From 31788545b110e39ee872439a375fd5778132b5af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Jul 2026 05:58:09 +0000 Subject: [PATCH] chore: update schemas and regenerate all SDK clients Auto-generated by schema-propagation workflow. Source: constructive-db@541c3a32ac3 --- .../src/admin/cli/commands.ts | 197 +- .../src/admin/cli/commands/app-admin-grant.ts | 350 +- .../admin/cli/commands/app-claimed-invite.ts | 350 +- .../src/admin/cli/commands/app-grant.ts | 385 +- .../src/admin/cli/commands/app-invite.ts | 689 ++-- .../cli/commands/app-membership-default.ts | 396 +- .../src/admin/cli/commands/app-membership.ts | 726 ++-- .../src/admin/cli/commands/app-owner-grant.ts | 350 +- .../commands/app-permission-default-grant.ts | 354 +- .../app-permission-default-permission.ts | 278 +- .../cli/commands/app-permission-default.ts | 266 +- .../src/admin/cli/commands/app-permission.ts | 372 +- .../commands/app-permissions-get-by-mask.ts | 81 +- .../app-permissions-get-mask-by-names.ts | 36 +- .../cli/commands/app-permissions-get-mask.ts | 36 +- .../app-permissions-get-padded-mask.ts | 36 +- .../src/admin/cli/commands/auth.ts | 105 +- .../src/admin/cli/commands/context.ts | 162 +- .../src/admin/cli/commands/membership-type.ts | 398 +- .../src/admin/cli/commands/org-admin-grant.ts | 384 +- .../admin/cli/commands/org-claimed-invite.ts | 384 +- .../src/admin/cli/commands/org-grant.ts | 419 ++- .../src/admin/cli/commands/org-invite.ts | 799 ++-- .../admin/cli/commands/org-member-profile.ts | 528 +-- .../src/admin/cli/commands/org-member.ts | 323 +- .../cli/commands/org-membership-default.ts | 392 +- .../cli/commands/org-membership-setting.ts | 658 ++-- .../src/admin/cli/commands/org-membership.ts | 798 ++-- .../src/admin/cli/commands/org-owner-grant.ts | 384 +- .../commands/org-permission-default-grant.ts | 388 +- .../org-permission-default-permission.ts | 312 +- .../cli/commands/org-permission-default.ts | 300 +- .../src/admin/cli/commands/org-permission.ts | 372 +- .../commands/org-permissions-get-by-mask.ts | 81 +- .../org-permissions-get-mask-by-names.ts | 36 +- .../cli/commands/org-permissions-get-mask.ts | 36 +- .../org-permissions-get-padded-mask.ts | 36 +- .../admin/cli/commands/provision-bucket.ts | 56 +- .../cli/commands/submit-app-invite-code.ts | 56 +- .../cli/commands/submit-org-invite-code.ts | 56 +- .../src/admin/cli/executor.ts | 12 +- sdk/constructive-cli/src/admin/cli/index.ts | 3 +- sdk/constructive-cli/src/admin/cli/utils.ts | 59 +- sdk/constructive-cli/src/admin/index.ts | 4 +- sdk/constructive-cli/src/admin/orm/client.ts | 43 +- sdk/constructive-cli/src/admin/orm/index.ts | 78 +- .../src/admin/orm/input-types.ts | 585 ++- .../src/admin/orm/models/appAdminGrant.ts | 275 +- .../src/admin/orm/models/appClaimedInvite.ts | 275 +- .../src/admin/orm/models/appGrant.ts | 275 +- .../src/admin/orm/models/appInvite.ts | 275 +- .../src/admin/orm/models/appMembership.ts | 275 +- .../admin/orm/models/appMembershipDefault.ts | 279 +- .../src/admin/orm/models/appOwnerGrant.ts | 275 +- .../src/admin/orm/models/appPermission.ts | 275 +- .../admin/orm/models/appPermissionDefault.ts | 279 +- .../orm/models/appPermissionDefaultGrant.ts | 279 +- .../models/appPermissionDefaultPermission.ts | 315 +- .../src/admin/orm/models/index.ts | 52 +- .../src/admin/orm/models/membershipType.ts | 275 +- .../src/admin/orm/models/orgAdminGrant.ts | 275 +- .../src/admin/orm/models/orgClaimedInvite.ts | 275 +- .../src/admin/orm/models/orgGrant.ts | 275 +- .../src/admin/orm/models/orgInvite.ts | 275 +- .../src/admin/orm/models/orgMember.ts | 275 +- .../src/admin/orm/models/orgMemberProfile.ts | 275 +- .../src/admin/orm/models/orgMembership.ts | 275 +- .../admin/orm/models/orgMembershipDefault.ts | 279 +- .../admin/orm/models/orgMembershipSetting.ts | 279 +- .../src/admin/orm/models/orgOwnerGrant.ts | 275 +- .../src/admin/orm/models/orgPermission.ts | 275 +- .../admin/orm/models/orgPermissionDefault.ts | 279 +- .../orm/models/orgPermissionDefaultGrant.ts | 279 +- .../models/orgPermissionDefaultPermission.ts | 315 +- .../src/admin/orm/mutation/index.ts | 151 +- .../src/admin/orm/query-builder.ts | 215 +- .../src/admin/orm/query/index.ts | 398 +- .../src/admin/orm/realtime.ts | 37 +- .../src/admin/orm/select-types.ts | 22 +- .../src/agent/cli/commands.ts | 89 +- .../src/agent/cli/commands/agent-message.ts | 490 +-- .../src/agent/cli/commands/agent-persona.ts | 604 +-- .../src/agent/cli/commands/agent-plan.ts | 449 ++- .../src/agent/cli/commands/agent-prompt.ts | 528 +-- .../cli/commands/agent-resource-chunk.ts | 488 +-- .../src/agent/cli/commands/agent-resource.ts | 870 +++-- .../src/agent/cli/commands/agent-task.ts | 715 ++-- .../src/agent/cli/commands/agent-thread.ts | 726 ++-- .../src/agent/cli/commands/agent.ts | 567 +-- .../src/agent/cli/commands/auth.ts | 105 +- .../src/agent/cli/commands/context.ts | 162 +- .../agent/cli/commands/provision-bucket.ts | 56 +- .../src/agent/cli/embedder.ts | 28 +- .../src/agent/cli/executor.ts | 12 +- sdk/constructive-cli/src/agent/cli/index.ts | 3 +- sdk/constructive-cli/src/agent/cli/utils.ts | 59 +- sdk/constructive-cli/src/agent/index.ts | 4 +- sdk/constructive-cli/src/agent/orm/client.ts | 43 +- sdk/constructive-cli/src/agent/orm/index.ts | 40 +- .../src/agent/orm/input-types.ts | 329 +- .../src/agent/orm/models/agent.ts | 275 +- .../src/agent/orm/models/agentMessage.ts | 275 +- .../src/agent/orm/models/agentPersona.ts | 275 +- .../src/agent/orm/models/agentPlan.ts | 275 +- .../src/agent/orm/models/agentPrompt.ts | 275 +- .../src/agent/orm/models/agentResource.ts | 275 +- .../agent/orm/models/agentResourceChunk.ts | 275 +- .../src/agent/orm/models/agentTask.ts | 275 +- .../src/agent/orm/models/agentThread.ts | 275 +- .../src/agent/orm/models/index.ts | 18 +- .../src/agent/orm/mutation/index.ts | 59 +- .../src/agent/orm/query-builder.ts | 215 +- .../src/agent/orm/realtime.ts | 37 +- .../src/agent/orm/select-types.ts | 22 +- sdk/constructive-cli/src/api/cli/commands.ts | 353 +- .../cli/commands/accept-database-transfer.ts | 56 +- .../src/api/cli/commands/api-module.ts | 369 +- .../src/api/cli/commands/api-schema-names.ts | 34 +- .../src/api/cli/commands/api-schema.ts | 335 +- .../src/api/cli/commands/api-setting.ts | 795 ++-- .../src/api/cli/commands/api.ts | 491 +-- .../cli/commands/apply-registry-defaults.ts | 45 +- .../src/api/cli/commands/apply-rls.ts | 54 +- .../src/api/cli/commands/ast-migration.ts | 303 +- .../src/api/cli/commands/auth.ts | 105 +- .../cli/commands/cancel-database-transfer.ts | 56 +- .../src/api/cli/commands/check-constraint.ts | 646 ++-- .../src/api/cli/commands/composite-type.ts | 550 +-- .../src/api/cli/commands/context.ts | 162 +- .../src/api/cli/commands/cors-setting.ts | 346 +- .../src/api/cli/commands/database-setting.ts | 840 +++-- .../src/api/cli/commands/database-transfer.ts | 642 ++-- .../src/api/cli/commands/database.ts | 461 +-- .../src/api/cli/commands/default-privilege.ts | 432 ++- .../src/api/cli/commands/domain-event.ts | 532 +-- .../api/cli/commands/domain-verification.ts | 730 ++-- .../src/api/cli/commands/domain.ts | 681 ++-- .../src/api/cli/commands/embedding-chunk.ts | 916 ++--- .../src/api/cli/commands/enum.ts | 547 +-- .../api/cli/commands/exclusion-constraint.ts | 696 ++-- .../src/api/cli/commands/field.ts | 1057 +++--- .../cli/commands/foreign-key-constraint.ts | 874 +++-- .../src/api/cli/commands/full-text-search.ts | 482 +-- .../src/api/cli/commands/function.ts | 319 +- .../src/api/cli/commands/hostname-binding.ts | 524 +-- .../src/api/cli/commands/http-route.ts | 597 +-- .../src/api/cli/commands/index.ts | 757 ++-- .../src/api/cli/commands/managed-domain.ts | 608 +-- .../api/cli/commands/node-type-registry.ts | 453 ++- .../src/api/cli/commands/partition.ts | 597 +-- .../api/cli/commands/platform-api-module.ts | 338 +- .../api/cli/commands/platform-api-schema.ts | 304 +- .../api/cli/commands/platform-api-setting.ts | 772 ++-- .../src/api/cli/commands/platform-api.ts | 460 +-- .../api/cli/commands/platform-cors-setting.ts | 320 +- .../api/cli/commands/platform-domain-event.ts | 506 +-- .../commands/platform-domain-verification.ts | 696 ++-- .../src/api/cli/commands/platform-domain.ts | 650 ++-- .../cli/commands/platform-managed-domain.ts | 582 +-- .../cli/commands/platform-site-metadatum.ts | 392 +- .../api/cli/commands/platform-site-module.ts | 346 +- .../api/cli/commands/platform-site-theme.ts | 304 +- .../src/api/cli/commands/platform-site.ts | 422 ++- .../src/api/cli/commands/policy.ts | 723 ++-- .../cli/commands/primary-key-constraint.ts | 654 ++-- .../src/api/cli/commands/provision-bucket.ts | 56 +- .../src/api/cli/commands/pubkey-setting.ts | 536 +-- .../cli/commands/reject-database-transfer.ts | 56 +- .../src/api/cli/commands/request-database.ts | 56 +- .../api/cli/commands/resolve-http-route.ts | 69 +- .../src/api/cli/commands/resolve-route.ts | 69 +- .../src/api/cli/commands/rls-setting.ts | 571 +-- .../src/api/cli/commands/route-binding.ts | 524 +-- .../src/api/cli/commands/route.ts | 605 +-- .../src/api/cli/commands/schema-grant.ts | 342 +- .../src/api/cli/commands/schema.ts | 601 +-- .../src/api/cli/commands/set-field-order.ts | 54 +- .../src/api/cli/commands/site-metadatum.ts | 418 ++- .../src/api/cli/commands/site-module.ts | 369 +- .../src/api/cli/commands/site-theme.ts | 335 +- .../src/api/cli/commands/site.ts | 453 +-- .../src/api/cli/commands/spatial-relation.ts | 592 +-- .../src/api/cli/commands/sql-action.ts | 300 +- .../src/api/cli/commands/table-grant.ts | 449 ++- .../src/api/cli/commands/table.ts | 947 ++--- .../src/api/cli/commands/trigger-function.ts | 342 +- .../src/api/cli/commands/trigger.ts | 529 +-- .../src/api/cli/commands/unique-constraint.ts | 684 ++-- .../src/api/cli/commands/view-grant.ts | 433 ++- .../src/api/cli/commands/view-rule.ts | 395 +- .../src/api/cli/commands/view-table.ts | 361 +- .../src/api/cli/commands/view.ts | 775 ++-- .../src/api/cli/commands/webauthn-setting.ts | 878 +++-- sdk/constructive-cli/src/api/cli/executor.ts | 12 +- sdk/constructive-cli/src/api/cli/index.ts | 3 +- sdk/constructive-cli/src/api/cli/utils.ts | 59 +- sdk/constructive-cli/src/api/index.ts | 4 +- sdk/constructive-cli/src/api/orm/client.ts | 43 +- sdk/constructive-cli/src/api/orm/index.ts | 156 +- .../src/api/orm/input-types.ts | 2008 +++++++++- .../src/api/orm/models/api.ts | 275 +- .../src/api/orm/models/apiModule.ts | 275 +- .../src/api/orm/models/apiSchema.ts | 275 +- .../src/api/orm/models/apiSetting.ts | 275 +- .../src/api/orm/models/astMigration.ts | 194 +- .../src/api/orm/models/checkConstraint.ts | 275 +- .../src/api/orm/models/compositeType.ts | 275 +- .../src/api/orm/models/corsSetting.ts | 275 +- .../src/api/orm/models/database.ts | 275 +- .../src/api/orm/models/databaseSetting.ts | 275 +- .../src/api/orm/models/databaseTransfer.ts | 275 +- .../src/api/orm/models/defaultPrivilege.ts | 275 +- .../src/api/orm/models/domain.ts | 275 +- .../src/api/orm/models/domainEvent.ts | 275 +- .../src/api/orm/models/domainVerification.ts | 275 +- .../src/api/orm/models/embeddingChunk.ts | 275 +- .../src/api/orm/models/enum.ts | 275 +- .../src/api/orm/models/exclusionConstraint.ts | 275 +- .../src/api/orm/models/field.ts | 275 +- .../api/orm/models/foreignKeyConstraint.ts | 279 +- .../src/api/orm/models/fullTextSearch.ts | 275 +- .../src/api/orm/models/function.ts | 275 +- .../src/api/orm/models/hostnameBinding.ts | 275 +- .../src/api/orm/models/httpRoute.ts | 275 +- .../src/api/orm/models/index.ts | 130 +- .../src/api/orm/models/indexModel.ts | 275 +- .../src/api/orm/models/managedDomain.ts | 275 +- .../src/api/orm/models/nodeTypeRegistry.ts | 275 +- .../src/api/orm/models/partition.ts | 275 +- .../src/api/orm/models/platformApi.ts | 275 +- .../src/api/orm/models/platformApiModule.ts | 275 +- .../src/api/orm/models/platformApiSchema.ts | 275 +- .../src/api/orm/models/platformApiSetting.ts | 275 +- .../src/api/orm/models/platformCorsSetting.ts | 275 +- .../src/api/orm/models/platformDomain.ts | 275 +- .../src/api/orm/models/platformDomainEvent.ts | 275 +- .../orm/models/platformDomainVerification.ts | 289 +- .../api/orm/models/platformManagedDomain.ts | 279 +- .../src/api/orm/models/platformSite.ts | 275 +- .../api/orm/models/platformSiteMetadatum.ts | 279 +- .../src/api/orm/models/platformSiteModule.ts | 275 +- .../src/api/orm/models/platformSiteTheme.ts | 275 +- .../src/api/orm/models/policy.ts | 275 +- .../api/orm/models/primaryKeyConstraint.ts | 279 +- .../src/api/orm/models/pubkeySetting.ts | 275 +- .../src/api/orm/models/rlsSetting.ts | 275 +- .../src/api/orm/models/route.ts | 275 +- .../src/api/orm/models/routeBinding.ts | 275 +- .../src/api/orm/models/schema.ts | 275 +- .../src/api/orm/models/schemaGrant.ts | 275 +- .../src/api/orm/models/site.ts | 275 +- .../src/api/orm/models/siteMetadatum.ts | 275 +- .../src/api/orm/models/siteModule.ts | 275 +- .../src/api/orm/models/siteTheme.ts | 275 +- .../src/api/orm/models/spatialRelation.ts | 275 +- .../src/api/orm/models/sqlAction.ts | 194 +- .../src/api/orm/models/table.ts | 275 +- .../src/api/orm/models/tableGrant.ts | 275 +- .../src/api/orm/models/trigger.ts | 275 +- .../src/api/orm/models/triggerFunction.ts | 275 +- .../src/api/orm/models/uniqueConstraint.ts | 275 +- .../src/api/orm/models/view.ts | 275 +- .../src/api/orm/models/viewGrant.ts | 275 +- .../src/api/orm/models/viewRule.ts | 275 +- .../src/api/orm/models/viewTable.ts | 275 +- .../src/api/orm/models/webauthnSetting.ts | 275 +- .../src/api/orm/mutation/index.ts | 335 +- .../src/api/orm/query-builder.ts | 215 +- .../src/api/orm/query/index.ts | 224 +- sdk/constructive-cli/src/api/orm/realtime.ts | 37 +- .../src/api/orm/select-types.ts | 22 +- sdk/constructive-cli/src/auth/cli/commands.ts | 241 +- .../src/auth/cli/commands/audit-log-auth.ts | 474 +-- .../src/auth/cli/commands/auth.ts | 105 +- .../src/auth/cli/commands/check-password.ts | 54 +- .../cli/commands/confirm-delete-account.ts | 56 +- .../src/auth/cli/commands/context.ts | 162 +- .../src/auth/cli/commands/create-api-key.ts | 54 +- .../auth/cli/commands/create-org-api-key.ts | 54 +- .../auth/cli/commands/create-org-principal.ts | 56 +- .../src/auth/cli/commands/crypto-address.ts | 422 ++- .../auth/cli/commands/current-ip-address.ts | 16 +- .../auth/cli/commands/current-user-agent.ts | 16 +- .../src/auth/cli/commands/current-user-id.ts | 16 +- .../src/auth/cli/commands/current-user.ts | 34 +- .../auth/cli/commands/delete-org-principal.ts | 56 +- .../src/auth/cli/commands/delete-principal.ts | 54 +- .../auth/cli/commands/disconnect-account.ts | 56 +- .../src/auth/cli/commands/email.ts | 419 ++- .../auth/cli/commands/extend-token-expires.ts | 56 +- .../src/auth/cli/commands/forgot-password.ts | 54 +- .../auth/cli/commands/identity-provider.ts | 176 +- .../src/auth/cli/commands/link-identity.ts | 54 +- .../src/auth/cli/commands/org-api-key-list.ts | 273 +- .../src/auth/cli/commands/phone-number.ts | 456 +-- .../src/auth/cli/commands/principal-entity.ts | 338 +- .../cli/commands/principal-scope-override.ts | 230 +- .../src/auth/cli/commands/principal.ts | 219 +- .../src/auth/cli/commands/provision-bucket.ts | 56 +- .../auth/cli/commands/provision-new-user.ts | 54 +- .../commands/request-cross-origin-token.ts | 56 +- .../src/auth/cli/commands/require-step-up.ts | 34 +- .../src/auth/cli/commands/reset-password.ts | 54 +- .../src/auth/cli/commands/revoke-api-key.ts | 54 +- .../auth/cli/commands/revoke-org-api-key.ts | 54 +- .../src/auth/cli/commands/revoke-session.ts | 54 +- .../src/auth/cli/commands/role-type.ts | 251 +- .../commands/send-account-deletion-email.ts | 56 +- .../cli/commands/send-verification-email.ts | 56 +- .../src/auth/cli/commands/set-password.ts | 54 +- .../auth/cli/commands/sign-in-cross-origin.ts | 56 +- .../src/auth/cli/commands/sign-in-sms-otp.ts | 54 +- .../src/auth/cli/commands/sign-in.ts | 54 +- .../src/auth/cli/commands/sign-out.ts | 54 +- .../src/auth/cli/commands/sign-up-sms.ts | 54 +- .../src/auth/cli/commands/sign-up.ts | 54 +- .../cli/commands/user-connected-account.ts | 213 +- .../src/auth/cli/commands/user.ts | 415 ++- .../src/auth/cli/commands/verify-email.ts | 54 +- .../src/auth/cli/commands/verify-password.ts | 54 +- .../src/auth/cli/commands/verify-totp.ts | 54 +- .../auth/cli/commands/webauthn-credential.ts | 646 ++-- sdk/constructive-cli/src/auth/cli/executor.ts | 12 +- sdk/constructive-cli/src/auth/cli/index.ts | 3 +- sdk/constructive-cli/src/auth/cli/utils.ts | 59 +- sdk/constructive-cli/src/auth/index.ts | 4 +- sdk/constructive-cli/src/auth/orm/client.ts | 43 +- sdk/constructive-cli/src/auth/orm/index.ts | 52 +- .../src/auth/orm/input-types.ts | 315 +- .../src/auth/orm/models/auditLogAuth.ts | 285 +- .../src/auth/orm/models/cryptoAddress.ts | 275 +- .../src/auth/orm/models/email.ts | 275 +- .../src/auth/orm/models/identityProvider.ts | 149 +- .../src/auth/orm/models/index.ts | 26 +- .../src/auth/orm/models/orgApiKeyList.ts | 194 +- .../src/auth/orm/models/phoneNumber.ts | 275 +- .../src/auth/orm/models/principal.ts | 194 +- .../src/auth/orm/models/principalEntity.ts | 275 +- .../auth/orm/models/principalScopeOverride.ts | 198 +- .../src/auth/orm/models/roleType.ts | 275 +- .../src/auth/orm/models/user.ts | 275 +- .../auth/orm/models/userConnectedAccount.ts | 198 +- .../src/auth/orm/models/webauthnCredential.ts | 275 +- .../src/auth/orm/mutation/index.ts | 1393 ++++--- .../src/auth/orm/query-builder.ts | 215 +- .../src/auth/orm/query/index.ts | 179 +- sdk/constructive-cli/src/auth/orm/realtime.ts | 37 +- .../src/auth/orm/select-types.ts | 22 +- .../src/compute/cli/commands.ts | 433 +-- .../compute/cli/commands/add-edge-and-save.ts | 54 +- .../src/compute/cli/commands/add-edge.ts | 54 +- .../compute/cli/commands/add-node-and-save.ts | 54 +- .../src/compute/cli/commands/add-node.ts | 54 +- .../src/compute/cli/commands/auth.ts | 105 +- .../src/compute/cli/commands/context.ts | 162 +- .../src/compute/cli/commands/copy-graph.ts | 54 +- .../src/compute/cli/commands/db-preset.ts | 529 +-- .../cli/commands/function-api-binding.ts | 372 +- .../cli/commands/function-definition.ts | 1572 ++++---- .../cli/commands/function-deployment-event.ts | 478 +-- .../cli/commands/function-deployment.ts | 954 ++--- .../cli/commands/function-execution-log.ts | 520 +-- .../cli/commands/function-graph-commit.ts | 537 +-- .../function-graph-execution-node-state.ts | 749 ++-- .../function-graph-execution-output.ts | 364 +- .../cli/commands/function-graph-execution.ts | 1409 +++---- .../cli/commands/function-graph-object.ts | 397 +- .../cli/commands/function-graph-ref.ts | 373 +- .../cli/commands/function-graph-store.ts | 342 +- .../compute/cli/commands/function-graph.ts | 542 +-- .../commands/function-invocation-attempt.ts | 656 ++-- .../cli/commands/function-invocation.ts | 938 ++--- .../cli/commands/get-all-tree-nodes-record.ts | 150 +- .../cli/commands/import-definitions.ts | 56 +- .../compute/cli/commands/import-graph-json.ts | 54 +- .../src/compute/cli/commands/infra-commit.ts | 529 +-- .../infra-get-all-tree-nodes-record.ts | 150 +- .../cli/commands/infra-init-empty-repo.ts | 56 +- .../cli/commands/infra-insert-node-at-path.ts | 56 +- .../src/compute/cli/commands/infra-object.ts | 389 +- .../src/compute/cli/commands/infra-ref.ts | 370 +- .../cli/commands/infra-set-data-at-path.ts | 56 +- .../src/compute/cli/commands/infra-store.ts | 331 +- .../compute/cli/commands/init-empty-repo.ts | 54 +- .../cli/commands/insert-node-at-path.ts | 56 +- .../cli/commands/integration-provider.ts | 578 +-- .../compute/cli/commands/namespace-event.ts | 470 +-- .../src/compute/cli/commands/namespace.ts | 601 +-- .../commands/platform-function-api-binding.ts | 372 +- .../commands/platform-function-definition.ts | 1614 ++++---- .../platform-function-deployment-event.ts | 449 ++- .../commands/platform-function-deployment.ts | 920 ++--- .../platform-function-execution-log.ts | 486 +-- .../platform-function-invocation-attempt.ts | 631 ++-- .../commands/platform-function-invocation.ts | 904 ++--- .../cli/commands/platform-infra-commit.ts | 537 +-- ...latform-infra-get-all-tree-nodes-record.ts | 154 +- .../platform-infra-init-empty-repo.ts | 56 +- .../platform-infra-insert-node-at-path.ts | 56 +- .../cli/commands/platform-infra-object.ts | 397 +- .../cli/commands/platform-infra-ref.ts | 373 +- .../platform-infra-set-data-at-path.ts | 56 +- .../cli/commands/platform-infra-store.ts | 342 +- .../cli/commands/platform-namespace-event.ts | 444 ++- .../cli/commands/platform-namespace.ts | 570 +-- .../platform-resource-declared-capacity.ts | 337 +- .../commands/platform-resource-definition.ts | 760 ++-- .../cli/commands/platform-resource-event.ts | 444 ++- .../platform-resource-installation.ts | 612 ++-- ...platform-resource-installations-install.ts | 56 +- ...latform-resource-installations-rollback.ts | 56 +- ...atform-resource-installations-uninstall.ts | 56 +- ...platform-resource-installations-upgrade.ts | 56 +- .../platform-resource-status-check.ts | 452 ++- .../commands/platform-resource-usage-log.ts | 531 +-- .../platform-resource-usage-summary.ts | 537 +-- .../commands/platform-resource-utilization.ts | 439 ++- .../compute/cli/commands/platform-resource.ts | 956 ++--- .../cli/commands/platform-resources-health.ts | 587 +-- .../platform-resources-requirements-state.ts | 239 +- ...platform-resources-resolved-requirement.ts | 294 +- .../cli/commands/platform-webhook-endpoint.ts | 604 +-- .../cli/commands/platform-webhook-event.ts | 574 +-- .../compute/cli/commands/provision-bucket.ts | 56 +- .../cli/commands/read-function-graph.ts | 36 +- .../commands/resource-declared-capacity.ts | 337 +- .../cli/commands/resource-definition.ts | 794 ++-- .../compute/cli/commands/resource-event.ts | 470 +-- .../cli/commands/resource-installation.ts | 646 ++-- .../resource-installations-install.ts | 56 +- .../resource-installations-rollback.ts | 56 +- .../resource-installations-uninstall.ts | 56 +- .../resource-installations-upgrade.ts | 56 +- .../cli/commands/resource-status-check.ts | 486 +-- .../cli/commands/resource-usage-log.ts | 557 +-- .../cli/commands/resource-usage-summary.ts | 571 +-- .../cli/commands/resource-utilization.ts | 439 ++- .../src/compute/cli/commands/resource.ts | 987 ++--- .../compute/cli/commands/resources-health.ts | 596 +-- .../commands/resources-requirements-state.ts | 235 +- .../resources-resolved-requirement.ts | 286 +- .../src/compute/cli/commands/save-graph.ts | 54 +- .../compute/cli/commands/set-data-at-path.ts | 54 +- .../compute/cli/commands/start-execution.ts | 54 +- .../cli/commands/validate-function-graph.ts | 56 +- .../compute/cli/commands/webhook-endpoint.ts | 630 ++-- .../src/compute/cli/commands/webhook-event.ts | 600 +-- .../src/compute/cli/executor.ts | 12 +- sdk/constructive-cli/src/compute/cli/index.ts | 3 +- sdk/constructive-cli/src/compute/cli/utils.ts | 59 +- sdk/constructive-cli/src/compute/index.ts | 4 +- .../src/compute/orm/client.ts | 43 +- sdk/constructive-cli/src/compute/orm/index.ts | 160 +- .../src/compute/orm/input-types.ts | 2194 ++++++++++- .../src/compute/orm/models/dbPreset.ts | 275 +- .../compute/orm/models/functionApiBinding.ts | 275 +- .../compute/orm/models/functionDefinition.ts | 275 +- .../compute/orm/models/functionDeployment.ts | 275 +- .../orm/models/functionDeploymentEvent.ts | 289 +- .../orm/models/functionExecutionLog.ts | 289 +- .../src/compute/orm/models/functionGraph.ts | 275 +- .../compute/orm/models/functionGraphCommit.ts | 285 +- .../orm/models/functionGraphExecution.ts | 289 +- .../models/functionGraphExecutionNodeState.ts | 325 +- .../models/functionGraphExecutionOutput.ts | 307 +- .../compute/orm/models/functionGraphObject.ts | 271 +- .../compute/orm/models/functionGraphRef.ts | 285 +- .../compute/orm/models/functionGraphStore.ts | 275 +- .../compute/orm/models/functionInvocation.ts | 285 +- .../orm/models/functionInvocationAttempt.ts | 289 +- .../orm/models/getAllTreeNodesRecord.ts | 149 +- .../src/compute/orm/models/index.ts | 134 +- .../src/compute/orm/models/infraCommit.ts | 285 +- .../orm/models/infraGetAllTreeNodesRecord.ts | 158 +- .../src/compute/orm/models/infraObject.ts | 271 +- .../src/compute/orm/models/infraRef.ts | 285 +- .../src/compute/orm/models/infraStore.ts | 275 +- .../compute/orm/models/integrationProvider.ts | 275 +- .../src/compute/orm/models/namespace.ts | 275 +- .../src/compute/orm/models/namespaceEvent.ts | 285 +- .../orm/models/platformFunctionApiBinding.ts | 289 +- .../orm/models/platformFunctionDefinition.ts | 289 +- .../orm/models/platformFunctionDeployment.ts | 289 +- .../models/platformFunctionDeploymentEvent.ts | 325 +- .../models/platformFunctionExecutionLog.ts | 307 +- .../orm/models/platformFunctionInvocation.ts | 299 +- .../platformFunctionInvocationAttempt.ts | 327 +- .../compute/orm/models/platformInfraCommit.ts | 285 +- .../platformInfraGetAllTreeNodesRecord.ts | 174 +- .../compute/orm/models/platformInfraObject.ts | 271 +- .../compute/orm/models/platformInfraRef.ts | 285 +- .../compute/orm/models/platformInfraStore.ts | 275 +- .../compute/orm/models/platformNamespace.ts | 275 +- .../orm/models/platformNamespaceEvent.ts | 289 +- .../compute/orm/models/platformResource.ts | 275 +- .../platformResourceDeclaredCapacity.ts | 175 +- .../orm/models/platformResourceDefinition.ts | 289 +- .../orm/models/platformResourceEvent.ts | 289 +- .../models/platformResourceInstallation.ts | 297 +- .../orm/models/platformResourceStatusCheck.ts | 293 +- .../orm/models/platformResourceUsageLog.ts | 289 +- .../models/platformResourceUsageSummary.ts | 307 +- .../orm/models/platformResourceUtilization.ts | 162 +- .../orm/models/platformResourcesHealth.ts | 198 +- .../platformResourcesRequirementsState.ts | 175 +- .../platformResourcesResolvedRequirement.ts | 175 +- .../orm/models/platformWebhookEndpoint.ts | 279 +- .../orm/models/platformWebhookEvent.ts | 279 +- .../src/compute/orm/models/resource.ts | 275 +- .../orm/models/resourceDeclaredCapacity.ts | 153 +- .../compute/orm/models/resourceDefinition.ts | 275 +- .../src/compute/orm/models/resourceEvent.ts | 285 +- .../orm/models/resourceInstallation.ts | 279 +- .../compute/orm/models/resourceStatusCheck.ts | 275 +- .../compute/orm/models/resourceUsageLog.ts | 285 +- .../orm/models/resourceUsageSummary.ts | 289 +- .../compute/orm/models/resourceUtilization.ts | 149 +- .../src/compute/orm/models/resourcesHealth.ts | 194 +- .../orm/models/resourcesRequirementsState.ts | 158 +- .../models/resourcesResolvedRequirement.ts | 166 +- .../src/compute/orm/models/webhookEndpoint.ts | 275 +- .../src/compute/orm/models/webhookEvent.ts | 275 +- .../src/compute/orm/mutation/index.ts | 1336 +++++-- .../src/compute/orm/query-builder.ts | 215 +- .../src/compute/orm/query/index.ts | 53 +- .../src/compute/orm/realtime.ts | 37 +- .../src/compute/orm/select-types.ts | 22 +- .../src/config/cli/commands.ts | 121 +- .../src/config/cli/commands/auth.ts | 105 +- .../src/config/cli/commands/config.ts | 563 +-- .../src/config/cli/commands/context.ts | 162 +- .../config/cli/commands/platform-config.ts | 532 +-- .../cli/commands/platform-internal-secret.ts | 247 +- .../commands/platform-internal-secrets-del.ts | 56 +- .../platform-internal-secrets-remove-array.ts | 56 +- .../platform-internal-secrets-rotate.ts | 56 +- .../commands/platform-internal-secrets-set.ts | 56 +- .../config/cli/commands/platform-secret.ts | 256 +- .../cli/commands/platform-secrets-del.ts | 56 +- .../commands/platform-secrets-remove-array.ts | 56 +- .../cli/commands/platform-secrets-rotate.ts | 56 +- .../cli/commands/platform-secrets-set.ts | 56 +- .../config/cli/commands/provision-bucket.ts | 56 +- .../src/config/cli/commands/secret.ts | 270 +- .../src/config/cli/commands/secrets-del.ts | 54 +- .../cli/commands/secrets-remove-array.ts | 56 +- .../src/config/cli/commands/secrets-rotate.ts | 54 +- .../src/config/cli/commands/secrets-set.ts | 54 +- .../src/config/cli/executor.ts | 12 +- sdk/constructive-cli/src/config/cli/index.ts | 3 +- sdk/constructive-cli/src/config/cli/utils.ts | 59 +- sdk/constructive-cli/src/config/index.ts | 4 +- sdk/constructive-cli/src/config/orm/client.ts | 43 +- sdk/constructive-cli/src/config/orm/index.ts | 32 +- .../src/config/orm/input-types.ts | 136 +- .../src/config/orm/models/config.ts | 275 +- .../src/config/orm/models/index.ts | 10 +- .../src/config/orm/models/platformConfig.ts | 275 +- .../orm/models/platformInternalSecret.ts | 198 +- .../src/config/orm/models/platformSecret.ts | 194 +- .../src/config/orm/models/secret.ts | 194 +- .../src/config/orm/mutation/index.ts | 617 +++- .../src/config/orm/query-builder.ts | 215 +- .../src/config/orm/realtime.ts | 37 +- .../src/config/orm/select-types.ts | 22 +- sdk/constructive-cli/src/index.ts | 24 +- .../src/infra/cli/commands.ts | 105 +- .../src/infra/cli/commands/auth.ts | 105 +- .../src/infra/cli/commands/context.ts | 162 +- .../src/infra/cli/commands/db-preset.ts | 529 +-- .../src/infra/cli/commands/namespace-event.ts | 470 +-- .../src/infra/cli/commands/namespace.ts | 601 +-- .../cli/commands/platform-infra-commit.ts | 537 +-- ...latform-infra-get-all-tree-nodes-record.ts | 154 +- .../platform-infra-init-empty-repo.ts | 56 +- .../platform-infra-insert-node-at-path.ts | 56 +- .../cli/commands/platform-infra-object.ts | 397 +- .../infra/cli/commands/platform-infra-ref.ts | 373 +- .../platform-infra-set-data-at-path.ts | 56 +- .../cli/commands/platform-infra-store.ts | 342 +- .../cli/commands/platform-namespace-event.ts | 444 ++- .../infra/cli/commands/platform-namespace.ts | 570 +-- .../infra/cli/commands/provision-bucket.ts | 56 +- .../src/infra/cli/executor.ts | 12 +- sdk/constructive-cli/src/infra/cli/index.ts | 3 +- sdk/constructive-cli/src/infra/cli/utils.ts | 59 +- sdk/constructive-cli/src/infra/index.ts | 4 +- sdk/constructive-cli/src/infra/orm/client.ts | 43 +- sdk/constructive-cli/src/infra/orm/index.ts | 42 +- .../src/infra/orm/input-types.ts | 214 +- .../src/infra/orm/models/dbPreset.ts | 275 +- .../src/infra/orm/models/index.ts | 20 +- .../src/infra/orm/models/namespace.ts | 275 +- .../src/infra/orm/models/namespaceEvent.ts | 285 +- .../infra/orm/models/platformInfraCommit.ts | 285 +- .../platformInfraGetAllTreeNodesRecord.ts | 174 +- .../infra/orm/models/platformInfraObject.ts | 271 +- .../src/infra/orm/models/platformInfraRef.ts | 285 +- .../infra/orm/models/platformInfraStore.ts | 275 +- .../src/infra/orm/models/platformNamespace.ts | 275 +- .../orm/models/platformNamespaceEvent.ts | 289 +- .../src/infra/orm/mutation/index.ts | 200 +- .../src/infra/orm/query-builder.ts | 215 +- .../src/infra/orm/realtime.ts | 37 +- .../src/infra/orm/select-types.ts | 22 +- .../src/modules/cli/commands.ts | 397 +- .../src/modules/cli/commands/agent-module.ts | 1542 ++++---- .../cli/commands/api-surface-module.ts | 1086 +++--- .../src/modules/cli/commands/app-module.ts | 931 ++--- .../src/modules/cli/commands/auth.ts | 105 +- .../modules/cli/commands/billing-module.ts | 1204 +++--- .../cli/commands/billing-provider-module.ts | 1022 +++--- .../cli/commands/blueprint-construction.ts | 540 +-- .../cli/commands/blueprint-template.ts | 866 +++-- .../src/modules/cli/commands/blueprint.ts | 555 +-- .../modules/cli/commands/catalog-module.ts | 1276 ++++--- .../cli/commands/compute-log-module.ts | 934 ++--- .../commands/config-secrets-user-module.ts | 490 +-- .../cli/commands/connected-accounts-module.ts | 524 +-- .../cli/commands/construct-blueprint.ts | 56 +- .../src/modules/cli/commands/context.ts | 162 +- .../commands/copy-template-to-blueprint.ts | 56 +- .../cli/commands/crypto-addresses-module.ts | 562 +-- .../cli/commands/crypto-auth-module.ts | 706 ++-- .../cli/commands/database-provision-module.ts | 840 +++-- .../cli/commands/database-settings-module.ts | 980 ++--- .../modules/cli/commands/db-pool-config.ts | 490 +-- .../src/modules/cli/commands/db-pool.ts | 609 ++-- .../modules/cli/commands/db-preset-module.ts | 778 ++-- .../modules/cli/commands/db-usage-module.ts | 1204 +++--- .../cli/commands/default-ids-module.ts | 254 +- .../cli/commands/denormalized-table-field.ts | 626 ++-- .../modules/cli/commands/devices-module.ts | 444 ++- .../src/modules/cli/commands/domain-module.ts | 1086 +++--- .../src/modules/cli/commands/emails-module.ts | 516 +-- .../cli/commands/entity-type-provision.ts | 1660 +++++---- .../src/modules/cli/commands/events-module.ts | 1846 +++++----- .../commands/function-deployment-module.ts | 980 ++--- .../commands/function-invocation-module.ts | 980 ++--- .../modules/cli/commands/function-module.ts | 972 ++--- .../cli/commands/graph-execution-module.ts | 1022 +++--- .../src/modules/cli/commands/graph-module.ts | 824 +++-- .../modules/cli/commands/hierarchy-module.ts | 1010 ++--- .../modules/cli/commands/http-route-module.ts | 972 ++--- .../src/modules/cli/commands/i-18-n-module.ts | 441 ++- .../cli/commands/identity-providers-module.ts | 714 ++-- .../cli/commands/inference-log-module.ts | 942 ++--- .../cli/commands/infra-config-module.ts | 782 ++-- .../cli/commands/infra-secrets-module.ts | 790 ++-- .../commands/integration-providers-module.ts | 714 ++-- .../cli/commands/internal-secrets-module.ts | 790 ++-- .../modules/cli/commands/invites-module.ts | 896 ++--- .../src/modules/cli/commands/limits-module.ts | 1580 ++++---- .../cli/commands/membership-types-module.ts | 376 +- .../cli/commands/memberships-module.ts | 1770 ++++----- .../cli/commands/merkle-store-module.ts | 828 +++-- .../modules/cli/commands/namespace-module.ts | 896 ++--- .../cli/commands/notifications-module.ts | 1098 +++--- .../cli/commands/permissions-module.ts | 1010 ++--- .../cli/commands/phone-numbers-module.ts | 524 +-- .../src/modules/cli/commands/plans-module.ts | 976 ++--- .../cli/commands/principal-auth-module.ts | 870 +++-- .../modules/cli/commands/profiles-module.ts | 1124 +++--- .../modules/cli/commands/provision-bucket.ts | 56 +- .../commands/provision-check-constraint.ts | 56 +- .../commands/provision-full-text-search.ts | 56 +- .../modules/cli/commands/provision-index.ts | 56 +- .../cli/commands/provision-relation.ts | 56 +- .../commands/provision-spatial-relation.ts | 56 +- .../modules/cli/commands/provision-table.ts | 56 +- .../commands/provision-unique-constraint.ts | 56 +- .../cli/commands/rate-limit-meters-module.ts | 832 +++-- .../cli/commands/rate-limits-module.ts | 520 +-- .../modules/cli/commands/realtime-module.ts | 710 ++-- .../cli/commands/relation-provision.ts | 1078 +++--- .../cli/commands/resolve-blueprint-field.ts | 54 +- .../cli/commands/resolve-blueprint-table.ts | 72 +- .../modules/cli/commands/resource-module.ts | 1542 ++++---- .../src/modules/cli/commands/rls-module.ts | 669 ++-- .../src/modules/cli/commands/route-module.ts | 1086 +++--- .../cli/commands/secure-table-provision.ts | 604 +-- .../cli/commands/session-secrets-module.ts | 414 ++- .../modules/cli/commands/sessions-module.ts | 596 +-- .../cli/commands/site-surface-module.ts | 1010 ++--- .../cli/commands/storage-log-module.ts | 934 ++--- .../modules/cli/commands/storage-module.ts | 1694 +++++---- .../cli/commands/transfer-log-module.ts | 934 ++--- .../modules/cli/commands/user-auth-module.ts | 1242 ++++--- .../cli/commands/user-credentials-module.ts | 452 ++- .../cli/commands/user-settings-module.ts | 452 ++- .../modules/cli/commands/user-state-module.ts | 406 ++- .../src/modules/cli/commands/users-module.ts | 520 +-- .../cli/commands/webauthn-auth-module.ts | 794 ++-- .../commands/webauthn-credentials-module.ts | 528 +-- .../modules/cli/commands/webhook-module.ts | 1048 +++--- .../src/modules/cli/executor.ts | 12 +- sdk/constructive-cli/src/modules/cli/index.ts | 3 +- sdk/constructive-cli/src/modules/cli/utils.ts | 59 +- sdk/constructive-cli/src/modules/index.ts | 4 +- .../src/modules/orm/client.ts | 43 +- sdk/constructive-cli/src/modules/orm/index.ts | 176 +- .../src/modules/orm/input-types.ts | 3231 +++++++++++++++- .../src/modules/orm/models/agentModule.ts | 275 +- .../modules/orm/models/apiSurfaceModule.ts | 275 +- .../src/modules/orm/models/appModule.ts | 275 +- .../src/modules/orm/models/billingModule.ts | 275 +- .../orm/models/billingProviderModule.ts | 279 +- .../src/modules/orm/models/blueprint.ts | 275 +- .../orm/models/blueprintConstruction.ts | 279 +- .../modules/orm/models/blueprintTemplate.ts | 275 +- .../src/modules/orm/models/catalogModule.ts | 275 +- .../modules/orm/models/computeLogModule.ts | 275 +- .../orm/models/configSecretsUserModule.ts | 279 +- .../orm/models/connectedAccountsModule.ts | 279 +- .../orm/models/cryptoAddressesModule.ts | 279 +- .../modules/orm/models/cryptoAuthModule.ts | 275 +- .../orm/models/databaseProvisionModule.ts | 279 +- .../orm/models/databaseSettingsModule.ts | 279 +- .../src/modules/orm/models/dbPool.ts | 275 +- .../src/modules/orm/models/dbPoolConfig.ts | 275 +- .../src/modules/orm/models/dbPresetModule.ts | 275 +- .../src/modules/orm/models/dbUsageModule.ts | 275 +- .../modules/orm/models/defaultIdsModule.ts | 275 +- .../orm/models/denormalizedTableField.ts | 279 +- .../src/modules/orm/models/devicesModule.ts | 275 +- .../src/modules/orm/models/domainModule.ts | 275 +- .../src/modules/orm/models/emailsModule.ts | 275 +- .../modules/orm/models/entityTypeProvision.ts | 275 +- .../src/modules/orm/models/eventsModule.ts | 275 +- .../orm/models/functionDeploymentModule.ts | 279 +- .../orm/models/functionInvocationModule.ts | 279 +- .../src/modules/orm/models/functionModule.ts | 275 +- .../orm/models/graphExecutionModule.ts | 279 +- .../src/modules/orm/models/graphModule.ts | 275 +- .../src/modules/orm/models/hierarchyModule.ts | 275 +- .../src/modules/orm/models/httpRouteModule.ts | 275 +- .../src/modules/orm/models/i18NModule.ts | 275 +- .../orm/models/identityProvidersModule.ts | 279 +- .../src/modules/orm/models/index.ts | 150 +- .../modules/orm/models/inferenceLogModule.ts | 275 +- .../modules/orm/models/infraConfigModule.ts | 275 +- .../modules/orm/models/infraSecretsModule.ts | 275 +- .../orm/models/integrationProvidersModule.ts | 289 +- .../orm/models/internalSecretsModule.ts | 279 +- .../src/modules/orm/models/invitesModule.ts | 275 +- .../src/modules/orm/models/limitsModule.ts | 275 +- .../orm/models/membershipTypesModule.ts | 279 +- .../modules/orm/models/membershipsModule.ts | 275 +- .../modules/orm/models/merkleStoreModule.ts | 275 +- .../src/modules/orm/models/namespaceModule.ts | 275 +- .../modules/orm/models/notificationsModule.ts | 275 +- .../modules/orm/models/permissionsModule.ts | 275 +- .../modules/orm/models/phoneNumbersModule.ts | 275 +- .../src/modules/orm/models/plansModule.ts | 275 +- .../modules/orm/models/principalAuthModule.ts | 275 +- .../src/modules/orm/models/profilesModule.ts | 275 +- .../orm/models/rateLimitMetersModule.ts | 279 +- .../modules/orm/models/rateLimitsModule.ts | 275 +- .../src/modules/orm/models/realtimeModule.ts | 275 +- .../modules/orm/models/relationProvision.ts | 275 +- .../src/modules/orm/models/resourceModule.ts | 275 +- .../src/modules/orm/models/rlsModule.ts | 275 +- .../src/modules/orm/models/routeModule.ts | 275 +- .../orm/models/secureTableProvision.ts | 279 +- .../orm/models/sessionSecretsModule.ts | 279 +- .../src/modules/orm/models/sessionsModule.ts | 275 +- .../modules/orm/models/siteSurfaceModule.ts | 275 +- .../modules/orm/models/storageLogModule.ts | 275 +- .../src/modules/orm/models/storageModule.ts | 275 +- .../modules/orm/models/transferLogModule.ts | 275 +- .../src/modules/orm/models/userAuthModule.ts | 275 +- .../orm/models/userCredentialsModule.ts | 279 +- .../modules/orm/models/userSettingsModule.ts | 275 +- .../src/modules/orm/models/userStateModule.ts | 275 +- .../src/modules/orm/models/usersModule.ts | 275 +- .../modules/orm/models/webauthnAuthModule.ts | 275 +- .../orm/models/webauthnCredentialsModule.ts | 279 +- .../src/modules/orm/models/webhookModule.ts | 275 +- .../src/modules/orm/mutation/index.ts | 473 ++- .../src/modules/orm/query-builder.ts | 215 +- .../src/modules/orm/query/index.ts | 138 +- .../src/modules/orm/realtime.ts | 37 +- .../src/modules/orm/select-types.ts | 22 +- .../src/objects/cli/commands.ts | 85 +- .../src/objects/cli/commands/auth.ts | 105 +- .../src/objects/cli/commands/commit.ts | 526 +-- .../src/objects/cli/commands/context.ts | 162 +- .../cli/commands/get-all-tree-nodes-record.ts | 150 +- .../objects/cli/commands/init-empty-repo.ts | 54 +- .../cli/commands/insert-node-at-path.ts | 56 +- .../src/objects/cli/commands/object.ts | 386 +- .../objects/cli/commands/provision-bucket.ts | 56 +- .../src/objects/cli/commands/ref.ts | 370 +- .../objects/cli/commands/set-data-at-path.ts | 54 +- .../src/objects/cli/commands/store.ts | 331 +- .../src/objects/cli/executor.ts | 12 +- sdk/constructive-cli/src/objects/cli/index.ts | 3 +- sdk/constructive-cli/src/objects/cli/utils.ts | 59 +- sdk/constructive-cli/src/objects/index.ts | 4 +- .../src/objects/orm/client.ts | 43 +- sdk/constructive-cli/src/objects/orm/index.ts | 32 +- .../src/objects/orm/input-types.ts | 84 +- .../src/objects/orm/models/commit.ts | 285 +- .../orm/models/getAllTreeNodesRecord.ts | 149 +- .../src/objects/orm/models/index.ts | 10 +- .../src/objects/orm/models/object.ts | 271 +- .../src/objects/orm/models/ref.ts | 285 +- .../src/objects/orm/models/store.ts | 275 +- .../src/objects/orm/mutation/index.ts | 197 +- .../src/objects/orm/query-builder.ts | 215 +- .../src/objects/orm/realtime.ts | 37 +- .../src/objects/orm/select-types.ts | 22 +- .../src/usage/cli/commands.ts | 141 +- .../src/usage/cli/commands/app-limit-cap.ts | 326 +- .../cli/commands/app-limit-caps-default.ts | 300 +- .../commands/app-limit-credit-code-item.ts | 368 +- .../cli/commands/app-limit-credit-code.ts | 376 +- .../commands/app-limit-credit-redemption.ts | 372 +- .../usage/cli/commands/app-limit-credit.ts | 402 +- .../usage/cli/commands/app-limit-default.ts | 330 +- .../src/usage/cli/commands/app-limit-event.ts | 672 ++-- .../usage/cli/commands/app-limit-warning.ts | 356 +- .../src/usage/cli/commands/app-limit.ts | 669 ++-- .../src/usage/cli/commands/auth.ts | 105 +- .../src/usage/cli/commands/context.ts | 162 +- .../usage/cli/commands/org-limit-aggregate.ts | 710 ++-- .../src/usage/cli/commands/org-limit-cap.ts | 326 +- .../cli/commands/org-limit-caps-default.ts | 300 +- .../usage/cli/commands/org-limit-credit.ts | 516 +-- .../usage/cli/commands/org-limit-default.ts | 330 +- .../src/usage/cli/commands/org-limit-event.ts | 672 ++-- .../usage/cli/commands/org-limit-warning.ts | 394 +- .../src/usage/cli/commands/org-limit.ts | 703 ++-- .../usage/cli/commands/provision-bucket.ts | 56 +- .../commands/seed-app-limit-caps-defaults.ts | 56 +- .../cli/commands/seed-app-limit-defaults.ts | 56 +- .../commands/seed-org-limit-caps-defaults.ts | 56 +- .../cli/commands/seed-org-limit-defaults.ts | 56 +- .../src/usage/cli/executor.ts | 12 +- sdk/constructive-cli/src/usage/cli/index.ts | 3 +- sdk/constructive-cli/src/usage/cli/utils.ts | 59 +- sdk/constructive-cli/src/usage/index.ts | 4 +- sdk/constructive-cli/src/usage/orm/client.ts | 43 +- sdk/constructive-cli/src/usage/orm/index.ts | 58 +- .../src/usage/orm/input-types.ts | 376 +- .../src/usage/orm/models/appLimit.ts | 275 +- .../src/usage/orm/models/appLimitCap.ts | 275 +- .../usage/orm/models/appLimitCapsDefault.ts | 275 +- .../src/usage/orm/models/appLimitCredit.ts | 275 +- .../usage/orm/models/appLimitCreditCode.ts | 275 +- .../orm/models/appLimitCreditCodeItem.ts | 279 +- .../orm/models/appLimitCreditRedemption.ts | 279 +- .../src/usage/orm/models/appLimitDefault.ts | 275 +- .../src/usage/orm/models/appLimitEvent.ts | 285 +- .../src/usage/orm/models/appLimitWarning.ts | 275 +- .../src/usage/orm/models/index.ts | 36 +- .../src/usage/orm/models/orgLimit.ts | 275 +- .../src/usage/orm/models/orgLimitAggregate.ts | 275 +- .../src/usage/orm/models/orgLimitCap.ts | 275 +- .../usage/orm/models/orgLimitCapsDefault.ts | 275 +- .../src/usage/orm/models/orgLimitCredit.ts | 275 +- .../src/usage/orm/models/orgLimitDefault.ts | 275 +- .../src/usage/orm/models/orgLimitEvent.ts | 285 +- .../src/usage/orm/models/orgLimitWarning.ts | 275 +- .../src/usage/orm/mutation/index.ts | 243 +- .../src/usage/orm/query-builder.ts | 215 +- .../src/usage/orm/realtime.ts | 37 +- .../src/usage/orm/select-types.ts | 22 +- .../src/admin/hooks/client.ts | 4 +- .../src/admin/hooks/index.ts | 24 +- .../src/admin/hooks/invalidation.ts | 926 +++-- .../src/admin/hooks/mutation-keys.ts | 310 +- .../src/admin/hooks/mutations/index.ts | 162 +- .../useCreateAppAdminGrantMutation.ts | 99 +- .../useCreateAppClaimedInviteMutation.ts | 102 +- .../mutations/useCreateAppGrantMutation.ts | 99 +- .../mutations/useCreateAppInviteMutation.ts | 99 +- .../useCreateAppMembershipDefaultMutation.ts | 102 +- .../useCreateAppMembershipMutation.ts | 99 +- .../useCreateAppOwnerGrantMutation.ts | 99 +- ...CreateAppPermissionDefaultGrantMutation.ts | 108 +- .../useCreateAppPermissionDefaultMutation.ts | 102 +- ...eAppPermissionDefaultPermissionMutation.ts | 116 +- .../useCreateAppPermissionMutation.ts | 99 +- .../useCreateMembershipTypeMutation.ts | 102 +- .../useCreateOrgAdminGrantMutation.ts | 99 +- .../useCreateOrgClaimedInviteMutation.ts | 102 +- .../mutations/useCreateOrgGrantMutation.ts | 99 +- .../mutations/useCreateOrgInviteMutation.ts | 99 +- .../mutations/useCreateOrgMemberMutation.ts | 99 +- .../useCreateOrgMemberProfileMutation.ts | 102 +- .../useCreateOrgMembershipDefaultMutation.ts | 102 +- .../useCreateOrgMembershipMutation.ts | 99 +- .../useCreateOrgMembershipSettingMutation.ts | 102 +- .../useCreateOrgOwnerGrantMutation.ts | 99 +- ...CreateOrgPermissionDefaultGrantMutation.ts | 108 +- .../useCreateOrgPermissionDefaultMutation.ts | 102 +- ...eOrgPermissionDefaultPermissionMutation.ts | 116 +- .../useCreateOrgPermissionMutation.ts | 99 +- .../useDeleteAppAdminGrantMutation.ts | 120 +- .../useDeleteAppClaimedInviteMutation.ts | 120 +- .../mutations/useDeleteAppGrantMutation.ts | 120 +- .../mutations/useDeleteAppInviteMutation.ts | 120 +- .../useDeleteAppMembershipDefaultMutation.ts | 126 +- .../useDeleteAppMembershipMutation.ts | 120 +- .../useDeleteAppOwnerGrantMutation.ts | 120 +- ...DeleteAppPermissionDefaultGrantMutation.ts | 128 +- .../useDeleteAppPermissionDefaultMutation.ts | 126 +- ...eAppPermissionDefaultPermissionMutation.ts | 134 +- .../useDeleteAppPermissionMutation.ts | 120 +- .../useDeleteMembershipTypeMutation.ts | 120 +- .../useDeleteOrgAdminGrantMutation.ts | 120 +- .../useDeleteOrgClaimedInviteMutation.ts | 120 +- .../mutations/useDeleteOrgGrantMutation.ts | 120 +- .../mutations/useDeleteOrgInviteMutation.ts | 120 +- .../mutations/useDeleteOrgMemberMutation.ts | 120 +- .../useDeleteOrgMemberProfileMutation.ts | 120 +- .../useDeleteOrgMembershipDefaultMutation.ts | 126 +- .../useDeleteOrgMembershipMutation.ts | 120 +- .../useDeleteOrgMembershipSettingMutation.ts | 126 +- .../useDeleteOrgOwnerGrantMutation.ts | 120 +- ...DeleteOrgPermissionDefaultGrantMutation.ts | 128 +- .../useDeleteOrgPermissionDefaultMutation.ts | 126 +- ...eOrgPermissionDefaultPermissionMutation.ts | 134 +- .../useDeleteOrgPermissionMutation.ts | 120 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../useSubmitAppInviteCodeMutation.ts | 76 +- .../useSubmitOrgInviteCodeMutation.ts | 76 +- .../useUpdateAppAdminGrantMutation.ts | 134 +- .../useUpdateAppClaimedInviteMutation.ts | 134 +- .../mutations/useUpdateAppGrantMutation.ts | 130 +- .../mutations/useUpdateAppInviteMutation.ts | 138 +- .../useUpdateAppMembershipDefaultMutation.ts | 134 +- .../useUpdateAppMembershipMutation.ts | 134 +- .../useUpdateAppOwnerGrantMutation.ts | 134 +- ...UpdateAppPermissionDefaultGrantMutation.ts | 136 +- .../useUpdateAppPermissionDefaultMutation.ts | 134 +- ...eAppPermissionDefaultPermissionMutation.ts | 142 +- .../useUpdateAppPermissionMutation.ts | 134 +- .../useUpdateMembershipTypeMutation.ts | 134 +- .../useUpdateOrgAdminGrantMutation.ts | 134 +- .../useUpdateOrgClaimedInviteMutation.ts | 134 +- .../mutations/useUpdateOrgGrantMutation.ts | 130 +- .../mutations/useUpdateOrgInviteMutation.ts | 138 +- .../mutations/useUpdateOrgMemberMutation.ts | 138 +- .../useUpdateOrgMemberProfileMutation.ts | 134 +- .../useUpdateOrgMembershipDefaultMutation.ts | 134 +- .../useUpdateOrgMembershipMutation.ts | 134 +- .../useUpdateOrgMembershipSettingMutation.ts | 134 +- .../useUpdateOrgOwnerGrantMutation.ts | 134 +- ...UpdateOrgPermissionDefaultGrantMutation.ts | 136 +- .../useUpdateOrgPermissionDefaultMutation.ts | 134 +- ...eOrgPermissionDefaultPermissionMutation.ts | 142 +- .../useUpdateOrgPermissionMutation.ts | 134 +- .../src/admin/hooks/queries/index.ts | 120 +- .../hooks/queries/useAppAdminGrantQuery.ts | 131 +- .../hooks/queries/useAppAdminGrantsQuery.ts | 131 +- .../hooks/queries/useAppClaimedInviteQuery.ts | 131 +- .../queries/useAppClaimedInvitesQuery.ts | 145 +- .../admin/hooks/queries/useAppGrantQuery.ts | 131 +- .../admin/hooks/queries/useAppGrantsQuery.ts | 125 +- .../admin/hooks/queries/useAppInviteQuery.ts | 131 +- .../admin/hooks/queries/useAppInvitesQuery.ts | 125 +- .../queries/useAppMembershipDefaultQuery.ts | 137 +- .../queries/useAppMembershipDefaultsQuery.ts | 162 +- .../hooks/queries/useAppMembershipQuery.ts | 131 +- .../hooks/queries/useAppMembershipsQuery.ts | 131 +- .../hooks/queries/useAppOwnerGrantQuery.ts | 131 +- .../hooks/queries/useAppOwnerGrantsQuery.ts | 131 +- .../useAppPermissionDefaultGrantQuery.ts | 146 +- .../useAppPermissionDefaultGrantsQuery.ts | 168 +- .../useAppPermissionDefaultPermissionQuery.ts | 154 +- ...useAppPermissionDefaultPermissionsQuery.ts | 180 +- .../queries/useAppPermissionDefaultQuery.ts | 137 +- .../queries/useAppPermissionDefaultsQuery.ts | 162 +- .../hooks/queries/useAppPermissionQuery.ts | 131 +- .../useAppPermissionsGetByMaskQuery.ts | 94 +- .../useAppPermissionsGetMaskByNamesQuery.ts | 92 +- .../queries/useAppPermissionsGetMaskQuery.ts | 92 +- .../useAppPermissionsGetPaddedMaskQuery.ts | 92 +- .../hooks/queries/useAppPermissionsQuery.ts | 131 +- .../hooks/queries/useMembershipTypeQuery.ts | 131 +- .../hooks/queries/useMembershipTypesQuery.ts | 139 +- .../hooks/queries/useOrgAdminGrantQuery.ts | 131 +- .../hooks/queries/useOrgAdminGrantsQuery.ts | 131 +- .../hooks/queries/useOrgClaimedInviteQuery.ts | 131 +- .../queries/useOrgClaimedInvitesQuery.ts | 145 +- .../admin/hooks/queries/useOrgGrantQuery.ts | 131 +- .../admin/hooks/queries/useOrgGrantsQuery.ts | 125 +- .../admin/hooks/queries/useOrgInviteQuery.ts | 131 +- .../admin/hooks/queries/useOrgInvitesQuery.ts | 125 +- .../hooks/queries/useOrgMemberProfileQuery.ts | 131 +- .../queries/useOrgMemberProfilesQuery.ts | 145 +- .../admin/hooks/queries/useOrgMemberQuery.ts | 131 +- .../admin/hooks/queries/useOrgMembersQuery.ts | 125 +- .../queries/useOrgMembershipDefaultQuery.ts | 137 +- .../queries/useOrgMembershipDefaultsQuery.ts | 162 +- .../hooks/queries/useOrgMembershipQuery.ts | 131 +- .../queries/useOrgMembershipSettingQuery.ts | 137 +- .../queries/useOrgMembershipSettingsQuery.ts | 162 +- .../hooks/queries/useOrgMembershipsQuery.ts | 131 +- .../hooks/queries/useOrgOwnerGrantQuery.ts | 131 +- .../hooks/queries/useOrgOwnerGrantsQuery.ts | 131 +- .../useOrgPermissionDefaultGrantQuery.ts | 146 +- .../useOrgPermissionDefaultGrantsQuery.ts | 168 +- .../useOrgPermissionDefaultPermissionQuery.ts | 154 +- ...useOrgPermissionDefaultPermissionsQuery.ts | 180 +- .../queries/useOrgPermissionDefaultQuery.ts | 137 +- .../queries/useOrgPermissionDefaultsQuery.ts | 162 +- .../hooks/queries/useOrgPermissionQuery.ts | 131 +- .../useOrgPermissionsGetByMaskQuery.ts | 94 +- .../useOrgPermissionsGetMaskByNamesQuery.ts | 92 +- .../queries/useOrgPermissionsGetMaskQuery.ts | 92 +- .../useOrgPermissionsGetPaddedMaskQuery.ts | 92 +- .../hooks/queries/useOrgPermissionsQuery.ts | 131 +- .../src/admin/hooks/query-keys.ts | 348 +- .../src/admin/hooks/selection.ts | 18 +- sdk/constructive-react/src/admin/index.ts | 6 +- .../src/admin/orm/client.ts | 43 +- sdk/constructive-react/src/admin/orm/index.ts | 78 +- .../src/admin/orm/input-types.ts | 585 ++- .../src/admin/orm/models/appAdminGrant.ts | 275 +- .../src/admin/orm/models/appClaimedInvite.ts | 275 +- .../src/admin/orm/models/appGrant.ts | 275 +- .../src/admin/orm/models/appInvite.ts | 275 +- .../src/admin/orm/models/appMembership.ts | 275 +- .../admin/orm/models/appMembershipDefault.ts | 279 +- .../src/admin/orm/models/appOwnerGrant.ts | 275 +- .../src/admin/orm/models/appPermission.ts | 275 +- .../admin/orm/models/appPermissionDefault.ts | 279 +- .../orm/models/appPermissionDefaultGrant.ts | 279 +- .../models/appPermissionDefaultPermission.ts | 315 +- .../src/admin/orm/models/index.ts | 52 +- .../src/admin/orm/models/membershipType.ts | 275 +- .../src/admin/orm/models/orgAdminGrant.ts | 275 +- .../src/admin/orm/models/orgClaimedInvite.ts | 275 +- .../src/admin/orm/models/orgGrant.ts | 275 +- .../src/admin/orm/models/orgInvite.ts | 275 +- .../src/admin/orm/models/orgMember.ts | 275 +- .../src/admin/orm/models/orgMemberProfile.ts | 275 +- .../src/admin/orm/models/orgMembership.ts | 275 +- .../admin/orm/models/orgMembershipDefault.ts | 279 +- .../admin/orm/models/orgMembershipSetting.ts | 279 +- .../src/admin/orm/models/orgOwnerGrant.ts | 275 +- .../src/admin/orm/models/orgPermission.ts | 275 +- .../admin/orm/models/orgPermissionDefault.ts | 279 +- .../orm/models/orgPermissionDefaultGrant.ts | 279 +- .../models/orgPermissionDefaultPermission.ts | 315 +- .../src/admin/orm/mutation/index.ts | 151 +- .../src/admin/orm/query-builder.ts | 215 +- .../src/admin/orm/query/index.ts | 398 +- .../src/admin/orm/realtime.ts | 37 +- .../src/admin/orm/select-types.ts | 22 +- .../src/admin/schema-types.ts | 592 ++- sdk/constructive-react/src/admin/types.ts | 2 +- .../src/agent/hooks/client.ts | 4 +- .../src/agent/hooks/index.ts | 24 +- .../src/agent/hooks/invalidation.ts | 319 +- .../src/agent/hooks/mutation-keys.ts | 103 +- .../src/agent/hooks/mutations/index.ts | 56 +- .../useCreateAgentMessageMutation.ts | 99 +- .../hooks/mutations/useCreateAgentMutation.ts | 91 +- .../useCreateAgentPersonaMutation.ts | 99 +- .../mutations/useCreateAgentPlanMutation.ts | 99 +- .../mutations/useCreateAgentPromptMutation.ts | 99 +- .../useCreateAgentResourceChunkMutation.ts | 102 +- .../useCreateAgentResourceMutation.ts | 99 +- .../mutations/useCreateAgentTaskMutation.ts | 99 +- .../mutations/useCreateAgentThreadMutation.ts | 99 +- .../useDeleteAgentMessageMutation.ts | 120 +- .../hooks/mutations/useDeleteAgentMutation.ts | 120 +- .../useDeleteAgentPersonaMutation.ts | 120 +- .../mutations/useDeleteAgentPlanMutation.ts | 120 +- .../mutations/useDeleteAgentPromptMutation.ts | 120 +- .../useDeleteAgentResourceChunkMutation.ts | 126 +- .../useDeleteAgentResourceMutation.ts | 120 +- .../mutations/useDeleteAgentTaskMutation.ts | 120 +- .../mutations/useDeleteAgentThreadMutation.ts | 120 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../useUpdateAgentMessageMutation.ts | 138 +- .../hooks/mutations/useUpdateAgentMutation.ts | 130 +- .../useUpdateAgentPersonaMutation.ts | 138 +- .../mutations/useUpdateAgentPlanMutation.ts | 138 +- .../mutations/useUpdateAgentPromptMutation.ts | 138 +- .../useUpdateAgentResourceChunkMutation.ts | 134 +- .../useUpdateAgentResourceMutation.ts | 134 +- .../mutations/useUpdateAgentTaskMutation.ts | 138 +- .../mutations/useUpdateAgentThreadMutation.ts | 138 +- .../src/agent/hooks/queries/index.ts | 36 +- .../hooks/queries/useAgentMessageQuery.ts | 131 +- .../hooks/queries/useAgentMessagesQuery.ts | 125 +- .../hooks/queries/useAgentPersonaQuery.ts | 131 +- .../hooks/queries/useAgentPersonasQuery.ts | 125 +- .../agent/hooks/queries/useAgentPlanQuery.ts | 131 +- .../agent/hooks/queries/useAgentPlansQuery.ts | 125 +- .../hooks/queries/useAgentPromptQuery.ts | 131 +- .../hooks/queries/useAgentPromptsQuery.ts | 125 +- .../src/agent/hooks/queries/useAgentQuery.ts | 131 +- .../queries/useAgentResourceChunkQuery.ts | 137 +- .../queries/useAgentResourceChunksQuery.ts | 153 +- .../hooks/queries/useAgentResourceQuery.ts | 131 +- .../hooks/queries/useAgentResourcesQuery.ts | 131 +- .../agent/hooks/queries/useAgentTaskQuery.ts | 131 +- .../agent/hooks/queries/useAgentTasksQuery.ts | 125 +- .../hooks/queries/useAgentThreadQuery.ts | 131 +- .../hooks/queries/useAgentThreadsQuery.ts | 125 +- .../src/agent/hooks/queries/useAgentsQuery.ts | 113 +- .../src/agent/hooks/query-keys.ts | 110 +- .../src/agent/hooks/selection.ts | 18 +- sdk/constructive-react/src/agent/index.ts | 6 +- .../src/agent/orm/client.ts | 43 +- sdk/constructive-react/src/agent/orm/index.ts | 40 +- .../src/agent/orm/input-types.ts | 329 +- .../src/agent/orm/models/agent.ts | 275 +- .../src/agent/orm/models/agentMessage.ts | 275 +- .../src/agent/orm/models/agentPersona.ts | 275 +- .../src/agent/orm/models/agentPlan.ts | 275 +- .../src/agent/orm/models/agentPrompt.ts | 275 +- .../src/agent/orm/models/agentResource.ts | 275 +- .../agent/orm/models/agentResourceChunk.ts | 275 +- .../src/agent/orm/models/agentTask.ts | 275 +- .../src/agent/orm/models/agentThread.ts | 275 +- .../src/agent/orm/models/index.ts | 18 +- .../src/agent/orm/mutation/index.ts | 59 +- .../src/agent/orm/query-builder.ts | 215 +- .../src/agent/orm/realtime.ts | 37 +- .../src/agent/orm/select-types.ts | 22 +- .../src/agent/schema-types.ts | 324 +- sdk/constructive-react/src/agent/types.ts | 2 +- .../src/api/hooks/client.ts | 4 +- sdk/constructive-react/src/api/hooks/index.ts | 24 +- .../src/api/hooks/invalidation.ts | 2233 +++++++----- .../src/api/hooks/mutation-keys.ts | 734 ++-- .../src/api/hooks/mutations/index.ts | 396 +- .../useAcceptDatabaseTransferMutation.ts | 76 +- .../hooks/mutations/useApplyRlsMutation.ts | 73 +- .../useCancelDatabaseTransferMutation.ts | 76 +- .../mutations/useCreateApiModuleMutation.ts | 99 +- .../hooks/mutations/useCreateApiMutation.ts | 91 +- .../mutations/useCreateApiSchemaMutation.ts | 99 +- .../mutations/useCreateApiSettingMutation.ts | 99 +- .../useCreateAstMigrationMutation.ts | 99 +- .../useCreateCheckConstraintMutation.ts | 102 +- .../useCreateCompositeTypeMutation.ts | 99 +- .../mutations/useCreateCorsSettingMutation.ts | 99 +- .../mutations/useCreateDatabaseMutation.ts | 99 +- .../useCreateDatabaseSettingMutation.ts | 102 +- .../useCreateDatabaseTransferMutation.ts | 102 +- .../useCreateDefaultPrivilegeMutation.ts | 102 +- .../mutations/useCreateDomainEventMutation.ts | 99 +- .../mutations/useCreateDomainMutation.ts | 91 +- .../useCreateDomainVerificationMutation.ts | 102 +- .../useCreateEmbeddingChunkMutation.ts | 102 +- .../hooks/mutations/useCreateEnumMutation.ts | 91 +- .../useCreateExclusionConstraintMutation.ts | 102 +- .../hooks/mutations/useCreateFieldMutation.ts | 91 +- .../useCreateForeignKeyConstraintMutation.ts | 102 +- .../useCreateFullTextSearchMutation.ts | 102 +- .../mutations/useCreateFunctionMutation.ts | 99 +- .../useCreateHostnameBindingMutation.ts | 102 +- .../mutations/useCreateHttpRouteMutation.ts | 99 +- .../hooks/mutations/useCreateIndexMutation.ts | 91 +- .../useCreateManagedDomainMutation.ts | 99 +- .../useCreateNodeTypeRegistryMutation.ts | 102 +- .../mutations/useCreatePartitionMutation.ts | 99 +- .../useCreatePlatformApiModuleMutation.ts | 102 +- .../mutations/useCreatePlatformApiMutation.ts | 99 +- .../useCreatePlatformApiSchemaMutation.ts | 102 +- .../useCreatePlatformApiSettingMutation.ts | 102 +- .../useCreatePlatformCorsSettingMutation.ts | 102 +- .../useCreatePlatformDomainEventMutation.ts | 102 +- .../useCreatePlatformDomainMutation.ts | 102 +- ...reatePlatformDomainVerificationMutation.ts | 108 +- .../useCreatePlatformManagedDomainMutation.ts | 102 +- .../useCreatePlatformSiteMetadatumMutation.ts | 102 +- .../useCreatePlatformSiteModuleMutation.ts | 102 +- .../useCreatePlatformSiteMutation.ts | 99 +- .../useCreatePlatformSiteThemeMutation.ts | 102 +- .../mutations/useCreatePolicyMutation.ts | 91 +- .../useCreatePrimaryKeyConstraintMutation.ts | 102 +- .../useCreatePubkeySettingMutation.ts | 99 +- .../mutations/useCreateRlsSettingMutation.ts | 99 +- .../useCreateRouteBindingMutation.ts | 99 +- .../hooks/mutations/useCreateRouteMutation.ts | 91 +- .../mutations/useCreateSchemaGrantMutation.ts | 99 +- .../mutations/useCreateSchemaMutation.ts | 91 +- .../useCreateSiteMetadatumMutation.ts | 99 +- .../mutations/useCreateSiteModuleMutation.ts | 99 +- .../hooks/mutations/useCreateSiteMutation.ts | 91 +- .../mutations/useCreateSiteThemeMutation.ts | 99 +- .../useCreateSpatialRelationMutation.ts | 102 +- .../mutations/useCreateSqlActionMutation.ts | 99 +- .../mutations/useCreateTableGrantMutation.ts | 99 +- .../hooks/mutations/useCreateTableMutation.ts | 91 +- .../useCreateTriggerFunctionMutation.ts | 102 +- .../mutations/useCreateTriggerMutation.ts | 99 +- .../useCreateUniqueConstraintMutation.ts | 102 +- .../mutations/useCreateViewGrantMutation.ts | 99 +- .../hooks/mutations/useCreateViewMutation.ts | 91 +- .../mutations/useCreateViewRuleMutation.ts | 99 +- .../mutations/useCreateViewTableMutation.ts | 99 +- .../useCreateWebauthnSettingMutation.ts | 102 +- .../mutations/useDeleteApiModuleMutation.ts | 120 +- .../hooks/mutations/useDeleteApiMutation.ts | 120 +- .../mutations/useDeleteApiSchemaMutation.ts | 120 +- .../mutations/useDeleteApiSettingMutation.ts | 120 +- .../useDeleteCheckConstraintMutation.ts | 120 +- .../useDeleteCompositeTypeMutation.ts | 120 +- .../mutations/useDeleteCorsSettingMutation.ts | 120 +- .../mutations/useDeleteDatabaseMutation.ts | 120 +- .../useDeleteDatabaseSettingMutation.ts | 120 +- .../useDeleteDatabaseTransferMutation.ts | 120 +- .../useDeleteDefaultPrivilegeMutation.ts | 120 +- .../mutations/useDeleteDomainEventMutation.ts | 120 +- .../mutations/useDeleteDomainMutation.ts | 120 +- .../useDeleteDomainVerificationMutation.ts | 126 +- .../useDeleteEmbeddingChunkMutation.ts | 120 +- .../hooks/mutations/useDeleteEnumMutation.ts | 120 +- .../useDeleteExclusionConstraintMutation.ts | 126 +- .../hooks/mutations/useDeleteFieldMutation.ts | 120 +- .../useDeleteForeignKeyConstraintMutation.ts | 126 +- .../useDeleteFullTextSearchMutation.ts | 120 +- .../mutations/useDeleteFunctionMutation.ts | 120 +- .../useDeleteHostnameBindingMutation.ts | 120 +- .../mutations/useDeleteHttpRouteMutation.ts | 120 +- .../hooks/mutations/useDeleteIndexMutation.ts | 120 +- .../useDeleteManagedDomainMutation.ts | 120 +- .../useDeleteNodeTypeRegistryMutation.ts | 120 +- .../mutations/useDeletePartitionMutation.ts | 120 +- .../useDeletePlatformApiModuleMutation.ts | 126 +- .../mutations/useDeletePlatformApiMutation.ts | 120 +- .../useDeletePlatformApiSchemaMutation.ts | 126 +- .../useDeletePlatformApiSettingMutation.ts | 126 +- .../useDeletePlatformCorsSettingMutation.ts | 126 +- .../useDeletePlatformDomainEventMutation.ts | 126 +- .../useDeletePlatformDomainMutation.ts | 120 +- ...eletePlatformDomainVerificationMutation.ts | 128 +- .../useDeletePlatformManagedDomainMutation.ts | 126 +- .../useDeletePlatformSiteMetadatumMutation.ts | 126 +- .../useDeletePlatformSiteModuleMutation.ts | 126 +- .../useDeletePlatformSiteMutation.ts | 120 +- .../useDeletePlatformSiteThemeMutation.ts | 126 +- .../mutations/useDeletePolicyMutation.ts | 120 +- .../useDeletePrimaryKeyConstraintMutation.ts | 126 +- .../useDeletePubkeySettingMutation.ts | 120 +- .../mutations/useDeleteRlsSettingMutation.ts | 120 +- .../useDeleteRouteBindingMutation.ts | 120 +- .../hooks/mutations/useDeleteRouteMutation.ts | 120 +- .../mutations/useDeleteSchemaGrantMutation.ts | 120 +- .../mutations/useDeleteSchemaMutation.ts | 120 +- .../useDeleteSiteMetadatumMutation.ts | 120 +- .../mutations/useDeleteSiteModuleMutation.ts | 120 +- .../hooks/mutations/useDeleteSiteMutation.ts | 120 +- .../mutations/useDeleteSiteThemeMutation.ts | 120 +- .../useDeleteSpatialRelationMutation.ts | 120 +- .../mutations/useDeleteTableGrantMutation.ts | 120 +- .../hooks/mutations/useDeleteTableMutation.ts | 120 +- .../useDeleteTriggerFunctionMutation.ts | 120 +- .../mutations/useDeleteTriggerMutation.ts | 120 +- .../useDeleteUniqueConstraintMutation.ts | 120 +- .../mutations/useDeleteViewGrantMutation.ts | 120 +- .../hooks/mutations/useDeleteViewMutation.ts | 120 +- .../mutations/useDeleteViewRuleMutation.ts | 120 +- .../mutations/useDeleteViewTableMutation.ts | 120 +- .../useDeleteWebauthnSettingMutation.ts | 120 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../useRejectDatabaseTransferMutation.ts | 76 +- .../mutations/useRequestDatabaseMutation.ts | 73 +- .../mutations/useSetFieldOrderMutation.ts | 73 +- .../mutations/useUpdateApiModuleMutation.ts | 138 +- .../hooks/mutations/useUpdateApiMutation.ts | 130 +- .../mutations/useUpdateApiSchemaMutation.ts | 138 +- .../mutations/useUpdateApiSettingMutation.ts | 138 +- .../useUpdateCheckConstraintMutation.ts | 134 +- .../useUpdateCompositeTypeMutation.ts | 134 +- .../mutations/useUpdateCorsSettingMutation.ts | 138 +- .../mutations/useUpdateDatabaseMutation.ts | 130 +- .../useUpdateDatabaseSettingMutation.ts | 134 +- .../useUpdateDatabaseTransferMutation.ts | 134 +- .../useUpdateDefaultPrivilegeMutation.ts | 134 +- .../mutations/useUpdateDomainEventMutation.ts | 138 +- .../mutations/useUpdateDomainMutation.ts | 130 +- .../useUpdateDomainVerificationMutation.ts | 134 +- .../useUpdateEmbeddingChunkMutation.ts | 134 +- .../hooks/mutations/useUpdateEnumMutation.ts | 130 +- .../useUpdateExclusionConstraintMutation.ts | 134 +- .../hooks/mutations/useUpdateFieldMutation.ts | 130 +- .../useUpdateForeignKeyConstraintMutation.ts | 134 +- .../useUpdateFullTextSearchMutation.ts | 134 +- .../mutations/useUpdateFunctionMutation.ts | 130 +- .../useUpdateHostnameBindingMutation.ts | 134 +- .../mutations/useUpdateHttpRouteMutation.ts | 138 +- .../hooks/mutations/useUpdateIndexMutation.ts | 130 +- .../useUpdateManagedDomainMutation.ts | 134 +- .../useUpdateNodeTypeRegistryMutation.ts | 134 +- .../mutations/useUpdatePartitionMutation.ts | 138 +- .../useUpdatePlatformApiModuleMutation.ts | 134 +- .../mutations/useUpdatePlatformApiMutation.ts | 138 +- .../useUpdatePlatformApiSchemaMutation.ts | 134 +- .../useUpdatePlatformApiSettingMutation.ts | 134 +- .../useUpdatePlatformCorsSettingMutation.ts | 134 +- .../useUpdatePlatformDomainEventMutation.ts | 134 +- .../useUpdatePlatformDomainMutation.ts | 134 +- ...pdatePlatformDomainVerificationMutation.ts | 136 +- .../useUpdatePlatformManagedDomainMutation.ts | 134 +- .../useUpdatePlatformSiteMetadatumMutation.ts | 134 +- .../useUpdatePlatformSiteModuleMutation.ts | 134 +- .../useUpdatePlatformSiteMutation.ts | 138 +- .../useUpdatePlatformSiteThemeMutation.ts | 134 +- .../mutations/useUpdatePolicyMutation.ts | 130 +- .../useUpdatePrimaryKeyConstraintMutation.ts | 134 +- .../useUpdatePubkeySettingMutation.ts | 134 +- .../mutations/useUpdateRlsSettingMutation.ts | 138 +- .../useUpdateRouteBindingMutation.ts | 138 +- .../hooks/mutations/useUpdateRouteMutation.ts | 130 +- .../mutations/useUpdateSchemaGrantMutation.ts | 138 +- .../mutations/useUpdateSchemaMutation.ts | 130 +- .../useUpdateSiteMetadatumMutation.ts | 134 +- .../mutations/useUpdateSiteModuleMutation.ts | 138 +- .../hooks/mutations/useUpdateSiteMutation.ts | 130 +- .../mutations/useUpdateSiteThemeMutation.ts | 138 +- .../useUpdateSpatialRelationMutation.ts | 134 +- .../mutations/useUpdateTableGrantMutation.ts | 138 +- .../hooks/mutations/useUpdateTableMutation.ts | 130 +- .../useUpdateTriggerFunctionMutation.ts | 134 +- .../mutations/useUpdateTriggerMutation.ts | 130 +- .../useUpdateUniqueConstraintMutation.ts | 134 +- .../mutations/useUpdateViewGrantMutation.ts | 138 +- .../hooks/mutations/useUpdateViewMutation.ts | 130 +- .../mutations/useUpdateViewRuleMutation.ts | 130 +- .../mutations/useUpdateViewTableMutation.ts | 138 +- .../useUpdateWebauthnSettingMutation.ts | 134 +- .../src/api/hooks/queries/index.ts | 268 +- .../api/hooks/queries/useApiModuleQuery.ts | 131 +- .../api/hooks/queries/useApiModulesQuery.ts | 125 +- .../src/api/hooks/queries/useApiQuery.ts | 131 +- .../hooks/queries/useApiSchemaNamesQuery.ts | 96 +- .../api/hooks/queries/useApiSchemaQuery.ts | 131 +- .../api/hooks/queries/useApiSchemasQuery.ts | 125 +- .../api/hooks/queries/useApiSettingQuery.ts | 131 +- .../api/hooks/queries/useApiSettingsQuery.ts | 125 +- .../src/api/hooks/queries/useApisQuery.ts | 103 +- .../queries/useApplyRegistryDefaultsQuery.ts | 92 +- .../api/hooks/queries/useAstMigrationQuery.ts | 131 +- .../hooks/queries/useAstMigrationsQuery.ts | 125 +- .../hooks/queries/useCheckConstraintQuery.ts | 131 +- .../hooks/queries/useCheckConstraintsQuery.ts | 145 +- .../hooks/queries/useCompositeTypeQuery.ts | 131 +- .../hooks/queries/useCompositeTypesQuery.ts | 131 +- .../api/hooks/queries/useCorsSettingQuery.ts | 131 +- .../api/hooks/queries/useCorsSettingsQuery.ts | 125 +- .../src/api/hooks/queries/useDatabaseQuery.ts | 131 +- .../hooks/queries/useDatabaseSettingQuery.ts | 131 +- .../hooks/queries/useDatabaseSettingsQuery.ts | 145 +- .../hooks/queries/useDatabaseTransferQuery.ts | 131 +- .../queries/useDatabaseTransfersQuery.ts | 145 +- .../api/hooks/queries/useDatabasesQuery.ts | 125 +- .../hooks/queries/useDefaultPrivilegeQuery.ts | 131 +- .../queries/useDefaultPrivilegesQuery.ts | 145 +- .../api/hooks/queries/useDomainEventQuery.ts | 131 +- .../api/hooks/queries/useDomainEventsQuery.ts | 125 +- .../src/api/hooks/queries/useDomainQuery.ts | 131 +- .../queries/useDomainVerificationQuery.ts | 137 +- .../queries/useDomainVerificationsQuery.ts | 153 +- .../src/api/hooks/queries/useDomainsQuery.ts | 113 +- .../hooks/queries/useEmbeddingChunkQuery.ts | 131 +- .../hooks/queries/useEmbeddingChunksQuery.ts | 139 +- .../src/api/hooks/queries/useEnumQuery.ts | 131 +- .../src/api/hooks/queries/useEnumsQuery.ts | 103 +- .../queries/useExclusionConstraintQuery.ts | 137 +- .../queries/useExclusionConstraintsQuery.ts | 156 +- .../src/api/hooks/queries/useFieldQuery.ts | 131 +- .../src/api/hooks/queries/useFieldsQuery.ts | 113 +- .../queries/useForeignKeyConstraintQuery.ts | 137 +- .../queries/useForeignKeyConstraintsQuery.ts | 162 +- .../hooks/queries/useFullTextSearchQuery.ts | 131 +- .../hooks/queries/useFullTextSearchesQuery.ts | 139 +- .../src/api/hooks/queries/useFunctionQuery.ts | 131 +- .../api/hooks/queries/useFunctionsQuery.ts | 125 +- .../hooks/queries/useHostnameBindingQuery.ts | 131 +- .../hooks/queries/useHostnameBindingsQuery.ts | 145 +- .../api/hooks/queries/useHttpRouteQuery.ts | 131 +- .../api/hooks/queries/useHttpRoutesQuery.ts | 125 +- .../src/api/hooks/queries/useIndexQuery.ts | 131 +- .../src/api/hooks/queries/useIndicesQuery.ts | 113 +- .../hooks/queries/useManagedDomainQuery.ts | 131 +- .../hooks/queries/useManagedDomainsQuery.ts | 131 +- .../queries/useNodeTypeRegistriesQuery.ts | 145 +- .../hooks/queries/useNodeTypeRegistryQuery.ts | 131 +- .../api/hooks/queries/usePartitionQuery.ts | 131 +- .../api/hooks/queries/usePartitionsQuery.ts | 125 +- .../queries/usePlatformApiModuleQuery.ts | 137 +- .../queries/usePlatformApiModulesQuery.ts | 145 +- .../api/hooks/queries/usePlatformApiQuery.ts | 131 +- .../queries/usePlatformApiSchemaQuery.ts | 137 +- .../queries/usePlatformApiSchemasQuery.ts | 145 +- .../queries/usePlatformApiSettingQuery.ts | 137 +- .../queries/usePlatformApiSettingsQuery.ts | 153 +- .../api/hooks/queries/usePlatformApisQuery.ts | 125 +- .../queries/usePlatformCorsSettingQuery.ts | 137 +- .../queries/usePlatformCorsSettingsQuery.ts | 156 +- .../queries/usePlatformDomainEventQuery.ts | 137 +- .../queries/usePlatformDomainEventsQuery.ts | 156 +- .../hooks/queries/usePlatformDomainQuery.ts | 131 +- .../usePlatformDomainVerificationQuery.ts | 149 +- .../usePlatformDomainVerificationsQuery.ts | 168 +- .../hooks/queries/usePlatformDomainsQuery.ts | 139 +- .../queries/usePlatformManagedDomainQuery.ts | 141 +- .../queries/usePlatformManagedDomainsQuery.ts | 166 +- .../queries/usePlatformSiteMetadataQuery.ts | 162 +- .../queries/usePlatformSiteMetadatumQuery.ts | 141 +- .../queries/usePlatformSiteModuleQuery.ts | 137 +- .../queries/usePlatformSiteModulesQuery.ts | 153 +- .../api/hooks/queries/usePlatformSiteQuery.ts | 131 +- .../queries/usePlatformSiteThemeQuery.ts | 137 +- .../queries/usePlatformSiteThemesQuery.ts | 145 +- .../hooks/queries/usePlatformSitesQuery.ts | 125 +- .../src/api/hooks/queries/usePoliciesQuery.ts | 113 +- .../src/api/hooks/queries/usePolicyQuery.ts | 131 +- .../queries/usePrimaryKeyConstraintQuery.ts | 137 +- .../queries/usePrimaryKeyConstraintsQuery.ts | 162 +- .../hooks/queries/usePubkeySettingQuery.ts | 131 +- .../hooks/queries/usePubkeySettingsQuery.ts | 131 +- .../hooks/queries/useResolveHttpRouteQuery.ts | 136 +- .../api/hooks/queries/useResolveRouteQuery.ts | 136 +- .../api/hooks/queries/useRlsSettingQuery.ts | 131 +- .../api/hooks/queries/useRlsSettingsQuery.ts | 125 +- .../api/hooks/queries/useRouteBindingQuery.ts | 131 +- .../hooks/queries/useRouteBindingsQuery.ts | 125 +- .../src/api/hooks/queries/useRouteQuery.ts | 131 +- .../src/api/hooks/queries/useRoutesQuery.ts | 113 +- .../api/hooks/queries/useSchemaGrantQuery.ts | 131 +- .../api/hooks/queries/useSchemaGrantsQuery.ts | 125 +- .../src/api/hooks/queries/useSchemaQuery.ts | 131 +- .../src/api/hooks/queries/useSchemasQuery.ts | 113 +- .../api/hooks/queries/useSiteMetadataQuery.ts | 131 +- .../hooks/queries/useSiteMetadatumQuery.ts | 131 +- .../api/hooks/queries/useSiteModuleQuery.ts | 131 +- .../api/hooks/queries/useSiteModulesQuery.ts | 125 +- .../src/api/hooks/queries/useSiteQuery.ts | 131 +- .../api/hooks/queries/useSiteThemeQuery.ts | 131 +- .../api/hooks/queries/useSiteThemesQuery.ts | 125 +- .../src/api/hooks/queries/useSitesQuery.ts | 103 +- .../hooks/queries/useSpatialRelationQuery.ts | 131 +- .../hooks/queries/useSpatialRelationsQuery.ts | 145 +- .../api/hooks/queries/useSqlActionQuery.ts | 131 +- .../api/hooks/queries/useSqlActionsQuery.ts | 125 +- .../api/hooks/queries/useTableGrantQuery.ts | 131 +- .../api/hooks/queries/useTableGrantsQuery.ts | 125 +- .../src/api/hooks/queries/useTableQuery.ts | 131 +- .../src/api/hooks/queries/useTablesQuery.ts | 113 +- .../hooks/queries/useTriggerFunctionQuery.ts | 131 +- .../hooks/queries/useTriggerFunctionsQuery.ts | 145 +- .../src/api/hooks/queries/useTriggerQuery.ts | 131 +- .../src/api/hooks/queries/useTriggersQuery.ts | 125 +- .../hooks/queries/useUniqueConstraintQuery.ts | 131 +- .../queries/useUniqueConstraintsQuery.ts | 145 +- .../api/hooks/queries/useViewGrantQuery.ts | 131 +- .../api/hooks/queries/useViewGrantsQuery.ts | 125 +- .../src/api/hooks/queries/useViewQuery.ts | 131 +- .../src/api/hooks/queries/useViewRuleQuery.ts | 131 +- .../api/hooks/queries/useViewRulesQuery.ts | 125 +- .../api/hooks/queries/useViewTableQuery.ts | 131 +- .../api/hooks/queries/useViewTablesQuery.ts | 125 +- .../src/api/hooks/queries/useViewsQuery.ts | 103 +- .../hooks/queries/useWebauthnSettingQuery.ts | 131 +- .../hooks/queries/useWebauthnSettingsQuery.ts | 145 +- .../src/api/hooks/query-keys.ts | 795 ++-- .../src/api/hooks/selection.ts | 18 +- sdk/constructive-react/src/api/index.ts | 6 +- sdk/constructive-react/src/api/orm/client.ts | 43 +- sdk/constructive-react/src/api/orm/index.ts | 156 +- .../src/api/orm/input-types.ts | 2008 +++++++++- .../src/api/orm/models/api.ts | 275 +- .../src/api/orm/models/apiModule.ts | 275 +- .../src/api/orm/models/apiSchema.ts | 275 +- .../src/api/orm/models/apiSetting.ts | 275 +- .../src/api/orm/models/astMigration.ts | 194 +- .../src/api/orm/models/checkConstraint.ts | 275 +- .../src/api/orm/models/compositeType.ts | 275 +- .../src/api/orm/models/corsSetting.ts | 275 +- .../src/api/orm/models/database.ts | 275 +- .../src/api/orm/models/databaseSetting.ts | 275 +- .../src/api/orm/models/databaseTransfer.ts | 275 +- .../src/api/orm/models/defaultPrivilege.ts | 275 +- .../src/api/orm/models/domain.ts | 275 +- .../src/api/orm/models/domainEvent.ts | 275 +- .../src/api/orm/models/domainVerification.ts | 275 +- .../src/api/orm/models/embeddingChunk.ts | 275 +- .../src/api/orm/models/enum.ts | 275 +- .../src/api/orm/models/exclusionConstraint.ts | 275 +- .../src/api/orm/models/field.ts | 275 +- .../api/orm/models/foreignKeyConstraint.ts | 279 +- .../src/api/orm/models/fullTextSearch.ts | 275 +- .../src/api/orm/models/function.ts | 275 +- .../src/api/orm/models/hostnameBinding.ts | 275 +- .../src/api/orm/models/httpRoute.ts | 275 +- .../src/api/orm/models/index.ts | 130 +- .../src/api/orm/models/indexModel.ts | 275 +- .../src/api/orm/models/managedDomain.ts | 275 +- .../src/api/orm/models/nodeTypeRegistry.ts | 275 +- .../src/api/orm/models/partition.ts | 275 +- .../src/api/orm/models/platformApi.ts | 275 +- .../src/api/orm/models/platformApiModule.ts | 275 +- .../src/api/orm/models/platformApiSchema.ts | 275 +- .../src/api/orm/models/platformApiSetting.ts | 275 +- .../src/api/orm/models/platformCorsSetting.ts | 275 +- .../src/api/orm/models/platformDomain.ts | 275 +- .../src/api/orm/models/platformDomainEvent.ts | 275 +- .../orm/models/platformDomainVerification.ts | 289 +- .../api/orm/models/platformManagedDomain.ts | 279 +- .../src/api/orm/models/platformSite.ts | 275 +- .../api/orm/models/platformSiteMetadatum.ts | 279 +- .../src/api/orm/models/platformSiteModule.ts | 275 +- .../src/api/orm/models/platformSiteTheme.ts | 275 +- .../src/api/orm/models/policy.ts | 275 +- .../api/orm/models/primaryKeyConstraint.ts | 279 +- .../src/api/orm/models/pubkeySetting.ts | 275 +- .../src/api/orm/models/rlsSetting.ts | 275 +- .../src/api/orm/models/route.ts | 275 +- .../src/api/orm/models/routeBinding.ts | 275 +- .../src/api/orm/models/schema.ts | 275 +- .../src/api/orm/models/schemaGrant.ts | 275 +- .../src/api/orm/models/site.ts | 275 +- .../src/api/orm/models/siteMetadatum.ts | 275 +- .../src/api/orm/models/siteModule.ts | 275 +- .../src/api/orm/models/siteTheme.ts | 275 +- .../src/api/orm/models/spatialRelation.ts | 275 +- .../src/api/orm/models/sqlAction.ts | 194 +- .../src/api/orm/models/table.ts | 275 +- .../src/api/orm/models/tableGrant.ts | 275 +- .../src/api/orm/models/trigger.ts | 275 +- .../src/api/orm/models/triggerFunction.ts | 275 +- .../src/api/orm/models/uniqueConstraint.ts | 275 +- .../src/api/orm/models/view.ts | 275 +- .../src/api/orm/models/viewGrant.ts | 275 +- .../src/api/orm/models/viewRule.ts | 275 +- .../src/api/orm/models/viewTable.ts | 275 +- .../src/api/orm/models/webauthnSetting.ts | 275 +- .../src/api/orm/mutation/index.ts | 335 +- .../src/api/orm/query-builder.ts | 215 +- .../src/api/orm/query/index.ts | 224 +- .../src/api/orm/realtime.ts | 37 +- .../src/api/orm/select-types.ts | 22 +- .../src/api/schema-types.ts | 1892 +++++++++- sdk/constructive-react/src/api/types.ts | 4 +- .../src/auth/hooks/client.ts | 4 +- .../src/auth/hooks/index.ts | 24 +- .../src/auth/hooks/invalidation.ts | 430 ++- .../src/auth/hooks/mutation-keys.ts | 292 +- .../src/auth/hooks/mutations/index.ts | 118 +- .../mutations/useCheckPasswordMutation.ts | 73 +- .../useConfirmDeleteAccountMutation.ts | 76 +- .../mutations/useCreateApiKeyMutation.ts | 73 +- .../useCreateAuditLogAuthMutation.ts | 99 +- .../useCreateCryptoAddressMutation.ts | 99 +- .../hooks/mutations/useCreateEmailMutation.ts | 91 +- .../useCreateIdentityProviderMutation.ts | 102 +- .../useCreateOrgApiKeyListMutation.ts | 99 +- .../mutations/useCreateOrgApiKeyMutation.ts | 73 +- .../useCreateOrgPrincipalMutation.ts | 76 +- .../mutations/useCreatePhoneNumberMutation.ts | 99 +- .../useCreatePrincipalEntityMutation.ts | 102 +- .../mutations/useCreatePrincipalMutation.ts | 99 +- ...useCreatePrincipalScopeOverrideMutation.ts | 102 +- .../mutations/useCreateRoleTypeMutation.ts | 99 +- .../useCreateUserConnectedAccountMutation.ts | 102 +- .../hooks/mutations/useCreateUserMutation.ts | 91 +- .../useCreateWebauthnCredentialMutation.ts | 102 +- .../useDeleteAuditLogAuthMutation.ts | 130 +- .../useDeleteCryptoAddressMutation.ts | 120 +- .../hooks/mutations/useDeleteEmailMutation.ts | 120 +- .../useDeleteOrgPrincipalMutation.ts | 76 +- .../mutations/useDeletePhoneNumberMutation.ts | 120 +- .../useDeletePrincipalEntityMutation.ts | 120 +- .../mutations/useDeletePrincipalMutation.ts | 73 +- .../mutations/useDeleteRoleTypeMutation.ts | 120 +- .../hooks/mutations/useDeleteUserMutation.ts | 120 +- .../useDeleteWebauthnCredentialMutation.ts | 126 +- .../mutations/useDisconnectAccountMutation.ts | 76 +- .../useExtendTokenExpiresMutation.ts | 76 +- .../mutations/useForgotPasswordMutation.ts | 73 +- .../mutations/useLinkIdentityMutation.ts | 73 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../mutations/useProvisionNewUserMutation.ts | 73 +- .../useRequestCrossOriginTokenMutation.ts | 76 +- .../mutations/useResetPasswordMutation.ts | 73 +- .../mutations/useRevokeApiKeyMutation.ts | 73 +- .../mutations/useRevokeOrgApiKeyMutation.ts | 73 +- .../mutations/useRevokeSessionMutation.ts | 73 +- .../useSendAccountDeletionEmailMutation.ts | 78 +- .../useSendVerificationEmailMutation.ts | 76 +- .../hooks/mutations/useSetPasswordMutation.ts | 73 +- .../mutations/useSignInCrossOriginMutation.ts | 76 +- .../auth/hooks/mutations/useSignInMutation.ts | 73 +- .../mutations/useSignInSmsOtpMutation.ts | 73 +- .../hooks/mutations/useSignOutMutation.ts | 73 +- .../auth/hooks/mutations/useSignUpMutation.ts | 73 +- .../hooks/mutations/useSignUpSmsMutation.ts | 73 +- .../useUpdateAuditLogAuthMutation.ts | 142 +- .../useUpdateCryptoAddressMutation.ts | 134 +- .../hooks/mutations/useUpdateEmailMutation.ts | 130 +- .../mutations/useUpdatePhoneNumberMutation.ts | 138 +- .../useUpdatePrincipalEntityMutation.ts | 134 +- .../mutations/useUpdateRoleTypeMutation.ts | 130 +- .../hooks/mutations/useUpdateUserMutation.ts | 130 +- .../useUpdateWebauthnCredentialMutation.ts | 134 +- .../hooks/mutations/useVerifyEmailMutation.ts | 73 +- .../mutations/useVerifyPasswordMutation.ts | 73 +- .../hooks/mutations/useVerifyTotpMutation.ts | 73 +- .../src/auth/hooks/queries/index.ts | 60 +- .../hooks/queries/useAuditLogAuthQuery.ts | 131 +- .../hooks/queries/useAuditLogAuthsQuery.ts | 125 +- .../hooks/queries/useCryptoAddressQuery.ts | 131 +- .../hooks/queries/useCryptoAddressesQuery.ts | 131 +- .../hooks/queries/useCurrentIpAddressQuery.ts | 66 +- .../hooks/queries/useCurrentUserAgentQuery.ts | 66 +- .../hooks/queries/useCurrentUserIdQuery.ts | 66 +- .../auth/hooks/queries/useCurrentUserQuery.ts | 127 +- .../src/auth/hooks/queries/useEmailQuery.ts | 131 +- .../src/auth/hooks/queries/useEmailsQuery.ts | 113 +- .../queries/useIdentityProvidersQuery.ts | 145 +- .../hooks/queries/useOrgApiKeyListQuery.ts | 131 +- .../hooks/queries/useOrgApiKeyListsQuery.ts | 131 +- .../auth/hooks/queries/usePhoneNumberQuery.ts | 131 +- .../hooks/queries/usePhoneNumbersQuery.ts | 125 +- .../queries/usePrincipalEntitiesQuery.ts | 145 +- .../hooks/queries/usePrincipalEntityQuery.ts | 131 +- .../auth/hooks/queries/usePrincipalQuery.ts | 131 +- .../queries/usePrincipalScopeOverrideQuery.ts | 141 +- .../usePrincipalScopeOverridesQuery.ts | 166 +- .../auth/hooks/queries/usePrincipalsQuery.ts | 125 +- .../hooks/queries/useRequireStepUpQuery.ts | 96 +- .../auth/hooks/queries/useRoleTypeQuery.ts | 131 +- .../auth/hooks/queries/useRoleTypesQuery.ts | 125 +- .../queries/useUserConnectedAccountQuery.ts | 137 +- .../queries/useUserConnectedAccountsQuery.ts | 162 +- .../src/auth/hooks/queries/useUserQuery.ts | 131 +- .../src/auth/hooks/queries/useUsersQuery.ts | 103 +- .../queries/useWebauthnCredentialQuery.ts | 137 +- .../queries/useWebauthnCredentialsQuery.ts | 153 +- .../src/auth/hooks/query-keys.ts | 169 +- .../src/auth/hooks/selection.ts | 18 +- sdk/constructive-react/src/auth/index.ts | 6 +- sdk/constructive-react/src/auth/orm/client.ts | 43 +- sdk/constructive-react/src/auth/orm/index.ts | 52 +- .../src/auth/orm/input-types.ts | 315 +- .../src/auth/orm/models/auditLogAuth.ts | 285 +- .../src/auth/orm/models/cryptoAddress.ts | 275 +- .../src/auth/orm/models/email.ts | 275 +- .../src/auth/orm/models/identityProvider.ts | 149 +- .../src/auth/orm/models/index.ts | 26 +- .../src/auth/orm/models/orgApiKeyList.ts | 194 +- .../src/auth/orm/models/phoneNumber.ts | 275 +- .../src/auth/orm/models/principal.ts | 194 +- .../src/auth/orm/models/principalEntity.ts | 275 +- .../auth/orm/models/principalScopeOverride.ts | 198 +- .../src/auth/orm/models/roleType.ts | 275 +- .../src/auth/orm/models/user.ts | 275 +- .../auth/orm/models/userConnectedAccount.ts | 198 +- .../src/auth/orm/models/webauthnCredential.ts | 275 +- .../src/auth/orm/mutation/index.ts | 1393 ++++--- .../src/auth/orm/query-builder.ts | 215 +- .../src/auth/orm/query/index.ts | 179 +- .../src/auth/orm/realtime.ts | 37 +- .../src/auth/orm/select-types.ts | 22 +- .../src/auth/schema-types.ts | 310 +- sdk/constructive-react/src/auth/types.ts | 2 +- .../src/compute/hooks/client.ts | 4 +- .../src/compute/hooks/index.ts | 24 +- .../src/compute/hooks/invalidation.ts | 2425 +++++++----- .../src/compute/hooks/mutation-keys.ts | 985 +++-- .../src/compute/hooks/mutations/index.ts | 406 +-- .../mutations/useAddEdgeAndSaveMutation.ts | 73 +- .../hooks/mutations/useAddEdgeMutation.ts | 73 +- .../mutations/useAddNodeAndSaveMutation.ts | 73 +- .../hooks/mutations/useAddNodeMutation.ts | 73 +- .../hooks/mutations/useCopyGraphMutation.ts | 73 +- .../mutations/useCreateDbPresetMutation.ts | 99 +- .../useCreateFunctionApiBindingMutation.ts | 102 +- .../useCreateFunctionDefinitionMutation.ts | 102 +- ...seCreateFunctionDeploymentEventMutation.ts | 102 +- .../useCreateFunctionDeploymentMutation.ts | 102 +- .../useCreateFunctionExecutionLogMutation.ts | 102 +- .../useCreateFunctionGraphCommitMutation.ts | 102 +- ...useCreateFunctionGraphExecutionMutation.ts | 102 +- ...FunctionGraphExecutionNodeStateMutation.ts | 116 +- ...ateFunctionGraphExecutionOutputMutation.ts | 111 +- .../useCreateFunctionGraphMutation.ts | 99 +- .../useCreateFunctionGraphObjectMutation.ts | 102 +- .../useCreateFunctionGraphRefMutation.ts | 102 +- .../useCreateFunctionGraphStoreMutation.ts | 102 +- ...CreateFunctionInvocationAttemptMutation.ts | 108 +- .../useCreateFunctionInvocationMutation.ts | 102 +- .../useCreateGetAllTreeNodesRecordMutation.ts | 102 +- .../mutations/useCreateInfraCommitMutation.ts | 99 +- ...reateInfraGetAllTreeNodesRecordMutation.ts | 108 +- .../mutations/useCreateInfraObjectMutation.ts | 99 +- .../mutations/useCreateInfraRefMutation.ts | 99 +- .../mutations/useCreateInfraStoreMutation.ts | 99 +- .../useCreateIntegrationProviderMutation.ts | 102 +- .../useCreateNamespaceEventMutation.ts | 102 +- .../mutations/useCreateNamespaceMutation.ts | 99 +- ...reatePlatformFunctionApiBindingMutation.ts | 108 +- ...reatePlatformFunctionDefinitionMutation.ts | 108 +- ...PlatformFunctionDeploymentEventMutation.ts | 116 +- ...reatePlatformFunctionDeploymentMutation.ts | 108 +- ...atePlatformFunctionExecutionLogMutation.ts | 111 +- ...atformFunctionInvocationAttemptMutation.ts | 116 +- ...reatePlatformFunctionInvocationMutation.ts | 108 +- .../useCreatePlatformInfraCommitMutation.ts | 102 +- ...tformInfraGetAllTreeNodesRecordMutation.ts | 116 +- .../useCreatePlatformInfraObjectMutation.ts | 102 +- .../useCreatePlatformInfraRefMutation.ts | 102 +- .../useCreatePlatformInfraStoreMutation.ts | 102 +- ...useCreatePlatformNamespaceEventMutation.ts | 102 +- .../useCreatePlatformNamespaceMutation.ts | 102 +- ...latformResourceDeclaredCapacityMutation.ts | 116 +- ...reatePlatformResourceDefinitionMutation.ts | 108 +- .../useCreatePlatformResourceEventMutation.ts | 102 +- ...atePlatformResourceInstallationMutation.ts | 111 +- .../useCreatePlatformResourceMutation.ts | 102 +- ...eatePlatformResourceStatusCheckMutation.ts | 111 +- ...eCreatePlatformResourceUsageLogMutation.ts | 102 +- ...atePlatformResourceUsageSummaryMutation.ts | 111 +- ...eatePlatformResourceUtilizationMutation.ts | 111 +- ...seCreatePlatformResourcesHealthMutation.ts | 102 +- ...tformResourcesRequirementsStateMutation.ts | 116 +- ...ormResourcesResolvedRequirementMutation.ts | 116 +- ...seCreatePlatformWebhookEndpointMutation.ts | 102 +- .../useCreatePlatformWebhookEventMutation.ts | 102 +- ...eCreateResourceDeclaredCapacityMutation.ts | 102 +- .../useCreateResourceDefinitionMutation.ts | 102 +- .../useCreateResourceEventMutation.ts | 99 +- .../useCreateResourceInstallationMutation.ts | 102 +- .../mutations/useCreateResourceMutation.ts | 99 +- .../useCreateResourceStatusCheckMutation.ts | 102 +- .../useCreateResourceUsageLogMutation.ts | 102 +- .../useCreateResourceUsageSummaryMutation.ts | 102 +- .../useCreateResourceUtilizationMutation.ts | 102 +- .../useCreateResourcesHealthMutation.ts | 102 +- ...reateResourcesRequirementsStateMutation.ts | 108 +- ...ateResourcesResolvedRequirementMutation.ts | 111 +- .../useCreateWebhookEndpointMutation.ts | 102 +- .../useCreateWebhookEventMutation.ts | 99 +- .../mutations/useDeleteDbPresetMutation.ts | 120 +- .../useDeleteFunctionApiBindingMutation.ts | 126 +- .../useDeleteFunctionDefinitionMutation.ts | 126 +- ...seDeleteFunctionDeploymentEventMutation.ts | 136 +- .../useDeleteFunctionDeploymentMutation.ts | 126 +- .../useDeleteFunctionExecutionLogMutation.ts | 136 +- .../useDeleteFunctionGraphCommitMutation.ts | 136 +- ...useDeleteFunctionGraphExecutionMutation.ts | 136 +- ...FunctionGraphExecutionNodeStateMutation.ts | 144 +- ...eteFunctionGraphExecutionOutputMutation.ts | 141 +- .../useDeleteFunctionGraphMutation.ts | 120 +- .../useDeleteFunctionGraphObjectMutation.ts | 136 +- .../useDeleteFunctionGraphRefMutation.ts | 130 +- .../useDeleteFunctionGraphStoreMutation.ts | 126 +- ...DeleteFunctionInvocationAttemptMutation.ts | 138 +- .../useDeleteFunctionInvocationMutation.ts | 136 +- .../mutations/useDeleteInfraCommitMutation.ts | 130 +- .../mutations/useDeleteInfraObjectMutation.ts | 130 +- .../mutations/useDeleteInfraRefMutation.ts | 130 +- .../mutations/useDeleteInfraStoreMutation.ts | 120 +- .../useDeleteIntegrationProviderMutation.ts | 126 +- .../useDeleteNamespaceEventMutation.ts | 130 +- .../mutations/useDeleteNamespaceMutation.ts | 120 +- ...eletePlatformFunctionApiBindingMutation.ts | 128 +- ...eletePlatformFunctionDefinitionMutation.ts | 128 +- ...PlatformFunctionDeploymentEventMutation.ts | 144 +- ...eletePlatformFunctionDeploymentMutation.ts | 128 +- ...etePlatformFunctionExecutionLogMutation.ts | 141 +- ...atformFunctionInvocationAttemptMutation.ts | 144 +- ...eletePlatformFunctionInvocationMutation.ts | 138 +- .../useDeletePlatformInfraCommitMutation.ts | 136 +- .../useDeletePlatformInfraObjectMutation.ts | 136 +- .../useDeletePlatformInfraRefMutation.ts | 130 +- .../useDeletePlatformInfraStoreMutation.ts | 126 +- ...useDeletePlatformNamespaceEventMutation.ts | 136 +- .../useDeletePlatformNamespaceMutation.ts | 126 +- ...eletePlatformResourceDefinitionMutation.ts | 128 +- .../useDeletePlatformResourceEventMutation.ts | 136 +- ...etePlatformResourceInstallationMutation.ts | 131 +- .../useDeletePlatformResourceMutation.ts | 120 +- ...letePlatformResourceStatusCheckMutation.ts | 131 +- ...eDeletePlatformResourceUsageLogMutation.ts | 136 +- ...etePlatformResourceUsageSummaryMutation.ts | 141 +- ...seDeletePlatformWebhookEndpointMutation.ts | 126 +- .../useDeletePlatformWebhookEventMutation.ts | 126 +- .../useDeleteResourceDefinitionMutation.ts | 126 +- .../useDeleteResourceEventMutation.ts | 130 +- .../useDeleteResourceInstallationMutation.ts | 126 +- .../mutations/useDeleteResourceMutation.ts | 120 +- .../useDeleteResourceStatusCheckMutation.ts | 126 +- .../useDeleteResourceUsageLogMutation.ts | 130 +- .../useDeleteResourceUsageSummaryMutation.ts | 136 +- .../useDeleteWebhookEndpointMutation.ts | 120 +- .../useDeleteWebhookEventMutation.ts | 120 +- .../mutations/useImportDefinitionsMutation.ts | 76 +- .../mutations/useImportGraphJsonMutation.ts | 73 +- .../useInfraInitEmptyRepoMutation.ts | 76 +- .../useInfraInsertNodeAtPathMutation.ts | 76 +- .../useInfraSetDataAtPathMutation.ts | 76 +- .../mutations/useInitEmptyRepoMutation.ts | 73 +- .../mutations/useInsertNodeAtPathMutation.ts | 73 +- .../usePlatformInfraInitEmptyRepoMutation.ts | 78 +- ...sePlatformInfraInsertNodeAtPathMutation.ts | 84 +- .../usePlatformInfraSetDataAtPathMutation.ts | 78 +- ...ormResourceInstallationsInstallMutation.ts | 84 +- ...rmResourceInstallationsRollbackMutation.ts | 84 +- ...mResourceInstallationsUninstallMutation.ts | 84 +- ...ormResourceInstallationsUpgradeMutation.ts | 84 +- .../mutations/useProvisionBucketMutation.ts | 73 +- ...useResourceInstallationsInstallMutation.ts | 81 +- ...seResourceInstallationsRollbackMutation.ts | 84 +- ...eResourceInstallationsUninstallMutation.ts | 84 +- ...useResourceInstallationsUpgradeMutation.ts | 81 +- .../hooks/mutations/useSaveGraphMutation.ts | 73 +- .../mutations/useSetDataAtPathMutation.ts | 73 +- .../mutations/useStartExecutionMutation.ts | 73 +- .../mutations/useUpdateDbPresetMutation.ts | 130 +- .../useUpdateFunctionApiBindingMutation.ts | 134 +- .../useUpdateFunctionDefinitionMutation.ts | 134 +- ...seUpdateFunctionDeploymentEventMutation.ts | 142 +- .../useUpdateFunctionDeploymentMutation.ts | 134 +- .../useUpdateFunctionExecutionLogMutation.ts | 142 +- .../useUpdateFunctionGraphCommitMutation.ts | 142 +- ...useUpdateFunctionGraphExecutionMutation.ts | 142 +- ...FunctionGraphExecutionNodeStateMutation.ts | 150 +- ...ateFunctionGraphExecutionOutputMutation.ts | 147 +- .../useUpdateFunctionGraphMutation.ts | 134 +- .../useUpdateFunctionGraphObjectMutation.ts | 142 +- .../useUpdateFunctionGraphRefMutation.ts | 142 +- .../useUpdateFunctionGraphStoreMutation.ts | 134 +- ...UpdateFunctionInvocationAttemptMutation.ts | 144 +- .../useUpdateFunctionInvocationMutation.ts | 142 +- .../mutations/useUpdateInfraCommitMutation.ts | 142 +- .../mutations/useUpdateInfraObjectMutation.ts | 142 +- .../mutations/useUpdateInfraRefMutation.ts | 134 +- .../mutations/useUpdateInfraStoreMutation.ts | 138 +- .../useUpdateIntegrationProviderMutation.ts | 134 +- .../useUpdateNamespaceEventMutation.ts | 142 +- .../mutations/useUpdateNamespaceMutation.ts | 138 +- ...pdatePlatformFunctionApiBindingMutation.ts | 136 +- ...pdatePlatformFunctionDefinitionMutation.ts | 136 +- ...PlatformFunctionDeploymentEventMutation.ts | 150 +- ...pdatePlatformFunctionDeploymentMutation.ts | 136 +- ...atePlatformFunctionExecutionLogMutation.ts | 147 +- ...atformFunctionInvocationAttemptMutation.ts | 150 +- ...pdatePlatformFunctionInvocationMutation.ts | 144 +- .../useUpdatePlatformInfraCommitMutation.ts | 142 +- .../useUpdatePlatformInfraObjectMutation.ts | 142 +- .../useUpdatePlatformInfraRefMutation.ts | 142 +- .../useUpdatePlatformInfraStoreMutation.ts | 134 +- ...useUpdatePlatformNamespaceEventMutation.ts | 142 +- .../useUpdatePlatformNamespaceMutation.ts | 134 +- ...pdatePlatformResourceDefinitionMutation.ts | 136 +- .../useUpdatePlatformResourceEventMutation.ts | 142 +- ...atePlatformResourceInstallationMutation.ts | 139 +- .../useUpdatePlatformResourceMutation.ts | 134 +- ...datePlatformResourceStatusCheckMutation.ts | 139 +- ...eUpdatePlatformResourceUsageLogMutation.ts | 142 +- ...atePlatformResourceUsageSummaryMutation.ts | 147 +- ...seUpdatePlatformWebhookEndpointMutation.ts | 134 +- .../useUpdatePlatformWebhookEventMutation.ts | 134 +- .../useUpdateResourceDefinitionMutation.ts | 134 +- .../useUpdateResourceEventMutation.ts | 142 +- .../useUpdateResourceInstallationMutation.ts | 134 +- .../mutations/useUpdateResourceMutation.ts | 130 +- .../useUpdateResourceStatusCheckMutation.ts | 134 +- .../useUpdateResourceUsageLogMutation.ts | 142 +- .../useUpdateResourceUsageSummaryMutation.ts | 142 +- .../useUpdateWebhookEndpointMutation.ts | 134 +- .../useUpdateWebhookEventMutation.ts | 138 +- .../useValidateFunctionGraphMutation.ts | 76 +- .../src/compute/hooks/queries/index.ts | 248 +- .../compute/hooks/queries/useDbPresetQuery.ts | 131 +- .../hooks/queries/useDbPresetsQuery.ts | 125 +- .../queries/useFunctionApiBindingQuery.ts | 137 +- .../queries/useFunctionApiBindingsQuery.ts | 153 +- .../queries/useFunctionDefinitionQuery.ts | 137 +- .../queries/useFunctionDefinitionsQuery.ts | 153 +- .../useFunctionDeploymentEventQuery.ts | 141 +- .../useFunctionDeploymentEventsQuery.ts | 168 +- .../queries/useFunctionDeploymentQuery.ts | 137 +- .../queries/useFunctionDeploymentsQuery.ts | 153 +- .../queries/useFunctionExecutionLogQuery.ts | 137 +- .../queries/useFunctionExecutionLogsQuery.ts | 162 +- .../queries/useFunctionGraphCommitQuery.ts | 137 +- .../queries/useFunctionGraphCommitsQuery.ts | 156 +- ...useFunctionGraphExecutionNodeStateQuery.ts | 154 +- ...seFunctionGraphExecutionNodeStatesQuery.ts | 180 +- .../useFunctionGraphExecutionOutputQuery.ts | 154 +- .../useFunctionGraphExecutionOutputsQuery.ts | 176 +- .../queries/useFunctionGraphExecutionQuery.ts | 141 +- .../useFunctionGraphExecutionsQuery.ts | 166 +- .../queries/useFunctionGraphObjectQuery.ts | 137 +- .../queries/useFunctionGraphObjectsQuery.ts | 156 +- .../hooks/queries/useFunctionGraphQuery.ts | 131 +- .../hooks/queries/useFunctionGraphRefQuery.ts | 131 +- .../queries/useFunctionGraphRefsQuery.ts | 145 +- .../queries/useFunctionGraphStoreQuery.ts | 137 +- .../queries/useFunctionGraphStoresQuery.ts | 153 +- .../hooks/queries/useFunctionGraphsQuery.ts | 131 +- .../useFunctionInvocationAttemptQuery.ts | 146 +- .../useFunctionInvocationAttemptsQuery.ts | 168 +- .../queries/useFunctionInvocationQuery.ts | 137 +- .../queries/useFunctionInvocationsQuery.ts | 153 +- .../hooks/queries/useGetAllTreeNodesQuery.ts | 154 +- .../hooks/queries/useInfraCommitQuery.ts | 131 +- .../hooks/queries/useInfraCommitsQuery.ts | 125 +- .../queries/useInfraGetAllTreeNodesQuery.ts | 166 +- .../hooks/queries/useInfraObjectQuery.ts | 131 +- .../hooks/queries/useInfraObjectsQuery.ts | 125 +- .../compute/hooks/queries/useInfraRefQuery.ts | 131 +- .../hooks/queries/useInfraRefsQuery.ts | 125 +- .../hooks/queries/useInfraStoreQuery.ts | 131 +- .../hooks/queries/useInfraStoresQuery.ts | 125 +- .../queries/useIntegrationProviderQuery.ts | 137 +- .../queries/useIntegrationProvidersQuery.ts | 156 +- .../hooks/queries/useNamespaceEventQuery.ts | 131 +- .../hooks/queries/useNamespaceEventsQuery.ts | 139 +- .../hooks/queries/useNamespaceQuery.ts | 131 +- .../hooks/queries/useNamespacesQuery.ts | 125 +- .../usePlatformFunctionApiBindingQuery.ts | 149 +- .../usePlatformFunctionApiBindingsQuery.ts | 168 +- .../usePlatformFunctionDefinitionQuery.ts | 149 +- .../usePlatformFunctionDefinitionsQuery.ts | 168 +- ...usePlatformFunctionDeploymentEventQuery.ts | 154 +- ...sePlatformFunctionDeploymentEventsQuery.ts | 180 +- .../usePlatformFunctionDeploymentQuery.ts | 149 +- .../usePlatformFunctionDeploymentsQuery.ts | 168 +- .../usePlatformFunctionExecutionLogQuery.ts | 154 +- .../usePlatformFunctionExecutionLogsQuery.ts | 176 +- ...ePlatformFunctionInvocationAttemptQuery.ts | 157 +- ...PlatformFunctionInvocationAttemptsQuery.ts | 183 +- .../usePlatformFunctionInvocationQuery.ts | 149 +- .../usePlatformFunctionInvocationsQuery.ts | 168 +- .../queries/usePlatformInfraCommitQuery.ts | 137 +- .../queries/usePlatformInfraCommitsQuery.ts | 156 +- .../usePlatformInfraGetAllTreeNodesQuery.ts | 180 +- .../queries/usePlatformInfraObjectQuery.ts | 137 +- .../queries/usePlatformInfraObjectsQuery.ts | 156 +- .../hooks/queries/usePlatformInfraRefQuery.ts | 131 +- .../queries/usePlatformInfraRefsQuery.ts | 145 +- .../queries/usePlatformInfraStoreQuery.ts | 137 +- .../queries/usePlatformInfraStoresQuery.ts | 153 +- .../queries/usePlatformNamespaceEventQuery.ts | 141 +- .../usePlatformNamespaceEventsQuery.ts | 166 +- .../queries/usePlatformNamespaceQuery.ts | 137 +- .../queries/usePlatformNamespacesQuery.ts | 145 +- ...PlatformResourceDeclaredCapacitiesQuery.ts | 180 +- .../usePlatformResourceDefinitionQuery.ts | 149 +- .../usePlatformResourceDefinitionsQuery.ts | 168 +- .../queries/usePlatformResourceEventQuery.ts | 141 +- .../queries/usePlatformResourceEventsQuery.ts | 166 +- .../usePlatformResourceInstallationQuery.ts | 154 +- .../usePlatformResourceInstallationsQuery.ts | 176 +- .../hooks/queries/usePlatformResourceQuery.ts | 131 +- .../usePlatformResourceStatusCheckQuery.ts | 154 +- .../usePlatformResourceStatusChecksQuery.ts | 168 +- .../usePlatformResourceUsageLogQuery.ts | 146 +- .../usePlatformResourceUsageLogsQuery.ts | 168 +- .../usePlatformResourceUsageSummariesQuery.ts | 176 +- .../usePlatformResourceUsageSummaryQuery.ts | 154 +- .../usePlatformResourceUtilizationsQuery.ts | 168 +- .../usePlatformResourcesHealthQuery.ts | 141 +- .../usePlatformResourcesHealthsQuery.ts | 168 +- .../queries/usePlatformResourcesQuery.ts | 145 +- ...latformResourcesRequirementsStatesQuery.ts | 183 +- ...tformResourcesResolvedRequirementsQuery.ts | 183 +- .../usePlatformWebhookEndpointQuery.ts | 141 +- .../usePlatformWebhookEndpointsQuery.ts | 168 +- .../queries/usePlatformWebhookEventQuery.ts | 137 +- .../queries/usePlatformWebhookEventsQuery.ts | 162 +- .../queries/useReadFunctionGraphQuery.ts | 92 +- .../useResourceDeclaredCapacitiesQuery.ts | 168 +- .../queries/useResourceDefinitionQuery.ts | 137 +- .../queries/useResourceDefinitionsQuery.ts | 153 +- .../hooks/queries/useResourceEventQuery.ts | 131 +- .../hooks/queries/useResourceEventsQuery.ts | 131 +- .../queries/useResourceInstallationQuery.ts | 137 +- .../queries/useResourceInstallationsQuery.ts | 162 +- .../compute/hooks/queries/useResourceQuery.ts | 131 +- .../queries/useResourceStatusCheckQuery.ts | 137 +- .../queries/useResourceStatusChecksQuery.ts | 156 +- .../hooks/queries/useResourceUsageLogQuery.ts | 131 +- .../queries/useResourceUsageLogsQuery.ts | 145 +- .../queries/useResourceUsageSummariesQuery.ts | 162 +- .../queries/useResourceUsageSummaryQuery.ts | 137 +- .../queries/useResourceUtilizationsQuery.ts | 156 +- .../hooks/queries/useResourcesHealthQuery.ts | 131 +- .../hooks/queries/useResourcesHealthsQuery.ts | 145 +- .../hooks/queries/useResourcesQuery.ts | 125 +- .../useResourcesRequirementsStatesQuery.ts | 168 +- .../useResourcesResolvedRequirementsQuery.ts | 176 +- .../hooks/queries/useWebhookEndpointQuery.ts | 131 +- .../hooks/queries/useWebhookEndpointsQuery.ts | 145 +- .../hooks/queries/useWebhookEventQuery.ts | 131 +- .../hooks/queries/useWebhookEventsQuery.ts | 125 +- .../src/compute/hooks/query-keys.ts | 849 +++-- .../src/compute/hooks/selection.ts | 18 +- sdk/constructive-react/src/compute/index.ts | 6 +- .../src/compute/orm/client.ts | 43 +- .../src/compute/orm/index.ts | 160 +- .../src/compute/orm/input-types.ts | 2194 ++++++++++- .../src/compute/orm/models/dbPreset.ts | 275 +- .../compute/orm/models/functionApiBinding.ts | 275 +- .../compute/orm/models/functionDefinition.ts | 275 +- .../compute/orm/models/functionDeployment.ts | 275 +- .../orm/models/functionDeploymentEvent.ts | 289 +- .../orm/models/functionExecutionLog.ts | 289 +- .../src/compute/orm/models/functionGraph.ts | 275 +- .../compute/orm/models/functionGraphCommit.ts | 285 +- .../orm/models/functionGraphExecution.ts | 289 +- .../models/functionGraphExecutionNodeState.ts | 325 +- .../models/functionGraphExecutionOutput.ts | 307 +- .../compute/orm/models/functionGraphObject.ts | 271 +- .../compute/orm/models/functionGraphRef.ts | 285 +- .../compute/orm/models/functionGraphStore.ts | 275 +- .../compute/orm/models/functionInvocation.ts | 285 +- .../orm/models/functionInvocationAttempt.ts | 289 +- .../orm/models/getAllTreeNodesRecord.ts | 149 +- .../src/compute/orm/models/index.ts | 134 +- .../src/compute/orm/models/infraCommit.ts | 285 +- .../orm/models/infraGetAllTreeNodesRecord.ts | 158 +- .../src/compute/orm/models/infraObject.ts | 271 +- .../src/compute/orm/models/infraRef.ts | 285 +- .../src/compute/orm/models/infraStore.ts | 275 +- .../compute/orm/models/integrationProvider.ts | 275 +- .../src/compute/orm/models/namespace.ts | 275 +- .../src/compute/orm/models/namespaceEvent.ts | 285 +- .../orm/models/platformFunctionApiBinding.ts | 289 +- .../orm/models/platformFunctionDefinition.ts | 289 +- .../orm/models/platformFunctionDeployment.ts | 289 +- .../models/platformFunctionDeploymentEvent.ts | 325 +- .../models/platformFunctionExecutionLog.ts | 307 +- .../orm/models/platformFunctionInvocation.ts | 299 +- .../platformFunctionInvocationAttempt.ts | 327 +- .../compute/orm/models/platformInfraCommit.ts | 285 +- .../platformInfraGetAllTreeNodesRecord.ts | 174 +- .../compute/orm/models/platformInfraObject.ts | 271 +- .../compute/orm/models/platformInfraRef.ts | 285 +- .../compute/orm/models/platformInfraStore.ts | 275 +- .../compute/orm/models/platformNamespace.ts | 275 +- .../orm/models/platformNamespaceEvent.ts | 289 +- .../compute/orm/models/platformResource.ts | 275 +- .../platformResourceDeclaredCapacity.ts | 175 +- .../orm/models/platformResourceDefinition.ts | 289 +- .../orm/models/platformResourceEvent.ts | 289 +- .../models/platformResourceInstallation.ts | 297 +- .../orm/models/platformResourceStatusCheck.ts | 293 +- .../orm/models/platformResourceUsageLog.ts | 289 +- .../models/platformResourceUsageSummary.ts | 307 +- .../orm/models/platformResourceUtilization.ts | 162 +- .../orm/models/platformResourcesHealth.ts | 198 +- .../platformResourcesRequirementsState.ts | 175 +- .../platformResourcesResolvedRequirement.ts | 175 +- .../orm/models/platformWebhookEndpoint.ts | 279 +- .../orm/models/platformWebhookEvent.ts | 279 +- .../src/compute/orm/models/resource.ts | 275 +- .../orm/models/resourceDeclaredCapacity.ts | 153 +- .../compute/orm/models/resourceDefinition.ts | 275 +- .../src/compute/orm/models/resourceEvent.ts | 285 +- .../orm/models/resourceInstallation.ts | 279 +- .../compute/orm/models/resourceStatusCheck.ts | 275 +- .../compute/orm/models/resourceUsageLog.ts | 285 +- .../orm/models/resourceUsageSummary.ts | 289 +- .../compute/orm/models/resourceUtilization.ts | 149 +- .../src/compute/orm/models/resourcesHealth.ts | 194 +- .../orm/models/resourcesRequirementsState.ts | 158 +- .../models/resourcesResolvedRequirement.ts | 166 +- .../src/compute/orm/models/webhookEndpoint.ts | 275 +- .../src/compute/orm/models/webhookEvent.ts | 275 +- .../src/compute/orm/mutation/index.ts | 1336 +++++-- .../src/compute/orm/query-builder.ts | 215 +- .../src/compute/orm/query/index.ts | 53 +- .../src/compute/orm/realtime.ts | 37 +- .../src/compute/orm/select-types.ts | 22 +- .../src/compute/schema-types.ts | 2065 ++++++++++- sdk/constructive-react/src/compute/types.ts | 2 +- .../src/config/hooks/client.ts | 4 +- .../src/config/hooks/index.ts | 24 +- .../src/config/hooks/invalidation.ts | 167 +- .../src/config/hooks/mutation-keys.ts | 133 +- .../src/config/hooks/mutations/index.ts | 44 +- .../mutations/useCreateConfigMutation.ts | 91 +- .../useCreatePlatformConfigMutation.ts | 102 +- ...useCreatePlatformInternalSecretMutation.ts | 102 +- .../useCreatePlatformSecretMutation.ts | 102 +- .../mutations/useCreateSecretMutation.ts | 91 +- .../mutations/useDeleteConfigMutation.ts | 120 +- .../useDeletePlatformConfigMutation.ts | 120 +- .../usePlatformInternalSecretsDelMutation.ts | 78 +- ...tformInternalSecretsRemoveArrayMutation.ts | 84 +- ...sePlatformInternalSecretsRotateMutation.ts | 84 +- .../usePlatformInternalSecretsSetMutation.ts | 78 +- .../usePlatformSecretsDelMutation.ts | 76 +- .../usePlatformSecretsRemoveArrayMutation.ts | 78 +- .../usePlatformSecretsRotateMutation.ts | 76 +- .../usePlatformSecretsSetMutation.ts | 76 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../mutations/useUpdateConfigMutation.ts | 130 +- .../useUpdatePlatformConfigMutation.ts | 134 +- .../hooks/mutations/use_secretsDelMutation.ts | 73 +- .../use_secretsRemoveArrayMutation.ts | 76 +- .../mutations/use_secretsRotateMutation.ts | 73 +- .../hooks/mutations/use_secretsSetMutation.ts | 73 +- .../src/config/hooks/queries/index.ts | 20 +- .../config/hooks/queries/useConfigQuery.ts | 131 +- .../config/hooks/queries/useConfigsQuery.ts | 113 +- .../hooks/queries/usePlatformConfigQuery.ts | 131 +- .../hooks/queries/usePlatformConfigsQuery.ts | 139 +- .../queries/usePlatformInternalSecretQuery.ts | 141 +- .../usePlatformInternalSecretsQuery.ts | 166 +- .../hooks/queries/usePlatformSecretQuery.ts | 131 +- .../hooks/queries/usePlatformSecretsQuery.ts | 139 +- .../config/hooks/queries/useSecretQuery.ts | 131 +- .../config/hooks/queries/useSecretsQuery.ts | 113 +- .../src/config/hooks/query-keys.ts | 62 +- .../src/config/hooks/selection.ts | 18 +- sdk/constructive-react/src/config/index.ts | 6 +- .../src/config/orm/client.ts | 43 +- .../src/config/orm/index.ts | 32 +- .../src/config/orm/input-types.ts | 136 +- .../src/config/orm/models/config.ts | 275 +- .../src/config/orm/models/index.ts | 10 +- .../src/config/orm/models/platformConfig.ts | 275 +- .../orm/models/platformInternalSecret.ts | 198 +- .../src/config/orm/models/platformSecret.ts | 194 +- .../src/config/orm/models/secret.ts | 194 +- .../src/config/orm/mutation/index.ts | 617 +++- .../src/config/orm/query-builder.ts | 215 +- .../src/config/orm/realtime.ts | 37 +- .../src/config/orm/select-types.ts | 22 +- .../src/config/schema-types.ts | 158 +- sdk/constructive-react/src/config/types.ts | 2 +- sdk/constructive-react/src/index.ts | 24 +- .../src/infra/hooks/client.ts | 4 +- .../src/infra/hooks/index.ts | 24 +- .../src/infra/hooks/invalidation.ts | 362 +- .../src/infra/hooks/mutation-keys.ts | 142 +- .../src/infra/hooks/mutations/index.ts | 64 +- .../mutations/useCreateDbPresetMutation.ts | 99 +- .../useCreateNamespaceEventMutation.ts | 102 +- .../mutations/useCreateNamespaceMutation.ts | 99 +- .../useCreatePlatformInfraCommitMutation.ts | 102 +- ...tformInfraGetAllTreeNodesRecordMutation.ts | 116 +- .../useCreatePlatformInfraObjectMutation.ts | 102 +- .../useCreatePlatformInfraRefMutation.ts | 102 +- .../useCreatePlatformInfraStoreMutation.ts | 102 +- ...useCreatePlatformNamespaceEventMutation.ts | 102 +- .../useCreatePlatformNamespaceMutation.ts | 102 +- .../mutations/useDeleteDbPresetMutation.ts | 120 +- .../useDeleteNamespaceEventMutation.ts | 130 +- .../mutations/useDeleteNamespaceMutation.ts | 120 +- .../useDeletePlatformInfraCommitMutation.ts | 136 +- .../useDeletePlatformInfraObjectMutation.ts | 136 +- .../useDeletePlatformInfraRefMutation.ts | 130 +- .../useDeletePlatformInfraStoreMutation.ts | 126 +- ...useDeletePlatformNamespaceEventMutation.ts | 136 +- .../useDeletePlatformNamespaceMutation.ts | 126 +- .../usePlatformInfraInitEmptyRepoMutation.ts | 78 +- ...sePlatformInfraInsertNodeAtPathMutation.ts | 84 +- .../usePlatformInfraSetDataAtPathMutation.ts | 78 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../mutations/useUpdateDbPresetMutation.ts | 130 +- .../useUpdateNamespaceEventMutation.ts | 142 +- .../mutations/useUpdateNamespaceMutation.ts | 138 +- .../useUpdatePlatformInfraCommitMutation.ts | 142 +- .../useUpdatePlatformInfraObjectMutation.ts | 142 +- .../useUpdatePlatformInfraRefMutation.ts | 142 +- .../useUpdatePlatformInfraStoreMutation.ts | 134 +- ...useUpdatePlatformNamespaceEventMutation.ts | 142 +- .../useUpdatePlatformNamespaceMutation.ts | 134 +- .../src/infra/hooks/queries/index.ts | 38 +- .../infra/hooks/queries/useDbPresetQuery.ts | 131 +- .../infra/hooks/queries/useDbPresetsQuery.ts | 125 +- .../hooks/queries/useNamespaceEventQuery.ts | 131 +- .../hooks/queries/useNamespaceEventsQuery.ts | 139 +- .../infra/hooks/queries/useNamespaceQuery.ts | 131 +- .../infra/hooks/queries/useNamespacesQuery.ts | 125 +- .../queries/usePlatformInfraCommitQuery.ts | 137 +- .../queries/usePlatformInfraCommitsQuery.ts | 156 +- .../usePlatformInfraGetAllTreeNodesQuery.ts | 180 +- .../queries/usePlatformInfraObjectQuery.ts | 137 +- .../queries/usePlatformInfraObjectsQuery.ts | 156 +- .../hooks/queries/usePlatformInfraRefQuery.ts | 131 +- .../queries/usePlatformInfraRefsQuery.ts | 145 +- .../queries/usePlatformInfraStoreQuery.ts | 137 +- .../queries/usePlatformInfraStoresQuery.ts | 153 +- .../queries/usePlatformNamespaceEventQuery.ts | 141 +- .../usePlatformNamespaceEventsQuery.ts | 166 +- .../queries/usePlatformNamespaceQuery.ts | 137 +- .../queries/usePlatformNamespacesQuery.ts | 145 +- .../src/infra/hooks/query-keys.ts | 126 +- .../src/infra/hooks/selection.ts | 18 +- sdk/constructive-react/src/infra/index.ts | 6 +- .../src/infra/orm/client.ts | 43 +- sdk/constructive-react/src/infra/orm/index.ts | 42 +- .../src/infra/orm/input-types.ts | 214 +- .../src/infra/orm/models/dbPreset.ts | 275 +- .../src/infra/orm/models/index.ts | 20 +- .../src/infra/orm/models/namespace.ts | 275 +- .../src/infra/orm/models/namespaceEvent.ts | 285 +- .../infra/orm/models/platformInfraCommit.ts | 285 +- .../platformInfraGetAllTreeNodesRecord.ts | 174 +- .../infra/orm/models/platformInfraObject.ts | 271 +- .../src/infra/orm/models/platformInfraRef.ts | 285 +- .../infra/orm/models/platformInfraStore.ts | 275 +- .../src/infra/orm/models/platformNamespace.ts | 275 +- .../orm/models/platformNamespaceEvent.ts | 289 +- .../src/infra/orm/mutation/index.ts | 200 +- .../src/infra/orm/query-builder.ts | 215 +- .../src/infra/orm/realtime.ts | 37 +- .../src/infra/orm/select-types.ts | 22 +- .../src/infra/schema-types.ts | 229 +- sdk/constructive-react/src/infra/types.ts | 2 +- .../src/modules/hooks/client.ts | 4 +- .../src/modules/hooks/index.ts | 24 +- .../src/modules/hooks/invalidation.ts | 2692 +++++++++----- .../src/modules/hooks/mutation-keys.ts | 929 +++-- .../src/modules/hooks/mutations/index.ts | 470 +-- .../useConstructBlueprintMutation.ts | 76 +- .../useCopyTemplateToBlueprintMutation.ts | 76 +- .../mutations/useCreateAgentModuleMutation.ts | 99 +- .../useCreateApiSurfaceModuleMutation.ts | 102 +- .../mutations/useCreateAppModuleMutation.ts | 99 +- .../useCreateBillingModuleMutation.ts | 99 +- .../useCreateBillingProviderModuleMutation.ts | 102 +- .../useCreateBlueprintConstructionMutation.ts | 102 +- .../mutations/useCreateBlueprintMutation.ts | 99 +- .../useCreateBlueprintTemplateMutation.ts | 102 +- .../useCreateCatalogModuleMutation.ts | 99 +- .../useCreateComputeLogModuleMutation.ts | 102 +- ...seCreateConfigSecretsUserModuleMutation.ts | 102 +- ...seCreateConnectedAccountsModuleMutation.ts | 102 +- .../useCreateCryptoAddressesModuleMutation.ts | 102 +- .../useCreateCryptoAuthModuleMutation.ts | 102 +- ...seCreateDatabaseProvisionModuleMutation.ts | 102 +- ...useCreateDatabaseSettingsModuleMutation.ts | 102 +- .../useCreateDbPoolConfigMutation.ts | 99 +- .../mutations/useCreateDbPoolMutation.ts | 91 +- .../useCreateDbPresetModuleMutation.ts | 102 +- .../useCreateDbUsageModuleMutation.ts | 99 +- .../useCreateDefaultIdsModuleMutation.ts | 102 +- ...useCreateDenormalizedTableFieldMutation.ts | 102 +- .../useCreateDevicesModuleMutation.ts | 99 +- .../useCreateDomainModuleMutation.ts | 99 +- .../useCreateEmailsModuleMutation.ts | 99 +- .../useCreateEntityTypeProvisionMutation.ts | 98 +- .../useCreateEventsModuleMutation.ts | 99 +- ...eCreateFunctionDeploymentModuleMutation.ts | 102 +- ...eCreateFunctionInvocationModuleMutation.ts | 102 +- .../useCreateFunctionModuleMutation.ts | 102 +- .../useCreateGraphExecutionModuleMutation.ts | 102 +- .../mutations/useCreateGraphModuleMutation.ts | 99 +- .../useCreateHierarchyModuleMutation.ts | 102 +- .../useCreateHttpRouteModuleMutation.ts | 102 +- .../mutations/useCreateI18NModuleMutation.ts | 99 +- ...seCreateIdentityProvidersModuleMutation.ts | 98 +- .../useCreateInferenceLogModuleMutation.ts | 102 +- .../useCreateInfraConfigModuleMutation.ts | 102 +- .../useCreateInfraSecretsModuleMutation.ts | 102 +- ...reateIntegrationProvidersModuleMutation.ts | 104 +- .../useCreateInternalSecretsModuleMutation.ts | 102 +- .../useCreateInvitesModuleMutation.ts | 99 +- .../useCreateLimitsModuleMutation.ts | 99 +- .../useCreateMembershipTypesModuleMutation.ts | 102 +- .../useCreateMembershipsModuleMutation.ts | 102 +- .../useCreateMerkleStoreModuleMutation.ts | 102 +- .../useCreateNamespaceModuleMutation.ts | 102 +- .../useCreateNotificationsModuleMutation.ts | 102 +- .../useCreatePermissionsModuleMutation.ts | 102 +- .../useCreatePhoneNumbersModuleMutation.ts | 102 +- .../mutations/useCreatePlansModuleMutation.ts | 99 +- .../useCreatePrincipalAuthModuleMutation.ts | 102 +- .../useCreateProfilesModuleMutation.ts | 102 +- .../useCreateRateLimitMetersModuleMutation.ts | 102 +- .../useCreateRateLimitsModuleMutation.ts | 102 +- .../useCreateRealtimeModuleMutation.ts | 102 +- .../useCreateRelationProvisionMutation.ts | 98 +- .../useCreateResourceModuleMutation.ts | 102 +- .../mutations/useCreateRlsModuleMutation.ts | 99 +- .../mutations/useCreateRouteModuleMutation.ts | 99 +- .../useCreateSecureTableProvisionMutation.ts | 102 +- .../useCreateSessionSecretsModuleMutation.ts | 102 +- .../useCreateSessionsModuleMutation.ts | 102 +- .../useCreateSiteSurfaceModuleMutation.ts | 102 +- .../useCreateStorageLogModuleMutation.ts | 102 +- .../useCreateStorageModuleMutation.ts | 99 +- .../useCreateTransferLogModuleMutation.ts | 102 +- .../useCreateUserAuthModuleMutation.ts | 102 +- .../useCreateUserCredentialsModuleMutation.ts | 98 +- .../useCreateUserSettingsModuleMutation.ts | 102 +- .../useCreateUserStateModuleMutation.ts | 102 +- .../mutations/useCreateUsersModuleMutation.ts | 99 +- .../useCreateWebauthnAuthModuleMutation.ts | 102 +- ...CreateWebauthnCredentialsModuleMutation.ts | 108 +- .../useCreateWebhookModuleMutation.ts | 99 +- .../mutations/useDeleteAgentModuleMutation.ts | 120 +- .../useDeleteApiSurfaceModuleMutation.ts | 120 +- .../mutations/useDeleteAppModuleMutation.ts | 120 +- .../useDeleteBillingModuleMutation.ts | 120 +- .../useDeleteBillingProviderModuleMutation.ts | 126 +- .../useDeleteBlueprintConstructionMutation.ts | 126 +- .../mutations/useDeleteBlueprintMutation.ts | 120 +- .../useDeleteBlueprintTemplateMutation.ts | 126 +- .../useDeleteCatalogModuleMutation.ts | 120 +- .../useDeleteComputeLogModuleMutation.ts | 120 +- ...seDeleteConfigSecretsUserModuleMutation.ts | 126 +- ...seDeleteConnectedAccountsModuleMutation.ts | 126 +- .../useDeleteCryptoAddressesModuleMutation.ts | 126 +- .../useDeleteCryptoAuthModuleMutation.ts | 120 +- ...seDeleteDatabaseProvisionModuleMutation.ts | 126 +- ...useDeleteDatabaseSettingsModuleMutation.ts | 126 +- .../useDeleteDbPoolConfigMutation.ts | 120 +- .../mutations/useDeleteDbPoolMutation.ts | 120 +- .../useDeleteDbPresetModuleMutation.ts | 120 +- .../useDeleteDbUsageModuleMutation.ts | 120 +- .../useDeleteDefaultIdsModuleMutation.ts | 120 +- ...useDeleteDenormalizedTableFieldMutation.ts | 126 +- .../useDeleteDevicesModuleMutation.ts | 120 +- .../useDeleteDomainModuleMutation.ts | 120 +- .../useDeleteEmailsModuleMutation.ts | 120 +- .../useDeleteEntityTypeProvisionMutation.ts | 122 +- .../useDeleteEventsModuleMutation.ts | 120 +- ...eDeleteFunctionDeploymentModuleMutation.ts | 126 +- ...eDeleteFunctionInvocationModuleMutation.ts | 126 +- .../useDeleteFunctionModuleMutation.ts | 120 +- .../useDeleteGraphExecutionModuleMutation.ts | 126 +- .../mutations/useDeleteGraphModuleMutation.ts | 120 +- .../useDeleteHierarchyModuleMutation.ts | 120 +- .../useDeleteHttpRouteModuleMutation.ts | 120 +- .../mutations/useDeleteI18NModuleMutation.ts | 120 +- ...seDeleteIdentityProvidersModuleMutation.ts | 122 +- .../useDeleteInferenceLogModuleMutation.ts | 126 +- .../useDeleteInfraConfigModuleMutation.ts | 126 +- .../useDeleteInfraSecretsModuleMutation.ts | 126 +- ...eleteIntegrationProvidersModuleMutation.ts | 124 +- .../useDeleteInternalSecretsModuleMutation.ts | 126 +- .../useDeleteInvitesModuleMutation.ts | 120 +- .../useDeleteLimitsModuleMutation.ts | 120 +- .../useDeleteMembershipTypesModuleMutation.ts | 126 +- .../useDeleteMembershipsModuleMutation.ts | 126 +- .../useDeleteMerkleStoreModuleMutation.ts | 126 +- .../useDeleteNamespaceModuleMutation.ts | 120 +- .../useDeleteNotificationsModuleMutation.ts | 126 +- .../useDeletePermissionsModuleMutation.ts | 126 +- .../useDeletePhoneNumbersModuleMutation.ts | 126 +- .../mutations/useDeletePlansModuleMutation.ts | 120 +- .../useDeletePrincipalAuthModuleMutation.ts | 126 +- .../useDeleteProfilesModuleMutation.ts | 120 +- .../useDeleteRateLimitMetersModuleMutation.ts | 126 +- .../useDeleteRateLimitsModuleMutation.ts | 120 +- .../useDeleteRealtimeModuleMutation.ts | 120 +- .../useDeleteRelationProvisionMutation.ts | 122 +- .../useDeleteResourceModuleMutation.ts | 120 +- .../mutations/useDeleteRlsModuleMutation.ts | 120 +- .../mutations/useDeleteRouteModuleMutation.ts | 120 +- .../useDeleteSecureTableProvisionMutation.ts | 126 +- .../useDeleteSessionSecretsModuleMutation.ts | 126 +- .../useDeleteSessionsModuleMutation.ts | 120 +- .../useDeleteSiteSurfaceModuleMutation.ts | 126 +- .../useDeleteStorageLogModuleMutation.ts | 120 +- .../useDeleteStorageModuleMutation.ts | 120 +- .../useDeleteTransferLogModuleMutation.ts | 126 +- .../useDeleteUserAuthModuleMutation.ts | 120 +- .../useDeleteUserCredentialsModuleMutation.ts | 122 +- .../useDeleteUserSettingsModuleMutation.ts | 126 +- .../useDeleteUserStateModuleMutation.ts | 120 +- .../mutations/useDeleteUsersModuleMutation.ts | 120 +- .../useDeleteWebauthnAuthModuleMutation.ts | 126 +- ...DeleteWebauthnCredentialsModuleMutation.ts | 128 +- .../useDeleteWebhookModuleMutation.ts | 120 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../useProvisionCheckConstraintMutation.ts | 78 +- .../useProvisionFullTextSearchMutation.ts | 76 +- .../mutations/useProvisionIndexMutation.ts | 73 +- .../mutations/useProvisionRelationMutation.ts | 76 +- .../useProvisionSpatialRelationMutation.ts | 78 +- .../mutations/useProvisionTableMutation.ts | 73 +- .../useProvisionUniqueConstraintMutation.ts | 78 +- .../mutations/useUpdateAgentModuleMutation.ts | 138 +- .../useUpdateApiSurfaceModuleMutation.ts | 134 +- .../mutations/useUpdateAppModuleMutation.ts | 138 +- .../useUpdateBillingModuleMutation.ts | 134 +- .../useUpdateBillingProviderModuleMutation.ts | 134 +- .../useUpdateBlueprintConstructionMutation.ts | 134 +- .../mutations/useUpdateBlueprintMutation.ts | 138 +- .../useUpdateBlueprintTemplateMutation.ts | 134 +- .../useUpdateCatalogModuleMutation.ts | 134 +- .../useUpdateComputeLogModuleMutation.ts | 134 +- ...seUpdateConfigSecretsUserModuleMutation.ts | 134 +- ...seUpdateConnectedAccountsModuleMutation.ts | 134 +- .../useUpdateCryptoAddressesModuleMutation.ts | 134 +- .../useUpdateCryptoAuthModuleMutation.ts | 134 +- ...seUpdateDatabaseProvisionModuleMutation.ts | 134 +- ...useUpdateDatabaseSettingsModuleMutation.ts | 134 +- .../useUpdateDbPoolConfigMutation.ts | 138 +- .../mutations/useUpdateDbPoolMutation.ts | 130 +- .../useUpdateDbPresetModuleMutation.ts | 134 +- .../useUpdateDbUsageModuleMutation.ts | 134 +- .../useUpdateDefaultIdsModuleMutation.ts | 134 +- ...useUpdateDenormalizedTableFieldMutation.ts | 134 +- .../useUpdateDevicesModuleMutation.ts | 134 +- .../useUpdateDomainModuleMutation.ts | 138 +- .../useUpdateEmailsModuleMutation.ts | 138 +- .../useUpdateEntityTypeProvisionMutation.ts | 130 +- .../useUpdateEventsModuleMutation.ts | 138 +- ...eUpdateFunctionDeploymentModuleMutation.ts | 134 +- ...eUpdateFunctionInvocationModuleMutation.ts | 134 +- .../useUpdateFunctionModuleMutation.ts | 134 +- .../useUpdateGraphExecutionModuleMutation.ts | 134 +- .../mutations/useUpdateGraphModuleMutation.ts | 138 +- .../useUpdateHierarchyModuleMutation.ts | 134 +- .../useUpdateHttpRouteModuleMutation.ts | 134 +- .../mutations/useUpdateI18NModuleMutation.ts | 138 +- ...seUpdateIdentityProvidersModuleMutation.ts | 130 +- .../useUpdateInferenceLogModuleMutation.ts | 134 +- .../useUpdateInfraConfigModuleMutation.ts | 134 +- .../useUpdateInfraSecretsModuleMutation.ts | 134 +- ...pdateIntegrationProvidersModuleMutation.ts | 132 +- .../useUpdateInternalSecretsModuleMutation.ts | 134 +- .../useUpdateInvitesModuleMutation.ts | 134 +- .../useUpdateLimitsModuleMutation.ts | 138 +- .../useUpdateMembershipTypesModuleMutation.ts | 134 +- .../useUpdateMembershipsModuleMutation.ts | 134 +- .../useUpdateMerkleStoreModuleMutation.ts | 134 +- .../useUpdateNamespaceModuleMutation.ts | 134 +- .../useUpdateNotificationsModuleMutation.ts | 134 +- .../useUpdatePermissionsModuleMutation.ts | 134 +- .../useUpdatePhoneNumbersModuleMutation.ts | 134 +- .../mutations/useUpdatePlansModuleMutation.ts | 138 +- .../useUpdatePrincipalAuthModuleMutation.ts | 134 +- .../useUpdateProfilesModuleMutation.ts | 134 +- .../useUpdateRateLimitMetersModuleMutation.ts | 134 +- .../useUpdateRateLimitsModuleMutation.ts | 134 +- .../useUpdateRealtimeModuleMutation.ts | 134 +- .../useUpdateRelationProvisionMutation.ts | 130 +- .../useUpdateResourceModuleMutation.ts | 134 +- .../mutations/useUpdateRlsModuleMutation.ts | 138 +- .../mutations/useUpdateRouteModuleMutation.ts | 138 +- .../useUpdateSecureTableProvisionMutation.ts | 134 +- .../useUpdateSessionSecretsModuleMutation.ts | 134 +- .../useUpdateSessionsModuleMutation.ts | 134 +- .../useUpdateSiteSurfaceModuleMutation.ts | 134 +- .../useUpdateStorageLogModuleMutation.ts | 134 +- .../useUpdateStorageModuleMutation.ts | 134 +- .../useUpdateTransferLogModuleMutation.ts | 134 +- .../useUpdateUserAuthModuleMutation.ts | 134 +- .../useUpdateUserCredentialsModuleMutation.ts | 130 +- .../useUpdateUserSettingsModuleMutation.ts | 134 +- .../useUpdateUserStateModuleMutation.ts | 134 +- .../mutations/useUpdateUsersModuleMutation.ts | 138 +- .../useUpdateWebauthnAuthModuleMutation.ts | 134 +- ...UpdateWebauthnCredentialsModuleMutation.ts | 136 +- .../useUpdateWebhookModuleMutation.ts | 134 +- .../src/modules/hooks/queries/index.ts | 304 +- .../hooks/queries/useAgentModuleQuery.ts | 131 +- .../hooks/queries/useAgentModulesQuery.ts | 125 +- .../hooks/queries/useApiSurfaceModuleQuery.ts | 131 +- .../queries/useApiSurfaceModulesQuery.ts | 145 +- .../hooks/queries/useAppModuleQuery.ts | 131 +- .../hooks/queries/useAppModulesQuery.ts | 125 +- .../hooks/queries/useBillingModuleQuery.ts | 131 +- .../hooks/queries/useBillingModulesQuery.ts | 131 +- .../queries/useBillingProviderModuleQuery.ts | 141 +- .../queries/useBillingProviderModulesQuery.ts | 166 +- .../queries/useBlueprintConstructionQuery.ts | 141 +- .../queries/useBlueprintConstructionsQuery.ts | 166 +- .../hooks/queries/useBlueprintQuery.ts | 131 +- .../queries/useBlueprintTemplateQuery.ts | 137 +- .../queries/useBlueprintTemplatesQuery.ts | 145 +- .../hooks/queries/useBlueprintsQuery.ts | 125 +- .../hooks/queries/useCatalogModuleQuery.ts | 131 +- .../hooks/queries/useCatalogModulesQuery.ts | 131 +- .../hooks/queries/useComputeLogModuleQuery.ts | 131 +- .../queries/useComputeLogModulesQuery.ts | 145 +- .../useConfigSecretsUserModuleQuery.ts | 141 +- .../useConfigSecretsUserModulesQuery.ts | 168 +- .../useConnectedAccountsModuleQuery.ts | 141 +- .../useConnectedAccountsModulesQuery.ts | 168 +- .../queries/useCryptoAddressesModuleQuery.ts | 141 +- .../queries/useCryptoAddressesModulesQuery.ts | 166 +- .../hooks/queries/useCryptoAuthModuleQuery.ts | 131 +- .../queries/useCryptoAuthModulesQuery.ts | 145 +- .../useDatabaseProvisionModuleQuery.ts | 141 +- .../useDatabaseProvisionModulesQuery.ts | 168 +- .../queries/useDatabaseSettingsModuleQuery.ts | 141 +- .../useDatabaseSettingsModulesQuery.ts | 166 +- .../hooks/queries/useDbPoolConfigQuery.ts | 131 +- .../hooks/queries/useDbPoolConfigsQuery.ts | 125 +- .../modules/hooks/queries/useDbPoolQuery.ts | 131 +- .../modules/hooks/queries/useDbPoolsQuery.ts | 113 +- .../hooks/queries/useDbPresetModuleQuery.ts | 131 +- .../hooks/queries/useDbPresetModulesQuery.ts | 139 +- .../hooks/queries/useDbUsageModuleQuery.ts | 131 +- .../hooks/queries/useDbUsageModulesQuery.ts | 131 +- .../hooks/queries/useDefaultIdsModuleQuery.ts | 131 +- .../queries/useDefaultIdsModulesQuery.ts | 145 +- .../queries/useDenormalizedTableFieldQuery.ts | 141 +- .../useDenormalizedTableFieldsQuery.ts | 166 +- .../hooks/queries/useDevicesModuleQuery.ts | 131 +- .../hooks/queries/useDevicesModulesQuery.ts | 131 +- .../hooks/queries/useDomainModuleQuery.ts | 131 +- .../hooks/queries/useDomainModulesQuery.ts | 125 +- .../hooks/queries/useEmailsModuleQuery.ts | 131 +- .../hooks/queries/useEmailsModulesQuery.ts | 125 +- .../queries/useEntityTypeProvisionQuery.ts | 131 +- .../queries/useEntityTypeProvisionsQuery.ts | 150 +- .../hooks/queries/useEventsModuleQuery.ts | 131 +- .../hooks/queries/useEventsModulesQuery.ts | 125 +- .../useFunctionDeploymentModuleQuery.ts | 146 +- .../useFunctionDeploymentModulesQuery.ts | 168 +- .../useFunctionInvocationModuleQuery.ts | 146 +- .../useFunctionInvocationModulesQuery.ts | 168 +- .../hooks/queries/useFunctionModuleQuery.ts | 131 +- .../hooks/queries/useFunctionModulesQuery.ts | 139 +- .../queries/useGraphExecutionModuleQuery.ts | 137 +- .../queries/useGraphExecutionModulesQuery.ts | 162 +- .../hooks/queries/useGraphModuleQuery.ts | 131 +- .../hooks/queries/useGraphModulesQuery.ts | 125 +- .../hooks/queries/useHierarchyModuleQuery.ts | 131 +- .../hooks/queries/useHierarchyModulesQuery.ts | 145 +- .../hooks/queries/useHttpRouteModuleQuery.ts | 131 +- .../hooks/queries/useHttpRouteModulesQuery.ts | 145 +- .../hooks/queries/useI18NModuleQuery.ts | 131 +- .../hooks/queries/useI18nModulesQuery.ts | 125 +- .../useIdentityProvidersModuleQuery.ts | 135 +- .../useIdentityProvidersModulesQuery.ts | 162 +- .../queries/useInferenceLogModuleQuery.ts | 137 +- .../queries/useInferenceLogModulesQuery.ts | 153 +- .../queries/useInfraConfigModuleQuery.ts | 137 +- .../queries/useInfraConfigModulesQuery.ts | 145 +- .../queries/useInfraSecretsModuleQuery.ts | 137 +- .../queries/useInfraSecretsModulesQuery.ts | 153 +- .../useIntegrationProvidersModuleQuery.ts | 143 +- .../useIntegrationProvidersModulesQuery.ts | 162 +- .../queries/useInternalSecretsModuleQuery.ts | 141 +- .../queries/useInternalSecretsModulesQuery.ts | 166 +- .../hooks/queries/useInvitesModuleQuery.ts | 131 +- .../hooks/queries/useInvitesModulesQuery.ts | 131 +- .../hooks/queries/useLimitsModuleQuery.ts | 131 +- .../hooks/queries/useLimitsModulesQuery.ts | 125 +- .../queries/useMembershipTypesModuleQuery.ts | 141 +- .../queries/useMembershipTypesModulesQuery.ts | 166 +- .../queries/useMembershipsModuleQuery.ts | 137 +- .../queries/useMembershipsModulesQuery.ts | 145 +- .../queries/useMerkleStoreModuleQuery.ts | 137 +- .../queries/useMerkleStoreModulesQuery.ts | 145 +- .../hooks/queries/useNamespaceModuleQuery.ts | 131 +- .../hooks/queries/useNamespaceModulesQuery.ts | 145 +- .../queries/useNotificationsModuleQuery.ts | 137 +- .../queries/useNotificationsModulesQuery.ts | 156 +- .../queries/usePermissionsModuleQuery.ts | 137 +- .../queries/usePermissionsModulesQuery.ts | 145 +- .../queries/usePhoneNumbersModuleQuery.ts | 137 +- .../queries/usePhoneNumbersModulesQuery.ts | 153 +- .../hooks/queries/usePlansModuleQuery.ts | 131 +- .../hooks/queries/usePlansModulesQuery.ts | 125 +- .../queries/usePrincipalAuthModuleQuery.ts | 137 +- .../queries/usePrincipalAuthModulesQuery.ts | 156 +- .../hooks/queries/useProfilesModuleQuery.ts | 131 +- .../hooks/queries/useProfilesModulesQuery.ts | 139 +- .../queries/useRateLimitMetersModuleQuery.ts | 141 +- .../queries/useRateLimitMetersModulesQuery.ts | 166 +- .../hooks/queries/useRateLimitsModuleQuery.ts | 131 +- .../queries/useRateLimitsModulesQuery.ts | 145 +- .../hooks/queries/useRealtimeModuleQuery.ts | 131 +- .../hooks/queries/useRealtimeModulesQuery.ts | 139 +- .../queries/useRelationProvisionQuery.ts | 131 +- .../queries/useRelationProvisionsQuery.ts | 139 +- .../queries/useResolveBlueprintFieldQuery.ts | 92 +- .../queries/useResolveBlueprintTableQuery.ts | 92 +- .../hooks/queries/useResourceModuleQuery.ts | 131 +- .../hooks/queries/useResourceModulesQuery.ts | 139 +- .../hooks/queries/useRlsModuleQuery.ts | 131 +- .../hooks/queries/useRlsModulesQuery.ts | 125 +- .../hooks/queries/useRouteModuleQuery.ts | 131 +- .../hooks/queries/useRouteModulesQuery.ts | 125 +- .../queries/useSecureTableProvisionQuery.ts | 137 +- .../queries/useSecureTableProvisionsQuery.ts | 162 +- .../queries/useSessionSecretsModuleQuery.ts | 137 +- .../queries/useSessionSecretsModulesQuery.ts | 162 +- .../hooks/queries/useSessionsModuleQuery.ts | 131 +- .../hooks/queries/useSessionsModulesQuery.ts | 139 +- .../queries/useSiteSurfaceModuleQuery.ts | 137 +- .../queries/useSiteSurfaceModulesQuery.ts | 145 +- .../hooks/queries/useStorageLogModuleQuery.ts | 131 +- .../queries/useStorageLogModulesQuery.ts | 145 +- .../hooks/queries/useStorageModuleQuery.ts | 131 +- .../hooks/queries/useStorageModulesQuery.ts | 131 +- .../queries/useTransferLogModuleQuery.ts | 137 +- .../queries/useTransferLogModulesQuery.ts | 145 +- .../hooks/queries/useUserAuthModuleQuery.ts | 131 +- .../hooks/queries/useUserAuthModulesQuery.ts | 139 +- .../queries/useUserCredentialsModuleQuery.ts | 135 +- .../queries/useUserCredentialsModulesQuery.ts | 160 +- .../queries/useUserSettingsModuleQuery.ts | 137 +- .../queries/useUserSettingsModulesQuery.ts | 153 +- .../hooks/queries/useUserStateModuleQuery.ts | 131 +- .../hooks/queries/useUserStateModulesQuery.ts | 145 +- .../hooks/queries/useUsersModuleQuery.ts | 131 +- .../hooks/queries/useUsersModulesQuery.ts | 125 +- .../queries/useWebauthnAuthModuleQuery.ts | 137 +- .../queries/useWebauthnAuthModulesQuery.ts | 153 +- .../useWebauthnCredentialsModuleQuery.ts | 146 +- .../useWebauthnCredentialsModulesQuery.ts | 168 +- .../hooks/queries/useWebhookModuleQuery.ts | 131 +- .../hooks/queries/useWebhookModulesQuery.ts | 131 +- .../src/modules/hooks/query-keys.ts | 909 +++-- .../src/modules/hooks/selection.ts | 18 +- sdk/constructive-react/src/modules/index.ts | 6 +- .../src/modules/orm/client.ts | 43 +- .../src/modules/orm/index.ts | 176 +- .../src/modules/orm/input-types.ts | 3231 +++++++++++++++- .../src/modules/orm/models/agentModule.ts | 275 +- .../modules/orm/models/apiSurfaceModule.ts | 275 +- .../src/modules/orm/models/appModule.ts | 275 +- .../src/modules/orm/models/billingModule.ts | 275 +- .../orm/models/billingProviderModule.ts | 279 +- .../src/modules/orm/models/blueprint.ts | 275 +- .../orm/models/blueprintConstruction.ts | 279 +- .../modules/orm/models/blueprintTemplate.ts | 275 +- .../src/modules/orm/models/catalogModule.ts | 275 +- .../modules/orm/models/computeLogModule.ts | 275 +- .../orm/models/configSecretsUserModule.ts | 279 +- .../orm/models/connectedAccountsModule.ts | 279 +- .../orm/models/cryptoAddressesModule.ts | 279 +- .../modules/orm/models/cryptoAuthModule.ts | 275 +- .../orm/models/databaseProvisionModule.ts | 279 +- .../orm/models/databaseSettingsModule.ts | 279 +- .../src/modules/orm/models/dbPool.ts | 275 +- .../src/modules/orm/models/dbPoolConfig.ts | 275 +- .../src/modules/orm/models/dbPresetModule.ts | 275 +- .../src/modules/orm/models/dbUsageModule.ts | 275 +- .../modules/orm/models/defaultIdsModule.ts | 275 +- .../orm/models/denormalizedTableField.ts | 279 +- .../src/modules/orm/models/devicesModule.ts | 275 +- .../src/modules/orm/models/domainModule.ts | 275 +- .../src/modules/orm/models/emailsModule.ts | 275 +- .../modules/orm/models/entityTypeProvision.ts | 275 +- .../src/modules/orm/models/eventsModule.ts | 275 +- .../orm/models/functionDeploymentModule.ts | 279 +- .../orm/models/functionInvocationModule.ts | 279 +- .../src/modules/orm/models/functionModule.ts | 275 +- .../orm/models/graphExecutionModule.ts | 279 +- .../src/modules/orm/models/graphModule.ts | 275 +- .../src/modules/orm/models/hierarchyModule.ts | 275 +- .../src/modules/orm/models/httpRouteModule.ts | 275 +- .../src/modules/orm/models/i18NModule.ts | 275 +- .../orm/models/identityProvidersModule.ts | 279 +- .../src/modules/orm/models/index.ts | 150 +- .../modules/orm/models/inferenceLogModule.ts | 275 +- .../modules/orm/models/infraConfigModule.ts | 275 +- .../modules/orm/models/infraSecretsModule.ts | 275 +- .../orm/models/integrationProvidersModule.ts | 289 +- .../orm/models/internalSecretsModule.ts | 279 +- .../src/modules/orm/models/invitesModule.ts | 275 +- .../src/modules/orm/models/limitsModule.ts | 275 +- .../orm/models/membershipTypesModule.ts | 279 +- .../modules/orm/models/membershipsModule.ts | 275 +- .../modules/orm/models/merkleStoreModule.ts | 275 +- .../src/modules/orm/models/namespaceModule.ts | 275 +- .../modules/orm/models/notificationsModule.ts | 275 +- .../modules/orm/models/permissionsModule.ts | 275 +- .../modules/orm/models/phoneNumbersModule.ts | 275 +- .../src/modules/orm/models/plansModule.ts | 275 +- .../modules/orm/models/principalAuthModule.ts | 275 +- .../src/modules/orm/models/profilesModule.ts | 275 +- .../orm/models/rateLimitMetersModule.ts | 279 +- .../modules/orm/models/rateLimitsModule.ts | 275 +- .../src/modules/orm/models/realtimeModule.ts | 275 +- .../modules/orm/models/relationProvision.ts | 275 +- .../src/modules/orm/models/resourceModule.ts | 275 +- .../src/modules/orm/models/rlsModule.ts | 275 +- .../src/modules/orm/models/routeModule.ts | 275 +- .../orm/models/secureTableProvision.ts | 279 +- .../orm/models/sessionSecretsModule.ts | 279 +- .../src/modules/orm/models/sessionsModule.ts | 275 +- .../modules/orm/models/siteSurfaceModule.ts | 275 +- .../modules/orm/models/storageLogModule.ts | 275 +- .../src/modules/orm/models/storageModule.ts | 275 +- .../modules/orm/models/transferLogModule.ts | 275 +- .../src/modules/orm/models/userAuthModule.ts | 275 +- .../orm/models/userCredentialsModule.ts | 279 +- .../modules/orm/models/userSettingsModule.ts | 275 +- .../src/modules/orm/models/userStateModule.ts | 275 +- .../src/modules/orm/models/usersModule.ts | 275 +- .../modules/orm/models/webauthnAuthModule.ts | 275 +- .../orm/models/webauthnCredentialsModule.ts | 279 +- .../src/modules/orm/models/webhookModule.ts | 275 +- .../src/modules/orm/mutation/index.ts | 473 ++- .../src/modules/orm/query-builder.ts | 215 +- .../src/modules/orm/query/index.ts | 138 +- .../src/modules/orm/realtime.ts | 37 +- .../src/modules/orm/select-types.ts | 22 +- .../src/modules/schema-types.ts | 3248 ++++++++++++++++- sdk/constructive-react/src/modules/types.ts | 2 +- .../src/objects/hooks/client.ts | 4 +- .../src/objects/hooks/index.ts | 24 +- .../src/objects/hooks/invalidation.ts | 155 +- .../src/objects/hooks/mutation-keys.ts | 76 +- .../src/objects/hooks/mutations/index.ts | 34 +- .../mutations/useCreateCommitMutation.ts | 91 +- .../useCreateGetAllTreeNodesRecordMutation.ts | 102 +- .../mutations/useCreateObjectMutation.ts | 91 +- .../hooks/mutations/useCreateRefMutation.ts | 91 +- .../hooks/mutations/useCreateStoreMutation.ts | 91 +- .../mutations/useDeleteCommitMutation.ts | 130 +- .../mutations/useDeleteObjectMutation.ts | 130 +- .../hooks/mutations/useDeleteRefMutation.ts | 130 +- .../hooks/mutations/useDeleteStoreMutation.ts | 120 +- .../mutations/useInitEmptyRepoMutation.ts | 73 +- .../mutations/useInsertNodeAtPathMutation.ts | 73 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../mutations/useSetDataAtPathMutation.ts | 73 +- .../mutations/useUpdateCommitMutation.ts | 134 +- .../mutations/useUpdateObjectMutation.ts | 134 +- .../hooks/mutations/useUpdateRefMutation.ts | 134 +- .../hooks/mutations/useUpdateStoreMutation.ts | 130 +- .../src/objects/hooks/queries/index.ts | 18 +- .../objects/hooks/queries/useCommitQuery.ts | 131 +- .../objects/hooks/queries/useCommitsQuery.ts | 113 +- .../hooks/queries/useGetAllTreeNodesQuery.ts | 154 +- .../objects/hooks/queries/useObjectQuery.ts | 131 +- .../objects/hooks/queries/useObjectsQuery.ts | 113 +- .../src/objects/hooks/queries/useRefQuery.ts | 131 +- .../src/objects/hooks/queries/useRefsQuery.ts | 103 +- .../objects/hooks/queries/useStoreQuery.ts | 131 +- .../objects/hooks/queries/useStoresQuery.ts | 113 +- .../src/objects/hooks/query-keys.ts | 62 +- .../src/objects/hooks/selection.ts | 18 +- sdk/constructive-react/src/objects/index.ts | 6 +- .../src/objects/orm/client.ts | 43 +- .../src/objects/orm/index.ts | 32 +- .../src/objects/orm/input-types.ts | 84 +- .../src/objects/orm/models/commit.ts | 285 +- .../orm/models/getAllTreeNodesRecord.ts | 149 +- .../src/objects/orm/models/index.ts | 10 +- .../src/objects/orm/models/object.ts | 271 +- .../src/objects/orm/models/ref.ts | 285 +- .../src/objects/orm/models/store.ts | 275 +- .../src/objects/orm/mutation/index.ts | 197 +- .../src/objects/orm/query-builder.ts | 215 +- .../src/objects/orm/realtime.ts | 37 +- .../src/objects/orm/select-types.ts | 22 +- .../src/objects/schema-types.ts | 97 +- sdk/constructive-react/src/objects/types.ts | 2 +- .../src/usage/hooks/client.ts | 4 +- .../src/usage/hooks/index.ts | 24 +- .../src/usage/hooks/invalidation.ts | 643 ++-- .../src/usage/hooks/mutation-keys.ts | 233 +- .../src/usage/hooks/mutations/index.ts | 118 +- .../mutations/useCreateAppLimitCapMutation.ts | 99 +- .../useCreateAppLimitCapsDefaultMutation.ts | 102 +- ...useCreateAppLimitCreditCodeItemMutation.ts | 102 +- .../useCreateAppLimitCreditCodeMutation.ts | 102 +- .../useCreateAppLimitCreditMutation.ts | 102 +- ...eCreateAppLimitCreditRedemptionMutation.ts | 102 +- .../useCreateAppLimitDefaultMutation.ts | 102 +- .../useCreateAppLimitEventMutation.ts | 99 +- .../mutations/useCreateAppLimitMutation.ts | 99 +- .../useCreateAppLimitWarningMutation.ts | 102 +- .../useCreateOrgLimitAggregateMutation.ts | 102 +- .../mutations/useCreateOrgLimitCapMutation.ts | 99 +- .../useCreateOrgLimitCapsDefaultMutation.ts | 102 +- .../useCreateOrgLimitCreditMutation.ts | 102 +- .../useCreateOrgLimitDefaultMutation.ts | 102 +- .../useCreateOrgLimitEventMutation.ts | 99 +- .../mutations/useCreateOrgLimitMutation.ts | 99 +- .../useCreateOrgLimitWarningMutation.ts | 102 +- .../mutations/useDeleteAppLimitCapMutation.ts | 120 +- .../useDeleteAppLimitCapsDefaultMutation.ts | 126 +- ...useDeleteAppLimitCreditCodeItemMutation.ts | 126 +- .../useDeleteAppLimitCreditCodeMutation.ts | 126 +- .../useDeleteAppLimitCreditMutation.ts | 120 +- ...eDeleteAppLimitCreditRedemptionMutation.ts | 126 +- .../useDeleteAppLimitDefaultMutation.ts | 120 +- .../useDeleteAppLimitEventMutation.ts | 130 +- .../mutations/useDeleteAppLimitMutation.ts | 120 +- .../useDeleteAppLimitWarningMutation.ts | 120 +- .../useDeleteOrgLimitAggregateMutation.ts | 126 +- .../mutations/useDeleteOrgLimitCapMutation.ts | 120 +- .../useDeleteOrgLimitCapsDefaultMutation.ts | 126 +- .../useDeleteOrgLimitCreditMutation.ts | 120 +- .../useDeleteOrgLimitDefaultMutation.ts | 120 +- .../useDeleteOrgLimitEventMutation.ts | 130 +- .../mutations/useDeleteOrgLimitMutation.ts | 120 +- .../useDeleteOrgLimitWarningMutation.ts | 120 +- .../mutations/useProvisionBucketMutation.ts | 73 +- .../useSeedAppLimitCapsDefaultsMutation.ts | 78 +- .../useSeedAppLimitDefaultsMutation.ts | 76 +- .../useSeedOrgLimitCapsDefaultsMutation.ts | 78 +- .../useSeedOrgLimitDefaultsMutation.ts | 76 +- .../mutations/useUpdateAppLimitCapMutation.ts | 138 +- .../useUpdateAppLimitCapsDefaultMutation.ts | 134 +- ...useUpdateAppLimitCreditCodeItemMutation.ts | 134 +- .../useUpdateAppLimitCreditCodeMutation.ts | 134 +- .../useUpdateAppLimitCreditMutation.ts | 134 +- ...eUpdateAppLimitCreditRedemptionMutation.ts | 134 +- .../useUpdateAppLimitDefaultMutation.ts | 134 +- .../useUpdateAppLimitEventMutation.ts | 142 +- .../mutations/useUpdateAppLimitMutation.ts | 130 +- .../useUpdateAppLimitWarningMutation.ts | 134 +- .../useUpdateOrgLimitAggregateMutation.ts | 134 +- .../mutations/useUpdateOrgLimitCapMutation.ts | 138 +- .../useUpdateOrgLimitCapsDefaultMutation.ts | 134 +- .../useUpdateOrgLimitCreditMutation.ts | 134 +- .../useUpdateOrgLimitDefaultMutation.ts | 134 +- .../useUpdateOrgLimitEventMutation.ts | 142 +- .../mutations/useUpdateOrgLimitMutation.ts | 130 +- .../useUpdateOrgLimitWarningMutation.ts | 134 +- .../src/usage/hooks/queries/index.ts | 72 +- .../hooks/queries/useAppLimitCapQuery.ts | 131 +- .../queries/useAppLimitCapsDefaultQuery.ts | 137 +- .../queries/useAppLimitCapsDefaultsQuery.ts | 156 +- .../hooks/queries/useAppLimitCapsQuery.ts | 125 +- .../queries/useAppLimitCreditCodeItemQuery.ts | 141 +- .../useAppLimitCreditCodeItemsQuery.ts | 166 +- .../queries/useAppLimitCreditCodeQuery.ts | 137 +- .../queries/useAppLimitCreditCodesQuery.ts | 153 +- .../hooks/queries/useAppLimitCreditQuery.ts | 131 +- .../useAppLimitCreditRedemptionQuery.ts | 146 +- .../useAppLimitCreditRedemptionsQuery.ts | 168 +- .../hooks/queries/useAppLimitCreditsQuery.ts | 139 +- .../hooks/queries/useAppLimitDefaultQuery.ts | 131 +- .../hooks/queries/useAppLimitDefaultsQuery.ts | 145 +- .../hooks/queries/useAppLimitEventQuery.ts | 131 +- .../hooks/queries/useAppLimitEventsQuery.ts | 131 +- .../usage/hooks/queries/useAppLimitQuery.ts | 131 +- .../hooks/queries/useAppLimitWarningQuery.ts | 131 +- .../hooks/queries/useAppLimitWarningsQuery.ts | 145 +- .../usage/hooks/queries/useAppLimitsQuery.ts | 125 +- .../queries/useOrgLimitAggregateQuery.ts | 137 +- .../queries/useOrgLimitAggregatesQuery.ts | 145 +- .../hooks/queries/useOrgLimitCapQuery.ts | 131 +- .../queries/useOrgLimitCapsDefaultQuery.ts | 137 +- .../queries/useOrgLimitCapsDefaultsQuery.ts | 156 +- .../hooks/queries/useOrgLimitCapsQuery.ts | 125 +- .../hooks/queries/useOrgLimitCreditQuery.ts | 131 +- .../hooks/queries/useOrgLimitCreditsQuery.ts | 139 +- .../hooks/queries/useOrgLimitDefaultQuery.ts | 131 +- .../hooks/queries/useOrgLimitDefaultsQuery.ts | 145 +- .../hooks/queries/useOrgLimitEventQuery.ts | 131 +- .../hooks/queries/useOrgLimitEventsQuery.ts | 131 +- .../usage/hooks/queries/useOrgLimitQuery.ts | 131 +- .../hooks/queries/useOrgLimitWarningQuery.ts | 131 +- .../hooks/queries/useOrgLimitWarningsQuery.ts | 145 +- .../usage/hooks/queries/useOrgLimitsQuery.ts | 125 +- .../src/usage/hooks/query-keys.ts | 218 +- .../src/usage/hooks/selection.ts | 18 +- sdk/constructive-react/src/usage/index.ts | 6 +- .../src/usage/orm/client.ts | 43 +- sdk/constructive-react/src/usage/orm/index.ts | 58 +- .../src/usage/orm/input-types.ts | 376 +- .../src/usage/orm/models/appLimit.ts | 275 +- .../src/usage/orm/models/appLimitCap.ts | 275 +- .../usage/orm/models/appLimitCapsDefault.ts | 275 +- .../src/usage/orm/models/appLimitCredit.ts | 275 +- .../usage/orm/models/appLimitCreditCode.ts | 275 +- .../orm/models/appLimitCreditCodeItem.ts | 279 +- .../orm/models/appLimitCreditRedemption.ts | 279 +- .../src/usage/orm/models/appLimitDefault.ts | 275 +- .../src/usage/orm/models/appLimitEvent.ts | 285 +- .../src/usage/orm/models/appLimitWarning.ts | 275 +- .../src/usage/orm/models/index.ts | 36 +- .../src/usage/orm/models/orgLimit.ts | 275 +- .../src/usage/orm/models/orgLimitAggregate.ts | 275 +- .../src/usage/orm/models/orgLimitCap.ts | 275 +- .../usage/orm/models/orgLimitCapsDefault.ts | 275 +- .../src/usage/orm/models/orgLimitCredit.ts | 275 +- .../src/usage/orm/models/orgLimitDefault.ts | 275 +- .../src/usage/orm/models/orgLimitEvent.ts | 285 +- .../src/usage/orm/models/orgLimitWarning.ts | 275 +- .../src/usage/orm/mutation/index.ts | 243 +- .../src/usage/orm/query-builder.ts | 215 +- .../src/usage/orm/realtime.ts | 37 +- .../src/usage/orm/select-types.ts | 22 +- .../src/usage/schema-types.ts | 390 +- sdk/constructive-react/src/usage/types.ts | 2 +- sdk/constructive-sdk/src/admin/index.ts | 2 +- sdk/constructive-sdk/src/admin/orm/client.ts | 43 +- sdk/constructive-sdk/src/admin/orm/index.ts | 78 +- .../src/admin/orm/input-types.ts | 585 ++- .../src/admin/orm/models/appAdminGrant.ts | 275 +- .../src/admin/orm/models/appClaimedInvite.ts | 275 +- .../src/admin/orm/models/appGrant.ts | 275 +- .../src/admin/orm/models/appInvite.ts | 275 +- .../src/admin/orm/models/appMembership.ts | 275 +- .../admin/orm/models/appMembershipDefault.ts | 279 +- .../src/admin/orm/models/appOwnerGrant.ts | 275 +- .../src/admin/orm/models/appPermission.ts | 275 +- .../admin/orm/models/appPermissionDefault.ts | 279 +- .../orm/models/appPermissionDefaultGrant.ts | 279 +- .../models/appPermissionDefaultPermission.ts | 315 +- .../src/admin/orm/models/index.ts | 52 +- .../src/admin/orm/models/membershipType.ts | 275 +- .../src/admin/orm/models/orgAdminGrant.ts | 275 +- .../src/admin/orm/models/orgClaimedInvite.ts | 275 +- .../src/admin/orm/models/orgGrant.ts | 275 +- .../src/admin/orm/models/orgInvite.ts | 275 +- .../src/admin/orm/models/orgMember.ts | 275 +- .../src/admin/orm/models/orgMemberProfile.ts | 275 +- .../src/admin/orm/models/orgMembership.ts | 275 +- .../admin/orm/models/orgMembershipDefault.ts | 279 +- .../admin/orm/models/orgMembershipSetting.ts | 279 +- .../src/admin/orm/models/orgOwnerGrant.ts | 275 +- .../src/admin/orm/models/orgPermission.ts | 275 +- .../admin/orm/models/orgPermissionDefault.ts | 279 +- .../orm/models/orgPermissionDefaultGrant.ts | 279 +- .../models/orgPermissionDefaultPermission.ts | 315 +- .../src/admin/orm/mutation/index.ts | 151 +- .../src/admin/orm/query-builder.ts | 215 +- .../src/admin/orm/query/index.ts | 398 +- .../src/admin/orm/realtime.ts | 37 +- .../src/admin/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/agent/index.ts | 2 +- sdk/constructive-sdk/src/agent/orm/client.ts | 43 +- sdk/constructive-sdk/src/agent/orm/index.ts | 40 +- .../src/agent/orm/input-types.ts | 329 +- .../src/agent/orm/models/agent.ts | 275 +- .../src/agent/orm/models/agentMessage.ts | 275 +- .../src/agent/orm/models/agentPersona.ts | 275 +- .../src/agent/orm/models/agentPlan.ts | 275 +- .../src/agent/orm/models/agentPrompt.ts | 275 +- .../src/agent/orm/models/agentResource.ts | 275 +- .../agent/orm/models/agentResourceChunk.ts | 275 +- .../src/agent/orm/models/agentTask.ts | 275 +- .../src/agent/orm/models/agentThread.ts | 275 +- .../src/agent/orm/models/index.ts | 18 +- .../src/agent/orm/mutation/index.ts | 59 +- .../src/agent/orm/query-builder.ts | 215 +- .../src/agent/orm/realtime.ts | 37 +- .../src/agent/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/api/index.ts | 2 +- sdk/constructive-sdk/src/api/orm/client.ts | 43 +- sdk/constructive-sdk/src/api/orm/index.ts | 156 +- .../src/api/orm/input-types.ts | 2008 +++++++++- .../src/api/orm/models/api.ts | 275 +- .../src/api/orm/models/apiModule.ts | 275 +- .../src/api/orm/models/apiSchema.ts | 275 +- .../src/api/orm/models/apiSetting.ts | 275 +- .../src/api/orm/models/astMigration.ts | 194 +- .../src/api/orm/models/checkConstraint.ts | 275 +- .../src/api/orm/models/compositeType.ts | 275 +- .../src/api/orm/models/corsSetting.ts | 275 +- .../src/api/orm/models/database.ts | 275 +- .../src/api/orm/models/databaseSetting.ts | 275 +- .../src/api/orm/models/databaseTransfer.ts | 275 +- .../src/api/orm/models/defaultPrivilege.ts | 275 +- .../src/api/orm/models/domain.ts | 275 +- .../src/api/orm/models/domainEvent.ts | 275 +- .../src/api/orm/models/domainVerification.ts | 275 +- .../src/api/orm/models/embeddingChunk.ts | 275 +- .../src/api/orm/models/enum.ts | 275 +- .../src/api/orm/models/exclusionConstraint.ts | 275 +- .../src/api/orm/models/field.ts | 275 +- .../api/orm/models/foreignKeyConstraint.ts | 279 +- .../src/api/orm/models/fullTextSearch.ts | 275 +- .../src/api/orm/models/function.ts | 275 +- .../src/api/orm/models/hostnameBinding.ts | 275 +- .../src/api/orm/models/httpRoute.ts | 275 +- .../src/api/orm/models/index.ts | 130 +- .../src/api/orm/models/indexModel.ts | 275 +- .../src/api/orm/models/managedDomain.ts | 275 +- .../src/api/orm/models/nodeTypeRegistry.ts | 275 +- .../src/api/orm/models/partition.ts | 275 +- .../src/api/orm/models/platformApi.ts | 275 +- .../src/api/orm/models/platformApiModule.ts | 275 +- .../src/api/orm/models/platformApiSchema.ts | 275 +- .../src/api/orm/models/platformApiSetting.ts | 275 +- .../src/api/orm/models/platformCorsSetting.ts | 275 +- .../src/api/orm/models/platformDomain.ts | 275 +- .../src/api/orm/models/platformDomainEvent.ts | 275 +- .../orm/models/platformDomainVerification.ts | 289 +- .../api/orm/models/platformManagedDomain.ts | 279 +- .../src/api/orm/models/platformSite.ts | 275 +- .../api/orm/models/platformSiteMetadatum.ts | 279 +- .../src/api/orm/models/platformSiteModule.ts | 275 +- .../src/api/orm/models/platformSiteTheme.ts | 275 +- .../src/api/orm/models/policy.ts | 275 +- .../api/orm/models/primaryKeyConstraint.ts | 279 +- .../src/api/orm/models/pubkeySetting.ts | 275 +- .../src/api/orm/models/rlsSetting.ts | 275 +- .../src/api/orm/models/route.ts | 275 +- .../src/api/orm/models/routeBinding.ts | 275 +- .../src/api/orm/models/schema.ts | 275 +- .../src/api/orm/models/schemaGrant.ts | 275 +- .../src/api/orm/models/site.ts | 275 +- .../src/api/orm/models/siteMetadatum.ts | 275 +- .../src/api/orm/models/siteModule.ts | 275 +- .../src/api/orm/models/siteTheme.ts | 275 +- .../src/api/orm/models/spatialRelation.ts | 275 +- .../src/api/orm/models/sqlAction.ts | 194 +- .../src/api/orm/models/table.ts | 275 +- .../src/api/orm/models/tableGrant.ts | 275 +- .../src/api/orm/models/trigger.ts | 275 +- .../src/api/orm/models/triggerFunction.ts | 275 +- .../src/api/orm/models/uniqueConstraint.ts | 275 +- .../src/api/orm/models/view.ts | 275 +- .../src/api/orm/models/viewGrant.ts | 275 +- .../src/api/orm/models/viewRule.ts | 275 +- .../src/api/orm/models/viewTable.ts | 275 +- .../src/api/orm/models/webauthnSetting.ts | 275 +- .../src/api/orm/mutation/index.ts | 335 +- .../src/api/orm/query-builder.ts | 215 +- .../src/api/orm/query/index.ts | 224 +- sdk/constructive-sdk/src/api/orm/realtime.ts | 37 +- .../src/api/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/auth/index.ts | 2 +- sdk/constructive-sdk/src/auth/orm/client.ts | 43 +- sdk/constructive-sdk/src/auth/orm/index.ts | 52 +- .../src/auth/orm/input-types.ts | 315 +- .../src/auth/orm/models/auditLogAuth.ts | 285 +- .../src/auth/orm/models/cryptoAddress.ts | 275 +- .../src/auth/orm/models/email.ts | 275 +- .../src/auth/orm/models/identityProvider.ts | 149 +- .../src/auth/orm/models/index.ts | 26 +- .../src/auth/orm/models/orgApiKeyList.ts | 194 +- .../src/auth/orm/models/phoneNumber.ts | 275 +- .../src/auth/orm/models/principal.ts | 194 +- .../src/auth/orm/models/principalEntity.ts | 275 +- .../auth/orm/models/principalScopeOverride.ts | 198 +- .../src/auth/orm/models/roleType.ts | 275 +- .../src/auth/orm/models/user.ts | 275 +- .../auth/orm/models/userConnectedAccount.ts | 198 +- .../src/auth/orm/models/webauthnCredential.ts | 275 +- .../src/auth/orm/mutation/index.ts | 1393 ++++--- .../src/auth/orm/query-builder.ts | 215 +- .../src/auth/orm/query/index.ts | 179 +- sdk/constructive-sdk/src/auth/orm/realtime.ts | 37 +- .../src/auth/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/compute/index.ts | 2 +- .../src/compute/orm/client.ts | 43 +- sdk/constructive-sdk/src/compute/orm/index.ts | 160 +- .../src/compute/orm/input-types.ts | 2194 ++++++++++- .../src/compute/orm/models/dbPreset.ts | 275 +- .../compute/orm/models/functionApiBinding.ts | 275 +- .../compute/orm/models/functionDefinition.ts | 275 +- .../compute/orm/models/functionDeployment.ts | 275 +- .../orm/models/functionDeploymentEvent.ts | 289 +- .../orm/models/functionExecutionLog.ts | 289 +- .../src/compute/orm/models/functionGraph.ts | 275 +- .../compute/orm/models/functionGraphCommit.ts | 285 +- .../orm/models/functionGraphExecution.ts | 289 +- .../models/functionGraphExecutionNodeState.ts | 325 +- .../models/functionGraphExecutionOutput.ts | 307 +- .../compute/orm/models/functionGraphObject.ts | 271 +- .../compute/orm/models/functionGraphRef.ts | 285 +- .../compute/orm/models/functionGraphStore.ts | 275 +- .../compute/orm/models/functionInvocation.ts | 285 +- .../orm/models/functionInvocationAttempt.ts | 289 +- .../orm/models/getAllTreeNodesRecord.ts | 149 +- .../src/compute/orm/models/index.ts | 134 +- .../src/compute/orm/models/infraCommit.ts | 285 +- .../orm/models/infraGetAllTreeNodesRecord.ts | 158 +- .../src/compute/orm/models/infraObject.ts | 271 +- .../src/compute/orm/models/infraRef.ts | 285 +- .../src/compute/orm/models/infraStore.ts | 275 +- .../compute/orm/models/integrationProvider.ts | 275 +- .../src/compute/orm/models/namespace.ts | 275 +- .../src/compute/orm/models/namespaceEvent.ts | 285 +- .../orm/models/platformFunctionApiBinding.ts | 289 +- .../orm/models/platformFunctionDefinition.ts | 289 +- .../orm/models/platformFunctionDeployment.ts | 289 +- .../models/platformFunctionDeploymentEvent.ts | 325 +- .../models/platformFunctionExecutionLog.ts | 307 +- .../orm/models/platformFunctionInvocation.ts | 299 +- .../platformFunctionInvocationAttempt.ts | 327 +- .../compute/orm/models/platformInfraCommit.ts | 285 +- .../platformInfraGetAllTreeNodesRecord.ts | 174 +- .../compute/orm/models/platformInfraObject.ts | 271 +- .../compute/orm/models/platformInfraRef.ts | 285 +- .../compute/orm/models/platformInfraStore.ts | 275 +- .../compute/orm/models/platformNamespace.ts | 275 +- .../orm/models/platformNamespaceEvent.ts | 289 +- .../compute/orm/models/platformResource.ts | 275 +- .../platformResourceDeclaredCapacity.ts | 175 +- .../orm/models/platformResourceDefinition.ts | 289 +- .../orm/models/platformResourceEvent.ts | 289 +- .../models/platformResourceInstallation.ts | 297 +- .../orm/models/platformResourceStatusCheck.ts | 293 +- .../orm/models/platformResourceUsageLog.ts | 289 +- .../models/platformResourceUsageSummary.ts | 307 +- .../orm/models/platformResourceUtilization.ts | 162 +- .../orm/models/platformResourcesHealth.ts | 198 +- .../platformResourcesRequirementsState.ts | 175 +- .../platformResourcesResolvedRequirement.ts | 175 +- .../orm/models/platformWebhookEndpoint.ts | 279 +- .../orm/models/platformWebhookEvent.ts | 279 +- .../src/compute/orm/models/resource.ts | 275 +- .../orm/models/resourceDeclaredCapacity.ts | 153 +- .../compute/orm/models/resourceDefinition.ts | 275 +- .../src/compute/orm/models/resourceEvent.ts | 285 +- .../orm/models/resourceInstallation.ts | 279 +- .../compute/orm/models/resourceStatusCheck.ts | 275 +- .../compute/orm/models/resourceUsageLog.ts | 285 +- .../orm/models/resourceUsageSummary.ts | 289 +- .../compute/orm/models/resourceUtilization.ts | 149 +- .../src/compute/orm/models/resourcesHealth.ts | 194 +- .../orm/models/resourcesRequirementsState.ts | 158 +- .../models/resourcesResolvedRequirement.ts | 166 +- .../src/compute/orm/models/webhookEndpoint.ts | 275 +- .../src/compute/orm/models/webhookEvent.ts | 275 +- .../src/compute/orm/mutation/index.ts | 1336 +++++-- .../src/compute/orm/query-builder.ts | 215 +- .../src/compute/orm/query/index.ts | 53 +- .../src/compute/orm/realtime.ts | 37 +- .../src/compute/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/config/index.ts | 2 +- sdk/constructive-sdk/src/config/orm/client.ts | 43 +- sdk/constructive-sdk/src/config/orm/index.ts | 32 +- .../src/config/orm/input-types.ts | 136 +- .../src/config/orm/models/config.ts | 275 +- .../src/config/orm/models/index.ts | 10 +- .../src/config/orm/models/platformConfig.ts | 275 +- .../orm/models/platformInternalSecret.ts | 198 +- .../src/config/orm/models/platformSecret.ts | 194 +- .../src/config/orm/models/secret.ts | 194 +- .../src/config/orm/mutation/index.ts | 617 +++- .../src/config/orm/query-builder.ts | 215 +- .../src/config/orm/realtime.ts | 37 +- .../src/config/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/index.ts | 24 +- sdk/constructive-sdk/src/infra/index.ts | 2 +- sdk/constructive-sdk/src/infra/orm/client.ts | 43 +- sdk/constructive-sdk/src/infra/orm/index.ts | 42 +- .../src/infra/orm/input-types.ts | 214 +- .../src/infra/orm/models/dbPreset.ts | 275 +- .../src/infra/orm/models/index.ts | 20 +- .../src/infra/orm/models/namespace.ts | 275 +- .../src/infra/orm/models/namespaceEvent.ts | 285 +- .../infra/orm/models/platformInfraCommit.ts | 285 +- .../platformInfraGetAllTreeNodesRecord.ts | 174 +- .../infra/orm/models/platformInfraObject.ts | 271 +- .../src/infra/orm/models/platformInfraRef.ts | 285 +- .../infra/orm/models/platformInfraStore.ts | 275 +- .../src/infra/orm/models/platformNamespace.ts | 275 +- .../orm/models/platformNamespaceEvent.ts | 289 +- .../src/infra/orm/mutation/index.ts | 200 +- .../src/infra/orm/query-builder.ts | 215 +- .../src/infra/orm/realtime.ts | 37 +- .../src/infra/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/modules/index.ts | 2 +- .../src/modules/orm/client.ts | 43 +- sdk/constructive-sdk/src/modules/orm/index.ts | 176 +- .../src/modules/orm/input-types.ts | 3231 +++++++++++++++- .../src/modules/orm/models/agentModule.ts | 275 +- .../modules/orm/models/apiSurfaceModule.ts | 275 +- .../src/modules/orm/models/appModule.ts | 275 +- .../src/modules/orm/models/billingModule.ts | 275 +- .../orm/models/billingProviderModule.ts | 279 +- .../src/modules/orm/models/blueprint.ts | 275 +- .../orm/models/blueprintConstruction.ts | 279 +- .../modules/orm/models/blueprintTemplate.ts | 275 +- .../src/modules/orm/models/catalogModule.ts | 275 +- .../modules/orm/models/computeLogModule.ts | 275 +- .../orm/models/configSecretsUserModule.ts | 279 +- .../orm/models/connectedAccountsModule.ts | 279 +- .../orm/models/cryptoAddressesModule.ts | 279 +- .../modules/orm/models/cryptoAuthModule.ts | 275 +- .../orm/models/databaseProvisionModule.ts | 279 +- .../orm/models/databaseSettingsModule.ts | 279 +- .../src/modules/orm/models/dbPool.ts | 275 +- .../src/modules/orm/models/dbPoolConfig.ts | 275 +- .../src/modules/orm/models/dbPresetModule.ts | 275 +- .../src/modules/orm/models/dbUsageModule.ts | 275 +- .../modules/orm/models/defaultIdsModule.ts | 275 +- .../orm/models/denormalizedTableField.ts | 279 +- .../src/modules/orm/models/devicesModule.ts | 275 +- .../src/modules/orm/models/domainModule.ts | 275 +- .../src/modules/orm/models/emailsModule.ts | 275 +- .../modules/orm/models/entityTypeProvision.ts | 275 +- .../src/modules/orm/models/eventsModule.ts | 275 +- .../orm/models/functionDeploymentModule.ts | 279 +- .../orm/models/functionInvocationModule.ts | 279 +- .../src/modules/orm/models/functionModule.ts | 275 +- .../orm/models/graphExecutionModule.ts | 279 +- .../src/modules/orm/models/graphModule.ts | 275 +- .../src/modules/orm/models/hierarchyModule.ts | 275 +- .../src/modules/orm/models/httpRouteModule.ts | 275 +- .../src/modules/orm/models/i18NModule.ts | 275 +- .../orm/models/identityProvidersModule.ts | 279 +- .../src/modules/orm/models/index.ts | 150 +- .../modules/orm/models/inferenceLogModule.ts | 275 +- .../modules/orm/models/infraConfigModule.ts | 275 +- .../modules/orm/models/infraSecretsModule.ts | 275 +- .../orm/models/integrationProvidersModule.ts | 289 +- .../orm/models/internalSecretsModule.ts | 279 +- .../src/modules/orm/models/invitesModule.ts | 275 +- .../src/modules/orm/models/limitsModule.ts | 275 +- .../orm/models/membershipTypesModule.ts | 279 +- .../modules/orm/models/membershipsModule.ts | 275 +- .../modules/orm/models/merkleStoreModule.ts | 275 +- .../src/modules/orm/models/namespaceModule.ts | 275 +- .../modules/orm/models/notificationsModule.ts | 275 +- .../modules/orm/models/permissionsModule.ts | 275 +- .../modules/orm/models/phoneNumbersModule.ts | 275 +- .../src/modules/orm/models/plansModule.ts | 275 +- .../modules/orm/models/principalAuthModule.ts | 275 +- .../src/modules/orm/models/profilesModule.ts | 275 +- .../orm/models/rateLimitMetersModule.ts | 279 +- .../modules/orm/models/rateLimitsModule.ts | 275 +- .../src/modules/orm/models/realtimeModule.ts | 275 +- .../modules/orm/models/relationProvision.ts | 275 +- .../src/modules/orm/models/resourceModule.ts | 275 +- .../src/modules/orm/models/rlsModule.ts | 275 +- .../src/modules/orm/models/routeModule.ts | 275 +- .../orm/models/secureTableProvision.ts | 279 +- .../orm/models/sessionSecretsModule.ts | 279 +- .../src/modules/orm/models/sessionsModule.ts | 275 +- .../modules/orm/models/siteSurfaceModule.ts | 275 +- .../modules/orm/models/storageLogModule.ts | 275 +- .../src/modules/orm/models/storageModule.ts | 275 +- .../modules/orm/models/transferLogModule.ts | 275 +- .../src/modules/orm/models/userAuthModule.ts | 275 +- .../orm/models/userCredentialsModule.ts | 279 +- .../modules/orm/models/userSettingsModule.ts | 275 +- .../src/modules/orm/models/userStateModule.ts | 275 +- .../src/modules/orm/models/usersModule.ts | 275 +- .../modules/orm/models/webauthnAuthModule.ts | 275 +- .../orm/models/webauthnCredentialsModule.ts | 279 +- .../src/modules/orm/models/webhookModule.ts | 275 +- .../src/modules/orm/mutation/index.ts | 473 ++- .../src/modules/orm/query-builder.ts | 215 +- .../src/modules/orm/query/index.ts | 138 +- .../src/modules/orm/realtime.ts | 37 +- .../src/modules/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/objects/index.ts | 2 +- .../src/objects/orm/client.ts | 43 +- sdk/constructive-sdk/src/objects/orm/index.ts | 32 +- .../src/objects/orm/input-types.ts | 84 +- .../src/objects/orm/models/commit.ts | 285 +- .../orm/models/getAllTreeNodesRecord.ts | 149 +- .../src/objects/orm/models/index.ts | 10 +- .../src/objects/orm/models/object.ts | 271 +- .../src/objects/orm/models/ref.ts | 285 +- .../src/objects/orm/models/store.ts | 275 +- .../src/objects/orm/mutation/index.ts | 197 +- .../src/objects/orm/query-builder.ts | 215 +- .../src/objects/orm/realtime.ts | 37 +- .../src/objects/orm/select-types.ts | 22 +- sdk/constructive-sdk/src/usage/index.ts | 2 +- sdk/constructive-sdk/src/usage/orm/client.ts | 43 +- sdk/constructive-sdk/src/usage/orm/index.ts | 58 +- .../src/usage/orm/input-types.ts | 376 +- .../src/usage/orm/models/appLimit.ts | 275 +- .../src/usage/orm/models/appLimitCap.ts | 275 +- .../usage/orm/models/appLimitCapsDefault.ts | 275 +- .../src/usage/orm/models/appLimitCredit.ts | 275 +- .../usage/orm/models/appLimitCreditCode.ts | 275 +- .../orm/models/appLimitCreditCodeItem.ts | 279 +- .../orm/models/appLimitCreditRedemption.ts | 279 +- .../src/usage/orm/models/appLimitDefault.ts | 275 +- .../src/usage/orm/models/appLimitEvent.ts | 285 +- .../src/usage/orm/models/appLimitWarning.ts | 275 +- .../src/usage/orm/models/index.ts | 36 +- .../src/usage/orm/models/orgLimit.ts | 275 +- .../src/usage/orm/models/orgLimitAggregate.ts | 275 +- .../src/usage/orm/models/orgLimitCap.ts | 275 +- .../usage/orm/models/orgLimitCapsDefault.ts | 275 +- .../src/usage/orm/models/orgLimitCredit.ts | 275 +- .../src/usage/orm/models/orgLimitDefault.ts | 275 +- .../src/usage/orm/models/orgLimitEvent.ts | 285 +- .../src/usage/orm/models/orgLimitWarning.ts | 275 +- .../src/usage/orm/mutation/index.ts | 243 +- .../src/usage/orm/query-builder.ts | 215 +- .../src/usage/orm/realtime.ts | 37 +- .../src/usage/orm/select-types.ts | 22 +- sdk/migrate-client/src/migrate/index.ts | 2 +- sdk/migrate-client/src/migrate/orm/client.ts | 43 +- sdk/migrate-client/src/migrate/orm/index.ts | 26 +- .../src/migrate/orm/input-types.ts | 60 +- .../src/migrate/orm/models/astMigration.ts | 194 +- .../src/migrate/orm/models/index.ts | 4 +- .../src/migrate/orm/models/sqlAction.ts | 194 +- .../src/migrate/orm/mutation/index.ts | 59 +- .../src/migrate/orm/query-builder.ts | 215 +- .../src/migrate/orm/realtime.ts | 37 +- .../src/migrate/orm/select-types.ts | 22 +- 3283 files changed, 441092 insertions(+), 264980 deletions(-) diff --git a/sdk/constructive-cli/src/admin/cli/commands.ts b/sdk/constructive-cli/src/admin/cli/commands.ts index 269ad8aeed..a7911ecb85 100644 --- a/sdk/constructive-cli/src/admin/cli/commands.ts +++ b/sdk/constructive-cli/src/admin/cli/commands.ts @@ -3,105 +3,116 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import appAdminGrantCmd from "./commands/app-admin-grant"; -import appClaimedInviteCmd from "./commands/app-claimed-invite"; -import appGrantCmd from "./commands/app-grant"; -import appInviteCmd from "./commands/app-invite"; -import appMembershipCmd from "./commands/app-membership"; -import appMembershipDefaultCmd from "./commands/app-membership-default"; -import appOwnerGrantCmd from "./commands/app-owner-grant"; -import appPermissionCmd from "./commands/app-permission"; -import appPermissionDefaultCmd from "./commands/app-permission-default"; -import appPermissionDefaultGrantCmd from "./commands/app-permission-default-grant"; -import appPermissionDefaultPermissionCmd from "./commands/app-permission-default-permission"; -import membershipTypeCmd from "./commands/membership-type"; -import orgAdminGrantCmd from "./commands/org-admin-grant"; -import orgClaimedInviteCmd from "./commands/org-claimed-invite"; -import orgGrantCmd from "./commands/org-grant"; -import orgInviteCmd from "./commands/org-invite"; -import orgMemberCmd from "./commands/org-member"; -import orgMemberProfileCmd from "./commands/org-member-profile"; -import orgMembershipCmd from "./commands/org-membership"; -import orgMembershipDefaultCmd from "./commands/org-membership-default"; -import orgMembershipSettingCmd from "./commands/org-membership-setting"; -import orgOwnerGrantCmd from "./commands/org-owner-grant"; -import orgPermissionCmd from "./commands/org-permission"; -import orgPermissionDefaultCmd from "./commands/org-permission-default"; -import orgPermissionDefaultGrantCmd from "./commands/org-permission-default-grant"; -import orgPermissionDefaultPermissionCmd from "./commands/org-permission-default-permission"; -import appPermissionsGetByMaskCmd from "./commands/app-permissions-get-by-mask"; -import appPermissionsGetMaskCmd from "./commands/app-permissions-get-mask"; -import appPermissionsGetMaskByNamesCmd from "./commands/app-permissions-get-mask-by-names"; -import appPermissionsGetPaddedMaskCmd from "./commands/app-permissions-get-padded-mask"; -import orgPermissionsGetByMaskCmd from "./commands/org-permissions-get-by-mask"; -import orgPermissionsGetMaskCmd from "./commands/org-permissions-get-mask"; -import orgPermissionsGetMaskByNamesCmd from "./commands/org-permissions-get-mask-by-names"; -import orgPermissionsGetPaddedMaskCmd from "./commands/org-permissions-get-padded-mask"; -import provisionBucketCmd from "./commands/provision-bucket"; -import submitAppInviteCodeCmd from "./commands/submit-app-invite-code"; -import submitOrgInviteCodeCmd from "./commands/submit-org-invite-code"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "app-admin-grant": appAdminGrantCmd, - "app-claimed-invite": appClaimedInviteCmd, - "app-grant": appGrantCmd, - "app-invite": appInviteCmd, - "app-membership": appMembershipCmd, - "app-membership-default": appMembershipDefaultCmd, - "app-owner-grant": appOwnerGrantCmd, - "app-permission": appPermissionCmd, - "app-permission-default": appPermissionDefaultCmd, - "app-permission-default-grant": appPermissionDefaultGrantCmd, - "app-permission-default-permission": appPermissionDefaultPermissionCmd, - "membership-type": membershipTypeCmd, - "org-admin-grant": orgAdminGrantCmd, - "org-claimed-invite": orgClaimedInviteCmd, - "org-grant": orgGrantCmd, - "org-invite": orgInviteCmd, - "org-member": orgMemberCmd, - "org-member-profile": orgMemberProfileCmd, - "org-membership": orgMembershipCmd, - "org-membership-default": orgMembershipDefaultCmd, - "org-membership-setting": orgMembershipSettingCmd, - "org-owner-grant": orgOwnerGrantCmd, - "org-permission": orgPermissionCmd, - "org-permission-default": orgPermissionDefaultCmd, - "org-permission-default-grant": orgPermissionDefaultGrantCmd, - "org-permission-default-permission": orgPermissionDefaultPermissionCmd, - "app-permissions-get-by-mask": appPermissionsGetByMaskCmd, - "app-permissions-get-mask": appPermissionsGetMaskCmd, - "app-permissions-get-mask-by-names": appPermissionsGetMaskByNamesCmd, - "app-permissions-get-padded-mask": appPermissionsGetPaddedMaskCmd, - "org-permissions-get-by-mask": orgPermissionsGetByMaskCmd, - "org-permissions-get-mask": orgPermissionsGetMaskCmd, - "org-permissions-get-mask-by-names": orgPermissionsGetMaskByNamesCmd, - "org-permissions-get-padded-mask": orgPermissionsGetPaddedMaskCmd, - "provision-bucket": provisionBucketCmd, - "submit-app-invite-code": submitAppInviteCodeCmd, - "submit-org-invite-code": submitOrgInviteCodeCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import appAdminGrantCmd from './commands/app-admin-grant'; +import appClaimedInviteCmd from './commands/app-claimed-invite'; +import appGrantCmd from './commands/app-grant'; +import appInviteCmd from './commands/app-invite'; +import appMembershipCmd from './commands/app-membership'; +import appMembershipDefaultCmd from './commands/app-membership-default'; +import appOwnerGrantCmd from './commands/app-owner-grant'; +import appPermissionCmd from './commands/app-permission'; +import appPermissionDefaultCmd from './commands/app-permission-default'; +import appPermissionDefaultGrantCmd from './commands/app-permission-default-grant'; +import appPermissionDefaultPermissionCmd from './commands/app-permission-default-permission'; +import membershipTypeCmd from './commands/membership-type'; +import orgAdminGrantCmd from './commands/org-admin-grant'; +import orgClaimedInviteCmd from './commands/org-claimed-invite'; +import orgGrantCmd from './commands/org-grant'; +import orgInviteCmd from './commands/org-invite'; +import orgMemberCmd from './commands/org-member'; +import orgMemberProfileCmd from './commands/org-member-profile'; +import orgMembershipCmd from './commands/org-membership'; +import orgMembershipDefaultCmd from './commands/org-membership-default'; +import orgMembershipSettingCmd from './commands/org-membership-setting'; +import orgOwnerGrantCmd from './commands/org-owner-grant'; +import orgPermissionCmd from './commands/org-permission'; +import orgPermissionDefaultCmd from './commands/org-permission-default'; +import orgPermissionDefaultGrantCmd from './commands/org-permission-default-grant'; +import orgPermissionDefaultPermissionCmd from './commands/org-permission-default-permission'; +import appPermissionsGetByMaskCmd from './commands/app-permissions-get-by-mask'; +import appPermissionsGetMaskCmd from './commands/app-permissions-get-mask'; +import appPermissionsGetMaskByNamesCmd from './commands/app-permissions-get-mask-by-names'; +import appPermissionsGetPaddedMaskCmd from './commands/app-permissions-get-padded-mask'; +import orgPermissionsGetByMaskCmd from './commands/org-permissions-get-by-mask'; +import orgPermissionsGetMaskCmd from './commands/org-permissions-get-mask'; +import orgPermissionsGetMaskByNamesCmd from './commands/org-permissions-get-mask-by-names'; +import orgPermissionsGetPaddedMaskCmd from './commands/org-permissions-get-padded-mask'; +import provisionBucketCmd from './commands/provision-bucket'; +import submitAppInviteCodeCmd from './commands/submit-app-invite-code'; +import submitOrgInviteCodeCmd from './commands/submit-org-invite-code'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + 'app-admin-grant': appAdminGrantCmd, + 'app-claimed-invite': appClaimedInviteCmd, + 'app-grant': appGrantCmd, + 'app-invite': appInviteCmd, + 'app-membership': appMembershipCmd, + 'app-membership-default': appMembershipDefaultCmd, + 'app-owner-grant': appOwnerGrantCmd, + 'app-permission': appPermissionCmd, + 'app-permission-default': appPermissionDefaultCmd, + 'app-permission-default-grant': appPermissionDefaultGrantCmd, + 'app-permission-default-permission': appPermissionDefaultPermissionCmd, + 'membership-type': membershipTypeCmd, + 'org-admin-grant': orgAdminGrantCmd, + 'org-claimed-invite': orgClaimedInviteCmd, + 'org-grant': orgGrantCmd, + 'org-invite': orgInviteCmd, + 'org-member': orgMemberCmd, + 'org-member-profile': orgMemberProfileCmd, + 'org-membership': orgMembershipCmd, + 'org-membership-default': orgMembershipDefaultCmd, + 'org-membership-setting': orgMembershipSettingCmd, + 'org-owner-grant': orgOwnerGrantCmd, + 'org-permission': orgPermissionCmd, + 'org-permission-default': orgPermissionDefaultCmd, + 'org-permission-default-grant': orgPermissionDefaultGrantCmd, + 'org-permission-default-permission': orgPermissionDefaultPermissionCmd, + 'app-permissions-get-by-mask': appPermissionsGetByMaskCmd, + 'app-permissions-get-mask': appPermissionsGetMaskCmd, + 'app-permissions-get-mask-by-names': appPermissionsGetMaskByNamesCmd, + 'app-permissions-get-padded-mask': appPermissionsGetPaddedMaskCmd, + 'org-permissions-get-by-mask': orgPermissionsGetByMaskCmd, + 'org-permissions-get-mask': orgPermissionsGetMaskCmd, + 'org-permissions-get-mask-by-names': orgPermissionsGetMaskByNamesCmd, + 'org-permissions-get-padded-mask': orgPermissionsGetPaddedMaskCmd, + 'provision-bucket': provisionBucketCmd, + 'submit-app-invite-code': submitAppInviteCodeCmd, + 'submit-org-invite-code': submitOrgInviteCodeCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n app-admin-grant appAdminGrant CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n app-grant appGrant CRUD operations\n app-invite appInvite CRUD operations\n app-membership appMembership CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-permission appPermission CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n app-permission-default-grant appPermissionDefaultGrant CRUD operations\n app-permission-default-permission appPermissionDefaultPermission CRUD operations\n membership-type membershipType CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n org-grant orgGrant CRUD operations\n org-invite orgInvite CRUD operations\n org-member orgMember CRUD operations\n org-member-profile orgMemberProfile CRUD operations\n org-membership orgMembership CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n org-membership-setting orgMembershipSetting CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-permission orgPermission CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n org-permission-default-grant orgPermissionDefaultGrant CRUD operations\n org-permission-default-permission orgPermissionDefaultPermission CRUD operations\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n app-permissions-get-mask appPermissionsGetMask\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n org-permissions-get-mask orgPermissionsGetMask\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\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 submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n app-admin-grant appAdminGrant CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n app-grant appGrant CRUD operations\n app-invite appInvite CRUD operations\n app-membership appMembership CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-permission appPermission CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n app-permission-default-grant appPermissionDefaultGrant CRUD operations\n app-permission-default-permission appPermissionDefaultPermission CRUD operations\n membership-type membershipType CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n org-grant orgGrant CRUD operations\n org-invite orgInvite CRUD operations\n org-member orgMember CRUD operations\n org-member-profile orgMemberProfile CRUD operations\n org-membership orgMembership CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n org-membership-setting orgMembershipSetting CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-permission orgPermission CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n org-permission-default-grant orgPermissionDefaultGrant CRUD operations\n org-permission-default-permission orgPermissionDefaultPermission CRUD operations\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n app-permissions-get-mask appPermissionsGetMask\n app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n org-permissions-get-mask orgPermissionsGetMask\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\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 submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -113,4 +124,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-admin-grant.ts b/sdk/constructive-cli/src/admin/cli/commands/app-admin-grant.ts index ecbd13b56f..1e17259ca7 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-admin-grant.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-admin-grant.ts @@ -3,54 +3,68 @@ * @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 { CreateAppAdminGrantInput, AppAdminGrantPatch, AppAdminGrantSelect, AppAdminGrantFilter, AppAdminGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppAdminGrantInput, + AppAdminGrantPatch, + AppAdminGrantSelect, + AppAdminGrantFilter, + AppAdminGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - grantorId: "uuid", - id: "uuid", - isGrant: "boolean", - updatedAt: "string" + actorId: 'uuid', + createdAt: 'string', + grantorId: 'uuid', + id: 'uuid', + isGrant: 'boolean', + updatedAt: 'string', }; -const usage = "\napp-admin-grant \n\nCommands:\n list List appAdminGrant records\n find-first Find first matching appAdminGrant record\n get Get a appAdminGrant by ID\n create Create a new appAdminGrant\n update Update an existing appAdminGrant\n delete Delete a appAdminGrant\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) => { +const usage = + '\napp-admin-grant \n\nCommands:\n list List appAdminGrant records\n find-first Find first matching appAdminGrant record\n get Get a appAdminGrant by ID\n create Create a new appAdminGrant\n update Update an existing appAdminGrant\n delete Delete a appAdminGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq grantorId: true, id: true, isGrant: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppAdminGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppAdminGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appAdminGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter grantorId: true, id: true, isGrant: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppAdminGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppAdminGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appAdminGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appAdminGrant.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.appAdminGrant + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,46 +158,55 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppAdminGrantInput["appAdminGrant"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppAdminGrantInput['appAdminGrant']; const client = getClient(); - const result = await client.appAdminGrant.create({ - data: { - actorId: cleanedData.actorId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant - }, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.appAdminGrant + .create({ + data: { + actorId: cleanedData.actorId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + }, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -184,54 +215,61 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppAdminGrantPatch; const client = getClient(); - const result = await client.appAdminGrant.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant - }, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.appAdminGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + }, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -240,28 +278,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appAdminGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appAdminGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-claimed-invite.ts b/sdk/constructive-cli/src/admin/cli/commands/app-claimed-invite.ts index 06168bf6fb..dc3744557b 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-claimed-invite.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-claimed-invite.ts @@ -3,54 +3,68 @@ * @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 { CreateAppClaimedInviteInput, AppClaimedInvitePatch, AppClaimedInviteSelect, AppClaimedInviteFilter, AppClaimedInviteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppClaimedInviteInput, + AppClaimedInvitePatch, + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - id: "uuid", - receiverId: "uuid", - senderId: "uuid", - updatedAt: "string" + createdAt: 'string', + data: 'json', + id: 'uuid', + receiverId: 'uuid', + senderId: 'uuid', + updatedAt: 'string', }; -const usage = "\napp-claimed-invite \n\nCommands:\n list List appClaimedInvite records\n find-first Find first matching appClaimedInvite record\n get Get a appClaimedInvite by ID\n create Create a new appClaimedInvite\n update Update an existing appClaimedInvite\n delete Delete a appClaimedInvite\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) => { +const usage = + '\napp-claimed-invite \n\nCommands:\n list List appClaimedInvite records\n find-first Find first matching appClaimedInvite record\n get Get a appClaimedInvite by ID\n create Create a new appClaimedInvite\n update Update an existing appClaimedInvite\n delete Delete a appClaimedInvite\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, receiverId: true, senderId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppClaimedInviteSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppClaimedInviteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appClaimedInvite.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, receiverId: true, senderId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppClaimedInviteSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppClaimedInviteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appClaimedInvite.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appClaimedInvite.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - id: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.appClaimedInvite + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + id: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,46 +158,55 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "receiverId", - message: "receiverId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "senderId", - message: "senderId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'receiverId', + message: 'receiverId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'senderId', + message: 'senderId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppClaimedInviteInput["appClaimedInvite"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppClaimedInviteInput['appClaimedInvite']; const client = getClient(); - const result = await client.appClaimedInvite.create({ - data: { - data: cleanedData.data, - receiverId: cleanedData.receiverId, - senderId: cleanedData.senderId - }, - select: { - createdAt: true, - data: true, - id: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.appClaimedInvite + .create({ + data: { + data: cleanedData.data, + receiverId: cleanedData.receiverId, + senderId: cleanedData.senderId, + }, + select: { + createdAt: true, + data: true, + id: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -184,54 +215,61 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "receiverId", - message: "receiverId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "senderId", - message: "senderId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'receiverId', + message: 'receiverId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'senderId', + message: 'senderId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppClaimedInvitePatch; const client = getClient(); - const result = await client.appClaimedInvite.update({ - where: { - id: answers.id as string - }, - data: { - data: cleanedData.data, - receiverId: cleanedData.receiverId, - senderId: cleanedData.senderId - }, - select: { - createdAt: true, - data: true, - id: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.appClaimedInvite + .update({ + where: { + id: answers.id as string, + }, + data: { + data: cleanedData.data, + receiverId: cleanedData.receiverId, + senderId: cleanedData.senderId, + }, + select: { + createdAt: true, + data: true, + id: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -240,28 +278,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appClaimedInvite.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appClaimedInvite + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-grant.ts b/sdk/constructive-cli/src/admin/cli/commands/app-grant.ts index 4555ec4686..54f8c0205d 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-grant.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-grant.ts @@ -3,55 +3,69 @@ * @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 { CreateAppGrantInput, AppGrantPatch, AppGrantSelect, AppGrantFilter, AppGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppGrantInput, + AppGrantPatch, + AppGrantSelect, + AppGrantFilter, + AppGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - grantorId: "uuid", - id: "uuid", - isGrant: "boolean", - permissions: "string", - updatedAt: "string" + actorId: 'uuid', + createdAt: 'string', + grantorId: 'uuid', + id: 'uuid', + isGrant: 'boolean', + permissions: 'string', + updatedAt: 'string', }; -const usage = "\napp-grant \n\nCommands:\n list List appGrant records\n find-first Find first matching appGrant record\n get Get a appGrant by ID\n create Create a new appGrant\n update Update an existing appGrant\n delete Delete a appGrant\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) => { +const usage = + '\napp-grant \n\nCommands:\n list List appGrant records\n find-first Find first matching appGrant record\n get Get a appGrant by ID\n create Create a new appGrant\n update Update an existing appGrant\n delete Delete a appGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, isGrant: true, permissions: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, isGrant: true, permissions: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appGrant.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - permissions: true, - updatedAt: true - } - }).execute(); + const result = await client.appGrant + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + permissions: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,54 +162,61 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppGrantInput["appGrant"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppGrantInput['appGrant']; const client = getClient(); - const result = await client.appGrant.create({ - data: { - actorId: cleanedData.actorId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant, - permissions: cleanedData.permissions - }, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - permissions: true, - updatedAt: true - } - }).execute(); + const result = await client.appGrant + .create({ + data: { + actorId: cleanedData.actorId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + permissions: cleanedData.permissions, + }, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + permissions: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -196,62 +225,70 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppGrantPatch; const client = getClient(); - const result = await client.appGrant.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant, - permissions: cleanedData.permissions - }, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - permissions: true, - updatedAt: true - } - }).execute(); + const result = await client.appGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + permissions: cleanedData.permissions, + }, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + permissions: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -260,28 +297,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-invite.ts b/sdk/constructive-cli/src/admin/cli/commands/app-invite.ts index 1f3a0e3c99..531e455e54 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-invite.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-invite.ts @@ -3,63 +3,77 @@ * @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 { CreateAppInviteInput, AppInvitePatch, AppInviteSelect, AppInviteFilter, AppInviteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppInviteInput, + AppInvitePatch, + AppInviteSelect, + AppInviteFilter, + AppInviteOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - channel: "string", - createdAt: "string", - data: "json", - email: "string", - expiresAt: "string", - id: "uuid", - inviteCount: "int", - inviteLimit: "int", - inviteToken: "string", - inviteValid: "boolean", - multiple: "boolean", - phone: "string", - profileId: "uuid", - senderId: "uuid", - updatedAt: "string" + channel: 'string', + createdAt: 'string', + data: 'json', + email: 'string', + expiresAt: 'string', + id: 'uuid', + inviteCount: 'int', + inviteLimit: 'int', + inviteToken: 'string', + inviteValid: 'boolean', + multiple: 'boolean', + phone: 'string', + profileId: 'uuid', + senderId: 'uuid', + updatedAt: 'string', }; -const usage = "\napp-invite \n\nCommands:\n list List appInvite records\n find-first Find first matching appInvite record\n get Get a appInvite by ID\n create Create a new appInvite\n update Update an existing appInvite\n delete Delete a appInvite\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) => { +const usage = + '\napp-invite \n\nCommands:\n list List appInvite records\n find-first Find first matching appInvite record\n get Get a appInvite by ID\n create Create a new appInvite\n update Update an existing appInvite\n delete Delete a appInvite\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -83,16 +97,18 @@ async function handleList(argv: Partial>, _prompter: Inq phone: true, profileId: true, senderId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppInviteSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppInviteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appInvite.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -116,16 +132,18 @@ async function handleFindFirst(argv: Partial>, _prompter phone: true, profileId: true, senderId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppInviteSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppInviteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appInvite.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -134,36 +152,40 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appInvite.findOne({ - id: answers.id as string, - select: { - channel: true, - createdAt: true, - data: true, - email: true, - expiresAt: true, - id: true, - inviteCount: true, - inviteLimit: true, - inviteToken: true, - inviteValid: true, - multiple: true, - phone: true, - profileId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.appInvite + .findOne({ + id: answers.id as string, + select: { + channel: true, + createdAt: true, + data: true, + email: true, + expiresAt: true, + id: true, + inviteCount: true, + inviteLimit: true, + inviteToken: true, + inviteValid: true, + multiple: true, + phone: true, + profileId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -172,118 +194,133 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "channel", - message: "channel", - required: false, - skipPrompt: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "email", - message: "email", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteCount", - message: "inviteCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteLimit", - message: "inviteLimit", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteToken", - message: "inviteToken", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "inviteValid", - message: "inviteValid", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "multiple", - message: "multiple", - required: false, - skipPrompt: true - }, { - type: "text", - name: "phone", - message: "phone", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileId", - message: "profileId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "senderId", - message: "senderId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'channel', + message: 'channel', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'email', + message: 'email', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteCount', + message: 'inviteCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteLimit', + message: 'inviteLimit', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteToken', + message: 'inviteToken', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'inviteValid', + message: 'inviteValid', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'multiple', + message: 'multiple', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'phone', + message: 'phone', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileId', + message: 'profileId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'senderId', + message: 'senderId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppInviteInput["appInvite"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppInviteInput['appInvite']; const client = getClient(); - const result = await client.appInvite.create({ - data: { - channel: cleanedData.channel, - data: cleanedData.data, - email: cleanedData.email, - expiresAt: cleanedData.expiresAt, - inviteCount: cleanedData.inviteCount, - inviteLimit: cleanedData.inviteLimit, - inviteToken: cleanedData.inviteToken, - inviteValid: cleanedData.inviteValid, - multiple: cleanedData.multiple, - phone: cleanedData.phone, - profileId: cleanedData.profileId, - senderId: cleanedData.senderId - }, - select: { - channel: true, - createdAt: true, - data: true, - email: true, - expiresAt: true, - id: true, - inviteCount: true, - inviteLimit: true, - inviteToken: true, - inviteValid: true, - multiple: true, - phone: true, - profileId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.appInvite + .create({ + data: { + channel: cleanedData.channel, + data: cleanedData.data, + email: cleanedData.email, + expiresAt: cleanedData.expiresAt, + inviteCount: cleanedData.inviteCount, + inviteLimit: cleanedData.inviteLimit, + inviteToken: cleanedData.inviteToken, + inviteValid: cleanedData.inviteValid, + multiple: cleanedData.multiple, + phone: cleanedData.phone, + profileId: cleanedData.profileId, + senderId: cleanedData.senderId, + }, + select: { + channel: true, + createdAt: true, + data: true, + email: true, + expiresAt: true, + id: true, + inviteCount: true, + inviteLimit: true, + inviteToken: true, + inviteValid: true, + multiple: true, + phone: true, + profileId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -292,126 +329,142 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "channel", - message: "channel", - required: false, - skipPrompt: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "email", - message: "email", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteCount", - message: "inviteCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteLimit", - message: "inviteLimit", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteToken", - message: "inviteToken", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "inviteValid", - message: "inviteValid", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "multiple", - message: "multiple", - required: false, - skipPrompt: true - }, { - type: "text", - name: "phone", - message: "phone", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileId", - message: "profileId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "senderId", - message: "senderId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'channel', + message: 'channel', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'email', + message: 'email', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteCount', + message: 'inviteCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteLimit', + message: 'inviteLimit', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteToken', + message: 'inviteToken', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'inviteValid', + message: 'inviteValid', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'multiple', + message: 'multiple', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'phone', + message: 'phone', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileId', + message: 'profileId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'senderId', + message: 'senderId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppInvitePatch; const client = getClient(); - const result = await client.appInvite.update({ - where: { - id: answers.id as string - }, - data: { - channel: cleanedData.channel, - data: cleanedData.data, - email: cleanedData.email, - expiresAt: cleanedData.expiresAt, - inviteCount: cleanedData.inviteCount, - inviteLimit: cleanedData.inviteLimit, - inviteToken: cleanedData.inviteToken, - inviteValid: cleanedData.inviteValid, - multiple: cleanedData.multiple, - phone: cleanedData.phone, - profileId: cleanedData.profileId, - senderId: cleanedData.senderId - }, - select: { - channel: true, - createdAt: true, - data: true, - email: true, - expiresAt: true, - id: true, - inviteCount: true, - inviteLimit: true, - inviteToken: true, - inviteValid: true, - multiple: true, - phone: true, - profileId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.appInvite + .update({ + where: { + id: answers.id as string, + }, + data: { + channel: cleanedData.channel, + data: cleanedData.data, + email: cleanedData.email, + expiresAt: cleanedData.expiresAt, + inviteCount: cleanedData.inviteCount, + inviteLimit: cleanedData.inviteLimit, + inviteToken: cleanedData.inviteToken, + inviteValid: cleanedData.inviteValid, + multiple: cleanedData.multiple, + phone: cleanedData.phone, + profileId: cleanedData.profileId, + senderId: cleanedData.senderId, + }, + select: { + channel: true, + createdAt: true, + data: true, + email: true, + expiresAt: true, + id: true, + inviteCount: true, + inviteLimit: true, + inviteToken: true, + inviteValid: true, + multiple: true, + phone: true, + profileId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -420,28 +473,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appInvite.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appInvite + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-membership-default.ts b/sdk/constructive-cli/src/admin/cli/commands/app-membership-default.ts index bff37dd629..cecf038631 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-membership-default.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-membership-default.ts @@ -3,55 +3,69 @@ * @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 { CreateAppMembershipDefaultInput, AppMembershipDefaultPatch, AppMembershipDefaultSelect, AppMembershipDefaultFilter, AppMembershipDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppMembershipDefaultInput, + AppMembershipDefaultPatch, + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - createdBy: "uuid", - id: "uuid", - isApproved: "boolean", - isVerified: "boolean", - updatedAt: "string", - updatedBy: "uuid" + createdAt: 'string', + createdBy: 'uuid', + id: 'uuid', + isApproved: 'boolean', + isVerified: 'boolean', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\napp-membership-default \n\nCommands:\n list List appMembershipDefault records\n find-first Find first matching appMembershipDefault record\n get Get a appMembershipDefault by ID\n create Create a new appMembershipDefault\n update Update an existing appMembershipDefault\n delete Delete a appMembershipDefault\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) => { +const usage = + '\napp-membership-default \n\nCommands:\n list List appMembershipDefault records\n find-first Find first matching appMembershipDefault record\n get Get a appMembershipDefault by ID\n create Create a new appMembershipDefault\n update Update an existing appMembershipDefault\n delete Delete a appMembershipDefault\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq isApproved: true, isVerified: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppMembershipDefaultSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy + > & { + select: AppMembershipDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appMembershipDefault.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter isApproved: true, isVerified: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppMembershipDefaultSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy + > & { + select: AppMembershipDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appMembershipDefault.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appMembershipDefault.findOne({ - id: answers.id as string, - select: { - createdAt: true, - createdBy: true, - id: true, - isApproved: true, - isVerified: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.appMembershipDefault + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + createdBy: true, + id: true, + isApproved: true, + isVerified: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,54 +170,64 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isApproved", - message: "isApproved", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isApproved', + message: 'isApproved', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppMembershipDefaultInput["appMembershipDefault"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppMembershipDefaultInput['appMembershipDefault']; const client = getClient(); - const result = await client.appMembershipDefault.create({ - data: { - createdBy: cleanedData.createdBy, - isApproved: cleanedData.isApproved, - isVerified: cleanedData.isVerified, - updatedBy: cleanedData.updatedBy - }, - select: { - createdAt: true, - createdBy: true, - id: true, - isApproved: true, - isVerified: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.appMembershipDefault + .create({ + data: { + createdBy: cleanedData.createdBy, + isApproved: cleanedData.isApproved, + isVerified: cleanedData.isVerified, + updatedBy: cleanedData.updatedBy, + }, + select: { + createdAt: true, + createdBy: true, + id: true, + isApproved: true, + isVerified: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -196,62 +236,70 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isApproved", - message: "isApproved", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isApproved', + message: 'isApproved', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppMembershipDefaultPatch; const client = getClient(); - const result = await client.appMembershipDefault.update({ - where: { - id: answers.id as string - }, - data: { - createdBy: cleanedData.createdBy, - isApproved: cleanedData.isApproved, - isVerified: cleanedData.isVerified, - updatedBy: cleanedData.updatedBy - }, - select: { - createdAt: true, - createdBy: true, - id: true, - isApproved: true, - isVerified: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.appMembershipDefault + .update({ + where: { + id: answers.id as string, + }, + data: { + createdBy: cleanedData.createdBy, + isApproved: cleanedData.isApproved, + isVerified: cleanedData.isVerified, + updatedBy: cleanedData.updatedBy, + }, + select: { + createdAt: true, + createdBy: true, + id: true, + isApproved: true, + isVerified: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -260,28 +308,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appMembershipDefault.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appMembershipDefault + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-membership.ts b/sdk/constructive-cli/src/admin/cli/commands/app-membership.ts index 2781845413..bc461db4c8 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-membership.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-membership.ts @@ -3,64 +3,78 @@ * @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 { CreateAppMembershipInput, AppMembershipPatch, AppMembershipSelect, AppMembershipFilter, AppMembershipOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppMembershipInput, + AppMembershipPatch, + AppMembershipSelect, + AppMembershipFilter, + AppMembershipOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - createdBy: "uuid", - granted: "string", - id: "uuid", - isActive: "boolean", - isAdmin: "boolean", - isApproved: "boolean", - isBanned: "boolean", - isDisabled: "boolean", - isOwner: "boolean", - isVerified: "boolean", - permissions: "string", - profileId: "uuid", - updatedAt: "string", - updatedBy: "uuid" + actorId: 'uuid', + createdAt: 'string', + createdBy: 'uuid', + granted: 'string', + id: 'uuid', + isActive: 'boolean', + isAdmin: 'boolean', + isApproved: 'boolean', + isBanned: 'boolean', + isDisabled: 'boolean', + isOwner: 'boolean', + isVerified: 'boolean', + permissions: 'string', + profileId: 'uuid', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\napp-membership \n\nCommands:\n list List appMembership records\n find-first Find first matching appMembership record\n get Get a appMembership by ID\n create Create a new appMembership\n update Update an existing appMembership\n delete Delete a appMembership\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) => { +const usage = + '\napp-membership \n\nCommands:\n list List appMembership records\n find-first Find first matching appMembership record\n get Get a appMembership by ID\n create Create a new appMembership\n update Update an existing appMembership\n delete Delete a appMembership\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,18 @@ async function handleList(argv: Partial>, _prompter: Inq permissions: true, profileId: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppMembershipSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppMembershipSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appMembership.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +135,18 @@ async function handleFindFirst(argv: Partial>, _prompter permissions: true, profileId: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppMembershipSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppMembershipSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appMembership.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +155,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appMembership.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - createdBy: true, - granted: true, - id: true, - isActive: true, - isAdmin: true, - isApproved: true, - isBanned: true, - isDisabled: true, - isOwner: true, - isVerified: true, - permissions: true, - profileId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.appMembership + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + createdBy: true, + granted: true, + id: true, + isActive: true, + isAdmin: true, + isApproved: true, + isBanned: true, + isDisabled: true, + isOwner: true, + isVerified: true, + permissions: true, + profileId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,125 +198,144 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granted", - message: "granted", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isAdmin", - message: "isAdmin", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isApproved", - message: "isApproved", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isBanned", - message: "isBanned", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDisabled", - message: "isDisabled", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isOwner", - message: "isOwner", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileId", - message: "profileId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granted', + message: 'granted', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isAdmin', + message: 'isAdmin', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isApproved', + message: 'isApproved', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBanned', + message: 'isBanned', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDisabled', + message: 'isDisabled', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isOwner', + message: 'isOwner', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileId', + message: 'profileId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppMembershipInput["appMembership"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppMembershipInput['appMembership']; const client = getClient(); - const result = await client.appMembership.create({ - data: { - actorId: cleanedData.actorId, - createdBy: cleanedData.createdBy, - granted: cleanedData.granted, - isActive: cleanedData.isActive, - isAdmin: cleanedData.isAdmin, - isApproved: cleanedData.isApproved, - isBanned: cleanedData.isBanned, - isDisabled: cleanedData.isDisabled, - isOwner: cleanedData.isOwner, - isVerified: cleanedData.isVerified, - permissions: cleanedData.permissions, - profileId: cleanedData.profileId, - updatedBy: cleanedData.updatedBy - }, - select: { - actorId: true, - createdAt: true, - createdBy: true, - granted: true, - id: true, - isActive: true, - isAdmin: true, - isApproved: true, - isBanned: true, - isDisabled: true, - isOwner: true, - isVerified: true, - permissions: true, - profileId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.appMembership + .create({ + data: { + actorId: cleanedData.actorId, + createdBy: cleanedData.createdBy, + granted: cleanedData.granted, + isActive: cleanedData.isActive, + isAdmin: cleanedData.isAdmin, + isApproved: cleanedData.isApproved, + isBanned: cleanedData.isBanned, + isDisabled: cleanedData.isDisabled, + isOwner: cleanedData.isOwner, + isVerified: cleanedData.isVerified, + permissions: cleanedData.permissions, + profileId: cleanedData.profileId, + updatedBy: cleanedData.updatedBy, + }, + select: { + actorId: true, + createdAt: true, + createdBy: true, + granted: true, + id: true, + isActive: true, + isAdmin: true, + isApproved: true, + isBanned: true, + isDisabled: true, + isOwner: true, + isVerified: true, + permissions: true, + profileId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -303,133 +344,150 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granted", - message: "granted", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isAdmin", - message: "isAdmin", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isApproved", - message: "isApproved", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isBanned", - message: "isBanned", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDisabled", - message: "isDisabled", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isOwner", - message: "isOwner", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileId", - message: "profileId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granted', + message: 'granted', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isAdmin', + message: 'isAdmin', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isApproved', + message: 'isApproved', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBanned', + message: 'isBanned', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDisabled', + message: 'isDisabled', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isOwner', + message: 'isOwner', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileId', + message: 'profileId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppMembershipPatch; const client = getClient(); - const result = await client.appMembership.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - createdBy: cleanedData.createdBy, - granted: cleanedData.granted, - isActive: cleanedData.isActive, - isAdmin: cleanedData.isAdmin, - isApproved: cleanedData.isApproved, - isBanned: cleanedData.isBanned, - isDisabled: cleanedData.isDisabled, - isOwner: cleanedData.isOwner, - isVerified: cleanedData.isVerified, - permissions: cleanedData.permissions, - profileId: cleanedData.profileId, - updatedBy: cleanedData.updatedBy - }, - select: { - actorId: true, - createdAt: true, - createdBy: true, - granted: true, - id: true, - isActive: true, - isAdmin: true, - isApproved: true, - isBanned: true, - isDisabled: true, - isOwner: true, - isVerified: true, - permissions: true, - profileId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.appMembership + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + createdBy: cleanedData.createdBy, + granted: cleanedData.granted, + isActive: cleanedData.isActive, + isAdmin: cleanedData.isAdmin, + isApproved: cleanedData.isApproved, + isBanned: cleanedData.isBanned, + isDisabled: cleanedData.isDisabled, + isOwner: cleanedData.isOwner, + isVerified: cleanedData.isVerified, + permissions: cleanedData.permissions, + profileId: cleanedData.profileId, + updatedBy: cleanedData.updatedBy, + }, + select: { + actorId: true, + createdAt: true, + createdBy: true, + granted: true, + id: true, + isActive: true, + isAdmin: true, + isApproved: true, + isBanned: true, + isDisabled: true, + isOwner: true, + isVerified: true, + permissions: true, + profileId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -438,28 +496,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appMembership.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appMembership + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-owner-grant.ts b/sdk/constructive-cli/src/admin/cli/commands/app-owner-grant.ts index c84f59e1e7..eb9877a189 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-owner-grant.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-owner-grant.ts @@ -3,54 +3,68 @@ * @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 { CreateAppOwnerGrantInput, AppOwnerGrantPatch, AppOwnerGrantSelect, AppOwnerGrantFilter, AppOwnerGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppOwnerGrantInput, + AppOwnerGrantPatch, + AppOwnerGrantSelect, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - grantorId: "uuid", - id: "uuid", - isGrant: "boolean", - updatedAt: "string" + actorId: 'uuid', + createdAt: 'string', + grantorId: 'uuid', + id: 'uuid', + isGrant: 'boolean', + updatedAt: 'string', }; -const usage = "\napp-owner-grant \n\nCommands:\n list List appOwnerGrant records\n find-first Find first matching appOwnerGrant record\n get Get a appOwnerGrant by ID\n create Create a new appOwnerGrant\n update Update an existing appOwnerGrant\n delete Delete a appOwnerGrant\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) => { +const usage = + '\napp-owner-grant \n\nCommands:\n list List appOwnerGrant records\n find-first Find first matching appOwnerGrant record\n get Get a appOwnerGrant by ID\n create Create a new appOwnerGrant\n update Update an existing appOwnerGrant\n delete Delete a appOwnerGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq grantorId: true, id: true, isGrant: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppOwnerGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppOwnerGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appOwnerGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter grantorId: true, id: true, isGrant: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppOwnerGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppOwnerGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appOwnerGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appOwnerGrant.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.appOwnerGrant + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,46 +158,55 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppOwnerGrantInput["appOwnerGrant"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppOwnerGrantInput['appOwnerGrant']; const client = getClient(); - const result = await client.appOwnerGrant.create({ - data: { - actorId: cleanedData.actorId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant - }, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.appOwnerGrant + .create({ + data: { + actorId: cleanedData.actorId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + }, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -184,54 +215,61 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppOwnerGrantPatch; const client = getClient(); - const result = await client.appOwnerGrant.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant - }, - select: { - actorId: true, - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.appOwnerGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + }, + select: { + actorId: true, + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -240,28 +278,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appOwnerGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appOwnerGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-permission-default-grant.ts b/sdk/constructive-cli/src/admin/cli/commands/app-permission-default-grant.ts index d2ee885d83..dbe5909dd1 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-permission-default-grant.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-permission-default-grant.ts @@ -3,54 +3,68 @@ * @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 { CreateAppPermissionDefaultGrantInput, AppPermissionDefaultGrantPatch, AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantFilter, AppPermissionDefaultGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppPermissionDefaultGrantInput, + AppPermissionDefaultGrantPatch, + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - grantorId: "uuid", - id: "uuid", - isGrant: "boolean", - permissionId: "uuid", - updatedAt: "string" + createdAt: 'string', + grantorId: 'uuid', + id: 'uuid', + isGrant: 'boolean', + permissionId: 'uuid', + updatedAt: 'string', }; -const usage = "\napp-permission-default-grant \n\nCommands:\n list List appPermissionDefaultGrant records\n find-first Find first matching appPermissionDefaultGrant record\n get Get a appPermissionDefaultGrant by ID\n create Create a new appPermissionDefaultGrant\n update Update an existing appPermissionDefaultGrant\n delete Delete a appPermissionDefaultGrant\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) => { +const usage = + '\napp-permission-default-grant \n\nCommands:\n list List appPermissionDefaultGrant records\n find-first Find first matching appPermissionDefaultGrant record\n get Get a appPermissionDefaultGrant by ID\n create Create a new appPermissionDefaultGrant\n update Update an existing appPermissionDefaultGrant\n delete Delete a appPermissionDefaultGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, isGrant: true, permissionId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppPermissionDefaultGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy + > & { + select: AppPermissionDefaultGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appPermissionDefaultGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +109,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, isGrant: true, permissionId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppPermissionDefaultGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy + > & { + select: AppPermissionDefaultGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appPermissionDefaultGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +133,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appPermissionDefaultGrant.findOne({ - id: answers.id as string, - select: { - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.appPermissionDefaultGrant + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,45 +166,54 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionId", - message: "permissionId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionId', + message: 'permissionId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppPermissionDefaultGrantInput["appPermissionDefaultGrant"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppPermissionDefaultGrantInput['appPermissionDefaultGrant']; const client = getClient(); - const result = await client.appPermissionDefaultGrant.create({ - data: { - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant, - permissionId: cleanedData.permissionId - }, - select: { - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.appPermissionDefaultGrant + .create({ + data: { + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + permissionId: cleanedData.permissionId, + }, + select: { + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -183,53 +222,60 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionId", - message: "permissionId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionId', + message: 'permissionId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppPermissionDefaultGrantPatch; const client = getClient(); - const result = await client.appPermissionDefaultGrant.update({ - where: { - id: answers.id as string - }, - data: { - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant, - permissionId: cleanedData.permissionId - }, - select: { - createdAt: true, - grantorId: true, - id: true, - isGrant: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.appPermissionDefaultGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + permissionId: cleanedData.permissionId, + }, + select: { + createdAt: true, + grantorId: true, + id: true, + isGrant: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -238,28 +284,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appPermissionDefaultGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appPermissionDefaultGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-permission-default-permission.ts b/sdk/constructive-cli/src/admin/cli/commands/app-permission-default-permission.ts index 69b7781f14..56917d715e 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-permission-default-permission.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-permission-default-permission.ts @@ -3,52 +3,66 @@ * @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 { CreateAppPermissionDefaultPermissionInput, AppPermissionDefaultPermissionPatch, AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionFilter, AppPermissionDefaultPermissionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppPermissionDefaultPermissionInput, + AppPermissionDefaultPermissionPatch, + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - id: "uuid", - permissionId: "uuid", - updatedAt: "string" + createdAt: 'string', + id: 'uuid', + permissionId: 'uuid', + updatedAt: 'string', }; -const usage = "\napp-permission-default-permission \n\nCommands:\n list List appPermissionDefaultPermission records\n find-first Find first matching appPermissionDefaultPermission record\n get Get a appPermissionDefaultPermission by ID\n create Create a new appPermissionDefaultPermission\n update Update an existing appPermissionDefaultPermission\n delete Delete a appPermissionDefaultPermission\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) => { +const usage = + '\napp-permission-default-permission \n\nCommands:\n list List appPermissionDefaultPermission records\n find-first Find first matching appPermissionDefaultPermission record\n get Get a appPermissionDefaultPermission by ID\n create Create a new appPermissionDefaultPermission\n update Update an existing appPermissionDefaultPermission\n delete Delete a appPermissionDefaultPermission\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -61,16 +75,22 @@ async function handleList(argv: Partial>, _prompter: Inq createdAt: true, id: true, permissionId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppPermissionDefaultPermissionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + > & { + select: AppPermissionDefaultPermissionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appPermissionDefaultPermission.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -83,16 +103,22 @@ async function handleFindFirst(argv: Partial>, _prompter createdAt: true, id: true, permissionId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppPermissionDefaultPermissionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + > & { + select: AppPermissionDefaultPermissionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appPermissionDefaultPermission.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -101,25 +127,29 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appPermissionDefaultPermission.findOne({ - id: answers.id as string, - select: { - createdAt: true, - id: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.appPermissionDefaultPermission + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -128,29 +158,36 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "permissionId", - message: "permissionId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'permissionId', + message: 'permissionId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppPermissionDefaultPermissionInput["appPermissionDefaultPermission"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppPermissionDefaultPermissionInput['appPermissionDefaultPermission']; const client = getClient(); - const result = await client.appPermissionDefaultPermission.create({ - data: { - permissionId: cleanedData.permissionId - }, - select: { - createdAt: true, - id: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.appPermissionDefaultPermission + .create({ + data: { + permissionId: cleanedData.permissionId, + }, + select: { + createdAt: true, + id: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -159,37 +196,42 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "permissionId", - message: "permissionId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'permissionId', + message: 'permissionId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppPermissionDefaultPermissionPatch; const client = getClient(); - const result = await client.appPermissionDefaultPermission.update({ - where: { - id: answers.id as string - }, - data: { - permissionId: cleanedData.permissionId - }, - select: { - createdAt: true, - id: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.appPermissionDefaultPermission + .update({ + where: { + id: answers.id as string, + }, + data: { + permissionId: cleanedData.permissionId, + }, + select: { + createdAt: true, + id: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -198,28 +240,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appPermissionDefaultPermission.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appPermissionDefaultPermission + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-permission-default.ts b/sdk/constructive-cli/src/admin/cli/commands/app-permission-default.ts index 1542f65ac3..3a03ac6c82 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-permission-default.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-permission-default.ts @@ -3,50 +3,64 @@ * @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 { CreateAppPermissionDefaultInput, AppPermissionDefaultPatch, AppPermissionDefaultSelect, AppPermissionDefaultFilter, AppPermissionDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppPermissionDefaultInput, + AppPermissionDefaultPatch, + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - id: "uuid", - permissions: "string" + id: 'uuid', + permissions: 'string', }; -const usage = "\napp-permission-default \n\nCommands:\n list List appPermissionDefault records\n find-first Find first matching appPermissionDefault record\n get Get a appPermissionDefault by ID\n create Create a new appPermissionDefault\n update Update an existing appPermissionDefault\n delete Delete a appPermissionDefault\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) => { +const usage = + '\napp-permission-default \n\nCommands:\n list List appPermissionDefault records\n find-first Find first matching appPermissionDefault record\n get Get a appPermissionDefault by ID\n create Create a new appPermissionDefault\n update Update an existing appPermissionDefault\n delete Delete a appPermissionDefault\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -57,16 +71,22 @@ async function handleList(argv: Partial>, _prompter: Inq try { const defaultSelect = { id: true, - permissions: true + permissions: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppPermissionDefaultSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy + > & { + select: AppPermissionDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appPermissionDefault.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -77,16 +97,22 @@ async function handleFindFirst(argv: Partial>, _prompter try { const defaultSelect = { id: true, - permissions: true + permissions: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppPermissionDefaultSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy + > & { + select: AppPermissionDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appPermissionDefault.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -95,23 +121,27 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appPermissionDefault.findOne({ - id: answers.id as string, - select: { - id: true, - permissions: true - } - }).execute(); + const result = await client.appPermissionDefault + .findOne({ + id: answers.id as string, + select: { + id: true, + permissions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -120,28 +150,35 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppPermissionDefaultInput["appPermissionDefault"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppPermissionDefaultInput['appPermissionDefault']; const client = getClient(); - const result = await client.appPermissionDefault.create({ - data: { - permissions: cleanedData.permissions - }, - select: { - id: true, - permissions: true - } - }).execute(); + const result = await client.appPermissionDefault + .create({ + data: { + permissions: cleanedData.permissions, + }, + select: { + id: true, + permissions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -150,36 +187,41 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppPermissionDefaultPatch; const client = getClient(); - const result = await client.appPermissionDefault.update({ - where: { - id: answers.id as string - }, - data: { - permissions: cleanedData.permissions - }, - select: { - id: true, - permissions: true - } - }).execute(); + const result = await client.appPermissionDefault + .update({ + where: { + id: answers.id as string, + }, + data: { + permissions: cleanedData.permissions, + }, + select: { + id: true, + permissions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -188,28 +230,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appPermissionDefault.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appPermissionDefault + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-permission.ts b/sdk/constructive-cli/src/admin/cli/commands/app-permission.ts index 1b7a89cef4..75325a49b6 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-permission.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-permission.ts @@ -3,53 +3,67 @@ * @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 { CreateAppPermissionInput, AppPermissionPatch, AppPermissionSelect, AppPermissionFilter, AppPermissionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppPermissionInput, + AppPermissionPatch, + AppPermissionSelect, + AppPermissionFilter, + AppPermissionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - bitnum: "int", - bitstr: "string", - description: "string", - id: "uuid", - name: "string" + bitnum: 'int', + bitstr: 'string', + description: 'string', + id: 'uuid', + name: 'string', }; -const usage = "\napp-permission \n\nCommands:\n list List appPermission records\n find-first Find first matching appPermission record\n get Get a appPermission by ID\n create Create a new appPermission\n update Update an existing appPermission\n delete Delete a appPermission\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) => { +const usage = + '\napp-permission \n\nCommands:\n list List appPermission records\n find-first Find first matching appPermission record\n get Get a appPermission by ID\n create Create a new appPermission\n update Update an existing appPermission\n delete Delete a appPermission\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq bitstr: true, description: true, id: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppPermissionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppPermissionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appPermission.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter bitstr: true, description: true, id: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppPermissionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppPermissionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appPermission.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appPermission.findOne({ - id: answers.id as string, - select: { - bitnum: true, - bitstr: true, - description: true, - id: true, - name: true - } - }).execute(); + const result = await client.appPermission + .findOne({ + id: answers.id as string, + select: { + bitnum: true, + bitstr: true, + description: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,52 +154,62 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "bitnum", - message: "bitnum", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bitstr", - message: "bitstr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'bitnum', + message: 'bitnum', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bitstr', + message: 'bitstr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppPermissionInput["appPermission"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppPermissionInput['appPermission']; const client = getClient(); - const result = await client.appPermission.create({ - data: { - bitnum: cleanedData.bitnum, - bitstr: cleanedData.bitstr, - description: cleanedData.description, - name: cleanedData.name - }, - select: { - bitnum: true, - bitstr: true, - description: true, - id: true, - name: true - } - }).execute(); + const result = await client.appPermission + .create({ + data: { + bitnum: cleanedData.bitnum, + bitstr: cleanedData.bitstr, + description: cleanedData.description, + name: cleanedData.name, + }, + select: { + bitnum: true, + bitstr: true, + description: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -186,60 +218,68 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "bitnum", - message: "bitnum", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bitstr", - message: "bitstr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'bitnum', + message: 'bitnum', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bitstr', + message: 'bitstr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppPermissionPatch; const client = getClient(); - const result = await client.appPermission.update({ - where: { - id: answers.id as string - }, - data: { - bitnum: cleanedData.bitnum, - bitstr: cleanedData.bitstr, - description: cleanedData.description, - name: cleanedData.name - }, - select: { - bitnum: true, - bitstr: true, - description: true, - id: true, - name: true - } - }).execute(); + const result = await client.appPermission + .update({ + where: { + id: answers.id as string, + }, + data: { + bitnum: cleanedData.bitnum, + bitstr: cleanedData.bitstr, + description: cleanedData.description, + name: cleanedData.name, + }, + select: { + bitnum: true, + bitstr: true, + description: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -248,28 +288,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appPermission.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appPermission + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-by-mask.ts b/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-by-mask.ts index a53b051b2c..0cc520e391 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-by-mask.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-by-mask.ts @@ -3,47 +3,64 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { buildSelectFromPaths } from "../utils"; -import type { AppPermissionsGetByMaskVariables } from "../../orm/query"; -import type { AppPermissionConnectionSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { buildSelectFromPaths } from '../utils'; +import type { AppPermissionsGetByMaskVariables } from '../../orm/query'; +import type { AppPermissionConnectionSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("app-permissions-get-by-mask - Reads and enables pagination through a set of `AppPermission`.\n\nUsage: app-permissions-get-by-mask [OPTIONS]\n"); + console.log( + 'app-permissions-get-by-mask - Reads and enables pagination through a set of `AppPermission`.\n\nUsage: app-permissions-get-by-mask [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "after", - message: "Read all values in the set after (below) this cursor." - }, { - type: "text", - name: "first", - message: "Only read the first `n` values of the set." - }, { - type: "text", - name: "mask", - message: "mask" - }, { - type: "text", - name: "offset", - message: "Skip the first `n` values from our `after` cursor, an alternative to cursor\nbased pagination. May not be used with `last`." - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'after', + message: 'Read all values in the set after (below) this cursor.', + }, + { + type: 'text', + name: 'first', + message: 'Only read the first `n` values of the set.', + }, + { + type: 'text', + name: 'mask', + message: 'mask', + }, + { + type: 'text', + name: 'offset', + message: + 'Skip the first `n` values from our `after` cursor, an alternative to cursor\nbased pagination. May not be used with `last`.', + }, + ]); const client = getClient(); - const selectFields = buildSelectFromPaths(argv.select as string ?? ""); - const result = await client.query.appPermissionsGetByMask(answers as unknown as AppPermissionsGetByMaskVariables, { - select: selectFields - } as unknown as { - select: AppPermissionConnectionSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? ''); + const result = await client.query + .appPermissionsGetByMask( + answers as unknown as AppPermissionsGetByMaskVariables, + { + select: selectFields, + } as unknown as { + select: AppPermissionConnectionSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: appPermissionsGetByMask"); + console.error('Failed: appPermissionsGetByMask'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-mask-by-names.ts b/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-mask-by-names.ts index 0684f5cb0a..2b9494ddda 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-mask-by-names.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-mask-by-names.ts @@ -3,28 +3,38 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { AppPermissionsGetMaskByNamesVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { AppPermissionsGetMaskByNamesVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("app-permissions-get-mask-by-names - appPermissionsGetMaskByNames\n\nUsage: app-permissions-get-mask-by-names [OPTIONS]\n"); + console.log( + 'app-permissions-get-mask-by-names - appPermissionsGetMaskByNames\n\nUsage: app-permissions-get-mask-by-names [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "names", - message: "names" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'names', + message: 'names', + }, + ]); const client = getClient(); - const result = await client.query.appPermissionsGetMaskByNames(answers as unknown as AppPermissionsGetMaskByNamesVariables).execute(); + const result = await client.query + .appPermissionsGetMaskByNames(answers as unknown as AppPermissionsGetMaskByNamesVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: appPermissionsGetMaskByNames"); + console.error('Failed: appPermissionsGetMaskByNames'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-mask.ts b/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-mask.ts index aad79d77a0..f40cf36074 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-mask.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-mask.ts @@ -3,28 +3,38 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { AppPermissionsGetMaskVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { AppPermissionsGetMaskVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("app-permissions-get-mask - appPermissionsGetMask\n\nUsage: app-permissions-get-mask [OPTIONS]\n"); + console.log( + 'app-permissions-get-mask - appPermissionsGetMask\n\nUsage: app-permissions-get-mask [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "ids", - message: "ids" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'ids', + message: 'ids', + }, + ]); const client = getClient(); - const result = await client.query.appPermissionsGetMask(answers as unknown as AppPermissionsGetMaskVariables).execute(); + const result = await client.query + .appPermissionsGetMask(answers as unknown as AppPermissionsGetMaskVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: appPermissionsGetMask"); + console.error('Failed: appPermissionsGetMask'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-padded-mask.ts b/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-padded-mask.ts index ff27bf7bdd..afa2fbc4c7 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-padded-mask.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/app-permissions-get-padded-mask.ts @@ -3,28 +3,38 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { AppPermissionsGetPaddedMaskVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { AppPermissionsGetPaddedMaskVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("app-permissions-get-padded-mask - appPermissionsGetPaddedMask\n\nUsage: app-permissions-get-padded-mask [OPTIONS]\n"); + console.log( + 'app-permissions-get-padded-mask - appPermissionsGetPaddedMask\n\nUsage: app-permissions-get-padded-mask [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "mask", - message: "mask" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'mask', + message: 'mask', + }, + ]); const client = getClient(); - const result = await client.query.appPermissionsGetPaddedMask(answers as unknown as AppPermissionsGetPaddedMaskVariables).execute(); + const result = await client.query + .appPermissionsGetPaddedMask(answers as unknown as AppPermissionsGetPaddedMaskVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: appPermissionsGetPaddedMask"); + console.error('Failed: appPermissionsGetPaddedMask'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/auth.ts b/sdk/constructive-cli/src/admin/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/context.ts b/sdk/constructive-cli/src/admin/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/context.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/membership-type.ts b/sdk/constructive-cli/src/admin/cli/commands/membership-type.ts index 368b6f1ef8..5a0077dbf5 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/membership-type.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/membership-type.ts @@ -3,54 +3,68 @@ * @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 { CreateMembershipTypeInput, MembershipTypePatch, MembershipTypeSelect, MembershipTypeFilter, MembershipTypeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateMembershipTypeInput, + MembershipTypePatch, + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - description: "string", - hasUsersTableEntry: "boolean", - id: "int", - name: "string", - parentMembershipType: "int", - scope: "string" + description: 'string', + hasUsersTableEntry: 'boolean', + id: 'int', + name: 'string', + parentMembershipType: 'int', + scope: 'string', }; -const usage = "\nmembership-type \n\nCommands:\n list List membershipType records\n find-first Find first matching membershipType record\n get Get a membershipType by ID\n create Create a new membershipType\n update Update an existing membershipType\n delete Delete a membershipType\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) => { +const usage = + '\nmembership-type \n\nCommands:\n list List membershipType records\n find-first Find first matching membershipType record\n get Get a membershipType by ID\n create Create a new membershipType\n update Update an existing membershipType\n delete Delete a membershipType\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, name: true, parentMembershipType: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: MembershipTypeSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: MembershipTypeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.membershipType.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, name: true, parentMembershipType: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: MembershipTypeSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: MembershipTypeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.membershipType.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.membershipType.findOne({ - id: answers.id as number, - select: { - description: true, - hasUsersTableEntry: true, - id: true, - name: true, - parentMembershipType: true, - scope: true - } - }).execute(); + const result = await client.membershipType + .findOne({ + id: answers.id as number, + select: { + description: true, + hasUsersTableEntry: true, + id: true, + name: true, + parentMembershipType: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,57 +158,68 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "description", - message: "description", - required: true - }, { - type: "boolean", - name: "hasUsersTableEntry", - message: "hasUsersTableEntry", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "parentMembershipType", - message: "parentMembershipType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'description', + message: 'description', + required: true, + }, + { + type: 'boolean', + name: 'hasUsersTableEntry', + message: 'hasUsersTableEntry', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'parentMembershipType', + message: 'parentMembershipType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateMembershipTypeInput["membershipType"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateMembershipTypeInput['membershipType']; const client = getClient(); - const result = await client.membershipType.create({ - data: { - description: cleanedData.description, - hasUsersTableEntry: cleanedData.hasUsersTableEntry, - name: cleanedData.name, - parentMembershipType: cleanedData.parentMembershipType, - scope: cleanedData.scope - }, - select: { - description: true, - hasUsersTableEntry: true, - id: true, - name: true, - parentMembershipType: true, - scope: true - } - }).execute(); + const result = await client.membershipType + .create({ + data: { + description: cleanedData.description, + hasUsersTableEntry: cleanedData.hasUsersTableEntry, + name: cleanedData.name, + parentMembershipType: cleanedData.parentMembershipType, + scope: cleanedData.scope, + }, + select: { + description: true, + hasUsersTableEntry: true, + id: true, + name: true, + parentMembershipType: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -195,65 +228,74 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "description", - message: "description", - required: false - }, { - type: "boolean", - name: "hasUsersTableEntry", - message: "hasUsersTableEntry", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "parentMembershipType", - message: "parentMembershipType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + }, + { + type: 'boolean', + name: 'hasUsersTableEntry', + message: 'hasUsersTableEntry', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'parentMembershipType', + message: 'parentMembershipType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as MembershipTypePatch; const client = getClient(); - const result = await client.membershipType.update({ - where: { - id: answers.id as number - }, - data: { - description: cleanedData.description, - hasUsersTableEntry: cleanedData.hasUsersTableEntry, - name: cleanedData.name, - parentMembershipType: cleanedData.parentMembershipType, - scope: cleanedData.scope - }, - select: { - description: true, - hasUsersTableEntry: true, - id: true, - name: true, - parentMembershipType: true, - scope: true - } - }).execute(); + const result = await client.membershipType + .update({ + where: { + id: answers.id as number, + }, + data: { + description: cleanedData.description, + hasUsersTableEntry: cleanedData.hasUsersTableEntry, + name: cleanedData.name, + parentMembershipType: cleanedData.parentMembershipType, + scope: cleanedData.scope, + }, + select: { + description: true, + hasUsersTableEntry: true, + id: true, + name: true, + parentMembershipType: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -262,28 +304,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.membershipType.delete({ - where: { - id: answers.id as number - }, - select: { - id: true - } - }).execute(); + const result = await client.membershipType + .delete({ + where: { + id: answers.id as number, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-admin-grant.ts b/sdk/constructive-cli/src/admin/cli/commands/org-admin-grant.ts index c9a5a58d8a..bd87925397 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-admin-grant.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-admin-grant.ts @@ -3,55 +3,69 @@ * @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 { CreateOrgAdminGrantInput, OrgAdminGrantPatch, OrgAdminGrantSelect, OrgAdminGrantFilter, OrgAdminGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgAdminGrantInput, + OrgAdminGrantPatch, + OrgAdminGrantSelect, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - entityId: "uuid", - grantorId: "uuid", - id: "uuid", - isGrant: "boolean", - updatedAt: "string" + actorId: 'uuid', + createdAt: 'string', + entityId: 'uuid', + grantorId: 'uuid', + id: 'uuid', + isGrant: 'boolean', + updatedAt: 'string', }; -const usage = "\norg-admin-grant \n\nCommands:\n list List orgAdminGrant records\n find-first Find first matching orgAdminGrant record\n get Get a orgAdminGrant by ID\n create Create a new orgAdminGrant\n update Update an existing orgAdminGrant\n delete Delete a orgAdminGrant\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) => { +const usage = + '\norg-admin-grant \n\nCommands:\n list List orgAdminGrant records\n find-first Find first matching orgAdminGrant record\n get Get a orgAdminGrant by ID\n create Create a new orgAdminGrant\n update Update an existing orgAdminGrant\n delete Delete a orgAdminGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq grantorId: true, id: true, isGrant: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgAdminGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgAdminGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgAdminGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter grantorId: true, id: true, isGrant: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgAdminGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgAdminGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgAdminGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgAdminGrant.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.orgAdminGrant + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,53 +162,63 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgAdminGrantInput["orgAdminGrant"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgAdminGrantInput['orgAdminGrant']; const client = getClient(); - const result = await client.orgAdminGrant.create({ - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant - }, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.orgAdminGrant + .create({ + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + }, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -195,61 +227,69 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgAdminGrantPatch; const client = getClient(); - const result = await client.orgAdminGrant.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant - }, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.orgAdminGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + }, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -258,28 +298,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgAdminGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgAdminGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-claimed-invite.ts b/sdk/constructive-cli/src/admin/cli/commands/org-claimed-invite.ts index 3d9055bbc0..0a7a0afad4 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-claimed-invite.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-claimed-invite.ts @@ -3,55 +3,69 @@ * @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 { CreateOrgClaimedInviteInput, OrgClaimedInvitePatch, OrgClaimedInviteSelect, OrgClaimedInviteFilter, OrgClaimedInviteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgClaimedInviteInput, + OrgClaimedInvitePatch, + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - entityId: "uuid", - id: "uuid", - receiverId: "uuid", - senderId: "uuid", - updatedAt: "string" + createdAt: 'string', + data: 'json', + entityId: 'uuid', + id: 'uuid', + receiverId: 'uuid', + senderId: 'uuid', + updatedAt: 'string', }; -const usage = "\norg-claimed-invite \n\nCommands:\n list List orgClaimedInvite records\n find-first Find first matching orgClaimedInvite record\n get Get a orgClaimedInvite by ID\n create Create a new orgClaimedInvite\n update Update an existing orgClaimedInvite\n delete Delete a orgClaimedInvite\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) => { +const usage = + '\norg-claimed-invite \n\nCommands:\n list List orgClaimedInvite records\n find-first Find first matching orgClaimedInvite record\n get Get a orgClaimedInvite by ID\n create Create a new orgClaimedInvite\n update Update an existing orgClaimedInvite\n delete Delete a orgClaimedInvite\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, receiverId: true, senderId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgClaimedInviteSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgClaimedInviteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgClaimedInvite.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, receiverId: true, senderId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgClaimedInviteSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgClaimedInviteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgClaimedInvite.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgClaimedInvite.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - entityId: true, - id: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgClaimedInvite + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + entityId: true, + id: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,53 +162,63 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "receiverId", - message: "receiverId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "senderId", - message: "senderId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'receiverId', + message: 'receiverId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'senderId', + message: 'senderId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgClaimedInviteInput["orgClaimedInvite"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgClaimedInviteInput['orgClaimedInvite']; const client = getClient(); - const result = await client.orgClaimedInvite.create({ - data: { - data: cleanedData.data, - entityId: cleanedData.entityId, - receiverId: cleanedData.receiverId, - senderId: cleanedData.senderId - }, - select: { - createdAt: true, - data: true, - entityId: true, - id: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgClaimedInvite + .create({ + data: { + data: cleanedData.data, + entityId: cleanedData.entityId, + receiverId: cleanedData.receiverId, + senderId: cleanedData.senderId, + }, + select: { + createdAt: true, + data: true, + entityId: true, + id: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -195,61 +227,69 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "receiverId", - message: "receiverId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "senderId", - message: "senderId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'receiverId', + message: 'receiverId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'senderId', + message: 'senderId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgClaimedInvitePatch; const client = getClient(); - const result = await client.orgClaimedInvite.update({ - where: { - id: answers.id as string - }, - data: { - data: cleanedData.data, - entityId: cleanedData.entityId, - receiverId: cleanedData.receiverId, - senderId: cleanedData.senderId - }, - select: { - createdAt: true, - data: true, - entityId: true, - id: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgClaimedInvite + .update({ + where: { + id: answers.id as string, + }, + data: { + data: cleanedData.data, + entityId: cleanedData.entityId, + receiverId: cleanedData.receiverId, + senderId: cleanedData.senderId, + }, + select: { + createdAt: true, + data: true, + entityId: true, + id: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -258,28 +298,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgClaimedInvite.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgClaimedInvite + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-grant.ts b/sdk/constructive-cli/src/admin/cli/commands/org-grant.ts index 8dedbbd2f3..ff31324db6 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-grant.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-grant.ts @@ -3,56 +3,70 @@ * @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 { CreateOrgGrantInput, OrgGrantPatch, OrgGrantSelect, OrgGrantFilter, OrgGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgGrantInput, + OrgGrantPatch, + OrgGrantSelect, + OrgGrantFilter, + OrgGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - entityId: "uuid", - grantorId: "uuid", - id: "uuid", - isGrant: "boolean", - permissions: "string", - updatedAt: "string" + actorId: 'uuid', + createdAt: 'string', + entityId: 'uuid', + grantorId: 'uuid', + id: 'uuid', + isGrant: 'boolean', + permissions: 'string', + updatedAt: 'string', }; -const usage = "\norg-grant \n\nCommands:\n list List orgGrant records\n find-first Find first matching orgGrant record\n get Get a orgGrant by ID\n create Create a new orgGrant\n update Update an existing orgGrant\n delete Delete a orgGrant\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) => { +const usage = + '\norg-grant \n\nCommands:\n list List orgGrant records\n find-first Find first matching orgGrant record\n get Get a orgGrant by ID\n create Create a new orgGrant\n update Update an existing orgGrant\n delete Delete a orgGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, isGrant: true, permissions: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, isGrant: true, permissions: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgGrant.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - permissions: true, - updatedAt: true - } - }).execute(); + const result = await client.orgGrant + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + permissions: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,61 +166,69 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgGrantInput["orgGrant"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgGrantInput['orgGrant']; const client = getClient(); - const result = await client.orgGrant.create({ - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant, - permissions: cleanedData.permissions - }, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - permissions: true, - updatedAt: true - } - }).execute(); + const result = await client.orgGrant + .create({ + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + permissions: cleanedData.permissions, + }, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + permissions: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -207,69 +237,78 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgGrantPatch; const client = getClient(); - const result = await client.orgGrant.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant, - permissions: cleanedData.permissions - }, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - permissions: true, - updatedAt: true - } - }).execute(); + const result = await client.orgGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + permissions: cleanedData.permissions, + }, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + permissions: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -278,28 +317,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-invite.ts b/sdk/constructive-cli/src/admin/cli/commands/org-invite.ts index 61b00e3a39..a6409f937f 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-invite.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-invite.ts @@ -3,66 +3,80 @@ * @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 { CreateOrgInviteInput, OrgInvitePatch, OrgInviteSelect, OrgInviteFilter, OrgInviteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgInviteInput, + OrgInvitePatch, + OrgInviteSelect, + OrgInviteFilter, + OrgInviteOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - channel: "string", - createdAt: "string", - data: "json", - email: "string", - entityId: "uuid", - expiresAt: "string", - id: "uuid", - inviteCount: "int", - inviteLimit: "int", - inviteToken: "string", - inviteValid: "boolean", - isReadOnly: "boolean", - multiple: "boolean", - phone: "string", - profileId: "uuid", - receiverId: "uuid", - senderId: "uuid", - updatedAt: "string" + channel: 'string', + createdAt: 'string', + data: 'json', + email: 'string', + entityId: 'uuid', + expiresAt: 'string', + id: 'uuid', + inviteCount: 'int', + inviteLimit: 'int', + inviteToken: 'string', + inviteValid: 'boolean', + isReadOnly: 'boolean', + multiple: 'boolean', + phone: 'string', + profileId: 'uuid', + receiverId: 'uuid', + senderId: 'uuid', + updatedAt: 'string', }; -const usage = "\norg-invite \n\nCommands:\n list List orgInvite records\n find-first Find first matching orgInvite record\n get Get a orgInvite by ID\n create Create a new orgInvite\n update Update an existing orgInvite\n delete Delete a orgInvite\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) => { +const usage = + '\norg-invite \n\nCommands:\n list List orgInvite records\n find-first Find first matching orgInvite record\n get Get a orgInvite by ID\n create Create a new orgInvite\n update Update an existing orgInvite\n delete Delete a orgInvite\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -89,16 +103,18 @@ async function handleList(argv: Partial>, _prompter: Inq profileId: true, receiverId: true, senderId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgInviteSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgInviteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgInvite.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -125,16 +141,18 @@ async function handleFindFirst(argv: Partial>, _prompter profileId: true, receiverId: true, senderId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgInviteSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgInviteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgInvite.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -143,39 +161,43 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgInvite.findOne({ - id: answers.id as string, - select: { - channel: true, - createdAt: true, - data: true, - email: true, - entityId: true, - expiresAt: true, - id: true, - inviteCount: true, - inviteLimit: true, - inviteToken: true, - inviteValid: true, - isReadOnly: true, - multiple: true, - phone: true, - profileId: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgInvite + .findOne({ + id: answers.id as string, + select: { + channel: true, + createdAt: true, + data: true, + email: true, + entityId: true, + expiresAt: true, + id: true, + inviteCount: true, + inviteLimit: true, + inviteToken: true, + inviteValid: true, + isReadOnly: true, + multiple: true, + phone: true, + profileId: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -184,141 +206,159 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "channel", - message: "channel", - required: false, - skipPrompt: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "email", - message: "email", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteCount", - message: "inviteCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteLimit", - message: "inviteLimit", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteToken", - message: "inviteToken", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "inviteValid", - message: "inviteValid", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isReadOnly", - message: "isReadOnly", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "multiple", - message: "multiple", - required: false, - skipPrompt: true - }, { - type: "text", - name: "phone", - message: "phone", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileId", - message: "profileId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "receiverId", - message: "receiverId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "senderId", - message: "senderId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'channel', + message: 'channel', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'email', + message: 'email', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteCount', + message: 'inviteCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteLimit', + message: 'inviteLimit', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteToken', + message: 'inviteToken', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'inviteValid', + message: 'inviteValid', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'multiple', + message: 'multiple', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'phone', + message: 'phone', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileId', + message: 'profileId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'receiverId', + message: 'receiverId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'senderId', + message: 'senderId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgInviteInput["orgInvite"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgInviteInput['orgInvite']; const client = getClient(); - const result = await client.orgInvite.create({ - data: { - channel: cleanedData.channel, - data: cleanedData.data, - email: cleanedData.email, - entityId: cleanedData.entityId, - expiresAt: cleanedData.expiresAt, - inviteCount: cleanedData.inviteCount, - inviteLimit: cleanedData.inviteLimit, - inviteToken: cleanedData.inviteToken, - inviteValid: cleanedData.inviteValid, - isReadOnly: cleanedData.isReadOnly, - multiple: cleanedData.multiple, - phone: cleanedData.phone, - profileId: cleanedData.profileId, - receiverId: cleanedData.receiverId, - senderId: cleanedData.senderId - }, - select: { - channel: true, - createdAt: true, - data: true, - email: true, - entityId: true, - expiresAt: true, - id: true, - inviteCount: true, - inviteLimit: true, - inviteToken: true, - inviteValid: true, - isReadOnly: true, - multiple: true, - phone: true, - profileId: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgInvite + .create({ + data: { + channel: cleanedData.channel, + data: cleanedData.data, + email: cleanedData.email, + entityId: cleanedData.entityId, + expiresAt: cleanedData.expiresAt, + inviteCount: cleanedData.inviteCount, + inviteLimit: cleanedData.inviteLimit, + inviteToken: cleanedData.inviteToken, + inviteValid: cleanedData.inviteValid, + isReadOnly: cleanedData.isReadOnly, + multiple: cleanedData.multiple, + phone: cleanedData.phone, + profileId: cleanedData.profileId, + receiverId: cleanedData.receiverId, + senderId: cleanedData.senderId, + }, + select: { + channel: true, + createdAt: true, + data: true, + email: true, + entityId: true, + expiresAt: true, + id: true, + inviteCount: true, + inviteLimit: true, + inviteToken: true, + inviteValid: true, + isReadOnly: true, + multiple: true, + phone: true, + profileId: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -327,149 +367,168 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "channel", - message: "channel", - required: false, - skipPrompt: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "email", - message: "email", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteCount", - message: "inviteCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteLimit", - message: "inviteLimit", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inviteToken", - message: "inviteToken", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "inviteValid", - message: "inviteValid", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isReadOnly", - message: "isReadOnly", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "multiple", - message: "multiple", - required: false, - skipPrompt: true - }, { - type: "text", - name: "phone", - message: "phone", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileId", - message: "profileId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "receiverId", - message: "receiverId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "senderId", - message: "senderId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'channel', + message: 'channel', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'email', + message: 'email', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteCount', + message: 'inviteCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteLimit', + message: 'inviteLimit', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inviteToken', + message: 'inviteToken', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'inviteValid', + message: 'inviteValid', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'multiple', + message: 'multiple', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'phone', + message: 'phone', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileId', + message: 'profileId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'receiverId', + message: 'receiverId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'senderId', + message: 'senderId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgInvitePatch; const client = getClient(); - const result = await client.orgInvite.update({ - where: { - id: answers.id as string - }, - data: { - channel: cleanedData.channel, - data: cleanedData.data, - email: cleanedData.email, - entityId: cleanedData.entityId, - expiresAt: cleanedData.expiresAt, - inviteCount: cleanedData.inviteCount, - inviteLimit: cleanedData.inviteLimit, - inviteToken: cleanedData.inviteToken, - inviteValid: cleanedData.inviteValid, - isReadOnly: cleanedData.isReadOnly, - multiple: cleanedData.multiple, - phone: cleanedData.phone, - profileId: cleanedData.profileId, - receiverId: cleanedData.receiverId, - senderId: cleanedData.senderId - }, - select: { - channel: true, - createdAt: true, - data: true, - email: true, - entityId: true, - expiresAt: true, - id: true, - inviteCount: true, - inviteLimit: true, - inviteToken: true, - inviteValid: true, - isReadOnly: true, - multiple: true, - phone: true, - profileId: true, - receiverId: true, - senderId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgInvite + .update({ + where: { + id: answers.id as string, + }, + data: { + channel: cleanedData.channel, + data: cleanedData.data, + email: cleanedData.email, + entityId: cleanedData.entityId, + expiresAt: cleanedData.expiresAt, + inviteCount: cleanedData.inviteCount, + inviteLimit: cleanedData.inviteLimit, + inviteToken: cleanedData.inviteToken, + inviteValid: cleanedData.inviteValid, + isReadOnly: cleanedData.isReadOnly, + multiple: cleanedData.multiple, + phone: cleanedData.phone, + profileId: cleanedData.profileId, + receiverId: cleanedData.receiverId, + senderId: cleanedData.senderId, + }, + select: { + channel: true, + createdAt: true, + data: true, + email: true, + entityId: true, + expiresAt: true, + id: true, + inviteCount: true, + inviteLimit: true, + inviteToken: true, + inviteValid: true, + isReadOnly: true, + multiple: true, + phone: true, + profileId: true, + receiverId: true, + senderId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -478,28 +537,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgInvite.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgInvite + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-member-profile.ts b/sdk/constructive-cli/src/admin/cli/commands/org-member-profile.ts index 4f34972898..2ee08ef06a 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-member-profile.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-member-profile.ts @@ -3,59 +3,73 @@ * @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 { CreateOrgMemberProfileInput, OrgMemberProfilePatch, OrgMemberProfileSelect, OrgMemberProfileFilter, OrgMemberProfileOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgMemberProfileInput, + OrgMemberProfilePatch, + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - bio: "string", - createdAt: "string", - displayName: "string", - email: "string", - entityId: "uuid", - id: "uuid", - membershipId: "uuid", - profilePicture: "string", - title: "string", - updatedAt: "string" + actorId: 'uuid', + bio: 'string', + createdAt: 'string', + displayName: 'string', + email: 'string', + entityId: 'uuid', + id: 'uuid', + membershipId: 'uuid', + profilePicture: 'string', + title: 'string', + updatedAt: 'string', }; -const usage = "\norg-member-profile \n\nCommands:\n list List orgMemberProfile records\n find-first Find first matching orgMemberProfile record\n get Get a orgMemberProfile by ID\n create Create a new orgMemberProfile\n update Update an existing orgMemberProfile\n delete Delete a orgMemberProfile\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) => { +const usage = + '\norg-member-profile \n\nCommands:\n list List orgMemberProfile records\n find-first Find first matching orgMemberProfile record\n get Get a orgMemberProfile by ID\n create Create a new orgMemberProfile\n update Update an existing orgMemberProfile\n delete Delete a orgMemberProfile\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq membershipId: true, profilePicture: true, title: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgMemberProfileSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgMemberProfileSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMemberProfile.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter membershipId: true, profilePicture: true, title: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgMemberProfileSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgMemberProfileSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMemberProfile.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgMemberProfile.findOne({ - id: answers.id as string, - select: { - actorId: true, - bio: true, - createdAt: true, - displayName: true, - email: true, - entityId: true, - id: true, - membershipId: true, - profilePicture: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.orgMemberProfile + .findOne({ + id: answers.id as string, + select: { + actorId: true, + bio: true, + createdAt: true, + displayName: true, + email: true, + entityId: true, + id: true, + membershipId: true, + profilePicture: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,83 +178,97 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: true - }, { - type: "text", - name: "bio", - message: "bio", - required: false, - skipPrompt: true - }, { - type: "text", - name: "displayName", - message: "displayName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "email", - message: "email", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "membershipId", - message: "membershipId", - required: true - }, { - type: "text", - name: "profilePicture", - message: "profilePicture", - required: false, - skipPrompt: true - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: true, + }, + { + type: 'text', + name: 'bio', + message: 'bio', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'email', + message: 'email', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'membershipId', + message: 'membershipId', + required: true, + }, + { + type: 'text', + name: 'profilePicture', + message: 'profilePicture', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgMemberProfileInput["orgMemberProfile"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgMemberProfileInput['orgMemberProfile']; const client = getClient(); - const result = await client.orgMemberProfile.create({ - data: { - actorId: cleanedData.actorId, - bio: cleanedData.bio, - displayName: cleanedData.displayName, - email: cleanedData.email, - entityId: cleanedData.entityId, - membershipId: cleanedData.membershipId, - profilePicture: cleanedData.profilePicture, - title: cleanedData.title - }, - select: { - actorId: true, - bio: true, - createdAt: true, - displayName: true, - email: true, - entityId: true, - id: true, - membershipId: true, - profilePicture: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.orgMemberProfile + .create({ + data: { + actorId: cleanedData.actorId, + bio: cleanedData.bio, + displayName: cleanedData.displayName, + email: cleanedData.email, + entityId: cleanedData.entityId, + membershipId: cleanedData.membershipId, + profilePicture: cleanedData.profilePicture, + title: cleanedData.title, + }, + select: { + actorId: true, + bio: true, + createdAt: true, + displayName: true, + email: true, + entityId: true, + id: true, + membershipId: true, + profilePicture: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -241,91 +277,103 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false - }, { - type: "text", - name: "bio", - message: "bio", - required: false, - skipPrompt: true - }, { - type: "text", - name: "displayName", - message: "displayName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "email", - message: "email", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "membershipId", - message: "membershipId", - required: false - }, { - type: "text", - name: "profilePicture", - message: "profilePicture", - required: false, - skipPrompt: true - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + }, + { + type: 'text', + name: 'bio', + message: 'bio', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'email', + message: 'email', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'membershipId', + message: 'membershipId', + required: false, + }, + { + type: 'text', + name: 'profilePicture', + message: 'profilePicture', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgMemberProfilePatch; const client = getClient(); - const result = await client.orgMemberProfile.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - bio: cleanedData.bio, - displayName: cleanedData.displayName, - email: cleanedData.email, - entityId: cleanedData.entityId, - membershipId: cleanedData.membershipId, - profilePicture: cleanedData.profilePicture, - title: cleanedData.title - }, - select: { - actorId: true, - bio: true, - createdAt: true, - displayName: true, - email: true, - entityId: true, - id: true, - membershipId: true, - profilePicture: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.orgMemberProfile + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + bio: cleanedData.bio, + displayName: cleanedData.displayName, + email: cleanedData.email, + entityId: cleanedData.entityId, + membershipId: cleanedData.membershipId, + profilePicture: cleanedData.profilePicture, + title: cleanedData.title, + }, + select: { + actorId: true, + bio: true, + createdAt: true, + displayName: true, + email: true, + entityId: true, + id: true, + membershipId: true, + profilePicture: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -334,28 +382,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgMemberProfile.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgMemberProfile + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-member.ts b/sdk/constructive-cli/src/admin/cli/commands/org-member.ts index f3cafa21b9..98f1a4e7dc 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-member.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-member.ts @@ -3,52 +3,66 @@ * @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 { CreateOrgMemberInput, OrgMemberPatch, OrgMemberSelect, OrgMemberFilter, OrgMemberOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgMemberInput, + OrgMemberPatch, + OrgMemberSelect, + OrgMemberFilter, + OrgMemberOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - entityId: "uuid", - id: "uuid", - isAdmin: "boolean" + actorId: 'uuid', + entityId: 'uuid', + id: 'uuid', + isAdmin: 'boolean', }; -const usage = "\norg-member \n\nCommands:\n list List orgMember records\n find-first Find first matching orgMember record\n get Get a orgMember by ID\n create Create a new orgMember\n update Update an existing orgMember\n delete Delete a orgMember\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) => { +const usage = + '\norg-member \n\nCommands:\n list List orgMember records\n find-first Find first matching orgMember record\n get Get a orgMember by ID\n create Create a new orgMember\n update Update an existing orgMember\n delete Delete a orgMember\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -61,16 +75,18 @@ async function handleList(argv: Partial>, _prompter: Inq actorId: true, entityId: true, id: true, - isAdmin: true + isAdmin: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgMemberSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgMemberSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMember.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -83,16 +99,18 @@ async function handleFindFirst(argv: Partial>, _prompter actorId: true, entityId: true, id: true, - isAdmin: true + isAdmin: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgMemberSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgMemberSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMember.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -101,25 +119,29 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgMember.findOne({ - id: answers.id as string, - select: { - actorId: true, - entityId: true, - id: true, - isAdmin: true - } - }).execute(); + const result = await client.orgMember + .findOne({ + id: answers.id as string, + select: { + actorId: true, + entityId: true, + id: true, + isAdmin: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -128,42 +150,48 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "boolean", - name: "isAdmin", - message: "isAdmin", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'boolean', + name: 'isAdmin', + message: 'isAdmin', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgMemberInput["orgMember"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgMemberInput['orgMember']; const client = getClient(); - const result = await client.orgMember.create({ - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - isAdmin: cleanedData.isAdmin - }, - select: { - actorId: true, - entityId: true, - id: true, - isAdmin: true - } - }).execute(); + const result = await client.orgMember + .create({ + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + isAdmin: cleanedData.isAdmin, + }, + select: { + actorId: true, + entityId: true, + id: true, + isAdmin: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -172,50 +200,57 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "boolean", - name: "isAdmin", - message: "isAdmin", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'boolean', + name: 'isAdmin', + message: 'isAdmin', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgMemberPatch; const client = getClient(); - const result = await client.orgMember.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - isAdmin: cleanedData.isAdmin - }, - select: { - actorId: true, - entityId: true, - id: true, - isAdmin: true - } - }).execute(); + const result = await client.orgMember + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + isAdmin: cleanedData.isAdmin, + }, + select: { + actorId: true, + entityId: true, + id: true, + isAdmin: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -224,28 +259,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgMember.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgMember + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-membership-default.ts b/sdk/constructive-cli/src/admin/cli/commands/org-membership-default.ts index db30ed75dd..ef6f59f9ec 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-membership-default.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-membership-default.ts @@ -3,55 +3,69 @@ * @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 { CreateOrgMembershipDefaultInput, OrgMembershipDefaultPatch, OrgMembershipDefaultSelect, OrgMembershipDefaultFilter, OrgMembershipDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgMembershipDefaultInput, + OrgMembershipDefaultPatch, + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - createdBy: "uuid", - entityId: "uuid", - id: "uuid", - isApproved: "boolean", - updatedAt: "string", - updatedBy: "uuid" + createdAt: 'string', + createdBy: 'uuid', + entityId: 'uuid', + id: 'uuid', + isApproved: 'boolean', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\norg-membership-default \n\nCommands:\n list List orgMembershipDefault records\n find-first Find first matching orgMembershipDefault record\n get Get a orgMembershipDefault by ID\n create Create a new orgMembershipDefault\n update Update an existing orgMembershipDefault\n delete Delete a orgMembershipDefault\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) => { +const usage = + '\norg-membership-default \n\nCommands:\n list List orgMembershipDefault records\n find-first Find first matching orgMembershipDefault record\n get Get a orgMembershipDefault by ID\n create Create a new orgMembershipDefault\n update Update an existing orgMembershipDefault\n delete Delete a orgMembershipDefault\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, isApproved: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgMembershipDefaultSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy + > & { + select: OrgMembershipDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMembershipDefault.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, isApproved: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgMembershipDefaultSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy + > & { + select: OrgMembershipDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMembershipDefault.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgMembershipDefault.findOne({ - id: answers.id as string, - select: { - createdAt: true, - createdBy: true, - entityId: true, - id: true, - isApproved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembershipDefault + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + createdBy: true, + entityId: true, + id: true, + isApproved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,53 +170,63 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "boolean", - name: "isApproved", - message: "isApproved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'boolean', + name: 'isApproved', + message: 'isApproved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgMembershipDefaultInput["orgMembershipDefault"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgMembershipDefaultInput['orgMembershipDefault']; const client = getClient(); - const result = await client.orgMembershipDefault.create({ - data: { - createdBy: cleanedData.createdBy, - entityId: cleanedData.entityId, - isApproved: cleanedData.isApproved, - updatedBy: cleanedData.updatedBy - }, - select: { - createdAt: true, - createdBy: true, - entityId: true, - id: true, - isApproved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembershipDefault + .create({ + data: { + createdBy: cleanedData.createdBy, + entityId: cleanedData.entityId, + isApproved: cleanedData.isApproved, + updatedBy: cleanedData.updatedBy, + }, + select: { + createdAt: true, + createdBy: true, + entityId: true, + id: true, + isApproved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -195,61 +235,69 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "boolean", - name: "isApproved", - message: "isApproved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'boolean', + name: 'isApproved', + message: 'isApproved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgMembershipDefaultPatch; const client = getClient(); - const result = await client.orgMembershipDefault.update({ - where: { - id: answers.id as string - }, - data: { - createdBy: cleanedData.createdBy, - entityId: cleanedData.entityId, - isApproved: cleanedData.isApproved, - updatedBy: cleanedData.updatedBy - }, - select: { - createdAt: true, - createdBy: true, - entityId: true, - id: true, - isApproved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembershipDefault + .update({ + where: { + id: answers.id as string, + }, + data: { + createdBy: cleanedData.createdBy, + entityId: cleanedData.entityId, + isApproved: cleanedData.isApproved, + updatedBy: cleanedData.updatedBy, + }, + select: { + createdAt: true, + createdBy: true, + entityId: true, + id: true, + isApproved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -258,28 +306,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgMembershipDefault.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgMembershipDefault + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-membership-setting.ts b/sdk/constructive-cli/src/admin/cli/commands/org-membership-setting.ts index 26d3a7ad5e..56f9068445 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-membership-setting.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-membership-setting.ts @@ -3,62 +3,76 @@ * @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 { CreateOrgMembershipSettingInput, OrgMembershipSettingPatch, OrgMembershipSettingSelect, OrgMembershipSettingFilter, OrgMembershipSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgMembershipSettingInput, + OrgMembershipSettingPatch, + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - allowExternalMembers: "boolean", - createChildCascadeAdmins: "boolean", - createChildCascadeMembers: "boolean", - createChildCascadeOwners: "boolean", - createdAt: "string", - createdBy: "uuid", - deleteMemberCascadeChildren: "boolean", - entityId: "uuid", - id: "uuid", - inviteProfileAssignmentMode: "string", - limitAllocationMode: "string", - populateMemberEmail: "boolean", - updatedAt: "string", - updatedBy: "uuid" + allowExternalMembers: 'boolean', + createChildCascadeAdmins: 'boolean', + createChildCascadeMembers: 'boolean', + createChildCascadeOwners: 'boolean', + createdAt: 'string', + createdBy: 'uuid', + deleteMemberCascadeChildren: 'boolean', + entityId: 'uuid', + id: 'uuid', + inviteProfileAssignmentMode: 'string', + limitAllocationMode: 'string', + populateMemberEmail: 'boolean', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\norg-membership-setting \n\nCommands:\n list List orgMembershipSetting records\n find-first Find first matching orgMembershipSetting record\n get Get a orgMembershipSetting by ID\n create Create a new orgMembershipSetting\n update Update an existing orgMembershipSetting\n delete Delete a orgMembershipSetting\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) => { +const usage = + '\norg-membership-setting \n\nCommands:\n list List orgMembershipSetting records\n find-first Find first matching orgMembershipSetting record\n get Get a orgMembershipSetting by ID\n create Create a new orgMembershipSetting\n update Update an existing orgMembershipSetting\n delete Delete a orgMembershipSetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,22 @@ async function handleList(argv: Partial>, _prompter: Inq limitAllocationMode: true, populateMemberEmail: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgMembershipSettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy + > & { + select: OrgMembershipSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMembershipSetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +133,22 @@ async function handleFindFirst(argv: Partial>, _prompter limitAllocationMode: true, populateMemberEmail: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgMembershipSettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy + > & { + select: OrgMembershipSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMembershipSetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +157,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgMembershipSetting.findOne({ - id: answers.id as string, - select: { - allowExternalMembers: true, - createChildCascadeAdmins: true, - createChildCascadeMembers: true, - createChildCascadeOwners: true, - createdAt: true, - createdBy: true, - deleteMemberCascadeChildren: true, - entityId: true, - id: true, - inviteProfileAssignmentMode: true, - limitAllocationMode: true, - populateMemberEmail: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembershipSetting + .findOne({ + id: answers.id as string, + select: { + allowExternalMembers: true, + createChildCascadeAdmins: true, + createChildCascadeMembers: true, + createChildCascadeOwners: true, + createdAt: true, + createdBy: true, + deleteMemberCascadeChildren: true, + entityId: true, + id: true, + inviteProfileAssignmentMode: true, + limitAllocationMode: true, + populateMemberEmail: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,109 +198,126 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "allowExternalMembers", - message: "allowExternalMembers", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "createChildCascadeAdmins", - message: "createChildCascadeAdmins", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "createChildCascadeMembers", - message: "createChildCascadeMembers", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "createChildCascadeOwners", - message: "createChildCascadeOwners", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "deleteMemberCascadeChildren", - message: "deleteMemberCascadeChildren", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "inviteProfileAssignmentMode", - message: "inviteProfileAssignmentMode", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitAllocationMode", - message: "limitAllocationMode", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "populateMemberEmail", - message: "populateMemberEmail", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'allowExternalMembers', + message: 'allowExternalMembers', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'createChildCascadeAdmins', + message: 'createChildCascadeAdmins', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'createChildCascadeMembers', + message: 'createChildCascadeMembers', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'createChildCascadeOwners', + message: 'createChildCascadeOwners', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'deleteMemberCascadeChildren', + message: 'deleteMemberCascadeChildren', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'inviteProfileAssignmentMode', + message: 'inviteProfileAssignmentMode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitAllocationMode', + message: 'limitAllocationMode', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'populateMemberEmail', + message: 'populateMemberEmail', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgMembershipSettingInput["orgMembershipSetting"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgMembershipSettingInput['orgMembershipSetting']; const client = getClient(); - const result = await client.orgMembershipSetting.create({ - data: { - allowExternalMembers: cleanedData.allowExternalMembers, - createChildCascadeAdmins: cleanedData.createChildCascadeAdmins, - createChildCascadeMembers: cleanedData.createChildCascadeMembers, - createChildCascadeOwners: cleanedData.createChildCascadeOwners, - createdBy: cleanedData.createdBy, - deleteMemberCascadeChildren: cleanedData.deleteMemberCascadeChildren, - entityId: cleanedData.entityId, - inviteProfileAssignmentMode: cleanedData.inviteProfileAssignmentMode, - limitAllocationMode: cleanedData.limitAllocationMode, - populateMemberEmail: cleanedData.populateMemberEmail, - updatedBy: cleanedData.updatedBy - }, - select: { - allowExternalMembers: true, - createChildCascadeAdmins: true, - createChildCascadeMembers: true, - createChildCascadeOwners: true, - createdAt: true, - createdBy: true, - deleteMemberCascadeChildren: true, - entityId: true, - id: true, - inviteProfileAssignmentMode: true, - limitAllocationMode: true, - populateMemberEmail: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembershipSetting + .create({ + data: { + allowExternalMembers: cleanedData.allowExternalMembers, + createChildCascadeAdmins: cleanedData.createChildCascadeAdmins, + createChildCascadeMembers: cleanedData.createChildCascadeMembers, + createChildCascadeOwners: cleanedData.createChildCascadeOwners, + createdBy: cleanedData.createdBy, + deleteMemberCascadeChildren: cleanedData.deleteMemberCascadeChildren, + entityId: cleanedData.entityId, + inviteProfileAssignmentMode: cleanedData.inviteProfileAssignmentMode, + limitAllocationMode: cleanedData.limitAllocationMode, + populateMemberEmail: cleanedData.populateMemberEmail, + updatedBy: cleanedData.updatedBy, + }, + select: { + allowExternalMembers: true, + createChildCascadeAdmins: true, + createChildCascadeMembers: true, + createChildCascadeOwners: true, + createdAt: true, + createdBy: true, + deleteMemberCascadeChildren: true, + entityId: true, + id: true, + inviteProfileAssignmentMode: true, + limitAllocationMode: true, + populateMemberEmail: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -279,117 +326,132 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "allowExternalMembers", - message: "allowExternalMembers", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "createChildCascadeAdmins", - message: "createChildCascadeAdmins", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "createChildCascadeMembers", - message: "createChildCascadeMembers", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "createChildCascadeOwners", - message: "createChildCascadeOwners", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "deleteMemberCascadeChildren", - message: "deleteMemberCascadeChildren", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "inviteProfileAssignmentMode", - message: "inviteProfileAssignmentMode", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitAllocationMode", - message: "limitAllocationMode", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "populateMemberEmail", - message: "populateMemberEmail", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'allowExternalMembers', + message: 'allowExternalMembers', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'createChildCascadeAdmins', + message: 'createChildCascadeAdmins', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'createChildCascadeMembers', + message: 'createChildCascadeMembers', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'createChildCascadeOwners', + message: 'createChildCascadeOwners', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'deleteMemberCascadeChildren', + message: 'deleteMemberCascadeChildren', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'inviteProfileAssignmentMode', + message: 'inviteProfileAssignmentMode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitAllocationMode', + message: 'limitAllocationMode', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'populateMemberEmail', + message: 'populateMemberEmail', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgMembershipSettingPatch; const client = getClient(); - const result = await client.orgMembershipSetting.update({ - where: { - id: answers.id as string - }, - data: { - allowExternalMembers: cleanedData.allowExternalMembers, - createChildCascadeAdmins: cleanedData.createChildCascadeAdmins, - createChildCascadeMembers: cleanedData.createChildCascadeMembers, - createChildCascadeOwners: cleanedData.createChildCascadeOwners, - createdBy: cleanedData.createdBy, - deleteMemberCascadeChildren: cleanedData.deleteMemberCascadeChildren, - entityId: cleanedData.entityId, - inviteProfileAssignmentMode: cleanedData.inviteProfileAssignmentMode, - limitAllocationMode: cleanedData.limitAllocationMode, - populateMemberEmail: cleanedData.populateMemberEmail, - updatedBy: cleanedData.updatedBy - }, - select: { - allowExternalMembers: true, - createChildCascadeAdmins: true, - createChildCascadeMembers: true, - createChildCascadeOwners: true, - createdAt: true, - createdBy: true, - deleteMemberCascadeChildren: true, - entityId: true, - id: true, - inviteProfileAssignmentMode: true, - limitAllocationMode: true, - populateMemberEmail: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembershipSetting + .update({ + where: { + id: answers.id as string, + }, + data: { + allowExternalMembers: cleanedData.allowExternalMembers, + createChildCascadeAdmins: cleanedData.createChildCascadeAdmins, + createChildCascadeMembers: cleanedData.createChildCascadeMembers, + createChildCascadeOwners: cleanedData.createChildCascadeOwners, + createdBy: cleanedData.createdBy, + deleteMemberCascadeChildren: cleanedData.deleteMemberCascadeChildren, + entityId: cleanedData.entityId, + inviteProfileAssignmentMode: cleanedData.inviteProfileAssignmentMode, + limitAllocationMode: cleanedData.limitAllocationMode, + populateMemberEmail: cleanedData.populateMemberEmail, + updatedBy: cleanedData.updatedBy, + }, + select: { + allowExternalMembers: true, + createChildCascadeAdmins: true, + createChildCascadeMembers: true, + createChildCascadeOwners: true, + createdAt: true, + createdBy: true, + deleteMemberCascadeChildren: true, + entityId: true, + id: true, + inviteProfileAssignmentMode: true, + limitAllocationMode: true, + populateMemberEmail: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -398,28 +460,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgMembershipSetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgMembershipSetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-membership.ts b/sdk/constructive-cli/src/admin/cli/commands/org-membership.ts index a03cb1e14e..930f805b1a 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-membership.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-membership.ts @@ -3,66 +3,80 @@ * @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 { CreateOrgMembershipInput, OrgMembershipPatch, OrgMembershipSelect, OrgMembershipFilter, OrgMembershipOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgMembershipInput, + OrgMembershipPatch, + OrgMembershipSelect, + OrgMembershipFilter, + OrgMembershipOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - createdBy: "uuid", - entityId: "uuid", - granted: "string", - id: "uuid", - isActive: "boolean", - isAdmin: "boolean", - isApproved: "boolean", - isBanned: "boolean", - isDisabled: "boolean", - isExternal: "boolean", - isOwner: "boolean", - isReadOnly: "boolean", - permissions: "string", - profileId: "uuid", - updatedAt: "string", - updatedBy: "uuid" + actorId: 'uuid', + createdAt: 'string', + createdBy: 'uuid', + entityId: 'uuid', + granted: 'string', + id: 'uuid', + isActive: 'boolean', + isAdmin: 'boolean', + isApproved: 'boolean', + isBanned: 'boolean', + isDisabled: 'boolean', + isExternal: 'boolean', + isOwner: 'boolean', + isReadOnly: 'boolean', + permissions: 'string', + profileId: 'uuid', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\norg-membership \n\nCommands:\n list List orgMembership records\n find-first Find first matching orgMembership record\n get Get a orgMembership by ID\n create Create a new orgMembership\n update Update an existing orgMembership\n delete Delete a orgMembership\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) => { +const usage = + '\norg-membership \n\nCommands:\n list List orgMembership records\n find-first Find first matching orgMembership record\n get Get a orgMembership by ID\n create Create a new orgMembership\n update Update an existing orgMembership\n delete Delete a orgMembership\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -89,16 +103,18 @@ async function handleList(argv: Partial>, _prompter: Inq permissions: true, profileId: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgMembershipSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgMembershipSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMembership.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -125,16 +141,18 @@ async function handleFindFirst(argv: Partial>, _prompter permissions: true, profileId: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgMembershipSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgMembershipSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgMembership.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -143,39 +161,43 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgMembership.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - createdBy: true, - entityId: true, - granted: true, - id: true, - isActive: true, - isAdmin: true, - isApproved: true, - isBanned: true, - isDisabled: true, - isExternal: true, - isOwner: true, - isReadOnly: true, - permissions: true, - profileId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembership + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + createdBy: true, + entityId: true, + granted: true, + id: true, + isActive: true, + isAdmin: true, + isApproved: true, + isBanned: true, + isDisabled: true, + isExternal: true, + isOwner: true, + isReadOnly: true, + permissions: true, + profileId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -184,140 +206,161 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "granted", - message: "granted", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isAdmin", - message: "isAdmin", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isApproved", - message: "isApproved", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isBanned", - message: "isBanned", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDisabled", - message: "isDisabled", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isExternal", - message: "isExternal", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isOwner", - message: "isOwner", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isReadOnly", - message: "isReadOnly", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileId", - message: "profileId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'granted', + message: 'granted', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isAdmin', + message: 'isAdmin', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isApproved', + message: 'isApproved', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBanned', + message: 'isBanned', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDisabled', + message: 'isDisabled', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isExternal', + message: 'isExternal', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isOwner', + message: 'isOwner', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileId', + message: 'profileId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgMembershipInput["orgMembership"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgMembershipInput['orgMembership']; const client = getClient(); - const result = await client.orgMembership.create({ - data: { - actorId: cleanedData.actorId, - createdBy: cleanedData.createdBy, - entityId: cleanedData.entityId, - granted: cleanedData.granted, - isActive: cleanedData.isActive, - isAdmin: cleanedData.isAdmin, - isApproved: cleanedData.isApproved, - isBanned: cleanedData.isBanned, - isDisabled: cleanedData.isDisabled, - isExternal: cleanedData.isExternal, - isOwner: cleanedData.isOwner, - isReadOnly: cleanedData.isReadOnly, - permissions: cleanedData.permissions, - profileId: cleanedData.profileId, - updatedBy: cleanedData.updatedBy - }, - select: { - actorId: true, - createdAt: true, - createdBy: true, - entityId: true, - granted: true, - id: true, - isActive: true, - isAdmin: true, - isApproved: true, - isBanned: true, - isDisabled: true, - isExternal: true, - isOwner: true, - isReadOnly: true, - permissions: true, - profileId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembership + .create({ + data: { + actorId: cleanedData.actorId, + createdBy: cleanedData.createdBy, + entityId: cleanedData.entityId, + granted: cleanedData.granted, + isActive: cleanedData.isActive, + isAdmin: cleanedData.isAdmin, + isApproved: cleanedData.isApproved, + isBanned: cleanedData.isBanned, + isDisabled: cleanedData.isDisabled, + isExternal: cleanedData.isExternal, + isOwner: cleanedData.isOwner, + isReadOnly: cleanedData.isReadOnly, + permissions: cleanedData.permissions, + profileId: cleanedData.profileId, + updatedBy: cleanedData.updatedBy, + }, + select: { + actorId: true, + createdAt: true, + createdBy: true, + entityId: true, + granted: true, + id: true, + isActive: true, + isAdmin: true, + isApproved: true, + isBanned: true, + isDisabled: true, + isExternal: true, + isOwner: true, + isReadOnly: true, + permissions: true, + profileId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -326,148 +369,167 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "granted", - message: "granted", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isAdmin", - message: "isAdmin", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isApproved", - message: "isApproved", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isBanned", - message: "isBanned", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDisabled", - message: "isDisabled", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isExternal", - message: "isExternal", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isOwner", - message: "isOwner", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isReadOnly", - message: "isReadOnly", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileId", - message: "profileId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'granted', + message: 'granted', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isAdmin', + message: 'isAdmin', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isApproved', + message: 'isApproved', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBanned', + message: 'isBanned', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDisabled', + message: 'isDisabled', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isExternal', + message: 'isExternal', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isOwner', + message: 'isOwner', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileId', + message: 'profileId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgMembershipPatch; const client = getClient(); - const result = await client.orgMembership.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - createdBy: cleanedData.createdBy, - entityId: cleanedData.entityId, - granted: cleanedData.granted, - isActive: cleanedData.isActive, - isAdmin: cleanedData.isAdmin, - isApproved: cleanedData.isApproved, - isBanned: cleanedData.isBanned, - isDisabled: cleanedData.isDisabled, - isExternal: cleanedData.isExternal, - isOwner: cleanedData.isOwner, - isReadOnly: cleanedData.isReadOnly, - permissions: cleanedData.permissions, - profileId: cleanedData.profileId, - updatedBy: cleanedData.updatedBy - }, - select: { - actorId: true, - createdAt: true, - createdBy: true, - entityId: true, - granted: true, - id: true, - isActive: true, - isAdmin: true, - isApproved: true, - isBanned: true, - isDisabled: true, - isExternal: true, - isOwner: true, - isReadOnly: true, - permissions: true, - profileId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.orgMembership + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + createdBy: cleanedData.createdBy, + entityId: cleanedData.entityId, + granted: cleanedData.granted, + isActive: cleanedData.isActive, + isAdmin: cleanedData.isAdmin, + isApproved: cleanedData.isApproved, + isBanned: cleanedData.isBanned, + isDisabled: cleanedData.isDisabled, + isExternal: cleanedData.isExternal, + isOwner: cleanedData.isOwner, + isReadOnly: cleanedData.isReadOnly, + permissions: cleanedData.permissions, + profileId: cleanedData.profileId, + updatedBy: cleanedData.updatedBy, + }, + select: { + actorId: true, + createdAt: true, + createdBy: true, + entityId: true, + granted: true, + id: true, + isActive: true, + isAdmin: true, + isApproved: true, + isBanned: true, + isDisabled: true, + isExternal: true, + isOwner: true, + isReadOnly: true, + permissions: true, + profileId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -476,28 +538,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgMembership.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgMembership + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-owner-grant.ts b/sdk/constructive-cli/src/admin/cli/commands/org-owner-grant.ts index 6396311115..3fb4d859ca 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-owner-grant.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-owner-grant.ts @@ -3,55 +3,69 @@ * @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 { CreateOrgOwnerGrantInput, OrgOwnerGrantPatch, OrgOwnerGrantSelect, OrgOwnerGrantFilter, OrgOwnerGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgOwnerGrantInput, + OrgOwnerGrantPatch, + OrgOwnerGrantSelect, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - entityId: "uuid", - grantorId: "uuid", - id: "uuid", - isGrant: "boolean", - updatedAt: "string" + actorId: 'uuid', + createdAt: 'string', + entityId: 'uuid', + grantorId: 'uuid', + id: 'uuid', + isGrant: 'boolean', + updatedAt: 'string', }; -const usage = "\norg-owner-grant \n\nCommands:\n list List orgOwnerGrant records\n find-first Find first matching orgOwnerGrant record\n get Get a orgOwnerGrant by ID\n create Create a new orgOwnerGrant\n update Update an existing orgOwnerGrant\n delete Delete a orgOwnerGrant\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) => { +const usage = + '\norg-owner-grant \n\nCommands:\n list List orgOwnerGrant records\n find-first Find first matching orgOwnerGrant record\n get Get a orgOwnerGrant by ID\n create Create a new orgOwnerGrant\n update Update an existing orgOwnerGrant\n delete Delete a orgOwnerGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq grantorId: true, id: true, isGrant: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgOwnerGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgOwnerGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgOwnerGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter grantorId: true, id: true, isGrant: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgOwnerGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgOwnerGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgOwnerGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgOwnerGrant.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.orgOwnerGrant + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,53 +162,63 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgOwnerGrantInput["orgOwnerGrant"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgOwnerGrantInput['orgOwnerGrant']; const client = getClient(); - const result = await client.orgOwnerGrant.create({ - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant - }, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.orgOwnerGrant + .create({ + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + }, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -195,61 +227,69 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgOwnerGrantPatch; const client = getClient(); - const result = await client.orgOwnerGrant.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant - }, - select: { - actorId: true, - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - updatedAt: true - } - }).execute(); + const result = await client.orgOwnerGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + }, + select: { + actorId: true, + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -258,28 +298,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgOwnerGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgOwnerGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-permission-default-grant.ts b/sdk/constructive-cli/src/admin/cli/commands/org-permission-default-grant.ts index 00cb6148a9..179b90d112 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-permission-default-grant.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-permission-default-grant.ts @@ -3,55 +3,69 @@ * @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 { CreateOrgPermissionDefaultGrantInput, OrgPermissionDefaultGrantPatch, OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantFilter, OrgPermissionDefaultGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgPermissionDefaultGrantInput, + OrgPermissionDefaultGrantPatch, + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - entityId: "uuid", - grantorId: "uuid", - id: "uuid", - isGrant: "boolean", - permissionId: "uuid", - updatedAt: "string" + createdAt: 'string', + entityId: 'uuid', + grantorId: 'uuid', + id: 'uuid', + isGrant: 'boolean', + permissionId: 'uuid', + updatedAt: 'string', }; -const usage = "\norg-permission-default-grant \n\nCommands:\n list List orgPermissionDefaultGrant records\n find-first Find first matching orgPermissionDefaultGrant record\n get Get a orgPermissionDefaultGrant by ID\n create Create a new orgPermissionDefaultGrant\n update Update an existing orgPermissionDefaultGrant\n delete Delete a orgPermissionDefaultGrant\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) => { +const usage = + '\norg-permission-default-grant \n\nCommands:\n list List orgPermissionDefaultGrant records\n find-first Find first matching orgPermissionDefaultGrant record\n get Get a orgPermissionDefaultGrant by ID\n create Create a new orgPermissionDefaultGrant\n update Update an existing orgPermissionDefaultGrant\n delete Delete a orgPermissionDefaultGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, isGrant: true, permissionId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgPermissionDefaultGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy + > & { + select: OrgPermissionDefaultGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgPermissionDefaultGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, isGrant: true, permissionId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgPermissionDefaultGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy + > & { + select: OrgPermissionDefaultGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgPermissionDefaultGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgPermissionDefaultGrant.findOne({ - id: answers.id as string, - select: { - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgPermissionDefaultGrant + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,52 +170,62 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionId", - message: "permissionId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionId', + message: 'permissionId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgPermissionDefaultGrantInput["orgPermissionDefaultGrant"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgPermissionDefaultGrantInput['orgPermissionDefaultGrant']; const client = getClient(); - const result = await client.orgPermissionDefaultGrant.create({ - data: { - entityId: cleanedData.entityId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant, - permissionId: cleanedData.permissionId - }, - select: { - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgPermissionDefaultGrant + .create({ + data: { + entityId: cleanedData.entityId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + permissionId: cleanedData.permissionId, + }, + select: { + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -194,60 +234,68 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "grantorId", - message: "grantorId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionId", - message: "permissionId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'grantorId', + message: 'grantorId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionId', + message: 'permissionId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgPermissionDefaultGrantPatch; const client = getClient(); - const result = await client.orgPermissionDefaultGrant.update({ - where: { - id: answers.id as string - }, - data: { - entityId: cleanedData.entityId, - grantorId: cleanedData.grantorId, - isGrant: cleanedData.isGrant, - permissionId: cleanedData.permissionId - }, - select: { - createdAt: true, - entityId: true, - grantorId: true, - id: true, - isGrant: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgPermissionDefaultGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + entityId: cleanedData.entityId, + grantorId: cleanedData.grantorId, + isGrant: cleanedData.isGrant, + permissionId: cleanedData.permissionId, + }, + select: { + createdAt: true, + entityId: true, + grantorId: true, + id: true, + isGrant: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -256,28 +304,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgPermissionDefaultGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgPermissionDefaultGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-permission-default-permission.ts b/sdk/constructive-cli/src/admin/cli/commands/org-permission-default-permission.ts index 75b4474008..0b1653abf0 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-permission-default-permission.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-permission-default-permission.ts @@ -3,53 +3,67 @@ * @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 { CreateOrgPermissionDefaultPermissionInput, OrgPermissionDefaultPermissionPatch, OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionFilter, OrgPermissionDefaultPermissionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgPermissionDefaultPermissionInput, + OrgPermissionDefaultPermissionPatch, + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - entityId: "uuid", - id: "uuid", - permissionId: "uuid", - updatedAt: "string" + createdAt: 'string', + entityId: 'uuid', + id: 'uuid', + permissionId: 'uuid', + updatedAt: 'string', }; -const usage = "\norg-permission-default-permission \n\nCommands:\n list List orgPermissionDefaultPermission records\n find-first Find first matching orgPermissionDefaultPermission record\n get Get a orgPermissionDefaultPermission by ID\n create Create a new orgPermissionDefaultPermission\n update Update an existing orgPermissionDefaultPermission\n delete Delete a orgPermissionDefaultPermission\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) => { +const usage = + '\norg-permission-default-permission \n\nCommands:\n list List orgPermissionDefaultPermission records\n find-first Find first matching orgPermissionDefaultPermission record\n get Get a orgPermissionDefaultPermission by ID\n create Create a new orgPermissionDefaultPermission\n update Update an existing orgPermissionDefaultPermission\n delete Delete a orgPermissionDefaultPermission\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq entityId: true, id: true, permissionId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgPermissionDefaultPermissionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + > & { + select: OrgPermissionDefaultPermissionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgPermissionDefaultPermission.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter entityId: true, id: true, permissionId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgPermissionDefaultPermissionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + > & { + select: OrgPermissionDefaultPermissionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgPermissionDefaultPermission.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgPermissionDefaultPermission.findOne({ - id: answers.id as string, - select: { - createdAt: true, - entityId: true, - id: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgPermissionDefaultPermission + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + entityId: true, + id: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,36 +162,44 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "permissionId", - message: "permissionId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'permissionId', + message: 'permissionId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgPermissionDefaultPermissionInput["orgPermissionDefaultPermission"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgPermissionDefaultPermissionInput['orgPermissionDefaultPermission']; const client = getClient(); - const result = await client.orgPermissionDefaultPermission.create({ - data: { - entityId: cleanedData.entityId, - permissionId: cleanedData.permissionId - }, - select: { - createdAt: true, - entityId: true, - id: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgPermissionDefaultPermission + .create({ + data: { + entityId: cleanedData.entityId, + permissionId: cleanedData.permissionId, + }, + select: { + createdAt: true, + entityId: true, + id: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -170,44 +208,50 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "permissionId", - message: "permissionId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'permissionId', + message: 'permissionId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgPermissionDefaultPermissionPatch; const client = getClient(); - const result = await client.orgPermissionDefaultPermission.update({ - where: { - id: answers.id as string - }, - data: { - entityId: cleanedData.entityId, - permissionId: cleanedData.permissionId - }, - select: { - createdAt: true, - entityId: true, - id: true, - permissionId: true, - updatedAt: true - } - }).execute(); + const result = await client.orgPermissionDefaultPermission + .update({ + where: { + id: answers.id as string, + }, + data: { + entityId: cleanedData.entityId, + permissionId: cleanedData.permissionId, + }, + select: { + createdAt: true, + entityId: true, + id: true, + permissionId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -216,28 +260,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgPermissionDefaultPermission.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgPermissionDefaultPermission + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-permission-default.ts b/sdk/constructive-cli/src/admin/cli/commands/org-permission-default.ts index 3cd5a4ecca..b0856d28e3 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-permission-default.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-permission-default.ts @@ -3,51 +3,65 @@ * @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 { CreateOrgPermissionDefaultInput, OrgPermissionDefaultPatch, OrgPermissionDefaultSelect, OrgPermissionDefaultFilter, OrgPermissionDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgPermissionDefaultInput, + OrgPermissionDefaultPatch, + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - entityId: "uuid", - id: "uuid", - permissions: "string" + entityId: 'uuid', + id: 'uuid', + permissions: 'string', }; -const usage = "\norg-permission-default \n\nCommands:\n list List orgPermissionDefault records\n find-first Find first matching orgPermissionDefault record\n get Get a orgPermissionDefault by ID\n create Create a new orgPermissionDefault\n update Update an existing orgPermissionDefault\n delete Delete a orgPermissionDefault\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) => { +const usage = + '\norg-permission-default \n\nCommands:\n list List orgPermissionDefault records\n find-first Find first matching orgPermissionDefault record\n get Get a orgPermissionDefault by ID\n create Create a new orgPermissionDefault\n update Update an existing orgPermissionDefault\n delete Delete a orgPermissionDefault\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -59,16 +73,22 @@ async function handleList(argv: Partial>, _prompter: Inq const defaultSelect = { entityId: true, id: true, - permissions: true + permissions: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgPermissionDefaultSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy + > & { + select: OrgPermissionDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgPermissionDefault.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -80,16 +100,22 @@ async function handleFindFirst(argv: Partial>, _prompter const defaultSelect = { entityId: true, id: true, - permissions: true + permissions: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgPermissionDefaultSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy + > & { + select: OrgPermissionDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgPermissionDefault.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -98,24 +124,28 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgPermissionDefault.findOne({ - id: answers.id as string, - select: { - entityId: true, - id: true, - permissions: true - } - }).execute(); + const result = await client.orgPermissionDefault + .findOne({ + id: answers.id as string, + select: { + entityId: true, + id: true, + permissions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -124,35 +154,43 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgPermissionDefaultInput["orgPermissionDefault"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgPermissionDefaultInput['orgPermissionDefault']; const client = getClient(); - const result = await client.orgPermissionDefault.create({ - data: { - entityId: cleanedData.entityId, - permissions: cleanedData.permissions - }, - select: { - entityId: true, - id: true, - permissions: true - } - }).execute(); + const result = await client.orgPermissionDefault + .create({ + data: { + entityId: cleanedData.entityId, + permissions: cleanedData.permissions, + }, + select: { + entityId: true, + id: true, + permissions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -161,43 +199,49 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "permissions", - message: "permissions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'permissions', + message: 'permissions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgPermissionDefaultPatch; const client = getClient(); - const result = await client.orgPermissionDefault.update({ - where: { - id: answers.id as string - }, - data: { - entityId: cleanedData.entityId, - permissions: cleanedData.permissions - }, - select: { - entityId: true, - id: true, - permissions: true - } - }).execute(); + const result = await client.orgPermissionDefault + .update({ + where: { + id: answers.id as string, + }, + data: { + entityId: cleanedData.entityId, + permissions: cleanedData.permissions, + }, + select: { + entityId: true, + id: true, + permissions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -206,28 +250,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgPermissionDefault.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgPermissionDefault + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-permission.ts b/sdk/constructive-cli/src/admin/cli/commands/org-permission.ts index cc97bfab3d..997efa2456 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-permission.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-permission.ts @@ -3,53 +3,67 @@ * @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 { CreateOrgPermissionInput, OrgPermissionPatch, OrgPermissionSelect, OrgPermissionFilter, OrgPermissionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgPermissionInput, + OrgPermissionPatch, + OrgPermissionSelect, + OrgPermissionFilter, + OrgPermissionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - bitnum: "int", - bitstr: "string", - description: "string", - id: "uuid", - name: "string" + bitnum: 'int', + bitstr: 'string', + description: 'string', + id: 'uuid', + name: 'string', }; -const usage = "\norg-permission \n\nCommands:\n list List orgPermission records\n find-first Find first matching orgPermission record\n get Get a orgPermission by ID\n create Create a new orgPermission\n update Update an existing orgPermission\n delete Delete a orgPermission\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) => { +const usage = + '\norg-permission \n\nCommands:\n list List orgPermission records\n find-first Find first matching orgPermission record\n get Get a orgPermission by ID\n create Create a new orgPermission\n update Update an existing orgPermission\n delete Delete a orgPermission\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq bitstr: true, description: true, id: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgPermissionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgPermissionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgPermission.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter bitstr: true, description: true, id: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgPermissionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgPermissionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgPermission.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgPermission.findOne({ - id: answers.id as string, - select: { - bitnum: true, - bitstr: true, - description: true, - id: true, - name: true - } - }).execute(); + const result = await client.orgPermission + .findOne({ + id: answers.id as string, + select: { + bitnum: true, + bitstr: true, + description: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,52 +154,62 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "bitnum", - message: "bitnum", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bitstr", - message: "bitstr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'bitnum', + message: 'bitnum', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bitstr', + message: 'bitstr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgPermissionInput["orgPermission"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgPermissionInput['orgPermission']; const client = getClient(); - const result = await client.orgPermission.create({ - data: { - bitnum: cleanedData.bitnum, - bitstr: cleanedData.bitstr, - description: cleanedData.description, - name: cleanedData.name - }, - select: { - bitnum: true, - bitstr: true, - description: true, - id: true, - name: true - } - }).execute(); + const result = await client.orgPermission + .create({ + data: { + bitnum: cleanedData.bitnum, + bitstr: cleanedData.bitstr, + description: cleanedData.description, + name: cleanedData.name, + }, + select: { + bitnum: true, + bitstr: true, + description: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -186,60 +218,68 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "bitnum", - message: "bitnum", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bitstr", - message: "bitstr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'bitnum', + message: 'bitnum', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bitstr', + message: 'bitstr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgPermissionPatch; const client = getClient(); - const result = await client.orgPermission.update({ - where: { - id: answers.id as string - }, - data: { - bitnum: cleanedData.bitnum, - bitstr: cleanedData.bitstr, - description: cleanedData.description, - name: cleanedData.name - }, - select: { - bitnum: true, - bitstr: true, - description: true, - id: true, - name: true - } - }).execute(); + const result = await client.orgPermission + .update({ + where: { + id: answers.id as string, + }, + data: { + bitnum: cleanedData.bitnum, + bitstr: cleanedData.bitstr, + description: cleanedData.description, + name: cleanedData.name, + }, + select: { + bitnum: true, + bitstr: true, + description: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -248,28 +288,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgPermission.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgPermission + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-by-mask.ts b/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-by-mask.ts index b2695df1fa..c91c50e552 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-by-mask.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-by-mask.ts @@ -3,47 +3,64 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { buildSelectFromPaths } from "../utils"; -import type { OrgPermissionsGetByMaskVariables } from "../../orm/query"; -import type { OrgPermissionConnectionSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { buildSelectFromPaths } from '../utils'; +import type { OrgPermissionsGetByMaskVariables } from '../../orm/query'; +import type { OrgPermissionConnectionSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("org-permissions-get-by-mask - Reads and enables pagination through a set of `OrgPermission`.\n\nUsage: org-permissions-get-by-mask [OPTIONS]\n"); + console.log( + 'org-permissions-get-by-mask - Reads and enables pagination through a set of `OrgPermission`.\n\nUsage: org-permissions-get-by-mask [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "after", - message: "Read all values in the set after (below) this cursor." - }, { - type: "text", - name: "first", - message: "Only read the first `n` values of the set." - }, { - type: "text", - name: "mask", - message: "mask" - }, { - type: "text", - name: "offset", - message: "Skip the first `n` values from our `after` cursor, an alternative to cursor\nbased pagination. May not be used with `last`." - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'after', + message: 'Read all values in the set after (below) this cursor.', + }, + { + type: 'text', + name: 'first', + message: 'Only read the first `n` values of the set.', + }, + { + type: 'text', + name: 'mask', + message: 'mask', + }, + { + type: 'text', + name: 'offset', + message: + 'Skip the first `n` values from our `after` cursor, an alternative to cursor\nbased pagination. May not be used with `last`.', + }, + ]); const client = getClient(); - const selectFields = buildSelectFromPaths(argv.select as string ?? ""); - const result = await client.query.orgPermissionsGetByMask(answers as unknown as OrgPermissionsGetByMaskVariables, { - select: selectFields - } as unknown as { - select: OrgPermissionConnectionSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? ''); + const result = await client.query + .orgPermissionsGetByMask( + answers as unknown as OrgPermissionsGetByMaskVariables, + { + select: selectFields, + } as unknown as { + select: OrgPermissionConnectionSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: orgPermissionsGetByMask"); + console.error('Failed: orgPermissionsGetByMask'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-mask-by-names.ts b/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-mask-by-names.ts index 84835e3cea..643b680962 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-mask-by-names.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-mask-by-names.ts @@ -3,28 +3,38 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { OrgPermissionsGetMaskByNamesVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { OrgPermissionsGetMaskByNamesVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("org-permissions-get-mask-by-names - orgPermissionsGetMaskByNames\n\nUsage: org-permissions-get-mask-by-names [OPTIONS]\n"); + console.log( + 'org-permissions-get-mask-by-names - orgPermissionsGetMaskByNames\n\nUsage: org-permissions-get-mask-by-names [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "names", - message: "names" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'names', + message: 'names', + }, + ]); const client = getClient(); - const result = await client.query.orgPermissionsGetMaskByNames(answers as unknown as OrgPermissionsGetMaskByNamesVariables).execute(); + const result = await client.query + .orgPermissionsGetMaskByNames(answers as unknown as OrgPermissionsGetMaskByNamesVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: orgPermissionsGetMaskByNames"); + console.error('Failed: orgPermissionsGetMaskByNames'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-mask.ts b/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-mask.ts index 29b52e66ef..7045bd2006 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-mask.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-mask.ts @@ -3,28 +3,38 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { OrgPermissionsGetMaskVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { OrgPermissionsGetMaskVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("org-permissions-get-mask - orgPermissionsGetMask\n\nUsage: org-permissions-get-mask [OPTIONS]\n"); + console.log( + 'org-permissions-get-mask - orgPermissionsGetMask\n\nUsage: org-permissions-get-mask [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "ids", - message: "ids" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'ids', + message: 'ids', + }, + ]); const client = getClient(); - const result = await client.query.orgPermissionsGetMask(answers as unknown as OrgPermissionsGetMaskVariables).execute(); + const result = await client.query + .orgPermissionsGetMask(answers as unknown as OrgPermissionsGetMaskVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: orgPermissionsGetMask"); + console.error('Failed: orgPermissionsGetMask'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-padded-mask.ts b/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-padded-mask.ts index e82818d028..1963857d28 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-padded-mask.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/org-permissions-get-padded-mask.ts @@ -3,28 +3,38 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { OrgPermissionsGetPaddedMaskVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { OrgPermissionsGetPaddedMaskVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("org-permissions-get-padded-mask - orgPermissionsGetPaddedMask\n\nUsage: org-permissions-get-padded-mask [OPTIONS]\n"); + console.log( + 'org-permissions-get-padded-mask - orgPermissionsGetPaddedMask\n\nUsage: org-permissions-get-padded-mask [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "mask", - message: "mask" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'mask', + message: 'mask', + }, + ]); const client = getClient(); - const result = await client.query.orgPermissionsGetPaddedMask(answers as unknown as OrgPermissionsGetPaddedMaskVariables).execute(); + const result = await client.query + .orgPermissionsGetPaddedMask(answers as unknown as OrgPermissionsGetPaddedMaskVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: orgPermissionsGetPaddedMask"); + console.error('Failed: orgPermissionsGetPaddedMask'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/admin/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/submit-app-invite-code.ts b/sdk/constructive-cli/src/admin/cli/commands/submit-app-invite-code.ts index 3ebe64c98d..0a28b6a1c4 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/submit-app-invite-code.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/submit-app-invite-code.ts @@ -3,37 +3,51 @@ * @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 { SubmitAppInviteCodeVariables } from "../../orm/mutation"; -import type { SubmitAppInviteCodePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SubmitAppInviteCodeVariables } from '../../orm/mutation'; +import type { SubmitAppInviteCodePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("submit-app-invite-code - submitAppInviteCode\n\nUsage: submit-app-invite-code [OPTIONS]\n"); + console.log( + 'submit-app-invite-code - submitAppInviteCode\n\nUsage: submit-app-invite-code [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 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.submitAppInviteCode(parsedAnswers as unknown as SubmitAppInviteCodeVariables, { - select: selectFields - } as unknown as { - select: SubmitAppInviteCodePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .submitAppInviteCode( + parsedAnswers as unknown as SubmitAppInviteCodeVariables, + { + select: selectFields, + } as unknown as { + select: SubmitAppInviteCodePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: submitAppInviteCode"); + console.error('Failed: submitAppInviteCode'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/commands/submit-org-invite-code.ts b/sdk/constructive-cli/src/admin/cli/commands/submit-org-invite-code.ts index 8aa9e52d5a..57f7a5768d 100644 --- a/sdk/constructive-cli/src/admin/cli/commands/submit-org-invite-code.ts +++ b/sdk/constructive-cli/src/admin/cli/commands/submit-org-invite-code.ts @@ -3,37 +3,51 @@ * @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 { SubmitOrgInviteCodeVariables } from "../../orm/mutation"; -import type { SubmitOrgInviteCodePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SubmitOrgInviteCodeVariables } from '../../orm/mutation'; +import type { SubmitOrgInviteCodePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("submit-org-invite-code - submitOrgInviteCode\n\nUsage: submit-org-invite-code [OPTIONS]\n"); + console.log( + 'submit-org-invite-code - submitOrgInviteCode\n\nUsage: submit-org-invite-code [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 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.submitOrgInviteCode(parsedAnswers as unknown as SubmitOrgInviteCodeVariables, { - select: selectFields - } as unknown as { - select: SubmitOrgInviteCodePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .submitOrgInviteCode( + parsedAnswers as unknown as SubmitOrgInviteCodeVariables, + { + select: selectFields, + } as unknown as { + select: SubmitOrgInviteCodePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: submitOrgInviteCode"); + console.error('Failed: submitOrgInviteCode'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/cli/executor.ts b/sdk/constructive-cli/src/admin/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/admin/cli/executor.ts +++ b/sdk/constructive-cli/src/admin/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/cli/index.ts b/sdk/constructive-cli/src/admin/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/admin/cli/index.ts +++ b/sdk/constructive-cli/src/admin/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/admin/cli/utils.ts b/sdk/constructive-cli/src/admin/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/admin/cli/utils.ts +++ b/sdk/constructive-cli/src/admin/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/admin/index.ts b/sdk/constructive-cli/src/admin/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/admin/index.ts +++ b/sdk/constructive-cli/src/admin/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/admin/orm/client.ts b/sdk/constructive-cli/src/admin/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/admin/orm/client.ts +++ b/sdk/constructive-cli/src/admin/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/admin/orm/index.ts b/sdk/constructive-cli/src/admin/orm/index.ts index 80f72b6711..05c2d70038 100644 --- a/sdk/constructive-cli/src/admin/orm/index.ts +++ b/sdk/constructive-cli/src/admin/orm/index.ts @@ -3,43 +3,43 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AppAdminGrantModel } from "./models/appAdminGrant"; -import { AppClaimedInviteModel } from "./models/appClaimedInvite"; -import { AppGrantModel } from "./models/appGrant"; -import { AppInviteModel } from "./models/appInvite"; -import { AppMembershipModel } from "./models/appMembership"; -import { AppMembershipDefaultModel } from "./models/appMembershipDefault"; -import { AppOwnerGrantModel } from "./models/appOwnerGrant"; -import { AppPermissionModel } from "./models/appPermission"; -import { AppPermissionDefaultModel } from "./models/appPermissionDefault"; -import { AppPermissionDefaultGrantModel } from "./models/appPermissionDefaultGrant"; -import { AppPermissionDefaultPermissionModel } from "./models/appPermissionDefaultPermission"; -import { MembershipTypeModel } from "./models/membershipType"; -import { OrgAdminGrantModel } from "./models/orgAdminGrant"; -import { OrgClaimedInviteModel } from "./models/orgClaimedInvite"; -import { OrgGrantModel } from "./models/orgGrant"; -import { OrgInviteModel } from "./models/orgInvite"; -import { OrgMemberModel } from "./models/orgMember"; -import { OrgMemberProfileModel } from "./models/orgMemberProfile"; -import { OrgMembershipModel } from "./models/orgMembership"; -import { OrgMembershipDefaultModel } from "./models/orgMembershipDefault"; -import { OrgMembershipSettingModel } from "./models/orgMembershipSetting"; -import { OrgOwnerGrantModel } from "./models/orgOwnerGrant"; -import { OrgPermissionModel } from "./models/orgPermission"; -import { OrgPermissionDefaultModel } from "./models/orgPermissionDefault"; -import { OrgPermissionDefaultGrantModel } from "./models/orgPermissionDefaultGrant"; -import { OrgPermissionDefaultPermissionModel } from "./models/orgPermissionDefaultPermission"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AppAdminGrantModel } from './models/appAdminGrant'; +import { AppClaimedInviteModel } from './models/appClaimedInvite'; +import { AppGrantModel } from './models/appGrant'; +import { AppInviteModel } from './models/appInvite'; +import { AppMembershipModel } from './models/appMembership'; +import { AppMembershipDefaultModel } from './models/appMembershipDefault'; +import { AppOwnerGrantModel } from './models/appOwnerGrant'; +import { AppPermissionModel } from './models/appPermission'; +import { AppPermissionDefaultModel } from './models/appPermissionDefault'; +import { AppPermissionDefaultGrantModel } from './models/appPermissionDefaultGrant'; +import { AppPermissionDefaultPermissionModel } from './models/appPermissionDefaultPermission'; +import { MembershipTypeModel } from './models/membershipType'; +import { OrgAdminGrantModel } from './models/orgAdminGrant'; +import { OrgClaimedInviteModel } from './models/orgClaimedInvite'; +import { OrgGrantModel } from './models/orgGrant'; +import { OrgInviteModel } from './models/orgInvite'; +import { OrgMemberModel } from './models/orgMember'; +import { OrgMemberProfileModel } from './models/orgMemberProfile'; +import { OrgMembershipModel } from './models/orgMembership'; +import { OrgMembershipDefaultModel } from './models/orgMembershipDefault'; +import { OrgMembershipSettingModel } from './models/orgMembershipSetting'; +import { OrgOwnerGrantModel } from './models/orgOwnerGrant'; +import { OrgPermissionModel } from './models/orgPermission'; +import { OrgPermissionDefaultModel } from './models/orgPermissionDefault'; +import { OrgPermissionDefaultGrantModel } from './models/orgPermissionDefaultGrant'; +import { OrgPermissionDefaultPermissionModel } from './models/orgPermissionDefaultPermission'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -93,6 +93,6 @@ export function createClient(config: OrmClientConfig) { orgPermissionDefaultGrant: new OrgPermissionDefaultGrantModel(client), orgPermissionDefaultPermission: new OrgPermissionDefaultPermissionModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/input-types.ts b/sdk/constructive-cli/src/admin/orm/input-types.ts index 55d15ac97d..b6b48b9b04 100644 --- a/sdk/constructive-cli/src/admin/orm/input-types.ts +++ b/sdk/constructive-cli/src/admin/orm/input-types.ts @@ -702,12 +702,16 @@ export type AppClaimedInviteWithRelations = AppClaimedInvite & AppClaimedInviteR export type AppGrantWithRelations = AppGrant & AppGrantRelations; export type AppInviteWithRelations = AppInvite & AppInviteRelations; export type AppMembershipWithRelations = AppMembership & AppMembershipRelations; -export type AppMembershipDefaultWithRelations = AppMembershipDefault & AppMembershipDefaultRelations; +export type AppMembershipDefaultWithRelations = AppMembershipDefault & + AppMembershipDefaultRelations; export type AppOwnerGrantWithRelations = AppOwnerGrant & AppOwnerGrantRelations; export type AppPermissionWithRelations = AppPermission & AppPermissionRelations; -export type AppPermissionDefaultWithRelations = AppPermissionDefault & AppPermissionDefaultRelations; -export type AppPermissionDefaultGrantWithRelations = AppPermissionDefaultGrant & AppPermissionDefaultGrantRelations; -export type AppPermissionDefaultPermissionWithRelations = AppPermissionDefaultPermission & AppPermissionDefaultPermissionRelations; +export type AppPermissionDefaultWithRelations = AppPermissionDefault & + AppPermissionDefaultRelations; +export type AppPermissionDefaultGrantWithRelations = AppPermissionDefaultGrant & + AppPermissionDefaultGrantRelations; +export type AppPermissionDefaultPermissionWithRelations = AppPermissionDefaultPermission & + AppPermissionDefaultPermissionRelations; export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type OrgAdminGrantWithRelations = OrgAdminGrant & OrgAdminGrantRelations; export type OrgClaimedInviteWithRelations = OrgClaimedInvite & OrgClaimedInviteRelations; @@ -716,13 +720,18 @@ export type OrgInviteWithRelations = OrgInvite & OrgInviteRelations; export type OrgMemberWithRelations = OrgMember & OrgMemberRelations; export type OrgMemberProfileWithRelations = OrgMemberProfile & OrgMemberProfileRelations; export type OrgMembershipWithRelations = OrgMembership & OrgMembershipRelations; -export type OrgMembershipDefaultWithRelations = OrgMembershipDefault & OrgMembershipDefaultRelations; -export type OrgMembershipSettingWithRelations = OrgMembershipSetting & OrgMembershipSettingRelations; +export type OrgMembershipDefaultWithRelations = OrgMembershipDefault & + OrgMembershipDefaultRelations; +export type OrgMembershipSettingWithRelations = OrgMembershipSetting & + OrgMembershipSettingRelations; export type OrgOwnerGrantWithRelations = OrgOwnerGrant & OrgOwnerGrantRelations; export type OrgPermissionWithRelations = OrgPermission & OrgPermissionRelations; -export type OrgPermissionDefaultWithRelations = OrgPermissionDefault & OrgPermissionDefaultRelations; -export type OrgPermissionDefaultGrantWithRelations = OrgPermissionDefaultGrant & OrgPermissionDefaultGrantRelations; -export type OrgPermissionDefaultPermissionWithRelations = OrgPermissionDefaultPermission & OrgPermissionDefaultPermissionRelations; +export type OrgPermissionDefaultWithRelations = OrgPermissionDefault & + OrgPermissionDefaultRelations; +export type OrgPermissionDefaultGrantWithRelations = OrgPermissionDefaultGrant & + OrgPermissionDefaultGrantRelations; +export type OrgPermissionDefaultPermissionWithRelations = OrgPermissionDefaultPermission & + OrgPermissionDefaultPermissionRelations; // ============ Entity Select Types ============ export type AppAdminGrantSelect = { actorId?: boolean; @@ -1668,32 +1677,524 @@ export interface OrgPermissionDefaultPermissionFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type AppAdminGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppClaimedInviteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppInviteOrderBy = "CHANNEL_ASC" | "CHANNEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_COUNT_ASC" | "INVITE_COUNT_DESC" | "INVITE_LIMIT_ASC" | "INVITE_LIMIT_DESC" | "INVITE_TOKEN_ASC" | "INVITE_TOKEN_DESC" | "INVITE_VALID_ASC" | "INVITE_VALID_DESC" | "MULTIPLE_ASC" | "MULTIPLE_DESC" | "NATURAL" | "PHONE_ASC" | "PHONE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppMembershipOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "GRANTED_ASC" | "GRANTED_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_BANNED_ASC" | "IS_BANNED_DESC" | "IS_DISABLED_ASC" | "IS_DISABLED_DESC" | "IS_OWNER_ASC" | "IS_OWNER_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AppMembershipDefaultOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ID_ASC" | "ID_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AppOwnerGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppPermissionOrderBy = "BITNUM_ASC" | "BITNUM_DESC" | "BITSTR_ASC" | "BITSTR_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppPermissionDefaultOrderBy = "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppPermissionDefaultGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppPermissionDefaultPermissionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type MembershipTypeOrderBy = "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "HAS_USERS_TABLE_ENTRY_ASC" | "HAS_USERS_TABLE_ENTRY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARENT_MEMBERSHIP_TYPE_ASC" | "PARENT_MEMBERSHIP_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type OrgAdminGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgClaimedInviteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgInviteOrderBy = "CHANNEL_ASC" | "CHANNEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_COUNT_ASC" | "INVITE_COUNT_DESC" | "INVITE_LIMIT_ASC" | "INVITE_LIMIT_DESC" | "INVITE_TOKEN_ASC" | "INVITE_TOKEN_DESC" | "INVITE_VALID_ASC" | "INVITE_VALID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "MULTIPLE_ASC" | "MULTIPLE_DESC" | "NATURAL" | "PHONE_ASC" | "PHONE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgMemberOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgMemberProfileOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "BIO_ASC" | "BIO_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MEMBERSHIP_ID_ASC" | "MEMBERSHIP_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_PICTURE_ASC" | "PROFILE_PICTURE_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgMembershipOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTED_ASC" | "GRANTED_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_BANNED_ASC" | "IS_BANNED_DESC" | "IS_DISABLED_ASC" | "IS_DISABLED_DESC" | "IS_EXTERNAL_ASC" | "IS_EXTERNAL_DESC" | "IS_OWNER_ASC" | "IS_OWNER_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgMembershipDefaultOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgMembershipSettingOrderBy = "ALLOW_EXTERNAL_MEMBERS_ASC" | "ALLOW_EXTERNAL_MEMBERS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "CREATE_CHILD_CASCADE_ADMINS_ASC" | "CREATE_CHILD_CASCADE_ADMINS_DESC" | "CREATE_CHILD_CASCADE_MEMBERS_ASC" | "CREATE_CHILD_CASCADE_MEMBERS_DESC" | "CREATE_CHILD_CASCADE_OWNERS_ASC" | "CREATE_CHILD_CASCADE_OWNERS_DESC" | "DELETE_MEMBER_CASCADE_CHILDREN_ASC" | "DELETE_MEMBER_CASCADE_CHILDREN_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_PROFILE_ASSIGNMENT_MODE_ASC" | "INVITE_PROFILE_ASSIGNMENT_MODE_DESC" | "LIMIT_ALLOCATION_MODE_ASC" | "LIMIT_ALLOCATION_MODE_DESC" | "NATURAL" | "POPULATE_MEMBER_EMAIL_ASC" | "POPULATE_MEMBER_EMAIL_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgOwnerGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgPermissionOrderBy = "BITNUM_ASC" | "BITNUM_DESC" | "BITSTR_ASC" | "BITSTR_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgPermissionDefaultOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgPermissionDefaultGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgPermissionDefaultPermissionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppAdminGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppClaimedInviteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppInviteOrderBy = + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_COUNT_ASC' + | 'INVITE_COUNT_DESC' + | 'INVITE_LIMIT_ASC' + | 'INVITE_LIMIT_DESC' + | 'INVITE_TOKEN_ASC' + | 'INVITE_TOKEN_DESC' + | 'INVITE_VALID_ASC' + | 'INVITE_VALID_DESC' + | 'MULTIPLE_ASC' + | 'MULTIPLE_DESC' + | 'NATURAL' + | 'PHONE_ASC' + | 'PHONE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppMembershipOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'GRANTED_ASC' + | 'GRANTED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_BANNED_ASC' + | 'IS_BANNED_DESC' + | 'IS_DISABLED_ASC' + | 'IS_DISABLED_DESC' + | 'IS_OWNER_ASC' + | 'IS_OWNER_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AppMembershipDefaultOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AppOwnerGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppPermissionOrderBy = + | 'BITNUM_ASC' + | 'BITNUM_DESC' + | 'BITSTR_ASC' + | 'BITSTR_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppPermissionDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppPermissionDefaultGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppPermissionDefaultPermissionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type MembershipTypeOrderBy = + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARENT_MEMBERSHIP_TYPE_ASC' + | 'PARENT_MEMBERSHIP_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type OrgAdminGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgClaimedInviteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgInviteOrderBy = + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_COUNT_ASC' + | 'INVITE_COUNT_DESC' + | 'INVITE_LIMIT_ASC' + | 'INVITE_LIMIT_DESC' + | 'INVITE_TOKEN_ASC' + | 'INVITE_TOKEN_DESC' + | 'INVITE_VALID_ASC' + | 'INVITE_VALID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'MULTIPLE_ASC' + | 'MULTIPLE_DESC' + | 'NATURAL' + | 'PHONE_ASC' + | 'PHONE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgMemberOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgMemberProfileOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'BIO_ASC' + | 'BIO_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MEMBERSHIP_ID_ASC' + | 'MEMBERSHIP_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_PICTURE_ASC' + | 'PROFILE_PICTURE_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgMembershipOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTED_ASC' + | 'GRANTED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_BANNED_ASC' + | 'IS_BANNED_DESC' + | 'IS_DISABLED_ASC' + | 'IS_DISABLED_DESC' + | 'IS_EXTERNAL_ASC' + | 'IS_EXTERNAL_DESC' + | 'IS_OWNER_ASC' + | 'IS_OWNER_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgMembershipDefaultOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgMembershipSettingOrderBy = + | 'ALLOW_EXTERNAL_MEMBERS_ASC' + | 'ALLOW_EXTERNAL_MEMBERS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'CREATE_CHILD_CASCADE_ADMINS_ASC' + | 'CREATE_CHILD_CASCADE_ADMINS_DESC' + | 'CREATE_CHILD_CASCADE_MEMBERS_ASC' + | 'CREATE_CHILD_CASCADE_MEMBERS_DESC' + | 'CREATE_CHILD_CASCADE_OWNERS_ASC' + | 'CREATE_CHILD_CASCADE_OWNERS_DESC' + | 'DELETE_MEMBER_CASCADE_CHILDREN_ASC' + | 'DELETE_MEMBER_CASCADE_CHILDREN_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_PROFILE_ASSIGNMENT_MODE_ASC' + | 'INVITE_PROFILE_ASSIGNMENT_MODE_DESC' + | 'LIMIT_ALLOCATION_MODE_ASC' + | 'LIMIT_ALLOCATION_MODE_DESC' + | 'NATURAL' + | 'POPULATE_MEMBER_EMAIL_ASC' + | 'POPULATE_MEMBER_EMAIL_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgOwnerGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgPermissionOrderBy = + | 'BITNUM_ASC' + | 'BITNUM_DESC' + | 'BITSTR_ASC' + | 'BITSTR_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgPermissionDefaultOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgPermissionDefaultGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgPermissionDefaultPermissionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateAppAdminGrantInput { clientMutationId?: string; @@ -2396,13 +2897,13 @@ export interface DeleteOrgPermissionDefaultPermissionInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "AppPermission": { - "appPermissionDefaultGrantsByPermissionId": "AppPermissionDefaultGrant" + AppPermission: { + appPermissionDefaultGrantsByPermissionId: 'AppPermissionDefaultGrant', + }, + OrgPermission: { + orgPermissionDefaultGrantsByPermissionId: 'OrgPermissionDefaultGrant', + orgPermissionDefaultPermissionsByPermissionId: 'OrgPermissionDefaultPermission', }, - "OrgPermission": { - "orgPermissionDefaultGrantsByPermissionId": "OrgPermissionDefaultGrant", - "orgPermissionDefaultPermissionsByPermissionId": "OrgPermissionDefaultPermission" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -4885,4 +5386,4 @@ export type OrgPermissionDefaultPermissionEdgeSelect = { node?: { select: OrgPermissionDefaultPermissionSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/admin/orm/models/appAdminGrant.ts b/sdk/constructive-cli/src/admin/orm/models/appAdminGrant.ts index 0c7dffaf81..cc7a22623e 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appAdminGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appAdminGrant.ts @@ -3,56 +3,96 @@ * @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 { AppAdminGrant, AppAdminGrantWithRelations, AppAdminGrantSelect, AppAdminGrantFilter, AppAdminGrantOrderBy, CreateAppAdminGrantInput, UpdateAppAdminGrantInput, AppAdminGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppAdminGrant, + AppAdminGrantWithRelations, + AppAdminGrantSelect, + AppAdminGrantFilter, + AppAdminGrantOrderBy, + CreateAppAdminGrantInput, + UpdateAppAdminGrantInput, + AppAdminGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppAdminGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppAdminGrant", "appAdminGrants", 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 - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppAdminGrant', + 'appAdminGrants', + 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, + }, + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrants", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppAdminGrant", "appAdminGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppAdminGrant', + 'appAdminGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrant", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appAdminGrant": data.appAdminGrants?.nodes?.[0] ?? null - }) + appAdminGrant: data.appAdminGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppAdminGrant", "appAdminGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppAdminGrant', + 'appAdminGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrant", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appAdminGrant": data.appAdminGrants?.nodes?.[0] ?? null - }) + appAdminGrant: data.appAdminGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppAdminGrant", "createAppAdminGrant", "appAdminGrant", args.select, args.data, "CreateAppAdminGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppAdminGrant', + 'createAppAdminGrant', + 'appAdminGrant', + args.select, + args.data, + 'CreateAppAdminGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "createAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'createAppAdminGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppAdminGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppAdminGrant", "updateAppAdminGrant", "appAdminGrant", args.select, args.where.id, args.data, "UpdateAppAdminGrantInput", "id", "appAdminGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppAdminGrant', + 'updateAppAdminGrant', + 'appAdminGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppAdminGrantInput', + 'id', + 'appAdminGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "updateAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'updateAppAdminGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppAdminGrant", "deleteAppAdminGrant", "appAdminGrant", { - id: args.where.id - }, "DeleteAppAdminGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppAdminGrant', + 'deleteAppAdminGrant', + 'appAdminGrant', + { + id: args.where.id, + }, + 'DeleteAppAdminGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "deleteAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'deleteAppAdminGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appClaimedInvite.ts b/sdk/constructive-cli/src/admin/orm/models/appClaimedInvite.ts index 66e752f4b1..598f1b15af 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appClaimedInvite.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appClaimedInvite.ts @@ -3,56 +3,96 @@ * @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 { AppClaimedInvite, AppClaimedInviteWithRelations, AppClaimedInviteSelect, AppClaimedInviteFilter, AppClaimedInviteOrderBy, CreateAppClaimedInviteInput, UpdateAppClaimedInviteInput, AppClaimedInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppClaimedInvite, + AppClaimedInviteWithRelations, + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy, + CreateAppClaimedInviteInput, + UpdateAppClaimedInviteInput, + AppClaimedInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppClaimedInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppClaimedInvite", "appClaimedInvites", 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 - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + 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, + }, + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvites", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppClaimedInvite", "appClaimedInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvite", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appClaimedInvite": data.appClaimedInvites?.nodes?.[0] ?? null - }) + appClaimedInvite: data.appClaimedInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppClaimedInvite", "appClaimedInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvite", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appClaimedInvite": data.appClaimedInvites?.nodes?.[0] ?? null - }) + appClaimedInvite: data.appClaimedInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppClaimedInvite", "createAppClaimedInvite", "appClaimedInvite", args.select, args.data, "CreateAppClaimedInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppClaimedInvite', + 'createAppClaimedInvite', + 'appClaimedInvite', + args.select, + args.data, + 'CreateAppClaimedInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "createAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'createAppClaimedInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppClaimedInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppClaimedInvite", "updateAppClaimedInvite", "appClaimedInvite", args.select, args.where.id, args.data, "UpdateAppClaimedInviteInput", "id", "appClaimedInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppClaimedInvite', + 'updateAppClaimedInvite', + 'appClaimedInvite', + args.select, + args.where.id, + args.data, + 'UpdateAppClaimedInviteInput', + 'id', + 'appClaimedInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "updateAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'updateAppClaimedInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppClaimedInvite", "deleteAppClaimedInvite", "appClaimedInvite", { - id: args.where.id - }, "DeleteAppClaimedInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppClaimedInvite', + 'deleteAppClaimedInvite', + 'appClaimedInvite', + { + id: args.where.id, + }, + 'DeleteAppClaimedInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "deleteAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'deleteAppClaimedInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appGrant.ts b/sdk/constructive-cli/src/admin/orm/models/appGrant.ts index 13823f924b..d773ff6de1 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appGrant.ts @@ -3,56 +3,96 @@ * @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 { AppGrant, AppGrantWithRelations, AppGrantSelect, AppGrantFilter, AppGrantOrderBy, CreateAppGrantInput, UpdateAppGrantInput, AppGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppGrant, + AppGrantWithRelations, + AppGrantSelect, + AppGrantFilter, + AppGrantOrderBy, + CreateAppGrantInput, + UpdateAppGrantInput, + AppGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppGrant", "appGrants", 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 - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppGrant', + 'appGrants', + 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, + }, + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrants", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppGrant", "appGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppGrant', + 'appGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrant", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appGrant": data.appGrants?.nodes?.[0] ?? null - }) + appGrant: data.appGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppGrant", "appGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppGrant', + 'appGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrant", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appGrant": data.appGrants?.nodes?.[0] ?? null - }) + appGrant: data.appGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppGrant", "createAppGrant", "appGrant", args.select, args.data, "CreateAppGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppGrant', + 'createAppGrant', + 'appGrant', + args.select, + args.data, + 'CreateAppGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "createAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'createAppGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppGrant", "updateAppGrant", "appGrant", args.select, args.where.id, args.data, "UpdateAppGrantInput", "id", "appGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppGrant', + 'updateAppGrant', + 'appGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppGrantInput', + 'id', + 'appGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "updateAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'updateAppGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppGrant", "deleteAppGrant", "appGrant", { - id: args.where.id - }, "DeleteAppGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppGrant', + 'deleteAppGrant', + 'appGrant', + { + id: args.where.id, + }, + 'DeleteAppGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "deleteAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'deleteAppGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appInvite.ts b/sdk/constructive-cli/src/admin/orm/models/appInvite.ts index 7320a2028b..3350bba65b 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appInvite.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appInvite.ts @@ -3,56 +3,96 @@ * @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 { AppInvite, AppInviteWithRelations, AppInviteSelect, AppInviteFilter, AppInviteOrderBy, CreateAppInviteInput, UpdateAppInviteInput, AppInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppInvite, + AppInviteWithRelations, + AppInviteSelect, + AppInviteFilter, + AppInviteOrderBy, + CreateAppInviteInput, + UpdateAppInviteInput, + AppInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppInvite", "appInvites", 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 - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppInvite', + 'appInvites', + 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, + }, + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvites", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppInvite", "appInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppInvite', + 'appInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvite", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appInvite": data.appInvites?.nodes?.[0] ?? null - }) + appInvite: data.appInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppInvite", "appInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppInvite', + 'appInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvite", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appInvite": data.appInvites?.nodes?.[0] ?? null - }) + appInvite: data.appInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppInvite", "createAppInvite", "appInvite", args.select, args.data, "CreateAppInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppInvite', + 'createAppInvite', + 'appInvite', + args.select, + args.data, + 'CreateAppInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "createAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'createAppInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppInvite", "updateAppInvite", "appInvite", args.select, args.where.id, args.data, "UpdateAppInviteInput", "id", "appInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppInvite', + 'updateAppInvite', + 'appInvite', + args.select, + args.where.id, + args.data, + 'UpdateAppInviteInput', + 'id', + 'appInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "updateAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'updateAppInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppInvite", "deleteAppInvite", "appInvite", { - id: args.where.id - }, "DeleteAppInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppInvite', + 'deleteAppInvite', + 'appInvite', + { + id: args.where.id, + }, + 'DeleteAppInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "deleteAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'deleteAppInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appMembership.ts b/sdk/constructive-cli/src/admin/orm/models/appMembership.ts index 6732a31125..1faa691016 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appMembership.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appMembership.ts @@ -3,56 +3,96 @@ * @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 { AppMembership, AppMembershipWithRelations, AppMembershipSelect, AppMembershipFilter, AppMembershipOrderBy, CreateAppMembershipInput, UpdateAppMembershipInput, AppMembershipPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppMembership, + AppMembershipWithRelations, + AppMembershipSelect, + AppMembershipFilter, + AppMembershipOrderBy, + CreateAppMembershipInput, + UpdateAppMembershipInput, + AppMembershipPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppMembershipModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMemberships: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembership", "appMemberships", 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 - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppMembership', + 'appMemberships', + 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, + }, + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMemberships", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMemberships', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppMembership", "appMemberships", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppMembership', + 'appMemberships', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMembership", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMembership', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembership": data.appMemberships?.nodes?.[0] ?? null - }) + appMembership: data.appMemberships?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembership", "appMemberships", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppMembership', + 'appMemberships', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMembership", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMembership', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembership": data.appMemberships?.nodes?.[0] ?? null - }) + appMembership: data.appMemberships?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppMembership", "createAppMembership", "appMembership", args.select, args.data, "CreateAppMembershipInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppMembership', + 'createAppMembership', + 'appMembership', + args.select, + args.data, + 'CreateAppMembershipInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "createAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'createAppMembership', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppMembershipPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppMembership", "updateAppMembership", "appMembership", args.select, args.where.id, args.data, "UpdateAppMembershipInput", "id", "appMembershipPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppMembership', + 'updateAppMembership', + 'appMembership', + args.select, + args.where.id, + args.data, + 'UpdateAppMembershipInput', + 'id', + 'appMembershipPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "updateAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'updateAppMembership', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppMembership", "deleteAppMembership", "appMembership", { - id: args.where.id - }, "DeleteAppMembershipInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppMembership', + 'deleteAppMembership', + 'appMembership', + { + id: args.where.id, + }, + 'DeleteAppMembershipInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "deleteAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'deleteAppMembership', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appMembershipDefault.ts b/sdk/constructive-cli/src/admin/orm/models/appMembershipDefault.ts index bfd6c3ee6e..efc0ab28ee 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appMembershipDefault.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appMembershipDefault.ts @@ -3,56 +3,98 @@ * @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 { AppMembershipDefault, AppMembershipDefaultWithRelations, AppMembershipDefaultSelect, AppMembershipDefaultFilter, AppMembershipDefaultOrderBy, CreateAppMembershipDefaultInput, UpdateAppMembershipDefaultInput, AppMembershipDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppMembershipDefault, + AppMembershipDefaultWithRelations, + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy, + CreateAppMembershipDefaultInput, + UpdateAppMembershipDefaultInput, + AppMembershipDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppMembershipDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appMembershipDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appMembershipDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembershipDefault", "appMembershipDefaults", 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 - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + 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, + }, + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefaults", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppMembershipDefault", "appMembershipDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefault", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembershipDefault": data.appMembershipDefaults?.nodes?.[0] ?? null - }) + appMembershipDefault: data.appMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembershipDefault", "appMembershipDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefault", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembershipDefault": data.appMembershipDefaults?.nodes?.[0] ?? null - }) + appMembershipDefault: data.appMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppMembershipDefault", "createAppMembershipDefault", "appMembershipDefault", args.select, args.data, "CreateAppMembershipDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppMembershipDefault', + 'createAppMembershipDefault', + 'appMembershipDefault', + args.select, + args.data, + 'CreateAppMembershipDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "createAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'createAppMembershipDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppMembershipDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppMembershipDefault", "updateAppMembershipDefault", "appMembershipDefault", args.select, args.where.id, args.data, "UpdateAppMembershipDefaultInput", "id", "appMembershipDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppMembershipDefault', + 'updateAppMembershipDefault', + 'appMembershipDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppMembershipDefaultInput', + 'id', + 'appMembershipDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "updateAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'updateAppMembershipDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppMembershipDefault", "deleteAppMembershipDefault", "appMembershipDefault", { - id: args.where.id - }, "DeleteAppMembershipDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppMembershipDefault', + 'deleteAppMembershipDefault', + 'appMembershipDefault', + { + id: args.where.id, + }, + 'DeleteAppMembershipDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "deleteAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'deleteAppMembershipDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appOwnerGrant.ts b/sdk/constructive-cli/src/admin/orm/models/appOwnerGrant.ts index 8709dd4496..28f7d92d12 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appOwnerGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appOwnerGrant.ts @@ -3,56 +3,96 @@ * @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 { AppOwnerGrant, AppOwnerGrantWithRelations, AppOwnerGrantSelect, AppOwnerGrantFilter, AppOwnerGrantOrderBy, CreateAppOwnerGrantInput, UpdateAppOwnerGrantInput, AppOwnerGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppOwnerGrant, + AppOwnerGrantWithRelations, + AppOwnerGrantSelect, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy, + CreateAppOwnerGrantInput, + UpdateAppOwnerGrantInput, + AppOwnerGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppOwnerGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppOwnerGrant", "appOwnerGrants", 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 - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + 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, + }, + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrants", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppOwnerGrant", "appOwnerGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrant", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appOwnerGrant": data.appOwnerGrants?.nodes?.[0] ?? null - }) + appOwnerGrant: data.appOwnerGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppOwnerGrant", "appOwnerGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrant", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appOwnerGrant": data.appOwnerGrants?.nodes?.[0] ?? null - }) + appOwnerGrant: data.appOwnerGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppOwnerGrant", "createAppOwnerGrant", "appOwnerGrant", args.select, args.data, "CreateAppOwnerGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppOwnerGrant', + 'createAppOwnerGrant', + 'appOwnerGrant', + args.select, + args.data, + 'CreateAppOwnerGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "createAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'createAppOwnerGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppOwnerGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppOwnerGrant", "updateAppOwnerGrant", "appOwnerGrant", args.select, args.where.id, args.data, "UpdateAppOwnerGrantInput", "id", "appOwnerGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppOwnerGrant', + 'updateAppOwnerGrant', + 'appOwnerGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppOwnerGrantInput', + 'id', + 'appOwnerGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "updateAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'updateAppOwnerGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppOwnerGrant", "deleteAppOwnerGrant", "appOwnerGrant", { - id: args.where.id - }, "DeleteAppOwnerGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppOwnerGrant', + 'deleteAppOwnerGrant', + 'appOwnerGrant', + { + id: args.where.id, + }, + 'DeleteAppOwnerGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "deleteAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'deleteAppOwnerGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appPermission.ts b/sdk/constructive-cli/src/admin/orm/models/appPermission.ts index ebfaf30147..efa4812398 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appPermission.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appPermission.ts @@ -3,56 +3,96 @@ * @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 { AppPermission, AppPermissionWithRelations, AppPermissionSelect, AppPermissionFilter, AppPermissionOrderBy, CreateAppPermissionInput, UpdateAppPermissionInput, AppPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermission, + AppPermissionWithRelations, + AppPermissionSelect, + AppPermissionFilter, + AppPermissionOrderBy, + CreateAppPermissionInput, + UpdateAppPermissionInput, + AppPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermission", "appPermissions", 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 - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermission', + 'appPermissions', + 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, + }, + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermissions", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermission", "appPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermission', + 'appPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermission", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermission', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermission": data.appPermissions?.nodes?.[0] ?? null - }) + appPermission: data.appPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermission", "appPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermission', + 'appPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermission", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermission', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermission": data.appPermissions?.nodes?.[0] ?? null - }) + appPermission: data.appPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermission", "createAppPermission", "appPermission", args.select, args.data, "CreateAppPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermission', + 'createAppPermission', + 'appPermission', + args.select, + args.data, + 'CreateAppPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "createAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'createAppPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermission", "updateAppPermission", "appPermission", args.select, args.where.id, args.data, "UpdateAppPermissionInput", "id", "appPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermission', + 'updateAppPermission', + 'appPermission', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionInput', + 'id', + 'appPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "updateAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'updateAppPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermission", "deleteAppPermission", "appPermission", { - id: args.where.id - }, "DeleteAppPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermission', + 'deleteAppPermission', + 'appPermission', + { + id: args.where.id, + }, + 'DeleteAppPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "deleteAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'deleteAppPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefault.ts b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefault.ts index 682c13a467..c967364f31 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefault.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefault.ts @@ -3,56 +3,98 @@ * @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 { AppPermissionDefault, AppPermissionDefaultWithRelations, AppPermissionDefaultSelect, AppPermissionDefaultFilter, AppPermissionDefaultOrderBy, CreateAppPermissionDefaultInput, UpdateAppPermissionDefaultInput, AppPermissionDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefault, + AppPermissionDefaultWithRelations, + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy, + CreateAppPermissionDefaultInput, + UpdateAppPermissionDefaultInput, + AppPermissionDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefault", "appPermissionDefaults", 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 - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + 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, + }, + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefaults", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefault", "appPermissionDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefault", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefault": data.appPermissionDefaults?.nodes?.[0] ?? null - }) + appPermissionDefault: data.appPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefault", "appPermissionDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefault", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefault": data.appPermissionDefaults?.nodes?.[0] ?? null - }) + appPermissionDefault: data.appPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefault", "createAppPermissionDefault", "appPermissionDefault", args.select, args.data, "CreateAppPermissionDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefault', + 'createAppPermissionDefault', + 'appPermissionDefault', + args.select, + args.data, + 'CreateAppPermissionDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "createAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'createAppPermissionDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefault", "updateAppPermissionDefault", "appPermissionDefault", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultInput", "id", "appPermissionDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefault', + 'updateAppPermissionDefault', + 'appPermissionDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultInput', + 'id', + 'appPermissionDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "updateAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'updateAppPermissionDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefault", "deleteAppPermissionDefault", "appPermissionDefault", { - id: args.where.id - }, "DeleteAppPermissionDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefault', + 'deleteAppPermissionDefault', + 'appPermissionDefault', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "deleteAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'deleteAppPermissionDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultGrant.ts b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultGrant.ts index a04d3770ba..b6a3b10748 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultGrant.ts @@ -3,56 +3,98 @@ * @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 { AppPermissionDefaultGrant, AppPermissionDefaultGrantWithRelations, AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantFilter, AppPermissionDefaultGrantOrderBy, CreateAppPermissionDefaultGrantInput, UpdateAppPermissionDefaultGrantInput, AppPermissionDefaultGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefaultGrant, + AppPermissionDefaultGrantWithRelations, + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy, + CreateAppPermissionDefaultGrantInput, + UpdateAppPermissionDefaultGrantInput, + AppPermissionDefaultGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultGrants: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", 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 - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + 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, + }, + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrants", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrant", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrant', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultGrant": data.appPermissionDefaultGrants?.nodes?.[0] ?? null - }) + appPermissionDefaultGrant: data.appPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrant", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrant', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultGrant": data.appPermissionDefaultGrants?.nodes?.[0] ?? null - }) + appPermissionDefaultGrant: data.appPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefaultGrant", "createAppPermissionDefaultGrant", "appPermissionDefaultGrant", args.select, args.data, "CreateAppPermissionDefaultGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefaultGrant', + 'createAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + args.select, + args.data, + 'CreateAppPermissionDefaultGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "createAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'createAppPermissionDefaultGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefaultGrant", "updateAppPermissionDefaultGrant", "appPermissionDefaultGrant", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultGrantInput", "id", "appPermissionDefaultGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefaultGrant', + 'updateAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultGrantInput', + 'id', + 'appPermissionDefaultGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "updateAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'updateAppPermissionDefaultGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefaultGrant", "deleteAppPermissionDefaultGrant", "appPermissionDefaultGrant", { - id: args.where.id - }, "DeleteAppPermissionDefaultGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefaultGrant', + 'deleteAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "deleteAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'deleteAppPermissionDefaultGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultPermission.ts b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultPermission.ts index 15217af996..6e47d9eeec 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultPermission.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultPermission.ts @@ -3,56 +3,109 @@ * @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 { AppPermissionDefaultPermission, AppPermissionDefaultPermissionWithRelations, AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionFilter, AppPermissionDefaultPermissionOrderBy, CreateAppPermissionDefaultPermissionInput, UpdateAppPermissionDefaultPermissionInput, AppPermissionDefaultPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefaultPermission, + AppPermissionDefaultPermissionWithRelations, + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy, + CreateAppPermissionDefaultPermissionInput, + UpdateAppPermissionDefaultPermissionInput, + AppPermissionDefaultPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermissions: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", 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 - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + 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, + }, + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermissions", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermission: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermission", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermission', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class AppPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultPermission": data.appPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + appPermissionDefaultPermission: data.appPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermission: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermission", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermission', document, variables, transform: (data: { @@ -93,74 +156,118 @@ export class AppPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultPermission": data.appPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + appPermissionDefaultPermission: data.appPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateAppPermissionDefaultPermissionInput['appPermissionDefaultPermission'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefaultPermission", "createAppPermissionDefaultPermission", "appPermissionDefaultPermission", args.select, args.data, "CreateAppPermissionDefaultPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefaultPermission', + 'createAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + args.select, + args.data, + 'CreateAppPermissionDefaultPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "createAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'createAppPermissionDefaultPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefaultPermission", "updateAppPermissionDefaultPermission", "appPermissionDefaultPermission", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultPermissionInput", "id", "appPermissionDefaultPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefaultPermission', + 'updateAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultPermissionInput', + 'id', + 'appPermissionDefaultPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "updateAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'updateAppPermissionDefaultPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefaultPermission", "deleteAppPermissionDefaultPermission", "appPermissionDefaultPermission", { - id: args.where.id - }, "DeleteAppPermissionDefaultPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefaultPermission', + 'deleteAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "deleteAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'deleteAppPermissionDefaultPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/index.ts b/sdk/constructive-cli/src/admin/orm/models/index.ts index ba6cc4f424..0cac178e48 100644 --- a/sdk/constructive-cli/src/admin/orm/models/index.ts +++ b/sdk/constructive-cli/src/admin/orm/models/index.ts @@ -3,29 +3,29 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AppAdminGrantModel } from "./appAdminGrant"; -export { AppClaimedInviteModel } from "./appClaimedInvite"; -export { AppGrantModel } from "./appGrant"; -export { AppInviteModel } from "./appInvite"; -export { AppMembershipModel } from "./appMembership"; -export { AppMembershipDefaultModel } from "./appMembershipDefault"; -export { AppOwnerGrantModel } from "./appOwnerGrant"; -export { AppPermissionModel } from "./appPermission"; -export { AppPermissionDefaultModel } from "./appPermissionDefault"; -export { AppPermissionDefaultGrantModel } from "./appPermissionDefaultGrant"; -export { AppPermissionDefaultPermissionModel } from "./appPermissionDefaultPermission"; -export { MembershipTypeModel } from "./membershipType"; -export { OrgAdminGrantModel } from "./orgAdminGrant"; -export { OrgClaimedInviteModel } from "./orgClaimedInvite"; -export { OrgGrantModel } from "./orgGrant"; -export { OrgInviteModel } from "./orgInvite"; -export { OrgMemberModel } from "./orgMember"; -export { OrgMemberProfileModel } from "./orgMemberProfile"; -export { OrgMembershipModel } from "./orgMembership"; -export { OrgMembershipDefaultModel } from "./orgMembershipDefault"; -export { OrgMembershipSettingModel } from "./orgMembershipSetting"; -export { OrgOwnerGrantModel } from "./orgOwnerGrant"; -export { OrgPermissionModel } from "./orgPermission"; -export { OrgPermissionDefaultModel } from "./orgPermissionDefault"; -export { OrgPermissionDefaultGrantModel } from "./orgPermissionDefaultGrant"; -export { OrgPermissionDefaultPermissionModel } from "./orgPermissionDefaultPermission"; \ No newline at end of file +export { AppAdminGrantModel } from './appAdminGrant'; +export { AppClaimedInviteModel } from './appClaimedInvite'; +export { AppGrantModel } from './appGrant'; +export { AppInviteModel } from './appInvite'; +export { AppMembershipModel } from './appMembership'; +export { AppMembershipDefaultModel } from './appMembershipDefault'; +export { AppOwnerGrantModel } from './appOwnerGrant'; +export { AppPermissionModel } from './appPermission'; +export { AppPermissionDefaultModel } from './appPermissionDefault'; +export { AppPermissionDefaultGrantModel } from './appPermissionDefaultGrant'; +export { AppPermissionDefaultPermissionModel } from './appPermissionDefaultPermission'; +export { MembershipTypeModel } from './membershipType'; +export { OrgAdminGrantModel } from './orgAdminGrant'; +export { OrgClaimedInviteModel } from './orgClaimedInvite'; +export { OrgGrantModel } from './orgGrant'; +export { OrgInviteModel } from './orgInvite'; +export { OrgMemberModel } from './orgMember'; +export { OrgMemberProfileModel } from './orgMemberProfile'; +export { OrgMembershipModel } from './orgMembership'; +export { OrgMembershipDefaultModel } from './orgMembershipDefault'; +export { OrgMembershipSettingModel } from './orgMembershipSetting'; +export { OrgOwnerGrantModel } from './orgOwnerGrant'; +export { OrgPermissionModel } from './orgPermission'; +export { OrgPermissionDefaultModel } from './orgPermissionDefault'; +export { OrgPermissionDefaultGrantModel } from './orgPermissionDefaultGrant'; +export { OrgPermissionDefaultPermissionModel } from './orgPermissionDefaultPermission'; diff --git a/sdk/constructive-cli/src/admin/orm/models/membershipType.ts b/sdk/constructive-cli/src/admin/orm/models/membershipType.ts index e99dd207df..1ab7c15781 100644 --- a/sdk/constructive-cli/src/admin/orm/models/membershipType.ts +++ b/sdk/constructive-cli/src/admin/orm/models/membershipType.ts @@ -3,56 +3,96 @@ * @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 { MembershipType, MembershipTypeWithRelations, MembershipTypeSelect, MembershipTypeFilter, MembershipTypeOrderBy, CreateMembershipTypeInput, UpdateMembershipTypeInput, MembershipTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipType, + MembershipTypeWithRelations, + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy, + CreateMembershipTypeInput, + UpdateMembershipTypeInput, + MembershipTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipType", "membershipTypes", 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 - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipType', + 'membershipTypes', + 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, + }, + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipTypes", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipType", "membershipTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipType', + 'membershipTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipType", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MembershipTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipType": data.membershipTypes?.nodes?.[0] ?? null - }) + membershipType: data.membershipTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipType", "membershipTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipType', + 'membershipTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipType", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MembershipTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipType": data.membershipTypes?.nodes?.[0] ?? null - }) + membershipType: data.membershipTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipType", "createMembershipType", "membershipType", args.select, args.data, "CreateMembershipTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipType', + 'createMembershipType', + 'membershipType', + args.select, + args.data, + 'CreateMembershipTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "createMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'createMembershipType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: number; + }, + MembershipTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipType", "updateMembershipType", "membershipType", args.select, args.where.id, args.data, "UpdateMembershipTypeInput", "id", "membershipTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipType', + 'updateMembershipType', + 'membershipType', + args.select, + args.where.id, + args.data, + 'UpdateMembershipTypeInput', + 'id', + 'membershipTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "updateMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'updateMembershipType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: number; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: number; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipType", "deleteMembershipType", "membershipType", { - id: args.where.id - }, "DeleteMembershipTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipType', + 'deleteMembershipType', + 'membershipType', + { + id: args.where.id, + }, + 'DeleteMembershipTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "deleteMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'deleteMembershipType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgAdminGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgAdminGrant.ts index 2bd28d708d..9ef902aaa8 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgAdminGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgAdminGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgAdminGrant, OrgAdminGrantWithRelations, OrgAdminGrantSelect, OrgAdminGrantFilter, OrgAdminGrantOrderBy, CreateOrgAdminGrantInput, UpdateOrgAdminGrantInput, OrgAdminGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgAdminGrant, + OrgAdminGrantWithRelations, + OrgAdminGrantSelect, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy, + CreateOrgAdminGrantInput, + UpdateOrgAdminGrantInput, + OrgAdminGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgAdminGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgAdminGrant", "orgAdminGrants", 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 - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + 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, + }, + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrants", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgAdminGrant", "orgAdminGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrant", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgAdminGrant": data.orgAdminGrants?.nodes?.[0] ?? null - }) + orgAdminGrant: data.orgAdminGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgAdminGrant", "orgAdminGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrant", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgAdminGrant": data.orgAdminGrants?.nodes?.[0] ?? null - }) + orgAdminGrant: data.orgAdminGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgAdminGrant", "createOrgAdminGrant", "orgAdminGrant", args.select, args.data, "CreateOrgAdminGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgAdminGrant', + 'createOrgAdminGrant', + 'orgAdminGrant', + args.select, + args.data, + 'CreateOrgAdminGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "createOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'createOrgAdminGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgAdminGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgAdminGrant", "updateOrgAdminGrant", "orgAdminGrant", args.select, args.where.id, args.data, "UpdateOrgAdminGrantInput", "id", "orgAdminGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgAdminGrant', + 'updateOrgAdminGrant', + 'orgAdminGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgAdminGrantInput', + 'id', + 'orgAdminGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "updateOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'updateOrgAdminGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgAdminGrant", "deleteOrgAdminGrant", "orgAdminGrant", { - id: args.where.id - }, "DeleteOrgAdminGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgAdminGrant', + 'deleteOrgAdminGrant', + 'orgAdminGrant', + { + id: args.where.id, + }, + 'DeleteOrgAdminGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "deleteOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'deleteOrgAdminGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgClaimedInvite.ts b/sdk/constructive-cli/src/admin/orm/models/orgClaimedInvite.ts index 3e5e549cb0..82b31bb474 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgClaimedInvite.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgClaimedInvite.ts @@ -3,56 +3,96 @@ * @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 { OrgClaimedInvite, OrgClaimedInviteWithRelations, OrgClaimedInviteSelect, OrgClaimedInviteFilter, OrgClaimedInviteOrderBy, CreateOrgClaimedInviteInput, UpdateOrgClaimedInviteInput, OrgClaimedInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgClaimedInvite, + OrgClaimedInviteWithRelations, + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy, + CreateOrgClaimedInviteInput, + UpdateOrgClaimedInviteInput, + OrgClaimedInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgClaimedInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgClaimedInvite", "orgClaimedInvites", 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 - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + 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, + }, + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvites", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgClaimedInvite", "orgClaimedInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvite", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgClaimedInvite": data.orgClaimedInvites?.nodes?.[0] ?? null - }) + orgClaimedInvite: data.orgClaimedInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgClaimedInvite", "orgClaimedInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvite", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgClaimedInvite": data.orgClaimedInvites?.nodes?.[0] ?? null - }) + orgClaimedInvite: data.orgClaimedInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgClaimedInvite", "createOrgClaimedInvite", "orgClaimedInvite", args.select, args.data, "CreateOrgClaimedInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgClaimedInvite', + 'createOrgClaimedInvite', + 'orgClaimedInvite', + args.select, + args.data, + 'CreateOrgClaimedInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "createOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'createOrgClaimedInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgClaimedInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgClaimedInvite", "updateOrgClaimedInvite", "orgClaimedInvite", args.select, args.where.id, args.data, "UpdateOrgClaimedInviteInput", "id", "orgClaimedInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgClaimedInvite', + 'updateOrgClaimedInvite', + 'orgClaimedInvite', + args.select, + args.where.id, + args.data, + 'UpdateOrgClaimedInviteInput', + 'id', + 'orgClaimedInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "updateOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'updateOrgClaimedInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgClaimedInvite", "deleteOrgClaimedInvite", "orgClaimedInvite", { - id: args.where.id - }, "DeleteOrgClaimedInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgClaimedInvite', + 'deleteOrgClaimedInvite', + 'orgClaimedInvite', + { + id: args.where.id, + }, + 'DeleteOrgClaimedInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "deleteOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'deleteOrgClaimedInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgGrant.ts index 8d61a4f545..467c6b11b9 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgGrant, OrgGrantWithRelations, OrgGrantSelect, OrgGrantFilter, OrgGrantOrderBy, CreateOrgGrantInput, UpdateOrgGrantInput, OrgGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgGrant, + OrgGrantWithRelations, + OrgGrantSelect, + OrgGrantFilter, + OrgGrantOrderBy, + CreateOrgGrantInput, + UpdateOrgGrantInput, + OrgGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgGrant", "orgGrants", 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 - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgGrant', + 'orgGrants', + 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, + }, + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrants", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgGrant", "orgGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgGrant', + 'orgGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrant", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgGrant": data.orgGrants?.nodes?.[0] ?? null - }) + orgGrant: data.orgGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgGrant", "orgGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgGrant', + 'orgGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrant", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgGrant": data.orgGrants?.nodes?.[0] ?? null - }) + orgGrant: data.orgGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgGrant", "createOrgGrant", "orgGrant", args.select, args.data, "CreateOrgGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgGrant', + 'createOrgGrant', + 'orgGrant', + args.select, + args.data, + 'CreateOrgGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "createOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'createOrgGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgGrant", "updateOrgGrant", "orgGrant", args.select, args.where.id, args.data, "UpdateOrgGrantInput", "id", "orgGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgGrant', + 'updateOrgGrant', + 'orgGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgGrantInput', + 'id', + 'orgGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "updateOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'updateOrgGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgGrant", "deleteOrgGrant", "orgGrant", { - id: args.where.id - }, "DeleteOrgGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgGrant', + 'deleteOrgGrant', + 'orgGrant', + { + id: args.where.id, + }, + 'DeleteOrgGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "deleteOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'deleteOrgGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgInvite.ts b/sdk/constructive-cli/src/admin/orm/models/orgInvite.ts index 120f096740..50cc5eb9e6 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgInvite.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgInvite.ts @@ -3,56 +3,96 @@ * @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 { OrgInvite, OrgInviteWithRelations, OrgInviteSelect, OrgInviteFilter, OrgInviteOrderBy, CreateOrgInviteInput, UpdateOrgInviteInput, OrgInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgInvite, + OrgInviteWithRelations, + OrgInviteSelect, + OrgInviteFilter, + OrgInviteOrderBy, + CreateOrgInviteInput, + UpdateOrgInviteInput, + OrgInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgInvite", "orgInvites", 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 - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgInvite', + 'orgInvites', + 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, + }, + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvites", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgInvite", "orgInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgInvite', + 'orgInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvite", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgInvite": data.orgInvites?.nodes?.[0] ?? null - }) + orgInvite: data.orgInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgInvite", "orgInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgInvite', + 'orgInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvite", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgInvite": data.orgInvites?.nodes?.[0] ?? null - }) + orgInvite: data.orgInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgInvite", "createOrgInvite", "orgInvite", args.select, args.data, "CreateOrgInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgInvite', + 'createOrgInvite', + 'orgInvite', + args.select, + args.data, + 'CreateOrgInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "createOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'createOrgInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgInvite", "updateOrgInvite", "orgInvite", args.select, args.where.id, args.data, "UpdateOrgInviteInput", "id", "orgInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgInvite', + 'updateOrgInvite', + 'orgInvite', + args.select, + args.where.id, + args.data, + 'UpdateOrgInviteInput', + 'id', + 'orgInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "updateOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'updateOrgInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgInvite", "deleteOrgInvite", "orgInvite", { - id: args.where.id - }, "DeleteOrgInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgInvite', + 'deleteOrgInvite', + 'orgInvite', + { + id: args.where.id, + }, + 'DeleteOrgInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "deleteOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'deleteOrgInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMember.ts b/sdk/constructive-cli/src/admin/orm/models/orgMember.ts index 76ffb8c694..bf7ac25fe9 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMember.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMember.ts @@ -3,56 +3,96 @@ * @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 { OrgMember, OrgMemberWithRelations, OrgMemberSelect, OrgMemberFilter, OrgMemberOrderBy, CreateOrgMemberInput, UpdateOrgMemberInput, OrgMemberPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMember, + OrgMemberWithRelations, + OrgMemberSelect, + OrgMemberFilter, + OrgMemberOrderBy, + CreateOrgMemberInput, + UpdateOrgMemberInput, + OrgMemberPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMemberModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMember", "orgMembers", 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 - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMember', + 'orgMembers', + 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, + }, + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMembers", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMembers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMember: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMember", "orgMembers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMember', + 'orgMembers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMember", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMember', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMemberModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMember": data.orgMembers?.nodes?.[0] ?? null - }) + orgMember: data.orgMembers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMember: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMember", "orgMembers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMember', + 'orgMembers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMember", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMember', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMemberModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMember": data.orgMembers?.nodes?.[0] ?? null - }) + orgMember: data.orgMembers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMember", "createOrgMember", "orgMember", args.select, args.data, "CreateOrgMemberInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMember', + 'createOrgMember', + 'orgMember', + args.select, + args.data, + 'CreateOrgMemberInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "createOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'createOrgMember', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMemberPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMember", "updateOrgMember", "orgMember", args.select, args.where.id, args.data, "UpdateOrgMemberInput", "id", "orgMemberPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMember', + 'updateOrgMember', + 'orgMember', + args.select, + args.where.id, + args.data, + 'UpdateOrgMemberInput', + 'id', + 'orgMemberPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "updateOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'updateOrgMember', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMember", "deleteOrgMember", "orgMember", { - id: args.where.id - }, "DeleteOrgMemberInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMember', + 'deleteOrgMember', + 'orgMember', + { + id: args.where.id, + }, + 'DeleteOrgMemberInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "deleteOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'deleteOrgMember', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMemberProfile.ts b/sdk/constructive-cli/src/admin/orm/models/orgMemberProfile.ts index 4f0671ad74..9cecf8839b 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMemberProfile.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMemberProfile.ts @@ -3,56 +3,96 @@ * @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 { OrgMemberProfile, OrgMemberProfileWithRelations, OrgMemberProfileSelect, OrgMemberProfileFilter, OrgMemberProfileOrderBy, CreateOrgMemberProfileInput, UpdateOrgMemberProfileInput, OrgMemberProfilePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMemberProfile, + OrgMemberProfileWithRelations, + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy, + CreateOrgMemberProfileInput, + UpdateOrgMemberProfileInput, + OrgMemberProfilePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMemberProfileModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfiles: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMemberProfile", "orgMemberProfiles", 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 - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + 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, + }, + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfiles", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfiles', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfile: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMemberProfile", "orgMemberProfiles", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfile", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfile', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMemberProfileModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMemberProfile": data.orgMemberProfiles?.nodes?.[0] ?? null - }) + orgMemberProfile: data.orgMemberProfiles?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfile: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMemberProfile", "orgMemberProfiles", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfile", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfile', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMemberProfileModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMemberProfile": data.orgMemberProfiles?.nodes?.[0] ?? null - }) + orgMemberProfile: data.orgMemberProfiles?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMemberProfile", "createOrgMemberProfile", "orgMemberProfile", args.select, args.data, "CreateOrgMemberProfileInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMemberProfile', + 'createOrgMemberProfile', + 'orgMemberProfile', + args.select, + args.data, + 'CreateOrgMemberProfileInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "createOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'createOrgMemberProfile', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMemberProfilePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMemberProfile", "updateOrgMemberProfile", "orgMemberProfile", args.select, args.where.id, args.data, "UpdateOrgMemberProfileInput", "id", "orgMemberProfilePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMemberProfile', + 'updateOrgMemberProfile', + 'orgMemberProfile', + args.select, + args.where.id, + args.data, + 'UpdateOrgMemberProfileInput', + 'id', + 'orgMemberProfilePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "updateOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'updateOrgMemberProfile', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMemberProfile", "deleteOrgMemberProfile", "orgMemberProfile", { - id: args.where.id - }, "DeleteOrgMemberProfileInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMemberProfile', + 'deleteOrgMemberProfile', + 'orgMemberProfile', + { + id: args.where.id, + }, + 'DeleteOrgMemberProfileInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "deleteOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'deleteOrgMemberProfile', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMembership.ts b/sdk/constructive-cli/src/admin/orm/models/orgMembership.ts index 316b21c75c..06ee032ca8 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMembership.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMembership.ts @@ -3,56 +3,96 @@ * @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 { OrgMembership, OrgMembershipWithRelations, OrgMembershipSelect, OrgMembershipFilter, OrgMembershipOrderBy, CreateOrgMembershipInput, UpdateOrgMembershipInput, OrgMembershipPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembership, + OrgMembershipWithRelations, + OrgMembershipSelect, + OrgMembershipFilter, + OrgMembershipOrderBy, + CreateOrgMembershipInput, + UpdateOrgMembershipInput, + OrgMembershipPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberships: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembership", "orgMemberships", 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 - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembership', + 'orgMemberships', + 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, + }, + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMemberships", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMemberships', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembership", "orgMemberships", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembership', + 'orgMemberships', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMembership", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMembership', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembership": data.orgMemberships?.nodes?.[0] ?? null - }) + orgMembership: data.orgMemberships?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembership", "orgMemberships", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembership', + 'orgMemberships', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMembership", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMembership', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembership": data.orgMemberships?.nodes?.[0] ?? null - }) + orgMembership: data.orgMemberships?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembership", "createOrgMembership", "orgMembership", args.select, args.data, "CreateOrgMembershipInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembership', + 'createOrgMembership', + 'orgMembership', + args.select, + args.data, + 'CreateOrgMembershipInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "createOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'createOrgMembership', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembership", "updateOrgMembership", "orgMembership", args.select, args.where.id, args.data, "UpdateOrgMembershipInput", "id", "orgMembershipPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembership', + 'updateOrgMembership', + 'orgMembership', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipInput', + 'id', + 'orgMembershipPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "updateOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'updateOrgMembership', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembership", "deleteOrgMembership", "orgMembership", { - id: args.where.id - }, "DeleteOrgMembershipInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembership', + 'deleteOrgMembership', + 'orgMembership', + { + id: args.where.id, + }, + 'DeleteOrgMembershipInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "deleteOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'deleteOrgMembership', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMembershipDefault.ts b/sdk/constructive-cli/src/admin/orm/models/orgMembershipDefault.ts index 25472918b1..525619dfca 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMembershipDefault.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMembershipDefault.ts @@ -3,56 +3,98 @@ * @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 { OrgMembershipDefault, OrgMembershipDefaultWithRelations, OrgMembershipDefaultSelect, OrgMembershipDefaultFilter, OrgMembershipDefaultOrderBy, CreateOrgMembershipDefaultInput, UpdateOrgMembershipDefaultInput, OrgMembershipDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembershipDefault, + OrgMembershipDefaultWithRelations, + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy, + CreateOrgMembershipDefaultInput, + UpdateOrgMembershipDefaultInput, + OrgMembershipDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgMembershipDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgMembershipDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipDefault", "orgMembershipDefaults", 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 - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + 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, + }, + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefaults", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembershipDefault", "orgMembershipDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefault", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipDefault": data.orgMembershipDefaults?.nodes?.[0] ?? null - }) + orgMembershipDefault: data.orgMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipDefault", "orgMembershipDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefault", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipDefault": data.orgMembershipDefaults?.nodes?.[0] ?? null - }) + orgMembershipDefault: data.orgMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembershipDefault", "createOrgMembershipDefault", "orgMembershipDefault", args.select, args.data, "CreateOrgMembershipDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembershipDefault', + 'createOrgMembershipDefault', + 'orgMembershipDefault', + args.select, + args.data, + 'CreateOrgMembershipDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "createOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'createOrgMembershipDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembershipDefault", "updateOrgMembershipDefault", "orgMembershipDefault", args.select, args.where.id, args.data, "UpdateOrgMembershipDefaultInput", "id", "orgMembershipDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembershipDefault', + 'updateOrgMembershipDefault', + 'orgMembershipDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipDefaultInput', + 'id', + 'orgMembershipDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "updateOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'updateOrgMembershipDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembershipDefault", "deleteOrgMembershipDefault", "orgMembershipDefault", { - id: args.where.id - }, "DeleteOrgMembershipDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembershipDefault', + 'deleteOrgMembershipDefault', + 'orgMembershipDefault', + { + id: args.where.id, + }, + 'DeleteOrgMembershipDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "deleteOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'deleteOrgMembershipDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMembershipSetting.ts b/sdk/constructive-cli/src/admin/orm/models/orgMembershipSetting.ts index 3297c80b04..de551183d2 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMembershipSetting.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMembershipSetting.ts @@ -3,56 +3,98 @@ * @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 { OrgMembershipSetting, OrgMembershipSettingWithRelations, OrgMembershipSettingSelect, OrgMembershipSettingFilter, OrgMembershipSettingOrderBy, CreateOrgMembershipSettingInput, UpdateOrgMembershipSettingInput, OrgMembershipSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembershipSetting, + OrgMembershipSettingWithRelations, + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy, + CreateOrgMembershipSettingInput, + UpdateOrgMembershipSettingInput, + OrgMembershipSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgMembershipSettings: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgMembershipSettings: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipSetting", "orgMembershipSettings", 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 - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + 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, + }, + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSettings", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembershipSetting", "orgMembershipSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSetting", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSetting', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgMembershipSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipSetting": data.orgMembershipSettings?.nodes?.[0] ?? null - }) + orgMembershipSetting: data.orgMembershipSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipSetting", "orgMembershipSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSetting", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSetting', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgMembershipSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipSetting": data.orgMembershipSettings?.nodes?.[0] ?? null - }) + orgMembershipSetting: data.orgMembershipSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembershipSetting", "createOrgMembershipSetting", "orgMembershipSetting", args.select, args.data, "CreateOrgMembershipSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembershipSetting', + 'createOrgMembershipSetting', + 'orgMembershipSetting', + args.select, + args.data, + 'CreateOrgMembershipSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "createOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'createOrgMembershipSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembershipSetting", "updateOrgMembershipSetting", "orgMembershipSetting", args.select, args.where.id, args.data, "UpdateOrgMembershipSettingInput", "id", "orgMembershipSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembershipSetting', + 'updateOrgMembershipSetting', + 'orgMembershipSetting', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipSettingInput', + 'id', + 'orgMembershipSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "updateOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'updateOrgMembershipSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembershipSetting", "deleteOrgMembershipSetting", "orgMembershipSetting", { - id: args.where.id - }, "DeleteOrgMembershipSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembershipSetting', + 'deleteOrgMembershipSetting', + 'orgMembershipSetting', + { + id: args.where.id, + }, + 'DeleteOrgMembershipSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "deleteOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'deleteOrgMembershipSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgOwnerGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgOwnerGrant.ts index 163b918057..d99550bd73 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgOwnerGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgOwnerGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgOwnerGrant, OrgOwnerGrantWithRelations, OrgOwnerGrantSelect, OrgOwnerGrantFilter, OrgOwnerGrantOrderBy, CreateOrgOwnerGrantInput, UpdateOrgOwnerGrantInput, OrgOwnerGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgOwnerGrant, + OrgOwnerGrantWithRelations, + OrgOwnerGrantSelect, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy, + CreateOrgOwnerGrantInput, + UpdateOrgOwnerGrantInput, + OrgOwnerGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgOwnerGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgOwnerGrant", "orgOwnerGrants", 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 - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + 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, + }, + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrants", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgOwnerGrant", "orgOwnerGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrant", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgOwnerGrant": data.orgOwnerGrants?.nodes?.[0] ?? null - }) + orgOwnerGrant: data.orgOwnerGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgOwnerGrant", "orgOwnerGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrant", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgOwnerGrant": data.orgOwnerGrants?.nodes?.[0] ?? null - }) + orgOwnerGrant: data.orgOwnerGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgOwnerGrant", "createOrgOwnerGrant", "orgOwnerGrant", args.select, args.data, "CreateOrgOwnerGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgOwnerGrant', + 'createOrgOwnerGrant', + 'orgOwnerGrant', + args.select, + args.data, + 'CreateOrgOwnerGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "createOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'createOrgOwnerGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgOwnerGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgOwnerGrant", "updateOrgOwnerGrant", "orgOwnerGrant", args.select, args.where.id, args.data, "UpdateOrgOwnerGrantInput", "id", "orgOwnerGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgOwnerGrant', + 'updateOrgOwnerGrant', + 'orgOwnerGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgOwnerGrantInput', + 'id', + 'orgOwnerGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "updateOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'updateOrgOwnerGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgOwnerGrant", "deleteOrgOwnerGrant", "orgOwnerGrant", { - id: args.where.id - }, "DeleteOrgOwnerGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgOwnerGrant', + 'deleteOrgOwnerGrant', + 'orgOwnerGrant', + { + id: args.where.id, + }, + 'DeleteOrgOwnerGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "deleteOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'deleteOrgOwnerGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgPermission.ts b/sdk/constructive-cli/src/admin/orm/models/orgPermission.ts index 76834b6851..e3aded7147 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgPermission.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgPermission.ts @@ -3,56 +3,96 @@ * @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 { OrgPermission, OrgPermissionWithRelations, OrgPermissionSelect, OrgPermissionFilter, OrgPermissionOrderBy, CreateOrgPermissionInput, UpdateOrgPermissionInput, OrgPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermission, + OrgPermissionWithRelations, + OrgPermissionSelect, + OrgPermissionFilter, + OrgPermissionOrderBy, + CreateOrgPermissionInput, + UpdateOrgPermissionInput, + OrgPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermission", "orgPermissions", 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 - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermission', + 'orgPermissions', + 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, + }, + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermissions", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermission", "orgPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermission', + 'orgPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermission", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermission', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermission": data.orgPermissions?.nodes?.[0] ?? null - }) + orgPermission: data.orgPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermission", "orgPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermission', + 'orgPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermission", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermission', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermission": data.orgPermissions?.nodes?.[0] ?? null - }) + orgPermission: data.orgPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermission", "createOrgPermission", "orgPermission", args.select, args.data, "CreateOrgPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermission', + 'createOrgPermission', + 'orgPermission', + args.select, + args.data, + 'CreateOrgPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "createOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'createOrgPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermission", "updateOrgPermission", "orgPermission", args.select, args.where.id, args.data, "UpdateOrgPermissionInput", "id", "orgPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermission', + 'updateOrgPermission', + 'orgPermission', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionInput', + 'id', + 'orgPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "updateOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'updateOrgPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermission", "deleteOrgPermission", "orgPermission", { - id: args.where.id - }, "DeleteOrgPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermission', + 'deleteOrgPermission', + 'orgPermission', + { + id: args.where.id, + }, + 'DeleteOrgPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "deleteOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'deleteOrgPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefault.ts b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefault.ts index b9fd8d9a5f..20ed957d15 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefault.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefault.ts @@ -3,56 +3,98 @@ * @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 { OrgPermissionDefault, OrgPermissionDefaultWithRelations, OrgPermissionDefaultSelect, OrgPermissionDefaultFilter, OrgPermissionDefaultOrderBy, CreateOrgPermissionDefaultInput, UpdateOrgPermissionDefaultInput, OrgPermissionDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefault, + OrgPermissionDefaultWithRelations, + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy, + CreateOrgPermissionDefaultInput, + UpdateOrgPermissionDefaultInput, + OrgPermissionDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefault", "orgPermissionDefaults", 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 - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + 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, + }, + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefaults", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefault", "orgPermissionDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefault", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefault": data.orgPermissionDefaults?.nodes?.[0] ?? null - }) + orgPermissionDefault: data.orgPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefault", "orgPermissionDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefault", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefault": data.orgPermissionDefaults?.nodes?.[0] ?? null - }) + orgPermissionDefault: data.orgPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefault", "createOrgPermissionDefault", "orgPermissionDefault", args.select, args.data, "CreateOrgPermissionDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefault', + 'createOrgPermissionDefault', + 'orgPermissionDefault', + args.select, + args.data, + 'CreateOrgPermissionDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "createOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'createOrgPermissionDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefault", "updateOrgPermissionDefault", "orgPermissionDefault", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultInput", "id", "orgPermissionDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefault', + 'updateOrgPermissionDefault', + 'orgPermissionDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultInput', + 'id', + 'orgPermissionDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "updateOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'updateOrgPermissionDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefault", "deleteOrgPermissionDefault", "orgPermissionDefault", { - id: args.where.id - }, "DeleteOrgPermissionDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefault', + 'deleteOrgPermissionDefault', + 'orgPermissionDefault', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "deleteOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'deleteOrgPermissionDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultGrant.ts index 0a3f198007..07d5976acb 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultGrant.ts @@ -3,56 +3,98 @@ * @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 { OrgPermissionDefaultGrant, OrgPermissionDefaultGrantWithRelations, OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantFilter, OrgPermissionDefaultGrantOrderBy, CreateOrgPermissionDefaultGrantInput, UpdateOrgPermissionDefaultGrantInput, OrgPermissionDefaultGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefaultGrant, + OrgPermissionDefaultGrantWithRelations, + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy, + CreateOrgPermissionDefaultGrantInput, + UpdateOrgPermissionDefaultGrantInput, + OrgPermissionDefaultGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultGrants: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", 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 - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + 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, + }, + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrants", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrant", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrant', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultGrant": data.orgPermissionDefaultGrants?.nodes?.[0] ?? null - }) + orgPermissionDefaultGrant: data.orgPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrant", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrant', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultGrant": data.orgPermissionDefaultGrants?.nodes?.[0] ?? null - }) + orgPermissionDefaultGrant: data.orgPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefaultGrant", "createOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", args.select, args.data, "CreateOrgPermissionDefaultGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefaultGrant', + 'createOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + args.select, + args.data, + 'CreateOrgPermissionDefaultGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "createOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'createOrgPermissionDefaultGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefaultGrant", "updateOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultGrantInput", "id", "orgPermissionDefaultGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefaultGrant', + 'updateOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultGrantInput', + 'id', + 'orgPermissionDefaultGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "updateOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'updateOrgPermissionDefaultGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefaultGrant", "deleteOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", { - id: args.where.id - }, "DeleteOrgPermissionDefaultGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefaultGrant', + 'deleteOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "deleteOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'deleteOrgPermissionDefaultGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultPermission.ts b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultPermission.ts index 66e7df7fd0..3339ceaeca 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultPermission.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultPermission.ts @@ -3,56 +3,109 @@ * @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 { OrgPermissionDefaultPermission, OrgPermissionDefaultPermissionWithRelations, OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionFilter, OrgPermissionDefaultPermissionOrderBy, CreateOrgPermissionDefaultPermissionInput, UpdateOrgPermissionDefaultPermissionInput, OrgPermissionDefaultPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefaultPermission, + OrgPermissionDefaultPermissionWithRelations, + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy, + CreateOrgPermissionDefaultPermissionInput, + UpdateOrgPermissionDefaultPermissionInput, + OrgPermissionDefaultPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermissions: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", 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 - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + 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, + }, + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermissions", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermission: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermission", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermission', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class OrgPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultPermission": data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + orgPermissionDefaultPermission: data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermission: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermission", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermission', document, variables, transform: (data: { @@ -93,74 +156,118 @@ export class OrgPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultPermission": data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + orgPermissionDefaultPermission: data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateOrgPermissionDefaultPermissionInput['orgPermissionDefaultPermission'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefaultPermission", "createOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", args.select, args.data, "CreateOrgPermissionDefaultPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefaultPermission', + 'createOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + args.select, + args.data, + 'CreateOrgPermissionDefaultPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "createOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'createOrgPermissionDefaultPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefaultPermission", "updateOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultPermissionInput", "id", "orgPermissionDefaultPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefaultPermission', + 'updateOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultPermissionInput', + 'id', + 'orgPermissionDefaultPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "updateOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'updateOrgPermissionDefaultPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefaultPermission", "deleteOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", { - id: args.where.id - }, "DeleteOrgPermissionDefaultPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefaultPermission', + 'deleteOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "deleteOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'deleteOrgPermissionDefaultPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/mutation/index.ts b/sdk/constructive-cli/src/admin/orm/mutation/index.ts index 822d64e2f2..0e8e613d2e 100644 --- a/sdk/constructive-cli/src/admin/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/admin/orm/mutation/index.ts @@ -3,11 +3,21 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, SubmitAppInviteCodeInput, SubmitOrgInviteCodeInput, ProvisionBucketPayload, SubmitAppInviteCodePayload, SubmitOrgInviteCodePayload, ProvisionBucketPayloadSelect, SubmitAppInviteCodePayloadSelect, SubmitOrgInviteCodePayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + SubmitAppInviteCodeInput, + SubmitOrgInviteCodeInput, + ProvisionBucketPayload, + SubmitAppInviteCodePayload, + SubmitOrgInviteCodePayload, + ProvisionBucketPayloadSelect, + SubmitAppInviteCodePayloadSelect, + SubmitOrgInviteCodePayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -26,47 +36,92 @@ export interface SubmitOrgInviteCodeVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - submitAppInviteCode: (args: SubmitAppInviteCodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - submitAppInviteCode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SubmitAppInviteCode", - fieldName: "submitAppInviteCode", - ...buildCustomDocument("mutation", "SubmitAppInviteCode", "submitAppInviteCode", options.select, args, [{ - name: "input", - type: "SubmitAppInviteCodeInput!" - }], connectionFieldsMap, "SubmitAppInviteCodePayload") - }), - submitOrgInviteCode: (args: SubmitOrgInviteCodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - submitOrgInviteCode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SubmitOrgInviteCode", - fieldName: "submitOrgInviteCode", - ...buildCustomDocument("mutation", "SubmitOrgInviteCode", "submitOrgInviteCode", options.select, args, [{ - name: "input", - type: "SubmitOrgInviteCodeInput!" - }], connectionFieldsMap, "SubmitOrgInviteCodePayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + submitAppInviteCode: ( + args: SubmitAppInviteCodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + submitAppInviteCode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SubmitAppInviteCode', + fieldName: 'submitAppInviteCode', + ...buildCustomDocument( + 'mutation', + 'SubmitAppInviteCode', + 'submitAppInviteCode', + options.select, + args, + [ + { + name: 'input', + type: 'SubmitAppInviteCodeInput!', + }, + ], + connectionFieldsMap, + 'SubmitAppInviteCodePayload' + ), + }), + submitOrgInviteCode: ( + args: SubmitOrgInviteCodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + submitOrgInviteCode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SubmitOrgInviteCode', + fieldName: 'submitOrgInviteCode', + ...buildCustomDocument( + 'mutation', + 'SubmitOrgInviteCode', + 'submitOrgInviteCode', + options.select, + args, + [ + { + name: 'input', + type: 'SubmitOrgInviteCodeInput!', + }, + ], + connectionFieldsMap, + 'SubmitOrgInviteCodePayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/query-builder.ts b/sdk/constructive-cli/src/admin/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/admin/orm/query-builder.ts +++ b/sdk/constructive-cli/src/admin/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/admin/orm/query/index.ts b/sdk/constructive-cli/src/admin/orm/query/index.ts index 08db07b7be..da811891ce 100644 --- a/sdk/constructive-cli/src/admin/orm/query/index.ts +++ b/sdk/constructive-cli/src/admin/orm/query/index.ts @@ -3,11 +3,11 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AppPermissionConnection, OrgPermissionConnection } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { AppPermissionConnection, OrgPermissionConnection } from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AppPermissionsGetByMaskVariables { /** Read all values in the set after (below) this cursor. */ after?: string; @@ -52,135 +52,261 @@ export interface OrgPermissionsGetPaddedMaskVariables { } export function createQueryOperations(client: OrmClient) { return { - appPermissionsGetByMask: (args: AppPermissionsGetByMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetByMask: AppPermissionConnection | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetByMask", - fieldName: "appPermissionsGetByMask", - ...buildCustomDocument("query", "AppPermissionsGetByMask", "appPermissionsGetByMask", options?.select, args, [{ - name: "after", - type: "Cursor" - }, { - name: "first", - type: "Int" - }, { - name: "mask", - type: "BitString" - }, { - name: "offset", - type: "Int" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetMask: (args: AppPermissionsGetMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetMask: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetMask", - fieldName: "appPermissionsGetMask", - ...buildCustomDocument("query", "AppPermissionsGetMask", "appPermissionsGetMask", options?.select, args, [{ - name: "ids", - type: "[UUID]" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetMaskByNames: (args: AppPermissionsGetMaskByNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetMaskByNames: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetMaskByNames", - fieldName: "appPermissionsGetMaskByNames", - ...buildCustomDocument("query", "AppPermissionsGetMaskByNames", "appPermissionsGetMaskByNames", options?.select, args, [{ - name: "names", - type: "[String]" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetPaddedMask: (args: AppPermissionsGetPaddedMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetPaddedMask: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetPaddedMask", - fieldName: "appPermissionsGetPaddedMask", - ...buildCustomDocument("query", "AppPermissionsGetPaddedMask", "appPermissionsGetPaddedMask", options?.select, args, [{ - name: "mask", - type: "BitString" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetByMask: (args: OrgPermissionsGetByMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetByMask: OrgPermissionConnection | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetByMask", - fieldName: "orgPermissionsGetByMask", - ...buildCustomDocument("query", "OrgPermissionsGetByMask", "orgPermissionsGetByMask", options?.select, args, [{ - name: "after", - type: "Cursor" - }, { - name: "first", - type: "Int" - }, { - name: "mask", - type: "BitString" - }, { - name: "offset", - type: "Int" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetMask: (args: OrgPermissionsGetMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetMask: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetMask", - fieldName: "orgPermissionsGetMask", - ...buildCustomDocument("query", "OrgPermissionsGetMask", "orgPermissionsGetMask", options?.select, args, [{ - name: "ids", - type: "[UUID]" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetMaskByNames: (args: OrgPermissionsGetMaskByNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetMaskByNames: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetMaskByNames", - fieldName: "orgPermissionsGetMaskByNames", - ...buildCustomDocument("query", "OrgPermissionsGetMaskByNames", "orgPermissionsGetMaskByNames", options?.select, args, [{ - name: "names", - type: "[String]" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetPaddedMask: (args: OrgPermissionsGetPaddedMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetPaddedMask: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetPaddedMask", - fieldName: "orgPermissionsGetPaddedMask", - ...buildCustomDocument("query", "OrgPermissionsGetPaddedMask", "orgPermissionsGetPaddedMask", options?.select, args, [{ - name: "mask", - type: "BitString" - }], connectionFieldsMap, undefined) - }) + appPermissionsGetByMask: ( + args: AppPermissionsGetByMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetByMask: AppPermissionConnection | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetByMask', + fieldName: 'appPermissionsGetByMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetByMask', + 'appPermissionsGetByMask', + options?.select, + args, + [ + { + name: 'after', + type: 'Cursor', + }, + { + name: 'first', + type: 'Int', + }, + { + name: 'mask', + type: 'BitString', + }, + { + name: 'offset', + type: 'Int', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetMask: ( + args: AppPermissionsGetMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetMask', + fieldName: 'appPermissionsGetMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetMask', + 'appPermissionsGetMask', + options?.select, + args, + [ + { + name: 'ids', + type: '[UUID]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetMaskByNames: ( + args: AppPermissionsGetMaskByNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetMaskByNames: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetMaskByNames', + fieldName: 'appPermissionsGetMaskByNames', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetMaskByNames', + 'appPermissionsGetMaskByNames', + options?.select, + args, + [ + { + name: 'names', + type: '[String]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetPaddedMask: ( + args: AppPermissionsGetPaddedMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetPaddedMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetPaddedMask', + fieldName: 'appPermissionsGetPaddedMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetPaddedMask', + 'appPermissionsGetPaddedMask', + options?.select, + args, + [ + { + name: 'mask', + type: 'BitString', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetByMask: ( + args: OrgPermissionsGetByMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetByMask: OrgPermissionConnection | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetByMask', + fieldName: 'orgPermissionsGetByMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetByMask', + 'orgPermissionsGetByMask', + options?.select, + args, + [ + { + name: 'after', + type: 'Cursor', + }, + { + name: 'first', + type: 'Int', + }, + { + name: 'mask', + type: 'BitString', + }, + { + name: 'offset', + type: 'Int', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetMask: ( + args: OrgPermissionsGetMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetMask', + fieldName: 'orgPermissionsGetMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetMask', + 'orgPermissionsGetMask', + options?.select, + args, + [ + { + name: 'ids', + type: '[UUID]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetMaskByNames: ( + args: OrgPermissionsGetMaskByNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetMaskByNames: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetMaskByNames', + fieldName: 'orgPermissionsGetMaskByNames', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetMaskByNames', + 'orgPermissionsGetMaskByNames', + options?.select, + args, + [ + { + name: 'names', + type: '[String]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetPaddedMask: ( + args: OrgPermissionsGetPaddedMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetPaddedMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetPaddedMask', + fieldName: 'orgPermissionsGetPaddedMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetPaddedMask', + 'orgPermissionsGetPaddedMask', + options?.select, + args, + [ + { + name: 'mask', + type: 'BitString', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/admin/orm/realtime.ts b/sdk/constructive-cli/src/admin/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/admin/orm/realtime.ts +++ b/sdk/constructive-cli/src/admin/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/admin/orm/select-types.ts b/sdk/constructive-cli/src/admin/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/admin/orm/select-types.ts +++ b/sdk/constructive-cli/src/admin/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/agent/cli/commands.ts b/sdk/constructive-cli/src/agent/cli/commands.ts index 9ec96999e3..1dc3d5c18d 100644 --- a/sdk/constructive-cli/src/agent/cli/commands.ts +++ b/sdk/constructive-cli/src/agent/cli/commands.ts @@ -3,51 +3,62 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import agentCmd from "./commands/agent"; -import agentMessageCmd from "./commands/agent-message"; -import agentPersonaCmd from "./commands/agent-persona"; -import agentPlanCmd from "./commands/agent-plan"; -import agentPromptCmd from "./commands/agent-prompt"; -import agentResourceChunkCmd from "./commands/agent-resource-chunk"; -import agentResourceCmd from "./commands/agent-resource"; -import agentTaskCmd from "./commands/agent-task"; -import agentThreadCmd from "./commands/agent-thread"; -import provisionBucketCmd from "./commands/provision-bucket"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "agent": agentCmd, - "agent-message": agentMessageCmd, - "agent-persona": agentPersonaCmd, - "agent-plan": agentPlanCmd, - "agent-prompt": agentPromptCmd, - "agent-resource-chunk": agentResourceChunkCmd, - "agent-resource": agentResourceCmd, - "agent-task": agentTaskCmd, - "agent-thread": agentThreadCmd, - "provision-bucket": provisionBucketCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import agentCmd from './commands/agent'; +import agentMessageCmd from './commands/agent-message'; +import agentPersonaCmd from './commands/agent-persona'; +import agentPlanCmd from './commands/agent-plan'; +import agentPromptCmd from './commands/agent-prompt'; +import agentResourceChunkCmd from './commands/agent-resource-chunk'; +import agentResourceCmd from './commands/agent-resource'; +import agentTaskCmd from './commands/agent-task'; +import agentThreadCmd from './commands/agent-thread'; +import provisionBucketCmd from './commands/provision-bucket'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + agent: agentCmd, + 'agent-message': agentMessageCmd, + 'agent-persona': agentPersonaCmd, + 'agent-plan': agentPlanCmd, + 'agent-prompt': agentPromptCmd, + 'agent-resource-chunk': agentResourceChunkCmd, + 'agent-resource': agentResourceCmd, + 'agent-task': agentTaskCmd, + 'agent-thread': agentThreadCmd, + 'provision-bucket': provisionBucketCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n agent agent CRUD operations\n agent-message agentMessage CRUD operations\n agent-persona agentPersona CRUD operations\n agent-plan agentPlan CRUD operations\n agent-prompt agentPrompt CRUD operations\n agent-resource-chunk agentResourceChunk CRUD operations\n agent-resource agentResource CRUD operations\n agent-task agentTask CRUD operations\n agent-thread agentThread CRUD operations\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n agent agent CRUD operations\n agent-message agentMessage CRUD operations\n agent-persona agentPersona CRUD operations\n agent-plan agentPlan CRUD operations\n agent-prompt agentPrompt CRUD operations\n agent-resource-chunk agentResourceChunk CRUD operations\n agent-resource agentResource CRUD operations\n agent-task agentTask CRUD operations\n agent-thread agentThread CRUD operations\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -59,4 +70,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent-message.ts b/sdk/constructive-cli/src/agent/cli/commands/agent-message.ts index 9a7f748856..d827804b2e 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent-message.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent-message.ts @@ -3,58 +3,72 @@ * @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 { CreateAgentMessageInput, AgentMessagePatch, AgentMessageSelect, AgentMessageFilter, AgentMessageOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentMessageInput, + AgentMessagePatch, + AgentMessageSelect, + AgentMessageFilter, + AgentMessageOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - agentId: "uuid", - authorRole: "string", - createdAt: "string", - databaseId: "uuid", - id: "uuid", - model: "string", - parts: "json", - threadId: "uuid", - updatedAt: "string" + actorId: 'uuid', + agentId: 'uuid', + authorRole: 'string', + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + model: 'string', + parts: 'json', + threadId: 'uuid', + updatedAt: 'string', }; -const usage = "\nagent-message \n\nCommands:\n list List agentMessage records\n find-first Find first matching agentMessage record\n get Get a agentMessage by ID\n create Create a new agentMessage\n update Update an existing agentMessage\n delete Delete a agentMessage\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) => { +const usage = + '\nagent-message \n\nCommands:\n list List agentMessage records\n find-first Find first matching agentMessage record\n get Get a agentMessage by ID\n create Create a new agentMessage\n update Update an existing agentMessage\n delete Delete a agentMessage\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq model: true, parts: true, threadId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentMessageSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentMessageSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentMessage.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter model: true, parts: true, threadId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentMessageSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentMessageSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentMessage.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentMessage.findOne({ - id: answers.id as string, - select: { - actorId: true, - agentId: true, - authorRole: true, - createdAt: true, - databaseId: true, - id: true, - model: true, - parts: true, - threadId: true, - updatedAt: true - } - }).execute(); + const result = await client.agentMessage + .findOne({ + id: answers.id as string, + select: { + actorId: true, + agentId: true, + authorRole: true, + createdAt: true, + databaseId: true, + id: true, + model: true, + parts: true, + threadId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,75 +174,88 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "agentId", - message: "agentId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authorRole", - message: "authorRole", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "model", - message: "model", - required: false, - skipPrompt: true - }, { - type: "json", - name: "parts", - message: "parts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "threadId", - message: "threadId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'agentId', + message: 'agentId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authorRole', + message: 'authorRole', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'model', + message: 'model', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'parts', + message: 'parts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'threadId', + message: 'threadId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentMessageInput["agentMessage"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAgentMessageInput['agentMessage']; const client = getClient(); - const result = await client.agentMessage.create({ - data: { - actorId: cleanedData.actorId, - agentId: cleanedData.agentId, - authorRole: cleanedData.authorRole, - databaseId: cleanedData.databaseId, - model: cleanedData.model, - parts: cleanedData.parts, - threadId: cleanedData.threadId - }, - select: { - actorId: true, - agentId: true, - authorRole: true, - createdAt: true, - databaseId: true, - id: true, - model: true, - parts: true, - threadId: true, - updatedAt: true - } - }).execute(); + const result = await client.agentMessage + .create({ + data: { + actorId: cleanedData.actorId, + agentId: cleanedData.agentId, + authorRole: cleanedData.authorRole, + databaseId: cleanedData.databaseId, + model: cleanedData.model, + parts: cleanedData.parts, + threadId: cleanedData.threadId, + }, + select: { + actorId: true, + agentId: true, + authorRole: true, + createdAt: true, + databaseId: true, + id: true, + model: true, + parts: true, + threadId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -229,83 +264,94 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "agentId", - message: "agentId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authorRole", - message: "authorRole", - required: false - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "model", - message: "model", - required: false, - skipPrompt: true - }, { - type: "json", - name: "parts", - message: "parts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "threadId", - message: "threadId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'agentId', + message: 'agentId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authorRole', + message: 'authorRole', + required: false, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'model', + message: 'model', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'parts', + message: 'parts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'threadId', + message: 'threadId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentMessagePatch; const client = getClient(); - const result = await client.agentMessage.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - agentId: cleanedData.agentId, - authorRole: cleanedData.authorRole, - databaseId: cleanedData.databaseId, - model: cleanedData.model, - parts: cleanedData.parts, - threadId: cleanedData.threadId - }, - select: { - actorId: true, - agentId: true, - authorRole: true, - createdAt: true, - databaseId: true, - id: true, - model: true, - parts: true, - threadId: true, - updatedAt: true - } - }).execute(); + const result = await client.agentMessage + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + agentId: cleanedData.agentId, + authorRole: cleanedData.authorRole, + databaseId: cleanedData.databaseId, + model: cleanedData.model, + parts: cleanedData.parts, + threadId: cleanedData.threadId, + }, + select: { + actorId: true, + agentId: true, + authorRole: true, + createdAt: true, + databaseId: true, + id: true, + model: true, + parts: true, + threadId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -314,28 +360,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentMessage.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentMessage + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent-persona.ts b/sdk/constructive-cli/src/agent/cli/commands/agent-persona.ts index cceb229293..af640b9410 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent-persona.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent-persona.ts @@ -3,61 +3,75 @@ * @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 { CreateAgentPersonaInput, AgentPersonaPatch, AgentPersonaSelect, AgentPersonaFilter, AgentPersonaOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentPersonaInput, + AgentPersonaPatch, + AgentPersonaSelect, + AgentPersonaFilter, + AgentPersonaOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - config: "json", - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - description: "string", - id: "uuid", - isActive: "boolean", - name: "string", - resources: "string", - slug: "string", - systemPrompt: "string", - updatedAt: "string", - updatedBy: "uuid" + config: 'json', + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + isActive: 'boolean', + name: 'string', + resources: 'string', + slug: 'string', + systemPrompt: 'string', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nagent-persona \n\nCommands:\n list List agentPersona records\n find-first Find first matching agentPersona record\n get Get a agentPersona by ID\n create Create a new agentPersona\n update Update an existing agentPersona\n delete Delete a agentPersona\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) => { +const usage = + '\nagent-persona \n\nCommands:\n list List agentPersona records\n find-first Find first matching agentPersona record\n get Get a agentPersona by ID\n create Create a new agentPersona\n update Update an existing agentPersona\n delete Delete a agentPersona\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq slug: true, systemPrompt: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentPersonaSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentPersonaSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentPersona.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter slug: true, systemPrompt: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentPersonaSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentPersonaSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentPersona.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentPersona.findOne({ - id: answers.id as string, - select: { - config: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - id: true, - isActive: true, - name: true, - resources: true, - slug: true, - systemPrompt: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentPersona + .findOne({ + id: answers.id as string, + select: { + config: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + id: true, + isActive: true, + name: true, + resources: true, + slug: true, + systemPrompt: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,99 +186,115 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "systemPrompt", - message: "systemPrompt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'systemPrompt', + message: 'systemPrompt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentPersonaInput["agentPersona"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAgentPersonaInput['agentPersona']; const client = getClient(); - const result = await client.agentPersona.create({ - data: { - config: cleanedData.config, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isActive: cleanedData.isActive, - name: cleanedData.name, - resources: cleanedData.resources, - slug: cleanedData.slug, - systemPrompt: cleanedData.systemPrompt, - updatedBy: cleanedData.updatedBy - }, - select: { - config: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - id: true, - isActive: true, - name: true, - resources: true, - slug: true, - systemPrompt: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentPersona + .create({ + data: { + config: cleanedData.config, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isActive: cleanedData.isActive, + name: cleanedData.name, + resources: cleanedData.resources, + slug: cleanedData.slug, + systemPrompt: cleanedData.systemPrompt, + updatedBy: cleanedData.updatedBy, + }, + select: { + config: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + id: true, + isActive: true, + name: true, + resources: true, + slug: true, + systemPrompt: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -265,107 +303,121 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "systemPrompt", - message: "systemPrompt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'systemPrompt', + message: 'systemPrompt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentPersonaPatch; const client = getClient(); - const result = await client.agentPersona.update({ - where: { - id: answers.id as string - }, - data: { - config: cleanedData.config, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isActive: cleanedData.isActive, - name: cleanedData.name, - resources: cleanedData.resources, - slug: cleanedData.slug, - systemPrompt: cleanedData.systemPrompt, - updatedBy: cleanedData.updatedBy - }, - select: { - config: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - id: true, - isActive: true, - name: true, - resources: true, - slug: true, - systemPrompt: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentPersona + .update({ + where: { + id: answers.id as string, + }, + data: { + config: cleanedData.config, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isActive: cleanedData.isActive, + name: cleanedData.name, + resources: cleanedData.resources, + slug: cleanedData.slug, + systemPrompt: cleanedData.systemPrompt, + updatedBy: cleanedData.updatedBy, + }, + select: { + config: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + id: true, + isActive: true, + name: true, + resources: true, + slug: true, + systemPrompt: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -374,28 +426,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentPersona.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentPersona + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent-plan.ts b/sdk/constructive-cli/src/agent/cli/commands/agent-plan.ts index 63f717ac64..96fe2c306d 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent-plan.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent-plan.ts @@ -3,57 +3,71 @@ * @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 { CreateAgentPlanInput, AgentPlanPatch, AgentPlanSelect, AgentPlanFilter, AgentPlanOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentPlanInput, + AgentPlanPatch, + AgentPlanSelect, + AgentPlanFilter, + AgentPlanOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - ownerId: "uuid", - status: "string", - threadId: "uuid", - title: "string", - updatedAt: "string" + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + ownerId: 'uuid', + status: 'string', + threadId: 'uuid', + title: 'string', + updatedAt: 'string', }; -const usage = "\nagent-plan \n\nCommands:\n list List agentPlan records\n find-first Find first matching agentPlan record\n get Get a agentPlan by ID\n create Create a new agentPlan\n update Update an existing agentPlan\n delete Delete a agentPlan\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) => { +const usage = + '\nagent-plan \n\nCommands:\n list List agentPlan records\n find-first Find first matching agentPlan record\n get Get a agentPlan by ID\n create Create a new agentPlan\n update Update an existing agentPlan\n delete Delete a agentPlan\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq status: true, threadId: true, title: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentPlanSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentPlanSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentPlan.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter status: true, threadId: true, title: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentPlanSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentPlanSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentPlan.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentPlan.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - description: true, - id: true, - ownerId: true, - status: true, - threadId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.agentPlan + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + description: true, + id: true, + ownerId: true, + status: true, + threadId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,67 +170,76 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "threadId", - message: "threadId", - required: true - }, { - type: "text", - name: "title", - message: "title", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'threadId', + message: 'threadId', + required: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentPlanInput["agentPlan"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentPlanInput['agentPlan']; const client = getClient(); - const result = await client.agentPlan.create({ - data: { - databaseId: cleanedData.databaseId, - description: cleanedData.description, - ownerId: cleanedData.ownerId, - status: cleanedData.status, - threadId: cleanedData.threadId, - title: cleanedData.title - }, - select: { - createdAt: true, - databaseId: true, - description: true, - id: true, - ownerId: true, - status: true, - threadId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.agentPlan + .create({ + data: { + databaseId: cleanedData.databaseId, + description: cleanedData.description, + ownerId: cleanedData.ownerId, + status: cleanedData.status, + threadId: cleanedData.threadId, + title: cleanedData.title, + }, + select: { + createdAt: true, + databaseId: true, + description: true, + id: true, + ownerId: true, + status: true, + threadId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -217,75 +248,85 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "threadId", - message: "threadId", - required: false - }, { - type: "text", - name: "title", - message: "title", - required: false - }]); + 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: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'threadId', + message: 'threadId', + required: false, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentPlanPatch; const client = getClient(); - const result = await client.agentPlan.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - description: cleanedData.description, - ownerId: cleanedData.ownerId, - status: cleanedData.status, - threadId: cleanedData.threadId, - title: cleanedData.title - }, - select: { - createdAt: true, - databaseId: true, - description: true, - id: true, - ownerId: true, - status: true, - threadId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.agentPlan + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + description: cleanedData.description, + ownerId: cleanedData.ownerId, + status: cleanedData.status, + threadId: cleanedData.threadId, + title: cleanedData.title, + }, + select: { + createdAt: true, + databaseId: true, + description: true, + id: true, + ownerId: true, + status: true, + threadId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -294,28 +335,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentPlan.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentPlan + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent-prompt.ts b/sdk/constructive-cli/src/agent/cli/commands/agent-prompt.ts index 15a2314eba..3a2c835662 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent-prompt.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent-prompt.ts @@ -3,59 +3,73 @@ * @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 { CreateAgentPromptInput, AgentPromptPatch, AgentPromptSelect, AgentPromptFilter, AgentPromptOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentPromptInput, + AgentPromptPatch, + AgentPromptSelect, + AgentPromptFilter, + AgentPromptOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - content: "string", - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - description: "string", - id: "uuid", - isDefault: "boolean", - metadata: "json", - name: "string", - updatedAt: "string", - updatedBy: "uuid" + content: 'string', + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + isDefault: 'boolean', + metadata: 'json', + name: 'string', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nagent-prompt \n\nCommands:\n list List agentPrompt records\n find-first Find first matching agentPrompt record\n get Get a agentPrompt by ID\n create Create a new agentPrompt\n update Update an existing agentPrompt\n delete Delete a agentPrompt\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) => { +const usage = + '\nagent-prompt \n\nCommands:\n list List agentPrompt records\n find-first Find first matching agentPrompt record\n get Get a agentPrompt by ID\n create Create a new agentPrompt\n update Update an existing agentPrompt\n delete Delete a agentPrompt\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq metadata: true, name: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentPromptSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentPromptSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentPrompt.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter metadata: true, name: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentPromptSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentPromptSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentPrompt.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentPrompt.findOne({ - id: answers.id as string, - select: { - content: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - id: true, - isDefault: true, - metadata: true, - name: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentPrompt + .findOne({ + id: answers.id as string, + select: { + content: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + id: true, + isDefault: true, + metadata: true, + name: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,83 +178,97 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "content", - message: "content", - required: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDefault", - message: "isDefault", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'content', + message: 'content', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDefault', + message: 'isDefault', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentPromptInput["agentPrompt"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAgentPromptInput['agentPrompt']; const client = getClient(); - const result = await client.agentPrompt.create({ - data: { - content: cleanedData.content, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isDefault: cleanedData.isDefault, - metadata: cleanedData.metadata, - name: cleanedData.name, - updatedBy: cleanedData.updatedBy - }, - select: { - content: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - id: true, - isDefault: true, - metadata: true, - name: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentPrompt + .create({ + data: { + content: cleanedData.content, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isDefault: cleanedData.isDefault, + metadata: cleanedData.metadata, + name: cleanedData.name, + updatedBy: cleanedData.updatedBy, + }, + select: { + content: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + id: true, + isDefault: true, + metadata: true, + name: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -241,91 +277,103 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "content", - message: "content", - required: false - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDefault", - message: "isDefault", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'content', + message: 'content', + required: false, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDefault', + message: 'isDefault', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentPromptPatch; const client = getClient(); - const result = await client.agentPrompt.update({ - where: { - id: answers.id as string - }, - data: { - content: cleanedData.content, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isDefault: cleanedData.isDefault, - metadata: cleanedData.metadata, - name: cleanedData.name, - updatedBy: cleanedData.updatedBy - }, - select: { - content: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - id: true, - isDefault: true, - metadata: true, - name: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentPrompt + .update({ + where: { + id: answers.id as string, + }, + data: { + content: cleanedData.content, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isDefault: cleanedData.isDefault, + metadata: cleanedData.metadata, + name: cleanedData.name, + updatedBy: cleanedData.updatedBy, + }, + select: { + content: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + id: true, + isDefault: true, + metadata: true, + name: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -334,28 +382,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentPrompt.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentPrompt + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent-resource-chunk.ts b/sdk/constructive-cli/src/agent/cli/commands/agent-resource-chunk.ts index b377ba1c59..72d33d8895 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent-resource-chunk.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent-resource-chunk.ts @@ -3,61 +3,75 @@ * @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 { CreateAgentResourceChunkInput, AgentResourceChunkPatch, AgentResourceChunkSelect, AgentResourceChunkFilter, AgentResourceChunkOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentResourceChunkInput, + AgentResourceChunkPatch, + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - agentResourceId: "uuid", - body: "string", - chunkIndex: "int", - createdAt: "string", - embedding: "string", - embeddingVectorDistance: "float", - id: "uuid", - metadata: "json", - searchScore: "float", - updatedAt: "string" + agentResourceId: 'uuid', + body: 'string', + chunkIndex: 'int', + createdAt: 'string', + embedding: 'string', + embeddingVectorDistance: 'float', + id: 'uuid', + metadata: 'json', + searchScore: 'float', + updatedAt: 'string', }; -import { resolveEmbedder, autoEmbedWhere, autoEmbedInput } from "../embedder"; -const usage = "\nagent-resource-chunk \n\nCommands:\n list List agentResourceChunk records\n find-first Find first matching agentResourceChunk record\n search Search agentResourceChunk records\n get Get a agentResourceChunk by ID\n create Create a new agentResourceChunk\n update Update an existing agentResourceChunk\n\nCreate/Update Options:\n --auto-embed Convert text values in vector fields to embeddings before saving\n delete Delete a agentResourceChunk\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\nSearch Options:\n Search query string (required)\n --limit Max number of records to return\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --orderBy Comma-separated list of ordering values\n --auto-embed Convert text queries to vectors via configured embedder\n\nEmbedding Options (for --auto-embed):\n Set EMBEDDER_PROVIDER=ollama to enable text-to-vector embedding.\n Optional: EMBEDDER_MODEL (default: nomic-embed-text)\n Optional: EMBEDDER_BASE_URL (default: http://localhost:11434)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { resolveEmbedder, autoEmbedWhere, autoEmbedInput } from '../embedder'; +const usage = + '\nagent-resource-chunk \n\nCommands:\n list List agentResourceChunk records\n find-first Find first matching agentResourceChunk record\n search Search agentResourceChunk records\n get Get a agentResourceChunk by ID\n create Create a new agentResourceChunk\n update Update an existing agentResourceChunk\n\nCreate/Update Options:\n --auto-embed Convert text values in vector fields to embeddings before saving\n delete Delete a agentResourceChunk\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\nSearch Options:\n Search query string (required)\n --limit Max number of records to return\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --orderBy Comma-separated list of ordering values\n --auto-embed Convert text queries to vectors via configured embedder\n\nEmbedding Options (for --auto-embed):\n Set EMBEDDER_PROVIDER=ollama to enable text-to-vector embedding.\n Optional: EMBEDDER_MODEL (default: nomic-embed-text)\n Optional: EMBEDDER_BASE_URL (default: http://localhost:11434)\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); + 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", "search", "get", "create", "update", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'search', '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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "search": + case 'search': return handleSearch(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -74,24 +88,32 @@ async function handleList(argv: Partial>, _prompter: Inq embedding: true, id: true, metadata: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentResourceChunkSelect; - }>(argv, defaultSelect); - if (argv["auto-embed"]) { + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + > & { + select: AgentResourceChunkSelect; + } + >(argv, defaultSelect); + if (argv['auto-embed']) { const embedder = resolveEmbedder(); if (!embedder) { - console.error("--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL)."); + console.error( + '--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL).' + ); process.exit(1); } - findManyArgs.where = await autoEmbedWhere(findManyArgs.where ?? {}, ["embedding"], embedder); + findManyArgs.where = await autoEmbedWhere(findManyArgs.where ?? {}, ['embedding'], embedder); } const client = getClient(); const result = await client.agentResourceChunk.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -108,16 +130,22 @@ async function handleFindFirst(argv: Partial>, _prompter embedding: true, id: true, metadata: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentResourceChunkSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + > & { + select: AgentResourceChunkSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentResourceChunk.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,21 +156,23 @@ async function handleSearch(argv: Partial>, _prompter: I try { const query = Array.isArray(argv._) && argv._.length > 0 ? String(argv._[0]) : undefined; if (!query) { - console.error("Error: search requires a argument"); + console.error('Error: search requires a argument'); process.exit(1); } const searchWhere = { embedding: { - vector: query - } + vector: query, + }, }; - if (argv["auto-embed"]) { + if (argv['auto-embed']) { const embedder = resolveEmbedder(); if (!embedder) { - console.error("--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL)."); + console.error( + '--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL).' + ); process.exit(1); } - await autoEmbedWhere(searchWhere ?? {}, ["embedding"], embedder); + await autoEmbedWhere(searchWhere ?? {}, ['embedding'], embedder); } const defaultSelect = { agentResourceId: true, @@ -152,16 +182,22 @@ async function handleSearch(argv: Partial>, _prompter: I embedding: true, id: true, metadata: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentResourceChunkSelect; - }>(argv, defaultSelect, searchWhere); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + > & { + select: AgentResourceChunkSelect; + } + >(argv, defaultSelect, searchWhere); const client = getClient(); const result = await client.agentResourceChunk.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to search records."); + console.error('Failed to search records.'); if (error instanceof Error) { console.error(error.message); } @@ -170,29 +206,33 @@ async function handleSearch(argv: Partial>, _prompter: I } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentResourceChunk.findOne({ - id: answers.id as string, - select: { - agentResourceId: true, - body: true, - chunkIndex: true, - createdAt: true, - embedding: true, - id: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.agentResourceChunk + .findOne({ + id: answers.id as string, + select: { + agentResourceId: true, + body: true, + chunkIndex: true, + createdAt: true, + embedding: true, + id: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -201,68 +241,81 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "agentResourceId", - message: "agentResourceId", - required: true - }, { - type: "text", - name: "body", - message: "body", - required: true - }, { - type: "text", - name: "chunkIndex", - message: "chunkIndex", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embedding", - message: "embedding", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'agentResourceId', + message: 'agentResourceId', + required: true, + }, + { + type: 'text', + name: 'body', + message: 'body', + required: true, + }, + { + type: 'text', + name: 'chunkIndex', + message: 'chunkIndex', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embedding', + message: 'embedding', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentResourceChunkInput["agentResourceChunk"]; - if (argv["auto-embed"]) { + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAgentResourceChunkInput['agentResourceChunk']; + if (argv['auto-embed']) { const embedder = resolveEmbedder(); if (!embedder) { - console.error("--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL)."); + console.error( + '--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL).' + ); process.exit(1); } - await autoEmbedInput(cleanedData, ["embedding"], embedder); + await autoEmbedInput(cleanedData, ['embedding'], embedder); } const client = getClient(); - const result = await client.agentResourceChunk.create({ - data: { - agentResourceId: cleanedData.agentResourceId, - body: cleanedData.body, - chunkIndex: cleanedData.chunkIndex, - embedding: cleanedData.embedding, - metadata: cleanedData.metadata - }, - select: { - agentResourceId: true, - body: true, - chunkIndex: true, - createdAt: true, - embedding: true, - id: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.agentResourceChunk + .create({ + data: { + agentResourceId: cleanedData.agentResourceId, + body: cleanedData.body, + chunkIndex: cleanedData.chunkIndex, + embedding: cleanedData.embedding, + metadata: cleanedData.metadata, + }, + select: { + agentResourceId: true, + body: true, + chunkIndex: true, + createdAt: true, + embedding: true, + id: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -271,76 +324,87 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "agentResourceId", - message: "agentResourceId", - required: false - }, { - type: "text", - name: "body", - message: "body", - required: false - }, { - type: "text", - name: "chunkIndex", - message: "chunkIndex", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embedding", - message: "embedding", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'agentResourceId', + message: 'agentResourceId', + required: false, + }, + { + type: 'text', + name: 'body', + message: 'body', + required: false, + }, + { + type: 'text', + name: 'chunkIndex', + message: 'chunkIndex', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embedding', + message: 'embedding', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentResourceChunkPatch; - if (argv["auto-embed"]) { + if (argv['auto-embed']) { const embedder = resolveEmbedder(); if (!embedder) { - console.error("--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL)."); + console.error( + '--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL).' + ); process.exit(1); } - await autoEmbedInput(cleanedData, ["embedding"], embedder); + await autoEmbedInput(cleanedData, ['embedding'], embedder); } const client = getClient(); - const result = await client.agentResourceChunk.update({ - where: { - id: answers.id as string - }, - data: { - agentResourceId: cleanedData.agentResourceId, - body: cleanedData.body, - chunkIndex: cleanedData.chunkIndex, - embedding: cleanedData.embedding, - metadata: cleanedData.metadata - }, - select: { - agentResourceId: true, - body: true, - chunkIndex: true, - createdAt: true, - embedding: true, - id: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.agentResourceChunk + .update({ + where: { + id: answers.id as string, + }, + data: { + agentResourceId: cleanedData.agentResourceId, + body: cleanedData.body, + chunkIndex: cleanedData.chunkIndex, + embedding: cleanedData.embedding, + metadata: cleanedData.metadata, + }, + select: { + agentResourceId: true, + body: true, + chunkIndex: true, + createdAt: true, + embedding: true, + id: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -349,28 +413,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentResourceChunk.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentResourceChunk + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent-resource.ts b/sdk/constructive-cli/src/agent/cli/commands/agent-resource.ts index 7045fd3da8..d65a820f23 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent-resource.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent-resource.ts @@ -3,77 +3,91 @@ * @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 { CreateAgentResourceInput, AgentResourcePatch, AgentResourceSelect, AgentResourceFilter, AgentResourceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentResourceInput, + AgentResourcePatch, + AgentResourceSelect, + AgentResourceFilter, + AgentResourceOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - archivedAt: "string", - body: "string", - bodyTrgmSimilarity: "float", - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - description: "string", - descriptionTrgmSimilarity: "float", - embedding: "string", - embeddingUpdatedAt: "string", - embeddingVectorDistance: "float", - id: "uuid", - isActive: "boolean", - isArchived: "boolean", - keywords: "string", - kind: "string", - kindTrgmSimilarity: "float", - metadata: "json", - search: "string", - searchScore: "float", - searchTsvRank: "float", - slug: "string", - title: "string", - titleTrgmSimilarity: "float", - updatedAt: "string", - updatedBy: "uuid" + archivedAt: 'string', + body: 'string', + bodyTrgmSimilarity: 'float', + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + description: 'string', + descriptionTrgmSimilarity: 'float', + embedding: 'string', + embeddingUpdatedAt: 'string', + embeddingVectorDistance: 'float', + id: 'uuid', + isActive: 'boolean', + isArchived: 'boolean', + keywords: 'string', + kind: 'string', + kindTrgmSimilarity: 'float', + metadata: 'json', + search: 'string', + searchScore: 'float', + searchTsvRank: 'float', + slug: 'string', + title: 'string', + titleTrgmSimilarity: 'float', + updatedAt: 'string', + updatedBy: 'uuid', }; -import { resolveEmbedder, autoEmbedWhere, autoEmbedInput } from "../embedder"; -const usage = "\nagent-resource \n\nCommands:\n list List agentResource records\n find-first Find first matching agentResource record\n search Search agentResource records\n get Get a agentResource by ID\n create Create a new agentResource\n update Update an existing agentResource\n\nCreate/Update Options:\n --auto-embed Convert text values in vector fields to embeddings before saving\n delete Delete a agentResource\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\nSearch Options:\n Search query string (required)\n --limit Max number of records to return\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --orderBy Comma-separated list of ordering values\n --auto-embed Convert text queries to vectors via configured embedder\n\nEmbedding Options (for --auto-embed):\n Set EMBEDDER_PROVIDER=ollama to enable text-to-vector embedding.\n Optional: EMBEDDER_MODEL (default: nomic-embed-text)\n Optional: EMBEDDER_BASE_URL (default: http://localhost:11434)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { resolveEmbedder, autoEmbedWhere, autoEmbedInput } from '../embedder'; +const usage = + '\nagent-resource \n\nCommands:\n list List agentResource records\n find-first Find first matching agentResource record\n search Search agentResource records\n get Get a agentResource by ID\n create Create a new agentResource\n update Update an existing agentResource\n\nCreate/Update Options:\n --auto-embed Convert text values in vector fields to embeddings before saving\n delete Delete a agentResource\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\nSearch Options:\n Search query string (required)\n --limit Max number of records to return\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --orderBy Comma-separated list of ordering values\n --auto-embed Convert text queries to vectors via configured embedder\n\nEmbedding Options (for --auto-embed):\n Set EMBEDDER_PROVIDER=ollama to enable text-to-vector embedding.\n Optional: EMBEDDER_MODEL (default: nomic-embed-text)\n Optional: EMBEDDER_BASE_URL (default: http://localhost:11434)\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); + 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", "search", "get", "create", "update", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'search', '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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "search": + case 'search': return handleSearch(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -100,24 +114,28 @@ async function handleList(argv: Partial>, _prompter: Inq slug: true, title: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentResourceSelect; - }>(argv, defaultSelect); - if (argv["auto-embed"]) { + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentResourceSelect; + } + >(argv, defaultSelect); + if (argv['auto-embed']) { const embedder = resolveEmbedder(); if (!embedder) { - console.error("--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL)."); + console.error( + '--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL).' + ); process.exit(1); } - findManyArgs.where = await autoEmbedWhere(findManyArgs.where ?? {}, ["embedding"], embedder); + findManyArgs.where = await autoEmbedWhere(findManyArgs.where ?? {}, ['embedding'], embedder); } const client = getClient(); const result = await client.agentResource.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -144,16 +162,18 @@ async function handleFindFirst(argv: Partial>, _prompter slug: true, title: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentResourceSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentResourceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentResource.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -164,40 +184,42 @@ async function handleSearch(argv: Partial>, _prompter: I try { const query = Array.isArray(argv._) && argv._.length > 0 ? String(argv._[0]) : undefined; if (!query) { - console.error("Error: search requires a argument"); + console.error('Error: search requires a argument'); process.exit(1); } const searchWhere = { embedding: { - vector: query + vector: query, }, trgmBody: { value: query, - threshold: 0.3 + threshold: 0.3, }, trgmDescription: { value: query, - threshold: 0.3 + threshold: 0.3, }, trgmKind: { value: query, - threshold: 0.3 + threshold: 0.3, }, search: { - query + query, }, trgmTitle: { value: query, - threshold: 0.3 - } + threshold: 0.3, + }, }; - if (argv["auto-embed"]) { + if (argv['auto-embed']) { const embedder = resolveEmbedder(); if (!embedder) { - console.error("--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL)."); + console.error( + '--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL).' + ); process.exit(1); } - await autoEmbedWhere(searchWhere ?? {}, ["embedding"], embedder); + await autoEmbedWhere(searchWhere ?? {}, ['embedding'], embedder); } const defaultSelect = { archivedAt: true, @@ -217,16 +239,18 @@ async function handleSearch(argv: Partial>, _prompter: I slug: true, title: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentResourceSelect; - }>(argv, defaultSelect, searchWhere); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentResourceSelect; + } + >(argv, defaultSelect, searchWhere); const client = getClient(); const result = await client.agentResource.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to search records."); + console.error('Failed to search records.'); if (error instanceof Error) { console.error(error.message); } @@ -235,39 +259,43 @@ async function handleSearch(argv: Partial>, _prompter: I } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentResource.findOne({ - id: answers.id as string, - select: { - archivedAt: true, - body: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - embedding: true, - embeddingUpdatedAt: true, - id: true, - isActive: true, - isArchived: true, - keywords: true, - kind: true, - metadata: true, - slug: true, - title: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentResource + .findOne({ + id: answers.id as string, + select: { + archivedAt: true, + body: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + embedding: true, + embeddingUpdatedAt: true, + id: true, + isActive: true, + isArchived: true, + keywords: true, + kind: true, + metadata: true, + slug: true, + title: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -276,146 +304,169 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "archivedAt", - message: "archivedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "body", - message: "body", - required: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embedding", - message: "embedding", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embeddingUpdatedAt", - message: "embeddingUpdatedAt", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isArchived", - message: "isArchived", - required: false, - skipPrompt: true - }, { - type: "text", - name: "keywords", - message: "keywords", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "title", - message: "title", - required: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'archivedAt', + message: 'archivedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'body', + message: 'body', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embedding', + message: 'embedding', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embeddingUpdatedAt', + message: 'embeddingUpdatedAt', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isArchived', + message: 'isArchived', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'keywords', + message: 'keywords', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentResourceInput["agentResource"]; - if (argv["auto-embed"]) { + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAgentResourceInput['agentResource']; + if (argv['auto-embed']) { const embedder = resolveEmbedder(); if (!embedder) { - console.error("--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL)."); + console.error( + '--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL).' + ); process.exit(1); } - await autoEmbedInput(cleanedData, ["embedding"], embedder); + await autoEmbedInput(cleanedData, ['embedding'], embedder); } const client = getClient(); - const result = await client.agentResource.create({ - data: { - archivedAt: cleanedData.archivedAt, - body: cleanedData.body, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - embedding: cleanedData.embedding, - embeddingUpdatedAt: cleanedData.embeddingUpdatedAt, - isActive: cleanedData.isActive, - isArchived: cleanedData.isArchived, - keywords: cleanedData.keywords, - kind: cleanedData.kind, - metadata: cleanedData.metadata, - slug: cleanedData.slug, - title: cleanedData.title, - updatedBy: cleanedData.updatedBy - }, - select: { - archivedAt: true, - body: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - embedding: true, - embeddingUpdatedAt: true, - id: true, - isActive: true, - isArchived: true, - keywords: true, - kind: true, - metadata: true, - slug: true, - title: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentResource + .create({ + data: { + archivedAt: cleanedData.archivedAt, + body: cleanedData.body, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + embedding: cleanedData.embedding, + embeddingUpdatedAt: cleanedData.embeddingUpdatedAt, + isActive: cleanedData.isActive, + isArchived: cleanedData.isArchived, + keywords: cleanedData.keywords, + kind: cleanedData.kind, + metadata: cleanedData.metadata, + slug: cleanedData.slug, + title: cleanedData.title, + updatedBy: cleanedData.updatedBy, + }, + select: { + archivedAt: true, + body: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + embedding: true, + embeddingUpdatedAt: true, + id: true, + isActive: true, + isArchived: true, + keywords: true, + kind: true, + metadata: true, + slug: true, + title: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -424,154 +475,175 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "archivedAt", - message: "archivedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "body", - message: "body", - required: false - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embedding", - message: "embedding", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embeddingUpdatedAt", - message: "embeddingUpdatedAt", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isArchived", - message: "isArchived", - required: false, - skipPrompt: true - }, { - type: "text", - name: "keywords", - message: "keywords", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "title", - message: "title", - required: false - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'archivedAt', + message: 'archivedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'body', + message: 'body', + required: false, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embedding', + message: 'embedding', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embeddingUpdatedAt', + message: 'embeddingUpdatedAt', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isArchived', + message: 'isArchived', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'keywords', + message: 'keywords', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentResourcePatch; - if (argv["auto-embed"]) { + if (argv['auto-embed']) { const embedder = resolveEmbedder(); if (!embedder) { - console.error("--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL)."); + console.error( + '--auto-embed requires an embedder. Set EMBEDDER_PROVIDER=ollama (and optionally EMBEDDER_MODEL, EMBEDDER_BASE_URL).' + ); process.exit(1); } - await autoEmbedInput(cleanedData, ["embedding"], embedder); + await autoEmbedInput(cleanedData, ['embedding'], embedder); } const client = getClient(); - const result = await client.agentResource.update({ - where: { - id: answers.id as string - }, - data: { - archivedAt: cleanedData.archivedAt, - body: cleanedData.body, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - embedding: cleanedData.embedding, - embeddingUpdatedAt: cleanedData.embeddingUpdatedAt, - isActive: cleanedData.isActive, - isArchived: cleanedData.isArchived, - keywords: cleanedData.keywords, - kind: cleanedData.kind, - metadata: cleanedData.metadata, - slug: cleanedData.slug, - title: cleanedData.title, - updatedBy: cleanedData.updatedBy - }, - select: { - archivedAt: true, - body: true, - createdAt: true, - createdBy: true, - databaseId: true, - description: true, - embedding: true, - embeddingUpdatedAt: true, - id: true, - isActive: true, - isArchived: true, - keywords: true, - kind: true, - metadata: true, - slug: true, - title: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.agentResource + .update({ + where: { + id: answers.id as string, + }, + data: { + archivedAt: cleanedData.archivedAt, + body: cleanedData.body, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + embedding: cleanedData.embedding, + embeddingUpdatedAt: cleanedData.embeddingUpdatedAt, + isActive: cleanedData.isActive, + isArchived: cleanedData.isArchived, + keywords: cleanedData.keywords, + kind: cleanedData.kind, + metadata: cleanedData.metadata, + slug: cleanedData.slug, + title: cleanedData.title, + updatedBy: cleanedData.updatedBy, + }, + select: { + archivedAt: true, + body: true, + createdAt: true, + createdBy: true, + databaseId: true, + description: true, + embedding: true, + embeddingUpdatedAt: true, + id: true, + isActive: true, + isArchived: true, + keywords: true, + kind: true, + metadata: true, + slug: true, + title: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -580,28 +652,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentResource.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentResource + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent-task.ts b/sdk/constructive-cli/src/agent/cli/commands/agent-task.ts index 969221ab8d..2fb62a07af 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent-task.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent-task.ts @@ -3,64 +3,78 @@ * @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 { CreateAgentTaskInput, AgentTaskPatch, AgentTaskSelect, AgentTaskFilter, AgentTaskOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentTaskInput, + AgentTaskPatch, + AgentTaskSelect, + AgentTaskFilter, + AgentTaskOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - approvalFeedback: "string", - approvalStatus: "string", - approvedAt: "string", - approvedBy: "uuid", - createdAt: "string", - databaseId: "uuid", - description: "string", - error: "string", - id: "uuid", - orderIndex: "int", - planId: "uuid", - requiresApproval: "boolean", - source: "string", - status: "string", - updatedAt: "string" + actorId: 'uuid', + approvalFeedback: 'string', + approvalStatus: 'string', + approvedAt: 'string', + approvedBy: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + error: 'string', + id: 'uuid', + orderIndex: 'int', + planId: 'uuid', + requiresApproval: 'boolean', + source: 'string', + status: 'string', + updatedAt: 'string', }; -const usage = "\nagent-task \n\nCommands:\n list List agentTask records\n find-first Find first matching agentTask record\n get Get a agentTask by ID\n create Create a new agentTask\n update Update an existing agentTask\n delete Delete a agentTask\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) => { +const usage = + '\nagent-task \n\nCommands:\n list List agentTask records\n find-first Find first matching agentTask record\n get Get a agentTask by ID\n create Create a new agentTask\n update Update an existing agentTask\n delete Delete a agentTask\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,18 @@ async function handleList(argv: Partial>, _prompter: Inq requiresApproval: true, source: true, status: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentTaskSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentTaskSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentTask.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +135,18 @@ async function handleFindFirst(argv: Partial>, _prompter requiresApproval: true, source: true, status: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentTaskSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentTaskSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentTask.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +155,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentTask.findOne({ - id: answers.id as string, - select: { - actorId: true, - approvalFeedback: true, - approvalStatus: true, - approvedAt: true, - approvedBy: true, - createdAt: true, - databaseId: true, - description: true, - error: true, - id: true, - orderIndex: true, - planId: true, - requiresApproval: true, - source: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.agentTask + .findOne({ + id: answers.id as string, + select: { + actorId: true, + approvalFeedback: true, + approvalStatus: true, + approvedAt: true, + approvedBy: true, + createdAt: true, + databaseId: true, + description: true, + error: true, + id: true, + orderIndex: true, + planId: true, + requiresApproval: true, + source: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,123 +198,139 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "approvalFeedback", - message: "approvalFeedback", - required: false, - skipPrompt: true - }, { - type: "text", - name: "approvalStatus", - message: "approvalStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "approvedAt", - message: "approvedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "approvedBy", - message: "approvedBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "orderIndex", - message: "orderIndex", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planId", - message: "planId", - required: true - }, { - type: "boolean", - name: "requiresApproval", - message: "requiresApproval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "source", - message: "source", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'approvalFeedback', + message: 'approvalFeedback', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'approvalStatus', + message: 'approvalStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'approvedAt', + message: 'approvedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'approvedBy', + message: 'approvedBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'orderIndex', + message: 'orderIndex', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planId', + message: 'planId', + required: true, + }, + { + type: 'boolean', + name: 'requiresApproval', + message: 'requiresApproval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentTaskInput["agentTask"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentTaskInput['agentTask']; const client = getClient(); - const result = await client.agentTask.create({ - data: { - actorId: cleanedData.actorId, - approvalFeedback: cleanedData.approvalFeedback, - approvalStatus: cleanedData.approvalStatus, - approvedAt: cleanedData.approvedAt, - approvedBy: cleanedData.approvedBy, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - error: cleanedData.error, - orderIndex: cleanedData.orderIndex, - planId: cleanedData.planId, - requiresApproval: cleanedData.requiresApproval, - source: cleanedData.source, - status: cleanedData.status - }, - select: { - actorId: true, - approvalFeedback: true, - approvalStatus: true, - approvedAt: true, - approvedBy: true, - createdAt: true, - databaseId: true, - description: true, - error: true, - id: true, - orderIndex: true, - planId: true, - requiresApproval: true, - source: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.agentTask + .create({ + data: { + actorId: cleanedData.actorId, + approvalFeedback: cleanedData.approvalFeedback, + approvalStatus: cleanedData.approvalStatus, + approvedAt: cleanedData.approvedAt, + approvedBy: cleanedData.approvedBy, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + error: cleanedData.error, + orderIndex: cleanedData.orderIndex, + planId: cleanedData.planId, + requiresApproval: cleanedData.requiresApproval, + source: cleanedData.source, + status: cleanedData.status, + }, + select: { + actorId: true, + approvalFeedback: true, + approvalStatus: true, + approvedAt: true, + approvedBy: true, + createdAt: true, + databaseId: true, + description: true, + error: true, + id: true, + orderIndex: true, + planId: true, + requiresApproval: true, + source: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -301,131 +339,148 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "approvalFeedback", - message: "approvalFeedback", - required: false, - skipPrompt: true - }, { - type: "text", - name: "approvalStatus", - message: "approvalStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "approvedAt", - message: "approvedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "approvedBy", - message: "approvedBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "orderIndex", - message: "orderIndex", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planId", - message: "planId", - required: false - }, { - type: "boolean", - name: "requiresApproval", - message: "requiresApproval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "source", - message: "source", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'approvalFeedback', + message: 'approvalFeedback', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'approvalStatus', + message: 'approvalStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'approvedAt', + message: 'approvedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'approvedBy', + message: 'approvedBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'orderIndex', + message: 'orderIndex', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planId', + message: 'planId', + required: false, + }, + { + type: 'boolean', + name: 'requiresApproval', + message: 'requiresApproval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentTaskPatch; const client = getClient(); - const result = await client.agentTask.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - approvalFeedback: cleanedData.approvalFeedback, - approvalStatus: cleanedData.approvalStatus, - approvedAt: cleanedData.approvedAt, - approvedBy: cleanedData.approvedBy, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - error: cleanedData.error, - orderIndex: cleanedData.orderIndex, - planId: cleanedData.planId, - requiresApproval: cleanedData.requiresApproval, - source: cleanedData.source, - status: cleanedData.status - }, - select: { - actorId: true, - approvalFeedback: true, - approvalStatus: true, - approvedAt: true, - approvedBy: true, - createdAt: true, - databaseId: true, - description: true, - error: true, - id: true, - orderIndex: true, - planId: true, - requiresApproval: true, - source: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.agentTask + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + approvalFeedback: cleanedData.approvalFeedback, + approvalStatus: cleanedData.approvalStatus, + approvedAt: cleanedData.approvedAt, + approvedBy: cleanedData.approvedBy, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + error: cleanedData.error, + orderIndex: cleanedData.orderIndex, + planId: cleanedData.planId, + requiresApproval: cleanedData.requiresApproval, + source: cleanedData.source, + status: cleanedData.status, + }, + select: { + actorId: true, + approvalFeedback: true, + approvalStatus: true, + approvedAt: true, + approvedBy: true, + createdAt: true, + databaseId: true, + description: true, + error: true, + id: true, + orderIndex: true, + planId: true, + requiresApproval: true, + source: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -434,28 +489,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentTask.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentTask + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent-thread.ts b/sdk/constructive-cli/src/agent/cli/commands/agent-thread.ts index 6cd908cefc..d905d2ed73 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent-thread.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent-thread.ts @@ -3,64 +3,78 @@ * @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 { CreateAgentThreadInput, AgentThreadPatch, AgentThreadSelect, AgentThreadFilter, AgentThreadOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentThreadInput, + AgentThreadPatch, + AgentThreadSelect, + AgentThreadFilter, + AgentThreadOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - agentId: "uuid", - archivedAt: "string", - createdAt: "string", - databaseId: "uuid", - id: "uuid", - isArchived: "boolean", - mode: "string", - model: "string", - ownerId: "uuid", - parentThreadId: "uuid", - promptTemplateId: "uuid", - status: "string", - systemPrompt: "string", - tags: "string", - title: "string", - updatedAt: "string" + agentId: 'uuid', + archivedAt: 'string', + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + isArchived: 'boolean', + mode: 'string', + model: 'string', + ownerId: 'uuid', + parentThreadId: 'uuid', + promptTemplateId: 'uuid', + status: 'string', + systemPrompt: 'string', + tags: 'string', + title: 'string', + updatedAt: 'string', }; -const usage = "\nagent-thread \n\nCommands:\n list List agentThread records\n find-first Find first matching agentThread record\n get Get a agentThread by ID\n create Create a new agentThread\n update Update an existing agentThread\n delete Delete a agentThread\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) => { +const usage = + '\nagent-thread \n\nCommands:\n list List agentThread records\n find-first Find first matching agentThread record\n get Get a agentThread by ID\n create Create a new agentThread\n update Update an existing agentThread\n delete Delete a agentThread\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,18 @@ async function handleList(argv: Partial>, _prompter: Inq systemPrompt: true, tags: true, title: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentThreadSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentThreadSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentThread.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +135,18 @@ async function handleFindFirst(argv: Partial>, _prompter systemPrompt: true, tags: true, title: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentThreadSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentThreadSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentThread.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +155,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentThread.findOne({ - id: answers.id as string, - select: { - agentId: true, - archivedAt: true, - createdAt: true, - databaseId: true, - id: true, - isArchived: true, - mode: true, - model: true, - ownerId: true, - parentThreadId: true, - promptTemplateId: true, - status: true, - systemPrompt: true, - tags: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.agentThread + .findOne({ + id: answers.id as string, + select: { + agentId: true, + archivedAt: true, + createdAt: true, + databaseId: true, + id: true, + isArchived: true, + mode: true, + model: true, + ownerId: true, + parentThreadId: true, + promptTemplateId: true, + status: true, + systemPrompt: true, + tags: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,125 +198,144 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "agentId", - message: "agentId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "archivedAt", - message: "archivedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "boolean", - name: "isArchived", - message: "isArchived", - required: false, - skipPrompt: true - }, { - type: "text", - name: "mode", - message: "mode", - required: false, - skipPrompt: true - }, { - type: "text", - name: "model", - message: "model", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentThreadId", - message: "parentThreadId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "promptTemplateId", - message: "promptTemplateId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "systemPrompt", - message: "systemPrompt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'agentId', + message: 'agentId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'archivedAt', + message: 'archivedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'boolean', + name: 'isArchived', + message: 'isArchived', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'mode', + message: 'mode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'model', + message: 'model', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentThreadId', + message: 'parentThreadId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'promptTemplateId', + message: 'promptTemplateId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'systemPrompt', + message: 'systemPrompt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentThreadInput["agentThread"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAgentThreadInput['agentThread']; const client = getClient(); - const result = await client.agentThread.create({ - data: { - agentId: cleanedData.agentId, - archivedAt: cleanedData.archivedAt, - databaseId: cleanedData.databaseId, - isArchived: cleanedData.isArchived, - mode: cleanedData.mode, - model: cleanedData.model, - ownerId: cleanedData.ownerId, - parentThreadId: cleanedData.parentThreadId, - promptTemplateId: cleanedData.promptTemplateId, - status: cleanedData.status, - systemPrompt: cleanedData.systemPrompt, - tags: cleanedData.tags, - title: cleanedData.title - }, - select: { - agentId: true, - archivedAt: true, - createdAt: true, - databaseId: true, - id: true, - isArchived: true, - mode: true, - model: true, - ownerId: true, - parentThreadId: true, - promptTemplateId: true, - status: true, - systemPrompt: true, - tags: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.agentThread + .create({ + data: { + agentId: cleanedData.agentId, + archivedAt: cleanedData.archivedAt, + databaseId: cleanedData.databaseId, + isArchived: cleanedData.isArchived, + mode: cleanedData.mode, + model: cleanedData.model, + ownerId: cleanedData.ownerId, + parentThreadId: cleanedData.parentThreadId, + promptTemplateId: cleanedData.promptTemplateId, + status: cleanedData.status, + systemPrompt: cleanedData.systemPrompt, + tags: cleanedData.tags, + title: cleanedData.title, + }, + select: { + agentId: true, + archivedAt: true, + createdAt: true, + databaseId: true, + id: true, + isArchived: true, + mode: true, + model: true, + ownerId: true, + parentThreadId: true, + promptTemplateId: true, + status: true, + systemPrompt: true, + tags: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -303,133 +344,150 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "agentId", - message: "agentId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "archivedAt", - message: "archivedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "boolean", - name: "isArchived", - message: "isArchived", - required: false, - skipPrompt: true - }, { - type: "text", - name: "mode", - message: "mode", - required: false, - skipPrompt: true - }, { - type: "text", - name: "model", - message: "model", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentThreadId", - message: "parentThreadId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "promptTemplateId", - message: "promptTemplateId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "systemPrompt", - message: "systemPrompt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'agentId', + message: 'agentId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'archivedAt', + message: 'archivedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'boolean', + name: 'isArchived', + message: 'isArchived', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'mode', + message: 'mode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'model', + message: 'model', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentThreadId', + message: 'parentThreadId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'promptTemplateId', + message: 'promptTemplateId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'systemPrompt', + message: 'systemPrompt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentThreadPatch; const client = getClient(); - const result = await client.agentThread.update({ - where: { - id: answers.id as string - }, - data: { - agentId: cleanedData.agentId, - archivedAt: cleanedData.archivedAt, - databaseId: cleanedData.databaseId, - isArchived: cleanedData.isArchived, - mode: cleanedData.mode, - model: cleanedData.model, - ownerId: cleanedData.ownerId, - parentThreadId: cleanedData.parentThreadId, - promptTemplateId: cleanedData.promptTemplateId, - status: cleanedData.status, - systemPrompt: cleanedData.systemPrompt, - tags: cleanedData.tags, - title: cleanedData.title - }, - select: { - agentId: true, - archivedAt: true, - createdAt: true, - databaseId: true, - id: true, - isArchived: true, - mode: true, - model: true, - ownerId: true, - parentThreadId: true, - promptTemplateId: true, - status: true, - systemPrompt: true, - tags: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.agentThread + .update({ + where: { + id: answers.id as string, + }, + data: { + agentId: cleanedData.agentId, + archivedAt: cleanedData.archivedAt, + databaseId: cleanedData.databaseId, + isArchived: cleanedData.isArchived, + mode: cleanedData.mode, + model: cleanedData.model, + ownerId: cleanedData.ownerId, + parentThreadId: cleanedData.parentThreadId, + promptTemplateId: cleanedData.promptTemplateId, + status: cleanedData.status, + systemPrompt: cleanedData.systemPrompt, + tags: cleanedData.tags, + title: cleanedData.title, + }, + select: { + agentId: true, + archivedAt: true, + createdAt: true, + databaseId: true, + id: true, + isArchived: true, + mode: true, + model: true, + ownerId: true, + parentThreadId: true, + promptTemplateId: true, + status: true, + systemPrompt: true, + tags: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -438,28 +496,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentThread.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentThread + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/agent.ts b/sdk/constructive-cli/src/agent/cli/commands/agent.ts index e6cd968dea..3cc55d182c 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/agent.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/agent.ts @@ -3,60 +3,74 @@ * @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 { CreateAgentInput, AgentPatch, AgentSelect, AgentFilter, AgentOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentInput, + AgentPatch, + AgentSelect, + AgentFilter, + AgentOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - config: "json", - createdAt: "string", - databaseId: "uuid", - id: "uuid", - isEphemeral: "boolean", - name: "string", - ownerId: "uuid", - parentId: "uuid", - personaId: "uuid", - status: "string", - systemPrompt: "string", - updatedAt: "string" + config: 'json', + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + isEphemeral: 'boolean', + name: 'string', + ownerId: 'uuid', + parentId: 'uuid', + personaId: 'uuid', + status: 'string', + systemPrompt: 'string', + updatedAt: 'string', }; -const usage = "\nagent \n\nCommands:\n list List agent records\n find-first Find first matching agent record\n get Get a agent by ID\n create Create a new agent\n update Update an existing agent\n delete Delete a agent\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) => { +const usage = + '\nagent \n\nCommands:\n list List agent records\n find-first Find first matching agent record\n get Get a agent by ID\n create Create a new agent\n update Update an existing agent\n delete Delete a agent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,18 @@ async function handleList(argv: Partial>, _prompter: Inq personaId: true, status: true, systemPrompt: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +123,18 @@ async function handleFindFirst(argv: Partial>, _prompter personaId: true, status: true, systemPrompt: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +143,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agent.findOne({ - id: answers.id as string, - select: { - config: true, - createdAt: true, - databaseId: true, - id: true, - isEphemeral: true, - name: true, - ownerId: true, - parentId: true, - personaId: true, - status: true, - systemPrompt: true, - updatedAt: true - } - }).execute(); + const result = await client.agent + .findOne({ + id: answers.id as string, + select: { + config: true, + createdAt: true, + databaseId: true, + id: true, + isEphemeral: true, + name: true, + ownerId: true, + parentId: true, + personaId: true, + status: true, + systemPrompt: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,92 +182,104 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "boolean", - name: "isEphemeral", - message: "isEphemeral", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentId", - message: "parentId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "personaId", - message: "personaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "systemPrompt", - message: "systemPrompt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'boolean', + name: 'isEphemeral', + message: 'isEphemeral', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentId', + message: 'parentId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'personaId', + message: 'personaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'systemPrompt', + message: 'systemPrompt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentInput["agent"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentInput['agent']; const client = getClient(); - const result = await client.agent.create({ - data: { - config: cleanedData.config, - databaseId: cleanedData.databaseId, - isEphemeral: cleanedData.isEphemeral, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - parentId: cleanedData.parentId, - personaId: cleanedData.personaId, - status: cleanedData.status, - systemPrompt: cleanedData.systemPrompt - }, - select: { - config: true, - createdAt: true, - databaseId: true, - id: true, - isEphemeral: true, - name: true, - ownerId: true, - parentId: true, - personaId: true, - status: true, - systemPrompt: true, - updatedAt: true - } - }).execute(); + const result = await client.agent + .create({ + data: { + config: cleanedData.config, + databaseId: cleanedData.databaseId, + isEphemeral: cleanedData.isEphemeral, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + parentId: cleanedData.parentId, + personaId: cleanedData.personaId, + status: cleanedData.status, + systemPrompt: cleanedData.systemPrompt, + }, + select: { + config: true, + createdAt: true, + databaseId: true, + id: true, + isEphemeral: true, + name: true, + ownerId: true, + parentId: true, + personaId: true, + status: true, + systemPrompt: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -254,100 +288,113 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "boolean", - name: "isEphemeral", - message: "isEphemeral", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentId", - message: "parentId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "personaId", - message: "personaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "systemPrompt", - message: "systemPrompt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'boolean', + name: 'isEphemeral', + message: 'isEphemeral', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentId', + message: 'parentId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'personaId', + message: 'personaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'systemPrompt', + message: 'systemPrompt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentPatch; const client = getClient(); - const result = await client.agent.update({ - where: { - id: answers.id as string - }, - data: { - config: cleanedData.config, - databaseId: cleanedData.databaseId, - isEphemeral: cleanedData.isEphemeral, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - parentId: cleanedData.parentId, - personaId: cleanedData.personaId, - status: cleanedData.status, - systemPrompt: cleanedData.systemPrompt - }, - select: { - config: true, - createdAt: true, - databaseId: true, - id: true, - isEphemeral: true, - name: true, - ownerId: true, - parentId: true, - personaId: true, - status: true, - systemPrompt: true, - updatedAt: true - } - }).execute(); + const result = await client.agent + .update({ + where: { + id: answers.id as string, + }, + data: { + config: cleanedData.config, + databaseId: cleanedData.databaseId, + isEphemeral: cleanedData.isEphemeral, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + parentId: cleanedData.parentId, + personaId: cleanedData.personaId, + status: cleanedData.status, + systemPrompt: cleanedData.systemPrompt, + }, + select: { + config: true, + createdAt: true, + databaseId: true, + id: true, + isEphemeral: true, + name: true, + ownerId: true, + parentId: true, + personaId: true, + status: true, + systemPrompt: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -356,28 +403,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agent.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agent + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/auth.ts b/sdk/constructive-cli/src/agent/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/context.ts b/sdk/constructive-cli/src/agent/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/context.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/agent/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/agent/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/agent/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/agent/cli/embedder.ts b/sdk/constructive-cli/src/agent/cli/embedder.ts index df97c82e42..dfd92fb46d 100644 --- a/sdk/constructive-cli/src/agent/cli/embedder.ts +++ b/sdk/constructive-cli/src/agent/cli/embedder.ts @@ -22,7 +22,11 @@ function createOllamaEmbedder( baseUrl: string = 'http://localhost:11434', model: string = 'nomic-embed-text' ): EmbedderFunction { - let clientP: Promise<{ generateEmbedding: (text: string, model: string) => Promise<{ embedding: number[] }> }> | undefined; + let clientP: + | Promise<{ + generateEmbedding: (text: string, model: string) => Promise<{ embedding: number[] }>; + }> + | undefined; return async (text: string): Promise => { if (!clientP) { clientP = import('@agentic-kit/ollama') @@ -52,16 +56,16 @@ function createOllamaEmbedder( * @param store - Optional appstash config store for reading persisted config * @returns An EmbedderFunction or null if no embedder is configured */ -export function resolveEmbedder( - store?: { getVar: (key: string) => string | undefined } -): EmbedderFunction | null { +export function resolveEmbedder(store?: { + getVar: (key: string) => string | undefined; +}): EmbedderFunction | null { // 1. Check environment variables first const envProvider = process.env.EMBEDDER_PROVIDER; if (envProvider) { return buildEmbedder({ provider: envProvider, model: process.env.EMBEDDER_MODEL, - baseUrl: process.env.EMBEDDER_BASE_URL + baseUrl: process.env.EMBEDDER_BASE_URL, }); } @@ -72,7 +76,7 @@ export function resolveEmbedder( return buildEmbedder({ provider: configProvider, model: store.getVar('embedder.model'), - baseUrl: store.getVar('embedder.baseUrl') + baseUrl: store.getVar('embedder.baseUrl'), }); } } @@ -86,13 +90,11 @@ export function resolveEmbedder( */ function buildEmbedder(config: EmbedderConfig): EmbedderFunction | null { switch (config.provider) { - case 'ollama': - return createOllamaEmbedder(config.baseUrl, config.model); - default: - console.error( - `Unknown embedder provider: '${config.provider}'. Supported: ollama` - ); - return null; + case 'ollama': + return createOllamaEmbedder(config.baseUrl, config.model); + default: + console.error(`Unknown embedder provider: '${config.provider}'. Supported: ollama`); + return null; } } diff --git a/sdk/constructive-cli/src/agent/cli/executor.ts b/sdk/constructive-cli/src/agent/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/agent/cli/executor.ts +++ b/sdk/constructive-cli/src/agent/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/cli/index.ts b/sdk/constructive-cli/src/agent/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/agent/cli/index.ts +++ b/sdk/constructive-cli/src/agent/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/agent/cli/utils.ts b/sdk/constructive-cli/src/agent/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/agent/cli/utils.ts +++ b/sdk/constructive-cli/src/agent/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/agent/index.ts b/sdk/constructive-cli/src/agent/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/agent/index.ts +++ b/sdk/constructive-cli/src/agent/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/agent/orm/client.ts b/sdk/constructive-cli/src/agent/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/agent/orm/client.ts +++ b/sdk/constructive-cli/src/agent/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/agent/orm/index.ts b/sdk/constructive-cli/src/agent/orm/index.ts index be2f54cdb8..5ca8fcc3eb 100644 --- a/sdk/constructive-cli/src/agent/orm/index.ts +++ b/sdk/constructive-cli/src/agent/orm/index.ts @@ -3,24 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AgentModel } from "./models/agent"; -import { AgentMessageModel } from "./models/agentMessage"; -import { AgentPersonaModel } from "./models/agentPersona"; -import { AgentPlanModel } from "./models/agentPlan"; -import { AgentPromptModel } from "./models/agentPrompt"; -import { AgentResourceChunkModel } from "./models/agentResourceChunk"; -import { AgentResourceModel } from "./models/agentResource"; -import { AgentTaskModel } from "./models/agentTask"; -import { AgentThreadModel } from "./models/agentThread"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AgentModel } from './models/agent'; +import { AgentMessageModel } from './models/agentMessage'; +import { AgentPersonaModel } from './models/agentPersona'; +import { AgentPlanModel } from './models/agentPlan'; +import { AgentPromptModel } from './models/agentPrompt'; +import { AgentResourceChunkModel } from './models/agentResourceChunk'; +import { AgentResourceModel } from './models/agentResource'; +import { AgentTaskModel } from './models/agentTask'; +import { AgentThreadModel } from './models/agentThread'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -56,6 +56,6 @@ export function createClient(config: OrmClientConfig) { agentResource: new AgentResourceModel(client), agentTask: new AgentTaskModel(client), agentThread: new AgentThreadModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/input-types.ts b/sdk/constructive-cli/src/agent/orm/input-types.ts index c716bf9a92..3b5bf5f2b5 100644 --- a/sdk/constructive-cli/src/agent/orm/input-types.ts +++ b/sdk/constructive-cli/src/agent/orm/input-types.ts @@ -1151,15 +1151,288 @@ export interface AgentThreadFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type AgentOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_EPHEMERAL_ASC" | "IS_EPHEMERAL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PARENT_ID_ASC" | "PARENT_ID_DESC" | "PERSONA_ID_ASC" | "PERSONA_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentMessageOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AGENT_ID_ASC" | "AGENT_ID_DESC" | "AUTHOR_ROLE_ASC" | "AUTHOR_ROLE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MODEL_ASC" | "MODEL_DESC" | "NATURAL" | "PARTS_ASC" | "PARTS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "THREAD_ID_ASC" | "THREAD_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentPersonaOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentPlanOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "THREAD_ID_ASC" | "THREAD_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentPromptOrderBy = "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_DEFAULT_ASC" | "IS_DEFAULT_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentResourceChunkOrderBy = "AGENT_RESOURCE_ID_ASC" | "AGENT_RESOURCE_ID_DESC" | "BODY_ASC" | "BODY_DESC" | "CHUNK_INDEX_ASC" | "CHUNK_INDEX_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EMBEDDING_ASC" | "EMBEDDING_DESC" | "EMBEDDING_VECTOR_DISTANCE_ASC" | "EMBEDDING_VECTOR_DISTANCE_DESC" | "ID_ASC" | "ID_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentResourceOrderBy = "ARCHIVED_AT_ASC" | "ARCHIVED_AT_DESC" | "BODY_ASC" | "BODY_DESC" | "BODY_TRGM_SIMILARITY_ASC" | "BODY_TRGM_SIMILARITY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DESCRIPTION_TRGM_SIMILARITY_ASC" | "DESCRIPTION_TRGM_SIMILARITY_DESC" | "EMBEDDING_ASC" | "EMBEDDING_DESC" | "EMBEDDING_UPDATED_AT_ASC" | "EMBEDDING_UPDATED_AT_DESC" | "EMBEDDING_VECTOR_DISTANCE_ASC" | "EMBEDDING_VECTOR_DISTANCE_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ARCHIVED_ASC" | "IS_ARCHIVED_DESC" | "KEYWORDS_ASC" | "KEYWORDS_DESC" | "KIND_ASC" | "KIND_DESC" | "KIND_TRGM_SIMILARITY_ASC" | "KIND_TRGM_SIMILARITY_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_ASC" | "SEARCH_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "SEARCH_TSV_RANK_ASC" | "SEARCH_TSV_RANK_DESC" | "SLUG_ASC" | "SLUG_DESC" | "TITLE_ASC" | "TITLE_DESC" | "TITLE_TRGM_SIMILARITY_ASC" | "TITLE_TRGM_SIMILARITY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentTaskOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "APPROVAL_FEEDBACK_ASC" | "APPROVAL_FEEDBACK_DESC" | "APPROVAL_STATUS_ASC" | "APPROVAL_STATUS_DESC" | "APPROVED_AT_ASC" | "APPROVED_AT_DESC" | "APPROVED_BY_ASC" | "APPROVED_BY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORDER_INDEX_ASC" | "ORDER_INDEX_DESC" | "PLAN_ID_ASC" | "PLAN_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRES_APPROVAL_ASC" | "REQUIRES_APPROVAL_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentThreadOrderBy = "AGENT_ID_ASC" | "AGENT_ID_DESC" | "ARCHIVED_AT_ASC" | "ARCHIVED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ARCHIVED_ASC" | "IS_ARCHIVED_DESC" | "MODEL_ASC" | "MODEL_DESC" | "MODE_ASC" | "MODE_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PARENT_THREAD_ID_ASC" | "PARENT_THREAD_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROMPT_TEMPLATE_ID_ASC" | "PROMPT_TEMPLATE_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_EPHEMERAL_ASC' + | 'IS_EPHEMERAL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PARENT_ID_ASC' + | 'PARENT_ID_DESC' + | 'PERSONA_ID_ASC' + | 'PERSONA_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentMessageOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AGENT_ID_ASC' + | 'AGENT_ID_DESC' + | 'AUTHOR_ROLE_ASC' + | 'AUTHOR_ROLE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MODEL_ASC' + | 'MODEL_DESC' + | 'NATURAL' + | 'PARTS_ASC' + | 'PARTS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'THREAD_ID_ASC' + | 'THREAD_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentPersonaOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentPlanOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'THREAD_ID_ASC' + | 'THREAD_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentPromptOrderBy = + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_DEFAULT_ASC' + | 'IS_DEFAULT_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentResourceChunkOrderBy = + | 'AGENT_RESOURCE_ID_ASC' + | 'AGENT_RESOURCE_ID_DESC' + | 'BODY_ASC' + | 'BODY_DESC' + | 'CHUNK_INDEX_ASC' + | 'CHUNK_INDEX_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EMBEDDING_ASC' + | 'EMBEDDING_DESC' + | 'EMBEDDING_VECTOR_DISTANCE_ASC' + | 'EMBEDDING_VECTOR_DISTANCE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentResourceOrderBy = + | 'ARCHIVED_AT_ASC' + | 'ARCHIVED_AT_DESC' + | 'BODY_ASC' + | 'BODY_DESC' + | 'BODY_TRGM_SIMILARITY_ASC' + | 'BODY_TRGM_SIMILARITY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DESCRIPTION_TRGM_SIMILARITY_ASC' + | 'DESCRIPTION_TRGM_SIMILARITY_DESC' + | 'EMBEDDING_ASC' + | 'EMBEDDING_DESC' + | 'EMBEDDING_UPDATED_AT_ASC' + | 'EMBEDDING_UPDATED_AT_DESC' + | 'EMBEDDING_VECTOR_DISTANCE_ASC' + | 'EMBEDDING_VECTOR_DISTANCE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ARCHIVED_ASC' + | 'IS_ARCHIVED_DESC' + | 'KEYWORDS_ASC' + | 'KEYWORDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'KIND_TRGM_SIMILARITY_ASC' + | 'KIND_TRGM_SIMILARITY_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_ASC' + | 'SEARCH_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'SEARCH_TSV_RANK_ASC' + | 'SEARCH_TSV_RANK_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'TITLE_TRGM_SIMILARITY_ASC' + | 'TITLE_TRGM_SIMILARITY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentTaskOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'APPROVAL_FEEDBACK_ASC' + | 'APPROVAL_FEEDBACK_DESC' + | 'APPROVAL_STATUS_ASC' + | 'APPROVAL_STATUS_DESC' + | 'APPROVED_AT_ASC' + | 'APPROVED_AT_DESC' + | 'APPROVED_BY_ASC' + | 'APPROVED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORDER_INDEX_ASC' + | 'ORDER_INDEX_DESC' + | 'PLAN_ID_ASC' + | 'PLAN_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRES_APPROVAL_ASC' + | 'REQUIRES_APPROVAL_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentThreadOrderBy = + | 'AGENT_ID_ASC' + | 'AGENT_ID_DESC' + | 'ARCHIVED_AT_ASC' + | 'ARCHIVED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ARCHIVED_ASC' + | 'IS_ARCHIVED_DESC' + | 'MODEL_ASC' + | 'MODEL_DESC' + | 'MODE_ASC' + | 'MODE_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PARENT_THREAD_ID_ASC' + | 'PARENT_THREAD_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROMPT_TEMPLATE_ID_ASC' + | 'PROMPT_TEMPLATE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateAgentInput { clientMutationId?: string; @@ -1483,28 +1756,28 @@ export interface DeleteAgentThreadInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Agent": { - "agentMessages": "AgentMessage", - "agentThreads": "AgentThread", - "childAgents": "Agent" + Agent: { + agentMessages: 'AgentMessage', + agentThreads: 'AgentThread', + childAgents: 'Agent', }, - "AgentPersona": { - "agentsByPersonaId": "Agent" + AgentPersona: { + agentsByPersonaId: 'Agent', }, - "AgentPlan": { - "agentTasksByPlanId": "AgentTask" + AgentPlan: { + agentTasksByPlanId: 'AgentTask', }, - "AgentPrompt": { - "agentThreadsByPromptTemplateId": "AgentThread" + AgentPrompt: { + agentThreadsByPromptTemplateId: 'AgentThread', }, - "AgentResource": { - "agentResourceChunks": "AgentResourceChunk" + AgentResource: { + agentResourceChunks: 'AgentResourceChunk', + }, + AgentThread: { + agentMessagesByThreadId: 'AgentMessage', + agentPlansByThreadId: 'AgentPlan', + agentThreadsByParentThreadId: 'AgentThread', }, - "AgentThread": { - "agentMessagesByThreadId": "AgentMessage", - "agentPlansByThreadId": "AgentPlan", - "agentThreadsByParentThreadId": "AgentThread" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -2121,7 +2394,7 @@ export interface AgentTaskFilter { updatedAt?: DatetimeFilter; } /** Similarity metric for vector search */ -export type VectorMetric = "COSINE" | "IP" | "L2"; +export type VectorMetric = 'COSINE' | 'IP' | 'L2'; /** A filter to be used against `AgentResourceChunk` object types. All fields are combined with a logical ‘and.’ */ export interface AgentResourceChunkFilter { /** Filter by the object’s `agentResource` relation. */ @@ -3151,4 +3424,4 @@ export type AgentThreadEdgeSelect = { node?: { select: AgentThreadSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/agent/orm/models/agent.ts b/sdk/constructive-cli/src/agent/orm/models/agent.ts index bf8233944a..72f4b04da0 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agent.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agent.ts @@ -3,56 +3,96 @@ * @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 { Agent, AgentWithRelations, AgentSelect, AgentFilter, AgentOrderBy, CreateAgentInput, UpdateAgentInput, AgentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Agent, + AgentWithRelations, + AgentSelect, + AgentFilter, + AgentOrderBy, + CreateAgentInput, + UpdateAgentInput, + AgentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Agent", "agents", 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 - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Agent', + 'agents', + 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, + }, + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agents", + operation: 'query', + operationName: 'Agent', + fieldName: 'agents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Agent", "agents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Agent', + 'agents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agent", + operation: 'query', + operationName: 'Agent', + fieldName: 'agent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentModel { nodes?: InferSelectResult[]; }; }) => ({ - "agent": data.agents?.nodes?.[0] ?? null - }) + agent: data.agents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Agent", "agents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Agent', + 'agents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agent", + operation: 'query', + operationName: 'Agent', + fieldName: 'agent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentModel { nodes?: InferSelectResult[]; }; }) => ({ - "agent": data.agents?.nodes?.[0] ?? null - }) + agent: data.agents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Agent", "createAgent", "agent", args.select, args.data, "CreateAgentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Agent', + 'createAgent', + 'agent', + args.select, + args.data, + 'CreateAgentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "createAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'createAgent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Agent", "updateAgent", "agent", args.select, args.where.id, args.data, "UpdateAgentInput", "id", "agentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Agent', + 'updateAgent', + 'agent', + args.select, + args.where.id, + args.data, + 'UpdateAgentInput', + 'id', + 'agentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "updateAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'updateAgent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Agent", "deleteAgent", "agent", { - id: args.where.id - }, "DeleteAgentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Agent', + 'deleteAgent', + 'agent', + { + id: args.where.id, + }, + 'DeleteAgentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "deleteAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'deleteAgent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/agentMessage.ts b/sdk/constructive-cli/src/agent/orm/models/agentMessage.ts index 68995cfcec..ffa3a09734 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentMessage.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentMessage.ts @@ -3,56 +3,96 @@ * @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 { AgentMessage, AgentMessageWithRelations, AgentMessageSelect, AgentMessageFilter, AgentMessageOrderBy, CreateAgentMessageInput, UpdateAgentMessageInput, AgentMessagePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentMessage, + AgentMessageWithRelations, + AgentMessageSelect, + AgentMessageFilter, + AgentMessageOrderBy, + CreateAgentMessageInput, + UpdateAgentMessageInput, + AgentMessagePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentMessageModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessages: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentMessage", "agentMessages", 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 - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentMessage', + 'agentMessages', + 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, + }, + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessages", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessages', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessage: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentMessage", "agentMessages", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentMessage', + 'agentMessages', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessage", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessage', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentMessageModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentMessage": data.agentMessages?.nodes?.[0] ?? null - }) + agentMessage: data.agentMessages?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessage: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentMessage", "agentMessages", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentMessage', + 'agentMessages', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessage", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessage', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentMessageModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentMessage": data.agentMessages?.nodes?.[0] ?? null - }) + agentMessage: data.agentMessages?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentMessage", "createAgentMessage", "agentMessage", args.select, args.data, "CreateAgentMessageInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentMessage', + 'createAgentMessage', + 'agentMessage', + args.select, + args.data, + 'CreateAgentMessageInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "createAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'createAgentMessage', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentMessagePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentMessage", "updateAgentMessage", "agentMessage", args.select, args.where.id, args.data, "UpdateAgentMessageInput", "id", "agentMessagePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentMessage', + 'updateAgentMessage', + 'agentMessage', + args.select, + args.where.id, + args.data, + 'UpdateAgentMessageInput', + 'id', + 'agentMessagePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "updateAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'updateAgentMessage', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentMessage", "deleteAgentMessage", "agentMessage", { - id: args.where.id - }, "DeleteAgentMessageInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentMessage', + 'deleteAgentMessage', + 'agentMessage', + { + id: args.where.id, + }, + 'DeleteAgentMessageInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "deleteAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'deleteAgentMessage', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/agentPersona.ts b/sdk/constructive-cli/src/agent/orm/models/agentPersona.ts index 4d25d25806..1391dbde2c 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentPersona.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentPersona.ts @@ -3,56 +3,96 @@ * @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 { AgentPersona, AgentPersonaWithRelations, AgentPersonaSelect, AgentPersonaFilter, AgentPersonaOrderBy, CreateAgentPersonaInput, UpdateAgentPersonaInput, AgentPersonaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPersona, + AgentPersonaWithRelations, + AgentPersonaSelect, + AgentPersonaFilter, + AgentPersonaOrderBy, + CreateAgentPersonaInput, + UpdateAgentPersonaInput, + AgentPersonaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPersonaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersonas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPersona", "agentPersonas", 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 - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPersona', + 'agentPersonas', + 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, + }, + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersonas", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersonas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersona: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPersona", "agentPersonas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPersona', + 'agentPersonas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersona", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersona', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPersonaModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPersona": data.agentPersonas?.nodes?.[0] ?? null - }) + agentPersona: data.agentPersonas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersona: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPersona", "agentPersonas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPersona', + 'agentPersonas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersona", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersona', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPersonaModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPersona": data.agentPersonas?.nodes?.[0] ?? null - }) + agentPersona: data.agentPersonas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPersona", "createAgentPersona", "agentPersona", args.select, args.data, "CreateAgentPersonaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPersona', + 'createAgentPersona', + 'agentPersona', + args.select, + args.data, + 'CreateAgentPersonaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "createAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'createAgentPersona', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPersonaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPersona", "updateAgentPersona", "agentPersona", args.select, args.where.id, args.data, "UpdateAgentPersonaInput", "id", "agentPersonaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPersona', + 'updateAgentPersona', + 'agentPersona', + args.select, + args.where.id, + args.data, + 'UpdateAgentPersonaInput', + 'id', + 'agentPersonaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "updateAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'updateAgentPersona', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPersona", "deleteAgentPersona", "agentPersona", { - id: args.where.id - }, "DeleteAgentPersonaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPersona', + 'deleteAgentPersona', + 'agentPersona', + { + id: args.where.id, + }, + 'DeleteAgentPersonaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "deleteAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'deleteAgentPersona', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/agentPlan.ts b/sdk/constructive-cli/src/agent/orm/models/agentPlan.ts index 7c2939a364..9829718fee 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentPlan.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentPlan.ts @@ -3,56 +3,96 @@ * @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 { AgentPlan, AgentPlanWithRelations, AgentPlanSelect, AgentPlanFilter, AgentPlanOrderBy, CreateAgentPlanInput, UpdateAgentPlanInput, AgentPlanPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPlan, + AgentPlanWithRelations, + AgentPlanSelect, + AgentPlanFilter, + AgentPlanOrderBy, + CreateAgentPlanInput, + UpdateAgentPlanInput, + AgentPlanPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPlanModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlans: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPlan", "agentPlans", 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 - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPlan', + 'agentPlans', + 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, + }, + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlans", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlans', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlan: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPlan", "agentPlans", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPlan', + 'agentPlans', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlan", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlan', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPlanModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPlan": data.agentPlans?.nodes?.[0] ?? null - }) + agentPlan: data.agentPlans?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlan: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPlan", "agentPlans", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPlan', + 'agentPlans', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlan", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlan', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPlanModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPlan": data.agentPlans?.nodes?.[0] ?? null - }) + agentPlan: data.agentPlans?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPlan", "createAgentPlan", "agentPlan", args.select, args.data, "CreateAgentPlanInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPlan', + 'createAgentPlan', + 'agentPlan', + args.select, + args.data, + 'CreateAgentPlanInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "createAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'createAgentPlan', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPlanPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPlan", "updateAgentPlan", "agentPlan", args.select, args.where.id, args.data, "UpdateAgentPlanInput", "id", "agentPlanPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPlan', + 'updateAgentPlan', + 'agentPlan', + args.select, + args.where.id, + args.data, + 'UpdateAgentPlanInput', + 'id', + 'agentPlanPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "updateAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'updateAgentPlan', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPlan", "deleteAgentPlan", "agentPlan", { - id: args.where.id - }, "DeleteAgentPlanInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPlan', + 'deleteAgentPlan', + 'agentPlan', + { + id: args.where.id, + }, + 'DeleteAgentPlanInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "deleteAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'deleteAgentPlan', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/agentPrompt.ts b/sdk/constructive-cli/src/agent/orm/models/agentPrompt.ts index 7d63959a91..e301bf6c99 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentPrompt.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentPrompt.ts @@ -3,56 +3,96 @@ * @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 { AgentPrompt, AgentPromptWithRelations, AgentPromptSelect, AgentPromptFilter, AgentPromptOrderBy, CreateAgentPromptInput, UpdateAgentPromptInput, AgentPromptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPrompt, + AgentPromptWithRelations, + AgentPromptSelect, + AgentPromptFilter, + AgentPromptOrderBy, + CreateAgentPromptInput, + UpdateAgentPromptInput, + AgentPromptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPromptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompts: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPrompt", "agentPrompts", 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 - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPrompt', + 'agentPrompts', + 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, + }, + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompts", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPrompt", "agentPrompts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPrompt', + 'agentPrompts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompt", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompt', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPromptModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPrompt": data.agentPrompts?.nodes?.[0] ?? null - }) + agentPrompt: data.agentPrompts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPrompt", "agentPrompts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPrompt', + 'agentPrompts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompt", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompt', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPromptModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPrompt": data.agentPrompts?.nodes?.[0] ?? null - }) + agentPrompt: data.agentPrompts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPrompt", "createAgentPrompt", "agentPrompt", args.select, args.data, "CreateAgentPromptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPrompt', + 'createAgentPrompt', + 'agentPrompt', + args.select, + args.data, + 'CreateAgentPromptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "createAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'createAgentPrompt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPromptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPrompt", "updateAgentPrompt", "agentPrompt", args.select, args.where.id, args.data, "UpdateAgentPromptInput", "id", "agentPromptPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPrompt', + 'updateAgentPrompt', + 'agentPrompt', + args.select, + args.where.id, + args.data, + 'UpdateAgentPromptInput', + 'id', + 'agentPromptPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "updateAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'updateAgentPrompt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPrompt", "deleteAgentPrompt", "agentPrompt", { - id: args.where.id - }, "DeleteAgentPromptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPrompt', + 'deleteAgentPrompt', + 'agentPrompt', + { + id: args.where.id, + }, + 'DeleteAgentPromptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "deleteAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'deleteAgentPrompt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/agentResource.ts b/sdk/constructive-cli/src/agent/orm/models/agentResource.ts index 3dc0e3ad1e..7628b03b3c 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentResource.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentResource.ts @@ -3,56 +3,96 @@ * @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 { AgentResource, AgentResourceWithRelations, AgentResourceSelect, AgentResourceFilter, AgentResourceOrderBy, CreateAgentResourceInput, UpdateAgentResourceInput, AgentResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentResource, + AgentResourceWithRelations, + AgentResourceSelect, + AgentResourceFilter, + AgentResourceOrderBy, + CreateAgentResourceInput, + UpdateAgentResourceInput, + AgentResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResource", "agentResources", 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 - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentResource', + 'agentResources', + 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, + }, + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResources", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentResource", "agentResources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentResource', + 'agentResources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResource", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResource": data.agentResources?.nodes?.[0] ?? null - }) + agentResource: data.agentResources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResource", "agentResources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentResource', + 'agentResources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResource", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResource": data.agentResources?.nodes?.[0] ?? null - }) + agentResource: data.agentResources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentResource", "createAgentResource", "agentResource", args.select, args.data, "CreateAgentResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentResource', + 'createAgentResource', + 'agentResource', + args.select, + args.data, + 'CreateAgentResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "createAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'createAgentResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentResource", "updateAgentResource", "agentResource", args.select, args.where.id, args.data, "UpdateAgentResourceInput", "id", "agentResourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentResource', + 'updateAgentResource', + 'agentResource', + args.select, + args.where.id, + args.data, + 'UpdateAgentResourceInput', + 'id', + 'agentResourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "updateAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'updateAgentResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentResource", "deleteAgentResource", "agentResource", { - id: args.where.id - }, "DeleteAgentResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentResource', + 'deleteAgentResource', + 'agentResource', + { + id: args.where.id, + }, + 'DeleteAgentResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "deleteAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'deleteAgentResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/agentResourceChunk.ts b/sdk/constructive-cli/src/agent/orm/models/agentResourceChunk.ts index 49158ba880..fd5edf82ac 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentResourceChunk.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentResourceChunk.ts @@ -3,56 +3,96 @@ * @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 { AgentResourceChunk, AgentResourceChunkWithRelations, AgentResourceChunkSelect, AgentResourceChunkFilter, AgentResourceChunkOrderBy, CreateAgentResourceChunkInput, UpdateAgentResourceChunkInput, AgentResourceChunkPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentResourceChunk, + AgentResourceChunkWithRelations, + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy, + CreateAgentResourceChunkInput, + UpdateAgentResourceChunkInput, + AgentResourceChunkPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentResourceChunkModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResourceChunk", "agentResourceChunks", 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 - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + 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, + }, + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunks", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentResourceChunk", "agentResourceChunks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunk", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunk', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentResourceChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResourceChunk": data.agentResourceChunks?.nodes?.[0] ?? null - }) + agentResourceChunk: data.agentResourceChunks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResourceChunk", "agentResourceChunks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunk", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunk', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentResourceChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResourceChunk": data.agentResourceChunks?.nodes?.[0] ?? null - }) + agentResourceChunk: data.agentResourceChunks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentResourceChunk", "createAgentResourceChunk", "agentResourceChunk", args.select, args.data, "CreateAgentResourceChunkInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentResourceChunk', + 'createAgentResourceChunk', + 'agentResourceChunk', + args.select, + args.data, + 'CreateAgentResourceChunkInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "createAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'createAgentResourceChunk', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentResourceChunkPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentResourceChunk", "updateAgentResourceChunk", "agentResourceChunk", args.select, args.where.id, args.data, "UpdateAgentResourceChunkInput", "id", "agentResourceChunkPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentResourceChunk', + 'updateAgentResourceChunk', + 'agentResourceChunk', + args.select, + args.where.id, + args.data, + 'UpdateAgentResourceChunkInput', + 'id', + 'agentResourceChunkPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "updateAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'updateAgentResourceChunk', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentResourceChunk", "deleteAgentResourceChunk", "agentResourceChunk", { - id: args.where.id - }, "DeleteAgentResourceChunkInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentResourceChunk', + 'deleteAgentResourceChunk', + 'agentResourceChunk', + { + id: args.where.id, + }, + 'DeleteAgentResourceChunkInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "deleteAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'deleteAgentResourceChunk', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/agentTask.ts b/sdk/constructive-cli/src/agent/orm/models/agentTask.ts index 6eabf7f118..a4b3a1e367 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentTask.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentTask.ts @@ -3,56 +3,96 @@ * @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 { AgentTask, AgentTaskWithRelations, AgentTaskSelect, AgentTaskFilter, AgentTaskOrderBy, CreateAgentTaskInput, UpdateAgentTaskInput, AgentTaskPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentTask, + AgentTaskWithRelations, + AgentTaskSelect, + AgentTaskFilter, + AgentTaskOrderBy, + CreateAgentTaskInput, + UpdateAgentTaskInput, + AgentTaskPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentTaskModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTasks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentTask", "agentTasks", 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 - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentTask', + 'agentTasks', + 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, + }, + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTasks", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTasks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTask: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentTask", "agentTasks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentTask', + 'agentTasks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTask", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTask', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentTaskModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentTask": data.agentTasks?.nodes?.[0] ?? null - }) + agentTask: data.agentTasks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTask: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentTask", "agentTasks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentTask', + 'agentTasks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTask", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTask', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentTaskModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentTask": data.agentTasks?.nodes?.[0] ?? null - }) + agentTask: data.agentTasks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentTask", "createAgentTask", "agentTask", args.select, args.data, "CreateAgentTaskInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentTask', + 'createAgentTask', + 'agentTask', + args.select, + args.data, + 'CreateAgentTaskInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "createAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'createAgentTask', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentTaskPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentTask", "updateAgentTask", "agentTask", args.select, args.where.id, args.data, "UpdateAgentTaskInput", "id", "agentTaskPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentTask', + 'updateAgentTask', + 'agentTask', + args.select, + args.where.id, + args.data, + 'UpdateAgentTaskInput', + 'id', + 'agentTaskPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "updateAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'updateAgentTask', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentTask", "deleteAgentTask", "agentTask", { - id: args.where.id - }, "DeleteAgentTaskInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentTask', + 'deleteAgentTask', + 'agentTask', + { + id: args.where.id, + }, + 'DeleteAgentTaskInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "deleteAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'deleteAgentTask', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/agentThread.ts b/sdk/constructive-cli/src/agent/orm/models/agentThread.ts index 6f1a410252..1ae2eb5a67 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentThread.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentThread.ts @@ -3,56 +3,96 @@ * @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 { AgentThread, AgentThreadWithRelations, AgentThreadSelect, AgentThreadFilter, AgentThreadOrderBy, CreateAgentThreadInput, UpdateAgentThreadInput, AgentThreadPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentThread, + AgentThreadWithRelations, + AgentThreadSelect, + AgentThreadFilter, + AgentThreadOrderBy, + CreateAgentThreadInput, + UpdateAgentThreadInput, + AgentThreadPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentThreadModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThreads: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentThread", "agentThreads", 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 - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentThread', + 'agentThreads', + 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, + }, + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThreads", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThreads', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThread: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentThread", "agentThreads", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentThread', + 'agentThreads', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThread", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThread', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentThreadModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentThread": data.agentThreads?.nodes?.[0] ?? null - }) + agentThread: data.agentThreads?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThread: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentThread", "agentThreads", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentThread', + 'agentThreads', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThread", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThread', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentThreadModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentThread": data.agentThreads?.nodes?.[0] ?? null - }) + agentThread: data.agentThreads?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentThread", "createAgentThread", "agentThread", args.select, args.data, "CreateAgentThreadInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentThread', + 'createAgentThread', + 'agentThread', + args.select, + args.data, + 'CreateAgentThreadInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "createAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'createAgentThread', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentThreadPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentThread", "updateAgentThread", "agentThread", args.select, args.where.id, args.data, "UpdateAgentThreadInput", "id", "agentThreadPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentThread', + 'updateAgentThread', + 'agentThread', + args.select, + args.where.id, + args.data, + 'UpdateAgentThreadInput', + 'id', + 'agentThreadPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "updateAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'updateAgentThread', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentThread", "deleteAgentThread", "agentThread", { - id: args.where.id - }, "DeleteAgentThreadInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentThread', + 'deleteAgentThread', + 'agentThread', + { + id: args.where.id, + }, + 'DeleteAgentThreadInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "deleteAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'deleteAgentThread', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/models/index.ts b/sdk/constructive-cli/src/agent/orm/models/index.ts index b0397fe3ec..4d02471c8a 100644 --- a/sdk/constructive-cli/src/agent/orm/models/index.ts +++ b/sdk/constructive-cli/src/agent/orm/models/index.ts @@ -3,12 +3,12 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AgentModel } from "./agent"; -export { AgentMessageModel } from "./agentMessage"; -export { AgentPersonaModel } from "./agentPersona"; -export { AgentPlanModel } from "./agentPlan"; -export { AgentPromptModel } from "./agentPrompt"; -export { AgentResourceChunkModel } from "./agentResourceChunk"; -export { AgentResourceModel } from "./agentResource"; -export { AgentTaskModel } from "./agentTask"; -export { AgentThreadModel } from "./agentThread"; \ No newline at end of file +export { AgentModel } from './agent'; +export { AgentMessageModel } from './agentMessage'; +export { AgentPersonaModel } from './agentPersona'; +export { AgentPlanModel } from './agentPlan'; +export { AgentPromptModel } from './agentPrompt'; +export { AgentResourceChunkModel } from './agentResourceChunk'; +export { AgentResourceModel } from './agentResource'; +export { AgentTaskModel } from './agentTask'; +export { AgentThreadModel } from './agentThread'; diff --git a/sdk/constructive-cli/src/agent/orm/mutation/index.ts b/sdk/constructive-cli/src/agent/orm/mutation/index.ts index 1e981b094d..989afbcbd6 100644 --- a/sdk/constructive-cli/src/agent/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/agent/orm/mutation/index.ts @@ -3,11 +3,15 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, ProvisionBucketPayload, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + ProvisionBucketPayload, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -20,19 +24,34 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/agent/orm/query-builder.ts b/sdk/constructive-cli/src/agent/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/agent/orm/query-builder.ts +++ b/sdk/constructive-cli/src/agent/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/agent/orm/realtime.ts b/sdk/constructive-cli/src/agent/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/agent/orm/realtime.ts +++ b/sdk/constructive-cli/src/agent/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/agent/orm/select-types.ts b/sdk/constructive-cli/src/agent/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/agent/orm/select-types.ts +++ b/sdk/constructive-cli/src/agent/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/api/cli/commands.ts b/sdk/constructive-cli/src/api/cli/commands.ts index 51b9e90400..04049c5fcb 100644 --- a/sdk/constructive-cli/src/api/cli/commands.ts +++ b/sdk/constructive-cli/src/api/cli/commands.ts @@ -3,183 +3,194 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import apiCmd from "./commands/api"; -import apiModuleCmd from "./commands/api-module"; -import apiSchemaCmd from "./commands/api-schema"; -import apiSettingCmd from "./commands/api-setting"; -import astMigrationCmd from "./commands/ast-migration"; -import checkConstraintCmd from "./commands/check-constraint"; -import compositeTypeCmd from "./commands/composite-type"; -import corsSettingCmd from "./commands/cors-setting"; -import databaseCmd from "./commands/database"; -import databaseSettingCmd from "./commands/database-setting"; -import databaseTransferCmd from "./commands/database-transfer"; -import defaultPrivilegeCmd from "./commands/default-privilege"; -import domainCmd from "./commands/domain"; -import domainEventCmd from "./commands/domain-event"; -import domainVerificationCmd from "./commands/domain-verification"; -import embeddingChunkCmd from "./commands/embedding-chunk"; -import enumCmd from "./commands/enum"; -import exclusionConstraintCmd from "./commands/exclusion-constraint"; -import fieldCmd from "./commands/field"; -import foreignKeyConstraintCmd from "./commands/foreign-key-constraint"; -import fullTextSearchCmd from "./commands/full-text-search"; -import functionCmd from "./commands/function"; -import hostnameBindingCmd from "./commands/hostname-binding"; -import httpRouteCmd from "./commands/http-route"; -import indexCmd from "./commands/index"; -import managedDomainCmd from "./commands/managed-domain"; -import nodeTypeRegistryCmd from "./commands/node-type-registry"; -import partitionCmd from "./commands/partition"; -import platformApiCmd from "./commands/platform-api"; -import platformApiModuleCmd from "./commands/platform-api-module"; -import platformApiSchemaCmd from "./commands/platform-api-schema"; -import platformApiSettingCmd from "./commands/platform-api-setting"; -import platformCorsSettingCmd from "./commands/platform-cors-setting"; -import platformDomainCmd from "./commands/platform-domain"; -import platformDomainEventCmd from "./commands/platform-domain-event"; -import platformDomainVerificationCmd from "./commands/platform-domain-verification"; -import platformManagedDomainCmd from "./commands/platform-managed-domain"; -import platformSiteCmd from "./commands/platform-site"; -import platformSiteMetadatumCmd from "./commands/platform-site-metadatum"; -import platformSiteModuleCmd from "./commands/platform-site-module"; -import platformSiteThemeCmd from "./commands/platform-site-theme"; -import policyCmd from "./commands/policy"; -import primaryKeyConstraintCmd from "./commands/primary-key-constraint"; -import pubkeySettingCmd from "./commands/pubkey-setting"; -import rlsSettingCmd from "./commands/rls-setting"; -import routeBindingCmd from "./commands/route-binding"; -import routeCmd from "./commands/route"; -import schemaCmd from "./commands/schema"; -import schemaGrantCmd from "./commands/schema-grant"; -import siteCmd from "./commands/site"; -import siteMetadatumCmd from "./commands/site-metadatum"; -import siteModuleCmd from "./commands/site-module"; -import siteThemeCmd from "./commands/site-theme"; -import spatialRelationCmd from "./commands/spatial-relation"; -import sqlActionCmd from "./commands/sql-action"; -import tableCmd from "./commands/table"; -import tableGrantCmd from "./commands/table-grant"; -import triggerCmd from "./commands/trigger"; -import triggerFunctionCmd from "./commands/trigger-function"; -import uniqueConstraintCmd from "./commands/unique-constraint"; -import viewCmd from "./commands/view"; -import viewGrantCmd from "./commands/view-grant"; -import viewRuleCmd from "./commands/view-rule"; -import viewTableCmd from "./commands/view-table"; -import webauthnSettingCmd from "./commands/webauthn-setting"; -import apiSchemaNamesCmd from "./commands/api-schema-names"; -import applyRegistryDefaultsCmd from "./commands/apply-registry-defaults"; -import resolveHttpRouteCmd from "./commands/resolve-http-route"; -import resolveRouteCmd from "./commands/resolve-route"; -import acceptDatabaseTransferCmd from "./commands/accept-database-transfer"; -import applyRlsCmd from "./commands/apply-rls"; -import cancelDatabaseTransferCmd from "./commands/cancel-database-transfer"; -import provisionBucketCmd from "./commands/provision-bucket"; -import rejectDatabaseTransferCmd from "./commands/reject-database-transfer"; -import requestDatabaseCmd from "./commands/request-database"; -import setFieldOrderCmd from "./commands/set-field-order"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "api": apiCmd, - "api-module": apiModuleCmd, - "api-schema": apiSchemaCmd, - "api-setting": apiSettingCmd, - "ast-migration": astMigrationCmd, - "check-constraint": checkConstraintCmd, - "composite-type": compositeTypeCmd, - "cors-setting": corsSettingCmd, - "database": databaseCmd, - "database-setting": databaseSettingCmd, - "database-transfer": databaseTransferCmd, - "default-privilege": defaultPrivilegeCmd, - "domain": domainCmd, - "domain-event": domainEventCmd, - "domain-verification": domainVerificationCmd, - "embedding-chunk": embeddingChunkCmd, - "enum": enumCmd, - "exclusion-constraint": exclusionConstraintCmd, - "field": fieldCmd, - "foreign-key-constraint": foreignKeyConstraintCmd, - "full-text-search": fullTextSearchCmd, - "function": functionCmd, - "hostname-binding": hostnameBindingCmd, - "http-route": httpRouteCmd, - "index": indexCmd, - "managed-domain": managedDomainCmd, - "node-type-registry": nodeTypeRegistryCmd, - "partition": partitionCmd, - "platform-api": platformApiCmd, - "platform-api-module": platformApiModuleCmd, - "platform-api-schema": platformApiSchemaCmd, - "platform-api-setting": platformApiSettingCmd, - "platform-cors-setting": platformCorsSettingCmd, - "platform-domain": platformDomainCmd, - "platform-domain-event": platformDomainEventCmd, - "platform-domain-verification": platformDomainVerificationCmd, - "platform-managed-domain": platformManagedDomainCmd, - "platform-site": platformSiteCmd, - "platform-site-metadatum": platformSiteMetadatumCmd, - "platform-site-module": platformSiteModuleCmd, - "platform-site-theme": platformSiteThemeCmd, - "policy": policyCmd, - "primary-key-constraint": primaryKeyConstraintCmd, - "pubkey-setting": pubkeySettingCmd, - "rls-setting": rlsSettingCmd, - "route-binding": routeBindingCmd, - "route": routeCmd, - "schema": schemaCmd, - "schema-grant": schemaGrantCmd, - "site": siteCmd, - "site-metadatum": siteMetadatumCmd, - "site-module": siteModuleCmd, - "site-theme": siteThemeCmd, - "spatial-relation": spatialRelationCmd, - "sql-action": sqlActionCmd, - "table": tableCmd, - "table-grant": tableGrantCmd, - "trigger": triggerCmd, - "trigger-function": triggerFunctionCmd, - "unique-constraint": uniqueConstraintCmd, - "view": viewCmd, - "view-grant": viewGrantCmd, - "view-rule": viewRuleCmd, - "view-table": viewTableCmd, - "webauthn-setting": webauthnSettingCmd, - "api-schema-names": apiSchemaNamesCmd, - "apply-registry-defaults": applyRegistryDefaultsCmd, - "resolve-http-route": resolveHttpRouteCmd, - "resolve-route": resolveRouteCmd, - "accept-database-transfer": acceptDatabaseTransferCmd, - "apply-rls": applyRlsCmd, - "cancel-database-transfer": cancelDatabaseTransferCmd, - "provision-bucket": provisionBucketCmd, - "reject-database-transfer": rejectDatabaseTransferCmd, - "request-database": requestDatabaseCmd, - "set-field-order": setFieldOrderCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import apiCmd from './commands/api'; +import apiModuleCmd from './commands/api-module'; +import apiSchemaCmd from './commands/api-schema'; +import apiSettingCmd from './commands/api-setting'; +import astMigrationCmd from './commands/ast-migration'; +import checkConstraintCmd from './commands/check-constraint'; +import compositeTypeCmd from './commands/composite-type'; +import corsSettingCmd from './commands/cors-setting'; +import databaseCmd from './commands/database'; +import databaseSettingCmd from './commands/database-setting'; +import databaseTransferCmd from './commands/database-transfer'; +import defaultPrivilegeCmd from './commands/default-privilege'; +import domainCmd from './commands/domain'; +import domainEventCmd from './commands/domain-event'; +import domainVerificationCmd from './commands/domain-verification'; +import embeddingChunkCmd from './commands/embedding-chunk'; +import enumCmd from './commands/enum'; +import exclusionConstraintCmd from './commands/exclusion-constraint'; +import fieldCmd from './commands/field'; +import foreignKeyConstraintCmd from './commands/foreign-key-constraint'; +import fullTextSearchCmd from './commands/full-text-search'; +import functionCmd from './commands/function'; +import hostnameBindingCmd from './commands/hostname-binding'; +import httpRouteCmd from './commands/http-route'; +import indexCmd from './commands/index'; +import managedDomainCmd from './commands/managed-domain'; +import nodeTypeRegistryCmd from './commands/node-type-registry'; +import partitionCmd from './commands/partition'; +import platformApiCmd from './commands/platform-api'; +import platformApiModuleCmd from './commands/platform-api-module'; +import platformApiSchemaCmd from './commands/platform-api-schema'; +import platformApiSettingCmd from './commands/platform-api-setting'; +import platformCorsSettingCmd from './commands/platform-cors-setting'; +import platformDomainCmd from './commands/platform-domain'; +import platformDomainEventCmd from './commands/platform-domain-event'; +import platformDomainVerificationCmd from './commands/platform-domain-verification'; +import platformManagedDomainCmd from './commands/platform-managed-domain'; +import platformSiteCmd from './commands/platform-site'; +import platformSiteMetadatumCmd from './commands/platform-site-metadatum'; +import platformSiteModuleCmd from './commands/platform-site-module'; +import platformSiteThemeCmd from './commands/platform-site-theme'; +import policyCmd from './commands/policy'; +import primaryKeyConstraintCmd from './commands/primary-key-constraint'; +import pubkeySettingCmd from './commands/pubkey-setting'; +import rlsSettingCmd from './commands/rls-setting'; +import routeBindingCmd from './commands/route-binding'; +import routeCmd from './commands/route'; +import schemaCmd from './commands/schema'; +import schemaGrantCmd from './commands/schema-grant'; +import siteCmd from './commands/site'; +import siteMetadatumCmd from './commands/site-metadatum'; +import siteModuleCmd from './commands/site-module'; +import siteThemeCmd from './commands/site-theme'; +import spatialRelationCmd from './commands/spatial-relation'; +import sqlActionCmd from './commands/sql-action'; +import tableCmd from './commands/table'; +import tableGrantCmd from './commands/table-grant'; +import triggerCmd from './commands/trigger'; +import triggerFunctionCmd from './commands/trigger-function'; +import uniqueConstraintCmd from './commands/unique-constraint'; +import viewCmd from './commands/view'; +import viewGrantCmd from './commands/view-grant'; +import viewRuleCmd from './commands/view-rule'; +import viewTableCmd from './commands/view-table'; +import webauthnSettingCmd from './commands/webauthn-setting'; +import apiSchemaNamesCmd from './commands/api-schema-names'; +import applyRegistryDefaultsCmd from './commands/apply-registry-defaults'; +import resolveHttpRouteCmd from './commands/resolve-http-route'; +import resolveRouteCmd from './commands/resolve-route'; +import acceptDatabaseTransferCmd from './commands/accept-database-transfer'; +import applyRlsCmd from './commands/apply-rls'; +import cancelDatabaseTransferCmd from './commands/cancel-database-transfer'; +import provisionBucketCmd from './commands/provision-bucket'; +import rejectDatabaseTransferCmd from './commands/reject-database-transfer'; +import requestDatabaseCmd from './commands/request-database'; +import setFieldOrderCmd from './commands/set-field-order'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + api: apiCmd, + 'api-module': apiModuleCmd, + 'api-schema': apiSchemaCmd, + 'api-setting': apiSettingCmd, + 'ast-migration': astMigrationCmd, + 'check-constraint': checkConstraintCmd, + 'composite-type': compositeTypeCmd, + 'cors-setting': corsSettingCmd, + database: databaseCmd, + 'database-setting': databaseSettingCmd, + 'database-transfer': databaseTransferCmd, + 'default-privilege': defaultPrivilegeCmd, + domain: domainCmd, + 'domain-event': domainEventCmd, + 'domain-verification': domainVerificationCmd, + 'embedding-chunk': embeddingChunkCmd, + enum: enumCmd, + 'exclusion-constraint': exclusionConstraintCmd, + field: fieldCmd, + 'foreign-key-constraint': foreignKeyConstraintCmd, + 'full-text-search': fullTextSearchCmd, + function: functionCmd, + 'hostname-binding': hostnameBindingCmd, + 'http-route': httpRouteCmd, + index: indexCmd, + 'managed-domain': managedDomainCmd, + 'node-type-registry': nodeTypeRegistryCmd, + partition: partitionCmd, + 'platform-api': platformApiCmd, + 'platform-api-module': platformApiModuleCmd, + 'platform-api-schema': platformApiSchemaCmd, + 'platform-api-setting': platformApiSettingCmd, + 'platform-cors-setting': platformCorsSettingCmd, + 'platform-domain': platformDomainCmd, + 'platform-domain-event': platformDomainEventCmd, + 'platform-domain-verification': platformDomainVerificationCmd, + 'platform-managed-domain': platformManagedDomainCmd, + 'platform-site': platformSiteCmd, + 'platform-site-metadatum': platformSiteMetadatumCmd, + 'platform-site-module': platformSiteModuleCmd, + 'platform-site-theme': platformSiteThemeCmd, + policy: policyCmd, + 'primary-key-constraint': primaryKeyConstraintCmd, + 'pubkey-setting': pubkeySettingCmd, + 'rls-setting': rlsSettingCmd, + 'route-binding': routeBindingCmd, + route: routeCmd, + schema: schemaCmd, + 'schema-grant': schemaGrantCmd, + site: siteCmd, + 'site-metadatum': siteMetadatumCmd, + 'site-module': siteModuleCmd, + 'site-theme': siteThemeCmd, + 'spatial-relation': spatialRelationCmd, + 'sql-action': sqlActionCmd, + table: tableCmd, + 'table-grant': tableGrantCmd, + trigger: triggerCmd, + 'trigger-function': triggerFunctionCmd, + 'unique-constraint': uniqueConstraintCmd, + view: viewCmd, + 'view-grant': viewGrantCmd, + 'view-rule': viewRuleCmd, + 'view-table': viewTableCmd, + 'webauthn-setting': webauthnSettingCmd, + 'api-schema-names': apiSchemaNamesCmd, + 'apply-registry-defaults': applyRegistryDefaultsCmd, + 'resolve-http-route': resolveHttpRouteCmd, + 'resolve-route': resolveRouteCmd, + 'accept-database-transfer': acceptDatabaseTransferCmd, + 'apply-rls': applyRlsCmd, + 'cancel-database-transfer': cancelDatabaseTransferCmd, + 'provision-bucket': provisionBucketCmd, + 'reject-database-transfer': rejectDatabaseTransferCmd, + 'request-database': requestDatabaseCmd, + 'set-field-order': setFieldOrderCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n api api CRUD operations\n api-module apiModule CRUD operations\n api-schema apiSchema CRUD operations\n api-setting apiSetting CRUD operations\n ast-migration astMigration CRUD operations\n check-constraint checkConstraint CRUD operations\n composite-type compositeType CRUD operations\n cors-setting corsSetting CRUD operations\n database database CRUD operations\n database-setting databaseSetting CRUD operations\n database-transfer databaseTransfer CRUD operations\n default-privilege defaultPrivilege CRUD operations\n domain domain CRUD operations\n domain-event domainEvent CRUD operations\n domain-verification domainVerification CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n enum enum CRUD operations\n exclusion-constraint exclusionConstraint CRUD operations\n field field CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n function function CRUD operations\n hostname-binding hostnameBinding CRUD operations\n http-route httpRoute CRUD operations\n index index CRUD operations\n managed-domain managedDomain CRUD operations\n node-type-registry nodeTypeRegistry CRUD operations\n partition partition CRUD operations\n platform-api platformApi CRUD operations\n platform-api-module platformApiModule CRUD operations\n platform-api-schema platformApiSchema CRUD operations\n platform-api-setting platformApiSetting CRUD operations\n platform-cors-setting platformCorsSetting CRUD operations\n platform-domain platformDomain CRUD operations\n platform-domain-event platformDomainEvent CRUD operations\n platform-domain-verification platformDomainVerification CRUD operations\n platform-managed-domain platformManagedDomain CRUD operations\n platform-site platformSite CRUD operations\n platform-site-metadatum platformSiteMetadatum CRUD operations\n platform-site-module platformSiteModule CRUD operations\n platform-site-theme platformSiteTheme CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n pubkey-setting pubkeySetting CRUD operations\n rls-setting rlsSetting CRUD operations\n route-binding routeBinding CRUD operations\n route route CRUD operations\n schema schema CRUD operations\n schema-grant schemaGrant CRUD operations\n site site CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n spatial-relation spatialRelation CRUD operations\n sql-action sqlAction CRUD operations\n table table CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n trigger-function triggerFunction CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n view-table viewTable CRUD operations\n webauthn-setting webauthnSetting CRUD operations\n api-schema-names apiSchemaNames\n apply-registry-defaults applyRegistryDefaults\n resolve-http-route resolveHttpRoute\n resolve-route resolveRoute\n accept-database-transfer acceptDatabaseTransfer\n apply-rls applyRls\n cancel-database-transfer cancelDatabaseTransfer\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 reject-database-transfer rejectDatabaseTransfer\n request-database Requests a database and returns a ticket (database_provision_module row) to poll.\n\nPass exactly one of preset_slug or modules. The pool, presets, and owner bootstrap are private implementation details: a warm pool hit fulfills the ticket immediately (fulfilled_at set, deferred owner bootstrap), otherwise the database is cold-provisioned asynchronously with exactly the requested modules. Poll the ticket until status = 'completed'; it then carries database_id and fulfilled_at.\n\nExample usage:\n SELECT * FROM metaschema_public.request_database('my_app', 'example.com', preset_slug := 'full');\n SELECT * FROM metaschema_public.request_database('my_app', 'example.com', modules := '[\"users_module\", \"emails_module\"]'::jsonb);\n set-field-order setFieldOrder\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n api api CRUD operations\n api-module apiModule CRUD operations\n api-schema apiSchema CRUD operations\n api-setting apiSetting CRUD operations\n ast-migration astMigration CRUD operations\n check-constraint checkConstraint CRUD operations\n composite-type compositeType CRUD operations\n cors-setting corsSetting CRUD operations\n database database CRUD operations\n database-setting databaseSetting CRUD operations\n database-transfer databaseTransfer CRUD operations\n default-privilege defaultPrivilege CRUD operations\n domain domain CRUD operations\n domain-event domainEvent CRUD operations\n domain-verification domainVerification CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n enum enum CRUD operations\n exclusion-constraint exclusionConstraint CRUD operations\n field field CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n function function CRUD operations\n hostname-binding hostnameBinding CRUD operations\n http-route httpRoute CRUD operations\n index index CRUD operations\n managed-domain managedDomain CRUD operations\n node-type-registry nodeTypeRegistry CRUD operations\n partition partition CRUD operations\n platform-api platformApi CRUD operations\n platform-api-module platformApiModule CRUD operations\n platform-api-schema platformApiSchema CRUD operations\n platform-api-setting platformApiSetting CRUD operations\n platform-cors-setting platformCorsSetting CRUD operations\n platform-domain platformDomain CRUD operations\n platform-domain-event platformDomainEvent CRUD operations\n platform-domain-verification platformDomainVerification CRUD operations\n platform-managed-domain platformManagedDomain CRUD operations\n platform-site platformSite CRUD operations\n platform-site-metadatum platformSiteMetadatum CRUD operations\n platform-site-module platformSiteModule CRUD operations\n platform-site-theme platformSiteTheme CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n pubkey-setting pubkeySetting CRUD operations\n rls-setting rlsSetting CRUD operations\n route-binding routeBinding CRUD operations\n route route CRUD operations\n schema schema CRUD operations\n schema-grant schemaGrant CRUD operations\n site site CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n spatial-relation spatialRelation CRUD operations\n sql-action sqlAction CRUD operations\n table table CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n trigger-function triggerFunction CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n view-table viewTable CRUD operations\n webauthn-setting webauthnSetting CRUD operations\n api-schema-names apiSchemaNames\n apply-registry-defaults applyRegistryDefaults\n resolve-http-route resolveHttpRoute\n resolve-route resolveRoute\n accept-database-transfer acceptDatabaseTransfer\n apply-rls applyRls\n cancel-database-transfer cancelDatabaseTransfer\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 reject-database-transfer rejectDatabaseTransfer\n request-database Requests a database and returns a ticket (database_provision_module row) to poll.\n\nPass exactly one of preset_slug or modules. The pool, presets, and owner bootstrap are private implementation details: a warm pool hit fulfills the ticket immediately (fulfilled_at set, deferred owner bootstrap), otherwise the database is cold-provisioned asynchronously with exactly the requested modules. Poll the ticket until status = 'completed'; it then carries database_id and fulfilled_at.\n\nExample usage:\n SELECT * FROM metaschema_public.request_database('my_app', 'example.com', preset_slug := 'full');\n SELECT * FROM metaschema_public.request_database('my_app', 'example.com', modules := '[\"users_module\", \"emails_module\"]'::jsonb);\n set-field-order setFieldOrder\n\n --help, -h Show this help message\n --version, -v Show version\n"; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -191,4 +202,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/accept-database-transfer.ts b/sdk/constructive-cli/src/api/cli/commands/accept-database-transfer.ts index 2f1d8de685..3ebc01d25e 100644 --- a/sdk/constructive-cli/src/api/cli/commands/accept-database-transfer.ts +++ b/sdk/constructive-cli/src/api/cli/commands/accept-database-transfer.ts @@ -3,37 +3,51 @@ * @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 { AcceptDatabaseTransferVariables } from "../../orm/mutation"; -import type { AcceptDatabaseTransferPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AcceptDatabaseTransferVariables } from '../../orm/mutation'; +import type { AcceptDatabaseTransferPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("accept-database-transfer - acceptDatabaseTransfer\n\nUsage: accept-database-transfer [OPTIONS]\n"); + console.log( + 'accept-database-transfer - acceptDatabaseTransfer\n\nUsage: accept-database-transfer [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 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.acceptDatabaseTransfer(parsedAnswers as unknown as AcceptDatabaseTransferVariables, { - select: selectFields - } as unknown as { - select: AcceptDatabaseTransferPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .acceptDatabaseTransfer( + parsedAnswers as unknown as AcceptDatabaseTransferVariables, + { + select: selectFields, + } as unknown as { + select: AcceptDatabaseTransferPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: acceptDatabaseTransfer"); + console.error('Failed: acceptDatabaseTransfer'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/api-module.ts b/sdk/constructive-cli/src/api/cli/commands/api-module.ts index db6c85da11..0cf5f21ee1 100644 --- a/sdk/constructive-cli/src/api/cli/commands/api-module.ts +++ b/sdk/constructive-cli/src/api/cli/commands/api-module.ts @@ -3,55 +3,69 @@ * @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 { CreateApiModuleInput, ApiModulePatch, ApiModuleSelect, ApiModuleFilter, ApiModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateApiModuleInput, + ApiModulePatch, + ApiModuleSelect, + ApiModuleFilter, + ApiModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiId: "uuid", - createdAt: "string", - data: "json", - databaseId: "uuid", - id: "uuid", - name: "string", - updatedAt: "string" + apiId: 'uuid', + createdAt: 'string', + data: 'json', + databaseId: 'uuid', + id: 'uuid', + name: 'string', + updatedAt: 'string', }; -const usage = "\napi-module \n\nCommands:\n list List apiModule records\n find-first Find first matching apiModule record\n get Get a apiModule by ID\n create Create a new apiModule\n update Update an existing apiModule\n delete Delete a apiModule\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) => { +const usage = + '\napi-module \n\nCommands:\n list List apiModule records\n find-first Find first matching apiModule record\n get Get a apiModule by ID\n create Create a new apiModule\n update Update an existing apiModule\n delete Delete a apiModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, name: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: ApiModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ApiModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.apiModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, name: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ApiModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ApiModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.apiModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.apiModule.findOne({ - id: answers.id as string, - select: { - apiId: true, - createdAt: true, - data: true, - databaseId: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.apiModule + .findOne({ + id: answers.id as string, + select: { + apiId: true, + createdAt: true, + data: true, + databaseId: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,50 +162,57 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiId", - message: "apiId", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiModuleInput["apiModule"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiModuleInput['apiModule']; const client = getClient(); - const result = await client.apiModule.create({ - data: { - apiId: cleanedData.apiId, - data: cleanedData.data, - databaseId: cleanedData.databaseId, - name: cleanedData.name - }, - select: { - apiId: true, - createdAt: true, - data: true, - databaseId: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.apiModule + .create({ + data: { + apiId: cleanedData.apiId, + data: cleanedData.data, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + }, + select: { + apiId: true, + createdAt: true, + data: true, + databaseId: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -192,58 +221,66 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiId", - message: "apiId", - required: false - }, { - type: "json", - name: "data", - message: "data", - required: false - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ApiModulePatch; const client = getClient(); - const result = await client.apiModule.update({ - where: { - id: answers.id as string - }, - data: { - apiId: cleanedData.apiId, - data: cleanedData.data, - databaseId: cleanedData.databaseId, - name: cleanedData.name - }, - select: { - apiId: true, - createdAt: true, - data: true, - databaseId: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.apiModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiId: cleanedData.apiId, + data: cleanedData.data, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + }, + select: { + apiId: true, + createdAt: true, + data: true, + databaseId: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -252,28 +289,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.apiModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.apiModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/api-schema-names.ts b/sdk/constructive-cli/src/api/cli/commands/api-schema-names.ts index d7952db7a7..5ab8637bb6 100644 --- a/sdk/constructive-cli/src/api/cli/commands/api-schema-names.ts +++ b/sdk/constructive-cli/src/api/cli/commands/api-schema-names.ts @@ -3,28 +3,36 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { ApiSchemaNamesVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { ApiSchemaNamesVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("api-schema-names - apiSchemaNames\n\nUsage: api-schema-names [OPTIONS]\n"); + console.log('api-schema-names - apiSchemaNames\n\nUsage: api-schema-names [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "targetApiId", - message: "targetApiId" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'targetApiId', + message: 'targetApiId', + }, + ]); const client = getClient(); - const result = await client.query.apiSchemaNames(answers as unknown as ApiSchemaNamesVariables).execute(); + const result = await client.query + .apiSchemaNames(answers as unknown as ApiSchemaNamesVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: apiSchemaNames"); + console.error('Failed: apiSchemaNames'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/api-schema.ts b/sdk/constructive-cli/src/api/cli/commands/api-schema.ts index 420168ca60..a2413dc4fd 100644 --- a/sdk/constructive-cli/src/api/cli/commands/api-schema.ts +++ b/sdk/constructive-cli/src/api/cli/commands/api-schema.ts @@ -3,54 +3,68 @@ * @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 { CreateApiSchemaInput, ApiSchemaPatch, ApiSchemaSelect, ApiSchemaFilter, ApiSchemaOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateApiSchemaInput, + ApiSchemaPatch, + ApiSchemaSelect, + ApiSchemaFilter, + ApiSchemaOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiId: "uuid", - createdAt: "string", - databaseId: "uuid", - id: "uuid", - schemaId: "uuid", - updatedAt: "string" + apiId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + schemaId: 'uuid', + updatedAt: 'string', }; -const usage = "\napi-schema \n\nCommands:\n list List apiSchema records\n find-first Find first matching apiSchema record\n get Get a apiSchema by ID\n create Create a new apiSchema\n update Update an existing apiSchema\n delete Delete a apiSchema\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) => { +const usage = + '\napi-schema \n\nCommands:\n list List apiSchema records\n find-first Find first matching apiSchema record\n get Get a apiSchema by ID\n create Create a new apiSchema\n update Update an existing apiSchema\n delete Delete a apiSchema\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, schemaId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: ApiSchemaSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ApiSchemaSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.apiSchema.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, schemaId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ApiSchemaSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ApiSchemaSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.apiSchema.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.apiSchema.findOne({ - id: answers.id as string, - select: { - apiId: true, - createdAt: true, - databaseId: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.apiSchema + .findOne({ + id: answers.id as string, + select: { + apiId: true, + createdAt: true, + databaseId: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,43 +158,49 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiId", - message: "apiId", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiSchemaInput["apiSchema"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiSchemaInput['apiSchema']; const client = getClient(); - const result = await client.apiSchema.create({ - data: { - apiId: cleanedData.apiId, - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId - }, - select: { - apiId: true, - createdAt: true, - databaseId: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.apiSchema + .create({ + data: { + apiId: cleanedData.apiId, + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + }, + select: { + apiId: true, + createdAt: true, + databaseId: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -181,51 +209,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiId", - message: "apiId", - required: false - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ApiSchemaPatch; const client = getClient(); - const result = await client.apiSchema.update({ - where: { - id: answers.id as string - }, - data: { - apiId: cleanedData.apiId, - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId - }, - select: { - apiId: true, - createdAt: true, - databaseId: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.apiSchema + .update({ + where: { + id: answers.id as string, + }, + data: { + apiId: cleanedData.apiId, + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + }, + select: { + apiId: true, + createdAt: true, + databaseId: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -234,28 +269,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.apiSchema.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.apiSchema + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/api-setting.ts b/sdk/constructive-cli/src/api/cli/commands/api-setting.ts index fed59c368a..4d9d62e84a 100644 --- a/sdk/constructive-cli/src/api/cli/commands/api-setting.ts +++ b/sdk/constructive-cli/src/api/cli/commands/api-setting.ts @@ -3,66 +3,80 @@ * @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 { CreateApiSettingInput, ApiSettingPatch, ApiSettingSelect, ApiSettingFilter, ApiSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateApiSettingInput, + ApiSettingPatch, + ApiSettingSelect, + ApiSettingFilter, + ApiSettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiId: "uuid", - createdAt: "string", - databaseId: "uuid", - enableAggregates: "boolean", - enableBulk: "boolean", - enableConnectionFilter: "boolean", - enableDirectUploads: "boolean", - enableI18N: "boolean", - enableLlm: "boolean", - enableLtree: "boolean", - enableManyToMany: "boolean", - enablePostgis: "boolean", - enablePresignedUploads: "boolean", - enableRealtime: "boolean", - enableSearch: "boolean", - id: "uuid", - options: "json", - updatedAt: "string" + apiId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + enableAggregates: 'boolean', + enableBulk: 'boolean', + enableConnectionFilter: 'boolean', + enableDirectUploads: 'boolean', + enableI18N: 'boolean', + enableLlm: 'boolean', + enableLtree: 'boolean', + enableManyToMany: 'boolean', + enablePostgis: 'boolean', + enablePresignedUploads: 'boolean', + enableRealtime: 'boolean', + enableSearch: 'boolean', + id: 'uuid', + options: 'json', + updatedAt: 'string', }; -const usage = "\napi-setting \n\nCommands:\n list List apiSetting records\n find-first Find first matching apiSetting record\n get Get a apiSetting by ID\n create Create a new apiSetting\n update Update an existing apiSetting\n delete Delete a apiSetting\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) => { +const usage = + '\napi-setting \n\nCommands:\n list List apiSetting records\n find-first Find first matching apiSetting record\n get Get a apiSetting by ID\n create Create a new apiSetting\n update Update an existing apiSetting\n delete Delete a apiSetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -89,16 +103,18 @@ async function handleList(argv: Partial>, _prompter: Inq enableSearch: true, id: true, options: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: ApiSettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ApiSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.apiSetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -125,16 +141,18 @@ async function handleFindFirst(argv: Partial>, _prompter enableSearch: true, id: true, options: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ApiSettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ApiSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.apiSetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -143,39 +161,43 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.apiSetting.findOne({ - id: answers.id as string, - select: { - apiId: true, - createdAt: true, - databaseId: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.apiSetting + .findOne({ + id: answers.id as string, + select: { + apiId: true, + createdAt: true, + databaseId: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -184,140 +206,158 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiId", - message: "apiId", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "boolean", - name: "enableAggregates", - message: "enableAggregates", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableBulk", - message: "enableBulk", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableConnectionFilter", - message: "enableConnectionFilter", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableDirectUploads", - message: "enableDirectUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableI18N", - message: "enableI18N", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLlm", - message: "enableLlm", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLtree", - message: "enableLtree", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableManyToMany", - message: "enableManyToMany", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePostgis", - message: "enablePostgis", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePresignedUploads", - message: "enablePresignedUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableRealtime", - message: "enableRealtime", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableSearch", - message: "enableSearch", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'boolean', + name: 'enableAggregates', + message: 'enableAggregates', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableBulk', + message: 'enableBulk', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableConnectionFilter', + message: 'enableConnectionFilter', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableDirectUploads', + message: 'enableDirectUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableI18N', + message: 'enableI18N', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLlm', + message: 'enableLlm', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLtree', + message: 'enableLtree', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableManyToMany', + message: 'enableManyToMany', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePostgis', + message: 'enablePostgis', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePresignedUploads', + message: 'enablePresignedUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableRealtime', + message: 'enableRealtime', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableSearch', + message: 'enableSearch', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiSettingInput["apiSetting"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiSettingInput['apiSetting']; const client = getClient(); - const result = await client.apiSetting.create({ - data: { - apiId: cleanedData.apiId, - databaseId: cleanedData.databaseId, - enableAggregates: cleanedData.enableAggregates, - enableBulk: cleanedData.enableBulk, - enableConnectionFilter: cleanedData.enableConnectionFilter, - enableDirectUploads: cleanedData.enableDirectUploads, - enableI18N: cleanedData.enableI18N, - enableLlm: cleanedData.enableLlm, - enableLtree: cleanedData.enableLtree, - enableManyToMany: cleanedData.enableManyToMany, - enablePostgis: cleanedData.enablePostgis, - enablePresignedUploads: cleanedData.enablePresignedUploads, - enableRealtime: cleanedData.enableRealtime, - enableSearch: cleanedData.enableSearch, - options: cleanedData.options - }, - select: { - apiId: true, - createdAt: true, - databaseId: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.apiSetting + .create({ + data: { + apiId: cleanedData.apiId, + databaseId: cleanedData.databaseId, + enableAggregates: cleanedData.enableAggregates, + enableBulk: cleanedData.enableBulk, + enableConnectionFilter: cleanedData.enableConnectionFilter, + enableDirectUploads: cleanedData.enableDirectUploads, + enableI18N: cleanedData.enableI18N, + enableLlm: cleanedData.enableLlm, + enableLtree: cleanedData.enableLtree, + enableManyToMany: cleanedData.enableManyToMany, + enablePostgis: cleanedData.enablePostgis, + enablePresignedUploads: cleanedData.enablePresignedUploads, + enableRealtime: cleanedData.enableRealtime, + enableSearch: cleanedData.enableSearch, + options: cleanedData.options, + }, + select: { + apiId: true, + createdAt: true, + databaseId: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -326,148 +366,167 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiId", - message: "apiId", - required: false - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "boolean", - name: "enableAggregates", - message: "enableAggregates", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableBulk", - message: "enableBulk", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableConnectionFilter", - message: "enableConnectionFilter", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableDirectUploads", - message: "enableDirectUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableI18N", - message: "enableI18N", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLlm", - message: "enableLlm", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLtree", - message: "enableLtree", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableManyToMany", - message: "enableManyToMany", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePostgis", - message: "enablePostgis", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePresignedUploads", - message: "enablePresignedUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableRealtime", - message: "enableRealtime", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableSearch", - message: "enableSearch", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'boolean', + name: 'enableAggregates', + message: 'enableAggregates', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableBulk', + message: 'enableBulk', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableConnectionFilter', + message: 'enableConnectionFilter', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableDirectUploads', + message: 'enableDirectUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableI18N', + message: 'enableI18N', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLlm', + message: 'enableLlm', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLtree', + message: 'enableLtree', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableManyToMany', + message: 'enableManyToMany', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePostgis', + message: 'enablePostgis', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePresignedUploads', + message: 'enablePresignedUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableRealtime', + message: 'enableRealtime', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableSearch', + message: 'enableSearch', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ApiSettingPatch; const client = getClient(); - const result = await client.apiSetting.update({ - where: { - id: answers.id as string - }, - data: { - apiId: cleanedData.apiId, - databaseId: cleanedData.databaseId, - enableAggregates: cleanedData.enableAggregates, - enableBulk: cleanedData.enableBulk, - enableConnectionFilter: cleanedData.enableConnectionFilter, - enableDirectUploads: cleanedData.enableDirectUploads, - enableI18N: cleanedData.enableI18N, - enableLlm: cleanedData.enableLlm, - enableLtree: cleanedData.enableLtree, - enableManyToMany: cleanedData.enableManyToMany, - enablePostgis: cleanedData.enablePostgis, - enablePresignedUploads: cleanedData.enablePresignedUploads, - enableRealtime: cleanedData.enableRealtime, - enableSearch: cleanedData.enableSearch, - options: cleanedData.options - }, - select: { - apiId: true, - createdAt: true, - databaseId: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.apiSetting + .update({ + where: { + id: answers.id as string, + }, + data: { + apiId: cleanedData.apiId, + databaseId: cleanedData.databaseId, + enableAggregates: cleanedData.enableAggregates, + enableBulk: cleanedData.enableBulk, + enableConnectionFilter: cleanedData.enableConnectionFilter, + enableDirectUploads: cleanedData.enableDirectUploads, + enableI18N: cleanedData.enableI18N, + enableLlm: cleanedData.enableLlm, + enableLtree: cleanedData.enableLtree, + enableManyToMany: cleanedData.enableManyToMany, + enablePostgis: cleanedData.enablePostgis, + enablePresignedUploads: cleanedData.enablePresignedUploads, + enableRealtime: cleanedData.enableRealtime, + enableSearch: cleanedData.enableSearch, + options: cleanedData.options, + }, + select: { + apiId: true, + createdAt: true, + databaseId: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -476,28 +535,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.apiSetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.apiSetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/api.ts b/sdk/constructive-cli/src/api/cli/commands/api.ts index a034970f79..d7efd0643c 100644 --- a/sdk/constructive-cli/src/api/cli/commands/api.ts +++ b/sdk/constructive-cli/src/api/cli/commands/api.ts @@ -3,58 +3,72 @@ * @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 { CreateApiInput, ApiPatch, ApiSelect, ApiFilter, ApiOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateApiInput, + ApiPatch, + ApiSelect, + ApiFilter, + ApiOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - anonRole: "string", - config: "json", - createdAt: "string", - databaseId: "uuid", - dbname: "string", - id: "uuid", - isPublished: "boolean", - name: "string", - roleName: "string", - updatedAt: "string" + anonRole: 'string', + config: 'json', + createdAt: 'string', + databaseId: 'uuid', + dbname: 'string', + id: 'uuid', + isPublished: 'boolean', + name: 'string', + roleName: 'string', + updatedAt: 'string', }; -const usage = "\napi \n\nCommands:\n list List api records\n find-first Find first matching api record\n get Get a api by ID\n create Create a new api\n update Update an existing api\n delete Delete a api\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) => { +const usage = + '\napi \n\nCommands:\n list List api records\n find-first Find first matching api record\n get Get a api by ID\n create Create a new api\n update Update an existing api\n delete Delete a api\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq isPublished: true, name: true, roleName: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: ApiSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ApiSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.api.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter isPublished: true, name: true, roleName: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ApiSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ApiSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.api.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.api.findOne({ - id: answers.id as string, - select: { - anonRole: true, - config: true, - createdAt: true, - databaseId: true, - dbname: true, - id: true, - isPublished: true, - name: true, - roleName: true, - updatedAt: true - } - }).execute(); + const result = await client.api + .findOne({ + id: answers.id as string, + select: { + anonRole: true, + config: true, + createdAt: true, + databaseId: true, + dbname: true, + id: true, + isPublished: true, + name: true, + roleName: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,76 +174,86 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "anonRole", - message: "anonRole", - required: false, - skipPrompt: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "dbname", - message: "dbname", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "roleName", - message: "roleName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'anonRole', + message: 'anonRole', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'dbname', + message: 'dbname', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'roleName', + message: 'roleName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiInput["api"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiInput['api']; const client = getClient(); - const result = await client.api.create({ - data: { - anonRole: cleanedData.anonRole, - config: cleanedData.config, - databaseId: cleanedData.databaseId, - dbname: cleanedData.dbname, - isPublished: cleanedData.isPublished, - name: cleanedData.name, - roleName: cleanedData.roleName - }, - select: { - anonRole: true, - config: true, - createdAt: true, - databaseId: true, - dbname: true, - id: true, - isPublished: true, - name: true, - roleName: true, - updatedAt: true - } - }).execute(); + const result = await client.api + .create({ + data: { + anonRole: cleanedData.anonRole, + config: cleanedData.config, + databaseId: cleanedData.databaseId, + dbname: cleanedData.dbname, + isPublished: cleanedData.isPublished, + name: cleanedData.name, + roleName: cleanedData.roleName, + }, + select: { + anonRole: true, + config: true, + createdAt: true, + databaseId: true, + dbname: true, + id: true, + isPublished: true, + name: true, + roleName: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -230,84 +262,95 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "anonRole", - message: "anonRole", - required: false, - skipPrompt: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "dbname", - message: "dbname", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "roleName", - message: "roleName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'anonRole', + message: 'anonRole', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'dbname', + message: 'dbname', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'roleName', + message: 'roleName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ApiPatch; const client = getClient(); - const result = await client.api.update({ - where: { - id: answers.id as string - }, - data: { - anonRole: cleanedData.anonRole, - config: cleanedData.config, - databaseId: cleanedData.databaseId, - dbname: cleanedData.dbname, - isPublished: cleanedData.isPublished, - name: cleanedData.name, - roleName: cleanedData.roleName - }, - select: { - anonRole: true, - config: true, - createdAt: true, - databaseId: true, - dbname: true, - id: true, - isPublished: true, - name: true, - roleName: true, - updatedAt: true - } - }).execute(); + const result = await client.api + .update({ + where: { + id: answers.id as string, + }, + data: { + anonRole: cleanedData.anonRole, + config: cleanedData.config, + databaseId: cleanedData.databaseId, + dbname: cleanedData.dbname, + isPublished: cleanedData.isPublished, + name: cleanedData.name, + roleName: cleanedData.roleName, + }, + select: { + anonRole: true, + config: true, + createdAt: true, + databaseId: true, + dbname: true, + id: true, + isPublished: true, + name: true, + roleName: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -316,28 +359,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.api.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.api + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/apply-registry-defaults.ts b/sdk/constructive-cli/src/api/cli/commands/apply-registry-defaults.ts index 0157f6f3f1..0dcecb91cf 100644 --- a/sdk/constructive-cli/src/api/cli/commands/apply-registry-defaults.ts +++ b/sdk/constructive-cli/src/api/cli/commands/apply-registry-defaults.ts @@ -3,32 +3,43 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { ApplyRegistryDefaultsVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { ApplyRegistryDefaultsVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("apply-registry-defaults - applyRegistryDefaults\n\nUsage: apply-registry-defaults [OPTIONS]\n"); + console.log( + 'apply-registry-defaults - applyRegistryDefaults\n\nUsage: apply-registry-defaults [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "data", - message: "data" - }, { - type: "text", - name: "nodeType", - message: "nodeType" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'data', + message: 'data', + }, + { + type: 'text', + name: 'nodeType', + message: 'nodeType', + }, + ]); const client = getClient(); - const result = await client.query.applyRegistryDefaults(answers as unknown as ApplyRegistryDefaultsVariables).execute(); + const result = await client.query + .applyRegistryDefaults(answers as unknown as ApplyRegistryDefaultsVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: applyRegistryDefaults"); + console.error('Failed: applyRegistryDefaults'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/apply-rls.ts b/sdk/constructive-cli/src/api/cli/commands/apply-rls.ts index 0134d08007..d6e6576f7b 100644 --- a/sdk/constructive-cli/src/api/cli/commands/apply-rls.ts +++ b/sdk/constructive-cli/src/api/cli/commands/apply-rls.ts @@ -3,37 +3,49 @@ * @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 { ApplyRlsVariables } from "../../orm/mutation"; -import type { ApplyRlsPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ApplyRlsVariables } from '../../orm/mutation'; +import type { ApplyRlsPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("apply-rls - applyRls\n\nUsage: apply-rls [OPTIONS]\n"); + console.log('apply-rls - applyRls\n\nUsage: apply-rls [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 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.applyRls(parsedAnswers as unknown as ApplyRlsVariables, { - select: selectFields - } as unknown as { - select: ApplyRlsPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .applyRls( + parsedAnswers as unknown as ApplyRlsVariables, + { + select: selectFields, + } as unknown as { + select: ApplyRlsPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: applyRls"); + console.error('Failed: applyRls'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/ast-migration.ts b/sdk/constructive-cli/src/api/cli/commands/ast-migration.ts index c1c2354da4..03949dcec5 100644 --- a/sdk/constructive-cli/src/api/cli/commands/ast-migration.ts +++ b/sdk/constructive-cli/src/api/cli/commands/ast-migration.ts @@ -3,55 +3,69 @@ * @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 { CreateAstMigrationInput, AstMigrationPatch, AstMigrationSelect, AstMigrationFilter, AstMigrationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAstMigrationInput, + AstMigrationPatch, + AstMigrationSelect, + AstMigrationFilter, + AstMigrationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actionId: "uuid", - actionName: "string", - actorId: "uuid", - createdAt: "string", - databaseId: "uuid", - deploy: "json", - deploys: "string", - id: "int", - name: "string", - payload: "json", - requires: "string", - revert: "json", - verify: "json" + actionId: 'uuid', + actionName: 'string', + actorId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + deploy: 'json', + deploys: 'string', + id: 'int', + name: 'string', + payload: 'json', + requires: 'string', + revert: 'json', + verify: 'json', }; -const usage = "\nast-migration \n\nCommands:\n list List astMigration records\n find-first Find first matching astMigration record\n create Create a new astMigration\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) => { +const usage = + '\nast-migration \n\nCommands:\n list List astMigration records\n find-first Find first matching astMigration record\n create Create a new astMigration\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq payload: true, requires: true, revert: true, - verify: true + verify: true, }; - const findManyArgs = parseFindManyArgs & { - select: AstMigrationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AstMigrationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.astMigration.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter payload: true, requires: true, revert: true, - verify: true + verify: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AstMigrationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AstMigrationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.astMigration.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,101 +140,118 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actionId", - message: "actionId", - required: true - }, { - type: "text", - name: "actionName", - message: "actionName", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "json", - name: "deploy", - message: "deploy", - required: true - }, { - type: "text", - name: "deploys", - message: "deploys", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "json", - name: "payload", - message: "payload", - required: true - }, { - type: "text", - name: "requires", - message: "requires", - required: true - }, { - type: "json", - name: "revert", - message: "revert", - required: true - }, { - type: "json", - name: "verify", - message: "verify", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actionId', + message: 'actionId', + required: true, + }, + { + type: 'text', + name: 'actionName', + message: 'actionName', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'json', + name: 'deploy', + message: 'deploy', + required: true, + }, + { + type: 'text', + name: 'deploys', + message: 'deploys', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: true, + }, + { + type: 'text', + name: 'requires', + message: 'requires', + required: true, + }, + { + type: 'json', + name: 'revert', + message: 'revert', + required: true, + }, + { + type: 'json', + name: 'verify', + message: 'verify', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAstMigrationInput["astMigration"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAstMigrationInput['astMigration']; const client = getClient(); - const result = await client.astMigration.create({ - data: { - actionId: cleanedData.actionId, - actionName: cleanedData.actionName, - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - deploy: cleanedData.deploy, - deploys: cleanedData.deploys, - name: cleanedData.name, - payload: cleanedData.payload, - requires: cleanedData.requires, - revert: cleanedData.revert, - verify: cleanedData.verify - }, - select: { - actionId: true, - actionName: true, - actorId: true, - createdAt: true, - databaseId: true, - deploy: true, - deploys: true, - id: true, - name: true, - payload: true, - requires: true, - revert: true, - verify: true - } - }).execute(); + const result = await client.astMigration + .create({ + data: { + actionId: cleanedData.actionId, + actionName: cleanedData.actionName, + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + deploy: cleanedData.deploy, + deploys: cleanedData.deploys, + name: cleanedData.name, + payload: cleanedData.payload, + requires: cleanedData.requires, + revert: cleanedData.revert, + verify: cleanedData.verify, + }, + select: { + actionId: true, + actionName: true, + actorId: true, + createdAt: true, + databaseId: true, + deploy: true, + deploys: true, + id: true, + name: true, + payload: true, + requires: true, + revert: true, + verify: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/auth.ts b/sdk/constructive-cli/src/api/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/api/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/api/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/cancel-database-transfer.ts b/sdk/constructive-cli/src/api/cli/commands/cancel-database-transfer.ts index 280786e658..45bf96ab1f 100644 --- a/sdk/constructive-cli/src/api/cli/commands/cancel-database-transfer.ts +++ b/sdk/constructive-cli/src/api/cli/commands/cancel-database-transfer.ts @@ -3,37 +3,51 @@ * @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 { CancelDatabaseTransferVariables } from "../../orm/mutation"; -import type { CancelDatabaseTransferPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { CancelDatabaseTransferVariables } from '../../orm/mutation'; +import type { CancelDatabaseTransferPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("cancel-database-transfer - cancelDatabaseTransfer\n\nUsage: cancel-database-transfer [OPTIONS]\n"); + console.log( + 'cancel-database-transfer - cancelDatabaseTransfer\n\nUsage: cancel-database-transfer [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 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.cancelDatabaseTransfer(parsedAnswers as unknown as CancelDatabaseTransferVariables, { - select: selectFields - } as unknown as { - select: CancelDatabaseTransferPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .cancelDatabaseTransfer( + parsedAnswers as unknown as CancelDatabaseTransferVariables, + { + select: selectFields, + } as unknown as { + select: CancelDatabaseTransferPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: cancelDatabaseTransfer"); + console.error('Failed: cancelDatabaseTransfer'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/check-constraint.ts b/sdk/constructive-cli/src/api/cli/commands/check-constraint.ts index 4c7b941ee8..418be4b18b 100644 --- a/sdk/constructive-cli/src/api/cli/commands/check-constraint.ts +++ b/sdk/constructive-cli/src/api/cli/commands/check-constraint.ts @@ -3,62 +3,76 @@ * @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 { CreateCheckConstraintInput, CheckConstraintPatch, CheckConstraintSelect, CheckConstraintFilter, CheckConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateCheckConstraintInput, + CheckConstraintPatch, + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - createdAt: "string", - databaseId: "uuid", - expr: "json", - fieldIds: "uuid", - id: "uuid", - initiallyDeferred: "boolean", - isDeferrable: "boolean", - name: "string", - smartTags: "json", - tableId: "uuid", - tags: "string", - type: "string", - updatedAt: "string" + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + expr: 'json', + fieldIds: 'uuid', + id: 'uuid', + initiallyDeferred: 'boolean', + isDeferrable: 'boolean', + name: 'string', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + type: 'string', + updatedAt: 'string', }; -const usage = "\ncheck-constraint \n\nCommands:\n list List checkConstraint records\n find-first Find first matching checkConstraint record\n get Get a checkConstraint by ID\n create Create a new checkConstraint\n update Update an existing checkConstraint\n delete Delete a checkConstraint\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) => { +const usage = + '\ncheck-constraint \n\nCommands:\n list List checkConstraint records\n find-first Find first matching checkConstraint record\n get Get a checkConstraint by ID\n create Create a new checkConstraint\n update Update an existing checkConstraint\n delete Delete a checkConstraint\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,18 @@ async function handleList(argv: Partial>, _prompter: Inq tableId: true, tags: true, type: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: CheckConstraintSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: CheckConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.checkConstraint.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +129,18 @@ async function handleFindFirst(argv: Partial>, _prompter tableId: true, tags: true, type: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: CheckConstraintSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: CheckConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.checkConstraint.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +149,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.checkConstraint.findOne({ - id: answers.id as string, - select: { - category: true, - createdAt: true, - databaseId: true, - expr: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true - } - }).execute(); + const result = await client.checkConstraint + .findOne({ + id: answers.id as string, + select: { + category: true, + createdAt: true, + databaseId: true, + expr: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,108 +190,125 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "expr", - message: "expr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: true - }, { - type: "boolean", - name: "initiallyDeferred", - message: "initiallyDeferred", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDeferrable", - message: "isDeferrable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'expr', + message: 'expr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: true, + }, + { + type: 'boolean', + name: 'initiallyDeferred', + message: 'initiallyDeferred', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDeferrable', + message: 'isDeferrable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateCheckConstraintInput["checkConstraint"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateCheckConstraintInput['checkConstraint']; const client = getClient(); - const result = await client.checkConstraint.create({ - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - expr: cleanedData.expr, - fieldIds: cleanedData.fieldIds, - initiallyDeferred: cleanedData.initiallyDeferred, - isDeferrable: cleanedData.isDeferrable, - name: cleanedData.name, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type - }, - select: { - category: true, - createdAt: true, - databaseId: true, - expr: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true - } - }).execute(); + const result = await client.checkConstraint + .create({ + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + expr: cleanedData.expr, + fieldIds: cleanedData.fieldIds, + initiallyDeferred: cleanedData.initiallyDeferred, + isDeferrable: cleanedData.isDeferrable, + name: cleanedData.name, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + expr: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -278,116 +317,131 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "expr", - message: "expr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false - }, { - type: "boolean", - name: "initiallyDeferred", - message: "initiallyDeferred", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDeferrable", - message: "isDeferrable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'expr', + message: 'expr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + }, + { + type: 'boolean', + name: 'initiallyDeferred', + message: 'initiallyDeferred', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDeferrable', + message: 'isDeferrable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CheckConstraintPatch; const client = getClient(); - const result = await client.checkConstraint.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - expr: cleanedData.expr, - fieldIds: cleanedData.fieldIds, - initiallyDeferred: cleanedData.initiallyDeferred, - isDeferrable: cleanedData.isDeferrable, - name: cleanedData.name, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type - }, - select: { - category: true, - createdAt: true, - databaseId: true, - expr: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true - } - }).execute(); + const result = await client.checkConstraint + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + expr: cleanedData.expr, + fieldIds: cleanedData.fieldIds, + initiallyDeferred: cleanedData.initiallyDeferred, + isDeferrable: cleanedData.isDeferrable, + name: cleanedData.name, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + expr: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -396,28 +450,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.checkConstraint.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.checkConstraint + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/composite-type.ts b/sdk/constructive-cli/src/api/cli/commands/composite-type.ts index 0e7229d898..c7792030ba 100644 --- a/sdk/constructive-cli/src/api/cli/commands/composite-type.ts +++ b/sdk/constructive-cli/src/api/cli/commands/composite-type.ts @@ -3,58 +3,72 @@ * @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 { CreateCompositeTypeInput, CompositeTypePatch, CompositeTypeSelect, CompositeTypeFilter, CompositeTypeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateCompositeTypeInput, + CompositeTypePatch, + CompositeTypeSelect, + CompositeTypeFilter, + CompositeTypeOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - attributes: "json", - category: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - label: "string", - name: "string", - schemaId: "uuid", - smartTags: "json", - tags: "string" + attributes: 'json', + category: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + label: 'string', + name: 'string', + schemaId: 'uuid', + smartTags: 'json', + tags: 'string', }; -const usage = "\ncomposite-type \n\nCommands:\n list List compositeType records\n find-first Find first matching compositeType record\n get Get a compositeType by ID\n create Create a new compositeType\n update Update an existing compositeType\n delete Delete a compositeType\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) => { +const usage = + '\ncomposite-type \n\nCommands:\n list List compositeType records\n find-first Find first matching compositeType record\n get Get a compositeType by ID\n create Create a new compositeType\n update Update an existing compositeType\n delete Delete a compositeType\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, schemaId: true, smartTags: true, - tags: true + tags: true, }; - const findManyArgs = parseFindManyArgs & { - select: CompositeTypeSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: CompositeTypeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.compositeType.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, schemaId: true, smartTags: true, - tags: true + tags: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: CompositeTypeSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: CompositeTypeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.compositeType.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.compositeType.findOne({ - id: answers.id as string, - select: { - attributes: true, - category: true, - databaseId: true, - description: true, - id: true, - label: true, - name: true, - schemaId: true, - smartTags: true, - tags: true - } - }).execute(); + const result = await client.compositeType + .findOne({ + id: answers.id as string, + select: { + attributes: true, + category: true, + databaseId: true, + description: true, + id: true, + label: true, + name: true, + schemaId: true, + smartTags: true, + tags: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,89 +174,104 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "attributes", - message: "attributes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'attributes', + message: 'attributes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateCompositeTypeInput["compositeType"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateCompositeTypeInput['compositeType']; const client = getClient(); - const result = await client.compositeType.create({ - data: { - attributes: cleanedData.attributes, - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - label: cleanedData.label, - name: cleanedData.name, - schemaId: cleanedData.schemaId, - smartTags: cleanedData.smartTags, - tags: cleanedData.tags - }, - select: { - attributes: true, - category: true, - databaseId: true, - description: true, - id: true, - label: true, - name: true, - schemaId: true, - smartTags: true, - tags: true - } - }).execute(); + const result = await client.compositeType + .create({ + data: { + attributes: cleanedData.attributes, + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + label: cleanedData.label, + name: cleanedData.name, + schemaId: cleanedData.schemaId, + smartTags: cleanedData.smartTags, + tags: cleanedData.tags, + }, + select: { + attributes: true, + category: true, + databaseId: true, + description: true, + id: true, + label: true, + name: true, + schemaId: true, + smartTags: true, + tags: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -243,97 +280,110 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "attributes", - message: "attributes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'attributes', + message: 'attributes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CompositeTypePatch; const client = getClient(); - const result = await client.compositeType.update({ - where: { - id: answers.id as string - }, - data: { - attributes: cleanedData.attributes, - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - label: cleanedData.label, - name: cleanedData.name, - schemaId: cleanedData.schemaId, - smartTags: cleanedData.smartTags, - tags: cleanedData.tags - }, - select: { - attributes: true, - category: true, - databaseId: true, - description: true, - id: true, - label: true, - name: true, - schemaId: true, - smartTags: true, - tags: true - } - }).execute(); + const result = await client.compositeType + .update({ + where: { + id: answers.id as string, + }, + data: { + attributes: cleanedData.attributes, + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + label: cleanedData.label, + name: cleanedData.name, + schemaId: cleanedData.schemaId, + smartTags: cleanedData.smartTags, + tags: cleanedData.tags, + }, + select: { + attributes: true, + category: true, + databaseId: true, + description: true, + id: true, + label: true, + name: true, + schemaId: true, + smartTags: true, + tags: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -342,28 +392,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.compositeType.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.compositeType + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/context.ts b/sdk/constructive-cli/src/api/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/api/cli/commands/context.ts +++ b/sdk/constructive-cli/src/api/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/cors-setting.ts b/sdk/constructive-cli/src/api/cli/commands/cors-setting.ts index ed693b727a..4738406caf 100644 --- a/sdk/constructive-cli/src/api/cli/commands/cors-setting.ts +++ b/sdk/constructive-cli/src/api/cli/commands/cors-setting.ts @@ -3,54 +3,68 @@ * @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 { CreateCorsSettingInput, CorsSettingPatch, CorsSettingSelect, CorsSettingFilter, CorsSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateCorsSettingInput, + CorsSettingPatch, + CorsSettingSelect, + CorsSettingFilter, + CorsSettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - allowedOrigins: "string", - apiId: "uuid", - createdAt: "string", - databaseId: "uuid", - id: "uuid", - updatedAt: "string" + allowedOrigins: 'string', + apiId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + updatedAt: 'string', }; -const usage = "\ncors-setting \n\nCommands:\n list List corsSetting records\n find-first Find first matching corsSetting record\n get Get a corsSetting by ID\n create Create a new corsSetting\n update Update an existing corsSetting\n delete Delete a corsSetting\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) => { +const usage = + '\ncors-setting \n\nCommands:\n list List corsSetting records\n find-first Find first matching corsSetting record\n get Get a corsSetting by ID\n create Create a new corsSetting\n update Update an existing corsSetting\n delete Delete a corsSetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq createdAt: true, databaseId: true, id: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: CorsSettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: CorsSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.corsSetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter createdAt: true, databaseId: true, id: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: CorsSettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: CorsSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.corsSetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.corsSetting.findOne({ - id: answers.id as string, - select: { - allowedOrigins: true, - apiId: true, - createdAt: true, - databaseId: true, - id: true, - updatedAt: true - } - }).execute(); + const result = await client.corsSetting + .findOne({ + id: answers.id as string, + select: { + allowedOrigins: true, + apiId: true, + createdAt: true, + databaseId: true, + id: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,45 +158,54 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "allowedOrigins", - message: "allowedOrigins", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiId", - message: "apiId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'allowedOrigins', + message: 'allowedOrigins', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateCorsSettingInput["corsSetting"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateCorsSettingInput['corsSetting']; const client = getClient(); - const result = await client.corsSetting.create({ - data: { - allowedOrigins: cleanedData.allowedOrigins, - apiId: cleanedData.apiId, - databaseId: cleanedData.databaseId - }, - select: { - allowedOrigins: true, - apiId: true, - createdAt: true, - databaseId: true, - id: true, - updatedAt: true - } - }).execute(); + const result = await client.corsSetting + .create({ + data: { + allowedOrigins: cleanedData.allowedOrigins, + apiId: cleanedData.apiId, + databaseId: cleanedData.databaseId, + }, + select: { + allowedOrigins: true, + apiId: true, + createdAt: true, + databaseId: true, + id: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -183,53 +214,60 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "allowedOrigins", - message: "allowedOrigins", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiId", - message: "apiId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'allowedOrigins', + message: 'allowedOrigins', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CorsSettingPatch; const client = getClient(); - const result = await client.corsSetting.update({ - where: { - id: answers.id as string - }, - data: { - allowedOrigins: cleanedData.allowedOrigins, - apiId: cleanedData.apiId, - databaseId: cleanedData.databaseId - }, - select: { - allowedOrigins: true, - apiId: true, - createdAt: true, - databaseId: true, - id: true, - updatedAt: true - } - }).execute(); + const result = await client.corsSetting + .update({ + where: { + id: answers.id as string, + }, + data: { + allowedOrigins: cleanedData.allowedOrigins, + apiId: cleanedData.apiId, + databaseId: cleanedData.databaseId, + }, + select: { + allowedOrigins: true, + apiId: true, + createdAt: true, + databaseId: true, + id: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -238,28 +276,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.corsSetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.corsSetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/database-setting.ts b/sdk/constructive-cli/src/api/cli/commands/database-setting.ts index b630c08dc3..15479d5785 100644 --- a/sdk/constructive-cli/src/api/cli/commands/database-setting.ts +++ b/sdk/constructive-cli/src/api/cli/commands/database-setting.ts @@ -3,67 +3,81 @@ * @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 { CreateDatabaseSettingInput, DatabaseSettingPatch, DatabaseSettingSelect, DatabaseSettingFilter, DatabaseSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDatabaseSettingInput, + DatabaseSettingPatch, + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - databaseId: "uuid", - enableAggregates: "boolean", - enableBulk: "boolean", - enableConnectionFilter: "boolean", - enableDirectUploads: "boolean", - enableI18N: "boolean", - enableLlm: "boolean", - enableLtree: "boolean", - enableManyToMany: "boolean", - enablePostgis: "boolean", - enablePresignedUploads: "boolean", - enableRealtime: "boolean", - enableSearch: "boolean", - id: "uuid", - labels: "json", - options: "json", - updatedAt: "string" + annotations: 'json', + createdAt: 'string', + databaseId: 'uuid', + enableAggregates: 'boolean', + enableBulk: 'boolean', + enableConnectionFilter: 'boolean', + enableDirectUploads: 'boolean', + enableI18N: 'boolean', + enableLlm: 'boolean', + enableLtree: 'boolean', + enableManyToMany: 'boolean', + enablePostgis: 'boolean', + enablePresignedUploads: 'boolean', + enableRealtime: 'boolean', + enableSearch: 'boolean', + id: 'uuid', + labels: 'json', + options: 'json', + updatedAt: 'string', }; -const usage = "\ndatabase-setting \n\nCommands:\n list List databaseSetting records\n find-first Find first matching databaseSetting record\n get Get a databaseSetting by ID\n create Create a new databaseSetting\n update Update an existing databaseSetting\n delete Delete a databaseSetting\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) => { +const usage = + '\ndatabase-setting \n\nCommands:\n list List databaseSetting records\n find-first Find first matching databaseSetting record\n get Get a databaseSetting by ID\n create Create a new databaseSetting\n update Update an existing databaseSetting\n delete Delete a databaseSetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -91,16 +105,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, labels: true, options: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DatabaseSettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DatabaseSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.databaseSetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -128,16 +144,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, labels: true, options: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DatabaseSettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DatabaseSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.databaseSetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -146,40 +164,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.databaseSetting.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - databaseId: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - labels: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseSetting + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + databaseId: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + labels: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -188,149 +210,171 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "boolean", - name: "enableAggregates", - message: "enableAggregates", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableBulk", - message: "enableBulk", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableConnectionFilter", - message: "enableConnectionFilter", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableDirectUploads", - message: "enableDirectUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableI18N", - message: "enableI18N", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLlm", - message: "enableLlm", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLtree", - message: "enableLtree", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableManyToMany", - message: "enableManyToMany", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePostgis", - message: "enablePostgis", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePresignedUploads", - message: "enablePresignedUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableRealtime", - message: "enableRealtime", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableSearch", - message: "enableSearch", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'boolean', + name: 'enableAggregates', + message: 'enableAggregates', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableBulk', + message: 'enableBulk', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableConnectionFilter', + message: 'enableConnectionFilter', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableDirectUploads', + message: 'enableDirectUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableI18N', + message: 'enableI18N', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLlm', + message: 'enableLlm', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLtree', + message: 'enableLtree', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableManyToMany', + message: 'enableManyToMany', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePostgis', + message: 'enablePostgis', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePresignedUploads', + message: 'enablePresignedUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableRealtime', + message: 'enableRealtime', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableSearch', + message: 'enableSearch', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDatabaseSettingInput["databaseSetting"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDatabaseSettingInput['databaseSetting']; const client = getClient(); - const result = await client.databaseSetting.create({ - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - enableAggregates: cleanedData.enableAggregates, - enableBulk: cleanedData.enableBulk, - enableConnectionFilter: cleanedData.enableConnectionFilter, - enableDirectUploads: cleanedData.enableDirectUploads, - enableI18N: cleanedData.enableI18N, - enableLlm: cleanedData.enableLlm, - enableLtree: cleanedData.enableLtree, - enableManyToMany: cleanedData.enableManyToMany, - enablePostgis: cleanedData.enablePostgis, - enablePresignedUploads: cleanedData.enablePresignedUploads, - enableRealtime: cleanedData.enableRealtime, - enableSearch: cleanedData.enableSearch, - labels: cleanedData.labels, - options: cleanedData.options - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - labels: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseSetting + .create({ + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + enableAggregates: cleanedData.enableAggregates, + enableBulk: cleanedData.enableBulk, + enableConnectionFilter: cleanedData.enableConnectionFilter, + enableDirectUploads: cleanedData.enableDirectUploads, + enableI18N: cleanedData.enableI18N, + enableLlm: cleanedData.enableLlm, + enableLtree: cleanedData.enableLtree, + enableManyToMany: cleanedData.enableManyToMany, + enablePostgis: cleanedData.enablePostgis, + enablePresignedUploads: cleanedData.enablePresignedUploads, + enableRealtime: cleanedData.enableRealtime, + enableSearch: cleanedData.enableSearch, + labels: cleanedData.labels, + options: cleanedData.options, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + labels: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -339,157 +383,177 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "boolean", - name: "enableAggregates", - message: "enableAggregates", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableBulk", - message: "enableBulk", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableConnectionFilter", - message: "enableConnectionFilter", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableDirectUploads", - message: "enableDirectUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableI18N", - message: "enableI18N", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLlm", - message: "enableLlm", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLtree", - message: "enableLtree", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableManyToMany", - message: "enableManyToMany", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePostgis", - message: "enablePostgis", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePresignedUploads", - message: "enablePresignedUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableRealtime", - message: "enableRealtime", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableSearch", - message: "enableSearch", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'boolean', + name: 'enableAggregates', + message: 'enableAggregates', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableBulk', + message: 'enableBulk', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableConnectionFilter', + message: 'enableConnectionFilter', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableDirectUploads', + message: 'enableDirectUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableI18N', + message: 'enableI18N', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLlm', + message: 'enableLlm', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLtree', + message: 'enableLtree', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableManyToMany', + message: 'enableManyToMany', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePostgis', + message: 'enablePostgis', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePresignedUploads', + message: 'enablePresignedUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableRealtime', + message: 'enableRealtime', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableSearch', + message: 'enableSearch', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DatabaseSettingPatch; const client = getClient(); - const result = await client.databaseSetting.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - enableAggregates: cleanedData.enableAggregates, - enableBulk: cleanedData.enableBulk, - enableConnectionFilter: cleanedData.enableConnectionFilter, - enableDirectUploads: cleanedData.enableDirectUploads, - enableI18N: cleanedData.enableI18N, - enableLlm: cleanedData.enableLlm, - enableLtree: cleanedData.enableLtree, - enableManyToMany: cleanedData.enableManyToMany, - enablePostgis: cleanedData.enablePostgis, - enablePresignedUploads: cleanedData.enablePresignedUploads, - enableRealtime: cleanedData.enableRealtime, - enableSearch: cleanedData.enableSearch, - labels: cleanedData.labels, - options: cleanedData.options - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - labels: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseSetting + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + enableAggregates: cleanedData.enableAggregates, + enableBulk: cleanedData.enableBulk, + enableConnectionFilter: cleanedData.enableConnectionFilter, + enableDirectUploads: cleanedData.enableDirectUploads, + enableI18N: cleanedData.enableI18N, + enableLlm: cleanedData.enableLlm, + enableLtree: cleanedData.enableLtree, + enableManyToMany: cleanedData.enableManyToMany, + enablePostgis: cleanedData.enablePostgis, + enablePresignedUploads: cleanedData.enablePresignedUploads, + enableRealtime: cleanedData.enableRealtime, + enableSearch: cleanedData.enableSearch, + labels: cleanedData.labels, + options: cleanedData.options, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + labels: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -498,28 +562,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.databaseSetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.databaseSetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/database-transfer.ts b/sdk/constructive-cli/src/api/cli/commands/database-transfer.ts index 87efde3f3b..8a079f28b9 100644 --- a/sdk/constructive-cli/src/api/cli/commands/database-transfer.ts +++ b/sdk/constructive-cli/src/api/cli/commands/database-transfer.ts @@ -3,62 +3,76 @@ * @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 { CreateDatabaseTransferInput, DatabaseTransferPatch, DatabaseTransferSelect, DatabaseTransferFilter, DatabaseTransferOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDatabaseTransferInput, + DatabaseTransferPatch, + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - completedAt: "string", - createdAt: "string", - databaseId: "uuid", - expiresAt: "string", - id: "uuid", - initiatedBy: "uuid", - notes: "string", - sourceApproved: "boolean", - sourceApprovedAt: "string", - status: "string", - targetApproved: "boolean", - targetApprovedAt: "string", - targetOwnerId: "uuid", - updatedAt: "string" + completedAt: 'string', + createdAt: 'string', + databaseId: 'uuid', + expiresAt: 'string', + id: 'uuid', + initiatedBy: 'uuid', + notes: 'string', + sourceApproved: 'boolean', + sourceApprovedAt: 'string', + status: 'string', + targetApproved: 'boolean', + targetApprovedAt: 'string', + targetOwnerId: 'uuid', + updatedAt: 'string', }; -const usage = "\ndatabase-transfer \n\nCommands:\n list List databaseTransfer records\n find-first Find first matching databaseTransfer record\n get Get a databaseTransfer by ID\n create Create a new databaseTransfer\n update Update an existing databaseTransfer\n delete Delete a databaseTransfer\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) => { +const usage = + '\ndatabase-transfer \n\nCommands:\n list List databaseTransfer records\n find-first Find first matching databaseTransfer record\n get Get a databaseTransfer by ID\n create Create a new databaseTransfer\n update Update an existing databaseTransfer\n delete Delete a databaseTransfer\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,18 @@ async function handleList(argv: Partial>, _prompter: Inq targetApproved: true, targetApprovedAt: true, targetOwnerId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DatabaseTransferSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DatabaseTransferSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.databaseTransfer.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +129,18 @@ async function handleFindFirst(argv: Partial>, _prompter targetApproved: true, targetApprovedAt: true, targetOwnerId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DatabaseTransferSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DatabaseTransferSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.databaseTransfer.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +149,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.databaseTransfer.findOne({ - id: answers.id as string, - select: { - completedAt: true, - createdAt: true, - databaseId: true, - expiresAt: true, - id: true, - initiatedBy: true, - notes: true, - sourceApproved: true, - sourceApprovedAt: true, - status: true, - targetApproved: true, - targetApprovedAt: true, - targetOwnerId: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseTransfer + .findOne({ + id: answers.id as string, + select: { + completedAt: true, + createdAt: true, + databaseId: true, + expiresAt: true, + id: true, + initiatedBy: true, + notes: true, + sourceApproved: true, + sourceApprovedAt: true, + status: true, + targetApproved: true, + targetApprovedAt: true, + targetOwnerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,107 +190,124 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "initiatedBy", - message: "initiatedBy", - required: true - }, { - type: "text", - name: "notes", - message: "notes", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "sourceApproved", - message: "sourceApproved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sourceApprovedAt", - message: "sourceApprovedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "targetApproved", - message: "targetApproved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetApprovedAt", - message: "targetApprovedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetOwnerId", - message: "targetOwnerId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'initiatedBy', + message: 'initiatedBy', + required: true, + }, + { + type: 'text', + name: 'notes', + message: 'notes', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'sourceApproved', + message: 'sourceApproved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sourceApprovedAt', + message: 'sourceApprovedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'targetApproved', + message: 'targetApproved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetApprovedAt', + message: 'targetApprovedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetOwnerId', + message: 'targetOwnerId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDatabaseTransferInput["databaseTransfer"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDatabaseTransferInput['databaseTransfer']; const client = getClient(); - const result = await client.databaseTransfer.create({ - data: { - completedAt: cleanedData.completedAt, - databaseId: cleanedData.databaseId, - expiresAt: cleanedData.expiresAt, - initiatedBy: cleanedData.initiatedBy, - notes: cleanedData.notes, - sourceApproved: cleanedData.sourceApproved, - sourceApprovedAt: cleanedData.sourceApprovedAt, - status: cleanedData.status, - targetApproved: cleanedData.targetApproved, - targetApprovedAt: cleanedData.targetApprovedAt, - targetOwnerId: cleanedData.targetOwnerId - }, - select: { - completedAt: true, - createdAt: true, - databaseId: true, - expiresAt: true, - id: true, - initiatedBy: true, - notes: true, - sourceApproved: true, - sourceApprovedAt: true, - status: true, - targetApproved: true, - targetApprovedAt: true, - targetOwnerId: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseTransfer + .create({ + data: { + completedAt: cleanedData.completedAt, + databaseId: cleanedData.databaseId, + expiresAt: cleanedData.expiresAt, + initiatedBy: cleanedData.initiatedBy, + notes: cleanedData.notes, + sourceApproved: cleanedData.sourceApproved, + sourceApprovedAt: cleanedData.sourceApprovedAt, + status: cleanedData.status, + targetApproved: cleanedData.targetApproved, + targetApprovedAt: cleanedData.targetApprovedAt, + targetOwnerId: cleanedData.targetOwnerId, + }, + select: { + completedAt: true, + createdAt: true, + databaseId: true, + expiresAt: true, + id: true, + initiatedBy: true, + notes: true, + sourceApproved: true, + sourceApprovedAt: true, + status: true, + targetApproved: true, + targetApprovedAt: true, + targetOwnerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -277,115 +316,130 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "initiatedBy", - message: "initiatedBy", - required: false - }, { - type: "text", - name: "notes", - message: "notes", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "sourceApproved", - message: "sourceApproved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sourceApprovedAt", - message: "sourceApprovedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "targetApproved", - message: "targetApproved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetApprovedAt", - message: "targetApprovedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetOwnerId", - message: "targetOwnerId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'initiatedBy', + message: 'initiatedBy', + required: false, + }, + { + type: 'text', + name: 'notes', + message: 'notes', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'sourceApproved', + message: 'sourceApproved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sourceApprovedAt', + message: 'sourceApprovedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'targetApproved', + message: 'targetApproved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetApprovedAt', + message: 'targetApprovedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetOwnerId', + message: 'targetOwnerId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DatabaseTransferPatch; const client = getClient(); - const result = await client.databaseTransfer.update({ - where: { - id: answers.id as string - }, - data: { - completedAt: cleanedData.completedAt, - databaseId: cleanedData.databaseId, - expiresAt: cleanedData.expiresAt, - initiatedBy: cleanedData.initiatedBy, - notes: cleanedData.notes, - sourceApproved: cleanedData.sourceApproved, - sourceApprovedAt: cleanedData.sourceApprovedAt, - status: cleanedData.status, - targetApproved: cleanedData.targetApproved, - targetApprovedAt: cleanedData.targetApprovedAt, - targetOwnerId: cleanedData.targetOwnerId - }, - select: { - completedAt: true, - createdAt: true, - databaseId: true, - expiresAt: true, - id: true, - initiatedBy: true, - notes: true, - sourceApproved: true, - sourceApprovedAt: true, - status: true, - targetApproved: true, - targetApprovedAt: true, - targetOwnerId: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseTransfer + .update({ + where: { + id: answers.id as string, + }, + data: { + completedAt: cleanedData.completedAt, + databaseId: cleanedData.databaseId, + expiresAt: cleanedData.expiresAt, + initiatedBy: cleanedData.initiatedBy, + notes: cleanedData.notes, + sourceApproved: cleanedData.sourceApproved, + sourceApprovedAt: cleanedData.sourceApprovedAt, + status: cleanedData.status, + targetApproved: cleanedData.targetApproved, + targetApprovedAt: cleanedData.targetApprovedAt, + targetOwnerId: cleanedData.targetOwnerId, + }, + select: { + completedAt: true, + createdAt: true, + databaseId: true, + expiresAt: true, + id: true, + initiatedBy: true, + notes: true, + sourceApproved: true, + sourceApprovedAt: true, + status: true, + targetApproved: true, + targetApprovedAt: true, + targetOwnerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -394,28 +448,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.databaseTransfer.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.databaseTransfer + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/database.ts b/sdk/constructive-cli/src/api/cli/commands/database.ts index 6d54f77a53..e8808cbf68 100644 --- a/sdk/constructive-cli/src/api/cli/commands/database.ts +++ b/sdk/constructive-cli/src/api/cli/commands/database.ts @@ -3,57 +3,71 @@ * @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 { CreateDatabaseInput, DatabasePatch, DatabaseSelect, DatabaseFilter, DatabaseOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDatabaseInput, + DatabasePatch, + DatabaseSelect, + DatabaseFilter, + DatabaseOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - hash: "uuid", - id: "uuid", - label: "string", - name: "string", - ownerId: "uuid", - platform: "boolean", - schemaHash: "string", - updatedAt: "string" + createdAt: 'string', + hash: 'uuid', + id: 'uuid', + label: 'string', + name: 'string', + ownerId: 'uuid', + platform: 'boolean', + schemaHash: 'string', + updatedAt: 'string', }; -const usage = "\ndatabase \n\nCommands:\n list List database records\n find-first Find first matching database record\n get Get a database by ID\n create Create a new database\n update Update an existing database\n delete Delete a database\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) => { +const usage = + '\ndatabase \n\nCommands:\n list List database records\n find-first Find first matching database record\n get Get a database by ID\n create Create a new database\n update Update an existing database\n delete Delete a database\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq ownerId: true, platform: true, schemaHash: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DatabaseSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DatabaseSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.database.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter ownerId: true, platform: true, schemaHash: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DatabaseSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DatabaseSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.database.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.database.findOne({ - id: answers.id as string, - select: { - createdAt: true, - hash: true, - id: true, - label: true, - name: true, - ownerId: true, - platform: true, - schemaHash: true, - updatedAt: true - } - }).execute(); + const result = await client.database + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + hash: true, + id: true, + label: true, + name: true, + ownerId: true, + platform: true, + schemaHash: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,70 +170,79 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "platform", - message: "platform", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaHash", - message: "schemaHash", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'platform', + message: 'platform', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaHash', + message: 'schemaHash', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDatabaseInput["database"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateDatabaseInput['database']; const client = getClient(); - const result = await client.database.create({ - data: { - hash: cleanedData.hash, - label: cleanedData.label, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - platform: cleanedData.platform, - schemaHash: cleanedData.schemaHash - }, - select: { - createdAt: true, - hash: true, - id: true, - label: true, - name: true, - ownerId: true, - platform: true, - schemaHash: true, - updatedAt: true - } - }).execute(); + const result = await client.database + .create({ + data: { + hash: cleanedData.hash, + label: cleanedData.label, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + platform: cleanedData.platform, + schemaHash: cleanedData.schemaHash, + }, + select: { + createdAt: true, + hash: true, + id: true, + label: true, + name: true, + ownerId: true, + platform: true, + schemaHash: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -220,78 +251,88 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "platform", - message: "platform", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaHash", - message: "schemaHash", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'platform', + message: 'platform', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaHash', + message: 'schemaHash', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DatabasePatch; const client = getClient(); - const result = await client.database.update({ - where: { - id: answers.id as string - }, - data: { - hash: cleanedData.hash, - label: cleanedData.label, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - platform: cleanedData.platform, - schemaHash: cleanedData.schemaHash - }, - select: { - createdAt: true, - hash: true, - id: true, - label: true, - name: true, - ownerId: true, - platform: true, - schemaHash: true, - updatedAt: true - } - }).execute(); + const result = await client.database + .update({ + where: { + id: answers.id as string, + }, + data: { + hash: cleanedData.hash, + label: cleanedData.label, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + platform: cleanedData.platform, + schemaHash: cleanedData.schemaHash, + }, + select: { + createdAt: true, + hash: true, + id: true, + label: true, + name: true, + ownerId: true, + platform: true, + schemaHash: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -300,28 +341,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.database.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.database + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/default-privilege.ts b/sdk/constructive-cli/src/api/cli/commands/default-privilege.ts index 1b2533dc51..1afede5495 100644 --- a/sdk/constructive-cli/src/api/cli/commands/default-privilege.ts +++ b/sdk/constructive-cli/src/api/cli/commands/default-privilege.ts @@ -3,55 +3,69 @@ * @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 { CreateDefaultPrivilegeInput, DefaultPrivilegePatch, DefaultPrivilegeSelect, DefaultPrivilegeFilter, DefaultPrivilegeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDefaultPrivilegeInput, + DefaultPrivilegePatch, + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - granteeName: "string", - id: "uuid", - isGrant: "boolean", - objectType: "string", - privilege: "string", - schemaId: "uuid" + databaseId: 'uuid', + granteeName: 'string', + id: 'uuid', + isGrant: 'boolean', + objectType: 'string', + privilege: 'string', + schemaId: 'uuid', }; -const usage = "\ndefault-privilege \n\nCommands:\n list List defaultPrivilege records\n find-first Find first matching defaultPrivilege record\n get Get a defaultPrivilege by ID\n create Create a new defaultPrivilege\n update Update an existing defaultPrivilege\n delete Delete a defaultPrivilege\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) => { +const usage = + '\ndefault-privilege \n\nCommands:\n list List defaultPrivilege records\n find-first Find first matching defaultPrivilege record\n get Get a defaultPrivilege by ID\n create Create a new defaultPrivilege\n update Update an existing defaultPrivilege\n delete Delete a defaultPrivilege\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq isGrant: true, objectType: true, privilege: true, - schemaId: true + schemaId: true, }; - const findManyArgs = parseFindManyArgs & { - select: DefaultPrivilegeSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DefaultPrivilegeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.defaultPrivilege.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter isGrant: true, objectType: true, privilege: true, - schemaId: true + schemaId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DefaultPrivilegeSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DefaultPrivilegeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.defaultPrivilege.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.defaultPrivilege.findOne({ - id: answers.id as string, - select: { - databaseId: true, - granteeName: true, - id: true, - isGrant: true, - objectType: true, - privilege: true, - schemaId: true - } - }).execute(); + const result = await client.defaultPrivilege + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + granteeName: true, + id: true, + isGrant: true, + objectType: true, + privilege: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,64 +162,76 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "objectType", - message: "objectType", - required: true - }, { - type: "text", - name: "privilege", - message: "privilege", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'objectType', + message: 'objectType', + required: true, + }, + { + type: 'text', + name: 'privilege', + message: 'privilege', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDefaultPrivilegeInput["defaultPrivilege"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDefaultPrivilegeInput['defaultPrivilege']; const client = getClient(); - const result = await client.defaultPrivilege.create({ - data: { - databaseId: cleanedData.databaseId, - granteeName: cleanedData.granteeName, - isGrant: cleanedData.isGrant, - objectType: cleanedData.objectType, - privilege: cleanedData.privilege, - schemaId: cleanedData.schemaId - }, - select: { - databaseId: true, - granteeName: true, - id: true, - isGrant: true, - objectType: true, - privilege: true, - schemaId: true - } - }).execute(); + const result = await client.defaultPrivilege + .create({ + data: { + databaseId: cleanedData.databaseId, + granteeName: cleanedData.granteeName, + isGrant: cleanedData.isGrant, + objectType: cleanedData.objectType, + privilege: cleanedData.privilege, + schemaId: cleanedData.schemaId, + }, + select: { + databaseId: true, + granteeName: true, + id: true, + isGrant: true, + objectType: true, + privilege: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -206,72 +240,82 @@ async function handleCreate(argv: Partial>, prompter: In } 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, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: false - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "objectType", - message: "objectType", - required: false - }, { - type: "text", - name: "privilege", - message: "privilege", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: false, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'objectType', + message: 'objectType', + required: false, + }, + { + type: 'text', + name: 'privilege', + message: 'privilege', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DefaultPrivilegePatch; const client = getClient(); - const result = await client.defaultPrivilege.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - granteeName: cleanedData.granteeName, - isGrant: cleanedData.isGrant, - objectType: cleanedData.objectType, - privilege: cleanedData.privilege, - schemaId: cleanedData.schemaId - }, - select: { - databaseId: true, - granteeName: true, - id: true, - isGrant: true, - objectType: true, - privilege: true, - schemaId: true - } - }).execute(); + const result = await client.defaultPrivilege + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + granteeName: cleanedData.granteeName, + isGrant: cleanedData.isGrant, + objectType: cleanedData.objectType, + privilege: cleanedData.privilege, + schemaId: cleanedData.schemaId, + }, + select: { + databaseId: true, + granteeName: true, + id: true, + isGrant: true, + objectType: true, + privilege: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -280,28 +324,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.defaultPrivilege.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.defaultPrivilege + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/domain-event.ts b/sdk/constructive-cli/src/api/cli/commands/domain-event.ts index a102b75690..9b7e9f6a5a 100644 --- a/sdk/constructive-cli/src/api/cli/commands/domain-event.ts +++ b/sdk/constructive-cli/src/api/cli/commands/domain-event.ts @@ -3,59 +3,73 @@ * @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 { CreateDomainEventInput, DomainEventPatch, DomainEventSelect, DomainEventFilter, DomainEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDomainEventInput, + DomainEventPatch, + DomainEventSelect, + DomainEventFilter, + DomainEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - databaseId: "uuid", - domainId: "uuid", - domainVerificationId: "uuid", - eventType: "string", - id: "uuid", - managedDomainId: "uuid", - message: "string", - metadata: "json", - updatedAt: "string" + actorId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + domainId: 'uuid', + domainVerificationId: 'uuid', + eventType: 'string', + id: 'uuid', + managedDomainId: 'uuid', + message: 'string', + metadata: 'json', + updatedAt: 'string', }; -const usage = "\ndomain-event \n\nCommands:\n list List domainEvent records\n find-first Find first matching domainEvent record\n get Get a domainEvent by ID\n create Create a new domainEvent\n update Update an existing domainEvent\n delete Delete a domainEvent\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) => { +const usage = + '\ndomain-event \n\nCommands:\n list List domainEvent records\n find-first Find first matching domainEvent record\n get Get a domainEvent by ID\n create Create a new domainEvent\n update Update an existing domainEvent\n delete Delete a domainEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq managedDomainId: true, message: true, metadata: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DomainEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DomainEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.domainEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter managedDomainId: true, message: true, metadata: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DomainEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DomainEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.domainEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.domainEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - databaseId: true, - domainId: true, - domainVerificationId: true, - eventType: true, - id: true, - managedDomainId: true, - message: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.domainEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + databaseId: true, + domainId: true, + domainVerificationId: true, + eventType: true, + id: true, + managedDomainId: true, + message: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,84 +178,98 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainVerificationId", - message: "domainVerificationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "managedDomainId", - message: "managedDomainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainVerificationId', + message: 'domainVerificationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'managedDomainId', + message: 'managedDomainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDomainEventInput["domainEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDomainEventInput['domainEvent']; const client = getClient(); - const result = await client.domainEvent.create({ - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - domainId: cleanedData.domainId, - domainVerificationId: cleanedData.domainVerificationId, - eventType: cleanedData.eventType, - managedDomainId: cleanedData.managedDomainId, - message: cleanedData.message, - metadata: cleanedData.metadata - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - domainId: true, - domainVerificationId: true, - eventType: true, - id: true, - managedDomainId: true, - message: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.domainEvent + .create({ + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + domainId: cleanedData.domainId, + domainVerificationId: cleanedData.domainVerificationId, + eventType: cleanedData.eventType, + managedDomainId: cleanedData.managedDomainId, + message: cleanedData.message, + metadata: cleanedData.metadata, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + domainId: true, + domainVerificationId: true, + eventType: true, + id: true, + managedDomainId: true, + message: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,92 +278,104 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainVerificationId", - message: "domainVerificationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "managedDomainId", - message: "managedDomainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainVerificationId', + message: 'domainVerificationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'managedDomainId', + message: 'managedDomainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DomainEventPatch; const client = getClient(); - const result = await client.domainEvent.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - domainId: cleanedData.domainId, - domainVerificationId: cleanedData.domainVerificationId, - eventType: cleanedData.eventType, - managedDomainId: cleanedData.managedDomainId, - message: cleanedData.message, - metadata: cleanedData.metadata - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - domainId: true, - domainVerificationId: true, - eventType: true, - id: true, - managedDomainId: true, - message: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.domainEvent + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + domainId: cleanedData.domainId, + domainVerificationId: cleanedData.domainVerificationId, + eventType: cleanedData.eventType, + managedDomainId: cleanedData.managedDomainId, + message: cleanedData.message, + metadata: cleanedData.metadata, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + domainId: true, + domainVerificationId: true, + eventType: true, + id: true, + managedDomainId: true, + message: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -336,28 +384,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.domainEvent.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.domainEvent + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/domain-verification.ts b/sdk/constructive-cli/src/api/cli/commands/domain-verification.ts index 625b1a308a..97f570196b 100644 --- a/sdk/constructive-cli/src/api/cli/commands/domain-verification.ts +++ b/sdk/constructive-cli/src/api/cli/commands/domain-verification.ts @@ -3,64 +3,78 @@ * @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 { CreateDomainVerificationInput, DomainVerificationPatch, DomainVerificationSelect, DomainVerificationFilter, DomainVerificationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDomainVerificationInput, + DomainVerificationPatch, + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - attempts: "int", - createdAt: "string", - databaseId: "uuid", - domainId: "uuid", - error: "string", - expiresAt: "string", - id: "uuid", - lastCheckedAt: "string", - managedDomainId: "uuid", - method: "string", - recordName: "string", - recordType: "string", - recordValue: "string", - status: "string", - updatedAt: "string", - verifiedAt: "string" + attempts: 'int', + createdAt: 'string', + databaseId: 'uuid', + domainId: 'uuid', + error: 'string', + expiresAt: 'string', + id: 'uuid', + lastCheckedAt: 'string', + managedDomainId: 'uuid', + method: 'string', + recordName: 'string', + recordType: 'string', + recordValue: 'string', + status: 'string', + updatedAt: 'string', + verifiedAt: 'string', }; -const usage = "\ndomain-verification \n\nCommands:\n list List domainVerification records\n find-first Find first matching domainVerification record\n get Get a domainVerification by ID\n create Create a new domainVerification\n update Update an existing domainVerification\n delete Delete a domainVerification\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) => { +const usage = + '\ndomain-verification \n\nCommands:\n list List domainVerification records\n find-first Find first matching domainVerification record\n get Get a domainVerification by ID\n create Create a new domainVerification\n update Update an existing domainVerification\n delete Delete a domainVerification\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,22 @@ async function handleList(argv: Partial>, _prompter: Inq recordValue: true, status: true, updatedAt: true, - verifiedAt: true + verifiedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DomainVerificationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy + > & { + select: DomainVerificationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.domainVerification.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +139,22 @@ async function handleFindFirst(argv: Partial>, _prompter recordValue: true, status: true, updatedAt: true, - verifiedAt: true + verifiedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DomainVerificationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy + > & { + select: DomainVerificationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.domainVerification.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +163,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.domainVerification.findOne({ - id: answers.id as string, - select: { - attempts: true, - createdAt: true, - databaseId: true, - domainId: true, - error: true, - expiresAt: true, - id: true, - lastCheckedAt: true, - managedDomainId: true, - method: true, - recordName: true, - recordType: true, - recordValue: true, - status: true, - updatedAt: true, - verifiedAt: true - } - }).execute(); + const result = await client.domainVerification + .findOne({ + id: answers.id as string, + select: { + attempts: true, + createdAt: true, + databaseId: true, + domainId: true, + error: true, + expiresAt: true, + id: true, + lastCheckedAt: true, + managedDomainId: true, + method: true, + recordName: true, + recordType: true, + recordValue: true, + status: true, + updatedAt: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,124 +206,143 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "attempts", - message: "attempts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastCheckedAt", - message: "lastCheckedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "managedDomainId", - message: "managedDomainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: true - }, { - type: "text", - name: "recordName", - message: "recordName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordType", - message: "recordType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordValue", - message: "recordValue", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'attempts', + message: 'attempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastCheckedAt', + message: 'lastCheckedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'managedDomainId', + message: 'managedDomainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: true, + }, + { + type: 'text', + name: 'recordName', + message: 'recordName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordType', + message: 'recordType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordValue', + message: 'recordValue', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDomainVerificationInput["domainVerification"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDomainVerificationInput['domainVerification']; const client = getClient(); - const result = await client.domainVerification.create({ - data: { - attempts: cleanedData.attempts, - databaseId: cleanedData.databaseId, - domainId: cleanedData.domainId, - error: cleanedData.error, - expiresAt: cleanedData.expiresAt, - lastCheckedAt: cleanedData.lastCheckedAt, - managedDomainId: cleanedData.managedDomainId, - method: cleanedData.method, - recordName: cleanedData.recordName, - recordType: cleanedData.recordType, - recordValue: cleanedData.recordValue, - status: cleanedData.status, - verifiedAt: cleanedData.verifiedAt - }, - select: { - attempts: true, - createdAt: true, - databaseId: true, - domainId: true, - error: true, - expiresAt: true, - id: true, - lastCheckedAt: true, - managedDomainId: true, - method: true, - recordName: true, - recordType: true, - recordValue: true, - status: true, - updatedAt: true, - verifiedAt: true - } - }).execute(); + const result = await client.domainVerification + .create({ + data: { + attempts: cleanedData.attempts, + databaseId: cleanedData.databaseId, + domainId: cleanedData.domainId, + error: cleanedData.error, + expiresAt: cleanedData.expiresAt, + lastCheckedAt: cleanedData.lastCheckedAt, + managedDomainId: cleanedData.managedDomainId, + method: cleanedData.method, + recordName: cleanedData.recordName, + recordType: cleanedData.recordType, + recordValue: cleanedData.recordValue, + status: cleanedData.status, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + attempts: true, + createdAt: true, + databaseId: true, + domainId: true, + error: true, + expiresAt: true, + id: true, + lastCheckedAt: true, + managedDomainId: true, + method: true, + recordName: true, + recordType: true, + recordValue: true, + status: true, + updatedAt: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -302,132 +351,149 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "attempts", - message: "attempts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastCheckedAt", - message: "lastCheckedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "managedDomainId", - message: "managedDomainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: false - }, { - type: "text", - name: "recordName", - message: "recordName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordType", - message: "recordType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordValue", - message: "recordValue", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'attempts', + message: 'attempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastCheckedAt', + message: 'lastCheckedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'managedDomainId', + message: 'managedDomainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: false, + }, + { + type: 'text', + name: 'recordName', + message: 'recordName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordType', + message: 'recordType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordValue', + message: 'recordValue', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DomainVerificationPatch; const client = getClient(); - const result = await client.domainVerification.update({ - where: { - id: answers.id as string - }, - data: { - attempts: cleanedData.attempts, - databaseId: cleanedData.databaseId, - domainId: cleanedData.domainId, - error: cleanedData.error, - expiresAt: cleanedData.expiresAt, - lastCheckedAt: cleanedData.lastCheckedAt, - managedDomainId: cleanedData.managedDomainId, - method: cleanedData.method, - recordName: cleanedData.recordName, - recordType: cleanedData.recordType, - recordValue: cleanedData.recordValue, - status: cleanedData.status, - verifiedAt: cleanedData.verifiedAt - }, - select: { - attempts: true, - createdAt: true, - databaseId: true, - domainId: true, - error: true, - expiresAt: true, - id: true, - lastCheckedAt: true, - managedDomainId: true, - method: true, - recordName: true, - recordType: true, - recordValue: true, - status: true, - updatedAt: true, - verifiedAt: true - } - }).execute(); + const result = await client.domainVerification + .update({ + where: { + id: answers.id as string, + }, + data: { + attempts: cleanedData.attempts, + databaseId: cleanedData.databaseId, + domainId: cleanedData.domainId, + error: cleanedData.error, + expiresAt: cleanedData.expiresAt, + lastCheckedAt: cleanedData.lastCheckedAt, + managedDomainId: cleanedData.managedDomainId, + method: cleanedData.method, + recordName: cleanedData.recordName, + recordType: cleanedData.recordType, + recordValue: cleanedData.recordValue, + status: cleanedData.status, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + attempts: true, + createdAt: true, + databaseId: true, + domainId: true, + error: true, + expiresAt: true, + id: true, + lastCheckedAt: true, + managedDomainId: true, + method: true, + recordName: true, + recordType: true, + recordValue: true, + status: true, + updatedAt: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -436,28 +502,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.domainVerification.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.domainVerification + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/domain.ts b/sdk/constructive-cli/src/api/cli/commands/domain.ts index 7600338f99..0d2659d8ad 100644 --- a/sdk/constructive-cli/src/api/cli/commands/domain.ts +++ b/sdk/constructive-cli/src/api/cli/commands/domain.ts @@ -3,63 +3,77 @@ * @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 { CreateDomainInput, DomainPatch, DomainSelect, DomainFilter, DomainOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDomainInput, + DomainPatch, + DomainSelect, + DomainFilter, + DomainOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - config: "json", - createdAt: "string", - databaseId: "uuid", - hostname: "string", - id: "uuid", - isPublished: "boolean", - isWildcard: "boolean", - managed: "boolean", - parentHostname: "string", - tlsReadyAt: "string", - tlsSecretName: "string", - tlsStatus: "string", - updatedAt: "string", - verificationStatus: "string", - verifiedAt: "string" + config: 'json', + createdAt: 'string', + databaseId: 'uuid', + hostname: 'string', + id: 'uuid', + isPublished: 'boolean', + isWildcard: 'boolean', + managed: 'boolean', + parentHostname: 'string', + tlsReadyAt: 'string', + tlsSecretName: 'string', + tlsStatus: 'string', + updatedAt: 'string', + verificationStatus: 'string', + verifiedAt: 'string', }; -const usage = "\ndomain \n\nCommands:\n list List domain records\n find-first Find first matching domain record\n get Get a domain by ID\n create Create a new domain\n update Update an existing domain\n delete Delete a domain\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) => { +const usage = + '\ndomain \n\nCommands:\n list List domain records\n find-first Find first matching domain record\n get Get a domain by ID\n create Create a new domain\n update Update an existing domain\n delete Delete a domain\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -83,16 +97,18 @@ async function handleList(argv: Partial>, _prompter: Inq tlsStatus: true, updatedAt: true, verificationStatus: true, - verifiedAt: true + verifiedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DomainSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DomainSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.domain.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -116,16 +132,18 @@ async function handleFindFirst(argv: Partial>, _prompter tlsStatus: true, updatedAt: true, verificationStatus: true, - verifiedAt: true + verifiedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DomainSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DomainSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.domain.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -134,36 +152,40 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.domain.findOne({ - id: answers.id as string, - select: { - config: true, - createdAt: true, - databaseId: true, - hostname: true, - id: true, - isPublished: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsReadyAt: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.domain + .findOne({ + id: answers.id as string, + select: { + config: true, + createdAt: true, + databaseId: true, + hostname: true, + id: true, + isPublished: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsReadyAt: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -172,116 +194,131 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "hostname", - message: "hostname", - required: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "managed", - message: "managed", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentHostname", - message: "parentHostname", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsReadyAt", - message: "tlsReadyAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsSecretName", - message: "tlsSecretName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'hostname', + message: 'hostname', + required: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'managed', + message: 'managed', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentHostname', + message: 'parentHostname', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsReadyAt', + message: 'tlsReadyAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsSecretName', + message: 'tlsSecretName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDomainInput["domain"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateDomainInput['domain']; const client = getClient(); - const result = await client.domain.create({ - data: { - config: cleanedData.config, - databaseId: cleanedData.databaseId, - hostname: cleanedData.hostname, - isPublished: cleanedData.isPublished, - isWildcard: cleanedData.isWildcard, - managed: cleanedData.managed, - parentHostname: cleanedData.parentHostname, - tlsReadyAt: cleanedData.tlsReadyAt, - tlsSecretName: cleanedData.tlsSecretName, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus, - verifiedAt: cleanedData.verifiedAt - }, - select: { - config: true, - createdAt: true, - databaseId: true, - hostname: true, - id: true, - isPublished: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsReadyAt: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.domain + .create({ + data: { + config: cleanedData.config, + databaseId: cleanedData.databaseId, + hostname: cleanedData.hostname, + isPublished: cleanedData.isPublished, + isWildcard: cleanedData.isWildcard, + managed: cleanedData.managed, + parentHostname: cleanedData.parentHostname, + tlsReadyAt: cleanedData.tlsReadyAt, + tlsSecretName: cleanedData.tlsSecretName, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + config: true, + createdAt: true, + databaseId: true, + hostname: true, + id: true, + isPublished: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsReadyAt: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -290,124 +327,140 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "hostname", - message: "hostname", - required: false - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "managed", - message: "managed", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentHostname", - message: "parentHostname", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsReadyAt", - message: "tlsReadyAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsSecretName", - message: "tlsSecretName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'hostname', + message: 'hostname', + required: false, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'managed', + message: 'managed', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentHostname', + message: 'parentHostname', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsReadyAt', + message: 'tlsReadyAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsSecretName', + message: 'tlsSecretName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DomainPatch; const client = getClient(); - const result = await client.domain.update({ - where: { - id: answers.id as string - }, - data: { - config: cleanedData.config, - databaseId: cleanedData.databaseId, - hostname: cleanedData.hostname, - isPublished: cleanedData.isPublished, - isWildcard: cleanedData.isWildcard, - managed: cleanedData.managed, - parentHostname: cleanedData.parentHostname, - tlsReadyAt: cleanedData.tlsReadyAt, - tlsSecretName: cleanedData.tlsSecretName, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus, - verifiedAt: cleanedData.verifiedAt - }, - select: { - config: true, - createdAt: true, - databaseId: true, - hostname: true, - id: true, - isPublished: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsReadyAt: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.domain + .update({ + where: { + id: answers.id as string, + }, + data: { + config: cleanedData.config, + databaseId: cleanedData.databaseId, + hostname: cleanedData.hostname, + isPublished: cleanedData.isPublished, + isWildcard: cleanedData.isWildcard, + managed: cleanedData.managed, + parentHostname: cleanedData.parentHostname, + tlsReadyAt: cleanedData.tlsReadyAt, + tlsSecretName: cleanedData.tlsSecretName, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + config: true, + createdAt: true, + databaseId: true, + hostname: true, + id: true, + isPublished: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsReadyAt: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -416,28 +469,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.domain.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.domain + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/embedding-chunk.ts b/sdk/constructive-cli/src/api/cli/commands/embedding-chunk.ts index ea2ecbaf59..552b140cb2 100644 --- a/sdk/constructive-cli/src/api/cli/commands/embedding-chunk.ts +++ b/sdk/constructive-cli/src/api/cli/commands/embedding-chunk.ts @@ -3,69 +3,83 @@ * @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 { CreateEmbeddingChunkInput, EmbeddingChunkPatch, EmbeddingChunkSelect, EmbeddingChunkFilter, EmbeddingChunkOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateEmbeddingChunkInput, + EmbeddingChunkPatch, + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - chunkOverlap: "int", - chunkSize: "int", - chunkStrategy: "string", - chunkingTaskName: "string", - chunksTableId: "uuid", - chunksTableName: "string", - contentFieldName: "string", - createdAt: "string", - databaseId: "uuid", - dimensions: "int", - embeddingFieldId: "uuid", - embeddingModel: "string", - embeddingProvider: "string", - enqueueChunkingJob: "boolean", - id: "uuid", - metadataFields: "json", - metric: "string", - parentFkFieldId: "uuid", - searchIndexes: "json", - tableId: "uuid", - updatedAt: "string" + chunkOverlap: 'int', + chunkSize: 'int', + chunkStrategy: 'string', + chunkingTaskName: 'string', + chunksTableId: 'uuid', + chunksTableName: 'string', + contentFieldName: 'string', + createdAt: 'string', + databaseId: 'uuid', + dimensions: 'int', + embeddingFieldId: 'uuid', + embeddingModel: 'string', + embeddingProvider: 'string', + enqueueChunkingJob: 'boolean', + id: 'uuid', + metadataFields: 'json', + metric: 'string', + parentFkFieldId: 'uuid', + searchIndexes: 'json', + tableId: 'uuid', + updatedAt: 'string', }; -const usage = "\nembedding-chunk \n\nCommands:\n list List embeddingChunk records\n find-first Find first matching embeddingChunk record\n get Get a embeddingChunk by ID\n create Create a new embeddingChunk\n update Update an existing embeddingChunk\n delete Delete a embeddingChunk\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) => { +const usage = + '\nembedding-chunk \n\nCommands:\n list List embeddingChunk records\n find-first Find first matching embeddingChunk record\n get Get a embeddingChunk by ID\n create Create a new embeddingChunk\n update Update an existing embeddingChunk\n delete Delete a embeddingChunk\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -95,16 +109,18 @@ async function handleList(argv: Partial>, _prompter: Inq parentFkFieldId: true, searchIndexes: true, tableId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: EmbeddingChunkSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: EmbeddingChunkSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.embeddingChunk.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -134,16 +150,18 @@ async function handleFindFirst(argv: Partial>, _prompter parentFkFieldId: true, searchIndexes: true, tableId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: EmbeddingChunkSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: EmbeddingChunkSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.embeddingChunk.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -152,42 +170,46 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.embeddingChunk.findOne({ - id: answers.id as string, - select: { - chunkOverlap: true, - chunkSize: true, - chunkStrategy: true, - chunkingTaskName: true, - chunksTableId: true, - chunksTableName: true, - contentFieldName: true, - createdAt: true, - databaseId: true, - dimensions: true, - embeddingFieldId: true, - embeddingModel: true, - embeddingProvider: true, - enqueueChunkingJob: true, - id: true, - metadataFields: true, - metric: true, - parentFkFieldId: true, - searchIndexes: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.embeddingChunk + .findOne({ + id: answers.id as string, + select: { + chunkOverlap: true, + chunkSize: true, + chunkStrategy: true, + chunkingTaskName: true, + chunksTableId: true, + chunksTableName: true, + contentFieldName: true, + createdAt: true, + databaseId: true, + dimensions: true, + embeddingFieldId: true, + embeddingModel: true, + embeddingProvider: true, + enqueueChunkingJob: true, + id: true, + metadataFields: true, + metric: true, + parentFkFieldId: true, + searchIndexes: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -196,165 +218,189 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "chunkOverlap", - message: "chunkOverlap", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunkSize", - message: "chunkSize", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunkStrategy", - message: "chunkStrategy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunkingTaskName", - message: "chunkingTaskName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunksTableId", - message: "chunksTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunksTableName", - message: "chunksTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "contentFieldName", - message: "contentFieldName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "dimensions", - message: "dimensions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embeddingFieldId", - message: "embeddingFieldId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embeddingModel", - message: "embeddingModel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embeddingProvider", - message: "embeddingProvider", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enqueueChunkingJob", - message: "enqueueChunkingJob", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadataFields", - message: "metadataFields", - required: false, - skipPrompt: true - }, { - type: "text", - name: "metric", - message: "metric", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentFkFieldId", - message: "parentFkFieldId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "searchIndexes", - message: "searchIndexes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'chunkOverlap', + message: 'chunkOverlap', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunkSize', + message: 'chunkSize', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunkStrategy', + message: 'chunkStrategy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunkingTaskName', + message: 'chunkingTaskName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunksTableId', + message: 'chunksTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunksTableName', + message: 'chunksTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'contentFieldName', + message: 'contentFieldName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'dimensions', + message: 'dimensions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embeddingFieldId', + message: 'embeddingFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embeddingModel', + message: 'embeddingModel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embeddingProvider', + message: 'embeddingProvider', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enqueueChunkingJob', + message: 'enqueueChunkingJob', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadataFields', + message: 'metadataFields', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'metric', + message: 'metric', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentFkFieldId', + message: 'parentFkFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'searchIndexes', + message: 'searchIndexes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateEmbeddingChunkInput["embeddingChunk"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateEmbeddingChunkInput['embeddingChunk']; const client = getClient(); - const result = await client.embeddingChunk.create({ - data: { - chunkOverlap: cleanedData.chunkOverlap, - chunkSize: cleanedData.chunkSize, - chunkStrategy: cleanedData.chunkStrategy, - chunkingTaskName: cleanedData.chunkingTaskName, - chunksTableId: cleanedData.chunksTableId, - chunksTableName: cleanedData.chunksTableName, - contentFieldName: cleanedData.contentFieldName, - databaseId: cleanedData.databaseId, - dimensions: cleanedData.dimensions, - embeddingFieldId: cleanedData.embeddingFieldId, - embeddingModel: cleanedData.embeddingModel, - embeddingProvider: cleanedData.embeddingProvider, - enqueueChunkingJob: cleanedData.enqueueChunkingJob, - metadataFields: cleanedData.metadataFields, - metric: cleanedData.metric, - parentFkFieldId: cleanedData.parentFkFieldId, - searchIndexes: cleanedData.searchIndexes, - tableId: cleanedData.tableId - }, - select: { - chunkOverlap: true, - chunkSize: true, - chunkStrategy: true, - chunkingTaskName: true, - chunksTableId: true, - chunksTableName: true, - contentFieldName: true, - createdAt: true, - databaseId: true, - dimensions: true, - embeddingFieldId: true, - embeddingModel: true, - embeddingProvider: true, - enqueueChunkingJob: true, - id: true, - metadataFields: true, - metric: true, - parentFkFieldId: true, - searchIndexes: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.embeddingChunk + .create({ + data: { + chunkOverlap: cleanedData.chunkOverlap, + chunkSize: cleanedData.chunkSize, + chunkStrategy: cleanedData.chunkStrategy, + chunkingTaskName: cleanedData.chunkingTaskName, + chunksTableId: cleanedData.chunksTableId, + chunksTableName: cleanedData.chunksTableName, + contentFieldName: cleanedData.contentFieldName, + databaseId: cleanedData.databaseId, + dimensions: cleanedData.dimensions, + embeddingFieldId: cleanedData.embeddingFieldId, + embeddingModel: cleanedData.embeddingModel, + embeddingProvider: cleanedData.embeddingProvider, + enqueueChunkingJob: cleanedData.enqueueChunkingJob, + metadataFields: cleanedData.metadataFields, + metric: cleanedData.metric, + parentFkFieldId: cleanedData.parentFkFieldId, + searchIndexes: cleanedData.searchIndexes, + tableId: cleanedData.tableId, + }, + select: { + chunkOverlap: true, + chunkSize: true, + chunkStrategy: true, + chunkingTaskName: true, + chunksTableId: true, + chunksTableName: true, + contentFieldName: true, + createdAt: true, + databaseId: true, + dimensions: true, + embeddingFieldId: true, + embeddingModel: true, + embeddingProvider: true, + enqueueChunkingJob: true, + id: true, + metadataFields: true, + metric: true, + parentFkFieldId: true, + searchIndexes: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -363,173 +409,195 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "chunkOverlap", - message: "chunkOverlap", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunkSize", - message: "chunkSize", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunkStrategy", - message: "chunkStrategy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunkingTaskName", - message: "chunkingTaskName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunksTableId", - message: "chunksTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chunksTableName", - message: "chunksTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "contentFieldName", - message: "contentFieldName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "dimensions", - message: "dimensions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embeddingFieldId", - message: "embeddingFieldId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embeddingModel", - message: "embeddingModel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "embeddingProvider", - message: "embeddingProvider", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enqueueChunkingJob", - message: "enqueueChunkingJob", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadataFields", - message: "metadataFields", - required: false, - skipPrompt: true - }, { - type: "text", - name: "metric", - message: "metric", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentFkFieldId", - message: "parentFkFieldId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "searchIndexes", - message: "searchIndexes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'chunkOverlap', + message: 'chunkOverlap', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunkSize', + message: 'chunkSize', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunkStrategy', + message: 'chunkStrategy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunkingTaskName', + message: 'chunkingTaskName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunksTableId', + message: 'chunksTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chunksTableName', + message: 'chunksTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'contentFieldName', + message: 'contentFieldName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'dimensions', + message: 'dimensions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embeddingFieldId', + message: 'embeddingFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embeddingModel', + message: 'embeddingModel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'embeddingProvider', + message: 'embeddingProvider', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enqueueChunkingJob', + message: 'enqueueChunkingJob', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadataFields', + message: 'metadataFields', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'metric', + message: 'metric', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentFkFieldId', + message: 'parentFkFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'searchIndexes', + message: 'searchIndexes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as EmbeddingChunkPatch; const client = getClient(); - const result = await client.embeddingChunk.update({ - where: { - id: answers.id as string - }, - data: { - chunkOverlap: cleanedData.chunkOverlap, - chunkSize: cleanedData.chunkSize, - chunkStrategy: cleanedData.chunkStrategy, - chunkingTaskName: cleanedData.chunkingTaskName, - chunksTableId: cleanedData.chunksTableId, - chunksTableName: cleanedData.chunksTableName, - contentFieldName: cleanedData.contentFieldName, - databaseId: cleanedData.databaseId, - dimensions: cleanedData.dimensions, - embeddingFieldId: cleanedData.embeddingFieldId, - embeddingModel: cleanedData.embeddingModel, - embeddingProvider: cleanedData.embeddingProvider, - enqueueChunkingJob: cleanedData.enqueueChunkingJob, - metadataFields: cleanedData.metadataFields, - metric: cleanedData.metric, - parentFkFieldId: cleanedData.parentFkFieldId, - searchIndexes: cleanedData.searchIndexes, - tableId: cleanedData.tableId - }, - select: { - chunkOverlap: true, - chunkSize: true, - chunkStrategy: true, - chunkingTaskName: true, - chunksTableId: true, - chunksTableName: true, - contentFieldName: true, - createdAt: true, - databaseId: true, - dimensions: true, - embeddingFieldId: true, - embeddingModel: true, - embeddingProvider: true, - enqueueChunkingJob: true, - id: true, - metadataFields: true, - metric: true, - parentFkFieldId: true, - searchIndexes: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.embeddingChunk + .update({ + where: { + id: answers.id as string, + }, + data: { + chunkOverlap: cleanedData.chunkOverlap, + chunkSize: cleanedData.chunkSize, + chunkStrategy: cleanedData.chunkStrategy, + chunkingTaskName: cleanedData.chunkingTaskName, + chunksTableId: cleanedData.chunksTableId, + chunksTableName: cleanedData.chunksTableName, + contentFieldName: cleanedData.contentFieldName, + databaseId: cleanedData.databaseId, + dimensions: cleanedData.dimensions, + embeddingFieldId: cleanedData.embeddingFieldId, + embeddingModel: cleanedData.embeddingModel, + embeddingProvider: cleanedData.embeddingProvider, + enqueueChunkingJob: cleanedData.enqueueChunkingJob, + metadataFields: cleanedData.metadataFields, + metric: cleanedData.metric, + parentFkFieldId: cleanedData.parentFkFieldId, + searchIndexes: cleanedData.searchIndexes, + tableId: cleanedData.tableId, + }, + select: { + chunkOverlap: true, + chunkSize: true, + chunkStrategy: true, + chunkingTaskName: true, + chunksTableId: true, + chunksTableName: true, + contentFieldName: true, + createdAt: true, + databaseId: true, + dimensions: true, + embeddingFieldId: true, + embeddingModel: true, + embeddingProvider: true, + enqueueChunkingJob: true, + id: true, + metadataFields: true, + metric: true, + parentFkFieldId: true, + searchIndexes: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -538,28 +606,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.embeddingChunk.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.embeddingChunk + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/enum.ts b/sdk/constructive-cli/src/api/cli/commands/enum.ts index c063ee9a2a..36fd3bcd52 100644 --- a/sdk/constructive-cli/src/api/cli/commands/enum.ts +++ b/sdk/constructive-cli/src/api/cli/commands/enum.ts @@ -3,58 +3,72 @@ * @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 { CreateEnumInput, EnumPatch, EnumSelect, EnumFilter, EnumOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateEnumInput, + EnumPatch, + EnumSelect, + EnumFilter, + EnumOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - label: "string", - name: "string", - schemaId: "uuid", - smartTags: "json", - tags: "string", - values: "string" + category: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + label: 'string', + name: 'string', + schemaId: 'uuid', + smartTags: 'json', + tags: 'string', + values: 'string', }; -const usage = "\nenum \n\nCommands:\n list List enum records\n find-first Find first matching enum record\n get Get a enum by ID\n create Create a new enum\n update Update an existing enum\n delete Delete a enum\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) => { +const usage = + '\nenum \n\nCommands:\n list List enum records\n find-first Find first matching enum record\n get Get a enum by ID\n create Create a new enum\n update Update an existing enum\n delete Delete a enum\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, smartTags: true, tags: true, - values: true + values: true, }; - const findManyArgs = parseFindManyArgs & { - select: EnumSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: EnumSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.enum.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, smartTags: true, tags: true, - values: true + values: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: EnumSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: EnumSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.enum.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.enum.findOne({ - id: answers.id as string, - select: { - category: true, - databaseId: true, - description: true, - id: true, - label: true, - name: true, - schemaId: true, - smartTags: true, - tags: true, - values: true - } - }).execute(); + const result = await client.enum + .findOne({ + id: answers.id as string, + select: { + category: true, + databaseId: true, + description: true, + id: true, + label: true, + name: true, + schemaId: true, + smartTags: true, + tags: true, + values: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,89 +174,101 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "values", - message: "values", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'values', + message: 'values', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateEnumInput["enum"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateEnumInput['enum']; const client = getClient(); - const result = await client.enum.create({ - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - label: cleanedData.label, - name: cleanedData.name, - schemaId: cleanedData.schemaId, - smartTags: cleanedData.smartTags, - tags: cleanedData.tags, - values: cleanedData.values - }, - select: { - category: true, - databaseId: true, - description: true, - id: true, - label: true, - name: true, - schemaId: true, - smartTags: true, - tags: true, - values: true - } - }).execute(); + const result = await client.enum + .create({ + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + label: cleanedData.label, + name: cleanedData.name, + schemaId: cleanedData.schemaId, + smartTags: cleanedData.smartTags, + tags: cleanedData.tags, + values: cleanedData.values, + }, + select: { + category: true, + databaseId: true, + description: true, + id: true, + label: true, + name: true, + schemaId: true, + smartTags: true, + tags: true, + values: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -243,97 +277,110 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "values", - message: "values", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'values', + message: 'values', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as EnumPatch; const client = getClient(); - const result = await client.enum.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - label: cleanedData.label, - name: cleanedData.name, - schemaId: cleanedData.schemaId, - smartTags: cleanedData.smartTags, - tags: cleanedData.tags, - values: cleanedData.values - }, - select: { - category: true, - databaseId: true, - description: true, - id: true, - label: true, - name: true, - schemaId: true, - smartTags: true, - tags: true, - values: true - } - }).execute(); + const result = await client.enum + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + label: cleanedData.label, + name: cleanedData.name, + schemaId: cleanedData.schemaId, + smartTags: cleanedData.smartTags, + tags: cleanedData.tags, + values: cleanedData.values, + }, + select: { + category: true, + databaseId: true, + description: true, + id: true, + label: true, + name: true, + schemaId: true, + smartTags: true, + tags: true, + values: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -342,28 +389,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.enum.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.enum + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/exclusion-constraint.ts b/sdk/constructive-cli/src/api/cli/commands/exclusion-constraint.ts index f45d8b74e3..8cc80eba89 100644 --- a/sdk/constructive-cli/src/api/cli/commands/exclusion-constraint.ts +++ b/sdk/constructive-cli/src/api/cli/commands/exclusion-constraint.ts @@ -3,63 +3,77 @@ * @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 { CreateExclusionConstraintInput, ExclusionConstraintPatch, ExclusionConstraintSelect, ExclusionConstraintFilter, ExclusionConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateExclusionConstraintInput, + ExclusionConstraintPatch, + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - accessMethod: "string", - category: "string", - createdAt: "string", - databaseId: "uuid", - elementExpr: "json", - fieldIds: "uuid", - id: "uuid", - name: "string", - operators: "string", - smartTags: "json", - tableId: "uuid", - tags: "string", - type: "string", - updatedAt: "string", - whereClause: "json" + accessMethod: 'string', + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + elementExpr: 'json', + fieldIds: 'uuid', + id: 'uuid', + name: 'string', + operators: 'string', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + type: 'string', + updatedAt: 'string', + whereClause: 'json', }; -const usage = "\nexclusion-constraint \n\nCommands:\n list List exclusionConstraint records\n find-first Find first matching exclusionConstraint record\n get Get a exclusionConstraint by ID\n create Create a new exclusionConstraint\n update Update an existing exclusionConstraint\n delete Delete a exclusionConstraint\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) => { +const usage = + '\nexclusion-constraint \n\nCommands:\n list List exclusionConstraint records\n find-first Find first matching exclusionConstraint record\n get Get a exclusionConstraint by ID\n create Create a new exclusionConstraint\n update Update an existing exclusionConstraint\n delete Delete a exclusionConstraint\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -83,16 +97,22 @@ async function handleList(argv: Partial>, _prompter: Inq tags: true, type: true, updatedAt: true, - whereClause: true + whereClause: true, }; - const findManyArgs = parseFindManyArgs & { - select: ExclusionConstraintSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy + > & { + select: ExclusionConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.exclusionConstraint.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -116,16 +136,22 @@ async function handleFindFirst(argv: Partial>, _prompter tags: true, type: true, updatedAt: true, - whereClause: true + whereClause: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ExclusionConstraintSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy + > & { + select: ExclusionConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.exclusionConstraint.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -134,36 +160,40 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.exclusionConstraint.findOne({ - id: answers.id as string, - select: { - accessMethod: true, - category: true, - createdAt: true, - databaseId: true, - elementExpr: true, - fieldIds: true, - id: true, - name: true, - operators: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - whereClause: true - } - }).execute(); + const result = await client.exclusionConstraint + .findOne({ + id: answers.id as string, + select: { + accessMethod: true, + category: true, + createdAt: true, + databaseId: true, + elementExpr: true, + fieldIds: true, + id: true, + name: true, + operators: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + whereClause: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -172,117 +202,135 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "accessMethod", - message: "accessMethod", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "elementExpr", - message: "elementExpr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "operators", - message: "operators", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "json", - name: "whereClause", - message: "whereClause", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'accessMethod', + message: 'accessMethod', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'elementExpr', + message: 'elementExpr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'operators', + message: 'operators', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'whereClause', + message: 'whereClause', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateExclusionConstraintInput["exclusionConstraint"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateExclusionConstraintInput['exclusionConstraint']; const client = getClient(); - const result = await client.exclusionConstraint.create({ - data: { - accessMethod: cleanedData.accessMethod, - category: cleanedData.category, - databaseId: cleanedData.databaseId, - elementExpr: cleanedData.elementExpr, - fieldIds: cleanedData.fieldIds, - name: cleanedData.name, - operators: cleanedData.operators, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type, - whereClause: cleanedData.whereClause - }, - select: { - accessMethod: true, - category: true, - createdAt: true, - databaseId: true, - elementExpr: true, - fieldIds: true, - id: true, - name: true, - operators: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - whereClause: true - } - }).execute(); + const result = await client.exclusionConstraint + .create({ + data: { + accessMethod: cleanedData.accessMethod, + category: cleanedData.category, + databaseId: cleanedData.databaseId, + elementExpr: cleanedData.elementExpr, + fieldIds: cleanedData.fieldIds, + name: cleanedData.name, + operators: cleanedData.operators, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + whereClause: cleanedData.whereClause, + }, + select: { + accessMethod: true, + category: true, + createdAt: true, + databaseId: true, + elementExpr: true, + fieldIds: true, + id: true, + name: true, + operators: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + whereClause: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -291,125 +339,141 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "accessMethod", - message: "accessMethod", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "elementExpr", - message: "elementExpr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "operators", - message: "operators", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "json", - name: "whereClause", - message: "whereClause", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'accessMethod', + message: 'accessMethod', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'elementExpr', + message: 'elementExpr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'operators', + message: 'operators', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'whereClause', + message: 'whereClause', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ExclusionConstraintPatch; const client = getClient(); - const result = await client.exclusionConstraint.update({ - where: { - id: answers.id as string - }, - data: { - accessMethod: cleanedData.accessMethod, - category: cleanedData.category, - databaseId: cleanedData.databaseId, - elementExpr: cleanedData.elementExpr, - fieldIds: cleanedData.fieldIds, - name: cleanedData.name, - operators: cleanedData.operators, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type, - whereClause: cleanedData.whereClause - }, - select: { - accessMethod: true, - category: true, - createdAt: true, - databaseId: true, - elementExpr: true, - fieldIds: true, - id: true, - name: true, - operators: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - whereClause: true - } - }).execute(); + const result = await client.exclusionConstraint + .update({ + where: { + id: answers.id as string, + }, + data: { + accessMethod: cleanedData.accessMethod, + category: cleanedData.category, + databaseId: cleanedData.databaseId, + elementExpr: cleanedData.elementExpr, + fieldIds: cleanedData.fieldIds, + name: cleanedData.name, + operators: cleanedData.operators, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + whereClause: cleanedData.whereClause, + }, + select: { + accessMethod: true, + category: true, + createdAt: true, + databaseId: true, + elementExpr: true, + fieldIds: true, + id: true, + name: true, + operators: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + whereClause: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -418,28 +482,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.exclusionConstraint.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.exclusionConstraint + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/field.ts b/sdk/constructive-cli/src/api/cli/commands/field.ts index 44a931ae8f..314d33287f 100644 --- a/sdk/constructive-cli/src/api/cli/commands/field.ts +++ b/sdk/constructive-cli/src/api/cli/commands/field.ts @@ -3,73 +3,87 @@ * @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 { CreateFieldInput, FieldPatch, FieldSelect, FieldFilter, FieldOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFieldInput, + FieldPatch, + FieldSelect, + FieldFilter, + FieldOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiRequired: "boolean", - category: "string", - chk: "json", - chkExpr: "json", - createdAt: "string", - databaseId: "uuid", - defaultValue: "json", - description: "string", - fieldOrder: "int", - generationExpression: "json", - generationType: "string", - id: "uuid", - identityGeneration: "string", - identityOptions: "json", - isRequired: "boolean", - label: "string", - max: "float", - min: "float", - name: "string", - regexp: "string", - smartTags: "json", - tableId: "uuid", - tags: "string", - type: "json", - updatedAt: "string" + apiRequired: 'boolean', + category: 'string', + chk: 'json', + chkExpr: 'json', + createdAt: 'string', + databaseId: 'uuid', + defaultValue: 'json', + description: 'string', + fieldOrder: 'int', + generationExpression: 'json', + generationType: 'string', + id: 'uuid', + identityGeneration: 'string', + identityOptions: 'json', + isRequired: 'boolean', + label: 'string', + max: 'float', + min: 'float', + name: 'string', + regexp: 'string', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + type: 'json', + updatedAt: 'string', }; -const usage = "\nfield \n\nCommands:\n list List field records\n find-first Find first matching field record\n get Get a field by ID\n create Create a new field\n update Update an existing field\n delete Delete a field\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) => { +const usage = + '\nfield \n\nCommands:\n list List field records\n find-first Find first matching field record\n get Get a field by ID\n create Create a new field\n update Update an existing field\n delete Delete a field\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -103,16 +117,18 @@ async function handleList(argv: Partial>, _prompter: Inq tableId: true, tags: true, type: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: FieldSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: FieldSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.field.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -146,16 +162,18 @@ async function handleFindFirst(argv: Partial>, _prompter tableId: true, tags: true, type: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FieldSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: FieldSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.field.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -164,46 +182,50 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.field.findOne({ - id: answers.id as string, - select: { - apiRequired: true, - category: true, - chk: true, - chkExpr: true, - createdAt: true, - databaseId: true, - defaultValue: true, - description: true, - fieldOrder: true, - generationExpression: true, - generationType: true, - id: true, - identityGeneration: true, - identityOptions: true, - isRequired: true, - label: true, - max: true, - min: true, - name: true, - regexp: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true - } - }).execute(); + const result = await client.field + .findOne({ + id: answers.id as string, + select: { + apiRequired: true, + category: true, + chk: true, + chkExpr: true, + createdAt: true, + databaseId: true, + defaultValue: true, + description: true, + fieldOrder: true, + generationExpression: true, + generationType: true, + id: true, + identityGeneration: true, + identityOptions: true, + isRequired: true, + label: true, + max: true, + min: true, + name: true, + regexp: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -212,195 +234,220 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "apiRequired", - message: "apiRequired", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "json", - name: "chk", - message: "chk", - required: false, - skipPrompt: true - }, { - type: "json", - name: "chkExpr", - message: "chkExpr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "defaultValue", - message: "defaultValue", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldOrder", - message: "fieldOrder", - required: false, - skipPrompt: true - }, { - type: "json", - name: "generationExpression", - message: "generationExpression", - required: false, - skipPrompt: true - }, { - type: "text", - name: "generationType", - message: "generationType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "identityGeneration", - message: "identityGeneration", - required: false, - skipPrompt: true - }, { - type: "json", - name: "identityOptions", - message: "identityOptions", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isRequired", - message: "isRequired", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "min", - message: "min", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "regexp", - message: "regexp", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "json", - name: "type", - message: "type", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'apiRequired', + message: 'apiRequired', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'chk', + message: 'chk', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'chkExpr', + message: 'chkExpr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'defaultValue', + message: 'defaultValue', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldOrder', + message: 'fieldOrder', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'generationExpression', + message: 'generationExpression', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'generationType', + message: 'generationType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'identityGeneration', + message: 'identityGeneration', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'identityOptions', + message: 'identityOptions', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isRequired', + message: 'isRequired', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'min', + message: 'min', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'regexp', + message: 'regexp', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'type', + message: 'type', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFieldInput["field"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateFieldInput['field']; const client = getClient(); - const result = await client.field.create({ - data: { - apiRequired: cleanedData.apiRequired, - category: cleanedData.category, - chk: cleanedData.chk, - chkExpr: cleanedData.chkExpr, - databaseId: cleanedData.databaseId, - defaultValue: cleanedData.defaultValue, - description: cleanedData.description, - fieldOrder: cleanedData.fieldOrder, - generationExpression: cleanedData.generationExpression, - generationType: cleanedData.generationType, - identityGeneration: cleanedData.identityGeneration, - identityOptions: cleanedData.identityOptions, - isRequired: cleanedData.isRequired, - label: cleanedData.label, - max: cleanedData.max, - min: cleanedData.min, - name: cleanedData.name, - regexp: cleanedData.regexp, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type - }, - select: { - apiRequired: true, - category: true, - chk: true, - chkExpr: true, - createdAt: true, - databaseId: true, - defaultValue: true, - description: true, - fieldOrder: true, - generationExpression: true, - generationType: true, - id: true, - identityGeneration: true, - identityOptions: true, - isRequired: true, - label: true, - max: true, - min: true, - name: true, - regexp: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true - } - }).execute(); + const result = await client.field + .create({ + data: { + apiRequired: cleanedData.apiRequired, + category: cleanedData.category, + chk: cleanedData.chk, + chkExpr: cleanedData.chkExpr, + databaseId: cleanedData.databaseId, + defaultValue: cleanedData.defaultValue, + description: cleanedData.description, + fieldOrder: cleanedData.fieldOrder, + generationExpression: cleanedData.generationExpression, + generationType: cleanedData.generationType, + identityGeneration: cleanedData.identityGeneration, + identityOptions: cleanedData.identityOptions, + isRequired: cleanedData.isRequired, + label: cleanedData.label, + max: cleanedData.max, + min: cleanedData.min, + name: cleanedData.name, + regexp: cleanedData.regexp, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + }, + select: { + apiRequired: true, + category: true, + chk: true, + chkExpr: true, + createdAt: true, + databaseId: true, + defaultValue: true, + description: true, + fieldOrder: true, + generationExpression: true, + generationType: true, + id: true, + identityGeneration: true, + identityOptions: true, + isRequired: true, + label: true, + max: true, + min: true, + name: true, + regexp: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -409,203 +456,229 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "apiRequired", - message: "apiRequired", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "json", - name: "chk", - message: "chk", - required: false, - skipPrompt: true - }, { - type: "json", - name: "chkExpr", - message: "chkExpr", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "defaultValue", - message: "defaultValue", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldOrder", - message: "fieldOrder", - required: false, - skipPrompt: true - }, { - type: "json", - name: "generationExpression", - message: "generationExpression", - required: false, - skipPrompt: true - }, { - type: "text", - name: "generationType", - message: "generationType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "identityGeneration", - message: "identityGeneration", - required: false, - skipPrompt: true - }, { - type: "json", - name: "identityOptions", - message: "identityOptions", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isRequired", - message: "isRequired", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "min", - message: "min", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "regexp", - message: "regexp", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "json", - name: "type", - message: "type", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'apiRequired', + message: 'apiRequired', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'chk', + message: 'chk', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'chkExpr', + message: 'chkExpr', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'defaultValue', + message: 'defaultValue', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldOrder', + message: 'fieldOrder', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'generationExpression', + message: 'generationExpression', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'generationType', + message: 'generationType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'identityGeneration', + message: 'identityGeneration', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'identityOptions', + message: 'identityOptions', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isRequired', + message: 'isRequired', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'min', + message: 'min', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'regexp', + message: 'regexp', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'type', + message: 'type', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FieldPatch; const client = getClient(); - const result = await client.field.update({ - where: { - id: answers.id as string - }, - data: { - apiRequired: cleanedData.apiRequired, - category: cleanedData.category, - chk: cleanedData.chk, - chkExpr: cleanedData.chkExpr, - databaseId: cleanedData.databaseId, - defaultValue: cleanedData.defaultValue, - description: cleanedData.description, - fieldOrder: cleanedData.fieldOrder, - generationExpression: cleanedData.generationExpression, - generationType: cleanedData.generationType, - identityGeneration: cleanedData.identityGeneration, - identityOptions: cleanedData.identityOptions, - isRequired: cleanedData.isRequired, - label: cleanedData.label, - max: cleanedData.max, - min: cleanedData.min, - name: cleanedData.name, - regexp: cleanedData.regexp, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type - }, - select: { - apiRequired: true, - category: true, - chk: true, - chkExpr: true, - createdAt: true, - databaseId: true, - defaultValue: true, - description: true, - fieldOrder: true, - generationExpression: true, - generationType: true, - id: true, - identityGeneration: true, - identityOptions: true, - isRequired: true, - label: true, - max: true, - min: true, - name: true, - regexp: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true - } - }).execute(); + const result = await client.field + .update({ + where: { + id: answers.id as string, + }, + data: { + apiRequired: cleanedData.apiRequired, + category: cleanedData.category, + chk: cleanedData.chk, + chkExpr: cleanedData.chkExpr, + databaseId: cleanedData.databaseId, + defaultValue: cleanedData.defaultValue, + description: cleanedData.description, + fieldOrder: cleanedData.fieldOrder, + generationExpression: cleanedData.generationExpression, + generationType: cleanedData.generationType, + identityGeneration: cleanedData.identityGeneration, + identityOptions: cleanedData.identityOptions, + isRequired: cleanedData.isRequired, + label: cleanedData.label, + max: cleanedData.max, + min: cleanedData.min, + name: cleanedData.name, + regexp: cleanedData.regexp, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + }, + select: { + apiRequired: true, + category: true, + chk: true, + chkExpr: true, + createdAt: true, + databaseId: true, + defaultValue: true, + description: true, + fieldOrder: true, + generationExpression: true, + generationType: true, + id: true, + identityGeneration: true, + identityOptions: true, + isRequired: true, + label: true, + max: true, + min: true, + name: true, + regexp: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -614,28 +687,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.field.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.field + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/foreign-key-constraint.ts b/sdk/constructive-cli/src/api/cli/commands/foreign-key-constraint.ts index aed147d32e..81a46e9cf9 100644 --- a/sdk/constructive-cli/src/api/cli/commands/foreign-key-constraint.ts +++ b/sdk/constructive-cli/src/api/cli/commands/foreign-key-constraint.ts @@ -3,68 +3,82 @@ * @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 { CreateForeignKeyConstraintInput, ForeignKeyConstraintPatch, ForeignKeyConstraintSelect, ForeignKeyConstraintFilter, ForeignKeyConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateForeignKeyConstraintInput, + ForeignKeyConstraintPatch, + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - createdAt: "string", - databaseId: "uuid", - deleteAction: "string", - deleteSetFieldIds: "uuid", - description: "string", - fieldIds: "uuid", - id: "uuid", - initiallyDeferred: "boolean", - isDeferrable: "boolean", - name: "string", - refFieldIds: "uuid", - refTableId: "uuid", - smartTags: "json", - tableId: "uuid", - tags: "string", - type: "string", - updateAction: "string", - updatedAt: "string", - withPeriod: "boolean" + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + deleteAction: 'string', + deleteSetFieldIds: 'uuid', + description: 'string', + fieldIds: 'uuid', + id: 'uuid', + initiallyDeferred: 'boolean', + isDeferrable: 'boolean', + name: 'string', + refFieldIds: 'uuid', + refTableId: 'uuid', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + type: 'string', + updateAction: 'string', + updatedAt: 'string', + withPeriod: 'boolean', }; -const usage = "\nforeign-key-constraint \n\nCommands:\n list List foreignKeyConstraint records\n find-first Find first matching foreignKeyConstraint record\n get Get a foreignKeyConstraint by ID\n create Create a new foreignKeyConstraint\n update Update an existing foreignKeyConstraint\n delete Delete a foreignKeyConstraint\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) => { +const usage = + '\nforeign-key-constraint \n\nCommands:\n list List foreignKeyConstraint records\n find-first Find first matching foreignKeyConstraint record\n get Get a foreignKeyConstraint by ID\n create Create a new foreignKeyConstraint\n update Update an existing foreignKeyConstraint\n delete Delete a foreignKeyConstraint\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,22 @@ async function handleList(argv: Partial>, _prompter: Inq type: true, updateAction: true, updatedAt: true, - withPeriod: true + withPeriod: true, }; - const findManyArgs = parseFindManyArgs & { - select: ForeignKeyConstraintSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy + > & { + select: ForeignKeyConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.foreignKeyConstraint.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +151,22 @@ async function handleFindFirst(argv: Partial>, _prompter type: true, updateAction: true, updatedAt: true, - withPeriod: true + withPeriod: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ForeignKeyConstraintSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy + > & { + select: ForeignKeyConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.foreignKeyConstraint.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +175,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.foreignKeyConstraint.findOne({ - id: answers.id as string, - select: { - category: true, - createdAt: true, - databaseId: true, - deleteAction: true, - deleteSetFieldIds: true, - description: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - refFieldIds: true, - refTableId: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updateAction: true, - updatedAt: true, - withPeriod: true - } - }).execute(); + const result = await client.foreignKeyConstraint + .findOne({ + id: answers.id as string, + select: { + category: true, + createdAt: true, + databaseId: true, + deleteAction: true, + deleteSetFieldIds: true, + description: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + refFieldIds: true, + refTableId: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updateAction: true, + updatedAt: true, + withPeriod: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,154 +222,177 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deleteAction", - message: "deleteAction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deleteSetFieldIds", - message: "deleteSetFieldIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: true - }, { - type: "boolean", - name: "initiallyDeferred", - message: "initiallyDeferred", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDeferrable", - message: "isDeferrable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refFieldIds", - message: "refFieldIds", - required: true - }, { - type: "text", - name: "refTableId", - message: "refTableId", - required: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updateAction", - message: "updateAction", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "withPeriod", - message: "withPeriod", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deleteAction', + message: 'deleteAction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deleteSetFieldIds', + message: 'deleteSetFieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: true, + }, + { + type: 'boolean', + name: 'initiallyDeferred', + message: 'initiallyDeferred', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDeferrable', + message: 'isDeferrable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refFieldIds', + message: 'refFieldIds', + required: true, + }, + { + type: 'text', + name: 'refTableId', + message: 'refTableId', + required: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updateAction', + message: 'updateAction', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'withPeriod', + message: 'withPeriod', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateForeignKeyConstraintInput["foreignKeyConstraint"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateForeignKeyConstraintInput['foreignKeyConstraint']; const client = getClient(); - const result = await client.foreignKeyConstraint.create({ - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - deleteAction: cleanedData.deleteAction, - deleteSetFieldIds: cleanedData.deleteSetFieldIds, - description: cleanedData.description, - fieldIds: cleanedData.fieldIds, - initiallyDeferred: cleanedData.initiallyDeferred, - isDeferrable: cleanedData.isDeferrable, - name: cleanedData.name, - refFieldIds: cleanedData.refFieldIds, - refTableId: cleanedData.refTableId, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type, - updateAction: cleanedData.updateAction, - withPeriod: cleanedData.withPeriod - }, - select: { - category: true, - createdAt: true, - databaseId: true, - deleteAction: true, - deleteSetFieldIds: true, - description: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - refFieldIds: true, - refTableId: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updateAction: true, - updatedAt: true, - withPeriod: true - } - }).execute(); + const result = await client.foreignKeyConstraint + .create({ + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + deleteAction: cleanedData.deleteAction, + deleteSetFieldIds: cleanedData.deleteSetFieldIds, + description: cleanedData.description, + fieldIds: cleanedData.fieldIds, + initiallyDeferred: cleanedData.initiallyDeferred, + isDeferrable: cleanedData.isDeferrable, + name: cleanedData.name, + refFieldIds: cleanedData.refFieldIds, + refTableId: cleanedData.refTableId, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + updateAction: cleanedData.updateAction, + withPeriod: cleanedData.withPeriod, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + deleteAction: true, + deleteSetFieldIds: true, + description: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + refFieldIds: true, + refTableId: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updateAction: true, + updatedAt: true, + withPeriod: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -348,162 +401,183 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deleteAction", - message: "deleteAction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deleteSetFieldIds", - message: "deleteSetFieldIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false - }, { - type: "boolean", - name: "initiallyDeferred", - message: "initiallyDeferred", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDeferrable", - message: "isDeferrable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refFieldIds", - message: "refFieldIds", - required: false - }, { - type: "text", - name: "refTableId", - message: "refTableId", - required: false - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updateAction", - message: "updateAction", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "withPeriod", - message: "withPeriod", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deleteAction', + message: 'deleteAction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deleteSetFieldIds', + message: 'deleteSetFieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + }, + { + type: 'boolean', + name: 'initiallyDeferred', + message: 'initiallyDeferred', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDeferrable', + message: 'isDeferrable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refFieldIds', + message: 'refFieldIds', + required: false, + }, + { + type: 'text', + name: 'refTableId', + message: 'refTableId', + required: false, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updateAction', + message: 'updateAction', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'withPeriod', + message: 'withPeriod', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ForeignKeyConstraintPatch; const client = getClient(); - const result = await client.foreignKeyConstraint.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - deleteAction: cleanedData.deleteAction, - deleteSetFieldIds: cleanedData.deleteSetFieldIds, - description: cleanedData.description, - fieldIds: cleanedData.fieldIds, - initiallyDeferred: cleanedData.initiallyDeferred, - isDeferrable: cleanedData.isDeferrable, - name: cleanedData.name, - refFieldIds: cleanedData.refFieldIds, - refTableId: cleanedData.refTableId, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type, - updateAction: cleanedData.updateAction, - withPeriod: cleanedData.withPeriod - }, - select: { - category: true, - createdAt: true, - databaseId: true, - deleteAction: true, - deleteSetFieldIds: true, - description: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - refFieldIds: true, - refTableId: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updateAction: true, - updatedAt: true, - withPeriod: true - } - }).execute(); + const result = await client.foreignKeyConstraint + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + deleteAction: cleanedData.deleteAction, + deleteSetFieldIds: cleanedData.deleteSetFieldIds, + description: cleanedData.description, + fieldIds: cleanedData.fieldIds, + initiallyDeferred: cleanedData.initiallyDeferred, + isDeferrable: cleanedData.isDeferrable, + name: cleanedData.name, + refFieldIds: cleanedData.refFieldIds, + refTableId: cleanedData.refTableId, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + updateAction: cleanedData.updateAction, + withPeriod: cleanedData.withPeriod, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + deleteAction: true, + deleteSetFieldIds: true, + description: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + refFieldIds: true, + refTableId: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updateAction: true, + updatedAt: true, + withPeriod: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -512,28 +586,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.foreignKeyConstraint.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.foreignKeyConstraint + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/full-text-search.ts b/sdk/constructive-cli/src/api/cli/commands/full-text-search.ts index 9938669374..2cc1bd7ee0 100644 --- a/sdk/constructive-cli/src/api/cli/commands/full-text-search.ts +++ b/sdk/constructive-cli/src/api/cli/commands/full-text-search.ts @@ -3,58 +3,72 @@ * @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 { CreateFullTextSearchInput, FullTextSearchPatch, FullTextSearchSelect, FullTextSearchFilter, FullTextSearchOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFullTextSearchInput, + FullTextSearchPatch, + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - fieldId: "uuid", - fieldIds: "uuid", - id: "uuid", - langColumn: "string", - langs: "string", - tableId: "uuid", - updatedAt: "string", - weights: "string" + createdAt: 'string', + databaseId: 'uuid', + fieldId: 'uuid', + fieldIds: 'uuid', + id: 'uuid', + langColumn: 'string', + langs: 'string', + tableId: 'uuid', + updatedAt: 'string', + weights: 'string', }; -const usage = "\nfull-text-search \n\nCommands:\n list List fullTextSearch records\n find-first Find first matching fullTextSearch record\n get Get a fullTextSearch by ID\n create Create a new fullTextSearch\n update Update an existing fullTextSearch\n delete Delete a fullTextSearch\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) => { +const usage = + '\nfull-text-search \n\nCommands:\n list List fullTextSearch records\n find-first Find first matching fullTextSearch record\n get Get a fullTextSearch by ID\n create Create a new fullTextSearch\n update Update an existing fullTextSearch\n delete Delete a fullTextSearch\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq langs: true, tableId: true, updatedAt: true, - weights: true + weights: true, }; - const findManyArgs = parseFindManyArgs & { - select: FullTextSearchSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: FullTextSearchSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.fullTextSearch.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter langs: true, tableId: true, updatedAt: true, - weights: true + weights: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FullTextSearchSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: FullTextSearchSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.fullTextSearch.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.fullTextSearch.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - fieldId: true, - fieldIds: true, - id: true, - langColumn: true, - langs: true, - tableId: true, - updatedAt: true, - weights: true - } - }).execute(); + const result = await client.fullTextSearch + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + fieldId: true, + fieldIds: true, + id: true, + langColumn: true, + langs: true, + tableId: true, + updatedAt: true, + weights: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,73 +174,86 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldId", - message: "fieldId", - required: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: true - }, { - type: "text", - name: "langColumn", - message: "langColumn", - required: false, - skipPrompt: true - }, { - type: "text", - name: "langs", - message: "langs", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "weights", - message: "weights", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldId', + message: 'fieldId', + required: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: true, + }, + { + type: 'text', + name: 'langColumn', + message: 'langColumn', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'langs', + message: 'langs', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'weights', + message: 'weights', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFullTextSearchInput["fullTextSearch"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFullTextSearchInput['fullTextSearch']; const client = getClient(); - const result = await client.fullTextSearch.create({ - data: { - databaseId: cleanedData.databaseId, - fieldId: cleanedData.fieldId, - fieldIds: cleanedData.fieldIds, - langColumn: cleanedData.langColumn, - langs: cleanedData.langs, - tableId: cleanedData.tableId, - weights: cleanedData.weights - }, - select: { - createdAt: true, - databaseId: true, - fieldId: true, - fieldIds: true, - id: true, - langColumn: true, - langs: true, - tableId: true, - updatedAt: true, - weights: true - } - }).execute(); + const result = await client.fullTextSearch + .create({ + data: { + databaseId: cleanedData.databaseId, + fieldId: cleanedData.fieldId, + fieldIds: cleanedData.fieldIds, + langColumn: cleanedData.langColumn, + langs: cleanedData.langs, + tableId: cleanedData.tableId, + weights: cleanedData.weights, + }, + select: { + createdAt: true, + databaseId: true, + fieldId: true, + fieldIds: true, + id: true, + langColumn: true, + langs: true, + tableId: true, + updatedAt: true, + weights: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -227,81 +262,92 @@ async function handleCreate(argv: Partial>, prompter: In } 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, - skipPrompt: true - }, { - type: "text", - name: "fieldId", - message: "fieldId", - required: false - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false - }, { - type: "text", - name: "langColumn", - message: "langColumn", - required: false, - skipPrompt: true - }, { - type: "text", - name: "langs", - message: "langs", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "weights", - message: "weights", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldId', + message: 'fieldId', + required: false, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + }, + { + type: 'text', + name: 'langColumn', + message: 'langColumn', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'langs', + message: 'langs', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'weights', + message: 'weights', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FullTextSearchPatch; const client = getClient(); - const result = await client.fullTextSearch.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - fieldId: cleanedData.fieldId, - fieldIds: cleanedData.fieldIds, - langColumn: cleanedData.langColumn, - langs: cleanedData.langs, - tableId: cleanedData.tableId, - weights: cleanedData.weights - }, - select: { - createdAt: true, - databaseId: true, - fieldId: true, - fieldIds: true, - id: true, - langColumn: true, - langs: true, - tableId: true, - updatedAt: true, - weights: true - } - }).execute(); + const result = await client.fullTextSearch + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + fieldId: cleanedData.fieldId, + fieldIds: cleanedData.fieldIds, + langColumn: cleanedData.langColumn, + langs: cleanedData.langs, + tableId: cleanedData.tableId, + weights: cleanedData.weights, + }, + select: { + createdAt: true, + databaseId: true, + fieldId: true, + fieldIds: true, + id: true, + langColumn: true, + langs: true, + tableId: true, + updatedAt: true, + weights: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -310,28 +356,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.fullTextSearch.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.fullTextSearch + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/function.ts b/sdk/constructive-cli/src/api/cli/commands/function.ts index 19741cf841..54ba65cab3 100644 --- a/sdk/constructive-cli/src/api/cli/commands/function.ts +++ b/sdk/constructive-cli/src/api/cli/commands/function.ts @@ -3,52 +3,66 @@ * @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 { CreateFunctionInput, FunctionPatch, FunctionSelect, FunctionFilter, FunctionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionInput, + FunctionPatch, + FunctionSelect, + FunctionFilter, + FunctionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - id: "uuid", - name: "string", - schemaId: "uuid" + databaseId: 'uuid', + id: 'uuid', + name: 'string', + schemaId: 'uuid', }; -const usage = "\nfunction \n\nCommands:\n list List function records\n find-first Find first matching function record\n get Get a function by ID\n create Create a new function\n update Update an existing function\n delete Delete a function\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) => { +const usage = + '\nfunction \n\nCommands:\n list List function records\n find-first Find first matching function record\n get Get a function by ID\n create Create a new function\n update Update an existing function\n delete Delete a function\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -61,16 +75,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, name: true, - schemaId: true + schemaId: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: FunctionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.function.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -83,16 +99,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, name: true, - schemaId: true + schemaId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: FunctionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.function.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -101,25 +119,29 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.function.findOne({ - id: answers.id as string, - select: { - databaseId: true, - id: true, - name: true, - schemaId: true - } - }).execute(); + const result = await client.function + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + id: true, + name: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -128,41 +150,47 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "name", - message: "name", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionInput["function"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionInput['function']; const client = getClient(); - const result = await client.function.create({ - data: { - databaseId: cleanedData.databaseId, - name: cleanedData.name, - schemaId: cleanedData.schemaId - }, - select: { - databaseId: true, - id: true, - name: true, - schemaId: true - } - }).execute(); + const result = await client.function + .create({ + data: { + databaseId: cleanedData.databaseId, + name: cleanedData.name, + schemaId: cleanedData.schemaId, + }, + select: { + databaseId: true, + id: true, + name: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -171,49 +199,56 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "name", - message: "name", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }]); + 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: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionPatch; const client = getClient(); - const result = await client.function.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - name: cleanedData.name, - schemaId: cleanedData.schemaId - }, - select: { - databaseId: true, - id: true, - name: true, - schemaId: true - } - }).execute(); + const result = await client.function + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + name: cleanedData.name, + schemaId: cleanedData.schemaId, + }, + select: { + databaseId: true, + id: true, + name: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -222,28 +257,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.function.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.function + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/hostname-binding.ts b/sdk/constructive-cli/src/api/cli/commands/hostname-binding.ts index 36c4683149..fae7b2e3e8 100644 --- a/sdk/constructive-cli/src/api/cli/commands/hostname-binding.ts +++ b/sdk/constructive-cli/src/api/cli/commands/hostname-binding.ts @@ -3,58 +3,72 @@ * @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 { CreateHostnameBindingInput, HostnameBindingPatch, HostnameBindingSelect, HostnameBindingFilter, HostnameBindingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateHostnameBindingInput, + HostnameBindingPatch, + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - domainId: "uuid", - hostname: "string", - id: "uuid", - isWildcard: "boolean", - managed: "boolean", - parentHostname: "string", - tlsSecretName: "string", - tlsStatus: "string", - updatedAt: "string", - verificationStatus: "string" + domainId: 'uuid', + hostname: 'string', + id: 'uuid', + isWildcard: 'boolean', + managed: 'boolean', + parentHostname: 'string', + tlsSecretName: 'string', + tlsStatus: 'string', + updatedAt: 'string', + verificationStatus: 'string', }; -const usage = "\nhostname-binding \n\nCommands:\n list List hostnameBinding records\n find-first Find first matching hostnameBinding record\n get Get a hostnameBinding by ID\n create Create a new hostnameBinding\n update Update an existing hostnameBinding\n delete Delete a hostnameBinding\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) => { +const usage = + '\nhostname-binding \n\nCommands:\n list List hostnameBinding records\n find-first Find first matching hostnameBinding record\n get Get a hostnameBinding by ID\n create Create a new hostnameBinding\n update Update an existing hostnameBinding\n delete Delete a hostnameBinding\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq tlsSecretName: true, tlsStatus: true, updatedAt: true, - verificationStatus: true + verificationStatus: true, }; - const findManyArgs = parseFindManyArgs & { - select: HostnameBindingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: HostnameBindingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.hostnameBinding.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter tlsSecretName: true, tlsStatus: true, updatedAt: true, - verificationStatus: true + verificationStatus: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: HostnameBindingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: HostnameBindingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.hostnameBinding.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.hostnameBinding.findOne({ - id: answers.id as string, - select: { - domainId: true, - hostname: true, - id: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true - } - }).execute(); + const result = await client.hostnameBinding + .findOne({ + id: answers.id as string, + select: { + domainId: true, + hostname: true, + id: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,83 +174,97 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "domainId", - message: "domainId", - required: true - }, { - type: "text", - name: "hostname", - message: "hostname", - required: true - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "managed", - message: "managed", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentHostname", - message: "parentHostname", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsSecretName", - message: "tlsSecretName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: true, + }, + { + type: 'text', + name: 'hostname', + message: 'hostname', + required: true, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'managed', + message: 'managed', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentHostname', + message: 'parentHostname', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsSecretName', + message: 'tlsSecretName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateHostnameBindingInput["hostnameBinding"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateHostnameBindingInput['hostnameBinding']; const client = getClient(); - const result = await client.hostnameBinding.create({ - data: { - domainId: cleanedData.domainId, - hostname: cleanedData.hostname, - isWildcard: cleanedData.isWildcard, - managed: cleanedData.managed, - parentHostname: cleanedData.parentHostname, - tlsSecretName: cleanedData.tlsSecretName, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus - }, - select: { - domainId: true, - hostname: true, - id: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true - } - }).execute(); + const result = await client.hostnameBinding + .create({ + data: { + domainId: cleanedData.domainId, + hostname: cleanedData.hostname, + isWildcard: cleanedData.isWildcard, + managed: cleanedData.managed, + parentHostname: cleanedData.parentHostname, + tlsSecretName: cleanedData.tlsSecretName, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + }, + select: { + domainId: true, + hostname: true, + id: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -237,91 +273,103 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "domainId", - message: "domainId", - required: false - }, { - type: "text", - name: "hostname", - message: "hostname", - required: false - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "managed", - message: "managed", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentHostname", - message: "parentHostname", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsSecretName", - message: "tlsSecretName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + }, + { + type: 'text', + name: 'hostname', + message: 'hostname', + required: false, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'managed', + message: 'managed', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentHostname', + message: 'parentHostname', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsSecretName', + message: 'tlsSecretName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as HostnameBindingPatch; const client = getClient(); - const result = await client.hostnameBinding.update({ - where: { - id: answers.id as string - }, - data: { - domainId: cleanedData.domainId, - hostname: cleanedData.hostname, - isWildcard: cleanedData.isWildcard, - managed: cleanedData.managed, - parentHostname: cleanedData.parentHostname, - tlsSecretName: cleanedData.tlsSecretName, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus - }, - select: { - domainId: true, - hostname: true, - id: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true - } - }).execute(); + const result = await client.hostnameBinding + .update({ + where: { + id: answers.id as string, + }, + data: { + domainId: cleanedData.domainId, + hostname: cleanedData.hostname, + isWildcard: cleanedData.isWildcard, + managed: cleanedData.managed, + parentHostname: cleanedData.parentHostname, + tlsSecretName: cleanedData.tlsSecretName, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + }, + select: { + domainId: true, + hostname: true, + id: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -330,28 +378,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.hostnameBinding.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.hostnameBinding + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/http-route.ts b/sdk/constructive-cli/src/api/cli/commands/http-route.ts index 9c9276a36c..62461e7b5a 100644 --- a/sdk/constructive-cli/src/api/cli/commands/http-route.ts +++ b/sdk/constructive-cli/src/api/cli/commands/http-route.ts @@ -3,61 +3,75 @@ * @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 { CreateHttpRouteInput, HttpRoutePatch, HttpRouteSelect, HttpRouteFilter, HttpRouteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateHttpRouteInput, + HttpRoutePatch, + HttpRouteSelect, + HttpRouteFilter, + HttpRouteOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - domainId: "uuid", - id: "uuid", - isActive: "boolean", - method: "string", - path: "string", - priority: "int", - targetId: "uuid", - targetKind: "string", - updatedAt: "string", - updatedBy: "uuid" + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + domainId: 'uuid', + id: 'uuid', + isActive: 'boolean', + method: 'string', + path: 'string', + priority: 'int', + targetId: 'uuid', + targetKind: 'string', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nhttp-route \n\nCommands:\n list List httpRoute records\n find-first Find first matching httpRoute record\n get Get a httpRoute by ID\n create Create a new httpRoute\n update Update an existing httpRoute\n delete Delete a httpRoute\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) => { +const usage = + '\nhttp-route \n\nCommands:\n list List httpRoute records\n find-first Find first matching httpRoute record\n get Get a httpRoute by ID\n create Create a new httpRoute\n update Update an existing httpRoute\n delete Delete a httpRoute\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq targetId: true, targetKind: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: HttpRouteSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: HttpRouteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.httpRoute.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter targetId: true, targetKind: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: HttpRouteSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: HttpRouteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.httpRoute.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.httpRoute.findOne({ - id: answers.id as string, - select: { - createdAt: true, - createdBy: true, - databaseId: true, - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetId: true, - targetKind: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.httpRoute + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + createdBy: true, + databaseId: true, + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetId: true, + targetKind: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,98 +186,111 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "domainId", - message: "domainId", - required: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: false, - skipPrompt: true - }, { - type: "text", - name: "path", - message: "path", - required: false, - skipPrompt: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetId", - message: "targetId", - required: true - }, { - type: "text", - name: "targetKind", - message: "targetKind", - required: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetId', + message: 'targetId', + required: true, + }, + { + type: 'text', + name: 'targetKind', + message: 'targetKind', + required: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateHttpRouteInput["httpRoute"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateHttpRouteInput['httpRoute']; const client = getClient(); - const result = await client.httpRoute.create({ - data: { - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - domainId: cleanedData.domainId, - isActive: cleanedData.isActive, - method: cleanedData.method, - path: cleanedData.path, - priority: cleanedData.priority, - targetId: cleanedData.targetId, - targetKind: cleanedData.targetKind, - updatedBy: cleanedData.updatedBy - }, - select: { - createdAt: true, - createdBy: true, - databaseId: true, - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetId: true, - targetKind: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.httpRoute + .create({ + data: { + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + domainId: cleanedData.domainId, + isActive: cleanedData.isActive, + method: cleanedData.method, + path: cleanedData.path, + priority: cleanedData.priority, + targetId: cleanedData.targetId, + targetKind: cleanedData.targetKind, + updatedBy: cleanedData.updatedBy, + }, + select: { + createdAt: true, + createdBy: true, + databaseId: true, + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetId: true, + targetKind: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -264,106 +299,120 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: false, - skipPrompt: true - }, { - type: "text", - name: "path", - message: "path", - required: false, - skipPrompt: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetId", - message: "targetId", - required: false - }, { - type: "text", - name: "targetKind", - message: "targetKind", - required: false - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetId', + message: 'targetId', + required: false, + }, + { + type: 'text', + name: 'targetKind', + message: 'targetKind', + required: false, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as HttpRoutePatch; const client = getClient(); - const result = await client.httpRoute.update({ - where: { - id: answers.id as string - }, - data: { - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - domainId: cleanedData.domainId, - isActive: cleanedData.isActive, - method: cleanedData.method, - path: cleanedData.path, - priority: cleanedData.priority, - targetId: cleanedData.targetId, - targetKind: cleanedData.targetKind, - updatedBy: cleanedData.updatedBy - }, - select: { - createdAt: true, - createdBy: true, - databaseId: true, - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetId: true, - targetKind: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.httpRoute + .update({ + where: { + id: answers.id as string, + }, + data: { + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + domainId: cleanedData.domainId, + isActive: cleanedData.isActive, + method: cleanedData.method, + path: cleanedData.path, + priority: cleanedData.priority, + targetId: cleanedData.targetId, + targetKind: cleanedData.targetKind, + updatedBy: cleanedData.updatedBy, + }, + select: { + createdAt: true, + createdBy: true, + databaseId: true, + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetId: true, + targetKind: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -372,28 +421,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.httpRoute.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.httpRoute + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/index.ts b/sdk/constructive-cli/src/api/cli/commands/index.ts index 73296dfb14..2d589d444c 100644 --- a/sdk/constructive-cli/src/api/cli/commands/index.ts +++ b/sdk/constructive-cli/src/api/cli/commands/index.ts @@ -3,65 +3,79 @@ * @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 { CreateIndexInput, IndexPatch, IndexSelect, IndexFilter, IndexOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateIndexInput, + IndexPatch, + IndexSelect, + IndexFilter, + IndexOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - accessMethod: "string", - category: "string", - createdAt: "string", - databaseId: "uuid", - fieldIds: "uuid", - id: "uuid", - includeFieldIds: "uuid", - indexParams: "json", - isUnique: "boolean", - name: "string", - opClasses: "string", - options: "json", - smartTags: "json", - tableId: "uuid", - tags: "string", - updatedAt: "string", - whereClause: "json" + accessMethod: 'string', + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + fieldIds: 'uuid', + id: 'uuid', + includeFieldIds: 'uuid', + indexParams: 'json', + isUnique: 'boolean', + name: 'string', + opClasses: 'string', + options: 'json', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + updatedAt: 'string', + whereClause: 'json', }; -const usage = "\nindex \n\nCommands:\n list List index records\n find-first Find first matching index record\n get Get a index by ID\n create Create a new index\n update Update an existing index\n delete Delete a index\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) => { +const usage = + '\nindex \n\nCommands:\n list List index records\n find-first Find first matching index record\n get Get a index by ID\n create Create a new index\n update Update an existing index\n delete Delete a index\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -87,16 +101,18 @@ async function handleList(argv: Partial>, _prompter: Inq tableId: true, tags: true, updatedAt: true, - whereClause: true + whereClause: true, }; - const findManyArgs = parseFindManyArgs & { - select: IndexSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: IndexSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.index.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -122,16 +138,18 @@ async function handleFindFirst(argv: Partial>, _prompter tableId: true, tags: true, updatedAt: true, - whereClause: true + whereClause: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: IndexSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: IndexSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.index.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -140,38 +158,42 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.index.findOne({ - id: answers.id as string, - select: { - accessMethod: true, - category: true, - createdAt: true, - databaseId: true, - fieldIds: true, - id: true, - includeFieldIds: true, - indexParams: true, - isUnique: true, - name: true, - opClasses: true, - options: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true, - whereClause: true - } - }).execute(); + const result = await client.index + .findOne({ + id: answers.id as string, + select: { + accessMethod: true, + category: true, + createdAt: true, + databaseId: true, + fieldIds: true, + id: true, + includeFieldIds: true, + indexParams: true, + isUnique: true, + name: true, + opClasses: true, + options: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + whereClause: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -180,132 +202,149 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "accessMethod", - message: "accessMethod", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "includeFieldIds", - message: "includeFieldIds", - required: false, - skipPrompt: true - }, { - type: "json", - name: "indexParams", - message: "indexParams", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isUnique", - message: "isUnique", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "opClasses", - message: "opClasses", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "json", - name: "whereClause", - message: "whereClause", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'accessMethod', + message: 'accessMethod', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'includeFieldIds', + message: 'includeFieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'indexParams', + message: 'indexParams', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isUnique', + message: 'isUnique', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'opClasses', + message: 'opClasses', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'whereClause', + message: 'whereClause', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateIndexInput["index"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateIndexInput['index']; const client = getClient(); - const result = await client.index.create({ - data: { - accessMethod: cleanedData.accessMethod, - category: cleanedData.category, - databaseId: cleanedData.databaseId, - fieldIds: cleanedData.fieldIds, - includeFieldIds: cleanedData.includeFieldIds, - indexParams: cleanedData.indexParams, - isUnique: cleanedData.isUnique, - name: cleanedData.name, - opClasses: cleanedData.opClasses, - options: cleanedData.options, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - whereClause: cleanedData.whereClause - }, - select: { - accessMethod: true, - category: true, - createdAt: true, - databaseId: true, - fieldIds: true, - id: true, - includeFieldIds: true, - indexParams: true, - isUnique: true, - name: true, - opClasses: true, - options: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true, - whereClause: true - } - }).execute(); + const result = await client.index + .create({ + data: { + accessMethod: cleanedData.accessMethod, + category: cleanedData.category, + databaseId: cleanedData.databaseId, + fieldIds: cleanedData.fieldIds, + includeFieldIds: cleanedData.includeFieldIds, + indexParams: cleanedData.indexParams, + isUnique: cleanedData.isUnique, + name: cleanedData.name, + opClasses: cleanedData.opClasses, + options: cleanedData.options, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + whereClause: cleanedData.whereClause, + }, + select: { + accessMethod: true, + category: true, + createdAt: true, + databaseId: true, + fieldIds: true, + id: true, + includeFieldIds: true, + indexParams: true, + isUnique: true, + name: true, + opClasses: true, + options: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + whereClause: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -314,140 +353,158 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "accessMethod", - message: "accessMethod", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "includeFieldIds", - message: "includeFieldIds", - required: false, - skipPrompt: true - }, { - type: "json", - name: "indexParams", - message: "indexParams", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isUnique", - message: "isUnique", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "opClasses", - message: "opClasses", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "json", - name: "whereClause", - message: "whereClause", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'accessMethod', + message: 'accessMethod', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'includeFieldIds', + message: 'includeFieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'indexParams', + message: 'indexParams', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isUnique', + message: 'isUnique', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'opClasses', + message: 'opClasses', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'whereClause', + message: 'whereClause', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as IndexPatch; const client = getClient(); - const result = await client.index.update({ - where: { - id: answers.id as string - }, - data: { - accessMethod: cleanedData.accessMethod, - category: cleanedData.category, - databaseId: cleanedData.databaseId, - fieldIds: cleanedData.fieldIds, - includeFieldIds: cleanedData.includeFieldIds, - indexParams: cleanedData.indexParams, - isUnique: cleanedData.isUnique, - name: cleanedData.name, - opClasses: cleanedData.opClasses, - options: cleanedData.options, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - whereClause: cleanedData.whereClause - }, - select: { - accessMethod: true, - category: true, - createdAt: true, - databaseId: true, - fieldIds: true, - id: true, - includeFieldIds: true, - indexParams: true, - isUnique: true, - name: true, - opClasses: true, - options: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true, - whereClause: true - } - }).execute(); + const result = await client.index + .update({ + where: { + id: answers.id as string, + }, + data: { + accessMethod: cleanedData.accessMethod, + category: cleanedData.category, + databaseId: cleanedData.databaseId, + fieldIds: cleanedData.fieldIds, + includeFieldIds: cleanedData.includeFieldIds, + indexParams: cleanedData.indexParams, + isUnique: cleanedData.isUnique, + name: cleanedData.name, + opClasses: cleanedData.opClasses, + options: cleanedData.options, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + whereClause: cleanedData.whereClause, + }, + select: { + accessMethod: true, + category: true, + createdAt: true, + databaseId: true, + fieldIds: true, + id: true, + includeFieldIds: true, + indexParams: true, + isUnique: true, + name: true, + opClasses: true, + options: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + whereClause: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -456,28 +513,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.index.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.index + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/managed-domain.ts b/sdk/constructive-cli/src/api/cli/commands/managed-domain.ts index 4951c8c169..16a495a347 100644 --- a/sdk/constructive-cli/src/api/cli/commands/managed-domain.ts +++ b/sdk/constructive-cli/src/api/cli/commands/managed-domain.ts @@ -3,61 +3,75 @@ * @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 { CreateManagedDomainInput, ManagedDomainPatch, ManagedDomainSelect, ManagedDomainFilter, ManagedDomainOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateManagedDomainInput, + ManagedDomainPatch, + ManagedDomainSelect, + ManagedDomainFilter, + ManagedDomainOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - allowPublicUsage: "boolean", - annotations: "json", - certStatus: "string", - createdAt: "string", - databaseId: "uuid", - domain: "string", - id: "uuid", - isWildcard: "boolean", - tlsReadyAt: "string", - tlsStatus: "string", - updatedAt: "string", - verificationStatus: "string", - verifiedAt: "string" + allowPublicUsage: 'boolean', + annotations: 'json', + certStatus: 'string', + createdAt: 'string', + databaseId: 'uuid', + domain: 'string', + id: 'uuid', + isWildcard: 'boolean', + tlsReadyAt: 'string', + tlsStatus: 'string', + updatedAt: 'string', + verificationStatus: 'string', + verifiedAt: 'string', }; -const usage = "\nmanaged-domain \n\nCommands:\n list List managedDomain records\n find-first Find first matching managedDomain record\n get Get a managedDomain by ID\n create Create a new managedDomain\n update Update an existing managedDomain\n delete Delete a managedDomain\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) => { +const usage = + '\nmanaged-domain \n\nCommands:\n list List managedDomain records\n find-first Find first matching managedDomain record\n get Get a managedDomain by ID\n create Create a new managedDomain\n update Update an existing managedDomain\n delete Delete a managedDomain\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq tlsStatus: true, updatedAt: true, verificationStatus: true, - verifiedAt: true + verifiedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: ManagedDomainSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ManagedDomainSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.managedDomain.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter tlsStatus: true, updatedAt: true, verificationStatus: true, - verifiedAt: true + verifiedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ManagedDomainSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ManagedDomainSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.managedDomain.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.managedDomain.findOne({ - id: answers.id as string, - select: { - allowPublicUsage: true, - annotations: true, - certStatus: true, - createdAt: true, - databaseId: true, - domain: true, - id: true, - isWildcard: true, - tlsReadyAt: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.managedDomain + .findOne({ + id: answers.id as string, + select: { + allowPublicUsage: true, + annotations: true, + certStatus: true, + createdAt: true, + databaseId: true, + domain: true, + id: true, + isWildcard: true, + tlsReadyAt: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,100 +186,116 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "allowPublicUsage", - message: "allowPublicUsage", - required: false, - skipPrompt: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "certStatus", - message: "certStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "domain", - message: "domain", - required: true - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsReadyAt", - message: "tlsReadyAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'allowPublicUsage', + message: 'allowPublicUsage', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'certStatus', + message: 'certStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'domain', + message: 'domain', + required: true, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsReadyAt', + message: 'tlsReadyAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateManagedDomainInput["managedDomain"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateManagedDomainInput['managedDomain']; const client = getClient(); - const result = await client.managedDomain.create({ - data: { - allowPublicUsage: cleanedData.allowPublicUsage, - annotations: cleanedData.annotations, - certStatus: cleanedData.certStatus, - databaseId: cleanedData.databaseId, - domain: cleanedData.domain, - isWildcard: cleanedData.isWildcard, - tlsReadyAt: cleanedData.tlsReadyAt, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus, - verifiedAt: cleanedData.verifiedAt - }, - select: { - allowPublicUsage: true, - annotations: true, - certStatus: true, - createdAt: true, - databaseId: true, - domain: true, - id: true, - isWildcard: true, - tlsReadyAt: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.managedDomain + .create({ + data: { + allowPublicUsage: cleanedData.allowPublicUsage, + annotations: cleanedData.annotations, + certStatus: cleanedData.certStatus, + databaseId: cleanedData.databaseId, + domain: cleanedData.domain, + isWildcard: cleanedData.isWildcard, + tlsReadyAt: cleanedData.tlsReadyAt, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + allowPublicUsage: true, + annotations: true, + certStatus: true, + createdAt: true, + databaseId: true, + domain: true, + id: true, + isWildcard: true, + tlsReadyAt: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -266,108 +304,122 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "allowPublicUsage", - message: "allowPublicUsage", - required: false, - skipPrompt: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "certStatus", - message: "certStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "domain", - message: "domain", - required: false - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsReadyAt", - message: "tlsReadyAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'allowPublicUsage', + message: 'allowPublicUsage', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'certStatus', + message: 'certStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'domain', + message: 'domain', + required: false, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsReadyAt', + message: 'tlsReadyAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ManagedDomainPatch; const client = getClient(); - const result = await client.managedDomain.update({ - where: { - id: answers.id as string - }, - data: { - allowPublicUsage: cleanedData.allowPublicUsage, - annotations: cleanedData.annotations, - certStatus: cleanedData.certStatus, - databaseId: cleanedData.databaseId, - domain: cleanedData.domain, - isWildcard: cleanedData.isWildcard, - tlsReadyAt: cleanedData.tlsReadyAt, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus, - verifiedAt: cleanedData.verifiedAt - }, - select: { - allowPublicUsage: true, - annotations: true, - certStatus: true, - createdAt: true, - databaseId: true, - domain: true, - id: true, - isWildcard: true, - tlsReadyAt: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.managedDomain + .update({ + where: { + id: answers.id as string, + }, + data: { + allowPublicUsage: cleanedData.allowPublicUsage, + annotations: cleanedData.annotations, + certStatus: cleanedData.certStatus, + databaseId: cleanedData.databaseId, + domain: cleanedData.domain, + isWildcard: cleanedData.isWildcard, + tlsReadyAt: cleanedData.tlsReadyAt, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + allowPublicUsage: true, + annotations: true, + certStatus: true, + createdAt: true, + databaseId: true, + domain: true, + id: true, + isWildcard: true, + tlsReadyAt: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -376,28 +428,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.managedDomain.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.managedDomain + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/node-type-registry.ts b/sdk/constructive-cli/src/api/cli/commands/node-type-registry.ts index 5b055ff9c2..edb496409f 100644 --- a/sdk/constructive-cli/src/api/cli/commands/node-type-registry.ts +++ b/sdk/constructive-cli/src/api/cli/commands/node-type-registry.ts @@ -3,55 +3,69 @@ * @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 { CreateNodeTypeRegistryInput, NodeTypeRegistryPatch, NodeTypeRegistrySelect, NodeTypeRegistryFilter, NodeTypeRegistryOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateNodeTypeRegistryInput, + NodeTypeRegistryPatch, + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - description: "string", - displayName: "string", - name: "string", - parameterSchema: "json", - slug: "string", - tags: "string" + category: 'string', + description: 'string', + displayName: 'string', + name: 'string', + parameterSchema: 'json', + slug: 'string', + tags: 'string', }; -const usage = "\nnode-type-registry \n\nCommands:\n list List nodeTypeRegistry records\n find-first Find first matching nodeTypeRegistry record\n get Get a nodeTypeRegistry by ID\n create Create a new nodeTypeRegistry\n update Update an existing nodeTypeRegistry\n delete Delete a nodeTypeRegistry\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) => { +const usage = + '\nnode-type-registry \n\nCommands:\n list List nodeTypeRegistry records\n find-first Find first matching nodeTypeRegistry record\n get Get a nodeTypeRegistry by ID\n create Create a new nodeTypeRegistry\n update Update an existing nodeTypeRegistry\n delete Delete a nodeTypeRegistry\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, parameterSchema: true, slug: true, - tags: true + tags: true, }; - const findManyArgs = parseFindManyArgs & { - select: NodeTypeRegistrySelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: NodeTypeRegistrySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.nodeTypeRegistry.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, parameterSchema: true, slug: true, - tags: true + tags: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: NodeTypeRegistrySelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: NodeTypeRegistrySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.nodeTypeRegistry.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "name", - message: "name", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const client = getClient(); - const result = await client.nodeTypeRegistry.findOne({ - name: answers.name as string, - select: { - category: true, - description: true, - displayName: true, - name: true, - parameterSchema: true, - slug: true, - tags: true - } - }).execute(); + const result = await client.nodeTypeRegistry + .findOne({ + name: answers.name as string, + select: { + category: true, + description: true, + displayName: true, + name: true, + parameterSchema: true, + slug: true, + tags: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,72 +162,85 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "displayName", - message: "displayName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "json", - name: "parameterSchema", - message: "parameterSchema", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'json', + name: 'parameterSchema', + message: 'parameterSchema', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateNodeTypeRegistryInput["nodeTypeRegistry"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateNodeTypeRegistryInput['nodeTypeRegistry']; const client = getClient(); - const result = await client.nodeTypeRegistry.create({ - data: { - category: cleanedData.category, - description: cleanedData.description, - displayName: cleanedData.displayName, - name: cleanedData.name, - parameterSchema: cleanedData.parameterSchema, - slug: cleanedData.slug, - tags: cleanedData.tags - }, - select: { - category: true, - description: true, - displayName: true, - name: true, - parameterSchema: true, - slug: true, - tags: true - } - }).execute(); + const result = await client.nodeTypeRegistry + .create({ + data: { + category: cleanedData.category, + description: cleanedData.description, + displayName: cleanedData.displayName, + name: cleanedData.name, + parameterSchema: cleanedData.parameterSchema, + slug: cleanedData.slug, + tags: cleanedData.tags, + }, + select: { + category: true, + description: true, + displayName: true, + name: true, + parameterSchema: true, + slug: true, + tags: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -214,74 +249,84 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "category", - message: "category", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "displayName", - message: "displayName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "parameterSchema", - message: "parameterSchema", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'parameterSchema', + message: 'parameterSchema', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as NodeTypeRegistryPatch; const client = getClient(); - const result = await client.nodeTypeRegistry.update({ - where: { - name: answers.name as string - }, - data: { - category: cleanedData.category, - description: cleanedData.description, - displayName: cleanedData.displayName, - parameterSchema: cleanedData.parameterSchema, - slug: cleanedData.slug, - tags: cleanedData.tags - }, - select: { - category: true, - description: true, - displayName: true, - name: true, - parameterSchema: true, - slug: true, - tags: true - } - }).execute(); + const result = await client.nodeTypeRegistry + .update({ + where: { + name: answers.name as string, + }, + data: { + category: cleanedData.category, + description: cleanedData.description, + displayName: cleanedData.displayName, + parameterSchema: cleanedData.parameterSchema, + slug: cleanedData.slug, + tags: cleanedData.tags, + }, + select: { + category: true, + description: true, + displayName: true, + name: true, + parameterSchema: true, + slug: true, + tags: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -290,28 +335,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.nodeTypeRegistry.delete({ - where: { - name: answers.name as string - }, - select: { - name: true - } - }).execute(); + const result = await client.nodeTypeRegistry + .delete({ + where: { + name: answers.name as string, + }, + select: { + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/partition.ts b/sdk/constructive-cli/src/api/cli/commands/partition.ts index 92c97dd491..2d04aea416 100644 --- a/sdk/constructive-cli/src/api/cli/commands/partition.ts +++ b/sdk/constructive-cli/src/api/cli/commands/partition.ts @@ -3,61 +3,75 @@ * @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 { CreatePartitionInput, PartitionPatch, PartitionSelect, PartitionFilter, PartitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePartitionInput, + PartitionPatch, + PartitionSelect, + PartitionFilter, + PartitionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - id: "uuid", - interval: "string", - isParented: "boolean", - namingPattern: "string", - partitionKeyId: "uuid", - premake: "int", - retention: "string", - retentionKeepTable: "boolean", - strategy: "string", - tableId: "uuid", - updatedAt: "string" + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + interval: 'string', + isParented: 'boolean', + namingPattern: 'string', + partitionKeyId: 'uuid', + premake: 'int', + retention: 'string', + retentionKeepTable: 'boolean', + strategy: 'string', + tableId: 'uuid', + updatedAt: 'string', }; -const usage = "\npartition \n\nCommands:\n list List partition records\n find-first Find first matching partition record\n get Get a partition by ID\n create Create a new partition\n update Update an existing partition\n delete Delete a partition\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) => { +const usage = + '\npartition \n\nCommands:\n list List partition records\n find-first Find first matching partition record\n get Get a partition by ID\n create Create a new partition\n update Update an existing partition\n delete Delete a partition\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq retentionKeepTable: true, strategy: true, tableId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PartitionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PartitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.partition.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter retentionKeepTable: true, strategy: true, tableId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PartitionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PartitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.partition.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.partition.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - id: true, - interval: true, - isParented: true, - namingPattern: true, - partitionKeyId: true, - premake: true, - retention: true, - retentionKeepTable: true, - strategy: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.partition + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + id: true, + interval: true, + isParented: true, + namingPattern: true, + partitionKeyId: true, + premake: true, + retention: true, + retentionKeepTable: true, + strategy: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,98 +186,111 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isParented", - message: "isParented", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namingPattern", - message: "namingPattern", - required: false, - skipPrompt: true - }, { - type: "text", - name: "partitionKeyId", - message: "partitionKeyId", - required: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "retentionKeepTable", - message: "retentionKeepTable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "strategy", - message: "strategy", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isParented', + message: 'isParented', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namingPattern', + message: 'namingPattern', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'partitionKeyId', + message: 'partitionKeyId', + required: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'retentionKeepTable', + message: 'retentionKeepTable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'strategy', + message: 'strategy', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePartitionInput["partition"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreatePartitionInput['partition']; const client = getClient(); - const result = await client.partition.create({ - data: { - databaseId: cleanedData.databaseId, - interval: cleanedData.interval, - isParented: cleanedData.isParented, - namingPattern: cleanedData.namingPattern, - partitionKeyId: cleanedData.partitionKeyId, - premake: cleanedData.premake, - retention: cleanedData.retention, - retentionKeepTable: cleanedData.retentionKeepTable, - strategy: cleanedData.strategy, - tableId: cleanedData.tableId - }, - select: { - createdAt: true, - databaseId: true, - id: true, - interval: true, - isParented: true, - namingPattern: true, - partitionKeyId: true, - premake: true, - retention: true, - retentionKeepTable: true, - strategy: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.partition + .create({ + data: { + databaseId: cleanedData.databaseId, + interval: cleanedData.interval, + isParented: cleanedData.isParented, + namingPattern: cleanedData.namingPattern, + partitionKeyId: cleanedData.partitionKeyId, + premake: cleanedData.premake, + retention: cleanedData.retention, + retentionKeepTable: cleanedData.retentionKeepTable, + strategy: cleanedData.strategy, + tableId: cleanedData.tableId, + }, + select: { + createdAt: true, + databaseId: true, + id: true, + interval: true, + isParented: true, + namingPattern: true, + partitionKeyId: true, + premake: true, + retention: true, + retentionKeepTable: true, + strategy: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -264,106 +299,120 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isParented", - message: "isParented", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namingPattern", - message: "namingPattern", - required: false, - skipPrompt: true - }, { - type: "text", - name: "partitionKeyId", - message: "partitionKeyId", - required: false - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "retentionKeepTable", - message: "retentionKeepTable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "strategy", - message: "strategy", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }]); + 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: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isParented', + message: 'isParented', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namingPattern', + message: 'namingPattern', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'partitionKeyId', + message: 'partitionKeyId', + required: false, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'retentionKeepTable', + message: 'retentionKeepTable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'strategy', + message: 'strategy', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PartitionPatch; const client = getClient(); - const result = await client.partition.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - interval: cleanedData.interval, - isParented: cleanedData.isParented, - namingPattern: cleanedData.namingPattern, - partitionKeyId: cleanedData.partitionKeyId, - premake: cleanedData.premake, - retention: cleanedData.retention, - retentionKeepTable: cleanedData.retentionKeepTable, - strategy: cleanedData.strategy, - tableId: cleanedData.tableId - }, - select: { - createdAt: true, - databaseId: true, - id: true, - interval: true, - isParented: true, - namingPattern: true, - partitionKeyId: true, - premake: true, - retention: true, - retentionKeepTable: true, - strategy: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.partition + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + interval: cleanedData.interval, + isParented: cleanedData.isParented, + namingPattern: cleanedData.namingPattern, + partitionKeyId: cleanedData.partitionKeyId, + premake: cleanedData.premake, + retention: cleanedData.retention, + retentionKeepTable: cleanedData.retentionKeepTable, + strategy: cleanedData.strategy, + tableId: cleanedData.tableId, + }, + select: { + createdAt: true, + databaseId: true, + id: true, + interval: true, + isParented: true, + namingPattern: true, + partitionKeyId: true, + premake: true, + retention: true, + retentionKeepTable: true, + strategy: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -372,28 +421,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.partition.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.partition + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-api-module.ts b/sdk/constructive-cli/src/api/cli/commands/platform-api-module.ts index 41b81c9f00..fdfdcaf2f1 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-api-module.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-api-module.ts @@ -3,54 +3,68 @@ * @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 { CreatePlatformApiModuleInput, PlatformApiModulePatch, PlatformApiModuleSelect, PlatformApiModuleFilter, PlatformApiModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformApiModuleInput, + PlatformApiModulePatch, + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiId: "uuid", - createdAt: "string", - data: "json", - id: "uuid", - name: "string", - updatedAt: "string" + apiId: 'uuid', + createdAt: 'string', + data: 'json', + id: 'uuid', + name: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-api-module \n\nCommands:\n list List platformApiModule records\n find-first Find first matching platformApiModule record\n get Get a platformApiModule by ID\n create Create a new platformApiModule\n update Update an existing platformApiModule\n delete Delete a platformApiModule\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) => { +const usage = + '\nplatform-api-module \n\nCommands:\n list List platformApiModule records\n find-first Find first matching platformApiModule record\n get Get a platformApiModule by ID\n create Create a new platformApiModule\n update Update an existing platformApiModule\n delete Delete a platformApiModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq data: true, id: true, name: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformApiModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformApiModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformApiModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter data: true, id: true, name: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformApiModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformApiModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformApiModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformApiModule.findOne({ - id: answers.id as string, - select: { - apiId: true, - createdAt: true, - data: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiModule + .findOne({ + id: answers.id as string, + select: { + apiId: true, + createdAt: true, + data: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,43 +158,52 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiId", - message: "apiId", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformApiModuleInput["platformApiModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformApiModuleInput['platformApiModule']; const client = getClient(); - const result = await client.platformApiModule.create({ - data: { - apiId: cleanedData.apiId, - data: cleanedData.data, - name: cleanedData.name - }, - select: { - apiId: true, - createdAt: true, - data: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiModule + .create({ + data: { + apiId: cleanedData.apiId, + data: cleanedData.data, + name: cleanedData.name, + }, + select: { + apiId: true, + createdAt: true, + data: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -181,51 +212,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiId", - message: "apiId", - required: false - }, { - type: "json", - name: "data", - message: "data", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformApiModulePatch; const client = getClient(); - const result = await client.platformApiModule.update({ - where: { - id: answers.id as string - }, - data: { - apiId: cleanedData.apiId, - data: cleanedData.data, - name: cleanedData.name - }, - select: { - apiId: true, - createdAt: true, - data: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiId: cleanedData.apiId, + data: cleanedData.data, + name: cleanedData.name, + }, + select: { + apiId: true, + createdAt: true, + data: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -234,28 +272,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformApiModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformApiModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-api-schema.ts b/sdk/constructive-cli/src/api/cli/commands/platform-api-schema.ts index 8f8c657cf8..22920cce83 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-api-schema.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-api-schema.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformApiSchemaInput, PlatformApiSchemaPatch, PlatformApiSchemaSelect, PlatformApiSchemaFilter, PlatformApiSchemaOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformApiSchemaInput, + PlatformApiSchemaPatch, + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiId: "uuid", - createdAt: "string", - id: "uuid", - schemaId: "uuid", - updatedAt: "string" + apiId: 'uuid', + createdAt: 'string', + id: 'uuid', + schemaId: 'uuid', + updatedAt: 'string', }; -const usage = "\nplatform-api-schema \n\nCommands:\n list List platformApiSchema records\n find-first Find first matching platformApiSchema record\n get Get a platformApiSchema by ID\n create Create a new platformApiSchema\n update Update an existing platformApiSchema\n delete Delete a platformApiSchema\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) => { +const usage = + '\nplatform-api-schema \n\nCommands:\n list List platformApiSchema records\n find-first Find first matching platformApiSchema record\n get Get a platformApiSchema by ID\n create Create a new platformApiSchema\n update Update an existing platformApiSchema\n delete Delete a platformApiSchema\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq createdAt: true, id: true, schemaId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformApiSchemaSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformApiSchemaSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformApiSchema.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter createdAt: true, id: true, schemaId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformApiSchemaSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformApiSchemaSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformApiSchema.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformApiSchema.findOne({ - id: answers.id as string, - select: { - apiId: true, - createdAt: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiSchema + .findOne({ + id: answers.id as string, + select: { + apiId: true, + createdAt: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,36 +154,44 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiId", - message: "apiId", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformApiSchemaInput["platformApiSchema"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformApiSchemaInput['platformApiSchema']; const client = getClient(); - const result = await client.platformApiSchema.create({ - data: { - apiId: cleanedData.apiId, - schemaId: cleanedData.schemaId - }, - select: { - apiId: true, - createdAt: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiSchema + .create({ + data: { + apiId: cleanedData.apiId, + schemaId: cleanedData.schemaId, + }, + select: { + apiId: true, + createdAt: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -170,44 +200,50 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiId", - message: "apiId", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformApiSchemaPatch; const client = getClient(); - const result = await client.platformApiSchema.update({ - where: { - id: answers.id as string - }, - data: { - apiId: cleanedData.apiId, - schemaId: cleanedData.schemaId - }, - select: { - apiId: true, - createdAt: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiSchema + .update({ + where: { + id: answers.id as string, + }, + data: { + apiId: cleanedData.apiId, + schemaId: cleanedData.schemaId, + }, + select: { + apiId: true, + createdAt: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -216,28 +252,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformApiSchema.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformApiSchema + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-api-setting.ts b/sdk/constructive-cli/src/api/cli/commands/platform-api-setting.ts index 92caed857d..e7057de2e0 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-api-setting.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-api-setting.ts @@ -3,65 +3,79 @@ * @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 { CreatePlatformApiSettingInput, PlatformApiSettingPatch, PlatformApiSettingSelect, PlatformApiSettingFilter, PlatformApiSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformApiSettingInput, + PlatformApiSettingPatch, + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiId: "uuid", - createdAt: "string", - enableAggregates: "boolean", - enableBulk: "boolean", - enableConnectionFilter: "boolean", - enableDirectUploads: "boolean", - enableI18N: "boolean", - enableLlm: "boolean", - enableLtree: "boolean", - enableManyToMany: "boolean", - enablePostgis: "boolean", - enablePresignedUploads: "boolean", - enableRealtime: "boolean", - enableSearch: "boolean", - id: "uuid", - options: "json", - updatedAt: "string" + apiId: 'uuid', + createdAt: 'string', + enableAggregates: 'boolean', + enableBulk: 'boolean', + enableConnectionFilter: 'boolean', + enableDirectUploads: 'boolean', + enableI18N: 'boolean', + enableLlm: 'boolean', + enableLtree: 'boolean', + enableManyToMany: 'boolean', + enablePostgis: 'boolean', + enablePresignedUploads: 'boolean', + enableRealtime: 'boolean', + enableSearch: 'boolean', + id: 'uuid', + options: 'json', + updatedAt: 'string', }; -const usage = "\nplatform-api-setting \n\nCommands:\n list List platformApiSetting records\n find-first Find first matching platformApiSetting record\n get Get a platformApiSetting by ID\n create Create a new platformApiSetting\n update Update an existing platformApiSetting\n delete Delete a platformApiSetting\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) => { +const usage = + '\nplatform-api-setting \n\nCommands:\n list List platformApiSetting records\n find-first Find first matching platformApiSetting record\n get Get a platformApiSetting by ID\n create Create a new platformApiSetting\n update Update an existing platformApiSetting\n delete Delete a platformApiSetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -87,16 +101,22 @@ async function handleList(argv: Partial>, _prompter: Inq enableSearch: true, id: true, options: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformApiSettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy + > & { + select: PlatformApiSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformApiSetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -122,16 +142,22 @@ async function handleFindFirst(argv: Partial>, _prompter enableSearch: true, id: true, options: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformApiSettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy + > & { + select: PlatformApiSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformApiSetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -140,38 +166,42 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformApiSetting.findOne({ - id: answers.id as string, - select: { - apiId: true, - createdAt: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiSetting + .findOne({ + id: answers.id as string, + select: { + apiId: true, + createdAt: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -180,133 +210,153 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiId", - message: "apiId", - required: true - }, { - type: "boolean", - name: "enableAggregates", - message: "enableAggregates", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableBulk", - message: "enableBulk", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableConnectionFilter", - message: "enableConnectionFilter", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableDirectUploads", - message: "enableDirectUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableI18N", - message: "enableI18N", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLlm", - message: "enableLlm", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLtree", - message: "enableLtree", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableManyToMany", - message: "enableManyToMany", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePostgis", - message: "enablePostgis", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePresignedUploads", - message: "enablePresignedUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableRealtime", - message: "enableRealtime", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableSearch", - message: "enableSearch", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'boolean', + name: 'enableAggregates', + message: 'enableAggregates', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableBulk', + message: 'enableBulk', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableConnectionFilter', + message: 'enableConnectionFilter', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableDirectUploads', + message: 'enableDirectUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableI18N', + message: 'enableI18N', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLlm', + message: 'enableLlm', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLtree', + message: 'enableLtree', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableManyToMany', + message: 'enableManyToMany', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePostgis', + message: 'enablePostgis', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePresignedUploads', + message: 'enablePresignedUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableRealtime', + message: 'enableRealtime', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableSearch', + message: 'enableSearch', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformApiSettingInput["platformApiSetting"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformApiSettingInput['platformApiSetting']; const client = getClient(); - const result = await client.platformApiSetting.create({ - data: { - apiId: cleanedData.apiId, - enableAggregates: cleanedData.enableAggregates, - enableBulk: cleanedData.enableBulk, - enableConnectionFilter: cleanedData.enableConnectionFilter, - enableDirectUploads: cleanedData.enableDirectUploads, - enableI18N: cleanedData.enableI18N, - enableLlm: cleanedData.enableLlm, - enableLtree: cleanedData.enableLtree, - enableManyToMany: cleanedData.enableManyToMany, - enablePostgis: cleanedData.enablePostgis, - enablePresignedUploads: cleanedData.enablePresignedUploads, - enableRealtime: cleanedData.enableRealtime, - enableSearch: cleanedData.enableSearch, - options: cleanedData.options - }, - select: { - apiId: true, - createdAt: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiSetting + .create({ + data: { + apiId: cleanedData.apiId, + enableAggregates: cleanedData.enableAggregates, + enableBulk: cleanedData.enableBulk, + enableConnectionFilter: cleanedData.enableConnectionFilter, + enableDirectUploads: cleanedData.enableDirectUploads, + enableI18N: cleanedData.enableI18N, + enableLlm: cleanedData.enableLlm, + enableLtree: cleanedData.enableLtree, + enableManyToMany: cleanedData.enableManyToMany, + enablePostgis: cleanedData.enablePostgis, + enablePresignedUploads: cleanedData.enablePresignedUploads, + enableRealtime: cleanedData.enableRealtime, + enableSearch: cleanedData.enableSearch, + options: cleanedData.options, + }, + select: { + apiId: true, + createdAt: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -315,141 +365,159 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiId", - message: "apiId", - required: false - }, { - type: "boolean", - name: "enableAggregates", - message: "enableAggregates", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableBulk", - message: "enableBulk", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableConnectionFilter", - message: "enableConnectionFilter", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableDirectUploads", - message: "enableDirectUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableI18N", - message: "enableI18N", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLlm", - message: "enableLlm", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableLtree", - message: "enableLtree", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableManyToMany", - message: "enableManyToMany", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePostgis", - message: "enablePostgis", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enablePresignedUploads", - message: "enablePresignedUploads", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableRealtime", - message: "enableRealtime", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "enableSearch", - message: "enableSearch", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'boolean', + name: 'enableAggregates', + message: 'enableAggregates', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableBulk', + message: 'enableBulk', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableConnectionFilter', + message: 'enableConnectionFilter', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableDirectUploads', + message: 'enableDirectUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableI18N', + message: 'enableI18N', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLlm', + message: 'enableLlm', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableLtree', + message: 'enableLtree', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableManyToMany', + message: 'enableManyToMany', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePostgis', + message: 'enablePostgis', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enablePresignedUploads', + message: 'enablePresignedUploads', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableRealtime', + message: 'enableRealtime', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'enableSearch', + message: 'enableSearch', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformApiSettingPatch; const client = getClient(); - const result = await client.platformApiSetting.update({ - where: { - id: answers.id as string - }, - data: { - apiId: cleanedData.apiId, - enableAggregates: cleanedData.enableAggregates, - enableBulk: cleanedData.enableBulk, - enableConnectionFilter: cleanedData.enableConnectionFilter, - enableDirectUploads: cleanedData.enableDirectUploads, - enableI18N: cleanedData.enableI18N, - enableLlm: cleanedData.enableLlm, - enableLtree: cleanedData.enableLtree, - enableManyToMany: cleanedData.enableManyToMany, - enablePostgis: cleanedData.enablePostgis, - enablePresignedUploads: cleanedData.enablePresignedUploads, - enableRealtime: cleanedData.enableRealtime, - enableSearch: cleanedData.enableSearch, - options: cleanedData.options - }, - select: { - apiId: true, - createdAt: true, - enableAggregates: true, - enableBulk: true, - enableConnectionFilter: true, - enableDirectUploads: true, - enableI18N: true, - enableLlm: true, - enableLtree: true, - enableManyToMany: true, - enablePostgis: true, - enablePresignedUploads: true, - enableRealtime: true, - enableSearch: true, - id: true, - options: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApiSetting + .update({ + where: { + id: answers.id as string, + }, + data: { + apiId: cleanedData.apiId, + enableAggregates: cleanedData.enableAggregates, + enableBulk: cleanedData.enableBulk, + enableConnectionFilter: cleanedData.enableConnectionFilter, + enableDirectUploads: cleanedData.enableDirectUploads, + enableI18N: cleanedData.enableI18N, + enableLlm: cleanedData.enableLlm, + enableLtree: cleanedData.enableLtree, + enableManyToMany: cleanedData.enableManyToMany, + enablePostgis: cleanedData.enablePostgis, + enablePresignedUploads: cleanedData.enablePresignedUploads, + enableRealtime: cleanedData.enableRealtime, + enableSearch: cleanedData.enableSearch, + options: cleanedData.options, + }, + select: { + apiId: true, + createdAt: true, + enableAggregates: true, + enableBulk: true, + enableConnectionFilter: true, + enableDirectUploads: true, + enableI18N: true, + enableLlm: true, + enableLtree: true, + enableManyToMany: true, + enablePostgis: true, + enablePresignedUploads: true, + enableRealtime: true, + enableSearch: true, + id: true, + options: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -458,28 +526,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformApiSetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformApiSetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-api.ts b/sdk/constructive-cli/src/api/cli/commands/platform-api.ts index 42ea0ea884..6338ed05c9 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-api.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-api.ts @@ -3,57 +3,71 @@ * @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 { CreatePlatformApiInput, PlatformApiPatch, PlatformApiSelect, PlatformApiFilter, PlatformApiOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformApiInput, + PlatformApiPatch, + PlatformApiSelect, + PlatformApiFilter, + PlatformApiOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - anonRole: "string", - config: "json", - createdAt: "string", - dbname: "string", - id: "uuid", - isPublished: "boolean", - name: "string", - roleName: "string", - updatedAt: "string" + anonRole: 'string', + config: 'json', + createdAt: 'string', + dbname: 'string', + id: 'uuid', + isPublished: 'boolean', + name: 'string', + roleName: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-api \n\nCommands:\n list List platformApi records\n find-first Find first matching platformApi record\n get Get a platformApi by ID\n create Create a new platformApi\n update Update an existing platformApi\n delete Delete a platformApi\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) => { +const usage = + '\nplatform-api \n\nCommands:\n list List platformApi records\n find-first Find first matching platformApi record\n get Get a platformApi by ID\n create Create a new platformApi\n update Update an existing platformApi\n delete Delete a platformApi\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq isPublished: true, name: true, roleName: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformApiSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformApiSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformApi.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter isPublished: true, name: true, roleName: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformApiSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformApiSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformApi.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformApi.findOne({ - id: answers.id as string, - select: { - anonRole: true, - config: true, - createdAt: true, - dbname: true, - id: true, - isPublished: true, - name: true, - roleName: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApi + .findOne({ + id: answers.id as string, + select: { + anonRole: true, + config: true, + createdAt: true, + dbname: true, + id: true, + isPublished: true, + name: true, + roleName: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,69 +170,81 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "anonRole", - message: "anonRole", - required: false, - skipPrompt: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "dbname", - message: "dbname", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "roleName", - message: "roleName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'anonRole', + message: 'anonRole', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'dbname', + message: 'dbname', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'roleName', + message: 'roleName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformApiInput["platformApi"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformApiInput['platformApi']; const client = getClient(); - const result = await client.platformApi.create({ - data: { - anonRole: cleanedData.anonRole, - config: cleanedData.config, - dbname: cleanedData.dbname, - isPublished: cleanedData.isPublished, - name: cleanedData.name, - roleName: cleanedData.roleName - }, - select: { - anonRole: true, - config: true, - createdAt: true, - dbname: true, - id: true, - isPublished: true, - name: true, - roleName: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApi + .create({ + data: { + anonRole: cleanedData.anonRole, + config: cleanedData.config, + dbname: cleanedData.dbname, + isPublished: cleanedData.isPublished, + name: cleanedData.name, + roleName: cleanedData.roleName, + }, + select: { + anonRole: true, + config: true, + createdAt: true, + dbname: true, + id: true, + isPublished: true, + name: true, + roleName: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -219,77 +253,87 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "anonRole", - message: "anonRole", - required: false, - skipPrompt: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "dbname", - message: "dbname", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "roleName", - message: "roleName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'anonRole', + message: 'anonRole', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'dbname', + message: 'dbname', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'roleName', + message: 'roleName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformApiPatch; const client = getClient(); - const result = await client.platformApi.update({ - where: { - id: answers.id as string - }, - data: { - anonRole: cleanedData.anonRole, - config: cleanedData.config, - dbname: cleanedData.dbname, - isPublished: cleanedData.isPublished, - name: cleanedData.name, - roleName: cleanedData.roleName - }, - select: { - anonRole: true, - config: true, - createdAt: true, - dbname: true, - id: true, - isPublished: true, - name: true, - roleName: true, - updatedAt: true - } - }).execute(); + const result = await client.platformApi + .update({ + where: { + id: answers.id as string, + }, + data: { + anonRole: cleanedData.anonRole, + config: cleanedData.config, + dbname: cleanedData.dbname, + isPublished: cleanedData.isPublished, + name: cleanedData.name, + roleName: cleanedData.roleName, + }, + select: { + anonRole: true, + config: true, + createdAt: true, + dbname: true, + id: true, + isPublished: true, + name: true, + roleName: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -298,28 +342,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformApi.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformApi + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-cors-setting.ts b/sdk/constructive-cli/src/api/cli/commands/platform-cors-setting.ts index 3758a2a084..97c8144046 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-cors-setting.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-cors-setting.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformCorsSettingInput, PlatformCorsSettingPatch, PlatformCorsSettingSelect, PlatformCorsSettingFilter, PlatformCorsSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformCorsSettingInput, + PlatformCorsSettingPatch, + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - allowedOrigins: "string", - apiId: "uuid", - createdAt: "string", - id: "uuid", - updatedAt: "string" + allowedOrigins: 'string', + apiId: 'uuid', + createdAt: 'string', + id: 'uuid', + updatedAt: 'string', }; -const usage = "\nplatform-cors-setting \n\nCommands:\n list List platformCorsSetting records\n find-first Find first matching platformCorsSetting record\n get Get a platformCorsSetting by ID\n create Create a new platformCorsSetting\n update Update an existing platformCorsSetting\n delete Delete a platformCorsSetting\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) => { +const usage = + '\nplatform-cors-setting \n\nCommands:\n list List platformCorsSetting records\n find-first Find first matching platformCorsSetting record\n get Get a platformCorsSetting by ID\n create Create a new platformCorsSetting\n update Update an existing platformCorsSetting\n delete Delete a platformCorsSetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq apiId: true, createdAt: true, id: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformCorsSettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy + > & { + select: PlatformCorsSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformCorsSetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter apiId: true, createdAt: true, id: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformCorsSettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy + > & { + select: PlatformCorsSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformCorsSetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformCorsSetting.findOne({ - id: answers.id as string, - select: { - allowedOrigins: true, - apiId: true, - createdAt: true, - id: true, - updatedAt: true - } - }).execute(); + const result = await client.platformCorsSetting + .findOne({ + id: answers.id as string, + select: { + allowedOrigins: true, + apiId: true, + createdAt: true, + id: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,38 +162,46 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "allowedOrigins", - message: "allowedOrigins", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiId", - message: "apiId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'allowedOrigins', + message: 'allowedOrigins', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformCorsSettingInput["platformCorsSetting"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformCorsSettingInput['platformCorsSetting']; const client = getClient(); - const result = await client.platformCorsSetting.create({ - data: { - allowedOrigins: cleanedData.allowedOrigins, - apiId: cleanedData.apiId - }, - select: { - allowedOrigins: true, - apiId: true, - createdAt: true, - id: true, - updatedAt: true - } - }).execute(); + const result = await client.platformCorsSetting + .create({ + data: { + allowedOrigins: cleanedData.allowedOrigins, + apiId: cleanedData.apiId, + }, + select: { + allowedOrigins: true, + apiId: true, + createdAt: true, + id: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -172,46 +210,52 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "allowedOrigins", - message: "allowedOrigins", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiId", - message: "apiId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'allowedOrigins', + message: 'allowedOrigins', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformCorsSettingPatch; const client = getClient(); - const result = await client.platformCorsSetting.update({ - where: { - id: answers.id as string - }, - data: { - allowedOrigins: cleanedData.allowedOrigins, - apiId: cleanedData.apiId - }, - select: { - allowedOrigins: true, - apiId: true, - createdAt: true, - id: true, - updatedAt: true - } - }).execute(); + const result = await client.platformCorsSetting + .update({ + where: { + id: answers.id as string, + }, + data: { + allowedOrigins: cleanedData.allowedOrigins, + apiId: cleanedData.apiId, + }, + select: { + allowedOrigins: true, + apiId: true, + createdAt: true, + id: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -220,28 +264,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformCorsSetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformCorsSetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-domain-event.ts b/sdk/constructive-cli/src/api/cli/commands/platform-domain-event.ts index da039ed41b..ffdcd19017 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-domain-event.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-domain-event.ts @@ -3,58 +3,72 @@ * @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 { CreatePlatformDomainEventInput, PlatformDomainEventPatch, PlatformDomainEventSelect, PlatformDomainEventFilter, PlatformDomainEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformDomainEventInput, + PlatformDomainEventPatch, + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - domainId: "uuid", - domainVerificationId: "uuid", - eventType: "string", - id: "uuid", - managedDomainId: "uuid", - message: "string", - metadata: "json", - updatedAt: "string" + actorId: 'uuid', + createdAt: 'string', + domainId: 'uuid', + domainVerificationId: 'uuid', + eventType: 'string', + id: 'uuid', + managedDomainId: 'uuid', + message: 'string', + metadata: 'json', + updatedAt: 'string', }; -const usage = "\nplatform-domain-event \n\nCommands:\n list List platformDomainEvent records\n find-first Find first matching platformDomainEvent record\n get Get a platformDomainEvent by ID\n create Create a new platformDomainEvent\n update Update an existing platformDomainEvent\n delete Delete a platformDomainEvent\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) => { +const usage = + '\nplatform-domain-event \n\nCommands:\n list List platformDomainEvent records\n find-first Find first matching platformDomainEvent record\n get Get a platformDomainEvent by ID\n create Create a new platformDomainEvent\n update Update an existing platformDomainEvent\n delete Delete a platformDomainEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,22 @@ async function handleList(argv: Partial>, _prompter: Inq managedDomainId: true, message: true, metadata: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformDomainEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy + > & { + select: PlatformDomainEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformDomainEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +121,22 @@ async function handleFindFirst(argv: Partial>, _prompter managedDomainId: true, message: true, metadata: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformDomainEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy + > & { + select: PlatformDomainEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformDomainEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +145,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformDomainEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - domainId: true, - domainVerificationId: true, - eventType: true, - id: true, - managedDomainId: true, - message: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.platformDomainEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + domainId: true, + domainVerificationId: true, + eventType: true, + id: true, + managedDomainId: true, + message: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,77 +182,90 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainVerificationId", - message: "domainVerificationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "managedDomainId", - message: "managedDomainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainVerificationId', + message: 'domainVerificationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'managedDomainId', + message: 'managedDomainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformDomainEventInput["platformDomainEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformDomainEventInput['platformDomainEvent']; const client = getClient(); - const result = await client.platformDomainEvent.create({ - data: { - actorId: cleanedData.actorId, - domainId: cleanedData.domainId, - domainVerificationId: cleanedData.domainVerificationId, - eventType: cleanedData.eventType, - managedDomainId: cleanedData.managedDomainId, - message: cleanedData.message, - metadata: cleanedData.metadata - }, - select: { - actorId: true, - createdAt: true, - domainId: true, - domainVerificationId: true, - eventType: true, - id: true, - managedDomainId: true, - message: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.platformDomainEvent + .create({ + data: { + actorId: cleanedData.actorId, + domainId: cleanedData.domainId, + domainVerificationId: cleanedData.domainVerificationId, + eventType: cleanedData.eventType, + managedDomainId: cleanedData.managedDomainId, + message: cleanedData.message, + metadata: cleanedData.metadata, + }, + select: { + actorId: true, + createdAt: true, + domainId: true, + domainVerificationId: true, + eventType: true, + id: true, + managedDomainId: true, + message: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -231,85 +274,96 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainVerificationId", - message: "domainVerificationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "managedDomainId", - message: "managedDomainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainVerificationId', + message: 'domainVerificationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'managedDomainId', + message: 'managedDomainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformDomainEventPatch; const client = getClient(); - const result = await client.platformDomainEvent.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - domainId: cleanedData.domainId, - domainVerificationId: cleanedData.domainVerificationId, - eventType: cleanedData.eventType, - managedDomainId: cleanedData.managedDomainId, - message: cleanedData.message, - metadata: cleanedData.metadata - }, - select: { - actorId: true, - createdAt: true, - domainId: true, - domainVerificationId: true, - eventType: true, - id: true, - managedDomainId: true, - message: true, - metadata: true, - updatedAt: true - } - }).execute(); + const result = await client.platformDomainEvent + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + domainId: cleanedData.domainId, + domainVerificationId: cleanedData.domainVerificationId, + eventType: cleanedData.eventType, + managedDomainId: cleanedData.managedDomainId, + message: cleanedData.message, + metadata: cleanedData.metadata, + }, + select: { + actorId: true, + createdAt: true, + domainId: true, + domainVerificationId: true, + eventType: true, + id: true, + managedDomainId: true, + message: true, + metadata: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -318,28 +372,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformDomainEvent.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformDomainEvent + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-domain-verification.ts b/sdk/constructive-cli/src/api/cli/commands/platform-domain-verification.ts index ff85143ef8..1af050dc14 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-domain-verification.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-domain-verification.ts @@ -3,63 +3,77 @@ * @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 { CreatePlatformDomainVerificationInput, PlatformDomainVerificationPatch, PlatformDomainVerificationSelect, PlatformDomainVerificationFilter, PlatformDomainVerificationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformDomainVerificationInput, + PlatformDomainVerificationPatch, + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - attempts: "int", - createdAt: "string", - domainId: "uuid", - error: "string", - expiresAt: "string", - id: "uuid", - lastCheckedAt: "string", - managedDomainId: "uuid", - method: "string", - recordName: "string", - recordType: "string", - recordValue: "string", - status: "string", - updatedAt: "string", - verifiedAt: "string" + attempts: 'int', + createdAt: 'string', + domainId: 'uuid', + error: 'string', + expiresAt: 'string', + id: 'uuid', + lastCheckedAt: 'string', + managedDomainId: 'uuid', + method: 'string', + recordName: 'string', + recordType: 'string', + recordValue: 'string', + status: 'string', + updatedAt: 'string', + verifiedAt: 'string', }; -const usage = "\nplatform-domain-verification \n\nCommands:\n list List platformDomainVerification records\n find-first Find first matching platformDomainVerification record\n get Get a platformDomainVerification by ID\n create Create a new platformDomainVerification\n update Update an existing platformDomainVerification\n delete Delete a platformDomainVerification\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) => { +const usage = + '\nplatform-domain-verification \n\nCommands:\n list List platformDomainVerification records\n find-first Find first matching platformDomainVerification record\n get Get a platformDomainVerification by ID\n create Create a new platformDomainVerification\n update Update an existing platformDomainVerification\n delete Delete a platformDomainVerification\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -83,16 +97,22 @@ async function handleList(argv: Partial>, _prompter: Inq recordValue: true, status: true, updatedAt: true, - verifiedAt: true + verifiedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformDomainVerificationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy + > & { + select: PlatformDomainVerificationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformDomainVerification.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -116,16 +136,22 @@ async function handleFindFirst(argv: Partial>, _prompter recordValue: true, status: true, updatedAt: true, - verifiedAt: true + verifiedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformDomainVerificationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy + > & { + select: PlatformDomainVerificationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformDomainVerification.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -134,36 +160,40 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformDomainVerification.findOne({ - id: answers.id as string, - select: { - attempts: true, - createdAt: true, - domainId: true, - error: true, - expiresAt: true, - id: true, - lastCheckedAt: true, - managedDomainId: true, - method: true, - recordName: true, - recordType: true, - recordValue: true, - status: true, - updatedAt: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformDomainVerification + .findOne({ + id: answers.id as string, + select: { + attempts: true, + createdAt: true, + domainId: true, + error: true, + expiresAt: true, + id: true, + lastCheckedAt: true, + managedDomainId: true, + method: true, + recordName: true, + recordType: true, + recordValue: true, + status: true, + updatedAt: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -172,117 +202,135 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "attempts", - message: "attempts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastCheckedAt", - message: "lastCheckedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "managedDomainId", - message: "managedDomainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: true - }, { - type: "text", - name: "recordName", - message: "recordName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordType", - message: "recordType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordValue", - message: "recordValue", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'attempts', + message: 'attempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastCheckedAt', + message: 'lastCheckedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'managedDomainId', + message: 'managedDomainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: true, + }, + { + type: 'text', + name: 'recordName', + message: 'recordName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordType', + message: 'recordType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordValue', + message: 'recordValue', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformDomainVerificationInput["platformDomainVerification"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformDomainVerificationInput['platformDomainVerification']; const client = getClient(); - const result = await client.platformDomainVerification.create({ - data: { - attempts: cleanedData.attempts, - domainId: cleanedData.domainId, - error: cleanedData.error, - expiresAt: cleanedData.expiresAt, - lastCheckedAt: cleanedData.lastCheckedAt, - managedDomainId: cleanedData.managedDomainId, - method: cleanedData.method, - recordName: cleanedData.recordName, - recordType: cleanedData.recordType, - recordValue: cleanedData.recordValue, - status: cleanedData.status, - verifiedAt: cleanedData.verifiedAt - }, - select: { - attempts: true, - createdAt: true, - domainId: true, - error: true, - expiresAt: true, - id: true, - lastCheckedAt: true, - managedDomainId: true, - method: true, - recordName: true, - recordType: true, - recordValue: true, - status: true, - updatedAt: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformDomainVerification + .create({ + data: { + attempts: cleanedData.attempts, + domainId: cleanedData.domainId, + error: cleanedData.error, + expiresAt: cleanedData.expiresAt, + lastCheckedAt: cleanedData.lastCheckedAt, + managedDomainId: cleanedData.managedDomainId, + method: cleanedData.method, + recordName: cleanedData.recordName, + recordType: cleanedData.recordType, + recordValue: cleanedData.recordValue, + status: cleanedData.status, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + attempts: true, + createdAt: true, + domainId: true, + error: true, + expiresAt: true, + id: true, + lastCheckedAt: true, + managedDomainId: true, + method: true, + recordName: true, + recordType: true, + recordValue: true, + status: true, + updatedAt: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -291,125 +339,141 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "attempts", - message: "attempts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastCheckedAt", - message: "lastCheckedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "managedDomainId", - message: "managedDomainId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: false - }, { - type: "text", - name: "recordName", - message: "recordName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordType", - message: "recordType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordValue", - message: "recordValue", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'attempts', + message: 'attempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastCheckedAt', + message: 'lastCheckedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'managedDomainId', + message: 'managedDomainId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: false, + }, + { + type: 'text', + name: 'recordName', + message: 'recordName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordType', + message: 'recordType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordValue', + message: 'recordValue', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformDomainVerificationPatch; const client = getClient(); - const result = await client.platformDomainVerification.update({ - where: { - id: answers.id as string - }, - data: { - attempts: cleanedData.attempts, - domainId: cleanedData.domainId, - error: cleanedData.error, - expiresAt: cleanedData.expiresAt, - lastCheckedAt: cleanedData.lastCheckedAt, - managedDomainId: cleanedData.managedDomainId, - method: cleanedData.method, - recordName: cleanedData.recordName, - recordType: cleanedData.recordType, - recordValue: cleanedData.recordValue, - status: cleanedData.status, - verifiedAt: cleanedData.verifiedAt - }, - select: { - attempts: true, - createdAt: true, - domainId: true, - error: true, - expiresAt: true, - id: true, - lastCheckedAt: true, - managedDomainId: true, - method: true, - recordName: true, - recordType: true, - recordValue: true, - status: true, - updatedAt: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformDomainVerification + .update({ + where: { + id: answers.id as string, + }, + data: { + attempts: cleanedData.attempts, + domainId: cleanedData.domainId, + error: cleanedData.error, + expiresAt: cleanedData.expiresAt, + lastCheckedAt: cleanedData.lastCheckedAt, + managedDomainId: cleanedData.managedDomainId, + method: cleanedData.method, + recordName: cleanedData.recordName, + recordType: cleanedData.recordType, + recordValue: cleanedData.recordValue, + status: cleanedData.status, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + attempts: true, + createdAt: true, + domainId: true, + error: true, + expiresAt: true, + id: true, + lastCheckedAt: true, + managedDomainId: true, + method: true, + recordName: true, + recordType: true, + recordValue: true, + status: true, + updatedAt: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -418,28 +482,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformDomainVerification.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformDomainVerification + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-domain.ts b/sdk/constructive-cli/src/api/cli/commands/platform-domain.ts index d2c7f47f71..5b2e33cc5a 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-domain.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-domain.ts @@ -3,62 +3,76 @@ * @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 { CreatePlatformDomainInput, PlatformDomainPatch, PlatformDomainSelect, PlatformDomainFilter, PlatformDomainOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformDomainInput, + PlatformDomainPatch, + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - config: "json", - createdAt: "string", - hostname: "string", - id: "uuid", - isPublished: "boolean", - isWildcard: "boolean", - managed: "boolean", - parentHostname: "string", - tlsReadyAt: "string", - tlsSecretName: "string", - tlsStatus: "string", - updatedAt: "string", - verificationStatus: "string", - verifiedAt: "string" + config: 'json', + createdAt: 'string', + hostname: 'string', + id: 'uuid', + isPublished: 'boolean', + isWildcard: 'boolean', + managed: 'boolean', + parentHostname: 'string', + tlsReadyAt: 'string', + tlsSecretName: 'string', + tlsStatus: 'string', + updatedAt: 'string', + verificationStatus: 'string', + verifiedAt: 'string', }; -const usage = "\nplatform-domain \n\nCommands:\n list List platformDomain records\n find-first Find first matching platformDomain record\n get Get a platformDomain by ID\n create Create a new platformDomain\n update Update an existing platformDomain\n delete Delete a platformDomain\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) => { +const usage = + '\nplatform-domain \n\nCommands:\n list List platformDomain records\n find-first Find first matching platformDomain record\n get Get a platformDomain by ID\n create Create a new platformDomain\n update Update an existing platformDomain\n delete Delete a platformDomain\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,18 @@ async function handleList(argv: Partial>, _prompter: Inq tlsStatus: true, updatedAt: true, verificationStatus: true, - verifiedAt: true + verifiedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformDomainSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformDomainSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformDomain.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +129,18 @@ async function handleFindFirst(argv: Partial>, _prompter tlsStatus: true, updatedAt: true, verificationStatus: true, - verifiedAt: true + verifiedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformDomainSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformDomainSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformDomain.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +149,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformDomain.findOne({ - id: answers.id as string, - select: { - config: true, - createdAt: true, - hostname: true, - id: true, - isPublished: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsReadyAt: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformDomain + .findOne({ + id: answers.id as string, + select: { + config: true, + createdAt: true, + hostname: true, + id: true, + isPublished: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsReadyAt: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,109 +190,126 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hostname", - message: "hostname", - required: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "managed", - message: "managed", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentHostname", - message: "parentHostname", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsReadyAt", - message: "tlsReadyAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsSecretName", - message: "tlsSecretName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hostname', + message: 'hostname', + required: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'managed', + message: 'managed', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentHostname', + message: 'parentHostname', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsReadyAt', + message: 'tlsReadyAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsSecretName', + message: 'tlsSecretName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformDomainInput["platformDomain"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformDomainInput['platformDomain']; const client = getClient(); - const result = await client.platformDomain.create({ - data: { - config: cleanedData.config, - hostname: cleanedData.hostname, - isPublished: cleanedData.isPublished, - isWildcard: cleanedData.isWildcard, - managed: cleanedData.managed, - parentHostname: cleanedData.parentHostname, - tlsReadyAt: cleanedData.tlsReadyAt, - tlsSecretName: cleanedData.tlsSecretName, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus, - verifiedAt: cleanedData.verifiedAt - }, - select: { - config: true, - createdAt: true, - hostname: true, - id: true, - isPublished: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsReadyAt: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformDomain + .create({ + data: { + config: cleanedData.config, + hostname: cleanedData.hostname, + isPublished: cleanedData.isPublished, + isWildcard: cleanedData.isWildcard, + managed: cleanedData.managed, + parentHostname: cleanedData.parentHostname, + tlsReadyAt: cleanedData.tlsReadyAt, + tlsSecretName: cleanedData.tlsSecretName, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + config: true, + createdAt: true, + hostname: true, + id: true, + isPublished: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsReadyAt: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -279,117 +318,132 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hostname", - message: "hostname", - required: false - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "managed", - message: "managed", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentHostname", - message: "parentHostname", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsReadyAt", - message: "tlsReadyAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsSecretName", - message: "tlsSecretName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hostname', + message: 'hostname', + required: false, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'managed', + message: 'managed', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentHostname', + message: 'parentHostname', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsReadyAt', + message: 'tlsReadyAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsSecretName', + message: 'tlsSecretName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformDomainPatch; const client = getClient(); - const result = await client.platformDomain.update({ - where: { - id: answers.id as string - }, - data: { - config: cleanedData.config, - hostname: cleanedData.hostname, - isPublished: cleanedData.isPublished, - isWildcard: cleanedData.isWildcard, - managed: cleanedData.managed, - parentHostname: cleanedData.parentHostname, - tlsReadyAt: cleanedData.tlsReadyAt, - tlsSecretName: cleanedData.tlsSecretName, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus, - verifiedAt: cleanedData.verifiedAt - }, - select: { - config: true, - createdAt: true, - hostname: true, - id: true, - isPublished: true, - isWildcard: true, - managed: true, - parentHostname: true, - tlsReadyAt: true, - tlsSecretName: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformDomain + .update({ + where: { + id: answers.id as string, + }, + data: { + config: cleanedData.config, + hostname: cleanedData.hostname, + isPublished: cleanedData.isPublished, + isWildcard: cleanedData.isWildcard, + managed: cleanedData.managed, + parentHostname: cleanedData.parentHostname, + tlsReadyAt: cleanedData.tlsReadyAt, + tlsSecretName: cleanedData.tlsSecretName, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + config: true, + createdAt: true, + hostname: true, + id: true, + isPublished: true, + isWildcard: true, + managed: true, + parentHostname: true, + tlsReadyAt: true, + tlsSecretName: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -398,28 +452,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformDomain.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformDomain + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-managed-domain.ts b/sdk/constructive-cli/src/api/cli/commands/platform-managed-domain.ts index f269528888..afd7d20101 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-managed-domain.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-managed-domain.ts @@ -3,60 +3,74 @@ * @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 { CreatePlatformManagedDomainInput, PlatformManagedDomainPatch, PlatformManagedDomainSelect, PlatformManagedDomainFilter, PlatformManagedDomainOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformManagedDomainInput, + PlatformManagedDomainPatch, + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - allowPublicUsage: "boolean", - annotations: "json", - certStatus: "string", - createdAt: "string", - domain: "string", - id: "uuid", - isWildcard: "boolean", - tlsReadyAt: "string", - tlsStatus: "string", - updatedAt: "string", - verificationStatus: "string", - verifiedAt: "string" + allowPublicUsage: 'boolean', + annotations: 'json', + certStatus: 'string', + createdAt: 'string', + domain: 'string', + id: 'uuid', + isWildcard: 'boolean', + tlsReadyAt: 'string', + tlsStatus: 'string', + updatedAt: 'string', + verificationStatus: 'string', + verifiedAt: 'string', }; -const usage = "\nplatform-managed-domain \n\nCommands:\n list List platformManagedDomain records\n find-first Find first matching platformManagedDomain record\n get Get a platformManagedDomain by ID\n create Create a new platformManagedDomain\n update Update an existing platformManagedDomain\n delete Delete a platformManagedDomain\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) => { +const usage = + '\nplatform-managed-domain \n\nCommands:\n list List platformManagedDomain records\n find-first Find first matching platformManagedDomain record\n get Get a platformManagedDomain by ID\n create Create a new platformManagedDomain\n update Update an existing platformManagedDomain\n delete Delete a platformManagedDomain\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,22 @@ async function handleList(argv: Partial>, _prompter: Inq tlsStatus: true, updatedAt: true, verificationStatus: true, - verifiedAt: true + verifiedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformManagedDomainSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy + > & { + select: PlatformManagedDomainSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformManagedDomain.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +127,22 @@ async function handleFindFirst(argv: Partial>, _prompter tlsStatus: true, updatedAt: true, verificationStatus: true, - verifiedAt: true + verifiedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformManagedDomainSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy + > & { + select: PlatformManagedDomainSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformManagedDomain.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +151,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformManagedDomain.findOne({ - id: answers.id as string, - select: { - allowPublicUsage: true, - annotations: true, - certStatus: true, - createdAt: true, - domain: true, - id: true, - isWildcard: true, - tlsReadyAt: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformManagedDomain + .findOne({ + id: answers.id as string, + select: { + allowPublicUsage: true, + annotations: true, + certStatus: true, + createdAt: true, + domain: true, + id: true, + isWildcard: true, + tlsReadyAt: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,93 +190,108 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "allowPublicUsage", - message: "allowPublicUsage", - required: false, - skipPrompt: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "certStatus", - message: "certStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domain", - message: "domain", - required: true - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsReadyAt", - message: "tlsReadyAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'allowPublicUsage', + message: 'allowPublicUsage', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'certStatus', + message: 'certStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domain', + message: 'domain', + required: true, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsReadyAt', + message: 'tlsReadyAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformManagedDomainInput["platformManagedDomain"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformManagedDomainInput['platformManagedDomain']; const client = getClient(); - const result = await client.platformManagedDomain.create({ - data: { - allowPublicUsage: cleanedData.allowPublicUsage, - annotations: cleanedData.annotations, - certStatus: cleanedData.certStatus, - domain: cleanedData.domain, - isWildcard: cleanedData.isWildcard, - tlsReadyAt: cleanedData.tlsReadyAt, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus, - verifiedAt: cleanedData.verifiedAt - }, - select: { - allowPublicUsage: true, - annotations: true, - certStatus: true, - createdAt: true, - domain: true, - id: true, - isWildcard: true, - tlsReadyAt: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformManagedDomain + .create({ + data: { + allowPublicUsage: cleanedData.allowPublicUsage, + annotations: cleanedData.annotations, + certStatus: cleanedData.certStatus, + domain: cleanedData.domain, + isWildcard: cleanedData.isWildcard, + tlsReadyAt: cleanedData.tlsReadyAt, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + allowPublicUsage: true, + annotations: true, + certStatus: true, + createdAt: true, + domain: true, + id: true, + isWildcard: true, + tlsReadyAt: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -255,101 +300,114 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "allowPublicUsage", - message: "allowPublicUsage", - required: false, - skipPrompt: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "certStatus", - message: "certStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domain", - message: "domain", - required: false - }, { - type: "boolean", - name: "isWildcard", - message: "isWildcard", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsReadyAt", - message: "tlsReadyAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tlsStatus", - message: "tlsStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verificationStatus", - message: "verificationStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifiedAt", - message: "verifiedAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'allowPublicUsage', + message: 'allowPublicUsage', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'certStatus', + message: 'certStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domain', + message: 'domain', + required: false, + }, + { + type: 'boolean', + name: 'isWildcard', + message: 'isWildcard', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsReadyAt', + message: 'tlsReadyAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tlsStatus', + message: 'tlsStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verificationStatus', + message: 'verificationStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifiedAt', + message: 'verifiedAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformManagedDomainPatch; const client = getClient(); - const result = await client.platformManagedDomain.update({ - where: { - id: answers.id as string - }, - data: { - allowPublicUsage: cleanedData.allowPublicUsage, - annotations: cleanedData.annotations, - certStatus: cleanedData.certStatus, - domain: cleanedData.domain, - isWildcard: cleanedData.isWildcard, - tlsReadyAt: cleanedData.tlsReadyAt, - tlsStatus: cleanedData.tlsStatus, - verificationStatus: cleanedData.verificationStatus, - verifiedAt: cleanedData.verifiedAt - }, - select: { - allowPublicUsage: true, - annotations: true, - certStatus: true, - createdAt: true, - domain: true, - id: true, - isWildcard: true, - tlsReadyAt: true, - tlsStatus: true, - updatedAt: true, - verificationStatus: true, - verifiedAt: true - } - }).execute(); + const result = await client.platformManagedDomain + .update({ + where: { + id: answers.id as string, + }, + data: { + allowPublicUsage: cleanedData.allowPublicUsage, + annotations: cleanedData.annotations, + certStatus: cleanedData.certStatus, + domain: cleanedData.domain, + isWildcard: cleanedData.isWildcard, + tlsReadyAt: cleanedData.tlsReadyAt, + tlsStatus: cleanedData.tlsStatus, + verificationStatus: cleanedData.verificationStatus, + verifiedAt: cleanedData.verifiedAt, + }, + select: { + allowPublicUsage: true, + annotations: true, + certStatus: true, + createdAt: true, + domain: true, + id: true, + isWildcard: true, + tlsReadyAt: true, + tlsStatus: true, + updatedAt: true, + verificationStatus: true, + verifiedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -358,28 +416,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformManagedDomain.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformManagedDomain + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-site-metadatum.ts b/sdk/constructive-cli/src/api/cli/commands/platform-site-metadatum.ts index e64af7e514..f7060259c8 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-site-metadatum.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-site-metadatum.ts @@ -3,55 +3,69 @@ * @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 { CreatePlatformSiteMetadatumInput, PlatformSiteMetadatumPatch, PlatformSiteMetadatumSelect, PlatformSiteMetadatumFilter, PlatformSiteMetadatumOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformSiteMetadatumInput, + PlatformSiteMetadatumPatch, + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - description: "string", - id: "uuid", - ogImage: "string", - siteId: "uuid", - title: "string", - updatedAt: "string" + createdAt: 'string', + description: 'string', + id: 'uuid', + ogImage: 'string', + siteId: 'uuid', + title: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-site-metadatum \n\nCommands:\n list List platformSiteMetadatum records\n find-first Find first matching platformSiteMetadatum record\n get Get a platformSiteMetadatum by ID\n create Create a new platformSiteMetadatum\n update Update an existing platformSiteMetadatum\n delete Delete a platformSiteMetadatum\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) => { +const usage = + '\nplatform-site-metadatum \n\nCommands:\n list List platformSiteMetadatum records\n find-first Find first matching platformSiteMetadatum record\n get Get a platformSiteMetadatum by ID\n create Create a new platformSiteMetadatum\n update Update an existing platformSiteMetadatum\n delete Delete a platformSiteMetadatum\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq ogImage: true, siteId: true, title: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformSiteMetadatumSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy + > & { + select: PlatformSiteMetadatumSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSiteMetadatum.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter ogImage: true, siteId: true, title: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformSiteMetadatumSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy + > & { + select: PlatformSiteMetadatumSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSiteMetadatum.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformSiteMetadatum.findOne({ - id: answers.id as string, - select: { - createdAt: true, - description: true, - id: true, - ogImage: true, - siteId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteMetadatum + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + description: true, + id: true, + ogImage: true, + siteId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,53 +170,63 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ogImage", - message: "ogImage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteId", - message: "siteId", - required: true - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ogImage', + message: 'ogImage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformSiteMetadatumInput["platformSiteMetadatum"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformSiteMetadatumInput['platformSiteMetadatum']; const client = getClient(); - const result = await client.platformSiteMetadatum.create({ - data: { - description: cleanedData.description, - ogImage: cleanedData.ogImage, - siteId: cleanedData.siteId, - title: cleanedData.title - }, - select: { - createdAt: true, - description: true, - id: true, - ogImage: true, - siteId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteMetadatum + .create({ + data: { + description: cleanedData.description, + ogImage: cleanedData.ogImage, + siteId: cleanedData.siteId, + title: cleanedData.title, + }, + select: { + createdAt: true, + description: true, + id: true, + ogImage: true, + siteId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -195,61 +235,69 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ogImage", - message: "ogImage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteId", - message: "siteId", - required: false - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ogImage', + message: 'ogImage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: false, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformSiteMetadatumPatch; const client = getClient(); - const result = await client.platformSiteMetadatum.update({ - where: { - id: answers.id as string - }, - data: { - description: cleanedData.description, - ogImage: cleanedData.ogImage, - siteId: cleanedData.siteId, - title: cleanedData.title - }, - select: { - createdAt: true, - description: true, - id: true, - ogImage: true, - siteId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteMetadatum + .update({ + where: { + id: answers.id as string, + }, + data: { + description: cleanedData.description, + ogImage: cleanedData.ogImage, + siteId: cleanedData.siteId, + title: cleanedData.title, + }, + select: { + createdAt: true, + description: true, + id: true, + ogImage: true, + siteId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -258,28 +306,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformSiteMetadatum.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformSiteMetadatum + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-site-module.ts b/sdk/constructive-cli/src/api/cli/commands/platform-site-module.ts index 44fb38f9c6..e9b82bcd12 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-site-module.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-site-module.ts @@ -3,54 +3,68 @@ * @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 { CreatePlatformSiteModuleInput, PlatformSiteModulePatch, PlatformSiteModuleSelect, PlatformSiteModuleFilter, PlatformSiteModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformSiteModuleInput, + PlatformSiteModulePatch, + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - id: "uuid", - name: "string", - siteId: "uuid", - updatedAt: "string" + createdAt: 'string', + data: 'json', + id: 'uuid', + name: 'string', + siteId: 'uuid', + updatedAt: 'string', }; -const usage = "\nplatform-site-module \n\nCommands:\n list List platformSiteModule records\n find-first Find first matching platformSiteModule record\n get Get a platformSiteModule by ID\n create Create a new platformSiteModule\n update Update an existing platformSiteModule\n delete Delete a platformSiteModule\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) => { +const usage = + '\nplatform-site-module \n\nCommands:\n list List platformSiteModule records\n find-first Find first matching platformSiteModule record\n get Get a platformSiteModule by ID\n create Create a new platformSiteModule\n update Update an existing platformSiteModule\n delete Delete a platformSiteModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, name: true, siteId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformSiteModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy + > & { + select: PlatformSiteModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSiteModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +109,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, name: true, siteId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformSiteModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy + > & { + select: PlatformSiteModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSiteModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +133,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformSiteModule.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - id: true, - name: true, - siteId: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteModule + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + id: true, + name: true, + siteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,43 +166,52 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "siteId", - message: "siteId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformSiteModuleInput["platformSiteModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformSiteModuleInput['platformSiteModule']; const client = getClient(); - const result = await client.platformSiteModule.create({ - data: { - data: cleanedData.data, - name: cleanedData.name, - siteId: cleanedData.siteId - }, - select: { - createdAt: true, - data: true, - id: true, - name: true, - siteId: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteModule + .create({ + data: { + data: cleanedData.data, + name: cleanedData.name, + siteId: cleanedData.siteId, + }, + select: { + createdAt: true, + data: true, + id: true, + name: true, + siteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -181,51 +220,58 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "siteId", - message: "siteId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformSiteModulePatch; const client = getClient(); - const result = await client.platformSiteModule.update({ - where: { - id: answers.id as string - }, - data: { - data: cleanedData.data, - name: cleanedData.name, - siteId: cleanedData.siteId - }, - select: { - createdAt: true, - data: true, - id: true, - name: true, - siteId: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteModule + .update({ + where: { + id: answers.id as string, + }, + data: { + data: cleanedData.data, + name: cleanedData.name, + siteId: cleanedData.siteId, + }, + select: { + createdAt: true, + data: true, + id: true, + name: true, + siteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -234,28 +280,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformSiteModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformSiteModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-site-theme.ts b/sdk/constructive-cli/src/api/cli/commands/platform-site-theme.ts index 62312b75e2..0da3d2c093 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-site-theme.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-site-theme.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformSiteThemeInput, PlatformSiteThemePatch, PlatformSiteThemeSelect, PlatformSiteThemeFilter, PlatformSiteThemeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformSiteThemeInput, + PlatformSiteThemePatch, + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - id: "uuid", - siteId: "uuid", - theme: "json", - updatedAt: "string" + createdAt: 'string', + id: 'uuid', + siteId: 'uuid', + theme: 'json', + updatedAt: 'string', }; -const usage = "\nplatform-site-theme \n\nCommands:\n list List platformSiteTheme records\n find-first Find first matching platformSiteTheme record\n get Get a platformSiteTheme by ID\n create Create a new platformSiteTheme\n update Update an existing platformSiteTheme\n delete Delete a platformSiteTheme\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) => { +const usage = + '\nplatform-site-theme \n\nCommands:\n list List platformSiteTheme records\n find-first Find first matching platformSiteTheme record\n get Get a platformSiteTheme by ID\n create Create a new platformSiteTheme\n update Update an existing platformSiteTheme\n delete Delete a platformSiteTheme\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, siteId: true, theme: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformSiteThemeSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformSiteThemeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSiteTheme.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, siteId: true, theme: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformSiteThemeSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformSiteThemeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSiteTheme.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformSiteTheme.findOne({ - id: answers.id as string, - select: { - createdAt: true, - id: true, - siteId: true, - theme: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteTheme + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + siteId: true, + theme: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,36 +154,44 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "siteId", - message: "siteId", - required: true - }, { - type: "json", - name: "theme", - message: "theme", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: true, + }, + { + type: 'json', + name: 'theme', + message: 'theme', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformSiteThemeInput["platformSiteTheme"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformSiteThemeInput['platformSiteTheme']; const client = getClient(); - const result = await client.platformSiteTheme.create({ - data: { - siteId: cleanedData.siteId, - theme: cleanedData.theme - }, - select: { - createdAt: true, - id: true, - siteId: true, - theme: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteTheme + .create({ + data: { + siteId: cleanedData.siteId, + theme: cleanedData.theme, + }, + select: { + createdAt: true, + id: true, + siteId: true, + theme: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -170,44 +200,50 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "siteId", - message: "siteId", - required: false - }, { - type: "json", - name: "theme", - message: "theme", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: false, + }, + { + type: 'json', + name: 'theme', + message: 'theme', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformSiteThemePatch; const client = getClient(); - const result = await client.platformSiteTheme.update({ - where: { - id: answers.id as string - }, - data: { - siteId: cleanedData.siteId, - theme: cleanedData.theme - }, - select: { - createdAt: true, - id: true, - siteId: true, - theme: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSiteTheme + .update({ + where: { + id: answers.id as string, + }, + data: { + siteId: cleanedData.siteId, + theme: cleanedData.theme, + }, + select: { + createdAt: true, + id: true, + siteId: true, + theme: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -216,28 +252,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformSiteTheme.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformSiteTheme + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/platform-site.ts b/sdk/constructive-cli/src/api/cli/commands/platform-site.ts index d61deba575..1b1b16ff1a 100644 --- a/sdk/constructive-cli/src/api/cli/commands/platform-site.ts +++ b/sdk/constructive-cli/src/api/cli/commands/platform-site.ts @@ -3,56 +3,70 @@ * @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 { CreatePlatformSiteInput, PlatformSitePatch, PlatformSiteSelect, PlatformSiteFilter, PlatformSiteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformSiteInput, + PlatformSitePatch, + PlatformSiteSelect, + PlatformSiteFilter, + PlatformSiteOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - config: "json", - createdAt: "string", - description: "string", - id: "uuid", - isPublished: "boolean", - name: "string", - title: "string", - updatedAt: "string" + config: 'json', + createdAt: 'string', + description: 'string', + id: 'uuid', + isPublished: 'boolean', + name: 'string', + title: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-site \n\nCommands:\n list List platformSite records\n find-first Find first matching platformSite record\n get Get a platformSite by ID\n create Create a new platformSite\n update Update an existing platformSite\n delete Delete a platformSite\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) => { +const usage = + '\nplatform-site \n\nCommands:\n list List platformSite records\n find-first Find first matching platformSite record\n get Get a platformSite by ID\n create Create a new platformSite\n update Update an existing platformSite\n delete Delete a platformSite\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq isPublished: true, name: true, title: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformSiteSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformSiteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSite.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter isPublished: true, name: true, title: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformSiteSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformSiteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSite.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformSite.findOne({ - id: answers.id as string, - select: { - config: true, - createdAt: true, - description: true, - id: true, - isPublished: true, - name: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSite + .findOne({ + id: answers.id as string, + select: { + config: true, + createdAt: true, + description: true, + id: true, + isPublished: true, + name: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,61 +166,72 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformSiteInput["platformSite"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformSiteInput['platformSite']; const client = getClient(); - const result = await client.platformSite.create({ - data: { - config: cleanedData.config, - description: cleanedData.description, - isPublished: cleanedData.isPublished, - name: cleanedData.name, - title: cleanedData.title - }, - select: { - config: true, - createdAt: true, - description: true, - id: true, - isPublished: true, - name: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSite + .create({ + data: { + config: cleanedData.config, + description: cleanedData.description, + isPublished: cleanedData.isPublished, + name: cleanedData.name, + title: cleanedData.title, + }, + select: { + config: true, + createdAt: true, + description: true, + id: true, + isPublished: true, + name: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -207,69 +240,78 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformSitePatch; const client = getClient(); - const result = await client.platformSite.update({ - where: { - id: answers.id as string - }, - data: { - config: cleanedData.config, - description: cleanedData.description, - isPublished: cleanedData.isPublished, - name: cleanedData.name, - title: cleanedData.title - }, - select: { - config: true, - createdAt: true, - description: true, - id: true, - isPublished: true, - name: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSite + .update({ + where: { + id: answers.id as string, + }, + data: { + config: cleanedData.config, + description: cleanedData.description, + isPublished: cleanedData.isPublished, + name: cleanedData.name, + title: cleanedData.title, + }, + select: { + config: true, + createdAt: true, + description: true, + id: true, + isPublished: true, + name: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -278,28 +320,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformSite.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformSite + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/policy.ts b/sdk/constructive-cli/src/api/cli/commands/policy.ts index c5ab8082e6..093021efbf 100644 --- a/sdk/constructive-cli/src/api/cli/commands/policy.ts +++ b/sdk/constructive-cli/src/api/cli/commands/policy.ts @@ -3,64 +3,78 @@ * @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 { CreatePolicyInput, PolicyPatch, PolicySelect, PolicyFilter, PolicyOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePolicyInput, + PolicyPatch, + PolicySelect, + PolicyFilter, + PolicyOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - createdAt: "string", - data: "json", - databaseId: "uuid", - disabled: "boolean", - granteeName: "string", - id: "uuid", - name: "string", - permissive: "boolean", - policyType: "string", - privilege: "string", - smartTags: "json", - tableId: "uuid", - tags: "string", - updatedAt: "string", - withCheck: "json" + category: 'string', + createdAt: 'string', + data: 'json', + databaseId: 'uuid', + disabled: 'boolean', + granteeName: 'string', + id: 'uuid', + name: 'string', + permissive: 'boolean', + policyType: 'string', + privilege: 'string', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + updatedAt: 'string', + withCheck: 'json', }; -const usage = "\npolicy \n\nCommands:\n list List policy records\n find-first Find first matching policy record\n get Get a policy by ID\n create Create a new policy\n update Update an existing policy\n delete Delete a policy\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) => { +const usage = + '\npolicy \n\nCommands:\n list List policy records\n find-first Find first matching policy record\n get Get a policy by ID\n create Create a new policy\n update Update an existing policy\n delete Delete a policy\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,18 @@ async function handleList(argv: Partial>, _prompter: Inq tableId: true, tags: true, updatedAt: true, - withCheck: true + withCheck: true, }; - const findManyArgs = parseFindManyArgs & { - select: PolicySelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PolicySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.policy.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +135,18 @@ async function handleFindFirst(argv: Partial>, _prompter tableId: true, tags: true, updatedAt: true, - withCheck: true + withCheck: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PolicySelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PolicySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.policy.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +155,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.policy.findOne({ - id: answers.id as string, - select: { - category: true, - createdAt: true, - data: true, - databaseId: true, - disabled: true, - granteeName: true, - id: true, - name: true, - permissive: true, - policyType: true, - privilege: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true, - withCheck: true - } - }).execute(); + const result = await client.policy + .findOne({ + id: answers.id as string, + select: { + category: true, + createdAt: true, + data: true, + databaseId: true, + disabled: true, + granteeName: true, + id: true, + name: true, + permissive: true, + policyType: true, + privilege: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + withCheck: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,125 +198,141 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "disabled", - message: "disabled", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "permissive", - message: "permissive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "policyType", - message: "policyType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privilege", - message: "privilege", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "json", - name: "withCheck", - message: "withCheck", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'disabled', + message: 'disabled', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'permissive', + message: 'permissive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'policyType', + message: 'policyType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privilege', + message: 'privilege', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'withCheck', + message: 'withCheck', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePolicyInput["policy"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreatePolicyInput['policy']; const client = getClient(); - const result = await client.policy.create({ - data: { - category: cleanedData.category, - data: cleanedData.data, - databaseId: cleanedData.databaseId, - disabled: cleanedData.disabled, - granteeName: cleanedData.granteeName, - name: cleanedData.name, - permissive: cleanedData.permissive, - policyType: cleanedData.policyType, - privilege: cleanedData.privilege, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - withCheck: cleanedData.withCheck - }, - select: { - category: true, - createdAt: true, - data: true, - databaseId: true, - disabled: true, - granteeName: true, - id: true, - name: true, - permissive: true, - policyType: true, - privilege: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true, - withCheck: true - } - }).execute(); + const result = await client.policy + .create({ + data: { + category: cleanedData.category, + data: cleanedData.data, + databaseId: cleanedData.databaseId, + disabled: cleanedData.disabled, + granteeName: cleanedData.granteeName, + name: cleanedData.name, + permissive: cleanedData.permissive, + policyType: cleanedData.policyType, + privilege: cleanedData.privilege, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + withCheck: cleanedData.withCheck, + }, + select: { + category: true, + createdAt: true, + data: true, + databaseId: true, + disabled: true, + granteeName: true, + id: true, + name: true, + permissive: true, + policyType: true, + privilege: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + withCheck: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -303,133 +341,150 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "disabled", - message: "disabled", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "permissive", - message: "permissive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "policyType", - message: "policyType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privilege", - message: "privilege", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "json", - name: "withCheck", - message: "withCheck", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'disabled', + message: 'disabled', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'permissive', + message: 'permissive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'policyType', + message: 'policyType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privilege', + message: 'privilege', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'withCheck', + message: 'withCheck', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PolicyPatch; const client = getClient(); - const result = await client.policy.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - data: cleanedData.data, - databaseId: cleanedData.databaseId, - disabled: cleanedData.disabled, - granteeName: cleanedData.granteeName, - name: cleanedData.name, - permissive: cleanedData.permissive, - policyType: cleanedData.policyType, - privilege: cleanedData.privilege, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - withCheck: cleanedData.withCheck - }, - select: { - category: true, - createdAt: true, - data: true, - databaseId: true, - disabled: true, - granteeName: true, - id: true, - name: true, - permissive: true, - policyType: true, - privilege: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true, - withCheck: true - } - }).execute(); + const result = await client.policy + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + data: cleanedData.data, + databaseId: cleanedData.databaseId, + disabled: cleanedData.disabled, + granteeName: cleanedData.granteeName, + name: cleanedData.name, + permissive: cleanedData.permissive, + policyType: cleanedData.policyType, + privilege: cleanedData.privilege, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + withCheck: cleanedData.withCheck, + }, + select: { + category: true, + createdAt: true, + data: true, + databaseId: true, + disabled: true, + granteeName: true, + id: true, + name: true, + permissive: true, + policyType: true, + privilege: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + withCheck: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -438,28 +493,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.policy.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.policy + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/primary-key-constraint.ts b/sdk/constructive-cli/src/api/cli/commands/primary-key-constraint.ts index 7cb543cdab..c1bb10b304 100644 --- a/sdk/constructive-cli/src/api/cli/commands/primary-key-constraint.ts +++ b/sdk/constructive-cli/src/api/cli/commands/primary-key-constraint.ts @@ -3,62 +3,76 @@ * @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 { CreatePrimaryKeyConstraintInput, PrimaryKeyConstraintPatch, PrimaryKeyConstraintSelect, PrimaryKeyConstraintFilter, PrimaryKeyConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePrimaryKeyConstraintInput, + PrimaryKeyConstraintPatch, + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - createdAt: "string", - databaseId: "uuid", - fieldIds: "uuid", - id: "uuid", - initiallyDeferred: "boolean", - isDeferrable: "boolean", - name: "string", - smartTags: "json", - tableId: "uuid", - tags: "string", - type: "string", - updatedAt: "string", - withoutOverlaps: "boolean" + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + fieldIds: 'uuid', + id: 'uuid', + initiallyDeferred: 'boolean', + isDeferrable: 'boolean', + name: 'string', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + type: 'string', + updatedAt: 'string', + withoutOverlaps: 'boolean', }; -const usage = "\nprimary-key-constraint \n\nCommands:\n list List primaryKeyConstraint records\n find-first Find first matching primaryKeyConstraint record\n get Get a primaryKeyConstraint by ID\n create Create a new primaryKeyConstraint\n update Update an existing primaryKeyConstraint\n delete Delete a primaryKeyConstraint\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) => { +const usage = + '\nprimary-key-constraint \n\nCommands:\n list List primaryKeyConstraint records\n find-first Find first matching primaryKeyConstraint record\n get Get a primaryKeyConstraint by ID\n create Create a new primaryKeyConstraint\n update Update an existing primaryKeyConstraint\n delete Delete a primaryKeyConstraint\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,22 @@ async function handleList(argv: Partial>, _prompter: Inq tags: true, type: true, updatedAt: true, - withoutOverlaps: true + withoutOverlaps: true, }; - const findManyArgs = parseFindManyArgs & { - select: PrimaryKeyConstraintSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy + > & { + select: PrimaryKeyConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.primaryKeyConstraint.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +133,22 @@ async function handleFindFirst(argv: Partial>, _prompter tags: true, type: true, updatedAt: true, - withoutOverlaps: true + withoutOverlaps: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PrimaryKeyConstraintSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy + > & { + select: PrimaryKeyConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.primaryKeyConstraint.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +157,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.primaryKeyConstraint.findOne({ - id: answers.id as string, - select: { - category: true, - createdAt: true, - databaseId: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - withoutOverlaps: true - } - }).execute(); + const result = await client.primaryKeyConstraint + .findOne({ + id: answers.id as string, + select: { + category: true, + createdAt: true, + databaseId: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + withoutOverlaps: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,108 +198,125 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: true - }, { - type: "boolean", - name: "initiallyDeferred", - message: "initiallyDeferred", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDeferrable", - message: "isDeferrable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "withoutOverlaps", - message: "withoutOverlaps", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: true, + }, + { + type: 'boolean', + name: 'initiallyDeferred', + message: 'initiallyDeferred', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDeferrable', + message: 'isDeferrable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'withoutOverlaps', + message: 'withoutOverlaps', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePrimaryKeyConstraintInput["primaryKeyConstraint"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePrimaryKeyConstraintInput['primaryKeyConstraint']; const client = getClient(); - const result = await client.primaryKeyConstraint.create({ - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - fieldIds: cleanedData.fieldIds, - initiallyDeferred: cleanedData.initiallyDeferred, - isDeferrable: cleanedData.isDeferrable, - name: cleanedData.name, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type, - withoutOverlaps: cleanedData.withoutOverlaps - }, - select: { - category: true, - createdAt: true, - databaseId: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - withoutOverlaps: true - } - }).execute(); + const result = await client.primaryKeyConstraint + .create({ + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + fieldIds: cleanedData.fieldIds, + initiallyDeferred: cleanedData.initiallyDeferred, + isDeferrable: cleanedData.isDeferrable, + name: cleanedData.name, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + withoutOverlaps: cleanedData.withoutOverlaps, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + withoutOverlaps: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -278,116 +325,131 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false - }, { - type: "boolean", - name: "initiallyDeferred", - message: "initiallyDeferred", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDeferrable", - message: "isDeferrable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "withoutOverlaps", - message: "withoutOverlaps", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + }, + { + type: 'boolean', + name: 'initiallyDeferred', + message: 'initiallyDeferred', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDeferrable', + message: 'isDeferrable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'withoutOverlaps', + message: 'withoutOverlaps', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PrimaryKeyConstraintPatch; const client = getClient(); - const result = await client.primaryKeyConstraint.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - fieldIds: cleanedData.fieldIds, - initiallyDeferred: cleanedData.initiallyDeferred, - isDeferrable: cleanedData.isDeferrable, - name: cleanedData.name, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type, - withoutOverlaps: cleanedData.withoutOverlaps - }, - select: { - category: true, - createdAt: true, - databaseId: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - withoutOverlaps: true - } - }).execute(); + const result = await client.primaryKeyConstraint + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + fieldIds: cleanedData.fieldIds, + initiallyDeferred: cleanedData.initiallyDeferred, + isDeferrable: cleanedData.isDeferrable, + name: cleanedData.name, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + withoutOverlaps: cleanedData.withoutOverlaps, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + withoutOverlaps: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -396,28 +458,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.primaryKeyConstraint.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.primaryKeyConstraint + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/api/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/api/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/api/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/pubkey-setting.ts b/sdk/constructive-cli/src/api/cli/commands/pubkey-setting.ts index e44fb55345..31c51e0366 100644 --- a/sdk/constructive-cli/src/api/cli/commands/pubkey-setting.ts +++ b/sdk/constructive-cli/src/api/cli/commands/pubkey-setting.ts @@ -3,59 +3,73 @@ * @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 { CreatePubkeySettingInput, PubkeySettingPatch, PubkeySettingSelect, PubkeySettingFilter, PubkeySettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePubkeySettingInput, + PubkeySettingPatch, + PubkeySettingSelect, + PubkeySettingFilter, + PubkeySettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - cryptoNetwork: "string", - databaseId: "uuid", - id: "uuid", - schemaId: "uuid", - signInRecordFailureFunctionId: "uuid", - signInRequestChallengeFunctionId: "uuid", - signInWithChallengeFunctionId: "uuid", - signUpWithKeyFunctionId: "uuid", - updatedAt: "string", - userField: "string" + createdAt: 'string', + cryptoNetwork: 'string', + databaseId: 'uuid', + id: 'uuid', + schemaId: 'uuid', + signInRecordFailureFunctionId: 'uuid', + signInRequestChallengeFunctionId: 'uuid', + signInWithChallengeFunctionId: 'uuid', + signUpWithKeyFunctionId: 'uuid', + updatedAt: 'string', + userField: 'string', }; -const usage = "\npubkey-setting \n\nCommands:\n list List pubkeySetting records\n find-first Find first matching pubkeySetting record\n get Get a pubkeySetting by ID\n create Create a new pubkeySetting\n update Update an existing pubkeySetting\n delete Delete a pubkeySetting\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) => { +const usage = + '\npubkey-setting \n\nCommands:\n list List pubkeySetting records\n find-first Find first matching pubkeySetting record\n get Get a pubkeySetting by ID\n create Create a new pubkeySetting\n update Update an existing pubkeySetting\n delete Delete a pubkeySetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq signInWithChallengeFunctionId: true, signUpWithKeyFunctionId: true, updatedAt: true, - userField: true + userField: true, }; - const findManyArgs = parseFindManyArgs & { - select: PubkeySettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PubkeySettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.pubkeySetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter signInWithChallengeFunctionId: true, signUpWithKeyFunctionId: true, updatedAt: true, - userField: true + userField: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PubkeySettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PubkeySettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.pubkeySetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.pubkeySetting.findOne({ - id: answers.id as string, - select: { - createdAt: true, - cryptoNetwork: true, - databaseId: true, - id: true, - schemaId: true, - signInRecordFailureFunctionId: true, - signInRequestChallengeFunctionId: true, - signInWithChallengeFunctionId: true, - signUpWithKeyFunctionId: true, - updatedAt: true, - userField: true - } - }).execute(); + const result = await client.pubkeySetting + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + cryptoNetwork: true, + databaseId: true, + id: true, + schemaId: true, + signInRecordFailureFunctionId: true, + signInRequestChallengeFunctionId: true, + signInWithChallengeFunctionId: true, + signUpWithKeyFunctionId: true, + updatedAt: true, + userField: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,85 +178,99 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "cryptoNetwork", - message: "cryptoNetwork", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInRecordFailureFunctionId", - message: "signInRecordFailureFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInRequestChallengeFunctionId", - message: "signInRequestChallengeFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInWithChallengeFunctionId", - message: "signInWithChallengeFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signUpWithKeyFunctionId", - message: "signUpWithKeyFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userField", - message: "userField", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'cryptoNetwork', + message: 'cryptoNetwork', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInRecordFailureFunctionId', + message: 'signInRecordFailureFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInRequestChallengeFunctionId', + message: 'signInRequestChallengeFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInWithChallengeFunctionId', + message: 'signInWithChallengeFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signUpWithKeyFunctionId', + message: 'signUpWithKeyFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userField', + message: 'userField', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePubkeySettingInput["pubkeySetting"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePubkeySettingInput['pubkeySetting']; const client = getClient(); - const result = await client.pubkeySetting.create({ - data: { - cryptoNetwork: cleanedData.cryptoNetwork, - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - signInRecordFailureFunctionId: cleanedData.signInRecordFailureFunctionId, - signInRequestChallengeFunctionId: cleanedData.signInRequestChallengeFunctionId, - signInWithChallengeFunctionId: cleanedData.signInWithChallengeFunctionId, - signUpWithKeyFunctionId: cleanedData.signUpWithKeyFunctionId, - userField: cleanedData.userField - }, - select: { - createdAt: true, - cryptoNetwork: true, - databaseId: true, - id: true, - schemaId: true, - signInRecordFailureFunctionId: true, - signInRequestChallengeFunctionId: true, - signInWithChallengeFunctionId: true, - signUpWithKeyFunctionId: true, - updatedAt: true, - userField: true - } - }).execute(); + const result = await client.pubkeySetting + .create({ + data: { + cryptoNetwork: cleanedData.cryptoNetwork, + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + signInRecordFailureFunctionId: cleanedData.signInRecordFailureFunctionId, + signInRequestChallengeFunctionId: cleanedData.signInRequestChallengeFunctionId, + signInWithChallengeFunctionId: cleanedData.signInWithChallengeFunctionId, + signUpWithKeyFunctionId: cleanedData.signUpWithKeyFunctionId, + userField: cleanedData.userField, + }, + select: { + createdAt: true, + cryptoNetwork: true, + databaseId: true, + id: true, + schemaId: true, + signInRecordFailureFunctionId: true, + signInRequestChallengeFunctionId: true, + signInWithChallengeFunctionId: true, + signUpWithKeyFunctionId: true, + updatedAt: true, + userField: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -243,93 +279,105 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "cryptoNetwork", - message: "cryptoNetwork", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInRecordFailureFunctionId", - message: "signInRecordFailureFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInRequestChallengeFunctionId", - message: "signInRequestChallengeFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInWithChallengeFunctionId", - message: "signInWithChallengeFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signUpWithKeyFunctionId", - message: "signUpWithKeyFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userField", - message: "userField", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'cryptoNetwork', + message: 'cryptoNetwork', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInRecordFailureFunctionId', + message: 'signInRecordFailureFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInRequestChallengeFunctionId', + message: 'signInRequestChallengeFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInWithChallengeFunctionId', + message: 'signInWithChallengeFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signUpWithKeyFunctionId', + message: 'signUpWithKeyFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userField', + message: 'userField', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PubkeySettingPatch; const client = getClient(); - const result = await client.pubkeySetting.update({ - where: { - id: answers.id as string - }, - data: { - cryptoNetwork: cleanedData.cryptoNetwork, - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - signInRecordFailureFunctionId: cleanedData.signInRecordFailureFunctionId, - signInRequestChallengeFunctionId: cleanedData.signInRequestChallengeFunctionId, - signInWithChallengeFunctionId: cleanedData.signInWithChallengeFunctionId, - signUpWithKeyFunctionId: cleanedData.signUpWithKeyFunctionId, - userField: cleanedData.userField - }, - select: { - createdAt: true, - cryptoNetwork: true, - databaseId: true, - id: true, - schemaId: true, - signInRecordFailureFunctionId: true, - signInRequestChallengeFunctionId: true, - signInWithChallengeFunctionId: true, - signUpWithKeyFunctionId: true, - updatedAt: true, - userField: true - } - }).execute(); + const result = await client.pubkeySetting + .update({ + where: { + id: answers.id as string, + }, + data: { + cryptoNetwork: cleanedData.cryptoNetwork, + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + signInRecordFailureFunctionId: cleanedData.signInRecordFailureFunctionId, + signInRequestChallengeFunctionId: cleanedData.signInRequestChallengeFunctionId, + signInWithChallengeFunctionId: cleanedData.signInWithChallengeFunctionId, + signUpWithKeyFunctionId: cleanedData.signUpWithKeyFunctionId, + userField: cleanedData.userField, + }, + select: { + createdAt: true, + cryptoNetwork: true, + databaseId: true, + id: true, + schemaId: true, + signInRecordFailureFunctionId: true, + signInRequestChallengeFunctionId: true, + signInWithChallengeFunctionId: true, + signUpWithKeyFunctionId: true, + updatedAt: true, + userField: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -338,28 +386,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.pubkeySetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.pubkeySetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/reject-database-transfer.ts b/sdk/constructive-cli/src/api/cli/commands/reject-database-transfer.ts index 486413443f..cca8dcb4ff 100644 --- a/sdk/constructive-cli/src/api/cli/commands/reject-database-transfer.ts +++ b/sdk/constructive-cli/src/api/cli/commands/reject-database-transfer.ts @@ -3,37 +3,51 @@ * @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 { RejectDatabaseTransferVariables } from "../../orm/mutation"; -import type { RejectDatabaseTransferPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { RejectDatabaseTransferVariables } from '../../orm/mutation'; +import type { RejectDatabaseTransferPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("reject-database-transfer - rejectDatabaseTransfer\n\nUsage: reject-database-transfer [OPTIONS]\n"); + console.log( + 'reject-database-transfer - rejectDatabaseTransfer\n\nUsage: reject-database-transfer [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 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.rejectDatabaseTransfer(parsedAnswers as unknown as RejectDatabaseTransferVariables, { - select: selectFields - } as unknown as { - select: RejectDatabaseTransferPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .rejectDatabaseTransfer( + parsedAnswers as unknown as RejectDatabaseTransferVariables, + { + select: selectFields, + } as unknown as { + select: RejectDatabaseTransferPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: rejectDatabaseTransfer"); + console.error('Failed: rejectDatabaseTransfer'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/request-database.ts b/sdk/constructive-cli/src/api/cli/commands/request-database.ts index 7bdccfcdf9..00e2f1489b 100644 --- a/sdk/constructive-cli/src/api/cli/commands/request-database.ts +++ b/sdk/constructive-cli/src/api/cli/commands/request-database.ts @@ -3,37 +3,51 @@ * @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 { RequestDatabaseVariables } from "../../orm/mutation"; -import type { RequestDatabasePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { RequestDatabaseVariables } from '../../orm/mutation'; +import type { RequestDatabasePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("request-database - Requests a database and returns a ticket (database_provision_module row) to poll.\n\nPass exactly one of preset_slug or modules. The pool, presets, and owner bootstrap are private implementation details: a warm pool hit fulfills the ticket immediately (fulfilled_at set, deferred owner bootstrap), otherwise the database is cold-provisioned asynchronously with exactly the requested modules. Poll the ticket until status = 'completed'; it then carries database_id and fulfilled_at.\n\nExample usage:\n SELECT * FROM metaschema_public.request_database('my_app', 'example.com', preset_slug := 'full');\n SELECT * FROM metaschema_public.request_database('my_app', 'example.com', modules := '[\"users_module\", \"emails_module\"]'::jsonb);\n\nUsage: request-database [OPTIONS]\n"); + console.log( + "request-database - Requests a database and returns a ticket (database_provision_module row) to poll.\n\nPass exactly one of preset_slug or modules. The pool, presets, and owner bootstrap are private implementation details: a warm pool hit fulfills the ticket immediately (fulfilled_at set, deferred owner bootstrap), otherwise the database is cold-provisioned asynchronously with exactly the requested modules. Poll the ticket until status = 'completed'; it then carries database_id and fulfilled_at.\n\nExample usage:\n SELECT * FROM metaschema_public.request_database('my_app', 'example.com', preset_slug := 'full');\n SELECT * FROM metaschema_public.request_database('my_app', 'example.com', modules := '[\"users_module\", \"emails_module\"]'::jsonb);\n\nUsage: request-database [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 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.requestDatabase(parsedAnswers as unknown as RequestDatabaseVariables, { - select: selectFields - } as unknown as { - select: RequestDatabasePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .requestDatabase( + parsedAnswers as unknown as RequestDatabaseVariables, + { + select: selectFields, + } as unknown as { + select: RequestDatabasePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: requestDatabase"); + console.error('Failed: requestDatabase'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/resolve-http-route.ts b/sdk/constructive-cli/src/api/cli/commands/resolve-http-route.ts index cea9e557e3..3ca1265841 100644 --- a/sdk/constructive-cli/src/api/cli/commands/resolve-http-route.ts +++ b/sdk/constructive-cli/src/api/cli/commands/resolve-http-route.ts @@ -3,43 +3,56 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { buildSelectFromPaths } from "../utils"; -import type { ResolveHttpRouteVariables } from "../../orm/query"; -import type { ResolveHttpRouteRecordSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { buildSelectFromPaths } from '../utils'; +import type { ResolveHttpRouteVariables } from '../../orm/query'; +import type { ResolveHttpRouteRecordSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("resolve-http-route - resolveHttpRoute\n\nUsage: resolve-http-route [OPTIONS]\n"); + console.log('resolve-http-route - resolveHttpRoute\n\nUsage: resolve-http-route [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "requestHost", - message: "requestHost" - }, { - type: "text", - name: "requestMethod", - message: "requestMethod" - }, { - type: "text", - name: "requestPath", - message: "requestPath" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'requestHost', + message: 'requestHost', + }, + { + type: 'text', + name: 'requestMethod', + message: 'requestMethod', + }, + { + type: 'text', + name: 'requestPath', + message: 'requestPath', + }, + ]); const client = getClient(); - const selectFields = buildSelectFromPaths(argv.select as string ?? ""); - const result = await client.query.resolveHttpRoute(answers as unknown as ResolveHttpRouteVariables, { - select: selectFields - } as unknown as { - select: ResolveHttpRouteRecordSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? ''); + const result = await client.query + .resolveHttpRoute( + answers as unknown as ResolveHttpRouteVariables, + { + select: selectFields, + } as unknown as { + select: ResolveHttpRouteRecordSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resolveHttpRoute"); + console.error('Failed: resolveHttpRoute'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/resolve-route.ts b/sdk/constructive-cli/src/api/cli/commands/resolve-route.ts index 2acb506b18..45af777b53 100644 --- a/sdk/constructive-cli/src/api/cli/commands/resolve-route.ts +++ b/sdk/constructive-cli/src/api/cli/commands/resolve-route.ts @@ -3,43 +3,56 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { buildSelectFromPaths } from "../utils"; -import type { ResolveRouteVariables } from "../../orm/query"; -import type { ResolveRouteRecordSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { buildSelectFromPaths } from '../utils'; +import type { ResolveRouteVariables } from '../../orm/query'; +import type { ResolveRouteRecordSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("resolve-route - resolveRoute\n\nUsage: resolve-route [OPTIONS]\n"); + console.log('resolve-route - resolveRoute\n\nUsage: resolve-route [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "requestHost", - message: "requestHost" - }, { - type: "text", - name: "requestMethod", - message: "requestMethod" - }, { - type: "text", - name: "requestPath", - message: "requestPath" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'requestHost', + message: 'requestHost', + }, + { + type: 'text', + name: 'requestMethod', + message: 'requestMethod', + }, + { + type: 'text', + name: 'requestPath', + message: 'requestPath', + }, + ]); const client = getClient(); - const selectFields = buildSelectFromPaths(argv.select as string ?? ""); - const result = await client.query.resolveRoute(answers as unknown as ResolveRouteVariables, { - select: selectFields - } as unknown as { - select: ResolveRouteRecordSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? ''); + const result = await client.query + .resolveRoute( + answers as unknown as ResolveRouteVariables, + { + select: selectFields, + } as unknown as { + select: ResolveRouteRecordSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resolveRoute"); + console.error('Failed: resolveRoute'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/rls-setting.ts b/sdk/constructive-cli/src/api/cli/commands/rls-setting.ts index 6612d423fa..6274dd854f 100644 --- a/sdk/constructive-cli/src/api/cli/commands/rls-setting.ts +++ b/sdk/constructive-cli/src/api/cli/commands/rls-setting.ts @@ -3,60 +3,74 @@ * @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 { CreateRlsSettingInput, RlsSettingPatch, RlsSettingSelect, RlsSettingFilter, RlsSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRlsSettingInput, + RlsSettingPatch, + RlsSettingSelect, + RlsSettingFilter, + RlsSettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - authenticateFunctionId: "uuid", - authenticateSchemaId: "uuid", - authenticateStrictFunctionId: "uuid", - createdAt: "string", - currentIpAddressFunctionId: "uuid", - currentRoleFunctionId: "uuid", - currentRoleIdFunctionId: "uuid", - currentUserAgentFunctionId: "uuid", - databaseId: "uuid", - id: "uuid", - roleSchemaId: "uuid", - updatedAt: "string" + authenticateFunctionId: 'uuid', + authenticateSchemaId: 'uuid', + authenticateStrictFunctionId: 'uuid', + createdAt: 'string', + currentIpAddressFunctionId: 'uuid', + currentRoleFunctionId: 'uuid', + currentRoleIdFunctionId: 'uuid', + currentUserAgentFunctionId: 'uuid', + databaseId: 'uuid', + id: 'uuid', + roleSchemaId: 'uuid', + updatedAt: 'string', }; -const usage = "\nrls-setting \n\nCommands:\n list List rlsSetting records\n find-first Find first matching rlsSetting record\n get Get a rlsSetting by ID\n create Create a new rlsSetting\n update Update an existing rlsSetting\n delete Delete a rlsSetting\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) => { +const usage = + '\nrls-setting \n\nCommands:\n list List rlsSetting records\n find-first Find first matching rlsSetting record\n get Get a rlsSetting by ID\n create Create a new rlsSetting\n update Update an existing rlsSetting\n delete Delete a rlsSetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, roleSchemaId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: RlsSettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RlsSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.rlsSetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +123,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, roleSchemaId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RlsSettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RlsSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.rlsSetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +143,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.rlsSetting.findOne({ - id: answers.id as string, - select: { - authenticateFunctionId: true, - authenticateSchemaId: true, - authenticateStrictFunctionId: true, - createdAt: true, - currentIpAddressFunctionId: true, - currentRoleFunctionId: true, - currentRoleIdFunctionId: true, - currentUserAgentFunctionId: true, - databaseId: true, - id: true, - roleSchemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.rlsSetting + .findOne({ + id: answers.id as string, + select: { + authenticateFunctionId: true, + authenticateSchemaId: true, + authenticateStrictFunctionId: true, + createdAt: true, + currentIpAddressFunctionId: true, + currentRoleFunctionId: true, + currentRoleIdFunctionId: true, + currentUserAgentFunctionId: true, + databaseId: true, + id: true, + roleSchemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,93 +182,105 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "authenticateFunctionId", - message: "authenticateFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authenticateSchemaId", - message: "authenticateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authenticateStrictFunctionId", - message: "authenticateStrictFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentIpAddressFunctionId", - message: "currentIpAddressFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentRoleFunctionId", - message: "currentRoleFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentRoleIdFunctionId", - message: "currentRoleIdFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentUserAgentFunctionId", - message: "currentUserAgentFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "roleSchemaId", - message: "roleSchemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'authenticateFunctionId', + message: 'authenticateFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authenticateSchemaId', + message: 'authenticateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authenticateStrictFunctionId', + message: 'authenticateStrictFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentIpAddressFunctionId', + message: 'currentIpAddressFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentRoleFunctionId', + message: 'currentRoleFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentRoleIdFunctionId', + message: 'currentRoleIdFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentUserAgentFunctionId', + message: 'currentUserAgentFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'roleSchemaId', + message: 'roleSchemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRlsSettingInput["rlsSetting"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateRlsSettingInput['rlsSetting']; const client = getClient(); - const result = await client.rlsSetting.create({ - data: { - authenticateFunctionId: cleanedData.authenticateFunctionId, - authenticateSchemaId: cleanedData.authenticateSchemaId, - authenticateStrictFunctionId: cleanedData.authenticateStrictFunctionId, - currentIpAddressFunctionId: cleanedData.currentIpAddressFunctionId, - currentRoleFunctionId: cleanedData.currentRoleFunctionId, - currentRoleIdFunctionId: cleanedData.currentRoleIdFunctionId, - currentUserAgentFunctionId: cleanedData.currentUserAgentFunctionId, - databaseId: cleanedData.databaseId, - roleSchemaId: cleanedData.roleSchemaId - }, - select: { - authenticateFunctionId: true, - authenticateSchemaId: true, - authenticateStrictFunctionId: true, - createdAt: true, - currentIpAddressFunctionId: true, - currentRoleFunctionId: true, - currentRoleIdFunctionId: true, - currentUserAgentFunctionId: true, - databaseId: true, - id: true, - roleSchemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.rlsSetting + .create({ + data: { + authenticateFunctionId: cleanedData.authenticateFunctionId, + authenticateSchemaId: cleanedData.authenticateSchemaId, + authenticateStrictFunctionId: cleanedData.authenticateStrictFunctionId, + currentIpAddressFunctionId: cleanedData.currentIpAddressFunctionId, + currentRoleFunctionId: cleanedData.currentRoleFunctionId, + currentRoleIdFunctionId: cleanedData.currentRoleIdFunctionId, + currentUserAgentFunctionId: cleanedData.currentUserAgentFunctionId, + databaseId: cleanedData.databaseId, + roleSchemaId: cleanedData.roleSchemaId, + }, + select: { + authenticateFunctionId: true, + authenticateSchemaId: true, + authenticateStrictFunctionId: true, + createdAt: true, + currentIpAddressFunctionId: true, + currentRoleFunctionId: true, + currentRoleIdFunctionId: true, + currentUserAgentFunctionId: true, + databaseId: true, + id: true, + roleSchemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -255,101 +289,114 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "authenticateFunctionId", - message: "authenticateFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authenticateSchemaId", - message: "authenticateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authenticateStrictFunctionId", - message: "authenticateStrictFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentIpAddressFunctionId", - message: "currentIpAddressFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentRoleFunctionId", - message: "currentRoleFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentRoleIdFunctionId", - message: "currentRoleIdFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentUserAgentFunctionId", - message: "currentUserAgentFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "roleSchemaId", - message: "roleSchemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'authenticateFunctionId', + message: 'authenticateFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authenticateSchemaId', + message: 'authenticateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authenticateStrictFunctionId', + message: 'authenticateStrictFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentIpAddressFunctionId', + message: 'currentIpAddressFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentRoleFunctionId', + message: 'currentRoleFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentRoleIdFunctionId', + message: 'currentRoleIdFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentUserAgentFunctionId', + message: 'currentUserAgentFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'roleSchemaId', + message: 'roleSchemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RlsSettingPatch; const client = getClient(); - const result = await client.rlsSetting.update({ - where: { - id: answers.id as string - }, - data: { - authenticateFunctionId: cleanedData.authenticateFunctionId, - authenticateSchemaId: cleanedData.authenticateSchemaId, - authenticateStrictFunctionId: cleanedData.authenticateStrictFunctionId, - currentIpAddressFunctionId: cleanedData.currentIpAddressFunctionId, - currentRoleFunctionId: cleanedData.currentRoleFunctionId, - currentRoleIdFunctionId: cleanedData.currentRoleIdFunctionId, - currentUserAgentFunctionId: cleanedData.currentUserAgentFunctionId, - databaseId: cleanedData.databaseId, - roleSchemaId: cleanedData.roleSchemaId - }, - select: { - authenticateFunctionId: true, - authenticateSchemaId: true, - authenticateStrictFunctionId: true, - createdAt: true, - currentIpAddressFunctionId: true, - currentRoleFunctionId: true, - currentRoleIdFunctionId: true, - currentUserAgentFunctionId: true, - databaseId: true, - id: true, - roleSchemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.rlsSetting + .update({ + where: { + id: answers.id as string, + }, + data: { + authenticateFunctionId: cleanedData.authenticateFunctionId, + authenticateSchemaId: cleanedData.authenticateSchemaId, + authenticateStrictFunctionId: cleanedData.authenticateStrictFunctionId, + currentIpAddressFunctionId: cleanedData.currentIpAddressFunctionId, + currentRoleFunctionId: cleanedData.currentRoleFunctionId, + currentRoleIdFunctionId: cleanedData.currentRoleIdFunctionId, + currentUserAgentFunctionId: cleanedData.currentUserAgentFunctionId, + databaseId: cleanedData.databaseId, + roleSchemaId: cleanedData.roleSchemaId, + }, + select: { + authenticateFunctionId: true, + authenticateSchemaId: true, + authenticateStrictFunctionId: true, + createdAt: true, + currentIpAddressFunctionId: true, + currentRoleFunctionId: true, + currentRoleIdFunctionId: true, + currentUserAgentFunctionId: true, + databaseId: true, + id: true, + roleSchemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -358,28 +405,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.rlsSetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.rlsSetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/route-binding.ts b/sdk/constructive-cli/src/api/cli/commands/route-binding.ts index 94d1450396..96cd4468d3 100644 --- a/sdk/constructive-cli/src/api/cli/commands/route-binding.ts +++ b/sdk/constructive-cli/src/api/cli/commands/route-binding.ts @@ -3,58 +3,72 @@ * @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 { CreateRouteBindingInput, RouteBindingPatch, RouteBindingSelect, RouteBindingFilter, RouteBindingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRouteBindingInput, + RouteBindingPatch, + RouteBindingSelect, + RouteBindingFilter, + RouteBindingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - domainId: "uuid", - id: "uuid", - isActive: "boolean", - method: "string", - path: "string", - priority: "int", - targetApiId: "uuid", - targetFunctionId: "uuid", - targetSiteId: "uuid", - updatedAt: "string" + domainId: 'uuid', + id: 'uuid', + isActive: 'boolean', + method: 'string', + path: 'string', + priority: 'int', + targetApiId: 'uuid', + targetFunctionId: 'uuid', + targetSiteId: 'uuid', + updatedAt: 'string', }; -const usage = "\nroute-binding \n\nCommands:\n list List routeBinding records\n find-first Find first matching routeBinding record\n get Get a routeBinding by ID\n create Create a new routeBinding\n update Update an existing routeBinding\n delete Delete a routeBinding\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) => { +const usage = + '\nroute-binding \n\nCommands:\n list List routeBinding records\n find-first Find first matching routeBinding record\n get Get a routeBinding by ID\n create Create a new routeBinding\n update Update an existing routeBinding\n delete Delete a routeBinding\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq targetApiId: true, targetFunctionId: true, targetSiteId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: RouteBindingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RouteBindingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.routeBinding.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter targetApiId: true, targetFunctionId: true, targetSiteId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RouteBindingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RouteBindingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.routeBinding.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.routeBinding.findOne({ - id: answers.id as string, - select: { - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetApiId: true, - targetFunctionId: true, - targetSiteId: true, - updatedAt: true - } - }).execute(); + const result = await client.routeBinding + .findOne({ + id: answers.id as string, + select: { + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetApiId: true, + targetFunctionId: true, + targetSiteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,83 +174,97 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "domainId", - message: "domainId", - required: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: false, - skipPrompt: true - }, { - type: "text", - name: "path", - message: "path", - required: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetApiId", - message: "targetApiId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetFunctionId", - message: "targetFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetSiteId", - message: "targetSiteId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetApiId', + message: 'targetApiId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetFunctionId', + message: 'targetFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetSiteId', + message: 'targetSiteId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRouteBindingInput["routeBinding"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateRouteBindingInput['routeBinding']; const client = getClient(); - const result = await client.routeBinding.create({ - data: { - domainId: cleanedData.domainId, - isActive: cleanedData.isActive, - method: cleanedData.method, - path: cleanedData.path, - priority: cleanedData.priority, - targetApiId: cleanedData.targetApiId, - targetFunctionId: cleanedData.targetFunctionId, - targetSiteId: cleanedData.targetSiteId - }, - select: { - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetApiId: true, - targetFunctionId: true, - targetSiteId: true, - updatedAt: true - } - }).execute(); + const result = await client.routeBinding + .create({ + data: { + domainId: cleanedData.domainId, + isActive: cleanedData.isActive, + method: cleanedData.method, + path: cleanedData.path, + priority: cleanedData.priority, + targetApiId: cleanedData.targetApiId, + targetFunctionId: cleanedData.targetFunctionId, + targetSiteId: cleanedData.targetSiteId, + }, + select: { + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetApiId: true, + targetFunctionId: true, + targetSiteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -237,91 +273,103 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "domainId", - message: "domainId", - required: false - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: false, - skipPrompt: true - }, { - type: "text", - name: "path", - message: "path", - required: false - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetApiId", - message: "targetApiId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetFunctionId", - message: "targetFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetSiteId", - message: "targetSiteId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: false, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetApiId', + message: 'targetApiId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetFunctionId', + message: 'targetFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetSiteId', + message: 'targetSiteId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RouteBindingPatch; const client = getClient(); - const result = await client.routeBinding.update({ - where: { - id: answers.id as string - }, - data: { - domainId: cleanedData.domainId, - isActive: cleanedData.isActive, - method: cleanedData.method, - path: cleanedData.path, - priority: cleanedData.priority, - targetApiId: cleanedData.targetApiId, - targetFunctionId: cleanedData.targetFunctionId, - targetSiteId: cleanedData.targetSiteId - }, - select: { - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetApiId: true, - targetFunctionId: true, - targetSiteId: true, - updatedAt: true - } - }).execute(); + const result = await client.routeBinding + .update({ + where: { + id: answers.id as string, + }, + data: { + domainId: cleanedData.domainId, + isActive: cleanedData.isActive, + method: cleanedData.method, + path: cleanedData.path, + priority: cleanedData.priority, + targetApiId: cleanedData.targetApiId, + targetFunctionId: cleanedData.targetFunctionId, + targetSiteId: cleanedData.targetSiteId, + }, + select: { + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetApiId: true, + targetFunctionId: true, + targetSiteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -330,28 +378,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.routeBinding.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.routeBinding + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/route.ts b/sdk/constructive-cli/src/api/cli/commands/route.ts index e79f31cd02..d04eab5d34 100644 --- a/sdk/constructive-cli/src/api/cli/commands/route.ts +++ b/sdk/constructive-cli/src/api/cli/commands/route.ts @@ -3,61 +3,75 @@ * @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 { CreateRouteInput, RoutePatch, RouteSelect, RouteFilter, RouteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRouteInput, + RoutePatch, + RouteSelect, + RouteFilter, + RouteOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - config: "json", - createdAt: "string", - databaseId: "uuid", - domainId: "uuid", - id: "uuid", - isActive: "boolean", - method: "string", - path: "string", - priority: "int", - targetApiId: "uuid", - targetFunctionId: "uuid", - targetSiteId: "uuid", - updatedAt: "string" + config: 'json', + createdAt: 'string', + databaseId: 'uuid', + domainId: 'uuid', + id: 'uuid', + isActive: 'boolean', + method: 'string', + path: 'string', + priority: 'int', + targetApiId: 'uuid', + targetFunctionId: 'uuid', + targetSiteId: 'uuid', + updatedAt: 'string', }; -const usage = "\nroute \n\nCommands:\n list List route records\n find-first Find first matching route record\n get Get a route by ID\n create Create a new route\n update Update an existing route\n delete Delete a route\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) => { +const usage = + '\nroute \n\nCommands:\n list List route records\n find-first Find first matching route record\n get Get a route by ID\n create Create a new route\n update Update an existing route\n delete Delete a route\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq targetApiId: true, targetFunctionId: true, targetSiteId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: RouteSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RouteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.route.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter targetApiId: true, targetFunctionId: true, targetSiteId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RouteSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RouteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.route.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.route.findOne({ - id: answers.id as string, - select: { - config: true, - createdAt: true, - databaseId: true, - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetApiId: true, - targetFunctionId: true, - targetSiteId: true, - updatedAt: true - } - }).execute(); + const result = await client.route + .findOne({ + id: answers.id as string, + select: { + config: true, + createdAt: true, + databaseId: true, + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetApiId: true, + targetFunctionId: true, + targetSiteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,100 +186,113 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "domainId", - message: "domainId", - required: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: false, - skipPrompt: true - }, { - type: "text", - name: "path", - message: "path", - required: false, - skipPrompt: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetApiId", - message: "targetApiId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetFunctionId", - message: "targetFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetSiteId", - message: "targetSiteId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetApiId', + message: 'targetApiId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetFunctionId', + message: 'targetFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetSiteId', + message: 'targetSiteId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRouteInput["route"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateRouteInput['route']; const client = getClient(); - const result = await client.route.create({ - data: { - config: cleanedData.config, - databaseId: cleanedData.databaseId, - domainId: cleanedData.domainId, - isActive: cleanedData.isActive, - method: cleanedData.method, - path: cleanedData.path, - priority: cleanedData.priority, - targetApiId: cleanedData.targetApiId, - targetFunctionId: cleanedData.targetFunctionId, - targetSiteId: cleanedData.targetSiteId - }, - select: { - config: true, - createdAt: true, - databaseId: true, - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetApiId: true, - targetFunctionId: true, - targetSiteId: true, - updatedAt: true - } - }).execute(); + const result = await client.route + .create({ + data: { + config: cleanedData.config, + databaseId: cleanedData.databaseId, + domainId: cleanedData.domainId, + isActive: cleanedData.isActive, + method: cleanedData.method, + path: cleanedData.path, + priority: cleanedData.priority, + targetApiId: cleanedData.targetApiId, + targetFunctionId: cleanedData.targetFunctionId, + targetSiteId: cleanedData.targetSiteId, + }, + select: { + config: true, + createdAt: true, + databaseId: true, + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetApiId: true, + targetFunctionId: true, + targetSiteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -266,108 +301,122 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "domainId", - message: "domainId", - required: false - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "text", - name: "method", - message: "method", - required: false, - skipPrompt: true - }, { - type: "text", - name: "path", - message: "path", - required: false, - skipPrompt: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetApiId", - message: "targetApiId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetFunctionId", - message: "targetFunctionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetSiteId", - message: "targetSiteId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'domainId', + message: 'domainId', + required: false, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'method', + message: 'method', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetApiId', + message: 'targetApiId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetFunctionId', + message: 'targetFunctionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetSiteId', + message: 'targetSiteId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RoutePatch; const client = getClient(); - const result = await client.route.update({ - where: { - id: answers.id as string - }, - data: { - config: cleanedData.config, - databaseId: cleanedData.databaseId, - domainId: cleanedData.domainId, - isActive: cleanedData.isActive, - method: cleanedData.method, - path: cleanedData.path, - priority: cleanedData.priority, - targetApiId: cleanedData.targetApiId, - targetFunctionId: cleanedData.targetFunctionId, - targetSiteId: cleanedData.targetSiteId - }, - select: { - config: true, - createdAt: true, - databaseId: true, - domainId: true, - id: true, - isActive: true, - method: true, - path: true, - priority: true, - targetApiId: true, - targetFunctionId: true, - targetSiteId: true, - updatedAt: true - } - }).execute(); + const result = await client.route + .update({ + where: { + id: answers.id as string, + }, + data: { + config: cleanedData.config, + databaseId: cleanedData.databaseId, + domainId: cleanedData.domainId, + isActive: cleanedData.isActive, + method: cleanedData.method, + path: cleanedData.path, + priority: cleanedData.priority, + targetApiId: cleanedData.targetApiId, + targetFunctionId: cleanedData.targetFunctionId, + targetSiteId: cleanedData.targetSiteId, + }, + select: { + config: true, + createdAt: true, + databaseId: true, + domainId: true, + id: true, + isActive: true, + method: true, + path: true, + priority: true, + targetApiId: true, + targetFunctionId: true, + targetSiteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -376,28 +425,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.route.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.route + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/schema-grant.ts b/sdk/constructive-cli/src/api/cli/commands/schema-grant.ts index afa6e2de93..0af570f518 100644 --- a/sdk/constructive-cli/src/api/cli/commands/schema-grant.ts +++ b/sdk/constructive-cli/src/api/cli/commands/schema-grant.ts @@ -3,54 +3,68 @@ * @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 { CreateSchemaGrantInput, SchemaGrantPatch, SchemaGrantSelect, SchemaGrantFilter, SchemaGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSchemaGrantInput, + SchemaGrantPatch, + SchemaGrantSelect, + SchemaGrantFilter, + SchemaGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - granteeName: "string", - id: "uuid", - schemaId: "uuid", - updatedAt: "string" + createdAt: 'string', + databaseId: 'uuid', + granteeName: 'string', + id: 'uuid', + schemaId: 'uuid', + updatedAt: 'string', }; -const usage = "\nschema-grant \n\nCommands:\n list List schemaGrant records\n find-first Find first matching schemaGrant record\n get Get a schemaGrant by ID\n create Create a new schemaGrant\n update Update an existing schemaGrant\n delete Delete a schemaGrant\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) => { +const usage = + '\nschema-grant \n\nCommands:\n list List schemaGrant records\n find-first Find first matching schemaGrant record\n get Get a schemaGrant by ID\n create Create a new schemaGrant\n update Update an existing schemaGrant\n delete Delete a schemaGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq granteeName: true, id: true, schemaId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: SchemaGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SchemaGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.schemaGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter granteeName: true, id: true, schemaId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SchemaGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SchemaGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.schemaGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.schemaGrant.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - granteeName: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.schemaGrant + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + granteeName: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,44 +158,53 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSchemaGrantInput["schemaGrant"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateSchemaGrantInput['schemaGrant']; const client = getClient(); - const result = await client.schemaGrant.create({ - data: { - databaseId: cleanedData.databaseId, - granteeName: cleanedData.granteeName, - schemaId: cleanedData.schemaId - }, - select: { - createdAt: true, - databaseId: true, - granteeName: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.schemaGrant + .create({ + data: { + databaseId: cleanedData.databaseId, + granteeName: cleanedData.granteeName, + schemaId: cleanedData.schemaId, + }, + select: { + createdAt: true, + databaseId: true, + granteeName: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -182,52 +213,59 @@ async function handleCreate(argv: Partial>, prompter: In } 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, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SchemaGrantPatch; const client = getClient(); - const result = await client.schemaGrant.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - granteeName: cleanedData.granteeName, - schemaId: cleanedData.schemaId - }, - select: { - createdAt: true, - databaseId: true, - granteeName: true, - id: true, - schemaId: true, - updatedAt: true - } - }).execute(); + const result = await client.schemaGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + granteeName: cleanedData.granteeName, + schemaId: cleanedData.schemaId, + }, + select: { + createdAt: true, + databaseId: true, + granteeName: true, + id: true, + schemaId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -236,28 +274,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.schemaGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.schemaGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/schema.ts b/sdk/constructive-cli/src/api/cli/commands/schema.ts index 7e3c3b5ff3..8aead31ba7 100644 --- a/sdk/constructive-cli/src/api/cli/commands/schema.ts +++ b/sdk/constructive-cli/src/api/cli/commands/schema.ts @@ -3,61 +3,75 @@ * @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 { CreateSchemaInput, SchemaPatch, SchemaSelect, SchemaFilter, SchemaOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSchemaInput, + SchemaPatch, + SchemaSelect, + SchemaFilter, + SchemaOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiExposure: "string", - category: "string", - createdAt: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - isPublic: "boolean", - label: "string", - name: "string", - schemaName: "string", - smartTags: "json", - tags: "string", - updatedAt: "string" + apiExposure: 'string', + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + isPublic: 'boolean', + label: 'string', + name: 'string', + schemaName: 'string', + smartTags: 'json', + tags: 'string', + updatedAt: 'string', }; -const usage = "\nschema \n\nCommands:\n list List schema records\n find-first Find first matching schema record\n get Get a schema by ID\n create Create a new schema\n update Update an existing schema\n delete Delete a schema\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) => { +const usage = + '\nschema \n\nCommands:\n list List schema records\n find-first Find first matching schema record\n get Get a schema by ID\n create Create a new schema\n update Update an existing schema\n delete Delete a schema\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaName: true, smartTags: true, tags: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: SchemaSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SchemaSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.schema.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaName: true, smartTags: true, tags: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SchemaSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SchemaSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.schema.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.schema.findOne({ - id: answers.id as string, - select: { - apiExposure: true, - category: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isPublic: true, - label: true, - name: true, - schemaName: true, - smartTags: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.schema + .findOne({ + id: answers.id as string, + select: { + apiExposure: true, + category: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isPublic: true, + label: true, + name: true, + schemaName: true, + smartTags: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,99 +186,112 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiExposure", - message: "apiExposure", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublic", - message: "isPublic", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "schemaName", - message: "schemaName", - required: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiExposure', + message: 'apiExposure', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublic', + message: 'isPublic', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'schemaName', + message: 'schemaName', + required: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSchemaInput["schema"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateSchemaInput['schema']; const client = getClient(); - const result = await client.schema.create({ - data: { - apiExposure: cleanedData.apiExposure, - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isPublic: cleanedData.isPublic, - label: cleanedData.label, - name: cleanedData.name, - schemaName: cleanedData.schemaName, - smartTags: cleanedData.smartTags, - tags: cleanedData.tags - }, - select: { - apiExposure: true, - category: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isPublic: true, - label: true, - name: true, - schemaName: true, - smartTags: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.schema + .create({ + data: { + apiExposure: cleanedData.apiExposure, + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isPublic: cleanedData.isPublic, + label: cleanedData.label, + name: cleanedData.name, + schemaName: cleanedData.schemaName, + smartTags: cleanedData.smartTags, + tags: cleanedData.tags, + }, + select: { + apiExposure: true, + category: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isPublic: true, + label: true, + name: true, + schemaName: true, + smartTags: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -265,107 +300,121 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiExposure", - message: "apiExposure", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublic", - message: "isPublic", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "schemaName", - message: "schemaName", - required: false - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiExposure', + message: 'apiExposure', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublic', + message: 'isPublic', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'schemaName', + message: 'schemaName', + required: false, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SchemaPatch; const client = getClient(); - const result = await client.schema.update({ - where: { - id: answers.id as string - }, - data: { - apiExposure: cleanedData.apiExposure, - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isPublic: cleanedData.isPublic, - label: cleanedData.label, - name: cleanedData.name, - schemaName: cleanedData.schemaName, - smartTags: cleanedData.smartTags, - tags: cleanedData.tags - }, - select: { - apiExposure: true, - category: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isPublic: true, - label: true, - name: true, - schemaName: true, - smartTags: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.schema + .update({ + where: { + id: answers.id as string, + }, + data: { + apiExposure: cleanedData.apiExposure, + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isPublic: cleanedData.isPublic, + label: cleanedData.label, + name: cleanedData.name, + schemaName: cleanedData.schemaName, + smartTags: cleanedData.smartTags, + tags: cleanedData.tags, + }, + select: { + apiExposure: true, + category: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isPublic: true, + label: true, + name: true, + schemaName: true, + smartTags: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -374,28 +423,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.schema.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.schema + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/set-field-order.ts b/sdk/constructive-cli/src/api/cli/commands/set-field-order.ts index be5ee7e678..4e3b518b4b 100644 --- a/sdk/constructive-cli/src/api/cli/commands/set-field-order.ts +++ b/sdk/constructive-cli/src/api/cli/commands/set-field-order.ts @@ -3,37 +3,49 @@ * @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 { SetFieldOrderVariables } from "../../orm/mutation"; -import type { SetFieldOrderPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SetFieldOrderVariables } from '../../orm/mutation'; +import type { SetFieldOrderPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("set-field-order - setFieldOrder\n\nUsage: set-field-order [OPTIONS]\n"); + console.log('set-field-order - setFieldOrder\n\nUsage: set-field-order [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 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.setFieldOrder(parsedAnswers as unknown as SetFieldOrderVariables, { - select: selectFields - } as unknown as { - select: SetFieldOrderPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .setFieldOrder( + parsedAnswers as unknown as SetFieldOrderVariables, + { + select: selectFields, + } as unknown as { + select: SetFieldOrderPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: setFieldOrder"); + console.error('Failed: setFieldOrder'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/cli/commands/site-metadatum.ts b/sdk/constructive-cli/src/api/cli/commands/site-metadatum.ts index a0bc0a02f5..181bdb6781 100644 --- a/sdk/constructive-cli/src/api/cli/commands/site-metadatum.ts +++ b/sdk/constructive-cli/src/api/cli/commands/site-metadatum.ts @@ -3,56 +3,70 @@ * @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 { CreateSiteMetadatumInput, SiteMetadatumPatch, SiteMetadatumSelect, SiteMetadatumFilter, SiteMetadatumOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSiteMetadatumInput, + SiteMetadatumPatch, + SiteMetadatumSelect, + SiteMetadatumFilter, + SiteMetadatumOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - ogImage: "string", - siteId: "uuid", - title: "string", - updatedAt: "string" + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + ogImage: 'string', + siteId: 'uuid', + title: 'string', + updatedAt: 'string', }; -const usage = "\nsite-metadatum \n\nCommands:\n list List siteMetadatum records\n find-first Find first matching siteMetadatum record\n get Get a siteMetadatum by ID\n create Create a new siteMetadatum\n update Update an existing siteMetadatum\n delete Delete a siteMetadatum\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) => { +const usage = + '\nsite-metadatum \n\nCommands:\n list List siteMetadatum records\n find-first Find first matching siteMetadatum record\n get Get a siteMetadatum by ID\n create Create a new siteMetadatum\n update Update an existing siteMetadatum\n delete Delete a siteMetadatum\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq ogImage: true, siteId: true, title: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: SiteMetadatumSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SiteMetadatumSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.siteMetadatum.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter ogImage: true, siteId: true, title: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SiteMetadatumSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SiteMetadatumSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.siteMetadatum.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.siteMetadatum.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - description: true, - id: true, - ogImage: true, - siteId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.siteMetadatum + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + description: true, + id: true, + ogImage: true, + siteId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,60 +166,71 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ogImage", - message: "ogImage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteId", - message: "siteId", - required: true - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ogImage', + message: 'ogImage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSiteMetadatumInput["siteMetadatum"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateSiteMetadatumInput['siteMetadatum']; const client = getClient(); - const result = await client.siteMetadatum.create({ - data: { - databaseId: cleanedData.databaseId, - description: cleanedData.description, - ogImage: cleanedData.ogImage, - siteId: cleanedData.siteId, - title: cleanedData.title - }, - select: { - createdAt: true, - databaseId: true, - description: true, - id: true, - ogImage: true, - siteId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.siteMetadatum + .create({ + data: { + databaseId: cleanedData.databaseId, + description: cleanedData.description, + ogImage: cleanedData.ogImage, + siteId: cleanedData.siteId, + title: cleanedData.title, + }, + select: { + createdAt: true, + databaseId: true, + description: true, + id: true, + ogImage: true, + siteId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -206,68 +239,77 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ogImage", - message: "ogImage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteId", - message: "siteId", - required: false - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + 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: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ogImage', + message: 'ogImage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: false, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SiteMetadatumPatch; const client = getClient(); - const result = await client.siteMetadatum.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - description: cleanedData.description, - ogImage: cleanedData.ogImage, - siteId: cleanedData.siteId, - title: cleanedData.title - }, - select: { - createdAt: true, - databaseId: true, - description: true, - id: true, - ogImage: true, - siteId: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.siteMetadatum + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + description: cleanedData.description, + ogImage: cleanedData.ogImage, + siteId: cleanedData.siteId, + title: cleanedData.title, + }, + select: { + createdAt: true, + databaseId: true, + description: true, + id: true, + ogImage: true, + siteId: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -276,28 +318,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.siteMetadatum.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.siteMetadatum + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/site-module.ts b/sdk/constructive-cli/src/api/cli/commands/site-module.ts index ee00a45e09..1cc1d5213a 100644 --- a/sdk/constructive-cli/src/api/cli/commands/site-module.ts +++ b/sdk/constructive-cli/src/api/cli/commands/site-module.ts @@ -3,55 +3,69 @@ * @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 { CreateSiteModuleInput, SiteModulePatch, SiteModuleSelect, SiteModuleFilter, SiteModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSiteModuleInput, + SiteModulePatch, + SiteModuleSelect, + SiteModuleFilter, + SiteModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - databaseId: "uuid", - id: "uuid", - name: "string", - siteId: "uuid", - updatedAt: "string" + createdAt: 'string', + data: 'json', + databaseId: 'uuid', + id: 'uuid', + name: 'string', + siteId: 'uuid', + updatedAt: 'string', }; -const usage = "\nsite-module \n\nCommands:\n list List siteModule records\n find-first Find first matching siteModule record\n get Get a siteModule by ID\n create Create a new siteModule\n update Update an existing siteModule\n delete Delete a siteModule\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) => { +const usage = + '\nsite-module \n\nCommands:\n list List siteModule records\n find-first Find first matching siteModule record\n get Get a siteModule by ID\n create Create a new siteModule\n update Update an existing siteModule\n delete Delete a siteModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, name: true, siteId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: SiteModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SiteModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.siteModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, name: true, siteId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SiteModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SiteModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.siteModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.siteModule.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - name: true, - siteId: true, - updatedAt: true - } - }).execute(); + const result = await client.siteModule + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + name: true, + siteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,50 +162,57 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "siteId", - message: "siteId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSiteModuleInput["siteModule"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateSiteModuleInput['siteModule']; const client = getClient(); - const result = await client.siteModule.create({ - data: { - data: cleanedData.data, - databaseId: cleanedData.databaseId, - name: cleanedData.name, - siteId: cleanedData.siteId - }, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - name: true, - siteId: true, - updatedAt: true - } - }).execute(); + const result = await client.siteModule + .create({ + data: { + data: cleanedData.data, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + siteId: cleanedData.siteId, + }, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + name: true, + siteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -192,58 +221,66 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "siteId", - message: "siteId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SiteModulePatch; const client = getClient(); - const result = await client.siteModule.update({ - where: { - id: answers.id as string - }, - data: { - data: cleanedData.data, - databaseId: cleanedData.databaseId, - name: cleanedData.name, - siteId: cleanedData.siteId - }, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - name: true, - siteId: true, - updatedAt: true - } - }).execute(); + const result = await client.siteModule + .update({ + where: { + id: answers.id as string, + }, + data: { + data: cleanedData.data, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + siteId: cleanedData.siteId, + }, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + name: true, + siteId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -252,28 +289,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.siteModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.siteModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/site-theme.ts b/sdk/constructive-cli/src/api/cli/commands/site-theme.ts index 650bef26fe..0945577efb 100644 --- a/sdk/constructive-cli/src/api/cli/commands/site-theme.ts +++ b/sdk/constructive-cli/src/api/cli/commands/site-theme.ts @@ -3,54 +3,68 @@ * @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 { CreateSiteThemeInput, SiteThemePatch, SiteThemeSelect, SiteThemeFilter, SiteThemeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSiteThemeInput, + SiteThemePatch, + SiteThemeSelect, + SiteThemeFilter, + SiteThemeOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - id: "uuid", - siteId: "uuid", - theme: "json", - updatedAt: "string" + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + siteId: 'uuid', + theme: 'json', + updatedAt: 'string', }; -const usage = "\nsite-theme \n\nCommands:\n list List siteTheme records\n find-first Find first matching siteTheme record\n get Get a siteTheme by ID\n create Create a new siteTheme\n update Update an existing siteTheme\n delete Delete a siteTheme\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) => { +const usage = + '\nsite-theme \n\nCommands:\n list List siteTheme records\n find-first Find first matching siteTheme record\n get Get a siteTheme by ID\n create Create a new siteTheme\n update Update an existing siteTheme\n delete Delete a siteTheme\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, siteId: true, theme: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: SiteThemeSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SiteThemeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.siteTheme.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, siteId: true, theme: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SiteThemeSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SiteThemeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.siteTheme.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.siteTheme.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - id: true, - siteId: true, - theme: true, - updatedAt: true - } - }).execute(); + const result = await client.siteTheme + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + id: true, + siteId: true, + theme: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,43 +158,49 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "siteId", - message: "siteId", - required: true - }, { - type: "json", - name: "theme", - message: "theme", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'siteId', + message: 'siteId', + required: true, + }, + { + type: 'json', + name: 'theme', + message: 'theme', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSiteThemeInput["siteTheme"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateSiteThemeInput['siteTheme']; const client = getClient(); - const result = await client.siteTheme.create({ - data: { - databaseId: cleanedData.databaseId, - siteId: cleanedData.siteId, - theme: cleanedData.theme - }, - select: { - createdAt: true, - databaseId: true, - id: true, - siteId: true, - theme: true, - updatedAt: true - } - }).execute(); + const result = await client.siteTheme + .create({ + data: { + databaseId: cleanedData.databaseId, + siteId: cleanedData.siteId, + theme: cleanedData.theme, + }, + select: { + createdAt: true, + databaseId: true, + id: true, + siteId: true, + theme: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -181,51 +209,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "siteId", - message: "siteId", - required: false - }, { - type: "json", - name: "theme", - message: "theme", - required: false - }]); + 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: 'siteId', + message: 'siteId', + required: false, + }, + { + type: 'json', + name: 'theme', + message: 'theme', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SiteThemePatch; const client = getClient(); - const result = await client.siteTheme.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - siteId: cleanedData.siteId, - theme: cleanedData.theme - }, - select: { - createdAt: true, - databaseId: true, - id: true, - siteId: true, - theme: true, - updatedAt: true - } - }).execute(); + const result = await client.siteTheme + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + siteId: cleanedData.siteId, + theme: cleanedData.theme, + }, + select: { + createdAt: true, + databaseId: true, + id: true, + siteId: true, + theme: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -234,28 +269,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.siteTheme.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.siteTheme + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/site.ts b/sdk/constructive-cli/src/api/cli/commands/site.ts index 7a7b7557f8..b3bf46ce4f 100644 --- a/sdk/constructive-cli/src/api/cli/commands/site.ts +++ b/sdk/constructive-cli/src/api/cli/commands/site.ts @@ -3,57 +3,71 @@ * @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 { CreateSiteInput, SitePatch, SiteSelect, SiteFilter, SiteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSiteInput, + SitePatch, + SiteSelect, + SiteFilter, + SiteOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - config: "json", - createdAt: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - isPublished: "boolean", - name: "string", - title: "string", - updatedAt: "string" + config: 'json', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + isPublished: 'boolean', + name: 'string', + title: 'string', + updatedAt: 'string', }; -const usage = "\nsite \n\nCommands:\n list List site records\n find-first Find first matching site record\n get Get a site by ID\n create Create a new site\n update Update an existing site\n delete Delete a site\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) => { +const usage = + '\nsite \n\nCommands:\n list List site records\n find-first Find first matching site record\n get Get a site by ID\n create Create a new site\n update Update an existing site\n delete Delete a site\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq isPublished: true, name: true, title: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: SiteSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SiteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.site.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter isPublished: true, name: true, title: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SiteSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SiteSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.site.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.site.findOne({ - id: answers.id as string, - select: { - config: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isPublished: true, - name: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.site + .findOne({ + id: answers.id as string, + select: { + config: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isPublished: true, + name: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,68 +170,77 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSiteInput["site"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateSiteInput['site']; const client = getClient(); - const result = await client.site.create({ - data: { - config: cleanedData.config, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isPublished: cleanedData.isPublished, - name: cleanedData.name, - title: cleanedData.title - }, - select: { - config: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isPublished: true, - name: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.site + .create({ + data: { + config: cleanedData.config, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isPublished: cleanedData.isPublished, + name: cleanedData.name, + title: cleanedData.title, + }, + select: { + config: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isPublished: true, + name: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -218,76 +249,86 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "title", - message: "title", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'title', + message: 'title', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SitePatch; const client = getClient(); - const result = await client.site.update({ - where: { - id: answers.id as string - }, - data: { - config: cleanedData.config, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isPublished: cleanedData.isPublished, - name: cleanedData.name, - title: cleanedData.title - }, - select: { - config: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isPublished: true, - name: true, - title: true, - updatedAt: true - } - }).execute(); + const result = await client.site + .update({ + where: { + id: answers.id as string, + }, + data: { + config: cleanedData.config, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isPublished: cleanedData.isPublished, + name: cleanedData.name, + title: cleanedData.title, + }, + select: { + config: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isPublished: true, + name: true, + title: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -296,28 +337,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.site.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.site + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/spatial-relation.ts b/sdk/constructive-cli/src/api/cli/commands/spatial-relation.ts index 7dd002ea53..f61ab27c40 100644 --- a/sdk/constructive-cli/src/api/cli/commands/spatial-relation.ts +++ b/sdk/constructive-cli/src/api/cli/commands/spatial-relation.ts @@ -3,61 +3,75 @@ * @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 { CreateSpatialRelationInput, SpatialRelationPatch, SpatialRelationSelect, SpatialRelationFilter, SpatialRelationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSpatialRelationInput, + SpatialRelationPatch, + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - createdAt: "string", - databaseId: "uuid", - fieldId: "uuid", - id: "uuid", - name: "string", - operator: "string", - paramName: "string", - refFieldId: "uuid", - refTableId: "uuid", - tableId: "uuid", - tags: "string", - updatedAt: "string" + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + fieldId: 'uuid', + id: 'uuid', + name: 'string', + operator: 'string', + paramName: 'string', + refFieldId: 'uuid', + refTableId: 'uuid', + tableId: 'uuid', + tags: 'string', + updatedAt: 'string', }; -const usage = "\nspatial-relation \n\nCommands:\n list List spatialRelation records\n find-first Find first matching spatialRelation record\n get Get a spatialRelation by ID\n create Create a new spatialRelation\n update Update an existing spatialRelation\n delete Delete a spatialRelation\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) => { +const usage = + '\nspatial-relation \n\nCommands:\n list List spatialRelation records\n find-first Find first matching spatialRelation record\n get Get a spatialRelation by ID\n create Create a new spatialRelation\n update Update an existing spatialRelation\n delete Delete a spatialRelation\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq refTableId: true, tableId: true, tags: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: SpatialRelationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SpatialRelationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.spatialRelation.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter refTableId: true, tableId: true, tags: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SpatialRelationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SpatialRelationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.spatialRelation.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.spatialRelation.findOne({ - id: answers.id as string, - select: { - category: true, - createdAt: true, - databaseId: true, - fieldId: true, - id: true, - name: true, - operator: true, - paramName: true, - refFieldId: true, - refTableId: true, - tableId: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.spatialRelation + .findOne({ + id: answers.id as string, + select: { + category: true, + createdAt: true, + databaseId: true, + fieldId: true, + id: true, + name: true, + operator: true, + paramName: true, + refFieldId: true, + refTableId: true, + tableId: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,96 +186,112 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldId", - message: "fieldId", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "operator", - message: "operator", - required: true - }, { - type: "text", - name: "paramName", - message: "paramName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refFieldId", - message: "refFieldId", - required: true - }, { - type: "text", - name: "refTableId", - message: "refTableId", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldId', + message: 'fieldId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'operator', + message: 'operator', + required: true, + }, + { + type: 'text', + name: 'paramName', + message: 'paramName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refFieldId', + message: 'refFieldId', + required: true, + }, + { + type: 'text', + name: 'refTableId', + message: 'refTableId', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSpatialRelationInput["spatialRelation"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateSpatialRelationInput['spatialRelation']; const client = getClient(); - const result = await client.spatialRelation.create({ - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - fieldId: cleanedData.fieldId, - name: cleanedData.name, - operator: cleanedData.operator, - paramName: cleanedData.paramName, - refFieldId: cleanedData.refFieldId, - refTableId: cleanedData.refTableId, - tableId: cleanedData.tableId, - tags: cleanedData.tags - }, - select: { - category: true, - createdAt: true, - databaseId: true, - fieldId: true, - id: true, - name: true, - operator: true, - paramName: true, - refFieldId: true, - refTableId: true, - tableId: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.spatialRelation + .create({ + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + fieldId: cleanedData.fieldId, + name: cleanedData.name, + operator: cleanedData.operator, + paramName: cleanedData.paramName, + refFieldId: cleanedData.refFieldId, + refTableId: cleanedData.refTableId, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + fieldId: true, + id: true, + name: true, + operator: true, + paramName: true, + refFieldId: true, + refTableId: true, + tableId: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -262,104 +300,118 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldId", - message: "fieldId", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "operator", - message: "operator", - required: false - }, { - type: "text", - name: "paramName", - message: "paramName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refFieldId", - message: "refFieldId", - required: false - }, { - type: "text", - name: "refTableId", - message: "refTableId", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldId', + message: 'fieldId', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'operator', + message: 'operator', + required: false, + }, + { + type: 'text', + name: 'paramName', + message: 'paramName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refFieldId', + message: 'refFieldId', + required: false, + }, + { + type: 'text', + name: 'refTableId', + message: 'refTableId', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SpatialRelationPatch; const client = getClient(); - const result = await client.spatialRelation.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - fieldId: cleanedData.fieldId, - name: cleanedData.name, - operator: cleanedData.operator, - paramName: cleanedData.paramName, - refFieldId: cleanedData.refFieldId, - refTableId: cleanedData.refTableId, - tableId: cleanedData.tableId, - tags: cleanedData.tags - }, - select: { - category: true, - createdAt: true, - databaseId: true, - fieldId: true, - id: true, - name: true, - operator: true, - paramName: true, - refFieldId: true, - refTableId: true, - tableId: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.spatialRelation + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + fieldId: cleanedData.fieldId, + name: cleanedData.name, + operator: cleanedData.operator, + paramName: cleanedData.paramName, + refFieldId: cleanedData.refFieldId, + refTableId: cleanedData.refTableId, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + fieldId: true, + id: true, + name: true, + operator: true, + paramName: true, + refFieldId: true, + refTableId: true, + tableId: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -368,28 +420,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.spatialRelation.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.spatialRelation + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/sql-action.ts b/sdk/constructive-cli/src/api/cli/commands/sql-action.ts index d81803ec27..7bffadff1d 100644 --- a/sdk/constructive-cli/src/api/cli/commands/sql-action.ts +++ b/sdk/constructive-cli/src/api/cli/commands/sql-action.ts @@ -3,55 +3,69 @@ * @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 { CreateSqlActionInput, SqlActionPatch, SqlActionSelect, SqlActionFilter, SqlActionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSqlActionInput, + SqlActionPatch, + SqlActionSelect, + SqlActionFilter, + SqlActionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actionId: "uuid", - actionName: "string", - actorId: "uuid", - content: "string", - createdAt: "string", - databaseId: "uuid", - deploy: "string", - deps: "string", - id: "int", - name: "string", - payload: "json", - revert: "string", - verify: "string" + actionId: 'uuid', + actionName: 'string', + actorId: 'uuid', + content: 'string', + createdAt: 'string', + databaseId: 'uuid', + deploy: 'string', + deps: 'string', + id: 'int', + name: 'string', + payload: 'json', + revert: 'string', + verify: 'string', }; -const usage = "\nsql-action \n\nCommands:\n list List sqlAction records\n find-first Find first matching sqlAction record\n create Create a new sqlAction\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) => { +const usage = + '\nsql-action \n\nCommands:\n list List sqlAction records\n find-first Find first matching sqlAction record\n create Create a new sqlAction\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, payload: true, revert: true, - verify: true + verify: true, }; - const findManyArgs = parseFindManyArgs & { - select: SqlActionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SqlActionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.sqlAction.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, payload: true, revert: true, - verify: true + verify: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SqlActionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SqlActionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.sqlAction.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,101 +140,115 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actionId", - message: "actionId", - required: true - }, { - type: "text", - name: "actionName", - message: "actionName", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: true - }, { - type: "text", - name: "content", - message: "content", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "deploy", - message: "deploy", - required: true - }, { - type: "text", - name: "deps", - message: "deps", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "json", - name: "payload", - message: "payload", - required: true - }, { - type: "text", - name: "revert", - message: "revert", - required: true - }, { - type: "text", - name: "verify", - message: "verify", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actionId', + message: 'actionId', + required: true, + }, + { + type: 'text', + name: 'actionName', + message: 'actionName', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: true, + }, + { + type: 'text', + name: 'content', + message: 'content', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'deploy', + message: 'deploy', + required: true, + }, + { + type: 'text', + name: 'deps', + message: 'deps', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: true, + }, + { + type: 'text', + name: 'revert', + message: 'revert', + required: true, + }, + { + type: 'text', + name: 'verify', + message: 'verify', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSqlActionInput["sqlAction"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateSqlActionInput['sqlAction']; const client = getClient(); - const result = await client.sqlAction.create({ - data: { - actionId: cleanedData.actionId, - actionName: cleanedData.actionName, - actorId: cleanedData.actorId, - content: cleanedData.content, - databaseId: cleanedData.databaseId, - deploy: cleanedData.deploy, - deps: cleanedData.deps, - name: cleanedData.name, - payload: cleanedData.payload, - revert: cleanedData.revert, - verify: cleanedData.verify - }, - select: { - actionId: true, - actionName: true, - actorId: true, - content: true, - createdAt: true, - databaseId: true, - deploy: true, - deps: true, - id: true, - name: true, - payload: true, - revert: true, - verify: true - } - }).execute(); + const result = await client.sqlAction + .create({ + data: { + actionId: cleanedData.actionId, + actionName: cleanedData.actionName, + actorId: cleanedData.actorId, + content: cleanedData.content, + databaseId: cleanedData.databaseId, + deploy: cleanedData.deploy, + deps: cleanedData.deps, + name: cleanedData.name, + payload: cleanedData.payload, + revert: cleanedData.revert, + verify: cleanedData.verify, + }, + select: { + actionId: true, + actionName: true, + actorId: true, + content: true, + createdAt: true, + databaseId: true, + deploy: true, + deps: true, + id: true, + name: true, + payload: true, + revert: true, + verify: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/table-grant.ts b/sdk/constructive-cli/src/api/cli/commands/table-grant.ts index 81fef529fa..29338e75ca 100644 --- a/sdk/constructive-cli/src/api/cli/commands/table-grant.ts +++ b/sdk/constructive-cli/src/api/cli/commands/table-grant.ts @@ -3,57 +3,71 @@ * @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 { CreateTableGrantInput, TableGrantPatch, TableGrantSelect, TableGrantFilter, TableGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateTableGrantInput, + TableGrantPatch, + TableGrantSelect, + TableGrantFilter, + TableGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - fieldIds: "uuid", - granteeName: "string", - id: "uuid", - isGrant: "boolean", - privilege: "string", - tableId: "uuid", - updatedAt: "string" + createdAt: 'string', + databaseId: 'uuid', + fieldIds: 'uuid', + granteeName: 'string', + id: 'uuid', + isGrant: 'boolean', + privilege: 'string', + tableId: 'uuid', + updatedAt: 'string', }; -const usage = "\ntable-grant \n\nCommands:\n list List tableGrant records\n find-first Find first matching tableGrant record\n get Get a tableGrant by ID\n create Create a new tableGrant\n update Update an existing tableGrant\n delete Delete a tableGrant\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) => { +const usage = + '\ntable-grant \n\nCommands:\n list List tableGrant records\n find-first Find first matching tableGrant record\n get Get a tableGrant by ID\n create Create a new tableGrant\n update Update an existing tableGrant\n delete Delete a tableGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq isGrant: true, privilege: true, tableId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: TableGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: TableGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.tableGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter isGrant: true, privilege: true, tableId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: TableGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: TableGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.tableGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.tableGrant.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - fieldIds: true, - granteeName: true, - id: true, - isGrant: true, - privilege: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.tableGrant + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + fieldIds: true, + granteeName: true, + id: true, + isGrant: true, + privilege: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,67 +170,76 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privilege", - message: "privilege", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privilege', + message: 'privilege', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateTableGrantInput["tableGrant"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateTableGrantInput['tableGrant']; const client = getClient(); - const result = await client.tableGrant.create({ - data: { - databaseId: cleanedData.databaseId, - fieldIds: cleanedData.fieldIds, - granteeName: cleanedData.granteeName, - isGrant: cleanedData.isGrant, - privilege: cleanedData.privilege, - tableId: cleanedData.tableId - }, - select: { - createdAt: true, - databaseId: true, - fieldIds: true, - granteeName: true, - id: true, - isGrant: true, - privilege: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.tableGrant + .create({ + data: { + databaseId: cleanedData.databaseId, + fieldIds: cleanedData.fieldIds, + granteeName: cleanedData.granteeName, + isGrant: cleanedData.isGrant, + privilege: cleanedData.privilege, + tableId: cleanedData.tableId, + }, + select: { + createdAt: true, + databaseId: true, + fieldIds: true, + granteeName: true, + id: true, + isGrant: true, + privilege: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -217,75 +248,85 @@ async function handleCreate(argv: Partial>, prompter: In } 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, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: false - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privilege", - message: "privilege", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: false, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privilege', + message: 'privilege', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as TableGrantPatch; const client = getClient(); - const result = await client.tableGrant.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - fieldIds: cleanedData.fieldIds, - granteeName: cleanedData.granteeName, - isGrant: cleanedData.isGrant, - privilege: cleanedData.privilege, - tableId: cleanedData.tableId - }, - select: { - createdAt: true, - databaseId: true, - fieldIds: true, - granteeName: true, - id: true, - isGrant: true, - privilege: true, - tableId: true, - updatedAt: true - } - }).execute(); + const result = await client.tableGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + fieldIds: cleanedData.fieldIds, + granteeName: cleanedData.granteeName, + isGrant: cleanedData.isGrant, + privilege: cleanedData.privilege, + tableId: cleanedData.tableId, + }, + select: { + createdAt: true, + databaseId: true, + fieldIds: true, + granteeName: true, + id: true, + isGrant: true, + privilege: true, + tableId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -294,28 +335,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.tableGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.tableGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/table.ts b/sdk/constructive-cli/src/api/cli/commands/table.ts index 5f3d96a272..d53af6ce0d 100644 --- a/sdk/constructive-cli/src/api/cli/commands/table.ts +++ b/sdk/constructive-cli/src/api/cli/commands/table.ts @@ -3,70 +3,84 @@ * @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 { CreateTableInput, TablePatch, TableSelect, TableFilter, TableOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateTableInput, + TablePatch, + TableSelect, + TableFilter, + TableOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - createdAt: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - inheritsId: "uuid", - label: "string", - name: "string", - partitionKeyNames: "string", - partitionKeyTypes: "string", - partitionStrategy: "string", - partitioned: "boolean", - peoplestamps: "boolean", - pluralName: "string", - schemaId: "uuid", - singularName: "string", - smartTags: "json", - stepUp: "json", - tags: "string", - timestamps: "boolean", - updatedAt: "string", - useRls: "boolean" + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + inheritsId: 'uuid', + label: 'string', + name: 'string', + partitionKeyNames: 'string', + partitionKeyTypes: 'string', + partitionStrategy: 'string', + partitioned: 'boolean', + peoplestamps: 'boolean', + pluralName: 'string', + schemaId: 'uuid', + singularName: 'string', + smartTags: 'json', + stepUp: 'json', + tags: 'string', + timestamps: 'boolean', + updatedAt: 'string', + useRls: 'boolean', }; -const usage = "\ntable \n\nCommands:\n list List table records\n find-first Find first matching table record\n get Get a table by ID\n create Create a new table\n update Update an existing table\n delete Delete a table\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) => { +const usage = + '\ntable \n\nCommands:\n list List table records\n find-first Find first matching table record\n get Get a table by ID\n create Create a new table\n update Update an existing table\n delete Delete a table\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -97,16 +111,18 @@ async function handleList(argv: Partial>, _prompter: Inq tags: true, timestamps: true, updatedAt: true, - useRls: true + useRls: true, }; - const findManyArgs = parseFindManyArgs & { - select: TableSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: TableSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.table.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -137,16 +153,18 @@ async function handleFindFirst(argv: Partial>, _prompter tags: true, timestamps: true, updatedAt: true, - useRls: true + useRls: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: TableSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: TableSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.table.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -155,43 +173,47 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.table.findOne({ - id: answers.id as string, - select: { - category: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - inheritsId: true, - label: true, - name: true, - partitionKeyNames: true, - partitionKeyTypes: true, - partitionStrategy: true, - partitioned: true, - peoplestamps: true, - pluralName: true, - schemaId: true, - singularName: true, - smartTags: true, - stepUp: true, - tags: true, - timestamps: true, - updatedAt: true, - useRls: true - } - }).execute(); + const result = await client.table + .findOne({ + id: answers.id as string, + select: { + category: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + inheritsId: true, + label: true, + name: true, + partitionKeyNames: true, + partitionKeyTypes: true, + partitionStrategy: true, + partitioned: true, + peoplestamps: true, + pluralName: true, + schemaId: true, + singularName: true, + smartTags: true, + stepUp: true, + tags: true, + timestamps: true, + updatedAt: true, + useRls: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -200,172 +222,194 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inheritsId", - message: "inheritsId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "partitionKeyNames", - message: "partitionKeyNames", - required: false, - skipPrompt: true - }, { - type: "text", - name: "partitionKeyTypes", - message: "partitionKeyTypes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "partitionStrategy", - message: "partitionStrategy", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "partitioned", - message: "partitioned", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "peoplestamps", - message: "peoplestamps", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pluralName", - message: "pluralName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }, { - type: "text", - name: "singularName", - message: "singularName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "json", - name: "stepUp", - message: "stepUp", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "timestamps", - message: "timestamps", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "useRls", - message: "useRls", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inheritsId', + message: 'inheritsId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'partitionKeyNames', + message: 'partitionKeyNames', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'partitionKeyTypes', + message: 'partitionKeyTypes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'partitionStrategy', + message: 'partitionStrategy', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'partitioned', + message: 'partitioned', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'peoplestamps', + message: 'peoplestamps', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pluralName', + message: 'pluralName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + { + type: 'text', + name: 'singularName', + message: 'singularName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'stepUp', + message: 'stepUp', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'timestamps', + message: 'timestamps', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'useRls', + message: 'useRls', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateTableInput["table"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateTableInput['table']; const client = getClient(); - const result = await client.table.create({ - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - inheritsId: cleanedData.inheritsId, - label: cleanedData.label, - name: cleanedData.name, - partitionKeyNames: cleanedData.partitionKeyNames, - partitionKeyTypes: cleanedData.partitionKeyTypes, - partitionStrategy: cleanedData.partitionStrategy, - partitioned: cleanedData.partitioned, - peoplestamps: cleanedData.peoplestamps, - pluralName: cleanedData.pluralName, - schemaId: cleanedData.schemaId, - singularName: cleanedData.singularName, - smartTags: cleanedData.smartTags, - stepUp: cleanedData.stepUp, - tags: cleanedData.tags, - timestamps: cleanedData.timestamps, - useRls: cleanedData.useRls - }, - select: { - category: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - inheritsId: true, - label: true, - name: true, - partitionKeyNames: true, - partitionKeyTypes: true, - partitionStrategy: true, - partitioned: true, - peoplestamps: true, - pluralName: true, - schemaId: true, - singularName: true, - smartTags: true, - stepUp: true, - tags: true, - timestamps: true, - updatedAt: true, - useRls: true - } - }).execute(); + const result = await client.table + .create({ + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + inheritsId: cleanedData.inheritsId, + label: cleanedData.label, + name: cleanedData.name, + partitionKeyNames: cleanedData.partitionKeyNames, + partitionKeyTypes: cleanedData.partitionKeyTypes, + partitionStrategy: cleanedData.partitionStrategy, + partitioned: cleanedData.partitioned, + peoplestamps: cleanedData.peoplestamps, + pluralName: cleanedData.pluralName, + schemaId: cleanedData.schemaId, + singularName: cleanedData.singularName, + smartTags: cleanedData.smartTags, + stepUp: cleanedData.stepUp, + tags: cleanedData.tags, + timestamps: cleanedData.timestamps, + useRls: cleanedData.useRls, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + inheritsId: true, + label: true, + name: true, + partitionKeyNames: true, + partitionKeyTypes: true, + partitionStrategy: true, + partitioned: true, + peoplestamps: true, + pluralName: true, + schemaId: true, + singularName: true, + smartTags: true, + stepUp: true, + tags: true, + timestamps: true, + updatedAt: true, + useRls: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -374,180 +418,203 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inheritsId", - message: "inheritsId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "partitionKeyNames", - message: "partitionKeyNames", - required: false, - skipPrompt: true - }, { - type: "text", - name: "partitionKeyTypes", - message: "partitionKeyTypes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "partitionStrategy", - message: "partitionStrategy", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "partitioned", - message: "partitioned", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "peoplestamps", - message: "peoplestamps", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pluralName", - message: "pluralName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }, { - type: "text", - name: "singularName", - message: "singularName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "json", - name: "stepUp", - message: "stepUp", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "timestamps", - message: "timestamps", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "useRls", - message: "useRls", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inheritsId', + message: 'inheritsId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'partitionKeyNames', + message: 'partitionKeyNames', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'partitionKeyTypes', + message: 'partitionKeyTypes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'partitionStrategy', + message: 'partitionStrategy', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'partitioned', + message: 'partitioned', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'peoplestamps', + message: 'peoplestamps', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pluralName', + message: 'pluralName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + { + type: 'text', + name: 'singularName', + message: 'singularName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'stepUp', + message: 'stepUp', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'timestamps', + message: 'timestamps', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'useRls', + message: 'useRls', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as TablePatch; const client = getClient(); - const result = await client.table.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - inheritsId: cleanedData.inheritsId, - label: cleanedData.label, - name: cleanedData.name, - partitionKeyNames: cleanedData.partitionKeyNames, - partitionKeyTypes: cleanedData.partitionKeyTypes, - partitionStrategy: cleanedData.partitionStrategy, - partitioned: cleanedData.partitioned, - peoplestamps: cleanedData.peoplestamps, - pluralName: cleanedData.pluralName, - schemaId: cleanedData.schemaId, - singularName: cleanedData.singularName, - smartTags: cleanedData.smartTags, - stepUp: cleanedData.stepUp, - tags: cleanedData.tags, - timestamps: cleanedData.timestamps, - useRls: cleanedData.useRls - }, - select: { - category: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - inheritsId: true, - label: true, - name: true, - partitionKeyNames: true, - partitionKeyTypes: true, - partitionStrategy: true, - partitioned: true, - peoplestamps: true, - pluralName: true, - schemaId: true, - singularName: true, - smartTags: true, - stepUp: true, - tags: true, - timestamps: true, - updatedAt: true, - useRls: true - } - }).execute(); + const result = await client.table + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + inheritsId: cleanedData.inheritsId, + label: cleanedData.label, + name: cleanedData.name, + partitionKeyNames: cleanedData.partitionKeyNames, + partitionKeyTypes: cleanedData.partitionKeyTypes, + partitionStrategy: cleanedData.partitionStrategy, + partitioned: cleanedData.partitioned, + peoplestamps: cleanedData.peoplestamps, + pluralName: cleanedData.pluralName, + schemaId: cleanedData.schemaId, + singularName: cleanedData.singularName, + smartTags: cleanedData.smartTags, + stepUp: cleanedData.stepUp, + tags: cleanedData.tags, + timestamps: cleanedData.timestamps, + useRls: cleanedData.useRls, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + inheritsId: true, + label: true, + name: true, + partitionKeyNames: true, + partitionKeyTypes: true, + partitionStrategy: true, + partitioned: true, + peoplestamps: true, + pluralName: true, + schemaId: true, + singularName: true, + smartTags: true, + stepUp: true, + tags: true, + timestamps: true, + updatedAt: true, + useRls: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -556,28 +623,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.table.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.table + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/trigger-function.ts b/sdk/constructive-cli/src/api/cli/commands/trigger-function.ts index 9be7f1b96f..d2b324e437 100644 --- a/sdk/constructive-cli/src/api/cli/commands/trigger-function.ts +++ b/sdk/constructive-cli/src/api/cli/commands/trigger-function.ts @@ -3,54 +3,68 @@ * @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 { CreateTriggerFunctionInput, TriggerFunctionPatch, TriggerFunctionSelect, TriggerFunctionFilter, TriggerFunctionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateTriggerFunctionInput, + TriggerFunctionPatch, + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - code: "string", - createdAt: "string", - databaseId: "uuid", - id: "uuid", - name: "string", - updatedAt: "string" + code: 'string', + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + name: 'string', + updatedAt: 'string', }; -const usage = "\ntrigger-function \n\nCommands:\n list List triggerFunction records\n find-first Find first matching triggerFunction record\n get Get a triggerFunction by ID\n create Create a new triggerFunction\n update Update an existing triggerFunction\n delete Delete a triggerFunction\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) => { +const usage = + '\ntrigger-function \n\nCommands:\n list List triggerFunction records\n find-first Find first matching triggerFunction record\n get Get a triggerFunction by ID\n create Create a new triggerFunction\n update Update an existing triggerFunction\n delete Delete a triggerFunction\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, name: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: TriggerFunctionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: TriggerFunctionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.triggerFunction.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, name: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: TriggerFunctionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: TriggerFunctionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.triggerFunction.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.triggerFunction.findOne({ - id: answers.id as string, - select: { - code: true, - createdAt: true, - databaseId: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.triggerFunction + .findOne({ + id: answers.id as string, + select: { + code: true, + createdAt: true, + databaseId: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,44 +158,53 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "code", - message: "code", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'code', + message: 'code', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateTriggerFunctionInput["triggerFunction"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateTriggerFunctionInput['triggerFunction']; const client = getClient(); - const result = await client.triggerFunction.create({ - data: { - code: cleanedData.code, - databaseId: cleanedData.databaseId, - name: cleanedData.name - }, - select: { - code: true, - createdAt: true, - databaseId: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.triggerFunction + .create({ + data: { + code: cleanedData.code, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + }, + select: { + code: true, + createdAt: true, + databaseId: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -182,52 +213,59 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "code", - message: "code", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'code', + message: 'code', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as TriggerFunctionPatch; const client = getClient(); - const result = await client.triggerFunction.update({ - where: { - id: answers.id as string - }, - data: { - code: cleanedData.code, - databaseId: cleanedData.databaseId, - name: cleanedData.name - }, - select: { - code: true, - createdAt: true, - databaseId: true, - id: true, - name: true, - updatedAt: true - } - }).execute(); + const result = await client.triggerFunction + .update({ + where: { + id: answers.id as string, + }, + data: { + code: cleanedData.code, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + }, + select: { + code: true, + createdAt: true, + databaseId: true, + id: true, + name: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -236,28 +274,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.triggerFunction.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.triggerFunction + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/trigger.ts b/sdk/constructive-cli/src/api/cli/commands/trigger.ts index faf87378a2..c4d55507eb 100644 --- a/sdk/constructive-cli/src/api/cli/commands/trigger.ts +++ b/sdk/constructive-cli/src/api/cli/commands/trigger.ts @@ -3,59 +3,73 @@ * @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 { CreateTriggerInput, TriggerPatch, TriggerSelect, TriggerFilter, TriggerOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateTriggerInput, + TriggerPatch, + TriggerSelect, + TriggerFilter, + TriggerOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - createdAt: "string", - databaseId: "uuid", - event: "string", - functionName: "string", - id: "uuid", - name: "string", - smartTags: "json", - tableId: "uuid", - tags: "string", - updatedAt: "string" + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + event: 'string', + functionName: 'string', + id: 'uuid', + name: 'string', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + updatedAt: 'string', }; -const usage = "\ntrigger \n\nCommands:\n list List trigger records\n find-first Find first matching trigger record\n get Get a trigger by ID\n create Create a new trigger\n update Update an existing trigger\n delete Delete a trigger\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) => { +const usage = + '\ntrigger \n\nCommands:\n list List trigger records\n find-first Find first matching trigger record\n get Get a trigger by ID\n create Create a new trigger\n update Update an existing trigger\n delete Delete a trigger\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq smartTags: true, tableId: true, tags: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: TriggerSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: TriggerSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.trigger.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter smartTags: true, tableId: true, tags: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: TriggerSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: TriggerSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.trigger.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.trigger.findOne({ - id: answers.id as string, - select: { - category: true, - createdAt: true, - databaseId: true, - event: true, - functionName: true, - id: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.trigger + .findOne({ + id: answers.id as string, + select: { + category: true, + createdAt: true, + databaseId: true, + event: true, + functionName: true, + id: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,84 +178,95 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "event", - message: "event", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionName", - message: "functionName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'event', + message: 'event', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionName', + message: 'functionName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateTriggerInput["trigger"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateTriggerInput['trigger']; const client = getClient(); - const result = await client.trigger.create({ - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - event: cleanedData.event, - functionName: cleanedData.functionName, - name: cleanedData.name, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags - }, - select: { - category: true, - createdAt: true, - databaseId: true, - event: true, - functionName: true, - id: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.trigger + .create({ + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + event: cleanedData.event, + functionName: cleanedData.functionName, + name: cleanedData.name, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + event: true, + functionName: true, + id: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,92 +275,104 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "event", - message: "event", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionName", - message: "functionName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'event', + message: 'event', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionName', + message: 'functionName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as TriggerPatch; const client = getClient(); - const result = await client.trigger.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - event: cleanedData.event, - functionName: cleanedData.functionName, - name: cleanedData.name, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags - }, - select: { - category: true, - createdAt: true, - databaseId: true, - event: true, - functionName: true, - id: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - updatedAt: true - } - }).execute(); + const result = await client.trigger + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + event: cleanedData.event, + functionName: cleanedData.functionName, + name: cleanedData.name, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + event: true, + functionName: true, + id: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -336,28 +381,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.trigger.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.trigger + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/unique-constraint.ts b/sdk/constructive-cli/src/api/cli/commands/unique-constraint.ts index cbb1cd50f4..7c45f37692 100644 --- a/sdk/constructive-cli/src/api/cli/commands/unique-constraint.ts +++ b/sdk/constructive-cli/src/api/cli/commands/unique-constraint.ts @@ -3,63 +3,77 @@ * @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 { CreateUniqueConstraintInput, UniqueConstraintPatch, UniqueConstraintSelect, UniqueConstraintFilter, UniqueConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateUniqueConstraintInput, + UniqueConstraintPatch, + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - createdAt: "string", - databaseId: "uuid", - description: "string", - fieldIds: "uuid", - id: "uuid", - initiallyDeferred: "boolean", - isDeferrable: "boolean", - name: "string", - smartTags: "json", - tableId: "uuid", - tags: "string", - type: "string", - updatedAt: "string", - withoutOverlaps: "boolean" + category: 'string', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + fieldIds: 'uuid', + id: 'uuid', + initiallyDeferred: 'boolean', + isDeferrable: 'boolean', + name: 'string', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + type: 'string', + updatedAt: 'string', + withoutOverlaps: 'boolean', }; -const usage = "\nunique-constraint \n\nCommands:\n list List uniqueConstraint records\n find-first Find first matching uniqueConstraint record\n get Get a uniqueConstraint by ID\n create Create a new uniqueConstraint\n update Update an existing uniqueConstraint\n delete Delete a uniqueConstraint\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) => { +const usage = + '\nunique-constraint \n\nCommands:\n list List uniqueConstraint records\n find-first Find first matching uniqueConstraint record\n get Get a uniqueConstraint by ID\n create Create a new uniqueConstraint\n update Update an existing uniqueConstraint\n delete Delete a uniqueConstraint\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -83,16 +97,18 @@ async function handleList(argv: Partial>, _prompter: Inq tags: true, type: true, updatedAt: true, - withoutOverlaps: true + withoutOverlaps: true, }; - const findManyArgs = parseFindManyArgs & { - select: UniqueConstraintSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: UniqueConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.uniqueConstraint.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -116,16 +132,18 @@ async function handleFindFirst(argv: Partial>, _prompter tags: true, type: true, updatedAt: true, - withoutOverlaps: true + withoutOverlaps: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: UniqueConstraintSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: UniqueConstraintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.uniqueConstraint.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -134,36 +152,40 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.uniqueConstraint.findOne({ - id: answers.id as string, - select: { - category: true, - createdAt: true, - databaseId: true, - description: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - withoutOverlaps: true - } - }).execute(); + const result = await client.uniqueConstraint + .findOne({ + id: answers.id as string, + select: { + category: true, + createdAt: true, + databaseId: true, + description: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + withoutOverlaps: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -172,116 +194,134 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: true - }, { - type: "boolean", - name: "initiallyDeferred", - message: "initiallyDeferred", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDeferrable", - message: "isDeferrable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "withoutOverlaps", - message: "withoutOverlaps", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: true, + }, + { + type: 'boolean', + name: 'initiallyDeferred', + message: 'initiallyDeferred', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDeferrable', + message: 'isDeferrable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'withoutOverlaps', + message: 'withoutOverlaps', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateUniqueConstraintInput["uniqueConstraint"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateUniqueConstraintInput['uniqueConstraint']; const client = getClient(); - const result = await client.uniqueConstraint.create({ - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - fieldIds: cleanedData.fieldIds, - initiallyDeferred: cleanedData.initiallyDeferred, - isDeferrable: cleanedData.isDeferrable, - name: cleanedData.name, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type, - withoutOverlaps: cleanedData.withoutOverlaps - }, - select: { - category: true, - createdAt: true, - databaseId: true, - description: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - withoutOverlaps: true - } - }).execute(); + const result = await client.uniqueConstraint + .create({ + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + fieldIds: cleanedData.fieldIds, + initiallyDeferred: cleanedData.initiallyDeferred, + isDeferrable: cleanedData.isDeferrable, + name: cleanedData.name, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + withoutOverlaps: cleanedData.withoutOverlaps, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + description: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + withoutOverlaps: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -290,124 +330,140 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldIds", - message: "fieldIds", - required: false - }, { - type: "boolean", - name: "initiallyDeferred", - message: "initiallyDeferred", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isDeferrable", - message: "isDeferrable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "withoutOverlaps", - message: "withoutOverlaps", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldIds', + message: 'fieldIds', + required: false, + }, + { + type: 'boolean', + name: 'initiallyDeferred', + message: 'initiallyDeferred', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isDeferrable', + message: 'isDeferrable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'withoutOverlaps', + message: 'withoutOverlaps', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as UniqueConstraintPatch; const client = getClient(); - const result = await client.uniqueConstraint.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - fieldIds: cleanedData.fieldIds, - initiallyDeferred: cleanedData.initiallyDeferred, - isDeferrable: cleanedData.isDeferrable, - name: cleanedData.name, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - type: cleanedData.type, - withoutOverlaps: cleanedData.withoutOverlaps - }, - select: { - category: true, - createdAt: true, - databaseId: true, - description: true, - fieldIds: true, - id: true, - initiallyDeferred: true, - isDeferrable: true, - name: true, - smartTags: true, - tableId: true, - tags: true, - type: true, - updatedAt: true, - withoutOverlaps: true - } - }).execute(); + const result = await client.uniqueConstraint + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + fieldIds: cleanedData.fieldIds, + initiallyDeferred: cleanedData.initiallyDeferred, + isDeferrable: cleanedData.isDeferrable, + name: cleanedData.name, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + type: cleanedData.type, + withoutOverlaps: cleanedData.withoutOverlaps, + }, + select: { + category: true, + createdAt: true, + databaseId: true, + description: true, + fieldIds: true, + id: true, + initiallyDeferred: true, + isDeferrable: true, + name: true, + smartTags: true, + tableId: true, + tags: true, + type: true, + updatedAt: true, + withoutOverlaps: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -416,28 +472,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.uniqueConstraint.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.uniqueConstraint + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/view-grant.ts b/sdk/constructive-cli/src/api/cli/commands/view-grant.ts index 04a6ffe885..3eea4f3fb0 100644 --- a/sdk/constructive-cli/src/api/cli/commands/view-grant.ts +++ b/sdk/constructive-cli/src/api/cli/commands/view-grant.ts @@ -3,55 +3,69 @@ * @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 { CreateViewGrantInput, ViewGrantPatch, ViewGrantSelect, ViewGrantFilter, ViewGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateViewGrantInput, + ViewGrantPatch, + ViewGrantSelect, + ViewGrantFilter, + ViewGrantOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - granteeName: "string", - id: "uuid", - isGrant: "boolean", - privilege: "string", - viewId: "uuid", - withGrantOption: "boolean" + databaseId: 'uuid', + granteeName: 'string', + id: 'uuid', + isGrant: 'boolean', + privilege: 'string', + viewId: 'uuid', + withGrantOption: 'boolean', }; -const usage = "\nview-grant \n\nCommands:\n list List viewGrant records\n find-first Find first matching viewGrant record\n get Get a viewGrant by ID\n create Create a new viewGrant\n update Update an existing viewGrant\n delete Delete a viewGrant\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) => { +const usage = + '\nview-grant \n\nCommands:\n list List viewGrant records\n find-first Find first matching viewGrant record\n get Get a viewGrant by ID\n create Create a new viewGrant\n update Update an existing viewGrant\n delete Delete a viewGrant\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq isGrant: true, privilege: true, viewId: true, - withGrantOption: true + withGrantOption: true, }; - const findManyArgs = parseFindManyArgs & { - select: ViewGrantSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ViewGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.viewGrant.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter isGrant: true, privilege: true, viewId: true, - withGrantOption: true + withGrantOption: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ViewGrantSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ViewGrantSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.viewGrant.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.viewGrant.findOne({ - id: answers.id as string, - select: { - databaseId: true, - granteeName: true, - id: true, - isGrant: true, - privilege: true, - viewId: true, - withGrantOption: true - } - }).execute(); + const result = await client.viewGrant + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + granteeName: true, + id: true, + isGrant: true, + privilege: true, + viewId: true, + withGrantOption: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,65 +162,74 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: true - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privilege", - message: "privilege", - required: true - }, { - type: "text", - name: "viewId", - message: "viewId", - required: true - }, { - type: "boolean", - name: "withGrantOption", - message: "withGrantOption", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: true, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privilege', + message: 'privilege', + required: true, + }, + { + type: 'text', + name: 'viewId', + message: 'viewId', + required: true, + }, + { + type: 'boolean', + name: 'withGrantOption', + message: 'withGrantOption', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateViewGrantInput["viewGrant"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateViewGrantInput['viewGrant']; const client = getClient(); - const result = await client.viewGrant.create({ - data: { - databaseId: cleanedData.databaseId, - granteeName: cleanedData.granteeName, - isGrant: cleanedData.isGrant, - privilege: cleanedData.privilege, - viewId: cleanedData.viewId, - withGrantOption: cleanedData.withGrantOption - }, - select: { - databaseId: true, - granteeName: true, - id: true, - isGrant: true, - privilege: true, - viewId: true, - withGrantOption: true - } - }).execute(); + const result = await client.viewGrant + .create({ + data: { + databaseId: cleanedData.databaseId, + granteeName: cleanedData.granteeName, + isGrant: cleanedData.isGrant, + privilege: cleanedData.privilege, + viewId: cleanedData.viewId, + withGrantOption: cleanedData.withGrantOption, + }, + select: { + databaseId: true, + granteeName: true, + id: true, + isGrant: true, + privilege: true, + viewId: true, + withGrantOption: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -207,73 +238,83 @@ async function handleCreate(argv: Partial>, prompter: In } 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, - skipPrompt: true - }, { - type: "text", - name: "granteeName", - message: "granteeName", - required: false - }, { - type: "boolean", - name: "isGrant", - message: "isGrant", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privilege", - message: "privilege", - required: false - }, { - type: "text", - name: "viewId", - message: "viewId", - required: false - }, { - type: "boolean", - name: "withGrantOption", - message: "withGrantOption", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'granteeName', + message: 'granteeName', + required: false, + }, + { + type: 'boolean', + name: 'isGrant', + message: 'isGrant', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privilege', + message: 'privilege', + required: false, + }, + { + type: 'text', + name: 'viewId', + message: 'viewId', + required: false, + }, + { + type: 'boolean', + name: 'withGrantOption', + message: 'withGrantOption', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ViewGrantPatch; const client = getClient(); - const result = await client.viewGrant.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - granteeName: cleanedData.granteeName, - isGrant: cleanedData.isGrant, - privilege: cleanedData.privilege, - viewId: cleanedData.viewId, - withGrantOption: cleanedData.withGrantOption - }, - select: { - databaseId: true, - granteeName: true, - id: true, - isGrant: true, - privilege: true, - viewId: true, - withGrantOption: true - } - }).execute(); + const result = await client.viewGrant + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + granteeName: cleanedData.granteeName, + isGrant: cleanedData.isGrant, + privilege: cleanedData.privilege, + viewId: cleanedData.viewId, + withGrantOption: cleanedData.withGrantOption, + }, + select: { + databaseId: true, + granteeName: true, + id: true, + isGrant: true, + privilege: true, + viewId: true, + withGrantOption: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -282,28 +323,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.viewGrant.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.viewGrant + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/view-rule.ts b/sdk/constructive-cli/src/api/cli/commands/view-rule.ts index 380287d4a5..7def88c63f 100644 --- a/sdk/constructive-cli/src/api/cli/commands/view-rule.ts +++ b/sdk/constructive-cli/src/api/cli/commands/view-rule.ts @@ -3,54 +3,68 @@ * @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 { CreateViewRuleInput, ViewRulePatch, ViewRuleSelect, ViewRuleFilter, ViewRuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateViewRuleInput, + ViewRulePatch, + ViewRuleSelect, + ViewRuleFilter, + ViewRuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - action: "string", - databaseId: "uuid", - event: "string", - id: "uuid", - name: "string", - viewId: "uuid" + action: 'string', + databaseId: 'uuid', + event: 'string', + id: 'uuid', + name: 'string', + viewId: 'uuid', }; -const usage = "\nview-rule \n\nCommands:\n list List viewRule records\n find-first Find first matching viewRule record\n get Get a viewRule by ID\n create Create a new viewRule\n update Update an existing viewRule\n delete Delete a viewRule\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) => { +const usage = + '\nview-rule \n\nCommands:\n list List viewRule records\n find-first Find first matching viewRule record\n get Get a viewRule by ID\n create Create a new viewRule\n update Update an existing viewRule\n delete Delete a viewRule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq event: true, id: true, name: true, - viewId: true + viewId: true, }; - const findManyArgs = parseFindManyArgs & { - select: ViewRuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ViewRuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.viewRule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter event: true, id: true, name: true, - viewId: true + viewId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ViewRuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ViewRuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.viewRule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.viewRule.findOne({ - id: answers.id as string, - select: { - action: true, - databaseId: true, - event: true, - id: true, - name: true, - viewId: true - } - }).execute(); + const result = await client.viewRule + .findOne({ + id: answers.id as string, + select: { + action: true, + databaseId: true, + event: true, + id: true, + name: true, + viewId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,57 +158,65 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "action", - message: "action", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "event", - message: "event", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "viewId", - message: "viewId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'action', + message: 'action', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'event', + message: 'event', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'viewId', + message: 'viewId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateViewRuleInput["viewRule"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateViewRuleInput['viewRule']; const client = getClient(); - const result = await client.viewRule.create({ - data: { - action: cleanedData.action, - databaseId: cleanedData.databaseId, - event: cleanedData.event, - name: cleanedData.name, - viewId: cleanedData.viewId - }, - select: { - action: true, - databaseId: true, - event: true, - id: true, - name: true, - viewId: true - } - }).execute(); + const result = await client.viewRule + .create({ + data: { + action: cleanedData.action, + databaseId: cleanedData.databaseId, + event: cleanedData.event, + name: cleanedData.name, + viewId: cleanedData.viewId, + }, + select: { + action: true, + databaseId: true, + event: true, + id: true, + name: true, + viewId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -195,65 +225,74 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "action", - message: "action", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "event", - message: "event", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "viewId", - message: "viewId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'action', + message: 'action', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'event', + message: 'event', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'viewId', + message: 'viewId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ViewRulePatch; const client = getClient(); - const result = await client.viewRule.update({ - where: { - id: answers.id as string - }, - data: { - action: cleanedData.action, - databaseId: cleanedData.databaseId, - event: cleanedData.event, - name: cleanedData.name, - viewId: cleanedData.viewId - }, - select: { - action: true, - databaseId: true, - event: true, - id: true, - name: true, - viewId: true - } - }).execute(); + const result = await client.viewRule + .update({ + where: { + id: answers.id as string, + }, + data: { + action: cleanedData.action, + databaseId: cleanedData.databaseId, + event: cleanedData.event, + name: cleanedData.name, + viewId: cleanedData.viewId, + }, + select: { + action: true, + databaseId: true, + event: true, + id: true, + name: true, + viewId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -262,28 +301,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.viewRule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.viewRule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/view-table.ts b/sdk/constructive-cli/src/api/cli/commands/view-table.ts index 1a917c312c..aed0d27d2f 100644 --- a/sdk/constructive-cli/src/api/cli/commands/view-table.ts +++ b/sdk/constructive-cli/src/api/cli/commands/view-table.ts @@ -3,53 +3,67 @@ * @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 { CreateViewTableInput, ViewTablePatch, ViewTableSelect, ViewTableFilter, ViewTableOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateViewTableInput, + ViewTablePatch, + ViewTableSelect, + ViewTableFilter, + ViewTableOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - id: "uuid", - joinOrder: "int", - tableId: "uuid", - viewId: "uuid" + databaseId: 'uuid', + id: 'uuid', + joinOrder: 'int', + tableId: 'uuid', + viewId: 'uuid', }; -const usage = "\nview-table \n\nCommands:\n list List viewTable records\n find-first Find first matching viewTable record\n get Get a viewTable by ID\n create Create a new viewTable\n update Update an existing viewTable\n delete Delete a viewTable\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) => { +const usage = + '\nview-table \n\nCommands:\n list List viewTable records\n find-first Find first matching viewTable record\n get Get a viewTable by ID\n create Create a new viewTable\n update Update an existing viewTable\n delete Delete a viewTable\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, joinOrder: true, tableId: true, - viewId: true + viewId: true, }; - const findManyArgs = parseFindManyArgs & { - select: ViewTableSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ViewTableSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.viewTable.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, joinOrder: true, tableId: true, - viewId: true + viewId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ViewTableSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ViewTableSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.viewTable.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.viewTable.findOne({ - id: answers.id as string, - select: { - databaseId: true, - id: true, - joinOrder: true, - tableId: true, - viewId: true - } - }).execute(); + const result = await client.viewTable + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + id: true, + joinOrder: true, + tableId: true, + viewId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,50 +154,57 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "joinOrder", - message: "joinOrder", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "text", - name: "viewId", - message: "viewId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'joinOrder', + message: 'joinOrder', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'text', + name: 'viewId', + message: 'viewId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateViewTableInput["viewTable"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateViewTableInput['viewTable']; const client = getClient(); - const result = await client.viewTable.create({ - data: { - databaseId: cleanedData.databaseId, - joinOrder: cleanedData.joinOrder, - tableId: cleanedData.tableId, - viewId: cleanedData.viewId - }, - select: { - databaseId: true, - id: true, - joinOrder: true, - tableId: true, - viewId: true - } - }).execute(); + const result = await client.viewTable + .create({ + data: { + databaseId: cleanedData.databaseId, + joinOrder: cleanedData.joinOrder, + tableId: cleanedData.tableId, + viewId: cleanedData.viewId, + }, + select: { + databaseId: true, + id: true, + joinOrder: true, + tableId: true, + viewId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -184,58 +213,66 @@ async function handleCreate(argv: Partial>, prompter: In } 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, - skipPrompt: true - }, { - type: "text", - name: "joinOrder", - message: "joinOrder", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "text", - name: "viewId", - message: "viewId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'joinOrder', + message: 'joinOrder', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'text', + name: 'viewId', + message: 'viewId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ViewTablePatch; const client = getClient(); - const result = await client.viewTable.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - joinOrder: cleanedData.joinOrder, - tableId: cleanedData.tableId, - viewId: cleanedData.viewId - }, - select: { - databaseId: true, - id: true, - joinOrder: true, - tableId: true, - viewId: true - } - }).execute(); + const result = await client.viewTable + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + joinOrder: cleanedData.joinOrder, + tableId: cleanedData.tableId, + viewId: cleanedData.viewId, + }, + select: { + databaseId: true, + id: true, + joinOrder: true, + tableId: true, + viewId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -244,28 +281,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.viewTable.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.viewTable + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/view.ts b/sdk/constructive-cli/src/api/cli/commands/view.ts index 090d80d634..5849275903 100644 --- a/sdk/constructive-cli/src/api/cli/commands/view.ts +++ b/sdk/constructive-cli/src/api/cli/commands/view.ts @@ -3,64 +3,78 @@ * @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 { CreateViewInput, ViewPatch, ViewSelect, ViewFilter, ViewOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateViewInput, + ViewPatch, + ViewSelect, + ViewFilter, + ViewOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - category: "string", - checkOption: "string", - data: "json", - databaseId: "uuid", - filterData: "json", - filterType: "string", - id: "uuid", - isReadOnly: "boolean", - name: "string", - schemaId: "uuid", - securityBarrier: "boolean", - securityInvoker: "boolean", - smartTags: "json", - tableId: "uuid", - tags: "string", - viewType: "string" + category: 'string', + checkOption: 'string', + data: 'json', + databaseId: 'uuid', + filterData: 'json', + filterType: 'string', + id: 'uuid', + isReadOnly: 'boolean', + name: 'string', + schemaId: 'uuid', + securityBarrier: 'boolean', + securityInvoker: 'boolean', + smartTags: 'json', + tableId: 'uuid', + tags: 'string', + viewType: 'string', }; -const usage = "\nview \n\nCommands:\n list List view records\n find-first Find first matching view record\n get Get a view by ID\n create Create a new view\n update Update an existing view\n delete Delete a view\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) => { +const usage = + '\nview \n\nCommands:\n list List view records\n find-first Find first matching view record\n get Get a view by ID\n create Create a new view\n update Update an existing view\n delete Delete a view\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,18 @@ async function handleList(argv: Partial>, _prompter: Inq smartTags: true, tableId: true, tags: true, - viewType: true + viewType: true, }; - const findManyArgs = parseFindManyArgs & { - select: ViewSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ViewSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.view.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +135,18 @@ async function handleFindFirst(argv: Partial>, _prompter smartTags: true, tableId: true, tags: true, - viewType: true + viewType: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ViewSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ViewSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.view.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +155,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.view.findOne({ - id: answers.id as string, - select: { - category: true, - checkOption: true, - data: true, - databaseId: true, - filterData: true, - filterType: true, - id: true, - isReadOnly: true, - name: true, - schemaId: true, - securityBarrier: true, - securityInvoker: true, - smartTags: true, - tableId: true, - tags: true, - viewType: true - } - }).execute(); + const result = await client.view + .findOne({ + id: answers.id as string, + select: { + category: true, + checkOption: true, + data: true, + databaseId: true, + filterData: true, + filterType: true, + id: true, + isReadOnly: true, + name: true, + schemaId: true, + securityBarrier: true, + securityInvoker: true, + smartTags: true, + tableId: true, + tags: true, + viewType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,137 +198,155 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "checkOption", - message: "checkOption", - required: false, - skipPrompt: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "filterData", - message: "filterData", - required: false, - skipPrompt: true - }, { - type: "text", - name: "filterType", - message: "filterType", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isReadOnly", - message: "isReadOnly", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: true - }, { - type: "boolean", - name: "securityBarrier", - message: "securityBarrier", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "securityInvoker", - message: "securityInvoker", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "viewType", - message: "viewType", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'checkOption', + message: 'checkOption', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'filterData', + message: 'filterData', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'filterType', + message: 'filterType', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: true, + }, + { + type: 'boolean', + name: 'securityBarrier', + message: 'securityBarrier', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'securityInvoker', + message: 'securityInvoker', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'viewType', + message: 'viewType', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateViewInput["view"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateViewInput['view']; const client = getClient(); - const result = await client.view.create({ - data: { - category: cleanedData.category, - checkOption: cleanedData.checkOption, - data: cleanedData.data, - databaseId: cleanedData.databaseId, - filterData: cleanedData.filterData, - filterType: cleanedData.filterType, - isReadOnly: cleanedData.isReadOnly, - name: cleanedData.name, - schemaId: cleanedData.schemaId, - securityBarrier: cleanedData.securityBarrier, - securityInvoker: cleanedData.securityInvoker, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - viewType: cleanedData.viewType - }, - select: { - category: true, - checkOption: true, - data: true, - databaseId: true, - filterData: true, - filterType: true, - id: true, - isReadOnly: true, - name: true, - schemaId: true, - securityBarrier: true, - securityInvoker: true, - smartTags: true, - tableId: true, - tags: true, - viewType: true - } - }).execute(); + const result = await client.view + .create({ + data: { + category: cleanedData.category, + checkOption: cleanedData.checkOption, + data: cleanedData.data, + databaseId: cleanedData.databaseId, + filterData: cleanedData.filterData, + filterType: cleanedData.filterType, + isReadOnly: cleanedData.isReadOnly, + name: cleanedData.name, + schemaId: cleanedData.schemaId, + securityBarrier: cleanedData.securityBarrier, + securityInvoker: cleanedData.securityInvoker, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + viewType: cleanedData.viewType, + }, + select: { + category: true, + checkOption: true, + data: true, + databaseId: true, + filterData: true, + filterType: true, + id: true, + isReadOnly: true, + name: true, + schemaId: true, + securityBarrier: true, + securityInvoker: true, + smartTags: true, + tableId: true, + tags: true, + viewType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -315,145 +355,164 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "checkOption", - message: "checkOption", - required: false, - skipPrompt: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "filterData", - message: "filterData", - required: false, - skipPrompt: true - }, { - type: "text", - name: "filterType", - message: "filterType", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isReadOnly", - message: "isReadOnly", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false - }, { - type: "boolean", - name: "securityBarrier", - message: "securityBarrier", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "securityInvoker", - message: "securityInvoker", - required: false, - skipPrompt: true - }, { - type: "json", - name: "smartTags", - message: "smartTags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "viewType", - message: "viewType", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'checkOption', + message: 'checkOption', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'filterData', + message: 'filterData', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'filterType', + message: 'filterType', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + }, + { + type: 'boolean', + name: 'securityBarrier', + message: 'securityBarrier', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'securityInvoker', + message: 'securityInvoker', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'smartTags', + message: 'smartTags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'viewType', + message: 'viewType', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ViewPatch; const client = getClient(); - const result = await client.view.update({ - where: { - id: answers.id as string - }, - data: { - category: cleanedData.category, - checkOption: cleanedData.checkOption, - data: cleanedData.data, - databaseId: cleanedData.databaseId, - filterData: cleanedData.filterData, - filterType: cleanedData.filterType, - isReadOnly: cleanedData.isReadOnly, - name: cleanedData.name, - schemaId: cleanedData.schemaId, - securityBarrier: cleanedData.securityBarrier, - securityInvoker: cleanedData.securityInvoker, - smartTags: cleanedData.smartTags, - tableId: cleanedData.tableId, - tags: cleanedData.tags, - viewType: cleanedData.viewType - }, - select: { - category: true, - checkOption: true, - data: true, - databaseId: true, - filterData: true, - filterType: true, - id: true, - isReadOnly: true, - name: true, - schemaId: true, - securityBarrier: true, - securityInvoker: true, - smartTags: true, - tableId: true, - tags: true, - viewType: true - } - }).execute(); + const result = await client.view + .update({ + where: { + id: answers.id as string, + }, + data: { + category: cleanedData.category, + checkOption: cleanedData.checkOption, + data: cleanedData.data, + databaseId: cleanedData.databaseId, + filterData: cleanedData.filterData, + filterType: cleanedData.filterType, + isReadOnly: cleanedData.isReadOnly, + name: cleanedData.name, + schemaId: cleanedData.schemaId, + securityBarrier: cleanedData.securityBarrier, + securityInvoker: cleanedData.securityInvoker, + smartTags: cleanedData.smartTags, + tableId: cleanedData.tableId, + tags: cleanedData.tags, + viewType: cleanedData.viewType, + }, + select: { + category: true, + checkOption: true, + data: true, + databaseId: true, + filterData: true, + filterType: true, + id: true, + isReadOnly: true, + name: true, + schemaId: true, + securityBarrier: true, + securityInvoker: true, + smartTags: true, + tableId: true, + tags: true, + viewType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -462,28 +521,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.view.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.view + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/commands/webauthn-setting.ts b/sdk/constructive-cli/src/api/cli/commands/webauthn-setting.ts index 8deef62032..efedfc35d7 100644 --- a/sdk/constructive-cli/src/api/cli/commands/webauthn-setting.ts +++ b/sdk/constructive-cli/src/api/cli/commands/webauthn-setting.ts @@ -3,68 +3,82 @@ * @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 { CreateWebauthnSettingInput, WebauthnSettingPatch, WebauthnSettingSelect, WebauthnSettingFilter, WebauthnSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateWebauthnSettingInput, + WebauthnSettingPatch, + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - attestationType: "string", - challengeExpirySeconds: "int", - createdAt: "string", - credentialsSchemaId: "uuid", - credentialsTableId: "uuid", - databaseId: "uuid", - id: "uuid", - originAllowlist: "string", - requireUserVerification: "boolean", - residentKey: "string", - rpId: "string", - rpName: "string", - schemaId: "uuid", - sessionCredentialsTableId: "uuid", - sessionSecretsSchemaId: "uuid", - sessionSecretsTableId: "uuid", - sessionsSchemaId: "uuid", - sessionsTableId: "uuid", - updatedAt: "string", - userFieldId: "uuid" + attestationType: 'string', + challengeExpirySeconds: 'int', + createdAt: 'string', + credentialsSchemaId: 'uuid', + credentialsTableId: 'uuid', + databaseId: 'uuid', + id: 'uuid', + originAllowlist: 'string', + requireUserVerification: 'boolean', + residentKey: 'string', + rpId: 'string', + rpName: 'string', + schemaId: 'uuid', + sessionCredentialsTableId: 'uuid', + sessionSecretsSchemaId: 'uuid', + sessionSecretsTableId: 'uuid', + sessionsSchemaId: 'uuid', + sessionsTableId: 'uuid', + updatedAt: 'string', + userFieldId: 'uuid', }; -const usage = "\nwebauthn-setting \n\nCommands:\n list List webauthnSetting records\n find-first Find first matching webauthnSetting record\n get Get a webauthnSetting by ID\n create Create a new webauthnSetting\n update Update an existing webauthnSetting\n delete Delete a webauthnSetting\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) => { +const usage = + '\nwebauthn-setting \n\nCommands:\n list List webauthnSetting records\n find-first Find first matching webauthnSetting record\n get Get a webauthnSetting by ID\n create Create a new webauthnSetting\n update Update an existing webauthnSetting\n delete Delete a webauthnSetting\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,18 @@ async function handleList(argv: Partial>, _prompter: Inq sessionsSchemaId: true, sessionsTableId: true, updatedAt: true, - userFieldId: true + userFieldId: true, }; - const findManyArgs = parseFindManyArgs & { - select: WebauthnSettingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: WebauthnSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webauthnSetting.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +147,18 @@ async function handleFindFirst(argv: Partial>, _prompter sessionsSchemaId: true, sessionsTableId: true, updatedAt: true, - userFieldId: true + userFieldId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: WebauthnSettingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: WebauthnSettingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webauthnSetting.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +167,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.webauthnSetting.findOne({ - id: answers.id as string, - select: { - attestationType: true, - challengeExpirySeconds: true, - createdAt: true, - credentialsSchemaId: true, - credentialsTableId: true, - databaseId: true, - id: true, - originAllowlist: true, - requireUserVerification: true, - residentKey: true, - rpId: true, - rpName: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionSecretsSchemaId: true, - sessionSecretsTableId: true, - sessionsSchemaId: true, - sessionsTableId: true, - updatedAt: true, - userFieldId: true - } - }).execute(); + const result = await client.webauthnSetting + .findOne({ + id: answers.id as string, + select: { + attestationType: true, + challengeExpirySeconds: true, + createdAt: true, + credentialsSchemaId: true, + credentialsTableId: true, + databaseId: true, + id: true, + originAllowlist: true, + requireUserVerification: true, + residentKey: true, + rpId: true, + rpName: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionSecretsSchemaId: true, + sessionSecretsTableId: true, + sessionsSchemaId: true, + sessionsTableId: true, + updatedAt: true, + userFieldId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,157 +214,180 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "attestationType", - message: "attestationType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "challengeExpirySeconds", - message: "challengeExpirySeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "credentialsSchemaId", - message: "credentialsSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "credentialsTableId", - message: "credentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "originAllowlist", - message: "originAllowlist", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "requireUserVerification", - message: "requireUserVerification", - required: false, - skipPrompt: true - }, { - type: "text", - name: "residentKey", - message: "residentKey", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rpId", - message: "rpId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rpName", - message: "rpName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionSecretsSchemaId", - message: "sessionSecretsSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionSecretsTableId", - message: "sessionSecretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsSchemaId", - message: "sessionsSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userFieldId", - message: "userFieldId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'attestationType', + message: 'attestationType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'challengeExpirySeconds', + message: 'challengeExpirySeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'credentialsSchemaId', + message: 'credentialsSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'credentialsTableId', + message: 'credentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'originAllowlist', + message: 'originAllowlist', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'requireUserVerification', + message: 'requireUserVerification', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'residentKey', + message: 'residentKey', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rpId', + message: 'rpId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rpName', + message: 'rpName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionSecretsSchemaId', + message: 'sessionSecretsSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionSecretsTableId', + message: 'sessionSecretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsSchemaId', + message: 'sessionsSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userFieldId', + message: 'userFieldId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateWebauthnSettingInput["webauthnSetting"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateWebauthnSettingInput['webauthnSetting']; const client = getClient(); - const result = await client.webauthnSetting.create({ - data: { - attestationType: cleanedData.attestationType, - challengeExpirySeconds: cleanedData.challengeExpirySeconds, - credentialsSchemaId: cleanedData.credentialsSchemaId, - credentialsTableId: cleanedData.credentialsTableId, - databaseId: cleanedData.databaseId, - originAllowlist: cleanedData.originAllowlist, - requireUserVerification: cleanedData.requireUserVerification, - residentKey: cleanedData.residentKey, - rpId: cleanedData.rpId, - rpName: cleanedData.rpName, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionSecretsSchemaId: cleanedData.sessionSecretsSchemaId, - sessionSecretsTableId: cleanedData.sessionSecretsTableId, - sessionsSchemaId: cleanedData.sessionsSchemaId, - sessionsTableId: cleanedData.sessionsTableId, - userFieldId: cleanedData.userFieldId - }, - select: { - attestationType: true, - challengeExpirySeconds: true, - createdAt: true, - credentialsSchemaId: true, - credentialsTableId: true, - databaseId: true, - id: true, - originAllowlist: true, - requireUserVerification: true, - residentKey: true, - rpId: true, - rpName: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionSecretsSchemaId: true, - sessionSecretsTableId: true, - sessionsSchemaId: true, - sessionsTableId: true, - updatedAt: true, - userFieldId: true - } - }).execute(); + const result = await client.webauthnSetting + .create({ + data: { + attestationType: cleanedData.attestationType, + challengeExpirySeconds: cleanedData.challengeExpirySeconds, + credentialsSchemaId: cleanedData.credentialsSchemaId, + credentialsTableId: cleanedData.credentialsTableId, + databaseId: cleanedData.databaseId, + originAllowlist: cleanedData.originAllowlist, + requireUserVerification: cleanedData.requireUserVerification, + residentKey: cleanedData.residentKey, + rpId: cleanedData.rpId, + rpName: cleanedData.rpName, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionSecretsSchemaId: cleanedData.sessionSecretsSchemaId, + sessionSecretsTableId: cleanedData.sessionSecretsTableId, + sessionsSchemaId: cleanedData.sessionsSchemaId, + sessionsTableId: cleanedData.sessionsTableId, + userFieldId: cleanedData.userFieldId, + }, + select: { + attestationType: true, + challengeExpirySeconds: true, + createdAt: true, + credentialsSchemaId: true, + credentialsTableId: true, + databaseId: true, + id: true, + originAllowlist: true, + requireUserVerification: true, + residentKey: true, + rpId: true, + rpName: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionSecretsSchemaId: true, + sessionSecretsTableId: true, + sessionsSchemaId: true, + sessionsTableId: true, + updatedAt: true, + userFieldId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -351,165 +396,186 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "attestationType", - message: "attestationType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "challengeExpirySeconds", - message: "challengeExpirySeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "credentialsSchemaId", - message: "credentialsSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "credentialsTableId", - message: "credentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "originAllowlist", - message: "originAllowlist", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "requireUserVerification", - message: "requireUserVerification", - required: false, - skipPrompt: true - }, { - type: "text", - name: "residentKey", - message: "residentKey", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rpId", - message: "rpId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rpName", - message: "rpName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionSecretsSchemaId", - message: "sessionSecretsSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionSecretsTableId", - message: "sessionSecretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsSchemaId", - message: "sessionsSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userFieldId", - message: "userFieldId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'attestationType', + message: 'attestationType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'challengeExpirySeconds', + message: 'challengeExpirySeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'credentialsSchemaId', + message: 'credentialsSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'credentialsTableId', + message: 'credentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'originAllowlist', + message: 'originAllowlist', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'requireUserVerification', + message: 'requireUserVerification', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'residentKey', + message: 'residentKey', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rpId', + message: 'rpId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rpName', + message: 'rpName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionSecretsSchemaId', + message: 'sessionSecretsSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionSecretsTableId', + message: 'sessionSecretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsSchemaId', + message: 'sessionsSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userFieldId', + message: 'userFieldId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as WebauthnSettingPatch; const client = getClient(); - const result = await client.webauthnSetting.update({ - where: { - id: answers.id as string - }, - data: { - attestationType: cleanedData.attestationType, - challengeExpirySeconds: cleanedData.challengeExpirySeconds, - credentialsSchemaId: cleanedData.credentialsSchemaId, - credentialsTableId: cleanedData.credentialsTableId, - databaseId: cleanedData.databaseId, - originAllowlist: cleanedData.originAllowlist, - requireUserVerification: cleanedData.requireUserVerification, - residentKey: cleanedData.residentKey, - rpId: cleanedData.rpId, - rpName: cleanedData.rpName, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionSecretsSchemaId: cleanedData.sessionSecretsSchemaId, - sessionSecretsTableId: cleanedData.sessionSecretsTableId, - sessionsSchemaId: cleanedData.sessionsSchemaId, - sessionsTableId: cleanedData.sessionsTableId, - userFieldId: cleanedData.userFieldId - }, - select: { - attestationType: true, - challengeExpirySeconds: true, - createdAt: true, - credentialsSchemaId: true, - credentialsTableId: true, - databaseId: true, - id: true, - originAllowlist: true, - requireUserVerification: true, - residentKey: true, - rpId: true, - rpName: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionSecretsSchemaId: true, - sessionSecretsTableId: true, - sessionsSchemaId: true, - sessionsTableId: true, - updatedAt: true, - userFieldId: true - } - }).execute(); + const result = await client.webauthnSetting + .update({ + where: { + id: answers.id as string, + }, + data: { + attestationType: cleanedData.attestationType, + challengeExpirySeconds: cleanedData.challengeExpirySeconds, + credentialsSchemaId: cleanedData.credentialsSchemaId, + credentialsTableId: cleanedData.credentialsTableId, + databaseId: cleanedData.databaseId, + originAllowlist: cleanedData.originAllowlist, + requireUserVerification: cleanedData.requireUserVerification, + residentKey: cleanedData.residentKey, + rpId: cleanedData.rpId, + rpName: cleanedData.rpName, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionSecretsSchemaId: cleanedData.sessionSecretsSchemaId, + sessionSecretsTableId: cleanedData.sessionSecretsTableId, + sessionsSchemaId: cleanedData.sessionsSchemaId, + sessionsTableId: cleanedData.sessionsTableId, + userFieldId: cleanedData.userFieldId, + }, + select: { + attestationType: true, + challengeExpirySeconds: true, + createdAt: true, + credentialsSchemaId: true, + credentialsTableId: true, + databaseId: true, + id: true, + originAllowlist: true, + requireUserVerification: true, + residentKey: true, + rpId: true, + rpName: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionSecretsSchemaId: true, + sessionSecretsTableId: true, + sessionsSchemaId: true, + sessionsTableId: true, + updatedAt: true, + userFieldId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -518,28 +584,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.webauthnSetting.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.webauthnSetting + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/executor.ts b/sdk/constructive-cli/src/api/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/api/cli/executor.ts +++ b/sdk/constructive-cli/src/api/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/cli/index.ts b/sdk/constructive-cli/src/api/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/api/cli/index.ts +++ b/sdk/constructive-cli/src/api/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/api/cli/utils.ts b/sdk/constructive-cli/src/api/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/api/cli/utils.ts +++ b/sdk/constructive-cli/src/api/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/api/index.ts b/sdk/constructive-cli/src/api/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/api/index.ts +++ b/sdk/constructive-cli/src/api/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/api/orm/client.ts b/sdk/constructive-cli/src/api/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/api/orm/client.ts +++ b/sdk/constructive-cli/src/api/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/api/orm/index.ts b/sdk/constructive-cli/src/api/orm/index.ts index f2e5d03590..daef0c9123 100644 --- a/sdk/constructive-cli/src/api/orm/index.ts +++ b/sdk/constructive-cli/src/api/orm/index.ts @@ -3,82 +3,82 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { ApiModel } from "./models/api"; -import { ApiModuleModel } from "./models/apiModule"; -import { ApiSchemaModel } from "./models/apiSchema"; -import { ApiSettingModel } from "./models/apiSetting"; -import { AstMigrationModel } from "./models/astMigration"; -import { CheckConstraintModel } from "./models/checkConstraint"; -import { CompositeTypeModel } from "./models/compositeType"; -import { CorsSettingModel } from "./models/corsSetting"; -import { DatabaseModel } from "./models/database"; -import { DatabaseSettingModel } from "./models/databaseSetting"; -import { DatabaseTransferModel } from "./models/databaseTransfer"; -import { DefaultPrivilegeModel } from "./models/defaultPrivilege"; -import { DomainModel } from "./models/domain"; -import { DomainEventModel } from "./models/domainEvent"; -import { DomainVerificationModel } from "./models/domainVerification"; -import { EmbeddingChunkModel } from "./models/embeddingChunk"; -import { EnumModel } from "./models/enum"; -import { ExclusionConstraintModel } from "./models/exclusionConstraint"; -import { FieldModel } from "./models/field"; -import { ForeignKeyConstraintModel } from "./models/foreignKeyConstraint"; -import { FullTextSearchModel } from "./models/fullTextSearch"; -import { FunctionModel } from "./models/function"; -import { HostnameBindingModel } from "./models/hostnameBinding"; -import { HttpRouteModel } from "./models/httpRoute"; -import { IndexModel } from "./models/index"; -import { ManagedDomainModel } from "./models/managedDomain"; -import { NodeTypeRegistryModel } from "./models/nodeTypeRegistry"; -import { PartitionModel } from "./models/partition"; -import { PlatformApiModel } from "./models/platformApi"; -import { PlatformApiModuleModel } from "./models/platformApiModule"; -import { PlatformApiSchemaModel } from "./models/platformApiSchema"; -import { PlatformApiSettingModel } from "./models/platformApiSetting"; -import { PlatformCorsSettingModel } from "./models/platformCorsSetting"; -import { PlatformDomainModel } from "./models/platformDomain"; -import { PlatformDomainEventModel } from "./models/platformDomainEvent"; -import { PlatformDomainVerificationModel } from "./models/platformDomainVerification"; -import { PlatformManagedDomainModel } from "./models/platformManagedDomain"; -import { PlatformSiteModel } from "./models/platformSite"; -import { PlatformSiteMetadatumModel } from "./models/platformSiteMetadatum"; -import { PlatformSiteModuleModel } from "./models/platformSiteModule"; -import { PlatformSiteThemeModel } from "./models/platformSiteTheme"; -import { PolicyModel } from "./models/policy"; -import { PrimaryKeyConstraintModel } from "./models/primaryKeyConstraint"; -import { PubkeySettingModel } from "./models/pubkeySetting"; -import { RlsSettingModel } from "./models/rlsSetting"; -import { RouteBindingModel } from "./models/routeBinding"; -import { RouteModel } from "./models/route"; -import { SchemaModel } from "./models/schema"; -import { SchemaGrantModel } from "./models/schemaGrant"; -import { SiteModel } from "./models/site"; -import { SiteMetadatumModel } from "./models/siteMetadatum"; -import { SiteModuleModel } from "./models/siteModule"; -import { SiteThemeModel } from "./models/siteTheme"; -import { SpatialRelationModel } from "./models/spatialRelation"; -import { SqlActionModel } from "./models/sqlAction"; -import { TableModel } from "./models/table"; -import { TableGrantModel } from "./models/tableGrant"; -import { TriggerModel } from "./models/trigger"; -import { TriggerFunctionModel } from "./models/triggerFunction"; -import { UniqueConstraintModel } from "./models/uniqueConstraint"; -import { ViewModel } from "./models/view"; -import { ViewGrantModel } from "./models/viewGrant"; -import { ViewRuleModel } from "./models/viewRule"; -import { ViewTableModel } from "./models/viewTable"; -import { WebauthnSettingModel } from "./models/webauthnSetting"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { ApiModel } from './models/api'; +import { ApiModuleModel } from './models/apiModule'; +import { ApiSchemaModel } from './models/apiSchema'; +import { ApiSettingModel } from './models/apiSetting'; +import { AstMigrationModel } from './models/astMigration'; +import { CheckConstraintModel } from './models/checkConstraint'; +import { CompositeTypeModel } from './models/compositeType'; +import { CorsSettingModel } from './models/corsSetting'; +import { DatabaseModel } from './models/database'; +import { DatabaseSettingModel } from './models/databaseSetting'; +import { DatabaseTransferModel } from './models/databaseTransfer'; +import { DefaultPrivilegeModel } from './models/defaultPrivilege'; +import { DomainModel } from './models/domain'; +import { DomainEventModel } from './models/domainEvent'; +import { DomainVerificationModel } from './models/domainVerification'; +import { EmbeddingChunkModel } from './models/embeddingChunk'; +import { EnumModel } from './models/enum'; +import { ExclusionConstraintModel } from './models/exclusionConstraint'; +import { FieldModel } from './models/field'; +import { ForeignKeyConstraintModel } from './models/foreignKeyConstraint'; +import { FullTextSearchModel } from './models/fullTextSearch'; +import { FunctionModel } from './models/function'; +import { HostnameBindingModel } from './models/hostnameBinding'; +import { HttpRouteModel } from './models/httpRoute'; +import { IndexModel } from './models/index'; +import { ManagedDomainModel } from './models/managedDomain'; +import { NodeTypeRegistryModel } from './models/nodeTypeRegistry'; +import { PartitionModel } from './models/partition'; +import { PlatformApiModel } from './models/platformApi'; +import { PlatformApiModuleModel } from './models/platformApiModule'; +import { PlatformApiSchemaModel } from './models/platformApiSchema'; +import { PlatformApiSettingModel } from './models/platformApiSetting'; +import { PlatformCorsSettingModel } from './models/platformCorsSetting'; +import { PlatformDomainModel } from './models/platformDomain'; +import { PlatformDomainEventModel } from './models/platformDomainEvent'; +import { PlatformDomainVerificationModel } from './models/platformDomainVerification'; +import { PlatformManagedDomainModel } from './models/platformManagedDomain'; +import { PlatformSiteModel } from './models/platformSite'; +import { PlatformSiteMetadatumModel } from './models/platformSiteMetadatum'; +import { PlatformSiteModuleModel } from './models/platformSiteModule'; +import { PlatformSiteThemeModel } from './models/platformSiteTheme'; +import { PolicyModel } from './models/policy'; +import { PrimaryKeyConstraintModel } from './models/primaryKeyConstraint'; +import { PubkeySettingModel } from './models/pubkeySetting'; +import { RlsSettingModel } from './models/rlsSetting'; +import { RouteBindingModel } from './models/routeBinding'; +import { RouteModel } from './models/route'; +import { SchemaModel } from './models/schema'; +import { SchemaGrantModel } from './models/schemaGrant'; +import { SiteModel } from './models/site'; +import { SiteMetadatumModel } from './models/siteMetadatum'; +import { SiteModuleModel } from './models/siteModule'; +import { SiteThemeModel } from './models/siteTheme'; +import { SpatialRelationModel } from './models/spatialRelation'; +import { SqlActionModel } from './models/sqlAction'; +import { TableModel } from './models/table'; +import { TableGrantModel } from './models/tableGrant'; +import { TriggerModel } from './models/trigger'; +import { TriggerFunctionModel } from './models/triggerFunction'; +import { UniqueConstraintModel } from './models/uniqueConstraint'; +import { ViewModel } from './models/view'; +import { ViewGrantModel } from './models/viewGrant'; +import { ViewRuleModel } from './models/viewRule'; +import { ViewTableModel } from './models/viewTable'; +import { WebauthnSettingModel } from './models/webauthnSetting'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -171,6 +171,6 @@ export function createClient(config: OrmClientConfig) { viewTable: new ViewTableModel(client), webauthnSetting: new WebauthnSettingModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/input-types.ts b/sdk/constructive-cli/src/api/orm/input-types.ts index 5e778de550..4396202b0a 100644 --- a/sdk/constructive-cli/src/api/orm/input-types.ts +++ b/sdk/constructive-cli/src/api/orm/input-types.ts @@ -231,8 +231,8 @@ export interface UUIDListFilter { anyGreaterThanOrEqualTo?: string; } // ============ Enum Types ============ -export type ApiExposureLevel = "EXPOSABLE" | "INTERNAL_ONLY" | "NEVER_EXPOSE"; -export type ObjectCategory = "APP" | "AUTH" | "CORE" | "MEMBERSHIPS" | "MODULE" | "PERMISSIONS"; +export type ApiExposureLevel = 'EXPOSABLE' | 'INTERNAL_ONLY' | 'NEVER_EXPOSE'; +export type ObjectCategory = 'APP' | 'AUTH' | 'CORE' | 'MEMBERSHIPS' | 'MODULE' | 'PERMISSIONS'; // ============ Custom Scalar Types ============ export type ConstructiveInternalTypeImage = unknown; /** API surfaces exposed by this scope; publication makes a surface bindable from other scopes */ @@ -1757,7 +1757,8 @@ export type EmbeddingChunkWithRelations = EmbeddingChunk & EmbeddingChunkRelatio export type EnumWithRelations = Enum & EnumRelations; export type ExclusionConstraintWithRelations = ExclusionConstraint & ExclusionConstraintRelations; export type FieldWithRelations = Field & FieldRelations; -export type ForeignKeyConstraintWithRelations = ForeignKeyConstraint & ForeignKeyConstraintRelations; +export type ForeignKeyConstraintWithRelations = ForeignKeyConstraint & + ForeignKeyConstraintRelations; export type FullTextSearchWithRelations = FullTextSearch & FullTextSearchRelations; export type FunctionWithRelations = Function & FunctionRelations; export type HostnameBindingWithRelations = HostnameBinding & HostnameBindingRelations; @@ -1773,14 +1774,18 @@ export type PlatformApiSettingWithRelations = PlatformApiSetting & PlatformApiSe export type PlatformCorsSettingWithRelations = PlatformCorsSetting & PlatformCorsSettingRelations; export type PlatformDomainWithRelations = PlatformDomain & PlatformDomainRelations; export type PlatformDomainEventWithRelations = PlatformDomainEvent & PlatformDomainEventRelations; -export type PlatformDomainVerificationWithRelations = PlatformDomainVerification & PlatformDomainVerificationRelations; -export type PlatformManagedDomainWithRelations = PlatformManagedDomain & PlatformManagedDomainRelations; +export type PlatformDomainVerificationWithRelations = PlatformDomainVerification & + PlatformDomainVerificationRelations; +export type PlatformManagedDomainWithRelations = PlatformManagedDomain & + PlatformManagedDomainRelations; export type PlatformSiteWithRelations = PlatformSite & PlatformSiteRelations; -export type PlatformSiteMetadatumWithRelations = PlatformSiteMetadatum & PlatformSiteMetadatumRelations; +export type PlatformSiteMetadatumWithRelations = PlatformSiteMetadatum & + PlatformSiteMetadatumRelations; export type PlatformSiteModuleWithRelations = PlatformSiteModule & PlatformSiteModuleRelations; export type PlatformSiteThemeWithRelations = PlatformSiteTheme & PlatformSiteThemeRelations; export type PolicyWithRelations = Policy & PolicyRelations; -export type PrimaryKeyConstraintWithRelations = PrimaryKeyConstraint & PrimaryKeyConstraintRelations; +export type PrimaryKeyConstraintWithRelations = PrimaryKeyConstraint & + PrimaryKeyConstraintRelations; export type PubkeySettingWithRelations = PubkeySetting & PubkeySettingRelations; export type RlsSettingWithRelations = RlsSetting & RlsSettingRelations; export type RouteBindingWithRelations = RouteBinding & RouteBindingRelations; @@ -6122,71 +6127,1742 @@ export interface WebauthnSettingFilter { userFieldId?: UUIDFilter; } // ============ OrderBy Types ============ -export type ApiOrderBy = "ANON_ROLE_ASC" | "ANON_ROLE_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DBNAME_ASC" | "DBNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_NAME_ASC" | "ROLE_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiModuleOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiSchemaOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiSettingOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AstMigrationOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYS_ASC" | "DEPLOYS_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REQUIRES_ASC" | "REQUIRES_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; -export type CheckConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EXPR_ASC" | "EXPR_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type CompositeTypeOrderBy = "ATTRIBUTES_ASC" | "ATTRIBUTES_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC"; -export type CorsSettingOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PLATFORM_ASC" | "PLATFORM_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_HASH_ASC" | "SCHEMA_HASH_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseSettingOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseTransferOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INITIATED_BY_ASC" | "INITIATED_BY_DESC" | "NATURAL" | "NOTES_ASC" | "NOTES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_APPROVED_ASC" | "SOURCE_APPROVED_AT_ASC" | "SOURCE_APPROVED_AT_DESC" | "SOURCE_APPROVED_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TARGET_APPROVED_ASC" | "TARGET_APPROVED_AT_ASC" | "TARGET_APPROVED_AT_DESC" | "TARGET_APPROVED_DESC" | "TARGET_OWNER_ID_ASC" | "TARGET_OWNER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DefaultPrivilegeOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "OBJECT_TYPE_ASC" | "OBJECT_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type DomainOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type DomainEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "DOMAIN_VERIFICATION_ID_ASC" | "DOMAIN_VERIFICATION_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DomainVerificationOrderBy = "ATTEMPTS_ASC" | "ATTEMPTS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LAST_CHECKED_AT_ASC" | "LAST_CHECKED_AT_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECORD_NAME_ASC" | "RECORD_NAME_DESC" | "RECORD_TYPE_ASC" | "RECORD_TYPE_DESC" | "RECORD_VALUE_ASC" | "RECORD_VALUE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type EmbeddingChunkOrderBy = "CHUNKING_TASK_NAME_ASC" | "CHUNKING_TASK_NAME_DESC" | "CHUNKS_TABLE_ID_ASC" | "CHUNKS_TABLE_ID_DESC" | "CHUNKS_TABLE_NAME_ASC" | "CHUNKS_TABLE_NAME_DESC" | "CHUNK_OVERLAP_ASC" | "CHUNK_OVERLAP_DESC" | "CHUNK_SIZE_ASC" | "CHUNK_SIZE_DESC" | "CHUNK_STRATEGY_ASC" | "CHUNK_STRATEGY_DESC" | "CONTENT_FIELD_NAME_ASC" | "CONTENT_FIELD_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DIMENSIONS_ASC" | "DIMENSIONS_DESC" | "EMBEDDING_FIELD_ID_ASC" | "EMBEDDING_FIELD_ID_DESC" | "EMBEDDING_MODEL_ASC" | "EMBEDDING_MODEL_DESC" | "EMBEDDING_PROVIDER_ASC" | "EMBEDDING_PROVIDER_DESC" | "ENQUEUE_CHUNKING_JOB_ASC" | "ENQUEUE_CHUNKING_JOB_DESC" | "ID_ASC" | "ID_DESC" | "METADATA_FIELDS_ASC" | "METADATA_FIELDS_DESC" | "METRIC_ASC" | "METRIC_DESC" | "NATURAL" | "PARENT_FK_FIELD_ID_ASC" | "PARENT_FK_FIELD_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_INDEXES_ASC" | "SEARCH_INDEXES_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type EnumOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC" | "VALUES_ASC" | "VALUES_DESC"; -export type ExclusionConstraintOrderBy = "ACCESS_METHOD_ASC" | "ACCESS_METHOD_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ELEMENT_EXPR_ASC" | "ELEMENT_EXPR_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPERATORS_ASC" | "OPERATORS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WHERE_CLAUSE_ASC" | "WHERE_CLAUSE_DESC"; -export type FieldOrderBy = "API_REQUIRED_ASC" | "API_REQUIRED_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CHK_ASC" | "CHK_DESC" | "CHK_EXPR_ASC" | "CHK_EXPR_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_VALUE_ASC" | "DEFAULT_VALUE_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_ORDER_ASC" | "FIELD_ORDER_DESC" | "GENERATION_EXPRESSION_ASC" | "GENERATION_EXPRESSION_DESC" | "GENERATION_TYPE_ASC" | "GENERATION_TYPE_DESC" | "IDENTITY_GENERATION_ASC" | "IDENTITY_GENERATION_DESC" | "IDENTITY_OPTIONS_ASC" | "IDENTITY_OPTIONS_DESC" | "ID_ASC" | "ID_DESC" | "IS_REQUIRED_ASC" | "IS_REQUIRED_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MAX_ASC" | "MAX_DESC" | "MIN_ASC" | "MIN_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REGEXP_ASC" | "REGEXP_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ForeignKeyConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACTION_ASC" | "DELETE_ACTION_DESC" | "DELETE_SET_FIELD_IDS_ASC" | "DELETE_SET_FIELD_IDS_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_IDS_ASC" | "REF_FIELD_IDS_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATE_ACTION_ASC" | "UPDATE_ACTION_DESC" | "WITH_PERIOD_ASC" | "WITH_PERIOD_DESC"; -export type FullTextSearchOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "ID_ASC" | "ID_DESC" | "LANGS_ASC" | "LANGS_DESC" | "LANG_COLUMN_ASC" | "LANG_COLUMN_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WEIGHTS_ASC" | "WEIGHTS_DESC"; -export type FunctionOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type HostnameBindingOrderBy = "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC"; -export type HttpRouteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_ID_ASC" | "TARGET_ID_DESC" | "TARGET_KIND_ASC" | "TARGET_KIND_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type IndexOrderBy = "ACCESS_METHOD_ASC" | "ACCESS_METHOD_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INCLUDE_FIELD_IDS_ASC" | "INCLUDE_FIELD_IDS_DESC" | "INDEX_PARAMS_ASC" | "INDEX_PARAMS_DESC" | "IS_UNIQUE_ASC" | "IS_UNIQUE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "OP_CLASSES_ASC" | "OP_CLASSES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WHERE_CLAUSE_ASC" | "WHERE_CLAUSE_DESC"; -export type ManagedDomainOrderBy = "ALLOW_PUBLIC_USAGE_ASC" | "ALLOW_PUBLIC_USAGE_DESC" | "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CERT_STATUS_ASC" | "CERT_STATUS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type NodeTypeRegistryOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMETER_SCHEMA_ASC" | "PARAMETER_SCHEMA_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "TAGS_ASC" | "TAGS_DESC"; -export type PartitionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "IS_PARENTED_ASC" | "IS_PARENTED_DESC" | "NAMING_PATTERN_ASC" | "NAMING_PATTERN_DESC" | "NATURAL" | "PARTITION_KEY_ID_ASC" | "PARTITION_KEY_ID_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "RETENTION_KEEP_TABLE_ASC" | "RETENTION_KEEP_TABLE_DESC" | "STRATEGY_ASC" | "STRATEGY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiOrderBy = "ANON_ROLE_ASC" | "ANON_ROLE_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DBNAME_ASC" | "DBNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_NAME_ASC" | "ROLE_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiModuleOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiSchemaOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiSettingOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformCorsSettingOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformDomainOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformDomainEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "DOMAIN_VERIFICATION_ID_ASC" | "DOMAIN_VERIFICATION_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformDomainVerificationOrderBy = "ATTEMPTS_ASC" | "ATTEMPTS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LAST_CHECKED_AT_ASC" | "LAST_CHECKED_AT_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECORD_NAME_ASC" | "RECORD_NAME_DESC" | "RECORD_TYPE_ASC" | "RECORD_TYPE_DESC" | "RECORD_VALUE_ASC" | "RECORD_VALUE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformManagedDomainOrderBy = "ALLOW_PUBLIC_USAGE_ASC" | "ALLOW_PUBLIC_USAGE_DESC" | "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CERT_STATUS_ASC" | "CERT_STATUS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformSiteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteMetadatumOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OG_IMAGE_ASC" | "OG_IMAGE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteModuleOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteThemeOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "THEME_ASC" | "THEME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PolicyOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "DISABLED_ASC" | "DISABLED_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PERMISSIVE_ASC" | "PERMISSIVE_DESC" | "POLICY_TYPE_ASC" | "POLICY_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITH_CHECK_ASC" | "WITH_CHECK_DESC"; -export type PrimaryKeyConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITHOUT_OVERLAPS_ASC" | "WITHOUT_OVERLAPS_DESC"; -export type PubkeySettingOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC" | "SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC" | "SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC" | "SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC" | "SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC" | "SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC" | "SIGN_UP_WITH_KEY_FUNCTION_ID_ASC" | "SIGN_UP_WITH_KEY_FUNCTION_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_FIELD_ASC" | "USER_FIELD_DESC"; -export type RlsSettingOrderBy = "AUTHENTICATE_FUNCTION_ID_ASC" | "AUTHENTICATE_FUNCTION_ID_DESC" | "AUTHENTICATE_SCHEMA_ID_ASC" | "AUTHENTICATE_SCHEMA_ID_DESC" | "AUTHENTICATE_STRICT_FUNCTION_ID_ASC" | "AUTHENTICATE_STRICT_FUNCTION_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CURRENT_IP_ADDRESS_FUNCTION_ID_ASC" | "CURRENT_IP_ADDRESS_FUNCTION_ID_DESC" | "CURRENT_ROLE_FUNCTION_ID_ASC" | "CURRENT_ROLE_FUNCTION_ID_DESC" | "CURRENT_ROLE_ID_FUNCTION_ID_ASC" | "CURRENT_ROLE_ID_FUNCTION_ID_DESC" | "CURRENT_USER_AGENT_FUNCTION_ID_ASC" | "CURRENT_USER_AGENT_FUNCTION_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_SCHEMA_ID_ASC" | "ROLE_SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type RouteBindingOrderBy = "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_API_ID_ASC" | "TARGET_API_ID_DESC" | "TARGET_FUNCTION_ID_ASC" | "TARGET_FUNCTION_ID_DESC" | "TARGET_SITE_ID_ASC" | "TARGET_SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type RouteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_API_ID_ASC" | "TARGET_API_ID_DESC" | "TARGET_FUNCTION_ID_ASC" | "TARGET_FUNCTION_ID_DESC" | "TARGET_SITE_ID_ASC" | "TARGET_SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SchemaOrderBy = "API_EXPOSURE_ASC" | "API_EXPOSURE_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLIC_ASC" | "IS_PUBLIC_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_NAME_ASC" | "SCHEMA_NAME_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SchemaGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteMetadatumOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OG_IMAGE_ASC" | "OG_IMAGE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteModuleOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteThemeOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "THEME_ASC" | "THEME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SpatialRelationOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPERATOR_ASC" | "OPERATOR_DESC" | "PARAM_NAME_ASC" | "PARAM_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_ID_ASC" | "REF_FIELD_ID_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SqlActionOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "DEPS_ASC" | "DEPS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; -export type TableOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INHERITS_ID_ASC" | "INHERITS_ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARTITIONED_ASC" | "PARTITIONED_DESC" | "PARTITION_KEY_NAMES_ASC" | "PARTITION_KEY_NAMES_DESC" | "PARTITION_KEY_TYPES_ASC" | "PARTITION_KEY_TYPES_DESC" | "PARTITION_STRATEGY_ASC" | "PARTITION_STRATEGY_DESC" | "PEOPLESTAMPS_ASC" | "PEOPLESTAMPS_DESC" | "PLURAL_NAME_ASC" | "PLURAL_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SINGULAR_NAME_ASC" | "SINGULAR_NAME_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "STEP_UP_ASC" | "STEP_UP_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TIMESTAMPS_ASC" | "TIMESTAMPS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USE_RLS_ASC" | "USE_RLS_DESC"; -export type TableGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type TriggerOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_ASC" | "EVENT_DESC" | "FUNCTION_NAME_ASC" | "FUNCTION_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type TriggerFunctionOrderBy = "CODE_ASC" | "CODE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type UniqueConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITHOUT_OVERLAPS_ASC" | "WITHOUT_OVERLAPS_DESC"; -export type ViewOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CHECK_OPTION_ASC" | "CHECK_OPTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "FILTER_DATA_ASC" | "FILTER_DATA_DESC" | "FILTER_TYPE_ASC" | "FILTER_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECURITY_BARRIER_ASC" | "SECURITY_BARRIER_DESC" | "SECURITY_INVOKER_ASC" | "SECURITY_INVOKER_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "VIEW_TYPE_ASC" | "VIEW_TYPE_DESC"; -export type ViewGrantOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC" | "WITH_GRANT_OPTION_ASC" | "WITH_GRANT_OPTION_DESC"; -export type ViewRuleOrderBy = "ACTION_ASC" | "ACTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_ASC" | "EVENT_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC"; -export type ViewTableOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOIN_ORDER_ASC" | "JOIN_ORDER_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC"; -export type WebauthnSettingOrderBy = "ATTESTATION_TYPE_ASC" | "ATTESTATION_TYPE_DESC" | "CHALLENGE_EXPIRY_SECONDS_ASC" | "CHALLENGE_EXPIRY_SECONDS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREDENTIALS_SCHEMA_ID_ASC" | "CREDENTIALS_SCHEMA_ID_DESC" | "CREDENTIALS_TABLE_ID_ASC" | "CREDENTIALS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORIGIN_ALLOWLIST_ASC" | "ORIGIN_ALLOWLIST_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRE_USER_VERIFICATION_ASC" | "REQUIRE_USER_VERIFICATION_DESC" | "RESIDENT_KEY_ASC" | "RESIDENT_KEY_DESC" | "RP_ID_ASC" | "RP_ID_DESC" | "RP_NAME_ASC" | "RP_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_SCHEMA_ID_ASC" | "SESSIONS_SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_SECRETS_SCHEMA_ID_ASC" | "SESSION_SECRETS_SCHEMA_ID_DESC" | "SESSION_SECRETS_TABLE_ID_ASC" | "SESSION_SECRETS_TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_FIELD_ID_ASC" | "USER_FIELD_ID_DESC"; +export type ApiOrderBy = + | 'ANON_ROLE_ASC' + | 'ANON_ROLE_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DBNAME_ASC' + | 'DBNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_NAME_ASC' + | 'ROLE_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiModuleOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiSchemaOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiSettingOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AstMigrationOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYS_ASC' + | 'DEPLOYS_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REQUIRES_ASC' + | 'REQUIRES_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; +export type CheckConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EXPR_ASC' + | 'EXPR_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type CompositeTypeOrderBy = + | 'ATTRIBUTES_ASC' + | 'ATTRIBUTES_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC'; +export type CorsSettingOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PLATFORM_ASC' + | 'PLATFORM_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_HASH_ASC' + | 'SCHEMA_HASH_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseSettingOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseTransferOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIATED_BY_ASC' + | 'INITIATED_BY_DESC' + | 'NATURAL' + | 'NOTES_ASC' + | 'NOTES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_APPROVED_ASC' + | 'SOURCE_APPROVED_AT_ASC' + | 'SOURCE_APPROVED_AT_DESC' + | 'SOURCE_APPROVED_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TARGET_APPROVED_ASC' + | 'TARGET_APPROVED_AT_ASC' + | 'TARGET_APPROVED_AT_DESC' + | 'TARGET_APPROVED_DESC' + | 'TARGET_OWNER_ID_ASC' + | 'TARGET_OWNER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DefaultPrivilegeOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'OBJECT_TYPE_ASC' + | 'OBJECT_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type DomainOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type DomainEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'DOMAIN_VERIFICATION_ID_ASC' + | 'DOMAIN_VERIFICATION_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DomainVerificationOrderBy = + | 'ATTEMPTS_ASC' + | 'ATTEMPTS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_CHECKED_AT_ASC' + | 'LAST_CHECKED_AT_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECORD_NAME_ASC' + | 'RECORD_NAME_DESC' + | 'RECORD_TYPE_ASC' + | 'RECORD_TYPE_DESC' + | 'RECORD_VALUE_ASC' + | 'RECORD_VALUE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type EmbeddingChunkOrderBy = + | 'CHUNKING_TASK_NAME_ASC' + | 'CHUNKING_TASK_NAME_DESC' + | 'CHUNKS_TABLE_ID_ASC' + | 'CHUNKS_TABLE_ID_DESC' + | 'CHUNKS_TABLE_NAME_ASC' + | 'CHUNKS_TABLE_NAME_DESC' + | 'CHUNK_OVERLAP_ASC' + | 'CHUNK_OVERLAP_DESC' + | 'CHUNK_SIZE_ASC' + | 'CHUNK_SIZE_DESC' + | 'CHUNK_STRATEGY_ASC' + | 'CHUNK_STRATEGY_DESC' + | 'CONTENT_FIELD_NAME_ASC' + | 'CONTENT_FIELD_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DIMENSIONS_ASC' + | 'DIMENSIONS_DESC' + | 'EMBEDDING_FIELD_ID_ASC' + | 'EMBEDDING_FIELD_ID_DESC' + | 'EMBEDDING_MODEL_ASC' + | 'EMBEDDING_MODEL_DESC' + | 'EMBEDDING_PROVIDER_ASC' + | 'EMBEDDING_PROVIDER_DESC' + | 'ENQUEUE_CHUNKING_JOB_ASC' + | 'ENQUEUE_CHUNKING_JOB_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'METADATA_FIELDS_ASC' + | 'METADATA_FIELDS_DESC' + | 'METRIC_ASC' + | 'METRIC_DESC' + | 'NATURAL' + | 'PARENT_FK_FIELD_ID_ASC' + | 'PARENT_FK_FIELD_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_INDEXES_ASC' + | 'SEARCH_INDEXES_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type EnumOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'VALUES_ASC' + | 'VALUES_DESC'; +export type ExclusionConstraintOrderBy = + | 'ACCESS_METHOD_ASC' + | 'ACCESS_METHOD_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ELEMENT_EXPR_ASC' + | 'ELEMENT_EXPR_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPERATORS_ASC' + | 'OPERATORS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WHERE_CLAUSE_ASC' + | 'WHERE_CLAUSE_DESC'; +export type FieldOrderBy = + | 'API_REQUIRED_ASC' + | 'API_REQUIRED_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CHK_ASC' + | 'CHK_DESC' + | 'CHK_EXPR_ASC' + | 'CHK_EXPR_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_VALUE_ASC' + | 'DEFAULT_VALUE_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_ORDER_ASC' + | 'FIELD_ORDER_DESC' + | 'GENERATION_EXPRESSION_ASC' + | 'GENERATION_EXPRESSION_DESC' + | 'GENERATION_TYPE_ASC' + | 'GENERATION_TYPE_DESC' + | 'IDENTITY_GENERATION_ASC' + | 'IDENTITY_GENERATION_DESC' + | 'IDENTITY_OPTIONS_ASC' + | 'IDENTITY_OPTIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_REQUIRED_ASC' + | 'IS_REQUIRED_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'MIN_ASC' + | 'MIN_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REGEXP_ASC' + | 'REGEXP_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ForeignKeyConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACTION_ASC' + | 'DELETE_ACTION_DESC' + | 'DELETE_SET_FIELD_IDS_ASC' + | 'DELETE_SET_FIELD_IDS_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_IDS_ASC' + | 'REF_FIELD_IDS_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATE_ACTION_ASC' + | 'UPDATE_ACTION_DESC' + | 'WITH_PERIOD_ASC' + | 'WITH_PERIOD_DESC'; +export type FullTextSearchOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LANGS_ASC' + | 'LANGS_DESC' + | 'LANG_COLUMN_ASC' + | 'LANG_COLUMN_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WEIGHTS_ASC' + | 'WEIGHTS_DESC'; +export type FunctionOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type HostnameBindingOrderBy = + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC'; +export type HttpRouteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_ID_ASC' + | 'TARGET_ID_DESC' + | 'TARGET_KIND_ASC' + | 'TARGET_KIND_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type IndexOrderBy = + | 'ACCESS_METHOD_ASC' + | 'ACCESS_METHOD_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INCLUDE_FIELD_IDS_ASC' + | 'INCLUDE_FIELD_IDS_DESC' + | 'INDEX_PARAMS_ASC' + | 'INDEX_PARAMS_DESC' + | 'IS_UNIQUE_ASC' + | 'IS_UNIQUE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'OP_CLASSES_ASC' + | 'OP_CLASSES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WHERE_CLAUSE_ASC' + | 'WHERE_CLAUSE_DESC'; +export type ManagedDomainOrderBy = + | 'ALLOW_PUBLIC_USAGE_ASC' + | 'ALLOW_PUBLIC_USAGE_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CERT_STATUS_ASC' + | 'CERT_STATUS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type NodeTypeRegistryOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMETER_SCHEMA_ASC' + | 'PARAMETER_SCHEMA_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC'; +export type PartitionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'IS_PARENTED_ASC' + | 'IS_PARENTED_DESC' + | 'NAMING_PATTERN_ASC' + | 'NAMING_PATTERN_DESC' + | 'NATURAL' + | 'PARTITION_KEY_ID_ASC' + | 'PARTITION_KEY_ID_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'RETENTION_KEEP_TABLE_ASC' + | 'RETENTION_KEEP_TABLE_DESC' + | 'STRATEGY_ASC' + | 'STRATEGY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiOrderBy = + | 'ANON_ROLE_ASC' + | 'ANON_ROLE_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DBNAME_ASC' + | 'DBNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_NAME_ASC' + | 'ROLE_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiModuleOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiSchemaOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiSettingOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformCorsSettingOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformDomainOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformDomainEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'DOMAIN_VERIFICATION_ID_ASC' + | 'DOMAIN_VERIFICATION_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformDomainVerificationOrderBy = + | 'ATTEMPTS_ASC' + | 'ATTEMPTS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_CHECKED_AT_ASC' + | 'LAST_CHECKED_AT_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECORD_NAME_ASC' + | 'RECORD_NAME_DESC' + | 'RECORD_TYPE_ASC' + | 'RECORD_TYPE_DESC' + | 'RECORD_VALUE_ASC' + | 'RECORD_VALUE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformManagedDomainOrderBy = + | 'ALLOW_PUBLIC_USAGE_ASC' + | 'ALLOW_PUBLIC_USAGE_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CERT_STATUS_ASC' + | 'CERT_STATUS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformSiteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteMetadatumOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OG_IMAGE_ASC' + | 'OG_IMAGE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteModuleOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteThemeOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'THEME_ASC' + | 'THEME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PolicyOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'DISABLED_ASC' + | 'DISABLED_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PERMISSIVE_ASC' + | 'PERMISSIVE_DESC' + | 'POLICY_TYPE_ASC' + | 'POLICY_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITH_CHECK_ASC' + | 'WITH_CHECK_DESC'; +export type PrimaryKeyConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITHOUT_OVERLAPS_ASC' + | 'WITHOUT_OVERLAPS_DESC'; +export type PubkeySettingOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC' + | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC' + | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC' + | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC' + | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC' + | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC' + | 'SIGN_UP_WITH_KEY_FUNCTION_ID_ASC' + | 'SIGN_UP_WITH_KEY_FUNCTION_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_FIELD_ASC' + | 'USER_FIELD_DESC'; +export type RlsSettingOrderBy = + | 'AUTHENTICATE_FUNCTION_ID_ASC' + | 'AUTHENTICATE_FUNCTION_ID_DESC' + | 'AUTHENTICATE_SCHEMA_ID_ASC' + | 'AUTHENTICATE_SCHEMA_ID_DESC' + | 'AUTHENTICATE_STRICT_FUNCTION_ID_ASC' + | 'AUTHENTICATE_STRICT_FUNCTION_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CURRENT_IP_ADDRESS_FUNCTION_ID_ASC' + | 'CURRENT_IP_ADDRESS_FUNCTION_ID_DESC' + | 'CURRENT_ROLE_FUNCTION_ID_ASC' + | 'CURRENT_ROLE_FUNCTION_ID_DESC' + | 'CURRENT_ROLE_ID_FUNCTION_ID_ASC' + | 'CURRENT_ROLE_ID_FUNCTION_ID_DESC' + | 'CURRENT_USER_AGENT_FUNCTION_ID_ASC' + | 'CURRENT_USER_AGENT_FUNCTION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_SCHEMA_ID_ASC' + | 'ROLE_SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type RouteBindingOrderBy = + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_API_ID_ASC' + | 'TARGET_API_ID_DESC' + | 'TARGET_FUNCTION_ID_ASC' + | 'TARGET_FUNCTION_ID_DESC' + | 'TARGET_SITE_ID_ASC' + | 'TARGET_SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type RouteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_API_ID_ASC' + | 'TARGET_API_ID_DESC' + | 'TARGET_FUNCTION_ID_ASC' + | 'TARGET_FUNCTION_ID_DESC' + | 'TARGET_SITE_ID_ASC' + | 'TARGET_SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SchemaOrderBy = + | 'API_EXPOSURE_ASC' + | 'API_EXPOSURE_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLIC_ASC' + | 'IS_PUBLIC_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_NAME_ASC' + | 'SCHEMA_NAME_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SchemaGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteMetadatumOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OG_IMAGE_ASC' + | 'OG_IMAGE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteModuleOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteThemeOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'THEME_ASC' + | 'THEME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SpatialRelationOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPERATOR_ASC' + | 'OPERATOR_DESC' + | 'PARAM_NAME_ASC' + | 'PARAM_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_ID_ASC' + | 'REF_FIELD_ID_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SqlActionOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'DEPS_ASC' + | 'DEPS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; +export type TableOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INHERITS_ID_ASC' + | 'INHERITS_ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARTITIONED_ASC' + | 'PARTITIONED_DESC' + | 'PARTITION_KEY_NAMES_ASC' + | 'PARTITION_KEY_NAMES_DESC' + | 'PARTITION_KEY_TYPES_ASC' + | 'PARTITION_KEY_TYPES_DESC' + | 'PARTITION_STRATEGY_ASC' + | 'PARTITION_STRATEGY_DESC' + | 'PEOPLESTAMPS_ASC' + | 'PEOPLESTAMPS_DESC' + | 'PLURAL_NAME_ASC' + | 'PLURAL_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SINGULAR_NAME_ASC' + | 'SINGULAR_NAME_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'STEP_UP_ASC' + | 'STEP_UP_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TIMESTAMPS_ASC' + | 'TIMESTAMPS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USE_RLS_ASC' + | 'USE_RLS_DESC'; +export type TableGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type TriggerOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'FUNCTION_NAME_ASC' + | 'FUNCTION_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type TriggerFunctionOrderBy = + | 'CODE_ASC' + | 'CODE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type UniqueConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITHOUT_OVERLAPS_ASC' + | 'WITHOUT_OVERLAPS_DESC'; +export type ViewOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CHECK_OPTION_ASC' + | 'CHECK_OPTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'FILTER_DATA_ASC' + | 'FILTER_DATA_DESC' + | 'FILTER_TYPE_ASC' + | 'FILTER_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECURITY_BARRIER_ASC' + | 'SECURITY_BARRIER_DESC' + | 'SECURITY_INVOKER_ASC' + | 'SECURITY_INVOKER_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'VIEW_TYPE_ASC' + | 'VIEW_TYPE_DESC'; +export type ViewGrantOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC' + | 'WITH_GRANT_OPTION_ASC' + | 'WITH_GRANT_OPTION_DESC'; +export type ViewRuleOrderBy = + | 'ACTION_ASC' + | 'ACTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC'; +export type ViewTableOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOIN_ORDER_ASC' + | 'JOIN_ORDER_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC'; +export type WebauthnSettingOrderBy = + | 'ATTESTATION_TYPE_ASC' + | 'ATTESTATION_TYPE_DESC' + | 'CHALLENGE_EXPIRY_SECONDS_ASC' + | 'CHALLENGE_EXPIRY_SECONDS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREDENTIALS_SCHEMA_ID_ASC' + | 'CREDENTIALS_SCHEMA_ID_DESC' + | 'CREDENTIALS_TABLE_ID_ASC' + | 'CREDENTIALS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORIGIN_ALLOWLIST_ASC' + | 'ORIGIN_ALLOWLIST_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRE_USER_VERIFICATION_ASC' + | 'REQUIRE_USER_VERIFICATION_DESC' + | 'RESIDENT_KEY_ASC' + | 'RESIDENT_KEY_DESC' + | 'RP_ID_ASC' + | 'RP_ID_DESC' + | 'RP_NAME_ASC' + | 'RP_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_SCHEMA_ID_ASC' + | 'SESSIONS_SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_SECRETS_SCHEMA_ID_ASC' + | 'SESSION_SECRETS_SCHEMA_ID_DESC' + | 'SESSION_SECRETS_TABLE_ID_ASC' + | 'SESSION_SECRETS_TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_FIELD_ID_ASC' + | 'USER_FIELD_ID_DESC'; // ============ CRUD Input Types ============ export interface CreateApiInput { clientMutationId?: string; @@ -8368,111 +10044,111 @@ export interface DeleteWebauthnSettingInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Api": { - "apiModules": "ApiModule", - "apiSchemas": "ApiSchema", - "corsSettings": "CorsSetting" + Api: { + apiModules: 'ApiModule', + apiSchemas: 'ApiSchema', + corsSettings: 'CorsSetting', }, - "Database": { - "checkConstraints": "CheckConstraint", - "compositeTypes": "CompositeType", - "databaseTransfers": "DatabaseTransfer", - "defaultPrivileges": "DefaultPrivilege", - "embeddingChunks": "EmbeddingChunk", - "enums": "Enum", - "exclusionConstraints": "ExclusionConstraint", - "fields": "Field", - "foreignKeyConstraints": "ForeignKeyConstraint", - "fullTextSearches": "FullTextSearch", - "functions": "Function", - "indices": "Index", - "partitions": "Partition", - "policies": "Policy", - "primaryKeyConstraints": "PrimaryKeyConstraint", - "schemaGrants": "SchemaGrant", - "schemas": "Schema", - "spatialRelations": "SpatialRelation", - "tableGrants": "TableGrant", - "tables": "Table", - "triggerFunctions": "TriggerFunction", - "triggers": "Trigger", - "uniqueConstraints": "UniqueConstraint", - "viewGrants": "ViewGrant", - "viewRules": "ViewRule", - "viewTables": "ViewTable", - "views": "View" + Database: { + checkConstraints: 'CheckConstraint', + compositeTypes: 'CompositeType', + databaseTransfers: 'DatabaseTransfer', + defaultPrivileges: 'DefaultPrivilege', + embeddingChunks: 'EmbeddingChunk', + enums: 'Enum', + exclusionConstraints: 'ExclusionConstraint', + fields: 'Field', + foreignKeyConstraints: 'ForeignKeyConstraint', + fullTextSearches: 'FullTextSearch', + functions: 'Function', + indices: 'Index', + partitions: 'Partition', + policies: 'Policy', + primaryKeyConstraints: 'PrimaryKeyConstraint', + schemaGrants: 'SchemaGrant', + schemas: 'Schema', + spatialRelations: 'SpatialRelation', + tableGrants: 'TableGrant', + tables: 'Table', + triggerFunctions: 'TriggerFunction', + triggers: 'Trigger', + uniqueConstraints: 'UniqueConstraint', + viewGrants: 'ViewGrant', + viewRules: 'ViewRule', + viewTables: 'ViewTable', + views: 'View', }, - "Domain": { - "domainEvents": "DomainEvent", - "domainVerifications": "DomainVerification", - "httpRoutes": "HttpRoute", - "routes": "Route" + Domain: { + domainEvents: 'DomainEvent', + domainVerifications: 'DomainVerification', + httpRoutes: 'HttpRoute', + routes: 'Route', }, - "Field": { - "spatialRelations": "SpatialRelation", - "spatialRelationsByRefFieldId": "SpatialRelation" + Field: { + spatialRelations: 'SpatialRelation', + spatialRelationsByRefFieldId: 'SpatialRelation', }, - "ManagedDomain": { - "domainEvents": "DomainEvent", - "domainVerifications": "DomainVerification" + ManagedDomain: { + domainEvents: 'DomainEvent', + domainVerifications: 'DomainVerification', }, - "PlatformApi": { - "platformApiModulesByApiId": "PlatformApiModule", - "platformApiSchemasByApiId": "PlatformApiSchema" + PlatformApi: { + platformApiModulesByApiId: 'PlatformApiModule', + platformApiSchemasByApiId: 'PlatformApiSchema', }, - "PlatformDomain": { - "platformDomainEventsByDomainId": "PlatformDomainEvent", - "platformDomainVerificationsByDomainId": "PlatformDomainVerification" + PlatformDomain: { + platformDomainEventsByDomainId: 'PlatformDomainEvent', + platformDomainVerificationsByDomainId: 'PlatformDomainVerification', }, - "PlatformManagedDomain": { - "platformDomainEventsByManagedDomainId": "PlatformDomainEvent", - "platformDomainVerificationsByManagedDomainId": "PlatformDomainVerification" + PlatformManagedDomain: { + platformDomainEventsByManagedDomainId: 'PlatformDomainEvent', + platformDomainVerificationsByManagedDomainId: 'PlatformDomainVerification', }, - "PlatformSite": { - "platformSiteMetadataBySiteId": "PlatformSiteMetadatum", - "platformSiteModulesBySiteId": "PlatformSiteModule", - "platformSiteThemesBySiteId": "PlatformSiteTheme" + PlatformSite: { + platformSiteMetadataBySiteId: 'PlatformSiteMetadatum', + platformSiteModulesBySiteId: 'PlatformSiteModule', + platformSiteThemesBySiteId: 'PlatformSiteTheme', }, - "Schema": { - "apiSchemas": "ApiSchema", - "compositeTypes": "CompositeType", - "defaultPrivileges": "DefaultPrivilege", - "enums": "Enum", - "functions": "Function", - "platformApiSchemas": "PlatformApiSchema", - "schemaGrants": "SchemaGrant", - "tables": "Table", - "views": "View" + Schema: { + apiSchemas: 'ApiSchema', + compositeTypes: 'CompositeType', + defaultPrivileges: 'DefaultPrivilege', + enums: 'Enum', + functions: 'Function', + platformApiSchemas: 'PlatformApiSchema', + schemaGrants: 'SchemaGrant', + tables: 'Table', + views: 'View', }, - "Site": { - "siteMetadata": "SiteMetadatum", - "siteModules": "SiteModule", - "siteThemes": "SiteTheme" + Site: { + siteMetadata: 'SiteMetadatum', + siteModules: 'SiteModule', + siteThemes: 'SiteTheme', }, - "Table": { - "checkConstraints": "CheckConstraint", - "embeddingChunks": "EmbeddingChunk", - "embeddingChunksByChunksTableId": "EmbeddingChunk", - "exclusionConstraints": "ExclusionConstraint", - "fields": "Field", - "foreignKeyConstraints": "ForeignKeyConstraint", - "fullTextSearches": "FullTextSearch", - "indices": "Index", - "policies": "Policy", - "primaryKeyConstraints": "PrimaryKeyConstraint", - "spatialRelations": "SpatialRelation", - "spatialRelationsByRefTableId": "SpatialRelation", - "tableGrants": "TableGrant", - "triggers": "Trigger", - "uniqueConstraints": "UniqueConstraint", - "viewTables": "ViewTable", - "views": "View" + Table: { + checkConstraints: 'CheckConstraint', + embeddingChunks: 'EmbeddingChunk', + embeddingChunksByChunksTableId: 'EmbeddingChunk', + exclusionConstraints: 'ExclusionConstraint', + fields: 'Field', + foreignKeyConstraints: 'ForeignKeyConstraint', + fullTextSearches: 'FullTextSearch', + indices: 'Index', + policies: 'Policy', + primaryKeyConstraints: 'PrimaryKeyConstraint', + spatialRelations: 'SpatialRelation', + spatialRelationsByRefTableId: 'SpatialRelation', + tableGrants: 'TableGrant', + triggers: 'Trigger', + uniqueConstraints: 'UniqueConstraint', + viewTables: 'ViewTable', + views: 'View', + }, + View: { + viewGrants: 'ViewGrant', + viewRules: 'ViewRule', + viewTables: 'ViewTable', }, - "View": { - "viewGrants": "ViewGrant", - "viewRules": "ViewRule", - "viewTables": "ViewTable" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface AcceptDatabaseTransferInput { @@ -16831,4 +18507,4 @@ export type WebauthnSettingEdgeSelect = { node?: { select: WebauthnSettingSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/api/orm/models/api.ts b/sdk/constructive-cli/src/api/orm/models/api.ts index 6a90777ca7..4d60695731 100644 --- a/sdk/constructive-cli/src/api/orm/models/api.ts +++ b/sdk/constructive-cli/src/api/orm/models/api.ts @@ -3,56 +3,96 @@ * @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 { Api, ApiWithRelations, ApiSelect, ApiFilter, ApiOrderBy, CreateApiInput, UpdateApiInput, ApiPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Api, + ApiWithRelations, + ApiSelect, + ApiFilter, + ApiOrderBy, + CreateApiInput, + UpdateApiInput, + ApiPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apis: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Api", "apis", 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 - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Api', + 'apis', + 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, + }, + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "apis", + operation: 'query', + operationName: 'Api', + fieldName: 'apis', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ api: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Api", "apis", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Api', + 'apis', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "api", + operation: 'query', + operationName: 'Api', + fieldName: 'api', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "api": data.apis?.nodes?.[0] ?? null - }) + api: data.apis?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ api: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Api", "apis", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Api', + 'apis', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "api", + operation: 'query', + operationName: 'Api', + fieldName: 'api', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "api": data.apis?.nodes?.[0] ?? null - }) + api: data.apis?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Api", "createApi", "api", args.select, args.data, "CreateApiInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Api', + 'createApi', + 'api', + args.select, + args.data, + 'CreateApiInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "createApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'createApi', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Api", "updateApi", "api", args.select, args.where.id, args.data, "UpdateApiInput", "id", "apiPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Api', + 'updateApi', + 'api', + args.select, + args.where.id, + args.data, + 'UpdateApiInput', + 'id', + 'apiPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "updateApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'updateApi', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Api", "deleteApi", "api", { - id: args.where.id - }, "DeleteApiInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Api', + 'deleteApi', + 'api', + { + id: args.where.id, + }, + 'DeleteApiInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "deleteApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'deleteApi', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/apiModule.ts b/sdk/constructive-cli/src/api/orm/models/apiModule.ts index ac4485467d..dd9bb29f76 100644 --- a/sdk/constructive-cli/src/api/orm/models/apiModule.ts +++ b/sdk/constructive-cli/src/api/orm/models/apiModule.ts @@ -3,56 +3,96 @@ * @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 { ApiModule, ApiModuleWithRelations, ApiModuleSelect, ApiModuleFilter, ApiModuleOrderBy, CreateApiModuleInput, UpdateApiModuleInput, ApiModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiModule, + ApiModuleWithRelations, + ApiModuleSelect, + ApiModuleFilter, + ApiModuleOrderBy, + CreateApiModuleInput, + UpdateApiModuleInput, + ApiModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiModule", "apiModules", 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 - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiModule', + 'apiModules', + 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, + }, + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModules", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiModule", "apiModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiModule', + 'apiModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModule", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiModule": data.apiModules?.nodes?.[0] ?? null - }) + apiModule: data.apiModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiModule", "apiModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiModule', + 'apiModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModule", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiModule": data.apiModules?.nodes?.[0] ?? null - }) + apiModule: data.apiModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiModule", "createApiModule", "apiModule", args.select, args.data, "CreateApiModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiModule', + 'createApiModule', + 'apiModule', + args.select, + args.data, + 'CreateApiModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "createApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'createApiModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiModule", "updateApiModule", "apiModule", args.select, args.where.id, args.data, "UpdateApiModuleInput", "id", "apiModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiModule', + 'updateApiModule', + 'apiModule', + args.select, + args.where.id, + args.data, + 'UpdateApiModuleInput', + 'id', + 'apiModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "updateApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'updateApiModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiModule", "deleteApiModule", "apiModule", { - id: args.where.id - }, "DeleteApiModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiModule', + 'deleteApiModule', + 'apiModule', + { + id: args.where.id, + }, + 'DeleteApiModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "deleteApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'deleteApiModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/apiSchema.ts b/sdk/constructive-cli/src/api/orm/models/apiSchema.ts index 2545e4014a..2179728a2b 100644 --- a/sdk/constructive-cli/src/api/orm/models/apiSchema.ts +++ b/sdk/constructive-cli/src/api/orm/models/apiSchema.ts @@ -3,56 +3,96 @@ * @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 { ApiSchema, ApiSchemaWithRelations, ApiSchemaSelect, ApiSchemaFilter, ApiSchemaOrderBy, CreateApiSchemaInput, UpdateApiSchemaInput, ApiSchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSchema, + ApiSchemaWithRelations, + ApiSchemaSelect, + ApiSchemaFilter, + ApiSchemaOrderBy, + CreateApiSchemaInput, + UpdateApiSchemaInput, + ApiSchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSchema", "apiSchemas", 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 - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSchema', + 'apiSchemas', + 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, + }, + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchemas", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSchema", "apiSchemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSchema', + 'apiSchemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchema", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSchema": data.apiSchemas?.nodes?.[0] ?? null - }) + apiSchema: data.apiSchemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSchema", "apiSchemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSchema', + 'apiSchemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchema", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSchema": data.apiSchemas?.nodes?.[0] ?? null - }) + apiSchema: data.apiSchemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSchema", "createApiSchema", "apiSchema", args.select, args.data, "CreateApiSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSchema', + 'createApiSchema', + 'apiSchema', + args.select, + args.data, + 'CreateApiSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "createApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'createApiSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSchema", "updateApiSchema", "apiSchema", args.select, args.where.id, args.data, "UpdateApiSchemaInput", "id", "apiSchemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSchema', + 'updateApiSchema', + 'apiSchema', + args.select, + args.where.id, + args.data, + 'UpdateApiSchemaInput', + 'id', + 'apiSchemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "updateApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'updateApiSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSchema", "deleteApiSchema", "apiSchema", { - id: args.where.id - }, "DeleteApiSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSchema', + 'deleteApiSchema', + 'apiSchema', + { + id: args.where.id, + }, + 'DeleteApiSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "deleteApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'deleteApiSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/apiSetting.ts b/sdk/constructive-cli/src/api/orm/models/apiSetting.ts index b2ba66ae85..01f1b5b74e 100644 --- a/sdk/constructive-cli/src/api/orm/models/apiSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/apiSetting.ts @@ -3,56 +3,96 @@ * @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 { ApiSetting, ApiSettingWithRelations, ApiSettingSelect, ApiSettingFilter, ApiSettingOrderBy, CreateApiSettingInput, UpdateApiSettingInput, ApiSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSetting, + ApiSettingWithRelations, + ApiSettingSelect, + ApiSettingFilter, + ApiSettingOrderBy, + CreateApiSettingInput, + UpdateApiSettingInput, + ApiSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSetting", "apiSettings", 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 - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSetting', + 'apiSettings', + 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, + }, + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSettings", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSetting", "apiSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSetting', + 'apiSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSetting", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSetting": data.apiSettings?.nodes?.[0] ?? null - }) + apiSetting: data.apiSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSetting", "apiSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSetting', + 'apiSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSetting", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSetting": data.apiSettings?.nodes?.[0] ?? null - }) + apiSetting: data.apiSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSetting", "createApiSetting", "apiSetting", args.select, args.data, "CreateApiSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSetting', + 'createApiSetting', + 'apiSetting', + args.select, + args.data, + 'CreateApiSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "createApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'createApiSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSetting", "updateApiSetting", "apiSetting", args.select, args.where.id, args.data, "UpdateApiSettingInput", "id", "apiSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSetting', + 'updateApiSetting', + 'apiSetting', + args.select, + args.where.id, + args.data, + 'UpdateApiSettingInput', + 'id', + 'apiSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "updateApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'updateApiSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSetting", "deleteApiSetting", "apiSetting", { - id: args.where.id - }, "DeleteApiSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSetting', + 'deleteApiSetting', + 'apiSetting', + { + id: args.where.id, + }, + 'DeleteApiSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "deleteApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'deleteApiSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/astMigration.ts b/sdk/constructive-cli/src/api/orm/models/astMigration.ts index b6f4db557f..bfcc5f455a 100644 --- a/sdk/constructive-cli/src/api/orm/models/astMigration.ts +++ b/sdk/constructive-cli/src/api/orm/models/astMigration.ts @@ -3,56 +3,96 @@ * @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 { AstMigration, AstMigrationWithRelations, AstMigrationSelect, AstMigrationFilter, AstMigrationOrderBy, CreateAstMigrationInput, UpdateAstMigrationInput, AstMigrationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AstMigration, + AstMigrationWithRelations, + AstMigrationSelect, + AstMigrationFilter, + AstMigrationOrderBy, + CreateAstMigrationInput, + UpdateAstMigrationInput, + AstMigrationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AstMigrationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigrations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AstMigration", "astMigrations", 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 - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AstMigration', + 'astMigrations', + 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, + }, + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigrations", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigrations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigration: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AstMigration", "astMigrations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AstMigration', + 'astMigrations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigration", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigration', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AstMigrationModel { nodes?: InferSelectResult[]; }; }) => ({ - "astMigration": data.astMigrations?.nodes?.[0] ?? null - }) + astMigration: data.astMigrations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigration: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AstMigration", "astMigrations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AstMigration', + 'astMigrations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigration", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigration', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class AstMigrationModel { nodes?: InferSelectResult[]; }; }) => ({ - "astMigration": data.astMigrations?.nodes?.[0] ?? null - }) + astMigration: data.astMigrations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAstMigration: { astMigration: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AstMigration", "createAstMigration", "astMigration", args.select, args.data, "CreateAstMigrationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AstMigration', + 'createAstMigration', + 'astMigration', + args.select, + args.data, + 'CreateAstMigrationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AstMigration", - fieldName: "createAstMigration", + operation: 'mutation', + operationName: 'AstMigration', + fieldName: 'createAstMigration', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/checkConstraint.ts b/sdk/constructive-cli/src/api/orm/models/checkConstraint.ts index 2683f316fc..7f6054e6a4 100644 --- a/sdk/constructive-cli/src/api/orm/models/checkConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/checkConstraint.ts @@ -3,56 +3,96 @@ * @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 { CheckConstraint, CheckConstraintWithRelations, CheckConstraintSelect, CheckConstraintFilter, CheckConstraintOrderBy, CreateCheckConstraintInput, UpdateCheckConstraintInput, CheckConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CheckConstraint, + CheckConstraintWithRelations, + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy, + CreateCheckConstraintInput, + UpdateCheckConstraintInput, + CheckConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CheckConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CheckConstraint", "checkConstraints", 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 - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CheckConstraint', + 'checkConstraints', + 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, + }, + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraints", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CheckConstraint", "checkConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CheckConstraint', + 'checkConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraint", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CheckConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "checkConstraint": data.checkConstraints?.nodes?.[0] ?? null - }) + checkConstraint: data.checkConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CheckConstraint", "checkConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CheckConstraint', + 'checkConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraint", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CheckConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "checkConstraint": data.checkConstraints?.nodes?.[0] ?? null - }) + checkConstraint: data.checkConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CheckConstraint", "createCheckConstraint", "checkConstraint", args.select, args.data, "CreateCheckConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CheckConstraint', + 'createCheckConstraint', + 'checkConstraint', + args.select, + args.data, + 'CreateCheckConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "createCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'createCheckConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CheckConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CheckConstraint", "updateCheckConstraint", "checkConstraint", args.select, args.where.id, args.data, "UpdateCheckConstraintInput", "id", "checkConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CheckConstraint', + 'updateCheckConstraint', + 'checkConstraint', + args.select, + args.where.id, + args.data, + 'UpdateCheckConstraintInput', + 'id', + 'checkConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "updateCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'updateCheckConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CheckConstraint", "deleteCheckConstraint", "checkConstraint", { - id: args.where.id - }, "DeleteCheckConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CheckConstraint', + 'deleteCheckConstraint', + 'checkConstraint', + { + id: args.where.id, + }, + 'DeleteCheckConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "deleteCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'deleteCheckConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/compositeType.ts b/sdk/constructive-cli/src/api/orm/models/compositeType.ts index b9da115bea..72f4ab3adf 100644 --- a/sdk/constructive-cli/src/api/orm/models/compositeType.ts +++ b/sdk/constructive-cli/src/api/orm/models/compositeType.ts @@ -3,56 +3,96 @@ * @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 { CompositeType, CompositeTypeWithRelations, CompositeTypeSelect, CompositeTypeFilter, CompositeTypeOrderBy, CreateCompositeTypeInput, UpdateCompositeTypeInput, CompositeTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CompositeType, + CompositeTypeWithRelations, + CompositeTypeSelect, + CompositeTypeFilter, + CompositeTypeOrderBy, + CreateCompositeTypeInput, + UpdateCompositeTypeInput, + CompositeTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CompositeTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CompositeType", "compositeTypes", 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 - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CompositeType', + 'compositeTypes', + 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, + }, + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeTypes", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CompositeType", "compositeTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CompositeType', + 'compositeTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeType", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CompositeTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "compositeType": data.compositeTypes?.nodes?.[0] ?? null - }) + compositeType: data.compositeTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CompositeType", "compositeTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CompositeType', + 'compositeTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeType", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CompositeTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "compositeType": data.compositeTypes?.nodes?.[0] ?? null - }) + compositeType: data.compositeTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CompositeType", "createCompositeType", "compositeType", args.select, args.data, "CreateCompositeTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CompositeType', + 'createCompositeType', + 'compositeType', + args.select, + args.data, + 'CreateCompositeTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "createCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'createCompositeType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CompositeTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CompositeType", "updateCompositeType", "compositeType", args.select, args.where.id, args.data, "UpdateCompositeTypeInput", "id", "compositeTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CompositeType', + 'updateCompositeType', + 'compositeType', + args.select, + args.where.id, + args.data, + 'UpdateCompositeTypeInput', + 'id', + 'compositeTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "updateCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'updateCompositeType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CompositeType", "deleteCompositeType", "compositeType", { - id: args.where.id - }, "DeleteCompositeTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CompositeType', + 'deleteCompositeType', + 'compositeType', + { + id: args.where.id, + }, + 'DeleteCompositeTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "deleteCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'deleteCompositeType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/corsSetting.ts b/sdk/constructive-cli/src/api/orm/models/corsSetting.ts index 27feb0bf5a..2e37465f00 100644 --- a/sdk/constructive-cli/src/api/orm/models/corsSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/corsSetting.ts @@ -3,56 +3,96 @@ * @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 { CorsSetting, CorsSettingWithRelations, CorsSettingSelect, CorsSettingFilter, CorsSettingOrderBy, CreateCorsSettingInput, UpdateCorsSettingInput, CorsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CorsSetting, + CorsSettingWithRelations, + CorsSettingSelect, + CorsSettingFilter, + CorsSettingOrderBy, + CreateCorsSettingInput, + UpdateCorsSettingInput, + CorsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CorsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CorsSetting", "corsSettings", 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 - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CorsSetting', + 'corsSettings', + 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, + }, + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSettings", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CorsSetting", "corsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CorsSetting', + 'corsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSetting", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "corsSetting": data.corsSettings?.nodes?.[0] ?? null - }) + corsSetting: data.corsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CorsSetting", "corsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CorsSetting', + 'corsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSetting", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "corsSetting": data.corsSettings?.nodes?.[0] ?? null - }) + corsSetting: data.corsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CorsSetting", "createCorsSetting", "corsSetting", args.select, args.data, "CreateCorsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CorsSetting', + 'createCorsSetting', + 'corsSetting', + args.select, + args.data, + 'CreateCorsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "createCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'createCorsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CorsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CorsSetting", "updateCorsSetting", "corsSetting", args.select, args.where.id, args.data, "UpdateCorsSettingInput", "id", "corsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CorsSetting', + 'updateCorsSetting', + 'corsSetting', + args.select, + args.where.id, + args.data, + 'UpdateCorsSettingInput', + 'id', + 'corsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "updateCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'updateCorsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CorsSetting", "deleteCorsSetting", "corsSetting", { - id: args.where.id - }, "DeleteCorsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CorsSetting', + 'deleteCorsSetting', + 'corsSetting', + { + id: args.where.id, + }, + 'DeleteCorsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "deleteCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'deleteCorsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/database.ts b/sdk/constructive-cli/src/api/orm/models/database.ts index 4ce0f8c1b5..41c99ba120 100644 --- a/sdk/constructive-cli/src/api/orm/models/database.ts +++ b/sdk/constructive-cli/src/api/orm/models/database.ts @@ -3,56 +3,96 @@ * @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 { Database, DatabaseWithRelations, DatabaseSelect, DatabaseFilter, DatabaseOrderBy, CreateDatabaseInput, UpdateDatabaseInput, DatabasePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Database, + DatabaseWithRelations, + DatabaseSelect, + DatabaseFilter, + DatabaseOrderBy, + CreateDatabaseInput, + UpdateDatabaseInput, + DatabasePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databases: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Database", "databases", 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 - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Database', + 'databases', + 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, + }, + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "databases", + operation: 'query', + operationName: 'Database', + fieldName: 'databases', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ database: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Database", "databases", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Database', + 'databases', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "database", + operation: 'query', + operationName: 'Database', + fieldName: 'database', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseModel { nodes?: InferSelectResult[]; }; }) => ({ - "database": data.databases?.nodes?.[0] ?? null - }) + database: data.databases?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ database: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Database", "databases", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Database', + 'databases', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "database", + operation: 'query', + operationName: 'Database', + fieldName: 'database', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseModel { nodes?: InferSelectResult[]; }; }) => ({ - "database": data.databases?.nodes?.[0] ?? null - }) + database: data.databases?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Database", "createDatabase", "database", args.select, args.data, "CreateDatabaseInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Database', + 'createDatabase', + 'database', + args.select, + args.data, + 'CreateDatabaseInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "createDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'createDatabase', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabasePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Database", "updateDatabase", "database", args.select, args.where.id, args.data, "UpdateDatabaseInput", "id", "databasePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Database', + 'updateDatabase', + 'database', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseInput', + 'id', + 'databasePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "updateDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'updateDatabase', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Database", "deleteDatabase", "database", { - id: args.where.id - }, "DeleteDatabaseInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Database', + 'deleteDatabase', + 'database', + { + id: args.where.id, + }, + 'DeleteDatabaseInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "deleteDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'deleteDatabase', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/databaseSetting.ts b/sdk/constructive-cli/src/api/orm/models/databaseSetting.ts index 8060f8c85d..6743fdbdc2 100644 --- a/sdk/constructive-cli/src/api/orm/models/databaseSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/databaseSetting.ts @@ -3,56 +3,96 @@ * @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 { DatabaseSetting, DatabaseSettingWithRelations, DatabaseSettingSelect, DatabaseSettingFilter, DatabaseSettingOrderBy, CreateDatabaseSettingInput, UpdateDatabaseSettingInput, DatabaseSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseSetting, + DatabaseSettingWithRelations, + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy, + CreateDatabaseSettingInput, + UpdateDatabaseSettingInput, + DatabaseSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSetting", "databaseSettings", 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 - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseSetting', + 'databaseSettings', + 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, + }, + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSettings", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseSetting", "databaseSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseSetting', + 'databaseSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSetting", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSetting": data.databaseSettings?.nodes?.[0] ?? null - }) + databaseSetting: data.databaseSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSetting", "databaseSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseSetting', + 'databaseSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSetting", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSetting": data.databaseSettings?.nodes?.[0] ?? null - }) + databaseSetting: data.databaseSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseSetting", "createDatabaseSetting", "databaseSetting", args.select, args.data, "CreateDatabaseSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseSetting', + 'createDatabaseSetting', + 'databaseSetting', + args.select, + args.data, + 'CreateDatabaseSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "createDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'createDatabaseSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseSetting", "updateDatabaseSetting", "databaseSetting", args.select, args.where.id, args.data, "UpdateDatabaseSettingInput", "id", "databaseSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseSetting', + 'updateDatabaseSetting', + 'databaseSetting', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseSettingInput', + 'id', + 'databaseSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "updateDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'updateDatabaseSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseSetting", "deleteDatabaseSetting", "databaseSetting", { - id: args.where.id - }, "DeleteDatabaseSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseSetting', + 'deleteDatabaseSetting', + 'databaseSetting', + { + id: args.where.id, + }, + 'DeleteDatabaseSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "deleteDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'deleteDatabaseSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/databaseTransfer.ts b/sdk/constructive-cli/src/api/orm/models/databaseTransfer.ts index 76caea1f6d..9260ed2fb7 100644 --- a/sdk/constructive-cli/src/api/orm/models/databaseTransfer.ts +++ b/sdk/constructive-cli/src/api/orm/models/databaseTransfer.ts @@ -3,56 +3,96 @@ * @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 { DatabaseTransfer, DatabaseTransferWithRelations, DatabaseTransferSelect, DatabaseTransferFilter, DatabaseTransferOrderBy, CreateDatabaseTransferInput, UpdateDatabaseTransferInput, DatabaseTransferPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseTransfer, + DatabaseTransferWithRelations, + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy, + CreateDatabaseTransferInput, + UpdateDatabaseTransferInput, + DatabaseTransferPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseTransferModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseTransfer", "databaseTransfers", 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 - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseTransfer', + 'databaseTransfers', + 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, + }, + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfers", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfer: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseTransfer", "databaseTransfers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseTransfer', + 'databaseTransfers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfer", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfer', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseTransferModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseTransfer": data.databaseTransfers?.nodes?.[0] ?? null - }) + databaseTransfer: data.databaseTransfers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfer: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseTransfer", "databaseTransfers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseTransfer', + 'databaseTransfers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfer", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfer', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseTransferModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseTransfer": data.databaseTransfers?.nodes?.[0] ?? null - }) + databaseTransfer: data.databaseTransfers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseTransfer", "createDatabaseTransfer", "databaseTransfer", args.select, args.data, "CreateDatabaseTransferInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseTransfer', + 'createDatabaseTransfer', + 'databaseTransfer', + args.select, + args.data, + 'CreateDatabaseTransferInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "createDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'createDatabaseTransfer', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseTransferPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseTransfer", "updateDatabaseTransfer", "databaseTransfer", args.select, args.where.id, args.data, "UpdateDatabaseTransferInput", "id", "databaseTransferPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseTransfer', + 'updateDatabaseTransfer', + 'databaseTransfer', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseTransferInput', + 'id', + 'databaseTransferPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "updateDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'updateDatabaseTransfer', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseTransfer", "deleteDatabaseTransfer", "databaseTransfer", { - id: args.where.id - }, "DeleteDatabaseTransferInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseTransfer', + 'deleteDatabaseTransfer', + 'databaseTransfer', + { + id: args.where.id, + }, + 'DeleteDatabaseTransferInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "deleteDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'deleteDatabaseTransfer', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/defaultPrivilege.ts b/sdk/constructive-cli/src/api/orm/models/defaultPrivilege.ts index dc42720521..8d964bf6a4 100644 --- a/sdk/constructive-cli/src/api/orm/models/defaultPrivilege.ts +++ b/sdk/constructive-cli/src/api/orm/models/defaultPrivilege.ts @@ -3,56 +3,96 @@ * @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 { DefaultPrivilege, DefaultPrivilegeWithRelations, DefaultPrivilegeSelect, DefaultPrivilegeFilter, DefaultPrivilegeOrderBy, CreateDefaultPrivilegeInput, UpdateDefaultPrivilegeInput, DefaultPrivilegePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DefaultPrivilege, + DefaultPrivilegeWithRelations, + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy, + CreateDefaultPrivilegeInput, + UpdateDefaultPrivilegeInput, + DefaultPrivilegePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DefaultPrivilegeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivileges: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultPrivilege", "defaultPrivileges", 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 - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + 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, + }, + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivileges", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivileges', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivilege: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DefaultPrivilege", "defaultPrivileges", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivilege", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivilege', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DefaultPrivilegeModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultPrivilege": data.defaultPrivileges?.nodes?.[0] ?? null - }) + defaultPrivilege: data.defaultPrivileges?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivilege: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultPrivilege", "defaultPrivileges", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivilege", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivilege', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DefaultPrivilegeModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultPrivilege": data.defaultPrivileges?.nodes?.[0] ?? null - }) + defaultPrivilege: data.defaultPrivileges?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DefaultPrivilege", "createDefaultPrivilege", "defaultPrivilege", args.select, args.data, "CreateDefaultPrivilegeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DefaultPrivilege', + 'createDefaultPrivilege', + 'defaultPrivilege', + args.select, + args.data, + 'CreateDefaultPrivilegeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "createDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'createDefaultPrivilege', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DefaultPrivilegePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DefaultPrivilege", "updateDefaultPrivilege", "defaultPrivilege", args.select, args.where.id, args.data, "UpdateDefaultPrivilegeInput", "id", "defaultPrivilegePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DefaultPrivilege', + 'updateDefaultPrivilege', + 'defaultPrivilege', + args.select, + args.where.id, + args.data, + 'UpdateDefaultPrivilegeInput', + 'id', + 'defaultPrivilegePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "updateDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'updateDefaultPrivilege', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DefaultPrivilege", "deleteDefaultPrivilege", "defaultPrivilege", { - id: args.where.id - }, "DeleteDefaultPrivilegeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DefaultPrivilege', + 'deleteDefaultPrivilege', + 'defaultPrivilege', + { + id: args.where.id, + }, + 'DeleteDefaultPrivilegeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "deleteDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'deleteDefaultPrivilege', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/domain.ts b/sdk/constructive-cli/src/api/orm/models/domain.ts index 1576b5451f..d5d807ae4c 100644 --- a/sdk/constructive-cli/src/api/orm/models/domain.ts +++ b/sdk/constructive-cli/src/api/orm/models/domain.ts @@ -3,56 +3,96 @@ * @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 { Domain, DomainWithRelations, DomainSelect, DomainFilter, DomainOrderBy, CreateDomainInput, UpdateDomainInput, DomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Domain, + DomainWithRelations, + DomainSelect, + DomainFilter, + DomainOrderBy, + CreateDomainInput, + UpdateDomainInput, + DomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Domain", "domains", 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 - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Domain', + 'domains', + 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, + }, + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domains", + operation: 'query', + operationName: 'Domain', + fieldName: 'domains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Domain", "domains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Domain', + 'domains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domain", + operation: 'query', + operationName: 'Domain', + fieldName: 'domain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "domain": data.domains?.nodes?.[0] ?? null - }) + domain: data.domains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Domain", "domains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Domain', + 'domains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domain", + operation: 'query', + operationName: 'Domain', + fieldName: 'domain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "domain": data.domains?.nodes?.[0] ?? null - }) + domain: data.domains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Domain", "createDomain", "domain", args.select, args.data, "CreateDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Domain', + 'createDomain', + 'domain', + args.select, + args.data, + 'CreateDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "createDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'createDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Domain", "updateDomain", "domain", args.select, args.where.id, args.data, "UpdateDomainInput", "id", "domainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Domain', + 'updateDomain', + 'domain', + args.select, + args.where.id, + args.data, + 'UpdateDomainInput', + 'id', + 'domainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "updateDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'updateDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Domain", "deleteDomain", "domain", { - id: args.where.id - }, "DeleteDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Domain', + 'deleteDomain', + 'domain', + { + id: args.where.id, + }, + 'DeleteDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "deleteDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'deleteDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/domainEvent.ts b/sdk/constructive-cli/src/api/orm/models/domainEvent.ts index a490c9c31f..7177a72702 100644 --- a/sdk/constructive-cli/src/api/orm/models/domainEvent.ts +++ b/sdk/constructive-cli/src/api/orm/models/domainEvent.ts @@ -3,56 +3,96 @@ * @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 { DomainEvent, DomainEventWithRelations, DomainEventSelect, DomainEventFilter, DomainEventOrderBy, CreateDomainEventInput, UpdateDomainEventInput, DomainEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainEvent, + DomainEventWithRelations, + DomainEventSelect, + DomainEventFilter, + DomainEventOrderBy, + CreateDomainEventInput, + UpdateDomainEventInput, + DomainEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainEvent", "domainEvents", 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 - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainEvent', + 'domainEvents', + 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, + }, + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvents", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainEvent", "domainEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainEvent', + 'domainEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvent", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainEvent": data.domainEvents?.nodes?.[0] ?? null - }) + domainEvent: data.domainEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainEvent", "domainEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainEvent', + 'domainEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvent", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainEvent": data.domainEvents?.nodes?.[0] ?? null - }) + domainEvent: data.domainEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainEvent", "createDomainEvent", "domainEvent", args.select, args.data, "CreateDomainEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainEvent', + 'createDomainEvent', + 'domainEvent', + args.select, + args.data, + 'CreateDomainEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "createDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'createDomainEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainEvent", "updateDomainEvent", "domainEvent", args.select, args.where.id, args.data, "UpdateDomainEventInput", "id", "domainEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainEvent', + 'updateDomainEvent', + 'domainEvent', + args.select, + args.where.id, + args.data, + 'UpdateDomainEventInput', + 'id', + 'domainEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "updateDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'updateDomainEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainEvent", "deleteDomainEvent", "domainEvent", { - id: args.where.id - }, "DeleteDomainEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainEvent', + 'deleteDomainEvent', + 'domainEvent', + { + id: args.where.id, + }, + 'DeleteDomainEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "deleteDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'deleteDomainEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/domainVerification.ts b/sdk/constructive-cli/src/api/orm/models/domainVerification.ts index 60c8c2572f..b004e0b4da 100644 --- a/sdk/constructive-cli/src/api/orm/models/domainVerification.ts +++ b/sdk/constructive-cli/src/api/orm/models/domainVerification.ts @@ -3,56 +3,96 @@ * @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 { DomainVerification, DomainVerificationWithRelations, DomainVerificationSelect, DomainVerificationFilter, DomainVerificationOrderBy, CreateDomainVerificationInput, UpdateDomainVerificationInput, DomainVerificationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainVerification, + DomainVerificationWithRelations, + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy, + CreateDomainVerificationInput, + UpdateDomainVerificationInput, + DomainVerificationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainVerificationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerifications: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainVerification", "domainVerifications", 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 - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainVerification', + 'domainVerifications', + 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, + }, + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerifications", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerifications', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerification: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainVerification", "domainVerifications", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainVerification', + 'domainVerifications', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerification", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerification', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainVerification": data.domainVerifications?.nodes?.[0] ?? null - }) + domainVerification: data.domainVerifications?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerification: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainVerification", "domainVerifications", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainVerification', + 'domainVerifications', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerification", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerification', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainVerification": data.domainVerifications?.nodes?.[0] ?? null - }) + domainVerification: data.domainVerifications?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainVerification", "createDomainVerification", "domainVerification", args.select, args.data, "CreateDomainVerificationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainVerification', + 'createDomainVerification', + 'domainVerification', + args.select, + args.data, + 'CreateDomainVerificationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "createDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'createDomainVerification', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainVerificationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainVerification", "updateDomainVerification", "domainVerification", args.select, args.where.id, args.data, "UpdateDomainVerificationInput", "id", "domainVerificationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainVerification', + 'updateDomainVerification', + 'domainVerification', + args.select, + args.where.id, + args.data, + 'UpdateDomainVerificationInput', + 'id', + 'domainVerificationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "updateDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'updateDomainVerification', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainVerification", "deleteDomainVerification", "domainVerification", { - id: args.where.id - }, "DeleteDomainVerificationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainVerification', + 'deleteDomainVerification', + 'domainVerification', + { + id: args.where.id, + }, + 'DeleteDomainVerificationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "deleteDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'deleteDomainVerification', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/embeddingChunk.ts b/sdk/constructive-cli/src/api/orm/models/embeddingChunk.ts index 5b0eae38d8..90af6f51a9 100644 --- a/sdk/constructive-cli/src/api/orm/models/embeddingChunk.ts +++ b/sdk/constructive-cli/src/api/orm/models/embeddingChunk.ts @@ -3,56 +3,96 @@ * @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 { EmbeddingChunk, EmbeddingChunkWithRelations, EmbeddingChunkSelect, EmbeddingChunkFilter, EmbeddingChunkOrderBy, CreateEmbeddingChunkInput, UpdateEmbeddingChunkInput, EmbeddingChunkPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EmbeddingChunk, + EmbeddingChunkWithRelations, + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy, + CreateEmbeddingChunkInput, + UpdateEmbeddingChunkInput, + EmbeddingChunkPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmbeddingChunkModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EmbeddingChunk", "embeddingChunks", 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 - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EmbeddingChunk', + 'embeddingChunks', + 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, + }, + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunks", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EmbeddingChunk", "embeddingChunks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EmbeddingChunk', + 'embeddingChunks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunk", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunk', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmbeddingChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "embeddingChunk": data.embeddingChunks?.nodes?.[0] ?? null - }) + embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EmbeddingChunk", "embeddingChunks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EmbeddingChunk', + 'embeddingChunks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunk", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunk', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmbeddingChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "embeddingChunk": data.embeddingChunks?.nodes?.[0] ?? null - }) + embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EmbeddingChunk", "createEmbeddingChunk", "embeddingChunk", args.select, args.data, "CreateEmbeddingChunkInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EmbeddingChunk', + 'createEmbeddingChunk', + 'embeddingChunk', + args.select, + args.data, + 'CreateEmbeddingChunkInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "createEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'createEmbeddingChunk', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmbeddingChunkPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EmbeddingChunk", "updateEmbeddingChunk", "embeddingChunk", args.select, args.where.id, args.data, "UpdateEmbeddingChunkInput", "id", "embeddingChunkPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EmbeddingChunk', + 'updateEmbeddingChunk', + 'embeddingChunk', + args.select, + args.where.id, + args.data, + 'UpdateEmbeddingChunkInput', + 'id', + 'embeddingChunkPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "updateEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'updateEmbeddingChunk', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EmbeddingChunk", "deleteEmbeddingChunk", "embeddingChunk", { - id: args.where.id - }, "DeleteEmbeddingChunkInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EmbeddingChunk', + 'deleteEmbeddingChunk', + 'embeddingChunk', + { + id: args.where.id, + }, + 'DeleteEmbeddingChunkInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "deleteEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'deleteEmbeddingChunk', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/enum.ts b/sdk/constructive-cli/src/api/orm/models/enum.ts index a8face956a..b5f965ea6f 100644 --- a/sdk/constructive-cli/src/api/orm/models/enum.ts +++ b/sdk/constructive-cli/src/api/orm/models/enum.ts @@ -3,56 +3,96 @@ * @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 { Enum, EnumWithRelations, EnumSelect, EnumFilter, EnumOrderBy, CreateEnumInput, UpdateEnumInput, EnumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Enum, + EnumWithRelations, + EnumSelect, + EnumFilter, + EnumOrderBy, + CreateEnumInput, + UpdateEnumInput, + EnumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EnumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ enums: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Enum", "enums", 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 - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Enum', + 'enums', + 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, + }, + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enums", + operation: 'query', + operationName: 'Enum', + fieldName: 'enums', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ enum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Enum", "enums", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Enum', + 'enums', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enum", + operation: 'query', + operationName: 'Enum', + fieldName: 'enum', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EnumModel { nodes?: InferSelectResult[]; }; }) => ({ - "enum": data.enums?.nodes?.[0] ?? null - }) + enum: data.enums?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ enum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Enum", "enums", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Enum', + 'enums', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enum", + operation: 'query', + operationName: 'Enum', + fieldName: 'enum', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EnumModel { nodes?: InferSelectResult[]; }; }) => ({ - "enum": data.enums?.nodes?.[0] ?? null - }) + enum: data.enums?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Enum", "createEnum", "enum", args.select, args.data, "CreateEnumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Enum', + 'createEnum', + 'enum', + args.select, + args.data, + 'CreateEnumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "createEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'createEnum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EnumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Enum", "updateEnum", "enum", args.select, args.where.id, args.data, "UpdateEnumInput", "id", "enumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Enum', + 'updateEnum', + 'enum', + args.select, + args.where.id, + args.data, + 'UpdateEnumInput', + 'id', + 'enumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "updateEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'updateEnum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Enum", "deleteEnum", "enum", { - id: args.where.id - }, "DeleteEnumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Enum', + 'deleteEnum', + 'enum', + { + id: args.where.id, + }, + 'DeleteEnumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "deleteEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'deleteEnum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/exclusionConstraint.ts b/sdk/constructive-cli/src/api/orm/models/exclusionConstraint.ts index a0d6320772..6cc388e197 100644 --- a/sdk/constructive-cli/src/api/orm/models/exclusionConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/exclusionConstraint.ts @@ -3,56 +3,96 @@ * @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 { ExclusionConstraint, ExclusionConstraintWithRelations, ExclusionConstraintSelect, ExclusionConstraintFilter, ExclusionConstraintOrderBy, CreateExclusionConstraintInput, UpdateExclusionConstraintInput, ExclusionConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ExclusionConstraint, + ExclusionConstraintWithRelations, + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy, + CreateExclusionConstraintInput, + UpdateExclusionConstraintInput, + ExclusionConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ExclusionConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ExclusionConstraint", "exclusionConstraints", 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 - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + 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, + }, + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraints", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ExclusionConstraint", "exclusionConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraint", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ExclusionConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "exclusionConstraint": data.exclusionConstraints?.nodes?.[0] ?? null - }) + exclusionConstraint: data.exclusionConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ExclusionConstraint", "exclusionConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraint", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ExclusionConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "exclusionConstraint": data.exclusionConstraints?.nodes?.[0] ?? null - }) + exclusionConstraint: data.exclusionConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ExclusionConstraint", "createExclusionConstraint", "exclusionConstraint", args.select, args.data, "CreateExclusionConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ExclusionConstraint', + 'createExclusionConstraint', + 'exclusionConstraint', + args.select, + args.data, + 'CreateExclusionConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "createExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'createExclusionConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ExclusionConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ExclusionConstraint", "updateExclusionConstraint", "exclusionConstraint", args.select, args.where.id, args.data, "UpdateExclusionConstraintInput", "id", "exclusionConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ExclusionConstraint', + 'updateExclusionConstraint', + 'exclusionConstraint', + args.select, + args.where.id, + args.data, + 'UpdateExclusionConstraintInput', + 'id', + 'exclusionConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "updateExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'updateExclusionConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ExclusionConstraint", "deleteExclusionConstraint", "exclusionConstraint", { - id: args.where.id - }, "DeleteExclusionConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ExclusionConstraint', + 'deleteExclusionConstraint', + 'exclusionConstraint', + { + id: args.where.id, + }, + 'DeleteExclusionConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "deleteExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'deleteExclusionConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/field.ts b/sdk/constructive-cli/src/api/orm/models/field.ts index 28d34da746..baa1994dbd 100644 --- a/sdk/constructive-cli/src/api/orm/models/field.ts +++ b/sdk/constructive-cli/src/api/orm/models/field.ts @@ -3,56 +3,96 @@ * @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 { Field, FieldWithRelations, FieldSelect, FieldFilter, FieldOrderBy, CreateFieldInput, UpdateFieldInput, FieldPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Field, + FieldWithRelations, + FieldSelect, + FieldFilter, + FieldOrderBy, + CreateFieldInput, + UpdateFieldInput, + FieldPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FieldModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fields: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Field", "fields", 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 - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Field', + 'fields', + 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, + }, + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "fields", + operation: 'query', + operationName: 'Field', + fieldName: 'fields', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ field: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Field", "fields", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Field', + 'fields', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "field", + operation: 'query', + operationName: 'Field', + fieldName: 'field', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "field": data.fields?.nodes?.[0] ?? null - }) + field: data.fields?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ field: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Field", "fields", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Field', + 'fields', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "field", + operation: 'query', + operationName: 'Field', + fieldName: 'field', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "field": data.fields?.nodes?.[0] ?? null - }) + field: data.fields?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Field", "createField", "field", args.select, args.data, "CreateFieldInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Field', + 'createField', + 'field', + args.select, + args.data, + 'CreateFieldInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "createField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'createField', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FieldPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Field", "updateField", "field", args.select, args.where.id, args.data, "UpdateFieldInput", "id", "fieldPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Field', + 'updateField', + 'field', + args.select, + args.where.id, + args.data, + 'UpdateFieldInput', + 'id', + 'fieldPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "updateField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'updateField', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Field", "deleteField", "field", { - id: args.where.id - }, "DeleteFieldInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Field', + 'deleteField', + 'field', + { + id: args.where.id, + }, + 'DeleteFieldInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "deleteField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'deleteField', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/foreignKeyConstraint.ts b/sdk/constructive-cli/src/api/orm/models/foreignKeyConstraint.ts index 9d86ea7aa5..498b987bd0 100644 --- a/sdk/constructive-cli/src/api/orm/models/foreignKeyConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/foreignKeyConstraint.ts @@ -3,56 +3,98 @@ * @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 { ForeignKeyConstraint, ForeignKeyConstraintWithRelations, ForeignKeyConstraintSelect, ForeignKeyConstraintFilter, ForeignKeyConstraintOrderBy, CreateForeignKeyConstraintInput, UpdateForeignKeyConstraintInput, ForeignKeyConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ForeignKeyConstraint, + ForeignKeyConstraintWithRelations, + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy, + CreateForeignKeyConstraintInput, + UpdateForeignKeyConstraintInput, + ForeignKeyConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ForeignKeyConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - foreignKeyConstraints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + foreignKeyConstraints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ForeignKeyConstraint", "foreignKeyConstraints", 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 - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + 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, + }, + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraints", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ foreignKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ForeignKeyConstraint", "foreignKeyConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraint", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ForeignKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "foreignKeyConstraint": data.foreignKeyConstraints?.nodes?.[0] ?? null - }) + foreignKeyConstraint: data.foreignKeyConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ foreignKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ForeignKeyConstraint", "foreignKeyConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraint", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ForeignKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "foreignKeyConstraint": data.foreignKeyConstraints?.nodes?.[0] ?? null - }) + foreignKeyConstraint: data.foreignKeyConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ForeignKeyConstraint", "createForeignKeyConstraint", "foreignKeyConstraint", args.select, args.data, "CreateForeignKeyConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ForeignKeyConstraint', + 'createForeignKeyConstraint', + 'foreignKeyConstraint', + args.select, + args.data, + 'CreateForeignKeyConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "createForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'createForeignKeyConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ForeignKeyConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ForeignKeyConstraint", "updateForeignKeyConstraint", "foreignKeyConstraint", args.select, args.where.id, args.data, "UpdateForeignKeyConstraintInput", "id", "foreignKeyConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ForeignKeyConstraint', + 'updateForeignKeyConstraint', + 'foreignKeyConstraint', + args.select, + args.where.id, + args.data, + 'UpdateForeignKeyConstraintInput', + 'id', + 'foreignKeyConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "updateForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'updateForeignKeyConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ForeignKeyConstraint", "deleteForeignKeyConstraint", "foreignKeyConstraint", { - id: args.where.id - }, "DeleteForeignKeyConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ForeignKeyConstraint', + 'deleteForeignKeyConstraint', + 'foreignKeyConstraint', + { + id: args.where.id, + }, + 'DeleteForeignKeyConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "deleteForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'deleteForeignKeyConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/fullTextSearch.ts b/sdk/constructive-cli/src/api/orm/models/fullTextSearch.ts index 25db3c0ee1..1fc50cde73 100644 --- a/sdk/constructive-cli/src/api/orm/models/fullTextSearch.ts +++ b/sdk/constructive-cli/src/api/orm/models/fullTextSearch.ts @@ -3,56 +3,96 @@ * @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 { FullTextSearch, FullTextSearchWithRelations, FullTextSearchSelect, FullTextSearchFilter, FullTextSearchOrderBy, CreateFullTextSearchInput, UpdateFullTextSearchInput, FullTextSearchPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FullTextSearch, + FullTextSearchWithRelations, + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy, + CreateFullTextSearchInput, + UpdateFullTextSearchInput, + FullTextSearchPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FullTextSearchModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearches: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FullTextSearch", "fullTextSearches", 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 - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FullTextSearch', + 'fullTextSearches', + 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, + }, + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearches", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearches', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearch: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FullTextSearch", "fullTextSearches", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FullTextSearch', + 'fullTextSearches', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearch", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearch', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FullTextSearchModel { nodes?: InferSelectResult[]; }; }) => ({ - "fullTextSearch": data.fullTextSearches?.nodes?.[0] ?? null - }) + fullTextSearch: data.fullTextSearches?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearch: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FullTextSearch", "fullTextSearches", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FullTextSearch', + 'fullTextSearches', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearch", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearch', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FullTextSearchModel { nodes?: InferSelectResult[]; }; }) => ({ - "fullTextSearch": data.fullTextSearches?.nodes?.[0] ?? null - }) + fullTextSearch: data.fullTextSearches?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FullTextSearch", "createFullTextSearch", "fullTextSearch", args.select, args.data, "CreateFullTextSearchInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FullTextSearch', + 'createFullTextSearch', + 'fullTextSearch', + args.select, + args.data, + 'CreateFullTextSearchInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "createFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'createFullTextSearch', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FullTextSearchPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FullTextSearch", "updateFullTextSearch", "fullTextSearch", args.select, args.where.id, args.data, "UpdateFullTextSearchInput", "id", "fullTextSearchPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FullTextSearch', + 'updateFullTextSearch', + 'fullTextSearch', + args.select, + args.where.id, + args.data, + 'UpdateFullTextSearchInput', + 'id', + 'fullTextSearchPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "updateFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'updateFullTextSearch', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FullTextSearch", "deleteFullTextSearch", "fullTextSearch", { - id: args.where.id - }, "DeleteFullTextSearchInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FullTextSearch', + 'deleteFullTextSearch', + 'fullTextSearch', + { + id: args.where.id, + }, + 'DeleteFullTextSearchInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "deleteFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'deleteFullTextSearch', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/function.ts b/sdk/constructive-cli/src/api/orm/models/function.ts index 03d957378d..fc8fba9b21 100644 --- a/sdk/constructive-cli/src/api/orm/models/function.ts +++ b/sdk/constructive-cli/src/api/orm/models/function.ts @@ -3,56 +3,96 @@ * @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 { Function, FunctionWithRelations, FunctionSelect, FunctionFilter, FunctionOrderBy, CreateFunctionInput, UpdateFunctionInput, FunctionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Function, + FunctionWithRelations, + FunctionSelect, + FunctionFilter, + FunctionOrderBy, + CreateFunctionInput, + UpdateFunctionInput, + FunctionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Function", "functions", 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 - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Function', + 'functions', + 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, + }, + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "functions", + operation: 'query', + operationName: 'Function', + fieldName: 'functions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ function: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Function", "functions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Function', + 'functions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "function", + operation: 'query', + operationName: 'Function', + fieldName: 'function', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "function": data.functions?.nodes?.[0] ?? null - }) + function: data.functions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ function: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Function", "functions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Function', + 'functions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "function", + operation: 'query', + operationName: 'Function', + fieldName: 'function', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "function": data.functions?.nodes?.[0] ?? null - }) + function: data.functions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Function", "createFunction", "function", args.select, args.data, "CreateFunctionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Function', + 'createFunction', + 'function', + args.select, + args.data, + 'CreateFunctionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "createFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'createFunction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Function", "updateFunction", "function", args.select, args.where.id, args.data, "UpdateFunctionInput", "id", "functionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Function', + 'updateFunction', + 'function', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInput', + 'id', + 'functionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "updateFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'updateFunction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Function", "deleteFunction", "function", { - id: args.where.id - }, "DeleteFunctionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Function', + 'deleteFunction', + 'function', + { + id: args.where.id, + }, + 'DeleteFunctionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "deleteFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'deleteFunction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/hostnameBinding.ts b/sdk/constructive-cli/src/api/orm/models/hostnameBinding.ts index 3e42c2f357..f720f177ad 100644 --- a/sdk/constructive-cli/src/api/orm/models/hostnameBinding.ts +++ b/sdk/constructive-cli/src/api/orm/models/hostnameBinding.ts @@ -3,56 +3,96 @@ * @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 { HostnameBinding, HostnameBindingWithRelations, HostnameBindingSelect, HostnameBindingFilter, HostnameBindingOrderBy, CreateHostnameBindingInput, UpdateHostnameBindingInput, HostnameBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HostnameBinding, + HostnameBindingWithRelations, + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy, + CreateHostnameBindingInput, + UpdateHostnameBindingInput, + HostnameBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HostnameBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HostnameBinding", "hostnameBindings", 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 - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HostnameBinding', + 'hostnameBindings', + 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, + }, + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBindings", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HostnameBinding", "hostnameBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HostnameBinding', + 'hostnameBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBinding", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HostnameBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "hostnameBinding": data.hostnameBindings?.nodes?.[0] ?? null - }) + hostnameBinding: data.hostnameBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HostnameBinding", "hostnameBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HostnameBinding', + 'hostnameBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBinding", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HostnameBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "hostnameBinding": data.hostnameBindings?.nodes?.[0] ?? null - }) + hostnameBinding: data.hostnameBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HostnameBinding", "createHostnameBinding", "hostnameBinding", args.select, args.data, "CreateHostnameBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HostnameBinding', + 'createHostnameBinding', + 'hostnameBinding', + args.select, + args.data, + 'CreateHostnameBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "createHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'createHostnameBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HostnameBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HostnameBinding", "updateHostnameBinding", "hostnameBinding", args.select, args.where.id, args.data, "UpdateHostnameBindingInput", "id", "hostnameBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HostnameBinding', + 'updateHostnameBinding', + 'hostnameBinding', + args.select, + args.where.id, + args.data, + 'UpdateHostnameBindingInput', + 'id', + 'hostnameBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "updateHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'updateHostnameBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HostnameBinding", "deleteHostnameBinding", "hostnameBinding", { - id: args.where.id - }, "DeleteHostnameBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HostnameBinding', + 'deleteHostnameBinding', + 'hostnameBinding', + { + id: args.where.id, + }, + 'DeleteHostnameBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "deleteHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'deleteHostnameBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/httpRoute.ts b/sdk/constructive-cli/src/api/orm/models/httpRoute.ts index 3264e720b6..0af2bf2fac 100644 --- a/sdk/constructive-cli/src/api/orm/models/httpRoute.ts +++ b/sdk/constructive-cli/src/api/orm/models/httpRoute.ts @@ -3,56 +3,96 @@ * @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 { HttpRoute, HttpRouteWithRelations, HttpRouteSelect, HttpRouteFilter, HttpRouteOrderBy, CreateHttpRouteInput, UpdateHttpRouteInput, HttpRoutePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HttpRoute, + HttpRouteWithRelations, + HttpRouteSelect, + HttpRouteFilter, + HttpRouteOrderBy, + CreateHttpRouteInput, + UpdateHttpRouteInput, + HttpRoutePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HttpRouteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoutes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRoute", "httpRoutes", 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 - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HttpRoute', + 'httpRoutes', + 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, + }, + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoutes", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoutes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoute: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HttpRoute", "httpRoutes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HttpRoute', + 'httpRoutes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoute", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoute', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HttpRouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRoute": data.httpRoutes?.nodes?.[0] ?? null - }) + httpRoute: data.httpRoutes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoute: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRoute", "httpRoutes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HttpRoute', + 'httpRoutes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoute", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoute', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HttpRouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRoute": data.httpRoutes?.nodes?.[0] ?? null - }) + httpRoute: data.httpRoutes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HttpRoute", "createHttpRoute", "httpRoute", args.select, args.data, "CreateHttpRouteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HttpRoute', + 'createHttpRoute', + 'httpRoute', + args.select, + args.data, + 'CreateHttpRouteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "createHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'createHttpRoute', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HttpRoutePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HttpRoute", "updateHttpRoute", "httpRoute", args.select, args.where.id, args.data, "UpdateHttpRouteInput", "id", "httpRoutePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HttpRoute', + 'updateHttpRoute', + 'httpRoute', + args.select, + args.where.id, + args.data, + 'UpdateHttpRouteInput', + 'id', + 'httpRoutePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "updateHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'updateHttpRoute', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HttpRoute", "deleteHttpRoute", "httpRoute", { - id: args.where.id - }, "DeleteHttpRouteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HttpRoute', + 'deleteHttpRoute', + 'httpRoute', + { + id: args.where.id, + }, + 'DeleteHttpRouteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "deleteHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'deleteHttpRoute', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/index.ts b/sdk/constructive-cli/src/api/orm/models/index.ts index ec8f8de6a3..a9bb5c2667 100644 --- a/sdk/constructive-cli/src/api/orm/models/index.ts +++ b/sdk/constructive-cli/src/api/orm/models/index.ts @@ -3,68 +3,68 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { ApiModel } from "./api"; -export { ApiModuleModel } from "./apiModule"; -export { ApiSchemaModel } from "./apiSchema"; -export { ApiSettingModel } from "./apiSetting"; -export { AstMigrationModel } from "./astMigration"; -export { CheckConstraintModel } from "./checkConstraint"; -export { CompositeTypeModel } from "./compositeType"; -export { CorsSettingModel } from "./corsSetting"; -export { DatabaseModel } from "./database"; -export { DatabaseSettingModel } from "./databaseSetting"; -export { DatabaseTransferModel } from "./databaseTransfer"; -export { DefaultPrivilegeModel } from "./defaultPrivilege"; -export { DomainModel } from "./domain"; -export { DomainEventModel } from "./domainEvent"; -export { DomainVerificationModel } from "./domainVerification"; -export { EmbeddingChunkModel } from "./embeddingChunk"; -export { EnumModel } from "./enum"; -export { ExclusionConstraintModel } from "./exclusionConstraint"; -export { FieldModel } from "./field"; -export { ForeignKeyConstraintModel } from "./foreignKeyConstraint"; -export { FullTextSearchModel } from "./fullTextSearch"; -export { FunctionModel } from "./function"; -export { HostnameBindingModel } from "./hostnameBinding"; -export { HttpRouteModel } from "./httpRoute"; -export { IndexModel } from "./indexModel"; -export { ManagedDomainModel } from "./managedDomain"; -export { NodeTypeRegistryModel } from "./nodeTypeRegistry"; -export { PartitionModel } from "./partition"; -export { PlatformApiModel } from "./platformApi"; -export { PlatformApiModuleModel } from "./platformApiModule"; -export { PlatformApiSchemaModel } from "./platformApiSchema"; -export { PlatformApiSettingModel } from "./platformApiSetting"; -export { PlatformCorsSettingModel } from "./platformCorsSetting"; -export { PlatformDomainModel } from "./platformDomain"; -export { PlatformDomainEventModel } from "./platformDomainEvent"; -export { PlatformDomainVerificationModel } from "./platformDomainVerification"; -export { PlatformManagedDomainModel } from "./platformManagedDomain"; -export { PlatformSiteModel } from "./platformSite"; -export { PlatformSiteMetadatumModel } from "./platformSiteMetadatum"; -export { PlatformSiteModuleModel } from "./platformSiteModule"; -export { PlatformSiteThemeModel } from "./platformSiteTheme"; -export { PolicyModel } from "./policy"; -export { PrimaryKeyConstraintModel } from "./primaryKeyConstraint"; -export { PubkeySettingModel } from "./pubkeySetting"; -export { RlsSettingModel } from "./rlsSetting"; -export { RouteBindingModel } from "./routeBinding"; -export { RouteModel } from "./route"; -export { SchemaModel } from "./schema"; -export { SchemaGrantModel } from "./schemaGrant"; -export { SiteModel } from "./site"; -export { SiteMetadatumModel } from "./siteMetadatum"; -export { SiteModuleModel } from "./siteModule"; -export { SiteThemeModel } from "./siteTheme"; -export { SpatialRelationModel } from "./spatialRelation"; -export { SqlActionModel } from "./sqlAction"; -export { TableModel } from "./table"; -export { TableGrantModel } from "./tableGrant"; -export { TriggerModel } from "./trigger"; -export { TriggerFunctionModel } from "./triggerFunction"; -export { UniqueConstraintModel } from "./uniqueConstraint"; -export { ViewModel } from "./view"; -export { ViewGrantModel } from "./viewGrant"; -export { ViewRuleModel } from "./viewRule"; -export { ViewTableModel } from "./viewTable"; -export { WebauthnSettingModel } from "./webauthnSetting"; \ No newline at end of file +export { ApiModel } from './api'; +export { ApiModuleModel } from './apiModule'; +export { ApiSchemaModel } from './apiSchema'; +export { ApiSettingModel } from './apiSetting'; +export { AstMigrationModel } from './astMigration'; +export { CheckConstraintModel } from './checkConstraint'; +export { CompositeTypeModel } from './compositeType'; +export { CorsSettingModel } from './corsSetting'; +export { DatabaseModel } from './database'; +export { DatabaseSettingModel } from './databaseSetting'; +export { DatabaseTransferModel } from './databaseTransfer'; +export { DefaultPrivilegeModel } from './defaultPrivilege'; +export { DomainModel } from './domain'; +export { DomainEventModel } from './domainEvent'; +export { DomainVerificationModel } from './domainVerification'; +export { EmbeddingChunkModel } from './embeddingChunk'; +export { EnumModel } from './enum'; +export { ExclusionConstraintModel } from './exclusionConstraint'; +export { FieldModel } from './field'; +export { ForeignKeyConstraintModel } from './foreignKeyConstraint'; +export { FullTextSearchModel } from './fullTextSearch'; +export { FunctionModel } from './function'; +export { HostnameBindingModel } from './hostnameBinding'; +export { HttpRouteModel } from './httpRoute'; +export { IndexModel } from './indexModel'; +export { ManagedDomainModel } from './managedDomain'; +export { NodeTypeRegistryModel } from './nodeTypeRegistry'; +export { PartitionModel } from './partition'; +export { PlatformApiModel } from './platformApi'; +export { PlatformApiModuleModel } from './platformApiModule'; +export { PlatformApiSchemaModel } from './platformApiSchema'; +export { PlatformApiSettingModel } from './platformApiSetting'; +export { PlatformCorsSettingModel } from './platformCorsSetting'; +export { PlatformDomainModel } from './platformDomain'; +export { PlatformDomainEventModel } from './platformDomainEvent'; +export { PlatformDomainVerificationModel } from './platformDomainVerification'; +export { PlatformManagedDomainModel } from './platformManagedDomain'; +export { PlatformSiteModel } from './platformSite'; +export { PlatformSiteMetadatumModel } from './platformSiteMetadatum'; +export { PlatformSiteModuleModel } from './platformSiteModule'; +export { PlatformSiteThemeModel } from './platformSiteTheme'; +export { PolicyModel } from './policy'; +export { PrimaryKeyConstraintModel } from './primaryKeyConstraint'; +export { PubkeySettingModel } from './pubkeySetting'; +export { RlsSettingModel } from './rlsSetting'; +export { RouteBindingModel } from './routeBinding'; +export { RouteModel } from './route'; +export { SchemaModel } from './schema'; +export { SchemaGrantModel } from './schemaGrant'; +export { SiteModel } from './site'; +export { SiteMetadatumModel } from './siteMetadatum'; +export { SiteModuleModel } from './siteModule'; +export { SiteThemeModel } from './siteTheme'; +export { SpatialRelationModel } from './spatialRelation'; +export { SqlActionModel } from './sqlAction'; +export { TableModel } from './table'; +export { TableGrantModel } from './tableGrant'; +export { TriggerModel } from './trigger'; +export { TriggerFunctionModel } from './triggerFunction'; +export { UniqueConstraintModel } from './uniqueConstraint'; +export { ViewModel } from './view'; +export { ViewGrantModel } from './viewGrant'; +export { ViewRuleModel } from './viewRule'; +export { ViewTableModel } from './viewTable'; +export { WebauthnSettingModel } from './webauthnSetting'; diff --git a/sdk/constructive-cli/src/api/orm/models/indexModel.ts b/sdk/constructive-cli/src/api/orm/models/indexModel.ts index 38ebd55b62..919849c835 100644 --- a/sdk/constructive-cli/src/api/orm/models/indexModel.ts +++ b/sdk/constructive-cli/src/api/orm/models/indexModel.ts @@ -3,56 +3,96 @@ * @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 { Index, IndexWithRelations, IndexSelect, IndexFilter, IndexOrderBy, CreateIndexInput, UpdateIndexInput, IndexPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Index, + IndexWithRelations, + IndexSelect, + IndexFilter, + IndexOrderBy, + CreateIndexInput, + UpdateIndexInput, + IndexPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IndexModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ indices: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Index", "indices", 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 - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Index', + 'indices', + 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, + }, + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "indices", + operation: 'query', + operationName: 'Index', + fieldName: 'indices', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ index: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Index", "indices", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Index', + 'indices', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "index", + operation: 'query', + operationName: 'Index', + fieldName: 'index', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class IndexModel { nodes?: InferSelectResult[]; }; }) => ({ - "index": data.indices?.nodes?.[0] ?? null - }) + index: data.indices?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ index: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Index", "indices", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Index', + 'indices', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "index", + operation: 'query', + operationName: 'Index', + fieldName: 'index', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class IndexModel { nodes?: InferSelectResult[]; }; }) => ({ - "index": data.indices?.nodes?.[0] ?? null - }) + index: data.indices?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Index", "createIndex", "index", args.select, args.data, "CreateIndexInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Index', + 'createIndex', + 'index', + args.select, + args.data, + 'CreateIndexInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "createIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'createIndex', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IndexPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Index", "updateIndex", "index", args.select, args.where.id, args.data, "UpdateIndexInput", "id", "indexPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Index', + 'updateIndex', + 'index', + args.select, + args.where.id, + args.data, + 'UpdateIndexInput', + 'id', + 'indexPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "updateIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'updateIndex', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Index", "deleteIndex", "index", { - id: args.where.id - }, "DeleteIndexInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Index', + 'deleteIndex', + 'index', + { + id: args.where.id, + }, + 'DeleteIndexInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "deleteIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'deleteIndex', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/managedDomain.ts b/sdk/constructive-cli/src/api/orm/models/managedDomain.ts index 780919d989..8b93f6e1ac 100644 --- a/sdk/constructive-cli/src/api/orm/models/managedDomain.ts +++ b/sdk/constructive-cli/src/api/orm/models/managedDomain.ts @@ -3,56 +3,96 @@ * @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 { ManagedDomain, ManagedDomainWithRelations, ManagedDomainSelect, ManagedDomainFilter, ManagedDomainOrderBy, CreateManagedDomainInput, UpdateManagedDomainInput, ManagedDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ManagedDomain, + ManagedDomainWithRelations, + ManagedDomainSelect, + ManagedDomainFilter, + ManagedDomainOrderBy, + CreateManagedDomainInput, + UpdateManagedDomainInput, + ManagedDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ManagedDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ManagedDomain", "managedDomains", 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 - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ManagedDomain', + 'managedDomains', + 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, + }, + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomains", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ManagedDomain", "managedDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ManagedDomain', + 'managedDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomain", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "managedDomain": data.managedDomains?.nodes?.[0] ?? null - }) + managedDomain: data.managedDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ManagedDomain", "managedDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ManagedDomain', + 'managedDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomain", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "managedDomain": data.managedDomains?.nodes?.[0] ?? null - }) + managedDomain: data.managedDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ManagedDomain", "createManagedDomain", "managedDomain", args.select, args.data, "CreateManagedDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ManagedDomain', + 'createManagedDomain', + 'managedDomain', + args.select, + args.data, + 'CreateManagedDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "createManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'createManagedDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ManagedDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ManagedDomain", "updateManagedDomain", "managedDomain", args.select, args.where.id, args.data, "UpdateManagedDomainInput", "id", "managedDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ManagedDomain', + 'updateManagedDomain', + 'managedDomain', + args.select, + args.where.id, + args.data, + 'UpdateManagedDomainInput', + 'id', + 'managedDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "updateManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'updateManagedDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ManagedDomain", "deleteManagedDomain", "managedDomain", { - id: args.where.id - }, "DeleteManagedDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ManagedDomain', + 'deleteManagedDomain', + 'managedDomain', + { + id: args.where.id, + }, + 'DeleteManagedDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "deleteManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'deleteManagedDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/nodeTypeRegistry.ts b/sdk/constructive-cli/src/api/orm/models/nodeTypeRegistry.ts index 0124074e7a..ab4670e925 100644 --- a/sdk/constructive-cli/src/api/orm/models/nodeTypeRegistry.ts +++ b/sdk/constructive-cli/src/api/orm/models/nodeTypeRegistry.ts @@ -3,56 +3,96 @@ * @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 { NodeTypeRegistry, NodeTypeRegistryWithRelations, NodeTypeRegistrySelect, NodeTypeRegistryFilter, NodeTypeRegistryOrderBy, CreateNodeTypeRegistryInput, UpdateNodeTypeRegistryInput, NodeTypeRegistryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NodeTypeRegistry, + NodeTypeRegistryWithRelations, + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy, + CreateNodeTypeRegistryInput, + UpdateNodeTypeRegistryInput, + NodeTypeRegistryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NodeTypeRegistryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistries: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NodeTypeRegistry", "nodeTypeRegistries", 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 - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + 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, + }, + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistries", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistry: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NodeTypeRegistry", "nodeTypeRegistries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistry", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistry', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NodeTypeRegistryModel { nodes?: InferSelectResult[]; }; }) => ({ - "nodeTypeRegistry": data.nodeTypeRegistries?.nodes?.[0] ?? null - }) + nodeTypeRegistry: data.nodeTypeRegistries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - name: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + name: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistry: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NodeTypeRegistry", "nodeTypeRegistries", args.select, { - where: { - name: { - equalTo: args.name - } + const { document, variables } = buildFindManyDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + args.select, + { + where: { + name: { + equalTo: args.name, + }, + }, + first: 1, }, - first: 1 - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistry", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistry', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NodeTypeRegistryModel { nodes?: InferSelectResult[]; }; }) => ({ - "nodeTypeRegistry": data.nodeTypeRegistries?.nodes?.[0] ?? null - }) + nodeTypeRegistry: data.nodeTypeRegistries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NodeTypeRegistry", "createNodeTypeRegistry", "nodeTypeRegistry", args.select, args.data, "CreateNodeTypeRegistryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NodeTypeRegistry', + 'createNodeTypeRegistry', + 'nodeTypeRegistry', + args.select, + args.data, + 'CreateNodeTypeRegistryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "createNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'createNodeTypeRegistry', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + name: string; + }, + NodeTypeRegistryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NodeTypeRegistry", "updateNodeTypeRegistry", "nodeTypeRegistry", args.select, args.where.name, args.data, "UpdateNodeTypeRegistryInput", "name", "nodeTypeRegistryPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NodeTypeRegistry', + 'updateNodeTypeRegistry', + 'nodeTypeRegistry', + args.select, + args.where.name, + args.data, + 'UpdateNodeTypeRegistryInput', + 'name', + 'nodeTypeRegistryPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "updateNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'updateNodeTypeRegistry', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - name: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + name: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NodeTypeRegistry", "deleteNodeTypeRegistry", "nodeTypeRegistry", { - name: args.where.name - }, "DeleteNodeTypeRegistryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NodeTypeRegistry', + 'deleteNodeTypeRegistry', + 'nodeTypeRegistry', + { + name: args.where.name, + }, + 'DeleteNodeTypeRegistryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "deleteNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'deleteNodeTypeRegistry', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/partition.ts b/sdk/constructive-cli/src/api/orm/models/partition.ts index f6b45122d8..1f848f6419 100644 --- a/sdk/constructive-cli/src/api/orm/models/partition.ts +++ b/sdk/constructive-cli/src/api/orm/models/partition.ts @@ -3,56 +3,96 @@ * @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 { Partition, PartitionWithRelations, PartitionSelect, PartitionFilter, PartitionOrderBy, CreatePartitionInput, UpdatePartitionInput, PartitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Partition, + PartitionWithRelations, + PartitionSelect, + PartitionFilter, + PartitionOrderBy, + CreatePartitionInput, + UpdatePartitionInput, + PartitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PartitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ partitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Partition", "partitions", 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 - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Partition', + 'partitions', + 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, + }, + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partitions", + operation: 'query', + operationName: 'Partition', + fieldName: 'partitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ partition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Partition", "partitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Partition', + 'partitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partition", + operation: 'query', + operationName: 'Partition', + fieldName: 'partition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PartitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "partition": data.partitions?.nodes?.[0] ?? null - }) + partition: data.partitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ partition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Partition", "partitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Partition', + 'partitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partition", + operation: 'query', + operationName: 'Partition', + fieldName: 'partition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PartitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "partition": data.partitions?.nodes?.[0] ?? null - }) + partition: data.partitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Partition", "createPartition", "partition", args.select, args.data, "CreatePartitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Partition', + 'createPartition', + 'partition', + args.select, + args.data, + 'CreatePartitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "createPartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'createPartition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PartitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Partition", "updatePartition", "partition", args.select, args.where.id, args.data, "UpdatePartitionInput", "id", "partitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Partition', + 'updatePartition', + 'partition', + args.select, + args.where.id, + args.data, + 'UpdatePartitionInput', + 'id', + 'partitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "updatePartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'updatePartition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Partition", "deletePartition", "partition", { - id: args.where.id - }, "DeletePartitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Partition', + 'deletePartition', + 'partition', + { + id: args.where.id, + }, + 'DeletePartitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "deletePartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'deletePartition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformApi.ts b/sdk/constructive-cli/src/api/orm/models/platformApi.ts index e51486fdec..3eee59e6c8 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformApi.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformApi.ts @@ -3,56 +3,96 @@ * @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 { PlatformApi, PlatformApiWithRelations, PlatformApiSelect, PlatformApiFilter, PlatformApiOrderBy, CreatePlatformApiInput, UpdatePlatformApiInput, PlatformApiPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApi, + PlatformApiWithRelations, + PlatformApiSelect, + PlatformApiFilter, + PlatformApiOrderBy, + CreatePlatformApiInput, + UpdatePlatformApiInput, + PlatformApiPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApis: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApi", "platformApis", 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 - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApi', + 'platformApis', + 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, + }, + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApis", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApis', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApi: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApi", "platformApis", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApi', + 'platformApis', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApi", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApi', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApi": data.platformApis?.nodes?.[0] ?? null - }) + platformApi: data.platformApis?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApi: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApi", "platformApis", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApi', + 'platformApis', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApi", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApi', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApi": data.platformApis?.nodes?.[0] ?? null - }) + platformApi: data.platformApis?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApi", "createPlatformApi", "platformApi", args.select, args.data, "CreatePlatformApiInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApi', + 'createPlatformApi', + 'platformApi', + args.select, + args.data, + 'CreatePlatformApiInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "createPlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'createPlatformApi', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApi", "updatePlatformApi", "platformApi", args.select, args.where.id, args.data, "UpdatePlatformApiInput", "id", "platformApiPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApi', + 'updatePlatformApi', + 'platformApi', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiInput', + 'id', + 'platformApiPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "updatePlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'updatePlatformApi', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApi", "deletePlatformApi", "platformApi", { - id: args.where.id - }, "DeletePlatformApiInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApi', + 'deletePlatformApi', + 'platformApi', + { + id: args.where.id, + }, + 'DeletePlatformApiInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "deletePlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'deletePlatformApi', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformApiModule.ts b/sdk/constructive-cli/src/api/orm/models/platformApiModule.ts index d4c89a7118..fe0fe89c45 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformApiModule.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformApiModule.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiModule, PlatformApiModuleWithRelations, PlatformApiModuleSelect, PlatformApiModuleFilter, PlatformApiModuleOrderBy, CreatePlatformApiModuleInput, UpdatePlatformApiModuleInput, PlatformApiModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiModule, + PlatformApiModuleWithRelations, + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy, + CreatePlatformApiModuleInput, + UpdatePlatformApiModuleInput, + PlatformApiModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiModule", "platformApiModules", 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 - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiModule', + 'platformApiModules', + 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, + }, + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModules", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiModule", "platformApiModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiModule', + 'platformApiModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModule", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiModule": data.platformApiModules?.nodes?.[0] ?? null - }) + platformApiModule: data.platformApiModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiModule", "platformApiModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiModule', + 'platformApiModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModule", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiModule": data.platformApiModules?.nodes?.[0] ?? null - }) + platformApiModule: data.platformApiModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiModule", "createPlatformApiModule", "platformApiModule", args.select, args.data, "CreatePlatformApiModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiModule', + 'createPlatformApiModule', + 'platformApiModule', + args.select, + args.data, + 'CreatePlatformApiModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "createPlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'createPlatformApiModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiModule", "updatePlatformApiModule", "platformApiModule", args.select, args.where.id, args.data, "UpdatePlatformApiModuleInput", "id", "platformApiModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiModule', + 'updatePlatformApiModule', + 'platformApiModule', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiModuleInput', + 'id', + 'platformApiModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "updatePlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'updatePlatformApiModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiModule", "deletePlatformApiModule", "platformApiModule", { - id: args.where.id - }, "DeletePlatformApiModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiModule', + 'deletePlatformApiModule', + 'platformApiModule', + { + id: args.where.id, + }, + 'DeletePlatformApiModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "deletePlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'deletePlatformApiModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformApiSchema.ts b/sdk/constructive-cli/src/api/orm/models/platformApiSchema.ts index 8dee7b12ed..45d57c9570 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformApiSchema.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformApiSchema.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiSchema, PlatformApiSchemaWithRelations, PlatformApiSchemaSelect, PlatformApiSchemaFilter, PlatformApiSchemaOrderBy, CreatePlatformApiSchemaInput, UpdatePlatformApiSchemaInput, PlatformApiSchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiSchema, + PlatformApiSchemaWithRelations, + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy, + CreatePlatformApiSchemaInput, + UpdatePlatformApiSchemaInput, + PlatformApiSchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiSchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSchema", "platformApiSchemas", 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 - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + 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, + }, + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchemas", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiSchema", "platformApiSchemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchema", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSchema": data.platformApiSchemas?.nodes?.[0] ?? null - }) + platformApiSchema: data.platformApiSchemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSchema", "platformApiSchemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchema", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSchema": data.platformApiSchemas?.nodes?.[0] ?? null - }) + platformApiSchema: data.platformApiSchemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiSchema", "createPlatformApiSchema", "platformApiSchema", args.select, args.data, "CreatePlatformApiSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiSchema', + 'createPlatformApiSchema', + 'platformApiSchema', + args.select, + args.data, + 'CreatePlatformApiSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "createPlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'createPlatformApiSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiSchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiSchema", "updatePlatformApiSchema", "platformApiSchema", args.select, args.where.id, args.data, "UpdatePlatformApiSchemaInput", "id", "platformApiSchemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiSchema', + 'updatePlatformApiSchema', + 'platformApiSchema', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiSchemaInput', + 'id', + 'platformApiSchemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "updatePlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'updatePlatformApiSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiSchema", "deletePlatformApiSchema", "platformApiSchema", { - id: args.where.id - }, "DeletePlatformApiSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiSchema', + 'deletePlatformApiSchema', + 'platformApiSchema', + { + id: args.where.id, + }, + 'DeletePlatformApiSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "deletePlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'deletePlatformApiSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformApiSetting.ts b/sdk/constructive-cli/src/api/orm/models/platformApiSetting.ts index 7326b52ed3..c84fedd66b 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformApiSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformApiSetting.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiSetting, PlatformApiSettingWithRelations, PlatformApiSettingSelect, PlatformApiSettingFilter, PlatformApiSettingOrderBy, CreatePlatformApiSettingInput, UpdatePlatformApiSettingInput, PlatformApiSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiSetting, + PlatformApiSettingWithRelations, + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy, + CreatePlatformApiSettingInput, + UpdatePlatformApiSettingInput, + PlatformApiSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSetting", "platformApiSettings", 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 - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiSetting', + 'platformApiSettings', + 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, + }, + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSettings", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiSetting", "platformApiSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiSetting', + 'platformApiSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSetting", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSetting": data.platformApiSettings?.nodes?.[0] ?? null - }) + platformApiSetting: data.platformApiSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSetting", "platformApiSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiSetting', + 'platformApiSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSetting", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSetting": data.platformApiSettings?.nodes?.[0] ?? null - }) + platformApiSetting: data.platformApiSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiSetting", "createPlatformApiSetting", "platformApiSetting", args.select, args.data, "CreatePlatformApiSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiSetting', + 'createPlatformApiSetting', + 'platformApiSetting', + args.select, + args.data, + 'CreatePlatformApiSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "createPlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'createPlatformApiSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiSetting", "updatePlatformApiSetting", "platformApiSetting", args.select, args.where.id, args.data, "UpdatePlatformApiSettingInput", "id", "platformApiSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiSetting', + 'updatePlatformApiSetting', + 'platformApiSetting', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiSettingInput', + 'id', + 'platformApiSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "updatePlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'updatePlatformApiSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiSetting", "deletePlatformApiSetting", "platformApiSetting", { - id: args.where.id - }, "DeletePlatformApiSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiSetting', + 'deletePlatformApiSetting', + 'platformApiSetting', + { + id: args.where.id, + }, + 'DeletePlatformApiSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "deletePlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'deletePlatformApiSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformCorsSetting.ts b/sdk/constructive-cli/src/api/orm/models/platformCorsSetting.ts index 5d692ac827..02f5ce48f3 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformCorsSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformCorsSetting.ts @@ -3,56 +3,96 @@ * @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 { PlatformCorsSetting, PlatformCorsSettingWithRelations, PlatformCorsSettingSelect, PlatformCorsSettingFilter, PlatformCorsSettingOrderBy, CreatePlatformCorsSettingInput, UpdatePlatformCorsSettingInput, PlatformCorsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformCorsSetting, + PlatformCorsSettingWithRelations, + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy, + CreatePlatformCorsSettingInput, + UpdatePlatformCorsSettingInput, + PlatformCorsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformCorsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformCorsSetting", "platformCorsSettings", 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 - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + 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, + }, + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSettings", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformCorsSetting", "platformCorsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSetting", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformCorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformCorsSetting": data.platformCorsSettings?.nodes?.[0] ?? null - }) + platformCorsSetting: data.platformCorsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformCorsSetting", "platformCorsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSetting", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformCorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformCorsSetting": data.platformCorsSettings?.nodes?.[0] ?? null - }) + platformCorsSetting: data.platformCorsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformCorsSetting", "createPlatformCorsSetting", "platformCorsSetting", args.select, args.data, "CreatePlatformCorsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformCorsSetting', + 'createPlatformCorsSetting', + 'platformCorsSetting', + args.select, + args.data, + 'CreatePlatformCorsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "createPlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'createPlatformCorsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformCorsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformCorsSetting", "updatePlatformCorsSetting", "platformCorsSetting", args.select, args.where.id, args.data, "UpdatePlatformCorsSettingInput", "id", "platformCorsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformCorsSetting', + 'updatePlatformCorsSetting', + 'platformCorsSetting', + args.select, + args.where.id, + args.data, + 'UpdatePlatformCorsSettingInput', + 'id', + 'platformCorsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "updatePlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'updatePlatformCorsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformCorsSetting", "deletePlatformCorsSetting", "platformCorsSetting", { - id: args.where.id - }, "DeletePlatformCorsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformCorsSetting', + 'deletePlatformCorsSetting', + 'platformCorsSetting', + { + id: args.where.id, + }, + 'DeletePlatformCorsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "deletePlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'deletePlatformCorsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformDomain.ts b/sdk/constructive-cli/src/api/orm/models/platformDomain.ts index e1c4721eee..a87fc3495a 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformDomain.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformDomain.ts @@ -3,56 +3,96 @@ * @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 { PlatformDomain, PlatformDomainWithRelations, PlatformDomainSelect, PlatformDomainFilter, PlatformDomainOrderBy, CreatePlatformDomainInput, UpdatePlatformDomainInput, PlatformDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomain, + PlatformDomainWithRelations, + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy, + CreatePlatformDomainInput, + UpdatePlatformDomainInput, + PlatformDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomain", "platformDomains", 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 - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomain', + 'platformDomains', + 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, + }, + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomains", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomain", "platformDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomain', + 'platformDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomain", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomain": data.platformDomains?.nodes?.[0] ?? null - }) + platformDomain: data.platformDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomain", "platformDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomain', + 'platformDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomain", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomain": data.platformDomains?.nodes?.[0] ?? null - }) + platformDomain: data.platformDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomain", "createPlatformDomain", "platformDomain", args.select, args.data, "CreatePlatformDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomain', + 'createPlatformDomain', + 'platformDomain', + args.select, + args.data, + 'CreatePlatformDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "createPlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'createPlatformDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomain", "updatePlatformDomain", "platformDomain", args.select, args.where.id, args.data, "UpdatePlatformDomainInput", "id", "platformDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomain', + 'updatePlatformDomain', + 'platformDomain', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainInput', + 'id', + 'platformDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "updatePlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'updatePlatformDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomain", "deletePlatformDomain", "platformDomain", { - id: args.where.id - }, "DeletePlatformDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomain', + 'deletePlatformDomain', + 'platformDomain', + { + id: args.where.id, + }, + 'DeletePlatformDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "deletePlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'deletePlatformDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformDomainEvent.ts b/sdk/constructive-cli/src/api/orm/models/platformDomainEvent.ts index cf74bef292..0626ef3a7a 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformDomainEvent.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformDomainEvent.ts @@ -3,56 +3,96 @@ * @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 { PlatformDomainEvent, PlatformDomainEventWithRelations, PlatformDomainEventSelect, PlatformDomainEventFilter, PlatformDomainEventOrderBy, CreatePlatformDomainEventInput, UpdatePlatformDomainEventInput, PlatformDomainEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomainEvent, + PlatformDomainEventWithRelations, + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy, + CreatePlatformDomainEventInput, + UpdatePlatformDomainEventInput, + PlatformDomainEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainEvent", "platformDomainEvents", 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 - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + 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, + }, + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvents", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomainEvent", "platformDomainEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvent", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformDomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainEvent": data.platformDomainEvents?.nodes?.[0] ?? null - }) + platformDomainEvent: data.platformDomainEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainEvent", "platformDomainEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvent", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformDomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainEvent": data.platformDomainEvents?.nodes?.[0] ?? null - }) + platformDomainEvent: data.platformDomainEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomainEvent", "createPlatformDomainEvent", "platformDomainEvent", args.select, args.data, "CreatePlatformDomainEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomainEvent', + 'createPlatformDomainEvent', + 'platformDomainEvent', + args.select, + args.data, + 'CreatePlatformDomainEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "createPlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'createPlatformDomainEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomainEvent", "updatePlatformDomainEvent", "platformDomainEvent", args.select, args.where.id, args.data, "UpdatePlatformDomainEventInput", "id", "platformDomainEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomainEvent', + 'updatePlatformDomainEvent', + 'platformDomainEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainEventInput', + 'id', + 'platformDomainEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "updatePlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'updatePlatformDomainEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomainEvent", "deletePlatformDomainEvent", "platformDomainEvent", { - id: args.where.id - }, "DeletePlatformDomainEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomainEvent', + 'deletePlatformDomainEvent', + 'platformDomainEvent', + { + id: args.where.id, + }, + 'DeletePlatformDomainEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "deletePlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'deletePlatformDomainEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformDomainVerification.ts b/sdk/constructive-cli/src/api/orm/models/platformDomainVerification.ts index c6066ed06f..92b3873048 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformDomainVerification.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformDomainVerification.ts @@ -3,56 +3,101 @@ * @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 { PlatformDomainVerification, PlatformDomainVerificationWithRelations, PlatformDomainVerificationSelect, PlatformDomainVerificationFilter, PlatformDomainVerificationOrderBy, CreatePlatformDomainVerificationInput, UpdatePlatformDomainVerificationInput, PlatformDomainVerificationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomainVerification, + PlatformDomainVerificationWithRelations, + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy, + CreatePlatformDomainVerificationInput, + UpdatePlatformDomainVerificationInput, + PlatformDomainVerificationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainVerificationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerifications: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerifications: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainVerification", "platformDomainVerifications", 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 - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + 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, + }, + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerifications", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerifications', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerification: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerification: InferSelectResult< + PlatformDomainVerificationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomainVerification", "platformDomainVerifications", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerification", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerification', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformDomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainVerification": data.platformDomainVerifications?.nodes?.[0] ?? null - }) + platformDomainVerification: data.platformDomainVerifications?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerification: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerification: InferSelectResult< + PlatformDomainVerificationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainVerification", "platformDomainVerifications", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerification", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerification', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformDomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainVerification": data.platformDomainVerifications?.nodes?.[0] ?? null - }) + platformDomainVerification: data.platformDomainVerifications?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomainVerification", "createPlatformDomainVerification", "platformDomainVerification", args.select, args.data, "CreatePlatformDomainVerificationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomainVerification', + 'createPlatformDomainVerification', + 'platformDomainVerification', + args.select, + args.data, + 'CreatePlatformDomainVerificationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "createPlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'createPlatformDomainVerification', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainVerificationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomainVerification", "updatePlatformDomainVerification", "platformDomainVerification", args.select, args.where.id, args.data, "UpdatePlatformDomainVerificationInput", "id", "platformDomainVerificationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomainVerification', + 'updatePlatformDomainVerification', + 'platformDomainVerification', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainVerificationInput', + 'id', + 'platformDomainVerificationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "updatePlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'updatePlatformDomainVerification', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomainVerification", "deletePlatformDomainVerification", "platformDomainVerification", { - id: args.where.id - }, "DeletePlatformDomainVerificationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomainVerification', + 'deletePlatformDomainVerification', + 'platformDomainVerification', + { + id: args.where.id, + }, + 'DeletePlatformDomainVerificationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "deletePlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'deletePlatformDomainVerification', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformManagedDomain.ts b/sdk/constructive-cli/src/api/orm/models/platformManagedDomain.ts index 28aa514693..3c1cc45243 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformManagedDomain.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformManagedDomain.ts @@ -3,56 +3,98 @@ * @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 { PlatformManagedDomain, PlatformManagedDomainWithRelations, PlatformManagedDomainSelect, PlatformManagedDomainFilter, PlatformManagedDomainOrderBy, CreatePlatformManagedDomainInput, UpdatePlatformManagedDomainInput, PlatformManagedDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformManagedDomain, + PlatformManagedDomainWithRelations, + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy, + CreatePlatformManagedDomainInput, + UpdatePlatformManagedDomainInput, + PlatformManagedDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformManagedDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformManagedDomains: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformManagedDomains: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformManagedDomain", "platformManagedDomains", 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 - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + 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, + }, + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomains", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformManagedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformManagedDomain", "platformManagedDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomain", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomain', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformManagedDomain": data.platformManagedDomains?.nodes?.[0] ?? null - }) + platformManagedDomain: data.platformManagedDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformManagedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformManagedDomain", "platformManagedDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomain", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomain', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformManagedDomain": data.platformManagedDomains?.nodes?.[0] ?? null - }) + platformManagedDomain: data.platformManagedDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformManagedDomain", "createPlatformManagedDomain", "platformManagedDomain", args.select, args.data, "CreatePlatformManagedDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformManagedDomain', + 'createPlatformManagedDomain', + 'platformManagedDomain', + args.select, + args.data, + 'CreatePlatformManagedDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "createPlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'createPlatformManagedDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformManagedDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformManagedDomain", "updatePlatformManagedDomain", "platformManagedDomain", args.select, args.where.id, args.data, "UpdatePlatformManagedDomainInput", "id", "platformManagedDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformManagedDomain', + 'updatePlatformManagedDomain', + 'platformManagedDomain', + args.select, + args.where.id, + args.data, + 'UpdatePlatformManagedDomainInput', + 'id', + 'platformManagedDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "updatePlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'updatePlatformManagedDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformManagedDomain", "deletePlatformManagedDomain", "platformManagedDomain", { - id: args.where.id - }, "DeletePlatformManagedDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformManagedDomain', + 'deletePlatformManagedDomain', + 'platformManagedDomain', + { + id: args.where.id, + }, + 'DeletePlatformManagedDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "deletePlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'deletePlatformManagedDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformSite.ts b/sdk/constructive-cli/src/api/orm/models/platformSite.ts index 7deeb9578e..4ac8c5a064 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformSite.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformSite.ts @@ -3,56 +3,96 @@ * @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 { PlatformSite, PlatformSiteWithRelations, PlatformSiteSelect, PlatformSiteFilter, PlatformSiteOrderBy, CreatePlatformSiteInput, UpdatePlatformSiteInput, PlatformSitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSite, + PlatformSiteWithRelations, + PlatformSiteSelect, + PlatformSiteFilter, + PlatformSiteOrderBy, + CreatePlatformSiteInput, + UpdatePlatformSiteInput, + PlatformSitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSite", "platformSites", 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 - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSite', + 'platformSites', + 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, + }, + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSites", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSite", "platformSites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSite', + 'platformSites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSite", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSite": data.platformSites?.nodes?.[0] ?? null - }) + platformSite: data.platformSites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSite", "platformSites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSite', + 'platformSites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSite", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSite": data.platformSites?.nodes?.[0] ?? null - }) + platformSite: data.platformSites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSite", "createPlatformSite", "platformSite", args.select, args.data, "CreatePlatformSiteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSite', + 'createPlatformSite', + 'platformSite', + args.select, + args.data, + 'CreatePlatformSiteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "createPlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'createPlatformSite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSite", "updatePlatformSite", "platformSite", args.select, args.where.id, args.data, "UpdatePlatformSiteInput", "id", "platformSitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSite', + 'updatePlatformSite', + 'platformSite', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteInput', + 'id', + 'platformSitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "updatePlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'updatePlatformSite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSite", "deletePlatformSite", "platformSite", { - id: args.where.id - }, "DeletePlatformSiteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSite', + 'deletePlatformSite', + 'platformSite', + { + id: args.where.id, + }, + 'DeletePlatformSiteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "deletePlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'deletePlatformSite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformSiteMetadatum.ts b/sdk/constructive-cli/src/api/orm/models/platformSiteMetadatum.ts index 181e7e7b02..8ca55b3e2d 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformSiteMetadatum.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformSiteMetadatum.ts @@ -3,56 +3,98 @@ * @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 { PlatformSiteMetadatum, PlatformSiteMetadatumWithRelations, PlatformSiteMetadatumSelect, PlatformSiteMetadatumFilter, PlatformSiteMetadatumOrderBy, CreatePlatformSiteMetadatumInput, UpdatePlatformSiteMetadatumInput, PlatformSiteMetadatumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteMetadatum, + PlatformSiteMetadatumWithRelations, + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy, + CreatePlatformSiteMetadatumInput, + UpdatePlatformSiteMetadatumInput, + PlatformSiteMetadatumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteMetadatumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformSiteMetadata: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformSiteMetadata: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteMetadatum", "platformSiteMetadata", 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 - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + 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, + }, + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadata", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadata', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteMetadatum", "platformSiteMetadata", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadatum", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadatum', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformSiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteMetadatum": data.platformSiteMetadata?.nodes?.[0] ?? null - }) + platformSiteMetadatum: data.platformSiteMetadata?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteMetadatum", "platformSiteMetadata", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadatum", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadatum', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformSiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteMetadatum": data.platformSiteMetadata?.nodes?.[0] ?? null - }) + platformSiteMetadatum: data.platformSiteMetadata?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteMetadatum", "createPlatformSiteMetadatum", "platformSiteMetadatum", args.select, args.data, "CreatePlatformSiteMetadatumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteMetadatum', + 'createPlatformSiteMetadatum', + 'platformSiteMetadatum', + args.select, + args.data, + 'CreatePlatformSiteMetadatumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "createPlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'createPlatformSiteMetadatum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteMetadatumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteMetadatum", "updatePlatformSiteMetadatum", "platformSiteMetadatum", args.select, args.where.id, args.data, "UpdatePlatformSiteMetadatumInput", "id", "platformSiteMetadatumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteMetadatum', + 'updatePlatformSiteMetadatum', + 'platformSiteMetadatum', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteMetadatumInput', + 'id', + 'platformSiteMetadatumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "updatePlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'updatePlatformSiteMetadatum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteMetadatum", "deletePlatformSiteMetadatum", "platformSiteMetadatum", { - id: args.where.id - }, "DeletePlatformSiteMetadatumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteMetadatum', + 'deletePlatformSiteMetadatum', + 'platformSiteMetadatum', + { + id: args.where.id, + }, + 'DeletePlatformSiteMetadatumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "deletePlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'deletePlatformSiteMetadatum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformSiteModule.ts b/sdk/constructive-cli/src/api/orm/models/platformSiteModule.ts index 0476688298..e01bb42a05 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformSiteModule.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformSiteModule.ts @@ -3,56 +3,96 @@ * @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 { PlatformSiteModule, PlatformSiteModuleWithRelations, PlatformSiteModuleSelect, PlatformSiteModuleFilter, PlatformSiteModuleOrderBy, CreatePlatformSiteModuleInput, UpdatePlatformSiteModuleInput, PlatformSiteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteModule, + PlatformSiteModuleWithRelations, + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy, + CreatePlatformSiteModuleInput, + UpdatePlatformSiteModuleInput, + PlatformSiteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteModule", "platformSiteModules", 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 - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteModule', + 'platformSiteModules', + 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, + }, + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModules", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteModule", "platformSiteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteModule', + 'platformSiteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModule", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteModule": data.platformSiteModules?.nodes?.[0] ?? null - }) + platformSiteModule: data.platformSiteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteModule", "platformSiteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteModule', + 'platformSiteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModule", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteModule": data.platformSiteModules?.nodes?.[0] ?? null - }) + platformSiteModule: data.platformSiteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteModule", "createPlatformSiteModule", "platformSiteModule", args.select, args.data, "CreatePlatformSiteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteModule', + 'createPlatformSiteModule', + 'platformSiteModule', + args.select, + args.data, + 'CreatePlatformSiteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "createPlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'createPlatformSiteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteModule", "updatePlatformSiteModule", "platformSiteModule", args.select, args.where.id, args.data, "UpdatePlatformSiteModuleInput", "id", "platformSiteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteModule', + 'updatePlatformSiteModule', + 'platformSiteModule', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteModuleInput', + 'id', + 'platformSiteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "updatePlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'updatePlatformSiteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteModule", "deletePlatformSiteModule", "platformSiteModule", { - id: args.where.id - }, "DeletePlatformSiteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteModule', + 'deletePlatformSiteModule', + 'platformSiteModule', + { + id: args.where.id, + }, + 'DeletePlatformSiteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "deletePlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'deletePlatformSiteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/platformSiteTheme.ts b/sdk/constructive-cli/src/api/orm/models/platformSiteTheme.ts index bc002ebb11..585071722f 100644 --- a/sdk/constructive-cli/src/api/orm/models/platformSiteTheme.ts +++ b/sdk/constructive-cli/src/api/orm/models/platformSiteTheme.ts @@ -3,56 +3,96 @@ * @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 { PlatformSiteTheme, PlatformSiteThemeWithRelations, PlatformSiteThemeSelect, PlatformSiteThemeFilter, PlatformSiteThemeOrderBy, CreatePlatformSiteThemeInput, UpdatePlatformSiteThemeInput, PlatformSiteThemePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteTheme, + PlatformSiteThemeWithRelations, + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy, + CreatePlatformSiteThemeInput, + UpdatePlatformSiteThemeInput, + PlatformSiteThemePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteThemeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteThemes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteTheme", "platformSiteThemes", 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 - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + 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, + }, + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteThemes", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteThemes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteTheme", "platformSiteThemes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteTheme", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteTheme', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteTheme": data.platformSiteThemes?.nodes?.[0] ?? null - }) + platformSiteTheme: data.platformSiteThemes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteTheme", "platformSiteThemes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteTheme", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteTheme', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteTheme": data.platformSiteThemes?.nodes?.[0] ?? null - }) + platformSiteTheme: data.platformSiteThemes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteTheme", "createPlatformSiteTheme", "platformSiteTheme", args.select, args.data, "CreatePlatformSiteThemeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteTheme', + 'createPlatformSiteTheme', + 'platformSiteTheme', + args.select, + args.data, + 'CreatePlatformSiteThemeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "createPlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'createPlatformSiteTheme', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteThemePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteTheme", "updatePlatformSiteTheme", "platformSiteTheme", args.select, args.where.id, args.data, "UpdatePlatformSiteThemeInput", "id", "platformSiteThemePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteTheme', + 'updatePlatformSiteTheme', + 'platformSiteTheme', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteThemeInput', + 'id', + 'platformSiteThemePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "updatePlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'updatePlatformSiteTheme', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteTheme", "deletePlatformSiteTheme", "platformSiteTheme", { - id: args.where.id - }, "DeletePlatformSiteThemeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteTheme', + 'deletePlatformSiteTheme', + 'platformSiteTheme', + { + id: args.where.id, + }, + 'DeletePlatformSiteThemeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "deletePlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'deletePlatformSiteTheme', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/policy.ts b/sdk/constructive-cli/src/api/orm/models/policy.ts index fd0c410789..0b50aa86d3 100644 --- a/sdk/constructive-cli/src/api/orm/models/policy.ts +++ b/sdk/constructive-cli/src/api/orm/models/policy.ts @@ -3,56 +3,96 @@ * @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 { Policy, PolicyWithRelations, PolicySelect, PolicyFilter, PolicyOrderBy, CreatePolicyInput, UpdatePolicyInput, PolicyPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Policy, + PolicyWithRelations, + PolicySelect, + PolicyFilter, + PolicyOrderBy, + CreatePolicyInput, + UpdatePolicyInput, + PolicyPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PolicyModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ policies: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Policy", "policies", 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 - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Policy', + 'policies', + 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, + }, + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policies", + operation: 'query', + operationName: 'Policy', + fieldName: 'policies', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ policy: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Policy", "policies", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Policy', + 'policies', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policy", + operation: 'query', + operationName: 'Policy', + fieldName: 'policy', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PolicyModel { nodes?: InferSelectResult[]; }; }) => ({ - "policy": data.policies?.nodes?.[0] ?? null - }) + policy: data.policies?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ policy: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Policy", "policies", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Policy', + 'policies', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policy", + operation: 'query', + operationName: 'Policy', + fieldName: 'policy', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PolicyModel { nodes?: InferSelectResult[]; }; }) => ({ - "policy": data.policies?.nodes?.[0] ?? null - }) + policy: data.policies?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Policy", "createPolicy", "policy", args.select, args.data, "CreatePolicyInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Policy', + 'createPolicy', + 'policy', + args.select, + args.data, + 'CreatePolicyInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "createPolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'createPolicy', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PolicyPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Policy", "updatePolicy", "policy", args.select, args.where.id, args.data, "UpdatePolicyInput", "id", "policyPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Policy', + 'updatePolicy', + 'policy', + args.select, + args.where.id, + args.data, + 'UpdatePolicyInput', + 'id', + 'policyPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "updatePolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'updatePolicy', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Policy", "deletePolicy", "policy", { - id: args.where.id - }, "DeletePolicyInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Policy', + 'deletePolicy', + 'policy', + { + id: args.where.id, + }, + 'DeletePolicyInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "deletePolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'deletePolicy', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/primaryKeyConstraint.ts b/sdk/constructive-cli/src/api/orm/models/primaryKeyConstraint.ts index a1015e4a8d..65f2946d86 100644 --- a/sdk/constructive-cli/src/api/orm/models/primaryKeyConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/primaryKeyConstraint.ts @@ -3,56 +3,98 @@ * @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 { PrimaryKeyConstraint, PrimaryKeyConstraintWithRelations, PrimaryKeyConstraintSelect, PrimaryKeyConstraintFilter, PrimaryKeyConstraintOrderBy, CreatePrimaryKeyConstraintInput, UpdatePrimaryKeyConstraintInput, PrimaryKeyConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PrimaryKeyConstraint, + PrimaryKeyConstraintWithRelations, + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy, + CreatePrimaryKeyConstraintInput, + UpdatePrimaryKeyConstraintInput, + PrimaryKeyConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PrimaryKeyConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - primaryKeyConstraints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + primaryKeyConstraints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PrimaryKeyConstraint", "primaryKeyConstraints", 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 - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + 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, + }, + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraints", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ primaryKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PrimaryKeyConstraint", "primaryKeyConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraint", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PrimaryKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "primaryKeyConstraint": data.primaryKeyConstraints?.nodes?.[0] ?? null - }) + primaryKeyConstraint: data.primaryKeyConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ primaryKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrimaryKeyConstraint", "primaryKeyConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraint", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PrimaryKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "primaryKeyConstraint": data.primaryKeyConstraints?.nodes?.[0] ?? null - }) + primaryKeyConstraint: data.primaryKeyConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrimaryKeyConstraint", "createPrimaryKeyConstraint", "primaryKeyConstraint", args.select, args.data, "CreatePrimaryKeyConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PrimaryKeyConstraint', + 'createPrimaryKeyConstraint', + 'primaryKeyConstraint', + args.select, + args.data, + 'CreatePrimaryKeyConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "createPrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'createPrimaryKeyConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrimaryKeyConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PrimaryKeyConstraint", "updatePrimaryKeyConstraint", "primaryKeyConstraint", args.select, args.where.id, args.data, "UpdatePrimaryKeyConstraintInput", "id", "primaryKeyConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PrimaryKeyConstraint', + 'updatePrimaryKeyConstraint', + 'primaryKeyConstraint', + args.select, + args.where.id, + args.data, + 'UpdatePrimaryKeyConstraintInput', + 'id', + 'primaryKeyConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "updatePrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'updatePrimaryKeyConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PrimaryKeyConstraint", "deletePrimaryKeyConstraint", "primaryKeyConstraint", { - id: args.where.id - }, "DeletePrimaryKeyConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PrimaryKeyConstraint', + 'deletePrimaryKeyConstraint', + 'primaryKeyConstraint', + { + id: args.where.id, + }, + 'DeletePrimaryKeyConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "deletePrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'deletePrimaryKeyConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/pubkeySetting.ts b/sdk/constructive-cli/src/api/orm/models/pubkeySetting.ts index 0108538df3..e44627cac6 100644 --- a/sdk/constructive-cli/src/api/orm/models/pubkeySetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/pubkeySetting.ts @@ -3,56 +3,96 @@ * @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 { PubkeySetting, PubkeySettingWithRelations, PubkeySettingSelect, PubkeySettingFilter, PubkeySettingOrderBy, CreatePubkeySettingInput, UpdatePubkeySettingInput, PubkeySettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PubkeySetting, + PubkeySettingWithRelations, + PubkeySettingSelect, + PubkeySettingFilter, + PubkeySettingOrderBy, + CreatePubkeySettingInput, + UpdatePubkeySettingInput, + PubkeySettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PubkeySettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PubkeySetting", "pubkeySettings", 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 - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PubkeySetting', + 'pubkeySettings', + 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, + }, + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySettings", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PubkeySetting", "pubkeySettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PubkeySetting', + 'pubkeySettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySetting", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PubkeySettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "pubkeySetting": data.pubkeySettings?.nodes?.[0] ?? null - }) + pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PubkeySetting", "pubkeySettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PubkeySetting', + 'pubkeySettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySetting", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PubkeySettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "pubkeySetting": data.pubkeySettings?.nodes?.[0] ?? null - }) + pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PubkeySetting", "createPubkeySetting", "pubkeySetting", args.select, args.data, "CreatePubkeySettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PubkeySetting', + 'createPubkeySetting', + 'pubkeySetting', + args.select, + args.data, + 'CreatePubkeySettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "createPubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'createPubkeySetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PubkeySettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PubkeySetting", "updatePubkeySetting", "pubkeySetting", args.select, args.where.id, args.data, "UpdatePubkeySettingInput", "id", "pubkeySettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PubkeySetting', + 'updatePubkeySetting', + 'pubkeySetting', + args.select, + args.where.id, + args.data, + 'UpdatePubkeySettingInput', + 'id', + 'pubkeySettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "updatePubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'updatePubkeySetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PubkeySetting", "deletePubkeySetting", "pubkeySetting", { - id: args.where.id - }, "DeletePubkeySettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PubkeySetting', + 'deletePubkeySetting', + 'pubkeySetting', + { + id: args.where.id, + }, + 'DeletePubkeySettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "deletePubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'deletePubkeySetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/rlsSetting.ts b/sdk/constructive-cli/src/api/orm/models/rlsSetting.ts index 235ffd888c..f371074a3a 100644 --- a/sdk/constructive-cli/src/api/orm/models/rlsSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/rlsSetting.ts @@ -3,56 +3,96 @@ * @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 { RlsSetting, RlsSettingWithRelations, RlsSettingSelect, RlsSettingFilter, RlsSettingOrderBy, CreateRlsSettingInput, UpdateRlsSettingInput, RlsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RlsSetting, + RlsSettingWithRelations, + RlsSettingSelect, + RlsSettingFilter, + RlsSettingOrderBy, + CreateRlsSettingInput, + UpdateRlsSettingInput, + RlsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RlsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RlsSetting", "rlsSettings", 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 - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RlsSetting', + 'rlsSettings', + 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, + }, + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSettings", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RlsSetting", "rlsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RlsSetting', + 'rlsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSetting", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RlsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsSetting": data.rlsSettings?.nodes?.[0] ?? null - }) + rlsSetting: data.rlsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RlsSetting", "rlsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RlsSetting', + 'rlsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSetting", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RlsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsSetting": data.rlsSettings?.nodes?.[0] ?? null - }) + rlsSetting: data.rlsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RlsSetting", "createRlsSetting", "rlsSetting", args.select, args.data, "CreateRlsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RlsSetting', + 'createRlsSetting', + 'rlsSetting', + args.select, + args.data, + 'CreateRlsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "createRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'createRlsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RlsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RlsSetting", "updateRlsSetting", "rlsSetting", args.select, args.where.id, args.data, "UpdateRlsSettingInput", "id", "rlsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RlsSetting', + 'updateRlsSetting', + 'rlsSetting', + args.select, + args.where.id, + args.data, + 'UpdateRlsSettingInput', + 'id', + 'rlsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "updateRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'updateRlsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RlsSetting", "deleteRlsSetting", "rlsSetting", { - id: args.where.id - }, "DeleteRlsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RlsSetting', + 'deleteRlsSetting', + 'rlsSetting', + { + id: args.where.id, + }, + 'DeleteRlsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "deleteRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'deleteRlsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/route.ts b/sdk/constructive-cli/src/api/orm/models/route.ts index 1377ead14a..0fbf96934f 100644 --- a/sdk/constructive-cli/src/api/orm/models/route.ts +++ b/sdk/constructive-cli/src/api/orm/models/route.ts @@ -3,56 +3,96 @@ * @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 { Route, RouteWithRelations, RouteSelect, RouteFilter, RouteOrderBy, CreateRouteInput, UpdateRouteInput, RoutePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Route, + RouteWithRelations, + RouteSelect, + RouteFilter, + RouteOrderBy, + CreateRouteInput, + UpdateRouteInput, + RoutePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Route", "routes", 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 - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Route', + 'routes', + 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, + }, + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "routes", + operation: 'query', + operationName: 'Route', + fieldName: 'routes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ route: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Route", "routes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Route', + 'routes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "route", + operation: 'query', + operationName: 'Route', + fieldName: 'route', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "route": data.routes?.nodes?.[0] ?? null - }) + route: data.routes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ route: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Route", "routes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Route', + 'routes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "route", + operation: 'query', + operationName: 'Route', + fieldName: 'route', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "route": data.routes?.nodes?.[0] ?? null - }) + route: data.routes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Route", "createRoute", "route", args.select, args.data, "CreateRouteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Route', + 'createRoute', + 'route', + args.select, + args.data, + 'CreateRouteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "createRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'createRoute', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RoutePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Route", "updateRoute", "route", args.select, args.where.id, args.data, "UpdateRouteInput", "id", "routePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Route', + 'updateRoute', + 'route', + args.select, + args.where.id, + args.data, + 'UpdateRouteInput', + 'id', + 'routePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "updateRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'updateRoute', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Route", "deleteRoute", "route", { - id: args.where.id - }, "DeleteRouteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Route', + 'deleteRoute', + 'route', + { + id: args.where.id, + }, + 'DeleteRouteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "deleteRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'deleteRoute', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/routeBinding.ts b/sdk/constructive-cli/src/api/orm/models/routeBinding.ts index 42c87f01af..3389ee7e37 100644 --- a/sdk/constructive-cli/src/api/orm/models/routeBinding.ts +++ b/sdk/constructive-cli/src/api/orm/models/routeBinding.ts @@ -3,56 +3,96 @@ * @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 { RouteBinding, RouteBindingWithRelations, RouteBindingSelect, RouteBindingFilter, RouteBindingOrderBy, CreateRouteBindingInput, UpdateRouteBindingInput, RouteBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RouteBinding, + RouteBindingWithRelations, + RouteBindingSelect, + RouteBindingFilter, + RouteBindingOrderBy, + CreateRouteBindingInput, + UpdateRouteBindingInput, + RouteBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RouteBinding", "routeBindings", 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 - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RouteBinding', + 'routeBindings', + 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, + }, + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBindings", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RouteBinding", "routeBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RouteBinding', + 'routeBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBinding", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeBinding": data.routeBindings?.nodes?.[0] ?? null - }) + routeBinding: data.routeBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RouteBinding", "routeBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RouteBinding', + 'routeBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBinding", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeBinding": data.routeBindings?.nodes?.[0] ?? null - }) + routeBinding: data.routeBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RouteBinding", "createRouteBinding", "routeBinding", args.select, args.data, "CreateRouteBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RouteBinding', + 'createRouteBinding', + 'routeBinding', + args.select, + args.data, + 'CreateRouteBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "createRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'createRouteBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RouteBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RouteBinding", "updateRouteBinding", "routeBinding", args.select, args.where.id, args.data, "UpdateRouteBindingInput", "id", "routeBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RouteBinding', + 'updateRouteBinding', + 'routeBinding', + args.select, + args.where.id, + args.data, + 'UpdateRouteBindingInput', + 'id', + 'routeBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "updateRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'updateRouteBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RouteBinding", "deleteRouteBinding", "routeBinding", { - id: args.where.id - }, "DeleteRouteBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RouteBinding', + 'deleteRouteBinding', + 'routeBinding', + { + id: args.where.id, + }, + 'DeleteRouteBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "deleteRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'deleteRouteBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/schema.ts b/sdk/constructive-cli/src/api/orm/models/schema.ts index f8ae9d0a19..d9d34cae1a 100644 --- a/sdk/constructive-cli/src/api/orm/models/schema.ts +++ b/sdk/constructive-cli/src/api/orm/models/schema.ts @@ -3,56 +3,96 @@ * @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 { Schema, SchemaWithRelations, SchemaSelect, SchemaFilter, SchemaOrderBy, CreateSchemaInput, UpdateSchemaInput, SchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Schema, + SchemaWithRelations, + SchemaSelect, + SchemaFilter, + SchemaOrderBy, + CreateSchemaInput, + UpdateSchemaInput, + SchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Schema", "schemas", 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 - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Schema', + 'schemas', + 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, + }, + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schemas", + operation: 'query', + operationName: 'Schema', + fieldName: 'schemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Schema", "schemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Schema', + 'schemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schema", + operation: 'query', + operationName: 'Schema', + fieldName: 'schema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "schema": data.schemas?.nodes?.[0] ?? null - }) + schema: data.schemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ schema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Schema", "schemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Schema', + 'schemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schema", + operation: 'query', + operationName: 'Schema', + fieldName: 'schema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "schema": data.schemas?.nodes?.[0] ?? null - }) + schema: data.schemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Schema", "createSchema", "schema", args.select, args.data, "CreateSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Schema', + 'createSchema', + 'schema', + args.select, + args.data, + 'CreateSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "createSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'createSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Schema", "updateSchema", "schema", args.select, args.where.id, args.data, "UpdateSchemaInput", "id", "schemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Schema', + 'updateSchema', + 'schema', + args.select, + args.where.id, + args.data, + 'UpdateSchemaInput', + 'id', + 'schemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "updateSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'updateSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Schema", "deleteSchema", "schema", { - id: args.where.id - }, "DeleteSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Schema', + 'deleteSchema', + 'schema', + { + id: args.where.id, + }, + 'DeleteSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "deleteSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'deleteSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/schemaGrant.ts b/sdk/constructive-cli/src/api/orm/models/schemaGrant.ts index 5c4171b93b..553345a2b3 100644 --- a/sdk/constructive-cli/src/api/orm/models/schemaGrant.ts +++ b/sdk/constructive-cli/src/api/orm/models/schemaGrant.ts @@ -3,56 +3,96 @@ * @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 { SchemaGrant, SchemaGrantWithRelations, SchemaGrantSelect, SchemaGrantFilter, SchemaGrantOrderBy, CreateSchemaGrantInput, UpdateSchemaGrantInput, SchemaGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SchemaGrant, + SchemaGrantWithRelations, + SchemaGrantSelect, + SchemaGrantFilter, + SchemaGrantOrderBy, + CreateSchemaGrantInput, + UpdateSchemaGrantInput, + SchemaGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SchemaGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SchemaGrant", "schemaGrants", 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 - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SchemaGrant', + 'schemaGrants', + 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, + }, + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrants", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SchemaGrant", "schemaGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SchemaGrant', + 'schemaGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrant", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SchemaGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "schemaGrant": data.schemaGrants?.nodes?.[0] ?? null - }) + schemaGrant: data.schemaGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SchemaGrant", "schemaGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SchemaGrant', + 'schemaGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrant", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SchemaGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "schemaGrant": data.schemaGrants?.nodes?.[0] ?? null - }) + schemaGrant: data.schemaGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SchemaGrant", "createSchemaGrant", "schemaGrant", args.select, args.data, "CreateSchemaGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SchemaGrant', + 'createSchemaGrant', + 'schemaGrant', + args.select, + args.data, + 'CreateSchemaGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "createSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'createSchemaGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SchemaGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SchemaGrant", "updateSchemaGrant", "schemaGrant", args.select, args.where.id, args.data, "UpdateSchemaGrantInput", "id", "schemaGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SchemaGrant', + 'updateSchemaGrant', + 'schemaGrant', + args.select, + args.where.id, + args.data, + 'UpdateSchemaGrantInput', + 'id', + 'schemaGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "updateSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'updateSchemaGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SchemaGrant", "deleteSchemaGrant", "schemaGrant", { - id: args.where.id - }, "DeleteSchemaGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SchemaGrant', + 'deleteSchemaGrant', + 'schemaGrant', + { + id: args.where.id, + }, + 'DeleteSchemaGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "deleteSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'deleteSchemaGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/site.ts b/sdk/constructive-cli/src/api/orm/models/site.ts index 40992146a5..30c5c8f81a 100644 --- a/sdk/constructive-cli/src/api/orm/models/site.ts +++ b/sdk/constructive-cli/src/api/orm/models/site.ts @@ -3,56 +3,96 @@ * @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 { Site, SiteWithRelations, SiteSelect, SiteFilter, SiteOrderBy, CreateSiteInput, UpdateSiteInput, SitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Site, + SiteWithRelations, + SiteSelect, + SiteFilter, + SiteOrderBy, + CreateSiteInput, + UpdateSiteInput, + SitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Site", "sites", 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 - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Site', + 'sites', + 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, + }, + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "sites", + operation: 'query', + operationName: 'Site', + fieldName: 'sites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ site: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Site", "sites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Site', + 'sites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "site", + operation: 'query', + operationName: 'Site', + fieldName: 'site', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "site": data.sites?.nodes?.[0] ?? null - }) + site: data.sites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ site: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Site", "sites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Site', + 'sites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "site", + operation: 'query', + operationName: 'Site', + fieldName: 'site', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "site": data.sites?.nodes?.[0] ?? null - }) + site: data.sites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Site", "createSite", "site", args.select, args.data, "CreateSiteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Site', + 'createSite', + 'site', + args.select, + args.data, + 'CreateSiteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "createSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'createSite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Site", "updateSite", "site", args.select, args.where.id, args.data, "UpdateSiteInput", "id", "sitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Site', + 'updateSite', + 'site', + args.select, + args.where.id, + args.data, + 'UpdateSiteInput', + 'id', + 'sitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "updateSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'updateSite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Site", "deleteSite", "site", { - id: args.where.id - }, "DeleteSiteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Site', + 'deleteSite', + 'site', + { + id: args.where.id, + }, + 'DeleteSiteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "deleteSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'deleteSite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/siteMetadatum.ts b/sdk/constructive-cli/src/api/orm/models/siteMetadatum.ts index c5119c2a96..1e8bc08f33 100644 --- a/sdk/constructive-cli/src/api/orm/models/siteMetadatum.ts +++ b/sdk/constructive-cli/src/api/orm/models/siteMetadatum.ts @@ -3,56 +3,96 @@ * @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 { SiteMetadatum, SiteMetadatumWithRelations, SiteMetadatumSelect, SiteMetadatumFilter, SiteMetadatumOrderBy, CreateSiteMetadatumInput, UpdateSiteMetadatumInput, SiteMetadatumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteMetadatum, + SiteMetadatumWithRelations, + SiteMetadatumSelect, + SiteMetadatumFilter, + SiteMetadatumOrderBy, + CreateSiteMetadatumInput, + UpdateSiteMetadatumInput, + SiteMetadatumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteMetadatumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadata: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteMetadatum", "siteMetadata", 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 - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteMetadatum', + 'siteMetadata', + 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, + }, + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadata", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadata', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteMetadatum", "siteMetadata", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteMetadatum', + 'siteMetadata', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadatum", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadatum', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteMetadatum": data.siteMetadata?.nodes?.[0] ?? null - }) + siteMetadatum: data.siteMetadata?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteMetadatum", "siteMetadata", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteMetadatum', + 'siteMetadata', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadatum", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadatum', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteMetadatum": data.siteMetadata?.nodes?.[0] ?? null - }) + siteMetadatum: data.siteMetadata?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteMetadatum", "createSiteMetadatum", "siteMetadatum", args.select, args.data, "CreateSiteMetadatumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteMetadatum', + 'createSiteMetadatum', + 'siteMetadatum', + args.select, + args.data, + 'CreateSiteMetadatumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "createSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'createSiteMetadatum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteMetadatumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteMetadatum", "updateSiteMetadatum", "siteMetadatum", args.select, args.where.id, args.data, "UpdateSiteMetadatumInput", "id", "siteMetadatumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteMetadatum', + 'updateSiteMetadatum', + 'siteMetadatum', + args.select, + args.where.id, + args.data, + 'UpdateSiteMetadatumInput', + 'id', + 'siteMetadatumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "updateSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'updateSiteMetadatum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteMetadatum", "deleteSiteMetadatum", "siteMetadatum", { - id: args.where.id - }, "DeleteSiteMetadatumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteMetadatum', + 'deleteSiteMetadatum', + 'siteMetadatum', + { + id: args.where.id, + }, + 'DeleteSiteMetadatumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "deleteSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'deleteSiteMetadatum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/siteModule.ts b/sdk/constructive-cli/src/api/orm/models/siteModule.ts index 0cbd99db46..fe7f43bf62 100644 --- a/sdk/constructive-cli/src/api/orm/models/siteModule.ts +++ b/sdk/constructive-cli/src/api/orm/models/siteModule.ts @@ -3,56 +3,96 @@ * @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 { SiteModule, SiteModuleWithRelations, SiteModuleSelect, SiteModuleFilter, SiteModuleOrderBy, CreateSiteModuleInput, UpdateSiteModuleInput, SiteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteModule, + SiteModuleWithRelations, + SiteModuleSelect, + SiteModuleFilter, + SiteModuleOrderBy, + CreateSiteModuleInput, + UpdateSiteModuleInput, + SiteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteModule", "siteModules", 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 - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteModule', + 'siteModules', + 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, + }, + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModules", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteModule", "siteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteModule', + 'siteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModule", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteModule": data.siteModules?.nodes?.[0] ?? null - }) + siteModule: data.siteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteModule", "siteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteModule', + 'siteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModule", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteModule": data.siteModules?.nodes?.[0] ?? null - }) + siteModule: data.siteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteModule", "createSiteModule", "siteModule", args.select, args.data, "CreateSiteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteModule', + 'createSiteModule', + 'siteModule', + args.select, + args.data, + 'CreateSiteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "createSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'createSiteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteModule", "updateSiteModule", "siteModule", args.select, args.where.id, args.data, "UpdateSiteModuleInput", "id", "siteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteModule', + 'updateSiteModule', + 'siteModule', + args.select, + args.where.id, + args.data, + 'UpdateSiteModuleInput', + 'id', + 'siteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "updateSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'updateSiteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteModule", "deleteSiteModule", "siteModule", { - id: args.where.id - }, "DeleteSiteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteModule', + 'deleteSiteModule', + 'siteModule', + { + id: args.where.id, + }, + 'DeleteSiteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "deleteSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'deleteSiteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/siteTheme.ts b/sdk/constructive-cli/src/api/orm/models/siteTheme.ts index 9244052766..51551f60db 100644 --- a/sdk/constructive-cli/src/api/orm/models/siteTheme.ts +++ b/sdk/constructive-cli/src/api/orm/models/siteTheme.ts @@ -3,56 +3,96 @@ * @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 { SiteTheme, SiteThemeWithRelations, SiteThemeSelect, SiteThemeFilter, SiteThemeOrderBy, CreateSiteThemeInput, UpdateSiteThemeInput, SiteThemePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteTheme, + SiteThemeWithRelations, + SiteThemeSelect, + SiteThemeFilter, + SiteThemeOrderBy, + CreateSiteThemeInput, + UpdateSiteThemeInput, + SiteThemePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteThemeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteThemes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteTheme", "siteThemes", 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 - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteTheme', + 'siteThemes', + 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, + }, + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteThemes", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteThemes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteTheme", "siteThemes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteTheme', + 'siteThemes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteTheme", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteTheme', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteTheme": data.siteThemes?.nodes?.[0] ?? null - }) + siteTheme: data.siteThemes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteTheme", "siteThemes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteTheme', + 'siteThemes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteTheme", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteTheme', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteTheme": data.siteThemes?.nodes?.[0] ?? null - }) + siteTheme: data.siteThemes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteTheme", "createSiteTheme", "siteTheme", args.select, args.data, "CreateSiteThemeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteTheme', + 'createSiteTheme', + 'siteTheme', + args.select, + args.data, + 'CreateSiteThemeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "createSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'createSiteTheme', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteThemePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteTheme", "updateSiteTheme", "siteTheme", args.select, args.where.id, args.data, "UpdateSiteThemeInput", "id", "siteThemePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteTheme', + 'updateSiteTheme', + 'siteTheme', + args.select, + args.where.id, + args.data, + 'UpdateSiteThemeInput', + 'id', + 'siteThemePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "updateSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'updateSiteTheme', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteTheme", "deleteSiteTheme", "siteTheme", { - id: args.where.id - }, "DeleteSiteThemeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteTheme', + 'deleteSiteTheme', + 'siteTheme', + { + id: args.where.id, + }, + 'DeleteSiteThemeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "deleteSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'deleteSiteTheme', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/spatialRelation.ts b/sdk/constructive-cli/src/api/orm/models/spatialRelation.ts index 6ef5ccab36..31de43c115 100644 --- a/sdk/constructive-cli/src/api/orm/models/spatialRelation.ts +++ b/sdk/constructive-cli/src/api/orm/models/spatialRelation.ts @@ -3,56 +3,96 @@ * @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 { SpatialRelation, SpatialRelationWithRelations, SpatialRelationSelect, SpatialRelationFilter, SpatialRelationOrderBy, CreateSpatialRelationInput, UpdateSpatialRelationInput, SpatialRelationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SpatialRelation, + SpatialRelationWithRelations, + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy, + CreateSpatialRelationInput, + UpdateSpatialRelationInput, + SpatialRelationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SpatialRelationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SpatialRelation", "spatialRelations", 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 - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SpatialRelation', + 'spatialRelations', + 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, + }, + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelations", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SpatialRelation", "spatialRelations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SpatialRelation', + 'spatialRelations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelation", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelation', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SpatialRelationModel { nodes?: InferSelectResult[]; }; }) => ({ - "spatialRelation": data.spatialRelations?.nodes?.[0] ?? null - }) + spatialRelation: data.spatialRelations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SpatialRelation", "spatialRelations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SpatialRelation', + 'spatialRelations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelation", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelation', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SpatialRelationModel { nodes?: InferSelectResult[]; }; }) => ({ - "spatialRelation": data.spatialRelations?.nodes?.[0] ?? null - }) + spatialRelation: data.spatialRelations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SpatialRelation", "createSpatialRelation", "spatialRelation", args.select, args.data, "CreateSpatialRelationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SpatialRelation', + 'createSpatialRelation', + 'spatialRelation', + args.select, + args.data, + 'CreateSpatialRelationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "createSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'createSpatialRelation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SpatialRelationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SpatialRelation", "updateSpatialRelation", "spatialRelation", args.select, args.where.id, args.data, "UpdateSpatialRelationInput", "id", "spatialRelationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SpatialRelation', + 'updateSpatialRelation', + 'spatialRelation', + args.select, + args.where.id, + args.data, + 'UpdateSpatialRelationInput', + 'id', + 'spatialRelationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "updateSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'updateSpatialRelation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SpatialRelation", "deleteSpatialRelation", "spatialRelation", { - id: args.where.id - }, "DeleteSpatialRelationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SpatialRelation', + 'deleteSpatialRelation', + 'spatialRelation', + { + id: args.where.id, + }, + 'DeleteSpatialRelationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "deleteSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'deleteSpatialRelation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/sqlAction.ts b/sdk/constructive-cli/src/api/orm/models/sqlAction.ts index 8099171baf..74b4418688 100644 --- a/sdk/constructive-cli/src/api/orm/models/sqlAction.ts +++ b/sdk/constructive-cli/src/api/orm/models/sqlAction.ts @@ -3,56 +3,96 @@ * @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 { SqlAction, SqlActionWithRelations, SqlActionSelect, SqlActionFilter, SqlActionOrderBy, CreateSqlActionInput, UpdateSqlActionInput, SqlActionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SqlAction, + SqlActionWithRelations, + SqlActionSelect, + SqlActionFilter, + SqlActionOrderBy, + CreateSqlActionInput, + UpdateSqlActionInput, + SqlActionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SqlActionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlActions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SqlAction", "sqlActions", 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 - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SqlAction', + 'sqlActions', + 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, + }, + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlActions", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlActions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlAction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SqlAction", "sqlActions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SqlAction', + 'sqlActions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlAction", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlAction', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SqlActionModel { nodes?: InferSelectResult[]; }; }) => ({ - "sqlAction": data.sqlActions?.nodes?.[0] ?? null - }) + sqlAction: data.sqlActions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlAction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SqlAction", "sqlActions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SqlAction', + 'sqlActions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlAction", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlAction', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class SqlActionModel { nodes?: InferSelectResult[]; }; }) => ({ - "sqlAction": data.sqlActions?.nodes?.[0] ?? null - }) + sqlAction: data.sqlActions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSqlAction: { sqlAction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SqlAction", "createSqlAction", "sqlAction", args.select, args.data, "CreateSqlActionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SqlAction', + 'createSqlAction', + 'sqlAction', + args.select, + args.data, + 'CreateSqlActionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SqlAction", - fieldName: "createSqlAction", + operation: 'mutation', + operationName: 'SqlAction', + fieldName: 'createSqlAction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/table.ts b/sdk/constructive-cli/src/api/orm/models/table.ts index 5cb18d7cb1..1f8df77e80 100644 --- a/sdk/constructive-cli/src/api/orm/models/table.ts +++ b/sdk/constructive-cli/src/api/orm/models/table.ts @@ -3,56 +3,96 @@ * @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 { Table, TableWithRelations, TableSelect, TableFilter, TableOrderBy, CreateTableInput, UpdateTableInput, TablePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Table, + TableWithRelations, + TableSelect, + TableFilter, + TableOrderBy, + CreateTableInput, + UpdateTableInput, + TablePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TableModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tables: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Table", "tables", 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 - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Table', + 'tables', + 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, + }, + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "tables", + operation: 'query', + operationName: 'Table', + fieldName: 'tables', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ table: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Table", "tables", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Table', + 'tables', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "table", + operation: 'query', + operationName: 'Table', + fieldName: 'table', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TableModel { nodes?: InferSelectResult[]; }; }) => ({ - "table": data.tables?.nodes?.[0] ?? null - }) + table: data.tables?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ table: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Table", "tables", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Table', + 'tables', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "table", + operation: 'query', + operationName: 'Table', + fieldName: 'table', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TableModel { nodes?: InferSelectResult[]; }; }) => ({ - "table": data.tables?.nodes?.[0] ?? null - }) + table: data.tables?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Table", "createTable", "table", args.select, args.data, "CreateTableInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Table', + 'createTable', + 'table', + args.select, + args.data, + 'CreateTableInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "createTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'createTable', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TablePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Table", "updateTable", "table", args.select, args.where.id, args.data, "UpdateTableInput", "id", "tablePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Table', + 'updateTable', + 'table', + args.select, + args.where.id, + args.data, + 'UpdateTableInput', + 'id', + 'tablePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "updateTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'updateTable', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Table", "deleteTable", "table", { - id: args.where.id - }, "DeleteTableInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Table', + 'deleteTable', + 'table', + { + id: args.where.id, + }, + 'DeleteTableInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "deleteTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'deleteTable', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/tableGrant.ts b/sdk/constructive-cli/src/api/orm/models/tableGrant.ts index 6e028cfbf7..b49372245a 100644 --- a/sdk/constructive-cli/src/api/orm/models/tableGrant.ts +++ b/sdk/constructive-cli/src/api/orm/models/tableGrant.ts @@ -3,56 +3,96 @@ * @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 { TableGrant, TableGrantWithRelations, TableGrantSelect, TableGrantFilter, TableGrantOrderBy, CreateTableGrantInput, UpdateTableGrantInput, TableGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TableGrant, + TableGrantWithRelations, + TableGrantSelect, + TableGrantFilter, + TableGrantOrderBy, + CreateTableGrantInput, + UpdateTableGrantInput, + TableGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TableGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TableGrant", "tableGrants", 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 - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TableGrant', + 'tableGrants', + 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, + }, + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrants", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TableGrant", "tableGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TableGrant', + 'tableGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrant", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TableGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "tableGrant": data.tableGrants?.nodes?.[0] ?? null - }) + tableGrant: data.tableGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TableGrant", "tableGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TableGrant', + 'tableGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrant", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TableGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "tableGrant": data.tableGrants?.nodes?.[0] ?? null - }) + tableGrant: data.tableGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TableGrant", "createTableGrant", "tableGrant", args.select, args.data, "CreateTableGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TableGrant', + 'createTableGrant', + 'tableGrant', + args.select, + args.data, + 'CreateTableGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "createTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'createTableGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TableGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TableGrant", "updateTableGrant", "tableGrant", args.select, args.where.id, args.data, "UpdateTableGrantInput", "id", "tableGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TableGrant', + 'updateTableGrant', + 'tableGrant', + args.select, + args.where.id, + args.data, + 'UpdateTableGrantInput', + 'id', + 'tableGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "updateTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'updateTableGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TableGrant", "deleteTableGrant", "tableGrant", { - id: args.where.id - }, "DeleteTableGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TableGrant', + 'deleteTableGrant', + 'tableGrant', + { + id: args.where.id, + }, + 'DeleteTableGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "deleteTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'deleteTableGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/trigger.ts b/sdk/constructive-cli/src/api/orm/models/trigger.ts index bacb29512c..47169bc484 100644 --- a/sdk/constructive-cli/src/api/orm/models/trigger.ts +++ b/sdk/constructive-cli/src/api/orm/models/trigger.ts @@ -3,56 +3,96 @@ * @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 { Trigger, TriggerWithRelations, TriggerSelect, TriggerFilter, TriggerOrderBy, CreateTriggerInput, UpdateTriggerInput, TriggerPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Trigger, + TriggerWithRelations, + TriggerSelect, + TriggerFilter, + TriggerOrderBy, + CreateTriggerInput, + UpdateTriggerInput, + TriggerPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TriggerModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Trigger", "triggers", 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 - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Trigger', + 'triggers', + 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, + }, + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "triggers", + operation: 'query', + operationName: 'Trigger', + fieldName: 'triggers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ trigger: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Trigger", "triggers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Trigger', + 'triggers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "trigger", + operation: 'query', + operationName: 'Trigger', + fieldName: 'trigger', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TriggerModel { nodes?: InferSelectResult[]; }; }) => ({ - "trigger": data.triggers?.nodes?.[0] ?? null - }) + trigger: data.triggers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ trigger: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Trigger", "triggers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Trigger', + 'triggers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "trigger", + operation: 'query', + operationName: 'Trigger', + fieldName: 'trigger', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TriggerModel { nodes?: InferSelectResult[]; }; }) => ({ - "trigger": data.triggers?.nodes?.[0] ?? null - }) + trigger: data.triggers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Trigger", "createTrigger", "trigger", args.select, args.data, "CreateTriggerInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Trigger', + 'createTrigger', + 'trigger', + args.select, + args.data, + 'CreateTriggerInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "createTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'createTrigger', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TriggerPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Trigger", "updateTrigger", "trigger", args.select, args.where.id, args.data, "UpdateTriggerInput", "id", "triggerPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Trigger', + 'updateTrigger', + 'trigger', + args.select, + args.where.id, + args.data, + 'UpdateTriggerInput', + 'id', + 'triggerPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "updateTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'updateTrigger', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Trigger", "deleteTrigger", "trigger", { - id: args.where.id - }, "DeleteTriggerInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Trigger', + 'deleteTrigger', + 'trigger', + { + id: args.where.id, + }, + 'DeleteTriggerInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "deleteTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'deleteTrigger', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/triggerFunction.ts b/sdk/constructive-cli/src/api/orm/models/triggerFunction.ts index 27384220c3..40d2ee283e 100644 --- a/sdk/constructive-cli/src/api/orm/models/triggerFunction.ts +++ b/sdk/constructive-cli/src/api/orm/models/triggerFunction.ts @@ -3,56 +3,96 @@ * @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 { TriggerFunction, TriggerFunctionWithRelations, TriggerFunctionSelect, TriggerFunctionFilter, TriggerFunctionOrderBy, CreateTriggerFunctionInput, UpdateTriggerFunctionInput, TriggerFunctionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TriggerFunction, + TriggerFunctionWithRelations, + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy, + CreateTriggerFunctionInput, + UpdateTriggerFunctionInput, + TriggerFunctionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TriggerFunctionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunctions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TriggerFunction", "triggerFunctions", 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 - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TriggerFunction', + 'triggerFunctions', + 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, + }, + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunctions", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunctions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TriggerFunction", "triggerFunctions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TriggerFunction', + 'triggerFunctions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunction", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunction', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TriggerFunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "triggerFunction": data.triggerFunctions?.nodes?.[0] ?? null - }) + triggerFunction: data.triggerFunctions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TriggerFunction", "triggerFunctions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TriggerFunction', + 'triggerFunctions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunction", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunction', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TriggerFunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "triggerFunction": data.triggerFunctions?.nodes?.[0] ?? null - }) + triggerFunction: data.triggerFunctions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TriggerFunction", "createTriggerFunction", "triggerFunction", args.select, args.data, "CreateTriggerFunctionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TriggerFunction', + 'createTriggerFunction', + 'triggerFunction', + args.select, + args.data, + 'CreateTriggerFunctionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "createTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'createTriggerFunction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TriggerFunctionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TriggerFunction", "updateTriggerFunction", "triggerFunction", args.select, args.where.id, args.data, "UpdateTriggerFunctionInput", "id", "triggerFunctionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TriggerFunction', + 'updateTriggerFunction', + 'triggerFunction', + args.select, + args.where.id, + args.data, + 'UpdateTriggerFunctionInput', + 'id', + 'triggerFunctionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "updateTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'updateTriggerFunction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TriggerFunction", "deleteTriggerFunction", "triggerFunction", { - id: args.where.id - }, "DeleteTriggerFunctionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TriggerFunction', + 'deleteTriggerFunction', + 'triggerFunction', + { + id: args.where.id, + }, + 'DeleteTriggerFunctionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "deleteTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'deleteTriggerFunction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/uniqueConstraint.ts b/sdk/constructive-cli/src/api/orm/models/uniqueConstraint.ts index 2664f51152..0880a23e50 100644 --- a/sdk/constructive-cli/src/api/orm/models/uniqueConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/uniqueConstraint.ts @@ -3,56 +3,96 @@ * @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 { UniqueConstraint, UniqueConstraintWithRelations, UniqueConstraintSelect, UniqueConstraintFilter, UniqueConstraintOrderBy, CreateUniqueConstraintInput, UpdateUniqueConstraintInput, UniqueConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UniqueConstraint, + UniqueConstraintWithRelations, + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy, + CreateUniqueConstraintInput, + UpdateUniqueConstraintInput, + UniqueConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UniqueConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UniqueConstraint", "uniqueConstraints", 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 - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UniqueConstraint', + 'uniqueConstraints', + 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, + }, + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraints", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UniqueConstraint", "uniqueConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UniqueConstraint', + 'uniqueConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraint", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UniqueConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "uniqueConstraint": data.uniqueConstraints?.nodes?.[0] ?? null - }) + uniqueConstraint: data.uniqueConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UniqueConstraint", "uniqueConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UniqueConstraint', + 'uniqueConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraint", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UniqueConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "uniqueConstraint": data.uniqueConstraints?.nodes?.[0] ?? null - }) + uniqueConstraint: data.uniqueConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UniqueConstraint", "createUniqueConstraint", "uniqueConstraint", args.select, args.data, "CreateUniqueConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UniqueConstraint', + 'createUniqueConstraint', + 'uniqueConstraint', + args.select, + args.data, + 'CreateUniqueConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "createUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'createUniqueConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UniqueConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UniqueConstraint", "updateUniqueConstraint", "uniqueConstraint", args.select, args.where.id, args.data, "UpdateUniqueConstraintInput", "id", "uniqueConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UniqueConstraint', + 'updateUniqueConstraint', + 'uniqueConstraint', + args.select, + args.where.id, + args.data, + 'UpdateUniqueConstraintInput', + 'id', + 'uniqueConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "updateUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'updateUniqueConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UniqueConstraint", "deleteUniqueConstraint", "uniqueConstraint", { - id: args.where.id - }, "DeleteUniqueConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UniqueConstraint', + 'deleteUniqueConstraint', + 'uniqueConstraint', + { + id: args.where.id, + }, + 'DeleteUniqueConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "deleteUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'deleteUniqueConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/view.ts b/sdk/constructive-cli/src/api/orm/models/view.ts index aad1e83070..04afa60a84 100644 --- a/sdk/constructive-cli/src/api/orm/models/view.ts +++ b/sdk/constructive-cli/src/api/orm/models/view.ts @@ -3,56 +3,96 @@ * @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 { View, ViewWithRelations, ViewSelect, ViewFilter, ViewOrderBy, CreateViewInput, UpdateViewInput, ViewPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + View, + ViewWithRelations, + ViewSelect, + ViewFilter, + ViewOrderBy, + CreateViewInput, + UpdateViewInput, + ViewPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ views: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("View", "views", 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 - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'View', + 'views', + 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, + }, + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "views", + operation: 'query', + operationName: 'View', + fieldName: 'views', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ view: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("View", "views", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'View', + 'views', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "view", + operation: 'query', + operationName: 'View', + fieldName: 'view', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewModel { nodes?: InferSelectResult[]; }; }) => ({ - "view": data.views?.nodes?.[0] ?? null - }) + view: data.views?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ view: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("View", "views", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'View', + 'views', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "view", + operation: 'query', + operationName: 'View', + fieldName: 'view', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewModel { nodes?: InferSelectResult[]; }; }) => ({ - "view": data.views?.nodes?.[0] ?? null - }) + view: data.views?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("View", "createView", "view", args.select, args.data, "CreateViewInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'View', + 'createView', + 'view', + args.select, + args.data, + 'CreateViewInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "createView", + operation: 'mutation', + operationName: 'View', + fieldName: 'createView', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("View", "updateView", "view", args.select, args.where.id, args.data, "UpdateViewInput", "id", "viewPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'View', + 'updateView', + 'view', + args.select, + args.where.id, + args.data, + 'UpdateViewInput', + 'id', + 'viewPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "updateView", + operation: 'mutation', + operationName: 'View', + fieldName: 'updateView', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("View", "deleteView", "view", { - id: args.where.id - }, "DeleteViewInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'View', + 'deleteView', + 'view', + { + id: args.where.id, + }, + 'DeleteViewInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "deleteView", + operation: 'mutation', + operationName: 'View', + fieldName: 'deleteView', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/viewGrant.ts b/sdk/constructive-cli/src/api/orm/models/viewGrant.ts index ee6c58946a..7f9b69a42c 100644 --- a/sdk/constructive-cli/src/api/orm/models/viewGrant.ts +++ b/sdk/constructive-cli/src/api/orm/models/viewGrant.ts @@ -3,56 +3,96 @@ * @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 { ViewGrant, ViewGrantWithRelations, ViewGrantSelect, ViewGrantFilter, ViewGrantOrderBy, CreateViewGrantInput, UpdateViewGrantInput, ViewGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewGrant, + ViewGrantWithRelations, + ViewGrantSelect, + ViewGrantFilter, + ViewGrantOrderBy, + CreateViewGrantInput, + UpdateViewGrantInput, + ViewGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewGrant", "viewGrants", 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 - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewGrant', + 'viewGrants', + 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, + }, + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrants", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewGrant", "viewGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewGrant', + 'viewGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrant", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewGrant": data.viewGrants?.nodes?.[0] ?? null - }) + viewGrant: data.viewGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewGrant", "viewGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewGrant', + 'viewGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrant", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewGrant": data.viewGrants?.nodes?.[0] ?? null - }) + viewGrant: data.viewGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewGrant", "createViewGrant", "viewGrant", args.select, args.data, "CreateViewGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewGrant', + 'createViewGrant', + 'viewGrant', + args.select, + args.data, + 'CreateViewGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "createViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'createViewGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewGrant", "updateViewGrant", "viewGrant", args.select, args.where.id, args.data, "UpdateViewGrantInput", "id", "viewGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewGrant', + 'updateViewGrant', + 'viewGrant', + args.select, + args.where.id, + args.data, + 'UpdateViewGrantInput', + 'id', + 'viewGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "updateViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'updateViewGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewGrant", "deleteViewGrant", "viewGrant", { - id: args.where.id - }, "DeleteViewGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewGrant', + 'deleteViewGrant', + 'viewGrant', + { + id: args.where.id, + }, + 'DeleteViewGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "deleteViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'deleteViewGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/viewRule.ts b/sdk/constructive-cli/src/api/orm/models/viewRule.ts index 9d23a13997..df3eadd57c 100644 --- a/sdk/constructive-cli/src/api/orm/models/viewRule.ts +++ b/sdk/constructive-cli/src/api/orm/models/viewRule.ts @@ -3,56 +3,96 @@ * @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 { ViewRule, ViewRuleWithRelations, ViewRuleSelect, ViewRuleFilter, ViewRuleOrderBy, CreateViewRuleInput, UpdateViewRuleInput, ViewRulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewRule, + ViewRuleWithRelations, + ViewRuleSelect, + ViewRuleFilter, + ViewRuleOrderBy, + CreateViewRuleInput, + UpdateViewRuleInput, + ViewRulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewRuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewRule", "viewRules", 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 - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewRule', + 'viewRules', + 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, + }, + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRules", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewRule", "viewRules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewRule', + 'viewRules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRule", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewRuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewRule": data.viewRules?.nodes?.[0] ?? null - }) + viewRule: data.viewRules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewRule", "viewRules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewRule', + 'viewRules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRule", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewRuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewRule": data.viewRules?.nodes?.[0] ?? null - }) + viewRule: data.viewRules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewRule", "createViewRule", "viewRule", args.select, args.data, "CreateViewRuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewRule', + 'createViewRule', + 'viewRule', + args.select, + args.data, + 'CreateViewRuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "createViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'createViewRule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewRulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewRule", "updateViewRule", "viewRule", args.select, args.where.id, args.data, "UpdateViewRuleInput", "id", "viewRulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewRule', + 'updateViewRule', + 'viewRule', + args.select, + args.where.id, + args.data, + 'UpdateViewRuleInput', + 'id', + 'viewRulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "updateViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'updateViewRule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewRule", "deleteViewRule", "viewRule", { - id: args.where.id - }, "DeleteViewRuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewRule', + 'deleteViewRule', + 'viewRule', + { + id: args.where.id, + }, + 'DeleteViewRuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "deleteViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'deleteViewRule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/viewTable.ts b/sdk/constructive-cli/src/api/orm/models/viewTable.ts index f28432a5cc..44308019a0 100644 --- a/sdk/constructive-cli/src/api/orm/models/viewTable.ts +++ b/sdk/constructive-cli/src/api/orm/models/viewTable.ts @@ -3,56 +3,96 @@ * @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 { ViewTable, ViewTableWithRelations, ViewTableSelect, ViewTableFilter, ViewTableOrderBy, CreateViewTableInput, UpdateViewTableInput, ViewTablePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewTable, + ViewTableWithRelations, + ViewTableSelect, + ViewTableFilter, + ViewTableOrderBy, + CreateViewTableInput, + UpdateViewTableInput, + ViewTablePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewTableModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTables: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewTable", "viewTables", 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 - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewTable', + 'viewTables', + 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, + }, + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTables", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTables', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTable: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewTable", "viewTables", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewTable', + 'viewTables', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTable", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTable', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewTableModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewTable": data.viewTables?.nodes?.[0] ?? null - }) + viewTable: data.viewTables?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTable: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewTable", "viewTables", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewTable', + 'viewTables', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTable", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTable', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewTableModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewTable": data.viewTables?.nodes?.[0] ?? null - }) + viewTable: data.viewTables?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewTable", "createViewTable", "viewTable", args.select, args.data, "CreateViewTableInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewTable', + 'createViewTable', + 'viewTable', + args.select, + args.data, + 'CreateViewTableInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "createViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'createViewTable', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewTablePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewTable", "updateViewTable", "viewTable", args.select, args.where.id, args.data, "UpdateViewTableInput", "id", "viewTablePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewTable', + 'updateViewTable', + 'viewTable', + args.select, + args.where.id, + args.data, + 'UpdateViewTableInput', + 'id', + 'viewTablePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "updateViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'updateViewTable', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewTable", "deleteViewTable", "viewTable", { - id: args.where.id - }, "DeleteViewTableInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewTable', + 'deleteViewTable', + 'viewTable', + { + id: args.where.id, + }, + 'DeleteViewTableInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "deleteViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'deleteViewTable', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/models/webauthnSetting.ts b/sdk/constructive-cli/src/api/orm/models/webauthnSetting.ts index 8150003ac5..515c0dbcaa 100644 --- a/sdk/constructive-cli/src/api/orm/models/webauthnSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/webauthnSetting.ts @@ -3,56 +3,96 @@ * @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 { WebauthnSetting, WebauthnSettingWithRelations, WebauthnSettingSelect, WebauthnSettingFilter, WebauthnSettingOrderBy, CreateWebauthnSettingInput, UpdateWebauthnSettingInput, WebauthnSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnSetting, + WebauthnSettingWithRelations, + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy, + CreateWebauthnSettingInput, + UpdateWebauthnSettingInput, + WebauthnSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnSetting", "webauthnSettings", 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 - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnSetting', + 'webauthnSettings', + 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, + }, + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSettings", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnSetting", "webauthnSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnSetting', + 'webauthnSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSetting", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnSetting": data.webauthnSettings?.nodes?.[0] ?? null - }) + webauthnSetting: data.webauthnSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnSetting", "webauthnSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnSetting', + 'webauthnSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSetting", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnSetting": data.webauthnSettings?.nodes?.[0] ?? null - }) + webauthnSetting: data.webauthnSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnSetting", "createWebauthnSetting", "webauthnSetting", args.select, args.data, "CreateWebauthnSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnSetting', + 'createWebauthnSetting', + 'webauthnSetting', + args.select, + args.data, + 'CreateWebauthnSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "createWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'createWebauthnSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnSetting", "updateWebauthnSetting", "webauthnSetting", args.select, args.where.id, args.data, "UpdateWebauthnSettingInput", "id", "webauthnSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnSetting', + 'updateWebauthnSetting', + 'webauthnSetting', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnSettingInput', + 'id', + 'webauthnSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "updateWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'updateWebauthnSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnSetting", "deleteWebauthnSetting", "webauthnSetting", { - id: args.where.id - }, "DeleteWebauthnSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnSetting', + 'deleteWebauthnSetting', + 'webauthnSetting', + { + id: args.where.id, + }, + 'DeleteWebauthnSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "deleteWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'deleteWebauthnSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/mutation/index.ts b/sdk/constructive-cli/src/api/orm/mutation/index.ts index ad9dcc2e30..0192a395b1 100644 --- a/sdk/constructive-cli/src/api/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/api/orm/mutation/index.ts @@ -3,11 +3,33 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AcceptDatabaseTransferInput, ApplyRlsInput, CancelDatabaseTransferInput, ProvisionBucketInput, RejectDatabaseTransferInput, RequestDatabaseInput, SetFieldOrderInput, AcceptDatabaseTransferPayload, ApplyRlsPayload, CancelDatabaseTransferPayload, ProvisionBucketPayload, RejectDatabaseTransferPayload, RequestDatabasePayload, SetFieldOrderPayload, AcceptDatabaseTransferPayloadSelect, ApplyRlsPayloadSelect, CancelDatabaseTransferPayloadSelect, ProvisionBucketPayloadSelect, RejectDatabaseTransferPayloadSelect, RequestDatabasePayloadSelect, SetFieldOrderPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + AcceptDatabaseTransferInput, + ApplyRlsInput, + CancelDatabaseTransferInput, + ProvisionBucketInput, + RejectDatabaseTransferInput, + RequestDatabaseInput, + SetFieldOrderInput, + AcceptDatabaseTransferPayload, + ApplyRlsPayload, + CancelDatabaseTransferPayload, + ProvisionBucketPayload, + RejectDatabaseTransferPayload, + RequestDatabasePayload, + SetFieldOrderPayload, + AcceptDatabaseTransferPayloadSelect, + ApplyRlsPayloadSelect, + CancelDatabaseTransferPayloadSelect, + ProvisionBucketPayloadSelect, + RejectDatabaseTransferPayloadSelect, + RequestDatabasePayloadSelect, + SetFieldOrderPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AcceptDatabaseTransferVariables { input: AcceptDatabaseTransferInput; } @@ -48,103 +70,208 @@ export interface SetFieldOrderVariables { } export function createMutationOperations(client: OrmClient) { return { - acceptDatabaseTransfer: (args: AcceptDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - acceptDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AcceptDatabaseTransfer", - fieldName: "acceptDatabaseTransfer", - ...buildCustomDocument("mutation", "AcceptDatabaseTransfer", "acceptDatabaseTransfer", options.select, args, [{ - name: "input", - type: "AcceptDatabaseTransferInput!" - }], connectionFieldsMap, "AcceptDatabaseTransferPayload") - }), - applyRls: (args: ApplyRlsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - applyRls: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ApplyRls", - fieldName: "applyRls", - ...buildCustomDocument("mutation", "ApplyRls", "applyRls", options.select, args, [{ - name: "input", - type: "ApplyRlsInput!" - }], connectionFieldsMap, "ApplyRlsPayload") - }), - cancelDatabaseTransfer: (args: CancelDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - cancelDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CancelDatabaseTransfer", - fieldName: "cancelDatabaseTransfer", - ...buildCustomDocument("mutation", "CancelDatabaseTransfer", "cancelDatabaseTransfer", options.select, args, [{ - name: "input", - type: "CancelDatabaseTransferInput!" - }], connectionFieldsMap, "CancelDatabaseTransferPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - rejectDatabaseTransfer: (args: RejectDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - rejectDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RejectDatabaseTransfer", - fieldName: "rejectDatabaseTransfer", - ...buildCustomDocument("mutation", "RejectDatabaseTransfer", "rejectDatabaseTransfer", options.select, args, [{ - name: "input", - type: "RejectDatabaseTransferInput!" - }], connectionFieldsMap, "RejectDatabaseTransferPayload") - }), - requestDatabase: (args: RequestDatabaseVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - requestDatabase: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RequestDatabase", - fieldName: "requestDatabase", - ...buildCustomDocument("mutation", "RequestDatabase", "requestDatabase", options.select, args, [{ - name: "input", - type: "RequestDatabaseInput!" - }], connectionFieldsMap, "RequestDatabasePayload") - }), - setFieldOrder: (args: SetFieldOrderVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setFieldOrder: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetFieldOrder", - fieldName: "setFieldOrder", - ...buildCustomDocument("mutation", "SetFieldOrder", "setFieldOrder", options.select, args, [{ - name: "input", - type: "SetFieldOrderInput!" - }], connectionFieldsMap, "SetFieldOrderPayload") - }) + acceptDatabaseTransfer: ( + args: AcceptDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + acceptDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AcceptDatabaseTransfer', + fieldName: 'acceptDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'AcceptDatabaseTransfer', + 'acceptDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'AcceptDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'AcceptDatabaseTransferPayload' + ), + }), + applyRls: ( + args: ApplyRlsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + applyRls: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ApplyRls', + fieldName: 'applyRls', + ...buildCustomDocument( + 'mutation', + 'ApplyRls', + 'applyRls', + options.select, + args, + [ + { + name: 'input', + type: 'ApplyRlsInput!', + }, + ], + connectionFieldsMap, + 'ApplyRlsPayload' + ), + }), + cancelDatabaseTransfer: ( + args: CancelDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + cancelDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CancelDatabaseTransfer', + fieldName: 'cancelDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'CancelDatabaseTransfer', + 'cancelDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'CancelDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'CancelDatabaseTransferPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + rejectDatabaseTransfer: ( + args: RejectDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + rejectDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RejectDatabaseTransfer', + fieldName: 'rejectDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'RejectDatabaseTransfer', + 'rejectDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'RejectDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'RejectDatabaseTransferPayload' + ), + }), + requestDatabase: ( + args: RequestDatabaseVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + requestDatabase: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RequestDatabase', + fieldName: 'requestDatabase', + ...buildCustomDocument( + 'mutation', + 'RequestDatabase', + 'requestDatabase', + options.select, + args, + [ + { + name: 'input', + type: 'RequestDatabaseInput!', + }, + ], + connectionFieldsMap, + 'RequestDatabasePayload' + ), + }), + setFieldOrder: ( + args: SetFieldOrderVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setFieldOrder: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetFieldOrder', + fieldName: 'setFieldOrder', + ...buildCustomDocument( + 'mutation', + 'SetFieldOrder', + 'setFieldOrder', + options.select, + args, + [ + { + name: 'input', + type: 'SetFieldOrderInput!', + }, + ], + connectionFieldsMap, + 'SetFieldOrderPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/query-builder.ts b/sdk/constructive-cli/src/api/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/api/orm/query-builder.ts +++ b/sdk/constructive-cli/src/api/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/api/orm/query/index.ts b/sdk/constructive-cli/src/api/orm/query/index.ts index a8fb40e9c4..4136dc4b39 100644 --- a/sdk/constructive-cli/src/api/orm/query/index.ts +++ b/sdk/constructive-cli/src/api/orm/query/index.ts @@ -3,11 +3,16 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ResolveHttpRouteRecord, ResolveRouteRecord, ResolveHttpRouteRecordSelect, ResolveRouteRecordSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ResolveHttpRouteRecord, + ResolveRouteRecord, + ResolveHttpRouteRecordSelect, + ResolveRouteRecordSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface ApiSchemaNamesVariables { targetApiId?: string; } @@ -27,76 +32,141 @@ export interface ResolveRouteVariables { } export function createQueryOperations(client: OrmClient) { return { - apiSchemaNames: (args: ApiSchemaNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - apiSchemaNames: unknown | null; - }>({ - client, - operation: "query", - operationName: "ApiSchemaNames", - fieldName: "apiSchemaNames", - ...buildCustomDocument("query", "ApiSchemaNames", "apiSchemaNames", options?.select, args, [{ - name: "targetApiId", - type: "UUID" - }], connectionFieldsMap, undefined) - }), - applyRegistryDefaults: (args: ApplyRegistryDefaultsVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - applyRegistryDefaults: unknown | null; - }>({ - client, - operation: "query", - operationName: "ApplyRegistryDefaults", - fieldName: "applyRegistryDefaults", - ...buildCustomDocument("query", "ApplyRegistryDefaults", "applyRegistryDefaults", options?.select, args, [{ - name: "data", - type: "JSON" - }, { - name: "nodeType", - type: "String" - }], connectionFieldsMap, undefined) - }), - resolveHttpRoute: (args: ResolveHttpRouteVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resolveHttpRoute: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "ResolveHttpRoute", - fieldName: "resolveHttpRoute", - ...buildCustomDocument("query", "ResolveHttpRoute", "resolveHttpRoute", options.select, args, [{ - name: "requestHost", - type: "String" - }, { - name: "requestMethod", - type: "String" - }, { - name: "requestPath", - type: "String" - }], connectionFieldsMap, "ResolveHttpRouteRecord") - }), - resolveRoute: (args: ResolveRouteVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resolveRoute: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "ResolveRoute", - fieldName: "resolveRoute", - ...buildCustomDocument("query", "ResolveRoute", "resolveRoute", options.select, args, [{ - name: "requestHost", - type: "String" - }, { - name: "requestMethod", - type: "String" - }, { - name: "requestPath", - type: "String" - }], connectionFieldsMap, "ResolveRouteRecord") - }) + apiSchemaNames: ( + args: ApiSchemaNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + apiSchemaNames: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ApiSchemaNames', + fieldName: 'apiSchemaNames', + ...buildCustomDocument( + 'query', + 'ApiSchemaNames', + 'apiSchemaNames', + options?.select, + args, + [ + { + name: 'targetApiId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + applyRegistryDefaults: ( + args: ApplyRegistryDefaultsVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + applyRegistryDefaults: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ApplyRegistryDefaults', + fieldName: 'applyRegistryDefaults', + ...buildCustomDocument( + 'query', + 'ApplyRegistryDefaults', + 'applyRegistryDefaults', + options?.select, + args, + [ + { + name: 'data', + type: 'JSON', + }, + { + name: 'nodeType', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), + resolveHttpRoute: ( + args: ResolveHttpRouteVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resolveHttpRoute: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveHttpRoute', + fieldName: 'resolveHttpRoute', + ...buildCustomDocument( + 'query', + 'ResolveHttpRoute', + 'resolveHttpRoute', + options.select, + args, + [ + { + name: 'requestHost', + type: 'String', + }, + { + name: 'requestMethod', + type: 'String', + }, + { + name: 'requestPath', + type: 'String', + }, + ], + connectionFieldsMap, + 'ResolveHttpRouteRecord' + ), + }), + resolveRoute: ( + args: ResolveRouteVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resolveRoute: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveRoute', + fieldName: 'resolveRoute', + ...buildCustomDocument( + 'query', + 'ResolveRoute', + 'resolveRoute', + options.select, + args, + [ + { + name: 'requestHost', + type: 'String', + }, + { + name: 'requestMethod', + type: 'String', + }, + { + name: 'requestPath', + type: 'String', + }, + ], + connectionFieldsMap, + 'ResolveRouteRecord' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/api/orm/realtime.ts b/sdk/constructive-cli/src/api/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/api/orm/realtime.ts +++ b/sdk/constructive-cli/src/api/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/api/orm/select-types.ts b/sdk/constructive-cli/src/api/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/api/orm/select-types.ts +++ b/sdk/constructive-cli/src/api/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/auth/cli/commands.ts b/sdk/constructive-cli/src/auth/cli/commands.ts index fa56891535..dfbdf380c0 100644 --- a/sdk/constructive-cli/src/auth/cli/commands.ts +++ b/sdk/constructive-cli/src/auth/cli/commands.ts @@ -3,127 +3,138 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import auditLogAuthCmd from "./commands/audit-log-auth"; -import cryptoAddressCmd from "./commands/crypto-address"; -import emailCmd from "./commands/email"; -import identityProviderCmd from "./commands/identity-provider"; -import orgApiKeyListCmd from "./commands/org-api-key-list"; -import phoneNumberCmd from "./commands/phone-number"; -import principalCmd from "./commands/principal"; -import principalEntityCmd from "./commands/principal-entity"; -import principalScopeOverrideCmd from "./commands/principal-scope-override"; -import roleTypeCmd from "./commands/role-type"; -import userConnectedAccountCmd from "./commands/user-connected-account"; -import userCmd from "./commands/user"; -import webauthnCredentialCmd from "./commands/webauthn-credential"; -import currentIpAddressCmd from "./commands/current-ip-address"; -import currentUserCmd from "./commands/current-user"; -import currentUserAgentCmd from "./commands/current-user-agent"; -import currentUserIdCmd from "./commands/current-user-id"; -import requireStepUpCmd from "./commands/require-step-up"; -import checkPasswordCmd from "./commands/check-password"; -import confirmDeleteAccountCmd from "./commands/confirm-delete-account"; -import createApiKeyCmd from "./commands/create-api-key"; -import createOrgApiKeyCmd from "./commands/create-org-api-key"; -import createOrgPrincipalCmd from "./commands/create-org-principal"; -import deleteOrgPrincipalCmd from "./commands/delete-org-principal"; -import deletePrincipalCmd from "./commands/delete-principal"; -import disconnectAccountCmd from "./commands/disconnect-account"; -import extendTokenExpiresCmd from "./commands/extend-token-expires"; -import forgotPasswordCmd from "./commands/forgot-password"; -import linkIdentityCmd from "./commands/link-identity"; -import provisionBucketCmd from "./commands/provision-bucket"; -import provisionNewUserCmd from "./commands/provision-new-user"; -import requestCrossOriginTokenCmd from "./commands/request-cross-origin-token"; -import resetPasswordCmd from "./commands/reset-password"; -import revokeApiKeyCmd from "./commands/revoke-api-key"; -import revokeOrgApiKeyCmd from "./commands/revoke-org-api-key"; -import revokeSessionCmd from "./commands/revoke-session"; -import sendAccountDeletionEmailCmd from "./commands/send-account-deletion-email"; -import sendVerificationEmailCmd from "./commands/send-verification-email"; -import setPasswordCmd from "./commands/set-password"; -import signInCmd from "./commands/sign-in"; -import signInCrossOriginCmd from "./commands/sign-in-cross-origin"; -import signInSmsOtpCmd from "./commands/sign-in-sms-otp"; -import signOutCmd from "./commands/sign-out"; -import signUpCmd from "./commands/sign-up"; -import signUpSmsCmd from "./commands/sign-up-sms"; -import verifyEmailCmd from "./commands/verify-email"; -import verifyPasswordCmd from "./commands/verify-password"; -import verifyTotpCmd from "./commands/verify-totp"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "audit-log-auth": auditLogAuthCmd, - "crypto-address": cryptoAddressCmd, - "email": emailCmd, - "identity-provider": identityProviderCmd, - "org-api-key-list": orgApiKeyListCmd, - "phone-number": phoneNumberCmd, - "principal": principalCmd, - "principal-entity": principalEntityCmd, - "principal-scope-override": principalScopeOverrideCmd, - "role-type": roleTypeCmd, - "user-connected-account": userConnectedAccountCmd, - "user": userCmd, - "webauthn-credential": webauthnCredentialCmd, - "current-ip-address": currentIpAddressCmd, - "current-user": currentUserCmd, - "current-user-agent": currentUserAgentCmd, - "current-user-id": currentUserIdCmd, - "require-step-up": requireStepUpCmd, - "check-password": checkPasswordCmd, - "confirm-delete-account": confirmDeleteAccountCmd, - "create-api-key": createApiKeyCmd, - "create-org-api-key": createOrgApiKeyCmd, - "create-org-principal": createOrgPrincipalCmd, - "delete-org-principal": deleteOrgPrincipalCmd, - "delete-principal": deletePrincipalCmd, - "disconnect-account": disconnectAccountCmd, - "extend-token-expires": extendTokenExpiresCmd, - "forgot-password": forgotPasswordCmd, - "link-identity": linkIdentityCmd, - "provision-bucket": provisionBucketCmd, - "provision-new-user": provisionNewUserCmd, - "request-cross-origin-token": requestCrossOriginTokenCmd, - "reset-password": resetPasswordCmd, - "revoke-api-key": revokeApiKeyCmd, - "revoke-org-api-key": revokeOrgApiKeyCmd, - "revoke-session": revokeSessionCmd, - "send-account-deletion-email": sendAccountDeletionEmailCmd, - "send-verification-email": sendVerificationEmailCmd, - "set-password": setPasswordCmd, - "sign-in": signInCmd, - "sign-in-cross-origin": signInCrossOriginCmd, - "sign-in-sms-otp": signInSmsOtpCmd, - "sign-out": signOutCmd, - "sign-up": signUpCmd, - "sign-up-sms": signUpSmsCmd, - "verify-email": verifyEmailCmd, - "verify-password": verifyPasswordCmd, - "verify-totp": verifyTotpCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import auditLogAuthCmd from './commands/audit-log-auth'; +import cryptoAddressCmd from './commands/crypto-address'; +import emailCmd from './commands/email'; +import identityProviderCmd from './commands/identity-provider'; +import orgApiKeyListCmd from './commands/org-api-key-list'; +import phoneNumberCmd from './commands/phone-number'; +import principalCmd from './commands/principal'; +import principalEntityCmd from './commands/principal-entity'; +import principalScopeOverrideCmd from './commands/principal-scope-override'; +import roleTypeCmd from './commands/role-type'; +import userConnectedAccountCmd from './commands/user-connected-account'; +import userCmd from './commands/user'; +import webauthnCredentialCmd from './commands/webauthn-credential'; +import currentIpAddressCmd from './commands/current-ip-address'; +import currentUserCmd from './commands/current-user'; +import currentUserAgentCmd from './commands/current-user-agent'; +import currentUserIdCmd from './commands/current-user-id'; +import requireStepUpCmd from './commands/require-step-up'; +import checkPasswordCmd from './commands/check-password'; +import confirmDeleteAccountCmd from './commands/confirm-delete-account'; +import createApiKeyCmd from './commands/create-api-key'; +import createOrgApiKeyCmd from './commands/create-org-api-key'; +import createOrgPrincipalCmd from './commands/create-org-principal'; +import deleteOrgPrincipalCmd from './commands/delete-org-principal'; +import deletePrincipalCmd from './commands/delete-principal'; +import disconnectAccountCmd from './commands/disconnect-account'; +import extendTokenExpiresCmd from './commands/extend-token-expires'; +import forgotPasswordCmd from './commands/forgot-password'; +import linkIdentityCmd from './commands/link-identity'; +import provisionBucketCmd from './commands/provision-bucket'; +import provisionNewUserCmd from './commands/provision-new-user'; +import requestCrossOriginTokenCmd from './commands/request-cross-origin-token'; +import resetPasswordCmd from './commands/reset-password'; +import revokeApiKeyCmd from './commands/revoke-api-key'; +import revokeOrgApiKeyCmd from './commands/revoke-org-api-key'; +import revokeSessionCmd from './commands/revoke-session'; +import sendAccountDeletionEmailCmd from './commands/send-account-deletion-email'; +import sendVerificationEmailCmd from './commands/send-verification-email'; +import setPasswordCmd from './commands/set-password'; +import signInCmd from './commands/sign-in'; +import signInCrossOriginCmd from './commands/sign-in-cross-origin'; +import signInSmsOtpCmd from './commands/sign-in-sms-otp'; +import signOutCmd from './commands/sign-out'; +import signUpCmd from './commands/sign-up'; +import signUpSmsCmd from './commands/sign-up-sms'; +import verifyEmailCmd from './commands/verify-email'; +import verifyPasswordCmd from './commands/verify-password'; +import verifyTotpCmd from './commands/verify-totp'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + 'audit-log-auth': auditLogAuthCmd, + 'crypto-address': cryptoAddressCmd, + email: emailCmd, + 'identity-provider': identityProviderCmd, + 'org-api-key-list': orgApiKeyListCmd, + 'phone-number': phoneNumberCmd, + principal: principalCmd, + 'principal-entity': principalEntityCmd, + 'principal-scope-override': principalScopeOverrideCmd, + 'role-type': roleTypeCmd, + 'user-connected-account': userConnectedAccountCmd, + user: userCmd, + 'webauthn-credential': webauthnCredentialCmd, + 'current-ip-address': currentIpAddressCmd, + 'current-user': currentUserCmd, + 'current-user-agent': currentUserAgentCmd, + 'current-user-id': currentUserIdCmd, + 'require-step-up': requireStepUpCmd, + 'check-password': checkPasswordCmd, + 'confirm-delete-account': confirmDeleteAccountCmd, + 'create-api-key': createApiKeyCmd, + 'create-org-api-key': createOrgApiKeyCmd, + 'create-org-principal': createOrgPrincipalCmd, + 'delete-org-principal': deleteOrgPrincipalCmd, + 'delete-principal': deletePrincipalCmd, + 'disconnect-account': disconnectAccountCmd, + 'extend-token-expires': extendTokenExpiresCmd, + 'forgot-password': forgotPasswordCmd, + 'link-identity': linkIdentityCmd, + 'provision-bucket': provisionBucketCmd, + 'provision-new-user': provisionNewUserCmd, + 'request-cross-origin-token': requestCrossOriginTokenCmd, + 'reset-password': resetPasswordCmd, + 'revoke-api-key': revokeApiKeyCmd, + 'revoke-org-api-key': revokeOrgApiKeyCmd, + 'revoke-session': revokeSessionCmd, + 'send-account-deletion-email': sendAccountDeletionEmailCmd, + 'send-verification-email': sendVerificationEmailCmd, + 'set-password': setPasswordCmd, + 'sign-in': signInCmd, + 'sign-in-cross-origin': signInCrossOriginCmd, + 'sign-in-sms-otp': signInSmsOtpCmd, + 'sign-out': signOutCmd, + 'sign-up': signUpCmd, + 'sign-up-sms': signUpSmsCmd, + 'verify-email': verifyEmailCmd, + 'verify-password': verifyPasswordCmd, + 'verify-totp': verifyTotpCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n audit-log-auth auditLogAuth CRUD operations\n crypto-address cryptoAddress CRUD operations\n email email CRUD operations\n identity-provider identityProvider CRUD operations\n org-api-key-list orgApiKeyList CRUD operations\n phone-number phoneNumber CRUD operations\n principal principal CRUD operations\n principal-entity principalEntity CRUD operations\n principal-scope-override principalScopeOverride CRUD operations\n role-type roleType CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n user user CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n current-ip-address currentIpAddress\n current-user currentUser\n current-user-agent currentUserAgent\n current-user-id currentUserId\n require-step-up requireStepUp\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n create-api-key createApiKey\n create-org-api-key createOrgApiKey\n create-org-principal createOrgPrincipal\n delete-org-principal deleteOrgPrincipal\n delete-principal deletePrincipal\n disconnect-account disconnectAccount\n extend-token-expires extendTokenExpires\n forgot-password forgotPassword\n link-identity linkIdentity\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 provision-new-user provisionNewUser\n request-cross-origin-token requestCrossOriginToken\n reset-password resetPassword\n revoke-api-key revokeApiKey\n revoke-org-api-key revokeOrgApiKey\n revoke-session revokeSession\n send-account-deletion-email sendAccountDeletionEmail\n send-verification-email sendVerificationEmail\n set-password setPassword\n sign-in signIn\n sign-in-cross-origin signInCrossOrigin\n sign-in-sms-otp signInSmsOtp\n sign-out signOut\n sign-up signUp\n sign-up-sms signUpSms\n verify-email verifyEmail\n verify-password verifyPassword\n verify-totp verifyTotp\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n audit-log-auth auditLogAuth CRUD operations\n crypto-address cryptoAddress CRUD operations\n email email CRUD operations\n identity-provider identityProvider CRUD operations\n org-api-key-list orgApiKeyList CRUD operations\n phone-number phoneNumber CRUD operations\n principal principal CRUD operations\n principal-entity principalEntity CRUD operations\n principal-scope-override principalScopeOverride CRUD operations\n role-type roleType CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n user user CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n current-ip-address currentIpAddress\n current-user currentUser\n current-user-agent currentUserAgent\n current-user-id currentUserId\n require-step-up requireStepUp\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n create-api-key createApiKey\n create-org-api-key createOrgApiKey\n create-org-principal createOrgPrincipal\n delete-org-principal deleteOrgPrincipal\n delete-principal deletePrincipal\n disconnect-account disconnectAccount\n extend-token-expires extendTokenExpires\n forgot-password forgotPassword\n link-identity linkIdentity\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 provision-new-user provisionNewUser\n request-cross-origin-token requestCrossOriginToken\n reset-password resetPassword\n revoke-api-key revokeApiKey\n revoke-org-api-key revokeOrgApiKey\n revoke-session revokeSession\n send-account-deletion-email sendAccountDeletionEmail\n send-verification-email sendVerificationEmail\n set-password setPassword\n sign-in signIn\n sign-in-cross-origin signInCrossOrigin\n sign-in-sms-otp signInSmsOtp\n sign-out signOut\n sign-up signUp\n sign-up-sms signUpSms\n verify-email verifyEmail\n verify-password verifyPassword\n verify-totp verifyTotp\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -135,4 +146,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/audit-log-auth.ts b/sdk/constructive-cli/src/auth/cli/commands/audit-log-auth.ts index c230e8e874..711a4522ae 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/audit-log-auth.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/audit-log-auth.ts @@ -3,56 +3,70 @@ * @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 { CreateAuditLogAuthInput, AuditLogAuthPatch, AuditLogAuthSelect, AuditLogAuthFilter, AuditLogAuthOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAuditLogAuthInput, + AuditLogAuthPatch, + AuditLogAuthSelect, + AuditLogAuthFilter, + AuditLogAuthOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - event: "string", - id: "uuid", - ipAddress: "string", - origin: "string", - success: "boolean", - userAgent: "string" + actorId: 'uuid', + createdAt: 'string', + event: 'string', + id: 'uuid', + ipAddress: 'string', + origin: 'string', + success: 'boolean', + userAgent: 'string', }; -const usage = "\naudit-log-auth \n\nCommands:\n list List auditLogAuth records\n find-first Find first matching auditLogAuth record\n get Get a auditLogAuth by ID\n create Create a new auditLogAuth\n update Update an existing auditLogAuth\n delete Delete a auditLogAuth\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) => { +const usage = + '\naudit-log-auth \n\nCommands:\n list List auditLogAuth records\n find-first Find first matching auditLogAuth record\n get Get a auditLogAuth by ID\n create Create a new auditLogAuth\n update Update an existing auditLogAuth\n delete Delete a auditLogAuth\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq ipAddress: true, origin: true, success: true, - userAgent: true + userAgent: true, }; - const findManyArgs = parseFindManyArgs & { - select: AuditLogAuthSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AuditLogAuthSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.auditLogAuth.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter ipAddress: true, origin: true, success: true, - userAgent: true + userAgent: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AuditLogAuthSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AuditLogAuthSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.auditLogAuth.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.auditLogAuth.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - event: true, - id: true, - ipAddress: true, - origin: true, - success: true, - userAgent: true - } - }).execute(); + const result = await client.auditLogAuth + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + event: true, + id: true, + ipAddress: true, + origin: true, + success: true, + userAgent: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,67 +166,79 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "event", - message: "event", - required: true - }, { - type: "text", - name: "ipAddress", - message: "ipAddress", - required: false, - skipPrompt: true - }, { - type: "text", - name: "origin", - message: "origin", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "success", - message: "success", - required: true - }, { - type: "text", - name: "userAgent", - message: "userAgent", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'event', + message: 'event', + required: true, + }, + { + type: 'text', + name: 'ipAddress', + message: 'ipAddress', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'origin', + message: 'origin', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'success', + message: 'success', + required: true, + }, + { + type: 'text', + name: 'userAgent', + message: 'userAgent', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAuditLogAuthInput["auditLogAuth"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAuditLogAuthInput['auditLogAuth']; const client = getClient(); - const result = await client.auditLogAuth.create({ - data: { - actorId: cleanedData.actorId, - event: cleanedData.event, - ipAddress: cleanedData.ipAddress, - origin: cleanedData.origin, - success: cleanedData.success, - userAgent: cleanedData.userAgent - }, - select: { - actorId: true, - createdAt: true, - event: true, - id: true, - ipAddress: true, - origin: true, - success: true, - userAgent: true - } - }).execute(); + const result = await client.auditLogAuth + .create({ + data: { + actorId: cleanedData.actorId, + event: cleanedData.event, + ipAddress: cleanedData.ipAddress, + origin: cleanedData.origin, + success: cleanedData.success, + userAgent: cleanedData.userAgent, + }, + select: { + actorId: true, + createdAt: true, + event: true, + id: true, + ipAddress: true, + origin: true, + success: true, + userAgent: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -213,81 +247,92 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "event", - message: "event", - required: false - }, { - type: "text", - name: "ipAddress", - message: "ipAddress", - required: false, - skipPrompt: true - }, { - type: "text", - name: "origin", - message: "origin", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "success", - message: "success", - required: false - }, { - type: "text", - name: "userAgent", - message: "userAgent", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'event', + message: 'event', + required: false, + }, + { + type: 'text', + name: 'ipAddress', + message: 'ipAddress', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'origin', + message: 'origin', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'success', + message: 'success', + required: false, + }, + { + type: 'text', + name: 'userAgent', + message: 'userAgent', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AuditLogAuthPatch; const client = getClient(); - const result = await client.auditLogAuth.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - event: cleanedData.event, - ipAddress: cleanedData.ipAddress, - origin: cleanedData.origin, - success: cleanedData.success, - userAgent: cleanedData.userAgent - }, - select: { - actorId: true, - createdAt: true, - event: true, - id: true, - ipAddress: true, - origin: true, - success: true, - userAgent: true - } - }).execute(); + const result = await client.auditLogAuth + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + event: cleanedData.event, + ipAddress: cleanedData.ipAddress, + origin: cleanedData.origin, + success: cleanedData.success, + userAgent: cleanedData.userAgent, + }, + select: { + actorId: true, + createdAt: true, + event: true, + id: true, + ipAddress: true, + origin: true, + success: true, + userAgent: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -296,34 +341,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.auditLogAuth.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.auditLogAuth + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/auth.ts b/sdk/constructive-cli/src/auth/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/check-password.ts b/sdk/constructive-cli/src/auth/cli/commands/check-password.ts index dbb31480b9..8411d3605c 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/check-password.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/check-password.ts @@ -3,37 +3,49 @@ * @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 { CheckPasswordVariables } from "../../orm/mutation"; -import type { CheckPasswordPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { CheckPasswordVariables } from '../../orm/mutation'; +import type { CheckPasswordPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("check-password - checkPassword\n\nUsage: check-password [OPTIONS]\n"); + console.log('check-password - checkPassword\n\nUsage: check-password [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 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.checkPassword(parsedAnswers as unknown as CheckPasswordVariables, { - select: selectFields - } as unknown as { - select: CheckPasswordPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .checkPassword( + parsedAnswers as unknown as CheckPasswordVariables, + { + select: selectFields, + } as unknown as { + select: CheckPasswordPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: checkPassword"); + console.error('Failed: checkPassword'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/confirm-delete-account.ts b/sdk/constructive-cli/src/auth/cli/commands/confirm-delete-account.ts index fb60e025af..7b01478d4e 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/confirm-delete-account.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/confirm-delete-account.ts @@ -3,37 +3,51 @@ * @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 { ConfirmDeleteAccountVariables } from "../../orm/mutation"; -import type { ConfirmDeleteAccountPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ConfirmDeleteAccountVariables } from '../../orm/mutation'; +import type { ConfirmDeleteAccountPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("confirm-delete-account - confirmDeleteAccount\n\nUsage: confirm-delete-account [OPTIONS]\n"); + console.log( + 'confirm-delete-account - confirmDeleteAccount\n\nUsage: confirm-delete-account [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 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.confirmDeleteAccount(parsedAnswers as unknown as ConfirmDeleteAccountVariables, { - select: selectFields - } as unknown as { - select: ConfirmDeleteAccountPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .confirmDeleteAccount( + parsedAnswers as unknown as ConfirmDeleteAccountVariables, + { + select: selectFields, + } as unknown as { + select: ConfirmDeleteAccountPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: confirmDeleteAccount"); + console.error('Failed: confirmDeleteAccount'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/context.ts b/sdk/constructive-cli/src/auth/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/context.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/create-api-key.ts b/sdk/constructive-cli/src/auth/cli/commands/create-api-key.ts index 630554639b..672db1229b 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/create-api-key.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/create-api-key.ts @@ -3,37 +3,49 @@ * @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 { CreateApiKeyVariables } from "../../orm/mutation"; -import type { CreateApiKeyPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { CreateApiKeyVariables } from '../../orm/mutation'; +import type { CreateApiKeyPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("create-api-key - createApiKey\n\nUsage: create-api-key [OPTIONS]\n"); + console.log('create-api-key - createApiKey\n\nUsage: create-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 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.createApiKey(parsedAnswers as unknown as CreateApiKeyVariables, { - select: selectFields - } as unknown as { - select: CreateApiKeyPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .createApiKey( + parsedAnswers as unknown as CreateApiKeyVariables, + { + select: selectFields, + } as unknown as { + select: CreateApiKeyPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: createApiKey"); + console.error('Failed: createApiKey'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; 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 index eb0f893212..ff4135e4d9 100644 --- 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 @@ -3,37 +3,49 @@ * @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) => { +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"); + 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 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(); + 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"); + console.error('Failed: createOrgApiKey'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; 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 index b71f448bb7..2c4547f1d6 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/create-org-principal.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/create-org-principal.ts @@ -3,37 +3,51 @@ * @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) => { +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"); + 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 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(); + 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"); + console.error('Failed: createOrgPrincipal'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/crypto-address.ts b/sdk/constructive-cli/src/auth/cli/commands/crypto-address.ts index 1b01e2140a..97288bb0dc 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/crypto-address.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/crypto-address.ts @@ -3,56 +3,70 @@ * @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 { CreateCryptoAddressInput, CryptoAddressPatch, CryptoAddressSelect, CryptoAddressFilter, CryptoAddressOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateCryptoAddressInput, + CryptoAddressPatch, + CryptoAddressSelect, + CryptoAddressFilter, + CryptoAddressOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - address: "string", - createdAt: "string", - id: "uuid", - isPrimary: "boolean", - isVerified: "boolean", - name: "string", - ownerId: "uuid", - updatedAt: "string" + address: 'string', + createdAt: 'string', + id: 'uuid', + isPrimary: 'boolean', + isVerified: 'boolean', + name: 'string', + ownerId: 'uuid', + updatedAt: 'string', }; -const usage = "\ncrypto-address \n\nCommands:\n list List cryptoAddress records\n find-first Find first matching cryptoAddress record\n get Get a cryptoAddress by ID\n create Create a new cryptoAddress\n update Update an existing cryptoAddress\n delete Delete a cryptoAddress\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) => { +const usage = + '\ncrypto-address \n\nCommands:\n list List cryptoAddress records\n find-first Find first matching cryptoAddress record\n get Get a cryptoAddress by ID\n create Create a new cryptoAddress\n update Update an existing cryptoAddress\n delete Delete a cryptoAddress\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq isVerified: true, name: true, ownerId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: CryptoAddressSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: CryptoAddressSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.cryptoAddress.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter isVerified: true, name: true, ownerId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: CryptoAddressSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: CryptoAddressSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.cryptoAddress.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.cryptoAddress.findOne({ - id: answers.id as string, - select: { - address: true, - createdAt: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.cryptoAddress + .findOne({ + id: answers.id as string, + select: { + address: true, + createdAt: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,61 +166,72 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "address", - message: "address", - required: true - }, { - type: "boolean", - name: "isPrimary", - message: "isPrimary", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'address', + message: 'address', + required: true, + }, + { + type: 'boolean', + name: 'isPrimary', + message: 'isPrimary', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateCryptoAddressInput["cryptoAddress"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateCryptoAddressInput['cryptoAddress']; const client = getClient(); - const result = await client.cryptoAddress.create({ - data: { - address: cleanedData.address, - isPrimary: cleanedData.isPrimary, - isVerified: cleanedData.isVerified, - name: cleanedData.name, - ownerId: cleanedData.ownerId - }, - select: { - address: true, - createdAt: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.cryptoAddress + .create({ + data: { + address: cleanedData.address, + isPrimary: cleanedData.isPrimary, + isVerified: cleanedData.isVerified, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + }, + select: { + address: true, + createdAt: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -207,69 +240,78 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "address", - message: "address", - required: false - }, { - type: "boolean", - name: "isPrimary", - message: "isPrimary", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'address', + message: 'address', + required: false, + }, + { + type: 'boolean', + name: 'isPrimary', + message: 'isPrimary', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CryptoAddressPatch; const client = getClient(); - const result = await client.cryptoAddress.update({ - where: { - id: answers.id as string - }, - data: { - address: cleanedData.address, - isPrimary: cleanedData.isPrimary, - isVerified: cleanedData.isVerified, - name: cleanedData.name, - ownerId: cleanedData.ownerId - }, - select: { - address: true, - createdAt: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.cryptoAddress + .update({ + where: { + id: answers.id as string, + }, + data: { + address: cleanedData.address, + isPrimary: cleanedData.isPrimary, + isVerified: cleanedData.isVerified, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + }, + select: { + address: true, + createdAt: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -278,28 +320,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.cryptoAddress.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.cryptoAddress + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/current-ip-address.ts b/sdk/constructive-cli/src/auth/cli/commands/current-ip-address.ts index 4d803701b7..e2dd3037d9 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/current-ip-address.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/current-ip-address.ts @@ -3,22 +3,26 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("current-ip-address - currentIpAddress\n\nUsage: current-ip-address [OPTIONS]\n"); + console.log('current-ip-address - currentIpAddress\n\nUsage: current-ip-address [OPTIONS]\n'); process.exit(0); } const client = getClient(); const result = await client.query.currentIpAddress().execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: currentIpAddress"); + console.error('Failed: currentIpAddress'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/current-user-agent.ts b/sdk/constructive-cli/src/auth/cli/commands/current-user-agent.ts index b85b6f3271..9191321fbd 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/current-user-agent.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/current-user-agent.ts @@ -3,22 +3,26 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("current-user-agent - currentUserAgent\n\nUsage: current-user-agent [OPTIONS]\n"); + console.log('current-user-agent - currentUserAgent\n\nUsage: current-user-agent [OPTIONS]\n'); process.exit(0); } const client = getClient(); const result = await client.query.currentUserAgent().execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: currentUserAgent"); + console.error('Failed: currentUserAgent'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/current-user-id.ts b/sdk/constructive-cli/src/auth/cli/commands/current-user-id.ts index 2d28eb8cdb..0ade5d19e9 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/current-user-id.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/current-user-id.ts @@ -3,22 +3,26 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("current-user-id - currentUserId\n\nUsage: current-user-id [OPTIONS]\n"); + console.log('current-user-id - currentUserId\n\nUsage: current-user-id [OPTIONS]\n'); process.exit(0); } const client = getClient(); const result = await client.query.currentUserId().execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: currentUserId"); + console.error('Failed: currentUserId'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/current-user.ts b/sdk/constructive-cli/src/auth/cli/commands/current-user.ts index 9bdc0480be..14c69246b0 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/current-user.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/current-user.ts @@ -3,29 +3,35 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { buildSelectFromPaths } from "../utils"; -import type { UserSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { buildSelectFromPaths } from '../utils'; +import type { UserSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("current-user - currentUser\n\nUsage: current-user [OPTIONS]\n"); + console.log('current-user - currentUser\n\nUsage: current-user [OPTIONS]\n'); process.exit(0); } const client = getClient(); - const selectFields = buildSelectFromPaths(argv.select as string ?? ""); - const result = await client.query.currentUser({ - select: selectFields - } as unknown as { - select: UserSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? ''); + const result = await client.query + .currentUser({ + select: selectFields, + } as unknown as { + select: UserSelect; + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: currentUser"); + console.error('Failed: currentUser'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; 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 index a611c65dee..a3b2dd94ef 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/delete-org-principal.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/delete-org-principal.ts @@ -3,37 +3,51 @@ * @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) => { +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"); + 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 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(); + 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"); + console.error('Failed: deleteOrgPrincipal'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/delete-principal.ts b/sdk/constructive-cli/src/auth/cli/commands/delete-principal.ts index 4314e3a1be..71195aacbc 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/delete-principal.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/delete-principal.ts @@ -3,37 +3,49 @@ * @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 { DeletePrincipalVariables } from "../../orm/mutation"; -import type { DeletePrincipalPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { DeletePrincipalVariables } from '../../orm/mutation'; +import type { DeletePrincipalPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("delete-principal - deletePrincipal\n\nUsage: delete-principal [OPTIONS]\n"); + console.log('delete-principal - deletePrincipal\n\nUsage: delete-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 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.deletePrincipal(parsedAnswers as unknown as DeletePrincipalVariables, { - select: selectFields - } as unknown as { - select: DeletePrincipalPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .deletePrincipal( + parsedAnswers as unknown as DeletePrincipalVariables, + { + select: selectFields, + } as unknown as { + select: DeletePrincipalPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: deletePrincipal"); + console.error('Failed: deletePrincipal'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/disconnect-account.ts b/sdk/constructive-cli/src/auth/cli/commands/disconnect-account.ts index 0caff8a9cc..cf78a9609c 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/disconnect-account.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/disconnect-account.ts @@ -3,37 +3,51 @@ * @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 { DisconnectAccountVariables } from "../../orm/mutation"; -import type { DisconnectAccountPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { DisconnectAccountVariables } from '../../orm/mutation'; +import type { DisconnectAccountPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("disconnect-account - disconnectAccount\n\nUsage: disconnect-account [OPTIONS]\n"); + console.log( + 'disconnect-account - disconnectAccount\n\nUsage: disconnect-account [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 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.disconnectAccount(parsedAnswers as unknown as DisconnectAccountVariables, { - select: selectFields - } as unknown as { - select: DisconnectAccountPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .disconnectAccount( + parsedAnswers as unknown as DisconnectAccountVariables, + { + select: selectFields, + } as unknown as { + select: DisconnectAccountPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: disconnectAccount"); + console.error('Failed: disconnectAccount'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/email.ts b/sdk/constructive-cli/src/auth/cli/commands/email.ts index f0f7516bfd..a79b02d447 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/email.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/email.ts @@ -3,56 +3,70 @@ * @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 { CreateEmailInput, EmailPatch, EmailSelect, EmailFilter, EmailOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateEmailInput, + EmailPatch, + EmailSelect, + EmailFilter, + EmailOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - email: "string", - id: "uuid", - isPrimary: "boolean", - isVerified: "boolean", - name: "string", - ownerId: "uuid", - updatedAt: "string" + createdAt: 'string', + email: 'string', + id: 'uuid', + isPrimary: 'boolean', + isVerified: 'boolean', + name: 'string', + ownerId: 'uuid', + updatedAt: 'string', }; -const usage = "\nemail \n\nCommands:\n list List email records\n find-first Find first matching email record\n get Get a email by ID\n create Create a new email\n update Update an existing email\n delete Delete a email\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) => { +const usage = + '\nemail \n\nCommands:\n list List email records\n find-first Find first matching email record\n get Get a email by ID\n create Create a new email\n update Update an existing email\n delete Delete a email\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq isVerified: true, name: true, ownerId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: EmailSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: EmailSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.email.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter isVerified: true, name: true, ownerId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: EmailSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: EmailSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.email.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.email.findOne({ - id: answers.id as string, - select: { - createdAt: true, - email: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.email + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + email: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,61 +166,69 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "email", - message: "email", - required: true - }, { - type: "boolean", - name: "isPrimary", - message: "isPrimary", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'email', + message: 'email', + required: true, + }, + { + type: 'boolean', + name: 'isPrimary', + message: 'isPrimary', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateEmailInput["email"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateEmailInput['email']; const client = getClient(); - const result = await client.email.create({ - data: { - email: cleanedData.email, - isPrimary: cleanedData.isPrimary, - isVerified: cleanedData.isVerified, - name: cleanedData.name, - ownerId: cleanedData.ownerId - }, - select: { - createdAt: true, - email: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.email + .create({ + data: { + email: cleanedData.email, + isPrimary: cleanedData.isPrimary, + isVerified: cleanedData.isVerified, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + }, + select: { + createdAt: true, + email: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -207,69 +237,78 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "email", - message: "email", - required: false - }, { - type: "boolean", - name: "isPrimary", - message: "isPrimary", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'email', + message: 'email', + required: false, + }, + { + type: 'boolean', + name: 'isPrimary', + message: 'isPrimary', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as EmailPatch; const client = getClient(); - const result = await client.email.update({ - where: { - id: answers.id as string - }, - data: { - email: cleanedData.email, - isPrimary: cleanedData.isPrimary, - isVerified: cleanedData.isVerified, - name: cleanedData.name, - ownerId: cleanedData.ownerId - }, - select: { - createdAt: true, - email: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.email + .update({ + where: { + id: answers.id as string, + }, + data: { + email: cleanedData.email, + isPrimary: cleanedData.isPrimary, + isVerified: cleanedData.isVerified, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + }, + select: { + createdAt: true, + email: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -278,28 +317,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.email.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.email + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/extend-token-expires.ts b/sdk/constructive-cli/src/auth/cli/commands/extend-token-expires.ts index 4cd00249d7..b6580b9df0 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/extend-token-expires.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/extend-token-expires.ts @@ -3,37 +3,51 @@ * @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 { ExtendTokenExpiresVariables } from "../../orm/mutation"; -import type { ExtendTokenExpiresPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ExtendTokenExpiresVariables } from '../../orm/mutation'; +import type { ExtendTokenExpiresPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("extend-token-expires - extendTokenExpires\n\nUsage: extend-token-expires [OPTIONS]\n"); + console.log( + 'extend-token-expires - extendTokenExpires\n\nUsage: extend-token-expires [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 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.extendTokenExpires(parsedAnswers as unknown as ExtendTokenExpiresVariables, { - select: selectFields - } as unknown as { - select: ExtendTokenExpiresPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .extendTokenExpires( + parsedAnswers as unknown as ExtendTokenExpiresVariables, + { + select: selectFields, + } as unknown as { + select: ExtendTokenExpiresPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: extendTokenExpires"); + console.error('Failed: extendTokenExpires'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/forgot-password.ts b/sdk/constructive-cli/src/auth/cli/commands/forgot-password.ts index f7223f183d..2163c66d84 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/forgot-password.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/forgot-password.ts @@ -3,37 +3,49 @@ * @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 { ForgotPasswordVariables } from "../../orm/mutation"; -import type { ForgotPasswordPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ForgotPasswordVariables } from '../../orm/mutation'; +import type { ForgotPasswordPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("forgot-password - forgotPassword\n\nUsage: forgot-password [OPTIONS]\n"); + console.log('forgot-password - forgotPassword\n\nUsage: forgot-password [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 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.forgotPassword(parsedAnswers as unknown as ForgotPasswordVariables, { - select: selectFields - } as unknown as { - select: ForgotPasswordPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .forgotPassword( + parsedAnswers as unknown as ForgotPasswordVariables, + { + select: selectFields, + } as unknown as { + select: ForgotPasswordPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: forgotPassword"); + console.error('Failed: forgotPassword'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/identity-provider.ts b/sdk/constructive-cli/src/auth/cli/commands/identity-provider.ts index 2612dcdcf2..27af14d3ed 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/identity-provider.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/identity-provider.ts @@ -3,46 +3,60 @@ * @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 { CreateIdentityProviderInput, IdentityProviderPatch, IdentityProviderSelect, IdentityProviderFilter, IdentityProviderOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateIdentityProviderInput, + IdentityProviderPatch, + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - displayName: "string", - enabled: "boolean", - kind: "string", - slug: "string" + displayName: 'string', + enabled: 'boolean', + kind: 'string', + slug: 'string', }; -const usage = "\nidentity-provider \n\nCommands:\n list List identityProvider records\n find-first Find first matching identityProvider record\n create Create a new identityProvider\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) => { +const usage = + '\nidentity-provider \n\nCommands:\n list List identityProvider records\n find-first Find first matching identityProvider record\n create Create a new identityProvider\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -55,16 +69,18 @@ async function handleList(argv: Partial>, _prompter: Inq displayName: true, enabled: true, kind: true, - slug: true + slug: true, }; - const findManyArgs = parseFindManyArgs & { - select: IdentityProviderSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: IdentityProviderSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.identityProvider.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -77,16 +93,18 @@ async function handleFindFirst(argv: Partial>, _prompter displayName: true, enabled: true, kind: true, - slug: true + slug: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: IdentityProviderSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: IdentityProviderSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.identityProvider.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -95,50 +113,60 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "displayName", - message: "displayName", - required: true - }, { - type: "boolean", - name: "enabled", - message: "enabled", - required: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: true, + }, + { + type: 'boolean', + name: 'enabled', + message: 'enabled', + required: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateIdentityProviderInput["identityProvider"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateIdentityProviderInput['identityProvider']; const client = getClient(); - const result = await client.identityProvider.create({ - data: { - displayName: cleanedData.displayName, - enabled: cleanedData.enabled, - kind: cleanedData.kind, - slug: cleanedData.slug - }, - select: { - displayName: true, - enabled: true, - kind: true, - slug: true - } - }).execute(); + const result = await client.identityProvider + .create({ + data: { + displayName: cleanedData.displayName, + enabled: cleanedData.enabled, + kind: cleanedData.kind, + slug: cleanedData.slug, + }, + select: { + displayName: true, + enabled: true, + kind: true, + slug: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/link-identity.ts b/sdk/constructive-cli/src/auth/cli/commands/link-identity.ts index a7678a1279..a0f841b861 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/link-identity.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/link-identity.ts @@ -3,37 +3,49 @@ * @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 { LinkIdentityVariables } from "../../orm/mutation"; -import type { LinkIdentityPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { LinkIdentityVariables } from '../../orm/mutation'; +import type { LinkIdentityPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("link-identity - linkIdentity\n\nUsage: link-identity [OPTIONS]\n"); + console.log('link-identity - linkIdentity\n\nUsage: link-identity [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 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.linkIdentity(parsedAnswers as unknown as LinkIdentityVariables, { - select: selectFields - } as unknown as { - select: LinkIdentityPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .linkIdentity( + parsedAnswers as unknown as LinkIdentityVariables, + { + select: selectFields, + } as unknown as { + select: LinkIdentityPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: linkIdentity"); + console.error('Failed: linkIdentity'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; 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 index 3eb9660d0b..dd56fa3f2c 100644 --- 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 @@ -3,54 +3,68 @@ * @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"; +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 = { - accessLevel: "string", - createdAt: "string", - expiresAt: "string", - id: "uuid", - keyId: "string", - lastUsedAt: "string", - mfaLevel: "string", - name: "string", - orgId: "uuid", - principalId: "uuid", - revokedAt: "string", - updatedAt: "string" + accessLevel: 'string', + createdAt: 'string', + expiresAt: 'string', + id: 'uuid', + keyId: 'string', + lastUsedAt: 'string', + mfaLevel: 'string', + name: 'string', + orgId: 'uuid', + principalId: 'uuid', + revokedAt: '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) => { +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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq orgId: true, principalId: true, revokedAt: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgApiKeyListSelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter orgId: true, principalId: true, revokedAt: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgApiKeyListSelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,88 +137,103 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "accessLevel", - message: "accessLevel", - required: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: true - }, { - type: "text", - name: "keyId", - message: "keyId", - required: true - }, { - type: "text", - name: "lastUsedAt", - message: "lastUsedAt", - required: true - }, { - type: "text", - name: "mfaLevel", - message: "mfaLevel", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "orgId", - message: "orgId", - required: true - }, { - type: "text", - name: "principalId", - message: "principalId", - required: true - }, { - type: "text", - name: "revokedAt", - message: "revokedAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'accessLevel', + message: 'accessLevel', + required: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: true, + }, + { + type: 'text', + name: 'keyId', + message: 'keyId', + required: true, + }, + { + type: 'text', + name: 'lastUsedAt', + message: 'lastUsedAt', + required: true, + }, + { + type: 'text', + name: 'mfaLevel', + message: 'mfaLevel', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'orgId', + message: 'orgId', + required: true, + }, + { + type: 'text', + name: 'principalId', + message: 'principalId', + required: true, + }, + { + type: 'text', + name: 'revokedAt', + message: 'revokedAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgApiKeyListInput["orgApiKeyList"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgApiKeyListInput['orgApiKeyList']; const client = getClient(); - const result = await client.orgApiKeyList.create({ - data: { - accessLevel: cleanedData.accessLevel, - expiresAt: cleanedData.expiresAt, - keyId: cleanedData.keyId, - lastUsedAt: cleanedData.lastUsedAt, - mfaLevel: cleanedData.mfaLevel, - name: cleanedData.name, - orgId: cleanedData.orgId, - principalId: cleanedData.principalId, - revokedAt: cleanedData.revokedAt - }, - select: { - accessLevel: true, - createdAt: true, - expiresAt: true, - id: true, - keyId: true, - lastUsedAt: true, - mfaLevel: true, - name: true, - orgId: true, - principalId: true, - revokedAt: true, - updatedAt: true - } - }).execute(); + const result = await client.orgApiKeyList + .create({ + data: { + accessLevel: cleanedData.accessLevel, + expiresAt: cleanedData.expiresAt, + keyId: cleanedData.keyId, + lastUsedAt: cleanedData.lastUsedAt, + mfaLevel: cleanedData.mfaLevel, + name: cleanedData.name, + orgId: cleanedData.orgId, + principalId: cleanedData.principalId, + revokedAt: cleanedData.revokedAt, + }, + select: { + accessLevel: true, + createdAt: true, + expiresAt: true, + id: true, + keyId: true, + lastUsedAt: true, + mfaLevel: true, + name: true, + orgId: true, + principalId: true, + revokedAt: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/phone-number.ts b/sdk/constructive-cli/src/auth/cli/commands/phone-number.ts index 1a02ca88cc..e6593dcdca 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/phone-number.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/phone-number.ts @@ -3,57 +3,71 @@ * @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 { CreatePhoneNumberInput, PhoneNumberPatch, PhoneNumberSelect, PhoneNumberFilter, PhoneNumberOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePhoneNumberInput, + PhoneNumberPatch, + PhoneNumberSelect, + PhoneNumberFilter, + PhoneNumberOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - cc: "string", - createdAt: "string", - id: "uuid", - isPrimary: "boolean", - isVerified: "boolean", - name: "string", - number: "string", - ownerId: "uuid", - updatedAt: "string" + cc: 'string', + createdAt: 'string', + id: 'uuid', + isPrimary: 'boolean', + isVerified: 'boolean', + name: 'string', + number: 'string', + ownerId: 'uuid', + updatedAt: 'string', }; -const usage = "\nphone-number \n\nCommands:\n list List phoneNumber records\n find-first Find first matching phoneNumber record\n get Get a phoneNumber by ID\n create Create a new phoneNumber\n update Update an existing phoneNumber\n delete Delete a phoneNumber\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) => { +const usage = + '\nphone-number \n\nCommands:\n list List phoneNumber records\n find-first Find first matching phoneNumber record\n get Get a phoneNumber by ID\n create Create a new phoneNumber\n update Update an existing phoneNumber\n delete Delete a phoneNumber\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, number: true, ownerId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PhoneNumberSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PhoneNumberSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.phoneNumber.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, number: true, ownerId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PhoneNumberSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PhoneNumberSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.phoneNumber.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.phoneNumber.findOne({ - id: answers.id as string, - select: { - cc: true, - createdAt: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - number: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.phoneNumber + .findOne({ + id: answers.id as string, + select: { + cc: true, + createdAt: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + number: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,68 +170,80 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "cc", - message: "cc", - required: true - }, { - type: "boolean", - name: "isPrimary", - message: "isPrimary", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "number", - message: "number", - required: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'cc', + message: 'cc', + required: true, + }, + { + type: 'boolean', + name: 'isPrimary', + message: 'isPrimary', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'number', + message: 'number', + required: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePhoneNumberInput["phoneNumber"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePhoneNumberInput['phoneNumber']; const client = getClient(); - const result = await client.phoneNumber.create({ - data: { - cc: cleanedData.cc, - isPrimary: cleanedData.isPrimary, - isVerified: cleanedData.isVerified, - name: cleanedData.name, - number: cleanedData.number, - ownerId: cleanedData.ownerId - }, - select: { - cc: true, - createdAt: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - number: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.phoneNumber + .create({ + data: { + cc: cleanedData.cc, + isPrimary: cleanedData.isPrimary, + isVerified: cleanedData.isVerified, + name: cleanedData.name, + number: cleanedData.number, + ownerId: cleanedData.ownerId, + }, + select: { + cc: true, + createdAt: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + number: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -218,76 +252,86 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "cc", - message: "cc", - required: false - }, { - type: "boolean", - name: "isPrimary", - message: "isPrimary", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "number", - message: "number", - required: false - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'cc', + message: 'cc', + required: false, + }, + { + type: 'boolean', + name: 'isPrimary', + message: 'isPrimary', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'number', + message: 'number', + required: false, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PhoneNumberPatch; const client = getClient(); - const result = await client.phoneNumber.update({ - where: { - id: answers.id as string - }, - data: { - cc: cleanedData.cc, - isPrimary: cleanedData.isPrimary, - isVerified: cleanedData.isVerified, - name: cleanedData.name, - number: cleanedData.number, - ownerId: cleanedData.ownerId - }, - select: { - cc: true, - createdAt: true, - id: true, - isPrimary: true, - isVerified: true, - name: true, - number: true, - ownerId: true, - updatedAt: true - } - }).execute(); + const result = await client.phoneNumber + .update({ + where: { + id: answers.id as string, + }, + data: { + cc: cleanedData.cc, + isPrimary: cleanedData.isPrimary, + isVerified: cleanedData.isVerified, + name: cleanedData.name, + number: cleanedData.number, + ownerId: cleanedData.ownerId, + }, + select: { + cc: true, + createdAt: true, + id: true, + isPrimary: true, + isVerified: true, + name: true, + number: true, + ownerId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -296,28 +340,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.phoneNumber.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.phoneNumber + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/principal-entity.ts b/sdk/constructive-cli/src/auth/cli/commands/principal-entity.ts index 686e9b435b..92a03b1442 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/principal-entity.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/principal-entity.ts @@ -3,54 +3,68 @@ * @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"; +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 = { - createdAt: "string", - entityId: "uuid", - id: "uuid", - ownerId: "uuid", - principalId: "uuid", - updatedAt: "string" + createdAt: 'string', + entityId: 'uuid', + id: 'uuid', + ownerId: 'uuid', + principalId: 'uuid', + updatedAt: 'string', }; -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) => { +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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, ownerId: true, principalId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PrincipalEntitySelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, ownerId: true, principalId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PrincipalEntitySelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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: { - createdAt: true, - entityId: true, - id: true, - ownerId: true, - principalId: true, - updatedAt: true - } - }).execute(); + const result = await client.principalEntity + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + entityId: true, + id: true, + ownerId: true, + principalId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,43 +158,52 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: true - }, { - type: "text", - name: "principalId", - message: "principalId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: true, + }, + { + type: 'text', + name: 'principalId', + message: 'principalId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePrincipalEntityInput["principalEntity"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePrincipalEntityInput['principalEntity']; const client = getClient(); - const result = await client.principalEntity.create({ - data: { - entityId: cleanedData.entityId, - ownerId: cleanedData.ownerId, - principalId: cleanedData.principalId - }, - select: { - createdAt: true, - entityId: true, - id: true, - ownerId: true, - principalId: true, - updatedAt: true - } - }).execute(); + const result = await client.principalEntity + .create({ + data: { + entityId: cleanedData.entityId, + ownerId: cleanedData.ownerId, + principalId: cleanedData.principalId, + }, + select: { + createdAt: true, + entityId: true, + id: true, + ownerId: true, + principalId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -181,51 +212,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false - }, { - type: "text", - name: "principalId", - message: "principalId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + }, + { + type: 'text', + name: 'principalId', + message: 'principalId', + 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: { - entityId: cleanedData.entityId, - ownerId: cleanedData.ownerId, - principalId: cleanedData.principalId - }, - select: { - createdAt: true, - entityId: true, - id: true, - ownerId: true, - principalId: true, - updatedAt: true - } - }).execute(); + const result = await client.principalEntity + .update({ + where: { + id: answers.id as string, + }, + data: { + entityId: cleanedData.entityId, + ownerId: cleanedData.ownerId, + principalId: cleanedData.principalId, + }, + select: { + createdAt: true, + entityId: true, + id: true, + ownerId: true, + principalId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -234,28 +272,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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(); + 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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} 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 index baa47048a0..8a73f19ceb 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/principal-scope-override.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/principal-scope-override.ts @@ -3,51 +3,65 @@ * @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"; +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 = { - allowedMask: "string", - createdAt: "string", - id: "uuid", - isActive: "boolean", - isReadOnly: "boolean", - membershipType: "int", - principalId: "uuid", - updatedAt: "string", - useAdminOwner: "boolean" + allowedMask: 'string', + createdAt: 'string', + id: 'uuid', + isActive: 'boolean', + isReadOnly: 'boolean', + membershipType: 'int', + principalId: 'uuid', + updatedAt: 'string', + useAdminOwner: '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) => { +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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -65,16 +79,22 @@ async function handleList(argv: Partial>, _prompter: Inq membershipType: true, principalId: true, updatedAt: true, - useAdminOwner: true + useAdminOwner: true, }; - const findManyArgs = parseFindManyArgs & { - select: PrincipalScopeOverrideSelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter membershipType: true, principalId: true, updatedAt: true, - useAdminOwner: true + useAdminOwner: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PrincipalScopeOverrideSelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,67 +136,79 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "allowedMask", - message: "allowedMask", - required: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: true - }, { - type: "boolean", - name: "isReadOnly", - message: "isReadOnly", - required: true - }, { - type: "text", - name: "membershipType", - message: "membershipType", - required: true - }, { - type: "text", - name: "principalId", - message: "principalId", - required: true - }, { - type: "boolean", - name: "useAdminOwner", - message: "useAdminOwner", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'allowedMask', + message: 'allowedMask', + required: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: true, + }, + { + type: 'text', + name: 'membershipType', + message: 'membershipType', + required: true, + }, + { + type: 'text', + name: 'principalId', + message: 'principalId', + required: true, + }, + { + type: 'boolean', + name: 'useAdminOwner', + message: 'useAdminOwner', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePrincipalScopeOverrideInput["principalScopeOverride"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePrincipalScopeOverrideInput['principalScopeOverride']; const client = getClient(); - const result = await client.principalScopeOverride.create({ - data: { - allowedMask: cleanedData.allowedMask, - isActive: cleanedData.isActive, - isReadOnly: cleanedData.isReadOnly, - membershipType: cleanedData.membershipType, - principalId: cleanedData.principalId, - useAdminOwner: cleanedData.useAdminOwner - }, - select: { - allowedMask: true, - createdAt: true, - id: true, - isActive: true, - isReadOnly: true, - membershipType: true, - principalId: true, - updatedAt: true, - useAdminOwner: true - } - }).execute(); + const result = await client.principalScopeOverride + .create({ + data: { + allowedMask: cleanedData.allowedMask, + isActive: cleanedData.isActive, + isReadOnly: cleanedData.isReadOnly, + membershipType: cleanedData.membershipType, + principalId: cleanedData.principalId, + useAdminOwner: cleanedData.useAdminOwner, + }, + select: { + allowedMask: true, + createdAt: true, + id: true, + isActive: true, + isReadOnly: true, + membershipType: true, + principalId: true, + updatedAt: true, + useAdminOwner: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/principal.ts b/sdk/constructive-cli/src/auth/cli/commands/principal.ts index 69df847ef5..b41834d4ba 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/principal.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/principal.ts @@ -3,51 +3,65 @@ * @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"; +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 = { - bypassStepUp: "boolean", - createdAt: "string", - id: "uuid", - isReadOnly: "boolean", - name: "string", - ownerId: "uuid", - updatedAt: "string", - useAdminOwner: "boolean", - userId: "uuid" + bypassStepUp: 'boolean', + createdAt: 'string', + id: 'uuid', + isReadOnly: 'boolean', + name: 'string', + ownerId: 'uuid', + updatedAt: 'string', + useAdminOwner: 'boolean', + userId: 'uuid', }; -const usage = "\nprincipal \n\nCommands:\n list List principal records\n find-first Find first matching principal record\n create Create a new 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) => { +const usage = + '\nprincipal \n\nCommands:\n list List principal records\n find-first Find first matching principal record\n create Create a new 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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq ownerId: true, updatedAt: true, useAdminOwner: true, - userId: true + userId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PrincipalSelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter ownerId: true, updatedAt: true, useAdminOwner: true, - userId: true + userId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PrincipalSelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,67 +128,76 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "bypassStepUp", - message: "bypassStepUp", - required: true - }, { - type: "boolean", - name: "isReadOnly", - message: "isReadOnly", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: true - }, { - type: "boolean", - name: "useAdminOwner", - message: "useAdminOwner", - required: true - }, { - type: "text", - name: "userId", - message: "userId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'bypassStepUp', + message: 'bypassStepUp', + required: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: true, + }, + { + type: 'boolean', + name: 'useAdminOwner', + message: 'useAdminOwner', + required: true, + }, + { + type: 'text', + name: 'userId', + message: 'userId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePrincipalInput["principal"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreatePrincipalInput['principal']; const client = getClient(); - const result = await client.principal.create({ - data: { - bypassStepUp: cleanedData.bypassStepUp, - isReadOnly: cleanedData.isReadOnly, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - useAdminOwner: cleanedData.useAdminOwner, - userId: cleanedData.userId - }, - select: { - bypassStepUp: true, - createdAt: true, - id: true, - isReadOnly: true, - name: true, - ownerId: true, - updatedAt: true, - useAdminOwner: true, - userId: true - } - }).execute(); + const result = await client.principal + .create({ + data: { + bypassStepUp: cleanedData.bypassStepUp, + isReadOnly: cleanedData.isReadOnly, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + useAdminOwner: cleanedData.useAdminOwner, + userId: cleanedData.userId, + }, + select: { + bypassStepUp: true, + createdAt: true, + id: true, + isReadOnly: true, + name: true, + ownerId: true, + updatedAt: true, + useAdminOwner: true, + userId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/auth/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/provision-new-user.ts b/sdk/constructive-cli/src/auth/cli/commands/provision-new-user.ts index ab6f632362..862bbf9198 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/provision-new-user.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/provision-new-user.ts @@ -3,37 +3,49 @@ * @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 { ProvisionNewUserVariables } from "../../orm/mutation"; -import type { ProvisionNewUserPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionNewUserVariables } from '../../orm/mutation'; +import type { ProvisionNewUserPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-new-user - provisionNewUser\n\nUsage: provision-new-user [OPTIONS]\n"); + console.log('provision-new-user - provisionNewUser\n\nUsage: provision-new-user [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 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.provisionNewUser(parsedAnswers as unknown as ProvisionNewUserVariables, { - select: selectFields - } as unknown as { - select: ProvisionNewUserPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionNewUser( + parsedAnswers as unknown as ProvisionNewUserVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionNewUserPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionNewUser"); + console.error('Failed: provisionNewUser'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/request-cross-origin-token.ts b/sdk/constructive-cli/src/auth/cli/commands/request-cross-origin-token.ts index 21b0e8354f..344a44b85b 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/request-cross-origin-token.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/request-cross-origin-token.ts @@ -3,37 +3,51 @@ * @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 { RequestCrossOriginTokenVariables } from "../../orm/mutation"; -import type { RequestCrossOriginTokenPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { RequestCrossOriginTokenVariables } from '../../orm/mutation'; +import type { RequestCrossOriginTokenPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("request-cross-origin-token - requestCrossOriginToken\n\nUsage: request-cross-origin-token [OPTIONS]\n"); + console.log( + 'request-cross-origin-token - requestCrossOriginToken\n\nUsage: request-cross-origin-token [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 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.requestCrossOriginToken(parsedAnswers as unknown as RequestCrossOriginTokenVariables, { - select: selectFields - } as unknown as { - select: RequestCrossOriginTokenPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .requestCrossOriginToken( + parsedAnswers as unknown as RequestCrossOriginTokenVariables, + { + select: selectFields, + } as unknown as { + select: RequestCrossOriginTokenPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: requestCrossOriginToken"); + console.error('Failed: requestCrossOriginToken'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/require-step-up.ts b/sdk/constructive-cli/src/auth/cli/commands/require-step-up.ts index 6e578cf0b0..9720978f45 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/require-step-up.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/require-step-up.ts @@ -3,28 +3,36 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { RequireStepUpVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { RequireStepUpVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("require-step-up - requireStepUp\n\nUsage: require-step-up [OPTIONS]\n"); + console.log('require-step-up - requireStepUp\n\nUsage: require-step-up [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "stepUpType", - message: "stepUpType" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'stepUpType', + message: 'stepUpType', + }, + ]); const client = getClient(); - const result = await client.query.requireStepUp(answers as unknown as RequireStepUpVariables).execute(); + const result = await client.query + .requireStepUp(answers as unknown as RequireStepUpVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: requireStepUp"); + console.error('Failed: requireStepUp'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/reset-password.ts b/sdk/constructive-cli/src/auth/cli/commands/reset-password.ts index aa888b3db2..dc1d30eae8 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/reset-password.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/reset-password.ts @@ -3,37 +3,49 @@ * @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 { ResetPasswordVariables } from "../../orm/mutation"; -import type { ResetPasswordPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ResetPasswordVariables } from '../../orm/mutation'; +import type { ResetPasswordPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("reset-password - resetPassword\n\nUsage: reset-password [OPTIONS]\n"); + console.log('reset-password - resetPassword\n\nUsage: reset-password [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 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.resetPassword(parsedAnswers as unknown as ResetPasswordVariables, { - select: selectFields - } as unknown as { - select: ResetPasswordPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .resetPassword( + parsedAnswers as unknown as ResetPasswordVariables, + { + select: selectFields, + } as unknown as { + select: ResetPasswordPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resetPassword"); + console.error('Failed: resetPassword'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/revoke-api-key.ts b/sdk/constructive-cli/src/auth/cli/commands/revoke-api-key.ts index 1114ebea32..0f159c4013 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/revoke-api-key.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/revoke-api-key.ts @@ -3,37 +3,49 @@ * @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 { RevokeApiKeyVariables } from "../../orm/mutation"; -import type { RevokeApiKeyPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { RevokeApiKeyVariables } from '../../orm/mutation'; +import type { RevokeApiKeyPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("revoke-api-key - revokeApiKey\n\nUsage: revoke-api-key [OPTIONS]\n"); + console.log('revoke-api-key - revokeApiKey\n\nUsage: revoke-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 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.revokeApiKey(parsedAnswers as unknown as RevokeApiKeyVariables, { - select: selectFields - } as unknown as { - select: RevokeApiKeyPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .revokeApiKey( + parsedAnswers as unknown as RevokeApiKeyVariables, + { + select: selectFields, + } as unknown as { + select: RevokeApiKeyPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: revokeApiKey"); + console.error('Failed: revokeApiKey'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; 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 index 82b088d545..f7db2a1a7a 100644 --- 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 @@ -3,37 +3,49 @@ * @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) => { +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"); + 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 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(); + 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"); + console.error('Failed: revokeOrgApiKey'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/revoke-session.ts b/sdk/constructive-cli/src/auth/cli/commands/revoke-session.ts index 7951473747..8b3bc5036f 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/revoke-session.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/revoke-session.ts @@ -3,37 +3,49 @@ * @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 { RevokeSessionVariables } from "../../orm/mutation"; -import type { RevokeSessionPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { RevokeSessionVariables } from '../../orm/mutation'; +import type { RevokeSessionPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("revoke-session - revokeSession\n\nUsage: revoke-session [OPTIONS]\n"); + console.log('revoke-session - revokeSession\n\nUsage: revoke-session [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 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.revokeSession(parsedAnswers as unknown as RevokeSessionVariables, { - select: selectFields - } as unknown as { - select: RevokeSessionPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .revokeSession( + parsedAnswers as unknown as RevokeSessionVariables, + { + select: selectFields, + } as unknown as { + select: RevokeSessionPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: revokeSession"); + console.error('Failed: revokeSession'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/role-type.ts b/sdk/constructive-cli/src/auth/cli/commands/role-type.ts index 7ef2fbe529..565ef8219c 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/role-type.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/role-type.ts @@ -3,50 +3,64 @@ * @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 { CreateRoleTypeInput, RoleTypePatch, RoleTypeSelect, RoleTypeFilter, RoleTypeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRoleTypeInput, + RoleTypePatch, + RoleTypeSelect, + RoleTypeFilter, + RoleTypeOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - id: "int", - name: "string" + id: 'int', + name: 'string', }; -const usage = "\nrole-type \n\nCommands:\n list List roleType records\n find-first Find first matching roleType record\n get Get a roleType by ID\n create Create a new roleType\n update Update an existing roleType\n delete Delete a roleType\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) => { +const usage = + '\nrole-type \n\nCommands:\n list List roleType records\n find-first Find first matching roleType record\n get Get a roleType by ID\n create Create a new roleType\n update Update an existing roleType\n delete Delete a roleType\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -57,16 +71,18 @@ async function handleList(argv: Partial>, _prompter: Inq try { const defaultSelect = { id: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: RoleTypeSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RoleTypeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.roleType.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -77,16 +93,18 @@ async function handleFindFirst(argv: Partial>, _prompter try { const defaultSelect = { id: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RoleTypeSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RoleTypeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.roleType.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -95,23 +113,27 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.roleType.findOne({ - id: answers.id as number, - select: { - id: true, - name: true - } - }).execute(); + const result = await client.roleType + .findOne({ + id: answers.id as number, + select: { + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -120,27 +142,31 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRoleTypeInput["roleType"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateRoleTypeInput['roleType']; const client = getClient(); - const result = await client.roleType.create({ - data: { - name: cleanedData.name - }, - select: { - id: true, - name: true - } - }).execute(); + const result = await client.roleType + .create({ + data: { + name: cleanedData.name, + }, + select: { + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,35 +175,40 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RoleTypePatch; const client = getClient(); - const result = await client.roleType.update({ - where: { - id: answers.id as number - }, - data: { - name: cleanedData.name - }, - select: { - id: true, - name: true - } - }).execute(); + const result = await client.roleType + .update({ + where: { + id: answers.id as number, + }, + data: { + name: cleanedData.name, + }, + select: { + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -186,28 +217,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.roleType.delete({ - where: { - id: answers.id as number - }, - select: { - id: true - } - }).execute(); + const result = await client.roleType + .delete({ + where: { + id: answers.id as number, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/send-account-deletion-email.ts b/sdk/constructive-cli/src/auth/cli/commands/send-account-deletion-email.ts index 2b53d9c581..d985198b3e 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/send-account-deletion-email.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/send-account-deletion-email.ts @@ -3,37 +3,51 @@ * @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 { SendAccountDeletionEmailVariables } from "../../orm/mutation"; -import type { SendAccountDeletionEmailPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SendAccountDeletionEmailVariables } from '../../orm/mutation'; +import type { SendAccountDeletionEmailPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("send-account-deletion-email - sendAccountDeletionEmail\n\nUsage: send-account-deletion-email [OPTIONS]\n"); + console.log( + 'send-account-deletion-email - sendAccountDeletionEmail\n\nUsage: send-account-deletion-email [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 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.sendAccountDeletionEmail(parsedAnswers as unknown as SendAccountDeletionEmailVariables, { - select: selectFields - } as unknown as { - select: SendAccountDeletionEmailPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .sendAccountDeletionEmail( + parsedAnswers as unknown as SendAccountDeletionEmailVariables, + { + select: selectFields, + } as unknown as { + select: SendAccountDeletionEmailPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: sendAccountDeletionEmail"); + console.error('Failed: sendAccountDeletionEmail'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/send-verification-email.ts b/sdk/constructive-cli/src/auth/cli/commands/send-verification-email.ts index fa2e18c19c..5748397d96 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/send-verification-email.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/send-verification-email.ts @@ -3,37 +3,51 @@ * @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 { SendVerificationEmailVariables } from "../../orm/mutation"; -import type { SendVerificationEmailPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SendVerificationEmailVariables } from '../../orm/mutation'; +import type { SendVerificationEmailPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("send-verification-email - sendVerificationEmail\n\nUsage: send-verification-email [OPTIONS]\n"); + console.log( + 'send-verification-email - sendVerificationEmail\n\nUsage: send-verification-email [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 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.sendVerificationEmail(parsedAnswers as unknown as SendVerificationEmailVariables, { - select: selectFields - } as unknown as { - select: SendVerificationEmailPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .sendVerificationEmail( + parsedAnswers as unknown as SendVerificationEmailVariables, + { + select: selectFields, + } as unknown as { + select: SendVerificationEmailPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: sendVerificationEmail"); + console.error('Failed: sendVerificationEmail'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/set-password.ts b/sdk/constructive-cli/src/auth/cli/commands/set-password.ts index f780d78c5f..318c96d559 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/set-password.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/set-password.ts @@ -3,37 +3,49 @@ * @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 { SetPasswordVariables } from "../../orm/mutation"; -import type { SetPasswordPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SetPasswordVariables } from '../../orm/mutation'; +import type { SetPasswordPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("set-password - setPassword\n\nUsage: set-password [OPTIONS]\n"); + console.log('set-password - setPassword\n\nUsage: set-password [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 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.setPassword(parsedAnswers as unknown as SetPasswordVariables, { - select: selectFields - } as unknown as { - select: SetPasswordPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .setPassword( + parsedAnswers as unknown as SetPasswordVariables, + { + select: selectFields, + } as unknown as { + select: SetPasswordPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: setPassword"); + console.error('Failed: setPassword'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/sign-in-cross-origin.ts b/sdk/constructive-cli/src/auth/cli/commands/sign-in-cross-origin.ts index ca7ef42deb..33c90f1f46 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/sign-in-cross-origin.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/sign-in-cross-origin.ts @@ -3,37 +3,51 @@ * @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 { SignInCrossOriginVariables } from "../../orm/mutation"; -import type { SignInCrossOriginPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SignInCrossOriginVariables } from '../../orm/mutation'; +import type { SignInCrossOriginPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("sign-in-cross-origin - signInCrossOrigin\n\nUsage: sign-in-cross-origin [OPTIONS]\n"); + console.log( + 'sign-in-cross-origin - signInCrossOrigin\n\nUsage: sign-in-cross-origin [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 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.signInCrossOrigin(parsedAnswers as unknown as SignInCrossOriginVariables, { - select: selectFields - } as unknown as { - select: SignInCrossOriginPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .signInCrossOrigin( + parsedAnswers as unknown as SignInCrossOriginVariables, + { + select: selectFields, + } as unknown as { + select: SignInCrossOriginPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: signInCrossOrigin"); + console.error('Failed: signInCrossOrigin'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/sign-in-sms-otp.ts b/sdk/constructive-cli/src/auth/cli/commands/sign-in-sms-otp.ts index 83401be4ab..2663004425 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/sign-in-sms-otp.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/sign-in-sms-otp.ts @@ -3,37 +3,49 @@ * @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 { SignInSmsOtpVariables } from "../../orm/mutation"; -import type { SignInSmsOtpPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SignInSmsOtpVariables } from '../../orm/mutation'; +import type { SignInSmsOtpPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("sign-in-sms-otp - signInSmsOtp\n\nUsage: sign-in-sms-otp [OPTIONS]\n"); + console.log('sign-in-sms-otp - signInSmsOtp\n\nUsage: sign-in-sms-otp [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 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.signInSmsOtp(parsedAnswers as unknown as SignInSmsOtpVariables, { - select: selectFields - } as unknown as { - select: SignInSmsOtpPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .signInSmsOtp( + parsedAnswers as unknown as SignInSmsOtpVariables, + { + select: selectFields, + } as unknown as { + select: SignInSmsOtpPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: signInSmsOtp"); + console.error('Failed: signInSmsOtp'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/sign-in.ts b/sdk/constructive-cli/src/auth/cli/commands/sign-in.ts index a11dda45fc..2713837b87 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/sign-in.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/sign-in.ts @@ -3,37 +3,49 @@ * @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 { SignInVariables } from "../../orm/mutation"; -import type { SignInPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SignInVariables } from '../../orm/mutation'; +import type { SignInPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("sign-in - signIn\n\nUsage: sign-in [OPTIONS]\n"); + console.log('sign-in - signIn\n\nUsage: sign-in [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 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.signIn(parsedAnswers as unknown as SignInVariables, { - select: selectFields - } as unknown as { - select: SignInPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .signIn( + parsedAnswers as unknown as SignInVariables, + { + select: selectFields, + } as unknown as { + select: SignInPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: signIn"); + console.error('Failed: signIn'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/sign-out.ts b/sdk/constructive-cli/src/auth/cli/commands/sign-out.ts index 7cf86abf33..5964dc1285 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/sign-out.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/sign-out.ts @@ -3,37 +3,49 @@ * @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 { SignOutVariables } from "../../orm/mutation"; -import type { SignOutPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SignOutVariables } from '../../orm/mutation'; +import type { SignOutPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("sign-out - signOut\n\nUsage: sign-out [OPTIONS]\n"); + console.log('sign-out - signOut\n\nUsage: sign-out [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 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.signOut(parsedAnswers as unknown as SignOutVariables, { - select: selectFields - } as unknown as { - select: SignOutPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .signOut( + parsedAnswers as unknown as SignOutVariables, + { + select: selectFields, + } as unknown as { + select: SignOutPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: signOut"); + console.error('Failed: signOut'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/sign-up-sms.ts b/sdk/constructive-cli/src/auth/cli/commands/sign-up-sms.ts index 6e2b380db0..86aacce200 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/sign-up-sms.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/sign-up-sms.ts @@ -3,37 +3,49 @@ * @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 { SignUpSmsVariables } from "../../orm/mutation"; -import type { SignUpSmsPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SignUpSmsVariables } from '../../orm/mutation'; +import type { SignUpSmsPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("sign-up-sms - signUpSms\n\nUsage: sign-up-sms [OPTIONS]\n"); + console.log('sign-up-sms - signUpSms\n\nUsage: sign-up-sms [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 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.signUpSms(parsedAnswers as unknown as SignUpSmsVariables, { - select: selectFields - } as unknown as { - select: SignUpSmsPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .signUpSms( + parsedAnswers as unknown as SignUpSmsVariables, + { + select: selectFields, + } as unknown as { + select: SignUpSmsPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: signUpSms"); + console.error('Failed: signUpSms'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/sign-up.ts b/sdk/constructive-cli/src/auth/cli/commands/sign-up.ts index 869ec5aebf..7c3939b78b 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/sign-up.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/sign-up.ts @@ -3,37 +3,49 @@ * @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 { SignUpVariables } from "../../orm/mutation"; -import type { SignUpPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SignUpVariables } from '../../orm/mutation'; +import type { SignUpPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("sign-up - signUp\n\nUsage: sign-up [OPTIONS]\n"); + console.log('sign-up - signUp\n\nUsage: sign-up [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 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.signUp(parsedAnswers as unknown as SignUpVariables, { - select: selectFields - } as unknown as { - select: SignUpPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .signUp( + parsedAnswers as unknown as SignUpVariables, + { + select: selectFields, + } as unknown as { + select: SignUpPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: signUp"); + console.error('Failed: signUp'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/user-connected-account.ts b/sdk/constructive-cli/src/auth/cli/commands/user-connected-account.ts index 5c6cdf199c..1aca163fb5 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/user-connected-account.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/user-connected-account.ts @@ -3,50 +3,64 @@ * @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 { CreateUserConnectedAccountInput, UserConnectedAccountPatch, UserConnectedAccountSelect, UserConnectedAccountFilter, UserConnectedAccountOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateUserConnectedAccountInput, + UserConnectedAccountPatch, + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - details: "json", - id: "uuid", - identifier: "string", - isVerified: "boolean", - ownerId: "uuid", - service: "string", - updatedAt: "string" + createdAt: 'string', + details: 'json', + id: 'uuid', + identifier: 'string', + isVerified: 'boolean', + ownerId: 'uuid', + service: 'string', + updatedAt: 'string', }; -const usage = "\nuser-connected-account \n\nCommands:\n list List userConnectedAccount records\n find-first Find first matching userConnectedAccount record\n create Create a new userConnectedAccount\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) => { +const usage = + '\nuser-connected-account \n\nCommands:\n list List userConnectedAccount records\n find-first Find first matching userConnectedAccount record\n create Create a new userConnectedAccount\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq isVerified: true, ownerId: true, service: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: UserConnectedAccountSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy + > & { + select: UserConnectedAccountSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userConnectedAccount.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +109,22 @@ async function handleFindFirst(argv: Partial>, _prompter isVerified: true, ownerId: true, service: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: UserConnectedAccountSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy + > & { + select: UserConnectedAccountSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userConnectedAccount.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,60 +133,71 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "details", - message: "details", - required: true - }, { - type: "text", - name: "identifier", - message: "identifier", - required: true - }, { - type: "boolean", - name: "isVerified", - message: "isVerified", - required: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: true - }, { - type: "text", - name: "service", - message: "service", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'details', + message: 'details', + required: true, + }, + { + type: 'text', + name: 'identifier', + message: 'identifier', + required: true, + }, + { + type: 'boolean', + name: 'isVerified', + message: 'isVerified', + required: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: true, + }, + { + type: 'text', + name: 'service', + message: 'service', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateUserConnectedAccountInput["userConnectedAccount"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateUserConnectedAccountInput['userConnectedAccount']; const client = getClient(); - const result = await client.userConnectedAccount.create({ - data: { - details: cleanedData.details, - identifier: cleanedData.identifier, - isVerified: cleanedData.isVerified, - ownerId: cleanedData.ownerId, - service: cleanedData.service - }, - select: { - createdAt: true, - details: true, - id: true, - identifier: true, - isVerified: true, - ownerId: true, - service: true, - updatedAt: true - } - }).execute(); + const result = await client.userConnectedAccount + .create({ + data: { + details: cleanedData.details, + identifier: cleanedData.identifier, + isVerified: cleanedData.isVerified, + ownerId: cleanedData.ownerId, + service: cleanedData.service, + }, + select: { + createdAt: true, + details: true, + id: true, + identifier: true, + isVerified: true, + ownerId: true, + service: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/user.ts b/sdk/constructive-cli/src/auth/cli/commands/user.ts index b92d19f9c1..17123dc0e9 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/user.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/user.ts @@ -3,61 +3,75 @@ * @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 { CreateUserInput, UserPatch, UserSelect, UserFilter, UserOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateUserInput, + UserPatch, + UserSelect, + UserFilter, + UserOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - displayName: "string", - displayNameTrgmSimilarity: "float", - id: "uuid", - profilePicture: "string", - searchScore: "float", - searchTsv: "string", - searchTsvRank: "float", - type: "int", - updatedAt: "string", - username: "string" + createdAt: 'string', + displayName: 'string', + displayNameTrgmSimilarity: 'float', + id: 'uuid', + profilePicture: 'string', + searchScore: 'float', + searchTsv: 'string', + searchTsvRank: 'float', + type: 'int', + updatedAt: 'string', + username: 'string', }; -const usage = "\nuser \n\nCommands:\n list List user records\n find-first Find first matching user record\n search Search user records\n get Get a user by ID\n create Create a new user\n update Update an existing user\n delete Delete a user\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\nSearch Options:\n Search query string (required)\n --limit Max number of records to return\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --orderBy Comma-separated list of ordering values\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nuser \n\nCommands:\n list List user records\n find-first Find first matching user record\n search Search user records\n get Get a user by ID\n create Create a new user\n update Update an existing user\n delete Delete a user\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\nSearch Options:\n Search query string (required)\n --limit Max number of records to return\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --orderBy Comma-separated list of ordering values\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); + 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", "search", "get", "create", "update", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'search', '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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "search": + case 'search': return handleSearch(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq profilePicture: true, type: true, updatedAt: true, - username: true + username: true, }; - const findManyArgs = parseFindManyArgs & { - select: UserSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: UserSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.user.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter profilePicture: true, type: true, updatedAt: true, - username: true + username: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: UserSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: UserSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.user.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -118,17 +136,17 @@ async function handleSearch(argv: Partial>, _prompter: I try { const query = Array.isArray(argv._) && argv._.length > 0 ? String(argv._[0]) : undefined; if (!query) { - console.error("Error: search requires a argument"); + console.error('Error: search requires a argument'); process.exit(1); } const searchWhere = { trgmDisplayName: { value: query, - threshold: 0.3 + threshold: 0.3, }, searchTsv: { - query - } + query, + }, }; const defaultSelect = { createdAt: true, @@ -137,16 +155,18 @@ async function handleSearch(argv: Partial>, _prompter: I profilePicture: true, type: true, updatedAt: true, - username: true + username: true, }; - const findManyArgs = parseFindManyArgs & { - select: UserSelect; - }>(argv, defaultSelect, searchWhere); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: UserSelect; + } + >(argv, defaultSelect, searchWhere); const client = getClient(); const result = await client.user.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to search records."); + console.error('Failed to search records.'); if (error instanceof Error) { console.error(error.message); } @@ -155,28 +175,32 @@ async function handleSearch(argv: Partial>, _prompter: I } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.user.findOne({ - id: answers.id as string, - select: { - createdAt: true, - displayName: true, - id: true, - profilePicture: true, - type: true, - updatedAt: true, - username: true - } - }).execute(); + const result = await client.user + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + displayName: true, + id: true, + profilePicture: true, + type: true, + updatedAt: true, + username: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -185,54 +209,61 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "displayName", - message: "displayName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profilePicture", - message: "profilePicture", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "text", - name: "username", - message: "username", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profilePicture', + message: 'profilePicture', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'username', + message: 'username', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateUserInput["user"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateUserInput['user']; const client = getClient(); - const result = await client.user.create({ - data: { - displayName: cleanedData.displayName, - profilePicture: cleanedData.profilePicture, - type: cleanedData.type, - username: cleanedData.username - }, - select: { - createdAt: true, - displayName: true, - id: true, - profilePicture: true, - type: true, - updatedAt: true, - username: true - } - }).execute(); + const result = await client.user + .create({ + data: { + displayName: cleanedData.displayName, + profilePicture: cleanedData.profilePicture, + type: cleanedData.type, + username: cleanedData.username, + }, + select: { + createdAt: true, + displayName: true, + id: true, + profilePicture: true, + type: true, + updatedAt: true, + username: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -241,62 +272,70 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "displayName", - message: "displayName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profilePicture", - message: "profilePicture", - required: false, - skipPrompt: true - }, { - type: "text", - name: "type", - message: "type", - required: false, - skipPrompt: true - }, { - type: "text", - name: "username", - message: "username", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profilePicture', + message: 'profilePicture', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'type', + message: 'type', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'username', + message: 'username', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as UserPatch; const client = getClient(); - const result = await client.user.update({ - where: { - id: answers.id as string - }, - data: { - displayName: cleanedData.displayName, - profilePicture: cleanedData.profilePicture, - type: cleanedData.type, - username: cleanedData.username - }, - select: { - createdAt: true, - displayName: true, - id: true, - profilePicture: true, - type: true, - updatedAt: true, - username: true - } - }).execute(); + const result = await client.user + .update({ + where: { + id: answers.id as string, + }, + data: { + displayName: cleanedData.displayName, + profilePicture: cleanedData.profilePicture, + type: cleanedData.type, + username: cleanedData.username, + }, + select: { + createdAt: true, + displayName: true, + id: true, + profilePicture: true, + type: true, + updatedAt: true, + username: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -305,28 +344,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.user.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.user + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/verify-email.ts b/sdk/constructive-cli/src/auth/cli/commands/verify-email.ts index 91913cd7ac..dbc4bfabe4 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/verify-email.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/verify-email.ts @@ -3,37 +3,49 @@ * @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 { VerifyEmailVariables } from "../../orm/mutation"; -import type { VerifyEmailPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { VerifyEmailVariables } from '../../orm/mutation'; +import type { VerifyEmailPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("verify-email - verifyEmail\n\nUsage: verify-email [OPTIONS]\n"); + console.log('verify-email - verifyEmail\n\nUsage: verify-email [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 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.verifyEmail(parsedAnswers as unknown as VerifyEmailVariables, { - select: selectFields - } as unknown as { - select: VerifyEmailPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .verifyEmail( + parsedAnswers as unknown as VerifyEmailVariables, + { + select: selectFields, + } as unknown as { + select: VerifyEmailPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: verifyEmail"); + console.error('Failed: verifyEmail'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/verify-password.ts b/sdk/constructive-cli/src/auth/cli/commands/verify-password.ts index e25e45e3e8..c1e24455ce 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/verify-password.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/verify-password.ts @@ -3,37 +3,49 @@ * @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 { VerifyPasswordVariables } from "../../orm/mutation"; -import type { VerifyPasswordPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { VerifyPasswordVariables } from '../../orm/mutation'; +import type { VerifyPasswordPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("verify-password - verifyPassword\n\nUsage: verify-password [OPTIONS]\n"); + console.log('verify-password - verifyPassword\n\nUsage: verify-password [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 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.verifyPassword(parsedAnswers as unknown as VerifyPasswordVariables, { - select: selectFields - } as unknown as { - select: VerifyPasswordPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .verifyPassword( + parsedAnswers as unknown as VerifyPasswordVariables, + { + select: selectFields, + } as unknown as { + select: VerifyPasswordPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: verifyPassword"); + console.error('Failed: verifyPassword'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/verify-totp.ts b/sdk/constructive-cli/src/auth/cli/commands/verify-totp.ts index a65da81ac1..499b2a3852 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/verify-totp.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/verify-totp.ts @@ -3,37 +3,49 @@ * @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 { VerifyTotpVariables } from "../../orm/mutation"; -import type { VerifyTotpPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { VerifyTotpVariables } from '../../orm/mutation'; +import type { VerifyTotpPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("verify-totp - verifyTotp\n\nUsage: verify-totp [OPTIONS]\n"); + console.log('verify-totp - verifyTotp\n\nUsage: verify-totp [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 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.verifyTotp(parsedAnswers as unknown as VerifyTotpVariables, { - select: selectFields - } as unknown as { - select: VerifyTotpPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .verifyTotp( + parsedAnswers as unknown as VerifyTotpVariables, + { + select: selectFields, + } as unknown as { + select: VerifyTotpPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: verifyTotp"); + console.error('Failed: verifyTotp'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/webauthn-credential.ts b/sdk/constructive-cli/src/auth/cli/commands/webauthn-credential.ts index ea9c8e7838..b531717b08 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/webauthn-credential.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/webauthn-credential.ts @@ -3,62 +3,76 @@ * @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 { CreateWebauthnCredentialInput, WebauthnCredentialPatch, WebauthnCredentialSelect, WebauthnCredentialFilter, WebauthnCredentialOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateWebauthnCredentialInput, + WebauthnCredentialPatch, + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - backupEligible: "boolean", - backupState: "boolean", - createdAt: "string", - credentialDeviceType: "string", - credentialId: "string", - id: "uuid", - lastUsedAt: "string", - name: "string", - ownerId: "uuid", - publicKey: "string", - signCount: "int", - transports: "string", - updatedAt: "string", - webauthnUserId: "string" + backupEligible: 'boolean', + backupState: 'boolean', + createdAt: 'string', + credentialDeviceType: 'string', + credentialId: 'string', + id: 'uuid', + lastUsedAt: 'string', + name: 'string', + ownerId: 'uuid', + publicKey: 'string', + signCount: 'int', + transports: 'string', + updatedAt: 'string', + webauthnUserId: 'string', }; -const usage = "\nwebauthn-credential \n\nCommands:\n list List webauthnCredential records\n find-first Find first matching webauthnCredential record\n get Get a webauthnCredential by ID\n create Create a new webauthnCredential\n update Update an existing webauthnCredential\n delete Delete a webauthnCredential\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) => { +const usage = + '\nwebauthn-credential \n\nCommands:\n list List webauthnCredential records\n find-first Find first matching webauthnCredential record\n get Get a webauthnCredential by ID\n create Create a new webauthnCredential\n update Update an existing webauthnCredential\n delete Delete a webauthnCredential\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,22 @@ async function handleList(argv: Partial>, _prompter: Inq signCount: true, transports: true, updatedAt: true, - webauthnUserId: true + webauthnUserId: true, }; - const findManyArgs = parseFindManyArgs & { - select: WebauthnCredentialSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy + > & { + select: WebauthnCredentialSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webauthnCredential.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +133,22 @@ async function handleFindFirst(argv: Partial>, _prompter signCount: true, transports: true, updatedAt: true, - webauthnUserId: true + webauthnUserId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: WebauthnCredentialSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy + > & { + select: WebauthnCredentialSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webauthnCredential.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +157,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.webauthnCredential.findOne({ - id: answers.id as string, - select: { - backupEligible: true, - backupState: true, - createdAt: true, - credentialDeviceType: true, - credentialId: true, - id: true, - lastUsedAt: true, - name: true, - ownerId: true, - publicKey: true, - signCount: true, - transports: true, - updatedAt: true, - webauthnUserId: true - } - }).execute(); + const result = await client.webauthnCredential + .findOne({ + id: answers.id as string, + select: { + backupEligible: true, + backupState: true, + createdAt: true, + credentialDeviceType: true, + credentialId: true, + id: true, + lastUsedAt: true, + name: true, + ownerId: true, + publicKey: true, + signCount: true, + transports: true, + updatedAt: true, + webauthnUserId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,106 +198,123 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "backupEligible", - message: "backupEligible", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "backupState", - message: "backupState", - required: false, - skipPrompt: true - }, { - type: "text", - name: "credentialDeviceType", - message: "credentialDeviceType", - required: true - }, { - type: "text", - name: "credentialId", - message: "credentialId", - required: true - }, { - type: "text", - name: "lastUsedAt", - message: "lastUsedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicKey", - message: "publicKey", - required: true - }, { - type: "text", - name: "signCount", - message: "signCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "transports", - message: "transports", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webauthnUserId", - message: "webauthnUserId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'backupEligible', + message: 'backupEligible', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'backupState', + message: 'backupState', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'credentialDeviceType', + message: 'credentialDeviceType', + required: true, + }, + { + type: 'text', + name: 'credentialId', + message: 'credentialId', + required: true, + }, + { + type: 'text', + name: 'lastUsedAt', + message: 'lastUsedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicKey', + message: 'publicKey', + required: true, + }, + { + type: 'text', + name: 'signCount', + message: 'signCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'transports', + message: 'transports', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webauthnUserId', + message: 'webauthnUserId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateWebauthnCredentialInput["webauthnCredential"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateWebauthnCredentialInput['webauthnCredential']; const client = getClient(); - const result = await client.webauthnCredential.create({ - data: { - backupEligible: cleanedData.backupEligible, - backupState: cleanedData.backupState, - credentialDeviceType: cleanedData.credentialDeviceType, - credentialId: cleanedData.credentialId, - lastUsedAt: cleanedData.lastUsedAt, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - publicKey: cleanedData.publicKey, - signCount: cleanedData.signCount, - transports: cleanedData.transports, - webauthnUserId: cleanedData.webauthnUserId - }, - select: { - backupEligible: true, - backupState: true, - createdAt: true, - credentialDeviceType: true, - credentialId: true, - id: true, - lastUsedAt: true, - name: true, - ownerId: true, - publicKey: true, - signCount: true, - transports: true, - updatedAt: true, - webauthnUserId: true - } - }).execute(); + const result = await client.webauthnCredential + .create({ + data: { + backupEligible: cleanedData.backupEligible, + backupState: cleanedData.backupState, + credentialDeviceType: cleanedData.credentialDeviceType, + credentialId: cleanedData.credentialId, + lastUsedAt: cleanedData.lastUsedAt, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + publicKey: cleanedData.publicKey, + signCount: cleanedData.signCount, + transports: cleanedData.transports, + webauthnUserId: cleanedData.webauthnUserId, + }, + select: { + backupEligible: true, + backupState: true, + createdAt: true, + credentialDeviceType: true, + credentialId: true, + id: true, + lastUsedAt: true, + name: true, + ownerId: true, + publicKey: true, + signCount: true, + transports: true, + updatedAt: true, + webauthnUserId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -276,114 +323,129 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "backupEligible", - message: "backupEligible", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "backupState", - message: "backupState", - required: false, - skipPrompt: true - }, { - type: "text", - name: "credentialDeviceType", - message: "credentialDeviceType", - required: false - }, { - type: "text", - name: "credentialId", - message: "credentialId", - required: false - }, { - type: "text", - name: "lastUsedAt", - message: "lastUsedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicKey", - message: "publicKey", - required: false - }, { - type: "text", - name: "signCount", - message: "signCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "transports", - message: "transports", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webauthnUserId", - message: "webauthnUserId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'backupEligible', + message: 'backupEligible', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'backupState', + message: 'backupState', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'credentialDeviceType', + message: 'credentialDeviceType', + required: false, + }, + { + type: 'text', + name: 'credentialId', + message: 'credentialId', + required: false, + }, + { + type: 'text', + name: 'lastUsedAt', + message: 'lastUsedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicKey', + message: 'publicKey', + required: false, + }, + { + type: 'text', + name: 'signCount', + message: 'signCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'transports', + message: 'transports', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webauthnUserId', + message: 'webauthnUserId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as WebauthnCredentialPatch; const client = getClient(); - const result = await client.webauthnCredential.update({ - where: { - id: answers.id as string - }, - data: { - backupEligible: cleanedData.backupEligible, - backupState: cleanedData.backupState, - credentialDeviceType: cleanedData.credentialDeviceType, - credentialId: cleanedData.credentialId, - lastUsedAt: cleanedData.lastUsedAt, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - publicKey: cleanedData.publicKey, - signCount: cleanedData.signCount, - transports: cleanedData.transports, - webauthnUserId: cleanedData.webauthnUserId - }, - select: { - backupEligible: true, - backupState: true, - createdAt: true, - credentialDeviceType: true, - credentialId: true, - id: true, - lastUsedAt: true, - name: true, - ownerId: true, - publicKey: true, - signCount: true, - transports: true, - updatedAt: true, - webauthnUserId: true - } - }).execute(); + const result = await client.webauthnCredential + .update({ + where: { + id: answers.id as string, + }, + data: { + backupEligible: cleanedData.backupEligible, + backupState: cleanedData.backupState, + credentialDeviceType: cleanedData.credentialDeviceType, + credentialId: cleanedData.credentialId, + lastUsedAt: cleanedData.lastUsedAt, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + publicKey: cleanedData.publicKey, + signCount: cleanedData.signCount, + transports: cleanedData.transports, + webauthnUserId: cleanedData.webauthnUserId, + }, + select: { + backupEligible: true, + backupState: true, + createdAt: true, + credentialDeviceType: true, + credentialId: true, + id: true, + lastUsedAt: true, + name: true, + ownerId: true, + publicKey: true, + signCount: true, + transports: true, + updatedAt: true, + webauthnUserId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -392,28 +454,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.webauthnCredential.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.webauthnCredential + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/executor.ts b/sdk/constructive-cli/src/auth/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/auth/cli/executor.ts +++ b/sdk/constructive-cli/src/auth/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/cli/index.ts b/sdk/constructive-cli/src/auth/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/auth/cli/index.ts +++ b/sdk/constructive-cli/src/auth/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/auth/cli/utils.ts b/sdk/constructive-cli/src/auth/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/auth/cli/utils.ts +++ b/sdk/constructive-cli/src/auth/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/auth/index.ts b/sdk/constructive-cli/src/auth/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/auth/index.ts +++ b/sdk/constructive-cli/src/auth/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/auth/orm/client.ts b/sdk/constructive-cli/src/auth/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/auth/orm/client.ts +++ b/sdk/constructive-cli/src/auth/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/auth/orm/index.ts b/sdk/constructive-cli/src/auth/orm/index.ts index 7c5cb52e86..b677b5b306 100644 --- a/sdk/constructive-cli/src/auth/orm/index.ts +++ b/sdk/constructive-cli/src/auth/orm/index.ts @@ -3,30 +3,30 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AuditLogAuthModel } from "./models/auditLogAuth"; -import { CryptoAddressModel } from "./models/cryptoAddress"; -import { EmailModel } from "./models/email"; -import { IdentityProviderModel } from "./models/identityProvider"; -import { OrgApiKeyListModel } from "./models/orgApiKeyList"; -import { PhoneNumberModel } from "./models/phoneNumber"; -import { PrincipalModel } from "./models/principal"; -import { PrincipalEntityModel } from "./models/principalEntity"; -import { PrincipalScopeOverrideModel } from "./models/principalScopeOverride"; -import { RoleTypeModel } from "./models/roleType"; -import { UserConnectedAccountModel } from "./models/userConnectedAccount"; -import { UserModel } from "./models/user"; -import { WebauthnCredentialModel } from "./models/webauthnCredential"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AuditLogAuthModel } from './models/auditLogAuth'; +import { CryptoAddressModel } from './models/cryptoAddress'; +import { EmailModel } from './models/email'; +import { IdentityProviderModel } from './models/identityProvider'; +import { OrgApiKeyListModel } from './models/orgApiKeyList'; +import { PhoneNumberModel } from './models/phoneNumber'; +import { PrincipalModel } from './models/principal'; +import { PrincipalEntityModel } from './models/principalEntity'; +import { PrincipalScopeOverrideModel } from './models/principalScopeOverride'; +import { RoleTypeModel } from './models/roleType'; +import { UserConnectedAccountModel } from './models/userConnectedAccount'; +import { UserModel } from './models/user'; +import { WebauthnCredentialModel } from './models/webauthnCredential'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -67,6 +67,6 @@ export function createClient(config: OrmClientConfig) { user: new UserModel(client), webauthnCredential: new WebauthnCredentialModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/input-types.ts b/sdk/constructive-cli/src/auth/orm/input-types.ts index e6132cfc3d..56374f8968 100644 --- a/sdk/constructive-cli/src/auth/orm/input-types.ts +++ b/sdk/constructive-cli/src/auth/orm/input-types.ts @@ -495,9 +495,11 @@ export type OrgApiKeyListWithRelations = OrgApiKeyList & OrgApiKeyListRelations; export type PhoneNumberWithRelations = PhoneNumber & PhoneNumberRelations; export type PrincipalWithRelations = Principal & PrincipalRelations; export type PrincipalEntityWithRelations = PrincipalEntity & PrincipalEntityRelations; -export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & PrincipalScopeOverrideRelations; +export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & + PrincipalScopeOverrideRelations; export type RoleTypeWithRelations = RoleType & RoleTypeRelations; -export type UserConnectedAccountWithRelations = UserConnectedAccount & UserConnectedAccountRelations; +export type UserConnectedAccountWithRelations = UserConnectedAccount & + UserConnectedAccountRelations; export type UserWithRelations = User & UserRelations; export type WebauthnCredentialWithRelations = WebauthnCredential & WebauthnCredentialRelations; // ============ Entity Select Types ============ @@ -1145,19 +1147,268 @@ export interface WebauthnCredentialFilter { webauthnUserId?: StringFilter; } // ============ OrderBy Types ============ -export type AuditLogAuthOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_ASC" | "EVENT_DESC" | "ID_ASC" | "ID_DESC" | "IP_ADDRESS_ASC" | "IP_ADDRESS_DESC" | "NATURAL" | "ORIGIN_ASC" | "ORIGIN_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "USER_AGENT_ASC" | "USER_AGENT_DESC"; -export type CryptoAddressOrderBy = "ADDRESS_ASC" | "ADDRESS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type EmailOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type IdentityProviderOrderBy = "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "ENABLED_ASC" | "ENABLED_DESC" | "KIND_ASC" | "KIND_DESC" | "NATURAL" | "SLUG_ASC" | "SLUG_DESC"; -export type OrgApiKeyListOrderBy = "ACCESS_LEVEL_ASC" | "ACCESS_LEVEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "KEY_ID_ASC" | "KEY_ID_DESC" | "LAST_USED_AT_ASC" | "LAST_USED_AT_DESC" | "MFA_LEVEL_ASC" | "MFA_LEVEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "ORG_ID_ASC" | "ORG_ID_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "REVOKED_AT_ASC" | "REVOKED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PhoneNumberOrderBy = "CC_ASC" | "CC_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUMBER_ASC" | "NUMBER_DESC" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PrincipalOrderBy = "BYPASS_STEP_UP_ASC" | "BYPASS_STEP_UP_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_ID_ASC" | "USER_ID_DESC" | "USE_ADMIN_OWNER_ASC" | "USE_ADMIN_OWNER_DESC"; -export type PrincipalEntityOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PrincipalScopeOverrideOrderBy = "ALLOWED_MASK_ASC" | "ALLOWED_MASK_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "MEMBERSHIP_TYPE_ASC" | "MEMBERSHIP_TYPE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USE_ADMIN_OWNER_ASC" | "USE_ADMIN_OWNER_DESC"; -export type RoleTypeOrderBy = "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type UserConnectedAccountOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DETAILS_ASC" | "DETAILS_DESC" | "IDENTIFIER_ASC" | "IDENTIFIER_DESC" | "ID_ASC" | "ID_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "SERVICE_ASC" | "SERVICE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type UserOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "DISPLAY_NAME_TRGM_SIMILARITY_ASC" | "DISPLAY_NAME_TRGM_SIMILARITY_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_PICTURE_ASC" | "PROFILE_PICTURE_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "SEARCH_TSV_ASC" | "SEARCH_TSV_DESC" | "SEARCH_TSV_RANK_ASC" | "SEARCH_TSV_RANK_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USERNAME_ASC" | "USERNAME_DESC"; -export type WebauthnCredentialOrderBy = "BACKUP_ELIGIBLE_ASC" | "BACKUP_ELIGIBLE_DESC" | "BACKUP_STATE_ASC" | "BACKUP_STATE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREDENTIAL_DEVICE_TYPE_ASC" | "CREDENTIAL_DEVICE_TYPE_DESC" | "CREDENTIAL_ID_ASC" | "CREDENTIAL_ID_DESC" | "ID_ASC" | "ID_DESC" | "LAST_USED_AT_ASC" | "LAST_USED_AT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PUBLIC_KEY_ASC" | "PUBLIC_KEY_DESC" | "SIGN_COUNT_ASC" | "SIGN_COUNT_DESC" | "TRANSPORTS_ASC" | "TRANSPORTS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WEBAUTHN_USER_ID_ASC" | "WEBAUTHN_USER_ID_DESC"; +export type AuditLogAuthOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IP_ADDRESS_ASC' + | 'IP_ADDRESS_DESC' + | 'NATURAL' + | 'ORIGIN_ASC' + | 'ORIGIN_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'USER_AGENT_ASC' + | 'USER_AGENT_DESC'; +export type CryptoAddressOrderBy = + | 'ADDRESS_ASC' + | 'ADDRESS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type EmailOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type IdentityProviderOrderBy = + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'ENABLED_ASC' + | 'ENABLED_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'NATURAL' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type OrgApiKeyListOrderBy = + | 'ACCESS_LEVEL_ASC' + | 'ACCESS_LEVEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KEY_ID_ASC' + | 'KEY_ID_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'MFA_LEVEL_ASC' + | 'MFA_LEVEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'ORG_ID_ASC' + | 'ORG_ID_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'REVOKED_AT_ASC' + | 'REVOKED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PhoneNumberOrderBy = + | 'CC_ASC' + | 'CC_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUMBER_ASC' + | 'NUMBER_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PrincipalOrderBy = + | 'BYPASS_STEP_UP_ASC' + | 'BYPASS_STEP_UP_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_ID_ASC' + | 'USER_ID_DESC' + | 'USE_ADMIN_OWNER_ASC' + | 'USE_ADMIN_OWNER_DESC'; +export type PrincipalEntityOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PrincipalScopeOverrideOrderBy = + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'MEMBERSHIP_TYPE_ASC' + | 'MEMBERSHIP_TYPE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USE_ADMIN_OWNER_ASC' + | 'USE_ADMIN_OWNER_DESC'; +export type RoleTypeOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type UserConnectedAccountOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DETAILS_ASC' + | 'DETAILS_DESC' + | 'IDENTIFIER_ASC' + | 'IDENTIFIER_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'SERVICE_ASC' + | 'SERVICE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type UserOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'DISPLAY_NAME_TRGM_SIMILARITY_ASC' + | 'DISPLAY_NAME_TRGM_SIMILARITY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_PICTURE_ASC' + | 'PROFILE_PICTURE_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'SEARCH_TSV_ASC' + | 'SEARCH_TSV_DESC' + | 'SEARCH_TSV_RANK_ASC' + | 'SEARCH_TSV_RANK_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USERNAME_ASC' + | 'USERNAME_DESC'; +export type WebauthnCredentialOrderBy = + | 'BACKUP_ELIGIBLE_ASC' + | 'BACKUP_ELIGIBLE_DESC' + | 'BACKUP_STATE_ASC' + | 'BACKUP_STATE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREDENTIAL_DEVICE_TYPE_ASC' + | 'CREDENTIAL_DEVICE_TYPE_DESC' + | 'CREDENTIAL_ID_ASC' + | 'CREDENTIAL_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PUBLIC_KEY_ASC' + | 'PUBLIC_KEY_DESC' + | 'SIGN_COUNT_ASC' + | 'SIGN_COUNT_DESC' + | 'TRANSPORTS_ASC' + | 'TRANSPORTS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WEBAUTHN_USER_ID_ASC' + | 'WEBAUTHN_USER_ID_DESC'; // ============ CRUD Input Types ============ export interface CreateAuditLogAuthInput { clientMutationId?: string; @@ -1512,24 +1763,24 @@ export interface DeleteWebauthnCredentialInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Principal": { - "principalEntities": "PrincipalEntity", - "principalScopeOverrides": "PrincipalScopeOverride" + Principal: { + principalEntities: 'PrincipalEntity', + principalScopeOverrides: 'PrincipalScopeOverride', }, - "RoleType": { - "usersByType": "User" + RoleType: { + usersByType: 'User', + }, + User: { + auditLogAuthsByActorId: 'AuditLogAuth', + ownedCryptoAddresses: 'CryptoAddress', + ownedEmails: 'Email', + ownedPhoneNumbers: 'PhoneNumber', + ownedPrincipalEntities: 'PrincipalEntity', + ownedPrincipals: 'Principal', + ownedWebauthnCredentials: 'WebauthnCredential', + principalEntitiesByEntityId: 'PrincipalEntity', + principals: 'Principal', }, - "User": { - "auditLogAuthsByActorId": "AuditLogAuth", - "ownedCryptoAddresses": "CryptoAddress", - "ownedEmails": "Email", - "ownedPhoneNumbers": "PhoneNumber", - "ownedPrincipalEntities": "PrincipalEntity", - "ownedPrincipals": "Principal", - "ownedWebauthnCredentials": "WebauthnCredential", - "principalEntitiesByEntityId": "PrincipalEntity", - "principals": "Principal" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface CheckPasswordInput { @@ -3705,4 +3956,4 @@ export type WebauthnCredentialEdgeSelect = { node?: { select: WebauthnCredentialSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/auth/orm/models/auditLogAuth.ts b/sdk/constructive-cli/src/auth/orm/models/auditLogAuth.ts index 250bad2507..d0eee8faf1 100644 --- a/sdk/constructive-cli/src/auth/orm/models/auditLogAuth.ts +++ b/sdk/constructive-cli/src/auth/orm/models/auditLogAuth.ts @@ -3,56 +3,96 @@ * @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 { AuditLogAuth, AuditLogAuthWithRelations, AuditLogAuthSelect, AuditLogAuthFilter, AuditLogAuthOrderBy, CreateAuditLogAuthInput, UpdateAuditLogAuthInput, AuditLogAuthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AuditLogAuth, + AuditLogAuthWithRelations, + AuditLogAuthSelect, + AuditLogAuthFilter, + AuditLogAuthOrderBy, + CreateAuditLogAuthInput, + UpdateAuditLogAuthInput, + AuditLogAuthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AuditLogAuthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuths: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AuditLogAuth", "auditLogAuths", 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 - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AuditLogAuth', + 'auditLogAuths', + 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, + }, + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuths", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AuditLogAuth", "auditLogAuths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AuditLogAuth', + 'auditLogAuths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuth", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuth', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AuditLogAuthModel { nodes?: InferSelectResult[]; }; }) => ({ - "auditLogAuth": data.auditLogAuths?.nodes?.[0] ?? null - }) + auditLogAuth: data.auditLogAuths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AuditLogAuth", "auditLogAuths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AuditLogAuth', + 'auditLogAuths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuth", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuth', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class AuditLogAuthModel { nodes?: InferSelectResult[]; }; }) => ({ - "auditLogAuth": data.auditLogAuths?.nodes?.[0] ?? null - }) + auditLogAuth: data.auditLogAuths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AuditLogAuth", "createAuditLogAuth", "auditLogAuth", args.select, args.data, "CreateAuditLogAuthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AuditLogAuth', + 'createAuditLogAuth', + 'auditLogAuth', + args.select, + args.data, + 'CreateAuditLogAuthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "createAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'createAuditLogAuth', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + AuditLogAuthPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AuditLogAuth", "updateAuditLogAuth", "auditLogAuth", args.select, args.where.id, args.data, "UpdateAuditLogAuthInput", "id", "auditLogAuthPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'AuditLogAuth', + 'updateAuditLogAuth', + 'auditLogAuth', + args.select, + args.where.id, + args.data, + 'UpdateAuditLogAuthInput', + 'id', + 'auditLogAuthPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "updateAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'updateAuditLogAuth', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AuditLogAuth", "deleteAuditLogAuth", "auditLogAuth", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteAuditLogAuthInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AuditLogAuth', + 'deleteAuditLogAuth', + 'auditLogAuth', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteAuditLogAuthInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "deleteAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'deleteAuditLogAuth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/cryptoAddress.ts b/sdk/constructive-cli/src/auth/orm/models/cryptoAddress.ts index dbf942ec7b..5dc26c76df 100644 --- a/sdk/constructive-cli/src/auth/orm/models/cryptoAddress.ts +++ b/sdk/constructive-cli/src/auth/orm/models/cryptoAddress.ts @@ -3,56 +3,96 @@ * @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 { CryptoAddress, CryptoAddressWithRelations, CryptoAddressSelect, CryptoAddressFilter, CryptoAddressOrderBy, CreateCryptoAddressInput, UpdateCryptoAddressInput, CryptoAddressPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAddress, + CryptoAddressWithRelations, + CryptoAddressSelect, + CryptoAddressFilter, + CryptoAddressOrderBy, + CreateCryptoAddressInput, + UpdateCryptoAddressInput, + CryptoAddressPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAddressModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddresses: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddress", "cryptoAddresses", 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 - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAddress', + 'cryptoAddresses', + 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, + }, + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddresses", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddresses', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddress: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAddress", "cryptoAddresses", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAddress', + 'cryptoAddresses', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddress", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddress', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CryptoAddressModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddress": data.cryptoAddresses?.nodes?.[0] ?? null - }) + cryptoAddress: data.cryptoAddresses?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddress: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddress", "cryptoAddresses", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAddress', + 'cryptoAddresses', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddress", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddress', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CryptoAddressModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddress": data.cryptoAddresses?.nodes?.[0] ?? null - }) + cryptoAddress: data.cryptoAddresses?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAddress", "createCryptoAddress", "cryptoAddress", args.select, args.data, "CreateCryptoAddressInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAddress', + 'createCryptoAddress', + 'cryptoAddress', + args.select, + args.data, + 'CreateCryptoAddressInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "createCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'createCryptoAddress', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAddressPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAddress", "updateCryptoAddress", "cryptoAddress", args.select, args.where.id, args.data, "UpdateCryptoAddressInput", "id", "cryptoAddressPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAddress', + 'updateCryptoAddress', + 'cryptoAddress', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAddressInput', + 'id', + 'cryptoAddressPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "updateCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'updateCryptoAddress', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAddress", "deleteCryptoAddress", "cryptoAddress", { - id: args.where.id - }, "DeleteCryptoAddressInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAddress', + 'deleteCryptoAddress', + 'cryptoAddress', + { + id: args.where.id, + }, + 'DeleteCryptoAddressInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "deleteCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'deleteCryptoAddress', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/email.ts b/sdk/constructive-cli/src/auth/orm/models/email.ts index d3bf3812f5..eb60ea671f 100644 --- a/sdk/constructive-cli/src/auth/orm/models/email.ts +++ b/sdk/constructive-cli/src/auth/orm/models/email.ts @@ -3,56 +3,96 @@ * @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 { Email, EmailWithRelations, EmailSelect, EmailFilter, EmailOrderBy, CreateEmailInput, UpdateEmailInput, EmailPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Email, + EmailWithRelations, + EmailSelect, + EmailFilter, + EmailOrderBy, + CreateEmailInput, + UpdateEmailInput, + EmailPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmailModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emails: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Email", "emails", 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 - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Email', + 'emails', + 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, + }, + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "emails", + operation: 'query', + operationName: 'Email', + fieldName: 'emails', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ email: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Email", "emails", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Email', + 'emails', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "email", + operation: 'query', + operationName: 'Email', + fieldName: 'email', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmailModel { nodes?: InferSelectResult[]; }; }) => ({ - "email": data.emails?.nodes?.[0] ?? null - }) + email: data.emails?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ email: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Email", "emails", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Email', + 'emails', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "email", + operation: 'query', + operationName: 'Email', + fieldName: 'email', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmailModel { nodes?: InferSelectResult[]; }; }) => ({ - "email": data.emails?.nodes?.[0] ?? null - }) + email: data.emails?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Email", "createEmail", "email", args.select, args.data, "CreateEmailInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Email', + 'createEmail', + 'email', + args.select, + args.data, + 'CreateEmailInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "createEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'createEmail', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmailPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Email", "updateEmail", "email", args.select, args.where.id, args.data, "UpdateEmailInput", "id", "emailPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Email', + 'updateEmail', + 'email', + args.select, + args.where.id, + args.data, + 'UpdateEmailInput', + 'id', + 'emailPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "updateEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'updateEmail', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Email", "deleteEmail", "email", { - id: args.where.id - }, "DeleteEmailInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Email', + 'deleteEmail', + 'email', + { + id: args.where.id, + }, + 'DeleteEmailInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "deleteEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'deleteEmail', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/identityProvider.ts b/sdk/constructive-cli/src/auth/orm/models/identityProvider.ts index f339ccf4d3..cdc672145c 100644 --- a/sdk/constructive-cli/src/auth/orm/models/identityProvider.ts +++ b/sdk/constructive-cli/src/auth/orm/models/identityProvider.ts @@ -3,56 +3,96 @@ * @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 { IdentityProvider, IdentityProviderWithRelations, IdentityProviderSelect, IdentityProviderFilter, IdentityProviderOrderBy, CreateIdentityProviderInput, UpdateIdentityProviderInput, IdentityProviderPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IdentityProvider, + IdentityProviderWithRelations, + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy, + CreateIdentityProviderInput, + UpdateIdentityProviderInput, + IdentityProviderPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IdentityProviderModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProviders: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvider", "identityProviders", 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 - }, "IdentityProviderFilter", "IdentityProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IdentityProvider', + 'identityProviders', + 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, + }, + 'IdentityProviderFilter', + 'IdentityProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvider", - fieldName: "identityProviders", + operation: 'query', + operationName: 'IdentityProvider', + fieldName: 'identityProviders', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IdentityProvider", "identityProviders", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IdentityProviderFilter", "IdentityProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IdentityProvider', + 'identityProviders', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IdentityProviderFilter', + 'IdentityProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvider", - fieldName: "identityProvider", + operation: 'query', + operationName: 'IdentityProvider', + fieldName: 'identityProvider', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class IdentityProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvider": data.identityProviders?.nodes?.[0] ?? null - }) + identityProvider: data.identityProviders?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIdentityProvider: { identityProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IdentityProvider", "createIdentityProvider", "identityProvider", args.select, args.data, "CreateIdentityProviderInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IdentityProvider', + 'createIdentityProvider', + 'identityProvider', + args.select, + args.data, + 'CreateIdentityProviderInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvider", - fieldName: "createIdentityProvider", + operation: 'mutation', + operationName: 'IdentityProvider', + fieldName: 'createIdentityProvider', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/index.ts b/sdk/constructive-cli/src/auth/orm/models/index.ts index 114133e294..16f584ff03 100644 --- a/sdk/constructive-cli/src/auth/orm/models/index.ts +++ b/sdk/constructive-cli/src/auth/orm/models/index.ts @@ -3,16 +3,16 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AuditLogAuthModel } from "./auditLogAuth"; -export { CryptoAddressModel } from "./cryptoAddress"; -export { EmailModel } from "./email"; -export { IdentityProviderModel } from "./identityProvider"; -export { OrgApiKeyListModel } from "./orgApiKeyList"; -export { PhoneNumberModel } from "./phoneNumber"; -export { PrincipalModel } from "./principal"; -export { PrincipalEntityModel } from "./principalEntity"; -export { PrincipalScopeOverrideModel } from "./principalScopeOverride"; -export { RoleTypeModel } from "./roleType"; -export { UserConnectedAccountModel } from "./userConnectedAccount"; -export { UserModel } from "./user"; -export { WebauthnCredentialModel } from "./webauthnCredential"; \ No newline at end of file +export { AuditLogAuthModel } from './auditLogAuth'; +export { CryptoAddressModel } from './cryptoAddress'; +export { EmailModel } from './email'; +export { IdentityProviderModel } from './identityProvider'; +export { OrgApiKeyListModel } from './orgApiKeyList'; +export { PhoneNumberModel } from './phoneNumber'; +export { PrincipalModel } from './principal'; +export { PrincipalEntityModel } from './principalEntity'; +export { PrincipalScopeOverrideModel } from './principalScopeOverride'; +export { RoleTypeModel } from './roleType'; +export { UserConnectedAccountModel } from './userConnectedAccount'; +export { UserModel } from './user'; +export { WebauthnCredentialModel } from './webauthnCredential'; diff --git a/sdk/constructive-cli/src/auth/orm/models/orgApiKeyList.ts b/sdk/constructive-cli/src/auth/orm/models/orgApiKeyList.ts index 8c834057b7..fe7120ee8a 100644 --- a/sdk/constructive-cli/src/auth/orm/models/orgApiKeyList.ts +++ b/sdk/constructive-cli/src/auth/orm/models/orgApiKeyList.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyLists', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgApiKeyListModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgApiKeyList": data.orgApiKeyLists?.nodes?.[0] ?? null - }) + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgApiKeyList: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgApiKeyList", "orgApiKeyLists", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgApiKeyListFilter", "OrgApiKeyListOrderBy", connectionFieldsMap); + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgApiKeyList", - fieldName: "orgApiKeyList", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class OrgApiKeyListModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgApiKeyList": data.orgApiKeyLists?.nodes?.[0] ?? null - }) + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgApiKeyList: { orgApiKeyList: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgApiKeyList", "createOrgApiKeyList", "orgApiKeyList", args.select, args.data, "CreateOrgApiKeyListInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'OrgApiKeyList', + fieldName: 'createOrgApiKeyList', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/phoneNumber.ts b/sdk/constructive-cli/src/auth/orm/models/phoneNumber.ts index 113fbf78bb..f005f23c34 100644 --- a/sdk/constructive-cli/src/auth/orm/models/phoneNumber.ts +++ b/sdk/constructive-cli/src/auth/orm/models/phoneNumber.ts @@ -3,56 +3,96 @@ * @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 { PhoneNumber, PhoneNumberWithRelations, PhoneNumberSelect, PhoneNumberFilter, PhoneNumberOrderBy, CreatePhoneNumberInput, UpdatePhoneNumberInput, PhoneNumberPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PhoneNumber, + PhoneNumberWithRelations, + PhoneNumberSelect, + PhoneNumberFilter, + PhoneNumberOrderBy, + CreatePhoneNumberInput, + UpdatePhoneNumberInput, + PhoneNumberPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PhoneNumberModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumber", "phoneNumbers", 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 - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PhoneNumber', + 'phoneNumbers', + 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, + }, + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumbers", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumbers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumber: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PhoneNumber", "phoneNumbers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PhoneNumber', + 'phoneNumbers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumber", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumber', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PhoneNumberModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumber": data.phoneNumbers?.nodes?.[0] ?? null - }) + phoneNumber: data.phoneNumbers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumber: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumber", "phoneNumbers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PhoneNumber', + 'phoneNumbers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumber", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumber', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PhoneNumberModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumber": data.phoneNumbers?.nodes?.[0] ?? null - }) + phoneNumber: data.phoneNumbers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PhoneNumber", "createPhoneNumber", "phoneNumber", args.select, args.data, "CreatePhoneNumberInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PhoneNumber', + 'createPhoneNumber', + 'phoneNumber', + args.select, + args.data, + 'CreatePhoneNumberInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "createPhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'createPhoneNumber', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PhoneNumberPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PhoneNumber", "updatePhoneNumber", "phoneNumber", args.select, args.where.id, args.data, "UpdatePhoneNumberInput", "id", "phoneNumberPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PhoneNumber', + 'updatePhoneNumber', + 'phoneNumber', + args.select, + args.where.id, + args.data, + 'UpdatePhoneNumberInput', + 'id', + 'phoneNumberPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "updatePhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'updatePhoneNumber', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PhoneNumber", "deletePhoneNumber", "phoneNumber", { - id: args.where.id - }, "DeletePhoneNumberInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PhoneNumber', + 'deletePhoneNumber', + 'phoneNumber', + { + id: args.where.id, + }, + 'DeletePhoneNumberInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "deletePhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'deletePhoneNumber', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/principal.ts b/sdk/constructive-cli/src/auth/orm/models/principal.ts index 74f25735af..05e5aa400c 100644 --- a/sdk/constructive-cli/src/auth/orm/models/principal.ts +++ b/sdk/constructive-cli/src/auth/orm/models/principal.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'Principal', + fieldName: 'principals', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalModel { nodes?: InferSelectResult[]; }; }) => ({ - "principal": data.principals?.nodes?.[0] ?? null - }) + principal: data.principals?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - principalId: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + principalId: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principal: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Principal", "principals", args.select, { - where: { - principalId: { - equalTo: args.principalId - } + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + args.select, + { + where: { + principalId: { + equalTo: args.principalId, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalFilter", "PrincipalOrderBy", connectionFieldsMap); + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Principal", - fieldName: "principal", + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class PrincipalModel { nodes?: InferSelectResult[]; }; }) => ({ - "principal": data.principals?.nodes?.[0] ?? null - }) + principal: data.principals?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipal: { principal: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Principal", "createPrincipal", "principal", args.select, args.data, "CreatePrincipalInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'Principal', + fieldName: 'createPrincipal', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/principalEntity.ts b/sdk/constructive-cli/src/auth/orm/models/principalEntity.ts index bb89e7c1ac..0c265501f5 100644 --- a/sdk/constructive-cli/src/auth/orm/models/principalEntity.ts +++ b/sdk/constructive-cli/src/auth/orm/models/principalEntity.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalEntityModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalEntity": data.principalEntities?.nodes?.[0] ?? null - }) + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalEntity: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalEntity", "principalEntities", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalEntityFilter", "PrincipalEntityOrderBy", connectionFieldsMap); + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalEntity", - fieldName: "principalEntity", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PrincipalEntityModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalEntity": data.principalEntities?.nodes?.[0] ?? null - }) + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalEntity: { principalEntity: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalEntity", "createPrincipalEntity", "principalEntity", args.select, args.data, "CreatePrincipalEntityInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'createPrincipalEntity', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'updatePrincipalEntity', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'deletePrincipalEntity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/principalScopeOverride.ts b/sdk/constructive-cli/src/auth/orm/models/principalScopeOverride.ts index 44fc657725..3d3e7bedd3 100644 --- a/sdk/constructive-cli/src/auth/orm/models/principalScopeOverride.ts +++ b/sdk/constructive-cli/src/auth/orm/models/principalScopeOverride.ts @@ -3,56 +3,98 @@ * @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"; +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>; + 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); + 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", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverrides', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PrincipalScopeOverrideModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalScopeOverride": data.principalScopeOverrides?.nodes?.[0] ?? null - }) + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalScopeOverride: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalScopeOverride", "principalScopeOverrides", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalScopeOverrideFilter", "PrincipalScopeOverrideOrderBy", connectionFieldsMap); + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalScopeOverride", - fieldName: "principalScopeOverride", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PrincipalScopeOverrideModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalScopeOverride": data.principalScopeOverrides?.nodes?.[0] ?? null - }) + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalScopeOverride: { principalScopeOverride: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalScopeOverride", "createPrincipalScopeOverride", "principalScopeOverride", args.select, args.data, "CreatePrincipalScopeOverrideInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalScopeOverride', + fieldName: 'createPrincipalScopeOverride', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/roleType.ts b/sdk/constructive-cli/src/auth/orm/models/roleType.ts index 9ad06fd49a..e8df4924bd 100644 --- a/sdk/constructive-cli/src/auth/orm/models/roleType.ts +++ b/sdk/constructive-cli/src/auth/orm/models/roleType.ts @@ -3,56 +3,96 @@ * @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 { RoleType, RoleTypeWithRelations, RoleTypeSelect, RoleTypeFilter, RoleTypeOrderBy, CreateRoleTypeInput, UpdateRoleTypeInput, RoleTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RoleType, + RoleTypeWithRelations, + RoleTypeSelect, + RoleTypeFilter, + RoleTypeOrderBy, + CreateRoleTypeInput, + UpdateRoleTypeInput, + RoleTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RoleTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ roleTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RoleType", "roleTypes", 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 - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RoleType', + 'roleTypes', + 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, + }, + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleTypes", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ roleType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RoleType", "roleTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RoleType', + 'roleTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleType", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RoleTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "roleType": data.roleTypes?.nodes?.[0] ?? null - }) + roleType: data.roleTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ roleType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RoleType", "roleTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RoleType', + 'roleTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleType", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RoleTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "roleType": data.roleTypes?.nodes?.[0] ?? null - }) + roleType: data.roleTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RoleType", "createRoleType", "roleType", args.select, args.data, "CreateRoleTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RoleType', + 'createRoleType', + 'roleType', + args.select, + args.data, + 'CreateRoleTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "createRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'createRoleType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: number; + }, + RoleTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RoleType", "updateRoleType", "roleType", args.select, args.where.id, args.data, "UpdateRoleTypeInput", "id", "roleTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RoleType', + 'updateRoleType', + 'roleType', + args.select, + args.where.id, + args.data, + 'UpdateRoleTypeInput', + 'id', + 'roleTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "updateRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'updateRoleType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: number; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: number; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RoleType", "deleteRoleType", "roleType", { - id: args.where.id - }, "DeleteRoleTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RoleType', + 'deleteRoleType', + 'roleType', + { + id: args.where.id, + }, + 'DeleteRoleTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "deleteRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'deleteRoleType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/user.ts b/sdk/constructive-cli/src/auth/orm/models/user.ts index e1ba665fee..a35147a5ac 100644 --- a/sdk/constructive-cli/src/auth/orm/models/user.ts +++ b/sdk/constructive-cli/src/auth/orm/models/user.ts @@ -3,56 +3,96 @@ * @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 { User, UserWithRelations, UserSelect, UserFilter, UserOrderBy, CreateUserInput, UpdateUserInput, UserPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + User, + UserWithRelations, + UserSelect, + UserFilter, + UserOrderBy, + CreateUserInput, + UpdateUserInput, + UserPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ users: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("User", "users", 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 - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'User', + 'users', + 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, + }, + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "users", + operation: 'query', + operationName: 'User', + fieldName: 'users', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ user: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("User", "users", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'User', + 'users', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "user", + operation: 'query', + operationName: 'User', + fieldName: 'user', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserModel { nodes?: InferSelectResult[]; }; }) => ({ - "user": data.users?.nodes?.[0] ?? null - }) + user: data.users?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ user: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("User", "users", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'User', + 'users', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "user", + operation: 'query', + operationName: 'User', + fieldName: 'user', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserModel { nodes?: InferSelectResult[]; }; }) => ({ - "user": data.users?.nodes?.[0] ?? null - }) + user: data.users?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("User", "createUser", "user", args.select, args.data, "CreateUserInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'User', + 'createUser', + 'user', + args.select, + args.data, + 'CreateUserInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "createUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'createUser', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("User", "updateUser", "user", args.select, args.where.id, args.data, "UpdateUserInput", "id", "userPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'User', + 'updateUser', + 'user', + args.select, + args.where.id, + args.data, + 'UpdateUserInput', + 'id', + 'userPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "updateUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'updateUser', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("User", "deleteUser", "user", { - id: args.where.id - }, "DeleteUserInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'User', + 'deleteUser', + 'user', + { + id: args.where.id, + }, + 'DeleteUserInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "deleteUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'deleteUser', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/userConnectedAccount.ts b/sdk/constructive-cli/src/auth/orm/models/userConnectedAccount.ts index a9666543ab..a2344afdf4 100644 --- a/sdk/constructive-cli/src/auth/orm/models/userConnectedAccount.ts +++ b/sdk/constructive-cli/src/auth/orm/models/userConnectedAccount.ts @@ -3,56 +3,98 @@ * @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 { UserConnectedAccount, UserConnectedAccountWithRelations, UserConnectedAccountSelect, UserConnectedAccountFilter, UserConnectedAccountOrderBy, CreateUserConnectedAccountInput, UpdateUserConnectedAccountInput, UserConnectedAccountPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserConnectedAccount, + UserConnectedAccountWithRelations, + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy, + CreateUserConnectedAccountInput, + UpdateUserConnectedAccountInput, + UserConnectedAccountPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserConnectedAccountModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - userConnectedAccounts: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + userConnectedAccounts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("UserConnectedAccount", "userConnectedAccounts", 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 - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + 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, + }, + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccounts", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccounts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userConnectedAccount: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserConnectedAccount", "userConnectedAccounts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccount", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccount', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class UserConnectedAccountModel { nodes?: InferSelectResult[]; }; }) => ({ - "userConnectedAccount": data.userConnectedAccounts?.nodes?.[0] ?? null - }) + userConnectedAccount: data.userConnectedAccounts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userConnectedAccount: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserConnectedAccount", "userConnectedAccounts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccount", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccount', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class UserConnectedAccountModel { nodes?: InferSelectResult[]; }; }) => ({ - "userConnectedAccount": data.userConnectedAccounts?.nodes?.[0] ?? null - }) + userConnectedAccount: data.userConnectedAccounts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserConnectedAccount: { userConnectedAccount: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserConnectedAccount", "createUserConnectedAccount", "userConnectedAccount", args.select, args.data, "CreateUserConnectedAccountInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserConnectedAccount', + 'createUserConnectedAccount', + 'userConnectedAccount', + args.select, + args.data, + 'CreateUserConnectedAccountInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserConnectedAccount", - fieldName: "createUserConnectedAccount", + operation: 'mutation', + operationName: 'UserConnectedAccount', + fieldName: 'createUserConnectedAccount', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/models/webauthnCredential.ts b/sdk/constructive-cli/src/auth/orm/models/webauthnCredential.ts index 9760690ceb..bc31ef6a16 100644 --- a/sdk/constructive-cli/src/auth/orm/models/webauthnCredential.ts +++ b/sdk/constructive-cli/src/auth/orm/models/webauthnCredential.ts @@ -3,56 +3,96 @@ * @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 { WebauthnCredential, WebauthnCredentialWithRelations, WebauthnCredentialSelect, WebauthnCredentialFilter, WebauthnCredentialOrderBy, CreateWebauthnCredentialInput, UpdateWebauthnCredentialInput, WebauthnCredentialPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnCredential, + WebauthnCredentialWithRelations, + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy, + CreateWebauthnCredentialInput, + UpdateWebauthnCredentialInput, + WebauthnCredentialPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnCredentialModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentials: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredential", "webauthnCredentials", 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 - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnCredential', + 'webauthnCredentials', + 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, + }, + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredentials", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredentials', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredential: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnCredential", "webauthnCredentials", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnCredential', + 'webauthnCredentials', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredential", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredential', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnCredentialModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredential": data.webauthnCredentials?.nodes?.[0] ?? null - }) + webauthnCredential: data.webauthnCredentials?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredential: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredential", "webauthnCredentials", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnCredential', + 'webauthnCredentials', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredential", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredential', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnCredentialModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredential": data.webauthnCredentials?.nodes?.[0] ?? null - }) + webauthnCredential: data.webauthnCredentials?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnCredential", "createWebauthnCredential", "webauthnCredential", args.select, args.data, "CreateWebauthnCredentialInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnCredential', + 'createWebauthnCredential', + 'webauthnCredential', + args.select, + args.data, + 'CreateWebauthnCredentialInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "createWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'createWebauthnCredential', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnCredentialPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnCredential", "updateWebauthnCredential", "webauthnCredential", args.select, args.where.id, args.data, "UpdateWebauthnCredentialInput", "id", "webauthnCredentialPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnCredential', + 'updateWebauthnCredential', + 'webauthnCredential', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnCredentialInput', + 'id', + 'webauthnCredentialPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "updateWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'updateWebauthnCredential', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnCredential", "deleteWebauthnCredential", "webauthnCredential", { - id: args.where.id - }, "DeleteWebauthnCredentialInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnCredential', + 'deleteWebauthnCredential', + 'webauthnCredential', + { + id: args.where.id, + }, + 'DeleteWebauthnCredentialInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "deleteWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'deleteWebauthnCredential', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/mutation/index.ts b/sdk/constructive-cli/src/auth/orm/mutation/index.ts index fcdc27d130..ae0973c7fb 100644 --- a/sdk/constructive-cli/src/auth/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/auth/orm/mutation/index.ts @@ -3,11 +3,102 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { CheckPasswordInput, ConfirmDeleteAccountInput, CreateApiKeyInput, CreateOrgApiKeyInput, CreateOrgPrincipalInput, DeleteOrgPrincipalInput, DeletePrincipalInput, DisconnectAccountInput, ExtendTokenExpiresInput, ForgotPasswordInput, LinkIdentityInput, ProvisionBucketInput, ProvisionNewUserInput, RequestCrossOriginTokenInput, ResetPasswordInput, RevokeApiKeyInput, RevokeOrgApiKeyInput, RevokeSessionInput, SendAccountDeletionEmailInput, SendVerificationEmailInput, SetPasswordInput, SignInInput, SignInCrossOriginInput, SignInSmsOtpInput, SignOutInput, SignUpInput, SignUpSmsInput, VerifyEmailInput, VerifyPasswordInput, VerifyTotpInput, CheckPasswordPayload, ConfirmDeleteAccountPayload, CreateApiKeyPayload, CreateOrgApiKeyPayload, CreateOrgPrincipalPayload, DeleteOrgPrincipalPayload, DeletePrincipalPayload, DisconnectAccountPayload, ExtendTokenExpiresPayload, ForgotPasswordPayload, LinkIdentityPayload, ProvisionBucketPayload, ProvisionNewUserPayload, RequestCrossOriginTokenPayload, ResetPasswordPayload, RevokeApiKeyPayload, RevokeOrgApiKeyPayload, RevokeSessionPayload, SendAccountDeletionEmailPayload, SendVerificationEmailPayload, SetPasswordPayload, SignInPayload, SignInCrossOriginPayload, SignInSmsOtpPayload, SignOutPayload, SignUpPayload, SignUpSmsPayload, VerifyEmailPayload, VerifyPasswordPayload, VerifyTotpPayload, CheckPasswordPayloadSelect, ConfirmDeleteAccountPayloadSelect, CreateApiKeyPayloadSelect, CreateOrgApiKeyPayloadSelect, CreateOrgPrincipalPayloadSelect, DeleteOrgPrincipalPayloadSelect, DeletePrincipalPayloadSelect, DisconnectAccountPayloadSelect, ExtendTokenExpiresPayloadSelect, ForgotPasswordPayloadSelect, LinkIdentityPayloadSelect, ProvisionBucketPayloadSelect, ProvisionNewUserPayloadSelect, RequestCrossOriginTokenPayloadSelect, ResetPasswordPayloadSelect, RevokeApiKeyPayloadSelect, RevokeOrgApiKeyPayloadSelect, RevokeSessionPayloadSelect, SendAccountDeletionEmailPayloadSelect, SendVerificationEmailPayloadSelect, SetPasswordPayloadSelect, SignInPayloadSelect, SignInCrossOriginPayloadSelect, SignInSmsOtpPayloadSelect, SignOutPayloadSelect, SignUpPayloadSelect, SignUpSmsPayloadSelect, VerifyEmailPayloadSelect, VerifyPasswordPayloadSelect, VerifyTotpPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + CheckPasswordInput, + ConfirmDeleteAccountInput, + CreateApiKeyInput, + CreateOrgApiKeyInput, + CreateOrgPrincipalInput, + DeleteOrgPrincipalInput, + DeletePrincipalInput, + DisconnectAccountInput, + ExtendTokenExpiresInput, + ForgotPasswordInput, + LinkIdentityInput, + ProvisionBucketInput, + ProvisionNewUserInput, + RequestCrossOriginTokenInput, + ResetPasswordInput, + RevokeApiKeyInput, + RevokeOrgApiKeyInput, + RevokeSessionInput, + SendAccountDeletionEmailInput, + SendVerificationEmailInput, + SetPasswordInput, + SignInInput, + SignInCrossOriginInput, + SignInSmsOtpInput, + SignOutInput, + SignUpInput, + SignUpSmsInput, + VerifyEmailInput, + VerifyPasswordInput, + VerifyTotpInput, + CheckPasswordPayload, + ConfirmDeleteAccountPayload, + CreateApiKeyPayload, + CreateOrgApiKeyPayload, + CreateOrgPrincipalPayload, + DeleteOrgPrincipalPayload, + DeletePrincipalPayload, + DisconnectAccountPayload, + ExtendTokenExpiresPayload, + ForgotPasswordPayload, + LinkIdentityPayload, + ProvisionBucketPayload, + ProvisionNewUserPayload, + RequestCrossOriginTokenPayload, + ResetPasswordPayload, + RevokeApiKeyPayload, + RevokeOrgApiKeyPayload, + RevokeSessionPayload, + SendAccountDeletionEmailPayload, + SendVerificationEmailPayload, + SetPasswordPayload, + SignInPayload, + SignInCrossOriginPayload, + SignInSmsOtpPayload, + SignOutPayload, + SignUpPayload, + SignUpSmsPayload, + VerifyEmailPayload, + VerifyPasswordPayload, + VerifyTotpPayload, + CheckPasswordPayloadSelect, + ConfirmDeleteAccountPayloadSelect, + CreateApiKeyPayloadSelect, + CreateOrgApiKeyPayloadSelect, + CreateOrgPrincipalPayloadSelect, + DeleteOrgPrincipalPayloadSelect, + DeletePrincipalPayloadSelect, + DisconnectAccountPayloadSelect, + ExtendTokenExpiresPayloadSelect, + ForgotPasswordPayloadSelect, + LinkIdentityPayloadSelect, + ProvisionBucketPayloadSelect, + ProvisionNewUserPayloadSelect, + RequestCrossOriginTokenPayloadSelect, + ResetPasswordPayloadSelect, + RevokeApiKeyPayloadSelect, + RevokeOrgApiKeyPayloadSelect, + RevokeSessionPayloadSelect, + SendAccountDeletionEmailPayloadSelect, + SendVerificationEmailPayloadSelect, + SetPasswordPayloadSelect, + SignInPayloadSelect, + SignInCrossOriginPayloadSelect, + SignInSmsOtpPayloadSelect, + SignOutPayloadSelect, + SignUpPayloadSelect, + SignUpSmsPayloadSelect, + VerifyEmailPayloadSelect, + VerifyPasswordPayloadSelect, + VerifyTotpPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface CheckPasswordVariables { input: CheckPasswordInput; } @@ -107,425 +198,875 @@ export interface VerifyTotpVariables { } export function createMutationOperations(client: OrmClient) { return { - checkPassword: (args: CheckPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - checkPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CheckPassword", - fieldName: "checkPassword", - ...buildCustomDocument("mutation", "CheckPassword", "checkPassword", options.select, args, [{ - name: "input", - type: "CheckPasswordInput!" - }], connectionFieldsMap, "CheckPasswordPayload") - }), - confirmDeleteAccount: (args: ConfirmDeleteAccountVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - confirmDeleteAccount: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ConfirmDeleteAccount", - fieldName: "confirmDeleteAccount", - ...buildCustomDocument("mutation", "ConfirmDeleteAccount", "confirmDeleteAccount", options.select, args, [{ - name: "input", - type: "ConfirmDeleteAccountInput!" - }], connectionFieldsMap, "ConfirmDeleteAccountPayload") - }), - createApiKey: (args: CreateApiKeyVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - createApiKey: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CreateApiKey", - fieldName: "createApiKey", - ...buildCustomDocument("mutation", "CreateApiKey", "createApiKey", options.select, args, [{ - name: "input", - type: "CreateApiKeyInput!" - }], connectionFieldsMap, "CreateApiKeyPayload") - }), - 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") - }), - 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") - }), - 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") - }), - deletePrincipal: (args: DeletePrincipalVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - deletePrincipal: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "DeletePrincipal", - fieldName: "deletePrincipal", - ...buildCustomDocument("mutation", "DeletePrincipal", "deletePrincipal", options.select, args, [{ - name: "input", - type: "DeletePrincipalInput!" - }], connectionFieldsMap, "DeletePrincipalPayload") - }), - disconnectAccount: (args: DisconnectAccountVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - disconnectAccount: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "DisconnectAccount", - fieldName: "disconnectAccount", - ...buildCustomDocument("mutation", "DisconnectAccount", "disconnectAccount", options.select, args, [{ - name: "input", - type: "DisconnectAccountInput!" - }], connectionFieldsMap, "DisconnectAccountPayload") - }), - extendTokenExpires: (args: ExtendTokenExpiresVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - extendTokenExpires: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ExtendTokenExpires", - fieldName: "extendTokenExpires", - ...buildCustomDocument("mutation", "ExtendTokenExpires", "extendTokenExpires", options.select, args, [{ - name: "input", - type: "ExtendTokenExpiresInput!" - }], connectionFieldsMap, "ExtendTokenExpiresPayload") - }), - forgotPassword: (args: ForgotPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - forgotPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ForgotPassword", - fieldName: "forgotPassword", - ...buildCustomDocument("mutation", "ForgotPassword", "forgotPassword", options.select, args, [{ - name: "input", - type: "ForgotPasswordInput!" - }], connectionFieldsMap, "ForgotPasswordPayload") - }), - linkIdentity: (args: LinkIdentityVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - linkIdentity: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "LinkIdentity", - fieldName: "linkIdentity", - ...buildCustomDocument("mutation", "LinkIdentity", "linkIdentity", options.select, args, [{ - name: "input", - type: "LinkIdentityInput!" - }], connectionFieldsMap, "LinkIdentityPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - provisionNewUser: (args: ProvisionNewUserVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionNewUser: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionNewUser", - fieldName: "provisionNewUser", - ...buildCustomDocument("mutation", "ProvisionNewUser", "provisionNewUser", options.select, args, [{ - name: "input", - type: "ProvisionNewUserInput!" - }], connectionFieldsMap, "ProvisionNewUserPayload") - }), - requestCrossOriginToken: (args: RequestCrossOriginTokenVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - requestCrossOriginToken: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RequestCrossOriginToken", - fieldName: "requestCrossOriginToken", - ...buildCustomDocument("mutation", "RequestCrossOriginToken", "requestCrossOriginToken", options.select, args, [{ - name: "input", - type: "RequestCrossOriginTokenInput!" - }], connectionFieldsMap, "RequestCrossOriginTokenPayload") - }), - resetPassword: (args: ResetPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resetPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResetPassword", - fieldName: "resetPassword", - ...buildCustomDocument("mutation", "ResetPassword", "resetPassword", options.select, args, [{ - name: "input", - type: "ResetPasswordInput!" - }], connectionFieldsMap, "ResetPasswordPayload") - }), - revokeApiKey: (args: RevokeApiKeyVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - revokeApiKey: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RevokeApiKey", - fieldName: "revokeApiKey", - ...buildCustomDocument("mutation", "RevokeApiKey", "revokeApiKey", options.select, args, [{ - name: "input", - type: "RevokeApiKeyInput!" - }], connectionFieldsMap, "RevokeApiKeyPayload") - }), - 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") - }), - revokeSession: (args: RevokeSessionVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - revokeSession: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RevokeSession", - fieldName: "revokeSession", - ...buildCustomDocument("mutation", "RevokeSession", "revokeSession", options.select, args, [{ - name: "input", - type: "RevokeSessionInput!" - }], connectionFieldsMap, "RevokeSessionPayload") - }), - sendAccountDeletionEmail: (args: SendAccountDeletionEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - sendAccountDeletionEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SendAccountDeletionEmail", - fieldName: "sendAccountDeletionEmail", - ...buildCustomDocument("mutation", "SendAccountDeletionEmail", "sendAccountDeletionEmail", options.select, args, [{ - name: "input", - type: "SendAccountDeletionEmailInput!" - }], connectionFieldsMap, "SendAccountDeletionEmailPayload") - }), - sendVerificationEmail: (args: SendVerificationEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - sendVerificationEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SendVerificationEmail", - fieldName: "sendVerificationEmail", - ...buildCustomDocument("mutation", "SendVerificationEmail", "sendVerificationEmail", options.select, args, [{ - name: "input", - type: "SendVerificationEmailInput!" - }], connectionFieldsMap, "SendVerificationEmailPayload") - }), - setPassword: (args: SetPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetPassword", - fieldName: "setPassword", - ...buildCustomDocument("mutation", "SetPassword", "setPassword", options.select, args, [{ - name: "input", - type: "SetPasswordInput!" - }], connectionFieldsMap, "SetPasswordPayload") - }), - signIn: (args: SignInVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signIn: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignIn", - fieldName: "signIn", - ...buildCustomDocument("mutation", "SignIn", "signIn", options.select, args, [{ - name: "input", - type: "SignInInput!" - }], connectionFieldsMap, "SignInPayload") - }), - signInCrossOrigin: (args: SignInCrossOriginVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signInCrossOrigin: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignInCrossOrigin", - fieldName: "signInCrossOrigin", - ...buildCustomDocument("mutation", "SignInCrossOrigin", "signInCrossOrigin", options.select, args, [{ - name: "input", - type: "SignInCrossOriginInput!" - }], connectionFieldsMap, "SignInCrossOriginPayload") - }), - signInSmsOtp: (args: SignInSmsOtpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signInSmsOtp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignInSmsOtp", - fieldName: "signInSmsOtp", - ...buildCustomDocument("mutation", "SignInSmsOtp", "signInSmsOtp", options.select, args, [{ - name: "input", - type: "SignInSmsOtpInput!" - }], connectionFieldsMap, "SignInSmsOtpPayload") - }), - signOut: (args: SignOutVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signOut: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignOut", - fieldName: "signOut", - ...buildCustomDocument("mutation", "SignOut", "signOut", options.select, args, [{ - name: "input", - type: "SignOutInput!" - }], connectionFieldsMap, "SignOutPayload") - }), - signUp: (args: SignUpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signUp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignUp", - fieldName: "signUp", - ...buildCustomDocument("mutation", "SignUp", "signUp", options.select, args, [{ - name: "input", - type: "SignUpInput!" - }], connectionFieldsMap, "SignUpPayload") - }), - signUpSms: (args: SignUpSmsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signUpSms: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignUpSms", - fieldName: "signUpSms", - ...buildCustomDocument("mutation", "SignUpSms", "signUpSms", options.select, args, [{ - name: "input", - type: "SignUpSmsInput!" - }], connectionFieldsMap, "SignUpSmsPayload") - }), - verifyEmail: (args: VerifyEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyEmail", - fieldName: "verifyEmail", - ...buildCustomDocument("mutation", "VerifyEmail", "verifyEmail", options.select, args, [{ - name: "input", - type: "VerifyEmailInput!" - }], connectionFieldsMap, "VerifyEmailPayload") - }), - verifyPassword: (args: VerifyPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyPassword", - fieldName: "verifyPassword", - ...buildCustomDocument("mutation", "VerifyPassword", "verifyPassword", options.select, args, [{ - name: "input", - type: "VerifyPasswordInput!" - }], connectionFieldsMap, "VerifyPasswordPayload") - }), - verifyTotp: (args: VerifyTotpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyTotp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyTotp", - fieldName: "verifyTotp", - ...buildCustomDocument("mutation", "VerifyTotp", "verifyTotp", options.select, args, [{ - name: "input", - type: "VerifyTotpInput!" - }], connectionFieldsMap, "VerifyTotpPayload") - }) + checkPassword: ( + args: CheckPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + checkPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CheckPassword', + fieldName: 'checkPassword', + ...buildCustomDocument( + 'mutation', + 'CheckPassword', + 'checkPassword', + options.select, + args, + [ + { + name: 'input', + type: 'CheckPasswordInput!', + }, + ], + connectionFieldsMap, + 'CheckPasswordPayload' + ), + }), + confirmDeleteAccount: ( + args: ConfirmDeleteAccountVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + confirmDeleteAccount: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ConfirmDeleteAccount', + fieldName: 'confirmDeleteAccount', + ...buildCustomDocument( + 'mutation', + 'ConfirmDeleteAccount', + 'confirmDeleteAccount', + options.select, + args, + [ + { + name: 'input', + type: 'ConfirmDeleteAccountInput!', + }, + ], + connectionFieldsMap, + 'ConfirmDeleteAccountPayload' + ), + }), + createApiKey: ( + args: CreateApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateApiKey', + fieldName: 'createApiKey', + ...buildCustomDocument( + 'mutation', + 'CreateApiKey', + 'createApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'CreateApiKeyInput!', + }, + ], + connectionFieldsMap, + 'CreateApiKeyPayload' + ), + }), + 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' + ), + }), + 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' + ), + }), + 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' + ), + }), + deletePrincipal: ( + args: DeletePrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + deletePrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DeletePrincipal', + fieldName: 'deletePrincipal', + ...buildCustomDocument( + 'mutation', + 'DeletePrincipal', + 'deletePrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'DeletePrincipalInput!', + }, + ], + connectionFieldsMap, + 'DeletePrincipalPayload' + ), + }), + disconnectAccount: ( + args: DisconnectAccountVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + disconnectAccount: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DisconnectAccount', + fieldName: 'disconnectAccount', + ...buildCustomDocument( + 'mutation', + 'DisconnectAccount', + 'disconnectAccount', + options.select, + args, + [ + { + name: 'input', + type: 'DisconnectAccountInput!', + }, + ], + connectionFieldsMap, + 'DisconnectAccountPayload' + ), + }), + extendTokenExpires: ( + args: ExtendTokenExpiresVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + extendTokenExpires: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ExtendTokenExpires', + fieldName: 'extendTokenExpires', + ...buildCustomDocument( + 'mutation', + 'ExtendTokenExpires', + 'extendTokenExpires', + options.select, + args, + [ + { + name: 'input', + type: 'ExtendTokenExpiresInput!', + }, + ], + connectionFieldsMap, + 'ExtendTokenExpiresPayload' + ), + }), + forgotPassword: ( + args: ForgotPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + forgotPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ForgotPassword', + fieldName: 'forgotPassword', + ...buildCustomDocument( + 'mutation', + 'ForgotPassword', + 'forgotPassword', + options.select, + args, + [ + { + name: 'input', + type: 'ForgotPasswordInput!', + }, + ], + connectionFieldsMap, + 'ForgotPasswordPayload' + ), + }), + linkIdentity: ( + args: LinkIdentityVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + linkIdentity: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'LinkIdentity', + fieldName: 'linkIdentity', + ...buildCustomDocument( + 'mutation', + 'LinkIdentity', + 'linkIdentity', + options.select, + args, + [ + { + name: 'input', + type: 'LinkIdentityInput!', + }, + ], + connectionFieldsMap, + 'LinkIdentityPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + provisionNewUser: ( + args: ProvisionNewUserVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionNewUser: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionNewUser', + fieldName: 'provisionNewUser', + ...buildCustomDocument( + 'mutation', + 'ProvisionNewUser', + 'provisionNewUser', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionNewUserInput!', + }, + ], + connectionFieldsMap, + 'ProvisionNewUserPayload' + ), + }), + requestCrossOriginToken: ( + args: RequestCrossOriginTokenVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + requestCrossOriginToken: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RequestCrossOriginToken', + fieldName: 'requestCrossOriginToken', + ...buildCustomDocument( + 'mutation', + 'RequestCrossOriginToken', + 'requestCrossOriginToken', + options.select, + args, + [ + { + name: 'input', + type: 'RequestCrossOriginTokenInput!', + }, + ], + connectionFieldsMap, + 'RequestCrossOriginTokenPayload' + ), + }), + resetPassword: ( + args: ResetPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resetPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResetPassword', + fieldName: 'resetPassword', + ...buildCustomDocument( + 'mutation', + 'ResetPassword', + 'resetPassword', + options.select, + args, + [ + { + name: 'input', + type: 'ResetPasswordInput!', + }, + ], + connectionFieldsMap, + 'ResetPasswordPayload' + ), + }), + revokeApiKey: ( + args: RevokeApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeApiKey', + fieldName: 'revokeApiKey', + ...buildCustomDocument( + 'mutation', + 'RevokeApiKey', + 'revokeApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeApiKeyInput!', + }, + ], + connectionFieldsMap, + 'RevokeApiKeyPayload' + ), + }), + 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' + ), + }), + revokeSession: ( + args: RevokeSessionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeSession: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeSession', + fieldName: 'revokeSession', + ...buildCustomDocument( + 'mutation', + 'RevokeSession', + 'revokeSession', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeSessionInput!', + }, + ], + connectionFieldsMap, + 'RevokeSessionPayload' + ), + }), + sendAccountDeletionEmail: ( + args: SendAccountDeletionEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + sendAccountDeletionEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SendAccountDeletionEmail', + fieldName: 'sendAccountDeletionEmail', + ...buildCustomDocument( + 'mutation', + 'SendAccountDeletionEmail', + 'sendAccountDeletionEmail', + options.select, + args, + [ + { + name: 'input', + type: 'SendAccountDeletionEmailInput!', + }, + ], + connectionFieldsMap, + 'SendAccountDeletionEmailPayload' + ), + }), + sendVerificationEmail: ( + args: SendVerificationEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + sendVerificationEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SendVerificationEmail', + fieldName: 'sendVerificationEmail', + ...buildCustomDocument( + 'mutation', + 'SendVerificationEmail', + 'sendVerificationEmail', + options.select, + args, + [ + { + name: 'input', + type: 'SendVerificationEmailInput!', + }, + ], + connectionFieldsMap, + 'SendVerificationEmailPayload' + ), + }), + setPassword: ( + args: SetPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetPassword', + fieldName: 'setPassword', + ...buildCustomDocument( + 'mutation', + 'SetPassword', + 'setPassword', + options.select, + args, + [ + { + name: 'input', + type: 'SetPasswordInput!', + }, + ], + connectionFieldsMap, + 'SetPasswordPayload' + ), + }), + signIn: ( + args: SignInVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signIn: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignIn', + fieldName: 'signIn', + ...buildCustomDocument( + 'mutation', + 'SignIn', + 'signIn', + options.select, + args, + [ + { + name: 'input', + type: 'SignInInput!', + }, + ], + connectionFieldsMap, + 'SignInPayload' + ), + }), + signInCrossOrigin: ( + args: SignInCrossOriginVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signInCrossOrigin: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignInCrossOrigin', + fieldName: 'signInCrossOrigin', + ...buildCustomDocument( + 'mutation', + 'SignInCrossOrigin', + 'signInCrossOrigin', + options.select, + args, + [ + { + name: 'input', + type: 'SignInCrossOriginInput!', + }, + ], + connectionFieldsMap, + 'SignInCrossOriginPayload' + ), + }), + signInSmsOtp: ( + args: SignInSmsOtpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signInSmsOtp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignInSmsOtp', + fieldName: 'signInSmsOtp', + ...buildCustomDocument( + 'mutation', + 'SignInSmsOtp', + 'signInSmsOtp', + options.select, + args, + [ + { + name: 'input', + type: 'SignInSmsOtpInput!', + }, + ], + connectionFieldsMap, + 'SignInSmsOtpPayload' + ), + }), + signOut: ( + args: SignOutVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signOut: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignOut', + fieldName: 'signOut', + ...buildCustomDocument( + 'mutation', + 'SignOut', + 'signOut', + options.select, + args, + [ + { + name: 'input', + type: 'SignOutInput!', + }, + ], + connectionFieldsMap, + 'SignOutPayload' + ), + }), + signUp: ( + args: SignUpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signUp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignUp', + fieldName: 'signUp', + ...buildCustomDocument( + 'mutation', + 'SignUp', + 'signUp', + options.select, + args, + [ + { + name: 'input', + type: 'SignUpInput!', + }, + ], + connectionFieldsMap, + 'SignUpPayload' + ), + }), + signUpSms: ( + args: SignUpSmsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signUpSms: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignUpSms', + fieldName: 'signUpSms', + ...buildCustomDocument( + 'mutation', + 'SignUpSms', + 'signUpSms', + options.select, + args, + [ + { + name: 'input', + type: 'SignUpSmsInput!', + }, + ], + connectionFieldsMap, + 'SignUpSmsPayload' + ), + }), + verifyEmail: ( + args: VerifyEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyEmail', + fieldName: 'verifyEmail', + ...buildCustomDocument( + 'mutation', + 'VerifyEmail', + 'verifyEmail', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyEmailInput!', + }, + ], + connectionFieldsMap, + 'VerifyEmailPayload' + ), + }), + verifyPassword: ( + args: VerifyPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyPassword', + fieldName: 'verifyPassword', + ...buildCustomDocument( + 'mutation', + 'VerifyPassword', + 'verifyPassword', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyPasswordInput!', + }, + ], + connectionFieldsMap, + 'VerifyPasswordPayload' + ), + }), + verifyTotp: ( + args: VerifyTotpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyTotp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyTotp', + fieldName: 'verifyTotp', + ...buildCustomDocument( + 'mutation', + 'VerifyTotp', + 'verifyTotp', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyTotpInput!', + }, + ], + connectionFieldsMap, + 'VerifyTotpPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/query-builder.ts b/sdk/constructive-cli/src/auth/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/auth/orm/query-builder.ts +++ b/sdk/constructive-cli/src/auth/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/auth/orm/query/index.ts b/sdk/constructive-cli/src/auth/orm/query/index.ts index 5a555d9687..d13999f7b4 100644 --- a/sdk/constructive-cli/src/auth/orm/query/index.ts +++ b/sdk/constructive-cli/src/auth/orm/query/index.ts @@ -3,73 +3,124 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { User, UserSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { User, UserSelect } from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface RequireStepUpVariables { stepUpType?: string; } export function createQueryOperations(client: OrmClient) { return { - currentIpAddress: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentIpAddress: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentIpAddress", - fieldName: "currentIpAddress", - ...buildCustomDocument("query", "CurrentIpAddress", "currentIpAddress", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - currentUser: (options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - currentUser: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "CurrentUser", - fieldName: "currentUser", - ...buildCustomDocument("query", "CurrentUser", "currentUser", options.select, undefined, [], connectionFieldsMap, "User") - }), - currentUserAgent: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentUserAgent: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentUserAgent", - fieldName: "currentUserAgent", - ...buildCustomDocument("query", "CurrentUserAgent", "currentUserAgent", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - currentUserId: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentUserId: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentUserId", - fieldName: "currentUserId", - ...buildCustomDocument("query", "CurrentUserId", "currentUserId", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - requireStepUp: (args: RequireStepUpVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - requireStepUp: boolean | null; - }>({ - client, - operation: "query", - operationName: "RequireStepUp", - fieldName: "requireStepUp", - ...buildCustomDocument("query", "RequireStepUp", "requireStepUp", options?.select, args, [{ - name: "stepUpType", - type: "String" - }], connectionFieldsMap, undefined) - }) + currentIpAddress: (options?: { select?: Record }) => + new QueryBuilder<{ + currentIpAddress: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentIpAddress', + fieldName: 'currentIpAddress', + ...buildCustomDocument( + 'query', + 'CurrentIpAddress', + 'currentIpAddress', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + currentUser: ( + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + currentUser: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUser', + fieldName: 'currentUser', + ...buildCustomDocument( + 'query', + 'CurrentUser', + 'currentUser', + options.select, + undefined, + [], + connectionFieldsMap, + 'User' + ), + }), + currentUserAgent: (options?: { select?: Record }) => + new QueryBuilder<{ + currentUserAgent: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUserAgent', + fieldName: 'currentUserAgent', + ...buildCustomDocument( + 'query', + 'CurrentUserAgent', + 'currentUserAgent', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + currentUserId: (options?: { select?: Record }) => + new QueryBuilder<{ + currentUserId: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUserId', + fieldName: 'currentUserId', + ...buildCustomDocument( + 'query', + 'CurrentUserId', + 'currentUserId', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + requireStepUp: ( + args: RequireStepUpVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + requireStepUp: boolean | null; + }>({ + client, + operation: 'query', + operationName: 'RequireStepUp', + fieldName: 'requireStepUp', + ...buildCustomDocument( + 'query', + 'RequireStepUp', + 'requireStepUp', + options?.select, + args, + [ + { + name: 'stepUpType', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/auth/orm/realtime.ts b/sdk/constructive-cli/src/auth/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/auth/orm/realtime.ts +++ b/sdk/constructive-cli/src/auth/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/auth/orm/select-types.ts b/sdk/constructive-cli/src/auth/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/auth/orm/select-types.ts +++ b/sdk/constructive-cli/src/auth/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/compute/cli/commands.ts b/sdk/constructive-cli/src/compute/cli/commands.ts index 01128a7379..4839d1a184 100644 --- a/sdk/constructive-cli/src/compute/cli/commands.ts +++ b/sdk/constructive-cli/src/compute/cli/commands.ts @@ -3,223 +3,234 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import dbPresetCmd from "./commands/db-preset"; -import functionApiBindingCmd from "./commands/function-api-binding"; -import functionDefinitionCmd from "./commands/function-definition"; -import functionDeploymentCmd from "./commands/function-deployment"; -import functionDeploymentEventCmd from "./commands/function-deployment-event"; -import functionExecutionLogCmd from "./commands/function-execution-log"; -import functionGraphCommitCmd from "./commands/function-graph-commit"; -import functionGraphCmd from "./commands/function-graph"; -import functionGraphExecutionCmd from "./commands/function-graph-execution"; -import functionGraphExecutionNodeStateCmd from "./commands/function-graph-execution-node-state"; -import functionGraphExecutionOutputCmd from "./commands/function-graph-execution-output"; -import functionGraphObjectCmd from "./commands/function-graph-object"; -import functionGraphRefCmd from "./commands/function-graph-ref"; -import functionGraphStoreCmd from "./commands/function-graph-store"; -import functionInvocationAttemptCmd from "./commands/function-invocation-attempt"; -import functionInvocationCmd from "./commands/function-invocation"; -import getAllTreeNodesRecordCmd from "./commands/get-all-tree-nodes-record"; -import infraCommitCmd from "./commands/infra-commit"; -import infraGetAllTreeNodesRecordCmd from "./commands/infra-get-all-tree-nodes-record"; -import infraObjectCmd from "./commands/infra-object"; -import infraRefCmd from "./commands/infra-ref"; -import infraStoreCmd from "./commands/infra-store"; -import integrationProviderCmd from "./commands/integration-provider"; -import namespaceCmd from "./commands/namespace"; -import namespaceEventCmd from "./commands/namespace-event"; -import platformFunctionApiBindingCmd from "./commands/platform-function-api-binding"; -import platformFunctionDefinitionCmd from "./commands/platform-function-definition"; -import platformFunctionDeploymentCmd from "./commands/platform-function-deployment"; -import platformFunctionDeploymentEventCmd from "./commands/platform-function-deployment-event"; -import platformFunctionExecutionLogCmd from "./commands/platform-function-execution-log"; -import platformFunctionInvocationAttemptCmd from "./commands/platform-function-invocation-attempt"; -import platformFunctionInvocationCmd from "./commands/platform-function-invocation"; -import platformInfraCommitCmd from "./commands/platform-infra-commit"; -import platformInfraGetAllTreeNodesRecordCmd from "./commands/platform-infra-get-all-tree-nodes-record"; -import platformInfraObjectCmd from "./commands/platform-infra-object"; -import platformInfraRefCmd from "./commands/platform-infra-ref"; -import platformInfraStoreCmd from "./commands/platform-infra-store"; -import platformNamespaceCmd from "./commands/platform-namespace"; -import platformNamespaceEventCmd from "./commands/platform-namespace-event"; -import platformResourceCmd from "./commands/platform-resource"; -import platformResourceDeclaredCapacityCmd from "./commands/platform-resource-declared-capacity"; -import platformResourceDefinitionCmd from "./commands/platform-resource-definition"; -import platformResourceEventCmd from "./commands/platform-resource-event"; -import platformResourceInstallationCmd from "./commands/platform-resource-installation"; -import platformResourceStatusCheckCmd from "./commands/platform-resource-status-check"; -import platformResourceUsageLogCmd from "./commands/platform-resource-usage-log"; -import platformResourceUsageSummaryCmd from "./commands/platform-resource-usage-summary"; -import platformResourceUtilizationCmd from "./commands/platform-resource-utilization"; -import platformResourcesHealthCmd from "./commands/platform-resources-health"; -import platformResourcesRequirementsStateCmd from "./commands/platform-resources-requirements-state"; -import platformResourcesResolvedRequirementCmd from "./commands/platform-resources-resolved-requirement"; -import platformWebhookEndpointCmd from "./commands/platform-webhook-endpoint"; -import platformWebhookEventCmd from "./commands/platform-webhook-event"; -import resourceCmd from "./commands/resource"; -import resourceDeclaredCapacityCmd from "./commands/resource-declared-capacity"; -import resourceDefinitionCmd from "./commands/resource-definition"; -import resourceEventCmd from "./commands/resource-event"; -import resourceInstallationCmd from "./commands/resource-installation"; -import resourceStatusCheckCmd from "./commands/resource-status-check"; -import resourceUsageLogCmd from "./commands/resource-usage-log"; -import resourceUsageSummaryCmd from "./commands/resource-usage-summary"; -import resourceUtilizationCmd from "./commands/resource-utilization"; -import resourcesHealthCmd from "./commands/resources-health"; -import resourcesRequirementsStateCmd from "./commands/resources-requirements-state"; -import resourcesResolvedRequirementCmd from "./commands/resources-resolved-requirement"; -import webhookEndpointCmd from "./commands/webhook-endpoint"; -import webhookEventCmd from "./commands/webhook-event"; -import readFunctionGraphCmd from "./commands/read-function-graph"; -import addEdgeCmd from "./commands/add-edge"; -import addEdgeAndSaveCmd from "./commands/add-edge-and-save"; -import addNodeCmd from "./commands/add-node"; -import addNodeAndSaveCmd from "./commands/add-node-and-save"; -import copyGraphCmd from "./commands/copy-graph"; -import importDefinitionsCmd from "./commands/import-definitions"; -import importGraphJsonCmd from "./commands/import-graph-json"; -import infraInitEmptyRepoCmd from "./commands/infra-init-empty-repo"; -import infraInsertNodeAtPathCmd from "./commands/infra-insert-node-at-path"; -import infraSetDataAtPathCmd from "./commands/infra-set-data-at-path"; -import initEmptyRepoCmd from "./commands/init-empty-repo"; -import insertNodeAtPathCmd from "./commands/insert-node-at-path"; -import platformInfraInitEmptyRepoCmd from "./commands/platform-infra-init-empty-repo"; -import platformInfraInsertNodeAtPathCmd from "./commands/platform-infra-insert-node-at-path"; -import platformInfraSetDataAtPathCmd from "./commands/platform-infra-set-data-at-path"; -import platformResourceInstallationsInstallCmd from "./commands/platform-resource-installations-install"; -import platformResourceInstallationsRollbackCmd from "./commands/platform-resource-installations-rollback"; -import platformResourceInstallationsUninstallCmd from "./commands/platform-resource-installations-uninstall"; -import platformResourceInstallationsUpgradeCmd from "./commands/platform-resource-installations-upgrade"; -import provisionBucketCmd from "./commands/provision-bucket"; -import resourceInstallationsInstallCmd from "./commands/resource-installations-install"; -import resourceInstallationsRollbackCmd from "./commands/resource-installations-rollback"; -import resourceInstallationsUninstallCmd from "./commands/resource-installations-uninstall"; -import resourceInstallationsUpgradeCmd from "./commands/resource-installations-upgrade"; -import saveGraphCmd from "./commands/save-graph"; -import setDataAtPathCmd from "./commands/set-data-at-path"; -import startExecutionCmd from "./commands/start-execution"; -import validateFunctionGraphCmd from "./commands/validate-function-graph"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "db-preset": dbPresetCmd, - "function-api-binding": functionApiBindingCmd, - "function-definition": functionDefinitionCmd, - "function-deployment": functionDeploymentCmd, - "function-deployment-event": functionDeploymentEventCmd, - "function-execution-log": functionExecutionLogCmd, - "function-graph-commit": functionGraphCommitCmd, - "function-graph": functionGraphCmd, - "function-graph-execution": functionGraphExecutionCmd, - "function-graph-execution-node-state": functionGraphExecutionNodeStateCmd, - "function-graph-execution-output": functionGraphExecutionOutputCmd, - "function-graph-object": functionGraphObjectCmd, - "function-graph-ref": functionGraphRefCmd, - "function-graph-store": functionGraphStoreCmd, - "function-invocation-attempt": functionInvocationAttemptCmd, - "function-invocation": functionInvocationCmd, - "get-all-tree-nodes-record": getAllTreeNodesRecordCmd, - "infra-commit": infraCommitCmd, - "infra-get-all-tree-nodes-record": infraGetAllTreeNodesRecordCmd, - "infra-object": infraObjectCmd, - "infra-ref": infraRefCmd, - "infra-store": infraStoreCmd, - "integration-provider": integrationProviderCmd, - "namespace": namespaceCmd, - "namespace-event": namespaceEventCmd, - "platform-function-api-binding": platformFunctionApiBindingCmd, - "platform-function-definition": platformFunctionDefinitionCmd, - "platform-function-deployment": platformFunctionDeploymentCmd, - "platform-function-deployment-event": platformFunctionDeploymentEventCmd, - "platform-function-execution-log": platformFunctionExecutionLogCmd, - "platform-function-invocation-attempt": platformFunctionInvocationAttemptCmd, - "platform-function-invocation": platformFunctionInvocationCmd, - "platform-infra-commit": platformInfraCommitCmd, - "platform-infra-get-all-tree-nodes-record": platformInfraGetAllTreeNodesRecordCmd, - "platform-infra-object": platformInfraObjectCmd, - "platform-infra-ref": platformInfraRefCmd, - "platform-infra-store": platformInfraStoreCmd, - "platform-namespace": platformNamespaceCmd, - "platform-namespace-event": platformNamespaceEventCmd, - "platform-resource": platformResourceCmd, - "platform-resource-declared-capacity": platformResourceDeclaredCapacityCmd, - "platform-resource-definition": platformResourceDefinitionCmd, - "platform-resource-event": platformResourceEventCmd, - "platform-resource-installation": platformResourceInstallationCmd, - "platform-resource-status-check": platformResourceStatusCheckCmd, - "platform-resource-usage-log": platformResourceUsageLogCmd, - "platform-resource-usage-summary": platformResourceUsageSummaryCmd, - "platform-resource-utilization": platformResourceUtilizationCmd, - "platform-resources-health": platformResourcesHealthCmd, - "platform-resources-requirements-state": platformResourcesRequirementsStateCmd, - "platform-resources-resolved-requirement": platformResourcesResolvedRequirementCmd, - "platform-webhook-endpoint": platformWebhookEndpointCmd, - "platform-webhook-event": platformWebhookEventCmd, - "resource": resourceCmd, - "resource-declared-capacity": resourceDeclaredCapacityCmd, - "resource-definition": resourceDefinitionCmd, - "resource-event": resourceEventCmd, - "resource-installation": resourceInstallationCmd, - "resource-status-check": resourceStatusCheckCmd, - "resource-usage-log": resourceUsageLogCmd, - "resource-usage-summary": resourceUsageSummaryCmd, - "resource-utilization": resourceUtilizationCmd, - "resources-health": resourcesHealthCmd, - "resources-requirements-state": resourcesRequirementsStateCmd, - "resources-resolved-requirement": resourcesResolvedRequirementCmd, - "webhook-endpoint": webhookEndpointCmd, - "webhook-event": webhookEventCmd, - "read-function-graph": readFunctionGraphCmd, - "add-edge": addEdgeCmd, - "add-edge-and-save": addEdgeAndSaveCmd, - "add-node": addNodeCmd, - "add-node-and-save": addNodeAndSaveCmd, - "copy-graph": copyGraphCmd, - "import-definitions": importDefinitionsCmd, - "import-graph-json": importGraphJsonCmd, - "infra-init-empty-repo": infraInitEmptyRepoCmd, - "infra-insert-node-at-path": infraInsertNodeAtPathCmd, - "infra-set-data-at-path": infraSetDataAtPathCmd, - "init-empty-repo": initEmptyRepoCmd, - "insert-node-at-path": insertNodeAtPathCmd, - "platform-infra-init-empty-repo": platformInfraInitEmptyRepoCmd, - "platform-infra-insert-node-at-path": platformInfraInsertNodeAtPathCmd, - "platform-infra-set-data-at-path": platformInfraSetDataAtPathCmd, - "platform-resource-installations-install": platformResourceInstallationsInstallCmd, - "platform-resource-installations-rollback": platformResourceInstallationsRollbackCmd, - "platform-resource-installations-uninstall": platformResourceInstallationsUninstallCmd, - "platform-resource-installations-upgrade": platformResourceInstallationsUpgradeCmd, - "provision-bucket": provisionBucketCmd, - "resource-installations-install": resourceInstallationsInstallCmd, - "resource-installations-rollback": resourceInstallationsRollbackCmd, - "resource-installations-uninstall": resourceInstallationsUninstallCmd, - "resource-installations-upgrade": resourceInstallationsUpgradeCmd, - "save-graph": saveGraphCmd, - "set-data-at-path": setDataAtPathCmd, - "start-execution": startExecutionCmd, - "validate-function-graph": validateFunctionGraphCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import dbPresetCmd from './commands/db-preset'; +import functionApiBindingCmd from './commands/function-api-binding'; +import functionDefinitionCmd from './commands/function-definition'; +import functionDeploymentCmd from './commands/function-deployment'; +import functionDeploymentEventCmd from './commands/function-deployment-event'; +import functionExecutionLogCmd from './commands/function-execution-log'; +import functionGraphCommitCmd from './commands/function-graph-commit'; +import functionGraphCmd from './commands/function-graph'; +import functionGraphExecutionCmd from './commands/function-graph-execution'; +import functionGraphExecutionNodeStateCmd from './commands/function-graph-execution-node-state'; +import functionGraphExecutionOutputCmd from './commands/function-graph-execution-output'; +import functionGraphObjectCmd from './commands/function-graph-object'; +import functionGraphRefCmd from './commands/function-graph-ref'; +import functionGraphStoreCmd from './commands/function-graph-store'; +import functionInvocationAttemptCmd from './commands/function-invocation-attempt'; +import functionInvocationCmd from './commands/function-invocation'; +import getAllTreeNodesRecordCmd from './commands/get-all-tree-nodes-record'; +import infraCommitCmd from './commands/infra-commit'; +import infraGetAllTreeNodesRecordCmd from './commands/infra-get-all-tree-nodes-record'; +import infraObjectCmd from './commands/infra-object'; +import infraRefCmd from './commands/infra-ref'; +import infraStoreCmd from './commands/infra-store'; +import integrationProviderCmd from './commands/integration-provider'; +import namespaceCmd from './commands/namespace'; +import namespaceEventCmd from './commands/namespace-event'; +import platformFunctionApiBindingCmd from './commands/platform-function-api-binding'; +import platformFunctionDefinitionCmd from './commands/platform-function-definition'; +import platformFunctionDeploymentCmd from './commands/platform-function-deployment'; +import platformFunctionDeploymentEventCmd from './commands/platform-function-deployment-event'; +import platformFunctionExecutionLogCmd from './commands/platform-function-execution-log'; +import platformFunctionInvocationAttemptCmd from './commands/platform-function-invocation-attempt'; +import platformFunctionInvocationCmd from './commands/platform-function-invocation'; +import platformInfraCommitCmd from './commands/platform-infra-commit'; +import platformInfraGetAllTreeNodesRecordCmd from './commands/platform-infra-get-all-tree-nodes-record'; +import platformInfraObjectCmd from './commands/platform-infra-object'; +import platformInfraRefCmd from './commands/platform-infra-ref'; +import platformInfraStoreCmd from './commands/platform-infra-store'; +import platformNamespaceCmd from './commands/platform-namespace'; +import platformNamespaceEventCmd from './commands/platform-namespace-event'; +import platformResourceCmd from './commands/platform-resource'; +import platformResourceDeclaredCapacityCmd from './commands/platform-resource-declared-capacity'; +import platformResourceDefinitionCmd from './commands/platform-resource-definition'; +import platformResourceEventCmd from './commands/platform-resource-event'; +import platformResourceInstallationCmd from './commands/platform-resource-installation'; +import platformResourceStatusCheckCmd from './commands/platform-resource-status-check'; +import platformResourceUsageLogCmd from './commands/platform-resource-usage-log'; +import platformResourceUsageSummaryCmd from './commands/platform-resource-usage-summary'; +import platformResourceUtilizationCmd from './commands/platform-resource-utilization'; +import platformResourcesHealthCmd from './commands/platform-resources-health'; +import platformResourcesRequirementsStateCmd from './commands/platform-resources-requirements-state'; +import platformResourcesResolvedRequirementCmd from './commands/platform-resources-resolved-requirement'; +import platformWebhookEndpointCmd from './commands/platform-webhook-endpoint'; +import platformWebhookEventCmd from './commands/platform-webhook-event'; +import resourceCmd from './commands/resource'; +import resourceDeclaredCapacityCmd from './commands/resource-declared-capacity'; +import resourceDefinitionCmd from './commands/resource-definition'; +import resourceEventCmd from './commands/resource-event'; +import resourceInstallationCmd from './commands/resource-installation'; +import resourceStatusCheckCmd from './commands/resource-status-check'; +import resourceUsageLogCmd from './commands/resource-usage-log'; +import resourceUsageSummaryCmd from './commands/resource-usage-summary'; +import resourceUtilizationCmd from './commands/resource-utilization'; +import resourcesHealthCmd from './commands/resources-health'; +import resourcesRequirementsStateCmd from './commands/resources-requirements-state'; +import resourcesResolvedRequirementCmd from './commands/resources-resolved-requirement'; +import webhookEndpointCmd from './commands/webhook-endpoint'; +import webhookEventCmd from './commands/webhook-event'; +import readFunctionGraphCmd from './commands/read-function-graph'; +import addEdgeCmd from './commands/add-edge'; +import addEdgeAndSaveCmd from './commands/add-edge-and-save'; +import addNodeCmd from './commands/add-node'; +import addNodeAndSaveCmd from './commands/add-node-and-save'; +import copyGraphCmd from './commands/copy-graph'; +import importDefinitionsCmd from './commands/import-definitions'; +import importGraphJsonCmd from './commands/import-graph-json'; +import infraInitEmptyRepoCmd from './commands/infra-init-empty-repo'; +import infraInsertNodeAtPathCmd from './commands/infra-insert-node-at-path'; +import infraSetDataAtPathCmd from './commands/infra-set-data-at-path'; +import initEmptyRepoCmd from './commands/init-empty-repo'; +import insertNodeAtPathCmd from './commands/insert-node-at-path'; +import platformInfraInitEmptyRepoCmd from './commands/platform-infra-init-empty-repo'; +import platformInfraInsertNodeAtPathCmd from './commands/platform-infra-insert-node-at-path'; +import platformInfraSetDataAtPathCmd from './commands/platform-infra-set-data-at-path'; +import platformResourceInstallationsInstallCmd from './commands/platform-resource-installations-install'; +import platformResourceInstallationsRollbackCmd from './commands/platform-resource-installations-rollback'; +import platformResourceInstallationsUninstallCmd from './commands/platform-resource-installations-uninstall'; +import platformResourceInstallationsUpgradeCmd from './commands/platform-resource-installations-upgrade'; +import provisionBucketCmd from './commands/provision-bucket'; +import resourceInstallationsInstallCmd from './commands/resource-installations-install'; +import resourceInstallationsRollbackCmd from './commands/resource-installations-rollback'; +import resourceInstallationsUninstallCmd from './commands/resource-installations-uninstall'; +import resourceInstallationsUpgradeCmd from './commands/resource-installations-upgrade'; +import saveGraphCmd from './commands/save-graph'; +import setDataAtPathCmd from './commands/set-data-at-path'; +import startExecutionCmd from './commands/start-execution'; +import validateFunctionGraphCmd from './commands/validate-function-graph'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + 'db-preset': dbPresetCmd, + 'function-api-binding': functionApiBindingCmd, + 'function-definition': functionDefinitionCmd, + 'function-deployment': functionDeploymentCmd, + 'function-deployment-event': functionDeploymentEventCmd, + 'function-execution-log': functionExecutionLogCmd, + 'function-graph-commit': functionGraphCommitCmd, + 'function-graph': functionGraphCmd, + 'function-graph-execution': functionGraphExecutionCmd, + 'function-graph-execution-node-state': functionGraphExecutionNodeStateCmd, + 'function-graph-execution-output': functionGraphExecutionOutputCmd, + 'function-graph-object': functionGraphObjectCmd, + 'function-graph-ref': functionGraphRefCmd, + 'function-graph-store': functionGraphStoreCmd, + 'function-invocation-attempt': functionInvocationAttemptCmd, + 'function-invocation': functionInvocationCmd, + 'get-all-tree-nodes-record': getAllTreeNodesRecordCmd, + 'infra-commit': infraCommitCmd, + 'infra-get-all-tree-nodes-record': infraGetAllTreeNodesRecordCmd, + 'infra-object': infraObjectCmd, + 'infra-ref': infraRefCmd, + 'infra-store': infraStoreCmd, + 'integration-provider': integrationProviderCmd, + namespace: namespaceCmd, + 'namespace-event': namespaceEventCmd, + 'platform-function-api-binding': platformFunctionApiBindingCmd, + 'platform-function-definition': platformFunctionDefinitionCmd, + 'platform-function-deployment': platformFunctionDeploymentCmd, + 'platform-function-deployment-event': platformFunctionDeploymentEventCmd, + 'platform-function-execution-log': platformFunctionExecutionLogCmd, + 'platform-function-invocation-attempt': platformFunctionInvocationAttemptCmd, + 'platform-function-invocation': platformFunctionInvocationCmd, + 'platform-infra-commit': platformInfraCommitCmd, + 'platform-infra-get-all-tree-nodes-record': platformInfraGetAllTreeNodesRecordCmd, + 'platform-infra-object': platformInfraObjectCmd, + 'platform-infra-ref': platformInfraRefCmd, + 'platform-infra-store': platformInfraStoreCmd, + 'platform-namespace': platformNamespaceCmd, + 'platform-namespace-event': platformNamespaceEventCmd, + 'platform-resource': platformResourceCmd, + 'platform-resource-declared-capacity': platformResourceDeclaredCapacityCmd, + 'platform-resource-definition': platformResourceDefinitionCmd, + 'platform-resource-event': platformResourceEventCmd, + 'platform-resource-installation': platformResourceInstallationCmd, + 'platform-resource-status-check': platformResourceStatusCheckCmd, + 'platform-resource-usage-log': platformResourceUsageLogCmd, + 'platform-resource-usage-summary': platformResourceUsageSummaryCmd, + 'platform-resource-utilization': platformResourceUtilizationCmd, + 'platform-resources-health': platformResourcesHealthCmd, + 'platform-resources-requirements-state': platformResourcesRequirementsStateCmd, + 'platform-resources-resolved-requirement': platformResourcesResolvedRequirementCmd, + 'platform-webhook-endpoint': platformWebhookEndpointCmd, + 'platform-webhook-event': platformWebhookEventCmd, + resource: resourceCmd, + 'resource-declared-capacity': resourceDeclaredCapacityCmd, + 'resource-definition': resourceDefinitionCmd, + 'resource-event': resourceEventCmd, + 'resource-installation': resourceInstallationCmd, + 'resource-status-check': resourceStatusCheckCmd, + 'resource-usage-log': resourceUsageLogCmd, + 'resource-usage-summary': resourceUsageSummaryCmd, + 'resource-utilization': resourceUtilizationCmd, + 'resources-health': resourcesHealthCmd, + 'resources-requirements-state': resourcesRequirementsStateCmd, + 'resources-resolved-requirement': resourcesResolvedRequirementCmd, + 'webhook-endpoint': webhookEndpointCmd, + 'webhook-event': webhookEventCmd, + 'read-function-graph': readFunctionGraphCmd, + 'add-edge': addEdgeCmd, + 'add-edge-and-save': addEdgeAndSaveCmd, + 'add-node': addNodeCmd, + 'add-node-and-save': addNodeAndSaveCmd, + 'copy-graph': copyGraphCmd, + 'import-definitions': importDefinitionsCmd, + 'import-graph-json': importGraphJsonCmd, + 'infra-init-empty-repo': infraInitEmptyRepoCmd, + 'infra-insert-node-at-path': infraInsertNodeAtPathCmd, + 'infra-set-data-at-path': infraSetDataAtPathCmd, + 'init-empty-repo': initEmptyRepoCmd, + 'insert-node-at-path': insertNodeAtPathCmd, + 'platform-infra-init-empty-repo': platformInfraInitEmptyRepoCmd, + 'platform-infra-insert-node-at-path': platformInfraInsertNodeAtPathCmd, + 'platform-infra-set-data-at-path': platformInfraSetDataAtPathCmd, + 'platform-resource-installations-install': platformResourceInstallationsInstallCmd, + 'platform-resource-installations-rollback': platformResourceInstallationsRollbackCmd, + 'platform-resource-installations-uninstall': platformResourceInstallationsUninstallCmd, + 'platform-resource-installations-upgrade': platformResourceInstallationsUpgradeCmd, + 'provision-bucket': provisionBucketCmd, + 'resource-installations-install': resourceInstallationsInstallCmd, + 'resource-installations-rollback': resourceInstallationsRollbackCmd, + 'resource-installations-uninstall': resourceInstallationsUninstallCmd, + 'resource-installations-upgrade': resourceInstallationsUpgradeCmd, + 'save-graph': saveGraphCmd, + 'set-data-at-path': setDataAtPathCmd, + 'start-execution': startExecutionCmd, + 'validate-function-graph': validateFunctionGraphCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n db-preset dbPreset CRUD operations\n function-api-binding functionApiBinding CRUD operations\n function-definition functionDefinition CRUD operations\n function-deployment functionDeployment CRUD operations\n function-deployment-event functionDeploymentEvent CRUD operations\n function-execution-log functionExecutionLog CRUD operations\n function-graph-commit functionGraphCommit CRUD operations\n function-graph functionGraph CRUD operations\n function-graph-execution functionGraphExecution CRUD operations\n function-graph-execution-node-state functionGraphExecutionNodeState CRUD operations\n function-graph-execution-output functionGraphExecutionOutput CRUD operations\n function-graph-object functionGraphObject CRUD operations\n function-graph-ref functionGraphRef CRUD operations\n function-graph-store functionGraphStore CRUD operations\n function-invocation-attempt functionInvocationAttempt CRUD operations\n function-invocation functionInvocation CRUD operations\n get-all-tree-nodes-record getAllTreeNodesRecord CRUD operations\n infra-commit infraCommit CRUD operations\n infra-get-all-tree-nodes-record infraGetAllTreeNodesRecord CRUD operations\n infra-object infraObject CRUD operations\n infra-ref infraRef CRUD operations\n infra-store infraStore CRUD operations\n integration-provider integrationProvider CRUD operations\n namespace namespace CRUD operations\n namespace-event namespaceEvent CRUD operations\n platform-function-api-binding platformFunctionApiBinding CRUD operations\n platform-function-definition platformFunctionDefinition CRUD operations\n platform-function-deployment platformFunctionDeployment CRUD operations\n platform-function-deployment-event platformFunctionDeploymentEvent CRUD operations\n platform-function-execution-log platformFunctionExecutionLog CRUD operations\n platform-function-invocation-attempt platformFunctionInvocationAttempt CRUD operations\n platform-function-invocation platformFunctionInvocation CRUD operations\n platform-infra-commit platformInfraCommit CRUD operations\n platform-infra-get-all-tree-nodes-record platformInfraGetAllTreeNodesRecord CRUD operations\n platform-infra-object platformInfraObject CRUD operations\n platform-infra-ref platformInfraRef CRUD operations\n platform-infra-store platformInfraStore CRUD operations\n platform-namespace platformNamespace CRUD operations\n platform-namespace-event platformNamespaceEvent CRUD operations\n platform-resource platformResource CRUD operations\n platform-resource-declared-capacity platformResourceDeclaredCapacity CRUD operations\n platform-resource-definition platformResourceDefinition CRUD operations\n platform-resource-event platformResourceEvent CRUD operations\n platform-resource-installation platformResourceInstallation CRUD operations\n platform-resource-status-check platformResourceStatusCheck CRUD operations\n platform-resource-usage-log platformResourceUsageLog CRUD operations\n platform-resource-usage-summary platformResourceUsageSummary CRUD operations\n platform-resource-utilization platformResourceUtilization CRUD operations\n platform-resources-health platformResourcesHealth CRUD operations\n platform-resources-requirements-state platformResourcesRequirementsState CRUD operations\n platform-resources-resolved-requirement platformResourcesResolvedRequirement CRUD operations\n platform-webhook-endpoint platformWebhookEndpoint CRUD operations\n platform-webhook-event platformWebhookEvent CRUD operations\n resource resource CRUD operations\n resource-declared-capacity resourceDeclaredCapacity CRUD operations\n resource-definition resourceDefinition CRUD operations\n resource-event resourceEvent CRUD operations\n resource-installation resourceInstallation CRUD operations\n resource-status-check resourceStatusCheck CRUD operations\n resource-usage-log resourceUsageLog CRUD operations\n resource-usage-summary resourceUsageSummary CRUD operations\n resource-utilization resourceUtilization CRUD operations\n resources-health resourcesHealth CRUD operations\n resources-requirements-state resourcesRequirementsState CRUD operations\n resources-resolved-requirement resourcesResolvedRequirement CRUD operations\n webhook-endpoint webhookEndpoint CRUD operations\n webhook-event webhookEvent CRUD operations\n read-function-graph readFunctionGraph\n add-edge addEdge\n add-edge-and-save addEdgeAndSave\n add-node addNode\n add-node-and-save addNodeAndSave\n copy-graph copyGraph\n import-definitions importDefinitions\n import-graph-json importGraphJson\n infra-init-empty-repo infraInitEmptyRepo\n infra-insert-node-at-path infraInsertNodeAtPath\n infra-set-data-at-path infraSetDataAtPath\n init-empty-repo initEmptyRepo\n insert-node-at-path insertNodeAtPath\n platform-infra-init-empty-repo platformInfraInitEmptyRepo\n platform-infra-insert-node-at-path platformInfraInsertNodeAtPath\n platform-infra-set-data-at-path platformInfraSetDataAtPath\n platform-resource-installations-install platformResourceInstallationsInstall\n platform-resource-installations-rollback platformResourceInstallationsRollback\n platform-resource-installations-uninstall platformResourceInstallationsUninstall\n platform-resource-installations-upgrade platformResourceInstallationsUpgrade\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 resource-installations-install resourceInstallationsInstall\n resource-installations-rollback resourceInstallationsRollback\n resource-installations-uninstall resourceInstallationsUninstall\n resource-installations-upgrade resourceInstallationsUpgrade\n save-graph saveGraph\n set-data-at-path setDataAtPath\n start-execution startExecution\n validate-function-graph validateFunctionGraph\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n db-preset dbPreset CRUD operations\n function-api-binding functionApiBinding CRUD operations\n function-definition functionDefinition CRUD operations\n function-deployment functionDeployment CRUD operations\n function-deployment-event functionDeploymentEvent CRUD operations\n function-execution-log functionExecutionLog CRUD operations\n function-graph-commit functionGraphCommit CRUD operations\n function-graph functionGraph CRUD operations\n function-graph-execution functionGraphExecution CRUD operations\n function-graph-execution-node-state functionGraphExecutionNodeState CRUD operations\n function-graph-execution-output functionGraphExecutionOutput CRUD operations\n function-graph-object functionGraphObject CRUD operations\n function-graph-ref functionGraphRef CRUD operations\n function-graph-store functionGraphStore CRUD operations\n function-invocation-attempt functionInvocationAttempt CRUD operations\n function-invocation functionInvocation CRUD operations\n get-all-tree-nodes-record getAllTreeNodesRecord CRUD operations\n infra-commit infraCommit CRUD operations\n infra-get-all-tree-nodes-record infraGetAllTreeNodesRecord CRUD operations\n infra-object infraObject CRUD operations\n infra-ref infraRef CRUD operations\n infra-store infraStore CRUD operations\n integration-provider integrationProvider CRUD operations\n namespace namespace CRUD operations\n namespace-event namespaceEvent CRUD operations\n platform-function-api-binding platformFunctionApiBinding CRUD operations\n platform-function-definition platformFunctionDefinition CRUD operations\n platform-function-deployment platformFunctionDeployment CRUD operations\n platform-function-deployment-event platformFunctionDeploymentEvent CRUD operations\n platform-function-execution-log platformFunctionExecutionLog CRUD operations\n platform-function-invocation-attempt platformFunctionInvocationAttempt CRUD operations\n platform-function-invocation platformFunctionInvocation CRUD operations\n platform-infra-commit platformInfraCommit CRUD operations\n platform-infra-get-all-tree-nodes-record platformInfraGetAllTreeNodesRecord CRUD operations\n platform-infra-object platformInfraObject CRUD operations\n platform-infra-ref platformInfraRef CRUD operations\n platform-infra-store platformInfraStore CRUD operations\n platform-namespace platformNamespace CRUD operations\n platform-namespace-event platformNamespaceEvent CRUD operations\n platform-resource platformResource CRUD operations\n platform-resource-declared-capacity platformResourceDeclaredCapacity CRUD operations\n platform-resource-definition platformResourceDefinition CRUD operations\n platform-resource-event platformResourceEvent CRUD operations\n platform-resource-installation platformResourceInstallation CRUD operations\n platform-resource-status-check platformResourceStatusCheck CRUD operations\n platform-resource-usage-log platformResourceUsageLog CRUD operations\n platform-resource-usage-summary platformResourceUsageSummary CRUD operations\n platform-resource-utilization platformResourceUtilization CRUD operations\n platform-resources-health platformResourcesHealth CRUD operations\n platform-resources-requirements-state platformResourcesRequirementsState CRUD operations\n platform-resources-resolved-requirement platformResourcesResolvedRequirement CRUD operations\n platform-webhook-endpoint platformWebhookEndpoint CRUD operations\n platform-webhook-event platformWebhookEvent CRUD operations\n resource resource CRUD operations\n resource-declared-capacity resourceDeclaredCapacity CRUD operations\n resource-definition resourceDefinition CRUD operations\n resource-event resourceEvent CRUD operations\n resource-installation resourceInstallation CRUD operations\n resource-status-check resourceStatusCheck CRUD operations\n resource-usage-log resourceUsageLog CRUD operations\n resource-usage-summary resourceUsageSummary CRUD operations\n resource-utilization resourceUtilization CRUD operations\n resources-health resourcesHealth CRUD operations\n resources-requirements-state resourcesRequirementsState CRUD operations\n resources-resolved-requirement resourcesResolvedRequirement CRUD operations\n webhook-endpoint webhookEndpoint CRUD operations\n webhook-event webhookEvent CRUD operations\n read-function-graph readFunctionGraph\n add-edge addEdge\n add-edge-and-save addEdgeAndSave\n add-node addNode\n add-node-and-save addNodeAndSave\n copy-graph copyGraph\n import-definitions importDefinitions\n import-graph-json importGraphJson\n infra-init-empty-repo infraInitEmptyRepo\n infra-insert-node-at-path infraInsertNodeAtPath\n infra-set-data-at-path infraSetDataAtPath\n init-empty-repo initEmptyRepo\n insert-node-at-path insertNodeAtPath\n platform-infra-init-empty-repo platformInfraInitEmptyRepo\n platform-infra-insert-node-at-path platformInfraInsertNodeAtPath\n platform-infra-set-data-at-path platformInfraSetDataAtPath\n platform-resource-installations-install platformResourceInstallationsInstall\n platform-resource-installations-rollback platformResourceInstallationsRollback\n platform-resource-installations-uninstall platformResourceInstallationsUninstall\n platform-resource-installations-upgrade platformResourceInstallationsUpgrade\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 resource-installations-install resourceInstallationsInstall\n resource-installations-rollback resourceInstallationsRollback\n resource-installations-uninstall resourceInstallationsUninstall\n resource-installations-upgrade resourceInstallationsUpgrade\n save-graph saveGraph\n set-data-at-path setDataAtPath\n start-execution startExecution\n validate-function-graph validateFunctionGraph\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -231,4 +242,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/add-edge-and-save.ts b/sdk/constructive-cli/src/compute/cli/commands/add-edge-and-save.ts index e37461e1bf..7d259d67d8 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/add-edge-and-save.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/add-edge-and-save.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { AddEdgeAndSaveVariables } from "../../orm/mutation"; -import type { AddEdgeAndSavePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AddEdgeAndSaveVariables } from '../../orm/mutation'; +import type { AddEdgeAndSavePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("add-edge-and-save - addEdgeAndSave\n\nUsage: add-edge-and-save [OPTIONS]\n"); + console.log('add-edge-and-save - addEdgeAndSave\n\nUsage: add-edge-and-save [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.addEdgeAndSave(parsedAnswers as unknown as AddEdgeAndSaveVariables, { - select: selectFields - } as unknown as { - select: AddEdgeAndSavePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .addEdgeAndSave( + parsedAnswers as unknown as AddEdgeAndSaveVariables, + { + select: selectFields, + } as unknown as { + select: AddEdgeAndSavePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: addEdgeAndSave"); + console.error('Failed: addEdgeAndSave'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/add-edge.ts b/sdk/constructive-cli/src/compute/cli/commands/add-edge.ts index d8805d4931..63ff143b52 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/add-edge.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/add-edge.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { AddEdgeVariables } from "../../orm/mutation"; -import type { AddEdgePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AddEdgeVariables } from '../../orm/mutation'; +import type { AddEdgePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("add-edge - addEdge\n\nUsage: add-edge [OPTIONS]\n"); + console.log('add-edge - addEdge\n\nUsage: add-edge [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.addEdge(parsedAnswers as unknown as AddEdgeVariables, { - select: selectFields - } as unknown as { - select: AddEdgePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .addEdge( + parsedAnswers as unknown as AddEdgeVariables, + { + select: selectFields, + } as unknown as { + select: AddEdgePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: addEdge"); + console.error('Failed: addEdge'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/add-node-and-save.ts b/sdk/constructive-cli/src/compute/cli/commands/add-node-and-save.ts index faef18b711..1e20debed8 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/add-node-and-save.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/add-node-and-save.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { AddNodeAndSaveVariables } from "../../orm/mutation"; -import type { AddNodeAndSavePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AddNodeAndSaveVariables } from '../../orm/mutation'; +import type { AddNodeAndSavePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("add-node-and-save - addNodeAndSave\n\nUsage: add-node-and-save [OPTIONS]\n"); + console.log('add-node-and-save - addNodeAndSave\n\nUsage: add-node-and-save [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.addNodeAndSave(parsedAnswers as unknown as AddNodeAndSaveVariables, { - select: selectFields - } as unknown as { - select: AddNodeAndSavePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .addNodeAndSave( + parsedAnswers as unknown as AddNodeAndSaveVariables, + { + select: selectFields, + } as unknown as { + select: AddNodeAndSavePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: addNodeAndSave"); + console.error('Failed: addNodeAndSave'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/add-node.ts b/sdk/constructive-cli/src/compute/cli/commands/add-node.ts index 84bda80bd7..53d031681e 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/add-node.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/add-node.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { AddNodeVariables } from "../../orm/mutation"; -import type { AddNodePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AddNodeVariables } from '../../orm/mutation'; +import type { AddNodePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("add-node - addNode\n\nUsage: add-node [OPTIONS]\n"); + console.log('add-node - addNode\n\nUsage: add-node [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.addNode(parsedAnswers as unknown as AddNodeVariables, { - select: selectFields - } as unknown as { - select: AddNodePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .addNode( + parsedAnswers as unknown as AddNodeVariables, + { + select: selectFields, + } as unknown as { + select: AddNodePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: addNode"); + console.error('Failed: addNode'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/auth.ts b/sdk/constructive-cli/src/compute/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/context.ts b/sdk/constructive-cli/src/compute/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/context.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/copy-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/copy-graph.ts index efbd2bf581..bad694bbb3 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/copy-graph.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/copy-graph.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { CopyGraphVariables } from "../../orm/mutation"; -import type { CopyGraphPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { CopyGraphVariables } from '../../orm/mutation'; +import type { CopyGraphPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("copy-graph - copyGraph\n\nUsage: copy-graph [OPTIONS]\n"); + console.log('copy-graph - copyGraph\n\nUsage: copy-graph [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.copyGraph(parsedAnswers as unknown as CopyGraphVariables, { - select: selectFields - } as unknown as { - select: CopyGraphPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .copyGraph( + parsedAnswers as unknown as CopyGraphVariables, + { + select: selectFields, + } as unknown as { + select: CopyGraphPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: copyGraph"); + console.error('Failed: copyGraph'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/db-preset.ts b/sdk/constructive-cli/src/compute/cli/commands/db-preset.ts index 728e1cdfe2..b3c9d7af31 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/db-preset.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/db-preset.ts @@ -3,59 +3,73 @@ * @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 { CreateDbPresetInput, DbPresetPatch, DbPresetSelect, DbPresetFilter, DbPresetOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDbPresetInput, + DbPresetPatch, + DbPresetSelect, + DbPresetFilter, + DbPresetOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - active: "boolean", - commitId: "uuid", - createdAt: "string", - definition: "json", - description: "string", - id: "uuid", - label: "string", - modulesHash: "uuid", - slug: "string", - storeId: "uuid", - updatedAt: "string" + active: 'boolean', + commitId: 'uuid', + createdAt: 'string', + definition: 'json', + description: 'string', + id: 'uuid', + label: 'string', + modulesHash: 'uuid', + slug: 'string', + storeId: 'uuid', + updatedAt: 'string', }; -const usage = "\ndb-preset \n\nCommands:\n list List dbPreset records\n find-first Find first matching dbPreset record\n get Get a dbPreset by ID\n create Create a new dbPreset\n update Update an existing dbPreset\n delete Delete a dbPreset\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) => { +const usage = + '\ndb-preset \n\nCommands:\n list List dbPreset records\n find-first Find first matching dbPreset record\n get Get a dbPreset by ID\n create Create a new dbPreset\n update Update an existing dbPreset\n delete Delete a dbPreset\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq modulesHash: true, slug: true, storeId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DbPresetSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DbPresetSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPreset.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter modulesHash: true, slug: true, storeId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DbPresetSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DbPresetSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPreset.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.dbPreset.findOne({ - id: answers.id as string, - select: { - active: true, - commitId: true, - createdAt: true, - definition: true, - description: true, - id: true, - label: true, - modulesHash: true, - slug: true, - storeId: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPreset + .findOne({ + id: answers.id as string, + select: { + active: true, + commitId: true, + createdAt: true, + definition: true, + description: true, + id: true, + label: true, + modulesHash: true, + slug: true, + storeId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,84 +178,95 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "active", - message: "active", - required: false, - skipPrompt: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "definition", - message: "definition", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "modulesHash", - message: "modulesHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'active', + message: 'active', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'definition', + message: 'definition', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'modulesHash', + message: 'modulesHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbPresetInput["dbPreset"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbPresetInput['dbPreset']; const client = getClient(); - const result = await client.dbPreset.create({ - data: { - active: cleanedData.active, - commitId: cleanedData.commitId, - definition: cleanedData.definition, - description: cleanedData.description, - label: cleanedData.label, - modulesHash: cleanedData.modulesHash, - slug: cleanedData.slug, - storeId: cleanedData.storeId - }, - select: { - active: true, - commitId: true, - createdAt: true, - definition: true, - description: true, - id: true, - label: true, - modulesHash: true, - slug: true, - storeId: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPreset + .create({ + data: { + active: cleanedData.active, + commitId: cleanedData.commitId, + definition: cleanedData.definition, + description: cleanedData.description, + label: cleanedData.label, + modulesHash: cleanedData.modulesHash, + slug: cleanedData.slug, + storeId: cleanedData.storeId, + }, + select: { + active: true, + commitId: true, + createdAt: true, + definition: true, + description: true, + id: true, + label: true, + modulesHash: true, + slug: true, + storeId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,92 +275,104 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "active", - message: "active", - required: false, - skipPrompt: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "definition", - message: "definition", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "modulesHash", - message: "modulesHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'active', + message: 'active', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'definition', + message: 'definition', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'modulesHash', + message: 'modulesHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DbPresetPatch; const client = getClient(); - const result = await client.dbPreset.update({ - where: { - id: answers.id as string - }, - data: { - active: cleanedData.active, - commitId: cleanedData.commitId, - definition: cleanedData.definition, - description: cleanedData.description, - label: cleanedData.label, - modulesHash: cleanedData.modulesHash, - slug: cleanedData.slug, - storeId: cleanedData.storeId - }, - select: { - active: true, - commitId: true, - createdAt: true, - definition: true, - description: true, - id: true, - label: true, - modulesHash: true, - slug: true, - storeId: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPreset + .update({ + where: { + id: answers.id as string, + }, + data: { + active: cleanedData.active, + commitId: cleanedData.commitId, + definition: cleanedData.definition, + description: cleanedData.description, + label: cleanedData.label, + modulesHash: cleanedData.modulesHash, + slug: cleanedData.slug, + storeId: cleanedData.storeId, + }, + select: { + active: true, + commitId: true, + createdAt: true, + definition: true, + description: true, + id: true, + label: true, + modulesHash: true, + slug: true, + storeId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -336,28 +381,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.dbPreset.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.dbPreset + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-api-binding.ts b/sdk/constructive-cli/src/compute/cli/commands/function-api-binding.ts index fc3fa5d1fc..a87dbfda24 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-api-binding.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-api-binding.ts @@ -3,53 +3,67 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionApiBindingInput, FunctionApiBindingPatch, FunctionApiBindingSelect, FunctionApiBindingFilter, FunctionApiBindingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionApiBindingInput, + FunctionApiBindingPatch, + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - alias: "string", - apiId: "uuid", - config: "json", - functionDefinitionId: "uuid", - id: "uuid" + alias: 'string', + apiId: 'uuid', + config: 'json', + functionDefinitionId: 'uuid', + id: 'uuid', }; -const usage = "\nfunction-api-binding \n\nCommands:\n list List functionApiBinding records\n find-first Find first matching functionApiBinding record\n get Get a functionApiBinding by ID\n create Create a new functionApiBinding\n update Update an existing functionApiBinding\n delete Delete a functionApiBinding\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-api-binding \n\nCommands:\n list List functionApiBinding records\n find-first Find first matching functionApiBinding record\n get Get a functionApiBinding by ID\n create Create a new functionApiBinding\n update Update an existing functionApiBinding\n delete Delete a functionApiBinding\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq apiId: true, config: true, functionDefinitionId: true, - id: true + id: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionApiBindingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + > & { + select: FunctionApiBindingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionApiBinding.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter apiId: true, config: true, functionDefinitionId: true, - id: true + id: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionApiBindingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + > & { + select: FunctionApiBindingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionApiBinding.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionApiBinding.findOne({ - id: answers.id as string, - select: { - alias: true, - apiId: true, - config: true, - functionDefinitionId: true, - id: true - } - }).execute(); + const result = await client.functionApiBinding + .findOne({ + id: answers.id as string, + select: { + alias: true, + apiId: true, + config: true, + functionDefinitionId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,50 +162,60 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "alias", - message: "alias", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiId", - message: "apiId", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'alias', + message: 'alias', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionApiBindingInput["functionApiBinding"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionApiBindingInput['functionApiBinding']; const client = getClient(); - const result = await client.functionApiBinding.create({ - data: { - alias: cleanedData.alias, - apiId: cleanedData.apiId, - config: cleanedData.config, - functionDefinitionId: cleanedData.functionDefinitionId - }, - select: { - alias: true, - apiId: true, - config: true, - functionDefinitionId: true, - id: true - } - }).execute(); + const result = await client.functionApiBinding + .create({ + data: { + alias: cleanedData.alias, + apiId: cleanedData.apiId, + config: cleanedData.config, + functionDefinitionId: cleanedData.functionDefinitionId, + }, + select: { + alias: true, + apiId: true, + config: true, + functionDefinitionId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -184,58 +224,66 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "alias", - message: "alias", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiId", - message: "apiId", - required: false - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'alias', + message: 'alias', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionApiBindingPatch; const client = getClient(); - const result = await client.functionApiBinding.update({ - where: { - id: answers.id as string - }, - data: { - alias: cleanedData.alias, - apiId: cleanedData.apiId, - config: cleanedData.config, - functionDefinitionId: cleanedData.functionDefinitionId - }, - select: { - alias: true, - apiId: true, - config: true, - functionDefinitionId: true, - id: true - } - }).execute(); + const result = await client.functionApiBinding + .update({ + where: { + id: answers.id as string, + }, + data: { + alias: cleanedData.alias, + apiId: cleanedData.apiId, + config: cleanedData.config, + functionDefinitionId: cleanedData.functionDefinitionId, + }, + select: { + alias: true, + apiId: true, + config: true, + functionDefinitionId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -244,28 +292,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionApiBinding.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionApiBinding + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-definition.ts b/sdk/constructive-cli/src/compute/cli/commands/function-definition.ts index 34b458ed32..4f44ce5afc 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-definition.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-definition.ts @@ -3,91 +3,105 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionDefinitionInput, FunctionDefinitionPatch, FunctionDefinitionSelect, FunctionDefinitionFilter, FunctionDefinitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionDefinitionInput, + FunctionDefinitionPatch, + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - accessChannels: "string", - category: "string", - concurrency: "int", - cpuLimitMillicores: "int", - cpuRequestMillicores: "int", - createdAt: "string", - databaseId: "uuid", - description: "string", - fnCategory: "string", - functionColumns: "json", - graphId: "uuid", - icon: "string", - id: "uuid", - image: "string", - inputs: "json", - integrations: "string", - isPublished: "boolean", - maxAttempts: "int", - memoryLimitBytes: "int", - memoryRequestBytes: "int", - moduleTable: "string", - name: "string", - outputs: "json", - payloadArgs: "json", - priority: "int", - props: "json", - protected: "boolean", - publishedAt: "string", - queueName: "string", - requiredBuckets: "string", - requiredConfigs: "string", - requiredModels: "string", - requiredSecrets: "string", - resources: "json", - runtime: "string", - scaleMax: "int", - scaleMin: "int", - targetFunction: "string", - targetSchema: "string", - taskIdentifier: "string", - timeoutSeconds: "int", - updatedAt: "string", - volatile: "boolean" + accessChannels: 'string', + category: 'string', + concurrency: 'int', + cpuLimitMillicores: 'int', + cpuRequestMillicores: 'int', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + fnCategory: 'string', + functionColumns: 'json', + graphId: 'uuid', + icon: 'string', + id: 'uuid', + image: 'string', + inputs: 'json', + integrations: 'string', + isPublished: 'boolean', + maxAttempts: 'int', + memoryLimitBytes: 'int', + memoryRequestBytes: 'int', + moduleTable: 'string', + name: 'string', + outputs: 'json', + payloadArgs: 'json', + priority: 'int', + props: 'json', + protected: 'boolean', + publishedAt: 'string', + queueName: 'string', + requiredBuckets: 'string', + requiredConfigs: 'string', + requiredModels: 'string', + requiredSecrets: 'string', + resources: 'json', + runtime: 'string', + scaleMax: 'int', + scaleMin: 'int', + targetFunction: 'string', + targetSchema: 'string', + taskIdentifier: 'string', + timeoutSeconds: 'int', + updatedAt: 'string', + volatile: 'boolean', }; -const usage = "\nfunction-definition \n\nCommands:\n list List functionDefinition records\n find-first Find first matching functionDefinition record\n get Get a functionDefinition by ID\n create Create a new functionDefinition\n update Update an existing functionDefinition\n delete Delete a functionDefinition\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-definition \n\nCommands:\n list List functionDefinition records\n find-first Find first matching functionDefinition record\n get Get a functionDefinition by ID\n create Create a new functionDefinition\n update Update an existing functionDefinition\n delete Delete a functionDefinition\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -134,16 +148,22 @@ async function handleList(argv: Partial>, _prompter: Inq targetSchema: true, timeoutSeconds: true, updatedAt: true, - volatile: true + volatile: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionDefinitionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + > & { + select: FunctionDefinitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionDefinition.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -190,16 +210,22 @@ async function handleFindFirst(argv: Partial>, _prompter targetSchema: true, timeoutSeconds: true, updatedAt: true, - volatile: true + volatile: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionDefinitionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + > & { + select: FunctionDefinitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionDefinition.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -208,59 +234,63 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionDefinition.findOne({ - id: answers.id as string, - select: { - accessChannels: true, - category: true, - concurrency: true, - createdAt: true, - databaseId: true, - description: true, - fnCategory: true, - functionColumns: true, - graphId: true, - icon: true, - id: true, - image: true, - inputs: true, - integrations: true, - isPublished: true, - maxAttempts: true, - moduleTable: true, - name: true, - outputs: true, - payloadArgs: true, - priority: true, - props: true, - protected: true, - publishedAt: true, - queueName: true, - requiredBuckets: true, - requiredConfigs: true, - requiredModels: true, - requiredSecrets: true, - resources: true, - runtime: true, - scaleMax: true, - scaleMin: true, - targetFunction: true, - targetSchema: true, - timeoutSeconds: true, - updatedAt: true, - volatile: true - } - }).execute(); + const result = await client.functionDefinition + .findOne({ + id: answers.id as string, + select: { + accessChannels: true, + category: true, + concurrency: true, + createdAt: true, + databaseId: true, + description: true, + fnCategory: true, + functionColumns: true, + graphId: true, + icon: true, + id: true, + image: true, + inputs: true, + integrations: true, + isPublished: true, + maxAttempts: true, + moduleTable: true, + name: true, + outputs: true, + payloadArgs: true, + priority: true, + props: true, + protected: true, + publishedAt: true, + queueName: true, + requiredBuckets: true, + requiredConfigs: true, + requiredModels: true, + requiredSecrets: true, + resources: true, + runtime: true, + scaleMax: true, + scaleMin: true, + targetFunction: true, + targetSchema: true, + timeoutSeconds: true, + updatedAt: true, + volatile: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -269,299 +299,340 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "accessChannels", - message: "accessChannels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: true - }, { - type: "text", - name: "concurrency", - message: "concurrency", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fnCategory", - message: "fnCategory", - required: false, - skipPrompt: true - }, { - type: "json", - name: "functionColumns", - message: "functionColumns", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphId", - message: "graphId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "icon", - message: "icon", - required: false, - skipPrompt: true - }, { - type: "text", - name: "image", - message: "image", - required: false, - skipPrompt: true - }, { - type: "json", - name: "inputs", - message: "inputs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxAttempts", - message: "maxAttempts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "moduleTable", - message: "moduleTable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "json", - name: "outputs", - message: "outputs", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payloadArgs", - message: "payloadArgs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "json", - name: "props", - message: "props", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "protected", - message: "protected", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publishedAt", - message: "publishedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queueName", - message: "queueName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredBuckets", - message: "requiredBuckets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredModels", - message: "requiredModels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "runtime", - message: "runtime", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMax", - message: "scaleMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMin", - message: "scaleMin", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetFunction", - message: "targetFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetSchema", - message: "targetSchema", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutSeconds", - message: "timeoutSeconds", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "volatile", - message: "volatile", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'accessChannels', + message: 'accessChannels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fnCategory', + message: 'fnCategory', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'functionColumns', + message: 'functionColumns', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphId', + message: 'graphId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'icon', + message: 'icon', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'inputs', + message: 'inputs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAttempts', + message: 'maxAttempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'moduleTable', + message: 'moduleTable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'json', + name: 'outputs', + message: 'outputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payloadArgs', + message: 'payloadArgs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'props', + message: 'props', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'protected', + message: 'protected', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publishedAt', + message: 'publishedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queueName', + message: 'queueName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredBuckets', + message: 'requiredBuckets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredModels', + message: 'requiredModels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtime', + message: 'runtime', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetFunction', + message: 'targetFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetSchema', + message: 'targetSchema', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'volatile', + message: 'volatile', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionDefinitionInput["functionDefinition"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionDefinitionInput['functionDefinition']; const client = getClient(); - const result = await client.functionDefinition.create({ - data: { - accessChannels: cleanedData.accessChannels, - category: cleanedData.category, - concurrency: cleanedData.concurrency, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - fnCategory: cleanedData.fnCategory, - functionColumns: cleanedData.functionColumns, - graphId: cleanedData.graphId, - icon: cleanedData.icon, - image: cleanedData.image, - inputs: cleanedData.inputs, - integrations: cleanedData.integrations, - isPublished: cleanedData.isPublished, - maxAttempts: cleanedData.maxAttempts, - moduleTable: cleanedData.moduleTable, - name: cleanedData.name, - outputs: cleanedData.outputs, - payloadArgs: cleanedData.payloadArgs, - priority: cleanedData.priority, - props: cleanedData.props, - protected: cleanedData.protected, - publishedAt: cleanedData.publishedAt, - queueName: cleanedData.queueName, - requiredBuckets: cleanedData.requiredBuckets, - requiredConfigs: cleanedData.requiredConfigs, - requiredModels: cleanedData.requiredModels, - requiredSecrets: cleanedData.requiredSecrets, - resources: cleanedData.resources, - runtime: cleanedData.runtime, - scaleMax: cleanedData.scaleMax, - scaleMin: cleanedData.scaleMin, - targetFunction: cleanedData.targetFunction, - targetSchema: cleanedData.targetSchema, - timeoutSeconds: cleanedData.timeoutSeconds, - volatile: cleanedData.volatile - }, - select: { - accessChannels: true, - category: true, - concurrency: true, - createdAt: true, - databaseId: true, - description: true, - fnCategory: true, - functionColumns: true, - graphId: true, - icon: true, - id: true, - image: true, - inputs: true, - integrations: true, - isPublished: true, - maxAttempts: true, - moduleTable: true, - name: true, - outputs: true, - payloadArgs: true, - priority: true, - props: true, - protected: true, - publishedAt: true, - queueName: true, - requiredBuckets: true, - requiredConfigs: true, - requiredModels: true, - requiredSecrets: true, - resources: true, - runtime: true, - scaleMax: true, - scaleMin: true, - targetFunction: true, - targetSchema: true, - timeoutSeconds: true, - updatedAt: true, - volatile: true - } - }).execute(); + const result = await client.functionDefinition + .create({ + data: { + accessChannels: cleanedData.accessChannels, + category: cleanedData.category, + concurrency: cleanedData.concurrency, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + fnCategory: cleanedData.fnCategory, + functionColumns: cleanedData.functionColumns, + graphId: cleanedData.graphId, + icon: cleanedData.icon, + image: cleanedData.image, + inputs: cleanedData.inputs, + integrations: cleanedData.integrations, + isPublished: cleanedData.isPublished, + maxAttempts: cleanedData.maxAttempts, + moduleTable: cleanedData.moduleTable, + name: cleanedData.name, + outputs: cleanedData.outputs, + payloadArgs: cleanedData.payloadArgs, + priority: cleanedData.priority, + props: cleanedData.props, + protected: cleanedData.protected, + publishedAt: cleanedData.publishedAt, + queueName: cleanedData.queueName, + requiredBuckets: cleanedData.requiredBuckets, + requiredConfigs: cleanedData.requiredConfigs, + requiredModels: cleanedData.requiredModels, + requiredSecrets: cleanedData.requiredSecrets, + resources: cleanedData.resources, + runtime: cleanedData.runtime, + scaleMax: cleanedData.scaleMax, + scaleMin: cleanedData.scaleMin, + targetFunction: cleanedData.targetFunction, + targetSchema: cleanedData.targetSchema, + timeoutSeconds: cleanedData.timeoutSeconds, + volatile: cleanedData.volatile, + }, + select: { + accessChannels: true, + category: true, + concurrency: true, + createdAt: true, + databaseId: true, + description: true, + fnCategory: true, + functionColumns: true, + graphId: true, + icon: true, + id: true, + image: true, + inputs: true, + integrations: true, + isPublished: true, + maxAttempts: true, + moduleTable: true, + name: true, + outputs: true, + payloadArgs: true, + priority: true, + props: true, + protected: true, + publishedAt: true, + queueName: true, + requiredBuckets: true, + requiredConfigs: true, + requiredModels: true, + requiredSecrets: true, + resources: true, + runtime: true, + scaleMax: true, + scaleMin: true, + targetFunction: true, + targetSchema: true, + timeoutSeconds: true, + updatedAt: true, + volatile: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -570,307 +641,346 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "accessChannels", - message: "accessChannels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false - }, { - type: "text", - name: "concurrency", - message: "concurrency", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fnCategory", - message: "fnCategory", - required: false, - skipPrompt: true - }, { - type: "json", - name: "functionColumns", - message: "functionColumns", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphId", - message: "graphId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "icon", - message: "icon", - required: false, - skipPrompt: true - }, { - type: "text", - name: "image", - message: "image", - required: false, - skipPrompt: true - }, { - type: "json", - name: "inputs", - message: "inputs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxAttempts", - message: "maxAttempts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "moduleTable", - message: "moduleTable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "json", - name: "outputs", - message: "outputs", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payloadArgs", - message: "payloadArgs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "json", - name: "props", - message: "props", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "protected", - message: "protected", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publishedAt", - message: "publishedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queueName", - message: "queueName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredBuckets", - message: "requiredBuckets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredModels", - message: "requiredModels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "runtime", - message: "runtime", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMax", - message: "scaleMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMin", - message: "scaleMin", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetFunction", - message: "targetFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetSchema", - message: "targetSchema", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutSeconds", - message: "timeoutSeconds", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "volatile", - message: "volatile", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'accessChannels', + message: 'accessChannels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fnCategory', + message: 'fnCategory', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'functionColumns', + message: 'functionColumns', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphId', + message: 'graphId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'icon', + message: 'icon', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'inputs', + message: 'inputs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAttempts', + message: 'maxAttempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'moduleTable', + message: 'moduleTable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'json', + name: 'outputs', + message: 'outputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payloadArgs', + message: 'payloadArgs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'props', + message: 'props', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'protected', + message: 'protected', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publishedAt', + message: 'publishedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queueName', + message: 'queueName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredBuckets', + message: 'requiredBuckets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredModels', + message: 'requiredModels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtime', + message: 'runtime', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetFunction', + message: 'targetFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetSchema', + message: 'targetSchema', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'volatile', + message: 'volatile', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionDefinitionPatch; const client = getClient(); - const result = await client.functionDefinition.update({ - where: { - id: answers.id as string - }, - data: { - accessChannels: cleanedData.accessChannels, - category: cleanedData.category, - concurrency: cleanedData.concurrency, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - fnCategory: cleanedData.fnCategory, - functionColumns: cleanedData.functionColumns, - graphId: cleanedData.graphId, - icon: cleanedData.icon, - image: cleanedData.image, - inputs: cleanedData.inputs, - integrations: cleanedData.integrations, - isPublished: cleanedData.isPublished, - maxAttempts: cleanedData.maxAttempts, - moduleTable: cleanedData.moduleTable, - name: cleanedData.name, - outputs: cleanedData.outputs, - payloadArgs: cleanedData.payloadArgs, - priority: cleanedData.priority, - props: cleanedData.props, - protected: cleanedData.protected, - publishedAt: cleanedData.publishedAt, - queueName: cleanedData.queueName, - requiredBuckets: cleanedData.requiredBuckets, - requiredConfigs: cleanedData.requiredConfigs, - requiredModels: cleanedData.requiredModels, - requiredSecrets: cleanedData.requiredSecrets, - resources: cleanedData.resources, - runtime: cleanedData.runtime, - scaleMax: cleanedData.scaleMax, - scaleMin: cleanedData.scaleMin, - targetFunction: cleanedData.targetFunction, - targetSchema: cleanedData.targetSchema, - timeoutSeconds: cleanedData.timeoutSeconds, - volatile: cleanedData.volatile - }, - select: { - accessChannels: true, - category: true, - concurrency: true, - createdAt: true, - databaseId: true, - description: true, - fnCategory: true, - functionColumns: true, - graphId: true, - icon: true, - id: true, - image: true, - inputs: true, - integrations: true, - isPublished: true, - maxAttempts: true, - moduleTable: true, - name: true, - outputs: true, - payloadArgs: true, - priority: true, - props: true, - protected: true, - publishedAt: true, - queueName: true, - requiredBuckets: true, - requiredConfigs: true, - requiredModels: true, - requiredSecrets: true, - resources: true, - runtime: true, - scaleMax: true, - scaleMin: true, - targetFunction: true, - targetSchema: true, - timeoutSeconds: true, - updatedAt: true, - volatile: true - } - }).execute(); + const result = await client.functionDefinition + .update({ + where: { + id: answers.id as string, + }, + data: { + accessChannels: cleanedData.accessChannels, + category: cleanedData.category, + concurrency: cleanedData.concurrency, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + fnCategory: cleanedData.fnCategory, + functionColumns: cleanedData.functionColumns, + graphId: cleanedData.graphId, + icon: cleanedData.icon, + image: cleanedData.image, + inputs: cleanedData.inputs, + integrations: cleanedData.integrations, + isPublished: cleanedData.isPublished, + maxAttempts: cleanedData.maxAttempts, + moduleTable: cleanedData.moduleTable, + name: cleanedData.name, + outputs: cleanedData.outputs, + payloadArgs: cleanedData.payloadArgs, + priority: cleanedData.priority, + props: cleanedData.props, + protected: cleanedData.protected, + publishedAt: cleanedData.publishedAt, + queueName: cleanedData.queueName, + requiredBuckets: cleanedData.requiredBuckets, + requiredConfigs: cleanedData.requiredConfigs, + requiredModels: cleanedData.requiredModels, + requiredSecrets: cleanedData.requiredSecrets, + resources: cleanedData.resources, + runtime: cleanedData.runtime, + scaleMax: cleanedData.scaleMax, + scaleMin: cleanedData.scaleMin, + targetFunction: cleanedData.targetFunction, + targetSchema: cleanedData.targetSchema, + timeoutSeconds: cleanedData.timeoutSeconds, + volatile: cleanedData.volatile, + }, + select: { + accessChannels: true, + category: true, + concurrency: true, + createdAt: true, + databaseId: true, + description: true, + fnCategory: true, + functionColumns: true, + graphId: true, + icon: true, + id: true, + image: true, + inputs: true, + integrations: true, + isPublished: true, + maxAttempts: true, + moduleTable: true, + name: true, + outputs: true, + payloadArgs: true, + priority: true, + props: true, + protected: true, + publishedAt: true, + queueName: true, + requiredBuckets: true, + requiredConfigs: true, + requiredModels: true, + requiredSecrets: true, + resources: true, + runtime: true, + scaleMax: true, + scaleMin: true, + targetFunction: true, + targetSchema: true, + timeoutSeconds: true, + updatedAt: true, + volatile: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -879,28 +989,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionDefinition.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionDefinition + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-deployment-event.ts b/sdk/constructive-cli/src/compute/cli/commands/function-deployment-event.ts index 4bfe247a63..9bbdc3e167 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-deployment-event.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-deployment-event.ts @@ -3,56 +3,70 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionDeploymentEventInput, FunctionDeploymentEventPatch, FunctionDeploymentEventSelect, FunctionDeploymentEventFilter, FunctionDeploymentEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionDeploymentEventInput, + FunctionDeploymentEventPatch, + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - databaseId: "uuid", - deploymentId: "uuid", - eventType: "string", - id: "uuid", - message: "string", - metadata: "json" + actorId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + deploymentId: 'uuid', + eventType: 'string', + id: 'uuid', + message: 'string', + metadata: 'json', }; -const usage = "\nfunction-deployment-event \n\nCommands:\n list List functionDeploymentEvent records\n find-first Find first matching functionDeploymentEvent record\n get Get a functionDeploymentEvent by ID\n create Create a new functionDeploymentEvent\n update Update an existing functionDeploymentEvent\n delete Delete a functionDeploymentEvent\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-deployment-event \n\nCommands:\n list List functionDeploymentEvent records\n find-first Find first matching functionDeploymentEvent record\n get Get a functionDeploymentEvent by ID\n create Create a new functionDeploymentEvent\n update Update an existing functionDeploymentEvent\n delete Delete a functionDeploymentEvent\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,22 @@ async function handleList(argv: Partial>, _prompter: Inq eventType: true, id: true, message: true, - metadata: true + metadata: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionDeploymentEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + > & { + select: FunctionDeploymentEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionDeploymentEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +115,22 @@ async function handleFindFirst(argv: Partial>, _prompter eventType: true, id: true, message: true, - metadata: true + metadata: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionDeploymentEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + > & { + select: FunctionDeploymentEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionDeploymentEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +139,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionDeploymentEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - databaseId: true, - deploymentId: true, - eventType: true, - id: true, - message: true, - metadata: true - } - }).execute(); + const result = await client.functionDeploymentEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + databaseId: true, + deploymentId: true, + eventType: true, + id: true, + message: true, + metadata: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,66 +174,78 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "deploymentId", - message: "deploymentId", - required: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'deploymentId', + message: 'deploymentId', + required: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionDeploymentEventInput["functionDeploymentEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionDeploymentEventInput['functionDeploymentEvent']; const client = getClient(); - const result = await client.functionDeploymentEvent.create({ - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - deploymentId: cleanedData.deploymentId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - deploymentId: true, - eventType: true, - id: true, - message: true, - metadata: true - } - }).execute(); + const result = await client.functionDeploymentEvent + .create({ + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + deploymentId: cleanedData.deploymentId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + deploymentId: true, + eventType: true, + id: true, + message: true, + metadata: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -212,80 +254,91 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "deploymentId", - message: "deploymentId", - required: false - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'deploymentId', + message: 'deploymentId', + required: false, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionDeploymentEventPatch; const client = getClient(); - const result = await client.functionDeploymentEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - deploymentId: cleanedData.deploymentId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - deploymentId: true, - eventType: true, - id: true, - message: true, - metadata: true - } - }).execute(); + const result = await client.functionDeploymentEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + deploymentId: cleanedData.deploymentId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + deploymentId: true, + eventType: true, + id: true, + message: true, + metadata: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -294,34 +347,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionDeploymentEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionDeploymentEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-deployment.ts b/sdk/constructive-cli/src/compute/cli/commands/function-deployment.ts index 398bbc8a8f..3bd2cf1561 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-deployment.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-deployment.ts @@ -3,70 +3,84 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionDeploymentInput, FunctionDeploymentPatch, FunctionDeploymentSelect, FunctionDeploymentFilter, FunctionDeploymentOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionDeploymentInput, + FunctionDeploymentPatch, + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - concurrency: "int", - createdAt: "string", - databaseId: "uuid", - errorCount: "int", - handlerName: "string", - id: "uuid", - image: "string", - imageVersion: "string", - labels: "json", - lastError: "string", - lastErrorAt: "string", - namespaceId: "uuid", - resources: "json", - revision: "int", - scaleMax: "int", - scaleMin: "int", - serviceName: "string", - serviceUrl: "string", - status: "string", - timeoutSeconds: "int", - updatedAt: "string" + annotations: 'json', + concurrency: 'int', + createdAt: 'string', + databaseId: 'uuid', + errorCount: 'int', + handlerName: 'string', + id: 'uuid', + image: 'string', + imageVersion: 'string', + labels: 'json', + lastError: 'string', + lastErrorAt: 'string', + namespaceId: 'uuid', + resources: 'json', + revision: 'int', + scaleMax: 'int', + scaleMin: 'int', + serviceName: 'string', + serviceUrl: 'string', + status: 'string', + timeoutSeconds: 'int', + updatedAt: 'string', }; -const usage = "\nfunction-deployment \n\nCommands:\n list List functionDeployment records\n find-first Find first matching functionDeployment record\n get Get a functionDeployment by ID\n create Create a new functionDeployment\n update Update an existing functionDeployment\n delete Delete a functionDeployment\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-deployment \n\nCommands:\n list List functionDeployment records\n find-first Find first matching functionDeployment record\n get Get a functionDeployment by ID\n create Create a new functionDeployment\n update Update an existing functionDeployment\n delete Delete a functionDeployment\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -97,16 +111,22 @@ async function handleList(argv: Partial>, _prompter: Inq serviceUrl: true, status: true, timeoutSeconds: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionDeploymentSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + > & { + select: FunctionDeploymentSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionDeployment.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -137,16 +157,22 @@ async function handleFindFirst(argv: Partial>, _prompter serviceUrl: true, status: true, timeoutSeconds: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionDeploymentSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + > & { + select: FunctionDeploymentSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionDeployment.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -155,43 +181,47 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionDeployment.findOne({ - id: answers.id as string, - select: { - annotations: true, - concurrency: true, - createdAt: true, - databaseId: true, - errorCount: true, - handlerName: true, - id: true, - image: true, - imageVersion: true, - labels: true, - lastError: true, - lastErrorAt: true, - namespaceId: true, - resources: true, - revision: true, - scaleMax: true, - scaleMin: true, - serviceName: true, - serviceUrl: true, - status: true, - timeoutSeconds: true, - updatedAt: true - } - }).execute(); + const result = await client.functionDeployment + .findOne({ + id: answers.id as string, + select: { + annotations: true, + concurrency: true, + createdAt: true, + databaseId: true, + errorCount: true, + handlerName: true, + id: true, + image: true, + imageVersion: true, + labels: true, + lastError: true, + lastErrorAt: true, + namespaceId: true, + resources: true, + revision: true, + scaleMax: true, + scaleMin: true, + serviceName: true, + serviceUrl: true, + status: true, + timeoutSeconds: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -200,171 +230,196 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "concurrency", - message: "concurrency", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "handlerName", - message: "handlerName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "image", - message: "image", - required: true - }, { - type: "text", - name: "imageVersion", - message: "imageVersion", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastErrorAt", - message: "lastErrorAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revision", - message: "revision", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMax", - message: "scaleMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMin", - message: "scaleMin", - required: false, - skipPrompt: true - }, { - type: "text", - name: "serviceName", - message: "serviceName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "serviceUrl", - message: "serviceUrl", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutSeconds", - message: "timeoutSeconds", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'handlerName', + message: 'handlerName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: true, + }, + { + type: 'text', + name: 'imageVersion', + message: 'imageVersion', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastErrorAt', + message: 'lastErrorAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceName', + message: 'serviceName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceUrl', + message: 'serviceUrl', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionDeploymentInput["functionDeployment"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionDeploymentInput['functionDeployment']; const client = getClient(); - const result = await client.functionDeployment.create({ - data: { - annotations: cleanedData.annotations, - concurrency: cleanedData.concurrency, - databaseId: cleanedData.databaseId, - errorCount: cleanedData.errorCount, - handlerName: cleanedData.handlerName, - image: cleanedData.image, - imageVersion: cleanedData.imageVersion, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastErrorAt: cleanedData.lastErrorAt, - namespaceId: cleanedData.namespaceId, - resources: cleanedData.resources, - revision: cleanedData.revision, - scaleMax: cleanedData.scaleMax, - scaleMin: cleanedData.scaleMin, - serviceName: cleanedData.serviceName, - serviceUrl: cleanedData.serviceUrl, - status: cleanedData.status, - timeoutSeconds: cleanedData.timeoutSeconds - }, - select: { - annotations: true, - concurrency: true, - createdAt: true, - databaseId: true, - errorCount: true, - handlerName: true, - id: true, - image: true, - imageVersion: true, - labels: true, - lastError: true, - lastErrorAt: true, - namespaceId: true, - resources: true, - revision: true, - scaleMax: true, - scaleMin: true, - serviceName: true, - serviceUrl: true, - status: true, - timeoutSeconds: true, - updatedAt: true - } - }).execute(); + const result = await client.functionDeployment + .create({ + data: { + annotations: cleanedData.annotations, + concurrency: cleanedData.concurrency, + databaseId: cleanedData.databaseId, + errorCount: cleanedData.errorCount, + handlerName: cleanedData.handlerName, + image: cleanedData.image, + imageVersion: cleanedData.imageVersion, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastErrorAt: cleanedData.lastErrorAt, + namespaceId: cleanedData.namespaceId, + resources: cleanedData.resources, + revision: cleanedData.revision, + scaleMax: cleanedData.scaleMax, + scaleMin: cleanedData.scaleMin, + serviceName: cleanedData.serviceName, + serviceUrl: cleanedData.serviceUrl, + status: cleanedData.status, + timeoutSeconds: cleanedData.timeoutSeconds, + }, + select: { + annotations: true, + concurrency: true, + createdAt: true, + databaseId: true, + errorCount: true, + handlerName: true, + id: true, + image: true, + imageVersion: true, + labels: true, + lastError: true, + lastErrorAt: true, + namespaceId: true, + resources: true, + revision: true, + scaleMax: true, + scaleMin: true, + serviceName: true, + serviceUrl: true, + status: true, + timeoutSeconds: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -373,179 +428,202 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "concurrency", - message: "concurrency", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "handlerName", - message: "handlerName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "image", - message: "image", - required: false - }, { - type: "text", - name: "imageVersion", - message: "imageVersion", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastErrorAt", - message: "lastErrorAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revision", - message: "revision", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMax", - message: "scaleMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMin", - message: "scaleMin", - required: false, - skipPrompt: true - }, { - type: "text", - name: "serviceName", - message: "serviceName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "serviceUrl", - message: "serviceUrl", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutSeconds", - message: "timeoutSeconds", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'handlerName', + message: 'handlerName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + }, + { + type: 'text', + name: 'imageVersion', + message: 'imageVersion', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastErrorAt', + message: 'lastErrorAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceName', + message: 'serviceName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceUrl', + message: 'serviceUrl', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionDeploymentPatch; const client = getClient(); - const result = await client.functionDeployment.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - concurrency: cleanedData.concurrency, - databaseId: cleanedData.databaseId, - errorCount: cleanedData.errorCount, - handlerName: cleanedData.handlerName, - image: cleanedData.image, - imageVersion: cleanedData.imageVersion, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastErrorAt: cleanedData.lastErrorAt, - namespaceId: cleanedData.namespaceId, - resources: cleanedData.resources, - revision: cleanedData.revision, - scaleMax: cleanedData.scaleMax, - scaleMin: cleanedData.scaleMin, - serviceName: cleanedData.serviceName, - serviceUrl: cleanedData.serviceUrl, - status: cleanedData.status, - timeoutSeconds: cleanedData.timeoutSeconds - }, - select: { - annotations: true, - concurrency: true, - createdAt: true, - databaseId: true, - errorCount: true, - handlerName: true, - id: true, - image: true, - imageVersion: true, - labels: true, - lastError: true, - lastErrorAt: true, - namespaceId: true, - resources: true, - revision: true, - scaleMax: true, - scaleMin: true, - serviceName: true, - serviceUrl: true, - status: true, - timeoutSeconds: true, - updatedAt: true - } - }).execute(); + const result = await client.functionDeployment + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + concurrency: cleanedData.concurrency, + databaseId: cleanedData.databaseId, + errorCount: cleanedData.errorCount, + handlerName: cleanedData.handlerName, + image: cleanedData.image, + imageVersion: cleanedData.imageVersion, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastErrorAt: cleanedData.lastErrorAt, + namespaceId: cleanedData.namespaceId, + resources: cleanedData.resources, + revision: cleanedData.revision, + scaleMax: cleanedData.scaleMax, + scaleMin: cleanedData.scaleMin, + serviceName: cleanedData.serviceName, + serviceUrl: cleanedData.serviceUrl, + status: cleanedData.status, + timeoutSeconds: cleanedData.timeoutSeconds, + }, + select: { + annotations: true, + concurrency: true, + createdAt: true, + databaseId: true, + errorCount: true, + handlerName: true, + id: true, + image: true, + imageVersion: true, + labels: true, + lastError: true, + lastErrorAt: true, + namespaceId: true, + resources: true, + revision: true, + scaleMax: true, + scaleMin: true, + serviceName: true, + serviceUrl: true, + status: true, + timeoutSeconds: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -554,28 +632,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionDeployment.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionDeployment + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-execution-log.ts b/sdk/constructive-cli/src/compute/cli/commands/function-execution-log.ts index 554f2f52e9..396629e48b 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-execution-log.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-execution-log.ts @@ -3,57 +3,71 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionExecutionLogInput, FunctionExecutionLogPatch, FunctionExecutionLogSelect, FunctionExecutionLogFilter, FunctionExecutionLogOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionExecutionLogInput, + FunctionExecutionLogPatch, + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - databaseId: "uuid", - id: "uuid", - invocationId: "uuid", - logLevel: "string", - message: "string", - metadata: "json", - taskIdentifier: "string" + actorId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + id: 'uuid', + invocationId: 'uuid', + logLevel: 'string', + message: 'string', + metadata: 'json', + taskIdentifier: 'string', }; -const usage = "\nfunction-execution-log \n\nCommands:\n list List functionExecutionLog records\n find-first Find first matching functionExecutionLog record\n get Get a functionExecutionLog by ID\n create Create a new functionExecutionLog\n update Update an existing functionExecutionLog\n delete Delete a functionExecutionLog\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-execution-log \n\nCommands:\n list List functionExecutionLog records\n find-first Find first matching functionExecutionLog record\n get Get a functionExecutionLog by ID\n create Create a new functionExecutionLog\n update Update an existing functionExecutionLog\n delete Delete a functionExecutionLog\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq logLevel: true, message: true, metadata: true, - taskIdentifier: true + taskIdentifier: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionExecutionLogSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + > & { + select: FunctionExecutionLogSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionExecutionLog.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter logLevel: true, message: true, metadata: true, - taskIdentifier: true + taskIdentifier: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionExecutionLogSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + > & { + select: FunctionExecutionLogSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionExecutionLog.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionExecutionLog.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - databaseId: true, - id: true, - invocationId: true, - logLevel: true, - message: true, - metadata: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionExecutionLog + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + databaseId: true, + id: true, + invocationId: true, + logLevel: true, + message: true, + metadata: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,75 +178,88 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "logLevel", - message: "logLevel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logLevel', + message: 'logLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionExecutionLogInput["functionExecutionLog"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionExecutionLogInput['functionExecutionLog']; const client = getClient(); - const result = await client.functionExecutionLog.create({ - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - invocationId: cleanedData.invocationId, - logLevel: cleanedData.logLevel, - message: cleanedData.message, - metadata: cleanedData.metadata, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - id: true, - invocationId: true, - logLevel: true, - message: true, - metadata: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionExecutionLog + .create({ + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + invocationId: cleanedData.invocationId, + logLevel: cleanedData.logLevel, + message: cleanedData.message, + metadata: cleanedData.metadata, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + id: true, + invocationId: true, + logLevel: true, + message: true, + metadata: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -225,89 +268,101 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "logLevel", - message: "logLevel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logLevel', + message: 'logLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionExecutionLogPatch; const client = getClient(); - const result = await client.functionExecutionLog.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - invocationId: cleanedData.invocationId, - logLevel: cleanedData.logLevel, - message: cleanedData.message, - metadata: cleanedData.metadata, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - id: true, - invocationId: true, - logLevel: true, - message: true, - metadata: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionExecutionLog + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + invocationId: cleanedData.invocationId, + logLevel: cleanedData.logLevel, + message: cleanedData.message, + metadata: cleanedData.metadata, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + id: true, + invocationId: true, + logLevel: true, + message: true, + metadata: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -316,34 +371,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionExecutionLog.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionExecutionLog + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-commit.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-commit.ts index 51a8934c7d..80723b4512 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph-commit.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-commit.ts @@ -3,57 +3,71 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionGraphCommitInput, FunctionGraphCommitPatch, FunctionGraphCommitSelect, FunctionGraphCommitFilter, FunctionGraphCommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphCommitInput, + FunctionGraphCommitPatch, + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - authorId: "uuid", - committerId: "uuid", - date: "string", - id: "uuid", - message: "string", - parentIds: "uuid", - scopeId: "uuid", - storeId: "uuid", - treeId: "uuid" + authorId: 'uuid', + committerId: 'uuid', + date: 'string', + id: 'uuid', + message: 'string', + parentIds: 'uuid', + scopeId: 'uuid', + storeId: 'uuid', + treeId: 'uuid', }; -const usage = "\nfunction-graph-commit \n\nCommands:\n list List functionGraphCommit records\n find-first Find first matching functionGraphCommit record\n get Get a functionGraphCommit by ID\n create Create a new functionGraphCommit\n update Update an existing functionGraphCommit\n delete Delete a functionGraphCommit\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-graph-commit \n\nCommands:\n list List functionGraphCommit records\n find-first Find first matching functionGraphCommit record\n get Get a functionGraphCommit by ID\n create Create a new functionGraphCommit\n update Update an existing functionGraphCommit\n delete Delete a functionGraphCommit\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq parentIds: true, scopeId: true, storeId: true, - treeId: true + treeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionGraphCommitSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + > & { + select: FunctionGraphCommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphCommit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter parentIds: true, scopeId: true, storeId: true, - treeId: true + treeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionGraphCommitSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + > & { + select: FunctionGraphCommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphCommit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionGraphCommit.findOne({ - id: answers.id as string, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.functionGraphCommit + .findOne({ + id: answers.id as string, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +178,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionGraphCommitInput["functionGraphCommit"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphCommitInput['functionGraphCommit']; const client = getClient(); - const result = await client.functionGraphCommit.create({ - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - scopeId: cleanedData.scopeId, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.functionGraphCommit + .create({ + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + scopeId: cleanedData.scopeId, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +276,102 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphCommitPatch; const client = getClient(); - const result = await client.functionGraphCommit.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.functionGraphCommit + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,34 +380,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionGraphCommit.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionGraphCommit + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-node-state.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-node-state.ts index 2991f72843..906bb7ea95 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-node-state.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-node-state.ts @@ -3,63 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionGraphExecutionNodeStateInput, FunctionGraphExecutionNodeStatePatch, FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphExecutionNodeStateInput, + FunctionGraphExecutionNodeStatePatch, + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - callbackInputs: "json", - callbackMeta: "json", - callbackTokenHash: "string", - completedAt: "string", - createdAt: "string", - errorCode: "string", - errorMessage: "string", - executionId: "uuid", - id: "uuid", - nodeName: "string", - nodePath: "string", - outputId: "uuid", - scopeId: "uuid", - startedAt: "string", - status: "string" + callbackInputs: 'json', + callbackMeta: 'json', + callbackTokenHash: 'string', + completedAt: 'string', + createdAt: 'string', + errorCode: 'string', + errorMessage: 'string', + executionId: 'uuid', + id: 'uuid', + nodeName: 'string', + nodePath: 'string', + outputId: 'uuid', + scopeId: 'uuid', + startedAt: 'string', + status: 'string', }; -const usage = "\nfunction-graph-execution-node-state \n\nCommands:\n list List functionGraphExecutionNodeState records\n find-first Find first matching functionGraphExecutionNodeState record\n get Get a functionGraphExecutionNodeState by ID\n create Create a new functionGraphExecutionNodeState\n update Update an existing functionGraphExecutionNodeState\n delete Delete a functionGraphExecutionNodeState\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-graph-execution-node-state \n\nCommands:\n list List functionGraphExecutionNodeState records\n find-first Find first matching functionGraphExecutionNodeState record\n get Get a functionGraphExecutionNodeState by ID\n create Create a new functionGraphExecutionNodeState\n update Update an existing functionGraphExecutionNodeState\n delete Delete a functionGraphExecutionNodeState\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -83,16 +97,22 @@ async function handleList(argv: Partial>, _prompter: Inq outputId: true, scopeId: true, startedAt: true, - status: true + status: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionGraphExecutionNodeStateSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: FunctionGraphExecutionNodeStateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphExecutionNodeState.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -116,16 +136,22 @@ async function handleFindFirst(argv: Partial>, _prompter outputId: true, scopeId: true, startedAt: true, - status: true + status: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionGraphExecutionNodeStateSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: FunctionGraphExecutionNodeStateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphExecutionNodeState.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -134,36 +160,40 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionGraphExecutionNodeState.findOne({ - id: answers.id as string, - select: { - callbackInputs: true, - callbackMeta: true, - callbackTokenHash: true, - completedAt: true, - createdAt: true, - errorCode: true, - errorMessage: true, - executionId: true, - id: true, - nodeName: true, - nodePath: true, - outputId: true, - scopeId: true, - startedAt: true, - status: true - } - }).execute(); + const result = await client.functionGraphExecutionNodeState + .findOne({ + id: answers.id as string, + select: { + callbackInputs: true, + callbackMeta: true, + callbackTokenHash: true, + completedAt: true, + createdAt: true, + errorCode: true, + errorMessage: true, + executionId: true, + id: true, + nodeName: true, + nodePath: true, + outputId: true, + scopeId: true, + startedAt: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -172,122 +202,141 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "callbackInputs", - message: "callbackInputs", - required: false, - skipPrompt: true - }, { - type: "json", - name: "callbackMeta", - message: "callbackMeta", - required: false, - skipPrompt: true - }, { - type: "text", - name: "callbackTokenHash", - message: "callbackTokenHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorCode", - message: "errorCode", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorMessage", - message: "errorMessage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionId", - message: "executionId", - required: true - }, { - type: "text", - name: "nodeName", - message: "nodeName", - required: true - }, { - type: "text", - name: "nodePath", - message: "nodePath", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputId", - message: "outputId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'callbackInputs', + message: 'callbackInputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'callbackMeta', + message: 'callbackMeta', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'callbackTokenHash', + message: 'callbackTokenHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCode', + message: 'errorCode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionId', + message: 'executionId', + required: true, + }, + { + type: 'text', + name: 'nodeName', + message: 'nodeName', + required: true, + }, + { + type: 'text', + name: 'nodePath', + message: 'nodePath', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputId', + message: 'outputId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionGraphExecutionNodeStateInput["functionGraphExecutionNodeState"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState']; const client = getClient(); - const result = await client.functionGraphExecutionNodeState.create({ - data: { - callbackInputs: cleanedData.callbackInputs, - callbackMeta: cleanedData.callbackMeta, - callbackTokenHash: cleanedData.callbackTokenHash, - completedAt: cleanedData.completedAt, - errorCode: cleanedData.errorCode, - errorMessage: cleanedData.errorMessage, - executionId: cleanedData.executionId, - nodeName: cleanedData.nodeName, - nodePath: cleanedData.nodePath, - outputId: cleanedData.outputId, - scopeId: cleanedData.scopeId, - startedAt: cleanedData.startedAt, - status: cleanedData.status - }, - select: { - callbackInputs: true, - callbackMeta: true, - callbackTokenHash: true, - completedAt: true, - createdAt: true, - errorCode: true, - errorMessage: true, - executionId: true, - id: true, - nodeName: true, - nodePath: true, - outputId: true, - scopeId: true, - startedAt: true, - status: true - } - }).execute(); + const result = await client.functionGraphExecutionNodeState + .create({ + data: { + callbackInputs: cleanedData.callbackInputs, + callbackMeta: cleanedData.callbackMeta, + callbackTokenHash: cleanedData.callbackTokenHash, + completedAt: cleanedData.completedAt, + errorCode: cleanedData.errorCode, + errorMessage: cleanedData.errorMessage, + executionId: cleanedData.executionId, + nodeName: cleanedData.nodeName, + nodePath: cleanedData.nodePath, + outputId: cleanedData.outputId, + scopeId: cleanedData.scopeId, + startedAt: cleanedData.startedAt, + status: cleanedData.status, + }, + select: { + callbackInputs: true, + callbackMeta: true, + callbackTokenHash: true, + completedAt: true, + createdAt: true, + errorCode: true, + errorMessage: true, + executionId: true, + id: true, + nodeName: true, + nodePath: true, + outputId: true, + scopeId: true, + startedAt: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -296,136 +345,157 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "json", - name: "callbackInputs", - message: "callbackInputs", - required: false, - skipPrompt: true - }, { - type: "json", - name: "callbackMeta", - message: "callbackMeta", - required: false, - skipPrompt: true - }, { - type: "text", - name: "callbackTokenHash", - message: "callbackTokenHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorCode", - message: "errorCode", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorMessage", - message: "errorMessage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionId", - message: "executionId", - required: false - }, { - type: "text", - name: "nodeName", - message: "nodeName", - required: false - }, { - type: "text", - name: "nodePath", - message: "nodePath", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputId", - message: "outputId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: false - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'json', + name: 'callbackInputs', + message: 'callbackInputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'callbackMeta', + message: 'callbackMeta', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'callbackTokenHash', + message: 'callbackTokenHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCode', + message: 'errorCode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionId', + message: 'executionId', + required: false, + }, + { + type: 'text', + name: 'nodeName', + message: 'nodeName', + required: false, + }, + { + type: 'text', + name: 'nodePath', + message: 'nodePath', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputId', + message: 'outputId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: false, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphExecutionNodeStatePatch; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as FunctionGraphExecutionNodeStatePatch; const client = getClient(); - const result = await client.functionGraphExecutionNodeState.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - callbackInputs: cleanedData.callbackInputs, - callbackMeta: cleanedData.callbackMeta, - callbackTokenHash: cleanedData.callbackTokenHash, - completedAt: cleanedData.completedAt, - errorCode: cleanedData.errorCode, - errorMessage: cleanedData.errorMessage, - executionId: cleanedData.executionId, - nodeName: cleanedData.nodeName, - nodePath: cleanedData.nodePath, - outputId: cleanedData.outputId, - scopeId: cleanedData.scopeId, - startedAt: cleanedData.startedAt, - status: cleanedData.status - }, - select: { - callbackInputs: true, - callbackMeta: true, - callbackTokenHash: true, - completedAt: true, - createdAt: true, - errorCode: true, - errorMessage: true, - executionId: true, - id: true, - nodeName: true, - nodePath: true, - outputId: true, - scopeId: true, - startedAt: true, - status: true - } - }).execute(); + const result = await client.functionGraphExecutionNodeState + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + callbackInputs: cleanedData.callbackInputs, + callbackMeta: cleanedData.callbackMeta, + callbackTokenHash: cleanedData.callbackTokenHash, + completedAt: cleanedData.completedAt, + errorCode: cleanedData.errorCode, + errorMessage: cleanedData.errorMessage, + executionId: cleanedData.executionId, + nodeName: cleanedData.nodeName, + nodePath: cleanedData.nodePath, + outputId: cleanedData.outputId, + scopeId: cleanedData.scopeId, + startedAt: cleanedData.startedAt, + status: cleanedData.status, + }, + select: { + callbackInputs: true, + callbackMeta: true, + callbackTokenHash: true, + completedAt: true, + createdAt: true, + errorCode: true, + errorMessage: true, + executionId: true, + id: true, + nodeName: true, + nodePath: true, + outputId: true, + scopeId: true, + startedAt: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -434,34 +504,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionGraphExecutionNodeState.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionGraphExecutionNodeState + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-output.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-output.ts index e76f4b216a..4f9e5fc99b 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-output.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-output.ts @@ -3,53 +3,67 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionGraphExecutionOutputInput, FunctionGraphExecutionOutputPatch, FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputFilter, FunctionGraphExecutionOutputOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphExecutionOutputInput, + FunctionGraphExecutionOutputPatch, + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - hash: "string", - id: "uuid", - scopeId: "uuid" + createdAt: 'string', + data: 'json', + hash: 'string', + id: 'uuid', + scopeId: 'uuid', }; -const usage = "\nfunction-graph-execution-output \n\nCommands:\n list List functionGraphExecutionOutput records\n find-first Find first matching functionGraphExecutionOutput record\n get Get a functionGraphExecutionOutput by ID\n create Create a new functionGraphExecutionOutput\n update Update an existing functionGraphExecutionOutput\n delete Delete a functionGraphExecutionOutput\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-graph-execution-output \n\nCommands:\n list List functionGraphExecutionOutput records\n find-first Find first matching functionGraphExecutionOutput record\n get Get a functionGraphExecutionOutput by ID\n create Create a new functionGraphExecutionOutput\n update Update an existing functionGraphExecutionOutput\n delete Delete a functionGraphExecutionOutput\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq data: true, hash: true, id: true, - scopeId: true + scopeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionGraphExecutionOutputSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: FunctionGraphExecutionOutputSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphExecutionOutput.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter data: true, hash: true, id: true, - scopeId: true + scopeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionGraphExecutionOutputSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: FunctionGraphExecutionOutputSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphExecutionOutput.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionGraphExecutionOutput.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - hash: true, - id: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphExecutionOutput + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + hash: true, + id: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,42 +162,51 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "hash", - message: "hash", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionGraphExecutionOutputInput["functionGraphExecutionOutput"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput']; const client = getClient(); - const result = await client.functionGraphExecutionOutput.create({ - data: { - data: cleanedData.data, - hash: cleanedData.hash, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - data: true, - hash: true, - id: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphExecutionOutput + .create({ + data: { + data: cleanedData.data, + hash: cleanedData.hash, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + data: true, + hash: true, + id: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -176,56 +215,64 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false - }, { - type: "text", - name: "hash", - message: "hash", - required: false - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphExecutionOutputPatch; const client = getClient(); - const result = await client.functionGraphExecutionOutput.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - data: cleanedData.data, - hash: cleanedData.hash, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - data: true, - hash: true, - id: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphExecutionOutput + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + data: cleanedData.data, + hash: cleanedData.hash, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + data: true, + hash: true, + id: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -234,34 +281,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionGraphExecutionOutput.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionGraphExecutionOutput + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} 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 b235758cd5..4b76c5f734 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 @@ -3,80 +3,94 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionGraphExecutionInput, FunctionGraphExecutionPatch, FunctionGraphExecutionSelect, FunctionGraphExecutionFilter, FunctionGraphExecutionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphExecutionInput, + FunctionGraphExecutionPatch, + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - completedAt: "string", - currentWave: "int", - definitionsCommitId: "uuid", - entityId: "uuid", - entityType: "string", - errorCode: "string", - errorMessage: "string", - executionPlan: "json", - graphId: "uuid", - id: "uuid", - inputPayload: "json", - invocationCreatedAt: "string", - invocationId: "uuid", - lastProgressAt: "string", - maxPendingJobs: "int", - maxTicks: "int", - nodeOutputs: "json", - organizationId: "uuid", - outputNames: "string", - outputNode: "string", - outputPayload: "json", - outputPort: "string", - parentExecutionId: "uuid", - parentInvocationId: "uuid", - parentNodeName: "string", - principalId: "uuid", - scopeId: "uuid", - startedAt: "string", - status: "string", - tickCount: "int", - timeoutAt: "string" + actorId: 'uuid', + completedAt: 'string', + currentWave: 'int', + definitionsCommitId: 'uuid', + entityId: 'uuid', + entityType: 'string', + errorCode: 'string', + errorMessage: 'string', + executionPlan: 'json', + graphId: 'uuid', + id: 'uuid', + inputPayload: 'json', + invocationCreatedAt: 'string', + invocationId: 'uuid', + lastProgressAt: 'string', + maxPendingJobs: 'int', + maxTicks: 'int', + nodeOutputs: 'json', + organizationId: 'uuid', + outputNames: 'string', + outputNode: 'string', + outputPayload: 'json', + outputPort: 'string', + parentExecutionId: 'uuid', + parentInvocationId: 'uuid', + parentNodeName: 'string', + principalId: 'uuid', + scopeId: 'uuid', + startedAt: 'string', + status: 'string', + tickCount: 'int', + timeoutAt: 'string', }; -const usage = "\nfunction-graph-execution \n\nCommands:\n list List functionGraphExecution records\n find-first Find first matching functionGraphExecution record\n get Get a functionGraphExecution by ID\n create Create a new functionGraphExecution\n update Update an existing functionGraphExecution\n delete Delete a functionGraphExecution\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-graph-execution \n\nCommands:\n list List functionGraphExecution records\n find-first Find first matching functionGraphExecution record\n get Get a functionGraphExecution by ID\n create Create a new functionGraphExecution\n update Update an existing functionGraphExecution\n delete Delete a functionGraphExecution\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -117,16 +131,22 @@ async function handleList(argv: Partial>, _prompter: Inq startedAt: true, status: true, tickCount: true, - timeoutAt: true + timeoutAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionGraphExecutionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + > & { + select: FunctionGraphExecutionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphExecution.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -167,16 +187,22 @@ async function handleFindFirst(argv: Partial>, _prompter startedAt: true, status: true, tickCount: true, - timeoutAt: true + timeoutAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionGraphExecutionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + > & { + select: FunctionGraphExecutionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphExecution.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -185,53 +211,57 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionGraphExecution.findOne({ - id: answers.id as string, - select: { - actorId: true, - completedAt: true, - currentWave: true, - definitionsCommitId: true, - entityId: true, - entityType: true, - errorCode: true, - errorMessage: true, - executionPlan: true, - graphId: true, - id: true, - inputPayload: true, - invocationCreatedAt: true, - invocationId: true, - lastProgressAt: true, - maxPendingJobs: true, - maxTicks: true, - nodeOutputs: true, - organizationId: true, - outputNames: true, - outputNode: true, - outputPayload: true, - outputPort: true, - parentExecutionId: true, - parentInvocationId: true, - parentNodeName: true, - principalId: true, - scopeId: true, - startedAt: true, - status: true, - tickCount: true, - timeoutAt: true - } - }).execute(); + const result = await client.functionGraphExecution + .findOne({ + id: answers.id as string, + select: { + actorId: true, + completedAt: true, + currentWave: true, + definitionsCommitId: true, + entityId: true, + entityType: true, + errorCode: true, + errorMessage: true, + executionPlan: true, + graphId: true, + id: true, + inputPayload: true, + invocationCreatedAt: true, + invocationId: true, + lastProgressAt: true, + maxPendingJobs: true, + maxTicks: true, + nodeOutputs: true, + organizationId: true, + outputNames: true, + outputNode: true, + outputPayload: true, + outputPort: true, + parentExecutionId: true, + parentInvocationId: true, + parentNodeName: true, + principalId: true, + scopeId: true, + startedAt: true, + status: true, + tickCount: true, + timeoutAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -240,266 +270,303 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentWave", - message: "currentWave", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionsCommitId", - message: "definitionsCommitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorCode", - message: "errorCode", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorMessage", - message: "errorMessage", - required: false, - skipPrompt: true - }, { - type: "json", - name: "executionPlan", - message: "executionPlan", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphId", - message: "graphId", - required: true - }, { - type: "json", - name: "inputPayload", - message: "inputPayload", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastProgressAt", - message: "lastProgressAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxPendingJobs", - message: "maxPendingJobs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxTicks", - message: "maxTicks", - required: false, - skipPrompt: true - }, { - type: "json", - name: "nodeOutputs", - message: "nodeOutputs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputNames", - message: "outputNames", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputNode", - message: "outputNode", - required: false, - skipPrompt: true - }, { - type: "json", - name: "outputPayload", - message: "outputPayload", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputPort", - message: "outputPort", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentExecutionId", - message: "parentExecutionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentInvocationId", - message: "parentInvocationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentNodeName", - message: "parentNodeName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "principalId", - message: "principalId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tickCount", - message: "tickCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutAt", - message: "timeoutAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentWave', + message: 'currentWave', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionsCommitId', + message: 'definitionsCommitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCode', + message: 'errorCode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'executionPlan', + message: 'executionPlan', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphId', + message: 'graphId', + required: true, + }, + { + type: 'json', + name: 'inputPayload', + message: 'inputPayload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastProgressAt', + message: 'lastProgressAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxPendingJobs', + message: 'maxPendingJobs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxTicks', + message: 'maxTicks', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'nodeOutputs', + message: 'nodeOutputs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputNames', + message: 'outputNames', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputNode', + message: 'outputNode', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'outputPayload', + message: 'outputPayload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputPort', + message: 'outputPort', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentExecutionId', + message: 'parentExecutionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentNodeName', + message: 'parentNodeName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalId', + message: 'principalId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tickCount', + message: 'tickCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutAt', + message: 'timeoutAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionGraphExecutionInput["functionGraphExecution"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphExecutionInput['functionGraphExecution']; const client = getClient(); - const result = await client.functionGraphExecution.create({ - data: { - actorId: cleanedData.actorId, - completedAt: cleanedData.completedAt, - currentWave: cleanedData.currentWave, - definitionsCommitId: cleanedData.definitionsCommitId, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - errorCode: cleanedData.errorCode, - errorMessage: cleanedData.errorMessage, - executionPlan: cleanedData.executionPlan, - graphId: cleanedData.graphId, - inputPayload: cleanedData.inputPayload, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - lastProgressAt: cleanedData.lastProgressAt, - maxPendingJobs: cleanedData.maxPendingJobs, - maxTicks: cleanedData.maxTicks, - nodeOutputs: cleanedData.nodeOutputs, - organizationId: cleanedData.organizationId, - outputNames: cleanedData.outputNames, - outputNode: cleanedData.outputNode, - outputPayload: cleanedData.outputPayload, - outputPort: cleanedData.outputPort, - parentExecutionId: cleanedData.parentExecutionId, - parentInvocationId: cleanedData.parentInvocationId, - parentNodeName: cleanedData.parentNodeName, - principalId: cleanedData.principalId, - scopeId: cleanedData.scopeId, - startedAt: cleanedData.startedAt, - status: cleanedData.status, - tickCount: cleanedData.tickCount, - timeoutAt: cleanedData.timeoutAt - }, - select: { - actorId: true, - completedAt: true, - currentWave: true, - definitionsCommitId: true, - entityId: true, - entityType: true, - errorCode: true, - errorMessage: true, - executionPlan: true, - graphId: true, - id: true, - inputPayload: true, - invocationCreatedAt: true, - invocationId: true, - lastProgressAt: true, - maxPendingJobs: true, - maxTicks: true, - nodeOutputs: true, - organizationId: true, - outputNames: true, - outputNode: true, - outputPayload: true, - outputPort: true, - parentExecutionId: true, - parentInvocationId: true, - parentNodeName: true, - principalId: true, - scopeId: true, - startedAt: true, - status: true, - tickCount: true, - timeoutAt: true - } - }).execute(); + const result = await client.functionGraphExecution + .create({ + data: { + actorId: cleanedData.actorId, + completedAt: cleanedData.completedAt, + currentWave: cleanedData.currentWave, + definitionsCommitId: cleanedData.definitionsCommitId, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + errorCode: cleanedData.errorCode, + errorMessage: cleanedData.errorMessage, + executionPlan: cleanedData.executionPlan, + graphId: cleanedData.graphId, + inputPayload: cleanedData.inputPayload, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + lastProgressAt: cleanedData.lastProgressAt, + maxPendingJobs: cleanedData.maxPendingJobs, + maxTicks: cleanedData.maxTicks, + nodeOutputs: cleanedData.nodeOutputs, + organizationId: cleanedData.organizationId, + outputNames: cleanedData.outputNames, + outputNode: cleanedData.outputNode, + outputPayload: cleanedData.outputPayload, + outputPort: cleanedData.outputPort, + parentExecutionId: cleanedData.parentExecutionId, + parentInvocationId: cleanedData.parentInvocationId, + parentNodeName: cleanedData.parentNodeName, + principalId: cleanedData.principalId, + scopeId: cleanedData.scopeId, + startedAt: cleanedData.startedAt, + status: cleanedData.status, + tickCount: cleanedData.tickCount, + timeoutAt: cleanedData.timeoutAt, + }, + select: { + actorId: true, + completedAt: true, + currentWave: true, + definitionsCommitId: true, + entityId: true, + entityType: true, + errorCode: true, + errorMessage: true, + executionPlan: true, + graphId: true, + id: true, + inputPayload: true, + invocationCreatedAt: true, + invocationId: true, + lastProgressAt: true, + maxPendingJobs: true, + maxTicks: true, + nodeOutputs: true, + organizationId: true, + outputNames: true, + outputNode: true, + outputPayload: true, + outputPort: true, + parentExecutionId: true, + parentInvocationId: true, + parentNodeName: true, + principalId: true, + scopeId: true, + startedAt: true, + status: true, + tickCount: true, + timeoutAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -508,273 +575,308 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentWave", - message: "currentWave", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionsCommitId", - message: "definitionsCommitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorCode", - message: "errorCode", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorMessage", - message: "errorMessage", - required: false, - skipPrompt: true - }, { - type: "json", - name: "executionPlan", - message: "executionPlan", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphId", - message: "graphId", - required: false - }, { - type: "json", - name: "inputPayload", - message: "inputPayload", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastProgressAt", - message: "lastProgressAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxPendingJobs", - message: "maxPendingJobs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxTicks", - message: "maxTicks", - required: false, - skipPrompt: true - }, { - type: "json", - name: "nodeOutputs", - message: "nodeOutputs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputNames", - message: "outputNames", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputNode", - message: "outputNode", - required: false, - skipPrompt: true - }, { - type: "json", - name: "outputPayload", - message: "outputPayload", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputPort", - message: "outputPort", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentExecutionId", - message: "parentExecutionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentInvocationId", - message: "parentInvocationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentNodeName", - message: "parentNodeName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "principalId", - message: "principalId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: false - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tickCount", - message: "tickCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutAt", - message: "timeoutAt", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentWave', + message: 'currentWave', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionsCommitId', + message: 'definitionsCommitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCode', + message: 'errorCode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'executionPlan', + message: 'executionPlan', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphId', + message: 'graphId', + required: false, + }, + { + type: 'json', + name: 'inputPayload', + message: 'inputPayload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastProgressAt', + message: 'lastProgressAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxPendingJobs', + message: 'maxPendingJobs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxTicks', + message: 'maxTicks', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'nodeOutputs', + message: 'nodeOutputs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputNames', + message: 'outputNames', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputNode', + message: 'outputNode', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'outputPayload', + message: 'outputPayload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputPort', + message: 'outputPort', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentExecutionId', + message: 'parentExecutionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentNodeName', + message: 'parentNodeName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalId', + message: 'principalId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tickCount', + message: 'tickCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutAt', + message: 'timeoutAt', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphExecutionPatch; const client = getClient(); - const result = await client.functionGraphExecution.update({ - where: { - id: answers.id as string, - startedAt: answers.startedAt as string - }, - data: { - actorId: cleanedData.actorId, - completedAt: cleanedData.completedAt, - currentWave: cleanedData.currentWave, - definitionsCommitId: cleanedData.definitionsCommitId, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - errorCode: cleanedData.errorCode, - errorMessage: cleanedData.errorMessage, - executionPlan: cleanedData.executionPlan, - graphId: cleanedData.graphId, - inputPayload: cleanedData.inputPayload, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - lastProgressAt: cleanedData.lastProgressAt, - maxPendingJobs: cleanedData.maxPendingJobs, - maxTicks: cleanedData.maxTicks, - nodeOutputs: cleanedData.nodeOutputs, - organizationId: cleanedData.organizationId, - outputNames: cleanedData.outputNames, - outputNode: cleanedData.outputNode, - outputPayload: cleanedData.outputPayload, - outputPort: cleanedData.outputPort, - parentExecutionId: cleanedData.parentExecutionId, - parentInvocationId: cleanedData.parentInvocationId, - parentNodeName: cleanedData.parentNodeName, - principalId: cleanedData.principalId, - scopeId: cleanedData.scopeId, - status: cleanedData.status, - tickCount: cleanedData.tickCount, - timeoutAt: cleanedData.timeoutAt - }, - select: { - actorId: true, - completedAt: true, - currentWave: true, - definitionsCommitId: true, - entityId: true, - entityType: true, - errorCode: true, - errorMessage: true, - executionPlan: true, - graphId: true, - id: true, - inputPayload: true, - invocationCreatedAt: true, - invocationId: true, - lastProgressAt: true, - maxPendingJobs: true, - maxTicks: true, - nodeOutputs: true, - organizationId: true, - outputNames: true, - outputNode: true, - outputPayload: true, - outputPort: true, - parentExecutionId: true, - parentInvocationId: true, - parentNodeName: true, - principalId: true, - scopeId: true, - startedAt: true, - status: true, - tickCount: true, - timeoutAt: true - } - }).execute(); + const result = await client.functionGraphExecution + .update({ + where: { + id: answers.id as string, + startedAt: answers.startedAt as string, + }, + data: { + actorId: cleanedData.actorId, + completedAt: cleanedData.completedAt, + currentWave: cleanedData.currentWave, + definitionsCommitId: cleanedData.definitionsCommitId, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + errorCode: cleanedData.errorCode, + errorMessage: cleanedData.errorMessage, + executionPlan: cleanedData.executionPlan, + graphId: cleanedData.graphId, + inputPayload: cleanedData.inputPayload, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + lastProgressAt: cleanedData.lastProgressAt, + maxPendingJobs: cleanedData.maxPendingJobs, + maxTicks: cleanedData.maxTicks, + nodeOutputs: cleanedData.nodeOutputs, + organizationId: cleanedData.organizationId, + outputNames: cleanedData.outputNames, + outputNode: cleanedData.outputNode, + outputPayload: cleanedData.outputPayload, + outputPort: cleanedData.outputPort, + parentExecutionId: cleanedData.parentExecutionId, + parentInvocationId: cleanedData.parentInvocationId, + parentNodeName: cleanedData.parentNodeName, + principalId: cleanedData.principalId, + scopeId: cleanedData.scopeId, + status: cleanedData.status, + tickCount: cleanedData.tickCount, + timeoutAt: cleanedData.timeoutAt, + }, + select: { + actorId: true, + completedAt: true, + currentWave: true, + definitionsCommitId: true, + entityId: true, + entityType: true, + errorCode: true, + errorMessage: true, + executionPlan: true, + graphId: true, + id: true, + inputPayload: true, + invocationCreatedAt: true, + invocationId: true, + lastProgressAt: true, + maxPendingJobs: true, + maxTicks: true, + nodeOutputs: true, + organizationId: true, + outputNames: true, + outputNode: true, + outputPayload: true, + outputPort: true, + parentExecutionId: true, + parentInvocationId: true, + parentNodeName: true, + principalId: true, + scopeId: true, + startedAt: true, + status: true, + tickCount: true, + timeoutAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -783,34 +885,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionGraphExecution.delete({ - where: { - id: answers.id as string, - startedAt: answers.startedAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionGraphExecution + .delete({ + where: { + id: answers.id as string, + startedAt: answers.startedAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-object.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-object.ts index 42649e38fc..6f945718d8 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph-object.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-object.ts @@ -3,54 +3,68 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionGraphObjectInput, FunctionGraphObjectPatch, FunctionGraphObjectSelect, FunctionGraphObjectFilter, FunctionGraphObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphObjectInput, + FunctionGraphObjectPatch, + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - id: "uuid", - kids: "uuid", - ktree: "string", - scopeId: "uuid" + createdAt: 'string', + data: 'json', + id: 'uuid', + kids: 'uuid', + ktree: 'string', + scopeId: 'uuid', }; -const usage = "\nfunction-graph-object \n\nCommands:\n list List functionGraphObject records\n find-first Find first matching functionGraphObject record\n get Get a functionGraphObject by ID\n create Create a new functionGraphObject\n update Update an existing functionGraphObject\n delete Delete a functionGraphObject\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-graph-object \n\nCommands:\n list List functionGraphObject records\n find-first Find first matching functionGraphObject record\n get Get a functionGraphObject by ID\n create Create a new functionGraphObject\n update Update an existing functionGraphObject\n delete Delete a functionGraphObject\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, kids: true, ktree: true, - scopeId: true + scopeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionGraphObjectSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + > & { + select: FunctionGraphObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphObject.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +109,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, kids: true, ktree: true, - scopeId: true + scopeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionGraphObjectSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + > & { + select: FunctionGraphObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphObject.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +133,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionGraphObject.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphObject + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,52 +166,62 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionGraphObjectInput["functionGraphObject"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphObjectInput['functionGraphObject']; const client = getClient(); - const result = await client.functionGraphObject.create({ - data: { - data: cleanedData.data, - kids: cleanedData.kids, - ktree: cleanedData.ktree, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphObject + .create({ + data: { + data: cleanedData.data, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -190,60 +230,68 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphObjectPatch; const client = getClient(); - const result = await client.functionGraphObject.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - data: cleanedData.data, - kids: cleanedData.kids, - ktree: cleanedData.ktree - }, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphObject + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + data: cleanedData.data, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + }, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -252,34 +300,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionGraphObject.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionGraphObject + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-ref.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-ref.ts index ba44417ed2..8c7f6f0a4b 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph-ref.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-ref.ts @@ -3,53 +3,67 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionGraphRefInput, FunctionGraphRefPatch, FunctionGraphRefSelect, FunctionGraphRefFilter, FunctionGraphRefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphRefInput, + FunctionGraphRefPatch, + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - commitId: "uuid", - id: "uuid", - name: "string", - scopeId: "uuid", - storeId: "uuid" + commitId: 'uuid', + id: 'uuid', + name: 'string', + scopeId: 'uuid', + storeId: 'uuid', }; -const usage = "\nfunction-graph-ref \n\nCommands:\n list List functionGraphRef records\n find-first Find first matching functionGraphRef record\n get Get a functionGraphRef by ID\n create Create a new functionGraphRef\n update Update an existing functionGraphRef\n delete Delete a functionGraphRef\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-graph-ref \n\nCommands:\n list List functionGraphRef records\n find-first Find first matching functionGraphRef record\n get Get a functionGraphRef by ID\n create Create a new functionGraphRef\n update Update an existing functionGraphRef\n delete Delete a functionGraphRef\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, name: true, scopeId: true, - storeId: true + storeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionGraphRefSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: FunctionGraphRefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphRef.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, name: true, scopeId: true, - storeId: true + storeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionGraphRefSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: FunctionGraphRefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphRef.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionGraphRef.findOne({ - id: answers.id as string, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.functionGraphRef + .findOne({ + id: answers.id as string, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,49 +154,59 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionGraphRefInput["functionGraphRef"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphRefInput['functionGraphRef']; const client = getClient(); - const result = await client.functionGraphRef.create({ - data: { - commitId: cleanedData.commitId, - name: cleanedData.name, - scopeId: cleanedData.scopeId, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.functionGraphRef + .create({ + data: { + commitId: cleanedData.commitId, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -183,57 +215,65 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphRefPatch; const client = getClient(); - const result = await client.functionGraphRef.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - commitId: cleanedData.commitId, - name: cleanedData.name, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.functionGraphRef + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + commitId: cleanedData.commitId, + name: cleanedData.name, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,34 +282,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionGraphRef.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionGraphRef + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-store.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-store.ts index d31540adc7..5f9446fc40 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph-store.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-store.ts @@ -3,53 +3,67 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionGraphStoreInput, FunctionGraphStorePatch, FunctionGraphStoreSelect, FunctionGraphStoreFilter, FunctionGraphStoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphStoreInput, + FunctionGraphStorePatch, + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - hash: "uuid", - id: "uuid", - name: "string", - scopeId: "uuid" + createdAt: 'string', + hash: 'uuid', + id: 'uuid', + name: 'string', + scopeId: 'uuid', }; -const usage = "\nfunction-graph-store \n\nCommands:\n list List functionGraphStore records\n find-first Find first matching functionGraphStore record\n get Get a functionGraphStore by ID\n create Create a new functionGraphStore\n update Update an existing functionGraphStore\n delete Delete a functionGraphStore\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-graph-store \n\nCommands:\n list List functionGraphStore records\n find-first Find first matching functionGraphStore record\n get Get a functionGraphStore by ID\n create Create a new functionGraphStore\n update Update an existing functionGraphStore\n delete Delete a functionGraphStore\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq hash: true, id: true, name: true, - scopeId: true + scopeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionGraphStoreSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + > & { + select: FunctionGraphStoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphStore.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter hash: true, id: true, name: true, - scopeId: true + scopeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionGraphStoreSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + > & { + select: FunctionGraphStoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraphStore.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionGraphStore.findOne({ - id: answers.id as string, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphStore + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,43 +162,52 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionGraphStoreInput["functionGraphStore"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphStoreInput['functionGraphStore']; const client = getClient(); - const result = await client.functionGraphStore.create({ - data: { - hash: cleanedData.hash, - name: cleanedData.name, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphStore + .create({ + data: { + hash: cleanedData.hash, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -177,51 +216,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphStorePatch; const client = getClient(); - const result = await client.functionGraphStore.update({ - where: { - id: answers.id as string - }, - data: { - hash: cleanedData.hash, - name: cleanedData.name, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.functionGraphStore + .update({ + where: { + id: answers.id as string, + }, + data: { + hash: cleanedData.hash, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -230,28 +276,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionGraphStore.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionGraphStore + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} 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 6cac3dc0fa..a83dd2610a 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts @@ -3,60 +3,74 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionGraphInput, FunctionGraphPatch, FunctionGraphSelect, FunctionGraphFilter, FunctionGraphOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphInput, + FunctionGraphPatch, + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - context: "string", - createdAt: "string", - createdBy: "uuid", - definitionsCommitId: "uuid", - description: "string", - id: "uuid", - isValid: "boolean", - name: "string", - scopeId: "uuid", - storeId: "uuid", - updatedAt: "string", - validationErrors: "json" + context: 'string', + createdAt: 'string', + createdBy: 'uuid', + definitionsCommitId: 'uuid', + description: 'string', + id: 'uuid', + isValid: 'boolean', + name: 'string', + scopeId: 'uuid', + storeId: 'uuid', + updatedAt: 'string', + validationErrors: 'json', }; -const usage = "\nfunction-graph \n\nCommands:\n list List functionGraph records\n find-first Find first matching functionGraph record\n get Get a functionGraph by ID\n create Create a new functionGraph\n update Update an existing functionGraph\n delete Delete a functionGraph\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-graph \n\nCommands:\n list List functionGraph records\n find-first Find first matching functionGraph record\n get Get a functionGraph by ID\n create Create a new functionGraph\n update Update an existing functionGraph\n delete Delete a functionGraph\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,18 @@ async function handleList(argv: Partial>, _prompter: Inq scopeId: true, storeId: true, updatedAt: true, - validationErrors: true + validationErrors: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionGraphSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: FunctionGraphSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraph.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +123,18 @@ async function handleFindFirst(argv: Partial>, _prompter scopeId: true, storeId: true, updatedAt: true, - validationErrors: true + validationErrors: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionGraphSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: FunctionGraphSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionGraph.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +143,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionGraph.findOne({ - id: answers.id as string, - select: { - context: true, - createdAt: true, - createdBy: true, - definitionsCommitId: true, - description: true, - id: true, - isValid: true, - name: true, - scopeId: true, - storeId: true, - updatedAt: true, - validationErrors: true - } - }).execute(); + const result = await client.functionGraph + .findOne({ + id: answers.id as string, + select: { + context: true, + createdAt: true, + createdBy: true, + definitionsCommitId: true, + description: true, + id: true, + isValid: true, + name: true, + scopeId: true, + storeId: true, + updatedAt: true, + validationErrors: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,85 +182,100 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "context", - message: "context", - required: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: true - }, { - type: "text", - name: "definitionsCommitId", - message: "definitionsCommitId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: true - }, { - type: "boolean", - name: "isValid", - message: "isValid", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }, { - type: "json", - name: "validationErrors", - message: "validationErrors", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'context', + message: 'context', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: true, + }, + { + type: 'text', + name: 'definitionsCommitId', + message: 'definitionsCommitId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: true, + }, + { + type: 'boolean', + name: 'isValid', + message: 'isValid', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'json', + name: 'validationErrors', + message: 'validationErrors', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionGraphInput["functionGraph"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphInput['functionGraph']; const client = getClient(); - const result = await client.functionGraph.create({ - data: { - context: cleanedData.context, - createdBy: cleanedData.createdBy, - definitionsCommitId: cleanedData.definitionsCommitId, - description: cleanedData.description, - isValid: cleanedData.isValid, - name: cleanedData.name, - scopeId: cleanedData.scopeId, - storeId: cleanedData.storeId, - validationErrors: cleanedData.validationErrors - }, - select: { - context: true, - createdAt: true, - createdBy: true, - definitionsCommitId: true, - description: true, - id: true, - isValid: true, - name: true, - scopeId: true, - storeId: true, - updatedAt: true, - validationErrors: true - } - }).execute(); + const result = await client.functionGraph + .create({ + data: { + context: cleanedData.context, + createdBy: cleanedData.createdBy, + definitionsCommitId: cleanedData.definitionsCommitId, + description: cleanedData.description, + isValid: cleanedData.isValid, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + storeId: cleanedData.storeId, + validationErrors: cleanedData.validationErrors, + }, + select: { + context: true, + createdAt: true, + createdBy: true, + definitionsCommitId: true, + description: true, + id: true, + isValid: true, + name: true, + scopeId: true, + storeId: true, + updatedAt: true, + validationErrors: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -247,93 +284,106 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "context", - message: "context", - required: false - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false - }, { - type: "text", - name: "definitionsCommitId", - message: "definitionsCommitId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false - }, { - type: "boolean", - name: "isValid", - message: "isValid", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: false - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }, { - type: "json", - name: "validationErrors", - message: "validationErrors", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'context', + message: 'context', + required: false, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + }, + { + type: 'text', + name: 'definitionsCommitId', + message: 'definitionsCommitId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + }, + { + type: 'boolean', + name: 'isValid', + message: 'isValid', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'json', + name: 'validationErrors', + message: 'validationErrors', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphPatch; const client = getClient(); - const result = await client.functionGraph.update({ - where: { - id: answers.id as string - }, - data: { - context: cleanedData.context, - createdBy: cleanedData.createdBy, - definitionsCommitId: cleanedData.definitionsCommitId, - description: cleanedData.description, - isValid: cleanedData.isValid, - name: cleanedData.name, - scopeId: cleanedData.scopeId, - storeId: cleanedData.storeId, - validationErrors: cleanedData.validationErrors - }, - select: { - context: true, - createdAt: true, - createdBy: true, - definitionsCommitId: true, - description: true, - id: true, - isValid: true, - name: true, - scopeId: true, - storeId: true, - updatedAt: true, - validationErrors: true - } - }).execute(); + const result = await client.functionGraph + .update({ + where: { + id: answers.id as string, + }, + data: { + context: cleanedData.context, + createdBy: cleanedData.createdBy, + definitionsCommitId: cleanedData.definitionsCommitId, + description: cleanedData.description, + isValid: cleanedData.isValid, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + storeId: cleanedData.storeId, + validationErrors: cleanedData.validationErrors, + }, + select: { + context: true, + createdAt: true, + createdBy: true, + definitionsCommitId: true, + description: true, + id: true, + isValid: true, + name: true, + scopeId: true, + storeId: true, + updatedAt: true, + validationErrors: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -342,28 +392,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionGraph.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionGraph + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-invocation-attempt.ts b/sdk/constructive-cli/src/compute/cli/commands/function-invocation-attempt.ts index de9be899a9..528c2362a6 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-invocation-attempt.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-invocation-attempt.ts @@ -3,61 +3,75 @@ * @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 { CreateFunctionInvocationAttemptInput, FunctionInvocationAttemptPatch, FunctionInvocationAttemptSelect, FunctionInvocationAttemptFilter, FunctionInvocationAttemptOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionInvocationAttemptInput, + FunctionInvocationAttemptPatch, + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - attempt: "int", - createdAt: "string", - databaseId: "uuid", - durationMs: "int", - error: "string", - errorDetail: "json", - id: "uuid", - invocationCreatedAt: "string", - invocationId: "uuid", - startedAt: "string", - success: "boolean", - taskIdentifier: "string" + actorId: 'uuid', + attempt: 'int', + createdAt: 'string', + databaseId: 'uuid', + durationMs: 'int', + error: 'string', + errorDetail: 'json', + id: 'uuid', + invocationCreatedAt: 'string', + invocationId: 'uuid', + startedAt: 'string', + success: 'boolean', + taskIdentifier: 'string', }; -const usage = "\nfunction-invocation-attempt \n\nCommands:\n list List functionInvocationAttempt records\n find-first Find first matching functionInvocationAttempt record\n get Get a functionInvocationAttempt by ID\n create Create a new functionInvocationAttempt\n update Update an existing functionInvocationAttempt\n delete Delete a functionInvocationAttempt\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) => { +const usage = + '\nfunction-invocation-attempt \n\nCommands:\n list List functionInvocationAttempt records\n find-first Find first matching functionInvocationAttempt record\n get Get a functionInvocationAttempt by ID\n create Create a new functionInvocationAttempt\n update Update an existing functionInvocationAttempt\n delete Delete a functionInvocationAttempt\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,22 @@ async function handleList(argv: Partial>, _prompter: Inq invocationId: true, startedAt: true, success: true, - taskIdentifier: true + taskIdentifier: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionInvocationAttemptSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy + > & { + select: FunctionInvocationAttemptSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionInvocationAttempt.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +130,22 @@ async function handleFindFirst(argv: Partial>, _prompter invocationId: true, startedAt: true, success: true, - taskIdentifier: true + taskIdentifier: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionInvocationAttemptSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy + > & { + select: FunctionInvocationAttemptSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionInvocationAttempt.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +154,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionInvocationAttempt.findOne({ - id: answers.id as string, - select: { - actorId: true, - attempt: true, - createdAt: true, - databaseId: true, - durationMs: true, - error: true, - errorDetail: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - startedAt: true, - success: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionInvocationAttempt + .findOne({ + id: answers.id as string, + select: { + actorId: true, + attempt: true, + createdAt: true, + databaseId: true, + durationMs: true, + error: true, + errorDetail: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + startedAt: true, + success: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,103 +194,120 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "attempt", - message: "attempt", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "durationMs", - message: "durationMs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "json", - name: "errorDetail", - message: "errorDetail", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "success", - message: "success", - required: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'attempt', + message: 'attempt', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'errorDetail', + message: 'errorDetail', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'success', + message: 'success', + required: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionInvocationAttemptInput["functionInvocationAttempt"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionInvocationAttemptInput['functionInvocationAttempt']; const client = getClient(); - const result = await client.functionInvocationAttempt.create({ - data: { - actorId: cleanedData.actorId, - attempt: cleanedData.attempt, - databaseId: cleanedData.databaseId, - durationMs: cleanedData.durationMs, - error: cleanedData.error, - errorDetail: cleanedData.errorDetail, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - startedAt: cleanedData.startedAt, - success: cleanedData.success, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - attempt: true, - createdAt: true, - databaseId: true, - durationMs: true, - error: true, - errorDetail: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - startedAt: true, - success: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionInvocationAttempt + .create({ + data: { + actorId: cleanedData.actorId, + attempt: cleanedData.attempt, + databaseId: cleanedData.databaseId, + durationMs: cleanedData.durationMs, + error: cleanedData.error, + errorDetail: cleanedData.errorDetail, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + startedAt: cleanedData.startedAt, + success: cleanedData.success, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + attempt: true, + createdAt: true, + databaseId: true, + durationMs: true, + error: true, + errorDetail: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + startedAt: true, + success: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -269,117 +316,133 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "attempt", - message: "attempt", - required: false - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "durationMs", - message: "durationMs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "json", - name: "errorDetail", - message: "errorDetail", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: false - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "success", - message: "success", - required: false - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'attempt', + message: 'attempt', + required: false, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'errorDetail', + message: 'errorDetail', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: false, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'success', + message: 'success', + required: false, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionInvocationAttemptPatch; const client = getClient(); - const result = await client.functionInvocationAttempt.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - attempt: cleanedData.attempt, - databaseId: cleanedData.databaseId, - durationMs: cleanedData.durationMs, - error: cleanedData.error, - errorDetail: cleanedData.errorDetail, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - startedAt: cleanedData.startedAt, - success: cleanedData.success, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - attempt: true, - createdAt: true, - databaseId: true, - durationMs: true, - error: true, - errorDetail: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - startedAt: true, - success: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionInvocationAttempt + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + attempt: cleanedData.attempt, + databaseId: cleanedData.databaseId, + durationMs: cleanedData.durationMs, + error: cleanedData.error, + errorDetail: cleanedData.errorDetail, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + startedAt: cleanedData.startedAt, + success: cleanedData.success, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + attempt: true, + createdAt: true, + databaseId: true, + durationMs: true, + error: true, + errorDetail: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + startedAt: true, + success: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -388,34 +451,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionInvocationAttempt.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionInvocationAttempt + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-invocation.ts b/sdk/constructive-cli/src/compute/cli/commands/function-invocation.ts index 4c8b000b03..28fb06f960 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-invocation.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-invocation.ts @@ -3,68 +3,82 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionInvocationInput, FunctionInvocationPatch, FunctionInvocationSelect, FunctionInvocationFilter, FunctionInvocationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionInvocationInput, + FunctionInvocationPatch, + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - apiBindingId: "uuid", - channel: "string", - completedAt: "string", - createdAt: "string", - databaseId: "uuid", - definitionScope: "string", - durationMs: "int", - error: "string", - functionDefinitionId: "uuid", - graphExecutionId: "uuid", - id: "uuid", - jobId: "int", - parentInvocationId: "uuid", - payload: "json", - provenance: "json", - result: "json", - startedAt: "string", - status: "string", - taskIdentifier: "string" + actorId: 'uuid', + apiBindingId: 'uuid', + channel: 'string', + completedAt: 'string', + createdAt: 'string', + databaseId: 'uuid', + definitionScope: 'string', + durationMs: 'int', + error: 'string', + functionDefinitionId: 'uuid', + graphExecutionId: 'uuid', + id: 'uuid', + jobId: 'int', + parentInvocationId: 'uuid', + payload: 'json', + provenance: 'json', + result: 'json', + startedAt: 'string', + status: 'string', + taskIdentifier: 'string', }; -const usage = "\nfunction-invocation \n\nCommands:\n list List functionInvocation records\n find-first Find first matching functionInvocation record\n get Get a functionInvocation by ID\n create Create a new functionInvocation\n update Update an existing functionInvocation\n delete Delete a functionInvocation\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-invocation \n\nCommands:\n list List functionInvocation records\n find-first Find first matching functionInvocation record\n get Get a functionInvocation by ID\n create Create a new functionInvocation\n update Update an existing functionInvocation\n delete Delete a functionInvocation\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,22 @@ async function handleList(argv: Partial>, _prompter: Inq result: true, startedAt: true, status: true, - taskIdentifier: true + taskIdentifier: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionInvocationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + > & { + select: FunctionInvocationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionInvocation.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +151,22 @@ async function handleFindFirst(argv: Partial>, _prompter result: true, startedAt: true, status: true, - taskIdentifier: true + taskIdentifier: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionInvocationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + > & { + select: FunctionInvocationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionInvocation.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +175,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionInvocation.findOne({ - id: answers.id as string, - select: { - actorId: true, - apiBindingId: true, - channel: true, - completedAt: true, - createdAt: true, - databaseId: true, - definitionScope: true, - durationMs: true, - error: true, - functionDefinitionId: true, - graphExecutionId: true, - id: true, - jobId: true, - parentInvocationId: true, - payload: true, - provenance: true, - result: true, - startedAt: true, - status: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionInvocation + .findOne({ + id: answers.id as string, + select: { + actorId: true, + apiBindingId: true, + channel: true, + completedAt: true, + createdAt: true, + databaseId: true, + definitionScope: true, + durationMs: true, + error: true, + functionDefinitionId: true, + graphExecutionId: true, + id: true, + jobId: true, + parentInvocationId: true, + payload: true, + provenance: true, + result: true, + startedAt: true, + status: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,163 +222,187 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiBindingId", - message: "apiBindingId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "channel", - message: "channel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "definitionScope", - message: "definitionScope", - required: false, - skipPrompt: true - }, { - type: "text", - name: "durationMs", - message: "durationMs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphExecutionId", - message: "graphExecutionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "jobId", - message: "jobId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentInvocationId", - message: "parentInvocationId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payload", - message: "payload", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provenance", - message: "provenance", - required: false, - skipPrompt: true - }, { - type: "json", - name: "result", - message: "result", - required: false, - skipPrompt: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiBindingId', + message: 'apiBindingId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'channel', + message: 'channel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'definitionScope', + message: 'definitionScope', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphExecutionId', + message: 'graphExecutionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'jobId', + message: 'jobId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provenance', + message: 'provenance', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionInvocationInput["functionInvocation"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionInvocationInput['functionInvocation']; const client = getClient(); - const result = await client.functionInvocation.create({ - data: { - actorId: cleanedData.actorId, - apiBindingId: cleanedData.apiBindingId, - channel: cleanedData.channel, - completedAt: cleanedData.completedAt, - databaseId: cleanedData.databaseId, - definitionScope: cleanedData.definitionScope, - durationMs: cleanedData.durationMs, - error: cleanedData.error, - functionDefinitionId: cleanedData.functionDefinitionId, - graphExecutionId: cleanedData.graphExecutionId, - jobId: cleanedData.jobId, - parentInvocationId: cleanedData.parentInvocationId, - payload: cleanedData.payload, - provenance: cleanedData.provenance, - result: cleanedData.result, - startedAt: cleanedData.startedAt, - status: cleanedData.status, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - apiBindingId: true, - channel: true, - completedAt: true, - createdAt: true, - databaseId: true, - definitionScope: true, - durationMs: true, - error: true, - functionDefinitionId: true, - graphExecutionId: true, - id: true, - jobId: true, - parentInvocationId: true, - payload: true, - provenance: true, - result: true, - startedAt: true, - status: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionInvocation + .create({ + data: { + actorId: cleanedData.actorId, + apiBindingId: cleanedData.apiBindingId, + channel: cleanedData.channel, + completedAt: cleanedData.completedAt, + databaseId: cleanedData.databaseId, + definitionScope: cleanedData.definitionScope, + durationMs: cleanedData.durationMs, + error: cleanedData.error, + functionDefinitionId: cleanedData.functionDefinitionId, + graphExecutionId: cleanedData.graphExecutionId, + jobId: cleanedData.jobId, + parentInvocationId: cleanedData.parentInvocationId, + payload: cleanedData.payload, + provenance: cleanedData.provenance, + result: cleanedData.result, + startedAt: cleanedData.startedAt, + status: cleanedData.status, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + apiBindingId: true, + channel: true, + completedAt: true, + createdAt: true, + databaseId: true, + definitionScope: true, + durationMs: true, + error: true, + functionDefinitionId: true, + graphExecutionId: true, + id: true, + jobId: true, + parentInvocationId: true, + payload: true, + provenance: true, + result: true, + startedAt: true, + status: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -357,177 +411,200 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiBindingId", - message: "apiBindingId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "channel", - message: "channel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "definitionScope", - message: "definitionScope", - required: false, - skipPrompt: true - }, { - type: "text", - name: "durationMs", - message: "durationMs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphExecutionId", - message: "graphExecutionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "jobId", - message: "jobId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentInvocationId", - message: "parentInvocationId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payload", - message: "payload", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provenance", - message: "provenance", - required: false, - skipPrompt: true - }, { - type: "json", - name: "result", - message: "result", - required: false, - skipPrompt: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiBindingId', + message: 'apiBindingId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'channel', + message: 'channel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'definitionScope', + message: 'definitionScope', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphExecutionId', + message: 'graphExecutionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'jobId', + message: 'jobId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provenance', + message: 'provenance', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionInvocationPatch; const client = getClient(); - const result = await client.functionInvocation.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - apiBindingId: cleanedData.apiBindingId, - channel: cleanedData.channel, - completedAt: cleanedData.completedAt, - databaseId: cleanedData.databaseId, - definitionScope: cleanedData.definitionScope, - durationMs: cleanedData.durationMs, - error: cleanedData.error, - functionDefinitionId: cleanedData.functionDefinitionId, - graphExecutionId: cleanedData.graphExecutionId, - jobId: cleanedData.jobId, - parentInvocationId: cleanedData.parentInvocationId, - payload: cleanedData.payload, - provenance: cleanedData.provenance, - result: cleanedData.result, - startedAt: cleanedData.startedAt, - status: cleanedData.status, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - apiBindingId: true, - channel: true, - completedAt: true, - createdAt: true, - databaseId: true, - definitionScope: true, - durationMs: true, - error: true, - functionDefinitionId: true, - graphExecutionId: true, - id: true, - jobId: true, - parentInvocationId: true, - payload: true, - provenance: true, - result: true, - startedAt: true, - status: true, - taskIdentifier: true - } - }).execute(); + const result = await client.functionInvocation + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + apiBindingId: cleanedData.apiBindingId, + channel: cleanedData.channel, + completedAt: cleanedData.completedAt, + databaseId: cleanedData.databaseId, + definitionScope: cleanedData.definitionScope, + durationMs: cleanedData.durationMs, + error: cleanedData.error, + functionDefinitionId: cleanedData.functionDefinitionId, + graphExecutionId: cleanedData.graphExecutionId, + jobId: cleanedData.jobId, + parentInvocationId: cleanedData.parentInvocationId, + payload: cleanedData.payload, + provenance: cleanedData.provenance, + result: cleanedData.result, + startedAt: cleanedData.startedAt, + status: cleanedData.status, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + apiBindingId: true, + channel: true, + completedAt: true, + createdAt: true, + databaseId: true, + definitionScope: true, + durationMs: true, + error: true, + functionDefinitionId: true, + graphExecutionId: true, + id: true, + jobId: true, + parentInvocationId: true, + payload: true, + provenance: true, + result: true, + startedAt: true, + status: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -536,34 +613,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionInvocation.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionInvocation + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/get-all-tree-nodes-record.ts b/sdk/constructive-cli/src/compute/cli/commands/get-all-tree-nodes-record.ts index cc6e9135c9..31c495de36 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/get-all-tree-nodes-record.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/get-all-tree-nodes-record.ts @@ -3,44 +3,58 @@ * @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 { CreateGetAllTreeNodesRecordInput, GetAllTreeNodesRecordPatch, GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateGetAllTreeNodesRecordInput, + GetAllTreeNodesRecordPatch, + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - data: "json", - path: "string" + data: 'json', + path: 'string', }; -const usage = "\nget-all-tree-nodes-record \n\nCommands:\n list List getAllTreeNodesRecord records\n find-first Find first matching getAllTreeNodesRecord record\n create Create a new getAllTreeNodesRecord\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) => { +const usage = + '\nget-all-tree-nodes-record \n\nCommands:\n list List getAllTreeNodesRecord records\n find-first Find first matching getAllTreeNodesRecord record\n create Create a new getAllTreeNodesRecord\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -51,16 +65,22 @@ async function handleList(argv: Partial>, _prompter: Inq try { const defaultSelect = { data: true, - path: true + path: true, }; - const findManyArgs = parseFindManyArgs & { - select: GetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + > & { + select: GetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.getAllTreeNodesRecord.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -71,16 +91,22 @@ async function handleFindFirst(argv: Partial>, _prompter try { const defaultSelect = { data: true, - path: true + path: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: GetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + > & { + select: GetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.getAllTreeNodesRecord.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -89,36 +115,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "path", - message: "path", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateGetAllTreeNodesRecordInput["getAllTreeNodesRecord"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateGetAllTreeNodesRecordInput['getAllTreeNodesRecord']; const client = getClient(); - const result = await client.getAllTreeNodesRecord.create({ - data: { - data: cleanedData.data, - path: cleanedData.path - }, - select: { - data: true, - path: true - } - }).execute(); + const result = await client.getAllTreeNodesRecord + .create({ + data: { + data: cleanedData.data, + path: cleanedData.path, + }, + select: { + data: true, + path: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/import-definitions.ts b/sdk/constructive-cli/src/compute/cli/commands/import-definitions.ts index 094b4e486f..9f5fa2daa9 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/import-definitions.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/import-definitions.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ImportDefinitionsVariables } from "../../orm/mutation"; -import type { ImportDefinitionsPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ImportDefinitionsVariables } from '../../orm/mutation'; +import type { ImportDefinitionsPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("import-definitions - importDefinitions\n\nUsage: import-definitions [OPTIONS]\n"); + console.log( + 'import-definitions - importDefinitions\n\nUsage: import-definitions [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.importDefinitions(parsedAnswers as unknown as ImportDefinitionsVariables, { - select: selectFields - } as unknown as { - select: ImportDefinitionsPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .importDefinitions( + parsedAnswers as unknown as ImportDefinitionsVariables, + { + select: selectFields, + } as unknown as { + select: ImportDefinitionsPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: importDefinitions"); + console.error('Failed: importDefinitions'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/import-graph-json.ts b/sdk/constructive-cli/src/compute/cli/commands/import-graph-json.ts index 90d4a5bdf5..cbe653e98e 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/import-graph-json.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/import-graph-json.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ImportGraphJsonVariables } from "../../orm/mutation"; -import type { ImportGraphJsonPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ImportGraphJsonVariables } from '../../orm/mutation'; +import type { ImportGraphJsonPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("import-graph-json - importGraphJson\n\nUsage: import-graph-json [OPTIONS]\n"); + console.log('import-graph-json - importGraphJson\n\nUsage: import-graph-json [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.importGraphJson(parsedAnswers as unknown as ImportGraphJsonVariables, { - select: selectFields - } as unknown as { - select: ImportGraphJsonPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .importGraphJson( + parsedAnswers as unknown as ImportGraphJsonVariables, + { + select: selectFields, + } as unknown as { + select: ImportGraphJsonPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: importGraphJson"); + console.error('Failed: importGraphJson'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/infra-commit.ts b/sdk/constructive-cli/src/compute/cli/commands/infra-commit.ts index a903613c77..6a335f7946 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/infra-commit.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/infra-commit.ts @@ -3,57 +3,71 @@ * @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 { CreateInfraCommitInput, InfraCommitPatch, InfraCommitSelect, InfraCommitFilter, InfraCommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInfraCommitInput, + InfraCommitPatch, + InfraCommitSelect, + InfraCommitFilter, + InfraCommitOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - authorId: "uuid", - committerId: "uuid", - databaseId: "uuid", - date: "string", - id: "uuid", - message: "string", - parentIds: "uuid", - storeId: "uuid", - treeId: "uuid" + authorId: 'uuid', + committerId: 'uuid', + databaseId: 'uuid', + date: 'string', + id: 'uuid', + message: 'string', + parentIds: 'uuid', + storeId: 'uuid', + treeId: 'uuid', }; -const usage = "\ninfra-commit \n\nCommands:\n list List infraCommit records\n find-first Find first matching infraCommit record\n get Get a infraCommit by ID\n create Create a new infraCommit\n update Update an existing infraCommit\n delete Delete a infraCommit\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) => { +const usage = + '\ninfra-commit \n\nCommands:\n list List infraCommit records\n find-first Find first matching infraCommit record\n get Get a infraCommit by ID\n create Create a new infraCommit\n update Update an existing infraCommit\n delete Delete a infraCommit\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq message: true, parentIds: true, storeId: true, - treeId: true + treeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: InfraCommitSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: InfraCommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraCommit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter message: true, parentIds: true, storeId: true, - treeId: true + treeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InfraCommitSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: InfraCommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraCommit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.infraCommit.findOne({ - id: answers.id as string, - select: { - authorId: true, - committerId: true, - databaseId: true, - date: true, - id: true, - message: true, - parentIds: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.infraCommit + .findOne({ + id: answers.id as string, + select: { + authorId: true, + committerId: true, + databaseId: true, + date: true, + id: true, + message: true, + parentIds: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +170,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraCommitInput["infraCommit"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateInfraCommitInput['infraCommit']; const client = getClient(); - const result = await client.infraCommit.create({ - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - databaseId: cleanedData.databaseId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - databaseId: true, - date: true, - id: true, - message: true, - parentIds: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.infraCommit + .create({ + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + databaseId: cleanedData.databaseId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + databaseId: true, + date: true, + id: true, + message: true, + parentIds: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +268,102 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InfraCommitPatch; const client = getClient(); - const result = await client.infraCommit.update({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - databaseId: true, - date: true, - id: true, - message: true, - parentIds: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.infraCommit + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + databaseId: true, + date: true, + id: true, + message: true, + parentIds: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,34 +372,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.infraCommit.delete({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.infraCommit + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/infra-get-all-tree-nodes-record.ts b/sdk/constructive-cli/src/compute/cli/commands/infra-get-all-tree-nodes-record.ts index 7ab6446e87..e269d06e08 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/infra-get-all-tree-nodes-record.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/infra-get-all-tree-nodes-record.ts @@ -3,44 +3,58 @@ * @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 { CreateInfraGetAllTreeNodesRecordInput, InfraGetAllTreeNodesRecordPatch, InfraGetAllTreeNodesRecordSelect, InfraGetAllTreeNodesRecordFilter, InfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInfraGetAllTreeNodesRecordInput, + InfraGetAllTreeNodesRecordPatch, + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - data: "json", - path: "string" + data: 'json', + path: 'string', }; -const usage = "\ninfra-get-all-tree-nodes-record \n\nCommands:\n list List infraGetAllTreeNodesRecord records\n find-first Find first matching infraGetAllTreeNodesRecord record\n create Create a new infraGetAllTreeNodesRecord\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) => { +const usage = + '\ninfra-get-all-tree-nodes-record \n\nCommands:\n list List infraGetAllTreeNodesRecord records\n find-first Find first matching infraGetAllTreeNodesRecord record\n create Create a new infraGetAllTreeNodesRecord\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -51,16 +65,22 @@ async function handleList(argv: Partial>, _prompter: Inq try { const defaultSelect = { data: true, - path: true + path: true, }; - const findManyArgs = parseFindManyArgs & { - select: InfraGetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy + > & { + select: InfraGetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraGetAllTreeNodesRecord.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -71,16 +91,22 @@ async function handleFindFirst(argv: Partial>, _prompter try { const defaultSelect = { data: true, - path: true + path: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InfraGetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy + > & { + select: InfraGetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraGetAllTreeNodesRecord.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -89,36 +115,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "path", - message: "path", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraGetAllTreeNodesRecordInput["infraGetAllTreeNodesRecord"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateInfraGetAllTreeNodesRecordInput['infraGetAllTreeNodesRecord']; const client = getClient(); - const result = await client.infraGetAllTreeNodesRecord.create({ - data: { - data: cleanedData.data, - path: cleanedData.path - }, - select: { - data: true, - path: true - } - }).execute(); + const result = await client.infraGetAllTreeNodesRecord + .create({ + data: { + data: cleanedData.data, + path: cleanedData.path, + }, + select: { + data: true, + path: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/infra-init-empty-repo.ts b/sdk/constructive-cli/src/compute/cli/commands/infra-init-empty-repo.ts index e2eec117e7..1178351d1e 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/infra-init-empty-repo.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/infra-init-empty-repo.ts @@ -3,37 +3,51 @@ * @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 { InfraInitEmptyRepoVariables } from "../../orm/mutation"; -import type { InfraInitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InfraInitEmptyRepoVariables } from '../../orm/mutation'; +import type { InfraInitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("infra-init-empty-repo - infraInitEmptyRepo\n\nUsage: infra-init-empty-repo [OPTIONS]\n"); + console.log( + 'infra-init-empty-repo - infraInitEmptyRepo\n\nUsage: infra-init-empty-repo [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.infraInitEmptyRepo(parsedAnswers as unknown as InfraInitEmptyRepoVariables, { - select: selectFields - } as unknown as { - select: InfraInitEmptyRepoPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .infraInitEmptyRepo( + parsedAnswers as unknown as InfraInitEmptyRepoVariables, + { + select: selectFields, + } as unknown as { + select: InfraInitEmptyRepoPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: infraInitEmptyRepo"); + console.error('Failed: infraInitEmptyRepo'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/infra-insert-node-at-path.ts b/sdk/constructive-cli/src/compute/cli/commands/infra-insert-node-at-path.ts index e23889816a..f5c871f585 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/infra-insert-node-at-path.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/infra-insert-node-at-path.ts @@ -3,37 +3,51 @@ * @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 { InfraInsertNodeAtPathVariables } from "../../orm/mutation"; -import type { InfraInsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InfraInsertNodeAtPathVariables } from '../../orm/mutation'; +import type { InfraInsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("infra-insert-node-at-path - infraInsertNodeAtPath\n\nUsage: infra-insert-node-at-path [OPTIONS]\n"); + console.log( + 'infra-insert-node-at-path - infraInsertNodeAtPath\n\nUsage: infra-insert-node-at-path [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.infraInsertNodeAtPath(parsedAnswers as unknown as InfraInsertNodeAtPathVariables, { - select: selectFields - } as unknown as { - select: InfraInsertNodeAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .infraInsertNodeAtPath( + parsedAnswers as unknown as InfraInsertNodeAtPathVariables, + { + select: selectFields, + } as unknown as { + select: InfraInsertNodeAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: infraInsertNodeAtPath"); + console.error('Failed: infraInsertNodeAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/infra-object.ts b/sdk/constructive-cli/src/compute/cli/commands/infra-object.ts index abb6be14b7..652ef012eb 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/infra-object.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/infra-object.ts @@ -3,54 +3,68 @@ * @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 { CreateInfraObjectInput, InfraObjectPatch, InfraObjectSelect, InfraObjectFilter, InfraObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInfraObjectInput, + InfraObjectPatch, + InfraObjectSelect, + InfraObjectFilter, + InfraObjectOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - databaseId: "uuid", - id: "uuid", - kids: "uuid", - ktree: "string" + createdAt: 'string', + data: 'json', + databaseId: 'uuid', + id: 'uuid', + kids: 'uuid', + ktree: 'string', }; -const usage = "\ninfra-object \n\nCommands:\n list List infraObject records\n find-first Find first matching infraObject record\n get Get a infraObject by ID\n create Create a new infraObject\n update Update an existing infraObject\n delete Delete a infraObject\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) => { +const usage = + '\ninfra-object \n\nCommands:\n list List infraObject records\n find-first Find first matching infraObject record\n get Get a infraObject by ID\n create Create a new infraObject\n update Update an existing infraObject\n delete Delete a infraObject\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, kids: true, - ktree: true + ktree: true, }; - const findManyArgs = parseFindManyArgs & { - select: InfraObjectSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: InfraObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraObject.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, kids: true, - ktree: true + ktree: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InfraObjectSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: InfraObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraObject.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.infraObject.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - kids: true, - ktree: true - } - }).execute(); + const result = await client.infraObject + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + kids: true, + ktree: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,52 +158,62 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraObjectInput["infraObject"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateInfraObjectInput['infraObject']; const client = getClient(); - const result = await client.infraObject.create({ - data: { - data: cleanedData.data, - databaseId: cleanedData.databaseId, - kids: cleanedData.kids, - ktree: cleanedData.ktree - }, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - kids: true, - ktree: true - } - }).execute(); + const result = await client.infraObject + .create({ + data: { + data: cleanedData.data, + databaseId: cleanedData.databaseId, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + }, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + kids: true, + ktree: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -190,60 +222,68 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InfraObjectPatch; const client = getClient(); - const result = await client.infraObject.update({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - data: { - data: cleanedData.data, - kids: cleanedData.kids, - ktree: cleanedData.ktree - }, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - kids: true, - ktree: true - } - }).execute(); + const result = await client.infraObject + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + data: cleanedData.data, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + }, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + kids: true, + ktree: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -252,34 +292,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.infraObject.delete({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.infraObject + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/infra-ref.ts b/sdk/constructive-cli/src/compute/cli/commands/infra-ref.ts index 637b2edf4d..452459e389 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/infra-ref.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/infra-ref.ts @@ -3,53 +3,67 @@ * @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 { CreateInfraRefInput, InfraRefPatch, InfraRefSelect, InfraRefFilter, InfraRefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInfraRefInput, + InfraRefPatch, + InfraRefSelect, + InfraRefFilter, + InfraRefOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - commitId: "uuid", - databaseId: "uuid", - id: "uuid", - name: "string", - storeId: "uuid" + commitId: 'uuid', + databaseId: 'uuid', + id: 'uuid', + name: 'string', + storeId: 'uuid', }; -const usage = "\ninfra-ref \n\nCommands:\n list List infraRef records\n find-first Find first matching infraRef record\n get Get a infraRef by ID\n create Create a new infraRef\n update Update an existing infraRef\n delete Delete a infraRef\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) => { +const usage = + '\ninfra-ref \n\nCommands:\n list List infraRef records\n find-first Find first matching infraRef record\n get Get a infraRef by ID\n create Create a new infraRef\n update Update an existing infraRef\n delete Delete a infraRef\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, name: true, - storeId: true + storeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: InfraRefSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: InfraRefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraRef.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, name: true, - storeId: true + storeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InfraRefSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: InfraRefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraRef.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.infraRef.findOne({ - id: answers.id as string, - select: { - commitId: true, - databaseId: true, - id: true, - name: true, - storeId: true - } - }).execute(); + const result = await client.infraRef + .findOne({ + id: answers.id as string, + select: { + commitId: true, + databaseId: true, + id: true, + name: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,49 +154,56 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraRefInput["infraRef"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraRefInput['infraRef']; const client = getClient(); - const result = await client.infraRef.create({ - data: { - commitId: cleanedData.commitId, - databaseId: cleanedData.databaseId, - name: cleanedData.name, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - databaseId: true, - id: true, - name: true, - storeId: true - } - }).execute(); + const result = await client.infraRef + .create({ + data: { + commitId: cleanedData.commitId, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + databaseId: true, + id: true, + name: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -183,57 +212,65 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InfraRefPatch; const client = getClient(); - const result = await client.infraRef.update({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - data: { - commitId: cleanedData.commitId, - name: cleanedData.name, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - databaseId: true, - id: true, - name: true, - storeId: true - } - }).execute(); + const result = await client.infraRef + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + commitId: cleanedData.commitId, + name: cleanedData.name, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + databaseId: true, + id: true, + name: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,34 +279,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.infraRef.delete({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.infraRef + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/infra-set-data-at-path.ts b/sdk/constructive-cli/src/compute/cli/commands/infra-set-data-at-path.ts index e86ed44a5c..63fa0bf97a 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/infra-set-data-at-path.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/infra-set-data-at-path.ts @@ -3,37 +3,51 @@ * @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 { InfraSetDataAtPathVariables } from "../../orm/mutation"; -import type { InfraSetDataAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InfraSetDataAtPathVariables } from '../../orm/mutation'; +import type { InfraSetDataAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("infra-set-data-at-path - infraSetDataAtPath\n\nUsage: infra-set-data-at-path [OPTIONS]\n"); + console.log( + 'infra-set-data-at-path - infraSetDataAtPath\n\nUsage: infra-set-data-at-path [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.infraSetDataAtPath(parsedAnswers as unknown as InfraSetDataAtPathVariables, { - select: selectFields - } as unknown as { - select: InfraSetDataAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .infraSetDataAtPath( + parsedAnswers as unknown as InfraSetDataAtPathVariables, + { + select: selectFields, + } as unknown as { + select: InfraSetDataAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: infraSetDataAtPath"); + console.error('Failed: infraSetDataAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/infra-store.ts b/sdk/constructive-cli/src/compute/cli/commands/infra-store.ts index 2db30d3a1e..37f6ff60db 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/infra-store.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/infra-store.ts @@ -3,53 +3,67 @@ * @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 { CreateInfraStoreInput, InfraStorePatch, InfraStoreSelect, InfraStoreFilter, InfraStoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInfraStoreInput, + InfraStorePatch, + InfraStoreSelect, + InfraStoreFilter, + InfraStoreOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - hash: "uuid", - id: "uuid", - name: "string" + createdAt: 'string', + databaseId: 'uuid', + hash: 'uuid', + id: 'uuid', + name: 'string', }; -const usage = "\ninfra-store \n\nCommands:\n list List infraStore records\n find-first Find first matching infraStore record\n get Get a infraStore by ID\n create Create a new infraStore\n update Update an existing infraStore\n delete Delete a infraStore\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) => { +const usage = + '\ninfra-store \n\nCommands:\n list List infraStore records\n find-first Find first matching infraStore record\n get Get a infraStore by ID\n create Create a new infraStore\n update Update an existing infraStore\n delete Delete a infraStore\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, hash: true, id: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: InfraStoreSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: InfraStoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraStore.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, hash: true, id: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InfraStoreSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: InfraStoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraStore.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.infraStore.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - hash: true, - id: true, - name: true - } - }).execute(); + const result = await client.infraStore + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + hash: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,43 +154,49 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraStoreInput["infraStore"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraStoreInput['infraStore']; const client = getClient(); - const result = await client.infraStore.create({ - data: { - databaseId: cleanedData.databaseId, - hash: cleanedData.hash, - name: cleanedData.name - }, - select: { - createdAt: true, - databaseId: true, - hash: true, - id: true, - name: true - } - }).execute(); + const result = await client.infraStore + .create({ + data: { + databaseId: cleanedData.databaseId, + hash: cleanedData.hash, + name: cleanedData.name, + }, + select: { + createdAt: true, + databaseId: true, + hash: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -177,51 +205,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + 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: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InfraStorePatch; const client = getClient(); - const result = await client.infraStore.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - hash: cleanedData.hash, - name: cleanedData.name - }, - select: { - createdAt: true, - databaseId: true, - hash: true, - id: true, - name: true - } - }).execute(); + const result = await client.infraStore + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + hash: cleanedData.hash, + name: cleanedData.name, + }, + select: { + createdAt: true, + databaseId: true, + hash: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -230,28 +265,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.infraStore.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.infraStore + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/init-empty-repo.ts b/sdk/constructive-cli/src/compute/cli/commands/init-empty-repo.ts index 86f98c3e31..85713a6542 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/init-empty-repo.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/init-empty-repo.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { InitEmptyRepoVariables } from "../../orm/mutation"; -import type { InitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InitEmptyRepoVariables } from '../../orm/mutation'; +import type { InitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("init-empty-repo - initEmptyRepo\n\nUsage: init-empty-repo [OPTIONS]\n"); + console.log('init-empty-repo - initEmptyRepo\n\nUsage: init-empty-repo [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.initEmptyRepo(parsedAnswers as unknown as InitEmptyRepoVariables, { - select: selectFields - } as unknown as { - select: InitEmptyRepoPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .initEmptyRepo( + parsedAnswers as unknown as InitEmptyRepoVariables, + { + select: selectFields, + } as unknown as { + select: InitEmptyRepoPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: initEmptyRepo"); + console.error('Failed: initEmptyRepo'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/insert-node-at-path.ts b/sdk/constructive-cli/src/compute/cli/commands/insert-node-at-path.ts index 82b25fe228..ded4cd5bb8 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/insert-node-at-path.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/insert-node-at-path.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { InsertNodeAtPathVariables } from "../../orm/mutation"; -import type { InsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InsertNodeAtPathVariables } from '../../orm/mutation'; +import type { InsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("insert-node-at-path - insertNodeAtPath\n\nUsage: insert-node-at-path [OPTIONS]\n"); + console.log( + 'insert-node-at-path - insertNodeAtPath\n\nUsage: insert-node-at-path [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.insertNodeAtPath(parsedAnswers as unknown as InsertNodeAtPathVariables, { - select: selectFields - } as unknown as { - select: InsertNodeAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .insertNodeAtPath( + parsedAnswers as unknown as InsertNodeAtPathVariables, + { + select: selectFields, + } as unknown as { + select: InsertNodeAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: insertNodeAtPath"); + console.error('Failed: insertNodeAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/integration-provider.ts b/sdk/constructive-cli/src/compute/cli/commands/integration-provider.ts index 5446dbdb8c..a498efe701 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/integration-provider.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/integration-provider.ts @@ -3,60 +3,74 @@ * @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 { CreateIntegrationProviderInput, IntegrationProviderPatch, IntegrationProviderSelect, IntegrationProviderFilter, IntegrationProviderOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateIntegrationProviderInput, + IntegrationProviderPatch, + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - brand: "json", - category: "string", - createdAt: "string", - description: "string", - icon: "string", - id: "uuid", - logo: "string", - name: "string", - requiredConfigs: "string", - requiredSecrets: "string", - slug: "string", - updatedAt: "string" + brand: 'json', + category: 'string', + createdAt: 'string', + description: 'string', + icon: 'string', + id: 'uuid', + logo: 'string', + name: 'string', + requiredConfigs: 'string', + requiredSecrets: 'string', + slug: 'string', + updatedAt: 'string', }; -const usage = "\nintegration-provider \n\nCommands:\n list List integrationProvider records\n find-first Find first matching integrationProvider record\n get Get a integrationProvider by ID\n create Create a new integrationProvider\n update Update an existing integrationProvider\n delete Delete a integrationProvider\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) => { +const usage = + '\nintegration-provider \n\nCommands:\n list List integrationProvider records\n find-first Find first matching integrationProvider record\n get Get a integrationProvider by ID\n create Create a new integrationProvider\n update Update an existing integrationProvider\n delete Delete a integrationProvider\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,22 @@ async function handleList(argv: Partial>, _prompter: Inq requiredConfigs: true, requiredSecrets: true, slug: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: IntegrationProviderSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy + > & { + select: IntegrationProviderSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.integrationProvider.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +127,22 @@ async function handleFindFirst(argv: Partial>, _prompter requiredConfigs: true, requiredSecrets: true, slug: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: IntegrationProviderSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy + > & { + select: IntegrationProviderSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.integrationProvider.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +151,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.integrationProvider.findOne({ - id: answers.id as string, - select: { - brand: true, - category: true, - createdAt: true, - description: true, - icon: true, - id: true, - logo: true, - name: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - updatedAt: true - } - }).execute(); + const result = await client.integrationProvider + .findOne({ + id: answers.id as string, + select: { + brand: true, + category: true, + createdAt: true, + description: true, + icon: true, + id: true, + logo: true, + name: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,92 +190,107 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "brand", - message: "brand", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "icon", - message: "icon", - required: false, - skipPrompt: true - }, { - type: "text", - name: "logo", - message: "logo", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'brand', + message: 'brand', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'icon', + message: 'icon', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logo', + message: 'logo', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateIntegrationProviderInput["integrationProvider"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateIntegrationProviderInput['integrationProvider']; const client = getClient(); - const result = await client.integrationProvider.create({ - data: { - brand: cleanedData.brand, - category: cleanedData.category, - description: cleanedData.description, - icon: cleanedData.icon, - logo: cleanedData.logo, - name: cleanedData.name, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - slug: cleanedData.slug - }, - select: { - brand: true, - category: true, - createdAt: true, - description: true, - icon: true, - id: true, - logo: true, - name: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - updatedAt: true - } - }).execute(); + const result = await client.integrationProvider + .create({ + data: { + brand: cleanedData.brand, + category: cleanedData.category, + description: cleanedData.description, + icon: cleanedData.icon, + logo: cleanedData.logo, + name: cleanedData.name, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + slug: cleanedData.slug, + }, + select: { + brand: true, + category: true, + createdAt: true, + description: true, + icon: true, + id: true, + logo: true, + name: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -254,100 +299,113 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "brand", - message: "brand", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "icon", - message: "icon", - required: false, - skipPrompt: true - }, { - type: "text", - name: "logo", - message: "logo", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'brand', + message: 'brand', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'icon', + message: 'icon', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logo', + message: 'logo', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as IntegrationProviderPatch; const client = getClient(); - const result = await client.integrationProvider.update({ - where: { - id: answers.id as string - }, - data: { - brand: cleanedData.brand, - category: cleanedData.category, - description: cleanedData.description, - icon: cleanedData.icon, - logo: cleanedData.logo, - name: cleanedData.name, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - slug: cleanedData.slug - }, - select: { - brand: true, - category: true, - createdAt: true, - description: true, - icon: true, - id: true, - logo: true, - name: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - updatedAt: true - } - }).execute(); + const result = await client.integrationProvider + .update({ + where: { + id: answers.id as string, + }, + data: { + brand: cleanedData.brand, + category: cleanedData.category, + description: cleanedData.description, + icon: cleanedData.icon, + logo: cleanedData.logo, + name: cleanedData.name, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + slug: cleanedData.slug, + }, + select: { + brand: true, + category: true, + createdAt: true, + description: true, + icon: true, + id: true, + logo: true, + name: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -356,28 +414,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.integrationProvider.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.integrationProvider + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/namespace-event.ts b/sdk/constructive-cli/src/compute/cli/commands/namespace-event.ts index 26b5edda39..d93f3ed2d4 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/namespace-event.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/namespace-event.ts @@ -3,56 +3,70 @@ * @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 { CreateNamespaceEventInput, NamespaceEventPatch, NamespaceEventSelect, NamespaceEventFilter, NamespaceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateNamespaceEventInput, + NamespaceEventPatch, + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - databaseId: "uuid", - eventType: "string", - id: "uuid", - message: "string", - metadata: "json", - namespaceId: "uuid" + actorId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + eventType: 'string', + id: 'uuid', + message: 'string', + metadata: 'json', + namespaceId: 'uuid', }; -const usage = "\nnamespace-event \n\nCommands:\n list List namespaceEvent records\n find-first Find first matching namespaceEvent record\n get Get a namespaceEvent by ID\n create Create a new namespaceEvent\n update Update an existing namespaceEvent\n delete Delete a namespaceEvent\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) => { +const usage = + '\nnamespace-event \n\nCommands:\n list List namespaceEvent records\n find-first Find first matching namespaceEvent record\n get Get a namespaceEvent by ID\n create Create a new namespaceEvent\n update Update an existing namespaceEvent\n delete Delete a namespaceEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, message: true, metadata: true, - namespaceId: true + namespaceId: true, }; - const findManyArgs = parseFindManyArgs & { - select: NamespaceEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: NamespaceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespaceEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, message: true, metadata: true, - namespaceId: true + namespaceId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: NamespaceEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: NamespaceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespaceEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.namespaceEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.namespaceEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,66 +166,78 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateNamespaceEventInput["namespaceEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateNamespaceEventInput['namespaceEvent']; const client = getClient(); - const result = await client.namespaceEvent.create({ - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - namespaceId: cleanedData.namespaceId - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.namespaceEvent + .create({ + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + namespaceId: cleanedData.namespaceId, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -212,80 +246,91 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as NamespaceEventPatch; const client = getClient(); - const result = await client.namespaceEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - namespaceId: cleanedData.namespaceId - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.namespaceEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + namespaceId: cleanedData.namespaceId, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -294,34 +339,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.namespaceEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.namespaceEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/namespace.ts b/sdk/constructive-cli/src/compute/cli/commands/namespace.ts index 4210542a81..8250becd02 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/namespace.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/namespace.ts @@ -3,61 +3,75 @@ * @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 { CreateNamespaceInput, NamespacePatch, NamespaceSelect, NamespaceFilter, NamespaceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateNamespaceInput, + NamespacePatch, + NamespaceSelect, + NamespaceFilter, + NamespaceOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - isActive: "boolean", - isManaged: "boolean", - labels: "json", - lastError: "string", - name: "string", - namespaceName: "string", - status: "string", - updatedAt: "string" + annotations: 'json', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + isActive: 'boolean', + isManaged: 'boolean', + labels: 'json', + lastError: 'string', + name: 'string', + namespaceName: 'string', + status: 'string', + updatedAt: 'string', }; -const usage = "\nnamespace \n\nCommands:\n list List namespace records\n find-first Find first matching namespace record\n get Get a namespace by ID\n create Create a new namespace\n update Update an existing namespace\n delete Delete a namespace\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) => { +const usage = + '\nnamespace \n\nCommands:\n list List namespace records\n find-first Find first matching namespace record\n get Get a namespace by ID\n create Create a new namespace\n update Update an existing namespace\n delete Delete a namespace\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, namespaceName: true, status: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: NamespaceSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: NamespaceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespace.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, namespaceName: true, status: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: NamespaceSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: NamespaceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespace.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.namespace.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.namespace + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,99 +186,112 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isManaged", - message: "isManaged", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceName", - message: "namespaceName", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isManaged', + message: 'isManaged', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceName', + message: 'namespaceName', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateNamespaceInput["namespace"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateNamespaceInput['namespace']; const client = getClient(); - const result = await client.namespace.create({ - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isActive: cleanedData.isActive, - isManaged: cleanedData.isManaged, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - name: cleanedData.name, - namespaceName: cleanedData.namespaceName, - status: cleanedData.status - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.namespace + .create({ + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isActive: cleanedData.isActive, + isManaged: cleanedData.isManaged, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + name: cleanedData.name, + namespaceName: cleanedData.namespaceName, + status: cleanedData.status, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -265,107 +300,121 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isManaged", - message: "isManaged", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceName", - message: "namespaceName", - required: false - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isManaged', + message: 'isManaged', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceName', + message: 'namespaceName', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as NamespacePatch; const client = getClient(); - const result = await client.namespace.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isActive: cleanedData.isActive, - isManaged: cleanedData.isManaged, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - name: cleanedData.name, - namespaceName: cleanedData.namespaceName, - status: cleanedData.status - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.namespace + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isActive: cleanedData.isActive, + isManaged: cleanedData.isManaged, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + name: cleanedData.name, + namespaceName: cleanedData.namespaceName, + status: cleanedData.status, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -374,28 +423,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.namespace.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.namespace + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-function-api-binding.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-function-api-binding.ts index 983fef6d6f..f9ad0f8cc9 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-function-api-binding.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-function-api-binding.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformFunctionApiBindingInput, PlatformFunctionApiBindingPatch, PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingFilter, PlatformFunctionApiBindingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformFunctionApiBindingInput, + PlatformFunctionApiBindingPatch, + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - alias: "string", - apiId: "uuid", - config: "json", - functionDefinitionId: "uuid", - id: "uuid" + alias: 'string', + apiId: 'uuid', + config: 'json', + functionDefinitionId: 'uuid', + id: 'uuid', }; -const usage = "\nplatform-function-api-binding \n\nCommands:\n list List platformFunctionApiBinding records\n find-first Find first matching platformFunctionApiBinding record\n get Get a platformFunctionApiBinding by ID\n create Create a new platformFunctionApiBinding\n update Update an existing platformFunctionApiBinding\n delete Delete a platformFunctionApiBinding\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) => { +const usage = + '\nplatform-function-api-binding \n\nCommands:\n list List platformFunctionApiBinding records\n find-first Find first matching platformFunctionApiBinding record\n get Get a platformFunctionApiBinding by ID\n create Create a new platformFunctionApiBinding\n update Update an existing platformFunctionApiBinding\n delete Delete a platformFunctionApiBinding\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq apiId: true, config: true, functionDefinitionId: true, - id: true + id: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformFunctionApiBindingSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy + > & { + select: PlatformFunctionApiBindingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionApiBinding.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter apiId: true, config: true, functionDefinitionId: true, - id: true + id: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformFunctionApiBindingSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy + > & { + select: PlatformFunctionApiBindingSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionApiBinding.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformFunctionApiBinding.findOne({ - id: answers.id as string, - select: { - alias: true, - apiId: true, - config: true, - functionDefinitionId: true, - id: true - } - }).execute(); + const result = await client.platformFunctionApiBinding + .findOne({ + id: answers.id as string, + select: { + alias: true, + apiId: true, + config: true, + functionDefinitionId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,50 +162,60 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "alias", - message: "alias", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiId", - message: "apiId", - required: true - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'alias', + message: 'alias', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformFunctionApiBindingInput["platformFunctionApiBinding"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformFunctionApiBindingInput['platformFunctionApiBinding']; const client = getClient(); - const result = await client.platformFunctionApiBinding.create({ - data: { - alias: cleanedData.alias, - apiId: cleanedData.apiId, - config: cleanedData.config, - functionDefinitionId: cleanedData.functionDefinitionId - }, - select: { - alias: true, - apiId: true, - config: true, - functionDefinitionId: true, - id: true - } - }).execute(); + const result = await client.platformFunctionApiBinding + .create({ + data: { + alias: cleanedData.alias, + apiId: cleanedData.apiId, + config: cleanedData.config, + functionDefinitionId: cleanedData.functionDefinitionId, + }, + select: { + alias: true, + apiId: true, + config: true, + functionDefinitionId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -184,58 +224,66 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "alias", - message: "alias", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiId", - message: "apiId", - required: false - }, { - type: "json", - name: "config", - message: "config", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'alias', + message: 'alias', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformFunctionApiBindingPatch; const client = getClient(); - const result = await client.platformFunctionApiBinding.update({ - where: { - id: answers.id as string - }, - data: { - alias: cleanedData.alias, - apiId: cleanedData.apiId, - config: cleanedData.config, - functionDefinitionId: cleanedData.functionDefinitionId - }, - select: { - alias: true, - apiId: true, - config: true, - functionDefinitionId: true, - id: true - } - }).execute(); + const result = await client.platformFunctionApiBinding + .update({ + where: { + id: answers.id as string, + }, + data: { + alias: cleanedData.alias, + apiId: cleanedData.apiId, + config: cleanedData.config, + functionDefinitionId: cleanedData.functionDefinitionId, + }, + select: { + alias: true, + apiId: true, + config: true, + functionDefinitionId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -244,28 +292,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformFunctionApiBinding.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformFunctionApiBinding + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-function-definition.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-function-definition.ts index 9d0d88e7d2..66df7440ef 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-function-definition.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-function-definition.ts @@ -3,92 +3,106 @@ * @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 { CreatePlatformFunctionDefinitionInput, PlatformFunctionDefinitionPatch, PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionFilter, PlatformFunctionDefinitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformFunctionDefinitionInput, + PlatformFunctionDefinitionPatch, + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - accessChannels: "string", - billable: "boolean", - category: "string", - concurrency: "int", - cpuLimitMillicores: "int", - cpuRequestMillicores: "int", - createdAt: "string", - description: "string", - fnCategory: "string", - functionColumns: "json", - graphId: "uuid", - icon: "string", - id: "uuid", - image: "string", - inputs: "json", - integrations: "string", - isPublished: "boolean", - maxAttempts: "int", - memoryLimitBytes: "int", - memoryRequestBytes: "int", - moduleTable: "string", - name: "string", - outputs: "json", - payloadArgs: "json", - priority: "int", - props: "json", - protected: "boolean", - publishedAt: "string", - queueName: "string", - requiredBuckets: "string", - requiredConfigs: "string", - requiredModels: "string", - requiredSecrets: "string", - resources: "json", - runtime: "string", - scaleMax: "int", - scaleMin: "int", - system: "boolean", - targetFunction: "string", - targetSchema: "string", - taskIdentifier: "string", - timeoutSeconds: "int", - updatedAt: "string", - volatile: "boolean" + accessChannels: 'string', + billable: 'boolean', + category: 'string', + concurrency: 'int', + cpuLimitMillicores: 'int', + cpuRequestMillicores: 'int', + createdAt: 'string', + description: 'string', + fnCategory: 'string', + functionColumns: 'json', + graphId: 'uuid', + icon: 'string', + id: 'uuid', + image: 'string', + inputs: 'json', + integrations: 'string', + isPublished: 'boolean', + maxAttempts: 'int', + memoryLimitBytes: 'int', + memoryRequestBytes: 'int', + moduleTable: 'string', + name: 'string', + outputs: 'json', + payloadArgs: 'json', + priority: 'int', + props: 'json', + protected: 'boolean', + publishedAt: 'string', + queueName: 'string', + requiredBuckets: 'string', + requiredConfigs: 'string', + requiredModels: 'string', + requiredSecrets: 'string', + resources: 'json', + runtime: 'string', + scaleMax: 'int', + scaleMin: 'int', + system: 'boolean', + targetFunction: 'string', + targetSchema: 'string', + taskIdentifier: 'string', + timeoutSeconds: 'int', + updatedAt: 'string', + volatile: 'boolean', }; -const usage = "\nplatform-function-definition \n\nCommands:\n list List platformFunctionDefinition records\n find-first Find first matching platformFunctionDefinition record\n get Get a platformFunctionDefinition by ID\n create Create a new platformFunctionDefinition\n update Update an existing platformFunctionDefinition\n delete Delete a platformFunctionDefinition\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) => { +const usage = + '\nplatform-function-definition \n\nCommands:\n list List platformFunctionDefinition records\n find-first Find first matching platformFunctionDefinition record\n get Get a platformFunctionDefinition by ID\n create Create a new platformFunctionDefinition\n update Update an existing platformFunctionDefinition\n delete Delete a platformFunctionDefinition\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -136,16 +150,22 @@ async function handleList(argv: Partial>, _prompter: Inq targetSchema: true, timeoutSeconds: true, updatedAt: true, - volatile: true + volatile: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformFunctionDefinitionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy + > & { + select: PlatformFunctionDefinitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionDefinition.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -193,16 +213,22 @@ async function handleFindFirst(argv: Partial>, _prompter targetSchema: true, timeoutSeconds: true, updatedAt: true, - volatile: true + volatile: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformFunctionDefinitionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy + > & { + select: PlatformFunctionDefinitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionDefinition.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -211,60 +237,64 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformFunctionDefinition.findOne({ - id: answers.id as string, - select: { - accessChannels: true, - billable: true, - category: true, - concurrency: true, - createdAt: true, - description: true, - fnCategory: true, - functionColumns: true, - graphId: true, - icon: true, - id: true, - image: true, - inputs: true, - integrations: true, - isPublished: true, - maxAttempts: true, - moduleTable: true, - name: true, - outputs: true, - payloadArgs: true, - priority: true, - props: true, - protected: true, - publishedAt: true, - queueName: true, - requiredBuckets: true, - requiredConfigs: true, - requiredModels: true, - requiredSecrets: true, - resources: true, - runtime: true, - scaleMax: true, - scaleMin: true, - system: true, - targetFunction: true, - targetSchema: true, - timeoutSeconds: true, - updatedAt: true, - volatile: true - } - }).execute(); + const result = await client.platformFunctionDefinition + .findOne({ + id: answers.id as string, + select: { + accessChannels: true, + billable: true, + category: true, + concurrency: true, + createdAt: true, + description: true, + fnCategory: true, + functionColumns: true, + graphId: true, + icon: true, + id: true, + image: true, + inputs: true, + integrations: true, + isPublished: true, + maxAttempts: true, + moduleTable: true, + name: true, + outputs: true, + payloadArgs: true, + priority: true, + props: true, + protected: true, + publishedAt: true, + queueName: true, + requiredBuckets: true, + requiredConfigs: true, + requiredModels: true, + requiredSecrets: true, + resources: true, + runtime: true, + scaleMax: true, + scaleMin: true, + system: true, + targetFunction: true, + targetSchema: true, + timeoutSeconds: true, + updatedAt: true, + volatile: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -273,308 +303,350 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "accessChannels", - message: "accessChannels", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "billable", - message: "billable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: true - }, { - type: "text", - name: "concurrency", - message: "concurrency", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fnCategory", - message: "fnCategory", - required: false, - skipPrompt: true - }, { - type: "json", - name: "functionColumns", - message: "functionColumns", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphId", - message: "graphId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "icon", - message: "icon", - required: false, - skipPrompt: true - }, { - type: "text", - name: "image", - message: "image", - required: false, - skipPrompt: true - }, { - type: "json", - name: "inputs", - message: "inputs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxAttempts", - message: "maxAttempts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "moduleTable", - message: "moduleTable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "json", - name: "outputs", - message: "outputs", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payloadArgs", - message: "payloadArgs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "json", - name: "props", - message: "props", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "protected", - message: "protected", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publishedAt", - message: "publishedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queueName", - message: "queueName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredBuckets", - message: "requiredBuckets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredModels", - message: "requiredModels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "runtime", - message: "runtime", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMax", - message: "scaleMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMin", - message: "scaleMin", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "system", - message: "system", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetFunction", - message: "targetFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetSchema", - message: "targetSchema", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutSeconds", - message: "timeoutSeconds", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "volatile", - message: "volatile", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'accessChannels', + message: 'accessChannels', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'billable', + message: 'billable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fnCategory', + message: 'fnCategory', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'functionColumns', + message: 'functionColumns', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphId', + message: 'graphId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'icon', + message: 'icon', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'inputs', + message: 'inputs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAttempts', + message: 'maxAttempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'moduleTable', + message: 'moduleTable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'json', + name: 'outputs', + message: 'outputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payloadArgs', + message: 'payloadArgs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'props', + message: 'props', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'protected', + message: 'protected', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publishedAt', + message: 'publishedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queueName', + message: 'queueName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredBuckets', + message: 'requiredBuckets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredModels', + message: 'requiredModels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtime', + message: 'runtime', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'system', + message: 'system', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetFunction', + message: 'targetFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetSchema', + message: 'targetSchema', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'volatile', + message: 'volatile', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformFunctionDefinitionInput["platformFunctionDefinition"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformFunctionDefinitionInput['platformFunctionDefinition']; const client = getClient(); - const result = await client.platformFunctionDefinition.create({ - data: { - accessChannels: cleanedData.accessChannels, - billable: cleanedData.billable, - category: cleanedData.category, - concurrency: cleanedData.concurrency, - description: cleanedData.description, - fnCategory: cleanedData.fnCategory, - functionColumns: cleanedData.functionColumns, - graphId: cleanedData.graphId, - icon: cleanedData.icon, - image: cleanedData.image, - inputs: cleanedData.inputs, - integrations: cleanedData.integrations, - isPublished: cleanedData.isPublished, - maxAttempts: cleanedData.maxAttempts, - moduleTable: cleanedData.moduleTable, - name: cleanedData.name, - outputs: cleanedData.outputs, - payloadArgs: cleanedData.payloadArgs, - priority: cleanedData.priority, - props: cleanedData.props, - protected: cleanedData.protected, - publishedAt: cleanedData.publishedAt, - queueName: cleanedData.queueName, - requiredBuckets: cleanedData.requiredBuckets, - requiredConfigs: cleanedData.requiredConfigs, - requiredModels: cleanedData.requiredModels, - requiredSecrets: cleanedData.requiredSecrets, - resources: cleanedData.resources, - runtime: cleanedData.runtime, - scaleMax: cleanedData.scaleMax, - scaleMin: cleanedData.scaleMin, - system: cleanedData.system, - targetFunction: cleanedData.targetFunction, - targetSchema: cleanedData.targetSchema, - timeoutSeconds: cleanedData.timeoutSeconds, - volatile: cleanedData.volatile - }, - select: { - accessChannels: true, - billable: true, - category: true, - concurrency: true, - createdAt: true, - description: true, - fnCategory: true, - functionColumns: true, - graphId: true, - icon: true, - id: true, - image: true, - inputs: true, - integrations: true, - isPublished: true, - maxAttempts: true, - moduleTable: true, - name: true, - outputs: true, - payloadArgs: true, - priority: true, - props: true, - protected: true, - publishedAt: true, - queueName: true, - requiredBuckets: true, - requiredConfigs: true, - requiredModels: true, - requiredSecrets: true, - resources: true, - runtime: true, - scaleMax: true, - scaleMin: true, - system: true, - targetFunction: true, - targetSchema: true, - timeoutSeconds: true, - updatedAt: true, - volatile: true - } - }).execute(); + const result = await client.platformFunctionDefinition + .create({ + data: { + accessChannels: cleanedData.accessChannels, + billable: cleanedData.billable, + category: cleanedData.category, + concurrency: cleanedData.concurrency, + description: cleanedData.description, + fnCategory: cleanedData.fnCategory, + functionColumns: cleanedData.functionColumns, + graphId: cleanedData.graphId, + icon: cleanedData.icon, + image: cleanedData.image, + inputs: cleanedData.inputs, + integrations: cleanedData.integrations, + isPublished: cleanedData.isPublished, + maxAttempts: cleanedData.maxAttempts, + moduleTable: cleanedData.moduleTable, + name: cleanedData.name, + outputs: cleanedData.outputs, + payloadArgs: cleanedData.payloadArgs, + priority: cleanedData.priority, + props: cleanedData.props, + protected: cleanedData.protected, + publishedAt: cleanedData.publishedAt, + queueName: cleanedData.queueName, + requiredBuckets: cleanedData.requiredBuckets, + requiredConfigs: cleanedData.requiredConfigs, + requiredModels: cleanedData.requiredModels, + requiredSecrets: cleanedData.requiredSecrets, + resources: cleanedData.resources, + runtime: cleanedData.runtime, + scaleMax: cleanedData.scaleMax, + scaleMin: cleanedData.scaleMin, + system: cleanedData.system, + targetFunction: cleanedData.targetFunction, + targetSchema: cleanedData.targetSchema, + timeoutSeconds: cleanedData.timeoutSeconds, + volatile: cleanedData.volatile, + }, + select: { + accessChannels: true, + billable: true, + category: true, + concurrency: true, + createdAt: true, + description: true, + fnCategory: true, + functionColumns: true, + graphId: true, + icon: true, + id: true, + image: true, + inputs: true, + integrations: true, + isPublished: true, + maxAttempts: true, + moduleTable: true, + name: true, + outputs: true, + payloadArgs: true, + priority: true, + props: true, + protected: true, + publishedAt: true, + queueName: true, + requiredBuckets: true, + requiredConfigs: true, + requiredModels: true, + requiredSecrets: true, + resources: true, + runtime: true, + scaleMax: true, + scaleMin: true, + system: true, + targetFunction: true, + targetSchema: true, + timeoutSeconds: true, + updatedAt: true, + volatile: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -583,316 +655,356 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "accessChannels", - message: "accessChannels", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "billable", - message: "billable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "category", - message: "category", - required: false - }, { - type: "text", - name: "concurrency", - message: "concurrency", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fnCategory", - message: "fnCategory", - required: false, - skipPrompt: true - }, { - type: "json", - name: "functionColumns", - message: "functionColumns", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphId", - message: "graphId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "icon", - message: "icon", - required: false, - skipPrompt: true - }, { - type: "text", - name: "image", - message: "image", - required: false, - skipPrompt: true - }, { - type: "json", - name: "inputs", - message: "inputs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isPublished", - message: "isPublished", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxAttempts", - message: "maxAttempts", - required: false, - skipPrompt: true - }, { - type: "text", - name: "moduleTable", - message: "moduleTable", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "json", - name: "outputs", - message: "outputs", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payloadArgs", - message: "payloadArgs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "priority", - message: "priority", - required: false, - skipPrompt: true - }, { - type: "json", - name: "props", - message: "props", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "protected", - message: "protected", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publishedAt", - message: "publishedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queueName", - message: "queueName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredBuckets", - message: "requiredBuckets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredModels", - message: "requiredModels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "runtime", - message: "runtime", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMax", - message: "scaleMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMin", - message: "scaleMin", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "system", - message: "system", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetFunction", - message: "targetFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetSchema", - message: "targetSchema", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutSeconds", - message: "timeoutSeconds", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "volatile", - message: "volatile", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'accessChannels', + message: 'accessChannels', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'billable', + message: 'billable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fnCategory', + message: 'fnCategory', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'functionColumns', + message: 'functionColumns', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphId', + message: 'graphId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'icon', + message: 'icon', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'inputs', + message: 'inputs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isPublished', + message: 'isPublished', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAttempts', + message: 'maxAttempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'moduleTable', + message: 'moduleTable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'json', + name: 'outputs', + message: 'outputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payloadArgs', + message: 'payloadArgs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'props', + message: 'props', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'protected', + message: 'protected', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publishedAt', + message: 'publishedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queueName', + message: 'queueName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredBuckets', + message: 'requiredBuckets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredModels', + message: 'requiredModels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtime', + message: 'runtime', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'system', + message: 'system', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetFunction', + message: 'targetFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetSchema', + message: 'targetSchema', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'volatile', + message: 'volatile', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformFunctionDefinitionPatch; const client = getClient(); - const result = await client.platformFunctionDefinition.update({ - where: { - id: answers.id as string - }, - data: { - accessChannels: cleanedData.accessChannels, - billable: cleanedData.billable, - category: cleanedData.category, - concurrency: cleanedData.concurrency, - description: cleanedData.description, - fnCategory: cleanedData.fnCategory, - functionColumns: cleanedData.functionColumns, - graphId: cleanedData.graphId, - icon: cleanedData.icon, - image: cleanedData.image, - inputs: cleanedData.inputs, - integrations: cleanedData.integrations, - isPublished: cleanedData.isPublished, - maxAttempts: cleanedData.maxAttempts, - moduleTable: cleanedData.moduleTable, - name: cleanedData.name, - outputs: cleanedData.outputs, - payloadArgs: cleanedData.payloadArgs, - priority: cleanedData.priority, - props: cleanedData.props, - protected: cleanedData.protected, - publishedAt: cleanedData.publishedAt, - queueName: cleanedData.queueName, - requiredBuckets: cleanedData.requiredBuckets, - requiredConfigs: cleanedData.requiredConfigs, - requiredModels: cleanedData.requiredModels, - requiredSecrets: cleanedData.requiredSecrets, - resources: cleanedData.resources, - runtime: cleanedData.runtime, - scaleMax: cleanedData.scaleMax, - scaleMin: cleanedData.scaleMin, - system: cleanedData.system, - targetFunction: cleanedData.targetFunction, - targetSchema: cleanedData.targetSchema, - timeoutSeconds: cleanedData.timeoutSeconds, - volatile: cleanedData.volatile - }, - select: { - accessChannels: true, - billable: true, - category: true, - concurrency: true, - createdAt: true, - description: true, - fnCategory: true, - functionColumns: true, - graphId: true, - icon: true, - id: true, - image: true, - inputs: true, - integrations: true, - isPublished: true, - maxAttempts: true, - moduleTable: true, - name: true, - outputs: true, - payloadArgs: true, - priority: true, - props: true, - protected: true, - publishedAt: true, - queueName: true, - requiredBuckets: true, - requiredConfigs: true, - requiredModels: true, - requiredSecrets: true, - resources: true, - runtime: true, - scaleMax: true, - scaleMin: true, - system: true, - targetFunction: true, - targetSchema: true, - timeoutSeconds: true, - updatedAt: true, - volatile: true - } - }).execute(); + const result = await client.platformFunctionDefinition + .update({ + where: { + id: answers.id as string, + }, + data: { + accessChannels: cleanedData.accessChannels, + billable: cleanedData.billable, + category: cleanedData.category, + concurrency: cleanedData.concurrency, + description: cleanedData.description, + fnCategory: cleanedData.fnCategory, + functionColumns: cleanedData.functionColumns, + graphId: cleanedData.graphId, + icon: cleanedData.icon, + image: cleanedData.image, + inputs: cleanedData.inputs, + integrations: cleanedData.integrations, + isPublished: cleanedData.isPublished, + maxAttempts: cleanedData.maxAttempts, + moduleTable: cleanedData.moduleTable, + name: cleanedData.name, + outputs: cleanedData.outputs, + payloadArgs: cleanedData.payloadArgs, + priority: cleanedData.priority, + props: cleanedData.props, + protected: cleanedData.protected, + publishedAt: cleanedData.publishedAt, + queueName: cleanedData.queueName, + requiredBuckets: cleanedData.requiredBuckets, + requiredConfigs: cleanedData.requiredConfigs, + requiredModels: cleanedData.requiredModels, + requiredSecrets: cleanedData.requiredSecrets, + resources: cleanedData.resources, + runtime: cleanedData.runtime, + scaleMax: cleanedData.scaleMax, + scaleMin: cleanedData.scaleMin, + system: cleanedData.system, + targetFunction: cleanedData.targetFunction, + targetSchema: cleanedData.targetSchema, + timeoutSeconds: cleanedData.timeoutSeconds, + volatile: cleanedData.volatile, + }, + select: { + accessChannels: true, + billable: true, + category: true, + concurrency: true, + createdAt: true, + description: true, + fnCategory: true, + functionColumns: true, + graphId: true, + icon: true, + id: true, + image: true, + inputs: true, + integrations: true, + isPublished: true, + maxAttempts: true, + moduleTable: true, + name: true, + outputs: true, + payloadArgs: true, + priority: true, + props: true, + protected: true, + publishedAt: true, + queueName: true, + requiredBuckets: true, + requiredConfigs: true, + requiredModels: true, + requiredSecrets: true, + resources: true, + runtime: true, + scaleMax: true, + scaleMin: true, + system: true, + targetFunction: true, + targetSchema: true, + timeoutSeconds: true, + updatedAt: true, + volatile: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -901,28 +1013,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformFunctionDefinition.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformFunctionDefinition + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-function-deployment-event.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-function-deployment-event.ts index 65ac06bc8e..2a567ad47f 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-function-deployment-event.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-function-deployment-event.ts @@ -3,55 +3,69 @@ * @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 { CreatePlatformFunctionDeploymentEventInput, PlatformFunctionDeploymentEventPatch, PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformFunctionDeploymentEventInput, + PlatformFunctionDeploymentEventPatch, + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - deploymentId: "uuid", - eventType: "string", - id: "uuid", - message: "string", - metadata: "json" + actorId: 'uuid', + createdAt: 'string', + deploymentId: 'uuid', + eventType: 'string', + id: 'uuid', + message: 'string', + metadata: 'json', }; -const usage = "\nplatform-function-deployment-event \n\nCommands:\n list List platformFunctionDeploymentEvent records\n find-first Find first matching platformFunctionDeploymentEvent record\n get Get a platformFunctionDeploymentEvent by ID\n create Create a new platformFunctionDeploymentEvent\n update Update an existing platformFunctionDeploymentEvent\n delete Delete a platformFunctionDeploymentEvent\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) => { +const usage = + '\nplatform-function-deployment-event \n\nCommands:\n list List platformFunctionDeploymentEvent records\n find-first Find first matching platformFunctionDeploymentEvent record\n get Get a platformFunctionDeploymentEvent by ID\n create Create a new platformFunctionDeploymentEvent\n update Update an existing platformFunctionDeploymentEvent\n delete Delete a platformFunctionDeploymentEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq eventType: true, id: true, message: true, - metadata: true + metadata: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformFunctionDeploymentEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + > & { + select: PlatformFunctionDeploymentEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionDeploymentEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter eventType: true, id: true, message: true, - metadata: true + metadata: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformFunctionDeploymentEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + > & { + select: PlatformFunctionDeploymentEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionDeploymentEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformFunctionDeploymentEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - deploymentId: true, - eventType: true, - id: true, - message: true, - metadata: true - } - }).execute(); + const result = await client.platformFunctionDeploymentEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + deploymentId: true, + eventType: true, + id: true, + message: true, + metadata: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,59 +170,70 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentId", - message: "deploymentId", - required: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentId', + message: 'deploymentId', + required: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformFunctionDeploymentEventInput["platformFunctionDeploymentEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent']; const client = getClient(); - const result = await client.platformFunctionDeploymentEvent.create({ - data: { - actorId: cleanedData.actorId, - deploymentId: cleanedData.deploymentId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata - }, - select: { - actorId: true, - createdAt: true, - deploymentId: true, - eventType: true, - id: true, - message: true, - metadata: true - } - }).execute(); + const result = await client.platformFunctionDeploymentEvent + .create({ + data: { + actorId: cleanedData.actorId, + deploymentId: cleanedData.deploymentId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + }, + select: { + actorId: true, + createdAt: true, + deploymentId: true, + eventType: true, + id: true, + message: true, + metadata: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -201,73 +242,86 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentId", - message: "deploymentId", - required: false - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }]); - const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as PlatformFunctionDeploymentEventPatch; - const client = getClient(); - const result = await client.platformFunctionDeploymentEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, }, - data: { - actorId: cleanedData.actorId, - deploymentId: cleanedData.deploymentId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, }, - select: { - actorId: true, - createdAt: true, - deploymentId: true, - eventType: true, - id: true, - message: true, - metadata: true - } - }).execute(); + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentId', + message: 'deploymentId', + required: false, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as PlatformFunctionDeploymentEventPatch; + const client = getClient(); + const result = await client.platformFunctionDeploymentEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + deploymentId: cleanedData.deploymentId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + }, + select: { + actorId: true, + createdAt: true, + deploymentId: true, + eventType: true, + id: true, + message: true, + metadata: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -276,34 +330,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformFunctionDeploymentEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformFunctionDeploymentEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-function-deployment.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-function-deployment.ts index 2050263284..6041b82a68 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-function-deployment.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-function-deployment.ts @@ -3,69 +3,83 @@ * @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 { CreatePlatformFunctionDeploymentInput, PlatformFunctionDeploymentPatch, PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentFilter, PlatformFunctionDeploymentOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformFunctionDeploymentInput, + PlatformFunctionDeploymentPatch, + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - concurrency: "int", - createdAt: "string", - errorCount: "int", - handlerName: "string", - id: "uuid", - image: "string", - imageVersion: "string", - labels: "json", - lastError: "string", - lastErrorAt: "string", - namespaceId: "uuid", - resources: "json", - revision: "int", - scaleMax: "int", - scaleMin: "int", - serviceName: "string", - serviceUrl: "string", - status: "string", - timeoutSeconds: "int", - updatedAt: "string" + annotations: 'json', + concurrency: 'int', + createdAt: 'string', + errorCount: 'int', + handlerName: 'string', + id: 'uuid', + image: 'string', + imageVersion: 'string', + labels: 'json', + lastError: 'string', + lastErrorAt: 'string', + namespaceId: 'uuid', + resources: 'json', + revision: 'int', + scaleMax: 'int', + scaleMin: 'int', + serviceName: 'string', + serviceUrl: 'string', + status: 'string', + timeoutSeconds: 'int', + updatedAt: 'string', }; -const usage = "\nplatform-function-deployment \n\nCommands:\n list List platformFunctionDeployment records\n find-first Find first matching platformFunctionDeployment record\n get Get a platformFunctionDeployment by ID\n create Create a new platformFunctionDeployment\n update Update an existing platformFunctionDeployment\n delete Delete a platformFunctionDeployment\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) => { +const usage = + '\nplatform-function-deployment \n\nCommands:\n list List platformFunctionDeployment records\n find-first Find first matching platformFunctionDeployment record\n get Get a platformFunctionDeployment by ID\n create Create a new platformFunctionDeployment\n update Update an existing platformFunctionDeployment\n delete Delete a platformFunctionDeployment\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -95,16 +109,22 @@ async function handleList(argv: Partial>, _prompter: Inq serviceUrl: true, status: true, timeoutSeconds: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformFunctionDeploymentSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy + > & { + select: PlatformFunctionDeploymentSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionDeployment.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -134,16 +154,22 @@ async function handleFindFirst(argv: Partial>, _prompter serviceUrl: true, status: true, timeoutSeconds: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformFunctionDeploymentSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy + > & { + select: PlatformFunctionDeploymentSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionDeployment.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -152,42 +178,46 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformFunctionDeployment.findOne({ - id: answers.id as string, - select: { - annotations: true, - concurrency: true, - createdAt: true, - errorCount: true, - handlerName: true, - id: true, - image: true, - imageVersion: true, - labels: true, - lastError: true, - lastErrorAt: true, - namespaceId: true, - resources: true, - revision: true, - scaleMax: true, - scaleMin: true, - serviceName: true, - serviceUrl: true, - status: true, - timeoutSeconds: true, - updatedAt: true - } - }).execute(); + const result = await client.platformFunctionDeployment + .findOne({ + id: answers.id as string, + select: { + annotations: true, + concurrency: true, + createdAt: true, + errorCount: true, + handlerName: true, + id: true, + image: true, + imageVersion: true, + labels: true, + lastError: true, + lastErrorAt: true, + namespaceId: true, + resources: true, + revision: true, + scaleMax: true, + scaleMin: true, + serviceName: true, + serviceUrl: true, + status: true, + timeoutSeconds: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -196,164 +226,188 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "concurrency", - message: "concurrency", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "handlerName", - message: "handlerName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "image", - message: "image", - required: true - }, { - type: "text", - name: "imageVersion", - message: "imageVersion", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastErrorAt", - message: "lastErrorAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revision", - message: "revision", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMax", - message: "scaleMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMin", - message: "scaleMin", - required: false, - skipPrompt: true - }, { - type: "text", - name: "serviceName", - message: "serviceName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "serviceUrl", - message: "serviceUrl", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutSeconds", - message: "timeoutSeconds", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'handlerName', + message: 'handlerName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: true, + }, + { + type: 'text', + name: 'imageVersion', + message: 'imageVersion', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastErrorAt', + message: 'lastErrorAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceName', + message: 'serviceName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceUrl', + message: 'serviceUrl', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformFunctionDeploymentInput["platformFunctionDeployment"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformFunctionDeploymentInput['platformFunctionDeployment']; const client = getClient(); - const result = await client.platformFunctionDeployment.create({ - data: { - annotations: cleanedData.annotations, - concurrency: cleanedData.concurrency, - errorCount: cleanedData.errorCount, - handlerName: cleanedData.handlerName, - image: cleanedData.image, - imageVersion: cleanedData.imageVersion, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastErrorAt: cleanedData.lastErrorAt, - namespaceId: cleanedData.namespaceId, - resources: cleanedData.resources, - revision: cleanedData.revision, - scaleMax: cleanedData.scaleMax, - scaleMin: cleanedData.scaleMin, - serviceName: cleanedData.serviceName, - serviceUrl: cleanedData.serviceUrl, - status: cleanedData.status, - timeoutSeconds: cleanedData.timeoutSeconds - }, - select: { - annotations: true, - concurrency: true, - createdAt: true, - errorCount: true, - handlerName: true, - id: true, - image: true, - imageVersion: true, - labels: true, - lastError: true, - lastErrorAt: true, - namespaceId: true, - resources: true, - revision: true, - scaleMax: true, - scaleMin: true, - serviceName: true, - serviceUrl: true, - status: true, - timeoutSeconds: true, - updatedAt: true - } - }).execute(); + const result = await client.platformFunctionDeployment + .create({ + data: { + annotations: cleanedData.annotations, + concurrency: cleanedData.concurrency, + errorCount: cleanedData.errorCount, + handlerName: cleanedData.handlerName, + image: cleanedData.image, + imageVersion: cleanedData.imageVersion, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastErrorAt: cleanedData.lastErrorAt, + namespaceId: cleanedData.namespaceId, + resources: cleanedData.resources, + revision: cleanedData.revision, + scaleMax: cleanedData.scaleMax, + scaleMin: cleanedData.scaleMin, + serviceName: cleanedData.serviceName, + serviceUrl: cleanedData.serviceUrl, + status: cleanedData.status, + timeoutSeconds: cleanedData.timeoutSeconds, + }, + select: { + annotations: true, + concurrency: true, + createdAt: true, + errorCount: true, + handlerName: true, + id: true, + image: true, + imageVersion: true, + labels: true, + lastError: true, + lastErrorAt: true, + namespaceId: true, + resources: true, + revision: true, + scaleMax: true, + scaleMin: true, + serviceName: true, + serviceUrl: true, + status: true, + timeoutSeconds: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -362,172 +416,194 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "concurrency", - message: "concurrency", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "handlerName", - message: "handlerName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "image", - message: "image", - required: false - }, { - type: "text", - name: "imageVersion", - message: "imageVersion", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastErrorAt", - message: "lastErrorAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revision", - message: "revision", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMax", - message: "scaleMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scaleMin", - message: "scaleMin", - required: false, - skipPrompt: true - }, { - type: "text", - name: "serviceName", - message: "serviceName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "serviceUrl", - message: "serviceUrl", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "timeoutSeconds", - message: "timeoutSeconds", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'handlerName', + message: 'handlerName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + }, + { + type: 'text', + name: 'imageVersion', + message: 'imageVersion', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastErrorAt', + message: 'lastErrorAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceName', + message: 'serviceName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceUrl', + message: 'serviceUrl', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformFunctionDeploymentPatch; const client = getClient(); - const result = await client.platformFunctionDeployment.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - concurrency: cleanedData.concurrency, - errorCount: cleanedData.errorCount, - handlerName: cleanedData.handlerName, - image: cleanedData.image, - imageVersion: cleanedData.imageVersion, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastErrorAt: cleanedData.lastErrorAt, - namespaceId: cleanedData.namespaceId, - resources: cleanedData.resources, - revision: cleanedData.revision, - scaleMax: cleanedData.scaleMax, - scaleMin: cleanedData.scaleMin, - serviceName: cleanedData.serviceName, - serviceUrl: cleanedData.serviceUrl, - status: cleanedData.status, - timeoutSeconds: cleanedData.timeoutSeconds - }, - select: { - annotations: true, - concurrency: true, - createdAt: true, - errorCount: true, - handlerName: true, - id: true, - image: true, - imageVersion: true, - labels: true, - lastError: true, - lastErrorAt: true, - namespaceId: true, - resources: true, - revision: true, - scaleMax: true, - scaleMin: true, - serviceName: true, - serviceUrl: true, - status: true, - timeoutSeconds: true, - updatedAt: true - } - }).execute(); + const result = await client.platformFunctionDeployment + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + concurrency: cleanedData.concurrency, + errorCount: cleanedData.errorCount, + handlerName: cleanedData.handlerName, + image: cleanedData.image, + imageVersion: cleanedData.imageVersion, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastErrorAt: cleanedData.lastErrorAt, + namespaceId: cleanedData.namespaceId, + resources: cleanedData.resources, + revision: cleanedData.revision, + scaleMax: cleanedData.scaleMax, + scaleMin: cleanedData.scaleMin, + serviceName: cleanedData.serviceName, + serviceUrl: cleanedData.serviceUrl, + status: cleanedData.status, + timeoutSeconds: cleanedData.timeoutSeconds, + }, + select: { + annotations: true, + concurrency: true, + createdAt: true, + errorCount: true, + handlerName: true, + id: true, + image: true, + imageVersion: true, + labels: true, + lastError: true, + lastErrorAt: true, + namespaceId: true, + resources: true, + revision: true, + scaleMax: true, + scaleMin: true, + serviceName: true, + serviceUrl: true, + status: true, + timeoutSeconds: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -536,28 +612,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformFunctionDeployment.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformFunctionDeployment + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-function-execution-log.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-function-execution-log.ts index eedcfd0510..f20d51e0b6 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-function-execution-log.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-function-execution-log.ts @@ -3,56 +3,70 @@ * @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 { CreatePlatformFunctionExecutionLogInput, PlatformFunctionExecutionLogPatch, PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformFunctionExecutionLogInput, + PlatformFunctionExecutionLogPatch, + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - id: "uuid", - invocationId: "uuid", - logLevel: "string", - message: "string", - metadata: "json", - taskIdentifier: "string" + actorId: 'uuid', + createdAt: 'string', + id: 'uuid', + invocationId: 'uuid', + logLevel: 'string', + message: 'string', + metadata: 'json', + taskIdentifier: 'string', }; -const usage = "\nplatform-function-execution-log \n\nCommands:\n list List platformFunctionExecutionLog records\n find-first Find first matching platformFunctionExecutionLog record\n get Get a platformFunctionExecutionLog by ID\n create Create a new platformFunctionExecutionLog\n update Update an existing platformFunctionExecutionLog\n delete Delete a platformFunctionExecutionLog\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) => { +const usage = + '\nplatform-function-execution-log \n\nCommands:\n list List platformFunctionExecutionLog records\n find-first Find first matching platformFunctionExecutionLog record\n get Get a platformFunctionExecutionLog by ID\n create Create a new platformFunctionExecutionLog\n update Update an existing platformFunctionExecutionLog\n delete Delete a platformFunctionExecutionLog\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,22 @@ async function handleList(argv: Partial>, _prompter: Inq logLevel: true, message: true, metadata: true, - taskIdentifier: true + taskIdentifier: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformFunctionExecutionLogSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + > & { + select: PlatformFunctionExecutionLogSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionExecutionLog.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +115,22 @@ async function handleFindFirst(argv: Partial>, _prompter logLevel: true, message: true, metadata: true, - taskIdentifier: true + taskIdentifier: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformFunctionExecutionLogSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + > & { + select: PlatformFunctionExecutionLogSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionExecutionLog.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +139,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformFunctionExecutionLog.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - id: true, - invocationId: true, - logLevel: true, - message: true, - metadata: true, - taskIdentifier: true - } - }).execute(); + const result = await client.platformFunctionExecutionLog + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + id: true, + invocationId: true, + logLevel: true, + message: true, + metadata: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,68 +174,80 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "logLevel", - message: "logLevel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logLevel', + message: 'logLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformFunctionExecutionLogInput["platformFunctionExecutionLog"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformFunctionExecutionLogInput['platformFunctionExecutionLog']; const client = getClient(); - const result = await client.platformFunctionExecutionLog.create({ - data: { - actorId: cleanedData.actorId, - invocationId: cleanedData.invocationId, - logLevel: cleanedData.logLevel, - message: cleanedData.message, - metadata: cleanedData.metadata, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - createdAt: true, - id: true, - invocationId: true, - logLevel: true, - message: true, - metadata: true, - taskIdentifier: true - } - }).execute(); + const result = await client.platformFunctionExecutionLog + .create({ + data: { + actorId: cleanedData.actorId, + invocationId: cleanedData.invocationId, + logLevel: cleanedData.logLevel, + message: cleanedData.message, + metadata: cleanedData.metadata, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + createdAt: true, + id: true, + invocationId: true, + logLevel: true, + message: true, + metadata: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -214,82 +256,93 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "logLevel", - message: "logLevel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logLevel', + message: 'logLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformFunctionExecutionLogPatch; const client = getClient(); - const result = await client.platformFunctionExecutionLog.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - invocationId: cleanedData.invocationId, - logLevel: cleanedData.logLevel, - message: cleanedData.message, - metadata: cleanedData.metadata, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - createdAt: true, - id: true, - invocationId: true, - logLevel: true, - message: true, - metadata: true, - taskIdentifier: true - } - }).execute(); + const result = await client.platformFunctionExecutionLog + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + invocationId: cleanedData.invocationId, + logLevel: cleanedData.logLevel, + message: cleanedData.message, + metadata: cleanedData.metadata, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + createdAt: true, + id: true, + invocationId: true, + logLevel: true, + message: true, + metadata: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -298,34 +351,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformFunctionExecutionLog.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformFunctionExecutionLog + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-function-invocation-attempt.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-function-invocation-attempt.ts index 3bf3b523d2..23f583f56d 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-function-invocation-attempt.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-function-invocation-attempt.ts @@ -3,60 +3,74 @@ * @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 { CreatePlatformFunctionInvocationAttemptInput, PlatformFunctionInvocationAttemptPatch, PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformFunctionInvocationAttemptInput, + PlatformFunctionInvocationAttemptPatch, + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - attempt: "int", - createdAt: "string", - durationMs: "int", - error: "string", - errorDetail: "json", - id: "uuid", - invocationCreatedAt: "string", - invocationId: "uuid", - startedAt: "string", - success: "boolean", - taskIdentifier: "string" + actorId: 'uuid', + attempt: 'int', + createdAt: 'string', + durationMs: 'int', + error: 'string', + errorDetail: 'json', + id: 'uuid', + invocationCreatedAt: 'string', + invocationId: 'uuid', + startedAt: 'string', + success: 'boolean', + taskIdentifier: 'string', }; -const usage = "\nplatform-function-invocation-attempt \n\nCommands:\n list List platformFunctionInvocationAttempt records\n find-first Find first matching platformFunctionInvocationAttempt record\n get Get a platformFunctionInvocationAttempt by ID\n create Create a new platformFunctionInvocationAttempt\n update Update an existing platformFunctionInvocationAttempt\n delete Delete a platformFunctionInvocationAttempt\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) => { +const usage = + '\nplatform-function-invocation-attempt \n\nCommands:\n list List platformFunctionInvocationAttempt records\n find-first Find first matching platformFunctionInvocationAttempt record\n get Get a platformFunctionInvocationAttempt by ID\n create Create a new platformFunctionInvocationAttempt\n update Update an existing platformFunctionInvocationAttempt\n delete Delete a platformFunctionInvocationAttempt\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,22 @@ async function handleList(argv: Partial>, _prompter: Inq invocationId: true, startedAt: true, success: true, - taskIdentifier: true + taskIdentifier: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformFunctionInvocationAttemptSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + > & { + select: PlatformFunctionInvocationAttemptSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionInvocationAttempt.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +127,24 @@ async function handleFindFirst(argv: Partial>, _prompter invocationId: true, startedAt: true, success: true, - taskIdentifier: true + taskIdentifier: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformFunctionInvocationAttemptSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + > & { + select: PlatformFunctionInvocationAttemptSelect; + } + >(argv, defaultSelect); const client = getClient(); - const result = await client.platformFunctionInvocationAttempt.findFirst(findFirstArgs).execute(); + const result = await client.platformFunctionInvocationAttempt + .findFirst(findFirstArgs) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +153,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformFunctionInvocationAttempt.findOne({ - id: answers.id as string, - select: { - actorId: true, - attempt: true, - createdAt: true, - durationMs: true, - error: true, - errorDetail: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - startedAt: true, - success: true, - taskIdentifier: true - } - }).execute(); + const result = await client.platformFunctionInvocationAttempt + .findOne({ + id: answers.id as string, + select: { + actorId: true, + attempt: true, + createdAt: true, + durationMs: true, + error: true, + errorDetail: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + startedAt: true, + success: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,96 +192,112 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "attempt", - message: "attempt", - required: true - }, { - type: "text", - name: "durationMs", - message: "durationMs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "json", - name: "errorDetail", - message: "errorDetail", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "success", - message: "success", - required: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'attempt', + message: 'attempt', + required: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'errorDetail', + message: 'errorDetail', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'success', + message: 'success', + required: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformFunctionInvocationAttemptInput["platformFunctionInvocationAttempt"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt']; const client = getClient(); - const result = await client.platformFunctionInvocationAttempt.create({ - data: { - actorId: cleanedData.actorId, - attempt: cleanedData.attempt, - durationMs: cleanedData.durationMs, - error: cleanedData.error, - errorDetail: cleanedData.errorDetail, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - startedAt: cleanedData.startedAt, - success: cleanedData.success, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - attempt: true, - createdAt: true, - durationMs: true, - error: true, - errorDetail: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - startedAt: true, - success: true, - taskIdentifier: true - } - }).execute(); + const result = await client.platformFunctionInvocationAttempt + .create({ + data: { + actorId: cleanedData.actorId, + attempt: cleanedData.attempt, + durationMs: cleanedData.durationMs, + error: cleanedData.error, + errorDetail: cleanedData.errorDetail, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + startedAt: cleanedData.startedAt, + success: cleanedData.success, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + attempt: true, + createdAt: true, + durationMs: true, + error: true, + errorDetail: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + startedAt: true, + success: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -258,110 +306,128 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "attempt", - message: "attempt", - required: false - }, { - type: "text", - name: "durationMs", - message: "durationMs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "json", - name: "errorDetail", - message: "errorDetail", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: false - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "success", - message: "success", - required: false - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false - }]); - const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as PlatformFunctionInvocationAttemptPatch; - const client = getClient(); - const result = await client.platformFunctionInvocationAttempt.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, }, - data: { - actorId: cleanedData.actorId, - attempt: cleanedData.attempt, - durationMs: cleanedData.durationMs, - error: cleanedData.error, - errorDetail: cleanedData.errorDetail, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - startedAt: cleanedData.startedAt, - success: cleanedData.success, - taskIdentifier: cleanedData.taskIdentifier + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, }, - select: { - actorId: true, - attempt: true, - createdAt: true, - durationMs: true, - error: true, - errorDetail: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - startedAt: true, - success: true, - taskIdentifier: true - } - }).execute(); + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'attempt', + message: 'attempt', + required: false, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'errorDetail', + message: 'errorDetail', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: false, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'success', + message: 'success', + required: false, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as PlatformFunctionInvocationAttemptPatch; + const client = getClient(); + const result = await client.platformFunctionInvocationAttempt + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + attempt: cleanedData.attempt, + durationMs: cleanedData.durationMs, + error: cleanedData.error, + errorDetail: cleanedData.errorDetail, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + startedAt: cleanedData.startedAt, + success: cleanedData.success, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + attempt: true, + createdAt: true, + durationMs: true, + error: true, + errorDetail: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + startedAt: true, + success: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -370,34 +436,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformFunctionInvocationAttempt.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformFunctionInvocationAttempt + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-function-invocation.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-function-invocation.ts index cf03dd8de3..f61949e61d 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-function-invocation.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-function-invocation.ts @@ -3,67 +3,81 @@ * @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 { CreatePlatformFunctionInvocationInput, PlatformFunctionInvocationPatch, PlatformFunctionInvocationSelect, PlatformFunctionInvocationFilter, PlatformFunctionInvocationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformFunctionInvocationInput, + PlatformFunctionInvocationPatch, + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - apiBindingId: "uuid", - channel: "string", - completedAt: "string", - createdAt: "string", - definitionScope: "string", - durationMs: "int", - error: "string", - functionDefinitionId: "uuid", - graphExecutionId: "uuid", - id: "uuid", - jobId: "int", - parentInvocationId: "uuid", - payload: "json", - provenance: "json", - result: "json", - startedAt: "string", - status: "string", - taskIdentifier: "string" + actorId: 'uuid', + apiBindingId: 'uuid', + channel: 'string', + completedAt: 'string', + createdAt: 'string', + definitionScope: 'string', + durationMs: 'int', + error: 'string', + functionDefinitionId: 'uuid', + graphExecutionId: 'uuid', + id: 'uuid', + jobId: 'int', + parentInvocationId: 'uuid', + payload: 'json', + provenance: 'json', + result: 'json', + startedAt: 'string', + status: 'string', + taskIdentifier: 'string', }; -const usage = "\nplatform-function-invocation \n\nCommands:\n list List platformFunctionInvocation records\n find-first Find first matching platformFunctionInvocation record\n get Get a platformFunctionInvocation by ID\n create Create a new platformFunctionInvocation\n update Update an existing platformFunctionInvocation\n delete Delete a platformFunctionInvocation\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) => { +const usage = + '\nplatform-function-invocation \n\nCommands:\n list List platformFunctionInvocation records\n find-first Find first matching platformFunctionInvocation record\n get Get a platformFunctionInvocation by ID\n create Create a new platformFunctionInvocation\n update Update an existing platformFunctionInvocation\n delete Delete a platformFunctionInvocation\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -91,16 +105,22 @@ async function handleList(argv: Partial>, _prompter: Inq result: true, startedAt: true, status: true, - taskIdentifier: true + taskIdentifier: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformFunctionInvocationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy + > & { + select: PlatformFunctionInvocationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionInvocation.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -128,16 +148,22 @@ async function handleFindFirst(argv: Partial>, _prompter result: true, startedAt: true, status: true, - taskIdentifier: true + taskIdentifier: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformFunctionInvocationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy + > & { + select: PlatformFunctionInvocationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformFunctionInvocation.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -146,40 +172,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformFunctionInvocation.findOne({ - id: answers.id as string, - select: { - actorId: true, - apiBindingId: true, - channel: true, - completedAt: true, - createdAt: true, - definitionScope: true, - durationMs: true, - error: true, - functionDefinitionId: true, - graphExecutionId: true, - id: true, - jobId: true, - parentInvocationId: true, - payload: true, - provenance: true, - result: true, - startedAt: true, - status: true, - taskIdentifier: true - } - }).execute(); + const result = await client.platformFunctionInvocation + .findOne({ + id: answers.id as string, + select: { + actorId: true, + apiBindingId: true, + channel: true, + completedAt: true, + createdAt: true, + definitionScope: true, + durationMs: true, + error: true, + functionDefinitionId: true, + graphExecutionId: true, + id: true, + jobId: true, + parentInvocationId: true, + payload: true, + provenance: true, + result: true, + startedAt: true, + status: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -188,156 +218,179 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiBindingId", - message: "apiBindingId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "channel", - message: "channel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionScope", - message: "definitionScope", - required: false, - skipPrompt: true - }, { - type: "text", - name: "durationMs", - message: "durationMs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphExecutionId", - message: "graphExecutionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "jobId", - message: "jobId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentInvocationId", - message: "parentInvocationId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payload", - message: "payload", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provenance", - message: "provenance", - required: false, - skipPrompt: true - }, { - type: "json", - name: "result", - message: "result", - required: false, - skipPrompt: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiBindingId', + message: 'apiBindingId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'channel', + message: 'channel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionScope', + message: 'definitionScope', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphExecutionId', + message: 'graphExecutionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'jobId', + message: 'jobId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provenance', + message: 'provenance', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformFunctionInvocationInput["platformFunctionInvocation"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformFunctionInvocationInput['platformFunctionInvocation']; const client = getClient(); - const result = await client.platformFunctionInvocation.create({ - data: { - actorId: cleanedData.actorId, - apiBindingId: cleanedData.apiBindingId, - channel: cleanedData.channel, - completedAt: cleanedData.completedAt, - definitionScope: cleanedData.definitionScope, - durationMs: cleanedData.durationMs, - error: cleanedData.error, - functionDefinitionId: cleanedData.functionDefinitionId, - graphExecutionId: cleanedData.graphExecutionId, - jobId: cleanedData.jobId, - parentInvocationId: cleanedData.parentInvocationId, - payload: cleanedData.payload, - provenance: cleanedData.provenance, - result: cleanedData.result, - startedAt: cleanedData.startedAt, - status: cleanedData.status, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - apiBindingId: true, - channel: true, - completedAt: true, - createdAt: true, - definitionScope: true, - durationMs: true, - error: true, - functionDefinitionId: true, - graphExecutionId: true, - id: true, - jobId: true, - parentInvocationId: true, - payload: true, - provenance: true, - result: true, - startedAt: true, - status: true, - taskIdentifier: true - } - }).execute(); + const result = await client.platformFunctionInvocation + .create({ + data: { + actorId: cleanedData.actorId, + apiBindingId: cleanedData.apiBindingId, + channel: cleanedData.channel, + completedAt: cleanedData.completedAt, + definitionScope: cleanedData.definitionScope, + durationMs: cleanedData.durationMs, + error: cleanedData.error, + functionDefinitionId: cleanedData.functionDefinitionId, + graphExecutionId: cleanedData.graphExecutionId, + jobId: cleanedData.jobId, + parentInvocationId: cleanedData.parentInvocationId, + payload: cleanedData.payload, + provenance: cleanedData.provenance, + result: cleanedData.result, + startedAt: cleanedData.startedAt, + status: cleanedData.status, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + apiBindingId: true, + channel: true, + completedAt: true, + createdAt: true, + definitionScope: true, + durationMs: true, + error: true, + functionDefinitionId: true, + graphExecutionId: true, + id: true, + jobId: true, + parentInvocationId: true, + payload: true, + provenance: true, + result: true, + startedAt: true, + status: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -346,170 +399,192 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiBindingId", - message: "apiBindingId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "channel", - message: "channel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionScope", - message: "definitionScope", - required: false, - skipPrompt: true - }, { - type: "text", - name: "durationMs", - message: "durationMs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphExecutionId", - message: "graphExecutionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "jobId", - message: "jobId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentInvocationId", - message: "parentInvocationId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payload", - message: "payload", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provenance", - message: "provenance", - required: false, - skipPrompt: true - }, { - type: "json", - name: "result", - message: "result", - required: false, - skipPrompt: true - }, { - type: "text", - name: "startedAt", - message: "startedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiBindingId', + message: 'apiBindingId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'channel', + message: 'channel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionScope', + message: 'definitionScope', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphExecutionId', + message: 'graphExecutionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'jobId', + message: 'jobId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provenance', + message: 'provenance', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformFunctionInvocationPatch; const client = getClient(); - const result = await client.platformFunctionInvocation.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - apiBindingId: cleanedData.apiBindingId, - channel: cleanedData.channel, - completedAt: cleanedData.completedAt, - definitionScope: cleanedData.definitionScope, - durationMs: cleanedData.durationMs, - error: cleanedData.error, - functionDefinitionId: cleanedData.functionDefinitionId, - graphExecutionId: cleanedData.graphExecutionId, - jobId: cleanedData.jobId, - parentInvocationId: cleanedData.parentInvocationId, - payload: cleanedData.payload, - provenance: cleanedData.provenance, - result: cleanedData.result, - startedAt: cleanedData.startedAt, - status: cleanedData.status, - taskIdentifier: cleanedData.taskIdentifier - }, - select: { - actorId: true, - apiBindingId: true, - channel: true, - completedAt: true, - createdAt: true, - definitionScope: true, - durationMs: true, - error: true, - functionDefinitionId: true, - graphExecutionId: true, - id: true, - jobId: true, - parentInvocationId: true, - payload: true, - provenance: true, - result: true, - startedAt: true, - status: true, - taskIdentifier: true - } - }).execute(); + const result = await client.platformFunctionInvocation + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + apiBindingId: cleanedData.apiBindingId, + channel: cleanedData.channel, + completedAt: cleanedData.completedAt, + definitionScope: cleanedData.definitionScope, + durationMs: cleanedData.durationMs, + error: cleanedData.error, + functionDefinitionId: cleanedData.functionDefinitionId, + graphExecutionId: cleanedData.graphExecutionId, + jobId: cleanedData.jobId, + parentInvocationId: cleanedData.parentInvocationId, + payload: cleanedData.payload, + provenance: cleanedData.provenance, + result: cleanedData.result, + startedAt: cleanedData.startedAt, + status: cleanedData.status, + taskIdentifier: cleanedData.taskIdentifier, + }, + select: { + actorId: true, + apiBindingId: true, + channel: true, + completedAt: true, + createdAt: true, + definitionScope: true, + durationMs: true, + error: true, + functionDefinitionId: true, + graphExecutionId: true, + id: true, + jobId: true, + parentInvocationId: true, + payload: true, + provenance: true, + result: true, + startedAt: true, + status: true, + taskIdentifier: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -518,34 +593,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformFunctionInvocation.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformFunctionInvocation + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-commit.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-commit.ts index 4b89a1fb63..01724e9862 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-commit.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-commit.ts @@ -3,57 +3,71 @@ * @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 { CreatePlatformInfraCommitInput, PlatformInfraCommitPatch, PlatformInfraCommitSelect, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraCommitInput, + PlatformInfraCommitPatch, + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - authorId: "uuid", - committerId: "uuid", - date: "string", - id: "uuid", - message: "string", - parentIds: "uuid", - scopeId: "uuid", - storeId: "uuid", - treeId: "uuid" + authorId: 'uuid', + committerId: 'uuid', + date: 'string', + id: 'uuid', + message: 'string', + parentIds: 'uuid', + scopeId: 'uuid', + storeId: 'uuid', + treeId: 'uuid', }; -const usage = "\nplatform-infra-commit \n\nCommands:\n list List platformInfraCommit records\n find-first Find first matching platformInfraCommit record\n get Get a platformInfraCommit by ID\n create Create a new platformInfraCommit\n update Update an existing platformInfraCommit\n delete Delete a platformInfraCommit\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) => { +const usage = + '\nplatform-infra-commit \n\nCommands:\n list List platformInfraCommit records\n find-first Find first matching platformInfraCommit record\n get Get a platformInfraCommit by ID\n create Create a new platformInfraCommit\n update Update an existing platformInfraCommit\n delete Delete a platformInfraCommit\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq parentIds: true, scopeId: true, storeId: true, - treeId: true + treeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraCommitSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + > & { + select: PlatformInfraCommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraCommit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter parentIds: true, scopeId: true, storeId: true, - treeId: true + treeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraCommitSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + > & { + select: PlatformInfraCommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraCommit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformInfraCommit.findOne({ - id: answers.id as string, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.platformInfraCommit + .findOne({ + id: answers.id as string, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +178,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraCommitInput["platformInfraCommit"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraCommitInput['platformInfraCommit']; const client = getClient(); - const result = await client.platformInfraCommit.create({ - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - scopeId: cleanedData.scopeId, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.platformInfraCommit + .create({ + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + scopeId: cleanedData.scopeId, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +276,102 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformInfraCommitPatch; const client = getClient(); - const result = await client.platformInfraCommit.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.platformInfraCommit + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,34 +380,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformInfraCommit.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformInfraCommit + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-get-all-tree-nodes-record.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-get-all-tree-nodes-record.ts index 8d892d2e8c..6283b9d768 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-get-all-tree-nodes-record.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-get-all-tree-nodes-record.ts @@ -3,44 +3,58 @@ * @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 { CreatePlatformInfraGetAllTreeNodesRecordInput, PlatformInfraGetAllTreeNodesRecordPatch, PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraGetAllTreeNodesRecordInput, + PlatformInfraGetAllTreeNodesRecordPatch, + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - data: "json", - path: "string" + data: 'json', + path: 'string', }; -const usage = "\nplatform-infra-get-all-tree-nodes-record \n\nCommands:\n list List platformInfraGetAllTreeNodesRecord records\n find-first Find first matching platformInfraGetAllTreeNodesRecord record\n create Create a new platformInfraGetAllTreeNodesRecord\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) => { +const usage = + '\nplatform-infra-get-all-tree-nodes-record \n\nCommands:\n list List platformInfraGetAllTreeNodesRecord records\n find-first Find first matching platformInfraGetAllTreeNodesRecord record\n create Create a new platformInfraGetAllTreeNodesRecord\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -51,16 +65,22 @@ async function handleList(argv: Partial>, _prompter: Inq try { const defaultSelect = { data: true, - path: true + path: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraGetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: PlatformInfraGetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraGetAllTreeNodesRecord.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -71,16 +91,24 @@ async function handleFindFirst(argv: Partial>, _prompter try { const defaultSelect = { data: true, - path: true + path: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraGetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: PlatformInfraGetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); - const result = await client.platformInfraGetAllTreeNodesRecord.findFirst(findFirstArgs).execute(); + const result = await client.platformInfraGetAllTreeNodesRecord + .findFirst(findFirstArgs) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -89,36 +117,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "path", - message: "path", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraGetAllTreeNodesRecordInput["platformInfraGetAllTreeNodesRecord"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord']; const client = getClient(); - const result = await client.platformInfraGetAllTreeNodesRecord.create({ - data: { - data: cleanedData.data, - path: cleanedData.path - }, - select: { - data: true, - path: true - } - }).execute(); + const result = await client.platformInfraGetAllTreeNodesRecord + .create({ + data: { + data: cleanedData.data, + path: cleanedData.path, + }, + select: { + data: true, + path: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-init-empty-repo.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-init-empty-repo.ts index 7b64adfcd8..ed24198f2c 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-init-empty-repo.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-init-empty-repo.ts @@ -3,37 +3,51 @@ * @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 { PlatformInfraInitEmptyRepoVariables } from "../../orm/mutation"; -import type { PlatformInfraInitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInfraInitEmptyRepoVariables } from '../../orm/mutation'; +import type { PlatformInfraInitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-infra-init-empty-repo - platformInfraInitEmptyRepo\n\nUsage: platform-infra-init-empty-repo [OPTIONS]\n"); + console.log( + 'platform-infra-init-empty-repo - platformInfraInitEmptyRepo\n\nUsage: platform-infra-init-empty-repo [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInfraInitEmptyRepo(parsedAnswers as unknown as PlatformInfraInitEmptyRepoVariables, { - select: selectFields - } as unknown as { - select: PlatformInfraInitEmptyRepoPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInfraInitEmptyRepo( + parsedAnswers as unknown as PlatformInfraInitEmptyRepoVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInfraInitEmptyRepoPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInfraInitEmptyRepo"); + console.error('Failed: platformInfraInitEmptyRepo'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-insert-node-at-path.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-insert-node-at-path.ts index d42b47ea3a..31a2a161d7 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-insert-node-at-path.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-insert-node-at-path.ts @@ -3,37 +3,51 @@ * @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 { PlatformInfraInsertNodeAtPathVariables } from "../../orm/mutation"; -import type { PlatformInfraInsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInfraInsertNodeAtPathVariables } from '../../orm/mutation'; +import type { PlatformInfraInsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-infra-insert-node-at-path - platformInfraInsertNodeAtPath\n\nUsage: platform-infra-insert-node-at-path [OPTIONS]\n"); + console.log( + 'platform-infra-insert-node-at-path - platformInfraInsertNodeAtPath\n\nUsage: platform-infra-insert-node-at-path [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInfraInsertNodeAtPath(parsedAnswers as unknown as PlatformInfraInsertNodeAtPathVariables, { - select: selectFields - } as unknown as { - select: PlatformInfraInsertNodeAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInfraInsertNodeAtPath( + parsedAnswers as unknown as PlatformInfraInsertNodeAtPathVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInfraInsertNodeAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInfraInsertNodeAtPath"); + console.error('Failed: platformInfraInsertNodeAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-object.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-object.ts index c624a315a8..f42fdc567b 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-object.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-object.ts @@ -3,54 +3,68 @@ * @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 { CreatePlatformInfraObjectInput, PlatformInfraObjectPatch, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraObjectInput, + PlatformInfraObjectPatch, + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - id: "uuid", - kids: "uuid", - ktree: "string", - scopeId: "uuid" + createdAt: 'string', + data: 'json', + id: 'uuid', + kids: 'uuid', + ktree: 'string', + scopeId: 'uuid', }; -const usage = "\nplatform-infra-object \n\nCommands:\n list List platformInfraObject records\n find-first Find first matching platformInfraObject record\n get Get a platformInfraObject by ID\n create Create a new platformInfraObject\n update Update an existing platformInfraObject\n delete Delete a platformInfraObject\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) => { +const usage = + '\nplatform-infra-object \n\nCommands:\n list List platformInfraObject records\n find-first Find first matching platformInfraObject record\n get Get a platformInfraObject by ID\n create Create a new platformInfraObject\n update Update an existing platformInfraObject\n delete Delete a platformInfraObject\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, kids: true, ktree: true, - scopeId: true + scopeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraObjectSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + > & { + select: PlatformInfraObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraObject.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +109,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, kids: true, ktree: true, - scopeId: true + scopeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraObjectSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + > & { + select: PlatformInfraObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraObject.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +133,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformInfraObject.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraObject + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,52 +166,62 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraObjectInput["platformInfraObject"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraObjectInput['platformInfraObject']; const client = getClient(); - const result = await client.platformInfraObject.create({ - data: { - data: cleanedData.data, - kids: cleanedData.kids, - ktree: cleanedData.ktree, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraObject + .create({ + data: { + data: cleanedData.data, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -190,60 +230,68 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformInfraObjectPatch; const client = getClient(); - const result = await client.platformInfraObject.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - data: cleanedData.data, - kids: cleanedData.kids, - ktree: cleanedData.ktree - }, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraObject + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + data: cleanedData.data, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + }, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -252,34 +300,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformInfraObject.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformInfraObject + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-ref.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-ref.ts index 5f6405a2ca..1199479403 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-ref.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-ref.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformInfraRefInput, PlatformInfraRefPatch, PlatformInfraRefSelect, PlatformInfraRefFilter, PlatformInfraRefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraRefInput, + PlatformInfraRefPatch, + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - commitId: "uuid", - id: "uuid", - name: "string", - scopeId: "uuid", - storeId: "uuid" + commitId: 'uuid', + id: 'uuid', + name: 'string', + scopeId: 'uuid', + storeId: 'uuid', }; -const usage = "\nplatform-infra-ref \n\nCommands:\n list List platformInfraRef records\n find-first Find first matching platformInfraRef record\n get Get a platformInfraRef by ID\n create Create a new platformInfraRef\n update Update an existing platformInfraRef\n delete Delete a platformInfraRef\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) => { +const usage = + '\nplatform-infra-ref \n\nCommands:\n list List platformInfraRef records\n find-first Find first matching platformInfraRef record\n get Get a platformInfraRef by ID\n create Create a new platformInfraRef\n update Update an existing platformInfraRef\n delete Delete a platformInfraRef\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, name: true, scopeId: true, - storeId: true + storeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraRefSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformInfraRefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraRef.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, name: true, scopeId: true, - storeId: true + storeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraRefSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformInfraRefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraRef.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformInfraRef.findOne({ - id: answers.id as string, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.platformInfraRef + .findOne({ + id: answers.id as string, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,49 +154,59 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraRefInput["platformInfraRef"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraRefInput['platformInfraRef']; const client = getClient(); - const result = await client.platformInfraRef.create({ - data: { - commitId: cleanedData.commitId, - name: cleanedData.name, - scopeId: cleanedData.scopeId, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.platformInfraRef + .create({ + data: { + commitId: cleanedData.commitId, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -183,57 +215,65 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformInfraRefPatch; const client = getClient(); - const result = await client.platformInfraRef.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - commitId: cleanedData.commitId, - name: cleanedData.name, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.platformInfraRef + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + commitId: cleanedData.commitId, + name: cleanedData.name, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,34 +282,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformInfraRef.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformInfraRef + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-set-data-at-path.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-set-data-at-path.ts index 4746c396c8..a08f131c85 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-set-data-at-path.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-set-data-at-path.ts @@ -3,37 +3,51 @@ * @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 { PlatformInfraSetDataAtPathVariables } from "../../orm/mutation"; -import type { PlatformInfraSetDataAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInfraSetDataAtPathVariables } from '../../orm/mutation'; +import type { PlatformInfraSetDataAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-infra-set-data-at-path - platformInfraSetDataAtPath\n\nUsage: platform-infra-set-data-at-path [OPTIONS]\n"); + console.log( + 'platform-infra-set-data-at-path - platformInfraSetDataAtPath\n\nUsage: platform-infra-set-data-at-path [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInfraSetDataAtPath(parsedAnswers as unknown as PlatformInfraSetDataAtPathVariables, { - select: selectFields - } as unknown as { - select: PlatformInfraSetDataAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInfraSetDataAtPath( + parsedAnswers as unknown as PlatformInfraSetDataAtPathVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInfraSetDataAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInfraSetDataAtPath"); + console.error('Failed: platformInfraSetDataAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-store.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-store.ts index e13889326f..00de9e0155 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-infra-store.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-infra-store.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformInfraStoreInput, PlatformInfraStorePatch, PlatformInfraStoreSelect, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraStoreInput, + PlatformInfraStorePatch, + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - hash: "uuid", - id: "uuid", - name: "string", - scopeId: "uuid" + createdAt: 'string', + hash: 'uuid', + id: 'uuid', + name: 'string', + scopeId: 'uuid', }; -const usage = "\nplatform-infra-store \n\nCommands:\n list List platformInfraStore records\n find-first Find first matching platformInfraStore record\n get Get a platformInfraStore by ID\n create Create a new platformInfraStore\n update Update an existing platformInfraStore\n delete Delete a platformInfraStore\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) => { +const usage = + '\nplatform-infra-store \n\nCommands:\n list List platformInfraStore records\n find-first Find first matching platformInfraStore record\n get Get a platformInfraStore by ID\n create Create a new platformInfraStore\n update Update an existing platformInfraStore\n delete Delete a platformInfraStore\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq hash: true, id: true, name: true, - scopeId: true + scopeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraStoreSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + > & { + select: PlatformInfraStoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraStore.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter hash: true, id: true, name: true, - scopeId: true + scopeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraStoreSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + > & { + select: PlatformInfraStoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraStore.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformInfraStore.findOne({ - id: answers.id as string, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraStore + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,43 +162,52 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraStoreInput["platformInfraStore"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraStoreInput['platformInfraStore']; const client = getClient(); - const result = await client.platformInfraStore.create({ - data: { - hash: cleanedData.hash, - name: cleanedData.name, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraStore + .create({ + data: { + hash: cleanedData.hash, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -177,51 +216,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformInfraStorePatch; const client = getClient(); - const result = await client.platformInfraStore.update({ - where: { - id: answers.id as string - }, - data: { - hash: cleanedData.hash, - name: cleanedData.name, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraStore + .update({ + where: { + id: answers.id as string, + }, + data: { + hash: cleanedData.hash, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -230,28 +276,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformInfraStore.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformInfraStore + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-namespace-event.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-namespace-event.ts index 19a0973f9c..61456547a7 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-namespace-event.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-namespace-event.ts @@ -3,55 +3,69 @@ * @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 { CreatePlatformNamespaceEventInput, PlatformNamespaceEventPatch, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformNamespaceEventInput, + PlatformNamespaceEventPatch, + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - eventType: "string", - id: "uuid", - message: "string", - metadata: "json", - namespaceId: "uuid" + actorId: 'uuid', + createdAt: 'string', + eventType: 'string', + id: 'uuid', + message: 'string', + metadata: 'json', + namespaceId: 'uuid', }; -const usage = "\nplatform-namespace-event \n\nCommands:\n list List platformNamespaceEvent records\n find-first Find first matching platformNamespaceEvent record\n get Get a platformNamespaceEvent by ID\n create Create a new platformNamespaceEvent\n update Update an existing platformNamespaceEvent\n delete Delete a platformNamespaceEvent\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) => { +const usage = + '\nplatform-namespace-event \n\nCommands:\n list List platformNamespaceEvent records\n find-first Find first matching platformNamespaceEvent record\n get Get a platformNamespaceEvent by ID\n create Create a new platformNamespaceEvent\n update Update an existing platformNamespaceEvent\n delete Delete a platformNamespaceEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, message: true, metadata: true, - namespaceId: true + namespaceId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformNamespaceEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + > & { + select: PlatformNamespaceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformNamespaceEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, message: true, metadata: true, - namespaceId: true + namespaceId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformNamespaceEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + > & { + select: PlatformNamespaceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformNamespaceEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformNamespaceEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.platformNamespaceEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,59 +170,70 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformNamespaceEventInput["platformNamespaceEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformNamespaceEventInput['platformNamespaceEvent']; const client = getClient(); - const result = await client.platformNamespaceEvent.create({ - data: { - actorId: cleanedData.actorId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - namespaceId: cleanedData.namespaceId - }, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.platformNamespaceEvent + .create({ + data: { + actorId: cleanedData.actorId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + namespaceId: cleanedData.namespaceId, + }, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -201,73 +242,83 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformNamespaceEventPatch; const client = getClient(); - const result = await client.platformNamespaceEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - namespaceId: cleanedData.namespaceId - }, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.platformNamespaceEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + namespaceId: cleanedData.namespaceId, + }, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -276,34 +327,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformNamespaceEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformNamespaceEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-namespace.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-namespace.ts index deca11906d..e005043d68 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-namespace.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-namespace.ts @@ -3,60 +3,74 @@ * @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 { CreatePlatformNamespaceInput, PlatformNamespacePatch, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformNamespaceInput, + PlatformNamespacePatch, + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - description: "string", - id: "uuid", - isActive: "boolean", - isManaged: "boolean", - labels: "json", - lastError: "string", - name: "string", - namespaceName: "string", - status: "string", - updatedAt: "string" + annotations: 'json', + createdAt: 'string', + description: 'string', + id: 'uuid', + isActive: 'boolean', + isManaged: 'boolean', + labels: 'json', + lastError: 'string', + name: 'string', + namespaceName: 'string', + status: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-namespace \n\nCommands:\n list List platformNamespace records\n find-first Find first matching platformNamespace record\n get Get a platformNamespace by ID\n create Create a new platformNamespace\n update Update an existing platformNamespace\n delete Delete a platformNamespace\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) => { +const usage = + '\nplatform-namespace \n\nCommands:\n list List platformNamespace records\n find-first Find first matching platformNamespace record\n get Get a platformNamespace by ID\n create Create a new platformNamespace\n update Update an existing platformNamespace\n delete Delete a platformNamespace\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, namespaceName: true, status: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformNamespaceSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformNamespaceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformNamespace.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +123,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, namespaceName: true, status: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformNamespaceSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformNamespaceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformNamespace.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +143,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformNamespace.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformNamespace + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,92 +182,107 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isManaged", - message: "isManaged", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceName", - message: "namespaceName", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isManaged', + message: 'isManaged', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceName', + message: 'namespaceName', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformNamespaceInput["platformNamespace"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformNamespaceInput['platformNamespace']; const client = getClient(); - const result = await client.platformNamespace.create({ - data: { - annotations: cleanedData.annotations, - description: cleanedData.description, - isActive: cleanedData.isActive, - isManaged: cleanedData.isManaged, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - name: cleanedData.name, - namespaceName: cleanedData.namespaceName, - status: cleanedData.status - }, - select: { - annotations: true, - createdAt: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformNamespace + .create({ + data: { + annotations: cleanedData.annotations, + description: cleanedData.description, + isActive: cleanedData.isActive, + isManaged: cleanedData.isManaged, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + name: cleanedData.name, + namespaceName: cleanedData.namespaceName, + status: cleanedData.status, + }, + select: { + annotations: true, + createdAt: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -254,100 +291,113 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isManaged", - message: "isManaged", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceName", - message: "namespaceName", - required: false - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isManaged', + message: 'isManaged', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceName', + message: 'namespaceName', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformNamespacePatch; const client = getClient(); - const result = await client.platformNamespace.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - description: cleanedData.description, - isActive: cleanedData.isActive, - isManaged: cleanedData.isManaged, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - name: cleanedData.name, - namespaceName: cleanedData.namespaceName, - status: cleanedData.status - }, - select: { - annotations: true, - createdAt: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformNamespace + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + description: cleanedData.description, + isActive: cleanedData.isActive, + isManaged: cleanedData.isManaged, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + name: cleanedData.name, + namespaceName: cleanedData.namespaceName, + status: cleanedData.status, + }, + select: { + annotations: true, + createdAt: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -356,28 +406,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformNamespace.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformNamespace + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-declared-capacity.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-declared-capacity.ts index 82444ce948..47b79a0b91 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-declared-capacity.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-declared-capacity.ts @@ -3,55 +3,69 @@ * @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 { CreatePlatformResourceDeclaredCapacityInput, PlatformResourceDeclaredCapacityPatch, PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceDeclaredCapacityInput, + PlatformResourceDeclaredCapacityPatch, + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - cpuLimitMillicores: "int", - cpuRequestMillicores: "int", - installationId: "uuid", - isTransient: "boolean", - kind: "string", - memoryLimitBytes: "int", - memoryRequestBytes: "int", - namespaceId: "uuid", - podCountMax: "int", - podCountMin: "int", - source: "string", - sourceId: "uuid", - storageSizeBytes: "int" + cpuLimitMillicores: 'int', + cpuRequestMillicores: 'int', + installationId: 'uuid', + isTransient: 'boolean', + kind: 'string', + memoryLimitBytes: 'int', + memoryRequestBytes: 'int', + namespaceId: 'uuid', + podCountMax: 'int', + podCountMin: 'int', + source: 'string', + sourceId: 'uuid', + storageSizeBytes: 'int', }; -const usage = "\nplatform-resource-declared-capacity \n\nCommands:\n list List platformResourceDeclaredCapacity records\n find-first Find first matching platformResourceDeclaredCapacity record\n create Create a new platformResourceDeclaredCapacity\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) => { +const usage = + '\nplatform-resource-declared-capacity \n\nCommands:\n list List platformResourceDeclaredCapacity records\n find-first Find first matching platformResourceDeclaredCapacity record\n create Create a new platformResourceDeclaredCapacity\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -73,16 +87,22 @@ async function handleList(argv: Partial>, _prompter: Inq podCountMin: true, source: true, sourceId: true, - storageSizeBytes: true + storageSizeBytes: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceDeclaredCapacitySelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + > & { + select: PlatformResourceDeclaredCapacitySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceDeclaredCapacity.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +124,22 @@ async function handleFindFirst(argv: Partial>, _prompter podCountMin: true, source: true, sourceId: true, - storageSizeBytes: true + storageSizeBytes: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceDeclaredCapacitySelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + > & { + select: PlatformResourceDeclaredCapacitySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceDeclaredCapacity.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,113 +148,132 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "cpuLimitMillicores", - message: "cpuLimitMillicores", - required: true - }, { - type: "text", - name: "cpuRequestMillicores", - message: "cpuRequestMillicores", - required: true - }, { - type: "text", - name: "installationId", - message: "installationId", - required: true - }, { - type: "boolean", - name: "isTransient", - message: "isTransient", - required: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "text", - name: "memoryLimitBytes", - message: "memoryLimitBytes", - required: true - }, { - type: "text", - name: "memoryRequestBytes", - message: "memoryRequestBytes", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "podCountMax", - message: "podCountMax", - required: true - }, { - type: "text", - name: "podCountMin", - message: "podCountMin", - required: true - }, { - type: "text", - name: "source", - message: "source", - required: true - }, { - type: "text", - name: "sourceId", - message: "sourceId", - required: true - }, { - type: "text", - name: "storageSizeBytes", - message: "storageSizeBytes", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'cpuLimitMillicores', + message: 'cpuLimitMillicores', + required: true, + }, + { + type: 'text', + name: 'cpuRequestMillicores', + message: 'cpuRequestMillicores', + required: true, + }, + { + type: 'text', + name: 'installationId', + message: 'installationId', + required: true, + }, + { + type: 'boolean', + name: 'isTransient', + message: 'isTransient', + required: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'text', + name: 'memoryLimitBytes', + message: 'memoryLimitBytes', + required: true, + }, + { + type: 'text', + name: 'memoryRequestBytes', + message: 'memoryRequestBytes', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'podCountMax', + message: 'podCountMax', + required: true, + }, + { + type: 'text', + name: 'podCountMin', + message: 'podCountMin', + required: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: true, + }, + { + type: 'text', + name: 'sourceId', + message: 'sourceId', + required: true, + }, + { + type: 'text', + name: 'storageSizeBytes', + message: 'storageSizeBytes', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceDeclaredCapacityInput["platformResourceDeclaredCapacity"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceDeclaredCapacityInput['platformResourceDeclaredCapacity']; const client = getClient(); - const result = await client.platformResourceDeclaredCapacity.create({ - data: { - cpuLimitMillicores: cleanedData.cpuLimitMillicores, - cpuRequestMillicores: cleanedData.cpuRequestMillicores, - installationId: cleanedData.installationId, - isTransient: cleanedData.isTransient, - kind: cleanedData.kind, - memoryLimitBytes: cleanedData.memoryLimitBytes, - memoryRequestBytes: cleanedData.memoryRequestBytes, - namespaceId: cleanedData.namespaceId, - podCountMax: cleanedData.podCountMax, - podCountMin: cleanedData.podCountMin, - source: cleanedData.source, - sourceId: cleanedData.sourceId, - storageSizeBytes: cleanedData.storageSizeBytes - }, - select: { - cpuLimitMillicores: true, - cpuRequestMillicores: true, - installationId: true, - isTransient: true, - kind: true, - memoryLimitBytes: true, - memoryRequestBytes: true, - namespaceId: true, - podCountMax: true, - podCountMin: true, - source: true, - sourceId: true, - storageSizeBytes: true - } - }).execute(); + const result = await client.platformResourceDeclaredCapacity + .create({ + data: { + cpuLimitMillicores: cleanedData.cpuLimitMillicores, + cpuRequestMillicores: cleanedData.cpuRequestMillicores, + installationId: cleanedData.installationId, + isTransient: cleanedData.isTransient, + kind: cleanedData.kind, + memoryLimitBytes: cleanedData.memoryLimitBytes, + memoryRequestBytes: cleanedData.memoryRequestBytes, + namespaceId: cleanedData.namespaceId, + podCountMax: cleanedData.podCountMax, + podCountMin: cleanedData.podCountMin, + source: cleanedData.source, + sourceId: cleanedData.sourceId, + storageSizeBytes: cleanedData.storageSizeBytes, + }, + select: { + cpuLimitMillicores: true, + cpuRequestMillicores: true, + installationId: true, + isTransient: true, + kind: true, + memoryLimitBytes: true, + memoryRequestBytes: true, + namespaceId: true, + podCountMax: true, + podCountMin: true, + source: true, + sourceId: true, + storageSizeBytes: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-definition.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-definition.ts index e361be18af..046f9eb890 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-definition.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-definition.ts @@ -3,65 +3,79 @@ * @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 { CreatePlatformResourceDefinitionInput, PlatformResourceDefinitionPatch, PlatformResourceDefinitionSelect, PlatformResourceDefinitionFilter, PlatformResourceDefinitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceDefinitionInput, + PlatformResourceDefinitionPatch, + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - createdBy: "uuid", - defaultSpec: "json", - description: "string", - id: "uuid", - integrations: "string", - kind: "string", - labels: "json", - name: "string", - namespaceId: "uuid", - requiredConfigs: "string", - requiredSecrets: "string", - slug: "string", - stepUpMinAge: "string", - updatedAt: "string", - updatedBy: "uuid" + annotations: 'json', + createdAt: 'string', + createdBy: 'uuid', + defaultSpec: 'json', + description: 'string', + id: 'uuid', + integrations: 'string', + kind: 'string', + labels: 'json', + name: 'string', + namespaceId: 'uuid', + requiredConfigs: 'string', + requiredSecrets: 'string', + slug: 'string', + stepUpMinAge: 'string', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nplatform-resource-definition \n\nCommands:\n list List platformResourceDefinition records\n find-first Find first matching platformResourceDefinition record\n get Get a platformResourceDefinition by ID\n create Create a new platformResourceDefinition\n update Update an existing platformResourceDefinition\n delete Delete a platformResourceDefinition\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) => { +const usage = + '\nplatform-resource-definition \n\nCommands:\n list List platformResourceDefinition records\n find-first Find first matching platformResourceDefinition record\n get Get a platformResourceDefinition by ID\n create Create a new platformResourceDefinition\n update Update an existing platformResourceDefinition\n delete Delete a platformResourceDefinition\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -87,16 +101,22 @@ async function handleList(argv: Partial>, _prompter: Inq slug: true, stepUpMinAge: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceDefinitionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy + > & { + select: PlatformResourceDefinitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceDefinition.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -122,16 +142,22 @@ async function handleFindFirst(argv: Partial>, _prompter slug: true, stepUpMinAge: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceDefinitionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy + > & { + select: PlatformResourceDefinitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceDefinition.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -140,38 +166,42 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformResourceDefinition.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - createdBy: true, - defaultSpec: true, - description: true, - id: true, - integrations: true, - kind: true, - labels: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - stepUpMinAge: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResourceDefinition + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + createdBy: true, + defaultSpec: true, + description: true, + id: true, + integrations: true, + kind: true, + labels: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + stepUpMinAge: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -180,130 +210,150 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "json", - name: "defaultSpec", - message: "defaultSpec", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "stepUpMinAge", - message: "stepUpMinAge", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'defaultSpec', + message: 'defaultSpec', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'stepUpMinAge', + message: 'stepUpMinAge', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceDefinitionInput["platformResourceDefinition"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceDefinitionInput['platformResourceDefinition']; const client = getClient(); - const result = await client.platformResourceDefinition.create({ - data: { - annotations: cleanedData.annotations, - createdBy: cleanedData.createdBy, - defaultSpec: cleanedData.defaultSpec, - description: cleanedData.description, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - slug: cleanedData.slug, - stepUpMinAge: cleanedData.stepUpMinAge, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - createdAt: true, - createdBy: true, - defaultSpec: true, - description: true, - id: true, - integrations: true, - kind: true, - labels: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - stepUpMinAge: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResourceDefinition + .create({ + data: { + annotations: cleanedData.annotations, + createdBy: cleanedData.createdBy, + defaultSpec: cleanedData.defaultSpec, + description: cleanedData.description, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + slug: cleanedData.slug, + stepUpMinAge: cleanedData.stepUpMinAge, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + createdAt: true, + createdBy: true, + defaultSpec: true, + description: true, + id: true, + integrations: true, + kind: true, + labels: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + stepUpMinAge: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -312,138 +362,156 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "json", - name: "defaultSpec", - message: "defaultSpec", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: false - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "stepUpMinAge", - message: "stepUpMinAge", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'defaultSpec', + message: 'defaultSpec', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: false, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'stepUpMinAge', + message: 'stepUpMinAge', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformResourceDefinitionPatch; const client = getClient(); - const result = await client.platformResourceDefinition.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - createdBy: cleanedData.createdBy, - defaultSpec: cleanedData.defaultSpec, - description: cleanedData.description, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - slug: cleanedData.slug, - stepUpMinAge: cleanedData.stepUpMinAge, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - createdAt: true, - createdBy: true, - defaultSpec: true, - description: true, - id: true, - integrations: true, - kind: true, - labels: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - stepUpMinAge: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResourceDefinition + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + createdBy: cleanedData.createdBy, + defaultSpec: cleanedData.defaultSpec, + description: cleanedData.description, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + slug: cleanedData.slug, + stepUpMinAge: cleanedData.stepUpMinAge, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + createdAt: true, + createdBy: true, + defaultSpec: true, + description: true, + id: true, + integrations: true, + kind: true, + labels: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + stepUpMinAge: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -452,28 +520,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformResourceDefinition.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformResourceDefinition + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-event.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-event.ts index ced5a9fb0f..630082f756 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-event.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-event.ts @@ -3,55 +3,69 @@ * @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 { CreatePlatformResourceEventInput, PlatformResourceEventPatch, PlatformResourceEventSelect, PlatformResourceEventFilter, PlatformResourceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceEventInput, + PlatformResourceEventPatch, + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - eventType: "string", - id: "uuid", - message: "string", - metadata: "json", - resourceId: "uuid" + actorId: 'uuid', + createdAt: 'string', + eventType: 'string', + id: 'uuid', + message: 'string', + metadata: 'json', + resourceId: 'uuid', }; -const usage = "\nplatform-resource-event \n\nCommands:\n list List platformResourceEvent records\n find-first Find first matching platformResourceEvent record\n get Get a platformResourceEvent by ID\n create Create a new platformResourceEvent\n update Update an existing platformResourceEvent\n delete Delete a platformResourceEvent\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) => { +const usage = + '\nplatform-resource-event \n\nCommands:\n list List platformResourceEvent records\n find-first Find first matching platformResourceEvent record\n get Get a platformResourceEvent by ID\n create Create a new platformResourceEvent\n update Update an existing platformResourceEvent\n delete Delete a platformResourceEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, message: true, metadata: true, - resourceId: true + resourceId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy + > & { + select: PlatformResourceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, message: true, metadata: true, - resourceId: true + resourceId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy + > & { + select: PlatformResourceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformResourceEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - resourceId: true - } - }).execute(); + const result = await client.platformResourceEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + resourceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,59 +170,70 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceEventInput["platformResourceEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceEventInput['platformResourceEvent']; const client = getClient(); - const result = await client.platformResourceEvent.create({ - data: { - actorId: cleanedData.actorId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - resourceId: cleanedData.resourceId - }, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - resourceId: true - } - }).execute(); + const result = await client.platformResourceEvent + .create({ + data: { + actorId: cleanedData.actorId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + resourceId: cleanedData.resourceId, + }, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + resourceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -201,73 +242,83 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformResourceEventPatch; const client = getClient(); - const result = await client.platformResourceEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - resourceId: cleanedData.resourceId - }, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - resourceId: true - } - }).execute(); + const result = await client.platformResourceEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + resourceId: cleanedData.resourceId, + }, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + resourceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -276,34 +327,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformResourceEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformResourceEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installation.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installation.ts index 368268207e..7eb39400f8 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installation.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installation.ts @@ -3,61 +3,75 @@ * @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 { CreatePlatformResourceInstallationInput, PlatformResourceInstallationPatch, PlatformResourceInstallationSelect, PlatformResourceInstallationFilter, PlatformResourceInstallationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceInstallationInput, + PlatformResourceInstallationPatch, + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - commitId: "uuid", - createdAt: "string", - createdBy: "uuid", - id: "uuid", - name: "string", - namespaceId: "uuid", - params: "json", - revision: "int", - slug: "string", - status: "string", - storeId: "uuid", - updatedAt: "string", - updatedBy: "uuid" + commitId: 'uuid', + createdAt: 'string', + createdBy: 'uuid', + id: 'uuid', + name: 'string', + namespaceId: 'uuid', + params: 'json', + revision: 'int', + slug: 'string', + status: 'string', + storeId: 'uuid', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nplatform-resource-installation \n\nCommands:\n list List platformResourceInstallation records\n find-first Find first matching platformResourceInstallation record\n get Get a platformResourceInstallation by ID\n create Create a new platformResourceInstallation\n update Update an existing platformResourceInstallation\n delete Delete a platformResourceInstallation\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) => { +const usage = + '\nplatform-resource-installation \n\nCommands:\n list List platformResourceInstallation records\n find-first Find first matching platformResourceInstallation record\n get Get a platformResourceInstallation by ID\n create Create a new platformResourceInstallation\n update Update an existing platformResourceInstallation\n delete Delete a platformResourceInstallation\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,22 @@ async function handleList(argv: Partial>, _prompter: Inq status: true, storeId: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceInstallationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + > & { + select: PlatformResourceInstallationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceInstallation.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +130,22 @@ async function handleFindFirst(argv: Partial>, _prompter status: true, storeId: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceInstallationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + > & { + select: PlatformResourceInstallationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceInstallation.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +154,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformResourceInstallation.findOne({ - id: answers.id as string, - select: { - commitId: true, - createdAt: true, - createdBy: true, - id: true, - name: true, - namespaceId: true, - params: true, - revision: true, - slug: true, - status: true, - storeId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResourceInstallation + .findOne({ + id: answers.id as string, + select: { + commitId: true, + createdAt: true, + createdBy: true, + id: true, + name: true, + namespaceId: true, + params: true, + revision: true, + slug: true, + status: true, + storeId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,99 +194,115 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "json", - name: "params", - message: "params", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revision", - message: "revision", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'json', + name: 'params', + message: 'params', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceInstallationInput["platformResourceInstallation"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceInstallationInput['platformResourceInstallation']; const client = getClient(); - const result = await client.platformResourceInstallation.create({ - data: { - commitId: cleanedData.commitId, - createdBy: cleanedData.createdBy, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - params: cleanedData.params, - revision: cleanedData.revision, - slug: cleanedData.slug, - status: cleanedData.status, - storeId: cleanedData.storeId, - updatedBy: cleanedData.updatedBy - }, - select: { - commitId: true, - createdAt: true, - createdBy: true, - id: true, - name: true, - namespaceId: true, - params: true, - revision: true, - slug: true, - status: true, - storeId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResourceInstallation + .create({ + data: { + commitId: cleanedData.commitId, + createdBy: cleanedData.createdBy, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + params: cleanedData.params, + revision: cleanedData.revision, + slug: cleanedData.slug, + status: cleanedData.status, + storeId: cleanedData.storeId, + updatedBy: cleanedData.updatedBy, + }, + select: { + commitId: true, + createdAt: true, + createdBy: true, + id: true, + name: true, + namespaceId: true, + params: true, + revision: true, + slug: true, + status: true, + storeId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -265,107 +311,121 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "json", - name: "params", - message: "params", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revision", - message: "revision", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'json', + name: 'params', + message: 'params', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformResourceInstallationPatch; const client = getClient(); - const result = await client.platformResourceInstallation.update({ - where: { - id: answers.id as string - }, - data: { - commitId: cleanedData.commitId, - createdBy: cleanedData.createdBy, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - params: cleanedData.params, - revision: cleanedData.revision, - slug: cleanedData.slug, - status: cleanedData.status, - storeId: cleanedData.storeId, - updatedBy: cleanedData.updatedBy - }, - select: { - commitId: true, - createdAt: true, - createdBy: true, - id: true, - name: true, - namespaceId: true, - params: true, - revision: true, - slug: true, - status: true, - storeId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResourceInstallation + .update({ + where: { + id: answers.id as string, + }, + data: { + commitId: cleanedData.commitId, + createdBy: cleanedData.createdBy, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + params: cleanedData.params, + revision: cleanedData.revision, + slug: cleanedData.slug, + status: cleanedData.status, + storeId: cleanedData.storeId, + updatedBy: cleanedData.updatedBy, + }, + select: { + commitId: true, + createdAt: true, + createdBy: true, + id: true, + name: true, + namespaceId: true, + params: true, + revision: true, + slug: true, + status: true, + storeId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -374,28 +434,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformResourceInstallation.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformResourceInstallation + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-install.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-install.ts index cbe3f79970..3684cfef7b 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-install.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-install.ts @@ -3,37 +3,51 @@ * @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 { PlatformResourceInstallationsInstallVariables } from "../../orm/mutation"; -import type { PlatformResourceInstallationsInstallPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformResourceInstallationsInstallVariables } from '../../orm/mutation'; +import type { PlatformResourceInstallationsInstallPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-resource-installations-install - platformResourceInstallationsInstall\n\nUsage: platform-resource-installations-install [OPTIONS]\n"); + console.log( + 'platform-resource-installations-install - platformResourceInstallationsInstall\n\nUsage: platform-resource-installations-install [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 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.platformResourceInstallationsInstall(parsedAnswers as unknown as PlatformResourceInstallationsInstallVariables, { - select: selectFields - } as unknown as { - select: PlatformResourceInstallationsInstallPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformResourceInstallationsInstall( + parsedAnswers as unknown as PlatformResourceInstallationsInstallVariables, + { + select: selectFields, + } as unknown as { + select: PlatformResourceInstallationsInstallPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformResourceInstallationsInstall"); + console.error('Failed: platformResourceInstallationsInstall'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-rollback.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-rollback.ts index 2778a8438a..342b80e3dd 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-rollback.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-rollback.ts @@ -3,37 +3,51 @@ * @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 { PlatformResourceInstallationsRollbackVariables } from "../../orm/mutation"; -import type { PlatformResourceInstallationsRollbackPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformResourceInstallationsRollbackVariables } from '../../orm/mutation'; +import type { PlatformResourceInstallationsRollbackPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-resource-installations-rollback - platformResourceInstallationsRollback\n\nUsage: platform-resource-installations-rollback [OPTIONS]\n"); + console.log( + 'platform-resource-installations-rollback - platformResourceInstallationsRollback\n\nUsage: platform-resource-installations-rollback [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 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.platformResourceInstallationsRollback(parsedAnswers as unknown as PlatformResourceInstallationsRollbackVariables, { - select: selectFields - } as unknown as { - select: PlatformResourceInstallationsRollbackPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformResourceInstallationsRollback( + parsedAnswers as unknown as PlatformResourceInstallationsRollbackVariables, + { + select: selectFields, + } as unknown as { + select: PlatformResourceInstallationsRollbackPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformResourceInstallationsRollback"); + console.error('Failed: platformResourceInstallationsRollback'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-uninstall.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-uninstall.ts index c64a819945..532ed9b9e6 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-uninstall.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-uninstall.ts @@ -3,37 +3,51 @@ * @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 { PlatformResourceInstallationsUninstallVariables } from "../../orm/mutation"; -import type { PlatformResourceInstallationsUninstallPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformResourceInstallationsUninstallVariables } from '../../orm/mutation'; +import type { PlatformResourceInstallationsUninstallPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-resource-installations-uninstall - platformResourceInstallationsUninstall\n\nUsage: platform-resource-installations-uninstall [OPTIONS]\n"); + console.log( + 'platform-resource-installations-uninstall - platformResourceInstallationsUninstall\n\nUsage: platform-resource-installations-uninstall [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 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.platformResourceInstallationsUninstall(parsedAnswers as unknown as PlatformResourceInstallationsUninstallVariables, { - select: selectFields - } as unknown as { - select: PlatformResourceInstallationsUninstallPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformResourceInstallationsUninstall( + parsedAnswers as unknown as PlatformResourceInstallationsUninstallVariables, + { + select: selectFields, + } as unknown as { + select: PlatformResourceInstallationsUninstallPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformResourceInstallationsUninstall"); + console.error('Failed: platformResourceInstallationsUninstall'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-upgrade.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-upgrade.ts index 350072697a..851b7263a0 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-upgrade.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-installations-upgrade.ts @@ -3,37 +3,51 @@ * @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 { PlatformResourceInstallationsUpgradeVariables } from "../../orm/mutation"; -import type { PlatformResourceInstallationsUpgradePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformResourceInstallationsUpgradeVariables } from '../../orm/mutation'; +import type { PlatformResourceInstallationsUpgradePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-resource-installations-upgrade - platformResourceInstallationsUpgrade\n\nUsage: platform-resource-installations-upgrade [OPTIONS]\n"); + console.log( + 'platform-resource-installations-upgrade - platformResourceInstallationsUpgrade\n\nUsage: platform-resource-installations-upgrade [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 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.platformResourceInstallationsUpgrade(parsedAnswers as unknown as PlatformResourceInstallationsUpgradeVariables, { - select: selectFields - } as unknown as { - select: PlatformResourceInstallationsUpgradePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformResourceInstallationsUpgrade( + parsedAnswers as unknown as PlatformResourceInstallationsUpgradeVariables, + { + select: selectFields, + } as unknown as { + select: PlatformResourceInstallationsUpgradePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformResourceInstallationsUpgrade"); + console.error('Failed: platformResourceInstallationsUpgrade'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-status-check.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-status-check.ts index 9169338391..5612991c62 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-status-check.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-status-check.ts @@ -3,55 +3,69 @@ * @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 { CreatePlatformResourceStatusCheckInput, PlatformResourceStatusCheckPatch, PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckFilter, PlatformResourceStatusCheckOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceStatusCheckInput, + PlatformResourceStatusCheckPatch, + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - completedAt: "string", - id: "uuid", - requestedAt: "string", - requestedBy: "uuid", - resourceId: "uuid", - result: "json", - status: "string" + completedAt: 'string', + id: 'uuid', + requestedAt: 'string', + requestedBy: 'uuid', + resourceId: 'uuid', + result: 'json', + status: 'string', }; -const usage = "\nplatform-resource-status-check \n\nCommands:\n list List platformResourceStatusCheck records\n find-first Find first matching platformResourceStatusCheck record\n get Get a platformResourceStatusCheck by ID\n create Create a new platformResourceStatusCheck\n update Update an existing platformResourceStatusCheck\n delete Delete a platformResourceStatusCheck\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) => { +const usage = + '\nplatform-resource-status-check \n\nCommands:\n list List platformResourceStatusCheck records\n find-first Find first matching platformResourceStatusCheck record\n get Get a platformResourceStatusCheck by ID\n create Create a new platformResourceStatusCheck\n update Update an existing platformResourceStatusCheck\n delete Delete a platformResourceStatusCheck\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq requestedBy: true, resourceId: true, result: true, - status: true + status: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceStatusCheckSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + > & { + select: PlatformResourceStatusCheckSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceStatusCheck.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter requestedBy: true, resourceId: true, result: true, - status: true + status: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceStatusCheckSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + > & { + select: PlatformResourceStatusCheckSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceStatusCheck.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformResourceStatusCheck.findOne({ - id: answers.id as string, - select: { - completedAt: true, - id: true, - requestedAt: true, - requestedBy: true, - resourceId: true, - result: true, - status: true - } - }).execute(); + const result = await client.platformResourceStatusCheck + .findOne({ + id: answers.id as string, + select: { + completedAt: true, + id: true, + requestedAt: true, + requestedBy: true, + resourceId: true, + result: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,67 +170,79 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requestedAt", - message: "requestedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requestedBy", - message: "requestedBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }, { - type: "json", - name: "result", - message: "result", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requestedAt', + message: 'requestedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requestedBy', + message: 'requestedBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceStatusCheckInput["platformResourceStatusCheck"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceStatusCheckInput['platformResourceStatusCheck']; const client = getClient(); - const result = await client.platformResourceStatusCheck.create({ - data: { - completedAt: cleanedData.completedAt, - requestedAt: cleanedData.requestedAt, - requestedBy: cleanedData.requestedBy, - resourceId: cleanedData.resourceId, - result: cleanedData.result, - status: cleanedData.status - }, - select: { - completedAt: true, - id: true, - requestedAt: true, - requestedBy: true, - resourceId: true, - result: true, - status: true - } - }).execute(); + const result = await client.platformResourceStatusCheck + .create({ + data: { + completedAt: cleanedData.completedAt, + requestedAt: cleanedData.requestedAt, + requestedBy: cleanedData.requestedBy, + resourceId: cleanedData.resourceId, + result: cleanedData.result, + status: cleanedData.status, + }, + select: { + completedAt: true, + id: true, + requestedAt: true, + requestedBy: true, + resourceId: true, + result: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -209,75 +251,85 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requestedAt", - message: "requestedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requestedBy", - message: "requestedBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false - }, { - type: "json", - name: "result", - message: "result", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requestedAt', + message: 'requestedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requestedBy', + message: 'requestedBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformResourceStatusCheckPatch; const client = getClient(); - const result = await client.platformResourceStatusCheck.update({ - where: { - id: answers.id as string - }, - data: { - completedAt: cleanedData.completedAt, - requestedAt: cleanedData.requestedAt, - requestedBy: cleanedData.requestedBy, - resourceId: cleanedData.resourceId, - result: cleanedData.result, - status: cleanedData.status - }, - select: { - completedAt: true, - id: true, - requestedAt: true, - requestedBy: true, - resourceId: true, - result: true, - status: true - } - }).execute(); + const result = await client.platformResourceStatusCheck + .update({ + where: { + id: answers.id as string, + }, + data: { + completedAt: cleanedData.completedAt, + requestedAt: cleanedData.requestedAt, + requestedBy: cleanedData.requestedBy, + resourceId: cleanedData.resourceId, + result: cleanedData.result, + status: cleanedData.status, + }, + select: { + completedAt: true, + id: true, + requestedAt: true, + requestedBy: true, + resourceId: true, + result: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -286,28 +338,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformResourceStatusCheck.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformResourceStatusCheck + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-usage-log.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-usage-log.ts index 575cc2d011..11cd8e88fd 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-usage-log.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-usage-log.ts @@ -3,57 +3,71 @@ * @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 { CreatePlatformResourceUsageLogInput, PlatformResourceUsageLogPatch, PlatformResourceUsageLogSelect, PlatformResourceUsageLogFilter, PlatformResourceUsageLogOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceUsageLogInput, + PlatformResourceUsageLogPatch, + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - cpuMillicores: "int", - id: "uuid", - intervalSeconds: "int", - memoryBytes: "int", - metrics: "json", - namespaceId: "uuid", - resourceId: "uuid", - sampledAt: "string", - source: "string" + cpuMillicores: 'int', + id: 'uuid', + intervalSeconds: 'int', + memoryBytes: 'int', + metrics: 'json', + namespaceId: 'uuid', + resourceId: 'uuid', + sampledAt: 'string', + source: 'string', }; -const usage = "\nplatform-resource-usage-log \n\nCommands:\n list List platformResourceUsageLog records\n find-first Find first matching platformResourceUsageLog record\n get Get a platformResourceUsageLog by ID\n create Create a new platformResourceUsageLog\n update Update an existing platformResourceUsageLog\n delete Delete a platformResourceUsageLog\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) => { +const usage = + '\nplatform-resource-usage-log \n\nCommands:\n list List platformResourceUsageLog records\n find-first Find first matching platformResourceUsageLog record\n get Get a platformResourceUsageLog by ID\n create Create a new platformResourceUsageLog\n update Update an existing platformResourceUsageLog\n delete Delete a platformResourceUsageLog\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq namespaceId: true, resourceId: true, sampledAt: true, - source: true + source: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceUsageLogSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy + > & { + select: PlatformResourceUsageLogSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceUsageLog.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter namespaceId: true, resourceId: true, sampledAt: true, - source: true + source: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceUsageLogSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy + > & { + select: PlatformResourceUsageLogSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceUsageLog.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformResourceUsageLog.findOne({ - id: answers.id as string, - select: { - cpuMillicores: true, - id: true, - intervalSeconds: true, - memoryBytes: true, - metrics: true, - namespaceId: true, - resourceId: true, - sampledAt: true, - source: true - } - }).execute(); + const result = await client.platformResourceUsageLog + .findOne({ + id: answers.id as string, + select: { + cpuMillicores: true, + id: true, + intervalSeconds: true, + memoryBytes: true, + metrics: true, + namespaceId: true, + resourceId: true, + sampledAt: true, + source: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,81 +178,95 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "cpuMillicores", - message: "cpuMillicores", - required: false, - skipPrompt: true - }, { - type: "text", - name: "intervalSeconds", - message: "intervalSeconds", - required: true - }, { - type: "text", - name: "memoryBytes", - message: "memoryBytes", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metrics", - message: "metrics", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sampledAt", - message: "sampledAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "source", - message: "source", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'cpuMillicores', + message: 'cpuMillicores', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'intervalSeconds', + message: 'intervalSeconds', + required: true, + }, + { + type: 'text', + name: 'memoryBytes', + message: 'memoryBytes', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metrics', + message: 'metrics', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sampledAt', + message: 'sampledAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceUsageLogInput["platformResourceUsageLog"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceUsageLogInput['platformResourceUsageLog']; const client = getClient(); - const result = await client.platformResourceUsageLog.create({ - data: { - cpuMillicores: cleanedData.cpuMillicores, - intervalSeconds: cleanedData.intervalSeconds, - memoryBytes: cleanedData.memoryBytes, - metrics: cleanedData.metrics, - namespaceId: cleanedData.namespaceId, - resourceId: cleanedData.resourceId, - sampledAt: cleanedData.sampledAt, - source: cleanedData.source - }, - select: { - cpuMillicores: true, - id: true, - intervalSeconds: true, - memoryBytes: true, - metrics: true, - namespaceId: true, - resourceId: true, - sampledAt: true, - source: true - } - }).execute(); + const result = await client.platformResourceUsageLog + .create({ + data: { + cpuMillicores: cleanedData.cpuMillicores, + intervalSeconds: cleanedData.intervalSeconds, + memoryBytes: cleanedData.memoryBytes, + metrics: cleanedData.metrics, + namespaceId: cleanedData.namespaceId, + resourceId: cleanedData.resourceId, + sampledAt: cleanedData.sampledAt, + source: cleanedData.source, + }, + select: { + cpuMillicores: true, + id: true, + intervalSeconds: true, + memoryBytes: true, + metrics: true, + namespaceId: true, + resourceId: true, + sampledAt: true, + source: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -231,88 +275,100 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "sampledAt", - message: "sampledAt", - required: true - }, { - type: "text", - name: "cpuMillicores", - message: "cpuMillicores", - required: false, - skipPrompt: true - }, { - type: "text", - name: "intervalSeconds", - message: "intervalSeconds", - required: false - }, { - type: "text", - name: "memoryBytes", - message: "memoryBytes", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metrics", - message: "metrics", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "source", - message: "source", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'sampledAt', + message: 'sampledAt', + required: true, + }, + { + type: 'text', + name: 'cpuMillicores', + message: 'cpuMillicores', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'intervalSeconds', + message: 'intervalSeconds', + required: false, + }, + { + type: 'text', + name: 'memoryBytes', + message: 'memoryBytes', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metrics', + message: 'metrics', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformResourceUsageLogPatch; const client = getClient(); - const result = await client.platformResourceUsageLog.update({ - where: { - id: answers.id as string, - sampledAt: answers.sampledAt as string - }, - data: { - cpuMillicores: cleanedData.cpuMillicores, - intervalSeconds: cleanedData.intervalSeconds, - memoryBytes: cleanedData.memoryBytes, - metrics: cleanedData.metrics, - namespaceId: cleanedData.namespaceId, - resourceId: cleanedData.resourceId, - source: cleanedData.source - }, - select: { - cpuMillicores: true, - id: true, - intervalSeconds: true, - memoryBytes: true, - metrics: true, - namespaceId: true, - resourceId: true, - sampledAt: true, - source: true - } - }).execute(); + const result = await client.platformResourceUsageLog + .update({ + where: { + id: answers.id as string, + sampledAt: answers.sampledAt as string, + }, + data: { + cpuMillicores: cleanedData.cpuMillicores, + intervalSeconds: cleanedData.intervalSeconds, + memoryBytes: cleanedData.memoryBytes, + metrics: cleanedData.metrics, + namespaceId: cleanedData.namespaceId, + resourceId: cleanedData.resourceId, + source: cleanedData.source, + }, + select: { + cpuMillicores: true, + id: true, + intervalSeconds: true, + memoryBytes: true, + metrics: true, + namespaceId: true, + resourceId: true, + sampledAt: true, + source: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -321,34 +377,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "sampledAt", - message: "sampledAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'sampledAt', + message: 'sampledAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformResourceUsageLog.delete({ - where: { - id: answers.id as string, - sampledAt: answers.sampledAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformResourceUsageLog + .delete({ + where: { + id: answers.id as string, + sampledAt: answers.sampledAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-usage-summary.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-usage-summary.ts index cfa0949b3e..91ff793404 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-usage-summary.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-usage-summary.ts @@ -3,57 +3,71 @@ * @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 { CreatePlatformResourceUsageSummaryInput, PlatformResourceUsageSummaryPatch, PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryFilter, PlatformResourceUsageSummaryOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceUsageSummaryInput, + PlatformResourceUsageSummaryPatch, + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - date: "string", - gbSeconds: "string", - id: "uuid", - maxCpuMillicores: "int", - maxMemoryBytes: "int", - namespaceId: "uuid", - resourceId: "uuid", - runtimeSeconds: "int", - sampleCount: "int" + date: 'string', + gbSeconds: 'string', + id: 'uuid', + maxCpuMillicores: 'int', + maxMemoryBytes: 'int', + namespaceId: 'uuid', + resourceId: 'uuid', + runtimeSeconds: 'int', + sampleCount: 'int', }; -const usage = "\nplatform-resource-usage-summary \n\nCommands:\n list List platformResourceUsageSummary records\n find-first Find first matching platformResourceUsageSummary record\n get Get a platformResourceUsageSummary by ID\n create Create a new platformResourceUsageSummary\n update Update an existing platformResourceUsageSummary\n delete Delete a platformResourceUsageSummary\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) => { +const usage = + '\nplatform-resource-usage-summary \n\nCommands:\n list List platformResourceUsageSummary records\n find-first Find first matching platformResourceUsageSummary record\n get Get a platformResourceUsageSummary by ID\n create Create a new platformResourceUsageSummary\n update Update an existing platformResourceUsageSummary\n delete Delete a platformResourceUsageSummary\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq namespaceId: true, resourceId: true, runtimeSeconds: true, - sampleCount: true + sampleCount: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceUsageSummarySelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + > & { + select: PlatformResourceUsageSummarySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceUsageSummary.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter namespaceId: true, resourceId: true, runtimeSeconds: true, - sampleCount: true + sampleCount: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceUsageSummarySelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + > & { + select: PlatformResourceUsageSummarySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceUsageSummary.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformResourceUsageSummary.findOne({ - id: answers.id as string, - select: { - date: true, - gbSeconds: true, - id: true, - maxCpuMillicores: true, - maxMemoryBytes: true, - namespaceId: true, - resourceId: true, - runtimeSeconds: true, - sampleCount: true - } - }).execute(); + const result = await client.platformResourceUsageSummary + .findOne({ + id: answers.id as string, + select: { + date: true, + gbSeconds: true, + id: true, + maxCpuMillicores: true, + maxMemoryBytes: true, + namespaceId: true, + resourceId: true, + runtimeSeconds: true, + sampleCount: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +178,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "date", - message: "date", - required: true - }, { - type: "text", - name: "gbSeconds", - message: "gbSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxCpuMillicores", - message: "maxCpuMillicores", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxMemoryBytes", - message: "maxMemoryBytes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "runtimeSeconds", - message: "runtimeSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sampleCount", - message: "sampleCount", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'date', + message: 'date', + required: true, + }, + { + type: 'text', + name: 'gbSeconds', + message: 'gbSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxCpuMillicores', + message: 'maxCpuMillicores', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxMemoryBytes', + message: 'maxMemoryBytes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtimeSeconds', + message: 'runtimeSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sampleCount', + message: 'sampleCount', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceUsageSummaryInput["platformResourceUsageSummary"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceUsageSummaryInput['platformResourceUsageSummary']; const client = getClient(); - const result = await client.platformResourceUsageSummary.create({ - data: { - date: cleanedData.date, - gbSeconds: cleanedData.gbSeconds, - maxCpuMillicores: cleanedData.maxCpuMillicores, - maxMemoryBytes: cleanedData.maxMemoryBytes, - namespaceId: cleanedData.namespaceId, - resourceId: cleanedData.resourceId, - runtimeSeconds: cleanedData.runtimeSeconds, - sampleCount: cleanedData.sampleCount - }, - select: { - date: true, - gbSeconds: true, - id: true, - maxCpuMillicores: true, - maxMemoryBytes: true, - namespaceId: true, - resourceId: true, - runtimeSeconds: true, - sampleCount: true - } - }).execute(); + const result = await client.platformResourceUsageSummary + .create({ + data: { + date: cleanedData.date, + gbSeconds: cleanedData.gbSeconds, + maxCpuMillicores: cleanedData.maxCpuMillicores, + maxMemoryBytes: cleanedData.maxMemoryBytes, + namespaceId: cleanedData.namespaceId, + resourceId: cleanedData.resourceId, + runtimeSeconds: cleanedData.runtimeSeconds, + sampleCount: cleanedData.sampleCount, + }, + select: { + date: true, + gbSeconds: true, + id: true, + maxCpuMillicores: true, + maxMemoryBytes: true, + namespaceId: true, + resourceId: true, + runtimeSeconds: true, + sampleCount: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +276,102 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "date", - message: "date", - required: true - }, { - type: "text", - name: "gbSeconds", - message: "gbSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxCpuMillicores", - message: "maxCpuMillicores", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxMemoryBytes", - message: "maxMemoryBytes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "runtimeSeconds", - message: "runtimeSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sampleCount", - message: "sampleCount", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: true, + }, + { + type: 'text', + name: 'gbSeconds', + message: 'gbSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxCpuMillicores', + message: 'maxCpuMillicores', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxMemoryBytes', + message: 'maxMemoryBytes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtimeSeconds', + message: 'runtimeSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sampleCount', + message: 'sampleCount', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformResourceUsageSummaryPatch; const client = getClient(); - const result = await client.platformResourceUsageSummary.update({ - where: { - id: answers.id as string, - date: answers.date as string - }, - data: { - gbSeconds: cleanedData.gbSeconds, - maxCpuMillicores: cleanedData.maxCpuMillicores, - maxMemoryBytes: cleanedData.maxMemoryBytes, - namespaceId: cleanedData.namespaceId, - resourceId: cleanedData.resourceId, - runtimeSeconds: cleanedData.runtimeSeconds, - sampleCount: cleanedData.sampleCount - }, - select: { - date: true, - gbSeconds: true, - id: true, - maxCpuMillicores: true, - maxMemoryBytes: true, - namespaceId: true, - resourceId: true, - runtimeSeconds: true, - sampleCount: true - } - }).execute(); + const result = await client.platformResourceUsageSummary + .update({ + where: { + id: answers.id as string, + date: answers.date as string, + }, + data: { + gbSeconds: cleanedData.gbSeconds, + maxCpuMillicores: cleanedData.maxCpuMillicores, + maxMemoryBytes: cleanedData.maxMemoryBytes, + namespaceId: cleanedData.namespaceId, + resourceId: cleanedData.resourceId, + runtimeSeconds: cleanedData.runtimeSeconds, + sampleCount: cleanedData.sampleCount, + }, + select: { + date: true, + gbSeconds: true, + id: true, + maxCpuMillicores: true, + maxMemoryBytes: true, + namespaceId: true, + resourceId: true, + runtimeSeconds: true, + sampleCount: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,34 +380,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "date", - message: "date", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformResourceUsageSummary.delete({ - where: { - id: answers.id as string, - date: answers.date as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformResourceUsageSummary + .delete({ + where: { + id: answers.id as string, + date: answers.date as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-utilization.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-utilization.ts index bd827aa021..9581ffc9f8 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource-utilization.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource-utilization.ts @@ -3,61 +3,75 @@ * @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 { CreatePlatformResourceUtilizationInput, PlatformResourceUtilizationPatch, PlatformResourceUtilizationSelect, PlatformResourceUtilizationFilter, PlatformResourceUtilizationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceUtilizationInput, + PlatformResourceUtilizationPatch, + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - avgMemoryBytes: "int", - cpuLimitMillicores: "int", - cpuPeakUtilization: "string", - cpuRequestHeadroomMillicores: "int", - cpuRequestMillicores: "int", - date: "string", - gbSeconds: "string", - kind: "string", - maxCpuMillicores: "int", - maxMemoryBytes: "int", - memoryLimitBytes: "int", - memoryPeakUtilization: "string", - memoryRequestBytes: "int", - memoryRequestHeadroomBytes: "int", - namespaceId: "uuid", - replicas: "int", - resourceId: "uuid", - runtimeSeconds: "int", - sampleCount: "int" + avgMemoryBytes: 'int', + cpuLimitMillicores: 'int', + cpuPeakUtilization: 'string', + cpuRequestHeadroomMillicores: 'int', + cpuRequestMillicores: 'int', + date: 'string', + gbSeconds: 'string', + kind: 'string', + maxCpuMillicores: 'int', + maxMemoryBytes: 'int', + memoryLimitBytes: 'int', + memoryPeakUtilization: 'string', + memoryRequestBytes: 'int', + memoryRequestHeadroomBytes: 'int', + namespaceId: 'uuid', + replicas: 'int', + resourceId: 'uuid', + runtimeSeconds: 'int', + sampleCount: 'int', }; -const usage = "\nplatform-resource-utilization \n\nCommands:\n list List platformResourceUtilization records\n find-first Find first matching platformResourceUtilization record\n create Create a new platformResourceUtilization\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) => { +const usage = + '\nplatform-resource-utilization \n\nCommands:\n list List platformResourceUtilization records\n find-first Find first matching platformResourceUtilization record\n create Create a new platformResourceUtilization\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -85,16 +99,22 @@ async function handleList(argv: Partial>, _prompter: Inq replicas: true, resourceId: true, runtimeSeconds: true, - sampleCount: true + sampleCount: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceUtilizationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + > & { + select: PlatformResourceUtilizationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceUtilization.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -122,16 +142,22 @@ async function handleFindFirst(argv: Partial>, _prompter replicas: true, resourceId: true, runtimeSeconds: true, - sampleCount: true + sampleCount: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceUtilizationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + > & { + select: PlatformResourceUtilizationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourceUtilization.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -140,155 +166,180 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "avgMemoryBytes", - message: "avgMemoryBytes", - required: true - }, { - type: "text", - name: "cpuLimitMillicores", - message: "cpuLimitMillicores", - required: true - }, { - type: "text", - name: "cpuPeakUtilization", - message: "cpuPeakUtilization", - required: true - }, { - type: "text", - name: "cpuRequestHeadroomMillicores", - message: "cpuRequestHeadroomMillicores", - required: true - }, { - type: "text", - name: "cpuRequestMillicores", - message: "cpuRequestMillicores", - required: true - }, { - type: "text", - name: "date", - message: "date", - required: true - }, { - type: "text", - name: "gbSeconds", - message: "gbSeconds", - required: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "text", - name: "maxCpuMillicores", - message: "maxCpuMillicores", - required: true - }, { - type: "text", - name: "maxMemoryBytes", - message: "maxMemoryBytes", - required: true - }, { - type: "text", - name: "memoryLimitBytes", - message: "memoryLimitBytes", - required: true - }, { - type: "text", - name: "memoryPeakUtilization", - message: "memoryPeakUtilization", - required: true - }, { - type: "text", - name: "memoryRequestBytes", - message: "memoryRequestBytes", - required: true - }, { - type: "text", - name: "memoryRequestHeadroomBytes", - message: "memoryRequestHeadroomBytes", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "replicas", - message: "replicas", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }, { - type: "text", - name: "runtimeSeconds", - message: "runtimeSeconds", - required: true - }, { - type: "text", - name: "sampleCount", - message: "sampleCount", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'avgMemoryBytes', + message: 'avgMemoryBytes', + required: true, + }, + { + type: 'text', + name: 'cpuLimitMillicores', + message: 'cpuLimitMillicores', + required: true, + }, + { + type: 'text', + name: 'cpuPeakUtilization', + message: 'cpuPeakUtilization', + required: true, + }, + { + type: 'text', + name: 'cpuRequestHeadroomMillicores', + message: 'cpuRequestHeadroomMillicores', + required: true, + }, + { + type: 'text', + name: 'cpuRequestMillicores', + message: 'cpuRequestMillicores', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: true, + }, + { + type: 'text', + name: 'gbSeconds', + message: 'gbSeconds', + required: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'text', + name: 'maxCpuMillicores', + message: 'maxCpuMillicores', + required: true, + }, + { + type: 'text', + name: 'maxMemoryBytes', + message: 'maxMemoryBytes', + required: true, + }, + { + type: 'text', + name: 'memoryLimitBytes', + message: 'memoryLimitBytes', + required: true, + }, + { + type: 'text', + name: 'memoryPeakUtilization', + message: 'memoryPeakUtilization', + required: true, + }, + { + type: 'text', + name: 'memoryRequestBytes', + message: 'memoryRequestBytes', + required: true, + }, + { + type: 'text', + name: 'memoryRequestHeadroomBytes', + message: 'memoryRequestHeadroomBytes', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'replicas', + message: 'replicas', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + { + type: 'text', + name: 'runtimeSeconds', + message: 'runtimeSeconds', + required: true, + }, + { + type: 'text', + name: 'sampleCount', + message: 'sampleCount', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceUtilizationInput["platformResourceUtilization"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceUtilizationInput['platformResourceUtilization']; const client = getClient(); - const result = await client.platformResourceUtilization.create({ - data: { - avgMemoryBytes: cleanedData.avgMemoryBytes, - cpuLimitMillicores: cleanedData.cpuLimitMillicores, - cpuPeakUtilization: cleanedData.cpuPeakUtilization, - cpuRequestHeadroomMillicores: cleanedData.cpuRequestHeadroomMillicores, - cpuRequestMillicores: cleanedData.cpuRequestMillicores, - date: cleanedData.date, - gbSeconds: cleanedData.gbSeconds, - kind: cleanedData.kind, - maxCpuMillicores: cleanedData.maxCpuMillicores, - maxMemoryBytes: cleanedData.maxMemoryBytes, - memoryLimitBytes: cleanedData.memoryLimitBytes, - memoryPeakUtilization: cleanedData.memoryPeakUtilization, - memoryRequestBytes: cleanedData.memoryRequestBytes, - memoryRequestHeadroomBytes: cleanedData.memoryRequestHeadroomBytes, - namespaceId: cleanedData.namespaceId, - replicas: cleanedData.replicas, - resourceId: cleanedData.resourceId, - runtimeSeconds: cleanedData.runtimeSeconds, - sampleCount: cleanedData.sampleCount - }, - select: { - avgMemoryBytes: true, - cpuLimitMillicores: true, - cpuPeakUtilization: true, - cpuRequestHeadroomMillicores: true, - cpuRequestMillicores: true, - date: true, - gbSeconds: true, - kind: true, - maxCpuMillicores: true, - maxMemoryBytes: true, - memoryLimitBytes: true, - memoryPeakUtilization: true, - memoryRequestBytes: true, - memoryRequestHeadroomBytes: true, - namespaceId: true, - replicas: true, - resourceId: true, - runtimeSeconds: true, - sampleCount: true - } - }).execute(); + const result = await client.platformResourceUtilization + .create({ + data: { + avgMemoryBytes: cleanedData.avgMemoryBytes, + cpuLimitMillicores: cleanedData.cpuLimitMillicores, + cpuPeakUtilization: cleanedData.cpuPeakUtilization, + cpuRequestHeadroomMillicores: cleanedData.cpuRequestHeadroomMillicores, + cpuRequestMillicores: cleanedData.cpuRequestMillicores, + date: cleanedData.date, + gbSeconds: cleanedData.gbSeconds, + kind: cleanedData.kind, + maxCpuMillicores: cleanedData.maxCpuMillicores, + maxMemoryBytes: cleanedData.maxMemoryBytes, + memoryLimitBytes: cleanedData.memoryLimitBytes, + memoryPeakUtilization: cleanedData.memoryPeakUtilization, + memoryRequestBytes: cleanedData.memoryRequestBytes, + memoryRequestHeadroomBytes: cleanedData.memoryRequestHeadroomBytes, + namespaceId: cleanedData.namespaceId, + replicas: cleanedData.replicas, + resourceId: cleanedData.resourceId, + runtimeSeconds: cleanedData.runtimeSeconds, + sampleCount: cleanedData.sampleCount, + }, + select: { + avgMemoryBytes: true, + cpuLimitMillicores: true, + cpuPeakUtilization: true, + cpuRequestHeadroomMillicores: true, + cpuRequestMillicores: true, + date: true, + gbSeconds: true, + kind: true, + maxCpuMillicores: true, + maxMemoryBytes: true, + memoryLimitBytes: true, + memoryPeakUtilization: true, + memoryRequestBytes: true, + memoryRequestHeadroomBytes: true, + namespaceId: true, + replicas: true, + resourceId: true, + runtimeSeconds: true, + sampleCount: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resource.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resource.ts index 1d7c6f4fca..4e59deed7d 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resource.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resource.ts @@ -3,77 +3,91 @@ * @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 { CreatePlatformResourceInput, PlatformResourcePatch, PlatformResourceSelect, PlatformResourceFilter, PlatformResourceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourceInput, + PlatformResourcePatch, + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - cpuLimitMillicores: "int", - cpuRequestMillicores: "int", - createdAt: "string", - createdBy: "uuid", - errorCount: "int", - id: "uuid", - installationId: "uuid", - integrations: "string", - kind: "string", - labels: "json", - lastError: "string", - lastHeartbeatAt: "string", - memoryLimitBytes: "int", - memoryRequestBytes: "int", - name: "string", - namespaceId: "uuid", - replicas: "int", - requiredConfigs: "string", - requiredSecrets: "string", - resourceDefinitionId: "uuid", - slug: "string", - spec: "json", - status: "string", - statusObserved: "json", - storageClass: "string", - storageSizeBytes: "int", - updatedAt: "string", - updatedBy: "uuid" + annotations: 'json', + cpuLimitMillicores: 'int', + cpuRequestMillicores: 'int', + createdAt: 'string', + createdBy: 'uuid', + errorCount: 'int', + id: 'uuid', + installationId: 'uuid', + integrations: 'string', + kind: 'string', + labels: 'json', + lastError: 'string', + lastHeartbeatAt: 'string', + memoryLimitBytes: 'int', + memoryRequestBytes: 'int', + name: 'string', + namespaceId: 'uuid', + replicas: 'int', + requiredConfigs: 'string', + requiredSecrets: 'string', + resourceDefinitionId: 'uuid', + slug: 'string', + spec: 'json', + status: 'string', + statusObserved: 'json', + storageClass: 'string', + storageSizeBytes: 'int', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nplatform-resource \n\nCommands:\n list List platformResource records\n find-first Find first matching platformResource record\n get Get a platformResource by ID\n create Create a new platformResource\n update Update an existing platformResource\n delete Delete a platformResource\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) => { +const usage = + '\nplatform-resource \n\nCommands:\n list List platformResource records\n find-first Find first matching platformResource record\n get Get a platformResource by ID\n create Create a new platformResource\n update Update an existing platformResource\n delete Delete a platformResource\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -104,16 +118,18 @@ async function handleList(argv: Partial>, _prompter: Inq status: true, statusObserved: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourceSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformResourceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResource.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -144,16 +160,18 @@ async function handleFindFirst(argv: Partial>, _prompter status: true, statusObserved: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourceSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformResourceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResource.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -162,43 +180,47 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformResource.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - createdBy: true, - errorCount: true, - id: true, - installationId: true, - integrations: true, - kind: true, - labels: true, - lastError: true, - lastHeartbeatAt: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - resourceDefinitionId: true, - slug: true, - spec: true, - status: true, - statusObserved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResource + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + createdBy: true, + errorCount: true, + id: true, + installationId: true, + integrations: true, + kind: true, + labels: true, + lastError: true, + lastHeartbeatAt: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + resourceDefinitionId: true, + slug: true, + spec: true, + status: true, + statusObserved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -207,170 +229,195 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "installationId", - message: "installationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastHeartbeatAt", - message: "lastHeartbeatAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionId", - message: "resourceDefinitionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "json", - name: "spec", - message: "spec", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "json", - name: "statusObserved", - message: "statusObserved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'installationId', + message: 'installationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastHeartbeatAt', + message: 'lastHeartbeatAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionId', + message: 'resourceDefinitionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'json', + name: 'spec', + message: 'spec', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'statusObserved', + message: 'statusObserved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourceInput["platformResource"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourceInput['platformResource']; const client = getClient(); - const result = await client.platformResource.create({ - data: { - annotations: cleanedData.annotations, - createdBy: cleanedData.createdBy, - errorCount: cleanedData.errorCount, - installationId: cleanedData.installationId, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastHeartbeatAt: cleanedData.lastHeartbeatAt, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - resourceDefinitionId: cleanedData.resourceDefinitionId, - slug: cleanedData.slug, - spec: cleanedData.spec, - status: cleanedData.status, - statusObserved: cleanedData.statusObserved, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - createdAt: true, - createdBy: true, - errorCount: true, - id: true, - installationId: true, - integrations: true, - kind: true, - labels: true, - lastError: true, - lastHeartbeatAt: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - resourceDefinitionId: true, - slug: true, - spec: true, - status: true, - statusObserved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResource + .create({ + data: { + annotations: cleanedData.annotations, + createdBy: cleanedData.createdBy, + errorCount: cleanedData.errorCount, + installationId: cleanedData.installationId, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastHeartbeatAt: cleanedData.lastHeartbeatAt, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + resourceDefinitionId: cleanedData.resourceDefinitionId, + slug: cleanedData.slug, + spec: cleanedData.spec, + status: cleanedData.status, + statusObserved: cleanedData.statusObserved, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + createdAt: true, + createdBy: true, + errorCount: true, + id: true, + installationId: true, + integrations: true, + kind: true, + labels: true, + lastError: true, + lastHeartbeatAt: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + resourceDefinitionId: true, + slug: true, + spec: true, + status: true, + statusObserved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -379,178 +426,201 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "installationId", - message: "installationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: false - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastHeartbeatAt", - message: "lastHeartbeatAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionId", - message: "resourceDefinitionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "json", - name: "spec", - message: "spec", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "json", - name: "statusObserved", - message: "statusObserved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'installationId', + message: 'installationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: false, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastHeartbeatAt', + message: 'lastHeartbeatAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionId', + message: 'resourceDefinitionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'json', + name: 'spec', + message: 'spec', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'statusObserved', + message: 'statusObserved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformResourcePatch; const client = getClient(); - const result = await client.platformResource.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - createdBy: cleanedData.createdBy, - errorCount: cleanedData.errorCount, - installationId: cleanedData.installationId, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastHeartbeatAt: cleanedData.lastHeartbeatAt, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - resourceDefinitionId: cleanedData.resourceDefinitionId, - slug: cleanedData.slug, - spec: cleanedData.spec, - status: cleanedData.status, - statusObserved: cleanedData.statusObserved, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - createdAt: true, - createdBy: true, - errorCount: true, - id: true, - installationId: true, - integrations: true, - kind: true, - labels: true, - lastError: true, - lastHeartbeatAt: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - resourceDefinitionId: true, - slug: true, - spec: true, - status: true, - statusObserved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResource + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + createdBy: cleanedData.createdBy, + errorCount: cleanedData.errorCount, + installationId: cleanedData.installationId, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastHeartbeatAt: cleanedData.lastHeartbeatAt, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + resourceDefinitionId: cleanedData.resourceDefinitionId, + slug: cleanedData.slug, + spec: cleanedData.spec, + status: cleanedData.status, + statusObserved: cleanedData.statusObserved, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + createdAt: true, + createdBy: true, + errorCount: true, + id: true, + installationId: true, + integrations: true, + kind: true, + labels: true, + lastError: true, + lastHeartbeatAt: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + resourceDefinitionId: true, + slug: true, + spec: true, + status: true, + statusObserved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -559,28 +629,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformResource.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformResource + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resources-health.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resources-health.ts index 1a1e3cdd54..0684290f0c 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resources-health.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resources-health.ts @@ -3,72 +3,86 @@ * @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 { CreatePlatformResourcesHealthInput, PlatformResourcesHealthPatch, PlatformResourcesHealthSelect, PlatformResourcesHealthFilter, PlatformResourcesHealthOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourcesHealthInput, + PlatformResourcesHealthPatch, + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - cpuLimitMillicores: "int", - cpuRequestMillicores: "int", - createdAt: "string", - createdBy: "uuid", - errorCount: "int", - id: "uuid", - installationId: "uuid", - integrations: "string", - kind: "string", - labels: "json", - lastError: "string", - lastHeartbeatAt: "string", - memoryLimitBytes: "int", - memoryRequestBytes: "int", - name: "string", - namespaceId: "uuid", - replicas: "int", - requiredConfigs: "string", - requiredSecrets: "string", - resourceDefinitionId: "uuid", - slug: "string", - spec: "json", - status: "string", - statusDetail: "string", - statusObserved: "json", - storageClass: "string", - storageSizeBytes: "int", - updatedAt: "string", - updatedBy: "uuid" + annotations: 'json', + cpuLimitMillicores: 'int', + cpuRequestMillicores: 'int', + createdAt: 'string', + createdBy: 'uuid', + errorCount: 'int', + id: 'uuid', + installationId: 'uuid', + integrations: 'string', + kind: 'string', + labels: 'json', + lastError: 'string', + lastHeartbeatAt: 'string', + memoryLimitBytes: 'int', + memoryRequestBytes: 'int', + name: 'string', + namespaceId: 'uuid', + replicas: 'int', + requiredConfigs: 'string', + requiredSecrets: 'string', + resourceDefinitionId: 'uuid', + slug: 'string', + spec: 'json', + status: 'string', + statusDetail: 'string', + statusObserved: 'json', + storageClass: 'string', + storageSizeBytes: 'int', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nplatform-resources-health \n\nCommands:\n list List platformResourcesHealth records\n find-first Find first matching platformResourcesHealth record\n create Create a new platformResourcesHealth\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) => { +const usage = + '\nplatform-resources-health \n\nCommands:\n list List platformResourcesHealth records\n find-first Find first matching platformResourcesHealth record\n create Create a new platformResourcesHealth\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -107,16 +121,22 @@ async function handleList(argv: Partial>, _prompter: Inq storageClass: true, storageSizeBytes: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourcesHealthSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy + > & { + select: PlatformResourcesHealthSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourcesHealth.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -155,16 +175,22 @@ async function handleFindFirst(argv: Partial>, _prompter storageClass: true, storageSizeBytes: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourcesHealthSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy + > & { + select: PlatformResourcesHealthSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourcesHealth.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -173,214 +199,247 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: true - }, { - type: "text", - name: "cpuLimitMillicores", - message: "cpuLimitMillicores", - required: true - }, { - type: "text", - name: "cpuRequestMillicores", - message: "cpuRequestMillicores", - required: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: true - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: true - }, { - type: "text", - name: "installationId", - message: "installationId", - required: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: true - }, { - type: "text", - name: "lastHeartbeatAt", - message: "lastHeartbeatAt", - required: true - }, { - type: "text", - name: "memoryLimitBytes", - message: "memoryLimitBytes", - required: true - }, { - type: "text", - name: "memoryRequestBytes", - message: "memoryRequestBytes", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "replicas", - message: "replicas", - required: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: true - }, { - type: "text", - name: "resourceDefinitionId", - message: "resourceDefinitionId", - required: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "json", - name: "spec", - message: "spec", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: true - }, { - type: "text", - name: "statusDetail", - message: "statusDetail", - required: true - }, { - type: "json", - name: "statusObserved", - message: "statusObserved", - required: true - }, { - type: "text", - name: "storageClass", - message: "storageClass", - required: true - }, { - type: "text", - name: "storageSizeBytes", - message: "storageSizeBytes", - required: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: true, + }, + { + type: 'text', + name: 'cpuLimitMillicores', + message: 'cpuLimitMillicores', + required: true, + }, + { + type: 'text', + name: 'cpuRequestMillicores', + message: 'cpuRequestMillicores', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: true, + }, + { + type: 'text', + name: 'installationId', + message: 'installationId', + required: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: true, + }, + { + type: 'text', + name: 'lastHeartbeatAt', + message: 'lastHeartbeatAt', + required: true, + }, + { + type: 'text', + name: 'memoryLimitBytes', + message: 'memoryLimitBytes', + required: true, + }, + { + type: 'text', + name: 'memoryRequestBytes', + message: 'memoryRequestBytes', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'replicas', + message: 'replicas', + required: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: true, + }, + { + type: 'text', + name: 'resourceDefinitionId', + message: 'resourceDefinitionId', + required: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'json', + name: 'spec', + message: 'spec', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: true, + }, + { + type: 'text', + name: 'statusDetail', + message: 'statusDetail', + required: true, + }, + { + type: 'json', + name: 'statusObserved', + message: 'statusObserved', + required: true, + }, + { + type: 'text', + name: 'storageClass', + message: 'storageClass', + required: true, + }, + { + type: 'text', + name: 'storageSizeBytes', + message: 'storageSizeBytes', + required: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourcesHealthInput["platformResourcesHealth"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourcesHealthInput['platformResourcesHealth']; const client = getClient(); - const result = await client.platformResourcesHealth.create({ - data: { - annotations: cleanedData.annotations, - cpuLimitMillicores: cleanedData.cpuLimitMillicores, - cpuRequestMillicores: cleanedData.cpuRequestMillicores, - createdBy: cleanedData.createdBy, - errorCount: cleanedData.errorCount, - installationId: cleanedData.installationId, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastHeartbeatAt: cleanedData.lastHeartbeatAt, - memoryLimitBytes: cleanedData.memoryLimitBytes, - memoryRequestBytes: cleanedData.memoryRequestBytes, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - replicas: cleanedData.replicas, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - resourceDefinitionId: cleanedData.resourceDefinitionId, - slug: cleanedData.slug, - spec: cleanedData.spec, - status: cleanedData.status, - statusDetail: cleanedData.statusDetail, - statusObserved: cleanedData.statusObserved, - storageClass: cleanedData.storageClass, - storageSizeBytes: cleanedData.storageSizeBytes, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - cpuLimitMillicores: true, - cpuRequestMillicores: true, - createdAt: true, - createdBy: true, - errorCount: true, - id: true, - installationId: true, - integrations: true, - kind: true, - labels: true, - lastError: true, - lastHeartbeatAt: true, - memoryLimitBytes: true, - memoryRequestBytes: true, - name: true, - namespaceId: true, - replicas: true, - requiredConfigs: true, - requiredSecrets: true, - resourceDefinitionId: true, - slug: true, - spec: true, - status: true, - statusDetail: true, - statusObserved: true, - storageClass: true, - storageSizeBytes: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformResourcesHealth + .create({ + data: { + annotations: cleanedData.annotations, + cpuLimitMillicores: cleanedData.cpuLimitMillicores, + cpuRequestMillicores: cleanedData.cpuRequestMillicores, + createdBy: cleanedData.createdBy, + errorCount: cleanedData.errorCount, + installationId: cleanedData.installationId, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastHeartbeatAt: cleanedData.lastHeartbeatAt, + memoryLimitBytes: cleanedData.memoryLimitBytes, + memoryRequestBytes: cleanedData.memoryRequestBytes, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + replicas: cleanedData.replicas, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + resourceDefinitionId: cleanedData.resourceDefinitionId, + slug: cleanedData.slug, + spec: cleanedData.spec, + status: cleanedData.status, + statusDetail: cleanedData.statusDetail, + statusObserved: cleanedData.statusObserved, + storageClass: cleanedData.storageClass, + storageSizeBytes: cleanedData.storageSizeBytes, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + cpuLimitMillicores: true, + cpuRequestMillicores: true, + createdAt: true, + createdBy: true, + errorCount: true, + id: true, + installationId: true, + integrations: true, + kind: true, + labels: true, + lastError: true, + lastHeartbeatAt: true, + memoryLimitBytes: true, + memoryRequestBytes: true, + name: true, + namespaceId: true, + replicas: true, + requiredConfigs: true, + requiredSecrets: true, + resourceDefinitionId: true, + slug: true, + spec: true, + status: true, + statusDetail: true, + statusObserved: true, + storageClass: true, + storageSizeBytes: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resources-requirements-state.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resources-requirements-state.ts index 20463a4e92..1ce47d2c3b 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resources-requirements-state.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resources-requirements-state.ts @@ -3,49 +3,63 @@ * @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 { CreatePlatformResourcesRequirementsStateInput, PlatformResourcesRequirementsStatePatch, PlatformResourcesRequirementsStateSelect, PlatformResourcesRequirementsStateFilter, PlatformResourcesRequirementsStateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourcesRequirementsStateInput, + PlatformResourcesRequirementsStatePatch, + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - configHash: "string", - configObjectName: "string", - requirementsHash: "string", - resourceId: "uuid", - secretsHash: "string", - secretsObjectName: "string", - slug: "string" + configHash: 'string', + configObjectName: 'string', + requirementsHash: 'string', + resourceId: 'uuid', + secretsHash: 'string', + secretsObjectName: 'string', + slug: 'string', }; -const usage = "\nplatform-resources-requirements-state \n\nCommands:\n list List platformResourcesRequirementsState records\n find-first Find first matching platformResourcesRequirementsState record\n create Create a new platformResourcesRequirementsState\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) => { +const usage = + '\nplatform-resources-requirements-state \n\nCommands:\n list List platformResourcesRequirementsState records\n find-first Find first matching platformResourcesRequirementsState record\n create Create a new platformResourcesRequirementsState\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -61,16 +75,22 @@ async function handleList(argv: Partial>, _prompter: Inq resourceId: true, secretsHash: true, secretsObjectName: true, - slug: true + slug: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourcesRequirementsStateSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + > & { + select: PlatformResourcesRequirementsStateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformResourcesRequirementsState.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,24 @@ async function handleFindFirst(argv: Partial>, _prompter resourceId: true, secretsHash: true, secretsObjectName: true, - slug: true + slug: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourcesRequirementsStateSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + > & { + select: PlatformResourcesRequirementsStateSelect; + } + >(argv, defaultSelect); const client = getClient(); - const result = await client.platformResourcesRequirementsState.findFirst(findFirstArgs).execute(); + const result = await client.platformResourcesRequirementsState + .findFirst(findFirstArgs) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,71 +132,84 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "configHash", - message: "configHash", - required: true - }, { - type: "text", - name: "configObjectName", - message: "configObjectName", - required: true - }, { - type: "text", - name: "requirementsHash", - message: "requirementsHash", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }, { - type: "text", - name: "secretsHash", - message: "secretsHash", - required: true - }, { - type: "text", - name: "secretsObjectName", - message: "secretsObjectName", - required: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'configHash', + message: 'configHash', + required: true, + }, + { + type: 'text', + name: 'configObjectName', + message: 'configObjectName', + required: true, + }, + { + type: 'text', + name: 'requirementsHash', + message: 'requirementsHash', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + { + type: 'text', + name: 'secretsHash', + message: 'secretsHash', + required: true, + }, + { + type: 'text', + name: 'secretsObjectName', + message: 'secretsObjectName', + required: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourcesRequirementsStateInput["platformResourcesRequirementsState"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourcesRequirementsStateInput['platformResourcesRequirementsState']; const client = getClient(); - const result = await client.platformResourcesRequirementsState.create({ - data: { - configHash: cleanedData.configHash, - configObjectName: cleanedData.configObjectName, - requirementsHash: cleanedData.requirementsHash, - resourceId: cleanedData.resourceId, - secretsHash: cleanedData.secretsHash, - secretsObjectName: cleanedData.secretsObjectName, - slug: cleanedData.slug - }, - select: { - configHash: true, - configObjectName: true, - requirementsHash: true, - resourceId: true, - secretsHash: true, - secretsObjectName: true, - slug: true - } - }).execute(); + const result = await client.platformResourcesRequirementsState + .create({ + data: { + configHash: cleanedData.configHash, + configObjectName: cleanedData.configObjectName, + requirementsHash: cleanedData.requirementsHash, + resourceId: cleanedData.resourceId, + secretsHash: cleanedData.secretsHash, + secretsObjectName: cleanedData.secretsObjectName, + slug: cleanedData.slug, + }, + select: { + configHash: true, + configObjectName: true, + requirementsHash: true, + resourceId: true, + secretsHash: true, + secretsObjectName: true, + slug: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-resources-resolved-requirement.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-resources-resolved-requirement.ts index 74283b8a23..f334fec52b 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-resources-resolved-requirement.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-resources-resolved-requirement.ts @@ -3,52 +3,66 @@ * @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 { CreatePlatformResourcesResolvedRequirementInput, PlatformResourcesResolvedRequirementPatch, PlatformResourcesResolvedRequirementSelect, PlatformResourcesResolvedRequirementFilter, PlatformResourcesResolvedRequirementOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformResourcesResolvedRequirementInput, + PlatformResourcesResolvedRequirementPatch, + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - atomId: "uuid", - configObjectName: "string", - name: "string", - namespaceId: "uuid", - present: "boolean", - required: "boolean", - requirementKind: "string", - resourceId: "uuid", - secretsObjectName: "string", - slug: "string" + atomId: 'uuid', + configObjectName: 'string', + name: 'string', + namespaceId: 'uuid', + present: 'boolean', + required: 'boolean', + requirementKind: 'string', + resourceId: 'uuid', + secretsObjectName: 'string', + slug: 'string', }; -const usage = "\nplatform-resources-resolved-requirement \n\nCommands:\n list List platformResourcesResolvedRequirement records\n find-first Find first matching platformResourcesResolvedRequirement record\n create Create a new platformResourcesResolvedRequirement\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) => { +const usage = + '\nplatform-resources-resolved-requirement \n\nCommands:\n list List platformResourcesResolvedRequirement records\n find-first Find first matching platformResourcesResolvedRequirement record\n create Create a new platformResourcesResolvedRequirement\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -67,16 +81,24 @@ async function handleList(argv: Partial>, _prompter: Inq requirementKind: true, resourceId: true, secretsObjectName: true, - slug: true + slug: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformResourcesResolvedRequirementSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + > & { + select: PlatformResourcesResolvedRequirementSelect; + } + >(argv, defaultSelect); const client = getClient(); - const result = await client.platformResourcesResolvedRequirement.findMany(findManyArgs).execute(); + const result = await client.platformResourcesResolvedRequirement + .findMany(findManyArgs) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +117,24 @@ async function handleFindFirst(argv: Partial>, _prompter requirementKind: true, resourceId: true, secretsObjectName: true, - slug: true + slug: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformResourcesResolvedRequirementSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + > & { + select: PlatformResourcesResolvedRequirementSelect; + } + >(argv, defaultSelect); const client = getClient(); - const result = await client.platformResourcesResolvedRequirement.findFirst(findFirstArgs).execute(); + const result = await client.platformResourcesResolvedRequirement + .findFirst(findFirstArgs) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,92 +143,108 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "atomId", - message: "atomId", - required: true - }, { - type: "text", - name: "configObjectName", - message: "configObjectName", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "boolean", - name: "present", - message: "present", - required: true - }, { - type: "boolean", - name: "required", - message: "required", - required: true - }, { - type: "text", - name: "requirementKind", - message: "requirementKind", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }, { - type: "text", - name: "secretsObjectName", - message: "secretsObjectName", - required: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }]); - const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformResourcesResolvedRequirementInput["platformResourcesResolvedRequirement"]; - const client = getClient(); - const result = await client.platformResourcesResolvedRequirement.create({ - data: { - atomId: cleanedData.atomId, - configObjectName: cleanedData.configObjectName, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - present: cleanedData.present, - required: cleanedData.required, - requirementKind: cleanedData.requirementKind, - resourceId: cleanedData.resourceId, - secretsObjectName: cleanedData.secretsObjectName, - slug: cleanedData.slug + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'atomId', + message: 'atomId', + required: true, }, - select: { - atomId: true, - configObjectName: true, - name: true, - namespaceId: true, - present: true, + { + type: 'text', + name: 'configObjectName', + message: 'configObjectName', required: true, - requirementKind: true, - resourceId: true, - secretsObjectName: true, - slug: true - } - }).execute(); + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'boolean', + name: 'present', + message: 'present', + required: true, + }, + { + type: 'boolean', + name: 'required', + message: 'required', + required: true, + }, + { + type: 'text', + name: 'requirementKind', + message: 'requirementKind', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + { + type: 'text', + name: 'secretsObjectName', + message: 'secretsObjectName', + required: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformResourcesResolvedRequirementInput['platformResourcesResolvedRequirement']; + const client = getClient(); + const result = await client.platformResourcesResolvedRequirement + .create({ + data: { + atomId: cleanedData.atomId, + configObjectName: cleanedData.configObjectName, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + present: cleanedData.present, + required: cleanedData.required, + requirementKind: cleanedData.requirementKind, + resourceId: cleanedData.resourceId, + secretsObjectName: cleanedData.secretsObjectName, + slug: cleanedData.slug, + }, + select: { + atomId: true, + configObjectName: true, + name: true, + namespaceId: true, + present: true, + required: true, + requirementKind: true, + resourceId: true, + secretsObjectName: true, + slug: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-webhook-endpoint.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-webhook-endpoint.ts index dd0922630e..6775ec1d2e 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-webhook-endpoint.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-webhook-endpoint.ts @@ -3,61 +3,75 @@ * @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 { CreatePlatformWebhookEndpointInput, PlatformWebhookEndpointPatch, PlatformWebhookEndpointSelect, PlatformWebhookEndpointFilter, PlatformWebhookEndpointOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformWebhookEndpointInput, + PlatformWebhookEndpointPatch, + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - active: "boolean", - createdAt: "string", - createdBy: "uuid", - functionDefinitionId: "uuid", - host: "string", - id: "uuid", - namespaceId: "uuid", - path: "string", - provider: "string", - replayWindowSeconds: "int", - signingSecretName: "string", - updatedAt: "string", - updatedBy: "uuid" + active: 'boolean', + createdAt: 'string', + createdBy: 'uuid', + functionDefinitionId: 'uuid', + host: 'string', + id: 'uuid', + namespaceId: 'uuid', + path: 'string', + provider: 'string', + replayWindowSeconds: 'int', + signingSecretName: 'string', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nplatform-webhook-endpoint \n\nCommands:\n list List platformWebhookEndpoint records\n find-first Find first matching platformWebhookEndpoint record\n get Get a platformWebhookEndpoint by ID\n create Create a new platformWebhookEndpoint\n update Update an existing platformWebhookEndpoint\n delete Delete a platformWebhookEndpoint\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) => { +const usage = + '\nplatform-webhook-endpoint \n\nCommands:\n list List platformWebhookEndpoint records\n find-first Find first matching platformWebhookEndpoint record\n get Get a platformWebhookEndpoint by ID\n create Create a new platformWebhookEndpoint\n update Update an existing platformWebhookEndpoint\n delete Delete a platformWebhookEndpoint\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,22 @@ async function handleList(argv: Partial>, _prompter: Inq replayWindowSeconds: true, signingSecretName: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformWebhookEndpointSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy + > & { + select: PlatformWebhookEndpointSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformWebhookEndpoint.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +130,22 @@ async function handleFindFirst(argv: Partial>, _prompter replayWindowSeconds: true, signingSecretName: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformWebhookEndpointSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy + > & { + select: PlatformWebhookEndpointSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformWebhookEndpoint.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +154,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformWebhookEndpoint.findOne({ - id: answers.id as string, - select: { - active: true, - createdAt: true, - createdBy: true, - functionDefinitionId: true, - host: true, - id: true, - namespaceId: true, - path: true, - provider: true, - replayWindowSeconds: true, - signingSecretName: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformWebhookEndpoint + .findOne({ + id: answers.id as string, + select: { + active: true, + createdAt: true, + createdBy: true, + functionDefinitionId: true, + host: true, + id: true, + namespaceId: true, + path: true, + provider: true, + replayWindowSeconds: true, + signingSecretName: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,97 +194,113 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "active", - message: "active", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: true - }, { - type: "text", - name: "host", - message: "host", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "path", - message: "path", - required: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "replayWindowSeconds", - message: "replayWindowSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signingSecretName", - message: "signingSecretName", - required: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'active', + message: 'active', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: true, + }, + { + type: 'text', + name: 'host', + message: 'host', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'replayWindowSeconds', + message: 'replayWindowSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signingSecretName', + message: 'signingSecretName', + required: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformWebhookEndpointInput["platformWebhookEndpoint"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformWebhookEndpointInput['platformWebhookEndpoint']; const client = getClient(); - const result = await client.platformWebhookEndpoint.create({ - data: { - active: cleanedData.active, - createdBy: cleanedData.createdBy, - functionDefinitionId: cleanedData.functionDefinitionId, - host: cleanedData.host, - namespaceId: cleanedData.namespaceId, - path: cleanedData.path, - provider: cleanedData.provider, - replayWindowSeconds: cleanedData.replayWindowSeconds, - signingSecretName: cleanedData.signingSecretName, - updatedBy: cleanedData.updatedBy - }, - select: { - active: true, - createdAt: true, - createdBy: true, - functionDefinitionId: true, - host: true, - id: true, - namespaceId: true, - path: true, - provider: true, - replayWindowSeconds: true, - signingSecretName: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformWebhookEndpoint + .create({ + data: { + active: cleanedData.active, + createdBy: cleanedData.createdBy, + functionDefinitionId: cleanedData.functionDefinitionId, + host: cleanedData.host, + namespaceId: cleanedData.namespaceId, + path: cleanedData.path, + provider: cleanedData.provider, + replayWindowSeconds: cleanedData.replayWindowSeconds, + signingSecretName: cleanedData.signingSecretName, + updatedBy: cleanedData.updatedBy, + }, + select: { + active: true, + createdAt: true, + createdBy: true, + functionDefinitionId: true, + host: true, + id: true, + namespaceId: true, + path: true, + provider: true, + replayWindowSeconds: true, + signingSecretName: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -263,105 +309,119 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "active", - message: "active", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: false - }, { - type: "text", - name: "host", - message: "host", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "path", - message: "path", - required: false - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "replayWindowSeconds", - message: "replayWindowSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signingSecretName", - message: "signingSecretName", - required: false - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'active', + message: 'active', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + }, + { + type: 'text', + name: 'host', + message: 'host', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: false, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'replayWindowSeconds', + message: 'replayWindowSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signingSecretName', + message: 'signingSecretName', + required: false, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformWebhookEndpointPatch; const client = getClient(); - const result = await client.platformWebhookEndpoint.update({ - where: { - id: answers.id as string - }, - data: { - active: cleanedData.active, - createdBy: cleanedData.createdBy, - functionDefinitionId: cleanedData.functionDefinitionId, - host: cleanedData.host, - namespaceId: cleanedData.namespaceId, - path: cleanedData.path, - provider: cleanedData.provider, - replayWindowSeconds: cleanedData.replayWindowSeconds, - signingSecretName: cleanedData.signingSecretName, - updatedBy: cleanedData.updatedBy - }, - select: { - active: true, - createdAt: true, - createdBy: true, - functionDefinitionId: true, - host: true, - id: true, - namespaceId: true, - path: true, - provider: true, - replayWindowSeconds: true, - signingSecretName: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.platformWebhookEndpoint + .update({ + where: { + id: answers.id as string, + }, + data: { + active: cleanedData.active, + createdBy: cleanedData.createdBy, + functionDefinitionId: cleanedData.functionDefinitionId, + host: cleanedData.host, + namespaceId: cleanedData.namespaceId, + path: cleanedData.path, + provider: cleanedData.provider, + replayWindowSeconds: cleanedData.replayWindowSeconds, + signingSecretName: cleanedData.signingSecretName, + updatedBy: cleanedData.updatedBy, + }, + select: { + active: true, + createdAt: true, + createdBy: true, + functionDefinitionId: true, + host: true, + id: true, + namespaceId: true, + path: true, + provider: true, + replayWindowSeconds: true, + signingSecretName: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -370,28 +430,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformWebhookEndpoint.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformWebhookEndpoint + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/platform-webhook-event.ts b/sdk/constructive-cli/src/compute/cli/commands/platform-webhook-event.ts index e64265bb43..ed793994e0 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/platform-webhook-event.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/platform-webhook-event.ts @@ -3,60 +3,74 @@ * @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 { CreatePlatformWebhookEventInput, PlatformWebhookEventPatch, PlatformWebhookEventSelect, PlatformWebhookEventFilter, PlatformWebhookEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformWebhookEventInput, + PlatformWebhookEventPatch, + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - endpointId: "uuid", - error: "string", - externalEventId: "string", - id: "uuid", - invocationCreatedAt: "string", - invocationId: "uuid", - payload: "json", - provider: "string", - providerTimestamp: "string", - status: "string", - updatedAt: "string" + createdAt: 'string', + endpointId: 'uuid', + error: 'string', + externalEventId: 'string', + id: 'uuid', + invocationCreatedAt: 'string', + invocationId: 'uuid', + payload: 'json', + provider: 'string', + providerTimestamp: 'string', + status: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-webhook-event \n\nCommands:\n list List platformWebhookEvent records\n find-first Find first matching platformWebhookEvent record\n get Get a platformWebhookEvent by ID\n create Create a new platformWebhookEvent\n update Update an existing platformWebhookEvent\n delete Delete a platformWebhookEvent\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) => { +const usage = + '\nplatform-webhook-event \n\nCommands:\n list List platformWebhookEvent records\n find-first Find first matching platformWebhookEvent record\n get Get a platformWebhookEvent by ID\n create Create a new platformWebhookEvent\n update Update an existing platformWebhookEvent\n delete Delete a platformWebhookEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,22 @@ async function handleList(argv: Partial>, _prompter: Inq provider: true, providerTimestamp: true, status: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformWebhookEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy + > & { + select: PlatformWebhookEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformWebhookEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +127,22 @@ async function handleFindFirst(argv: Partial>, _prompter provider: true, providerTimestamp: true, status: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformWebhookEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy + > & { + select: PlatformWebhookEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformWebhookEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +151,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformWebhookEvent.findOne({ - id: answers.id as string, - select: { - createdAt: true, - endpointId: true, - error: true, - externalEventId: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - payload: true, - provider: true, - providerTimestamp: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformWebhookEvent + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + endpointId: true, + error: true, + externalEventId: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + payload: true, + provider: true, + providerTimestamp: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,91 +190,106 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "endpointId", - message: "endpointId", - required: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "externalEventId", - message: "externalEventId", - required: true - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payload", - message: "payload", - required: false, - skipPrompt: true - }, { - type: "text", - name: "provider", - message: "provider", - required: true - }, { - type: "text", - name: "providerTimestamp", - message: "providerTimestamp", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'endpointId', + message: 'endpointId', + required: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'externalEventId', + message: 'externalEventId', + required: true, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: true, + }, + { + type: 'text', + name: 'providerTimestamp', + message: 'providerTimestamp', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformWebhookEventInput["platformWebhookEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformWebhookEventInput['platformWebhookEvent']; const client = getClient(); - const result = await client.platformWebhookEvent.create({ - data: { - endpointId: cleanedData.endpointId, - error: cleanedData.error, - externalEventId: cleanedData.externalEventId, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - payload: cleanedData.payload, - provider: cleanedData.provider, - providerTimestamp: cleanedData.providerTimestamp, - status: cleanedData.status - }, - select: { - createdAt: true, - endpointId: true, - error: true, - externalEventId: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - payload: true, - provider: true, - providerTimestamp: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformWebhookEvent + .create({ + data: { + endpointId: cleanedData.endpointId, + error: cleanedData.error, + externalEventId: cleanedData.externalEventId, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + payload: cleanedData.payload, + provider: cleanedData.provider, + providerTimestamp: cleanedData.providerTimestamp, + status: cleanedData.status, + }, + select: { + createdAt: true, + endpointId: true, + error: true, + externalEventId: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + payload: true, + provider: true, + providerTimestamp: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -253,99 +298,112 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "endpointId", - message: "endpointId", - required: false - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "externalEventId", - message: "externalEventId", - required: false - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payload", - message: "payload", - required: false, - skipPrompt: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false - }, { - type: "text", - name: "providerTimestamp", - message: "providerTimestamp", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'endpointId', + message: 'endpointId', + required: false, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'externalEventId', + message: 'externalEventId', + required: false, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + }, + { + type: 'text', + name: 'providerTimestamp', + message: 'providerTimestamp', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformWebhookEventPatch; const client = getClient(); - const result = await client.platformWebhookEvent.update({ - where: { - id: answers.id as string - }, - data: { - endpointId: cleanedData.endpointId, - error: cleanedData.error, - externalEventId: cleanedData.externalEventId, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - payload: cleanedData.payload, - provider: cleanedData.provider, - providerTimestamp: cleanedData.providerTimestamp, - status: cleanedData.status - }, - select: { - createdAt: true, - endpointId: true, - error: true, - externalEventId: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - payload: true, - provider: true, - providerTimestamp: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformWebhookEvent + .update({ + where: { + id: answers.id as string, + }, + data: { + endpointId: cleanedData.endpointId, + error: cleanedData.error, + externalEventId: cleanedData.externalEventId, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + payload: cleanedData.payload, + provider: cleanedData.provider, + providerTimestamp: cleanedData.providerTimestamp, + status: cleanedData.status, + }, + select: { + createdAt: true, + endpointId: true, + error: true, + externalEventId: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + payload: true, + provider: true, + providerTimestamp: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -354,28 +412,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformWebhookEvent.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformWebhookEvent + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/compute/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/read-function-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/read-function-graph.ts index 52027b7ae1..ca5752bb22 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/read-function-graph.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/read-function-graph.ts @@ -3,28 +3,38 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { ReadFunctionGraphVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { ReadFunctionGraphVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("read-function-graph - readFunctionGraph\n\nUsage: read-function-graph [OPTIONS]\n"); + console.log( + 'read-function-graph - readFunctionGraph\n\nUsage: read-function-graph [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "graphId", - message: "graphId" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'graphId', + message: 'graphId', + }, + ]); const client = getClient(); - const result = await client.query.readFunctionGraph(answers as unknown as ReadFunctionGraphVariables).execute(); + const result = await client.query + .readFunctionGraph(answers as unknown as ReadFunctionGraphVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: readFunctionGraph"); + console.error('Failed: readFunctionGraph'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-declared-capacity.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-declared-capacity.ts index 3d6e5c58cc..90de479b7f 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-declared-capacity.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-declared-capacity.ts @@ -3,55 +3,69 @@ * @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 { CreateResourceDeclaredCapacityInput, ResourceDeclaredCapacityPatch, ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityFilter, ResourceDeclaredCapacityOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceDeclaredCapacityInput, + ResourceDeclaredCapacityPatch, + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - cpuLimitMillicores: "int", - cpuRequestMillicores: "int", - installationId: "uuid", - isTransient: "boolean", - kind: "string", - memoryLimitBytes: "int", - memoryRequestBytes: "int", - namespaceId: "uuid", - podCountMax: "int", - podCountMin: "int", - source: "string", - sourceId: "uuid", - storageSizeBytes: "int" + cpuLimitMillicores: 'int', + cpuRequestMillicores: 'int', + installationId: 'uuid', + isTransient: 'boolean', + kind: 'string', + memoryLimitBytes: 'int', + memoryRequestBytes: 'int', + namespaceId: 'uuid', + podCountMax: 'int', + podCountMin: 'int', + source: 'string', + sourceId: 'uuid', + storageSizeBytes: 'int', }; -const usage = "\nresource-declared-capacity \n\nCommands:\n list List resourceDeclaredCapacity records\n find-first Find first matching resourceDeclaredCapacity record\n create Create a new resourceDeclaredCapacity\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) => { +const usage = + '\nresource-declared-capacity \n\nCommands:\n list List resourceDeclaredCapacity records\n find-first Find first matching resourceDeclaredCapacity record\n create Create a new resourceDeclaredCapacity\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -73,16 +87,22 @@ async function handleList(argv: Partial>, _prompter: Inq podCountMin: true, source: true, sourceId: true, - storageSizeBytes: true + storageSizeBytes: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceDeclaredCapacitySelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy + > & { + select: ResourceDeclaredCapacitySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceDeclaredCapacity.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +124,22 @@ async function handleFindFirst(argv: Partial>, _prompter podCountMin: true, source: true, sourceId: true, - storageSizeBytes: true + storageSizeBytes: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceDeclaredCapacitySelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy + > & { + select: ResourceDeclaredCapacitySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceDeclaredCapacity.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,113 +148,132 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "cpuLimitMillicores", - message: "cpuLimitMillicores", - required: true - }, { - type: "text", - name: "cpuRequestMillicores", - message: "cpuRequestMillicores", - required: true - }, { - type: "text", - name: "installationId", - message: "installationId", - required: true - }, { - type: "boolean", - name: "isTransient", - message: "isTransient", - required: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "text", - name: "memoryLimitBytes", - message: "memoryLimitBytes", - required: true - }, { - type: "text", - name: "memoryRequestBytes", - message: "memoryRequestBytes", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "podCountMax", - message: "podCountMax", - required: true - }, { - type: "text", - name: "podCountMin", - message: "podCountMin", - required: true - }, { - type: "text", - name: "source", - message: "source", - required: true - }, { - type: "text", - name: "sourceId", - message: "sourceId", - required: true - }, { - type: "text", - name: "storageSizeBytes", - message: "storageSizeBytes", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'cpuLimitMillicores', + message: 'cpuLimitMillicores', + required: true, + }, + { + type: 'text', + name: 'cpuRequestMillicores', + message: 'cpuRequestMillicores', + required: true, + }, + { + type: 'text', + name: 'installationId', + message: 'installationId', + required: true, + }, + { + type: 'boolean', + name: 'isTransient', + message: 'isTransient', + required: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'text', + name: 'memoryLimitBytes', + message: 'memoryLimitBytes', + required: true, + }, + { + type: 'text', + name: 'memoryRequestBytes', + message: 'memoryRequestBytes', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'podCountMax', + message: 'podCountMax', + required: true, + }, + { + type: 'text', + name: 'podCountMin', + message: 'podCountMin', + required: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: true, + }, + { + type: 'text', + name: 'sourceId', + message: 'sourceId', + required: true, + }, + { + type: 'text', + name: 'storageSizeBytes', + message: 'storageSizeBytes', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceDeclaredCapacityInput["resourceDeclaredCapacity"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceDeclaredCapacityInput['resourceDeclaredCapacity']; const client = getClient(); - const result = await client.resourceDeclaredCapacity.create({ - data: { - cpuLimitMillicores: cleanedData.cpuLimitMillicores, - cpuRequestMillicores: cleanedData.cpuRequestMillicores, - installationId: cleanedData.installationId, - isTransient: cleanedData.isTransient, - kind: cleanedData.kind, - memoryLimitBytes: cleanedData.memoryLimitBytes, - memoryRequestBytes: cleanedData.memoryRequestBytes, - namespaceId: cleanedData.namespaceId, - podCountMax: cleanedData.podCountMax, - podCountMin: cleanedData.podCountMin, - source: cleanedData.source, - sourceId: cleanedData.sourceId, - storageSizeBytes: cleanedData.storageSizeBytes - }, - select: { - cpuLimitMillicores: true, - cpuRequestMillicores: true, - installationId: true, - isTransient: true, - kind: true, - memoryLimitBytes: true, - memoryRequestBytes: true, - namespaceId: true, - podCountMax: true, - podCountMin: true, - source: true, - sourceId: true, - storageSizeBytes: true - } - }).execute(); + const result = await client.resourceDeclaredCapacity + .create({ + data: { + cpuLimitMillicores: cleanedData.cpuLimitMillicores, + cpuRequestMillicores: cleanedData.cpuRequestMillicores, + installationId: cleanedData.installationId, + isTransient: cleanedData.isTransient, + kind: cleanedData.kind, + memoryLimitBytes: cleanedData.memoryLimitBytes, + memoryRequestBytes: cleanedData.memoryRequestBytes, + namespaceId: cleanedData.namespaceId, + podCountMax: cleanedData.podCountMax, + podCountMin: cleanedData.podCountMin, + source: cleanedData.source, + sourceId: cleanedData.sourceId, + storageSizeBytes: cleanedData.storageSizeBytes, + }, + select: { + cpuLimitMillicores: true, + cpuRequestMillicores: true, + installationId: true, + isTransient: true, + kind: true, + memoryLimitBytes: true, + memoryRequestBytes: true, + namespaceId: true, + podCountMax: true, + podCountMin: true, + source: true, + sourceId: true, + storageSizeBytes: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-definition.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-definition.ts index 65d193f9e9..ab364628e7 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-definition.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-definition.ts @@ -3,66 +3,80 @@ * @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 { CreateResourceDefinitionInput, ResourceDefinitionPatch, ResourceDefinitionSelect, ResourceDefinitionFilter, ResourceDefinitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceDefinitionInput, + ResourceDefinitionPatch, + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - defaultSpec: "json", - description: "string", - id: "uuid", - integrations: "string", - kind: "string", - labels: "json", - name: "string", - namespaceId: "uuid", - requiredConfigs: "string", - requiredSecrets: "string", - slug: "string", - stepUpMinAge: "string", - updatedAt: "string", - updatedBy: "uuid" + annotations: 'json', + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + defaultSpec: 'json', + description: 'string', + id: 'uuid', + integrations: 'string', + kind: 'string', + labels: 'json', + name: 'string', + namespaceId: 'uuid', + requiredConfigs: 'string', + requiredSecrets: 'string', + slug: 'string', + stepUpMinAge: 'string', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nresource-definition \n\nCommands:\n list List resourceDefinition records\n find-first Find first matching resourceDefinition record\n get Get a resourceDefinition by ID\n create Create a new resourceDefinition\n update Update an existing resourceDefinition\n delete Delete a resourceDefinition\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) => { +const usage = + '\nresource-definition \n\nCommands:\n list List resourceDefinition records\n find-first Find first matching resourceDefinition record\n get Get a resourceDefinition by ID\n create Create a new resourceDefinition\n update Update an existing resourceDefinition\n delete Delete a resourceDefinition\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -89,16 +103,22 @@ async function handleList(argv: Partial>, _prompter: Inq slug: true, stepUpMinAge: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceDefinitionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy + > & { + select: ResourceDefinitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceDefinition.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -125,16 +145,22 @@ async function handleFindFirst(argv: Partial>, _prompter slug: true, stepUpMinAge: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceDefinitionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy + > & { + select: ResourceDefinitionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceDefinition.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -143,39 +169,43 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.resourceDefinition.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - createdBy: true, - databaseId: true, - defaultSpec: true, - description: true, - id: true, - integrations: true, - kind: true, - labels: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - stepUpMinAge: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resourceDefinition + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + createdBy: true, + databaseId: true, + defaultSpec: true, + description: true, + id: true, + integrations: true, + kind: true, + labels: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + stepUpMinAge: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -184,137 +214,158 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "json", - name: "defaultSpec", - message: "defaultSpec", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "stepUpMinAge", - message: "stepUpMinAge", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'json', + name: 'defaultSpec', + message: 'defaultSpec', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'stepUpMinAge', + message: 'stepUpMinAge', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceDefinitionInput["resourceDefinition"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceDefinitionInput['resourceDefinition']; const client = getClient(); - const result = await client.resourceDefinition.create({ - data: { - annotations: cleanedData.annotations, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - defaultSpec: cleanedData.defaultSpec, - description: cleanedData.description, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - slug: cleanedData.slug, - stepUpMinAge: cleanedData.stepUpMinAge, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - createdAt: true, - createdBy: true, - databaseId: true, - defaultSpec: true, - description: true, - id: true, - integrations: true, - kind: true, - labels: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - stepUpMinAge: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resourceDefinition + .create({ + data: { + annotations: cleanedData.annotations, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + defaultSpec: cleanedData.defaultSpec, + description: cleanedData.description, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + slug: cleanedData.slug, + stepUpMinAge: cleanedData.stepUpMinAge, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + createdAt: true, + createdBy: true, + databaseId: true, + defaultSpec: true, + description: true, + id: true, + integrations: true, + kind: true, + labels: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + stepUpMinAge: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -323,145 +374,164 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "json", - name: "defaultSpec", - message: "defaultSpec", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: false - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "stepUpMinAge", - message: "stepUpMinAge", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'json', + name: 'defaultSpec', + message: 'defaultSpec', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: false, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'stepUpMinAge', + message: 'stepUpMinAge', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ResourceDefinitionPatch; const client = getClient(); - const result = await client.resourceDefinition.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - defaultSpec: cleanedData.defaultSpec, - description: cleanedData.description, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - slug: cleanedData.slug, - stepUpMinAge: cleanedData.stepUpMinAge, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - createdAt: true, - createdBy: true, - databaseId: true, - defaultSpec: true, - description: true, - id: true, - integrations: true, - kind: true, - labels: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - slug: true, - stepUpMinAge: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resourceDefinition + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + defaultSpec: cleanedData.defaultSpec, + description: cleanedData.description, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + slug: cleanedData.slug, + stepUpMinAge: cleanedData.stepUpMinAge, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + createdAt: true, + createdBy: true, + databaseId: true, + defaultSpec: true, + description: true, + id: true, + integrations: true, + kind: true, + labels: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + slug: true, + stepUpMinAge: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -470,28 +540,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.resourceDefinition.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.resourceDefinition + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-event.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-event.ts index c9aa712910..4a380bd2af 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-event.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-event.ts @@ -3,56 +3,70 @@ * @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 { CreateResourceEventInput, ResourceEventPatch, ResourceEventSelect, ResourceEventFilter, ResourceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceEventInput, + ResourceEventPatch, + ResourceEventSelect, + ResourceEventFilter, + ResourceEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - databaseId: "uuid", - eventType: "string", - id: "uuid", - message: "string", - metadata: "json", - resourceId: "uuid" + actorId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + eventType: 'string', + id: 'uuid', + message: 'string', + metadata: 'json', + resourceId: 'uuid', }; -const usage = "\nresource-event \n\nCommands:\n list List resourceEvent records\n find-first Find first matching resourceEvent record\n get Get a resourceEvent by ID\n create Create a new resourceEvent\n update Update an existing resourceEvent\n delete Delete a resourceEvent\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) => { +const usage = + '\nresource-event \n\nCommands:\n list List resourceEvent records\n find-first Find first matching resourceEvent record\n get Get a resourceEvent by ID\n create Create a new resourceEvent\n update Update an existing resourceEvent\n delete Delete a resourceEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, message: true, metadata: true, - resourceId: true + resourceId: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ResourceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, message: true, metadata: true, - resourceId: true + resourceId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ResourceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.resourceEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - resourceId: true - } - }).execute(); + const result = await client.resourceEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + resourceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,66 +166,78 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceEventInput["resourceEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceEventInput['resourceEvent']; const client = getClient(); - const result = await client.resourceEvent.create({ - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - resourceId: cleanedData.resourceId - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - resourceId: true - } - }).execute(); + const result = await client.resourceEvent + .create({ + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + resourceId: cleanedData.resourceId, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + resourceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -212,80 +246,91 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ResourceEventPatch; const client = getClient(); - const result = await client.resourceEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - resourceId: cleanedData.resourceId - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - resourceId: true - } - }).execute(); + const result = await client.resourceEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + resourceId: cleanedData.resourceId, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + resourceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -294,34 +339,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.resourceEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.resourceEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-installation.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-installation.ts index faabb3a127..f301b72201 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-installation.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-installation.ts @@ -3,62 +3,76 @@ * @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 { CreateResourceInstallationInput, ResourceInstallationPatch, ResourceInstallationSelect, ResourceInstallationFilter, ResourceInstallationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceInstallationInput, + ResourceInstallationPatch, + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - commitId: "uuid", - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - id: "uuid", - name: "string", - namespaceId: "uuid", - params: "json", - revision: "int", - slug: "string", - status: "string", - storeId: "uuid", - updatedAt: "string", - updatedBy: "uuid" + commitId: 'uuid', + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + id: 'uuid', + name: 'string', + namespaceId: 'uuid', + params: 'json', + revision: 'int', + slug: 'string', + status: 'string', + storeId: 'uuid', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nresource-installation \n\nCommands:\n list List resourceInstallation records\n find-first Find first matching resourceInstallation record\n get Get a resourceInstallation by ID\n create Create a new resourceInstallation\n update Update an existing resourceInstallation\n delete Delete a resourceInstallation\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) => { +const usage = + '\nresource-installation \n\nCommands:\n list List resourceInstallation records\n find-first Find first matching resourceInstallation record\n get Get a resourceInstallation by ID\n create Create a new resourceInstallation\n update Update an existing resourceInstallation\n delete Delete a resourceInstallation\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,22 @@ async function handleList(argv: Partial>, _prompter: Inq status: true, storeId: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceInstallationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy + > & { + select: ResourceInstallationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceInstallation.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +133,22 @@ async function handleFindFirst(argv: Partial>, _prompter status: true, storeId: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceInstallationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy + > & { + select: ResourceInstallationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceInstallation.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +157,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.resourceInstallation.findOne({ - id: answers.id as string, - select: { - commitId: true, - createdAt: true, - createdBy: true, - databaseId: true, - id: true, - name: true, - namespaceId: true, - params: true, - revision: true, - slug: true, - status: true, - storeId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resourceInstallation + .findOne({ + id: answers.id as string, + select: { + commitId: true, + createdAt: true, + createdBy: true, + databaseId: true, + id: true, + name: true, + namespaceId: true, + params: true, + revision: true, + slug: true, + status: true, + storeId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,106 +198,123 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "json", - name: "params", - message: "params", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revision", - message: "revision", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'json', + name: 'params', + message: 'params', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceInstallationInput["resourceInstallation"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceInstallationInput['resourceInstallation']; const client = getClient(); - const result = await client.resourceInstallation.create({ - data: { - commitId: cleanedData.commitId, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - params: cleanedData.params, - revision: cleanedData.revision, - slug: cleanedData.slug, - status: cleanedData.status, - storeId: cleanedData.storeId, - updatedBy: cleanedData.updatedBy - }, - select: { - commitId: true, - createdAt: true, - createdBy: true, - databaseId: true, - id: true, - name: true, - namespaceId: true, - params: true, - revision: true, - slug: true, - status: true, - storeId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resourceInstallation + .create({ + data: { + commitId: cleanedData.commitId, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + params: cleanedData.params, + revision: cleanedData.revision, + slug: cleanedData.slug, + status: cleanedData.status, + storeId: cleanedData.storeId, + updatedBy: cleanedData.updatedBy, + }, + select: { + commitId: true, + createdAt: true, + createdBy: true, + databaseId: true, + id: true, + name: true, + namespaceId: true, + params: true, + revision: true, + slug: true, + status: true, + storeId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -276,114 +323,129 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "json", - name: "params", - message: "params", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revision", - message: "revision", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'json', + name: 'params', + message: 'params', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ResourceInstallationPatch; const client = getClient(); - const result = await client.resourceInstallation.update({ - where: { - id: answers.id as string - }, - data: { - commitId: cleanedData.commitId, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - params: cleanedData.params, - revision: cleanedData.revision, - slug: cleanedData.slug, - status: cleanedData.status, - storeId: cleanedData.storeId, - updatedBy: cleanedData.updatedBy - }, - select: { - commitId: true, - createdAt: true, - createdBy: true, - databaseId: true, - id: true, - name: true, - namespaceId: true, - params: true, - revision: true, - slug: true, - status: true, - storeId: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resourceInstallation + .update({ + where: { + id: answers.id as string, + }, + data: { + commitId: cleanedData.commitId, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + params: cleanedData.params, + revision: cleanedData.revision, + slug: cleanedData.slug, + status: cleanedData.status, + storeId: cleanedData.storeId, + updatedBy: cleanedData.updatedBy, + }, + select: { + commitId: true, + createdAt: true, + createdBy: true, + databaseId: true, + id: true, + name: true, + namespaceId: true, + params: true, + revision: true, + slug: true, + status: true, + storeId: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -392,28 +454,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.resourceInstallation.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.resourceInstallation + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-installations-install.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-installations-install.ts index e48238b08d..44f7520b8e 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-installations-install.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-installations-install.ts @@ -3,37 +3,51 @@ * @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 { ResourceInstallationsInstallVariables } from "../../orm/mutation"; -import type { ResourceInstallationsInstallPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ResourceInstallationsInstallVariables } from '../../orm/mutation'; +import type { ResourceInstallationsInstallPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("resource-installations-install - resourceInstallationsInstall\n\nUsage: resource-installations-install [OPTIONS]\n"); + console.log( + 'resource-installations-install - resourceInstallationsInstall\n\nUsage: resource-installations-install [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 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.resourceInstallationsInstall(parsedAnswers as unknown as ResourceInstallationsInstallVariables, { - select: selectFields - } as unknown as { - select: ResourceInstallationsInstallPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .resourceInstallationsInstall( + parsedAnswers as unknown as ResourceInstallationsInstallVariables, + { + select: selectFields, + } as unknown as { + select: ResourceInstallationsInstallPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resourceInstallationsInstall"); + console.error('Failed: resourceInstallationsInstall'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-installations-rollback.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-installations-rollback.ts index 04b28313c7..3b81e25f70 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-installations-rollback.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-installations-rollback.ts @@ -3,37 +3,51 @@ * @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 { ResourceInstallationsRollbackVariables } from "../../orm/mutation"; -import type { ResourceInstallationsRollbackPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ResourceInstallationsRollbackVariables } from '../../orm/mutation'; +import type { ResourceInstallationsRollbackPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("resource-installations-rollback - resourceInstallationsRollback\n\nUsage: resource-installations-rollback [OPTIONS]\n"); + console.log( + 'resource-installations-rollback - resourceInstallationsRollback\n\nUsage: resource-installations-rollback [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 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.resourceInstallationsRollback(parsedAnswers as unknown as ResourceInstallationsRollbackVariables, { - select: selectFields - } as unknown as { - select: ResourceInstallationsRollbackPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .resourceInstallationsRollback( + parsedAnswers as unknown as ResourceInstallationsRollbackVariables, + { + select: selectFields, + } as unknown as { + select: ResourceInstallationsRollbackPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resourceInstallationsRollback"); + console.error('Failed: resourceInstallationsRollback'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-installations-uninstall.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-installations-uninstall.ts index c78f526d8c..6a7a752a09 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-installations-uninstall.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-installations-uninstall.ts @@ -3,37 +3,51 @@ * @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 { ResourceInstallationsUninstallVariables } from "../../orm/mutation"; -import type { ResourceInstallationsUninstallPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ResourceInstallationsUninstallVariables } from '../../orm/mutation'; +import type { ResourceInstallationsUninstallPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("resource-installations-uninstall - resourceInstallationsUninstall\n\nUsage: resource-installations-uninstall [OPTIONS]\n"); + console.log( + 'resource-installations-uninstall - resourceInstallationsUninstall\n\nUsage: resource-installations-uninstall [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 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.resourceInstallationsUninstall(parsedAnswers as unknown as ResourceInstallationsUninstallVariables, { - select: selectFields - } as unknown as { - select: ResourceInstallationsUninstallPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .resourceInstallationsUninstall( + parsedAnswers as unknown as ResourceInstallationsUninstallVariables, + { + select: selectFields, + } as unknown as { + select: ResourceInstallationsUninstallPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resourceInstallationsUninstall"); + console.error('Failed: resourceInstallationsUninstall'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-installations-upgrade.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-installations-upgrade.ts index 9b30775d33..ce9033fa66 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-installations-upgrade.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-installations-upgrade.ts @@ -3,37 +3,51 @@ * @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 { ResourceInstallationsUpgradeVariables } from "../../orm/mutation"; -import type { ResourceInstallationsUpgradePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ResourceInstallationsUpgradeVariables } from '../../orm/mutation'; +import type { ResourceInstallationsUpgradePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("resource-installations-upgrade - resourceInstallationsUpgrade\n\nUsage: resource-installations-upgrade [OPTIONS]\n"); + console.log( + 'resource-installations-upgrade - resourceInstallationsUpgrade\n\nUsage: resource-installations-upgrade [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 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.resourceInstallationsUpgrade(parsedAnswers as unknown as ResourceInstallationsUpgradeVariables, { - select: selectFields - } as unknown as { - select: ResourceInstallationsUpgradePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .resourceInstallationsUpgrade( + parsedAnswers as unknown as ResourceInstallationsUpgradeVariables, + { + select: selectFields, + } as unknown as { + select: ResourceInstallationsUpgradePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resourceInstallationsUpgrade"); + console.error('Failed: resourceInstallationsUpgrade'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-status-check.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-status-check.ts index 2acee1ab4e..d2c4c81b8d 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-status-check.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-status-check.ts @@ -3,56 +3,70 @@ * @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 { CreateResourceStatusCheckInput, ResourceStatusCheckPatch, ResourceStatusCheckSelect, ResourceStatusCheckFilter, ResourceStatusCheckOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceStatusCheckInput, + ResourceStatusCheckPatch, + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - completedAt: "string", - databaseId: "uuid", - id: "uuid", - requestedAt: "string", - requestedBy: "uuid", - resourceId: "uuid", - result: "json", - status: "string" + completedAt: 'string', + databaseId: 'uuid', + id: 'uuid', + requestedAt: 'string', + requestedBy: 'uuid', + resourceId: 'uuid', + result: 'json', + status: 'string', }; -const usage = "\nresource-status-check \n\nCommands:\n list List resourceStatusCheck records\n find-first Find first matching resourceStatusCheck record\n get Get a resourceStatusCheck by ID\n create Create a new resourceStatusCheck\n update Update an existing resourceStatusCheck\n delete Delete a resourceStatusCheck\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) => { +const usage = + '\nresource-status-check \n\nCommands:\n list List resourceStatusCheck records\n find-first Find first matching resourceStatusCheck record\n get Get a resourceStatusCheck by ID\n create Create a new resourceStatusCheck\n update Update an existing resourceStatusCheck\n delete Delete a resourceStatusCheck\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,22 @@ async function handleList(argv: Partial>, _prompter: Inq requestedBy: true, resourceId: true, result: true, - status: true + status: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceStatusCheckSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy + > & { + select: ResourceStatusCheckSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceStatusCheck.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +115,22 @@ async function handleFindFirst(argv: Partial>, _prompter requestedBy: true, resourceId: true, result: true, - status: true + status: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceStatusCheckSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy + > & { + select: ResourceStatusCheckSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceStatusCheck.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +139,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.resourceStatusCheck.findOne({ - id: answers.id as string, - select: { - completedAt: true, - databaseId: true, - id: true, - requestedAt: true, - requestedBy: true, - resourceId: true, - result: true, - status: true - } - }).execute(); + const result = await client.resourceStatusCheck + .findOne({ + id: answers.id as string, + select: { + completedAt: true, + databaseId: true, + id: true, + requestedAt: true, + requestedBy: true, + resourceId: true, + result: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,74 +174,87 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "requestedAt", - message: "requestedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requestedBy", - message: "requestedBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }, { - type: "json", - name: "result", - message: "result", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'requestedAt', + message: 'requestedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requestedBy', + message: 'requestedBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceStatusCheckInput["resourceStatusCheck"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceStatusCheckInput['resourceStatusCheck']; const client = getClient(); - const result = await client.resourceStatusCheck.create({ - data: { - completedAt: cleanedData.completedAt, - databaseId: cleanedData.databaseId, - requestedAt: cleanedData.requestedAt, - requestedBy: cleanedData.requestedBy, - resourceId: cleanedData.resourceId, - result: cleanedData.result, - status: cleanedData.status - }, - select: { - completedAt: true, - databaseId: true, - id: true, - requestedAt: true, - requestedBy: true, - resourceId: true, - result: true, - status: true - } - }).execute(); + const result = await client.resourceStatusCheck + .create({ + data: { + completedAt: cleanedData.completedAt, + databaseId: cleanedData.databaseId, + requestedAt: cleanedData.requestedAt, + requestedBy: cleanedData.requestedBy, + resourceId: cleanedData.resourceId, + result: cleanedData.result, + status: cleanedData.status, + }, + select: { + completedAt: true, + databaseId: true, + id: true, + requestedAt: true, + requestedBy: true, + resourceId: true, + result: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -220,82 +263,93 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "requestedAt", - message: "requestedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requestedBy", - message: "requestedBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false - }, { - type: "json", - name: "result", - message: "result", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'requestedAt', + message: 'requestedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requestedBy', + message: 'requestedBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ResourceStatusCheckPatch; const client = getClient(); - const result = await client.resourceStatusCheck.update({ - where: { - id: answers.id as string - }, - data: { - completedAt: cleanedData.completedAt, - databaseId: cleanedData.databaseId, - requestedAt: cleanedData.requestedAt, - requestedBy: cleanedData.requestedBy, - resourceId: cleanedData.resourceId, - result: cleanedData.result, - status: cleanedData.status - }, - select: { - completedAt: true, - databaseId: true, - id: true, - requestedAt: true, - requestedBy: true, - resourceId: true, - result: true, - status: true - } - }).execute(); + const result = await client.resourceStatusCheck + .update({ + where: { + id: answers.id as string, + }, + data: { + completedAt: cleanedData.completedAt, + databaseId: cleanedData.databaseId, + requestedAt: cleanedData.requestedAt, + requestedBy: cleanedData.requestedBy, + resourceId: cleanedData.resourceId, + result: cleanedData.result, + status: cleanedData.status, + }, + select: { + completedAt: true, + databaseId: true, + id: true, + requestedAt: true, + requestedBy: true, + resourceId: true, + result: true, + status: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -304,28 +358,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.resourceStatusCheck.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.resourceStatusCheck + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-usage-log.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-usage-log.ts index bee23e5098..6dfa3478bb 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-usage-log.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-usage-log.ts @@ -3,58 +3,72 @@ * @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 { CreateResourceUsageLogInput, ResourceUsageLogPatch, ResourceUsageLogSelect, ResourceUsageLogFilter, ResourceUsageLogOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceUsageLogInput, + ResourceUsageLogPatch, + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - cpuMillicores: "int", - databaseId: "uuid", - id: "uuid", - intervalSeconds: "int", - memoryBytes: "int", - metrics: "json", - namespaceId: "uuid", - resourceId: "uuid", - sampledAt: "string", - source: "string" + cpuMillicores: 'int', + databaseId: 'uuid', + id: 'uuid', + intervalSeconds: 'int', + memoryBytes: 'int', + metrics: 'json', + namespaceId: 'uuid', + resourceId: 'uuid', + sampledAt: 'string', + source: 'string', }; -const usage = "\nresource-usage-log \n\nCommands:\n list List resourceUsageLog records\n find-first Find first matching resourceUsageLog record\n get Get a resourceUsageLog by ID\n create Create a new resourceUsageLog\n update Update an existing resourceUsageLog\n delete Delete a resourceUsageLog\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) => { +const usage = + '\nresource-usage-log \n\nCommands:\n list List resourceUsageLog records\n find-first Find first matching resourceUsageLog record\n get Get a resourceUsageLog by ID\n create Create a new resourceUsageLog\n update Update an existing resourceUsageLog\n delete Delete a resourceUsageLog\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq namespaceId: true, resourceId: true, sampledAt: true, - source: true + source: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceUsageLogSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ResourceUsageLogSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceUsageLog.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter namespaceId: true, resourceId: true, sampledAt: true, - source: true + source: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceUsageLogSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ResourceUsageLogSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceUsageLog.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.resourceUsageLog.findOne({ - id: answers.id as string, - select: { - cpuMillicores: true, - databaseId: true, - id: true, - intervalSeconds: true, - memoryBytes: true, - metrics: true, - namespaceId: true, - resourceId: true, - sampledAt: true, - source: true - } - }).execute(); + const result = await client.resourceUsageLog + .findOne({ + id: answers.id as string, + select: { + cpuMillicores: true, + databaseId: true, + id: true, + intervalSeconds: true, + memoryBytes: true, + metrics: true, + namespaceId: true, + resourceId: true, + sampledAt: true, + source: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,88 +174,103 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "cpuMillicores", - message: "cpuMillicores", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "intervalSeconds", - message: "intervalSeconds", - required: true - }, { - type: "text", - name: "memoryBytes", - message: "memoryBytes", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metrics", - message: "metrics", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sampledAt", - message: "sampledAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "source", - message: "source", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'cpuMillicores', + message: 'cpuMillicores', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'intervalSeconds', + message: 'intervalSeconds', + required: true, + }, + { + type: 'text', + name: 'memoryBytes', + message: 'memoryBytes', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metrics', + message: 'metrics', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sampledAt', + message: 'sampledAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceUsageLogInput["resourceUsageLog"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceUsageLogInput['resourceUsageLog']; const client = getClient(); - const result = await client.resourceUsageLog.create({ - data: { - cpuMillicores: cleanedData.cpuMillicores, - databaseId: cleanedData.databaseId, - intervalSeconds: cleanedData.intervalSeconds, - memoryBytes: cleanedData.memoryBytes, - metrics: cleanedData.metrics, - namespaceId: cleanedData.namespaceId, - resourceId: cleanedData.resourceId, - sampledAt: cleanedData.sampledAt, - source: cleanedData.source - }, - select: { - cpuMillicores: true, - databaseId: true, - id: true, - intervalSeconds: true, - memoryBytes: true, - metrics: true, - namespaceId: true, - resourceId: true, - sampledAt: true, - source: true - } - }).execute(); + const result = await client.resourceUsageLog + .create({ + data: { + cpuMillicores: cleanedData.cpuMillicores, + databaseId: cleanedData.databaseId, + intervalSeconds: cleanedData.intervalSeconds, + memoryBytes: cleanedData.memoryBytes, + metrics: cleanedData.metrics, + namespaceId: cleanedData.namespaceId, + resourceId: cleanedData.resourceId, + sampledAt: cleanedData.sampledAt, + source: cleanedData.source, + }, + select: { + cpuMillicores: true, + databaseId: true, + id: true, + intervalSeconds: true, + memoryBytes: true, + metrics: true, + namespaceId: true, + resourceId: true, + sampledAt: true, + source: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,95 +279,108 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "sampledAt", - message: "sampledAt", - required: true - }, { - type: "text", - name: "cpuMillicores", - message: "cpuMillicores", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "intervalSeconds", - message: "intervalSeconds", - required: false - }, { - type: "text", - name: "memoryBytes", - message: "memoryBytes", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metrics", - message: "metrics", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "source", - message: "source", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'sampledAt', + message: 'sampledAt', + required: true, + }, + { + type: 'text', + name: 'cpuMillicores', + message: 'cpuMillicores', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'intervalSeconds', + message: 'intervalSeconds', + required: false, + }, + { + type: 'text', + name: 'memoryBytes', + message: 'memoryBytes', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metrics', + message: 'metrics', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ResourceUsageLogPatch; const client = getClient(); - const result = await client.resourceUsageLog.update({ - where: { - id: answers.id as string, - sampledAt: answers.sampledAt as string - }, - data: { - cpuMillicores: cleanedData.cpuMillicores, - databaseId: cleanedData.databaseId, - intervalSeconds: cleanedData.intervalSeconds, - memoryBytes: cleanedData.memoryBytes, - metrics: cleanedData.metrics, - namespaceId: cleanedData.namespaceId, - resourceId: cleanedData.resourceId, - source: cleanedData.source - }, - select: { - cpuMillicores: true, - databaseId: true, - id: true, - intervalSeconds: true, - memoryBytes: true, - metrics: true, - namespaceId: true, - resourceId: true, - sampledAt: true, - source: true - } - }).execute(); + const result = await client.resourceUsageLog + .update({ + where: { + id: answers.id as string, + sampledAt: answers.sampledAt as string, + }, + data: { + cpuMillicores: cleanedData.cpuMillicores, + databaseId: cleanedData.databaseId, + intervalSeconds: cleanedData.intervalSeconds, + memoryBytes: cleanedData.memoryBytes, + metrics: cleanedData.metrics, + namespaceId: cleanedData.namespaceId, + resourceId: cleanedData.resourceId, + source: cleanedData.source, + }, + select: { + cpuMillicores: true, + databaseId: true, + id: true, + intervalSeconds: true, + memoryBytes: true, + metrics: true, + namespaceId: true, + resourceId: true, + sampledAt: true, + source: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -339,34 +389,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "sampledAt", - message: "sampledAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'sampledAt', + message: 'sampledAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.resourceUsageLog.delete({ - where: { - id: answers.id as string, - sampledAt: answers.sampledAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.resourceUsageLog + .delete({ + where: { + id: answers.id as string, + sampledAt: answers.sampledAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-usage-summary.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-usage-summary.ts index 1d10512a59..bc3bdf969d 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-usage-summary.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-usage-summary.ts @@ -3,58 +3,72 @@ * @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 { CreateResourceUsageSummaryInput, ResourceUsageSummaryPatch, ResourceUsageSummarySelect, ResourceUsageSummaryFilter, ResourceUsageSummaryOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceUsageSummaryInput, + ResourceUsageSummaryPatch, + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - date: "string", - gbSeconds: "string", - id: "uuid", - maxCpuMillicores: "int", - maxMemoryBytes: "int", - namespaceId: "uuid", - resourceId: "uuid", - runtimeSeconds: "int", - sampleCount: "int" + databaseId: 'uuid', + date: 'string', + gbSeconds: 'string', + id: 'uuid', + maxCpuMillicores: 'int', + maxMemoryBytes: 'int', + namespaceId: 'uuid', + resourceId: 'uuid', + runtimeSeconds: 'int', + sampleCount: 'int', }; -const usage = "\nresource-usage-summary \n\nCommands:\n list List resourceUsageSummary records\n find-first Find first matching resourceUsageSummary record\n get Get a resourceUsageSummary by ID\n create Create a new resourceUsageSummary\n update Update an existing resourceUsageSummary\n delete Delete a resourceUsageSummary\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) => { +const usage = + '\nresource-usage-summary \n\nCommands:\n list List resourceUsageSummary records\n find-first Find first matching resourceUsageSummary record\n get Get a resourceUsageSummary by ID\n create Create a new resourceUsageSummary\n update Update an existing resourceUsageSummary\n delete Delete a resourceUsageSummary\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,22 @@ async function handleList(argv: Partial>, _prompter: Inq namespaceId: true, resourceId: true, runtimeSeconds: true, - sampleCount: true + sampleCount: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceUsageSummarySelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy + > & { + select: ResourceUsageSummarySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceUsageSummary.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +121,22 @@ async function handleFindFirst(argv: Partial>, _prompter namespaceId: true, resourceId: true, runtimeSeconds: true, - sampleCount: true + sampleCount: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceUsageSummarySelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy + > & { + select: ResourceUsageSummarySelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceUsageSummary.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +145,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.resourceUsageSummary.findOne({ - id: answers.id as string, - select: { - databaseId: true, - date: true, - gbSeconds: true, - id: true, - maxCpuMillicores: true, - maxMemoryBytes: true, - namespaceId: true, - resourceId: true, - runtimeSeconds: true, - sampleCount: true - } - }).execute(); + const result = await client.resourceUsageSummary + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + date: true, + gbSeconds: true, + id: true, + maxCpuMillicores: true, + maxMemoryBytes: true, + namespaceId: true, + resourceId: true, + runtimeSeconds: true, + sampleCount: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,89 +182,104 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "date", - message: "date", - required: true - }, { - type: "text", - name: "gbSeconds", - message: "gbSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxCpuMillicores", - message: "maxCpuMillicores", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxMemoryBytes", - message: "maxMemoryBytes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "runtimeSeconds", - message: "runtimeSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sampleCount", - message: "sampleCount", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: true, + }, + { + type: 'text', + name: 'gbSeconds', + message: 'gbSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxCpuMillicores', + message: 'maxCpuMillicores', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxMemoryBytes', + message: 'maxMemoryBytes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtimeSeconds', + message: 'runtimeSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sampleCount', + message: 'sampleCount', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceUsageSummaryInput["resourceUsageSummary"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceUsageSummaryInput['resourceUsageSummary']; const client = getClient(); - const result = await client.resourceUsageSummary.create({ - data: { - databaseId: cleanedData.databaseId, - date: cleanedData.date, - gbSeconds: cleanedData.gbSeconds, - maxCpuMillicores: cleanedData.maxCpuMillicores, - maxMemoryBytes: cleanedData.maxMemoryBytes, - namespaceId: cleanedData.namespaceId, - resourceId: cleanedData.resourceId, - runtimeSeconds: cleanedData.runtimeSeconds, - sampleCount: cleanedData.sampleCount - }, - select: { - databaseId: true, - date: true, - gbSeconds: true, - id: true, - maxCpuMillicores: true, - maxMemoryBytes: true, - namespaceId: true, - resourceId: true, - runtimeSeconds: true, - sampleCount: true - } - }).execute(); + const result = await client.resourceUsageSummary + .create({ + data: { + databaseId: cleanedData.databaseId, + date: cleanedData.date, + gbSeconds: cleanedData.gbSeconds, + maxCpuMillicores: cleanedData.maxCpuMillicores, + maxMemoryBytes: cleanedData.maxMemoryBytes, + namespaceId: cleanedData.namespaceId, + resourceId: cleanedData.resourceId, + runtimeSeconds: cleanedData.runtimeSeconds, + sampleCount: cleanedData.sampleCount, + }, + select: { + databaseId: true, + date: true, + gbSeconds: true, + id: true, + maxCpuMillicores: true, + maxMemoryBytes: true, + namespaceId: true, + resourceId: true, + runtimeSeconds: true, + sampleCount: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -243,97 +288,110 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "date", - message: "date", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "gbSeconds", - message: "gbSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxCpuMillicores", - message: "maxCpuMillicores", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxMemoryBytes", - message: "maxMemoryBytes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "runtimeSeconds", - message: "runtimeSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sampleCount", - message: "sampleCount", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'gbSeconds', + message: 'gbSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxCpuMillicores', + message: 'maxCpuMillicores', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxMemoryBytes', + message: 'maxMemoryBytes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtimeSeconds', + message: 'runtimeSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sampleCount', + message: 'sampleCount', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ResourceUsageSummaryPatch; const client = getClient(); - const result = await client.resourceUsageSummary.update({ - where: { - id: answers.id as string, - date: answers.date as string - }, - data: { - databaseId: cleanedData.databaseId, - gbSeconds: cleanedData.gbSeconds, - maxCpuMillicores: cleanedData.maxCpuMillicores, - maxMemoryBytes: cleanedData.maxMemoryBytes, - namespaceId: cleanedData.namespaceId, - resourceId: cleanedData.resourceId, - runtimeSeconds: cleanedData.runtimeSeconds, - sampleCount: cleanedData.sampleCount - }, - select: { - databaseId: true, - date: true, - gbSeconds: true, - id: true, - maxCpuMillicores: true, - maxMemoryBytes: true, - namespaceId: true, - resourceId: true, - runtimeSeconds: true, - sampleCount: true - } - }).execute(); + const result = await client.resourceUsageSummary + .update({ + where: { + id: answers.id as string, + date: answers.date as string, + }, + data: { + databaseId: cleanedData.databaseId, + gbSeconds: cleanedData.gbSeconds, + maxCpuMillicores: cleanedData.maxCpuMillicores, + maxMemoryBytes: cleanedData.maxMemoryBytes, + namespaceId: cleanedData.namespaceId, + resourceId: cleanedData.resourceId, + runtimeSeconds: cleanedData.runtimeSeconds, + sampleCount: cleanedData.sampleCount, + }, + select: { + databaseId: true, + date: true, + gbSeconds: true, + id: true, + maxCpuMillicores: true, + maxMemoryBytes: true, + namespaceId: true, + resourceId: true, + runtimeSeconds: true, + sampleCount: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -342,34 +400,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "date", - message: "date", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.resourceUsageSummary.delete({ - where: { - id: answers.id as string, - date: answers.date as string - }, - select: { - id: true - } - }).execute(); + const result = await client.resourceUsageSummary + .delete({ + where: { + id: answers.id as string, + date: answers.date as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource-utilization.ts b/sdk/constructive-cli/src/compute/cli/commands/resource-utilization.ts index 156ce36fdd..bf97744728 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource-utilization.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource-utilization.ts @@ -3,61 +3,75 @@ * @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 { CreateResourceUtilizationInput, ResourceUtilizationPatch, ResourceUtilizationSelect, ResourceUtilizationFilter, ResourceUtilizationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceUtilizationInput, + ResourceUtilizationPatch, + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - avgMemoryBytes: "int", - cpuLimitMillicores: "int", - cpuPeakUtilization: "string", - cpuRequestHeadroomMillicores: "int", - cpuRequestMillicores: "int", - date: "string", - gbSeconds: "string", - kind: "string", - maxCpuMillicores: "int", - maxMemoryBytes: "int", - memoryLimitBytes: "int", - memoryPeakUtilization: "string", - memoryRequestBytes: "int", - memoryRequestHeadroomBytes: "int", - namespaceId: "uuid", - replicas: "int", - resourceId: "uuid", - runtimeSeconds: "int", - sampleCount: "int" + avgMemoryBytes: 'int', + cpuLimitMillicores: 'int', + cpuPeakUtilization: 'string', + cpuRequestHeadroomMillicores: 'int', + cpuRequestMillicores: 'int', + date: 'string', + gbSeconds: 'string', + kind: 'string', + maxCpuMillicores: 'int', + maxMemoryBytes: 'int', + memoryLimitBytes: 'int', + memoryPeakUtilization: 'string', + memoryRequestBytes: 'int', + memoryRequestHeadroomBytes: 'int', + namespaceId: 'uuid', + replicas: 'int', + resourceId: 'uuid', + runtimeSeconds: 'int', + sampleCount: 'int', }; -const usage = "\nresource-utilization \n\nCommands:\n list List resourceUtilization records\n find-first Find first matching resourceUtilization record\n create Create a new resourceUtilization\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) => { +const usage = + '\nresource-utilization \n\nCommands:\n list List resourceUtilization records\n find-first Find first matching resourceUtilization record\n create Create a new resourceUtilization\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -85,16 +99,22 @@ async function handleList(argv: Partial>, _prompter: Inq replicas: true, resourceId: true, runtimeSeconds: true, - sampleCount: true + sampleCount: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceUtilizationSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy + > & { + select: ResourceUtilizationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceUtilization.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -122,16 +142,22 @@ async function handleFindFirst(argv: Partial>, _prompter replicas: true, resourceId: true, runtimeSeconds: true, - sampleCount: true + sampleCount: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceUtilizationSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy + > & { + select: ResourceUtilizationSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceUtilization.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -140,155 +166,180 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "avgMemoryBytes", - message: "avgMemoryBytes", - required: true - }, { - type: "text", - name: "cpuLimitMillicores", - message: "cpuLimitMillicores", - required: true - }, { - type: "text", - name: "cpuPeakUtilization", - message: "cpuPeakUtilization", - required: true - }, { - type: "text", - name: "cpuRequestHeadroomMillicores", - message: "cpuRequestHeadroomMillicores", - required: true - }, { - type: "text", - name: "cpuRequestMillicores", - message: "cpuRequestMillicores", - required: true - }, { - type: "text", - name: "date", - message: "date", - required: true - }, { - type: "text", - name: "gbSeconds", - message: "gbSeconds", - required: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "text", - name: "maxCpuMillicores", - message: "maxCpuMillicores", - required: true - }, { - type: "text", - name: "maxMemoryBytes", - message: "maxMemoryBytes", - required: true - }, { - type: "text", - name: "memoryLimitBytes", - message: "memoryLimitBytes", - required: true - }, { - type: "text", - name: "memoryPeakUtilization", - message: "memoryPeakUtilization", - required: true - }, { - type: "text", - name: "memoryRequestBytes", - message: "memoryRequestBytes", - required: true - }, { - type: "text", - name: "memoryRequestHeadroomBytes", - message: "memoryRequestHeadroomBytes", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "replicas", - message: "replicas", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }, { - type: "text", - name: "runtimeSeconds", - message: "runtimeSeconds", - required: true - }, { - type: "text", - name: "sampleCount", - message: "sampleCount", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'avgMemoryBytes', + message: 'avgMemoryBytes', + required: true, + }, + { + type: 'text', + name: 'cpuLimitMillicores', + message: 'cpuLimitMillicores', + required: true, + }, + { + type: 'text', + name: 'cpuPeakUtilization', + message: 'cpuPeakUtilization', + required: true, + }, + { + type: 'text', + name: 'cpuRequestHeadroomMillicores', + message: 'cpuRequestHeadroomMillicores', + required: true, + }, + { + type: 'text', + name: 'cpuRequestMillicores', + message: 'cpuRequestMillicores', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: true, + }, + { + type: 'text', + name: 'gbSeconds', + message: 'gbSeconds', + required: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'text', + name: 'maxCpuMillicores', + message: 'maxCpuMillicores', + required: true, + }, + { + type: 'text', + name: 'maxMemoryBytes', + message: 'maxMemoryBytes', + required: true, + }, + { + type: 'text', + name: 'memoryLimitBytes', + message: 'memoryLimitBytes', + required: true, + }, + { + type: 'text', + name: 'memoryPeakUtilization', + message: 'memoryPeakUtilization', + required: true, + }, + { + type: 'text', + name: 'memoryRequestBytes', + message: 'memoryRequestBytes', + required: true, + }, + { + type: 'text', + name: 'memoryRequestHeadroomBytes', + message: 'memoryRequestHeadroomBytes', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'replicas', + message: 'replicas', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + { + type: 'text', + name: 'runtimeSeconds', + message: 'runtimeSeconds', + required: true, + }, + { + type: 'text', + name: 'sampleCount', + message: 'sampleCount', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceUtilizationInput["resourceUtilization"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceUtilizationInput['resourceUtilization']; const client = getClient(); - const result = await client.resourceUtilization.create({ - data: { - avgMemoryBytes: cleanedData.avgMemoryBytes, - cpuLimitMillicores: cleanedData.cpuLimitMillicores, - cpuPeakUtilization: cleanedData.cpuPeakUtilization, - cpuRequestHeadroomMillicores: cleanedData.cpuRequestHeadroomMillicores, - cpuRequestMillicores: cleanedData.cpuRequestMillicores, - date: cleanedData.date, - gbSeconds: cleanedData.gbSeconds, - kind: cleanedData.kind, - maxCpuMillicores: cleanedData.maxCpuMillicores, - maxMemoryBytes: cleanedData.maxMemoryBytes, - memoryLimitBytes: cleanedData.memoryLimitBytes, - memoryPeakUtilization: cleanedData.memoryPeakUtilization, - memoryRequestBytes: cleanedData.memoryRequestBytes, - memoryRequestHeadroomBytes: cleanedData.memoryRequestHeadroomBytes, - namespaceId: cleanedData.namespaceId, - replicas: cleanedData.replicas, - resourceId: cleanedData.resourceId, - runtimeSeconds: cleanedData.runtimeSeconds, - sampleCount: cleanedData.sampleCount - }, - select: { - avgMemoryBytes: true, - cpuLimitMillicores: true, - cpuPeakUtilization: true, - cpuRequestHeadroomMillicores: true, - cpuRequestMillicores: true, - date: true, - gbSeconds: true, - kind: true, - maxCpuMillicores: true, - maxMemoryBytes: true, - memoryLimitBytes: true, - memoryPeakUtilization: true, - memoryRequestBytes: true, - memoryRequestHeadroomBytes: true, - namespaceId: true, - replicas: true, - resourceId: true, - runtimeSeconds: true, - sampleCount: true - } - }).execute(); + const result = await client.resourceUtilization + .create({ + data: { + avgMemoryBytes: cleanedData.avgMemoryBytes, + cpuLimitMillicores: cleanedData.cpuLimitMillicores, + cpuPeakUtilization: cleanedData.cpuPeakUtilization, + cpuRequestHeadroomMillicores: cleanedData.cpuRequestHeadroomMillicores, + cpuRequestMillicores: cleanedData.cpuRequestMillicores, + date: cleanedData.date, + gbSeconds: cleanedData.gbSeconds, + kind: cleanedData.kind, + maxCpuMillicores: cleanedData.maxCpuMillicores, + maxMemoryBytes: cleanedData.maxMemoryBytes, + memoryLimitBytes: cleanedData.memoryLimitBytes, + memoryPeakUtilization: cleanedData.memoryPeakUtilization, + memoryRequestBytes: cleanedData.memoryRequestBytes, + memoryRequestHeadroomBytes: cleanedData.memoryRequestHeadroomBytes, + namespaceId: cleanedData.namespaceId, + replicas: cleanedData.replicas, + resourceId: cleanedData.resourceId, + runtimeSeconds: cleanedData.runtimeSeconds, + sampleCount: cleanedData.sampleCount, + }, + select: { + avgMemoryBytes: true, + cpuLimitMillicores: true, + cpuPeakUtilization: true, + cpuRequestHeadroomMillicores: true, + cpuRequestMillicores: true, + date: true, + gbSeconds: true, + kind: true, + maxCpuMillicores: true, + maxMemoryBytes: true, + memoryLimitBytes: true, + memoryPeakUtilization: true, + memoryRequestBytes: true, + memoryRequestHeadroomBytes: true, + namespaceId: true, + replicas: true, + resourceId: true, + runtimeSeconds: true, + sampleCount: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resource.ts b/sdk/constructive-cli/src/compute/cli/commands/resource.ts index 9158872123..03fa51b45c 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resource.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resource.ts @@ -3,78 +3,92 @@ * @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 { CreateResourceInput, ResourcePatch, ResourceSelect, ResourceFilter, ResourceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceInput, + ResourcePatch, + ResourceSelect, + ResourceFilter, + ResourceOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - cpuLimitMillicores: "int", - cpuRequestMillicores: "int", - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - errorCount: "int", - id: "uuid", - installationId: "uuid", - integrations: "string", - kind: "string", - labels: "json", - lastError: "string", - lastHeartbeatAt: "string", - memoryLimitBytes: "int", - memoryRequestBytes: "int", - name: "string", - namespaceId: "uuid", - replicas: "int", - requiredConfigs: "string", - requiredSecrets: "string", - resourceDefinitionId: "uuid", - slug: "string", - spec: "json", - status: "string", - statusObserved: "json", - storageClass: "string", - storageSizeBytes: "int", - updatedAt: "string", - updatedBy: "uuid" + annotations: 'json', + cpuLimitMillicores: 'int', + cpuRequestMillicores: 'int', + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + errorCount: 'int', + id: 'uuid', + installationId: 'uuid', + integrations: 'string', + kind: 'string', + labels: 'json', + lastError: 'string', + lastHeartbeatAt: 'string', + memoryLimitBytes: 'int', + memoryRequestBytes: 'int', + name: 'string', + namespaceId: 'uuid', + replicas: 'int', + requiredConfigs: 'string', + requiredSecrets: 'string', + resourceDefinitionId: 'uuid', + slug: 'string', + spec: 'json', + status: 'string', + statusObserved: 'json', + storageClass: 'string', + storageSizeBytes: 'int', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nresource \n\nCommands:\n list List resource records\n find-first Find first matching resource record\n get Get a resource by ID\n create Create a new resource\n update Update an existing resource\n delete Delete a resource\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) => { +const usage = + '\nresource \n\nCommands:\n list List resource records\n find-first Find first matching resource record\n get Get a resource by ID\n create Create a new resource\n update Update an existing resource\n delete Delete a resource\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -106,16 +120,18 @@ async function handleList(argv: Partial>, _prompter: Inq status: true, statusObserved: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ResourceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resource.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -147,16 +163,18 @@ async function handleFindFirst(argv: Partial>, _prompter status: true, statusObserved: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ResourceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resource.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -165,44 +183,48 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.resource.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - createdBy: true, - databaseId: true, - errorCount: true, - id: true, - installationId: true, - integrations: true, - kind: true, - labels: true, - lastError: true, - lastHeartbeatAt: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - resourceDefinitionId: true, - slug: true, - spec: true, - status: true, - statusObserved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resource + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + createdBy: true, + databaseId: true, + errorCount: true, + id: true, + installationId: true, + integrations: true, + kind: true, + labels: true, + lastError: true, + lastHeartbeatAt: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + resourceDefinitionId: true, + slug: true, + spec: true, + status: true, + statusObserved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -211,177 +233,200 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "installationId", - message: "installationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastHeartbeatAt", - message: "lastHeartbeatAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionId", - message: "resourceDefinitionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "json", - name: "spec", - message: "spec", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "json", - name: "statusObserved", - message: "statusObserved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'installationId', + message: 'installationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastHeartbeatAt', + message: 'lastHeartbeatAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionId', + message: 'resourceDefinitionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'json', + name: 'spec', + message: 'spec', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'statusObserved', + message: 'statusObserved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceInput["resource"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceInput['resource']; const client = getClient(); - const result = await client.resource.create({ - data: { - annotations: cleanedData.annotations, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - errorCount: cleanedData.errorCount, - installationId: cleanedData.installationId, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastHeartbeatAt: cleanedData.lastHeartbeatAt, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - resourceDefinitionId: cleanedData.resourceDefinitionId, - slug: cleanedData.slug, - spec: cleanedData.spec, - status: cleanedData.status, - statusObserved: cleanedData.statusObserved, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - createdAt: true, - createdBy: true, - databaseId: true, - errorCount: true, - id: true, - installationId: true, - integrations: true, - kind: true, - labels: true, - lastError: true, - lastHeartbeatAt: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - resourceDefinitionId: true, - slug: true, - spec: true, - status: true, - statusObserved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resource + .create({ + data: { + annotations: cleanedData.annotations, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + errorCount: cleanedData.errorCount, + installationId: cleanedData.installationId, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastHeartbeatAt: cleanedData.lastHeartbeatAt, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + resourceDefinitionId: cleanedData.resourceDefinitionId, + slug: cleanedData.slug, + spec: cleanedData.spec, + status: cleanedData.status, + statusObserved: cleanedData.statusObserved, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + createdAt: true, + createdBy: true, + databaseId: true, + errorCount: true, + id: true, + installationId: true, + integrations: true, + kind: true, + labels: true, + lastError: true, + lastHeartbeatAt: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + resourceDefinitionId: true, + slug: true, + spec: true, + status: true, + statusObserved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -390,185 +435,209 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "installationId", - message: "installationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kind", - message: "kind", - required: false - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastHeartbeatAt", - message: "lastHeartbeatAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionId", - message: "resourceDefinitionId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "json", - name: "spec", - message: "spec", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "json", - name: "statusObserved", - message: "statusObserved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'installationId', + message: 'installationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: false, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastHeartbeatAt', + message: 'lastHeartbeatAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionId', + message: 'resourceDefinitionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'json', + name: 'spec', + message: 'spec', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'statusObserved', + message: 'statusObserved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ResourcePatch; const client = getClient(); - const result = await client.resource.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - errorCount: cleanedData.errorCount, - installationId: cleanedData.installationId, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastHeartbeatAt: cleanedData.lastHeartbeatAt, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - resourceDefinitionId: cleanedData.resourceDefinitionId, - slug: cleanedData.slug, - spec: cleanedData.spec, - status: cleanedData.status, - statusObserved: cleanedData.statusObserved, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - createdAt: true, - createdBy: true, - databaseId: true, - errorCount: true, - id: true, - installationId: true, - integrations: true, - kind: true, - labels: true, - lastError: true, - lastHeartbeatAt: true, - name: true, - namespaceId: true, - requiredConfigs: true, - requiredSecrets: true, - resourceDefinitionId: true, - slug: true, - spec: true, - status: true, - statusObserved: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resource + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + errorCount: cleanedData.errorCount, + installationId: cleanedData.installationId, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastHeartbeatAt: cleanedData.lastHeartbeatAt, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + resourceDefinitionId: cleanedData.resourceDefinitionId, + slug: cleanedData.slug, + spec: cleanedData.spec, + status: cleanedData.status, + statusObserved: cleanedData.statusObserved, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + createdAt: true, + createdBy: true, + databaseId: true, + errorCount: true, + id: true, + installationId: true, + integrations: true, + kind: true, + labels: true, + lastError: true, + lastHeartbeatAt: true, + name: true, + namespaceId: true, + requiredConfigs: true, + requiredSecrets: true, + resourceDefinitionId: true, + slug: true, + spec: true, + status: true, + statusObserved: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -577,28 +646,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.resource.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.resource + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resources-health.ts b/sdk/constructive-cli/src/compute/cli/commands/resources-health.ts index d6d654af08..3f48acd646 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resources-health.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resources-health.ts @@ -3,73 +3,87 @@ * @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 { CreateResourcesHealthInput, ResourcesHealthPatch, ResourcesHealthSelect, ResourcesHealthFilter, ResourcesHealthOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourcesHealthInput, + ResourcesHealthPatch, + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - cpuLimitMillicores: "int", - cpuRequestMillicores: "int", - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - errorCount: "int", - id: "uuid", - installationId: "uuid", - integrations: "string", - kind: "string", - labels: "json", - lastError: "string", - lastHeartbeatAt: "string", - memoryLimitBytes: "int", - memoryRequestBytes: "int", - name: "string", - namespaceId: "uuid", - replicas: "int", - requiredConfigs: "string", - requiredSecrets: "string", - resourceDefinitionId: "uuid", - slug: "string", - spec: "json", - status: "string", - statusDetail: "string", - statusObserved: "json", - storageClass: "string", - storageSizeBytes: "int", - updatedAt: "string", - updatedBy: "uuid" + annotations: 'json', + cpuLimitMillicores: 'int', + cpuRequestMillicores: 'int', + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + errorCount: 'int', + id: 'uuid', + installationId: 'uuid', + integrations: 'string', + kind: 'string', + labels: 'json', + lastError: 'string', + lastHeartbeatAt: 'string', + memoryLimitBytes: 'int', + memoryRequestBytes: 'int', + name: 'string', + namespaceId: 'uuid', + replicas: 'int', + requiredConfigs: 'string', + requiredSecrets: 'string', + resourceDefinitionId: 'uuid', + slug: 'string', + spec: 'json', + status: 'string', + statusDetail: 'string', + statusObserved: 'json', + storageClass: 'string', + storageSizeBytes: 'int', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nresources-health \n\nCommands:\n list List resourcesHealth records\n find-first Find first matching resourcesHealth record\n create Create a new resourcesHealth\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) => { +const usage = + '\nresources-health \n\nCommands:\n list List resourcesHealth records\n find-first Find first matching resourcesHealth record\n create Create a new resourcesHealth\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -109,16 +123,18 @@ async function handleList(argv: Partial>, _prompter: Inq storageClass: true, storageSizeBytes: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourcesHealthSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ResourcesHealthSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourcesHealth.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -158,16 +174,18 @@ async function handleFindFirst(argv: Partial>, _prompter storageClass: true, storageSizeBytes: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourcesHealthSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ResourcesHealthSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourcesHealth.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -176,221 +194,255 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: true - }, { - type: "text", - name: "cpuLimitMillicores", - message: "cpuLimitMillicores", - required: true - }, { - type: "text", - name: "cpuRequestMillicores", - message: "cpuRequestMillicores", - required: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "errorCount", - message: "errorCount", - required: true - }, { - type: "text", - name: "installationId", - message: "installationId", - required: true - }, { - type: "text", - name: "integrations", - message: "integrations", - required: true - }, { - type: "text", - name: "kind", - message: "kind", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: true - }, { - type: "text", - name: "lastHeartbeatAt", - message: "lastHeartbeatAt", - required: true - }, { - type: "text", - name: "memoryLimitBytes", - message: "memoryLimitBytes", - required: true - }, { - type: "text", - name: "memoryRequestBytes", - message: "memoryRequestBytes", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "replicas", - message: "replicas", - required: true - }, { - type: "text", - name: "requiredConfigs", - message: "requiredConfigs", - required: true - }, { - type: "text", - name: "requiredSecrets", - message: "requiredSecrets", - required: true - }, { - type: "text", - name: "resourceDefinitionId", - message: "resourceDefinitionId", - required: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "json", - name: "spec", - message: "spec", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: true - }, { - type: "text", - name: "statusDetail", - message: "statusDetail", - required: true - }, { - type: "json", - name: "statusObserved", - message: "statusObserved", - required: true - }, { - type: "text", - name: "storageClass", - message: "storageClass", - required: true - }, { - type: "text", - name: "storageSizeBytes", - message: "storageSizeBytes", - required: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: true, + }, + { + type: 'text', + name: 'cpuLimitMillicores', + message: 'cpuLimitMillicores', + required: true, + }, + { + type: 'text', + name: 'cpuRequestMillicores', + message: 'cpuRequestMillicores', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: true, + }, + { + type: 'text', + name: 'installationId', + message: 'installationId', + required: true, + }, + { + type: 'text', + name: 'integrations', + message: 'integrations', + required: true, + }, + { + type: 'text', + name: 'kind', + message: 'kind', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: true, + }, + { + type: 'text', + name: 'lastHeartbeatAt', + message: 'lastHeartbeatAt', + required: true, + }, + { + type: 'text', + name: 'memoryLimitBytes', + message: 'memoryLimitBytes', + required: true, + }, + { + type: 'text', + name: 'memoryRequestBytes', + message: 'memoryRequestBytes', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'replicas', + message: 'replicas', + required: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: true, + }, + { + type: 'text', + name: 'resourceDefinitionId', + message: 'resourceDefinitionId', + required: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'json', + name: 'spec', + message: 'spec', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: true, + }, + { + type: 'text', + name: 'statusDetail', + message: 'statusDetail', + required: true, + }, + { + type: 'json', + name: 'statusObserved', + message: 'statusObserved', + required: true, + }, + { + type: 'text', + name: 'storageClass', + message: 'storageClass', + required: true, + }, + { + type: 'text', + name: 'storageSizeBytes', + message: 'storageSizeBytes', + required: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourcesHealthInput["resourcesHealth"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourcesHealthInput['resourcesHealth']; const client = getClient(); - const result = await client.resourcesHealth.create({ - data: { - annotations: cleanedData.annotations, - cpuLimitMillicores: cleanedData.cpuLimitMillicores, - cpuRequestMillicores: cleanedData.cpuRequestMillicores, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - errorCount: cleanedData.errorCount, - installationId: cleanedData.installationId, - integrations: cleanedData.integrations, - kind: cleanedData.kind, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - lastHeartbeatAt: cleanedData.lastHeartbeatAt, - memoryLimitBytes: cleanedData.memoryLimitBytes, - memoryRequestBytes: cleanedData.memoryRequestBytes, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - replicas: cleanedData.replicas, - requiredConfigs: cleanedData.requiredConfigs, - requiredSecrets: cleanedData.requiredSecrets, - resourceDefinitionId: cleanedData.resourceDefinitionId, - slug: cleanedData.slug, - spec: cleanedData.spec, - status: cleanedData.status, - statusDetail: cleanedData.statusDetail, - statusObserved: cleanedData.statusObserved, - storageClass: cleanedData.storageClass, - storageSizeBytes: cleanedData.storageSizeBytes, - updatedBy: cleanedData.updatedBy - }, - select: { - annotations: true, - cpuLimitMillicores: true, - cpuRequestMillicores: true, - createdAt: true, - createdBy: true, - databaseId: true, - errorCount: true, - id: true, - installationId: true, - integrations: true, - kind: true, - labels: true, - lastError: true, - lastHeartbeatAt: true, - memoryLimitBytes: true, - memoryRequestBytes: true, - name: true, - namespaceId: true, - replicas: true, - requiredConfigs: true, - requiredSecrets: true, - resourceDefinitionId: true, - slug: true, - spec: true, - status: true, - statusDetail: true, - statusObserved: true, - storageClass: true, - storageSizeBytes: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.resourcesHealth + .create({ + data: { + annotations: cleanedData.annotations, + cpuLimitMillicores: cleanedData.cpuLimitMillicores, + cpuRequestMillicores: cleanedData.cpuRequestMillicores, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + errorCount: cleanedData.errorCount, + installationId: cleanedData.installationId, + integrations: cleanedData.integrations, + kind: cleanedData.kind, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + lastHeartbeatAt: cleanedData.lastHeartbeatAt, + memoryLimitBytes: cleanedData.memoryLimitBytes, + memoryRequestBytes: cleanedData.memoryRequestBytes, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + replicas: cleanedData.replicas, + requiredConfigs: cleanedData.requiredConfigs, + requiredSecrets: cleanedData.requiredSecrets, + resourceDefinitionId: cleanedData.resourceDefinitionId, + slug: cleanedData.slug, + spec: cleanedData.spec, + status: cleanedData.status, + statusDetail: cleanedData.statusDetail, + statusObserved: cleanedData.statusObserved, + storageClass: cleanedData.storageClass, + storageSizeBytes: cleanedData.storageSizeBytes, + updatedBy: cleanedData.updatedBy, + }, + select: { + annotations: true, + cpuLimitMillicores: true, + cpuRequestMillicores: true, + createdAt: true, + createdBy: true, + databaseId: true, + errorCount: true, + id: true, + installationId: true, + integrations: true, + kind: true, + labels: true, + lastError: true, + lastHeartbeatAt: true, + memoryLimitBytes: true, + memoryRequestBytes: true, + name: true, + namespaceId: true, + replicas: true, + requiredConfigs: true, + requiredSecrets: true, + resourceDefinitionId: true, + slug: true, + spec: true, + status: true, + statusDetail: true, + statusObserved: true, + storageClass: true, + storageSizeBytes: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resources-requirements-state.ts b/sdk/constructive-cli/src/compute/cli/commands/resources-requirements-state.ts index a00b0c889b..50c8a947a1 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resources-requirements-state.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resources-requirements-state.ts @@ -3,49 +3,63 @@ * @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 { CreateResourcesRequirementsStateInput, ResourcesRequirementsStatePatch, ResourcesRequirementsStateSelect, ResourcesRequirementsStateFilter, ResourcesRequirementsStateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourcesRequirementsStateInput, + ResourcesRequirementsStatePatch, + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - configHash: "string", - configObjectName: "string", - requirementsHash: "string", - resourceId: "uuid", - secretsHash: "string", - secretsObjectName: "string", - slug: "string" + configHash: 'string', + configObjectName: 'string', + requirementsHash: 'string', + resourceId: 'uuid', + secretsHash: 'string', + secretsObjectName: 'string', + slug: 'string', }; -const usage = "\nresources-requirements-state \n\nCommands:\n list List resourcesRequirementsState records\n find-first Find first matching resourcesRequirementsState record\n create Create a new resourcesRequirementsState\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) => { +const usage = + '\nresources-requirements-state \n\nCommands:\n list List resourcesRequirementsState records\n find-first Find first matching resourcesRequirementsState record\n create Create a new resourcesRequirementsState\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -61,16 +75,22 @@ async function handleList(argv: Partial>, _prompter: Inq resourceId: true, secretsHash: true, secretsObjectName: true, - slug: true + slug: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourcesRequirementsStateSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy + > & { + select: ResourcesRequirementsStateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourcesRequirementsState.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter resourceId: true, secretsHash: true, secretsObjectName: true, - slug: true + slug: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourcesRequirementsStateSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy + > & { + select: ResourcesRequirementsStateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourcesRequirementsState.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,71 +130,84 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "configHash", - message: "configHash", - required: true - }, { - type: "text", - name: "configObjectName", - message: "configObjectName", - required: true - }, { - type: "text", - name: "requirementsHash", - message: "requirementsHash", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }, { - type: "text", - name: "secretsHash", - message: "secretsHash", - required: true - }, { - type: "text", - name: "secretsObjectName", - message: "secretsObjectName", - required: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'configHash', + message: 'configHash', + required: true, + }, + { + type: 'text', + name: 'configObjectName', + message: 'configObjectName', + required: true, + }, + { + type: 'text', + name: 'requirementsHash', + message: 'requirementsHash', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + { + type: 'text', + name: 'secretsHash', + message: 'secretsHash', + required: true, + }, + { + type: 'text', + name: 'secretsObjectName', + message: 'secretsObjectName', + required: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourcesRequirementsStateInput["resourcesRequirementsState"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourcesRequirementsStateInput['resourcesRequirementsState']; const client = getClient(); - const result = await client.resourcesRequirementsState.create({ - data: { - configHash: cleanedData.configHash, - configObjectName: cleanedData.configObjectName, - requirementsHash: cleanedData.requirementsHash, - resourceId: cleanedData.resourceId, - secretsHash: cleanedData.secretsHash, - secretsObjectName: cleanedData.secretsObjectName, - slug: cleanedData.slug - }, - select: { - configHash: true, - configObjectName: true, - requirementsHash: true, - resourceId: true, - secretsHash: true, - secretsObjectName: true, - slug: true - } - }).execute(); + const result = await client.resourcesRequirementsState + .create({ + data: { + configHash: cleanedData.configHash, + configObjectName: cleanedData.configObjectName, + requirementsHash: cleanedData.requirementsHash, + resourceId: cleanedData.resourceId, + secretsHash: cleanedData.secretsHash, + secretsObjectName: cleanedData.secretsObjectName, + slug: cleanedData.slug, + }, + select: { + configHash: true, + configObjectName: true, + requirementsHash: true, + resourceId: true, + secretsHash: true, + secretsObjectName: true, + slug: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/resources-resolved-requirement.ts b/sdk/constructive-cli/src/compute/cli/commands/resources-resolved-requirement.ts index 7303645ad5..8c9c47144f 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/resources-resolved-requirement.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/resources-resolved-requirement.ts @@ -3,52 +3,66 @@ * @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 { CreateResourcesResolvedRequirementInput, ResourcesResolvedRequirementPatch, ResourcesResolvedRequirementSelect, ResourcesResolvedRequirementFilter, ResourcesResolvedRequirementOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourcesResolvedRequirementInput, + ResourcesResolvedRequirementPatch, + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - atomId: "uuid", - configObjectName: "string", - name: "string", - namespaceId: "uuid", - present: "boolean", - required: "boolean", - requirementKind: "string", - resourceId: "uuid", - secretsObjectName: "string", - slug: "string" + atomId: 'uuid', + configObjectName: 'string', + name: 'string', + namespaceId: 'uuid', + present: 'boolean', + required: 'boolean', + requirementKind: 'string', + resourceId: 'uuid', + secretsObjectName: 'string', + slug: 'string', }; -const usage = "\nresources-resolved-requirement \n\nCommands:\n list List resourcesResolvedRequirement records\n find-first Find first matching resourcesResolvedRequirement record\n create Create a new resourcesResolvedRequirement\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) => { +const usage = + '\nresources-resolved-requirement \n\nCommands:\n list List resourcesResolvedRequirement records\n find-first Find first matching resourcesResolvedRequirement record\n create Create a new resourcesResolvedRequirement\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq requirementKind: true, resourceId: true, secretsObjectName: true, - slug: true + slug: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourcesResolvedRequirementSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + > & { + select: ResourcesResolvedRequirementSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourcesResolvedRequirement.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +115,22 @@ async function handleFindFirst(argv: Partial>, _prompter requirementKind: true, resourceId: true, secretsObjectName: true, - slug: true + slug: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourcesResolvedRequirementSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + > & { + select: ResourcesResolvedRequirementSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourcesResolvedRequirement.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,92 +139,108 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "atomId", - message: "atomId", - required: true - }, { - type: "text", - name: "configObjectName", - message: "configObjectName", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "boolean", - name: "present", - message: "present", - required: true - }, { - type: "boolean", - name: "required", - message: "required", - required: true - }, { - type: "text", - name: "requirementKind", - message: "requirementKind", - required: true - }, { - type: "text", - name: "resourceId", - message: "resourceId", - required: true - }, { - type: "text", - name: "secretsObjectName", - message: "secretsObjectName", - required: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }]); - const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourcesResolvedRequirementInput["resourcesResolvedRequirement"]; - const client = getClient(); - const result = await client.resourcesResolvedRequirement.create({ - data: { - atomId: cleanedData.atomId, - configObjectName: cleanedData.configObjectName, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - present: cleanedData.present, - required: cleanedData.required, - requirementKind: cleanedData.requirementKind, - resourceId: cleanedData.resourceId, - secretsObjectName: cleanedData.secretsObjectName, - slug: cleanedData.slug + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'atomId', + message: 'atomId', + required: true, }, - select: { - atomId: true, - configObjectName: true, - name: true, - namespaceId: true, - present: true, + { + type: 'text', + name: 'configObjectName', + message: 'configObjectName', required: true, - requirementKind: true, - resourceId: true, - secretsObjectName: true, - slug: true - } - }).execute(); + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'boolean', + name: 'present', + message: 'present', + required: true, + }, + { + type: 'boolean', + name: 'required', + message: 'required', + required: true, + }, + { + type: 'text', + name: 'requirementKind', + message: 'requirementKind', + required: true, + }, + { + type: 'text', + name: 'resourceId', + message: 'resourceId', + required: true, + }, + { + type: 'text', + name: 'secretsObjectName', + message: 'secretsObjectName', + required: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourcesResolvedRequirementInput['resourcesResolvedRequirement']; + const client = getClient(); + const result = await client.resourcesResolvedRequirement + .create({ + data: { + atomId: cleanedData.atomId, + configObjectName: cleanedData.configObjectName, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + present: cleanedData.present, + required: cleanedData.required, + requirementKind: cleanedData.requirementKind, + resourceId: cleanedData.resourceId, + secretsObjectName: cleanedData.secretsObjectName, + slug: cleanedData.slug, + }, + select: { + atomId: true, + configObjectName: true, + name: true, + namespaceId: true, + present: true, + required: true, + requirementKind: true, + resourceId: true, + secretsObjectName: true, + slug: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/save-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/save-graph.ts index 04944c9c6f..b6046724f1 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/save-graph.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/save-graph.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { SaveGraphVariables } from "../../orm/mutation"; -import type { SaveGraphPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SaveGraphVariables } from '../../orm/mutation'; +import type { SaveGraphPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("save-graph - saveGraph\n\nUsage: save-graph [OPTIONS]\n"); + console.log('save-graph - saveGraph\n\nUsage: save-graph [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.saveGraph(parsedAnswers as unknown as SaveGraphVariables, { - select: selectFields - } as unknown as { - select: SaveGraphPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .saveGraph( + parsedAnswers as unknown as SaveGraphVariables, + { + select: selectFields, + } as unknown as { + select: SaveGraphPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: saveGraph"); + console.error('Failed: saveGraph'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/set-data-at-path.ts b/sdk/constructive-cli/src/compute/cli/commands/set-data-at-path.ts index a96ece186a..a815197cd6 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/set-data-at-path.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/set-data-at-path.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { SetDataAtPathVariables } from "../../orm/mutation"; -import type { SetDataAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SetDataAtPathVariables } from '../../orm/mutation'; +import type { SetDataAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("set-data-at-path - setDataAtPath\n\nUsage: set-data-at-path [OPTIONS]\n"); + console.log('set-data-at-path - setDataAtPath\n\nUsage: set-data-at-path [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.setDataAtPath(parsedAnswers as unknown as SetDataAtPathVariables, { - select: selectFields - } as unknown as { - select: SetDataAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .setDataAtPath( + parsedAnswers as unknown as SetDataAtPathVariables, + { + select: selectFields, + } as unknown as { + select: SetDataAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: setDataAtPath"); + console.error('Failed: setDataAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/start-execution.ts b/sdk/constructive-cli/src/compute/cli/commands/start-execution.ts index 37877fc822..eca3cb7bb1 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/start-execution.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/start-execution.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { StartExecutionVariables } from "../../orm/mutation"; -import type { StartExecutionPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { StartExecutionVariables } from '../../orm/mutation'; +import type { StartExecutionPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("start-execution - startExecution\n\nUsage: start-execution [OPTIONS]\n"); + console.log('start-execution - startExecution\n\nUsage: start-execution [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.startExecution(parsedAnswers as unknown as StartExecutionVariables, { - select: selectFields - } as unknown as { - select: StartExecutionPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .startExecution( + parsedAnswers as unknown as StartExecutionVariables, + { + select: selectFields, + } as unknown as { + select: StartExecutionPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: startExecution"); + console.error('Failed: startExecution'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/validate-function-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/validate-function-graph.ts index 1b7a410fb6..95dff06bf9 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/validate-function-graph.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/validate-function-graph.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ValidateFunctionGraphVariables } from "../../orm/mutation"; -import type { ValidateFunctionGraphPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ValidateFunctionGraphVariables } from '../../orm/mutation'; +import type { ValidateFunctionGraphPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("validate-function-graph - validateFunctionGraph\n\nUsage: validate-function-graph [OPTIONS]\n"); + console.log( + 'validate-function-graph - validateFunctionGraph\n\nUsage: validate-function-graph [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.validateFunctionGraph(parsedAnswers as unknown as ValidateFunctionGraphVariables, { - select: selectFields - } as unknown as { - select: ValidateFunctionGraphPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .validateFunctionGraph( + parsedAnswers as unknown as ValidateFunctionGraphVariables, + { + select: selectFields, + } as unknown as { + select: ValidateFunctionGraphPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: validateFunctionGraph"); + console.error('Failed: validateFunctionGraph'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/webhook-endpoint.ts b/sdk/constructive-cli/src/compute/cli/commands/webhook-endpoint.ts index 3ed8b21074..9eb2e627e1 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/webhook-endpoint.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/webhook-endpoint.ts @@ -3,62 +3,76 @@ * @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 { CreateWebhookEndpointInput, WebhookEndpointPatch, WebhookEndpointSelect, WebhookEndpointFilter, WebhookEndpointOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateWebhookEndpointInput, + WebhookEndpointPatch, + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - active: "boolean", - createdAt: "string", - createdBy: "uuid", - databaseId: "uuid", - functionDefinitionId: "uuid", - host: "string", - id: "uuid", - namespaceId: "uuid", - path: "string", - provider: "string", - replayWindowSeconds: "int", - signingSecretName: "string", - updatedAt: "string", - updatedBy: "uuid" + active: 'boolean', + createdAt: 'string', + createdBy: 'uuid', + databaseId: 'uuid', + functionDefinitionId: 'uuid', + host: 'string', + id: 'uuid', + namespaceId: 'uuid', + path: 'string', + provider: 'string', + replayWindowSeconds: 'int', + signingSecretName: 'string', + updatedAt: 'string', + updatedBy: 'uuid', }; -const usage = "\nwebhook-endpoint \n\nCommands:\n list List webhookEndpoint records\n find-first Find first matching webhookEndpoint record\n get Get a webhookEndpoint by ID\n create Create a new webhookEndpoint\n update Update an existing webhookEndpoint\n delete Delete a webhookEndpoint\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) => { +const usage = + '\nwebhook-endpoint \n\nCommands:\n list List webhookEndpoint records\n find-first Find first matching webhookEndpoint record\n get Get a webhookEndpoint by ID\n create Create a new webhookEndpoint\n update Update an existing webhookEndpoint\n delete Delete a webhookEndpoint\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,18 @@ async function handleList(argv: Partial>, _prompter: Inq replayWindowSeconds: true, signingSecretName: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findManyArgs = parseFindManyArgs & { - select: WebhookEndpointSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: WebhookEndpointSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webhookEndpoint.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +129,18 @@ async function handleFindFirst(argv: Partial>, _prompter replayWindowSeconds: true, signingSecretName: true, updatedAt: true, - updatedBy: true + updatedBy: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: WebhookEndpointSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: WebhookEndpointSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webhookEndpoint.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +149,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.webhookEndpoint.findOne({ - id: answers.id as string, - select: { - active: true, - createdAt: true, - createdBy: true, - databaseId: true, - functionDefinitionId: true, - host: true, - id: true, - namespaceId: true, - path: true, - provider: true, - replayWindowSeconds: true, - signingSecretName: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.webhookEndpoint + .findOne({ + id: answers.id as string, + select: { + active: true, + createdAt: true, + createdBy: true, + databaseId: true, + functionDefinitionId: true, + host: true, + id: true, + namespaceId: true, + path: true, + provider: true, + replayWindowSeconds: true, + signingSecretName: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,104 +190,121 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "active", - message: "active", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: true - }, { - type: "text", - name: "host", - message: "host", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "path", - message: "path", - required: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "replayWindowSeconds", - message: "replayWindowSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signingSecretName", - message: "signingSecretName", - required: true - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'active', + message: 'active', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: true, + }, + { + type: 'text', + name: 'host', + message: 'host', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'replayWindowSeconds', + message: 'replayWindowSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signingSecretName', + message: 'signingSecretName', + required: true, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateWebhookEndpointInput["webhookEndpoint"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateWebhookEndpointInput['webhookEndpoint']; const client = getClient(); - const result = await client.webhookEndpoint.create({ - data: { - active: cleanedData.active, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - functionDefinitionId: cleanedData.functionDefinitionId, - host: cleanedData.host, - namespaceId: cleanedData.namespaceId, - path: cleanedData.path, - provider: cleanedData.provider, - replayWindowSeconds: cleanedData.replayWindowSeconds, - signingSecretName: cleanedData.signingSecretName, - updatedBy: cleanedData.updatedBy - }, - select: { - active: true, - createdAt: true, - createdBy: true, - databaseId: true, - functionDefinitionId: true, - host: true, - id: true, - namespaceId: true, - path: true, - provider: true, - replayWindowSeconds: true, - signingSecretName: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.webhookEndpoint + .create({ + data: { + active: cleanedData.active, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + functionDefinitionId: cleanedData.functionDefinitionId, + host: cleanedData.host, + namespaceId: cleanedData.namespaceId, + path: cleanedData.path, + provider: cleanedData.provider, + replayWindowSeconds: cleanedData.replayWindowSeconds, + signingSecretName: cleanedData.signingSecretName, + updatedBy: cleanedData.updatedBy, + }, + select: { + active: true, + createdAt: true, + createdBy: true, + databaseId: true, + functionDefinitionId: true, + host: true, + id: true, + namespaceId: true, + path: true, + provider: true, + replayWindowSeconds: true, + signingSecretName: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -274,112 +313,127 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "active", - message: "active", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createdBy", - message: "createdBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "functionDefinitionId", - message: "functionDefinitionId", - required: false - }, { - type: "text", - name: "host", - message: "host", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "path", - message: "path", - required: false - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "replayWindowSeconds", - message: "replayWindowSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signingSecretName", - message: "signingSecretName", - required: false - }, { - type: "text", - name: "updatedBy", - message: "updatedBy", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'active', + message: 'active', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + }, + { + type: 'text', + name: 'host', + message: 'host', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: false, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'replayWindowSeconds', + message: 'replayWindowSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signingSecretName', + message: 'signingSecretName', + required: false, + }, + { + type: 'text', + name: 'updatedBy', + message: 'updatedBy', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as WebhookEndpointPatch; const client = getClient(); - const result = await client.webhookEndpoint.update({ - where: { - id: answers.id as string - }, - data: { - active: cleanedData.active, - createdBy: cleanedData.createdBy, - databaseId: cleanedData.databaseId, - functionDefinitionId: cleanedData.functionDefinitionId, - host: cleanedData.host, - namespaceId: cleanedData.namespaceId, - path: cleanedData.path, - provider: cleanedData.provider, - replayWindowSeconds: cleanedData.replayWindowSeconds, - signingSecretName: cleanedData.signingSecretName, - updatedBy: cleanedData.updatedBy - }, - select: { - active: true, - createdAt: true, - createdBy: true, - databaseId: true, - functionDefinitionId: true, - host: true, - id: true, - namespaceId: true, - path: true, - provider: true, - replayWindowSeconds: true, - signingSecretName: true, - updatedAt: true, - updatedBy: true - } - }).execute(); + const result = await client.webhookEndpoint + .update({ + where: { + id: answers.id as string, + }, + data: { + active: cleanedData.active, + createdBy: cleanedData.createdBy, + databaseId: cleanedData.databaseId, + functionDefinitionId: cleanedData.functionDefinitionId, + host: cleanedData.host, + namespaceId: cleanedData.namespaceId, + path: cleanedData.path, + provider: cleanedData.provider, + replayWindowSeconds: cleanedData.replayWindowSeconds, + signingSecretName: cleanedData.signingSecretName, + updatedBy: cleanedData.updatedBy, + }, + select: { + active: true, + createdAt: true, + createdBy: true, + databaseId: true, + functionDefinitionId: true, + host: true, + id: true, + namespaceId: true, + path: true, + provider: true, + replayWindowSeconds: true, + signingSecretName: true, + updatedAt: true, + updatedBy: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -388,28 +442,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.webhookEndpoint.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.webhookEndpoint + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/webhook-event.ts b/sdk/constructive-cli/src/compute/cli/commands/webhook-event.ts index e322367042..56fe4495d2 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/webhook-event.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/webhook-event.ts @@ -3,61 +3,75 @@ * @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 { CreateWebhookEventInput, WebhookEventPatch, WebhookEventSelect, WebhookEventFilter, WebhookEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateWebhookEventInput, + WebhookEventPatch, + WebhookEventSelect, + WebhookEventFilter, + WebhookEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - endpointId: "uuid", - error: "string", - externalEventId: "string", - id: "uuid", - invocationCreatedAt: "string", - invocationId: "uuid", - payload: "json", - provider: "string", - providerTimestamp: "string", - status: "string", - updatedAt: "string" + createdAt: 'string', + databaseId: 'uuid', + endpointId: 'uuid', + error: 'string', + externalEventId: 'string', + id: 'uuid', + invocationCreatedAt: 'string', + invocationId: 'uuid', + payload: 'json', + provider: 'string', + providerTimestamp: 'string', + status: 'string', + updatedAt: 'string', }; -const usage = "\nwebhook-event \n\nCommands:\n list List webhookEvent records\n find-first Find first matching webhookEvent record\n get Get a webhookEvent by ID\n create Create a new webhookEvent\n update Update an existing webhookEvent\n delete Delete a webhookEvent\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) => { +const usage = + '\nwebhook-event \n\nCommands:\n list List webhookEvent records\n find-first Find first matching webhookEvent record\n get Get a webhookEvent by ID\n create Create a new webhookEvent\n update Update an existing webhookEvent\n delete Delete a webhookEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq provider: true, providerTimestamp: true, status: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: WebhookEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: WebhookEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webhookEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter provider: true, providerTimestamp: true, status: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: WebhookEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: WebhookEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webhookEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.webhookEvent.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - endpointId: true, - error: true, - externalEventId: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - payload: true, - provider: true, - providerTimestamp: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.webhookEvent + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + endpointId: true, + error: true, + externalEventId: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + payload: true, + provider: true, + providerTimestamp: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,98 +186,114 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "endpointId", - message: "endpointId", - required: true - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "externalEventId", - message: "externalEventId", - required: true - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payload", - message: "payload", - required: false, - skipPrompt: true - }, { - type: "text", - name: "provider", - message: "provider", - required: true - }, { - type: "text", - name: "providerTimestamp", - message: "providerTimestamp", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'endpointId', + message: 'endpointId', + required: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'externalEventId', + message: 'externalEventId', + required: true, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: true, + }, + { + type: 'text', + name: 'providerTimestamp', + message: 'providerTimestamp', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateWebhookEventInput["webhookEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateWebhookEventInput['webhookEvent']; const client = getClient(); - const result = await client.webhookEvent.create({ - data: { - databaseId: cleanedData.databaseId, - endpointId: cleanedData.endpointId, - error: cleanedData.error, - externalEventId: cleanedData.externalEventId, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - payload: cleanedData.payload, - provider: cleanedData.provider, - providerTimestamp: cleanedData.providerTimestamp, - status: cleanedData.status - }, - select: { - createdAt: true, - databaseId: true, - endpointId: true, - error: true, - externalEventId: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - payload: true, - provider: true, - providerTimestamp: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.webhookEvent + .create({ + data: { + databaseId: cleanedData.databaseId, + endpointId: cleanedData.endpointId, + error: cleanedData.error, + externalEventId: cleanedData.externalEventId, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + payload: cleanedData.payload, + provider: cleanedData.provider, + providerTimestamp: cleanedData.providerTimestamp, + status: cleanedData.status, + }, + select: { + createdAt: true, + databaseId: true, + endpointId: true, + error: true, + externalEventId: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + payload: true, + provider: true, + providerTimestamp: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -264,106 +302,120 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "endpointId", - message: "endpointId", - required: false - }, { - type: "text", - name: "error", - message: "error", - required: false, - skipPrompt: true - }, { - type: "text", - name: "externalEventId", - message: "externalEventId", - required: false - }, { - type: "text", - name: "invocationCreatedAt", - message: "invocationCreatedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationId", - message: "invocationId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "payload", - message: "payload", - required: false, - skipPrompt: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false - }, { - type: "text", - name: "providerTimestamp", - message: "providerTimestamp", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + 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: 'endpointId', + message: 'endpointId', + required: false, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'externalEventId', + message: 'externalEventId', + required: false, + }, + { + type: 'text', + name: 'invocationCreatedAt', + message: 'invocationCreatedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + }, + { + type: 'text', + name: 'providerTimestamp', + message: 'providerTimestamp', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as WebhookEventPatch; const client = getClient(); - const result = await client.webhookEvent.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - endpointId: cleanedData.endpointId, - error: cleanedData.error, - externalEventId: cleanedData.externalEventId, - invocationCreatedAt: cleanedData.invocationCreatedAt, - invocationId: cleanedData.invocationId, - payload: cleanedData.payload, - provider: cleanedData.provider, - providerTimestamp: cleanedData.providerTimestamp, - status: cleanedData.status - }, - select: { - createdAt: true, - databaseId: true, - endpointId: true, - error: true, - externalEventId: true, - id: true, - invocationCreatedAt: true, - invocationId: true, - payload: true, - provider: true, - providerTimestamp: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.webhookEvent + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + endpointId: cleanedData.endpointId, + error: cleanedData.error, + externalEventId: cleanedData.externalEventId, + invocationCreatedAt: cleanedData.invocationCreatedAt, + invocationId: cleanedData.invocationId, + payload: cleanedData.payload, + provider: cleanedData.provider, + providerTimestamp: cleanedData.providerTimestamp, + status: cleanedData.status, + }, + select: { + createdAt: true, + databaseId: true, + endpointId: true, + error: true, + externalEventId: true, + id: true, + invocationCreatedAt: true, + invocationId: true, + payload: true, + provider: true, + providerTimestamp: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -372,28 +424,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.webhookEvent.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.webhookEvent + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/executor.ts b/sdk/constructive-cli/src/compute/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/compute/cli/executor.ts +++ b/sdk/constructive-cli/src/compute/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/cli/index.ts b/sdk/constructive-cli/src/compute/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/compute/cli/index.ts +++ b/sdk/constructive-cli/src/compute/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/compute/cli/utils.ts b/sdk/constructive-cli/src/compute/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/compute/cli/utils.ts +++ b/sdk/constructive-cli/src/compute/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/compute/index.ts b/sdk/constructive-cli/src/compute/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/compute/index.ts +++ b/sdk/constructive-cli/src/compute/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/compute/orm/client.ts b/sdk/constructive-cli/src/compute/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/compute/orm/client.ts +++ b/sdk/constructive-cli/src/compute/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/compute/orm/index.ts b/sdk/constructive-cli/src/compute/orm/index.ts index 097bc38eea..933b08ed35 100644 --- a/sdk/constructive-cli/src/compute/orm/index.ts +++ b/sdk/constructive-cli/src/compute/orm/index.ts @@ -3,84 +3,84 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { DbPresetModel } from "./models/dbPreset"; -import { FunctionApiBindingModel } from "./models/functionApiBinding"; -import { FunctionDefinitionModel } from "./models/functionDefinition"; -import { FunctionDeploymentModel } from "./models/functionDeployment"; -import { FunctionDeploymentEventModel } from "./models/functionDeploymentEvent"; -import { FunctionExecutionLogModel } from "./models/functionExecutionLog"; -import { FunctionGraphCommitModel } from "./models/functionGraphCommit"; -import { FunctionGraphModel } from "./models/functionGraph"; -import { FunctionGraphExecutionModel } from "./models/functionGraphExecution"; -import { FunctionGraphExecutionNodeStateModel } from "./models/functionGraphExecutionNodeState"; -import { FunctionGraphExecutionOutputModel } from "./models/functionGraphExecutionOutput"; -import { FunctionGraphObjectModel } from "./models/functionGraphObject"; -import { FunctionGraphRefModel } from "./models/functionGraphRef"; -import { FunctionGraphStoreModel } from "./models/functionGraphStore"; -import { FunctionInvocationAttemptModel } from "./models/functionInvocationAttempt"; -import { FunctionInvocationModel } from "./models/functionInvocation"; -import { GetAllTreeNodesRecordModel } from "./models/getAllTreeNodesRecord"; -import { InfraCommitModel } from "./models/infraCommit"; -import { InfraGetAllTreeNodesRecordModel } from "./models/infraGetAllTreeNodesRecord"; -import { InfraObjectModel } from "./models/infraObject"; -import { InfraRefModel } from "./models/infraRef"; -import { InfraStoreModel } from "./models/infraStore"; -import { IntegrationProviderModel } from "./models/integrationProvider"; -import { NamespaceModel } from "./models/namespace"; -import { NamespaceEventModel } from "./models/namespaceEvent"; -import { PlatformFunctionApiBindingModel } from "./models/platformFunctionApiBinding"; -import { PlatformFunctionDefinitionModel } from "./models/platformFunctionDefinition"; -import { PlatformFunctionDeploymentModel } from "./models/platformFunctionDeployment"; -import { PlatformFunctionDeploymentEventModel } from "./models/platformFunctionDeploymentEvent"; -import { PlatformFunctionExecutionLogModel } from "./models/platformFunctionExecutionLog"; -import { PlatformFunctionInvocationAttemptModel } from "./models/platformFunctionInvocationAttempt"; -import { PlatformFunctionInvocationModel } from "./models/platformFunctionInvocation"; -import { PlatformInfraCommitModel } from "./models/platformInfraCommit"; -import { PlatformInfraGetAllTreeNodesRecordModel } from "./models/platformInfraGetAllTreeNodesRecord"; -import { PlatformInfraObjectModel } from "./models/platformInfraObject"; -import { PlatformInfraRefModel } from "./models/platformInfraRef"; -import { PlatformInfraStoreModel } from "./models/platformInfraStore"; -import { PlatformNamespaceModel } from "./models/platformNamespace"; -import { PlatformNamespaceEventModel } from "./models/platformNamespaceEvent"; -import { PlatformResourceModel } from "./models/platformResource"; -import { PlatformResourceDeclaredCapacityModel } from "./models/platformResourceDeclaredCapacity"; -import { PlatformResourceDefinitionModel } from "./models/platformResourceDefinition"; -import { PlatformResourceEventModel } from "./models/platformResourceEvent"; -import { PlatformResourceInstallationModel } from "./models/platformResourceInstallation"; -import { PlatformResourceStatusCheckModel } from "./models/platformResourceStatusCheck"; -import { PlatformResourceUsageLogModel } from "./models/platformResourceUsageLog"; -import { PlatformResourceUsageSummaryModel } from "./models/platformResourceUsageSummary"; -import { PlatformResourceUtilizationModel } from "./models/platformResourceUtilization"; -import { PlatformResourcesHealthModel } from "./models/platformResourcesHealth"; -import { PlatformResourcesRequirementsStateModel } from "./models/platformResourcesRequirementsState"; -import { PlatformResourcesResolvedRequirementModel } from "./models/platformResourcesResolvedRequirement"; -import { PlatformWebhookEndpointModel } from "./models/platformWebhookEndpoint"; -import { PlatformWebhookEventModel } from "./models/platformWebhookEvent"; -import { ResourceModel } from "./models/resource"; -import { ResourceDeclaredCapacityModel } from "./models/resourceDeclaredCapacity"; -import { ResourceDefinitionModel } from "./models/resourceDefinition"; -import { ResourceEventModel } from "./models/resourceEvent"; -import { ResourceInstallationModel } from "./models/resourceInstallation"; -import { ResourceStatusCheckModel } from "./models/resourceStatusCheck"; -import { ResourceUsageLogModel } from "./models/resourceUsageLog"; -import { ResourceUsageSummaryModel } from "./models/resourceUsageSummary"; -import { ResourceUtilizationModel } from "./models/resourceUtilization"; -import { ResourcesHealthModel } from "./models/resourcesHealth"; -import { ResourcesRequirementsStateModel } from "./models/resourcesRequirementsState"; -import { ResourcesResolvedRequirementModel } from "./models/resourcesResolvedRequirement"; -import { WebhookEndpointModel } from "./models/webhookEndpoint"; -import { WebhookEventModel } from "./models/webhookEvent"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { DbPresetModel } from './models/dbPreset'; +import { FunctionApiBindingModel } from './models/functionApiBinding'; +import { FunctionDefinitionModel } from './models/functionDefinition'; +import { FunctionDeploymentModel } from './models/functionDeployment'; +import { FunctionDeploymentEventModel } from './models/functionDeploymentEvent'; +import { FunctionExecutionLogModel } from './models/functionExecutionLog'; +import { FunctionGraphCommitModel } from './models/functionGraphCommit'; +import { FunctionGraphModel } from './models/functionGraph'; +import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; +import { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; +import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecutionOutput'; +import { FunctionGraphObjectModel } from './models/functionGraphObject'; +import { FunctionGraphRefModel } from './models/functionGraphRef'; +import { FunctionGraphStoreModel } from './models/functionGraphStore'; +import { FunctionInvocationAttemptModel } from './models/functionInvocationAttempt'; +import { FunctionInvocationModel } from './models/functionInvocation'; +import { GetAllTreeNodesRecordModel } from './models/getAllTreeNodesRecord'; +import { InfraCommitModel } from './models/infraCommit'; +import { InfraGetAllTreeNodesRecordModel } from './models/infraGetAllTreeNodesRecord'; +import { InfraObjectModel } from './models/infraObject'; +import { InfraRefModel } from './models/infraRef'; +import { InfraStoreModel } from './models/infraStore'; +import { IntegrationProviderModel } from './models/integrationProvider'; +import { NamespaceModel } from './models/namespace'; +import { NamespaceEventModel } from './models/namespaceEvent'; +import { PlatformFunctionApiBindingModel } from './models/platformFunctionApiBinding'; +import { PlatformFunctionDefinitionModel } from './models/platformFunctionDefinition'; +import { PlatformFunctionDeploymentModel } from './models/platformFunctionDeployment'; +import { PlatformFunctionDeploymentEventModel } from './models/platformFunctionDeploymentEvent'; +import { PlatformFunctionExecutionLogModel } from './models/platformFunctionExecutionLog'; +import { PlatformFunctionInvocationAttemptModel } from './models/platformFunctionInvocationAttempt'; +import { PlatformFunctionInvocationModel } from './models/platformFunctionInvocation'; +import { PlatformInfraCommitModel } from './models/platformInfraCommit'; +import { PlatformInfraGetAllTreeNodesRecordModel } from './models/platformInfraGetAllTreeNodesRecord'; +import { PlatformInfraObjectModel } from './models/platformInfraObject'; +import { PlatformInfraRefModel } from './models/platformInfraRef'; +import { PlatformInfraStoreModel } from './models/platformInfraStore'; +import { PlatformNamespaceModel } from './models/platformNamespace'; +import { PlatformNamespaceEventModel } from './models/platformNamespaceEvent'; +import { PlatformResourceModel } from './models/platformResource'; +import { PlatformResourceDeclaredCapacityModel } from './models/platformResourceDeclaredCapacity'; +import { PlatformResourceDefinitionModel } from './models/platformResourceDefinition'; +import { PlatformResourceEventModel } from './models/platformResourceEvent'; +import { PlatformResourceInstallationModel } from './models/platformResourceInstallation'; +import { PlatformResourceStatusCheckModel } from './models/platformResourceStatusCheck'; +import { PlatformResourceUsageLogModel } from './models/platformResourceUsageLog'; +import { PlatformResourceUsageSummaryModel } from './models/platformResourceUsageSummary'; +import { PlatformResourceUtilizationModel } from './models/platformResourceUtilization'; +import { PlatformResourcesHealthModel } from './models/platformResourcesHealth'; +import { PlatformResourcesRequirementsStateModel } from './models/platformResourcesRequirementsState'; +import { PlatformResourcesResolvedRequirementModel } from './models/platformResourcesResolvedRequirement'; +import { PlatformWebhookEndpointModel } from './models/platformWebhookEndpoint'; +import { PlatformWebhookEventModel } from './models/platformWebhookEvent'; +import { ResourceModel } from './models/resource'; +import { ResourceDeclaredCapacityModel } from './models/resourceDeclaredCapacity'; +import { ResourceDefinitionModel } from './models/resourceDefinition'; +import { ResourceEventModel } from './models/resourceEvent'; +import { ResourceInstallationModel } from './models/resourceInstallation'; +import { ResourceStatusCheckModel } from './models/resourceStatusCheck'; +import { ResourceUsageLogModel } from './models/resourceUsageLog'; +import { ResourceUsageSummaryModel } from './models/resourceUsageSummary'; +import { ResourceUtilizationModel } from './models/resourceUtilization'; +import { ResourcesHealthModel } from './models/resourcesHealth'; +import { ResourcesRequirementsStateModel } from './models/resourcesRequirementsState'; +import { ResourcesResolvedRequirementModel } from './models/resourcesResolvedRequirement'; +import { WebhookEndpointModel } from './models/webhookEndpoint'; +import { WebhookEventModel } from './models/webhookEvent'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -175,6 +175,6 @@ export function createClient(config: OrmClientConfig) { webhookEndpoint: new WebhookEndpointModel(client), webhookEvent: new WebhookEventModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/input-types.ts b/sdk/constructive-cli/src/compute/orm/input-types.ts index 24e4a3d10c..6ff0184126 100644 --- a/sdk/constructive-cli/src/compute/orm/input-types.ts +++ b/sdk/constructive-cli/src/compute/orm/input-types.ts @@ -2038,67 +2038,102 @@ export type DbPresetWithRelations = DbPreset & DbPresetRelations; export type FunctionApiBindingWithRelations = FunctionApiBinding & FunctionApiBindingRelations; export type FunctionDefinitionWithRelations = FunctionDefinition & FunctionDefinitionRelations; export type FunctionDeploymentWithRelations = FunctionDeployment & FunctionDeploymentRelations; -export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & FunctionDeploymentEventRelations; -export type FunctionExecutionLogWithRelations = FunctionExecutionLog & FunctionExecutionLogRelations; +export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & + FunctionDeploymentEventRelations; +export type FunctionExecutionLogWithRelations = FunctionExecutionLog & + FunctionExecutionLogRelations; export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGraphCommitRelations; export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; -export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & FunctionGraphExecutionRelations; -export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & FunctionGraphExecutionNodeStateRelations; -export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & FunctionGraphExecutionOutputRelations; +export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & + FunctionGraphExecutionRelations; +export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & + FunctionGraphExecutionNodeStateRelations; +export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & + FunctionGraphExecutionOutputRelations; export type FunctionGraphObjectWithRelations = FunctionGraphObject & FunctionGraphObjectRelations; export type FunctionGraphRefWithRelations = FunctionGraphRef & FunctionGraphRefRelations; export type FunctionGraphStoreWithRelations = FunctionGraphStore & FunctionGraphStoreRelations; -export type FunctionInvocationAttemptWithRelations = FunctionInvocationAttempt & FunctionInvocationAttemptRelations; +export type FunctionInvocationAttemptWithRelations = FunctionInvocationAttempt & + FunctionInvocationAttemptRelations; export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; -export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & GetAllTreeNodesRecordRelations; +export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & + GetAllTreeNodesRecordRelations; export type InfraCommitWithRelations = InfraCommit & InfraCommitRelations; -export type InfraGetAllTreeNodesRecordWithRelations = InfraGetAllTreeNodesRecord & InfraGetAllTreeNodesRecordRelations; +export type InfraGetAllTreeNodesRecordWithRelations = InfraGetAllTreeNodesRecord & + InfraGetAllTreeNodesRecordRelations; export type InfraObjectWithRelations = InfraObject & InfraObjectRelations; export type InfraRefWithRelations = InfraRef & InfraRefRelations; export type InfraStoreWithRelations = InfraStore & InfraStoreRelations; export type IntegrationProviderWithRelations = IntegrationProvider & IntegrationProviderRelations; export type NamespaceWithRelations = Namespace & NamespaceRelations; export type NamespaceEventWithRelations = NamespaceEvent & NamespaceEventRelations; -export type PlatformFunctionApiBindingWithRelations = PlatformFunctionApiBinding & PlatformFunctionApiBindingRelations; -export type PlatformFunctionDefinitionWithRelations = PlatformFunctionDefinition & PlatformFunctionDefinitionRelations; -export type PlatformFunctionDeploymentWithRelations = PlatformFunctionDeployment & PlatformFunctionDeploymentRelations; -export type PlatformFunctionDeploymentEventWithRelations = PlatformFunctionDeploymentEvent & PlatformFunctionDeploymentEventRelations; -export type PlatformFunctionExecutionLogWithRelations = PlatformFunctionExecutionLog & PlatformFunctionExecutionLogRelations; -export type PlatformFunctionInvocationAttemptWithRelations = PlatformFunctionInvocationAttempt & PlatformFunctionInvocationAttemptRelations; -export type PlatformFunctionInvocationWithRelations = PlatformFunctionInvocation & PlatformFunctionInvocationRelations; +export type PlatformFunctionApiBindingWithRelations = PlatformFunctionApiBinding & + PlatformFunctionApiBindingRelations; +export type PlatformFunctionDefinitionWithRelations = PlatformFunctionDefinition & + PlatformFunctionDefinitionRelations; +export type PlatformFunctionDeploymentWithRelations = PlatformFunctionDeployment & + PlatformFunctionDeploymentRelations; +export type PlatformFunctionDeploymentEventWithRelations = PlatformFunctionDeploymentEvent & + PlatformFunctionDeploymentEventRelations; +export type PlatformFunctionExecutionLogWithRelations = PlatformFunctionExecutionLog & + PlatformFunctionExecutionLogRelations; +export type PlatformFunctionInvocationAttemptWithRelations = PlatformFunctionInvocationAttempt & + PlatformFunctionInvocationAttemptRelations; +export type PlatformFunctionInvocationWithRelations = PlatformFunctionInvocation & + PlatformFunctionInvocationRelations; export type PlatformInfraCommitWithRelations = PlatformInfraCommit & PlatformInfraCommitRelations; -export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & PlatformInfraGetAllTreeNodesRecordRelations; +export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & + PlatformInfraGetAllTreeNodesRecordRelations; export type PlatformInfraObjectWithRelations = PlatformInfraObject & PlatformInfraObjectRelations; export type PlatformInfraRefWithRelations = PlatformInfraRef & PlatformInfraRefRelations; export type PlatformInfraStoreWithRelations = PlatformInfraStore & PlatformInfraStoreRelations; export type PlatformNamespaceWithRelations = PlatformNamespace & PlatformNamespaceRelations; -export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & PlatformNamespaceEventRelations; +export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & + PlatformNamespaceEventRelations; export type PlatformResourceWithRelations = PlatformResource & PlatformResourceRelations; -export type PlatformResourceDeclaredCapacityWithRelations = PlatformResourceDeclaredCapacity & PlatformResourceDeclaredCapacityRelations; -export type PlatformResourceDefinitionWithRelations = PlatformResourceDefinition & PlatformResourceDefinitionRelations; -export type PlatformResourceEventWithRelations = PlatformResourceEvent & PlatformResourceEventRelations; -export type PlatformResourceInstallationWithRelations = PlatformResourceInstallation & PlatformResourceInstallationRelations; -export type PlatformResourceStatusCheckWithRelations = PlatformResourceStatusCheck & PlatformResourceStatusCheckRelations; -export type PlatformResourceUsageLogWithRelations = PlatformResourceUsageLog & PlatformResourceUsageLogRelations; -export type PlatformResourceUsageSummaryWithRelations = PlatformResourceUsageSummary & PlatformResourceUsageSummaryRelations; -export type PlatformResourceUtilizationWithRelations = PlatformResourceUtilization & PlatformResourceUtilizationRelations; -export type PlatformResourcesHealthWithRelations = PlatformResourcesHealth & PlatformResourcesHealthRelations; -export type PlatformResourcesRequirementsStateWithRelations = PlatformResourcesRequirementsState & PlatformResourcesRequirementsStateRelations; -export type PlatformResourcesResolvedRequirementWithRelations = PlatformResourcesResolvedRequirement & PlatformResourcesResolvedRequirementRelations; -export type PlatformWebhookEndpointWithRelations = PlatformWebhookEndpoint & PlatformWebhookEndpointRelations; -export type PlatformWebhookEventWithRelations = PlatformWebhookEvent & PlatformWebhookEventRelations; +export type PlatformResourceDeclaredCapacityWithRelations = PlatformResourceDeclaredCapacity & + PlatformResourceDeclaredCapacityRelations; +export type PlatformResourceDefinitionWithRelations = PlatformResourceDefinition & + PlatformResourceDefinitionRelations; +export type PlatformResourceEventWithRelations = PlatformResourceEvent & + PlatformResourceEventRelations; +export type PlatformResourceInstallationWithRelations = PlatformResourceInstallation & + PlatformResourceInstallationRelations; +export type PlatformResourceStatusCheckWithRelations = PlatformResourceStatusCheck & + PlatformResourceStatusCheckRelations; +export type PlatformResourceUsageLogWithRelations = PlatformResourceUsageLog & + PlatformResourceUsageLogRelations; +export type PlatformResourceUsageSummaryWithRelations = PlatformResourceUsageSummary & + PlatformResourceUsageSummaryRelations; +export type PlatformResourceUtilizationWithRelations = PlatformResourceUtilization & + PlatformResourceUtilizationRelations; +export type PlatformResourcesHealthWithRelations = PlatformResourcesHealth & + PlatformResourcesHealthRelations; +export type PlatformResourcesRequirementsStateWithRelations = PlatformResourcesRequirementsState & + PlatformResourcesRequirementsStateRelations; +export type PlatformResourcesResolvedRequirementWithRelations = + PlatformResourcesResolvedRequirement & PlatformResourcesResolvedRequirementRelations; +export type PlatformWebhookEndpointWithRelations = PlatformWebhookEndpoint & + PlatformWebhookEndpointRelations; +export type PlatformWebhookEventWithRelations = PlatformWebhookEvent & + PlatformWebhookEventRelations; export type ResourceWithRelations = Resource & ResourceRelations; -export type ResourceDeclaredCapacityWithRelations = ResourceDeclaredCapacity & ResourceDeclaredCapacityRelations; +export type ResourceDeclaredCapacityWithRelations = ResourceDeclaredCapacity & + ResourceDeclaredCapacityRelations; export type ResourceDefinitionWithRelations = ResourceDefinition & ResourceDefinitionRelations; export type ResourceEventWithRelations = ResourceEvent & ResourceEventRelations; -export type ResourceInstallationWithRelations = ResourceInstallation & ResourceInstallationRelations; +export type ResourceInstallationWithRelations = ResourceInstallation & + ResourceInstallationRelations; export type ResourceStatusCheckWithRelations = ResourceStatusCheck & ResourceStatusCheckRelations; export type ResourceUsageLogWithRelations = ResourceUsageLog & ResourceUsageLogRelations; -export type ResourceUsageSummaryWithRelations = ResourceUsageSummary & ResourceUsageSummaryRelations; +export type ResourceUsageSummaryWithRelations = ResourceUsageSummary & + ResourceUsageSummaryRelations; export type ResourceUtilizationWithRelations = ResourceUtilization & ResourceUtilizationRelations; export type ResourcesHealthWithRelations = ResourcesHealth & ResourcesHealthRelations; -export type ResourcesRequirementsStateWithRelations = ResourcesRequirementsState & ResourcesRequirementsStateRelations; -export type ResourcesResolvedRequirementWithRelations = ResourcesResolvedRequirement & ResourcesResolvedRequirementRelations; +export type ResourcesRequirementsStateWithRelations = ResourcesRequirementsState & + ResourcesRequirementsStateRelations; +export type ResourcesResolvedRequirementWithRelations = ResourcesResolvedRequirement & + ResourcesResolvedRequirementRelations; export type WebhookEndpointWithRelations = WebhookEndpoint & WebhookEndpointRelations; export type WebhookEventWithRelations = WebhookEvent & WebhookEventRelations; // ============ Entity Select Types ============ @@ -5659,73 +5694,1942 @@ export interface WebhookEventFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type DbPresetOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MODULES_HASH_ASC" | "MODULES_HASH_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type FunctionApiBindingOrderBy = "ALIAS_ASC" | "ALIAS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type FunctionDefinitionOrderBy = "ACCESS_CHANNELS_ASC" | "ACCESS_CHANNELS_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FN_CATEGORY_ASC" | "FN_CATEGORY_DESC" | "FUNCTION_COLUMNS_ASC" | "FUNCTION_COLUMNS_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "INPUTS_ASC" | "INPUTS_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "MAX_ATTEMPTS_ASC" | "MAX_ATTEMPTS_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MODULE_TABLE_ASC" | "MODULE_TABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUTPUTS_ASC" | "OUTPUTS_DESC" | "PAYLOAD_ARGS_ASC" | "PAYLOAD_ARGS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "PROPS_ASC" | "PROPS_DESC" | "PROTECTED_ASC" | "PROTECTED_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "QUEUE_NAME_ASC" | "QUEUE_NAME_DESC" | "REQUIRED_BUCKETS_ASC" | "REQUIRED_BUCKETS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_MODELS_ASC" | "REQUIRED_MODELS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RUNTIME_ASC" | "RUNTIME_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "TARGET_FUNCTION_ASC" | "TARGET_FUNCTION_DESC" | "TARGET_SCHEMA_ASC" | "TARGET_SCHEMA_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VOLATILE_ASC" | "VOLATILE_DESC"; -export type FunctionDeploymentOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "HANDLER_NAME_ASC" | "HANDLER_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "IMAGE_VERSION_ASC" | "IMAGE_VERSION_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_AT_ASC" | "LAST_ERROR_AT_DESC" | "LAST_ERROR_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SERVICE_NAME_ASC" | "SERVICE_NAME_DESC" | "SERVICE_URL_ASC" | "SERVICE_URL_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type FunctionDeploymentEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYMENT_ID_ASC" | "DEPLOYMENT_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type FunctionExecutionLogOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LOG_LEVEL_ASC" | "LOG_LEVEL_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type FunctionGraphCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type FunctionGraphOrderBy = "CONTEXT_ASC" | "CONTEXT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DEFINITIONS_COMMIT_ID_ASC" | "DEFINITIONS_COMMIT_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_VALID_ASC" | "IS_VALID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALIDATION_ERRORS_ASC" | "VALIDATION_ERRORS_DESC"; -export type FunctionGraphExecutionOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CURRENT_WAVE_ASC" | "CURRENT_WAVE_DESC" | "DEFINITIONS_COMMIT_ID_ASC" | "DEFINITIONS_COMMIT_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ERROR_CODE_ASC" | "ERROR_CODE_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXECUTION_PLAN_ASC" | "EXECUTION_PLAN_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ID_ASC" | "ID_DESC" | "INPUT_PAYLOAD_ASC" | "INPUT_PAYLOAD_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LAST_PROGRESS_AT_ASC" | "LAST_PROGRESS_AT_DESC" | "MAX_PENDING_JOBS_ASC" | "MAX_PENDING_JOBS_DESC" | "MAX_TICKS_ASC" | "MAX_TICKS_DESC" | "NATURAL" | "NODE_OUTPUTS_ASC" | "NODE_OUTPUTS_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "OUTPUT_NAMES_ASC" | "OUTPUT_NAMES_DESC" | "OUTPUT_NODE_ASC" | "OUTPUT_NODE_DESC" | "OUTPUT_PAYLOAD_ASC" | "OUTPUT_PAYLOAD_DESC" | "OUTPUT_PORT_ASC" | "OUTPUT_PORT_DESC" | "PARENT_EXECUTION_ID_ASC" | "PARENT_EXECUTION_ID_DESC" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PARENT_NODE_NAME_ASC" | "PARENT_NODE_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TICK_COUNT_ASC" | "TICK_COUNT_DESC" | "TIMEOUT_AT_ASC" | "TIMEOUT_AT_DESC"; -export type FunctionGraphExecutionNodeStateOrderBy = "CALLBACK_INPUTS_ASC" | "CALLBACK_INPUTS_DESC" | "CALLBACK_META_ASC" | "CALLBACK_META_DESC" | "CALLBACK_TOKEN_HASH_ASC" | "CALLBACK_TOKEN_HASH_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ERROR_CODE_ASC" | "ERROR_CODE_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXECUTION_ID_ASC" | "EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODE_NAME_ASC" | "NODE_NAME_DESC" | "NODE_PATH_ASC" | "NODE_PATH_DESC" | "OUTPUT_ID_ASC" | "OUTPUT_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type FunctionGraphExecutionOutputOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionGraphObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionGraphRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type FunctionGraphStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionInvocationAttemptOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ATTEMPT_ASC" | "ATTEMPT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ERROR_DETAIL_ASC" | "ERROR_DETAIL_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type FunctionInvocationOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "API_BINDING_ID_ASC" | "API_BINDING_ID_DESC" | "CHANNEL_ASC" | "CHANNEL_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFINITION_SCOPE_ASC" | "DEFINITION_SCOPE_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "GRAPH_EXECUTION_ID_ASC" | "GRAPH_EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOB_ID_ASC" | "JOB_ID_DESC" | "NATURAL" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVENANCE_ASC" | "PROVENANCE_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type GetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type InfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type InfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type InfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type InfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type InfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type IntegrationProviderOrderBy = "BRAND_ASC" | "BRAND_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "LOGO_ASC" | "LOGO_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionApiBindingOrderBy = "ALIAS_ASC" | "ALIAS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionDefinitionOrderBy = "ACCESS_CHANNELS_ASC" | "ACCESS_CHANNELS_DESC" | "BILLABLE_ASC" | "BILLABLE_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FN_CATEGORY_ASC" | "FN_CATEGORY_DESC" | "FUNCTION_COLUMNS_ASC" | "FUNCTION_COLUMNS_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "INPUTS_ASC" | "INPUTS_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "MAX_ATTEMPTS_ASC" | "MAX_ATTEMPTS_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MODULE_TABLE_ASC" | "MODULE_TABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUTPUTS_ASC" | "OUTPUTS_DESC" | "PAYLOAD_ARGS_ASC" | "PAYLOAD_ARGS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "PROPS_ASC" | "PROPS_DESC" | "PROTECTED_ASC" | "PROTECTED_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "QUEUE_NAME_ASC" | "QUEUE_NAME_DESC" | "REQUIRED_BUCKETS_ASC" | "REQUIRED_BUCKETS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_MODELS_ASC" | "REQUIRED_MODELS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RUNTIME_ASC" | "RUNTIME_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SYSTEM_ASC" | "SYSTEM_DESC" | "TARGET_FUNCTION_ASC" | "TARGET_FUNCTION_DESC" | "TARGET_SCHEMA_ASC" | "TARGET_SCHEMA_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VOLATILE_ASC" | "VOLATILE_DESC"; -export type PlatformFunctionDeploymentOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "HANDLER_NAME_ASC" | "HANDLER_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "IMAGE_VERSION_ASC" | "IMAGE_VERSION_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_AT_ASC" | "LAST_ERROR_AT_DESC" | "LAST_ERROR_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SERVICE_NAME_ASC" | "SERVICE_NAME_DESC" | "SERVICE_URL_ASC" | "SERVICE_URL_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformFunctionDeploymentEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEPLOYMENT_ID_ASC" | "DEPLOYMENT_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionExecutionLogOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LOG_LEVEL_ASC" | "LOG_LEVEL_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformFunctionInvocationAttemptOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ATTEMPT_ASC" | "ATTEMPT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ERROR_DETAIL_ASC" | "ERROR_DETAIL_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformFunctionInvocationOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "API_BINDING_ID_ASC" | "API_BINDING_ID_DESC" | "CHANNEL_ASC" | "CHANNEL_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_SCOPE_ASC" | "DEFINITION_SCOPE_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "GRAPH_EXECUTION_ID_ASC" | "GRAPH_EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOB_ID_ASC" | "JOB_ID_DESC" | "NATURAL" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVENANCE_ASC" | "PROVENANCE_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformInfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type PlatformInfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type PlatformInfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformInfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type PlatformInfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformNamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformNamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformResourceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceDeclaredCapacityOrderBy = "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "IS_TRANSIENT_ASC" | "IS_TRANSIENT_DESC" | "KIND_ASC" | "KIND_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "POD_COUNT_MAX_ASC" | "POD_COUNT_MAX_DESC" | "POD_COUNT_MIN_ASC" | "POD_COUNT_MIN_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "SOURCE_ID_ASC" | "SOURCE_ID_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC"; -export type PlatformResourceDefinitionOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DEFAULT_SPEC_ASC" | "DEFAULT_SPEC_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STEP_UP_MIN_AGE_ASC" | "STEP_UP_MIN_AGE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC"; -export type PlatformResourceInstallationOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMS_ASC" | "PARAMS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceStatusCheckOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUESTED_AT_ASC" | "REQUESTED_AT_DESC" | "REQUESTED_BY_ASC" | "REQUESTED_BY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type PlatformResourceUsageLogOrderBy = "CPU_MILLICORES_ASC" | "CPU_MILLICORES_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_SECONDS_ASC" | "INTERVAL_SECONDS_DESC" | "MEMORY_BYTES_ASC" | "MEMORY_BYTES_DESC" | "METRICS_ASC" | "METRICS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SAMPLED_AT_ASC" | "SAMPLED_AT_DESC" | "SOURCE_ASC" | "SOURCE_DESC"; -export type PlatformResourceUsageSummaryOrderBy = "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "ID_ASC" | "ID_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type PlatformResourceUtilizationOrderBy = "AVG_MEMORY_BYTES_ASC" | "AVG_MEMORY_BYTES_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_PEAK_UTILIZATION_ASC" | "CPU_PEAK_UTILIZATION_DESC" | "CPU_REQUEST_HEADROOM_MILLICORES_ASC" | "CPU_REQUEST_HEADROOM_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "KIND_ASC" | "KIND_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_PEAK_UTILIZATION_ASC" | "MEMORY_PEAK_UTILIZATION_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MEMORY_REQUEST_HEADROOM_BYTES_ASC" | "MEMORY_REQUEST_HEADROOM_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type PlatformResourcesHealthOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_DETAIL_ASC" | "STATUS_DETAIL_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourcesRequirementsStateOrderBy = "CONFIG_HASH_ASC" | "CONFIG_HASH_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NATURAL" | "REQUIREMENTS_HASH_ASC" | "REQUIREMENTS_HASH_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_HASH_ASC" | "SECRETS_HASH_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type PlatformResourcesResolvedRequirementOrderBy = "ATOM_ID_ASC" | "ATOM_ID_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRESENT_ASC" | "PRESENT_DESC" | "REQUIRED_ASC" | "REQUIRED_DESC" | "REQUIREMENT_KIND_ASC" | "REQUIREMENT_KIND_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type PlatformWebhookEndpointOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "HOST_ASC" | "HOST_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "REPLAY_WINDOW_SECONDS_ASC" | "REPLAY_WINDOW_SECONDS_DESC" | "SIGNING_SECRET_NAME_ASC" | "SIGNING_SECRET_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformWebhookEventOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENDPOINT_ID_ASC" | "ENDPOINT_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXTERNAL_EVENT_ID_ASC" | "EXTERNAL_EVENT_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVIDER_TIMESTAMP_ASC" | "PROVIDER_TIMESTAMP_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ResourceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceDeclaredCapacityOrderBy = "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "IS_TRANSIENT_ASC" | "IS_TRANSIENT_DESC" | "KIND_ASC" | "KIND_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "POD_COUNT_MAX_ASC" | "POD_COUNT_MAX_DESC" | "POD_COUNT_MIN_ASC" | "POD_COUNT_MIN_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "SOURCE_ID_ASC" | "SOURCE_ID_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC"; -export type ResourceDefinitionOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_SPEC_ASC" | "DEFAULT_SPEC_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STEP_UP_MIN_AGE_ASC" | "STEP_UP_MIN_AGE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC"; -export type ResourceInstallationOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMS_ASC" | "PARAMS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceStatusCheckOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUESTED_AT_ASC" | "REQUESTED_AT_DESC" | "REQUESTED_BY_ASC" | "REQUESTED_BY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type ResourceUsageLogOrderBy = "CPU_MILLICORES_ASC" | "CPU_MILLICORES_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_SECONDS_ASC" | "INTERVAL_SECONDS_DESC" | "MEMORY_BYTES_ASC" | "MEMORY_BYTES_DESC" | "METRICS_ASC" | "METRICS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SAMPLED_AT_ASC" | "SAMPLED_AT_DESC" | "SOURCE_ASC" | "SOURCE_DESC"; -export type ResourceUsageSummaryOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "ID_ASC" | "ID_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type ResourceUtilizationOrderBy = "AVG_MEMORY_BYTES_ASC" | "AVG_MEMORY_BYTES_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_PEAK_UTILIZATION_ASC" | "CPU_PEAK_UTILIZATION_DESC" | "CPU_REQUEST_HEADROOM_MILLICORES_ASC" | "CPU_REQUEST_HEADROOM_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "KIND_ASC" | "KIND_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_PEAK_UTILIZATION_ASC" | "MEMORY_PEAK_UTILIZATION_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MEMORY_REQUEST_HEADROOM_BYTES_ASC" | "MEMORY_REQUEST_HEADROOM_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type ResourcesHealthOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_DETAIL_ASC" | "STATUS_DETAIL_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourcesRequirementsStateOrderBy = "CONFIG_HASH_ASC" | "CONFIG_HASH_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NATURAL" | "REQUIREMENTS_HASH_ASC" | "REQUIREMENTS_HASH_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_HASH_ASC" | "SECRETS_HASH_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type ResourcesResolvedRequirementOrderBy = "ATOM_ID_ASC" | "ATOM_ID_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRESENT_ASC" | "PRESENT_DESC" | "REQUIRED_ASC" | "REQUIRED_DESC" | "REQUIREMENT_KIND_ASC" | "REQUIREMENT_KIND_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type WebhookEndpointOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "HOST_ASC" | "HOST_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "REPLAY_WINDOW_SECONDS_ASC" | "REPLAY_WINDOW_SECONDS_DESC" | "SIGNING_SECRET_NAME_ASC" | "SIGNING_SECRET_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type WebhookEventOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENDPOINT_ID_ASC" | "ENDPOINT_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXTERNAL_EVENT_ID_ASC" | "EXTERNAL_EVENT_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVIDER_TIMESTAMP_ASC" | "PROVIDER_TIMESTAMP_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DbPresetOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MODULES_HASH_ASC' + | 'MODULES_HASH_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type FunctionApiBindingOrderBy = + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type FunctionDefinitionOrderBy = + | 'ACCESS_CHANNELS_ASC' + | 'ACCESS_CHANNELS_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FN_CATEGORY_ASC' + | 'FN_CATEGORY_DESC' + | 'FUNCTION_COLUMNS_ASC' + | 'FUNCTION_COLUMNS_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MODULE_TABLE_ASC' + | 'MODULE_TABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PAYLOAD_ARGS_ASC' + | 'PAYLOAD_ARGS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'PROTECTED_ASC' + | 'PROTECTED_DESC' + | 'PUBLISHED_AT_ASC' + | 'PUBLISHED_AT_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'TARGET_FUNCTION_ASC' + | 'TARGET_FUNCTION_DESC' + | 'TARGET_SCHEMA_ASC' + | 'TARGET_SCHEMA_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC'; +export type FunctionDeploymentOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'HANDLER_NAME_ASC' + | 'HANDLER_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'IMAGE_VERSION_ASC' + | 'IMAGE_VERSION_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type FunctionDeploymentEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type FunctionExecutionLogOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type FunctionGraphCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type FunctionGraphOrderBy = + | 'CONTEXT_ASC' + | 'CONTEXT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VALID_ASC' + | 'IS_VALID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALIDATION_ERRORS_ASC' + | 'VALIDATION_ERRORS_DESC'; +export type FunctionGraphExecutionOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CURRENT_WAVE_ASC' + | 'CURRENT_WAVE_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXECUTION_PLAN_ASC' + | 'EXECUTION_PLAN_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INPUT_PAYLOAD_ASC' + | 'INPUT_PAYLOAD_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LAST_PROGRESS_AT_ASC' + | 'LAST_PROGRESS_AT_DESC' + | 'MAX_PENDING_JOBS_ASC' + | 'MAX_PENDING_JOBS_DESC' + | 'MAX_TICKS_ASC' + | 'MAX_TICKS_DESC' + | 'NATURAL' + | 'NODE_OUTPUTS_ASC' + | 'NODE_OUTPUTS_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'OUTPUT_NAMES_ASC' + | 'OUTPUT_NAMES_DESC' + | 'OUTPUT_NODE_ASC' + | 'OUTPUT_NODE_DESC' + | 'OUTPUT_PAYLOAD_ASC' + | 'OUTPUT_PAYLOAD_DESC' + | 'OUTPUT_PORT_ASC' + | 'OUTPUT_PORT_DESC' + | 'PARENT_EXECUTION_ID_ASC' + | 'PARENT_EXECUTION_ID_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PARENT_NODE_NAME_ASC' + | 'PARENT_NODE_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TICK_COUNT_ASC' + | 'TICK_COUNT_DESC' + | 'TIMEOUT_AT_ASC' + | 'TIMEOUT_AT_DESC'; +export type FunctionGraphExecutionNodeStateOrderBy = + | 'CALLBACK_INPUTS_ASC' + | 'CALLBACK_INPUTS_DESC' + | 'CALLBACK_META_ASC' + | 'CALLBACK_META_DESC' + | 'CALLBACK_TOKEN_HASH_ASC' + | 'CALLBACK_TOKEN_HASH_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXECUTION_ID_ASC' + | 'EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODE_NAME_ASC' + | 'NODE_NAME_DESC' + | 'NODE_PATH_ASC' + | 'NODE_PATH_DESC' + | 'OUTPUT_ID_ASC' + | 'OUTPUT_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type FunctionGraphExecutionOutputOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionGraphObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionGraphRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type FunctionGraphStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionInvocationAttemptOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ATTEMPT_ASC' + | 'ATTEMPT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ERROR_DETAIL_ASC' + | 'ERROR_DETAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type FunctionInvocationOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'API_BINDING_ID_ASC' + | 'API_BINDING_ID_DESC' + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFINITION_SCOPE_ASC' + | 'DEFINITION_SCOPE_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'NATURAL' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVENANCE_ASC' + | 'PROVENANCE_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type GetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type InfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type InfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type InfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type InfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type InfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type IntegrationProviderOrderBy = + | 'BRAND_ASC' + | 'BRAND_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LOGO_ASC' + | 'LOGO_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionApiBindingOrderBy = + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionDefinitionOrderBy = + | 'ACCESS_CHANNELS_ASC' + | 'ACCESS_CHANNELS_DESC' + | 'BILLABLE_ASC' + | 'BILLABLE_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FN_CATEGORY_ASC' + | 'FN_CATEGORY_DESC' + | 'FUNCTION_COLUMNS_ASC' + | 'FUNCTION_COLUMNS_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MODULE_TABLE_ASC' + | 'MODULE_TABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PAYLOAD_ARGS_ASC' + | 'PAYLOAD_ARGS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'PROTECTED_ASC' + | 'PROTECTED_DESC' + | 'PUBLISHED_AT_ASC' + | 'PUBLISHED_AT_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SYSTEM_ASC' + | 'SYSTEM_DESC' + | 'TARGET_FUNCTION_ASC' + | 'TARGET_FUNCTION_DESC' + | 'TARGET_SCHEMA_ASC' + | 'TARGET_SCHEMA_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC'; +export type PlatformFunctionDeploymentOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'HANDLER_NAME_ASC' + | 'HANDLER_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'IMAGE_VERSION_ASC' + | 'IMAGE_VERSION_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformFunctionDeploymentEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionExecutionLogOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformFunctionInvocationAttemptOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ATTEMPT_ASC' + | 'ATTEMPT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ERROR_DETAIL_ASC' + | 'ERROR_DETAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformFunctionInvocationOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'API_BINDING_ID_ASC' + | 'API_BINDING_ID_DESC' + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_SCOPE_ASC' + | 'DEFINITION_SCOPE_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'NATURAL' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVENANCE_ASC' + | 'PROVENANCE_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformInfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type PlatformInfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type PlatformInfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformInfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type PlatformInfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformNamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformNamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformResourceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceDeclaredCapacityOrderBy = + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'IS_TRANSIENT_ASC' + | 'IS_TRANSIENT_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'POD_COUNT_MAX_ASC' + | 'POD_COUNT_MAX_DESC' + | 'POD_COUNT_MIN_ASC' + | 'POD_COUNT_MIN_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'SOURCE_ID_ASC' + | 'SOURCE_ID_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC'; +export type PlatformResourceDefinitionOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DEFAULT_SPEC_ASC' + | 'DEFAULT_SPEC_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STEP_UP_MIN_AGE_ASC' + | 'STEP_UP_MIN_AGE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC'; +export type PlatformResourceInstallationOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMS_ASC' + | 'PARAMS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceStatusCheckOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUESTED_AT_ASC' + | 'REQUESTED_AT_DESC' + | 'REQUESTED_BY_ASC' + | 'REQUESTED_BY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type PlatformResourceUsageLogOrderBy = + | 'CPU_MILLICORES_ASC' + | 'CPU_MILLICORES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_SECONDS_ASC' + | 'INTERVAL_SECONDS_DESC' + | 'MEMORY_BYTES_ASC' + | 'MEMORY_BYTES_DESC' + | 'METRICS_ASC' + | 'METRICS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SAMPLED_AT_ASC' + | 'SAMPLED_AT_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC'; +export type PlatformResourceUsageSummaryOrderBy = + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type PlatformResourceUtilizationOrderBy = + | 'AVG_MEMORY_BYTES_ASC' + | 'AVG_MEMORY_BYTES_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_PEAK_UTILIZATION_ASC' + | 'CPU_PEAK_UTILIZATION_DESC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_ASC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_PEAK_UTILIZATION_ASC' + | 'MEMORY_PEAK_UTILIZATION_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_ASC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type PlatformResourcesHealthOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_DETAIL_ASC' + | 'STATUS_DETAIL_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourcesRequirementsStateOrderBy = + | 'CONFIG_HASH_ASC' + | 'CONFIG_HASH_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NATURAL' + | 'REQUIREMENTS_HASH_ASC' + | 'REQUIREMENTS_HASH_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_HASH_ASC' + | 'SECRETS_HASH_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type PlatformResourcesResolvedRequirementOrderBy = + | 'ATOM_ID_ASC' + | 'ATOM_ID_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRESENT_ASC' + | 'PRESENT_DESC' + | 'REQUIRED_ASC' + | 'REQUIRED_DESC' + | 'REQUIREMENT_KIND_ASC' + | 'REQUIREMENT_KIND_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type PlatformWebhookEndpointOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'HOST_ASC' + | 'HOST_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'REPLAY_WINDOW_SECONDS_ASC' + | 'REPLAY_WINDOW_SECONDS_DESC' + | 'SIGNING_SECRET_NAME_ASC' + | 'SIGNING_SECRET_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformWebhookEventOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENDPOINT_ID_ASC' + | 'ENDPOINT_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXTERNAL_EVENT_ID_ASC' + | 'EXTERNAL_EVENT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVIDER_TIMESTAMP_ASC' + | 'PROVIDER_TIMESTAMP_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ResourceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceDeclaredCapacityOrderBy = + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'IS_TRANSIENT_ASC' + | 'IS_TRANSIENT_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'POD_COUNT_MAX_ASC' + | 'POD_COUNT_MAX_DESC' + | 'POD_COUNT_MIN_ASC' + | 'POD_COUNT_MIN_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'SOURCE_ID_ASC' + | 'SOURCE_ID_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC'; +export type ResourceDefinitionOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_SPEC_ASC' + | 'DEFAULT_SPEC_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STEP_UP_MIN_AGE_ASC' + | 'STEP_UP_MIN_AGE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC'; +export type ResourceInstallationOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMS_ASC' + | 'PARAMS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceStatusCheckOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUESTED_AT_ASC' + | 'REQUESTED_AT_DESC' + | 'REQUESTED_BY_ASC' + | 'REQUESTED_BY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type ResourceUsageLogOrderBy = + | 'CPU_MILLICORES_ASC' + | 'CPU_MILLICORES_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_SECONDS_ASC' + | 'INTERVAL_SECONDS_DESC' + | 'MEMORY_BYTES_ASC' + | 'MEMORY_BYTES_DESC' + | 'METRICS_ASC' + | 'METRICS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SAMPLED_AT_ASC' + | 'SAMPLED_AT_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC'; +export type ResourceUsageSummaryOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type ResourceUtilizationOrderBy = + | 'AVG_MEMORY_BYTES_ASC' + | 'AVG_MEMORY_BYTES_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_PEAK_UTILIZATION_ASC' + | 'CPU_PEAK_UTILIZATION_DESC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_ASC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_PEAK_UTILIZATION_ASC' + | 'MEMORY_PEAK_UTILIZATION_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_ASC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type ResourcesHealthOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_DETAIL_ASC' + | 'STATUS_DETAIL_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourcesRequirementsStateOrderBy = + | 'CONFIG_HASH_ASC' + | 'CONFIG_HASH_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NATURAL' + | 'REQUIREMENTS_HASH_ASC' + | 'REQUIREMENTS_HASH_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_HASH_ASC' + | 'SECRETS_HASH_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type ResourcesResolvedRequirementOrderBy = + | 'ATOM_ID_ASC' + | 'ATOM_ID_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRESENT_ASC' + | 'PRESENT_DESC' + | 'REQUIRED_ASC' + | 'REQUIRED_DESC' + | 'REQUIREMENT_KIND_ASC' + | 'REQUIREMENT_KIND_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type WebhookEndpointOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'HOST_ASC' + | 'HOST_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'REPLAY_WINDOW_SECONDS_ASC' + | 'REPLAY_WINDOW_SECONDS_DESC' + | 'SIGNING_SECRET_NAME_ASC' + | 'SIGNING_SECRET_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type WebhookEventOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENDPOINT_ID_ASC' + | 'ENDPOINT_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXTERNAL_EVENT_ID_ASC' + | 'EXTERNAL_EVENT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVIDER_TIMESTAMP_ASC' + | 'PROVIDER_TIMESTAMP_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateDbPresetInput { clientMutationId?: string; @@ -8206,62 +10110,62 @@ export interface DeleteWebhookEventInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "FunctionApiBinding": { - "functionInvocationsByApiBindingId": "FunctionInvocation" + FunctionApiBinding: { + functionInvocationsByApiBindingId: 'FunctionInvocation', }, - "FunctionDefinition": { - "functionApiBindings": "FunctionApiBinding", - "webhookEndpoints": "WebhookEndpoint" + FunctionDefinition: { + functionApiBindings: 'FunctionApiBinding', + webhookEndpoints: 'WebhookEndpoint', }, - "FunctionGraph": { - "functionGraphExecutionsByGraphId": "FunctionGraphExecution", - "platformFunctionDefinitionsByGraphId": "PlatformFunctionDefinition" + FunctionGraph: { + functionGraphExecutionsByGraphId: 'FunctionGraphExecution', + platformFunctionDefinitionsByGraphId: 'PlatformFunctionDefinition', }, - "Namespace": { - "functionDeployments": "FunctionDeployment", - "resourceDefinitions": "ResourceDefinition", - "resourceInstallations": "ResourceInstallation", - "resources": "Resource", - "webhookEndpoints": "WebhookEndpoint" + Namespace: { + functionDeployments: 'FunctionDeployment', + resourceDefinitions: 'ResourceDefinition', + resourceInstallations: 'ResourceInstallation', + resources: 'Resource', + webhookEndpoints: 'WebhookEndpoint', }, - "PlatformFunctionApiBinding": { - "platformFunctionInvocationsByApiBindingId": "PlatformFunctionInvocation" + PlatformFunctionApiBinding: { + platformFunctionInvocationsByApiBindingId: 'PlatformFunctionInvocation', }, - "PlatformFunctionDefinition": { - "platformFunctionApiBindingsByFunctionDefinitionId": "PlatformFunctionApiBinding", - "platformWebhookEndpointsByFunctionDefinitionId": "PlatformWebhookEndpoint" + PlatformFunctionDefinition: { + platformFunctionApiBindingsByFunctionDefinitionId: 'PlatformFunctionApiBinding', + platformWebhookEndpointsByFunctionDefinitionId: 'PlatformWebhookEndpoint', }, - "PlatformNamespace": { - "platformFunctionDeploymentsByNamespaceId": "PlatformFunctionDeployment", - "platformResourceDefinitionsByNamespaceId": "PlatformResourceDefinition", - "platformResourceInstallationsByNamespaceId": "PlatformResourceInstallation", - "platformResourcesByNamespaceId": "PlatformResource", - "platformWebhookEndpointsByNamespaceId": "PlatformWebhookEndpoint" + PlatformNamespace: { + platformFunctionDeploymentsByNamespaceId: 'PlatformFunctionDeployment', + platformResourceDefinitionsByNamespaceId: 'PlatformResourceDefinition', + platformResourceInstallationsByNamespaceId: 'PlatformResourceInstallation', + platformResourcesByNamespaceId: 'PlatformResource', + platformWebhookEndpointsByNamespaceId: 'PlatformWebhookEndpoint', }, - "PlatformResource": { - "platformResourceStatusChecksByResourceId": "PlatformResourceStatusCheck" + PlatformResource: { + platformResourceStatusChecksByResourceId: 'PlatformResourceStatusCheck', }, - "PlatformResourceDefinition": { - "platformResourcesByResourceDefinitionId": "PlatformResource" + PlatformResourceDefinition: { + platformResourcesByResourceDefinitionId: 'PlatformResource', }, - "PlatformResourceInstallation": { - "platformResourcesByInstallationId": "PlatformResource" + PlatformResourceInstallation: { + platformResourcesByInstallationId: 'PlatformResource', }, - "PlatformWebhookEndpoint": { - "platformWebhookEventsByEndpointId": "PlatformWebhookEvent" + PlatformWebhookEndpoint: { + platformWebhookEventsByEndpointId: 'PlatformWebhookEvent', }, - "Resource": { - "resourceStatusChecks": "ResourceStatusCheck" + Resource: { + resourceStatusChecks: 'ResourceStatusCheck', }, - "ResourceDefinition": { - "resources": "Resource" + ResourceDefinition: { + resources: 'Resource', }, - "ResourceInstallation": { - "resourcesByInstallationId": "Resource" + ResourceInstallation: { + resourcesByInstallationId: 'Resource', + }, + WebhookEndpoint: { + webhookEventsByEndpointId: 'WebhookEvent', }, - "WebhookEndpoint": { - "webhookEventsByEndpointId": "WebhookEvent" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface AddEdgeInput { @@ -14975,4 +16879,4 @@ export type WebhookEventEdgeSelect = { node?: { select: WebhookEventSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/compute/orm/models/dbPreset.ts b/sdk/constructive-cli/src/compute/orm/models/dbPreset.ts index 15b60268b5..a3e824a674 100644 --- a/sdk/constructive-cli/src/compute/orm/models/dbPreset.ts +++ b/sdk/constructive-cli/src/compute/orm/models/dbPreset.ts @@ -3,56 +3,96 @@ * @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 { DbPreset, DbPresetWithRelations, DbPresetSelect, DbPresetFilter, DbPresetOrderBy, CreateDbPresetInput, UpdateDbPresetInput, DbPresetPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPreset, + DbPresetWithRelations, + DbPresetSelect, + DbPresetFilter, + DbPresetOrderBy, + CreateDbPresetInput, + UpdateDbPresetInput, + DbPresetPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", 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 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + 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, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPresets", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPresets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPreset", "dbPresets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPreset", "createDbPreset", "dbPreset", args.select, args.data, "CreateDbPresetInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPreset', + 'createDbPreset', + 'dbPreset', + args.select, + args.data, + 'CreateDbPresetInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "createDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'createDbPreset', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPreset", "updateDbPreset", "dbPreset", args.select, args.where.id, args.data, "UpdateDbPresetInput", "id", "dbPresetPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPreset', + 'updateDbPreset', + 'dbPreset', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetInput', + 'id', + 'dbPresetPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "updateDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'updateDbPreset', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPreset", "deleteDbPreset", "dbPreset", { - id: args.where.id - }, "DeleteDbPresetInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPreset', + 'deleteDbPreset', + 'dbPreset', + { + id: args.where.id, + }, + 'DeleteDbPresetInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "deleteDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'deleteDbPreset', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionApiBinding.ts b/sdk/constructive-cli/src/compute/orm/models/functionApiBinding.ts index 209cd4b4d5..a98f9d2a06 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionApiBinding.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionApiBinding.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionApiBinding, FunctionApiBindingWithRelations, FunctionApiBindingSelect, FunctionApiBindingFilter, FunctionApiBindingOrderBy, CreateFunctionApiBindingInput, UpdateFunctionApiBindingInput, FunctionApiBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionApiBinding, + FunctionApiBindingWithRelations, + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, + CreateFunctionApiBindingInput, + UpdateFunctionApiBindingInput, + FunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionApiBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBindings", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBinding", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionApiBinding": data.functionApiBindings?.nodes?.[0] ?? null - }) + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBinding", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionApiBinding": data.functionApiBindings?.nodes?.[0] ?? null - }) + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionApiBinding", "createFunctionApiBinding", "functionApiBinding", args.select, args.data, "CreateFunctionApiBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionApiBinding', + 'createFunctionApiBinding', + 'functionApiBinding', + args.select, + args.data, + 'CreateFunctionApiBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "createFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'createFunctionApiBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionApiBinding", "updateFunctionApiBinding", "functionApiBinding", args.select, args.where.id, args.data, "UpdateFunctionApiBindingInput", "id", "functionApiBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionApiBinding', + 'updateFunctionApiBinding', + 'functionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdateFunctionApiBindingInput', + 'id', + 'functionApiBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "updateFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'updateFunctionApiBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionApiBinding", "deleteFunctionApiBinding", "functionApiBinding", { - id: args.where.id - }, "DeleteFunctionApiBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionApiBinding', + 'deleteFunctionApiBinding', + 'functionApiBinding', + { + id: args.where.id, + }, + 'DeleteFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "deleteFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'deleteFunctionApiBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionDefinition.ts b/sdk/constructive-cli/src/compute/orm/models/functionDefinition.ts index 4ca2f5b29f..be6cb3ac27 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionDefinition.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionDefinition.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDefinition, FunctionDefinitionWithRelations, FunctionDefinitionSelect, FunctionDefinitionFilter, FunctionDefinitionOrderBy, CreateFunctionDefinitionInput, UpdateFunctionDefinitionInput, FunctionDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDefinition, + FunctionDefinitionWithRelations, + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, + CreateFunctionDefinitionInput, + UpdateFunctionDefinitionInput, + FunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinitions", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinition", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDefinition": data.functionDefinitions?.nodes?.[0] ?? null - }) + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinition", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDefinition": data.functionDefinitions?.nodes?.[0] ?? null - }) + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDefinition", "createFunctionDefinition", "functionDefinition", args.select, args.data, "CreateFunctionDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDefinition', + 'createFunctionDefinition', + 'functionDefinition', + args.select, + args.data, + 'CreateFunctionDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "createFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'createFunctionDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDefinition", "updateFunctionDefinition", "functionDefinition", args.select, args.where.id, args.data, "UpdateFunctionDefinitionInput", "id", "functionDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDefinition', + 'updateFunctionDefinition', + 'functionDefinition', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDefinitionInput', + 'id', + 'functionDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "updateFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'updateFunctionDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDefinition", "deleteFunctionDefinition", "functionDefinition", { - id: args.where.id - }, "DeleteFunctionDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDefinition', + 'deleteFunctionDefinition', + 'functionDefinition', + { + id: args.where.id, + }, + 'DeleteFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "deleteFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'deleteFunctionDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionDeployment.ts b/sdk/constructive-cli/src/compute/orm/models/functionDeployment.ts index 7470fc406f..d54820ebba 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionDeployment.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionDeployment.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeployment, FunctionDeploymentWithRelations, FunctionDeploymentSelect, FunctionDeploymentFilter, FunctionDeploymentOrderBy, CreateFunctionDeploymentInput, UpdateFunctionDeploymentInput, FunctionDeploymentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeployment, + FunctionDeploymentWithRelations, + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, + CreateFunctionDeploymentInput, + UpdateFunctionDeploymentInput, + FunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployments: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeployment", "functionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployments", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployments', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployment: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeployment", "functionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployment", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeployment": data.functionDeployments?.nodes?.[0] ?? null - }) + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployment: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeployment", "functionDeployments", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployment", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeployment": data.functionDeployments?.nodes?.[0] ?? null - }) + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeployment", "createFunctionDeployment", "functionDeployment", args.select, args.data, "CreateFunctionDeploymentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeployment', + 'createFunctionDeployment', + 'functionDeployment', + args.select, + args.data, + 'CreateFunctionDeploymentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "createFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'createFunctionDeployment', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeployment", "updateFunctionDeployment", "functionDeployment", args.select, args.where.id, args.data, "UpdateFunctionDeploymentInput", "id", "functionDeploymentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeployment', + 'updateFunctionDeployment', + 'functionDeployment', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentInput', + 'id', + 'functionDeploymentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "updateFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'updateFunctionDeployment', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeployment", "deleteFunctionDeployment", "functionDeployment", { - id: args.where.id - }, "DeleteFunctionDeploymentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeployment', + 'deleteFunctionDeployment', + 'functionDeployment', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "deleteFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'deleteFunctionDeployment', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionDeploymentEvent.ts b/sdk/constructive-cli/src/compute/orm/models/functionDeploymentEvent.ts index 1f61187c84..6b95be6471 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionDeploymentEvent.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionDeploymentEvent.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeploymentEvent, FunctionDeploymentEventWithRelations, FunctionDeploymentEventSelect, FunctionDeploymentEventFilter, FunctionDeploymentEventOrderBy, CreateFunctionDeploymentEventInput, UpdateFunctionDeploymentEventInput, FunctionDeploymentEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentEvent, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, + CreateFunctionDeploymentEventInput, + UpdateFunctionDeploymentEventInput, + FunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionDeploymentEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvents", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvent", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentEvent": data.functionDeploymentEvents?.nodes?.[0] ?? null - }) + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvent", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentEvent": data.functionDeploymentEvents?.nodes?.[0] ?? null - }) + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeploymentEvent", "createFunctionDeploymentEvent", "functionDeploymentEvent", args.select, args.data, "CreateFunctionDeploymentEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentEvent', + 'createFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.data, + 'CreateFunctionDeploymentEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "createFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'createFunctionDeploymentEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeploymentEvent", "updateFunctionDeploymentEvent", "functionDeploymentEvent", args.select, args.where.id, args.data, "UpdateFunctionDeploymentEventInput", "id", "functionDeploymentEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentEvent', + 'updateFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentEventInput', + 'id', + 'functionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "updateFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'updateFunctionDeploymentEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeploymentEvent", "deleteFunctionDeploymentEvent", "functionDeploymentEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionDeploymentEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentEvent', + 'deleteFunctionDeploymentEvent', + 'functionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "deleteFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'deleteFunctionDeploymentEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionExecutionLog.ts b/sdk/constructive-cli/src/compute/orm/models/functionExecutionLog.ts index f1249a036a..a581eeab83 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionExecutionLog.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionExecutionLog.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionExecutionLog, FunctionExecutionLogWithRelations, FunctionExecutionLogSelect, FunctionExecutionLogFilter, FunctionExecutionLogOrderBy, CreateFunctionExecutionLogInput, UpdateFunctionExecutionLogInput, FunctionExecutionLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionExecutionLog, + FunctionExecutionLogWithRelations, + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, + CreateFunctionExecutionLogInput, + UpdateFunctionExecutionLogInput, + FunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionExecutionLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionExecutionLogs: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLogs", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionExecutionLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLog", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionExecutionLog": data.functionExecutionLogs?.nodes?.[0] ?? null - }) + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionExecutionLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLog", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionExecutionLog": data.functionExecutionLogs?.nodes?.[0] ?? null - }) + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionExecutionLog", "createFunctionExecutionLog", "functionExecutionLog", args.select, args.data, "CreateFunctionExecutionLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionExecutionLog', + 'createFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.data, + 'CreateFunctionExecutionLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "createFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'createFunctionExecutionLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionExecutionLog", "updateFunctionExecutionLog", "functionExecutionLog", args.select, args.where.id, args.data, "UpdateFunctionExecutionLogInput", "id", "functionExecutionLogPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionExecutionLog', + 'updateFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateFunctionExecutionLogInput', + 'id', + 'functionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "updateFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'updateFunctionExecutionLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionExecutionLog", "deleteFunctionExecutionLog", "functionExecutionLog", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionExecutionLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionExecutionLog', + 'deleteFunctionExecutionLog', + 'functionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "deleteFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'deleteFunctionExecutionLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraph.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraph.ts index b06366eed7..8355e31658 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionGraph.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraph.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraph, FunctionGraphWithRelations, FunctionGraphSelect, FunctionGraphFilter, FunctionGraphOrderBy, CreateFunctionGraphInput, UpdateFunctionGraphInput, FunctionGraphPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraph, + FunctionGraphWithRelations, + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy, + CreateFunctionGraphInput, + UpdateFunctionGraphInput, + FunctionGraphPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraph", "functionGraphs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraphs", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraphs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraph: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraph", "functionGraphs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraph", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraph": data.functionGraphs?.nodes?.[0] ?? null - }) + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraph: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraph", "functionGraphs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraph", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionGraphModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraph": data.functionGraphs?.nodes?.[0] ?? null - }) + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraph", "createFunctionGraph", "functionGraph", args.select, args.data, "CreateFunctionGraphInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraph', + 'createFunctionGraph', + 'functionGraph', + args.select, + args.data, + 'CreateFunctionGraphInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "createFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'createFunctionGraph', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraph", "updateFunctionGraph", "functionGraph", args.select, args.where.id, args.data, "UpdateFunctionGraphInput", "id", "functionGraphPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraph', + 'updateFunctionGraph', + 'functionGraph', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphInput', + 'id', + 'functionGraphPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "updateFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'updateFunctionGraph', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraph", "deleteFunctionGraph", "functionGraph", { - id: args.where.id - }, "DeleteFunctionGraphInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraph', + 'deleteFunctionGraph', + 'functionGraph', + { + id: args.where.id, + }, + 'DeleteFunctionGraphInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "deleteFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'deleteFunctionGraph', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphCommit.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphCommit.ts index fc4f86a006..cd7d7dad08 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionGraphCommit.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphCommit.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphCommit, FunctionGraphCommitWithRelations, FunctionGraphCommitSelect, FunctionGraphCommitFilter, FunctionGraphCommitOrderBy, CreateFunctionGraphCommitInput, UpdateFunctionGraphCommitInput, FunctionGraphCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphCommit, + FunctionGraphCommitWithRelations, + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, + CreateFunctionGraphCommitInput, + UpdateFunctionGraphCommitInput, + FunctionGraphCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommits", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommit", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphCommit": data.functionGraphCommits?.nodes?.[0] ?? null - }) + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommit", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionGraphCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphCommit": data.functionGraphCommits?.nodes?.[0] ?? null - }) + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphCommit", "createFunctionGraphCommit", "functionGraphCommit", args.select, args.data, "CreateFunctionGraphCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphCommit', + 'createFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.data, + 'CreateFunctionGraphCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "createFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'createFunctionGraphCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphCommit", "updateFunctionGraphCommit", "functionGraphCommit", args.select, args.where.id, args.data, "UpdateFunctionGraphCommitInput", "id", "functionGraphCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphCommit', + 'updateFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphCommitInput', + 'id', + 'functionGraphCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "updateFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'updateFunctionGraphCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphCommit", "deleteFunctionGraphCommit", "functionGraphCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphCommit', + 'deleteFunctionGraphCommit', + 'functionGraphCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "deleteFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'deleteFunctionGraphCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecution.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecution.ts index 19bf0d3f80..36ba0d39b8 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecution.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecution.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecution, FunctionGraphExecutionWithRelations, FunctionGraphExecutionSelect, FunctionGraphExecutionFilter, FunctionGraphExecutionOrderBy, CreateFunctionGraphExecutionInput, UpdateFunctionGraphExecutionInput, FunctionGraphExecutionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecution, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, + CreateFunctionGraphExecutionInput, + UpdateFunctionGraphExecutionInput, + FunctionGraphExecutionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecutions", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecutions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphExecution: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecution", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionGraphExecutionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecution": data.functionGraphExecutions?.nodes?.[0] ?? null - }) + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphExecution: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecution", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionGraphExecutionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecution": data.functionGraphExecutions?.nodes?.[0] ?? null - }) + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecution", "createFunctionGraphExecution", "functionGraphExecution", args.select, args.data, "CreateFunctionGraphExecutionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecution', + 'createFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.data, + 'CreateFunctionGraphExecutionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "createFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'createFunctionGraphExecution', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + startedAt: string; + }, + FunctionGraphExecutionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecution", "updateFunctionGraphExecution", "functionGraphExecution", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionInput", "id", "functionGraphExecutionPatch", connectionFieldsMap, { - startedAt: args.where.startedAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecution', + 'updateFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionInput', + 'id', + 'functionGraphExecutionPatch', + connectionFieldsMap, + { + startedAt: args.where.startedAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "updateFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'updateFunctionGraphExecution', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - startedAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + startedAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecution", "deleteFunctionGraphExecution", "functionGraphExecution", { - id: args.where.id, - startedAt: args.where.startedAt - }, "DeleteFunctionGraphExecutionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecution', + 'deleteFunctionGraphExecution', + 'functionGraphExecution', + { + id: args.where.id, + startedAt: args.where.startedAt, + }, + 'DeleteFunctionGraphExecutionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "deleteFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'deleteFunctionGraphExecution', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionNodeState.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionNodeState.ts index 8640ca634a..734317c006 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionNodeState.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionNodeState.ts @@ -3,56 +3,109 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecutionNodeState, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy, CreateFunctionGraphExecutionNodeStateInput, UpdateFunctionGraphExecutionNodeStateInput, FunctionGraphExecutionNodeStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionNodeState, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, + CreateFunctionGraphExecutionNodeStateInput, + UpdateFunctionGraphExecutionNodeStateInput, + FunctionGraphExecutionNodeStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionNodeStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeStates: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeStates", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeState: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeState", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class FunctionGraphExecutionNodeStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionNodeState": data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null - }) + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeState: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeState", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', document, variables, transform: (data: { @@ -93,79 +156,123 @@ export class FunctionGraphExecutionNodeStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionNodeState": data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null - }) + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecutionNodeState", "createFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", args.select, args.data, "CreateFunctionGraphExecutionNodeStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionNodeState', + 'createFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.data, + 'CreateFunctionGraphExecutionNodeStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "createFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'createFunctionGraphExecutionNodeState', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionNodeStatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecutionNodeState", "updateFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionNodeStateInput", "id", "functionGraphExecutionNodeStatePatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionNodeState', + 'updateFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionNodeStateInput', + 'id', + 'functionGraphExecutionNodeStatePatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "updateFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'updateFunctionGraphExecutionNodeState', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecutionNodeState", "deleteFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionGraphExecutionNodeStateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionNodeState', + 'deleteFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionNodeStateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "deleteFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'deleteFunctionGraphExecutionNodeState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionOutput.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionOutput.ts index f2353e75de..c9a5085e5e 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionOutput.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionOutput.ts @@ -3,56 +3,109 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecutionOutput, FunctionGraphExecutionOutputWithRelations, FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputFilter, FunctionGraphExecutionOutputOrderBy, CreateFunctionGraphExecutionOutputInput, UpdateFunctionGraphExecutionOutputInput, FunctionGraphExecutionOutputPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionOutput, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, + CreateFunctionGraphExecutionOutputInput, + UpdateFunctionGraphExecutionOutputInput, + FunctionGraphExecutionOutputPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionOutputModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutputs: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutputs", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutputs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutput: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutput", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class FunctionGraphExecutionOutputModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionOutput": data.functionGraphExecutionOutputs?.nodes?.[0] ?? null - }) + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutput: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutput", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class FunctionGraphExecutionOutputModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionOutput": data.functionGraphExecutionOutputs?.nodes?.[0] ?? null - }) + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecutionOutput", "createFunctionGraphExecutionOutput", "functionGraphExecutionOutput", args.select, args.data, "CreateFunctionGraphExecutionOutputInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionOutput', + 'createFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.data, + 'CreateFunctionGraphExecutionOutputInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "createFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'createFunctionGraphExecutionOutput', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionOutputPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecutionOutput", "updateFunctionGraphExecutionOutput", "functionGraphExecutionOutput", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionOutputInput", "id", "functionGraphExecutionOutputPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionOutput', + 'updateFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionOutputInput', + 'id', + 'functionGraphExecutionOutputPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "updateFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'updateFunctionGraphExecutionOutput', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecutionOutput", "deleteFunctionGraphExecutionOutput", "functionGraphExecutionOutput", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionGraphExecutionOutputInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionOutput', + 'deleteFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionOutputInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "deleteFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'deleteFunctionGraphExecutionOutput', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphObject.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphObject.ts index fecd1e433b..d1f358a726 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionGraphObject.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphObject.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphObject, FunctionGraphObjectWithRelations, FunctionGraphObjectSelect, FunctionGraphObjectFilter, FunctionGraphObjectOrderBy, CreateFunctionGraphObjectInput, UpdateFunctionGraphObjectInput, FunctionGraphObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphObject, + FunctionGraphObjectWithRelations, + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, + CreateFunctionGraphObjectInput, + UpdateFunctionGraphObjectInput, + FunctionGraphObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphObject", "functionGraphObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphObjectFilter", "FunctionGraphObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObjects", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphObject", "functionGraphObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphObjectFilter", "FunctionGraphObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObject", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class FunctionGraphObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphObject": data.functionGraphObjects?.nodes?.[0] ?? null - }) + functionGraphObject: data.functionGraphObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("FunctionGraphObject", "getNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'FunctionGraphObject', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObject", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphObject", "createFunctionGraphObject", "functionGraphObject", args.select, args.data, "CreateFunctionGraphObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphObject', + 'createFunctionGraphObject', + 'functionGraphObject', + args.select, + args.data, + 'CreateFunctionGraphObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "createFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'createFunctionGraphObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphObject", "updateFunctionGraphObject", "functionGraphObject", args.select, args.where.id, args.data, "UpdateFunctionGraphObjectInput", "id", "functionGraphObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphObject', + 'updateFunctionGraphObject', + 'functionGraphObject', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphObjectInput', + 'id', + 'functionGraphObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "updateFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'updateFunctionGraphObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphObject", "deleteFunctionGraphObject", "functionGraphObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphObject', + 'deleteFunctionGraphObject', + 'functionGraphObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "deleteFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'deleteFunctionGraphObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphRef.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphRef.ts index 31993a8a93..c4ee3889eb 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionGraphRef.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphRef.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphRef, FunctionGraphRefWithRelations, FunctionGraphRefSelect, FunctionGraphRefFilter, FunctionGraphRefOrderBy, CreateFunctionGraphRefInput, UpdateFunctionGraphRefInput, FunctionGraphRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphRef, + FunctionGraphRefWithRelations, + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, + CreateFunctionGraphRefInput, + UpdateFunctionGraphRefInput, + FunctionGraphRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRefs", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRef", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphRef": data.functionGraphRefs?.nodes?.[0] ?? null - }) + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRef", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionGraphRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphRef": data.functionGraphRefs?.nodes?.[0] ?? null - }) + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphRef", "createFunctionGraphRef", "functionGraphRef", args.select, args.data, "CreateFunctionGraphRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphRef', + 'createFunctionGraphRef', + 'functionGraphRef', + args.select, + args.data, + 'CreateFunctionGraphRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "createFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'createFunctionGraphRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphRef", "updateFunctionGraphRef", "functionGraphRef", args.select, args.where.id, args.data, "UpdateFunctionGraphRefInput", "id", "functionGraphRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphRef', + 'updateFunctionGraphRef', + 'functionGraphRef', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphRefInput', + 'id', + 'functionGraphRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "updateFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'updateFunctionGraphRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphRef", "deleteFunctionGraphRef", "functionGraphRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphRef', + 'deleteFunctionGraphRef', + 'functionGraphRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "deleteFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'deleteFunctionGraphRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphStore.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphStore.ts index c4d13ac9ee..6d1f384449 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionGraphStore.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphStore.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphStore, FunctionGraphStoreWithRelations, FunctionGraphStoreSelect, FunctionGraphStoreFilter, FunctionGraphStoreOrderBy, CreateFunctionGraphStoreInput, UpdateFunctionGraphStoreInput, FunctionGraphStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphStore, + FunctionGraphStoreWithRelations, + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, + CreateFunctionGraphStoreInput, + UpdateFunctionGraphStoreInput, + FunctionGraphStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStores", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStore", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphStore": data.functionGraphStores?.nodes?.[0] ?? null - }) + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStore", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionGraphStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphStore": data.functionGraphStores?.nodes?.[0] ?? null - }) + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphStore", "createFunctionGraphStore", "functionGraphStore", args.select, args.data, "CreateFunctionGraphStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphStore', + 'createFunctionGraphStore', + 'functionGraphStore', + args.select, + args.data, + 'CreateFunctionGraphStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "createFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'createFunctionGraphStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphStore", "updateFunctionGraphStore", "functionGraphStore", args.select, args.where.id, args.data, "UpdateFunctionGraphStoreInput", "id", "functionGraphStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphStore', + 'updateFunctionGraphStore', + 'functionGraphStore', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphStoreInput', + 'id', + 'functionGraphStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "updateFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'updateFunctionGraphStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphStore", "deleteFunctionGraphStore", "functionGraphStore", { - id: args.where.id - }, "DeleteFunctionGraphStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphStore', + 'deleteFunctionGraphStore', + 'functionGraphStore', + { + id: args.where.id, + }, + 'DeleteFunctionGraphStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "deleteFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'deleteFunctionGraphStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionInvocation.ts b/sdk/constructive-cli/src/compute/orm/models/functionInvocation.ts index e9bd71267a..3589bf5a1d 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionInvocation.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionInvocation.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionInvocation, FunctionInvocationWithRelations, FunctionInvocationSelect, FunctionInvocationFilter, FunctionInvocationOrderBy, CreateFunctionInvocationInput, UpdateFunctionInvocationInput, FunctionInvocationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionInvocation, + FunctionInvocationWithRelations, + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy, + CreateFunctionInvocationInput, + UpdateFunctionInvocationInput, + FunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocation", "functionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocations", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocation", "functionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocation", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocation": data.functionInvocations?.nodes?.[0] ?? null - }) + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocation", "functionInvocations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocation", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocation": data.functionInvocations?.nodes?.[0] ?? null - }) + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocation", "createFunctionInvocation", "functionInvocation", args.select, args.data, "CreateFunctionInvocationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocation', + 'createFunctionInvocation', + 'functionInvocation', + args.select, + args.data, + 'CreateFunctionInvocationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "createFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'createFunctionInvocation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocation", "updateFunctionInvocation", "functionInvocation", args.select, args.where.id, args.data, "UpdateFunctionInvocationInput", "id", "functionInvocationPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocation', + 'updateFunctionInvocation', + 'functionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationInput', + 'id', + 'functionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "updateFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'updateFunctionInvocation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocation", "deleteFunctionInvocation", "functionInvocation", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionInvocationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocation', + 'deleteFunctionInvocation', + 'functionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "deleteFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'deleteFunctionInvocation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionInvocationAttempt.ts b/sdk/constructive-cli/src/compute/orm/models/functionInvocationAttempt.ts index 3f660a869e..710ddec0b8 100644 --- a/sdk/constructive-cli/src/compute/orm/models/functionInvocationAttempt.ts +++ b/sdk/constructive-cli/src/compute/orm/models/functionInvocationAttempt.ts @@ -3,56 +3,98 @@ * @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 { FunctionInvocationAttempt, FunctionInvocationAttemptWithRelations, FunctionInvocationAttemptSelect, FunctionInvocationAttemptFilter, FunctionInvocationAttemptOrderBy, CreateFunctionInvocationAttemptInput, UpdateFunctionInvocationAttemptInput, FunctionInvocationAttemptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionInvocationAttempt, + FunctionInvocationAttemptWithRelations, + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy, + CreateFunctionInvocationAttemptInput, + UpdateFunctionInvocationAttemptInput, + FunctionInvocationAttemptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationAttemptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionInvocationAttempts: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocationAttempts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationAttempt", "functionInvocationAttempts", 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 - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + 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, + }, + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempts", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationAttempt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocationAttempt", "functionInvocationAttempts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempt", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempt', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationAttempt": data.functionInvocationAttempts?.nodes?.[0] ?? null - }) + functionInvocationAttempt: data.functionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationAttempt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationAttempt", "functionInvocationAttempts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempt", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempt', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationAttempt": data.functionInvocationAttempts?.nodes?.[0] ?? null - }) + functionInvocationAttempt: data.functionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocationAttempt", "createFunctionInvocationAttempt", "functionInvocationAttempt", args.select, args.data, "CreateFunctionInvocationAttemptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocationAttempt', + 'createFunctionInvocationAttempt', + 'functionInvocationAttempt', + args.select, + args.data, + 'CreateFunctionInvocationAttemptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "createFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'createFunctionInvocationAttempt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationAttemptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocationAttempt", "updateFunctionInvocationAttempt", "functionInvocationAttempt", args.select, args.where.id, args.data, "UpdateFunctionInvocationAttemptInput", "id", "functionInvocationAttemptPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocationAttempt', + 'updateFunctionInvocationAttempt', + 'functionInvocationAttempt', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationAttemptInput', + 'id', + 'functionInvocationAttemptPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "updateFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'updateFunctionInvocationAttempt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocationAttempt", "deleteFunctionInvocationAttempt", "functionInvocationAttempt", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionInvocationAttemptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocationAttempt', + 'deleteFunctionInvocationAttempt', + 'functionInvocationAttempt', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationAttemptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "deleteFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'deleteFunctionInvocationAttempt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/getAllTreeNodesRecord.ts b/sdk/constructive-cli/src/compute/orm/models/getAllTreeNodesRecord.ts index bb9b696c09..00f51d01f7 100644 --- a/sdk/constructive-cli/src/compute/orm/models/getAllTreeNodesRecord.ts +++ b/sdk/constructive-cli/src/compute/orm/models/getAllTreeNodesRecord.ts @@ -3,56 +3,96 @@ * @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 { GetAllTreeNodesRecord, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy, CreateGetAllTreeNodesRecordInput, UpdateGetAllTreeNodesRecordInput, GetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GetAllTreeNodesRecord, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, + CreateGetAllTreeNodesRecordInput, + UpdateGetAllTreeNodesRecordInput, + GetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GetAllTreeNodesRecord", "getAllTreeNodes", 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 - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + 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, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodes", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodesRecord: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GetAllTreeNodesRecord", "getAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodesRecord", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class GetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "getAllTreeNodesRecord": data.getAllTreeNodes?.nodes?.[0] ?? null - }) + getAllTreeNodesRecord: data.getAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGetAllTreeNodesRecord: { getAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GetAllTreeNodesRecord", "createGetAllTreeNodesRecord", "getAllTreeNodesRecord", args.select, args.data, "CreateGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GetAllTreeNodesRecord', + 'createGetAllTreeNodesRecord', + 'getAllTreeNodesRecord', + args.select, + args.data, + 'CreateGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GetAllTreeNodesRecord", - fieldName: "createGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'createGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/index.ts b/sdk/constructive-cli/src/compute/orm/models/index.ts index 90c96202f6..c06f5f3db6 100644 --- a/sdk/constructive-cli/src/compute/orm/models/index.ts +++ b/sdk/constructive-cli/src/compute/orm/models/index.ts @@ -3,70 +3,70 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { DbPresetModel } from "./dbPreset"; -export { FunctionApiBindingModel } from "./functionApiBinding"; -export { FunctionDefinitionModel } from "./functionDefinition"; -export { FunctionDeploymentModel } from "./functionDeployment"; -export { FunctionDeploymentEventModel } from "./functionDeploymentEvent"; -export { FunctionExecutionLogModel } from "./functionExecutionLog"; -export { FunctionGraphCommitModel } from "./functionGraphCommit"; -export { FunctionGraphModel } from "./functionGraph"; -export { FunctionGraphExecutionModel } from "./functionGraphExecution"; -export { FunctionGraphExecutionNodeStateModel } from "./functionGraphExecutionNodeState"; -export { FunctionGraphExecutionOutputModel } from "./functionGraphExecutionOutput"; -export { FunctionGraphObjectModel } from "./functionGraphObject"; -export { FunctionGraphRefModel } from "./functionGraphRef"; -export { FunctionGraphStoreModel } from "./functionGraphStore"; -export { FunctionInvocationAttemptModel } from "./functionInvocationAttempt"; -export { FunctionInvocationModel } from "./functionInvocation"; -export { GetAllTreeNodesRecordModel } from "./getAllTreeNodesRecord"; -export { InfraCommitModel } from "./infraCommit"; -export { InfraGetAllTreeNodesRecordModel } from "./infraGetAllTreeNodesRecord"; -export { InfraObjectModel } from "./infraObject"; -export { InfraRefModel } from "./infraRef"; -export { InfraStoreModel } from "./infraStore"; -export { IntegrationProviderModel } from "./integrationProvider"; -export { NamespaceModel } from "./namespace"; -export { NamespaceEventModel } from "./namespaceEvent"; -export { PlatformFunctionApiBindingModel } from "./platformFunctionApiBinding"; -export { PlatformFunctionDefinitionModel } from "./platformFunctionDefinition"; -export { PlatformFunctionDeploymentModel } from "./platformFunctionDeployment"; -export { PlatformFunctionDeploymentEventModel } from "./platformFunctionDeploymentEvent"; -export { PlatformFunctionExecutionLogModel } from "./platformFunctionExecutionLog"; -export { PlatformFunctionInvocationAttemptModel } from "./platformFunctionInvocationAttempt"; -export { PlatformFunctionInvocationModel } from "./platformFunctionInvocation"; -export { PlatformInfraCommitModel } from "./platformInfraCommit"; -export { PlatformInfraGetAllTreeNodesRecordModel } from "./platformInfraGetAllTreeNodesRecord"; -export { PlatformInfraObjectModel } from "./platformInfraObject"; -export { PlatformInfraRefModel } from "./platformInfraRef"; -export { PlatformInfraStoreModel } from "./platformInfraStore"; -export { PlatformNamespaceModel } from "./platformNamespace"; -export { PlatformNamespaceEventModel } from "./platformNamespaceEvent"; -export { PlatformResourceModel } from "./platformResource"; -export { PlatformResourceDeclaredCapacityModel } from "./platformResourceDeclaredCapacity"; -export { PlatformResourceDefinitionModel } from "./platformResourceDefinition"; -export { PlatformResourceEventModel } from "./platformResourceEvent"; -export { PlatformResourceInstallationModel } from "./platformResourceInstallation"; -export { PlatformResourceStatusCheckModel } from "./platformResourceStatusCheck"; -export { PlatformResourceUsageLogModel } from "./platformResourceUsageLog"; -export { PlatformResourceUsageSummaryModel } from "./platformResourceUsageSummary"; -export { PlatformResourceUtilizationModel } from "./platformResourceUtilization"; -export { PlatformResourcesHealthModel } from "./platformResourcesHealth"; -export { PlatformResourcesRequirementsStateModel } from "./platformResourcesRequirementsState"; -export { PlatformResourcesResolvedRequirementModel } from "./platformResourcesResolvedRequirement"; -export { PlatformWebhookEndpointModel } from "./platformWebhookEndpoint"; -export { PlatformWebhookEventModel } from "./platformWebhookEvent"; -export { ResourceModel } from "./resource"; -export { ResourceDeclaredCapacityModel } from "./resourceDeclaredCapacity"; -export { ResourceDefinitionModel } from "./resourceDefinition"; -export { ResourceEventModel } from "./resourceEvent"; -export { ResourceInstallationModel } from "./resourceInstallation"; -export { ResourceStatusCheckModel } from "./resourceStatusCheck"; -export { ResourceUsageLogModel } from "./resourceUsageLog"; -export { ResourceUsageSummaryModel } from "./resourceUsageSummary"; -export { ResourceUtilizationModel } from "./resourceUtilization"; -export { ResourcesHealthModel } from "./resourcesHealth"; -export { ResourcesRequirementsStateModel } from "./resourcesRequirementsState"; -export { ResourcesResolvedRequirementModel } from "./resourcesResolvedRequirement"; -export { WebhookEndpointModel } from "./webhookEndpoint"; -export { WebhookEventModel } from "./webhookEvent"; \ No newline at end of file +export { DbPresetModel } from './dbPreset'; +export { FunctionApiBindingModel } from './functionApiBinding'; +export { FunctionDefinitionModel } from './functionDefinition'; +export { FunctionDeploymentModel } from './functionDeployment'; +export { FunctionDeploymentEventModel } from './functionDeploymentEvent'; +export { FunctionExecutionLogModel } from './functionExecutionLog'; +export { FunctionGraphCommitModel } from './functionGraphCommit'; +export { FunctionGraphModel } from './functionGraph'; +export { FunctionGraphExecutionModel } from './functionGraphExecution'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; +export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutput'; +export { FunctionGraphObjectModel } from './functionGraphObject'; +export { FunctionGraphRefModel } from './functionGraphRef'; +export { FunctionGraphStoreModel } from './functionGraphStore'; +export { FunctionInvocationAttemptModel } from './functionInvocationAttempt'; +export { FunctionInvocationModel } from './functionInvocation'; +export { GetAllTreeNodesRecordModel } from './getAllTreeNodesRecord'; +export { InfraCommitModel } from './infraCommit'; +export { InfraGetAllTreeNodesRecordModel } from './infraGetAllTreeNodesRecord'; +export { InfraObjectModel } from './infraObject'; +export { InfraRefModel } from './infraRef'; +export { InfraStoreModel } from './infraStore'; +export { IntegrationProviderModel } from './integrationProvider'; +export { NamespaceModel } from './namespace'; +export { NamespaceEventModel } from './namespaceEvent'; +export { PlatformFunctionApiBindingModel } from './platformFunctionApiBinding'; +export { PlatformFunctionDefinitionModel } from './platformFunctionDefinition'; +export { PlatformFunctionDeploymentModel } from './platformFunctionDeployment'; +export { PlatformFunctionDeploymentEventModel } from './platformFunctionDeploymentEvent'; +export { PlatformFunctionExecutionLogModel } from './platformFunctionExecutionLog'; +export { PlatformFunctionInvocationAttemptModel } from './platformFunctionInvocationAttempt'; +export { PlatformFunctionInvocationModel } from './platformFunctionInvocation'; +export { PlatformInfraCommitModel } from './platformInfraCommit'; +export { PlatformInfraGetAllTreeNodesRecordModel } from './platformInfraGetAllTreeNodesRecord'; +export { PlatformInfraObjectModel } from './platformInfraObject'; +export { PlatformInfraRefModel } from './platformInfraRef'; +export { PlatformInfraStoreModel } from './platformInfraStore'; +export { PlatformNamespaceModel } from './platformNamespace'; +export { PlatformNamespaceEventModel } from './platformNamespaceEvent'; +export { PlatformResourceModel } from './platformResource'; +export { PlatformResourceDeclaredCapacityModel } from './platformResourceDeclaredCapacity'; +export { PlatformResourceDefinitionModel } from './platformResourceDefinition'; +export { PlatformResourceEventModel } from './platformResourceEvent'; +export { PlatformResourceInstallationModel } from './platformResourceInstallation'; +export { PlatformResourceStatusCheckModel } from './platformResourceStatusCheck'; +export { PlatformResourceUsageLogModel } from './platformResourceUsageLog'; +export { PlatformResourceUsageSummaryModel } from './platformResourceUsageSummary'; +export { PlatformResourceUtilizationModel } from './platformResourceUtilization'; +export { PlatformResourcesHealthModel } from './platformResourcesHealth'; +export { PlatformResourcesRequirementsStateModel } from './platformResourcesRequirementsState'; +export { PlatformResourcesResolvedRequirementModel } from './platformResourcesResolvedRequirement'; +export { PlatformWebhookEndpointModel } from './platformWebhookEndpoint'; +export { PlatformWebhookEventModel } from './platformWebhookEvent'; +export { ResourceModel } from './resource'; +export { ResourceDeclaredCapacityModel } from './resourceDeclaredCapacity'; +export { ResourceDefinitionModel } from './resourceDefinition'; +export { ResourceEventModel } from './resourceEvent'; +export { ResourceInstallationModel } from './resourceInstallation'; +export { ResourceStatusCheckModel } from './resourceStatusCheck'; +export { ResourceUsageLogModel } from './resourceUsageLog'; +export { ResourceUsageSummaryModel } from './resourceUsageSummary'; +export { ResourceUtilizationModel } from './resourceUtilization'; +export { ResourcesHealthModel } from './resourcesHealth'; +export { ResourcesRequirementsStateModel } from './resourcesRequirementsState'; +export { ResourcesResolvedRequirementModel } from './resourcesResolvedRequirement'; +export { WebhookEndpointModel } from './webhookEndpoint'; +export { WebhookEventModel } from './webhookEvent'; diff --git a/sdk/constructive-cli/src/compute/orm/models/infraCommit.ts b/sdk/constructive-cli/src/compute/orm/models/infraCommit.ts index 657f82c32c..379750f7f9 100644 --- a/sdk/constructive-cli/src/compute/orm/models/infraCommit.ts +++ b/sdk/constructive-cli/src/compute/orm/models/infraCommit.ts @@ -3,56 +3,96 @@ * @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 { InfraCommit, InfraCommitWithRelations, InfraCommitSelect, InfraCommitFilter, InfraCommitOrderBy, CreateInfraCommitInput, UpdateInfraCommitInput, InfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraCommit, + InfraCommitWithRelations, + InfraCommitSelect, + InfraCommitFilter, + InfraCommitOrderBy, + CreateInfraCommitInput, + UpdateInfraCommitInput, + InfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraCommit", "infraCommits", 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 - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraCommit', + 'infraCommits', + 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, + }, + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommits", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraCommit", "infraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraCommit', + 'infraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommit", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraCommit": data.infraCommits?.nodes?.[0] ?? null - }) + infraCommit: data.infraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraCommit", "infraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraCommit', + 'infraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommit", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class InfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraCommit": data.infraCommits?.nodes?.[0] ?? null - }) + infraCommit: data.infraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraCommit", "createInfraCommit", "infraCommit", args.select, args.data, "CreateInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraCommit', + 'createInfraCommit', + 'infraCommit', + args.select, + args.data, + 'CreateInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "createInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'createInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraCommit", "updateInfraCommit", "infraCommit", args.select, args.where.id, args.data, "UpdateInfraCommitInput", "id", "infraCommitPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraCommit', + 'updateInfraCommit', + 'infraCommit', + args.select, + args.where.id, + args.data, + 'UpdateInfraCommitInput', + 'id', + 'infraCommitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "updateInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'updateInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraCommit", "deleteInfraCommit", "infraCommit", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraCommit', + 'deleteInfraCommit', + 'infraCommit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "deleteInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'deleteInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/infraGetAllTreeNodesRecord.ts b/sdk/constructive-cli/src/compute/orm/models/infraGetAllTreeNodesRecord.ts index 8df5146d17..7f2e31d467 100644 --- a/sdk/constructive-cli/src/compute/orm/models/infraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-cli/src/compute/orm/models/infraGetAllTreeNodesRecord.ts @@ -3,56 +3,101 @@ * @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 { InfraGetAllTreeNodesRecord, InfraGetAllTreeNodesRecordWithRelations, InfraGetAllTreeNodesRecordSelect, InfraGetAllTreeNodesRecordFilter, InfraGetAllTreeNodesRecordsOrderBy, CreateInfraGetAllTreeNodesRecordInput, UpdateInfraGetAllTreeNodesRecordInput, InfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraGetAllTreeNodesRecord, + InfraGetAllTreeNodesRecordWithRelations, + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy, + CreateInfraGetAllTreeNodesRecordInput, + UpdateInfraGetAllTreeNodesRecordInput, + InfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - infraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + infraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("InfraGetAllTreeNodesRecord", "infraGetAllTreeNodes", 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 - }, "InfraGetAllTreeNodesRecordFilter", "InfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodes', + 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, + }, + 'InfraGetAllTreeNodesRecordFilter', + 'InfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "infraGetAllTreeNodes", + operation: 'query', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'infraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - infraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + infraGetAllTreeNodesRecord: InferSelectResult< + InfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraGetAllTreeNodesRecord", "infraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraGetAllTreeNodesRecordFilter", "InfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraGetAllTreeNodesRecordFilter', + 'InfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "infraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'infraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +105,35 @@ export class InfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraGetAllTreeNodesRecord": data.infraGetAllTreeNodes?.nodes?.[0] ?? null - }) + infraGetAllTreeNodesRecord: data.infraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraGetAllTreeNodesRecord: { infraGetAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraGetAllTreeNodesRecord", "createInfraGetAllTreeNodesRecord", "infraGetAllTreeNodesRecord", args.select, args.data, "CreateInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraGetAllTreeNodesRecord', + 'createInfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreateInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "createInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'createInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/infraObject.ts b/sdk/constructive-cli/src/compute/orm/models/infraObject.ts index c6a0b8eb4e..ef01fc62a4 100644 --- a/sdk/constructive-cli/src/compute/orm/models/infraObject.ts +++ b/sdk/constructive-cli/src/compute/orm/models/infraObject.ts @@ -3,56 +3,96 @@ * @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 { InfraObject, InfraObjectWithRelations, InfraObjectSelect, InfraObjectFilter, InfraObjectOrderBy, CreateInfraObjectInput, UpdateInfraObjectInput, InfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraObject, + InfraObjectWithRelations, + InfraObjectSelect, + InfraObjectFilter, + InfraObjectOrderBy, + CreateInfraObjectInput, + UpdateInfraObjectInput, + InfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraObject", "infraObjects", 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 - }, "InfraObjectFilter", "InfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraObject', + 'infraObjects', + 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, + }, + 'InfraObjectFilter', + 'InfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObjects", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraObject", "infraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraObjectFilter", "InfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraObject', + 'infraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraObjectFilter', + 'InfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObject", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class InfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraObject": data.infraObjects?.nodes?.[0] ?? null - }) + infraObject: data.infraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("InfraObject", "infraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'InfraObject', + 'infraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObject", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraObject", "createInfraObject", "infraObject", args.select, args.data, "CreateInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraObject', + 'createInfraObject', + 'infraObject', + args.select, + args.data, + 'CreateInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "createInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'createInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraObject", "updateInfraObject", "infraObject", args.select, args.where.id, args.data, "UpdateInfraObjectInput", "id", "infraObjectPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraObject', + 'updateInfraObject', + 'infraObject', + args.select, + args.where.id, + args.data, + 'UpdateInfraObjectInput', + 'id', + 'infraObjectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "updateInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'updateInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraObject", "deleteInfraObject", "infraObject", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraObject', + 'deleteInfraObject', + 'infraObject', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "deleteInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'deleteInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/infraRef.ts b/sdk/constructive-cli/src/compute/orm/models/infraRef.ts index 57fdd343e9..bcc1a9d568 100644 --- a/sdk/constructive-cli/src/compute/orm/models/infraRef.ts +++ b/sdk/constructive-cli/src/compute/orm/models/infraRef.ts @@ -3,56 +3,96 @@ * @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 { InfraRef, InfraRefWithRelations, InfraRefSelect, InfraRefFilter, InfraRefOrderBy, CreateInfraRefInput, UpdateInfraRefInput, InfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraRef, + InfraRefWithRelations, + InfraRefSelect, + InfraRefFilter, + InfraRefOrderBy, + CreateInfraRefInput, + UpdateInfraRefInput, + InfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraRef", "infraRefs", 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 - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraRef', + 'infraRefs', + 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, + }, + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRefs", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraRef", "infraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraRef', + 'infraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRef", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraRef": data.infraRefs?.nodes?.[0] ?? null - }) + infraRef: data.infraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraRef", "infraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraRef', + 'infraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRef", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class InfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraRef": data.infraRefs?.nodes?.[0] ?? null - }) + infraRef: data.infraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraRef", "createInfraRef", "infraRef", args.select, args.data, "CreateInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraRef', + 'createInfraRef', + 'infraRef', + args.select, + args.data, + 'CreateInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "createInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'createInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraRef", "updateInfraRef", "infraRef", args.select, args.where.id, args.data, "UpdateInfraRefInput", "id", "infraRefPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraRef', + 'updateInfraRef', + 'infraRef', + args.select, + args.where.id, + args.data, + 'UpdateInfraRefInput', + 'id', + 'infraRefPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "updateInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'updateInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraRef", "deleteInfraRef", "infraRef", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraRef', + 'deleteInfraRef', + 'infraRef', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "deleteInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'deleteInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/infraStore.ts b/sdk/constructive-cli/src/compute/orm/models/infraStore.ts index 3d2d19bdcc..a0ed0dbe7b 100644 --- a/sdk/constructive-cli/src/compute/orm/models/infraStore.ts +++ b/sdk/constructive-cli/src/compute/orm/models/infraStore.ts @@ -3,56 +3,96 @@ * @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 { InfraStore, InfraStoreWithRelations, InfraStoreSelect, InfraStoreFilter, InfraStoreOrderBy, CreateInfraStoreInput, UpdateInfraStoreInput, InfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraStore, + InfraStoreWithRelations, + InfraStoreSelect, + InfraStoreFilter, + InfraStoreOrderBy, + CreateInfraStoreInput, + UpdateInfraStoreInput, + InfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraStore", "infraStores", 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 - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraStore', + 'infraStores', + 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, + }, + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStores", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraStore", "infraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraStore', + 'infraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStore", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraStore": data.infraStores?.nodes?.[0] ?? null - }) + infraStore: data.infraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraStore", "infraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraStore', + 'infraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStore", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraStore": data.infraStores?.nodes?.[0] ?? null - }) + infraStore: data.infraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraStore", "createInfraStore", "infraStore", args.select, args.data, "CreateInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraStore', + 'createInfraStore', + 'infraStore', + args.select, + args.data, + 'CreateInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "createInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'createInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraStore", "updateInfraStore", "infraStore", args.select, args.where.id, args.data, "UpdateInfraStoreInput", "id", "infraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraStore', + 'updateInfraStore', + 'infraStore', + args.select, + args.where.id, + args.data, + 'UpdateInfraStoreInput', + 'id', + 'infraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "updateInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'updateInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraStore", "deleteInfraStore", "infraStore", { - id: args.where.id - }, "DeleteInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraStore', + 'deleteInfraStore', + 'infraStore', + { + id: args.where.id, + }, + 'DeleteInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "deleteInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'deleteInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/integrationProvider.ts b/sdk/constructive-cli/src/compute/orm/models/integrationProvider.ts index bd4fa0c4d6..c79ad9375c 100644 --- a/sdk/constructive-cli/src/compute/orm/models/integrationProvider.ts +++ b/sdk/constructive-cli/src/compute/orm/models/integrationProvider.ts @@ -3,56 +3,96 @@ * @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 { IntegrationProvider, IntegrationProviderWithRelations, IntegrationProviderSelect, IntegrationProviderFilter, IntegrationProviderOrderBy, CreateIntegrationProviderInput, UpdateIntegrationProviderInput, IntegrationProviderPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IntegrationProvider, + IntegrationProviderWithRelations, + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy, + CreateIntegrationProviderInput, + UpdateIntegrationProviderInput, + IntegrationProviderPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IntegrationProviderModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProviders: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvider", "integrationProviders", 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 - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IntegrationProvider', + 'integrationProviders', + 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, + }, + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProviders", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProviders', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IntegrationProvider", "integrationProviders", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IntegrationProvider', + 'integrationProviders', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProvider", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProvider', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class IntegrationProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvider": data.integrationProviders?.nodes?.[0] ?? null - }) + integrationProvider: data.integrationProviders?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvider", "integrationProviders", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IntegrationProvider', + 'integrationProviders', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProvider", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProvider', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class IntegrationProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvider": data.integrationProviders?.nodes?.[0] ?? null - }) + integrationProvider: data.integrationProviders?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IntegrationProvider", "createIntegrationProvider", "integrationProvider", args.select, args.data, "CreateIntegrationProviderInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IntegrationProvider', + 'createIntegrationProvider', + 'integrationProvider', + args.select, + args.data, + 'CreateIntegrationProviderInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "createIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'createIntegrationProvider', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IntegrationProviderPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IntegrationProvider", "updateIntegrationProvider", "integrationProvider", args.select, args.where.id, args.data, "UpdateIntegrationProviderInput", "id", "integrationProviderPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IntegrationProvider', + 'updateIntegrationProvider', + 'integrationProvider', + args.select, + args.where.id, + args.data, + 'UpdateIntegrationProviderInput', + 'id', + 'integrationProviderPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "updateIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'updateIntegrationProvider', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IntegrationProvider", "deleteIntegrationProvider", "integrationProvider", { - id: args.where.id - }, "DeleteIntegrationProviderInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IntegrationProvider', + 'deleteIntegrationProvider', + 'integrationProvider', + { + id: args.where.id, + }, + 'DeleteIntegrationProviderInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "deleteIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'deleteIntegrationProvider', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/namespace.ts b/sdk/constructive-cli/src/compute/orm/models/namespace.ts index 8c2bf42876..4e300068cd 100644 --- a/sdk/constructive-cli/src/compute/orm/models/namespace.ts +++ b/sdk/constructive-cli/src/compute/orm/models/namespace.ts @@ -3,56 +3,96 @@ * @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 { Namespace, NamespaceWithRelations, NamespaceSelect, NamespaceFilter, NamespaceOrderBy, CreateNamespaceInput, UpdateNamespaceInput, NamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Namespace, + NamespaceWithRelations, + NamespaceSelect, + NamespaceFilter, + NamespaceOrderBy, + CreateNamespaceInput, + UpdateNamespaceInput, + NamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", 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 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + 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, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespaces", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Namespace", "namespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Namespace", "createNamespace", "namespace", args.select, args.data, "CreateNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Namespace', + 'createNamespace', + 'namespace', + args.select, + args.data, + 'CreateNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "createNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'createNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Namespace", "updateNamespace", "namespace", args.select, args.where.id, args.data, "UpdateNamespaceInput", "id", "namespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Namespace', + 'updateNamespace', + 'namespace', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceInput', + 'id', + 'namespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "updateNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'updateNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Namespace", "deleteNamespace", "namespace", { - id: args.where.id - }, "DeleteNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Namespace', + 'deleteNamespace', + 'namespace', + { + id: args.where.id, + }, + 'DeleteNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "deleteNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'deleteNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/namespaceEvent.ts b/sdk/constructive-cli/src/compute/orm/models/namespaceEvent.ts index 5fab4853c7..494442c263 100644 --- a/sdk/constructive-cli/src/compute/orm/models/namespaceEvent.ts +++ b/sdk/constructive-cli/src/compute/orm/models/namespaceEvent.ts @@ -3,56 +3,96 @@ * @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 { NamespaceEvent, NamespaceEventWithRelations, NamespaceEventSelect, NamespaceEventFilter, NamespaceEventOrderBy, CreateNamespaceEventInput, UpdateNamespaceEventInput, NamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceEvent, + NamespaceEventWithRelations, + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy, + CreateNamespaceEventInput, + UpdateNamespaceEventInput, + NamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", 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 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + 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, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvents", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceEvent", "createNamespaceEvent", "namespaceEvent", args.select, args.data, "CreateNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceEvent', + 'createNamespaceEvent', + 'namespaceEvent', + args.select, + args.data, + 'CreateNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "createNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'createNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + NamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceEvent", "updateNamespaceEvent", "namespaceEvent", args.select, args.where.id, args.data, "UpdateNamespaceEventInput", "id", "namespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceEvent', + 'updateNamespaceEvent', + 'namespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceEventInput', + 'id', + 'namespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "updateNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'updateNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceEvent", "deleteNamespaceEvent", "namespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceEvent', + 'deleteNamespaceEvent', + 'namespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "deleteNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'deleteNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformFunctionApiBinding.ts b/sdk/constructive-cli/src/compute/orm/models/platformFunctionApiBinding.ts index 6f3cffb12b..c74d4423e8 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformFunctionApiBinding.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformFunctionApiBinding.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionApiBinding, PlatformFunctionApiBindingWithRelations, PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingFilter, PlatformFunctionApiBindingOrderBy, CreatePlatformFunctionApiBindingInput, UpdatePlatformFunctionApiBindingInput, PlatformFunctionApiBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionApiBinding, + PlatformFunctionApiBindingWithRelations, + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy, + CreatePlatformFunctionApiBindingInput, + UpdatePlatformFunctionApiBindingInput, + PlatformFunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionApiBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBindings: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBindings: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", 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 - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + 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, + }, + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBindings", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBinding: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBinding: InferSelectResult< + PlatformFunctionApiBindingWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBinding", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBinding', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionApiBinding": data.platformFunctionApiBindings?.nodes?.[0] ?? null - }) + platformFunctionApiBinding: data.platformFunctionApiBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBinding: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBinding: InferSelectResult< + PlatformFunctionApiBindingWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBinding", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBinding', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionApiBinding": data.platformFunctionApiBindings?.nodes?.[0] ?? null - }) + platformFunctionApiBinding: data.platformFunctionApiBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionApiBinding", "createPlatformFunctionApiBinding", "platformFunctionApiBinding", args.select, args.data, "CreatePlatformFunctionApiBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionApiBinding', + 'createPlatformFunctionApiBinding', + 'platformFunctionApiBinding', + args.select, + args.data, + 'CreatePlatformFunctionApiBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "createPlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'createPlatformFunctionApiBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionApiBinding", "updatePlatformFunctionApiBinding", "platformFunctionApiBinding", args.select, args.where.id, args.data, "UpdatePlatformFunctionApiBindingInput", "id", "platformFunctionApiBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionApiBinding', + 'updatePlatformFunctionApiBinding', + 'platformFunctionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionApiBindingInput', + 'id', + 'platformFunctionApiBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "updatePlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'updatePlatformFunctionApiBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionApiBinding", "deletePlatformFunctionApiBinding", "platformFunctionApiBinding", { - id: args.where.id - }, "DeletePlatformFunctionApiBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionApiBinding', + 'deletePlatformFunctionApiBinding', + 'platformFunctionApiBinding', + { + id: args.where.id, + }, + 'DeletePlatformFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "deletePlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'deletePlatformFunctionApiBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformFunctionDefinition.ts b/sdk/constructive-cli/src/compute/orm/models/platformFunctionDefinition.ts index 43593c7d71..7422743780 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformFunctionDefinition.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformFunctionDefinition.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionDefinition, PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionFilter, PlatformFunctionDefinitionOrderBy, CreatePlatformFunctionDefinitionInput, UpdatePlatformFunctionDefinitionInput, PlatformFunctionDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDefinition, + PlatformFunctionDefinitionWithRelations, + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy, + CreatePlatformFunctionDefinitionInput, + UpdatePlatformFunctionDefinitionInput, + PlatformFunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinitions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinitions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", 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 - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + 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, + }, + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinitions", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinition: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinition: InferSelectResult< + PlatformFunctionDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinition", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinition', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDefinition": data.platformFunctionDefinitions?.nodes?.[0] ?? null - }) + platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinition: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinition: InferSelectResult< + PlatformFunctionDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinition", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinition', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDefinition": data.platformFunctionDefinitions?.nodes?.[0] ?? null - }) + platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDefinition", "createPlatformFunctionDefinition", "platformFunctionDefinition", args.select, args.data, "CreatePlatformFunctionDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDefinition', + 'createPlatformFunctionDefinition', + 'platformFunctionDefinition', + args.select, + args.data, + 'CreatePlatformFunctionDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "createPlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'createPlatformFunctionDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDefinition", "updatePlatformFunctionDefinition", "platformFunctionDefinition", args.select, args.where.id, args.data, "UpdatePlatformFunctionDefinitionInput", "id", "platformFunctionDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDefinition', + 'updatePlatformFunctionDefinition', + 'platformFunctionDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDefinitionInput', + 'id', + 'platformFunctionDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "updatePlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'updatePlatformFunctionDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDefinition", "deletePlatformFunctionDefinition", "platformFunctionDefinition", { - id: args.where.id - }, "DeletePlatformFunctionDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDefinition', + 'deletePlatformFunctionDefinition', + 'platformFunctionDefinition', + { + id: args.where.id, + }, + 'DeletePlatformFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "deletePlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'deletePlatformFunctionDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformFunctionDeployment.ts b/sdk/constructive-cli/src/compute/orm/models/platformFunctionDeployment.ts index d525b179ba..6331c14b14 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformFunctionDeployment.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformFunctionDeployment.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionDeployment, PlatformFunctionDeploymentWithRelations, PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentFilter, PlatformFunctionDeploymentOrderBy, CreatePlatformFunctionDeploymentInput, UpdatePlatformFunctionDeploymentInput, PlatformFunctionDeploymentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDeployment, + PlatformFunctionDeploymentWithRelations, + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy, + CreatePlatformFunctionDeploymentInput, + UpdatePlatformFunctionDeploymentInput, + PlatformFunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDeploymentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployments: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployments: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeployment", "platformFunctionDeployments", 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 - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + 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, + }, + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployments", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployments', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployment: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployment: InferSelectResult< + PlatformFunctionDeploymentWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDeployment", "platformFunctionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployment", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployment', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeployment": data.platformFunctionDeployments?.nodes?.[0] ?? null - }) + platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployment: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployment: InferSelectResult< + PlatformFunctionDeploymentWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeployment", "platformFunctionDeployments", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployment", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployment', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeployment": data.platformFunctionDeployments?.nodes?.[0] ?? null - }) + platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDeployment", "createPlatformFunctionDeployment", "platformFunctionDeployment", args.select, args.data, "CreatePlatformFunctionDeploymentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDeployment', + 'createPlatformFunctionDeployment', + 'platformFunctionDeployment', + args.select, + args.data, + 'CreatePlatformFunctionDeploymentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "createPlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'createPlatformFunctionDeployment', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDeployment", "updatePlatformFunctionDeployment", "platformFunctionDeployment", args.select, args.where.id, args.data, "UpdatePlatformFunctionDeploymentInput", "id", "platformFunctionDeploymentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDeployment', + 'updatePlatformFunctionDeployment', + 'platformFunctionDeployment', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDeploymentInput', + 'id', + 'platformFunctionDeploymentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "updatePlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'updatePlatformFunctionDeployment', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDeployment", "deletePlatformFunctionDeployment", "platformFunctionDeployment", { - id: args.where.id - }, "DeletePlatformFunctionDeploymentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDeployment', + 'deletePlatformFunctionDeployment', + 'platformFunctionDeployment', + { + id: args.where.id, + }, + 'DeletePlatformFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "deletePlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'deletePlatformFunctionDeployment', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformFunctionDeploymentEvent.ts b/sdk/constructive-cli/src/compute/orm/models/platformFunctionDeploymentEvent.ts index b0e61986d3..9e28f1c2c4 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformFunctionDeploymentEvent.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformFunctionDeploymentEvent.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionDeploymentEvent, PlatformFunctionDeploymentEventWithRelations, PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy, CreatePlatformFunctionDeploymentEventInput, UpdatePlatformFunctionDeploymentEventInput, PlatformFunctionDeploymentEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDeploymentEvent, + PlatformFunctionDeploymentEventWithRelations, + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy, + CreatePlatformFunctionDeploymentEventInput, + UpdatePlatformFunctionDeploymentEventInput, + PlatformFunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDeploymentEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvents: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", 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 - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + 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, + }, + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvents", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvent: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvent", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvent', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformFunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeploymentEvent": data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null - }) + platformFunctionDeploymentEvent: data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvent: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvent", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvent', document, variables, transform: (data: { @@ -93,79 +156,123 @@ export class PlatformFunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeploymentEvent": data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null - }) + platformFunctionDeploymentEvent: data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDeploymentEvent", "createPlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", args.select, args.data, "CreatePlatformFunctionDeploymentEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDeploymentEvent', + 'createPlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + args.select, + args.data, + 'CreatePlatformFunctionDeploymentEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "createPlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'createPlatformFunctionDeploymentEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDeploymentEvent", "updatePlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", args.select, args.where.id, args.data, "UpdatePlatformFunctionDeploymentEventInput", "id", "platformFunctionDeploymentEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDeploymentEvent', + 'updatePlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDeploymentEventInput', + 'id', + 'platformFunctionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "updatePlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'updatePlatformFunctionDeploymentEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDeploymentEvent", "deletePlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionDeploymentEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDeploymentEvent', + 'deletePlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "deletePlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'deletePlatformFunctionDeploymentEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformFunctionExecutionLog.ts b/sdk/constructive-cli/src/compute/orm/models/platformFunctionExecutionLog.ts index c2b531e089..1fe6df0cf8 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformFunctionExecutionLog.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformFunctionExecutionLog.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionExecutionLog, PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy, CreatePlatformFunctionExecutionLogInput, UpdatePlatformFunctionExecutionLogInput, PlatformFunctionExecutionLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionExecutionLog, + PlatformFunctionExecutionLogWithRelations, + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy, + CreatePlatformFunctionExecutionLogInput, + UpdatePlatformFunctionExecutionLogInput, + PlatformFunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionExecutionLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLogs: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", 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 - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + 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, + }, + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLogs", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLog: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLog", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLog', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformFunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionExecutionLog": data.platformFunctionExecutionLogs?.nodes?.[0] ?? null - }) + platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLog: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLog", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLog', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class PlatformFunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionExecutionLog": data.platformFunctionExecutionLogs?.nodes?.[0] ?? null - }) + platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionExecutionLog", "createPlatformFunctionExecutionLog", "platformFunctionExecutionLog", args.select, args.data, "CreatePlatformFunctionExecutionLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionExecutionLog', + 'createPlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + args.select, + args.data, + 'CreatePlatformFunctionExecutionLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "createPlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'createPlatformFunctionExecutionLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionExecutionLog", "updatePlatformFunctionExecutionLog", "platformFunctionExecutionLog", args.select, args.where.id, args.data, "UpdatePlatformFunctionExecutionLogInput", "id", "platformFunctionExecutionLogPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionExecutionLog', + 'updatePlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionExecutionLogInput', + 'id', + 'platformFunctionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "updatePlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'updatePlatformFunctionExecutionLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionExecutionLog", "deletePlatformFunctionExecutionLog", "platformFunctionExecutionLog", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionExecutionLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionExecutionLog', + 'deletePlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "deletePlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'deletePlatformFunctionExecutionLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformFunctionInvocation.ts b/sdk/constructive-cli/src/compute/orm/models/platformFunctionInvocation.ts index 79e7507dc9..f52ba9df33 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformFunctionInvocation.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformFunctionInvocation.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionInvocation, PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationSelect, PlatformFunctionInvocationFilter, PlatformFunctionInvocationOrderBy, CreatePlatformFunctionInvocationInput, UpdatePlatformFunctionInvocationInput, PlatformFunctionInvocationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionInvocation, + PlatformFunctionInvocationWithRelations, + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy, + CreatePlatformFunctionInvocationInput, + UpdatePlatformFunctionInvocationInput, + PlatformFunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionInvocationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocation", "platformFunctionInvocations", 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 - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + 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, + }, + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocations", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocation: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocation: InferSelectResult< + PlatformFunctionInvocationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionInvocation", "platformFunctionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocation", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocation', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocation": data.platformFunctionInvocations?.nodes?.[0] ?? null - }) + platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocation: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocation: InferSelectResult< + PlatformFunctionInvocationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocation", "platformFunctionInvocations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocation", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocation', document, variables, transform: (data: { @@ -93,79 +148,111 @@ export class PlatformFunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocation": data.platformFunctionInvocations?.nodes?.[0] ?? null - }) + platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionInvocation", "createPlatformFunctionInvocation", "platformFunctionInvocation", args.select, args.data, "CreatePlatformFunctionInvocationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionInvocation', + 'createPlatformFunctionInvocation', + 'platformFunctionInvocation', + args.select, + args.data, + 'CreatePlatformFunctionInvocationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "createPlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'createPlatformFunctionInvocation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionInvocation", "updatePlatformFunctionInvocation", "platformFunctionInvocation", args.select, args.where.id, args.data, "UpdatePlatformFunctionInvocationInput", "id", "platformFunctionInvocationPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionInvocation', + 'updatePlatformFunctionInvocation', + 'platformFunctionInvocation', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionInvocationInput', + 'id', + 'platformFunctionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "updatePlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'updatePlatformFunctionInvocation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionInvocation", "deletePlatformFunctionInvocation", "platformFunctionInvocation", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionInvocationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionInvocation', + 'deletePlatformFunctionInvocation', + 'platformFunctionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionInvocationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "deletePlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'deletePlatformFunctionInvocation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformFunctionInvocationAttempt.ts b/sdk/constructive-cli/src/compute/orm/models/platformFunctionInvocationAttempt.ts index 80c28fc7c6..a1db7bbe0a 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformFunctionInvocationAttempt.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformFunctionInvocationAttempt.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionInvocationAttempt, PlatformFunctionInvocationAttemptWithRelations, PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy, CreatePlatformFunctionInvocationAttemptInput, UpdatePlatformFunctionInvocationAttemptInput, PlatformFunctionInvocationAttemptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionInvocationAttempt, + PlatformFunctionInvocationAttemptWithRelations, + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy, + CreatePlatformFunctionInvocationAttemptInput, + UpdatePlatformFunctionInvocationAttemptInput, + PlatformFunctionInvocationAttemptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionInvocationAttemptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempts: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", 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 - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + 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, + }, + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempts", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempt: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempt", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempt', document, variables, transform: (data: { @@ -60,32 +113,43 @@ export class PlatformFunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocationAttempt": data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null - }) + platformFunctionInvocationAttempt: + data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempt: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempt", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempt', document, variables, transform: (data: { @@ -93,79 +157,124 @@ export class PlatformFunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocationAttempt": data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null - }) + platformFunctionInvocationAttempt: + data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionInvocationAttempt", "createPlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", args.select, args.data, "CreatePlatformFunctionInvocationAttemptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionInvocationAttempt', + 'createPlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + args.select, + args.data, + 'CreatePlatformFunctionInvocationAttemptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "createPlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'createPlatformFunctionInvocationAttempt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionInvocationAttemptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionInvocationAttempt", "updatePlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", args.select, args.where.id, args.data, "UpdatePlatformFunctionInvocationAttemptInput", "id", "platformFunctionInvocationAttemptPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionInvocationAttempt', + 'updatePlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionInvocationAttemptInput', + 'id', + 'platformFunctionInvocationAttemptPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "updatePlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'updatePlatformFunctionInvocationAttempt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionInvocationAttempt", "deletePlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionInvocationAttemptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionInvocationAttempt', + 'deletePlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionInvocationAttemptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "deletePlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'deletePlatformFunctionInvocationAttempt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformInfraCommit.ts b/sdk/constructive-cli/src/compute/orm/models/platformInfraCommit.ts index b5e90c524d..ab0c34f08f 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformInfraCommit.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformInfraCommit.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraCommit, PlatformInfraCommitWithRelations, PlatformInfraCommitSelect, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy, CreatePlatformInfraCommitInput, UpdatePlatformInfraCommitInput, PlatformInfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraCommit, + PlatformInfraCommitWithRelations, + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, + CreatePlatformInfraCommitInput, + UpdatePlatformInfraCommitInput, + PlatformInfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", 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 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + 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, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommits", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraCommit", "createPlatformInfraCommit", "platformInfraCommit", args.select, args.data, "CreatePlatformInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraCommit', + 'createPlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.data, + 'CreatePlatformInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "createPlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'createPlatformInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraCommit", "updatePlatformInfraCommit", "platformInfraCommit", args.select, args.where.id, args.data, "UpdatePlatformInfraCommitInput", "id", "platformInfraCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraCommit', + 'updatePlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraCommitInput', + 'id', + 'platformInfraCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "updatePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'updatePlatformInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraCommit", "deletePlatformInfraCommit", "platformInfraCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraCommit', + 'deletePlatformInfraCommit', + 'platformInfraCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "deletePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'deletePlatformInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts b/sdk/constructive-cli/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts index 6c9bfc2b28..e0e0a2aeaa 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts @@ -3,56 +3,109 @@ * @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 { PlatformInfraGetAllTreeNodesRecord, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy, CreatePlatformInfraGetAllTreeNodesRecordInput, UpdatePlatformInfraGetAllTreeNodesRecordInput, PlatformInfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraGetAllTreeNodesRecord, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, + CreatePlatformInfraGetAllTreeNodesRecordInput, + UpdatePlatformInfraGetAllTreeNodesRecordInput, + PlatformInfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", 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 - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + 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, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodes", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +113,41 @@ export class PlatformInfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraGetAllTreeNodesRecord": data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null - }) + platformInfraGetAllTreeNodesRecord: data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraGetAllTreeNodesRecord: { - platformInfraGetAllTreeNodesRecord: InferSelectResult; + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraGetAllTreeNodesRecord", "createPlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodesRecord", args.select, args.data, "CreatePlatformInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'createPlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreatePlatformInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "createPlatformInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'createPlatformInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformInfraObject.ts b/sdk/constructive-cli/src/compute/orm/models/platformInfraObject.ts index 2978ff1c18..512cb448c4 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformInfraObject.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformInfraObject.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraObject, PlatformInfraObjectWithRelations, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy, CreatePlatformInfraObjectInput, UpdatePlatformInfraObjectInput, PlatformInfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraObject, + PlatformInfraObjectWithRelations, + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, + CreatePlatformInfraObjectInput, + UpdatePlatformInfraObjectInput, + PlatformInfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraObject", "platformInfraObjects", 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 - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + 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, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObjects", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraObject", "platformInfraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class PlatformInfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraObject": data.platformInfraObjects?.nodes?.[0] ?? null - }) + platformInfraObject: data.platformInfraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("PlatformInfraObject", "platformInfraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'PlatformInfraObject', + 'platformInfraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraObject", "createPlatformInfraObject", "platformInfraObject", args.select, args.data, "CreatePlatformInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraObject', + 'createPlatformInfraObject', + 'platformInfraObject', + args.select, + args.data, + 'CreatePlatformInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "createPlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'createPlatformInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraObject", "updatePlatformInfraObject", "platformInfraObject", args.select, args.where.id, args.data, "UpdatePlatformInfraObjectInput", "id", "platformInfraObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraObject', + 'updatePlatformInfraObject', + 'platformInfraObject', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraObjectInput', + 'id', + 'platformInfraObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "updatePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'updatePlatformInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraObject", "deletePlatformInfraObject", "platformInfraObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraObject', + 'deletePlatformInfraObject', + 'platformInfraObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "deletePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'deletePlatformInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformInfraRef.ts b/sdk/constructive-cli/src/compute/orm/models/platformInfraRef.ts index 198e5cd359..c485407d95 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformInfraRef.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformInfraRef.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraRef, PlatformInfraRefWithRelations, PlatformInfraRefSelect, PlatformInfraRefFilter, PlatformInfraRefOrderBy, CreatePlatformInfraRefInput, UpdatePlatformInfraRefInput, PlatformInfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraRef, + PlatformInfraRefWithRelations, + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, + CreatePlatformInfraRefInput, + UpdatePlatformInfraRefInput, + PlatformInfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", 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 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + 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, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRefs", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraRef", "createPlatformInfraRef", "platformInfraRef", args.select, args.data, "CreatePlatformInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraRef', + 'createPlatformInfraRef', + 'platformInfraRef', + args.select, + args.data, + 'CreatePlatformInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "createPlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'createPlatformInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraRef", "updatePlatformInfraRef", "platformInfraRef", args.select, args.where.id, args.data, "UpdatePlatformInfraRefInput", "id", "platformInfraRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraRef', + 'updatePlatformInfraRef', + 'platformInfraRef', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraRefInput', + 'id', + 'platformInfraRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "updatePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'updatePlatformInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraRef", "deletePlatformInfraRef", "platformInfraRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraRef', + 'deletePlatformInfraRef', + 'platformInfraRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "deletePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'deletePlatformInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformInfraStore.ts b/sdk/constructive-cli/src/compute/orm/models/platformInfraStore.ts index 857230b173..493d42e53c 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformInfraStore.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformInfraStore.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraStore, PlatformInfraStoreWithRelations, PlatformInfraStoreSelect, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy, CreatePlatformInfraStoreInput, UpdatePlatformInfraStoreInput, PlatformInfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraStore, + PlatformInfraStoreWithRelations, + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, + CreatePlatformInfraStoreInput, + UpdatePlatformInfraStoreInput, + PlatformInfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", 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 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + 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, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStores", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraStore", "createPlatformInfraStore", "platformInfraStore", args.select, args.data, "CreatePlatformInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraStore', + 'createPlatformInfraStore', + 'platformInfraStore', + args.select, + args.data, + 'CreatePlatformInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "createPlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'createPlatformInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformInfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraStore", "updatePlatformInfraStore", "platformInfraStore", args.select, args.where.id, args.data, "UpdatePlatformInfraStoreInput", "id", "platformInfraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraStore', + 'updatePlatformInfraStore', + 'platformInfraStore', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraStoreInput', + 'id', + 'platformInfraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "updatePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'updatePlatformInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraStore", "deletePlatformInfraStore", "platformInfraStore", { - id: args.where.id - }, "DeletePlatformInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraStore', + 'deletePlatformInfraStore', + 'platformInfraStore', + { + id: args.where.id, + }, + 'DeletePlatformInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "deletePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'deletePlatformInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformNamespace.ts b/sdk/constructive-cli/src/compute/orm/models/platformNamespace.ts index 061849f0df..c4dff94953 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformNamespace.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformNamespace.ts @@ -3,56 +3,96 @@ * @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 { PlatformNamespace, PlatformNamespaceWithRelations, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy, CreatePlatformNamespaceInput, UpdatePlatformNamespaceInput, PlatformNamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespace, + PlatformNamespaceWithRelations, + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, + CreatePlatformNamespaceInput, + UpdatePlatformNamespaceInput, + PlatformNamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", 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 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + 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, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespaces", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespace", "createPlatformNamespace", "platformNamespace", args.select, args.data, "CreatePlatformNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespace', + 'createPlatformNamespace', + 'platformNamespace', + args.select, + args.data, + 'CreatePlatformNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "createPlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'createPlatformNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformNamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespace", "updatePlatformNamespace", "platformNamespace", args.select, args.where.id, args.data, "UpdatePlatformNamespaceInput", "id", "platformNamespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespace', + 'updatePlatformNamespace', + 'platformNamespace', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceInput', + 'id', + 'platformNamespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "updatePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'updatePlatformNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespace", "deletePlatformNamespace", "platformNamespace", { - id: args.where.id - }, "DeletePlatformNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespace', + 'deletePlatformNamespace', + 'platformNamespace', + { + id: args.where.id, + }, + 'DeletePlatformNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "deletePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'deletePlatformNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformNamespaceEvent.ts b/sdk/constructive-cli/src/compute/orm/models/platformNamespaceEvent.ts index 90242716e8..198afe79ae 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformNamespaceEvent.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformNamespaceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformNamespaceEvent, PlatformNamespaceEventWithRelations, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy, CreatePlatformNamespaceEventInput, UpdatePlatformNamespaceEventInput, PlatformNamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespaceEvent, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, + CreatePlatformNamespaceEventInput, + UpdatePlatformNamespaceEventInput, + PlatformNamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformNamespaceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", 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 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + 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, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvents", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespaceEvent", "createPlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.data, "CreatePlatformNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespaceEvent', + 'createPlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.data, + 'CreatePlatformNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "createPlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'createPlatformNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformNamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespaceEvent", "updatePlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.where.id, args.data, "UpdatePlatformNamespaceEventInput", "id", "platformNamespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespaceEvent', + 'updatePlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceEventInput', + 'id', + 'platformNamespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "updatePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'updatePlatformNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespaceEvent", "deletePlatformNamespaceEvent", "platformNamespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespaceEvent', + 'deletePlatformNamespaceEvent', + 'platformNamespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "deletePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'deletePlatformNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResource.ts b/sdk/constructive-cli/src/compute/orm/models/platformResource.ts index 7919e4d8dd..00f03ea1dc 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResource.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResource.ts @@ -3,56 +3,96 @@ * @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 { PlatformResource, PlatformResourceWithRelations, PlatformResourceSelect, PlatformResourceFilter, PlatformResourceOrderBy, CreatePlatformResourceInput, UpdatePlatformResourceInput, PlatformResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResource, + PlatformResourceWithRelations, + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy, + CreatePlatformResourceInput, + UpdatePlatformResourceInput, + PlatformResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResource", "platformResources", 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 - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResource', + 'platformResources', + 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, + }, + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResources", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResource", "platformResources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResource', + 'platformResources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResource", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResource": data.platformResources?.nodes?.[0] ?? null - }) + platformResource: data.platformResources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResource", "platformResources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResource', + 'platformResources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResource", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResource": data.platformResources?.nodes?.[0] ?? null - }) + platformResource: data.platformResources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResource", "createPlatformResource", "platformResource", args.select, args.data, "CreatePlatformResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResource', + 'createPlatformResource', + 'platformResource', + args.select, + args.data, + 'CreatePlatformResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "createPlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'createPlatformResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResource", "updatePlatformResource", "platformResource", args.select, args.where.id, args.data, "UpdatePlatformResourceInput", "id", "platformResourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResource', + 'updatePlatformResource', + 'platformResource', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceInput', + 'id', + 'platformResourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "updatePlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'updatePlatformResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResource", "deletePlatformResource", "platformResource", { - id: args.where.id - }, "DeletePlatformResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResource', + 'deletePlatformResource', + 'platformResource', + { + id: args.where.id, + }, + 'DeletePlatformResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "deletePlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'deletePlatformResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourceDeclaredCapacity.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourceDeclaredCapacity.ts index 922c25d12e..66a88f859d 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourceDeclaredCapacity.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourceDeclaredCapacity.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceDeclaredCapacity, PlatformResourceDeclaredCapacityWithRelations, PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy, CreatePlatformResourceDeclaredCapacityInput, UpdatePlatformResourceDeclaredCapacityInput, PlatformResourceDeclaredCapacityPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceDeclaredCapacity, + PlatformResourceDeclaredCapacityWithRelations, + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy, + CreatePlatformResourceDeclaredCapacityInput, + UpdatePlatformResourceDeclaredCapacityInput, + PlatformResourceDeclaredCapacityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceDeclaredCapacityModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDeclaredCapacities: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacities", 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 - }, "PlatformResourceDeclaredCapacityFilter", "PlatformResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacities', + 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, + }, + 'PlatformResourceDeclaredCapacityFilter', + 'PlatformResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "platformResourceDeclaredCapacities", + operation: 'query', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'platformResourceDeclaredCapacities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDeclaredCapacity: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDeclaredCapacity: InferSelectResult< + PlatformResourceDeclaredCapacityWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacities", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceDeclaredCapacityFilter", "PlatformResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceDeclaredCapacityFilter', + 'PlatformResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "platformResourceDeclaredCapacity", + operation: 'query', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'platformResourceDeclaredCapacity', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourceDeclaredCapacityModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDeclaredCapacity": data.platformResourceDeclaredCapacities?.nodes?.[0] ?? null - }) + platformResourceDeclaredCapacity: + data.platformResourceDeclaredCapacities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourceDeclaredCapacityInput['platformResourceDeclaredCapacity'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceDeclaredCapacity: { - platformResourceDeclaredCapacity: InferSelectResult; + platformResourceDeclaredCapacity: InferSelectResult< + PlatformResourceDeclaredCapacityWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceDeclaredCapacity", "createPlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacity", args.select, args.data, "CreatePlatformResourceDeclaredCapacityInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceDeclaredCapacity', + 'createPlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacity', + args.select, + args.data, + 'CreatePlatformResourceDeclaredCapacityInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "createPlatformResourceDeclaredCapacity", + operation: 'mutation', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'createPlatformResourceDeclaredCapacity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourceDefinition.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourceDefinition.ts index ae9490e31f..a23e8bf5a1 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourceDefinition.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourceDefinition.ts @@ -3,56 +3,101 @@ * @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 { PlatformResourceDefinition, PlatformResourceDefinitionWithRelations, PlatformResourceDefinitionSelect, PlatformResourceDefinitionFilter, PlatformResourceDefinitionOrderBy, CreatePlatformResourceDefinitionInput, UpdatePlatformResourceDefinitionInput, PlatformResourceDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceDefinition, + PlatformResourceDefinitionWithRelations, + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy, + CreatePlatformResourceDefinitionInput, + UpdatePlatformResourceDefinitionInput, + PlatformResourceDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinitions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinitions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDefinition", "platformResourceDefinitions", 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 - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + 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, + }, + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinitions", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinition: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinition: InferSelectResult< + PlatformResourceDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceDefinition", "platformResourceDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinition", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinition', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDefinition": data.platformResourceDefinitions?.nodes?.[0] ?? null - }) + platformResourceDefinition: data.platformResourceDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinition: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinition: InferSelectResult< + PlatformResourceDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDefinition", "platformResourceDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinition", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinition', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDefinition": data.platformResourceDefinitions?.nodes?.[0] ?? null - }) + platformResourceDefinition: data.platformResourceDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceDefinition", "createPlatformResourceDefinition", "platformResourceDefinition", args.select, args.data, "CreatePlatformResourceDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceDefinition', + 'createPlatformResourceDefinition', + 'platformResourceDefinition', + args.select, + args.data, + 'CreatePlatformResourceDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "createPlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'createPlatformResourceDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceDefinition", "updatePlatformResourceDefinition", "platformResourceDefinition", args.select, args.where.id, args.data, "UpdatePlatformResourceDefinitionInput", "id", "platformResourceDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceDefinition', + 'updatePlatformResourceDefinition', + 'platformResourceDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceDefinitionInput', + 'id', + 'platformResourceDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "updatePlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'updatePlatformResourceDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceDefinition", "deletePlatformResourceDefinition", "platformResourceDefinition", { - id: args.where.id - }, "DeletePlatformResourceDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceDefinition', + 'deletePlatformResourceDefinition', + 'platformResourceDefinition', + { + id: args.where.id, + }, + 'DeletePlatformResourceDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "deletePlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'deletePlatformResourceDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourceEvent.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourceEvent.ts index 8a8f320796..77ae28e155 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourceEvent.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourceEvent, PlatformResourceEventWithRelations, PlatformResourceEventSelect, PlatformResourceEventFilter, PlatformResourceEventOrderBy, CreatePlatformResourceEventInput, UpdatePlatformResourceEventInput, PlatformResourceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceEvent, + PlatformResourceEventWithRelations, + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy, + CreatePlatformResourceEventInput, + UpdatePlatformResourceEventInput, + PlatformResourceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceEvent", "platformResourceEvents", 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 - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + 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, + }, + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvents", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceEvent", "platformResourceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvent", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceEvent": data.platformResourceEvents?.nodes?.[0] ?? null - }) + platformResourceEvent: data.platformResourceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceEvent", "platformResourceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvent", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceEvent": data.platformResourceEvents?.nodes?.[0] ?? null - }) + platformResourceEvent: data.platformResourceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceEvent", "createPlatformResourceEvent", "platformResourceEvent", args.select, args.data, "CreatePlatformResourceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceEvent', + 'createPlatformResourceEvent', + 'platformResourceEvent', + args.select, + args.data, + 'CreatePlatformResourceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "createPlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'createPlatformResourceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformResourceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceEvent", "updatePlatformResourceEvent", "platformResourceEvent", args.select, args.where.id, args.data, "UpdatePlatformResourceEventInput", "id", "platformResourceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceEvent', + 'updatePlatformResourceEvent', + 'platformResourceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceEventInput', + 'id', + 'platformResourceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "updatePlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'updatePlatformResourceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceEvent", "deletePlatformResourceEvent", "platformResourceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformResourceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceEvent', + 'deletePlatformResourceEvent', + 'platformResourceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformResourceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "deletePlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'deletePlatformResourceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourceInstallation.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourceInstallation.ts index 9c839409d9..6da38f597c 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourceInstallation.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourceInstallation.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceInstallation, PlatformResourceInstallationWithRelations, PlatformResourceInstallationSelect, PlatformResourceInstallationFilter, PlatformResourceInstallationOrderBy, CreatePlatformResourceInstallationInput, UpdatePlatformResourceInstallationInput, PlatformResourceInstallationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceInstallation, + PlatformResourceInstallationWithRelations, + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy, + CreatePlatformResourceInstallationInput, + UpdatePlatformResourceInstallationInput, + PlatformResourceInstallationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceInstallationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallations: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceInstallation", "platformResourceInstallations", 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 - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + 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, + }, + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallations", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallation: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceInstallation", "platformResourceInstallations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallation", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallation', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceInstallation": data.platformResourceInstallations?.nodes?.[0] ?? null - }) + platformResourceInstallation: data.platformResourceInstallations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallation: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceInstallation", "platformResourceInstallations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallation", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallation', document, variables, transform: (data: { @@ -93,74 +156,106 @@ export class PlatformResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceInstallation": data.platformResourceInstallations?.nodes?.[0] ?? null - }) + platformResourceInstallation: data.platformResourceInstallations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceInstallation", "createPlatformResourceInstallation", "platformResourceInstallation", args.select, args.data, "CreatePlatformResourceInstallationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceInstallation', + 'createPlatformResourceInstallation', + 'platformResourceInstallation', + args.select, + args.data, + 'CreatePlatformResourceInstallationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "createPlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'createPlatformResourceInstallation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceInstallationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceInstallation", "updatePlatformResourceInstallation", "platformResourceInstallation", args.select, args.where.id, args.data, "UpdatePlatformResourceInstallationInput", "id", "platformResourceInstallationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceInstallation', + 'updatePlatformResourceInstallation', + 'platformResourceInstallation', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceInstallationInput', + 'id', + 'platformResourceInstallationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "updatePlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'updatePlatformResourceInstallation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceInstallation", "deletePlatformResourceInstallation", "platformResourceInstallation", { - id: args.where.id - }, "DeletePlatformResourceInstallationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceInstallation', + 'deletePlatformResourceInstallation', + 'platformResourceInstallation', + { + id: args.where.id, + }, + 'DeletePlatformResourceInstallationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "deletePlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'deletePlatformResourceInstallation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourceStatusCheck.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourceStatusCheck.ts index 2acb231904..16f33db355 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourceStatusCheck.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourceStatusCheck.ts @@ -3,56 +3,105 @@ * @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 { PlatformResourceStatusCheck, PlatformResourceStatusCheckWithRelations, PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckFilter, PlatformResourceStatusCheckOrderBy, CreatePlatformResourceStatusCheckInput, UpdatePlatformResourceStatusCheckInput, PlatformResourceStatusCheckPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceStatusCheck, + PlatformResourceStatusCheckWithRelations, + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy, + CreatePlatformResourceStatusCheckInput, + UpdatePlatformResourceStatusCheckInput, + PlatformResourceStatusCheckPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceStatusCheckModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusChecks: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusChecks: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", 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 - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + 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, + }, + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusChecks", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusChecks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusCheck: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusCheck", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusCheck', document, variables, transform: (data: { @@ -60,32 +109,42 @@ export class PlatformResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceStatusCheck": data.platformResourceStatusChecks?.nodes?.[0] ?? null - }) + platformResourceStatusCheck: data.platformResourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusCheck: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusCheck", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusCheck', document, variables, transform: (data: { @@ -93,74 +152,106 @@ export class PlatformResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceStatusCheck": data.platformResourceStatusChecks?.nodes?.[0] ?? null - }) + platformResourceStatusCheck: data.platformResourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceStatusCheck", "createPlatformResourceStatusCheck", "platformResourceStatusCheck", args.select, args.data, "CreatePlatformResourceStatusCheckInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceStatusCheck', + 'createPlatformResourceStatusCheck', + 'platformResourceStatusCheck', + args.select, + args.data, + 'CreatePlatformResourceStatusCheckInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "createPlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'createPlatformResourceStatusCheck', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceStatusCheckPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceStatusCheck", "updatePlatformResourceStatusCheck", "platformResourceStatusCheck", args.select, args.where.id, args.data, "UpdatePlatformResourceStatusCheckInput", "id", "platformResourceStatusCheckPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceStatusCheck', + 'updatePlatformResourceStatusCheck', + 'platformResourceStatusCheck', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceStatusCheckInput', + 'id', + 'platformResourceStatusCheckPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "updatePlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'updatePlatformResourceStatusCheck', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceStatusCheck", "deletePlatformResourceStatusCheck", "platformResourceStatusCheck", { - id: args.where.id - }, "DeletePlatformResourceStatusCheckInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceStatusCheck', + 'deletePlatformResourceStatusCheck', + 'platformResourceStatusCheck', + { + id: args.where.id, + }, + 'DeletePlatformResourceStatusCheckInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "deletePlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'deletePlatformResourceStatusCheck', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourceUsageLog.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourceUsageLog.ts index 41dd01a24e..276c7f50d9 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourceUsageLog.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourceUsageLog.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourceUsageLog, PlatformResourceUsageLogWithRelations, PlatformResourceUsageLogSelect, PlatformResourceUsageLogFilter, PlatformResourceUsageLogOrderBy, CreatePlatformResourceUsageLogInput, UpdatePlatformResourceUsageLogInput, PlatformResourceUsageLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUsageLog, + PlatformResourceUsageLogWithRelations, + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy, + CreatePlatformResourceUsageLogInput, + UpdatePlatformResourceUsageLogInput, + PlatformResourceUsageLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUsageLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageLogs: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", 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 - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + 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, + }, + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLogs", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLog", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLog', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageLog": data.platformResourceUsageLogs?.nodes?.[0] ?? null - }) + platformResourceUsageLog: data.platformResourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLog", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLog', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageLog": data.platformResourceUsageLogs?.nodes?.[0] ?? null - }) + platformResourceUsageLog: data.platformResourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUsageLog", "createPlatformResourceUsageLog", "platformResourceUsageLog", args.select, args.data, "CreatePlatformResourceUsageLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUsageLog', + 'createPlatformResourceUsageLog', + 'platformResourceUsageLog', + args.select, + args.data, + 'CreatePlatformResourceUsageLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "createPlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'createPlatformResourceUsageLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + sampledAt: string; + }, + PlatformResourceUsageLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceUsageLog", "updatePlatformResourceUsageLog", "platformResourceUsageLog", args.select, args.where.id, args.data, "UpdatePlatformResourceUsageLogInput", "id", "platformResourceUsageLogPatch", connectionFieldsMap, { - sampledAt: args.where.sampledAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceUsageLog', + 'updatePlatformResourceUsageLog', + 'platformResourceUsageLog', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceUsageLogInput', + 'id', + 'platformResourceUsageLogPatch', + connectionFieldsMap, + { + sampledAt: args.where.sampledAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "updatePlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'updatePlatformResourceUsageLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - sampledAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + sampledAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceUsageLog", "deletePlatformResourceUsageLog", "platformResourceUsageLog", { - id: args.where.id, - sampledAt: args.where.sampledAt - }, "DeletePlatformResourceUsageLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceUsageLog', + 'deletePlatformResourceUsageLog', + 'platformResourceUsageLog', + { + id: args.where.id, + sampledAt: args.where.sampledAt, + }, + 'DeletePlatformResourceUsageLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "deletePlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'deletePlatformResourceUsageLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourceUsageSummary.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourceUsageSummary.ts index 27e92a00e7..3d6efa4823 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourceUsageSummary.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourceUsageSummary.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceUsageSummary, PlatformResourceUsageSummaryWithRelations, PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryFilter, PlatformResourceUsageSummaryOrderBy, CreatePlatformResourceUsageSummaryInput, UpdatePlatformResourceUsageSummaryInput, PlatformResourceUsageSummaryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUsageSummary, + PlatformResourceUsageSummaryWithRelations, + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy, + CreatePlatformResourceUsageSummaryInput, + UpdatePlatformResourceUsageSummaryInput, + PlatformResourceUsageSummaryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUsageSummaryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummaries: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummaries: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", 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 - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + 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, + }, + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummaries", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummaries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummary: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummary", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummary', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageSummary": data.platformResourceUsageSummaries?.nodes?.[0] ?? null - }) + platformResourceUsageSummary: data.platformResourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummary: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummary", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummary', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class PlatformResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageSummary": data.platformResourceUsageSummaries?.nodes?.[0] ?? null - }) + platformResourceUsageSummary: data.platformResourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUsageSummary", "createPlatformResourceUsageSummary", "platformResourceUsageSummary", args.select, args.data, "CreatePlatformResourceUsageSummaryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUsageSummary', + 'createPlatformResourceUsageSummary', + 'platformResourceUsageSummary', + args.select, + args.data, + 'CreatePlatformResourceUsageSummaryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "createPlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'createPlatformResourceUsageSummary', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + date: string; + }, + PlatformResourceUsageSummaryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceUsageSummary", "updatePlatformResourceUsageSummary", "platformResourceUsageSummary", args.select, args.where.id, args.data, "UpdatePlatformResourceUsageSummaryInput", "id", "platformResourceUsageSummaryPatch", connectionFieldsMap, { - date: args.where.date - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceUsageSummary', + 'updatePlatformResourceUsageSummary', + 'platformResourceUsageSummary', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceUsageSummaryInput', + 'id', + 'platformResourceUsageSummaryPatch', + connectionFieldsMap, + { + date: args.where.date, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "updatePlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'updatePlatformResourceUsageSummary', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - date: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + date: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceUsageSummary", "deletePlatformResourceUsageSummary", "platformResourceUsageSummary", { - id: args.where.id, - date: args.where.date - }, "DeletePlatformResourceUsageSummaryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceUsageSummary', + 'deletePlatformResourceUsageSummary', + 'platformResourceUsageSummary', + { + id: args.where.id, + date: args.where.date, + }, + 'DeletePlatformResourceUsageSummaryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "deletePlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'deletePlatformResourceUsageSummary', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourceUtilization.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourceUtilization.ts index e4d7fa813d..040d38000e 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourceUtilization.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourceUtilization.ts @@ -3,56 +3,105 @@ * @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 { PlatformResourceUtilization, PlatformResourceUtilizationWithRelations, PlatformResourceUtilizationSelect, PlatformResourceUtilizationFilter, PlatformResourceUtilizationOrderBy, CreatePlatformResourceUtilizationInput, UpdatePlatformResourceUtilizationInput, PlatformResourceUtilizationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUtilization, + PlatformResourceUtilizationWithRelations, + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy, + CreatePlatformResourceUtilizationInput, + UpdatePlatformResourceUtilizationInput, + PlatformResourceUtilizationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUtilizationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUtilizations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUtilizations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUtilization", "platformResourceUtilizations", 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 - }, "PlatformResourceUtilizationFilter", "PlatformResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUtilization', + 'platformResourceUtilizations', + 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, + }, + 'PlatformResourceUtilizationFilter', + 'PlatformResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUtilization", - fieldName: "platformResourceUtilizations", + operation: 'query', + operationName: 'PlatformResourceUtilization', + fieldName: 'platformResourceUtilizations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUtilization: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUtilization: InferSelectResult< + PlatformResourceUtilizationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUtilization", "platformResourceUtilizations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUtilizationFilter", "PlatformResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUtilization', + 'platformResourceUtilizations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUtilizationFilter', + 'PlatformResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUtilization", - fieldName: "platformResourceUtilization", + operation: 'query', + operationName: 'PlatformResourceUtilization', + fieldName: 'platformResourceUtilization', document, variables, transform: (data: { @@ -60,28 +109,35 @@ export class PlatformResourceUtilizationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUtilization": data.platformResourceUtilizations?.nodes?.[0] ?? null - }) + platformResourceUtilization: data.platformResourceUtilizations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUtilization: { platformResourceUtilization: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUtilization", "createPlatformResourceUtilization", "platformResourceUtilization", args.select, args.data, "CreatePlatformResourceUtilizationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUtilization', + 'createPlatformResourceUtilization', + 'platformResourceUtilization', + args.select, + args.data, + 'CreatePlatformResourceUtilizationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUtilization", - fieldName: "createPlatformResourceUtilization", + operation: 'mutation', + operationName: 'PlatformResourceUtilization', + fieldName: 'createPlatformResourceUtilization', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourcesHealth.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourcesHealth.ts index 5c57532e6c..0f0efa3e31 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourcesHealth.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourcesHealth.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourcesHealth, PlatformResourcesHealthWithRelations, PlatformResourcesHealthSelect, PlatformResourcesHealthFilter, PlatformResourcesHealthOrderBy, CreatePlatformResourcesHealthInput, UpdatePlatformResourcesHealthInput, PlatformResourcesHealthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesHealth, + PlatformResourcesHealthWithRelations, + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy, + CreatePlatformResourcesHealthInput, + UpdatePlatformResourcesHealthInput, + PlatformResourcesHealthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesHealthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesHealths: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesHealths: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesHealth", "platformResourcesHealths", 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 - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + 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, + }, + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealths", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesHealth", "platformResourcesHealths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealth", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealth', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesHealth": data.platformResourcesHealths?.nodes?.[0] ?? null - }) + platformResourcesHealth: data.platformResourcesHealths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesHealth", "platformResourcesHealths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealth", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealth', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PlatformResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesHealth": data.platformResourcesHealths?.nodes?.[0] ?? null - }) + platformResourcesHealth: data.platformResourcesHealths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesHealth: { platformResourcesHealth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesHealth", "createPlatformResourcesHealth", "platformResourcesHealth", args.select, args.data, "CreatePlatformResourcesHealthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesHealth', + 'createPlatformResourcesHealth', + 'platformResourcesHealth', + args.select, + args.data, + 'CreatePlatformResourcesHealthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesHealth", - fieldName: "createPlatformResourcesHealth", + operation: 'mutation', + operationName: 'PlatformResourcesHealth', + fieldName: 'createPlatformResourcesHealth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourcesRequirementsState.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourcesRequirementsState.ts index 634b4945d0..ab6152e426 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourcesRequirementsState.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourcesRequirementsState.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourcesRequirementsState, PlatformResourcesRequirementsStateWithRelations, PlatformResourcesRequirementsStateSelect, PlatformResourcesRequirementsStateFilter, PlatformResourcesRequirementsStateOrderBy, CreatePlatformResourcesRequirementsStateInput, UpdatePlatformResourcesRequirementsStateInput, PlatformResourcesRequirementsStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesRequirementsState, + PlatformResourcesRequirementsStateWithRelations, + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy, + CreatePlatformResourcesRequirementsStateInput, + UpdatePlatformResourcesRequirementsStateInput, + PlatformResourcesRequirementsStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesRequirementsStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesRequirementsStates: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesRequirementsState", "platformResourcesRequirementsStates", 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 - }, "PlatformResourcesRequirementsStateFilter", "PlatformResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesRequirementsState', + 'platformResourcesRequirementsStates', + 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, + }, + 'PlatformResourcesRequirementsStateFilter', + 'PlatformResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesRequirementsState", - fieldName: "platformResourcesRequirementsStates", + operation: 'query', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'platformResourcesRequirementsStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesRequirementsState: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesRequirementsState: InferSelectResult< + PlatformResourcesRequirementsStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesRequirementsState", "platformResourcesRequirementsStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesRequirementsStateFilter", "PlatformResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesRequirementsState', + 'platformResourcesRequirementsStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesRequirementsStateFilter', + 'PlatformResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesRequirementsState", - fieldName: "platformResourcesRequirementsState", + operation: 'query', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'platformResourcesRequirementsState', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourcesRequirementsStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesRequirementsState": data.platformResourcesRequirementsStates?.nodes?.[0] ?? null - }) + platformResourcesRequirementsState: + data.platformResourcesRequirementsStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourcesRequirementsStateInput['platformResourcesRequirementsState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesRequirementsState: { - platformResourcesRequirementsState: InferSelectResult; + platformResourcesRequirementsState: InferSelectResult< + PlatformResourcesRequirementsStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesRequirementsState", "createPlatformResourcesRequirementsState", "platformResourcesRequirementsState", args.select, args.data, "CreatePlatformResourcesRequirementsStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesRequirementsState', + 'createPlatformResourcesRequirementsState', + 'platformResourcesRequirementsState', + args.select, + args.data, + 'CreatePlatformResourcesRequirementsStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesRequirementsState", - fieldName: "createPlatformResourcesRequirementsState", + operation: 'mutation', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'createPlatformResourcesRequirementsState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformResourcesResolvedRequirement.ts b/sdk/constructive-cli/src/compute/orm/models/platformResourcesResolvedRequirement.ts index 35ddaae650..d7d7bf4ed0 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformResourcesResolvedRequirement.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformResourcesResolvedRequirement.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourcesResolvedRequirement, PlatformResourcesResolvedRequirementWithRelations, PlatformResourcesResolvedRequirementSelect, PlatformResourcesResolvedRequirementFilter, PlatformResourcesResolvedRequirementOrderBy, CreatePlatformResourcesResolvedRequirementInput, UpdatePlatformResourcesResolvedRequirementInput, PlatformResourcesResolvedRequirementPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesResolvedRequirement, + PlatformResourcesResolvedRequirementWithRelations, + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy, + CreatePlatformResourcesResolvedRequirementInput, + UpdatePlatformResourcesResolvedRequirementInput, + PlatformResourcesResolvedRequirementPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesResolvedRequirementModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesResolvedRequirements: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirements", 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 - }, "PlatformResourcesResolvedRequirementFilter", "PlatformResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirements', + 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, + }, + 'PlatformResourcesResolvedRequirementFilter', + 'PlatformResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "platformResourcesResolvedRequirements", + operation: 'query', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'platformResourcesResolvedRequirements', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesResolvedRequirement: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesResolvedRequirement: InferSelectResult< + PlatformResourcesResolvedRequirementWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirements", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesResolvedRequirementFilter", "PlatformResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirements', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesResolvedRequirementFilter', + 'PlatformResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "platformResourcesResolvedRequirement", + operation: 'query', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'platformResourcesResolvedRequirement', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourcesResolvedRequirementModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesResolvedRequirement": data.platformResourcesResolvedRequirements?.nodes?.[0] ?? null - }) + platformResourcesResolvedRequirement: + data.platformResourcesResolvedRequirements?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourcesResolvedRequirementInput['platformResourcesResolvedRequirement'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesResolvedRequirement: { - platformResourcesResolvedRequirement: InferSelectResult; + platformResourcesResolvedRequirement: InferSelectResult< + PlatformResourcesResolvedRequirementWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesResolvedRequirement", "createPlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirement", args.select, args.data, "CreatePlatformResourcesResolvedRequirementInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesResolvedRequirement', + 'createPlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirement', + args.select, + args.data, + 'CreatePlatformResourcesResolvedRequirementInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "createPlatformResourcesResolvedRequirement", + operation: 'mutation', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'createPlatformResourcesResolvedRequirement', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformWebhookEndpoint.ts b/sdk/constructive-cli/src/compute/orm/models/platformWebhookEndpoint.ts index 99cce4fbc4..63d0e119ff 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformWebhookEndpoint.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformWebhookEndpoint.ts @@ -3,56 +3,98 @@ * @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 { PlatformWebhookEndpoint, PlatformWebhookEndpointWithRelations, PlatformWebhookEndpointSelect, PlatformWebhookEndpointFilter, PlatformWebhookEndpointOrderBy, CreatePlatformWebhookEndpointInput, UpdatePlatformWebhookEndpointInput, PlatformWebhookEndpointPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformWebhookEndpoint, + PlatformWebhookEndpointWithRelations, + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy, + CreatePlatformWebhookEndpointInput, + UpdatePlatformWebhookEndpointInput, + PlatformWebhookEndpointPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformWebhookEndpointModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformWebhookEndpoints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformWebhookEndpoints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", 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 - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + 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, + }, + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoints", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoint", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformWebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEndpoint": data.platformWebhookEndpoints?.nodes?.[0] ?? null - }) + platformWebhookEndpoint: data.platformWebhookEndpoints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoint", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformWebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEndpoint": data.platformWebhookEndpoints?.nodes?.[0] ?? null - }) + platformWebhookEndpoint: data.platformWebhookEndpoints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformWebhookEndpoint", "createPlatformWebhookEndpoint", "platformWebhookEndpoint", args.select, args.data, "CreatePlatformWebhookEndpointInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformWebhookEndpoint', + 'createPlatformWebhookEndpoint', + 'platformWebhookEndpoint', + args.select, + args.data, + 'CreatePlatformWebhookEndpointInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "createPlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'createPlatformWebhookEndpoint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformWebhookEndpointPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformWebhookEndpoint", "updatePlatformWebhookEndpoint", "platformWebhookEndpoint", args.select, args.where.id, args.data, "UpdatePlatformWebhookEndpointInput", "id", "platformWebhookEndpointPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformWebhookEndpoint', + 'updatePlatformWebhookEndpoint', + 'platformWebhookEndpoint', + args.select, + args.where.id, + args.data, + 'UpdatePlatformWebhookEndpointInput', + 'id', + 'platformWebhookEndpointPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "updatePlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'updatePlatformWebhookEndpoint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformWebhookEndpoint", "deletePlatformWebhookEndpoint", "platformWebhookEndpoint", { - id: args.where.id - }, "DeletePlatformWebhookEndpointInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformWebhookEndpoint', + 'deletePlatformWebhookEndpoint', + 'platformWebhookEndpoint', + { + id: args.where.id, + }, + 'DeletePlatformWebhookEndpointInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "deletePlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'deletePlatformWebhookEndpoint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/platformWebhookEvent.ts b/sdk/constructive-cli/src/compute/orm/models/platformWebhookEvent.ts index dc04e82a10..ee3318064c 100644 --- a/sdk/constructive-cli/src/compute/orm/models/platformWebhookEvent.ts +++ b/sdk/constructive-cli/src/compute/orm/models/platformWebhookEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformWebhookEvent, PlatformWebhookEventWithRelations, PlatformWebhookEventSelect, PlatformWebhookEventFilter, PlatformWebhookEventOrderBy, CreatePlatformWebhookEventInput, UpdatePlatformWebhookEventInput, PlatformWebhookEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformWebhookEvent, + PlatformWebhookEventWithRelations, + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy, + CreatePlatformWebhookEventInput, + UpdatePlatformWebhookEventInput, + PlatformWebhookEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformWebhookEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformWebhookEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformWebhookEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEvent", "platformWebhookEvents", 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 - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + 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, + }, + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvents", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformWebhookEvent", "platformWebhookEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvent", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformWebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEvent": data.platformWebhookEvents?.nodes?.[0] ?? null - }) + platformWebhookEvent: data.platformWebhookEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEvent", "platformWebhookEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvent", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvent', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformWebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEvent": data.platformWebhookEvents?.nodes?.[0] ?? null - }) + platformWebhookEvent: data.platformWebhookEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformWebhookEvent", "createPlatformWebhookEvent", "platformWebhookEvent", args.select, args.data, "CreatePlatformWebhookEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformWebhookEvent', + 'createPlatformWebhookEvent', + 'platformWebhookEvent', + args.select, + args.data, + 'CreatePlatformWebhookEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "createPlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'createPlatformWebhookEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformWebhookEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformWebhookEvent", "updatePlatformWebhookEvent", "platformWebhookEvent", args.select, args.where.id, args.data, "UpdatePlatformWebhookEventInput", "id", "platformWebhookEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformWebhookEvent', + 'updatePlatformWebhookEvent', + 'platformWebhookEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformWebhookEventInput', + 'id', + 'platformWebhookEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "updatePlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'updatePlatformWebhookEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformWebhookEvent", "deletePlatformWebhookEvent", "platformWebhookEvent", { - id: args.where.id - }, "DeletePlatformWebhookEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformWebhookEvent', + 'deletePlatformWebhookEvent', + 'platformWebhookEvent', + { + id: args.where.id, + }, + 'DeletePlatformWebhookEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "deletePlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'deletePlatformWebhookEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resource.ts b/sdk/constructive-cli/src/compute/orm/models/resource.ts index 5897835c08..b4b60ad6f3 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resource.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resource.ts @@ -3,56 +3,96 @@ * @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 { Resource, ResourceWithRelations, ResourceSelect, ResourceFilter, ResourceOrderBy, CreateResourceInput, UpdateResourceInput, ResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Resource, + ResourceWithRelations, + ResourceSelect, + ResourceFilter, + ResourceOrderBy, + CreateResourceInput, + UpdateResourceInput, + ResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Resource", "resources", 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 - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Resource', + 'resources', + 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, + }, + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resources", + operation: 'query', + operationName: 'Resource', + fieldName: 'resources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Resource", "resources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Resource', + 'resources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resource", + operation: 'query', + operationName: 'Resource', + fieldName: 'resource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "resource": data.resources?.nodes?.[0] ?? null - }) + resource: data.resources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Resource", "resources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Resource', + 'resources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resource", + operation: 'query', + operationName: 'Resource', + fieldName: 'resource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "resource": data.resources?.nodes?.[0] ?? null - }) + resource: data.resources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Resource", "createResource", "resource", args.select, args.data, "CreateResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Resource', + 'createResource', + 'resource', + args.select, + args.data, + 'CreateResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "createResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'createResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Resource", "updateResource", "resource", args.select, args.where.id, args.data, "UpdateResourceInput", "id", "resourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Resource', + 'updateResource', + 'resource', + args.select, + args.where.id, + args.data, + 'UpdateResourceInput', + 'id', + 'resourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "updateResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'updateResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Resource", "deleteResource", "resource", { - id: args.where.id - }, "DeleteResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Resource', + 'deleteResource', + 'resource', + { + id: args.where.id, + }, + 'DeleteResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "deleteResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'deleteResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourceDeclaredCapacity.ts b/sdk/constructive-cli/src/compute/orm/models/resourceDeclaredCapacity.ts index a41ff9e316..6340979a98 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourceDeclaredCapacity.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourceDeclaredCapacity.ts @@ -3,56 +3,98 @@ * @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 { ResourceDeclaredCapacity, ResourceDeclaredCapacityWithRelations, ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityFilter, ResourceDeclaredCapacityOrderBy, CreateResourceDeclaredCapacityInput, UpdateResourceDeclaredCapacityInput, ResourceDeclaredCapacityPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceDeclaredCapacity, + ResourceDeclaredCapacityWithRelations, + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy, + CreateResourceDeclaredCapacityInput, + UpdateResourceDeclaredCapacityInput, + ResourceDeclaredCapacityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceDeclaredCapacityModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceDeclaredCapacities: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDeclaredCapacity", "resourceDeclaredCapacities", 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 - }, "ResourceDeclaredCapacityFilter", "ResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceDeclaredCapacity', + 'resourceDeclaredCapacities', + 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, + }, + 'ResourceDeclaredCapacityFilter', + 'ResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDeclaredCapacity", - fieldName: "resourceDeclaredCapacities", + operation: 'query', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'resourceDeclaredCapacities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDeclaredCapacity: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceDeclaredCapacity", "resourceDeclaredCapacities", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceDeclaredCapacityFilter", "ResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceDeclaredCapacity', + 'resourceDeclaredCapacities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceDeclaredCapacityFilter', + 'ResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDeclaredCapacity", - fieldName: "resourceDeclaredCapacity", + operation: 'query', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'resourceDeclaredCapacity', document, variables, transform: (data: { @@ -60,28 +102,35 @@ export class ResourceDeclaredCapacityModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDeclaredCapacity": data.resourceDeclaredCapacities?.nodes?.[0] ?? null - }) + resourceDeclaredCapacity: data.resourceDeclaredCapacities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceDeclaredCapacity: { resourceDeclaredCapacity: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceDeclaredCapacity", "createResourceDeclaredCapacity", "resourceDeclaredCapacity", args.select, args.data, "CreateResourceDeclaredCapacityInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceDeclaredCapacity', + 'createResourceDeclaredCapacity', + 'resourceDeclaredCapacity', + args.select, + args.data, + 'CreateResourceDeclaredCapacityInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDeclaredCapacity", - fieldName: "createResourceDeclaredCapacity", + operation: 'mutation', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'createResourceDeclaredCapacity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourceDefinition.ts b/sdk/constructive-cli/src/compute/orm/models/resourceDefinition.ts index 3602f40743..26be134a8b 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourceDefinition.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourceDefinition.ts @@ -3,56 +3,96 @@ * @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 { ResourceDefinition, ResourceDefinitionWithRelations, ResourceDefinitionSelect, ResourceDefinitionFilter, ResourceDefinitionOrderBy, CreateResourceDefinitionInput, UpdateResourceDefinitionInput, ResourceDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceDefinition, + ResourceDefinitionWithRelations, + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy, + CreateResourceDefinitionInput, + UpdateResourceDefinitionInput, + ResourceDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDefinition", "resourceDefinitions", 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 - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceDefinition', + 'resourceDefinitions', + 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, + }, + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinitions", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceDefinition", "resourceDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceDefinition', + 'resourceDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinition", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDefinition": data.resourceDefinitions?.nodes?.[0] ?? null - }) + resourceDefinition: data.resourceDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDefinition", "resourceDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceDefinition', + 'resourceDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinition", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDefinition": data.resourceDefinitions?.nodes?.[0] ?? null - }) + resourceDefinition: data.resourceDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceDefinition", "createResourceDefinition", "resourceDefinition", args.select, args.data, "CreateResourceDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceDefinition', + 'createResourceDefinition', + 'resourceDefinition', + args.select, + args.data, + 'CreateResourceDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "createResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'createResourceDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceDefinition", "updateResourceDefinition", "resourceDefinition", args.select, args.where.id, args.data, "UpdateResourceDefinitionInput", "id", "resourceDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceDefinition', + 'updateResourceDefinition', + 'resourceDefinition', + args.select, + args.where.id, + args.data, + 'UpdateResourceDefinitionInput', + 'id', + 'resourceDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "updateResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'updateResourceDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceDefinition", "deleteResourceDefinition", "resourceDefinition", { - id: args.where.id - }, "DeleteResourceDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceDefinition', + 'deleteResourceDefinition', + 'resourceDefinition', + { + id: args.where.id, + }, + 'DeleteResourceDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "deleteResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'deleteResourceDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourceEvent.ts b/sdk/constructive-cli/src/compute/orm/models/resourceEvent.ts index f305a67427..9796098dc8 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourceEvent.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourceEvent.ts @@ -3,56 +3,96 @@ * @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 { ResourceEvent, ResourceEventWithRelations, ResourceEventSelect, ResourceEventFilter, ResourceEventOrderBy, CreateResourceEventInput, UpdateResourceEventInput, ResourceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceEvent, + ResourceEventWithRelations, + ResourceEventSelect, + ResourceEventFilter, + ResourceEventOrderBy, + CreateResourceEventInput, + UpdateResourceEventInput, + ResourceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceEvent", "resourceEvents", 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 - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceEvent', + 'resourceEvents', + 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, + }, + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvents", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceEvent", "resourceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceEvent', + 'resourceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvent", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceEvent": data.resourceEvents?.nodes?.[0] ?? null - }) + resourceEvent: data.resourceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceEvent", "resourceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceEvent', + 'resourceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvent", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class ResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceEvent": data.resourceEvents?.nodes?.[0] ?? null - }) + resourceEvent: data.resourceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceEvent", "createResourceEvent", "resourceEvent", args.select, args.data, "CreateResourceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceEvent', + 'createResourceEvent', + 'resourceEvent', + args.select, + args.data, + 'CreateResourceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "createResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'createResourceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + ResourceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceEvent", "updateResourceEvent", "resourceEvent", args.select, args.where.id, args.data, "UpdateResourceEventInput", "id", "resourceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceEvent', + 'updateResourceEvent', + 'resourceEvent', + args.select, + args.where.id, + args.data, + 'UpdateResourceEventInput', + 'id', + 'resourceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "updateResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'updateResourceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceEvent", "deleteResourceEvent", "resourceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteResourceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceEvent', + 'deleteResourceEvent', + 'resourceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteResourceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "deleteResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'deleteResourceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourceInstallation.ts b/sdk/constructive-cli/src/compute/orm/models/resourceInstallation.ts index 105f1b9ce5..dcdd64c3fd 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourceInstallation.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourceInstallation.ts @@ -3,56 +3,98 @@ * @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 { ResourceInstallation, ResourceInstallationWithRelations, ResourceInstallationSelect, ResourceInstallationFilter, ResourceInstallationOrderBy, CreateResourceInstallationInput, UpdateResourceInstallationInput, ResourceInstallationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceInstallation, + ResourceInstallationWithRelations, + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy, + CreateResourceInstallationInput, + UpdateResourceInstallationInput, + ResourceInstallationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceInstallationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceInstallations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceInstallations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceInstallation", "resourceInstallations", 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 - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceInstallation', + 'resourceInstallations', + 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, + }, + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallations", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceInstallation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceInstallation", "resourceInstallations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceInstallation', + 'resourceInstallations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallation", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallation', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceInstallation": data.resourceInstallations?.nodes?.[0] ?? null - }) + resourceInstallation: data.resourceInstallations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceInstallation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceInstallation", "resourceInstallations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceInstallation', + 'resourceInstallations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallation", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallation', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceInstallation": data.resourceInstallations?.nodes?.[0] ?? null - }) + resourceInstallation: data.resourceInstallations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceInstallation", "createResourceInstallation", "resourceInstallation", args.select, args.data, "CreateResourceInstallationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceInstallation', + 'createResourceInstallation', + 'resourceInstallation', + args.select, + args.data, + 'CreateResourceInstallationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "createResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'createResourceInstallation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceInstallationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceInstallation", "updateResourceInstallation", "resourceInstallation", args.select, args.where.id, args.data, "UpdateResourceInstallationInput", "id", "resourceInstallationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceInstallation', + 'updateResourceInstallation', + 'resourceInstallation', + args.select, + args.where.id, + args.data, + 'UpdateResourceInstallationInput', + 'id', + 'resourceInstallationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "updateResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'updateResourceInstallation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceInstallation", "deleteResourceInstallation", "resourceInstallation", { - id: args.where.id - }, "DeleteResourceInstallationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceInstallation', + 'deleteResourceInstallation', + 'resourceInstallation', + { + id: args.where.id, + }, + 'DeleteResourceInstallationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "deleteResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'deleteResourceInstallation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourceStatusCheck.ts b/sdk/constructive-cli/src/compute/orm/models/resourceStatusCheck.ts index 31433f3673..e7241931ee 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourceStatusCheck.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourceStatusCheck.ts @@ -3,56 +3,96 @@ * @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 { ResourceStatusCheck, ResourceStatusCheckWithRelations, ResourceStatusCheckSelect, ResourceStatusCheckFilter, ResourceStatusCheckOrderBy, CreateResourceStatusCheckInput, UpdateResourceStatusCheckInput, ResourceStatusCheckPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceStatusCheck, + ResourceStatusCheckWithRelations, + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy, + CreateResourceStatusCheckInput, + UpdateResourceStatusCheckInput, + ResourceStatusCheckPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceStatusCheckModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusChecks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceStatusCheck", "resourceStatusChecks", 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 - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + 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, + }, + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusChecks", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusChecks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusCheck: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceStatusCheck", "resourceStatusChecks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusCheck", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusCheck', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceStatusCheck": data.resourceStatusChecks?.nodes?.[0] ?? null - }) + resourceStatusCheck: data.resourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusCheck: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceStatusCheck", "resourceStatusChecks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusCheck", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusCheck', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceStatusCheck": data.resourceStatusChecks?.nodes?.[0] ?? null - }) + resourceStatusCheck: data.resourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceStatusCheck", "createResourceStatusCheck", "resourceStatusCheck", args.select, args.data, "CreateResourceStatusCheckInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceStatusCheck', + 'createResourceStatusCheck', + 'resourceStatusCheck', + args.select, + args.data, + 'CreateResourceStatusCheckInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "createResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'createResourceStatusCheck', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceStatusCheckPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceStatusCheck", "updateResourceStatusCheck", "resourceStatusCheck", args.select, args.where.id, args.data, "UpdateResourceStatusCheckInput", "id", "resourceStatusCheckPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceStatusCheck', + 'updateResourceStatusCheck', + 'resourceStatusCheck', + args.select, + args.where.id, + args.data, + 'UpdateResourceStatusCheckInput', + 'id', + 'resourceStatusCheckPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "updateResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'updateResourceStatusCheck', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceStatusCheck", "deleteResourceStatusCheck", "resourceStatusCheck", { - id: args.where.id - }, "DeleteResourceStatusCheckInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceStatusCheck', + 'deleteResourceStatusCheck', + 'resourceStatusCheck', + { + id: args.where.id, + }, + 'DeleteResourceStatusCheckInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "deleteResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'deleteResourceStatusCheck', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourceUsageLog.ts b/sdk/constructive-cli/src/compute/orm/models/resourceUsageLog.ts index fe263b008f..d5f3f5c79a 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourceUsageLog.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourceUsageLog.ts @@ -3,56 +3,96 @@ * @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 { ResourceUsageLog, ResourceUsageLogWithRelations, ResourceUsageLogSelect, ResourceUsageLogFilter, ResourceUsageLogOrderBy, CreateResourceUsageLogInput, UpdateResourceUsageLogInput, ResourceUsageLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUsageLog, + ResourceUsageLogWithRelations, + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy, + CreateResourceUsageLogInput, + UpdateResourceUsageLogInput, + ResourceUsageLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUsageLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLogs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageLog", "resourceUsageLogs", 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 - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + 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, + }, + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLogs", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUsageLog", "resourceUsageLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLog", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLog', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageLog": data.resourceUsageLogs?.nodes?.[0] ?? null - }) + resourceUsageLog: data.resourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageLog", "resourceUsageLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLog", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLog', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class ResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageLog": data.resourceUsageLogs?.nodes?.[0] ?? null - }) + resourceUsageLog: data.resourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUsageLog", "createResourceUsageLog", "resourceUsageLog", args.select, args.data, "CreateResourceUsageLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUsageLog', + 'createResourceUsageLog', + 'resourceUsageLog', + args.select, + args.data, + 'CreateResourceUsageLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "createResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'createResourceUsageLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + sampledAt: string; + }, + ResourceUsageLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceUsageLog", "updateResourceUsageLog", "resourceUsageLog", args.select, args.where.id, args.data, "UpdateResourceUsageLogInput", "id", "resourceUsageLogPatch", connectionFieldsMap, { - sampledAt: args.where.sampledAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceUsageLog', + 'updateResourceUsageLog', + 'resourceUsageLog', + args.select, + args.where.id, + args.data, + 'UpdateResourceUsageLogInput', + 'id', + 'resourceUsageLogPatch', + connectionFieldsMap, + { + sampledAt: args.where.sampledAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "updateResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'updateResourceUsageLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - sampledAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + sampledAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceUsageLog", "deleteResourceUsageLog", "resourceUsageLog", { - id: args.where.id, - sampledAt: args.where.sampledAt - }, "DeleteResourceUsageLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceUsageLog', + 'deleteResourceUsageLog', + 'resourceUsageLog', + { + id: args.where.id, + sampledAt: args.where.sampledAt, + }, + 'DeleteResourceUsageLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "deleteResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'deleteResourceUsageLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourceUsageSummary.ts b/sdk/constructive-cli/src/compute/orm/models/resourceUsageSummary.ts index c4155013d3..3024a18d37 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourceUsageSummary.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourceUsageSummary.ts @@ -3,56 +3,98 @@ * @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 { ResourceUsageSummary, ResourceUsageSummaryWithRelations, ResourceUsageSummarySelect, ResourceUsageSummaryFilter, ResourceUsageSummaryOrderBy, CreateResourceUsageSummaryInput, UpdateResourceUsageSummaryInput, ResourceUsageSummaryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUsageSummary, + ResourceUsageSummaryWithRelations, + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy, + CreateResourceUsageSummaryInput, + UpdateResourceUsageSummaryInput, + ResourceUsageSummaryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUsageSummaryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceUsageSummaries: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceUsageSummaries: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageSummary", "resourceUsageSummaries", 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 - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + 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, + }, + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummaries", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummaries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageSummary: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUsageSummary", "resourceUsageSummaries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummary", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummary', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageSummary": data.resourceUsageSummaries?.nodes?.[0] ?? null - }) + resourceUsageSummary: data.resourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageSummary: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageSummary", "resourceUsageSummaries", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummary", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummary', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class ResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageSummary": data.resourceUsageSummaries?.nodes?.[0] ?? null - }) + resourceUsageSummary: data.resourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUsageSummary", "createResourceUsageSummary", "resourceUsageSummary", args.select, args.data, "CreateResourceUsageSummaryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUsageSummary', + 'createResourceUsageSummary', + 'resourceUsageSummary', + args.select, + args.data, + 'CreateResourceUsageSummaryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "createResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'createResourceUsageSummary', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + date: string; + }, + ResourceUsageSummaryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceUsageSummary", "updateResourceUsageSummary", "resourceUsageSummary", args.select, args.where.id, args.data, "UpdateResourceUsageSummaryInput", "id", "resourceUsageSummaryPatch", connectionFieldsMap, { - date: args.where.date - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceUsageSummary', + 'updateResourceUsageSummary', + 'resourceUsageSummary', + args.select, + args.where.id, + args.data, + 'UpdateResourceUsageSummaryInput', + 'id', + 'resourceUsageSummaryPatch', + connectionFieldsMap, + { + date: args.where.date, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "updateResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'updateResourceUsageSummary', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - date: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + date: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceUsageSummary", "deleteResourceUsageSummary", "resourceUsageSummary", { - id: args.where.id, - date: args.where.date - }, "DeleteResourceUsageSummaryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceUsageSummary', + 'deleteResourceUsageSummary', + 'resourceUsageSummary', + { + id: args.where.id, + date: args.where.date, + }, + 'DeleteResourceUsageSummaryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "deleteResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'deleteResourceUsageSummary', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourceUtilization.ts b/sdk/constructive-cli/src/compute/orm/models/resourceUtilization.ts index 9314102ed0..3620486000 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourceUtilization.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourceUtilization.ts @@ -3,56 +3,96 @@ * @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 { ResourceUtilization, ResourceUtilizationWithRelations, ResourceUtilizationSelect, ResourceUtilizationFilter, ResourceUtilizationOrderBy, CreateResourceUtilizationInput, UpdateResourceUtilizationInput, ResourceUtilizationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUtilization, + ResourceUtilizationWithRelations, + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy, + CreateResourceUtilizationInput, + UpdateResourceUtilizationInput, + ResourceUtilizationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUtilizationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUtilizations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUtilization", "resourceUtilizations", 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 - }, "ResourceUtilizationFilter", "ResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUtilization', + 'resourceUtilizations', + 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, + }, + 'ResourceUtilizationFilter', + 'ResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUtilization", - fieldName: "resourceUtilizations", + operation: 'query', + operationName: 'ResourceUtilization', + fieldName: 'resourceUtilizations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUtilization: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUtilization", "resourceUtilizations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUtilizationFilter", "ResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUtilization', + 'resourceUtilizations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUtilizationFilter', + 'ResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUtilization", - fieldName: "resourceUtilization", + operation: 'query', + operationName: 'ResourceUtilization', + fieldName: 'resourceUtilization', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class ResourceUtilizationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUtilization": data.resourceUtilizations?.nodes?.[0] ?? null - }) + resourceUtilization: data.resourceUtilizations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUtilization: { resourceUtilization: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUtilization", "createResourceUtilization", "resourceUtilization", args.select, args.data, "CreateResourceUtilizationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUtilization', + 'createResourceUtilization', + 'resourceUtilization', + args.select, + args.data, + 'CreateResourceUtilizationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUtilization", - fieldName: "createResourceUtilization", + operation: 'mutation', + operationName: 'ResourceUtilization', + fieldName: 'createResourceUtilization', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourcesHealth.ts b/sdk/constructive-cli/src/compute/orm/models/resourcesHealth.ts index 5e4515d396..1ac97bab3d 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourcesHealth.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourcesHealth.ts @@ -3,56 +3,96 @@ * @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 { ResourcesHealth, ResourcesHealthWithRelations, ResourcesHealthSelect, ResourcesHealthFilter, ResourcesHealthOrderBy, CreateResourcesHealthInput, UpdateResourcesHealthInput, ResourcesHealthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesHealth, + ResourcesHealthWithRelations, + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy, + CreateResourcesHealthInput, + UpdateResourcesHealthInput, + ResourcesHealthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesHealthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealths: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesHealth", "resourcesHealths", 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 - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesHealth', + 'resourcesHealths', + 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, + }, + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealths", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesHealth", "resourcesHealths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesHealth', + 'resourcesHealths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealth", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealth', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesHealth": data.resourcesHealths?.nodes?.[0] ?? null - }) + resourcesHealth: data.resourcesHealths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesHealth", "resourcesHealths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourcesHealth', + 'resourcesHealths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealth", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealth', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class ResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesHealth": data.resourcesHealths?.nodes?.[0] ?? null - }) + resourcesHealth: data.resourcesHealths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesHealth: { resourcesHealth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesHealth", "createResourcesHealth", "resourcesHealth", args.select, args.data, "CreateResourcesHealthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesHealth', + 'createResourcesHealth', + 'resourcesHealth', + args.select, + args.data, + 'CreateResourcesHealthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesHealth", - fieldName: "createResourcesHealth", + operation: 'mutation', + operationName: 'ResourcesHealth', + fieldName: 'createResourcesHealth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourcesRequirementsState.ts b/sdk/constructive-cli/src/compute/orm/models/resourcesRequirementsState.ts index f1a5f93c93..8ce68f6a31 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourcesRequirementsState.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourcesRequirementsState.ts @@ -3,56 +3,101 @@ * @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 { ResourcesRequirementsState, ResourcesRequirementsStateWithRelations, ResourcesRequirementsStateSelect, ResourcesRequirementsStateFilter, ResourcesRequirementsStateOrderBy, CreateResourcesRequirementsStateInput, UpdateResourcesRequirementsStateInput, ResourcesRequirementsStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesRequirementsState, + ResourcesRequirementsStateWithRelations, + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy, + CreateResourcesRequirementsStateInput, + UpdateResourcesRequirementsStateInput, + ResourcesRequirementsStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesRequirementsStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesRequirementsStates: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesRequirementsState", "resourcesRequirementsStates", 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 - }, "ResourcesRequirementsStateFilter", "ResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesRequirementsState', + 'resourcesRequirementsStates', + 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, + }, + 'ResourcesRequirementsStateFilter', + 'ResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesRequirementsState", - fieldName: "resourcesRequirementsStates", + operation: 'query', + operationName: 'ResourcesRequirementsState', + fieldName: 'resourcesRequirementsStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesRequirementsState: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesRequirementsState: InferSelectResult< + ResourcesRequirementsStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesRequirementsState", "resourcesRequirementsStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesRequirementsStateFilter", "ResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesRequirementsState', + 'resourcesRequirementsStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesRequirementsStateFilter', + 'ResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesRequirementsState", - fieldName: "resourcesRequirementsState", + operation: 'query', + operationName: 'ResourcesRequirementsState', + fieldName: 'resourcesRequirementsState', document, variables, transform: (data: { @@ -60,28 +105,35 @@ export class ResourcesRequirementsStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesRequirementsState": data.resourcesRequirementsStates?.nodes?.[0] ?? null - }) + resourcesRequirementsState: data.resourcesRequirementsStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesRequirementsState: { resourcesRequirementsState: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesRequirementsState", "createResourcesRequirementsState", "resourcesRequirementsState", args.select, args.data, "CreateResourcesRequirementsStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesRequirementsState', + 'createResourcesRequirementsState', + 'resourcesRequirementsState', + args.select, + args.data, + 'CreateResourcesRequirementsStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesRequirementsState", - fieldName: "createResourcesRequirementsState", + operation: 'mutation', + operationName: 'ResourcesRequirementsState', + fieldName: 'createResourcesRequirementsState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/resourcesResolvedRequirement.ts b/sdk/constructive-cli/src/compute/orm/models/resourcesResolvedRequirement.ts index 4f46896bdc..40680dcfb3 100644 --- a/sdk/constructive-cli/src/compute/orm/models/resourcesResolvedRequirement.ts +++ b/sdk/constructive-cli/src/compute/orm/models/resourcesResolvedRequirement.ts @@ -3,56 +3,109 @@ * @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 { ResourcesResolvedRequirement, ResourcesResolvedRequirementWithRelations, ResourcesResolvedRequirementSelect, ResourcesResolvedRequirementFilter, ResourcesResolvedRequirementOrderBy, CreateResourcesResolvedRequirementInput, UpdateResourcesResolvedRequirementInput, ResourcesResolvedRequirementPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesResolvedRequirement, + ResourcesResolvedRequirementWithRelations, + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy, + CreateResourcesResolvedRequirementInput, + UpdateResourcesResolvedRequirementInput, + ResourcesResolvedRequirementPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesResolvedRequirementModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesResolvedRequirements: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesResolvedRequirement", "resourcesResolvedRequirements", 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 - }, "ResourcesResolvedRequirementFilter", "ResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesResolvedRequirement', + 'resourcesResolvedRequirements', + 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, + }, + 'ResourcesResolvedRequirementFilter', + 'ResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesResolvedRequirement", - fieldName: "resourcesResolvedRequirements", + operation: 'query', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'resourcesResolvedRequirements', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesResolvedRequirement: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesResolvedRequirement: InferSelectResult< + ResourcesResolvedRequirementWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesResolvedRequirement", "resourcesResolvedRequirements", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesResolvedRequirementFilter", "ResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesResolvedRequirement', + 'resourcesResolvedRequirements', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesResolvedRequirementFilter', + 'ResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesResolvedRequirement", - fieldName: "resourcesResolvedRequirement", + operation: 'query', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'resourcesResolvedRequirement', document, variables, transform: (data: { @@ -60,28 +113,35 @@ export class ResourcesResolvedRequirementModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesResolvedRequirement": data.resourcesResolvedRequirements?.nodes?.[0] ?? null - }) + resourcesResolvedRequirement: data.resourcesResolvedRequirements?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesResolvedRequirement: { resourcesResolvedRequirement: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesResolvedRequirement", "createResourcesResolvedRequirement", "resourcesResolvedRequirement", args.select, args.data, "CreateResourcesResolvedRequirementInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesResolvedRequirement', + 'createResourcesResolvedRequirement', + 'resourcesResolvedRequirement', + args.select, + args.data, + 'CreateResourcesResolvedRequirementInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesResolvedRequirement", - fieldName: "createResourcesResolvedRequirement", + operation: 'mutation', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'createResourcesResolvedRequirement', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/webhookEndpoint.ts b/sdk/constructive-cli/src/compute/orm/models/webhookEndpoint.ts index 844febe287..a76f34249c 100644 --- a/sdk/constructive-cli/src/compute/orm/models/webhookEndpoint.ts +++ b/sdk/constructive-cli/src/compute/orm/models/webhookEndpoint.ts @@ -3,56 +3,96 @@ * @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 { WebhookEndpoint, WebhookEndpointWithRelations, WebhookEndpointSelect, WebhookEndpointFilter, WebhookEndpointOrderBy, CreateWebhookEndpointInput, UpdateWebhookEndpointInput, WebhookEndpointPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookEndpoint, + WebhookEndpointWithRelations, + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy, + CreateWebhookEndpointInput, + UpdateWebhookEndpointInput, + WebhookEndpointPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookEndpointModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEndpoint", "webhookEndpoints", 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 - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + 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, + }, + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoints", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookEndpoint", "webhookEndpoints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoint", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEndpoint": data.webhookEndpoints?.nodes?.[0] ?? null - }) + webhookEndpoint: data.webhookEndpoints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEndpoint", "webhookEndpoints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoint", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEndpoint": data.webhookEndpoints?.nodes?.[0] ?? null - }) + webhookEndpoint: data.webhookEndpoints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookEndpoint", "createWebhookEndpoint", "webhookEndpoint", args.select, args.data, "CreateWebhookEndpointInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookEndpoint', + 'createWebhookEndpoint', + 'webhookEndpoint', + args.select, + args.data, + 'CreateWebhookEndpointInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "createWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'createWebhookEndpoint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookEndpointPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookEndpoint", "updateWebhookEndpoint", "webhookEndpoint", args.select, args.where.id, args.data, "UpdateWebhookEndpointInput", "id", "webhookEndpointPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookEndpoint', + 'updateWebhookEndpoint', + 'webhookEndpoint', + args.select, + args.where.id, + args.data, + 'UpdateWebhookEndpointInput', + 'id', + 'webhookEndpointPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "updateWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'updateWebhookEndpoint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookEndpoint", "deleteWebhookEndpoint", "webhookEndpoint", { - id: args.where.id - }, "DeleteWebhookEndpointInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookEndpoint', + 'deleteWebhookEndpoint', + 'webhookEndpoint', + { + id: args.where.id, + }, + 'DeleteWebhookEndpointInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "deleteWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'deleteWebhookEndpoint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/models/webhookEvent.ts b/sdk/constructive-cli/src/compute/orm/models/webhookEvent.ts index c4651cd89e..0a52d397e3 100644 --- a/sdk/constructive-cli/src/compute/orm/models/webhookEvent.ts +++ b/sdk/constructive-cli/src/compute/orm/models/webhookEvent.ts @@ -3,56 +3,96 @@ * @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 { WebhookEvent, WebhookEventWithRelations, WebhookEventSelect, WebhookEventFilter, WebhookEventOrderBy, CreateWebhookEventInput, UpdateWebhookEventInput, WebhookEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookEvent, + WebhookEventWithRelations, + WebhookEventSelect, + WebhookEventFilter, + WebhookEventOrderBy, + CreateWebhookEventInput, + UpdateWebhookEventInput, + WebhookEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEvent", "webhookEvents", 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 - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookEvent', + 'webhookEvents', + 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, + }, + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvents", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookEvent", "webhookEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookEvent', + 'webhookEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvent", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEvent": data.webhookEvents?.nodes?.[0] ?? null - }) + webhookEvent: data.webhookEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEvent", "webhookEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookEvent', + 'webhookEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvent", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEvent": data.webhookEvents?.nodes?.[0] ?? null - }) + webhookEvent: data.webhookEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookEvent", "createWebhookEvent", "webhookEvent", args.select, args.data, "CreateWebhookEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookEvent', + 'createWebhookEvent', + 'webhookEvent', + args.select, + args.data, + 'CreateWebhookEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "createWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'createWebhookEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookEvent", "updateWebhookEvent", "webhookEvent", args.select, args.where.id, args.data, "UpdateWebhookEventInput", "id", "webhookEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookEvent', + 'updateWebhookEvent', + 'webhookEvent', + args.select, + args.where.id, + args.data, + 'UpdateWebhookEventInput', + 'id', + 'webhookEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "updateWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'updateWebhookEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookEvent", "deleteWebhookEvent", "webhookEvent", { - id: args.where.id - }, "DeleteWebhookEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookEvent', + 'deleteWebhookEvent', + 'webhookEvent', + { + id: args.where.id, + }, + 'DeleteWebhookEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "deleteWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'deleteWebhookEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/mutation/index.ts b/sdk/constructive-cli/src/compute/orm/mutation/index.ts index c65d39c17a..c5bc975047 100644 --- a/sdk/constructive-cli/src/compute/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/compute/orm/mutation/index.ts @@ -3,11 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AddEdgeInput, AddEdgeAndSaveInput, AddNodeInput, AddNodeAndSaveInput, CopyGraphInput, ImportDefinitionsInput, ImportGraphJsonInput, InfraInitEmptyRepoInput, InfraInsertNodeAtPathInput, InfraSetDataAtPathInput, InitEmptyRepoInput, InsertNodeAtPathInput, PlatformInfraInitEmptyRepoInput, PlatformInfraInsertNodeAtPathInput, PlatformInfraSetDataAtPathInput, PlatformResourceInstallationsInstallInput, PlatformResourceInstallationsRollbackInput, PlatformResourceInstallationsUninstallInput, PlatformResourceInstallationsUpgradeInput, ProvisionBucketInput, ResourceInstallationsInstallInput, ResourceInstallationsRollbackInput, ResourceInstallationsUninstallInput, ResourceInstallationsUpgradeInput, SaveGraphInput, SetDataAtPathInput, StartExecutionInput, ValidateFunctionGraphInput, AddEdgePayload, AddEdgeAndSavePayload, AddNodePayload, AddNodeAndSavePayload, CopyGraphPayload, ImportDefinitionsPayload, ImportGraphJsonPayload, InfraInitEmptyRepoPayload, InfraInsertNodeAtPathPayload, InfraSetDataAtPathPayload, InitEmptyRepoPayload, InsertNodeAtPathPayload, PlatformInfraInitEmptyRepoPayload, PlatformInfraInsertNodeAtPathPayload, PlatformInfraSetDataAtPathPayload, PlatformResourceInstallationsInstallPayload, PlatformResourceInstallationsRollbackPayload, PlatformResourceInstallationsUninstallPayload, PlatformResourceInstallationsUpgradePayload, ProvisionBucketPayload, ResourceInstallationsInstallPayload, ResourceInstallationsRollbackPayload, ResourceInstallationsUninstallPayload, ResourceInstallationsUpgradePayload, SaveGraphPayload, SetDataAtPathPayload, StartExecutionPayload, ValidateFunctionGraphPayload, AddEdgePayloadSelect, AddEdgeAndSavePayloadSelect, AddNodePayloadSelect, AddNodeAndSavePayloadSelect, CopyGraphPayloadSelect, ImportDefinitionsPayloadSelect, ImportGraphJsonPayloadSelect, InfraInitEmptyRepoPayloadSelect, InfraInsertNodeAtPathPayloadSelect, InfraSetDataAtPathPayloadSelect, InitEmptyRepoPayloadSelect, InsertNodeAtPathPayloadSelect, PlatformInfraInitEmptyRepoPayloadSelect, PlatformInfraInsertNodeAtPathPayloadSelect, PlatformInfraSetDataAtPathPayloadSelect, PlatformResourceInstallationsInstallPayloadSelect, PlatformResourceInstallationsRollbackPayloadSelect, PlatformResourceInstallationsUninstallPayloadSelect, PlatformResourceInstallationsUpgradePayloadSelect, ProvisionBucketPayloadSelect, ResourceInstallationsInstallPayloadSelect, ResourceInstallationsRollbackPayloadSelect, ResourceInstallationsUninstallPayloadSelect, ResourceInstallationsUpgradePayloadSelect, SaveGraphPayloadSelect, SetDataAtPathPayloadSelect, StartExecutionPayloadSelect, ValidateFunctionGraphPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + AddEdgeInput, + AddEdgeAndSaveInput, + AddNodeInput, + AddNodeAndSaveInput, + CopyGraphInput, + ImportDefinitionsInput, + ImportGraphJsonInput, + InfraInitEmptyRepoInput, + InfraInsertNodeAtPathInput, + InfraSetDataAtPathInput, + InitEmptyRepoInput, + InsertNodeAtPathInput, + PlatformInfraInitEmptyRepoInput, + PlatformInfraInsertNodeAtPathInput, + PlatformInfraSetDataAtPathInput, + PlatformResourceInstallationsInstallInput, + PlatformResourceInstallationsRollbackInput, + PlatformResourceInstallationsUninstallInput, + PlatformResourceInstallationsUpgradeInput, + ProvisionBucketInput, + ResourceInstallationsInstallInput, + ResourceInstallationsRollbackInput, + ResourceInstallationsUninstallInput, + ResourceInstallationsUpgradeInput, + SaveGraphInput, + SetDataAtPathInput, + StartExecutionInput, + ValidateFunctionGraphInput, + AddEdgePayload, + AddEdgeAndSavePayload, + AddNodePayload, + AddNodeAndSavePayload, + CopyGraphPayload, + ImportDefinitionsPayload, + ImportGraphJsonPayload, + InfraInitEmptyRepoPayload, + InfraInsertNodeAtPathPayload, + InfraSetDataAtPathPayload, + InitEmptyRepoPayload, + InsertNodeAtPathPayload, + PlatformInfraInitEmptyRepoPayload, + PlatformInfraInsertNodeAtPathPayload, + PlatformInfraSetDataAtPathPayload, + PlatformResourceInstallationsInstallPayload, + PlatformResourceInstallationsRollbackPayload, + PlatformResourceInstallationsUninstallPayload, + PlatformResourceInstallationsUpgradePayload, + ProvisionBucketPayload, + ResourceInstallationsInstallPayload, + ResourceInstallationsRollbackPayload, + ResourceInstallationsUninstallPayload, + ResourceInstallationsUpgradePayload, + SaveGraphPayload, + SetDataAtPathPayload, + StartExecutionPayload, + ValidateFunctionGraphPayload, + AddEdgePayloadSelect, + AddEdgeAndSavePayloadSelect, + AddNodePayloadSelect, + AddNodeAndSavePayloadSelect, + CopyGraphPayloadSelect, + ImportDefinitionsPayloadSelect, + ImportGraphJsonPayloadSelect, + InfraInitEmptyRepoPayloadSelect, + InfraInsertNodeAtPathPayloadSelect, + InfraSetDataAtPathPayloadSelect, + InitEmptyRepoPayloadSelect, + InsertNodeAtPathPayloadSelect, + PlatformInfraInitEmptyRepoPayloadSelect, + PlatformInfraInsertNodeAtPathPayloadSelect, + PlatformInfraSetDataAtPathPayloadSelect, + PlatformResourceInstallationsInstallPayloadSelect, + PlatformResourceInstallationsRollbackPayloadSelect, + PlatformResourceInstallationsUninstallPayloadSelect, + PlatformResourceInstallationsUpgradePayloadSelect, + ProvisionBucketPayloadSelect, + ResourceInstallationsInstallPayloadSelect, + ResourceInstallationsRollbackPayloadSelect, + ResourceInstallationsUninstallPayloadSelect, + ResourceInstallationsUpgradePayloadSelect, + SaveGraphPayloadSelect, + SetDataAtPathPayloadSelect, + StartExecutionPayloadSelect, + ValidateFunctionGraphPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AddEdgeVariables { input: AddEdgeInput; } @@ -101,397 +186,852 @@ export interface ValidateFunctionGraphVariables { } export function createMutationOperations(client: OrmClient) { return { - addEdge: (args: AddEdgeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addEdge: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddEdge", - fieldName: "addEdge", - ...buildCustomDocument("mutation", "AddEdge", "addEdge", options.select, args, [{ - name: "input", - type: "AddEdgeInput!" - }], connectionFieldsMap, "AddEdgePayload") - }), - addEdgeAndSave: (args: AddEdgeAndSaveVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addEdgeAndSave: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddEdgeAndSave", - fieldName: "addEdgeAndSave", - ...buildCustomDocument("mutation", "AddEdgeAndSave", "addEdgeAndSave", options.select, args, [{ - name: "input", - type: "AddEdgeAndSaveInput!" - }], connectionFieldsMap, "AddEdgeAndSavePayload") - }), - addNode: (args: AddNodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addNode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddNode", - fieldName: "addNode", - ...buildCustomDocument("mutation", "AddNode", "addNode", options.select, args, [{ - name: "input", - type: "AddNodeInput!" - }], connectionFieldsMap, "AddNodePayload") - }), - addNodeAndSave: (args: AddNodeAndSaveVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addNodeAndSave: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddNodeAndSave", - fieldName: "addNodeAndSave", - ...buildCustomDocument("mutation", "AddNodeAndSave", "addNodeAndSave", options.select, args, [{ - name: "input", - type: "AddNodeAndSaveInput!" - }], connectionFieldsMap, "AddNodeAndSavePayload") - }), - copyGraph: (args: CopyGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - copyGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CopyGraph", - fieldName: "copyGraph", - ...buildCustomDocument("mutation", "CopyGraph", "copyGraph", options.select, args, [{ - name: "input", - type: "CopyGraphInput!" - }], connectionFieldsMap, "CopyGraphPayload") - }), - importDefinitions: (args: ImportDefinitionsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - importDefinitions: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ImportDefinitions", - fieldName: "importDefinitions", - ...buildCustomDocument("mutation", "ImportDefinitions", "importDefinitions", options.select, args, [{ - name: "input", - type: "ImportDefinitionsInput!" - }], connectionFieldsMap, "ImportDefinitionsPayload") - }), - 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") - }), - infraInitEmptyRepo: (args: InfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraInitEmptyRepo", - fieldName: "infraInitEmptyRepo", - ...buildCustomDocument("mutation", "InfraInitEmptyRepo", "infraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "InfraInitEmptyRepoInput!" - }], connectionFieldsMap, "InfraInitEmptyRepoPayload") - }), - infraInsertNodeAtPath: (args: InfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraInsertNodeAtPath", - fieldName: "infraInsertNodeAtPath", - ...buildCustomDocument("mutation", "InfraInsertNodeAtPath", "infraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "InfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "InfraInsertNodeAtPathPayload") - }), - infraSetDataAtPath: (args: InfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraSetDataAtPath", - fieldName: "infraSetDataAtPath", - ...buildCustomDocument("mutation", "InfraSetDataAtPath", "infraSetDataAtPath", options.select, args, [{ - name: "input", - type: "InfraSetDataAtPathInput!" - }], connectionFieldsMap, "InfraSetDataAtPathPayload") - }), - initEmptyRepo: (args: InitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - initEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InitEmptyRepo", - fieldName: "initEmptyRepo", - ...buildCustomDocument("mutation", "InitEmptyRepo", "initEmptyRepo", options.select, args, [{ - name: "input", - type: "InitEmptyRepoInput!" - }], connectionFieldsMap, "InitEmptyRepoPayload") - }), - insertNodeAtPath: (args: InsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - insertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InsertNodeAtPath", - fieldName: "insertNodeAtPath", - ...buildCustomDocument("mutation", "InsertNodeAtPath", "insertNodeAtPath", options.select, args, [{ - name: "input", - type: "InsertNodeAtPathInput!" - }], connectionFieldsMap, "InsertNodeAtPathPayload") - }), - platformInfraInitEmptyRepo: (args: PlatformInfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInitEmptyRepo", - fieldName: "platformInfraInitEmptyRepo", - ...buildCustomDocument("mutation", "PlatformInfraInitEmptyRepo", "platformInfraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "PlatformInfraInitEmptyRepoInput!" - }], connectionFieldsMap, "PlatformInfraInitEmptyRepoPayload") - }), - platformInfraInsertNodeAtPath: (args: PlatformInfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInsertNodeAtPath", - fieldName: "platformInfraInsertNodeAtPath", - ...buildCustomDocument("mutation", "PlatformInfraInsertNodeAtPath", "platformInfraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "PlatformInfraInsertNodeAtPathPayload") - }), - platformInfraSetDataAtPath: (args: PlatformInfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraSetDataAtPath", - fieldName: "platformInfraSetDataAtPath", - ...buildCustomDocument("mutation", "PlatformInfraSetDataAtPath", "platformInfraSetDataAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraSetDataAtPathInput!" - }], connectionFieldsMap, "PlatformInfraSetDataAtPathPayload") - }), - platformResourceInstallationsInstall: (args: PlatformResourceInstallationsInstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsInstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsInstall", - fieldName: "platformResourceInstallationsInstall", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsInstall", "platformResourceInstallationsInstall", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsInstallInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsInstallPayload") - }), - platformResourceInstallationsRollback: (args: PlatformResourceInstallationsRollbackVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsRollback: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsRollback", - fieldName: "platformResourceInstallationsRollback", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsRollback", "platformResourceInstallationsRollback", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsRollbackInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsRollbackPayload") - }), - platformResourceInstallationsUninstall: (args: PlatformResourceInstallationsUninstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsUninstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsUninstall", - fieldName: "platformResourceInstallationsUninstall", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsUninstall", "platformResourceInstallationsUninstall", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsUninstallInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsUninstallPayload") - }), - platformResourceInstallationsUpgrade: (args: PlatformResourceInstallationsUpgradeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsUpgrade: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsUpgrade", - fieldName: "platformResourceInstallationsUpgrade", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsUpgrade", "platformResourceInstallationsUpgrade", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsUpgradeInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsUpgradePayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - resourceInstallationsInstall: (args: ResourceInstallationsInstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsInstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsInstall", - fieldName: "resourceInstallationsInstall", - ...buildCustomDocument("mutation", "ResourceInstallationsInstall", "resourceInstallationsInstall", options.select, args, [{ - name: "input", - type: "ResourceInstallationsInstallInput!" - }], connectionFieldsMap, "ResourceInstallationsInstallPayload") - }), - resourceInstallationsRollback: (args: ResourceInstallationsRollbackVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsRollback: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsRollback", - fieldName: "resourceInstallationsRollback", - ...buildCustomDocument("mutation", "ResourceInstallationsRollback", "resourceInstallationsRollback", options.select, args, [{ - name: "input", - type: "ResourceInstallationsRollbackInput!" - }], connectionFieldsMap, "ResourceInstallationsRollbackPayload") - }), - resourceInstallationsUninstall: (args: ResourceInstallationsUninstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsUninstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsUninstall", - fieldName: "resourceInstallationsUninstall", - ...buildCustomDocument("mutation", "ResourceInstallationsUninstall", "resourceInstallationsUninstall", options.select, args, [{ - name: "input", - type: "ResourceInstallationsUninstallInput!" - }], connectionFieldsMap, "ResourceInstallationsUninstallPayload") - }), - resourceInstallationsUpgrade: (args: ResourceInstallationsUpgradeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsUpgrade: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsUpgrade", - fieldName: "resourceInstallationsUpgrade", - ...buildCustomDocument("mutation", "ResourceInstallationsUpgrade", "resourceInstallationsUpgrade", options.select, args, [{ - name: "input", - type: "ResourceInstallationsUpgradeInput!" - }], connectionFieldsMap, "ResourceInstallationsUpgradePayload") - }), - saveGraph: (args: SaveGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - saveGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SaveGraph", - fieldName: "saveGraph", - ...buildCustomDocument("mutation", "SaveGraph", "saveGraph", options.select, args, [{ - name: "input", - type: "SaveGraphInput!" - }], connectionFieldsMap, "SaveGraphPayload") - }), - setDataAtPath: (args: SetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetDataAtPath", - fieldName: "setDataAtPath", - ...buildCustomDocument("mutation", "SetDataAtPath", "setDataAtPath", options.select, args, [{ - name: "input", - type: "SetDataAtPathInput!" - }], connectionFieldsMap, "SetDataAtPathPayload") - }), - startExecution: (args: StartExecutionVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - startExecution: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "StartExecution", - fieldName: "startExecution", - ...buildCustomDocument("mutation", "StartExecution", "startExecution", options.select, args, [{ - name: "input", - type: "StartExecutionInput!" - }], connectionFieldsMap, "StartExecutionPayload") - }), - validateFunctionGraph: (args: ValidateFunctionGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - validateFunctionGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ValidateFunctionGraph", - fieldName: "validateFunctionGraph", - ...buildCustomDocument("mutation", "ValidateFunctionGraph", "validateFunctionGraph", options.select, args, [{ - name: "input", - type: "ValidateFunctionGraphInput!" - }], connectionFieldsMap, "ValidateFunctionGraphPayload") - }) + addEdge: ( + args: AddEdgeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdge: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdge', + fieldName: 'addEdge', + ...buildCustomDocument( + 'mutation', + 'AddEdge', + 'addEdge', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeInput!', + }, + ], + connectionFieldsMap, + 'AddEdgePayload' + ), + }), + addEdgeAndSave: ( + args: AddEdgeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdgeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdgeAndSave', + fieldName: 'addEdgeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddEdgeAndSave', + 'addEdgeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddEdgeAndSavePayload' + ), + }), + addNode: ( + args: AddNodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNode', + fieldName: 'addNode', + ...buildCustomDocument( + 'mutation', + 'AddNode', + 'addNode', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeInput!', + }, + ], + connectionFieldsMap, + 'AddNodePayload' + ), + }), + addNodeAndSave: ( + args: AddNodeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNodeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNodeAndSave', + fieldName: 'addNodeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddNodeAndSave', + 'addNodeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddNodeAndSavePayload' + ), + }), + copyGraph: ( + args: CopyGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyGraph', + fieldName: 'copyGraph', + ...buildCustomDocument( + 'mutation', + 'CopyGraph', + 'copyGraph', + options.select, + args, + [ + { + name: 'input', + type: 'CopyGraphInput!', + }, + ], + connectionFieldsMap, + 'CopyGraphPayload' + ), + }), + importDefinitions: ( + args: ImportDefinitionsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importDefinitions: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportDefinitions', + fieldName: 'importDefinitions', + ...buildCustomDocument( + 'mutation', + 'ImportDefinitions', + 'importDefinitions', + options.select, + args, + [ + { + name: 'input', + type: 'ImportDefinitionsInput!', + }, + ], + connectionFieldsMap, + 'ImportDefinitionsPayload' + ), + }), + 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' + ), + }), + infraInitEmptyRepo: ( + args: InfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraInitEmptyRepo', + fieldName: 'infraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InfraInitEmptyRepo', + 'infraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InfraInitEmptyRepoPayload' + ), + }), + infraInsertNodeAtPath: ( + args: InfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraInsertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraInsertNodeAtPath', + fieldName: 'infraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InfraInsertNodeAtPath', + 'infraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InfraInsertNodeAtPathPayload' + ), + }), + infraSetDataAtPath: ( + args: InfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraSetDataAtPath', + fieldName: 'infraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'InfraSetDataAtPath', + 'infraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'InfraSetDataAtPathPayload' + ), + }), + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + platformInfraInitEmptyRepo: ( + args: PlatformInfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInitEmptyRepo', + fieldName: 'platformInfraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInitEmptyRepo', + 'platformInfraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInitEmptyRepoPayload' + ), + }), + platformInfraInsertNodeAtPath: ( + args: PlatformInfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInsertNodeAtPath', + fieldName: 'platformInfraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInsertNodeAtPath', + 'platformInfraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInsertNodeAtPathPayload' + ), + }), + platformInfraSetDataAtPath: ( + args: PlatformInfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraSetDataAtPath', + fieldName: 'platformInfraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraSetDataAtPath', + 'platformInfraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraSetDataAtPathPayload' + ), + }), + platformResourceInstallationsInstall: < + S extends PlatformResourceInstallationsInstallPayloadSelect, + >( + args: PlatformResourceInstallationsInstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsInstall: InferSelectResult< + PlatformResourceInstallationsInstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsInstall', + fieldName: 'platformResourceInstallationsInstall', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsInstall', + 'platformResourceInstallationsInstall', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsInstallInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsInstallPayload' + ), + }), + platformResourceInstallationsRollback: < + S extends PlatformResourceInstallationsRollbackPayloadSelect, + >( + args: PlatformResourceInstallationsRollbackVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsRollback: InferSelectResult< + PlatformResourceInstallationsRollbackPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsRollback', + fieldName: 'platformResourceInstallationsRollback', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsRollback', + 'platformResourceInstallationsRollback', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsRollbackInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsRollbackPayload' + ), + }), + platformResourceInstallationsUninstall: < + S extends PlatformResourceInstallationsUninstallPayloadSelect, + >( + args: PlatformResourceInstallationsUninstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsUninstall: InferSelectResult< + PlatformResourceInstallationsUninstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsUninstall', + fieldName: 'platformResourceInstallationsUninstall', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsUninstall', + 'platformResourceInstallationsUninstall', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsUninstallInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsUninstallPayload' + ), + }), + platformResourceInstallationsUpgrade: < + S extends PlatformResourceInstallationsUpgradePayloadSelect, + >( + args: PlatformResourceInstallationsUpgradeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsUpgrade: InferSelectResult< + PlatformResourceInstallationsUpgradePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsUpgrade', + fieldName: 'platformResourceInstallationsUpgrade', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsUpgrade', + 'platformResourceInstallationsUpgrade', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsUpgradeInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsUpgradePayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + resourceInstallationsInstall: ( + args: ResourceInstallationsInstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsInstall: InferSelectResult< + ResourceInstallationsInstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsInstall', + fieldName: 'resourceInstallationsInstall', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsInstall', + 'resourceInstallationsInstall', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsInstallInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsInstallPayload' + ), + }), + resourceInstallationsRollback: ( + args: ResourceInstallationsRollbackVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsRollback: InferSelectResult< + ResourceInstallationsRollbackPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsRollback', + fieldName: 'resourceInstallationsRollback', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsRollback', + 'resourceInstallationsRollback', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsRollbackInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsRollbackPayload' + ), + }), + resourceInstallationsUninstall: ( + args: ResourceInstallationsUninstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsUninstall: InferSelectResult< + ResourceInstallationsUninstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsUninstall', + fieldName: 'resourceInstallationsUninstall', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsUninstall', + 'resourceInstallationsUninstall', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsUninstallInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsUninstallPayload' + ), + }), + resourceInstallationsUpgrade: ( + args: ResourceInstallationsUpgradeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsUpgrade: InferSelectResult< + ResourceInstallationsUpgradePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsUpgrade', + fieldName: 'resourceInstallationsUpgrade', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsUpgrade', + 'resourceInstallationsUpgrade', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsUpgradeInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsUpgradePayload' + ), + }), + saveGraph: ( + args: SaveGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + saveGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SaveGraph', + fieldName: 'saveGraph', + ...buildCustomDocument( + 'mutation', + 'SaveGraph', + 'saveGraph', + options.select, + args, + [ + { + name: 'input', + type: 'SaveGraphInput!', + }, + ], + connectionFieldsMap, + 'SaveGraphPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), + startExecution: ( + args: StartExecutionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + startExecution: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'StartExecution', + fieldName: 'startExecution', + ...buildCustomDocument( + 'mutation', + 'StartExecution', + 'startExecution', + options.select, + args, + [ + { + name: 'input', + type: 'StartExecutionInput!', + }, + ], + connectionFieldsMap, + 'StartExecutionPayload' + ), + }), + validateFunctionGraph: ( + args: ValidateFunctionGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + validateFunctionGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ValidateFunctionGraph', + fieldName: 'validateFunctionGraph', + ...buildCustomDocument( + 'mutation', + 'ValidateFunctionGraph', + 'validateFunctionGraph', + options.select, + args, + [ + { + name: 'input', + type: 'ValidateFunctionGraphInput!', + }, + ], + connectionFieldsMap, + 'ValidateFunctionGraphPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/query-builder.ts b/sdk/constructive-cli/src/compute/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/compute/orm/query-builder.ts +++ b/sdk/constructive-cli/src/compute/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/compute/orm/query/index.ts b/sdk/constructive-cli/src/compute/orm/query/index.ts index c94a1d0491..505264ae62 100644 --- a/sdk/constructive-cli/src/compute/orm/query/index.ts +++ b/sdk/constructive-cli/src/compute/orm/query/index.ts @@ -3,28 +3,43 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; export interface ReadFunctionGraphVariables { graphId?: string; } export function createQueryOperations(client: OrmClient) { return { - readFunctionGraph: (args: ReadFunctionGraphVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - readFunctionGraph: unknown | null; - }>({ - client, - operation: "query", - operationName: "ReadFunctionGraph", - fieldName: "readFunctionGraph", - ...buildCustomDocument("query", "ReadFunctionGraph", "readFunctionGraph", options?.select, args, [{ - name: "graphId", - type: "UUID" - }], connectionFieldsMap, undefined) - }) + readFunctionGraph: ( + args: ReadFunctionGraphVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + readFunctionGraph: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ReadFunctionGraph', + fieldName: 'readFunctionGraph', + ...buildCustomDocument( + 'query', + 'ReadFunctionGraph', + 'readFunctionGraph', + options?.select, + args, + [ + { + name: 'graphId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/compute/orm/realtime.ts b/sdk/constructive-cli/src/compute/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/compute/orm/realtime.ts +++ b/sdk/constructive-cli/src/compute/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/compute/orm/select-types.ts b/sdk/constructive-cli/src/compute/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/compute/orm/select-types.ts +++ b/sdk/constructive-cli/src/compute/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/config/cli/commands.ts b/sdk/constructive-cli/src/config/cli/commands.ts index e84d439c8a..8a9b2cd4fd 100644 --- a/sdk/constructive-cli/src/config/cli/commands.ts +++ b/sdk/constructive-cli/src/config/cli/commands.ts @@ -3,67 +3,78 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import configCmd from "./commands/config"; -import platformConfigCmd from "./commands/platform-config"; -import platformInternalSecretCmd from "./commands/platform-internal-secret"; -import platformSecretCmd from "./commands/platform-secret"; -import secretCmd from "./commands/secret"; -import _secretsDelCmd from "./commands/secrets-del"; -import _secretsRemoveArrayCmd from "./commands/secrets-remove-array"; -import _secretsRotateCmd from "./commands/secrets-rotate"; -import _secretsSetCmd from "./commands/secrets-set"; -import platformInternalSecretsDelCmd from "./commands/platform-internal-secrets-del"; -import platformInternalSecretsRemoveArrayCmd from "./commands/platform-internal-secrets-remove-array"; -import platformInternalSecretsRotateCmd from "./commands/platform-internal-secrets-rotate"; -import platformInternalSecretsSetCmd from "./commands/platform-internal-secrets-set"; -import platformSecretsDelCmd from "./commands/platform-secrets-del"; -import platformSecretsRemoveArrayCmd from "./commands/platform-secrets-remove-array"; -import platformSecretsRotateCmd from "./commands/platform-secrets-rotate"; -import platformSecretsSetCmd from "./commands/platform-secrets-set"; -import provisionBucketCmd from "./commands/provision-bucket"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "config": configCmd, - "platform-config": platformConfigCmd, - "platform-internal-secret": platformInternalSecretCmd, - "platform-secret": platformSecretCmd, - "secret": secretCmd, - "secrets-del": _secretsDelCmd, - "secrets-remove-array": _secretsRemoveArrayCmd, - "secrets-rotate": _secretsRotateCmd, - "secrets-set": _secretsSetCmd, - "platform-internal-secrets-del": platformInternalSecretsDelCmd, - "platform-internal-secrets-remove-array": platformInternalSecretsRemoveArrayCmd, - "platform-internal-secrets-rotate": platformInternalSecretsRotateCmd, - "platform-internal-secrets-set": platformInternalSecretsSetCmd, - "platform-secrets-del": platformSecretsDelCmd, - "platform-secrets-remove-array": platformSecretsRemoveArrayCmd, - "platform-secrets-rotate": platformSecretsRotateCmd, - "platform-secrets-set": platformSecretsSetCmd, - "provision-bucket": provisionBucketCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import configCmd from './commands/config'; +import platformConfigCmd from './commands/platform-config'; +import platformInternalSecretCmd from './commands/platform-internal-secret'; +import platformSecretCmd from './commands/platform-secret'; +import secretCmd from './commands/secret'; +import _secretsDelCmd from './commands/secrets-del'; +import _secretsRemoveArrayCmd from './commands/secrets-remove-array'; +import _secretsRotateCmd from './commands/secrets-rotate'; +import _secretsSetCmd from './commands/secrets-set'; +import platformInternalSecretsDelCmd from './commands/platform-internal-secrets-del'; +import platformInternalSecretsRemoveArrayCmd from './commands/platform-internal-secrets-remove-array'; +import platformInternalSecretsRotateCmd from './commands/platform-internal-secrets-rotate'; +import platformInternalSecretsSetCmd from './commands/platform-internal-secrets-set'; +import platformSecretsDelCmd from './commands/platform-secrets-del'; +import platformSecretsRemoveArrayCmd from './commands/platform-secrets-remove-array'; +import platformSecretsRotateCmd from './commands/platform-secrets-rotate'; +import platformSecretsSetCmd from './commands/platform-secrets-set'; +import provisionBucketCmd from './commands/provision-bucket'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + config: configCmd, + 'platform-config': platformConfigCmd, + 'platform-internal-secret': platformInternalSecretCmd, + 'platform-secret': platformSecretCmd, + secret: secretCmd, + 'secrets-del': _secretsDelCmd, + 'secrets-remove-array': _secretsRemoveArrayCmd, + 'secrets-rotate': _secretsRotateCmd, + 'secrets-set': _secretsSetCmd, + 'platform-internal-secrets-del': platformInternalSecretsDelCmd, + 'platform-internal-secrets-remove-array': platformInternalSecretsRemoveArrayCmd, + 'platform-internal-secrets-rotate': platformInternalSecretsRotateCmd, + 'platform-internal-secrets-set': platformInternalSecretsSetCmd, + 'platform-secrets-del': platformSecretsDelCmd, + 'platform-secrets-remove-array': platformSecretsRemoveArrayCmd, + 'platform-secrets-rotate': platformSecretsRotateCmd, + 'platform-secrets-set': platformSecretsSetCmd, + 'provision-bucket': provisionBucketCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n config config CRUD operations\n platform-config platformConfig CRUD operations\n platform-internal-secret platformInternalSecret CRUD operations\n platform-secret platformSecret CRUD operations\n secret secret CRUD operations\n secrets-del _secretsDel\n secrets-remove-array _secretsRemoveArray\n secrets-rotate _secretsRotate\n secrets-set _secretsSet\n platform-internal-secrets-del platformInternalSecretsDel\n platform-internal-secrets-remove-array platformInternalSecretsRemoveArray\n platform-internal-secrets-rotate platformInternalSecretsRotate\n platform-internal-secrets-set platformInternalSecretsSet\n platform-secrets-del platformSecretsDel\n platform-secrets-remove-array platformSecretsRemoveArray\n platform-secrets-rotate platformSecretsRotate\n platform-secrets-set platformSecretsSet\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n config config CRUD operations\n platform-config platformConfig CRUD operations\n platform-internal-secret platformInternalSecret CRUD operations\n platform-secret platformSecret CRUD operations\n secret secret CRUD operations\n secrets-del _secretsDel\n secrets-remove-array _secretsRemoveArray\n secrets-rotate _secretsRotate\n secrets-set _secretsSet\n platform-internal-secrets-del platformInternalSecretsDel\n platform-internal-secrets-remove-array platformInternalSecretsRemoveArray\n platform-internal-secrets-rotate platformInternalSecretsRotate\n platform-internal-secrets-set platformInternalSecretsSet\n platform-secrets-del platformSecretsDel\n platform-secrets-remove-array platformSecretsRemoveArray\n platform-secrets-rotate platformSecretsRotate\n platform-secrets-set platformSecretsSet\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -75,4 +86,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/auth.ts b/sdk/constructive-cli/src/config/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/config/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/config/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/cli/commands/config.ts b/sdk/constructive-cli/src/config/cli/commands/config.ts index 4e96d4c8ee..710bfb1db1 100644 --- a/sdk/constructive-cli/src/config/cli/commands/config.ts +++ b/sdk/constructive-cli/src/config/cli/commands/config.ts @@ -3,60 +3,74 @@ * @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 { CreateConfigInput, ConfigPatch, ConfigSelect, ConfigFilter, ConfigOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateConfigInput, + ConfigPatch, + ConfigSelect, + ConfigFilter, + ConfigOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - databaseId: "uuid", - description: "string", - expiresAt: "string", - id: "uuid", - labels: "json", - name: "string", - namespaceId: "uuid", - provider: "string", - updatedAt: "string", - value: "string" + annotations: 'json', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + expiresAt: 'string', + id: 'uuid', + labels: 'json', + name: 'string', + namespaceId: 'uuid', + provider: 'string', + updatedAt: 'string', + value: 'string', }; -const usage = "\nconfig \n\nCommands:\n list List config records\n find-first Find first matching config record\n get Get a config by ID\n create Create a new config\n update Update an existing config\n delete Delete a config\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) => { +const usage = + '\nconfig \n\nCommands:\n list List config records\n find-first Find first matching config record\n get Get a config by ID\n create Create a new config\n update Update an existing config\n delete Delete a config\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,18 @@ async function handleList(argv: Partial>, _prompter: Inq namespaceId: true, provider: true, updatedAt: true, - value: true + value: true, }; - const findManyArgs = parseFindManyArgs & { - select: ConfigSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ConfigSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.config.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +123,18 @@ async function handleFindFirst(argv: Partial>, _prompter namespaceId: true, provider: true, updatedAt: true, - value: true + value: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ConfigSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ConfigSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.config.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +143,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.config.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - expiresAt: true, - id: true, - labels: true, - name: true, - namespaceId: true, - provider: true, - updatedAt: true, - value: true - } - }).execute(); + const result = await client.config + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + expiresAt: true, + id: true, + labels: true, + name: true, + namespaceId: true, + provider: true, + updatedAt: true, + value: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,91 +182,103 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "value", - message: "value", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'value', + message: 'value', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateConfigInput["config"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateConfigInput['config']; const client = getClient(); - const result = await client.config.create({ - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - expiresAt: cleanedData.expiresAt, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - provider: cleanedData.provider, - value: cleanedData.value - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - expiresAt: true, - id: true, - labels: true, - name: true, - namespaceId: true, - provider: true, - updatedAt: true, - value: true - } - }).execute(); + const result = await client.config + .create({ + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + expiresAt: cleanedData.expiresAt, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + provider: cleanedData.provider, + value: cleanedData.value, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + expiresAt: true, + id: true, + labels: true, + name: true, + namespaceId: true, + provider: true, + updatedAt: true, + value: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -253,99 +287,112 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "value", - message: "value", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'value', + message: 'value', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ConfigPatch; const client = getClient(); - const result = await client.config.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - expiresAt: cleanedData.expiresAt, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - provider: cleanedData.provider, - value: cleanedData.value - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - expiresAt: true, - id: true, - labels: true, - name: true, - namespaceId: true, - provider: true, - updatedAt: true, - value: true - } - }).execute(); + const result = await client.config + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + expiresAt: cleanedData.expiresAt, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + provider: cleanedData.provider, + value: cleanedData.value, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + expiresAt: true, + id: true, + labels: true, + name: true, + namespaceId: true, + provider: true, + updatedAt: true, + value: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -354,28 +401,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.config.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.config + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/cli/commands/context.ts b/sdk/constructive-cli/src/config/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/config/cli/commands/context.ts +++ b/sdk/constructive-cli/src/config/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-config.ts b/sdk/constructive-cli/src/config/cli/commands/platform-config.ts index 0eac2b1468..ffa6228f63 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-config.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-config.ts @@ -3,59 +3,73 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreatePlatformConfigInput, PlatformConfigPatch, PlatformConfigSelect, PlatformConfigFilter, PlatformConfigOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformConfigInput, + PlatformConfigPatch, + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - description: "string", - expiresAt: "string", - id: "uuid", - labels: "json", - name: "string", - namespaceId: "uuid", - provider: "string", - updatedAt: "string", - value: "string" + annotations: 'json', + createdAt: 'string', + description: 'string', + expiresAt: 'string', + id: 'uuid', + labels: 'json', + name: 'string', + namespaceId: 'uuid', + provider: 'string', + updatedAt: 'string', + value: 'string', }; -const usage = "\nplatform-config \n\nCommands:\n list List platformConfig records\n find-first Find first matching platformConfig record\n get Get a platformConfig by ID\n create Create a new platformConfig\n update Update an existing platformConfig\n delete Delete a platformConfig\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nplatform-config \n\nCommands:\n list List platformConfig records\n find-first Find first matching platformConfig record\n get Get a platformConfig by ID\n create Create a new platformConfig\n update Update an existing platformConfig\n delete Delete a platformConfig\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq namespaceId: true, provider: true, updatedAt: true, - value: true + value: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformConfigSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformConfigSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformConfig.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter namespaceId: true, provider: true, updatedAt: true, - value: true + value: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformConfigSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformConfigSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformConfig.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformConfig.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - description: true, - expiresAt: true, - id: true, - labels: true, - name: true, - namespaceId: true, - provider: true, - updatedAt: true, - value: true - } - }).execute(); + const result = await client.platformConfig + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + description: true, + expiresAt: true, + id: true, + labels: true, + name: true, + namespaceId: true, + provider: true, + updatedAt: true, + value: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,84 +178,98 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "value", - message: "value", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'value', + message: 'value', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformConfigInput["platformConfig"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformConfigInput['platformConfig']; const client = getClient(); - const result = await client.platformConfig.create({ - data: { - annotations: cleanedData.annotations, - description: cleanedData.description, - expiresAt: cleanedData.expiresAt, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - provider: cleanedData.provider, - value: cleanedData.value - }, - select: { - annotations: true, - createdAt: true, - description: true, - expiresAt: true, - id: true, - labels: true, - name: true, - namespaceId: true, - provider: true, - updatedAt: true, - value: true - } - }).execute(); + const result = await client.platformConfig + .create({ + data: { + annotations: cleanedData.annotations, + description: cleanedData.description, + expiresAt: cleanedData.expiresAt, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + provider: cleanedData.provider, + value: cleanedData.value, + }, + select: { + annotations: true, + createdAt: true, + description: true, + expiresAt: true, + id: true, + labels: true, + name: true, + namespaceId: true, + provider: true, + updatedAt: true, + value: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,92 +278,104 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "value", - message: "value", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'value', + message: 'value', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformConfigPatch; const client = getClient(); - const result = await client.platformConfig.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - description: cleanedData.description, - expiresAt: cleanedData.expiresAt, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - provider: cleanedData.provider, - value: cleanedData.value - }, - select: { - annotations: true, - createdAt: true, - description: true, - expiresAt: true, - id: true, - labels: true, - name: true, - namespaceId: true, - provider: true, - updatedAt: true, - value: true - } - }).execute(); + const result = await client.platformConfig + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + description: cleanedData.description, + expiresAt: cleanedData.expiresAt, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + provider: cleanedData.provider, + value: cleanedData.value, + }, + select: { + annotations: true, + createdAt: true, + description: true, + expiresAt: true, + id: true, + labels: true, + name: true, + namespaceId: true, + provider: true, + updatedAt: true, + value: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -336,28 +384,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformConfig.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformConfig + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secret.ts b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secret.ts index dfc9f86cee..814963cc20 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secret.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secret.ts @@ -3,52 +3,66 @@ * @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 { CreatePlatformInternalSecretInput, PlatformInternalSecretPatch, PlatformInternalSecretSelect, PlatformInternalSecretFilter, PlatformInternalSecretOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInternalSecretInput, + PlatformInternalSecretPatch, + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - description: "string", - id: "uuid", - labels: "json", - name: "string", - namespaceId: "uuid", - retiredAt: "string", - rotatedAt: "string", - updatedAt: "string" + annotations: 'json', + createdAt: 'string', + description: 'string', + id: 'uuid', + labels: 'json', + name: 'string', + namespaceId: 'uuid', + retiredAt: 'string', + rotatedAt: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-internal-secret \n\nCommands:\n list List platformInternalSecret records\n find-first Find first matching platformInternalSecret record\n create Create a new platformInternalSecret\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) => { +const usage = + '\nplatform-internal-secret \n\nCommands:\n list List platformInternalSecret records\n find-first Find first matching platformInternalSecret record\n create Create a new platformInternalSecret\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq namespaceId: true, retiredAt: true, rotatedAt: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInternalSecretSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy + > & { + select: PlatformInternalSecretSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInternalSecret.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +115,22 @@ async function handleFindFirst(argv: Partial>, _prompter namespaceId: true, retiredAt: true, rotatedAt: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInternalSecretSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy + > & { + select: PlatformInternalSecretSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInternalSecret.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,74 +139,87 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "retiredAt", - message: "retiredAt", - required: true - }, { - type: "text", - name: "rotatedAt", - message: "rotatedAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'retiredAt', + message: 'retiredAt', + required: true, + }, + { + type: 'text', + name: 'rotatedAt', + message: 'rotatedAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInternalSecretInput["platformInternalSecret"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInternalSecretInput['platformInternalSecret']; const client = getClient(); - const result = await client.platformInternalSecret.create({ - data: { - annotations: cleanedData.annotations, - description: cleanedData.description, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - retiredAt: cleanedData.retiredAt, - rotatedAt: cleanedData.rotatedAt - }, - select: { - annotations: true, - createdAt: true, - description: true, - id: true, - labels: true, - name: true, - namespaceId: true, - retiredAt: true, - rotatedAt: true, - updatedAt: true - } - }).execute(); + const result = await client.platformInternalSecret + .create({ + data: { + annotations: cleanedData.annotations, + description: cleanedData.description, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + retiredAt: cleanedData.retiredAt, + rotatedAt: cleanedData.rotatedAt, + }, + select: { + annotations: true, + createdAt: true, + description: true, + id: true, + labels: true, + name: true, + namespaceId: true, + retiredAt: true, + rotatedAt: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-del.ts b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-del.ts index 8651dc87d2..70921af0ef 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-del.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-del.ts @@ -3,37 +3,51 @@ * @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 { PlatformInternalSecretsDelVariables } from "../../orm/mutation"; -import type { PlatformInternalSecretsDelPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInternalSecretsDelVariables } from '../../orm/mutation'; +import type { PlatformInternalSecretsDelPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-internal-secrets-del - platformInternalSecretsDel\n\nUsage: platform-internal-secrets-del [OPTIONS]\n"); + console.log( + 'platform-internal-secrets-del - platformInternalSecretsDel\n\nUsage: platform-internal-secrets-del [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInternalSecretsDel(parsedAnswers as unknown as PlatformInternalSecretsDelVariables, { - select: selectFields - } as unknown as { - select: PlatformInternalSecretsDelPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInternalSecretsDel( + parsedAnswers as unknown as PlatformInternalSecretsDelVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInternalSecretsDelPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInternalSecretsDel"); + console.error('Failed: platformInternalSecretsDel'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-remove-array.ts b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-remove-array.ts index 559542dfd3..ee9eabbef5 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-remove-array.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-remove-array.ts @@ -3,37 +3,51 @@ * @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 { PlatformInternalSecretsRemoveArrayVariables } from "../../orm/mutation"; -import type { PlatformInternalSecretsRemoveArrayPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInternalSecretsRemoveArrayVariables } from '../../orm/mutation'; +import type { PlatformInternalSecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-internal-secrets-remove-array - platformInternalSecretsRemoveArray\n\nUsage: platform-internal-secrets-remove-array [OPTIONS]\n"); + console.log( + 'platform-internal-secrets-remove-array - platformInternalSecretsRemoveArray\n\nUsage: platform-internal-secrets-remove-array [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInternalSecretsRemoveArray(parsedAnswers as unknown as PlatformInternalSecretsRemoveArrayVariables, { - select: selectFields - } as unknown as { - select: PlatformInternalSecretsRemoveArrayPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInternalSecretsRemoveArray( + parsedAnswers as unknown as PlatformInternalSecretsRemoveArrayVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInternalSecretsRemoveArrayPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInternalSecretsRemoveArray"); + console.error('Failed: platformInternalSecretsRemoveArray'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-rotate.ts b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-rotate.ts index 80f6702cfd..46bfa993f3 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-rotate.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-rotate.ts @@ -3,37 +3,51 @@ * @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 { PlatformInternalSecretsRotateVariables } from "../../orm/mutation"; -import type { PlatformInternalSecretsRotatePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInternalSecretsRotateVariables } from '../../orm/mutation'; +import type { PlatformInternalSecretsRotatePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-internal-secrets-rotate - platformInternalSecretsRotate\n\nUsage: platform-internal-secrets-rotate [OPTIONS]\n"); + console.log( + 'platform-internal-secrets-rotate - platformInternalSecretsRotate\n\nUsage: platform-internal-secrets-rotate [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInternalSecretsRotate(parsedAnswers as unknown as PlatformInternalSecretsRotateVariables, { - select: selectFields - } as unknown as { - select: PlatformInternalSecretsRotatePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInternalSecretsRotate( + parsedAnswers as unknown as PlatformInternalSecretsRotateVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInternalSecretsRotatePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInternalSecretsRotate"); + console.error('Failed: platformInternalSecretsRotate'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-set.ts b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-set.ts index 4f62c793b9..0daec243c1 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-set.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-internal-secrets-set.ts @@ -3,37 +3,51 @@ * @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 { PlatformInternalSecretsSetVariables } from "../../orm/mutation"; -import type { PlatformInternalSecretsSetPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInternalSecretsSetVariables } from '../../orm/mutation'; +import type { PlatformInternalSecretsSetPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-internal-secrets-set - platformInternalSecretsSet\n\nUsage: platform-internal-secrets-set [OPTIONS]\n"); + console.log( + 'platform-internal-secrets-set - platformInternalSecretsSet\n\nUsage: platform-internal-secrets-set [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInternalSecretsSet(parsedAnswers as unknown as PlatformInternalSecretsSetVariables, { - select: selectFields - } as unknown as { - select: PlatformInternalSecretsSetPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInternalSecretsSet( + parsedAnswers as unknown as PlatformInternalSecretsSetVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInternalSecretsSetPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInternalSecretsSet"); + console.error('Failed: platformInternalSecretsSet'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secret.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secret.ts index ab52dc57d6..00ca5d8ea5 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-secret.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secret.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformSecretInput, PlatformSecretPatch, PlatformSecretSelect, PlatformSecretFilter, PlatformSecretOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformSecretInput, + PlatformSecretPatch, + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - description: "string", - id: "uuid", - labels: "json", - name: "string", - namespaceId: "uuid", - provider: "string", - retiredAt: "string", - rotatedAt: "string", - updatedAt: "string" + annotations: 'json', + createdAt: 'string', + description: 'string', + id: 'uuid', + labels: 'json', + name: 'string', + namespaceId: 'uuid', + provider: 'string', + retiredAt: 'string', + rotatedAt: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-secret \n\nCommands:\n list List platformSecret records\n find-first Find first matching platformSecret record\n create Create a new platformSecret\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) => { +const usage = + '\nplatform-secret \n\nCommands:\n list List platformSecret records\n find-first Find first matching platformSecret record\n create Create a new platformSecret\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq provider: true, retiredAt: true, rotatedAt: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformSecretSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformSecretSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSecret.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter provider: true, retiredAt: true, rotatedAt: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformSecretSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformSecretSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformSecret.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,81 +134,95 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "provider", - message: "provider", - required: true - }, { - type: "text", - name: "retiredAt", - message: "retiredAt", - required: true - }, { - type: "text", - name: "rotatedAt", - message: "rotatedAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: true, + }, + { + type: 'text', + name: 'retiredAt', + message: 'retiredAt', + required: true, + }, + { + type: 'text', + name: 'rotatedAt', + message: 'rotatedAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformSecretInput["platformSecret"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformSecretInput['platformSecret']; const client = getClient(); - const result = await client.platformSecret.create({ - data: { - annotations: cleanedData.annotations, - description: cleanedData.description, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - provider: cleanedData.provider, - retiredAt: cleanedData.retiredAt, - rotatedAt: cleanedData.rotatedAt - }, - select: { - annotations: true, - createdAt: true, - description: true, - id: true, - labels: true, - name: true, - namespaceId: true, - provider: true, - retiredAt: true, - rotatedAt: true, - updatedAt: true - } - }).execute(); + const result = await client.platformSecret + .create({ + data: { + annotations: cleanedData.annotations, + description: cleanedData.description, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + provider: cleanedData.provider, + retiredAt: cleanedData.retiredAt, + rotatedAt: cleanedData.rotatedAt, + }, + select: { + annotations: true, + createdAt: true, + description: true, + id: true, + labels: true, + name: true, + namespaceId: true, + provider: true, + retiredAt: true, + rotatedAt: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-del.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-del.ts index 82723588c0..d652e01e14 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-del.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-del.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { PlatformSecretsDelVariables } from "../../orm/mutation"; -import type { PlatformSecretsDelPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformSecretsDelVariables } from '../../orm/mutation'; +import type { PlatformSecretsDelPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-secrets-del - platformSecretsDel\n\nUsage: platform-secrets-del [OPTIONS]\n"); + console.log( + 'platform-secrets-del - platformSecretsDel\n\nUsage: platform-secrets-del [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.platformSecretsDel(parsedAnswers as unknown as PlatformSecretsDelVariables, { - select: selectFields - } as unknown as { - select: PlatformSecretsDelPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformSecretsDel( + parsedAnswers as unknown as PlatformSecretsDelVariables, + { + select: selectFields, + } as unknown as { + select: PlatformSecretsDelPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformSecretsDel"); + console.error('Failed: platformSecretsDel'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-remove-array.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-remove-array.ts index 42cae6a218..51fc5b749f 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-remove-array.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-remove-array.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { PlatformSecretsRemoveArrayVariables } from "../../orm/mutation"; -import type { PlatformSecretsRemoveArrayPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformSecretsRemoveArrayVariables } from '../../orm/mutation'; +import type { PlatformSecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-secrets-remove-array - platformSecretsRemoveArray\n\nUsage: platform-secrets-remove-array [OPTIONS]\n"); + console.log( + 'platform-secrets-remove-array - platformSecretsRemoveArray\n\nUsage: platform-secrets-remove-array [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.platformSecretsRemoveArray(parsedAnswers as unknown as PlatformSecretsRemoveArrayVariables, { - select: selectFields - } as unknown as { - select: PlatformSecretsRemoveArrayPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformSecretsRemoveArray( + parsedAnswers as unknown as PlatformSecretsRemoveArrayVariables, + { + select: selectFields, + } as unknown as { + select: PlatformSecretsRemoveArrayPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformSecretsRemoveArray"); + console.error('Failed: platformSecretsRemoveArray'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-rotate.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-rotate.ts index af41d33625..5e9969743e 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-rotate.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-rotate.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { PlatformSecretsRotateVariables } from "../../orm/mutation"; -import type { PlatformSecretsRotatePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformSecretsRotateVariables } from '../../orm/mutation'; +import type { PlatformSecretsRotatePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-secrets-rotate - platformSecretsRotate\n\nUsage: platform-secrets-rotate [OPTIONS]\n"); + console.log( + 'platform-secrets-rotate - platformSecretsRotate\n\nUsage: platform-secrets-rotate [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.platformSecretsRotate(parsedAnswers as unknown as PlatformSecretsRotateVariables, { - select: selectFields - } as unknown as { - select: PlatformSecretsRotatePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformSecretsRotate( + parsedAnswers as unknown as PlatformSecretsRotateVariables, + { + select: selectFields, + } as unknown as { + select: PlatformSecretsRotatePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformSecretsRotate"); + console.error('Failed: platformSecretsRotate'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-set.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-set.ts index 801db8da21..9be1d837db 100644 --- a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-set.ts +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-set.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { PlatformSecretsSetVariables } from "../../orm/mutation"; -import type { PlatformSecretsSetPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformSecretsSetVariables } from '../../orm/mutation'; +import type { PlatformSecretsSetPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-secrets-set - platformSecretsSet\n\nUsage: platform-secrets-set [OPTIONS]\n"); + console.log( + 'platform-secrets-set - platformSecretsSet\n\nUsage: platform-secrets-set [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.platformSecretsSet(parsedAnswers as unknown as PlatformSecretsSetVariables, { - select: selectFields - } as unknown as { - select: PlatformSecretsSetPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformSecretsSet( + parsedAnswers as unknown as PlatformSecretsSetVariables, + { + select: selectFields, + } as unknown as { + select: PlatformSecretsSetPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformSecretsSet"); + console.error('Failed: platformSecretsSet'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/config/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/config/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/config/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/secret.ts b/sdk/constructive-cli/src/config/cli/commands/secret.ts index 5deef1f12e..d1cad40221 100644 --- a/sdk/constructive-cli/src/config/cli/commands/secret.ts +++ b/sdk/constructive-cli/src/config/cli/commands/secret.ts @@ -3,54 +3,68 @@ * @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 { CreateSecretInput, SecretPatch, SecretSelect, SecretFilter, SecretOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSecretInput, + SecretPatch, + SecretSelect, + SecretFilter, + SecretOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - labels: "json", - name: "string", - namespaceId: "uuid", - provider: "string", - retiredAt: "string", - rotatedAt: "string", - updatedAt: "string" + annotations: 'json', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + labels: 'json', + name: 'string', + namespaceId: 'uuid', + provider: 'string', + retiredAt: 'string', + rotatedAt: 'string', + updatedAt: 'string', }; -const usage = "\nsecret \n\nCommands:\n list List secret records\n find-first Find first matching secret record\n create Create a new secret\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) => { +const usage = + '\nsecret \n\nCommands:\n list List secret records\n find-first Find first matching secret record\n create Create a new secret\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq provider: true, retiredAt: true, rotatedAt: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: SecretSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SecretSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.secret.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter provider: true, retiredAt: true, rotatedAt: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SecretSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SecretSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.secret.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,88 +137,100 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: true - }, { - type: "json", - name: "labels", - message: "labels", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }, { - type: "text", - name: "provider", - message: "provider", - required: true - }, { - type: "text", - name: "retiredAt", - message: "retiredAt", - required: true - }, { - type: "text", - name: "rotatedAt", - message: "rotatedAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: true, + }, + { + type: 'text', + name: 'retiredAt', + message: 'retiredAt', + required: true, + }, + { + type: 'text', + name: 'rotatedAt', + message: 'rotatedAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSecretInput["secret"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateSecretInput['secret']; const client = getClient(); - const result = await client.secret.create({ - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - labels: cleanedData.labels, - name: cleanedData.name, - namespaceId: cleanedData.namespaceId, - provider: cleanedData.provider, - retiredAt: cleanedData.retiredAt, - rotatedAt: cleanedData.rotatedAt - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - labels: true, - name: true, - namespaceId: true, - provider: true, - retiredAt: true, - rotatedAt: true, - updatedAt: true - } - }).execute(); + const result = await client.secret + .create({ + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + labels: cleanedData.labels, + name: cleanedData.name, + namespaceId: cleanedData.namespaceId, + provider: cleanedData.provider, + retiredAt: cleanedData.retiredAt, + rotatedAt: cleanedData.rotatedAt, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + labels: true, + name: true, + namespaceId: true, + provider: true, + retiredAt: true, + rotatedAt: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/cli/commands/secrets-del.ts b/sdk/constructive-cli/src/config/cli/commands/secrets-del.ts index 39430c7880..737daa2aef 100644 --- a/sdk/constructive-cli/src/config/cli/commands/secrets-del.ts +++ b/sdk/constructive-cli/src/config/cli/commands/secrets-del.ts @@ -3,37 +3,49 @@ * @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 { _secretsDelVariables } from "../../orm/mutation"; -import type { _SecretsDelPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { _secretsDelVariables } from '../../orm/mutation'; +import type { _SecretsDelPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("secrets-del - _secretsDel\n\nUsage: secrets-del [OPTIONS]\n"); + console.log('secrets-del - _secretsDel\n\nUsage: secrets-del [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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._secretsDel(parsedAnswers as unknown as _secretsDelVariables, { - select: selectFields - } as unknown as { - select: _SecretsDelPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + ._secretsDel( + parsedAnswers as unknown as _secretsDelVariables, + { + select: selectFields, + } as unknown as { + select: _SecretsDelPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: _secretsDel"); + console.error('Failed: _secretsDel'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/secrets-remove-array.ts b/sdk/constructive-cli/src/config/cli/commands/secrets-remove-array.ts index 75de57278b..8c2cb720c1 100644 --- a/sdk/constructive-cli/src/config/cli/commands/secrets-remove-array.ts +++ b/sdk/constructive-cli/src/config/cli/commands/secrets-remove-array.ts @@ -3,37 +3,51 @@ * @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 { _secretsRemoveArrayVariables } from "../../orm/mutation"; -import type { _SecretsRemoveArrayPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { _secretsRemoveArrayVariables } from '../../orm/mutation'; +import type { _SecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("secrets-remove-array - _secretsRemoveArray\n\nUsage: secrets-remove-array [OPTIONS]\n"); + console.log( + 'secrets-remove-array - _secretsRemoveArray\n\nUsage: secrets-remove-array [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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._secretsRemoveArray(parsedAnswers as unknown as _secretsRemoveArrayVariables, { - select: selectFields - } as unknown as { - select: _SecretsRemoveArrayPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + ._secretsRemoveArray( + parsedAnswers as unknown as _secretsRemoveArrayVariables, + { + select: selectFields, + } as unknown as { + select: _SecretsRemoveArrayPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: _secretsRemoveArray"); + console.error('Failed: _secretsRemoveArray'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/secrets-rotate.ts b/sdk/constructive-cli/src/config/cli/commands/secrets-rotate.ts index 5dd7c06827..849bb8aa12 100644 --- a/sdk/constructive-cli/src/config/cli/commands/secrets-rotate.ts +++ b/sdk/constructive-cli/src/config/cli/commands/secrets-rotate.ts @@ -3,37 +3,49 @@ * @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 { _secretsRotateVariables } from "../../orm/mutation"; -import type { _SecretsRotatePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { _secretsRotateVariables } from '../../orm/mutation'; +import type { _SecretsRotatePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("secrets-rotate - _secretsRotate\n\nUsage: secrets-rotate [OPTIONS]\n"); + console.log('secrets-rotate - _secretsRotate\n\nUsage: secrets-rotate [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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._secretsRotate(parsedAnswers as unknown as _secretsRotateVariables, { - select: selectFields - } as unknown as { - select: _SecretsRotatePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + ._secretsRotate( + parsedAnswers as unknown as _secretsRotateVariables, + { + select: selectFields, + } as unknown as { + select: _SecretsRotatePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: _secretsRotate"); + console.error('Failed: _secretsRotate'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/secrets-set.ts b/sdk/constructive-cli/src/config/cli/commands/secrets-set.ts index 1e925af48e..f7e3452fee 100644 --- a/sdk/constructive-cli/src/config/cli/commands/secrets-set.ts +++ b/sdk/constructive-cli/src/config/cli/commands/secrets-set.ts @@ -3,37 +3,49 @@ * @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 { _secretsSetVariables } from "../../orm/mutation"; -import type { _SecretsSetPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { _secretsSetVariables } from '../../orm/mutation'; +import type { _SecretsSetPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("secrets-set - _secretsSet\n\nUsage: secrets-set [OPTIONS]\n"); + console.log('secrets-set - _secretsSet\n\nUsage: secrets-set [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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._secretsSet(parsedAnswers as unknown as _secretsSetVariables, { - select: selectFields - } as unknown as { - select: _SecretsSetPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + ._secretsSet( + parsedAnswers as unknown as _secretsSetVariables, + { + select: selectFields, + } as unknown as { + select: _SecretsSetPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: _secretsSet"); + console.error('Failed: _secretsSet'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/cli/executor.ts b/sdk/constructive-cli/src/config/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/config/cli/executor.ts +++ b/sdk/constructive-cli/src/config/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/cli/index.ts b/sdk/constructive-cli/src/config/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/config/cli/index.ts +++ b/sdk/constructive-cli/src/config/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/config/cli/utils.ts b/sdk/constructive-cli/src/config/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/config/cli/utils.ts +++ b/sdk/constructive-cli/src/config/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/config/index.ts b/sdk/constructive-cli/src/config/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/config/index.ts +++ b/sdk/constructive-cli/src/config/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/config/orm/client.ts b/sdk/constructive-cli/src/config/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/config/orm/client.ts +++ b/sdk/constructive-cli/src/config/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/config/orm/index.ts b/sdk/constructive-cli/src/config/orm/index.ts index fc3b40f037..bf16135b3c 100644 --- a/sdk/constructive-cli/src/config/orm/index.ts +++ b/sdk/constructive-cli/src/config/orm/index.ts @@ -3,20 +3,20 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { ConfigModel } from "./models/config"; -import { PlatformConfigModel } from "./models/platformConfig"; -import { PlatformInternalSecretModel } from "./models/platformInternalSecret"; -import { PlatformSecretModel } from "./models/platformSecret"; -import { SecretModel } from "./models/secret"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { ConfigModel } from './models/config'; +import { PlatformConfigModel } from './models/platformConfig'; +import { PlatformInternalSecretModel } from './models/platformInternalSecret'; +import { PlatformSecretModel } from './models/platformSecret'; +import { SecretModel } from './models/secret'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -48,6 +48,6 @@ export function createClient(config: OrmClientConfig) { platformInternalSecret: new PlatformInternalSecretModel(client), platformSecret: new PlatformSecretModel(client), secret: new SecretModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/orm/input-types.ts b/sdk/constructive-cli/src/config/orm/input-types.ts index 2a682fe678..110c75415d 100644 --- a/sdk/constructive-cli/src/config/orm/input-types.ts +++ b/sdk/constructive-cli/src/config/orm/input-types.ts @@ -339,7 +339,8 @@ export interface SecretRelations {} // ============ Entity Types With Relations ============ export type ConfigWithRelations = Config & ConfigRelations; export type PlatformConfigWithRelations = PlatformConfig & PlatformConfigRelations; -export type PlatformInternalSecretWithRelations = PlatformInternalSecret & PlatformInternalSecretRelations; +export type PlatformInternalSecretWithRelations = PlatformInternalSecret & + PlatformInternalSecretRelations; export type PlatformSecretWithRelations = PlatformSecret & PlatformSecretRelations; export type SecretWithRelations = Secret & SecretRelations; // ============ Entity Select Types ============ @@ -563,11 +564,132 @@ export interface SecretFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type ConfigOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALUE_ASC" | "VALUE_DESC"; -export type PlatformConfigOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALUE_ASC" | "VALUE_DESC"; -export type PlatformInternalSecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PROVIDER_ASC" | "PROVIDER_DESC" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PROVIDER_ASC" | "PROVIDER_DESC" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type ConfigOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC'; +export type PlatformConfigOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC'; +export type PlatformInternalSecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateConfigInput { clientMutationId?: string; @@ -1089,4 +1211,4 @@ export type PlatformConfigEdgeSelect = { node?: { select: PlatformConfigSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/config/orm/models/config.ts b/sdk/constructive-cli/src/config/orm/models/config.ts index f7c80edfb1..cef2950915 100644 --- a/sdk/constructive-cli/src/config/orm/models/config.ts +++ b/sdk/constructive-cli/src/config/orm/models/config.ts @@ -3,56 +3,96 @@ * @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 { Config, ConfigWithRelations, ConfigSelect, ConfigFilter, ConfigOrderBy, CreateConfigInput, UpdateConfigInput, ConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Config, + ConfigWithRelations, + ConfigSelect, + ConfigFilter, + ConfigOrderBy, + CreateConfigInput, + UpdateConfigInput, + ConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ configs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Config", "configs", 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 - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Config', + 'configs', + 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, + }, + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "configs", + operation: 'query', + operationName: 'Config', + fieldName: 'configs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ config: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Config", "configs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Config', + 'configs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "config", + operation: 'query', + operationName: 'Config', + fieldName: 'config', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "config": data.configs?.nodes?.[0] ?? null - }) + config: data.configs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ config: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Config", "configs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Config', + 'configs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "config", + operation: 'query', + operationName: 'Config', + fieldName: 'config', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "config": data.configs?.nodes?.[0] ?? null - }) + config: data.configs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Config", "createConfig", "config", args.select, args.data, "CreateConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Config', + 'createConfig', + 'config', + args.select, + args.data, + 'CreateConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "createConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'createConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Config", "updateConfig", "config", args.select, args.where.id, args.data, "UpdateConfigInput", "id", "configPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Config', + 'updateConfig', + 'config', + args.select, + args.where.id, + args.data, + 'UpdateConfigInput', + 'id', + 'configPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "updateConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'updateConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Config", "deleteConfig", "config", { - id: args.where.id - }, "DeleteConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Config', + 'deleteConfig', + 'config', + { + id: args.where.id, + }, + 'DeleteConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "deleteConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'deleteConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/orm/models/index.ts b/sdk/constructive-cli/src/config/orm/models/index.ts index 5bca8e3b99..0823cce0ad 100644 --- a/sdk/constructive-cli/src/config/orm/models/index.ts +++ b/sdk/constructive-cli/src/config/orm/models/index.ts @@ -3,8 +3,8 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { ConfigModel } from "./config"; -export { PlatformConfigModel } from "./platformConfig"; -export { PlatformInternalSecretModel } from "./platformInternalSecret"; -export { PlatformSecretModel } from "./platformSecret"; -export { SecretModel } from "./secret"; \ No newline at end of file +export { ConfigModel } from './config'; +export { PlatformConfigModel } from './platformConfig'; +export { PlatformInternalSecretModel } from './platformInternalSecret'; +export { PlatformSecretModel } from './platformSecret'; +export { SecretModel } from './secret'; diff --git a/sdk/constructive-cli/src/config/orm/models/platformConfig.ts b/sdk/constructive-cli/src/config/orm/models/platformConfig.ts index bf62b0821c..43634e7a80 100644 --- a/sdk/constructive-cli/src/config/orm/models/platformConfig.ts +++ b/sdk/constructive-cli/src/config/orm/models/platformConfig.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { PlatformConfig, PlatformConfigWithRelations, PlatformConfigSelect, PlatformConfigFilter, PlatformConfigOrderBy, CreatePlatformConfigInput, UpdatePlatformConfigInput, PlatformConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfig, + PlatformConfigWithRelations, + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy, + CreatePlatformConfigInput, + UpdatePlatformConfigInput, + PlatformConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfigs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformConfig", "platformConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfigs", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfigs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformConfig", "platformConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfig", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformConfig": data.platformConfigs?.nodes?.[0] ?? null - }) + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformConfig", "platformConfigs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfig", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformConfig": data.platformConfigs?.nodes?.[0] ?? null - }) + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformConfig", "createPlatformConfig", "platformConfig", args.select, args.data, "CreatePlatformConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformConfig', + 'createPlatformConfig', + 'platformConfig', + args.select, + args.data, + 'CreatePlatformConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "createPlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'createPlatformConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformConfig", "updatePlatformConfig", "platformConfig", args.select, args.where.id, args.data, "UpdatePlatformConfigInput", "id", "platformConfigPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfig', + 'updatePlatformConfig', + 'platformConfig', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigInput', + 'id', + 'platformConfigPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "updatePlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'updatePlatformConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformConfig", "deletePlatformConfig", "platformConfig", { - id: args.where.id - }, "DeletePlatformConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfig', + 'deletePlatformConfig', + 'platformConfig', + { + id: args.where.id, + }, + 'DeletePlatformConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "deletePlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'deletePlatformConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/orm/models/platformInternalSecret.ts b/sdk/constructive-cli/src/config/orm/models/platformInternalSecret.ts index 1e09df35f4..35e0c7b538 100644 --- a/sdk/constructive-cli/src/config/orm/models/platformInternalSecret.ts +++ b/sdk/constructive-cli/src/config/orm/models/platformInternalSecret.ts @@ -3,56 +3,98 @@ * @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 { PlatformInternalSecret, PlatformInternalSecretWithRelations, PlatformInternalSecretSelect, PlatformInternalSecretFilter, PlatformInternalSecretOrderBy, CreatePlatformInternalSecretInput, UpdatePlatformInternalSecretInput, PlatformInternalSecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInternalSecret, + PlatformInternalSecretWithRelations, + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy, + CreatePlatformInternalSecretInput, + UpdatePlatformInternalSecretInput, + PlatformInternalSecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInternalSecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInternalSecrets: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInternalSecrets: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInternalSecret", "platformInternalSecrets", 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 - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + 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, + }, + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecrets", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInternalSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInternalSecret", "platformInternalSecrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecret", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecret', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformInternalSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInternalSecret": data.platformInternalSecrets?.nodes?.[0] ?? null - }) + platformInternalSecret: data.platformInternalSecrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInternalSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInternalSecret", "platformInternalSecrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecret", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecret', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PlatformInternalSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInternalSecret": data.platformInternalSecrets?.nodes?.[0] ?? null - }) + platformInternalSecret: data.platformInternalSecrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInternalSecret: { platformInternalSecret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInternalSecret", "createPlatformInternalSecret", "platformInternalSecret", args.select, args.data, "CreatePlatformInternalSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInternalSecret', + 'createPlatformInternalSecret', + 'platformInternalSecret', + args.select, + args.data, + 'CreatePlatformInternalSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInternalSecret", - fieldName: "createPlatformInternalSecret", + operation: 'mutation', + operationName: 'PlatformInternalSecret', + fieldName: 'createPlatformInternalSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/orm/models/platformSecret.ts b/sdk/constructive-cli/src/config/orm/models/platformSecret.ts index 366da27bfe..03c0e23540 100644 --- a/sdk/constructive-cli/src/config/orm/models/platformSecret.ts +++ b/sdk/constructive-cli/src/config/orm/models/platformSecret.ts @@ -3,56 +3,96 @@ * @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 { PlatformSecret, PlatformSecretWithRelations, PlatformSecretSelect, PlatformSecretFilter, PlatformSecretOrderBy, CreatePlatformSecretInput, UpdatePlatformSecretInput, PlatformSecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSecret, + PlatformSecretWithRelations, + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy, + CreatePlatformSecretInput, + UpdatePlatformSecretInput, + PlatformSecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecrets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSecret", "platformSecrets", 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 - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSecret', + 'platformSecrets', + 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, + }, + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecrets", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSecret", "platformSecrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSecret', + 'platformSecrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecret", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecret', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSecret": data.platformSecrets?.nodes?.[0] ?? null - }) + platformSecret: data.platformSecrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSecret", "platformSecrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSecret', + 'platformSecrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecret", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecret', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class PlatformSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSecret": data.platformSecrets?.nodes?.[0] ?? null - }) + platformSecret: data.platformSecrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSecret: { platformSecret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSecret", "createPlatformSecret", "platformSecret", args.select, args.data, "CreatePlatformSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSecret', + 'createPlatformSecret', + 'platformSecret', + args.select, + args.data, + 'CreatePlatformSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSecret", - fieldName: "createPlatformSecret", + operation: 'mutation', + operationName: 'PlatformSecret', + fieldName: 'createPlatformSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/orm/models/secret.ts b/sdk/constructive-cli/src/config/orm/models/secret.ts index af9f11b5ae..37571240d8 100644 --- a/sdk/constructive-cli/src/config/orm/models/secret.ts +++ b/sdk/constructive-cli/src/config/orm/models/secret.ts @@ -3,56 +3,96 @@ * @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 { Secret, SecretWithRelations, SecretSelect, SecretFilter, SecretOrderBy, CreateSecretInput, UpdateSecretInput, SecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Secret, + SecretWithRelations, + SecretSelect, + SecretFilter, + SecretOrderBy, + CreateSecretInput, + UpdateSecretInput, + SecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secrets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Secret", "secrets", 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 - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Secret', + 'secrets', + 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, + }, + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secrets", + operation: 'query', + operationName: 'Secret', + fieldName: 'secrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Secret", "secrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Secret', + 'secrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secret", + operation: 'query', + operationName: 'Secret', + fieldName: 'secret', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "secret": data.secrets?.nodes?.[0] ?? null - }) + secret: data.secrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ secret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Secret", "secrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Secret', + 'secrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secret", + operation: 'query', + operationName: 'Secret', + fieldName: 'secret', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class SecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "secret": data.secrets?.nodes?.[0] ?? null - }) + secret: data.secrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSecret: { secret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Secret", "createSecret", "secret", args.select, args.data, "CreateSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Secret', + 'createSecret', + 'secret', + args.select, + args.data, + 'CreateSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Secret", - fieldName: "createSecret", + operation: 'mutation', + operationName: 'Secret', + fieldName: 'createSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/orm/mutation/index.ts b/sdk/constructive-cli/src/config/orm/mutation/index.ts index 8d24d8f7a0..13353608c7 100644 --- a/sdk/constructive-cli/src/config/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/config/orm/mutation/index.ts @@ -3,11 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { _SecretsDelInput, _SecretsRemoveArrayInput, _SecretsRotateInput, _SecretsSetInput, PlatformInternalSecretsDelInput, PlatformInternalSecretsRemoveArrayInput, PlatformInternalSecretsRotateInput, PlatformInternalSecretsSetInput, PlatformSecretsDelInput, PlatformSecretsRemoveArrayInput, PlatformSecretsRotateInput, PlatformSecretsSetInput, ProvisionBucketInput, _SecretsDelPayload, _SecretsRemoveArrayPayload, _SecretsRotatePayload, _SecretsSetPayload, PlatformInternalSecretsDelPayload, PlatformInternalSecretsRemoveArrayPayload, PlatformInternalSecretsRotatePayload, PlatformInternalSecretsSetPayload, PlatformSecretsDelPayload, PlatformSecretsRemoveArrayPayload, PlatformSecretsRotatePayload, PlatformSecretsSetPayload, ProvisionBucketPayload, _SecretsDelPayloadSelect, _SecretsRemoveArrayPayloadSelect, _SecretsRotatePayloadSelect, _SecretsSetPayloadSelect, PlatformInternalSecretsDelPayloadSelect, PlatformInternalSecretsRemoveArrayPayloadSelect, PlatformInternalSecretsRotatePayloadSelect, PlatformInternalSecretsSetPayloadSelect, PlatformSecretsDelPayloadSelect, PlatformSecretsRemoveArrayPayloadSelect, PlatformSecretsRotatePayloadSelect, PlatformSecretsSetPayloadSelect, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + _SecretsDelInput, + _SecretsRemoveArrayInput, + _SecretsRotateInput, + _SecretsSetInput, + PlatformInternalSecretsDelInput, + PlatformInternalSecretsRemoveArrayInput, + PlatformInternalSecretsRotateInput, + PlatformInternalSecretsSetInput, + PlatformSecretsDelInput, + PlatformSecretsRemoveArrayInput, + PlatformSecretsRotateInput, + PlatformSecretsSetInput, + ProvisionBucketInput, + _SecretsDelPayload, + _SecretsRemoveArrayPayload, + _SecretsRotatePayload, + _SecretsSetPayload, + PlatformInternalSecretsDelPayload, + PlatformInternalSecretsRemoveArrayPayload, + PlatformInternalSecretsRotatePayload, + PlatformInternalSecretsSetPayload, + PlatformSecretsDelPayload, + PlatformSecretsRemoveArrayPayload, + PlatformSecretsRotatePayload, + PlatformSecretsSetPayload, + ProvisionBucketPayload, + _SecretsDelPayloadSelect, + _SecretsRemoveArrayPayloadSelect, + _SecretsRotatePayloadSelect, + _SecretsSetPayloadSelect, + PlatformInternalSecretsDelPayloadSelect, + PlatformInternalSecretsRemoveArrayPayloadSelect, + PlatformInternalSecretsRotatePayloadSelect, + PlatformInternalSecretsSetPayloadSelect, + PlatformSecretsDelPayloadSelect, + PlatformSecretsRemoveArrayPayloadSelect, + PlatformSecretsRotatePayloadSelect, + PlatformSecretsSetPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface _secretsDelVariables { input: _SecretsDelInput; } @@ -56,187 +96,388 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - _secretsDel: (args: _secretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsDel", - fieldName: "_secretsDel", - ...buildCustomDocument("mutation", "_secretsDel", "_secretsDel", options.select, args, [{ - name: "input", - type: "_SecretsDelInput!" - }], connectionFieldsMap, "_SecretsDelPayload") - }), - _secretsRemoveArray: (args: _secretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsRemoveArray", - fieldName: "_secretsRemoveArray", - ...buildCustomDocument("mutation", "_secretsRemoveArray", "_secretsRemoveArray", options.select, args, [{ - name: "input", - type: "_SecretsRemoveArrayInput!" - }], connectionFieldsMap, "_SecretsRemoveArrayPayload") - }), - _secretsRotate: (args: _secretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsRotate", - fieldName: "_secretsRotate", - ...buildCustomDocument("mutation", "_secretsRotate", "_secretsRotate", options.select, args, [{ - name: "input", - type: "_SecretsRotateInput!" - }], connectionFieldsMap, "_SecretsRotatePayload") - }), - _secretsSet: (args: _secretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsSet", - fieldName: "_secretsSet", - ...buildCustomDocument("mutation", "_secretsSet", "_secretsSet", options.select, args, [{ - name: "input", - type: "_SecretsSetInput!" - }], connectionFieldsMap, "_SecretsSetPayload") - }), - platformInternalSecretsDel: (args: PlatformInternalSecretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsDel: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsDel", - fieldName: "platformInternalSecretsDel", - ...buildCustomDocument("mutation", "PlatformInternalSecretsDel", "platformInternalSecretsDel", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsDelInput!" - }], connectionFieldsMap, "PlatformInternalSecretsDelPayload") - }), - platformInternalSecretsRemoveArray: (args: PlatformInternalSecretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsRemoveArray: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsRemoveArray", - fieldName: "platformInternalSecretsRemoveArray", - ...buildCustomDocument("mutation", "PlatformInternalSecretsRemoveArray", "platformInternalSecretsRemoveArray", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsRemoveArrayInput!" - }], connectionFieldsMap, "PlatformInternalSecretsRemoveArrayPayload") - }), - platformInternalSecretsRotate: (args: PlatformInternalSecretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsRotate: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsRotate", - fieldName: "platformInternalSecretsRotate", - ...buildCustomDocument("mutation", "PlatformInternalSecretsRotate", "platformInternalSecretsRotate", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsRotateInput!" - }], connectionFieldsMap, "PlatformInternalSecretsRotatePayload") - }), - platformInternalSecretsSet: (args: PlatformInternalSecretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsSet: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsSet", - fieldName: "platformInternalSecretsSet", - ...buildCustomDocument("mutation", "PlatformInternalSecretsSet", "platformInternalSecretsSet", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsSetInput!" - }], connectionFieldsMap, "PlatformInternalSecretsSetPayload") - }), - platformSecretsDel: (args: PlatformSecretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsDel: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsDel", - fieldName: "platformSecretsDel", - ...buildCustomDocument("mutation", "PlatformSecretsDel", "platformSecretsDel", options.select, args, [{ - name: "input", - type: "PlatformSecretsDelInput!" - }], connectionFieldsMap, "PlatformSecretsDelPayload") - }), - platformSecretsRemoveArray: (args: PlatformSecretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsRemoveArray: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsRemoveArray", - fieldName: "platformSecretsRemoveArray", - ...buildCustomDocument("mutation", "PlatformSecretsRemoveArray", "platformSecretsRemoveArray", options.select, args, [{ - name: "input", - type: "PlatformSecretsRemoveArrayInput!" - }], connectionFieldsMap, "PlatformSecretsRemoveArrayPayload") - }), - platformSecretsRotate: (args: PlatformSecretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsRotate: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsRotate", - fieldName: "platformSecretsRotate", - ...buildCustomDocument("mutation", "PlatformSecretsRotate", "platformSecretsRotate", options.select, args, [{ - name: "input", - type: "PlatformSecretsRotateInput!" - }], connectionFieldsMap, "PlatformSecretsRotatePayload") - }), - platformSecretsSet: (args: PlatformSecretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsSet: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsSet", - fieldName: "platformSecretsSet", - ...buildCustomDocument("mutation", "PlatformSecretsSet", "platformSecretsSet", options.select, args, [{ - name: "input", - type: "PlatformSecretsSetInput!" - }], connectionFieldsMap, "PlatformSecretsSetPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + _secretsDel: ( + args: _secretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsDel', + fieldName: '_secretsDel', + ...buildCustomDocument( + 'mutation', + '_secretsDel', + '_secretsDel', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsDelInput!', + }, + ], + connectionFieldsMap, + '_SecretsDelPayload' + ), + }), + _secretsRemoveArray: ( + args: _secretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsRemoveArray', + fieldName: '_secretsRemoveArray', + ...buildCustomDocument( + 'mutation', + '_secretsRemoveArray', + '_secretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + '_SecretsRemoveArrayPayload' + ), + }), + _secretsRotate: ( + args: _secretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsRotate', + fieldName: '_secretsRotate', + ...buildCustomDocument( + 'mutation', + '_secretsRotate', + '_secretsRotate', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsRotateInput!', + }, + ], + connectionFieldsMap, + '_SecretsRotatePayload' + ), + }), + _secretsSet: ( + args: _secretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsSet', + fieldName: '_secretsSet', + ...buildCustomDocument( + 'mutation', + '_secretsSet', + '_secretsSet', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsSetInput!', + }, + ], + connectionFieldsMap, + '_SecretsSetPayload' + ), + }), + platformInternalSecretsDel: ( + args: PlatformInternalSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsDel', + fieldName: 'platformInternalSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsDel', + 'platformInternalSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsDelPayload' + ), + }), + platformInternalSecretsRemoveArray: ( + args: PlatformInternalSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsRemoveArray: InferSelectResult< + PlatformInternalSecretsRemoveArrayPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsRemoveArray', + fieldName: 'platformInternalSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsRemoveArray', + 'platformInternalSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsRemoveArrayPayload' + ), + }), + platformInternalSecretsRotate: ( + args: PlatformInternalSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsRotate: InferSelectResult< + PlatformInternalSecretsRotatePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsRotate', + fieldName: 'platformInternalSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsRotate', + 'platformInternalSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsRotatePayload' + ), + }), + platformInternalSecretsSet: ( + args: PlatformInternalSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsSet', + fieldName: 'platformInternalSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsSet', + 'platformInternalSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsSetPayload' + ), + }), + platformSecretsDel: ( + args: PlatformSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsDel', + fieldName: 'platformSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsDel', + 'platformSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsDelPayload' + ), + }), + platformSecretsRemoveArray: ( + args: PlatformSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRemoveArray', + fieldName: 'platformSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRemoveArray', + 'platformSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRemoveArrayPayload' + ), + }), + platformSecretsRotate: ( + args: PlatformSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRotate', + fieldName: 'platformSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRotate', + 'platformSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRotatePayload' + ), + }), + platformSecretsSet: ( + args: PlatformSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsSet', + fieldName: 'platformSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsSet', + 'platformSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsSetPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/config/orm/query-builder.ts b/sdk/constructive-cli/src/config/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/config/orm/query-builder.ts +++ b/sdk/constructive-cli/src/config/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/config/orm/realtime.ts b/sdk/constructive-cli/src/config/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/config/orm/realtime.ts +++ b/sdk/constructive-cli/src/config/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/config/orm/select-types.ts b/sdk/constructive-cli/src/config/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/config/orm/select-types.ts +++ b/sdk/constructive-cli/src/config/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/index.ts b/sdk/constructive-cli/src/index.ts index 4f492497df..f64a72cd39 100644 --- a/sdk/constructive-cli/src/index.ts +++ b/sdk/constructive-cli/src/index.ts @@ -1,18 +1,18 @@ /** * @constructive-io/sdk - * + * * Auto-generated GraphQL types and ORM client. * Run `pnpm run generate` to populate this package from the schema files. - * + * * @generated by @constructive-io/graphql-codegen */ -export * as admin from "./admin"; -export * as agent from "./agent"; -export * as api from "./api"; -export * as auth from "./auth"; -export * as compute from "./compute"; -export * as config from "./config"; -export * as infra from "./infra"; -export * as modules from "./modules"; -export * as objects from "./objects"; -export * as usage from "./usage"; \ No newline at end of file +export * as admin from './admin'; +export * as agent from './agent'; +export * as api from './api'; +export * as auth from './auth'; +export * as compute from './compute'; +export * as config from './config'; +export * as infra from './infra'; +export * as modules from './modules'; +export * as objects from './objects'; +export * as usage from './usage'; diff --git a/sdk/constructive-cli/src/infra/cli/commands.ts b/sdk/constructive-cli/src/infra/cli/commands.ts index 872dd034c7..9b61cfeec5 100644 --- a/sdk/constructive-cli/src/infra/cli/commands.ts +++ b/sdk/constructive-cli/src/infra/cli/commands.ts @@ -3,59 +3,70 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import dbPresetCmd from "./commands/db-preset"; -import namespaceCmd from "./commands/namespace"; -import namespaceEventCmd from "./commands/namespace-event"; -import platformInfraCommitCmd from "./commands/platform-infra-commit"; -import platformInfraGetAllTreeNodesRecordCmd from "./commands/platform-infra-get-all-tree-nodes-record"; -import platformInfraObjectCmd from "./commands/platform-infra-object"; -import platformInfraRefCmd from "./commands/platform-infra-ref"; -import platformInfraStoreCmd from "./commands/platform-infra-store"; -import platformNamespaceCmd from "./commands/platform-namespace"; -import platformNamespaceEventCmd from "./commands/platform-namespace-event"; -import platformInfraInitEmptyRepoCmd from "./commands/platform-infra-init-empty-repo"; -import platformInfraInsertNodeAtPathCmd from "./commands/platform-infra-insert-node-at-path"; -import platformInfraSetDataAtPathCmd from "./commands/platform-infra-set-data-at-path"; -import provisionBucketCmd from "./commands/provision-bucket"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "db-preset": dbPresetCmd, - "namespace": namespaceCmd, - "namespace-event": namespaceEventCmd, - "platform-infra-commit": platformInfraCommitCmd, - "platform-infra-get-all-tree-nodes-record": platformInfraGetAllTreeNodesRecordCmd, - "platform-infra-object": platformInfraObjectCmd, - "platform-infra-ref": platformInfraRefCmd, - "platform-infra-store": platformInfraStoreCmd, - "platform-namespace": platformNamespaceCmd, - "platform-namespace-event": platformNamespaceEventCmd, - "platform-infra-init-empty-repo": platformInfraInitEmptyRepoCmd, - "platform-infra-insert-node-at-path": platformInfraInsertNodeAtPathCmd, - "platform-infra-set-data-at-path": platformInfraSetDataAtPathCmd, - "provision-bucket": provisionBucketCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import dbPresetCmd from './commands/db-preset'; +import namespaceCmd from './commands/namespace'; +import namespaceEventCmd from './commands/namespace-event'; +import platformInfraCommitCmd from './commands/platform-infra-commit'; +import platformInfraGetAllTreeNodesRecordCmd from './commands/platform-infra-get-all-tree-nodes-record'; +import platformInfraObjectCmd from './commands/platform-infra-object'; +import platformInfraRefCmd from './commands/platform-infra-ref'; +import platformInfraStoreCmd from './commands/platform-infra-store'; +import platformNamespaceCmd from './commands/platform-namespace'; +import platformNamespaceEventCmd from './commands/platform-namespace-event'; +import platformInfraInitEmptyRepoCmd from './commands/platform-infra-init-empty-repo'; +import platformInfraInsertNodeAtPathCmd from './commands/platform-infra-insert-node-at-path'; +import platformInfraSetDataAtPathCmd from './commands/platform-infra-set-data-at-path'; +import provisionBucketCmd from './commands/provision-bucket'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + 'db-preset': dbPresetCmd, + namespace: namespaceCmd, + 'namespace-event': namespaceEventCmd, + 'platform-infra-commit': platformInfraCommitCmd, + 'platform-infra-get-all-tree-nodes-record': platformInfraGetAllTreeNodesRecordCmd, + 'platform-infra-object': platformInfraObjectCmd, + 'platform-infra-ref': platformInfraRefCmd, + 'platform-infra-store': platformInfraStoreCmd, + 'platform-namespace': platformNamespaceCmd, + 'platform-namespace-event': platformNamespaceEventCmd, + 'platform-infra-init-empty-repo': platformInfraInitEmptyRepoCmd, + 'platform-infra-insert-node-at-path': platformInfraInsertNodeAtPathCmd, + 'platform-infra-set-data-at-path': platformInfraSetDataAtPathCmd, + 'provision-bucket': provisionBucketCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n db-preset dbPreset CRUD operations\n namespace namespace CRUD operations\n namespace-event namespaceEvent CRUD operations\n platform-infra-commit platformInfraCommit CRUD operations\n platform-infra-get-all-tree-nodes-record platformInfraGetAllTreeNodesRecord CRUD operations\n platform-infra-object platformInfraObject CRUD operations\n platform-infra-ref platformInfraRef CRUD operations\n platform-infra-store platformInfraStore CRUD operations\n platform-namespace platformNamespace CRUD operations\n platform-namespace-event platformNamespaceEvent CRUD operations\n platform-infra-init-empty-repo platformInfraInitEmptyRepo\n platform-infra-insert-node-at-path platformInfraInsertNodeAtPath\n platform-infra-set-data-at-path platformInfraSetDataAtPath\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n db-preset dbPreset CRUD operations\n namespace namespace CRUD operations\n namespace-event namespaceEvent CRUD operations\n platform-infra-commit platformInfraCommit CRUD operations\n platform-infra-get-all-tree-nodes-record platformInfraGetAllTreeNodesRecord CRUD operations\n platform-infra-object platformInfraObject CRUD operations\n platform-infra-ref platformInfraRef CRUD operations\n platform-infra-store platformInfraStore CRUD operations\n platform-namespace platformNamespace CRUD operations\n platform-namespace-event platformNamespaceEvent CRUD operations\n platform-infra-init-empty-repo platformInfraInitEmptyRepo\n platform-infra-insert-node-at-path platformInfraInsertNodeAtPath\n platform-infra-set-data-at-path platformInfraSetDataAtPath\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -67,4 +78,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/infra/cli/commands/auth.ts b/sdk/constructive-cli/src/infra/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/context.ts b/sdk/constructive-cli/src/infra/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/context.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/db-preset.ts b/sdk/constructive-cli/src/infra/cli/commands/db-preset.ts index 728e1cdfe2..b3c9d7af31 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/db-preset.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/db-preset.ts @@ -3,59 +3,73 @@ * @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 { CreateDbPresetInput, DbPresetPatch, DbPresetSelect, DbPresetFilter, DbPresetOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDbPresetInput, + DbPresetPatch, + DbPresetSelect, + DbPresetFilter, + DbPresetOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - active: "boolean", - commitId: "uuid", - createdAt: "string", - definition: "json", - description: "string", - id: "uuid", - label: "string", - modulesHash: "uuid", - slug: "string", - storeId: "uuid", - updatedAt: "string" + active: 'boolean', + commitId: 'uuid', + createdAt: 'string', + definition: 'json', + description: 'string', + id: 'uuid', + label: 'string', + modulesHash: 'uuid', + slug: 'string', + storeId: 'uuid', + updatedAt: 'string', }; -const usage = "\ndb-preset \n\nCommands:\n list List dbPreset records\n find-first Find first matching dbPreset record\n get Get a dbPreset by ID\n create Create a new dbPreset\n update Update an existing dbPreset\n delete Delete a dbPreset\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) => { +const usage = + '\ndb-preset \n\nCommands:\n list List dbPreset records\n find-first Find first matching dbPreset record\n get Get a dbPreset by ID\n create Create a new dbPreset\n update Update an existing dbPreset\n delete Delete a dbPreset\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq modulesHash: true, slug: true, storeId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DbPresetSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DbPresetSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPreset.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter modulesHash: true, slug: true, storeId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DbPresetSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DbPresetSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPreset.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.dbPreset.findOne({ - id: answers.id as string, - select: { - active: true, - commitId: true, - createdAt: true, - definition: true, - description: true, - id: true, - label: true, - modulesHash: true, - slug: true, - storeId: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPreset + .findOne({ + id: answers.id as string, + select: { + active: true, + commitId: true, + createdAt: true, + definition: true, + description: true, + id: true, + label: true, + modulesHash: true, + slug: true, + storeId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,84 +178,95 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "active", - message: "active", - required: false, - skipPrompt: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "definition", - message: "definition", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "modulesHash", - message: "modulesHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'active', + message: 'active', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'definition', + message: 'definition', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'modulesHash', + message: 'modulesHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbPresetInput["dbPreset"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbPresetInput['dbPreset']; const client = getClient(); - const result = await client.dbPreset.create({ - data: { - active: cleanedData.active, - commitId: cleanedData.commitId, - definition: cleanedData.definition, - description: cleanedData.description, - label: cleanedData.label, - modulesHash: cleanedData.modulesHash, - slug: cleanedData.slug, - storeId: cleanedData.storeId - }, - select: { - active: true, - commitId: true, - createdAt: true, - definition: true, - description: true, - id: true, - label: true, - modulesHash: true, - slug: true, - storeId: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPreset + .create({ + data: { + active: cleanedData.active, + commitId: cleanedData.commitId, + definition: cleanedData.definition, + description: cleanedData.description, + label: cleanedData.label, + modulesHash: cleanedData.modulesHash, + slug: cleanedData.slug, + storeId: cleanedData.storeId, + }, + select: { + active: true, + commitId: true, + createdAt: true, + definition: true, + description: true, + id: true, + label: true, + modulesHash: true, + slug: true, + storeId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,92 +275,104 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "active", - message: "active", - required: false, - skipPrompt: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "definition", - message: "definition", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "label", - message: "label", - required: false, - skipPrompt: true - }, { - type: "text", - name: "modulesHash", - message: "modulesHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "slug", - message: "slug", - required: false - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'active', + message: 'active', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'definition', + message: 'definition', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'label', + message: 'label', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'modulesHash', + message: 'modulesHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'slug', + message: 'slug', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DbPresetPatch; const client = getClient(); - const result = await client.dbPreset.update({ - where: { - id: answers.id as string - }, - data: { - active: cleanedData.active, - commitId: cleanedData.commitId, - definition: cleanedData.definition, - description: cleanedData.description, - label: cleanedData.label, - modulesHash: cleanedData.modulesHash, - slug: cleanedData.slug, - storeId: cleanedData.storeId - }, - select: { - active: true, - commitId: true, - createdAt: true, - definition: true, - description: true, - id: true, - label: true, - modulesHash: true, - slug: true, - storeId: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPreset + .update({ + where: { + id: answers.id as string, + }, + data: { + active: cleanedData.active, + commitId: cleanedData.commitId, + definition: cleanedData.definition, + description: cleanedData.description, + label: cleanedData.label, + modulesHash: cleanedData.modulesHash, + slug: cleanedData.slug, + storeId: cleanedData.storeId, + }, + select: { + active: true, + commitId: true, + createdAt: true, + definition: true, + description: true, + id: true, + label: true, + modulesHash: true, + slug: true, + storeId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -336,28 +381,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.dbPreset.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.dbPreset + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/namespace-event.ts b/sdk/constructive-cli/src/infra/cli/commands/namespace-event.ts index 26b5edda39..d93f3ed2d4 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/namespace-event.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/namespace-event.ts @@ -3,56 +3,70 @@ * @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 { CreateNamespaceEventInput, NamespaceEventPatch, NamespaceEventSelect, NamespaceEventFilter, NamespaceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateNamespaceEventInput, + NamespaceEventPatch, + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - databaseId: "uuid", - eventType: "string", - id: "uuid", - message: "string", - metadata: "json", - namespaceId: "uuid" + actorId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + eventType: 'string', + id: 'uuid', + message: 'string', + metadata: 'json', + namespaceId: 'uuid', }; -const usage = "\nnamespace-event \n\nCommands:\n list List namespaceEvent records\n find-first Find first matching namespaceEvent record\n get Get a namespaceEvent by ID\n create Create a new namespaceEvent\n update Update an existing namespaceEvent\n delete Delete a namespaceEvent\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) => { +const usage = + '\nnamespace-event \n\nCommands:\n list List namespaceEvent records\n find-first Find first matching namespaceEvent record\n get Get a namespaceEvent by ID\n create Create a new namespaceEvent\n update Update an existing namespaceEvent\n delete Delete a namespaceEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, message: true, metadata: true, - namespaceId: true + namespaceId: true, }; - const findManyArgs = parseFindManyArgs & { - select: NamespaceEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: NamespaceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespaceEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +111,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, message: true, metadata: true, - namespaceId: true + namespaceId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: NamespaceEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: NamespaceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespaceEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +131,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.namespaceEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.namespaceEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,66 +166,78 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateNamespaceEventInput["namespaceEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateNamespaceEventInput['namespaceEvent']; const client = getClient(); - const result = await client.namespaceEvent.create({ - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - namespaceId: cleanedData.namespaceId - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.namespaceEvent + .create({ + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + namespaceId: cleanedData.namespaceId, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -212,80 +246,91 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as NamespaceEventPatch; const client = getClient(); - const result = await client.namespaceEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - databaseId: cleanedData.databaseId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - namespaceId: cleanedData.namespaceId - }, - select: { - actorId: true, - createdAt: true, - databaseId: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.namespaceEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + namespaceId: cleanedData.namespaceId, + }, + select: { + actorId: true, + createdAt: true, + databaseId: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -294,34 +339,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.namespaceEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.namespaceEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/namespace.ts b/sdk/constructive-cli/src/infra/cli/commands/namespace.ts index 4210542a81..8250becd02 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/namespace.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/namespace.ts @@ -3,61 +3,75 @@ * @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 { CreateNamespaceInput, NamespacePatch, NamespaceSelect, NamespaceFilter, NamespaceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateNamespaceInput, + NamespacePatch, + NamespaceSelect, + NamespaceFilter, + NamespaceOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - databaseId: "uuid", - description: "string", - id: "uuid", - isActive: "boolean", - isManaged: "boolean", - labels: "json", - lastError: "string", - name: "string", - namespaceName: "string", - status: "string", - updatedAt: "string" + annotations: 'json', + createdAt: 'string', + databaseId: 'uuid', + description: 'string', + id: 'uuid', + isActive: 'boolean', + isManaged: 'boolean', + labels: 'json', + lastError: 'string', + name: 'string', + namespaceName: 'string', + status: 'string', + updatedAt: 'string', }; -const usage = "\nnamespace \n\nCommands:\n list List namespace records\n find-first Find first matching namespace record\n get Get a namespace by ID\n create Create a new namespace\n update Update an existing namespace\n delete Delete a namespace\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) => { +const usage = + '\nnamespace \n\nCommands:\n list List namespace records\n find-first Find first matching namespace record\n get Get a namespace by ID\n create Create a new namespace\n update Update an existing namespace\n delete Delete a namespace\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, namespaceName: true, status: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: NamespaceSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: NamespaceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespace.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, namespaceName: true, status: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: NamespaceSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: NamespaceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespace.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.namespace.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.namespace + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,99 +186,112 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isManaged", - message: "isManaged", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceName", - message: "namespaceName", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isManaged', + message: 'isManaged', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceName', + message: 'namespaceName', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateNamespaceInput["namespace"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateNamespaceInput['namespace']; const client = getClient(); - const result = await client.namespace.create({ - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isActive: cleanedData.isActive, - isManaged: cleanedData.isManaged, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - name: cleanedData.name, - namespaceName: cleanedData.namespaceName, - status: cleanedData.status - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.namespace + .create({ + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isActive: cleanedData.isActive, + isManaged: cleanedData.isManaged, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + name: cleanedData.name, + namespaceName: cleanedData.namespaceName, + status: cleanedData.status, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -265,107 +300,121 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isManaged", - message: "isManaged", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceName", - message: "namespaceName", - required: false - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isManaged', + message: 'isManaged', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceName', + message: 'namespaceName', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as NamespacePatch; const client = getClient(); - const result = await client.namespace.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - isActive: cleanedData.isActive, - isManaged: cleanedData.isManaged, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - name: cleanedData.name, - namespaceName: cleanedData.namespaceName, - status: cleanedData.status - }, - select: { - annotations: true, - createdAt: true, - databaseId: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.namespace + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + isActive: cleanedData.isActive, + isManaged: cleanedData.isManaged, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + name: cleanedData.name, + namespaceName: cleanedData.namespaceName, + status: cleanedData.status, + }, + select: { + annotations: true, + createdAt: true, + databaseId: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -374,28 +423,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.namespace.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.namespace + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-commit.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-commit.ts index 4b89a1fb63..01724e9862 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-commit.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-commit.ts @@ -3,57 +3,71 @@ * @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 { CreatePlatformInfraCommitInput, PlatformInfraCommitPatch, PlatformInfraCommitSelect, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraCommitInput, + PlatformInfraCommitPatch, + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - authorId: "uuid", - committerId: "uuid", - date: "string", - id: "uuid", - message: "string", - parentIds: "uuid", - scopeId: "uuid", - storeId: "uuid", - treeId: "uuid" + authorId: 'uuid', + committerId: 'uuid', + date: 'string', + id: 'uuid', + message: 'string', + parentIds: 'uuid', + scopeId: 'uuid', + storeId: 'uuid', + treeId: 'uuid', }; -const usage = "\nplatform-infra-commit \n\nCommands:\n list List platformInfraCommit records\n find-first Find first matching platformInfraCommit record\n get Get a platformInfraCommit by ID\n create Create a new platformInfraCommit\n update Update an existing platformInfraCommit\n delete Delete a platformInfraCommit\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) => { +const usage = + '\nplatform-infra-commit \n\nCommands:\n list List platformInfraCommit records\n find-first Find first matching platformInfraCommit record\n get Get a platformInfraCommit by ID\n create Create a new platformInfraCommit\n update Update an existing platformInfraCommit\n delete Delete a platformInfraCommit\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq parentIds: true, scopeId: true, storeId: true, - treeId: true + treeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraCommitSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + > & { + select: PlatformInfraCommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraCommit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter parentIds: true, scopeId: true, storeId: true, - treeId: true + treeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraCommitSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + > & { + select: PlatformInfraCommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraCommit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformInfraCommit.findOne({ - id: answers.id as string, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.platformInfraCommit + .findOne({ + id: answers.id as string, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +178,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraCommitInput["platformInfraCommit"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraCommitInput['platformInfraCommit']; const client = getClient(); - const result = await client.platformInfraCommit.create({ - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - scopeId: cleanedData.scopeId, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.platformInfraCommit + .create({ + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + scopeId: cleanedData.scopeId, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +276,102 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformInfraCommitPatch; const client = getClient(); - const result = await client.platformInfraCommit.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - date: true, - id: true, - message: true, - parentIds: true, - scopeId: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.platformInfraCommit + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + date: true, + id: true, + message: true, + parentIds: true, + scopeId: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,34 +380,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformInfraCommit.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformInfraCommit + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-get-all-tree-nodes-record.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-get-all-tree-nodes-record.ts index 8d892d2e8c..6283b9d768 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-get-all-tree-nodes-record.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-get-all-tree-nodes-record.ts @@ -3,44 +3,58 @@ * @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 { CreatePlatformInfraGetAllTreeNodesRecordInput, PlatformInfraGetAllTreeNodesRecordPatch, PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraGetAllTreeNodesRecordInput, + PlatformInfraGetAllTreeNodesRecordPatch, + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - data: "json", - path: "string" + data: 'json', + path: 'string', }; -const usage = "\nplatform-infra-get-all-tree-nodes-record \n\nCommands:\n list List platformInfraGetAllTreeNodesRecord records\n find-first Find first matching platformInfraGetAllTreeNodesRecord record\n create Create a new platformInfraGetAllTreeNodesRecord\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) => { +const usage = + '\nplatform-infra-get-all-tree-nodes-record \n\nCommands:\n list List platformInfraGetAllTreeNodesRecord records\n find-first Find first matching platformInfraGetAllTreeNodesRecord record\n create Create a new platformInfraGetAllTreeNodesRecord\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -51,16 +65,22 @@ async function handleList(argv: Partial>, _prompter: Inq try { const defaultSelect = { data: true, - path: true + path: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraGetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: PlatformInfraGetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraGetAllTreeNodesRecord.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -71,16 +91,24 @@ async function handleFindFirst(argv: Partial>, _prompter try { const defaultSelect = { data: true, - path: true + path: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraGetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: PlatformInfraGetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); - const result = await client.platformInfraGetAllTreeNodesRecord.findFirst(findFirstArgs).execute(); + const result = await client.platformInfraGetAllTreeNodesRecord + .findFirst(findFirstArgs) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -89,36 +117,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "path", - message: "path", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraGetAllTreeNodesRecordInput["platformInfraGetAllTreeNodesRecord"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord']; const client = getClient(); - const result = await client.platformInfraGetAllTreeNodesRecord.create({ - data: { - data: cleanedData.data, - path: cleanedData.path - }, - select: { - data: true, - path: true - } - }).execute(); + const result = await client.platformInfraGetAllTreeNodesRecord + .create({ + data: { + data: cleanedData.data, + path: cleanedData.path, + }, + select: { + data: true, + path: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-init-empty-repo.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-init-empty-repo.ts index 7b64adfcd8..ed24198f2c 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-init-empty-repo.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-init-empty-repo.ts @@ -3,37 +3,51 @@ * @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 { PlatformInfraInitEmptyRepoVariables } from "../../orm/mutation"; -import type { PlatformInfraInitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInfraInitEmptyRepoVariables } from '../../orm/mutation'; +import type { PlatformInfraInitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-infra-init-empty-repo - platformInfraInitEmptyRepo\n\nUsage: platform-infra-init-empty-repo [OPTIONS]\n"); + console.log( + 'platform-infra-init-empty-repo - platformInfraInitEmptyRepo\n\nUsage: platform-infra-init-empty-repo [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInfraInitEmptyRepo(parsedAnswers as unknown as PlatformInfraInitEmptyRepoVariables, { - select: selectFields - } as unknown as { - select: PlatformInfraInitEmptyRepoPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInfraInitEmptyRepo( + parsedAnswers as unknown as PlatformInfraInitEmptyRepoVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInfraInitEmptyRepoPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInfraInitEmptyRepo"); + console.error('Failed: platformInfraInitEmptyRepo'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-insert-node-at-path.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-insert-node-at-path.ts index d42b47ea3a..31a2a161d7 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-insert-node-at-path.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-insert-node-at-path.ts @@ -3,37 +3,51 @@ * @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 { PlatformInfraInsertNodeAtPathVariables } from "../../orm/mutation"; -import type { PlatformInfraInsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInfraInsertNodeAtPathVariables } from '../../orm/mutation'; +import type { PlatformInfraInsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-infra-insert-node-at-path - platformInfraInsertNodeAtPath\n\nUsage: platform-infra-insert-node-at-path [OPTIONS]\n"); + console.log( + 'platform-infra-insert-node-at-path - platformInfraInsertNodeAtPath\n\nUsage: platform-infra-insert-node-at-path [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInfraInsertNodeAtPath(parsedAnswers as unknown as PlatformInfraInsertNodeAtPathVariables, { - select: selectFields - } as unknown as { - select: PlatformInfraInsertNodeAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInfraInsertNodeAtPath( + parsedAnswers as unknown as PlatformInfraInsertNodeAtPathVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInfraInsertNodeAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInfraInsertNodeAtPath"); + console.error('Failed: platformInfraInsertNodeAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-object.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-object.ts index c624a315a8..f42fdc567b 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-object.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-object.ts @@ -3,54 +3,68 @@ * @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 { CreatePlatformInfraObjectInput, PlatformInfraObjectPatch, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraObjectInput, + PlatformInfraObjectPatch, + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - id: "uuid", - kids: "uuid", - ktree: "string", - scopeId: "uuid" + createdAt: 'string', + data: 'json', + id: 'uuid', + kids: 'uuid', + ktree: 'string', + scopeId: 'uuid', }; -const usage = "\nplatform-infra-object \n\nCommands:\n list List platformInfraObject records\n find-first Find first matching platformInfraObject record\n get Get a platformInfraObject by ID\n create Create a new platformInfraObject\n update Update an existing platformInfraObject\n delete Delete a platformInfraObject\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) => { +const usage = + '\nplatform-infra-object \n\nCommands:\n list List platformInfraObject records\n find-first Find first matching platformInfraObject record\n get Get a platformInfraObject by ID\n create Create a new platformInfraObject\n update Update an existing platformInfraObject\n delete Delete a platformInfraObject\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, kids: true, ktree: true, - scopeId: true + scopeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraObjectSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + > & { + select: PlatformInfraObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraObject.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +109,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, kids: true, ktree: true, - scopeId: true + scopeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraObjectSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + > & { + select: PlatformInfraObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraObject.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +133,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformInfraObject.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraObject + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,52 +166,62 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraObjectInput["platformInfraObject"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraObjectInput['platformInfraObject']; const client = getClient(); - const result = await client.platformInfraObject.create({ - data: { - data: cleanedData.data, - kids: cleanedData.kids, - ktree: cleanedData.ktree, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraObject + .create({ + data: { + data: cleanedData.data, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -190,60 +230,68 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformInfraObjectPatch; const client = getClient(); - const result = await client.platformInfraObject.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - data: cleanedData.data, - kids: cleanedData.kids, - ktree: cleanedData.ktree - }, - select: { - createdAt: true, - data: true, - id: true, - kids: true, - ktree: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraObject + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + data: cleanedData.data, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + }, + select: { + createdAt: true, + data: true, + id: true, + kids: true, + ktree: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -252,34 +300,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformInfraObject.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformInfraObject + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-ref.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-ref.ts index 5f6405a2ca..1199479403 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-ref.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-ref.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformInfraRefInput, PlatformInfraRefPatch, PlatformInfraRefSelect, PlatformInfraRefFilter, PlatformInfraRefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraRefInput, + PlatformInfraRefPatch, + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - commitId: "uuid", - id: "uuid", - name: "string", - scopeId: "uuid", - storeId: "uuid" + commitId: 'uuid', + id: 'uuid', + name: 'string', + scopeId: 'uuid', + storeId: 'uuid', }; -const usage = "\nplatform-infra-ref \n\nCommands:\n list List platformInfraRef records\n find-first Find first matching platformInfraRef record\n get Get a platformInfraRef by ID\n create Create a new platformInfraRef\n update Update an existing platformInfraRef\n delete Delete a platformInfraRef\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) => { +const usage = + '\nplatform-infra-ref \n\nCommands:\n list List platformInfraRef records\n find-first Find first matching platformInfraRef record\n get Get a platformInfraRef by ID\n create Create a new platformInfraRef\n update Update an existing platformInfraRef\n delete Delete a platformInfraRef\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, name: true, scopeId: true, - storeId: true + storeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraRefSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformInfraRefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraRef.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, name: true, scopeId: true, - storeId: true + storeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraRefSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformInfraRefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraRef.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformInfraRef.findOne({ - id: answers.id as string, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.platformInfraRef + .findOne({ + id: answers.id as string, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,49 +154,59 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraRefInput["platformInfraRef"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraRefInput['platformInfraRef']; const client = getClient(); - const result = await client.platformInfraRef.create({ - data: { - commitId: cleanedData.commitId, - name: cleanedData.name, - scopeId: cleanedData.scopeId, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.platformInfraRef + .create({ + data: { + commitId: cleanedData.commitId, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -183,57 +215,65 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "scopeId", - message: "scopeId", - required: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformInfraRefPatch; const client = getClient(); - const result = await client.platformInfraRef.update({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - data: { - commitId: cleanedData.commitId, - name: cleanedData.name, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - id: true, - name: true, - scopeId: true, - storeId: true - } - }).execute(); + const result = await client.platformInfraRef + .update({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + data: { + commitId: cleanedData.commitId, + name: cleanedData.name, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + id: true, + name: true, + scopeId: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,34 +282,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformInfraRef.delete({ - where: { - id: answers.id as string, - scopeId: answers.scopeId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformInfraRef + .delete({ + where: { + id: answers.id as string, + scopeId: answers.scopeId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-set-data-at-path.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-set-data-at-path.ts index 4746c396c8..a08f131c85 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-set-data-at-path.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-set-data-at-path.ts @@ -3,37 +3,51 @@ * @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 { PlatformInfraSetDataAtPathVariables } from "../../orm/mutation"; -import type { PlatformInfraSetDataAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformInfraSetDataAtPathVariables } from '../../orm/mutation'; +import type { PlatformInfraSetDataAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("platform-infra-set-data-at-path - platformInfraSetDataAtPath\n\nUsage: platform-infra-set-data-at-path [OPTIONS]\n"); + console.log( + 'platform-infra-set-data-at-path - platformInfraSetDataAtPath\n\nUsage: platform-infra-set-data-at-path [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const 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.platformInfraSetDataAtPath(parsedAnswers as unknown as PlatformInfraSetDataAtPathVariables, { - select: selectFields - } as unknown as { - select: PlatformInfraSetDataAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformInfraSetDataAtPath( + parsedAnswers as unknown as PlatformInfraSetDataAtPathVariables, + { + select: selectFields, + } as unknown as { + select: PlatformInfraSetDataAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: platformInfraSetDataAtPath"); + console.error('Failed: platformInfraSetDataAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-store.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-store.ts index e13889326f..00de9e0155 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-infra-store.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-infra-store.ts @@ -3,53 +3,67 @@ * @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 { CreatePlatformInfraStoreInput, PlatformInfraStorePatch, PlatformInfraStoreSelect, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformInfraStoreInput, + PlatformInfraStorePatch, + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - hash: "uuid", - id: "uuid", - name: "string", - scopeId: "uuid" + createdAt: 'string', + hash: 'uuid', + id: 'uuid', + name: 'string', + scopeId: 'uuid', }; -const usage = "\nplatform-infra-store \n\nCommands:\n list List platformInfraStore records\n find-first Find first matching platformInfraStore record\n get Get a platformInfraStore by ID\n create Create a new platformInfraStore\n update Update an existing platformInfraStore\n delete Delete a platformInfraStore\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) => { +const usage = + '\nplatform-infra-store \n\nCommands:\n list List platformInfraStore records\n find-first Find first matching platformInfraStore record\n get Get a platformInfraStore by ID\n create Create a new platformInfraStore\n update Update an existing platformInfraStore\n delete Delete a platformInfraStore\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq hash: true, id: true, name: true, - scopeId: true + scopeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformInfraStoreSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + > & { + select: PlatformInfraStoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraStore.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter hash: true, id: true, name: true, - scopeId: true + scopeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformInfraStoreSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + > & { + select: PlatformInfraStoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformInfraStore.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformInfraStore.findOne({ - id: answers.id as string, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraStore + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,43 +162,52 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformInfraStoreInput["platformInfraStore"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformInfraStoreInput['platformInfraStore']; const client = getClient(); - const result = await client.platformInfraStore.create({ - data: { - hash: cleanedData.hash, - name: cleanedData.name, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraStore + .create({ + data: { + hash: cleanedData.hash, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -177,51 +216,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "scopeId", - message: "scopeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'scopeId', + message: 'scopeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformInfraStorePatch; const client = getClient(); - const result = await client.platformInfraStore.update({ - where: { - id: answers.id as string - }, - data: { - hash: cleanedData.hash, - name: cleanedData.name, - scopeId: cleanedData.scopeId - }, - select: { - createdAt: true, - hash: true, - id: true, - name: true, - scopeId: true - } - }).execute(); + const result = await client.platformInfraStore + .update({ + where: { + id: answers.id as string, + }, + data: { + hash: cleanedData.hash, + name: cleanedData.name, + scopeId: cleanedData.scopeId, + }, + select: { + createdAt: true, + hash: true, + id: true, + name: true, + scopeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -230,28 +276,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformInfraStore.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformInfraStore + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-namespace-event.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-namespace-event.ts index 19a0973f9c..61456547a7 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-namespace-event.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-namespace-event.ts @@ -3,55 +3,69 @@ * @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 { CreatePlatformNamespaceEventInput, PlatformNamespaceEventPatch, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformNamespaceEventInput, + PlatformNamespaceEventPatch, + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - eventType: "string", - id: "uuid", - message: "string", - metadata: "json", - namespaceId: "uuid" + actorId: 'uuid', + createdAt: 'string', + eventType: 'string', + id: 'uuid', + message: 'string', + metadata: 'json', + namespaceId: 'uuid', }; -const usage = "\nplatform-namespace-event \n\nCommands:\n list List platformNamespaceEvent records\n find-first Find first matching platformNamespaceEvent record\n get Get a platformNamespaceEvent by ID\n create Create a new platformNamespaceEvent\n update Update an existing platformNamespaceEvent\n delete Delete a platformNamespaceEvent\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) => { +const usage = + '\nplatform-namespace-event \n\nCommands:\n list List platformNamespaceEvent records\n find-first Find first matching platformNamespaceEvent record\n get Get a platformNamespaceEvent by ID\n create Create a new platformNamespaceEvent\n update Update an existing platformNamespaceEvent\n delete Delete a platformNamespaceEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, message: true, metadata: true, - namespaceId: true + namespaceId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformNamespaceEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + > & { + select: PlatformNamespaceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformNamespaceEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, message: true, metadata: true, - namespaceId: true + namespaceId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformNamespaceEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + > & { + select: PlatformNamespaceEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformNamespaceEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformNamespaceEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.platformNamespaceEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,59 +170,70 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformNamespaceEventInput["platformNamespaceEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformNamespaceEventInput['platformNamespaceEvent']; const client = getClient(); - const result = await client.platformNamespaceEvent.create({ - data: { - actorId: cleanedData.actorId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - namespaceId: cleanedData.namespaceId - }, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.platformNamespaceEvent + .create({ + data: { + actorId: cleanedData.actorId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + namespaceId: cleanedData.namespaceId, + }, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -201,73 +242,83 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "json", - name: "metadata", - message: "metadata", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceId", - message: "namespaceId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformNamespaceEventPatch; const client = getClient(); - const result = await client.platformNamespaceEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - eventType: cleanedData.eventType, - message: cleanedData.message, - metadata: cleanedData.metadata, - namespaceId: cleanedData.namespaceId - }, - select: { - actorId: true, - createdAt: true, - eventType: true, - id: true, - message: true, - metadata: true, - namespaceId: true - } - }).execute(); + const result = await client.platformNamespaceEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + eventType: cleanedData.eventType, + message: cleanedData.message, + metadata: cleanedData.metadata, + namespaceId: cleanedData.namespaceId, + }, + select: { + actorId: true, + createdAt: true, + eventType: true, + id: true, + message: true, + metadata: true, + namespaceId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -276,34 +327,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.platformNamespaceEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformNamespaceEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/platform-namespace.ts b/sdk/constructive-cli/src/infra/cli/commands/platform-namespace.ts index deca11906d..e005043d68 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/platform-namespace.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/platform-namespace.ts @@ -3,60 +3,74 @@ * @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 { CreatePlatformNamespaceInput, PlatformNamespacePatch, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformNamespaceInput, + PlatformNamespacePatch, + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - annotations: "json", - createdAt: "string", - description: "string", - id: "uuid", - isActive: "boolean", - isManaged: "boolean", - labels: "json", - lastError: "string", - name: "string", - namespaceName: "string", - status: "string", - updatedAt: "string" + annotations: 'json', + createdAt: 'string', + description: 'string', + id: 'uuid', + isActive: 'boolean', + isManaged: 'boolean', + labels: 'json', + lastError: 'string', + name: 'string', + namespaceName: 'string', + status: 'string', + updatedAt: 'string', }; -const usage = "\nplatform-namespace \n\nCommands:\n list List platformNamespace records\n find-first Find first matching platformNamespace record\n get Get a platformNamespace by ID\n create Create a new platformNamespace\n update Update an existing platformNamespace\n delete Delete a platformNamespace\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) => { +const usage = + '\nplatform-namespace \n\nCommands:\n list List platformNamespace records\n find-first Find first matching platformNamespace record\n get Get a platformNamespace by ID\n create Create a new platformNamespace\n update Update an existing platformNamespace\n delete Delete a platformNamespace\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, namespaceName: true, status: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlatformNamespaceSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformNamespaceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformNamespace.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +123,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, namespaceName: true, status: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlatformNamespaceSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformNamespaceSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.platformNamespace.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +143,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.platformNamespace.findOne({ - id: answers.id as string, - select: { - annotations: true, - createdAt: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformNamespace + .findOne({ + id: answers.id as string, + select: { + annotations: true, + createdAt: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,92 +182,107 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isManaged", - message: "isManaged", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "namespaceName", - message: "namespaceName", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isManaged', + message: 'isManaged', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'namespaceName', + message: 'namespaceName', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlatformNamespaceInput["platformNamespace"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformNamespaceInput['platformNamespace']; const client = getClient(); - const result = await client.platformNamespace.create({ - data: { - annotations: cleanedData.annotations, - description: cleanedData.description, - isActive: cleanedData.isActive, - isManaged: cleanedData.isManaged, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - name: cleanedData.name, - namespaceName: cleanedData.namespaceName, - status: cleanedData.status - }, - select: { - annotations: true, - createdAt: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformNamespace + .create({ + data: { + annotations: cleanedData.annotations, + description: cleanedData.description, + isActive: cleanedData.isActive, + isManaged: cleanedData.isManaged, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + name: cleanedData.name, + namespaceName: cleanedData.namespaceName, + status: cleanedData.status, + }, + select: { + annotations: true, + createdAt: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -254,100 +291,113 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "annotations", - message: "annotations", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isActive", - message: "isActive", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isManaged", - message: "isManaged", - required: false, - skipPrompt: true - }, { - type: "json", - name: "labels", - message: "labels", - required: false, - skipPrompt: true - }, { - type: "text", - name: "lastError", - message: "lastError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "namespaceName", - message: "namespaceName", - required: false - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isActive', + message: 'isActive', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isManaged', + message: 'isManaged', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'namespaceName', + message: 'namespaceName', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlatformNamespacePatch; const client = getClient(); - const result = await client.platformNamespace.update({ - where: { - id: answers.id as string - }, - data: { - annotations: cleanedData.annotations, - description: cleanedData.description, - isActive: cleanedData.isActive, - isManaged: cleanedData.isManaged, - labels: cleanedData.labels, - lastError: cleanedData.lastError, - name: cleanedData.name, - namespaceName: cleanedData.namespaceName, - status: cleanedData.status - }, - select: { - annotations: true, - createdAt: true, - description: true, - id: true, - isActive: true, - isManaged: true, - labels: true, - lastError: true, - name: true, - namespaceName: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.platformNamespace + .update({ + where: { + id: answers.id as string, + }, + data: { + annotations: cleanedData.annotations, + description: cleanedData.description, + isActive: cleanedData.isActive, + isManaged: cleanedData.isManaged, + labels: cleanedData.labels, + lastError: cleanedData.lastError, + name: cleanedData.name, + namespaceName: cleanedData.namespaceName, + status: cleanedData.status, + }, + select: { + annotations: true, + createdAt: true, + description: true, + id: true, + isActive: true, + isManaged: true, + labels: true, + lastError: true, + name: true, + namespaceName: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -356,28 +406,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.platformNamespace.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.platformNamespace + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/infra/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/infra/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/infra/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/infra/cli/executor.ts b/sdk/constructive-cli/src/infra/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/infra/cli/executor.ts +++ b/sdk/constructive-cli/src/infra/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/cli/index.ts b/sdk/constructive-cli/src/infra/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/infra/cli/index.ts +++ b/sdk/constructive-cli/src/infra/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/infra/cli/utils.ts b/sdk/constructive-cli/src/infra/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/infra/cli/utils.ts +++ b/sdk/constructive-cli/src/infra/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/infra/index.ts b/sdk/constructive-cli/src/infra/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/infra/index.ts +++ b/sdk/constructive-cli/src/infra/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/infra/orm/client.ts b/sdk/constructive-cli/src/infra/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/infra/orm/client.ts +++ b/sdk/constructive-cli/src/infra/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/infra/orm/index.ts b/sdk/constructive-cli/src/infra/orm/index.ts index e121317be7..c40f0234ec 100644 --- a/sdk/constructive-cli/src/infra/orm/index.ts +++ b/sdk/constructive-cli/src/infra/orm/index.ts @@ -3,25 +3,25 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { DbPresetModel } from "./models/dbPreset"; -import { NamespaceModel } from "./models/namespace"; -import { NamespaceEventModel } from "./models/namespaceEvent"; -import { PlatformInfraCommitModel } from "./models/platformInfraCommit"; -import { PlatformInfraGetAllTreeNodesRecordModel } from "./models/platformInfraGetAllTreeNodesRecord"; -import { PlatformInfraObjectModel } from "./models/platformInfraObject"; -import { PlatformInfraRefModel } from "./models/platformInfraRef"; -import { PlatformInfraStoreModel } from "./models/platformInfraStore"; -import { PlatformNamespaceModel } from "./models/platformNamespace"; -import { PlatformNamespaceEventModel } from "./models/platformNamespaceEvent"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { DbPresetModel } from './models/dbPreset'; +import { NamespaceModel } from './models/namespace'; +import { NamespaceEventModel } from './models/namespaceEvent'; +import { PlatformInfraCommitModel } from './models/platformInfraCommit'; +import { PlatformInfraGetAllTreeNodesRecordModel } from './models/platformInfraGetAllTreeNodesRecord'; +import { PlatformInfraObjectModel } from './models/platformInfraObject'; +import { PlatformInfraRefModel } from './models/platformInfraRef'; +import { PlatformInfraStoreModel } from './models/platformInfraStore'; +import { PlatformNamespaceModel } from './models/platformNamespace'; +import { PlatformNamespaceEventModel } from './models/platformNamespaceEvent'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -58,6 +58,6 @@ export function createClient(config: OrmClientConfig) { platformInfraStore: new PlatformInfraStoreModel(client), platformNamespace: new PlatformNamespaceModel(client), platformNamespaceEvent: new PlatformNamespaceEventModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/input-types.ts b/sdk/constructive-cli/src/infra/orm/input-types.ts index 1ac2c6461a..23e81e113d 100644 --- a/sdk/constructive-cli/src/infra/orm/input-types.ts +++ b/sdk/constructive-cli/src/infra/orm/input-types.ts @@ -436,12 +436,14 @@ export type DbPresetWithRelations = DbPreset & DbPresetRelations; export type NamespaceWithRelations = Namespace & NamespaceRelations; export type NamespaceEventWithRelations = NamespaceEvent & NamespaceEventRelations; export type PlatformInfraCommitWithRelations = PlatformInfraCommit & PlatformInfraCommitRelations; -export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & PlatformInfraGetAllTreeNodesRecordRelations; +export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & + PlatformInfraGetAllTreeNodesRecordRelations; export type PlatformInfraObjectWithRelations = PlatformInfraObject & PlatformInfraObjectRelations; export type PlatformInfraRefWithRelations = PlatformInfraRef & PlatformInfraRefRelations; export type PlatformInfraStoreWithRelations = PlatformInfraStore & PlatformInfraStoreRelations; export type PlatformNamespaceWithRelations = PlatformNamespace & PlatformNamespaceRelations; -export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & PlatformNamespaceEventRelations; +export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & + PlatformNamespaceEventRelations; // ============ Entity Select Types ============ export type DbPresetSelect = { active?: boolean; @@ -774,16 +776,202 @@ export interface PlatformNamespaceEventFilter { or?: PlatformNamespaceEventFilter[]; } // ============ OrderBy Types ============ -export type DbPresetOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MODULES_HASH_ASC" | "MODULES_HASH_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformInfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type PlatformInfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type PlatformInfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformInfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type PlatformInfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformNamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformNamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type DbPresetOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MODULES_HASH_ASC' + | 'MODULES_HASH_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformInfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type PlatformInfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type PlatformInfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformInfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type PlatformInfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformNamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformNamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; // ============ CRUD Input Types ============ export interface CreateDbPresetInput { clientMutationId?: string; @@ -1826,4 +2014,4 @@ export type PlatformNamespaceEventEdgeSelect = { node?: { select: PlatformNamespaceEventSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/infra/orm/models/dbPreset.ts b/sdk/constructive-cli/src/infra/orm/models/dbPreset.ts index 15b60268b5..a3e824a674 100644 --- a/sdk/constructive-cli/src/infra/orm/models/dbPreset.ts +++ b/sdk/constructive-cli/src/infra/orm/models/dbPreset.ts @@ -3,56 +3,96 @@ * @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 { DbPreset, DbPresetWithRelations, DbPresetSelect, DbPresetFilter, DbPresetOrderBy, CreateDbPresetInput, UpdateDbPresetInput, DbPresetPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPreset, + DbPresetWithRelations, + DbPresetSelect, + DbPresetFilter, + DbPresetOrderBy, + CreateDbPresetInput, + UpdateDbPresetInput, + DbPresetPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", 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 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + 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, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPresets", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPresets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPreset", "dbPresets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPreset", "createDbPreset", "dbPreset", args.select, args.data, "CreateDbPresetInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPreset', + 'createDbPreset', + 'dbPreset', + args.select, + args.data, + 'CreateDbPresetInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "createDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'createDbPreset', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPreset", "updateDbPreset", "dbPreset", args.select, args.where.id, args.data, "UpdateDbPresetInput", "id", "dbPresetPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPreset', + 'updateDbPreset', + 'dbPreset', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetInput', + 'id', + 'dbPresetPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "updateDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'updateDbPreset', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPreset", "deleteDbPreset", "dbPreset", { - id: args.where.id - }, "DeleteDbPresetInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPreset', + 'deleteDbPreset', + 'dbPreset', + { + id: args.where.id, + }, + 'DeleteDbPresetInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "deleteDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'deleteDbPreset', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/index.ts b/sdk/constructive-cli/src/infra/orm/models/index.ts index 60d8e491d5..1e5132eecf 100644 --- a/sdk/constructive-cli/src/infra/orm/models/index.ts +++ b/sdk/constructive-cli/src/infra/orm/models/index.ts @@ -3,13 +3,13 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { DbPresetModel } from "./dbPreset"; -export { NamespaceModel } from "./namespace"; -export { NamespaceEventModel } from "./namespaceEvent"; -export { PlatformInfraCommitModel } from "./platformInfraCommit"; -export { PlatformInfraGetAllTreeNodesRecordModel } from "./platformInfraGetAllTreeNodesRecord"; -export { PlatformInfraObjectModel } from "./platformInfraObject"; -export { PlatformInfraRefModel } from "./platformInfraRef"; -export { PlatformInfraStoreModel } from "./platformInfraStore"; -export { PlatformNamespaceModel } from "./platformNamespace"; -export { PlatformNamespaceEventModel } from "./platformNamespaceEvent"; \ No newline at end of file +export { DbPresetModel } from './dbPreset'; +export { NamespaceModel } from './namespace'; +export { NamespaceEventModel } from './namespaceEvent'; +export { PlatformInfraCommitModel } from './platformInfraCommit'; +export { PlatformInfraGetAllTreeNodesRecordModel } from './platformInfraGetAllTreeNodesRecord'; +export { PlatformInfraObjectModel } from './platformInfraObject'; +export { PlatformInfraRefModel } from './platformInfraRef'; +export { PlatformInfraStoreModel } from './platformInfraStore'; +export { PlatformNamespaceModel } from './platformNamespace'; +export { PlatformNamespaceEventModel } from './platformNamespaceEvent'; diff --git a/sdk/constructive-cli/src/infra/orm/models/namespace.ts b/sdk/constructive-cli/src/infra/orm/models/namespace.ts index 8c2bf42876..4e300068cd 100644 --- a/sdk/constructive-cli/src/infra/orm/models/namespace.ts +++ b/sdk/constructive-cli/src/infra/orm/models/namespace.ts @@ -3,56 +3,96 @@ * @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 { Namespace, NamespaceWithRelations, NamespaceSelect, NamespaceFilter, NamespaceOrderBy, CreateNamespaceInput, UpdateNamespaceInput, NamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Namespace, + NamespaceWithRelations, + NamespaceSelect, + NamespaceFilter, + NamespaceOrderBy, + CreateNamespaceInput, + UpdateNamespaceInput, + NamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", 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 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + 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, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespaces", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Namespace", "namespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Namespace", "createNamespace", "namespace", args.select, args.data, "CreateNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Namespace', + 'createNamespace', + 'namespace', + args.select, + args.data, + 'CreateNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "createNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'createNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Namespace", "updateNamespace", "namespace", args.select, args.where.id, args.data, "UpdateNamespaceInput", "id", "namespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Namespace', + 'updateNamespace', + 'namespace', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceInput', + 'id', + 'namespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "updateNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'updateNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Namespace", "deleteNamespace", "namespace", { - id: args.where.id - }, "DeleteNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Namespace', + 'deleteNamespace', + 'namespace', + { + id: args.where.id, + }, + 'DeleteNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "deleteNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'deleteNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/namespaceEvent.ts b/sdk/constructive-cli/src/infra/orm/models/namespaceEvent.ts index 5fab4853c7..494442c263 100644 --- a/sdk/constructive-cli/src/infra/orm/models/namespaceEvent.ts +++ b/sdk/constructive-cli/src/infra/orm/models/namespaceEvent.ts @@ -3,56 +3,96 @@ * @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 { NamespaceEvent, NamespaceEventWithRelations, NamespaceEventSelect, NamespaceEventFilter, NamespaceEventOrderBy, CreateNamespaceEventInput, UpdateNamespaceEventInput, NamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceEvent, + NamespaceEventWithRelations, + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy, + CreateNamespaceEventInput, + UpdateNamespaceEventInput, + NamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", 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 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + 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, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvents", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceEvent", "createNamespaceEvent", "namespaceEvent", args.select, args.data, "CreateNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceEvent', + 'createNamespaceEvent', + 'namespaceEvent', + args.select, + args.data, + 'CreateNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "createNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'createNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + NamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceEvent", "updateNamespaceEvent", "namespaceEvent", args.select, args.where.id, args.data, "UpdateNamespaceEventInput", "id", "namespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceEvent', + 'updateNamespaceEvent', + 'namespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceEventInput', + 'id', + 'namespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "updateNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'updateNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceEvent", "deleteNamespaceEvent", "namespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceEvent', + 'deleteNamespaceEvent', + 'namespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "deleteNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'deleteNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/platformInfraCommit.ts b/sdk/constructive-cli/src/infra/orm/models/platformInfraCommit.ts index b5e90c524d..ab0c34f08f 100644 --- a/sdk/constructive-cli/src/infra/orm/models/platformInfraCommit.ts +++ b/sdk/constructive-cli/src/infra/orm/models/platformInfraCommit.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraCommit, PlatformInfraCommitWithRelations, PlatformInfraCommitSelect, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy, CreatePlatformInfraCommitInput, UpdatePlatformInfraCommitInput, PlatformInfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraCommit, + PlatformInfraCommitWithRelations, + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, + CreatePlatformInfraCommitInput, + UpdatePlatformInfraCommitInput, + PlatformInfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", 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 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + 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, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommits", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraCommit", "createPlatformInfraCommit", "platformInfraCommit", args.select, args.data, "CreatePlatformInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraCommit', + 'createPlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.data, + 'CreatePlatformInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "createPlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'createPlatformInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraCommit", "updatePlatformInfraCommit", "platformInfraCommit", args.select, args.where.id, args.data, "UpdatePlatformInfraCommitInput", "id", "platformInfraCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraCommit', + 'updatePlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraCommitInput', + 'id', + 'platformInfraCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "updatePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'updatePlatformInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraCommit", "deletePlatformInfraCommit", "platformInfraCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraCommit', + 'deletePlatformInfraCommit', + 'platformInfraCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "deletePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'deletePlatformInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts b/sdk/constructive-cli/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts index 6c9bfc2b28..e0e0a2aeaa 100644 --- a/sdk/constructive-cli/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-cli/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts @@ -3,56 +3,109 @@ * @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 { PlatformInfraGetAllTreeNodesRecord, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy, CreatePlatformInfraGetAllTreeNodesRecordInput, UpdatePlatformInfraGetAllTreeNodesRecordInput, PlatformInfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraGetAllTreeNodesRecord, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, + CreatePlatformInfraGetAllTreeNodesRecordInput, + UpdatePlatformInfraGetAllTreeNodesRecordInput, + PlatformInfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", 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 - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + 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, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodes", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +113,41 @@ export class PlatformInfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraGetAllTreeNodesRecord": data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null - }) + platformInfraGetAllTreeNodesRecord: data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraGetAllTreeNodesRecord: { - platformInfraGetAllTreeNodesRecord: InferSelectResult; + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraGetAllTreeNodesRecord", "createPlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodesRecord", args.select, args.data, "CreatePlatformInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'createPlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreatePlatformInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "createPlatformInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'createPlatformInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/platformInfraObject.ts b/sdk/constructive-cli/src/infra/orm/models/platformInfraObject.ts index 2978ff1c18..512cb448c4 100644 --- a/sdk/constructive-cli/src/infra/orm/models/platformInfraObject.ts +++ b/sdk/constructive-cli/src/infra/orm/models/platformInfraObject.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraObject, PlatformInfraObjectWithRelations, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy, CreatePlatformInfraObjectInput, UpdatePlatformInfraObjectInput, PlatformInfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraObject, + PlatformInfraObjectWithRelations, + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, + CreatePlatformInfraObjectInput, + UpdatePlatformInfraObjectInput, + PlatformInfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraObject", "platformInfraObjects", 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 - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + 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, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObjects", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraObject", "platformInfraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class PlatformInfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraObject": data.platformInfraObjects?.nodes?.[0] ?? null - }) + platformInfraObject: data.platformInfraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("PlatformInfraObject", "platformInfraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'PlatformInfraObject', + 'platformInfraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraObject", "createPlatformInfraObject", "platformInfraObject", args.select, args.data, "CreatePlatformInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraObject', + 'createPlatformInfraObject', + 'platformInfraObject', + args.select, + args.data, + 'CreatePlatformInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "createPlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'createPlatformInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraObject", "updatePlatformInfraObject", "platformInfraObject", args.select, args.where.id, args.data, "UpdatePlatformInfraObjectInput", "id", "platformInfraObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraObject', + 'updatePlatformInfraObject', + 'platformInfraObject', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraObjectInput', + 'id', + 'platformInfraObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "updatePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'updatePlatformInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraObject", "deletePlatformInfraObject", "platformInfraObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraObject', + 'deletePlatformInfraObject', + 'platformInfraObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "deletePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'deletePlatformInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/platformInfraRef.ts b/sdk/constructive-cli/src/infra/orm/models/platformInfraRef.ts index 198e5cd359..c485407d95 100644 --- a/sdk/constructive-cli/src/infra/orm/models/platformInfraRef.ts +++ b/sdk/constructive-cli/src/infra/orm/models/platformInfraRef.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraRef, PlatformInfraRefWithRelations, PlatformInfraRefSelect, PlatformInfraRefFilter, PlatformInfraRefOrderBy, CreatePlatformInfraRefInput, UpdatePlatformInfraRefInput, PlatformInfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraRef, + PlatformInfraRefWithRelations, + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, + CreatePlatformInfraRefInput, + UpdatePlatformInfraRefInput, + PlatformInfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", 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 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + 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, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRefs", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraRef", "createPlatformInfraRef", "platformInfraRef", args.select, args.data, "CreatePlatformInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraRef', + 'createPlatformInfraRef', + 'platformInfraRef', + args.select, + args.data, + 'CreatePlatformInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "createPlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'createPlatformInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraRef", "updatePlatformInfraRef", "platformInfraRef", args.select, args.where.id, args.data, "UpdatePlatformInfraRefInput", "id", "platformInfraRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraRef', + 'updatePlatformInfraRef', + 'platformInfraRef', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraRefInput', + 'id', + 'platformInfraRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "updatePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'updatePlatformInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraRef", "deletePlatformInfraRef", "platformInfraRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraRef', + 'deletePlatformInfraRef', + 'platformInfraRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "deletePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'deletePlatformInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/platformInfraStore.ts b/sdk/constructive-cli/src/infra/orm/models/platformInfraStore.ts index 857230b173..493d42e53c 100644 --- a/sdk/constructive-cli/src/infra/orm/models/platformInfraStore.ts +++ b/sdk/constructive-cli/src/infra/orm/models/platformInfraStore.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraStore, PlatformInfraStoreWithRelations, PlatformInfraStoreSelect, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy, CreatePlatformInfraStoreInput, UpdatePlatformInfraStoreInput, PlatformInfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraStore, + PlatformInfraStoreWithRelations, + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, + CreatePlatformInfraStoreInput, + UpdatePlatformInfraStoreInput, + PlatformInfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", 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 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + 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, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStores", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraStore", "createPlatformInfraStore", "platformInfraStore", args.select, args.data, "CreatePlatformInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraStore', + 'createPlatformInfraStore', + 'platformInfraStore', + args.select, + args.data, + 'CreatePlatformInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "createPlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'createPlatformInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformInfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraStore", "updatePlatformInfraStore", "platformInfraStore", args.select, args.where.id, args.data, "UpdatePlatformInfraStoreInput", "id", "platformInfraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraStore', + 'updatePlatformInfraStore', + 'platformInfraStore', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraStoreInput', + 'id', + 'platformInfraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "updatePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'updatePlatformInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraStore", "deletePlatformInfraStore", "platformInfraStore", { - id: args.where.id - }, "DeletePlatformInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraStore', + 'deletePlatformInfraStore', + 'platformInfraStore', + { + id: args.where.id, + }, + 'DeletePlatformInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "deletePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'deletePlatformInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/platformNamespace.ts b/sdk/constructive-cli/src/infra/orm/models/platformNamespace.ts index 061849f0df..c4dff94953 100644 --- a/sdk/constructive-cli/src/infra/orm/models/platformNamespace.ts +++ b/sdk/constructive-cli/src/infra/orm/models/platformNamespace.ts @@ -3,56 +3,96 @@ * @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 { PlatformNamespace, PlatformNamespaceWithRelations, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy, CreatePlatformNamespaceInput, UpdatePlatformNamespaceInput, PlatformNamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespace, + PlatformNamespaceWithRelations, + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, + CreatePlatformNamespaceInput, + UpdatePlatformNamespaceInput, + PlatformNamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", 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 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + 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, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespaces", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespace", "createPlatformNamespace", "platformNamespace", args.select, args.data, "CreatePlatformNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespace', + 'createPlatformNamespace', + 'platformNamespace', + args.select, + args.data, + 'CreatePlatformNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "createPlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'createPlatformNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformNamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespace", "updatePlatformNamespace", "platformNamespace", args.select, args.where.id, args.data, "UpdatePlatformNamespaceInput", "id", "platformNamespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespace', + 'updatePlatformNamespace', + 'platformNamespace', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceInput', + 'id', + 'platformNamespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "updatePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'updatePlatformNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespace", "deletePlatformNamespace", "platformNamespace", { - id: args.where.id - }, "DeletePlatformNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespace', + 'deletePlatformNamespace', + 'platformNamespace', + { + id: args.where.id, + }, + 'DeletePlatformNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "deletePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'deletePlatformNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/models/platformNamespaceEvent.ts b/sdk/constructive-cli/src/infra/orm/models/platformNamespaceEvent.ts index 90242716e8..198afe79ae 100644 --- a/sdk/constructive-cli/src/infra/orm/models/platformNamespaceEvent.ts +++ b/sdk/constructive-cli/src/infra/orm/models/platformNamespaceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformNamespaceEvent, PlatformNamespaceEventWithRelations, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy, CreatePlatformNamespaceEventInput, UpdatePlatformNamespaceEventInput, PlatformNamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespaceEvent, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, + CreatePlatformNamespaceEventInput, + UpdatePlatformNamespaceEventInput, + PlatformNamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformNamespaceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", 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 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + 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, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvents", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespaceEvent", "createPlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.data, "CreatePlatformNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespaceEvent', + 'createPlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.data, + 'CreatePlatformNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "createPlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'createPlatformNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformNamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespaceEvent", "updatePlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.where.id, args.data, "UpdatePlatformNamespaceEventInput", "id", "platformNamespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespaceEvent', + 'updatePlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceEventInput', + 'id', + 'platformNamespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "updatePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'updatePlatformNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespaceEvent", "deletePlatformNamespaceEvent", "platformNamespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespaceEvent', + 'deletePlatformNamespaceEvent', + 'platformNamespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "deletePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'deletePlatformNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/mutation/index.ts b/sdk/constructive-cli/src/infra/orm/mutation/index.ts index 3414cf9046..f266633531 100644 --- a/sdk/constructive-cli/src/infra/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/infra/orm/mutation/index.ts @@ -3,11 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { PlatformInfraInitEmptyRepoInput, PlatformInfraInsertNodeAtPathInput, PlatformInfraSetDataAtPathInput, ProvisionBucketInput, PlatformInfraInitEmptyRepoPayload, PlatformInfraInsertNodeAtPathPayload, PlatformInfraSetDataAtPathPayload, ProvisionBucketPayload, PlatformInfraInitEmptyRepoPayloadSelect, PlatformInfraInsertNodeAtPathPayloadSelect, PlatformInfraSetDataAtPathPayloadSelect, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + PlatformInfraInitEmptyRepoInput, + PlatformInfraInsertNodeAtPathInput, + PlatformInfraSetDataAtPathInput, + ProvisionBucketInput, + PlatformInfraInitEmptyRepoPayload, + PlatformInfraInsertNodeAtPathPayload, + PlatformInfraSetDataAtPathPayload, + ProvisionBucketPayload, + PlatformInfraInitEmptyRepoPayloadSelect, + PlatformInfraInsertNodeAtPathPayloadSelect, + PlatformInfraSetDataAtPathPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface PlatformInfraInitEmptyRepoVariables { input: PlatformInfraInitEmptyRepoInput; } @@ -29,61 +42,124 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - platformInfraInitEmptyRepo: (args: PlatformInfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInitEmptyRepo", - fieldName: "platformInfraInitEmptyRepo", - ...buildCustomDocument("mutation", "PlatformInfraInitEmptyRepo", "platformInfraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "PlatformInfraInitEmptyRepoInput!" - }], connectionFieldsMap, "PlatformInfraInitEmptyRepoPayload") - }), - platformInfraInsertNodeAtPath: (args: PlatformInfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInsertNodeAtPath", - fieldName: "platformInfraInsertNodeAtPath", - ...buildCustomDocument("mutation", "PlatformInfraInsertNodeAtPath", "platformInfraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "PlatformInfraInsertNodeAtPathPayload") - }), - platformInfraSetDataAtPath: (args: PlatformInfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraSetDataAtPath", - fieldName: "platformInfraSetDataAtPath", - ...buildCustomDocument("mutation", "PlatformInfraSetDataAtPath", "platformInfraSetDataAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraSetDataAtPathInput!" - }], connectionFieldsMap, "PlatformInfraSetDataAtPathPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + platformInfraInitEmptyRepo: ( + args: PlatformInfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInitEmptyRepo', + fieldName: 'platformInfraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInitEmptyRepo', + 'platformInfraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInitEmptyRepoPayload' + ), + }), + platformInfraInsertNodeAtPath: ( + args: PlatformInfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInsertNodeAtPath', + fieldName: 'platformInfraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInsertNodeAtPath', + 'platformInfraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInsertNodeAtPathPayload' + ), + }), + platformInfraSetDataAtPath: ( + args: PlatformInfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraSetDataAtPath', + fieldName: 'platformInfraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraSetDataAtPath', + 'platformInfraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraSetDataAtPathPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/infra/orm/query-builder.ts b/sdk/constructive-cli/src/infra/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/infra/orm/query-builder.ts +++ b/sdk/constructive-cli/src/infra/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/infra/orm/realtime.ts b/sdk/constructive-cli/src/infra/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/infra/orm/realtime.ts +++ b/sdk/constructive-cli/src/infra/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/infra/orm/select-types.ts b/sdk/constructive-cli/src/infra/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/infra/orm/select-types.ts +++ b/sdk/constructive-cli/src/infra/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/modules/cli/commands.ts b/sdk/constructive-cli/src/modules/cli/commands.ts index 956de39580..3ee4bdc20b 100644 --- a/sdk/constructive-cli/src/modules/cli/commands.ts +++ b/sdk/constructive-cli/src/modules/cli/commands.ts @@ -3,205 +3,216 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import agentModuleCmd from "./commands/agent-module"; -import apiSurfaceModuleCmd from "./commands/api-surface-module"; -import appModuleCmd from "./commands/app-module"; -import billingModuleCmd from "./commands/billing-module"; -import billingProviderModuleCmd from "./commands/billing-provider-module"; -import blueprintCmd from "./commands/blueprint"; -import blueprintConstructionCmd from "./commands/blueprint-construction"; -import blueprintTemplateCmd from "./commands/blueprint-template"; -import catalogModuleCmd from "./commands/catalog-module"; -import computeLogModuleCmd from "./commands/compute-log-module"; -import configSecretsUserModuleCmd from "./commands/config-secrets-user-module"; -import connectedAccountsModuleCmd from "./commands/connected-accounts-module"; -import cryptoAddressesModuleCmd from "./commands/crypto-addresses-module"; -import cryptoAuthModuleCmd from "./commands/crypto-auth-module"; -import databaseProvisionModuleCmd from "./commands/database-provision-module"; -import databaseSettingsModuleCmd from "./commands/database-settings-module"; -import dbPoolConfigCmd from "./commands/db-pool-config"; -import dbPoolCmd from "./commands/db-pool"; -import dbPresetModuleCmd from "./commands/db-preset-module"; -import dbUsageModuleCmd from "./commands/db-usage-module"; -import defaultIdsModuleCmd from "./commands/default-ids-module"; -import denormalizedTableFieldCmd from "./commands/denormalized-table-field"; -import devicesModuleCmd from "./commands/devices-module"; -import domainModuleCmd from "./commands/domain-module"; -import emailsModuleCmd from "./commands/emails-module"; -import entityTypeProvisionCmd from "./commands/entity-type-provision"; -import eventsModuleCmd from "./commands/events-module"; -import functionDeploymentModuleCmd from "./commands/function-deployment-module"; -import functionInvocationModuleCmd from "./commands/function-invocation-module"; -import functionModuleCmd from "./commands/function-module"; -import graphExecutionModuleCmd from "./commands/graph-execution-module"; -import graphModuleCmd from "./commands/graph-module"; -import hierarchyModuleCmd from "./commands/hierarchy-module"; -import httpRouteModuleCmd from "./commands/http-route-module"; -import i18NModuleCmd from "./commands/i-18-n-module"; -import identityProvidersModuleCmd from "./commands/identity-providers-module"; -import inferenceLogModuleCmd from "./commands/inference-log-module"; -import infraConfigModuleCmd from "./commands/infra-config-module"; -import infraSecretsModuleCmd from "./commands/infra-secrets-module"; -import integrationProvidersModuleCmd from "./commands/integration-providers-module"; -import internalSecretsModuleCmd from "./commands/internal-secrets-module"; -import invitesModuleCmd from "./commands/invites-module"; -import limitsModuleCmd from "./commands/limits-module"; -import membershipTypesModuleCmd from "./commands/membership-types-module"; -import membershipsModuleCmd from "./commands/memberships-module"; -import merkleStoreModuleCmd from "./commands/merkle-store-module"; -import namespaceModuleCmd from "./commands/namespace-module"; -import notificationsModuleCmd from "./commands/notifications-module"; -import permissionsModuleCmd from "./commands/permissions-module"; -import phoneNumbersModuleCmd from "./commands/phone-numbers-module"; -import plansModuleCmd from "./commands/plans-module"; -import principalAuthModuleCmd from "./commands/principal-auth-module"; -import profilesModuleCmd from "./commands/profiles-module"; -import rateLimitMetersModuleCmd from "./commands/rate-limit-meters-module"; -import rateLimitsModuleCmd from "./commands/rate-limits-module"; -import realtimeModuleCmd from "./commands/realtime-module"; -import relationProvisionCmd from "./commands/relation-provision"; -import resourceModuleCmd from "./commands/resource-module"; -import rlsModuleCmd from "./commands/rls-module"; -import routeModuleCmd from "./commands/route-module"; -import secureTableProvisionCmd from "./commands/secure-table-provision"; -import sessionSecretsModuleCmd from "./commands/session-secrets-module"; -import sessionsModuleCmd from "./commands/sessions-module"; -import siteSurfaceModuleCmd from "./commands/site-surface-module"; -import storageLogModuleCmd from "./commands/storage-log-module"; -import storageModuleCmd from "./commands/storage-module"; -import transferLogModuleCmd from "./commands/transfer-log-module"; -import userAuthModuleCmd from "./commands/user-auth-module"; -import userCredentialsModuleCmd from "./commands/user-credentials-module"; -import userSettingsModuleCmd from "./commands/user-settings-module"; -import userStateModuleCmd from "./commands/user-state-module"; -import usersModuleCmd from "./commands/users-module"; -import webauthnAuthModuleCmd from "./commands/webauthn-auth-module"; -import webauthnCredentialsModuleCmd from "./commands/webauthn-credentials-module"; -import webhookModuleCmd from "./commands/webhook-module"; -import resolveBlueprintFieldCmd from "./commands/resolve-blueprint-field"; -import resolveBlueprintTableCmd from "./commands/resolve-blueprint-table"; -import constructBlueprintCmd from "./commands/construct-blueprint"; -import copyTemplateToBlueprintCmd from "./commands/copy-template-to-blueprint"; -import provisionBucketCmd from "./commands/provision-bucket"; -import provisionCheckConstraintCmd from "./commands/provision-check-constraint"; -import provisionFullTextSearchCmd from "./commands/provision-full-text-search"; -import provisionIndexCmd from "./commands/provision-index"; -import provisionRelationCmd from "./commands/provision-relation"; -import provisionSpatialRelationCmd from "./commands/provision-spatial-relation"; -import provisionTableCmd from "./commands/provision-table"; -import provisionUniqueConstraintCmd from "./commands/provision-unique-constraint"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "agent-module": agentModuleCmd, - "api-surface-module": apiSurfaceModuleCmd, - "app-module": appModuleCmd, - "billing-module": billingModuleCmd, - "billing-provider-module": billingProviderModuleCmd, - "blueprint": blueprintCmd, - "blueprint-construction": blueprintConstructionCmd, - "blueprint-template": blueprintTemplateCmd, - "catalog-module": catalogModuleCmd, - "compute-log-module": computeLogModuleCmd, - "config-secrets-user-module": configSecretsUserModuleCmd, - "connected-accounts-module": connectedAccountsModuleCmd, - "crypto-addresses-module": cryptoAddressesModuleCmd, - "crypto-auth-module": cryptoAuthModuleCmd, - "database-provision-module": databaseProvisionModuleCmd, - "database-settings-module": databaseSettingsModuleCmd, - "db-pool-config": dbPoolConfigCmd, - "db-pool": dbPoolCmd, - "db-preset-module": dbPresetModuleCmd, - "db-usage-module": dbUsageModuleCmd, - "default-ids-module": defaultIdsModuleCmd, - "denormalized-table-field": denormalizedTableFieldCmd, - "devices-module": devicesModuleCmd, - "domain-module": domainModuleCmd, - "emails-module": emailsModuleCmd, - "entity-type-provision": entityTypeProvisionCmd, - "events-module": eventsModuleCmd, - "function-deployment-module": functionDeploymentModuleCmd, - "function-invocation-module": functionInvocationModuleCmd, - "function-module": functionModuleCmd, - "graph-execution-module": graphExecutionModuleCmd, - "graph-module": graphModuleCmd, - "hierarchy-module": hierarchyModuleCmd, - "http-route-module": httpRouteModuleCmd, - "i-18-n-module": i18NModuleCmd, - "identity-providers-module": identityProvidersModuleCmd, - "inference-log-module": inferenceLogModuleCmd, - "infra-config-module": infraConfigModuleCmd, - "infra-secrets-module": infraSecretsModuleCmd, - "integration-providers-module": integrationProvidersModuleCmd, - "internal-secrets-module": internalSecretsModuleCmd, - "invites-module": invitesModuleCmd, - "limits-module": limitsModuleCmd, - "membership-types-module": membershipTypesModuleCmd, - "memberships-module": membershipsModuleCmd, - "merkle-store-module": merkleStoreModuleCmd, - "namespace-module": namespaceModuleCmd, - "notifications-module": notificationsModuleCmd, - "permissions-module": permissionsModuleCmd, - "phone-numbers-module": phoneNumbersModuleCmd, - "plans-module": plansModuleCmd, - "principal-auth-module": principalAuthModuleCmd, - "profiles-module": profilesModuleCmd, - "rate-limit-meters-module": rateLimitMetersModuleCmd, - "rate-limits-module": rateLimitsModuleCmd, - "realtime-module": realtimeModuleCmd, - "relation-provision": relationProvisionCmd, - "resource-module": resourceModuleCmd, - "rls-module": rlsModuleCmd, - "route-module": routeModuleCmd, - "secure-table-provision": secureTableProvisionCmd, - "session-secrets-module": sessionSecretsModuleCmd, - "sessions-module": sessionsModuleCmd, - "site-surface-module": siteSurfaceModuleCmd, - "storage-log-module": storageLogModuleCmd, - "storage-module": storageModuleCmd, - "transfer-log-module": transferLogModuleCmd, - "user-auth-module": userAuthModuleCmd, - "user-credentials-module": userCredentialsModuleCmd, - "user-settings-module": userSettingsModuleCmd, - "user-state-module": userStateModuleCmd, - "users-module": usersModuleCmd, - "webauthn-auth-module": webauthnAuthModuleCmd, - "webauthn-credentials-module": webauthnCredentialsModuleCmd, - "webhook-module": webhookModuleCmd, - "resolve-blueprint-field": resolveBlueprintFieldCmd, - "resolve-blueprint-table": resolveBlueprintTableCmd, - "construct-blueprint": constructBlueprintCmd, - "copy-template-to-blueprint": copyTemplateToBlueprintCmd, - "provision-bucket": provisionBucketCmd, - "provision-check-constraint": provisionCheckConstraintCmd, - "provision-full-text-search": provisionFullTextSearchCmd, - "provision-index": provisionIndexCmd, - "provision-relation": provisionRelationCmd, - "provision-spatial-relation": provisionSpatialRelationCmd, - "provision-table": provisionTableCmd, - "provision-unique-constraint": provisionUniqueConstraintCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import agentModuleCmd from './commands/agent-module'; +import apiSurfaceModuleCmd from './commands/api-surface-module'; +import appModuleCmd from './commands/app-module'; +import billingModuleCmd from './commands/billing-module'; +import billingProviderModuleCmd from './commands/billing-provider-module'; +import blueprintCmd from './commands/blueprint'; +import blueprintConstructionCmd from './commands/blueprint-construction'; +import blueprintTemplateCmd from './commands/blueprint-template'; +import catalogModuleCmd from './commands/catalog-module'; +import computeLogModuleCmd from './commands/compute-log-module'; +import configSecretsUserModuleCmd from './commands/config-secrets-user-module'; +import connectedAccountsModuleCmd from './commands/connected-accounts-module'; +import cryptoAddressesModuleCmd from './commands/crypto-addresses-module'; +import cryptoAuthModuleCmd from './commands/crypto-auth-module'; +import databaseProvisionModuleCmd from './commands/database-provision-module'; +import databaseSettingsModuleCmd from './commands/database-settings-module'; +import dbPoolConfigCmd from './commands/db-pool-config'; +import dbPoolCmd from './commands/db-pool'; +import dbPresetModuleCmd from './commands/db-preset-module'; +import dbUsageModuleCmd from './commands/db-usage-module'; +import defaultIdsModuleCmd from './commands/default-ids-module'; +import denormalizedTableFieldCmd from './commands/denormalized-table-field'; +import devicesModuleCmd from './commands/devices-module'; +import domainModuleCmd from './commands/domain-module'; +import emailsModuleCmd from './commands/emails-module'; +import entityTypeProvisionCmd from './commands/entity-type-provision'; +import eventsModuleCmd from './commands/events-module'; +import functionDeploymentModuleCmd from './commands/function-deployment-module'; +import functionInvocationModuleCmd from './commands/function-invocation-module'; +import functionModuleCmd from './commands/function-module'; +import graphExecutionModuleCmd from './commands/graph-execution-module'; +import graphModuleCmd from './commands/graph-module'; +import hierarchyModuleCmd from './commands/hierarchy-module'; +import httpRouteModuleCmd from './commands/http-route-module'; +import i18NModuleCmd from './commands/i-18-n-module'; +import identityProvidersModuleCmd from './commands/identity-providers-module'; +import inferenceLogModuleCmd from './commands/inference-log-module'; +import infraConfigModuleCmd from './commands/infra-config-module'; +import infraSecretsModuleCmd from './commands/infra-secrets-module'; +import integrationProvidersModuleCmd from './commands/integration-providers-module'; +import internalSecretsModuleCmd from './commands/internal-secrets-module'; +import invitesModuleCmd from './commands/invites-module'; +import limitsModuleCmd from './commands/limits-module'; +import membershipTypesModuleCmd from './commands/membership-types-module'; +import membershipsModuleCmd from './commands/memberships-module'; +import merkleStoreModuleCmd from './commands/merkle-store-module'; +import namespaceModuleCmd from './commands/namespace-module'; +import notificationsModuleCmd from './commands/notifications-module'; +import permissionsModuleCmd from './commands/permissions-module'; +import phoneNumbersModuleCmd from './commands/phone-numbers-module'; +import plansModuleCmd from './commands/plans-module'; +import principalAuthModuleCmd from './commands/principal-auth-module'; +import profilesModuleCmd from './commands/profiles-module'; +import rateLimitMetersModuleCmd from './commands/rate-limit-meters-module'; +import rateLimitsModuleCmd from './commands/rate-limits-module'; +import realtimeModuleCmd from './commands/realtime-module'; +import relationProvisionCmd from './commands/relation-provision'; +import resourceModuleCmd from './commands/resource-module'; +import rlsModuleCmd from './commands/rls-module'; +import routeModuleCmd from './commands/route-module'; +import secureTableProvisionCmd from './commands/secure-table-provision'; +import sessionSecretsModuleCmd from './commands/session-secrets-module'; +import sessionsModuleCmd from './commands/sessions-module'; +import siteSurfaceModuleCmd from './commands/site-surface-module'; +import storageLogModuleCmd from './commands/storage-log-module'; +import storageModuleCmd from './commands/storage-module'; +import transferLogModuleCmd from './commands/transfer-log-module'; +import userAuthModuleCmd from './commands/user-auth-module'; +import userCredentialsModuleCmd from './commands/user-credentials-module'; +import userSettingsModuleCmd from './commands/user-settings-module'; +import userStateModuleCmd from './commands/user-state-module'; +import usersModuleCmd from './commands/users-module'; +import webauthnAuthModuleCmd from './commands/webauthn-auth-module'; +import webauthnCredentialsModuleCmd from './commands/webauthn-credentials-module'; +import webhookModuleCmd from './commands/webhook-module'; +import resolveBlueprintFieldCmd from './commands/resolve-blueprint-field'; +import resolveBlueprintTableCmd from './commands/resolve-blueprint-table'; +import constructBlueprintCmd from './commands/construct-blueprint'; +import copyTemplateToBlueprintCmd from './commands/copy-template-to-blueprint'; +import provisionBucketCmd from './commands/provision-bucket'; +import provisionCheckConstraintCmd from './commands/provision-check-constraint'; +import provisionFullTextSearchCmd from './commands/provision-full-text-search'; +import provisionIndexCmd from './commands/provision-index'; +import provisionRelationCmd from './commands/provision-relation'; +import provisionSpatialRelationCmd from './commands/provision-spatial-relation'; +import provisionTableCmd from './commands/provision-table'; +import provisionUniqueConstraintCmd from './commands/provision-unique-constraint'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + 'agent-module': agentModuleCmd, + 'api-surface-module': apiSurfaceModuleCmd, + 'app-module': appModuleCmd, + 'billing-module': billingModuleCmd, + 'billing-provider-module': billingProviderModuleCmd, + blueprint: blueprintCmd, + 'blueprint-construction': blueprintConstructionCmd, + 'blueprint-template': blueprintTemplateCmd, + 'catalog-module': catalogModuleCmd, + 'compute-log-module': computeLogModuleCmd, + 'config-secrets-user-module': configSecretsUserModuleCmd, + 'connected-accounts-module': connectedAccountsModuleCmd, + 'crypto-addresses-module': cryptoAddressesModuleCmd, + 'crypto-auth-module': cryptoAuthModuleCmd, + 'database-provision-module': databaseProvisionModuleCmd, + 'database-settings-module': databaseSettingsModuleCmd, + 'db-pool-config': dbPoolConfigCmd, + 'db-pool': dbPoolCmd, + 'db-preset-module': dbPresetModuleCmd, + 'db-usage-module': dbUsageModuleCmd, + 'default-ids-module': defaultIdsModuleCmd, + 'denormalized-table-field': denormalizedTableFieldCmd, + 'devices-module': devicesModuleCmd, + 'domain-module': domainModuleCmd, + 'emails-module': emailsModuleCmd, + 'entity-type-provision': entityTypeProvisionCmd, + 'events-module': eventsModuleCmd, + 'function-deployment-module': functionDeploymentModuleCmd, + 'function-invocation-module': functionInvocationModuleCmd, + 'function-module': functionModuleCmd, + 'graph-execution-module': graphExecutionModuleCmd, + 'graph-module': graphModuleCmd, + 'hierarchy-module': hierarchyModuleCmd, + 'http-route-module': httpRouteModuleCmd, + 'i-18-n-module': i18NModuleCmd, + 'identity-providers-module': identityProvidersModuleCmd, + 'inference-log-module': inferenceLogModuleCmd, + 'infra-config-module': infraConfigModuleCmd, + 'infra-secrets-module': infraSecretsModuleCmd, + 'integration-providers-module': integrationProvidersModuleCmd, + 'internal-secrets-module': internalSecretsModuleCmd, + 'invites-module': invitesModuleCmd, + 'limits-module': limitsModuleCmd, + 'membership-types-module': membershipTypesModuleCmd, + 'memberships-module': membershipsModuleCmd, + 'merkle-store-module': merkleStoreModuleCmd, + 'namespace-module': namespaceModuleCmd, + 'notifications-module': notificationsModuleCmd, + 'permissions-module': permissionsModuleCmd, + 'phone-numbers-module': phoneNumbersModuleCmd, + 'plans-module': plansModuleCmd, + 'principal-auth-module': principalAuthModuleCmd, + 'profiles-module': profilesModuleCmd, + 'rate-limit-meters-module': rateLimitMetersModuleCmd, + 'rate-limits-module': rateLimitsModuleCmd, + 'realtime-module': realtimeModuleCmd, + 'relation-provision': relationProvisionCmd, + 'resource-module': resourceModuleCmd, + 'rls-module': rlsModuleCmd, + 'route-module': routeModuleCmd, + 'secure-table-provision': secureTableProvisionCmd, + 'session-secrets-module': sessionSecretsModuleCmd, + 'sessions-module': sessionsModuleCmd, + 'site-surface-module': siteSurfaceModuleCmd, + 'storage-log-module': storageLogModuleCmd, + 'storage-module': storageModuleCmd, + 'transfer-log-module': transferLogModuleCmd, + 'user-auth-module': userAuthModuleCmd, + 'user-credentials-module': userCredentialsModuleCmd, + 'user-settings-module': userSettingsModuleCmd, + 'user-state-module': userStateModuleCmd, + 'users-module': usersModuleCmd, + 'webauthn-auth-module': webauthnAuthModuleCmd, + 'webauthn-credentials-module': webauthnCredentialsModuleCmd, + 'webhook-module': webhookModuleCmd, + 'resolve-blueprint-field': resolveBlueprintFieldCmd, + 'resolve-blueprint-table': resolveBlueprintTableCmd, + 'construct-blueprint': constructBlueprintCmd, + 'copy-template-to-blueprint': copyTemplateToBlueprintCmd, + 'provision-bucket': provisionBucketCmd, + 'provision-check-constraint': provisionCheckConstraintCmd, + 'provision-full-text-search': provisionFullTextSearchCmd, + 'provision-index': provisionIndexCmd, + 'provision-relation': provisionRelationCmd, + 'provision-spatial-relation': provisionSpatialRelationCmd, + 'provision-table': provisionTableCmd, + 'provision-unique-constraint': provisionUniqueConstraintCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n agent-module agentModule CRUD operations\n api-surface-module apiSurfaceModule CRUD operations\n app-module appModule CRUD operations\n billing-module billingModule CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n catalog-module catalogModule CRUD operations\n compute-log-module computeLogModule CRUD operations\n config-secrets-user-module configSecretsUserModule CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n database-settings-module databaseSettingsModule CRUD operations\n db-pool-config dbPoolConfig CRUD operations\n db-pool dbPool CRUD operations\n db-preset-module dbPresetModule CRUD operations\n db-usage-module dbUsageModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n devices-module devicesModule CRUD operations\n domain-module domainModule CRUD operations\n emails-module emailsModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n events-module eventsModule CRUD operations\n function-deployment-module functionDeploymentModule CRUD operations\n function-invocation-module functionInvocationModule CRUD operations\n function-module functionModule CRUD operations\n graph-execution-module graphExecutionModule CRUD operations\n graph-module graphModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n http-route-module httpRouteModule CRUD operations\n i-18-n-module i18NModule CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n inference-log-module inferenceLogModule CRUD operations\n infra-config-module infraConfigModule CRUD operations\n infra-secrets-module infraSecretsModule CRUD operations\n integration-providers-module integrationProvidersModule CRUD operations\n internal-secrets-module internalSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n merkle-store-module merkleStoreModule CRUD operations\n namespace-module namespaceModule CRUD operations\n notifications-module notificationsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n plans-module plansModule CRUD operations\n principal-auth-module principalAuthModule CRUD operations\n profiles-module profilesModule CRUD operations\n rate-limit-meters-module rateLimitMetersModule CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n realtime-module realtimeModule CRUD operations\n relation-provision relationProvision CRUD operations\n resource-module resourceModule CRUD operations\n rls-module rlsModule CRUD operations\n route-module routeModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n site-surface-module siteSurfaceModule CRUD operations\n storage-log-module storageLogModule CRUD operations\n storage-module storageModule CRUD operations\n transfer-log-module transferLogModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n user-credentials-module userCredentialsModule CRUD operations\n user-settings-module userSettingsModule CRUD operations\n user-state-module userStateModule CRUD operations\n users-module usersModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n webhook-module webhookModule 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 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-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 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-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-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-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-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\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n agent-module agentModule CRUD operations\n api-surface-module apiSurfaceModule CRUD operations\n app-module appModule CRUD operations\n billing-module billingModule CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n catalog-module catalogModule CRUD operations\n compute-log-module computeLogModule CRUD operations\n config-secrets-user-module configSecretsUserModule CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n database-settings-module databaseSettingsModule CRUD operations\n db-pool-config dbPoolConfig CRUD operations\n db-pool dbPool CRUD operations\n db-preset-module dbPresetModule CRUD operations\n db-usage-module dbUsageModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n devices-module devicesModule CRUD operations\n domain-module domainModule CRUD operations\n emails-module emailsModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n events-module eventsModule CRUD operations\n function-deployment-module functionDeploymentModule CRUD operations\n function-invocation-module functionInvocationModule CRUD operations\n function-module functionModule CRUD operations\n graph-execution-module graphExecutionModule CRUD operations\n graph-module graphModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n http-route-module httpRouteModule CRUD operations\n i-18-n-module i18NModule CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n inference-log-module inferenceLogModule CRUD operations\n infra-config-module infraConfigModule CRUD operations\n infra-secrets-module infraSecretsModule CRUD operations\n integration-providers-module integrationProvidersModule CRUD operations\n internal-secrets-module internalSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n merkle-store-module merkleStoreModule CRUD operations\n namespace-module namespaceModule CRUD operations\n notifications-module notificationsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n plans-module plansModule CRUD operations\n principal-auth-module principalAuthModule CRUD operations\n profiles-module profilesModule CRUD operations\n rate-limit-meters-module rateLimitMetersModule CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n realtime-module realtimeModule CRUD operations\n relation-provision relationProvision CRUD operations\n resource-module resourceModule CRUD operations\n rls-module rlsModule CRUD operations\n route-module routeModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n site-surface-module siteSurfaceModule CRUD operations\n storage-log-module storageLogModule CRUD operations\n storage-module storageModule CRUD operations\n transfer-log-module transferLogModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n user-credentials-module userCredentialsModule CRUD operations\n user-settings-module userSettingsModule CRUD operations\n user-state-module userStateModule CRUD operations\n users-module usersModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n webhook-module webhookModule 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 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-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 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-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-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-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-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\n --help, -h Show this help message\n --version, -v Show version\n"; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -213,4 +224,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/agent-module.ts b/sdk/constructive-cli/src/modules/cli/commands/agent-module.ts index d7bfbbb0bf..e3dbf7f498 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/agent-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/agent-module.ts @@ -3,84 +3,98 @@ * @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 { CreateAgentModuleInput, AgentModulePatch, AgentModuleSelect, AgentModuleFilter, AgentModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAgentModuleInput, + AgentModulePatch, + AgentModuleSelect, + AgentModuleFilter, + AgentModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - agentTableId: "uuid", - agentTableName: "string", - apiName: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - hasAgents: "boolean", - hasPlans: "boolean", - hasResources: "boolean", - id: "uuid", - messageTableId: "uuid", - messageTableName: "string", - personaTableId: "uuid", - personaTableName: "string", - planTableId: "uuid", - planTableName: "string", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - promptsTableId: "uuid", - promptsTableName: "string", - provisions: "json", - publicSchemaName: "string", - resourceTableId: "uuid", - resourceTableName: "string", - resources: "json", - schemaId: "uuid", - scope: "string", - shared: "boolean", - taskTableId: "uuid", - taskTableName: "string", - threadTableId: "uuid", - threadTableName: "string" + agentTableId: 'uuid', + agentTableName: 'string', + apiName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + hasAgents: 'boolean', + hasPlans: 'boolean', + hasResources: 'boolean', + id: 'uuid', + messageTableId: 'uuid', + messageTableName: 'string', + personaTableId: 'uuid', + personaTableName: 'string', + planTableId: 'uuid', + planTableName: 'string', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + promptsTableId: 'uuid', + promptsTableName: 'string', + provisions: 'json', + publicSchemaName: 'string', + resourceTableId: 'uuid', + resourceTableName: 'string', + resources: 'json', + schemaId: 'uuid', + scope: 'string', + shared: 'boolean', + taskTableId: 'uuid', + taskTableName: 'string', + threadTableId: 'uuid', + threadTableName: 'string', }; -const usage = "\nagent-module \n\nCommands:\n list List agentModule records\n find-first Find first matching agentModule record\n get Get a agentModule by ID\n create Create a new agentModule\n update Update an existing agentModule\n delete Delete a agentModule\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) => { +const usage = + '\nagent-module \n\nCommands:\n list List agentModule records\n find-first Find first matching agentModule record\n get Get a agentModule by ID\n create Create a new agentModule\n update Update an existing agentModule\n delete Delete a agentModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -125,16 +139,18 @@ async function handleList(argv: Partial>, _prompter: Inq taskTableId: true, taskTableName: true, threadTableId: true, - threadTableName: true + threadTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: AgentModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AgentModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -179,16 +195,18 @@ async function handleFindFirst(argv: Partial>, _prompter taskTableId: true, taskTableName: true, threadTableId: true, - threadTableName: true + threadTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AgentModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AgentModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.agentModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -197,57 +215,61 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.agentModule.findOne({ - id: answers.id as string, - select: { - agentTableId: true, - agentTableName: true, - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - hasAgents: true, - hasPlans: true, - hasResources: true, - id: true, - messageTableId: true, - messageTableName: true, - personaTableId: true, - personaTableName: true, - planTableId: true, - planTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - promptsTableId: true, - promptsTableName: true, - provisions: true, - publicSchemaName: true, - resourceTableId: true, - resourceTableName: true, - resources: true, - schemaId: true, - scope: true, - shared: true, - taskTableId: true, - taskTableName: true, - threadTableId: true, - threadTableName: true - } - }).execute(); + const result = await client.agentModule + .findOne({ + id: answers.id as string, + select: { + agentTableId: true, + agentTableName: true, + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + hasAgents: true, + hasPlans: true, + hasResources: true, + id: true, + messageTableId: true, + messageTableName: true, + personaTableId: true, + personaTableName: true, + planTableId: true, + planTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + promptsTableId: true, + promptsTableName: true, + provisions: true, + publicSchemaName: true, + resourceTableId: true, + resourceTableName: true, + resources: true, + schemaId: true, + scope: true, + shared: true, + taskTableId: true, + taskTableName: true, + threadTableId: true, + threadTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -256,298 +278,339 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "agentTableId", - message: "agentTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "agentTableName", - message: "agentTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasAgents", - message: "hasAgents", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasPlans", - message: "hasPlans", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasResources", - message: "hasResources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "messageTableId", - message: "messageTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "messageTableName", - message: "messageTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "personaTableId", - message: "personaTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "personaTableName", - message: "personaTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planTableId", - message: "planTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planTableName", - message: "planTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "promptsTableId", - message: "promptsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "promptsTableName", - message: "promptsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceTableId", - message: "resourceTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceTableName", - message: "resourceTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "boolean", - name: "shared", - message: "shared", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskTableId", - message: "taskTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskTableName", - message: "taskTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "threadTableId", - message: "threadTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "threadTableName", - message: "threadTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'agentTableId', + message: 'agentTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'agentTableName', + message: 'agentTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasAgents', + message: 'hasAgents', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasPlans', + message: 'hasPlans', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasResources', + message: 'hasResources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'messageTableId', + message: 'messageTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'messageTableName', + message: 'messageTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'personaTableId', + message: 'personaTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'personaTableName', + message: 'personaTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planTableId', + message: 'planTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planTableName', + message: 'planTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'promptsTableId', + message: 'promptsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'promptsTableName', + message: 'promptsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceTableId', + message: 'resourceTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceTableName', + message: 'resourceTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'boolean', + name: 'shared', + message: 'shared', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskTableId', + message: 'taskTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskTableName', + message: 'taskTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'threadTableId', + message: 'threadTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'threadTableName', + message: 'threadTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAgentModuleInput["agentModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAgentModuleInput['agentModule']; const client = getClient(); - const result = await client.agentModule.create({ - data: { - agentTableId: cleanedData.agentTableId, - agentTableName: cleanedData.agentTableName, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - hasAgents: cleanedData.hasAgents, - hasPlans: cleanedData.hasPlans, - hasResources: cleanedData.hasResources, - messageTableId: cleanedData.messageTableId, - messageTableName: cleanedData.messageTableName, - personaTableId: cleanedData.personaTableId, - personaTableName: cleanedData.personaTableName, - planTableId: cleanedData.planTableId, - planTableName: cleanedData.planTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - promptsTableId: cleanedData.promptsTableId, - promptsTableName: cleanedData.promptsTableName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - resourceTableId: cleanedData.resourceTableId, - resourceTableName: cleanedData.resourceTableName, - resources: cleanedData.resources, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - shared: cleanedData.shared, - taskTableId: cleanedData.taskTableId, - taskTableName: cleanedData.taskTableName, - threadTableId: cleanedData.threadTableId, - threadTableName: cleanedData.threadTableName - }, - select: { - agentTableId: true, - agentTableName: true, - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - hasAgents: true, - hasPlans: true, - hasResources: true, - id: true, - messageTableId: true, - messageTableName: true, - personaTableId: true, - personaTableName: true, - planTableId: true, - planTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - promptsTableId: true, - promptsTableName: true, - provisions: true, - publicSchemaName: true, - resourceTableId: true, - resourceTableName: true, - resources: true, - schemaId: true, - scope: true, - shared: true, - taskTableId: true, - taskTableName: true, - threadTableId: true, - threadTableName: true - } - }).execute(); + const result = await client.agentModule + .create({ + data: { + agentTableId: cleanedData.agentTableId, + agentTableName: cleanedData.agentTableName, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + hasAgents: cleanedData.hasAgents, + hasPlans: cleanedData.hasPlans, + hasResources: cleanedData.hasResources, + messageTableId: cleanedData.messageTableId, + messageTableName: cleanedData.messageTableName, + personaTableId: cleanedData.personaTableId, + personaTableName: cleanedData.personaTableName, + planTableId: cleanedData.planTableId, + planTableName: cleanedData.planTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + promptsTableId: cleanedData.promptsTableId, + promptsTableName: cleanedData.promptsTableName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + resourceTableId: cleanedData.resourceTableId, + resourceTableName: cleanedData.resourceTableName, + resources: cleanedData.resources, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + shared: cleanedData.shared, + taskTableId: cleanedData.taskTableId, + taskTableName: cleanedData.taskTableName, + threadTableId: cleanedData.threadTableId, + threadTableName: cleanedData.threadTableName, + }, + select: { + agentTableId: true, + agentTableName: true, + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + hasAgents: true, + hasPlans: true, + hasResources: true, + id: true, + messageTableId: true, + messageTableName: true, + personaTableId: true, + personaTableName: true, + planTableId: true, + planTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + promptsTableId: true, + promptsTableName: true, + provisions: true, + publicSchemaName: true, + resourceTableId: true, + resourceTableName: true, + resources: true, + schemaId: true, + scope: true, + shared: true, + taskTableId: true, + taskTableName: true, + threadTableId: true, + threadTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -556,306 +619,345 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "agentTableId", - message: "agentTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "agentTableName", - message: "agentTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasAgents", - message: "hasAgents", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasPlans", - message: "hasPlans", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasResources", - message: "hasResources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "messageTableId", - message: "messageTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "messageTableName", - message: "messageTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "personaTableId", - message: "personaTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "personaTableName", - message: "personaTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planTableId", - message: "planTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planTableName", - message: "planTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "promptsTableId", - message: "promptsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "promptsTableName", - message: "promptsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceTableId", - message: "resourceTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceTableName", - message: "resourceTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "resources", - message: "resources", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "boolean", - name: "shared", - message: "shared", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskTableId", - message: "taskTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "taskTableName", - message: "taskTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "threadTableId", - message: "threadTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "threadTableName", - message: "threadTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'agentTableId', + message: 'agentTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'agentTableName', + message: 'agentTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasAgents', + message: 'hasAgents', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasPlans', + message: 'hasPlans', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasResources', + message: 'hasResources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'messageTableId', + message: 'messageTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'messageTableName', + message: 'messageTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'personaTableId', + message: 'personaTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'personaTableName', + message: 'personaTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planTableId', + message: 'planTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planTableName', + message: 'planTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'promptsTableId', + message: 'promptsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'promptsTableName', + message: 'promptsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceTableId', + message: 'resourceTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceTableName', + message: 'resourceTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'boolean', + name: 'shared', + message: 'shared', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskTableId', + message: 'taskTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskTableName', + message: 'taskTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'threadTableId', + message: 'threadTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'threadTableName', + message: 'threadTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AgentModulePatch; const client = getClient(); - const result = await client.agentModule.update({ - where: { - id: answers.id as string - }, - data: { - agentTableId: cleanedData.agentTableId, - agentTableName: cleanedData.agentTableName, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - hasAgents: cleanedData.hasAgents, - hasPlans: cleanedData.hasPlans, - hasResources: cleanedData.hasResources, - messageTableId: cleanedData.messageTableId, - messageTableName: cleanedData.messageTableName, - personaTableId: cleanedData.personaTableId, - personaTableName: cleanedData.personaTableName, - planTableId: cleanedData.planTableId, - planTableName: cleanedData.planTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - promptsTableId: cleanedData.promptsTableId, - promptsTableName: cleanedData.promptsTableName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - resourceTableId: cleanedData.resourceTableId, - resourceTableName: cleanedData.resourceTableName, - resources: cleanedData.resources, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - shared: cleanedData.shared, - taskTableId: cleanedData.taskTableId, - taskTableName: cleanedData.taskTableName, - threadTableId: cleanedData.threadTableId, - threadTableName: cleanedData.threadTableName - }, - select: { - agentTableId: true, - agentTableName: true, - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - hasAgents: true, - hasPlans: true, - hasResources: true, - id: true, - messageTableId: true, - messageTableName: true, - personaTableId: true, - personaTableName: true, - planTableId: true, - planTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - promptsTableId: true, - promptsTableName: true, - provisions: true, - publicSchemaName: true, - resourceTableId: true, - resourceTableName: true, - resources: true, - schemaId: true, - scope: true, - shared: true, - taskTableId: true, - taskTableName: true, - threadTableId: true, - threadTableName: true - } - }).execute(); + const result = await client.agentModule + .update({ + where: { + id: answers.id as string, + }, + data: { + agentTableId: cleanedData.agentTableId, + agentTableName: cleanedData.agentTableName, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + hasAgents: cleanedData.hasAgents, + hasPlans: cleanedData.hasPlans, + hasResources: cleanedData.hasResources, + messageTableId: cleanedData.messageTableId, + messageTableName: cleanedData.messageTableName, + personaTableId: cleanedData.personaTableId, + personaTableName: cleanedData.personaTableName, + planTableId: cleanedData.planTableId, + planTableName: cleanedData.planTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + promptsTableId: cleanedData.promptsTableId, + promptsTableName: cleanedData.promptsTableName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + resourceTableId: cleanedData.resourceTableId, + resourceTableName: cleanedData.resourceTableName, + resources: cleanedData.resources, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + shared: cleanedData.shared, + taskTableId: cleanedData.taskTableId, + taskTableName: cleanedData.taskTableName, + threadTableId: cleanedData.threadTableId, + threadTableName: cleanedData.threadTableName, + }, + select: { + agentTableId: true, + agentTableName: true, + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + hasAgents: true, + hasPlans: true, + hasResources: true, + id: true, + messageTableId: true, + messageTableName: true, + personaTableId: true, + personaTableName: true, + planTableId: true, + planTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + promptsTableId: true, + promptsTableName: true, + provisions: true, + publicSchemaName: true, + resourceTableId: true, + resourceTableName: true, + resources: true, + schemaId: true, + scope: true, + shared: true, + taskTableId: true, + taskTableName: true, + threadTableId: true, + threadTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -864,28 +966,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.agentModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.agentModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/api-surface-module.ts b/sdk/constructive-cli/src/modules/cli/commands/api-surface-module.ts index 5bf6ae8efe..cce28936bd 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/api-surface-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/api-surface-module.ts @@ -3,72 +3,86 @@ * @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 { CreateApiSurfaceModuleInput, ApiSurfaceModulePatch, ApiSurfaceModuleSelect, ApiSurfaceModuleFilter, ApiSurfaceModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateApiSurfaceModuleInput, + ApiSurfaceModulePatch, + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiModulesTableId: "uuid", - apiModulesTableName: "string", - apiName: "string", - apiSchemasTableId: "uuid", - apiSchemasTableName: "string", - apiSettingsTableId: "uuid", - apiSettingsTableName: "string", - apisTableId: "uuid", - apisTableName: "string", - catalogModuleId: "uuid", - corsSettingsTableId: "uuid", - corsSettingsTableName: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiModulesTableId: 'uuid', + apiModulesTableName: 'string', + apiName: 'string', + apiSchemasTableId: 'uuid', + apiSchemasTableName: 'string', + apiSettingsTableId: 'uuid', + apiSettingsTableName: 'string', + apisTableId: 'uuid', + apisTableName: 'string', + catalogModuleId: 'uuid', + corsSettingsTableId: 'uuid', + corsSettingsTableName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\napi-surface-module \n\nCommands:\n list List apiSurfaceModule records\n find-first Find first matching apiSurfaceModule record\n get Get a apiSurfaceModule by ID\n create Create a new apiSurfaceModule\n update Update an existing apiSurfaceModule\n delete Delete a apiSurfaceModule\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) => { +const usage = + '\napi-surface-module \n\nCommands:\n list List apiSurfaceModule records\n find-first Find first matching apiSurfaceModule record\n get Get a apiSurfaceModule by ID\n create Create a new apiSurfaceModule\n update Update an existing apiSurfaceModule\n delete Delete a apiSurfaceModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -101,16 +115,18 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: ApiSurfaceModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ApiSurfaceModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.apiSurfaceModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -143,16 +159,18 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ApiSurfaceModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ApiSurfaceModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.apiSurfaceModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -161,45 +179,49 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.apiSurfaceModule.findOne({ - id: answers.id as string, - select: { - apiModulesTableId: true, - apiModulesTableName: true, - apiName: true, - apiSchemasTableId: true, - apiSchemasTableName: true, - apiSettingsTableId: true, - apiSettingsTableName: true, - apisTableId: true, - apisTableName: true, - catalogModuleId: true, - corsSettingsTableId: true, - corsSettingsTableName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.apiSurfaceModule + .findOne({ + id: answers.id as string, + select: { + apiModulesTableId: true, + apiModulesTableName: true, + apiName: true, + apiSchemasTableId: true, + apiSchemasTableName: true, + apiSettingsTableId: true, + apiSettingsTableName: true, + apisTableId: true, + apisTableName: true, + catalogModuleId: true, + corsSettingsTableId: true, + corsSettingsTableName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -208,202 +230,231 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiModulesTableId", - message: "apiModulesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiModulesTableName", - message: "apiModulesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiSchemasTableId", - message: "apiSchemasTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiSchemasTableName", - message: "apiSchemasTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiSettingsTableId", - message: "apiSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiSettingsTableName", - message: "apiSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apisTableId", - message: "apisTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apisTableName", - message: "apisTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "corsSettingsTableId", - message: "corsSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "corsSettingsTableName", - message: "corsSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiModulesTableId', + message: 'apiModulesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiModulesTableName', + message: 'apiModulesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiSchemasTableId', + message: 'apiSchemasTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiSchemasTableName', + message: 'apiSchemasTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiSettingsTableId', + message: 'apiSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiSettingsTableName', + message: 'apiSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apisTableId', + message: 'apisTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apisTableName', + message: 'apisTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'corsSettingsTableId', + message: 'corsSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'corsSettingsTableName', + message: 'corsSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateApiSurfaceModuleInput["apiSurfaceModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateApiSurfaceModuleInput['apiSurfaceModule']; const client = getClient(); - const result = await client.apiSurfaceModule.create({ - data: { - apiModulesTableId: cleanedData.apiModulesTableId, - apiModulesTableName: cleanedData.apiModulesTableName, - apiName: cleanedData.apiName, - apiSchemasTableId: cleanedData.apiSchemasTableId, - apiSchemasTableName: cleanedData.apiSchemasTableName, - apiSettingsTableId: cleanedData.apiSettingsTableId, - apiSettingsTableName: cleanedData.apiSettingsTableName, - apisTableId: cleanedData.apisTableId, - apisTableName: cleanedData.apisTableName, - catalogModuleId: cleanedData.catalogModuleId, - corsSettingsTableId: cleanedData.corsSettingsTableId, - corsSettingsTableName: cleanedData.corsSettingsTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiModulesTableId: true, - apiModulesTableName: true, - apiName: true, - apiSchemasTableId: true, - apiSchemasTableName: true, - apiSettingsTableId: true, - apiSettingsTableName: true, - apisTableId: true, - apisTableName: true, - catalogModuleId: true, - corsSettingsTableId: true, - corsSettingsTableName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.apiSurfaceModule + .create({ + data: { + apiModulesTableId: cleanedData.apiModulesTableId, + apiModulesTableName: cleanedData.apiModulesTableName, + apiName: cleanedData.apiName, + apiSchemasTableId: cleanedData.apiSchemasTableId, + apiSchemasTableName: cleanedData.apiSchemasTableName, + apiSettingsTableId: cleanedData.apiSettingsTableId, + apiSettingsTableName: cleanedData.apiSettingsTableName, + apisTableId: cleanedData.apisTableId, + apisTableName: cleanedData.apisTableName, + catalogModuleId: cleanedData.catalogModuleId, + corsSettingsTableId: cleanedData.corsSettingsTableId, + corsSettingsTableName: cleanedData.corsSettingsTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiModulesTableId: true, + apiModulesTableName: true, + apiName: true, + apiSchemasTableId: true, + apiSchemasTableName: true, + apiSettingsTableId: true, + apiSettingsTableName: true, + apisTableId: true, + apisTableName: true, + catalogModuleId: true, + corsSettingsTableId: true, + corsSettingsTableName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -412,210 +463,237 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiModulesTableId", - message: "apiModulesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiModulesTableName", - message: "apiModulesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiSchemasTableId", - message: "apiSchemasTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiSchemasTableName", - message: "apiSchemasTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiSettingsTableId", - message: "apiSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiSettingsTableName", - message: "apiSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apisTableId", - message: "apisTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apisTableName", - message: "apisTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "corsSettingsTableId", - message: "corsSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "corsSettingsTableName", - message: "corsSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiModulesTableId', + message: 'apiModulesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiModulesTableName', + message: 'apiModulesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiSchemasTableId', + message: 'apiSchemasTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiSchemasTableName', + message: 'apiSchemasTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiSettingsTableId', + message: 'apiSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiSettingsTableName', + message: 'apiSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apisTableId', + message: 'apisTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apisTableName', + message: 'apisTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'corsSettingsTableId', + message: 'corsSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'corsSettingsTableName', + message: 'corsSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ApiSurfaceModulePatch; const client = getClient(); - const result = await client.apiSurfaceModule.update({ - where: { - id: answers.id as string - }, - data: { - apiModulesTableId: cleanedData.apiModulesTableId, - apiModulesTableName: cleanedData.apiModulesTableName, - apiName: cleanedData.apiName, - apiSchemasTableId: cleanedData.apiSchemasTableId, - apiSchemasTableName: cleanedData.apiSchemasTableName, - apiSettingsTableId: cleanedData.apiSettingsTableId, - apiSettingsTableName: cleanedData.apiSettingsTableName, - apisTableId: cleanedData.apisTableId, - apisTableName: cleanedData.apisTableName, - catalogModuleId: cleanedData.catalogModuleId, - corsSettingsTableId: cleanedData.corsSettingsTableId, - corsSettingsTableName: cleanedData.corsSettingsTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiModulesTableId: true, - apiModulesTableName: true, - apiName: true, - apiSchemasTableId: true, - apiSchemasTableName: true, - apiSettingsTableId: true, - apiSettingsTableName: true, - apisTableId: true, - apisTableName: true, - catalogModuleId: true, - corsSettingsTableId: true, - corsSettingsTableName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.apiSurfaceModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiModulesTableId: cleanedData.apiModulesTableId, + apiModulesTableName: cleanedData.apiModulesTableName, + apiName: cleanedData.apiName, + apiSchemasTableId: cleanedData.apiSchemasTableId, + apiSchemasTableName: cleanedData.apiSchemasTableName, + apiSettingsTableId: cleanedData.apiSettingsTableId, + apiSettingsTableName: cleanedData.apiSettingsTableName, + apisTableId: cleanedData.apisTableId, + apisTableName: cleanedData.apisTableName, + catalogModuleId: cleanedData.catalogModuleId, + corsSettingsTableId: cleanedData.corsSettingsTableId, + corsSettingsTableName: cleanedData.corsSettingsTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiModulesTableId: true, + apiModulesTableName: true, + apiName: true, + apiSchemasTableId: true, + apiSchemasTableName: true, + apiSettingsTableId: true, + apiSettingsTableName: true, + apisTableId: true, + apisTableName: true, + catalogModuleId: true, + corsSettingsTableId: true, + corsSettingsTableName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -624,28 +702,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.apiSurfaceModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.apiSurfaceModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/app-module.ts b/sdk/constructive-cli/src/modules/cli/commands/app-module.ts index cb9b26305f..3cd6f51a23 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/app-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/app-module.ts @@ -3,68 +3,82 @@ * @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 { CreateAppModuleInput, AppModulePatch, AppModuleSelect, AppModuleFilter, AppModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppModuleInput, + AppModulePatch, + AppModuleSelect, + AppModuleFilter, + AppModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - appComponentsTableId: "uuid", - appComponentsTableName: "string", - appsTableId: "uuid", - appsTableName: "string", - catalogModuleId: "uuid", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + appComponentsTableId: 'uuid', + appComponentsTableName: 'string', + appsTableId: 'uuid', + appsTableName: 'string', + catalogModuleId: 'uuid', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\napp-module \n\nCommands:\n list List appModule records\n find-first Find first matching appModule record\n get Get a appModule by ID\n create Create a new appModule\n update Update an existing appModule\n delete Delete a appModule\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) => { +const usage = + '\napp-module \n\nCommands:\n list List appModule records\n find-first Find first matching appModule record\n get Get a appModule by ID\n create Create a new appModule\n update Update an existing appModule\n delete Delete a appModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,18 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +147,18 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +167,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - appComponentsTableId: true, - appComponentsTableName: true, - appsTableId: true, - appsTableName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.appModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + appComponentsTableId: true, + appComponentsTableName: true, + appsTableId: true, + appsTableName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,170 +214,192 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appComponentsTableId", - message: "appComponentsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appComponentsTableName", - message: "appComponentsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appsTableId", - message: "appsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appsTableName", - message: "appsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appComponentsTableId', + message: 'appComponentsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appComponentsTableName', + message: 'appComponentsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appsTableId', + message: 'appsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appsTableName', + message: 'appsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppModuleInput["appModule"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppModuleInput['appModule']; const client = getClient(); - const result = await client.appModule.create({ - data: { - apiName: cleanedData.apiName, - appComponentsTableId: cleanedData.appComponentsTableId, - appComponentsTableName: cleanedData.appComponentsTableName, - appsTableId: cleanedData.appsTableId, - appsTableName: cleanedData.appsTableName, - catalogModuleId: cleanedData.catalogModuleId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - appComponentsTableId: true, - appComponentsTableName: true, - appsTableId: true, - appsTableName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.appModule + .create({ + data: { + apiName: cleanedData.apiName, + appComponentsTableId: cleanedData.appComponentsTableId, + appComponentsTableName: cleanedData.appComponentsTableName, + appsTableId: cleanedData.appsTableId, + appsTableName: cleanedData.appsTableName, + catalogModuleId: cleanedData.catalogModuleId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + appComponentsTableId: true, + appComponentsTableName: true, + appsTableId: true, + appsTableName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -364,178 +408,201 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appComponentsTableId", - message: "appComponentsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appComponentsTableName", - message: "appComponentsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appsTableId", - message: "appsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appsTableName", - message: "appsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appComponentsTableId', + message: 'appComponentsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appComponentsTableName', + message: 'appComponentsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appsTableId', + message: 'appsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appsTableName', + message: 'appsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppModulePatch; const client = getClient(); - const result = await client.appModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - appComponentsTableId: cleanedData.appComponentsTableId, - appComponentsTableName: cleanedData.appComponentsTableName, - appsTableId: cleanedData.appsTableId, - appsTableName: cleanedData.appsTableName, - catalogModuleId: cleanedData.catalogModuleId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - appComponentsTableId: true, - appComponentsTableName: true, - appsTableId: true, - appsTableName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.appModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + appComponentsTableId: cleanedData.appComponentsTableId, + appComponentsTableName: cleanedData.appComponentsTableName, + appsTableId: cleanedData.appsTableId, + appsTableName: cleanedData.appsTableName, + catalogModuleId: cleanedData.catalogModuleId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + appComponentsTableId: true, + appComponentsTableName: true, + appsTableId: true, + appsTableName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -544,28 +611,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/auth.ts b/sdk/constructive-cli/src/modules/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/billing-module.ts b/sdk/constructive-cli/src/modules/cli/commands/billing-module.ts index 745428fb66..4d1fedc817 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/billing-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/billing-module.ts @@ -3,75 +3,89 @@ * @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 { CreateBillingModuleInput, BillingModulePatch, BillingModuleSelect, BillingModuleFilter, BillingModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateBillingModuleInput, + BillingModulePatch, + BillingModuleSelect, + BillingModuleFilter, + BillingModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - balancesTableId: "uuid", - balancesTableName: "string", - databaseId: "uuid", - defaultPermissions: "string", - id: "uuid", - ledgerTableId: "uuid", - ledgerTableName: "string", - meterCreditsTableId: "uuid", - meterCreditsTableName: "string", - meterDefaultsTableId: "uuid", - meterDefaultsTableName: "string", - meterSourcesTableId: "uuid", - meterSourcesTableName: "string", - metersTableId: "uuid", - metersTableName: "string", - planSubscriptionsTableId: "uuid", - planSubscriptionsTableName: "string", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - recordUsageFunction: "string", - rollupUsageSummaryFunction: "string", - schemaId: "uuid", - sweepExpiredSubscriptionsFunction: "string" + apiName: 'string', + balancesTableId: 'uuid', + balancesTableName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + id: 'uuid', + ledgerTableId: 'uuid', + ledgerTableName: 'string', + meterCreditsTableId: 'uuid', + meterCreditsTableName: 'string', + meterDefaultsTableId: 'uuid', + meterDefaultsTableName: 'string', + meterSourcesTableId: 'uuid', + meterSourcesTableName: 'string', + metersTableId: 'uuid', + metersTableName: 'string', + planSubscriptionsTableId: 'uuid', + planSubscriptionsTableName: 'string', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + recordUsageFunction: 'string', + rollupUsageSummaryFunction: 'string', + schemaId: 'uuid', + sweepExpiredSubscriptionsFunction: 'string', }; -const usage = "\nbilling-module \n\nCommands:\n list List billingModule records\n find-first Find first matching billingModule record\n get Get a billingModule by ID\n create Create a new billingModule\n update Update an existing billingModule\n delete Delete a billingModule\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) => { +const usage = + '\nbilling-module \n\nCommands:\n list List billingModule records\n find-first Find first matching billingModule record\n get Get a billingModule by ID\n create Create a new billingModule\n update Update an existing billingModule\n delete Delete a billingModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -107,16 +121,18 @@ async function handleList(argv: Partial>, _prompter: Inq recordUsageFunction: true, rollupUsageSummaryFunction: true, schemaId: true, - sweepExpiredSubscriptionsFunction: true + sweepExpiredSubscriptionsFunction: true, }; - const findManyArgs = parseFindManyArgs & { - select: BillingModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: BillingModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.billingModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -152,16 +168,18 @@ async function handleFindFirst(argv: Partial>, _prompter recordUsageFunction: true, rollupUsageSummaryFunction: true, schemaId: true, - sweepExpiredSubscriptionsFunction: true + sweepExpiredSubscriptionsFunction: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: BillingModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: BillingModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.billingModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -170,48 +188,52 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.billingModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - balancesTableId: true, - balancesTableName: true, - databaseId: true, - defaultPermissions: true, - id: true, - ledgerTableId: true, - ledgerTableName: true, - meterCreditsTableId: true, - meterCreditsTableName: true, - meterDefaultsTableId: true, - meterDefaultsTableName: true, - meterSourcesTableId: true, - meterSourcesTableName: true, - metersTableId: true, - metersTableName: true, - planSubscriptionsTableId: true, - planSubscriptionsTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - recordUsageFunction: true, - rollupUsageSummaryFunction: true, - schemaId: true, - sweepExpiredSubscriptionsFunction: true - } - }).execute(); + const result = await client.billingModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + balancesTableId: true, + balancesTableName: true, + databaseId: true, + defaultPermissions: true, + id: true, + ledgerTableId: true, + ledgerTableName: true, + meterCreditsTableId: true, + meterCreditsTableName: true, + meterDefaultsTableId: true, + meterDefaultsTableName: true, + meterSourcesTableId: true, + meterSourcesTableName: true, + metersTableId: true, + metersTableName: true, + planSubscriptionsTableId: true, + planSubscriptionsTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + recordUsageFunction: true, + rollupUsageSummaryFunction: true, + schemaId: true, + sweepExpiredSubscriptionsFunction: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -220,227 +242,259 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "balancesTableId", - message: "balancesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "balancesTableName", - message: "balancesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ledgerTableId", - message: "ledgerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ledgerTableName", - message: "ledgerTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterCreditsTableId", - message: "meterCreditsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterCreditsTableName", - message: "meterCreditsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterDefaultsTableId", - message: "meterDefaultsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterDefaultsTableName", - message: "meterDefaultsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterSourcesTableId", - message: "meterSourcesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterSourcesTableName", - message: "meterSourcesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "metersTableId", - message: "metersTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "metersTableName", - message: "metersTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planSubscriptionsTableId", - message: "planSubscriptionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planSubscriptionsTableName", - message: "planSubscriptionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordUsageFunction", - message: "recordUsageFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rollupUsageSummaryFunction", - message: "rollupUsageSummaryFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sweepExpiredSubscriptionsFunction", - message: "sweepExpiredSubscriptionsFunction", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'balancesTableId', + message: 'balancesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'balancesTableName', + message: 'balancesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ledgerTableId', + message: 'ledgerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ledgerTableName', + message: 'ledgerTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterCreditsTableId', + message: 'meterCreditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterCreditsTableName', + message: 'meterCreditsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterDefaultsTableId', + message: 'meterDefaultsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterDefaultsTableName', + message: 'meterDefaultsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterSourcesTableId', + message: 'meterSourcesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterSourcesTableName', + message: 'meterSourcesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'metersTableId', + message: 'metersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'metersTableName', + message: 'metersTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planSubscriptionsTableId', + message: 'planSubscriptionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planSubscriptionsTableName', + message: 'planSubscriptionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordUsageFunction', + message: 'recordUsageFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rollupUsageSummaryFunction', + message: 'rollupUsageSummaryFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sweepExpiredSubscriptionsFunction', + message: 'sweepExpiredSubscriptionsFunction', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateBillingModuleInput["billingModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateBillingModuleInput['billingModule']; const client = getClient(); - const result = await client.billingModule.create({ - data: { - apiName: cleanedData.apiName, - balancesTableId: cleanedData.balancesTableId, - balancesTableName: cleanedData.balancesTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - ledgerTableId: cleanedData.ledgerTableId, - ledgerTableName: cleanedData.ledgerTableName, - meterCreditsTableId: cleanedData.meterCreditsTableId, - meterCreditsTableName: cleanedData.meterCreditsTableName, - meterDefaultsTableId: cleanedData.meterDefaultsTableId, - meterDefaultsTableName: cleanedData.meterDefaultsTableName, - meterSourcesTableId: cleanedData.meterSourcesTableId, - meterSourcesTableName: cleanedData.meterSourcesTableName, - metersTableId: cleanedData.metersTableId, - metersTableName: cleanedData.metersTableName, - planSubscriptionsTableId: cleanedData.planSubscriptionsTableId, - planSubscriptionsTableName: cleanedData.planSubscriptionsTableName, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - recordUsageFunction: cleanedData.recordUsageFunction, - rollupUsageSummaryFunction: cleanedData.rollupUsageSummaryFunction, - schemaId: cleanedData.schemaId, - sweepExpiredSubscriptionsFunction: cleanedData.sweepExpiredSubscriptionsFunction - }, - select: { - apiName: true, - balancesTableId: true, - balancesTableName: true, - databaseId: true, - defaultPermissions: true, - id: true, - ledgerTableId: true, - ledgerTableName: true, - meterCreditsTableId: true, - meterCreditsTableName: true, - meterDefaultsTableId: true, - meterDefaultsTableName: true, - meterSourcesTableId: true, - meterSourcesTableName: true, - metersTableId: true, - metersTableName: true, - planSubscriptionsTableId: true, - planSubscriptionsTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - recordUsageFunction: true, - rollupUsageSummaryFunction: true, - schemaId: true, - sweepExpiredSubscriptionsFunction: true - } - }).execute(); + const result = await client.billingModule + .create({ + data: { + apiName: cleanedData.apiName, + balancesTableId: cleanedData.balancesTableId, + balancesTableName: cleanedData.balancesTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + ledgerTableId: cleanedData.ledgerTableId, + ledgerTableName: cleanedData.ledgerTableName, + meterCreditsTableId: cleanedData.meterCreditsTableId, + meterCreditsTableName: cleanedData.meterCreditsTableName, + meterDefaultsTableId: cleanedData.meterDefaultsTableId, + meterDefaultsTableName: cleanedData.meterDefaultsTableName, + meterSourcesTableId: cleanedData.meterSourcesTableId, + meterSourcesTableName: cleanedData.meterSourcesTableName, + metersTableId: cleanedData.metersTableId, + metersTableName: cleanedData.metersTableName, + planSubscriptionsTableId: cleanedData.planSubscriptionsTableId, + planSubscriptionsTableName: cleanedData.planSubscriptionsTableName, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + recordUsageFunction: cleanedData.recordUsageFunction, + rollupUsageSummaryFunction: cleanedData.rollupUsageSummaryFunction, + schemaId: cleanedData.schemaId, + sweepExpiredSubscriptionsFunction: cleanedData.sweepExpiredSubscriptionsFunction, + }, + select: { + apiName: true, + balancesTableId: true, + balancesTableName: true, + databaseId: true, + defaultPermissions: true, + id: true, + ledgerTableId: true, + ledgerTableName: true, + meterCreditsTableId: true, + meterCreditsTableName: true, + meterDefaultsTableId: true, + meterDefaultsTableName: true, + meterSourcesTableId: true, + meterSourcesTableName: true, + metersTableId: true, + metersTableName: true, + planSubscriptionsTableId: true, + planSubscriptionsTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + recordUsageFunction: true, + rollupUsageSummaryFunction: true, + schemaId: true, + sweepExpiredSubscriptionsFunction: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -449,235 +503,265 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "balancesTableId", - message: "balancesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "balancesTableName", - message: "balancesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ledgerTableId", - message: "ledgerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ledgerTableName", - message: "ledgerTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterCreditsTableId", - message: "meterCreditsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterCreditsTableName", - message: "meterCreditsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterDefaultsTableId", - message: "meterDefaultsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterDefaultsTableName", - message: "meterDefaultsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterSourcesTableId", - message: "meterSourcesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "meterSourcesTableName", - message: "meterSourcesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "metersTableId", - message: "metersTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "metersTableName", - message: "metersTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planSubscriptionsTableId", - message: "planSubscriptionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planSubscriptionsTableName", - message: "planSubscriptionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordUsageFunction", - message: "recordUsageFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rollupUsageSummaryFunction", - message: "rollupUsageSummaryFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sweepExpiredSubscriptionsFunction", - message: "sweepExpiredSubscriptionsFunction", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'balancesTableId', + message: 'balancesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'balancesTableName', + message: 'balancesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ledgerTableId', + message: 'ledgerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ledgerTableName', + message: 'ledgerTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterCreditsTableId', + message: 'meterCreditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterCreditsTableName', + message: 'meterCreditsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterDefaultsTableId', + message: 'meterDefaultsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterDefaultsTableName', + message: 'meterDefaultsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterSourcesTableId', + message: 'meterSourcesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'meterSourcesTableName', + message: 'meterSourcesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'metersTableId', + message: 'metersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'metersTableName', + message: 'metersTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planSubscriptionsTableId', + message: 'planSubscriptionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planSubscriptionsTableName', + message: 'planSubscriptionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordUsageFunction', + message: 'recordUsageFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rollupUsageSummaryFunction', + message: 'rollupUsageSummaryFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sweepExpiredSubscriptionsFunction', + message: 'sweepExpiredSubscriptionsFunction', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as BillingModulePatch; const client = getClient(); - const result = await client.billingModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - balancesTableId: cleanedData.balancesTableId, - balancesTableName: cleanedData.balancesTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - ledgerTableId: cleanedData.ledgerTableId, - ledgerTableName: cleanedData.ledgerTableName, - meterCreditsTableId: cleanedData.meterCreditsTableId, - meterCreditsTableName: cleanedData.meterCreditsTableName, - meterDefaultsTableId: cleanedData.meterDefaultsTableId, - meterDefaultsTableName: cleanedData.meterDefaultsTableName, - meterSourcesTableId: cleanedData.meterSourcesTableId, - meterSourcesTableName: cleanedData.meterSourcesTableName, - metersTableId: cleanedData.metersTableId, - metersTableName: cleanedData.metersTableName, - planSubscriptionsTableId: cleanedData.planSubscriptionsTableId, - planSubscriptionsTableName: cleanedData.planSubscriptionsTableName, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - recordUsageFunction: cleanedData.recordUsageFunction, - rollupUsageSummaryFunction: cleanedData.rollupUsageSummaryFunction, - schemaId: cleanedData.schemaId, - sweepExpiredSubscriptionsFunction: cleanedData.sweepExpiredSubscriptionsFunction - }, - select: { - apiName: true, - balancesTableId: true, - balancesTableName: true, - databaseId: true, - defaultPermissions: true, - id: true, - ledgerTableId: true, - ledgerTableName: true, - meterCreditsTableId: true, - meterCreditsTableName: true, - meterDefaultsTableId: true, - meterDefaultsTableName: true, - meterSourcesTableId: true, - meterSourcesTableName: true, - metersTableId: true, - metersTableName: true, - planSubscriptionsTableId: true, - planSubscriptionsTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - recordUsageFunction: true, - rollupUsageSummaryFunction: true, - schemaId: true, - sweepExpiredSubscriptionsFunction: true - } - }).execute(); + const result = await client.billingModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + balancesTableId: cleanedData.balancesTableId, + balancesTableName: cleanedData.balancesTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + ledgerTableId: cleanedData.ledgerTableId, + ledgerTableName: cleanedData.ledgerTableName, + meterCreditsTableId: cleanedData.meterCreditsTableId, + meterCreditsTableName: cleanedData.meterCreditsTableName, + meterDefaultsTableId: cleanedData.meterDefaultsTableId, + meterDefaultsTableName: cleanedData.meterDefaultsTableName, + meterSourcesTableId: cleanedData.meterSourcesTableId, + meterSourcesTableName: cleanedData.meterSourcesTableName, + metersTableId: cleanedData.metersTableId, + metersTableName: cleanedData.metersTableName, + planSubscriptionsTableId: cleanedData.planSubscriptionsTableId, + planSubscriptionsTableName: cleanedData.planSubscriptionsTableName, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + recordUsageFunction: cleanedData.recordUsageFunction, + rollupUsageSummaryFunction: cleanedData.rollupUsageSummaryFunction, + schemaId: cleanedData.schemaId, + sweepExpiredSubscriptionsFunction: cleanedData.sweepExpiredSubscriptionsFunction, + }, + select: { + apiName: true, + balancesTableId: true, + balancesTableName: true, + databaseId: true, + defaultPermissions: true, + id: true, + ledgerTableId: true, + ledgerTableName: true, + meterCreditsTableId: true, + meterCreditsTableName: true, + meterDefaultsTableId: true, + meterDefaultsTableName: true, + meterSourcesTableId: true, + meterSourcesTableName: true, + metersTableId: true, + metersTableName: true, + planSubscriptionsTableId: true, + planSubscriptionsTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + recordUsageFunction: true, + rollupUsageSummaryFunction: true, + schemaId: true, + sweepExpiredSubscriptionsFunction: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -686,28 +770,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.billingModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.billingModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/billing-provider-module.ts b/sdk/constructive-cli/src/modules/cli/commands/billing-provider-module.ts index 9668f9733f..74e9a0d3f1 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/billing-provider-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/billing-provider-module.ts @@ -3,70 +3,84 @@ * @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 { CreateBillingProviderModuleInput, BillingProviderModulePatch, BillingProviderModuleSelect, BillingProviderModuleFilter, BillingProviderModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateBillingProviderModuleInput, + BillingProviderModulePatch, + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - billingCustomersTableId: "uuid", - billingCustomersTableName: "string", - billingPricesTableId: "uuid", - billingPricesTableName: "string", - billingProductsTableId: "uuid", - billingProductsTableName: "string", - billingSubscriptionsTableId: "uuid", - billingSubscriptionsTableName: "string", - billingWebhookEventsTableId: "uuid", - billingWebhookEventsTableName: "string", - databaseId: "uuid", - id: "uuid", - prefix: "string", - pricesTableId: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - processBillingEventFunction: "string", - productsTableId: "uuid", - provider: "string", - schemaId: "uuid", - subscriptionsTableId: "uuid" + apiName: 'string', + billingCustomersTableId: 'uuid', + billingCustomersTableName: 'string', + billingPricesTableId: 'uuid', + billingPricesTableName: 'string', + billingProductsTableId: 'uuid', + billingProductsTableName: 'string', + billingSubscriptionsTableId: 'uuid', + billingSubscriptionsTableName: 'string', + billingWebhookEventsTableId: 'uuid', + billingWebhookEventsTableName: 'string', + databaseId: 'uuid', + id: 'uuid', + prefix: 'string', + pricesTableId: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + processBillingEventFunction: 'string', + productsTableId: 'uuid', + provider: 'string', + schemaId: 'uuid', + subscriptionsTableId: 'uuid', }; -const usage = "\nbilling-provider-module \n\nCommands:\n list List billingProviderModule records\n find-first Find first matching billingProviderModule record\n get Get a billingProviderModule by ID\n create Create a new billingProviderModule\n update Update an existing billingProviderModule\n delete Delete a billingProviderModule\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) => { +const usage = + '\nbilling-provider-module \n\nCommands:\n list List billingProviderModule records\n find-first Find first matching billingProviderModule record\n get Get a billingProviderModule by ID\n create Create a new billingProviderModule\n update Update an existing billingProviderModule\n delete Delete a billingProviderModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -97,16 +111,22 @@ async function handleList(argv: Partial>, _prompter: Inq productsTableId: true, provider: true, schemaId: true, - subscriptionsTableId: true + subscriptionsTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: BillingProviderModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy + > & { + select: BillingProviderModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.billingProviderModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -137,16 +157,22 @@ async function handleFindFirst(argv: Partial>, _prompter productsTableId: true, provider: true, schemaId: true, - subscriptionsTableId: true + subscriptionsTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: BillingProviderModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy + > & { + select: BillingProviderModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.billingProviderModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -155,43 +181,47 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.billingProviderModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - billingCustomersTableId: true, - billingCustomersTableName: true, - billingPricesTableId: true, - billingPricesTableName: true, - billingProductsTableId: true, - billingProductsTableName: true, - billingSubscriptionsTableId: true, - billingSubscriptionsTableName: true, - billingWebhookEventsTableId: true, - billingWebhookEventsTableName: true, - databaseId: true, - id: true, - prefix: true, - pricesTableId: true, - privateApiName: true, - privateSchemaId: true, - processBillingEventFunction: true, - productsTableId: true, - provider: true, - schemaId: true, - subscriptionsTableId: true - } - }).execute(); + const result = await client.billingProviderModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + billingCustomersTableId: true, + billingCustomersTableName: true, + billingPricesTableId: true, + billingPricesTableName: true, + billingProductsTableId: true, + billingProductsTableName: true, + billingSubscriptionsTableId: true, + billingSubscriptionsTableName: true, + billingWebhookEventsTableId: true, + billingWebhookEventsTableName: true, + databaseId: true, + id: true, + prefix: true, + pricesTableId: true, + privateApiName: true, + privateSchemaId: true, + processBillingEventFunction: true, + productsTableId: true, + provider: true, + schemaId: true, + subscriptionsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -200,187 +230,214 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingCustomersTableId", - message: "billingCustomersTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingCustomersTableName", - message: "billingCustomersTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingPricesTableId", - message: "billingPricesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingPricesTableName", - message: "billingPricesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingProductsTableId", - message: "billingProductsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingProductsTableName", - message: "billingProductsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingSubscriptionsTableId", - message: "billingSubscriptionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingSubscriptionsTableName", - message: "billingSubscriptionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingWebhookEventsTableId", - message: "billingWebhookEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingWebhookEventsTableName", - message: "billingWebhookEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pricesTableId", - message: "pricesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "processBillingEventFunction", - message: "processBillingEventFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "productsTableId", - message: "productsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "subscriptionsTableId", - message: "subscriptionsTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingCustomersTableId', + message: 'billingCustomersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingCustomersTableName', + message: 'billingCustomersTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingPricesTableId', + message: 'billingPricesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingPricesTableName', + message: 'billingPricesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingProductsTableId', + message: 'billingProductsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingProductsTableName', + message: 'billingProductsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingSubscriptionsTableId', + message: 'billingSubscriptionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingSubscriptionsTableName', + message: 'billingSubscriptionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingWebhookEventsTableId', + message: 'billingWebhookEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingWebhookEventsTableName', + message: 'billingWebhookEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pricesTableId', + message: 'pricesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'processBillingEventFunction', + message: 'processBillingEventFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'productsTableId', + message: 'productsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'subscriptionsTableId', + message: 'subscriptionsTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateBillingProviderModuleInput["billingProviderModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateBillingProviderModuleInput['billingProviderModule']; const client = getClient(); - const result = await client.billingProviderModule.create({ - data: { - apiName: cleanedData.apiName, - billingCustomersTableId: cleanedData.billingCustomersTableId, - billingCustomersTableName: cleanedData.billingCustomersTableName, - billingPricesTableId: cleanedData.billingPricesTableId, - billingPricesTableName: cleanedData.billingPricesTableName, - billingProductsTableId: cleanedData.billingProductsTableId, - billingProductsTableName: cleanedData.billingProductsTableName, - billingSubscriptionsTableId: cleanedData.billingSubscriptionsTableId, - billingSubscriptionsTableName: cleanedData.billingSubscriptionsTableName, - billingWebhookEventsTableId: cleanedData.billingWebhookEventsTableId, - billingWebhookEventsTableName: cleanedData.billingWebhookEventsTableName, - databaseId: cleanedData.databaseId, - prefix: cleanedData.prefix, - pricesTableId: cleanedData.pricesTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - processBillingEventFunction: cleanedData.processBillingEventFunction, - productsTableId: cleanedData.productsTableId, - provider: cleanedData.provider, - schemaId: cleanedData.schemaId, - subscriptionsTableId: cleanedData.subscriptionsTableId - }, - select: { - apiName: true, - billingCustomersTableId: true, - billingCustomersTableName: true, - billingPricesTableId: true, - billingPricesTableName: true, - billingProductsTableId: true, - billingProductsTableName: true, - billingSubscriptionsTableId: true, - billingSubscriptionsTableName: true, - billingWebhookEventsTableId: true, - billingWebhookEventsTableName: true, - databaseId: true, - id: true, - prefix: true, - pricesTableId: true, - privateApiName: true, - privateSchemaId: true, - processBillingEventFunction: true, - productsTableId: true, - provider: true, - schemaId: true, - subscriptionsTableId: true - } - }).execute(); + const result = await client.billingProviderModule + .create({ + data: { + apiName: cleanedData.apiName, + billingCustomersTableId: cleanedData.billingCustomersTableId, + billingCustomersTableName: cleanedData.billingCustomersTableName, + billingPricesTableId: cleanedData.billingPricesTableId, + billingPricesTableName: cleanedData.billingPricesTableName, + billingProductsTableId: cleanedData.billingProductsTableId, + billingProductsTableName: cleanedData.billingProductsTableName, + billingSubscriptionsTableId: cleanedData.billingSubscriptionsTableId, + billingSubscriptionsTableName: cleanedData.billingSubscriptionsTableName, + billingWebhookEventsTableId: cleanedData.billingWebhookEventsTableId, + billingWebhookEventsTableName: cleanedData.billingWebhookEventsTableName, + databaseId: cleanedData.databaseId, + prefix: cleanedData.prefix, + pricesTableId: cleanedData.pricesTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + processBillingEventFunction: cleanedData.processBillingEventFunction, + productsTableId: cleanedData.productsTableId, + provider: cleanedData.provider, + schemaId: cleanedData.schemaId, + subscriptionsTableId: cleanedData.subscriptionsTableId, + }, + select: { + apiName: true, + billingCustomersTableId: true, + billingCustomersTableName: true, + billingPricesTableId: true, + billingPricesTableName: true, + billingProductsTableId: true, + billingProductsTableName: true, + billingSubscriptionsTableId: true, + billingSubscriptionsTableName: true, + billingWebhookEventsTableId: true, + billingWebhookEventsTableName: true, + databaseId: true, + id: true, + prefix: true, + pricesTableId: true, + privateApiName: true, + privateSchemaId: true, + processBillingEventFunction: true, + productsTableId: true, + provider: true, + schemaId: true, + subscriptionsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -389,195 +446,220 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingCustomersTableId", - message: "billingCustomersTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingCustomersTableName", - message: "billingCustomersTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingPricesTableId", - message: "billingPricesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingPricesTableName", - message: "billingPricesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingProductsTableId", - message: "billingProductsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingProductsTableName", - message: "billingProductsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingSubscriptionsTableId", - message: "billingSubscriptionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingSubscriptionsTableName", - message: "billingSubscriptionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingWebhookEventsTableId", - message: "billingWebhookEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "billingWebhookEventsTableName", - message: "billingWebhookEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pricesTableId", - message: "pricesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "processBillingEventFunction", - message: "processBillingEventFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "productsTableId", - message: "productsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "subscriptionsTableId", - message: "subscriptionsTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingCustomersTableId', + message: 'billingCustomersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingCustomersTableName', + message: 'billingCustomersTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingPricesTableId', + message: 'billingPricesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingPricesTableName', + message: 'billingPricesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingProductsTableId', + message: 'billingProductsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingProductsTableName', + message: 'billingProductsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingSubscriptionsTableId', + message: 'billingSubscriptionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingSubscriptionsTableName', + message: 'billingSubscriptionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingWebhookEventsTableId', + message: 'billingWebhookEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'billingWebhookEventsTableName', + message: 'billingWebhookEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pricesTableId', + message: 'pricesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'processBillingEventFunction', + message: 'processBillingEventFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'productsTableId', + message: 'productsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'subscriptionsTableId', + message: 'subscriptionsTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as BillingProviderModulePatch; const client = getClient(); - const result = await client.billingProviderModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - billingCustomersTableId: cleanedData.billingCustomersTableId, - billingCustomersTableName: cleanedData.billingCustomersTableName, - billingPricesTableId: cleanedData.billingPricesTableId, - billingPricesTableName: cleanedData.billingPricesTableName, - billingProductsTableId: cleanedData.billingProductsTableId, - billingProductsTableName: cleanedData.billingProductsTableName, - billingSubscriptionsTableId: cleanedData.billingSubscriptionsTableId, - billingSubscriptionsTableName: cleanedData.billingSubscriptionsTableName, - billingWebhookEventsTableId: cleanedData.billingWebhookEventsTableId, - billingWebhookEventsTableName: cleanedData.billingWebhookEventsTableName, - databaseId: cleanedData.databaseId, - prefix: cleanedData.prefix, - pricesTableId: cleanedData.pricesTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - processBillingEventFunction: cleanedData.processBillingEventFunction, - productsTableId: cleanedData.productsTableId, - provider: cleanedData.provider, - schemaId: cleanedData.schemaId, - subscriptionsTableId: cleanedData.subscriptionsTableId - }, - select: { - apiName: true, - billingCustomersTableId: true, - billingCustomersTableName: true, - billingPricesTableId: true, - billingPricesTableName: true, - billingProductsTableId: true, - billingProductsTableName: true, - billingSubscriptionsTableId: true, - billingSubscriptionsTableName: true, - billingWebhookEventsTableId: true, - billingWebhookEventsTableName: true, - databaseId: true, - id: true, - prefix: true, - pricesTableId: true, - privateApiName: true, - privateSchemaId: true, - processBillingEventFunction: true, - productsTableId: true, - provider: true, - schemaId: true, - subscriptionsTableId: true - } - }).execute(); + const result = await client.billingProviderModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + billingCustomersTableId: cleanedData.billingCustomersTableId, + billingCustomersTableName: cleanedData.billingCustomersTableName, + billingPricesTableId: cleanedData.billingPricesTableId, + billingPricesTableName: cleanedData.billingPricesTableName, + billingProductsTableId: cleanedData.billingProductsTableId, + billingProductsTableName: cleanedData.billingProductsTableName, + billingSubscriptionsTableId: cleanedData.billingSubscriptionsTableId, + billingSubscriptionsTableName: cleanedData.billingSubscriptionsTableName, + billingWebhookEventsTableId: cleanedData.billingWebhookEventsTableId, + billingWebhookEventsTableName: cleanedData.billingWebhookEventsTableName, + databaseId: cleanedData.databaseId, + prefix: cleanedData.prefix, + pricesTableId: cleanedData.pricesTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + processBillingEventFunction: cleanedData.processBillingEventFunction, + productsTableId: cleanedData.productsTableId, + provider: cleanedData.provider, + schemaId: cleanedData.schemaId, + subscriptionsTableId: cleanedData.subscriptionsTableId, + }, + select: { + apiName: true, + billingCustomersTableId: true, + billingCustomersTableName: true, + billingPricesTableId: true, + billingPricesTableName: true, + billingProductsTableId: true, + billingProductsTableName: true, + billingSubscriptionsTableId: true, + billingSubscriptionsTableName: true, + billingWebhookEventsTableId: true, + billingWebhookEventsTableName: true, + databaseId: true, + id: true, + prefix: true, + pricesTableId: true, + privateApiName: true, + privateSchemaId: true, + processBillingEventFunction: true, + productsTableId: true, + provider: true, + schemaId: true, + subscriptionsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -586,28 +668,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.billingProviderModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.billingProviderModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/blueprint-construction.ts b/sdk/constructive-cli/src/modules/cli/commands/blueprint-construction.ts index 5fb46ff8b5..3e24933007 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/blueprint-construction.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/blueprint-construction.ts @@ -3,59 +3,73 @@ * @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 { CreateBlueprintConstructionInput, BlueprintConstructionPatch, BlueprintConstructionSelect, BlueprintConstructionFilter, BlueprintConstructionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateBlueprintConstructionInput, + BlueprintConstructionPatch, + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - blueprintId: "uuid", - constructedAt: "string", - constructedDefinition: "json", - createdAt: "string", - databaseId: "uuid", - errorDetails: "string", - id: "uuid", - schemaId: "uuid", - status: "string", - tableMap: "json", - updatedAt: "string" + blueprintId: 'uuid', + constructedAt: 'string', + constructedDefinition: 'json', + createdAt: 'string', + databaseId: 'uuid', + errorDetails: 'string', + id: 'uuid', + schemaId: 'uuid', + status: 'string', + tableMap: 'json', + updatedAt: 'string', }; -const usage = "\nblueprint-construction \n\nCommands:\n list List blueprintConstruction records\n find-first Find first matching blueprintConstruction record\n get Get a blueprintConstruction by ID\n create Create a new blueprintConstruction\n update Update an existing blueprintConstruction\n delete Delete a blueprintConstruction\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) => { +const usage = + '\nblueprint-construction \n\nCommands:\n list List blueprintConstruction records\n find-first Find first matching blueprintConstruction record\n get Get a blueprintConstruction by ID\n create Create a new blueprintConstruction\n update Update an existing blueprintConstruction\n delete Delete a blueprintConstruction\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, status: true, tableMap: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: BlueprintConstructionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy + > & { + select: BlueprintConstructionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.blueprintConstruction.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +124,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, status: true, tableMap: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: BlueprintConstructionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy + > & { + select: BlueprintConstructionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.blueprintConstruction.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +148,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.blueprintConstruction.findOne({ - id: answers.id as string, - select: { - blueprintId: true, - constructedAt: true, - constructedDefinition: true, - createdAt: true, - databaseId: true, - errorDetails: true, - id: true, - schemaId: true, - status: true, - tableMap: true, - updatedAt: true - } - }).execute(); + const result = await client.blueprintConstruction + .findOne({ + id: answers.id as string, + select: { + blueprintId: true, + constructedAt: true, + constructedDefinition: true, + createdAt: true, + databaseId: true, + errorDetails: true, + id: true, + schemaId: true, + status: true, + tableMap: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,84 +186,98 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "blueprintId", - message: "blueprintId", - required: true - }, { - type: "text", - name: "constructedAt", - message: "constructedAt", - required: false, - skipPrompt: true - }, { - type: "json", - name: "constructedDefinition", - message: "constructedDefinition", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "errorDetails", - message: "errorDetails", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "json", - name: "tableMap", - message: "tableMap", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'blueprintId', + message: 'blueprintId', + required: true, + }, + { + type: 'text', + name: 'constructedAt', + message: 'constructedAt', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'constructedDefinition', + message: 'constructedDefinition', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'errorDetails', + message: 'errorDetails', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'tableMap', + message: 'tableMap', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateBlueprintConstructionInput["blueprintConstruction"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateBlueprintConstructionInput['blueprintConstruction']; const client = getClient(); - const result = await client.blueprintConstruction.create({ - data: { - blueprintId: cleanedData.blueprintId, - constructedAt: cleanedData.constructedAt, - constructedDefinition: cleanedData.constructedDefinition, - databaseId: cleanedData.databaseId, - errorDetails: cleanedData.errorDetails, - schemaId: cleanedData.schemaId, - status: cleanedData.status, - tableMap: cleanedData.tableMap - }, - select: { - blueprintId: true, - constructedAt: true, - constructedDefinition: true, - createdAt: true, - databaseId: true, - errorDetails: true, - id: true, - schemaId: true, - status: true, - tableMap: true, - updatedAt: true - } - }).execute(); + const result = await client.blueprintConstruction + .create({ + data: { + blueprintId: cleanedData.blueprintId, + constructedAt: cleanedData.constructedAt, + constructedDefinition: cleanedData.constructedDefinition, + databaseId: cleanedData.databaseId, + errorDetails: cleanedData.errorDetails, + schemaId: cleanedData.schemaId, + status: cleanedData.status, + tableMap: cleanedData.tableMap, + }, + select: { + blueprintId: true, + constructedAt: true, + constructedDefinition: true, + createdAt: true, + databaseId: true, + errorDetails: true, + id: true, + schemaId: true, + status: true, + tableMap: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,92 +286,104 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "blueprintId", - message: "blueprintId", - required: false - }, { - type: "text", - name: "constructedAt", - message: "constructedAt", - required: false, - skipPrompt: true - }, { - type: "json", - name: "constructedDefinition", - message: "constructedDefinition", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "errorDetails", - message: "errorDetails", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "json", - name: "tableMap", - message: "tableMap", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'blueprintId', + message: 'blueprintId', + required: false, + }, + { + type: 'text', + name: 'constructedAt', + message: 'constructedAt', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'constructedDefinition', + message: 'constructedDefinition', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'errorDetails', + message: 'errorDetails', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'tableMap', + message: 'tableMap', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as BlueprintConstructionPatch; const client = getClient(); - const result = await client.blueprintConstruction.update({ - where: { - id: answers.id as string - }, - data: { - blueprintId: cleanedData.blueprintId, - constructedAt: cleanedData.constructedAt, - constructedDefinition: cleanedData.constructedDefinition, - databaseId: cleanedData.databaseId, - errorDetails: cleanedData.errorDetails, - schemaId: cleanedData.schemaId, - status: cleanedData.status, - tableMap: cleanedData.tableMap - }, - select: { - blueprintId: true, - constructedAt: true, - constructedDefinition: true, - createdAt: true, - databaseId: true, - errorDetails: true, - id: true, - schemaId: true, - status: true, - tableMap: true, - updatedAt: true - } - }).execute(); + const result = await client.blueprintConstruction + .update({ + where: { + id: answers.id as string, + }, + data: { + blueprintId: cleanedData.blueprintId, + constructedAt: cleanedData.constructedAt, + constructedDefinition: cleanedData.constructedDefinition, + databaseId: cleanedData.databaseId, + errorDetails: cleanedData.errorDetails, + schemaId: cleanedData.schemaId, + status: cleanedData.status, + tableMap: cleanedData.tableMap, + }, + select: { + blueprintId: true, + constructedAt: true, + constructedDefinition: true, + createdAt: true, + databaseId: true, + errorDetails: true, + id: true, + schemaId: true, + status: true, + tableMap: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -336,28 +392,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.blueprintConstruction.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.blueprintConstruction + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/blueprint-template.ts b/sdk/constructive-cli/src/modules/cli/commands/blueprint-template.ts index 61d3ff4c23..260f807e98 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/blueprint-template.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/blueprint-template.ts @@ -3,68 +3,82 @@ * @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 { CreateBlueprintTemplateInput, BlueprintTemplatePatch, BlueprintTemplateSelect, BlueprintTemplateFilter, BlueprintTemplateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateBlueprintTemplateInput, + BlueprintTemplatePatch, + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - categories: "string", - complexity: "string", - copyCount: "int", - createdAt: "string", - definition: "json", - definitionHash: "uuid", - definitionSchemaVersion: "string", - description: "string", - displayName: "string", - forkCount: "int", - forkedFromId: "uuid", - id: "uuid", - name: "string", - ownerId: "uuid", - source: "string", - tableHashes: "json", - tags: "string", - updatedAt: "string", - version: "string", - visibility: "string" + categories: 'string', + complexity: 'string', + copyCount: 'int', + createdAt: 'string', + definition: 'json', + definitionHash: 'uuid', + definitionSchemaVersion: 'string', + description: 'string', + displayName: 'string', + forkCount: 'int', + forkedFromId: 'uuid', + id: 'uuid', + name: 'string', + ownerId: 'uuid', + source: 'string', + tableHashes: 'json', + tags: 'string', + updatedAt: 'string', + version: 'string', + visibility: 'string', }; -const usage = "\nblueprint-template \n\nCommands:\n list List blueprintTemplate records\n find-first Find first matching blueprintTemplate record\n get Get a blueprintTemplate by ID\n create Create a new blueprintTemplate\n update Update an existing blueprintTemplate\n delete Delete a blueprintTemplate\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) => { +const usage = + '\nblueprint-template \n\nCommands:\n list List blueprintTemplate records\n find-first Find first matching blueprintTemplate record\n get Get a blueprintTemplate by ID\n create Create a new blueprintTemplate\n update Update an existing blueprintTemplate\n delete Delete a blueprintTemplate\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,18 @@ async function handleList(argv: Partial>, _prompter: Inq tags: true, updatedAt: true, version: true, - visibility: true + visibility: true, }; - const findManyArgs = parseFindManyArgs & { - select: BlueprintTemplateSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: BlueprintTemplateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.blueprintTemplate.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +147,18 @@ async function handleFindFirst(argv: Partial>, _prompter tags: true, updatedAt: true, version: true, - visibility: true + visibility: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: BlueprintTemplateSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: BlueprintTemplateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.blueprintTemplate.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +167,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.blueprintTemplate.findOne({ - id: answers.id as string, - select: { - categories: true, - complexity: true, - copyCount: true, - createdAt: true, - definition: true, - definitionHash: true, - definitionSchemaVersion: true, - description: true, - displayName: true, - forkCount: true, - forkedFromId: true, - id: true, - name: true, - ownerId: true, - source: true, - tableHashes: true, - tags: true, - updatedAt: true, - version: true, - visibility: true - } - }).execute(); + const result = await client.blueprintTemplate + .findOne({ + id: answers.id as string, + select: { + categories: true, + complexity: true, + copyCount: true, + createdAt: true, + definition: true, + definitionHash: true, + definitionSchemaVersion: true, + description: true, + displayName: true, + forkCount: true, + forkedFromId: true, + id: true, + name: true, + ownerId: true, + source: true, + tableHashes: true, + tags: true, + updatedAt: true, + version: true, + visibility: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,154 +214,177 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "categories", - message: "categories", - required: false, - skipPrompt: true - }, { - type: "text", - name: "complexity", - message: "complexity", - required: false, - skipPrompt: true - }, { - type: "text", - name: "copyCount", - message: "copyCount", - required: false, - skipPrompt: true - }, { - type: "json", - name: "definition", - message: "definition", - required: true - }, { - type: "text", - name: "definitionHash", - message: "definitionHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionSchemaVersion", - message: "definitionSchemaVersion", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "displayName", - message: "displayName", - required: true - }, { - type: "text", - name: "forkCount", - message: "forkCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "forkedFromId", - message: "forkedFromId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: true - }, { - type: "text", - name: "source", - message: "source", - required: false, - skipPrompt: true - }, { - type: "json", - name: "tableHashes", - message: "tableHashes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "version", - message: "version", - required: false, - skipPrompt: true - }, { - type: "text", - name: "visibility", - message: "visibility", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'categories', + message: 'categories', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'complexity', + message: 'complexity', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'copyCount', + message: 'copyCount', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'definition', + message: 'definition', + required: true, + }, + { + type: 'text', + name: 'definitionHash', + message: 'definitionHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionSchemaVersion', + message: 'definitionSchemaVersion', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: true, + }, + { + type: 'text', + name: 'forkCount', + message: 'forkCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'forkedFromId', + message: 'forkedFromId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: true, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'tableHashes', + message: 'tableHashes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'version', + message: 'version', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'visibility', + message: 'visibility', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateBlueprintTemplateInput["blueprintTemplate"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateBlueprintTemplateInput['blueprintTemplate']; const client = getClient(); - const result = await client.blueprintTemplate.create({ - data: { - categories: cleanedData.categories, - complexity: cleanedData.complexity, - copyCount: cleanedData.copyCount, - definition: cleanedData.definition, - definitionHash: cleanedData.definitionHash, - definitionSchemaVersion: cleanedData.definitionSchemaVersion, - description: cleanedData.description, - displayName: cleanedData.displayName, - forkCount: cleanedData.forkCount, - forkedFromId: cleanedData.forkedFromId, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - source: cleanedData.source, - tableHashes: cleanedData.tableHashes, - tags: cleanedData.tags, - version: cleanedData.version, - visibility: cleanedData.visibility - }, - select: { - categories: true, - complexity: true, - copyCount: true, - createdAt: true, - definition: true, - definitionHash: true, - definitionSchemaVersion: true, - description: true, - displayName: true, - forkCount: true, - forkedFromId: true, - id: true, - name: true, - ownerId: true, - source: true, - tableHashes: true, - tags: true, - updatedAt: true, - version: true, - visibility: true - } - }).execute(); + const result = await client.blueprintTemplate + .create({ + data: { + categories: cleanedData.categories, + complexity: cleanedData.complexity, + copyCount: cleanedData.copyCount, + definition: cleanedData.definition, + definitionHash: cleanedData.definitionHash, + definitionSchemaVersion: cleanedData.definitionSchemaVersion, + description: cleanedData.description, + displayName: cleanedData.displayName, + forkCount: cleanedData.forkCount, + forkedFromId: cleanedData.forkedFromId, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + source: cleanedData.source, + tableHashes: cleanedData.tableHashes, + tags: cleanedData.tags, + version: cleanedData.version, + visibility: cleanedData.visibility, + }, + select: { + categories: true, + complexity: true, + copyCount: true, + createdAt: true, + definition: true, + definitionHash: true, + definitionSchemaVersion: true, + description: true, + displayName: true, + forkCount: true, + forkedFromId: true, + id: true, + name: true, + ownerId: true, + source: true, + tableHashes: true, + tags: true, + updatedAt: true, + version: true, + visibility: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -348,162 +393,183 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "categories", - message: "categories", - required: false, - skipPrompt: true - }, { - type: "text", - name: "complexity", - message: "complexity", - required: false, - skipPrompt: true - }, { - type: "text", - name: "copyCount", - message: "copyCount", - required: false, - skipPrompt: true - }, { - type: "json", - name: "definition", - message: "definition", - required: false - }, { - type: "text", - name: "definitionHash", - message: "definitionHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionSchemaVersion", - message: "definitionSchemaVersion", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "displayName", - message: "displayName", - required: false - }, { - type: "text", - name: "forkCount", - message: "forkCount", - required: false, - skipPrompt: true - }, { - type: "text", - name: "forkedFromId", - message: "forkedFromId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false - }, { - type: "text", - name: "source", - message: "source", - required: false, - skipPrompt: true - }, { - type: "json", - name: "tableHashes", - message: "tableHashes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tags", - message: "tags", - required: false, - skipPrompt: true - }, { - type: "text", - name: "version", - message: "version", - required: false, - skipPrompt: true - }, { - type: "text", - name: "visibility", - message: "visibility", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'categories', + message: 'categories', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'complexity', + message: 'complexity', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'copyCount', + message: 'copyCount', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'definition', + message: 'definition', + required: false, + }, + { + type: 'text', + name: 'definitionHash', + message: 'definitionHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionSchemaVersion', + message: 'definitionSchemaVersion', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: false, + }, + { + type: 'text', + name: 'forkCount', + message: 'forkCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'forkedFromId', + message: 'forkedFromId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + }, + { + type: 'text', + name: 'source', + message: 'source', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'tableHashes', + message: 'tableHashes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tags', + message: 'tags', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'version', + message: 'version', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'visibility', + message: 'visibility', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as BlueprintTemplatePatch; const client = getClient(); - const result = await client.blueprintTemplate.update({ - where: { - id: answers.id as string - }, - data: { - categories: cleanedData.categories, - complexity: cleanedData.complexity, - copyCount: cleanedData.copyCount, - definition: cleanedData.definition, - definitionHash: cleanedData.definitionHash, - definitionSchemaVersion: cleanedData.definitionSchemaVersion, - description: cleanedData.description, - displayName: cleanedData.displayName, - forkCount: cleanedData.forkCount, - forkedFromId: cleanedData.forkedFromId, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - source: cleanedData.source, - tableHashes: cleanedData.tableHashes, - tags: cleanedData.tags, - version: cleanedData.version, - visibility: cleanedData.visibility - }, - select: { - categories: true, - complexity: true, - copyCount: true, - createdAt: true, - definition: true, - definitionHash: true, - definitionSchemaVersion: true, - description: true, - displayName: true, - forkCount: true, - forkedFromId: true, - id: true, - name: true, - ownerId: true, - source: true, - tableHashes: true, - tags: true, - updatedAt: true, - version: true, - visibility: true - } - }).execute(); + const result = await client.blueprintTemplate + .update({ + where: { + id: answers.id as string, + }, + data: { + categories: cleanedData.categories, + complexity: cleanedData.complexity, + copyCount: cleanedData.copyCount, + definition: cleanedData.definition, + definitionHash: cleanedData.definitionHash, + definitionSchemaVersion: cleanedData.definitionSchemaVersion, + description: cleanedData.description, + displayName: cleanedData.displayName, + forkCount: cleanedData.forkCount, + forkedFromId: cleanedData.forkedFromId, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + source: cleanedData.source, + tableHashes: cleanedData.tableHashes, + tags: cleanedData.tags, + version: cleanedData.version, + visibility: cleanedData.visibility, + }, + select: { + categories: true, + complexity: true, + copyCount: true, + createdAt: true, + definition: true, + definitionHash: true, + definitionSchemaVersion: true, + description: true, + displayName: true, + forkCount: true, + forkedFromId: true, + id: true, + name: true, + ownerId: true, + source: true, + tableHashes: true, + tags: true, + updatedAt: true, + version: true, + visibility: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -512,28 +578,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.blueprintTemplate.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.blueprintTemplate + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/blueprint.ts b/sdk/constructive-cli/src/modules/cli/commands/blueprint.ts index 0d5af45837..fec2f29464 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/blueprint.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/blueprint.ts @@ -3,60 +3,74 @@ * @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 { CreateBlueprintInput, BlueprintPatch, BlueprintSelect, BlueprintFilter, BlueprintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateBlueprintInput, + BlueprintPatch, + BlueprintSelect, + BlueprintFilter, + BlueprintOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - definition: "json", - definitionHash: "uuid", - description: "string", - displayName: "string", - id: "uuid", - name: "string", - ownerId: "uuid", - tableHashes: "json", - templateId: "uuid", - updatedAt: "string" + createdAt: 'string', + databaseId: 'uuid', + definition: 'json', + definitionHash: 'uuid', + description: 'string', + displayName: 'string', + id: 'uuid', + name: 'string', + ownerId: 'uuid', + tableHashes: 'json', + templateId: 'uuid', + updatedAt: 'string', }; -const usage = "\nblueprint \n\nCommands:\n list List blueprint records\n find-first Find first matching blueprint record\n get Get a blueprint by ID\n create Create a new blueprint\n update Update an existing blueprint\n delete Delete a blueprint\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) => { +const usage = + '\nblueprint \n\nCommands:\n list List blueprint records\n find-first Find first matching blueprint record\n get Get a blueprint by ID\n create Create a new blueprint\n update Update an existing blueprint\n delete Delete a blueprint\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,18 @@ async function handleList(argv: Partial>, _prompter: Inq ownerId: true, tableHashes: true, templateId: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: BlueprintSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: BlueprintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.blueprint.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +123,18 @@ async function handleFindFirst(argv: Partial>, _prompter ownerId: true, tableHashes: true, templateId: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: BlueprintSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: BlueprintSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.blueprint.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +143,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.blueprint.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - definition: true, - definitionHash: true, - description: true, - displayName: true, - id: true, - name: true, - ownerId: true, - tableHashes: true, - templateId: true, - updatedAt: true - } - }).execute(); + const result = await client.blueprint + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + definition: true, + definitionHash: true, + description: true, + displayName: true, + id: true, + name: true, + ownerId: true, + tableHashes: true, + templateId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,89 +182,101 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "json", - name: "definition", - message: "definition", - required: true - }, { - type: "text", - name: "definitionHash", - message: "definitionHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "displayName", - message: "displayName", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: true - }, { - type: "json", - name: "tableHashes", - message: "tableHashes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "templateId", - message: "templateId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'json', + name: 'definition', + message: 'definition', + required: true, + }, + { + type: 'text', + name: 'definitionHash', + message: 'definitionHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: true, + }, + { + type: 'json', + name: 'tableHashes', + message: 'tableHashes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'templateId', + message: 'templateId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateBlueprintInput["blueprint"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateBlueprintInput['blueprint']; const client = getClient(); - const result = await client.blueprint.create({ - data: { - databaseId: cleanedData.databaseId, - definition: cleanedData.definition, - definitionHash: cleanedData.definitionHash, - description: cleanedData.description, - displayName: cleanedData.displayName, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - tableHashes: cleanedData.tableHashes, - templateId: cleanedData.templateId - }, - select: { - createdAt: true, - databaseId: true, - definition: true, - definitionHash: true, - description: true, - displayName: true, - id: true, - name: true, - ownerId: true, - tableHashes: true, - templateId: true, - updatedAt: true - } - }).execute(); + const result = await client.blueprint + .create({ + data: { + databaseId: cleanedData.databaseId, + definition: cleanedData.definition, + definitionHash: cleanedData.definitionHash, + description: cleanedData.description, + displayName: cleanedData.displayName, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + tableHashes: cleanedData.tableHashes, + templateId: cleanedData.templateId, + }, + select: { + createdAt: true, + databaseId: true, + definition: true, + definitionHash: true, + description: true, + displayName: true, + id: true, + name: true, + ownerId: true, + tableHashes: true, + templateId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -251,97 +285,110 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "json", - name: "definition", - message: "definition", - required: false - }, { - type: "text", - name: "definitionHash", - message: "definitionHash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "text", - name: "displayName", - message: "displayName", - required: false - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false - }, { - type: "json", - name: "tableHashes", - message: "tableHashes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "templateId", - message: "templateId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'json', + name: 'definition', + message: 'definition', + required: false, + }, + { + type: 'text', + name: 'definitionHash', + message: 'definitionHash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'displayName', + message: 'displayName', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + }, + { + type: 'json', + name: 'tableHashes', + message: 'tableHashes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'templateId', + message: 'templateId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as BlueprintPatch; const client = getClient(); - const result = await client.blueprint.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - definition: cleanedData.definition, - definitionHash: cleanedData.definitionHash, - description: cleanedData.description, - displayName: cleanedData.displayName, - name: cleanedData.name, - ownerId: cleanedData.ownerId, - tableHashes: cleanedData.tableHashes, - templateId: cleanedData.templateId - }, - select: { - createdAt: true, - databaseId: true, - definition: true, - definitionHash: true, - description: true, - displayName: true, - id: true, - name: true, - ownerId: true, - tableHashes: true, - templateId: true, - updatedAt: true - } - }).execute(); + const result = await client.blueprint + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + definition: cleanedData.definition, + definitionHash: cleanedData.definitionHash, + description: cleanedData.description, + displayName: cleanedData.displayName, + name: cleanedData.name, + ownerId: cleanedData.ownerId, + tableHashes: cleanedData.tableHashes, + templateId: cleanedData.templateId, + }, + select: { + createdAt: true, + databaseId: true, + definition: true, + definitionHash: true, + description: true, + displayName: true, + id: true, + name: true, + ownerId: true, + tableHashes: true, + templateId: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -350,28 +397,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.blueprint.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.blueprint + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/catalog-module.ts b/sdk/constructive-cli/src/modules/cli/commands/catalog-module.ts index 643b1c6fd7..a0b1dc936d 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/catalog-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/catalog-module.ts @@ -3,77 +3,91 @@ * @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 { CreateCatalogModuleInput, CatalogModulePatch, CatalogModuleSelect, CatalogModuleFilter, CatalogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateCatalogModuleInput, + CatalogModulePatch, + CatalogModuleSelect, + CatalogModuleFilter, + CatalogModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - apisTableId: "uuid", - apisTableName: "string", - appsTableId: "uuid", - appsTableName: "string", - databaseId: "uuid", - defaultPermissions: "string", - domainsTableId: "uuid", - domainsTableName: "string", - entityTableId: "uuid", - functionsTableId: "uuid", - functionsTableName: "string", - id: "uuid", - namespacesTableId: "uuid", - namespacesTableName: "string", - policies: "json", - privateApiName: "string", - provisions: "json", - publicSchemaName: "string", - resourceDefinitionsTableId: "uuid", - resourceDefinitionsTableName: "string", - resourceInstallationsTableId: "uuid", - resourceInstallationsTableName: "string", - resourcesTableId: "uuid", - resourcesTableName: "string", - schemaId: "uuid", - scope: "string", - sitesTableId: "uuid", - sitesTableName: "string" + apiName: 'string', + apisTableId: 'uuid', + apisTableName: 'string', + appsTableId: 'uuid', + appsTableName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + domainsTableId: 'uuid', + domainsTableName: 'string', + entityTableId: 'uuid', + functionsTableId: 'uuid', + functionsTableName: 'string', + id: 'uuid', + namespacesTableId: 'uuid', + namespacesTableName: 'string', + policies: 'json', + privateApiName: 'string', + provisions: 'json', + publicSchemaName: 'string', + resourceDefinitionsTableId: 'uuid', + resourceDefinitionsTableName: 'string', + resourceInstallationsTableId: 'uuid', + resourceInstallationsTableName: 'string', + resourcesTableId: 'uuid', + resourcesTableName: 'string', + schemaId: 'uuid', + scope: 'string', + sitesTableId: 'uuid', + sitesTableName: 'string', }; -const usage = "\ncatalog-module \n\nCommands:\n list List catalogModule records\n find-first Find first matching catalogModule record\n get Get a catalogModule by ID\n create Create a new catalogModule\n update Update an existing catalogModule\n delete Delete a catalogModule\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) => { +const usage = + '\ncatalog-module \n\nCommands:\n list List catalogModule records\n find-first Find first matching catalogModule record\n get Get a catalogModule by ID\n create Create a new catalogModule\n update Update an existing catalogModule\n delete Delete a catalogModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -111,16 +125,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, sitesTableId: true, - sitesTableName: true + sitesTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: CatalogModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: CatalogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.catalogModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -158,16 +174,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, sitesTableId: true, - sitesTableName: true + sitesTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: CatalogModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: CatalogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.catalogModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -176,50 +194,54 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.catalogModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - apisTableId: true, - apisTableName: true, - appsTableId: true, - appsTableName: true, - databaseId: true, - defaultPermissions: true, - domainsTableId: true, - domainsTableName: true, - entityTableId: true, - functionsTableId: true, - functionsTableName: true, - id: true, - namespacesTableId: true, - namespacesTableName: true, - policies: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - resourceDefinitionsTableId: true, - resourceDefinitionsTableName: true, - resourceInstallationsTableId: true, - resourceInstallationsTableName: true, - resourcesTableId: true, - resourcesTableName: true, - schemaId: true, - scope: true, - sitesTableId: true, - sitesTableName: true - } - }).execute(); + const result = await client.catalogModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + apisTableId: true, + apisTableName: true, + appsTableId: true, + appsTableName: true, + databaseId: true, + defaultPermissions: true, + domainsTableId: true, + domainsTableName: true, + entityTableId: true, + functionsTableId: true, + functionsTableName: true, + id: true, + namespacesTableId: true, + namespacesTableName: true, + policies: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + resourceDefinitionsTableId: true, + resourceDefinitionsTableName: true, + resourceInstallationsTableId: true, + resourceInstallationsTableName: true, + resourcesTableId: true, + resourcesTableName: true, + schemaId: true, + scope: true, + sitesTableId: true, + sitesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -228,242 +250,276 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apisTableId", - message: "apisTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apisTableName", - message: "apisTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appsTableId", - message: "appsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appsTableName", - message: "appsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainsTableId", - message: "domainsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainsTableName", - message: "domainsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionsTableId", - message: "functionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionsTableName", - message: "functionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespacesTableId", - message: "namespacesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespacesTableName", - message: "namespacesTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionsTableId", - message: "resourceDefinitionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionsTableName", - message: "resourceDefinitionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceInstallationsTableId", - message: "resourceInstallationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceInstallationsTableName", - message: "resourceInstallationsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourcesTableId", - message: "resourcesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourcesTableName", - message: "resourcesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "sitesTableId", - message: "sitesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sitesTableName", - message: "sitesTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apisTableId', + message: 'apisTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apisTableName', + message: 'apisTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appsTableId', + message: 'appsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appsTableName', + message: 'appsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainsTableId', + message: 'domainsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainsTableName', + message: 'domainsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionsTableId', + message: 'functionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionsTableName', + message: 'functionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespacesTableId', + message: 'namespacesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespacesTableName', + message: 'namespacesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionsTableId', + message: 'resourceDefinitionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionsTableName', + message: 'resourceDefinitionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceInstallationsTableId', + message: 'resourceInstallationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceInstallationsTableName', + message: 'resourceInstallationsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourcesTableId', + message: 'resourcesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourcesTableName', + message: 'resourcesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'sitesTableId', + message: 'sitesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sitesTableName', + message: 'sitesTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateCatalogModuleInput["catalogModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateCatalogModuleInput['catalogModule']; const client = getClient(); - const result = await client.catalogModule.create({ - data: { - apiName: cleanedData.apiName, - apisTableId: cleanedData.apisTableId, - apisTableName: cleanedData.apisTableName, - appsTableId: cleanedData.appsTableId, - appsTableName: cleanedData.appsTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - domainsTableId: cleanedData.domainsTableId, - domainsTableName: cleanedData.domainsTableName, - entityTableId: cleanedData.entityTableId, - functionsTableId: cleanedData.functionsTableId, - functionsTableName: cleanedData.functionsTableName, - namespacesTableId: cleanedData.namespacesTableId, - namespacesTableName: cleanedData.namespacesTableName, - policies: cleanedData.policies, - privateApiName: cleanedData.privateApiName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - resourceDefinitionsTableId: cleanedData.resourceDefinitionsTableId, - resourceDefinitionsTableName: cleanedData.resourceDefinitionsTableName, - resourceInstallationsTableId: cleanedData.resourceInstallationsTableId, - resourceInstallationsTableName: cleanedData.resourceInstallationsTableName, - resourcesTableId: cleanedData.resourcesTableId, - resourcesTableName: cleanedData.resourcesTableName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - sitesTableId: cleanedData.sitesTableId, - sitesTableName: cleanedData.sitesTableName - }, - select: { - apiName: true, - apisTableId: true, - apisTableName: true, - appsTableId: true, - appsTableName: true, - databaseId: true, - defaultPermissions: true, - domainsTableId: true, - domainsTableName: true, - entityTableId: true, - functionsTableId: true, - functionsTableName: true, - id: true, - namespacesTableId: true, - namespacesTableName: true, - policies: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - resourceDefinitionsTableId: true, - resourceDefinitionsTableName: true, - resourceInstallationsTableId: true, - resourceInstallationsTableName: true, - resourcesTableId: true, - resourcesTableName: true, - schemaId: true, - scope: true, - sitesTableId: true, - sitesTableName: true - } - }).execute(); + const result = await client.catalogModule + .create({ + data: { + apiName: cleanedData.apiName, + apisTableId: cleanedData.apisTableId, + apisTableName: cleanedData.apisTableName, + appsTableId: cleanedData.appsTableId, + appsTableName: cleanedData.appsTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + domainsTableId: cleanedData.domainsTableId, + domainsTableName: cleanedData.domainsTableName, + entityTableId: cleanedData.entityTableId, + functionsTableId: cleanedData.functionsTableId, + functionsTableName: cleanedData.functionsTableName, + namespacesTableId: cleanedData.namespacesTableId, + namespacesTableName: cleanedData.namespacesTableName, + policies: cleanedData.policies, + privateApiName: cleanedData.privateApiName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + resourceDefinitionsTableId: cleanedData.resourceDefinitionsTableId, + resourceDefinitionsTableName: cleanedData.resourceDefinitionsTableName, + resourceInstallationsTableId: cleanedData.resourceInstallationsTableId, + resourceInstallationsTableName: cleanedData.resourceInstallationsTableName, + resourcesTableId: cleanedData.resourcesTableId, + resourcesTableName: cleanedData.resourcesTableName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + sitesTableId: cleanedData.sitesTableId, + sitesTableName: cleanedData.sitesTableName, + }, + select: { + apiName: true, + apisTableId: true, + apisTableName: true, + appsTableId: true, + appsTableName: true, + databaseId: true, + defaultPermissions: true, + domainsTableId: true, + domainsTableName: true, + entityTableId: true, + functionsTableId: true, + functionsTableName: true, + id: true, + namespacesTableId: true, + namespacesTableName: true, + policies: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + resourceDefinitionsTableId: true, + resourceDefinitionsTableName: true, + resourceInstallationsTableId: true, + resourceInstallationsTableName: true, + resourcesTableId: true, + resourcesTableName: true, + schemaId: true, + scope: true, + sitesTableId: true, + sitesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -472,250 +528,282 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apisTableId", - message: "apisTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apisTableName", - message: "apisTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appsTableId", - message: "appsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "appsTableName", - message: "appsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainsTableId", - message: "domainsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainsTableName", - message: "domainsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionsTableId", - message: "functionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionsTableName", - message: "functionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespacesTableId", - message: "namespacesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespacesTableName", - message: "namespacesTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionsTableId", - message: "resourceDefinitionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionsTableName", - message: "resourceDefinitionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceInstallationsTableId", - message: "resourceInstallationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceInstallationsTableName", - message: "resourceInstallationsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourcesTableId", - message: "resourcesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourcesTableName", - message: "resourcesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "sitesTableId", - message: "sitesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sitesTableName", - message: "sitesTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apisTableId', + message: 'apisTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apisTableName', + message: 'apisTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appsTableId', + message: 'appsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'appsTableName', + message: 'appsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainsTableId', + message: 'domainsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainsTableName', + message: 'domainsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionsTableId', + message: 'functionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionsTableName', + message: 'functionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespacesTableId', + message: 'namespacesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespacesTableName', + message: 'namespacesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionsTableId', + message: 'resourceDefinitionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionsTableName', + message: 'resourceDefinitionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceInstallationsTableId', + message: 'resourceInstallationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceInstallationsTableName', + message: 'resourceInstallationsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourcesTableId', + message: 'resourcesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourcesTableName', + message: 'resourcesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'sitesTableId', + message: 'sitesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sitesTableName', + message: 'sitesTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CatalogModulePatch; const client = getClient(); - const result = await client.catalogModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - apisTableId: cleanedData.apisTableId, - apisTableName: cleanedData.apisTableName, - appsTableId: cleanedData.appsTableId, - appsTableName: cleanedData.appsTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - domainsTableId: cleanedData.domainsTableId, - domainsTableName: cleanedData.domainsTableName, - entityTableId: cleanedData.entityTableId, - functionsTableId: cleanedData.functionsTableId, - functionsTableName: cleanedData.functionsTableName, - namespacesTableId: cleanedData.namespacesTableId, - namespacesTableName: cleanedData.namespacesTableName, - policies: cleanedData.policies, - privateApiName: cleanedData.privateApiName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - resourceDefinitionsTableId: cleanedData.resourceDefinitionsTableId, - resourceDefinitionsTableName: cleanedData.resourceDefinitionsTableName, - resourceInstallationsTableId: cleanedData.resourceInstallationsTableId, - resourceInstallationsTableName: cleanedData.resourceInstallationsTableName, - resourcesTableId: cleanedData.resourcesTableId, - resourcesTableName: cleanedData.resourcesTableName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - sitesTableId: cleanedData.sitesTableId, - sitesTableName: cleanedData.sitesTableName - }, - select: { - apiName: true, - apisTableId: true, - apisTableName: true, - appsTableId: true, - appsTableName: true, - databaseId: true, - defaultPermissions: true, - domainsTableId: true, - domainsTableName: true, - entityTableId: true, - functionsTableId: true, - functionsTableName: true, - id: true, - namespacesTableId: true, - namespacesTableName: true, - policies: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - resourceDefinitionsTableId: true, - resourceDefinitionsTableName: true, - resourceInstallationsTableId: true, - resourceInstallationsTableName: true, - resourcesTableId: true, - resourcesTableName: true, - schemaId: true, - scope: true, - sitesTableId: true, - sitesTableName: true - } - }).execute(); + const result = await client.catalogModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + apisTableId: cleanedData.apisTableId, + apisTableName: cleanedData.apisTableName, + appsTableId: cleanedData.appsTableId, + appsTableName: cleanedData.appsTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + domainsTableId: cleanedData.domainsTableId, + domainsTableName: cleanedData.domainsTableName, + entityTableId: cleanedData.entityTableId, + functionsTableId: cleanedData.functionsTableId, + functionsTableName: cleanedData.functionsTableName, + namespacesTableId: cleanedData.namespacesTableId, + namespacesTableName: cleanedData.namespacesTableName, + policies: cleanedData.policies, + privateApiName: cleanedData.privateApiName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + resourceDefinitionsTableId: cleanedData.resourceDefinitionsTableId, + resourceDefinitionsTableName: cleanedData.resourceDefinitionsTableName, + resourceInstallationsTableId: cleanedData.resourceInstallationsTableId, + resourceInstallationsTableName: cleanedData.resourceInstallationsTableName, + resourcesTableId: cleanedData.resourcesTableId, + resourcesTableName: cleanedData.resourcesTableName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + sitesTableId: cleanedData.sitesTableId, + sitesTableName: cleanedData.sitesTableName, + }, + select: { + apiName: true, + apisTableId: true, + apisTableName: true, + appsTableId: true, + appsTableName: true, + databaseId: true, + defaultPermissions: true, + domainsTableId: true, + domainsTableName: true, + entityTableId: true, + functionsTableId: true, + functionsTableName: true, + id: true, + namespacesTableId: true, + namespacesTableName: true, + policies: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + resourceDefinitionsTableId: true, + resourceDefinitionsTableName: true, + resourceInstallationsTableId: true, + resourceInstallationsTableName: true, + resourcesTableId: true, + resourcesTableName: true, + schemaId: true, + scope: true, + sitesTableId: true, + sitesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -724,28 +812,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.catalogModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.catalogModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/compute-log-module.ts b/sdk/constructive-cli/src/modules/cli/commands/compute-log-module.ts index 7d6205727c..1c2d154fd0 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/compute-log-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/compute-log-module.ts @@ -3,68 +3,82 @@ * @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 { CreateComputeLogModuleInput, ComputeLogModulePatch, ComputeLogModuleSelect, ComputeLogModuleFilter, ComputeLogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateComputeLogModuleInput, + ComputeLogModulePatch, + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorFkTableId: "uuid", - apiName: "string", - computeLogTableId: "uuid", - computeLogTableName: "string", - databaseId: "uuid", - entityField: "string", - entityFkTableId: "uuid", - id: "uuid", - interval: "string", - prefix: "string", - premake: "int", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - retention: "string", - schemaId: "uuid", - scope: "string", - usageSummaryTableId: "uuid", - usageSummaryTableName: "string" + actorFkTableId: 'uuid', + apiName: 'string', + computeLogTableId: 'uuid', + computeLogTableName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityFkTableId: 'uuid', + id: 'uuid', + interval: 'string', + prefix: 'string', + premake: 'int', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + retention: 'string', + schemaId: 'uuid', + scope: 'string', + usageSummaryTableId: 'uuid', + usageSummaryTableName: 'string', }; -const usage = "\ncompute-log-module \n\nCommands:\n list List computeLogModule records\n find-first Find first matching computeLogModule record\n get Get a computeLogModule by ID\n create Create a new computeLogModule\n update Update an existing computeLogModule\n delete Delete a computeLogModule\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) => { +const usage = + '\ncompute-log-module \n\nCommands:\n list List computeLogModule records\n find-first Find first matching computeLogModule record\n get Get a computeLogModule by ID\n create Create a new computeLogModule\n update Update an existing computeLogModule\n delete Delete a computeLogModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, usageSummaryTableId: true, - usageSummaryTableName: true + usageSummaryTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: ComputeLogModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ComputeLogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.computeLogModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +147,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, usageSummaryTableId: true, - usageSummaryTableName: true + usageSummaryTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ComputeLogModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ComputeLogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.computeLogModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +167,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.computeLogModule.findOne({ - id: answers.id as string, - select: { - actorFkTableId: true, - apiName: true, - computeLogTableId: true, - computeLogTableName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.computeLogModule + .findOne({ + id: answers.id as string, + select: { + actorFkTableId: true, + apiName: true, + computeLogTableId: true, + computeLogTableName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,170 +214,195 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorFkTableId", - message: "actorFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "computeLogTableId", - message: "computeLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "computeLogTableName", - message: "computeLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityFkTableId", - message: "entityFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "usageSummaryTableId", - message: "usageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableName", - message: "usageSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorFkTableId', + message: 'actorFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'computeLogTableId', + message: 'computeLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'computeLogTableName', + message: 'computeLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityFkTableId', + message: 'entityFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'usageSummaryTableId', + message: 'usageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableName', + message: 'usageSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateComputeLogModuleInput["computeLogModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateComputeLogModuleInput['computeLogModule']; const client = getClient(); - const result = await client.computeLogModule.create({ - data: { - actorFkTableId: cleanedData.actorFkTableId, - apiName: cleanedData.apiName, - computeLogTableId: cleanedData.computeLogTableId, - computeLogTableName: cleanedData.computeLogTableName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityFkTableId: cleanedData.entityFkTableId, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - usageSummaryTableId: cleanedData.usageSummaryTableId, - usageSummaryTableName: cleanedData.usageSummaryTableName - }, - select: { - actorFkTableId: true, - apiName: true, - computeLogTableId: true, - computeLogTableName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.computeLogModule + .create({ + data: { + actorFkTableId: cleanedData.actorFkTableId, + apiName: cleanedData.apiName, + computeLogTableId: cleanedData.computeLogTableId, + computeLogTableName: cleanedData.computeLogTableName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityFkTableId: cleanedData.entityFkTableId, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + usageSummaryTableId: cleanedData.usageSummaryTableId, + usageSummaryTableName: cleanedData.usageSummaryTableName, + }, + select: { + actorFkTableId: true, + apiName: true, + computeLogTableId: true, + computeLogTableName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -364,178 +411,201 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorFkTableId", - message: "actorFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "computeLogTableId", - message: "computeLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "computeLogTableName", - message: "computeLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityFkTableId", - message: "entityFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "usageSummaryTableId", - message: "usageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableName", - message: "usageSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorFkTableId', + message: 'actorFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'computeLogTableId', + message: 'computeLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'computeLogTableName', + message: 'computeLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityFkTableId', + message: 'entityFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'usageSummaryTableId', + message: 'usageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableName', + message: 'usageSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ComputeLogModulePatch; const client = getClient(); - const result = await client.computeLogModule.update({ - where: { - id: answers.id as string - }, - data: { - actorFkTableId: cleanedData.actorFkTableId, - apiName: cleanedData.apiName, - computeLogTableId: cleanedData.computeLogTableId, - computeLogTableName: cleanedData.computeLogTableName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityFkTableId: cleanedData.entityFkTableId, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - usageSummaryTableId: cleanedData.usageSummaryTableId, - usageSummaryTableName: cleanedData.usageSummaryTableName - }, - select: { - actorFkTableId: true, - apiName: true, - computeLogTableId: true, - computeLogTableName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.computeLogModule + .update({ + where: { + id: answers.id as string, + }, + data: { + actorFkTableId: cleanedData.actorFkTableId, + apiName: cleanedData.apiName, + computeLogTableId: cleanedData.computeLogTableId, + computeLogTableName: cleanedData.computeLogTableName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityFkTableId: cleanedData.entityFkTableId, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + usageSummaryTableId: cleanedData.usageSummaryTableId, + usageSummaryTableName: cleanedData.usageSummaryTableName, + }, + select: { + actorFkTableId: true, + apiName: true, + computeLogTableId: true, + computeLogTableName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -544,28 +614,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.computeLogModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.computeLogModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/config-secrets-user-module.ts b/sdk/constructive-cli/src/modules/cli/commands/config-secrets-user-module.ts index d8963cb3e2..df4579c934 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/config-secrets-user-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/config-secrets-user-module.ts @@ -3,56 +3,70 @@ * @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 { CreateConfigSecretsUserModuleInput, ConfigSecretsUserModulePatch, ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleFilter, ConfigSecretsUserModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateConfigSecretsUserModuleInput, + ConfigSecretsUserModulePatch, + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - entityField: "string", - id: "uuid", - privateApiName: "string", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + id: 'uuid', + privateApiName: 'string', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nconfig-secrets-user-module \n\nCommands:\n list List configSecretsUserModule records\n find-first Find first matching configSecretsUserModule record\n get Get a configSecretsUserModule by ID\n create Create a new configSecretsUserModule\n update Update an existing configSecretsUserModule\n delete Delete a configSecretsUserModule\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) => { +const usage = + '\nconfig-secrets-user-module \n\nCommands:\n list List configSecretsUserModule records\n find-first Find first matching configSecretsUserModule record\n get Get a configSecretsUserModule by ID\n create Create a new configSecretsUserModule\n update Update an existing configSecretsUserModule\n delete Delete a configSecretsUserModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -69,16 +83,22 @@ async function handleList(argv: Partial>, _prompter: Inq privateApiName: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: ConfigSecretsUserModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy + > & { + select: ConfigSecretsUserModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.configSecretsUserModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -95,16 +115,22 @@ async function handleFindFirst(argv: Partial>, _prompter privateApiName: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ConfigSecretsUserModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy + > & { + select: ConfigSecretsUserModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.configSecretsUserModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -113,29 +139,33 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.configSecretsUserModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - entityField: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.configSecretsUserModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + entityField: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -144,75 +174,88 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateConfigSecretsUserModuleInput["configSecretsUserModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateConfigSecretsUserModuleInput['configSecretsUserModule']; const client = getClient(); - const result = await client.configSecretsUserModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - privateApiName: cleanedData.privateApiName, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.configSecretsUserModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + privateApiName: cleanedData.privateApiName, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -221,83 +264,94 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ConfigSecretsUserModulePatch; const client = getClient(); - const result = await client.configSecretsUserModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - privateApiName: cleanedData.privateApiName, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.configSecretsUserModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + privateApiName: cleanedData.privateApiName, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -306,28 +360,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.configSecretsUserModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.configSecretsUserModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/connected-accounts-module.ts b/sdk/constructive-cli/src/modules/cli/commands/connected-accounts-module.ts index f1dbee57a6..13d076cd62 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/connected-accounts-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/connected-accounts-module.ts @@ -3,57 +3,71 @@ * @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 { CreateConnectedAccountsModuleInput, ConnectedAccountsModulePatch, ConnectedAccountsModuleSelect, ConnectedAccountsModuleFilter, ConnectedAccountsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateConnectedAccountsModuleInput, + ConnectedAccountsModulePatch, + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - id: "uuid", - ownerTableId: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + apiName: 'string', + databaseId: 'uuid', + id: 'uuid', + ownerTableId: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nconnected-accounts-module \n\nCommands:\n list List connectedAccountsModule records\n find-first Find first matching connectedAccountsModule record\n get Get a connectedAccountsModule by ID\n create Create a new connectedAccountsModule\n update Update an existing connectedAccountsModule\n delete Delete a connectedAccountsModule\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) => { +const usage = + '\nconnected-accounts-module \n\nCommands:\n list List connectedAccountsModule records\n find-first Find first matching connectedAccountsModule record\n get Get a connectedAccountsModule by ID\n create Create a new connectedAccountsModule\n update Update an existing connectedAccountsModule\n delete Delete a connectedAccountsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: ConnectedAccountsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy + > & { + select: ConnectedAccountsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.connectedAccountsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ConnectedAccountsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy + > & { + select: ConnectedAccountsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.connectedAccountsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.connectedAccountsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.connectedAccountsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +178,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateConnectedAccountsModuleInput["connectedAccountsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateConnectedAccountsModuleInput['connectedAccountsModule']; const client = getClient(); - const result = await client.connectedAccountsModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.connectedAccountsModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +276,102 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ConnectedAccountsModulePatch; const client = getClient(); - const result = await client.connectedAccountsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.connectedAccountsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,28 +380,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.connectedAccountsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.connectedAccountsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/construct-blueprint.ts b/sdk/constructive-cli/src/modules/cli/commands/construct-blueprint.ts index 0d514346bb..651649b14a 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/construct-blueprint.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/construct-blueprint.ts @@ -3,37 +3,51 @@ * @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 { ConstructBlueprintVariables } from "../../orm/mutation"; -import type { ConstructBlueprintPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ConstructBlueprintVariables } from '../../orm/mutation'; +import type { ConstructBlueprintPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: construct-blueprint [OPTIONS]\n"); + console.log( + "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\nUsage: construct-blueprint [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 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.constructBlueprint(parsedAnswers as unknown as ConstructBlueprintVariables, { - select: selectFields - } as unknown as { - select: ConstructBlueprintPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .constructBlueprint( + parsedAnswers as unknown as ConstructBlueprintVariables, + { + select: selectFields, + } as unknown as { + select: ConstructBlueprintPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: constructBlueprint"); + console.error('Failed: constructBlueprint'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/context.ts b/sdk/constructive-cli/src/modules/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/context.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/copy-template-to-blueprint.ts b/sdk/constructive-cli/src/modules/cli/commands/copy-template-to-blueprint.ts index 8834a2851a..4630d21558 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/copy-template-to-blueprint.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/copy-template-to-blueprint.ts @@ -3,37 +3,51 @@ * @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 { CopyTemplateToBlueprintVariables } from "../../orm/mutation"; -import type { CopyTemplateToBlueprintPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { CopyTemplateToBlueprintVariables } from '../../orm/mutation'; +import type { CopyTemplateToBlueprintPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: copy-template-to-blueprint [OPTIONS]\n"); + console.log( + '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\nUsage: copy-template-to-blueprint [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 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.copyTemplateToBlueprint(parsedAnswers as unknown as CopyTemplateToBlueprintVariables, { - select: selectFields - } as unknown as { - select: CopyTemplateToBlueprintPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .copyTemplateToBlueprint( + parsedAnswers as unknown as CopyTemplateToBlueprintVariables, + { + select: selectFields, + } as unknown as { + select: CopyTemplateToBlueprintPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: copyTemplateToBlueprint"); + console.error('Failed: copyTemplateToBlueprint'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/crypto-addresses-module.ts b/sdk/constructive-cli/src/modules/cli/commands/crypto-addresses-module.ts index 9a54deb1fa..96f09ec4f6 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/crypto-addresses-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/crypto-addresses-module.ts @@ -3,58 +3,72 @@ * @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 { CreateCryptoAddressesModuleInput, CryptoAddressesModulePatch, CryptoAddressesModuleSelect, CryptoAddressesModuleFilter, CryptoAddressesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateCryptoAddressesModuleInput, + CryptoAddressesModulePatch, + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - cryptoNetwork: "string", - databaseId: "uuid", - id: "uuid", - ownerTableId: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + apiName: 'string', + cryptoNetwork: 'string', + databaseId: 'uuid', + id: 'uuid', + ownerTableId: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\ncrypto-addresses-module \n\nCommands:\n list List cryptoAddressesModule records\n find-first Find first matching cryptoAddressesModule record\n get Get a cryptoAddressesModule by ID\n create Create a new cryptoAddressesModule\n update Update an existing cryptoAddressesModule\n delete Delete a cryptoAddressesModule\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) => { +const usage = + '\ncrypto-addresses-module \n\nCommands:\n list List cryptoAddressesModule records\n find-first Find first matching cryptoAddressesModule record\n get Get a cryptoAddressesModule by ID\n create Create a new cryptoAddressesModule\n update Update an existing cryptoAddressesModule\n delete Delete a cryptoAddressesModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,22 @@ async function handleList(argv: Partial>, _prompter: Inq privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: CryptoAddressesModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy + > & { + select: CryptoAddressesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.cryptoAddressesModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +121,22 @@ async function handleFindFirst(argv: Partial>, _prompter privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: CryptoAddressesModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy + > & { + select: CryptoAddressesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.cryptoAddressesModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +145,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.cryptoAddressesModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - cryptoNetwork: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.cryptoAddressesModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + cryptoNetwork: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,90 +182,105 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "cryptoNetwork", - message: "cryptoNetwork", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'cryptoNetwork', + message: 'cryptoNetwork', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateCryptoAddressesModuleInput["cryptoAddressesModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateCryptoAddressesModuleInput['cryptoAddressesModule']; const client = getClient(); - const result = await client.cryptoAddressesModule.create({ - data: { - apiName: cleanedData.apiName, - cryptoNetwork: cleanedData.cryptoNetwork, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - cryptoNetwork: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.cryptoAddressesModule + .create({ + data: { + apiName: cleanedData.apiName, + cryptoNetwork: cleanedData.cryptoNetwork, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + cryptoNetwork: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -244,98 +289,111 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "cryptoNetwork", - message: "cryptoNetwork", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'cryptoNetwork', + message: 'cryptoNetwork', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CryptoAddressesModulePatch; const client = getClient(); - const result = await client.cryptoAddressesModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - cryptoNetwork: cleanedData.cryptoNetwork, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - cryptoNetwork: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.cryptoAddressesModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + cryptoNetwork: cleanedData.cryptoNetwork, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + cryptoNetwork: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -344,28 +402,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.cryptoAddressesModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.cryptoAddressesModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/crypto-auth-module.ts b/sdk/constructive-cli/src/modules/cli/commands/crypto-auth-module.ts index 43974b7a63..7ee0458f89 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/crypto-auth-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/crypto-auth-module.ts @@ -3,62 +3,76 @@ * @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 { CreateCryptoAuthModuleInput, CryptoAuthModulePatch, CryptoAuthModuleSelect, CryptoAuthModuleFilter, CryptoAuthModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateCryptoAuthModuleInput, + CryptoAuthModulePatch, + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - addressesTableId: "uuid", - cryptoNetwork: "string", - databaseId: "uuid", - id: "uuid", - schemaId: "uuid", - secretsTableId: "uuid", - sessionCredentialsTableId: "uuid", - sessionsTableId: "uuid", - signInRecordFailure: "string", - signInRequestChallenge: "string", - signInWithChallenge: "string", - signUpWithKey: "string", - userField: "string", - usersTableId: "uuid" + addressesTableId: 'uuid', + cryptoNetwork: 'string', + databaseId: 'uuid', + id: 'uuid', + schemaId: 'uuid', + secretsTableId: 'uuid', + sessionCredentialsTableId: 'uuid', + sessionsTableId: 'uuid', + signInRecordFailure: 'string', + signInRequestChallenge: 'string', + signInWithChallenge: 'string', + signUpWithKey: 'string', + userField: 'string', + usersTableId: 'uuid', }; -const usage = "\ncrypto-auth-module \n\nCommands:\n list List cryptoAuthModule records\n find-first Find first matching cryptoAuthModule record\n get Get a cryptoAuthModule by ID\n create Create a new cryptoAuthModule\n update Update an existing cryptoAuthModule\n delete Delete a cryptoAuthModule\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) => { +const usage = + '\ncrypto-auth-module \n\nCommands:\n list List cryptoAuthModule records\n find-first Find first matching cryptoAuthModule record\n get Get a cryptoAuthModule by ID\n create Create a new cryptoAuthModule\n update Update an existing cryptoAuthModule\n delete Delete a cryptoAuthModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,18 @@ async function handleList(argv: Partial>, _prompter: Inq signInWithChallenge: true, signUpWithKey: true, userField: true, - usersTableId: true + usersTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: CryptoAuthModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: CryptoAuthModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.cryptoAuthModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +129,18 @@ async function handleFindFirst(argv: Partial>, _prompter signInWithChallenge: true, signUpWithKey: true, userField: true, - usersTableId: true + usersTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: CryptoAuthModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: CryptoAuthModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.cryptoAuthModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +149,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.cryptoAuthModule.findOne({ - id: answers.id as string, - select: { - addressesTableId: true, - cryptoNetwork: true, - databaseId: true, - id: true, - schemaId: true, - secretsTableId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - signInRecordFailure: true, - signInRequestChallenge: true, - signInWithChallenge: true, - signUpWithKey: true, - userField: true, - usersTableId: true - } - }).execute(); + const result = await client.cryptoAuthModule + .findOne({ + id: answers.id as string, + select: { + addressesTableId: true, + cryptoNetwork: true, + databaseId: true, + id: true, + schemaId: true, + secretsTableId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + signInRecordFailure: true, + signInRequestChallenge: true, + signInWithChallenge: true, + signUpWithKey: true, + userField: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,122 +190,141 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "addressesTableId", - message: "addressesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "cryptoNetwork", - message: "cryptoNetwork", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "secretsTableId", - message: "secretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInRecordFailure", - message: "signInRecordFailure", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInRequestChallenge", - message: "signInRequestChallenge", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInWithChallenge", - message: "signInWithChallenge", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signUpWithKey", - message: "signUpWithKey", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userField", - message: "userField", - required: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'addressesTableId', + message: 'addressesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'cryptoNetwork', + message: 'cryptoNetwork', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'secretsTableId', + message: 'secretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInRecordFailure', + message: 'signInRecordFailure', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInRequestChallenge', + message: 'signInRequestChallenge', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInWithChallenge', + message: 'signInWithChallenge', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signUpWithKey', + message: 'signUpWithKey', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userField', + message: 'userField', + required: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateCryptoAuthModuleInput["cryptoAuthModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateCryptoAuthModuleInput['cryptoAuthModule']; const client = getClient(); - const result = await client.cryptoAuthModule.create({ - data: { - addressesTableId: cleanedData.addressesTableId, - cryptoNetwork: cleanedData.cryptoNetwork, - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - secretsTableId: cleanedData.secretsTableId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionsTableId: cleanedData.sessionsTableId, - signInRecordFailure: cleanedData.signInRecordFailure, - signInRequestChallenge: cleanedData.signInRequestChallenge, - signInWithChallenge: cleanedData.signInWithChallenge, - signUpWithKey: cleanedData.signUpWithKey, - userField: cleanedData.userField, - usersTableId: cleanedData.usersTableId - }, - select: { - addressesTableId: true, - cryptoNetwork: true, - databaseId: true, - id: true, - schemaId: true, - secretsTableId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - signInRecordFailure: true, - signInRequestChallenge: true, - signInWithChallenge: true, - signUpWithKey: true, - userField: true, - usersTableId: true - } - }).execute(); + const result = await client.cryptoAuthModule + .create({ + data: { + addressesTableId: cleanedData.addressesTableId, + cryptoNetwork: cleanedData.cryptoNetwork, + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + secretsTableId: cleanedData.secretsTableId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionsTableId: cleanedData.sessionsTableId, + signInRecordFailure: cleanedData.signInRecordFailure, + signInRequestChallenge: cleanedData.signInRequestChallenge, + signInWithChallenge: cleanedData.signInWithChallenge, + signUpWithKey: cleanedData.signUpWithKey, + userField: cleanedData.userField, + usersTableId: cleanedData.usersTableId, + }, + select: { + addressesTableId: true, + cryptoNetwork: true, + databaseId: true, + id: true, + schemaId: true, + secretsTableId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + signInRecordFailure: true, + signInRequestChallenge: true, + signInWithChallenge: true, + signUpWithKey: true, + userField: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -292,130 +333,147 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "addressesTableId", - message: "addressesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "cryptoNetwork", - message: "cryptoNetwork", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "secretsTableId", - message: "secretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInRecordFailure", - message: "signInRecordFailure", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInRequestChallenge", - message: "signInRequestChallenge", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInWithChallenge", - message: "signInWithChallenge", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signUpWithKey", - message: "signUpWithKey", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userField", - message: "userField", - required: false - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'addressesTableId', + message: 'addressesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'cryptoNetwork', + message: 'cryptoNetwork', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'secretsTableId', + message: 'secretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInRecordFailure', + message: 'signInRecordFailure', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInRequestChallenge', + message: 'signInRequestChallenge', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInWithChallenge', + message: 'signInWithChallenge', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signUpWithKey', + message: 'signUpWithKey', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userField', + message: 'userField', + required: false, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CryptoAuthModulePatch; const client = getClient(); - const result = await client.cryptoAuthModule.update({ - where: { - id: answers.id as string - }, - data: { - addressesTableId: cleanedData.addressesTableId, - cryptoNetwork: cleanedData.cryptoNetwork, - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - secretsTableId: cleanedData.secretsTableId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionsTableId: cleanedData.sessionsTableId, - signInRecordFailure: cleanedData.signInRecordFailure, - signInRequestChallenge: cleanedData.signInRequestChallenge, - signInWithChallenge: cleanedData.signInWithChallenge, - signUpWithKey: cleanedData.signUpWithKey, - userField: cleanedData.userField, - usersTableId: cleanedData.usersTableId - }, - select: { - addressesTableId: true, - cryptoNetwork: true, - databaseId: true, - id: true, - schemaId: true, - secretsTableId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - signInRecordFailure: true, - signInRequestChallenge: true, - signInWithChallenge: true, - signUpWithKey: true, - userField: true, - usersTableId: true - } - }).execute(); + const result = await client.cryptoAuthModule + .update({ + where: { + id: answers.id as string, + }, + data: { + addressesTableId: cleanedData.addressesTableId, + cryptoNetwork: cleanedData.cryptoNetwork, + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + secretsTableId: cleanedData.secretsTableId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionsTableId: cleanedData.sessionsTableId, + signInRecordFailure: cleanedData.signInRecordFailure, + signInRequestChallenge: cleanedData.signInRequestChallenge, + signInWithChallenge: cleanedData.signInWithChallenge, + signUpWithKey: cleanedData.signUpWithKey, + userField: cleanedData.userField, + usersTableId: cleanedData.usersTableId, + }, + select: { + addressesTableId: true, + cryptoNetwork: true, + databaseId: true, + id: true, + schemaId: true, + secretsTableId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + signInRecordFailure: true, + signInRequestChallenge: true, + signInWithChallenge: true, + signUpWithKey: true, + userField: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -424,28 +482,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.cryptoAuthModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.cryptoAuthModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/database-provision-module.ts b/sdk/constructive-cli/src/modules/cli/commands/database-provision-module.ts index f6cc89767a..81c07d4f5e 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/database-provision-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/database-provision-module.ts @@ -3,67 +3,81 @@ * @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 { CreateDatabaseProvisionModuleInput, DatabaseProvisionModulePatch, DatabaseProvisionModuleSelect, DatabaseProvisionModuleFilter, DatabaseProvisionModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDatabaseProvisionModuleInput, + DatabaseProvisionModulePatch, + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - async: "boolean", - bootstrapError: "string", - bootstrapStatus: "string", - bootstrapUser: "boolean", - completedAt: "string", - createdAt: "string", - databaseId: "uuid", - databaseName: "string", - domain: "string", - errorMessage: "string", - fulfilledAt: "string", - id: "uuid", - modules: "json", - options: "json", - ownerId: "uuid", - sourceDatabaseId: "uuid", - status: "string", - subdomain: "string", - updatedAt: "string" + async: 'boolean', + bootstrapError: 'string', + bootstrapStatus: 'string', + bootstrapUser: 'boolean', + completedAt: 'string', + createdAt: 'string', + databaseId: 'uuid', + databaseName: 'string', + domain: 'string', + errorMessage: 'string', + fulfilledAt: 'string', + id: 'uuid', + modules: 'json', + options: 'json', + ownerId: 'uuid', + sourceDatabaseId: 'uuid', + status: 'string', + subdomain: 'string', + updatedAt: 'string', }; -const usage = "\ndatabase-provision-module \n\nCommands:\n list List databaseProvisionModule records\n find-first Find first matching databaseProvisionModule record\n get Get a databaseProvisionModule by ID\n create Create a new databaseProvisionModule\n update Update an existing databaseProvisionModule\n delete Delete a databaseProvisionModule\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) => { +const usage = + '\ndatabase-provision-module \n\nCommands:\n list List databaseProvisionModule records\n find-first Find first matching databaseProvisionModule record\n get Get a databaseProvisionModule by ID\n create Create a new databaseProvisionModule\n update Update an existing databaseProvisionModule\n delete Delete a databaseProvisionModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -91,16 +105,22 @@ async function handleList(argv: Partial>, _prompter: Inq sourceDatabaseId: true, status: true, subdomain: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DatabaseProvisionModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy + > & { + select: DatabaseProvisionModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.databaseProvisionModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -128,16 +148,22 @@ async function handleFindFirst(argv: Partial>, _prompter sourceDatabaseId: true, status: true, subdomain: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DatabaseProvisionModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy + > & { + select: DatabaseProvisionModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.databaseProvisionModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -146,40 +172,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.databaseProvisionModule.findOne({ - id: answers.id as string, - select: { - async: true, - bootstrapError: true, - bootstrapStatus: true, - bootstrapUser: true, - completedAt: true, - createdAt: true, - databaseId: true, - databaseName: true, - domain: true, - errorMessage: true, - fulfilledAt: true, - id: true, - modules: true, - options: true, - ownerId: true, - sourceDatabaseId: true, - status: true, - subdomain: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseProvisionModule + .findOne({ + id: answers.id as string, + select: { + async: true, + bootstrapError: true, + bootstrapStatus: true, + bootstrapUser: true, + completedAt: true, + createdAt: true, + databaseId: true, + databaseName: true, + domain: true, + errorMessage: true, + fulfilledAt: true, + id: true, + modules: true, + options: true, + ownerId: true, + sourceDatabaseId: true, + status: true, + subdomain: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -188,147 +218,169 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "async", - message: "async", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bootstrapError", - message: "bootstrapError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bootstrapStatus", - message: "bootstrapStatus", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "bootstrapUser", - message: "bootstrapUser", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseName", - message: "databaseName", - required: true - }, { - type: "text", - name: "domain", - message: "domain", - required: true - }, { - type: "text", - name: "errorMessage", - message: "errorMessage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fulfilledAt", - message: "fulfilledAt", - required: false, - skipPrompt: true - }, { - type: "json", - name: "modules", - message: "modules", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: true - }, { - type: "text", - name: "sourceDatabaseId", - message: "sourceDatabaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "subdomain", - message: "subdomain", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'async', + message: 'async', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bootstrapError', + message: 'bootstrapError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bootstrapStatus', + message: 'bootstrapStatus', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'bootstrapUser', + message: 'bootstrapUser', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseName', + message: 'databaseName', + required: true, + }, + { + type: 'text', + name: 'domain', + message: 'domain', + required: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fulfilledAt', + message: 'fulfilledAt', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'modules', + message: 'modules', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: true, + }, + { + type: 'text', + name: 'sourceDatabaseId', + message: 'sourceDatabaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'subdomain', + message: 'subdomain', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDatabaseProvisionModuleInput["databaseProvisionModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDatabaseProvisionModuleInput['databaseProvisionModule']; const client = getClient(); - const result = await client.databaseProvisionModule.create({ - data: { - async: cleanedData.async, - bootstrapError: cleanedData.bootstrapError, - bootstrapStatus: cleanedData.bootstrapStatus, - bootstrapUser: cleanedData.bootstrapUser, - completedAt: cleanedData.completedAt, - databaseId: cleanedData.databaseId, - databaseName: cleanedData.databaseName, - domain: cleanedData.domain, - errorMessage: cleanedData.errorMessage, - fulfilledAt: cleanedData.fulfilledAt, - modules: cleanedData.modules, - options: cleanedData.options, - ownerId: cleanedData.ownerId, - sourceDatabaseId: cleanedData.sourceDatabaseId, - status: cleanedData.status, - subdomain: cleanedData.subdomain - }, - select: { - async: true, - bootstrapError: true, - bootstrapStatus: true, - bootstrapUser: true, - completedAt: true, - createdAt: true, - databaseId: true, - databaseName: true, - domain: true, - errorMessage: true, - fulfilledAt: true, - id: true, - modules: true, - options: true, - ownerId: true, - sourceDatabaseId: true, - status: true, - subdomain: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseProvisionModule + .create({ + data: { + async: cleanedData.async, + bootstrapError: cleanedData.bootstrapError, + bootstrapStatus: cleanedData.bootstrapStatus, + bootstrapUser: cleanedData.bootstrapUser, + completedAt: cleanedData.completedAt, + databaseId: cleanedData.databaseId, + databaseName: cleanedData.databaseName, + domain: cleanedData.domain, + errorMessage: cleanedData.errorMessage, + fulfilledAt: cleanedData.fulfilledAt, + modules: cleanedData.modules, + options: cleanedData.options, + ownerId: cleanedData.ownerId, + sourceDatabaseId: cleanedData.sourceDatabaseId, + status: cleanedData.status, + subdomain: cleanedData.subdomain, + }, + select: { + async: true, + bootstrapError: true, + bootstrapStatus: true, + bootstrapUser: true, + completedAt: true, + createdAt: true, + databaseId: true, + databaseName: true, + domain: true, + errorMessage: true, + fulfilledAt: true, + id: true, + modules: true, + options: true, + ownerId: true, + sourceDatabaseId: true, + status: true, + subdomain: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -337,155 +389,175 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "async", - message: "async", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bootstrapError", - message: "bootstrapError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bootstrapStatus", - message: "bootstrapStatus", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "bootstrapUser", - message: "bootstrapUser", - required: false, - skipPrompt: true - }, { - type: "text", - name: "completedAt", - message: "completedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseName", - message: "databaseName", - required: false - }, { - type: "text", - name: "domain", - message: "domain", - required: false - }, { - type: "text", - name: "errorMessage", - message: "errorMessage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fulfilledAt", - message: "fulfilledAt", - required: false, - skipPrompt: true - }, { - type: "json", - name: "modules", - message: "modules", - required: false, - skipPrompt: true - }, { - type: "json", - name: "options", - message: "options", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerId", - message: "ownerId", - required: false - }, { - type: "text", - name: "sourceDatabaseId", - message: "sourceDatabaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }, { - type: "text", - name: "subdomain", - message: "subdomain", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'async', + message: 'async', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bootstrapError', + message: 'bootstrapError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bootstrapStatus', + message: 'bootstrapStatus', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'bootstrapUser', + message: 'bootstrapUser', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseName', + message: 'databaseName', + required: false, + }, + { + type: 'text', + name: 'domain', + message: 'domain', + required: false, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fulfilledAt', + message: 'fulfilledAt', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'modules', + message: 'modules', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'options', + message: 'options', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + }, + { + type: 'text', + name: 'sourceDatabaseId', + message: 'sourceDatabaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'subdomain', + message: 'subdomain', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DatabaseProvisionModulePatch; const client = getClient(); - const result = await client.databaseProvisionModule.update({ - where: { - id: answers.id as string - }, - data: { - async: cleanedData.async, - bootstrapError: cleanedData.bootstrapError, - bootstrapStatus: cleanedData.bootstrapStatus, - bootstrapUser: cleanedData.bootstrapUser, - completedAt: cleanedData.completedAt, - databaseId: cleanedData.databaseId, - databaseName: cleanedData.databaseName, - domain: cleanedData.domain, - errorMessage: cleanedData.errorMessage, - fulfilledAt: cleanedData.fulfilledAt, - modules: cleanedData.modules, - options: cleanedData.options, - ownerId: cleanedData.ownerId, - sourceDatabaseId: cleanedData.sourceDatabaseId, - status: cleanedData.status, - subdomain: cleanedData.subdomain - }, - select: { - async: true, - bootstrapError: true, - bootstrapStatus: true, - bootstrapUser: true, - completedAt: true, - createdAt: true, - databaseId: true, - databaseName: true, - domain: true, - errorMessage: true, - fulfilledAt: true, - id: true, - modules: true, - options: true, - ownerId: true, - sourceDatabaseId: true, - status: true, - subdomain: true, - updatedAt: true - } - }).execute(); + const result = await client.databaseProvisionModule + .update({ + where: { + id: answers.id as string, + }, + data: { + async: cleanedData.async, + bootstrapError: cleanedData.bootstrapError, + bootstrapStatus: cleanedData.bootstrapStatus, + bootstrapUser: cleanedData.bootstrapUser, + completedAt: cleanedData.completedAt, + databaseId: cleanedData.databaseId, + databaseName: cleanedData.databaseName, + domain: cleanedData.domain, + errorMessage: cleanedData.errorMessage, + fulfilledAt: cleanedData.fulfilledAt, + modules: cleanedData.modules, + options: cleanedData.options, + ownerId: cleanedData.ownerId, + sourceDatabaseId: cleanedData.sourceDatabaseId, + status: cleanedData.status, + subdomain: cleanedData.subdomain, + }, + select: { + async: true, + bootstrapError: true, + bootstrapStatus: true, + bootstrapUser: true, + completedAt: true, + createdAt: true, + databaseId: true, + databaseName: true, + domain: true, + errorMessage: true, + fulfilledAt: true, + id: true, + modules: true, + options: true, + ownerId: true, + sourceDatabaseId: true, + status: true, + subdomain: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -494,28 +566,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.databaseProvisionModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.databaseProvisionModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/database-settings-module.ts b/sdk/constructive-cli/src/modules/cli/commands/database-settings-module.ts index 5cd2123646..0474b85a67 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/database-settings-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/database-settings-module.ts @@ -3,69 +3,83 @@ * @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 { CreateDatabaseSettingsModuleInput, DatabaseSettingsModulePatch, DatabaseSettingsModuleSelect, DatabaseSettingsModuleFilter, DatabaseSettingsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDatabaseSettingsModuleInput, + DatabaseSettingsModulePatch, + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - databaseSettingsTableId: "uuid", - databaseSettingsTableName: "string", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - provisions: "json", - pubkeySettingsTableId: "uuid", - pubkeySettingsTableName: "string", - publicSchemaName: "string", - rlsSettingsTableId: "uuid", - rlsSettingsTableName: "string", - schemaId: "uuid", - scope: "string", - webauthnSettingsTableId: "uuid", - webauthnSettingsTableName: "string" + apiName: 'string', + databaseId: 'uuid', + databaseSettingsTableId: 'uuid', + databaseSettingsTableName: 'string', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + provisions: 'json', + pubkeySettingsTableId: 'uuid', + pubkeySettingsTableName: 'string', + publicSchemaName: 'string', + rlsSettingsTableId: 'uuid', + rlsSettingsTableName: 'string', + schemaId: 'uuid', + scope: 'string', + webauthnSettingsTableId: 'uuid', + webauthnSettingsTableName: 'string', }; -const usage = "\ndatabase-settings-module \n\nCommands:\n list List databaseSettingsModule records\n find-first Find first matching databaseSettingsModule record\n get Get a databaseSettingsModule by ID\n create Create a new databaseSettingsModule\n update Update an existing databaseSettingsModule\n delete Delete a databaseSettingsModule\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) => { +const usage = + '\ndatabase-settings-module \n\nCommands:\n list List databaseSettingsModule records\n find-first Find first matching databaseSettingsModule record\n get Get a databaseSettingsModule by ID\n create Create a new databaseSettingsModule\n update Update an existing databaseSettingsModule\n delete Delete a databaseSettingsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -95,16 +109,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, webauthnSettingsTableId: true, - webauthnSettingsTableName: true + webauthnSettingsTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: DatabaseSettingsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy + > & { + select: DatabaseSettingsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.databaseSettingsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -134,16 +154,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, webauthnSettingsTableId: true, - webauthnSettingsTableName: true + webauthnSettingsTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DatabaseSettingsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy + > & { + select: DatabaseSettingsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.databaseSettingsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -152,42 +178,46 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.databaseSettingsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - databaseSettingsTableId: true, - databaseSettingsTableName: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - pubkeySettingsTableId: true, - pubkeySettingsTableName: true, - publicSchemaName: true, - rlsSettingsTableId: true, - rlsSettingsTableName: true, - schemaId: true, - scope: true, - webauthnSettingsTableId: true, - webauthnSettingsTableName: true - } - }).execute(); + const result = await client.databaseSettingsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + databaseSettingsTableId: true, + databaseSettingsTableName: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + pubkeySettingsTableId: true, + pubkeySettingsTableName: true, + publicSchemaName: true, + rlsSettingsTableId: true, + rlsSettingsTableName: true, + schemaId: true, + scope: true, + webauthnSettingsTableId: true, + webauthnSettingsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -196,178 +226,204 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "databaseSettingsTableId", - message: "databaseSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseSettingsTableName", - message: "databaseSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pubkeySettingsTableId", - message: "pubkeySettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pubkeySettingsTableName", - message: "pubkeySettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rlsSettingsTableId", - message: "rlsSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rlsSettingsTableName", - message: "rlsSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "webauthnSettingsTableId", - message: "webauthnSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webauthnSettingsTableName", - message: "webauthnSettingsTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'databaseSettingsTableId', + message: 'databaseSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseSettingsTableName', + message: 'databaseSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pubkeySettingsTableId', + message: 'pubkeySettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pubkeySettingsTableName', + message: 'pubkeySettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rlsSettingsTableId', + message: 'rlsSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rlsSettingsTableName', + message: 'rlsSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'webauthnSettingsTableId', + message: 'webauthnSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webauthnSettingsTableName', + message: 'webauthnSettingsTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDatabaseSettingsModuleInput["databaseSettingsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDatabaseSettingsModuleInput['databaseSettingsModule']; const client = getClient(); - const result = await client.databaseSettingsModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - databaseSettingsTableId: cleanedData.databaseSettingsTableId, - databaseSettingsTableName: cleanedData.databaseSettingsTableName, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - provisions: cleanedData.provisions, - pubkeySettingsTableId: cleanedData.pubkeySettingsTableId, - pubkeySettingsTableName: cleanedData.pubkeySettingsTableName, - publicSchemaName: cleanedData.publicSchemaName, - rlsSettingsTableId: cleanedData.rlsSettingsTableId, - rlsSettingsTableName: cleanedData.rlsSettingsTableName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - webauthnSettingsTableId: cleanedData.webauthnSettingsTableId, - webauthnSettingsTableName: cleanedData.webauthnSettingsTableName - }, - select: { - apiName: true, - databaseId: true, - databaseSettingsTableId: true, - databaseSettingsTableName: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - pubkeySettingsTableId: true, - pubkeySettingsTableName: true, - publicSchemaName: true, - rlsSettingsTableId: true, - rlsSettingsTableName: true, - schemaId: true, - scope: true, - webauthnSettingsTableId: true, - webauthnSettingsTableName: true - } - }).execute(); + const result = await client.databaseSettingsModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + databaseSettingsTableId: cleanedData.databaseSettingsTableId, + databaseSettingsTableName: cleanedData.databaseSettingsTableName, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + provisions: cleanedData.provisions, + pubkeySettingsTableId: cleanedData.pubkeySettingsTableId, + pubkeySettingsTableName: cleanedData.pubkeySettingsTableName, + publicSchemaName: cleanedData.publicSchemaName, + rlsSettingsTableId: cleanedData.rlsSettingsTableId, + rlsSettingsTableName: cleanedData.rlsSettingsTableName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + webauthnSettingsTableId: cleanedData.webauthnSettingsTableId, + webauthnSettingsTableName: cleanedData.webauthnSettingsTableName, + }, + select: { + apiName: true, + databaseId: true, + databaseSettingsTableId: true, + databaseSettingsTableName: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + pubkeySettingsTableId: true, + pubkeySettingsTableName: true, + publicSchemaName: true, + rlsSettingsTableId: true, + rlsSettingsTableName: true, + schemaId: true, + scope: true, + webauthnSettingsTableId: true, + webauthnSettingsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -376,186 +432,210 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "databaseSettingsTableId", - message: "databaseSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseSettingsTableName", - message: "databaseSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pubkeySettingsTableId", - message: "pubkeySettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pubkeySettingsTableName", - message: "pubkeySettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rlsSettingsTableId", - message: "rlsSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rlsSettingsTableName", - message: "rlsSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "webauthnSettingsTableId", - message: "webauthnSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webauthnSettingsTableName", - message: "webauthnSettingsTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'databaseSettingsTableId', + message: 'databaseSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseSettingsTableName', + message: 'databaseSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pubkeySettingsTableId', + message: 'pubkeySettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pubkeySettingsTableName', + message: 'pubkeySettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rlsSettingsTableId', + message: 'rlsSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rlsSettingsTableName', + message: 'rlsSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'webauthnSettingsTableId', + message: 'webauthnSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webauthnSettingsTableName', + message: 'webauthnSettingsTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DatabaseSettingsModulePatch; const client = getClient(); - const result = await client.databaseSettingsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - databaseSettingsTableId: cleanedData.databaseSettingsTableId, - databaseSettingsTableName: cleanedData.databaseSettingsTableName, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - provisions: cleanedData.provisions, - pubkeySettingsTableId: cleanedData.pubkeySettingsTableId, - pubkeySettingsTableName: cleanedData.pubkeySettingsTableName, - publicSchemaName: cleanedData.publicSchemaName, - rlsSettingsTableId: cleanedData.rlsSettingsTableId, - rlsSettingsTableName: cleanedData.rlsSettingsTableName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - webauthnSettingsTableId: cleanedData.webauthnSettingsTableId, - webauthnSettingsTableName: cleanedData.webauthnSettingsTableName - }, - select: { - apiName: true, - databaseId: true, - databaseSettingsTableId: true, - databaseSettingsTableName: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - pubkeySettingsTableId: true, - pubkeySettingsTableName: true, - publicSchemaName: true, - rlsSettingsTableId: true, - rlsSettingsTableName: true, - schemaId: true, - scope: true, - webauthnSettingsTableId: true, - webauthnSettingsTableName: true - } - }).execute(); + const result = await client.databaseSettingsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + databaseSettingsTableId: cleanedData.databaseSettingsTableId, + databaseSettingsTableName: cleanedData.databaseSettingsTableName, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + provisions: cleanedData.provisions, + pubkeySettingsTableId: cleanedData.pubkeySettingsTableId, + pubkeySettingsTableName: cleanedData.pubkeySettingsTableName, + publicSchemaName: cleanedData.publicSchemaName, + rlsSettingsTableId: cleanedData.rlsSettingsTableId, + rlsSettingsTableName: cleanedData.rlsSettingsTableName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + webauthnSettingsTableId: cleanedData.webauthnSettingsTableId, + webauthnSettingsTableName: cleanedData.webauthnSettingsTableName, + }, + select: { + apiName: true, + databaseId: true, + databaseSettingsTableId: true, + databaseSettingsTableName: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + pubkeySettingsTableId: true, + pubkeySettingsTableName: true, + publicSchemaName: true, + rlsSettingsTableId: true, + rlsSettingsTableName: true, + schemaId: true, + scope: true, + webauthnSettingsTableId: true, + webauthnSettingsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -564,28 +644,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.databaseSettingsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.databaseSettingsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/db-pool-config.ts b/sdk/constructive-cli/src/modules/cli/commands/db-pool-config.ts index 5e20af0e7e..4554c9f8e2 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/db-pool-config.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/db-pool-config.ts @@ -3,58 +3,72 @@ * @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 { CreateDbPoolConfigInput, DbPoolConfigPatch, DbPoolConfigSelect, DbPoolConfigFilter, DbPoolConfigOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDbPoolConfigInput, + DbPoolConfigPatch, + DbPoolConfigSelect, + DbPoolConfigFilter, + DbPoolConfigOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - domain: "string", - enabled: "boolean", - id: "uuid", - max: "int", - min: "int", - poolOwnerId: "uuid", - presetSlug: "string", - updatedAt: "string", - warmTtl: "string" + createdAt: 'string', + domain: 'string', + enabled: 'boolean', + id: 'uuid', + max: 'int', + min: 'int', + poolOwnerId: 'uuid', + presetSlug: 'string', + updatedAt: 'string', + warmTtl: 'string', }; -const usage = "\ndb-pool-config \n\nCommands:\n list List dbPoolConfig records\n find-first Find first matching dbPoolConfig record\n get Get a dbPoolConfig by ID\n create Create a new dbPoolConfig\n update Update an existing dbPoolConfig\n delete Delete a dbPoolConfig\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) => { +const usage = + '\ndb-pool-config \n\nCommands:\n list List dbPoolConfig records\n find-first Find first matching dbPoolConfig record\n get Get a dbPoolConfig by ID\n create Create a new dbPoolConfig\n update Update an existing dbPoolConfig\n delete Delete a dbPoolConfig\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -73,16 +87,18 @@ async function handleList(argv: Partial>, _prompter: Inq poolOwnerId: true, presetSlug: true, updatedAt: true, - warmTtl: true + warmTtl: true, }; - const findManyArgs = parseFindManyArgs & { - select: DbPoolConfigSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DbPoolConfigSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPoolConfig.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -101,16 +117,18 @@ async function handleFindFirst(argv: Partial>, _prompter poolOwnerId: true, presetSlug: true, updatedAt: true, - warmTtl: true + warmTtl: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DbPoolConfigSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DbPoolConfigSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPoolConfig.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -119,31 +137,35 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.dbPoolConfig.findOne({ - id: answers.id as string, - select: { - createdAt: true, - domain: true, - enabled: true, - id: true, - max: true, - min: true, - poolOwnerId: true, - presetSlug: true, - updatedAt: true, - warmTtl: true - } - }).execute(); + const result = await client.dbPoolConfig + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + domain: true, + enabled: true, + id: true, + max: true, + min: true, + poolOwnerId: true, + presetSlug: true, + updatedAt: true, + warmTtl: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -152,75 +174,88 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "domain", - message: "domain", - required: true - }, { - type: "boolean", - name: "enabled", - message: "enabled", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "min", - message: "min", - required: false, - skipPrompt: true - }, { - type: "text", - name: "poolOwnerId", - message: "poolOwnerId", - required: true - }, { - type: "text", - name: "presetSlug", - message: "presetSlug", - required: true - }, { - type: "text", - name: "warmTtl", - message: "warmTtl", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'domain', + message: 'domain', + required: true, + }, + { + type: 'boolean', + name: 'enabled', + message: 'enabled', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'min', + message: 'min', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'poolOwnerId', + message: 'poolOwnerId', + required: true, + }, + { + type: 'text', + name: 'presetSlug', + message: 'presetSlug', + required: true, + }, + { + type: 'text', + name: 'warmTtl', + message: 'warmTtl', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbPoolConfigInput["dbPoolConfig"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDbPoolConfigInput['dbPoolConfig']; const client = getClient(); - const result = await client.dbPoolConfig.create({ - data: { - domain: cleanedData.domain, - enabled: cleanedData.enabled, - max: cleanedData.max, - min: cleanedData.min, - poolOwnerId: cleanedData.poolOwnerId, - presetSlug: cleanedData.presetSlug, - warmTtl: cleanedData.warmTtl - }, - select: { - createdAt: true, - domain: true, - enabled: true, - id: true, - max: true, - min: true, - poolOwnerId: true, - presetSlug: true, - updatedAt: true, - warmTtl: true - } - }).execute(); + const result = await client.dbPoolConfig + .create({ + data: { + domain: cleanedData.domain, + enabled: cleanedData.enabled, + max: cleanedData.max, + min: cleanedData.min, + poolOwnerId: cleanedData.poolOwnerId, + presetSlug: cleanedData.presetSlug, + warmTtl: cleanedData.warmTtl, + }, + select: { + createdAt: true, + domain: true, + enabled: true, + id: true, + max: true, + min: true, + poolOwnerId: true, + presetSlug: true, + updatedAt: true, + warmTtl: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -229,83 +264,94 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "domain", - message: "domain", - required: false - }, { - type: "boolean", - name: "enabled", - message: "enabled", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "min", - message: "min", - required: false, - skipPrompt: true - }, { - type: "text", - name: "poolOwnerId", - message: "poolOwnerId", - required: false - }, { - type: "text", - name: "presetSlug", - message: "presetSlug", - required: false - }, { - type: "text", - name: "warmTtl", - message: "warmTtl", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'domain', + message: 'domain', + required: false, + }, + { + type: 'boolean', + name: 'enabled', + message: 'enabled', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'min', + message: 'min', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'poolOwnerId', + message: 'poolOwnerId', + required: false, + }, + { + type: 'text', + name: 'presetSlug', + message: 'presetSlug', + required: false, + }, + { + type: 'text', + name: 'warmTtl', + message: 'warmTtl', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DbPoolConfigPatch; const client = getClient(); - const result = await client.dbPoolConfig.update({ - where: { - id: answers.id as string - }, - data: { - domain: cleanedData.domain, - enabled: cleanedData.enabled, - max: cleanedData.max, - min: cleanedData.min, - poolOwnerId: cleanedData.poolOwnerId, - presetSlug: cleanedData.presetSlug, - warmTtl: cleanedData.warmTtl - }, - select: { - createdAt: true, - domain: true, - enabled: true, - id: true, - max: true, - min: true, - poolOwnerId: true, - presetSlug: true, - updatedAt: true, - warmTtl: true - } - }).execute(); + const result = await client.dbPoolConfig + .update({ + where: { + id: answers.id as string, + }, + data: { + domain: cleanedData.domain, + enabled: cleanedData.enabled, + max: cleanedData.max, + min: cleanedData.min, + poolOwnerId: cleanedData.poolOwnerId, + presetSlug: cleanedData.presetSlug, + warmTtl: cleanedData.warmTtl, + }, + select: { + createdAt: true, + domain: true, + enabled: true, + id: true, + max: true, + min: true, + poolOwnerId: true, + presetSlug: true, + updatedAt: true, + warmTtl: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -314,28 +360,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.dbPoolConfig.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.dbPoolConfig + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/db-pool.ts b/sdk/constructive-cli/src/modules/cli/commands/db-pool.ts index aa6cfb8aa8..d615a0f94f 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/db-pool.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/db-pool.ts @@ -3,61 +3,75 @@ * @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 { CreateDbPoolInput, DbPoolPatch, DbPoolSelect, DbPoolFilter, DbPoolOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDbPoolInput, + DbPoolPatch, + DbPoolSelect, + DbPoolFilter, + DbPoolOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - bootstrapError: "string", - bootstrapStatus: "string", - claimedAt: "string", - claimedBy: "uuid", - createdAt: "string", - databaseId: "uuid", - errorMessage: "string", - expiresAt: "string", - id: "uuid", - presetCommitId: "uuid", - presetSlug: "string", - status: "string", - updatedAt: "string" + bootstrapError: 'string', + bootstrapStatus: 'string', + claimedAt: 'string', + claimedBy: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + errorMessage: 'string', + expiresAt: 'string', + id: 'uuid', + presetCommitId: 'uuid', + presetSlug: 'string', + status: 'string', + updatedAt: 'string', }; -const usage = "\ndb-pool \n\nCommands:\n list List dbPool records\n find-first Find first matching dbPool record\n get Get a dbPool by ID\n create Create a new dbPool\n update Update an existing dbPool\n delete Delete a dbPool\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) => { +const usage = + '\ndb-pool \n\nCommands:\n list List dbPool records\n find-first Find first matching dbPool record\n get Get a dbPool by ID\n create Create a new dbPool\n update Update an existing dbPool\n delete Delete a dbPool\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq presetCommitId: true, presetSlug: true, status: true, - updatedAt: true + updatedAt: true, }; - const findManyArgs = parseFindManyArgs & { - select: DbPoolSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DbPoolSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPool.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter presetCommitId: true, presetSlug: true, status: true, - updatedAt: true + updatedAt: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DbPoolSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DbPoolSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPool.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.dbPool.findOne({ - id: answers.id as string, - select: { - bootstrapError: true, - bootstrapStatus: true, - claimedAt: true, - claimedBy: true, - createdAt: true, - databaseId: true, - errorMessage: true, - expiresAt: true, - id: true, - presetCommitId: true, - presetSlug: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPool + .findOne({ + id: answers.id as string, + select: { + bootstrapError: true, + bootstrapStatus: true, + claimedAt: true, + claimedBy: true, + createdAt: true, + databaseId: true, + errorMessage: true, + expiresAt: true, + id: true, + presetCommitId: true, + presetSlug: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,101 +186,114 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "bootstrapError", - message: "bootstrapError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bootstrapStatus", - message: "bootstrapStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "claimedAt", - message: "claimedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "claimedBy", - message: "claimedBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorMessage", - message: "errorMessage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "presetCommitId", - message: "presetCommitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "presetSlug", - message: "presetSlug", - required: true - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'bootstrapError', + message: 'bootstrapError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bootstrapStatus', + message: 'bootstrapStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'claimedAt', + message: 'claimedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'claimedBy', + message: 'claimedBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'presetCommitId', + message: 'presetCommitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'presetSlug', + message: 'presetSlug', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbPoolInput["dbPool"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbPoolInput['dbPool']; const client = getClient(); - const result = await client.dbPool.create({ - data: { - bootstrapError: cleanedData.bootstrapError, - bootstrapStatus: cleanedData.bootstrapStatus, - claimedAt: cleanedData.claimedAt, - claimedBy: cleanedData.claimedBy, - databaseId: cleanedData.databaseId, - errorMessage: cleanedData.errorMessage, - expiresAt: cleanedData.expiresAt, - presetCommitId: cleanedData.presetCommitId, - presetSlug: cleanedData.presetSlug, - status: cleanedData.status - }, - select: { - bootstrapError: true, - bootstrapStatus: true, - claimedAt: true, - claimedBy: true, - createdAt: true, - databaseId: true, - errorMessage: true, - expiresAt: true, - id: true, - presetCommitId: true, - presetSlug: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPool + .create({ + data: { + bootstrapError: cleanedData.bootstrapError, + bootstrapStatus: cleanedData.bootstrapStatus, + claimedAt: cleanedData.claimedAt, + claimedBy: cleanedData.claimedBy, + databaseId: cleanedData.databaseId, + errorMessage: cleanedData.errorMessage, + expiresAt: cleanedData.expiresAt, + presetCommitId: cleanedData.presetCommitId, + presetSlug: cleanedData.presetSlug, + status: cleanedData.status, + }, + select: { + bootstrapError: true, + bootstrapStatus: true, + claimedAt: true, + claimedBy: true, + createdAt: true, + databaseId: true, + errorMessage: true, + expiresAt: true, + id: true, + presetCommitId: true, + presetSlug: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -267,109 +302,123 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "bootstrapError", - message: "bootstrapError", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bootstrapStatus", - message: "bootstrapStatus", - required: false, - skipPrompt: true - }, { - type: "text", - name: "claimedAt", - message: "claimedAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "claimedBy", - message: "claimedBy", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "errorMessage", - message: "errorMessage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "presetCommitId", - message: "presetCommitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "presetSlug", - message: "presetSlug", - required: false - }, { - type: "text", - name: "status", - message: "status", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'bootstrapError', + message: 'bootstrapError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bootstrapStatus', + message: 'bootstrapStatus', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'claimedAt', + message: 'claimedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'claimedBy', + message: 'claimedBy', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'presetCommitId', + message: 'presetCommitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'presetSlug', + message: 'presetSlug', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DbPoolPatch; const client = getClient(); - const result = await client.dbPool.update({ - where: { - id: answers.id as string - }, - data: { - bootstrapError: cleanedData.bootstrapError, - bootstrapStatus: cleanedData.bootstrapStatus, - claimedAt: cleanedData.claimedAt, - claimedBy: cleanedData.claimedBy, - databaseId: cleanedData.databaseId, - errorMessage: cleanedData.errorMessage, - expiresAt: cleanedData.expiresAt, - presetCommitId: cleanedData.presetCommitId, - presetSlug: cleanedData.presetSlug, - status: cleanedData.status - }, - select: { - bootstrapError: true, - bootstrapStatus: true, - claimedAt: true, - claimedBy: true, - createdAt: true, - databaseId: true, - errorMessage: true, - expiresAt: true, - id: true, - presetCommitId: true, - presetSlug: true, - status: true, - updatedAt: true - } - }).execute(); + const result = await client.dbPool + .update({ + where: { + id: answers.id as string, + }, + data: { + bootstrapError: cleanedData.bootstrapError, + bootstrapStatus: cleanedData.bootstrapStatus, + claimedAt: cleanedData.claimedAt, + claimedBy: cleanedData.claimedBy, + databaseId: cleanedData.databaseId, + errorMessage: cleanedData.errorMessage, + expiresAt: cleanedData.expiresAt, + presetCommitId: cleanedData.presetCommitId, + presetSlug: cleanedData.presetSlug, + status: cleanedData.status, + }, + select: { + bootstrapError: true, + bootstrapStatus: true, + claimedAt: true, + claimedBy: true, + createdAt: true, + databaseId: true, + errorMessage: true, + expiresAt: true, + id: true, + presetCommitId: true, + presetSlug: true, + status: true, + updatedAt: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -378,28 +427,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.dbPool.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.dbPool + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/db-preset-module.ts b/sdk/constructive-cli/src/modules/cli/commands/db-preset-module.ts index f6b6b905db..9b2330be51 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/db-preset-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/db-preset-module.ts @@ -3,65 +3,79 @@ * @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 { CreateDbPresetModuleInput, DbPresetModulePatch, DbPresetModuleSelect, DbPresetModuleFilter, DbPresetModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDbPresetModuleInput, + DbPresetModulePatch, + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - createdAt: "string", - databaseId: "uuid", - dbPresetsTableId: "uuid", - entityTableId: "uuid", - id: "uuid", - merkleStoreModuleId: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaId: "uuid", - publicSchemaName: "string", - scope: "string", - storeName: "string" + apiName: 'string', + createdAt: 'string', + databaseId: 'uuid', + dbPresetsTableId: 'uuid', + entityTableId: 'uuid', + id: 'uuid', + merkleStoreModuleId: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaId: 'uuid', + publicSchemaName: 'string', + scope: 'string', + storeName: 'string', }; -const usage = "\ndb-preset-module \n\nCommands:\n list List dbPresetModule records\n find-first Find first matching dbPresetModule record\n get Get a dbPresetModule by ID\n create Create a new dbPresetModule\n update Update an existing dbPresetModule\n delete Delete a dbPresetModule\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) => { +const usage = + '\ndb-preset-module \n\nCommands:\n list List dbPresetModule records\n find-first Find first matching dbPresetModule record\n get Get a dbPresetModule by ID\n create Create a new dbPresetModule\n update Update an existing dbPresetModule\n delete Delete a dbPresetModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -87,16 +101,18 @@ async function handleList(argv: Partial>, _prompter: Inq publicSchemaId: true, publicSchemaName: true, scope: true, - storeName: true + storeName: true, }; - const findManyArgs = parseFindManyArgs & { - select: DbPresetModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DbPresetModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPresetModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -122,16 +138,18 @@ async function handleFindFirst(argv: Partial>, _prompter publicSchemaId: true, publicSchemaName: true, scope: true, - storeName: true + storeName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DbPresetModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DbPresetModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbPresetModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -140,38 +158,42 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.dbPresetModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - createdAt: true, - databaseId: true, - dbPresetsTableId: true, - entityTableId: true, - id: true, - merkleStoreModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaId: true, - publicSchemaName: true, - scope: true, - storeName: true - } - }).execute(); + const result = await client.dbPresetModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + createdAt: true, + databaseId: true, + dbPresetsTableId: true, + entityTableId: true, + id: true, + merkleStoreModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaId: true, + publicSchemaName: true, + scope: true, + storeName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -180,136 +202,157 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "dbPresetsTableId", - message: "dbPresetsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "merkleStoreModuleId", - message: "merkleStoreModuleId", - required: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaId", - message: "publicSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "storeName", - message: "storeName", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'dbPresetsTableId', + message: 'dbPresetsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'merkleStoreModuleId', + message: 'merkleStoreModuleId', + required: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaId', + message: 'publicSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'storeName', + message: 'storeName', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbPresetModuleInput["dbPresetModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDbPresetModuleInput['dbPresetModule']; const client = getClient(); - const result = await client.dbPresetModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - dbPresetsTableId: cleanedData.dbPresetsTableId, - entityTableId: cleanedData.entityTableId, - merkleStoreModuleId: cleanedData.merkleStoreModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaId: cleanedData.publicSchemaId, - publicSchemaName: cleanedData.publicSchemaName, - scope: cleanedData.scope, - storeName: cleanedData.storeName - }, - select: { - apiName: true, - createdAt: true, - databaseId: true, - dbPresetsTableId: true, - entityTableId: true, - id: true, - merkleStoreModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaId: true, - publicSchemaName: true, - scope: true, - storeName: true - } - }).execute(); + const result = await client.dbPresetModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + dbPresetsTableId: cleanedData.dbPresetsTableId, + entityTableId: cleanedData.entityTableId, + merkleStoreModuleId: cleanedData.merkleStoreModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaId: cleanedData.publicSchemaId, + publicSchemaName: cleanedData.publicSchemaName, + scope: cleanedData.scope, + storeName: cleanedData.storeName, + }, + select: { + apiName: true, + createdAt: true, + databaseId: true, + dbPresetsTableId: true, + entityTableId: true, + id: true, + merkleStoreModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaId: true, + publicSchemaName: true, + scope: true, + storeName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -318,144 +361,163 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "dbPresetsTableId", - message: "dbPresetsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "merkleStoreModuleId", - message: "merkleStoreModuleId", - required: false - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaId", - message: "publicSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "storeName", - message: "storeName", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'dbPresetsTableId', + message: 'dbPresetsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'merkleStoreModuleId', + message: 'merkleStoreModuleId', + required: false, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaId', + message: 'publicSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'storeName', + message: 'storeName', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DbPresetModulePatch; const client = getClient(); - const result = await client.dbPresetModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - dbPresetsTableId: cleanedData.dbPresetsTableId, - entityTableId: cleanedData.entityTableId, - merkleStoreModuleId: cleanedData.merkleStoreModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaId: cleanedData.publicSchemaId, - publicSchemaName: cleanedData.publicSchemaName, - scope: cleanedData.scope, - storeName: cleanedData.storeName - }, - select: { - apiName: true, - createdAt: true, - databaseId: true, - dbPresetsTableId: true, - entityTableId: true, - id: true, - merkleStoreModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaId: true, - publicSchemaName: true, - scope: true, - storeName: true - } - }).execute(); + const result = await client.dbPresetModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + dbPresetsTableId: cleanedData.dbPresetsTableId, + entityTableId: cleanedData.entityTableId, + merkleStoreModuleId: cleanedData.merkleStoreModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaId: cleanedData.publicSchemaId, + publicSchemaName: cleanedData.publicSchemaName, + scope: cleanedData.scope, + storeName: cleanedData.storeName, + }, + select: { + apiName: true, + createdAt: true, + databaseId: true, + dbPresetsTableId: true, + entityTableId: true, + id: true, + merkleStoreModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaId: true, + publicSchemaName: true, + scope: true, + storeName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -464,28 +526,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.dbPresetModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.dbPresetModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/db-usage-module.ts b/sdk/constructive-cli/src/modules/cli/commands/db-usage-module.ts index faca28a6bd..365c5a96c3 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/db-usage-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/db-usage-module.ts @@ -3,75 +3,89 @@ * @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 { CreateDbUsageModuleInput, DbUsageModulePatch, DbUsageModuleSelect, DbUsageModuleFilter, DbUsageModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDbUsageModuleInput, + DbUsageModulePatch, + DbUsageModuleSelect, + DbUsageModuleFilter, + DbUsageModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - collectDbQueryStatsFunction: "string", - collectDbTableStatsFunction: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - id: "uuid", - interval: "string", - prefix: "string", - premake: "int", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - queryStatsLogTableId: "uuid", - queryStatsLogTableName: "string", - queryStatsSummaryTableId: "uuid", - queryStatsSummaryTableName: "string", - retention: "string", - rollupDbQueryStatsUsageSummaryFunction: "string", - rollupDbTableStatsUsageSummaryFunction: "string", - schemaId: "uuid", - scope: "string", - tableStatsLogTableId: "uuid", - tableStatsLogTableName: "string", - tableStatsSummaryTableId: "uuid", - tableStatsSummaryTableName: "string" + apiName: 'string', + collectDbQueryStatsFunction: 'string', + collectDbTableStatsFunction: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + id: 'uuid', + interval: 'string', + prefix: 'string', + premake: 'int', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + queryStatsLogTableId: 'uuid', + queryStatsLogTableName: 'string', + queryStatsSummaryTableId: 'uuid', + queryStatsSummaryTableName: 'string', + retention: 'string', + rollupDbQueryStatsUsageSummaryFunction: 'string', + rollupDbTableStatsUsageSummaryFunction: 'string', + schemaId: 'uuid', + scope: 'string', + tableStatsLogTableId: 'uuid', + tableStatsLogTableName: 'string', + tableStatsSummaryTableId: 'uuid', + tableStatsSummaryTableName: 'string', }; -const usage = "\ndb-usage-module \n\nCommands:\n list List dbUsageModule records\n find-first Find first matching dbUsageModule record\n get Get a dbUsageModule by ID\n create Create a new dbUsageModule\n update Update an existing dbUsageModule\n delete Delete a dbUsageModule\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) => { +const usage = + '\ndb-usage-module \n\nCommands:\n list List dbUsageModule records\n find-first Find first matching dbUsageModule record\n get Get a dbUsageModule by ID\n create Create a new dbUsageModule\n update Update an existing dbUsageModule\n delete Delete a dbUsageModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -107,16 +121,18 @@ async function handleList(argv: Partial>, _prompter: Inq tableStatsLogTableId: true, tableStatsLogTableName: true, tableStatsSummaryTableId: true, - tableStatsSummaryTableName: true + tableStatsSummaryTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: DbUsageModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DbUsageModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbUsageModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -152,16 +168,18 @@ async function handleFindFirst(argv: Partial>, _prompter tableStatsLogTableId: true, tableStatsLogTableName: true, tableStatsSummaryTableId: true, - tableStatsSummaryTableName: true + tableStatsSummaryTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DbUsageModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DbUsageModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.dbUsageModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -170,48 +188,52 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.dbUsageModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - collectDbQueryStatsFunction: true, - collectDbTableStatsFunction: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - queryStatsLogTableId: true, - queryStatsLogTableName: true, - queryStatsSummaryTableId: true, - queryStatsSummaryTableName: true, - retention: true, - rollupDbQueryStatsUsageSummaryFunction: true, - rollupDbTableStatsUsageSummaryFunction: true, - schemaId: true, - scope: true, - tableStatsLogTableId: true, - tableStatsLogTableName: true, - tableStatsSummaryTableId: true, - tableStatsSummaryTableName: true - } - }).execute(); + const result = await client.dbUsageModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + collectDbQueryStatsFunction: true, + collectDbTableStatsFunction: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + queryStatsLogTableId: true, + queryStatsLogTableName: true, + queryStatsSummaryTableId: true, + queryStatsSummaryTableName: true, + retention: true, + rollupDbQueryStatsUsageSummaryFunction: true, + rollupDbTableStatsUsageSummaryFunction: true, + schemaId: true, + scope: true, + tableStatsLogTableId: true, + tableStatsLogTableName: true, + tableStatsSummaryTableId: true, + tableStatsSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -220,226 +242,260 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "collectDbQueryStatsFunction", - message: "collectDbQueryStatsFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "collectDbTableStatsFunction", - message: "collectDbTableStatsFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queryStatsLogTableId", - message: "queryStatsLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queryStatsLogTableName", - message: "queryStatsLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queryStatsSummaryTableId", - message: "queryStatsSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queryStatsSummaryTableName", - message: "queryStatsSummaryTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rollupDbQueryStatsUsageSummaryFunction", - message: "rollupDbQueryStatsUsageSummaryFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rollupDbTableStatsUsageSummaryFunction", - message: "rollupDbTableStatsUsageSummaryFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "tableStatsLogTableId", - message: "tableStatsLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableStatsLogTableName", - message: "tableStatsLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableStatsSummaryTableId", - message: "tableStatsSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableStatsSummaryTableName", - message: "tableStatsSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'collectDbQueryStatsFunction', + message: 'collectDbQueryStatsFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'collectDbTableStatsFunction', + message: 'collectDbTableStatsFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queryStatsLogTableId', + message: 'queryStatsLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queryStatsLogTableName', + message: 'queryStatsLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queryStatsSummaryTableId', + message: 'queryStatsSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queryStatsSummaryTableName', + message: 'queryStatsSummaryTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rollupDbQueryStatsUsageSummaryFunction', + message: 'rollupDbQueryStatsUsageSummaryFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rollupDbTableStatsUsageSummaryFunction', + message: 'rollupDbTableStatsUsageSummaryFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'tableStatsLogTableId', + message: 'tableStatsLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableStatsLogTableName', + message: 'tableStatsLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableStatsSummaryTableId', + message: 'tableStatsSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableStatsSummaryTableName', + message: 'tableStatsSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDbUsageModuleInput["dbUsageModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDbUsageModuleInput['dbUsageModule']; const client = getClient(); - const result = await client.dbUsageModule.create({ - data: { - apiName: cleanedData.apiName, - collectDbQueryStatsFunction: cleanedData.collectDbQueryStatsFunction, - collectDbTableStatsFunction: cleanedData.collectDbTableStatsFunction, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - queryStatsLogTableId: cleanedData.queryStatsLogTableId, - queryStatsLogTableName: cleanedData.queryStatsLogTableName, - queryStatsSummaryTableId: cleanedData.queryStatsSummaryTableId, - queryStatsSummaryTableName: cleanedData.queryStatsSummaryTableName, - retention: cleanedData.retention, - rollupDbQueryStatsUsageSummaryFunction: cleanedData.rollupDbQueryStatsUsageSummaryFunction, - rollupDbTableStatsUsageSummaryFunction: cleanedData.rollupDbTableStatsUsageSummaryFunction, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableStatsLogTableId: cleanedData.tableStatsLogTableId, - tableStatsLogTableName: cleanedData.tableStatsLogTableName, - tableStatsSummaryTableId: cleanedData.tableStatsSummaryTableId, - tableStatsSummaryTableName: cleanedData.tableStatsSummaryTableName - }, - select: { - apiName: true, - collectDbQueryStatsFunction: true, - collectDbTableStatsFunction: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - queryStatsLogTableId: true, - queryStatsLogTableName: true, - queryStatsSummaryTableId: true, - queryStatsSummaryTableName: true, - retention: true, - rollupDbQueryStatsUsageSummaryFunction: true, - rollupDbTableStatsUsageSummaryFunction: true, - schemaId: true, - scope: true, - tableStatsLogTableId: true, - tableStatsLogTableName: true, - tableStatsSummaryTableId: true, - tableStatsSummaryTableName: true - } - }).execute(); + const result = await client.dbUsageModule + .create({ + data: { + apiName: cleanedData.apiName, + collectDbQueryStatsFunction: cleanedData.collectDbQueryStatsFunction, + collectDbTableStatsFunction: cleanedData.collectDbTableStatsFunction, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + queryStatsLogTableId: cleanedData.queryStatsLogTableId, + queryStatsLogTableName: cleanedData.queryStatsLogTableName, + queryStatsSummaryTableId: cleanedData.queryStatsSummaryTableId, + queryStatsSummaryTableName: cleanedData.queryStatsSummaryTableName, + retention: cleanedData.retention, + rollupDbQueryStatsUsageSummaryFunction: + cleanedData.rollupDbQueryStatsUsageSummaryFunction, + rollupDbTableStatsUsageSummaryFunction: + cleanedData.rollupDbTableStatsUsageSummaryFunction, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableStatsLogTableId: cleanedData.tableStatsLogTableId, + tableStatsLogTableName: cleanedData.tableStatsLogTableName, + tableStatsSummaryTableId: cleanedData.tableStatsSummaryTableId, + tableStatsSummaryTableName: cleanedData.tableStatsSummaryTableName, + }, + select: { + apiName: true, + collectDbQueryStatsFunction: true, + collectDbTableStatsFunction: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + queryStatsLogTableId: true, + queryStatsLogTableName: true, + queryStatsSummaryTableId: true, + queryStatsSummaryTableName: true, + retention: true, + rollupDbQueryStatsUsageSummaryFunction: true, + rollupDbTableStatsUsageSummaryFunction: true, + schemaId: true, + scope: true, + tableStatsLogTableId: true, + tableStatsLogTableName: true, + tableStatsSummaryTableId: true, + tableStatsSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -448,234 +504,266 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "collectDbQueryStatsFunction", - message: "collectDbQueryStatsFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "collectDbTableStatsFunction", - message: "collectDbTableStatsFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queryStatsLogTableId", - message: "queryStatsLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queryStatsLogTableName", - message: "queryStatsLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queryStatsSummaryTableId", - message: "queryStatsSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "queryStatsSummaryTableName", - message: "queryStatsSummaryTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rollupDbQueryStatsUsageSummaryFunction", - message: "rollupDbQueryStatsUsageSummaryFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rollupDbTableStatsUsageSummaryFunction", - message: "rollupDbTableStatsUsageSummaryFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "tableStatsLogTableId", - message: "tableStatsLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableStatsLogTableName", - message: "tableStatsLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableStatsSummaryTableId", - message: "tableStatsSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableStatsSummaryTableName", - message: "tableStatsSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'collectDbQueryStatsFunction', + message: 'collectDbQueryStatsFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'collectDbTableStatsFunction', + message: 'collectDbTableStatsFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queryStatsLogTableId', + message: 'queryStatsLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queryStatsLogTableName', + message: 'queryStatsLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queryStatsSummaryTableId', + message: 'queryStatsSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queryStatsSummaryTableName', + message: 'queryStatsSummaryTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rollupDbQueryStatsUsageSummaryFunction', + message: 'rollupDbQueryStatsUsageSummaryFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rollupDbTableStatsUsageSummaryFunction', + message: 'rollupDbTableStatsUsageSummaryFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'tableStatsLogTableId', + message: 'tableStatsLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableStatsLogTableName', + message: 'tableStatsLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableStatsSummaryTableId', + message: 'tableStatsSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableStatsSummaryTableName', + message: 'tableStatsSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DbUsageModulePatch; const client = getClient(); - const result = await client.dbUsageModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - collectDbQueryStatsFunction: cleanedData.collectDbQueryStatsFunction, - collectDbTableStatsFunction: cleanedData.collectDbTableStatsFunction, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - queryStatsLogTableId: cleanedData.queryStatsLogTableId, - queryStatsLogTableName: cleanedData.queryStatsLogTableName, - queryStatsSummaryTableId: cleanedData.queryStatsSummaryTableId, - queryStatsSummaryTableName: cleanedData.queryStatsSummaryTableName, - retention: cleanedData.retention, - rollupDbQueryStatsUsageSummaryFunction: cleanedData.rollupDbQueryStatsUsageSummaryFunction, - rollupDbTableStatsUsageSummaryFunction: cleanedData.rollupDbTableStatsUsageSummaryFunction, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableStatsLogTableId: cleanedData.tableStatsLogTableId, - tableStatsLogTableName: cleanedData.tableStatsLogTableName, - tableStatsSummaryTableId: cleanedData.tableStatsSummaryTableId, - tableStatsSummaryTableName: cleanedData.tableStatsSummaryTableName - }, - select: { - apiName: true, - collectDbQueryStatsFunction: true, - collectDbTableStatsFunction: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - queryStatsLogTableId: true, - queryStatsLogTableName: true, - queryStatsSummaryTableId: true, - queryStatsSummaryTableName: true, - retention: true, - rollupDbQueryStatsUsageSummaryFunction: true, - rollupDbTableStatsUsageSummaryFunction: true, - schemaId: true, - scope: true, - tableStatsLogTableId: true, - tableStatsLogTableName: true, - tableStatsSummaryTableId: true, - tableStatsSummaryTableName: true - } - }).execute(); + const result = await client.dbUsageModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + collectDbQueryStatsFunction: cleanedData.collectDbQueryStatsFunction, + collectDbTableStatsFunction: cleanedData.collectDbTableStatsFunction, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + queryStatsLogTableId: cleanedData.queryStatsLogTableId, + queryStatsLogTableName: cleanedData.queryStatsLogTableName, + queryStatsSummaryTableId: cleanedData.queryStatsSummaryTableId, + queryStatsSummaryTableName: cleanedData.queryStatsSummaryTableName, + retention: cleanedData.retention, + rollupDbQueryStatsUsageSummaryFunction: + cleanedData.rollupDbQueryStatsUsageSummaryFunction, + rollupDbTableStatsUsageSummaryFunction: + cleanedData.rollupDbTableStatsUsageSummaryFunction, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableStatsLogTableId: cleanedData.tableStatsLogTableId, + tableStatsLogTableName: cleanedData.tableStatsLogTableName, + tableStatsSummaryTableId: cleanedData.tableStatsSummaryTableId, + tableStatsSummaryTableName: cleanedData.tableStatsSummaryTableName, + }, + select: { + apiName: true, + collectDbQueryStatsFunction: true, + collectDbTableStatsFunction: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + queryStatsLogTableId: true, + queryStatsLogTableName: true, + queryStatsSummaryTableId: true, + queryStatsSummaryTableName: true, + retention: true, + rollupDbQueryStatsUsageSummaryFunction: true, + rollupDbTableStatsUsageSummaryFunction: true, + schemaId: true, + scope: true, + tableStatsLogTableId: true, + tableStatsLogTableName: true, + tableStatsSummaryTableId: true, + tableStatsSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -684,28 +772,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.dbUsageModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.dbUsageModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/default-ids-module.ts b/sdk/constructive-cli/src/modules/cli/commands/default-ids-module.ts index cae401e44d..bff184512d 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/default-ids-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/default-ids-module.ts @@ -3,50 +3,64 @@ * @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 { CreateDefaultIdsModuleInput, DefaultIdsModulePatch, DefaultIdsModuleSelect, DefaultIdsModuleFilter, DefaultIdsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDefaultIdsModuleInput, + DefaultIdsModulePatch, + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - id: "uuid" + databaseId: 'uuid', + id: 'uuid', }; -const usage = "\ndefault-ids-module \n\nCommands:\n list List defaultIdsModule records\n find-first Find first matching defaultIdsModule record\n get Get a defaultIdsModule by ID\n create Create a new defaultIdsModule\n update Update an existing defaultIdsModule\n delete Delete a defaultIdsModule\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) => { +const usage = + '\ndefault-ids-module \n\nCommands:\n list List defaultIdsModule records\n find-first Find first matching defaultIdsModule record\n get Get a defaultIdsModule by ID\n create Create a new defaultIdsModule\n update Update an existing defaultIdsModule\n delete Delete a defaultIdsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -57,16 +71,18 @@ async function handleList(argv: Partial>, _prompter: Inq try { const defaultSelect = { databaseId: true, - id: true + id: true, }; - const findManyArgs = parseFindManyArgs & { - select: DefaultIdsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DefaultIdsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.defaultIdsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -77,16 +93,18 @@ async function handleFindFirst(argv: Partial>, _prompter try { const defaultSelect = { databaseId: true, - id: true + id: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DefaultIdsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DefaultIdsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.defaultIdsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -95,23 +113,27 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.defaultIdsModule.findOne({ - id: answers.id as string, - select: { - databaseId: true, - id: true - } - }).execute(); + const result = await client.defaultIdsModule + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -120,27 +142,34 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDefaultIdsModuleInput["defaultIdsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDefaultIdsModuleInput['defaultIdsModule']; const client = getClient(); - const result = await client.defaultIdsModule.create({ - data: { - databaseId: cleanedData.databaseId - }, - select: { - databaseId: true, - id: true - } - }).execute(); + const result = await client.defaultIdsModule + .create({ + data: { + databaseId: cleanedData.databaseId, + }, + select: { + databaseId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,35 +178,40 @@ async function handleCreate(argv: Partial>, prompter: In } 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 - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DefaultIdsModulePatch; const client = getClient(); - const result = await client.defaultIdsModule.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId - }, - select: { - databaseId: true, - id: true - } - }).execute(); + const result = await client.defaultIdsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + }, + select: { + databaseId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -186,28 +220,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.defaultIdsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.defaultIdsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/denormalized-table-field.ts b/sdk/constructive-cli/src/modules/cli/commands/denormalized-table-field.ts index a42afae629..139dfdcf5b 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/denormalized-table-field.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/denormalized-table-field.ts @@ -3,60 +3,74 @@ * @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 { CreateDenormalizedTableFieldInput, DenormalizedTableFieldPatch, DenormalizedTableFieldSelect, DenormalizedTableFieldFilter, DenormalizedTableFieldOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDenormalizedTableFieldInput, + DenormalizedTableFieldPatch, + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - fieldId: "uuid", - funcName: "string", - funcOrder: "int", - id: "uuid", - refFieldId: "uuid", - refIds: "uuid", - refTableId: "uuid", - setIds: "uuid", - tableId: "uuid", - updateDefaults: "boolean", - useUpdates: "boolean" + databaseId: 'uuid', + fieldId: 'uuid', + funcName: 'string', + funcOrder: 'int', + id: 'uuid', + refFieldId: 'uuid', + refIds: 'uuid', + refTableId: 'uuid', + setIds: 'uuid', + tableId: 'uuid', + updateDefaults: 'boolean', + useUpdates: 'boolean', }; -const usage = "\ndenormalized-table-field \n\nCommands:\n list List denormalizedTableField records\n find-first Find first matching denormalizedTableField record\n get Get a denormalizedTableField by ID\n create Create a new denormalizedTableField\n update Update an existing denormalizedTableField\n delete Delete a denormalizedTableField\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) => { +const usage = + '\ndenormalized-table-field \n\nCommands:\n list List denormalizedTableField records\n find-first Find first matching denormalizedTableField record\n get Get a denormalizedTableField by ID\n create Create a new denormalizedTableField\n update Update an existing denormalizedTableField\n delete Delete a denormalizedTableField\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -77,16 +91,22 @@ async function handleList(argv: Partial>, _prompter: Inq setIds: true, tableId: true, updateDefaults: true, - useUpdates: true + useUpdates: true, }; - const findManyArgs = parseFindManyArgs & { - select: DenormalizedTableFieldSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy + > & { + select: DenormalizedTableFieldSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.denormalizedTableField.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -107,16 +127,22 @@ async function handleFindFirst(argv: Partial>, _prompter setIds: true, tableId: true, updateDefaults: true, - useUpdates: true + useUpdates: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DenormalizedTableFieldSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy + > & { + select: DenormalizedTableFieldSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.denormalizedTableField.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -125,33 +151,37 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.denormalizedTableField.findOne({ - id: answers.id as string, - select: { - databaseId: true, - fieldId: true, - funcName: true, - funcOrder: true, - id: true, - refFieldId: true, - refIds: true, - refTableId: true, - setIds: true, - tableId: true, - updateDefaults: true, - useUpdates: true - } - }).execute(); + const result = await client.denormalizedTableField + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + fieldId: true, + funcName: true, + funcOrder: true, + id: true, + refFieldId: true, + refIds: true, + refTableId: true, + setIds: true, + tableId: true, + updateDefaults: true, + useUpdates: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -160,103 +190,120 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "fieldId", - message: "fieldId", - required: true - }, { - type: "text", - name: "funcName", - message: "funcName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "funcOrder", - message: "funcOrder", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refFieldId", - message: "refFieldId", - required: true - }, { - type: "text", - name: "refIds", - message: "refIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refTableId", - message: "refTableId", - required: true - }, { - type: "text", - name: "setIds", - message: "setIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: true - }, { - type: "boolean", - name: "updateDefaults", - message: "updateDefaults", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "useUpdates", - message: "useUpdates", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'fieldId', + message: 'fieldId', + required: true, + }, + { + type: 'text', + name: 'funcName', + message: 'funcName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'funcOrder', + message: 'funcOrder', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refFieldId', + message: 'refFieldId', + required: true, + }, + { + type: 'text', + name: 'refIds', + message: 'refIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refTableId', + message: 'refTableId', + required: true, + }, + { + type: 'text', + name: 'setIds', + message: 'setIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: true, + }, + { + type: 'boolean', + name: 'updateDefaults', + message: 'updateDefaults', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'useUpdates', + message: 'useUpdates', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDenormalizedTableFieldInput["denormalizedTableField"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDenormalizedTableFieldInput['denormalizedTableField']; const client = getClient(); - const result = await client.denormalizedTableField.create({ - data: { - databaseId: cleanedData.databaseId, - fieldId: cleanedData.fieldId, - funcName: cleanedData.funcName, - funcOrder: cleanedData.funcOrder, - refFieldId: cleanedData.refFieldId, - refIds: cleanedData.refIds, - refTableId: cleanedData.refTableId, - setIds: cleanedData.setIds, - tableId: cleanedData.tableId, - updateDefaults: cleanedData.updateDefaults, - useUpdates: cleanedData.useUpdates - }, - select: { - databaseId: true, - fieldId: true, - funcName: true, - funcOrder: true, - id: true, - refFieldId: true, - refIds: true, - refTableId: true, - setIds: true, - tableId: true, - updateDefaults: true, - useUpdates: true - } - }).execute(); + const result = await client.denormalizedTableField + .create({ + data: { + databaseId: cleanedData.databaseId, + fieldId: cleanedData.fieldId, + funcName: cleanedData.funcName, + funcOrder: cleanedData.funcOrder, + refFieldId: cleanedData.refFieldId, + refIds: cleanedData.refIds, + refTableId: cleanedData.refTableId, + setIds: cleanedData.setIds, + tableId: cleanedData.tableId, + updateDefaults: cleanedData.updateDefaults, + useUpdates: cleanedData.useUpdates, + }, + select: { + databaseId: true, + fieldId: true, + funcName: true, + funcOrder: true, + id: true, + refFieldId: true, + refIds: true, + refTableId: true, + setIds: true, + tableId: true, + updateDefaults: true, + useUpdates: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -265,111 +312,126 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "fieldId", - message: "fieldId", - required: false - }, { - type: "text", - name: "funcName", - message: "funcName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "funcOrder", - message: "funcOrder", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refFieldId", - message: "refFieldId", - required: false - }, { - type: "text", - name: "refIds", - message: "refIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refTableId", - message: "refTableId", - required: false - }, { - type: "text", - name: "setIds", - message: "setIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false - }, { - type: "boolean", - name: "updateDefaults", - message: "updateDefaults", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "useUpdates", - message: "useUpdates", - required: false, - skipPrompt: true - }]); + 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: 'fieldId', + message: 'fieldId', + required: false, + }, + { + type: 'text', + name: 'funcName', + message: 'funcName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'funcOrder', + message: 'funcOrder', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refFieldId', + message: 'refFieldId', + required: false, + }, + { + type: 'text', + name: 'refIds', + message: 'refIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refTableId', + message: 'refTableId', + required: false, + }, + { + type: 'text', + name: 'setIds', + message: 'setIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + }, + { + type: 'boolean', + name: 'updateDefaults', + message: 'updateDefaults', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'useUpdates', + message: 'useUpdates', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DenormalizedTableFieldPatch; const client = getClient(); - const result = await client.denormalizedTableField.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - fieldId: cleanedData.fieldId, - funcName: cleanedData.funcName, - funcOrder: cleanedData.funcOrder, - refFieldId: cleanedData.refFieldId, - refIds: cleanedData.refIds, - refTableId: cleanedData.refTableId, - setIds: cleanedData.setIds, - tableId: cleanedData.tableId, - updateDefaults: cleanedData.updateDefaults, - useUpdates: cleanedData.useUpdates - }, - select: { - databaseId: true, - fieldId: true, - funcName: true, - funcOrder: true, - id: true, - refFieldId: true, - refIds: true, - refTableId: true, - setIds: true, - tableId: true, - updateDefaults: true, - useUpdates: true - } - }).execute(); + const result = await client.denormalizedTableField + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + fieldId: cleanedData.fieldId, + funcName: cleanedData.funcName, + funcOrder: cleanedData.funcOrder, + refFieldId: cleanedData.refFieldId, + refIds: cleanedData.refIds, + refTableId: cleanedData.refTableId, + setIds: cleanedData.setIds, + tableId: cleanedData.tableId, + updateDefaults: cleanedData.updateDefaults, + useUpdates: cleanedData.useUpdates, + }, + select: { + databaseId: true, + fieldId: true, + funcName: true, + funcOrder: true, + id: true, + refFieldId: true, + refIds: true, + refTableId: true, + setIds: true, + tableId: true, + updateDefaults: true, + useUpdates: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -378,28 +440,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.denormalizedTableField.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.denormalizedTableField + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/devices-module.ts b/sdk/constructive-cli/src/modules/cli/commands/devices-module.ts index 89df3f3ff9..9341688bd5 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/devices-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/devices-module.ts @@ -3,55 +3,69 @@ * @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 { CreateDevicesModuleInput, DevicesModulePatch, DevicesModuleSelect, DevicesModuleFilter, DevicesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDevicesModuleInput, + DevicesModulePatch, + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - deviceSettingsTableId: "uuid", - deviceSettingsTableName: "string", - id: "uuid", - schemaId: "uuid", - userDevicesTableId: "uuid", - userDevicesTableName: "string" + databaseId: 'uuid', + deviceSettingsTableId: 'uuid', + deviceSettingsTableName: 'string', + id: 'uuid', + schemaId: 'uuid', + userDevicesTableId: 'uuid', + userDevicesTableName: 'string', }; -const usage = "\ndevices-module \n\nCommands:\n list List devicesModule records\n find-first Find first matching devicesModule record\n get Get a devicesModule by ID\n create Create a new devicesModule\n update Update an existing devicesModule\n delete Delete a devicesModule\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) => { +const usage = + '\ndevices-module \n\nCommands:\n list List devicesModule records\n find-first Find first matching devicesModule record\n get Get a devicesModule by ID\n create Create a new devicesModule\n update Update an existing devicesModule\n delete Delete a devicesModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, schemaId: true, userDevicesTableId: true, - userDevicesTableName: true + userDevicesTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: DevicesModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DevicesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.devicesModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, schemaId: true, userDevicesTableId: true, - userDevicesTableName: true + userDevicesTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DevicesModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DevicesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.devicesModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.devicesModule.findOne({ - id: answers.id as string, - select: { - databaseId: true, - deviceSettingsTableId: true, - deviceSettingsTableName: true, - id: true, - schemaId: true, - userDevicesTableId: true, - userDevicesTableName: true - } - }).execute(); + const result = await client.devicesModule + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + deviceSettingsTableId: true, + deviceSettingsTableName: true, + id: true, + schemaId: true, + userDevicesTableId: true, + userDevicesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,67 +162,79 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "deviceSettingsTableId", - message: "deviceSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deviceSettingsTableName", - message: "deviceSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userDevicesTableId", - message: "userDevicesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userDevicesTableName", - message: "userDevicesTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'deviceSettingsTableId', + message: 'deviceSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deviceSettingsTableName', + message: 'deviceSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userDevicesTableId', + message: 'userDevicesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userDevicesTableName', + message: 'userDevicesTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDevicesModuleInput["devicesModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDevicesModuleInput['devicesModule']; const client = getClient(); - const result = await client.devicesModule.create({ - data: { - databaseId: cleanedData.databaseId, - deviceSettingsTableId: cleanedData.deviceSettingsTableId, - deviceSettingsTableName: cleanedData.deviceSettingsTableName, - schemaId: cleanedData.schemaId, - userDevicesTableId: cleanedData.userDevicesTableId, - userDevicesTableName: cleanedData.userDevicesTableName - }, - select: { - databaseId: true, - deviceSettingsTableId: true, - deviceSettingsTableName: true, - id: true, - schemaId: true, - userDevicesTableId: true, - userDevicesTableName: true - } - }).execute(); + const result = await client.devicesModule + .create({ + data: { + databaseId: cleanedData.databaseId, + deviceSettingsTableId: cleanedData.deviceSettingsTableId, + deviceSettingsTableName: cleanedData.deviceSettingsTableName, + schemaId: cleanedData.schemaId, + userDevicesTableId: cleanedData.userDevicesTableId, + userDevicesTableName: cleanedData.userDevicesTableName, + }, + select: { + databaseId: true, + deviceSettingsTableId: true, + deviceSettingsTableName: true, + id: true, + schemaId: true, + userDevicesTableId: true, + userDevicesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -209,75 +243,85 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "deviceSettingsTableId", - message: "deviceSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deviceSettingsTableName", - message: "deviceSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userDevicesTableId", - message: "userDevicesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userDevicesTableName", - message: "userDevicesTableName", - required: false, - skipPrompt: true - }]); + 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: 'deviceSettingsTableId', + message: 'deviceSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deviceSettingsTableName', + message: 'deviceSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userDevicesTableId', + message: 'userDevicesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userDevicesTableName', + message: 'userDevicesTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DevicesModulePatch; const client = getClient(); - const result = await client.devicesModule.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - deviceSettingsTableId: cleanedData.deviceSettingsTableId, - deviceSettingsTableName: cleanedData.deviceSettingsTableName, - schemaId: cleanedData.schemaId, - userDevicesTableId: cleanedData.userDevicesTableId, - userDevicesTableName: cleanedData.userDevicesTableName - }, - select: { - databaseId: true, - deviceSettingsTableId: true, - deviceSettingsTableName: true, - id: true, - schemaId: true, - userDevicesTableId: true, - userDevicesTableName: true - } - }).execute(); + const result = await client.devicesModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + deviceSettingsTableId: cleanedData.deviceSettingsTableId, + deviceSettingsTableName: cleanedData.deviceSettingsTableName, + schemaId: cleanedData.schemaId, + userDevicesTableId: cleanedData.userDevicesTableId, + userDevicesTableName: cleanedData.userDevicesTableName, + }, + select: { + databaseId: true, + deviceSettingsTableId: true, + deviceSettingsTableName: true, + id: true, + schemaId: true, + userDevicesTableId: true, + userDevicesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -286,28 +330,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.devicesModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.devicesModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/domain-module.ts b/sdk/constructive-cli/src/modules/cli/commands/domain-module.ts index 38d436f698..7022a32c40 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/domain-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/domain-module.ts @@ -3,72 +3,86 @@ * @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 { CreateDomainModuleInput, DomainModulePatch, DomainModuleSelect, DomainModuleFilter, DomainModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateDomainModuleInput, + DomainModulePatch, + DomainModuleSelect, + DomainModuleFilter, + DomainModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - catalogModuleId: "uuid", - databaseId: "uuid", - defaultPermissions: "string", - domainEventsTableId: "uuid", - domainEventsTableName: "string", - domainVerificationsTableId: "uuid", - domainVerificationsTableName: "string", - domainsTableId: "uuid", - domainsTableName: "string", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - managedDomainsTableId: "uuid", - managedDomainsTableName: "string", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + catalogModuleId: 'uuid', + databaseId: 'uuid', + defaultPermissions: 'string', + domainEventsTableId: 'uuid', + domainEventsTableName: 'string', + domainVerificationsTableId: 'uuid', + domainVerificationsTableName: 'string', + domainsTableId: 'uuid', + domainsTableName: 'string', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + managedDomainsTableId: 'uuid', + managedDomainsTableName: 'string', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\ndomain-module \n\nCommands:\n list List domainModule records\n find-first Find first matching domainModule record\n get Get a domainModule by ID\n create Create a new domainModule\n update Update an existing domainModule\n delete Delete a domainModule\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) => { +const usage = + '\ndomain-module \n\nCommands:\n list List domainModule records\n find-first Find first matching domainModule record\n get Get a domainModule by ID\n create Create a new domainModule\n update Update an existing domainModule\n delete Delete a domainModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -101,16 +115,18 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: DomainModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: DomainModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.domainModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -143,16 +159,18 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: DomainModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: DomainModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.domainModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -161,45 +179,49 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.domainModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - domainEventsTableId: true, - domainEventsTableName: true, - domainVerificationsTableId: true, - domainVerificationsTableName: true, - domainsTableId: true, - domainsTableName: true, - entityField: true, - entityTableId: true, - id: true, - managedDomainsTableId: true, - managedDomainsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.domainModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + domainEventsTableId: true, + domainEventsTableName: true, + domainVerificationsTableId: true, + domainVerificationsTableName: true, + domainsTableId: true, + domainsTableName: true, + entityField: true, + entityTableId: true, + id: true, + managedDomainsTableId: true, + managedDomainsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -208,202 +230,231 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainEventsTableId", - message: "domainEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainEventsTableName", - message: "domainEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainVerificationsTableId", - message: "domainVerificationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainVerificationsTableName", - message: "domainVerificationsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainsTableId", - message: "domainsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainsTableName", - message: "domainsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "managedDomainsTableId", - message: "managedDomainsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "managedDomainsTableName", - message: "managedDomainsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainEventsTableId', + message: 'domainEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainEventsTableName', + message: 'domainEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainVerificationsTableId', + message: 'domainVerificationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainVerificationsTableName', + message: 'domainVerificationsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainsTableId', + message: 'domainsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainsTableName', + message: 'domainsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'managedDomainsTableId', + message: 'managedDomainsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'managedDomainsTableName', + message: 'managedDomainsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateDomainModuleInput["domainModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateDomainModuleInput['domainModule']; const client = getClient(); - const result = await client.domainModule.create({ - data: { - apiName: cleanedData.apiName, - catalogModuleId: cleanedData.catalogModuleId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - domainEventsTableId: cleanedData.domainEventsTableId, - domainEventsTableName: cleanedData.domainEventsTableName, - domainVerificationsTableId: cleanedData.domainVerificationsTableId, - domainVerificationsTableName: cleanedData.domainVerificationsTableName, - domainsTableId: cleanedData.domainsTableId, - domainsTableName: cleanedData.domainsTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - managedDomainsTableId: cleanedData.managedDomainsTableId, - managedDomainsTableName: cleanedData.managedDomainsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - domainEventsTableId: true, - domainEventsTableName: true, - domainVerificationsTableId: true, - domainVerificationsTableName: true, - domainsTableId: true, - domainsTableName: true, - entityField: true, - entityTableId: true, - id: true, - managedDomainsTableId: true, - managedDomainsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.domainModule + .create({ + data: { + apiName: cleanedData.apiName, + catalogModuleId: cleanedData.catalogModuleId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + domainEventsTableId: cleanedData.domainEventsTableId, + domainEventsTableName: cleanedData.domainEventsTableName, + domainVerificationsTableId: cleanedData.domainVerificationsTableId, + domainVerificationsTableName: cleanedData.domainVerificationsTableName, + domainsTableId: cleanedData.domainsTableId, + domainsTableName: cleanedData.domainsTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + managedDomainsTableId: cleanedData.managedDomainsTableId, + managedDomainsTableName: cleanedData.managedDomainsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + domainEventsTableId: true, + domainEventsTableName: true, + domainVerificationsTableId: true, + domainVerificationsTableName: true, + domainsTableId: true, + domainsTableName: true, + entityField: true, + entityTableId: true, + id: true, + managedDomainsTableId: true, + managedDomainsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -412,210 +463,237 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainEventsTableId", - message: "domainEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainEventsTableName", - message: "domainEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainVerificationsTableId", - message: "domainVerificationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainVerificationsTableName", - message: "domainVerificationsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainsTableId", - message: "domainsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainsTableName", - message: "domainsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "managedDomainsTableId", - message: "managedDomainsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "managedDomainsTableName", - message: "managedDomainsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainEventsTableId', + message: 'domainEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainEventsTableName', + message: 'domainEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainVerificationsTableId', + message: 'domainVerificationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainVerificationsTableName', + message: 'domainVerificationsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainsTableId', + message: 'domainsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainsTableName', + message: 'domainsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'managedDomainsTableId', + message: 'managedDomainsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'managedDomainsTableName', + message: 'managedDomainsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as DomainModulePatch; const client = getClient(); - const result = await client.domainModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - catalogModuleId: cleanedData.catalogModuleId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - domainEventsTableId: cleanedData.domainEventsTableId, - domainEventsTableName: cleanedData.domainEventsTableName, - domainVerificationsTableId: cleanedData.domainVerificationsTableId, - domainVerificationsTableName: cleanedData.domainVerificationsTableName, - domainsTableId: cleanedData.domainsTableId, - domainsTableName: cleanedData.domainsTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - managedDomainsTableId: cleanedData.managedDomainsTableId, - managedDomainsTableName: cleanedData.managedDomainsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - domainEventsTableId: true, - domainEventsTableName: true, - domainVerificationsTableId: true, - domainVerificationsTableName: true, - domainsTableId: true, - domainsTableName: true, - entityField: true, - entityTableId: true, - id: true, - managedDomainsTableId: true, - managedDomainsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.domainModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + catalogModuleId: cleanedData.catalogModuleId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + domainEventsTableId: cleanedData.domainEventsTableId, + domainEventsTableName: cleanedData.domainEventsTableName, + domainVerificationsTableId: cleanedData.domainVerificationsTableId, + domainVerificationsTableName: cleanedData.domainVerificationsTableName, + domainsTableId: cleanedData.domainsTableId, + domainsTableName: cleanedData.domainsTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + managedDomainsTableId: cleanedData.managedDomainsTableId, + managedDomainsTableName: cleanedData.managedDomainsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + domainEventsTableId: true, + domainEventsTableName: true, + domainVerificationsTableId: true, + domainVerificationsTableName: true, + domainsTableId: true, + domainsTableName: true, + entityField: true, + entityTableId: true, + id: true, + managedDomainsTableId: true, + managedDomainsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -624,28 +702,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.domainModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.domainModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/emails-module.ts b/sdk/constructive-cli/src/modules/cli/commands/emails-module.ts index 3f7fb689b1..5fe890fb51 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/emails-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/emails-module.ts @@ -3,57 +3,71 @@ * @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 { CreateEmailsModuleInput, EmailsModulePatch, EmailsModuleSelect, EmailsModuleFilter, EmailsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateEmailsModuleInput, + EmailsModulePatch, + EmailsModuleSelect, + EmailsModuleFilter, + EmailsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - id: "uuid", - ownerTableId: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + apiName: 'string', + databaseId: 'uuid', + id: 'uuid', + ownerTableId: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nemails-module \n\nCommands:\n list List emailsModule records\n find-first Find first matching emailsModule record\n get Get a emailsModule by ID\n create Create a new emailsModule\n update Update an existing emailsModule\n delete Delete a emailsModule\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) => { +const usage = + '\nemails-module \n\nCommands:\n list List emailsModule records\n find-first Find first matching emailsModule record\n get Get a emailsModule by ID\n create Create a new emailsModule\n update Update an existing emailsModule\n delete Delete a emailsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: EmailsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: EmailsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.emailsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: EmailsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: EmailsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.emailsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.emailsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.emailsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +170,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateEmailsModuleInput["emailsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateEmailsModuleInput['emailsModule']; const client = getClient(); - const result = await client.emailsModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.emailsModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +268,102 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as EmailsModulePatch; const client = getClient(); - const result = await client.emailsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.emailsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,28 +372,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.emailsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.emailsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/entity-type-provision.ts b/sdk/constructive-cli/src/modules/cli/commands/entity-type-provision.ts index 6655b245bd..3f41fec702 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/entity-type-provision.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/entity-type-provision.ts @@ -3,87 +3,101 @@ * @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 { CreateEntityTypeProvisionInput, EntityTypeProvisionPatch, EntityTypeProvisionSelect, EntityTypeProvisionFilter, EntityTypeProvisionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateEntityTypeProvisionInput, + EntityTypeProvisionPatch, + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - agents: "json", - databaseId: "uuid", - description: "string", - functions: "json", - graphs: "json", - hasInviteAchievements: "boolean", - hasInvites: "boolean", - hasLevels: "boolean", - hasLimits: "boolean", - hasProfiles: "boolean", - id: "uuid", - isVisible: "boolean", - name: "string", - namespaces: "json", - outAgentModuleId: "uuid", - outBucketsTableId: "uuid", - outDefinitionsTableId: "uuid", - outEntityTableId: "uuid", - outEntityTableName: "string", - outExecutionLogsTableId: "uuid", - outFilesTableId: "uuid", - outFunctionModuleId: "uuid", - outGraphModuleId: "uuid", - outGraphsTableId: "uuid", - outInstalledModules: "string", - outInvitesModuleId: "uuid", - outInvocationsTableId: "uuid", - outMembershipType: "int", - outNamespaceEventsTableId: "uuid", - outNamespaceModuleId: "uuid", - outNamespacesTableId: "uuid", - outPathSharesTableId: "uuid", - outStorageModuleId: "uuid", - parentEntity: "string", - prefix: "string", - skipEntityPolicies: "boolean", - storage: "json", - tableName: "string", - tableProvision: "json" + agents: 'json', + databaseId: 'uuid', + description: 'string', + functions: 'json', + graphs: 'json', + hasInviteAchievements: 'boolean', + hasInvites: 'boolean', + hasLevels: 'boolean', + hasLimits: 'boolean', + hasProfiles: 'boolean', + id: 'uuid', + isVisible: 'boolean', + name: 'string', + namespaces: 'json', + outAgentModuleId: 'uuid', + outBucketsTableId: 'uuid', + outDefinitionsTableId: 'uuid', + outEntityTableId: 'uuid', + outEntityTableName: 'string', + outExecutionLogsTableId: 'uuid', + outFilesTableId: 'uuid', + outFunctionModuleId: 'uuid', + outGraphModuleId: 'uuid', + outGraphsTableId: 'uuid', + outInstalledModules: 'string', + outInvitesModuleId: 'uuid', + outInvocationsTableId: 'uuid', + outMembershipType: 'int', + outNamespaceEventsTableId: 'uuid', + outNamespaceModuleId: 'uuid', + outNamespacesTableId: 'uuid', + outPathSharesTableId: 'uuid', + outStorageModuleId: 'uuid', + parentEntity: 'string', + prefix: 'string', + skipEntityPolicies: 'boolean', + storage: 'json', + tableName: 'string', + tableProvision: 'json', }; -const usage = "\nentity-type-provision \n\nCommands:\n list List entityTypeProvision records\n find-first Find first matching entityTypeProvision record\n get Get a entityTypeProvision by ID\n create Create a new entityTypeProvision\n update Update an existing entityTypeProvision\n delete Delete a entityTypeProvision\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) => { +const usage = + '\nentity-type-provision \n\nCommands:\n list List entityTypeProvision records\n find-first Find first matching entityTypeProvision record\n get Get a entityTypeProvision by ID\n create Create a new entityTypeProvision\n update Update an existing entityTypeProvision\n delete Delete a entityTypeProvision\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -131,16 +145,22 @@ async function handleList(argv: Partial>, _prompter: Inq skipEntityPolicies: true, storage: true, tableName: true, - tableProvision: true + tableProvision: true, }; - const findManyArgs = parseFindManyArgs & { - select: EntityTypeProvisionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy + > & { + select: EntityTypeProvisionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.entityTypeProvision.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -188,16 +208,22 @@ async function handleFindFirst(argv: Partial>, _prompter skipEntityPolicies: true, storage: true, tableName: true, - tableProvision: true + tableProvision: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: EntityTypeProvisionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy + > & { + select: EntityTypeProvisionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.entityTypeProvision.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -206,60 +232,64 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.entityTypeProvision.findOne({ - id: answers.id as string, - select: { - agents: true, - databaseId: true, - description: true, - functions: true, - graphs: true, - hasInviteAchievements: true, - hasInvites: true, - hasLevels: true, - hasLimits: true, - hasProfiles: true, - id: true, - isVisible: true, - name: true, - namespaces: true, - outAgentModuleId: true, - outBucketsTableId: true, - outDefinitionsTableId: true, - outEntityTableId: true, - outEntityTableName: true, - outExecutionLogsTableId: true, - outFilesTableId: true, - outFunctionModuleId: true, - outGraphModuleId: true, - outGraphsTableId: true, - outInstalledModules: true, - outInvitesModuleId: true, - outInvocationsTableId: true, - outMembershipType: true, - outNamespaceEventsTableId: true, - outNamespaceModuleId: true, - outNamespacesTableId: true, - outPathSharesTableId: true, - outStorageModuleId: true, - parentEntity: true, - prefix: true, - skipEntityPolicies: true, - storage: true, - tableName: true, - tableProvision: true - } - }).execute(); + const result = await client.entityTypeProvision + .findOne({ + id: answers.id as string, + select: { + agents: true, + databaseId: true, + description: true, + functions: true, + graphs: true, + hasInviteAchievements: true, + hasInvites: true, + hasLevels: true, + hasLimits: true, + hasProfiles: true, + id: true, + isVisible: true, + name: true, + namespaces: true, + outAgentModuleId: true, + outBucketsTableId: true, + outDefinitionsTableId: true, + outEntityTableId: true, + outEntityTableName: true, + outExecutionLogsTableId: true, + outFilesTableId: true, + outFunctionModuleId: true, + outGraphModuleId: true, + outGraphsTableId: true, + outInstalledModules: true, + outInvitesModuleId: true, + outInvocationsTableId: true, + outMembershipType: true, + outNamespaceEventsTableId: true, + outNamespaceModuleId: true, + outNamespacesTableId: true, + outPathSharesTableId: true, + outStorageModuleId: true, + parentEntity: true, + prefix: true, + skipEntityPolicies: true, + storage: true, + tableName: true, + tableProvision: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -268,321 +298,365 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "agents", - message: "agents", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "json", - name: "functions", - message: "functions", - required: false, - skipPrompt: true - }, { - type: "json", - name: "graphs", - message: "graphs", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasInviteAchievements", - message: "hasInviteAchievements", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasInvites", - message: "hasInvites", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasLevels", - message: "hasLevels", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasLimits", - message: "hasLimits", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasProfiles", - message: "hasProfiles", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVisible", - message: "isVisible", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "json", - name: "namespaces", - message: "namespaces", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outAgentModuleId", - message: "outAgentModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outBucketsTableId", - message: "outBucketsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outDefinitionsTableId", - message: "outDefinitionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outEntityTableId", - message: "outEntityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outEntityTableName", - message: "outEntityTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outExecutionLogsTableId", - message: "outExecutionLogsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outFilesTableId", - message: "outFilesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outFunctionModuleId", - message: "outFunctionModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outGraphModuleId", - message: "outGraphModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outGraphsTableId", - message: "outGraphsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outInstalledModules", - message: "outInstalledModules", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outInvitesModuleId", - message: "outInvitesModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outInvocationsTableId", - message: "outInvocationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outMembershipType", - message: "outMembershipType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outNamespaceEventsTableId", - message: "outNamespaceEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outNamespaceModuleId", - message: "outNamespaceModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outNamespacesTableId", - message: "outNamespacesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outPathSharesTableId", - message: "outPathSharesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outStorageModuleId", - message: "outStorageModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentEntity", - message: "parentEntity", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: true - }, { - type: "boolean", - name: "skipEntityPolicies", - message: "skipEntityPolicies", - required: false, - skipPrompt: true - }, { - type: "json", - name: "storage", - message: "storage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "tableProvision", - message: "tableProvision", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'agents', + message: 'agents', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'functions', + message: 'functions', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'graphs', + message: 'graphs', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasInviteAchievements', + message: 'hasInviteAchievements', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasInvites', + message: 'hasInvites', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasLevels', + message: 'hasLevels', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasLimits', + message: 'hasLimits', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasProfiles', + message: 'hasProfiles', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVisible', + message: 'isVisible', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'json', + name: 'namespaces', + message: 'namespaces', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outAgentModuleId', + message: 'outAgentModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outBucketsTableId', + message: 'outBucketsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outDefinitionsTableId', + message: 'outDefinitionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outEntityTableId', + message: 'outEntityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outEntityTableName', + message: 'outEntityTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outExecutionLogsTableId', + message: 'outExecutionLogsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outFilesTableId', + message: 'outFilesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outFunctionModuleId', + message: 'outFunctionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outGraphModuleId', + message: 'outGraphModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outGraphsTableId', + message: 'outGraphsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outInstalledModules', + message: 'outInstalledModules', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outInvitesModuleId', + message: 'outInvitesModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outInvocationsTableId', + message: 'outInvocationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outMembershipType', + message: 'outMembershipType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outNamespaceEventsTableId', + message: 'outNamespaceEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outNamespaceModuleId', + message: 'outNamespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outNamespacesTableId', + message: 'outNamespacesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outPathSharesTableId', + message: 'outPathSharesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outStorageModuleId', + message: 'outStorageModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentEntity', + message: 'parentEntity', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: true, + }, + { + type: 'boolean', + name: 'skipEntityPolicies', + message: 'skipEntityPolicies', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'storage', + message: 'storage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'tableProvision', + message: 'tableProvision', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateEntityTypeProvisionInput["entityTypeProvision"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateEntityTypeProvisionInput['entityTypeProvision']; const client = getClient(); - const result = await client.entityTypeProvision.create({ - data: { - agents: cleanedData.agents, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - functions: cleanedData.functions, - graphs: cleanedData.graphs, - hasInviteAchievements: cleanedData.hasInviteAchievements, - hasInvites: cleanedData.hasInvites, - hasLevels: cleanedData.hasLevels, - hasLimits: cleanedData.hasLimits, - hasProfiles: cleanedData.hasProfiles, - isVisible: cleanedData.isVisible, - name: cleanedData.name, - namespaces: cleanedData.namespaces, - outAgentModuleId: cleanedData.outAgentModuleId, - outBucketsTableId: cleanedData.outBucketsTableId, - outDefinitionsTableId: cleanedData.outDefinitionsTableId, - outEntityTableId: cleanedData.outEntityTableId, - outEntityTableName: cleanedData.outEntityTableName, - outExecutionLogsTableId: cleanedData.outExecutionLogsTableId, - outFilesTableId: cleanedData.outFilesTableId, - outFunctionModuleId: cleanedData.outFunctionModuleId, - outGraphModuleId: cleanedData.outGraphModuleId, - outGraphsTableId: cleanedData.outGraphsTableId, - outInstalledModules: cleanedData.outInstalledModules, - outInvitesModuleId: cleanedData.outInvitesModuleId, - outInvocationsTableId: cleanedData.outInvocationsTableId, - outMembershipType: cleanedData.outMembershipType, - outNamespaceEventsTableId: cleanedData.outNamespaceEventsTableId, - outNamespaceModuleId: cleanedData.outNamespaceModuleId, - outNamespacesTableId: cleanedData.outNamespacesTableId, - outPathSharesTableId: cleanedData.outPathSharesTableId, - outStorageModuleId: cleanedData.outStorageModuleId, - parentEntity: cleanedData.parentEntity, - prefix: cleanedData.prefix, - skipEntityPolicies: cleanedData.skipEntityPolicies, - storage: cleanedData.storage, - tableName: cleanedData.tableName, - tableProvision: cleanedData.tableProvision - }, - select: { - agents: true, - databaseId: true, - description: true, - functions: true, - graphs: true, - hasInviteAchievements: true, - hasInvites: true, - hasLevels: true, - hasLimits: true, - hasProfiles: true, - id: true, - isVisible: true, - name: true, - namespaces: true, - outAgentModuleId: true, - outBucketsTableId: true, - outDefinitionsTableId: true, - outEntityTableId: true, - outEntityTableName: true, - outExecutionLogsTableId: true, - outFilesTableId: true, - outFunctionModuleId: true, - outGraphModuleId: true, - outGraphsTableId: true, - outInstalledModules: true, - outInvitesModuleId: true, - outInvocationsTableId: true, - outMembershipType: true, - outNamespaceEventsTableId: true, - outNamespaceModuleId: true, - outNamespacesTableId: true, - outPathSharesTableId: true, - outStorageModuleId: true, - parentEntity: true, - prefix: true, - skipEntityPolicies: true, - storage: true, - tableName: true, - tableProvision: true - } - }).execute(); + const result = await client.entityTypeProvision + .create({ + data: { + agents: cleanedData.agents, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + functions: cleanedData.functions, + graphs: cleanedData.graphs, + hasInviteAchievements: cleanedData.hasInviteAchievements, + hasInvites: cleanedData.hasInvites, + hasLevels: cleanedData.hasLevels, + hasLimits: cleanedData.hasLimits, + hasProfiles: cleanedData.hasProfiles, + isVisible: cleanedData.isVisible, + name: cleanedData.name, + namespaces: cleanedData.namespaces, + outAgentModuleId: cleanedData.outAgentModuleId, + outBucketsTableId: cleanedData.outBucketsTableId, + outDefinitionsTableId: cleanedData.outDefinitionsTableId, + outEntityTableId: cleanedData.outEntityTableId, + outEntityTableName: cleanedData.outEntityTableName, + outExecutionLogsTableId: cleanedData.outExecutionLogsTableId, + outFilesTableId: cleanedData.outFilesTableId, + outFunctionModuleId: cleanedData.outFunctionModuleId, + outGraphModuleId: cleanedData.outGraphModuleId, + outGraphsTableId: cleanedData.outGraphsTableId, + outInstalledModules: cleanedData.outInstalledModules, + outInvitesModuleId: cleanedData.outInvitesModuleId, + outInvocationsTableId: cleanedData.outInvocationsTableId, + outMembershipType: cleanedData.outMembershipType, + outNamespaceEventsTableId: cleanedData.outNamespaceEventsTableId, + outNamespaceModuleId: cleanedData.outNamespaceModuleId, + outNamespacesTableId: cleanedData.outNamespacesTableId, + outPathSharesTableId: cleanedData.outPathSharesTableId, + outStorageModuleId: cleanedData.outStorageModuleId, + parentEntity: cleanedData.parentEntity, + prefix: cleanedData.prefix, + skipEntityPolicies: cleanedData.skipEntityPolicies, + storage: cleanedData.storage, + tableName: cleanedData.tableName, + tableProvision: cleanedData.tableProvision, + }, + select: { + agents: true, + databaseId: true, + description: true, + functions: true, + graphs: true, + hasInviteAchievements: true, + hasInvites: true, + hasLevels: true, + hasLimits: true, + hasProfiles: true, + id: true, + isVisible: true, + name: true, + namespaces: true, + outAgentModuleId: true, + outBucketsTableId: true, + outDefinitionsTableId: true, + outEntityTableId: true, + outEntityTableName: true, + outExecutionLogsTableId: true, + outFilesTableId: true, + outFunctionModuleId: true, + outGraphModuleId: true, + outGraphsTableId: true, + outInstalledModules: true, + outInvitesModuleId: true, + outInvocationsTableId: true, + outMembershipType: true, + outNamespaceEventsTableId: true, + outNamespaceModuleId: true, + outNamespacesTableId: true, + outPathSharesTableId: true, + outStorageModuleId: true, + parentEntity: true, + prefix: true, + skipEntityPolicies: true, + storage: true, + tableName: true, + tableProvision: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -591,329 +665,371 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "json", - name: "agents", - message: "agents", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "description", - message: "description", - required: false, - skipPrompt: true - }, { - type: "json", - name: "functions", - message: "functions", - required: false, - skipPrompt: true - }, { - type: "json", - name: "graphs", - message: "graphs", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasInviteAchievements", - message: "hasInviteAchievements", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasInvites", - message: "hasInvites", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasLevels", - message: "hasLevels", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasLimits", - message: "hasLimits", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasProfiles", - message: "hasProfiles", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isVisible", - message: "isVisible", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "json", - name: "namespaces", - message: "namespaces", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outAgentModuleId", - message: "outAgentModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outBucketsTableId", - message: "outBucketsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outDefinitionsTableId", - message: "outDefinitionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outEntityTableId", - message: "outEntityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outEntityTableName", - message: "outEntityTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outExecutionLogsTableId", - message: "outExecutionLogsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outFilesTableId", - message: "outFilesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outFunctionModuleId", - message: "outFunctionModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outGraphModuleId", - message: "outGraphModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outGraphsTableId", - message: "outGraphsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outInstalledModules", - message: "outInstalledModules", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outInvitesModuleId", - message: "outInvitesModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outInvocationsTableId", - message: "outInvocationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outMembershipType", - message: "outMembershipType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outNamespaceEventsTableId", - message: "outNamespaceEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outNamespaceModuleId", - message: "outNamespaceModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outNamespacesTableId", - message: "outNamespacesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outPathSharesTableId", - message: "outPathSharesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outStorageModuleId", - message: "outStorageModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentEntity", - message: "parentEntity", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false - }, { - type: "boolean", - name: "skipEntityPolicies", - message: "skipEntityPolicies", - required: false, - skipPrompt: true - }, { - type: "json", - name: "storage", - message: "storage", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "tableProvision", - message: "tableProvision", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'json', + name: 'agents', + message: 'agents', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'functions', + message: 'functions', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'graphs', + message: 'graphs', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasInviteAchievements', + message: 'hasInviteAchievements', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasInvites', + message: 'hasInvites', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasLevels', + message: 'hasLevels', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasLimits', + message: 'hasLimits', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasProfiles', + message: 'hasProfiles', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isVisible', + message: 'isVisible', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'json', + name: 'namespaces', + message: 'namespaces', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outAgentModuleId', + message: 'outAgentModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outBucketsTableId', + message: 'outBucketsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outDefinitionsTableId', + message: 'outDefinitionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outEntityTableId', + message: 'outEntityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outEntityTableName', + message: 'outEntityTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outExecutionLogsTableId', + message: 'outExecutionLogsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outFilesTableId', + message: 'outFilesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outFunctionModuleId', + message: 'outFunctionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outGraphModuleId', + message: 'outGraphModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outGraphsTableId', + message: 'outGraphsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outInstalledModules', + message: 'outInstalledModules', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outInvitesModuleId', + message: 'outInvitesModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outInvocationsTableId', + message: 'outInvocationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outMembershipType', + message: 'outMembershipType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outNamespaceEventsTableId', + message: 'outNamespaceEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outNamespaceModuleId', + message: 'outNamespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outNamespacesTableId', + message: 'outNamespacesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outPathSharesTableId', + message: 'outPathSharesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outStorageModuleId', + message: 'outStorageModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentEntity', + message: 'parentEntity', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + }, + { + type: 'boolean', + name: 'skipEntityPolicies', + message: 'skipEntityPolicies', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'storage', + message: 'storage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'tableProvision', + message: 'tableProvision', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as EntityTypeProvisionPatch; const client = getClient(); - const result = await client.entityTypeProvision.update({ - where: { - id: answers.id as string - }, - data: { - agents: cleanedData.agents, - databaseId: cleanedData.databaseId, - description: cleanedData.description, - functions: cleanedData.functions, - graphs: cleanedData.graphs, - hasInviteAchievements: cleanedData.hasInviteAchievements, - hasInvites: cleanedData.hasInvites, - hasLevels: cleanedData.hasLevels, - hasLimits: cleanedData.hasLimits, - hasProfiles: cleanedData.hasProfiles, - isVisible: cleanedData.isVisible, - name: cleanedData.name, - namespaces: cleanedData.namespaces, - outAgentModuleId: cleanedData.outAgentModuleId, - outBucketsTableId: cleanedData.outBucketsTableId, - outDefinitionsTableId: cleanedData.outDefinitionsTableId, - outEntityTableId: cleanedData.outEntityTableId, - outEntityTableName: cleanedData.outEntityTableName, - outExecutionLogsTableId: cleanedData.outExecutionLogsTableId, - outFilesTableId: cleanedData.outFilesTableId, - outFunctionModuleId: cleanedData.outFunctionModuleId, - outGraphModuleId: cleanedData.outGraphModuleId, - outGraphsTableId: cleanedData.outGraphsTableId, - outInstalledModules: cleanedData.outInstalledModules, - outInvitesModuleId: cleanedData.outInvitesModuleId, - outInvocationsTableId: cleanedData.outInvocationsTableId, - outMembershipType: cleanedData.outMembershipType, - outNamespaceEventsTableId: cleanedData.outNamespaceEventsTableId, - outNamespaceModuleId: cleanedData.outNamespaceModuleId, - outNamespacesTableId: cleanedData.outNamespacesTableId, - outPathSharesTableId: cleanedData.outPathSharesTableId, - outStorageModuleId: cleanedData.outStorageModuleId, - parentEntity: cleanedData.parentEntity, - prefix: cleanedData.prefix, - skipEntityPolicies: cleanedData.skipEntityPolicies, - storage: cleanedData.storage, - tableName: cleanedData.tableName, - tableProvision: cleanedData.tableProvision - }, - select: { - agents: true, - databaseId: true, - description: true, - functions: true, - graphs: true, - hasInviteAchievements: true, - hasInvites: true, - hasLevels: true, - hasLimits: true, - hasProfiles: true, - id: true, - isVisible: true, - name: true, - namespaces: true, - outAgentModuleId: true, - outBucketsTableId: true, - outDefinitionsTableId: true, - outEntityTableId: true, - outEntityTableName: true, - outExecutionLogsTableId: true, - outFilesTableId: true, - outFunctionModuleId: true, - outGraphModuleId: true, - outGraphsTableId: true, - outInstalledModules: true, - outInvitesModuleId: true, - outInvocationsTableId: true, - outMembershipType: true, - outNamespaceEventsTableId: true, - outNamespaceModuleId: true, - outNamespacesTableId: true, - outPathSharesTableId: true, - outStorageModuleId: true, - parentEntity: true, - prefix: true, - skipEntityPolicies: true, - storage: true, - tableName: true, - tableProvision: true - } - }).execute(); + const result = await client.entityTypeProvision + .update({ + where: { + id: answers.id as string, + }, + data: { + agents: cleanedData.agents, + databaseId: cleanedData.databaseId, + description: cleanedData.description, + functions: cleanedData.functions, + graphs: cleanedData.graphs, + hasInviteAchievements: cleanedData.hasInviteAchievements, + hasInvites: cleanedData.hasInvites, + hasLevels: cleanedData.hasLevels, + hasLimits: cleanedData.hasLimits, + hasProfiles: cleanedData.hasProfiles, + isVisible: cleanedData.isVisible, + name: cleanedData.name, + namespaces: cleanedData.namespaces, + outAgentModuleId: cleanedData.outAgentModuleId, + outBucketsTableId: cleanedData.outBucketsTableId, + outDefinitionsTableId: cleanedData.outDefinitionsTableId, + outEntityTableId: cleanedData.outEntityTableId, + outEntityTableName: cleanedData.outEntityTableName, + outExecutionLogsTableId: cleanedData.outExecutionLogsTableId, + outFilesTableId: cleanedData.outFilesTableId, + outFunctionModuleId: cleanedData.outFunctionModuleId, + outGraphModuleId: cleanedData.outGraphModuleId, + outGraphsTableId: cleanedData.outGraphsTableId, + outInstalledModules: cleanedData.outInstalledModules, + outInvitesModuleId: cleanedData.outInvitesModuleId, + outInvocationsTableId: cleanedData.outInvocationsTableId, + outMembershipType: cleanedData.outMembershipType, + outNamespaceEventsTableId: cleanedData.outNamespaceEventsTableId, + outNamespaceModuleId: cleanedData.outNamespaceModuleId, + outNamespacesTableId: cleanedData.outNamespacesTableId, + outPathSharesTableId: cleanedData.outPathSharesTableId, + outStorageModuleId: cleanedData.outStorageModuleId, + parentEntity: cleanedData.parentEntity, + prefix: cleanedData.prefix, + skipEntityPolicies: cleanedData.skipEntityPolicies, + storage: cleanedData.storage, + tableName: cleanedData.tableName, + tableProvision: cleanedData.tableProvision, + }, + select: { + agents: true, + databaseId: true, + description: true, + functions: true, + graphs: true, + hasInviteAchievements: true, + hasInvites: true, + hasLevels: true, + hasLimits: true, + hasProfiles: true, + id: true, + isVisible: true, + name: true, + namespaces: true, + outAgentModuleId: true, + outBucketsTableId: true, + outDefinitionsTableId: true, + outEntityTableId: true, + outEntityTableName: true, + outExecutionLogsTableId: true, + outFilesTableId: true, + outFunctionModuleId: true, + outGraphModuleId: true, + outGraphsTableId: true, + outInstalledModules: true, + outInvitesModuleId: true, + outInvocationsTableId: true, + outMembershipType: true, + outNamespaceEventsTableId: true, + outNamespaceModuleId: true, + outNamespacesTableId: true, + outPathSharesTableId: true, + outStorageModuleId: true, + parentEntity: true, + prefix: true, + skipEntityPolicies: true, + storage: true, + tableName: true, + tableProvision: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -922,28 +1038,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.entityTypeProvision.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.entityTypeProvision + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/events-module.ts b/sdk/constructive-cli/src/modules/cli/commands/events-module.ts index cfd82e976e..0cb0a64829 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/events-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/events-module.ts @@ -3,92 +3,106 @@ * @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 { CreateEventsModuleInput, EventsModulePatch, EventsModuleSelect, EventsModuleFilter, EventsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateEventsModuleInput, + EventsModulePatch, + EventsModuleSelect, + EventsModuleFilter, + EventsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - achievementRewardsTableId: "uuid", - achievementRewardsTableName: "string", - actorTableId: "uuid", - apiName: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - eventAggregatesTableId: "uuid", - eventAggregatesTableName: "string", - eventTypesTableId: "uuid", - eventTypesTableName: "string", - eventsTableId: "uuid", - eventsTableName: "string", - grantAchievement: "string", - id: "uuid", - interval: "string", - levelAchieved: "string", - levelGrantsTableId: "uuid", - levelGrantsTableName: "string", - levelRequirementsTableId: "uuid", - levelRequirementsTableName: "string", - levelsTableId: "uuid", - levelsTableName: "string", - prefix: "string", - premake: "int", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - recordEvent: "string", - removeEvent: "string", - retention: "string", - schemaId: "uuid", - scope: "string", - stepsRequired: "string", - tgAchievementReward: "string", - tgCheckAchievements: "string", - tgEvent: "string", - tgEventBool: "string", - tgEventToggle: "string", - tgEventToggleBool: "string", - tgUpdateAggregates: "string", - upsertAggregate: "string" + achievementRewardsTableId: 'uuid', + achievementRewardsTableName: 'string', + actorTableId: 'uuid', + apiName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + eventAggregatesTableId: 'uuid', + eventAggregatesTableName: 'string', + eventTypesTableId: 'uuid', + eventTypesTableName: 'string', + eventsTableId: 'uuid', + eventsTableName: 'string', + grantAchievement: 'string', + id: 'uuid', + interval: 'string', + levelAchieved: 'string', + levelGrantsTableId: 'uuid', + levelGrantsTableName: 'string', + levelRequirementsTableId: 'uuid', + levelRequirementsTableName: 'string', + levelsTableId: 'uuid', + levelsTableName: 'string', + prefix: 'string', + premake: 'int', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + recordEvent: 'string', + removeEvent: 'string', + retention: 'string', + schemaId: 'uuid', + scope: 'string', + stepsRequired: 'string', + tgAchievementReward: 'string', + tgCheckAchievements: 'string', + tgEvent: 'string', + tgEventBool: 'string', + tgEventToggle: 'string', + tgEventToggleBool: 'string', + tgUpdateAggregates: 'string', + upsertAggregate: 'string', }; -const usage = "\nevents-module \n\nCommands:\n list List eventsModule records\n find-first Find first matching eventsModule record\n get Get a eventsModule by ID\n create Create a new eventsModule\n update Update an existing eventsModule\n delete Delete a eventsModule\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) => { +const usage = + '\nevents-module \n\nCommands:\n list List eventsModule records\n find-first Find first matching eventsModule record\n get Get a eventsModule by ID\n create Create a new eventsModule\n update Update an existing eventsModule\n delete Delete a eventsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -141,16 +155,18 @@ async function handleList(argv: Partial>, _prompter: Inq tgEventToggle: true, tgEventToggleBool: true, tgUpdateAggregates: true, - upsertAggregate: true + upsertAggregate: true, }; - const findManyArgs = parseFindManyArgs & { - select: EventsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: EventsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.eventsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -203,16 +219,18 @@ async function handleFindFirst(argv: Partial>, _prompter tgEventToggle: true, tgEventToggleBool: true, tgUpdateAggregates: true, - upsertAggregate: true + upsertAggregate: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: EventsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: EventsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.eventsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -221,65 +239,69 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.eventsModule.findOne({ - id: answers.id as string, - select: { - achievementRewardsTableId: true, - achievementRewardsTableName: true, - actorTableId: true, - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - eventAggregatesTableId: true, - eventAggregatesTableName: true, - eventTypesTableId: true, - eventTypesTableName: true, - eventsTableId: true, - eventsTableName: true, - grantAchievement: true, - id: true, - interval: true, - levelAchieved: true, - levelGrantsTableId: true, - levelGrantsTableName: true, - levelRequirementsTableId: true, - levelRequirementsTableName: true, - levelsTableId: true, - levelsTableName: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - recordEvent: true, - removeEvent: true, - retention: true, - schemaId: true, - scope: true, - stepsRequired: true, - tgAchievementReward: true, - tgCheckAchievements: true, - tgEvent: true, - tgEventBool: true, - tgEventToggle: true, - tgEventToggleBool: true, - tgUpdateAggregates: true, - upsertAggregate: true - } - }).execute(); + const result = await client.eventsModule + .findOne({ + id: answers.id as string, + select: { + achievementRewardsTableId: true, + achievementRewardsTableName: true, + actorTableId: true, + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + eventAggregatesTableId: true, + eventAggregatesTableName: true, + eventTypesTableId: true, + eventTypesTableName: true, + eventsTableId: true, + eventsTableName: true, + grantAchievement: true, + id: true, + interval: true, + levelAchieved: true, + levelGrantsTableId: true, + levelGrantsTableName: true, + levelRequirementsTableId: true, + levelRequirementsTableName: true, + levelsTableId: true, + levelsTableName: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + recordEvent: true, + removeEvent: true, + retention: true, + schemaId: true, + scope: true, + stepsRequired: true, + tgAchievementReward: true, + tgCheckAchievements: true, + tgEvent: true, + tgEventBool: true, + tgEventToggle: true, + tgEventToggleBool: true, + tgUpdateAggregates: true, + upsertAggregate: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -288,362 +310,411 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "achievementRewardsTableId", - message: "achievementRewardsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "achievementRewardsTableName", - message: "achievementRewardsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventAggregatesTableId", - message: "eventAggregatesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventAggregatesTableName", - message: "eventAggregatesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventTypesTableId", - message: "eventTypesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventTypesTableName", - message: "eventTypesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventsTableId", - message: "eventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventsTableName", - message: "eventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantAchievement", - message: "grantAchievement", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelAchieved", - message: "levelAchieved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelGrantsTableId", - message: "levelGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelGrantsTableName", - message: "levelGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelRequirementsTableId", - message: "levelRequirementsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelRequirementsTableName", - message: "levelRequirementsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelsTableId", - message: "levelsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelsTableName", - message: "levelsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordEvent", - message: "recordEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "removeEvent", - message: "removeEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "stepsRequired", - message: "stepsRequired", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgAchievementReward", - message: "tgAchievementReward", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgCheckAchievements", - message: "tgCheckAchievements", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgEvent", - message: "tgEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgEventBool", - message: "tgEventBool", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgEventToggle", - message: "tgEventToggle", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgEventToggleBool", - message: "tgEventToggleBool", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgUpdateAggregates", - message: "tgUpdateAggregates", - required: false, - skipPrompt: true - }, { - type: "text", - name: "upsertAggregate", - message: "upsertAggregate", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'achievementRewardsTableId', + message: 'achievementRewardsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'achievementRewardsTableName', + message: 'achievementRewardsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventAggregatesTableId', + message: 'eventAggregatesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventAggregatesTableName', + message: 'eventAggregatesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventTypesTableId', + message: 'eventTypesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventTypesTableName', + message: 'eventTypesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventsTableId', + message: 'eventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventsTableName', + message: 'eventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantAchievement', + message: 'grantAchievement', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelAchieved', + message: 'levelAchieved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelGrantsTableId', + message: 'levelGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelGrantsTableName', + message: 'levelGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelRequirementsTableId', + message: 'levelRequirementsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelRequirementsTableName', + message: 'levelRequirementsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelsTableId', + message: 'levelsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelsTableName', + message: 'levelsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordEvent', + message: 'recordEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'removeEvent', + message: 'removeEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'stepsRequired', + message: 'stepsRequired', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgAchievementReward', + message: 'tgAchievementReward', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgCheckAchievements', + message: 'tgCheckAchievements', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgEvent', + message: 'tgEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgEventBool', + message: 'tgEventBool', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgEventToggle', + message: 'tgEventToggle', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgEventToggleBool', + message: 'tgEventToggleBool', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgUpdateAggregates', + message: 'tgUpdateAggregates', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'upsertAggregate', + message: 'upsertAggregate', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateEventsModuleInput["eventsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateEventsModuleInput['eventsModule']; const client = getClient(); - const result = await client.eventsModule.create({ - data: { - achievementRewardsTableId: cleanedData.achievementRewardsTableId, - achievementRewardsTableName: cleanedData.achievementRewardsTableName, - actorTableId: cleanedData.actorTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - eventAggregatesTableId: cleanedData.eventAggregatesTableId, - eventAggregatesTableName: cleanedData.eventAggregatesTableName, - eventTypesTableId: cleanedData.eventTypesTableId, - eventTypesTableName: cleanedData.eventTypesTableName, - eventsTableId: cleanedData.eventsTableId, - eventsTableName: cleanedData.eventsTableName, - grantAchievement: cleanedData.grantAchievement, - interval: cleanedData.interval, - levelAchieved: cleanedData.levelAchieved, - levelGrantsTableId: cleanedData.levelGrantsTableId, - levelGrantsTableName: cleanedData.levelGrantsTableName, - levelRequirementsTableId: cleanedData.levelRequirementsTableId, - levelRequirementsTableName: cleanedData.levelRequirementsTableName, - levelsTableId: cleanedData.levelsTableId, - levelsTableName: cleanedData.levelsTableName, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - recordEvent: cleanedData.recordEvent, - removeEvent: cleanedData.removeEvent, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - stepsRequired: cleanedData.stepsRequired, - tgAchievementReward: cleanedData.tgAchievementReward, - tgCheckAchievements: cleanedData.tgCheckAchievements, - tgEvent: cleanedData.tgEvent, - tgEventBool: cleanedData.tgEventBool, - tgEventToggle: cleanedData.tgEventToggle, - tgEventToggleBool: cleanedData.tgEventToggleBool, - tgUpdateAggregates: cleanedData.tgUpdateAggregates, - upsertAggregate: cleanedData.upsertAggregate - }, - select: { - achievementRewardsTableId: true, - achievementRewardsTableName: true, - actorTableId: true, - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - eventAggregatesTableId: true, - eventAggregatesTableName: true, - eventTypesTableId: true, - eventTypesTableName: true, - eventsTableId: true, - eventsTableName: true, - grantAchievement: true, - id: true, - interval: true, - levelAchieved: true, - levelGrantsTableId: true, - levelGrantsTableName: true, - levelRequirementsTableId: true, - levelRequirementsTableName: true, - levelsTableId: true, - levelsTableName: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - recordEvent: true, - removeEvent: true, - retention: true, - schemaId: true, - scope: true, - stepsRequired: true, - tgAchievementReward: true, - tgCheckAchievements: true, - tgEvent: true, - tgEventBool: true, - tgEventToggle: true, - tgEventToggleBool: true, - tgUpdateAggregates: true, - upsertAggregate: true - } - }).execute(); + const result = await client.eventsModule + .create({ + data: { + achievementRewardsTableId: cleanedData.achievementRewardsTableId, + achievementRewardsTableName: cleanedData.achievementRewardsTableName, + actorTableId: cleanedData.actorTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + eventAggregatesTableId: cleanedData.eventAggregatesTableId, + eventAggregatesTableName: cleanedData.eventAggregatesTableName, + eventTypesTableId: cleanedData.eventTypesTableId, + eventTypesTableName: cleanedData.eventTypesTableName, + eventsTableId: cleanedData.eventsTableId, + eventsTableName: cleanedData.eventsTableName, + grantAchievement: cleanedData.grantAchievement, + interval: cleanedData.interval, + levelAchieved: cleanedData.levelAchieved, + levelGrantsTableId: cleanedData.levelGrantsTableId, + levelGrantsTableName: cleanedData.levelGrantsTableName, + levelRequirementsTableId: cleanedData.levelRequirementsTableId, + levelRequirementsTableName: cleanedData.levelRequirementsTableName, + levelsTableId: cleanedData.levelsTableId, + levelsTableName: cleanedData.levelsTableName, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + recordEvent: cleanedData.recordEvent, + removeEvent: cleanedData.removeEvent, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + stepsRequired: cleanedData.stepsRequired, + tgAchievementReward: cleanedData.tgAchievementReward, + tgCheckAchievements: cleanedData.tgCheckAchievements, + tgEvent: cleanedData.tgEvent, + tgEventBool: cleanedData.tgEventBool, + tgEventToggle: cleanedData.tgEventToggle, + tgEventToggleBool: cleanedData.tgEventToggleBool, + tgUpdateAggregates: cleanedData.tgUpdateAggregates, + upsertAggregate: cleanedData.upsertAggregate, + }, + select: { + achievementRewardsTableId: true, + achievementRewardsTableName: true, + actorTableId: true, + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + eventAggregatesTableId: true, + eventAggregatesTableName: true, + eventTypesTableId: true, + eventTypesTableName: true, + eventsTableId: true, + eventsTableName: true, + grantAchievement: true, + id: true, + interval: true, + levelAchieved: true, + levelGrantsTableId: true, + levelGrantsTableName: true, + levelRequirementsTableId: true, + levelRequirementsTableName: true, + levelsTableId: true, + levelsTableName: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + recordEvent: true, + removeEvent: true, + retention: true, + schemaId: true, + scope: true, + stepsRequired: true, + tgAchievementReward: true, + tgCheckAchievements: true, + tgEvent: true, + tgEventBool: true, + tgEventToggle: true, + tgEventToggleBool: true, + tgUpdateAggregates: true, + upsertAggregate: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -652,370 +723,417 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "achievementRewardsTableId", - message: "achievementRewardsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "achievementRewardsTableName", - message: "achievementRewardsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventAggregatesTableId", - message: "eventAggregatesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventAggregatesTableName", - message: "eventAggregatesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventTypesTableId", - message: "eventTypesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventTypesTableName", - message: "eventTypesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventsTableId", - message: "eventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventsTableName", - message: "eventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantAchievement", - message: "grantAchievement", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelAchieved", - message: "levelAchieved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelGrantsTableId", - message: "levelGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelGrantsTableName", - message: "levelGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelRequirementsTableId", - message: "levelRequirementsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelRequirementsTableName", - message: "levelRequirementsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelsTableId", - message: "levelsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "levelsTableName", - message: "levelsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "recordEvent", - message: "recordEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "removeEvent", - message: "removeEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "stepsRequired", - message: "stepsRequired", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgAchievementReward", - message: "tgAchievementReward", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgCheckAchievements", - message: "tgCheckAchievements", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgEvent", - message: "tgEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgEventBool", - message: "tgEventBool", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgEventToggle", - message: "tgEventToggle", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgEventToggleBool", - message: "tgEventToggleBool", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tgUpdateAggregates", - message: "tgUpdateAggregates", - required: false, - skipPrompt: true - }, { - type: "text", - name: "upsertAggregate", - message: "upsertAggregate", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'achievementRewardsTableId', + message: 'achievementRewardsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'achievementRewardsTableName', + message: 'achievementRewardsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventAggregatesTableId', + message: 'eventAggregatesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventAggregatesTableName', + message: 'eventAggregatesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventTypesTableId', + message: 'eventTypesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventTypesTableName', + message: 'eventTypesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventsTableId', + message: 'eventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventsTableName', + message: 'eventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantAchievement', + message: 'grantAchievement', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelAchieved', + message: 'levelAchieved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelGrantsTableId', + message: 'levelGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelGrantsTableName', + message: 'levelGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelRequirementsTableId', + message: 'levelRequirementsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelRequirementsTableName', + message: 'levelRequirementsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelsTableId', + message: 'levelsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'levelsTableName', + message: 'levelsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'recordEvent', + message: 'recordEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'removeEvent', + message: 'removeEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'stepsRequired', + message: 'stepsRequired', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgAchievementReward', + message: 'tgAchievementReward', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgCheckAchievements', + message: 'tgCheckAchievements', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgEvent', + message: 'tgEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgEventBool', + message: 'tgEventBool', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgEventToggle', + message: 'tgEventToggle', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgEventToggleBool', + message: 'tgEventToggleBool', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tgUpdateAggregates', + message: 'tgUpdateAggregates', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'upsertAggregate', + message: 'upsertAggregate', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as EventsModulePatch; const client = getClient(); - const result = await client.eventsModule.update({ - where: { - id: answers.id as string - }, - data: { - achievementRewardsTableId: cleanedData.achievementRewardsTableId, - achievementRewardsTableName: cleanedData.achievementRewardsTableName, - actorTableId: cleanedData.actorTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - eventAggregatesTableId: cleanedData.eventAggregatesTableId, - eventAggregatesTableName: cleanedData.eventAggregatesTableName, - eventTypesTableId: cleanedData.eventTypesTableId, - eventTypesTableName: cleanedData.eventTypesTableName, - eventsTableId: cleanedData.eventsTableId, - eventsTableName: cleanedData.eventsTableName, - grantAchievement: cleanedData.grantAchievement, - interval: cleanedData.interval, - levelAchieved: cleanedData.levelAchieved, - levelGrantsTableId: cleanedData.levelGrantsTableId, - levelGrantsTableName: cleanedData.levelGrantsTableName, - levelRequirementsTableId: cleanedData.levelRequirementsTableId, - levelRequirementsTableName: cleanedData.levelRequirementsTableName, - levelsTableId: cleanedData.levelsTableId, - levelsTableName: cleanedData.levelsTableName, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - recordEvent: cleanedData.recordEvent, - removeEvent: cleanedData.removeEvent, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - stepsRequired: cleanedData.stepsRequired, - tgAchievementReward: cleanedData.tgAchievementReward, - tgCheckAchievements: cleanedData.tgCheckAchievements, - tgEvent: cleanedData.tgEvent, - tgEventBool: cleanedData.tgEventBool, - tgEventToggle: cleanedData.tgEventToggle, - tgEventToggleBool: cleanedData.tgEventToggleBool, - tgUpdateAggregates: cleanedData.tgUpdateAggregates, - upsertAggregate: cleanedData.upsertAggregate - }, - select: { - achievementRewardsTableId: true, - achievementRewardsTableName: true, - actorTableId: true, - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - eventAggregatesTableId: true, - eventAggregatesTableName: true, - eventTypesTableId: true, - eventTypesTableName: true, - eventsTableId: true, - eventsTableName: true, - grantAchievement: true, - id: true, - interval: true, - levelAchieved: true, - levelGrantsTableId: true, - levelGrantsTableName: true, - levelRequirementsTableId: true, - levelRequirementsTableName: true, - levelsTableId: true, - levelsTableName: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - recordEvent: true, - removeEvent: true, - retention: true, - schemaId: true, - scope: true, - stepsRequired: true, - tgAchievementReward: true, - tgCheckAchievements: true, - tgEvent: true, - tgEventBool: true, - tgEventToggle: true, - tgEventToggleBool: true, - tgUpdateAggregates: true, - upsertAggregate: true - } - }).execute(); + const result = await client.eventsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + achievementRewardsTableId: cleanedData.achievementRewardsTableId, + achievementRewardsTableName: cleanedData.achievementRewardsTableName, + actorTableId: cleanedData.actorTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + eventAggregatesTableId: cleanedData.eventAggregatesTableId, + eventAggregatesTableName: cleanedData.eventAggregatesTableName, + eventTypesTableId: cleanedData.eventTypesTableId, + eventTypesTableName: cleanedData.eventTypesTableName, + eventsTableId: cleanedData.eventsTableId, + eventsTableName: cleanedData.eventsTableName, + grantAchievement: cleanedData.grantAchievement, + interval: cleanedData.interval, + levelAchieved: cleanedData.levelAchieved, + levelGrantsTableId: cleanedData.levelGrantsTableId, + levelGrantsTableName: cleanedData.levelGrantsTableName, + levelRequirementsTableId: cleanedData.levelRequirementsTableId, + levelRequirementsTableName: cleanedData.levelRequirementsTableName, + levelsTableId: cleanedData.levelsTableId, + levelsTableName: cleanedData.levelsTableName, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + recordEvent: cleanedData.recordEvent, + removeEvent: cleanedData.removeEvent, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + stepsRequired: cleanedData.stepsRequired, + tgAchievementReward: cleanedData.tgAchievementReward, + tgCheckAchievements: cleanedData.tgCheckAchievements, + tgEvent: cleanedData.tgEvent, + tgEventBool: cleanedData.tgEventBool, + tgEventToggle: cleanedData.tgEventToggle, + tgEventToggleBool: cleanedData.tgEventToggleBool, + tgUpdateAggregates: cleanedData.tgUpdateAggregates, + upsertAggregate: cleanedData.upsertAggregate, + }, + select: { + achievementRewardsTableId: true, + achievementRewardsTableName: true, + actorTableId: true, + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + eventAggregatesTableId: true, + eventAggregatesTableName: true, + eventTypesTableId: true, + eventTypesTableName: true, + eventsTableId: true, + eventsTableName: true, + grantAchievement: true, + id: true, + interval: true, + levelAchieved: true, + levelGrantsTableId: true, + levelGrantsTableName: true, + levelRequirementsTableId: true, + levelRequirementsTableName: true, + levelsTableId: true, + levelsTableName: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + recordEvent: true, + removeEvent: true, + retention: true, + schemaId: true, + scope: true, + stepsRequired: true, + tgAchievementReward: true, + tgCheckAchievements: true, + tgEvent: true, + tgEventBool: true, + tgEventToggle: true, + tgEventToggleBool: true, + tgUpdateAggregates: true, + upsertAggregate: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -1024,28 +1142,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.eventsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.eventsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/function-deployment-module.ts b/sdk/constructive-cli/src/modules/cli/commands/function-deployment-module.ts index 4f50d9e0b9..e2a42ee2b9 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/function-deployment-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/function-deployment-module.ts @@ -3,69 +3,83 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateFunctionDeploymentModuleInput, FunctionDeploymentModulePatch, FunctionDeploymentModuleSelect, FunctionDeploymentModuleFilter, FunctionDeploymentModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionDeploymentModuleInput, + FunctionDeploymentModulePatch, + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - defaultPermissions: "string", - deploymentEventsTableId: "uuid", - deploymentEventsTableName: "string", - deploymentsTableId: "uuid", - deploymentsTableName: "string", - entityField: "string", - entityTableId: "uuid", - functionModuleId: "uuid", - id: "uuid", - namespaceModuleId: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + deploymentEventsTableId: 'uuid', + deploymentEventsTableName: 'string', + deploymentsTableId: 'uuid', + deploymentsTableName: 'string', + entityField: 'string', + entityTableId: 'uuid', + functionModuleId: 'uuid', + id: 'uuid', + namespaceModuleId: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\nfunction-deployment-module \n\nCommands:\n list List functionDeploymentModule records\n find-first Find first matching functionDeploymentModule record\n get Get a functionDeploymentModule by ID\n create Create a new functionDeploymentModule\n update Update an existing functionDeploymentModule\n delete Delete a functionDeploymentModule\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\nfunction-deployment-module \n\nCommands:\n list List functionDeploymentModule records\n find-first Find first matching functionDeploymentModule record\n get Get a functionDeploymentModule by ID\n create Create a new functionDeploymentModule\n update Update an existing functionDeploymentModule\n delete Delete a functionDeploymentModule\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -95,16 +109,22 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionDeploymentModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + > & { + select: FunctionDeploymentModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionDeploymentModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -134,16 +154,22 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionDeploymentModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + > & { + select: FunctionDeploymentModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionDeploymentModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -152,42 +178,46 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionDeploymentModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - deploymentEventsTableId: true, - deploymentEventsTableName: true, - deploymentsTableId: true, - deploymentsTableName: true, - entityField: true, - entityTableId: true, - functionModuleId: true, - id: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionDeploymentModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + deploymentEventsTableId: true, + deploymentEventsTableName: true, + deploymentsTableId: true, + deploymentsTableName: true, + entityField: true, + entityTableId: true, + functionModuleId: true, + id: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -196,178 +226,204 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentEventsTableId", - message: "deploymentEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentEventsTableName", - message: "deploymentEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentsTableId", - message: "deploymentsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentsTableName", - message: "deploymentsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionModuleId", - message: "functionModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceModuleId", - message: "namespaceModuleId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentEventsTableId', + message: 'deploymentEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentEventsTableName', + message: 'deploymentEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentsTableId', + message: 'deploymentsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentsTableName', + message: 'deploymentsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionModuleId', + message: 'functionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceModuleId', + message: 'namespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionDeploymentModuleInput["functionDeploymentModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionDeploymentModuleInput['functionDeploymentModule']; const client = getClient(); - const result = await client.functionDeploymentModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - deploymentEventsTableId: cleanedData.deploymentEventsTableId, - deploymentEventsTableName: cleanedData.deploymentEventsTableName, - deploymentsTableId: cleanedData.deploymentsTableId, - deploymentsTableName: cleanedData.deploymentsTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - functionModuleId: cleanedData.functionModuleId, - namespaceModuleId: cleanedData.namespaceModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - deploymentEventsTableId: true, - deploymentEventsTableName: true, - deploymentsTableId: true, - deploymentsTableName: true, - entityField: true, - entityTableId: true, - functionModuleId: true, - id: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionDeploymentModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + deploymentEventsTableId: cleanedData.deploymentEventsTableId, + deploymentEventsTableName: cleanedData.deploymentEventsTableName, + deploymentsTableId: cleanedData.deploymentsTableId, + deploymentsTableName: cleanedData.deploymentsTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + functionModuleId: cleanedData.functionModuleId, + namespaceModuleId: cleanedData.namespaceModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + deploymentEventsTableId: true, + deploymentEventsTableName: true, + deploymentsTableId: true, + deploymentsTableName: true, + entityField: true, + entityTableId: true, + functionModuleId: true, + id: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -376,186 +432,210 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentEventsTableId", - message: "deploymentEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentEventsTableName", - message: "deploymentEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentsTableId", - message: "deploymentsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deploymentsTableName", - message: "deploymentsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionModuleId", - message: "functionModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceModuleId", - message: "namespaceModuleId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentEventsTableId', + message: 'deploymentEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentEventsTableName', + message: 'deploymentEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentsTableId', + message: 'deploymentsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentsTableName', + message: 'deploymentsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionModuleId', + message: 'functionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceModuleId', + message: 'namespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionDeploymentModulePatch; const client = getClient(); - const result = await client.functionDeploymentModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - deploymentEventsTableId: cleanedData.deploymentEventsTableId, - deploymentEventsTableName: cleanedData.deploymentEventsTableName, - deploymentsTableId: cleanedData.deploymentsTableId, - deploymentsTableName: cleanedData.deploymentsTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - functionModuleId: cleanedData.functionModuleId, - namespaceModuleId: cleanedData.namespaceModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - deploymentEventsTableId: true, - deploymentEventsTableName: true, - deploymentsTableId: true, - deploymentsTableName: true, - entityField: true, - entityTableId: true, - functionModuleId: true, - id: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionDeploymentModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + deploymentEventsTableId: cleanedData.deploymentEventsTableId, + deploymentEventsTableName: cleanedData.deploymentEventsTableName, + deploymentsTableId: cleanedData.deploymentsTableId, + deploymentsTableName: cleanedData.deploymentsTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + functionModuleId: cleanedData.functionModuleId, + namespaceModuleId: cleanedData.namespaceModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + deploymentEventsTableId: true, + deploymentEventsTableName: true, + deploymentsTableId: true, + deploymentsTableName: true, + entityField: true, + entityTableId: true, + functionModuleId: true, + id: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -564,28 +644,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.functionDeploymentModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionDeploymentModule + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/function-invocation-module.ts b/sdk/constructive-cli/src/modules/cli/commands/function-invocation-module.ts index 4be0fe669b..7d71fd56c0 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/function-invocation-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/function-invocation-module.ts @@ -3,69 +3,83 @@ * @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 { CreateFunctionInvocationModuleInput, FunctionInvocationModulePatch, FunctionInvocationModuleSelect, FunctionInvocationModuleFilter, FunctionInvocationModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionInvocationModuleInput, + FunctionInvocationModulePatch, + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - attemptsTableId: "uuid", - attemptsTableName: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - executionLogsTableId: "uuid", - executionLogsTableName: "string", - id: "uuid", - invocationsTableId: "uuid", - invocationsTableName: "string", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + attemptsTableId: 'uuid', + attemptsTableName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + executionLogsTableId: 'uuid', + executionLogsTableName: 'string', + id: 'uuid', + invocationsTableId: 'uuid', + invocationsTableName: 'string', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\nfunction-invocation-module \n\nCommands:\n list List functionInvocationModule records\n find-first Find first matching functionInvocationModule record\n get Get a functionInvocationModule by ID\n create Create a new functionInvocationModule\n update Update an existing functionInvocationModule\n delete Delete a functionInvocationModule\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) => { +const usage = + '\nfunction-invocation-module \n\nCommands:\n list List functionInvocationModule records\n find-first Find first matching functionInvocationModule record\n get Get a functionInvocationModule by ID\n create Create a new functionInvocationModule\n update Update an existing functionInvocationModule\n delete Delete a functionInvocationModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -95,16 +109,22 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionInvocationModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy + > & { + select: FunctionInvocationModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionInvocationModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -134,16 +154,22 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionInvocationModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy + > & { + select: FunctionInvocationModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionInvocationModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -152,42 +178,46 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionInvocationModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - attemptsTableId: true, - attemptsTableName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - executionLogsTableId: true, - executionLogsTableName: true, - id: true, - invocationsTableId: true, - invocationsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionInvocationModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + attemptsTableId: true, + attemptsTableName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + executionLogsTableId: true, + executionLogsTableName: true, + id: true, + invocationsTableId: true, + invocationsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -196,178 +226,204 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "attemptsTableId", - message: "attemptsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "attemptsTableName", - message: "attemptsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionLogsTableId", - message: "executionLogsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionLogsTableName", - message: "executionLogsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationsTableId", - message: "invocationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationsTableName", - message: "invocationsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'attemptsTableId', + message: 'attemptsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'attemptsTableName', + message: 'attemptsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionLogsTableId', + message: 'executionLogsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionLogsTableName', + message: 'executionLogsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationsTableId', + message: 'invocationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationsTableName', + message: 'invocationsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionInvocationModuleInput["functionInvocationModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionInvocationModuleInput['functionInvocationModule']; const client = getClient(); - const result = await client.functionInvocationModule.create({ - data: { - apiName: cleanedData.apiName, - attemptsTableId: cleanedData.attemptsTableId, - attemptsTableName: cleanedData.attemptsTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - executionLogsTableId: cleanedData.executionLogsTableId, - executionLogsTableName: cleanedData.executionLogsTableName, - invocationsTableId: cleanedData.invocationsTableId, - invocationsTableName: cleanedData.invocationsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - attemptsTableId: true, - attemptsTableName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - executionLogsTableId: true, - executionLogsTableName: true, - id: true, - invocationsTableId: true, - invocationsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionInvocationModule + .create({ + data: { + apiName: cleanedData.apiName, + attemptsTableId: cleanedData.attemptsTableId, + attemptsTableName: cleanedData.attemptsTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + executionLogsTableId: cleanedData.executionLogsTableId, + executionLogsTableName: cleanedData.executionLogsTableName, + invocationsTableId: cleanedData.invocationsTableId, + invocationsTableName: cleanedData.invocationsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + attemptsTableId: true, + attemptsTableName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + executionLogsTableId: true, + executionLogsTableName: true, + id: true, + invocationsTableId: true, + invocationsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -376,186 +432,210 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "attemptsTableId", - message: "attemptsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "attemptsTableName", - message: "attemptsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionLogsTableId", - message: "executionLogsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionLogsTableName", - message: "executionLogsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationsTableId", - message: "invocationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invocationsTableName", - message: "invocationsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'attemptsTableId', + message: 'attemptsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'attemptsTableName', + message: 'attemptsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionLogsTableId', + message: 'executionLogsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionLogsTableName', + message: 'executionLogsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationsTableId', + message: 'invocationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invocationsTableName', + message: 'invocationsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionInvocationModulePatch; const client = getClient(); - const result = await client.functionInvocationModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - attemptsTableId: cleanedData.attemptsTableId, - attemptsTableName: cleanedData.attemptsTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - executionLogsTableId: cleanedData.executionLogsTableId, - executionLogsTableName: cleanedData.executionLogsTableName, - invocationsTableId: cleanedData.invocationsTableId, - invocationsTableName: cleanedData.invocationsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - attemptsTableId: true, - attemptsTableName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - executionLogsTableId: true, - executionLogsTableName: true, - id: true, - invocationsTableId: true, - invocationsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionInvocationModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + attemptsTableId: cleanedData.attemptsTableId, + attemptsTableName: cleanedData.attemptsTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + executionLogsTableId: cleanedData.executionLogsTableId, + executionLogsTableName: cleanedData.executionLogsTableName, + invocationsTableId: cleanedData.invocationsTableId, + invocationsTableName: cleanedData.invocationsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + attemptsTableId: true, + attemptsTableName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + executionLogsTableId: true, + executionLogsTableName: true, + id: true, + invocationsTableId: true, + invocationsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -564,28 +644,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.functionInvocationModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionInvocationModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/function-module.ts b/sdk/constructive-cli/src/modules/cli/commands/function-module.ts index 420f59e42c..787792650c 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/function-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/function-module.ts @@ -3,69 +3,83 @@ * @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 { CreateFunctionModuleInput, FunctionModulePatch, FunctionModuleSelect, FunctionModuleFilter, FunctionModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionModuleInput, + FunctionModulePatch, + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - bindingsTableId: "uuid", - bindingsTableName: "string", - databaseId: "uuid", - defaultPermissions: "string", - definitionsTableId: "uuid", - definitionsTableName: "string", - entityField: "string", - entityTableId: "uuid", - hasCron: "boolean", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schedulesTableId: "uuid", - schemaId: "uuid", - scope: "string" + apiName: 'string', + bindingsTableId: 'uuid', + bindingsTableName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + definitionsTableId: 'uuid', + definitionsTableName: 'string', + entityField: 'string', + entityTableId: 'uuid', + hasCron: 'boolean', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schedulesTableId: 'uuid', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\nfunction-module \n\nCommands:\n list List functionModule records\n find-first Find first matching functionModule record\n get Get a functionModule by ID\n create Create a new functionModule\n update Update an existing functionModule\n delete Delete a functionModule\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) => { +const usage = + '\nfunction-module \n\nCommands:\n list List functionModule records\n find-first Find first matching functionModule record\n get Get a functionModule by ID\n create Create a new functionModule\n update Update an existing functionModule\n delete Delete a functionModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -95,16 +109,18 @@ async function handleList(argv: Partial>, _prompter: Inq publicSchemaName: true, schedulesTableId: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: FunctionModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: FunctionModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -134,16 +150,18 @@ async function handleFindFirst(argv: Partial>, _prompter publicSchemaName: true, schedulesTableId: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: FunctionModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: FunctionModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.functionModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -152,42 +170,46 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.functionModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - bindingsTableId: true, - bindingsTableName: true, - databaseId: true, - defaultPermissions: true, - definitionsTableId: true, - definitionsTableName: true, - entityField: true, - entityTableId: true, - hasCron: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schedulesTableId: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + bindingsTableId: true, + bindingsTableName: true, + databaseId: true, + defaultPermissions: true, + definitionsTableId: true, + definitionsTableName: true, + entityField: true, + entityTableId: true, + hasCron: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schedulesTableId: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -196,178 +218,204 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bindingsTableId", - message: "bindingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bindingsTableName", - message: "bindingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionsTableId", - message: "definitionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionsTableName", - message: "definitionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasCron", - message: "hasCron", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schedulesTableId", - message: "schedulesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bindingsTableId', + message: 'bindingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bindingsTableName', + message: 'bindingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionsTableId', + message: 'definitionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionsTableName', + message: 'definitionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasCron', + message: 'hasCron', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schedulesTableId', + message: 'schedulesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateFunctionModuleInput["functionModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionModuleInput['functionModule']; const client = getClient(); - const result = await client.functionModule.create({ - data: { - apiName: cleanedData.apiName, - bindingsTableId: cleanedData.bindingsTableId, - bindingsTableName: cleanedData.bindingsTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - definitionsTableId: cleanedData.definitionsTableId, - definitionsTableName: cleanedData.definitionsTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - hasCron: cleanedData.hasCron, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schedulesTableId: cleanedData.schedulesTableId, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - bindingsTableId: true, - bindingsTableName: true, - databaseId: true, - defaultPermissions: true, - definitionsTableId: true, - definitionsTableName: true, - entityField: true, - entityTableId: true, - hasCron: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schedulesTableId: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionModule + .create({ + data: { + apiName: cleanedData.apiName, + bindingsTableId: cleanedData.bindingsTableId, + bindingsTableName: cleanedData.bindingsTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + definitionsTableId: cleanedData.definitionsTableId, + definitionsTableName: cleanedData.definitionsTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + hasCron: cleanedData.hasCron, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schedulesTableId: cleanedData.schedulesTableId, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + bindingsTableId: true, + bindingsTableName: true, + databaseId: true, + defaultPermissions: true, + definitionsTableId: true, + definitionsTableName: true, + entityField: true, + entityTableId: true, + hasCron: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schedulesTableId: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -376,186 +424,210 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bindingsTableId", - message: "bindingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bindingsTableName", - message: "bindingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionsTableId", - message: "definitionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "definitionsTableName", - message: "definitionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasCron", - message: "hasCron", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schedulesTableId", - message: "schedulesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bindingsTableId', + message: 'bindingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bindingsTableName', + message: 'bindingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionsTableId', + message: 'definitionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionsTableName', + message: 'definitionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasCron', + message: 'hasCron', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schedulesTableId', + message: 'schedulesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as FunctionModulePatch; const client = getClient(); - const result = await client.functionModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - bindingsTableId: cleanedData.bindingsTableId, - bindingsTableName: cleanedData.bindingsTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - definitionsTableId: cleanedData.definitionsTableId, - definitionsTableName: cleanedData.definitionsTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - hasCron: cleanedData.hasCron, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schedulesTableId: cleanedData.schedulesTableId, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - bindingsTableId: true, - bindingsTableName: true, - databaseId: true, - defaultPermissions: true, - definitionsTableId: true, - definitionsTableName: true, - entityField: true, - entityTableId: true, - hasCron: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schedulesTableId: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.functionModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + bindingsTableId: cleanedData.bindingsTableId, + bindingsTableName: cleanedData.bindingsTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + definitionsTableId: cleanedData.definitionsTableId, + definitionsTableName: cleanedData.definitionsTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + hasCron: cleanedData.hasCron, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schedulesTableId: cleanedData.schedulesTableId, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + bindingsTableId: true, + bindingsTableName: true, + databaseId: true, + defaultPermissions: true, + definitionsTableId: true, + definitionsTableName: true, + entityField: true, + entityTableId: true, + hasCron: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schedulesTableId: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -564,28 +636,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.functionModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.functionModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/graph-execution-module.ts b/sdk/constructive-cli/src/modules/cli/commands/graph-execution-module.ts index 98f2eec208..5083085daf 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/graph-execution-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/graph-execution-module.ts @@ -3,71 +3,85 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getClient } from "../executor"; -import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from "../utils"; -import type { FieldSchema } from "../utils"; -import type { CreateGraphExecutionModuleInput, GraphExecutionModulePatch, GraphExecutionModuleSelect, GraphExecutionModuleFilter, GraphExecutionModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateGraphExecutionModuleInput, + GraphExecutionModulePatch, + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - createdAt: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - executionsTableId: "uuid", - executionsTableName: "string", - graphModuleId: "uuid", - id: "uuid", - nodeStatesTableId: "uuid", - nodeStatesTableName: "string", - outputsTableId: "uuid", - outputsTableName: "string", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + createdAt: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + executionsTableId: 'uuid', + executionsTableName: 'string', + graphModuleId: 'uuid', + id: 'uuid', + nodeStatesTableId: 'uuid', + nodeStatesTableName: 'string', + outputsTableId: 'uuid', + outputsTableName: 'string', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\ngraph-execution-module \n\nCommands:\n list List graphExecutionModule records\n find-first Find first matching graphExecutionModule record\n get Get a graphExecutionModule by ID\n create Create a new graphExecutionModule\n update Update an existing graphExecutionModule\n delete Delete a graphExecutionModule\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +const usage = + '\ngraph-execution-module \n\nCommands:\n list List graphExecutionModule records\n find-first Find first matching graphExecutionModule record\n get Get a graphExecutionModule by ID\n create Create a new graphExecutionModule\n update Update an existing graphExecutionModule\n delete Delete a graphExecutionModule\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - const { - first: subcommand, - newArgv - } = extractFirst(argv); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -99,16 +113,22 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: GraphExecutionModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + > & { + select: GraphExecutionModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.graphExecutionModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -140,16 +160,22 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: GraphExecutionModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + > & { + select: GraphExecutionModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.graphExecutionModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -158,44 +184,48 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.graphExecutionModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - executionsTableId: true, - executionsTableName: true, - graphModuleId: true, - id: true, - nodeStatesTableId: true, - nodeStatesTableName: true, - outputsTableId: true, - outputsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.graphExecutionModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + executionsTableId: true, + executionsTableName: true, + graphModuleId: true, + id: true, + nodeStatesTableId: true, + nodeStatesTableName: true, + outputsTableId: true, + outputsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -204,186 +234,213 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionsTableId", - message: "executionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionsTableName", - message: "executionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphModuleId", - message: "graphModuleId", - required: true - }, { - type: "text", - name: "nodeStatesTableId", - message: "nodeStatesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "nodeStatesTableName", - message: "nodeStatesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputsTableId", - message: "outputsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputsTableName", - message: "outputsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionsTableId', + message: 'executionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionsTableName', + message: 'executionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphModuleId', + message: 'graphModuleId', + required: true, + }, + { + type: 'text', + name: 'nodeStatesTableId', + message: 'nodeStatesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'nodeStatesTableName', + message: 'nodeStatesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputsTableId', + message: 'outputsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputsTableName', + message: 'outputsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateGraphExecutionModuleInput["graphExecutionModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateGraphExecutionModuleInput['graphExecutionModule']; const client = getClient(); - const result = await client.graphExecutionModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - executionsTableId: cleanedData.executionsTableId, - executionsTableName: cleanedData.executionsTableName, - graphModuleId: cleanedData.graphModuleId, - nodeStatesTableId: cleanedData.nodeStatesTableId, - nodeStatesTableName: cleanedData.nodeStatesTableName, - outputsTableId: cleanedData.outputsTableId, - outputsTableName: cleanedData.outputsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - executionsTableId: true, - executionsTableName: true, - graphModuleId: true, - id: true, - nodeStatesTableId: true, - nodeStatesTableName: true, - outputsTableId: true, - outputsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.graphExecutionModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + executionsTableId: cleanedData.executionsTableId, + executionsTableName: cleanedData.executionsTableName, + graphModuleId: cleanedData.graphModuleId, + nodeStatesTableId: cleanedData.nodeStatesTableId, + nodeStatesTableName: cleanedData.nodeStatesTableName, + outputsTableId: cleanedData.outputsTableId, + outputsTableName: cleanedData.outputsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + executionsTableId: true, + executionsTableName: true, + graphModuleId: true, + id: true, + nodeStatesTableId: true, + nodeStatesTableName: true, + outputsTableId: true, + outputsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -392,194 +449,219 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionsTableId", - message: "executionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "executionsTableName", - message: "executionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphModuleId", - message: "graphModuleId", - required: false - }, { - type: "text", - name: "nodeStatesTableId", - message: "nodeStatesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "nodeStatesTableName", - message: "nodeStatesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputsTableId", - message: "outputsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outputsTableName", - message: "outputsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionsTableId', + message: 'executionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionsTableName', + message: 'executionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphModuleId', + message: 'graphModuleId', + required: false, + }, + { + type: 'text', + name: 'nodeStatesTableId', + message: 'nodeStatesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'nodeStatesTableName', + message: 'nodeStatesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputsTableId', + message: 'outputsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputsTableName', + message: 'outputsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as GraphExecutionModulePatch; const client = getClient(); - const result = await client.graphExecutionModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - executionsTableId: cleanedData.executionsTableId, - executionsTableName: cleanedData.executionsTableName, - graphModuleId: cleanedData.graphModuleId, - nodeStatesTableId: cleanedData.nodeStatesTableId, - nodeStatesTableName: cleanedData.nodeStatesTableName, - outputsTableId: cleanedData.outputsTableId, - outputsTableName: cleanedData.outputsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - executionsTableId: true, - executionsTableName: true, - graphModuleId: true, - id: true, - nodeStatesTableId: true, - nodeStatesTableName: true, - outputsTableId: true, - outputsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.graphExecutionModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + executionsTableId: cleanedData.executionsTableId, + executionsTableName: cleanedData.executionsTableName, + graphModuleId: cleanedData.graphModuleId, + nodeStatesTableId: cleanedData.nodeStatesTableId, + nodeStatesTableName: cleanedData.nodeStatesTableName, + outputsTableId: cleanedData.outputsTableId, + outputsTableName: cleanedData.outputsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + executionsTableId: true, + executionsTableName: true, + graphModuleId: true, + id: true, + nodeStatesTableId: true, + nodeStatesTableName: true, + outputsTableId: true, + outputsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -588,28 +670,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.graphExecutionModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.graphExecutionModule + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/graph-module.ts b/sdk/constructive-cli/src/modules/cli/commands/graph-module.ts index 3ce788bed2..765adb9418 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/graph-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/graph-module.ts @@ -3,66 +3,80 @@ * @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 { CreateGraphModuleInput, GraphModulePatch, GraphModuleSelect, GraphModuleFilter, GraphModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateGraphModuleInput, + GraphModulePatch, + GraphModuleSelect, + GraphModuleFilter, + GraphModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - createdAt: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - graphsTableId: "uuid", - id: "uuid", - merkleStoreModuleId: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaId: "uuid", - publicSchemaName: "string", - scope: "string" + apiName: 'string', + createdAt: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + graphsTableId: 'uuid', + id: 'uuid', + merkleStoreModuleId: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaId: 'uuid', + publicSchemaName: 'string', + scope: 'string', }; -const usage = "\ngraph-module \n\nCommands:\n list List graphModule records\n find-first Find first matching graphModule record\n get Get a graphModule by ID\n create Create a new graphModule\n update Update an existing graphModule\n delete Delete a graphModule\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) => { +const usage = + '\ngraph-module \n\nCommands:\n list List graphModule records\n find-first Find first matching graphModule record\n get Get a graphModule by ID\n create Create a new graphModule\n update Update an existing graphModule\n delete Delete a graphModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -89,16 +103,18 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaId: true, publicSchemaName: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: GraphModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: GraphModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.graphModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -125,16 +141,18 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaId: true, publicSchemaName: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: GraphModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: GraphModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.graphModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -143,39 +161,43 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.graphModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - graphsTableId: true, - id: true, - merkleStoreModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaId: true, - publicSchemaName: true, - scope: true - } - }).execute(); + const result = await client.graphModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + graphsTableId: true, + id: true, + merkleStoreModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaId: true, + publicSchemaName: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -184,146 +206,168 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphsTableId", - message: "graphsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "merkleStoreModuleId", - message: "merkleStoreModuleId", - required: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaId", - message: "publicSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphsTableId', + message: 'graphsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'merkleStoreModuleId', + message: 'merkleStoreModuleId', + required: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaId', + message: 'publicSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateGraphModuleInput["graphModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateGraphModuleInput['graphModule']; const client = getClient(); - const result = await client.graphModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - graphsTableId: cleanedData.graphsTableId, - merkleStoreModuleId: cleanedData.merkleStoreModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaId: cleanedData.publicSchemaId, - publicSchemaName: cleanedData.publicSchemaName, - scope: cleanedData.scope - }, - select: { - apiName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - graphsTableId: true, - id: true, - merkleStoreModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaId: true, - publicSchemaName: true, - scope: true - } - }).execute(); + const result = await client.graphModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + graphsTableId: cleanedData.graphsTableId, + merkleStoreModuleId: cleanedData.merkleStoreModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaId: cleanedData.publicSchemaId, + publicSchemaName: cleanedData.publicSchemaName, + scope: cleanedData.scope, + }, + select: { + apiName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + graphsTableId: true, + id: true, + merkleStoreModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaId: true, + publicSchemaName: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -332,154 +376,174 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "graphsTableId", - message: "graphsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "merkleStoreModuleId", - message: "merkleStoreModuleId", - required: false - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaId", - message: "publicSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphsTableId', + message: 'graphsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'merkleStoreModuleId', + message: 'merkleStoreModuleId', + required: false, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaId', + message: 'publicSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as GraphModulePatch; const client = getClient(); - const result = await client.graphModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - graphsTableId: cleanedData.graphsTableId, - merkleStoreModuleId: cleanedData.merkleStoreModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaId: cleanedData.publicSchemaId, - publicSchemaName: cleanedData.publicSchemaName, - scope: cleanedData.scope - }, - select: { - apiName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - graphsTableId: true, - id: true, - merkleStoreModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaId: true, - publicSchemaName: true, - scope: true - } - }).execute(); + const result = await client.graphModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + graphsTableId: cleanedData.graphsTableId, + merkleStoreModuleId: cleanedData.merkleStoreModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaId: cleanedData.publicSchemaId, + publicSchemaName: cleanedData.publicSchemaName, + scope: cleanedData.scope, + }, + select: { + apiName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + graphsTableId: true, + id: true, + merkleStoreModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaId: true, + publicSchemaName: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -488,28 +552,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.graphModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.graphModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/hierarchy-module.ts b/sdk/constructive-cli/src/modules/cli/commands/hierarchy-module.ts index 44fb2d35b0..5691c74a13 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/hierarchy-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/hierarchy-module.ts @@ -3,71 +3,85 @@ * @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 { CreateHierarchyModuleInput, HierarchyModulePatch, HierarchyModuleSelect, HierarchyModuleFilter, HierarchyModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateHierarchyModuleInput, + HierarchyModulePatch, + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - chartEdgeGrantsTableId: "uuid", - chartEdgeGrantsTableName: "string", - chartEdgesTableId: "uuid", - chartEdgesTableName: "string", - createdAt: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - getManagersFunction: "string", - getSubordinatesFunction: "string", - hierarchySprtTableId: "uuid", - hierarchySprtTableName: "string", - id: "uuid", - isManagerOfFunction: "string", - prefix: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - rebuildHierarchyFunction: "string", - schemaId: "uuid", - scope: "string", - sprtTableName: "string", - usersTableId: "uuid" + chartEdgeGrantsTableId: 'uuid', + chartEdgeGrantsTableName: 'string', + chartEdgesTableId: 'uuid', + chartEdgesTableName: 'string', + createdAt: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + getManagersFunction: 'string', + getSubordinatesFunction: 'string', + hierarchySprtTableId: 'uuid', + hierarchySprtTableName: 'string', + id: 'uuid', + isManagerOfFunction: 'string', + prefix: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + rebuildHierarchyFunction: 'string', + schemaId: 'uuid', + scope: 'string', + sprtTableName: 'string', + usersTableId: 'uuid', }; -const usage = "\nhierarchy-module \n\nCommands:\n list List hierarchyModule records\n find-first Find first matching hierarchyModule record\n get Get a hierarchyModule by ID\n create Create a new hierarchyModule\n update Update an existing hierarchyModule\n delete Delete a hierarchyModule\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) => { +const usage = + '\nhierarchy-module \n\nCommands:\n list List hierarchyModule records\n find-first Find first matching hierarchyModule record\n get Get a hierarchyModule by ID\n create Create a new hierarchyModule\n update Update an existing hierarchyModule\n delete Delete a hierarchyModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -99,16 +113,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, sprtTableName: true, - usersTableId: true + usersTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: HierarchyModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: HierarchyModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.hierarchyModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -140,16 +156,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, sprtTableName: true, - usersTableId: true + usersTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: HierarchyModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: HierarchyModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.hierarchyModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -158,44 +176,48 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.hierarchyModule.findOne({ - id: answers.id as string, - select: { - chartEdgeGrantsTableId: true, - chartEdgeGrantsTableName: true, - chartEdgesTableId: true, - chartEdgesTableName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - getManagersFunction: true, - getSubordinatesFunction: true, - hierarchySprtTableId: true, - hierarchySprtTableName: true, - id: true, - isManagerOfFunction: true, - prefix: true, - privateSchemaId: true, - privateSchemaName: true, - rebuildHierarchyFunction: true, - schemaId: true, - scope: true, - sprtTableName: true, - usersTableId: true - } - }).execute(); + const result = await client.hierarchyModule + .findOne({ + id: answers.id as string, + select: { + chartEdgeGrantsTableId: true, + chartEdgeGrantsTableName: true, + chartEdgesTableId: true, + chartEdgesTableName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + getManagersFunction: true, + getSubordinatesFunction: true, + hierarchySprtTableId: true, + hierarchySprtTableName: true, + id: true, + isManagerOfFunction: true, + prefix: true, + privateSchemaId: true, + privateSchemaName: true, + rebuildHierarchyFunction: true, + schemaId: true, + scope: true, + sprtTableName: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -204,185 +226,212 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "chartEdgeGrantsTableId", - message: "chartEdgeGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chartEdgeGrantsTableName", - message: "chartEdgeGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chartEdgesTableId", - message: "chartEdgesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chartEdgesTableName", - message: "chartEdgesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: true - }, { - type: "text", - name: "getManagersFunction", - message: "getManagersFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getSubordinatesFunction", - message: "getSubordinatesFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hierarchySprtTableId", - message: "hierarchySprtTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hierarchySprtTableName", - message: "hierarchySprtTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "isManagerOfFunction", - message: "isManagerOfFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rebuildHierarchyFunction", - message: "rebuildHierarchyFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "sprtTableName", - message: "sprtTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'chartEdgeGrantsTableId', + message: 'chartEdgeGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chartEdgeGrantsTableName', + message: 'chartEdgeGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chartEdgesTableId', + message: 'chartEdgesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chartEdgesTableName', + message: 'chartEdgesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: true, + }, + { + type: 'text', + name: 'getManagersFunction', + message: 'getManagersFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getSubordinatesFunction', + message: 'getSubordinatesFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hierarchySprtTableId', + message: 'hierarchySprtTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hierarchySprtTableName', + message: 'hierarchySprtTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'isManagerOfFunction', + message: 'isManagerOfFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rebuildHierarchyFunction', + message: 'rebuildHierarchyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'sprtTableName', + message: 'sprtTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateHierarchyModuleInput["hierarchyModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateHierarchyModuleInput['hierarchyModule']; const client = getClient(); - const result = await client.hierarchyModule.create({ - data: { - chartEdgeGrantsTableId: cleanedData.chartEdgeGrantsTableId, - chartEdgeGrantsTableName: cleanedData.chartEdgeGrantsTableName, - chartEdgesTableId: cleanedData.chartEdgesTableId, - chartEdgesTableName: cleanedData.chartEdgesTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - getManagersFunction: cleanedData.getManagersFunction, - getSubordinatesFunction: cleanedData.getSubordinatesFunction, - hierarchySprtTableId: cleanedData.hierarchySprtTableId, - hierarchySprtTableName: cleanedData.hierarchySprtTableName, - isManagerOfFunction: cleanedData.isManagerOfFunction, - prefix: cleanedData.prefix, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - rebuildHierarchyFunction: cleanedData.rebuildHierarchyFunction, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - sprtTableName: cleanedData.sprtTableName, - usersTableId: cleanedData.usersTableId - }, - select: { - chartEdgeGrantsTableId: true, - chartEdgeGrantsTableName: true, - chartEdgesTableId: true, - chartEdgesTableName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - getManagersFunction: true, - getSubordinatesFunction: true, - hierarchySprtTableId: true, - hierarchySprtTableName: true, - id: true, - isManagerOfFunction: true, - prefix: true, - privateSchemaId: true, - privateSchemaName: true, - rebuildHierarchyFunction: true, - schemaId: true, - scope: true, - sprtTableName: true, - usersTableId: true - } - }).execute(); + const result = await client.hierarchyModule + .create({ + data: { + chartEdgeGrantsTableId: cleanedData.chartEdgeGrantsTableId, + chartEdgeGrantsTableName: cleanedData.chartEdgeGrantsTableName, + chartEdgesTableId: cleanedData.chartEdgesTableId, + chartEdgesTableName: cleanedData.chartEdgesTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + getManagersFunction: cleanedData.getManagersFunction, + getSubordinatesFunction: cleanedData.getSubordinatesFunction, + hierarchySprtTableId: cleanedData.hierarchySprtTableId, + hierarchySprtTableName: cleanedData.hierarchySprtTableName, + isManagerOfFunction: cleanedData.isManagerOfFunction, + prefix: cleanedData.prefix, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + rebuildHierarchyFunction: cleanedData.rebuildHierarchyFunction, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + sprtTableName: cleanedData.sprtTableName, + usersTableId: cleanedData.usersTableId, + }, + select: { + chartEdgeGrantsTableId: true, + chartEdgeGrantsTableName: true, + chartEdgesTableId: true, + chartEdgesTableName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + getManagersFunction: true, + getSubordinatesFunction: true, + hierarchySprtTableId: true, + hierarchySprtTableName: true, + id: true, + isManagerOfFunction: true, + prefix: true, + privateSchemaId: true, + privateSchemaName: true, + rebuildHierarchyFunction: true, + schemaId: true, + scope: true, + sprtTableName: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -391,193 +440,218 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "chartEdgeGrantsTableId", - message: "chartEdgeGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chartEdgeGrantsTableName", - message: "chartEdgeGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chartEdgesTableId", - message: "chartEdgesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "chartEdgesTableName", - message: "chartEdgesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false - }, { - type: "text", - name: "getManagersFunction", - message: "getManagersFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getSubordinatesFunction", - message: "getSubordinatesFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hierarchySprtTableId", - message: "hierarchySprtTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hierarchySprtTableName", - message: "hierarchySprtTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "isManagerOfFunction", - message: "isManagerOfFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rebuildHierarchyFunction", - message: "rebuildHierarchyFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "sprtTableName", - message: "sprtTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'chartEdgeGrantsTableId', + message: 'chartEdgeGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chartEdgeGrantsTableName', + message: 'chartEdgeGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chartEdgesTableId', + message: 'chartEdgesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'chartEdgesTableName', + message: 'chartEdgesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + }, + { + type: 'text', + name: 'getManagersFunction', + message: 'getManagersFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getSubordinatesFunction', + message: 'getSubordinatesFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hierarchySprtTableId', + message: 'hierarchySprtTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hierarchySprtTableName', + message: 'hierarchySprtTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'isManagerOfFunction', + message: 'isManagerOfFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rebuildHierarchyFunction', + message: 'rebuildHierarchyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'sprtTableName', + message: 'sprtTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as HierarchyModulePatch; const client = getClient(); - const result = await client.hierarchyModule.update({ - where: { - id: answers.id as string - }, - data: { - chartEdgeGrantsTableId: cleanedData.chartEdgeGrantsTableId, - chartEdgeGrantsTableName: cleanedData.chartEdgeGrantsTableName, - chartEdgesTableId: cleanedData.chartEdgesTableId, - chartEdgesTableName: cleanedData.chartEdgesTableName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - getManagersFunction: cleanedData.getManagersFunction, - getSubordinatesFunction: cleanedData.getSubordinatesFunction, - hierarchySprtTableId: cleanedData.hierarchySprtTableId, - hierarchySprtTableName: cleanedData.hierarchySprtTableName, - isManagerOfFunction: cleanedData.isManagerOfFunction, - prefix: cleanedData.prefix, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - rebuildHierarchyFunction: cleanedData.rebuildHierarchyFunction, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - sprtTableName: cleanedData.sprtTableName, - usersTableId: cleanedData.usersTableId - }, - select: { - chartEdgeGrantsTableId: true, - chartEdgeGrantsTableName: true, - chartEdgesTableId: true, - chartEdgesTableName: true, - createdAt: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - getManagersFunction: true, - getSubordinatesFunction: true, - hierarchySprtTableId: true, - hierarchySprtTableName: true, - id: true, - isManagerOfFunction: true, - prefix: true, - privateSchemaId: true, - privateSchemaName: true, - rebuildHierarchyFunction: true, - schemaId: true, - scope: true, - sprtTableName: true, - usersTableId: true - } - }).execute(); + const result = await client.hierarchyModule + .update({ + where: { + id: answers.id as string, + }, + data: { + chartEdgeGrantsTableId: cleanedData.chartEdgeGrantsTableId, + chartEdgeGrantsTableName: cleanedData.chartEdgeGrantsTableName, + chartEdgesTableId: cleanedData.chartEdgesTableId, + chartEdgesTableName: cleanedData.chartEdgesTableName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + getManagersFunction: cleanedData.getManagersFunction, + getSubordinatesFunction: cleanedData.getSubordinatesFunction, + hierarchySprtTableId: cleanedData.hierarchySprtTableId, + hierarchySprtTableName: cleanedData.hierarchySprtTableName, + isManagerOfFunction: cleanedData.isManagerOfFunction, + prefix: cleanedData.prefix, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + rebuildHierarchyFunction: cleanedData.rebuildHierarchyFunction, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + sprtTableName: cleanedData.sprtTableName, + usersTableId: cleanedData.usersTableId, + }, + select: { + chartEdgeGrantsTableId: true, + chartEdgeGrantsTableName: true, + chartEdgesTableId: true, + chartEdgesTableName: true, + createdAt: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + getManagersFunction: true, + getSubordinatesFunction: true, + hierarchySprtTableId: true, + hierarchySprtTableName: true, + id: true, + isManagerOfFunction: true, + prefix: true, + privateSchemaId: true, + privateSchemaName: true, + rebuildHierarchyFunction: true, + schemaId: true, + scope: true, + sprtTableName: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -586,28 +660,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.hierarchyModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.hierarchyModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/http-route-module.ts b/sdk/constructive-cli/src/modules/cli/commands/http-route-module.ts index 6433fec9df..24acccd4ef 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/http-route-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/http-route-module.ts @@ -3,69 +3,83 @@ * @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 { CreateHttpRouteModuleInput, HttpRouteModulePatch, HttpRouteModuleSelect, HttpRouteModuleFilter, HttpRouteModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateHttpRouteModuleInput, + HttpRouteModulePatch, + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - functionModuleId: "uuid", - httpRoutesTableId: "uuid", - httpRoutesTableName: "string", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - resolverFunctionName: "string", - resourceModuleId: "uuid", - schemaId: "uuid", - scope: "string", - storageModuleId: "uuid" + apiName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + functionModuleId: 'uuid', + httpRoutesTableId: 'uuid', + httpRoutesTableName: 'string', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + resolverFunctionName: 'string', + resourceModuleId: 'uuid', + schemaId: 'uuid', + scope: 'string', + storageModuleId: 'uuid', }; -const usage = "\nhttp-route-module \n\nCommands:\n list List httpRouteModule records\n find-first Find first matching httpRouteModule record\n get Get a httpRouteModule by ID\n create Create a new httpRouteModule\n update Update an existing httpRouteModule\n delete Delete a httpRouteModule\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) => { +const usage = + '\nhttp-route-module \n\nCommands:\n list List httpRouteModule records\n find-first Find first matching httpRouteModule record\n get Get a httpRouteModule by ID\n create Create a new httpRouteModule\n update Update an existing httpRouteModule\n delete Delete a httpRouteModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -95,16 +109,18 @@ async function handleList(argv: Partial>, _prompter: Inq resourceModuleId: true, schemaId: true, scope: true, - storageModuleId: true + storageModuleId: true, }; - const findManyArgs = parseFindManyArgs & { - select: HttpRouteModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: HttpRouteModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.httpRouteModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -134,16 +150,18 @@ async function handleFindFirst(argv: Partial>, _prompter resourceModuleId: true, schemaId: true, scope: true, - storageModuleId: true + storageModuleId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: HttpRouteModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: HttpRouteModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.httpRouteModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -152,42 +170,46 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.httpRouteModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - functionModuleId: true, - httpRoutesTableId: true, - httpRoutesTableName: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - resolverFunctionName: true, - resourceModuleId: true, - schemaId: true, - scope: true, - storageModuleId: true - } - }).execute(); + const result = await client.httpRouteModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + functionModuleId: true, + httpRoutesTableId: true, + httpRoutesTableName: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + resolverFunctionName: true, + resourceModuleId: true, + schemaId: true, + scope: true, + storageModuleId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -196,178 +218,204 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionModuleId", - message: "functionModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "httpRoutesTableId", - message: "httpRoutesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "httpRoutesTableName", - message: "httpRoutesTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resolverFunctionName", - message: "resolverFunctionName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceModuleId", - message: "resourceModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "storageModuleId", - message: "storageModuleId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionModuleId', + message: 'functionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'httpRoutesTableId', + message: 'httpRoutesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'httpRoutesTableName', + message: 'httpRoutesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resolverFunctionName', + message: 'resolverFunctionName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceModuleId', + message: 'resourceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'storageModuleId', + message: 'storageModuleId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateHttpRouteModuleInput["httpRouteModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateHttpRouteModuleInput['httpRouteModule']; const client = getClient(); - const result = await client.httpRouteModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - functionModuleId: cleanedData.functionModuleId, - httpRoutesTableId: cleanedData.httpRoutesTableId, - httpRoutesTableName: cleanedData.httpRoutesTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - resolverFunctionName: cleanedData.resolverFunctionName, - resourceModuleId: cleanedData.resourceModuleId, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - storageModuleId: cleanedData.storageModuleId - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - functionModuleId: true, - httpRoutesTableId: true, - httpRoutesTableName: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - resolverFunctionName: true, - resourceModuleId: true, - schemaId: true, - scope: true, - storageModuleId: true - } - }).execute(); + const result = await client.httpRouteModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + functionModuleId: cleanedData.functionModuleId, + httpRoutesTableId: cleanedData.httpRoutesTableId, + httpRoutesTableName: cleanedData.httpRoutesTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + resolverFunctionName: cleanedData.resolverFunctionName, + resourceModuleId: cleanedData.resourceModuleId, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + storageModuleId: cleanedData.storageModuleId, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + functionModuleId: true, + httpRoutesTableId: true, + httpRoutesTableName: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + resolverFunctionName: true, + resourceModuleId: true, + schemaId: true, + scope: true, + storageModuleId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -376,186 +424,210 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionModuleId", - message: "functionModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "httpRoutesTableId", - message: "httpRoutesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "httpRoutesTableName", - message: "httpRoutesTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resolverFunctionName", - message: "resolverFunctionName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceModuleId", - message: "resourceModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "storageModuleId", - message: "storageModuleId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionModuleId', + message: 'functionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'httpRoutesTableId', + message: 'httpRoutesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'httpRoutesTableName', + message: 'httpRoutesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resolverFunctionName', + message: 'resolverFunctionName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceModuleId', + message: 'resourceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'storageModuleId', + message: 'storageModuleId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as HttpRouteModulePatch; const client = getClient(); - const result = await client.httpRouteModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - functionModuleId: cleanedData.functionModuleId, - httpRoutesTableId: cleanedData.httpRoutesTableId, - httpRoutesTableName: cleanedData.httpRoutesTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - resolverFunctionName: cleanedData.resolverFunctionName, - resourceModuleId: cleanedData.resourceModuleId, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - storageModuleId: cleanedData.storageModuleId - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - functionModuleId: true, - httpRoutesTableId: true, - httpRoutesTableName: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - resolverFunctionName: true, - resourceModuleId: true, - schemaId: true, - scope: true, - storageModuleId: true - } - }).execute(); + const result = await client.httpRouteModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + functionModuleId: cleanedData.functionModuleId, + httpRoutesTableId: cleanedData.httpRoutesTableId, + httpRoutesTableName: cleanedData.httpRoutesTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + resolverFunctionName: cleanedData.resolverFunctionName, + resourceModuleId: cleanedData.resourceModuleId, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + storageModuleId: cleanedData.storageModuleId, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + functionModuleId: true, + httpRoutesTableId: true, + httpRoutesTableName: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + resolverFunctionName: true, + resourceModuleId: true, + schemaId: true, + scope: true, + storageModuleId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -564,28 +636,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.httpRouteModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.httpRouteModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/i-18-n-module.ts b/sdk/constructive-cli/src/modules/cli/commands/i-18-n-module.ts index 12bd70b336..0396064048 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/i-18-n-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/i-18-n-module.ts @@ -3,55 +3,69 @@ * @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 { CreateI18NModuleInput, I18NModulePatch, I18NModuleSelect, I18NModuleFilter, I18NModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateI18NModuleInput, + I18NModulePatch, + I18NModuleSelect, + I18NModuleFilter, + I18NModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - id: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - schemaId: "uuid", - settingsTableId: "uuid" + apiName: 'string', + databaseId: 'uuid', + id: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + schemaId: 'uuid', + settingsTableId: 'uuid', }; -const usage = "\ni-18-n-module \n\nCommands:\n list List i18NModule records\n find-first Find first matching i18NModule record\n get Get a i18NModule by ID\n create Create a new i18NModule\n update Update an existing i18NModule\n delete Delete a i18NModule\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) => { +const usage = + '\ni-18-n-module \n\nCommands:\n list List i18NModule records\n find-first Find first matching i18NModule record\n get Get a i18NModule by ID\n create Create a new i18NModule\n update Update an existing i18NModule\n delete Delete a i18NModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,18 @@ async function handleList(argv: Partial>, _prompter: Inq privateApiName: true, privateSchemaId: true, schemaId: true, - settingsTableId: true + settingsTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: I18NModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: I18NModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.i18NModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +108,18 @@ async function handleFindFirst(argv: Partial>, _prompter privateApiName: true, privateSchemaId: true, schemaId: true, - settingsTableId: true + settingsTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: I18NModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: I18NModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.i18NModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +128,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.i18NModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - id: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - settingsTableId: true - } - }).execute(); + const result = await client.i18NModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + id: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + settingsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,67 +162,76 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "settingsTableId", - message: "settingsTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'settingsTableId', + message: 'settingsTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateI18NModuleInput["i18NModule"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateI18NModuleInput['i18NModule']; const client = getClient(); - const result = await client.i18NModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - settingsTableId: cleanedData.settingsTableId - }, - select: { - apiName: true, - databaseId: true, - id: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - settingsTableId: true - } - }).execute(); + const result = await client.i18NModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + settingsTableId: cleanedData.settingsTableId, + }, + select: { + apiName: true, + databaseId: true, + id: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + settingsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -209,75 +240,85 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "settingsTableId", - message: "settingsTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'settingsTableId', + message: 'settingsTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as I18NModulePatch; const client = getClient(); - const result = await client.i18NModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - settingsTableId: cleanedData.settingsTableId - }, - select: { - apiName: true, - databaseId: true, - id: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - settingsTableId: true - } - }).execute(); + const result = await client.i18NModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + settingsTableId: cleanedData.settingsTableId, + }, + select: { + apiName: true, + databaseId: true, + id: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + settingsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -286,28 +327,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.i18NModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.i18NModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/identity-providers-module.ts b/sdk/constructive-cli/src/modules/cli/commands/identity-providers-module.ts index 81a3c65aee..ecd76f18c1 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/identity-providers-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/identity-providers-module.ts @@ -3,62 +3,76 @@ * @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 { CreateIdentityProvidersModuleInput, IdentityProvidersModulePatch, IdentityProvidersModuleSelect, IdentityProvidersModuleFilter, IdentityProvidersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateIdentityProvidersModuleInput, + IdentityProvidersModulePatch, + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - tableId: "uuid", - tableName: "string" + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nidentity-providers-module \n\nCommands:\n list List identityProvidersModule records\n find-first Find first matching identityProvidersModule record\n get Get a identityProvidersModule by ID\n create Create a new identityProvidersModule\n update Update an existing identityProvidersModule\n delete Delete a identityProvidersModule\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) => { +const usage = + '\nidentity-providers-module \n\nCommands:\n list List identityProvidersModule records\n find-first Find first matching identityProvidersModule record\n get Get a identityProvidersModule by ID\n create Create a new identityProvidersModule\n update Update an existing identityProvidersModule\n delete Delete a identityProvidersModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: IdentityProvidersModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy + > & { + select: IdentityProvidersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.identityProvidersModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +133,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: IdentityProvidersModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy + > & { + select: IdentityProvidersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.identityProvidersModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +157,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.identityProvidersModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.identityProvidersModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,122 +198,141 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateIdentityProvidersModuleInput["identityProvidersModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateIdentityProvidersModuleInput['identityProvidersModule']; const client = getClient(); - const result = await client.identityProvidersModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.identityProvidersModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -292,130 +341,147 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as IdentityProvidersModulePatch; const client = getClient(); - const result = await client.identityProvidersModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.identityProvidersModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -424,28 +490,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.identityProvidersModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.identityProvidersModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/inference-log-module.ts b/sdk/constructive-cli/src/modules/cli/commands/inference-log-module.ts index 937e565acf..27db1b4287 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/inference-log-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/inference-log-module.ts @@ -3,68 +3,82 @@ * @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 { CreateInferenceLogModuleInput, InferenceLogModulePatch, InferenceLogModuleSelect, InferenceLogModuleFilter, InferenceLogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInferenceLogModuleInput, + InferenceLogModulePatch, + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorFkTableId: "uuid", - apiName: "string", - databaseId: "uuid", - entityField: "string", - entityFkTableId: "uuid", - id: "uuid", - inferenceLogTableId: "uuid", - inferenceLogTableName: "string", - interval: "string", - prefix: "string", - premake: "int", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - retention: "string", - schemaId: "uuid", - scope: "string", - usageSummaryTableId: "uuid", - usageSummaryTableName: "string" + actorFkTableId: 'uuid', + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityFkTableId: 'uuid', + id: 'uuid', + inferenceLogTableId: 'uuid', + inferenceLogTableName: 'string', + interval: 'string', + prefix: 'string', + premake: 'int', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + retention: 'string', + schemaId: 'uuid', + scope: 'string', + usageSummaryTableId: 'uuid', + usageSummaryTableName: 'string', }; -const usage = "\ninference-log-module \n\nCommands:\n list List inferenceLogModule records\n find-first Find first matching inferenceLogModule record\n get Get a inferenceLogModule by ID\n create Create a new inferenceLogModule\n update Update an existing inferenceLogModule\n delete Delete a inferenceLogModule\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) => { +const usage = + '\ninference-log-module \n\nCommands:\n list List inferenceLogModule records\n find-first Find first matching inferenceLogModule record\n get Get a inferenceLogModule by ID\n create Create a new inferenceLogModule\n update Update an existing inferenceLogModule\n delete Delete a inferenceLogModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, usageSummaryTableId: true, - usageSummaryTableName: true + usageSummaryTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: InferenceLogModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy + > & { + select: InferenceLogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.inferenceLogModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +151,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, usageSummaryTableId: true, - usageSummaryTableName: true + usageSummaryTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InferenceLogModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy + > & { + select: InferenceLogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.inferenceLogModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +175,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.inferenceLogModule.findOne({ - id: answers.id as string, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - inferenceLogTableId: true, - inferenceLogTableName: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.inferenceLogModule + .findOne({ + id: answers.id as string, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + inferenceLogTableId: true, + inferenceLogTableName: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,170 +222,195 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorFkTableId", - message: "actorFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityFkTableId", - message: "entityFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inferenceLogTableId", - message: "inferenceLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inferenceLogTableName", - message: "inferenceLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "usageSummaryTableId", - message: "usageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableName", - message: "usageSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorFkTableId', + message: 'actorFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityFkTableId', + message: 'entityFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inferenceLogTableId', + message: 'inferenceLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inferenceLogTableName', + message: 'inferenceLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'usageSummaryTableId', + message: 'usageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableName', + message: 'usageSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInferenceLogModuleInput["inferenceLogModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateInferenceLogModuleInput['inferenceLogModule']; const client = getClient(); - const result = await client.inferenceLogModule.create({ - data: { - actorFkTableId: cleanedData.actorFkTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityFkTableId: cleanedData.entityFkTableId, - inferenceLogTableId: cleanedData.inferenceLogTableId, - inferenceLogTableName: cleanedData.inferenceLogTableName, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - usageSummaryTableId: cleanedData.usageSummaryTableId, - usageSummaryTableName: cleanedData.usageSummaryTableName - }, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - inferenceLogTableId: true, - inferenceLogTableName: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.inferenceLogModule + .create({ + data: { + actorFkTableId: cleanedData.actorFkTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityFkTableId: cleanedData.entityFkTableId, + inferenceLogTableId: cleanedData.inferenceLogTableId, + inferenceLogTableName: cleanedData.inferenceLogTableName, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + usageSummaryTableId: cleanedData.usageSummaryTableId, + usageSummaryTableName: cleanedData.usageSummaryTableName, + }, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + inferenceLogTableId: true, + inferenceLogTableName: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -364,178 +419,201 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorFkTableId", - message: "actorFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityFkTableId", - message: "entityFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inferenceLogTableId", - message: "inferenceLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "inferenceLogTableName", - message: "inferenceLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "usageSummaryTableId", - message: "usageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableName", - message: "usageSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorFkTableId', + message: 'actorFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityFkTableId', + message: 'entityFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inferenceLogTableId', + message: 'inferenceLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'inferenceLogTableName', + message: 'inferenceLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'usageSummaryTableId', + message: 'usageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableName', + message: 'usageSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InferenceLogModulePatch; const client = getClient(); - const result = await client.inferenceLogModule.update({ - where: { - id: answers.id as string - }, - data: { - actorFkTableId: cleanedData.actorFkTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityFkTableId: cleanedData.entityFkTableId, - inferenceLogTableId: cleanedData.inferenceLogTableId, - inferenceLogTableName: cleanedData.inferenceLogTableName, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - usageSummaryTableId: cleanedData.usageSummaryTableId, - usageSummaryTableName: cleanedData.usageSummaryTableName - }, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - inferenceLogTableId: true, - inferenceLogTableName: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.inferenceLogModule + .update({ + where: { + id: answers.id as string, + }, + data: { + actorFkTableId: cleanedData.actorFkTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityFkTableId: cleanedData.entityFkTableId, + inferenceLogTableId: cleanedData.inferenceLogTableId, + inferenceLogTableName: cleanedData.inferenceLogTableName, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + usageSummaryTableId: cleanedData.usageSummaryTableId, + usageSummaryTableName: cleanedData.usageSummaryTableName, + }, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + inferenceLogTableId: true, + inferenceLogTableName: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -544,28 +622,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.inferenceLogModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.inferenceLogModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/infra-config-module.ts b/sdk/constructive-cli/src/modules/cli/commands/infra-config-module.ts index a41e46d4d7..0b344062c5 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/infra-config-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/infra-config-module.ts @@ -3,64 +3,78 @@ * @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 { CreateInfraConfigModuleInput, InfraConfigModulePatch, InfraConfigModuleSelect, InfraConfigModuleFilter, InfraConfigModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInfraConfigModuleInput, + InfraConfigModulePatch, + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - configTableId: "uuid", - configTableName: "string", - databaseId: "uuid", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + configTableId: 'uuid', + configTableName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\ninfra-config-module \n\nCommands:\n list List infraConfigModule records\n find-first Find first matching infraConfigModule record\n get Get a infraConfigModule by ID\n create Create a new infraConfigModule\n update Update an existing infraConfigModule\n delete Delete a infraConfigModule\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) => { +const usage = + '\ninfra-config-module \n\nCommands:\n list List infraConfigModule records\n find-first Find first matching infraConfigModule record\n get Get a infraConfigModule by ID\n create Create a new infraConfigModule\n update Update an existing infraConfigModule\n delete Delete a infraConfigModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,18 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: InfraConfigModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: InfraConfigModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraConfigModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +135,18 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InfraConfigModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: InfraConfigModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraConfigModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +155,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.infraConfigModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - configTableId: true, - configTableName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.infraConfigModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + configTableId: true, + configTableName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,138 +198,159 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "configTableId", - message: "configTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "configTableName", - message: "configTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'configTableId', + message: 'configTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'configTableName', + message: 'configTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraConfigModuleInput["infraConfigModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateInfraConfigModuleInput['infraConfigModule']; const client = getClient(); - const result = await client.infraConfigModule.create({ - data: { - apiName: cleanedData.apiName, - configTableId: cleanedData.configTableId, - configTableName: cleanedData.configTableName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - configTableId: true, - configTableName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.infraConfigModule + .create({ + data: { + apiName: cleanedData.apiName, + configTableId: cleanedData.configTableId, + configTableName: cleanedData.configTableName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + configTableId: true, + configTableName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -316,146 +359,165 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "configTableId", - message: "configTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "configTableName", - message: "configTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'configTableId', + message: 'configTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'configTableName', + message: 'configTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InfraConfigModulePatch; const client = getClient(); - const result = await client.infraConfigModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - configTableId: cleanedData.configTableId, - configTableName: cleanedData.configTableName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - configTableId: true, - configTableName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.infraConfigModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + configTableId: cleanedData.configTableId, + configTableName: cleanedData.configTableName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + configTableId: true, + configTableName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -464,28 +526,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.infraConfigModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.infraConfigModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/infra-secrets-module.ts b/sdk/constructive-cli/src/modules/cli/commands/infra-secrets-module.ts index cccd19c2d0..fca6ddb2b9 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/infra-secrets-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/infra-secrets-module.ts @@ -3,64 +3,78 @@ * @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 { CreateInfraSecretsModuleInput, InfraSecretsModulePatch, InfraSecretsModuleSelect, InfraSecretsModuleFilter, InfraSecretsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInfraSecretsModuleInput, + InfraSecretsModulePatch, + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - secretsTableId: "uuid", - secretsTableName: "string" + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + secretsTableId: 'uuid', + secretsTableName: 'string', }; -const usage = "\ninfra-secrets-module \n\nCommands:\n list List infraSecretsModule records\n find-first Find first matching infraSecretsModule record\n get Get a infraSecretsModule by ID\n create Create a new infraSecretsModule\n update Update an existing infraSecretsModule\n delete Delete a infraSecretsModule\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) => { +const usage = + '\ninfra-secrets-module \n\nCommands:\n list List infraSecretsModule records\n find-first Find first matching infraSecretsModule record\n get Get a infraSecretsModule by ID\n create Create a new infraSecretsModule\n update Update an existing infraSecretsModule\n delete Delete a infraSecretsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, secretsTableId: true, - secretsTableName: true + secretsTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: InfraSecretsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy + > & { + select: InfraSecretsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraSecretsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +139,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, secretsTableId: true, - secretsTableName: true + secretsTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InfraSecretsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy + > & { + select: InfraSecretsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.infraSecretsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +163,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.infraSecretsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - secretsTableId: true, - secretsTableName: true - } - }).execute(); + const result = await client.infraSecretsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + secretsTableId: true, + secretsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,138 +206,159 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "secretsTableId", - message: "secretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "secretsTableName", - message: "secretsTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'secretsTableId', + message: 'secretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'secretsTableName', + message: 'secretsTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInfraSecretsModuleInput["infraSecretsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateInfraSecretsModuleInput['infraSecretsModule']; const client = getClient(); - const result = await client.infraSecretsModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - secretsTableId: cleanedData.secretsTableId, - secretsTableName: cleanedData.secretsTableName - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - secretsTableId: true, - secretsTableName: true - } - }).execute(); + const result = await client.infraSecretsModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + secretsTableId: cleanedData.secretsTableId, + secretsTableName: cleanedData.secretsTableName, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + secretsTableId: true, + secretsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -316,146 +367,165 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "secretsTableId", - message: "secretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "secretsTableName", - message: "secretsTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'secretsTableId', + message: 'secretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'secretsTableName', + message: 'secretsTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InfraSecretsModulePatch; const client = getClient(); - const result = await client.infraSecretsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - secretsTableId: cleanedData.secretsTableId, - secretsTableName: cleanedData.secretsTableName - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - secretsTableId: true, - secretsTableName: true - } - }).execute(); + const result = await client.infraSecretsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + secretsTableId: cleanedData.secretsTableId, + secretsTableName: cleanedData.secretsTableName, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + secretsTableId: true, + secretsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -464,28 +534,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.infraSecretsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.infraSecretsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/integration-providers-module.ts b/sdk/constructive-cli/src/modules/cli/commands/integration-providers-module.ts index 2ddd69bdde..05ce640e7b 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/integration-providers-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/integration-providers-module.ts @@ -3,62 +3,76 @@ * @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 { CreateIntegrationProvidersModuleInput, IntegrationProvidersModulePatch, IntegrationProvidersModuleSelect, IntegrationProvidersModuleFilter, IntegrationProvidersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateIntegrationProvidersModuleInput, + IntegrationProvidersModulePatch, + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - tableId: "uuid", - tableName: "string" + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nintegration-providers-module \n\nCommands:\n list List integrationProvidersModule records\n find-first Find first matching integrationProvidersModule record\n get Get a integrationProvidersModule by ID\n create Create a new integrationProvidersModule\n update Update an existing integrationProvidersModule\n delete Delete a integrationProvidersModule\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) => { +const usage = + '\nintegration-providers-module \n\nCommands:\n list List integrationProvidersModule records\n find-first Find first matching integrationProvidersModule record\n get Get a integrationProvidersModule by ID\n create Create a new integrationProvidersModule\n update Update an existing integrationProvidersModule\n delete Delete a integrationProvidersModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: IntegrationProvidersModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy + > & { + select: IntegrationProvidersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.integrationProvidersModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +133,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: IntegrationProvidersModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy + > & { + select: IntegrationProvidersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.integrationProvidersModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +157,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.integrationProvidersModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.integrationProvidersModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,122 +198,141 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateIntegrationProvidersModuleInput["integrationProvidersModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateIntegrationProvidersModuleInput['integrationProvidersModule']; const client = getClient(); - const result = await client.integrationProvidersModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.integrationProvidersModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -292,130 +341,147 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as IntegrationProvidersModulePatch; const client = getClient(); - const result = await client.integrationProvidersModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.integrationProvidersModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -424,28 +490,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.integrationProvidersModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.integrationProvidersModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/internal-secrets-module.ts b/sdk/constructive-cli/src/modules/cli/commands/internal-secrets-module.ts index f8d312fd65..8bfd052ba5 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/internal-secrets-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/internal-secrets-module.ts @@ -3,64 +3,78 @@ * @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 { CreateInternalSecretsModuleInput, InternalSecretsModulePatch, InternalSecretsModuleSelect, InternalSecretsModuleFilter, InternalSecretsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInternalSecretsModuleInput, + InternalSecretsModulePatch, + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - internalSecretsTableId: "uuid", - internalSecretsTableName: "string", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + internalSecretsTableId: 'uuid', + internalSecretsTableName: 'string', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\ninternal-secrets-module \n\nCommands:\n list List internalSecretsModule records\n find-first Find first matching internalSecretsModule record\n get Get a internalSecretsModule by ID\n create Create a new internalSecretsModule\n update Update an existing internalSecretsModule\n delete Delete a internalSecretsModule\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) => { +const usage = + '\ninternal-secrets-module \n\nCommands:\n list List internalSecretsModule records\n find-first Find first matching internalSecretsModule record\n get Get a internalSecretsModule by ID\n create Create a new internalSecretsModule\n update Update an existing internalSecretsModule\n delete Delete a internalSecretsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,22 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: InternalSecretsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy + > & { + select: InternalSecretsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.internalSecretsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +139,22 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InternalSecretsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy + > & { + select: InternalSecretsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.internalSecretsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +163,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.internalSecretsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - internalSecretsTableId: true, - internalSecretsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.internalSecretsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + internalSecretsTableId: true, + internalSecretsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,138 +206,159 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "internalSecretsTableId", - message: "internalSecretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "internalSecretsTableName", - message: "internalSecretsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'internalSecretsTableId', + message: 'internalSecretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'internalSecretsTableName', + message: 'internalSecretsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInternalSecretsModuleInput["internalSecretsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateInternalSecretsModuleInput['internalSecretsModule']; const client = getClient(); - const result = await client.internalSecretsModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - internalSecretsTableId: cleanedData.internalSecretsTableId, - internalSecretsTableName: cleanedData.internalSecretsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - internalSecretsTableId: true, - internalSecretsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.internalSecretsModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + internalSecretsTableId: cleanedData.internalSecretsTableId, + internalSecretsTableName: cleanedData.internalSecretsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + internalSecretsTableId: true, + internalSecretsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -316,146 +367,165 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "internalSecretsTableId", - message: "internalSecretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "internalSecretsTableName", - message: "internalSecretsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'internalSecretsTableId', + message: 'internalSecretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'internalSecretsTableName', + message: 'internalSecretsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InternalSecretsModulePatch; const client = getClient(); - const result = await client.internalSecretsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - internalSecretsTableId: cleanedData.internalSecretsTableId, - internalSecretsTableName: cleanedData.internalSecretsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - internalSecretsTableId: true, - internalSecretsTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.internalSecretsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + internalSecretsTableId: cleanedData.internalSecretsTableId, + internalSecretsTableName: cleanedData.internalSecretsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + internalSecretsTableId: true, + internalSecretsTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -464,28 +534,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.internalSecretsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.internalSecretsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/invites-module.ts b/sdk/constructive-cli/src/modules/cli/commands/invites-module.ts index f9565fa2be..df989a1b27 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/invites-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/invites-module.ts @@ -3,67 +3,81 @@ * @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 { CreateInvitesModuleInput, InvitesModulePatch, InvitesModuleSelect, InvitesModuleFilter, InvitesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateInvitesModuleInput, + InvitesModulePatch, + InvitesModuleSelect, + InvitesModuleFilter, + InvitesModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - claimedInvitesTableId: "uuid", - claimedInvitesTableName: "string", - databaseId: "uuid", - emailsTableId: "uuid", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - invitesTableId: "uuid", - invitesTableName: "string", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - submitInviteCodeFunction: "string", - usersTableId: "uuid" + apiName: 'string', + claimedInvitesTableId: 'uuid', + claimedInvitesTableName: 'string', + databaseId: 'uuid', + emailsTableId: 'uuid', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + invitesTableId: 'uuid', + invitesTableName: 'string', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + submitInviteCodeFunction: 'string', + usersTableId: 'uuid', }; -const usage = "\ninvites-module \n\nCommands:\n list List invitesModule records\n find-first Find first matching invitesModule record\n get Get a invitesModule by ID\n create Create a new invitesModule\n update Update an existing invitesModule\n delete Delete a invitesModule\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) => { +const usage = + '\ninvites-module \n\nCommands:\n list List invitesModule records\n find-first Find first matching invitesModule record\n get Get a invitesModule by ID\n create Create a new invitesModule\n update Update an existing invitesModule\n delete Delete a invitesModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -91,16 +105,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, submitInviteCodeFunction: true, - usersTableId: true + usersTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: InvitesModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: InvitesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.invitesModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -128,16 +144,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, submitInviteCodeFunction: true, - usersTableId: true + usersTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: InvitesModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: InvitesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.invitesModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -146,40 +164,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.invitesModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - claimedInvitesTableId: true, - claimedInvitesTableName: true, - databaseId: true, - emailsTableId: true, - entityField: true, - entityTableId: true, - id: true, - invitesTableId: true, - invitesTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - submitInviteCodeFunction: true, - usersTableId: true - } - }).execute(); + const result = await client.invitesModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + claimedInvitesTableId: true, + claimedInvitesTableName: true, + databaseId: true, + emailsTableId: true, + entityField: true, + entityTableId: true, + id: true, + invitesTableId: true, + invitesTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + submitInviteCodeFunction: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -188,162 +210,186 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "claimedInvitesTableId", - message: "claimedInvitesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "claimedInvitesTableName", - message: "claimedInvitesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "emailsTableId", - message: "emailsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invitesTableId", - message: "invitesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invitesTableName", - message: "invitesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "submitInviteCodeFunction", - message: "submitInviteCodeFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'claimedInvitesTableId', + message: 'claimedInvitesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'claimedInvitesTableName', + message: 'claimedInvitesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'emailsTableId', + message: 'emailsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invitesTableId', + message: 'invitesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invitesTableName', + message: 'invitesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'submitInviteCodeFunction', + message: 'submitInviteCodeFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateInvitesModuleInput["invitesModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateInvitesModuleInput['invitesModule']; const client = getClient(); - const result = await client.invitesModule.create({ - data: { - apiName: cleanedData.apiName, - claimedInvitesTableId: cleanedData.claimedInvitesTableId, - claimedInvitesTableName: cleanedData.claimedInvitesTableName, - databaseId: cleanedData.databaseId, - emailsTableId: cleanedData.emailsTableId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - invitesTableId: cleanedData.invitesTableId, - invitesTableName: cleanedData.invitesTableName, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - submitInviteCodeFunction: cleanedData.submitInviteCodeFunction, - usersTableId: cleanedData.usersTableId - }, - select: { - apiName: true, - claimedInvitesTableId: true, - claimedInvitesTableName: true, - databaseId: true, - emailsTableId: true, - entityField: true, - entityTableId: true, - id: true, - invitesTableId: true, - invitesTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - submitInviteCodeFunction: true, - usersTableId: true - } - }).execute(); + const result = await client.invitesModule + .create({ + data: { + apiName: cleanedData.apiName, + claimedInvitesTableId: cleanedData.claimedInvitesTableId, + claimedInvitesTableName: cleanedData.claimedInvitesTableName, + databaseId: cleanedData.databaseId, + emailsTableId: cleanedData.emailsTableId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + invitesTableId: cleanedData.invitesTableId, + invitesTableName: cleanedData.invitesTableName, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + submitInviteCodeFunction: cleanedData.submitInviteCodeFunction, + usersTableId: cleanedData.usersTableId, + }, + select: { + apiName: true, + claimedInvitesTableId: true, + claimedInvitesTableName: true, + databaseId: true, + emailsTableId: true, + entityField: true, + entityTableId: true, + id: true, + invitesTableId: true, + invitesTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + submitInviteCodeFunction: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -352,170 +398,192 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "claimedInvitesTableId", - message: "claimedInvitesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "claimedInvitesTableName", - message: "claimedInvitesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "emailsTableId", - message: "emailsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invitesTableId", - message: "invitesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "invitesTableName", - message: "invitesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "submitInviteCodeFunction", - message: "submitInviteCodeFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'claimedInvitesTableId', + message: 'claimedInvitesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'claimedInvitesTableName', + message: 'claimedInvitesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'emailsTableId', + message: 'emailsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invitesTableId', + message: 'invitesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'invitesTableName', + message: 'invitesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'submitInviteCodeFunction', + message: 'submitInviteCodeFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as InvitesModulePatch; const client = getClient(); - const result = await client.invitesModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - claimedInvitesTableId: cleanedData.claimedInvitesTableId, - claimedInvitesTableName: cleanedData.claimedInvitesTableName, - databaseId: cleanedData.databaseId, - emailsTableId: cleanedData.emailsTableId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - invitesTableId: cleanedData.invitesTableId, - invitesTableName: cleanedData.invitesTableName, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - submitInviteCodeFunction: cleanedData.submitInviteCodeFunction, - usersTableId: cleanedData.usersTableId - }, - select: { - apiName: true, - claimedInvitesTableId: true, - claimedInvitesTableName: true, - databaseId: true, - emailsTableId: true, - entityField: true, - entityTableId: true, - id: true, - invitesTableId: true, - invitesTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - submitInviteCodeFunction: true, - usersTableId: true - } - }).execute(); + const result = await client.invitesModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + claimedInvitesTableId: cleanedData.claimedInvitesTableId, + claimedInvitesTableName: cleanedData.claimedInvitesTableName, + databaseId: cleanedData.databaseId, + emailsTableId: cleanedData.emailsTableId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + invitesTableId: cleanedData.invitesTableId, + invitesTableName: cleanedData.invitesTableName, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + submitInviteCodeFunction: cleanedData.submitInviteCodeFunction, + usersTableId: cleanedData.usersTableId, + }, + select: { + apiName: true, + claimedInvitesTableId: true, + claimedInvitesTableName: true, + databaseId: true, + emailsTableId: true, + entityField: true, + entityTableId: true, + id: true, + invitesTableId: true, + invitesTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + submitInviteCodeFunction: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -524,28 +592,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.invitesModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.invitesModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/limits-module.ts b/sdk/constructive-cli/src/modules/cli/commands/limits-module.ts index 993c8167b1..fda2f124a0 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/limits-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/limits-module.ts @@ -3,85 +3,99 @@ * @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 { CreateLimitsModuleInput, LimitsModulePatch, LimitsModuleSelect, LimitsModuleFilter, LimitsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateLimitsModuleInput, + LimitsModulePatch, + LimitsModuleSelect, + LimitsModuleFilter, + LimitsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorTableId: "uuid", - aggregateTableId: "uuid", - apiName: "string", - capCheckTrigger: "string", - creditCodeItemsTableId: "uuid", - creditCodesTableId: "uuid", - creditRedemptionsTableId: "uuid", - databaseId: "uuid", - defaultTableId: "uuid", - defaultTableName: "string", - entityField: "string", - entityTableId: "uuid", - eventsTableId: "uuid", - id: "uuid", - limitAggregateCheckSoftFunction: "string", - limitCapsDefaultsTableId: "uuid", - limitCapsTableId: "uuid", - limitCheckFunction: "string", - limitCheckSoftFunction: "string", - limitCreditsTableId: "uuid", - limitDecrementFunction: "string", - limitDecrementTrigger: "string", - limitIncrementFunction: "string", - limitIncrementTrigger: "string", - limitUpdateTrigger: "string", - limitWarningStateTableId: "uuid", - limitWarningsTableId: "uuid", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - resolveCapFunction: "string", - schemaId: "uuid", - scope: "string", - tableId: "uuid", - tableName: "string" + actorTableId: 'uuid', + aggregateTableId: 'uuid', + apiName: 'string', + capCheckTrigger: 'string', + creditCodeItemsTableId: 'uuid', + creditCodesTableId: 'uuid', + creditRedemptionsTableId: 'uuid', + databaseId: 'uuid', + defaultTableId: 'uuid', + defaultTableName: 'string', + entityField: 'string', + entityTableId: 'uuid', + eventsTableId: 'uuid', + id: 'uuid', + limitAggregateCheckSoftFunction: 'string', + limitCapsDefaultsTableId: 'uuid', + limitCapsTableId: 'uuid', + limitCheckFunction: 'string', + limitCheckSoftFunction: 'string', + limitCreditsTableId: 'uuid', + limitDecrementFunction: 'string', + limitDecrementTrigger: 'string', + limitIncrementFunction: 'string', + limitIncrementTrigger: 'string', + limitUpdateTrigger: 'string', + limitWarningStateTableId: 'uuid', + limitWarningsTableId: 'uuid', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + resolveCapFunction: 'string', + schemaId: 'uuid', + scope: 'string', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nlimits-module \n\nCommands:\n list List limitsModule records\n find-first Find first matching limitsModule record\n get Get a limitsModule by ID\n create Create a new limitsModule\n update Update an existing limitsModule\n delete Delete a limitsModule\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) => { +const usage = + '\nlimits-module \n\nCommands:\n list List limitsModule records\n find-first Find first matching limitsModule record\n get Get a limitsModule by ID\n create Create a new limitsModule\n update Update an existing limitsModule\n delete Delete a limitsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -127,16 +141,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: LimitsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: LimitsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.limitsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -182,16 +198,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: LimitsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: LimitsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.limitsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -200,58 +218,62 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.limitsModule.findOne({ - id: answers.id as string, - select: { - actorTableId: true, - aggregateTableId: true, - apiName: true, - capCheckTrigger: true, - creditCodeItemsTableId: true, - creditCodesTableId: true, - creditRedemptionsTableId: true, - databaseId: true, - defaultTableId: true, - defaultTableName: true, - entityField: true, - entityTableId: true, - eventsTableId: true, - id: true, - limitAggregateCheckSoftFunction: true, - limitCapsDefaultsTableId: true, - limitCapsTableId: true, - limitCheckFunction: true, - limitCheckSoftFunction: true, - limitCreditsTableId: true, - limitDecrementFunction: true, - limitDecrementTrigger: true, - limitIncrementFunction: true, - limitIncrementTrigger: true, - limitUpdateTrigger: true, - limitWarningStateTableId: true, - limitWarningsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - resolveCapFunction: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.limitsModule + .findOne({ + id: answers.id as string, + select: { + actorTableId: true, + aggregateTableId: true, + apiName: true, + capCheckTrigger: true, + creditCodeItemsTableId: true, + creditCodesTableId: true, + creditRedemptionsTableId: true, + databaseId: true, + defaultTableId: true, + defaultTableName: true, + entityField: true, + entityTableId: true, + eventsTableId: true, + id: true, + limitAggregateCheckSoftFunction: true, + limitCapsDefaultsTableId: true, + limitCapsTableId: true, + limitCheckFunction: true, + limitCheckSoftFunction: true, + limitCreditsTableId: true, + limitDecrementFunction: true, + limitDecrementTrigger: true, + limitIncrementFunction: true, + limitIncrementTrigger: true, + limitUpdateTrigger: true, + limitWarningStateTableId: true, + limitWarningsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + resolveCapFunction: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -260,306 +282,348 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "aggregateTableId", - message: "aggregateTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "capCheckTrigger", - message: "capCheckTrigger", - required: false, - skipPrompt: true - }, { - type: "text", - name: "creditCodeItemsTableId", - message: "creditCodeItemsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "creditCodesTableId", - message: "creditCodesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "creditRedemptionsTableId", - message: "creditRedemptionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultTableId", - message: "defaultTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultTableName", - message: "defaultTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventsTableId", - message: "eventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitAggregateCheckSoftFunction", - message: "limitAggregateCheckSoftFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCapsDefaultsTableId", - message: "limitCapsDefaultsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCapsTableId", - message: "limitCapsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCheckFunction", - message: "limitCheckFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCheckSoftFunction", - message: "limitCheckSoftFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCreditsTableId", - message: "limitCreditsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitDecrementFunction", - message: "limitDecrementFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitDecrementTrigger", - message: "limitDecrementTrigger", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitIncrementFunction", - message: "limitIncrementFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitIncrementTrigger", - message: "limitIncrementTrigger", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitUpdateTrigger", - message: "limitUpdateTrigger", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitWarningStateTableId", - message: "limitWarningStateTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitWarningsTableId", - message: "limitWarningsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resolveCapFunction", - message: "resolveCapFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'aggregateTableId', + message: 'aggregateTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'capCheckTrigger', + message: 'capCheckTrigger', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'creditCodeItemsTableId', + message: 'creditCodeItemsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'creditCodesTableId', + message: 'creditCodesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'creditRedemptionsTableId', + message: 'creditRedemptionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultTableId', + message: 'defaultTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultTableName', + message: 'defaultTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventsTableId', + message: 'eventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitAggregateCheckSoftFunction', + message: 'limitAggregateCheckSoftFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCapsDefaultsTableId', + message: 'limitCapsDefaultsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCapsTableId', + message: 'limitCapsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCheckFunction', + message: 'limitCheckFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCheckSoftFunction', + message: 'limitCheckSoftFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCreditsTableId', + message: 'limitCreditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitDecrementFunction', + message: 'limitDecrementFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitDecrementTrigger', + message: 'limitDecrementTrigger', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitIncrementFunction', + message: 'limitIncrementFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitIncrementTrigger', + message: 'limitIncrementTrigger', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitUpdateTrigger', + message: 'limitUpdateTrigger', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitWarningStateTableId', + message: 'limitWarningStateTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitWarningsTableId', + message: 'limitWarningsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resolveCapFunction', + message: 'resolveCapFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateLimitsModuleInput["limitsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateLimitsModuleInput['limitsModule']; const client = getClient(); - const result = await client.limitsModule.create({ - data: { - actorTableId: cleanedData.actorTableId, - aggregateTableId: cleanedData.aggregateTableId, - apiName: cleanedData.apiName, - capCheckTrigger: cleanedData.capCheckTrigger, - creditCodeItemsTableId: cleanedData.creditCodeItemsTableId, - creditCodesTableId: cleanedData.creditCodesTableId, - creditRedemptionsTableId: cleanedData.creditRedemptionsTableId, - databaseId: cleanedData.databaseId, - defaultTableId: cleanedData.defaultTableId, - defaultTableName: cleanedData.defaultTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - eventsTableId: cleanedData.eventsTableId, - limitAggregateCheckSoftFunction: cleanedData.limitAggregateCheckSoftFunction, - limitCapsDefaultsTableId: cleanedData.limitCapsDefaultsTableId, - limitCapsTableId: cleanedData.limitCapsTableId, - limitCheckFunction: cleanedData.limitCheckFunction, - limitCheckSoftFunction: cleanedData.limitCheckSoftFunction, - limitCreditsTableId: cleanedData.limitCreditsTableId, - limitDecrementFunction: cleanedData.limitDecrementFunction, - limitDecrementTrigger: cleanedData.limitDecrementTrigger, - limitIncrementFunction: cleanedData.limitIncrementFunction, - limitIncrementTrigger: cleanedData.limitIncrementTrigger, - limitUpdateTrigger: cleanedData.limitUpdateTrigger, - limitWarningStateTableId: cleanedData.limitWarningStateTableId, - limitWarningsTableId: cleanedData.limitWarningsTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - resolveCapFunction: cleanedData.resolveCapFunction, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - actorTableId: true, - aggregateTableId: true, - apiName: true, - capCheckTrigger: true, - creditCodeItemsTableId: true, - creditCodesTableId: true, - creditRedemptionsTableId: true, - databaseId: true, - defaultTableId: true, - defaultTableName: true, - entityField: true, - entityTableId: true, - eventsTableId: true, - id: true, - limitAggregateCheckSoftFunction: true, - limitCapsDefaultsTableId: true, - limitCapsTableId: true, - limitCheckFunction: true, - limitCheckSoftFunction: true, - limitCreditsTableId: true, - limitDecrementFunction: true, - limitDecrementTrigger: true, - limitIncrementFunction: true, - limitIncrementTrigger: true, - limitUpdateTrigger: true, - limitWarningStateTableId: true, - limitWarningsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - resolveCapFunction: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.limitsModule + .create({ + data: { + actorTableId: cleanedData.actorTableId, + aggregateTableId: cleanedData.aggregateTableId, + apiName: cleanedData.apiName, + capCheckTrigger: cleanedData.capCheckTrigger, + creditCodeItemsTableId: cleanedData.creditCodeItemsTableId, + creditCodesTableId: cleanedData.creditCodesTableId, + creditRedemptionsTableId: cleanedData.creditRedemptionsTableId, + databaseId: cleanedData.databaseId, + defaultTableId: cleanedData.defaultTableId, + defaultTableName: cleanedData.defaultTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + eventsTableId: cleanedData.eventsTableId, + limitAggregateCheckSoftFunction: cleanedData.limitAggregateCheckSoftFunction, + limitCapsDefaultsTableId: cleanedData.limitCapsDefaultsTableId, + limitCapsTableId: cleanedData.limitCapsTableId, + limitCheckFunction: cleanedData.limitCheckFunction, + limitCheckSoftFunction: cleanedData.limitCheckSoftFunction, + limitCreditsTableId: cleanedData.limitCreditsTableId, + limitDecrementFunction: cleanedData.limitDecrementFunction, + limitDecrementTrigger: cleanedData.limitDecrementTrigger, + limitIncrementFunction: cleanedData.limitIncrementFunction, + limitIncrementTrigger: cleanedData.limitIncrementTrigger, + limitUpdateTrigger: cleanedData.limitUpdateTrigger, + limitWarningStateTableId: cleanedData.limitWarningStateTableId, + limitWarningsTableId: cleanedData.limitWarningsTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + resolveCapFunction: cleanedData.resolveCapFunction, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + actorTableId: true, + aggregateTableId: true, + apiName: true, + capCheckTrigger: true, + creditCodeItemsTableId: true, + creditCodesTableId: true, + creditRedemptionsTableId: true, + databaseId: true, + defaultTableId: true, + defaultTableName: true, + entityField: true, + entityTableId: true, + eventsTableId: true, + id: true, + limitAggregateCheckSoftFunction: true, + limitCapsDefaultsTableId: true, + limitCapsTableId: true, + limitCheckFunction: true, + limitCheckSoftFunction: true, + limitCreditsTableId: true, + limitDecrementFunction: true, + limitDecrementTrigger: true, + limitIncrementFunction: true, + limitIncrementTrigger: true, + limitUpdateTrigger: true, + limitWarningStateTableId: true, + limitWarningsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + resolveCapFunction: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -568,314 +632,354 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "aggregateTableId", - message: "aggregateTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "capCheckTrigger", - message: "capCheckTrigger", - required: false, - skipPrompt: true - }, { - type: "text", - name: "creditCodeItemsTableId", - message: "creditCodeItemsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "creditCodesTableId", - message: "creditCodesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "creditRedemptionsTableId", - message: "creditRedemptionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultTableId", - message: "defaultTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultTableName", - message: "defaultTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventsTableId", - message: "eventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitAggregateCheckSoftFunction", - message: "limitAggregateCheckSoftFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCapsDefaultsTableId", - message: "limitCapsDefaultsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCapsTableId", - message: "limitCapsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCheckFunction", - message: "limitCheckFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCheckSoftFunction", - message: "limitCheckSoftFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitCreditsTableId", - message: "limitCreditsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitDecrementFunction", - message: "limitDecrementFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitDecrementTrigger", - message: "limitDecrementTrigger", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitIncrementFunction", - message: "limitIncrementFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitIncrementTrigger", - message: "limitIncrementTrigger", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitUpdateTrigger", - message: "limitUpdateTrigger", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitWarningStateTableId", - message: "limitWarningStateTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitWarningsTableId", - message: "limitWarningsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resolveCapFunction", - message: "resolveCapFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'aggregateTableId', + message: 'aggregateTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'capCheckTrigger', + message: 'capCheckTrigger', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'creditCodeItemsTableId', + message: 'creditCodeItemsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'creditCodesTableId', + message: 'creditCodesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'creditRedemptionsTableId', + message: 'creditRedemptionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultTableId', + message: 'defaultTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultTableName', + message: 'defaultTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventsTableId', + message: 'eventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitAggregateCheckSoftFunction', + message: 'limitAggregateCheckSoftFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCapsDefaultsTableId', + message: 'limitCapsDefaultsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCapsTableId', + message: 'limitCapsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCheckFunction', + message: 'limitCheckFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCheckSoftFunction', + message: 'limitCheckSoftFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitCreditsTableId', + message: 'limitCreditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitDecrementFunction', + message: 'limitDecrementFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitDecrementTrigger', + message: 'limitDecrementTrigger', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitIncrementFunction', + message: 'limitIncrementFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitIncrementTrigger', + message: 'limitIncrementTrigger', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitUpdateTrigger', + message: 'limitUpdateTrigger', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitWarningStateTableId', + message: 'limitWarningStateTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitWarningsTableId', + message: 'limitWarningsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resolveCapFunction', + message: 'resolveCapFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as LimitsModulePatch; const client = getClient(); - const result = await client.limitsModule.update({ - where: { - id: answers.id as string - }, - data: { - actorTableId: cleanedData.actorTableId, - aggregateTableId: cleanedData.aggregateTableId, - apiName: cleanedData.apiName, - capCheckTrigger: cleanedData.capCheckTrigger, - creditCodeItemsTableId: cleanedData.creditCodeItemsTableId, - creditCodesTableId: cleanedData.creditCodesTableId, - creditRedemptionsTableId: cleanedData.creditRedemptionsTableId, - databaseId: cleanedData.databaseId, - defaultTableId: cleanedData.defaultTableId, - defaultTableName: cleanedData.defaultTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - eventsTableId: cleanedData.eventsTableId, - limitAggregateCheckSoftFunction: cleanedData.limitAggregateCheckSoftFunction, - limitCapsDefaultsTableId: cleanedData.limitCapsDefaultsTableId, - limitCapsTableId: cleanedData.limitCapsTableId, - limitCheckFunction: cleanedData.limitCheckFunction, - limitCheckSoftFunction: cleanedData.limitCheckSoftFunction, - limitCreditsTableId: cleanedData.limitCreditsTableId, - limitDecrementFunction: cleanedData.limitDecrementFunction, - limitDecrementTrigger: cleanedData.limitDecrementTrigger, - limitIncrementFunction: cleanedData.limitIncrementFunction, - limitIncrementTrigger: cleanedData.limitIncrementTrigger, - limitUpdateTrigger: cleanedData.limitUpdateTrigger, - limitWarningStateTableId: cleanedData.limitWarningStateTableId, - limitWarningsTableId: cleanedData.limitWarningsTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - resolveCapFunction: cleanedData.resolveCapFunction, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - actorTableId: true, - aggregateTableId: true, - apiName: true, - capCheckTrigger: true, - creditCodeItemsTableId: true, - creditCodesTableId: true, - creditRedemptionsTableId: true, - databaseId: true, - defaultTableId: true, - defaultTableName: true, - entityField: true, - entityTableId: true, - eventsTableId: true, - id: true, - limitAggregateCheckSoftFunction: true, - limitCapsDefaultsTableId: true, - limitCapsTableId: true, - limitCheckFunction: true, - limitCheckSoftFunction: true, - limitCreditsTableId: true, - limitDecrementFunction: true, - limitDecrementTrigger: true, - limitIncrementFunction: true, - limitIncrementTrigger: true, - limitUpdateTrigger: true, - limitWarningStateTableId: true, - limitWarningsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - resolveCapFunction: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.limitsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + actorTableId: cleanedData.actorTableId, + aggregateTableId: cleanedData.aggregateTableId, + apiName: cleanedData.apiName, + capCheckTrigger: cleanedData.capCheckTrigger, + creditCodeItemsTableId: cleanedData.creditCodeItemsTableId, + creditCodesTableId: cleanedData.creditCodesTableId, + creditRedemptionsTableId: cleanedData.creditRedemptionsTableId, + databaseId: cleanedData.databaseId, + defaultTableId: cleanedData.defaultTableId, + defaultTableName: cleanedData.defaultTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + eventsTableId: cleanedData.eventsTableId, + limitAggregateCheckSoftFunction: cleanedData.limitAggregateCheckSoftFunction, + limitCapsDefaultsTableId: cleanedData.limitCapsDefaultsTableId, + limitCapsTableId: cleanedData.limitCapsTableId, + limitCheckFunction: cleanedData.limitCheckFunction, + limitCheckSoftFunction: cleanedData.limitCheckSoftFunction, + limitCreditsTableId: cleanedData.limitCreditsTableId, + limitDecrementFunction: cleanedData.limitDecrementFunction, + limitDecrementTrigger: cleanedData.limitDecrementTrigger, + limitIncrementFunction: cleanedData.limitIncrementFunction, + limitIncrementTrigger: cleanedData.limitIncrementTrigger, + limitUpdateTrigger: cleanedData.limitUpdateTrigger, + limitWarningStateTableId: cleanedData.limitWarningStateTableId, + limitWarningsTableId: cleanedData.limitWarningsTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + resolveCapFunction: cleanedData.resolveCapFunction, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + actorTableId: true, + aggregateTableId: true, + apiName: true, + capCheckTrigger: true, + creditCodeItemsTableId: true, + creditCodesTableId: true, + creditRedemptionsTableId: true, + databaseId: true, + defaultTableId: true, + defaultTableName: true, + entityField: true, + entityTableId: true, + eventsTableId: true, + id: true, + limitAggregateCheckSoftFunction: true, + limitCapsDefaultsTableId: true, + limitCapsTableId: true, + limitCheckFunction: true, + limitCheckSoftFunction: true, + limitCreditsTableId: true, + limitDecrementFunction: true, + limitDecrementTrigger: true, + limitIncrementFunction: true, + limitIncrementTrigger: true, + limitUpdateTrigger: true, + limitWarningStateTableId: true, + limitWarningsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + resolveCapFunction: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -884,28 +988,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.limitsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.limitsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/membership-types-module.ts b/sdk/constructive-cli/src/modules/cli/commands/membership-types-module.ts index f4d0301d4b..70c0d5462d 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/membership-types-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/membership-types-module.ts @@ -3,53 +3,67 @@ * @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 { CreateMembershipTypesModuleInput, MembershipTypesModulePatch, MembershipTypesModuleSelect, MembershipTypesModuleFilter, MembershipTypesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateMembershipTypesModuleInput, + MembershipTypesModulePatch, + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - id: "uuid", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + databaseId: 'uuid', + id: 'uuid', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nmembership-types-module \n\nCommands:\n list List membershipTypesModule records\n find-first Find first matching membershipTypesModule record\n get Get a membershipTypesModule by ID\n create Create a new membershipTypesModule\n update Update an existing membershipTypesModule\n delete Delete a membershipTypesModule\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) => { +const usage = + '\nmembership-types-module \n\nCommands:\n list List membershipTypesModule records\n find-first Find first matching membershipTypesModule record\n get Get a membershipTypesModule by ID\n create Create a new membershipTypesModule\n update Update an existing membershipTypesModule\n delete Delete a membershipTypesModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: MembershipTypesModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy + > & { + select: MembershipTypesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.membershipTypesModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: MembershipTypesModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy + > & { + select: MembershipTypesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.membershipTypesModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.membershipTypesModule.findOne({ - id: answers.id as string, - select: { - databaseId: true, - id: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.membershipTypesModule + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + id: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,51 +162,61 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + 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: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateMembershipTypesModuleInput["membershipTypesModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateMembershipTypesModuleInput['membershipTypesModule']; const client = getClient(); - const result = await client.membershipTypesModule.create({ - data: { - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - databaseId: true, - id: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.membershipTypesModule + .create({ + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + databaseId: true, + id: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -185,59 +225,67 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + 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: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as MembershipTypesModulePatch; const client = getClient(); - const result = await client.membershipTypesModule.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - databaseId: true, - id: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.membershipTypesModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + databaseId: true, + id: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -246,28 +294,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.membershipTypesModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.membershipTypesModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/memberships-module.ts b/sdk/constructive-cli/src/modules/cli/commands/memberships-module.ts index a27fd9eeec..09730cf87b 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/memberships-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/memberships-module.ts @@ -3,90 +3,104 @@ * @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 { CreateMembershipsModuleInput, MembershipsModulePatch, MembershipsModuleSelect, MembershipsModuleFilter, MembershipsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateMembershipsModuleInput, + MembershipsModulePatch, + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorMaskCheck: "string", - actorPermCheck: "string", - actorTableId: "uuid", - adminGrantsTableId: "uuid", - adminGrantsTableName: "string", - apiName: "string", - databaseId: "uuid", - defaultLimitsTableId: "uuid", - defaultPermissionsTableId: "uuid", - entityField: "string", - entityIdsByMask: "string", - entityIdsByPerm: "string", - entityIdsFunction: "string", - entityTableId: "uuid", - entityTableOwnerId: "uuid", - getOrgFn: "string", - grantsTableId: "uuid", - grantsTableName: "string", - id: "uuid", - limitsTableId: "uuid", - memberProfilesTableId: "uuid", - membersTableId: "uuid", - membersTableName: "string", - membershipDefaultsTableId: "uuid", - membershipDefaultsTableName: "string", - membershipSettingsTableId: "uuid", - membershipSettingsTableName: "string", - membershipsTableId: "uuid", - membershipsTableName: "string", - ownerGrantsTableId: "uuid", - ownerGrantsTableName: "string", - permissionDefaultGrantsTableId: "uuid", - permissionDefaultPermissionsTableId: "uuid", - permissionsTableId: "uuid", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - sprtTableId: "uuid" + actorMaskCheck: 'string', + actorPermCheck: 'string', + actorTableId: 'uuid', + adminGrantsTableId: 'uuid', + adminGrantsTableName: 'string', + apiName: 'string', + databaseId: 'uuid', + defaultLimitsTableId: 'uuid', + defaultPermissionsTableId: 'uuid', + entityField: 'string', + entityIdsByMask: 'string', + entityIdsByPerm: 'string', + entityIdsFunction: 'string', + entityTableId: 'uuid', + entityTableOwnerId: 'uuid', + getOrgFn: 'string', + grantsTableId: 'uuid', + grantsTableName: 'string', + id: 'uuid', + limitsTableId: 'uuid', + memberProfilesTableId: 'uuid', + membersTableId: 'uuid', + membersTableName: 'string', + membershipDefaultsTableId: 'uuid', + membershipDefaultsTableName: 'string', + membershipSettingsTableId: 'uuid', + membershipSettingsTableName: 'string', + membershipsTableId: 'uuid', + membershipsTableName: 'string', + ownerGrantsTableId: 'uuid', + ownerGrantsTableName: 'string', + permissionDefaultGrantsTableId: 'uuid', + permissionDefaultPermissionsTableId: 'uuid', + permissionsTableId: 'uuid', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + sprtTableId: 'uuid', }; -const usage = "\nmemberships-module \n\nCommands:\n list List membershipsModule records\n find-first Find first matching membershipsModule record\n get Get a membershipsModule by ID\n create Create a new membershipsModule\n update Update an existing membershipsModule\n delete Delete a membershipsModule\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) => { +const usage = + '\nmemberships-module \n\nCommands:\n list List membershipsModule records\n find-first Find first matching membershipsModule record\n get Get a membershipsModule by ID\n create Create a new membershipsModule\n update Update an existing membershipsModule\n delete Delete a membershipsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -137,16 +151,18 @@ async function handleList(argv: Partial>, _prompter: Inq publicSchemaName: true, schemaId: true, scope: true, - sprtTableId: true + sprtTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: MembershipsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: MembershipsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.membershipsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -197,16 +213,18 @@ async function handleFindFirst(argv: Partial>, _prompter publicSchemaName: true, schemaId: true, scope: true, - sprtTableId: true + sprtTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: MembershipsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: MembershipsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.membershipsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -215,63 +233,67 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.membershipsModule.findOne({ - id: answers.id as string, - select: { - actorMaskCheck: true, - actorPermCheck: true, - actorTableId: true, - adminGrantsTableId: true, - adminGrantsTableName: true, - apiName: true, - databaseId: true, - defaultLimitsTableId: true, - defaultPermissionsTableId: true, - entityField: true, - entityIdsByMask: true, - entityIdsByPerm: true, - entityIdsFunction: true, - entityTableId: true, - entityTableOwnerId: true, - getOrgFn: true, - grantsTableId: true, - grantsTableName: true, - id: true, - limitsTableId: true, - memberProfilesTableId: true, - membersTableId: true, - membersTableName: true, - membershipDefaultsTableId: true, - membershipDefaultsTableName: true, - membershipSettingsTableId: true, - membershipSettingsTableName: true, - membershipsTableId: true, - membershipsTableName: true, - ownerGrantsTableId: true, - ownerGrantsTableName: true, - permissionDefaultGrantsTableId: true, - permissionDefaultPermissionsTableId: true, - permissionsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - sprtTableId: true - } - }).execute(); + const result = await client.membershipsModule + .findOne({ + id: answers.id as string, + select: { + actorMaskCheck: true, + actorPermCheck: true, + actorTableId: true, + adminGrantsTableId: true, + adminGrantsTableName: true, + apiName: true, + databaseId: true, + defaultLimitsTableId: true, + defaultPermissionsTableId: true, + entityField: true, + entityIdsByMask: true, + entityIdsByPerm: true, + entityIdsFunction: true, + entityTableId: true, + entityTableOwnerId: true, + getOrgFn: true, + grantsTableId: true, + grantsTableName: true, + id: true, + limitsTableId: true, + memberProfilesTableId: true, + membersTableId: true, + membersTableName: true, + membershipDefaultsTableId: true, + membershipDefaultsTableName: true, + membershipSettingsTableId: true, + membershipSettingsTableName: true, + membershipsTableId: true, + membershipsTableName: true, + ownerGrantsTableId: true, + ownerGrantsTableName: true, + permissionDefaultGrantsTableId: true, + permissionDefaultPermissionsTableId: true, + permissionsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + sprtTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -280,346 +302,393 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorMaskCheck", - message: "actorMaskCheck", - required: false, - skipPrompt: true - }, { - type: "text", - name: "actorPermCheck", - message: "actorPermCheck", - required: false, - skipPrompt: true - }, { - type: "text", - name: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "adminGrantsTableId", - message: "adminGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "adminGrantsTableName", - message: "adminGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultLimitsTableId", - message: "defaultLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultPermissionsTableId", - message: "defaultPermissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityIdsByMask", - message: "entityIdsByMask", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityIdsByPerm", - message: "entityIdsByPerm", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityIdsFunction", - message: "entityIdsFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableOwnerId", - message: "entityTableOwnerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getOrgFn", - message: "getOrgFn", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantsTableId", - message: "grantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantsTableName", - message: "grantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitsTableId", - message: "limitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "memberProfilesTableId", - message: "memberProfilesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membersTableId", - message: "membersTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membersTableName", - message: "membersTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipDefaultsTableId", - message: "membershipDefaultsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipDefaultsTableName", - message: "membershipDefaultsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipSettingsTableId", - message: "membershipSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipSettingsTableName", - message: "membershipSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipsTableId", - message: "membershipsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipsTableName", - message: "membershipsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerGrantsTableId", - message: "ownerGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerGrantsTableName", - message: "ownerGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionDefaultGrantsTableId", - message: "permissionDefaultGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionDefaultPermissionsTableId", - message: "permissionDefaultPermissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionsTableId", - message: "permissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "sprtTableId", - message: "sprtTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorMaskCheck', + message: 'actorMaskCheck', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorPermCheck', + message: 'actorPermCheck', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'adminGrantsTableId', + message: 'adminGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'adminGrantsTableName', + message: 'adminGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultLimitsTableId', + message: 'defaultLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissionsTableId', + message: 'defaultPermissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityIdsByMask', + message: 'entityIdsByMask', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityIdsByPerm', + message: 'entityIdsByPerm', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityIdsFunction', + message: 'entityIdsFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableOwnerId', + message: 'entityTableOwnerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getOrgFn', + message: 'getOrgFn', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantsTableId', + message: 'grantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantsTableName', + message: 'grantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitsTableId', + message: 'limitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'memberProfilesTableId', + message: 'memberProfilesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membersTableId', + message: 'membersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membersTableName', + message: 'membersTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipDefaultsTableId', + message: 'membershipDefaultsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipDefaultsTableName', + message: 'membershipDefaultsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipSettingsTableId', + message: 'membershipSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipSettingsTableName', + message: 'membershipSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipsTableId', + message: 'membershipsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipsTableName', + message: 'membershipsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerGrantsTableId', + message: 'ownerGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerGrantsTableName', + message: 'ownerGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionDefaultGrantsTableId', + message: 'permissionDefaultGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionDefaultPermissionsTableId', + message: 'permissionDefaultPermissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionsTableId', + message: 'permissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'sprtTableId', + message: 'sprtTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateMembershipsModuleInput["membershipsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateMembershipsModuleInput['membershipsModule']; const client = getClient(); - const result = await client.membershipsModule.create({ - data: { - actorMaskCheck: cleanedData.actorMaskCheck, - actorPermCheck: cleanedData.actorPermCheck, - actorTableId: cleanedData.actorTableId, - adminGrantsTableId: cleanedData.adminGrantsTableId, - adminGrantsTableName: cleanedData.adminGrantsTableName, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultLimitsTableId: cleanedData.defaultLimitsTableId, - defaultPermissionsTableId: cleanedData.defaultPermissionsTableId, - entityField: cleanedData.entityField, - entityIdsByMask: cleanedData.entityIdsByMask, - entityIdsByPerm: cleanedData.entityIdsByPerm, - entityIdsFunction: cleanedData.entityIdsFunction, - entityTableId: cleanedData.entityTableId, - entityTableOwnerId: cleanedData.entityTableOwnerId, - getOrgFn: cleanedData.getOrgFn, - grantsTableId: cleanedData.grantsTableId, - grantsTableName: cleanedData.grantsTableName, - limitsTableId: cleanedData.limitsTableId, - memberProfilesTableId: cleanedData.memberProfilesTableId, - membersTableId: cleanedData.membersTableId, - membersTableName: cleanedData.membersTableName, - membershipDefaultsTableId: cleanedData.membershipDefaultsTableId, - membershipDefaultsTableName: cleanedData.membershipDefaultsTableName, - membershipSettingsTableId: cleanedData.membershipSettingsTableId, - membershipSettingsTableName: cleanedData.membershipSettingsTableName, - membershipsTableId: cleanedData.membershipsTableId, - membershipsTableName: cleanedData.membershipsTableName, - ownerGrantsTableId: cleanedData.ownerGrantsTableId, - ownerGrantsTableName: cleanedData.ownerGrantsTableName, - permissionDefaultGrantsTableId: cleanedData.permissionDefaultGrantsTableId, - permissionDefaultPermissionsTableId: cleanedData.permissionDefaultPermissionsTableId, - permissionsTableId: cleanedData.permissionsTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - sprtTableId: cleanedData.sprtTableId - }, - select: { - actorMaskCheck: true, - actorPermCheck: true, - actorTableId: true, - adminGrantsTableId: true, - adminGrantsTableName: true, - apiName: true, - databaseId: true, - defaultLimitsTableId: true, - defaultPermissionsTableId: true, - entityField: true, - entityIdsByMask: true, - entityIdsByPerm: true, - entityIdsFunction: true, - entityTableId: true, - entityTableOwnerId: true, - getOrgFn: true, - grantsTableId: true, - grantsTableName: true, - id: true, - limitsTableId: true, - memberProfilesTableId: true, - membersTableId: true, - membersTableName: true, - membershipDefaultsTableId: true, - membershipDefaultsTableName: true, - membershipSettingsTableId: true, - membershipSettingsTableName: true, - membershipsTableId: true, - membershipsTableName: true, - ownerGrantsTableId: true, - ownerGrantsTableName: true, - permissionDefaultGrantsTableId: true, - permissionDefaultPermissionsTableId: true, - permissionsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - sprtTableId: true - } - }).execute(); + const result = await client.membershipsModule + .create({ + data: { + actorMaskCheck: cleanedData.actorMaskCheck, + actorPermCheck: cleanedData.actorPermCheck, + actorTableId: cleanedData.actorTableId, + adminGrantsTableId: cleanedData.adminGrantsTableId, + adminGrantsTableName: cleanedData.adminGrantsTableName, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultLimitsTableId: cleanedData.defaultLimitsTableId, + defaultPermissionsTableId: cleanedData.defaultPermissionsTableId, + entityField: cleanedData.entityField, + entityIdsByMask: cleanedData.entityIdsByMask, + entityIdsByPerm: cleanedData.entityIdsByPerm, + entityIdsFunction: cleanedData.entityIdsFunction, + entityTableId: cleanedData.entityTableId, + entityTableOwnerId: cleanedData.entityTableOwnerId, + getOrgFn: cleanedData.getOrgFn, + grantsTableId: cleanedData.grantsTableId, + grantsTableName: cleanedData.grantsTableName, + limitsTableId: cleanedData.limitsTableId, + memberProfilesTableId: cleanedData.memberProfilesTableId, + membersTableId: cleanedData.membersTableId, + membersTableName: cleanedData.membersTableName, + membershipDefaultsTableId: cleanedData.membershipDefaultsTableId, + membershipDefaultsTableName: cleanedData.membershipDefaultsTableName, + membershipSettingsTableId: cleanedData.membershipSettingsTableId, + membershipSettingsTableName: cleanedData.membershipSettingsTableName, + membershipsTableId: cleanedData.membershipsTableId, + membershipsTableName: cleanedData.membershipsTableName, + ownerGrantsTableId: cleanedData.ownerGrantsTableId, + ownerGrantsTableName: cleanedData.ownerGrantsTableName, + permissionDefaultGrantsTableId: cleanedData.permissionDefaultGrantsTableId, + permissionDefaultPermissionsTableId: cleanedData.permissionDefaultPermissionsTableId, + permissionsTableId: cleanedData.permissionsTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + sprtTableId: cleanedData.sprtTableId, + }, + select: { + actorMaskCheck: true, + actorPermCheck: true, + actorTableId: true, + adminGrantsTableId: true, + adminGrantsTableName: true, + apiName: true, + databaseId: true, + defaultLimitsTableId: true, + defaultPermissionsTableId: true, + entityField: true, + entityIdsByMask: true, + entityIdsByPerm: true, + entityIdsFunction: true, + entityTableId: true, + entityTableOwnerId: true, + getOrgFn: true, + grantsTableId: true, + grantsTableName: true, + id: true, + limitsTableId: true, + memberProfilesTableId: true, + membersTableId: true, + membersTableName: true, + membershipDefaultsTableId: true, + membershipDefaultsTableName: true, + membershipSettingsTableId: true, + membershipSettingsTableName: true, + membershipsTableId: true, + membershipsTableName: true, + ownerGrantsTableId: true, + ownerGrantsTableName: true, + permissionDefaultGrantsTableId: true, + permissionDefaultPermissionsTableId: true, + permissionsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + sprtTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -628,354 +697,399 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorMaskCheck", - message: "actorMaskCheck", - required: false, - skipPrompt: true - }, { - type: "text", - name: "actorPermCheck", - message: "actorPermCheck", - required: false, - skipPrompt: true - }, { - type: "text", - name: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "adminGrantsTableId", - message: "adminGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "adminGrantsTableName", - message: "adminGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultLimitsTableId", - message: "defaultLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultPermissionsTableId", - message: "defaultPermissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityIdsByMask", - message: "entityIdsByMask", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityIdsByPerm", - message: "entityIdsByPerm", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityIdsFunction", - message: "entityIdsFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableOwnerId", - message: "entityTableOwnerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getOrgFn", - message: "getOrgFn", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantsTableId", - message: "grantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "grantsTableName", - message: "grantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "limitsTableId", - message: "limitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "memberProfilesTableId", - message: "memberProfilesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membersTableId", - message: "membersTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membersTableName", - message: "membersTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipDefaultsTableId", - message: "membershipDefaultsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipDefaultsTableName", - message: "membershipDefaultsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipSettingsTableId", - message: "membershipSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipSettingsTableName", - message: "membershipSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipsTableId", - message: "membershipsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipsTableName", - message: "membershipsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerGrantsTableId", - message: "ownerGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerGrantsTableName", - message: "ownerGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionDefaultGrantsTableId", - message: "permissionDefaultGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionDefaultPermissionsTableId", - message: "permissionDefaultPermissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionsTableId", - message: "permissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "sprtTableId", - message: "sprtTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorMaskCheck', + message: 'actorMaskCheck', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorPermCheck', + message: 'actorPermCheck', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'adminGrantsTableId', + message: 'adminGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'adminGrantsTableName', + message: 'adminGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultLimitsTableId', + message: 'defaultLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissionsTableId', + message: 'defaultPermissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityIdsByMask', + message: 'entityIdsByMask', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityIdsByPerm', + message: 'entityIdsByPerm', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityIdsFunction', + message: 'entityIdsFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableOwnerId', + message: 'entityTableOwnerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getOrgFn', + message: 'getOrgFn', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantsTableId', + message: 'grantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'grantsTableName', + message: 'grantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'limitsTableId', + message: 'limitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'memberProfilesTableId', + message: 'memberProfilesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membersTableId', + message: 'membersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membersTableName', + message: 'membersTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipDefaultsTableId', + message: 'membershipDefaultsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipDefaultsTableName', + message: 'membershipDefaultsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipSettingsTableId', + message: 'membershipSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipSettingsTableName', + message: 'membershipSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipsTableId', + message: 'membershipsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipsTableName', + message: 'membershipsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerGrantsTableId', + message: 'ownerGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerGrantsTableName', + message: 'ownerGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionDefaultGrantsTableId', + message: 'permissionDefaultGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionDefaultPermissionsTableId', + message: 'permissionDefaultPermissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionsTableId', + message: 'permissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'sprtTableId', + message: 'sprtTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as MembershipsModulePatch; const client = getClient(); - const result = await client.membershipsModule.update({ - where: { - id: answers.id as string - }, - data: { - actorMaskCheck: cleanedData.actorMaskCheck, - actorPermCheck: cleanedData.actorPermCheck, - actorTableId: cleanedData.actorTableId, - adminGrantsTableId: cleanedData.adminGrantsTableId, - adminGrantsTableName: cleanedData.adminGrantsTableName, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultLimitsTableId: cleanedData.defaultLimitsTableId, - defaultPermissionsTableId: cleanedData.defaultPermissionsTableId, - entityField: cleanedData.entityField, - entityIdsByMask: cleanedData.entityIdsByMask, - entityIdsByPerm: cleanedData.entityIdsByPerm, - entityIdsFunction: cleanedData.entityIdsFunction, - entityTableId: cleanedData.entityTableId, - entityTableOwnerId: cleanedData.entityTableOwnerId, - getOrgFn: cleanedData.getOrgFn, - grantsTableId: cleanedData.grantsTableId, - grantsTableName: cleanedData.grantsTableName, - limitsTableId: cleanedData.limitsTableId, - memberProfilesTableId: cleanedData.memberProfilesTableId, - membersTableId: cleanedData.membersTableId, - membersTableName: cleanedData.membersTableName, - membershipDefaultsTableId: cleanedData.membershipDefaultsTableId, - membershipDefaultsTableName: cleanedData.membershipDefaultsTableName, - membershipSettingsTableId: cleanedData.membershipSettingsTableId, - membershipSettingsTableName: cleanedData.membershipSettingsTableName, - membershipsTableId: cleanedData.membershipsTableId, - membershipsTableName: cleanedData.membershipsTableName, - ownerGrantsTableId: cleanedData.ownerGrantsTableId, - ownerGrantsTableName: cleanedData.ownerGrantsTableName, - permissionDefaultGrantsTableId: cleanedData.permissionDefaultGrantsTableId, - permissionDefaultPermissionsTableId: cleanedData.permissionDefaultPermissionsTableId, - permissionsTableId: cleanedData.permissionsTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - sprtTableId: cleanedData.sprtTableId - }, - select: { - actorMaskCheck: true, - actorPermCheck: true, - actorTableId: true, - adminGrantsTableId: true, - adminGrantsTableName: true, - apiName: true, - databaseId: true, - defaultLimitsTableId: true, - defaultPermissionsTableId: true, - entityField: true, - entityIdsByMask: true, - entityIdsByPerm: true, - entityIdsFunction: true, - entityTableId: true, - entityTableOwnerId: true, - getOrgFn: true, - grantsTableId: true, - grantsTableName: true, - id: true, - limitsTableId: true, - memberProfilesTableId: true, - membersTableId: true, - membersTableName: true, - membershipDefaultsTableId: true, - membershipDefaultsTableName: true, - membershipSettingsTableId: true, - membershipSettingsTableName: true, - membershipsTableId: true, - membershipsTableName: true, - ownerGrantsTableId: true, - ownerGrantsTableName: true, - permissionDefaultGrantsTableId: true, - permissionDefaultPermissionsTableId: true, - permissionsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - sprtTableId: true - } - }).execute(); + const result = await client.membershipsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + actorMaskCheck: cleanedData.actorMaskCheck, + actorPermCheck: cleanedData.actorPermCheck, + actorTableId: cleanedData.actorTableId, + adminGrantsTableId: cleanedData.adminGrantsTableId, + adminGrantsTableName: cleanedData.adminGrantsTableName, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultLimitsTableId: cleanedData.defaultLimitsTableId, + defaultPermissionsTableId: cleanedData.defaultPermissionsTableId, + entityField: cleanedData.entityField, + entityIdsByMask: cleanedData.entityIdsByMask, + entityIdsByPerm: cleanedData.entityIdsByPerm, + entityIdsFunction: cleanedData.entityIdsFunction, + entityTableId: cleanedData.entityTableId, + entityTableOwnerId: cleanedData.entityTableOwnerId, + getOrgFn: cleanedData.getOrgFn, + grantsTableId: cleanedData.grantsTableId, + grantsTableName: cleanedData.grantsTableName, + limitsTableId: cleanedData.limitsTableId, + memberProfilesTableId: cleanedData.memberProfilesTableId, + membersTableId: cleanedData.membersTableId, + membersTableName: cleanedData.membersTableName, + membershipDefaultsTableId: cleanedData.membershipDefaultsTableId, + membershipDefaultsTableName: cleanedData.membershipDefaultsTableName, + membershipSettingsTableId: cleanedData.membershipSettingsTableId, + membershipSettingsTableName: cleanedData.membershipSettingsTableName, + membershipsTableId: cleanedData.membershipsTableId, + membershipsTableName: cleanedData.membershipsTableName, + ownerGrantsTableId: cleanedData.ownerGrantsTableId, + ownerGrantsTableName: cleanedData.ownerGrantsTableName, + permissionDefaultGrantsTableId: cleanedData.permissionDefaultGrantsTableId, + permissionDefaultPermissionsTableId: cleanedData.permissionDefaultPermissionsTableId, + permissionsTableId: cleanedData.permissionsTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + sprtTableId: cleanedData.sprtTableId, + }, + select: { + actorMaskCheck: true, + actorPermCheck: true, + actorTableId: true, + adminGrantsTableId: true, + adminGrantsTableName: true, + apiName: true, + databaseId: true, + defaultLimitsTableId: true, + defaultPermissionsTableId: true, + entityField: true, + entityIdsByMask: true, + entityIdsByPerm: true, + entityIdsFunction: true, + entityTableId: true, + entityTableOwnerId: true, + getOrgFn: true, + grantsTableId: true, + grantsTableName: true, + id: true, + limitsTableId: true, + memberProfilesTableId: true, + membersTableId: true, + membersTableName: true, + membershipDefaultsTableId: true, + membershipDefaultsTableName: true, + membershipSettingsTableId: true, + membershipSettingsTableName: true, + membershipsTableId: true, + membershipsTableName: true, + ownerGrantsTableId: true, + ownerGrantsTableName: true, + permissionDefaultGrantsTableId: true, + permissionDefaultPermissionsTableId: true, + permissionsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + sprtTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -984,28 +1098,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.membershipsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.membershipsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} 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 ea31d03da0..9f568e76af 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 @@ -3,66 +3,80 @@ * @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 { CreateMerkleStoreModuleInput, MerkleStoreModulePatch, MerkleStoreModuleSelect, MerkleStoreModuleFilter, MerkleStoreModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateMerkleStoreModuleInput, + MerkleStoreModulePatch, + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - commitTableId: "uuid", - createdAt: "string", - databaseId: "uuid", - entityField: "string", - functionPrefix: "string", - id: "uuid", - objectTableId: "uuid", - permissionKey: "string", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - refTableId: "uuid", - schemaId: "uuid", - scope: "string", - storeTableId: "uuid" + apiName: 'string', + commitTableId: 'uuid', + createdAt: 'string', + databaseId: 'uuid', + entityField: 'string', + functionPrefix: 'string', + id: 'uuid', + objectTableId: 'uuid', + permissionKey: 'string', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + refTableId: 'uuid', + schemaId: 'uuid', + scope: 'string', + storeTableId: 'uuid', }; -const usage = "\nmerkle-store-module \n\nCommands:\n list List merkleStoreModule records\n find-first Find first matching merkleStoreModule record\n get Get a merkleStoreModule by ID\n create Create a new merkleStoreModule\n update Update an existing merkleStoreModule\n delete Delete a merkleStoreModule\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) => { +const usage = + '\nmerkle-store-module \n\nCommands:\n list List merkleStoreModule records\n find-first Find first matching merkleStoreModule record\n get Get a merkleStoreModule by ID\n create Create a new merkleStoreModule\n update Update an existing merkleStoreModule\n delete Delete a merkleStoreModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -89,16 +103,18 @@ async function handleList(argv: Partial>, _prompter: Inq refTableId: true, schemaId: true, scope: true, - storeTableId: true + storeTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: MerkleStoreModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: MerkleStoreModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.merkleStoreModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -125,16 +141,18 @@ async function handleFindFirst(argv: Partial>, _prompter refTableId: true, schemaId: true, scope: true, - storeTableId: true + storeTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: MerkleStoreModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: MerkleStoreModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.merkleStoreModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -143,39 +161,43 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.merkleStoreModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - commitTableId: true, - createdAt: true, - databaseId: true, - entityField: true, - functionPrefix: true, - id: true, - objectTableId: true, - permissionKey: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - refTableId: true, - schemaId: true, - scope: true, - storeTableId: true - } - }).execute(); + const result = await client.merkleStoreModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + commitTableId: true, + createdAt: true, + databaseId: true, + entityField: true, + functionPrefix: true, + id: true, + objectTableId: true, + permissionKey: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + refTableId: true, + schemaId: true, + scope: true, + storeTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -184,147 +206,169 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "commitTableId", - message: "commitTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionPrefix", - message: "functionPrefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "objectTableId", - message: "objectTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionKey", - message: "permissionKey", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refTableId", - message: "refTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "storeTableId", - message: "storeTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'commitTableId', + message: 'commitTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionPrefix', + message: 'functionPrefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'objectTableId', + message: 'objectTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionKey', + message: 'permissionKey', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refTableId', + message: 'refTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'storeTableId', + message: 'storeTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateMerkleStoreModuleInput["merkleStoreModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateMerkleStoreModuleInput['merkleStoreModule']; const client = getClient(); - const result = await client.merkleStoreModule.create({ - data: { - apiName: cleanedData.apiName, - commitTableId: cleanedData.commitTableId, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - functionPrefix: cleanedData.functionPrefix, - objectTableId: cleanedData.objectTableId, - permissionKey: cleanedData.permissionKey, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - refTableId: cleanedData.refTableId, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - storeTableId: cleanedData.storeTableId - }, - select: { - apiName: true, - commitTableId: true, - createdAt: true, - databaseId: true, - entityField: true, - functionPrefix: true, - id: true, - objectTableId: true, - permissionKey: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - refTableId: true, - schemaId: true, - scope: true, - storeTableId: true - } - }).execute(); + const result = await client.merkleStoreModule + .create({ + data: { + apiName: cleanedData.apiName, + commitTableId: cleanedData.commitTableId, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + functionPrefix: cleanedData.functionPrefix, + objectTableId: cleanedData.objectTableId, + permissionKey: cleanedData.permissionKey, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + refTableId: cleanedData.refTableId, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + storeTableId: cleanedData.storeTableId, + }, + select: { + apiName: true, + commitTableId: true, + createdAt: true, + databaseId: true, + entityField: true, + functionPrefix: true, + id: true, + objectTableId: true, + permissionKey: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + refTableId: true, + schemaId: true, + scope: true, + storeTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -333,155 +377,175 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "commitTableId", - message: "commitTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionPrefix", - message: "functionPrefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "objectTableId", - message: "objectTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionKey", - message: "permissionKey", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "refTableId", - message: "refTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "storeTableId", - message: "storeTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'commitTableId', + message: 'commitTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionPrefix', + message: 'functionPrefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'objectTableId', + message: 'objectTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionKey', + message: 'permissionKey', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'refTableId', + message: 'refTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'storeTableId', + message: 'storeTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as MerkleStoreModulePatch; const client = getClient(); - const result = await client.merkleStoreModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - commitTableId: cleanedData.commitTableId, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - functionPrefix: cleanedData.functionPrefix, - objectTableId: cleanedData.objectTableId, - permissionKey: cleanedData.permissionKey, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - refTableId: cleanedData.refTableId, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - storeTableId: cleanedData.storeTableId - }, - select: { - apiName: true, - commitTableId: true, - createdAt: true, - databaseId: true, - entityField: true, - functionPrefix: true, - id: true, - objectTableId: true, - permissionKey: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - refTableId: true, - schemaId: true, - scope: true, - storeTableId: true - } - }).execute(); + const result = await client.merkleStoreModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + commitTableId: cleanedData.commitTableId, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + functionPrefix: cleanedData.functionPrefix, + objectTableId: cleanedData.objectTableId, + permissionKey: cleanedData.permissionKey, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + refTableId: cleanedData.refTableId, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + storeTableId: cleanedData.storeTableId, + }, + select: { + apiName: true, + commitTableId: true, + createdAt: true, + databaseId: true, + entityField: true, + functionPrefix: true, + id: true, + objectTableId: true, + permissionKey: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + refTableId: true, + schemaId: true, + scope: true, + storeTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -490,28 +554,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.merkleStoreModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.merkleStoreModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/namespace-module.ts b/sdk/constructive-cli/src/modules/cli/commands/namespace-module.ts index 789673d2f6..46e05e9873 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/namespace-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/namespace-module.ts @@ -3,67 +3,81 @@ * @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 { CreateNamespaceModuleInput, NamespaceModulePatch, NamespaceModuleSelect, NamespaceModuleFilter, NamespaceModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateNamespaceModuleInput, + NamespaceModulePatch, + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - namespaceEventsTableId: "uuid", - namespaceEventsTableName: "string", - namespacesTableId: "uuid", - namespacesTableName: "string", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + namespaceEventsTableId: 'uuid', + namespaceEventsTableName: 'string', + namespacesTableId: 'uuid', + namespacesTableName: 'string', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\nnamespace-module \n\nCommands:\n list List namespaceModule records\n find-first Find first matching namespaceModule record\n get Get a namespaceModule by ID\n create Create a new namespaceModule\n update Update an existing namespaceModule\n delete Delete a namespaceModule\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) => { +const usage = + '\nnamespace-module \n\nCommands:\n list List namespaceModule records\n find-first Find first matching namespaceModule record\n get Get a namespaceModule by ID\n create Create a new namespaceModule\n update Update an existing namespaceModule\n delete Delete a namespaceModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -91,16 +105,18 @@ async function handleList(argv: Partial>, _prompter: Inq provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: NamespaceModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: NamespaceModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespaceModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -128,16 +144,18 @@ async function handleFindFirst(argv: Partial>, _prompter provisions: true, publicSchemaName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: NamespaceModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: NamespaceModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.namespaceModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -146,40 +164,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.namespaceModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - namespaceEventsTableId: true, - namespaceEventsTableName: true, - namespacesTableId: true, - namespacesTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.namespaceModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + namespaceEventsTableId: true, + namespaceEventsTableName: true, + namespacesTableId: true, + namespacesTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -188,162 +210,186 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceEventsTableId", - message: "namespaceEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceEventsTableName", - message: "namespaceEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespacesTableId", - message: "namespacesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespacesTableName", - message: "namespacesTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceEventsTableId', + message: 'namespaceEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceEventsTableName', + message: 'namespaceEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespacesTableId', + message: 'namespacesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespacesTableName', + message: 'namespacesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateNamespaceModuleInput["namespaceModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateNamespaceModuleInput['namespaceModule']; const client = getClient(); - const result = await client.namespaceModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - namespaceEventsTableId: cleanedData.namespaceEventsTableId, - namespaceEventsTableName: cleanedData.namespaceEventsTableName, - namespacesTableId: cleanedData.namespacesTableId, - namespacesTableName: cleanedData.namespacesTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - namespaceEventsTableId: true, - namespaceEventsTableName: true, - namespacesTableId: true, - namespacesTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.namespaceModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + namespaceEventsTableId: cleanedData.namespaceEventsTableId, + namespaceEventsTableName: cleanedData.namespaceEventsTableName, + namespacesTableId: cleanedData.namespacesTableId, + namespacesTableName: cleanedData.namespacesTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + namespaceEventsTableId: true, + namespaceEventsTableName: true, + namespacesTableId: true, + namespacesTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -352,170 +398,192 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceEventsTableId", - message: "namespaceEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceEventsTableName", - message: "namespaceEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespacesTableId", - message: "namespacesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespacesTableName", - message: "namespacesTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceEventsTableId', + message: 'namespaceEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceEventsTableName', + message: 'namespaceEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespacesTableId', + message: 'namespacesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespacesTableName', + message: 'namespacesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as NamespaceModulePatch; const client = getClient(); - const result = await client.namespaceModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - namespaceEventsTableId: cleanedData.namespaceEventsTableId, - namespaceEventsTableName: cleanedData.namespaceEventsTableName, - namespacesTableId: cleanedData.namespacesTableId, - namespacesTableName: cleanedData.namespacesTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - namespaceEventsTableId: true, - namespaceEventsTableName: true, - namespacesTableId: true, - namespacesTableName: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.namespaceModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + namespaceEventsTableId: cleanedData.namespaceEventsTableId, + namespaceEventsTableName: cleanedData.namespaceEventsTableName, + namespacesTableId: cleanedData.namespacesTableId, + namespacesTableName: cleanedData.namespacesTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + namespaceEventsTableId: true, + namespaceEventsTableName: true, + namespacesTableId: true, + namespacesTableName: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -524,28 +592,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.namespaceModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.namespaceModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/notifications-module.ts b/sdk/constructive-cli/src/modules/cli/commands/notifications-module.ts index c5c37b5cae..0ad0dce79e 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/notifications-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/notifications-module.ts @@ -3,72 +3,86 @@ * @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 { CreateNotificationsModuleInput, NotificationsModulePatch, NotificationsModuleSelect, NotificationsModuleFilter, NotificationsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateNotificationsModuleInput, + NotificationsModulePatch, + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - channelsTableId: "uuid", - databaseId: "uuid", - defaultPermissions: "string", - deliveryLogTableId: "uuid", - entityField: "string", - hasChannels: "boolean", - hasDigestMetadata: "boolean", - hasPreferences: "boolean", - hasSettingsExtension: "boolean", - hasSubscriptions: "boolean", - id: "uuid", - notificationsTableId: "uuid", - organizationSettingsTableId: "uuid", - ownerTableId: "uuid", - preferencesTableId: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - readStateTableId: "uuid", - schemaId: "uuid", - suppressionsTableId: "uuid", - userSettingsTableId: "uuid" + apiName: 'string', + channelsTableId: 'uuid', + databaseId: 'uuid', + defaultPermissions: 'string', + deliveryLogTableId: 'uuid', + entityField: 'string', + hasChannels: 'boolean', + hasDigestMetadata: 'boolean', + hasPreferences: 'boolean', + hasSettingsExtension: 'boolean', + hasSubscriptions: 'boolean', + id: 'uuid', + notificationsTableId: 'uuid', + organizationSettingsTableId: 'uuid', + ownerTableId: 'uuid', + preferencesTableId: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + readStateTableId: 'uuid', + schemaId: 'uuid', + suppressionsTableId: 'uuid', + userSettingsTableId: 'uuid', }; -const usage = "\nnotifications-module \n\nCommands:\n list List notificationsModule records\n find-first Find first matching notificationsModule record\n get Get a notificationsModule by ID\n create Create a new notificationsModule\n update Update an existing notificationsModule\n delete Delete a notificationsModule\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) => { +const usage = + '\nnotifications-module \n\nCommands:\n list List notificationsModule records\n find-first Find first matching notificationsModule record\n get Get a notificationsModule by ID\n create Create a new notificationsModule\n update Update an existing notificationsModule\n delete Delete a notificationsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -101,16 +115,22 @@ async function handleList(argv: Partial>, _prompter: Inq readStateTableId: true, schemaId: true, suppressionsTableId: true, - userSettingsTableId: true + userSettingsTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: NotificationsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy + > & { + select: NotificationsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.notificationsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -143,16 +163,22 @@ async function handleFindFirst(argv: Partial>, _prompter readStateTableId: true, schemaId: true, suppressionsTableId: true, - userSettingsTableId: true + userSettingsTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: NotificationsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy + > & { + select: NotificationsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.notificationsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -161,45 +187,49 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.notificationsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - channelsTableId: true, - databaseId: true, - defaultPermissions: true, - deliveryLogTableId: true, - entityField: true, - hasChannels: true, - hasDigestMetadata: true, - hasPreferences: true, - hasSettingsExtension: true, - hasSubscriptions: true, - id: true, - notificationsTableId: true, - organizationSettingsTableId: true, - ownerTableId: true, - preferencesTableId: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - readStateTableId: true, - schemaId: true, - suppressionsTableId: true, - userSettingsTableId: true - } - }).execute(); + const result = await client.notificationsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + channelsTableId: true, + databaseId: true, + defaultPermissions: true, + deliveryLogTableId: true, + entityField: true, + hasChannels: true, + hasDigestMetadata: true, + hasPreferences: true, + hasSettingsExtension: true, + hasSubscriptions: true, + id: true, + notificationsTableId: true, + organizationSettingsTableId: true, + ownerTableId: true, + preferencesTableId: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + readStateTableId: true, + schemaId: true, + suppressionsTableId: true, + userSettingsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -208,203 +238,232 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "channelsTableId", - message: "channelsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deliveryLogTableId", - message: "deliveryLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasChannels", - message: "hasChannels", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasDigestMetadata", - message: "hasDigestMetadata", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasPreferences", - message: "hasPreferences", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasSettingsExtension", - message: "hasSettingsExtension", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasSubscriptions", - message: "hasSubscriptions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "notificationsTableId", - message: "notificationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationSettingsTableId", - message: "organizationSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "preferencesTableId", - message: "preferencesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "readStateTableId", - message: "readStateTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "suppressionsTableId", - message: "suppressionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userSettingsTableId", - message: "userSettingsTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'channelsTableId', + message: 'channelsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deliveryLogTableId', + message: 'deliveryLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasChannels', + message: 'hasChannels', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasDigestMetadata', + message: 'hasDigestMetadata', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasPreferences', + message: 'hasPreferences', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasSettingsExtension', + message: 'hasSettingsExtension', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasSubscriptions', + message: 'hasSubscriptions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'notificationsTableId', + message: 'notificationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationSettingsTableId', + message: 'organizationSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'preferencesTableId', + message: 'preferencesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'readStateTableId', + message: 'readStateTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'suppressionsTableId', + message: 'suppressionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userSettingsTableId', + message: 'userSettingsTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateNotificationsModuleInput["notificationsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateNotificationsModuleInput['notificationsModule']; const client = getClient(); - const result = await client.notificationsModule.create({ - data: { - apiName: cleanedData.apiName, - channelsTableId: cleanedData.channelsTableId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - deliveryLogTableId: cleanedData.deliveryLogTableId, - entityField: cleanedData.entityField, - hasChannels: cleanedData.hasChannels, - hasDigestMetadata: cleanedData.hasDigestMetadata, - hasPreferences: cleanedData.hasPreferences, - hasSettingsExtension: cleanedData.hasSettingsExtension, - hasSubscriptions: cleanedData.hasSubscriptions, - notificationsTableId: cleanedData.notificationsTableId, - organizationSettingsTableId: cleanedData.organizationSettingsTableId, - ownerTableId: cleanedData.ownerTableId, - preferencesTableId: cleanedData.preferencesTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - readStateTableId: cleanedData.readStateTableId, - schemaId: cleanedData.schemaId, - suppressionsTableId: cleanedData.suppressionsTableId, - userSettingsTableId: cleanedData.userSettingsTableId - }, - select: { - apiName: true, - channelsTableId: true, - databaseId: true, - defaultPermissions: true, - deliveryLogTableId: true, - entityField: true, - hasChannels: true, - hasDigestMetadata: true, - hasPreferences: true, - hasSettingsExtension: true, - hasSubscriptions: true, - id: true, - notificationsTableId: true, - organizationSettingsTableId: true, - ownerTableId: true, - preferencesTableId: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - readStateTableId: true, - schemaId: true, - suppressionsTableId: true, - userSettingsTableId: true - } - }).execute(); + const result = await client.notificationsModule + .create({ + data: { + apiName: cleanedData.apiName, + channelsTableId: cleanedData.channelsTableId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + deliveryLogTableId: cleanedData.deliveryLogTableId, + entityField: cleanedData.entityField, + hasChannels: cleanedData.hasChannels, + hasDigestMetadata: cleanedData.hasDigestMetadata, + hasPreferences: cleanedData.hasPreferences, + hasSettingsExtension: cleanedData.hasSettingsExtension, + hasSubscriptions: cleanedData.hasSubscriptions, + notificationsTableId: cleanedData.notificationsTableId, + organizationSettingsTableId: cleanedData.organizationSettingsTableId, + ownerTableId: cleanedData.ownerTableId, + preferencesTableId: cleanedData.preferencesTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + readStateTableId: cleanedData.readStateTableId, + schemaId: cleanedData.schemaId, + suppressionsTableId: cleanedData.suppressionsTableId, + userSettingsTableId: cleanedData.userSettingsTableId, + }, + select: { + apiName: true, + channelsTableId: true, + databaseId: true, + defaultPermissions: true, + deliveryLogTableId: true, + entityField: true, + hasChannels: true, + hasDigestMetadata: true, + hasPreferences: true, + hasSettingsExtension: true, + hasSubscriptions: true, + id: true, + notificationsTableId: true, + organizationSettingsTableId: true, + ownerTableId: true, + preferencesTableId: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + readStateTableId: true, + schemaId: true, + suppressionsTableId: true, + userSettingsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -413,211 +472,238 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "channelsTableId", - message: "channelsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deliveryLogTableId", - message: "deliveryLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasChannels", - message: "hasChannels", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasDigestMetadata", - message: "hasDigestMetadata", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasPreferences", - message: "hasPreferences", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasSettingsExtension", - message: "hasSettingsExtension", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasSubscriptions", - message: "hasSubscriptions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "notificationsTableId", - message: "notificationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationSettingsTableId", - message: "organizationSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "preferencesTableId", - message: "preferencesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "readStateTableId", - message: "readStateTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "suppressionsTableId", - message: "suppressionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "userSettingsTableId", - message: "userSettingsTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'channelsTableId', + message: 'channelsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deliveryLogTableId', + message: 'deliveryLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasChannels', + message: 'hasChannels', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasDigestMetadata', + message: 'hasDigestMetadata', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasPreferences', + message: 'hasPreferences', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasSettingsExtension', + message: 'hasSettingsExtension', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasSubscriptions', + message: 'hasSubscriptions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'notificationsTableId', + message: 'notificationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationSettingsTableId', + message: 'organizationSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'preferencesTableId', + message: 'preferencesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'readStateTableId', + message: 'readStateTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'suppressionsTableId', + message: 'suppressionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'userSettingsTableId', + message: 'userSettingsTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as NotificationsModulePatch; const client = getClient(); - const result = await client.notificationsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - channelsTableId: cleanedData.channelsTableId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - deliveryLogTableId: cleanedData.deliveryLogTableId, - entityField: cleanedData.entityField, - hasChannels: cleanedData.hasChannels, - hasDigestMetadata: cleanedData.hasDigestMetadata, - hasPreferences: cleanedData.hasPreferences, - hasSettingsExtension: cleanedData.hasSettingsExtension, - hasSubscriptions: cleanedData.hasSubscriptions, - notificationsTableId: cleanedData.notificationsTableId, - organizationSettingsTableId: cleanedData.organizationSettingsTableId, - ownerTableId: cleanedData.ownerTableId, - preferencesTableId: cleanedData.preferencesTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - readStateTableId: cleanedData.readStateTableId, - schemaId: cleanedData.schemaId, - suppressionsTableId: cleanedData.suppressionsTableId, - userSettingsTableId: cleanedData.userSettingsTableId - }, - select: { - apiName: true, - channelsTableId: true, - databaseId: true, - defaultPermissions: true, - deliveryLogTableId: true, - entityField: true, - hasChannels: true, - hasDigestMetadata: true, - hasPreferences: true, - hasSettingsExtension: true, - hasSubscriptions: true, - id: true, - notificationsTableId: true, - organizationSettingsTableId: true, - ownerTableId: true, - preferencesTableId: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - readStateTableId: true, - schemaId: true, - suppressionsTableId: true, - userSettingsTableId: true - } - }).execute(); + const result = await client.notificationsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + channelsTableId: cleanedData.channelsTableId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + deliveryLogTableId: cleanedData.deliveryLogTableId, + entityField: cleanedData.entityField, + hasChannels: cleanedData.hasChannels, + hasDigestMetadata: cleanedData.hasDigestMetadata, + hasPreferences: cleanedData.hasPreferences, + hasSettingsExtension: cleanedData.hasSettingsExtension, + hasSubscriptions: cleanedData.hasSubscriptions, + notificationsTableId: cleanedData.notificationsTableId, + organizationSettingsTableId: cleanedData.organizationSettingsTableId, + ownerTableId: cleanedData.ownerTableId, + preferencesTableId: cleanedData.preferencesTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + readStateTableId: cleanedData.readStateTableId, + schemaId: cleanedData.schemaId, + suppressionsTableId: cleanedData.suppressionsTableId, + userSettingsTableId: cleanedData.userSettingsTableId, + }, + select: { + apiName: true, + channelsTableId: true, + databaseId: true, + defaultPermissions: true, + deliveryLogTableId: true, + entityField: true, + hasChannels: true, + hasDigestMetadata: true, + hasPreferences: true, + hasSettingsExtension: true, + hasSubscriptions: true, + id: true, + notificationsTableId: true, + organizationSettingsTableId: true, + ownerTableId: true, + preferencesTableId: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + readStateTableId: true, + schemaId: true, + suppressionsTableId: true, + userSettingsTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -626,28 +712,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.notificationsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.notificationsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/permissions-module.ts b/sdk/constructive-cli/src/modules/cli/commands/permissions-module.ts index e2c6dc39f6..9b76cbab39 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/permissions-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/permissions-module.ts @@ -3,70 +3,84 @@ * @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 { CreatePermissionsModuleInput, PermissionsModulePatch, PermissionsModuleSelect, PermissionsModuleFilter, PermissionsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePermissionsModuleInput, + PermissionsModulePatch, + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorTableId: "uuid", - apiName: "string", - bitlen: "int", - databaseId: "uuid", - defaultTableId: "uuid", - defaultTableName: "string", - entityField: "string", - entityTableId: "uuid", - getByMask: "string", - getMask: "string", - getMaskByName: "string", - getPaddedMask: "string", - id: "uuid", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - tableId: "uuid", - tableName: "string" + actorTableId: 'uuid', + apiName: 'string', + bitlen: 'int', + databaseId: 'uuid', + defaultTableId: 'uuid', + defaultTableName: 'string', + entityField: 'string', + entityTableId: 'uuid', + getByMask: 'string', + getMask: 'string', + getMaskByName: 'string', + getPaddedMask: 'string', + id: 'uuid', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\npermissions-module \n\nCommands:\n list List permissionsModule records\n find-first Find first matching permissionsModule record\n get Get a permissionsModule by ID\n create Create a new permissionsModule\n update Update an existing permissionsModule\n delete Delete a permissionsModule\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) => { +const usage = + '\npermissions-module \n\nCommands:\n list List permissionsModule records\n find-first Find first matching permissionsModule record\n get Get a permissionsModule by ID\n create Create a new permissionsModule\n update Update an existing permissionsModule\n delete Delete a permissionsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -97,16 +111,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: PermissionsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PermissionsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.permissionsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -137,16 +153,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PermissionsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PermissionsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.permissionsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -155,43 +173,47 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.permissionsModule.findOne({ - id: answers.id as string, - select: { - actorTableId: true, - apiName: true, - bitlen: true, - databaseId: true, - defaultTableId: true, - defaultTableName: true, - entityField: true, - entityTableId: true, - getByMask: true, - getMask: true, - getMaskByName: true, - getPaddedMask: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.permissionsModule + .findOne({ + id: answers.id as string, + select: { + actorTableId: true, + apiName: true, + bitlen: true, + databaseId: true, + defaultTableId: true, + defaultTableName: true, + entityField: true, + entityTableId: true, + getByMask: true, + getMask: true, + getMaskByName: true, + getPaddedMask: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -200,186 +222,213 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bitlen", - message: "bitlen", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultTableId", - message: "defaultTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultTableName", - message: "defaultTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getByMask", - message: "getByMask", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getMask", - message: "getMask", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getMaskByName", - message: "getMaskByName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getPaddedMask", - message: "getPaddedMask", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bitlen', + message: 'bitlen', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultTableId', + message: 'defaultTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultTableName', + message: 'defaultTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getByMask', + message: 'getByMask', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getMask', + message: 'getMask', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getMaskByName', + message: 'getMaskByName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getPaddedMask', + message: 'getPaddedMask', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePermissionsModuleInput["permissionsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePermissionsModuleInput['permissionsModule']; const client = getClient(); - const result = await client.permissionsModule.create({ - data: { - actorTableId: cleanedData.actorTableId, - apiName: cleanedData.apiName, - bitlen: cleanedData.bitlen, - databaseId: cleanedData.databaseId, - defaultTableId: cleanedData.defaultTableId, - defaultTableName: cleanedData.defaultTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - getByMask: cleanedData.getByMask, - getMask: cleanedData.getMask, - getMaskByName: cleanedData.getMaskByName, - getPaddedMask: cleanedData.getPaddedMask, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - actorTableId: true, - apiName: true, - bitlen: true, - databaseId: true, - defaultTableId: true, - defaultTableName: true, - entityField: true, - entityTableId: true, - getByMask: true, - getMask: true, - getMaskByName: true, - getPaddedMask: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.permissionsModule + .create({ + data: { + actorTableId: cleanedData.actorTableId, + apiName: cleanedData.apiName, + bitlen: cleanedData.bitlen, + databaseId: cleanedData.databaseId, + defaultTableId: cleanedData.defaultTableId, + defaultTableName: cleanedData.defaultTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + getByMask: cleanedData.getByMask, + getMask: cleanedData.getMask, + getMaskByName: cleanedData.getMaskByName, + getPaddedMask: cleanedData.getPaddedMask, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + actorTableId: true, + apiName: true, + bitlen: true, + databaseId: true, + defaultTableId: true, + defaultTableName: true, + entityField: true, + entityTableId: true, + getByMask: true, + getMask: true, + getMaskByName: true, + getPaddedMask: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -388,194 +437,219 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bitlen", - message: "bitlen", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultTableId", - message: "defaultTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultTableName", - message: "defaultTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getByMask", - message: "getByMask", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getMask", - message: "getMask", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getMaskByName", - message: "getMaskByName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "getPaddedMask", - message: "getPaddedMask", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bitlen', + message: 'bitlen', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultTableId', + message: 'defaultTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultTableName', + message: 'defaultTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getByMask', + message: 'getByMask', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getMask', + message: 'getMask', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getMaskByName', + message: 'getMaskByName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'getPaddedMask', + message: 'getPaddedMask', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PermissionsModulePatch; const client = getClient(); - const result = await client.permissionsModule.update({ - where: { - id: answers.id as string - }, - data: { - actorTableId: cleanedData.actorTableId, - apiName: cleanedData.apiName, - bitlen: cleanedData.bitlen, - databaseId: cleanedData.databaseId, - defaultTableId: cleanedData.defaultTableId, - defaultTableName: cleanedData.defaultTableName, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - getByMask: cleanedData.getByMask, - getMask: cleanedData.getMask, - getMaskByName: cleanedData.getMaskByName, - getPaddedMask: cleanedData.getPaddedMask, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - actorTableId: true, - apiName: true, - bitlen: true, - databaseId: true, - defaultTableId: true, - defaultTableName: true, - entityField: true, - entityTableId: true, - getByMask: true, - getMask: true, - getMaskByName: true, - getPaddedMask: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.permissionsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + actorTableId: cleanedData.actorTableId, + apiName: cleanedData.apiName, + bitlen: cleanedData.bitlen, + databaseId: cleanedData.databaseId, + defaultTableId: cleanedData.defaultTableId, + defaultTableName: cleanedData.defaultTableName, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + getByMask: cleanedData.getByMask, + getMask: cleanedData.getMask, + getMaskByName: cleanedData.getMaskByName, + getPaddedMask: cleanedData.getPaddedMask, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + actorTableId: true, + apiName: true, + bitlen: true, + databaseId: true, + defaultTableId: true, + defaultTableName: true, + entityField: true, + entityTableId: true, + getByMask: true, + getMask: true, + getMaskByName: true, + getPaddedMask: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -584,28 +658,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.permissionsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.permissionsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/phone-numbers-module.ts b/sdk/constructive-cli/src/modules/cli/commands/phone-numbers-module.ts index 7650845f86..79a39b44b1 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/phone-numbers-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/phone-numbers-module.ts @@ -3,57 +3,71 @@ * @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 { CreatePhoneNumbersModuleInput, PhoneNumbersModulePatch, PhoneNumbersModuleSelect, PhoneNumbersModuleFilter, PhoneNumbersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePhoneNumbersModuleInput, + PhoneNumbersModulePatch, + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - id: "uuid", - ownerTableId: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + apiName: 'string', + databaseId: 'uuid', + id: 'uuid', + ownerTableId: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nphone-numbers-module \n\nCommands:\n list List phoneNumbersModule records\n find-first Find first matching phoneNumbersModule record\n get Get a phoneNumbersModule by ID\n create Create a new phoneNumbersModule\n update Update an existing phoneNumbersModule\n delete Delete a phoneNumbersModule\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) => { +const usage = + '\nphone-numbers-module \n\nCommands:\n list List phoneNumbersModule records\n find-first Find first matching phoneNumbersModule record\n get Get a phoneNumbersModule by ID\n create Create a new phoneNumbersModule\n update Update an existing phoneNumbersModule\n delete Delete a phoneNumbersModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: PhoneNumbersModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy + > & { + select: PhoneNumbersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.phoneNumbersModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PhoneNumbersModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy + > & { + select: PhoneNumbersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.phoneNumbersModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.phoneNumbersModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.phoneNumbersModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +178,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePhoneNumbersModuleInput["phoneNumbersModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePhoneNumbersModuleInput['phoneNumbersModule']; const client = getClient(); - const result = await client.phoneNumbersModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.phoneNumbersModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +276,102 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PhoneNumbersModulePatch; const client = getClient(); - const result = await client.phoneNumbersModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.phoneNumbersModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,28 +380,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.phoneNumbersModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.phoneNumbersModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/plans-module.ts b/sdk/constructive-cli/src/modules/cli/commands/plans-module.ts index 4337720f53..413ea81fbe 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/plans-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/plans-module.ts @@ -3,69 +3,83 @@ * @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 { CreatePlansModuleInput, PlansModulePatch, PlansModuleSelect, PlansModuleFilter, PlansModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlansModuleInput, + PlansModulePatch, + PlansModuleSelect, + PlansModuleFilter, + PlansModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - applyBillingPlanFunction: "string", - applyPlanAggregateFunction: "string", - applyPlanCapsFunction: "string", - applyPlanFunction: "string", - databaseId: "uuid", - id: "uuid", - planCapsTableId: "uuid", - planLimitsTableId: "uuid", - planLimitsTableName: "string", - planMeterLimitsTableId: "uuid", - planOverridesTableId: "uuid", - planPricingTableId: "uuid", - plansTableId: "uuid", - plansTableName: "string", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - schemaId: "uuid" + apiName: 'string', + applyBillingPlanFunction: 'string', + applyPlanAggregateFunction: 'string', + applyPlanCapsFunction: 'string', + applyPlanFunction: 'string', + databaseId: 'uuid', + id: 'uuid', + planCapsTableId: 'uuid', + planLimitsTableId: 'uuid', + planLimitsTableName: 'string', + planMeterLimitsTableId: 'uuid', + planOverridesTableId: 'uuid', + planPricingTableId: 'uuid', + plansTableId: 'uuid', + plansTableName: 'string', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + schemaId: 'uuid', }; -const usage = "\nplans-module \n\nCommands:\n list List plansModule records\n find-first Find first matching plansModule record\n get Get a plansModule by ID\n create Create a new plansModule\n update Update an existing plansModule\n delete Delete a plansModule\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) => { +const usage = + '\nplans-module \n\nCommands:\n list List plansModule records\n find-first Find first matching plansModule record\n get Get a plansModule by ID\n create Create a new plansModule\n update Update an existing plansModule\n delete Delete a plansModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -95,16 +109,18 @@ async function handleList(argv: Partial>, _prompter: Inq privateSchemaId: true, privateSchemaName: true, publicSchemaName: true, - schemaId: true + schemaId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PlansModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlansModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.plansModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -134,16 +150,18 @@ async function handleFindFirst(argv: Partial>, _prompter privateSchemaId: true, privateSchemaName: true, publicSchemaName: true, - schemaId: true + schemaId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PlansModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlansModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.plansModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -152,42 +170,46 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.plansModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - applyBillingPlanFunction: true, - applyPlanAggregateFunction: true, - applyPlanCapsFunction: true, - applyPlanFunction: true, - databaseId: true, - id: true, - planCapsTableId: true, - planLimitsTableId: true, - planLimitsTableName: true, - planMeterLimitsTableId: true, - planOverridesTableId: true, - planPricingTableId: true, - plansTableId: true, - plansTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true - } - }).execute(); + const result = await client.plansModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + applyBillingPlanFunction: true, + applyPlanAggregateFunction: true, + applyPlanCapsFunction: true, + applyPlanFunction: true, + databaseId: true, + id: true, + planCapsTableId: true, + planLimitsTableId: true, + planLimitsTableName: true, + planMeterLimitsTableId: true, + planOverridesTableId: true, + planPricingTableId: true, + plansTableId: true, + plansTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -196,179 +218,205 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "applyBillingPlanFunction", - message: "applyBillingPlanFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "applyPlanAggregateFunction", - message: "applyPlanAggregateFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "applyPlanCapsFunction", - message: "applyPlanCapsFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "applyPlanFunction", - message: "applyPlanFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "planCapsTableId", - message: "planCapsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planLimitsTableId", - message: "planLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planLimitsTableName", - message: "planLimitsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planMeterLimitsTableId", - message: "planMeterLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planOverridesTableId", - message: "planOverridesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planPricingTableId", - message: "planPricingTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "plansTableId", - message: "plansTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "plansTableName", - message: "plansTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'applyBillingPlanFunction', + message: 'applyBillingPlanFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'applyPlanAggregateFunction', + message: 'applyPlanAggregateFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'applyPlanCapsFunction', + message: 'applyPlanCapsFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'applyPlanFunction', + message: 'applyPlanFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'planCapsTableId', + message: 'planCapsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planLimitsTableId', + message: 'planLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planLimitsTableName', + message: 'planLimitsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planMeterLimitsTableId', + message: 'planMeterLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planOverridesTableId', + message: 'planOverridesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planPricingTableId', + message: 'planPricingTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'plansTableId', + message: 'plansTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'plansTableName', + message: 'plansTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePlansModuleInput["plansModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlansModuleInput['plansModule']; const client = getClient(); - const result = await client.plansModule.create({ - data: { - apiName: cleanedData.apiName, - applyBillingPlanFunction: cleanedData.applyBillingPlanFunction, - applyPlanAggregateFunction: cleanedData.applyPlanAggregateFunction, - applyPlanCapsFunction: cleanedData.applyPlanCapsFunction, - applyPlanFunction: cleanedData.applyPlanFunction, - databaseId: cleanedData.databaseId, - planCapsTableId: cleanedData.planCapsTableId, - planLimitsTableId: cleanedData.planLimitsTableId, - planLimitsTableName: cleanedData.planLimitsTableName, - planMeterLimitsTableId: cleanedData.planMeterLimitsTableId, - planOverridesTableId: cleanedData.planOverridesTableId, - planPricingTableId: cleanedData.planPricingTableId, - plansTableId: cleanedData.plansTableId, - plansTableName: cleanedData.plansTableName, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId - }, - select: { - apiName: true, - applyBillingPlanFunction: true, - applyPlanAggregateFunction: true, - applyPlanCapsFunction: true, - applyPlanFunction: true, - databaseId: true, - id: true, - planCapsTableId: true, - planLimitsTableId: true, - planLimitsTableName: true, - planMeterLimitsTableId: true, - planOverridesTableId: true, - planPricingTableId: true, - plansTableId: true, - plansTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true - } - }).execute(); + const result = await client.plansModule + .create({ + data: { + apiName: cleanedData.apiName, + applyBillingPlanFunction: cleanedData.applyBillingPlanFunction, + applyPlanAggregateFunction: cleanedData.applyPlanAggregateFunction, + applyPlanCapsFunction: cleanedData.applyPlanCapsFunction, + applyPlanFunction: cleanedData.applyPlanFunction, + databaseId: cleanedData.databaseId, + planCapsTableId: cleanedData.planCapsTableId, + planLimitsTableId: cleanedData.planLimitsTableId, + planLimitsTableName: cleanedData.planLimitsTableName, + planMeterLimitsTableId: cleanedData.planMeterLimitsTableId, + planOverridesTableId: cleanedData.planOverridesTableId, + planPricingTableId: cleanedData.planPricingTableId, + plansTableId: cleanedData.plansTableId, + plansTableName: cleanedData.plansTableName, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + }, + select: { + apiName: true, + applyBillingPlanFunction: true, + applyPlanAggregateFunction: true, + applyPlanCapsFunction: true, + applyPlanFunction: true, + databaseId: true, + id: true, + planCapsTableId: true, + planLimitsTableId: true, + planLimitsTableName: true, + planMeterLimitsTableId: true, + planOverridesTableId: true, + planPricingTableId: true, + plansTableId: true, + plansTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -377,187 +425,211 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "applyBillingPlanFunction", - message: "applyBillingPlanFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "applyPlanAggregateFunction", - message: "applyPlanAggregateFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "applyPlanCapsFunction", - message: "applyPlanCapsFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "applyPlanFunction", - message: "applyPlanFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "planCapsTableId", - message: "planCapsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planLimitsTableId", - message: "planLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planLimitsTableName", - message: "planLimitsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planMeterLimitsTableId", - message: "planMeterLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planOverridesTableId", - message: "planOverridesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planPricingTableId", - message: "planPricingTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "plansTableId", - message: "plansTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "plansTableName", - message: "plansTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'applyBillingPlanFunction', + message: 'applyBillingPlanFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'applyPlanAggregateFunction', + message: 'applyPlanAggregateFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'applyPlanCapsFunction', + message: 'applyPlanCapsFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'applyPlanFunction', + message: 'applyPlanFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'planCapsTableId', + message: 'planCapsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planLimitsTableId', + message: 'planLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planLimitsTableName', + message: 'planLimitsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planMeterLimitsTableId', + message: 'planMeterLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planOverridesTableId', + message: 'planOverridesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planPricingTableId', + message: 'planPricingTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'plansTableId', + message: 'plansTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'plansTableName', + message: 'plansTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as PlansModulePatch; const client = getClient(); - const result = await client.plansModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - applyBillingPlanFunction: cleanedData.applyBillingPlanFunction, - applyPlanAggregateFunction: cleanedData.applyPlanAggregateFunction, - applyPlanCapsFunction: cleanedData.applyPlanCapsFunction, - applyPlanFunction: cleanedData.applyPlanFunction, - databaseId: cleanedData.databaseId, - planCapsTableId: cleanedData.planCapsTableId, - planLimitsTableId: cleanedData.planLimitsTableId, - planLimitsTableName: cleanedData.planLimitsTableName, - planMeterLimitsTableId: cleanedData.planMeterLimitsTableId, - planOverridesTableId: cleanedData.planOverridesTableId, - planPricingTableId: cleanedData.planPricingTableId, - plansTableId: cleanedData.plansTableId, - plansTableName: cleanedData.plansTableName, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId - }, - select: { - apiName: true, - applyBillingPlanFunction: true, - applyPlanAggregateFunction: true, - applyPlanCapsFunction: true, - applyPlanFunction: true, - databaseId: true, - id: true, - planCapsTableId: true, - planLimitsTableId: true, - planLimitsTableName: true, - planMeterLimitsTableId: true, - planOverridesTableId: true, - planPricingTableId: true, - plansTableId: true, - plansTableName: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - schemaId: true - } - }).execute(); + const result = await client.plansModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + applyBillingPlanFunction: cleanedData.applyBillingPlanFunction, + applyPlanAggregateFunction: cleanedData.applyPlanAggregateFunction, + applyPlanCapsFunction: cleanedData.applyPlanCapsFunction, + applyPlanFunction: cleanedData.applyPlanFunction, + databaseId: cleanedData.databaseId, + planCapsTableId: cleanedData.planCapsTableId, + planLimitsTableId: cleanedData.planLimitsTableId, + planLimitsTableName: cleanedData.planLimitsTableName, + planMeterLimitsTableId: cleanedData.planMeterLimitsTableId, + planOverridesTableId: cleanedData.planOverridesTableId, + planPricingTableId: cleanedData.planPricingTableId, + plansTableId: cleanedData.plansTableId, + plansTableName: cleanedData.plansTableName, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + }, + select: { + apiName: true, + applyBillingPlanFunction: true, + applyPlanAggregateFunction: true, + applyPlanCapsFunction: true, + applyPlanFunction: true, + databaseId: true, + id: true, + planCapsTableId: true, + planLimitsTableId: true, + planLimitsTableName: true, + planMeterLimitsTableId: true, + planOverridesTableId: true, + planPricingTableId: true, + plansTableId: true, + plansTableName: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -566,28 +638,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.plansModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.plansModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} 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 index 805fdd304d..6341fbf932 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/principal-auth-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/principal-auth-module.ts @@ -3,66 +3,80 @@ * @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"; +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 = { - apiName: "string", - auditsTableId: "uuid", - createOrgApiKeyFunction: "string", - createOrgPrincipalFunction: "string", - createPrincipalFunction: "string", - databaseId: "uuid", - deleteOrgPrincipalFunction: "string", - deletePrincipalFunction: "string", - id: "uuid", - principalEntitiesTableId: "uuid", - principalScopeOverridesTableId: "uuid", - principalsTableId: "uuid", - principalsTableName: "string", - revokeOrgApiKeyFunction: "string", - schemaId: "uuid", - sessionCredentialsTableId: "uuid", - sessionsTableId: "uuid", - usersTableId: "uuid" + apiName: 'string', + auditsTableId: 'uuid', + createOrgApiKeyFunction: 'string', + createOrgPrincipalFunction: 'string', + createPrincipalFunction: 'string', + databaseId: 'uuid', + deleteOrgPrincipalFunction: 'string', + deletePrincipalFunction: 'string', + id: 'uuid', + principalEntitiesTableId: 'uuid', + principalScopeOverridesTableId: 'uuid', + principalsTableId: 'uuid', + principalsTableName: 'string', + revokeOrgApiKeyFunction: 'string', + schemaId: 'uuid', + sessionCredentialsTableId: 'uuid', + sessionsTableId: 'uuid', + usersTableId: 'uuid', }; -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) => { +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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -89,16 +103,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, sessionCredentialsTableId: true, sessionsTableId: true, - usersTableId: true + usersTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: PrincipalAuthModuleSelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -125,16 +145,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, sessionCredentialsTableId: true, sessionsTableId: true, - usersTableId: true + usersTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: PrincipalAuthModuleSelect; - }>(argv, defaultSelect); + 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."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -143,39 +169,43 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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: { - apiName: true, - auditsTableId: true, - createOrgApiKeyFunction: true, - createOrgPrincipalFunction: true, - createPrincipalFunction: true, - databaseId: true, - deleteOrgPrincipalFunction: true, - deletePrincipalFunction: true, - id: true, - principalEntitiesTableId: true, - principalScopeOverridesTableId: true, - principalsTableId: true, - principalsTableName: true, - revokeOrgApiKeyFunction: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.principalAuthModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + auditsTableId: true, + createOrgApiKeyFunction: true, + createOrgPrincipalFunction: true, + createPrincipalFunction: true, + databaseId: true, + deleteOrgPrincipalFunction: true, + deletePrincipalFunction: true, + id: true, + principalEntitiesTableId: true, + principalScopeOverridesTableId: true, + principalsTableId: true, + principalsTableName: true, + revokeOrgApiKeyFunction: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -184,155 +214,178 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "auditsTableId", - message: "auditsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createOrgApiKeyFunction", - message: "createOrgApiKeyFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createOrgPrincipalFunction", - message: "createOrgPrincipalFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createPrincipalFunction", - message: "createPrincipalFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "deleteOrgPrincipalFunction", - message: "deleteOrgPrincipalFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deletePrincipalFunction", - message: "deletePrincipalFunction", - 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: "principalsTableId", - message: "principalsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "principalsTableName", - message: "principalsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revokeOrgApiKeyFunction", - message: "revokeOrgApiKeyFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'auditsTableId', + message: 'auditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createOrgApiKeyFunction', + message: 'createOrgApiKeyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createOrgPrincipalFunction', + message: 'createOrgPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createPrincipalFunction', + message: 'createPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'deleteOrgPrincipalFunction', + message: 'deleteOrgPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deletePrincipalFunction', + message: 'deletePrincipalFunction', + 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: 'principalsTableId', + message: 'principalsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalsTableName', + message: 'principalsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revokeOrgApiKeyFunction', + message: 'revokeOrgApiKeyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreatePrincipalAuthModuleInput["principalAuthModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePrincipalAuthModuleInput['principalAuthModule']; const client = getClient(); - const result = await client.principalAuthModule.create({ - data: { - apiName: cleanedData.apiName, - auditsTableId: cleanedData.auditsTableId, - createOrgApiKeyFunction: cleanedData.createOrgApiKeyFunction, - createOrgPrincipalFunction: cleanedData.createOrgPrincipalFunction, - createPrincipalFunction: cleanedData.createPrincipalFunction, - databaseId: cleanedData.databaseId, - deleteOrgPrincipalFunction: cleanedData.deleteOrgPrincipalFunction, - deletePrincipalFunction: cleanedData.deletePrincipalFunction, - principalEntitiesTableId: cleanedData.principalEntitiesTableId, - principalScopeOverridesTableId: cleanedData.principalScopeOverridesTableId, - principalsTableId: cleanedData.principalsTableId, - principalsTableName: cleanedData.principalsTableName, - revokeOrgApiKeyFunction: cleanedData.revokeOrgApiKeyFunction, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionsTableId: cleanedData.sessionsTableId, - usersTableId: cleanedData.usersTableId - }, - select: { - apiName: true, - auditsTableId: true, - createOrgApiKeyFunction: true, - createOrgPrincipalFunction: true, - createPrincipalFunction: true, - databaseId: true, - deleteOrgPrincipalFunction: true, - deletePrincipalFunction: true, - id: true, - principalEntitiesTableId: true, - principalScopeOverridesTableId: true, - principalsTableId: true, - principalsTableName: true, - revokeOrgApiKeyFunction: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.principalAuthModule + .create({ + data: { + apiName: cleanedData.apiName, + auditsTableId: cleanedData.auditsTableId, + createOrgApiKeyFunction: cleanedData.createOrgApiKeyFunction, + createOrgPrincipalFunction: cleanedData.createOrgPrincipalFunction, + createPrincipalFunction: cleanedData.createPrincipalFunction, + databaseId: cleanedData.databaseId, + deleteOrgPrincipalFunction: cleanedData.deleteOrgPrincipalFunction, + deletePrincipalFunction: cleanedData.deletePrincipalFunction, + principalEntitiesTableId: cleanedData.principalEntitiesTableId, + principalScopeOverridesTableId: cleanedData.principalScopeOverridesTableId, + principalsTableId: cleanedData.principalsTableId, + principalsTableName: cleanedData.principalsTableName, + revokeOrgApiKeyFunction: cleanedData.revokeOrgApiKeyFunction, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionsTableId: cleanedData.sessionsTableId, + usersTableId: cleanedData.usersTableId, + }, + select: { + apiName: true, + auditsTableId: true, + createOrgApiKeyFunction: true, + createOrgPrincipalFunction: true, + createPrincipalFunction: true, + databaseId: true, + deleteOrgPrincipalFunction: true, + deletePrincipalFunction: true, + id: true, + principalEntitiesTableId: true, + principalScopeOverridesTableId: true, + principalsTableId: true, + principalsTableName: true, + revokeOrgApiKeyFunction: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -341,163 +394,184 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "auditsTableId", - message: "auditsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createOrgApiKeyFunction", - message: "createOrgApiKeyFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createOrgPrincipalFunction", - message: "createOrgPrincipalFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "createPrincipalFunction", - message: "createPrincipalFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "deleteOrgPrincipalFunction", - message: "deleteOrgPrincipalFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "deletePrincipalFunction", - message: "deletePrincipalFunction", - 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: "principalsTableId", - message: "principalsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "principalsTableName", - message: "principalsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "revokeOrgApiKeyFunction", - message: "revokeOrgApiKeyFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'auditsTableId', + message: 'auditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createOrgApiKeyFunction', + message: 'createOrgApiKeyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createOrgPrincipalFunction', + message: 'createOrgPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createPrincipalFunction', + message: 'createPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'deleteOrgPrincipalFunction', + message: 'deleteOrgPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deletePrincipalFunction', + message: 'deletePrincipalFunction', + 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: 'principalsTableId', + message: 'principalsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalsTableName', + message: 'principalsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revokeOrgApiKeyFunction', + message: 'revokeOrgApiKeyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + 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: { - apiName: cleanedData.apiName, - auditsTableId: cleanedData.auditsTableId, - createOrgApiKeyFunction: cleanedData.createOrgApiKeyFunction, - createOrgPrincipalFunction: cleanedData.createOrgPrincipalFunction, - createPrincipalFunction: cleanedData.createPrincipalFunction, - databaseId: cleanedData.databaseId, - deleteOrgPrincipalFunction: cleanedData.deleteOrgPrincipalFunction, - deletePrincipalFunction: cleanedData.deletePrincipalFunction, - principalEntitiesTableId: cleanedData.principalEntitiesTableId, - principalScopeOverridesTableId: cleanedData.principalScopeOverridesTableId, - principalsTableId: cleanedData.principalsTableId, - principalsTableName: cleanedData.principalsTableName, - revokeOrgApiKeyFunction: cleanedData.revokeOrgApiKeyFunction, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionsTableId: cleanedData.sessionsTableId, - usersTableId: cleanedData.usersTableId - }, - select: { - apiName: true, - auditsTableId: true, - createOrgApiKeyFunction: true, - createOrgPrincipalFunction: true, - createPrincipalFunction: true, - databaseId: true, - deleteOrgPrincipalFunction: true, - deletePrincipalFunction: true, - id: true, - principalEntitiesTableId: true, - principalScopeOverridesTableId: true, - principalsTableId: true, - principalsTableName: true, - revokeOrgApiKeyFunction: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.principalAuthModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + auditsTableId: cleanedData.auditsTableId, + createOrgApiKeyFunction: cleanedData.createOrgApiKeyFunction, + createOrgPrincipalFunction: cleanedData.createOrgPrincipalFunction, + createPrincipalFunction: cleanedData.createPrincipalFunction, + databaseId: cleanedData.databaseId, + deleteOrgPrincipalFunction: cleanedData.deleteOrgPrincipalFunction, + deletePrincipalFunction: cleanedData.deletePrincipalFunction, + principalEntitiesTableId: cleanedData.principalEntitiesTableId, + principalScopeOverridesTableId: cleanedData.principalScopeOverridesTableId, + principalsTableId: cleanedData.principalsTableId, + principalsTableName: cleanedData.principalsTableName, + revokeOrgApiKeyFunction: cleanedData.revokeOrgApiKeyFunction, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionsTableId: cleanedData.sessionsTableId, + usersTableId: cleanedData.usersTableId, + }, + select: { + apiName: true, + auditsTableId: true, + createOrgApiKeyFunction: true, + createOrgPrincipalFunction: true, + createPrincipalFunction: true, + databaseId: true, + deleteOrgPrincipalFunction: true, + deletePrincipalFunction: true, + id: true, + principalEntitiesTableId: true, + principalScopeOverridesTableId: true, + principalsTableId: true, + principalsTableName: true, + revokeOrgApiKeyFunction: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -506,28 +580,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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(); + 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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/profiles-module.ts b/sdk/constructive-cli/src/modules/cli/commands/profiles-module.ts index 37787923e0..c575773b25 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/profiles-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/profiles-module.ts @@ -3,73 +3,87 @@ * @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 { CreateProfilesModuleInput, ProfilesModulePatch, ProfilesModuleSelect, ProfilesModuleFilter, ProfilesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateProfilesModuleInput, + ProfilesModulePatch, + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorTableId: "uuid", - apiName: "string", - databaseId: "uuid", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - membershipsTableId: "uuid", - permissionsTableId: "uuid", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - profileDefinitionGrantsTableId: "uuid", - profileDefinitionGrantsTableName: "string", - profileGrantsTableId: "uuid", - profileGrantsTableName: "string", - profilePermissionsTableId: "uuid", - profilePermissionsTableName: "string", - profileTemplatesTableId: "uuid", - profileTemplatesTableName: "string", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - tableId: "uuid", - tableName: "string" + actorTableId: 'uuid', + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + membershipsTableId: 'uuid', + permissionsTableId: 'uuid', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + profileDefinitionGrantsTableId: 'uuid', + profileDefinitionGrantsTableName: 'string', + profileGrantsTableId: 'uuid', + profileGrantsTableName: 'string', + profilePermissionsTableId: 'uuid', + profilePermissionsTableName: 'string', + profileTemplatesTableId: 'uuid', + profileTemplatesTableName: 'string', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nprofiles-module \n\nCommands:\n list List profilesModule records\n find-first Find first matching profilesModule record\n get Get a profilesModule by ID\n create Create a new profilesModule\n update Update an existing profilesModule\n delete Delete a profilesModule\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) => { +const usage = + '\nprofiles-module \n\nCommands:\n list List profilesModule records\n find-first Find first matching profilesModule record\n get Get a profilesModule by ID\n create Create a new profilesModule\n update Update an existing profilesModule\n delete Delete a profilesModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -103,16 +117,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: ProfilesModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ProfilesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.profilesModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -146,16 +162,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, scope: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ProfilesModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ProfilesModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.profilesModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -164,46 +182,50 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.profilesModule.findOne({ - id: answers.id as string, - select: { - actorTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - membershipsTableId: true, - permissionsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - profileDefinitionGrantsTableId: true, - profileDefinitionGrantsTableName: true, - profileGrantsTableId: true, - profileGrantsTableName: true, - profilePermissionsTableId: true, - profilePermissionsTableName: true, - profileTemplatesTableId: true, - profileTemplatesTableName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.profilesModule + .findOne({ + id: answers.id as string, + select: { + actorTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + membershipsTableId: true, + permissionsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + profileDefinitionGrantsTableId: true, + profileDefinitionGrantsTableName: true, + profileGrantsTableId: true, + profileGrantsTableName: true, + profilePermissionsTableId: true, + profilePermissionsTableName: true, + profileTemplatesTableId: true, + profileTemplatesTableName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -212,210 +234,240 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipsTableId", - message: "membershipsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionsTableId", - message: "permissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileDefinitionGrantsTableId", - message: "profileDefinitionGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileDefinitionGrantsTableName", - message: "profileDefinitionGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileGrantsTableId", - message: "profileGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileGrantsTableName", - message: "profileGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profilePermissionsTableId", - message: "profilePermissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profilePermissionsTableName", - message: "profilePermissionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileTemplatesTableId", - message: "profileTemplatesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileTemplatesTableName", - message: "profileTemplatesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipsTableId', + message: 'membershipsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionsTableId', + message: 'permissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileDefinitionGrantsTableId', + message: 'profileDefinitionGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileDefinitionGrantsTableName', + message: 'profileDefinitionGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileGrantsTableId', + message: 'profileGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileGrantsTableName', + message: 'profileGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profilePermissionsTableId', + message: 'profilePermissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profilePermissionsTableName', + message: 'profilePermissionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileTemplatesTableId', + message: 'profileTemplatesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileTemplatesTableName', + message: 'profileTemplatesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateProfilesModuleInput["profilesModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateProfilesModuleInput['profilesModule']; const client = getClient(); - const result = await client.profilesModule.create({ - data: { - actorTableId: cleanedData.actorTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - membershipsTableId: cleanedData.membershipsTableId, - permissionsTableId: cleanedData.permissionsTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - profileDefinitionGrantsTableId: cleanedData.profileDefinitionGrantsTableId, - profileDefinitionGrantsTableName: cleanedData.profileDefinitionGrantsTableName, - profileGrantsTableId: cleanedData.profileGrantsTableId, - profileGrantsTableName: cleanedData.profileGrantsTableName, - profilePermissionsTableId: cleanedData.profilePermissionsTableId, - profilePermissionsTableName: cleanedData.profilePermissionsTableName, - profileTemplatesTableId: cleanedData.profileTemplatesTableId, - profileTemplatesTableName: cleanedData.profileTemplatesTableName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - actorTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - membershipsTableId: true, - permissionsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - profileDefinitionGrantsTableId: true, - profileDefinitionGrantsTableName: true, - profileGrantsTableId: true, - profileGrantsTableName: true, - profilePermissionsTableId: true, - profilePermissionsTableName: true, - profileTemplatesTableId: true, - profileTemplatesTableName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.profilesModule + .create({ + data: { + actorTableId: cleanedData.actorTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + membershipsTableId: cleanedData.membershipsTableId, + permissionsTableId: cleanedData.permissionsTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + profileDefinitionGrantsTableId: cleanedData.profileDefinitionGrantsTableId, + profileDefinitionGrantsTableName: cleanedData.profileDefinitionGrantsTableName, + profileGrantsTableId: cleanedData.profileGrantsTableId, + profileGrantsTableName: cleanedData.profileGrantsTableName, + profilePermissionsTableId: cleanedData.profilePermissionsTableId, + profilePermissionsTableName: cleanedData.profilePermissionsTableName, + profileTemplatesTableId: cleanedData.profileTemplatesTableId, + profileTemplatesTableName: cleanedData.profileTemplatesTableName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + actorTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + membershipsTableId: true, + permissionsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + profileDefinitionGrantsTableId: true, + profileDefinitionGrantsTableName: true, + profileGrantsTableId: true, + profileGrantsTableName: true, + profilePermissionsTableId: true, + profilePermissionsTableName: true, + profileTemplatesTableId: true, + profileTemplatesTableName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -424,218 +476,246 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorTableId", - message: "actorTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "membershipsTableId", - message: "membershipsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "permissionsTableId", - message: "permissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileDefinitionGrantsTableId", - message: "profileDefinitionGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileDefinitionGrantsTableName", - message: "profileDefinitionGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileGrantsTableId", - message: "profileGrantsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileGrantsTableName", - message: "profileGrantsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profilePermissionsTableId", - message: "profilePermissionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profilePermissionsTableName", - message: "profilePermissionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileTemplatesTableId", - message: "profileTemplatesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "profileTemplatesTableName", - message: "profileTemplatesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorTableId', + message: 'actorTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'membershipsTableId', + message: 'membershipsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'permissionsTableId', + message: 'permissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileDefinitionGrantsTableId', + message: 'profileDefinitionGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileDefinitionGrantsTableName', + message: 'profileDefinitionGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileGrantsTableId', + message: 'profileGrantsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileGrantsTableName', + message: 'profileGrantsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profilePermissionsTableId', + message: 'profilePermissionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profilePermissionsTableName', + message: 'profilePermissionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileTemplatesTableId', + message: 'profileTemplatesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'profileTemplatesTableName', + message: 'profileTemplatesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ProfilesModulePatch; const client = getClient(); - const result = await client.profilesModule.update({ - where: { - id: answers.id as string - }, - data: { - actorTableId: cleanedData.actorTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - membershipsTableId: cleanedData.membershipsTableId, - permissionsTableId: cleanedData.permissionsTableId, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - profileDefinitionGrantsTableId: cleanedData.profileDefinitionGrantsTableId, - profileDefinitionGrantsTableName: cleanedData.profileDefinitionGrantsTableName, - profileGrantsTableId: cleanedData.profileGrantsTableId, - profileGrantsTableName: cleanedData.profileGrantsTableName, - profilePermissionsTableId: cleanedData.profilePermissionsTableId, - profilePermissionsTableName: cleanedData.profilePermissionsTableName, - profileTemplatesTableId: cleanedData.profileTemplatesTableId, - profileTemplatesTableName: cleanedData.profileTemplatesTableName, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - actorTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityTableId: true, - id: true, - membershipsTableId: true, - permissionsTableId: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - profileDefinitionGrantsTableId: true, - profileDefinitionGrantsTableName: true, - profileGrantsTableId: true, - profileGrantsTableName: true, - profilePermissionsTableId: true, - profilePermissionsTableName: true, - profileTemplatesTableId: true, - profileTemplatesTableName: true, - publicSchemaName: true, - schemaId: true, - scope: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.profilesModule + .update({ + where: { + id: answers.id as string, + }, + data: { + actorTableId: cleanedData.actorTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + membershipsTableId: cleanedData.membershipsTableId, + permissionsTableId: cleanedData.permissionsTableId, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + profileDefinitionGrantsTableId: cleanedData.profileDefinitionGrantsTableId, + profileDefinitionGrantsTableName: cleanedData.profileDefinitionGrantsTableName, + profileGrantsTableId: cleanedData.profileGrantsTableId, + profileGrantsTableName: cleanedData.profileGrantsTableName, + profilePermissionsTableId: cleanedData.profilePermissionsTableId, + profilePermissionsTableName: cleanedData.profilePermissionsTableName, + profileTemplatesTableId: cleanedData.profileTemplatesTableId, + profileTemplatesTableName: cleanedData.profileTemplatesTableName, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + actorTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityTableId: true, + id: true, + membershipsTableId: true, + permissionsTableId: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + profileDefinitionGrantsTableId: true, + profileDefinitionGrantsTableName: true, + profileGrantsTableId: true, + profileGrantsTableName: true, + profilePermissionsTableId: true, + profilePermissionsTableName: true, + profileTemplatesTableId: true, + profileTemplatesTableName: true, + publicSchemaName: true, + schemaId: true, + scope: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -644,28 +724,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.profilesModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.profilesModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/modules/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/provision-check-constraint.ts b/sdk/constructive-cli/src/modules/cli/commands/provision-check-constraint.ts index cad6d4b43d..9139f8dfb1 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/provision-check-constraint.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/provision-check-constraint.ts @@ -3,37 +3,51 @@ * @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 { ProvisionCheckConstraintVariables } from "../../orm/mutation"; -import type { ProvisionCheckConstraintPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionCheckConstraintVariables } from '../../orm/mutation'; +import type { ProvisionCheckConstraintPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: provision-check-constraint [OPTIONS]\n"); + console.log( + '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\nUsage: provision-check-constraint [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 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.provisionCheckConstraint(parsedAnswers as unknown as ProvisionCheckConstraintVariables, { - select: selectFields - } as unknown as { - select: ProvisionCheckConstraintPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionCheckConstraint( + parsedAnswers as unknown as ProvisionCheckConstraintVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionCheckConstraintPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionCheckConstraint"); + console.error('Failed: provisionCheckConstraint'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/provision-full-text-search.ts b/sdk/constructive-cli/src/modules/cli/commands/provision-full-text-search.ts index 93e3622628..ef353f9429 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/provision-full-text-search.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/provision-full-text-search.ts @@ -3,37 +3,51 @@ * @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 { ProvisionFullTextSearchVariables } from "../../orm/mutation"; -import type { ProvisionFullTextSearchPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionFullTextSearchVariables } from '../../orm/mutation'; +import type { ProvisionFullTextSearchPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: provision-full-text-search [OPTIONS]\n"); + console.log( + '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\nUsage: provision-full-text-search [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 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.provisionFullTextSearch(parsedAnswers as unknown as ProvisionFullTextSearchVariables, { - select: selectFields - } as unknown as { - select: ProvisionFullTextSearchPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionFullTextSearch( + parsedAnswers as unknown as ProvisionFullTextSearchVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionFullTextSearchPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionFullTextSearch"); + console.error('Failed: provisionFullTextSearch'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/provision-index.ts b/sdk/constructive-cli/src/modules/cli/commands/provision-index.ts index c7065c3294..76ad632afa 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/provision-index.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/provision-index.ts @@ -3,37 +3,51 @@ * @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 { ProvisionIndexVariables } from "../../orm/mutation"; -import type { ProvisionIndexPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionIndexVariables } from '../../orm/mutation'; +import type { ProvisionIndexPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: provision-index [OPTIONS]\n"); + console.log( + '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\nUsage: provision-index [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 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.provisionIndex(parsedAnswers as unknown as ProvisionIndexVariables, { - select: selectFields - } as unknown as { - select: ProvisionIndexPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionIndex( + parsedAnswers as unknown as ProvisionIndexVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionIndexPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionIndex"); + console.error('Failed: provisionIndex'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/provision-relation.ts b/sdk/constructive-cli/src/modules/cli/commands/provision-relation.ts index 352c6996c5..3d924f2028 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/provision-relation.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/provision-relation.ts @@ -3,37 +3,51 @@ * @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 { ProvisionRelationVariables } from "../../orm/mutation"; -import type { ProvisionRelationPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionRelationVariables } from '../../orm/mutation'; +import type { ProvisionRelationPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: provision-relation [OPTIONS]\n"); + console.log( + '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\nUsage: provision-relation [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 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.provisionRelation(parsedAnswers as unknown as ProvisionRelationVariables, { - select: selectFields - } as unknown as { - select: ProvisionRelationPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionRelation( + parsedAnswers as unknown as ProvisionRelationVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionRelationPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionRelation"); + console.error('Failed: provisionRelation'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/provision-spatial-relation.ts b/sdk/constructive-cli/src/modules/cli/commands/provision-spatial-relation.ts index 3cc226204b..fd46815bb8 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/provision-spatial-relation.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/provision-spatial-relation.ts @@ -3,37 +3,51 @@ * @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 { ProvisionSpatialRelationVariables } from "../../orm/mutation"; -import type { ProvisionSpatialRelationPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionSpatialRelationVariables } from '../../orm/mutation'; +import type { ProvisionSpatialRelationPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: provision-spatial-relation [OPTIONS]\n"); + console.log( + '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\nUsage: provision-spatial-relation [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 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.provisionSpatialRelation(parsedAnswers as unknown as ProvisionSpatialRelationVariables, { - select: selectFields - } as unknown as { - select: ProvisionSpatialRelationPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionSpatialRelation( + parsedAnswers as unknown as ProvisionSpatialRelationVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionSpatialRelationPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionSpatialRelation"); + console.error('Failed: provisionSpatialRelation'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/provision-table.ts b/sdk/constructive-cli/src/modules/cli/commands/provision-table.ts index d586182bd2..2d0e98f46f 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/provision-table.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/provision-table.ts @@ -3,37 +3,51 @@ * @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 { ProvisionTableVariables } from "../../orm/mutation"; -import type { ProvisionTablePayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionTableVariables } from '../../orm/mutation'; +import type { ProvisionTablePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: provision-table [OPTIONS]\n"); + console.log( + '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\nUsage: provision-table [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 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.provisionTable(parsedAnswers as unknown as ProvisionTableVariables, { - select: selectFields - } as unknown as { - select: ProvisionTablePayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionTable( + parsedAnswers as unknown as ProvisionTableVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionTablePayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionTable"); + console.error('Failed: provisionTable'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/provision-unique-constraint.ts b/sdk/constructive-cli/src/modules/cli/commands/provision-unique-constraint.ts index d63b37b84f..97caac5c74 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/provision-unique-constraint.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/provision-unique-constraint.ts @@ -3,37 +3,51 @@ * @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 { ProvisionUniqueConstraintVariables } from "../../orm/mutation"; -import type { ProvisionUniqueConstraintPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionUniqueConstraintVariables } from '../../orm/mutation'; +import type { ProvisionUniqueConstraintPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: provision-unique-constraint [OPTIONS]\n"); + console.log( + '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\nUsage: provision-unique-constraint [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 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.provisionUniqueConstraint(parsedAnswers as unknown as ProvisionUniqueConstraintVariables, { - select: selectFields - } as unknown as { - select: ProvisionUniqueConstraintPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionUniqueConstraint( + parsedAnswers as unknown as ProvisionUniqueConstraintVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionUniqueConstraintPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionUniqueConstraint"); + console.error('Failed: provisionUniqueConstraint'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/rate-limit-meters-module.ts b/sdk/constructive-cli/src/modules/cli/commands/rate-limit-meters-module.ts index 12a138b92c..ea629fc4ff 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/rate-limit-meters-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/rate-limit-meters-module.ts @@ -3,65 +3,79 @@ * @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 { CreateRateLimitMetersModuleInput, RateLimitMetersModulePatch, RateLimitMetersModuleSelect, RateLimitMetersModuleFilter, RateLimitMetersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRateLimitMetersModuleInput, + RateLimitMetersModulePatch, + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - checkRateLimitFunction: "string", - databaseId: "uuid", - defaultPermissions: "string", - id: "uuid", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - rateLimitOverridesTableId: "uuid", - rateLimitOverridesTableName: "string", - rateLimitStateTableId: "uuid", - rateLimitStateTableName: "string", - rateWindowLimitsTableId: "uuid", - rateWindowLimitsTableName: "string", - schemaId: "uuid" + apiName: 'string', + checkRateLimitFunction: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + id: 'uuid', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + rateLimitOverridesTableId: 'uuid', + rateLimitOverridesTableName: 'string', + rateLimitStateTableId: 'uuid', + rateLimitStateTableName: 'string', + rateWindowLimitsTableId: 'uuid', + rateWindowLimitsTableName: 'string', + schemaId: 'uuid', }; -const usage = "\nrate-limit-meters-module \n\nCommands:\n list List rateLimitMetersModule records\n find-first Find first matching rateLimitMetersModule record\n get Get a rateLimitMetersModule by ID\n create Create a new rateLimitMetersModule\n update Update an existing rateLimitMetersModule\n delete Delete a rateLimitMetersModule\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) => { +const usage = + '\nrate-limit-meters-module \n\nCommands:\n list List rateLimitMetersModule records\n find-first Find first matching rateLimitMetersModule record\n get Get a rateLimitMetersModule by ID\n create Create a new rateLimitMetersModule\n update Update an existing rateLimitMetersModule\n delete Delete a rateLimitMetersModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -87,16 +101,22 @@ async function handleList(argv: Partial>, _prompter: Inq rateLimitStateTableName: true, rateWindowLimitsTableId: true, rateWindowLimitsTableName: true, - schemaId: true + schemaId: true, }; - const findManyArgs = parseFindManyArgs & { - select: RateLimitMetersModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy + > & { + select: RateLimitMetersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.rateLimitMetersModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -122,16 +142,22 @@ async function handleFindFirst(argv: Partial>, _prompter rateLimitStateTableName: true, rateWindowLimitsTableId: true, rateWindowLimitsTableName: true, - schemaId: true + schemaId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RateLimitMetersModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy + > & { + select: RateLimitMetersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.rateLimitMetersModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -140,38 +166,42 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.rateLimitMetersModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - checkRateLimitFunction: true, - databaseId: true, - defaultPermissions: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - rateLimitOverridesTableId: true, - rateLimitOverridesTableName: true, - rateLimitStateTableId: true, - rateLimitStateTableName: true, - rateWindowLimitsTableId: true, - rateWindowLimitsTableName: true, - schemaId: true - } - }).execute(); + const result = await client.rateLimitMetersModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + checkRateLimitFunction: true, + databaseId: true, + defaultPermissions: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + rateLimitOverridesTableId: true, + rateLimitOverridesTableName: true, + rateLimitStateTableId: true, + rateLimitStateTableName: true, + rateWindowLimitsTableId: true, + rateWindowLimitsTableName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -180,147 +210,169 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "checkRateLimitFunction", - message: "checkRateLimitFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitOverridesTableId", - message: "rateLimitOverridesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitOverridesTableName", - message: "rateLimitOverridesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitStateTableId", - message: "rateLimitStateTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitStateTableName", - message: "rateLimitStateTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateWindowLimitsTableId", - message: "rateWindowLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateWindowLimitsTableName", - message: "rateWindowLimitsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'checkRateLimitFunction', + message: 'checkRateLimitFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitOverridesTableId', + message: 'rateLimitOverridesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitOverridesTableName', + message: 'rateLimitOverridesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitStateTableId', + message: 'rateLimitStateTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitStateTableName', + message: 'rateLimitStateTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateWindowLimitsTableId', + message: 'rateWindowLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateWindowLimitsTableName', + message: 'rateWindowLimitsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRateLimitMetersModuleInput["rateLimitMetersModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateRateLimitMetersModuleInput['rateLimitMetersModule']; const client = getClient(); - const result = await client.rateLimitMetersModule.create({ - data: { - apiName: cleanedData.apiName, - checkRateLimitFunction: cleanedData.checkRateLimitFunction, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - rateLimitOverridesTableId: cleanedData.rateLimitOverridesTableId, - rateLimitOverridesTableName: cleanedData.rateLimitOverridesTableName, - rateLimitStateTableId: cleanedData.rateLimitStateTableId, - rateLimitStateTableName: cleanedData.rateLimitStateTableName, - rateWindowLimitsTableId: cleanedData.rateWindowLimitsTableId, - rateWindowLimitsTableName: cleanedData.rateWindowLimitsTableName, - schemaId: cleanedData.schemaId - }, - select: { - apiName: true, - checkRateLimitFunction: true, - databaseId: true, - defaultPermissions: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - rateLimitOverridesTableId: true, - rateLimitOverridesTableName: true, - rateLimitStateTableId: true, - rateLimitStateTableName: true, - rateWindowLimitsTableId: true, - rateWindowLimitsTableName: true, - schemaId: true - } - }).execute(); + const result = await client.rateLimitMetersModule + .create({ + data: { + apiName: cleanedData.apiName, + checkRateLimitFunction: cleanedData.checkRateLimitFunction, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + rateLimitOverridesTableId: cleanedData.rateLimitOverridesTableId, + rateLimitOverridesTableName: cleanedData.rateLimitOverridesTableName, + rateLimitStateTableId: cleanedData.rateLimitStateTableId, + rateLimitStateTableName: cleanedData.rateLimitStateTableName, + rateWindowLimitsTableId: cleanedData.rateWindowLimitsTableId, + rateWindowLimitsTableName: cleanedData.rateWindowLimitsTableName, + schemaId: cleanedData.schemaId, + }, + select: { + apiName: true, + checkRateLimitFunction: true, + databaseId: true, + defaultPermissions: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + rateLimitOverridesTableId: true, + rateLimitOverridesTableName: true, + rateLimitStateTableId: true, + rateLimitStateTableName: true, + rateWindowLimitsTableId: true, + rateWindowLimitsTableName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -329,155 +381,175 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "checkRateLimitFunction", - message: "checkRateLimitFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitOverridesTableId", - message: "rateLimitOverridesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitOverridesTableName", - message: "rateLimitOverridesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitStateTableId", - message: "rateLimitStateTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitStateTableName", - message: "rateLimitStateTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateWindowLimitsTableId", - message: "rateWindowLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateWindowLimitsTableName", - message: "rateWindowLimitsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'checkRateLimitFunction', + message: 'checkRateLimitFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitOverridesTableId', + message: 'rateLimitOverridesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitOverridesTableName', + message: 'rateLimitOverridesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitStateTableId', + message: 'rateLimitStateTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitStateTableName', + message: 'rateLimitStateTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateWindowLimitsTableId', + message: 'rateWindowLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateWindowLimitsTableName', + message: 'rateWindowLimitsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RateLimitMetersModulePatch; const client = getClient(); - const result = await client.rateLimitMetersModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - checkRateLimitFunction: cleanedData.checkRateLimitFunction, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - rateLimitOverridesTableId: cleanedData.rateLimitOverridesTableId, - rateLimitOverridesTableName: cleanedData.rateLimitOverridesTableName, - rateLimitStateTableId: cleanedData.rateLimitStateTableId, - rateLimitStateTableName: cleanedData.rateLimitStateTableName, - rateWindowLimitsTableId: cleanedData.rateWindowLimitsTableId, - rateWindowLimitsTableName: cleanedData.rateWindowLimitsTableName, - schemaId: cleanedData.schemaId - }, - select: { - apiName: true, - checkRateLimitFunction: true, - databaseId: true, - defaultPermissions: true, - id: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - rateLimitOverridesTableId: true, - rateLimitOverridesTableName: true, - rateLimitStateTableId: true, - rateLimitStateTableName: true, - rateWindowLimitsTableId: true, - rateWindowLimitsTableName: true, - schemaId: true - } - }).execute(); + const result = await client.rateLimitMetersModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + checkRateLimitFunction: cleanedData.checkRateLimitFunction, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + rateLimitOverridesTableId: cleanedData.rateLimitOverridesTableId, + rateLimitOverridesTableName: cleanedData.rateLimitOverridesTableName, + rateLimitStateTableId: cleanedData.rateLimitStateTableId, + rateLimitStateTableName: cleanedData.rateLimitStateTableName, + rateWindowLimitsTableId: cleanedData.rateWindowLimitsTableId, + rateWindowLimitsTableName: cleanedData.rateWindowLimitsTableName, + schemaId: cleanedData.schemaId, + }, + select: { + apiName: true, + checkRateLimitFunction: true, + databaseId: true, + defaultPermissions: true, + id: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + rateLimitOverridesTableId: true, + rateLimitOverridesTableName: true, + rateLimitStateTableId: true, + rateLimitStateTableName: true, + rateWindowLimitsTableId: true, + rateWindowLimitsTableName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -486,28 +558,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.rateLimitMetersModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.rateLimitMetersModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/rate-limits-module.ts b/sdk/constructive-cli/src/modules/cli/commands/rate-limits-module.ts index 1fbc445981..8f48e3de29 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/rate-limits-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/rate-limits-module.ts @@ -3,57 +3,71 @@ * @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 { CreateRateLimitsModuleInput, RateLimitsModulePatch, RateLimitsModuleSelect, RateLimitsModuleFilter, RateLimitsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRateLimitsModuleInput, + RateLimitsModulePatch, + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - id: "uuid", - ipRateLimitsTableId: "uuid", - ipRateLimitsTableName: "string", - rateLimitSettingsTableId: "uuid", - rateLimitSettingsTableName: "string", - rateLimitsTableId: "uuid", - rateLimitsTableName: "string", - schemaId: "uuid" + databaseId: 'uuid', + id: 'uuid', + ipRateLimitsTableId: 'uuid', + ipRateLimitsTableName: 'string', + rateLimitSettingsTableId: 'uuid', + rateLimitSettingsTableName: 'string', + rateLimitsTableId: 'uuid', + rateLimitsTableName: 'string', + schemaId: 'uuid', }; -const usage = "\nrate-limits-module \n\nCommands:\n list List rateLimitsModule records\n find-first Find first matching rateLimitsModule record\n get Get a rateLimitsModule by ID\n create Create a new rateLimitsModule\n update Update an existing rateLimitsModule\n delete Delete a rateLimitsModule\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) => { +const usage = + '\nrate-limits-module \n\nCommands:\n list List rateLimitsModule records\n find-first Find first matching rateLimitsModule record\n get Get a rateLimitsModule by ID\n create Create a new rateLimitsModule\n update Update an existing rateLimitsModule\n delete Delete a rateLimitsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq rateLimitSettingsTableName: true, rateLimitsTableId: true, rateLimitsTableName: true, - schemaId: true + schemaId: true, }; - const findManyArgs = parseFindManyArgs & { - select: RateLimitsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RateLimitsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.rateLimitsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter rateLimitSettingsTableName: true, rateLimitsTableId: true, rateLimitsTableName: true, - schemaId: true + schemaId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RateLimitsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RateLimitsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.rateLimitsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.rateLimitsModule.findOne({ - id: answers.id as string, - select: { - databaseId: true, - id: true, - ipRateLimitsTableId: true, - ipRateLimitsTableName: true, - rateLimitSettingsTableId: true, - rateLimitSettingsTableName: true, - rateLimitsTableId: true, - rateLimitsTableName: true, - schemaId: true - } - }).execute(); + const result = await client.rateLimitsModule + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + id: true, + ipRateLimitsTableId: true, + ipRateLimitsTableName: true, + rateLimitSettingsTableId: true, + rateLimitSettingsTableName: true, + rateLimitsTableId: true, + rateLimitsTableName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,83 +170,97 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "ipRateLimitsTableId", - message: "ipRateLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ipRateLimitsTableName", - message: "ipRateLimitsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitSettingsTableId", - message: "rateLimitSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitSettingsTableName", - message: "rateLimitSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitsTableId", - message: "rateLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitsTableName", - message: "rateLimitsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'ipRateLimitsTableId', + message: 'ipRateLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ipRateLimitsTableName', + message: 'ipRateLimitsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitSettingsTableId', + message: 'rateLimitSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitSettingsTableName', + message: 'rateLimitSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitsTableId', + message: 'rateLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitsTableName', + message: 'rateLimitsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRateLimitsModuleInput["rateLimitsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateRateLimitsModuleInput['rateLimitsModule']; const client = getClient(); - const result = await client.rateLimitsModule.create({ - data: { - databaseId: cleanedData.databaseId, - ipRateLimitsTableId: cleanedData.ipRateLimitsTableId, - ipRateLimitsTableName: cleanedData.ipRateLimitsTableName, - rateLimitSettingsTableId: cleanedData.rateLimitSettingsTableId, - rateLimitSettingsTableName: cleanedData.rateLimitSettingsTableName, - rateLimitsTableId: cleanedData.rateLimitsTableId, - rateLimitsTableName: cleanedData.rateLimitsTableName, - schemaId: cleanedData.schemaId - }, - select: { - databaseId: true, - id: true, - ipRateLimitsTableId: true, - ipRateLimitsTableName: true, - rateLimitSettingsTableId: true, - rateLimitSettingsTableName: true, - rateLimitsTableId: true, - rateLimitsTableName: true, - schemaId: true - } - }).execute(); + const result = await client.rateLimitsModule + .create({ + data: { + databaseId: cleanedData.databaseId, + ipRateLimitsTableId: cleanedData.ipRateLimitsTableId, + ipRateLimitsTableName: cleanedData.ipRateLimitsTableName, + rateLimitSettingsTableId: cleanedData.rateLimitSettingsTableId, + rateLimitSettingsTableName: cleanedData.rateLimitSettingsTableName, + rateLimitsTableId: cleanedData.rateLimitsTableId, + rateLimitsTableName: cleanedData.rateLimitsTableName, + schemaId: cleanedData.schemaId, + }, + select: { + databaseId: true, + id: true, + ipRateLimitsTableId: true, + ipRateLimitsTableName: true, + rateLimitSettingsTableId: true, + rateLimitSettingsTableName: true, + rateLimitsTableId: true, + rateLimitsTableName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -233,91 +269,103 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "ipRateLimitsTableId", - message: "ipRateLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ipRateLimitsTableName", - message: "ipRateLimitsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitSettingsTableId", - message: "rateLimitSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitSettingsTableName", - message: "rateLimitSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitsTableId", - message: "rateLimitsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rateLimitsTableName", - message: "rateLimitsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }]); + 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: 'ipRateLimitsTableId', + message: 'ipRateLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ipRateLimitsTableName', + message: 'ipRateLimitsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitSettingsTableId', + message: 'rateLimitSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitSettingsTableName', + message: 'rateLimitSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitsTableId', + message: 'rateLimitsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rateLimitsTableName', + message: 'rateLimitsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RateLimitsModulePatch; const client = getClient(); - const result = await client.rateLimitsModule.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - ipRateLimitsTableId: cleanedData.ipRateLimitsTableId, - ipRateLimitsTableName: cleanedData.ipRateLimitsTableName, - rateLimitSettingsTableId: cleanedData.rateLimitSettingsTableId, - rateLimitSettingsTableName: cleanedData.rateLimitSettingsTableName, - rateLimitsTableId: cleanedData.rateLimitsTableId, - rateLimitsTableName: cleanedData.rateLimitsTableName, - schemaId: cleanedData.schemaId - }, - select: { - databaseId: true, - id: true, - ipRateLimitsTableId: true, - ipRateLimitsTableName: true, - rateLimitSettingsTableId: true, - rateLimitSettingsTableName: true, - rateLimitsTableId: true, - rateLimitsTableName: true, - schemaId: true - } - }).execute(); + const result = await client.rateLimitsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + ipRateLimitsTableId: cleanedData.ipRateLimitsTableId, + ipRateLimitsTableName: cleanedData.ipRateLimitsTableName, + rateLimitSettingsTableId: cleanedData.rateLimitSettingsTableId, + rateLimitSettingsTableName: cleanedData.rateLimitSettingsTableName, + rateLimitsTableId: cleanedData.rateLimitsTableId, + rateLimitsTableName: cleanedData.rateLimitsTableName, + schemaId: cleanedData.schemaId, + }, + select: { + databaseId: true, + id: true, + ipRateLimitsTableId: true, + ipRateLimitsTableName: true, + rateLimitSettingsTableId: true, + rateLimitSettingsTableName: true, + rateLimitsTableId: true, + rateLimitsTableName: true, + schemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -326,28 +374,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.rateLimitsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.rateLimitsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/realtime-module.ts b/sdk/constructive-cli/src/modules/cli/commands/realtime-module.ts index 65b707b377..8140c73e5f 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/realtime-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/realtime-module.ts @@ -3,62 +3,76 @@ * @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 { CreateRealtimeModuleInput, RealtimeModulePatch, RealtimeModuleSelect, RealtimeModuleFilter, RealtimeModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRealtimeModuleInput, + RealtimeModulePatch, + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - changeLogTableId: "uuid", - databaseId: "uuid", - id: "uuid", - interval: "string", - listenerNodeTableId: "uuid", - notifyChannel: "string", - premake: "int", - privateApiName: "string", - privateSchemaId: "uuid", - retentionHours: "int", - schemaId: "uuid", - sourceRegistryTableId: "uuid", - subscriptionsSchemaId: "uuid" + apiName: 'string', + changeLogTableId: 'uuid', + databaseId: 'uuid', + id: 'uuid', + interval: 'string', + listenerNodeTableId: 'uuid', + notifyChannel: 'string', + premake: 'int', + privateApiName: 'string', + privateSchemaId: 'uuid', + retentionHours: 'int', + schemaId: 'uuid', + sourceRegistryTableId: 'uuid', + subscriptionsSchemaId: 'uuid', }; -const usage = "\nrealtime-module \n\nCommands:\n list List realtimeModule records\n find-first Find first matching realtimeModule record\n get Get a realtimeModule by ID\n create Create a new realtimeModule\n update Update an existing realtimeModule\n delete Delete a realtimeModule\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) => { +const usage = + '\nrealtime-module \n\nCommands:\n list List realtimeModule records\n find-first Find first matching realtimeModule record\n get Get a realtimeModule by ID\n create Create a new realtimeModule\n update Update an existing realtimeModule\n delete Delete a realtimeModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,18 @@ async function handleList(argv: Partial>, _prompter: Inq retentionHours: true, schemaId: true, sourceRegistryTableId: true, - subscriptionsSchemaId: true + subscriptionsSchemaId: true, }; - const findManyArgs = parseFindManyArgs & { - select: RealtimeModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RealtimeModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.realtimeModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +129,18 @@ async function handleFindFirst(argv: Partial>, _prompter retentionHours: true, schemaId: true, sourceRegistryTableId: true, - subscriptionsSchemaId: true + subscriptionsSchemaId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RealtimeModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RealtimeModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.realtimeModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +149,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.realtimeModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - changeLogTableId: true, - databaseId: true, - id: true, - interval: true, - listenerNodeTableId: true, - notifyChannel: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - retentionHours: true, - schemaId: true, - sourceRegistryTableId: true, - subscriptionsSchemaId: true - } - }).execute(); + const result = await client.realtimeModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + changeLogTableId: true, + databaseId: true, + id: true, + interval: true, + listenerNodeTableId: true, + notifyChannel: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + retentionHours: true, + schemaId: true, + sourceRegistryTableId: true, + subscriptionsSchemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,123 +190,142 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "changeLogTableId", - message: "changeLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "listenerNodeTableId", - message: "listenerNodeTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "notifyChannel", - message: "notifyChannel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retentionHours", - message: "retentionHours", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sourceRegistryTableId", - message: "sourceRegistryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "subscriptionsSchemaId", - message: "subscriptionsSchemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'changeLogTableId', + message: 'changeLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'listenerNodeTableId', + message: 'listenerNodeTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'notifyChannel', + message: 'notifyChannel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retentionHours', + message: 'retentionHours', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sourceRegistryTableId', + message: 'sourceRegistryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'subscriptionsSchemaId', + message: 'subscriptionsSchemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRealtimeModuleInput["realtimeModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateRealtimeModuleInput['realtimeModule']; const client = getClient(); - const result = await client.realtimeModule.create({ - data: { - apiName: cleanedData.apiName, - changeLogTableId: cleanedData.changeLogTableId, - databaseId: cleanedData.databaseId, - interval: cleanedData.interval, - listenerNodeTableId: cleanedData.listenerNodeTableId, - notifyChannel: cleanedData.notifyChannel, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - retentionHours: cleanedData.retentionHours, - schemaId: cleanedData.schemaId, - sourceRegistryTableId: cleanedData.sourceRegistryTableId, - subscriptionsSchemaId: cleanedData.subscriptionsSchemaId - }, - select: { - apiName: true, - changeLogTableId: true, - databaseId: true, - id: true, - interval: true, - listenerNodeTableId: true, - notifyChannel: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - retentionHours: true, - schemaId: true, - sourceRegistryTableId: true, - subscriptionsSchemaId: true - } - }).execute(); + const result = await client.realtimeModule + .create({ + data: { + apiName: cleanedData.apiName, + changeLogTableId: cleanedData.changeLogTableId, + databaseId: cleanedData.databaseId, + interval: cleanedData.interval, + listenerNodeTableId: cleanedData.listenerNodeTableId, + notifyChannel: cleanedData.notifyChannel, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + retentionHours: cleanedData.retentionHours, + schemaId: cleanedData.schemaId, + sourceRegistryTableId: cleanedData.sourceRegistryTableId, + subscriptionsSchemaId: cleanedData.subscriptionsSchemaId, + }, + select: { + apiName: true, + changeLogTableId: true, + databaseId: true, + id: true, + interval: true, + listenerNodeTableId: true, + notifyChannel: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + retentionHours: true, + schemaId: true, + sourceRegistryTableId: true, + subscriptionsSchemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -293,131 +334,148 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "changeLogTableId", - message: "changeLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "listenerNodeTableId", - message: "listenerNodeTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "notifyChannel", - message: "notifyChannel", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retentionHours", - message: "retentionHours", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sourceRegistryTableId", - message: "sourceRegistryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "subscriptionsSchemaId", - message: "subscriptionsSchemaId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'changeLogTableId', + message: 'changeLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'listenerNodeTableId', + message: 'listenerNodeTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'notifyChannel', + message: 'notifyChannel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retentionHours', + message: 'retentionHours', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sourceRegistryTableId', + message: 'sourceRegistryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'subscriptionsSchemaId', + message: 'subscriptionsSchemaId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RealtimeModulePatch; const client = getClient(); - const result = await client.realtimeModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - changeLogTableId: cleanedData.changeLogTableId, - databaseId: cleanedData.databaseId, - interval: cleanedData.interval, - listenerNodeTableId: cleanedData.listenerNodeTableId, - notifyChannel: cleanedData.notifyChannel, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - retentionHours: cleanedData.retentionHours, - schemaId: cleanedData.schemaId, - sourceRegistryTableId: cleanedData.sourceRegistryTableId, - subscriptionsSchemaId: cleanedData.subscriptionsSchemaId - }, - select: { - apiName: true, - changeLogTableId: true, - databaseId: true, - id: true, - interval: true, - listenerNodeTableId: true, - notifyChannel: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - retentionHours: true, - schemaId: true, - sourceRegistryTableId: true, - subscriptionsSchemaId: true - } - }).execute(); + const result = await client.realtimeModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + changeLogTableId: cleanedData.changeLogTableId, + databaseId: cleanedData.databaseId, + interval: cleanedData.interval, + listenerNodeTableId: cleanedData.listenerNodeTableId, + notifyChannel: cleanedData.notifyChannel, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + retentionHours: cleanedData.retentionHours, + schemaId: cleanedData.schemaId, + sourceRegistryTableId: cleanedData.sourceRegistryTableId, + subscriptionsSchemaId: cleanedData.subscriptionsSchemaId, + }, + select: { + apiName: true, + changeLogTableId: true, + databaseId: true, + id: true, + interval: true, + listenerNodeTableId: true, + notifyChannel: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + retentionHours: true, + schemaId: true, + sourceRegistryTableId: true, + subscriptionsSchemaId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -426,28 +484,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.realtimeModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.realtimeModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/relation-provision.ts b/sdk/constructive-cli/src/modules/cli/commands/relation-provision.ts index 7797e87e62..ce3d567c33 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/relation-provision.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/relation-provision.ts @@ -3,72 +3,86 @@ * @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 { CreateRelationProvisionInput, RelationProvisionPatch, RelationProvisionSelect, RelationProvisionFilter, RelationProvisionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRelationProvisionInput, + RelationProvisionPatch, + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiRequired: "boolean", - createIndex: "boolean", - databaseId: "uuid", - deleteAction: "string", - exposeInApi: "boolean", - fieldName: "string", - grants: "json", - id: "uuid", - isRequired: "boolean", - junctionSchemaId: "uuid", - junctionTableId: "uuid", - junctionTableName: "string", - nodes: "json", - outFieldId: "uuid", - outJunctionTableId: "uuid", - outSourceFieldId: "uuid", - outTargetFieldId: "uuid", - policies: "json", - relationType: "string", - sourceFieldName: "string", - sourceTableId: "uuid", - targetFieldName: "string", - targetTableId: "uuid", - useCompositeKey: "boolean" + apiRequired: 'boolean', + createIndex: 'boolean', + databaseId: 'uuid', + deleteAction: 'string', + exposeInApi: 'boolean', + fieldName: 'string', + grants: 'json', + id: 'uuid', + isRequired: 'boolean', + junctionSchemaId: 'uuid', + junctionTableId: 'uuid', + junctionTableName: 'string', + nodes: 'json', + outFieldId: 'uuid', + outJunctionTableId: 'uuid', + outSourceFieldId: 'uuid', + outTargetFieldId: 'uuid', + policies: 'json', + relationType: 'string', + sourceFieldName: 'string', + sourceTableId: 'uuid', + targetFieldName: 'string', + targetTableId: 'uuid', + useCompositeKey: 'boolean', }; -const usage = "\nrelation-provision \n\nCommands:\n list List relationProvision records\n find-first Find first matching relationProvision record\n get Get a relationProvision by ID\n create Create a new relationProvision\n update Update an existing relationProvision\n delete Delete a relationProvision\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) => { +const usage = + '\nrelation-provision \n\nCommands:\n list List relationProvision records\n find-first Find first matching relationProvision record\n get Get a relationProvision by ID\n create Create a new relationProvision\n update Update an existing relationProvision\n delete Delete a relationProvision\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -101,16 +115,18 @@ async function handleList(argv: Partial>, _prompter: Inq sourceTableId: true, targetFieldName: true, targetTableId: true, - useCompositeKey: true + useCompositeKey: true, }; - const findManyArgs = parseFindManyArgs & { - select: RelationProvisionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RelationProvisionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.relationProvision.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -143,16 +159,18 @@ async function handleFindFirst(argv: Partial>, _prompter sourceTableId: true, targetFieldName: true, targetTableId: true, - useCompositeKey: true + useCompositeKey: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RelationProvisionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RelationProvisionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.relationProvision.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -161,45 +179,49 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.relationProvision.findOne({ - id: answers.id as string, - select: { - apiRequired: true, - createIndex: true, - databaseId: true, - deleteAction: true, - exposeInApi: true, - fieldName: true, - grants: true, - id: true, - isRequired: true, - junctionSchemaId: true, - junctionTableId: true, - junctionTableName: true, - nodes: true, - outFieldId: true, - outJunctionTableId: true, - outSourceFieldId: true, - outTargetFieldId: true, - policies: true, - relationType: true, - sourceFieldName: true, - sourceTableId: true, - targetFieldName: true, - targetTableId: true, - useCompositeKey: true - } - }).execute(); + const result = await client.relationProvision + .findOne({ + id: answers.id as string, + select: { + apiRequired: true, + createIndex: true, + databaseId: true, + deleteAction: true, + exposeInApi: true, + fieldName: true, + grants: true, + id: true, + isRequired: true, + junctionSchemaId: true, + junctionTableId: true, + junctionTableName: true, + nodes: true, + outFieldId: true, + outJunctionTableId: true, + outSourceFieldId: true, + outTargetFieldId: true, + policies: true, + relationType: true, + sourceFieldName: true, + sourceTableId: true, + targetFieldName: true, + targetTableId: true, + useCompositeKey: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -208,200 +230,229 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "boolean", - name: "apiRequired", - message: "apiRequired", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "createIndex", - message: "createIndex", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "deleteAction", - message: "deleteAction", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "exposeInApi", - message: "exposeInApi", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldName", - message: "fieldName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "grants", - message: "grants", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isRequired", - message: "isRequired", - required: false, - skipPrompt: true - }, { - type: "text", - name: "junctionSchemaId", - message: "junctionSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "junctionTableId", - message: "junctionTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "junctionTableName", - message: "junctionTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "nodes", - message: "nodes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outFieldId", - message: "outFieldId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outJunctionTableId", - message: "outJunctionTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outSourceFieldId", - message: "outSourceFieldId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outTargetFieldId", - message: "outTargetFieldId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "relationType", - message: "relationType", - required: true - }, { - type: "text", - name: "sourceFieldName", - message: "sourceFieldName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sourceTableId", - message: "sourceTableId", - required: true - }, { - type: "text", - name: "targetFieldName", - message: "targetFieldName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetTableId", - message: "targetTableId", - required: true - }, { - type: "boolean", - name: "useCompositeKey", - message: "useCompositeKey", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'boolean', + name: 'apiRequired', + message: 'apiRequired', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'createIndex', + message: 'createIndex', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'deleteAction', + message: 'deleteAction', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'exposeInApi', + message: 'exposeInApi', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldName', + message: 'fieldName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'grants', + message: 'grants', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isRequired', + message: 'isRequired', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'junctionSchemaId', + message: 'junctionSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'junctionTableId', + message: 'junctionTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'junctionTableName', + message: 'junctionTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'nodes', + message: 'nodes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outFieldId', + message: 'outFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outJunctionTableId', + message: 'outJunctionTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outSourceFieldId', + message: 'outSourceFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outTargetFieldId', + message: 'outTargetFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'relationType', + message: 'relationType', + required: true, + }, + { + type: 'text', + name: 'sourceFieldName', + message: 'sourceFieldName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sourceTableId', + message: 'sourceTableId', + required: true, + }, + { + type: 'text', + name: 'targetFieldName', + message: 'targetFieldName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetTableId', + message: 'targetTableId', + required: true, + }, + { + type: 'boolean', + name: 'useCompositeKey', + message: 'useCompositeKey', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRelationProvisionInput["relationProvision"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateRelationProvisionInput['relationProvision']; const client = getClient(); - const result = await client.relationProvision.create({ - data: { - apiRequired: cleanedData.apiRequired, - createIndex: cleanedData.createIndex, - databaseId: cleanedData.databaseId, - deleteAction: cleanedData.deleteAction, - exposeInApi: cleanedData.exposeInApi, - fieldName: cleanedData.fieldName, - grants: cleanedData.grants, - isRequired: cleanedData.isRequired, - junctionSchemaId: cleanedData.junctionSchemaId, - junctionTableId: cleanedData.junctionTableId, - junctionTableName: cleanedData.junctionTableName, - nodes: cleanedData.nodes, - outFieldId: cleanedData.outFieldId, - outJunctionTableId: cleanedData.outJunctionTableId, - outSourceFieldId: cleanedData.outSourceFieldId, - outTargetFieldId: cleanedData.outTargetFieldId, - policies: cleanedData.policies, - relationType: cleanedData.relationType, - sourceFieldName: cleanedData.sourceFieldName, - sourceTableId: cleanedData.sourceTableId, - targetFieldName: cleanedData.targetFieldName, - targetTableId: cleanedData.targetTableId, - useCompositeKey: cleanedData.useCompositeKey - }, - select: { - apiRequired: true, - createIndex: true, - databaseId: true, - deleteAction: true, - exposeInApi: true, - fieldName: true, - grants: true, - id: true, - isRequired: true, - junctionSchemaId: true, - junctionTableId: true, - junctionTableName: true, - nodes: true, - outFieldId: true, - outJunctionTableId: true, - outSourceFieldId: true, - outTargetFieldId: true, - policies: true, - relationType: true, - sourceFieldName: true, - sourceTableId: true, - targetFieldName: true, - targetTableId: true, - useCompositeKey: true - } - }).execute(); + const result = await client.relationProvision + .create({ + data: { + apiRequired: cleanedData.apiRequired, + createIndex: cleanedData.createIndex, + databaseId: cleanedData.databaseId, + deleteAction: cleanedData.deleteAction, + exposeInApi: cleanedData.exposeInApi, + fieldName: cleanedData.fieldName, + grants: cleanedData.grants, + isRequired: cleanedData.isRequired, + junctionSchemaId: cleanedData.junctionSchemaId, + junctionTableId: cleanedData.junctionTableId, + junctionTableName: cleanedData.junctionTableName, + nodes: cleanedData.nodes, + outFieldId: cleanedData.outFieldId, + outJunctionTableId: cleanedData.outJunctionTableId, + outSourceFieldId: cleanedData.outSourceFieldId, + outTargetFieldId: cleanedData.outTargetFieldId, + policies: cleanedData.policies, + relationType: cleanedData.relationType, + sourceFieldName: cleanedData.sourceFieldName, + sourceTableId: cleanedData.sourceTableId, + targetFieldName: cleanedData.targetFieldName, + targetTableId: cleanedData.targetTableId, + useCompositeKey: cleanedData.useCompositeKey, + }, + select: { + apiRequired: true, + createIndex: true, + databaseId: true, + deleteAction: true, + exposeInApi: true, + fieldName: true, + grants: true, + id: true, + isRequired: true, + junctionSchemaId: true, + junctionTableId: true, + junctionTableName: true, + nodes: true, + outFieldId: true, + outJunctionTableId: true, + outSourceFieldId: true, + outTargetFieldId: true, + policies: true, + relationType: true, + sourceFieldName: true, + sourceTableId: true, + targetFieldName: true, + targetTableId: true, + useCompositeKey: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -410,208 +461,235 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "boolean", - name: "apiRequired", - message: "apiRequired", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "createIndex", - message: "createIndex", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "deleteAction", - message: "deleteAction", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "exposeInApi", - message: "exposeInApi", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fieldName", - message: "fieldName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "grants", - message: "grants", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "isRequired", - message: "isRequired", - required: false, - skipPrompt: true - }, { - type: "text", - name: "junctionSchemaId", - message: "junctionSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "junctionTableId", - message: "junctionTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "junctionTableName", - message: "junctionTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "nodes", - message: "nodes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outFieldId", - message: "outFieldId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outJunctionTableId", - message: "outJunctionTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outSourceFieldId", - message: "outSourceFieldId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outTargetFieldId", - message: "outTargetFieldId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "relationType", - message: "relationType", - required: false - }, { - type: "text", - name: "sourceFieldName", - message: "sourceFieldName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sourceTableId", - message: "sourceTableId", - required: false - }, { - type: "text", - name: "targetFieldName", - message: "targetFieldName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "targetTableId", - message: "targetTableId", - required: false - }, { - type: "boolean", - name: "useCompositeKey", - message: "useCompositeKey", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'boolean', + name: 'apiRequired', + message: 'apiRequired', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'createIndex', + message: 'createIndex', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'deleteAction', + message: 'deleteAction', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'exposeInApi', + message: 'exposeInApi', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fieldName', + message: 'fieldName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'grants', + message: 'grants', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isRequired', + message: 'isRequired', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'junctionSchemaId', + message: 'junctionSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'junctionTableId', + message: 'junctionTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'junctionTableName', + message: 'junctionTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'nodes', + message: 'nodes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outFieldId', + message: 'outFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outJunctionTableId', + message: 'outJunctionTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outSourceFieldId', + message: 'outSourceFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outTargetFieldId', + message: 'outTargetFieldId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'relationType', + message: 'relationType', + required: false, + }, + { + type: 'text', + name: 'sourceFieldName', + message: 'sourceFieldName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sourceTableId', + message: 'sourceTableId', + required: false, + }, + { + type: 'text', + name: 'targetFieldName', + message: 'targetFieldName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'targetTableId', + message: 'targetTableId', + required: false, + }, + { + type: 'boolean', + name: 'useCompositeKey', + message: 'useCompositeKey', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RelationProvisionPatch; const client = getClient(); - const result = await client.relationProvision.update({ - where: { - id: answers.id as string - }, - data: { - apiRequired: cleanedData.apiRequired, - createIndex: cleanedData.createIndex, - databaseId: cleanedData.databaseId, - deleteAction: cleanedData.deleteAction, - exposeInApi: cleanedData.exposeInApi, - fieldName: cleanedData.fieldName, - grants: cleanedData.grants, - isRequired: cleanedData.isRequired, - junctionSchemaId: cleanedData.junctionSchemaId, - junctionTableId: cleanedData.junctionTableId, - junctionTableName: cleanedData.junctionTableName, - nodes: cleanedData.nodes, - outFieldId: cleanedData.outFieldId, - outJunctionTableId: cleanedData.outJunctionTableId, - outSourceFieldId: cleanedData.outSourceFieldId, - outTargetFieldId: cleanedData.outTargetFieldId, - policies: cleanedData.policies, - relationType: cleanedData.relationType, - sourceFieldName: cleanedData.sourceFieldName, - sourceTableId: cleanedData.sourceTableId, - targetFieldName: cleanedData.targetFieldName, - targetTableId: cleanedData.targetTableId, - useCompositeKey: cleanedData.useCompositeKey - }, - select: { - apiRequired: true, - createIndex: true, - databaseId: true, - deleteAction: true, - exposeInApi: true, - fieldName: true, - grants: true, - id: true, - isRequired: true, - junctionSchemaId: true, - junctionTableId: true, - junctionTableName: true, - nodes: true, - outFieldId: true, - outJunctionTableId: true, - outSourceFieldId: true, - outTargetFieldId: true, - policies: true, - relationType: true, - sourceFieldName: true, - sourceTableId: true, - targetFieldName: true, - targetTableId: true, - useCompositeKey: true - } - }).execute(); + const result = await client.relationProvision + .update({ + where: { + id: answers.id as string, + }, + data: { + apiRequired: cleanedData.apiRequired, + createIndex: cleanedData.createIndex, + databaseId: cleanedData.databaseId, + deleteAction: cleanedData.deleteAction, + exposeInApi: cleanedData.exposeInApi, + fieldName: cleanedData.fieldName, + grants: cleanedData.grants, + isRequired: cleanedData.isRequired, + junctionSchemaId: cleanedData.junctionSchemaId, + junctionTableId: cleanedData.junctionTableId, + junctionTableName: cleanedData.junctionTableName, + nodes: cleanedData.nodes, + outFieldId: cleanedData.outFieldId, + outJunctionTableId: cleanedData.outJunctionTableId, + outSourceFieldId: cleanedData.outSourceFieldId, + outTargetFieldId: cleanedData.outTargetFieldId, + policies: cleanedData.policies, + relationType: cleanedData.relationType, + sourceFieldName: cleanedData.sourceFieldName, + sourceTableId: cleanedData.sourceTableId, + targetFieldName: cleanedData.targetFieldName, + targetTableId: cleanedData.targetTableId, + useCompositeKey: cleanedData.useCompositeKey, + }, + select: { + apiRequired: true, + createIndex: true, + databaseId: true, + deleteAction: true, + exposeInApi: true, + fieldName: true, + grants: true, + id: true, + isRequired: true, + junctionSchemaId: true, + junctionTableId: true, + junctionTableName: true, + nodes: true, + outFieldId: true, + outJunctionTableId: true, + outSourceFieldId: true, + outTargetFieldId: true, + policies: true, + relationType: true, + sourceFieldName: true, + sourceTableId: true, + targetFieldName: true, + targetTableId: true, + useCompositeKey: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -620,28 +698,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.relationProvision.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.relationProvision + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/resolve-blueprint-field.ts b/sdk/constructive-cli/src/modules/cli/commands/resolve-blueprint-field.ts index 5ee8a22781..020df9055a 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/resolve-blueprint-field.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/resolve-blueprint-field.ts @@ -3,36 +3,48 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { ResolveBlueprintFieldVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { ResolveBlueprintFieldVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: resolve-blueprint-field [OPTIONS]\n"); + console.log( + '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\nUsage: resolve-blueprint-field [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId" - }, { - type: "text", - name: "fieldName", - message: "fieldName" - }, { - type: "text", - name: "tableId", - message: "tableId" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + }, + { + type: 'text', + name: 'fieldName', + message: 'fieldName', + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + }, + ]); const client = getClient(); - const result = await client.query.resolveBlueprintField(answers as unknown as ResolveBlueprintFieldVariables).execute(); + const result = await client.query + .resolveBlueprintField(answers as unknown as ResolveBlueprintFieldVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resolveBlueprintField"); + console.error('Failed: resolveBlueprintField'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/resolve-blueprint-table.ts b/sdk/constructive-cli/src/modules/cli/commands/resolve-blueprint-table.ts index 6a3b1b0a8e..8dbd6f1b8b 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/resolve-blueprint-table.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/resolve-blueprint-table.ts @@ -3,44 +3,58 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import type { ResolveBlueprintTableVariables } from "../../orm/query"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { ResolveBlueprintTableVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("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\nUsage: resolve-blueprint-table [OPTIONS]\n"); + console.log( + '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\nUsage: resolve-blueprint-table [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId" - }, { - type: "text", - name: "defaultSchemaId", - message: "defaultSchemaId" - }, { - type: "text", - name: "schemaName", - message: "schemaName" - }, { - type: "text", - name: "tableMap", - message: "tableMap" - }, { - type: "text", - name: "tableName", - message: "tableName" - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + }, + { + type: 'text', + name: 'defaultSchemaId', + message: 'defaultSchemaId', + }, + { + type: 'text', + name: 'schemaName', + message: 'schemaName', + }, + { + type: 'text', + name: 'tableMap', + message: 'tableMap', + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + }, + ]); const client = getClient(); - const result = await client.query.resolveBlueprintTable(answers as unknown as ResolveBlueprintTableVariables).execute(); + const result = await client.query + .resolveBlueprintTable(answers as unknown as ResolveBlueprintTableVariables) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: resolveBlueprintTable"); + console.error('Failed: resolveBlueprintTable'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/cli/commands/resource-module.ts b/sdk/constructive-cli/src/modules/cli/commands/resource-module.ts index 8031469b1a..5cf3108495 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/resource-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/resource-module.ts @@ -3,84 +3,98 @@ * @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 { CreateResourceModuleInput, ResourceModulePatch, ResourceModuleSelect, ResourceModuleFilter, ResourceModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateResourceModuleInput, + ResourceModulePatch, + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - installationStoreName: "string", - merkleStoreModuleId: "uuid", - namespaceModuleId: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - requirementsStateViewName: "string", - resolvedRequirementsViewName: "string", - resourceBillingRollupFunction: "string", - resourceDefinitionsTableId: "uuid", - resourceDefinitionsTableName: "string", - resourceEventsTableId: "uuid", - resourceEventsTableName: "string", - resourceInstallationsTableId: "uuid", - resourceInstallationsTableName: "string", - resourceStatusChecksTableId: "uuid", - resourceStatusChecksTableName: "string", - resourceUsageLogTableId: "uuid", - resourceUsageLogTableName: "string", - resourceUsageSummaryTableId: "uuid", - resourceUsageSummaryTableName: "string", - resourcesTableId: "uuid", - resourcesTableName: "string", - rollupResourceUsageSummaryFunction: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + installationStoreName: 'string', + merkleStoreModuleId: 'uuid', + namespaceModuleId: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + requirementsStateViewName: 'string', + resolvedRequirementsViewName: 'string', + resourceBillingRollupFunction: 'string', + resourceDefinitionsTableId: 'uuid', + resourceDefinitionsTableName: 'string', + resourceEventsTableId: 'uuid', + resourceEventsTableName: 'string', + resourceInstallationsTableId: 'uuid', + resourceInstallationsTableName: 'string', + resourceStatusChecksTableId: 'uuid', + resourceStatusChecksTableName: 'string', + resourceUsageLogTableId: 'uuid', + resourceUsageLogTableName: 'string', + resourceUsageSummaryTableId: 'uuid', + resourceUsageSummaryTableName: 'string', + resourcesTableId: 'uuid', + resourcesTableName: 'string', + rollupResourceUsageSummaryFunction: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\nresource-module \n\nCommands:\n list List resourceModule records\n find-first Find first matching resourceModule record\n get Get a resourceModule by ID\n create Create a new resourceModule\n update Update an existing resourceModule\n delete Delete a resourceModule\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) => { +const usage = + '\nresource-module \n\nCommands:\n list List resourceModule records\n find-first Find first matching resourceModule record\n get Get a resourceModule by ID\n create Create a new resourceModule\n update Update an existing resourceModule\n delete Delete a resourceModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -125,16 +139,18 @@ async function handleList(argv: Partial>, _prompter: Inq resourcesTableName: true, rollupResourceUsageSummaryFunction: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: ResourceModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ResourceModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -179,16 +195,18 @@ async function handleFindFirst(argv: Partial>, _prompter resourcesTableName: true, rollupResourceUsageSummaryFunction: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ResourceModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ResourceModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.resourceModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -197,57 +215,61 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.resourceModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - installationStoreName: true, - merkleStoreModuleId: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - requirementsStateViewName: true, - resolvedRequirementsViewName: true, - resourceBillingRollupFunction: true, - resourceDefinitionsTableId: true, - resourceDefinitionsTableName: true, - resourceEventsTableId: true, - resourceEventsTableName: true, - resourceInstallationsTableId: true, - resourceInstallationsTableName: true, - resourceStatusChecksTableId: true, - resourceStatusChecksTableName: true, - resourceUsageLogTableId: true, - resourceUsageLogTableName: true, - resourceUsageSummaryTableId: true, - resourceUsageSummaryTableName: true, - resourcesTableId: true, - resourcesTableName: true, - rollupResourceUsageSummaryFunction: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.resourceModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + installationStoreName: true, + merkleStoreModuleId: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + requirementsStateViewName: true, + resolvedRequirementsViewName: true, + resourceBillingRollupFunction: true, + resourceDefinitionsTableId: true, + resourceDefinitionsTableName: true, + resourceEventsTableId: true, + resourceEventsTableName: true, + resourceInstallationsTableId: true, + resourceInstallationsTableName: true, + resourceStatusChecksTableId: true, + resourceStatusChecksTableName: true, + resourceUsageLogTableId: true, + resourceUsageLogTableName: true, + resourceUsageSummaryTableId: true, + resourceUsageSummaryTableName: true, + resourcesTableId: true, + resourcesTableName: true, + rollupResourceUsageSummaryFunction: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -256,298 +278,339 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "installationStoreName", - message: "installationStoreName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "merkleStoreModuleId", - message: "merkleStoreModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceModuleId", - message: "namespaceModuleId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requirementsStateViewName", - message: "requirementsStateViewName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resolvedRequirementsViewName", - message: "resolvedRequirementsViewName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceBillingRollupFunction", - message: "resourceBillingRollupFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionsTableId", - message: "resourceDefinitionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionsTableName", - message: "resourceDefinitionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceEventsTableId", - message: "resourceEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceEventsTableName", - message: "resourceEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceInstallationsTableId", - message: "resourceInstallationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceInstallationsTableName", - message: "resourceInstallationsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceStatusChecksTableId", - message: "resourceStatusChecksTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceStatusChecksTableName", - message: "resourceStatusChecksTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceUsageLogTableId", - message: "resourceUsageLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceUsageLogTableName", - message: "resourceUsageLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceUsageSummaryTableId", - message: "resourceUsageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceUsageSummaryTableName", - message: "resourceUsageSummaryTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourcesTableId", - message: "resourcesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourcesTableName", - message: "resourcesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rollupResourceUsageSummaryFunction", - message: "rollupResourceUsageSummaryFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'installationStoreName', + message: 'installationStoreName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'merkleStoreModuleId', + message: 'merkleStoreModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceModuleId', + message: 'namespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requirementsStateViewName', + message: 'requirementsStateViewName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resolvedRequirementsViewName', + message: 'resolvedRequirementsViewName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceBillingRollupFunction', + message: 'resourceBillingRollupFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionsTableId', + message: 'resourceDefinitionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionsTableName', + message: 'resourceDefinitionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceEventsTableId', + message: 'resourceEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceEventsTableName', + message: 'resourceEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceInstallationsTableId', + message: 'resourceInstallationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceInstallationsTableName', + message: 'resourceInstallationsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceStatusChecksTableId', + message: 'resourceStatusChecksTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceStatusChecksTableName', + message: 'resourceStatusChecksTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceUsageLogTableId', + message: 'resourceUsageLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceUsageLogTableName', + message: 'resourceUsageLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceUsageSummaryTableId', + message: 'resourceUsageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceUsageSummaryTableName', + message: 'resourceUsageSummaryTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourcesTableId', + message: 'resourcesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourcesTableName', + message: 'resourcesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rollupResourceUsageSummaryFunction', + message: 'rollupResourceUsageSummaryFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateResourceModuleInput["resourceModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateResourceModuleInput['resourceModule']; const client = getClient(); - const result = await client.resourceModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - installationStoreName: cleanedData.installationStoreName, - merkleStoreModuleId: cleanedData.merkleStoreModuleId, - namespaceModuleId: cleanedData.namespaceModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - requirementsStateViewName: cleanedData.requirementsStateViewName, - resolvedRequirementsViewName: cleanedData.resolvedRequirementsViewName, - resourceBillingRollupFunction: cleanedData.resourceBillingRollupFunction, - resourceDefinitionsTableId: cleanedData.resourceDefinitionsTableId, - resourceDefinitionsTableName: cleanedData.resourceDefinitionsTableName, - resourceEventsTableId: cleanedData.resourceEventsTableId, - resourceEventsTableName: cleanedData.resourceEventsTableName, - resourceInstallationsTableId: cleanedData.resourceInstallationsTableId, - resourceInstallationsTableName: cleanedData.resourceInstallationsTableName, - resourceStatusChecksTableId: cleanedData.resourceStatusChecksTableId, - resourceStatusChecksTableName: cleanedData.resourceStatusChecksTableName, - resourceUsageLogTableId: cleanedData.resourceUsageLogTableId, - resourceUsageLogTableName: cleanedData.resourceUsageLogTableName, - resourceUsageSummaryTableId: cleanedData.resourceUsageSummaryTableId, - resourceUsageSummaryTableName: cleanedData.resourceUsageSummaryTableName, - resourcesTableId: cleanedData.resourcesTableId, - resourcesTableName: cleanedData.resourcesTableName, - rollupResourceUsageSummaryFunction: cleanedData.rollupResourceUsageSummaryFunction, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - installationStoreName: true, - merkleStoreModuleId: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - requirementsStateViewName: true, - resolvedRequirementsViewName: true, - resourceBillingRollupFunction: true, - resourceDefinitionsTableId: true, - resourceDefinitionsTableName: true, - resourceEventsTableId: true, - resourceEventsTableName: true, - resourceInstallationsTableId: true, - resourceInstallationsTableName: true, - resourceStatusChecksTableId: true, - resourceStatusChecksTableName: true, - resourceUsageLogTableId: true, - resourceUsageLogTableName: true, - resourceUsageSummaryTableId: true, - resourceUsageSummaryTableName: true, - resourcesTableId: true, - resourcesTableName: true, - rollupResourceUsageSummaryFunction: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.resourceModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + installationStoreName: cleanedData.installationStoreName, + merkleStoreModuleId: cleanedData.merkleStoreModuleId, + namespaceModuleId: cleanedData.namespaceModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + requirementsStateViewName: cleanedData.requirementsStateViewName, + resolvedRequirementsViewName: cleanedData.resolvedRequirementsViewName, + resourceBillingRollupFunction: cleanedData.resourceBillingRollupFunction, + resourceDefinitionsTableId: cleanedData.resourceDefinitionsTableId, + resourceDefinitionsTableName: cleanedData.resourceDefinitionsTableName, + resourceEventsTableId: cleanedData.resourceEventsTableId, + resourceEventsTableName: cleanedData.resourceEventsTableName, + resourceInstallationsTableId: cleanedData.resourceInstallationsTableId, + resourceInstallationsTableName: cleanedData.resourceInstallationsTableName, + resourceStatusChecksTableId: cleanedData.resourceStatusChecksTableId, + resourceStatusChecksTableName: cleanedData.resourceStatusChecksTableName, + resourceUsageLogTableId: cleanedData.resourceUsageLogTableId, + resourceUsageLogTableName: cleanedData.resourceUsageLogTableName, + resourceUsageSummaryTableId: cleanedData.resourceUsageSummaryTableId, + resourceUsageSummaryTableName: cleanedData.resourceUsageSummaryTableName, + resourcesTableId: cleanedData.resourcesTableId, + resourcesTableName: cleanedData.resourcesTableName, + rollupResourceUsageSummaryFunction: cleanedData.rollupResourceUsageSummaryFunction, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + installationStoreName: true, + merkleStoreModuleId: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + requirementsStateViewName: true, + resolvedRequirementsViewName: true, + resourceBillingRollupFunction: true, + resourceDefinitionsTableId: true, + resourceDefinitionsTableName: true, + resourceEventsTableId: true, + resourceEventsTableName: true, + resourceInstallationsTableId: true, + resourceInstallationsTableName: true, + resourceStatusChecksTableId: true, + resourceStatusChecksTableName: true, + resourceUsageLogTableId: true, + resourceUsageLogTableName: true, + resourceUsageSummaryTableId: true, + resourceUsageSummaryTableName: true, + resourcesTableId: true, + resourcesTableName: true, + rollupResourceUsageSummaryFunction: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -556,306 +619,345 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "installationStoreName", - message: "installationStoreName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "merkleStoreModuleId", - message: "merkleStoreModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceModuleId", - message: "namespaceModuleId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requirementsStateViewName", - message: "requirementsStateViewName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resolvedRequirementsViewName", - message: "resolvedRequirementsViewName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceBillingRollupFunction", - message: "resourceBillingRollupFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionsTableId", - message: "resourceDefinitionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceDefinitionsTableName", - message: "resourceDefinitionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceEventsTableId", - message: "resourceEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceEventsTableName", - message: "resourceEventsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceInstallationsTableId", - message: "resourceInstallationsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceInstallationsTableName", - message: "resourceInstallationsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceStatusChecksTableId", - message: "resourceStatusChecksTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceStatusChecksTableName", - message: "resourceStatusChecksTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceUsageLogTableId", - message: "resourceUsageLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceUsageLogTableName", - message: "resourceUsageLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceUsageSummaryTableId", - message: "resourceUsageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourceUsageSummaryTableName", - message: "resourceUsageSummaryTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourcesTableId", - message: "resourcesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resourcesTableName", - message: "resourcesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rollupResourceUsageSummaryFunction", - message: "rollupResourceUsageSummaryFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'installationStoreName', + message: 'installationStoreName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'merkleStoreModuleId', + message: 'merkleStoreModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceModuleId', + message: 'namespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requirementsStateViewName', + message: 'requirementsStateViewName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resolvedRequirementsViewName', + message: 'resolvedRequirementsViewName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceBillingRollupFunction', + message: 'resourceBillingRollupFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionsTableId', + message: 'resourceDefinitionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceDefinitionsTableName', + message: 'resourceDefinitionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceEventsTableId', + message: 'resourceEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceEventsTableName', + message: 'resourceEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceInstallationsTableId', + message: 'resourceInstallationsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceInstallationsTableName', + message: 'resourceInstallationsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceStatusChecksTableId', + message: 'resourceStatusChecksTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceStatusChecksTableName', + message: 'resourceStatusChecksTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceUsageLogTableId', + message: 'resourceUsageLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceUsageLogTableName', + message: 'resourceUsageLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceUsageSummaryTableId', + message: 'resourceUsageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourceUsageSummaryTableName', + message: 'resourceUsageSummaryTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourcesTableId', + message: 'resourcesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resourcesTableName', + message: 'resourcesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rollupResourceUsageSummaryFunction', + message: 'rollupResourceUsageSummaryFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ResourceModulePatch; const client = getClient(); - const result = await client.resourceModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - installationStoreName: cleanedData.installationStoreName, - merkleStoreModuleId: cleanedData.merkleStoreModuleId, - namespaceModuleId: cleanedData.namespaceModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - requirementsStateViewName: cleanedData.requirementsStateViewName, - resolvedRequirementsViewName: cleanedData.resolvedRequirementsViewName, - resourceBillingRollupFunction: cleanedData.resourceBillingRollupFunction, - resourceDefinitionsTableId: cleanedData.resourceDefinitionsTableId, - resourceDefinitionsTableName: cleanedData.resourceDefinitionsTableName, - resourceEventsTableId: cleanedData.resourceEventsTableId, - resourceEventsTableName: cleanedData.resourceEventsTableName, - resourceInstallationsTableId: cleanedData.resourceInstallationsTableId, - resourceInstallationsTableName: cleanedData.resourceInstallationsTableName, - resourceStatusChecksTableId: cleanedData.resourceStatusChecksTableId, - resourceStatusChecksTableName: cleanedData.resourceStatusChecksTableName, - resourceUsageLogTableId: cleanedData.resourceUsageLogTableId, - resourceUsageLogTableName: cleanedData.resourceUsageLogTableName, - resourceUsageSummaryTableId: cleanedData.resourceUsageSummaryTableId, - resourceUsageSummaryTableName: cleanedData.resourceUsageSummaryTableName, - resourcesTableId: cleanedData.resourcesTableId, - resourcesTableName: cleanedData.resourcesTableName, - rollupResourceUsageSummaryFunction: cleanedData.rollupResourceUsageSummaryFunction, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - installationStoreName: true, - merkleStoreModuleId: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - requirementsStateViewName: true, - resolvedRequirementsViewName: true, - resourceBillingRollupFunction: true, - resourceDefinitionsTableId: true, - resourceDefinitionsTableName: true, - resourceEventsTableId: true, - resourceEventsTableName: true, - resourceInstallationsTableId: true, - resourceInstallationsTableName: true, - resourceStatusChecksTableId: true, - resourceStatusChecksTableName: true, - resourceUsageLogTableId: true, - resourceUsageLogTableName: true, - resourceUsageSummaryTableId: true, - resourceUsageSummaryTableName: true, - resourcesTableId: true, - resourcesTableName: true, - rollupResourceUsageSummaryFunction: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.resourceModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + installationStoreName: cleanedData.installationStoreName, + merkleStoreModuleId: cleanedData.merkleStoreModuleId, + namespaceModuleId: cleanedData.namespaceModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + requirementsStateViewName: cleanedData.requirementsStateViewName, + resolvedRequirementsViewName: cleanedData.resolvedRequirementsViewName, + resourceBillingRollupFunction: cleanedData.resourceBillingRollupFunction, + resourceDefinitionsTableId: cleanedData.resourceDefinitionsTableId, + resourceDefinitionsTableName: cleanedData.resourceDefinitionsTableName, + resourceEventsTableId: cleanedData.resourceEventsTableId, + resourceEventsTableName: cleanedData.resourceEventsTableName, + resourceInstallationsTableId: cleanedData.resourceInstallationsTableId, + resourceInstallationsTableName: cleanedData.resourceInstallationsTableName, + resourceStatusChecksTableId: cleanedData.resourceStatusChecksTableId, + resourceStatusChecksTableName: cleanedData.resourceStatusChecksTableName, + resourceUsageLogTableId: cleanedData.resourceUsageLogTableId, + resourceUsageLogTableName: cleanedData.resourceUsageLogTableName, + resourceUsageSummaryTableId: cleanedData.resourceUsageSummaryTableId, + resourceUsageSummaryTableName: cleanedData.resourceUsageSummaryTableName, + resourcesTableId: cleanedData.resourcesTableId, + resourcesTableName: cleanedData.resourcesTableName, + rollupResourceUsageSummaryFunction: cleanedData.rollupResourceUsageSummaryFunction, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + installationStoreName: true, + merkleStoreModuleId: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + requirementsStateViewName: true, + resolvedRequirementsViewName: true, + resourceBillingRollupFunction: true, + resourceDefinitionsTableId: true, + resourceDefinitionsTableName: true, + resourceEventsTableId: true, + resourceEventsTableName: true, + resourceInstallationsTableId: true, + resourceInstallationsTableName: true, + resourceStatusChecksTableId: true, + resourceStatusChecksTableName: true, + resourceUsageLogTableId: true, + resourceUsageLogTableName: true, + resourceUsageSummaryTableId: true, + resourceUsageSummaryTableName: true, + resourcesTableId: true, + resourcesTableName: true, + rollupResourceUsageSummaryFunction: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -864,28 +966,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.resourceModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.resourceModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/rls-module.ts b/sdk/constructive-cli/src/modules/cli/commands/rls-module.ts index f6c03e99aa..08433e24b1 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/rls-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/rls-module.ts @@ -3,61 +3,75 @@ * @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 { CreateRlsModuleInput, RlsModulePatch, RlsModuleSelect, RlsModuleFilter, RlsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRlsModuleInput, + RlsModulePatch, + RlsModuleSelect, + RlsModuleFilter, + RlsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - authenticate: "string", - authenticateStrict: "string", - currentRole: "string", - currentRoleId: "string", - databaseId: "uuid", - id: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - schemaId: "uuid", - sessionCredentialsTableId: "uuid", - sessionsTableId: "uuid", - usersTableId: "uuid" + apiName: 'string', + authenticate: 'string', + authenticateStrict: 'string', + currentRole: 'string', + currentRoleId: 'string', + databaseId: 'uuid', + id: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + schemaId: 'uuid', + sessionCredentialsTableId: 'uuid', + sessionsTableId: 'uuid', + usersTableId: 'uuid', }; -const usage = "\nrls-module \n\nCommands:\n list List rlsModule records\n find-first Find first matching rlsModule record\n get Get a rlsModule by ID\n create Create a new rlsModule\n update Update an existing rlsModule\n delete Delete a rlsModule\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) => { +const usage = + '\nrls-module \n\nCommands:\n list List rlsModule records\n find-first Find first matching rlsModule record\n get Get a rlsModule by ID\n create Create a new rlsModule\n update Update an existing rlsModule\n delete Delete a rlsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, sessionCredentialsTableId: true, sessionsTableId: true, - usersTableId: true + usersTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: RlsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RlsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.rlsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, sessionCredentialsTableId: true, sessionsTableId: true, - usersTableId: true + usersTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RlsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RlsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.rlsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.rlsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - authenticate: true, - authenticateStrict: true, - currentRole: true, - currentRoleId: true, - databaseId: true, - id: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.rlsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + authenticate: true, + authenticateStrict: true, + currentRole: true, + currentRoleId: true, + databaseId: true, + id: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,115 +186,130 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authenticate", - message: "authenticate", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authenticateStrict", - message: "authenticateStrict", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentRole", - message: "currentRole", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentRoleId", - message: "currentRoleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authenticate', + message: 'authenticate', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authenticateStrict', + message: 'authenticateStrict', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentRole', + message: 'currentRole', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentRoleId', + message: 'currentRoleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRlsModuleInput["rlsModule"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateRlsModuleInput['rlsModule']; const client = getClient(); - const result = await client.rlsModule.create({ - data: { - apiName: cleanedData.apiName, - authenticate: cleanedData.authenticate, - authenticateStrict: cleanedData.authenticateStrict, - currentRole: cleanedData.currentRole, - currentRoleId: cleanedData.currentRoleId, - databaseId: cleanedData.databaseId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionsTableId: cleanedData.sessionsTableId, - usersTableId: cleanedData.usersTableId - }, - select: { - apiName: true, - authenticate: true, - authenticateStrict: true, - currentRole: true, - currentRoleId: true, - databaseId: true, - id: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.rlsModule + .create({ + data: { + apiName: cleanedData.apiName, + authenticate: cleanedData.authenticate, + authenticateStrict: cleanedData.authenticateStrict, + currentRole: cleanedData.currentRole, + currentRoleId: cleanedData.currentRoleId, + databaseId: cleanedData.databaseId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionsTableId: cleanedData.sessionsTableId, + usersTableId: cleanedData.usersTableId, + }, + select: { + apiName: true, + authenticate: true, + authenticateStrict: true, + currentRole: true, + currentRoleId: true, + databaseId: true, + id: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -281,123 +318,139 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authenticate", - message: "authenticate", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authenticateStrict", - message: "authenticateStrict", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentRole", - message: "currentRole", - required: false, - skipPrompt: true - }, { - type: "text", - name: "currentRoleId", - message: "currentRoleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authenticate', + message: 'authenticate', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authenticateStrict', + message: 'authenticateStrict', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentRole', + message: 'currentRole', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentRoleId', + message: 'currentRoleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RlsModulePatch; const client = getClient(); - const result = await client.rlsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - authenticate: cleanedData.authenticate, - authenticateStrict: cleanedData.authenticateStrict, - currentRole: cleanedData.currentRole, - currentRoleId: cleanedData.currentRoleId, - databaseId: cleanedData.databaseId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionsTableId: cleanedData.sessionsTableId, - usersTableId: cleanedData.usersTableId - }, - select: { - apiName: true, - authenticate: true, - authenticateStrict: true, - currentRole: true, - currentRoleId: true, - databaseId: true, - id: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.rlsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + authenticate: cleanedData.authenticate, + authenticateStrict: cleanedData.authenticateStrict, + currentRole: cleanedData.currentRole, + currentRoleId: cleanedData.currentRoleId, + databaseId: cleanedData.databaseId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionsTableId: cleanedData.sessionsTableId, + usersTableId: cleanedData.usersTableId, + }, + select: { + apiName: true, + authenticate: true, + authenticateStrict: true, + currentRole: true, + currentRoleId: true, + databaseId: true, + id: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -406,28 +459,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.rlsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.rlsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/route-module.ts b/sdk/constructive-cli/src/modules/cli/commands/route-module.ts index 35934947a8..695b24b67d 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/route-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/route-module.ts @@ -3,72 +3,86 @@ * @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 { CreateRouteModuleInput, RouteModulePatch, RouteModuleSelect, RouteModuleFilter, RouteModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRouteModuleInput, + RouteModulePatch, + RouteModuleSelect, + RouteModuleFilter, + RouteModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - catalogModuleId: "uuid", - databaseId: "uuid", - defaultPermissions: "string", - domainModuleId: "uuid", - entityField: "string", - entityTableId: "uuid", - hostnameBindingsTableId: "uuid", - hostnameBindingsTableName: "string", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - resolverFunctionName: "string", - routeBindingsTableId: "uuid", - routeBindingsTableName: "string", - routesTableId: "uuid", - routesTableName: "string", - schemaId: "uuid", - scope: "string" + apiName: 'string', + catalogModuleId: 'uuid', + databaseId: 'uuid', + defaultPermissions: 'string', + domainModuleId: 'uuid', + entityField: 'string', + entityTableId: 'uuid', + hostnameBindingsTableId: 'uuid', + hostnameBindingsTableName: 'string', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + resolverFunctionName: 'string', + routeBindingsTableId: 'uuid', + routeBindingsTableName: 'string', + routesTableId: 'uuid', + routesTableName: 'string', + schemaId: 'uuid', + scope: 'string', }; -const usage = "\nroute-module \n\nCommands:\n list List routeModule records\n find-first Find first matching routeModule record\n get Get a routeModule by ID\n create Create a new routeModule\n update Update an existing routeModule\n delete Delete a routeModule\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) => { +const usage = + '\nroute-module \n\nCommands:\n list List routeModule records\n find-first Find first matching routeModule record\n get Get a routeModule by ID\n create Create a new routeModule\n update Update an existing routeModule\n delete Delete a routeModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -101,16 +115,18 @@ async function handleList(argv: Partial>, _prompter: Inq routesTableId: true, routesTableName: true, schemaId: true, - scope: true + scope: true, }; - const findManyArgs = parseFindManyArgs & { - select: RouteModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RouteModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.routeModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -143,16 +159,18 @@ async function handleFindFirst(argv: Partial>, _prompter routesTableId: true, routesTableName: true, schemaId: true, - scope: true + scope: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RouteModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RouteModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.routeModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -161,45 +179,49 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.routeModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - domainModuleId: true, - entityField: true, - entityTableId: true, - hostnameBindingsTableId: true, - hostnameBindingsTableName: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - resolverFunctionName: true, - routeBindingsTableId: true, - routeBindingsTableName: true, - routesTableId: true, - routesTableName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.routeModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + domainModuleId: true, + entityField: true, + entityTableId: true, + hostnameBindingsTableId: true, + hostnameBindingsTableName: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + resolverFunctionName: true, + routeBindingsTableId: true, + routeBindingsTableName: true, + routesTableId: true, + routesTableName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -208,202 +230,231 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainModuleId", - message: "domainModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hostnameBindingsTableId", - message: "hostnameBindingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hostnameBindingsTableName", - message: "hostnameBindingsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resolverFunctionName", - message: "resolverFunctionName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "routeBindingsTableId", - message: "routeBindingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "routeBindingsTableName", - message: "routeBindingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "routesTableId", - message: "routesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "routesTableName", - message: "routesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainModuleId', + message: 'domainModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hostnameBindingsTableId', + message: 'hostnameBindingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hostnameBindingsTableName', + message: 'hostnameBindingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resolverFunctionName', + message: 'resolverFunctionName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'routeBindingsTableId', + message: 'routeBindingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'routeBindingsTableName', + message: 'routeBindingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'routesTableId', + message: 'routesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'routesTableName', + message: 'routesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRouteModuleInput["routeModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateRouteModuleInput['routeModule']; const client = getClient(); - const result = await client.routeModule.create({ - data: { - apiName: cleanedData.apiName, - catalogModuleId: cleanedData.catalogModuleId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - domainModuleId: cleanedData.domainModuleId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - hostnameBindingsTableId: cleanedData.hostnameBindingsTableId, - hostnameBindingsTableName: cleanedData.hostnameBindingsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - resolverFunctionName: cleanedData.resolverFunctionName, - routeBindingsTableId: cleanedData.routeBindingsTableId, - routeBindingsTableName: cleanedData.routeBindingsTableName, - routesTableId: cleanedData.routesTableId, - routesTableName: cleanedData.routesTableName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - domainModuleId: true, - entityField: true, - entityTableId: true, - hostnameBindingsTableId: true, - hostnameBindingsTableName: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - resolverFunctionName: true, - routeBindingsTableId: true, - routeBindingsTableName: true, - routesTableId: true, - routesTableName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.routeModule + .create({ + data: { + apiName: cleanedData.apiName, + catalogModuleId: cleanedData.catalogModuleId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + domainModuleId: cleanedData.domainModuleId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + hostnameBindingsTableId: cleanedData.hostnameBindingsTableId, + hostnameBindingsTableName: cleanedData.hostnameBindingsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + resolverFunctionName: cleanedData.resolverFunctionName, + routeBindingsTableId: cleanedData.routeBindingsTableId, + routeBindingsTableName: cleanedData.routeBindingsTableName, + routesTableId: cleanedData.routesTableId, + routesTableName: cleanedData.routesTableName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + domainModuleId: true, + entityField: true, + entityTableId: true, + hostnameBindingsTableId: true, + hostnameBindingsTableName: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + resolverFunctionName: true, + routeBindingsTableId: true, + routeBindingsTableName: true, + routesTableId: true, + routesTableName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -412,210 +463,237 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "domainModuleId", - message: "domainModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hostnameBindingsTableId", - message: "hostnameBindingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "hostnameBindingsTableName", - message: "hostnameBindingsTableName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resolverFunctionName", - message: "resolverFunctionName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "routeBindingsTableId", - message: "routeBindingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "routeBindingsTableName", - message: "routeBindingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "routesTableId", - message: "routesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "routesTableName", - message: "routesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'domainModuleId', + message: 'domainModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hostnameBindingsTableId', + message: 'hostnameBindingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'hostnameBindingsTableName', + message: 'hostnameBindingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resolverFunctionName', + message: 'resolverFunctionName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'routeBindingsTableId', + message: 'routeBindingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'routeBindingsTableName', + message: 'routeBindingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'routesTableId', + message: 'routesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'routesTableName', + message: 'routesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RouteModulePatch; const client = getClient(); - const result = await client.routeModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - catalogModuleId: cleanedData.catalogModuleId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - domainModuleId: cleanedData.domainModuleId, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - hostnameBindingsTableId: cleanedData.hostnameBindingsTableId, - hostnameBindingsTableName: cleanedData.hostnameBindingsTableName, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - resolverFunctionName: cleanedData.resolverFunctionName, - routeBindingsTableId: cleanedData.routeBindingsTableId, - routeBindingsTableName: cleanedData.routeBindingsTableName, - routesTableId: cleanedData.routesTableId, - routesTableName: cleanedData.routesTableName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope - }, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - domainModuleId: true, - entityField: true, - entityTableId: true, - hostnameBindingsTableId: true, - hostnameBindingsTableName: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - resolverFunctionName: true, - routeBindingsTableId: true, - routeBindingsTableName: true, - routesTableId: true, - routesTableName: true, - schemaId: true, - scope: true - } - }).execute(); + const result = await client.routeModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + catalogModuleId: cleanedData.catalogModuleId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + domainModuleId: cleanedData.domainModuleId, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + hostnameBindingsTableId: cleanedData.hostnameBindingsTableId, + hostnameBindingsTableName: cleanedData.hostnameBindingsTableName, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + resolverFunctionName: cleanedData.resolverFunctionName, + routeBindingsTableId: cleanedData.routeBindingsTableId, + routeBindingsTableName: cleanedData.routeBindingsTableName, + routesTableId: cleanedData.routesTableId, + routesTableName: cleanedData.routesTableName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + }, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + domainModuleId: true, + entityField: true, + entityTableId: true, + hostnameBindingsTableId: true, + hostnameBindingsTableName: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + resolverFunctionName: true, + routeBindingsTableId: true, + routeBindingsTableName: true, + routesTableId: true, + routesTableName: true, + schemaId: true, + scope: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -624,28 +702,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.routeModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.routeModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/secure-table-provision.ts b/sdk/constructive-cli/src/modules/cli/commands/secure-table-provision.ts index 30b369918d..a8f7164764 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/secure-table-provision.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/secure-table-provision.ts @@ -3,59 +3,73 @@ * @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 { CreateSecureTableProvisionInput, SecureTableProvisionPatch, SecureTableProvisionSelect, SecureTableProvisionFilter, SecureTableProvisionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSecureTableProvisionInput, + SecureTableProvisionPatch, + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - fields: "json", - grants: "json", - id: "uuid", - nodes: "json", - outFields: "uuid", - policies: "json", - schemaId: "uuid", - tableId: "uuid", - tableName: "string", - useRls: "boolean" + databaseId: 'uuid', + fields: 'json', + grants: 'json', + id: 'uuid', + nodes: 'json', + outFields: 'uuid', + policies: 'json', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', + useRls: 'boolean', }; -const usage = "\nsecure-table-provision \n\nCommands:\n list List secureTableProvision records\n find-first Find first matching secureTableProvision record\n get Get a secureTableProvision by ID\n create Create a new secureTableProvision\n update Update an existing secureTableProvision\n delete Delete a secureTableProvision\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) => { +const usage = + '\nsecure-table-provision \n\nCommands:\n list List secureTableProvision records\n find-first Find first matching secureTableProvision record\n get Get a secureTableProvision by ID\n create Create a new secureTableProvision\n update Update an existing secureTableProvision\n delete Delete a secureTableProvision\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, tableId: true, tableName: true, - useRls: true + useRls: true, }; - const findManyArgs = parseFindManyArgs & { - select: SecureTableProvisionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy + > & { + select: SecureTableProvisionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.secureTableProvision.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +124,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, tableId: true, tableName: true, - useRls: true + useRls: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SecureTableProvisionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy + > & { + select: SecureTableProvisionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.secureTableProvision.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +148,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.secureTableProvision.findOne({ - id: answers.id as string, - select: { - databaseId: true, - fields: true, - grants: true, - id: true, - nodes: true, - outFields: true, - policies: true, - schemaId: true, - tableId: true, - tableName: true, - useRls: true - } - }).execute(); + const result = await client.secureTableProvision + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + fields: true, + grants: true, + id: true, + nodes: true, + outFields: true, + policies: true, + schemaId: true, + tableId: true, + tableName: true, + useRls: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,99 +186,115 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "json", - name: "fields", - message: "fields", - required: false, - skipPrompt: true - }, { - type: "json", - name: "grants", - message: "grants", - required: false, - skipPrompt: true - }, { - type: "json", - name: "nodes", - message: "nodes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outFields", - message: "outFields", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "useRls", - message: "useRls", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'json', + name: 'fields', + message: 'fields', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'grants', + message: 'grants', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'nodes', + message: 'nodes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outFields', + message: 'outFields', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'useRls', + message: 'useRls', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSecureTableProvisionInput["secureTableProvision"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateSecureTableProvisionInput['secureTableProvision']; const client = getClient(); - const result = await client.secureTableProvision.create({ - data: { - databaseId: cleanedData.databaseId, - fields: cleanedData.fields, - grants: cleanedData.grants, - nodes: cleanedData.nodes, - outFields: cleanedData.outFields, - policies: cleanedData.policies, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName, - useRls: cleanedData.useRls - }, - select: { - databaseId: true, - fields: true, - grants: true, - id: true, - nodes: true, - outFields: true, - policies: true, - schemaId: true, - tableId: true, - tableName: true, - useRls: true - } - }).execute(); + const result = await client.secureTableProvision + .create({ + data: { + databaseId: cleanedData.databaseId, + fields: cleanedData.fields, + grants: cleanedData.grants, + nodes: cleanedData.nodes, + outFields: cleanedData.outFields, + policies: cleanedData.policies, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + useRls: cleanedData.useRls, + }, + select: { + databaseId: true, + fields: true, + grants: true, + id: true, + nodes: true, + outFields: true, + policies: true, + schemaId: true, + tableId: true, + tableName: true, + useRls: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -257,107 +303,121 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "json", - name: "fields", - message: "fields", - required: false, - skipPrompt: true - }, { - type: "json", - name: "grants", - message: "grants", - required: false, - skipPrompt: true - }, { - type: "json", - name: "nodes", - message: "nodes", - required: false, - skipPrompt: true - }, { - type: "text", - name: "outFields", - message: "outFields", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "useRls", - message: "useRls", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'json', + name: 'fields', + message: 'fields', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'grants', + message: 'grants', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'nodes', + message: 'nodes', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outFields', + message: 'outFields', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'useRls', + message: 'useRls', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SecureTableProvisionPatch; const client = getClient(); - const result = await client.secureTableProvision.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - fields: cleanedData.fields, - grants: cleanedData.grants, - nodes: cleanedData.nodes, - outFields: cleanedData.outFields, - policies: cleanedData.policies, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName, - useRls: cleanedData.useRls - }, - select: { - databaseId: true, - fields: true, - grants: true, - id: true, - nodes: true, - outFields: true, - policies: true, - schemaId: true, - tableId: true, - tableName: true, - useRls: true - } - }).execute(); + const result = await client.secureTableProvision + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + fields: cleanedData.fields, + grants: cleanedData.grants, + nodes: cleanedData.nodes, + outFields: cleanedData.outFields, + policies: cleanedData.policies, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + useRls: cleanedData.useRls, + }, + select: { + databaseId: true, + fields: true, + grants: true, + id: true, + nodes: true, + outFields: true, + policies: true, + schemaId: true, + tableId: true, + tableName: true, + useRls: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -366,28 +426,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.secureTableProvision.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.secureTableProvision + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/session-secrets-module.ts b/sdk/constructive-cli/src/modules/cli/commands/session-secrets-module.ts index d241cce262..bbeecc8010 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/session-secrets-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/session-secrets-module.ts @@ -3,54 +3,68 @@ * @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 { CreateSessionSecretsModuleInput, SessionSecretsModulePatch, SessionSecretsModuleSelect, SessionSecretsModuleFilter, SessionSecretsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSessionSecretsModuleInput, + SessionSecretsModulePatch, + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - id: "uuid", - schemaId: "uuid", - sessionsTableId: "uuid", - tableId: "uuid", - tableName: "string" + databaseId: 'uuid', + id: 'uuid', + schemaId: 'uuid', + sessionsTableId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nsession-secrets-module \n\nCommands:\n list List sessionSecretsModule records\n find-first Find first matching sessionSecretsModule record\n get Get a sessionSecretsModule by ID\n create Create a new sessionSecretsModule\n update Update an existing sessionSecretsModule\n delete Delete a sessionSecretsModule\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) => { +const usage = + '\nsession-secrets-module \n\nCommands:\n list List sessionSecretsModule records\n find-first Find first matching sessionSecretsModule record\n get Get a sessionSecretsModule by ID\n create Create a new sessionSecretsModule\n update Update an existing sessionSecretsModule\n delete Delete a sessionSecretsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,22 @@ async function handleList(argv: Partial>, _prompter: Inq schemaId: true, sessionsTableId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: SessionSecretsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy + > & { + select: SessionSecretsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.sessionSecretsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +109,22 @@ async function handleFindFirst(argv: Partial>, _prompter schemaId: true, sessionsTableId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SessionSecretsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy + > & { + select: SessionSecretsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.sessionSecretsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +133,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.sessionSecretsModule.findOne({ - id: answers.id as string, - select: { - databaseId: true, - id: true, - schemaId: true, - sessionsTableId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.sessionSecretsModule + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + id: true, + schemaId: true, + sessionsTableId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,59 +166,70 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + 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: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSessionSecretsModuleInput["sessionSecretsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateSessionSecretsModuleInput['sessionSecretsModule']; const client = getClient(); - const result = await client.sessionSecretsModule.create({ - data: { - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - sessionsTableId: cleanedData.sessionsTableId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - databaseId: true, - id: true, - schemaId: true, - sessionsTableId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.sessionSecretsModule + .create({ + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + sessionsTableId: cleanedData.sessionsTableId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + databaseId: true, + id: true, + schemaId: true, + sessionsTableId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -197,67 +238,76 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + 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: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SessionSecretsModulePatch; const client = getClient(); - const result = await client.sessionSecretsModule.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - sessionsTableId: cleanedData.sessionsTableId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - databaseId: true, - id: true, - schemaId: true, - sessionsTableId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.sessionSecretsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + sessionsTableId: cleanedData.sessionsTableId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + databaseId: true, + id: true, + schemaId: true, + sessionsTableId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -266,28 +316,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.sessionSecretsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.sessionSecretsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/sessions-module.ts b/sdk/constructive-cli/src/modules/cli/commands/sessions-module.ts index bd883655ed..c74f150668 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/sessions-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/sessions-module.ts @@ -3,59 +3,73 @@ * @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 { CreateSessionsModuleInput, SessionsModulePatch, SessionsModuleSelect, SessionsModuleFilter, SessionsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSessionsModuleInput, + SessionsModulePatch, + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - authSettingsTableId: "uuid", - authSettingsTableName: "string", - databaseId: "uuid", - id: "uuid", - schemaId: "uuid", - sessionCredentialsTableId: "uuid", - sessionCredentialsTableName: "string", - sessionsDefaultExpiration: "string", - sessionsTableId: "uuid", - sessionsTableName: "string", - usersTableId: "uuid" + authSettingsTableId: 'uuid', + authSettingsTableName: 'string', + databaseId: 'uuid', + id: 'uuid', + schemaId: 'uuid', + sessionCredentialsTableId: 'uuid', + sessionCredentialsTableName: 'string', + sessionsDefaultExpiration: 'string', + sessionsTableId: 'uuid', + sessionsTableName: 'string', + usersTableId: 'uuid', }; -const usage = "\nsessions-module \n\nCommands:\n list List sessionsModule records\n find-first Find first matching sessionsModule record\n get Get a sessionsModule by ID\n create Create a new sessionsModule\n update Update an existing sessionsModule\n delete Delete a sessionsModule\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) => { +const usage = + '\nsessions-module \n\nCommands:\n list List sessionsModule records\n find-first Find first matching sessionsModule record\n get Get a sessionsModule by ID\n create Create a new sessionsModule\n update Update an existing sessionsModule\n delete Delete a sessionsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -75,16 +89,18 @@ async function handleList(argv: Partial>, _prompter: Inq sessionsDefaultExpiration: true, sessionsTableId: true, sessionsTableName: true, - usersTableId: true + usersTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: SessionsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SessionsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.sessionsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -104,16 +120,18 @@ async function handleFindFirst(argv: Partial>, _prompter sessionsDefaultExpiration: true, sessionsTableId: true, sessionsTableName: true, - usersTableId: true + usersTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SessionsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SessionsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.sessionsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -122,32 +140,36 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.sessionsModule.findOne({ - id: answers.id as string, - select: { - authSettingsTableId: true, - authSettingsTableName: true, - databaseId: true, - id: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionCredentialsTableName: true, - sessionsDefaultExpiration: true, - sessionsTableId: true, - sessionsTableName: true, - usersTableId: true - } - }).execute(); + const result = await client.sessionsModule + .findOne({ + id: answers.id as string, + select: { + authSettingsTableId: true, + authSettingsTableName: true, + databaseId: true, + id: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionCredentialsTableName: true, + sessionsDefaultExpiration: true, + sessionsTableId: true, + sessionsTableName: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -156,99 +178,115 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "authSettingsTableId", - message: "authSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authSettingsTableName", - message: "authSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableName", - message: "sessionCredentialsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsDefaultExpiration", - message: "sessionsDefaultExpiration", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableName", - message: "sessionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'authSettingsTableId', + message: 'authSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authSettingsTableName', + message: 'authSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableName', + message: 'sessionCredentialsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsDefaultExpiration', + message: 'sessionsDefaultExpiration', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableName', + message: 'sessionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSessionsModuleInput["sessionsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateSessionsModuleInput['sessionsModule']; const client = getClient(); - const result = await client.sessionsModule.create({ - data: { - authSettingsTableId: cleanedData.authSettingsTableId, - authSettingsTableName: cleanedData.authSettingsTableName, - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionCredentialsTableName: cleanedData.sessionCredentialsTableName, - sessionsDefaultExpiration: cleanedData.sessionsDefaultExpiration, - sessionsTableId: cleanedData.sessionsTableId, - sessionsTableName: cleanedData.sessionsTableName, - usersTableId: cleanedData.usersTableId - }, - select: { - authSettingsTableId: true, - authSettingsTableName: true, - databaseId: true, - id: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionCredentialsTableName: true, - sessionsDefaultExpiration: true, - sessionsTableId: true, - sessionsTableName: true, - usersTableId: true - } - }).execute(); + const result = await client.sessionsModule + .create({ + data: { + authSettingsTableId: cleanedData.authSettingsTableId, + authSettingsTableName: cleanedData.authSettingsTableName, + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionCredentialsTableName: cleanedData.sessionCredentialsTableName, + sessionsDefaultExpiration: cleanedData.sessionsDefaultExpiration, + sessionsTableId: cleanedData.sessionsTableId, + sessionsTableName: cleanedData.sessionsTableName, + usersTableId: cleanedData.usersTableId, + }, + select: { + authSettingsTableId: true, + authSettingsTableName: true, + databaseId: true, + id: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionCredentialsTableName: true, + sessionsDefaultExpiration: true, + sessionsTableId: true, + sessionsTableName: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -257,107 +295,121 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "authSettingsTableId", - message: "authSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authSettingsTableName", - message: "authSettingsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableName", - message: "sessionCredentialsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsDefaultExpiration", - message: "sessionsDefaultExpiration", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableName", - message: "sessionsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'authSettingsTableId', + message: 'authSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authSettingsTableName', + message: 'authSettingsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableName', + message: 'sessionCredentialsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsDefaultExpiration', + message: 'sessionsDefaultExpiration', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableName', + message: 'sessionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SessionsModulePatch; const client = getClient(); - const result = await client.sessionsModule.update({ - where: { - id: answers.id as string - }, - data: { - authSettingsTableId: cleanedData.authSettingsTableId, - authSettingsTableName: cleanedData.authSettingsTableName, - databaseId: cleanedData.databaseId, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionCredentialsTableName: cleanedData.sessionCredentialsTableName, - sessionsDefaultExpiration: cleanedData.sessionsDefaultExpiration, - sessionsTableId: cleanedData.sessionsTableId, - sessionsTableName: cleanedData.sessionsTableName, - usersTableId: cleanedData.usersTableId - }, - select: { - authSettingsTableId: true, - authSettingsTableName: true, - databaseId: true, - id: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionCredentialsTableName: true, - sessionsDefaultExpiration: true, - sessionsTableId: true, - sessionsTableName: true, - usersTableId: true - } - }).execute(); + const result = await client.sessionsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + authSettingsTableId: cleanedData.authSettingsTableId, + authSettingsTableName: cleanedData.authSettingsTableName, + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionCredentialsTableName: cleanedData.sessionCredentialsTableName, + sessionsDefaultExpiration: cleanedData.sessionsDefaultExpiration, + sessionsTableId: cleanedData.sessionsTableId, + sessionsTableName: cleanedData.sessionsTableName, + usersTableId: cleanedData.usersTableId, + }, + select: { + authSettingsTableId: true, + authSettingsTableName: true, + databaseId: true, + id: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionCredentialsTableName: true, + sessionsDefaultExpiration: true, + sessionsTableId: true, + sessionsTableName: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -366,28 +418,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.sessionsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.sessionsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/site-surface-module.ts b/sdk/constructive-cli/src/modules/cli/commands/site-surface-module.ts index 2bcc585bcc..18c30df2de 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/site-surface-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/site-surface-module.ts @@ -3,70 +3,84 @@ * @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 { CreateSiteSurfaceModuleInput, SiteSurfaceModulePatch, SiteSurfaceModuleSelect, SiteSurfaceModuleFilter, SiteSurfaceModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSiteSurfaceModuleInput, + SiteSurfaceModulePatch, + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - catalogModuleId: "uuid", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - id: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - siteMetadataTableId: "uuid", - siteMetadataTableName: "string", - siteModulesTableId: "uuid", - siteModulesTableName: "string", - siteThemesTableId: "uuid", - siteThemesTableName: "string", - sitesTableId: "uuid", - sitesTableName: "string" + apiName: 'string', + catalogModuleId: 'uuid', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + id: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + siteMetadataTableId: 'uuid', + siteMetadataTableName: 'string', + siteModulesTableId: 'uuid', + siteModulesTableName: 'string', + siteThemesTableId: 'uuid', + siteThemesTableName: 'string', + sitesTableId: 'uuid', + sitesTableName: 'string', }; -const usage = "\nsite-surface-module \n\nCommands:\n list List siteSurfaceModule records\n find-first Find first matching siteSurfaceModule record\n get Get a siteSurfaceModule by ID\n create Create a new siteSurfaceModule\n update Update an existing siteSurfaceModule\n delete Delete a siteSurfaceModule\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) => { +const usage = + '\nsite-surface-module \n\nCommands:\n list List siteSurfaceModule records\n find-first Find first matching siteSurfaceModule record\n get Get a siteSurfaceModule by ID\n create Create a new siteSurfaceModule\n update Update an existing siteSurfaceModule\n delete Delete a siteSurfaceModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -97,16 +111,18 @@ async function handleList(argv: Partial>, _prompter: Inq siteThemesTableId: true, siteThemesTableName: true, sitesTableId: true, - sitesTableName: true + sitesTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: SiteSurfaceModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SiteSurfaceModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.siteSurfaceModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -137,16 +153,18 @@ async function handleFindFirst(argv: Partial>, _prompter siteThemesTableId: true, siteThemesTableName: true, sitesTableId: true, - sitesTableName: true + sitesTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: SiteSurfaceModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SiteSurfaceModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.siteSurfaceModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -155,43 +173,47 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.siteSurfaceModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - siteMetadataTableId: true, - siteMetadataTableName: true, - siteModulesTableId: true, - siteModulesTableName: true, - siteThemesTableId: true, - siteThemesTableName: true, - sitesTableId: true, - sitesTableName: true - } - }).execute(); + const result = await client.siteSurfaceModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + siteMetadataTableId: true, + siteMetadataTableName: true, + siteModulesTableId: true, + siteModulesTableName: true, + siteThemesTableId: true, + siteThemesTableName: true, + sitesTableId: true, + sitesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -200,186 +222,213 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "siteMetadataTableId", - message: "siteMetadataTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteMetadataTableName", - message: "siteMetadataTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteModulesTableId", - message: "siteModulesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteModulesTableName", - message: "siteModulesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteThemesTableId", - message: "siteThemesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteThemesTableName", - message: "siteThemesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sitesTableId", - message: "sitesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sitesTableName", - message: "sitesTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'siteMetadataTableId', + message: 'siteMetadataTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteMetadataTableName', + message: 'siteMetadataTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteModulesTableId', + message: 'siteModulesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteModulesTableName', + message: 'siteModulesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteThemesTableId', + message: 'siteThemesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteThemesTableName', + message: 'siteThemesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sitesTableId', + message: 'sitesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sitesTableName', + message: 'sitesTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateSiteSurfaceModuleInput["siteSurfaceModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateSiteSurfaceModuleInput['siteSurfaceModule']; const client = getClient(); - const result = await client.siteSurfaceModule.create({ - data: { - apiName: cleanedData.apiName, - catalogModuleId: cleanedData.catalogModuleId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - siteMetadataTableId: cleanedData.siteMetadataTableId, - siteMetadataTableName: cleanedData.siteMetadataTableName, - siteModulesTableId: cleanedData.siteModulesTableId, - siteModulesTableName: cleanedData.siteModulesTableName, - siteThemesTableId: cleanedData.siteThemesTableId, - siteThemesTableName: cleanedData.siteThemesTableName, - sitesTableId: cleanedData.sitesTableId, - sitesTableName: cleanedData.sitesTableName - }, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - siteMetadataTableId: true, - siteMetadataTableName: true, - siteModulesTableId: true, - siteModulesTableName: true, - siteThemesTableId: true, - siteThemesTableName: true, - sitesTableId: true, - sitesTableName: true - } - }).execute(); + const result = await client.siteSurfaceModule + .create({ + data: { + apiName: cleanedData.apiName, + catalogModuleId: cleanedData.catalogModuleId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + siteMetadataTableId: cleanedData.siteMetadataTableId, + siteMetadataTableName: cleanedData.siteMetadataTableName, + siteModulesTableId: cleanedData.siteModulesTableId, + siteModulesTableName: cleanedData.siteModulesTableName, + siteThemesTableId: cleanedData.siteThemesTableId, + siteThemesTableName: cleanedData.siteThemesTableName, + sitesTableId: cleanedData.sitesTableId, + sitesTableName: cleanedData.sitesTableName, + }, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + siteMetadataTableId: true, + siteMetadataTableName: true, + siteModulesTableId: true, + siteModulesTableName: true, + siteThemesTableId: true, + siteThemesTableName: true, + sitesTableId: true, + sitesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -388,194 +437,219 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "catalogModuleId", - message: "catalogModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "siteMetadataTableId", - message: "siteMetadataTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteMetadataTableName", - message: "siteMetadataTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteModulesTableId", - message: "siteModulesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteModulesTableName", - message: "siteModulesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteThemesTableId", - message: "siteThemesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "siteThemesTableName", - message: "siteThemesTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sitesTableId", - message: "sitesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sitesTableName", - message: "sitesTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'catalogModuleId', + message: 'catalogModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'siteMetadataTableId', + message: 'siteMetadataTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteMetadataTableName', + message: 'siteMetadataTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteModulesTableId', + message: 'siteModulesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteModulesTableName', + message: 'siteModulesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteThemesTableId', + message: 'siteThemesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'siteThemesTableName', + message: 'siteThemesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sitesTableId', + message: 'sitesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sitesTableName', + message: 'sitesTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SiteSurfaceModulePatch; const client = getClient(); - const result = await client.siteSurfaceModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - catalogModuleId: cleanedData.catalogModuleId, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - siteMetadataTableId: cleanedData.siteMetadataTableId, - siteMetadataTableName: cleanedData.siteMetadataTableName, - siteModulesTableId: cleanedData.siteModulesTableId, - siteModulesTableName: cleanedData.siteModulesTableName, - siteThemesTableId: cleanedData.siteThemesTableId, - siteThemesTableName: cleanedData.siteThemesTableName, - sitesTableId: cleanedData.sitesTableId, - sitesTableName: cleanedData.sitesTableName - }, - select: { - apiName: true, - catalogModuleId: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - id: true, - policies: true, - prefix: true, - privateApiName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - siteMetadataTableId: true, - siteMetadataTableName: true, - siteModulesTableId: true, - siteModulesTableName: true, - siteThemesTableId: true, - siteThemesTableName: true, - sitesTableId: true, - sitesTableName: true - } - }).execute(); + const result = await client.siteSurfaceModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + catalogModuleId: cleanedData.catalogModuleId, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + siteMetadataTableId: cleanedData.siteMetadataTableId, + siteMetadataTableName: cleanedData.siteMetadataTableName, + siteModulesTableId: cleanedData.siteModulesTableId, + siteModulesTableName: cleanedData.siteModulesTableName, + siteThemesTableId: cleanedData.siteThemesTableId, + siteThemesTableName: cleanedData.siteThemesTableName, + sitesTableId: cleanedData.sitesTableId, + sitesTableName: cleanedData.sitesTableName, + }, + select: { + apiName: true, + catalogModuleId: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + id: true, + policies: true, + prefix: true, + privateApiName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + siteMetadataTableId: true, + siteMetadataTableName: true, + siteModulesTableId: true, + siteModulesTableName: true, + siteThemesTableId: true, + siteThemesTableName: true, + sitesTableId: true, + sitesTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -584,28 +658,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.siteSurfaceModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.siteSurfaceModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/storage-log-module.ts b/sdk/constructive-cli/src/modules/cli/commands/storage-log-module.ts index 26059ca674..f152f8805b 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/storage-log-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/storage-log-module.ts @@ -3,68 +3,82 @@ * @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 { CreateStorageLogModuleInput, StorageLogModulePatch, StorageLogModuleSelect, StorageLogModuleFilter, StorageLogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateStorageLogModuleInput, + StorageLogModulePatch, + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorFkTableId: "uuid", - apiName: "string", - databaseId: "uuid", - entityField: "string", - entityFkTableId: "uuid", - id: "uuid", - interval: "string", - prefix: "string", - premake: "int", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - retention: "string", - schemaId: "uuid", - scope: "string", - storageLogTableId: "uuid", - storageLogTableName: "string", - usageSummaryTableId: "uuid", - usageSummaryTableName: "string" + actorFkTableId: 'uuid', + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityFkTableId: 'uuid', + id: 'uuid', + interval: 'string', + prefix: 'string', + premake: 'int', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + retention: 'string', + schemaId: 'uuid', + scope: 'string', + storageLogTableId: 'uuid', + storageLogTableName: 'string', + usageSummaryTableId: 'uuid', + usageSummaryTableName: 'string', }; -const usage = "\nstorage-log-module \n\nCommands:\n list List storageLogModule records\n find-first Find first matching storageLogModule record\n get Get a storageLogModule by ID\n create Create a new storageLogModule\n update Update an existing storageLogModule\n delete Delete a storageLogModule\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) => { +const usage = + '\nstorage-log-module \n\nCommands:\n list List storageLogModule records\n find-first Find first matching storageLogModule record\n get Get a storageLogModule by ID\n create Create a new storageLogModule\n update Update an existing storageLogModule\n delete Delete a storageLogModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,18 @@ async function handleList(argv: Partial>, _prompter: Inq storageLogTableId: true, storageLogTableName: true, usageSummaryTableId: true, - usageSummaryTableName: true + usageSummaryTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: StorageLogModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: StorageLogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.storageLogModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +147,18 @@ async function handleFindFirst(argv: Partial>, _prompter storageLogTableId: true, storageLogTableName: true, usageSummaryTableId: true, - usageSummaryTableName: true + usageSummaryTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: StorageLogModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: StorageLogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.storageLogModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +167,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.storageLogModule.findOne({ - id: answers.id as string, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - storageLogTableId: true, - storageLogTableName: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.storageLogModule + .findOne({ + id: answers.id as string, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + storageLogTableId: true, + storageLogTableName: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,170 +214,195 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorFkTableId", - message: "actorFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityFkTableId", - message: "entityFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "storageLogTableId", - message: "storageLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storageLogTableName", - message: "storageLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableId", - message: "usageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableName", - message: "usageSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorFkTableId', + message: 'actorFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityFkTableId', + message: 'entityFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'storageLogTableId', + message: 'storageLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storageLogTableName', + message: 'storageLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableId', + message: 'usageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableName', + message: 'usageSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateStorageLogModuleInput["storageLogModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateStorageLogModuleInput['storageLogModule']; const client = getClient(); - const result = await client.storageLogModule.create({ - data: { - actorFkTableId: cleanedData.actorFkTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityFkTableId: cleanedData.entityFkTableId, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - storageLogTableId: cleanedData.storageLogTableId, - storageLogTableName: cleanedData.storageLogTableName, - usageSummaryTableId: cleanedData.usageSummaryTableId, - usageSummaryTableName: cleanedData.usageSummaryTableName - }, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - storageLogTableId: true, - storageLogTableName: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.storageLogModule + .create({ + data: { + actorFkTableId: cleanedData.actorFkTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityFkTableId: cleanedData.entityFkTableId, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + storageLogTableId: cleanedData.storageLogTableId, + storageLogTableName: cleanedData.storageLogTableName, + usageSummaryTableId: cleanedData.usageSummaryTableId, + usageSummaryTableName: cleanedData.usageSummaryTableName, + }, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + storageLogTableId: true, + storageLogTableName: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -364,178 +411,201 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorFkTableId", - message: "actorFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityFkTableId", - message: "entityFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "storageLogTableId", - message: "storageLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storageLogTableName", - message: "storageLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableId", - message: "usageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableName", - message: "usageSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorFkTableId', + message: 'actorFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityFkTableId', + message: 'entityFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'storageLogTableId', + message: 'storageLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storageLogTableName', + message: 'storageLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableId', + message: 'usageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableName', + message: 'usageSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as StorageLogModulePatch; const client = getClient(); - const result = await client.storageLogModule.update({ - where: { - id: answers.id as string - }, - data: { - actorFkTableId: cleanedData.actorFkTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityFkTableId: cleanedData.entityFkTableId, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - storageLogTableId: cleanedData.storageLogTableId, - storageLogTableName: cleanedData.storageLogTableName, - usageSummaryTableId: cleanedData.usageSummaryTableId, - usageSummaryTableName: cleanedData.usageSummaryTableName - }, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - storageLogTableId: true, - storageLogTableName: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.storageLogModule + .update({ + where: { + id: answers.id as string, + }, + data: { + actorFkTableId: cleanedData.actorFkTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityFkTableId: cleanedData.entityFkTableId, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + storageLogTableId: cleanedData.storageLogTableId, + storageLogTableName: cleanedData.storageLogTableName, + usageSummaryTableId: cleanedData.usageSummaryTableId, + usageSummaryTableName: cleanedData.usageSummaryTableName, + }, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + storageLogTableId: true, + storageLogTableName: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -544,28 +614,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.storageLogModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.storageLogModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/storage-module.ts b/sdk/constructive-cli/src/modules/cli/commands/storage-module.ts index 9cbedf6ad2..528b278094 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/storage-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/storage-module.ts @@ -3,88 +3,102 @@ * @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 { CreateStorageModuleInput, StorageModulePatch, StorageModuleSelect, StorageModuleFilter, StorageModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateStorageModuleInput, + StorageModulePatch, + StorageModuleSelect, + StorageModuleFilter, + StorageModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - allowedOrigins: "string", - apiName: "string", - bucketsTableId: "uuid", - bucketsTableName: "string", - cacheTtlSeconds: "int", - confirmUploadDelay: "string", - databaseId: "uuid", - defaultMaxFileSize: "int", - defaultPermissions: "string", - downloadUrlExpirySeconds: "int", - endpoint: "string", - entityField: "string", - entityTableId: "uuid", - fileEventsTableId: "uuid", - filesTableId: "uuid", - filesTableName: "string", - hasAuditLog: "boolean", - hasConfirmUpload: "boolean", - hasContentHash: "boolean", - hasCustomKeys: "boolean", - hasPathShares: "boolean", - hasVersioning: "boolean", - id: "uuid", - maxBulkFiles: "int", - maxBulkTotalSize: "int", - maxFilenameLength: "int", - pathSharesTableId: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provider: "string", - provisions: "json", - publicSchemaName: "string", - publicUrlPrefix: "string", - restrictReads: "boolean", - schemaId: "uuid", - scope: "string", - uploadUrlExpirySeconds: "int" + allowedOrigins: 'string', + apiName: 'string', + bucketsTableId: 'uuid', + bucketsTableName: 'string', + cacheTtlSeconds: 'int', + confirmUploadDelay: 'string', + databaseId: 'uuid', + defaultMaxFileSize: 'int', + defaultPermissions: 'string', + downloadUrlExpirySeconds: 'int', + endpoint: 'string', + entityField: 'string', + entityTableId: 'uuid', + fileEventsTableId: 'uuid', + filesTableId: 'uuid', + filesTableName: 'string', + hasAuditLog: 'boolean', + hasConfirmUpload: 'boolean', + hasContentHash: 'boolean', + hasCustomKeys: 'boolean', + hasPathShares: 'boolean', + hasVersioning: 'boolean', + id: 'uuid', + maxBulkFiles: 'int', + maxBulkTotalSize: 'int', + maxFilenameLength: 'int', + pathSharesTableId: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provider: 'string', + provisions: 'json', + publicSchemaName: 'string', + publicUrlPrefix: 'string', + restrictReads: 'boolean', + schemaId: 'uuid', + scope: 'string', + uploadUrlExpirySeconds: 'int', }; -const usage = "\nstorage-module \n\nCommands:\n list List storageModule records\n find-first Find first matching storageModule record\n get Get a storageModule by ID\n create Create a new storageModule\n update Update an existing storageModule\n delete Delete a storageModule\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) => { +const usage = + '\nstorage-module \n\nCommands:\n list List storageModule records\n find-first Find first matching storageModule record\n get Get a storageModule by ID\n create Create a new storageModule\n update Update an existing storageModule\n delete Delete a storageModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -133,16 +147,18 @@ async function handleList(argv: Partial>, _prompter: Inq restrictReads: true, schemaId: true, scope: true, - uploadUrlExpirySeconds: true + uploadUrlExpirySeconds: true, }; - const findManyArgs = parseFindManyArgs & { - select: StorageModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: StorageModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.storageModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -191,16 +207,18 @@ async function handleFindFirst(argv: Partial>, _prompter restrictReads: true, schemaId: true, scope: true, - uploadUrlExpirySeconds: true + uploadUrlExpirySeconds: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: StorageModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: StorageModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.storageModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -209,61 +227,65 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.storageModule.findOne({ - id: answers.id as string, - select: { - allowedOrigins: true, - apiName: true, - bucketsTableId: true, - bucketsTableName: true, - cacheTtlSeconds: true, - confirmUploadDelay: true, - databaseId: true, - defaultMaxFileSize: true, - defaultPermissions: true, - downloadUrlExpirySeconds: true, - endpoint: true, - entityField: true, - entityTableId: true, - fileEventsTableId: true, - filesTableId: true, - filesTableName: true, - hasAuditLog: true, - hasConfirmUpload: true, - hasContentHash: true, - hasCustomKeys: true, - hasPathShares: true, - hasVersioning: true, - id: true, - maxBulkFiles: true, - maxBulkTotalSize: true, - maxFilenameLength: true, - pathSharesTableId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provider: true, - provisions: true, - publicSchemaName: true, - publicUrlPrefix: true, - restrictReads: true, - schemaId: true, - scope: true, - uploadUrlExpirySeconds: true - } - }).execute(); + const result = await client.storageModule + .findOne({ + id: answers.id as string, + select: { + allowedOrigins: true, + apiName: true, + bucketsTableId: true, + bucketsTableName: true, + cacheTtlSeconds: true, + confirmUploadDelay: true, + databaseId: true, + defaultMaxFileSize: true, + defaultPermissions: true, + downloadUrlExpirySeconds: true, + endpoint: true, + entityField: true, + entityTableId: true, + fileEventsTableId: true, + filesTableId: true, + filesTableName: true, + hasAuditLog: true, + hasConfirmUpload: true, + hasContentHash: true, + hasCustomKeys: true, + hasPathShares: true, + hasVersioning: true, + id: true, + maxBulkFiles: true, + maxBulkTotalSize: true, + maxFilenameLength: true, + pathSharesTableId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provider: true, + provisions: true, + publicSchemaName: true, + publicUrlPrefix: true, + restrictReads: true, + schemaId: true, + scope: true, + uploadUrlExpirySeconds: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -272,330 +294,375 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "allowedOrigins", - message: "allowedOrigins", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bucketsTableId", - message: "bucketsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bucketsTableName", - message: "bucketsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "cacheTtlSeconds", - message: "cacheTtlSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "confirmUploadDelay", - message: "confirmUploadDelay", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultMaxFileSize", - message: "defaultMaxFileSize", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "downloadUrlExpirySeconds", - message: "downloadUrlExpirySeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "endpoint", - message: "endpoint", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fileEventsTableId", - message: "fileEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "filesTableId", - message: "filesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "filesTableName", - message: "filesTableName", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasAuditLog", - message: "hasAuditLog", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasConfirmUpload", - message: "hasConfirmUpload", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasContentHash", - message: "hasContentHash", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasCustomKeys", - message: "hasCustomKeys", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasPathShares", - message: "hasPathShares", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasVersioning", - message: "hasVersioning", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxBulkFiles", - message: "maxBulkFiles", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxBulkTotalSize", - message: "maxBulkTotalSize", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxFilenameLength", - message: "maxFilenameLength", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pathSharesTableId", - message: "pathSharesTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicUrlPrefix", - message: "publicUrlPrefix", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "restrictReads", - message: "restrictReads", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "uploadUrlExpirySeconds", - message: "uploadUrlExpirySeconds", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'allowedOrigins', + message: 'allowedOrigins', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bucketsTableId', + message: 'bucketsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bucketsTableName', + message: 'bucketsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'cacheTtlSeconds', + message: 'cacheTtlSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'confirmUploadDelay', + message: 'confirmUploadDelay', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultMaxFileSize', + message: 'defaultMaxFileSize', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'downloadUrlExpirySeconds', + message: 'downloadUrlExpirySeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'endpoint', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fileEventsTableId', + message: 'fileEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'filesTableId', + message: 'filesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'filesTableName', + message: 'filesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasAuditLog', + message: 'hasAuditLog', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasConfirmUpload', + message: 'hasConfirmUpload', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasContentHash', + message: 'hasContentHash', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasCustomKeys', + message: 'hasCustomKeys', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasPathShares', + message: 'hasPathShares', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasVersioning', + message: 'hasVersioning', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxBulkFiles', + message: 'maxBulkFiles', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxBulkTotalSize', + message: 'maxBulkTotalSize', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxFilenameLength', + message: 'maxFilenameLength', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pathSharesTableId', + message: 'pathSharesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicUrlPrefix', + message: 'publicUrlPrefix', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'restrictReads', + message: 'restrictReads', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'uploadUrlExpirySeconds', + message: 'uploadUrlExpirySeconds', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateStorageModuleInput["storageModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateStorageModuleInput['storageModule']; const client = getClient(); - const result = await client.storageModule.create({ - data: { - allowedOrigins: cleanedData.allowedOrigins, - apiName: cleanedData.apiName, - bucketsTableId: cleanedData.bucketsTableId, - bucketsTableName: cleanedData.bucketsTableName, - cacheTtlSeconds: cleanedData.cacheTtlSeconds, - confirmUploadDelay: cleanedData.confirmUploadDelay, - databaseId: cleanedData.databaseId, - defaultMaxFileSize: cleanedData.defaultMaxFileSize, - defaultPermissions: cleanedData.defaultPermissions, - downloadUrlExpirySeconds: cleanedData.downloadUrlExpirySeconds, - endpoint: cleanedData.endpoint, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - fileEventsTableId: cleanedData.fileEventsTableId, - filesTableId: cleanedData.filesTableId, - filesTableName: cleanedData.filesTableName, - hasAuditLog: cleanedData.hasAuditLog, - hasConfirmUpload: cleanedData.hasConfirmUpload, - hasContentHash: cleanedData.hasContentHash, - hasCustomKeys: cleanedData.hasCustomKeys, - hasPathShares: cleanedData.hasPathShares, - hasVersioning: cleanedData.hasVersioning, - maxBulkFiles: cleanedData.maxBulkFiles, - maxBulkTotalSize: cleanedData.maxBulkTotalSize, - maxFilenameLength: cleanedData.maxFilenameLength, - pathSharesTableId: cleanedData.pathSharesTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provider: cleanedData.provider, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - publicUrlPrefix: cleanedData.publicUrlPrefix, - restrictReads: cleanedData.restrictReads, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - uploadUrlExpirySeconds: cleanedData.uploadUrlExpirySeconds - }, - select: { - allowedOrigins: true, - apiName: true, - bucketsTableId: true, - bucketsTableName: true, - cacheTtlSeconds: true, - confirmUploadDelay: true, - databaseId: true, - defaultMaxFileSize: true, - defaultPermissions: true, - downloadUrlExpirySeconds: true, - endpoint: true, - entityField: true, - entityTableId: true, - fileEventsTableId: true, - filesTableId: true, - filesTableName: true, - hasAuditLog: true, - hasConfirmUpload: true, - hasContentHash: true, - hasCustomKeys: true, - hasPathShares: true, - hasVersioning: true, - id: true, - maxBulkFiles: true, - maxBulkTotalSize: true, - maxFilenameLength: true, - pathSharesTableId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provider: true, - provisions: true, - publicSchemaName: true, - publicUrlPrefix: true, - restrictReads: true, - schemaId: true, - scope: true, - uploadUrlExpirySeconds: true - } - }).execute(); + const result = await client.storageModule + .create({ + data: { + allowedOrigins: cleanedData.allowedOrigins, + apiName: cleanedData.apiName, + bucketsTableId: cleanedData.bucketsTableId, + bucketsTableName: cleanedData.bucketsTableName, + cacheTtlSeconds: cleanedData.cacheTtlSeconds, + confirmUploadDelay: cleanedData.confirmUploadDelay, + databaseId: cleanedData.databaseId, + defaultMaxFileSize: cleanedData.defaultMaxFileSize, + defaultPermissions: cleanedData.defaultPermissions, + downloadUrlExpirySeconds: cleanedData.downloadUrlExpirySeconds, + endpoint: cleanedData.endpoint, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + fileEventsTableId: cleanedData.fileEventsTableId, + filesTableId: cleanedData.filesTableId, + filesTableName: cleanedData.filesTableName, + hasAuditLog: cleanedData.hasAuditLog, + hasConfirmUpload: cleanedData.hasConfirmUpload, + hasContentHash: cleanedData.hasContentHash, + hasCustomKeys: cleanedData.hasCustomKeys, + hasPathShares: cleanedData.hasPathShares, + hasVersioning: cleanedData.hasVersioning, + maxBulkFiles: cleanedData.maxBulkFiles, + maxBulkTotalSize: cleanedData.maxBulkTotalSize, + maxFilenameLength: cleanedData.maxFilenameLength, + pathSharesTableId: cleanedData.pathSharesTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provider: cleanedData.provider, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + publicUrlPrefix: cleanedData.publicUrlPrefix, + restrictReads: cleanedData.restrictReads, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + uploadUrlExpirySeconds: cleanedData.uploadUrlExpirySeconds, + }, + select: { + allowedOrigins: true, + apiName: true, + bucketsTableId: true, + bucketsTableName: true, + cacheTtlSeconds: true, + confirmUploadDelay: true, + databaseId: true, + defaultMaxFileSize: true, + defaultPermissions: true, + downloadUrlExpirySeconds: true, + endpoint: true, + entityField: true, + entityTableId: true, + fileEventsTableId: true, + filesTableId: true, + filesTableName: true, + hasAuditLog: true, + hasConfirmUpload: true, + hasContentHash: true, + hasCustomKeys: true, + hasPathShares: true, + hasVersioning: true, + id: true, + maxBulkFiles: true, + maxBulkTotalSize: true, + maxFilenameLength: true, + pathSharesTableId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provider: true, + provisions: true, + publicSchemaName: true, + publicUrlPrefix: true, + restrictReads: true, + schemaId: true, + scope: true, + uploadUrlExpirySeconds: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -604,338 +671,381 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "allowedOrigins", - message: "allowedOrigins", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bucketsTableId", - message: "bucketsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "bucketsTableName", - message: "bucketsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "cacheTtlSeconds", - message: "cacheTtlSeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "confirmUploadDelay", - message: "confirmUploadDelay", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultMaxFileSize", - message: "defaultMaxFileSize", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "downloadUrlExpirySeconds", - message: "downloadUrlExpirySeconds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "endpoint", - message: "endpoint", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "fileEventsTableId", - message: "fileEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "filesTableId", - message: "filesTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "filesTableName", - message: "filesTableName", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasAuditLog", - message: "hasAuditLog", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasConfirmUpload", - message: "hasConfirmUpload", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasContentHash", - message: "hasContentHash", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasCustomKeys", - message: "hasCustomKeys", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasPathShares", - message: "hasPathShares", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "hasVersioning", - message: "hasVersioning", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxBulkFiles", - message: "maxBulkFiles", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxBulkTotalSize", - message: "maxBulkTotalSize", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxFilenameLength", - message: "maxFilenameLength", - required: false, - skipPrompt: true - }, { - type: "text", - name: "pathSharesTableId", - message: "pathSharesTableId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "provider", - message: "provider", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicUrlPrefix", - message: "publicUrlPrefix", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "restrictReads", - message: "restrictReads", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "uploadUrlExpirySeconds", - message: "uploadUrlExpirySeconds", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'allowedOrigins', + message: 'allowedOrigins', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bucketsTableId', + message: 'bucketsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'bucketsTableName', + message: 'bucketsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'cacheTtlSeconds', + message: 'cacheTtlSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'confirmUploadDelay', + message: 'confirmUploadDelay', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultMaxFileSize', + message: 'defaultMaxFileSize', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'downloadUrlExpirySeconds', + message: 'downloadUrlExpirySeconds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'endpoint', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'fileEventsTableId', + message: 'fileEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'filesTableId', + message: 'filesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'filesTableName', + message: 'filesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasAuditLog', + message: 'hasAuditLog', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasConfirmUpload', + message: 'hasConfirmUpload', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasContentHash', + message: 'hasContentHash', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasCustomKeys', + message: 'hasCustomKeys', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasPathShares', + message: 'hasPathShares', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'hasVersioning', + message: 'hasVersioning', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxBulkFiles', + message: 'maxBulkFiles', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxBulkTotalSize', + message: 'maxBulkTotalSize', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxFilenameLength', + message: 'maxFilenameLength', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'pathSharesTableId', + message: 'pathSharesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'provider', + message: 'provider', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicUrlPrefix', + message: 'publicUrlPrefix', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'restrictReads', + message: 'restrictReads', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'uploadUrlExpirySeconds', + message: 'uploadUrlExpirySeconds', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as StorageModulePatch; const client = getClient(); - const result = await client.storageModule.update({ - where: { - id: answers.id as string - }, - data: { - allowedOrigins: cleanedData.allowedOrigins, - apiName: cleanedData.apiName, - bucketsTableId: cleanedData.bucketsTableId, - bucketsTableName: cleanedData.bucketsTableName, - cacheTtlSeconds: cleanedData.cacheTtlSeconds, - confirmUploadDelay: cleanedData.confirmUploadDelay, - databaseId: cleanedData.databaseId, - defaultMaxFileSize: cleanedData.defaultMaxFileSize, - defaultPermissions: cleanedData.defaultPermissions, - downloadUrlExpirySeconds: cleanedData.downloadUrlExpirySeconds, - endpoint: cleanedData.endpoint, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - fileEventsTableId: cleanedData.fileEventsTableId, - filesTableId: cleanedData.filesTableId, - filesTableName: cleanedData.filesTableName, - hasAuditLog: cleanedData.hasAuditLog, - hasConfirmUpload: cleanedData.hasConfirmUpload, - hasContentHash: cleanedData.hasContentHash, - hasCustomKeys: cleanedData.hasCustomKeys, - hasPathShares: cleanedData.hasPathShares, - hasVersioning: cleanedData.hasVersioning, - maxBulkFiles: cleanedData.maxBulkFiles, - maxBulkTotalSize: cleanedData.maxBulkTotalSize, - maxFilenameLength: cleanedData.maxFilenameLength, - pathSharesTableId: cleanedData.pathSharesTableId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provider: cleanedData.provider, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - publicUrlPrefix: cleanedData.publicUrlPrefix, - restrictReads: cleanedData.restrictReads, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - uploadUrlExpirySeconds: cleanedData.uploadUrlExpirySeconds - }, - select: { - allowedOrigins: true, - apiName: true, - bucketsTableId: true, - bucketsTableName: true, - cacheTtlSeconds: true, - confirmUploadDelay: true, - databaseId: true, - defaultMaxFileSize: true, - defaultPermissions: true, - downloadUrlExpirySeconds: true, - endpoint: true, - entityField: true, - entityTableId: true, - fileEventsTableId: true, - filesTableId: true, - filesTableName: true, - hasAuditLog: true, - hasConfirmUpload: true, - hasContentHash: true, - hasCustomKeys: true, - hasPathShares: true, - hasVersioning: true, - id: true, - maxBulkFiles: true, - maxBulkTotalSize: true, - maxFilenameLength: true, - pathSharesTableId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provider: true, - provisions: true, - publicSchemaName: true, - publicUrlPrefix: true, - restrictReads: true, - schemaId: true, - scope: true, - uploadUrlExpirySeconds: true - } - }).execute(); + const result = await client.storageModule + .update({ + where: { + id: answers.id as string, + }, + data: { + allowedOrigins: cleanedData.allowedOrigins, + apiName: cleanedData.apiName, + bucketsTableId: cleanedData.bucketsTableId, + bucketsTableName: cleanedData.bucketsTableName, + cacheTtlSeconds: cleanedData.cacheTtlSeconds, + confirmUploadDelay: cleanedData.confirmUploadDelay, + databaseId: cleanedData.databaseId, + defaultMaxFileSize: cleanedData.defaultMaxFileSize, + defaultPermissions: cleanedData.defaultPermissions, + downloadUrlExpirySeconds: cleanedData.downloadUrlExpirySeconds, + endpoint: cleanedData.endpoint, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + fileEventsTableId: cleanedData.fileEventsTableId, + filesTableId: cleanedData.filesTableId, + filesTableName: cleanedData.filesTableName, + hasAuditLog: cleanedData.hasAuditLog, + hasConfirmUpload: cleanedData.hasConfirmUpload, + hasContentHash: cleanedData.hasContentHash, + hasCustomKeys: cleanedData.hasCustomKeys, + hasPathShares: cleanedData.hasPathShares, + hasVersioning: cleanedData.hasVersioning, + maxBulkFiles: cleanedData.maxBulkFiles, + maxBulkTotalSize: cleanedData.maxBulkTotalSize, + maxFilenameLength: cleanedData.maxFilenameLength, + pathSharesTableId: cleanedData.pathSharesTableId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provider: cleanedData.provider, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + publicUrlPrefix: cleanedData.publicUrlPrefix, + restrictReads: cleanedData.restrictReads, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + uploadUrlExpirySeconds: cleanedData.uploadUrlExpirySeconds, + }, + select: { + allowedOrigins: true, + apiName: true, + bucketsTableId: true, + bucketsTableName: true, + cacheTtlSeconds: true, + confirmUploadDelay: true, + databaseId: true, + defaultMaxFileSize: true, + defaultPermissions: true, + downloadUrlExpirySeconds: true, + endpoint: true, + entityField: true, + entityTableId: true, + fileEventsTableId: true, + filesTableId: true, + filesTableName: true, + hasAuditLog: true, + hasConfirmUpload: true, + hasContentHash: true, + hasCustomKeys: true, + hasPathShares: true, + hasVersioning: true, + id: true, + maxBulkFiles: true, + maxBulkTotalSize: true, + maxFilenameLength: true, + pathSharesTableId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provider: true, + provisions: true, + publicSchemaName: true, + publicUrlPrefix: true, + restrictReads: true, + schemaId: true, + scope: true, + uploadUrlExpirySeconds: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -944,28 +1054,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.storageModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.storageModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/transfer-log-module.ts b/sdk/constructive-cli/src/modules/cli/commands/transfer-log-module.ts index b720e1b97a..5906b152aa 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/transfer-log-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/transfer-log-module.ts @@ -3,68 +3,82 @@ * @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 { CreateTransferLogModuleInput, TransferLogModulePatch, TransferLogModuleSelect, TransferLogModuleFilter, TransferLogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateTransferLogModuleInput, + TransferLogModulePatch, + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorFkTableId: "uuid", - apiName: "string", - databaseId: "uuid", - entityField: "string", - entityFkTableId: "uuid", - id: "uuid", - interval: "string", - prefix: "string", - premake: "int", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - publicSchemaName: "string", - retention: "string", - schemaId: "uuid", - scope: "string", - transferLogTableId: "uuid", - transferLogTableName: "string", - usageSummaryTableId: "uuid", - usageSummaryTableName: "string" + actorFkTableId: 'uuid', + apiName: 'string', + databaseId: 'uuid', + entityField: 'string', + entityFkTableId: 'uuid', + id: 'uuid', + interval: 'string', + prefix: 'string', + premake: 'int', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + publicSchemaName: 'string', + retention: 'string', + schemaId: 'uuid', + scope: 'string', + transferLogTableId: 'uuid', + transferLogTableName: 'string', + usageSummaryTableId: 'uuid', + usageSummaryTableName: 'string', }; -const usage = "\ntransfer-log-module \n\nCommands:\n list List transferLogModule records\n find-first Find first matching transferLogModule record\n get Get a transferLogModule by ID\n create Create a new transferLogModule\n update Update an existing transferLogModule\n delete Delete a transferLogModule\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) => { +const usage = + '\ntransfer-log-module \n\nCommands:\n list List transferLogModule records\n find-first Find first matching transferLogModule record\n get Get a transferLogModule by ID\n create Create a new transferLogModule\n update Update an existing transferLogModule\n delete Delete a transferLogModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -93,16 +107,18 @@ async function handleList(argv: Partial>, _prompter: Inq transferLogTableId: true, transferLogTableName: true, usageSummaryTableId: true, - usageSummaryTableName: true + usageSummaryTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: TransferLogModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: TransferLogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.transferLogModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -131,16 +147,18 @@ async function handleFindFirst(argv: Partial>, _prompter transferLogTableId: true, transferLogTableName: true, usageSummaryTableId: true, - usageSummaryTableName: true + usageSummaryTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: TransferLogModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: TransferLogModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.transferLogModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -149,41 +167,45 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.transferLogModule.findOne({ - id: answers.id as string, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - transferLogTableId: true, - transferLogTableName: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.transferLogModule + .findOne({ + id: answers.id as string, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + transferLogTableId: true, + transferLogTableName: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -192,170 +214,195 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorFkTableId", - message: "actorFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityFkTableId", - message: "entityFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "transferLogTableId", - message: "transferLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "transferLogTableName", - message: "transferLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableId", - message: "usageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableName", - message: "usageSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorFkTableId', + message: 'actorFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityFkTableId', + message: 'entityFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'transferLogTableId', + message: 'transferLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'transferLogTableName', + message: 'transferLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableId', + message: 'usageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableName', + message: 'usageSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateTransferLogModuleInput["transferLogModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateTransferLogModuleInput['transferLogModule']; const client = getClient(); - const result = await client.transferLogModule.create({ - data: { - actorFkTableId: cleanedData.actorFkTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityFkTableId: cleanedData.entityFkTableId, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - transferLogTableId: cleanedData.transferLogTableId, - transferLogTableName: cleanedData.transferLogTableName, - usageSummaryTableId: cleanedData.usageSummaryTableId, - usageSummaryTableName: cleanedData.usageSummaryTableName - }, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - transferLogTableId: true, - transferLogTableName: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.transferLogModule + .create({ + data: { + actorFkTableId: cleanedData.actorFkTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityFkTableId: cleanedData.entityFkTableId, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + transferLogTableId: cleanedData.transferLogTableId, + transferLogTableName: cleanedData.transferLogTableName, + usageSummaryTableId: cleanedData.usageSummaryTableId, + usageSummaryTableName: cleanedData.usageSummaryTableName, + }, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + transferLogTableId: true, + transferLogTableName: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -364,178 +411,201 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorFkTableId", - message: "actorFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityFkTableId", - message: "entityFkTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "interval", - message: "interval", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "premake", - message: "premake", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "retention", - message: "retention", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "transferLogTableId", - message: "transferLogTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "transferLogTableName", - message: "transferLogTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableId", - message: "usageSummaryTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usageSummaryTableName", - message: "usageSummaryTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorFkTableId', + message: 'actorFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityFkTableId', + message: 'entityFkTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'interval', + message: 'interval', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'premake', + message: 'premake', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'retention', + message: 'retention', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'transferLogTableId', + message: 'transferLogTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'transferLogTableName', + message: 'transferLogTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableId', + message: 'usageSummaryTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usageSummaryTableName', + message: 'usageSummaryTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as TransferLogModulePatch; const client = getClient(); - const result = await client.transferLogModule.update({ - where: { - id: answers.id as string - }, - data: { - actorFkTableId: cleanedData.actorFkTableId, - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - entityFkTableId: cleanedData.entityFkTableId, - interval: cleanedData.interval, - prefix: cleanedData.prefix, - premake: cleanedData.premake, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - publicSchemaName: cleanedData.publicSchemaName, - retention: cleanedData.retention, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - transferLogTableId: cleanedData.transferLogTableId, - transferLogTableName: cleanedData.transferLogTableName, - usageSummaryTableId: cleanedData.usageSummaryTableId, - usageSummaryTableName: cleanedData.usageSummaryTableName - }, - select: { - actorFkTableId: true, - apiName: true, - databaseId: true, - entityField: true, - entityFkTableId: true, - id: true, - interval: true, - prefix: true, - premake: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - publicSchemaName: true, - retention: true, - schemaId: true, - scope: true, - transferLogTableId: true, - transferLogTableName: true, - usageSummaryTableId: true, - usageSummaryTableName: true - } - }).execute(); + const result = await client.transferLogModule + .update({ + where: { + id: answers.id as string, + }, + data: { + actorFkTableId: cleanedData.actorFkTableId, + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + entityFkTableId: cleanedData.entityFkTableId, + interval: cleanedData.interval, + prefix: cleanedData.prefix, + premake: cleanedData.premake, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + publicSchemaName: cleanedData.publicSchemaName, + retention: cleanedData.retention, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + transferLogTableId: cleanedData.transferLogTableId, + transferLogTableName: cleanedData.transferLogTableName, + usageSummaryTableId: cleanedData.usageSummaryTableId, + usageSummaryTableName: cleanedData.usageSummaryTableName, + }, + select: { + actorFkTableId: true, + apiName: true, + databaseId: true, + entityField: true, + entityFkTableId: true, + id: true, + interval: true, + prefix: true, + premake: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + publicSchemaName: true, + retention: true, + schemaId: true, + scope: true, + transferLogTableId: true, + transferLogTableName: true, + usageSummaryTableId: true, + usageSummaryTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -544,28 +614,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.transferLogModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.transferLogModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/user-auth-module.ts b/sdk/constructive-cli/src/modules/cli/commands/user-auth-module.ts index 568c796f2d..f92155fceb 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/user-auth-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/user-auth-module.ts @@ -3,76 +3,90 @@ * @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 { CreateUserAuthModuleInput, UserAuthModulePatch, UserAuthModuleSelect, UserAuthModuleFilter, UserAuthModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateUserAuthModuleInput, + UserAuthModulePatch, + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - auditsTableId: "uuid", - auditsTableName: "string", - checkPasswordFunction: "string", - databaseId: "uuid", - deleteAccountFunction: "string", - emailsTableId: "uuid", - encryptedTableId: "uuid", - extendTokenExpires: "string", - forgotPasswordFunction: "string", - id: "uuid", - privateApiName: "string", - requestCrossOriginTokenFunction: "string", - resetPasswordFunction: "string", - schemaId: "uuid", - secretsTableId: "uuid", - sendAccountDeletionEmailFunction: "string", - sendVerificationEmailFunction: "string", - sessionCredentialsTableId: "uuid", - sessionsTableId: "uuid", - setPasswordFunction: "string", - signInCrossOriginFunction: "string", - signInFunction: "string", - signOutFunction: "string", - signUpFunction: "string", - usersTableId: "uuid", - verifyEmailFunction: "string", - verifyPasswordFunction: "string" + apiName: 'string', + auditsTableId: 'uuid', + auditsTableName: 'string', + checkPasswordFunction: 'string', + databaseId: 'uuid', + deleteAccountFunction: 'string', + emailsTableId: 'uuid', + encryptedTableId: 'uuid', + extendTokenExpires: 'string', + forgotPasswordFunction: 'string', + id: 'uuid', + privateApiName: 'string', + requestCrossOriginTokenFunction: 'string', + resetPasswordFunction: 'string', + schemaId: 'uuid', + secretsTableId: 'uuid', + sendAccountDeletionEmailFunction: 'string', + sendVerificationEmailFunction: 'string', + sessionCredentialsTableId: 'uuid', + sessionsTableId: 'uuid', + setPasswordFunction: 'string', + signInCrossOriginFunction: 'string', + signInFunction: 'string', + signOutFunction: 'string', + signUpFunction: 'string', + usersTableId: 'uuid', + verifyEmailFunction: 'string', + verifyPasswordFunction: 'string', }; -const usage = "\nuser-auth-module \n\nCommands:\n list List userAuthModule records\n find-first Find first matching userAuthModule record\n get Get a userAuthModule by ID\n create Create a new userAuthModule\n update Update an existing userAuthModule\n delete Delete a userAuthModule\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) => { +const usage = + '\nuser-auth-module \n\nCommands:\n list List userAuthModule records\n find-first Find first matching userAuthModule record\n get Get a userAuthModule by ID\n create Create a new userAuthModule\n update Update an existing userAuthModule\n delete Delete a userAuthModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -109,16 +123,18 @@ async function handleList(argv: Partial>, _prompter: Inq signUpFunction: true, usersTableId: true, verifyEmailFunction: true, - verifyPasswordFunction: true + verifyPasswordFunction: true, }; - const findManyArgs = parseFindManyArgs & { - select: UserAuthModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: UserAuthModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userAuthModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -155,16 +171,18 @@ async function handleFindFirst(argv: Partial>, _prompter signUpFunction: true, usersTableId: true, verifyEmailFunction: true, - verifyPasswordFunction: true + verifyPasswordFunction: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: UserAuthModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: UserAuthModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userAuthModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -173,49 +191,53 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.userAuthModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - auditsTableId: true, - auditsTableName: true, - checkPasswordFunction: true, - databaseId: true, - deleteAccountFunction: true, - emailsTableId: true, - encryptedTableId: true, - extendTokenExpires: true, - forgotPasswordFunction: true, - id: true, - privateApiName: true, - requestCrossOriginTokenFunction: true, - resetPasswordFunction: true, - schemaId: true, - secretsTableId: true, - sendAccountDeletionEmailFunction: true, - sendVerificationEmailFunction: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - setPasswordFunction: true, - signInCrossOriginFunction: true, - signInFunction: true, - signOutFunction: true, - signUpFunction: true, - usersTableId: true, - verifyEmailFunction: true, - verifyPasswordFunction: true - } - }).execute(); + const result = await client.userAuthModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + auditsTableId: true, + auditsTableName: true, + checkPasswordFunction: true, + databaseId: true, + deleteAccountFunction: true, + emailsTableId: true, + encryptedTableId: true, + extendTokenExpires: true, + forgotPasswordFunction: true, + id: true, + privateApiName: true, + requestCrossOriginTokenFunction: true, + resetPasswordFunction: true, + schemaId: true, + secretsTableId: true, + sendAccountDeletionEmailFunction: true, + sendVerificationEmailFunction: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + setPasswordFunction: true, + signInCrossOriginFunction: true, + signInFunction: true, + signOutFunction: true, + signUpFunction: true, + usersTableId: true, + verifyEmailFunction: true, + verifyPasswordFunction: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -224,235 +246,268 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "auditsTableId", - message: "auditsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "auditsTableName", - message: "auditsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "checkPasswordFunction", - message: "checkPasswordFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "deleteAccountFunction", - message: "deleteAccountFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "emailsTableId", - message: "emailsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "encryptedTableId", - message: "encryptedTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "extendTokenExpires", - message: "extendTokenExpires", - required: false, - skipPrompt: true - }, { - type: "text", - name: "forgotPasswordFunction", - message: "forgotPasswordFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requestCrossOriginTokenFunction", - message: "requestCrossOriginTokenFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resetPasswordFunction", - message: "resetPasswordFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "secretsTableId", - message: "secretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sendAccountDeletionEmailFunction", - message: "sendAccountDeletionEmailFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sendVerificationEmailFunction", - message: "sendVerificationEmailFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "setPasswordFunction", - message: "setPasswordFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInCrossOriginFunction", - message: "signInCrossOriginFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInFunction", - message: "signInFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signOutFunction", - message: "signOutFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signUpFunction", - message: "signUpFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifyEmailFunction", - message: "verifyEmailFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifyPasswordFunction", - message: "verifyPasswordFunction", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'auditsTableId', + message: 'auditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'auditsTableName', + message: 'auditsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'checkPasswordFunction', + message: 'checkPasswordFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'deleteAccountFunction', + message: 'deleteAccountFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'emailsTableId', + message: 'emailsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'encryptedTableId', + message: 'encryptedTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'extendTokenExpires', + message: 'extendTokenExpires', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'forgotPasswordFunction', + message: 'forgotPasswordFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requestCrossOriginTokenFunction', + message: 'requestCrossOriginTokenFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resetPasswordFunction', + message: 'resetPasswordFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'secretsTableId', + message: 'secretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sendAccountDeletionEmailFunction', + message: 'sendAccountDeletionEmailFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sendVerificationEmailFunction', + message: 'sendVerificationEmailFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'setPasswordFunction', + message: 'setPasswordFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInCrossOriginFunction', + message: 'signInCrossOriginFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInFunction', + message: 'signInFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signOutFunction', + message: 'signOutFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signUpFunction', + message: 'signUpFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifyEmailFunction', + message: 'verifyEmailFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifyPasswordFunction', + message: 'verifyPasswordFunction', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateUserAuthModuleInput["userAuthModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateUserAuthModuleInput['userAuthModule']; const client = getClient(); - const result = await client.userAuthModule.create({ - data: { - apiName: cleanedData.apiName, - auditsTableId: cleanedData.auditsTableId, - auditsTableName: cleanedData.auditsTableName, - checkPasswordFunction: cleanedData.checkPasswordFunction, - databaseId: cleanedData.databaseId, - deleteAccountFunction: cleanedData.deleteAccountFunction, - emailsTableId: cleanedData.emailsTableId, - encryptedTableId: cleanedData.encryptedTableId, - extendTokenExpires: cleanedData.extendTokenExpires, - forgotPasswordFunction: cleanedData.forgotPasswordFunction, - privateApiName: cleanedData.privateApiName, - requestCrossOriginTokenFunction: cleanedData.requestCrossOriginTokenFunction, - resetPasswordFunction: cleanedData.resetPasswordFunction, - schemaId: cleanedData.schemaId, - secretsTableId: cleanedData.secretsTableId, - sendAccountDeletionEmailFunction: cleanedData.sendAccountDeletionEmailFunction, - sendVerificationEmailFunction: cleanedData.sendVerificationEmailFunction, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionsTableId: cleanedData.sessionsTableId, - setPasswordFunction: cleanedData.setPasswordFunction, - signInCrossOriginFunction: cleanedData.signInCrossOriginFunction, - signInFunction: cleanedData.signInFunction, - signOutFunction: cleanedData.signOutFunction, - signUpFunction: cleanedData.signUpFunction, - usersTableId: cleanedData.usersTableId, - verifyEmailFunction: cleanedData.verifyEmailFunction, - verifyPasswordFunction: cleanedData.verifyPasswordFunction - }, - select: { - apiName: true, - auditsTableId: true, - auditsTableName: true, - checkPasswordFunction: true, - databaseId: true, - deleteAccountFunction: true, - emailsTableId: true, - encryptedTableId: true, - extendTokenExpires: true, - forgotPasswordFunction: true, - id: true, - privateApiName: true, - requestCrossOriginTokenFunction: true, - resetPasswordFunction: true, - schemaId: true, - secretsTableId: true, - sendAccountDeletionEmailFunction: true, - sendVerificationEmailFunction: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - setPasswordFunction: true, - signInCrossOriginFunction: true, - signInFunction: true, - signOutFunction: true, - signUpFunction: true, - usersTableId: true, - verifyEmailFunction: true, - verifyPasswordFunction: true - } - }).execute(); + const result = await client.userAuthModule + .create({ + data: { + apiName: cleanedData.apiName, + auditsTableId: cleanedData.auditsTableId, + auditsTableName: cleanedData.auditsTableName, + checkPasswordFunction: cleanedData.checkPasswordFunction, + databaseId: cleanedData.databaseId, + deleteAccountFunction: cleanedData.deleteAccountFunction, + emailsTableId: cleanedData.emailsTableId, + encryptedTableId: cleanedData.encryptedTableId, + extendTokenExpires: cleanedData.extendTokenExpires, + forgotPasswordFunction: cleanedData.forgotPasswordFunction, + privateApiName: cleanedData.privateApiName, + requestCrossOriginTokenFunction: cleanedData.requestCrossOriginTokenFunction, + resetPasswordFunction: cleanedData.resetPasswordFunction, + schemaId: cleanedData.schemaId, + secretsTableId: cleanedData.secretsTableId, + sendAccountDeletionEmailFunction: cleanedData.sendAccountDeletionEmailFunction, + sendVerificationEmailFunction: cleanedData.sendVerificationEmailFunction, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionsTableId: cleanedData.sessionsTableId, + setPasswordFunction: cleanedData.setPasswordFunction, + signInCrossOriginFunction: cleanedData.signInCrossOriginFunction, + signInFunction: cleanedData.signInFunction, + signOutFunction: cleanedData.signOutFunction, + signUpFunction: cleanedData.signUpFunction, + usersTableId: cleanedData.usersTableId, + verifyEmailFunction: cleanedData.verifyEmailFunction, + verifyPasswordFunction: cleanedData.verifyPasswordFunction, + }, + select: { + apiName: true, + auditsTableId: true, + auditsTableName: true, + checkPasswordFunction: true, + databaseId: true, + deleteAccountFunction: true, + emailsTableId: true, + encryptedTableId: true, + extendTokenExpires: true, + forgotPasswordFunction: true, + id: true, + privateApiName: true, + requestCrossOriginTokenFunction: true, + resetPasswordFunction: true, + schemaId: true, + secretsTableId: true, + sendAccountDeletionEmailFunction: true, + sendVerificationEmailFunction: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + setPasswordFunction: true, + signInCrossOriginFunction: true, + signInFunction: true, + signOutFunction: true, + signUpFunction: true, + usersTableId: true, + verifyEmailFunction: true, + verifyPasswordFunction: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -461,243 +516,274 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "auditsTableId", - message: "auditsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "auditsTableName", - message: "auditsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "checkPasswordFunction", - message: "checkPasswordFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "deleteAccountFunction", - message: "deleteAccountFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "emailsTableId", - message: "emailsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "encryptedTableId", - message: "encryptedTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "extendTokenExpires", - message: "extendTokenExpires", - required: false, - skipPrompt: true - }, { - type: "text", - name: "forgotPasswordFunction", - message: "forgotPasswordFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "requestCrossOriginTokenFunction", - message: "requestCrossOriginTokenFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "resetPasswordFunction", - message: "resetPasswordFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "secretsTableId", - message: "secretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sendAccountDeletionEmailFunction", - message: "sendAccountDeletionEmailFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sendVerificationEmailFunction", - message: "sendVerificationEmailFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "setPasswordFunction", - message: "setPasswordFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInCrossOriginFunction", - message: "signInCrossOriginFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signInFunction", - message: "signInFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signOutFunction", - message: "signOutFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "signUpFunction", - message: "signUpFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifyEmailFunction", - message: "verifyEmailFunction", - required: false, - skipPrompt: true - }, { - type: "text", - name: "verifyPasswordFunction", - message: "verifyPasswordFunction", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'auditsTableId', + message: 'auditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'auditsTableName', + message: 'auditsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'checkPasswordFunction', + message: 'checkPasswordFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'deleteAccountFunction', + message: 'deleteAccountFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'emailsTableId', + message: 'emailsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'encryptedTableId', + message: 'encryptedTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'extendTokenExpires', + message: 'extendTokenExpires', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'forgotPasswordFunction', + message: 'forgotPasswordFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requestCrossOriginTokenFunction', + message: 'requestCrossOriginTokenFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'resetPasswordFunction', + message: 'resetPasswordFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'secretsTableId', + message: 'secretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sendAccountDeletionEmailFunction', + message: 'sendAccountDeletionEmailFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sendVerificationEmailFunction', + message: 'sendVerificationEmailFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'setPasswordFunction', + message: 'setPasswordFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInCrossOriginFunction', + message: 'signInCrossOriginFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signInFunction', + message: 'signInFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signOutFunction', + message: 'signOutFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'signUpFunction', + message: 'signUpFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifyEmailFunction', + message: 'verifyEmailFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'verifyPasswordFunction', + message: 'verifyPasswordFunction', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as UserAuthModulePatch; const client = getClient(); - const result = await client.userAuthModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - auditsTableId: cleanedData.auditsTableId, - auditsTableName: cleanedData.auditsTableName, - checkPasswordFunction: cleanedData.checkPasswordFunction, - databaseId: cleanedData.databaseId, - deleteAccountFunction: cleanedData.deleteAccountFunction, - emailsTableId: cleanedData.emailsTableId, - encryptedTableId: cleanedData.encryptedTableId, - extendTokenExpires: cleanedData.extendTokenExpires, - forgotPasswordFunction: cleanedData.forgotPasswordFunction, - privateApiName: cleanedData.privateApiName, - requestCrossOriginTokenFunction: cleanedData.requestCrossOriginTokenFunction, - resetPasswordFunction: cleanedData.resetPasswordFunction, - schemaId: cleanedData.schemaId, - secretsTableId: cleanedData.secretsTableId, - sendAccountDeletionEmailFunction: cleanedData.sendAccountDeletionEmailFunction, - sendVerificationEmailFunction: cleanedData.sendVerificationEmailFunction, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionsTableId: cleanedData.sessionsTableId, - setPasswordFunction: cleanedData.setPasswordFunction, - signInCrossOriginFunction: cleanedData.signInCrossOriginFunction, - signInFunction: cleanedData.signInFunction, - signOutFunction: cleanedData.signOutFunction, - signUpFunction: cleanedData.signUpFunction, - usersTableId: cleanedData.usersTableId, - verifyEmailFunction: cleanedData.verifyEmailFunction, - verifyPasswordFunction: cleanedData.verifyPasswordFunction - }, - select: { - apiName: true, - auditsTableId: true, - auditsTableName: true, - checkPasswordFunction: true, - databaseId: true, - deleteAccountFunction: true, - emailsTableId: true, - encryptedTableId: true, - extendTokenExpires: true, - forgotPasswordFunction: true, - id: true, - privateApiName: true, - requestCrossOriginTokenFunction: true, - resetPasswordFunction: true, - schemaId: true, - secretsTableId: true, - sendAccountDeletionEmailFunction: true, - sendVerificationEmailFunction: true, - sessionCredentialsTableId: true, - sessionsTableId: true, - setPasswordFunction: true, - signInCrossOriginFunction: true, - signInFunction: true, - signOutFunction: true, - signUpFunction: true, - usersTableId: true, - verifyEmailFunction: true, - verifyPasswordFunction: true - } - }).execute(); + const result = await client.userAuthModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + auditsTableId: cleanedData.auditsTableId, + auditsTableName: cleanedData.auditsTableName, + checkPasswordFunction: cleanedData.checkPasswordFunction, + databaseId: cleanedData.databaseId, + deleteAccountFunction: cleanedData.deleteAccountFunction, + emailsTableId: cleanedData.emailsTableId, + encryptedTableId: cleanedData.encryptedTableId, + extendTokenExpires: cleanedData.extendTokenExpires, + forgotPasswordFunction: cleanedData.forgotPasswordFunction, + privateApiName: cleanedData.privateApiName, + requestCrossOriginTokenFunction: cleanedData.requestCrossOriginTokenFunction, + resetPasswordFunction: cleanedData.resetPasswordFunction, + schemaId: cleanedData.schemaId, + secretsTableId: cleanedData.secretsTableId, + sendAccountDeletionEmailFunction: cleanedData.sendAccountDeletionEmailFunction, + sendVerificationEmailFunction: cleanedData.sendVerificationEmailFunction, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionsTableId: cleanedData.sessionsTableId, + setPasswordFunction: cleanedData.setPasswordFunction, + signInCrossOriginFunction: cleanedData.signInCrossOriginFunction, + signInFunction: cleanedData.signInFunction, + signOutFunction: cleanedData.signOutFunction, + signUpFunction: cleanedData.signUpFunction, + usersTableId: cleanedData.usersTableId, + verifyEmailFunction: cleanedData.verifyEmailFunction, + verifyPasswordFunction: cleanedData.verifyPasswordFunction, + }, + select: { + apiName: true, + auditsTableId: true, + auditsTableName: true, + checkPasswordFunction: true, + databaseId: true, + deleteAccountFunction: true, + emailsTableId: true, + encryptedTableId: true, + extendTokenExpires: true, + forgotPasswordFunction: true, + id: true, + privateApiName: true, + requestCrossOriginTokenFunction: true, + resetPasswordFunction: true, + schemaId: true, + secretsTableId: true, + sendAccountDeletionEmailFunction: true, + sendVerificationEmailFunction: true, + sessionCredentialsTableId: true, + sessionsTableId: true, + setPasswordFunction: true, + signInCrossOriginFunction: true, + signInFunction: true, + signOutFunction: true, + signUpFunction: true, + usersTableId: true, + verifyEmailFunction: true, + verifyPasswordFunction: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -706,28 +792,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.userAuthModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.userAuthModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/user-credentials-module.ts b/sdk/constructive-cli/src/modules/cli/commands/user-credentials-module.ts index e3992ed61f..c7352b0ae4 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/user-credentials-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/user-credentials-module.ts @@ -3,55 +3,69 @@ * @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 { CreateUserCredentialsModuleInput, UserCredentialsModulePatch, UserCredentialsModuleSelect, UserCredentialsModuleFilter, UserCredentialsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateUserCredentialsModuleInput, + UserCredentialsModulePatch, + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - entityField: "string", - id: "uuid", - privateApiName: "string", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + databaseId: 'uuid', + entityField: 'string', + id: 'uuid', + privateApiName: 'string', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nuser-credentials-module \n\nCommands:\n list List userCredentialsModule records\n find-first Find first matching userCredentialsModule record\n get Get a userCredentialsModule by ID\n create Create a new userCredentialsModule\n update Update an existing userCredentialsModule\n delete Delete a userCredentialsModule\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) => { +const usage = + '\nuser-credentials-module \n\nCommands:\n list List userCredentialsModule records\n find-first Find first matching userCredentialsModule record\n get Get a userCredentialsModule by ID\n create Create a new userCredentialsModule\n update Update an existing userCredentialsModule\n delete Delete a userCredentialsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq privateApiName: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: UserCredentialsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy + > & { + select: UserCredentialsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userCredentialsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter privateApiName: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: UserCredentialsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy + > & { + select: UserCredentialsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userCredentialsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.userCredentialsModule.findOne({ - id: answers.id as string, - select: { - databaseId: true, - entityField: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userCredentialsModule + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + entityField: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,67 +170,79 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateUserCredentialsModuleInput["userCredentialsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateUserCredentialsModuleInput['userCredentialsModule']; const client = getClient(); - const result = await client.userCredentialsModule.create({ - data: { - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - privateApiName: cleanedData.privateApiName, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - databaseId: true, - entityField: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userCredentialsModule + .create({ + data: { + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + privateApiName: cleanedData.privateApiName, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + databaseId: true, + entityField: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -209,75 +251,85 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + 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: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as UserCredentialsModulePatch; const client = getClient(); - const result = await client.userCredentialsModule.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - privateApiName: cleanedData.privateApiName, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - databaseId: true, - entityField: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userCredentialsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + privateApiName: cleanedData.privateApiName, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + databaseId: true, + entityField: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -286,28 +338,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.userCredentialsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.userCredentialsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/user-settings-module.ts b/sdk/constructive-cli/src/modules/cli/commands/user-settings-module.ts index a98c0908fc..c9cc4868d4 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/user-settings-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/user-settings-module.ts @@ -3,55 +3,69 @@ * @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 { CreateUserSettingsModuleInput, UserSettingsModulePatch, UserSettingsModuleSelect, UserSettingsModuleFilter, UserSettingsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateUserSettingsModuleInput, + UserSettingsModulePatch, + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - id: "uuid", - ownerTableId: "uuid", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + apiName: 'string', + databaseId: 'uuid', + id: 'uuid', + ownerTableId: 'uuid', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nuser-settings-module \n\nCommands:\n list List userSettingsModule records\n find-first Find first matching userSettingsModule record\n get Get a userSettingsModule by ID\n create Create a new userSettingsModule\n update Update an existing userSettingsModule\n delete Delete a userSettingsModule\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) => { +const usage = + '\nuser-settings-module \n\nCommands:\n list List userSettingsModule records\n find-first Find first matching userSettingsModule record\n get Get a userSettingsModule by ID\n create Create a new userSettingsModule\n update Update an existing userSettingsModule\n delete Delete a userSettingsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -67,16 +81,22 @@ async function handleList(argv: Partial>, _prompter: Inq ownerTableId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: UserSettingsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy + > & { + select: UserSettingsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userSettingsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -92,16 +112,22 @@ async function handleFindFirst(argv: Partial>, _prompter ownerTableId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: UserSettingsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy + > & { + select: UserSettingsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userSettingsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -110,28 +136,32 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.userSettingsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userSettingsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -140,67 +170,79 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateUserSettingsModuleInput["userSettingsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateUserSettingsModuleInput['userSettingsModule']; const client = getClient(); - const result = await client.userSettingsModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userSettingsModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -209,75 +251,85 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as UserSettingsModulePatch; const client = getClient(); - const result = await client.userSettingsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userSettingsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -286,28 +338,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.userSettingsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.userSettingsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/user-state-module.ts b/sdk/constructive-cli/src/modules/cli/commands/user-state-module.ts index 2d23a949d7..18337d7dd8 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/user-state-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/user-state-module.ts @@ -3,54 +3,68 @@ * @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 { CreateUserStateModuleInput, UserStateModulePatch, UserStateModuleSelect, UserStateModuleFilter, UserStateModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateUserStateModuleInput, + UserStateModulePatch, + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - databaseId: "uuid", - entityField: "string", - id: "uuid", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + databaseId: 'uuid', + entityField: 'string', + id: 'uuid', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nuser-state-module \n\nCommands:\n list List userStateModule records\n find-first Find first matching userStateModule record\n get Get a userStateModule by ID\n create Create a new userStateModule\n update Update an existing userStateModule\n delete Delete a userStateModule\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) => { +const usage = + '\nuser-state-module \n\nCommands:\n list List userStateModule records\n find-first Find first matching userStateModule record\n get Get a userStateModule by ID\n create Create a new userStateModule\n update Update an existing userStateModule\n delete Delete a userStateModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: UserStateModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: UserStateModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userStateModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: UserStateModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: UserStateModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.userStateModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.userStateModule.findOne({ - id: answers.id as string, - select: { - databaseId: true, - entityField: true, - id: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userStateModule + .findOne({ + id: answers.id as string, + select: { + databaseId: true, + entityField: true, + id: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,59 +158,70 @@ async function handleGet(argv: Partial>, prompter: Inqui } 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: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateUserStateModuleInput["userStateModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateUserStateModuleInput['userStateModule']; const client = getClient(); - const result = await client.userStateModule.create({ - data: { - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - databaseId: true, - entityField: true, - id: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userStateModule + .create({ + data: { + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + databaseId: true, + entityField: true, + id: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -197,67 +230,76 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + 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: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as UserStateModulePatch; const client = getClient(); - const result = await client.userStateModule.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - entityField: cleanedData.entityField, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - databaseId: true, - entityField: true, - id: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.userStateModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + entityField: cleanedData.entityField, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + databaseId: true, + entityField: true, + id: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -266,28 +308,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.userStateModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.userStateModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/users-module.ts b/sdk/constructive-cli/src/modules/cli/commands/users-module.ts index 3f413361a9..7db77fe31c 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/users-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/users-module.ts @@ -3,57 +3,71 @@ * @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 { CreateUsersModuleInput, UsersModulePatch, UsersModuleSelect, UsersModuleFilter, UsersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateUsersModuleInput, + UsersModulePatch, + UsersModuleSelect, + UsersModuleFilter, + UsersModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - id: "uuid", - privateApiName: "string", - schemaId: "uuid", - tableId: "uuid", - tableName: "string", - typeTableId: "uuid", - typeTableName: "string" + apiName: 'string', + databaseId: 'uuid', + id: 'uuid', + privateApiName: 'string', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', + typeTableId: 'uuid', + typeTableName: 'string', }; -const usage = "\nusers-module \n\nCommands:\n list List usersModule records\n find-first Find first matching usersModule record\n get Get a usersModule by ID\n create Create a new usersModule\n update Update an existing usersModule\n delete Delete a usersModule\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) => { +const usage = + '\nusers-module \n\nCommands:\n list List usersModule records\n find-first Find first matching usersModule record\n get Get a usersModule by ID\n create Create a new usersModule\n update Update an existing usersModule\n delete Delete a usersModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq tableId: true, tableName: true, typeTableId: true, - typeTableName: true + typeTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: UsersModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: UsersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.usersModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter tableId: true, tableName: true, typeTableId: true, - typeTableName: true + typeTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: UsersModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: UsersModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.usersModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.usersModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true, - typeTableId: true, - typeTableName: true - } - }).execute(); + const result = await client.usersModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + typeTableId: true, + typeTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,83 +170,97 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "typeTableId", - message: "typeTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "typeTableName", - message: "typeTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'typeTableId', + message: 'typeTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'typeTableName', + message: 'typeTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateUsersModuleInput["usersModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateUsersModuleInput['usersModule']; const client = getClient(); - const result = await client.usersModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - privateApiName: cleanedData.privateApiName, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName, - typeTableId: cleanedData.typeTableId, - typeTableName: cleanedData.typeTableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true, - typeTableId: true, - typeTableName: true - } - }).execute(); + const result = await client.usersModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + privateApiName: cleanedData.privateApiName, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + typeTableId: cleanedData.typeTableId, + typeTableName: cleanedData.typeTableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + typeTableId: true, + typeTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -233,91 +269,103 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "typeTableId", - message: "typeTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "typeTableName", - message: "typeTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'typeTableId', + message: 'typeTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'typeTableName', + message: 'typeTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as UsersModulePatch; const client = getClient(); - const result = await client.usersModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - privateApiName: cleanedData.privateApiName, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName, - typeTableId: cleanedData.typeTableId, - typeTableName: cleanedData.typeTableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - privateApiName: true, - schemaId: true, - tableId: true, - tableName: true, - typeTableId: true, - typeTableName: true - } - }).execute(); + const result = await client.usersModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + privateApiName: cleanedData.privateApiName, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + typeTableId: cleanedData.typeTableId, + typeTableName: cleanedData.typeTableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + privateApiName: true, + schemaId: true, + tableId: true, + tableName: true, + typeTableId: true, + typeTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -326,28 +374,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.usersModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.usersModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/webauthn-auth-module.ts b/sdk/constructive-cli/src/modules/cli/commands/webauthn-auth-module.ts index e36992c092..e8e3549281 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/webauthn-auth-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/webauthn-auth-module.ts @@ -3,64 +3,78 @@ * @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 { CreateWebauthnAuthModuleInput, WebauthnAuthModulePatch, WebauthnAuthModuleSelect, WebauthnAuthModuleFilter, WebauthnAuthModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateWebauthnAuthModuleInput, + WebauthnAuthModulePatch, + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - attestationType: "string", - authSettingsTableId: "uuid", - challengeExpiry: "string", - credentialsTableId: "uuid", - databaseId: "uuid", - id: "uuid", - originAllowlist: "string", - requireUserVerification: "boolean", - residentKey: "string", - rpId: "string", - rpName: "string", - schemaId: "uuid", - sessionCredentialsTableId: "uuid", - sessionSecretsTableId: "uuid", - sessionsTableId: "uuid", - usersTableId: "uuid" + attestationType: 'string', + authSettingsTableId: 'uuid', + challengeExpiry: 'string', + credentialsTableId: 'uuid', + databaseId: 'uuid', + id: 'uuid', + originAllowlist: 'string', + requireUserVerification: 'boolean', + residentKey: 'string', + rpId: 'string', + rpName: 'string', + schemaId: 'uuid', + sessionCredentialsTableId: 'uuid', + sessionSecretsTableId: 'uuid', + sessionsTableId: 'uuid', + usersTableId: 'uuid', }; -const usage = "\nwebauthn-auth-module \n\nCommands:\n list List webauthnAuthModule records\n find-first Find first matching webauthnAuthModule record\n get Get a webauthnAuthModule by ID\n create Create a new webauthnAuthModule\n update Update an existing webauthnAuthModule\n delete Delete a webauthnAuthModule\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) => { +const usage = + '\nwebauthn-auth-module \n\nCommands:\n list List webauthnAuthModule records\n find-first Find first matching webauthnAuthModule record\n get Get a webauthnAuthModule by ID\n create Create a new webauthnAuthModule\n update Update an existing webauthnAuthModule\n delete Delete a webauthnAuthModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -85,16 +99,22 @@ async function handleList(argv: Partial>, _prompter: Inq sessionCredentialsTableId: true, sessionSecretsTableId: true, sessionsTableId: true, - usersTableId: true + usersTableId: true, }; - const findManyArgs = parseFindManyArgs & { - select: WebauthnAuthModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy + > & { + select: WebauthnAuthModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webauthnAuthModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -119,16 +139,22 @@ async function handleFindFirst(argv: Partial>, _prompter sessionCredentialsTableId: true, sessionSecretsTableId: true, sessionsTableId: true, - usersTableId: true + usersTableId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: WebauthnAuthModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy + > & { + select: WebauthnAuthModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webauthnAuthModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -137,37 +163,41 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.webauthnAuthModule.findOne({ - id: answers.id as string, - select: { - attestationType: true, - authSettingsTableId: true, - challengeExpiry: true, - credentialsTableId: true, - databaseId: true, - id: true, - originAllowlist: true, - requireUserVerification: true, - residentKey: true, - rpId: true, - rpName: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionSecretsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.webauthnAuthModule + .findOne({ + id: answers.id as string, + select: { + attestationType: true, + authSettingsTableId: true, + challengeExpiry: true, + credentialsTableId: true, + databaseId: true, + id: true, + originAllowlist: true, + requireUserVerification: true, + residentKey: true, + rpId: true, + rpName: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionSecretsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -176,139 +206,160 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "attestationType", - message: "attestationType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authSettingsTableId", - message: "authSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "challengeExpiry", - message: "challengeExpiry", - required: false, - skipPrompt: true - }, { - type: "text", - name: "credentialsTableId", - message: "credentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "originAllowlist", - message: "originAllowlist", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "requireUserVerification", - message: "requireUserVerification", - required: false, - skipPrompt: true - }, { - type: "text", - name: "residentKey", - message: "residentKey", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rpId", - message: "rpId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rpName", - message: "rpName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionSecretsTableId", - message: "sessionSecretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'attestationType', + message: 'attestationType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authSettingsTableId', + message: 'authSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'challengeExpiry', + message: 'challengeExpiry', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'credentialsTableId', + message: 'credentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'originAllowlist', + message: 'originAllowlist', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'requireUserVerification', + message: 'requireUserVerification', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'residentKey', + message: 'residentKey', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rpId', + message: 'rpId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rpName', + message: 'rpName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionSecretsTableId', + message: 'sessionSecretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateWebauthnAuthModuleInput["webauthnAuthModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateWebauthnAuthModuleInput['webauthnAuthModule']; const client = getClient(); - const result = await client.webauthnAuthModule.create({ - data: { - attestationType: cleanedData.attestationType, - authSettingsTableId: cleanedData.authSettingsTableId, - challengeExpiry: cleanedData.challengeExpiry, - credentialsTableId: cleanedData.credentialsTableId, - databaseId: cleanedData.databaseId, - originAllowlist: cleanedData.originAllowlist, - requireUserVerification: cleanedData.requireUserVerification, - residentKey: cleanedData.residentKey, - rpId: cleanedData.rpId, - rpName: cleanedData.rpName, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionSecretsTableId: cleanedData.sessionSecretsTableId, - sessionsTableId: cleanedData.sessionsTableId, - usersTableId: cleanedData.usersTableId - }, - select: { - attestationType: true, - authSettingsTableId: true, - challengeExpiry: true, - credentialsTableId: true, - databaseId: true, - id: true, - originAllowlist: true, - requireUserVerification: true, - residentKey: true, - rpId: true, - rpName: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionSecretsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.webauthnAuthModule + .create({ + data: { + attestationType: cleanedData.attestationType, + authSettingsTableId: cleanedData.authSettingsTableId, + challengeExpiry: cleanedData.challengeExpiry, + credentialsTableId: cleanedData.credentialsTableId, + databaseId: cleanedData.databaseId, + originAllowlist: cleanedData.originAllowlist, + requireUserVerification: cleanedData.requireUserVerification, + residentKey: cleanedData.residentKey, + rpId: cleanedData.rpId, + rpName: cleanedData.rpName, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionSecretsTableId: cleanedData.sessionSecretsTableId, + sessionsTableId: cleanedData.sessionsTableId, + usersTableId: cleanedData.usersTableId, + }, + select: { + attestationType: true, + authSettingsTableId: true, + challengeExpiry: true, + credentialsTableId: true, + databaseId: true, + id: true, + originAllowlist: true, + requireUserVerification: true, + residentKey: true, + rpId: true, + rpName: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionSecretsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -317,147 +368,166 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "attestationType", - message: "attestationType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "authSettingsTableId", - message: "authSettingsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "challengeExpiry", - message: "challengeExpiry", - required: false, - skipPrompt: true - }, { - type: "text", - name: "credentialsTableId", - message: "credentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "originAllowlist", - message: "originAllowlist", - required: false, - skipPrompt: true - }, { - type: "boolean", - name: "requireUserVerification", - message: "requireUserVerification", - required: false, - skipPrompt: true - }, { - type: "text", - name: "residentKey", - message: "residentKey", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rpId", - message: "rpId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "rpName", - message: "rpName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionCredentialsTableId", - message: "sessionCredentialsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionSecretsTableId", - message: "sessionSecretsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "sessionsTableId", - message: "sessionsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "usersTableId", - message: "usersTableId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'attestationType', + message: 'attestationType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authSettingsTableId', + message: 'authSettingsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'challengeExpiry', + message: 'challengeExpiry', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'credentialsTableId', + message: 'credentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'originAllowlist', + message: 'originAllowlist', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'requireUserVerification', + message: 'requireUserVerification', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'residentKey', + message: 'residentKey', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rpId', + message: 'rpId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'rpName', + message: 'rpName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionSecretsTableId', + message: 'sessionSecretsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as WebauthnAuthModulePatch; const client = getClient(); - const result = await client.webauthnAuthModule.update({ - where: { - id: answers.id as string - }, - data: { - attestationType: cleanedData.attestationType, - authSettingsTableId: cleanedData.authSettingsTableId, - challengeExpiry: cleanedData.challengeExpiry, - credentialsTableId: cleanedData.credentialsTableId, - databaseId: cleanedData.databaseId, - originAllowlist: cleanedData.originAllowlist, - requireUserVerification: cleanedData.requireUserVerification, - residentKey: cleanedData.residentKey, - rpId: cleanedData.rpId, - rpName: cleanedData.rpName, - schemaId: cleanedData.schemaId, - sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, - sessionSecretsTableId: cleanedData.sessionSecretsTableId, - sessionsTableId: cleanedData.sessionsTableId, - usersTableId: cleanedData.usersTableId - }, - select: { - attestationType: true, - authSettingsTableId: true, - challengeExpiry: true, - credentialsTableId: true, - databaseId: true, - id: true, - originAllowlist: true, - requireUserVerification: true, - residentKey: true, - rpId: true, - rpName: true, - schemaId: true, - sessionCredentialsTableId: true, - sessionSecretsTableId: true, - sessionsTableId: true, - usersTableId: true - } - }).execute(); + const result = await client.webauthnAuthModule + .update({ + where: { + id: answers.id as string, + }, + data: { + attestationType: cleanedData.attestationType, + authSettingsTableId: cleanedData.authSettingsTableId, + challengeExpiry: cleanedData.challengeExpiry, + credentialsTableId: cleanedData.credentialsTableId, + databaseId: cleanedData.databaseId, + originAllowlist: cleanedData.originAllowlist, + requireUserVerification: cleanedData.requireUserVerification, + residentKey: cleanedData.residentKey, + rpId: cleanedData.rpId, + rpName: cleanedData.rpName, + schemaId: cleanedData.schemaId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + sessionSecretsTableId: cleanedData.sessionSecretsTableId, + sessionsTableId: cleanedData.sessionsTableId, + usersTableId: cleanedData.usersTableId, + }, + select: { + attestationType: true, + authSettingsTableId: true, + challengeExpiry: true, + credentialsTableId: true, + databaseId: true, + id: true, + originAllowlist: true, + requireUserVerification: true, + residentKey: true, + rpId: true, + rpName: true, + schemaId: true, + sessionCredentialsTableId: true, + sessionSecretsTableId: true, + sessionsTableId: true, + usersTableId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -466,28 +536,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.webauthnAuthModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.webauthnAuthModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/webauthn-credentials-module.ts b/sdk/constructive-cli/src/modules/cli/commands/webauthn-credentials-module.ts index 5ae8506d4a..9e7d51c42c 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/webauthn-credentials-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/webauthn-credentials-module.ts @@ -3,57 +3,71 @@ * @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 { CreateWebauthnCredentialsModuleInput, WebauthnCredentialsModulePatch, WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleFilter, WebauthnCredentialsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateWebauthnCredentialsModuleInput, + WebauthnCredentialsModulePatch, + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - id: "uuid", - ownerTableId: "uuid", - privateApiName: "string", - privateSchemaId: "uuid", - schemaId: "uuid", - tableId: "uuid", - tableName: "string" + apiName: 'string', + databaseId: 'uuid', + id: 'uuid', + ownerTableId: 'uuid', + privateApiName: 'string', + privateSchemaId: 'uuid', + schemaId: 'uuid', + tableId: 'uuid', + tableName: 'string', }; -const usage = "\nwebauthn-credentials-module \n\nCommands:\n list List webauthnCredentialsModule records\n find-first Find first matching webauthnCredentialsModule record\n get Get a webauthnCredentialsModule by ID\n create Create a new webauthnCredentialsModule\n update Update an existing webauthnCredentialsModule\n delete Delete a webauthnCredentialsModule\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) => { +const usage = + '\nwebauthn-credentials-module \n\nCommands:\n list List webauthnCredentialsModule records\n find-first Find first matching webauthnCredentialsModule record\n get Get a webauthnCredentialsModule by ID\n create Create a new webauthnCredentialsModule\n update Update an existing webauthnCredentialsModule\n delete Delete a webauthnCredentialsModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,22 @@ async function handleList(argv: Partial>, _prompter: Inq privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: WebauthnCredentialsModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy + > & { + select: WebauthnCredentialsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webauthnCredentialsModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +118,22 @@ async function handleFindFirst(argv: Partial>, _prompter privateSchemaId: true, schemaId: true, tableId: true, - tableName: true + tableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: WebauthnCredentialsModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy + > & { + select: WebauthnCredentialsModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webauthnCredentialsModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +142,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.webauthnCredentialsModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.webauthnCredentialsModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,83 +178,97 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateWebauthnCredentialsModuleInput["webauthnCredentialsModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateWebauthnCredentialsModuleInput['webauthnCredentialsModule']; const client = getClient(); - const result = await client.webauthnCredentialsModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.webauthnCredentialsModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -233,91 +277,103 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "ownerTableId", - message: "ownerTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableId", - message: "tableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "tableName", - message: "tableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'ownerTableId', + message: 'ownerTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableId', + message: 'tableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tableName', + message: 'tableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as WebauthnCredentialsModulePatch; const client = getClient(); - const result = await client.webauthnCredentialsModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - ownerTableId: cleanedData.ownerTableId, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - schemaId: cleanedData.schemaId, - tableId: cleanedData.tableId, - tableName: cleanedData.tableName - }, - select: { - apiName: true, - databaseId: true, - id: true, - ownerTableId: true, - privateApiName: true, - privateSchemaId: true, - schemaId: true, - tableId: true, - tableName: true - } - }).execute(); + const result = await client.webauthnCredentialsModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + ownerTableId: cleanedData.ownerTableId, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + schemaId: cleanedData.schemaId, + tableId: cleanedData.tableId, + tableName: cleanedData.tableName, + }, + select: { + apiName: true, + databaseId: true, + id: true, + ownerTableId: true, + privateApiName: true, + privateSchemaId: true, + schemaId: true, + tableId: true, + tableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -326,28 +382,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.webauthnCredentialsModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.webauthnCredentialsModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/webhook-module.ts b/sdk/constructive-cli/src/modules/cli/commands/webhook-module.ts index 552d2fd673..6d916132ed 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/webhook-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/webhook-module.ts @@ -3,71 +3,85 @@ * @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 { CreateWebhookModuleInput, WebhookModulePatch, WebhookModuleSelect, WebhookModuleFilter, WebhookModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateWebhookModuleInput, + WebhookModulePatch, + WebhookModuleSelect, + WebhookModuleFilter, + WebhookModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - apiName: "string", - databaseId: "uuid", - defaultPermissions: "string", - entityField: "string", - entityTableId: "uuid", - functionInvocationModuleId: "uuid", - functionModuleId: "uuid", - id: "uuid", - infraSecretsModuleId: "uuid", - namespaceModuleId: "uuid", - policies: "json", - prefix: "string", - privateApiName: "string", - privateSchemaId: "uuid", - privateSchemaName: "string", - provisions: "json", - publicSchemaName: "string", - schemaId: "uuid", - scope: "string", - webhookEndpointsTableId: "uuid", - webhookEndpointsTableName: "string", - webhookEventsTableId: "uuid", - webhookEventsTableName: "string" + apiName: 'string', + databaseId: 'uuid', + defaultPermissions: 'string', + entityField: 'string', + entityTableId: 'uuid', + functionInvocationModuleId: 'uuid', + functionModuleId: 'uuid', + id: 'uuid', + infraSecretsModuleId: 'uuid', + namespaceModuleId: 'uuid', + policies: 'json', + prefix: 'string', + privateApiName: 'string', + privateSchemaId: 'uuid', + privateSchemaName: 'string', + provisions: 'json', + publicSchemaName: 'string', + schemaId: 'uuid', + scope: 'string', + webhookEndpointsTableId: 'uuid', + webhookEndpointsTableName: 'string', + webhookEventsTableId: 'uuid', + webhookEventsTableName: 'string', }; -const usage = "\nwebhook-module \n\nCommands:\n list List webhookModule records\n find-first Find first matching webhookModule record\n get Get a webhookModule by ID\n create Create a new webhookModule\n update Update an existing webhookModule\n delete Delete a webhookModule\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) => { +const usage = + '\nwebhook-module \n\nCommands:\n list List webhookModule records\n find-first Find first matching webhookModule record\n get Get a webhookModule by ID\n create Create a new webhookModule\n update Update an existing webhookModule\n delete Delete a webhookModule\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -99,16 +113,18 @@ async function handleList(argv: Partial>, _prompter: Inq webhookEndpointsTableId: true, webhookEndpointsTableName: true, webhookEventsTableId: true, - webhookEventsTableName: true + webhookEventsTableName: true, }; - const findManyArgs = parseFindManyArgs & { - select: WebhookModuleSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: WebhookModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webhookModule.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -140,16 +156,18 @@ async function handleFindFirst(argv: Partial>, _prompter webhookEndpointsTableId: true, webhookEndpointsTableName: true, webhookEventsTableId: true, - webhookEventsTableName: true + webhookEventsTableName: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: WebhookModuleSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: WebhookModuleSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.webhookModule.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -158,44 +176,48 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.webhookModule.findOne({ - id: answers.id as string, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - functionInvocationModuleId: true, - functionModuleId: true, - id: true, - infraSecretsModuleId: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - webhookEndpointsTableId: true, - webhookEndpointsTableName: true, - webhookEventsTableId: true, - webhookEventsTableName: true - } - }).execute(); + const result = await client.webhookModule + .findOne({ + id: answers.id as string, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + functionInvocationModuleId: true, + functionModuleId: true, + id: true, + infraSecretsModuleId: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + webhookEndpointsTableId: true, + webhookEndpointsTableName: true, + webhookEventsTableId: true, + webhookEventsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -204,194 +226,222 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionInvocationModuleId", - message: "functionInvocationModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionModuleId", - message: "functionModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "infraSecretsModuleId", - message: "infraSecretsModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceModuleId", - message: "namespaceModuleId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: true - }, { - type: "text", - name: "webhookEndpointsTableId", - message: "webhookEndpointsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webhookEndpointsTableName", - message: "webhookEndpointsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webhookEventsTableId", - message: "webhookEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webhookEventsTableName", - message: "webhookEventsTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionInvocationModuleId', + message: 'functionInvocationModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionModuleId', + message: 'functionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'infraSecretsModuleId', + message: 'infraSecretsModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceModuleId', + message: 'namespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'webhookEndpointsTableId', + message: 'webhookEndpointsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webhookEndpointsTableName', + message: 'webhookEndpointsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webhookEventsTableId', + message: 'webhookEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webhookEventsTableName', + message: 'webhookEventsTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateWebhookModuleInput["webhookModule"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateWebhookModuleInput['webhookModule']; const client = getClient(); - const result = await client.webhookModule.create({ - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - functionInvocationModuleId: cleanedData.functionInvocationModuleId, - functionModuleId: cleanedData.functionModuleId, - infraSecretsModuleId: cleanedData.infraSecretsModuleId, - namespaceModuleId: cleanedData.namespaceModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - webhookEndpointsTableId: cleanedData.webhookEndpointsTableId, - webhookEndpointsTableName: cleanedData.webhookEndpointsTableName, - webhookEventsTableId: cleanedData.webhookEventsTableId, - webhookEventsTableName: cleanedData.webhookEventsTableName - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - functionInvocationModuleId: true, - functionModuleId: true, - id: true, - infraSecretsModuleId: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - webhookEndpointsTableId: true, - webhookEndpointsTableName: true, - webhookEventsTableId: true, - webhookEventsTableName: true - } - }).execute(); + const result = await client.webhookModule + .create({ + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + functionInvocationModuleId: cleanedData.functionInvocationModuleId, + functionModuleId: cleanedData.functionModuleId, + infraSecretsModuleId: cleanedData.infraSecretsModuleId, + namespaceModuleId: cleanedData.namespaceModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + webhookEndpointsTableId: cleanedData.webhookEndpointsTableId, + webhookEndpointsTableName: cleanedData.webhookEndpointsTableName, + webhookEventsTableId: cleanedData.webhookEventsTableId, + webhookEventsTableName: cleanedData.webhookEventsTableName, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + functionInvocationModuleId: true, + functionModuleId: true, + id: true, + infraSecretsModuleId: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + webhookEndpointsTableId: true, + webhookEndpointsTableName: true, + webhookEventsTableId: true, + webhookEventsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -400,202 +450,228 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "apiName", - message: "apiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: false - }, { - type: "text", - name: "defaultPermissions", - message: "defaultPermissions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityField", - message: "entityField", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityTableId", - message: "entityTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionInvocationModuleId", - message: "functionInvocationModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "functionModuleId", - message: "functionModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "infraSecretsModuleId", - message: "infraSecretsModuleId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "namespaceModuleId", - message: "namespaceModuleId", - required: false, - skipPrompt: true - }, { - type: "json", - name: "policies", - message: "policies", - required: false, - skipPrompt: true - }, { - type: "text", - name: "prefix", - message: "prefix", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateApiName", - message: "privateApiName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaId", - message: "privateSchemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "privateSchemaName", - message: "privateSchemaName", - required: false, - skipPrompt: true - }, { - type: "json", - name: "provisions", - message: "provisions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "publicSchemaName", - message: "publicSchemaName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "schemaId", - message: "schemaId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "scope", - message: "scope", - required: false - }, { - type: "text", - name: "webhookEndpointsTableId", - message: "webhookEndpointsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webhookEndpointsTableName", - message: "webhookEndpointsTableName", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webhookEventsTableId", - message: "webhookEventsTableId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "webhookEventsTableName", - message: "webhookEventsTableName", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityField', + message: 'entityField', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionInvocationModuleId', + message: 'functionInvocationModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionModuleId', + message: 'functionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'infraSecretsModuleId', + message: 'infraSecretsModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceModuleId', + message: 'namespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'webhookEndpointsTableId', + message: 'webhookEndpointsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webhookEndpointsTableName', + message: 'webhookEndpointsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webhookEventsTableId', + message: 'webhookEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'webhookEventsTableName', + message: 'webhookEventsTableName', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as WebhookModulePatch; const client = getClient(); - const result = await client.webhookModule.update({ - where: { - id: answers.id as string - }, - data: { - apiName: cleanedData.apiName, - databaseId: cleanedData.databaseId, - defaultPermissions: cleanedData.defaultPermissions, - entityField: cleanedData.entityField, - entityTableId: cleanedData.entityTableId, - functionInvocationModuleId: cleanedData.functionInvocationModuleId, - functionModuleId: cleanedData.functionModuleId, - infraSecretsModuleId: cleanedData.infraSecretsModuleId, - namespaceModuleId: cleanedData.namespaceModuleId, - policies: cleanedData.policies, - prefix: cleanedData.prefix, - privateApiName: cleanedData.privateApiName, - privateSchemaId: cleanedData.privateSchemaId, - privateSchemaName: cleanedData.privateSchemaName, - provisions: cleanedData.provisions, - publicSchemaName: cleanedData.publicSchemaName, - schemaId: cleanedData.schemaId, - scope: cleanedData.scope, - webhookEndpointsTableId: cleanedData.webhookEndpointsTableId, - webhookEndpointsTableName: cleanedData.webhookEndpointsTableName, - webhookEventsTableId: cleanedData.webhookEventsTableId, - webhookEventsTableName: cleanedData.webhookEventsTableName - }, - select: { - apiName: true, - databaseId: true, - defaultPermissions: true, - entityField: true, - entityTableId: true, - functionInvocationModuleId: true, - functionModuleId: true, - id: true, - infraSecretsModuleId: true, - namespaceModuleId: true, - policies: true, - prefix: true, - privateApiName: true, - privateSchemaId: true, - privateSchemaName: true, - provisions: true, - publicSchemaName: true, - schemaId: true, - scope: true, - webhookEndpointsTableId: true, - webhookEndpointsTableName: true, - webhookEventsTableId: true, - webhookEventsTableName: true - } - }).execute(); + const result = await client.webhookModule + .update({ + where: { + id: answers.id as string, + }, + data: { + apiName: cleanedData.apiName, + databaseId: cleanedData.databaseId, + defaultPermissions: cleanedData.defaultPermissions, + entityField: cleanedData.entityField, + entityTableId: cleanedData.entityTableId, + functionInvocationModuleId: cleanedData.functionInvocationModuleId, + functionModuleId: cleanedData.functionModuleId, + infraSecretsModuleId: cleanedData.infraSecretsModuleId, + namespaceModuleId: cleanedData.namespaceModuleId, + policies: cleanedData.policies, + prefix: cleanedData.prefix, + privateApiName: cleanedData.privateApiName, + privateSchemaId: cleanedData.privateSchemaId, + privateSchemaName: cleanedData.privateSchemaName, + provisions: cleanedData.provisions, + publicSchemaName: cleanedData.publicSchemaName, + schemaId: cleanedData.schemaId, + scope: cleanedData.scope, + webhookEndpointsTableId: cleanedData.webhookEndpointsTableId, + webhookEndpointsTableName: cleanedData.webhookEndpointsTableName, + webhookEventsTableId: cleanedData.webhookEventsTableId, + webhookEventsTableName: cleanedData.webhookEventsTableName, + }, + select: { + apiName: true, + databaseId: true, + defaultPermissions: true, + entityField: true, + entityTableId: true, + functionInvocationModuleId: true, + functionModuleId: true, + id: true, + infraSecretsModuleId: true, + namespaceModuleId: true, + policies: true, + prefix: true, + privateApiName: true, + privateSchemaId: true, + privateSchemaName: true, + provisions: true, + publicSchemaName: true, + schemaId: true, + scope: true, + webhookEndpointsTableId: true, + webhookEndpointsTableName: true, + webhookEventsTableId: true, + webhookEventsTableName: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -604,28 +680,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.webhookModule.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.webhookModule + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/executor.ts b/sdk/constructive-cli/src/modules/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/modules/cli/executor.ts +++ b/sdk/constructive-cli/src/modules/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/cli/index.ts b/sdk/constructive-cli/src/modules/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/modules/cli/index.ts +++ b/sdk/constructive-cli/src/modules/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/modules/cli/utils.ts b/sdk/constructive-cli/src/modules/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/modules/cli/utils.ts +++ b/sdk/constructive-cli/src/modules/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/modules/index.ts b/sdk/constructive-cli/src/modules/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/modules/index.ts +++ b/sdk/constructive-cli/src/modules/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/modules/orm/client.ts b/sdk/constructive-cli/src/modules/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/modules/orm/client.ts +++ b/sdk/constructive-cli/src/modules/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/modules/orm/index.ts b/sdk/constructive-cli/src/modules/orm/index.ts index e1606d62ad..f50345da8b 100644 --- a/sdk/constructive-cli/src/modules/orm/index.ts +++ b/sdk/constructive-cli/src/modules/orm/index.ts @@ -3,92 +3,92 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AgentModuleModel } from "./models/agentModule"; -import { ApiSurfaceModuleModel } from "./models/apiSurfaceModule"; -import { AppModuleModel } from "./models/appModule"; -import { BillingModuleModel } from "./models/billingModule"; -import { BillingProviderModuleModel } from "./models/billingProviderModule"; -import { BlueprintModel } from "./models/blueprint"; -import { BlueprintConstructionModel } from "./models/blueprintConstruction"; -import { BlueprintTemplateModel } from "./models/blueprintTemplate"; -import { CatalogModuleModel } from "./models/catalogModule"; -import { ComputeLogModuleModel } from "./models/computeLogModule"; -import { ConfigSecretsUserModuleModel } from "./models/configSecretsUserModule"; -import { ConnectedAccountsModuleModel } from "./models/connectedAccountsModule"; -import { CryptoAddressesModuleModel } from "./models/cryptoAddressesModule"; -import { CryptoAuthModuleModel } from "./models/cryptoAuthModule"; -import { DatabaseProvisionModuleModel } from "./models/databaseProvisionModule"; -import { DatabaseSettingsModuleModel } from "./models/databaseSettingsModule"; -import { DbPoolConfigModel } from "./models/dbPoolConfig"; -import { DbPoolModel } from "./models/dbPool"; -import { DbPresetModuleModel } from "./models/dbPresetModule"; -import { DbUsageModuleModel } from "./models/dbUsageModule"; -import { DefaultIdsModuleModel } from "./models/defaultIdsModule"; -import { DenormalizedTableFieldModel } from "./models/denormalizedTableField"; -import { DevicesModuleModel } from "./models/devicesModule"; -import { DomainModuleModel } from "./models/domainModule"; -import { EmailsModuleModel } from "./models/emailsModule"; -import { EntityTypeProvisionModel } from "./models/entityTypeProvision"; -import { EventsModuleModel } from "./models/eventsModule"; -import { FunctionDeploymentModuleModel } from "./models/functionDeploymentModule"; -import { FunctionInvocationModuleModel } from "./models/functionInvocationModule"; -import { FunctionModuleModel } from "./models/functionModule"; -import { GraphExecutionModuleModel } from "./models/graphExecutionModule"; -import { GraphModuleModel } from "./models/graphModule"; -import { HierarchyModuleModel } from "./models/hierarchyModule"; -import { HttpRouteModuleModel } from "./models/httpRouteModule"; -import { I18NModuleModel } from "./models/i18NModule"; -import { IdentityProvidersModuleModel } from "./models/identityProvidersModule"; -import { InferenceLogModuleModel } from "./models/inferenceLogModule"; -import { InfraConfigModuleModel } from "./models/infraConfigModule"; -import { InfraSecretsModuleModel } from "./models/infraSecretsModule"; -import { IntegrationProvidersModuleModel } from "./models/integrationProvidersModule"; -import { InternalSecretsModuleModel } from "./models/internalSecretsModule"; -import { InvitesModuleModel } from "./models/invitesModule"; -import { LimitsModuleModel } from "./models/limitsModule"; -import { MembershipTypesModuleModel } from "./models/membershipTypesModule"; -import { MembershipsModuleModel } from "./models/membershipsModule"; -import { MerkleStoreModuleModel } from "./models/merkleStoreModule"; -import { NamespaceModuleModel } from "./models/namespaceModule"; -import { NotificationsModuleModel } from "./models/notificationsModule"; -import { PermissionsModuleModel } from "./models/permissionsModule"; -import { PhoneNumbersModuleModel } from "./models/phoneNumbersModule"; -import { PlansModuleModel } from "./models/plansModule"; -import { PrincipalAuthModuleModel } from "./models/principalAuthModule"; -import { ProfilesModuleModel } from "./models/profilesModule"; -import { RateLimitMetersModuleModel } from "./models/rateLimitMetersModule"; -import { RateLimitsModuleModel } from "./models/rateLimitsModule"; -import { RealtimeModuleModel } from "./models/realtimeModule"; -import { RelationProvisionModel } from "./models/relationProvision"; -import { ResourceModuleModel } from "./models/resourceModule"; -import { RlsModuleModel } from "./models/rlsModule"; -import { RouteModuleModel } from "./models/routeModule"; -import { SecureTableProvisionModel } from "./models/secureTableProvision"; -import { SessionSecretsModuleModel } from "./models/sessionSecretsModule"; -import { SessionsModuleModel } from "./models/sessionsModule"; -import { SiteSurfaceModuleModel } from "./models/siteSurfaceModule"; -import { StorageLogModuleModel } from "./models/storageLogModule"; -import { StorageModuleModel } from "./models/storageModule"; -import { TransferLogModuleModel } from "./models/transferLogModule"; -import { UserAuthModuleModel } from "./models/userAuthModule"; -import { UserCredentialsModuleModel } from "./models/userCredentialsModule"; -import { UserSettingsModuleModel } from "./models/userSettingsModule"; -import { UserStateModuleModel } from "./models/userStateModule"; -import { UsersModuleModel } from "./models/usersModule"; -import { WebauthnAuthModuleModel } from "./models/webauthnAuthModule"; -import { WebauthnCredentialsModuleModel } from "./models/webauthnCredentialsModule"; -import { WebhookModuleModel } from "./models/webhookModule"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AgentModuleModel } from './models/agentModule'; +import { ApiSurfaceModuleModel } from './models/apiSurfaceModule'; +import { AppModuleModel } from './models/appModule'; +import { BillingModuleModel } from './models/billingModule'; +import { BillingProviderModuleModel } from './models/billingProviderModule'; +import { BlueprintModel } from './models/blueprint'; +import { BlueprintConstructionModel } from './models/blueprintConstruction'; +import { BlueprintTemplateModel } from './models/blueprintTemplate'; +import { CatalogModuleModel } from './models/catalogModule'; +import { ComputeLogModuleModel } from './models/computeLogModule'; +import { ConfigSecretsUserModuleModel } from './models/configSecretsUserModule'; +import { ConnectedAccountsModuleModel } from './models/connectedAccountsModule'; +import { CryptoAddressesModuleModel } from './models/cryptoAddressesModule'; +import { CryptoAuthModuleModel } from './models/cryptoAuthModule'; +import { DatabaseProvisionModuleModel } from './models/databaseProvisionModule'; +import { DatabaseSettingsModuleModel } from './models/databaseSettingsModule'; +import { DbPoolConfigModel } from './models/dbPoolConfig'; +import { DbPoolModel } from './models/dbPool'; +import { DbPresetModuleModel } from './models/dbPresetModule'; +import { DbUsageModuleModel } from './models/dbUsageModule'; +import { DefaultIdsModuleModel } from './models/defaultIdsModule'; +import { DenormalizedTableFieldModel } from './models/denormalizedTableField'; +import { DevicesModuleModel } from './models/devicesModule'; +import { DomainModuleModel } from './models/domainModule'; +import { EmailsModuleModel } from './models/emailsModule'; +import { EntityTypeProvisionModel } from './models/entityTypeProvision'; +import { EventsModuleModel } from './models/eventsModule'; +import { FunctionDeploymentModuleModel } from './models/functionDeploymentModule'; +import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; +import { FunctionModuleModel } from './models/functionModule'; +import { GraphExecutionModuleModel } from './models/graphExecutionModule'; +import { GraphModuleModel } from './models/graphModule'; +import { HierarchyModuleModel } from './models/hierarchyModule'; +import { HttpRouteModuleModel } from './models/httpRouteModule'; +import { I18NModuleModel } from './models/i18NModule'; +import { IdentityProvidersModuleModel } from './models/identityProvidersModule'; +import { InferenceLogModuleModel } from './models/inferenceLogModule'; +import { InfraConfigModuleModel } from './models/infraConfigModule'; +import { InfraSecretsModuleModel } from './models/infraSecretsModule'; +import { IntegrationProvidersModuleModel } from './models/integrationProvidersModule'; +import { InternalSecretsModuleModel } from './models/internalSecretsModule'; +import { InvitesModuleModel } from './models/invitesModule'; +import { LimitsModuleModel } from './models/limitsModule'; +import { MembershipTypesModuleModel } from './models/membershipTypesModule'; +import { MembershipsModuleModel } from './models/membershipsModule'; +import { MerkleStoreModuleModel } from './models/merkleStoreModule'; +import { NamespaceModuleModel } from './models/namespaceModule'; +import { NotificationsModuleModel } from './models/notificationsModule'; +import { PermissionsModuleModel } from './models/permissionsModule'; +import { PhoneNumbersModuleModel } from './models/phoneNumbersModule'; +import { PlansModuleModel } from './models/plansModule'; +import { PrincipalAuthModuleModel } from './models/principalAuthModule'; +import { ProfilesModuleModel } from './models/profilesModule'; +import { RateLimitMetersModuleModel } from './models/rateLimitMetersModule'; +import { RateLimitsModuleModel } from './models/rateLimitsModule'; +import { RealtimeModuleModel } from './models/realtimeModule'; +import { RelationProvisionModel } from './models/relationProvision'; +import { ResourceModuleModel } from './models/resourceModule'; +import { RlsModuleModel } from './models/rlsModule'; +import { RouteModuleModel } from './models/routeModule'; +import { SecureTableProvisionModel } from './models/secureTableProvision'; +import { SessionSecretsModuleModel } from './models/sessionSecretsModule'; +import { SessionsModuleModel } from './models/sessionsModule'; +import { SiteSurfaceModuleModel } from './models/siteSurfaceModule'; +import { StorageLogModuleModel } from './models/storageLogModule'; +import { StorageModuleModel } from './models/storageModule'; +import { TransferLogModuleModel } from './models/transferLogModule'; +import { UserAuthModuleModel } from './models/userAuthModule'; +import { UserCredentialsModuleModel } from './models/userCredentialsModule'; +import { UserSettingsModuleModel } from './models/userSettingsModule'; +import { UserStateModuleModel } from './models/userStateModule'; +import { UsersModuleModel } from './models/usersModule'; +import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; +import { WebauthnCredentialsModuleModel } from './models/webauthnCredentialsModule'; +import { WebhookModuleModel } from './models/webhookModule'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -191,6 +191,6 @@ export function createClient(config: OrmClientConfig) { webauthnCredentialsModule: new WebauthnCredentialsModuleModel(client), webhookModule: new WebhookModuleModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/input-types.ts b/sdk/constructive-cli/src/modules/orm/input-types.ts index 14905979ef..c5c73d471c 100644 --- a/sdk/constructive-cli/src/modules/orm/input-types.ts +++ b/sdk/constructive-cli/src/modules/orm/input-types.ts @@ -2353,46 +2353,61 @@ export type AgentModuleWithRelations = AgentModule & AgentModuleRelations; export type ApiSurfaceModuleWithRelations = ApiSurfaceModule & ApiSurfaceModuleRelations; export type AppModuleWithRelations = AppModule & AppModuleRelations; export type BillingModuleWithRelations = BillingModule & BillingModuleRelations; -export type BillingProviderModuleWithRelations = BillingProviderModule & BillingProviderModuleRelations; +export type BillingProviderModuleWithRelations = BillingProviderModule & + BillingProviderModuleRelations; export type BlueprintWithRelations = Blueprint & BlueprintRelations; -export type BlueprintConstructionWithRelations = BlueprintConstruction & BlueprintConstructionRelations; +export type BlueprintConstructionWithRelations = BlueprintConstruction & + BlueprintConstructionRelations; export type BlueprintTemplateWithRelations = BlueprintTemplate & BlueprintTemplateRelations; export type CatalogModuleWithRelations = CatalogModule & CatalogModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; -export type ConfigSecretsUserModuleWithRelations = ConfigSecretsUserModule & ConfigSecretsUserModuleRelations; -export type ConnectedAccountsModuleWithRelations = ConnectedAccountsModule & ConnectedAccountsModuleRelations; -export type CryptoAddressesModuleWithRelations = CryptoAddressesModule & CryptoAddressesModuleRelations; +export type ConfigSecretsUserModuleWithRelations = ConfigSecretsUserModule & + ConfigSecretsUserModuleRelations; +export type ConnectedAccountsModuleWithRelations = ConnectedAccountsModule & + ConnectedAccountsModuleRelations; +export type CryptoAddressesModuleWithRelations = CryptoAddressesModule & + CryptoAddressesModuleRelations; export type CryptoAuthModuleWithRelations = CryptoAuthModule & CryptoAuthModuleRelations; -export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & DatabaseProvisionModuleRelations; -export type DatabaseSettingsModuleWithRelations = DatabaseSettingsModule & DatabaseSettingsModuleRelations; +export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & + DatabaseProvisionModuleRelations; +export type DatabaseSettingsModuleWithRelations = DatabaseSettingsModule & + DatabaseSettingsModuleRelations; export type DbPoolConfigWithRelations = DbPoolConfig & DbPoolConfigRelations; export type DbPoolWithRelations = DbPool & DbPoolRelations; export type DbPresetModuleWithRelations = DbPresetModule & DbPresetModuleRelations; export type DbUsageModuleWithRelations = DbUsageModule & DbUsageModuleRelations; export type DefaultIdsModuleWithRelations = DefaultIdsModule & DefaultIdsModuleRelations; -export type DenormalizedTableFieldWithRelations = DenormalizedTableField & DenormalizedTableFieldRelations; +export type DenormalizedTableFieldWithRelations = DenormalizedTableField & + DenormalizedTableFieldRelations; export type DevicesModuleWithRelations = DevicesModule & DevicesModuleRelations; export type DomainModuleWithRelations = DomainModule & DomainModuleRelations; export type EmailsModuleWithRelations = EmailsModule & EmailsModuleRelations; export type EntityTypeProvisionWithRelations = EntityTypeProvision & EntityTypeProvisionRelations; export type EventsModuleWithRelations = EventsModule & EventsModuleRelations; -export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & FunctionDeploymentModuleRelations; -export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; +export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & + FunctionDeploymentModuleRelations; +export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & + FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; -export type GraphExecutionModuleWithRelations = GraphExecutionModule & GraphExecutionModuleRelations; +export type GraphExecutionModuleWithRelations = GraphExecutionModule & + GraphExecutionModuleRelations; export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; export type HierarchyModuleWithRelations = HierarchyModule & HierarchyModuleRelations; export type HttpRouteModuleWithRelations = HttpRouteModule & HttpRouteModuleRelations; export type I18NModuleWithRelations = I18NModule & I18NModuleRelations; -export type IdentityProvidersModuleWithRelations = IdentityProvidersModule & IdentityProvidersModuleRelations; +export type IdentityProvidersModuleWithRelations = IdentityProvidersModule & + IdentityProvidersModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; export type InfraConfigModuleWithRelations = InfraConfigModule & InfraConfigModuleRelations; export type InfraSecretsModuleWithRelations = InfraSecretsModule & InfraSecretsModuleRelations; -export type IntegrationProvidersModuleWithRelations = IntegrationProvidersModule & IntegrationProvidersModuleRelations; -export type InternalSecretsModuleWithRelations = InternalSecretsModule & InternalSecretsModuleRelations; +export type IntegrationProvidersModuleWithRelations = IntegrationProvidersModule & + IntegrationProvidersModuleRelations; +export type InternalSecretsModuleWithRelations = InternalSecretsModule & + InternalSecretsModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; export type LimitsModuleWithRelations = LimitsModule & LimitsModuleRelations; -export type MembershipTypesModuleWithRelations = MembershipTypesModule & MembershipTypesModuleRelations; +export type MembershipTypesModuleWithRelations = MembershipTypesModule & + MembershipTypesModuleRelations; export type MembershipsModuleWithRelations = MembershipsModule & MembershipsModuleRelations; export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; @@ -2402,27 +2417,32 @@ export type PhoneNumbersModuleWithRelations = PhoneNumbersModule & PhoneNumbersM export type PlansModuleWithRelations = PlansModule & PlansModuleRelations; export type PrincipalAuthModuleWithRelations = PrincipalAuthModule & PrincipalAuthModuleRelations; export type ProfilesModuleWithRelations = ProfilesModule & ProfilesModuleRelations; -export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & RateLimitMetersModuleRelations; +export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & + RateLimitMetersModuleRelations; export type RateLimitsModuleWithRelations = RateLimitsModule & RateLimitsModuleRelations; export type RealtimeModuleWithRelations = RealtimeModule & RealtimeModuleRelations; export type RelationProvisionWithRelations = RelationProvision & RelationProvisionRelations; export type ResourceModuleWithRelations = ResourceModule & ResourceModuleRelations; export type RlsModuleWithRelations = RlsModule & RlsModuleRelations; export type RouteModuleWithRelations = RouteModule & RouteModuleRelations; -export type SecureTableProvisionWithRelations = SecureTableProvision & SecureTableProvisionRelations; -export type SessionSecretsModuleWithRelations = SessionSecretsModule & SessionSecretsModuleRelations; +export type SecureTableProvisionWithRelations = SecureTableProvision & + SecureTableProvisionRelations; +export type SessionSecretsModuleWithRelations = SessionSecretsModule & + SessionSecretsModuleRelations; export type SessionsModuleWithRelations = SessionsModule & SessionsModuleRelations; export type SiteSurfaceModuleWithRelations = SiteSurfaceModule & SiteSurfaceModuleRelations; export type StorageLogModuleWithRelations = StorageLogModule & StorageLogModuleRelations; export type StorageModuleWithRelations = StorageModule & StorageModuleRelations; export type TransferLogModuleWithRelations = TransferLogModule & TransferLogModuleRelations; export type UserAuthModuleWithRelations = UserAuthModule & UserAuthModuleRelations; -export type UserCredentialsModuleWithRelations = UserCredentialsModule & UserCredentialsModuleRelations; +export type UserCredentialsModuleWithRelations = UserCredentialsModule & + UserCredentialsModuleRelations; export type UserSettingsModuleWithRelations = UserSettingsModule & UserSettingsModuleRelations; export type UserStateModuleWithRelations = UserStateModule & UserStateModuleRelations; export type UsersModuleWithRelations = UsersModule & UsersModuleRelations; export type WebauthnAuthModuleWithRelations = WebauthnAuthModule & WebauthnAuthModuleRelations; -export type WebauthnCredentialsModuleWithRelations = WebauthnCredentialsModule & WebauthnCredentialsModuleRelations; +export type WebauthnCredentialsModuleWithRelations = WebauthnCredentialsModule & + WebauthnCredentialsModuleRelations; export type WebhookModuleWithRelations = WebhookModule & WebhookModuleRelations; // ============ Entity Select Types ============ export type AgentModuleSelect = { @@ -7544,81 +7564,3082 @@ export interface WebhookModuleFilter { webhookEventsTableName?: StringFilter; } // ============ OrderBy Types ============ -export type AgentModuleOrderBy = "AGENT_TABLE_ID_ASC" | "AGENT_TABLE_ID_DESC" | "AGENT_TABLE_NAME_ASC" | "AGENT_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HAS_AGENTS_ASC" | "HAS_AGENTS_DESC" | "HAS_PLANS_ASC" | "HAS_PLANS_DESC" | "HAS_RESOURCES_ASC" | "HAS_RESOURCES_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_TABLE_ID_ASC" | "MESSAGE_TABLE_ID_DESC" | "MESSAGE_TABLE_NAME_ASC" | "MESSAGE_TABLE_NAME_DESC" | "NATURAL" | "PERSONA_TABLE_ID_ASC" | "PERSONA_TABLE_ID_DESC" | "PERSONA_TABLE_NAME_ASC" | "PERSONA_TABLE_NAME_DESC" | "PLAN_TABLE_ID_ASC" | "PLAN_TABLE_ID_DESC" | "PLAN_TABLE_NAME_ASC" | "PLAN_TABLE_NAME_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROMPTS_TABLE_ID_ASC" | "PROMPTS_TABLE_ID_DESC" | "PROMPTS_TABLE_NAME_ASC" | "PROMPTS_TABLE_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RESOURCE_TABLE_ID_ASC" | "RESOURCE_TABLE_ID_DESC" | "RESOURCE_TABLE_NAME_ASC" | "RESOURCE_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SHARED_ASC" | "SHARED_DESC" | "TASK_TABLE_ID_ASC" | "TASK_TABLE_ID_DESC" | "TASK_TABLE_NAME_ASC" | "TASK_TABLE_NAME_DESC" | "THREAD_TABLE_ID_ASC" | "THREAD_TABLE_ID_DESC" | "THREAD_TABLE_NAME_ASC" | "THREAD_TABLE_NAME_DESC"; -export type ApiSurfaceModuleOrderBy = "APIS_TABLE_ID_ASC" | "APIS_TABLE_ID_DESC" | "APIS_TABLE_NAME_ASC" | "APIS_TABLE_NAME_DESC" | "API_MODULES_TABLE_ID_ASC" | "API_MODULES_TABLE_ID_DESC" | "API_MODULES_TABLE_NAME_ASC" | "API_MODULES_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "API_SCHEMAS_TABLE_ID_ASC" | "API_SCHEMAS_TABLE_ID_DESC" | "API_SCHEMAS_TABLE_NAME_ASC" | "API_SCHEMAS_TABLE_NAME_DESC" | "API_SETTINGS_TABLE_ID_ASC" | "API_SETTINGS_TABLE_ID_DESC" | "API_SETTINGS_TABLE_NAME_ASC" | "API_SETTINGS_TABLE_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "CORS_SETTINGS_TABLE_ID_ASC" | "CORS_SETTINGS_TABLE_ID_DESC" | "CORS_SETTINGS_TABLE_NAME_ASC" | "CORS_SETTINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type AppModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "APPS_TABLE_ID_ASC" | "APPS_TABLE_ID_DESC" | "APPS_TABLE_NAME_ASC" | "APPS_TABLE_NAME_DESC" | "APP_COMPONENTS_TABLE_ID_ASC" | "APP_COMPONENTS_TABLE_ID_DESC" | "APP_COMPONENTS_TABLE_NAME_ASC" | "APP_COMPONENTS_TABLE_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type BillingModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BALANCES_TABLE_ID_ASC" | "BALANCES_TABLE_ID_DESC" | "BALANCES_TABLE_NAME_ASC" | "BALANCES_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ID_ASC" | "ID_DESC" | "LEDGER_TABLE_ID_ASC" | "LEDGER_TABLE_ID_DESC" | "LEDGER_TABLE_NAME_ASC" | "LEDGER_TABLE_NAME_DESC" | "METERS_TABLE_ID_ASC" | "METERS_TABLE_ID_DESC" | "METERS_TABLE_NAME_ASC" | "METERS_TABLE_NAME_DESC" | "METER_CREDITS_TABLE_ID_ASC" | "METER_CREDITS_TABLE_ID_DESC" | "METER_CREDITS_TABLE_NAME_ASC" | "METER_CREDITS_TABLE_NAME_DESC" | "METER_DEFAULTS_TABLE_ID_ASC" | "METER_DEFAULTS_TABLE_ID_DESC" | "METER_DEFAULTS_TABLE_NAME_ASC" | "METER_DEFAULTS_TABLE_NAME_DESC" | "METER_SOURCES_TABLE_ID_ASC" | "METER_SOURCES_TABLE_ID_DESC" | "METER_SOURCES_TABLE_NAME_ASC" | "METER_SOURCES_TABLE_NAME_DESC" | "NATURAL" | "PLAN_SUBSCRIPTIONS_TABLE_ID_ASC" | "PLAN_SUBSCRIPTIONS_TABLE_ID_DESC" | "PLAN_SUBSCRIPTIONS_TABLE_NAME_ASC" | "PLAN_SUBSCRIPTIONS_TABLE_NAME_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RECORD_USAGE_FUNCTION_ASC" | "RECORD_USAGE_FUNCTION_DESC" | "ROLLUP_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_ASC" | "SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_DESC"; -export type BillingProviderModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BILLING_CUSTOMERS_TABLE_ID_ASC" | "BILLING_CUSTOMERS_TABLE_ID_DESC" | "BILLING_CUSTOMERS_TABLE_NAME_ASC" | "BILLING_CUSTOMERS_TABLE_NAME_DESC" | "BILLING_PRICES_TABLE_ID_ASC" | "BILLING_PRICES_TABLE_ID_DESC" | "BILLING_PRICES_TABLE_NAME_ASC" | "BILLING_PRICES_TABLE_NAME_DESC" | "BILLING_PRODUCTS_TABLE_ID_ASC" | "BILLING_PRODUCTS_TABLE_ID_DESC" | "BILLING_PRODUCTS_TABLE_NAME_ASC" | "BILLING_PRODUCTS_TABLE_NAME_DESC" | "BILLING_SUBSCRIPTIONS_TABLE_ID_ASC" | "BILLING_SUBSCRIPTIONS_TABLE_ID_DESC" | "BILLING_SUBSCRIPTIONS_TABLE_NAME_ASC" | "BILLING_SUBSCRIPTIONS_TABLE_NAME_DESC" | "BILLING_WEBHOOK_EVENTS_TABLE_ID_ASC" | "BILLING_WEBHOOK_EVENTS_TABLE_ID_DESC" | "BILLING_WEBHOOK_EVENTS_TABLE_NAME_ASC" | "BILLING_WEBHOOK_EVENTS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRICES_TABLE_ID_ASC" | "PRICES_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PROCESS_BILLING_EVENT_FUNCTION_ASC" | "PROCESS_BILLING_EVENT_FUNCTION_DESC" | "PRODUCTS_TABLE_ID_ASC" | "PRODUCTS_TABLE_ID_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SUBSCRIPTIONS_TABLE_ID_ASC" | "SUBSCRIPTIONS_TABLE_ID_DESC"; -export type BlueprintOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DEFINITION_HASH_ASC" | "DEFINITION_HASH_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_HASHES_ASC" | "TABLE_HASHES_DESC" | "TEMPLATE_ID_ASC" | "TEMPLATE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type BlueprintConstructionOrderBy = "BLUEPRINT_ID_ASC" | "BLUEPRINT_ID_DESC" | "CONSTRUCTED_AT_ASC" | "CONSTRUCTED_AT_DESC" | "CONSTRUCTED_DEFINITION_ASC" | "CONSTRUCTED_DEFINITION_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_DETAILS_ASC" | "ERROR_DETAILS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TABLE_MAP_ASC" | "TABLE_MAP_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type BlueprintTemplateOrderBy = "CATEGORIES_ASC" | "CATEGORIES_DESC" | "COMPLEXITY_ASC" | "COMPLEXITY_DESC" | "COPY_COUNT_ASC" | "COPY_COUNT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DEFINITION_HASH_ASC" | "DEFINITION_HASH_DESC" | "DEFINITION_SCHEMA_VERSION_ASC" | "DEFINITION_SCHEMA_VERSION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "FORKED_FROM_ID_ASC" | "FORKED_FROM_ID_DESC" | "FORK_COUNT_ASC" | "FORK_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "TABLE_HASHES_ASC" | "TABLE_HASHES_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERSION_ASC" | "VERSION_DESC" | "VISIBILITY_ASC" | "VISIBILITY_DESC"; -export type CatalogModuleOrderBy = "APIS_TABLE_ID_ASC" | "APIS_TABLE_ID_DESC" | "APIS_TABLE_NAME_ASC" | "APIS_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "APPS_TABLE_ID_ASC" | "APPS_TABLE_ID_DESC" | "APPS_TABLE_NAME_ASC" | "APPS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAINS_TABLE_ID_ASC" | "DOMAINS_TABLE_ID_DESC" | "DOMAINS_TABLE_NAME_ASC" | "DOMAINS_TABLE_NAME_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTIONS_TABLE_ID_ASC" | "FUNCTIONS_TABLE_ID_DESC" | "FUNCTIONS_TABLE_NAME_ASC" | "FUNCTIONS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACES_TABLE_ID_ASC" | "NAMESPACES_TABLE_ID_DESC" | "NAMESPACES_TABLE_NAME_ASC" | "NAMESPACES_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOURCES_TABLE_ID_ASC" | "RESOURCES_TABLE_ID_DESC" | "RESOURCES_TABLE_NAME_ASC" | "RESOURCES_TABLE_NAME_DESC" | "RESOURCE_DEFINITIONS_TABLE_ID_ASC" | "RESOURCE_DEFINITIONS_TABLE_ID_DESC" | "RESOURCE_DEFINITIONS_TABLE_NAME_ASC" | "RESOURCE_DEFINITIONS_TABLE_NAME_DESC" | "RESOURCE_INSTALLATIONS_TABLE_ID_ASC" | "RESOURCE_INSTALLATIONS_TABLE_ID_DESC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_ASC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SITES_TABLE_ID_ASC" | "SITES_TABLE_ID_DESC" | "SITES_TABLE_NAME_ASC" | "SITES_TABLE_NAME_DESC"; -export type ComputeLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "COMPUTE_LOG_TABLE_ID_ASC" | "COMPUTE_LOG_TABLE_ID_DESC" | "COMPUTE_LOG_TABLE_NAME_ASC" | "COMPUTE_LOG_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type ConfigSecretsUserModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type ConnectedAccountsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type CryptoAddressesModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type CryptoAuthModuleOrderBy = "ADDRESSES_TABLE_ID_ASC" | "ADDRESSES_TABLE_ID_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SIGN_IN_RECORD_FAILURE_ASC" | "SIGN_IN_RECORD_FAILURE_DESC" | "SIGN_IN_REQUEST_CHALLENGE_ASC" | "SIGN_IN_REQUEST_CHALLENGE_DESC" | "SIGN_IN_WITH_CHALLENGE_ASC" | "SIGN_IN_WITH_CHALLENGE_DESC" | "SIGN_UP_WITH_KEY_ASC" | "SIGN_UP_WITH_KEY_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC" | "USER_FIELD_ASC" | "USER_FIELD_DESC"; -export type DatabaseProvisionModuleOrderBy = "ASYNC_ASC" | "ASYNC_DESC" | "BOOTSTRAP_ERROR_ASC" | "BOOTSTRAP_ERROR_DESC" | "BOOTSTRAP_STATUS_ASC" | "BOOTSTRAP_STATUS_DESC" | "BOOTSTRAP_USER_ASC" | "BOOTSTRAP_USER_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATABASE_NAME_ASC" | "DATABASE_NAME_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "FULFILLED_AT_ASC" | "FULFILLED_AT_DESC" | "ID_ASC" | "ID_DESC" | "MODULES_ASC" | "MODULES_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_DATABASE_ID_ASC" | "SOURCE_DATABASE_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SUBDOMAIN_ASC" | "SUBDOMAIN_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseSettingsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATABASE_SETTINGS_TABLE_ID_ASC" | "DATABASE_SETTINGS_TABLE_ID_DESC" | "DATABASE_SETTINGS_TABLE_NAME_ASC" | "DATABASE_SETTINGS_TABLE_NAME_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBKEY_SETTINGS_TABLE_ID_ASC" | "PUBKEY_SETTINGS_TABLE_ID_DESC" | "PUBKEY_SETTINGS_TABLE_NAME_ASC" | "PUBKEY_SETTINGS_TABLE_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RLS_SETTINGS_TABLE_ID_ASC" | "RLS_SETTINGS_TABLE_ID_DESC" | "RLS_SETTINGS_TABLE_NAME_ASC" | "RLS_SETTINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "WEBAUTHN_SETTINGS_TABLE_ID_ASC" | "WEBAUTHN_SETTINGS_TABLE_ID_DESC" | "WEBAUTHN_SETTINGS_TABLE_NAME_ASC" | "WEBAUTHN_SETTINGS_TABLE_NAME_DESC"; -export type DbPoolConfigOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ENABLED_ASC" | "ENABLED_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "MIN_ASC" | "MIN_DESC" | "NATURAL" | "POOL_OWNER_ID_ASC" | "POOL_OWNER_ID_DESC" | "PRESET_SLUG_ASC" | "PRESET_SLUG_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WARM_TTL_ASC" | "WARM_TTL_DESC"; -export type DbPoolOrderBy = "BOOTSTRAP_ERROR_ASC" | "BOOTSTRAP_ERROR_DESC" | "BOOTSTRAP_STATUS_ASC" | "BOOTSTRAP_STATUS_DESC" | "CLAIMED_AT_ASC" | "CLAIMED_AT_DESC" | "CLAIMED_BY_ASC" | "CLAIMED_BY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRESET_COMMIT_ID_ASC" | "PRESET_COMMIT_ID_DESC" | "PRESET_SLUG_ASC" | "PRESET_SLUG_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DbPresetModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DB_PRESETS_TABLE_ID_ASC" | "DB_PRESETS_TABLE_ID_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_ID_ASC" | "PUBLIC_SCHEMA_ID_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORE_NAME_ASC" | "STORE_NAME_DESC"; -export type DbUsageModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "COLLECT_DB_QUERY_STATS_FUNCTION_ASC" | "COLLECT_DB_QUERY_STATS_FUNCTION_DESC" | "COLLECT_DB_TABLE_STATS_FUNCTION_ASC" | "COLLECT_DB_TABLE_STATS_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "QUERY_STATS_LOG_TABLE_ID_ASC" | "QUERY_STATS_LOG_TABLE_ID_DESC" | "QUERY_STATS_LOG_TABLE_NAME_ASC" | "QUERY_STATS_LOG_TABLE_NAME_DESC" | "QUERY_STATS_SUMMARY_TABLE_ID_ASC" | "QUERY_STATS_SUMMARY_TABLE_ID_DESC" | "QUERY_STATS_SUMMARY_TABLE_NAME_ASC" | "QUERY_STATS_SUMMARY_TABLE_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_DESC" | "ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_STATS_LOG_TABLE_ID_ASC" | "TABLE_STATS_LOG_TABLE_ID_DESC" | "TABLE_STATS_LOG_TABLE_NAME_ASC" | "TABLE_STATS_LOG_TABLE_NAME_DESC" | "TABLE_STATS_SUMMARY_TABLE_ID_ASC" | "TABLE_STATS_SUMMARY_TABLE_ID_DESC" | "TABLE_STATS_SUMMARY_TABLE_NAME_ASC" | "TABLE_STATS_SUMMARY_TABLE_NAME_DESC"; -export type DefaultIdsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type DenormalizedTableFieldOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "FUNC_NAME_ASC" | "FUNC_NAME_DESC" | "FUNC_ORDER_ASC" | "FUNC_ORDER_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_ID_ASC" | "REF_FIELD_ID_DESC" | "REF_IDS_ASC" | "REF_IDS_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SET_IDS_ASC" | "SET_IDS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATE_DEFAULTS_ASC" | "UPDATE_DEFAULTS_DESC" | "USE_UPDATES_ASC" | "USE_UPDATES_DESC"; -export type DevicesModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEVICE_SETTINGS_TABLE_ID_ASC" | "DEVICE_SETTINGS_TABLE_ID_DESC" | "DEVICE_SETTINGS_TABLE_NAME_ASC" | "DEVICE_SETTINGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "USER_DEVICES_TABLE_ID_ASC" | "USER_DEVICES_TABLE_ID_DESC" | "USER_DEVICES_TABLE_NAME_ASC" | "USER_DEVICES_TABLE_NAME_DESC"; -export type DomainModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAINS_TABLE_ID_ASC" | "DOMAINS_TABLE_ID_DESC" | "DOMAINS_TABLE_NAME_ASC" | "DOMAINS_TABLE_NAME_DESC" | "DOMAIN_EVENTS_TABLE_ID_ASC" | "DOMAIN_EVENTS_TABLE_ID_DESC" | "DOMAIN_EVENTS_TABLE_NAME_ASC" | "DOMAIN_EVENTS_TABLE_NAME_DESC" | "DOMAIN_VERIFICATIONS_TABLE_ID_ASC" | "DOMAIN_VERIFICATIONS_TABLE_ID_DESC" | "DOMAIN_VERIFICATIONS_TABLE_NAME_ASC" | "DOMAIN_VERIFICATIONS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAINS_TABLE_ID_ASC" | "MANAGED_DOMAINS_TABLE_ID_DESC" | "MANAGED_DOMAINS_TABLE_NAME_ASC" | "MANAGED_DOMAINS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type EmailsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type EntityTypeProvisionOrderBy = "AGENTS_ASC" | "AGENTS_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FUNCTIONS_ASC" | "FUNCTIONS_DESC" | "GRAPHS_ASC" | "GRAPHS_DESC" | "HAS_INVITES_ASC" | "HAS_INVITES_DESC" | "HAS_INVITE_ACHIEVEMENTS_ASC" | "HAS_INVITE_ACHIEVEMENTS_DESC" | "HAS_LEVELS_ASC" | "HAS_LEVELS_DESC" | "HAS_LIMITS_ASC" | "HAS_LIMITS_DESC" | "HAS_PROFILES_ASC" | "HAS_PROFILES_DESC" | "ID_ASC" | "ID_DESC" | "IS_VISIBLE_ASC" | "IS_VISIBLE_DESC" | "NAMESPACES_ASC" | "NAMESPACES_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUT_AGENT_MODULE_ID_ASC" | "OUT_AGENT_MODULE_ID_DESC" | "OUT_BUCKETS_TABLE_ID_ASC" | "OUT_BUCKETS_TABLE_ID_DESC" | "OUT_DEFINITIONS_TABLE_ID_ASC" | "OUT_DEFINITIONS_TABLE_ID_DESC" | "OUT_ENTITY_TABLE_ID_ASC" | "OUT_ENTITY_TABLE_ID_DESC" | "OUT_ENTITY_TABLE_NAME_ASC" | "OUT_ENTITY_TABLE_NAME_DESC" | "OUT_EXECUTION_LOGS_TABLE_ID_ASC" | "OUT_EXECUTION_LOGS_TABLE_ID_DESC" | "OUT_FILES_TABLE_ID_ASC" | "OUT_FILES_TABLE_ID_DESC" | "OUT_FUNCTION_MODULE_ID_ASC" | "OUT_FUNCTION_MODULE_ID_DESC" | "OUT_GRAPHS_TABLE_ID_ASC" | "OUT_GRAPHS_TABLE_ID_DESC" | "OUT_GRAPH_MODULE_ID_ASC" | "OUT_GRAPH_MODULE_ID_DESC" | "OUT_INSTALLED_MODULES_ASC" | "OUT_INSTALLED_MODULES_DESC" | "OUT_INVITES_MODULE_ID_ASC" | "OUT_INVITES_MODULE_ID_DESC" | "OUT_INVOCATIONS_TABLE_ID_ASC" | "OUT_INVOCATIONS_TABLE_ID_DESC" | "OUT_MEMBERSHIP_TYPE_ASC" | "OUT_MEMBERSHIP_TYPE_DESC" | "OUT_NAMESPACES_TABLE_ID_ASC" | "OUT_NAMESPACES_TABLE_ID_DESC" | "OUT_NAMESPACE_EVENTS_TABLE_ID_ASC" | "OUT_NAMESPACE_EVENTS_TABLE_ID_DESC" | "OUT_NAMESPACE_MODULE_ID_ASC" | "OUT_NAMESPACE_MODULE_ID_DESC" | "OUT_PATH_SHARES_TABLE_ID_ASC" | "OUT_PATH_SHARES_TABLE_ID_DESC" | "OUT_STORAGE_MODULE_ID_ASC" | "OUT_STORAGE_MODULE_ID_DESC" | "PARENT_ENTITY_ASC" | "PARENT_ENTITY_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SKIP_ENTITY_POLICIES_ASC" | "SKIP_ENTITY_POLICIES_DESC" | "STORAGE_ASC" | "STORAGE_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "TABLE_PROVISION_ASC" | "TABLE_PROVISION_DESC"; -export type EventsModuleOrderBy = "ACHIEVEMENT_REWARDS_TABLE_ID_ASC" | "ACHIEVEMENT_REWARDS_TABLE_ID_DESC" | "ACHIEVEMENT_REWARDS_TABLE_NAME_ASC" | "ACHIEVEMENT_REWARDS_TABLE_NAME_DESC" | "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EVENTS_TABLE_ID_ASC" | "EVENTS_TABLE_ID_DESC" | "EVENTS_TABLE_NAME_ASC" | "EVENTS_TABLE_NAME_DESC" | "EVENT_AGGREGATES_TABLE_ID_ASC" | "EVENT_AGGREGATES_TABLE_ID_DESC" | "EVENT_AGGREGATES_TABLE_NAME_ASC" | "EVENT_AGGREGATES_TABLE_NAME_DESC" | "EVENT_TYPES_TABLE_ID_ASC" | "EVENT_TYPES_TABLE_ID_DESC" | "EVENT_TYPES_TABLE_NAME_ASC" | "EVENT_TYPES_TABLE_NAME_DESC" | "GRANT_ACHIEVEMENT_ASC" | "GRANT_ACHIEVEMENT_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "LEVELS_TABLE_ID_ASC" | "LEVELS_TABLE_ID_DESC" | "LEVELS_TABLE_NAME_ASC" | "LEVELS_TABLE_NAME_DESC" | "LEVEL_ACHIEVED_ASC" | "LEVEL_ACHIEVED_DESC" | "LEVEL_GRANTS_TABLE_ID_ASC" | "LEVEL_GRANTS_TABLE_ID_DESC" | "LEVEL_GRANTS_TABLE_NAME_ASC" | "LEVEL_GRANTS_TABLE_NAME_DESC" | "LEVEL_REQUIREMENTS_TABLE_ID_ASC" | "LEVEL_REQUIREMENTS_TABLE_ID_DESC" | "LEVEL_REQUIREMENTS_TABLE_NAME_ASC" | "LEVEL_REQUIREMENTS_TABLE_NAME_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RECORD_EVENT_ASC" | "RECORD_EVENT_DESC" | "REMOVE_EVENT_ASC" | "REMOVE_EVENT_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STEPS_REQUIRED_ASC" | "STEPS_REQUIRED_DESC" | "TG_ACHIEVEMENT_REWARD_ASC" | "TG_ACHIEVEMENT_REWARD_DESC" | "TG_CHECK_ACHIEVEMENTS_ASC" | "TG_CHECK_ACHIEVEMENTS_DESC" | "TG_EVENT_ASC" | "TG_EVENT_BOOL_ASC" | "TG_EVENT_BOOL_DESC" | "TG_EVENT_DESC" | "TG_EVENT_TOGGLE_ASC" | "TG_EVENT_TOGGLE_BOOL_ASC" | "TG_EVENT_TOGGLE_BOOL_DESC" | "TG_EVENT_TOGGLE_DESC" | "TG_UPDATE_AGGREGATES_ASC" | "TG_UPDATE_AGGREGATES_DESC" | "UPSERT_AGGREGATE_ASC" | "UPSERT_AGGREGATE_DESC"; -export type FunctionDeploymentModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DEPLOYMENTS_TABLE_ID_ASC" | "DEPLOYMENTS_TABLE_ID_DESC" | "DEPLOYMENTS_TABLE_NAME_ASC" | "DEPLOYMENTS_TABLE_NAME_DESC" | "DEPLOYMENT_EVENTS_TABLE_ID_ASC" | "DEPLOYMENT_EVENTS_TABLE_ID_DESC" | "DEPLOYMENT_EVENTS_TABLE_NAME_ASC" | "DEPLOYMENT_EVENTS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type FunctionInvocationModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "ATTEMPTS_TABLE_ID_ASC" | "ATTEMPTS_TABLE_ID_DESC" | "ATTEMPTS_TABLE_NAME_ASC" | "ATTEMPTS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EXECUTION_LOGS_TABLE_ID_ASC" | "EXECUTION_LOGS_TABLE_ID_DESC" | "EXECUTION_LOGS_TABLE_NAME_ASC" | "EXECUTION_LOGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATIONS_TABLE_ID_ASC" | "INVOCATIONS_TABLE_ID_DESC" | "INVOCATIONS_TABLE_NAME_ASC" | "INVOCATIONS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type FunctionModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BINDINGS_TABLE_ID_ASC" | "BINDINGS_TABLE_ID_DESC" | "BINDINGS_TABLE_NAME_ASC" | "BINDINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DEFINITIONS_TABLE_ID_ASC" | "DEFINITIONS_TABLE_ID_DESC" | "DEFINITIONS_TABLE_NAME_ASC" | "DEFINITIONS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HAS_CRON_ASC" | "HAS_CRON_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEDULES_TABLE_ID_ASC" | "SCHEDULES_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type GraphExecutionModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EXECUTIONS_TABLE_ID_ASC" | "EXECUTIONS_TABLE_ID_DESC" | "EXECUTIONS_TABLE_NAME_ASC" | "EXECUTIONS_TABLE_NAME_DESC" | "GRAPH_MODULE_ID_ASC" | "GRAPH_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODE_STATES_TABLE_ID_ASC" | "NODE_STATES_TABLE_ID_DESC" | "NODE_STATES_TABLE_NAME_ASC" | "NODE_STATES_TABLE_NAME_DESC" | "OUTPUTS_TABLE_ID_ASC" | "OUTPUTS_TABLE_ID_DESC" | "OUTPUTS_TABLE_NAME_ASC" | "OUTPUTS_TABLE_NAME_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type GraphModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GRAPHS_TABLE_ID_ASC" | "GRAPHS_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_ID_ASC" | "PUBLIC_SCHEMA_ID_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type HierarchyModuleOrderBy = "CHART_EDGES_TABLE_ID_ASC" | "CHART_EDGES_TABLE_ID_DESC" | "CHART_EDGES_TABLE_NAME_ASC" | "CHART_EDGES_TABLE_NAME_DESC" | "CHART_EDGE_GRANTS_TABLE_ID_ASC" | "CHART_EDGE_GRANTS_TABLE_ID_DESC" | "CHART_EDGE_GRANTS_TABLE_NAME_ASC" | "CHART_EDGE_GRANTS_TABLE_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GET_MANAGERS_FUNCTION_ASC" | "GET_MANAGERS_FUNCTION_DESC" | "GET_SUBORDINATES_FUNCTION_ASC" | "GET_SUBORDINATES_FUNCTION_DESC" | "HIERARCHY_SPRT_TABLE_ID_ASC" | "HIERARCHY_SPRT_TABLE_ID_DESC" | "HIERARCHY_SPRT_TABLE_NAME_ASC" | "HIERARCHY_SPRT_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_MANAGER_OF_FUNCTION_ASC" | "IS_MANAGER_OF_FUNCTION_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "REBUILD_HIERARCHY_FUNCTION_ASC" | "REBUILD_HIERARCHY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SPRT_TABLE_NAME_ASC" | "SPRT_TABLE_NAME_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type HttpRouteModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "HTTP_ROUTES_TABLE_ID_ASC" | "HTTP_ROUTES_TABLE_ID_DESC" | "HTTP_ROUTES_TABLE_NAME_ASC" | "HTTP_ROUTES_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVER_FUNCTION_NAME_ASC" | "RESOLVER_FUNCTION_NAME_DESC" | "RESOURCE_MODULE_ID_ASC" | "RESOURCE_MODULE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORAGE_MODULE_ID_ASC" | "STORAGE_MODULE_ID_DESC"; -export type I18NModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SETTINGS_TABLE_ID_ASC" | "SETTINGS_TABLE_ID_DESC"; -export type IdentityProvidersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type InferenceLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INFERENCE_LOG_TABLE_ID_ASC" | "INFERENCE_LOG_TABLE_ID_DESC" | "INFERENCE_LOG_TABLE_NAME_ASC" | "INFERENCE_LOG_TABLE_NAME_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type InfraConfigModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CONFIG_TABLE_ID_ASC" | "CONFIG_TABLE_ID_DESC" | "CONFIG_TABLE_NAME_ASC" | "CONFIG_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type InfraSecretsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SECRETS_TABLE_NAME_ASC" | "SECRETS_TABLE_NAME_DESC"; -export type IntegrationProvidersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type InternalSecretsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERNAL_SECRETS_TABLE_ID_ASC" | "INTERNAL_SECRETS_TABLE_ID_DESC" | "INTERNAL_SECRETS_TABLE_NAME_ASC" | "INTERNAL_SECRETS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type InvitesModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CLAIMED_INVITES_TABLE_ID_ASC" | "CLAIMED_INVITES_TABLE_ID_DESC" | "CLAIMED_INVITES_TABLE_NAME_ASC" | "CLAIMED_INVITES_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EMAILS_TABLE_ID_ASC" | "EMAILS_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVITES_TABLE_ID_ASC" | "INVITES_TABLE_ID_DESC" | "INVITES_TABLE_NAME_ASC" | "INVITES_TABLE_NAME_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SUBMIT_INVITE_CODE_FUNCTION_ASC" | "SUBMIT_INVITE_CODE_FUNCTION_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type LimitsModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "AGGREGATE_TABLE_ID_ASC" | "AGGREGATE_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "CAP_CHECK_TRIGGER_ASC" | "CAP_CHECK_TRIGGER_DESC" | "CREDIT_CODES_TABLE_ID_ASC" | "CREDIT_CODES_TABLE_ID_DESC" | "CREDIT_CODE_ITEMS_TABLE_ID_ASC" | "CREDIT_CODE_ITEMS_TABLE_ID_DESC" | "CREDIT_REDEMPTIONS_TABLE_ID_ASC" | "CREDIT_REDEMPTIONS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_TABLE_ID_ASC" | "DEFAULT_TABLE_ID_DESC" | "DEFAULT_TABLE_NAME_ASC" | "DEFAULT_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EVENTS_TABLE_ID_ASC" | "EVENTS_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_ASC" | "LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_DESC" | "LIMIT_CAPS_DEFAULTS_TABLE_ID_ASC" | "LIMIT_CAPS_DEFAULTS_TABLE_ID_DESC" | "LIMIT_CAPS_TABLE_ID_ASC" | "LIMIT_CAPS_TABLE_ID_DESC" | "LIMIT_CHECK_FUNCTION_ASC" | "LIMIT_CHECK_FUNCTION_DESC" | "LIMIT_CHECK_SOFT_FUNCTION_ASC" | "LIMIT_CHECK_SOFT_FUNCTION_DESC" | "LIMIT_CREDITS_TABLE_ID_ASC" | "LIMIT_CREDITS_TABLE_ID_DESC" | "LIMIT_DECREMENT_FUNCTION_ASC" | "LIMIT_DECREMENT_FUNCTION_DESC" | "LIMIT_DECREMENT_TRIGGER_ASC" | "LIMIT_DECREMENT_TRIGGER_DESC" | "LIMIT_INCREMENT_FUNCTION_ASC" | "LIMIT_INCREMENT_FUNCTION_DESC" | "LIMIT_INCREMENT_TRIGGER_ASC" | "LIMIT_INCREMENT_TRIGGER_DESC" | "LIMIT_UPDATE_TRIGGER_ASC" | "LIMIT_UPDATE_TRIGGER_DESC" | "LIMIT_WARNINGS_TABLE_ID_ASC" | "LIMIT_WARNINGS_TABLE_ID_DESC" | "LIMIT_WARNING_STATE_TABLE_ID_ASC" | "LIMIT_WARNING_STATE_TABLE_ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVE_CAP_FUNCTION_ASC" | "RESOLVE_CAP_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type MembershipTypesModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type MembershipsModuleOrderBy = "ACTOR_MASK_CHECK_ASC" | "ACTOR_MASK_CHECK_DESC" | "ACTOR_PERM_CHECK_ASC" | "ACTOR_PERM_CHECK_DESC" | "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "ADMIN_GRANTS_TABLE_ID_ASC" | "ADMIN_GRANTS_TABLE_ID_DESC" | "ADMIN_GRANTS_TABLE_NAME_ASC" | "ADMIN_GRANTS_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_LIMITS_TABLE_ID_ASC" | "DEFAULT_LIMITS_TABLE_ID_DESC" | "DEFAULT_PERMISSIONS_TABLE_ID_ASC" | "DEFAULT_PERMISSIONS_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_IDS_BY_MASK_ASC" | "ENTITY_IDS_BY_MASK_DESC" | "ENTITY_IDS_BY_PERM_ASC" | "ENTITY_IDS_BY_PERM_DESC" | "ENTITY_IDS_FUNCTION_ASC" | "ENTITY_IDS_FUNCTION_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ENTITY_TABLE_OWNER_ID_ASC" | "ENTITY_TABLE_OWNER_ID_DESC" | "GET_ORG_FN_ASC" | "GET_ORG_FN_DESC" | "GRANTS_TABLE_ID_ASC" | "GRANTS_TABLE_ID_DESC" | "GRANTS_TABLE_NAME_ASC" | "GRANTS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "LIMITS_TABLE_ID_ASC" | "LIMITS_TABLE_ID_DESC" | "MEMBERSHIPS_TABLE_ID_ASC" | "MEMBERSHIPS_TABLE_ID_DESC" | "MEMBERSHIPS_TABLE_NAME_ASC" | "MEMBERSHIPS_TABLE_NAME_DESC" | "MEMBERSHIP_DEFAULTS_TABLE_ID_ASC" | "MEMBERSHIP_DEFAULTS_TABLE_ID_DESC" | "MEMBERSHIP_DEFAULTS_TABLE_NAME_ASC" | "MEMBERSHIP_DEFAULTS_TABLE_NAME_DESC" | "MEMBERSHIP_SETTINGS_TABLE_ID_ASC" | "MEMBERSHIP_SETTINGS_TABLE_ID_DESC" | "MEMBERSHIP_SETTINGS_TABLE_NAME_ASC" | "MEMBERSHIP_SETTINGS_TABLE_NAME_DESC" | "MEMBERS_TABLE_ID_ASC" | "MEMBERS_TABLE_ID_DESC" | "MEMBERS_TABLE_NAME_ASC" | "MEMBERS_TABLE_NAME_DESC" | "MEMBER_PROFILES_TABLE_ID_ASC" | "MEMBER_PROFILES_TABLE_ID_DESC" | "NATURAL" | "OWNER_GRANTS_TABLE_ID_ASC" | "OWNER_GRANTS_TABLE_ID_DESC" | "OWNER_GRANTS_TABLE_NAME_ASC" | "OWNER_GRANTS_TABLE_NAME_DESC" | "PERMISSIONS_TABLE_ID_ASC" | "PERMISSIONS_TABLE_ID_DESC" | "PERMISSION_DEFAULT_GRANTS_TABLE_ID_ASC" | "PERMISSION_DEFAULT_GRANTS_TABLE_ID_DESC" | "PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_ASC" | "PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SPRT_TABLE_ID_ASC" | "SPRT_TABLE_ID_DESC"; -export type MerkleStoreModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "COMMIT_TABLE_ID_ASC" | "COMMIT_TABLE_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "FUNCTION_PREFIX_ASC" | "FUNCTION_PREFIX_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OBJECT_TABLE_ID_ASC" | "OBJECT_TABLE_ID_DESC" | "PERMISSION_KEY_ASC" | "PERMISSION_KEY_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORE_TABLE_ID_ASC" | "STORE_TABLE_ID_DESC"; -export type NamespaceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACES_TABLE_ID_ASC" | "NAMESPACES_TABLE_ID_DESC" | "NAMESPACES_TABLE_NAME_ASC" | "NAMESPACES_TABLE_NAME_DESC" | "NAMESPACE_EVENTS_TABLE_ID_ASC" | "NAMESPACE_EVENTS_TABLE_ID_DESC" | "NAMESPACE_EVENTS_TABLE_NAME_ASC" | "NAMESPACE_EVENTS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type NotificationsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHANNELS_TABLE_ID_ASC" | "CHANNELS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DELIVERY_LOG_TABLE_ID_ASC" | "DELIVERY_LOG_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "HAS_CHANNELS_ASC" | "HAS_CHANNELS_DESC" | "HAS_DIGEST_METADATA_ASC" | "HAS_DIGEST_METADATA_DESC" | "HAS_PREFERENCES_ASC" | "HAS_PREFERENCES_DESC" | "HAS_SETTINGS_EXTENSION_ASC" | "HAS_SETTINGS_EXTENSION_DESC" | "HAS_SUBSCRIPTIONS_ASC" | "HAS_SUBSCRIPTIONS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NOTIFICATIONS_TABLE_ID_ASC" | "NOTIFICATIONS_TABLE_ID_DESC" | "ORGANIZATION_SETTINGS_TABLE_ID_ASC" | "ORGANIZATION_SETTINGS_TABLE_ID_DESC" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PREFERENCES_TABLE_ID_ASC" | "PREFERENCES_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "READ_STATE_TABLE_ID_ASC" | "READ_STATE_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SUPPRESSIONS_TABLE_ID_ASC" | "SUPPRESSIONS_TABLE_ID_DESC" | "USER_SETTINGS_TABLE_ID_ASC" | "USER_SETTINGS_TABLE_ID_DESC"; -export type PermissionsModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "BITLEN_ASC" | "BITLEN_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_TABLE_ID_ASC" | "DEFAULT_TABLE_ID_DESC" | "DEFAULT_TABLE_NAME_ASC" | "DEFAULT_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GET_BY_MASK_ASC" | "GET_BY_MASK_DESC" | "GET_MASK_ASC" | "GET_MASK_BY_NAME_ASC" | "GET_MASK_BY_NAME_DESC" | "GET_MASK_DESC" | "GET_PADDED_MASK_ASC" | "GET_PADDED_MASK_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type PhoneNumbersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type PlansModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "APPLY_BILLING_PLAN_FUNCTION_ASC" | "APPLY_BILLING_PLAN_FUNCTION_DESC" | "APPLY_PLAN_AGGREGATE_FUNCTION_ASC" | "APPLY_PLAN_AGGREGATE_FUNCTION_DESC" | "APPLY_PLAN_CAPS_FUNCTION_ASC" | "APPLY_PLAN_CAPS_FUNCTION_DESC" | "APPLY_PLAN_FUNCTION_ASC" | "APPLY_PLAN_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PLANS_TABLE_ID_ASC" | "PLANS_TABLE_ID_DESC" | "PLANS_TABLE_NAME_ASC" | "PLANS_TABLE_NAME_DESC" | "PLAN_CAPS_TABLE_ID_ASC" | "PLAN_CAPS_TABLE_ID_DESC" | "PLAN_LIMITS_TABLE_ID_ASC" | "PLAN_LIMITS_TABLE_ID_DESC" | "PLAN_LIMITS_TABLE_NAME_ASC" | "PLAN_LIMITS_TABLE_NAME_DESC" | "PLAN_METER_LIMITS_TABLE_ID_ASC" | "PLAN_METER_LIMITS_TABLE_ID_DESC" | "PLAN_OVERRIDES_TABLE_ID_ASC" | "PLAN_OVERRIDES_TABLE_ID_DESC" | "PLAN_PRICING_TABLE_ID_ASC" | "PLAN_PRICING_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type PrincipalAuthModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUDITS_TABLE_ID_ASC" | "AUDITS_TABLE_ID_DESC" | "CREATE_ORG_API_KEY_FUNCTION_ASC" | "CREATE_ORG_API_KEY_FUNCTION_DESC" | "CREATE_ORG_PRINCIPAL_FUNCTION_ASC" | "CREATE_ORG_PRINCIPAL_FUNCTION_DESC" | "CREATE_PRINCIPAL_FUNCTION_ASC" | "CREATE_PRINCIPAL_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ORG_PRINCIPAL_FUNCTION_ASC" | "DELETE_ORG_PRINCIPAL_FUNCTION_DESC" | "DELETE_PRINCIPAL_FUNCTION_ASC" | "DELETE_PRINCIPAL_FUNCTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPALS_TABLE_ID_ASC" | "PRINCIPALS_TABLE_ID_DESC" | "PRINCIPALS_TABLE_NAME_ASC" | "PRINCIPALS_TABLE_NAME_DESC" | "PRINCIPAL_ENTITIES_TABLE_ID_ASC" | "PRINCIPAL_ENTITIES_TABLE_ID_DESC" | "PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC" | "PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC" | "REVOKE_ORG_API_KEY_FUNCTION_ASC" | "REVOKE_ORG_API_KEY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type ProfilesModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MEMBERSHIPS_TABLE_ID_ASC" | "MEMBERSHIPS_TABLE_ID_DESC" | "NATURAL" | "PERMISSIONS_TABLE_ID_ASC" | "PERMISSIONS_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROFILE_DEFINITION_GRANTS_TABLE_ID_ASC" | "PROFILE_DEFINITION_GRANTS_TABLE_ID_DESC" | "PROFILE_DEFINITION_GRANTS_TABLE_NAME_ASC" | "PROFILE_DEFINITION_GRANTS_TABLE_NAME_DESC" | "PROFILE_GRANTS_TABLE_ID_ASC" | "PROFILE_GRANTS_TABLE_ID_DESC" | "PROFILE_GRANTS_TABLE_NAME_ASC" | "PROFILE_GRANTS_TABLE_NAME_DESC" | "PROFILE_PERMISSIONS_TABLE_ID_ASC" | "PROFILE_PERMISSIONS_TABLE_ID_DESC" | "PROFILE_PERMISSIONS_TABLE_NAME_ASC" | "PROFILE_PERMISSIONS_TABLE_NAME_DESC" | "PROFILE_TEMPLATES_TABLE_ID_ASC" | "PROFILE_TEMPLATES_TABLE_ID_DESC" | "PROFILE_TEMPLATES_TABLE_NAME_ASC" | "PROFILE_TEMPLATES_TABLE_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type RateLimitMetersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHECK_RATE_LIMIT_FUNCTION_ASC" | "CHECK_RATE_LIMIT_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RATE_LIMIT_OVERRIDES_TABLE_ID_ASC" | "RATE_LIMIT_OVERRIDES_TABLE_ID_DESC" | "RATE_LIMIT_OVERRIDES_TABLE_NAME_ASC" | "RATE_LIMIT_OVERRIDES_TABLE_NAME_DESC" | "RATE_LIMIT_STATE_TABLE_ID_ASC" | "RATE_LIMIT_STATE_TABLE_ID_DESC" | "RATE_LIMIT_STATE_TABLE_NAME_ASC" | "RATE_LIMIT_STATE_TABLE_NAME_DESC" | "RATE_WINDOW_LIMITS_TABLE_ID_ASC" | "RATE_WINDOW_LIMITS_TABLE_ID_DESC" | "RATE_WINDOW_LIMITS_TABLE_NAME_ASC" | "RATE_WINDOW_LIMITS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type RateLimitsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IP_RATE_LIMITS_TABLE_ID_ASC" | "IP_RATE_LIMITS_TABLE_ID_DESC" | "IP_RATE_LIMITS_TABLE_NAME_ASC" | "IP_RATE_LIMITS_TABLE_NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RATE_LIMITS_TABLE_ID_ASC" | "RATE_LIMITS_TABLE_ID_DESC" | "RATE_LIMITS_TABLE_NAME_ASC" | "RATE_LIMITS_TABLE_NAME_DESC" | "RATE_LIMIT_SETTINGS_TABLE_ID_ASC" | "RATE_LIMIT_SETTINGS_TABLE_ID_DESC" | "RATE_LIMIT_SETTINGS_TABLE_NAME_ASC" | "RATE_LIMIT_SETTINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type RealtimeModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHANGE_LOG_TABLE_ID_ASC" | "CHANGE_LOG_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "LISTENER_NODE_TABLE_ID_ASC" | "LISTENER_NODE_TABLE_ID_DESC" | "NATURAL" | "NOTIFY_CHANNEL_ASC" | "NOTIFY_CHANNEL_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "RETENTION_HOURS_ASC" | "RETENTION_HOURS_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SOURCE_REGISTRY_TABLE_ID_ASC" | "SOURCE_REGISTRY_TABLE_ID_DESC" | "SUBSCRIPTIONS_SCHEMA_ID_ASC" | "SUBSCRIPTIONS_SCHEMA_ID_DESC"; -export type RelationProvisionOrderBy = "API_REQUIRED_ASC" | "API_REQUIRED_DESC" | "CREATE_INDEX_ASC" | "CREATE_INDEX_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACTION_ASC" | "DELETE_ACTION_DESC" | "EXPOSE_IN_API_ASC" | "EXPOSE_IN_API_DESC" | "FIELD_NAME_ASC" | "FIELD_NAME_DESC" | "GRANTS_ASC" | "GRANTS_DESC" | "ID_ASC" | "ID_DESC" | "IS_REQUIRED_ASC" | "IS_REQUIRED_DESC" | "JUNCTION_SCHEMA_ID_ASC" | "JUNCTION_SCHEMA_ID_DESC" | "JUNCTION_TABLE_ID_ASC" | "JUNCTION_TABLE_ID_DESC" | "JUNCTION_TABLE_NAME_ASC" | "JUNCTION_TABLE_NAME_DESC" | "NATURAL" | "NODES_ASC" | "NODES_DESC" | "OUT_FIELD_ID_ASC" | "OUT_FIELD_ID_DESC" | "OUT_JUNCTION_TABLE_ID_ASC" | "OUT_JUNCTION_TABLE_ID_DESC" | "OUT_SOURCE_FIELD_ID_ASC" | "OUT_SOURCE_FIELD_ID_DESC" | "OUT_TARGET_FIELD_ID_ASC" | "OUT_TARGET_FIELD_ID_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RELATION_TYPE_ASC" | "RELATION_TYPE_DESC" | "SOURCE_FIELD_NAME_ASC" | "SOURCE_FIELD_NAME_DESC" | "SOURCE_TABLE_ID_ASC" | "SOURCE_TABLE_ID_DESC" | "TARGET_FIELD_NAME_ASC" | "TARGET_FIELD_NAME_DESC" | "TARGET_TABLE_ID_ASC" | "TARGET_TABLE_ID_DESC" | "USE_COMPOSITE_KEY_ASC" | "USE_COMPOSITE_KEY_DESC"; -export type ResourceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_STORE_NAME_ASC" | "INSTALLATION_STORE_NAME_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "REQUIREMENTS_STATE_VIEW_NAME_ASC" | "REQUIREMENTS_STATE_VIEW_NAME_DESC" | "RESOLVED_REQUIREMENTS_VIEW_NAME_ASC" | "RESOLVED_REQUIREMENTS_VIEW_NAME_DESC" | "RESOURCES_TABLE_ID_ASC" | "RESOURCES_TABLE_ID_DESC" | "RESOURCES_TABLE_NAME_ASC" | "RESOURCES_TABLE_NAME_DESC" | "RESOURCE_BILLING_ROLLUP_FUNCTION_ASC" | "RESOURCE_BILLING_ROLLUP_FUNCTION_DESC" | "RESOURCE_DEFINITIONS_TABLE_ID_ASC" | "RESOURCE_DEFINITIONS_TABLE_ID_DESC" | "RESOURCE_DEFINITIONS_TABLE_NAME_ASC" | "RESOURCE_DEFINITIONS_TABLE_NAME_DESC" | "RESOURCE_EVENTS_TABLE_ID_ASC" | "RESOURCE_EVENTS_TABLE_ID_DESC" | "RESOURCE_EVENTS_TABLE_NAME_ASC" | "RESOURCE_EVENTS_TABLE_NAME_DESC" | "RESOURCE_INSTALLATIONS_TABLE_ID_ASC" | "RESOURCE_INSTALLATIONS_TABLE_ID_DESC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_ASC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_DESC" | "RESOURCE_STATUS_CHECKS_TABLE_ID_ASC" | "RESOURCE_STATUS_CHECKS_TABLE_ID_DESC" | "RESOURCE_STATUS_CHECKS_TABLE_NAME_ASC" | "RESOURCE_STATUS_CHECKS_TABLE_NAME_DESC" | "RESOURCE_USAGE_LOG_TABLE_ID_ASC" | "RESOURCE_USAGE_LOG_TABLE_ID_DESC" | "RESOURCE_USAGE_LOG_TABLE_NAME_ASC" | "RESOURCE_USAGE_LOG_TABLE_NAME_DESC" | "RESOURCE_USAGE_SUMMARY_TABLE_ID_ASC" | "RESOURCE_USAGE_SUMMARY_TABLE_ID_DESC" | "RESOURCE_USAGE_SUMMARY_TABLE_NAME_ASC" | "RESOURCE_USAGE_SUMMARY_TABLE_NAME_DESC" | "ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type RlsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUTHENTICATE_ASC" | "AUTHENTICATE_DESC" | "AUTHENTICATE_STRICT_ASC" | "AUTHENTICATE_STRICT_DESC" | "CURRENT_ROLE_ASC" | "CURRENT_ROLE_DESC" | "CURRENT_ROLE_ID_ASC" | "CURRENT_ROLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type RouteModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAIN_MODULE_ID_ASC" | "DOMAIN_MODULE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HOSTNAME_BINDINGS_TABLE_ID_ASC" | "HOSTNAME_BINDINGS_TABLE_ID_DESC" | "HOSTNAME_BINDINGS_TABLE_NAME_ASC" | "HOSTNAME_BINDINGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVER_FUNCTION_NAME_ASC" | "RESOLVER_FUNCTION_NAME_DESC" | "ROUTES_TABLE_ID_ASC" | "ROUTES_TABLE_ID_DESC" | "ROUTES_TABLE_NAME_ASC" | "ROUTES_TABLE_NAME_DESC" | "ROUTE_BINDINGS_TABLE_ID_ASC" | "ROUTE_BINDINGS_TABLE_ID_DESC" | "ROUTE_BINDINGS_TABLE_NAME_ASC" | "ROUTE_BINDINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type SecureTableProvisionOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELDS_ASC" | "FIELDS_DESC" | "GRANTS_ASC" | "GRANTS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODES_ASC" | "NODES_DESC" | "OUT_FIELDS_ASC" | "OUT_FIELDS_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "USE_RLS_ASC" | "USE_RLS_DESC"; -export type SessionSecretsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type SessionsModuleOrderBy = "AUTH_SETTINGS_TABLE_ID_ASC" | "AUTH_SETTINGS_TABLE_ID_DESC" | "AUTH_SETTINGS_TABLE_NAME_ASC" | "AUTH_SETTINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_DEFAULT_EXPIRATION_ASC" | "SESSIONS_DEFAULT_EXPIRATION_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSIONS_TABLE_NAME_ASC" | "SESSIONS_TABLE_NAME_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_NAME_ASC" | "SESSION_CREDENTIALS_TABLE_NAME_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type SiteSurfaceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SITES_TABLE_ID_ASC" | "SITES_TABLE_ID_DESC" | "SITES_TABLE_NAME_ASC" | "SITES_TABLE_NAME_DESC" | "SITE_METADATA_TABLE_ID_ASC" | "SITE_METADATA_TABLE_ID_DESC" | "SITE_METADATA_TABLE_NAME_ASC" | "SITE_METADATA_TABLE_NAME_DESC" | "SITE_MODULES_TABLE_ID_ASC" | "SITE_MODULES_TABLE_ID_DESC" | "SITE_MODULES_TABLE_NAME_ASC" | "SITE_MODULES_TABLE_NAME_DESC" | "SITE_THEMES_TABLE_ID_ASC" | "SITE_THEMES_TABLE_ID_DESC" | "SITE_THEMES_TABLE_NAME_ASC" | "SITE_THEMES_TABLE_NAME_DESC"; -export type StorageLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORAGE_LOG_TABLE_ID_ASC" | "STORAGE_LOG_TABLE_ID_DESC" | "STORAGE_LOG_TABLE_NAME_ASC" | "STORAGE_LOG_TABLE_NAME_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type StorageModuleOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "BUCKETS_TABLE_ID_ASC" | "BUCKETS_TABLE_ID_DESC" | "BUCKETS_TABLE_NAME_ASC" | "BUCKETS_TABLE_NAME_DESC" | "CACHE_TTL_SECONDS_ASC" | "CACHE_TTL_SECONDS_DESC" | "CONFIRM_UPLOAD_DELAY_ASC" | "CONFIRM_UPLOAD_DELAY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_MAX_FILE_SIZE_ASC" | "DEFAULT_MAX_FILE_SIZE_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOWNLOAD_URL_EXPIRY_SECONDS_ASC" | "DOWNLOAD_URL_EXPIRY_SECONDS_DESC" | "ENDPOINT_ASC" | "ENDPOINT_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FILES_TABLE_ID_ASC" | "FILES_TABLE_ID_DESC" | "FILES_TABLE_NAME_ASC" | "FILES_TABLE_NAME_DESC" | "FILE_EVENTS_TABLE_ID_ASC" | "FILE_EVENTS_TABLE_ID_DESC" | "HAS_AUDIT_LOG_ASC" | "HAS_AUDIT_LOG_DESC" | "HAS_CONFIRM_UPLOAD_ASC" | "HAS_CONFIRM_UPLOAD_DESC" | "HAS_CONTENT_HASH_ASC" | "HAS_CONTENT_HASH_DESC" | "HAS_CUSTOM_KEYS_ASC" | "HAS_CUSTOM_KEYS_DESC" | "HAS_PATH_SHARES_ASC" | "HAS_PATH_SHARES_DESC" | "HAS_VERSIONING_ASC" | "HAS_VERSIONING_DESC" | "ID_ASC" | "ID_DESC" | "MAX_BULK_FILES_ASC" | "MAX_BULK_FILES_DESC" | "MAX_BULK_TOTAL_SIZE_ASC" | "MAX_BULK_TOTAL_SIZE_DESC" | "MAX_FILENAME_LENGTH_ASC" | "MAX_FILENAME_LENGTH_DESC" | "NATURAL" | "PATH_SHARES_TABLE_ID_ASC" | "PATH_SHARES_TABLE_ID_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "PUBLIC_URL_PREFIX_ASC" | "PUBLIC_URL_PREFIX_DESC" | "RESTRICT_READS_ASC" | "RESTRICT_READS_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "UPLOAD_URL_EXPIRY_SECONDS_ASC" | "UPLOAD_URL_EXPIRY_SECONDS_DESC"; -export type TransferLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TRANSFER_LOG_TABLE_ID_ASC" | "TRANSFER_LOG_TABLE_ID_DESC" | "TRANSFER_LOG_TABLE_NAME_ASC" | "TRANSFER_LOG_TABLE_NAME_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type UserAuthModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUDITS_TABLE_ID_ASC" | "AUDITS_TABLE_ID_DESC" | "AUDITS_TABLE_NAME_ASC" | "AUDITS_TABLE_NAME_DESC" | "CHECK_PASSWORD_FUNCTION_ASC" | "CHECK_PASSWORD_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACCOUNT_FUNCTION_ASC" | "DELETE_ACCOUNT_FUNCTION_DESC" | "EMAILS_TABLE_ID_ASC" | "EMAILS_TABLE_ID_DESC" | "ENCRYPTED_TABLE_ID_ASC" | "ENCRYPTED_TABLE_ID_DESC" | "EXTEND_TOKEN_EXPIRES_ASC" | "EXTEND_TOKEN_EXPIRES_DESC" | "FORGOT_PASSWORD_FUNCTION_ASC" | "FORGOT_PASSWORD_FUNCTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_ASC" | "REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_DESC" | "RESET_PASSWORD_FUNCTION_ASC" | "RESET_PASSWORD_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_ASC" | "SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_DESC" | "SEND_VERIFICATION_EMAIL_FUNCTION_ASC" | "SEND_VERIFICATION_EMAIL_FUNCTION_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SET_PASSWORD_FUNCTION_ASC" | "SET_PASSWORD_FUNCTION_DESC" | "SIGN_IN_CROSS_ORIGIN_FUNCTION_ASC" | "SIGN_IN_CROSS_ORIGIN_FUNCTION_DESC" | "SIGN_IN_FUNCTION_ASC" | "SIGN_IN_FUNCTION_DESC" | "SIGN_OUT_FUNCTION_ASC" | "SIGN_OUT_FUNCTION_DESC" | "SIGN_UP_FUNCTION_ASC" | "SIGN_UP_FUNCTION_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC" | "VERIFY_EMAIL_FUNCTION_ASC" | "VERIFY_EMAIL_FUNCTION_DESC" | "VERIFY_PASSWORD_FUNCTION_ASC" | "VERIFY_PASSWORD_FUNCTION_DESC"; -export type UserCredentialsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UserSettingsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UserStateModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UsersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "TYPE_TABLE_ID_ASC" | "TYPE_TABLE_ID_DESC" | "TYPE_TABLE_NAME_ASC" | "TYPE_TABLE_NAME_DESC"; -export type WebauthnAuthModuleOrderBy = "ATTESTATION_TYPE_ASC" | "ATTESTATION_TYPE_DESC" | "AUTH_SETTINGS_TABLE_ID_ASC" | "AUTH_SETTINGS_TABLE_ID_DESC" | "CHALLENGE_EXPIRY_ASC" | "CHALLENGE_EXPIRY_DESC" | "CREDENTIALS_TABLE_ID_ASC" | "CREDENTIALS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORIGIN_ALLOWLIST_ASC" | "ORIGIN_ALLOWLIST_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRE_USER_VERIFICATION_ASC" | "REQUIRE_USER_VERIFICATION_DESC" | "RESIDENT_KEY_ASC" | "RESIDENT_KEY_DESC" | "RP_ID_ASC" | "RP_ID_DESC" | "RP_NAME_ASC" | "RP_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_SECRETS_TABLE_ID_ASC" | "SESSION_SECRETS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type WebauthnCredentialsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type WebhookModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_INVOCATION_MODULE_ID_ASC" | "FUNCTION_INVOCATION_MODULE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INFRA_SECRETS_MODULE_ID_ASC" | "INFRA_SECRETS_MODULE_ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "WEBHOOK_ENDPOINTS_TABLE_ID_ASC" | "WEBHOOK_ENDPOINTS_TABLE_ID_DESC" | "WEBHOOK_ENDPOINTS_TABLE_NAME_ASC" | "WEBHOOK_ENDPOINTS_TABLE_NAME_DESC" | "WEBHOOK_EVENTS_TABLE_ID_ASC" | "WEBHOOK_EVENTS_TABLE_ID_DESC" | "WEBHOOK_EVENTS_TABLE_NAME_ASC" | "WEBHOOK_EVENTS_TABLE_NAME_DESC"; +export type AgentModuleOrderBy = + | 'AGENT_TABLE_ID_ASC' + | 'AGENT_TABLE_ID_DESC' + | 'AGENT_TABLE_NAME_ASC' + | 'AGENT_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HAS_AGENTS_ASC' + | 'HAS_AGENTS_DESC' + | 'HAS_PLANS_ASC' + | 'HAS_PLANS_DESC' + | 'HAS_RESOURCES_ASC' + | 'HAS_RESOURCES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_TABLE_ID_ASC' + | 'MESSAGE_TABLE_ID_DESC' + | 'MESSAGE_TABLE_NAME_ASC' + | 'MESSAGE_TABLE_NAME_DESC' + | 'NATURAL' + | 'PERSONA_TABLE_ID_ASC' + | 'PERSONA_TABLE_ID_DESC' + | 'PERSONA_TABLE_NAME_ASC' + | 'PERSONA_TABLE_NAME_DESC' + | 'PLAN_TABLE_ID_ASC' + | 'PLAN_TABLE_ID_DESC' + | 'PLAN_TABLE_NAME_ASC' + | 'PLAN_TABLE_NAME_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROMPTS_TABLE_ID_ASC' + | 'PROMPTS_TABLE_ID_DESC' + | 'PROMPTS_TABLE_NAME_ASC' + | 'PROMPTS_TABLE_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RESOURCE_TABLE_ID_ASC' + | 'RESOURCE_TABLE_ID_DESC' + | 'RESOURCE_TABLE_NAME_ASC' + | 'RESOURCE_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SHARED_ASC' + | 'SHARED_DESC' + | 'TASK_TABLE_ID_ASC' + | 'TASK_TABLE_ID_DESC' + | 'TASK_TABLE_NAME_ASC' + | 'TASK_TABLE_NAME_DESC' + | 'THREAD_TABLE_ID_ASC' + | 'THREAD_TABLE_ID_DESC' + | 'THREAD_TABLE_NAME_ASC' + | 'THREAD_TABLE_NAME_DESC'; +export type ApiSurfaceModuleOrderBy = + | 'APIS_TABLE_ID_ASC' + | 'APIS_TABLE_ID_DESC' + | 'APIS_TABLE_NAME_ASC' + | 'APIS_TABLE_NAME_DESC' + | 'API_MODULES_TABLE_ID_ASC' + | 'API_MODULES_TABLE_ID_DESC' + | 'API_MODULES_TABLE_NAME_ASC' + | 'API_MODULES_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'API_SCHEMAS_TABLE_ID_ASC' + | 'API_SCHEMAS_TABLE_ID_DESC' + | 'API_SCHEMAS_TABLE_NAME_ASC' + | 'API_SCHEMAS_TABLE_NAME_DESC' + | 'API_SETTINGS_TABLE_ID_ASC' + | 'API_SETTINGS_TABLE_ID_DESC' + | 'API_SETTINGS_TABLE_NAME_ASC' + | 'API_SETTINGS_TABLE_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'CORS_SETTINGS_TABLE_ID_ASC' + | 'CORS_SETTINGS_TABLE_ID_DESC' + | 'CORS_SETTINGS_TABLE_NAME_ASC' + | 'CORS_SETTINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type AppModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPS_TABLE_ID_ASC' + | 'APPS_TABLE_ID_DESC' + | 'APPS_TABLE_NAME_ASC' + | 'APPS_TABLE_NAME_DESC' + | 'APP_COMPONENTS_TABLE_ID_ASC' + | 'APP_COMPONENTS_TABLE_ID_DESC' + | 'APP_COMPONENTS_TABLE_NAME_ASC' + | 'APP_COMPONENTS_TABLE_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type BillingModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BALANCES_TABLE_ID_ASC' + | 'BALANCES_TABLE_ID_DESC' + | 'BALANCES_TABLE_NAME_ASC' + | 'BALANCES_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LEDGER_TABLE_ID_ASC' + | 'LEDGER_TABLE_ID_DESC' + | 'LEDGER_TABLE_NAME_ASC' + | 'LEDGER_TABLE_NAME_DESC' + | 'METERS_TABLE_ID_ASC' + | 'METERS_TABLE_ID_DESC' + | 'METERS_TABLE_NAME_ASC' + | 'METERS_TABLE_NAME_DESC' + | 'METER_CREDITS_TABLE_ID_ASC' + | 'METER_CREDITS_TABLE_ID_DESC' + | 'METER_CREDITS_TABLE_NAME_ASC' + | 'METER_CREDITS_TABLE_NAME_DESC' + | 'METER_DEFAULTS_TABLE_ID_ASC' + | 'METER_DEFAULTS_TABLE_ID_DESC' + | 'METER_DEFAULTS_TABLE_NAME_ASC' + | 'METER_DEFAULTS_TABLE_NAME_DESC' + | 'METER_SOURCES_TABLE_ID_ASC' + | 'METER_SOURCES_TABLE_ID_DESC' + | 'METER_SOURCES_TABLE_NAME_ASC' + | 'METER_SOURCES_TABLE_NAME_DESC' + | 'NATURAL' + | 'PLAN_SUBSCRIPTIONS_TABLE_ID_ASC' + | 'PLAN_SUBSCRIPTIONS_TABLE_ID_DESC' + | 'PLAN_SUBSCRIPTIONS_TABLE_NAME_ASC' + | 'PLAN_SUBSCRIPTIONS_TABLE_NAME_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RECORD_USAGE_FUNCTION_ASC' + | 'RECORD_USAGE_FUNCTION_DESC' + | 'ROLLUP_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_ASC' + | 'SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_DESC'; +export type BillingProviderModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BILLING_CUSTOMERS_TABLE_ID_ASC' + | 'BILLING_CUSTOMERS_TABLE_ID_DESC' + | 'BILLING_CUSTOMERS_TABLE_NAME_ASC' + | 'BILLING_CUSTOMERS_TABLE_NAME_DESC' + | 'BILLING_PRICES_TABLE_ID_ASC' + | 'BILLING_PRICES_TABLE_ID_DESC' + | 'BILLING_PRICES_TABLE_NAME_ASC' + | 'BILLING_PRICES_TABLE_NAME_DESC' + | 'BILLING_PRODUCTS_TABLE_ID_ASC' + | 'BILLING_PRODUCTS_TABLE_ID_DESC' + | 'BILLING_PRODUCTS_TABLE_NAME_ASC' + | 'BILLING_PRODUCTS_TABLE_NAME_DESC' + | 'BILLING_SUBSCRIPTIONS_TABLE_ID_ASC' + | 'BILLING_SUBSCRIPTIONS_TABLE_ID_DESC' + | 'BILLING_SUBSCRIPTIONS_TABLE_NAME_ASC' + | 'BILLING_SUBSCRIPTIONS_TABLE_NAME_DESC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_ID_ASC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_ID_DESC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_NAME_ASC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRICES_TABLE_ID_ASC' + | 'PRICES_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PROCESS_BILLING_EVENT_FUNCTION_ASC' + | 'PROCESS_BILLING_EVENT_FUNCTION_DESC' + | 'PRODUCTS_TABLE_ID_ASC' + | 'PRODUCTS_TABLE_ID_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SUBSCRIPTIONS_TABLE_ID_ASC' + | 'SUBSCRIPTIONS_TABLE_ID_DESC'; +export type BlueprintOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DEFINITION_HASH_ASC' + | 'DEFINITION_HASH_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_HASHES_ASC' + | 'TABLE_HASHES_DESC' + | 'TEMPLATE_ID_ASC' + | 'TEMPLATE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type BlueprintConstructionOrderBy = + | 'BLUEPRINT_ID_ASC' + | 'BLUEPRINT_ID_DESC' + | 'CONSTRUCTED_AT_ASC' + | 'CONSTRUCTED_AT_DESC' + | 'CONSTRUCTED_DEFINITION_ASC' + | 'CONSTRUCTED_DEFINITION_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_DETAILS_ASC' + | 'ERROR_DETAILS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TABLE_MAP_ASC' + | 'TABLE_MAP_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type BlueprintTemplateOrderBy = + | 'CATEGORIES_ASC' + | 'CATEGORIES_DESC' + | 'COMPLEXITY_ASC' + | 'COMPLEXITY_DESC' + | 'COPY_COUNT_ASC' + | 'COPY_COUNT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DEFINITION_HASH_ASC' + | 'DEFINITION_HASH_DESC' + | 'DEFINITION_SCHEMA_VERSION_ASC' + | 'DEFINITION_SCHEMA_VERSION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'FORKED_FROM_ID_ASC' + | 'FORKED_FROM_ID_DESC' + | 'FORK_COUNT_ASC' + | 'FORK_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'TABLE_HASHES_ASC' + | 'TABLE_HASHES_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERSION_ASC' + | 'VERSION_DESC' + | 'VISIBILITY_ASC' + | 'VISIBILITY_DESC'; +export type CatalogModuleOrderBy = + | 'APIS_TABLE_ID_ASC' + | 'APIS_TABLE_ID_DESC' + | 'APIS_TABLE_NAME_ASC' + | 'APIS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPS_TABLE_ID_ASC' + | 'APPS_TABLE_ID_DESC' + | 'APPS_TABLE_NAME_ASC' + | 'APPS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAINS_TABLE_ID_ASC' + | 'DOMAINS_TABLE_ID_DESC' + | 'DOMAINS_TABLE_NAME_ASC' + | 'DOMAINS_TABLE_NAME_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTIONS_TABLE_ID_ASC' + | 'FUNCTIONS_TABLE_ID_DESC' + | 'FUNCTIONS_TABLE_NAME_ASC' + | 'FUNCTIONS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOURCES_TABLE_ID_ASC' + | 'RESOURCES_TABLE_ID_DESC' + | 'RESOURCES_TABLE_NAME_ASC' + | 'RESOURCES_TABLE_NAME_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SITES_TABLE_ID_ASC' + | 'SITES_TABLE_ID_DESC' + | 'SITES_TABLE_NAME_ASC' + | 'SITES_TABLE_NAME_DESC'; +export type ComputeLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COMPUTE_LOG_TABLE_ID_ASC' + | 'COMPUTE_LOG_TABLE_ID_DESC' + | 'COMPUTE_LOG_TABLE_NAME_ASC' + | 'COMPUTE_LOG_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type ConfigSecretsUserModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type ConnectedAccountsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type CryptoAddressesModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type CryptoAuthModuleOrderBy = + | 'ADDRESSES_TABLE_ID_ASC' + | 'ADDRESSES_TABLE_ID_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SIGN_IN_RECORD_FAILURE_ASC' + | 'SIGN_IN_RECORD_FAILURE_DESC' + | 'SIGN_IN_REQUEST_CHALLENGE_ASC' + | 'SIGN_IN_REQUEST_CHALLENGE_DESC' + | 'SIGN_IN_WITH_CHALLENGE_ASC' + | 'SIGN_IN_WITH_CHALLENGE_DESC' + | 'SIGN_UP_WITH_KEY_ASC' + | 'SIGN_UP_WITH_KEY_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'USER_FIELD_ASC' + | 'USER_FIELD_DESC'; +export type DatabaseProvisionModuleOrderBy = + | 'ASYNC_ASC' + | 'ASYNC_DESC' + | 'BOOTSTRAP_ERROR_ASC' + | 'BOOTSTRAP_ERROR_DESC' + | 'BOOTSTRAP_STATUS_ASC' + | 'BOOTSTRAP_STATUS_DESC' + | 'BOOTSTRAP_USER_ASC' + | 'BOOTSTRAP_USER_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATABASE_NAME_ASC' + | 'DATABASE_NAME_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'FULFILLED_AT_ASC' + | 'FULFILLED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MODULES_ASC' + | 'MODULES_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_DATABASE_ID_ASC' + | 'SOURCE_DATABASE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SUBDOMAIN_ASC' + | 'SUBDOMAIN_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseSettingsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATABASE_SETTINGS_TABLE_ID_ASC' + | 'DATABASE_SETTINGS_TABLE_ID_DESC' + | 'DATABASE_SETTINGS_TABLE_NAME_ASC' + | 'DATABASE_SETTINGS_TABLE_NAME_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBKEY_SETTINGS_TABLE_ID_ASC' + | 'PUBKEY_SETTINGS_TABLE_ID_DESC' + | 'PUBKEY_SETTINGS_TABLE_NAME_ASC' + | 'PUBKEY_SETTINGS_TABLE_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RLS_SETTINGS_TABLE_ID_ASC' + | 'RLS_SETTINGS_TABLE_ID_DESC' + | 'RLS_SETTINGS_TABLE_NAME_ASC' + | 'RLS_SETTINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'WEBAUTHN_SETTINGS_TABLE_ID_ASC' + | 'WEBAUTHN_SETTINGS_TABLE_ID_DESC' + | 'WEBAUTHN_SETTINGS_TABLE_NAME_ASC' + | 'WEBAUTHN_SETTINGS_TABLE_NAME_DESC'; +export type DbPoolConfigOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ENABLED_ASC' + | 'ENABLED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'MIN_ASC' + | 'MIN_DESC' + | 'NATURAL' + | 'POOL_OWNER_ID_ASC' + | 'POOL_OWNER_ID_DESC' + | 'PRESET_SLUG_ASC' + | 'PRESET_SLUG_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WARM_TTL_ASC' + | 'WARM_TTL_DESC'; +export type DbPoolOrderBy = + | 'BOOTSTRAP_ERROR_ASC' + | 'BOOTSTRAP_ERROR_DESC' + | 'BOOTSTRAP_STATUS_ASC' + | 'BOOTSTRAP_STATUS_DESC' + | 'CLAIMED_AT_ASC' + | 'CLAIMED_AT_DESC' + | 'CLAIMED_BY_ASC' + | 'CLAIMED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRESET_COMMIT_ID_ASC' + | 'PRESET_COMMIT_ID_DESC' + | 'PRESET_SLUG_ASC' + | 'PRESET_SLUG_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DbPresetModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DB_PRESETS_TABLE_ID_ASC' + | 'DB_PRESETS_TABLE_ID_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_ID_ASC' + | 'PUBLIC_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORE_NAME_ASC' + | 'STORE_NAME_DESC'; +export type DbUsageModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COLLECT_DB_QUERY_STATS_FUNCTION_ASC' + | 'COLLECT_DB_QUERY_STATS_FUNCTION_DESC' + | 'COLLECT_DB_TABLE_STATS_FUNCTION_ASC' + | 'COLLECT_DB_TABLE_STATS_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'QUERY_STATS_LOG_TABLE_ID_ASC' + | 'QUERY_STATS_LOG_TABLE_ID_DESC' + | 'QUERY_STATS_LOG_TABLE_NAME_ASC' + | 'QUERY_STATS_LOG_TABLE_NAME_DESC' + | 'QUERY_STATS_SUMMARY_TABLE_ID_ASC' + | 'QUERY_STATS_SUMMARY_TABLE_ID_DESC' + | 'QUERY_STATS_SUMMARY_TABLE_NAME_ASC' + | 'QUERY_STATS_SUMMARY_TABLE_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_DESC' + | 'ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_STATS_LOG_TABLE_ID_ASC' + | 'TABLE_STATS_LOG_TABLE_ID_DESC' + | 'TABLE_STATS_LOG_TABLE_NAME_ASC' + | 'TABLE_STATS_LOG_TABLE_NAME_DESC' + | 'TABLE_STATS_SUMMARY_TABLE_ID_ASC' + | 'TABLE_STATS_SUMMARY_TABLE_ID_DESC' + | 'TABLE_STATS_SUMMARY_TABLE_NAME_ASC' + | 'TABLE_STATS_SUMMARY_TABLE_NAME_DESC'; +export type DefaultIdsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type DenormalizedTableFieldOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'FUNC_NAME_ASC' + | 'FUNC_NAME_DESC' + | 'FUNC_ORDER_ASC' + | 'FUNC_ORDER_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_ID_ASC' + | 'REF_FIELD_ID_DESC' + | 'REF_IDS_ASC' + | 'REF_IDS_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SET_IDS_ASC' + | 'SET_IDS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATE_DEFAULTS_ASC' + | 'UPDATE_DEFAULTS_DESC' + | 'USE_UPDATES_ASC' + | 'USE_UPDATES_DESC'; +export type DevicesModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_ID_ASC' + | 'DEVICE_SETTINGS_TABLE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_NAME_ASC' + | 'DEVICE_SETTINGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'USER_DEVICES_TABLE_ID_ASC' + | 'USER_DEVICES_TABLE_ID_DESC' + | 'USER_DEVICES_TABLE_NAME_ASC' + | 'USER_DEVICES_TABLE_NAME_DESC'; +export type DomainModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAINS_TABLE_ID_ASC' + | 'DOMAINS_TABLE_ID_DESC' + | 'DOMAINS_TABLE_NAME_ASC' + | 'DOMAINS_TABLE_NAME_DESC' + | 'DOMAIN_EVENTS_TABLE_ID_ASC' + | 'DOMAIN_EVENTS_TABLE_ID_DESC' + | 'DOMAIN_EVENTS_TABLE_NAME_ASC' + | 'DOMAIN_EVENTS_TABLE_NAME_DESC' + | 'DOMAIN_VERIFICATIONS_TABLE_ID_ASC' + | 'DOMAIN_VERIFICATIONS_TABLE_ID_DESC' + | 'DOMAIN_VERIFICATIONS_TABLE_NAME_ASC' + | 'DOMAIN_VERIFICATIONS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAINS_TABLE_ID_ASC' + | 'MANAGED_DOMAINS_TABLE_ID_DESC' + | 'MANAGED_DOMAINS_TABLE_NAME_ASC' + | 'MANAGED_DOMAINS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type EmailsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type EntityTypeProvisionOrderBy = + | 'AGENTS_ASC' + | 'AGENTS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FUNCTIONS_ASC' + | 'FUNCTIONS_DESC' + | 'GRAPHS_ASC' + | 'GRAPHS_DESC' + | 'HAS_INVITES_ASC' + | 'HAS_INVITES_DESC' + | 'HAS_INVITE_ACHIEVEMENTS_ASC' + | 'HAS_INVITE_ACHIEVEMENTS_DESC' + | 'HAS_LEVELS_ASC' + | 'HAS_LEVELS_DESC' + | 'HAS_LIMITS_ASC' + | 'HAS_LIMITS_DESC' + | 'HAS_PROFILES_ASC' + | 'HAS_PROFILES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VISIBLE_ASC' + | 'IS_VISIBLE_DESC' + | 'NAMESPACES_ASC' + | 'NAMESPACES_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUT_AGENT_MODULE_ID_ASC' + | 'OUT_AGENT_MODULE_ID_DESC' + | 'OUT_BUCKETS_TABLE_ID_ASC' + | 'OUT_BUCKETS_TABLE_ID_DESC' + | 'OUT_DEFINITIONS_TABLE_ID_ASC' + | 'OUT_DEFINITIONS_TABLE_ID_DESC' + | 'OUT_ENTITY_TABLE_ID_ASC' + | 'OUT_ENTITY_TABLE_ID_DESC' + | 'OUT_ENTITY_TABLE_NAME_ASC' + | 'OUT_ENTITY_TABLE_NAME_DESC' + | 'OUT_EXECUTION_LOGS_TABLE_ID_ASC' + | 'OUT_EXECUTION_LOGS_TABLE_ID_DESC' + | 'OUT_FILES_TABLE_ID_ASC' + | 'OUT_FILES_TABLE_ID_DESC' + | 'OUT_FUNCTION_MODULE_ID_ASC' + | 'OUT_FUNCTION_MODULE_ID_DESC' + | 'OUT_GRAPHS_TABLE_ID_ASC' + | 'OUT_GRAPHS_TABLE_ID_DESC' + | 'OUT_GRAPH_MODULE_ID_ASC' + | 'OUT_GRAPH_MODULE_ID_DESC' + | 'OUT_INSTALLED_MODULES_ASC' + | 'OUT_INSTALLED_MODULES_DESC' + | 'OUT_INVITES_MODULE_ID_ASC' + | 'OUT_INVITES_MODULE_ID_DESC' + | 'OUT_INVOCATIONS_TABLE_ID_ASC' + | 'OUT_INVOCATIONS_TABLE_ID_DESC' + | 'OUT_MEMBERSHIP_TYPE_ASC' + | 'OUT_MEMBERSHIP_TYPE_DESC' + | 'OUT_NAMESPACES_TABLE_ID_ASC' + | 'OUT_NAMESPACES_TABLE_ID_DESC' + | 'OUT_NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'OUT_NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'OUT_NAMESPACE_MODULE_ID_ASC' + | 'OUT_NAMESPACE_MODULE_ID_DESC' + | 'OUT_PATH_SHARES_TABLE_ID_ASC' + | 'OUT_PATH_SHARES_TABLE_ID_DESC' + | 'OUT_STORAGE_MODULE_ID_ASC' + | 'OUT_STORAGE_MODULE_ID_DESC' + | 'PARENT_ENTITY_ASC' + | 'PARENT_ENTITY_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SKIP_ENTITY_POLICIES_ASC' + | 'SKIP_ENTITY_POLICIES_DESC' + | 'STORAGE_ASC' + | 'STORAGE_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'TABLE_PROVISION_ASC' + | 'TABLE_PROVISION_DESC'; +export type EventsModuleOrderBy = + | 'ACHIEVEMENT_REWARDS_TABLE_ID_ASC' + | 'ACHIEVEMENT_REWARDS_TABLE_ID_DESC' + | 'ACHIEVEMENT_REWARDS_TABLE_NAME_ASC' + | 'ACHIEVEMENT_REWARDS_TABLE_NAME_DESC' + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EVENTS_TABLE_ID_ASC' + | 'EVENTS_TABLE_ID_DESC' + | 'EVENTS_TABLE_NAME_ASC' + | 'EVENTS_TABLE_NAME_DESC' + | 'EVENT_AGGREGATES_TABLE_ID_ASC' + | 'EVENT_AGGREGATES_TABLE_ID_DESC' + | 'EVENT_AGGREGATES_TABLE_NAME_ASC' + | 'EVENT_AGGREGATES_TABLE_NAME_DESC' + | 'EVENT_TYPES_TABLE_ID_ASC' + | 'EVENT_TYPES_TABLE_ID_DESC' + | 'EVENT_TYPES_TABLE_NAME_ASC' + | 'EVENT_TYPES_TABLE_NAME_DESC' + | 'GRANT_ACHIEVEMENT_ASC' + | 'GRANT_ACHIEVEMENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'LEVELS_TABLE_ID_ASC' + | 'LEVELS_TABLE_ID_DESC' + | 'LEVELS_TABLE_NAME_ASC' + | 'LEVELS_TABLE_NAME_DESC' + | 'LEVEL_ACHIEVED_ASC' + | 'LEVEL_ACHIEVED_DESC' + | 'LEVEL_GRANTS_TABLE_ID_ASC' + | 'LEVEL_GRANTS_TABLE_ID_DESC' + | 'LEVEL_GRANTS_TABLE_NAME_ASC' + | 'LEVEL_GRANTS_TABLE_NAME_DESC' + | 'LEVEL_REQUIREMENTS_TABLE_ID_ASC' + | 'LEVEL_REQUIREMENTS_TABLE_ID_DESC' + | 'LEVEL_REQUIREMENTS_TABLE_NAME_ASC' + | 'LEVEL_REQUIREMENTS_TABLE_NAME_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RECORD_EVENT_ASC' + | 'RECORD_EVENT_DESC' + | 'REMOVE_EVENT_ASC' + | 'REMOVE_EVENT_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STEPS_REQUIRED_ASC' + | 'STEPS_REQUIRED_DESC' + | 'TG_ACHIEVEMENT_REWARD_ASC' + | 'TG_ACHIEVEMENT_REWARD_DESC' + | 'TG_CHECK_ACHIEVEMENTS_ASC' + | 'TG_CHECK_ACHIEVEMENTS_DESC' + | 'TG_EVENT_ASC' + | 'TG_EVENT_BOOL_ASC' + | 'TG_EVENT_BOOL_DESC' + | 'TG_EVENT_DESC' + | 'TG_EVENT_TOGGLE_ASC' + | 'TG_EVENT_TOGGLE_BOOL_ASC' + | 'TG_EVENT_TOGGLE_BOOL_DESC' + | 'TG_EVENT_TOGGLE_DESC' + | 'TG_UPDATE_AGGREGATES_ASC' + | 'TG_UPDATE_AGGREGATES_DESC' + | 'UPSERT_AGGREGATE_ASC' + | 'UPSERT_AGGREGATE_DESC'; +export type FunctionDeploymentModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DEPLOYMENTS_TABLE_ID_ASC' + | 'DEPLOYMENTS_TABLE_ID_DESC' + | 'DEPLOYMENTS_TABLE_NAME_ASC' + | 'DEPLOYMENTS_TABLE_NAME_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type FunctionInvocationModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'ATTEMPTS_TABLE_ID_ASC' + | 'ATTEMPTS_TABLE_ID_DESC' + | 'ATTEMPTS_TABLE_NAME_ASC' + | 'ATTEMPTS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EXECUTION_LOGS_TABLE_ID_ASC' + | 'EXECUTION_LOGS_TABLE_ID_DESC' + | 'EXECUTION_LOGS_TABLE_NAME_ASC' + | 'EXECUTION_LOGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATIONS_TABLE_ID_ASC' + | 'INVOCATIONS_TABLE_ID_DESC' + | 'INVOCATIONS_TABLE_NAME_ASC' + | 'INVOCATIONS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type FunctionModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BINDINGS_TABLE_ID_ASC' + | 'BINDINGS_TABLE_ID_DESC' + | 'BINDINGS_TABLE_NAME_ASC' + | 'BINDINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DEFINITIONS_TABLE_ID_ASC' + | 'DEFINITIONS_TABLE_ID_DESC' + | 'DEFINITIONS_TABLE_NAME_ASC' + | 'DEFINITIONS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HAS_CRON_ASC' + | 'HAS_CRON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEDULES_TABLE_ID_ASC' + | 'SCHEDULES_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type GraphExecutionModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_ID_ASC' + | 'EXECUTIONS_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_NAME_ASC' + | 'EXECUTIONS_TABLE_NAME_DESC' + | 'GRAPH_MODULE_ID_ASC' + | 'GRAPH_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODE_STATES_TABLE_ID_ASC' + | 'NODE_STATES_TABLE_ID_DESC' + | 'NODE_STATES_TABLE_NAME_ASC' + | 'NODE_STATES_TABLE_NAME_DESC' + | 'OUTPUTS_TABLE_ID_ASC' + | 'OUTPUTS_TABLE_ID_DESC' + | 'OUTPUTS_TABLE_NAME_ASC' + | 'OUTPUTS_TABLE_NAME_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type GraphModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GRAPHS_TABLE_ID_ASC' + | 'GRAPHS_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_ID_ASC' + | 'PUBLIC_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type HierarchyModuleOrderBy = + | 'CHART_EDGES_TABLE_ID_ASC' + | 'CHART_EDGES_TABLE_ID_DESC' + | 'CHART_EDGES_TABLE_NAME_ASC' + | 'CHART_EDGES_TABLE_NAME_DESC' + | 'CHART_EDGE_GRANTS_TABLE_ID_ASC' + | 'CHART_EDGE_GRANTS_TABLE_ID_DESC' + | 'CHART_EDGE_GRANTS_TABLE_NAME_ASC' + | 'CHART_EDGE_GRANTS_TABLE_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GET_MANAGERS_FUNCTION_ASC' + | 'GET_MANAGERS_FUNCTION_DESC' + | 'GET_SUBORDINATES_FUNCTION_ASC' + | 'GET_SUBORDINATES_FUNCTION_DESC' + | 'HIERARCHY_SPRT_TABLE_ID_ASC' + | 'HIERARCHY_SPRT_TABLE_ID_DESC' + | 'HIERARCHY_SPRT_TABLE_NAME_ASC' + | 'HIERARCHY_SPRT_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_MANAGER_OF_FUNCTION_ASC' + | 'IS_MANAGER_OF_FUNCTION_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'REBUILD_HIERARCHY_FUNCTION_ASC' + | 'REBUILD_HIERARCHY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SPRT_TABLE_NAME_ASC' + | 'SPRT_TABLE_NAME_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type HttpRouteModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'HTTP_ROUTES_TABLE_ID_ASC' + | 'HTTP_ROUTES_TABLE_ID_DESC' + | 'HTTP_ROUTES_TABLE_NAME_ASC' + | 'HTTP_ROUTES_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVER_FUNCTION_NAME_ASC' + | 'RESOLVER_FUNCTION_NAME_DESC' + | 'RESOURCE_MODULE_ID_ASC' + | 'RESOURCE_MODULE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORAGE_MODULE_ID_ASC' + | 'STORAGE_MODULE_ID_DESC'; +export type I18NModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SETTINGS_TABLE_ID_ASC' + | 'SETTINGS_TABLE_ID_DESC'; +export type IdentityProvidersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type InferenceLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INFERENCE_LOG_TABLE_ID_ASC' + | 'INFERENCE_LOG_TABLE_ID_DESC' + | 'INFERENCE_LOG_TABLE_NAME_ASC' + | 'INFERENCE_LOG_TABLE_NAME_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type InfraConfigModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CONFIG_TABLE_ID_ASC' + | 'CONFIG_TABLE_ID_DESC' + | 'CONFIG_TABLE_NAME_ASC' + | 'CONFIG_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type InfraSecretsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SECRETS_TABLE_NAME_ASC' + | 'SECRETS_TABLE_NAME_DESC'; +export type IntegrationProvidersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type InternalSecretsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERNAL_SECRETS_TABLE_ID_ASC' + | 'INTERNAL_SECRETS_TABLE_ID_DESC' + | 'INTERNAL_SECRETS_TABLE_NAME_ASC' + | 'INTERNAL_SECRETS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type InvitesModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CLAIMED_INVITES_TABLE_ID_ASC' + | 'CLAIMED_INVITES_TABLE_ID_DESC' + | 'CLAIMED_INVITES_TABLE_NAME_ASC' + | 'CLAIMED_INVITES_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EMAILS_TABLE_ID_ASC' + | 'EMAILS_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITES_TABLE_ID_ASC' + | 'INVITES_TABLE_ID_DESC' + | 'INVITES_TABLE_NAME_ASC' + | 'INVITES_TABLE_NAME_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SUBMIT_INVITE_CODE_FUNCTION_ASC' + | 'SUBMIT_INVITE_CODE_FUNCTION_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type LimitsModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'AGGREGATE_TABLE_ID_ASC' + | 'AGGREGATE_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CAP_CHECK_TRIGGER_ASC' + | 'CAP_CHECK_TRIGGER_DESC' + | 'CREDIT_CODES_TABLE_ID_ASC' + | 'CREDIT_CODES_TABLE_ID_DESC' + | 'CREDIT_CODE_ITEMS_TABLE_ID_ASC' + | 'CREDIT_CODE_ITEMS_TABLE_ID_DESC' + | 'CREDIT_REDEMPTIONS_TABLE_ID_ASC' + | 'CREDIT_REDEMPTIONS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_TABLE_ID_ASC' + | 'DEFAULT_TABLE_ID_DESC' + | 'DEFAULT_TABLE_NAME_ASC' + | 'DEFAULT_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EVENTS_TABLE_ID_ASC' + | 'EVENTS_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_ASC' + | 'LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_DESC' + | 'LIMIT_CAPS_DEFAULTS_TABLE_ID_ASC' + | 'LIMIT_CAPS_DEFAULTS_TABLE_ID_DESC' + | 'LIMIT_CAPS_TABLE_ID_ASC' + | 'LIMIT_CAPS_TABLE_ID_DESC' + | 'LIMIT_CHECK_FUNCTION_ASC' + | 'LIMIT_CHECK_FUNCTION_DESC' + | 'LIMIT_CHECK_SOFT_FUNCTION_ASC' + | 'LIMIT_CHECK_SOFT_FUNCTION_DESC' + | 'LIMIT_CREDITS_TABLE_ID_ASC' + | 'LIMIT_CREDITS_TABLE_ID_DESC' + | 'LIMIT_DECREMENT_FUNCTION_ASC' + | 'LIMIT_DECREMENT_FUNCTION_DESC' + | 'LIMIT_DECREMENT_TRIGGER_ASC' + | 'LIMIT_DECREMENT_TRIGGER_DESC' + | 'LIMIT_INCREMENT_FUNCTION_ASC' + | 'LIMIT_INCREMENT_FUNCTION_DESC' + | 'LIMIT_INCREMENT_TRIGGER_ASC' + | 'LIMIT_INCREMENT_TRIGGER_DESC' + | 'LIMIT_UPDATE_TRIGGER_ASC' + | 'LIMIT_UPDATE_TRIGGER_DESC' + | 'LIMIT_WARNINGS_TABLE_ID_ASC' + | 'LIMIT_WARNINGS_TABLE_ID_DESC' + | 'LIMIT_WARNING_STATE_TABLE_ID_ASC' + | 'LIMIT_WARNING_STATE_TABLE_ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVE_CAP_FUNCTION_ASC' + | 'RESOLVE_CAP_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type MembershipTypesModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type MembershipsModuleOrderBy = + | 'ACTOR_MASK_CHECK_ASC' + | 'ACTOR_MASK_CHECK_DESC' + | 'ACTOR_PERM_CHECK_ASC' + | 'ACTOR_PERM_CHECK_DESC' + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'ADMIN_GRANTS_TABLE_ID_ASC' + | 'ADMIN_GRANTS_TABLE_ID_DESC' + | 'ADMIN_GRANTS_TABLE_NAME_ASC' + | 'ADMIN_GRANTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_LIMITS_TABLE_ID_ASC' + | 'DEFAULT_LIMITS_TABLE_ID_DESC' + | 'DEFAULT_PERMISSIONS_TABLE_ID_ASC' + | 'DEFAULT_PERMISSIONS_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_IDS_BY_MASK_ASC' + | 'ENTITY_IDS_BY_MASK_DESC' + | 'ENTITY_IDS_BY_PERM_ASC' + | 'ENTITY_IDS_BY_PERM_DESC' + | 'ENTITY_IDS_FUNCTION_ASC' + | 'ENTITY_IDS_FUNCTION_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ENTITY_TABLE_OWNER_ID_ASC' + | 'ENTITY_TABLE_OWNER_ID_DESC' + | 'GET_ORG_FN_ASC' + | 'GET_ORG_FN_DESC' + | 'GRANTS_TABLE_ID_ASC' + | 'GRANTS_TABLE_ID_DESC' + | 'GRANTS_TABLE_NAME_ASC' + | 'GRANTS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LIMITS_TABLE_ID_ASC' + | 'LIMITS_TABLE_ID_DESC' + | 'MEMBERSHIPS_TABLE_ID_ASC' + | 'MEMBERSHIPS_TABLE_ID_DESC' + | 'MEMBERSHIPS_TABLE_NAME_ASC' + | 'MEMBERSHIPS_TABLE_NAME_DESC' + | 'MEMBERSHIP_DEFAULTS_TABLE_ID_ASC' + | 'MEMBERSHIP_DEFAULTS_TABLE_ID_DESC' + | 'MEMBERSHIP_DEFAULTS_TABLE_NAME_ASC' + | 'MEMBERSHIP_DEFAULTS_TABLE_NAME_DESC' + | 'MEMBERSHIP_SETTINGS_TABLE_ID_ASC' + | 'MEMBERSHIP_SETTINGS_TABLE_ID_DESC' + | 'MEMBERSHIP_SETTINGS_TABLE_NAME_ASC' + | 'MEMBERSHIP_SETTINGS_TABLE_NAME_DESC' + | 'MEMBERS_TABLE_ID_ASC' + | 'MEMBERS_TABLE_ID_DESC' + | 'MEMBERS_TABLE_NAME_ASC' + | 'MEMBERS_TABLE_NAME_DESC' + | 'MEMBER_PROFILES_TABLE_ID_ASC' + | 'MEMBER_PROFILES_TABLE_ID_DESC' + | 'NATURAL' + | 'OWNER_GRANTS_TABLE_ID_ASC' + | 'OWNER_GRANTS_TABLE_ID_DESC' + | 'OWNER_GRANTS_TABLE_NAME_ASC' + | 'OWNER_GRANTS_TABLE_NAME_DESC' + | 'PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSIONS_TABLE_ID_DESC' + | 'PERMISSION_DEFAULT_GRANTS_TABLE_ID_ASC' + | 'PERMISSION_DEFAULT_GRANTS_TABLE_ID_DESC' + | 'PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SPRT_TABLE_ID_ASC' + | 'SPRT_TABLE_ID_DESC'; +export type MerkleStoreModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COMMIT_TABLE_ID_ASC' + | 'COMMIT_TABLE_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'FUNCTION_PREFIX_ASC' + | 'FUNCTION_PREFIX_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OBJECT_TABLE_ID_ASC' + | 'OBJECT_TABLE_ID_DESC' + | 'PERMISSION_KEY_ASC' + | 'PERMISSION_KEY_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORE_TABLE_ID_ASC' + | 'STORE_TABLE_ID_DESC'; +export type NamespaceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' + | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type NotificationsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHANNELS_TABLE_ID_ASC' + | 'CHANNELS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DELIVERY_LOG_TABLE_ID_ASC' + | 'DELIVERY_LOG_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'HAS_CHANNELS_ASC' + | 'HAS_CHANNELS_DESC' + | 'HAS_DIGEST_METADATA_ASC' + | 'HAS_DIGEST_METADATA_DESC' + | 'HAS_PREFERENCES_ASC' + | 'HAS_PREFERENCES_DESC' + | 'HAS_SETTINGS_EXTENSION_ASC' + | 'HAS_SETTINGS_EXTENSION_DESC' + | 'HAS_SUBSCRIPTIONS_ASC' + | 'HAS_SUBSCRIPTIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NOTIFICATIONS_TABLE_ID_ASC' + | 'NOTIFICATIONS_TABLE_ID_DESC' + | 'ORGANIZATION_SETTINGS_TABLE_ID_ASC' + | 'ORGANIZATION_SETTINGS_TABLE_ID_DESC' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PREFERENCES_TABLE_ID_ASC' + | 'PREFERENCES_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'READ_STATE_TABLE_ID_ASC' + | 'READ_STATE_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SUPPRESSIONS_TABLE_ID_ASC' + | 'SUPPRESSIONS_TABLE_ID_DESC' + | 'USER_SETTINGS_TABLE_ID_ASC' + | 'USER_SETTINGS_TABLE_ID_DESC'; +export type PermissionsModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BITLEN_ASC' + | 'BITLEN_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_TABLE_ID_ASC' + | 'DEFAULT_TABLE_ID_DESC' + | 'DEFAULT_TABLE_NAME_ASC' + | 'DEFAULT_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GET_BY_MASK_ASC' + | 'GET_BY_MASK_DESC' + | 'GET_MASK_ASC' + | 'GET_MASK_BY_NAME_ASC' + | 'GET_MASK_BY_NAME_DESC' + | 'GET_MASK_DESC' + | 'GET_PADDED_MASK_ASC' + | 'GET_PADDED_MASK_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type PhoneNumbersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type PlansModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPLY_BILLING_PLAN_FUNCTION_ASC' + | 'APPLY_BILLING_PLAN_FUNCTION_DESC' + | 'APPLY_PLAN_AGGREGATE_FUNCTION_ASC' + | 'APPLY_PLAN_AGGREGATE_FUNCTION_DESC' + | 'APPLY_PLAN_CAPS_FUNCTION_ASC' + | 'APPLY_PLAN_CAPS_FUNCTION_DESC' + | 'APPLY_PLAN_FUNCTION_ASC' + | 'APPLY_PLAN_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PLANS_TABLE_ID_ASC' + | 'PLANS_TABLE_ID_DESC' + | 'PLANS_TABLE_NAME_ASC' + | 'PLANS_TABLE_NAME_DESC' + | 'PLAN_CAPS_TABLE_ID_ASC' + | 'PLAN_CAPS_TABLE_ID_DESC' + | 'PLAN_LIMITS_TABLE_ID_ASC' + | 'PLAN_LIMITS_TABLE_ID_DESC' + | 'PLAN_LIMITS_TABLE_NAME_ASC' + | 'PLAN_LIMITS_TABLE_NAME_DESC' + | 'PLAN_METER_LIMITS_TABLE_ID_ASC' + | 'PLAN_METER_LIMITS_TABLE_ID_DESC' + | 'PLAN_OVERRIDES_TABLE_ID_ASC' + | 'PLAN_OVERRIDES_TABLE_ID_DESC' + | 'PLAN_PRICING_TABLE_ID_ASC' + | 'PLAN_PRICING_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type PrincipalAuthModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'CREATE_ORG_API_KEY_FUNCTION_ASC' + | 'CREATE_ORG_API_KEY_FUNCTION_DESC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_PRINCIPAL_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_PRINCIPAL_FUNCTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPALS_TABLE_ID_ASC' + | 'PRINCIPALS_TABLE_ID_DESC' + | 'PRINCIPALS_TABLE_NAME_ASC' + | 'PRINCIPALS_TABLE_NAME_DESC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_ASC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_DESC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC' + | 'REVOKE_ORG_API_KEY_FUNCTION_ASC' + | 'REVOKE_ORG_API_KEY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type ProfilesModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MEMBERSHIPS_TABLE_ID_ASC' + | 'MEMBERSHIPS_TABLE_ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSIONS_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_ID_ASC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_ID_DESC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_NAME_ASC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_NAME_DESC' + | 'PROFILE_GRANTS_TABLE_ID_ASC' + | 'PROFILE_GRANTS_TABLE_ID_DESC' + | 'PROFILE_GRANTS_TABLE_NAME_ASC' + | 'PROFILE_GRANTS_TABLE_NAME_DESC' + | 'PROFILE_PERMISSIONS_TABLE_ID_ASC' + | 'PROFILE_PERMISSIONS_TABLE_ID_DESC' + | 'PROFILE_PERMISSIONS_TABLE_NAME_ASC' + | 'PROFILE_PERMISSIONS_TABLE_NAME_DESC' + | 'PROFILE_TEMPLATES_TABLE_ID_ASC' + | 'PROFILE_TEMPLATES_TABLE_ID_DESC' + | 'PROFILE_TEMPLATES_TABLE_NAME_ASC' + | 'PROFILE_TEMPLATES_TABLE_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type RateLimitMetersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHECK_RATE_LIMIT_FUNCTION_ASC' + | 'CHECK_RATE_LIMIT_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RATE_LIMIT_OVERRIDES_TABLE_ID_ASC' + | 'RATE_LIMIT_OVERRIDES_TABLE_ID_DESC' + | 'RATE_LIMIT_OVERRIDES_TABLE_NAME_ASC' + | 'RATE_LIMIT_OVERRIDES_TABLE_NAME_DESC' + | 'RATE_LIMIT_STATE_TABLE_ID_ASC' + | 'RATE_LIMIT_STATE_TABLE_ID_DESC' + | 'RATE_LIMIT_STATE_TABLE_NAME_ASC' + | 'RATE_LIMIT_STATE_TABLE_NAME_DESC' + | 'RATE_WINDOW_LIMITS_TABLE_ID_ASC' + | 'RATE_WINDOW_LIMITS_TABLE_ID_DESC' + | 'RATE_WINDOW_LIMITS_TABLE_NAME_ASC' + | 'RATE_WINDOW_LIMITS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type RateLimitsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IP_RATE_LIMITS_TABLE_ID_ASC' + | 'IP_RATE_LIMITS_TABLE_ID_DESC' + | 'IP_RATE_LIMITS_TABLE_NAME_ASC' + | 'IP_RATE_LIMITS_TABLE_NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RATE_LIMITS_TABLE_ID_ASC' + | 'RATE_LIMITS_TABLE_ID_DESC' + | 'RATE_LIMITS_TABLE_NAME_ASC' + | 'RATE_LIMITS_TABLE_NAME_DESC' + | 'RATE_LIMIT_SETTINGS_TABLE_ID_ASC' + | 'RATE_LIMIT_SETTINGS_TABLE_ID_DESC' + | 'RATE_LIMIT_SETTINGS_TABLE_NAME_ASC' + | 'RATE_LIMIT_SETTINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type RealtimeModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHANGE_LOG_TABLE_ID_ASC' + | 'CHANGE_LOG_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'LISTENER_NODE_TABLE_ID_ASC' + | 'LISTENER_NODE_TABLE_ID_DESC' + | 'NATURAL' + | 'NOTIFY_CHANNEL_ASC' + | 'NOTIFY_CHANNEL_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'RETENTION_HOURS_ASC' + | 'RETENTION_HOURS_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SOURCE_REGISTRY_TABLE_ID_ASC' + | 'SOURCE_REGISTRY_TABLE_ID_DESC' + | 'SUBSCRIPTIONS_SCHEMA_ID_ASC' + | 'SUBSCRIPTIONS_SCHEMA_ID_DESC'; +export type RelationProvisionOrderBy = + | 'API_REQUIRED_ASC' + | 'API_REQUIRED_DESC' + | 'CREATE_INDEX_ASC' + | 'CREATE_INDEX_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACTION_ASC' + | 'DELETE_ACTION_DESC' + | 'EXPOSE_IN_API_ASC' + | 'EXPOSE_IN_API_DESC' + | 'FIELD_NAME_ASC' + | 'FIELD_NAME_DESC' + | 'GRANTS_ASC' + | 'GRANTS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_REQUIRED_ASC' + | 'IS_REQUIRED_DESC' + | 'JUNCTION_SCHEMA_ID_ASC' + | 'JUNCTION_SCHEMA_ID_DESC' + | 'JUNCTION_TABLE_ID_ASC' + | 'JUNCTION_TABLE_ID_DESC' + | 'JUNCTION_TABLE_NAME_ASC' + | 'JUNCTION_TABLE_NAME_DESC' + | 'NATURAL' + | 'NODES_ASC' + | 'NODES_DESC' + | 'OUT_FIELD_ID_ASC' + | 'OUT_FIELD_ID_DESC' + | 'OUT_JUNCTION_TABLE_ID_ASC' + | 'OUT_JUNCTION_TABLE_ID_DESC' + | 'OUT_SOURCE_FIELD_ID_ASC' + | 'OUT_SOURCE_FIELD_ID_DESC' + | 'OUT_TARGET_FIELD_ID_ASC' + | 'OUT_TARGET_FIELD_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RELATION_TYPE_ASC' + | 'RELATION_TYPE_DESC' + | 'SOURCE_FIELD_NAME_ASC' + | 'SOURCE_FIELD_NAME_DESC' + | 'SOURCE_TABLE_ID_ASC' + | 'SOURCE_TABLE_ID_DESC' + | 'TARGET_FIELD_NAME_ASC' + | 'TARGET_FIELD_NAME_DESC' + | 'TARGET_TABLE_ID_ASC' + | 'TARGET_TABLE_ID_DESC' + | 'USE_COMPOSITE_KEY_ASC' + | 'USE_COMPOSITE_KEY_DESC'; +export type ResourceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_STORE_NAME_ASC' + | 'INSTALLATION_STORE_NAME_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'REQUIREMENTS_STATE_VIEW_NAME_ASC' + | 'REQUIREMENTS_STATE_VIEW_NAME_DESC' + | 'RESOLVED_REQUIREMENTS_VIEW_NAME_ASC' + | 'RESOLVED_REQUIREMENTS_VIEW_NAME_DESC' + | 'RESOURCES_TABLE_ID_ASC' + | 'RESOURCES_TABLE_ID_DESC' + | 'RESOURCES_TABLE_NAME_ASC' + | 'RESOURCES_TABLE_NAME_DESC' + | 'RESOURCE_BILLING_ROLLUP_FUNCTION_ASC' + | 'RESOURCE_BILLING_ROLLUP_FUNCTION_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_DESC' + | 'RESOURCE_EVENTS_TABLE_ID_ASC' + | 'RESOURCE_EVENTS_TABLE_ID_DESC' + | 'RESOURCE_EVENTS_TABLE_NAME_ASC' + | 'RESOURCE_EVENTS_TABLE_NAME_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_DESC' + | 'RESOURCE_STATUS_CHECKS_TABLE_ID_ASC' + | 'RESOURCE_STATUS_CHECKS_TABLE_ID_DESC' + | 'RESOURCE_STATUS_CHECKS_TABLE_NAME_ASC' + | 'RESOURCE_STATUS_CHECKS_TABLE_NAME_DESC' + | 'RESOURCE_USAGE_LOG_TABLE_ID_ASC' + | 'RESOURCE_USAGE_LOG_TABLE_ID_DESC' + | 'RESOURCE_USAGE_LOG_TABLE_NAME_ASC' + | 'RESOURCE_USAGE_LOG_TABLE_NAME_DESC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_ID_ASC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_ID_DESC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_NAME_ASC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_NAME_DESC' + | 'ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type RlsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUTHENTICATE_ASC' + | 'AUTHENTICATE_DESC' + | 'AUTHENTICATE_STRICT_ASC' + | 'AUTHENTICATE_STRICT_DESC' + | 'CURRENT_ROLE_ASC' + | 'CURRENT_ROLE_DESC' + | 'CURRENT_ROLE_ID_ASC' + | 'CURRENT_ROLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type RouteModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAIN_MODULE_ID_ASC' + | 'DOMAIN_MODULE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HOSTNAME_BINDINGS_TABLE_ID_ASC' + | 'HOSTNAME_BINDINGS_TABLE_ID_DESC' + | 'HOSTNAME_BINDINGS_TABLE_NAME_ASC' + | 'HOSTNAME_BINDINGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVER_FUNCTION_NAME_ASC' + | 'RESOLVER_FUNCTION_NAME_DESC' + | 'ROUTES_TABLE_ID_ASC' + | 'ROUTES_TABLE_ID_DESC' + | 'ROUTES_TABLE_NAME_ASC' + | 'ROUTES_TABLE_NAME_DESC' + | 'ROUTE_BINDINGS_TABLE_ID_ASC' + | 'ROUTE_BINDINGS_TABLE_ID_DESC' + | 'ROUTE_BINDINGS_TABLE_NAME_ASC' + | 'ROUTE_BINDINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type SecureTableProvisionOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELDS_ASC' + | 'FIELDS_DESC' + | 'GRANTS_ASC' + | 'GRANTS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODES_ASC' + | 'NODES_DESC' + | 'OUT_FIELDS_ASC' + | 'OUT_FIELDS_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'USE_RLS_ASC' + | 'USE_RLS_DESC'; +export type SessionSecretsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type SessionsModuleOrderBy = + | 'AUTH_SETTINGS_TABLE_ID_ASC' + | 'AUTH_SETTINGS_TABLE_ID_DESC' + | 'AUTH_SETTINGS_TABLE_NAME_ASC' + | 'AUTH_SETTINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_DEFAULT_EXPIRATION_ASC' + | 'SESSIONS_DEFAULT_EXPIRATION_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_NAME_ASC' + | 'SESSIONS_TABLE_NAME_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_NAME_ASC' + | 'SESSION_CREDENTIALS_TABLE_NAME_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type SiteSurfaceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SITES_TABLE_ID_ASC' + | 'SITES_TABLE_ID_DESC' + | 'SITES_TABLE_NAME_ASC' + | 'SITES_TABLE_NAME_DESC' + | 'SITE_METADATA_TABLE_ID_ASC' + | 'SITE_METADATA_TABLE_ID_DESC' + | 'SITE_METADATA_TABLE_NAME_ASC' + | 'SITE_METADATA_TABLE_NAME_DESC' + | 'SITE_MODULES_TABLE_ID_ASC' + | 'SITE_MODULES_TABLE_ID_DESC' + | 'SITE_MODULES_TABLE_NAME_ASC' + | 'SITE_MODULES_TABLE_NAME_DESC' + | 'SITE_THEMES_TABLE_ID_ASC' + | 'SITE_THEMES_TABLE_ID_DESC' + | 'SITE_THEMES_TABLE_NAME_ASC' + | 'SITE_THEMES_TABLE_NAME_DESC'; +export type StorageLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORAGE_LOG_TABLE_ID_ASC' + | 'STORAGE_LOG_TABLE_ID_DESC' + | 'STORAGE_LOG_TABLE_NAME_ASC' + | 'STORAGE_LOG_TABLE_NAME_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type StorageModuleOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BUCKETS_TABLE_ID_ASC' + | 'BUCKETS_TABLE_ID_DESC' + | 'BUCKETS_TABLE_NAME_ASC' + | 'BUCKETS_TABLE_NAME_DESC' + | 'CACHE_TTL_SECONDS_ASC' + | 'CACHE_TTL_SECONDS_DESC' + | 'CONFIRM_UPLOAD_DELAY_ASC' + | 'CONFIRM_UPLOAD_DELAY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_MAX_FILE_SIZE_ASC' + | 'DEFAULT_MAX_FILE_SIZE_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOWNLOAD_URL_EXPIRY_SECONDS_ASC' + | 'DOWNLOAD_URL_EXPIRY_SECONDS_DESC' + | 'ENDPOINT_ASC' + | 'ENDPOINT_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FILES_TABLE_ID_ASC' + | 'FILES_TABLE_ID_DESC' + | 'FILES_TABLE_NAME_ASC' + | 'FILES_TABLE_NAME_DESC' + | 'FILE_EVENTS_TABLE_ID_ASC' + | 'FILE_EVENTS_TABLE_ID_DESC' + | 'HAS_AUDIT_LOG_ASC' + | 'HAS_AUDIT_LOG_DESC' + | 'HAS_CONFIRM_UPLOAD_ASC' + | 'HAS_CONFIRM_UPLOAD_DESC' + | 'HAS_CONTENT_HASH_ASC' + | 'HAS_CONTENT_HASH_DESC' + | 'HAS_CUSTOM_KEYS_ASC' + | 'HAS_CUSTOM_KEYS_DESC' + | 'HAS_PATH_SHARES_ASC' + | 'HAS_PATH_SHARES_DESC' + | 'HAS_VERSIONING_ASC' + | 'HAS_VERSIONING_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_BULK_FILES_ASC' + | 'MAX_BULK_FILES_DESC' + | 'MAX_BULK_TOTAL_SIZE_ASC' + | 'MAX_BULK_TOTAL_SIZE_DESC' + | 'MAX_FILENAME_LENGTH_ASC' + | 'MAX_FILENAME_LENGTH_DESC' + | 'NATURAL' + | 'PATH_SHARES_TABLE_ID_ASC' + | 'PATH_SHARES_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PUBLIC_URL_PREFIX_ASC' + | 'PUBLIC_URL_PREFIX_DESC' + | 'RESTRICT_READS_ASC' + | 'RESTRICT_READS_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'UPLOAD_URL_EXPIRY_SECONDS_ASC' + | 'UPLOAD_URL_EXPIRY_SECONDS_DESC'; +export type TransferLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TRANSFER_LOG_TABLE_ID_ASC' + | 'TRANSFER_LOG_TABLE_ID_DESC' + | 'TRANSFER_LOG_TABLE_NAME_ASC' + | 'TRANSFER_LOG_TABLE_NAME_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type UserAuthModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'AUDITS_TABLE_NAME_ASC' + | 'AUDITS_TABLE_NAME_DESC' + | 'CHECK_PASSWORD_FUNCTION_ASC' + | 'CHECK_PASSWORD_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACCOUNT_FUNCTION_ASC' + | 'DELETE_ACCOUNT_FUNCTION_DESC' + | 'EMAILS_TABLE_ID_ASC' + | 'EMAILS_TABLE_ID_DESC' + | 'ENCRYPTED_TABLE_ID_ASC' + | 'ENCRYPTED_TABLE_ID_DESC' + | 'EXTEND_TOKEN_EXPIRES_ASC' + | 'EXTEND_TOKEN_EXPIRES_DESC' + | 'FORGOT_PASSWORD_FUNCTION_ASC' + | 'FORGOT_PASSWORD_FUNCTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_ASC' + | 'REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_DESC' + | 'RESET_PASSWORD_FUNCTION_ASC' + | 'RESET_PASSWORD_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_ASC' + | 'SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_DESC' + | 'SEND_VERIFICATION_EMAIL_FUNCTION_ASC' + | 'SEND_VERIFICATION_EMAIL_FUNCTION_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SET_PASSWORD_FUNCTION_ASC' + | 'SET_PASSWORD_FUNCTION_DESC' + | 'SIGN_IN_CROSS_ORIGIN_FUNCTION_ASC' + | 'SIGN_IN_CROSS_ORIGIN_FUNCTION_DESC' + | 'SIGN_IN_FUNCTION_ASC' + | 'SIGN_IN_FUNCTION_DESC' + | 'SIGN_OUT_FUNCTION_ASC' + | 'SIGN_OUT_FUNCTION_DESC' + | 'SIGN_UP_FUNCTION_ASC' + | 'SIGN_UP_FUNCTION_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'VERIFY_EMAIL_FUNCTION_ASC' + | 'VERIFY_EMAIL_FUNCTION_DESC' + | 'VERIFY_PASSWORD_FUNCTION_ASC' + | 'VERIFY_PASSWORD_FUNCTION_DESC'; +export type UserCredentialsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UserSettingsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UserStateModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UsersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'TYPE_TABLE_ID_ASC' + | 'TYPE_TABLE_ID_DESC' + | 'TYPE_TABLE_NAME_ASC' + | 'TYPE_TABLE_NAME_DESC'; +export type WebauthnAuthModuleOrderBy = + | 'ATTESTATION_TYPE_ASC' + | 'ATTESTATION_TYPE_DESC' + | 'AUTH_SETTINGS_TABLE_ID_ASC' + | 'AUTH_SETTINGS_TABLE_ID_DESC' + | 'CHALLENGE_EXPIRY_ASC' + | 'CHALLENGE_EXPIRY_DESC' + | 'CREDENTIALS_TABLE_ID_ASC' + | 'CREDENTIALS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORIGIN_ALLOWLIST_ASC' + | 'ORIGIN_ALLOWLIST_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRE_USER_VERIFICATION_ASC' + | 'REQUIRE_USER_VERIFICATION_DESC' + | 'RESIDENT_KEY_ASC' + | 'RESIDENT_KEY_DESC' + | 'RP_ID_ASC' + | 'RP_ID_DESC' + | 'RP_NAME_ASC' + | 'RP_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_SECRETS_TABLE_ID_ASC' + | 'SESSION_SECRETS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type WebauthnCredentialsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type WebhookModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_INVOCATION_MODULE_ID_ASC' + | 'FUNCTION_INVOCATION_MODULE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INFRA_SECRETS_MODULE_ID_ASC' + | 'INFRA_SECRETS_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'WEBHOOK_ENDPOINTS_TABLE_ID_ASC' + | 'WEBHOOK_ENDPOINTS_TABLE_ID_DESC' + | 'WEBHOOK_ENDPOINTS_TABLE_NAME_ASC' + | 'WEBHOOK_ENDPOINTS_TABLE_NAME_DESC' + | 'WEBHOOK_EVENTS_TABLE_ID_ASC' + | 'WEBHOOK_EVENTS_TABLE_ID_DESC' + | 'WEBHOOK_EVENTS_TABLE_NAME_ASC' + | 'WEBHOOK_EVENTS_TABLE_NAME_DESC'; // ============ CRUD Input Types ============ export interface CreateAgentModuleInput { clientMutationId?: string; @@ -11414,17 +14435,17 @@ export interface DeleteWebhookModuleInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Blueprint": { - "blueprintConstructions": "BlueprintConstruction" + Blueprint: { + blueprintConstructions: 'BlueprintConstruction', }, - "BlueprintTemplate": { - "blueprintTemplatesByForkedFromId": "BlueprintTemplate", - "blueprintsByTemplateId": "Blueprint" + BlueprintTemplate: { + blueprintTemplatesByForkedFromId: 'BlueprintTemplate', + blueprintsByTemplateId: 'Blueprint', + }, + MerkleStoreModule: { + dbPresetModules: 'DbPresetModule', + graphModules: 'GraphModule', }, - "MerkleStoreModule": { - "dbPresetModules": "DbPresetModule", - "graphModules": "GraphModule" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ConstructBlueprintInput { @@ -18549,4 +21570,4 @@ export type WebhookModuleEdgeSelect = { node?: { select: WebhookModuleSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/modules/orm/models/agentModule.ts b/sdk/constructive-cli/src/modules/orm/models/agentModule.ts index 27f6100e9a..ec52583704 100644 --- a/sdk/constructive-cli/src/modules/orm/models/agentModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/agentModule.ts @@ -3,56 +3,96 @@ * @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 { AgentModule, AgentModuleWithRelations, AgentModuleSelect, AgentModuleFilter, AgentModuleOrderBy, CreateAgentModuleInput, UpdateAgentModuleInput, AgentModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentModule, + AgentModuleWithRelations, + AgentModuleSelect, + AgentModuleFilter, + AgentModuleOrderBy, + CreateAgentModuleInput, + UpdateAgentModuleInput, + AgentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentModule", "agentModules", 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 - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentModule', + 'agentModules', + 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, + }, + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModules", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentModule", "agentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentModule', + 'agentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModule", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentModule": data.agentModules?.nodes?.[0] ?? null - }) + agentModule: data.agentModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentModule", "agentModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentModule', + 'agentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModule", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentModule": data.agentModules?.nodes?.[0] ?? null - }) + agentModule: data.agentModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentModule", "createAgentModule", "agentModule", args.select, args.data, "CreateAgentModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentModule', + 'createAgentModule', + 'agentModule', + args.select, + args.data, + 'CreateAgentModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "createAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'createAgentModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentModule", "updateAgentModule", "agentModule", args.select, args.where.id, args.data, "UpdateAgentModuleInput", "id", "agentModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentModule', + 'updateAgentModule', + 'agentModule', + args.select, + args.where.id, + args.data, + 'UpdateAgentModuleInput', + 'id', + 'agentModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "updateAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'updateAgentModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentModule", "deleteAgentModule", "agentModule", { - id: args.where.id - }, "DeleteAgentModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentModule', + 'deleteAgentModule', + 'agentModule', + { + id: args.where.id, + }, + 'DeleteAgentModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "deleteAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'deleteAgentModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/apiSurfaceModule.ts b/sdk/constructive-cli/src/modules/orm/models/apiSurfaceModule.ts index 449acbf127..12cb1d83e3 100644 --- a/sdk/constructive-cli/src/modules/orm/models/apiSurfaceModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/apiSurfaceModule.ts @@ -3,56 +3,96 @@ * @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 { ApiSurfaceModule, ApiSurfaceModuleWithRelations, ApiSurfaceModuleSelect, ApiSurfaceModuleFilter, ApiSurfaceModuleOrderBy, CreateApiSurfaceModuleInput, UpdateApiSurfaceModuleInput, ApiSurfaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSurfaceModule, + ApiSurfaceModuleWithRelations, + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy, + CreateApiSurfaceModuleInput, + UpdateApiSurfaceModuleInput, + ApiSurfaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSurfaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSurfaceModule", "apiSurfaceModules", 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 - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + 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, + }, + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModules", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSurfaceModule", "apiSurfaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModule", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSurfaceModule": data.apiSurfaceModules?.nodes?.[0] ?? null - }) + apiSurfaceModule: data.apiSurfaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSurfaceModule", "apiSurfaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModule", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSurfaceModule": data.apiSurfaceModules?.nodes?.[0] ?? null - }) + apiSurfaceModule: data.apiSurfaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSurfaceModule", "createApiSurfaceModule", "apiSurfaceModule", args.select, args.data, "CreateApiSurfaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSurfaceModule', + 'createApiSurfaceModule', + 'apiSurfaceModule', + args.select, + args.data, + 'CreateApiSurfaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "createApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'createApiSurfaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSurfaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSurfaceModule", "updateApiSurfaceModule", "apiSurfaceModule", args.select, args.where.id, args.data, "UpdateApiSurfaceModuleInput", "id", "apiSurfaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSurfaceModule', + 'updateApiSurfaceModule', + 'apiSurfaceModule', + args.select, + args.where.id, + args.data, + 'UpdateApiSurfaceModuleInput', + 'id', + 'apiSurfaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "updateApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'updateApiSurfaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSurfaceModule", "deleteApiSurfaceModule", "apiSurfaceModule", { - id: args.where.id - }, "DeleteApiSurfaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSurfaceModule', + 'deleteApiSurfaceModule', + 'apiSurfaceModule', + { + id: args.where.id, + }, + 'DeleteApiSurfaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "deleteApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'deleteApiSurfaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/appModule.ts b/sdk/constructive-cli/src/modules/orm/models/appModule.ts index 4a23e0239d..78c5786d0e 100644 --- a/sdk/constructive-cli/src/modules/orm/models/appModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/appModule.ts @@ -3,56 +3,96 @@ * @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 { AppModule, AppModuleWithRelations, AppModuleSelect, AppModuleFilter, AppModuleOrderBy, CreateAppModuleInput, UpdateAppModuleInput, AppModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppModule, + AppModuleWithRelations, + AppModuleSelect, + AppModuleFilter, + AppModuleOrderBy, + CreateAppModuleInput, + UpdateAppModuleInput, + AppModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppModule", "appModules", 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 - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppModule', + 'appModules', + 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, + }, + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModules", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppModule", "appModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppModule', + 'appModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModule", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "appModule": data.appModules?.nodes?.[0] ?? null - }) + appModule: data.appModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppModule", "appModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppModule', + 'appModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModule", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "appModule": data.appModules?.nodes?.[0] ?? null - }) + appModule: data.appModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppModule", "createAppModule", "appModule", args.select, args.data, "CreateAppModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppModule', + 'createAppModule', + 'appModule', + args.select, + args.data, + 'CreateAppModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "createAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'createAppModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppModule", "updateAppModule", "appModule", args.select, args.where.id, args.data, "UpdateAppModuleInput", "id", "appModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppModule', + 'updateAppModule', + 'appModule', + args.select, + args.where.id, + args.data, + 'UpdateAppModuleInput', + 'id', + 'appModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "updateAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'updateAppModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppModule", "deleteAppModule", "appModule", { - id: args.where.id - }, "DeleteAppModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppModule', + 'deleteAppModule', + 'appModule', + { + id: args.where.id, + }, + 'DeleteAppModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "deleteAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'deleteAppModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/billingModule.ts b/sdk/constructive-cli/src/modules/orm/models/billingModule.ts index cc721490cc..432eb970f3 100644 --- a/sdk/constructive-cli/src/modules/orm/models/billingModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/billingModule.ts @@ -3,56 +3,96 @@ * @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 { BillingModule, BillingModuleWithRelations, BillingModuleSelect, BillingModuleFilter, BillingModuleOrderBy, CreateBillingModuleInput, UpdateBillingModuleInput, BillingModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BillingModule, + BillingModuleWithRelations, + BillingModuleSelect, + BillingModuleFilter, + BillingModuleOrderBy, + CreateBillingModuleInput, + UpdateBillingModuleInput, + BillingModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BillingModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("BillingModule", "billingModules", 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 - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BillingModule', + 'billingModules', + 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, + }, + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModules", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BillingModule", "billingModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BillingModule', + 'billingModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModule", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BillingModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingModule": data.billingModules?.nodes?.[0] ?? null - }) + billingModule: data.billingModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BillingModule", "billingModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BillingModule', + 'billingModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModule", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BillingModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingModule": data.billingModules?.nodes?.[0] ?? null - }) + billingModule: data.billingModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BillingModule", "createBillingModule", "billingModule", args.select, args.data, "CreateBillingModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BillingModule', + 'createBillingModule', + 'billingModule', + args.select, + args.data, + 'CreateBillingModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "createBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'createBillingModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BillingModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BillingModule", "updateBillingModule", "billingModule", args.select, args.where.id, args.data, "UpdateBillingModuleInput", "id", "billingModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BillingModule', + 'updateBillingModule', + 'billingModule', + args.select, + args.where.id, + args.data, + 'UpdateBillingModuleInput', + 'id', + 'billingModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "updateBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'updateBillingModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BillingModule", "deleteBillingModule", "billingModule", { - id: args.where.id - }, "DeleteBillingModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BillingModule', + 'deleteBillingModule', + 'billingModule', + { + id: args.where.id, + }, + 'DeleteBillingModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "deleteBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'deleteBillingModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/billingProviderModule.ts b/sdk/constructive-cli/src/modules/orm/models/billingProviderModule.ts index a6c5d8c34c..16a8a68460 100644 --- a/sdk/constructive-cli/src/modules/orm/models/billingProviderModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/billingProviderModule.ts @@ -3,56 +3,98 @@ * @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 { BillingProviderModule, BillingProviderModuleWithRelations, BillingProviderModuleSelect, BillingProviderModuleFilter, BillingProviderModuleOrderBy, CreateBillingProviderModuleInput, UpdateBillingProviderModuleInput, BillingProviderModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BillingProviderModule, + BillingProviderModuleWithRelations, + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy, + CreateBillingProviderModuleInput, + UpdateBillingProviderModuleInput, + BillingProviderModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BillingProviderModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - billingProviderModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + billingProviderModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("BillingProviderModule", "billingProviderModules", 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 - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BillingProviderModule', + 'billingProviderModules', + 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, + }, + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModules", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingProviderModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BillingProviderModule", "billingProviderModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BillingProviderModule', + 'billingProviderModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModule", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class BillingProviderModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingProviderModule": data.billingProviderModules?.nodes?.[0] ?? null - }) + billingProviderModule: data.billingProviderModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ billingProviderModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BillingProviderModule", "billingProviderModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BillingProviderModule', + 'billingProviderModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModule", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class BillingProviderModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingProviderModule": data.billingProviderModules?.nodes?.[0] ?? null - }) + billingProviderModule: data.billingProviderModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BillingProviderModule", "createBillingProviderModule", "billingProviderModule", args.select, args.data, "CreateBillingProviderModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BillingProviderModule', + 'createBillingProviderModule', + 'billingProviderModule', + args.select, + args.data, + 'CreateBillingProviderModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "createBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'createBillingProviderModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BillingProviderModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BillingProviderModule", "updateBillingProviderModule", "billingProviderModule", args.select, args.where.id, args.data, "UpdateBillingProviderModuleInput", "id", "billingProviderModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BillingProviderModule', + 'updateBillingProviderModule', + 'billingProviderModule', + args.select, + args.where.id, + args.data, + 'UpdateBillingProviderModuleInput', + 'id', + 'billingProviderModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "updateBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'updateBillingProviderModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BillingProviderModule", "deleteBillingProviderModule", "billingProviderModule", { - id: args.where.id - }, "DeleteBillingProviderModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BillingProviderModule', + 'deleteBillingProviderModule', + 'billingProviderModule', + { + id: args.where.id, + }, + 'DeleteBillingProviderModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "deleteBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'deleteBillingProviderModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/blueprint.ts b/sdk/constructive-cli/src/modules/orm/models/blueprint.ts index 10b60d528d..48e4dc3d89 100644 --- a/sdk/constructive-cli/src/modules/orm/models/blueprint.ts +++ b/sdk/constructive-cli/src/modules/orm/models/blueprint.ts @@ -3,56 +3,96 @@ * @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 { Blueprint, BlueprintWithRelations, BlueprintSelect, BlueprintFilter, BlueprintOrderBy, CreateBlueprintInput, UpdateBlueprintInput, BlueprintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Blueprint, + BlueprintWithRelations, + BlueprintSelect, + BlueprintFilter, + BlueprintOrderBy, + CreateBlueprintInput, + UpdateBlueprintInput, + BlueprintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Blueprint", "blueprints", 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 - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Blueprint', + 'blueprints', + 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, + }, + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprints", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Blueprint", "blueprints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Blueprint', + 'blueprints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprint", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BlueprintModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprint": data.blueprints?.nodes?.[0] ?? null - }) + blueprint: data.blueprints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Blueprint", "blueprints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Blueprint', + 'blueprints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprint", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BlueprintModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprint": data.blueprints?.nodes?.[0] ?? null - }) + blueprint: data.blueprints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Blueprint", "createBlueprint", "blueprint", args.select, args.data, "CreateBlueprintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Blueprint', + 'createBlueprint', + 'blueprint', + args.select, + args.data, + 'CreateBlueprintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "createBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'createBlueprint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Blueprint", "updateBlueprint", "blueprint", args.select, args.where.id, args.data, "UpdateBlueprintInput", "id", "blueprintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Blueprint', + 'updateBlueprint', + 'blueprint', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintInput', + 'id', + 'blueprintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "updateBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'updateBlueprint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Blueprint", "deleteBlueprint", "blueprint", { - id: args.where.id - }, "DeleteBlueprintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Blueprint', + 'deleteBlueprint', + 'blueprint', + { + id: args.where.id, + }, + 'DeleteBlueprintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "deleteBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'deleteBlueprint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/blueprintConstruction.ts b/sdk/constructive-cli/src/modules/orm/models/blueprintConstruction.ts index 3584463b31..ee6a157760 100644 --- a/sdk/constructive-cli/src/modules/orm/models/blueprintConstruction.ts +++ b/sdk/constructive-cli/src/modules/orm/models/blueprintConstruction.ts @@ -3,56 +3,98 @@ * @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 { BlueprintConstruction, BlueprintConstructionWithRelations, BlueprintConstructionSelect, BlueprintConstructionFilter, BlueprintConstructionOrderBy, CreateBlueprintConstructionInput, UpdateBlueprintConstructionInput, BlueprintConstructionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BlueprintConstruction, + BlueprintConstructionWithRelations, + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy, + CreateBlueprintConstructionInput, + UpdateBlueprintConstructionInput, + BlueprintConstructionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintConstructionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - blueprintConstructions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + blueprintConstructions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintConstruction", "blueprintConstructions", 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 - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + 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, + }, + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstructions", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstructions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintConstruction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BlueprintConstruction", "blueprintConstructions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstruction", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstruction', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class BlueprintConstructionModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintConstruction": data.blueprintConstructions?.nodes?.[0] ?? null - }) + blueprintConstruction: data.blueprintConstructions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintConstruction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintConstruction", "blueprintConstructions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstruction", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstruction', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class BlueprintConstructionModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintConstruction": data.blueprintConstructions?.nodes?.[0] ?? null - }) + blueprintConstruction: data.blueprintConstructions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BlueprintConstruction", "createBlueprintConstruction", "blueprintConstruction", args.select, args.data, "CreateBlueprintConstructionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BlueprintConstruction', + 'createBlueprintConstruction', + 'blueprintConstruction', + args.select, + args.data, + 'CreateBlueprintConstructionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "createBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'createBlueprintConstruction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintConstructionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BlueprintConstruction", "updateBlueprintConstruction", "blueprintConstruction", args.select, args.where.id, args.data, "UpdateBlueprintConstructionInput", "id", "blueprintConstructionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BlueprintConstruction', + 'updateBlueprintConstruction', + 'blueprintConstruction', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintConstructionInput', + 'id', + 'blueprintConstructionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "updateBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'updateBlueprintConstruction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BlueprintConstruction", "deleteBlueprintConstruction", "blueprintConstruction", { - id: args.where.id - }, "DeleteBlueprintConstructionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BlueprintConstruction', + 'deleteBlueprintConstruction', + 'blueprintConstruction', + { + id: args.where.id, + }, + 'DeleteBlueprintConstructionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "deleteBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'deleteBlueprintConstruction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/blueprintTemplate.ts b/sdk/constructive-cli/src/modules/orm/models/blueprintTemplate.ts index 92dce7b1c4..486ef1c8e2 100644 --- a/sdk/constructive-cli/src/modules/orm/models/blueprintTemplate.ts +++ b/sdk/constructive-cli/src/modules/orm/models/blueprintTemplate.ts @@ -3,56 +3,96 @@ * @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 { BlueprintTemplate, BlueprintTemplateWithRelations, BlueprintTemplateSelect, BlueprintTemplateFilter, BlueprintTemplateOrderBy, CreateBlueprintTemplateInput, UpdateBlueprintTemplateInput, BlueprintTemplatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BlueprintTemplate, + BlueprintTemplateWithRelations, + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy, + CreateBlueprintTemplateInput, + UpdateBlueprintTemplateInput, + BlueprintTemplatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintTemplateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplates: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintTemplate", "blueprintTemplates", 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 - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + 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, + }, + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplates", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BlueprintTemplate", "blueprintTemplates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplate", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplate', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BlueprintTemplateModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintTemplate": data.blueprintTemplates?.nodes?.[0] ?? null - }) + blueprintTemplate: data.blueprintTemplates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintTemplate", "blueprintTemplates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplate", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplate', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BlueprintTemplateModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintTemplate": data.blueprintTemplates?.nodes?.[0] ?? null - }) + blueprintTemplate: data.blueprintTemplates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BlueprintTemplate", "createBlueprintTemplate", "blueprintTemplate", args.select, args.data, "CreateBlueprintTemplateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BlueprintTemplate', + 'createBlueprintTemplate', + 'blueprintTemplate', + args.select, + args.data, + 'CreateBlueprintTemplateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "createBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'createBlueprintTemplate', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintTemplatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BlueprintTemplate", "updateBlueprintTemplate", "blueprintTemplate", args.select, args.where.id, args.data, "UpdateBlueprintTemplateInput", "id", "blueprintTemplatePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BlueprintTemplate', + 'updateBlueprintTemplate', + 'blueprintTemplate', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintTemplateInput', + 'id', + 'blueprintTemplatePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "updateBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'updateBlueprintTemplate', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BlueprintTemplate", "deleteBlueprintTemplate", "blueprintTemplate", { - id: args.where.id - }, "DeleteBlueprintTemplateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BlueprintTemplate', + 'deleteBlueprintTemplate', + 'blueprintTemplate', + { + id: args.where.id, + }, + 'DeleteBlueprintTemplateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "deleteBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'deleteBlueprintTemplate', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/catalogModule.ts b/sdk/constructive-cli/src/modules/orm/models/catalogModule.ts index 731c29804e..f03b06347e 100644 --- a/sdk/constructive-cli/src/modules/orm/models/catalogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/catalogModule.ts @@ -3,56 +3,96 @@ * @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 { CatalogModule, CatalogModuleWithRelations, CatalogModuleSelect, CatalogModuleFilter, CatalogModuleOrderBy, CreateCatalogModuleInput, UpdateCatalogModuleInput, CatalogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CatalogModule, + CatalogModuleWithRelations, + CatalogModuleSelect, + CatalogModuleFilter, + CatalogModuleOrderBy, + CreateCatalogModuleInput, + UpdateCatalogModuleInput, + CatalogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CatalogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CatalogModule", "catalogModules", 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 - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CatalogModule', + 'catalogModules', + 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, + }, + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModules", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CatalogModule", "catalogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CatalogModule', + 'catalogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModule", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CatalogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "catalogModule": data.catalogModules?.nodes?.[0] ?? null - }) + catalogModule: data.catalogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CatalogModule", "catalogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CatalogModule', + 'catalogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModule", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CatalogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "catalogModule": data.catalogModules?.nodes?.[0] ?? null - }) + catalogModule: data.catalogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CatalogModule", "createCatalogModule", "catalogModule", args.select, args.data, "CreateCatalogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CatalogModule', + 'createCatalogModule', + 'catalogModule', + args.select, + args.data, + 'CreateCatalogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "createCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'createCatalogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CatalogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CatalogModule", "updateCatalogModule", "catalogModule", args.select, args.where.id, args.data, "UpdateCatalogModuleInput", "id", "catalogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CatalogModule', + 'updateCatalogModule', + 'catalogModule', + args.select, + args.where.id, + args.data, + 'UpdateCatalogModuleInput', + 'id', + 'catalogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "updateCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'updateCatalogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CatalogModule", "deleteCatalogModule", "catalogModule", { - id: args.where.id - }, "DeleteCatalogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CatalogModule', + 'deleteCatalogModule', + 'catalogModule', + { + id: args.where.id, + }, + 'DeleteCatalogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "deleteCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'deleteCatalogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/computeLogModule.ts b/sdk/constructive-cli/src/modules/orm/models/computeLogModule.ts index 042debf2b4..3451b45608 100644 --- a/sdk/constructive-cli/src/modules/orm/models/computeLogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/computeLogModule.ts @@ -3,56 +3,96 @@ * @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 { ComputeLogModule, ComputeLogModuleWithRelations, ComputeLogModuleSelect, ComputeLogModuleFilter, ComputeLogModuleOrderBy, CreateComputeLogModuleInput, UpdateComputeLogModuleInput, ComputeLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ComputeLogModule, + ComputeLogModuleWithRelations, + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy, + CreateComputeLogModuleInput, + UpdateComputeLogModuleInput, + ComputeLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ComputeLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ComputeLogModule", "computeLogModules", 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 - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ComputeLogModule', + 'computeLogModules', + 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, + }, + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModules", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ComputeLogModule", "computeLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ComputeLogModule', + 'computeLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModule", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ComputeLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "computeLogModule": data.computeLogModules?.nodes?.[0] ?? null - }) + computeLogModule: data.computeLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ComputeLogModule", "computeLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ComputeLogModule', + 'computeLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModule", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ComputeLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "computeLogModule": data.computeLogModules?.nodes?.[0] ?? null - }) + computeLogModule: data.computeLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ComputeLogModule", "createComputeLogModule", "computeLogModule", args.select, args.data, "CreateComputeLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ComputeLogModule', + 'createComputeLogModule', + 'computeLogModule', + args.select, + args.data, + 'CreateComputeLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "createComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'createComputeLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ComputeLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ComputeLogModule", "updateComputeLogModule", "computeLogModule", args.select, args.where.id, args.data, "UpdateComputeLogModuleInput", "id", "computeLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ComputeLogModule', + 'updateComputeLogModule', + 'computeLogModule', + args.select, + args.where.id, + args.data, + 'UpdateComputeLogModuleInput', + 'id', + 'computeLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "updateComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'updateComputeLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ComputeLogModule", "deleteComputeLogModule", "computeLogModule", { - id: args.where.id - }, "DeleteComputeLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ComputeLogModule', + 'deleteComputeLogModule', + 'computeLogModule', + { + id: args.where.id, + }, + 'DeleteComputeLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "deleteComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'deleteComputeLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/configSecretsUserModule.ts b/sdk/constructive-cli/src/modules/orm/models/configSecretsUserModule.ts index a910033dff..bd97e5bf01 100644 --- a/sdk/constructive-cli/src/modules/orm/models/configSecretsUserModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/configSecretsUserModule.ts @@ -3,56 +3,98 @@ * @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 { ConfigSecretsUserModule, ConfigSecretsUserModuleWithRelations, ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleFilter, ConfigSecretsUserModuleOrderBy, CreateConfigSecretsUserModuleInput, UpdateConfigSecretsUserModuleInput, ConfigSecretsUserModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ConfigSecretsUserModule, + ConfigSecretsUserModuleWithRelations, + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy, + CreateConfigSecretsUserModuleInput, + UpdateConfigSecretsUserModuleInput, + ConfigSecretsUserModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConfigSecretsUserModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - configSecretsUserModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + configSecretsUserModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ConfigSecretsUserModule", "configSecretsUserModules", 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 - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + 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, + }, + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModules", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ configSecretsUserModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ConfigSecretsUserModule", "configSecretsUserModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModule", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ConfigSecretsUserModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "configSecretsUserModule": data.configSecretsUserModules?.nodes?.[0] ?? null - }) + configSecretsUserModule: data.configSecretsUserModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ configSecretsUserModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ConfigSecretsUserModule", "configSecretsUserModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModule", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ConfigSecretsUserModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "configSecretsUserModule": data.configSecretsUserModules?.nodes?.[0] ?? null - }) + configSecretsUserModule: data.configSecretsUserModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ConfigSecretsUserModule", "createConfigSecretsUserModule", "configSecretsUserModule", args.select, args.data, "CreateConfigSecretsUserModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ConfigSecretsUserModule', + 'createConfigSecretsUserModule', + 'configSecretsUserModule', + args.select, + args.data, + 'CreateConfigSecretsUserModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "createConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'createConfigSecretsUserModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConfigSecretsUserModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ConfigSecretsUserModule", "updateConfigSecretsUserModule", "configSecretsUserModule", args.select, args.where.id, args.data, "UpdateConfigSecretsUserModuleInput", "id", "configSecretsUserModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ConfigSecretsUserModule', + 'updateConfigSecretsUserModule', + 'configSecretsUserModule', + args.select, + args.where.id, + args.data, + 'UpdateConfigSecretsUserModuleInput', + 'id', + 'configSecretsUserModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "updateConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'updateConfigSecretsUserModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ConfigSecretsUserModule", "deleteConfigSecretsUserModule", "configSecretsUserModule", { - id: args.where.id - }, "DeleteConfigSecretsUserModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ConfigSecretsUserModule', + 'deleteConfigSecretsUserModule', + 'configSecretsUserModule', + { + id: args.where.id, + }, + 'DeleteConfigSecretsUserModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "deleteConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'deleteConfigSecretsUserModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/connectedAccountsModule.ts b/sdk/constructive-cli/src/modules/orm/models/connectedAccountsModule.ts index 7b725c2754..64b1dc5c4c 100644 --- a/sdk/constructive-cli/src/modules/orm/models/connectedAccountsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/connectedAccountsModule.ts @@ -3,56 +3,98 @@ * @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 { ConnectedAccountsModule, ConnectedAccountsModuleWithRelations, ConnectedAccountsModuleSelect, ConnectedAccountsModuleFilter, ConnectedAccountsModuleOrderBy, CreateConnectedAccountsModuleInput, UpdateConnectedAccountsModuleInput, ConnectedAccountsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ConnectedAccountsModule, + ConnectedAccountsModuleWithRelations, + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy, + CreateConnectedAccountsModuleInput, + UpdateConnectedAccountsModuleInput, + ConnectedAccountsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConnectedAccountsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - connectedAccountsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + connectedAccountsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ConnectedAccountsModule", "connectedAccountsModules", 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 - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + 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, + }, + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModules", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ connectedAccountsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ConnectedAccountsModule", "connectedAccountsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModule", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ConnectedAccountsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "connectedAccountsModule": data.connectedAccountsModules?.nodes?.[0] ?? null - }) + connectedAccountsModule: data.connectedAccountsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ connectedAccountsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ConnectedAccountsModule", "connectedAccountsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModule", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ConnectedAccountsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "connectedAccountsModule": data.connectedAccountsModules?.nodes?.[0] ?? null - }) + connectedAccountsModule: data.connectedAccountsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ConnectedAccountsModule", "createConnectedAccountsModule", "connectedAccountsModule", args.select, args.data, "CreateConnectedAccountsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ConnectedAccountsModule', + 'createConnectedAccountsModule', + 'connectedAccountsModule', + args.select, + args.data, + 'CreateConnectedAccountsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "createConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'createConnectedAccountsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConnectedAccountsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ConnectedAccountsModule", "updateConnectedAccountsModule", "connectedAccountsModule", args.select, args.where.id, args.data, "UpdateConnectedAccountsModuleInput", "id", "connectedAccountsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ConnectedAccountsModule', + 'updateConnectedAccountsModule', + 'connectedAccountsModule', + args.select, + args.where.id, + args.data, + 'UpdateConnectedAccountsModuleInput', + 'id', + 'connectedAccountsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "updateConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'updateConnectedAccountsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ConnectedAccountsModule", "deleteConnectedAccountsModule", "connectedAccountsModule", { - id: args.where.id - }, "DeleteConnectedAccountsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ConnectedAccountsModule', + 'deleteConnectedAccountsModule', + 'connectedAccountsModule', + { + id: args.where.id, + }, + 'DeleteConnectedAccountsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "deleteConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'deleteConnectedAccountsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/cryptoAddressesModule.ts b/sdk/constructive-cli/src/modules/orm/models/cryptoAddressesModule.ts index 28b923a35e..c7797726bf 100644 --- a/sdk/constructive-cli/src/modules/orm/models/cryptoAddressesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/cryptoAddressesModule.ts @@ -3,56 +3,98 @@ * @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 { CryptoAddressesModule, CryptoAddressesModuleWithRelations, CryptoAddressesModuleSelect, CryptoAddressesModuleFilter, CryptoAddressesModuleOrderBy, CreateCryptoAddressesModuleInput, UpdateCryptoAddressesModuleInput, CryptoAddressesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAddressesModule, + CryptoAddressesModuleWithRelations, + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy, + CreateCryptoAddressesModuleInput, + UpdateCryptoAddressesModuleInput, + CryptoAddressesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAddressesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - cryptoAddressesModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + cryptoAddressesModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddressesModule", "cryptoAddressesModules", 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 - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + 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, + }, + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModules", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddressesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAddressesModule", "cryptoAddressesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModule", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class CryptoAddressesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddressesModule": data.cryptoAddressesModules?.nodes?.[0] ?? null - }) + cryptoAddressesModule: data.cryptoAddressesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddressesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddressesModule", "cryptoAddressesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModule", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class CryptoAddressesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddressesModule": data.cryptoAddressesModules?.nodes?.[0] ?? null - }) + cryptoAddressesModule: data.cryptoAddressesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAddressesModule", "createCryptoAddressesModule", "cryptoAddressesModule", args.select, args.data, "CreateCryptoAddressesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAddressesModule', + 'createCryptoAddressesModule', + 'cryptoAddressesModule', + args.select, + args.data, + 'CreateCryptoAddressesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "createCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'createCryptoAddressesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAddressesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAddressesModule", "updateCryptoAddressesModule", "cryptoAddressesModule", args.select, args.where.id, args.data, "UpdateCryptoAddressesModuleInput", "id", "cryptoAddressesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAddressesModule', + 'updateCryptoAddressesModule', + 'cryptoAddressesModule', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAddressesModuleInput', + 'id', + 'cryptoAddressesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "updateCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'updateCryptoAddressesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAddressesModule", "deleteCryptoAddressesModule", "cryptoAddressesModule", { - id: args.where.id - }, "DeleteCryptoAddressesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAddressesModule', + 'deleteCryptoAddressesModule', + 'cryptoAddressesModule', + { + id: args.where.id, + }, + 'DeleteCryptoAddressesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "deleteCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'deleteCryptoAddressesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/cryptoAuthModule.ts b/sdk/constructive-cli/src/modules/orm/models/cryptoAuthModule.ts index b2bf531ab9..d975e75267 100644 --- a/sdk/constructive-cli/src/modules/orm/models/cryptoAuthModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/cryptoAuthModule.ts @@ -3,56 +3,96 @@ * @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 { CryptoAuthModule, CryptoAuthModuleWithRelations, CryptoAuthModuleSelect, CryptoAuthModuleFilter, CryptoAuthModuleOrderBy, CreateCryptoAuthModuleInput, UpdateCryptoAuthModuleInput, CryptoAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAuthModule, + CryptoAuthModuleWithRelations, + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy, + CreateCryptoAuthModuleInput, + UpdateCryptoAuthModuleInput, + CryptoAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAuthModule", "cryptoAuthModules", 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 - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + 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, + }, + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModules", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAuthModule", "cryptoAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModule", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CryptoAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAuthModule": data.cryptoAuthModules?.nodes?.[0] ?? null - }) + cryptoAuthModule: data.cryptoAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAuthModule", "cryptoAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModule", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CryptoAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAuthModule": data.cryptoAuthModules?.nodes?.[0] ?? null - }) + cryptoAuthModule: data.cryptoAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAuthModule", "createCryptoAuthModule", "cryptoAuthModule", args.select, args.data, "CreateCryptoAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAuthModule', + 'createCryptoAuthModule', + 'cryptoAuthModule', + args.select, + args.data, + 'CreateCryptoAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "createCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'createCryptoAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAuthModule", "updateCryptoAuthModule", "cryptoAuthModule", args.select, args.where.id, args.data, "UpdateCryptoAuthModuleInput", "id", "cryptoAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAuthModule', + 'updateCryptoAuthModule', + 'cryptoAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAuthModuleInput', + 'id', + 'cryptoAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "updateCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'updateCryptoAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAuthModule", "deleteCryptoAuthModule", "cryptoAuthModule", { - id: args.where.id - }, "DeleteCryptoAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAuthModule', + 'deleteCryptoAuthModule', + 'cryptoAuthModule', + { + id: args.where.id, + }, + 'DeleteCryptoAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "deleteCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'deleteCryptoAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/databaseProvisionModule.ts b/sdk/constructive-cli/src/modules/orm/models/databaseProvisionModule.ts index dbfd38d4f7..1d9457eed6 100644 --- a/sdk/constructive-cli/src/modules/orm/models/databaseProvisionModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/databaseProvisionModule.ts @@ -3,56 +3,98 @@ * @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 { DatabaseProvisionModule, DatabaseProvisionModuleWithRelations, DatabaseProvisionModuleSelect, DatabaseProvisionModuleFilter, DatabaseProvisionModuleOrderBy, CreateDatabaseProvisionModuleInput, UpdateDatabaseProvisionModuleInput, DatabaseProvisionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseProvisionModule, + DatabaseProvisionModuleWithRelations, + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy, + CreateDatabaseProvisionModuleInput, + UpdateDatabaseProvisionModuleInput, + DatabaseProvisionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseProvisionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - databaseProvisionModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + databaseProvisionModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseProvisionModule", "databaseProvisionModules", 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 - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + 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, + }, + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModules", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseProvisionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseProvisionModule", "databaseProvisionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModule", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DatabaseProvisionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseProvisionModule": data.databaseProvisionModules?.nodes?.[0] ?? null - }) + databaseProvisionModule: data.databaseProvisionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseProvisionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseProvisionModule", "databaseProvisionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModule", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DatabaseProvisionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseProvisionModule": data.databaseProvisionModules?.nodes?.[0] ?? null - }) + databaseProvisionModule: data.databaseProvisionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseProvisionModule", "createDatabaseProvisionModule", "databaseProvisionModule", args.select, args.data, "CreateDatabaseProvisionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseProvisionModule', + 'createDatabaseProvisionModule', + 'databaseProvisionModule', + args.select, + args.data, + 'CreateDatabaseProvisionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "createDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'createDatabaseProvisionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseProvisionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseProvisionModule", "updateDatabaseProvisionModule", "databaseProvisionModule", args.select, args.where.id, args.data, "UpdateDatabaseProvisionModuleInput", "id", "databaseProvisionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseProvisionModule', + 'updateDatabaseProvisionModule', + 'databaseProvisionModule', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseProvisionModuleInput', + 'id', + 'databaseProvisionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "updateDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'updateDatabaseProvisionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseProvisionModule", "deleteDatabaseProvisionModule", "databaseProvisionModule", { - id: args.where.id - }, "DeleteDatabaseProvisionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseProvisionModule', + 'deleteDatabaseProvisionModule', + 'databaseProvisionModule', + { + id: args.where.id, + }, + 'DeleteDatabaseProvisionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "deleteDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'deleteDatabaseProvisionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/databaseSettingsModule.ts b/sdk/constructive-cli/src/modules/orm/models/databaseSettingsModule.ts index 477e77aa01..14e7f06eae 100644 --- a/sdk/constructive-cli/src/modules/orm/models/databaseSettingsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/databaseSettingsModule.ts @@ -3,56 +3,98 @@ * @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 { DatabaseSettingsModule, DatabaseSettingsModuleWithRelations, DatabaseSettingsModuleSelect, DatabaseSettingsModuleFilter, DatabaseSettingsModuleOrderBy, CreateDatabaseSettingsModuleInput, UpdateDatabaseSettingsModuleInput, DatabaseSettingsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseSettingsModule, + DatabaseSettingsModuleWithRelations, + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy, + CreateDatabaseSettingsModuleInput, + UpdateDatabaseSettingsModuleInput, + DatabaseSettingsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseSettingsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - databaseSettingsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + databaseSettingsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSettingsModule", "databaseSettingsModules", 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 - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + 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, + }, + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModules", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseSettingsModule", "databaseSettingsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModule", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DatabaseSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSettingsModule": data.databaseSettingsModules?.nodes?.[0] ?? null - }) + databaseSettingsModule: data.databaseSettingsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSettingsModule", "databaseSettingsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModule", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DatabaseSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSettingsModule": data.databaseSettingsModules?.nodes?.[0] ?? null - }) + databaseSettingsModule: data.databaseSettingsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseSettingsModule", "createDatabaseSettingsModule", "databaseSettingsModule", args.select, args.data, "CreateDatabaseSettingsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseSettingsModule', + 'createDatabaseSettingsModule', + 'databaseSettingsModule', + args.select, + args.data, + 'CreateDatabaseSettingsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "createDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'createDatabaseSettingsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseSettingsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseSettingsModule", "updateDatabaseSettingsModule", "databaseSettingsModule", args.select, args.where.id, args.data, "UpdateDatabaseSettingsModuleInput", "id", "databaseSettingsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseSettingsModule', + 'updateDatabaseSettingsModule', + 'databaseSettingsModule', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseSettingsModuleInput', + 'id', + 'databaseSettingsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "updateDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'updateDatabaseSettingsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseSettingsModule", "deleteDatabaseSettingsModule", "databaseSettingsModule", { - id: args.where.id - }, "DeleteDatabaseSettingsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseSettingsModule', + 'deleteDatabaseSettingsModule', + 'databaseSettingsModule', + { + id: args.where.id, + }, + 'DeleteDatabaseSettingsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "deleteDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'deleteDatabaseSettingsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/dbPool.ts b/sdk/constructive-cli/src/modules/orm/models/dbPool.ts index 07b4f67e30..32e26fe980 100644 --- a/sdk/constructive-cli/src/modules/orm/models/dbPool.ts +++ b/sdk/constructive-cli/src/modules/orm/models/dbPool.ts @@ -3,56 +3,96 @@ * @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 { DbPool, DbPoolWithRelations, DbPoolSelect, DbPoolFilter, DbPoolOrderBy, CreateDbPoolInput, UpdateDbPoolInput, DbPoolPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPool, + DbPoolWithRelations, + DbPoolSelect, + DbPoolFilter, + DbPoolOrderBy, + CreateDbPoolInput, + UpdateDbPoolInput, + DbPoolPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPoolModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPools: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPool", "dbPools", 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 - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPool', + 'dbPools', + 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, + }, + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPools", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPools', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPool: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPool", "dbPools", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPool', + 'dbPools', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPool", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPool', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPoolModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPool": data.dbPools?.nodes?.[0] ?? null - }) + dbPool: data.dbPools?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPool: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPool", "dbPools", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPool', + 'dbPools', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPool", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPool', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPoolModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPool": data.dbPools?.nodes?.[0] ?? null - }) + dbPool: data.dbPools?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPool", "createDbPool", "dbPool", args.select, args.data, "CreateDbPoolInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPool', + 'createDbPool', + 'dbPool', + args.select, + args.data, + 'CreateDbPoolInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "createDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'createDbPool', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPoolPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPool", "updateDbPool", "dbPool", args.select, args.where.id, args.data, "UpdateDbPoolInput", "id", "dbPoolPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPool', + 'updateDbPool', + 'dbPool', + args.select, + args.where.id, + args.data, + 'UpdateDbPoolInput', + 'id', + 'dbPoolPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "updateDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'updateDbPool', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPool", "deleteDbPool", "dbPool", { - id: args.where.id - }, "DeleteDbPoolInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPool', + 'deleteDbPool', + 'dbPool', + { + id: args.where.id, + }, + 'DeleteDbPoolInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "deleteDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'deleteDbPool', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/dbPoolConfig.ts b/sdk/constructive-cli/src/modules/orm/models/dbPoolConfig.ts index 37a3c62ff5..df67dbab50 100644 --- a/sdk/constructive-cli/src/modules/orm/models/dbPoolConfig.ts +++ b/sdk/constructive-cli/src/modules/orm/models/dbPoolConfig.ts @@ -3,56 +3,96 @@ * @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 { DbPoolConfig, DbPoolConfigWithRelations, DbPoolConfigSelect, DbPoolConfigFilter, DbPoolConfigOrderBy, CreateDbPoolConfigInput, UpdateDbPoolConfigInput, DbPoolConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPoolConfig, + DbPoolConfigWithRelations, + DbPoolConfigSelect, + DbPoolConfigFilter, + DbPoolConfigOrderBy, + CreateDbPoolConfigInput, + UpdateDbPoolConfigInput, + DbPoolConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPoolConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfigs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPoolConfig", "dbPoolConfigs", 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 - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + 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, + }, + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfigs", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfigs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPoolConfig", "dbPoolConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfig", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfig', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPoolConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPoolConfig": data.dbPoolConfigs?.nodes?.[0] ?? null - }) + dbPoolConfig: data.dbPoolConfigs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPoolConfig", "dbPoolConfigs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfig", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfig', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPoolConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPoolConfig": data.dbPoolConfigs?.nodes?.[0] ?? null - }) + dbPoolConfig: data.dbPoolConfigs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPoolConfig", "createDbPoolConfig", "dbPoolConfig", args.select, args.data, "CreateDbPoolConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPoolConfig', + 'createDbPoolConfig', + 'dbPoolConfig', + args.select, + args.data, + 'CreateDbPoolConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "createDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'createDbPoolConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPoolConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPoolConfig", "updateDbPoolConfig", "dbPoolConfig", args.select, args.where.id, args.data, "UpdateDbPoolConfigInput", "id", "dbPoolConfigPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPoolConfig', + 'updateDbPoolConfig', + 'dbPoolConfig', + args.select, + args.where.id, + args.data, + 'UpdateDbPoolConfigInput', + 'id', + 'dbPoolConfigPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "updateDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'updateDbPoolConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPoolConfig", "deleteDbPoolConfig", "dbPoolConfig", { - id: args.where.id - }, "DeleteDbPoolConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPoolConfig', + 'deleteDbPoolConfig', + 'dbPoolConfig', + { + id: args.where.id, + }, + 'DeleteDbPoolConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "deleteDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'deleteDbPoolConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/dbPresetModule.ts b/sdk/constructive-cli/src/modules/orm/models/dbPresetModule.ts index 1a2d12ef9c..e787354cf8 100644 --- a/sdk/constructive-cli/src/modules/orm/models/dbPresetModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/dbPresetModule.ts @@ -3,56 +3,96 @@ * @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 { DbPresetModule, DbPresetModuleWithRelations, DbPresetModuleSelect, DbPresetModuleFilter, DbPresetModuleOrderBy, CreateDbPresetModuleInput, UpdateDbPresetModuleInput, DbPresetModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPresetModule, + DbPresetModuleWithRelations, + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy, + CreateDbPresetModuleInput, + UpdateDbPresetModuleInput, + DbPresetModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPresetModule", "dbPresetModules", 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 - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPresetModule', + 'dbPresetModules', + 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, + }, + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModules", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPresetModule", "dbPresetModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPresetModule', + 'dbPresetModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModule", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPresetModule": data.dbPresetModules?.nodes?.[0] ?? null - }) + dbPresetModule: data.dbPresetModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPresetModule", "dbPresetModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPresetModule', + 'dbPresetModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModule", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPresetModule": data.dbPresetModules?.nodes?.[0] ?? null - }) + dbPresetModule: data.dbPresetModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPresetModule", "createDbPresetModule", "dbPresetModule", args.select, args.data, "CreateDbPresetModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPresetModule', + 'createDbPresetModule', + 'dbPresetModule', + args.select, + args.data, + 'CreateDbPresetModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "createDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'createDbPresetModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPresetModule", "updateDbPresetModule", "dbPresetModule", args.select, args.where.id, args.data, "UpdateDbPresetModuleInput", "id", "dbPresetModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPresetModule', + 'updateDbPresetModule', + 'dbPresetModule', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetModuleInput', + 'id', + 'dbPresetModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "updateDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'updateDbPresetModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPresetModule", "deleteDbPresetModule", "dbPresetModule", { - id: args.where.id - }, "DeleteDbPresetModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPresetModule', + 'deleteDbPresetModule', + 'dbPresetModule', + { + id: args.where.id, + }, + 'DeleteDbPresetModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "deleteDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'deleteDbPresetModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/dbUsageModule.ts b/sdk/constructive-cli/src/modules/orm/models/dbUsageModule.ts index 70423a1d03..45fc6b2a64 100644 --- a/sdk/constructive-cli/src/modules/orm/models/dbUsageModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/dbUsageModule.ts @@ -3,56 +3,96 @@ * @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 { DbUsageModule, DbUsageModuleWithRelations, DbUsageModuleSelect, DbUsageModuleFilter, DbUsageModuleOrderBy, CreateDbUsageModuleInput, UpdateDbUsageModuleInput, DbUsageModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbUsageModule, + DbUsageModuleWithRelations, + DbUsageModuleSelect, + DbUsageModuleFilter, + DbUsageModuleOrderBy, + CreateDbUsageModuleInput, + UpdateDbUsageModuleInput, + DbUsageModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbUsageModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbUsageModule", "dbUsageModules", 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 - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbUsageModule', + 'dbUsageModules', + 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, + }, + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModules", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbUsageModule", "dbUsageModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbUsageModule', + 'dbUsageModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModule", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbUsageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbUsageModule": data.dbUsageModules?.nodes?.[0] ?? null - }) + dbUsageModule: data.dbUsageModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbUsageModule", "dbUsageModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbUsageModule', + 'dbUsageModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModule", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbUsageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbUsageModule": data.dbUsageModules?.nodes?.[0] ?? null - }) + dbUsageModule: data.dbUsageModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbUsageModule", "createDbUsageModule", "dbUsageModule", args.select, args.data, "CreateDbUsageModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbUsageModule', + 'createDbUsageModule', + 'dbUsageModule', + args.select, + args.data, + 'CreateDbUsageModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "createDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'createDbUsageModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbUsageModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbUsageModule", "updateDbUsageModule", "dbUsageModule", args.select, args.where.id, args.data, "UpdateDbUsageModuleInput", "id", "dbUsageModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbUsageModule', + 'updateDbUsageModule', + 'dbUsageModule', + args.select, + args.where.id, + args.data, + 'UpdateDbUsageModuleInput', + 'id', + 'dbUsageModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "updateDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'updateDbUsageModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbUsageModule", "deleteDbUsageModule", "dbUsageModule", { - id: args.where.id - }, "DeleteDbUsageModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbUsageModule', + 'deleteDbUsageModule', + 'dbUsageModule', + { + id: args.where.id, + }, + 'DeleteDbUsageModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "deleteDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'deleteDbUsageModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/defaultIdsModule.ts b/sdk/constructive-cli/src/modules/orm/models/defaultIdsModule.ts index 92143e9800..957d0061e4 100644 --- a/sdk/constructive-cli/src/modules/orm/models/defaultIdsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/defaultIdsModule.ts @@ -3,56 +3,96 @@ * @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 { DefaultIdsModule, DefaultIdsModuleWithRelations, DefaultIdsModuleSelect, DefaultIdsModuleFilter, DefaultIdsModuleOrderBy, CreateDefaultIdsModuleInput, UpdateDefaultIdsModuleInput, DefaultIdsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DefaultIdsModule, + DefaultIdsModuleWithRelations, + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy, + CreateDefaultIdsModuleInput, + UpdateDefaultIdsModuleInput, + DefaultIdsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DefaultIdsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultIdsModule", "defaultIdsModules", 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 - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + 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, + }, + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModules", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DefaultIdsModule", "defaultIdsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModule", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DefaultIdsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultIdsModule": data.defaultIdsModules?.nodes?.[0] ?? null - }) + defaultIdsModule: data.defaultIdsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultIdsModule", "defaultIdsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModule", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DefaultIdsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultIdsModule": data.defaultIdsModules?.nodes?.[0] ?? null - }) + defaultIdsModule: data.defaultIdsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DefaultIdsModule", "createDefaultIdsModule", "defaultIdsModule", args.select, args.data, "CreateDefaultIdsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DefaultIdsModule', + 'createDefaultIdsModule', + 'defaultIdsModule', + args.select, + args.data, + 'CreateDefaultIdsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "createDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'createDefaultIdsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DefaultIdsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DefaultIdsModule", "updateDefaultIdsModule", "defaultIdsModule", args.select, args.where.id, args.data, "UpdateDefaultIdsModuleInput", "id", "defaultIdsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DefaultIdsModule', + 'updateDefaultIdsModule', + 'defaultIdsModule', + args.select, + args.where.id, + args.data, + 'UpdateDefaultIdsModuleInput', + 'id', + 'defaultIdsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "updateDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'updateDefaultIdsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DefaultIdsModule", "deleteDefaultIdsModule", "defaultIdsModule", { - id: args.where.id - }, "DeleteDefaultIdsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DefaultIdsModule', + 'deleteDefaultIdsModule', + 'defaultIdsModule', + { + id: args.where.id, + }, + 'DeleteDefaultIdsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "deleteDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'deleteDefaultIdsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/denormalizedTableField.ts b/sdk/constructive-cli/src/modules/orm/models/denormalizedTableField.ts index 2f529dcb80..bdc83099a2 100644 --- a/sdk/constructive-cli/src/modules/orm/models/denormalizedTableField.ts +++ b/sdk/constructive-cli/src/modules/orm/models/denormalizedTableField.ts @@ -3,56 +3,98 @@ * @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 { DenormalizedTableField, DenormalizedTableFieldWithRelations, DenormalizedTableFieldSelect, DenormalizedTableFieldFilter, DenormalizedTableFieldOrderBy, CreateDenormalizedTableFieldInput, UpdateDenormalizedTableFieldInput, DenormalizedTableFieldPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DenormalizedTableField, + DenormalizedTableFieldWithRelations, + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy, + CreateDenormalizedTableFieldInput, + UpdateDenormalizedTableFieldInput, + DenormalizedTableFieldPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DenormalizedTableFieldModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - denormalizedTableFields: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + denormalizedTableFields: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DenormalizedTableField", "denormalizedTableFields", 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 - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + 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, + }, + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableFields", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableFields', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ denormalizedTableField: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DenormalizedTableField", "denormalizedTableFields", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableField", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableField', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DenormalizedTableFieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "denormalizedTableField": data.denormalizedTableFields?.nodes?.[0] ?? null - }) + denormalizedTableField: data.denormalizedTableFields?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ denormalizedTableField: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DenormalizedTableField", "denormalizedTableFields", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableField", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableField', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DenormalizedTableFieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "denormalizedTableField": data.denormalizedTableFields?.nodes?.[0] ?? null - }) + denormalizedTableField: data.denormalizedTableFields?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DenormalizedTableField", "createDenormalizedTableField", "denormalizedTableField", args.select, args.data, "CreateDenormalizedTableFieldInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DenormalizedTableField', + 'createDenormalizedTableField', + 'denormalizedTableField', + args.select, + args.data, + 'CreateDenormalizedTableFieldInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "createDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'createDenormalizedTableField', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DenormalizedTableFieldPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DenormalizedTableField", "updateDenormalizedTableField", "denormalizedTableField", args.select, args.where.id, args.data, "UpdateDenormalizedTableFieldInput", "id", "denormalizedTableFieldPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DenormalizedTableField', + 'updateDenormalizedTableField', + 'denormalizedTableField', + args.select, + args.where.id, + args.data, + 'UpdateDenormalizedTableFieldInput', + 'id', + 'denormalizedTableFieldPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "updateDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'updateDenormalizedTableField', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DenormalizedTableField", "deleteDenormalizedTableField", "denormalizedTableField", { - id: args.where.id - }, "DeleteDenormalizedTableFieldInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DenormalizedTableField', + 'deleteDenormalizedTableField', + 'denormalizedTableField', + { + id: args.where.id, + }, + 'DeleteDenormalizedTableFieldInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "deleteDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'deleteDenormalizedTableField', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/devicesModule.ts b/sdk/constructive-cli/src/modules/orm/models/devicesModule.ts index 532e5e6598..8dc6cf5282 100644 --- a/sdk/constructive-cli/src/modules/orm/models/devicesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/devicesModule.ts @@ -3,56 +3,96 @@ * @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 { DevicesModule, DevicesModuleWithRelations, DevicesModuleSelect, DevicesModuleFilter, DevicesModuleOrderBy, CreateDevicesModuleInput, UpdateDevicesModuleInput, DevicesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DevicesModule, + DevicesModuleWithRelations, + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy, + CreateDevicesModuleInput, + UpdateDevicesModuleInput, + DevicesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DevicesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DevicesModule", "devicesModules", 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 - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + 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, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModules", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DevicesModule", "devicesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModule", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DevicesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "devicesModule": data.devicesModules?.nodes?.[0] ?? null - }) + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DevicesModule", "devicesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModule", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DevicesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "devicesModule": data.devicesModules?.nodes?.[0] ?? null - }) + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DevicesModule", "createDevicesModule", "devicesModule", args.select, args.data, "CreateDevicesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DevicesModule', + 'createDevicesModule', + 'devicesModule', + args.select, + args.data, + 'CreateDevicesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "createDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'createDevicesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DevicesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DevicesModule", "updateDevicesModule", "devicesModule", args.select, args.where.id, args.data, "UpdateDevicesModuleInput", "id", "devicesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DevicesModule', + 'updateDevicesModule', + 'devicesModule', + args.select, + args.where.id, + args.data, + 'UpdateDevicesModuleInput', + 'id', + 'devicesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "updateDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'updateDevicesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DevicesModule", "deleteDevicesModule", "devicesModule", { - id: args.where.id - }, "DeleteDevicesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DevicesModule', + 'deleteDevicesModule', + 'devicesModule', + { + id: args.where.id, + }, + 'DeleteDevicesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "deleteDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'deleteDevicesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/domainModule.ts b/sdk/constructive-cli/src/modules/orm/models/domainModule.ts index a8f1588a9c..fd1f536225 100644 --- a/sdk/constructive-cli/src/modules/orm/models/domainModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/domainModule.ts @@ -3,56 +3,96 @@ * @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 { DomainModule, DomainModuleWithRelations, DomainModuleSelect, DomainModuleFilter, DomainModuleOrderBy, CreateDomainModuleInput, UpdateDomainModuleInput, DomainModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainModule, + DomainModuleWithRelations, + DomainModuleSelect, + DomainModuleFilter, + DomainModuleOrderBy, + CreateDomainModuleInput, + UpdateDomainModuleInput, + DomainModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainModule", "domainModules", 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 - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainModule', + 'domainModules', + 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, + }, + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModules", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainModule", "domainModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainModule', + 'domainModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModule", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainModule": data.domainModules?.nodes?.[0] ?? null - }) + domainModule: data.domainModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainModule", "domainModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainModule', + 'domainModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModule", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainModule": data.domainModules?.nodes?.[0] ?? null - }) + domainModule: data.domainModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainModule", "createDomainModule", "domainModule", args.select, args.data, "CreateDomainModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainModule', + 'createDomainModule', + 'domainModule', + args.select, + args.data, + 'CreateDomainModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "createDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'createDomainModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainModule", "updateDomainModule", "domainModule", args.select, args.where.id, args.data, "UpdateDomainModuleInput", "id", "domainModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainModule', + 'updateDomainModule', + 'domainModule', + args.select, + args.where.id, + args.data, + 'UpdateDomainModuleInput', + 'id', + 'domainModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "updateDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'updateDomainModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainModule", "deleteDomainModule", "domainModule", { - id: args.where.id - }, "DeleteDomainModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainModule', + 'deleteDomainModule', + 'domainModule', + { + id: args.where.id, + }, + 'DeleteDomainModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "deleteDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'deleteDomainModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/emailsModule.ts b/sdk/constructive-cli/src/modules/orm/models/emailsModule.ts index 5b13919a98..f3a2297a8a 100644 --- a/sdk/constructive-cli/src/modules/orm/models/emailsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/emailsModule.ts @@ -3,56 +3,96 @@ * @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 { EmailsModule, EmailsModuleWithRelations, EmailsModuleSelect, EmailsModuleFilter, EmailsModuleOrderBy, CreateEmailsModuleInput, UpdateEmailsModuleInput, EmailsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EmailsModule, + EmailsModuleWithRelations, + EmailsModuleSelect, + EmailsModuleFilter, + EmailsModuleOrderBy, + CreateEmailsModuleInput, + UpdateEmailsModuleInput, + EmailsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmailsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EmailsModule", "emailsModules", 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 - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EmailsModule', + 'emailsModules', + 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, + }, + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModules", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EmailsModule", "emailsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EmailsModule', + 'emailsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModule", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmailsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "emailsModule": data.emailsModules?.nodes?.[0] ?? null - }) + emailsModule: data.emailsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EmailsModule", "emailsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EmailsModule', + 'emailsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModule", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmailsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "emailsModule": data.emailsModules?.nodes?.[0] ?? null - }) + emailsModule: data.emailsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EmailsModule", "createEmailsModule", "emailsModule", args.select, args.data, "CreateEmailsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EmailsModule', + 'createEmailsModule', + 'emailsModule', + args.select, + args.data, + 'CreateEmailsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "createEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'createEmailsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmailsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EmailsModule", "updateEmailsModule", "emailsModule", args.select, args.where.id, args.data, "UpdateEmailsModuleInput", "id", "emailsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EmailsModule', + 'updateEmailsModule', + 'emailsModule', + args.select, + args.where.id, + args.data, + 'UpdateEmailsModuleInput', + 'id', + 'emailsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "updateEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'updateEmailsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EmailsModule", "deleteEmailsModule", "emailsModule", { - id: args.where.id - }, "DeleteEmailsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EmailsModule', + 'deleteEmailsModule', + 'emailsModule', + { + id: args.where.id, + }, + 'DeleteEmailsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "deleteEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'deleteEmailsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/entityTypeProvision.ts b/sdk/constructive-cli/src/modules/orm/models/entityTypeProvision.ts index 5d95a2d830..c8e87d8f9c 100644 --- a/sdk/constructive-cli/src/modules/orm/models/entityTypeProvision.ts +++ b/sdk/constructive-cli/src/modules/orm/models/entityTypeProvision.ts @@ -3,56 +3,96 @@ * @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 { EntityTypeProvision, EntityTypeProvisionWithRelations, EntityTypeProvisionSelect, EntityTypeProvisionFilter, EntityTypeProvisionOrderBy, CreateEntityTypeProvisionInput, UpdateEntityTypeProvisionInput, EntityTypeProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EntityTypeProvision, + EntityTypeProvisionWithRelations, + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy, + CreateEntityTypeProvisionInput, + UpdateEntityTypeProvisionInput, + EntityTypeProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EntityTypeProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvisions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EntityTypeProvision", "entityTypeProvisions", 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 - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + 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, + }, + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvisions", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EntityTypeProvision", "entityTypeProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvision", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvision', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EntityTypeProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "entityTypeProvision": data.entityTypeProvisions?.nodes?.[0] ?? null - }) + entityTypeProvision: data.entityTypeProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EntityTypeProvision", "entityTypeProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvision", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvision', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EntityTypeProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "entityTypeProvision": data.entityTypeProvisions?.nodes?.[0] ?? null - }) + entityTypeProvision: data.entityTypeProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EntityTypeProvision", "createEntityTypeProvision", "entityTypeProvision", args.select, args.data, "CreateEntityTypeProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EntityTypeProvision', + 'createEntityTypeProvision', + 'entityTypeProvision', + args.select, + args.data, + 'CreateEntityTypeProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "createEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'createEntityTypeProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EntityTypeProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EntityTypeProvision", "updateEntityTypeProvision", "entityTypeProvision", args.select, args.where.id, args.data, "UpdateEntityTypeProvisionInput", "id", "entityTypeProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EntityTypeProvision', + 'updateEntityTypeProvision', + 'entityTypeProvision', + args.select, + args.where.id, + args.data, + 'UpdateEntityTypeProvisionInput', + 'id', + 'entityTypeProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "updateEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'updateEntityTypeProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EntityTypeProvision", "deleteEntityTypeProvision", "entityTypeProvision", { - id: args.where.id - }, "DeleteEntityTypeProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EntityTypeProvision', + 'deleteEntityTypeProvision', + 'entityTypeProvision', + { + id: args.where.id, + }, + 'DeleteEntityTypeProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "deleteEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'deleteEntityTypeProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/eventsModule.ts b/sdk/constructive-cli/src/modules/orm/models/eventsModule.ts index a60011d618..0f07d39979 100644 --- a/sdk/constructive-cli/src/modules/orm/models/eventsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/eventsModule.ts @@ -3,56 +3,96 @@ * @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 { EventsModule, EventsModuleWithRelations, EventsModuleSelect, EventsModuleFilter, EventsModuleOrderBy, CreateEventsModuleInput, UpdateEventsModuleInput, EventsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EventsModule, + EventsModuleWithRelations, + EventsModuleSelect, + EventsModuleFilter, + EventsModuleOrderBy, + CreateEventsModuleInput, + UpdateEventsModuleInput, + EventsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EventsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EventsModule", "eventsModules", 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 - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EventsModule', + 'eventsModules', + 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, + }, + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModules", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EventsModule", "eventsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EventsModule', + 'eventsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModule", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EventsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "eventsModule": data.eventsModules?.nodes?.[0] ?? null - }) + eventsModule: data.eventsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EventsModule", "eventsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EventsModule', + 'eventsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModule", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EventsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "eventsModule": data.eventsModules?.nodes?.[0] ?? null - }) + eventsModule: data.eventsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EventsModule", "createEventsModule", "eventsModule", args.select, args.data, "CreateEventsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EventsModule', + 'createEventsModule', + 'eventsModule', + args.select, + args.data, + 'CreateEventsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "createEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'createEventsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EventsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EventsModule", "updateEventsModule", "eventsModule", args.select, args.where.id, args.data, "UpdateEventsModuleInput", "id", "eventsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EventsModule', + 'updateEventsModule', + 'eventsModule', + args.select, + args.where.id, + args.data, + 'UpdateEventsModuleInput', + 'id', + 'eventsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "updateEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'updateEventsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EventsModule", "deleteEventsModule", "eventsModule", { - id: args.where.id - }, "DeleteEventsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EventsModule', + 'deleteEventsModule', + 'eventsModule', + { + id: args.where.id, + }, + 'DeleteEventsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "deleteEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'deleteEventsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/functionDeploymentModule.ts b/sdk/constructive-cli/src/modules/orm/models/functionDeploymentModule.ts index c3cec9d613..afe50267f8 100644 --- a/sdk/constructive-cli/src/modules/orm/models/functionDeploymentModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/functionDeploymentModule.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeploymentModule, FunctionDeploymentModuleWithRelations, FunctionDeploymentModuleSelect, FunctionDeploymentModuleFilter, FunctionDeploymentModuleOrderBy, CreateFunctionDeploymentModuleInput, UpdateFunctionDeploymentModuleInput, FunctionDeploymentModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentModule, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, + CreateFunctionDeploymentModuleInput, + UpdateFunctionDeploymentModuleInput, + FunctionDeploymentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionDeploymentModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModules", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModule", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionDeploymentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentModule": data.functionDeploymentModules?.nodes?.[0] ?? null - }) + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModule", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class FunctionDeploymentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentModule": data.functionDeploymentModules?.nodes?.[0] ?? null - }) + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeploymentModule", "createFunctionDeploymentModule", "functionDeploymentModule", args.select, args.data, "CreateFunctionDeploymentModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentModule', + 'createFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.data, + 'CreateFunctionDeploymentModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "createFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'createFunctionDeploymentModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeploymentModule", "updateFunctionDeploymentModule", "functionDeploymentModule", args.select, args.where.id, args.data, "UpdateFunctionDeploymentModuleInput", "id", "functionDeploymentModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentModule', + 'updateFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentModuleInput', + 'id', + 'functionDeploymentModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "updateFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'updateFunctionDeploymentModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeploymentModule", "deleteFunctionDeploymentModule", "functionDeploymentModule", { - id: args.where.id - }, "DeleteFunctionDeploymentModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentModule', + 'deleteFunctionDeploymentModule', + 'functionDeploymentModule', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "deleteFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'deleteFunctionDeploymentModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/functionInvocationModule.ts b/sdk/constructive-cli/src/modules/orm/models/functionInvocationModule.ts index 45fc3f9127..ba40e892ea 100644 --- a/sdk/constructive-cli/src/modules/orm/models/functionInvocationModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/functionInvocationModule.ts @@ -3,56 +3,98 @@ * @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 { FunctionInvocationModule, FunctionInvocationModuleWithRelations, FunctionInvocationModuleSelect, FunctionInvocationModuleFilter, FunctionInvocationModuleOrderBy, CreateFunctionInvocationModuleInput, UpdateFunctionInvocationModuleInput, FunctionInvocationModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionInvocationModule, + FunctionInvocationModuleWithRelations, + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy, + CreateFunctionInvocationModuleInput, + UpdateFunctionInvocationModuleInput, + FunctionInvocationModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionInvocationModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocationModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationModule", "functionInvocationModules", 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 - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + 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, + }, + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModules", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocationModule", "functionInvocationModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModule", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionInvocationModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationModule": data.functionInvocationModules?.nodes?.[0] ?? null - }) + functionInvocationModule: data.functionInvocationModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationModule", "functionInvocationModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModule", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class FunctionInvocationModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationModule": data.functionInvocationModules?.nodes?.[0] ?? null - }) + functionInvocationModule: data.functionInvocationModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocationModule", "createFunctionInvocationModule", "functionInvocationModule", args.select, args.data, "CreateFunctionInvocationModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocationModule', + 'createFunctionInvocationModule', + 'functionInvocationModule', + args.select, + args.data, + 'CreateFunctionInvocationModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "createFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'createFunctionInvocationModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionInvocationModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocationModule", "updateFunctionInvocationModule", "functionInvocationModule", args.select, args.where.id, args.data, "UpdateFunctionInvocationModuleInput", "id", "functionInvocationModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocationModule', + 'updateFunctionInvocationModule', + 'functionInvocationModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationModuleInput', + 'id', + 'functionInvocationModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "updateFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'updateFunctionInvocationModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocationModule", "deleteFunctionInvocationModule", "functionInvocationModule", { - id: args.where.id - }, "DeleteFunctionInvocationModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocationModule', + 'deleteFunctionInvocationModule', + 'functionInvocationModule', + { + id: args.where.id, + }, + 'DeleteFunctionInvocationModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "deleteFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'deleteFunctionInvocationModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/functionModule.ts b/sdk/constructive-cli/src/modules/orm/models/functionModule.ts index af5039e9a4..7e127377dd 100644 --- a/sdk/constructive-cli/src/modules/orm/models/functionModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/functionModule.ts @@ -3,56 +3,96 @@ * @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 { FunctionModule, FunctionModuleWithRelations, FunctionModuleSelect, FunctionModuleFilter, FunctionModuleOrderBy, CreateFunctionModuleInput, UpdateFunctionModuleInput, FunctionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionModule, + FunctionModuleWithRelations, + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy, + CreateFunctionModuleInput, + UpdateFunctionModuleInput, + FunctionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionModule", "functionModules", 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 - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionModule', + 'functionModules', + 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, + }, + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModules", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionModule", "functionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionModule', + 'functionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModule", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionModule": data.functionModules?.nodes?.[0] ?? null - }) + functionModule: data.functionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionModule", "functionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionModule', + 'functionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModule", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionModule": data.functionModules?.nodes?.[0] ?? null - }) + functionModule: data.functionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionModule", "createFunctionModule", "functionModule", args.select, args.data, "CreateFunctionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionModule', + 'createFunctionModule', + 'functionModule', + args.select, + args.data, + 'CreateFunctionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "createFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'createFunctionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionModule", "updateFunctionModule", "functionModule", args.select, args.where.id, args.data, "UpdateFunctionModuleInput", "id", "functionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionModule', + 'updateFunctionModule', + 'functionModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionModuleInput', + 'id', + 'functionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "updateFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'updateFunctionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionModule", "deleteFunctionModule", "functionModule", { - id: args.where.id - }, "DeleteFunctionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionModule', + 'deleteFunctionModule', + 'functionModule', + { + id: args.where.id, + }, + 'DeleteFunctionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "deleteFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'deleteFunctionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/graphExecutionModule.ts b/sdk/constructive-cli/src/modules/orm/models/graphExecutionModule.ts index 9f71b75b40..9f1866c036 100644 --- a/sdk/constructive-cli/src/modules/orm/models/graphExecutionModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/graphExecutionModule.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { GraphExecutionModule, GraphExecutionModuleWithRelations, GraphExecutionModuleSelect, GraphExecutionModuleFilter, GraphExecutionModuleOrderBy, CreateGraphExecutionModuleInput, UpdateGraphExecutionModuleInput, GraphExecutionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GraphExecutionModule, + GraphExecutionModuleWithRelations, + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, + CreateGraphExecutionModuleInput, + UpdateGraphExecutionModuleInput, + GraphExecutionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GraphExecutionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - graphExecutionModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModules", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphExecutionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModule", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class GraphExecutionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphExecutionModule": data.graphExecutionModules?.nodes?.[0] ?? null - }) + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ graphExecutionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModule", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class GraphExecutionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphExecutionModule": data.graphExecutionModules?.nodes?.[0] ?? null - }) + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GraphExecutionModule", "createGraphExecutionModule", "graphExecutionModule", args.select, args.data, "CreateGraphExecutionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GraphExecutionModule', + 'createGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.data, + 'CreateGraphExecutionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "createGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'createGraphExecutionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphExecutionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("GraphExecutionModule", "updateGraphExecutionModule", "graphExecutionModule", args.select, args.where.id, args.data, "UpdateGraphExecutionModuleInput", "id", "graphExecutionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'GraphExecutionModule', + 'updateGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphExecutionModuleInput', + 'id', + 'graphExecutionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "updateGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'updateGraphExecutionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("GraphExecutionModule", "deleteGraphExecutionModule", "graphExecutionModule", { - id: args.where.id - }, "DeleteGraphExecutionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'GraphExecutionModule', + 'deleteGraphExecutionModule', + 'graphExecutionModule', + { + id: args.where.id, + }, + 'DeleteGraphExecutionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "deleteGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'deleteGraphExecutionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/graphModule.ts b/sdk/constructive-cli/src/modules/orm/models/graphModule.ts index a7fa776384..f337b77ed9 100644 --- a/sdk/constructive-cli/src/modules/orm/models/graphModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/graphModule.ts @@ -3,56 +3,96 @@ * @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 { GraphModule, GraphModuleWithRelations, GraphModuleSelect, GraphModuleFilter, GraphModuleOrderBy, CreateGraphModuleInput, UpdateGraphModuleInput, GraphModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GraphModule, + GraphModuleWithRelations, + GraphModuleSelect, + GraphModuleFilter, + GraphModuleOrderBy, + CreateGraphModuleInput, + UpdateGraphModuleInput, + GraphModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GraphModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GraphModule", "graphModules", 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 - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GraphModule', + 'graphModules', + 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, + }, + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModules", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GraphModule", "graphModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GraphModule', + 'graphModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModule", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class GraphModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphModule": data.graphModules?.nodes?.[0] ?? null - }) + graphModule: data.graphModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("GraphModule", "graphModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'GraphModule', + 'graphModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModule", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class GraphModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphModule": data.graphModules?.nodes?.[0] ?? null - }) + graphModule: data.graphModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GraphModule", "createGraphModule", "graphModule", args.select, args.data, "CreateGraphModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GraphModule', + 'createGraphModule', + 'graphModule', + args.select, + args.data, + 'CreateGraphModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "createGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'createGraphModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("GraphModule", "updateGraphModule", "graphModule", args.select, args.where.id, args.data, "UpdateGraphModuleInput", "id", "graphModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'GraphModule', + 'updateGraphModule', + 'graphModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphModuleInput', + 'id', + 'graphModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "updateGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'updateGraphModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("GraphModule", "deleteGraphModule", "graphModule", { - id: args.where.id - }, "DeleteGraphModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'GraphModule', + 'deleteGraphModule', + 'graphModule', + { + id: args.where.id, + }, + 'DeleteGraphModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "deleteGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'deleteGraphModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/hierarchyModule.ts b/sdk/constructive-cli/src/modules/orm/models/hierarchyModule.ts index 30eca6fb9e..16e9170d2b 100644 --- a/sdk/constructive-cli/src/modules/orm/models/hierarchyModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/hierarchyModule.ts @@ -3,56 +3,96 @@ * @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 { HierarchyModule, HierarchyModuleWithRelations, HierarchyModuleSelect, HierarchyModuleFilter, HierarchyModuleOrderBy, CreateHierarchyModuleInput, UpdateHierarchyModuleInput, HierarchyModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HierarchyModule, + HierarchyModuleWithRelations, + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy, + CreateHierarchyModuleInput, + UpdateHierarchyModuleInput, + HierarchyModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HierarchyModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HierarchyModule", "hierarchyModules", 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 - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HierarchyModule', + 'hierarchyModules', + 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, + }, + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModules", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HierarchyModule", "hierarchyModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HierarchyModule', + 'hierarchyModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModule", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HierarchyModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "hierarchyModule": data.hierarchyModules?.nodes?.[0] ?? null - }) + hierarchyModule: data.hierarchyModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HierarchyModule", "hierarchyModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HierarchyModule', + 'hierarchyModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModule", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HierarchyModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "hierarchyModule": data.hierarchyModules?.nodes?.[0] ?? null - }) + hierarchyModule: data.hierarchyModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HierarchyModule", "createHierarchyModule", "hierarchyModule", args.select, args.data, "CreateHierarchyModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HierarchyModule', + 'createHierarchyModule', + 'hierarchyModule', + args.select, + args.data, + 'CreateHierarchyModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "createHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'createHierarchyModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HierarchyModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HierarchyModule", "updateHierarchyModule", "hierarchyModule", args.select, args.where.id, args.data, "UpdateHierarchyModuleInput", "id", "hierarchyModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HierarchyModule', + 'updateHierarchyModule', + 'hierarchyModule', + args.select, + args.where.id, + args.data, + 'UpdateHierarchyModuleInput', + 'id', + 'hierarchyModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "updateHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'updateHierarchyModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HierarchyModule", "deleteHierarchyModule", "hierarchyModule", { - id: args.where.id - }, "DeleteHierarchyModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HierarchyModule', + 'deleteHierarchyModule', + 'hierarchyModule', + { + id: args.where.id, + }, + 'DeleteHierarchyModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "deleteHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'deleteHierarchyModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/httpRouteModule.ts b/sdk/constructive-cli/src/modules/orm/models/httpRouteModule.ts index c44abc24a3..babf4d3085 100644 --- a/sdk/constructive-cli/src/modules/orm/models/httpRouteModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/httpRouteModule.ts @@ -3,56 +3,96 @@ * @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 { HttpRouteModule, HttpRouteModuleWithRelations, HttpRouteModuleSelect, HttpRouteModuleFilter, HttpRouteModuleOrderBy, CreateHttpRouteModuleInput, UpdateHttpRouteModuleInput, HttpRouteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HttpRouteModule, + HttpRouteModuleWithRelations, + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy, + CreateHttpRouteModuleInput, + UpdateHttpRouteModuleInput, + HttpRouteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HttpRouteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRouteModule", "httpRouteModules", 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 - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HttpRouteModule', + 'httpRouteModules', + 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, + }, + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModules", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HttpRouteModule", "httpRouteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HttpRouteModule', + 'httpRouteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModule", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HttpRouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRouteModule": data.httpRouteModules?.nodes?.[0] ?? null - }) + httpRouteModule: data.httpRouteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRouteModule", "httpRouteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HttpRouteModule', + 'httpRouteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModule", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HttpRouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRouteModule": data.httpRouteModules?.nodes?.[0] ?? null - }) + httpRouteModule: data.httpRouteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HttpRouteModule", "createHttpRouteModule", "httpRouteModule", args.select, args.data, "CreateHttpRouteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HttpRouteModule', + 'createHttpRouteModule', + 'httpRouteModule', + args.select, + args.data, + 'CreateHttpRouteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "createHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'createHttpRouteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HttpRouteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HttpRouteModule", "updateHttpRouteModule", "httpRouteModule", args.select, args.where.id, args.data, "UpdateHttpRouteModuleInput", "id", "httpRouteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HttpRouteModule', + 'updateHttpRouteModule', + 'httpRouteModule', + args.select, + args.where.id, + args.data, + 'UpdateHttpRouteModuleInput', + 'id', + 'httpRouteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "updateHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'updateHttpRouteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HttpRouteModule", "deleteHttpRouteModule", "httpRouteModule", { - id: args.where.id - }, "DeleteHttpRouteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HttpRouteModule', + 'deleteHttpRouteModule', + 'httpRouteModule', + { + id: args.where.id, + }, + 'DeleteHttpRouteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "deleteHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'deleteHttpRouteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/i18NModule.ts b/sdk/constructive-cli/src/modules/orm/models/i18NModule.ts index c49e6d670b..014ecefd15 100644 --- a/sdk/constructive-cli/src/modules/orm/models/i18NModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/i18NModule.ts @@ -3,56 +3,96 @@ * @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 { I18NModule, I18NModuleWithRelations, I18NModuleSelect, I18NModuleFilter, I18NModuleOrderBy, CreateI18NModuleInput, UpdateI18NModuleInput, I18NModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + I18NModule, + I18NModuleWithRelations, + I18NModuleSelect, + I18NModuleFilter, + I18NModuleOrderBy, + CreateI18NModuleInput, + UpdateI18NModuleInput, + I18NModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class I18NModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ i18nModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("I18NModule", "i18nModules", 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 - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'I18NModule', + 'i18nModules', + 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, + }, + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18nModules", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18nModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ i18NModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("I18NModule", "i18nModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'I18NModule', + 'i18nModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18NModule", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18NModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class I18NModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "i18NModule": data.i18nModules?.nodes?.[0] ?? null - }) + i18NModule: data.i18nModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ i18NModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("I18NModule", "i18nModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'I18NModule', + 'i18nModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18NModule", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18NModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class I18NModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "i18NModule": data.i18nModules?.nodes?.[0] ?? null - }) + i18NModule: data.i18nModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("I18NModule", "createI18NModule", "i18NModule", args.select, args.data, "CreateI18NModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'I18NModule', + 'createI18NModule', + 'i18NModule', + args.select, + args.data, + 'CreateI18NModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "createI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'createI18NModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + I18NModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("I18NModule", "updateI18NModule", "i18NModule", args.select, args.where.id, args.data, "UpdateI18NModuleInput", "id", "i18NModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'I18NModule', + 'updateI18NModule', + 'i18NModule', + args.select, + args.where.id, + args.data, + 'UpdateI18NModuleInput', + 'id', + 'i18NModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "updateI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'updateI18NModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("I18NModule", "deleteI18NModule", "i18NModule", { - id: args.where.id - }, "DeleteI18NModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'I18NModule', + 'deleteI18NModule', + 'i18NModule', + { + id: args.where.id, + }, + 'DeleteI18NModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "deleteI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'deleteI18NModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/identityProvidersModule.ts b/sdk/constructive-cli/src/modules/orm/models/identityProvidersModule.ts index 35b05c8128..bc564b56d1 100644 --- a/sdk/constructive-cli/src/modules/orm/models/identityProvidersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/identityProvidersModule.ts @@ -3,56 +3,98 @@ * @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 { IdentityProvidersModule, IdentityProvidersModuleWithRelations, IdentityProvidersModuleSelect, IdentityProvidersModuleFilter, IdentityProvidersModuleOrderBy, CreateIdentityProvidersModuleInput, UpdateIdentityProvidersModuleInput, IdentityProvidersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IdentityProvidersModule, + IdentityProvidersModuleWithRelations, + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy, + CreateIdentityProvidersModuleInput, + UpdateIdentityProvidersModuleInput, + IdentityProvidersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IdentityProvidersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - identityProvidersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + identityProvidersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvidersModule", "identityProvidersModules", 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 - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + 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, + }, + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModules", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvidersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IdentityProvidersModule", "identityProvidersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModule", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class IdentityProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvidersModule": data.identityProvidersModules?.nodes?.[0] ?? null - }) + identityProvidersModule: data.identityProvidersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvidersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvidersModule", "identityProvidersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModule", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class IdentityProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvidersModule": data.identityProvidersModules?.nodes?.[0] ?? null - }) + identityProvidersModule: data.identityProvidersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IdentityProvidersModule", "createIdentityProvidersModule", "identityProvidersModule", args.select, args.data, "CreateIdentityProvidersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IdentityProvidersModule', + 'createIdentityProvidersModule', + 'identityProvidersModule', + args.select, + args.data, + 'CreateIdentityProvidersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "createIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'createIdentityProvidersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IdentityProvidersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IdentityProvidersModule", "updateIdentityProvidersModule", "identityProvidersModule", args.select, args.where.id, args.data, "UpdateIdentityProvidersModuleInput", "id", "identityProvidersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IdentityProvidersModule', + 'updateIdentityProvidersModule', + 'identityProvidersModule', + args.select, + args.where.id, + args.data, + 'UpdateIdentityProvidersModuleInput', + 'id', + 'identityProvidersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "updateIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'updateIdentityProvidersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IdentityProvidersModule", "deleteIdentityProvidersModule", "identityProvidersModule", { - id: args.where.id - }, "DeleteIdentityProvidersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IdentityProvidersModule', + 'deleteIdentityProvidersModule', + 'identityProvidersModule', + { + id: args.where.id, + }, + 'DeleteIdentityProvidersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "deleteIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'deleteIdentityProvidersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/index.ts b/sdk/constructive-cli/src/modules/orm/models/index.ts index b2fe8faa92..3aa2d03318 100644 --- a/sdk/constructive-cli/src/modules/orm/models/index.ts +++ b/sdk/constructive-cli/src/modules/orm/models/index.ts @@ -3,78 +3,78 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AgentModuleModel } from "./agentModule"; -export { ApiSurfaceModuleModel } from "./apiSurfaceModule"; -export { AppModuleModel } from "./appModule"; -export { BillingModuleModel } from "./billingModule"; -export { BillingProviderModuleModel } from "./billingProviderModule"; -export { BlueprintModel } from "./blueprint"; -export { BlueprintConstructionModel } from "./blueprintConstruction"; -export { BlueprintTemplateModel } from "./blueprintTemplate"; -export { CatalogModuleModel } from "./catalogModule"; -export { ComputeLogModuleModel } from "./computeLogModule"; -export { ConfigSecretsUserModuleModel } from "./configSecretsUserModule"; -export { ConnectedAccountsModuleModel } from "./connectedAccountsModule"; -export { CryptoAddressesModuleModel } from "./cryptoAddressesModule"; -export { CryptoAuthModuleModel } from "./cryptoAuthModule"; -export { DatabaseProvisionModuleModel } from "./databaseProvisionModule"; -export { DatabaseSettingsModuleModel } from "./databaseSettingsModule"; -export { DbPoolConfigModel } from "./dbPoolConfig"; -export { DbPoolModel } from "./dbPool"; -export { DbPresetModuleModel } from "./dbPresetModule"; -export { DbUsageModuleModel } from "./dbUsageModule"; -export { DefaultIdsModuleModel } from "./defaultIdsModule"; -export { DenormalizedTableFieldModel } from "./denormalizedTableField"; -export { DevicesModuleModel } from "./devicesModule"; -export { DomainModuleModel } from "./domainModule"; -export { EmailsModuleModel } from "./emailsModule"; -export { EntityTypeProvisionModel } from "./entityTypeProvision"; -export { EventsModuleModel } from "./eventsModule"; -export { FunctionDeploymentModuleModel } from "./functionDeploymentModule"; -export { FunctionInvocationModuleModel } from "./functionInvocationModule"; -export { FunctionModuleModel } from "./functionModule"; -export { GraphExecutionModuleModel } from "./graphExecutionModule"; -export { GraphModuleModel } from "./graphModule"; -export { HierarchyModuleModel } from "./hierarchyModule"; -export { HttpRouteModuleModel } from "./httpRouteModule"; -export { I18NModuleModel } from "./i18NModule"; -export { IdentityProvidersModuleModel } from "./identityProvidersModule"; -export { InferenceLogModuleModel } from "./inferenceLogModule"; -export { InfraConfigModuleModel } from "./infraConfigModule"; -export { InfraSecretsModuleModel } from "./infraSecretsModule"; -export { IntegrationProvidersModuleModel } from "./integrationProvidersModule"; -export { InternalSecretsModuleModel } from "./internalSecretsModule"; -export { InvitesModuleModel } from "./invitesModule"; -export { LimitsModuleModel } from "./limitsModule"; -export { MembershipTypesModuleModel } from "./membershipTypesModule"; -export { MembershipsModuleModel } from "./membershipsModule"; -export { MerkleStoreModuleModel } from "./merkleStoreModule"; -export { NamespaceModuleModel } from "./namespaceModule"; -export { NotificationsModuleModel } from "./notificationsModule"; -export { PermissionsModuleModel } from "./permissionsModule"; -export { PhoneNumbersModuleModel } from "./phoneNumbersModule"; -export { PlansModuleModel } from "./plansModule"; -export { PrincipalAuthModuleModel } from "./principalAuthModule"; -export { ProfilesModuleModel } from "./profilesModule"; -export { RateLimitMetersModuleModel } from "./rateLimitMetersModule"; -export { RateLimitsModuleModel } from "./rateLimitsModule"; -export { RealtimeModuleModel } from "./realtimeModule"; -export { RelationProvisionModel } from "./relationProvision"; -export { ResourceModuleModel } from "./resourceModule"; -export { RlsModuleModel } from "./rlsModule"; -export { RouteModuleModel } from "./routeModule"; -export { SecureTableProvisionModel } from "./secureTableProvision"; -export { SessionSecretsModuleModel } from "./sessionSecretsModule"; -export { SessionsModuleModel } from "./sessionsModule"; -export { SiteSurfaceModuleModel } from "./siteSurfaceModule"; -export { StorageLogModuleModel } from "./storageLogModule"; -export { StorageModuleModel } from "./storageModule"; -export { TransferLogModuleModel } from "./transferLogModule"; -export { UserAuthModuleModel } from "./userAuthModule"; -export { UserCredentialsModuleModel } from "./userCredentialsModule"; -export { UserSettingsModuleModel } from "./userSettingsModule"; -export { UserStateModuleModel } from "./userStateModule"; -export { UsersModuleModel } from "./usersModule"; -export { WebauthnAuthModuleModel } from "./webauthnAuthModule"; -export { WebauthnCredentialsModuleModel } from "./webauthnCredentialsModule"; -export { WebhookModuleModel } from "./webhookModule"; \ No newline at end of file +export { AgentModuleModel } from './agentModule'; +export { ApiSurfaceModuleModel } from './apiSurfaceModule'; +export { AppModuleModel } from './appModule'; +export { BillingModuleModel } from './billingModule'; +export { BillingProviderModuleModel } from './billingProviderModule'; +export { BlueprintModel } from './blueprint'; +export { BlueprintConstructionModel } from './blueprintConstruction'; +export { BlueprintTemplateModel } from './blueprintTemplate'; +export { CatalogModuleModel } from './catalogModule'; +export { ComputeLogModuleModel } from './computeLogModule'; +export { ConfigSecretsUserModuleModel } from './configSecretsUserModule'; +export { ConnectedAccountsModuleModel } from './connectedAccountsModule'; +export { CryptoAddressesModuleModel } from './cryptoAddressesModule'; +export { CryptoAuthModuleModel } from './cryptoAuthModule'; +export { DatabaseProvisionModuleModel } from './databaseProvisionModule'; +export { DatabaseSettingsModuleModel } from './databaseSettingsModule'; +export { DbPoolConfigModel } from './dbPoolConfig'; +export { DbPoolModel } from './dbPool'; +export { DbPresetModuleModel } from './dbPresetModule'; +export { DbUsageModuleModel } from './dbUsageModule'; +export { DefaultIdsModuleModel } from './defaultIdsModule'; +export { DenormalizedTableFieldModel } from './denormalizedTableField'; +export { DevicesModuleModel } from './devicesModule'; +export { DomainModuleModel } from './domainModule'; +export { EmailsModuleModel } from './emailsModule'; +export { EntityTypeProvisionModel } from './entityTypeProvision'; +export { EventsModuleModel } from './eventsModule'; +export { FunctionDeploymentModuleModel } from './functionDeploymentModule'; +export { FunctionInvocationModuleModel } from './functionInvocationModule'; +export { FunctionModuleModel } from './functionModule'; +export { GraphExecutionModuleModel } from './graphExecutionModule'; +export { GraphModuleModel } from './graphModule'; +export { HierarchyModuleModel } from './hierarchyModule'; +export { HttpRouteModuleModel } from './httpRouteModule'; +export { I18NModuleModel } from './i18NModule'; +export { IdentityProvidersModuleModel } from './identityProvidersModule'; +export { InferenceLogModuleModel } from './inferenceLogModule'; +export { InfraConfigModuleModel } from './infraConfigModule'; +export { InfraSecretsModuleModel } from './infraSecretsModule'; +export { IntegrationProvidersModuleModel } from './integrationProvidersModule'; +export { InternalSecretsModuleModel } from './internalSecretsModule'; +export { InvitesModuleModel } from './invitesModule'; +export { LimitsModuleModel } from './limitsModule'; +export { MembershipTypesModuleModel } from './membershipTypesModule'; +export { MembershipsModuleModel } from './membershipsModule'; +export { MerkleStoreModuleModel } from './merkleStoreModule'; +export { NamespaceModuleModel } from './namespaceModule'; +export { NotificationsModuleModel } from './notificationsModule'; +export { PermissionsModuleModel } from './permissionsModule'; +export { PhoneNumbersModuleModel } from './phoneNumbersModule'; +export { PlansModuleModel } from './plansModule'; +export { PrincipalAuthModuleModel } from './principalAuthModule'; +export { ProfilesModuleModel } from './profilesModule'; +export { RateLimitMetersModuleModel } from './rateLimitMetersModule'; +export { RateLimitsModuleModel } from './rateLimitsModule'; +export { RealtimeModuleModel } from './realtimeModule'; +export { RelationProvisionModel } from './relationProvision'; +export { ResourceModuleModel } from './resourceModule'; +export { RlsModuleModel } from './rlsModule'; +export { RouteModuleModel } from './routeModule'; +export { SecureTableProvisionModel } from './secureTableProvision'; +export { SessionSecretsModuleModel } from './sessionSecretsModule'; +export { SessionsModuleModel } from './sessionsModule'; +export { SiteSurfaceModuleModel } from './siteSurfaceModule'; +export { StorageLogModuleModel } from './storageLogModule'; +export { StorageModuleModel } from './storageModule'; +export { TransferLogModuleModel } from './transferLogModule'; +export { UserAuthModuleModel } from './userAuthModule'; +export { UserCredentialsModuleModel } from './userCredentialsModule'; +export { UserSettingsModuleModel } from './userSettingsModule'; +export { UserStateModuleModel } from './userStateModule'; +export { UsersModuleModel } from './usersModule'; +export { WebauthnAuthModuleModel } from './webauthnAuthModule'; +export { WebauthnCredentialsModuleModel } from './webauthnCredentialsModule'; +export { WebhookModuleModel } from './webhookModule'; diff --git a/sdk/constructive-cli/src/modules/orm/models/inferenceLogModule.ts b/sdk/constructive-cli/src/modules/orm/models/inferenceLogModule.ts index ea4160dd85..f4c0f77d3b 100644 --- a/sdk/constructive-cli/src/modules/orm/models/inferenceLogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/inferenceLogModule.ts @@ -3,56 +3,96 @@ * @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 { InferenceLogModule, InferenceLogModuleWithRelations, InferenceLogModuleSelect, InferenceLogModuleFilter, InferenceLogModuleOrderBy, CreateInferenceLogModuleInput, UpdateInferenceLogModuleInput, InferenceLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InferenceLogModule, + InferenceLogModuleWithRelations, + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy, + CreateInferenceLogModuleInput, + UpdateInferenceLogModuleInput, + InferenceLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InferenceLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InferenceLogModule", "inferenceLogModules", 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 - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InferenceLogModule', + 'inferenceLogModules', + 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, + }, + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModules", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InferenceLogModule", "inferenceLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InferenceLogModule', + 'inferenceLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModule", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InferenceLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "inferenceLogModule": data.inferenceLogModules?.nodes?.[0] ?? null - }) + inferenceLogModule: data.inferenceLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InferenceLogModule", "inferenceLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InferenceLogModule', + 'inferenceLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModule", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InferenceLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "inferenceLogModule": data.inferenceLogModules?.nodes?.[0] ?? null - }) + inferenceLogModule: data.inferenceLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InferenceLogModule", "createInferenceLogModule", "inferenceLogModule", args.select, args.data, "CreateInferenceLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InferenceLogModule', + 'createInferenceLogModule', + 'inferenceLogModule', + args.select, + args.data, + 'CreateInferenceLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "createInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'createInferenceLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InferenceLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InferenceLogModule", "updateInferenceLogModule", "inferenceLogModule", args.select, args.where.id, args.data, "UpdateInferenceLogModuleInput", "id", "inferenceLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InferenceLogModule', + 'updateInferenceLogModule', + 'inferenceLogModule', + args.select, + args.where.id, + args.data, + 'UpdateInferenceLogModuleInput', + 'id', + 'inferenceLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "updateInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'updateInferenceLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InferenceLogModule", "deleteInferenceLogModule", "inferenceLogModule", { - id: args.where.id - }, "DeleteInferenceLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InferenceLogModule', + 'deleteInferenceLogModule', + 'inferenceLogModule', + { + id: args.where.id, + }, + 'DeleteInferenceLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "deleteInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'deleteInferenceLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/infraConfigModule.ts b/sdk/constructive-cli/src/modules/orm/models/infraConfigModule.ts index ace75e0620..12a793b04f 100644 --- a/sdk/constructive-cli/src/modules/orm/models/infraConfigModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/infraConfigModule.ts @@ -3,56 +3,96 @@ * @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 { InfraConfigModule, InfraConfigModuleWithRelations, InfraConfigModuleSelect, InfraConfigModuleFilter, InfraConfigModuleOrderBy, CreateInfraConfigModuleInput, UpdateInfraConfigModuleInput, InfraConfigModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraConfigModule, + InfraConfigModuleWithRelations, + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy, + CreateInfraConfigModuleInput, + UpdateInfraConfigModuleInput, + InfraConfigModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraConfigModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraConfigModule", "infraConfigModules", 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 - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraConfigModule', + 'infraConfigModules', + 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, + }, + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModules", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraConfigModule", "infraConfigModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraConfigModule', + 'infraConfigModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModule", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraConfigModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraConfigModule": data.infraConfigModules?.nodes?.[0] ?? null - }) + infraConfigModule: data.infraConfigModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraConfigModule", "infraConfigModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraConfigModule', + 'infraConfigModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModule", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraConfigModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraConfigModule": data.infraConfigModules?.nodes?.[0] ?? null - }) + infraConfigModule: data.infraConfigModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraConfigModule", "createInfraConfigModule", "infraConfigModule", args.select, args.data, "CreateInfraConfigModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraConfigModule', + 'createInfraConfigModule', + 'infraConfigModule', + args.select, + args.data, + 'CreateInfraConfigModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "createInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'createInfraConfigModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraConfigModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraConfigModule", "updateInfraConfigModule", "infraConfigModule", args.select, args.where.id, args.data, "UpdateInfraConfigModuleInput", "id", "infraConfigModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraConfigModule', + 'updateInfraConfigModule', + 'infraConfigModule', + args.select, + args.where.id, + args.data, + 'UpdateInfraConfigModuleInput', + 'id', + 'infraConfigModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "updateInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'updateInfraConfigModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraConfigModule", "deleteInfraConfigModule", "infraConfigModule", { - id: args.where.id - }, "DeleteInfraConfigModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraConfigModule', + 'deleteInfraConfigModule', + 'infraConfigModule', + { + id: args.where.id, + }, + 'DeleteInfraConfigModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "deleteInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'deleteInfraConfigModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/infraSecretsModule.ts b/sdk/constructive-cli/src/modules/orm/models/infraSecretsModule.ts index d1089bf89d..165b4f2d59 100644 --- a/sdk/constructive-cli/src/modules/orm/models/infraSecretsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/infraSecretsModule.ts @@ -3,56 +3,96 @@ * @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 { InfraSecretsModule, InfraSecretsModuleWithRelations, InfraSecretsModuleSelect, InfraSecretsModuleFilter, InfraSecretsModuleOrderBy, CreateInfraSecretsModuleInput, UpdateInfraSecretsModuleInput, InfraSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraSecretsModule, + InfraSecretsModuleWithRelations, + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy, + CreateInfraSecretsModuleInput, + UpdateInfraSecretsModuleInput, + InfraSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraSecretsModule", "infraSecretsModules", 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 - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + 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, + }, + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModules", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraSecretsModule", "infraSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModule", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraSecretsModule": data.infraSecretsModules?.nodes?.[0] ?? null - }) + infraSecretsModule: data.infraSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraSecretsModule", "infraSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModule", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraSecretsModule": data.infraSecretsModules?.nodes?.[0] ?? null - }) + infraSecretsModule: data.infraSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraSecretsModule", "createInfraSecretsModule", "infraSecretsModule", args.select, args.data, "CreateInfraSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraSecretsModule', + 'createInfraSecretsModule', + 'infraSecretsModule', + args.select, + args.data, + 'CreateInfraSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "createInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'createInfraSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraSecretsModule", "updateInfraSecretsModule", "infraSecretsModule", args.select, args.where.id, args.data, "UpdateInfraSecretsModuleInput", "id", "infraSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraSecretsModule', + 'updateInfraSecretsModule', + 'infraSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateInfraSecretsModuleInput', + 'id', + 'infraSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "updateInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'updateInfraSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraSecretsModule", "deleteInfraSecretsModule", "infraSecretsModule", { - id: args.where.id - }, "DeleteInfraSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraSecretsModule', + 'deleteInfraSecretsModule', + 'infraSecretsModule', + { + id: args.where.id, + }, + 'DeleteInfraSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "deleteInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'deleteInfraSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/integrationProvidersModule.ts b/sdk/constructive-cli/src/modules/orm/models/integrationProvidersModule.ts index 23d033a40a..63c765faee 100644 --- a/sdk/constructive-cli/src/modules/orm/models/integrationProvidersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/integrationProvidersModule.ts @@ -3,56 +3,101 @@ * @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 { IntegrationProvidersModule, IntegrationProvidersModuleWithRelations, IntegrationProvidersModuleSelect, IntegrationProvidersModuleFilter, IntegrationProvidersModuleOrderBy, CreateIntegrationProvidersModuleInput, UpdateIntegrationProvidersModuleInput, IntegrationProvidersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IntegrationProvidersModule, + IntegrationProvidersModuleWithRelations, + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy, + CreateIntegrationProvidersModuleInput, + UpdateIntegrationProvidersModuleInput, + IntegrationProvidersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IntegrationProvidersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvidersModule", "integrationProvidersModules", 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 - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + 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, + }, + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModules", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModule: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModule: InferSelectResult< + IntegrationProvidersModuleWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IntegrationProvidersModule", "integrationProvidersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModule", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModule', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class IntegrationProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvidersModule": data.integrationProvidersModules?.nodes?.[0] ?? null - }) + integrationProvidersModule: data.integrationProvidersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModule: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModule: InferSelectResult< + IntegrationProvidersModuleWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvidersModule", "integrationProvidersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModule", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModule', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class IntegrationProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvidersModule": data.integrationProvidersModules?.nodes?.[0] ?? null - }) + integrationProvidersModule: data.integrationProvidersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IntegrationProvidersModule", "createIntegrationProvidersModule", "integrationProvidersModule", args.select, args.data, "CreateIntegrationProvidersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IntegrationProvidersModule', + 'createIntegrationProvidersModule', + 'integrationProvidersModule', + args.select, + args.data, + 'CreateIntegrationProvidersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "createIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'createIntegrationProvidersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IntegrationProvidersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IntegrationProvidersModule", "updateIntegrationProvidersModule", "integrationProvidersModule", args.select, args.where.id, args.data, "UpdateIntegrationProvidersModuleInput", "id", "integrationProvidersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IntegrationProvidersModule', + 'updateIntegrationProvidersModule', + 'integrationProvidersModule', + args.select, + args.where.id, + args.data, + 'UpdateIntegrationProvidersModuleInput', + 'id', + 'integrationProvidersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "updateIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'updateIntegrationProvidersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IntegrationProvidersModule", "deleteIntegrationProvidersModule", "integrationProvidersModule", { - id: args.where.id - }, "DeleteIntegrationProvidersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IntegrationProvidersModule', + 'deleteIntegrationProvidersModule', + 'integrationProvidersModule', + { + id: args.where.id, + }, + 'DeleteIntegrationProvidersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "deleteIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'deleteIntegrationProvidersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/internalSecretsModule.ts b/sdk/constructive-cli/src/modules/orm/models/internalSecretsModule.ts index 649ce5bbd9..cfffbed8d5 100644 --- a/sdk/constructive-cli/src/modules/orm/models/internalSecretsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/internalSecretsModule.ts @@ -3,56 +3,98 @@ * @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 { InternalSecretsModule, InternalSecretsModuleWithRelations, InternalSecretsModuleSelect, InternalSecretsModuleFilter, InternalSecretsModuleOrderBy, CreateInternalSecretsModuleInput, UpdateInternalSecretsModuleInput, InternalSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InternalSecretsModule, + InternalSecretsModuleWithRelations, + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy, + CreateInternalSecretsModuleInput, + UpdateInternalSecretsModuleInput, + InternalSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InternalSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - internalSecretsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + internalSecretsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("InternalSecretsModule", "internalSecretsModules", 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 - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + 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, + }, + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModules", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ internalSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InternalSecretsModule", "internalSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModule", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class InternalSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "internalSecretsModule": data.internalSecretsModules?.nodes?.[0] ?? null - }) + internalSecretsModule: data.internalSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ internalSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InternalSecretsModule", "internalSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModule", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class InternalSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "internalSecretsModule": data.internalSecretsModules?.nodes?.[0] ?? null - }) + internalSecretsModule: data.internalSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InternalSecretsModule", "createInternalSecretsModule", "internalSecretsModule", args.select, args.data, "CreateInternalSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InternalSecretsModule', + 'createInternalSecretsModule', + 'internalSecretsModule', + args.select, + args.data, + 'CreateInternalSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "createInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'createInternalSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InternalSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InternalSecretsModule", "updateInternalSecretsModule", "internalSecretsModule", args.select, args.where.id, args.data, "UpdateInternalSecretsModuleInput", "id", "internalSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InternalSecretsModule', + 'updateInternalSecretsModule', + 'internalSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateInternalSecretsModuleInput', + 'id', + 'internalSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "updateInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'updateInternalSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InternalSecretsModule", "deleteInternalSecretsModule", "internalSecretsModule", { - id: args.where.id - }, "DeleteInternalSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InternalSecretsModule', + 'deleteInternalSecretsModule', + 'internalSecretsModule', + { + id: args.where.id, + }, + 'DeleteInternalSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "deleteInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'deleteInternalSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/invitesModule.ts b/sdk/constructive-cli/src/modules/orm/models/invitesModule.ts index b740ff9252..b244078720 100644 --- a/sdk/constructive-cli/src/modules/orm/models/invitesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/invitesModule.ts @@ -3,56 +3,96 @@ * @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 { InvitesModule, InvitesModuleWithRelations, InvitesModuleSelect, InvitesModuleFilter, InvitesModuleOrderBy, CreateInvitesModuleInput, UpdateInvitesModuleInput, InvitesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InvitesModule, + InvitesModuleWithRelations, + InvitesModuleSelect, + InvitesModuleFilter, + InvitesModuleOrderBy, + CreateInvitesModuleInput, + UpdateInvitesModuleInput, + InvitesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InvitesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InvitesModule", "invitesModules", 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 - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InvitesModule', + 'invitesModules', + 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, + }, + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModules", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InvitesModule", "invitesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InvitesModule', + 'invitesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModule", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InvitesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "invitesModule": data.invitesModules?.nodes?.[0] ?? null - }) + invitesModule: data.invitesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InvitesModule", "invitesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InvitesModule', + 'invitesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModule", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InvitesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "invitesModule": data.invitesModules?.nodes?.[0] ?? null - }) + invitesModule: data.invitesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InvitesModule", "createInvitesModule", "invitesModule", args.select, args.data, "CreateInvitesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InvitesModule', + 'createInvitesModule', + 'invitesModule', + args.select, + args.data, + 'CreateInvitesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "createInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'createInvitesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InvitesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InvitesModule", "updateInvitesModule", "invitesModule", args.select, args.where.id, args.data, "UpdateInvitesModuleInput", "id", "invitesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InvitesModule', + 'updateInvitesModule', + 'invitesModule', + args.select, + args.where.id, + args.data, + 'UpdateInvitesModuleInput', + 'id', + 'invitesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "updateInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'updateInvitesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InvitesModule", "deleteInvitesModule", "invitesModule", { - id: args.where.id - }, "DeleteInvitesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InvitesModule', + 'deleteInvitesModule', + 'invitesModule', + { + id: args.where.id, + }, + 'DeleteInvitesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "deleteInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'deleteInvitesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/limitsModule.ts b/sdk/constructive-cli/src/modules/orm/models/limitsModule.ts index 4e868d7c8f..50d0d76ba5 100644 --- a/sdk/constructive-cli/src/modules/orm/models/limitsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/limitsModule.ts @@ -3,56 +3,96 @@ * @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 { LimitsModule, LimitsModuleWithRelations, LimitsModuleSelect, LimitsModuleFilter, LimitsModuleOrderBy, CreateLimitsModuleInput, UpdateLimitsModuleInput, LimitsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + LimitsModule, + LimitsModuleWithRelations, + LimitsModuleSelect, + LimitsModuleFilter, + LimitsModuleOrderBy, + CreateLimitsModuleInput, + UpdateLimitsModuleInput, + LimitsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class LimitsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("LimitsModule", "limitsModules", 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 - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'LimitsModule', + 'limitsModules', + 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, + }, + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModules", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("LimitsModule", "limitsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'LimitsModule', + 'limitsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModule", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class LimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "limitsModule": data.limitsModules?.nodes?.[0] ?? null - }) + limitsModule: data.limitsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("LimitsModule", "limitsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'LimitsModule', + 'limitsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModule", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class LimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "limitsModule": data.limitsModules?.nodes?.[0] ?? null - }) + limitsModule: data.limitsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("LimitsModule", "createLimitsModule", "limitsModule", args.select, args.data, "CreateLimitsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'LimitsModule', + 'createLimitsModule', + 'limitsModule', + args.select, + args.data, + 'CreateLimitsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "createLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'createLimitsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + LimitsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("LimitsModule", "updateLimitsModule", "limitsModule", args.select, args.where.id, args.data, "UpdateLimitsModuleInput", "id", "limitsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'LimitsModule', + 'updateLimitsModule', + 'limitsModule', + args.select, + args.where.id, + args.data, + 'UpdateLimitsModuleInput', + 'id', + 'limitsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "updateLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'updateLimitsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("LimitsModule", "deleteLimitsModule", "limitsModule", { - id: args.where.id - }, "DeleteLimitsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'LimitsModule', + 'deleteLimitsModule', + 'limitsModule', + { + id: args.where.id, + }, + 'DeleteLimitsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "deleteLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'deleteLimitsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/membershipTypesModule.ts b/sdk/constructive-cli/src/modules/orm/models/membershipTypesModule.ts index 87f83a4f04..9eeb67961f 100644 --- a/sdk/constructive-cli/src/modules/orm/models/membershipTypesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/membershipTypesModule.ts @@ -3,56 +3,98 @@ * @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 { MembershipTypesModule, MembershipTypesModuleWithRelations, MembershipTypesModuleSelect, MembershipTypesModuleFilter, MembershipTypesModuleOrderBy, CreateMembershipTypesModuleInput, UpdateMembershipTypesModuleInput, MembershipTypesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipTypesModule, + MembershipTypesModuleWithRelations, + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy, + CreateMembershipTypesModuleInput, + UpdateMembershipTypesModuleInput, + MembershipTypesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipTypesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - membershipTypesModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + membershipTypesModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipTypesModule", "membershipTypesModules", 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 - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + 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, + }, + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModules", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipTypesModule", "membershipTypesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModule", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class MembershipTypesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipTypesModule": data.membershipTypesModules?.nodes?.[0] ?? null - }) + membershipTypesModule: data.membershipTypesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipTypesModule", "membershipTypesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModule", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class MembershipTypesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipTypesModule": data.membershipTypesModules?.nodes?.[0] ?? null - }) + membershipTypesModule: data.membershipTypesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipTypesModule", "createMembershipTypesModule", "membershipTypesModule", args.select, args.data, "CreateMembershipTypesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipTypesModule', + 'createMembershipTypesModule', + 'membershipTypesModule', + args.select, + args.data, + 'CreateMembershipTypesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "createMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'createMembershipTypesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MembershipTypesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipTypesModule", "updateMembershipTypesModule", "membershipTypesModule", args.select, args.where.id, args.data, "UpdateMembershipTypesModuleInput", "id", "membershipTypesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipTypesModule', + 'updateMembershipTypesModule', + 'membershipTypesModule', + args.select, + args.where.id, + args.data, + 'UpdateMembershipTypesModuleInput', + 'id', + 'membershipTypesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "updateMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'updateMembershipTypesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipTypesModule", "deleteMembershipTypesModule", "membershipTypesModule", { - id: args.where.id - }, "DeleteMembershipTypesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipTypesModule', + 'deleteMembershipTypesModule', + 'membershipTypesModule', + { + id: args.where.id, + }, + 'DeleteMembershipTypesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "deleteMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'deleteMembershipTypesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/membershipsModule.ts b/sdk/constructive-cli/src/modules/orm/models/membershipsModule.ts index ce4375291b..66b41bce21 100644 --- a/sdk/constructive-cli/src/modules/orm/models/membershipsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/membershipsModule.ts @@ -3,56 +3,96 @@ * @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 { MembershipsModule, MembershipsModuleWithRelations, MembershipsModuleSelect, MembershipsModuleFilter, MembershipsModuleOrderBy, CreateMembershipsModuleInput, UpdateMembershipsModuleInput, MembershipsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipsModule, + MembershipsModuleWithRelations, + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy, + CreateMembershipsModuleInput, + UpdateMembershipsModuleInput, + MembershipsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipsModule", "membershipsModules", 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 - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipsModule', + 'membershipsModules', + 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, + }, + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModules", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipsModule", "membershipsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipsModule', + 'membershipsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModule", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MembershipsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipsModule": data.membershipsModules?.nodes?.[0] ?? null - }) + membershipsModule: data.membershipsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipsModule", "membershipsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipsModule', + 'membershipsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModule", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MembershipsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipsModule": data.membershipsModules?.nodes?.[0] ?? null - }) + membershipsModule: data.membershipsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipsModule", "createMembershipsModule", "membershipsModule", args.select, args.data, "CreateMembershipsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipsModule', + 'createMembershipsModule', + 'membershipsModule', + args.select, + args.data, + 'CreateMembershipsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "createMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'createMembershipsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MembershipsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipsModule", "updateMembershipsModule", "membershipsModule", args.select, args.where.id, args.data, "UpdateMembershipsModuleInput", "id", "membershipsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipsModule', + 'updateMembershipsModule', + 'membershipsModule', + args.select, + args.where.id, + args.data, + 'UpdateMembershipsModuleInput', + 'id', + 'membershipsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "updateMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'updateMembershipsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipsModule", "deleteMembershipsModule", "membershipsModule", { - id: args.where.id - }, "DeleteMembershipsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipsModule', + 'deleteMembershipsModule', + 'membershipsModule', + { + id: args.where.id, + }, + 'DeleteMembershipsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "deleteMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'deleteMembershipsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/merkleStoreModule.ts b/sdk/constructive-cli/src/modules/orm/models/merkleStoreModule.ts index 3a6aa3c7c8..d3bb9d0c67 100644 --- a/sdk/constructive-cli/src/modules/orm/models/merkleStoreModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/merkleStoreModule.ts @@ -3,56 +3,96 @@ * @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 { MerkleStoreModule, MerkleStoreModuleWithRelations, MerkleStoreModuleSelect, MerkleStoreModuleFilter, MerkleStoreModuleOrderBy, CreateMerkleStoreModuleInput, UpdateMerkleStoreModuleInput, MerkleStoreModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MerkleStoreModule, + MerkleStoreModuleWithRelations, + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy, + CreateMerkleStoreModuleInput, + UpdateMerkleStoreModuleInput, + MerkleStoreModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MerkleStoreModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MerkleStoreModule", "merkleStoreModules", 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 - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + 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, + }, + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModules", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MerkleStoreModule", "merkleStoreModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModule", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MerkleStoreModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "merkleStoreModule": data.merkleStoreModules?.nodes?.[0] ?? null - }) + merkleStoreModule: data.merkleStoreModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MerkleStoreModule", "merkleStoreModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModule", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MerkleStoreModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "merkleStoreModule": data.merkleStoreModules?.nodes?.[0] ?? null - }) + merkleStoreModule: data.merkleStoreModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MerkleStoreModule", "createMerkleStoreModule", "merkleStoreModule", args.select, args.data, "CreateMerkleStoreModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MerkleStoreModule', + 'createMerkleStoreModule', + 'merkleStoreModule', + args.select, + args.data, + 'CreateMerkleStoreModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "createMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'createMerkleStoreModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MerkleStoreModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MerkleStoreModule", "updateMerkleStoreModule", "merkleStoreModule", args.select, args.where.id, args.data, "UpdateMerkleStoreModuleInput", "id", "merkleStoreModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MerkleStoreModule', + 'updateMerkleStoreModule', + 'merkleStoreModule', + args.select, + args.where.id, + args.data, + 'UpdateMerkleStoreModuleInput', + 'id', + 'merkleStoreModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "updateMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'updateMerkleStoreModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MerkleStoreModule", "deleteMerkleStoreModule", "merkleStoreModule", { - id: args.where.id - }, "DeleteMerkleStoreModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MerkleStoreModule', + 'deleteMerkleStoreModule', + 'merkleStoreModule', + { + id: args.where.id, + }, + 'DeleteMerkleStoreModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "deleteMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'deleteMerkleStoreModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/namespaceModule.ts b/sdk/constructive-cli/src/modules/orm/models/namespaceModule.ts index 582b808922..bd5c681504 100644 --- a/sdk/constructive-cli/src/modules/orm/models/namespaceModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/namespaceModule.ts @@ -3,56 +3,96 @@ * @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 { NamespaceModule, NamespaceModuleWithRelations, NamespaceModuleSelect, NamespaceModuleFilter, NamespaceModuleOrderBy, CreateNamespaceModuleInput, UpdateNamespaceModuleInput, NamespaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceModule, + NamespaceModuleWithRelations, + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy, + CreateNamespaceModuleInput, + UpdateNamespaceModuleInput, + NamespaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceModule", "namespaceModules", 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 - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceModule', + 'namespaceModules', + 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, + }, + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModules", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceModule", "namespaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceModule', + 'namespaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModule", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceModule": data.namespaceModules?.nodes?.[0] ?? null - }) + namespaceModule: data.namespaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceModule", "namespaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceModule', + 'namespaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModule", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceModule": data.namespaceModules?.nodes?.[0] ?? null - }) + namespaceModule: data.namespaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceModule", "createNamespaceModule", "namespaceModule", args.select, args.data, "CreateNamespaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceModule', + 'createNamespaceModule', + 'namespaceModule', + args.select, + args.data, + 'CreateNamespaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "createNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'createNamespaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceModule", "updateNamespaceModule", "namespaceModule", args.select, args.where.id, args.data, "UpdateNamespaceModuleInput", "id", "namespaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceModule', + 'updateNamespaceModule', + 'namespaceModule', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceModuleInput', + 'id', + 'namespaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "updateNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'updateNamespaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceModule", "deleteNamespaceModule", "namespaceModule", { - id: args.where.id - }, "DeleteNamespaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceModule', + 'deleteNamespaceModule', + 'namespaceModule', + { + id: args.where.id, + }, + 'DeleteNamespaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "deleteNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'deleteNamespaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/notificationsModule.ts b/sdk/constructive-cli/src/modules/orm/models/notificationsModule.ts index 2957519a06..a629d81108 100644 --- a/sdk/constructive-cli/src/modules/orm/models/notificationsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/notificationsModule.ts @@ -3,56 +3,96 @@ * @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 { NotificationsModule, NotificationsModuleWithRelations, NotificationsModuleSelect, NotificationsModuleFilter, NotificationsModuleOrderBy, CreateNotificationsModuleInput, UpdateNotificationsModuleInput, NotificationsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NotificationsModule, + NotificationsModuleWithRelations, + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy, + CreateNotificationsModuleInput, + UpdateNotificationsModuleInput, + NotificationsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NotificationsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NotificationsModule", "notificationsModules", 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 - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NotificationsModule', + 'notificationsModules', + 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, + }, + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModules", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NotificationsModule", "notificationsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NotificationsModule', + 'notificationsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModule", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NotificationsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "notificationsModule": data.notificationsModules?.nodes?.[0] ?? null - }) + notificationsModule: data.notificationsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NotificationsModule", "notificationsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NotificationsModule', + 'notificationsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModule", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NotificationsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "notificationsModule": data.notificationsModules?.nodes?.[0] ?? null - }) + notificationsModule: data.notificationsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NotificationsModule", "createNotificationsModule", "notificationsModule", args.select, args.data, "CreateNotificationsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NotificationsModule', + 'createNotificationsModule', + 'notificationsModule', + args.select, + args.data, + 'CreateNotificationsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "createNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'createNotificationsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NotificationsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NotificationsModule", "updateNotificationsModule", "notificationsModule", args.select, args.where.id, args.data, "UpdateNotificationsModuleInput", "id", "notificationsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NotificationsModule', + 'updateNotificationsModule', + 'notificationsModule', + args.select, + args.where.id, + args.data, + 'UpdateNotificationsModuleInput', + 'id', + 'notificationsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "updateNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'updateNotificationsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NotificationsModule", "deleteNotificationsModule", "notificationsModule", { - id: args.where.id - }, "DeleteNotificationsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NotificationsModule', + 'deleteNotificationsModule', + 'notificationsModule', + { + id: args.where.id, + }, + 'DeleteNotificationsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "deleteNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'deleteNotificationsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/permissionsModule.ts b/sdk/constructive-cli/src/modules/orm/models/permissionsModule.ts index 1b7e756241..2a330457b5 100644 --- a/sdk/constructive-cli/src/modules/orm/models/permissionsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/permissionsModule.ts @@ -3,56 +3,96 @@ * @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 { PermissionsModule, PermissionsModuleWithRelations, PermissionsModuleSelect, PermissionsModuleFilter, PermissionsModuleOrderBy, CreatePermissionsModuleInput, UpdatePermissionsModuleInput, PermissionsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PermissionsModule, + PermissionsModuleWithRelations, + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy, + CreatePermissionsModuleInput, + UpdatePermissionsModuleInput, + PermissionsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PermissionsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PermissionsModule", "permissionsModules", 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 - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PermissionsModule', + 'permissionsModules', + 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, + }, + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModules", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PermissionsModule", "permissionsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PermissionsModule', + 'permissionsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModule", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PermissionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "permissionsModule": data.permissionsModules?.nodes?.[0] ?? null - }) + permissionsModule: data.permissionsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PermissionsModule", "permissionsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PermissionsModule', + 'permissionsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModule", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PermissionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "permissionsModule": data.permissionsModules?.nodes?.[0] ?? null - }) + permissionsModule: data.permissionsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PermissionsModule", "createPermissionsModule", "permissionsModule", args.select, args.data, "CreatePermissionsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PermissionsModule', + 'createPermissionsModule', + 'permissionsModule', + args.select, + args.data, + 'CreatePermissionsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "createPermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'createPermissionsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PermissionsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PermissionsModule", "updatePermissionsModule", "permissionsModule", args.select, args.where.id, args.data, "UpdatePermissionsModuleInput", "id", "permissionsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PermissionsModule', + 'updatePermissionsModule', + 'permissionsModule', + args.select, + args.where.id, + args.data, + 'UpdatePermissionsModuleInput', + 'id', + 'permissionsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "updatePermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'updatePermissionsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PermissionsModule", "deletePermissionsModule", "permissionsModule", { - id: args.where.id - }, "DeletePermissionsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PermissionsModule', + 'deletePermissionsModule', + 'permissionsModule', + { + id: args.where.id, + }, + 'DeletePermissionsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "deletePermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'deletePermissionsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/phoneNumbersModule.ts b/sdk/constructive-cli/src/modules/orm/models/phoneNumbersModule.ts index ee3e5afa0f..42cbdfc98f 100644 --- a/sdk/constructive-cli/src/modules/orm/models/phoneNumbersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/phoneNumbersModule.ts @@ -3,56 +3,96 @@ * @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 { PhoneNumbersModule, PhoneNumbersModuleWithRelations, PhoneNumbersModuleSelect, PhoneNumbersModuleFilter, PhoneNumbersModuleOrderBy, CreatePhoneNumbersModuleInput, UpdatePhoneNumbersModuleInput, PhoneNumbersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PhoneNumbersModule, + PhoneNumbersModuleWithRelations, + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy, + CreatePhoneNumbersModuleInput, + UpdatePhoneNumbersModuleInput, + PhoneNumbersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PhoneNumbersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumbersModule", "phoneNumbersModules", 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 - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + 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, + }, + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModules", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PhoneNumbersModule", "phoneNumbersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModule", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PhoneNumbersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumbersModule": data.phoneNumbersModules?.nodes?.[0] ?? null - }) + phoneNumbersModule: data.phoneNumbersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumbersModule", "phoneNumbersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModule", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PhoneNumbersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumbersModule": data.phoneNumbersModules?.nodes?.[0] ?? null - }) + phoneNumbersModule: data.phoneNumbersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PhoneNumbersModule", "createPhoneNumbersModule", "phoneNumbersModule", args.select, args.data, "CreatePhoneNumbersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PhoneNumbersModule', + 'createPhoneNumbersModule', + 'phoneNumbersModule', + args.select, + args.data, + 'CreatePhoneNumbersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "createPhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'createPhoneNumbersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PhoneNumbersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PhoneNumbersModule", "updatePhoneNumbersModule", "phoneNumbersModule", args.select, args.where.id, args.data, "UpdatePhoneNumbersModuleInput", "id", "phoneNumbersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PhoneNumbersModule', + 'updatePhoneNumbersModule', + 'phoneNumbersModule', + args.select, + args.where.id, + args.data, + 'UpdatePhoneNumbersModuleInput', + 'id', + 'phoneNumbersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "updatePhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'updatePhoneNumbersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PhoneNumbersModule", "deletePhoneNumbersModule", "phoneNumbersModule", { - id: args.where.id - }, "DeletePhoneNumbersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PhoneNumbersModule', + 'deletePhoneNumbersModule', + 'phoneNumbersModule', + { + id: args.where.id, + }, + 'DeletePhoneNumbersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "deletePhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'deletePhoneNumbersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/plansModule.ts b/sdk/constructive-cli/src/modules/orm/models/plansModule.ts index aef90eafc2..545fbdd7cb 100644 --- a/sdk/constructive-cli/src/modules/orm/models/plansModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/plansModule.ts @@ -3,56 +3,96 @@ * @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 { PlansModule, PlansModuleWithRelations, PlansModuleSelect, PlansModuleFilter, PlansModuleOrderBy, CreatePlansModuleInput, UpdatePlansModuleInput, PlansModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlansModule, + PlansModuleWithRelations, + PlansModuleSelect, + PlansModuleFilter, + PlansModuleOrderBy, + CreatePlansModuleInput, + UpdatePlansModuleInput, + PlansModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlansModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlansModule", "plansModules", 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 - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlansModule', + 'plansModules', + 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, + }, + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModules", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlansModule", "plansModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlansModule', + 'plansModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModule", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlansModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "plansModule": data.plansModules?.nodes?.[0] ?? null - }) + plansModule: data.plansModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlansModule", "plansModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlansModule', + 'plansModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModule", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlansModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "plansModule": data.plansModules?.nodes?.[0] ?? null - }) + plansModule: data.plansModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlansModule", "createPlansModule", "plansModule", args.select, args.data, "CreatePlansModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlansModule', + 'createPlansModule', + 'plansModule', + args.select, + args.data, + 'CreatePlansModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "createPlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'createPlansModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlansModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlansModule", "updatePlansModule", "plansModule", args.select, args.where.id, args.data, "UpdatePlansModuleInput", "id", "plansModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlansModule', + 'updatePlansModule', + 'plansModule', + args.select, + args.where.id, + args.data, + 'UpdatePlansModuleInput', + 'id', + 'plansModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "updatePlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'updatePlansModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlansModule", "deletePlansModule", "plansModule", { - id: args.where.id - }, "DeletePlansModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlansModule', + 'deletePlansModule', + 'plansModule', + { + id: args.where.id, + }, + 'DeletePlansModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "deletePlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'deletePlansModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/principalAuthModule.ts b/sdk/constructive-cli/src/modules/orm/models/principalAuthModule.ts index fcf622bb0f..c0e9d913d3 100644 --- a/sdk/constructive-cli/src/modules/orm/models/principalAuthModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/principalAuthModule.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalAuthModule": data.principalAuthModules?.nodes?.[0] ?? null - }) + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalAuthModule", "principalAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalAuthModuleFilter", "PrincipalAuthModuleOrderBy", connectionFieldsMap); + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalAuthModule", - fieldName: "principalAuthModule", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PrincipalAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalAuthModule": data.principalAuthModules?.nodes?.[0] ?? null - }) + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalAuthModule: { principalAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalAuthModule", "createPrincipalAuthModule", "principalAuthModule", args.select, args.data, "CreatePrincipalAuthModuleInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'createPrincipalAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'updatePrincipalAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'deletePrincipalAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/profilesModule.ts b/sdk/constructive-cli/src/modules/orm/models/profilesModule.ts index 1fc4cff3fb..15d5a94e79 100644 --- a/sdk/constructive-cli/src/modules/orm/models/profilesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/profilesModule.ts @@ -3,56 +3,96 @@ * @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 { ProfilesModule, ProfilesModuleWithRelations, ProfilesModuleSelect, ProfilesModuleFilter, ProfilesModuleOrderBy, CreateProfilesModuleInput, UpdateProfilesModuleInput, ProfilesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ProfilesModule, + ProfilesModuleWithRelations, + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy, + CreateProfilesModuleInput, + UpdateProfilesModuleInput, + ProfilesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ProfilesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ProfilesModule", "profilesModules", 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 - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ProfilesModule', + 'profilesModules', + 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, + }, + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModules", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ProfilesModule", "profilesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ProfilesModule', + 'profilesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModule", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ProfilesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "profilesModule": data.profilesModules?.nodes?.[0] ?? null - }) + profilesModule: data.profilesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ProfilesModule", "profilesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ProfilesModule', + 'profilesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModule", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ProfilesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "profilesModule": data.profilesModules?.nodes?.[0] ?? null - }) + profilesModule: data.profilesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ProfilesModule", "createProfilesModule", "profilesModule", args.select, args.data, "CreateProfilesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ProfilesModule', + 'createProfilesModule', + 'profilesModule', + args.select, + args.data, + 'CreateProfilesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "createProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'createProfilesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ProfilesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ProfilesModule", "updateProfilesModule", "profilesModule", args.select, args.where.id, args.data, "UpdateProfilesModuleInput", "id", "profilesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ProfilesModule', + 'updateProfilesModule', + 'profilesModule', + args.select, + args.where.id, + args.data, + 'UpdateProfilesModuleInput', + 'id', + 'profilesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "updateProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'updateProfilesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ProfilesModule", "deleteProfilesModule", "profilesModule", { - id: args.where.id - }, "DeleteProfilesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ProfilesModule', + 'deleteProfilesModule', + 'profilesModule', + { + id: args.where.id, + }, + 'DeleteProfilesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "deleteProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'deleteProfilesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/rateLimitMetersModule.ts b/sdk/constructive-cli/src/modules/orm/models/rateLimitMetersModule.ts index cfa9903246..1205e581d8 100644 --- a/sdk/constructive-cli/src/modules/orm/models/rateLimitMetersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/rateLimitMetersModule.ts @@ -3,56 +3,98 @@ * @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 { RateLimitMetersModule, RateLimitMetersModuleWithRelations, RateLimitMetersModuleSelect, RateLimitMetersModuleFilter, RateLimitMetersModuleOrderBy, CreateRateLimitMetersModuleInput, UpdateRateLimitMetersModuleInput, RateLimitMetersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RateLimitMetersModule, + RateLimitMetersModuleWithRelations, + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy, + CreateRateLimitMetersModuleInput, + UpdateRateLimitMetersModuleInput, + RateLimitMetersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RateLimitMetersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - rateLimitMetersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + rateLimitMetersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitMetersModule", "rateLimitMetersModules", 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 - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + 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, + }, + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModules", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitMetersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RateLimitMetersModule", "rateLimitMetersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModule", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class RateLimitMetersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitMetersModule": data.rateLimitMetersModules?.nodes?.[0] ?? null - }) + rateLimitMetersModule: data.rateLimitMetersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitMetersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitMetersModule", "rateLimitMetersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModule", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class RateLimitMetersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitMetersModule": data.rateLimitMetersModules?.nodes?.[0] ?? null - }) + rateLimitMetersModule: data.rateLimitMetersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RateLimitMetersModule", "createRateLimitMetersModule", "rateLimitMetersModule", args.select, args.data, "CreateRateLimitMetersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RateLimitMetersModule', + 'createRateLimitMetersModule', + 'rateLimitMetersModule', + args.select, + args.data, + 'CreateRateLimitMetersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "createRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'createRateLimitMetersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RateLimitMetersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RateLimitMetersModule", "updateRateLimitMetersModule", "rateLimitMetersModule", args.select, args.where.id, args.data, "UpdateRateLimitMetersModuleInput", "id", "rateLimitMetersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RateLimitMetersModule', + 'updateRateLimitMetersModule', + 'rateLimitMetersModule', + args.select, + args.where.id, + args.data, + 'UpdateRateLimitMetersModuleInput', + 'id', + 'rateLimitMetersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "updateRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'updateRateLimitMetersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RateLimitMetersModule", "deleteRateLimitMetersModule", "rateLimitMetersModule", { - id: args.where.id - }, "DeleteRateLimitMetersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RateLimitMetersModule', + 'deleteRateLimitMetersModule', + 'rateLimitMetersModule', + { + id: args.where.id, + }, + 'DeleteRateLimitMetersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "deleteRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'deleteRateLimitMetersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/rateLimitsModule.ts b/sdk/constructive-cli/src/modules/orm/models/rateLimitsModule.ts index 854856d9e4..dbf9501696 100644 --- a/sdk/constructive-cli/src/modules/orm/models/rateLimitsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/rateLimitsModule.ts @@ -3,56 +3,96 @@ * @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 { RateLimitsModule, RateLimitsModuleWithRelations, RateLimitsModuleSelect, RateLimitsModuleFilter, RateLimitsModuleOrderBy, CreateRateLimitsModuleInput, UpdateRateLimitsModuleInput, RateLimitsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RateLimitsModule, + RateLimitsModuleWithRelations, + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy, + CreateRateLimitsModuleInput, + UpdateRateLimitsModuleInput, + RateLimitsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RateLimitsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitsModule", "rateLimitsModules", 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 - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RateLimitsModule', + 'rateLimitsModules', + 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, + }, + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModules", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RateLimitsModule", "rateLimitsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RateLimitsModule', + 'rateLimitsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModule", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RateLimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitsModule": data.rateLimitsModules?.nodes?.[0] ?? null - }) + rateLimitsModule: data.rateLimitsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitsModule", "rateLimitsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RateLimitsModule', + 'rateLimitsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModule", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RateLimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitsModule": data.rateLimitsModules?.nodes?.[0] ?? null - }) + rateLimitsModule: data.rateLimitsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RateLimitsModule", "createRateLimitsModule", "rateLimitsModule", args.select, args.data, "CreateRateLimitsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RateLimitsModule', + 'createRateLimitsModule', + 'rateLimitsModule', + args.select, + args.data, + 'CreateRateLimitsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "createRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'createRateLimitsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RateLimitsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RateLimitsModule", "updateRateLimitsModule", "rateLimitsModule", args.select, args.where.id, args.data, "UpdateRateLimitsModuleInput", "id", "rateLimitsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RateLimitsModule', + 'updateRateLimitsModule', + 'rateLimitsModule', + args.select, + args.where.id, + args.data, + 'UpdateRateLimitsModuleInput', + 'id', + 'rateLimitsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "updateRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'updateRateLimitsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RateLimitsModule", "deleteRateLimitsModule", "rateLimitsModule", { - id: args.where.id - }, "DeleteRateLimitsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RateLimitsModule', + 'deleteRateLimitsModule', + 'rateLimitsModule', + { + id: args.where.id, + }, + 'DeleteRateLimitsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "deleteRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'deleteRateLimitsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/realtimeModule.ts b/sdk/constructive-cli/src/modules/orm/models/realtimeModule.ts index a7be0753e0..2cb1075457 100644 --- a/sdk/constructive-cli/src/modules/orm/models/realtimeModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/realtimeModule.ts @@ -3,56 +3,96 @@ * @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 { RealtimeModule, RealtimeModuleWithRelations, RealtimeModuleSelect, RealtimeModuleFilter, RealtimeModuleOrderBy, CreateRealtimeModuleInput, UpdateRealtimeModuleInput, RealtimeModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RealtimeModule, + RealtimeModuleWithRelations, + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy, + CreateRealtimeModuleInput, + UpdateRealtimeModuleInput, + RealtimeModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RealtimeModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RealtimeModule", "realtimeModules", 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 - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RealtimeModule', + 'realtimeModules', + 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, + }, + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModules", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RealtimeModule", "realtimeModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RealtimeModule', + 'realtimeModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModule", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RealtimeModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "realtimeModule": data.realtimeModules?.nodes?.[0] ?? null - }) + realtimeModule: data.realtimeModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RealtimeModule", "realtimeModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RealtimeModule', + 'realtimeModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModule", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RealtimeModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "realtimeModule": data.realtimeModules?.nodes?.[0] ?? null - }) + realtimeModule: data.realtimeModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RealtimeModule", "createRealtimeModule", "realtimeModule", args.select, args.data, "CreateRealtimeModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RealtimeModule', + 'createRealtimeModule', + 'realtimeModule', + args.select, + args.data, + 'CreateRealtimeModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "createRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'createRealtimeModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RealtimeModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RealtimeModule", "updateRealtimeModule", "realtimeModule", args.select, args.where.id, args.data, "UpdateRealtimeModuleInput", "id", "realtimeModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RealtimeModule', + 'updateRealtimeModule', + 'realtimeModule', + args.select, + args.where.id, + args.data, + 'UpdateRealtimeModuleInput', + 'id', + 'realtimeModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "updateRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'updateRealtimeModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RealtimeModule", "deleteRealtimeModule", "realtimeModule", { - id: args.where.id - }, "DeleteRealtimeModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RealtimeModule', + 'deleteRealtimeModule', + 'realtimeModule', + { + id: args.where.id, + }, + 'DeleteRealtimeModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "deleteRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'deleteRealtimeModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/relationProvision.ts b/sdk/constructive-cli/src/modules/orm/models/relationProvision.ts index 267d8855f3..c8bc481ca9 100644 --- a/sdk/constructive-cli/src/modules/orm/models/relationProvision.ts +++ b/sdk/constructive-cli/src/modules/orm/models/relationProvision.ts @@ -3,56 +3,96 @@ * @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 { RelationProvision, RelationProvisionWithRelations, RelationProvisionSelect, RelationProvisionFilter, RelationProvisionOrderBy, CreateRelationProvisionInput, UpdateRelationProvisionInput, RelationProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RelationProvision, + RelationProvisionWithRelations, + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy, + CreateRelationProvisionInput, + UpdateRelationProvisionInput, + RelationProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RelationProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvisions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RelationProvision", "relationProvisions", 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 - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RelationProvision', + 'relationProvisions', + 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, + }, + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvisions", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RelationProvision", "relationProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RelationProvision', + 'relationProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvision", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvision', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RelationProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "relationProvision": data.relationProvisions?.nodes?.[0] ?? null - }) + relationProvision: data.relationProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RelationProvision", "relationProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RelationProvision', + 'relationProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvision", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvision', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RelationProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "relationProvision": data.relationProvisions?.nodes?.[0] ?? null - }) + relationProvision: data.relationProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RelationProvision", "createRelationProvision", "relationProvision", args.select, args.data, "CreateRelationProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RelationProvision', + 'createRelationProvision', + 'relationProvision', + args.select, + args.data, + 'CreateRelationProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "createRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'createRelationProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RelationProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RelationProvision", "updateRelationProvision", "relationProvision", args.select, args.where.id, args.data, "UpdateRelationProvisionInput", "id", "relationProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RelationProvision', + 'updateRelationProvision', + 'relationProvision', + args.select, + args.where.id, + args.data, + 'UpdateRelationProvisionInput', + 'id', + 'relationProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "updateRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'updateRelationProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RelationProvision", "deleteRelationProvision", "relationProvision", { - id: args.where.id - }, "DeleteRelationProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RelationProvision', + 'deleteRelationProvision', + 'relationProvision', + { + id: args.where.id, + }, + 'DeleteRelationProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "deleteRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'deleteRelationProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/resourceModule.ts b/sdk/constructive-cli/src/modules/orm/models/resourceModule.ts index 9f1e49821a..8fef54a24a 100644 --- a/sdk/constructive-cli/src/modules/orm/models/resourceModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/resourceModule.ts @@ -3,56 +3,96 @@ * @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 { ResourceModule, ResourceModuleWithRelations, ResourceModuleSelect, ResourceModuleFilter, ResourceModuleOrderBy, CreateResourceModuleInput, UpdateResourceModuleInput, ResourceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceModule, + ResourceModuleWithRelations, + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy, + CreateResourceModuleInput, + UpdateResourceModuleInput, + ResourceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceModule", "resourceModules", 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 - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceModule', + 'resourceModules', + 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, + }, + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModules", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceModule", "resourceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceModule', + 'resourceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModule", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceModule": data.resourceModules?.nodes?.[0] ?? null - }) + resourceModule: data.resourceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceModule", "resourceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceModule', + 'resourceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModule", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceModule": data.resourceModules?.nodes?.[0] ?? null - }) + resourceModule: data.resourceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceModule", "createResourceModule", "resourceModule", args.select, args.data, "CreateResourceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceModule', + 'createResourceModule', + 'resourceModule', + args.select, + args.data, + 'CreateResourceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "createResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'createResourceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceModule", "updateResourceModule", "resourceModule", args.select, args.where.id, args.data, "UpdateResourceModuleInput", "id", "resourceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceModule', + 'updateResourceModule', + 'resourceModule', + args.select, + args.where.id, + args.data, + 'UpdateResourceModuleInput', + 'id', + 'resourceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "updateResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'updateResourceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceModule", "deleteResourceModule", "resourceModule", { - id: args.where.id - }, "DeleteResourceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceModule', + 'deleteResourceModule', + 'resourceModule', + { + id: args.where.id, + }, + 'DeleteResourceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "deleteResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'deleteResourceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/rlsModule.ts b/sdk/constructive-cli/src/modules/orm/models/rlsModule.ts index 5d167b4465..6a1c7cae75 100644 --- a/sdk/constructive-cli/src/modules/orm/models/rlsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/rlsModule.ts @@ -3,56 +3,96 @@ * @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 { RlsModule, RlsModuleWithRelations, RlsModuleSelect, RlsModuleFilter, RlsModuleOrderBy, CreateRlsModuleInput, UpdateRlsModuleInput, RlsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RlsModule, + RlsModuleWithRelations, + RlsModuleSelect, + RlsModuleFilter, + RlsModuleOrderBy, + CreateRlsModuleInput, + UpdateRlsModuleInput, + RlsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RlsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RlsModule", "rlsModules", 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 - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RlsModule', + 'rlsModules', + 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, + }, + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModules", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RlsModule", "rlsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RlsModule', + 'rlsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModule", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RlsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsModule": data.rlsModules?.nodes?.[0] ?? null - }) + rlsModule: data.rlsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RlsModule", "rlsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RlsModule', + 'rlsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModule", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RlsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsModule": data.rlsModules?.nodes?.[0] ?? null - }) + rlsModule: data.rlsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RlsModule", "createRlsModule", "rlsModule", args.select, args.data, "CreateRlsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RlsModule', + 'createRlsModule', + 'rlsModule', + args.select, + args.data, + 'CreateRlsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "createRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'createRlsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RlsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RlsModule", "updateRlsModule", "rlsModule", args.select, args.where.id, args.data, "UpdateRlsModuleInput", "id", "rlsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RlsModule', + 'updateRlsModule', + 'rlsModule', + args.select, + args.where.id, + args.data, + 'UpdateRlsModuleInput', + 'id', + 'rlsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "updateRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'updateRlsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RlsModule", "deleteRlsModule", "rlsModule", { - id: args.where.id - }, "DeleteRlsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RlsModule', + 'deleteRlsModule', + 'rlsModule', + { + id: args.where.id, + }, + 'DeleteRlsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "deleteRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'deleteRlsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/routeModule.ts b/sdk/constructive-cli/src/modules/orm/models/routeModule.ts index d663444fdb..d57b13ceac 100644 --- a/sdk/constructive-cli/src/modules/orm/models/routeModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/routeModule.ts @@ -3,56 +3,96 @@ * @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 { RouteModule, RouteModuleWithRelations, RouteModuleSelect, RouteModuleFilter, RouteModuleOrderBy, CreateRouteModuleInput, UpdateRouteModuleInput, RouteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RouteModule, + RouteModuleWithRelations, + RouteModuleSelect, + RouteModuleFilter, + RouteModuleOrderBy, + CreateRouteModuleInput, + UpdateRouteModuleInput, + RouteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RouteModule", "routeModules", 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 - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RouteModule', + 'routeModules', + 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, + }, + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModules", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RouteModule", "routeModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RouteModule', + 'routeModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModule", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeModule": data.routeModules?.nodes?.[0] ?? null - }) + routeModule: data.routeModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RouteModule", "routeModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RouteModule', + 'routeModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModule", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeModule": data.routeModules?.nodes?.[0] ?? null - }) + routeModule: data.routeModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RouteModule", "createRouteModule", "routeModule", args.select, args.data, "CreateRouteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RouteModule', + 'createRouteModule', + 'routeModule', + args.select, + args.data, + 'CreateRouteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "createRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'createRouteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RouteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RouteModule", "updateRouteModule", "routeModule", args.select, args.where.id, args.data, "UpdateRouteModuleInput", "id", "routeModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RouteModule', + 'updateRouteModule', + 'routeModule', + args.select, + args.where.id, + args.data, + 'UpdateRouteModuleInput', + 'id', + 'routeModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "updateRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'updateRouteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RouteModule", "deleteRouteModule", "routeModule", { - id: args.where.id - }, "DeleteRouteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RouteModule', + 'deleteRouteModule', + 'routeModule', + { + id: args.where.id, + }, + 'DeleteRouteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "deleteRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'deleteRouteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/secureTableProvision.ts b/sdk/constructive-cli/src/modules/orm/models/secureTableProvision.ts index d96900112a..88e10489d0 100644 --- a/sdk/constructive-cli/src/modules/orm/models/secureTableProvision.ts +++ b/sdk/constructive-cli/src/modules/orm/models/secureTableProvision.ts @@ -3,56 +3,98 @@ * @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 { SecureTableProvision, SecureTableProvisionWithRelations, SecureTableProvisionSelect, SecureTableProvisionFilter, SecureTableProvisionOrderBy, CreateSecureTableProvisionInput, UpdateSecureTableProvisionInput, SecureTableProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SecureTableProvision, + SecureTableProvisionWithRelations, + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy, + CreateSecureTableProvisionInput, + UpdateSecureTableProvisionInput, + SecureTableProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SecureTableProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - secureTableProvisions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secureTableProvisions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("SecureTableProvision", "secureTableProvisions", 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 - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SecureTableProvision', + 'secureTableProvisions', + 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, + }, + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvisions", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secureTableProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SecureTableProvision", "secureTableProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SecureTableProvision', + 'secureTableProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvision", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvision', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class SecureTableProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "secureTableProvision": data.secureTableProvisions?.nodes?.[0] ?? null - }) + secureTableProvision: data.secureTableProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ secureTableProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SecureTableProvision", "secureTableProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SecureTableProvision', + 'secureTableProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvision", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvision', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class SecureTableProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "secureTableProvision": data.secureTableProvisions?.nodes?.[0] ?? null - }) + secureTableProvision: data.secureTableProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SecureTableProvision", "createSecureTableProvision", "secureTableProvision", args.select, args.data, "CreateSecureTableProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SecureTableProvision', + 'createSecureTableProvision', + 'secureTableProvision', + args.select, + args.data, + 'CreateSecureTableProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "createSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'createSecureTableProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SecureTableProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SecureTableProvision", "updateSecureTableProvision", "secureTableProvision", args.select, args.where.id, args.data, "UpdateSecureTableProvisionInput", "id", "secureTableProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SecureTableProvision', + 'updateSecureTableProvision', + 'secureTableProvision', + args.select, + args.where.id, + args.data, + 'UpdateSecureTableProvisionInput', + 'id', + 'secureTableProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "updateSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'updateSecureTableProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SecureTableProvision", "deleteSecureTableProvision", "secureTableProvision", { - id: args.where.id - }, "DeleteSecureTableProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SecureTableProvision', + 'deleteSecureTableProvision', + 'secureTableProvision', + { + id: args.where.id, + }, + 'DeleteSecureTableProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "deleteSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'deleteSecureTableProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/sessionSecretsModule.ts b/sdk/constructive-cli/src/modules/orm/models/sessionSecretsModule.ts index af5fbcd6f4..9460af6349 100644 --- a/sdk/constructive-cli/src/modules/orm/models/sessionSecretsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/sessionSecretsModule.ts @@ -3,56 +3,98 @@ * @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 { SessionSecretsModule, SessionSecretsModuleWithRelations, SessionSecretsModuleSelect, SessionSecretsModuleFilter, SessionSecretsModuleOrderBy, CreateSessionSecretsModuleInput, UpdateSessionSecretsModuleInput, SessionSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SessionSecretsModule, + SessionSecretsModuleWithRelations, + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy, + CreateSessionSecretsModuleInput, + UpdateSessionSecretsModuleInput, + SessionSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SessionSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - sessionSecretsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + sessionSecretsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("SessionSecretsModule", "sessionSecretsModules", 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 - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + 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, + }, + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModules", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SessionSecretsModule", "sessionSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModule", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class SessionSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionSecretsModule": data.sessionSecretsModules?.nodes?.[0] ?? null - }) + sessionSecretsModule: data.sessionSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SessionSecretsModule", "sessionSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModule", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class SessionSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionSecretsModule": data.sessionSecretsModules?.nodes?.[0] ?? null - }) + sessionSecretsModule: data.sessionSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SessionSecretsModule", "createSessionSecretsModule", "sessionSecretsModule", args.select, args.data, "CreateSessionSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SessionSecretsModule', + 'createSessionSecretsModule', + 'sessionSecretsModule', + args.select, + args.data, + 'CreateSessionSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "createSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'createSessionSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SessionSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SessionSecretsModule", "updateSessionSecretsModule", "sessionSecretsModule", args.select, args.where.id, args.data, "UpdateSessionSecretsModuleInput", "id", "sessionSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SessionSecretsModule', + 'updateSessionSecretsModule', + 'sessionSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateSessionSecretsModuleInput', + 'id', + 'sessionSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "updateSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'updateSessionSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SessionSecretsModule", "deleteSessionSecretsModule", "sessionSecretsModule", { - id: args.where.id - }, "DeleteSessionSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SessionSecretsModule', + 'deleteSessionSecretsModule', + 'sessionSecretsModule', + { + id: args.where.id, + }, + 'DeleteSessionSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "deleteSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'deleteSessionSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/sessionsModule.ts b/sdk/constructive-cli/src/modules/orm/models/sessionsModule.ts index 1b90af533a..324773df9f 100644 --- a/sdk/constructive-cli/src/modules/orm/models/sessionsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/sessionsModule.ts @@ -3,56 +3,96 @@ * @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 { SessionsModule, SessionsModuleWithRelations, SessionsModuleSelect, SessionsModuleFilter, SessionsModuleOrderBy, CreateSessionsModuleInput, UpdateSessionsModuleInput, SessionsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SessionsModule, + SessionsModuleWithRelations, + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy, + CreateSessionsModuleInput, + UpdateSessionsModuleInput, + SessionsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SessionsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SessionsModule", "sessionsModules", 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 - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SessionsModule', + 'sessionsModules', + 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, + }, + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModules", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SessionsModule", "sessionsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SessionsModule', + 'sessionsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModule", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SessionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionsModule": data.sessionsModules?.nodes?.[0] ?? null - }) + sessionsModule: data.sessionsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SessionsModule", "sessionsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SessionsModule', + 'sessionsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModule", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SessionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionsModule": data.sessionsModules?.nodes?.[0] ?? null - }) + sessionsModule: data.sessionsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SessionsModule", "createSessionsModule", "sessionsModule", args.select, args.data, "CreateSessionsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SessionsModule', + 'createSessionsModule', + 'sessionsModule', + args.select, + args.data, + 'CreateSessionsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "createSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'createSessionsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SessionsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SessionsModule", "updateSessionsModule", "sessionsModule", args.select, args.where.id, args.data, "UpdateSessionsModuleInput", "id", "sessionsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SessionsModule', + 'updateSessionsModule', + 'sessionsModule', + args.select, + args.where.id, + args.data, + 'UpdateSessionsModuleInput', + 'id', + 'sessionsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "updateSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'updateSessionsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SessionsModule", "deleteSessionsModule", "sessionsModule", { - id: args.where.id - }, "DeleteSessionsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SessionsModule', + 'deleteSessionsModule', + 'sessionsModule', + { + id: args.where.id, + }, + 'DeleteSessionsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "deleteSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'deleteSessionsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/siteSurfaceModule.ts b/sdk/constructive-cli/src/modules/orm/models/siteSurfaceModule.ts index 032b2d2cd5..891f21403a 100644 --- a/sdk/constructive-cli/src/modules/orm/models/siteSurfaceModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/siteSurfaceModule.ts @@ -3,56 +3,96 @@ * @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 { SiteSurfaceModule, SiteSurfaceModuleWithRelations, SiteSurfaceModuleSelect, SiteSurfaceModuleFilter, SiteSurfaceModuleOrderBy, CreateSiteSurfaceModuleInput, UpdateSiteSurfaceModuleInput, SiteSurfaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteSurfaceModule, + SiteSurfaceModuleWithRelations, + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy, + CreateSiteSurfaceModuleInput, + UpdateSiteSurfaceModuleInput, + SiteSurfaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteSurfaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteSurfaceModule", "siteSurfaceModules", 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 - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + 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, + }, + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModules", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteSurfaceModule", "siteSurfaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModule", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteSurfaceModule": data.siteSurfaceModules?.nodes?.[0] ?? null - }) + siteSurfaceModule: data.siteSurfaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteSurfaceModule", "siteSurfaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModule", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteSurfaceModule": data.siteSurfaceModules?.nodes?.[0] ?? null - }) + siteSurfaceModule: data.siteSurfaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteSurfaceModule", "createSiteSurfaceModule", "siteSurfaceModule", args.select, args.data, "CreateSiteSurfaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteSurfaceModule', + 'createSiteSurfaceModule', + 'siteSurfaceModule', + args.select, + args.data, + 'CreateSiteSurfaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "createSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'createSiteSurfaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteSurfaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteSurfaceModule", "updateSiteSurfaceModule", "siteSurfaceModule", args.select, args.where.id, args.data, "UpdateSiteSurfaceModuleInput", "id", "siteSurfaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteSurfaceModule', + 'updateSiteSurfaceModule', + 'siteSurfaceModule', + args.select, + args.where.id, + args.data, + 'UpdateSiteSurfaceModuleInput', + 'id', + 'siteSurfaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "updateSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'updateSiteSurfaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteSurfaceModule", "deleteSiteSurfaceModule", "siteSurfaceModule", { - id: args.where.id - }, "DeleteSiteSurfaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteSurfaceModule', + 'deleteSiteSurfaceModule', + 'siteSurfaceModule', + { + id: args.where.id, + }, + 'DeleteSiteSurfaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "deleteSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'deleteSiteSurfaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/storageLogModule.ts b/sdk/constructive-cli/src/modules/orm/models/storageLogModule.ts index e94ce03e99..a53edf15d1 100644 --- a/sdk/constructive-cli/src/modules/orm/models/storageLogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/storageLogModule.ts @@ -3,56 +3,96 @@ * @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 { StorageLogModule, StorageLogModuleWithRelations, StorageLogModuleSelect, StorageLogModuleFilter, StorageLogModuleOrderBy, CreateStorageLogModuleInput, UpdateStorageLogModuleInput, StorageLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + StorageLogModule, + StorageLogModuleWithRelations, + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy, + CreateStorageLogModuleInput, + UpdateStorageLogModuleInput, + StorageLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StorageLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("StorageLogModule", "storageLogModules", 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 - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'StorageLogModule', + 'storageLogModules', + 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, + }, + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModules", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("StorageLogModule", "storageLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'StorageLogModule', + 'storageLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModule", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StorageLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageLogModule": data.storageLogModules?.nodes?.[0] ?? null - }) + storageLogModule: data.storageLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("StorageLogModule", "storageLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'StorageLogModule', + 'storageLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModule", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StorageLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageLogModule": data.storageLogModules?.nodes?.[0] ?? null - }) + storageLogModule: data.storageLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("StorageLogModule", "createStorageLogModule", "storageLogModule", args.select, args.data, "CreateStorageLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'StorageLogModule', + 'createStorageLogModule', + 'storageLogModule', + args.select, + args.data, + 'CreateStorageLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "createStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'createStorageLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorageLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("StorageLogModule", "updateStorageLogModule", "storageLogModule", args.select, args.where.id, args.data, "UpdateStorageLogModuleInput", "id", "storageLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'StorageLogModule', + 'updateStorageLogModule', + 'storageLogModule', + args.select, + args.where.id, + args.data, + 'UpdateStorageLogModuleInput', + 'id', + 'storageLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "updateStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'updateStorageLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("StorageLogModule", "deleteStorageLogModule", "storageLogModule", { - id: args.where.id - }, "DeleteStorageLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'StorageLogModule', + 'deleteStorageLogModule', + 'storageLogModule', + { + id: args.where.id, + }, + 'DeleteStorageLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "deleteStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'deleteStorageLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/storageModule.ts b/sdk/constructive-cli/src/modules/orm/models/storageModule.ts index 05877e81a0..f69dd6e624 100644 --- a/sdk/constructive-cli/src/modules/orm/models/storageModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/storageModule.ts @@ -3,56 +3,96 @@ * @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 { StorageModule, StorageModuleWithRelations, StorageModuleSelect, StorageModuleFilter, StorageModuleOrderBy, CreateStorageModuleInput, UpdateStorageModuleInput, StorageModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + StorageModule, + StorageModuleWithRelations, + StorageModuleSelect, + StorageModuleFilter, + StorageModuleOrderBy, + CreateStorageModuleInput, + UpdateStorageModuleInput, + StorageModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StorageModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("StorageModule", "storageModules", 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 - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'StorageModule', + 'storageModules', + 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, + }, + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModules", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("StorageModule", "storageModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'StorageModule', + 'storageModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModule", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StorageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageModule": data.storageModules?.nodes?.[0] ?? null - }) + storageModule: data.storageModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("StorageModule", "storageModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'StorageModule', + 'storageModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModule", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StorageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageModule": data.storageModules?.nodes?.[0] ?? null - }) + storageModule: data.storageModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("StorageModule", "createStorageModule", "storageModule", args.select, args.data, "CreateStorageModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'StorageModule', + 'createStorageModule', + 'storageModule', + args.select, + args.data, + 'CreateStorageModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "createStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'createStorageModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorageModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("StorageModule", "updateStorageModule", "storageModule", args.select, args.where.id, args.data, "UpdateStorageModuleInput", "id", "storageModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'StorageModule', + 'updateStorageModule', + 'storageModule', + args.select, + args.where.id, + args.data, + 'UpdateStorageModuleInput', + 'id', + 'storageModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "updateStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'updateStorageModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("StorageModule", "deleteStorageModule", "storageModule", { - id: args.where.id - }, "DeleteStorageModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'StorageModule', + 'deleteStorageModule', + 'storageModule', + { + id: args.where.id, + }, + 'DeleteStorageModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "deleteStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'deleteStorageModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/transferLogModule.ts b/sdk/constructive-cli/src/modules/orm/models/transferLogModule.ts index 6c929a1b6b..cab2bec096 100644 --- a/sdk/constructive-cli/src/modules/orm/models/transferLogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/transferLogModule.ts @@ -3,56 +3,96 @@ * @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 { TransferLogModule, TransferLogModuleWithRelations, TransferLogModuleSelect, TransferLogModuleFilter, TransferLogModuleOrderBy, CreateTransferLogModuleInput, UpdateTransferLogModuleInput, TransferLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TransferLogModule, + TransferLogModuleWithRelations, + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy, + CreateTransferLogModuleInput, + UpdateTransferLogModuleInput, + TransferLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TransferLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TransferLogModule", "transferLogModules", 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 - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TransferLogModule', + 'transferLogModules', + 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, + }, + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModules", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TransferLogModule", "transferLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TransferLogModule', + 'transferLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModule", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TransferLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "transferLogModule": data.transferLogModules?.nodes?.[0] ?? null - }) + transferLogModule: data.transferLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TransferLogModule", "transferLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TransferLogModule', + 'transferLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModule", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TransferLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "transferLogModule": data.transferLogModules?.nodes?.[0] ?? null - }) + transferLogModule: data.transferLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TransferLogModule", "createTransferLogModule", "transferLogModule", args.select, args.data, "CreateTransferLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TransferLogModule', + 'createTransferLogModule', + 'transferLogModule', + args.select, + args.data, + 'CreateTransferLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "createTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'createTransferLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TransferLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TransferLogModule", "updateTransferLogModule", "transferLogModule", args.select, args.where.id, args.data, "UpdateTransferLogModuleInput", "id", "transferLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TransferLogModule', + 'updateTransferLogModule', + 'transferLogModule', + args.select, + args.where.id, + args.data, + 'UpdateTransferLogModuleInput', + 'id', + 'transferLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "updateTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'updateTransferLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TransferLogModule", "deleteTransferLogModule", "transferLogModule", { - id: args.where.id - }, "DeleteTransferLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TransferLogModule', + 'deleteTransferLogModule', + 'transferLogModule', + { + id: args.where.id, + }, + 'DeleteTransferLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "deleteTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'deleteTransferLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/userAuthModule.ts b/sdk/constructive-cli/src/modules/orm/models/userAuthModule.ts index edc18d6631..341885e14c 100644 --- a/sdk/constructive-cli/src/modules/orm/models/userAuthModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/userAuthModule.ts @@ -3,56 +3,96 @@ * @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 { UserAuthModule, UserAuthModuleWithRelations, UserAuthModuleSelect, UserAuthModuleFilter, UserAuthModuleOrderBy, CreateUserAuthModuleInput, UpdateUserAuthModuleInput, UserAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserAuthModule, + UserAuthModuleWithRelations, + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy, + CreateUserAuthModuleInput, + UpdateUserAuthModuleInput, + UserAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserAuthModule", "userAuthModules", 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 - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserAuthModule', + 'userAuthModules', + 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, + }, + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModules", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserAuthModule", "userAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserAuthModule', + 'userAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModule", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userAuthModule": data.userAuthModules?.nodes?.[0] ?? null - }) + userAuthModule: data.userAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserAuthModule", "userAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserAuthModule', + 'userAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModule", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userAuthModule": data.userAuthModules?.nodes?.[0] ?? null - }) + userAuthModule: data.userAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserAuthModule", "createUserAuthModule", "userAuthModule", args.select, args.data, "CreateUserAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserAuthModule', + 'createUserAuthModule', + 'userAuthModule', + args.select, + args.data, + 'CreateUserAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "createUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'createUserAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserAuthModule", "updateUserAuthModule", "userAuthModule", args.select, args.where.id, args.data, "UpdateUserAuthModuleInput", "id", "userAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserAuthModule', + 'updateUserAuthModule', + 'userAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateUserAuthModuleInput', + 'id', + 'userAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "updateUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'updateUserAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserAuthModule", "deleteUserAuthModule", "userAuthModule", { - id: args.where.id - }, "DeleteUserAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserAuthModule', + 'deleteUserAuthModule', + 'userAuthModule', + { + id: args.where.id, + }, + 'DeleteUserAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "deleteUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'deleteUserAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/userCredentialsModule.ts b/sdk/constructive-cli/src/modules/orm/models/userCredentialsModule.ts index 64bd269be4..9e9bc0b2aa 100644 --- a/sdk/constructive-cli/src/modules/orm/models/userCredentialsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/userCredentialsModule.ts @@ -3,56 +3,98 @@ * @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 { UserCredentialsModule, UserCredentialsModuleWithRelations, UserCredentialsModuleSelect, UserCredentialsModuleFilter, UserCredentialsModuleOrderBy, CreateUserCredentialsModuleInput, UpdateUserCredentialsModuleInput, UserCredentialsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserCredentialsModule, + UserCredentialsModuleWithRelations, + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy, + CreateUserCredentialsModuleInput, + UpdateUserCredentialsModuleInput, + UserCredentialsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserCredentialsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - userCredentialsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + userCredentialsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("UserCredentialsModule", "userCredentialsModules", 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 - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + 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, + }, + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModules", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserCredentialsModule", "userCredentialsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModule", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class UserCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userCredentialsModule": data.userCredentialsModules?.nodes?.[0] ?? null - }) + userCredentialsModule: data.userCredentialsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserCredentialsModule", "userCredentialsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModule", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class UserCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userCredentialsModule": data.userCredentialsModules?.nodes?.[0] ?? null - }) + userCredentialsModule: data.userCredentialsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserCredentialsModule", "createUserCredentialsModule", "userCredentialsModule", args.select, args.data, "CreateUserCredentialsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserCredentialsModule', + 'createUserCredentialsModule', + 'userCredentialsModule', + args.select, + args.data, + 'CreateUserCredentialsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "createUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'createUserCredentialsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserCredentialsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserCredentialsModule", "updateUserCredentialsModule", "userCredentialsModule", args.select, args.where.id, args.data, "UpdateUserCredentialsModuleInput", "id", "userCredentialsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserCredentialsModule', + 'updateUserCredentialsModule', + 'userCredentialsModule', + args.select, + args.where.id, + args.data, + 'UpdateUserCredentialsModuleInput', + 'id', + 'userCredentialsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "updateUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'updateUserCredentialsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserCredentialsModule", "deleteUserCredentialsModule", "userCredentialsModule", { - id: args.where.id - }, "DeleteUserCredentialsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserCredentialsModule', + 'deleteUserCredentialsModule', + 'userCredentialsModule', + { + id: args.where.id, + }, + 'DeleteUserCredentialsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "deleteUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'deleteUserCredentialsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/userSettingsModule.ts b/sdk/constructive-cli/src/modules/orm/models/userSettingsModule.ts index 4452bc7186..252d0cc8bf 100644 --- a/sdk/constructive-cli/src/modules/orm/models/userSettingsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/userSettingsModule.ts @@ -3,56 +3,96 @@ * @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 { UserSettingsModule, UserSettingsModuleWithRelations, UserSettingsModuleSelect, UserSettingsModuleFilter, UserSettingsModuleOrderBy, CreateUserSettingsModuleInput, UpdateUserSettingsModuleInput, UserSettingsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserSettingsModule, + UserSettingsModuleWithRelations, + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy, + CreateUserSettingsModuleInput, + UpdateUserSettingsModuleInput, + UserSettingsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserSettingsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserSettingsModule", "userSettingsModules", 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 - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserSettingsModule', + 'userSettingsModules', + 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, + }, + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModules", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserSettingsModule", "userSettingsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserSettingsModule', + 'userSettingsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModule", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userSettingsModule": data.userSettingsModules?.nodes?.[0] ?? null - }) + userSettingsModule: data.userSettingsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserSettingsModule", "userSettingsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserSettingsModule', + 'userSettingsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModule", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userSettingsModule": data.userSettingsModules?.nodes?.[0] ?? null - }) + userSettingsModule: data.userSettingsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserSettingsModule", "createUserSettingsModule", "userSettingsModule", args.select, args.data, "CreateUserSettingsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserSettingsModule', + 'createUserSettingsModule', + 'userSettingsModule', + args.select, + args.data, + 'CreateUserSettingsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "createUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'createUserSettingsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserSettingsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserSettingsModule", "updateUserSettingsModule", "userSettingsModule", args.select, args.where.id, args.data, "UpdateUserSettingsModuleInput", "id", "userSettingsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserSettingsModule', + 'updateUserSettingsModule', + 'userSettingsModule', + args.select, + args.where.id, + args.data, + 'UpdateUserSettingsModuleInput', + 'id', + 'userSettingsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "updateUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'updateUserSettingsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserSettingsModule", "deleteUserSettingsModule", "userSettingsModule", { - id: args.where.id - }, "DeleteUserSettingsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserSettingsModule', + 'deleteUserSettingsModule', + 'userSettingsModule', + { + id: args.where.id, + }, + 'DeleteUserSettingsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "deleteUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'deleteUserSettingsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/userStateModule.ts b/sdk/constructive-cli/src/modules/orm/models/userStateModule.ts index 14649c4d10..86999c74ae 100644 --- a/sdk/constructive-cli/src/modules/orm/models/userStateModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/userStateModule.ts @@ -3,56 +3,96 @@ * @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 { UserStateModule, UserStateModuleWithRelations, UserStateModuleSelect, UserStateModuleFilter, UserStateModuleOrderBy, CreateUserStateModuleInput, UpdateUserStateModuleInput, UserStateModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserStateModule, + UserStateModuleWithRelations, + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy, + CreateUserStateModuleInput, + UpdateUserStateModuleInput, + UserStateModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserStateModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserStateModule", "userStateModules", 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 - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserStateModule', + 'userStateModules', + 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, + }, + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModules", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserStateModule", "userStateModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserStateModule', + 'userStateModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModule", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserStateModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userStateModule": data.userStateModules?.nodes?.[0] ?? null - }) + userStateModule: data.userStateModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserStateModule", "userStateModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserStateModule', + 'userStateModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModule", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserStateModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userStateModule": data.userStateModules?.nodes?.[0] ?? null - }) + userStateModule: data.userStateModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserStateModule", "createUserStateModule", "userStateModule", args.select, args.data, "CreateUserStateModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserStateModule', + 'createUserStateModule', + 'userStateModule', + args.select, + args.data, + 'CreateUserStateModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "createUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'createUserStateModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserStateModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserStateModule", "updateUserStateModule", "userStateModule", args.select, args.where.id, args.data, "UpdateUserStateModuleInput", "id", "userStateModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserStateModule', + 'updateUserStateModule', + 'userStateModule', + args.select, + args.where.id, + args.data, + 'UpdateUserStateModuleInput', + 'id', + 'userStateModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "updateUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'updateUserStateModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserStateModule", "deleteUserStateModule", "userStateModule", { - id: args.where.id - }, "DeleteUserStateModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserStateModule', + 'deleteUserStateModule', + 'userStateModule', + { + id: args.where.id, + }, + 'DeleteUserStateModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "deleteUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'deleteUserStateModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/usersModule.ts b/sdk/constructive-cli/src/modules/orm/models/usersModule.ts index 487116399e..950038fcf0 100644 --- a/sdk/constructive-cli/src/modules/orm/models/usersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/usersModule.ts @@ -3,56 +3,96 @@ * @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 { UsersModule, UsersModuleWithRelations, UsersModuleSelect, UsersModuleFilter, UsersModuleOrderBy, CreateUsersModuleInput, UpdateUsersModuleInput, UsersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UsersModule, + UsersModuleWithRelations, + UsersModuleSelect, + UsersModuleFilter, + UsersModuleOrderBy, + CreateUsersModuleInput, + UpdateUsersModuleInput, + UsersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UsersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UsersModule", "usersModules", 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 - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UsersModule', + 'usersModules', + 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, + }, + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModules", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UsersModule", "usersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UsersModule', + 'usersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModule", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UsersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "usersModule": data.usersModules?.nodes?.[0] ?? null - }) + usersModule: data.usersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UsersModule", "usersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UsersModule', + 'usersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModule", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UsersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "usersModule": data.usersModules?.nodes?.[0] ?? null - }) + usersModule: data.usersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UsersModule", "createUsersModule", "usersModule", args.select, args.data, "CreateUsersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UsersModule', + 'createUsersModule', + 'usersModule', + args.select, + args.data, + 'CreateUsersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "createUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'createUsersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UsersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UsersModule", "updateUsersModule", "usersModule", args.select, args.where.id, args.data, "UpdateUsersModuleInput", "id", "usersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UsersModule', + 'updateUsersModule', + 'usersModule', + args.select, + args.where.id, + args.data, + 'UpdateUsersModuleInput', + 'id', + 'usersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "updateUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'updateUsersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UsersModule", "deleteUsersModule", "usersModule", { - id: args.where.id - }, "DeleteUsersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UsersModule', + 'deleteUsersModule', + 'usersModule', + { + id: args.where.id, + }, + 'DeleteUsersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "deleteUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'deleteUsersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/webauthnAuthModule.ts b/sdk/constructive-cli/src/modules/orm/models/webauthnAuthModule.ts index 8859f120d7..e8cdb4eb61 100644 --- a/sdk/constructive-cli/src/modules/orm/models/webauthnAuthModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/webauthnAuthModule.ts @@ -3,56 +3,96 @@ * @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 { WebauthnAuthModule, WebauthnAuthModuleWithRelations, WebauthnAuthModuleSelect, WebauthnAuthModuleFilter, WebauthnAuthModuleOrderBy, CreateWebauthnAuthModuleInput, UpdateWebauthnAuthModuleInput, WebauthnAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnAuthModule, + WebauthnAuthModuleWithRelations, + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy, + CreateWebauthnAuthModuleInput, + UpdateWebauthnAuthModuleInput, + WebauthnAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnAuthModule", "webauthnAuthModules", 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 - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + 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, + }, + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModules", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnAuthModule", "webauthnAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModule", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnAuthModule": data.webauthnAuthModules?.nodes?.[0] ?? null - }) + webauthnAuthModule: data.webauthnAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnAuthModule", "webauthnAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModule", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnAuthModule": data.webauthnAuthModules?.nodes?.[0] ?? null - }) + webauthnAuthModule: data.webauthnAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnAuthModule", "createWebauthnAuthModule", "webauthnAuthModule", args.select, args.data, "CreateWebauthnAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnAuthModule', + 'createWebauthnAuthModule', + 'webauthnAuthModule', + args.select, + args.data, + 'CreateWebauthnAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "createWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'createWebauthnAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnAuthModule", "updateWebauthnAuthModule", "webauthnAuthModule", args.select, args.where.id, args.data, "UpdateWebauthnAuthModuleInput", "id", "webauthnAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnAuthModule', + 'updateWebauthnAuthModule', + 'webauthnAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnAuthModuleInput', + 'id', + 'webauthnAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "updateWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'updateWebauthnAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnAuthModule", "deleteWebauthnAuthModule", "webauthnAuthModule", { - id: args.where.id - }, "DeleteWebauthnAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnAuthModule', + 'deleteWebauthnAuthModule', + 'webauthnAuthModule', + { + id: args.where.id, + }, + 'DeleteWebauthnAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "deleteWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'deleteWebauthnAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/webauthnCredentialsModule.ts b/sdk/constructive-cli/src/modules/orm/models/webauthnCredentialsModule.ts index 8c2a060a9e..fd73e47620 100644 --- a/sdk/constructive-cli/src/modules/orm/models/webauthnCredentialsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/webauthnCredentialsModule.ts @@ -3,56 +3,98 @@ * @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 { WebauthnCredentialsModule, WebauthnCredentialsModuleWithRelations, WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleFilter, WebauthnCredentialsModuleOrderBy, CreateWebauthnCredentialsModuleInput, UpdateWebauthnCredentialsModuleInput, WebauthnCredentialsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnCredentialsModule, + WebauthnCredentialsModuleWithRelations, + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy, + CreateWebauthnCredentialsModuleInput, + UpdateWebauthnCredentialsModuleInput, + WebauthnCredentialsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnCredentialsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - webauthnCredentialsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + webauthnCredentialsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", 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 - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + 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, + }, + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModules", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModule", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class WebauthnCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredentialsModule": data.webauthnCredentialsModules?.nodes?.[0] ?? null - }) + webauthnCredentialsModule: data.webauthnCredentialsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModule", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class WebauthnCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredentialsModule": data.webauthnCredentialsModules?.nodes?.[0] ?? null - }) + webauthnCredentialsModule: data.webauthnCredentialsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnCredentialsModule", "createWebauthnCredentialsModule", "webauthnCredentialsModule", args.select, args.data, "CreateWebauthnCredentialsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnCredentialsModule', + 'createWebauthnCredentialsModule', + 'webauthnCredentialsModule', + args.select, + args.data, + 'CreateWebauthnCredentialsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "createWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'createWebauthnCredentialsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnCredentialsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnCredentialsModule", "updateWebauthnCredentialsModule", "webauthnCredentialsModule", args.select, args.where.id, args.data, "UpdateWebauthnCredentialsModuleInput", "id", "webauthnCredentialsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnCredentialsModule', + 'updateWebauthnCredentialsModule', + 'webauthnCredentialsModule', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnCredentialsModuleInput', + 'id', + 'webauthnCredentialsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "updateWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'updateWebauthnCredentialsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnCredentialsModule", "deleteWebauthnCredentialsModule", "webauthnCredentialsModule", { - id: args.where.id - }, "DeleteWebauthnCredentialsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnCredentialsModule', + 'deleteWebauthnCredentialsModule', + 'webauthnCredentialsModule', + { + id: args.where.id, + }, + 'DeleteWebauthnCredentialsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "deleteWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'deleteWebauthnCredentialsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/models/webhookModule.ts b/sdk/constructive-cli/src/modules/orm/models/webhookModule.ts index 027621c87a..d792bcf865 100644 --- a/sdk/constructive-cli/src/modules/orm/models/webhookModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/webhookModule.ts @@ -3,56 +3,96 @@ * @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 { WebhookModule, WebhookModuleWithRelations, WebhookModuleSelect, WebhookModuleFilter, WebhookModuleOrderBy, CreateWebhookModuleInput, UpdateWebhookModuleInput, WebhookModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookModule, + WebhookModuleWithRelations, + WebhookModuleSelect, + WebhookModuleFilter, + WebhookModuleOrderBy, + CreateWebhookModuleInput, + UpdateWebhookModuleInput, + WebhookModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookModule", "webhookModules", 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 - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookModule', + 'webhookModules', + 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, + }, + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModules", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookModule", "webhookModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookModule', + 'webhookModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModule", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookModule": data.webhookModules?.nodes?.[0] ?? null - }) + webhookModule: data.webhookModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookModule", "webhookModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookModule', + 'webhookModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModule", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookModule": data.webhookModules?.nodes?.[0] ?? null - }) + webhookModule: data.webhookModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookModule", "createWebhookModule", "webhookModule", args.select, args.data, "CreateWebhookModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookModule', + 'createWebhookModule', + 'webhookModule', + args.select, + args.data, + 'CreateWebhookModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "createWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'createWebhookModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookModule", "updateWebhookModule", "webhookModule", args.select, args.where.id, args.data, "UpdateWebhookModuleInput", "id", "webhookModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookModule', + 'updateWebhookModule', + 'webhookModule', + args.select, + args.where.id, + args.data, + 'UpdateWebhookModuleInput', + 'id', + 'webhookModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "updateWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'updateWebhookModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookModule", "deleteWebhookModule", "webhookModule", { - id: args.where.id - }, "DeleteWebhookModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookModule', + 'deleteWebhookModule', + 'webhookModule', + { + id: args.where.id, + }, + 'DeleteWebhookModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "deleteWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'deleteWebhookModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/mutation/index.ts b/sdk/constructive-cli/src/modules/orm/mutation/index.ts index 9720edba22..60041efadb 100644 --- a/sdk/constructive-cli/src/modules/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/modules/orm/mutation/index.ts @@ -3,11 +3,42 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ConstructBlueprintInput, CopyTemplateToBlueprintInput, ProvisionBucketInput, ProvisionCheckConstraintInput, ProvisionFullTextSearchInput, ProvisionIndexInput, ProvisionRelationInput, ProvisionSpatialRelationInput, ProvisionTableInput, ProvisionUniqueConstraintInput, ConstructBlueprintPayload, CopyTemplateToBlueprintPayload, ProvisionBucketPayload, ProvisionCheckConstraintPayload, ProvisionFullTextSearchPayload, ProvisionIndexPayload, ProvisionRelationPayload, ProvisionSpatialRelationPayload, ProvisionTablePayload, ProvisionUniqueConstraintPayload, ConstructBlueprintPayloadSelect, CopyTemplateToBlueprintPayloadSelect, ProvisionBucketPayloadSelect, ProvisionCheckConstraintPayloadSelect, ProvisionFullTextSearchPayloadSelect, ProvisionIndexPayloadSelect, ProvisionRelationPayloadSelect, ProvisionSpatialRelationPayloadSelect, ProvisionTablePayloadSelect, ProvisionUniqueConstraintPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ConstructBlueprintInput, + CopyTemplateToBlueprintInput, + ProvisionBucketInput, + ProvisionCheckConstraintInput, + ProvisionFullTextSearchInput, + ProvisionIndexInput, + ProvisionRelationInput, + ProvisionSpatialRelationInput, + ProvisionTableInput, + ProvisionUniqueConstraintInput, + ConstructBlueprintPayload, + CopyTemplateToBlueprintPayload, + ProvisionBucketPayload, + ProvisionCheckConstraintPayload, + ProvisionFullTextSearchPayload, + ProvisionIndexPayload, + ProvisionRelationPayload, + ProvisionSpatialRelationPayload, + ProvisionTablePayload, + ProvisionUniqueConstraintPayload, + ConstructBlueprintPayloadSelect, + CopyTemplateToBlueprintPayloadSelect, + ProvisionBucketPayloadSelect, + ProvisionCheckConstraintPayloadSelect, + ProvisionFullTextSearchPayloadSelect, + ProvisionIndexPayloadSelect, + ProvisionRelationPayloadSelect, + ProvisionSpatialRelationPayloadSelect, + ProvisionTablePayloadSelect, + ProvisionUniqueConstraintPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for constructBlueprint * 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 — 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[] — 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. @@ -83,145 +114,295 @@ export interface ProvisionUniqueConstraintVariables { } export function createMutationOperations(client: OrmClient) { return { - constructBlueprint: (args: ConstructBlueprintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - constructBlueprint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ConstructBlueprint", - fieldName: "constructBlueprint", - ...buildCustomDocument("mutation", "ConstructBlueprint", "constructBlueprint", options.select, args, [{ - name: "input", - type: "ConstructBlueprintInput!" - }], connectionFieldsMap, "ConstructBlueprintPayload") - }), - copyTemplateToBlueprint: (args: CopyTemplateToBlueprintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - copyTemplateToBlueprint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CopyTemplateToBlueprint", - fieldName: "copyTemplateToBlueprint", - ...buildCustomDocument("mutation", "CopyTemplateToBlueprint", "copyTemplateToBlueprint", options.select, args, [{ - name: "input", - type: "CopyTemplateToBlueprintInput!" - }], connectionFieldsMap, "CopyTemplateToBlueprintPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - provisionCheckConstraint: (args: ProvisionCheckConstraintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionCheckConstraint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionCheckConstraint", - fieldName: "provisionCheckConstraint", - ...buildCustomDocument("mutation", "ProvisionCheckConstraint", "provisionCheckConstraint", options.select, args, [{ - name: "input", - type: "ProvisionCheckConstraintInput!" - }], connectionFieldsMap, "ProvisionCheckConstraintPayload") - }), - provisionFullTextSearch: (args: ProvisionFullTextSearchVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionFullTextSearch: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionFullTextSearch", - fieldName: "provisionFullTextSearch", - ...buildCustomDocument("mutation", "ProvisionFullTextSearch", "provisionFullTextSearch", options.select, args, [{ - name: "input", - type: "ProvisionFullTextSearchInput!" - }], connectionFieldsMap, "ProvisionFullTextSearchPayload") - }), - provisionIndex: (args: ProvisionIndexVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionIndex: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionIndex", - fieldName: "provisionIndex", - ...buildCustomDocument("mutation", "ProvisionIndex", "provisionIndex", options.select, args, [{ - name: "input", - type: "ProvisionIndexInput!" - }], connectionFieldsMap, "ProvisionIndexPayload") - }), - provisionRelation: (args: ProvisionRelationVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionRelation: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionRelation", - fieldName: "provisionRelation", - ...buildCustomDocument("mutation", "ProvisionRelation", "provisionRelation", options.select, args, [{ - name: "input", - type: "ProvisionRelationInput!" - }], connectionFieldsMap, "ProvisionRelationPayload") - }), - provisionSpatialRelation: (args: ProvisionSpatialRelationVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionSpatialRelation: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionSpatialRelation", - fieldName: "provisionSpatialRelation", - ...buildCustomDocument("mutation", "ProvisionSpatialRelation", "provisionSpatialRelation", options.select, args, [{ - name: "input", - type: "ProvisionSpatialRelationInput!" - }], connectionFieldsMap, "ProvisionSpatialRelationPayload") - }), - provisionTable: (args: ProvisionTableVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionTable: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionTable", - fieldName: "provisionTable", - ...buildCustomDocument("mutation", "ProvisionTable", "provisionTable", options.select, args, [{ - name: "input", - type: "ProvisionTableInput!" - }], connectionFieldsMap, "ProvisionTablePayload") - }), - provisionUniqueConstraint: (args: ProvisionUniqueConstraintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionUniqueConstraint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionUniqueConstraint", - fieldName: "provisionUniqueConstraint", - ...buildCustomDocument("mutation", "ProvisionUniqueConstraint", "provisionUniqueConstraint", options.select, args, [{ - name: "input", - type: "ProvisionUniqueConstraintInput!" - }], connectionFieldsMap, "ProvisionUniqueConstraintPayload") - }) + constructBlueprint: ( + args: ConstructBlueprintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + constructBlueprint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ConstructBlueprint', + fieldName: 'constructBlueprint', + ...buildCustomDocument( + 'mutation', + 'ConstructBlueprint', + 'constructBlueprint', + options.select, + args, + [ + { + name: 'input', + type: 'ConstructBlueprintInput!', + }, + ], + connectionFieldsMap, + 'ConstructBlueprintPayload' + ), + }), + copyTemplateToBlueprint: ( + args: CopyTemplateToBlueprintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyTemplateToBlueprint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyTemplateToBlueprint', + fieldName: 'copyTemplateToBlueprint', + ...buildCustomDocument( + 'mutation', + 'CopyTemplateToBlueprint', + 'copyTemplateToBlueprint', + options.select, + args, + [ + { + name: 'input', + type: 'CopyTemplateToBlueprintInput!', + }, + ], + connectionFieldsMap, + 'CopyTemplateToBlueprintPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + provisionCheckConstraint: ( + args: ProvisionCheckConstraintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionCheckConstraint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionCheckConstraint', + fieldName: 'provisionCheckConstraint', + ...buildCustomDocument( + 'mutation', + 'ProvisionCheckConstraint', + 'provisionCheckConstraint', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionCheckConstraintInput!', + }, + ], + connectionFieldsMap, + 'ProvisionCheckConstraintPayload' + ), + }), + provisionFullTextSearch: ( + args: ProvisionFullTextSearchVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionFullTextSearch: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionFullTextSearch', + fieldName: 'provisionFullTextSearch', + ...buildCustomDocument( + 'mutation', + 'ProvisionFullTextSearch', + 'provisionFullTextSearch', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionFullTextSearchInput!', + }, + ], + connectionFieldsMap, + 'ProvisionFullTextSearchPayload' + ), + }), + provisionIndex: ( + args: ProvisionIndexVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionIndex: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionIndex', + fieldName: 'provisionIndex', + ...buildCustomDocument( + 'mutation', + 'ProvisionIndex', + 'provisionIndex', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionIndexInput!', + }, + ], + connectionFieldsMap, + 'ProvisionIndexPayload' + ), + }), + provisionRelation: ( + args: ProvisionRelationVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionRelation: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionRelation', + fieldName: 'provisionRelation', + ...buildCustomDocument( + 'mutation', + 'ProvisionRelation', + 'provisionRelation', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionRelationInput!', + }, + ], + connectionFieldsMap, + 'ProvisionRelationPayload' + ), + }), + provisionSpatialRelation: ( + args: ProvisionSpatialRelationVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionSpatialRelation: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionSpatialRelation', + fieldName: 'provisionSpatialRelation', + ...buildCustomDocument( + 'mutation', + 'ProvisionSpatialRelation', + 'provisionSpatialRelation', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionSpatialRelationInput!', + }, + ], + connectionFieldsMap, + 'ProvisionSpatialRelationPayload' + ), + }), + provisionTable: ( + args: ProvisionTableVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionTable: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionTable', + fieldName: 'provisionTable', + ...buildCustomDocument( + 'mutation', + 'ProvisionTable', + 'provisionTable', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionTableInput!', + }, + ], + connectionFieldsMap, + 'ProvisionTablePayload' + ), + }), + provisionUniqueConstraint: ( + args: ProvisionUniqueConstraintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionUniqueConstraint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionUniqueConstraint', + fieldName: 'provisionUniqueConstraint', + ...buildCustomDocument( + 'mutation', + 'ProvisionUniqueConstraint', + 'provisionUniqueConstraint', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionUniqueConstraintInput!', + }, + ], + connectionFieldsMap, + 'ProvisionUniqueConstraintPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/query-builder.ts b/sdk/constructive-cli/src/modules/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/modules/orm/query-builder.ts +++ b/sdk/constructive-cli/src/modules/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/modules/orm/query/index.ts b/sdk/constructive-cli/src/modules/orm/query/index.ts index 6bb6ccfe36..70496d57ba 100644 --- a/sdk/constructive-cli/src/modules/orm/query/index.ts +++ b/sdk/constructive-cli/src/modules/orm/query/index.ts @@ -3,10 +3,10 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for resolveBlueprintField * 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. @@ -29,51 +29,87 @@ export interface ResolveBlueprintTableVariables { } export function createQueryOperations(client: OrmClient) { return { - resolveBlueprintField: (args: ResolveBlueprintFieldVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - resolveBlueprintField: string | null; - }>({ - client, - operation: "query", - operationName: "ResolveBlueprintField", - fieldName: "resolveBlueprintField", - ...buildCustomDocument("query", "ResolveBlueprintField", "resolveBlueprintField", options?.select, args, [{ - name: "databaseId", - type: "UUID" - }, { - name: "fieldName", - type: "String" - }, { - name: "tableId", - type: "UUID" - }], connectionFieldsMap, undefined) - }), - resolveBlueprintTable: (args: ResolveBlueprintTableVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - resolveBlueprintTable: string | null; - }>({ - client, - operation: "query", - operationName: "ResolveBlueprintTable", - fieldName: "resolveBlueprintTable", - ...buildCustomDocument("query", "ResolveBlueprintTable", "resolveBlueprintTable", options?.select, args, [{ - name: "databaseId", - type: "UUID" - }, { - name: "defaultSchemaId", - type: "UUID" - }, { - name: "schemaName", - type: "String" - }, { - name: "tableMap", - type: "JSON" - }, { - name: "tableName", - type: "String" - }], connectionFieldsMap, undefined) - }) + resolveBlueprintField: ( + args: ResolveBlueprintFieldVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + resolveBlueprintField: string | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveBlueprintField', + fieldName: 'resolveBlueprintField', + ...buildCustomDocument( + 'query', + 'ResolveBlueprintField', + 'resolveBlueprintField', + options?.select, + args, + [ + { + name: 'databaseId', + type: 'UUID', + }, + { + name: 'fieldName', + type: 'String', + }, + { + name: 'tableId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + resolveBlueprintTable: ( + args: ResolveBlueprintTableVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + resolveBlueprintTable: string | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveBlueprintTable', + fieldName: 'resolveBlueprintTable', + ...buildCustomDocument( + 'query', + 'ResolveBlueprintTable', + 'resolveBlueprintTable', + options?.select, + args, + [ + { + name: 'databaseId', + type: 'UUID', + }, + { + name: 'defaultSchemaId', + type: 'UUID', + }, + { + name: 'schemaName', + type: 'String', + }, + { + name: 'tableMap', + type: 'JSON', + }, + { + name: 'tableName', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/modules/orm/realtime.ts b/sdk/constructive-cli/src/modules/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/modules/orm/realtime.ts +++ b/sdk/constructive-cli/src/modules/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/modules/orm/select-types.ts b/sdk/constructive-cli/src/modules/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/modules/orm/select-types.ts +++ b/sdk/constructive-cli/src/modules/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/objects/cli/commands.ts b/sdk/constructive-cli/src/objects/cli/commands.ts index 691944cfa5..e04db329a7 100644 --- a/sdk/constructive-cli/src/objects/cli/commands.ts +++ b/sdk/constructive-cli/src/objects/cli/commands.ts @@ -3,49 +3,60 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import commitCmd from "./commands/commit"; -import getAllTreeNodesRecordCmd from "./commands/get-all-tree-nodes-record"; -import objectCmd from "./commands/object"; -import refCmd from "./commands/ref"; -import storeCmd from "./commands/store"; -import initEmptyRepoCmd from "./commands/init-empty-repo"; -import insertNodeAtPathCmd from "./commands/insert-node-at-path"; -import provisionBucketCmd from "./commands/provision-bucket"; -import setDataAtPathCmd from "./commands/set-data-at-path"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "commit": commitCmd, - "get-all-tree-nodes-record": getAllTreeNodesRecordCmd, - "object": objectCmd, - "ref": refCmd, - "store": storeCmd, - "init-empty-repo": initEmptyRepoCmd, - "insert-node-at-path": insertNodeAtPathCmd, - "provision-bucket": provisionBucketCmd, - "set-data-at-path": setDataAtPathCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import commitCmd from './commands/commit'; +import getAllTreeNodesRecordCmd from './commands/get-all-tree-nodes-record'; +import objectCmd from './commands/object'; +import refCmd from './commands/ref'; +import storeCmd from './commands/store'; +import initEmptyRepoCmd from './commands/init-empty-repo'; +import insertNodeAtPathCmd from './commands/insert-node-at-path'; +import provisionBucketCmd from './commands/provision-bucket'; +import setDataAtPathCmd from './commands/set-data-at-path'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + commit: commitCmd, + 'get-all-tree-nodes-record': getAllTreeNodesRecordCmd, + object: objectCmd, + ref: refCmd, + store: storeCmd, + 'init-empty-repo': initEmptyRepoCmd, + 'insert-node-at-path': insertNodeAtPathCmd, + 'provision-bucket': provisionBucketCmd, + 'set-data-at-path': setDataAtPathCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n commit commit CRUD operations\n get-all-tree-nodes-record getAllTreeNodesRecord CRUD operations\n object object CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n init-empty-repo initEmptyRepo\n insert-node-at-path insertNodeAtPath\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 set-data-at-path setDataAtPath\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n commit commit CRUD operations\n get-all-tree-nodes-record getAllTreeNodesRecord CRUD operations\n object object CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n init-empty-repo initEmptyRepo\n insert-node-at-path insertNodeAtPath\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 set-data-at-path setDataAtPath\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -57,4 +68,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/objects/cli/commands/auth.ts b/sdk/constructive-cli/src/objects/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/cli/commands/commit.ts b/sdk/constructive-cli/src/objects/cli/commands/commit.ts index 0c144825b7..a19b925ce1 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/commit.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/commit.ts @@ -3,57 +3,71 @@ * @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 { CreateCommitInput, CommitPatch, CommitSelect, CommitFilter, CommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateCommitInput, + CommitPatch, + CommitSelect, + CommitFilter, + CommitOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - authorId: "uuid", - committerId: "uuid", - databaseId: "uuid", - date: "string", - id: "uuid", - message: "string", - parentIds: "uuid", - storeId: "uuid", - treeId: "uuid" + authorId: 'uuid', + committerId: 'uuid', + databaseId: 'uuid', + date: 'string', + id: 'uuid', + message: 'string', + parentIds: 'uuid', + storeId: 'uuid', + treeId: 'uuid', }; -const usage = "\ncommit \n\nCommands:\n list List commit records\n find-first Find first matching commit record\n get Get a commit by ID\n create Create a new commit\n update Update an existing commit\n delete Delete a commit\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) => { +const usage = + '\ncommit \n\nCommands:\n list List commit records\n find-first Find first matching commit record\n get Get a commit by ID\n create Create a new commit\n update Update an existing commit\n delete Delete a commit\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq message: true, parentIds: true, storeId: true, - treeId: true + treeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: CommitSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: CommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.commit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter message: true, parentIds: true, storeId: true, - treeId: true + treeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: CommitSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: CommitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.commit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.commit.findOne({ - id: answers.id as string, - select: { - authorId: true, - committerId: true, - databaseId: true, - date: true, - id: true, - message: true, - parentIds: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.commit + .findOne({ + id: answers.id as string, + select: { + authorId: true, + committerId: true, + databaseId: true, + date: true, + id: true, + message: true, + parentIds: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +170,93 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateCommitInput["commit"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateCommitInput['commit']; const client = getClient(); - const result = await client.commit.create({ - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - databaseId: cleanedData.databaseId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - databaseId: true, - date: true, - id: true, - message: true, - parentIds: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.commit + .create({ + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + databaseId: cleanedData.databaseId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + databaseId: true, + date: true, + id: true, + message: true, + parentIds: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +265,102 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "authorId", - message: "authorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "committerId", - message: "committerId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "date", - message: "date", - required: false, - skipPrompt: true - }, { - type: "text", - name: "message", - message: "message", - required: false, - skipPrompt: true - }, { - type: "text", - name: "parentIds", - message: "parentIds", - required: false, - skipPrompt: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }, { - type: "text", - name: "treeId", - message: "treeId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CommitPatch; const client = getClient(); - const result = await client.commit.update({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - data: { - authorId: cleanedData.authorId, - committerId: cleanedData.committerId, - date: cleanedData.date, - message: cleanedData.message, - parentIds: cleanedData.parentIds, - storeId: cleanedData.storeId, - treeId: cleanedData.treeId - }, - select: { - authorId: true, - committerId: true, - databaseId: true, - date: true, - id: true, - message: true, - parentIds: true, - storeId: true, - treeId: true - } - }).execute(); + const result = await client.commit + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + date: cleanedData.date, + message: cleanedData.message, + parentIds: cleanedData.parentIds, + storeId: cleanedData.storeId, + treeId: cleanedData.treeId, + }, + select: { + authorId: true, + committerId: true, + databaseId: true, + date: true, + id: true, + message: true, + parentIds: true, + storeId: true, + treeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,34 +369,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.commit.delete({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.commit + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/cli/commands/context.ts b/sdk/constructive-cli/src/objects/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/context.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/cli/commands/get-all-tree-nodes-record.ts b/sdk/constructive-cli/src/objects/cli/commands/get-all-tree-nodes-record.ts index cc6e9135c9..31c495de36 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/get-all-tree-nodes-record.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/get-all-tree-nodes-record.ts @@ -3,44 +3,58 @@ * @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 { CreateGetAllTreeNodesRecordInput, GetAllTreeNodesRecordPatch, GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateGetAllTreeNodesRecordInput, + GetAllTreeNodesRecordPatch, + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - data: "json", - path: "string" + data: 'json', + path: 'string', }; -const usage = "\nget-all-tree-nodes-record \n\nCommands:\n list List getAllTreeNodesRecord records\n find-first Find first matching getAllTreeNodesRecord record\n create Create a new getAllTreeNodesRecord\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) => { +const usage = + '\nget-all-tree-nodes-record \n\nCommands:\n list List getAllTreeNodesRecord records\n find-first Find first matching getAllTreeNodesRecord record\n create Create a new getAllTreeNodesRecord\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); default: console.log(usage); @@ -51,16 +65,22 @@ async function handleList(argv: Partial>, _prompter: Inq try { const defaultSelect = { data: true, - path: true + path: true, }; - const findManyArgs = parseFindManyArgs & { - select: GetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + > & { + select: GetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.getAllTreeNodesRecord.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -71,16 +91,22 @@ async function handleFindFirst(argv: Partial>, _prompter try { const defaultSelect = { data: true, - path: true + path: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: GetAllTreeNodesRecordSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + > & { + select: GetAllTreeNodesRecordSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.getAllTreeNodesRecord.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -89,36 +115,44 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: true - }, { - type: "text", - name: "path", - message: "path", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateGetAllTreeNodesRecordInput["getAllTreeNodesRecord"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateGetAllTreeNodesRecordInput['getAllTreeNodesRecord']; const client = getClient(); - const result = await client.getAllTreeNodesRecord.create({ - data: { - data: cleanedData.data, - path: cleanedData.path - }, - select: { - data: true, - path: true - } - }).execute(); + const result = await client.getAllTreeNodesRecord + .create({ + data: { + data: cleanedData.data, + path: cleanedData.path, + }, + select: { + data: true, + path: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/cli/commands/init-empty-repo.ts b/sdk/constructive-cli/src/objects/cli/commands/init-empty-repo.ts index 86f98c3e31..85713a6542 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/init-empty-repo.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/init-empty-repo.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { InitEmptyRepoVariables } from "../../orm/mutation"; -import type { InitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InitEmptyRepoVariables } from '../../orm/mutation'; +import type { InitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("init-empty-repo - initEmptyRepo\n\nUsage: init-empty-repo [OPTIONS]\n"); + console.log('init-empty-repo - initEmptyRepo\n\nUsage: init-empty-repo [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.initEmptyRepo(parsedAnswers as unknown as InitEmptyRepoVariables, { - select: selectFields - } as unknown as { - select: InitEmptyRepoPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .initEmptyRepo( + parsedAnswers as unknown as InitEmptyRepoVariables, + { + select: selectFields, + } as unknown as { + select: InitEmptyRepoPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: initEmptyRepo"); + console.error('Failed: initEmptyRepo'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/objects/cli/commands/insert-node-at-path.ts b/sdk/constructive-cli/src/objects/cli/commands/insert-node-at-path.ts index 82b25fe228..ded4cd5bb8 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/insert-node-at-path.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/insert-node-at-path.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { InsertNodeAtPathVariables } from "../../orm/mutation"; -import type { InsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InsertNodeAtPathVariables } from '../../orm/mutation'; +import type { InsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("insert-node-at-path - insertNodeAtPath\n\nUsage: insert-node-at-path [OPTIONS]\n"); + console.log( + 'insert-node-at-path - insertNodeAtPath\n\nUsage: insert-node-at-path [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.insertNodeAtPath(parsedAnswers as unknown as InsertNodeAtPathVariables, { - select: selectFields - } as unknown as { - select: InsertNodeAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .insertNodeAtPath( + parsedAnswers as unknown as InsertNodeAtPathVariables, + { + select: selectFields, + } as unknown as { + select: InsertNodeAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: insertNodeAtPath"); + console.error('Failed: insertNodeAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/objects/cli/commands/object.ts b/sdk/constructive-cli/src/objects/cli/commands/object.ts index 6850b2e9d4..2ae4aa4da0 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/object.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/object.ts @@ -3,54 +3,68 @@ * @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 { CreateObjectInput, ObjectPatch, ObjectSelect, ObjectFilter, ObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateObjectInput, + ObjectPatch, + ObjectSelect, + ObjectFilter, + ObjectOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - data: "json", - databaseId: "uuid", - id: "uuid", - kids: "uuid", - ktree: "string" + createdAt: 'string', + data: 'json', + databaseId: 'uuid', + id: 'uuid', + kids: 'uuid', + ktree: 'string', }; -const usage = "\nobject \n\nCommands:\n list List object records\n find-first Find first matching object record\n get Get a object by ID\n create Create a new object\n update Update an existing object\n delete Delete a object\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) => { +const usage = + '\nobject \n\nCommands:\n list List object records\n find-first Find first matching object record\n get Get a object by ID\n create Create a new object\n update Update an existing object\n delete Delete a object\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, kids: true, - ktree: true + ktree: true, }; - const findManyArgs = parseFindManyArgs & { - select: ObjectSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: ObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.object.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, kids: true, - ktree: true + ktree: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: ObjectSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: ObjectSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.object.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.object.findOne({ - id: answers.id as string, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - kids: true, - ktree: true - } - }).execute(); + const result = await client.object + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + kids: true, + ktree: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,52 +158,59 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateObjectInput["object"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateObjectInput['object']; const client = getClient(); - const result = await client.object.create({ - data: { - data: cleanedData.data, - databaseId: cleanedData.databaseId, - kids: cleanedData.kids, - ktree: cleanedData.ktree - }, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - kids: true, - ktree: true - } - }).execute(); + const result = await client.object + .create({ + data: { + data: cleanedData.data, + databaseId: cleanedData.databaseId, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + }, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + kids: true, + ktree: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -190,60 +219,68 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "json", - name: "data", - message: "data", - required: false, - skipPrompt: true - }, { - type: "text", - name: "kids", - message: "kids", - required: false, - skipPrompt: true - }, { - type: "text", - name: "ktree", - message: "ktree", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as ObjectPatch; const client = getClient(); - const result = await client.object.update({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - data: { - data: cleanedData.data, - kids: cleanedData.kids, - ktree: cleanedData.ktree - }, - select: { - createdAt: true, - data: true, - databaseId: true, - id: true, - kids: true, - ktree: true - } - }).execute(); + const result = await client.object + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + data: cleanedData.data, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + }, + select: { + createdAt: true, + data: true, + databaseId: true, + id: true, + kids: true, + ktree: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -252,34 +289,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.object.delete({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.object + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/objects/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/objects/cli/commands/ref.ts b/sdk/constructive-cli/src/objects/cli/commands/ref.ts index 39b0a16b2a..36ef82f16a 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/ref.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/ref.ts @@ -3,53 +3,67 @@ * @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 { CreateRefInput, RefPatch, RefSelect, RefFilter, RefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateRefInput, + RefPatch, + RefSelect, + RefFilter, + RefOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - commitId: "uuid", - databaseId: "uuid", - id: "uuid", - name: "string", - storeId: "uuid" + commitId: 'uuid', + databaseId: 'uuid', + id: 'uuid', + name: 'string', + storeId: 'uuid', }; -const usage = "\nref \n\nCommands:\n list List ref records\n find-first Find first matching ref record\n get Get a ref by ID\n create Create a new ref\n update Update an existing ref\n delete Delete a ref\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) => { +const usage = + '\nref \n\nCommands:\n list List ref records\n find-first Find first matching ref record\n get Get a ref by ID\n create Create a new ref\n update Update an existing ref\n delete Delete a ref\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, id: true, name: true, - storeId: true + storeId: true, }; - const findManyArgs = parseFindManyArgs & { - select: RefSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: RefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.ref.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, id: true, name: true, - storeId: true + storeId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: RefSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: RefSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.ref.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.ref.findOne({ - id: answers.id as string, - select: { - commitId: true, - databaseId: true, - id: true, - name: true, - storeId: true - } - }).execute(); + const result = await client.ref + .findOne({ + id: answers.id as string, + select: { + commitId: true, + databaseId: true, + id: true, + name: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,49 +154,56 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "storeId", - message: "storeId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateRefInput["ref"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateRefInput['ref']; const client = getClient(); - const result = await client.ref.create({ - data: { - commitId: cleanedData.commitId, - databaseId: cleanedData.databaseId, - name: cleanedData.name, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - databaseId: true, - id: true, - name: true, - storeId: true - } - }).execute(); + const result = await client.ref + .create({ + data: { + commitId: cleanedData.commitId, + databaseId: cleanedData.databaseId, + name: cleanedData.name, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + databaseId: true, + id: true, + name: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -183,57 +212,65 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "commitId", - message: "commitId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "storeId", - message: "storeId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as RefPatch; const client = getClient(); - const result = await client.ref.update({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - data: { - commitId: cleanedData.commitId, - name: cleanedData.name, - storeId: cleanedData.storeId - }, - select: { - commitId: true, - databaseId: true, - id: true, - name: true, - storeId: true - } - }).execute(); + const result = await client.ref + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + commitId: cleanedData.commitId, + name: cleanedData.name, + storeId: cleanedData.storeId, + }, + select: { + commitId: true, + databaseId: true, + id: true, + name: true, + storeId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,34 +279,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.ref.delete({ - where: { - id: answers.id as string, - databaseId: answers.databaseId as string - }, - select: { - id: true - } - }).execute(); + const result = await client.ref + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/cli/commands/set-data-at-path.ts b/sdk/constructive-cli/src/objects/cli/commands/set-data-at-path.ts index a96ece186a..a815197cd6 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/set-data-at-path.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/set-data-at-path.ts @@ -3,37 +3,49 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { SetDataAtPathVariables } from "../../orm/mutation"; -import type { SetDataAtPathPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SetDataAtPathVariables } from '../../orm/mutation'; +import type { SetDataAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("set-data-at-path - setDataAtPath\n\nUsage: set-data-at-path [OPTIONS]\n"); + console.log('set-data-at-path - setDataAtPath\n\nUsage: set-data-at-path [OPTIONS]\n'); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.setDataAtPath(parsedAnswers as unknown as SetDataAtPathVariables, { - select: selectFields - } as unknown as { - select: SetDataAtPathPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .setDataAtPath( + parsedAnswers as unknown as SetDataAtPathVariables, + { + select: selectFields, + } as unknown as { + select: SetDataAtPathPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: setDataAtPath"); + console.error('Failed: setDataAtPath'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/objects/cli/commands/store.ts b/sdk/constructive-cli/src/objects/cli/commands/store.ts index 76364ea429..21ebac4a93 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/store.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/store.ts @@ -3,53 +3,67 @@ * @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 { CreateStoreInput, StorePatch, StoreSelect, StoreFilter, StoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateStoreInput, + StorePatch, + StoreSelect, + StoreFilter, + StoreOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - createdAt: "string", - databaseId: "uuid", - hash: "uuid", - id: "uuid", - name: "string" + createdAt: 'string', + databaseId: 'uuid', + hash: 'uuid', + id: 'uuid', + name: 'string', }; -const usage = "\nstore \n\nCommands:\n list List store records\n find-first Find first matching store record\n get Get a store by ID\n create Create a new store\n update Update an existing store\n delete Delete a store\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) => { +const usage = + '\nstore \n\nCommands:\n list List store records\n find-first Find first matching store record\n get Get a store by ID\n create Create a new store\n update Update an existing store\n delete Delete a store\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq databaseId: true, hash: true, id: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: StoreSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: StoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.store.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter databaseId: true, hash: true, id: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: StoreSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: StoreSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.store.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.store.findOne({ - id: answers.id as string, - select: { - createdAt: true, - databaseId: true, - hash: true, - id: true, - name: true - } - }).execute(); + const result = await client.store + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + databaseId: true, + hash: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,43 +154,49 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "databaseId", - message: "databaseId", - required: true - }, { - type: "text", - name: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateStoreInput["store"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateStoreInput['store']; const client = getClient(); - const result = await client.store.create({ - data: { - databaseId: cleanedData.databaseId, - hash: cleanedData.hash, - name: cleanedData.name - }, - select: { - createdAt: true, - databaseId: true, - hash: true, - id: true, - name: true - } - }).execute(); + const result = await client.store + .create({ + data: { + databaseId: cleanedData.databaseId, + hash: cleanedData.hash, + name: cleanedData.name, + }, + select: { + createdAt: true, + databaseId: true, + hash: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -177,51 +205,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "hash", - message: "hash", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + 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: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as StorePatch; const client = getClient(); - const result = await client.store.update({ - where: { - id: answers.id as string - }, - data: { - databaseId: cleanedData.databaseId, - hash: cleanedData.hash, - name: cleanedData.name - }, - select: { - createdAt: true, - databaseId: true, - hash: true, - id: true, - name: true - } - }).execute(); + const result = await client.store + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + hash: cleanedData.hash, + name: cleanedData.name, + }, + select: { + createdAt: true, + databaseId: true, + hash: true, + id: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -230,28 +265,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.store.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.store + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/cli/executor.ts b/sdk/constructive-cli/src/objects/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/objects/cli/executor.ts +++ b/sdk/constructive-cli/src/objects/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/cli/index.ts b/sdk/constructive-cli/src/objects/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/objects/cli/index.ts +++ b/sdk/constructive-cli/src/objects/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/objects/cli/utils.ts b/sdk/constructive-cli/src/objects/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/objects/cli/utils.ts +++ b/sdk/constructive-cli/src/objects/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/objects/index.ts b/sdk/constructive-cli/src/objects/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/objects/index.ts +++ b/sdk/constructive-cli/src/objects/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/objects/orm/client.ts b/sdk/constructive-cli/src/objects/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/objects/orm/client.ts +++ b/sdk/constructive-cli/src/objects/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/objects/orm/index.ts b/sdk/constructive-cli/src/objects/orm/index.ts index a38f67c89e..9d2f3fb51c 100644 --- a/sdk/constructive-cli/src/objects/orm/index.ts +++ b/sdk/constructive-cli/src/objects/orm/index.ts @@ -3,20 +3,20 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { CommitModel } from "./models/commit"; -import { GetAllTreeNodesRecordModel } from "./models/getAllTreeNodesRecord"; -import { ObjectModel } from "./models/object"; -import { RefModel } from "./models/ref"; -import { StoreModel } from "./models/store"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { CommitModel } from './models/commit'; +import { GetAllTreeNodesRecordModel } from './models/getAllTreeNodesRecord'; +import { ObjectModel } from './models/object'; +import { RefModel } from './models/ref'; +import { StoreModel } from './models/store'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -48,6 +48,6 @@ export function createClient(config: OrmClientConfig) { object: new ObjectModel(client), ref: new RefModel(client), store: new StoreModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/orm/input-types.ts b/sdk/constructive-cli/src/objects/orm/input-types.ts index eca4c2f021..bab07456e0 100644 --- a/sdk/constructive-cli/src/objects/orm/input-types.ts +++ b/sdk/constructive-cli/src/objects/orm/input-types.ts @@ -317,7 +317,8 @@ export interface RefRelations {} export interface StoreRelations {} // ============ Entity Types With Relations ============ export type CommitWithRelations = Commit & CommitRelations; -export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & GetAllTreeNodesRecordRelations; +export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & + GetAllTreeNodesRecordRelations; export type ObjectWithRelations = Object & ObjectRelations; export type RefWithRelations = Ref & RefRelations; export type StoreWithRelations = Store & StoreRelations; @@ -450,11 +451,80 @@ export interface StoreFilter { or?: StoreFilter[]; } // ============ OrderBy Types ============ -export type CommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type GetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type ObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type RefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type StoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type CommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type GetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type ObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type RefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type StoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; // ============ CRUD Input Types ============ export interface CreateCommitInput { clientMutationId?: string; @@ -945,4 +1015,4 @@ export type StoreEdgeSelect = { node?: { select: StoreSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/objects/orm/models/commit.ts b/sdk/constructive-cli/src/objects/orm/models/commit.ts index 271de62194..9f20aeeefc 100644 --- a/sdk/constructive-cli/src/objects/orm/models/commit.ts +++ b/sdk/constructive-cli/src/objects/orm/models/commit.ts @@ -3,56 +3,96 @@ * @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 { Commit, CommitWithRelations, CommitSelect, CommitFilter, CommitOrderBy, CreateCommitInput, UpdateCommitInput, CommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Commit, + CommitWithRelations, + CommitSelect, + CommitFilter, + CommitOrderBy, + CreateCommitInput, + UpdateCommitInput, + CommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ commits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Commit", "commits", 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 - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Commit', + 'commits', + 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, + }, + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commits", + operation: 'query', + operationName: 'Commit', + fieldName: 'commits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ commit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Commit", "commits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Commit', + 'commits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commit", + operation: 'query', + operationName: 'Commit', + fieldName: 'commit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "commit": data.commits?.nodes?.[0] ?? null - }) + commit: data.commits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ commit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Commit", "commits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Commit', + 'commits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commit", + operation: 'query', + operationName: 'Commit', + fieldName: 'commit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class CommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "commit": data.commits?.nodes?.[0] ?? null - }) + commit: data.commits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Commit", "createCommit", "commit", args.select, args.data, "CreateCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Commit', + 'createCommit', + 'commit', + args.select, + args.data, + 'CreateCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "createCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'createCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + CommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Commit", "updateCommit", "commit", args.select, args.where.id, args.data, "UpdateCommitInput", "id", "commitPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Commit', + 'updateCommit', + 'commit', + args.select, + args.where.id, + args.data, + 'UpdateCommitInput', + 'id', + 'commitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "updateCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'updateCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Commit", "deleteCommit", "commit", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Commit', + 'deleteCommit', + 'commit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "deleteCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'deleteCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/orm/models/getAllTreeNodesRecord.ts b/sdk/constructive-cli/src/objects/orm/models/getAllTreeNodesRecord.ts index bb9b696c09..00f51d01f7 100644 --- a/sdk/constructive-cli/src/objects/orm/models/getAllTreeNodesRecord.ts +++ b/sdk/constructive-cli/src/objects/orm/models/getAllTreeNodesRecord.ts @@ -3,56 +3,96 @@ * @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 { GetAllTreeNodesRecord, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy, CreateGetAllTreeNodesRecordInput, UpdateGetAllTreeNodesRecordInput, GetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GetAllTreeNodesRecord, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, + CreateGetAllTreeNodesRecordInput, + UpdateGetAllTreeNodesRecordInput, + GetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GetAllTreeNodesRecord", "getAllTreeNodes", 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 - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + 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, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodes", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodesRecord: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GetAllTreeNodesRecord", "getAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodesRecord", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class GetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "getAllTreeNodesRecord": data.getAllTreeNodes?.nodes?.[0] ?? null - }) + getAllTreeNodesRecord: data.getAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGetAllTreeNodesRecord: { getAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GetAllTreeNodesRecord", "createGetAllTreeNodesRecord", "getAllTreeNodesRecord", args.select, args.data, "CreateGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GetAllTreeNodesRecord', + 'createGetAllTreeNodesRecord', + 'getAllTreeNodesRecord', + args.select, + args.data, + 'CreateGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GetAllTreeNodesRecord", - fieldName: "createGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'createGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/orm/models/index.ts b/sdk/constructive-cli/src/objects/orm/models/index.ts index bc21284ac0..4480ea666b 100644 --- a/sdk/constructive-cli/src/objects/orm/models/index.ts +++ b/sdk/constructive-cli/src/objects/orm/models/index.ts @@ -3,8 +3,8 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { CommitModel } from "./commit"; -export { GetAllTreeNodesRecordModel } from "./getAllTreeNodesRecord"; -export { ObjectModel } from "./object"; -export { RefModel } from "./ref"; -export { StoreModel } from "./store"; \ No newline at end of file +export { CommitModel } from './commit'; +export { GetAllTreeNodesRecordModel } from './getAllTreeNodesRecord'; +export { ObjectModel } from './object'; +export { RefModel } from './ref'; +export { StoreModel } from './store'; diff --git a/sdk/constructive-cli/src/objects/orm/models/object.ts b/sdk/constructive-cli/src/objects/orm/models/object.ts index b7d1d22830..9470d460f6 100644 --- a/sdk/constructive-cli/src/objects/orm/models/object.ts +++ b/sdk/constructive-cli/src/objects/orm/models/object.ts @@ -3,56 +3,96 @@ * @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 { Object, ObjectWithRelations, ObjectSelect, ObjectFilter, ObjectOrderBy, CreateObjectInput, UpdateObjectInput, ObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Object, + ObjectWithRelations, + ObjectSelect, + ObjectFilter, + ObjectOrderBy, + CreateObjectInput, + UpdateObjectInput, + ObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ objects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Object", "objects", 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 - }, "ObjectFilter", "ObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Object', + 'objects', + 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, + }, + 'ObjectFilter', + 'ObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "objects", + operation: 'query', + operationName: 'Object', + fieldName: 'objects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ object: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Object", "objects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ObjectFilter", "ObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Object', + 'objects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ObjectFilter', + 'ObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "object", + operation: 'query', + operationName: 'Object', + fieldName: 'object', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class ObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "object": data.objects?.nodes?.[0] ?? null - }) + object: data.objects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ object: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("Object", "getNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'Object', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "object", + operation: 'query', + operationName: 'Object', + fieldName: 'object', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Object", "createObject", "object", args.select, args.data, "CreateObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Object', + 'createObject', + 'object', + args.select, + args.data, + 'CreateObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "createObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'createObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + ObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Object", "updateObject", "object", args.select, args.where.id, args.data, "UpdateObjectInput", "id", "objectPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Object', + 'updateObject', + 'object', + args.select, + args.where.id, + args.data, + 'UpdateObjectInput', + 'id', + 'objectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "updateObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'updateObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Object", "deleteObject", "object", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Object', + 'deleteObject', + 'object', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "deleteObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'deleteObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/orm/models/ref.ts b/sdk/constructive-cli/src/objects/orm/models/ref.ts index 7d19ae58d2..d29b2308a0 100644 --- a/sdk/constructive-cli/src/objects/orm/models/ref.ts +++ b/sdk/constructive-cli/src/objects/orm/models/ref.ts @@ -3,56 +3,96 @@ * @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 { Ref, RefWithRelations, RefSelect, RefFilter, RefOrderBy, CreateRefInput, UpdateRefInput, RefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Ref, + RefWithRelations, + RefSelect, + RefFilter, + RefOrderBy, + CreateRefInput, + UpdateRefInput, + RefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ refs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Ref", "refs", 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 - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Ref', + 'refs', + 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, + }, + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "refs", + operation: 'query', + operationName: 'Ref', + fieldName: 'refs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ ref: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Ref", "refs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Ref', + 'refs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "ref", + operation: 'query', + operationName: 'Ref', + fieldName: 'ref', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RefModel { nodes?: InferSelectResult[]; }; }) => ({ - "ref": data.refs?.nodes?.[0] ?? null - }) + ref: data.refs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ ref: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Ref", "refs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Ref', + 'refs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "ref", + operation: 'query', + operationName: 'Ref', + fieldName: 'ref', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class RefModel { nodes?: InferSelectResult[]; }; }) => ({ - "ref": data.refs?.nodes?.[0] ?? null - }) + ref: data.refs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Ref", "createRef", "ref", args.select, args.data, "CreateRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Ref', + 'createRef', + 'ref', + args.select, + args.data, + 'CreateRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "createRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'createRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + RefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Ref", "updateRef", "ref", args.select, args.where.id, args.data, "UpdateRefInput", "id", "refPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Ref', + 'updateRef', + 'ref', + args.select, + args.where.id, + args.data, + 'UpdateRefInput', + 'id', + 'refPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "updateRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'updateRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Ref", "deleteRef", "ref", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Ref', + 'deleteRef', + 'ref', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "deleteRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'deleteRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/orm/models/store.ts b/sdk/constructive-cli/src/objects/orm/models/store.ts index ed5d14a22e..3e81e5f9ca 100644 --- a/sdk/constructive-cli/src/objects/orm/models/store.ts +++ b/sdk/constructive-cli/src/objects/orm/models/store.ts @@ -3,56 +3,96 @@ * @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 { Store, StoreWithRelations, StoreSelect, StoreFilter, StoreOrderBy, CreateStoreInput, UpdateStoreInput, StorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Store, + StoreWithRelations, + StoreSelect, + StoreFilter, + StoreOrderBy, + CreateStoreInput, + UpdateStoreInput, + StorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ stores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Store", "stores", 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 - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Store', + 'stores', + 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, + }, + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "stores", + operation: 'query', + operationName: 'Store', + fieldName: 'stores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ store: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Store", "stores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Store', + 'stores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "store", + operation: 'query', + operationName: 'Store', + fieldName: 'store', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "store": data.stores?.nodes?.[0] ?? null - }) + store: data.stores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ store: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Store", "stores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Store', + 'stores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "store", + operation: 'query', + operationName: 'Store', + fieldName: 'store', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "store": data.stores?.nodes?.[0] ?? null - }) + store: data.stores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Store", "createStore", "store", args.select, args.data, "CreateStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Store', + 'createStore', + 'store', + args.select, + args.data, + 'CreateStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "createStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'createStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Store", "updateStore", "store", args.select, args.where.id, args.data, "UpdateStoreInput", "id", "storePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Store', + 'updateStore', + 'store', + args.select, + args.where.id, + args.data, + 'UpdateStoreInput', + 'id', + 'storePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "updateStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'updateStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Store", "deleteStore", "store", { - id: args.where.id - }, "DeleteStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Store', + 'deleteStore', + 'store', + { + id: args.where.id, + }, + 'DeleteStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "deleteStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'deleteStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/orm/mutation/index.ts b/sdk/constructive-cli/src/objects/orm/mutation/index.ts index 13f2ac7c1e..a0c21cb2bd 100644 --- a/sdk/constructive-cli/src/objects/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/objects/orm/mutation/index.ts @@ -3,11 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { InitEmptyRepoInput, InsertNodeAtPathInput, ProvisionBucketInput, SetDataAtPathInput, InitEmptyRepoPayload, InsertNodeAtPathPayload, ProvisionBucketPayload, SetDataAtPathPayload, InitEmptyRepoPayloadSelect, InsertNodeAtPathPayloadSelect, ProvisionBucketPayloadSelect, SetDataAtPathPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + InitEmptyRepoInput, + InsertNodeAtPathInput, + ProvisionBucketInput, + SetDataAtPathInput, + InitEmptyRepoPayload, + InsertNodeAtPathPayload, + ProvisionBucketPayload, + SetDataAtPathPayload, + InitEmptyRepoPayloadSelect, + InsertNodeAtPathPayloadSelect, + ProvisionBucketPayloadSelect, + SetDataAtPathPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface InitEmptyRepoVariables { input: InitEmptyRepoInput; } @@ -29,61 +42,121 @@ export interface SetDataAtPathVariables { } export function createMutationOperations(client: OrmClient) { return { - initEmptyRepo: (args: InitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - initEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InitEmptyRepo", - fieldName: "initEmptyRepo", - ...buildCustomDocument("mutation", "InitEmptyRepo", "initEmptyRepo", options.select, args, [{ - name: "input", - type: "InitEmptyRepoInput!" - }], connectionFieldsMap, "InitEmptyRepoPayload") - }), - insertNodeAtPath: (args: InsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - insertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InsertNodeAtPath", - fieldName: "insertNodeAtPath", - ...buildCustomDocument("mutation", "InsertNodeAtPath", "insertNodeAtPath", options.select, args, [{ - name: "input", - type: "InsertNodeAtPathInput!" - }], connectionFieldsMap, "InsertNodeAtPathPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - setDataAtPath: (args: SetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetDataAtPath", - fieldName: "setDataAtPath", - ...buildCustomDocument("mutation", "SetDataAtPath", "setDataAtPath", options.select, args, [{ - name: "input", - type: "SetDataAtPathInput!" - }], connectionFieldsMap, "SetDataAtPathPayload") - }) + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/objects/orm/query-builder.ts b/sdk/constructive-cli/src/objects/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/objects/orm/query-builder.ts +++ b/sdk/constructive-cli/src/objects/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/objects/orm/realtime.ts b/sdk/constructive-cli/src/objects/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/objects/orm/realtime.ts +++ b/sdk/constructive-cli/src/objects/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/objects/orm/select-types.ts b/sdk/constructive-cli/src/objects/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/objects/orm/select-types.ts +++ b/sdk/constructive-cli/src/objects/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-cli/src/usage/cli/commands.ts b/sdk/constructive-cli/src/usage/cli/commands.ts index 9761145580..42ca3d0cfd 100644 --- a/sdk/constructive-cli/src/usage/cli/commands.ts +++ b/sdk/constructive-cli/src/usage/cli/commands.ts @@ -3,77 +3,88 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import contextCmd from "./commands/context"; -import authCmd from "./commands/auth"; -import appLimitCapCmd from "./commands/app-limit-cap"; -import appLimitCapsDefaultCmd from "./commands/app-limit-caps-default"; -import appLimitCmd from "./commands/app-limit"; -import appLimitCreditCodeCmd from "./commands/app-limit-credit-code"; -import appLimitCreditCodeItemCmd from "./commands/app-limit-credit-code-item"; -import appLimitCreditCmd from "./commands/app-limit-credit"; -import appLimitCreditRedemptionCmd from "./commands/app-limit-credit-redemption"; -import appLimitDefaultCmd from "./commands/app-limit-default"; -import appLimitEventCmd from "./commands/app-limit-event"; -import appLimitWarningCmd from "./commands/app-limit-warning"; -import orgLimitAggregateCmd from "./commands/org-limit-aggregate"; -import orgLimitCapCmd from "./commands/org-limit-cap"; -import orgLimitCapsDefaultCmd from "./commands/org-limit-caps-default"; -import orgLimitCmd from "./commands/org-limit"; -import orgLimitCreditCmd from "./commands/org-limit-credit"; -import orgLimitDefaultCmd from "./commands/org-limit-default"; -import orgLimitEventCmd from "./commands/org-limit-event"; -import orgLimitWarningCmd from "./commands/org-limit-warning"; -import provisionBucketCmd from "./commands/provision-bucket"; -import seedAppLimitCapsDefaultsCmd from "./commands/seed-app-limit-caps-defaults"; -import seedAppLimitDefaultsCmd from "./commands/seed-app-limit-defaults"; -import seedOrgLimitCapsDefaultsCmd from "./commands/seed-org-limit-caps-defaults"; -import seedOrgLimitDefaultsCmd from "./commands/seed-org-limit-defaults"; -const createCommandMap: (() => Record>, prompter: Inquirerer, options: CLIOptions) => Promise>) = () => ({ - "context": contextCmd, - "auth": authCmd, - "app-limit-cap": appLimitCapCmd, - "app-limit-caps-default": appLimitCapsDefaultCmd, - "app-limit": appLimitCmd, - "app-limit-credit-code": appLimitCreditCodeCmd, - "app-limit-credit-code-item": appLimitCreditCodeItemCmd, - "app-limit-credit": appLimitCreditCmd, - "app-limit-credit-redemption": appLimitCreditRedemptionCmd, - "app-limit-default": appLimitDefaultCmd, - "app-limit-event": appLimitEventCmd, - "app-limit-warning": appLimitWarningCmd, - "org-limit-aggregate": orgLimitAggregateCmd, - "org-limit-cap": orgLimitCapCmd, - "org-limit-caps-default": orgLimitCapsDefaultCmd, - "org-limit": orgLimitCmd, - "org-limit-credit": orgLimitCreditCmd, - "org-limit-default": orgLimitDefaultCmd, - "org-limit-event": orgLimitEventCmd, - "org-limit-warning": orgLimitWarningCmd, - "provision-bucket": provisionBucketCmd, - "seed-app-limit-caps-defaults": seedAppLimitCapsDefaultsCmd, - "seed-app-limit-defaults": seedAppLimitDefaultsCmd, - "seed-org-limit-caps-defaults": seedOrgLimitCapsDefaultsCmd, - "seed-org-limit-defaults": seedOrgLimitDefaultsCmd +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import appLimitCapCmd from './commands/app-limit-cap'; +import appLimitCapsDefaultCmd from './commands/app-limit-caps-default'; +import appLimitCmd from './commands/app-limit'; +import appLimitCreditCodeCmd from './commands/app-limit-credit-code'; +import appLimitCreditCodeItemCmd from './commands/app-limit-credit-code-item'; +import appLimitCreditCmd from './commands/app-limit-credit'; +import appLimitCreditRedemptionCmd from './commands/app-limit-credit-redemption'; +import appLimitDefaultCmd from './commands/app-limit-default'; +import appLimitEventCmd from './commands/app-limit-event'; +import appLimitWarningCmd from './commands/app-limit-warning'; +import orgLimitAggregateCmd from './commands/org-limit-aggregate'; +import orgLimitCapCmd from './commands/org-limit-cap'; +import orgLimitCapsDefaultCmd from './commands/org-limit-caps-default'; +import orgLimitCmd from './commands/org-limit'; +import orgLimitCreditCmd from './commands/org-limit-credit'; +import orgLimitDefaultCmd from './commands/org-limit-default'; +import orgLimitEventCmd from './commands/org-limit-event'; +import orgLimitWarningCmd from './commands/org-limit-warning'; +import provisionBucketCmd from './commands/provision-bucket'; +import seedAppLimitCapsDefaultsCmd from './commands/seed-app-limit-caps-defaults'; +import seedAppLimitDefaultsCmd from './commands/seed-app-limit-defaults'; +import seedOrgLimitCapsDefaultsCmd from './commands/seed-org-limit-caps-defaults'; +import seedOrgLimitDefaultsCmd from './commands/seed-org-limit-defaults'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + 'app-limit-cap': appLimitCapCmd, + 'app-limit-caps-default': appLimitCapsDefaultCmd, + 'app-limit': appLimitCmd, + 'app-limit-credit-code': appLimitCreditCodeCmd, + 'app-limit-credit-code-item': appLimitCreditCodeItemCmd, + 'app-limit-credit': appLimitCreditCmd, + 'app-limit-credit-redemption': appLimitCreditRedemptionCmd, + 'app-limit-default': appLimitDefaultCmd, + 'app-limit-event': appLimitEventCmd, + 'app-limit-warning': appLimitWarningCmd, + 'org-limit-aggregate': orgLimitAggregateCmd, + 'org-limit-cap': orgLimitCapCmd, + 'org-limit-caps-default': orgLimitCapsDefaultCmd, + 'org-limit': orgLimitCmd, + 'org-limit-credit': orgLimitCreditCmd, + 'org-limit-default': orgLimitDefaultCmd, + 'org-limit-event': orgLimitEventCmd, + 'org-limit-warning': orgLimitWarningCmd, + 'provision-bucket': provisionBucketCmd, + 'seed-app-limit-caps-defaults': seedAppLimitCapsDefaultsCmd, + 'seed-app-limit-defaults': seedAppLimitDefaultsCmd, + 'seed-org-limit-caps-defaults': seedOrgLimitCapsDefaultsCmd, + 'seed-org-limit-defaults': seedOrgLimitDefaultsCmd, }); -const usage = "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n app-limit-cap appLimitCap CRUD operations\n app-limit-caps-default appLimitCapsDefault CRUD operations\n app-limit appLimit CRUD operations\n app-limit-credit-code appLimitCreditCode CRUD operations\n app-limit-credit-code-item appLimitCreditCodeItem CRUD operations\n app-limit-credit appLimitCredit CRUD operations\n app-limit-credit-redemption appLimitCreditRedemption CRUD operations\n app-limit-default appLimitDefault CRUD operations\n app-limit-event appLimitEvent CRUD operations\n app-limit-warning appLimitWarning CRUD operations\n org-limit-aggregate orgLimitAggregate CRUD operations\n org-limit-cap orgLimitCap CRUD operations\n org-limit-caps-default orgLimitCapsDefault CRUD operations\n org-limit orgLimit CRUD operations\n org-limit-credit orgLimitCredit CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n org-limit-event orgLimitEvent CRUD operations\n org-limit-warning orgLimitWarning CRUD operations\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 seed-app-limit-caps-defaults seedAppLimitCapsDefaults\n seed-app-limit-defaults seedAppLimitDefaults\n seed-org-limit-caps-defaults seedOrgLimitCapsDefaults\n seed-org-limit-defaults seedOrgLimitDefaults\n\n --help, -h Show this help message\n --version, -v Show version\n"; -export const commands = async (argv: Partial>, prompter: Inquirerer, options: CLIOptions) => { +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n app-limit-cap appLimitCap CRUD operations\n app-limit-caps-default appLimitCapsDefault CRUD operations\n app-limit appLimit CRUD operations\n app-limit-credit-code appLimitCreditCode CRUD operations\n app-limit-credit-code-item appLimitCreditCodeItem CRUD operations\n app-limit-credit appLimitCredit CRUD operations\n app-limit-credit-redemption appLimitCreditRedemption CRUD operations\n app-limit-default appLimitDefault CRUD operations\n app-limit-event appLimitEvent CRUD operations\n app-limit-warning appLimitWarning CRUD operations\n org-limit-aggregate orgLimitAggregate CRUD operations\n org-limit-cap orgLimitCap CRUD operations\n org-limit-caps-default orgLimitCapsDefault CRUD operations\n org-limit orgLimit CRUD operations\n org-limit-credit orgLimitCredit CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n org-limit-event orgLimitEvent CRUD operations\n org-limit-warning orgLimitWarning CRUD operations\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 seed-app-limit-caps-defaults seedAppLimitCapsDefaults\n seed-app-limit-defaults seedAppLimitDefaults\n seed-org-limit-caps-defaults seedOrgLimitCapsDefaults\n seed-org-limit-defaults seedOrgLimitDefaults\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } - let { - first: command, - newArgv - } = extractFirst(argv); + let { first: command, newArgv } = extractFirst(argv); const commandMap = createCommandMap(); if (!command) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "command", - message: "What do you want to do?", - options: Object.keys(commandMap) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); command = answer.command as string; } const commandFn = commandMap[command]; @@ -85,4 +96,4 @@ export const commands = async (argv: Partial>, prompter: await commandFn(newArgv, prompter, options); prompter.close(); return argv; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-cap.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-cap.ts index 32cccdc06c..835b6f7d80 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-cap.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-cap.ts @@ -3,52 +3,66 @@ * @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 { CreateAppLimitCapInput, AppLimitCapPatch, AppLimitCapSelect, AppLimitCapFilter, AppLimitCapOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitCapInput, + AppLimitCapPatch, + AppLimitCapSelect, + AppLimitCapFilter, + AppLimitCapOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - entityId: "uuid", - id: "uuid", - max: "int", - name: "string" + entityId: 'uuid', + id: 'uuid', + max: 'int', + name: 'string', }; -const usage = "\napp-limit-cap \n\nCommands:\n list List appLimitCap records\n find-first Find first matching appLimitCap record\n get Get a appLimitCap by ID\n create Create a new appLimitCap\n update Update an existing appLimitCap\n delete Delete a appLimitCap\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) => { +const usage = + '\napp-limit-cap \n\nCommands:\n list List appLimitCap records\n find-first Find first matching appLimitCap record\n get Get a appLimitCap by ID\n create Create a new appLimitCap\n update Update an existing appLimitCap\n delete Delete a appLimitCap\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -61,16 +75,18 @@ async function handleList(argv: Partial>, _prompter: Inq entityId: true, id: true, max: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitCapSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppLimitCapSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCap.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -83,16 +99,18 @@ async function handleFindFirst(argv: Partial>, _prompter entityId: true, id: true, max: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitCapSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppLimitCapSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCap.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -101,25 +119,29 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitCap.findOne({ - id: answers.id as string, - select: { - entityId: true, - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.appLimitCap + .findOne({ + id: answers.id as string, + select: { + entityId: true, + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -128,42 +150,51 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitCapInput["appLimitCap"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitCapInput['appLimitCap']; const client = getClient(); - const result = await client.appLimitCap.create({ - data: { - entityId: cleanedData.entityId, - max: cleanedData.max, - name: cleanedData.name - }, - select: { - entityId: true, - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.appLimitCap + .create({ + data: { + entityId: cleanedData.entityId, + max: cleanedData.max, + name: cleanedData.name, + }, + select: { + entityId: true, + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -172,50 +203,57 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitCapPatch; const client = getClient(); - const result = await client.appLimitCap.update({ - where: { - id: answers.id as string - }, - data: { - entityId: cleanedData.entityId, - max: cleanedData.max, - name: cleanedData.name - }, - select: { - entityId: true, - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.appLimitCap + .update({ + where: { + id: answers.id as string, + }, + data: { + entityId: cleanedData.entityId, + max: cleanedData.max, + name: cleanedData.name, + }, + select: { + entityId: true, + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -224,28 +262,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimitCap.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitCap + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-caps-default.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-caps-default.ts index 2a79a57ef4..cce1e93e2a 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-caps-default.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-caps-default.ts @@ -3,51 +3,65 @@ * @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 { CreateAppLimitCapsDefaultInput, AppLimitCapsDefaultPatch, AppLimitCapsDefaultSelect, AppLimitCapsDefaultFilter, AppLimitCapsDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitCapsDefaultInput, + AppLimitCapsDefaultPatch, + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - id: "uuid", - max: "int", - name: "string" + id: 'uuid', + max: 'int', + name: 'string', }; -const usage = "\napp-limit-caps-default \n\nCommands:\n list List appLimitCapsDefault records\n find-first Find first matching appLimitCapsDefault record\n get Get a appLimitCapsDefault by ID\n create Create a new appLimitCapsDefault\n update Update an existing appLimitCapsDefault\n delete Delete a appLimitCapsDefault\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) => { +const usage = + '\napp-limit-caps-default \n\nCommands:\n list List appLimitCapsDefault records\n find-first Find first matching appLimitCapsDefault record\n get Get a appLimitCapsDefault by ID\n create Create a new appLimitCapsDefault\n update Update an existing appLimitCapsDefault\n delete Delete a appLimitCapsDefault\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -59,16 +73,22 @@ async function handleList(argv: Partial>, _prompter: Inq const defaultSelect = { id: true, max: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitCapsDefaultSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy + > & { + select: AppLimitCapsDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCapsDefault.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -80,16 +100,22 @@ async function handleFindFirst(argv: Partial>, _prompter const defaultSelect = { id: true, max: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitCapsDefaultSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy + > & { + select: AppLimitCapsDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCapsDefault.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -98,24 +124,28 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitCapsDefault.findOne({ - id: answers.id as string, - select: { - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.appLimitCapsDefault + .findOne({ + id: answers.id as string, + select: { + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -124,35 +154,43 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitCapsDefaultInput["appLimitCapsDefault"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitCapsDefaultInput['appLimitCapsDefault']; const client = getClient(); - const result = await client.appLimitCapsDefault.create({ - data: { - max: cleanedData.max, - name: cleanedData.name - }, - select: { - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.appLimitCapsDefault + .create({ + data: { + max: cleanedData.max, + name: cleanedData.name, + }, + select: { + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -161,43 +199,49 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitCapsDefaultPatch; const client = getClient(); - const result = await client.appLimitCapsDefault.update({ - where: { - id: answers.id as string - }, - data: { - max: cleanedData.max, - name: cleanedData.name - }, - select: { - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.appLimitCapsDefault + .update({ + where: { + id: answers.id as string, + }, + data: { + max: cleanedData.max, + name: cleanedData.name, + }, + select: { + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -206,28 +250,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimitCapsDefault.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitCapsDefault + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-code-item.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-code-item.ts index 3bae432b82..ca96477184 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-code-item.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-code-item.ts @@ -3,53 +3,67 @@ * @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 { CreateAppLimitCreditCodeItemInput, AppLimitCreditCodeItemPatch, AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemFilter, AppLimitCreditCodeItemOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitCreditCodeItemInput, + AppLimitCreditCodeItemPatch, + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - amount: "int", - creditCodeId: "uuid", - creditType: "string", - defaultLimitId: "uuid", - id: "uuid" + amount: 'int', + creditCodeId: 'uuid', + creditType: 'string', + defaultLimitId: 'uuid', + id: 'uuid', }; -const usage = "\napp-limit-credit-code-item \n\nCommands:\n list List appLimitCreditCodeItem records\n find-first Find first matching appLimitCreditCodeItem record\n get Get a appLimitCreditCodeItem by ID\n create Create a new appLimitCreditCodeItem\n update Update an existing appLimitCreditCodeItem\n delete Delete a appLimitCreditCodeItem\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) => { +const usage = + '\napp-limit-credit-code-item \n\nCommands:\n list List appLimitCreditCodeItem records\n find-first Find first matching appLimitCreditCodeItem record\n get Get a appLimitCreditCodeItem by ID\n create Create a new appLimitCreditCodeItem\n update Update an existing appLimitCreditCodeItem\n delete Delete a appLimitCreditCodeItem\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq creditCodeId: true, creditType: true, defaultLimitId: true, - id: true + id: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitCreditCodeItemSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy + > & { + select: AppLimitCreditCodeItemSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCreditCodeItem.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter creditCodeId: true, creditType: true, defaultLimitId: true, - id: true + id: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitCreditCodeItemSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy + > & { + select: AppLimitCreditCodeItemSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCreditCodeItem.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitCreditCodeItem.findOne({ - id: answers.id as string, - select: { - amount: true, - creditCodeId: true, - creditType: true, - defaultLimitId: true, - id: true - } - }).execute(); + const result = await client.appLimitCreditCodeItem + .findOne({ + id: answers.id as string, + select: { + amount: true, + creditCodeId: true, + creditType: true, + defaultLimitId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,49 +162,59 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "amount", - message: "amount", - required: true - }, { - type: "text", - name: "creditCodeId", - message: "creditCodeId", - required: true - }, { - type: "text", - name: "creditType", - message: "creditType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultLimitId", - message: "defaultLimitId", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'amount', + message: 'amount', + required: true, + }, + { + type: 'text', + name: 'creditCodeId', + message: 'creditCodeId', + required: true, + }, + { + type: 'text', + name: 'creditType', + message: 'creditType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultLimitId', + message: 'defaultLimitId', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitCreditCodeItemInput["appLimitCreditCodeItem"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitCreditCodeItemInput['appLimitCreditCodeItem']; const client = getClient(); - const result = await client.appLimitCreditCodeItem.create({ - data: { - amount: cleanedData.amount, - creditCodeId: cleanedData.creditCodeId, - creditType: cleanedData.creditType, - defaultLimitId: cleanedData.defaultLimitId - }, - select: { - amount: true, - creditCodeId: true, - creditType: true, - defaultLimitId: true, - id: true - } - }).execute(); + const result = await client.appLimitCreditCodeItem + .create({ + data: { + amount: cleanedData.amount, + creditCodeId: cleanedData.creditCodeId, + creditType: cleanedData.creditType, + defaultLimitId: cleanedData.defaultLimitId, + }, + select: { + amount: true, + creditCodeId: true, + creditType: true, + defaultLimitId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -183,57 +223,65 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "amount", - message: "amount", - required: false - }, { - type: "text", - name: "creditCodeId", - message: "creditCodeId", - required: false - }, { - type: "text", - name: "creditType", - message: "creditType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultLimitId", - message: "defaultLimitId", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'amount', + message: 'amount', + required: false, + }, + { + type: 'text', + name: 'creditCodeId', + message: 'creditCodeId', + required: false, + }, + { + type: 'text', + name: 'creditType', + message: 'creditType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultLimitId', + message: 'defaultLimitId', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitCreditCodeItemPatch; const client = getClient(); - const result = await client.appLimitCreditCodeItem.update({ - where: { - id: answers.id as string - }, - data: { - amount: cleanedData.amount, - creditCodeId: cleanedData.creditCodeId, - creditType: cleanedData.creditType, - defaultLimitId: cleanedData.defaultLimitId - }, - select: { - amount: true, - creditCodeId: true, - creditType: true, - defaultLimitId: true, - id: true - } - }).execute(); + const result = await client.appLimitCreditCodeItem + .update({ + where: { + id: answers.id as string, + }, + data: { + amount: cleanedData.amount, + creditCodeId: cleanedData.creditCodeId, + creditType: cleanedData.creditType, + defaultLimitId: cleanedData.defaultLimitId, + }, + select: { + amount: true, + creditCodeId: true, + creditType: true, + defaultLimitId: true, + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -242,28 +290,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimitCreditCodeItem.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitCreditCodeItem + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-code.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-code.ts index 2d340a414d..e81b15bbe4 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-code.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-code.ts @@ -3,53 +3,67 @@ * @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 { CreateAppLimitCreditCodeInput, AppLimitCreditCodePatch, AppLimitCreditCodeSelect, AppLimitCreditCodeFilter, AppLimitCreditCodeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitCreditCodeInput, + AppLimitCreditCodePatch, + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - code: "string", - currentRedemptions: "int", - expiresAt: "string", - id: "uuid", - maxRedemptions: "int" + code: 'string', + currentRedemptions: 'int', + expiresAt: 'string', + id: 'uuid', + maxRedemptions: 'int', }; -const usage = "\napp-limit-credit-code \n\nCommands:\n list List appLimitCreditCode records\n find-first Find first matching appLimitCreditCode record\n get Get a appLimitCreditCode by ID\n create Create a new appLimitCreditCode\n update Update an existing appLimitCreditCode\n delete Delete a appLimitCreditCode\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) => { +const usage = + '\napp-limit-credit-code \n\nCommands:\n list List appLimitCreditCode records\n find-first Find first matching appLimitCreditCode record\n get Get a appLimitCreditCode by ID\n create Create a new appLimitCreditCode\n update Update an existing appLimitCreditCode\n delete Delete a appLimitCreditCode\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq currentRedemptions: true, expiresAt: true, id: true, - maxRedemptions: true + maxRedemptions: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitCreditCodeSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy + > & { + select: AppLimitCreditCodeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCreditCode.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter currentRedemptions: true, expiresAt: true, id: true, - maxRedemptions: true + maxRedemptions: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitCreditCodeSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy + > & { + select: AppLimitCreditCodeSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCreditCode.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitCreditCode.findOne({ - id: answers.id as string, - select: { - code: true, - currentRedemptions: true, - expiresAt: true, - id: true, - maxRedemptions: true - } - }).execute(); + const result = await client.appLimitCreditCode + .findOne({ + id: answers.id as string, + select: { + code: true, + currentRedemptions: true, + expiresAt: true, + id: true, + maxRedemptions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,51 +162,61 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "code", - message: "code", - required: true - }, { - type: "text", - name: "currentRedemptions", - message: "currentRedemptions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxRedemptions", - message: "maxRedemptions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'code', + message: 'code', + required: true, + }, + { + type: 'text', + name: 'currentRedemptions', + message: 'currentRedemptions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxRedemptions', + message: 'maxRedemptions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitCreditCodeInput["appLimitCreditCode"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitCreditCodeInput['appLimitCreditCode']; const client = getClient(); - const result = await client.appLimitCreditCode.create({ - data: { - code: cleanedData.code, - currentRedemptions: cleanedData.currentRedemptions, - expiresAt: cleanedData.expiresAt, - maxRedemptions: cleanedData.maxRedemptions - }, - select: { - code: true, - currentRedemptions: true, - expiresAt: true, - id: true, - maxRedemptions: true - } - }).execute(); + const result = await client.appLimitCreditCode + .create({ + data: { + code: cleanedData.code, + currentRedemptions: cleanedData.currentRedemptions, + expiresAt: cleanedData.expiresAt, + maxRedemptions: cleanedData.maxRedemptions, + }, + select: { + code: true, + currentRedemptions: true, + expiresAt: true, + id: true, + maxRedemptions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -185,59 +225,67 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "code", - message: "code", - required: false - }, { - type: "text", - name: "currentRedemptions", - message: "currentRedemptions", - required: false, - skipPrompt: true - }, { - type: "text", - name: "expiresAt", - message: "expiresAt", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxRedemptions", - message: "maxRedemptions", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'code', + message: 'code', + required: false, + }, + { + type: 'text', + name: 'currentRedemptions', + message: 'currentRedemptions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxRedemptions', + message: 'maxRedemptions', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitCreditCodePatch; const client = getClient(); - const result = await client.appLimitCreditCode.update({ - where: { - id: answers.id as string - }, - data: { - code: cleanedData.code, - currentRedemptions: cleanedData.currentRedemptions, - expiresAt: cleanedData.expiresAt, - maxRedemptions: cleanedData.maxRedemptions - }, - select: { - code: true, - currentRedemptions: true, - expiresAt: true, - id: true, - maxRedemptions: true - } - }).execute(); + const result = await client.appLimitCreditCode + .update({ + where: { + id: answers.id as string, + }, + data: { + code: cleanedData.code, + currentRedemptions: cleanedData.currentRedemptions, + expiresAt: cleanedData.expiresAt, + maxRedemptions: cleanedData.maxRedemptions, + }, + select: { + code: true, + currentRedemptions: true, + expiresAt: true, + id: true, + maxRedemptions: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -246,28 +294,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimitCreditCode.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitCreditCode + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-redemption.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-redemption.ts index ed29732157..0200fbcf7d 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-redemption.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit-redemption.ts @@ -3,53 +3,67 @@ * @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 { CreateAppLimitCreditRedemptionInput, AppLimitCreditRedemptionPatch, AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionFilter, AppLimitCreditRedemptionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitCreditRedemptionInput, + AppLimitCreditRedemptionPatch, + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - creditCodeId: "uuid", - entityId: "uuid", - entityType: "string", - id: "uuid", - organizationId: "uuid" + creditCodeId: 'uuid', + entityId: 'uuid', + entityType: 'string', + id: 'uuid', + organizationId: 'uuid', }; -const usage = "\napp-limit-credit-redemption \n\nCommands:\n list List appLimitCreditRedemption records\n find-first Find first matching appLimitCreditRedemption record\n get Get a appLimitCreditRedemption by ID\n create Create a new appLimitCreditRedemption\n update Update an existing appLimitCreditRedemption\n delete Delete a appLimitCreditRedemption\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) => { +const usage = + '\napp-limit-credit-redemption \n\nCommands:\n list List appLimitCreditRedemption records\n find-first Find first matching appLimitCreditRedemption record\n get Get a appLimitCreditRedemption by ID\n create Create a new appLimitCreditRedemption\n update Update an existing appLimitCreditRedemption\n delete Delete a appLimitCreditRedemption\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,22 @@ async function handleList(argv: Partial>, _prompter: Inq entityId: true, entityType: true, id: true, - organizationId: true + organizationId: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitCreditRedemptionSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy + > & { + select: AppLimitCreditRedemptionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCreditRedemption.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +106,22 @@ async function handleFindFirst(argv: Partial>, _prompter entityId: true, entityType: true, id: true, - organizationId: true + organizationId: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitCreditRedemptionSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy + > & { + select: AppLimitCreditRedemptionSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCreditRedemption.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +130,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitCreditRedemption.findOne({ - id: answers.id as string, - select: { - creditCodeId: true, - entityId: true, - entityType: true, - id: true, - organizationId: true - } - }).execute(); + const result = await client.appLimitCreditRedemption + .findOne({ + id: answers.id as string, + select: { + creditCodeId: true, + entityId: true, + entityType: true, + id: true, + organizationId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,50 +162,60 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "creditCodeId", - message: "creditCodeId", - required: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'creditCodeId', + message: 'creditCodeId', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitCreditRedemptionInput["appLimitCreditRedemption"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitCreditRedemptionInput['appLimitCreditRedemption']; const client = getClient(); - const result = await client.appLimitCreditRedemption.create({ - data: { - creditCodeId: cleanedData.creditCodeId, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - organizationId: cleanedData.organizationId - }, - select: { - creditCodeId: true, - entityId: true, - entityType: true, - id: true, - organizationId: true - } - }).execute(); + const result = await client.appLimitCreditRedemption + .create({ + data: { + creditCodeId: cleanedData.creditCodeId, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + organizationId: cleanedData.organizationId, + }, + select: { + creditCodeId: true, + entityId: true, + entityType: true, + id: true, + organizationId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -184,58 +224,66 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "creditCodeId", - message: "creditCodeId", - required: false - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'creditCodeId', + message: 'creditCodeId', + required: false, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitCreditRedemptionPatch; const client = getClient(); - const result = await client.appLimitCreditRedemption.update({ - where: { - id: answers.id as string - }, - data: { - creditCodeId: cleanedData.creditCodeId, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - organizationId: cleanedData.organizationId - }, - select: { - creditCodeId: true, - entityId: true, - entityType: true, - id: true, - organizationId: true - } - }).execute(); + const result = await client.appLimitCreditRedemption + .update({ + where: { + id: answers.id as string, + }, + data: { + creditCodeId: cleanedData.creditCodeId, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + organizationId: cleanedData.organizationId, + }, + select: { + creditCodeId: true, + entityId: true, + entityType: true, + id: true, + organizationId: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -244,28 +292,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimitCreditRedemption.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitCreditRedemption + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit.ts index 0227f08325..0c4624a5c8 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-credit.ts @@ -3,54 +3,68 @@ * @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 { CreateAppLimitCreditInput, AppLimitCreditPatch, AppLimitCreditSelect, AppLimitCreditFilter, AppLimitCreditOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitCreditInput, + AppLimitCreditPatch, + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - amount: "int", - creditType: "string", - defaultLimitId: "uuid", - id: "uuid", - reason: "string" + actorId: 'uuid', + amount: 'int', + creditType: 'string', + defaultLimitId: 'uuid', + id: 'uuid', + reason: 'string', }; -const usage = "\napp-limit-credit \n\nCommands:\n list List appLimitCredit records\n find-first Find first matching appLimitCredit record\n get Get a appLimitCredit by ID\n create Create a new appLimitCredit\n update Update an existing appLimitCredit\n delete Delete a appLimitCredit\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) => { +const usage = + '\napp-limit-credit \n\nCommands:\n list List appLimitCredit records\n find-first Find first matching appLimitCredit record\n get Get a appLimitCredit by ID\n create Create a new appLimitCredit\n update Update an existing appLimitCredit\n delete Delete a appLimitCredit\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq creditType: true, defaultLimitId: true, id: true, - reason: true + reason: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitCreditSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppLimitCreditSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCredit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter creditType: true, defaultLimitId: true, id: true, - reason: true + reason: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitCreditSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppLimitCreditSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitCredit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitCredit.findOne({ - id: answers.id as string, - select: { - actorId: true, - amount: true, - creditType: true, - defaultLimitId: true, - id: true, - reason: true - } - }).execute(); + const result = await client.appLimitCredit + .findOne({ + id: answers.id as string, + select: { + actorId: true, + amount: true, + creditType: true, + defaultLimitId: true, + id: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,58 +158,69 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "amount", - message: "amount", - required: true - }, { - type: "text", - name: "creditType", - message: "creditType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultLimitId", - message: "defaultLimitId", - required: true - }, { - type: "text", - name: "reason", - message: "reason", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'amount', + message: 'amount', + required: true, + }, + { + type: 'text', + name: 'creditType', + message: 'creditType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultLimitId', + message: 'defaultLimitId', + required: true, + }, + { + type: 'text', + name: 'reason', + message: 'reason', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitCreditInput["appLimitCredit"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitCreditInput['appLimitCredit']; const client = getClient(); - const result = await client.appLimitCredit.create({ - data: { - actorId: cleanedData.actorId, - amount: cleanedData.amount, - creditType: cleanedData.creditType, - defaultLimitId: cleanedData.defaultLimitId, - reason: cleanedData.reason - }, - select: { - actorId: true, - amount: true, - creditType: true, - defaultLimitId: true, - id: true, - reason: true - } - }).execute(); + const result = await client.appLimitCredit + .create({ + data: { + actorId: cleanedData.actorId, + amount: cleanedData.amount, + creditType: cleanedData.creditType, + defaultLimitId: cleanedData.defaultLimitId, + reason: cleanedData.reason, + }, + select: { + actorId: true, + amount: true, + creditType: true, + defaultLimitId: true, + id: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -196,66 +229,75 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "amount", - message: "amount", - required: false - }, { - type: "text", - name: "creditType", - message: "creditType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultLimitId", - message: "defaultLimitId", - required: false - }, { - type: "text", - name: "reason", - message: "reason", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'amount', + message: 'amount', + required: false, + }, + { + type: 'text', + name: 'creditType', + message: 'creditType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultLimitId', + message: 'defaultLimitId', + required: false, + }, + { + type: 'text', + name: 'reason', + message: 'reason', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitCreditPatch; const client = getClient(); - const result = await client.appLimitCredit.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - amount: cleanedData.amount, - creditType: cleanedData.creditType, - defaultLimitId: cleanedData.defaultLimitId, - reason: cleanedData.reason - }, - select: { - actorId: true, - amount: true, - creditType: true, - defaultLimitId: true, - id: true, - reason: true - } - }).execute(); + const result = await client.appLimitCredit + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + amount: cleanedData.amount, + creditType: cleanedData.creditType, + defaultLimitId: cleanedData.defaultLimitId, + reason: cleanedData.reason, + }, + select: { + actorId: true, + amount: true, + creditType: true, + defaultLimitId: true, + id: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -264,28 +306,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimitCredit.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitCredit + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-default.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-default.ts index 0aa194dbbe..bed3a020b2 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-default.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-default.ts @@ -3,52 +3,66 @@ * @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 { CreateAppLimitDefaultInput, AppLimitDefaultPatch, AppLimitDefaultSelect, AppLimitDefaultFilter, AppLimitDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitDefaultInput, + AppLimitDefaultPatch, + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - id: "uuid", - max: "int", - name: "string", - softMax: "int" + id: 'uuid', + max: 'int', + name: 'string', + softMax: 'int', }; -const usage = "\napp-limit-default \n\nCommands:\n list List appLimitDefault records\n find-first Find first matching appLimitDefault record\n get Get a appLimitDefault by ID\n create Create a new appLimitDefault\n update Update an existing appLimitDefault\n delete Delete a appLimitDefault\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) => { +const usage = + '\napp-limit-default \n\nCommands:\n list List appLimitDefault records\n find-first Find first matching appLimitDefault record\n get Get a appLimitDefault by ID\n create Create a new appLimitDefault\n update Update an existing appLimitDefault\n delete Delete a appLimitDefault\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -61,16 +75,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, max: true, name: true, - softMax: true + softMax: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitDefaultSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppLimitDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitDefault.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -83,16 +99,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, max: true, name: true, - softMax: true + softMax: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitDefaultSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppLimitDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitDefault.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -101,25 +119,29 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitDefault.findOne({ - id: answers.id as string, - select: { - id: true, - max: true, - name: true, - softMax: true - } - }).execute(); + const result = await client.appLimitDefault + .findOne({ + id: answers.id as string, + select: { + id: true, + max: true, + name: true, + softMax: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -128,43 +150,52 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitDefaultInput["appLimitDefault"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitDefaultInput['appLimitDefault']; const client = getClient(); - const result = await client.appLimitDefault.create({ - data: { - max: cleanedData.max, - name: cleanedData.name, - softMax: cleanedData.softMax - }, - select: { - id: true, - max: true, - name: true, - softMax: true - } - }).execute(); + const result = await client.appLimitDefault + .create({ + data: { + max: cleanedData.max, + name: cleanedData.name, + softMax: cleanedData.softMax, + }, + select: { + id: true, + max: true, + name: true, + softMax: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -173,51 +204,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitDefaultPatch; const client = getClient(); - const result = await client.appLimitDefault.update({ - where: { - id: answers.id as string - }, - data: { - max: cleanedData.max, - name: cleanedData.name, - softMax: cleanedData.softMax - }, - select: { - id: true, - max: true, - name: true, - softMax: true - } - }).execute(); + const result = await client.appLimitDefault + .update({ + where: { + id: answers.id as string, + }, + data: { + max: cleanedData.max, + name: cleanedData.name, + softMax: cleanedData.softMax, + }, + select: { + id: true, + max: true, + name: true, + softMax: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -226,28 +264,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimitDefault.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitDefault + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-event.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-event.ts index 5571f2de86..216e0dd3c6 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-event.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-event.ts @@ -3,61 +3,75 @@ * @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 { CreateAppLimitEventInput, AppLimitEventPatch, AppLimitEventSelect, AppLimitEventFilter, AppLimitEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitEventInput, + AppLimitEventPatch, + AppLimitEventSelect, + AppLimitEventFilter, + AppLimitEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - delta: "int", - entityId: "uuid", - entityType: "string", - eventType: "string", - id: "uuid", - maxAtEvent: "int", - name: "string", - numAfter: "int", - numBefore: "int", - organizationId: "uuid", - reason: "string" + actorId: 'uuid', + createdAt: 'string', + delta: 'int', + entityId: 'uuid', + entityType: 'string', + eventType: 'string', + id: 'uuid', + maxAtEvent: 'int', + name: 'string', + numAfter: 'int', + numBefore: 'int', + organizationId: 'uuid', + reason: 'string', }; -const usage = "\napp-limit-event \n\nCommands:\n list List appLimitEvent records\n find-first Find first matching appLimitEvent record\n get Get a appLimitEvent by ID\n create Create a new appLimitEvent\n update Update an existing appLimitEvent\n delete Delete a appLimitEvent\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) => { +const usage = + '\napp-limit-event \n\nCommands:\n list List appLimitEvent records\n find-first Find first matching appLimitEvent record\n get Get a appLimitEvent by ID\n create Create a new appLimitEvent\n update Update an existing appLimitEvent\n delete Delete a appLimitEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq numAfter: true, numBefore: true, organizationId: true, - reason: true + reason: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppLimitEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter numAfter: true, numBefore: true, organizationId: true, - reason: true + reason: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppLimitEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - delta: true, - entityId: true, - entityType: true, - eventType: true, - id: true, - maxAtEvent: true, - name: true, - numAfter: true, - numBefore: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.appLimitEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + delta: true, + entityId: true, + entityType: true, + eventType: true, + id: true, + maxAtEvent: true, + name: true, + numAfter: true, + numBefore: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,109 +186,126 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "delta", - message: "delta", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxAtEvent", - message: "maxAtEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "numAfter", - message: "numAfter", - required: false, - skipPrompt: true - }, { - type: "text", - name: "numBefore", - message: "numBefore", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "reason", - message: "reason", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'delta', + message: 'delta', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAtEvent', + message: 'maxAtEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'numAfter', + message: 'numAfter', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'numBefore', + message: 'numBefore', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'reason', + message: 'reason', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitEventInput["appLimitEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitEventInput['appLimitEvent']; const client = getClient(); - const result = await client.appLimitEvent.create({ - data: { - actorId: cleanedData.actorId, - delta: cleanedData.delta, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - eventType: cleanedData.eventType, - maxAtEvent: cleanedData.maxAtEvent, - name: cleanedData.name, - numAfter: cleanedData.numAfter, - numBefore: cleanedData.numBefore, - organizationId: cleanedData.organizationId, - reason: cleanedData.reason - }, - select: { - actorId: true, - createdAt: true, - delta: true, - entityId: true, - entityType: true, - eventType: true, - id: true, - maxAtEvent: true, - name: true, - numAfter: true, - numBefore: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.appLimitEvent + .create({ + data: { + actorId: cleanedData.actorId, + delta: cleanedData.delta, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + eventType: cleanedData.eventType, + maxAtEvent: cleanedData.maxAtEvent, + name: cleanedData.name, + numAfter: cleanedData.numAfter, + numBefore: cleanedData.numBefore, + organizationId: cleanedData.organizationId, + reason: cleanedData.reason, + }, + select: { + actorId: true, + createdAt: true, + delta: true, + entityId: true, + entityType: true, + eventType: true, + id: true, + maxAtEvent: true, + name: true, + numAfter: true, + numBefore: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -275,123 +314,139 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "delta", - message: "delta", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxAtEvent", - message: "maxAtEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "numAfter", - message: "numAfter", - required: false, - skipPrompt: true - }, { - type: "text", - name: "numBefore", - message: "numBefore", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "reason", - message: "reason", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'delta', + message: 'delta', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAtEvent', + message: 'maxAtEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'numAfter', + message: 'numAfter', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'numBefore', + message: 'numBefore', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'reason', + message: 'reason', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitEventPatch; const client = getClient(); - const result = await client.appLimitEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - delta: cleanedData.delta, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - eventType: cleanedData.eventType, - maxAtEvent: cleanedData.maxAtEvent, - name: cleanedData.name, - numAfter: cleanedData.numAfter, - numBefore: cleanedData.numBefore, - organizationId: cleanedData.organizationId, - reason: cleanedData.reason - }, - select: { - actorId: true, - createdAt: true, - delta: true, - entityId: true, - entityType: true, - eventType: true, - id: true, - maxAtEvent: true, - name: true, - numAfter: true, - numBefore: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.appLimitEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + delta: cleanedData.delta, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + eventType: cleanedData.eventType, + maxAtEvent: cleanedData.maxAtEvent, + name: cleanedData.name, + numAfter: cleanedData.numAfter, + numBefore: cleanedData.numBefore, + organizationId: cleanedData.organizationId, + reason: cleanedData.reason, + }, + select: { + actorId: true, + createdAt: true, + delta: true, + entityId: true, + entityType: true, + eventType: true, + id: true, + maxAtEvent: true, + name: true, + numAfter: true, + numBefore: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -400,34 +455,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.appLimitEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-warning.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-warning.ts index 65fe3d6a64..06c379c241 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-warning.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-warning.ts @@ -3,53 +3,67 @@ * @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 { CreateAppLimitWarningInput, AppLimitWarningPatch, AppLimitWarningSelect, AppLimitWarningFilter, AppLimitWarningOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitWarningInput, + AppLimitWarningPatch, + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - id: "uuid", - name: "string", - taskIdentifier: "string", - thresholdValue: "int", - warningType: "string" + id: 'uuid', + name: 'string', + taskIdentifier: 'string', + thresholdValue: 'int', + warningType: 'string', }; -const usage = "\napp-limit-warning \n\nCommands:\n list List appLimitWarning records\n find-first Find first matching appLimitWarning record\n get Get a appLimitWarning by ID\n create Create a new appLimitWarning\n update Update an existing appLimitWarning\n delete Delete a appLimitWarning\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) => { +const usage = + '\napp-limit-warning \n\nCommands:\n list List appLimitWarning records\n find-first Find first matching appLimitWarning record\n get Get a appLimitWarning by ID\n create Create a new appLimitWarning\n update Update an existing appLimitWarning\n delete Delete a appLimitWarning\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -63,16 +77,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, taskIdentifier: true, thresholdValue: true, - warningType: true + warningType: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitWarningSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppLimitWarningSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitWarning.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -86,16 +102,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, taskIdentifier: true, thresholdValue: true, - warningType: true + warningType: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitWarningSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppLimitWarningSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimitWarning.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -104,26 +122,30 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimitWarning.findOne({ - id: answers.id as string, - select: { - id: true, - name: true, - taskIdentifier: true, - thresholdValue: true, - warningType: true - } - }).execute(); + const result = await client.appLimitWarning + .findOne({ + id: answers.id as string, + select: { + id: true, + name: true, + taskIdentifier: true, + thresholdValue: true, + warningType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -132,48 +154,58 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: true - }, { - type: "text", - name: "thresholdValue", - message: "thresholdValue", - required: true - }, { - type: "text", - name: "warningType", - message: "warningType", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + { + type: 'text', + name: 'thresholdValue', + message: 'thresholdValue', + required: true, + }, + { + type: 'text', + name: 'warningType', + message: 'warningType', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitWarningInput["appLimitWarning"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateAppLimitWarningInput['appLimitWarning']; const client = getClient(); - const result = await client.appLimitWarning.create({ - data: { - name: cleanedData.name, - taskIdentifier: cleanedData.taskIdentifier, - thresholdValue: cleanedData.thresholdValue, - warningType: cleanedData.warningType - }, - select: { - id: true, - name: true, - taskIdentifier: true, - thresholdValue: true, - warningType: true - } - }).execute(); + const result = await client.appLimitWarning + .create({ + data: { + name: cleanedData.name, + taskIdentifier: cleanedData.taskIdentifier, + thresholdValue: cleanedData.thresholdValue, + warningType: cleanedData.warningType, + }, + select: { + id: true, + name: true, + taskIdentifier: true, + thresholdValue: true, + warningType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -182,56 +214,64 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false - }, { - type: "text", - name: "thresholdValue", - message: "thresholdValue", - required: false - }, { - type: "text", - name: "warningType", - message: "warningType", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + { + type: 'text', + name: 'thresholdValue', + message: 'thresholdValue', + required: false, + }, + { + type: 'text', + name: 'warningType', + message: 'warningType', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitWarningPatch; const client = getClient(); - const result = await client.appLimitWarning.update({ - where: { - id: answers.id as string - }, - data: { - name: cleanedData.name, - taskIdentifier: cleanedData.taskIdentifier, - thresholdValue: cleanedData.thresholdValue, - warningType: cleanedData.warningType - }, - select: { - id: true, - name: true, - taskIdentifier: true, - thresholdValue: true, - warningType: true - } - }).execute(); + const result = await client.appLimitWarning + .update({ + where: { + id: answers.id as string, + }, + data: { + name: cleanedData.name, + taskIdentifier: cleanedData.taskIdentifier, + thresholdValue: cleanedData.thresholdValue, + warningType: cleanedData.warningType, + }, + select: { + id: true, + name: true, + taskIdentifier: true, + thresholdValue: true, + warningType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -240,28 +280,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimitWarning.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimitWarning + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit.ts index fe28fd7306..088294de30 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit.ts @@ -3,61 +3,75 @@ * @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 { CreateAppLimitInput, AppLimitPatch, AppLimitSelect, AppLimitFilter, AppLimitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateAppLimitInput, + AppLimitPatch, + AppLimitSelect, + AppLimitFilter, + AppLimitOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - entityType: "string", - id: "uuid", - max: "int", - name: "string", - num: "int", - organizationId: "uuid", - periodCredits: "int", - planMax: "int", - purchasedCredits: "int", - softMax: "int", - windowDuration: "string", - windowStart: "string" + actorId: 'uuid', + entityType: 'string', + id: 'uuid', + max: 'int', + name: 'string', + num: 'int', + organizationId: 'uuid', + periodCredits: 'int', + planMax: 'int', + purchasedCredits: 'int', + softMax: 'int', + windowDuration: 'string', + windowStart: 'string', }; -const usage = "\napp-limit \n\nCommands:\n list List appLimit records\n find-first Find first matching appLimit record\n get Get a appLimit by ID\n create Create a new appLimit\n update Update an existing appLimit\n delete Delete a appLimit\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) => { +const usage = + '\napp-limit \n\nCommands:\n list List appLimit records\n find-first Find first matching appLimit record\n get Get a appLimit by ID\n create Create a new appLimit\n update Update an existing appLimit\n delete Delete a appLimit\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq purchasedCredits: true, softMax: true, windowDuration: true, - windowStart: true + windowStart: true, }; - const findManyArgs = parseFindManyArgs & { - select: AppLimitSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: AppLimitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter purchasedCredits: true, softMax: true, windowDuration: true, - windowStart: true + windowStart: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: AppLimitSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: AppLimitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.appLimit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.appLimit.findOne({ - id: answers.id as string, - select: { - actorId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.appLimit + .findOne({ + id: answers.id as string, + select: { + actorId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,115 +186,130 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "num", - message: "num", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "periodCredits", - message: "periodCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planMax", - message: "planMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "purchasedCredits", - message: "purchasedCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowDuration", - message: "windowDuration", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowStart", - message: "windowStart", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'num', + message: 'num', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'periodCredits', + message: 'periodCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planMax', + message: 'planMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'purchasedCredits', + message: 'purchasedCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowDuration', + message: 'windowDuration', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowStart', + message: 'windowStart', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitInput["appLimit"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateAppLimitInput['appLimit']; const client = getClient(); - const result = await client.appLimit.create({ - data: { - actorId: cleanedData.actorId, - entityType: cleanedData.entityType, - max: cleanedData.max, - name: cleanedData.name, - num: cleanedData.num, - organizationId: cleanedData.organizationId, - periodCredits: cleanedData.periodCredits, - planMax: cleanedData.planMax, - purchasedCredits: cleanedData.purchasedCredits, - softMax: cleanedData.softMax, - windowDuration: cleanedData.windowDuration, - windowStart: cleanedData.windowStart - }, - select: { - actorId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.appLimit + .create({ + data: { + actorId: cleanedData.actorId, + entityType: cleanedData.entityType, + max: cleanedData.max, + name: cleanedData.name, + num: cleanedData.num, + organizationId: cleanedData.organizationId, + periodCredits: cleanedData.periodCredits, + planMax: cleanedData.planMax, + purchasedCredits: cleanedData.purchasedCredits, + softMax: cleanedData.softMax, + windowDuration: cleanedData.windowDuration, + windowStart: cleanedData.windowStart, + }, + select: { + actorId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -281,123 +318,139 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "num", - message: "num", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "periodCredits", - message: "periodCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planMax", - message: "planMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "purchasedCredits", - message: "purchasedCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowDuration", - message: "windowDuration", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowStart", - message: "windowStart", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'num', + message: 'num', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'periodCredits', + message: 'periodCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planMax', + message: 'planMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'purchasedCredits', + message: 'purchasedCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowDuration', + message: 'windowDuration', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowStart', + message: 'windowStart', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as AppLimitPatch; const client = getClient(); - const result = await client.appLimit.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - entityType: cleanedData.entityType, - max: cleanedData.max, - name: cleanedData.name, - num: cleanedData.num, - organizationId: cleanedData.organizationId, - periodCredits: cleanedData.periodCredits, - planMax: cleanedData.planMax, - purchasedCredits: cleanedData.purchasedCredits, - softMax: cleanedData.softMax, - windowDuration: cleanedData.windowDuration, - windowStart: cleanedData.windowStart - }, - select: { - actorId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.appLimit + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + entityType: cleanedData.entityType, + max: cleanedData.max, + name: cleanedData.name, + num: cleanedData.num, + organizationId: cleanedData.organizationId, + periodCredits: cleanedData.periodCredits, + planMax: cleanedData.planMax, + purchasedCredits: cleanedData.purchasedCredits, + softMax: cleanedData.softMax, + windowDuration: cleanedData.windowDuration, + windowStart: cleanedData.windowStart, + }, + select: { + actorId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -406,28 +459,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.appLimit.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.appLimit + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/auth.ts b/sdk/constructive-cli/src/usage/cli/commands/auth.ts index b7414265c2..c731ba27ca 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/auth.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/auth.ts @@ -3,64 +3,77 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["set-token", "status", "logout"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleAuthSubcommand(subcommand, newArgv, prompter, store); }; -async function handleAuthSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "set-token": + case 'set-token': return handleSetToken(argv, prompter, store); - case "status": + case 'status': return handleStatus(store); - case "logout": + case 'logout': return handleLogout(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleSetToken(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.error("No active context. Run \"context create\" first."); + console.error('No active context. Run "context create" first.'); process.exit(1); } - const { - first: token - } = extractFirst(argv); + const { first: token } = extractFirst(argv); let tokenValue = token; if (!tokenValue) { - const answer = await prompter.prompt(argv, [{ - type: "password", - name: "token", - message: "API Token", - required: true - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); tokenValue = answer.token as string; } store.setCredentials(current.name, { - token: String(tokenValue || "").trim() + token: String(tokenValue || '').trim(), }); console.log(`Token saved for context: ${current.name}`); } @@ -68,30 +81,36 @@ function handleStatus(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Authentication Status:"); + console.log('Authentication Status:'); for (const ctx of contexts) { const isCurrent = ctx.name === settings.currentContext; const hasAuth = store.hasValidCredentials(ctx.name); - const marker = isCurrent ? "* " : " "; - const status = hasAuth ? "authenticated" : "no token"; + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; console.log(`${marker}${ctx.name} [${status}]`); } } -async function handleLogout(argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { const current = store.getCurrentContext(); if (!current) { - console.log("No active context."); + console.log('No active context.'); return; } - const confirm = await prompter.prompt(argv, [{ - type: "confirm", - name: "confirm", - message: `Remove credentials for "${current.name}"?`, - default: false - }]); + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); if (!(confirm.confirm as boolean)) { return; } @@ -100,4 +119,4 @@ async function handleLogout(argv: Partial>, prompter: In } else { console.log(`No credentials found for: ${current.name}`); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/context.ts b/sdk/constructive-cli/src/usage/cli/commands/context.ts index 4a297b5ed6..52d12c666b 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/context.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/context.ts @@ -3,70 +3,86 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer, extractFirst } from "inquirerer"; -import { getStore } from "../executor"; -const usage = "\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { if (argv.help || argv.h) { console.log(usage); process.exit(0); } const store = getStore(); - const { - first: subcommand, - newArgv - } = extractFirst(argv); + const { first: subcommand, newArgv } = extractFirst(argv); if (!subcommand) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "subcommand", - message: "What do you want to do?", - options: ["create", "list", "use", "current", "delete"] - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); } return handleSubcommand(subcommand, newArgv, prompter, store); }; -async function handleSubcommand(subcommand: string, argv: Partial>, prompter: Inquirerer, store: ReturnType) { +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { switch (subcommand) { - case "create": + case 'create': return handleCreate(argv, prompter, store); - case "list": + case 'list': return handleList(store); - case "use": + case 'use': return handleUse(argv, prompter, store); - case "current": + case 'current': return handleCurrent(store); - case "delete": + case 'delete': return handleDelete(argv, prompter, store); default: console.log(usage); process.exit(1); } } -async function handleCreate(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name, - newArgv: restArgv - } = extractFirst(argv); - const answers = (await prompter.prompt({ - name, - ...restArgv - }, [{ - type: "text", - name: "name", - message: "Context name", - required: true - }, { - type: "text", - name: "endpoint", - message: "GraphQL endpoint URL", - required: true - }])) as unknown as Record; +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; const contextName = answers.name; const endpoint = answers.endpoint; store.createContext(contextName, { - endpoint: endpoint + endpoint: endpoint, }); const settings = store.loadSettings(); if (!settings.currentContext) { @@ -79,34 +95,38 @@ function handleList(store: ReturnType) { const contexts = store.listContexts(); const settings = store.loadSettings(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } - console.log("Contexts:"); + console.log('Contexts:'); for (const ctx of contexts) { - const marker = ctx.name === settings.currentContext ? "* " : " "; - const authStatus = store.hasValidCredentials(ctx.name) ? "[authenticated]" : "[no token]"; + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; console.log(`${marker}${ctx.name} ${authStatus}`); console.log(` Endpoint: ${ctx.endpoint}`); } } -async function handleUse(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.setCurrentContext(contextName)) { @@ -119,31 +139,35 @@ async function handleUse(argv: Partial>, prompter: Inqui function handleCurrent(store: ReturnType) { const current = store.getCurrentContext(); if (!current) { - console.log("No current context set."); + console.log('No current context set.'); return; } console.log(`Current context: ${current.name}`); console.log(` Endpoint: ${current.endpoint}`); const hasAuth = store.hasValidCredentials(current.name); - console.log(` Auth: ${hasAuth ? "authenticated" : "not authenticated"}`); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); } -async function handleDelete(argv: Partial>, prompter: Inquirerer, store: ReturnType) { - const { - first: name - } = extractFirst(argv); +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); const contexts = store.listContexts(); if (contexts.length === 0) { - console.log("No contexts configured."); + console.log('No contexts configured.'); return; } let contextName = name; if (!contextName) { - const answer = await prompter.prompt(argv, [{ - type: "autocomplete", - name: "name", - message: "Select context to delete", - options: contexts.map(c => c.name) - }]); + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); contextName = answer.name as string; } if (store.deleteContext(contextName)) { @@ -152,4 +176,4 @@ async function handleDelete(argv: Partial>, prompter: In console.error(`Context "${contextName}" not found.`); process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit-aggregate.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit-aggregate.ts index 9cc044b8f9..bc4db432e5 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit-aggregate.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit-aggregate.ts @@ -3,62 +3,76 @@ * @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 { CreateOrgLimitAggregateInput, OrgLimitAggregatePatch, OrgLimitAggregateSelect, OrgLimitAggregateFilter, OrgLimitAggregateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgLimitAggregateInput, + OrgLimitAggregatePatch, + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - entityId: "uuid", - entityType: "string", - id: "uuid", - max: "int", - name: "string", - num: "int", - organizationId: "uuid", - periodCredits: "int", - planMax: "int", - purchasedCredits: "int", - reserved: "int", - softMax: "int", - windowDuration: "string", - windowStart: "string" + entityId: 'uuid', + entityType: 'string', + id: 'uuid', + max: 'int', + name: 'string', + num: 'int', + organizationId: 'uuid', + periodCredits: 'int', + planMax: 'int', + purchasedCredits: 'int', + reserved: 'int', + softMax: 'int', + windowDuration: 'string', + windowStart: 'string', }; -const usage = "\norg-limit-aggregate \n\nCommands:\n list List orgLimitAggregate records\n find-first Find first matching orgLimitAggregate record\n get Get a orgLimitAggregate by ID\n create Create a new orgLimitAggregate\n update Update an existing orgLimitAggregate\n delete Delete a orgLimitAggregate\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) => { +const usage = + '\norg-limit-aggregate \n\nCommands:\n list List orgLimitAggregate records\n find-first Find first matching orgLimitAggregate record\n get Get a orgLimitAggregate by ID\n create Create a new orgLimitAggregate\n update Update an existing orgLimitAggregate\n delete Delete a orgLimitAggregate\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,18 @@ async function handleList(argv: Partial>, _prompter: Inq reserved: true, softMax: true, windowDuration: true, - windowStart: true + windowStart: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgLimitAggregateSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgLimitAggregateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitAggregate.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +129,18 @@ async function handleFindFirst(argv: Partial>, _prompter reserved: true, softMax: true, windowDuration: true, - windowStart: true + windowStart: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgLimitAggregateSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgLimitAggregateSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitAggregate.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +149,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgLimitAggregate.findOne({ - id: answers.id as string, - select: { - entityId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - reserved: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.orgLimitAggregate + .findOne({ + id: answers.id as string, + select: { + entityId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + reserved: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,123 +190,142 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "num", - message: "num", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "periodCredits", - message: "periodCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planMax", - message: "planMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "purchasedCredits", - message: "purchasedCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "reserved", - message: "reserved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowDuration", - message: "windowDuration", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowStart", - message: "windowStart", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'num', + message: 'num', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'periodCredits', + message: 'periodCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planMax', + message: 'planMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'purchasedCredits', + message: 'purchasedCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'reserved', + message: 'reserved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowDuration', + message: 'windowDuration', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowStart', + message: 'windowStart', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitAggregateInput["orgLimitAggregate"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgLimitAggregateInput['orgLimitAggregate']; const client = getClient(); - const result = await client.orgLimitAggregate.create({ - data: { - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - max: cleanedData.max, - name: cleanedData.name, - num: cleanedData.num, - organizationId: cleanedData.organizationId, - periodCredits: cleanedData.periodCredits, - planMax: cleanedData.planMax, - purchasedCredits: cleanedData.purchasedCredits, - reserved: cleanedData.reserved, - softMax: cleanedData.softMax, - windowDuration: cleanedData.windowDuration, - windowStart: cleanedData.windowStart - }, - select: { - entityId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - reserved: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.orgLimitAggregate + .create({ + data: { + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + max: cleanedData.max, + name: cleanedData.name, + num: cleanedData.num, + organizationId: cleanedData.organizationId, + periodCredits: cleanedData.periodCredits, + planMax: cleanedData.planMax, + purchasedCredits: cleanedData.purchasedCredits, + reserved: cleanedData.reserved, + softMax: cleanedData.softMax, + windowDuration: cleanedData.windowDuration, + windowStart: cleanedData.windowStart, + }, + select: { + entityId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + reserved: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -293,131 +334,148 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "num", - message: "num", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "periodCredits", - message: "periodCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planMax", - message: "planMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "purchasedCredits", - message: "purchasedCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "reserved", - message: "reserved", - required: false, - skipPrompt: true - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowDuration", - message: "windowDuration", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowStart", - message: "windowStart", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'num', + message: 'num', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'periodCredits', + message: 'periodCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planMax', + message: 'planMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'purchasedCredits', + message: 'purchasedCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'reserved', + message: 'reserved', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowDuration', + message: 'windowDuration', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowStart', + message: 'windowStart', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgLimitAggregatePatch; const client = getClient(); - const result = await client.orgLimitAggregate.update({ - where: { - id: answers.id as string - }, - data: { - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - max: cleanedData.max, - name: cleanedData.name, - num: cleanedData.num, - organizationId: cleanedData.organizationId, - periodCredits: cleanedData.periodCredits, - planMax: cleanedData.planMax, - purchasedCredits: cleanedData.purchasedCredits, - reserved: cleanedData.reserved, - softMax: cleanedData.softMax, - windowDuration: cleanedData.windowDuration, - windowStart: cleanedData.windowStart - }, - select: { - entityId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - reserved: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.orgLimitAggregate + .update({ + where: { + id: answers.id as string, + }, + data: { + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + max: cleanedData.max, + name: cleanedData.name, + num: cleanedData.num, + organizationId: cleanedData.organizationId, + periodCredits: cleanedData.periodCredits, + planMax: cleanedData.planMax, + purchasedCredits: cleanedData.purchasedCredits, + reserved: cleanedData.reserved, + softMax: cleanedData.softMax, + windowDuration: cleanedData.windowDuration, + windowStart: cleanedData.windowStart, + }, + select: { + entityId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + reserved: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -426,28 +484,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgLimitAggregate.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgLimitAggregate + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit-cap.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit-cap.ts index cc196f5e46..eb520b503f 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit-cap.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit-cap.ts @@ -3,52 +3,66 @@ * @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 { CreateOrgLimitCapInput, OrgLimitCapPatch, OrgLimitCapSelect, OrgLimitCapFilter, OrgLimitCapOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgLimitCapInput, + OrgLimitCapPatch, + OrgLimitCapSelect, + OrgLimitCapFilter, + OrgLimitCapOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - entityId: "uuid", - id: "uuid", - max: "int", - name: "string" + entityId: 'uuid', + id: 'uuid', + max: 'int', + name: 'string', }; -const usage = "\norg-limit-cap \n\nCommands:\n list List orgLimitCap records\n find-first Find first matching orgLimitCap record\n get Get a orgLimitCap by ID\n create Create a new orgLimitCap\n update Update an existing orgLimitCap\n delete Delete a orgLimitCap\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) => { +const usage = + '\norg-limit-cap \n\nCommands:\n list List orgLimitCap records\n find-first Find first matching orgLimitCap record\n get Get a orgLimitCap by ID\n create Create a new orgLimitCap\n update Update an existing orgLimitCap\n delete Delete a orgLimitCap\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -61,16 +75,18 @@ async function handleList(argv: Partial>, _prompter: Inq entityId: true, id: true, max: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgLimitCapSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgLimitCapSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitCap.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -83,16 +99,18 @@ async function handleFindFirst(argv: Partial>, _prompter entityId: true, id: true, max: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgLimitCapSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgLimitCapSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitCap.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -101,25 +119,29 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgLimitCap.findOne({ - id: answers.id as string, - select: { - entityId: true, - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.orgLimitCap + .findOne({ + id: answers.id as string, + select: { + entityId: true, + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -128,42 +150,51 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitCapInput["orgLimitCap"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgLimitCapInput['orgLimitCap']; const client = getClient(); - const result = await client.orgLimitCap.create({ - data: { - entityId: cleanedData.entityId, - max: cleanedData.max, - name: cleanedData.name - }, - select: { - entityId: true, - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.orgLimitCap + .create({ + data: { + entityId: cleanedData.entityId, + max: cleanedData.max, + name: cleanedData.name, + }, + select: { + entityId: true, + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -172,50 +203,57 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgLimitCapPatch; const client = getClient(); - const result = await client.orgLimitCap.update({ - where: { - id: answers.id as string - }, - data: { - entityId: cleanedData.entityId, - max: cleanedData.max, - name: cleanedData.name - }, - select: { - entityId: true, - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.orgLimitCap + .update({ + where: { + id: answers.id as string, + }, + data: { + entityId: cleanedData.entityId, + max: cleanedData.max, + name: cleanedData.name, + }, + select: { + entityId: true, + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -224,28 +262,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgLimitCap.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgLimitCap + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit-caps-default.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit-caps-default.ts index a983f15bcd..bb3bed97af 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit-caps-default.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit-caps-default.ts @@ -3,51 +3,65 @@ * @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 { CreateOrgLimitCapsDefaultInput, OrgLimitCapsDefaultPatch, OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultFilter, OrgLimitCapsDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgLimitCapsDefaultInput, + OrgLimitCapsDefaultPatch, + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - id: "uuid", - max: "int", - name: "string" + id: 'uuid', + max: 'int', + name: 'string', }; -const usage = "\norg-limit-caps-default \n\nCommands:\n list List orgLimitCapsDefault records\n find-first Find first matching orgLimitCapsDefault record\n get Get a orgLimitCapsDefault by ID\n create Create a new orgLimitCapsDefault\n update Update an existing orgLimitCapsDefault\n delete Delete a orgLimitCapsDefault\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) => { +const usage = + '\norg-limit-caps-default \n\nCommands:\n list List orgLimitCapsDefault records\n find-first Find first matching orgLimitCapsDefault record\n get Get a orgLimitCapsDefault by ID\n create Create a new orgLimitCapsDefault\n update Update an existing orgLimitCapsDefault\n delete Delete a orgLimitCapsDefault\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -59,16 +73,22 @@ async function handleList(argv: Partial>, _prompter: Inq const defaultSelect = { id: true, max: true, - name: true + name: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgLimitCapsDefaultSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs< + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy + > & { + select: OrgLimitCapsDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitCapsDefault.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -80,16 +100,22 @@ async function handleFindFirst(argv: Partial>, _prompter const defaultSelect = { id: true, max: true, - name: true + name: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgLimitCapsDefaultSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy + > & { + select: OrgLimitCapsDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitCapsDefault.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -98,24 +124,28 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgLimitCapsDefault.findOne({ - id: answers.id as string, - select: { - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.orgLimitCapsDefault + .findOne({ + id: answers.id as string, + select: { + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -124,35 +154,43 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitCapsDefaultInput["orgLimitCapsDefault"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgLimitCapsDefaultInput['orgLimitCapsDefault']; const client = getClient(); - const result = await client.orgLimitCapsDefault.create({ - data: { - max: cleanedData.max, - name: cleanedData.name - }, - select: { - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.orgLimitCapsDefault + .create({ + data: { + max: cleanedData.max, + name: cleanedData.name, + }, + select: { + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -161,43 +199,49 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgLimitCapsDefaultPatch; const client = getClient(); - const result = await client.orgLimitCapsDefault.update({ - where: { - id: answers.id as string - }, - data: { - max: cleanedData.max, - name: cleanedData.name - }, - select: { - id: true, - max: true, - name: true - } - }).execute(); + const result = await client.orgLimitCapsDefault + .update({ + where: { + id: answers.id as string, + }, + data: { + max: cleanedData.max, + name: cleanedData.name, + }, + select: { + id: true, + max: true, + name: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -206,28 +250,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgLimitCapsDefault.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgLimitCapsDefault + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit-credit.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit-credit.ts index e2aa6301f0..6e07bff8ea 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit-credit.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit-credit.ts @@ -3,57 +3,71 @@ * @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 { CreateOrgLimitCreditInput, OrgLimitCreditPatch, OrgLimitCreditSelect, OrgLimitCreditFilter, OrgLimitCreditOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgLimitCreditInput, + OrgLimitCreditPatch, + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - amount: "int", - creditType: "string", - defaultLimitId: "uuid", - entityId: "uuid", - entityType: "string", - id: "uuid", - organizationId: "uuid", - reason: "string" + actorId: 'uuid', + amount: 'int', + creditType: 'string', + defaultLimitId: 'uuid', + entityId: 'uuid', + entityType: 'string', + id: 'uuid', + organizationId: 'uuid', + reason: 'string', }; -const usage = "\norg-limit-credit \n\nCommands:\n list List orgLimitCredit records\n find-first Find first matching orgLimitCredit record\n get Get a orgLimitCredit by ID\n create Create a new orgLimitCredit\n update Update an existing orgLimitCredit\n delete Delete a orgLimitCredit\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) => { +const usage = + '\norg-limit-credit \n\nCommands:\n list List orgLimitCredit records\n find-first Find first matching orgLimitCredit record\n get Get a orgLimitCredit by ID\n create Create a new orgLimitCredit\n update Update an existing orgLimitCredit\n delete Delete a orgLimitCredit\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -71,16 +85,18 @@ async function handleList(argv: Partial>, _prompter: Inq entityType: true, id: true, organizationId: true, - reason: true + reason: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgLimitCreditSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgLimitCreditSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitCredit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -98,16 +114,18 @@ async function handleFindFirst(argv: Partial>, _prompter entityType: true, id: true, organizationId: true, - reason: true + reason: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgLimitCreditSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgLimitCreditSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitCredit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -116,30 +134,34 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgLimitCredit.findOne({ - id: answers.id as string, - select: { - actorId: true, - amount: true, - creditType: true, - defaultLimitId: true, - entityId: true, - entityType: true, - id: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.orgLimitCredit + .findOne({ + id: answers.id as string, + select: { + actorId: true, + amount: true, + creditType: true, + defaultLimitId: true, + entityId: true, + entityType: true, + id: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -148,82 +170,96 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "amount", - message: "amount", - required: true - }, { - type: "text", - name: "creditType", - message: "creditType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultLimitId", - message: "defaultLimitId", - required: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "reason", - message: "reason", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'amount', + message: 'amount', + required: true, + }, + { + type: 'text', + name: 'creditType', + message: 'creditType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultLimitId', + message: 'defaultLimitId', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'reason', + message: 'reason', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitCreditInput["orgLimitCredit"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgLimitCreditInput['orgLimitCredit']; const client = getClient(); - const result = await client.orgLimitCredit.create({ - data: { - actorId: cleanedData.actorId, - amount: cleanedData.amount, - creditType: cleanedData.creditType, - defaultLimitId: cleanedData.defaultLimitId, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - organizationId: cleanedData.organizationId, - reason: cleanedData.reason - }, - select: { - actorId: true, - amount: true, - creditType: true, - defaultLimitId: true, - entityId: true, - entityType: true, - id: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.orgLimitCredit + .create({ + data: { + actorId: cleanedData.actorId, + amount: cleanedData.amount, + creditType: cleanedData.creditType, + defaultLimitId: cleanedData.defaultLimitId, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + organizationId: cleanedData.organizationId, + reason: cleanedData.reason, + }, + select: { + actorId: true, + amount: true, + creditType: true, + defaultLimitId: true, + entityId: true, + entityType: true, + id: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -232,90 +268,102 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "amount", - message: "amount", - required: false - }, { - type: "text", - name: "creditType", - message: "creditType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "defaultLimitId", - message: "defaultLimitId", - required: false - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "reason", - message: "reason", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'amount', + message: 'amount', + required: false, + }, + { + type: 'text', + name: 'creditType', + message: 'creditType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultLimitId', + message: 'defaultLimitId', + required: false, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'reason', + message: 'reason', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgLimitCreditPatch; const client = getClient(); - const result = await client.orgLimitCredit.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - amount: cleanedData.amount, - creditType: cleanedData.creditType, - defaultLimitId: cleanedData.defaultLimitId, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - organizationId: cleanedData.organizationId, - reason: cleanedData.reason - }, - select: { - actorId: true, - amount: true, - creditType: true, - defaultLimitId: true, - entityId: true, - entityType: true, - id: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.orgLimitCredit + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + amount: cleanedData.amount, + creditType: cleanedData.creditType, + defaultLimitId: cleanedData.defaultLimitId, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + organizationId: cleanedData.organizationId, + reason: cleanedData.reason, + }, + select: { + actorId: true, + amount: true, + creditType: true, + defaultLimitId: true, + entityId: true, + entityType: true, + id: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -324,28 +372,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgLimitCredit.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgLimitCredit + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit-default.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit-default.ts index 8084c7f3ef..479b6a591c 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit-default.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit-default.ts @@ -3,52 +3,66 @@ * @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 { CreateOrgLimitDefaultInput, OrgLimitDefaultPatch, OrgLimitDefaultSelect, OrgLimitDefaultFilter, OrgLimitDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgLimitDefaultInput, + OrgLimitDefaultPatch, + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - id: "uuid", - max: "int", - name: "string", - softMax: "int" + id: 'uuid', + max: 'int', + name: 'string', + softMax: 'int', }; -const usage = "\norg-limit-default \n\nCommands:\n list List orgLimitDefault records\n find-first Find first matching orgLimitDefault record\n get Get a orgLimitDefault by ID\n create Create a new orgLimitDefault\n update Update an existing orgLimitDefault\n delete Delete a orgLimitDefault\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) => { +const usage = + '\norg-limit-default \n\nCommands:\n list List orgLimitDefault records\n find-first Find first matching orgLimitDefault record\n get Get a orgLimitDefault by ID\n create Create a new orgLimitDefault\n update Update an existing orgLimitDefault\n delete Delete a orgLimitDefault\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -61,16 +75,18 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, max: true, name: true, - softMax: true + softMax: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgLimitDefaultSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgLimitDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitDefault.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -83,16 +99,18 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, max: true, name: true, - softMax: true + softMax: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgLimitDefaultSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgLimitDefaultSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitDefault.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -101,25 +119,29 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgLimitDefault.findOne({ - id: answers.id as string, - select: { - id: true, - max: true, - name: true, - softMax: true - } - }).execute(); + const result = await client.orgLimitDefault + .findOne({ + id: answers.id as string, + select: { + id: true, + max: true, + name: true, + softMax: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -128,43 +150,52 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitDefaultInput["orgLimitDefault"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgLimitDefaultInput['orgLimitDefault']; const client = getClient(); - const result = await client.orgLimitDefault.create({ - data: { - max: cleanedData.max, - name: cleanedData.name, - softMax: cleanedData.softMax - }, - select: { - id: true, - max: true, - name: true, - softMax: true - } - }).execute(); + const result = await client.orgLimitDefault + .create({ + data: { + max: cleanedData.max, + name: cleanedData.name, + softMax: cleanedData.softMax, + }, + select: { + id: true, + max: true, + name: true, + softMax: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -173,51 +204,58 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgLimitDefaultPatch; const client = getClient(); - const result = await client.orgLimitDefault.update({ - where: { - id: answers.id as string - }, - data: { - max: cleanedData.max, - name: cleanedData.name, - softMax: cleanedData.softMax - }, - select: { - id: true, - max: true, - name: true, - softMax: true - } - }).execute(); + const result = await client.orgLimitDefault + .update({ + where: { + id: answers.id as string, + }, + data: { + max: cleanedData.max, + name: cleanedData.name, + softMax: cleanedData.softMax, + }, + select: { + id: true, + max: true, + name: true, + softMax: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -226,28 +264,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgLimitDefault.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgLimitDefault + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit-event.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit-event.ts index f2009e4ec9..328c636b3a 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit-event.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit-event.ts @@ -3,61 +3,75 @@ * @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 { CreateOrgLimitEventInput, OrgLimitEventPatch, OrgLimitEventSelect, OrgLimitEventFilter, OrgLimitEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgLimitEventInput, + OrgLimitEventPatch, + OrgLimitEventSelect, + OrgLimitEventFilter, + OrgLimitEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - createdAt: "string", - delta: "int", - entityId: "uuid", - entityType: "string", - eventType: "string", - id: "uuid", - maxAtEvent: "int", - name: "string", - numAfter: "int", - numBefore: "int", - organizationId: "uuid", - reason: "string" + actorId: 'uuid', + createdAt: 'string', + delta: 'int', + entityId: 'uuid', + entityType: 'string', + eventType: 'string', + id: 'uuid', + maxAtEvent: 'int', + name: 'string', + numAfter: 'int', + numBefore: 'int', + organizationId: 'uuid', + reason: 'string', }; -const usage = "\norg-limit-event \n\nCommands:\n list List orgLimitEvent records\n find-first Find first matching orgLimitEvent record\n get Get a orgLimitEvent by ID\n create Create a new orgLimitEvent\n update Update an existing orgLimitEvent\n delete Delete a orgLimitEvent\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) => { +const usage = + '\norg-limit-event \n\nCommands:\n list List orgLimitEvent records\n find-first Find first matching orgLimitEvent record\n get Get a orgLimitEvent by ID\n create Create a new orgLimitEvent\n update Update an existing orgLimitEvent\n delete Delete a orgLimitEvent\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -79,16 +93,18 @@ async function handleList(argv: Partial>, _prompter: Inq numAfter: true, numBefore: true, organizationId: true, - reason: true + reason: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgLimitEventSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgLimitEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitEvent.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -110,16 +126,18 @@ async function handleFindFirst(argv: Partial>, _prompter numAfter: true, numBefore: true, organizationId: true, - reason: true + reason: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgLimitEventSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgLimitEventSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitEvent.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -128,34 +146,38 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgLimitEvent.findOne({ - id: answers.id as string, - select: { - actorId: true, - createdAt: true, - delta: true, - entityId: true, - entityType: true, - eventType: true, - id: true, - maxAtEvent: true, - name: true, - numAfter: true, - numBefore: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.orgLimitEvent + .findOne({ + id: answers.id as string, + select: { + actorId: true, + createdAt: true, + delta: true, + entityId: true, + entityType: true, + eventType: true, + id: true, + maxAtEvent: true, + name: true, + numAfter: true, + numBefore: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -164,109 +186,126 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "delta", - message: "delta", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxAtEvent", - message: "maxAtEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "numAfter", - message: "numAfter", - required: false, - skipPrompt: true - }, { - type: "text", - name: "numBefore", - message: "numBefore", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "reason", - message: "reason", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'delta', + message: 'delta', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAtEvent', + message: 'maxAtEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'numAfter', + message: 'numAfter', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'numBefore', + message: 'numBefore', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'reason', + message: 'reason', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitEventInput["orgLimitEvent"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgLimitEventInput['orgLimitEvent']; const client = getClient(); - const result = await client.orgLimitEvent.create({ - data: { - actorId: cleanedData.actorId, - delta: cleanedData.delta, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - eventType: cleanedData.eventType, - maxAtEvent: cleanedData.maxAtEvent, - name: cleanedData.name, - numAfter: cleanedData.numAfter, - numBefore: cleanedData.numBefore, - organizationId: cleanedData.organizationId, - reason: cleanedData.reason - }, - select: { - actorId: true, - createdAt: true, - delta: true, - entityId: true, - entityType: true, - eventType: true, - id: true, - maxAtEvent: true, - name: true, - numAfter: true, - numBefore: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.orgLimitEvent + .create({ + data: { + actorId: cleanedData.actorId, + delta: cleanedData.delta, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + eventType: cleanedData.eventType, + maxAtEvent: cleanedData.maxAtEvent, + name: cleanedData.name, + numAfter: cleanedData.numAfter, + numBefore: cleanedData.numBefore, + organizationId: cleanedData.organizationId, + reason: cleanedData.reason, + }, + select: { + actorId: true, + createdAt: true, + delta: true, + entityId: true, + entityType: true, + eventType: true, + id: true, + maxAtEvent: true, + name: true, + numAfter: true, + numBefore: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -275,123 +314,139 @@ async function handleCreate(argv: Partial>, prompter: In } async function handleUpdate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }, { - type: "text", - name: "actorId", - message: "actorId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "delta", - message: "delta", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "eventType", - message: "eventType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "maxAtEvent", - message: "maxAtEvent", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "numAfter", - message: "numAfter", - required: false, - skipPrompt: true - }, { - type: "text", - name: "numBefore", - message: "numBefore", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "reason", - message: "reason", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'delta', + message: 'delta', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAtEvent', + message: 'maxAtEvent', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'numAfter', + message: 'numAfter', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'numBefore', + message: 'numBefore', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'reason', + message: 'reason', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgLimitEventPatch; const client = getClient(); - const result = await client.orgLimitEvent.update({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - data: { - actorId: cleanedData.actorId, - delta: cleanedData.delta, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - eventType: cleanedData.eventType, - maxAtEvent: cleanedData.maxAtEvent, - name: cleanedData.name, - numAfter: cleanedData.numAfter, - numBefore: cleanedData.numBefore, - organizationId: cleanedData.organizationId, - reason: cleanedData.reason - }, - select: { - actorId: true, - createdAt: true, - delta: true, - entityId: true, - entityType: true, - eventType: true, - id: true, - maxAtEvent: true, - name: true, - numAfter: true, - numBefore: true, - organizationId: true, - reason: true - } - }).execute(); + const result = await client.orgLimitEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + delta: cleanedData.delta, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + eventType: cleanedData.eventType, + maxAtEvent: cleanedData.maxAtEvent, + name: cleanedData.name, + numAfter: cleanedData.numAfter, + numBefore: cleanedData.numBefore, + organizationId: cleanedData.organizationId, + reason: cleanedData.reason, + }, + select: { + actorId: true, + createdAt: true, + delta: true, + entityId: true, + entityType: true, + eventType: true, + id: true, + maxAtEvent: true, + name: true, + numAfter: true, + numBefore: true, + organizationId: true, + reason: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -400,34 +455,39 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }, { - type: "text", - name: "createdAt", - message: "createdAt", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); - const result = await client.orgLimitEvent.delete({ - where: { - id: answers.id as string, - createdAt: answers.createdAt as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgLimitEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to delete record."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit-warning.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit-warning.ts index 65db63ec42..1a887b4ee3 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit-warning.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit-warning.ts @@ -3,54 +3,68 @@ * @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 { CreateOrgLimitWarningInput, OrgLimitWarningPatch, OrgLimitWarningSelect, OrgLimitWarningFilter, OrgLimitWarningOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgLimitWarningInput, + OrgLimitWarningPatch, + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - entityId: "uuid", - id: "uuid", - name: "string", - taskIdentifier: "string", - thresholdValue: "int", - warningType: "string" + entityId: 'uuid', + id: 'uuid', + name: 'string', + taskIdentifier: 'string', + thresholdValue: 'int', + warningType: 'string', }; -const usage = "\norg-limit-warning \n\nCommands:\n list List orgLimitWarning records\n find-first Find first matching orgLimitWarning record\n get Get a orgLimitWarning by ID\n create Create a new orgLimitWarning\n update Update an existing orgLimitWarning\n delete Delete a orgLimitWarning\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) => { +const usage = + '\norg-limit-warning \n\nCommands:\n list List orgLimitWarning records\n find-first Find first matching orgLimitWarning record\n get Get a orgLimitWarning by ID\n create Create a new orgLimitWarning\n update Update an existing orgLimitWarning\n delete Delete a orgLimitWarning\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -65,16 +79,18 @@ async function handleList(argv: Partial>, _prompter: Inq name: true, taskIdentifier: true, thresholdValue: true, - warningType: true + warningType: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgLimitWarningSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgLimitWarningSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitWarning.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -89,16 +105,18 @@ async function handleFindFirst(argv: Partial>, _prompter name: true, taskIdentifier: true, thresholdValue: true, - warningType: true + warningType: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgLimitWarningSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgLimitWarningSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimitWarning.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -107,27 +125,31 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgLimitWarning.findOne({ - id: answers.id as string, - select: { - entityId: true, - id: true, - name: true, - taskIdentifier: true, - thresholdValue: true, - warningType: true - } - }).execute(); + const result = await client.orgLimitWarning + .findOne({ + id: answers.id as string, + select: { + entityId: true, + id: true, + name: true, + taskIdentifier: true, + thresholdValue: true, + warningType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -136,56 +158,67 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: true - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: true - }, { - type: "text", - name: "thresholdValue", - message: "thresholdValue", - required: true - }, { - type: "text", - name: "warningType", - message: "warningType", - required: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + { + type: 'text', + name: 'thresholdValue', + message: 'thresholdValue', + required: true, + }, + { + type: 'text', + name: 'warningType', + message: 'warningType', + required: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitWarningInput["orgLimitWarning"]; + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgLimitWarningInput['orgLimitWarning']; const client = getClient(); - const result = await client.orgLimitWarning.create({ - data: { - entityId: cleanedData.entityId, - name: cleanedData.name, - taskIdentifier: cleanedData.taskIdentifier, - thresholdValue: cleanedData.thresholdValue, - warningType: cleanedData.warningType - }, - select: { - entityId: true, - id: true, - name: true, - taskIdentifier: true, - thresholdValue: true, - warningType: true - } - }).execute(); + const result = await client.orgLimitWarning + .create({ + data: { + entityId: cleanedData.entityId, + name: cleanedData.name, + taskIdentifier: cleanedData.taskIdentifier, + thresholdValue: cleanedData.thresholdValue, + warningType: cleanedData.warningType, + }, + select: { + entityId: true, + id: true, + name: true, + taskIdentifier: true, + thresholdValue: true, + warningType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -194,64 +227,73 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "entityId", - message: "entityId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false - }, { - type: "text", - name: "taskIdentifier", - message: "taskIdentifier", - required: false - }, { - type: "text", - name: "thresholdValue", - message: "thresholdValue", - required: false - }, { - type: "text", - name: "warningType", - message: "warningType", - required: false - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + { + type: 'text', + name: 'thresholdValue', + message: 'thresholdValue', + required: false, + }, + { + type: 'text', + name: 'warningType', + message: 'warningType', + required: false, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgLimitWarningPatch; const client = getClient(); - const result = await client.orgLimitWarning.update({ - where: { - id: answers.id as string - }, - data: { - entityId: cleanedData.entityId, - name: cleanedData.name, - taskIdentifier: cleanedData.taskIdentifier, - thresholdValue: cleanedData.thresholdValue, - warningType: cleanedData.warningType - }, - select: { - entityId: true, - id: true, - name: true, - taskIdentifier: true, - thresholdValue: true, - warningType: true - } - }).execute(); + const result = await client.orgLimitWarning + .update({ + where: { + id: answers.id as string, + }, + data: { + entityId: cleanedData.entityId, + name: cleanedData.name, + taskIdentifier: cleanedData.taskIdentifier, + thresholdValue: cleanedData.thresholdValue, + warningType: cleanedData.warningType, + }, + select: { + entityId: true, + id: true, + name: true, + taskIdentifier: true, + thresholdValue: true, + warningType: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -260,28 +302,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgLimitWarning.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgLimitWarning + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit.ts index 5821c840bf..8228a96920 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit.ts @@ -3,62 +3,76 @@ * @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 { CreateOrgLimitInput, OrgLimitPatch, OrgLimitSelect, OrgLimitFilter, OrgLimitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, FindFirstArgs } from "../../orm/select-types"; +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgLimitInput, + OrgLimitPatch, + OrgLimitSelect, + OrgLimitFilter, + OrgLimitOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; const fieldSchema: FieldSchema = { - actorId: "uuid", - entityId: "uuid", - entityType: "string", - id: "uuid", - max: "int", - name: "string", - num: "int", - organizationId: "uuid", - periodCredits: "int", - planMax: "int", - purchasedCredits: "int", - softMax: "int", - windowDuration: "string", - windowStart: "string" + actorId: 'uuid', + entityId: 'uuid', + entityType: 'string', + id: 'uuid', + max: 'int', + name: 'string', + num: 'int', + organizationId: 'uuid', + periodCredits: 'int', + planMax: 'int', + purchasedCredits: 'int', + softMax: 'int', + windowDuration: 'string', + windowStart: 'string', }; -const usage = "\norg-limit \n\nCommands:\n list List orgLimit records\n find-first Find first matching orgLimit record\n get Get a orgLimit by ID\n create Create a new orgLimit\n update Update an existing orgLimit\n delete Delete a orgLimit\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) => { +const usage = + '\norg-limit \n\nCommands:\n list List orgLimit records\n find-first Find first matching orgLimit record\n get Get a orgLimit by ID\n create Create a new orgLimit\n update Update an existing orgLimit\n delete Delete a orgLimit\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); + 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"] - }]); + 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) { +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { switch (subcommand) { - case "list": + case 'list': return handleList(argv, prompter); - case "find-first": + case 'find-first': return handleFindFirst(argv, prompter); - case "get": + case 'get': return handleGet(argv, prompter); - case "create": + case 'create': return handleCreate(argv, prompter); - case "update": + case 'update': return handleUpdate(argv, prompter); - case "delete": + case 'delete': return handleDelete(argv, prompter); default: console.log(usage); @@ -81,16 +95,18 @@ async function handleList(argv: Partial>, _prompter: Inq purchasedCredits: true, softMax: true, windowDuration: true, - windowStart: true + windowStart: true, }; - const findManyArgs = parseFindManyArgs & { - select: OrgLimitSelect; - }>(argv, defaultSelect); + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgLimitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimit.findMany(findManyArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to list records."); + console.error('Failed to list records.'); if (error instanceof Error) { console.error(error.message); } @@ -113,16 +129,18 @@ async function handleFindFirst(argv: Partial>, _prompter purchasedCredits: true, softMax: true, windowDuration: true, - windowStart: true + windowStart: true, }; - const findFirstArgs = parseFindFirstArgs & { - select: OrgLimitSelect; - }>(argv, defaultSelect); + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgLimitSelect; + } + >(argv, defaultSelect); const client = getClient(); const result = await client.orgLimit.findFirst(findFirstArgs).execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to find record."); + console.error('Failed to find record.'); if (error instanceof Error) { console.error(error.message); } @@ -131,35 +149,39 @@ async function handleFindFirst(argv: Partial>, _prompter } async function handleGet(argv: Partial>, prompter: Inquirerer) { try { - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); const client = getClient(); - const result = await client.orgLimit.findOne({ - id: answers.id as string, - select: { - actorId: true, - entityId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.orgLimit + .findOne({ + id: answers.id as string, + select: { + actorId: true, + entityId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Record not found."); + console.error('Record not found.'); if (error instanceof Error) { console.error(error.message); } @@ -168,122 +190,138 @@ async function handleGet(argv: Partial>, prompter: Inqui } async function handleCreate(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "actorId", - message: "actorId", - required: true - }, { - type: "text", - name: "entityId", - message: "entityId", - required: true - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "num", - message: "num", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "periodCredits", - message: "periodCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planMax", - message: "planMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "purchasedCredits", - message: "purchasedCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowDuration", - message: "windowDuration", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowStart", - message: "windowStart", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'num', + message: 'num', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'periodCredits', + message: 'periodCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planMax', + message: 'planMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'purchasedCredits', + message: 'purchasedCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowDuration', + message: 'windowDuration', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowStart', + message: 'windowStart', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); - const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitInput["orgLimit"]; + const cleanedData = stripUndefined(answers, fieldSchema) as CreateOrgLimitInput['orgLimit']; const client = getClient(); - const result = await client.orgLimit.create({ - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - max: cleanedData.max, - name: cleanedData.name, - num: cleanedData.num, - organizationId: cleanedData.organizationId, - periodCredits: cleanedData.periodCredits, - planMax: cleanedData.planMax, - purchasedCredits: cleanedData.purchasedCredits, - softMax: cleanedData.softMax, - windowDuration: cleanedData.windowDuration, - windowStart: cleanedData.windowStart - }, - select: { - actorId: true, - entityId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.orgLimit + .create({ + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + max: cleanedData.max, + name: cleanedData.name, + num: cleanedData.num, + organizationId: cleanedData.organizationId, + periodCredits: cleanedData.periodCredits, + planMax: cleanedData.planMax, + purchasedCredits: cleanedData.purchasedCredits, + softMax: cleanedData.softMax, + windowDuration: cleanedData.windowDuration, + windowStart: cleanedData.windowStart, + }, + select: { + actorId: true, + entityId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to create record."); + console.error('Failed to create record.'); if (error instanceof Error) { console.error(error.message); } @@ -292,130 +330,147 @@ async function handleCreate(argv: Partial>, prompter: In } 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: "actorId", - message: "actorId", - required: false - }, { - type: "text", - name: "entityId", - message: "entityId", - required: false - }, { - type: "text", - name: "entityType", - message: "entityType", - required: false, - skipPrompt: true - }, { - type: "text", - name: "max", - message: "max", - required: false, - skipPrompt: true - }, { - type: "text", - name: "name", - message: "name", - required: false, - skipPrompt: true - }, { - type: "text", - name: "num", - message: "num", - required: false, - skipPrompt: true - }, { - type: "text", - name: "organizationId", - message: "organizationId", - required: false, - skipPrompt: true - }, { - type: "text", - name: "periodCredits", - message: "periodCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "planMax", - message: "planMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "purchasedCredits", - message: "purchasedCredits", - required: false, - skipPrompt: true - }, { - type: "text", - name: "softMax", - message: "softMax", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowDuration", - message: "windowDuration", - required: false, - skipPrompt: true - }, { - type: "text", - name: "windowStart", - message: "windowStart", - required: false, - skipPrompt: true - }]); + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'entityType', + message: 'entityType', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'max', + message: 'max', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'num', + message: 'num', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'organizationId', + message: 'organizationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'periodCredits', + message: 'periodCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'planMax', + message: 'planMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'purchasedCredits', + message: 'purchasedCredits', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'softMax', + message: 'softMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowDuration', + message: 'windowDuration', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'windowStart', + message: 'windowStart', + required: false, + skipPrompt: true, + }, + ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as OrgLimitPatch; const client = getClient(); - const result = await client.orgLimit.update({ - where: { - id: answers.id as string - }, - data: { - actorId: cleanedData.actorId, - entityId: cleanedData.entityId, - entityType: cleanedData.entityType, - max: cleanedData.max, - name: cleanedData.name, - num: cleanedData.num, - organizationId: cleanedData.organizationId, - periodCredits: cleanedData.periodCredits, - planMax: cleanedData.planMax, - purchasedCredits: cleanedData.purchasedCredits, - softMax: cleanedData.softMax, - windowDuration: cleanedData.windowDuration, - windowStart: cleanedData.windowStart - }, - select: { - actorId: true, - entityId: true, - entityType: true, - id: true, - max: true, - name: true, - num: true, - organizationId: true, - periodCredits: true, - planMax: true, - purchasedCredits: true, - softMax: true, - windowDuration: true, - windowStart: true - } - }).execute(); + const result = await client.orgLimit + .update({ + where: { + id: answers.id as string, + }, + data: { + actorId: cleanedData.actorId, + entityId: cleanedData.entityId, + entityType: cleanedData.entityType, + max: cleanedData.max, + name: cleanedData.name, + num: cleanedData.num, + organizationId: cleanedData.organizationId, + periodCredits: cleanedData.periodCredits, + planMax: cleanedData.planMax, + purchasedCredits: cleanedData.purchasedCredits, + softMax: cleanedData.softMax, + windowDuration: cleanedData.windowDuration, + windowStart: cleanedData.windowStart, + }, + select: { + actorId: true, + entityId: true, + entityType: true, + id: true, + max: true, + name: true, + num: true, + organizationId: true, + periodCredits: true, + planMax: true, + purchasedCredits: true, + softMax: true, + windowDuration: true, + windowStart: true, + }, + }) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed to update record."); + console.error('Failed to update record.'); if (error instanceof Error) { console.error(error.message); } @@ -424,28 +479,32 @@ async function handleUpdate(argv: Partial>, prompter: In } async function handleDelete(argv: Partial>, prompter: Inquirerer) { try { - const rawAnswers = await prompter.prompt(argv, [{ - type: "text", - name: "id", - message: "id", - required: true - }]); + 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.orgLimit.delete({ - where: { - id: answers.id as string - }, - select: { - id: true - } - }).execute(); + const result = await client.orgLimit + .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."); + console.error('Failed to delete record.'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/usage/cli/commands/provision-bucket.ts index 0e3df91ed6..ecd2e539d5 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/provision-bucket.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/provision-bucket.ts @@ -3,37 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { CLIOptions, Inquirerer } from "inquirerer"; -import { getClient } from "../executor"; -import { unflattenDotNotation, buildSelectFromPaths } from "../utils"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n"); + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); process.exit(0); } - const answers = await prompter.prompt(argv, [{ - type: "text", - name: "input", - message: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.", - required: true - }]); + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); const client = getClient(); const parsedAnswers = unflattenDotNotation(answers); - const selectFields = buildSelectFromPaths(argv.select as string ?? "clientMutationId"); - const result = await client.mutation.provisionBucket(parsedAnswers as unknown as ProvisionBucketVariables, { - select: selectFields - } as unknown as { - select: ProvisionBucketPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: provisionBucket"); + console.error('Failed: provisionBucket'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/usage/cli/commands/seed-app-limit-caps-defaults.ts b/sdk/constructive-cli/src/usage/cli/commands/seed-app-limit-caps-defaults.ts index 2289a81e4f..f0ef712764 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/seed-app-limit-caps-defaults.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/seed-app-limit-caps-defaults.ts @@ -3,37 +3,51 @@ * @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 { SeedAppLimitCapsDefaultsVariables } from "../../orm/mutation"; -import type { SeedAppLimitCapsDefaultsPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SeedAppLimitCapsDefaultsVariables } from '../../orm/mutation'; +import type { SeedAppLimitCapsDefaultsPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("seed-app-limit-caps-defaults - seedAppLimitCapsDefaults\n\nUsage: seed-app-limit-caps-defaults [OPTIONS]\n"); + console.log( + 'seed-app-limit-caps-defaults - seedAppLimitCapsDefaults\n\nUsage: seed-app-limit-caps-defaults [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 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.seedAppLimitCapsDefaults(parsedAnswers as unknown as SeedAppLimitCapsDefaultsVariables, { - select: selectFields - } as unknown as { - select: SeedAppLimitCapsDefaultsPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .seedAppLimitCapsDefaults( + parsedAnswers as unknown as SeedAppLimitCapsDefaultsVariables, + { + select: selectFields, + } as unknown as { + select: SeedAppLimitCapsDefaultsPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: seedAppLimitCapsDefaults"); + console.error('Failed: seedAppLimitCapsDefaults'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/usage/cli/commands/seed-app-limit-defaults.ts b/sdk/constructive-cli/src/usage/cli/commands/seed-app-limit-defaults.ts index 9acae2266e..85c4f65015 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/seed-app-limit-defaults.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/seed-app-limit-defaults.ts @@ -3,37 +3,51 @@ * @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 { SeedAppLimitDefaultsVariables } from "../../orm/mutation"; -import type { SeedAppLimitDefaultsPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SeedAppLimitDefaultsVariables } from '../../orm/mutation'; +import type { SeedAppLimitDefaultsPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("seed-app-limit-defaults - seedAppLimitDefaults\n\nUsage: seed-app-limit-defaults [OPTIONS]\n"); + console.log( + 'seed-app-limit-defaults - seedAppLimitDefaults\n\nUsage: seed-app-limit-defaults [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 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.seedAppLimitDefaults(parsedAnswers as unknown as SeedAppLimitDefaultsVariables, { - select: selectFields - } as unknown as { - select: SeedAppLimitDefaultsPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .seedAppLimitDefaults( + parsedAnswers as unknown as SeedAppLimitDefaultsVariables, + { + select: selectFields, + } as unknown as { + select: SeedAppLimitDefaultsPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: seedAppLimitDefaults"); + console.error('Failed: seedAppLimitDefaults'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/usage/cli/commands/seed-org-limit-caps-defaults.ts b/sdk/constructive-cli/src/usage/cli/commands/seed-org-limit-caps-defaults.ts index 2b33f96f0d..a6de1c1f5a 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/seed-org-limit-caps-defaults.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/seed-org-limit-caps-defaults.ts @@ -3,37 +3,51 @@ * @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 { SeedOrgLimitCapsDefaultsVariables } from "../../orm/mutation"; -import type { SeedOrgLimitCapsDefaultsPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SeedOrgLimitCapsDefaultsVariables } from '../../orm/mutation'; +import type { SeedOrgLimitCapsDefaultsPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("seed-org-limit-caps-defaults - seedOrgLimitCapsDefaults\n\nUsage: seed-org-limit-caps-defaults [OPTIONS]\n"); + console.log( + 'seed-org-limit-caps-defaults - seedOrgLimitCapsDefaults\n\nUsage: seed-org-limit-caps-defaults [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 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.seedOrgLimitCapsDefaults(parsedAnswers as unknown as SeedOrgLimitCapsDefaultsVariables, { - select: selectFields - } as unknown as { - select: SeedOrgLimitCapsDefaultsPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .seedOrgLimitCapsDefaults( + parsedAnswers as unknown as SeedOrgLimitCapsDefaultsVariables, + { + select: selectFields, + } as unknown as { + select: SeedOrgLimitCapsDefaultsPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: seedOrgLimitCapsDefaults"); + console.error('Failed: seedOrgLimitCapsDefaults'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/usage/cli/commands/seed-org-limit-defaults.ts b/sdk/constructive-cli/src/usage/cli/commands/seed-org-limit-defaults.ts index 0de2b3f9b7..717ed23197 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/seed-org-limit-defaults.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/seed-org-limit-defaults.ts @@ -3,37 +3,51 @@ * @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 { SeedOrgLimitDefaultsVariables } from "../../orm/mutation"; -import type { SeedOrgLimitDefaultsPayloadSelect } from "../../orm/input-types"; -export default async (argv: Partial>, prompter: Inquirerer, _options: CLIOptions) => { +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SeedOrgLimitDefaultsVariables } from '../../orm/mutation'; +import type { SeedOrgLimitDefaultsPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { try { if (argv.help || argv.h) { - console.log("seed-org-limit-defaults - seedOrgLimitDefaults\n\nUsage: seed-org-limit-defaults [OPTIONS]\n"); + console.log( + 'seed-org-limit-defaults - seedOrgLimitDefaults\n\nUsage: seed-org-limit-defaults [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 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.seedOrgLimitDefaults(parsedAnswers as unknown as SeedOrgLimitDefaultsVariables, { - select: selectFields - } as unknown as { - select: SeedOrgLimitDefaultsPayloadSelect; - }).execute(); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .seedOrgLimitDefaults( + parsedAnswers as unknown as SeedOrgLimitDefaultsVariables, + { + select: selectFields, + } as unknown as { + select: SeedOrgLimitDefaultsPayloadSelect; + } + ) + .execute(); console.log(JSON.stringify(result, null, 2)); } catch (error) { - console.error("Failed: seedOrgLimitDefaults"); + console.error('Failed: seedOrgLimitDefaults'); if (error instanceof Error) { console.error(error.message); } process.exit(1); } -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/usage/cli/executor.ts b/sdk/constructive-cli/src/usage/cli/executor.ts index 4a2cb195c1..50d150bce8 100644 --- a/sdk/constructive-cli/src/usage/cli/executor.ts +++ b/sdk/constructive-cli/src/usage/cli/executor.ts @@ -3,9 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { createConfigStore } from "appstash"; -import { createClient } from "../orm"; -const store = createConfigStore("csdk"); +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); export const getStore = () => store; export function getClient(contextName?: string) { let ctx = null; @@ -17,7 +17,7 @@ export function getClient(contextName?: string) { } else { ctx = store.getCurrentContext(); if (!ctx) { - throw new Error("No active context. Run \"context create\" or \"context use\" first."); + throw new Error('No active context. Run "context create" or "context use" first.'); } } const headers: Record = {}; @@ -29,6 +29,6 @@ export function getClient(contextName?: string) { } return createClient({ endpoint: ctx.endpoint, - headers: headers + headers: headers, }); -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/cli/index.ts b/sdk/constructive-cli/src/usage/cli/index.ts index 4325739c22..9ca839a9ee 100644 --- a/sdk/constructive-cli/src/usage/cli/index.ts +++ b/sdk/constructive-cli/src/usage/cli/index.ts @@ -14,7 +14,8 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) { // Check for --tty false or --no-tty to enable non-interactive mode (noTty) const ttyIdx = process.argv.indexOf('--tty'); -const noTty = (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); const options: Partial = { noTty, diff --git a/sdk/constructive-cli/src/usage/cli/utils.ts b/sdk/constructive-cli/src/usage/cli/utils.ts index 737ca061fe..78a7defb6f 100644 --- a/sdk/constructive-cli/src/usage/cli/utils.ts +++ b/sdk/constructive-cli/src/usage/cli/utils.ts @@ -5,14 +5,7 @@ */ import objectPath from 'nested-obj'; -export type FieldType = - | 'string' - | 'boolean' - | 'int' - | 'float' - | 'json' - | 'uuid' - | 'enum'; +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; export interface FieldSchema { [fieldName: string]: FieldType; @@ -25,7 +18,7 @@ export interface FieldSchema { */ export function coerceAnswers( answers: Record, - schema: FieldSchema, + schema: FieldSchema ): Record { const result: Record = { ...answers }; @@ -44,8 +37,7 @@ export function coerceAnswers( switch (fieldType) { case 'boolean': if (typeof value === 'boolean') break; - result[key] = - strValue === 'true' || strValue === '1' || strValue === 'yes'; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; break; case 'int': if (typeof value === 'number') break; @@ -105,7 +97,7 @@ export function coerceAnswers( */ export function stripUndefined( obj: Record, - schema?: FieldSchema, + schema?: FieldSchema ): Record { const result: Record = {}; const allowedKeys = schema ? new Set(Object.keys(schema)) : null; @@ -124,9 +116,7 @@ export function stripUndefined( * Custom mutation commands receive an `input` field as a JSON string * from the CLI prompt. This parses it into a proper object. */ -export function parseMutationInput( - answers: Record, -): Record { +export function parseMutationInput(answers: Record): Record { if (typeof answers.input === 'string') { try { const parsed = JSON.parse(answers.input); @@ -150,9 +140,7 @@ export function parseMutationInput( * Non-dotted keys are passed through unchanged. * Uses `nested-obj` for safe nested property setting. */ -export function unflattenDotNotation( - answers: Record, -): Record { +export function unflattenDotNotation(answers: Record): Record { const result: Record = {}; for (const [key, value] of Object.entries(answers)) { @@ -185,10 +173,7 @@ export function unflattenDotNotation( * Handles minimist delivering numbers or strings depending on the input. * Returns undefined when the flag is missing or not a valid number. */ -export function parseIntFlag( - argv: Record, - name: string, -): number | undefined { +export function parseIntFlag(argv: Record, name: string): number | undefined { const val = argv[name]; if (typeof val === 'number') return val; if (typeof val === 'string') { @@ -202,10 +187,7 @@ export function parseIntFlag( * Parse a CLI flag as a string. * Returns undefined when the flag is missing or not a string. */ -export function parseStringFlag( - argv: Record, - name: string, -): string | undefined { +export function parseStringFlag(argv: Record, name: string): string | undefined { const val = argv[name]; return typeof val === 'string' ? val : undefined; } @@ -214,9 +196,7 @@ export function parseStringFlag( * Parse --orderBy flag as a comma-separated list of enum values. * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] */ -export function parseOrderByFlag( - argv: Record, -): string[] | undefined { +export function parseOrderByFlag(argv: Record): string[] | undefined { const val = argv.orderBy; return typeof val === 'string' ? val.split(',') : undefined; } @@ -227,12 +207,10 @@ export function parseOrderByFlag( */ export function parseSelectFlag( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): Record { const raw = argv.select; - return typeof raw === 'string' - ? buildSelectFromPaths(raw) - : defaultSelect; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; } /** @@ -248,7 +226,7 @@ export function parseSelectFlag( export function parseFindManyArgs>( argv: Record, defaultSelect: Record, - extraWhere?: Record, + extraWhere?: Record ): T { const limit = parseIntFlag(argv, 'limit'); const last = parseIntFlag(argv, 'last'); @@ -257,9 +235,10 @@ export function parseFindManyArgs>( const before = parseStringFlag(argv, 'before'); const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); - const where = parsed.where ?? extraWhere - ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } - : undefined; + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; const orderBy = parseOrderByFlag(argv); return { @@ -281,7 +260,7 @@ export function parseFindManyArgs>( */ export function parseFindFirstArgs>( argv: Record, - defaultSelect: Record, + defaultSelect: Record ): T { const select = parseSelectFlag(argv, defaultSelect); const parsed = unflattenDotNotation(argv); @@ -295,9 +274,7 @@ export function parseFindFirstArgs>( } as unknown as T; } -export function buildSelectFromPaths( - paths: string, -): Record { +export function buildSelectFromPaths(paths: string): Record { const result: Record = {}; const trimmedPaths = paths .split(',') diff --git a/sdk/constructive-cli/src/usage/index.ts b/sdk/constructive-cli/src/usage/index.ts index edb0fc20a1..df67cba476 100644 --- a/sdk/constructive-cli/src/usage/index.ts +++ b/sdk/constructive-cli/src/usage/index.ts @@ -2,5 +2,5 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; -export * from "./cli"; \ No newline at end of file +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/usage/orm/client.ts b/sdk/constructive-cli/src/usage/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-cli/src/usage/orm/client.ts +++ b/sdk/constructive-cli/src/usage/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-cli/src/usage/orm/index.ts b/sdk/constructive-cli/src/usage/orm/index.ts index 2937809ca5..7d48027d3b 100644 --- a/sdk/constructive-cli/src/usage/orm/index.ts +++ b/sdk/constructive-cli/src/usage/orm/index.ts @@ -3,33 +3,33 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AppLimitCapModel } from "./models/appLimitCap"; -import { AppLimitCapsDefaultModel } from "./models/appLimitCapsDefault"; -import { AppLimitModel } from "./models/appLimit"; -import { AppLimitCreditCodeModel } from "./models/appLimitCreditCode"; -import { AppLimitCreditCodeItemModel } from "./models/appLimitCreditCodeItem"; -import { AppLimitCreditModel } from "./models/appLimitCredit"; -import { AppLimitCreditRedemptionModel } from "./models/appLimitCreditRedemption"; -import { AppLimitDefaultModel } from "./models/appLimitDefault"; -import { AppLimitEventModel } from "./models/appLimitEvent"; -import { AppLimitWarningModel } from "./models/appLimitWarning"; -import { OrgLimitAggregateModel } from "./models/orgLimitAggregate"; -import { OrgLimitCapModel } from "./models/orgLimitCap"; -import { OrgLimitCapsDefaultModel } from "./models/orgLimitCapsDefault"; -import { OrgLimitModel } from "./models/orgLimit"; -import { OrgLimitCreditModel } from "./models/orgLimitCredit"; -import { OrgLimitDefaultModel } from "./models/orgLimitDefault"; -import { OrgLimitEventModel } from "./models/orgLimitEvent"; -import { OrgLimitWarningModel } from "./models/orgLimitWarning"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AppLimitCapModel } from './models/appLimitCap'; +import { AppLimitCapsDefaultModel } from './models/appLimitCapsDefault'; +import { AppLimitModel } from './models/appLimit'; +import { AppLimitCreditCodeModel } from './models/appLimitCreditCode'; +import { AppLimitCreditCodeItemModel } from './models/appLimitCreditCodeItem'; +import { AppLimitCreditModel } from './models/appLimitCredit'; +import { AppLimitCreditRedemptionModel } from './models/appLimitCreditRedemption'; +import { AppLimitDefaultModel } from './models/appLimitDefault'; +import { AppLimitEventModel } from './models/appLimitEvent'; +import { AppLimitWarningModel } from './models/appLimitWarning'; +import { OrgLimitAggregateModel } from './models/orgLimitAggregate'; +import { OrgLimitCapModel } from './models/orgLimitCap'; +import { OrgLimitCapsDefaultModel } from './models/orgLimitCapsDefault'; +import { OrgLimitModel } from './models/orgLimit'; +import { OrgLimitCreditModel } from './models/orgLimitCredit'; +import { OrgLimitDefaultModel } from './models/orgLimitDefault'; +import { OrgLimitEventModel } from './models/orgLimitEvent'; +import { OrgLimitWarningModel } from './models/orgLimitWarning'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -74,6 +74,6 @@ export function createClient(config: OrmClientConfig) { orgLimitDefault: new OrgLimitDefaultModel(client), orgLimitEvent: new OrgLimitEventModel(client), orgLimitWarning: new OrgLimitWarningModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/input-types.ts b/sdk/constructive-cli/src/usage/orm/input-types.ts index c462da530b..f8df1c43d8 100644 --- a/sdk/constructive-cli/src/usage/orm/input-types.ts +++ b/sdk/constructive-cli/src/usage/orm/input-types.ts @@ -579,9 +579,11 @@ export type AppLimitCapWithRelations = AppLimitCap & AppLimitCapRelations; export type AppLimitCapsDefaultWithRelations = AppLimitCapsDefault & AppLimitCapsDefaultRelations; export type AppLimitWithRelations = AppLimit & AppLimitRelations; export type AppLimitCreditCodeWithRelations = AppLimitCreditCode & AppLimitCreditCodeRelations; -export type AppLimitCreditCodeItemWithRelations = AppLimitCreditCodeItem & AppLimitCreditCodeItemRelations; +export type AppLimitCreditCodeItemWithRelations = AppLimitCreditCodeItem & + AppLimitCreditCodeItemRelations; export type AppLimitCreditWithRelations = AppLimitCredit & AppLimitCreditRelations; -export type AppLimitCreditRedemptionWithRelations = AppLimitCreditRedemption & AppLimitCreditRedemptionRelations; +export type AppLimitCreditRedemptionWithRelations = AppLimitCreditRedemption & + AppLimitCreditRedemptionRelations; export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRelations; export type AppLimitEventWithRelations = AppLimitEvent & AppLimitEventRelations; export type AppLimitWarningWithRelations = AppLimitWarning & AppLimitWarningRelations; @@ -1241,24 +1243,338 @@ export interface OrgLimitWarningFilter { warningType?: StringFilter; } // ============ OrderBy Types ============ -export type AppLimitCapOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCapsDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type AppLimitCreditCodeOrderBy = "CODE_ASC" | "CODE_DESC" | "CURRENT_REDEMPTIONS_ASC" | "CURRENT_REDEMPTIONS_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "MAX_REDEMPTIONS_ASC" | "MAX_REDEMPTIONS_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCreditCodeItemOrderBy = "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_CODE_ID_ASC" | "CREDIT_CODE_ID_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCreditOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type AppLimitCreditRedemptionOrderBy = "CREDIT_CODE_ID_ASC" | "CREDIT_CODE_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC"; -export type AppLimitEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DELTA_ASC" | "DELTA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_AT_EVENT_ASC" | "MAX_AT_EVENT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_AFTER_ASC" | "NUM_AFTER_DESC" | "NUM_BEFORE_ASC" | "NUM_BEFORE_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type AppLimitWarningOrderBy = "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "THRESHOLD_VALUE_ASC" | "THRESHOLD_VALUE_DESC" | "WARNING_TYPE_ASC" | "WARNING_TYPE_DESC"; -export type OrgLimitAggregateOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "RESERVED_ASC" | "RESERVED_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type OrgLimitCapOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgLimitCapsDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgLimitOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type OrgLimitCreditOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type OrgLimitDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC"; -export type OrgLimitEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DELTA_ASC" | "DELTA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_AT_EVENT_ASC" | "MAX_AT_EVENT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_AFTER_ASC" | "NUM_AFTER_DESC" | "NUM_BEFORE_ASC" | "NUM_BEFORE_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type OrgLimitWarningOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "THRESHOLD_VALUE_ASC" | "THRESHOLD_VALUE_DESC" | "WARNING_TYPE_ASC" | "WARNING_TYPE_DESC"; +export type AppLimitCapOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCapsDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type AppLimitCreditCodeOrderBy = + | 'CODE_ASC' + | 'CODE_DESC' + | 'CURRENT_REDEMPTIONS_ASC' + | 'CURRENT_REDEMPTIONS_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_REDEMPTIONS_ASC' + | 'MAX_REDEMPTIONS_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCreditCodeItemOrderBy = + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_CODE_ID_ASC' + | 'CREDIT_CODE_ID_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCreditOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type AppLimitCreditRedemptionOrderBy = + | 'CREDIT_CODE_ID_ASC' + | 'CREDIT_CODE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC'; +export type AppLimitEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DELTA_ASC' + | 'DELTA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_AT_EVENT_ASC' + | 'MAX_AT_EVENT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_AFTER_ASC' + | 'NUM_AFTER_DESC' + | 'NUM_BEFORE_ASC' + | 'NUM_BEFORE_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type AppLimitWarningOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'THRESHOLD_VALUE_ASC' + | 'THRESHOLD_VALUE_DESC' + | 'WARNING_TYPE_ASC' + | 'WARNING_TYPE_DESC'; +export type OrgLimitAggregateOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'RESERVED_ASC' + | 'RESERVED_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type OrgLimitCapOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgLimitCapsDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgLimitOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type OrgLimitCreditOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type OrgLimitDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC'; +export type OrgLimitEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DELTA_ASC' + | 'DELTA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_AT_EVENT_ASC' + | 'MAX_AT_EVENT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_AFTER_ASC' + | 'NUM_AFTER_DESC' + | 'NUM_BEFORE_ASC' + | 'NUM_BEFORE_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type OrgLimitWarningOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'THRESHOLD_VALUE_ASC' + | 'THRESHOLD_VALUE_DESC' + | 'WARNING_TYPE_ASC' + | 'WARNING_TYPE_DESC'; // ============ CRUD Input Types ============ export interface CreateAppLimitCapInput { clientMutationId?: string; @@ -1770,17 +2086,17 @@ export interface DeleteOrgLimitWarningInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "AppLimitCreditCode": { - "appLimitCreditCodeItemsByCreditCodeId": "AppLimitCreditCodeItem", - "appLimitCreditRedemptionsByCreditCodeId": "AppLimitCreditRedemption" + AppLimitCreditCode: { + appLimitCreditCodeItemsByCreditCodeId: 'AppLimitCreditCodeItem', + appLimitCreditRedemptionsByCreditCodeId: 'AppLimitCreditRedemption', }, - "AppLimitDefault": { - "appLimitCreditCodeItemsByDefaultLimitId": "AppLimitCreditCodeItem", - "appLimitCreditsByDefaultLimitId": "AppLimitCredit" + AppLimitDefault: { + appLimitCreditCodeItemsByDefaultLimitId: 'AppLimitCreditCodeItem', + appLimitCreditsByDefaultLimitId: 'AppLimitCredit', + }, + OrgLimitDefault: { + orgLimitCreditsByDefaultLimitId: 'OrgLimitCredit', }, - "OrgLimitDefault": { - "orgLimitCreditsByDefaultLimitId": "OrgLimitCredit" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -3618,4 +3934,4 @@ export type OrgLimitWarningEdgeSelect = { node?: { select: OrgLimitWarningSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimit.ts b/sdk/constructive-cli/src/usage/orm/models/appLimit.ts index 3e7c702c15..e1903aae36 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimit.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimit.ts @@ -3,56 +3,96 @@ * @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 { AppLimit, AppLimitWithRelations, AppLimitSelect, AppLimitFilter, AppLimitOrderBy, CreateAppLimitInput, UpdateAppLimitInput, AppLimitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimit, + AppLimitWithRelations, + AppLimitSelect, + AppLimitFilter, + AppLimitOrderBy, + CreateAppLimitInput, + UpdateAppLimitInput, + AppLimitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimit", "appLimits", 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 - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimit', + 'appLimits', + 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, + }, + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimits", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimit", "appLimits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimit', + 'appLimits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimit", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimit": data.appLimits?.nodes?.[0] ?? null - }) + appLimit: data.appLimits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimit", "appLimits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimit', + 'appLimits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimit", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimit": data.appLimits?.nodes?.[0] ?? null - }) + appLimit: data.appLimits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimit", "createAppLimit", "appLimit", args.select, args.data, "CreateAppLimitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimit', + 'createAppLimit', + 'appLimit', + args.select, + args.data, + 'CreateAppLimitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "createAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'createAppLimit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimit", "updateAppLimit", "appLimit", args.select, args.where.id, args.data, "UpdateAppLimitInput", "id", "appLimitPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimit', + 'updateAppLimit', + 'appLimit', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitInput', + 'id', + 'appLimitPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "updateAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'updateAppLimit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimit", "deleteAppLimit", "appLimit", { - id: args.where.id - }, "DeleteAppLimitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimit', + 'deleteAppLimit', + 'appLimit', + { + id: args.where.id, + }, + 'DeleteAppLimitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "deleteAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'deleteAppLimit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCap.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCap.ts index 883def6208..9f93b87628 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCap.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCap.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCap, AppLimitCapWithRelations, AppLimitCapSelect, AppLimitCapFilter, AppLimitCapOrderBy, CreateAppLimitCapInput, UpdateAppLimitCapInput, AppLimitCapPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCap, + AppLimitCapWithRelations, + AppLimitCapSelect, + AppLimitCapFilter, + AppLimitCapOrderBy, + CreateAppLimitCapInput, + UpdateAppLimitCapInput, + AppLimitCapPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCapModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCaps: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCap", "appLimitCaps", 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 - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCap', + 'appLimitCaps', + 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, + }, + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCaps", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCaps', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCap", "appLimitCaps", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCap', + 'appLimitCaps', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCap", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCap', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCap": data.appLimitCaps?.nodes?.[0] ?? null - }) + appLimitCap: data.appLimitCaps?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCap", "appLimitCaps", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCap', + 'appLimitCaps', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCap", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCap', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCap": data.appLimitCaps?.nodes?.[0] ?? null - }) + appLimitCap: data.appLimitCaps?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCap", "createAppLimitCap", "appLimitCap", args.select, args.data, "CreateAppLimitCapInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCap', + 'createAppLimitCap', + 'appLimitCap', + args.select, + args.data, + 'CreateAppLimitCapInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "createAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'createAppLimitCap', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCapPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCap", "updateAppLimitCap", "appLimitCap", args.select, args.where.id, args.data, "UpdateAppLimitCapInput", "id", "appLimitCapPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCap', + 'updateAppLimitCap', + 'appLimitCap', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCapInput', + 'id', + 'appLimitCapPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "updateAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'updateAppLimitCap', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCap", "deleteAppLimitCap", "appLimitCap", { - id: args.where.id - }, "DeleteAppLimitCapInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCap', + 'deleteAppLimitCap', + 'appLimitCap', + { + id: args.where.id, + }, + 'DeleteAppLimitCapInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "deleteAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'deleteAppLimitCap', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCapsDefault.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCapsDefault.ts index 6e64cd49f5..3b0ac8a23b 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCapsDefault.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCapsDefault.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCapsDefault, AppLimitCapsDefaultWithRelations, AppLimitCapsDefaultSelect, AppLimitCapsDefaultFilter, AppLimitCapsDefaultOrderBy, CreateAppLimitCapsDefaultInput, UpdateAppLimitCapsDefaultInput, AppLimitCapsDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCapsDefault, + AppLimitCapsDefaultWithRelations, + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy, + CreateAppLimitCapsDefaultInput, + UpdateAppLimitCapsDefaultInput, + AppLimitCapsDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCapsDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCapsDefault", "appLimitCapsDefaults", 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 - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + 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, + }, + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefaults", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCapsDefault", "appLimitCapsDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefault", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCapsDefault": data.appLimitCapsDefaults?.nodes?.[0] ?? null - }) + appLimitCapsDefault: data.appLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCapsDefault", "appLimitCapsDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefault", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCapsDefault": data.appLimitCapsDefaults?.nodes?.[0] ?? null - }) + appLimitCapsDefault: data.appLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCapsDefault", "createAppLimitCapsDefault", "appLimitCapsDefault", args.select, args.data, "CreateAppLimitCapsDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCapsDefault', + 'createAppLimitCapsDefault', + 'appLimitCapsDefault', + args.select, + args.data, + 'CreateAppLimitCapsDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "createAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'createAppLimitCapsDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCapsDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCapsDefault", "updateAppLimitCapsDefault", "appLimitCapsDefault", args.select, args.where.id, args.data, "UpdateAppLimitCapsDefaultInput", "id", "appLimitCapsDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCapsDefault', + 'updateAppLimitCapsDefault', + 'appLimitCapsDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCapsDefaultInput', + 'id', + 'appLimitCapsDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "updateAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'updateAppLimitCapsDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCapsDefault", "deleteAppLimitCapsDefault", "appLimitCapsDefault", { - id: args.where.id - }, "DeleteAppLimitCapsDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCapsDefault', + 'deleteAppLimitCapsDefault', + 'appLimitCapsDefault', + { + id: args.where.id, + }, + 'DeleteAppLimitCapsDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "deleteAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'deleteAppLimitCapsDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCredit.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCredit.ts index b78f6d159a..7f66c4eb09 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCredit.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCredit.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCredit, AppLimitCreditWithRelations, AppLimitCreditSelect, AppLimitCreditFilter, AppLimitCreditOrderBy, CreateAppLimitCreditInput, UpdateAppLimitCreditInput, AppLimitCreditPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCredit, + AppLimitCreditWithRelations, + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy, + CreateAppLimitCreditInput, + UpdateAppLimitCreditInput, + AppLimitCreditPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCredit", "appLimitCredits", 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 - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCredit', + 'appLimitCredits', + 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, + }, + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredits", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCredit", "appLimitCredits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCredit', + 'appLimitCredits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredit", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCredit": data.appLimitCredits?.nodes?.[0] ?? null - }) + appLimitCredit: data.appLimitCredits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCredit", "appLimitCredits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCredit', + 'appLimitCredits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredit", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCredit": data.appLimitCredits?.nodes?.[0] ?? null - }) + appLimitCredit: data.appLimitCredits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCredit", "createAppLimitCredit", "appLimitCredit", args.select, args.data, "CreateAppLimitCreditInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCredit', + 'createAppLimitCredit', + 'appLimitCredit', + args.select, + args.data, + 'CreateAppLimitCreditInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "createAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'createAppLimitCredit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCredit", "updateAppLimitCredit", "appLimitCredit", args.select, args.where.id, args.data, "UpdateAppLimitCreditInput", "id", "appLimitCreditPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCredit', + 'updateAppLimitCredit', + 'appLimitCredit', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditInput', + 'id', + 'appLimitCreditPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "updateAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'updateAppLimitCredit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCredit", "deleteAppLimitCredit", "appLimitCredit", { - id: args.where.id - }, "DeleteAppLimitCreditInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCredit', + 'deleteAppLimitCredit', + 'appLimitCredit', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "deleteAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'deleteAppLimitCredit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCode.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCode.ts index db2a6b0b29..a449fef840 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCode.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCode.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCreditCode, AppLimitCreditCodeWithRelations, AppLimitCreditCodeSelect, AppLimitCreditCodeFilter, AppLimitCreditCodeOrderBy, CreateAppLimitCreditCodeInput, UpdateAppLimitCreditCodeInput, AppLimitCreditCodePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditCode, + AppLimitCreditCodeWithRelations, + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy, + CreateAppLimitCreditCodeInput, + UpdateAppLimitCreditCodeInput, + AppLimitCreditCodePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditCodeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCode", "appLimitCreditCodes", 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 - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + 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, + }, + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCodes", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCode: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditCode", "appLimitCreditCodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCode", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCode', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCreditCodeModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCode": data.appLimitCreditCodes?.nodes?.[0] ?? null - }) + appLimitCreditCode: data.appLimitCreditCodes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCode: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCode", "appLimitCreditCodes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCode", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCode', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCreditCodeModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCode": data.appLimitCreditCodes?.nodes?.[0] ?? null - }) + appLimitCreditCode: data.appLimitCreditCodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditCode", "createAppLimitCreditCode", "appLimitCreditCode", args.select, args.data, "CreateAppLimitCreditCodeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditCode', + 'createAppLimitCreditCode', + 'appLimitCreditCode', + args.select, + args.data, + 'CreateAppLimitCreditCodeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "createAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'createAppLimitCreditCode', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditCodePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditCode", "updateAppLimitCreditCode", "appLimitCreditCode", args.select, args.where.id, args.data, "UpdateAppLimitCreditCodeInput", "id", "appLimitCreditCodePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditCode', + 'updateAppLimitCreditCode', + 'appLimitCreditCode', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditCodeInput', + 'id', + 'appLimitCreditCodePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "updateAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'updateAppLimitCreditCode', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditCode", "deleteAppLimitCreditCode", "appLimitCreditCode", { - id: args.where.id - }, "DeleteAppLimitCreditCodeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditCode', + 'deleteAppLimitCreditCode', + 'appLimitCreditCode', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditCodeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "deleteAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'deleteAppLimitCreditCode', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCodeItem.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCodeItem.ts index ccf3875343..5f37d3fbe0 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCodeItem.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCodeItem.ts @@ -3,56 +3,98 @@ * @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 { AppLimitCreditCodeItem, AppLimitCreditCodeItemWithRelations, AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemFilter, AppLimitCreditCodeItemOrderBy, CreateAppLimitCreditCodeItemInput, UpdateAppLimitCreditCodeItemInput, AppLimitCreditCodeItemPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditCodeItem, + AppLimitCreditCodeItemWithRelations, + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy, + CreateAppLimitCreditCodeItemInput, + UpdateAppLimitCreditCodeItemInput, + AppLimitCreditCodeItemPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditCodeItemModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appLimitCreditCodeItems: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appLimitCreditCodeItems: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", 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 - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + 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, + }, + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItems", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItems', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodeItem: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItem", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItem', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppLimitCreditCodeItemModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCodeItem": data.appLimitCreditCodeItems?.nodes?.[0] ?? null - }) + appLimitCreditCodeItem: data.appLimitCreditCodeItems?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodeItem: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItem", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItem', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppLimitCreditCodeItemModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCodeItem": data.appLimitCreditCodeItems?.nodes?.[0] ?? null - }) + appLimitCreditCodeItem: data.appLimitCreditCodeItems?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditCodeItem", "createAppLimitCreditCodeItem", "appLimitCreditCodeItem", args.select, args.data, "CreateAppLimitCreditCodeItemInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditCodeItem', + 'createAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + args.select, + args.data, + 'CreateAppLimitCreditCodeItemInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "createAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'createAppLimitCreditCodeItem', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditCodeItemPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditCodeItem", "updateAppLimitCreditCodeItem", "appLimitCreditCodeItem", args.select, args.where.id, args.data, "UpdateAppLimitCreditCodeItemInput", "id", "appLimitCreditCodeItemPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditCodeItem', + 'updateAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditCodeItemInput', + 'id', + 'appLimitCreditCodeItemPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "updateAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'updateAppLimitCreditCodeItem', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditCodeItem", "deleteAppLimitCreditCodeItem", "appLimitCreditCodeItem", { - id: args.where.id - }, "DeleteAppLimitCreditCodeItemInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditCodeItem', + 'deleteAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditCodeItemInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "deleteAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'deleteAppLimitCreditCodeItem', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditRedemption.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditRedemption.ts index 754ba79962..582960bd9f 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditRedemption.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditRedemption.ts @@ -3,56 +3,98 @@ * @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 { AppLimitCreditRedemption, AppLimitCreditRedemptionWithRelations, AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionFilter, AppLimitCreditRedemptionOrderBy, CreateAppLimitCreditRedemptionInput, UpdateAppLimitCreditRedemptionInput, AppLimitCreditRedemptionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditRedemption, + AppLimitCreditRedemptionWithRelations, + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy, + CreateAppLimitCreditRedemptionInput, + UpdateAppLimitCreditRedemptionInput, + AppLimitCreditRedemptionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditRedemptionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appLimitCreditRedemptions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appLimitCreditRedemptions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", 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 - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + 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, + }, + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemptions", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemptions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditRedemption: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemption", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemption', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppLimitCreditRedemptionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditRedemption": data.appLimitCreditRedemptions?.nodes?.[0] ?? null - }) + appLimitCreditRedemption: data.appLimitCreditRedemptions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditRedemption: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemption", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemption', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppLimitCreditRedemptionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditRedemption": data.appLimitCreditRedemptions?.nodes?.[0] ?? null - }) + appLimitCreditRedemption: data.appLimitCreditRedemptions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditRedemption", "createAppLimitCreditRedemption", "appLimitCreditRedemption", args.select, args.data, "CreateAppLimitCreditRedemptionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditRedemption', + 'createAppLimitCreditRedemption', + 'appLimitCreditRedemption', + args.select, + args.data, + 'CreateAppLimitCreditRedemptionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "createAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'createAppLimitCreditRedemption', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditRedemptionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditRedemption", "updateAppLimitCreditRedemption", "appLimitCreditRedemption", args.select, args.where.id, args.data, "UpdateAppLimitCreditRedemptionInput", "id", "appLimitCreditRedemptionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditRedemption', + 'updateAppLimitCreditRedemption', + 'appLimitCreditRedemption', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditRedemptionInput', + 'id', + 'appLimitCreditRedemptionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "updateAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'updateAppLimitCreditRedemption', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditRedemption", "deleteAppLimitCreditRedemption", "appLimitCreditRedemption", { - id: args.where.id - }, "DeleteAppLimitCreditRedemptionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditRedemption', + 'deleteAppLimitCreditRedemption', + 'appLimitCreditRedemption', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditRedemptionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "deleteAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'deleteAppLimitCreditRedemption', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitDefault.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitDefault.ts index 6a45e01c7f..f0eb49d31f 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitDefault.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitDefault.ts @@ -3,56 +3,96 @@ * @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 { AppLimitDefault, AppLimitDefaultWithRelations, AppLimitDefaultSelect, AppLimitDefaultFilter, AppLimitDefaultOrderBy, CreateAppLimitDefaultInput, UpdateAppLimitDefaultInput, AppLimitDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitDefault, + AppLimitDefaultWithRelations, + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy, + CreateAppLimitDefaultInput, + UpdateAppLimitDefaultInput, + AppLimitDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitDefault", "appLimitDefaults", 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 - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitDefault', + 'appLimitDefaults', + 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, + }, + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefaults", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitDefault", "appLimitDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitDefault', + 'appLimitDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefault", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitDefault": data.appLimitDefaults?.nodes?.[0] ?? null - }) + appLimitDefault: data.appLimitDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitDefault", "appLimitDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitDefault', + 'appLimitDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefault", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitDefault": data.appLimitDefaults?.nodes?.[0] ?? null - }) + appLimitDefault: data.appLimitDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitDefault", "createAppLimitDefault", "appLimitDefault", args.select, args.data, "CreateAppLimitDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitDefault', + 'createAppLimitDefault', + 'appLimitDefault', + args.select, + args.data, + 'CreateAppLimitDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "createAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'createAppLimitDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitDefault", "updateAppLimitDefault", "appLimitDefault", args.select, args.where.id, args.data, "UpdateAppLimitDefaultInput", "id", "appLimitDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitDefault', + 'updateAppLimitDefault', + 'appLimitDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitDefaultInput', + 'id', + 'appLimitDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "updateAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'updateAppLimitDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitDefault", "deleteAppLimitDefault", "appLimitDefault", { - id: args.where.id - }, "DeleteAppLimitDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitDefault', + 'deleteAppLimitDefault', + 'appLimitDefault', + { + id: args.where.id, + }, + 'DeleteAppLimitDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "deleteAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'deleteAppLimitDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitEvent.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitEvent.ts index 9a54edcef3..17fd7e8866 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitEvent.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitEvent.ts @@ -3,56 +3,96 @@ * @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 { AppLimitEvent, AppLimitEventWithRelations, AppLimitEventSelect, AppLimitEventFilter, AppLimitEventOrderBy, CreateAppLimitEventInput, UpdateAppLimitEventInput, AppLimitEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitEvent, + AppLimitEventWithRelations, + AppLimitEventSelect, + AppLimitEventFilter, + AppLimitEventOrderBy, + CreateAppLimitEventInput, + UpdateAppLimitEventInput, + AppLimitEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitEvent", "appLimitEvents", 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 - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitEvent', + 'appLimitEvents', + 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, + }, + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvents", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitEvent", "appLimitEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitEvent', + 'appLimitEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvent", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitEvent": data.appLimitEvents?.nodes?.[0] ?? null - }) + appLimitEvent: data.appLimitEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitEvent", "appLimitEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitEvent', + 'appLimitEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvent", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class AppLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitEvent": data.appLimitEvents?.nodes?.[0] ?? null - }) + appLimitEvent: data.appLimitEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitEvent", "createAppLimitEvent", "appLimitEvent", args.select, args.data, "CreateAppLimitEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitEvent', + 'createAppLimitEvent', + 'appLimitEvent', + args.select, + args.data, + 'CreateAppLimitEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "createAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'createAppLimitEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + AppLimitEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitEvent", "updateAppLimitEvent", "appLimitEvent", args.select, args.where.id, args.data, "UpdateAppLimitEventInput", "id", "appLimitEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitEvent', + 'updateAppLimitEvent', + 'appLimitEvent', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitEventInput', + 'id', + 'appLimitEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "updateAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'updateAppLimitEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitEvent", "deleteAppLimitEvent", "appLimitEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteAppLimitEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitEvent', + 'deleteAppLimitEvent', + 'appLimitEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteAppLimitEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "deleteAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'deleteAppLimitEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitWarning.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitWarning.ts index c7e959263a..4d31d5490a 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitWarning.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitWarning.ts @@ -3,56 +3,96 @@ * @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 { AppLimitWarning, AppLimitWarningWithRelations, AppLimitWarningSelect, AppLimitWarningFilter, AppLimitWarningOrderBy, CreateAppLimitWarningInput, UpdateAppLimitWarningInput, AppLimitWarningPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitWarning, + AppLimitWarningWithRelations, + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy, + CreateAppLimitWarningInput, + UpdateAppLimitWarningInput, + AppLimitWarningPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitWarningModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarnings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitWarning", "appLimitWarnings", 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 - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitWarning', + 'appLimitWarnings', + 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, + }, + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarnings", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarnings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitWarning", "appLimitWarnings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitWarning', + 'appLimitWarnings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarning", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarning', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitWarning": data.appLimitWarnings?.nodes?.[0] ?? null - }) + appLimitWarning: data.appLimitWarnings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitWarning", "appLimitWarnings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitWarning', + 'appLimitWarnings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarning", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarning', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitWarning": data.appLimitWarnings?.nodes?.[0] ?? null - }) + appLimitWarning: data.appLimitWarnings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitWarning", "createAppLimitWarning", "appLimitWarning", args.select, args.data, "CreateAppLimitWarningInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitWarning', + 'createAppLimitWarning', + 'appLimitWarning', + args.select, + args.data, + 'CreateAppLimitWarningInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "createAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'createAppLimitWarning', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitWarningPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitWarning", "updateAppLimitWarning", "appLimitWarning", args.select, args.where.id, args.data, "UpdateAppLimitWarningInput", "id", "appLimitWarningPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitWarning', + 'updateAppLimitWarning', + 'appLimitWarning', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitWarningInput', + 'id', + 'appLimitWarningPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "updateAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'updateAppLimitWarning', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitWarning", "deleteAppLimitWarning", "appLimitWarning", { - id: args.where.id - }, "DeleteAppLimitWarningInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitWarning', + 'deleteAppLimitWarning', + 'appLimitWarning', + { + id: args.where.id, + }, + 'DeleteAppLimitWarningInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "deleteAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'deleteAppLimitWarning', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/index.ts b/sdk/constructive-cli/src/usage/orm/models/index.ts index 33c8f9a18e..049cfdab13 100644 --- a/sdk/constructive-cli/src/usage/orm/models/index.ts +++ b/sdk/constructive-cli/src/usage/orm/models/index.ts @@ -3,21 +3,21 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AppLimitCapModel } from "./appLimitCap"; -export { AppLimitCapsDefaultModel } from "./appLimitCapsDefault"; -export { AppLimitModel } from "./appLimit"; -export { AppLimitCreditCodeModel } from "./appLimitCreditCode"; -export { AppLimitCreditCodeItemModel } from "./appLimitCreditCodeItem"; -export { AppLimitCreditModel } from "./appLimitCredit"; -export { AppLimitCreditRedemptionModel } from "./appLimitCreditRedemption"; -export { AppLimitDefaultModel } from "./appLimitDefault"; -export { AppLimitEventModel } from "./appLimitEvent"; -export { AppLimitWarningModel } from "./appLimitWarning"; -export { OrgLimitAggregateModel } from "./orgLimitAggregate"; -export { OrgLimitCapModel } from "./orgLimitCap"; -export { OrgLimitCapsDefaultModel } from "./orgLimitCapsDefault"; -export { OrgLimitModel } from "./orgLimit"; -export { OrgLimitCreditModel } from "./orgLimitCredit"; -export { OrgLimitDefaultModel } from "./orgLimitDefault"; -export { OrgLimitEventModel } from "./orgLimitEvent"; -export { OrgLimitWarningModel } from "./orgLimitWarning"; \ No newline at end of file +export { AppLimitCapModel } from './appLimitCap'; +export { AppLimitCapsDefaultModel } from './appLimitCapsDefault'; +export { AppLimitModel } from './appLimit'; +export { AppLimitCreditCodeModel } from './appLimitCreditCode'; +export { AppLimitCreditCodeItemModel } from './appLimitCreditCodeItem'; +export { AppLimitCreditModel } from './appLimitCredit'; +export { AppLimitCreditRedemptionModel } from './appLimitCreditRedemption'; +export { AppLimitDefaultModel } from './appLimitDefault'; +export { AppLimitEventModel } from './appLimitEvent'; +export { AppLimitWarningModel } from './appLimitWarning'; +export { OrgLimitAggregateModel } from './orgLimitAggregate'; +export { OrgLimitCapModel } from './orgLimitCap'; +export { OrgLimitCapsDefaultModel } from './orgLimitCapsDefault'; +export { OrgLimitModel } from './orgLimit'; +export { OrgLimitCreditModel } from './orgLimitCredit'; +export { OrgLimitDefaultModel } from './orgLimitDefault'; +export { OrgLimitEventModel } from './orgLimitEvent'; +export { OrgLimitWarningModel } from './orgLimitWarning'; diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimit.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimit.ts index 246f61238f..188531420f 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimit.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimit.ts @@ -3,56 +3,96 @@ * @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 { OrgLimit, OrgLimitWithRelations, OrgLimitSelect, OrgLimitFilter, OrgLimitOrderBy, CreateOrgLimitInput, UpdateOrgLimitInput, OrgLimitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimit, + OrgLimitWithRelations, + OrgLimitSelect, + OrgLimitFilter, + OrgLimitOrderBy, + CreateOrgLimitInput, + UpdateOrgLimitInput, + OrgLimitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimit", "orgLimits", 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 - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimit', + 'orgLimits', + 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, + }, + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimits", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimit", "orgLimits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimit', + 'orgLimits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimit", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimit": data.orgLimits?.nodes?.[0] ?? null - }) + orgLimit: data.orgLimits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimit", "orgLimits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimit', + 'orgLimits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimit", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimit": data.orgLimits?.nodes?.[0] ?? null - }) + orgLimit: data.orgLimits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimit", "createOrgLimit", "orgLimit", args.select, args.data, "CreateOrgLimitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimit', + 'createOrgLimit', + 'orgLimit', + args.select, + args.data, + 'CreateOrgLimitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "createOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'createOrgLimit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimit", "updateOrgLimit", "orgLimit", args.select, args.where.id, args.data, "UpdateOrgLimitInput", "id", "orgLimitPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimit', + 'updateOrgLimit', + 'orgLimit', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitInput', + 'id', + 'orgLimitPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "updateOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'updateOrgLimit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimit", "deleteOrgLimit", "orgLimit", { - id: args.where.id - }, "DeleteOrgLimitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimit', + 'deleteOrgLimit', + 'orgLimit', + { + id: args.where.id, + }, + 'DeleteOrgLimitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "deleteOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'deleteOrgLimit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitAggregate.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitAggregate.ts index cccd405709..43f24e6d05 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitAggregate.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitAggregate.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitAggregate, OrgLimitAggregateWithRelations, OrgLimitAggregateSelect, OrgLimitAggregateFilter, OrgLimitAggregateOrderBy, CreateOrgLimitAggregateInput, UpdateOrgLimitAggregateInput, OrgLimitAggregatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitAggregate, + OrgLimitAggregateWithRelations, + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy, + CreateOrgLimitAggregateInput, + UpdateOrgLimitAggregateInput, + OrgLimitAggregatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitAggregateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregates: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitAggregate", "orgLimitAggregates", 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 - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + 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, + }, + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregates", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitAggregate", "orgLimitAggregates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregate", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregate', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitAggregateModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitAggregate": data.orgLimitAggregates?.nodes?.[0] ?? null - }) + orgLimitAggregate: data.orgLimitAggregates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitAggregate", "orgLimitAggregates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregate", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregate', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitAggregateModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitAggregate": data.orgLimitAggregates?.nodes?.[0] ?? null - }) + orgLimitAggregate: data.orgLimitAggregates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitAggregate", "createOrgLimitAggregate", "orgLimitAggregate", args.select, args.data, "CreateOrgLimitAggregateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitAggregate', + 'createOrgLimitAggregate', + 'orgLimitAggregate', + args.select, + args.data, + 'CreateOrgLimitAggregateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "createOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'createOrgLimitAggregate', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitAggregatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitAggregate", "updateOrgLimitAggregate", "orgLimitAggregate", args.select, args.where.id, args.data, "UpdateOrgLimitAggregateInput", "id", "orgLimitAggregatePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitAggregate', + 'updateOrgLimitAggregate', + 'orgLimitAggregate', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitAggregateInput', + 'id', + 'orgLimitAggregatePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "updateOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'updateOrgLimitAggregate', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitAggregate", "deleteOrgLimitAggregate", "orgLimitAggregate", { - id: args.where.id - }, "DeleteOrgLimitAggregateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitAggregate', + 'deleteOrgLimitAggregate', + 'orgLimitAggregate', + { + id: args.where.id, + }, + 'DeleteOrgLimitAggregateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "deleteOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'deleteOrgLimitAggregate', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitCap.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitCap.ts index 932ee5f41c..0877ea93fd 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitCap.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitCap.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCap, OrgLimitCapWithRelations, OrgLimitCapSelect, OrgLimitCapFilter, OrgLimitCapOrderBy, CreateOrgLimitCapInput, UpdateOrgLimitCapInput, OrgLimitCapPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCap, + OrgLimitCapWithRelations, + OrgLimitCapSelect, + OrgLimitCapFilter, + OrgLimitCapOrderBy, + CreateOrgLimitCapInput, + UpdateOrgLimitCapInput, + OrgLimitCapPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCapModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCaps: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCap", "orgLimitCaps", 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 - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCap', + 'orgLimitCaps', + 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, + }, + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCaps", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCaps', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCap", "orgLimitCaps", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCap', + 'orgLimitCaps', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCap", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCap', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCap": data.orgLimitCaps?.nodes?.[0] ?? null - }) + orgLimitCap: data.orgLimitCaps?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCap", "orgLimitCaps", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCap', + 'orgLimitCaps', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCap", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCap', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCap": data.orgLimitCaps?.nodes?.[0] ?? null - }) + orgLimitCap: data.orgLimitCaps?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCap", "createOrgLimitCap", "orgLimitCap", args.select, args.data, "CreateOrgLimitCapInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCap', + 'createOrgLimitCap', + 'orgLimitCap', + args.select, + args.data, + 'CreateOrgLimitCapInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "createOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'createOrgLimitCap', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCapPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCap", "updateOrgLimitCap", "orgLimitCap", args.select, args.where.id, args.data, "UpdateOrgLimitCapInput", "id", "orgLimitCapPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCap', + 'updateOrgLimitCap', + 'orgLimitCap', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCapInput', + 'id', + 'orgLimitCapPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "updateOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'updateOrgLimitCap', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCap", "deleteOrgLimitCap", "orgLimitCap", { - id: args.where.id - }, "DeleteOrgLimitCapInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCap', + 'deleteOrgLimitCap', + 'orgLimitCap', + { + id: args.where.id, + }, + 'DeleteOrgLimitCapInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "deleteOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'deleteOrgLimitCap', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitCapsDefault.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitCapsDefault.ts index 333bc342a2..de62c801b7 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitCapsDefault.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitCapsDefault.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCapsDefault, OrgLimitCapsDefaultWithRelations, OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultFilter, OrgLimitCapsDefaultOrderBy, CreateOrgLimitCapsDefaultInput, UpdateOrgLimitCapsDefaultInput, OrgLimitCapsDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCapsDefault, + OrgLimitCapsDefaultWithRelations, + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy, + CreateOrgLimitCapsDefaultInput, + UpdateOrgLimitCapsDefaultInput, + OrgLimitCapsDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCapsDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", 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 - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + 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, + }, + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefaults", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefault", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCapsDefault": data.orgLimitCapsDefaults?.nodes?.[0] ?? null - }) + orgLimitCapsDefault: data.orgLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefault", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCapsDefault": data.orgLimitCapsDefaults?.nodes?.[0] ?? null - }) + orgLimitCapsDefault: data.orgLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCapsDefault", "createOrgLimitCapsDefault", "orgLimitCapsDefault", args.select, args.data, "CreateOrgLimitCapsDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCapsDefault', + 'createOrgLimitCapsDefault', + 'orgLimitCapsDefault', + args.select, + args.data, + 'CreateOrgLimitCapsDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "createOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'createOrgLimitCapsDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCapsDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCapsDefault", "updateOrgLimitCapsDefault", "orgLimitCapsDefault", args.select, args.where.id, args.data, "UpdateOrgLimitCapsDefaultInput", "id", "orgLimitCapsDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCapsDefault', + 'updateOrgLimitCapsDefault', + 'orgLimitCapsDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCapsDefaultInput', + 'id', + 'orgLimitCapsDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "updateOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'updateOrgLimitCapsDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCapsDefault", "deleteOrgLimitCapsDefault", "orgLimitCapsDefault", { - id: args.where.id - }, "DeleteOrgLimitCapsDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCapsDefault', + 'deleteOrgLimitCapsDefault', + 'orgLimitCapsDefault', + { + id: args.where.id, + }, + 'DeleteOrgLimitCapsDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "deleteOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'deleteOrgLimitCapsDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitCredit.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitCredit.ts index 0ef684e92b..497dd5d807 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitCredit.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitCredit.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCredit, OrgLimitCreditWithRelations, OrgLimitCreditSelect, OrgLimitCreditFilter, OrgLimitCreditOrderBy, CreateOrgLimitCreditInput, UpdateOrgLimitCreditInput, OrgLimitCreditPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCredit, + OrgLimitCreditWithRelations, + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy, + CreateOrgLimitCreditInput, + UpdateOrgLimitCreditInput, + OrgLimitCreditPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCreditModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCredit", "orgLimitCredits", 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 - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + 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, + }, + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredits", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCredit", "orgLimitCredits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredit", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCredit": data.orgLimitCredits?.nodes?.[0] ?? null - }) + orgLimitCredit: data.orgLimitCredits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCredit", "orgLimitCredits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredit", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCredit": data.orgLimitCredits?.nodes?.[0] ?? null - }) + orgLimitCredit: data.orgLimitCredits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCredit", "createOrgLimitCredit", "orgLimitCredit", args.select, args.data, "CreateOrgLimitCreditInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCredit', + 'createOrgLimitCredit', + 'orgLimitCredit', + args.select, + args.data, + 'CreateOrgLimitCreditInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "createOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'createOrgLimitCredit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCreditPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCredit", "updateOrgLimitCredit", "orgLimitCredit", args.select, args.where.id, args.data, "UpdateOrgLimitCreditInput", "id", "orgLimitCreditPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCredit', + 'updateOrgLimitCredit', + 'orgLimitCredit', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCreditInput', + 'id', + 'orgLimitCreditPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "updateOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'updateOrgLimitCredit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCredit", "deleteOrgLimitCredit", "orgLimitCredit", { - id: args.where.id - }, "DeleteOrgLimitCreditInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCredit', + 'deleteOrgLimitCredit', + 'orgLimitCredit', + { + id: args.where.id, + }, + 'DeleteOrgLimitCreditInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "deleteOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'deleteOrgLimitCredit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitDefault.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitDefault.ts index 3b1dfb8b6d..3c91177b9c 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitDefault.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitDefault.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitDefault, OrgLimitDefaultWithRelations, OrgLimitDefaultSelect, OrgLimitDefaultFilter, OrgLimitDefaultOrderBy, CreateOrgLimitDefaultInput, UpdateOrgLimitDefaultInput, OrgLimitDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitDefault, + OrgLimitDefaultWithRelations, + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy, + CreateOrgLimitDefaultInput, + UpdateOrgLimitDefaultInput, + OrgLimitDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitDefault", "orgLimitDefaults", 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 - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + 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, + }, + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefaults", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitDefault", "orgLimitDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefault", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitDefault": data.orgLimitDefaults?.nodes?.[0] ?? null - }) + orgLimitDefault: data.orgLimitDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitDefault", "orgLimitDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefault", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitDefault": data.orgLimitDefaults?.nodes?.[0] ?? null - }) + orgLimitDefault: data.orgLimitDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitDefault", "createOrgLimitDefault", "orgLimitDefault", args.select, args.data, "CreateOrgLimitDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitDefault', + 'createOrgLimitDefault', + 'orgLimitDefault', + args.select, + args.data, + 'CreateOrgLimitDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "createOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'createOrgLimitDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitDefault", "updateOrgLimitDefault", "orgLimitDefault", args.select, args.where.id, args.data, "UpdateOrgLimitDefaultInput", "id", "orgLimitDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitDefault', + 'updateOrgLimitDefault', + 'orgLimitDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitDefaultInput', + 'id', + 'orgLimitDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "updateOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'updateOrgLimitDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitDefault", "deleteOrgLimitDefault", "orgLimitDefault", { - id: args.where.id - }, "DeleteOrgLimitDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitDefault', + 'deleteOrgLimitDefault', + 'orgLimitDefault', + { + id: args.where.id, + }, + 'DeleteOrgLimitDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "deleteOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'deleteOrgLimitDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitEvent.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitEvent.ts index 957e209173..419737757d 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitEvent.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitEvent.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitEvent, OrgLimitEventWithRelations, OrgLimitEventSelect, OrgLimitEventFilter, OrgLimitEventOrderBy, CreateOrgLimitEventInput, UpdateOrgLimitEventInput, OrgLimitEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitEvent, + OrgLimitEventWithRelations, + OrgLimitEventSelect, + OrgLimitEventFilter, + OrgLimitEventOrderBy, + CreateOrgLimitEventInput, + UpdateOrgLimitEventInput, + OrgLimitEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitEvent", "orgLimitEvents", 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 - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + 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, + }, + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvents", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitEvent", "orgLimitEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvent", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitEvent": data.orgLimitEvents?.nodes?.[0] ?? null - }) + orgLimitEvent: data.orgLimitEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitEvent", "orgLimitEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvent", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class OrgLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitEvent": data.orgLimitEvents?.nodes?.[0] ?? null - }) + orgLimitEvent: data.orgLimitEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitEvent", "createOrgLimitEvent", "orgLimitEvent", args.select, args.data, "CreateOrgLimitEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitEvent', + 'createOrgLimitEvent', + 'orgLimitEvent', + args.select, + args.data, + 'CreateOrgLimitEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "createOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'createOrgLimitEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgLimitEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitEvent", "updateOrgLimitEvent", "orgLimitEvent", args.select, args.where.id, args.data, "UpdateOrgLimitEventInput", "id", "orgLimitEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitEvent', + 'updateOrgLimitEvent', + 'orgLimitEvent', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitEventInput', + 'id', + 'orgLimitEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "updateOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'updateOrgLimitEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitEvent", "deleteOrgLimitEvent", "orgLimitEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteOrgLimitEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitEvent', + 'deleteOrgLimitEvent', + 'orgLimitEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgLimitEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "deleteOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'deleteOrgLimitEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitWarning.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitWarning.ts index c87ba9cf50..67d887241a 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitWarning.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitWarning.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitWarning, OrgLimitWarningWithRelations, OrgLimitWarningSelect, OrgLimitWarningFilter, OrgLimitWarningOrderBy, CreateOrgLimitWarningInput, UpdateOrgLimitWarningInput, OrgLimitWarningPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitWarning, + OrgLimitWarningWithRelations, + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy, + CreateOrgLimitWarningInput, + UpdateOrgLimitWarningInput, + OrgLimitWarningPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitWarningModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarnings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitWarning", "orgLimitWarnings", 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 - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + 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, + }, + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarnings", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarnings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitWarning", "orgLimitWarnings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarning", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarning', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitWarning": data.orgLimitWarnings?.nodes?.[0] ?? null - }) + orgLimitWarning: data.orgLimitWarnings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitWarning", "orgLimitWarnings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarning", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarning', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitWarning": data.orgLimitWarnings?.nodes?.[0] ?? null - }) + orgLimitWarning: data.orgLimitWarnings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitWarning", "createOrgLimitWarning", "orgLimitWarning", args.select, args.data, "CreateOrgLimitWarningInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitWarning', + 'createOrgLimitWarning', + 'orgLimitWarning', + args.select, + args.data, + 'CreateOrgLimitWarningInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "createOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'createOrgLimitWarning', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitWarningPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitWarning", "updateOrgLimitWarning", "orgLimitWarning", args.select, args.where.id, args.data, "UpdateOrgLimitWarningInput", "id", "orgLimitWarningPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitWarning', + 'updateOrgLimitWarning', + 'orgLimitWarning', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitWarningInput', + 'id', + 'orgLimitWarningPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "updateOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'updateOrgLimitWarning', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitWarning", "deleteOrgLimitWarning", "orgLimitWarning", { - id: args.where.id - }, "DeleteOrgLimitWarningInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitWarning', + 'deleteOrgLimitWarning', + 'orgLimitWarning', + { + id: args.where.id, + }, + 'DeleteOrgLimitWarningInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "deleteOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'deleteOrgLimitWarning', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/mutation/index.ts b/sdk/constructive-cli/src/usage/orm/mutation/index.ts index 9c8a2c2e94..176d63791b 100644 --- a/sdk/constructive-cli/src/usage/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/usage/orm/mutation/index.ts @@ -3,11 +3,27 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, SeedAppLimitCapsDefaultsInput, SeedAppLimitDefaultsInput, SeedOrgLimitCapsDefaultsInput, SeedOrgLimitDefaultsInput, ProvisionBucketPayload, SeedAppLimitCapsDefaultsPayload, SeedAppLimitDefaultsPayload, SeedOrgLimitCapsDefaultsPayload, SeedOrgLimitDefaultsPayload, ProvisionBucketPayloadSelect, SeedAppLimitCapsDefaultsPayloadSelect, SeedAppLimitDefaultsPayloadSelect, SeedOrgLimitCapsDefaultsPayloadSelect, SeedOrgLimitDefaultsPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + SeedAppLimitCapsDefaultsInput, + SeedAppLimitDefaultsInput, + SeedOrgLimitCapsDefaultsInput, + SeedOrgLimitDefaultsInput, + ProvisionBucketPayload, + SeedAppLimitCapsDefaultsPayload, + SeedAppLimitDefaultsPayload, + SeedOrgLimitCapsDefaultsPayload, + SeedOrgLimitDefaultsPayload, + ProvisionBucketPayloadSelect, + SeedAppLimitCapsDefaultsPayloadSelect, + SeedAppLimitDefaultsPayloadSelect, + SeedOrgLimitCapsDefaultsPayloadSelect, + SeedOrgLimitDefaultsPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -32,75 +48,150 @@ export interface SeedOrgLimitDefaultsVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - seedAppLimitCapsDefaults: (args: SeedAppLimitCapsDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedAppLimitCapsDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedAppLimitCapsDefaults", - fieldName: "seedAppLimitCapsDefaults", - ...buildCustomDocument("mutation", "SeedAppLimitCapsDefaults", "seedAppLimitCapsDefaults", options.select, args, [{ - name: "input", - type: "SeedAppLimitCapsDefaultsInput!" - }], connectionFieldsMap, "SeedAppLimitCapsDefaultsPayload") - }), - seedAppLimitDefaults: (args: SeedAppLimitDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedAppLimitDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedAppLimitDefaults", - fieldName: "seedAppLimitDefaults", - ...buildCustomDocument("mutation", "SeedAppLimitDefaults", "seedAppLimitDefaults", options.select, args, [{ - name: "input", - type: "SeedAppLimitDefaultsInput!" - }], connectionFieldsMap, "SeedAppLimitDefaultsPayload") - }), - seedOrgLimitCapsDefaults: (args: SeedOrgLimitCapsDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedOrgLimitCapsDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedOrgLimitCapsDefaults", - fieldName: "seedOrgLimitCapsDefaults", - ...buildCustomDocument("mutation", "SeedOrgLimitCapsDefaults", "seedOrgLimitCapsDefaults", options.select, args, [{ - name: "input", - type: "SeedOrgLimitCapsDefaultsInput!" - }], connectionFieldsMap, "SeedOrgLimitCapsDefaultsPayload") - }), - seedOrgLimitDefaults: (args: SeedOrgLimitDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedOrgLimitDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedOrgLimitDefaults", - fieldName: "seedOrgLimitDefaults", - ...buildCustomDocument("mutation", "SeedOrgLimitDefaults", "seedOrgLimitDefaults", options.select, args, [{ - name: "input", - type: "SeedOrgLimitDefaultsInput!" - }], connectionFieldsMap, "SeedOrgLimitDefaultsPayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + seedAppLimitCapsDefaults: ( + args: SeedAppLimitCapsDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedAppLimitCapsDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedAppLimitCapsDefaults', + fieldName: 'seedAppLimitCapsDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedAppLimitCapsDefaults', + 'seedAppLimitCapsDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedAppLimitCapsDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedAppLimitCapsDefaultsPayload' + ), + }), + seedAppLimitDefaults: ( + args: SeedAppLimitDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedAppLimitDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedAppLimitDefaults', + fieldName: 'seedAppLimitDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedAppLimitDefaults', + 'seedAppLimitDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedAppLimitDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedAppLimitDefaultsPayload' + ), + }), + seedOrgLimitCapsDefaults: ( + args: SeedOrgLimitCapsDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedOrgLimitCapsDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedOrgLimitCapsDefaults', + fieldName: 'seedOrgLimitCapsDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedOrgLimitCapsDefaults', + 'seedOrgLimitCapsDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedOrgLimitCapsDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedOrgLimitCapsDefaultsPayload' + ), + }), + seedOrgLimitDefaults: ( + args: SeedOrgLimitDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedOrgLimitDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedOrgLimitDefaults', + fieldName: 'seedOrgLimitDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedOrgLimitDefaults', + 'seedOrgLimitDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedOrgLimitDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedOrgLimitDefaultsPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-cli/src/usage/orm/query-builder.ts b/sdk/constructive-cli/src/usage/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-cli/src/usage/orm/query-builder.ts +++ b/sdk/constructive-cli/src/usage/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-cli/src/usage/orm/realtime.ts b/sdk/constructive-cli/src/usage/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-cli/src/usage/orm/realtime.ts +++ b/sdk/constructive-cli/src/usage/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-cli/src/usage/orm/select-types.ts b/sdk/constructive-cli/src/usage/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-cli/src/usage/orm/select-types.ts +++ b/sdk/constructive-cli/src/usage/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/admin/hooks/client.ts b/sdk/constructive-react/src/admin/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/admin/hooks/client.ts +++ b/sdk/constructive-react/src/admin/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/admin/hooks/index.ts b/sdk/constructive-react/src/admin/hooks/index.ts index 334c6c49f3..f807decd5f 100644 --- a/sdk/constructive-react/src/admin/hooks/index.ts +++ b/sdk/constructive-react/src/admin/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: AppAdminGrant, AppClaimedInvite, AppGrant, AppInvite, AppMembership, AppMembershipDefault, AppOwnerGrant, AppPermission, AppPermissionDefault, AppPermissionDefaultGrant, AppPermissionDefaultPermission, MembershipType, OrgAdminGrant, OrgClaimedInvite, OrgGrant, OrgInvite, OrgMember, OrgMemberProfile, OrgMembership, OrgMembershipDefault, OrgMembershipSetting, OrgOwnerGrant, OrgPermission, OrgPermissionDefault, OrgPermissionDefaultGrant, OrgPermissionDefaultPermission - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/admin/hooks/invalidation.ts b/sdk/constructive-react/src/admin/hooks/invalidation.ts index bdb997e396..077cb6dd70 100644 --- a/sdk/constructive-react/src/admin/hooks/invalidation.ts +++ b/sdk/constructive-react/src/admin/hooks/invalidation.ts @@ -13,8 +13,35 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { appAdminGrantKeys, appClaimedInviteKeys, appGrantKeys, appInviteKeys, appMembershipKeys, appMembershipDefaultKeys, appOwnerGrantKeys, appPermissionKeys, appPermissionDefaultKeys, appPermissionDefaultGrantKeys, appPermissionDefaultPermissionKeys, membershipTypeKeys, orgAdminGrantKeys, orgClaimedInviteKeys, orgGrantKeys, orgInviteKeys, orgMemberKeys, orgMemberProfileKeys, orgMembershipKeys, orgMembershipDefaultKeys, orgMembershipSettingKeys, orgOwnerGrantKeys, orgPermissionKeys, orgPermissionDefaultKeys, orgPermissionDefaultGrantKeys, orgPermissionDefaultPermissionKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + appAdminGrantKeys, + appClaimedInviteKeys, + appGrantKeys, + appInviteKeys, + appMembershipKeys, + appMembershipDefaultKeys, + appOwnerGrantKeys, + appPermissionKeys, + appPermissionDefaultKeys, + appPermissionDefaultGrantKeys, + appPermissionDefaultPermissionKeys, + membershipTypeKeys, + orgAdminGrantKeys, + orgClaimedInviteKeys, + orgGrantKeys, + orgInviteKeys, + orgMemberKeys, + orgMemberProfileKeys, + orgMembershipKeys, + orgMembershipDefaultKeys, + orgMembershipSettingKeys, + orgOwnerGrantKeys, + orgPermissionKeys, + orgPermissionDefaultKeys, + orgPermissionDefaultGrantKeys, + orgPermissionDefaultPermissionKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,292 +62,446 @@ import { appAdminGrantKeys, appClaimedInviteKeys, appGrantKeys, appInviteKeys, a * ``` */ export const invalidate = { - /** Invalidate appAdminGrant queries */appAdminGrant: { - /** Invalidate all appAdminGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appAdminGrantKeys.all - }), - /** Invalidate appAdminGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appAdminGrantKeys.lists() - }), - /** Invalidate a specific appAdminGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appAdminGrantKeys.detail(id) - }) - }, - /** Invalidate appClaimedInvite queries */appClaimedInvite: { - /** Invalidate all appClaimedInvite queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appClaimedInviteKeys.all - }), - /** Invalidate appClaimedInvite list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appClaimedInviteKeys.lists() - }), - /** Invalidate a specific appClaimedInvite */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appClaimedInviteKeys.detail(id) - }) - }, - /** Invalidate appGrant queries */appGrant: { - /** Invalidate all appGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appGrantKeys.all - }), - /** Invalidate appGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appGrantKeys.lists() - }), - /** Invalidate a specific appGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appGrantKeys.detail(id) - }) - }, - /** Invalidate appInvite queries */appInvite: { - /** Invalidate all appInvite queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appInviteKeys.all - }), - /** Invalidate appInvite list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appInviteKeys.lists() - }), - /** Invalidate a specific appInvite */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appInviteKeys.detail(id) - }) - }, - /** Invalidate appMembership queries */appMembership: { - /** Invalidate all appMembership queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appMembershipKeys.all - }), - /** Invalidate appMembership list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appMembershipKeys.lists() - }), - /** Invalidate a specific appMembership */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appMembershipKeys.detail(id) - }) - }, - /** Invalidate appMembershipDefault queries */appMembershipDefault: { - /** Invalidate all appMembershipDefault queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appMembershipDefaultKeys.all - }), - /** Invalidate appMembershipDefault list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appMembershipDefaultKeys.lists() - }), - /** Invalidate a specific appMembershipDefault */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appMembershipDefaultKeys.detail(id) - }) - }, - /** Invalidate appOwnerGrant queries */appOwnerGrant: { - /** Invalidate all appOwnerGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appOwnerGrantKeys.all - }), - /** Invalidate appOwnerGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appOwnerGrantKeys.lists() - }), - /** Invalidate a specific appOwnerGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appOwnerGrantKeys.detail(id) - }) - }, - /** Invalidate appPermission queries */appPermission: { - /** Invalidate all appPermission queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appPermissionKeys.all - }), - /** Invalidate appPermission list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appPermissionKeys.lists() - }), - /** Invalidate a specific appPermission */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appPermissionKeys.detail(id) - }) - }, - /** Invalidate appPermissionDefault queries */appPermissionDefault: { - /** Invalidate all appPermissionDefault queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultKeys.all - }), - /** Invalidate appPermissionDefault list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultKeys.lists() - }), - /** Invalidate a specific appPermissionDefault */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultKeys.detail(id) - }) - }, - /** Invalidate appPermissionDefaultGrant queries */appPermissionDefaultGrant: { - /** Invalidate all appPermissionDefaultGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultGrantKeys.all - }), - /** Invalidate appPermissionDefaultGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultGrantKeys.lists() - }), - /** Invalidate a specific appPermissionDefaultGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultGrantKeys.detail(id) - }) - }, - /** Invalidate appPermissionDefaultPermission queries */appPermissionDefaultPermission: { - /** Invalidate all appPermissionDefaultPermission queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultPermissionKeys.all - }), - /** Invalidate appPermissionDefaultPermission list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultPermissionKeys.lists() - }), - /** Invalidate a specific appPermissionDefaultPermission */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appPermissionDefaultPermissionKeys.detail(id) - }) - }, - /** Invalidate membershipType queries */membershipType: { - /** Invalidate all membershipType queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: membershipTypeKeys.all - }), - /** Invalidate membershipType list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: membershipTypeKeys.lists() - }), - /** Invalidate a specific membershipType */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: membershipTypeKeys.detail(id) - }) - }, - /** Invalidate orgAdminGrant queries */orgAdminGrant: { - /** Invalidate all orgAdminGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgAdminGrantKeys.all - }), - /** Invalidate orgAdminGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgAdminGrantKeys.lists() - }), - /** Invalidate a specific orgAdminGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgAdminGrantKeys.detail(id) - }) - }, - /** Invalidate orgClaimedInvite queries */orgClaimedInvite: { - /** Invalidate all orgClaimedInvite queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgClaimedInviteKeys.all - }), - /** Invalidate orgClaimedInvite list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgClaimedInviteKeys.lists() - }), - /** Invalidate a specific orgClaimedInvite */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgClaimedInviteKeys.detail(id) - }) - }, - /** Invalidate orgGrant queries */orgGrant: { - /** Invalidate all orgGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgGrantKeys.all - }), - /** Invalidate orgGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgGrantKeys.lists() - }), - /** Invalidate a specific orgGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgGrantKeys.detail(id) - }) - }, - /** Invalidate orgInvite queries */orgInvite: { - /** Invalidate all orgInvite queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgInviteKeys.all - }), - /** Invalidate orgInvite list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgInviteKeys.lists() - }), - /** Invalidate a specific orgInvite */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgInviteKeys.detail(id) - }) - }, - /** Invalidate orgMember queries */orgMember: { - /** Invalidate all orgMember queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMemberKeys.all - }), - /** Invalidate orgMember list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMemberKeys.lists() - }), - /** Invalidate a specific orgMember */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgMemberKeys.detail(id) - }) - }, - /** Invalidate orgMemberProfile queries */orgMemberProfile: { - /** Invalidate all orgMemberProfile queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMemberProfileKeys.all - }), - /** Invalidate orgMemberProfile list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMemberProfileKeys.lists() - }), - /** Invalidate a specific orgMemberProfile */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgMemberProfileKeys.detail(id) - }) - }, - /** Invalidate orgMembership queries */orgMembership: { - /** Invalidate all orgMembership queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMembershipKeys.all - }), - /** Invalidate orgMembership list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMembershipKeys.lists() - }), - /** Invalidate a specific orgMembership */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgMembershipKeys.detail(id) - }) - }, - /** Invalidate orgMembershipDefault queries */orgMembershipDefault: { - /** Invalidate all orgMembershipDefault queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMembershipDefaultKeys.all - }), - /** Invalidate orgMembershipDefault list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMembershipDefaultKeys.lists() - }), - /** Invalidate a specific orgMembershipDefault */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgMembershipDefaultKeys.detail(id) - }) - }, - /** Invalidate orgMembershipSetting queries */orgMembershipSetting: { - /** Invalidate all orgMembershipSetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMembershipSettingKeys.all - }), - /** Invalidate orgMembershipSetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgMembershipSettingKeys.lists() - }), - /** Invalidate a specific orgMembershipSetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgMembershipSettingKeys.detail(id) - }) - }, - /** Invalidate orgOwnerGrant queries */orgOwnerGrant: { - /** Invalidate all orgOwnerGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgOwnerGrantKeys.all - }), - /** Invalidate orgOwnerGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgOwnerGrantKeys.lists() - }), - /** Invalidate a specific orgOwnerGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgOwnerGrantKeys.detail(id) - }) - }, - /** Invalidate orgPermission queries */orgPermission: { - /** Invalidate all orgPermission queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgPermissionKeys.all - }), - /** Invalidate orgPermission list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgPermissionKeys.lists() - }), - /** Invalidate a specific orgPermission */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgPermissionKeys.detail(id) - }) - }, - /** Invalidate orgPermissionDefault queries */orgPermissionDefault: { - /** Invalidate all orgPermissionDefault queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultKeys.all - }), - /** Invalidate orgPermissionDefault list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultKeys.lists() - }), - /** Invalidate a specific orgPermissionDefault */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultKeys.detail(id) - }) - }, - /** Invalidate orgPermissionDefaultGrant queries */orgPermissionDefaultGrant: { - /** Invalidate all orgPermissionDefaultGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultGrantKeys.all - }), - /** Invalidate orgPermissionDefaultGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultGrantKeys.lists() - }), - /** Invalidate a specific orgPermissionDefaultGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultGrantKeys.detail(id) - }) - }, - /** Invalidate orgPermissionDefaultPermission queries */orgPermissionDefaultPermission: { - /** Invalidate all orgPermissionDefaultPermission queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultPermissionKeys.all - }), - /** Invalidate orgPermissionDefaultPermission list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultPermissionKeys.lists() - }), - /** Invalidate a specific orgPermissionDefaultPermission */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultPermissionKeys.detail(id) - }) - } + /** Invalidate appAdminGrant queries */ appAdminGrant: { + /** Invalidate all appAdminGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appAdminGrantKeys.all, + }), + /** Invalidate appAdminGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appAdminGrantKeys.lists(), + }), + /** Invalidate a specific appAdminGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appAdminGrantKeys.detail(id), + }), + }, + /** Invalidate appClaimedInvite queries */ appClaimedInvite: { + /** Invalidate all appClaimedInvite queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appClaimedInviteKeys.all, + }), + /** Invalidate appClaimedInvite list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appClaimedInviteKeys.lists(), + }), + /** Invalidate a specific appClaimedInvite */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appClaimedInviteKeys.detail(id), + }), + }, + /** Invalidate appGrant queries */ appGrant: { + /** Invalidate all appGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appGrantKeys.all, + }), + /** Invalidate appGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appGrantKeys.lists(), + }), + /** Invalidate a specific appGrant */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: appGrantKeys.detail(id), + }), + }, + /** Invalidate appInvite queries */ appInvite: { + /** Invalidate all appInvite queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appInviteKeys.all, + }), + /** Invalidate appInvite list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appInviteKeys.lists(), + }), + /** Invalidate a specific appInvite */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appInviteKeys.detail(id), + }), + }, + /** Invalidate appMembership queries */ appMembership: { + /** Invalidate all appMembership queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appMembershipKeys.all, + }), + /** Invalidate appMembership list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appMembershipKeys.lists(), + }), + /** Invalidate a specific appMembership */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appMembershipKeys.detail(id), + }), + }, + /** Invalidate appMembershipDefault queries */ appMembershipDefault: { + /** Invalidate all appMembershipDefault queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appMembershipDefaultKeys.all, + }), + /** Invalidate appMembershipDefault list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appMembershipDefaultKeys.lists(), + }), + /** Invalidate a specific appMembershipDefault */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appMembershipDefaultKeys.detail(id), + }), + }, + /** Invalidate appOwnerGrant queries */ appOwnerGrant: { + /** Invalidate all appOwnerGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appOwnerGrantKeys.all, + }), + /** Invalidate appOwnerGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appOwnerGrantKeys.lists(), + }), + /** Invalidate a specific appOwnerGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appOwnerGrantKeys.detail(id), + }), + }, + /** Invalidate appPermission queries */ appPermission: { + /** Invalidate all appPermission queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appPermissionKeys.all, + }), + /** Invalidate appPermission list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appPermissionKeys.lists(), + }), + /** Invalidate a specific appPermission */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appPermissionKeys.detail(id), + }), + }, + /** Invalidate appPermissionDefault queries */ appPermissionDefault: { + /** Invalidate all appPermissionDefault queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultKeys.all, + }), + /** Invalidate appPermissionDefault list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultKeys.lists(), + }), + /** Invalidate a specific appPermissionDefault */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultKeys.detail(id), + }), + }, + /** Invalidate appPermissionDefaultGrant queries */ appPermissionDefaultGrant: { + /** Invalidate all appPermissionDefaultGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultGrantKeys.all, + }), + /** Invalidate appPermissionDefaultGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultGrantKeys.lists(), + }), + /** Invalidate a specific appPermissionDefaultGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultGrantKeys.detail(id), + }), + }, + /** Invalidate appPermissionDefaultPermission queries */ appPermissionDefaultPermission: { + /** Invalidate all appPermissionDefaultPermission queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultPermissionKeys.all, + }), + /** Invalidate appPermissionDefaultPermission list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultPermissionKeys.lists(), + }), + /** Invalidate a specific appPermissionDefaultPermission */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appPermissionDefaultPermissionKeys.detail(id), + }), + }, + /** Invalidate membershipType queries */ membershipType: { + /** Invalidate all membershipType queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: membershipTypeKeys.all, + }), + /** Invalidate membershipType list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: membershipTypeKeys.lists(), + }), + /** Invalidate a specific membershipType */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: membershipTypeKeys.detail(id), + }), + }, + /** Invalidate orgAdminGrant queries */ orgAdminGrant: { + /** Invalidate all orgAdminGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgAdminGrantKeys.all, + }), + /** Invalidate orgAdminGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgAdminGrantKeys.lists(), + }), + /** Invalidate a specific orgAdminGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgAdminGrantKeys.detail(id), + }), + }, + /** Invalidate orgClaimedInvite queries */ orgClaimedInvite: { + /** Invalidate all orgClaimedInvite queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgClaimedInviteKeys.all, + }), + /** Invalidate orgClaimedInvite list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgClaimedInviteKeys.lists(), + }), + /** Invalidate a specific orgClaimedInvite */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgClaimedInviteKeys.detail(id), + }), + }, + /** Invalidate orgGrant queries */ orgGrant: { + /** Invalidate all orgGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgGrantKeys.all, + }), + /** Invalidate orgGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgGrantKeys.lists(), + }), + /** Invalidate a specific orgGrant */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: orgGrantKeys.detail(id), + }), + }, + /** Invalidate orgInvite queries */ orgInvite: { + /** Invalidate all orgInvite queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgInviteKeys.all, + }), + /** Invalidate orgInvite list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgInviteKeys.lists(), + }), + /** Invalidate a specific orgInvite */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgInviteKeys.detail(id), + }), + }, + /** Invalidate orgMember queries */ orgMember: { + /** Invalidate all orgMember queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMemberKeys.all, + }), + /** Invalidate orgMember list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMemberKeys.lists(), + }), + /** Invalidate a specific orgMember */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgMemberKeys.detail(id), + }), + }, + /** Invalidate orgMemberProfile queries */ orgMemberProfile: { + /** Invalidate all orgMemberProfile queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMemberProfileKeys.all, + }), + /** Invalidate orgMemberProfile list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMemberProfileKeys.lists(), + }), + /** Invalidate a specific orgMemberProfile */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgMemberProfileKeys.detail(id), + }), + }, + /** Invalidate orgMembership queries */ orgMembership: { + /** Invalidate all orgMembership queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMembershipKeys.all, + }), + /** Invalidate orgMembership list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMembershipKeys.lists(), + }), + /** Invalidate a specific orgMembership */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgMembershipKeys.detail(id), + }), + }, + /** Invalidate orgMembershipDefault queries */ orgMembershipDefault: { + /** Invalidate all orgMembershipDefault queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMembershipDefaultKeys.all, + }), + /** Invalidate orgMembershipDefault list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMembershipDefaultKeys.lists(), + }), + /** Invalidate a specific orgMembershipDefault */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgMembershipDefaultKeys.detail(id), + }), + }, + /** Invalidate orgMembershipSetting queries */ orgMembershipSetting: { + /** Invalidate all orgMembershipSetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMembershipSettingKeys.all, + }), + /** Invalidate orgMembershipSetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgMembershipSettingKeys.lists(), + }), + /** Invalidate a specific orgMembershipSetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgMembershipSettingKeys.detail(id), + }), + }, + /** Invalidate orgOwnerGrant queries */ orgOwnerGrant: { + /** Invalidate all orgOwnerGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgOwnerGrantKeys.all, + }), + /** Invalidate orgOwnerGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgOwnerGrantKeys.lists(), + }), + /** Invalidate a specific orgOwnerGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgOwnerGrantKeys.detail(id), + }), + }, + /** Invalidate orgPermission queries */ orgPermission: { + /** Invalidate all orgPermission queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgPermissionKeys.all, + }), + /** Invalidate orgPermission list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgPermissionKeys.lists(), + }), + /** Invalidate a specific orgPermission */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgPermissionKeys.detail(id), + }), + }, + /** Invalidate orgPermissionDefault queries */ orgPermissionDefault: { + /** Invalidate all orgPermissionDefault queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultKeys.all, + }), + /** Invalidate orgPermissionDefault list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultKeys.lists(), + }), + /** Invalidate a specific orgPermissionDefault */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultKeys.detail(id), + }), + }, + /** Invalidate orgPermissionDefaultGrant queries */ orgPermissionDefaultGrant: { + /** Invalidate all orgPermissionDefaultGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultGrantKeys.all, + }), + /** Invalidate orgPermissionDefaultGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultGrantKeys.lists(), + }), + /** Invalidate a specific orgPermissionDefaultGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultGrantKeys.detail(id), + }), + }, + /** Invalidate orgPermissionDefaultPermission queries */ orgPermissionDefaultPermission: { + /** Invalidate all orgPermissionDefaultPermission queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultPermissionKeys.all, + }), + /** Invalidate orgPermissionDefaultPermission list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultPermissionKeys.lists(), + }), + /** Invalidate a specific orgPermissionDefaultPermission */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgPermissionDefaultPermissionKeys.detail(id), + }), + }, } as const; /** @@ -334,134 +515,197 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove appAdminGrant from cache */appAdminGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove appAdminGrant from cache */ appAdminGrant: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appAdminGrantKeys.detail(id) + queryKey: appAdminGrantKeys.detail(id), }); }, - /** Remove appClaimedInvite from cache */appClaimedInvite: (queryClient: QueryClient, id: string | number) => { + /** Remove appClaimedInvite from cache */ appClaimedInvite: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appClaimedInviteKeys.detail(id) + queryKey: appClaimedInviteKeys.detail(id), }); }, - /** Remove appGrant from cache */appGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove appGrant from cache */ appGrant: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: appGrantKeys.detail(id) + queryKey: appGrantKeys.detail(id), }); }, - /** Remove appInvite from cache */appInvite: (queryClient: QueryClient, id: string | number) => { + /** Remove appInvite from cache */ appInvite: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: appInviteKeys.detail(id) + queryKey: appInviteKeys.detail(id), }); }, - /** Remove appMembership from cache */appMembership: (queryClient: QueryClient, id: string | number) => { + /** Remove appMembership from cache */ appMembership: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appMembershipKeys.detail(id) + queryKey: appMembershipKeys.detail(id), }); }, - /** Remove appMembershipDefault from cache */appMembershipDefault: (queryClient: QueryClient, id: string | number) => { + /** Remove appMembershipDefault from cache */ appMembershipDefault: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appMembershipDefaultKeys.detail(id) + queryKey: appMembershipDefaultKeys.detail(id), }); }, - /** Remove appOwnerGrant from cache */appOwnerGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove appOwnerGrant from cache */ appOwnerGrant: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appOwnerGrantKeys.detail(id) + queryKey: appOwnerGrantKeys.detail(id), }); }, - /** Remove appPermission from cache */appPermission: (queryClient: QueryClient, id: string | number) => { + /** Remove appPermission from cache */ appPermission: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appPermissionKeys.detail(id) + queryKey: appPermissionKeys.detail(id), }); }, - /** Remove appPermissionDefault from cache */appPermissionDefault: (queryClient: QueryClient, id: string | number) => { + /** Remove appPermissionDefault from cache */ appPermissionDefault: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appPermissionDefaultKeys.detail(id) + queryKey: appPermissionDefaultKeys.detail(id), }); }, - /** Remove appPermissionDefaultGrant from cache */appPermissionDefaultGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove appPermissionDefaultGrant from cache */ appPermissionDefaultGrant: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appPermissionDefaultGrantKeys.detail(id) + queryKey: appPermissionDefaultGrantKeys.detail(id), }); }, - /** Remove appPermissionDefaultPermission from cache */appPermissionDefaultPermission: (queryClient: QueryClient, id: string | number) => { + /** Remove appPermissionDefaultPermission from cache */ appPermissionDefaultPermission: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appPermissionDefaultPermissionKeys.detail(id) + queryKey: appPermissionDefaultPermissionKeys.detail(id), }); }, - /** Remove membershipType from cache */membershipType: (queryClient: QueryClient, id: string | number) => { + /** Remove membershipType from cache */ membershipType: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: membershipTypeKeys.detail(id) + queryKey: membershipTypeKeys.detail(id), }); }, - /** Remove orgAdminGrant from cache */orgAdminGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove orgAdminGrant from cache */ orgAdminGrant: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgAdminGrantKeys.detail(id) + queryKey: orgAdminGrantKeys.detail(id), }); }, - /** Remove orgClaimedInvite from cache */orgClaimedInvite: (queryClient: QueryClient, id: string | number) => { + /** Remove orgClaimedInvite from cache */ orgClaimedInvite: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgClaimedInviteKeys.detail(id) + queryKey: orgClaimedInviteKeys.detail(id), }); }, - /** Remove orgGrant from cache */orgGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove orgGrant from cache */ orgGrant: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: orgGrantKeys.detail(id) + queryKey: orgGrantKeys.detail(id), }); }, - /** Remove orgInvite from cache */orgInvite: (queryClient: QueryClient, id: string | number) => { + /** Remove orgInvite from cache */ orgInvite: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: orgInviteKeys.detail(id) + queryKey: orgInviteKeys.detail(id), }); }, - /** Remove orgMember from cache */orgMember: (queryClient: QueryClient, id: string | number) => { + /** Remove orgMember from cache */ orgMember: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: orgMemberKeys.detail(id) + queryKey: orgMemberKeys.detail(id), }); }, - /** Remove orgMemberProfile from cache */orgMemberProfile: (queryClient: QueryClient, id: string | number) => { + /** Remove orgMemberProfile from cache */ orgMemberProfile: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgMemberProfileKeys.detail(id) + queryKey: orgMemberProfileKeys.detail(id), }); }, - /** Remove orgMembership from cache */orgMembership: (queryClient: QueryClient, id: string | number) => { + /** Remove orgMembership from cache */ orgMembership: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgMembershipKeys.detail(id) + queryKey: orgMembershipKeys.detail(id), }); }, - /** Remove orgMembershipDefault from cache */orgMembershipDefault: (queryClient: QueryClient, id: string | number) => { + /** Remove orgMembershipDefault from cache */ orgMembershipDefault: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgMembershipDefaultKeys.detail(id) + queryKey: orgMembershipDefaultKeys.detail(id), }); }, - /** Remove orgMembershipSetting from cache */orgMembershipSetting: (queryClient: QueryClient, id: string | number) => { + /** Remove orgMembershipSetting from cache */ orgMembershipSetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgMembershipSettingKeys.detail(id) + queryKey: orgMembershipSettingKeys.detail(id), }); }, - /** Remove orgOwnerGrant from cache */orgOwnerGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove orgOwnerGrant from cache */ orgOwnerGrant: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgOwnerGrantKeys.detail(id) + queryKey: orgOwnerGrantKeys.detail(id), }); }, - /** Remove orgPermission from cache */orgPermission: (queryClient: QueryClient, id: string | number) => { + /** Remove orgPermission from cache */ orgPermission: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgPermissionKeys.detail(id) + queryKey: orgPermissionKeys.detail(id), }); }, - /** Remove orgPermissionDefault from cache */orgPermissionDefault: (queryClient: QueryClient, id: string | number) => { + /** Remove orgPermissionDefault from cache */ orgPermissionDefault: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgPermissionDefaultKeys.detail(id) + queryKey: orgPermissionDefaultKeys.detail(id), }); }, - /** Remove orgPermissionDefaultGrant from cache */orgPermissionDefaultGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove orgPermissionDefaultGrant from cache */ orgPermissionDefaultGrant: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgPermissionDefaultGrantKeys.detail(id) + queryKey: orgPermissionDefaultGrantKeys.detail(id), }); }, - /** Remove orgPermissionDefaultPermission from cache */orgPermissionDefaultPermission: (queryClient: QueryClient, id: string | number) => { + /** Remove orgPermissionDefaultPermission from cache */ orgPermissionDefaultPermission: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgPermissionDefaultPermissionKeys.detail(id) + queryKey: orgPermissionDefaultPermissionKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/admin/hooks/mutation-keys.ts b/sdk/constructive-react/src/admin/hooks/mutation-keys.ts index 94735aa164..7b8418db69 100644 --- a/sdk/constructive-react/src/admin/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/admin/hooks/mutation-keys.ts @@ -19,160 +19,245 @@ // ============================================================================ export const appAdminGrantMutationKeys = { - /** All appAdminGrant mutation keys */all: ["mutation", "appadmingrant"] as const, - /** Create appAdminGrant mutation key */create: () => ["mutation", "appadmingrant", "create"] as const, - /** Update appAdminGrant mutation key */update: (id: string | number) => ["mutation", "appadmingrant", "update", id] as const, - /** Delete appAdminGrant mutation key */delete: (id: string | number) => ["mutation", "appadmingrant", "delete", id] as const + /** All appAdminGrant mutation keys */ all: ['mutation', 'appadmingrant'] as const, + /** Create appAdminGrant mutation key */ create: () => + ['mutation', 'appadmingrant', 'create'] as const, + /** Update appAdminGrant mutation key */ update: (id: string | number) => + ['mutation', 'appadmingrant', 'update', id] as const, + /** Delete appAdminGrant mutation key */ delete: (id: string | number) => + ['mutation', 'appadmingrant', 'delete', id] as const, } as const; export const appClaimedInviteMutationKeys = { - /** All appClaimedInvite mutation keys */all: ["mutation", "appclaimedinvite"] as const, - /** Create appClaimedInvite mutation key */create: () => ["mutation", "appclaimedinvite", "create"] as const, - /** Update appClaimedInvite mutation key */update: (id: string | number) => ["mutation", "appclaimedinvite", "update", id] as const, - /** Delete appClaimedInvite mutation key */delete: (id: string | number) => ["mutation", "appclaimedinvite", "delete", id] as const + /** All appClaimedInvite mutation keys */ all: ['mutation', 'appclaimedinvite'] as const, + /** Create appClaimedInvite mutation key */ create: () => + ['mutation', 'appclaimedinvite', 'create'] as const, + /** Update appClaimedInvite mutation key */ update: (id: string | number) => + ['mutation', 'appclaimedinvite', 'update', id] as const, + /** Delete appClaimedInvite mutation key */ delete: (id: string | number) => + ['mutation', 'appclaimedinvite', 'delete', id] as const, } as const; export const appGrantMutationKeys = { - /** All appGrant mutation keys */all: ["mutation", "appgrant"] as const, - /** Create appGrant mutation key */create: () => ["mutation", "appgrant", "create"] as const, - /** Update appGrant mutation key */update: (id: string | number) => ["mutation", "appgrant", "update", id] as const, - /** Delete appGrant mutation key */delete: (id: string | number) => ["mutation", "appgrant", "delete", id] as const + /** All appGrant mutation keys */ all: ['mutation', 'appgrant'] as const, + /** Create appGrant mutation key */ create: () => ['mutation', 'appgrant', 'create'] as const, + /** Update appGrant mutation key */ update: (id: string | number) => + ['mutation', 'appgrant', 'update', id] as const, + /** Delete appGrant mutation key */ delete: (id: string | number) => + ['mutation', 'appgrant', 'delete', id] as const, } as const; export const appInviteMutationKeys = { - /** All appInvite mutation keys */all: ["mutation", "appinvite"] as const, - /** Create appInvite mutation key */create: () => ["mutation", "appinvite", "create"] as const, - /** Update appInvite mutation key */update: (id: string | number) => ["mutation", "appinvite", "update", id] as const, - /** Delete appInvite mutation key */delete: (id: string | number) => ["mutation", "appinvite", "delete", id] as const + /** All appInvite mutation keys */ all: ['mutation', 'appinvite'] as const, + /** Create appInvite mutation key */ create: () => ['mutation', 'appinvite', 'create'] as const, + /** Update appInvite mutation key */ update: (id: string | number) => + ['mutation', 'appinvite', 'update', id] as const, + /** Delete appInvite mutation key */ delete: (id: string | number) => + ['mutation', 'appinvite', 'delete', id] as const, } as const; export const appMembershipMutationKeys = { - /** All appMembership mutation keys */all: ["mutation", "appmembership"] as const, - /** Create appMembership mutation key */create: () => ["mutation", "appmembership", "create"] as const, - /** Update appMembership mutation key */update: (id: string | number) => ["mutation", "appmembership", "update", id] as const, - /** Delete appMembership mutation key */delete: (id: string | number) => ["mutation", "appmembership", "delete", id] as const + /** All appMembership mutation keys */ all: ['mutation', 'appmembership'] as const, + /** Create appMembership mutation key */ create: () => + ['mutation', 'appmembership', 'create'] as const, + /** Update appMembership mutation key */ update: (id: string | number) => + ['mutation', 'appmembership', 'update', id] as const, + /** Delete appMembership mutation key */ delete: (id: string | number) => + ['mutation', 'appmembership', 'delete', id] as const, } as const; export const appMembershipDefaultMutationKeys = { - /** All appMembershipDefault mutation keys */all: ["mutation", "appmembershipdefault"] as const, - /** Create appMembershipDefault mutation key */create: () => ["mutation", "appmembershipdefault", "create"] as const, - /** Update appMembershipDefault mutation key */update: (id: string | number) => ["mutation", "appmembershipdefault", "update", id] as const, - /** Delete appMembershipDefault mutation key */delete: (id: string | number) => ["mutation", "appmembershipdefault", "delete", id] as const + /** All appMembershipDefault mutation keys */ all: ['mutation', 'appmembershipdefault'] as const, + /** Create appMembershipDefault mutation key */ create: () => + ['mutation', 'appmembershipdefault', 'create'] as const, + /** Update appMembershipDefault mutation key */ update: (id: string | number) => + ['mutation', 'appmembershipdefault', 'update', id] as const, + /** Delete appMembershipDefault mutation key */ delete: (id: string | number) => + ['mutation', 'appmembershipdefault', 'delete', id] as const, } as const; export const appOwnerGrantMutationKeys = { - /** All appOwnerGrant mutation keys */all: ["mutation", "appownergrant"] as const, - /** Create appOwnerGrant mutation key */create: () => ["mutation", "appownergrant", "create"] as const, - /** Update appOwnerGrant mutation key */update: (id: string | number) => ["mutation", "appownergrant", "update", id] as const, - /** Delete appOwnerGrant mutation key */delete: (id: string | number) => ["mutation", "appownergrant", "delete", id] as const + /** All appOwnerGrant mutation keys */ all: ['mutation', 'appownergrant'] as const, + /** Create appOwnerGrant mutation key */ create: () => + ['mutation', 'appownergrant', 'create'] as const, + /** Update appOwnerGrant mutation key */ update: (id: string | number) => + ['mutation', 'appownergrant', 'update', id] as const, + /** Delete appOwnerGrant mutation key */ delete: (id: string | number) => + ['mutation', 'appownergrant', 'delete', id] as const, } as const; export const appPermissionMutationKeys = { - /** All appPermission mutation keys */all: ["mutation", "apppermission"] as const, - /** Create appPermission mutation key */create: () => ["mutation", "apppermission", "create"] as const, - /** Update appPermission mutation key */update: (id: string | number) => ["mutation", "apppermission", "update", id] as const, - /** Delete appPermission mutation key */delete: (id: string | number) => ["mutation", "apppermission", "delete", id] as const + /** All appPermission mutation keys */ all: ['mutation', 'apppermission'] as const, + /** Create appPermission mutation key */ create: () => + ['mutation', 'apppermission', 'create'] as const, + /** Update appPermission mutation key */ update: (id: string | number) => + ['mutation', 'apppermission', 'update', id] as const, + /** Delete appPermission mutation key */ delete: (id: string | number) => + ['mutation', 'apppermission', 'delete', id] as const, } as const; export const appPermissionDefaultMutationKeys = { - /** All appPermissionDefault mutation keys */all: ["mutation", "apppermissiondefault"] as const, - /** Create appPermissionDefault mutation key */create: () => ["mutation", "apppermissiondefault", "create"] as const, - /** Update appPermissionDefault mutation key */update: (id: string | number) => ["mutation", "apppermissiondefault", "update", id] as const, - /** Delete appPermissionDefault mutation key */delete: (id: string | number) => ["mutation", "apppermissiondefault", "delete", id] as const + /** All appPermissionDefault mutation keys */ all: ['mutation', 'apppermissiondefault'] as const, + /** Create appPermissionDefault mutation key */ create: () => + ['mutation', 'apppermissiondefault', 'create'] as const, + /** Update appPermissionDefault mutation key */ update: (id: string | number) => + ['mutation', 'apppermissiondefault', 'update', id] as const, + /** Delete appPermissionDefault mutation key */ delete: (id: string | number) => + ['mutation', 'apppermissiondefault', 'delete', id] as const, } as const; export const appPermissionDefaultGrantMutationKeys = { - /** All appPermissionDefaultGrant mutation keys */all: ["mutation", "apppermissiondefaultgrant"] as const, - /** Create appPermissionDefaultGrant mutation key */create: () => ["mutation", "apppermissiondefaultgrant", "create"] as const, - /** Update appPermissionDefaultGrant mutation key */update: (id: string | number) => ["mutation", "apppermissiondefaultgrant", "update", id] as const, - /** Delete appPermissionDefaultGrant mutation key */delete: (id: string | number) => ["mutation", "apppermissiondefaultgrant", "delete", id] as const + /** All appPermissionDefaultGrant mutation keys */ all: [ + 'mutation', + 'apppermissiondefaultgrant', + ] as const, + /** Create appPermissionDefaultGrant mutation key */ create: () => + ['mutation', 'apppermissiondefaultgrant', 'create'] as const, + /** Update appPermissionDefaultGrant mutation key */ update: (id: string | number) => + ['mutation', 'apppermissiondefaultgrant', 'update', id] as const, + /** Delete appPermissionDefaultGrant mutation key */ delete: (id: string | number) => + ['mutation', 'apppermissiondefaultgrant', 'delete', id] as const, } as const; export const appPermissionDefaultPermissionMutationKeys = { - /** All appPermissionDefaultPermission mutation keys */all: ["mutation", "apppermissiondefaultpermission"] as const, - /** Create appPermissionDefaultPermission mutation key */create: () => ["mutation", "apppermissiondefaultpermission", "create"] as const, - /** Update appPermissionDefaultPermission mutation key */update: (id: string | number) => ["mutation", "apppermissiondefaultpermission", "update", id] as const, - /** Delete appPermissionDefaultPermission mutation key */delete: (id: string | number) => ["mutation", "apppermissiondefaultpermission", "delete", id] as const + /** All appPermissionDefaultPermission mutation keys */ all: [ + 'mutation', + 'apppermissiondefaultpermission', + ] as const, + /** Create appPermissionDefaultPermission mutation key */ create: () => + ['mutation', 'apppermissiondefaultpermission', 'create'] as const, + /** Update appPermissionDefaultPermission mutation key */ update: (id: string | number) => + ['mutation', 'apppermissiondefaultpermission', 'update', id] as const, + /** Delete appPermissionDefaultPermission mutation key */ delete: (id: string | number) => + ['mutation', 'apppermissiondefaultpermission', 'delete', id] as const, } as const; export const membershipTypeMutationKeys = { - /** All membershipType mutation keys */all: ["mutation", "membershiptype"] as const, - /** Create membershipType mutation key */create: () => ["mutation", "membershiptype", "create"] as const, - /** Update membershipType mutation key */update: (id: string | number) => ["mutation", "membershiptype", "update", id] as const, - /** Delete membershipType mutation key */delete: (id: string | number) => ["mutation", "membershiptype", "delete", id] as const + /** All membershipType mutation keys */ all: ['mutation', 'membershiptype'] as const, + /** Create membershipType mutation key */ create: () => + ['mutation', 'membershiptype', 'create'] as const, + /** Update membershipType mutation key */ update: (id: string | number) => + ['mutation', 'membershiptype', 'update', id] as const, + /** Delete membershipType mutation key */ delete: (id: string | number) => + ['mutation', 'membershiptype', 'delete', id] as const, } as const; export const orgAdminGrantMutationKeys = { - /** All orgAdminGrant mutation keys */all: ["mutation", "orgadmingrant"] as const, - /** Create orgAdminGrant mutation key */create: () => ["mutation", "orgadmingrant", "create"] as const, - /** Update orgAdminGrant mutation key */update: (id: string | number) => ["mutation", "orgadmingrant", "update", id] as const, - /** Delete orgAdminGrant mutation key */delete: (id: string | number) => ["mutation", "orgadmingrant", "delete", id] as const + /** All orgAdminGrant mutation keys */ all: ['mutation', 'orgadmingrant'] as const, + /** Create orgAdminGrant mutation key */ create: () => + ['mutation', 'orgadmingrant', 'create'] as const, + /** Update orgAdminGrant mutation key */ update: (id: string | number) => + ['mutation', 'orgadmingrant', 'update', id] as const, + /** Delete orgAdminGrant mutation key */ delete: (id: string | number) => + ['mutation', 'orgadmingrant', 'delete', id] as const, } as const; export const orgClaimedInviteMutationKeys = { - /** All orgClaimedInvite mutation keys */all: ["mutation", "orgclaimedinvite"] as const, - /** Create orgClaimedInvite mutation key */create: () => ["mutation", "orgclaimedinvite", "create"] as const, - /** Update orgClaimedInvite mutation key */update: (id: string | number) => ["mutation", "orgclaimedinvite", "update", id] as const, - /** Delete orgClaimedInvite mutation key */delete: (id: string | number) => ["mutation", "orgclaimedinvite", "delete", id] as const + /** All orgClaimedInvite mutation keys */ all: ['mutation', 'orgclaimedinvite'] as const, + /** Create orgClaimedInvite mutation key */ create: () => + ['mutation', 'orgclaimedinvite', 'create'] as const, + /** Update orgClaimedInvite mutation key */ update: (id: string | number) => + ['mutation', 'orgclaimedinvite', 'update', id] as const, + /** Delete orgClaimedInvite mutation key */ delete: (id: string | number) => + ['mutation', 'orgclaimedinvite', 'delete', id] as const, } as const; export const orgGrantMutationKeys = { - /** All orgGrant mutation keys */all: ["mutation", "orggrant"] as const, - /** Create orgGrant mutation key */create: () => ["mutation", "orggrant", "create"] as const, - /** Update orgGrant mutation key */update: (id: string | number) => ["mutation", "orggrant", "update", id] as const, - /** Delete orgGrant mutation key */delete: (id: string | number) => ["mutation", "orggrant", "delete", id] as const + /** All orgGrant mutation keys */ all: ['mutation', 'orggrant'] as const, + /** Create orgGrant mutation key */ create: () => ['mutation', 'orggrant', 'create'] as const, + /** Update orgGrant mutation key */ update: (id: string | number) => + ['mutation', 'orggrant', 'update', id] as const, + /** Delete orgGrant mutation key */ delete: (id: string | number) => + ['mutation', 'orggrant', 'delete', id] as const, } as const; export const orgInviteMutationKeys = { - /** All orgInvite mutation keys */all: ["mutation", "orginvite"] as const, - /** Create orgInvite mutation key */create: () => ["mutation", "orginvite", "create"] as const, - /** Update orgInvite mutation key */update: (id: string | number) => ["mutation", "orginvite", "update", id] as const, - /** Delete orgInvite mutation key */delete: (id: string | number) => ["mutation", "orginvite", "delete", id] as const + /** All orgInvite mutation keys */ all: ['mutation', 'orginvite'] as const, + /** Create orgInvite mutation key */ create: () => ['mutation', 'orginvite', 'create'] as const, + /** Update orgInvite mutation key */ update: (id: string | number) => + ['mutation', 'orginvite', 'update', id] as const, + /** Delete orgInvite mutation key */ delete: (id: string | number) => + ['mutation', 'orginvite', 'delete', id] as const, } as const; export const orgMemberMutationKeys = { - /** All orgMember mutation keys */all: ["mutation", "orgmember"] as const, - /** Create orgMember mutation key */create: () => ["mutation", "orgmember", "create"] as const, - /** Update orgMember mutation key */update: (id: string | number) => ["mutation", "orgmember", "update", id] as const, - /** Delete orgMember mutation key */delete: (id: string | number) => ["mutation", "orgmember", "delete", id] as const + /** All orgMember mutation keys */ all: ['mutation', 'orgmember'] as const, + /** Create orgMember mutation key */ create: () => ['mutation', 'orgmember', 'create'] as const, + /** Update orgMember mutation key */ update: (id: string | number) => + ['mutation', 'orgmember', 'update', id] as const, + /** Delete orgMember mutation key */ delete: (id: string | number) => + ['mutation', 'orgmember', 'delete', id] as const, } as const; export const orgMemberProfileMutationKeys = { - /** All orgMemberProfile mutation keys */all: ["mutation", "orgmemberprofile"] as const, - /** Create orgMemberProfile mutation key */create: () => ["mutation", "orgmemberprofile", "create"] as const, - /** Update orgMemberProfile mutation key */update: (id: string | number) => ["mutation", "orgmemberprofile", "update", id] as const, - /** Delete orgMemberProfile mutation key */delete: (id: string | number) => ["mutation", "orgmemberprofile", "delete", id] as const + /** All orgMemberProfile mutation keys */ all: ['mutation', 'orgmemberprofile'] as const, + /** Create orgMemberProfile mutation key */ create: () => + ['mutation', 'orgmemberprofile', 'create'] as const, + /** Update orgMemberProfile mutation key */ update: (id: string | number) => + ['mutation', 'orgmemberprofile', 'update', id] as const, + /** Delete orgMemberProfile mutation key */ delete: (id: string | number) => + ['mutation', 'orgmemberprofile', 'delete', id] as const, } as const; export const orgMembershipMutationKeys = { - /** All orgMembership mutation keys */all: ["mutation", "orgmembership"] as const, - /** Create orgMembership mutation key */create: () => ["mutation", "orgmembership", "create"] as const, - /** Update orgMembership mutation key */update: (id: string | number) => ["mutation", "orgmembership", "update", id] as const, - /** Delete orgMembership mutation key */delete: (id: string | number) => ["mutation", "orgmembership", "delete", id] as const + /** All orgMembership mutation keys */ all: ['mutation', 'orgmembership'] as const, + /** Create orgMembership mutation key */ create: () => + ['mutation', 'orgmembership', 'create'] as const, + /** Update orgMembership mutation key */ update: (id: string | number) => + ['mutation', 'orgmembership', 'update', id] as const, + /** Delete orgMembership mutation key */ delete: (id: string | number) => + ['mutation', 'orgmembership', 'delete', id] as const, } as const; export const orgMembershipDefaultMutationKeys = { - /** All orgMembershipDefault mutation keys */all: ["mutation", "orgmembershipdefault"] as const, - /** Create orgMembershipDefault mutation key */create: () => ["mutation", "orgmembershipdefault", "create"] as const, - /** Update orgMembershipDefault mutation key */update: (id: string | number) => ["mutation", "orgmembershipdefault", "update", id] as const, - /** Delete orgMembershipDefault mutation key */delete: (id: string | number) => ["mutation", "orgmembershipdefault", "delete", id] as const + /** All orgMembershipDefault mutation keys */ all: ['mutation', 'orgmembershipdefault'] as const, + /** Create orgMembershipDefault mutation key */ create: () => + ['mutation', 'orgmembershipdefault', 'create'] as const, + /** Update orgMembershipDefault mutation key */ update: (id: string | number) => + ['mutation', 'orgmembershipdefault', 'update', id] as const, + /** Delete orgMembershipDefault mutation key */ delete: (id: string | number) => + ['mutation', 'orgmembershipdefault', 'delete', id] as const, } as const; export const orgMembershipSettingMutationKeys = { - /** All orgMembershipSetting mutation keys */all: ["mutation", "orgmembershipsetting"] as const, - /** Create orgMembershipSetting mutation key */create: () => ["mutation", "orgmembershipsetting", "create"] as const, - /** Update orgMembershipSetting mutation key */update: (id: string | number) => ["mutation", "orgmembershipsetting", "update", id] as const, - /** Delete orgMembershipSetting mutation key */delete: (id: string | number) => ["mutation", "orgmembershipsetting", "delete", id] as const + /** All orgMembershipSetting mutation keys */ all: ['mutation', 'orgmembershipsetting'] as const, + /** Create orgMembershipSetting mutation key */ create: () => + ['mutation', 'orgmembershipsetting', 'create'] as const, + /** Update orgMembershipSetting mutation key */ update: (id: string | number) => + ['mutation', 'orgmembershipsetting', 'update', id] as const, + /** Delete orgMembershipSetting mutation key */ delete: (id: string | number) => + ['mutation', 'orgmembershipsetting', 'delete', id] as const, } as const; export const orgOwnerGrantMutationKeys = { - /** All orgOwnerGrant mutation keys */all: ["mutation", "orgownergrant"] as const, - /** Create orgOwnerGrant mutation key */create: () => ["mutation", "orgownergrant", "create"] as const, - /** Update orgOwnerGrant mutation key */update: (id: string | number) => ["mutation", "orgownergrant", "update", id] as const, - /** Delete orgOwnerGrant mutation key */delete: (id: string | number) => ["mutation", "orgownergrant", "delete", id] as const + /** All orgOwnerGrant mutation keys */ all: ['mutation', 'orgownergrant'] as const, + /** Create orgOwnerGrant mutation key */ create: () => + ['mutation', 'orgownergrant', 'create'] as const, + /** Update orgOwnerGrant mutation key */ update: (id: string | number) => + ['mutation', 'orgownergrant', 'update', id] as const, + /** Delete orgOwnerGrant mutation key */ delete: (id: string | number) => + ['mutation', 'orgownergrant', 'delete', id] as const, } as const; export const orgPermissionMutationKeys = { - /** All orgPermission mutation keys */all: ["mutation", "orgpermission"] as const, - /** Create orgPermission mutation key */create: () => ["mutation", "orgpermission", "create"] as const, - /** Update orgPermission mutation key */update: (id: string | number) => ["mutation", "orgpermission", "update", id] as const, - /** Delete orgPermission mutation key */delete: (id: string | number) => ["mutation", "orgpermission", "delete", id] as const + /** All orgPermission mutation keys */ all: ['mutation', 'orgpermission'] as const, + /** Create orgPermission mutation key */ create: () => + ['mutation', 'orgpermission', 'create'] as const, + /** Update orgPermission mutation key */ update: (id: string | number) => + ['mutation', 'orgpermission', 'update', id] as const, + /** Delete orgPermission mutation key */ delete: (id: string | number) => + ['mutation', 'orgpermission', 'delete', id] as const, } as const; export const orgPermissionDefaultMutationKeys = { - /** All orgPermissionDefault mutation keys */all: ["mutation", "orgpermissiondefault"] as const, - /** Create orgPermissionDefault mutation key */create: () => ["mutation", "orgpermissiondefault", "create"] as const, - /** Update orgPermissionDefault mutation key */update: (id: string | number) => ["mutation", "orgpermissiondefault", "update", id] as const, - /** Delete orgPermissionDefault mutation key */delete: (id: string | number) => ["mutation", "orgpermissiondefault", "delete", id] as const + /** All orgPermissionDefault mutation keys */ all: ['mutation', 'orgpermissiondefault'] as const, + /** Create orgPermissionDefault mutation key */ create: () => + ['mutation', 'orgpermissiondefault', 'create'] as const, + /** Update orgPermissionDefault mutation key */ update: (id: string | number) => + ['mutation', 'orgpermissiondefault', 'update', id] as const, + /** Delete orgPermissionDefault mutation key */ delete: (id: string | number) => + ['mutation', 'orgpermissiondefault', 'delete', id] as const, } as const; export const orgPermissionDefaultGrantMutationKeys = { - /** All orgPermissionDefaultGrant mutation keys */all: ["mutation", "orgpermissiondefaultgrant"] as const, - /** Create orgPermissionDefaultGrant mutation key */create: () => ["mutation", "orgpermissiondefaultgrant", "create"] as const, - /** Update orgPermissionDefaultGrant mutation key */update: (id: string | number) => ["mutation", "orgpermissiondefaultgrant", "update", id] as const, - /** Delete orgPermissionDefaultGrant mutation key */delete: (id: string | number) => ["mutation", "orgpermissiondefaultgrant", "delete", id] as const + /** All orgPermissionDefaultGrant mutation keys */ all: [ + 'mutation', + 'orgpermissiondefaultgrant', + ] as const, + /** Create orgPermissionDefaultGrant mutation key */ create: () => + ['mutation', 'orgpermissiondefaultgrant', 'create'] as const, + /** Update orgPermissionDefaultGrant mutation key */ update: (id: string | number) => + ['mutation', 'orgpermissiondefaultgrant', 'update', id] as const, + /** Delete orgPermissionDefaultGrant mutation key */ delete: (id: string | number) => + ['mutation', 'orgpermissiondefaultgrant', 'delete', id] as const, } as const; export const orgPermissionDefaultPermissionMutationKeys = { - /** All orgPermissionDefaultPermission mutation keys */all: ["mutation", "orgpermissiondefaultpermission"] as const, - /** Create orgPermissionDefaultPermission mutation key */create: () => ["mutation", "orgpermissiondefaultpermission", "create"] as const, - /** Update orgPermissionDefaultPermission mutation key */update: (id: string | number) => ["mutation", "orgpermissiondefaultpermission", "update", id] as const, - /** Delete orgPermissionDefaultPermission mutation key */delete: (id: string | number) => ["mutation", "orgpermissiondefaultpermission", "delete", id] as const + /** All orgPermissionDefaultPermission mutation keys */ all: [ + 'mutation', + 'orgpermissiondefaultpermission', + ] as const, + /** Create orgPermissionDefaultPermission mutation key */ create: () => + ['mutation', 'orgpermissiondefaultpermission', 'create'] as const, + /** Update orgPermissionDefaultPermission mutation key */ update: (id: string | number) => + ['mutation', 'orgpermissiondefaultpermission', 'update', id] as const, + /** Delete orgPermissionDefaultPermission mutation key */ delete: (id: string | number) => + ['mutation', 'orgpermissiondefaultpermission', 'delete', id] as const, } as const; // ============================================================================ @@ -180,9 +265,18 @@ export const orgPermissionDefaultPermissionMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const, - /** Mutation key for submitAppInviteCode */submitAppInviteCode: (identifier?: string) => identifier ? ["mutation", "submitAppInviteCode", identifier] as const : ["mutation", "submitAppInviteCode"] as const, - /** Mutation key for submitOrgInviteCode */submitOrgInviteCode: (identifier?: string) => identifier ? ["mutation", "submitOrgInviteCode", identifier] as const : ["mutation", "submitOrgInviteCode"] as const + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), + /** Mutation key for submitAppInviteCode */ submitAppInviteCode: (identifier?: string) => + identifier + ? (['mutation', 'submitAppInviteCode', identifier] as const) + : (['mutation', 'submitAppInviteCode'] as const), + /** Mutation key for submitOrgInviteCode */ submitOrgInviteCode: (identifier?: string) => + identifier + ? (['mutation', 'submitOrgInviteCode', identifier] as const) + : (['mutation', 'submitOrgInviteCode'] as const), } as const; /** @@ -233,5 +327,5 @@ export const mutationKeys = { orgPermissionDefault: orgPermissionDefaultMutationKeys, orgPermissionDefaultGrant: orgPermissionDefaultGrantMutationKeys, orgPermissionDefaultPermission: orgPermissionDefaultPermissionMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/admin/hooks/mutations/index.ts b/sdk/constructive-react/src/admin/hooks/mutations/index.ts index c6689d3bbc..a87c304df5 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/index.ts @@ -3,84 +3,84 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateAppAdminGrantMutation"; -export * from "./useUpdateAppAdminGrantMutation"; -export * from "./useDeleteAppAdminGrantMutation"; -export * from "./useCreateAppClaimedInviteMutation"; -export * from "./useUpdateAppClaimedInviteMutation"; -export * from "./useDeleteAppClaimedInviteMutation"; -export * from "./useCreateAppGrantMutation"; -export * from "./useUpdateAppGrantMutation"; -export * from "./useDeleteAppGrantMutation"; -export * from "./useCreateAppInviteMutation"; -export * from "./useUpdateAppInviteMutation"; -export * from "./useDeleteAppInviteMutation"; -export * from "./useCreateAppMembershipMutation"; -export * from "./useUpdateAppMembershipMutation"; -export * from "./useDeleteAppMembershipMutation"; -export * from "./useCreateAppMembershipDefaultMutation"; -export * from "./useUpdateAppMembershipDefaultMutation"; -export * from "./useDeleteAppMembershipDefaultMutation"; -export * from "./useCreateAppOwnerGrantMutation"; -export * from "./useUpdateAppOwnerGrantMutation"; -export * from "./useDeleteAppOwnerGrantMutation"; -export * from "./useCreateAppPermissionMutation"; -export * from "./useUpdateAppPermissionMutation"; -export * from "./useDeleteAppPermissionMutation"; -export * from "./useCreateAppPermissionDefaultMutation"; -export * from "./useUpdateAppPermissionDefaultMutation"; -export * from "./useDeleteAppPermissionDefaultMutation"; -export * from "./useCreateAppPermissionDefaultGrantMutation"; -export * from "./useUpdateAppPermissionDefaultGrantMutation"; -export * from "./useDeleteAppPermissionDefaultGrantMutation"; -export * from "./useCreateAppPermissionDefaultPermissionMutation"; -export * from "./useUpdateAppPermissionDefaultPermissionMutation"; -export * from "./useDeleteAppPermissionDefaultPermissionMutation"; -export * from "./useCreateMembershipTypeMutation"; -export * from "./useUpdateMembershipTypeMutation"; -export * from "./useDeleteMembershipTypeMutation"; -export * from "./useCreateOrgAdminGrantMutation"; -export * from "./useUpdateOrgAdminGrantMutation"; -export * from "./useDeleteOrgAdminGrantMutation"; -export * from "./useCreateOrgClaimedInviteMutation"; -export * from "./useUpdateOrgClaimedInviteMutation"; -export * from "./useDeleteOrgClaimedInviteMutation"; -export * from "./useCreateOrgGrantMutation"; -export * from "./useUpdateOrgGrantMutation"; -export * from "./useDeleteOrgGrantMutation"; -export * from "./useCreateOrgInviteMutation"; -export * from "./useUpdateOrgInviteMutation"; -export * from "./useDeleteOrgInviteMutation"; -export * from "./useCreateOrgMemberMutation"; -export * from "./useUpdateOrgMemberMutation"; -export * from "./useDeleteOrgMemberMutation"; -export * from "./useCreateOrgMemberProfileMutation"; -export * from "./useUpdateOrgMemberProfileMutation"; -export * from "./useDeleteOrgMemberProfileMutation"; -export * from "./useCreateOrgMembershipMutation"; -export * from "./useUpdateOrgMembershipMutation"; -export * from "./useDeleteOrgMembershipMutation"; -export * from "./useCreateOrgMembershipDefaultMutation"; -export * from "./useUpdateOrgMembershipDefaultMutation"; -export * from "./useDeleteOrgMembershipDefaultMutation"; -export * from "./useCreateOrgMembershipSettingMutation"; -export * from "./useUpdateOrgMembershipSettingMutation"; -export * from "./useDeleteOrgMembershipSettingMutation"; -export * from "./useCreateOrgOwnerGrantMutation"; -export * from "./useUpdateOrgOwnerGrantMutation"; -export * from "./useDeleteOrgOwnerGrantMutation"; -export * from "./useCreateOrgPermissionMutation"; -export * from "./useUpdateOrgPermissionMutation"; -export * from "./useDeleteOrgPermissionMutation"; -export * from "./useCreateOrgPermissionDefaultMutation"; -export * from "./useUpdateOrgPermissionDefaultMutation"; -export * from "./useDeleteOrgPermissionDefaultMutation"; -export * from "./useCreateOrgPermissionDefaultGrantMutation"; -export * from "./useUpdateOrgPermissionDefaultGrantMutation"; -export * from "./useDeleteOrgPermissionDefaultGrantMutation"; -export * from "./useCreateOrgPermissionDefaultPermissionMutation"; -export * from "./useUpdateOrgPermissionDefaultPermissionMutation"; -export * from "./useDeleteOrgPermissionDefaultPermissionMutation"; -export * from "./useProvisionBucketMutation"; -export * from "./useSubmitAppInviteCodeMutation"; -export * from "./useSubmitOrgInviteCodeMutation"; \ No newline at end of file +export * from './useCreateAppAdminGrantMutation'; +export * from './useUpdateAppAdminGrantMutation'; +export * from './useDeleteAppAdminGrantMutation'; +export * from './useCreateAppClaimedInviteMutation'; +export * from './useUpdateAppClaimedInviteMutation'; +export * from './useDeleteAppClaimedInviteMutation'; +export * from './useCreateAppGrantMutation'; +export * from './useUpdateAppGrantMutation'; +export * from './useDeleteAppGrantMutation'; +export * from './useCreateAppInviteMutation'; +export * from './useUpdateAppInviteMutation'; +export * from './useDeleteAppInviteMutation'; +export * from './useCreateAppMembershipMutation'; +export * from './useUpdateAppMembershipMutation'; +export * from './useDeleteAppMembershipMutation'; +export * from './useCreateAppMembershipDefaultMutation'; +export * from './useUpdateAppMembershipDefaultMutation'; +export * from './useDeleteAppMembershipDefaultMutation'; +export * from './useCreateAppOwnerGrantMutation'; +export * from './useUpdateAppOwnerGrantMutation'; +export * from './useDeleteAppOwnerGrantMutation'; +export * from './useCreateAppPermissionMutation'; +export * from './useUpdateAppPermissionMutation'; +export * from './useDeleteAppPermissionMutation'; +export * from './useCreateAppPermissionDefaultMutation'; +export * from './useUpdateAppPermissionDefaultMutation'; +export * from './useDeleteAppPermissionDefaultMutation'; +export * from './useCreateAppPermissionDefaultGrantMutation'; +export * from './useUpdateAppPermissionDefaultGrantMutation'; +export * from './useDeleteAppPermissionDefaultGrantMutation'; +export * from './useCreateAppPermissionDefaultPermissionMutation'; +export * from './useUpdateAppPermissionDefaultPermissionMutation'; +export * from './useDeleteAppPermissionDefaultPermissionMutation'; +export * from './useCreateMembershipTypeMutation'; +export * from './useUpdateMembershipTypeMutation'; +export * from './useDeleteMembershipTypeMutation'; +export * from './useCreateOrgAdminGrantMutation'; +export * from './useUpdateOrgAdminGrantMutation'; +export * from './useDeleteOrgAdminGrantMutation'; +export * from './useCreateOrgClaimedInviteMutation'; +export * from './useUpdateOrgClaimedInviteMutation'; +export * from './useDeleteOrgClaimedInviteMutation'; +export * from './useCreateOrgGrantMutation'; +export * from './useUpdateOrgGrantMutation'; +export * from './useDeleteOrgGrantMutation'; +export * from './useCreateOrgInviteMutation'; +export * from './useUpdateOrgInviteMutation'; +export * from './useDeleteOrgInviteMutation'; +export * from './useCreateOrgMemberMutation'; +export * from './useUpdateOrgMemberMutation'; +export * from './useDeleteOrgMemberMutation'; +export * from './useCreateOrgMemberProfileMutation'; +export * from './useUpdateOrgMemberProfileMutation'; +export * from './useDeleteOrgMemberProfileMutation'; +export * from './useCreateOrgMembershipMutation'; +export * from './useUpdateOrgMembershipMutation'; +export * from './useDeleteOrgMembershipMutation'; +export * from './useCreateOrgMembershipDefaultMutation'; +export * from './useUpdateOrgMembershipDefaultMutation'; +export * from './useDeleteOrgMembershipDefaultMutation'; +export * from './useCreateOrgMembershipSettingMutation'; +export * from './useUpdateOrgMembershipSettingMutation'; +export * from './useDeleteOrgMembershipSettingMutation'; +export * from './useCreateOrgOwnerGrantMutation'; +export * from './useUpdateOrgOwnerGrantMutation'; +export * from './useDeleteOrgOwnerGrantMutation'; +export * from './useCreateOrgPermissionMutation'; +export * from './useUpdateOrgPermissionMutation'; +export * from './useDeleteOrgPermissionMutation'; +export * from './useCreateOrgPermissionDefaultMutation'; +export * from './useUpdateOrgPermissionDefaultMutation'; +export * from './useDeleteOrgPermissionDefaultMutation'; +export * from './useCreateOrgPermissionDefaultGrantMutation'; +export * from './useUpdateOrgPermissionDefaultGrantMutation'; +export * from './useDeleteOrgPermissionDefaultGrantMutation'; +export * from './useCreateOrgPermissionDefaultPermissionMutation'; +export * from './useUpdateOrgPermissionDefaultPermissionMutation'; +export * from './useDeleteOrgPermissionDefaultPermissionMutation'; +export * from './useProvisionBucketMutation'; +export * from './useSubmitAppInviteCodeMutation'; +export * from './useSubmitOrgInviteCodeMutation'; diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppAdminGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppAdminGrantMutation.ts index b489a63c98..3c9af35db9 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppAdminGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppAdminGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { appAdminGrantKeys } from "../query-keys"; -import { appAdminGrantMutationKeys } from "../mutation-keys"; -import type { AppAdminGrantSelect, AppAdminGrantWithRelations, CreateAppAdminGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppAdminGrantSelect, AppAdminGrantWithRelations, CreateAppAdminGrantInput } from "../../orm/input-types"; +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 { appAdminGrantKeys } from '../query-keys'; +import { appAdminGrantMutationKeys } from '../mutation-keys'; +import type { + AppAdminGrantSelect, + AppAdminGrantWithRelations, + CreateAppAdminGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppAdminGrantSelect, + AppAdminGrantWithRelations, + CreateAppAdminGrantInput, +} from '../../orm/input-types'; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppAdminGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppAdminGrantMutation(params: { - selection: ({ - fields: S & AppAdminGrantSelect; - } & HookStrictSelect, AppAdminGrantSelect>); -} & Omit; - }; -}, Error, CreateAppAdminGrantInput["appAdminGrant"]>, "mutationFn">): UseMutationResult<{ - createAppAdminGrant: { - appAdminGrant: InferSelectResult; - }; -}, Error, CreateAppAdminGrantInput["appAdminGrant"]>; -export function useCreateAppAdminGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppAdminGrantMutation( + params: { + selection: { + fields: S & AppAdminGrantSelect; + } & HookStrictSelect, AppAdminGrantSelect>; + } & Omit< + UseMutationOptions< + { + createAppAdminGrant: { + appAdminGrant: InferSelectResult; + }; + }, + Error, + CreateAppAdminGrantInput['appAdminGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppAdminGrant: { + appAdminGrant: InferSelectResult; + }; + }, + Error, + CreateAppAdminGrantInput['appAdminGrant'] +>; +export function useCreateAppAdminGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appAdminGrantMutationKeys.create(), - mutationFn: (data: CreateAppAdminGrantInput["appAdminGrant"]) => getClient().appAdminGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppAdminGrantInput['appAdminGrant']) => + getClient() + .appAdminGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appAdminGrantKeys.lists() + queryKey: appAdminGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppClaimedInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppClaimedInviteMutation.ts index 80ef269ce0..07d7274462 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppClaimedInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppClaimedInviteMutation.ts @@ -4,62 +4,88 @@ * 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 { appClaimedInviteKeys } from "../query-keys"; -import { appClaimedInviteMutationKeys } from "../mutation-keys"; -import type { AppClaimedInviteSelect, AppClaimedInviteWithRelations, CreateAppClaimedInviteInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppClaimedInviteSelect, AppClaimedInviteWithRelations, CreateAppClaimedInviteInput } from "../../orm/input-types"; +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 { appClaimedInviteKeys } from '../query-keys'; +import { appClaimedInviteMutationKeys } from '../mutation-keys'; +import type { + AppClaimedInviteSelect, + AppClaimedInviteWithRelations, + CreateAppClaimedInviteInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppClaimedInviteSelect, + AppClaimedInviteWithRelations, + CreateAppClaimedInviteInput, +} from '../../orm/input-types'; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppClaimedInviteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppClaimedInviteMutation(params: { - selection: ({ - fields: S & AppClaimedInviteSelect; - } & HookStrictSelect, AppClaimedInviteSelect>); -} & Omit; - }; -}, Error, CreateAppClaimedInviteInput["appClaimedInvite"]>, "mutationFn">): UseMutationResult<{ - createAppClaimedInvite: { - appClaimedInvite: InferSelectResult; - }; -}, Error, CreateAppClaimedInviteInput["appClaimedInvite"]>; -export function useCreateAppClaimedInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppClaimedInviteMutation( + params: { + selection: { + fields: S & AppClaimedInviteSelect; + } & HookStrictSelect, AppClaimedInviteSelect>; + } & Omit< + UseMutationOptions< + { + createAppClaimedInvite: { + appClaimedInvite: InferSelectResult; + }; + }, + Error, + CreateAppClaimedInviteInput['appClaimedInvite'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppClaimedInvite: { + appClaimedInvite: InferSelectResult; + }; + }, + Error, + CreateAppClaimedInviteInput['appClaimedInvite'] +>; +export function useCreateAppClaimedInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appClaimedInviteMutationKeys.create(), - mutationFn: (data: CreateAppClaimedInviteInput["appClaimedInvite"]) => getClient().appClaimedInvite.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppClaimedInviteInput['appClaimedInvite']) => + getClient() + .appClaimedInvite.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appClaimedInviteKeys.lists() + queryKey: appClaimedInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppGrantMutation.ts index 7d8f283c93..c3ae518e14 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { appGrantKeys } from "../query-keys"; -import { appGrantMutationKeys } from "../mutation-keys"; -import type { AppGrantSelect, AppGrantWithRelations, CreateAppGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppGrantSelect, AppGrantWithRelations, CreateAppGrantInput } from "../../orm/input-types"; +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 { appGrantKeys } from '../query-keys'; +import { appGrantMutationKeys } from '../mutation-keys'; +import type { + AppGrantSelect, + AppGrantWithRelations, + CreateAppGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppGrantSelect, + AppGrantWithRelations, + CreateAppGrantInput, +} from '../../orm/input-types'; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppGrantMutation(params: { - selection: ({ - fields: S & AppGrantSelect; - } & HookStrictSelect, AppGrantSelect>); -} & Omit; - }; -}, Error, CreateAppGrantInput["appGrant"]>, "mutationFn">): UseMutationResult<{ - createAppGrant: { - appGrant: InferSelectResult; - }; -}, Error, CreateAppGrantInput["appGrant"]>; -export function useCreateAppGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppGrantMutation( + params: { + selection: { + fields: S & AppGrantSelect; + } & HookStrictSelect, AppGrantSelect>; + } & Omit< + UseMutationOptions< + { + createAppGrant: { + appGrant: InferSelectResult; + }; + }, + Error, + CreateAppGrantInput['appGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppGrant: { + appGrant: InferSelectResult; + }; + }, + Error, + CreateAppGrantInput['appGrant'] +>; +export function useCreateAppGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appGrantMutationKeys.create(), - mutationFn: (data: CreateAppGrantInput["appGrant"]) => getClient().appGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppGrantInput['appGrant']) => + getClient() + .appGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appGrantKeys.lists() + queryKey: appGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppInviteMutation.ts index 836226a2dd..7feb9317d0 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppInviteMutation.ts @@ -4,62 +4,85 @@ * 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 { appInviteKeys } from "../query-keys"; -import { appInviteMutationKeys } from "../mutation-keys"; -import type { AppInviteSelect, AppInviteWithRelations, CreateAppInviteInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppInviteSelect, AppInviteWithRelations, CreateAppInviteInput } from "../../orm/input-types"; +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 { appInviteKeys } from '../query-keys'; +import { appInviteMutationKeys } from '../mutation-keys'; +import type { + AppInviteSelect, + AppInviteWithRelations, + CreateAppInviteInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppInviteSelect, + AppInviteWithRelations, + CreateAppInviteInput, +} from '../../orm/input-types'; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppInviteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppInviteMutation(params: { - selection: ({ - fields: S & AppInviteSelect; - } & HookStrictSelect, AppInviteSelect>); -} & Omit; - }; -}, Error, CreateAppInviteInput["appInvite"]>, "mutationFn">): UseMutationResult<{ - createAppInvite: { - appInvite: InferSelectResult; - }; -}, Error, CreateAppInviteInput["appInvite"]>; -export function useCreateAppInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppInviteMutation( + params: { + selection: { + fields: S & AppInviteSelect; + } & HookStrictSelect, AppInviteSelect>; + } & Omit< + UseMutationOptions< + { + createAppInvite: { + appInvite: InferSelectResult; + }; + }, + Error, + CreateAppInviteInput['appInvite'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppInvite: { + appInvite: InferSelectResult; + }; + }, + Error, + CreateAppInviteInput['appInvite'] +>; +export function useCreateAppInviteMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appInviteMutationKeys.create(), - mutationFn: (data: CreateAppInviteInput["appInvite"]) => getClient().appInvite.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppInviteInput['appInvite']) => + getClient() + .appInvite.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appInviteKeys.lists() + queryKey: appInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppMembershipDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppMembershipDefaultMutation.ts index 79665e2051..cc66d20abe 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppMembershipDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppMembershipDefaultMutation.ts @@ -4,62 +4,88 @@ * 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 { appMembershipDefaultKeys } from "../query-keys"; -import { appMembershipDefaultMutationKeys } from "../mutation-keys"; -import type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations, CreateAppMembershipDefaultInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations, CreateAppMembershipDefaultInput } from "../../orm/input-types"; +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 { appMembershipDefaultKeys } from '../query-keys'; +import { appMembershipDefaultMutationKeys } from '../mutation-keys'; +import type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, + CreateAppMembershipDefaultInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, + CreateAppMembershipDefaultInput, +} from '../../orm/input-types'; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppMembershipDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppMembershipDefaultMutation(params: { - selection: ({ - fields: S & AppMembershipDefaultSelect; - } & HookStrictSelect, AppMembershipDefaultSelect>); -} & Omit; - }; -}, Error, CreateAppMembershipDefaultInput["appMembershipDefault"]>, "mutationFn">): UseMutationResult<{ - createAppMembershipDefault: { - appMembershipDefault: InferSelectResult; - }; -}, Error, CreateAppMembershipDefaultInput["appMembershipDefault"]>; -export function useCreateAppMembershipDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppMembershipDefaultMutation( + params: { + selection: { + fields: S & AppMembershipDefaultSelect; + } & HookStrictSelect, AppMembershipDefaultSelect>; + } & Omit< + UseMutationOptions< + { + createAppMembershipDefault: { + appMembershipDefault: InferSelectResult; + }; + }, + Error, + CreateAppMembershipDefaultInput['appMembershipDefault'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppMembershipDefault: { + appMembershipDefault: InferSelectResult; + }; + }, + Error, + CreateAppMembershipDefaultInput['appMembershipDefault'] +>; +export function useCreateAppMembershipDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appMembershipDefaultMutationKeys.create(), - mutationFn: (data: CreateAppMembershipDefaultInput["appMembershipDefault"]) => getClient().appMembershipDefault.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppMembershipDefaultInput['appMembershipDefault']) => + getClient() + .appMembershipDefault.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appMembershipDefaultKeys.lists() + queryKey: appMembershipDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppMembershipMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppMembershipMutation.ts index 9f80506199..e991ed8fd6 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppMembershipMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppMembershipMutation.ts @@ -4,62 +4,85 @@ * 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 { appMembershipKeys } from "../query-keys"; -import { appMembershipMutationKeys } from "../mutation-keys"; -import type { AppMembershipSelect, AppMembershipWithRelations, CreateAppMembershipInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipSelect, AppMembershipWithRelations, CreateAppMembershipInput } from "../../orm/input-types"; +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 { appMembershipKeys } from '../query-keys'; +import { appMembershipMutationKeys } from '../mutation-keys'; +import type { + AppMembershipSelect, + AppMembershipWithRelations, + CreateAppMembershipInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppMembershipSelect, + AppMembershipWithRelations, + CreateAppMembershipInput, +} from '../../orm/input-types'; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppMembershipMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppMembershipMutation(params: { - selection: ({ - fields: S & AppMembershipSelect; - } & HookStrictSelect, AppMembershipSelect>); -} & Omit; - }; -}, Error, CreateAppMembershipInput["appMembership"]>, "mutationFn">): UseMutationResult<{ - createAppMembership: { - appMembership: InferSelectResult; - }; -}, Error, CreateAppMembershipInput["appMembership"]>; -export function useCreateAppMembershipMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppMembershipMutation( + params: { + selection: { + fields: S & AppMembershipSelect; + } & HookStrictSelect, AppMembershipSelect>; + } & Omit< + UseMutationOptions< + { + createAppMembership: { + appMembership: InferSelectResult; + }; + }, + Error, + CreateAppMembershipInput['appMembership'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppMembership: { + appMembership: InferSelectResult; + }; + }, + Error, + CreateAppMembershipInput['appMembership'] +>; +export function useCreateAppMembershipMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appMembershipMutationKeys.create(), - mutationFn: (data: CreateAppMembershipInput["appMembership"]) => getClient().appMembership.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppMembershipInput['appMembership']) => + getClient() + .appMembership.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appMembershipKeys.lists() + queryKey: appMembershipKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppOwnerGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppOwnerGrantMutation.ts index e9253dbdb5..3f5a3413d0 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppOwnerGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppOwnerGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { appOwnerGrantKeys } from "../query-keys"; -import { appOwnerGrantMutationKeys } from "../mutation-keys"; -import type { AppOwnerGrantSelect, AppOwnerGrantWithRelations, CreateAppOwnerGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppOwnerGrantSelect, AppOwnerGrantWithRelations, CreateAppOwnerGrantInput } from "../../orm/input-types"; +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 { appOwnerGrantKeys } from '../query-keys'; +import { appOwnerGrantMutationKeys } from '../mutation-keys'; +import type { + AppOwnerGrantSelect, + AppOwnerGrantWithRelations, + CreateAppOwnerGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppOwnerGrantSelect, + AppOwnerGrantWithRelations, + CreateAppOwnerGrantInput, +} from '../../orm/input-types'; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppOwnerGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppOwnerGrantMutation(params: { - selection: ({ - fields: S & AppOwnerGrantSelect; - } & HookStrictSelect, AppOwnerGrantSelect>); -} & Omit; - }; -}, Error, CreateAppOwnerGrantInput["appOwnerGrant"]>, "mutationFn">): UseMutationResult<{ - createAppOwnerGrant: { - appOwnerGrant: InferSelectResult; - }; -}, Error, CreateAppOwnerGrantInput["appOwnerGrant"]>; -export function useCreateAppOwnerGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppOwnerGrantMutation( + params: { + selection: { + fields: S & AppOwnerGrantSelect; + } & HookStrictSelect, AppOwnerGrantSelect>; + } & Omit< + UseMutationOptions< + { + createAppOwnerGrant: { + appOwnerGrant: InferSelectResult; + }; + }, + Error, + CreateAppOwnerGrantInput['appOwnerGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppOwnerGrant: { + appOwnerGrant: InferSelectResult; + }; + }, + Error, + CreateAppOwnerGrantInput['appOwnerGrant'] +>; +export function useCreateAppOwnerGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appOwnerGrantMutationKeys.create(), - mutationFn: (data: CreateAppOwnerGrantInput["appOwnerGrant"]) => getClient().appOwnerGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppOwnerGrantInput['appOwnerGrant']) => + getClient() + .appOwnerGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appOwnerGrantKeys.lists() + queryKey: appOwnerGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultGrantMutation.ts index 9ec9380333..695d905384 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultGrantMutation.ts @@ -4,62 +4,94 @@ * 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 { appPermissionDefaultGrantKeys } from "../query-keys"; -import { appPermissionDefaultGrantMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations, CreateAppPermissionDefaultGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations, CreateAppPermissionDefaultGrantInput } from "../../orm/input-types"; +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 { appPermissionDefaultGrantKeys } from '../query-keys'; +import { appPermissionDefaultGrantMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, + CreateAppPermissionDefaultGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, + CreateAppPermissionDefaultGrantInput, +} from '../../orm/input-types'; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppPermissionDefaultGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppPermissionDefaultGrantMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultGrantSelect; - } & HookStrictSelect, AppPermissionDefaultGrantSelect>); -} & Omit; - }; -}, Error, CreateAppPermissionDefaultGrantInput["appPermissionDefaultGrant"]>, "mutationFn">): UseMutationResult<{ - createAppPermissionDefaultGrant: { - appPermissionDefaultGrant: InferSelectResult; - }; -}, Error, CreateAppPermissionDefaultGrantInput["appPermissionDefaultGrant"]>; -export function useCreateAppPermissionDefaultGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppPermissionDefaultGrantMutation< + S extends AppPermissionDefaultGrantSelect, +>( + params: { + selection: { + fields: S & AppPermissionDefaultGrantSelect; + } & HookStrictSelect, AppPermissionDefaultGrantSelect>; + } & Omit< + UseMutationOptions< + { + createAppPermissionDefaultGrant: { + appPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + CreateAppPermissionDefaultGrantInput['appPermissionDefaultGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppPermissionDefaultGrant: { + appPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + CreateAppPermissionDefaultGrantInput['appPermissionDefaultGrant'] +>; +export function useCreateAppPermissionDefaultGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateAppPermissionDefaultGrantInput['appPermissionDefaultGrant'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultGrantMutationKeys.create(), - mutationFn: (data: CreateAppPermissionDefaultGrantInput["appPermissionDefaultGrant"]) => getClient().appPermissionDefaultGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppPermissionDefaultGrantInput['appPermissionDefaultGrant']) => + getClient() + .appPermissionDefaultGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appPermissionDefaultGrantKeys.lists() + queryKey: appPermissionDefaultGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultMutation.ts index 41350ebdae..1246a1892d 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultMutation.ts @@ -4,62 +4,88 @@ * 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 { appPermissionDefaultKeys } from "../query-keys"; -import { appPermissionDefaultMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations, CreateAppPermissionDefaultInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations, CreateAppPermissionDefaultInput } from "../../orm/input-types"; +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 { appPermissionDefaultKeys } from '../query-keys'; +import { appPermissionDefaultMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, + CreateAppPermissionDefaultInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, + CreateAppPermissionDefaultInput, +} from '../../orm/input-types'; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppPermissionDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppPermissionDefaultMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultSelect; - } & HookStrictSelect, AppPermissionDefaultSelect>); -} & Omit; - }; -}, Error, CreateAppPermissionDefaultInput["appPermissionDefault"]>, "mutationFn">): UseMutationResult<{ - createAppPermissionDefault: { - appPermissionDefault: InferSelectResult; - }; -}, Error, CreateAppPermissionDefaultInput["appPermissionDefault"]>; -export function useCreateAppPermissionDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppPermissionDefaultMutation( + params: { + selection: { + fields: S & AppPermissionDefaultSelect; + } & HookStrictSelect, AppPermissionDefaultSelect>; + } & Omit< + UseMutationOptions< + { + createAppPermissionDefault: { + appPermissionDefault: InferSelectResult; + }; + }, + Error, + CreateAppPermissionDefaultInput['appPermissionDefault'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppPermissionDefault: { + appPermissionDefault: InferSelectResult; + }; + }, + Error, + CreateAppPermissionDefaultInput['appPermissionDefault'] +>; +export function useCreateAppPermissionDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultMutationKeys.create(), - mutationFn: (data: CreateAppPermissionDefaultInput["appPermissionDefault"]) => getClient().appPermissionDefault.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppPermissionDefaultInput['appPermissionDefault']) => + getClient() + .appPermissionDefault.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appPermissionDefaultKeys.lists() + queryKey: appPermissionDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultPermissionMutation.ts index eda033455a..e954908380 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionDefaultPermissionMutation.ts @@ -4,62 +4,102 @@ * 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 { appPermissionDefaultPermissionKeys } from "../query-keys"; -import { appPermissionDefaultPermissionMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations, CreateAppPermissionDefaultPermissionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations, CreateAppPermissionDefaultPermissionInput } from "../../orm/input-types"; +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 { appPermissionDefaultPermissionKeys } from '../query-keys'; +import { appPermissionDefaultPermissionMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, + CreateAppPermissionDefaultPermissionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, + CreateAppPermissionDefaultPermissionInput, +} from '../../orm/input-types'; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppPermissionDefaultPermissionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppPermissionDefaultPermissionMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultPermissionSelect; - } & HookStrictSelect, AppPermissionDefaultPermissionSelect>); -} & Omit; - }; -}, Error, CreateAppPermissionDefaultPermissionInput["appPermissionDefaultPermission"]>, "mutationFn">): UseMutationResult<{ - createAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; - }; -}, Error, CreateAppPermissionDefaultPermissionInput["appPermissionDefaultPermission"]>; -export function useCreateAppPermissionDefaultPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppPermissionDefaultPermissionMutation< + S extends AppPermissionDefaultPermissionSelect, +>( + params: { + selection: { + fields: S & AppPermissionDefaultPermissionSelect; + } & HookStrictSelect, AppPermissionDefaultPermissionSelect>; + } & Omit< + UseMutationOptions< + { + createAppPermissionDefaultPermission: { + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + CreateAppPermissionDefaultPermissionInput['appPermissionDefaultPermission'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppPermissionDefaultPermission: { + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + CreateAppPermissionDefaultPermissionInput['appPermissionDefaultPermission'] +>; +export function useCreateAppPermissionDefaultPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateAppPermissionDefaultPermissionInput['appPermissionDefaultPermission'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultPermissionMutationKeys.create(), - mutationFn: (data: CreateAppPermissionDefaultPermissionInput["appPermissionDefaultPermission"]) => getClient().appPermissionDefaultPermission.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreateAppPermissionDefaultPermissionInput['appPermissionDefaultPermission'] + ) => + getClient() + .appPermissionDefaultPermission.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appPermissionDefaultPermissionKeys.lists() + queryKey: appPermissionDefaultPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionMutation.ts index 69f6322f06..c76e9081ad 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateAppPermissionMutation.ts @@ -4,62 +4,85 @@ * 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 { appPermissionKeys } from "../query-keys"; -import { appPermissionMutationKeys } from "../mutation-keys"; -import type { AppPermissionSelect, AppPermissionWithRelations, CreateAppPermissionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionSelect, AppPermissionWithRelations, CreateAppPermissionInput } from "../../orm/input-types"; +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 { appPermissionKeys } from '../query-keys'; +import { appPermissionMutationKeys } from '../mutation-keys'; +import type { + AppPermissionSelect, + AppPermissionWithRelations, + CreateAppPermissionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionSelect, + AppPermissionWithRelations, + CreateAppPermissionInput, +} from '../../orm/input-types'; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppPermissionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppPermissionMutation(params: { - selection: ({ - fields: S & AppPermissionSelect; - } & HookStrictSelect, AppPermissionSelect>); -} & Omit; - }; -}, Error, CreateAppPermissionInput["appPermission"]>, "mutationFn">): UseMutationResult<{ - createAppPermission: { - appPermission: InferSelectResult; - }; -}, Error, CreateAppPermissionInput["appPermission"]>; -export function useCreateAppPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppPermissionMutation( + params: { + selection: { + fields: S & AppPermissionSelect; + } & HookStrictSelect, AppPermissionSelect>; + } & Omit< + UseMutationOptions< + { + createAppPermission: { + appPermission: InferSelectResult; + }; + }, + Error, + CreateAppPermissionInput['appPermission'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppPermission: { + appPermission: InferSelectResult; + }; + }, + Error, + CreateAppPermissionInput['appPermission'] +>; +export function useCreateAppPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionMutationKeys.create(), - mutationFn: (data: CreateAppPermissionInput["appPermission"]) => getClient().appPermission.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppPermissionInput['appPermission']) => + getClient() + .appPermission.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appPermissionKeys.lists() + queryKey: appPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateMembershipTypeMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateMembershipTypeMutation.ts index dc1285d496..91c696e683 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateMembershipTypeMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateMembershipTypeMutation.ts @@ -4,62 +4,88 @@ * 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 { membershipTypeKeys } from "../query-keys"; -import { membershipTypeMutationKeys } from "../mutation-keys"; -import type { MembershipTypeSelect, MembershipTypeWithRelations, CreateMembershipTypeInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypeSelect, MembershipTypeWithRelations, CreateMembershipTypeInput } from "../../orm/input-types"; +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 { membershipTypeKeys } from '../query-keys'; +import { membershipTypeMutationKeys } from '../mutation-keys'; +import type { + MembershipTypeSelect, + MembershipTypeWithRelations, + CreateMembershipTypeInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipTypeSelect, + MembershipTypeWithRelations, + CreateMembershipTypeInput, +} from '../../orm/input-types'; /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateMembershipTypeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateMembershipTypeMutation(params: { - selection: ({ - fields: S & MembershipTypeSelect; - } & HookStrictSelect, MembershipTypeSelect>); -} & Omit; - }; -}, Error, CreateMembershipTypeInput["membershipType"]>, "mutationFn">): UseMutationResult<{ - createMembershipType: { - membershipType: InferSelectResult; - }; -}, Error, CreateMembershipTypeInput["membershipType"]>; -export function useCreateMembershipTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateMembershipTypeMutation( + params: { + selection: { + fields: S & MembershipTypeSelect; + } & HookStrictSelect, MembershipTypeSelect>; + } & Omit< + UseMutationOptions< + { + createMembershipType: { + membershipType: InferSelectResult; + }; + }, + Error, + CreateMembershipTypeInput['membershipType'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createMembershipType: { + membershipType: InferSelectResult; + }; + }, + Error, + CreateMembershipTypeInput['membershipType'] +>; +export function useCreateMembershipTypeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipTypeMutationKeys.create(), - mutationFn: (data: CreateMembershipTypeInput["membershipType"]) => getClient().membershipType.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateMembershipTypeInput['membershipType']) => + getClient() + .membershipType.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: membershipTypeKeys.lists() + queryKey: membershipTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgAdminGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgAdminGrantMutation.ts index 3af01b2ab9..1f160dd1d4 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgAdminGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgAdminGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { orgAdminGrantKeys } from "../query-keys"; -import { orgAdminGrantMutationKeys } from "../mutation-keys"; -import type { OrgAdminGrantSelect, OrgAdminGrantWithRelations, CreateOrgAdminGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgAdminGrantSelect, OrgAdminGrantWithRelations, CreateOrgAdminGrantInput } from "../../orm/input-types"; +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 { orgAdminGrantKeys } from '../query-keys'; +import { orgAdminGrantMutationKeys } from '../mutation-keys'; +import type { + OrgAdminGrantSelect, + OrgAdminGrantWithRelations, + CreateOrgAdminGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgAdminGrantSelect, + OrgAdminGrantWithRelations, + CreateOrgAdminGrantInput, +} from '../../orm/input-types'; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgAdminGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgAdminGrantMutation(params: { - selection: ({ - fields: S & OrgAdminGrantSelect; - } & HookStrictSelect, OrgAdminGrantSelect>); -} & Omit; - }; -}, Error, CreateOrgAdminGrantInput["orgAdminGrant"]>, "mutationFn">): UseMutationResult<{ - createOrgAdminGrant: { - orgAdminGrant: InferSelectResult; - }; -}, Error, CreateOrgAdminGrantInput["orgAdminGrant"]>; -export function useCreateOrgAdminGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgAdminGrantMutation( + params: { + selection: { + fields: S & OrgAdminGrantSelect; + } & HookStrictSelect, OrgAdminGrantSelect>; + } & Omit< + UseMutationOptions< + { + createOrgAdminGrant: { + orgAdminGrant: InferSelectResult; + }; + }, + Error, + CreateOrgAdminGrantInput['orgAdminGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgAdminGrant: { + orgAdminGrant: InferSelectResult; + }; + }, + Error, + CreateOrgAdminGrantInput['orgAdminGrant'] +>; +export function useCreateOrgAdminGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgAdminGrantMutationKeys.create(), - mutationFn: (data: CreateOrgAdminGrantInput["orgAdminGrant"]) => getClient().orgAdminGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgAdminGrantInput['orgAdminGrant']) => + getClient() + .orgAdminGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgAdminGrantKeys.lists() + queryKey: orgAdminGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgClaimedInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgClaimedInviteMutation.ts index 0189c05686..f08114d376 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgClaimedInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgClaimedInviteMutation.ts @@ -4,62 +4,88 @@ * 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 { orgClaimedInviteKeys } from "../query-keys"; -import { orgClaimedInviteMutationKeys } from "../mutation-keys"; -import type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations, CreateOrgClaimedInviteInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations, CreateOrgClaimedInviteInput } from "../../orm/input-types"; +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 { orgClaimedInviteKeys } from '../query-keys'; +import { orgClaimedInviteMutationKeys } from '../mutation-keys'; +import type { + OrgClaimedInviteSelect, + OrgClaimedInviteWithRelations, + CreateOrgClaimedInviteInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgClaimedInviteSelect, + OrgClaimedInviteWithRelations, + CreateOrgClaimedInviteInput, +} from '../../orm/input-types'; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgClaimedInviteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgClaimedInviteMutation(params: { - selection: ({ - fields: S & OrgClaimedInviteSelect; - } & HookStrictSelect, OrgClaimedInviteSelect>); -} & Omit; - }; -}, Error, CreateOrgClaimedInviteInput["orgClaimedInvite"]>, "mutationFn">): UseMutationResult<{ - createOrgClaimedInvite: { - orgClaimedInvite: InferSelectResult; - }; -}, Error, CreateOrgClaimedInviteInput["orgClaimedInvite"]>; -export function useCreateOrgClaimedInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgClaimedInviteMutation( + params: { + selection: { + fields: S & OrgClaimedInviteSelect; + } & HookStrictSelect, OrgClaimedInviteSelect>; + } & Omit< + UseMutationOptions< + { + createOrgClaimedInvite: { + orgClaimedInvite: InferSelectResult; + }; + }, + Error, + CreateOrgClaimedInviteInput['orgClaimedInvite'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgClaimedInvite: { + orgClaimedInvite: InferSelectResult; + }; + }, + Error, + CreateOrgClaimedInviteInput['orgClaimedInvite'] +>; +export function useCreateOrgClaimedInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgClaimedInviteMutationKeys.create(), - mutationFn: (data: CreateOrgClaimedInviteInput["orgClaimedInvite"]) => getClient().orgClaimedInvite.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgClaimedInviteInput['orgClaimedInvite']) => + getClient() + .orgClaimedInvite.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgClaimedInviteKeys.lists() + queryKey: orgClaimedInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgGrantMutation.ts index 0ed94abcdd..7dc4d3025e 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { orgGrantKeys } from "../query-keys"; -import { orgGrantMutationKeys } from "../mutation-keys"; -import type { OrgGrantSelect, OrgGrantWithRelations, CreateOrgGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgGrantSelect, OrgGrantWithRelations, CreateOrgGrantInput } from "../../orm/input-types"; +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 { orgGrantKeys } from '../query-keys'; +import { orgGrantMutationKeys } from '../mutation-keys'; +import type { + OrgGrantSelect, + OrgGrantWithRelations, + CreateOrgGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgGrantSelect, + OrgGrantWithRelations, + CreateOrgGrantInput, +} from '../../orm/input-types'; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgGrantMutation(params: { - selection: ({ - fields: S & OrgGrantSelect; - } & HookStrictSelect, OrgGrantSelect>); -} & Omit; - }; -}, Error, CreateOrgGrantInput["orgGrant"]>, "mutationFn">): UseMutationResult<{ - createOrgGrant: { - orgGrant: InferSelectResult; - }; -}, Error, CreateOrgGrantInput["orgGrant"]>; -export function useCreateOrgGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgGrantMutation( + params: { + selection: { + fields: S & OrgGrantSelect; + } & HookStrictSelect, OrgGrantSelect>; + } & Omit< + UseMutationOptions< + { + createOrgGrant: { + orgGrant: InferSelectResult; + }; + }, + Error, + CreateOrgGrantInput['orgGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgGrant: { + orgGrant: InferSelectResult; + }; + }, + Error, + CreateOrgGrantInput['orgGrant'] +>; +export function useCreateOrgGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgGrantMutationKeys.create(), - mutationFn: (data: CreateOrgGrantInput["orgGrant"]) => getClient().orgGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgGrantInput['orgGrant']) => + getClient() + .orgGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgGrantKeys.lists() + queryKey: orgGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgInviteMutation.ts index 52f6deeccb..a81a94a9dd 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgInviteMutation.ts @@ -4,62 +4,85 @@ * 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 { orgInviteKeys } from "../query-keys"; -import { orgInviteMutationKeys } from "../mutation-keys"; -import type { OrgInviteSelect, OrgInviteWithRelations, CreateOrgInviteInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgInviteSelect, OrgInviteWithRelations, CreateOrgInviteInput } from "../../orm/input-types"; +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 { orgInviteKeys } from '../query-keys'; +import { orgInviteMutationKeys } from '../mutation-keys'; +import type { + OrgInviteSelect, + OrgInviteWithRelations, + CreateOrgInviteInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgInviteSelect, + OrgInviteWithRelations, + CreateOrgInviteInput, +} from '../../orm/input-types'; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgInviteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgInviteMutation(params: { - selection: ({ - fields: S & OrgInviteSelect; - } & HookStrictSelect, OrgInviteSelect>); -} & Omit; - }; -}, Error, CreateOrgInviteInput["orgInvite"]>, "mutationFn">): UseMutationResult<{ - createOrgInvite: { - orgInvite: InferSelectResult; - }; -}, Error, CreateOrgInviteInput["orgInvite"]>; -export function useCreateOrgInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgInviteMutation( + params: { + selection: { + fields: S & OrgInviteSelect; + } & HookStrictSelect, OrgInviteSelect>; + } & Omit< + UseMutationOptions< + { + createOrgInvite: { + orgInvite: InferSelectResult; + }; + }, + Error, + CreateOrgInviteInput['orgInvite'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgInvite: { + orgInvite: InferSelectResult; + }; + }, + Error, + CreateOrgInviteInput['orgInvite'] +>; +export function useCreateOrgInviteMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgInviteMutationKeys.create(), - mutationFn: (data: CreateOrgInviteInput["orgInvite"]) => getClient().orgInvite.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgInviteInput['orgInvite']) => + getClient() + .orgInvite.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgInviteKeys.lists() + queryKey: orgInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMemberMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMemberMutation.ts index 5a030a580b..14c7550f50 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMemberMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMemberMutation.ts @@ -4,62 +4,85 @@ * 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 { orgMemberKeys } from "../query-keys"; -import { orgMemberMutationKeys } from "../mutation-keys"; -import type { OrgMemberSelect, OrgMemberWithRelations, CreateOrgMemberInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberSelect, OrgMemberWithRelations, CreateOrgMemberInput } from "../../orm/input-types"; +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 { orgMemberKeys } from '../query-keys'; +import { orgMemberMutationKeys } from '../mutation-keys'; +import type { + OrgMemberSelect, + OrgMemberWithRelations, + CreateOrgMemberInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMemberSelect, + OrgMemberWithRelations, + CreateOrgMemberInput, +} from '../../orm/input-types'; /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgMemberMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgMemberMutation(params: { - selection: ({ - fields: S & OrgMemberSelect; - } & HookStrictSelect, OrgMemberSelect>); -} & Omit; - }; -}, Error, CreateOrgMemberInput["orgMember"]>, "mutationFn">): UseMutationResult<{ - createOrgMember: { - orgMember: InferSelectResult; - }; -}, Error, CreateOrgMemberInput["orgMember"]>; -export function useCreateOrgMemberMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgMemberMutation( + params: { + selection: { + fields: S & OrgMemberSelect; + } & HookStrictSelect, OrgMemberSelect>; + } & Omit< + UseMutationOptions< + { + createOrgMember: { + orgMember: InferSelectResult; + }; + }, + Error, + CreateOrgMemberInput['orgMember'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgMember: { + orgMember: InferSelectResult; + }; + }, + Error, + CreateOrgMemberInput['orgMember'] +>; +export function useCreateOrgMemberMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMemberMutationKeys.create(), - mutationFn: (data: CreateOrgMemberInput["orgMember"]) => getClient().orgMember.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgMemberInput['orgMember']) => + getClient() + .orgMember.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgMemberKeys.lists() + queryKey: orgMemberKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMemberProfileMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMemberProfileMutation.ts index eea3719ef4..90480b1ccf 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMemberProfileMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMemberProfileMutation.ts @@ -4,62 +4,88 @@ * 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 { orgMemberProfileKeys } from "../query-keys"; -import { orgMemberProfileMutationKeys } from "../mutation-keys"; -import type { OrgMemberProfileSelect, OrgMemberProfileWithRelations, CreateOrgMemberProfileInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberProfileSelect, OrgMemberProfileWithRelations, CreateOrgMemberProfileInput } from "../../orm/input-types"; +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 { orgMemberProfileKeys } from '../query-keys'; +import { orgMemberProfileMutationKeys } from '../mutation-keys'; +import type { + OrgMemberProfileSelect, + OrgMemberProfileWithRelations, + CreateOrgMemberProfileInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMemberProfileSelect, + OrgMemberProfileWithRelations, + CreateOrgMemberProfileInput, +} from '../../orm/input-types'; /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgMemberProfileMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgMemberProfileMutation(params: { - selection: ({ - fields: S & OrgMemberProfileSelect; - } & HookStrictSelect, OrgMemberProfileSelect>); -} & Omit; - }; -}, Error, CreateOrgMemberProfileInput["orgMemberProfile"]>, "mutationFn">): UseMutationResult<{ - createOrgMemberProfile: { - orgMemberProfile: InferSelectResult; - }; -}, Error, CreateOrgMemberProfileInput["orgMemberProfile"]>; -export function useCreateOrgMemberProfileMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgMemberProfileMutation( + params: { + selection: { + fields: S & OrgMemberProfileSelect; + } & HookStrictSelect, OrgMemberProfileSelect>; + } & Omit< + UseMutationOptions< + { + createOrgMemberProfile: { + orgMemberProfile: InferSelectResult; + }; + }, + Error, + CreateOrgMemberProfileInput['orgMemberProfile'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgMemberProfile: { + orgMemberProfile: InferSelectResult; + }; + }, + Error, + CreateOrgMemberProfileInput['orgMemberProfile'] +>; +export function useCreateOrgMemberProfileMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMemberProfileMutationKeys.create(), - mutationFn: (data: CreateOrgMemberProfileInput["orgMemberProfile"]) => getClient().orgMemberProfile.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgMemberProfileInput['orgMemberProfile']) => + getClient() + .orgMemberProfile.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgMemberProfileKeys.lists() + queryKey: orgMemberProfileKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipDefaultMutation.ts index 70d91e5a16..b043e29d78 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipDefaultMutation.ts @@ -4,62 +4,88 @@ * 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 { orgMembershipDefaultKeys } from "../query-keys"; -import { orgMembershipDefaultMutationKeys } from "../mutation-keys"; -import type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations, CreateOrgMembershipDefaultInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations, CreateOrgMembershipDefaultInput } from "../../orm/input-types"; +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 { orgMembershipDefaultKeys } from '../query-keys'; +import { orgMembershipDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, + CreateOrgMembershipDefaultInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, + CreateOrgMembershipDefaultInput, +} from '../../orm/input-types'; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgMembershipDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgMembershipDefaultMutation(params: { - selection: ({ - fields: S & OrgMembershipDefaultSelect; - } & HookStrictSelect, OrgMembershipDefaultSelect>); -} & Omit; - }; -}, Error, CreateOrgMembershipDefaultInput["orgMembershipDefault"]>, "mutationFn">): UseMutationResult<{ - createOrgMembershipDefault: { - orgMembershipDefault: InferSelectResult; - }; -}, Error, CreateOrgMembershipDefaultInput["orgMembershipDefault"]>; -export function useCreateOrgMembershipDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgMembershipDefaultMutation( + params: { + selection: { + fields: S & OrgMembershipDefaultSelect; + } & HookStrictSelect, OrgMembershipDefaultSelect>; + } & Omit< + UseMutationOptions< + { + createOrgMembershipDefault: { + orgMembershipDefault: InferSelectResult; + }; + }, + Error, + CreateOrgMembershipDefaultInput['orgMembershipDefault'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgMembershipDefault: { + orgMembershipDefault: InferSelectResult; + }; + }, + Error, + CreateOrgMembershipDefaultInput['orgMembershipDefault'] +>; +export function useCreateOrgMembershipDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipDefaultMutationKeys.create(), - mutationFn: (data: CreateOrgMembershipDefaultInput["orgMembershipDefault"]) => getClient().orgMembershipDefault.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgMembershipDefaultInput['orgMembershipDefault']) => + getClient() + .orgMembershipDefault.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgMembershipDefaultKeys.lists() + queryKey: orgMembershipDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipMutation.ts index f4ac888e62..84633ad1d6 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipMutation.ts @@ -4,62 +4,85 @@ * 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 { orgMembershipKeys } from "../query-keys"; -import { orgMembershipMutationKeys } from "../mutation-keys"; -import type { OrgMembershipSelect, OrgMembershipWithRelations, CreateOrgMembershipInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSelect, OrgMembershipWithRelations, CreateOrgMembershipInput } from "../../orm/input-types"; +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 { orgMembershipKeys } from '../query-keys'; +import { orgMembershipMutationKeys } from '../mutation-keys'; +import type { + OrgMembershipSelect, + OrgMembershipWithRelations, + CreateOrgMembershipInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipSelect, + OrgMembershipWithRelations, + CreateOrgMembershipInput, +} from '../../orm/input-types'; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgMembershipMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgMembershipMutation(params: { - selection: ({ - fields: S & OrgMembershipSelect; - } & HookStrictSelect, OrgMembershipSelect>); -} & Omit; - }; -}, Error, CreateOrgMembershipInput["orgMembership"]>, "mutationFn">): UseMutationResult<{ - createOrgMembership: { - orgMembership: InferSelectResult; - }; -}, Error, CreateOrgMembershipInput["orgMembership"]>; -export function useCreateOrgMembershipMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgMembershipMutation( + params: { + selection: { + fields: S & OrgMembershipSelect; + } & HookStrictSelect, OrgMembershipSelect>; + } & Omit< + UseMutationOptions< + { + createOrgMembership: { + orgMembership: InferSelectResult; + }; + }, + Error, + CreateOrgMembershipInput['orgMembership'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgMembership: { + orgMembership: InferSelectResult; + }; + }, + Error, + CreateOrgMembershipInput['orgMembership'] +>; +export function useCreateOrgMembershipMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipMutationKeys.create(), - mutationFn: (data: CreateOrgMembershipInput["orgMembership"]) => getClient().orgMembership.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgMembershipInput['orgMembership']) => + getClient() + .orgMembership.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgMembershipKeys.lists() + queryKey: orgMembershipKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipSettingMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipSettingMutation.ts index 8e49ad63f4..46710df8fe 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipSettingMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgMembershipSettingMutation.ts @@ -4,62 +4,88 @@ * 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 { orgMembershipSettingKeys } from "../query-keys"; -import { orgMembershipSettingMutationKeys } from "../mutation-keys"; -import type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations, CreateOrgMembershipSettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations, CreateOrgMembershipSettingInput } from "../../orm/input-types"; +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 { orgMembershipSettingKeys } from '../query-keys'; +import { orgMembershipSettingMutationKeys } from '../mutation-keys'; +import type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, + CreateOrgMembershipSettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, + CreateOrgMembershipSettingInput, +} from '../../orm/input-types'; /** * Per-entity settings for the memberships module - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgMembershipSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgMembershipSettingMutation(params: { - selection: ({ - fields: S & OrgMembershipSettingSelect; - } & HookStrictSelect, OrgMembershipSettingSelect>); -} & Omit; - }; -}, Error, CreateOrgMembershipSettingInput["orgMembershipSetting"]>, "mutationFn">): UseMutationResult<{ - createOrgMembershipSetting: { - orgMembershipSetting: InferSelectResult; - }; -}, Error, CreateOrgMembershipSettingInput["orgMembershipSetting"]>; -export function useCreateOrgMembershipSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgMembershipSettingMutation( + params: { + selection: { + fields: S & OrgMembershipSettingSelect; + } & HookStrictSelect, OrgMembershipSettingSelect>; + } & Omit< + UseMutationOptions< + { + createOrgMembershipSetting: { + orgMembershipSetting: InferSelectResult; + }; + }, + Error, + CreateOrgMembershipSettingInput['orgMembershipSetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgMembershipSetting: { + orgMembershipSetting: InferSelectResult; + }; + }, + Error, + CreateOrgMembershipSettingInput['orgMembershipSetting'] +>; +export function useCreateOrgMembershipSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipSettingMutationKeys.create(), - mutationFn: (data: CreateOrgMembershipSettingInput["orgMembershipSetting"]) => getClient().orgMembershipSetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgMembershipSettingInput['orgMembershipSetting']) => + getClient() + .orgMembershipSetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgMembershipSettingKeys.lists() + queryKey: orgMembershipSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgOwnerGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgOwnerGrantMutation.ts index 5be1430f7a..974ac34305 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgOwnerGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgOwnerGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { orgOwnerGrantKeys } from "../query-keys"; -import { orgOwnerGrantMutationKeys } from "../mutation-keys"; -import type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations, CreateOrgOwnerGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations, CreateOrgOwnerGrantInput } from "../../orm/input-types"; +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 { orgOwnerGrantKeys } from '../query-keys'; +import { orgOwnerGrantMutationKeys } from '../mutation-keys'; +import type { + OrgOwnerGrantSelect, + OrgOwnerGrantWithRelations, + CreateOrgOwnerGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgOwnerGrantSelect, + OrgOwnerGrantWithRelations, + CreateOrgOwnerGrantInput, +} from '../../orm/input-types'; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgOwnerGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgOwnerGrantMutation(params: { - selection: ({ - fields: S & OrgOwnerGrantSelect; - } & HookStrictSelect, OrgOwnerGrantSelect>); -} & Omit; - }; -}, Error, CreateOrgOwnerGrantInput["orgOwnerGrant"]>, "mutationFn">): UseMutationResult<{ - createOrgOwnerGrant: { - orgOwnerGrant: InferSelectResult; - }; -}, Error, CreateOrgOwnerGrantInput["orgOwnerGrant"]>; -export function useCreateOrgOwnerGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgOwnerGrantMutation( + params: { + selection: { + fields: S & OrgOwnerGrantSelect; + } & HookStrictSelect, OrgOwnerGrantSelect>; + } & Omit< + UseMutationOptions< + { + createOrgOwnerGrant: { + orgOwnerGrant: InferSelectResult; + }; + }, + Error, + CreateOrgOwnerGrantInput['orgOwnerGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgOwnerGrant: { + orgOwnerGrant: InferSelectResult; + }; + }, + Error, + CreateOrgOwnerGrantInput['orgOwnerGrant'] +>; +export function useCreateOrgOwnerGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgOwnerGrantMutationKeys.create(), - mutationFn: (data: CreateOrgOwnerGrantInput["orgOwnerGrant"]) => getClient().orgOwnerGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgOwnerGrantInput['orgOwnerGrant']) => + getClient() + .orgOwnerGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgOwnerGrantKeys.lists() + queryKey: orgOwnerGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultGrantMutation.ts index fece186afa..03eb33d2c8 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultGrantMutation.ts @@ -4,62 +4,94 @@ * 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 { orgPermissionDefaultGrantKeys } from "../query-keys"; -import { orgPermissionDefaultGrantMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations, CreateOrgPermissionDefaultGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations, CreateOrgPermissionDefaultGrantInput } from "../../orm/input-types"; +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 { orgPermissionDefaultGrantKeys } from '../query-keys'; +import { orgPermissionDefaultGrantMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, + CreateOrgPermissionDefaultGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, + CreateOrgPermissionDefaultGrantInput, +} from '../../orm/input-types'; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgPermissionDefaultGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgPermissionDefaultGrantMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultGrantSelect; - } & HookStrictSelect, OrgPermissionDefaultGrantSelect>); -} & Omit; - }; -}, Error, CreateOrgPermissionDefaultGrantInput["orgPermissionDefaultGrant"]>, "mutationFn">): UseMutationResult<{ - createOrgPermissionDefaultGrant: { - orgPermissionDefaultGrant: InferSelectResult; - }; -}, Error, CreateOrgPermissionDefaultGrantInput["orgPermissionDefaultGrant"]>; -export function useCreateOrgPermissionDefaultGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgPermissionDefaultGrantMutation< + S extends OrgPermissionDefaultGrantSelect, +>( + params: { + selection: { + fields: S & OrgPermissionDefaultGrantSelect; + } & HookStrictSelect, OrgPermissionDefaultGrantSelect>; + } & Omit< + UseMutationOptions< + { + createOrgPermissionDefaultGrant: { + orgPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + CreateOrgPermissionDefaultGrantInput['orgPermissionDefaultGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgPermissionDefaultGrant: { + orgPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + CreateOrgPermissionDefaultGrantInput['orgPermissionDefaultGrant'] +>; +export function useCreateOrgPermissionDefaultGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateOrgPermissionDefaultGrantInput['orgPermissionDefaultGrant'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultGrantMutationKeys.create(), - mutationFn: (data: CreateOrgPermissionDefaultGrantInput["orgPermissionDefaultGrant"]) => getClient().orgPermissionDefaultGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgPermissionDefaultGrantInput['orgPermissionDefaultGrant']) => + getClient() + .orgPermissionDefaultGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultGrantKeys.lists() + queryKey: orgPermissionDefaultGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultMutation.ts index 994bdd0d95..1870514760 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultMutation.ts @@ -4,62 +4,88 @@ * 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 { orgPermissionDefaultKeys } from "../query-keys"; -import { orgPermissionDefaultMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations, CreateOrgPermissionDefaultInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations, CreateOrgPermissionDefaultInput } from "../../orm/input-types"; +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 { orgPermissionDefaultKeys } from '../query-keys'; +import { orgPermissionDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, + CreateOrgPermissionDefaultInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, + CreateOrgPermissionDefaultInput, +} from '../../orm/input-types'; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgPermissionDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgPermissionDefaultMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultSelect; - } & HookStrictSelect, OrgPermissionDefaultSelect>); -} & Omit; - }; -}, Error, CreateOrgPermissionDefaultInput["orgPermissionDefault"]>, "mutationFn">): UseMutationResult<{ - createOrgPermissionDefault: { - orgPermissionDefault: InferSelectResult; - }; -}, Error, CreateOrgPermissionDefaultInput["orgPermissionDefault"]>; -export function useCreateOrgPermissionDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgPermissionDefaultMutation( + params: { + selection: { + fields: S & OrgPermissionDefaultSelect; + } & HookStrictSelect, OrgPermissionDefaultSelect>; + } & Omit< + UseMutationOptions< + { + createOrgPermissionDefault: { + orgPermissionDefault: InferSelectResult; + }; + }, + Error, + CreateOrgPermissionDefaultInput['orgPermissionDefault'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgPermissionDefault: { + orgPermissionDefault: InferSelectResult; + }; + }, + Error, + CreateOrgPermissionDefaultInput['orgPermissionDefault'] +>; +export function useCreateOrgPermissionDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultMutationKeys.create(), - mutationFn: (data: CreateOrgPermissionDefaultInput["orgPermissionDefault"]) => getClient().orgPermissionDefault.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgPermissionDefaultInput['orgPermissionDefault']) => + getClient() + .orgPermissionDefault.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultKeys.lists() + queryKey: orgPermissionDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultPermissionMutation.ts index 0101cd2825..010f341f74 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionDefaultPermissionMutation.ts @@ -4,62 +4,102 @@ * 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 { orgPermissionDefaultPermissionKeys } from "../query-keys"; -import { orgPermissionDefaultPermissionMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations, CreateOrgPermissionDefaultPermissionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations, CreateOrgPermissionDefaultPermissionInput } from "../../orm/input-types"; +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 { orgPermissionDefaultPermissionKeys } from '../query-keys'; +import { orgPermissionDefaultPermissionMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, + CreateOrgPermissionDefaultPermissionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, + CreateOrgPermissionDefaultPermissionInput, +} from '../../orm/input-types'; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgPermissionDefaultPermissionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgPermissionDefaultPermissionMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultPermissionSelect; - } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>); -} & Omit; - }; -}, Error, CreateOrgPermissionDefaultPermissionInput["orgPermissionDefaultPermission"]>, "mutationFn">): UseMutationResult<{ - createOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; - }; -}, Error, CreateOrgPermissionDefaultPermissionInput["orgPermissionDefaultPermission"]>; -export function useCreateOrgPermissionDefaultPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgPermissionDefaultPermissionMutation< + S extends OrgPermissionDefaultPermissionSelect, +>( + params: { + selection: { + fields: S & OrgPermissionDefaultPermissionSelect; + } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; + } & Omit< + UseMutationOptions< + { + createOrgPermissionDefaultPermission: { + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + CreateOrgPermissionDefaultPermissionInput['orgPermissionDefaultPermission'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgPermissionDefaultPermission: { + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + CreateOrgPermissionDefaultPermissionInput['orgPermissionDefaultPermission'] +>; +export function useCreateOrgPermissionDefaultPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateOrgPermissionDefaultPermissionInput['orgPermissionDefaultPermission'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultPermissionMutationKeys.create(), - mutationFn: (data: CreateOrgPermissionDefaultPermissionInput["orgPermissionDefaultPermission"]) => getClient().orgPermissionDefaultPermission.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreateOrgPermissionDefaultPermissionInput['orgPermissionDefaultPermission'] + ) => + getClient() + .orgPermissionDefaultPermission.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultPermissionKeys.lists() + queryKey: orgPermissionDefaultPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionMutation.ts index 3358a79290..8c597cb085 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useCreateOrgPermissionMutation.ts @@ -4,62 +4,85 @@ * 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 { orgPermissionKeys } from "../query-keys"; -import { orgPermissionMutationKeys } from "../mutation-keys"; -import type { OrgPermissionSelect, OrgPermissionWithRelations, CreateOrgPermissionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionSelect, OrgPermissionWithRelations, CreateOrgPermissionInput } from "../../orm/input-types"; +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 { orgPermissionKeys } from '../query-keys'; +import { orgPermissionMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionSelect, + OrgPermissionWithRelations, + CreateOrgPermissionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionSelect, + OrgPermissionWithRelations, + CreateOrgPermissionInput, +} from '../../orm/input-types'; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgPermissionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgPermissionMutation(params: { - selection: ({ - fields: S & OrgPermissionSelect; - } & HookStrictSelect, OrgPermissionSelect>); -} & Omit; - }; -}, Error, CreateOrgPermissionInput["orgPermission"]>, "mutationFn">): UseMutationResult<{ - createOrgPermission: { - orgPermission: InferSelectResult; - }; -}, Error, CreateOrgPermissionInput["orgPermission"]>; -export function useCreateOrgPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgPermissionMutation( + params: { + selection: { + fields: S & OrgPermissionSelect; + } & HookStrictSelect, OrgPermissionSelect>; + } & Omit< + UseMutationOptions< + { + createOrgPermission: { + orgPermission: InferSelectResult; + }; + }, + Error, + CreateOrgPermissionInput['orgPermission'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgPermission: { + orgPermission: InferSelectResult; + }; + }, + Error, + CreateOrgPermissionInput['orgPermission'] +>; +export function useCreateOrgPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionMutationKeys.create(), - mutationFn: (data: CreateOrgPermissionInput["orgPermission"]) => getClient().orgPermission.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgPermissionInput['orgPermission']) => + getClient() + .orgPermission.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgPermissionKeys.lists() + queryKey: orgPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppAdminGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppAdminGrantMutation.ts index c5bee59b94..1962f80e9a 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppAdminGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppAdminGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { appAdminGrantKeys } from "../query-keys"; -import { appAdminGrantMutationKeys } from "../mutation-keys"; -import type { AppAdminGrantSelect, AppAdminGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppAdminGrantSelect, AppAdminGrantWithRelations } from "../../orm/input-types"; +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 { appAdminGrantKeys } from '../query-keys'; +import { appAdminGrantMutationKeys } from '../mutation-keys'; +import type { AppAdminGrantSelect, AppAdminGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppAdminGrantSelect, AppAdminGrantWithRelations } from '../../orm/input-types'; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppAdminGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppAdminGrantMutation(params: { - selection: ({ - fields: S & AppAdminGrantSelect; - } & HookStrictSelect, AppAdminGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppAdminGrant: { - appAdminGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppAdminGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppAdminGrantMutation( + params: { + selection: { + fields: S & AppAdminGrantSelect; + } & HookStrictSelect, AppAdminGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppAdminGrant: { + appAdminGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppAdminGrant: { + appAdminGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppAdminGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appAdminGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appAdminGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appAdminGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appAdminGrantKeys.detail(variables.id) + queryKey: appAdminGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appAdminGrantKeys.lists() + queryKey: appAdminGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppClaimedInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppClaimedInviteMutation.ts index 66d602e333..b1b6f9da85 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppClaimedInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppClaimedInviteMutation.ts @@ -4,77 +4,95 @@ * 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 { appClaimedInviteKeys } from "../query-keys"; -import { appClaimedInviteMutationKeys } from "../mutation-keys"; -import type { AppClaimedInviteSelect, AppClaimedInviteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppClaimedInviteSelect, AppClaimedInviteWithRelations } from "../../orm/input-types"; +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 { appClaimedInviteKeys } from '../query-keys'; +import { appClaimedInviteMutationKeys } from '../mutation-keys'; +import type { AppClaimedInviteSelect, AppClaimedInviteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppClaimedInviteSelect, AppClaimedInviteWithRelations } from '../../orm/input-types'; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppClaimedInviteMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppClaimedInviteMutation(params: { - selection: ({ - fields: S & AppClaimedInviteSelect; - } & HookStrictSelect, AppClaimedInviteSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppClaimedInvite: { - appClaimedInvite: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppClaimedInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppClaimedInviteMutation( + params: { + selection: { + fields: S & AppClaimedInviteSelect; + } & HookStrictSelect, AppClaimedInviteSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppClaimedInvite: { + appClaimedInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppClaimedInvite: { + appClaimedInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppClaimedInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appClaimedInviteMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appClaimedInvite.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appClaimedInvite.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appClaimedInviteKeys.detail(variables.id) + queryKey: appClaimedInviteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appClaimedInviteKeys.lists() + queryKey: appClaimedInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppGrantMutation.ts index 804daa6516..16814431f7 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { appGrantKeys } from "../query-keys"; -import { appGrantMutationKeys } from "../mutation-keys"; -import type { AppGrantSelect, AppGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppGrantSelect, AppGrantWithRelations } from "../../orm/input-types"; +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 { appGrantKeys } from '../query-keys'; +import { appGrantMutationKeys } from '../mutation-keys'; +import type { AppGrantSelect, AppGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppGrantSelect, AppGrantWithRelations } from '../../orm/input-types'; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppGrantMutation(params: { - selection: ({ - fields: S & AppGrantSelect; - } & HookStrictSelect, AppGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppGrant: { - appGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppGrantMutation( + params: { + selection: { + fields: S & AppGrantSelect; + } & HookStrictSelect, AppGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppGrant: { + appGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppGrant: { + appGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appGrantKeys.detail(variables.id) + queryKey: appGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appGrantKeys.lists() + queryKey: appGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppInviteMutation.ts index 308b67e24d..bb948cdda6 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppInviteMutation.ts @@ -4,77 +4,95 @@ * 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 { appInviteKeys } from "../query-keys"; -import { appInviteMutationKeys } from "../mutation-keys"; -import type { AppInviteSelect, AppInviteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppInviteSelect, AppInviteWithRelations } from "../../orm/input-types"; +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 { appInviteKeys } from '../query-keys'; +import { appInviteMutationKeys } from '../mutation-keys'; +import type { AppInviteSelect, AppInviteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppInviteSelect, AppInviteWithRelations } from '../../orm/input-types'; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppInviteMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppInviteMutation(params: { - selection: ({ - fields: S & AppInviteSelect; - } & HookStrictSelect, AppInviteSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppInvite: { - appInvite: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppInviteMutation( + params: { + selection: { + fields: S & AppInviteSelect; + } & HookStrictSelect, AppInviteSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppInvite: { + appInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppInvite: { + appInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appInviteMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appInvite.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appInvite.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appInviteKeys.detail(variables.id) + queryKey: appInviteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appInviteKeys.lists() + queryKey: appInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppMembershipDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppMembershipDefaultMutation.ts index 874092af85..c01ff2054a 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppMembershipDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppMembershipDefaultMutation.ts @@ -4,77 +4,101 @@ * 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 { appMembershipDefaultKeys } from "../query-keys"; -import { appMembershipDefaultMutationKeys } from "../mutation-keys"; -import type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations } from "../../orm/input-types"; +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 { appMembershipDefaultKeys } from '../query-keys'; +import { appMembershipDefaultMutationKeys } from '../mutation-keys'; +import type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, +} from '../../orm/input-types'; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppMembershipDefaultMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppMembershipDefaultMutation(params: { - selection: ({ - fields: S & AppMembershipDefaultSelect; - } & HookStrictSelect, AppMembershipDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppMembershipDefault: { - appMembershipDefault: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppMembershipDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppMembershipDefaultMutation( + params: { + selection: { + fields: S & AppMembershipDefaultSelect; + } & HookStrictSelect, AppMembershipDefaultSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppMembershipDefault: { + appMembershipDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppMembershipDefault: { + appMembershipDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppMembershipDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appMembershipDefaultMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appMembershipDefault.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appMembershipDefault.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appMembershipDefaultKeys.detail(variables.id) + queryKey: appMembershipDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appMembershipDefaultKeys.lists() + queryKey: appMembershipDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppMembershipMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppMembershipMutation.ts index b05b205dda..03a601e74f 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppMembershipMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppMembershipMutation.ts @@ -4,77 +4,95 @@ * 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 { appMembershipKeys } from "../query-keys"; -import { appMembershipMutationKeys } from "../mutation-keys"; -import type { AppMembershipSelect, AppMembershipWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipSelect, AppMembershipWithRelations } from "../../orm/input-types"; +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 { appMembershipKeys } from '../query-keys'; +import { appMembershipMutationKeys } from '../mutation-keys'; +import type { AppMembershipSelect, AppMembershipWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppMembershipSelect, AppMembershipWithRelations } from '../../orm/input-types'; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppMembershipMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppMembershipMutation(params: { - selection: ({ - fields: S & AppMembershipSelect; - } & HookStrictSelect, AppMembershipSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppMembership: { - appMembership: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppMembershipMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppMembershipMutation( + params: { + selection: { + fields: S & AppMembershipSelect; + } & HookStrictSelect, AppMembershipSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppMembership: { + appMembership: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppMembership: { + appMembership: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppMembershipMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appMembershipMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appMembership.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appMembership.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appMembershipKeys.detail(variables.id) + queryKey: appMembershipKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appMembershipKeys.lists() + queryKey: appMembershipKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppOwnerGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppOwnerGrantMutation.ts index 66c172593a..836d241e12 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppOwnerGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppOwnerGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { appOwnerGrantKeys } from "../query-keys"; -import { appOwnerGrantMutationKeys } from "../mutation-keys"; -import type { AppOwnerGrantSelect, AppOwnerGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppOwnerGrantSelect, AppOwnerGrantWithRelations } from "../../orm/input-types"; +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 { appOwnerGrantKeys } from '../query-keys'; +import { appOwnerGrantMutationKeys } from '../mutation-keys'; +import type { AppOwnerGrantSelect, AppOwnerGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppOwnerGrantSelect, AppOwnerGrantWithRelations } from '../../orm/input-types'; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppOwnerGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppOwnerGrantMutation(params: { - selection: ({ - fields: S & AppOwnerGrantSelect; - } & HookStrictSelect, AppOwnerGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppOwnerGrant: { - appOwnerGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppOwnerGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppOwnerGrantMutation( + params: { + selection: { + fields: S & AppOwnerGrantSelect; + } & HookStrictSelect, AppOwnerGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppOwnerGrant: { + appOwnerGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppOwnerGrant: { + appOwnerGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppOwnerGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appOwnerGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appOwnerGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appOwnerGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appOwnerGrantKeys.detail(variables.id) + queryKey: appOwnerGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appOwnerGrantKeys.lists() + queryKey: appOwnerGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultGrantMutation.ts index b395bc786e..ad38391ff2 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultGrantMutation.ts @@ -4,77 +4,103 @@ * 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 { appPermissionDefaultGrantKeys } from "../query-keys"; -import { appPermissionDefaultGrantMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations } from "../../orm/input-types"; +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 { appPermissionDefaultGrantKeys } from '../query-keys'; +import { appPermissionDefaultGrantMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, +} from '../../orm/input-types'; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppPermissionDefaultGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppPermissionDefaultGrantMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultGrantSelect; - } & HookStrictSelect, AppPermissionDefaultGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppPermissionDefaultGrant: { - appPermissionDefaultGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppPermissionDefaultGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppPermissionDefaultGrantMutation< + S extends AppPermissionDefaultGrantSelect, +>( + params: { + selection: { + fields: S & AppPermissionDefaultGrantSelect; + } & HookStrictSelect, AppPermissionDefaultGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppPermissionDefaultGrant: { + appPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppPermissionDefaultGrant: { + appPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppPermissionDefaultGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appPermissionDefaultGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appPermissionDefaultGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appPermissionDefaultGrantKeys.detail(variables.id) + queryKey: appPermissionDefaultGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appPermissionDefaultGrantKeys.lists() + queryKey: appPermissionDefaultGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultMutation.ts index f3d85a660b..a9b23c7473 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultMutation.ts @@ -4,77 +4,101 @@ * 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 { appPermissionDefaultKeys } from "../query-keys"; -import { appPermissionDefaultMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations } from "../../orm/input-types"; +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 { appPermissionDefaultKeys } from '../query-keys'; +import { appPermissionDefaultMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, +} from '../../orm/input-types'; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppPermissionDefaultMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppPermissionDefaultMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultSelect; - } & HookStrictSelect, AppPermissionDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppPermissionDefault: { - appPermissionDefault: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppPermissionDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppPermissionDefaultMutation( + params: { + selection: { + fields: S & AppPermissionDefaultSelect; + } & HookStrictSelect, AppPermissionDefaultSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppPermissionDefault: { + appPermissionDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppPermissionDefault: { + appPermissionDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppPermissionDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appPermissionDefault.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appPermissionDefault.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appPermissionDefaultKeys.detail(variables.id) + queryKey: appPermissionDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appPermissionDefaultKeys.lists() + queryKey: appPermissionDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultPermissionMutation.ts index 8e89e4bfd2..1efbf6a931 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionDefaultPermissionMutation.ts @@ -4,77 +4,109 @@ * 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 { appPermissionDefaultPermissionKeys } from "../query-keys"; -import { appPermissionDefaultPermissionMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations } from "../../orm/input-types"; +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 { appPermissionDefaultPermissionKeys } from '../query-keys'; +import { appPermissionDefaultPermissionMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, +} from '../../orm/input-types'; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppPermissionDefaultPermissionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppPermissionDefaultPermissionMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultPermissionSelect; - } & HookStrictSelect, AppPermissionDefaultPermissionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppPermissionDefaultPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppPermissionDefaultPermissionMutation< + S extends AppPermissionDefaultPermissionSelect, +>( + params: { + selection: { + fields: S & AppPermissionDefaultPermissionSelect; + } & HookStrictSelect, AppPermissionDefaultPermissionSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppPermissionDefaultPermission: { + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppPermissionDefaultPermission: { + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppPermissionDefaultPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultPermissionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appPermissionDefaultPermission.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appPermissionDefaultPermission.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appPermissionDefaultPermissionKeys.detail(variables.id) + queryKey: appPermissionDefaultPermissionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appPermissionDefaultPermissionKeys.lists() + queryKey: appPermissionDefaultPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionMutation.ts index 6cfc40ea31..b50268261e 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteAppPermissionMutation.ts @@ -4,77 +4,95 @@ * 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 { appPermissionKeys } from "../query-keys"; -import { appPermissionMutationKeys } from "../mutation-keys"; -import type { AppPermissionSelect, AppPermissionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionSelect, AppPermissionWithRelations } from "../../orm/input-types"; +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 { appPermissionKeys } from '../query-keys'; +import { appPermissionMutationKeys } from '../mutation-keys'; +import type { AppPermissionSelect, AppPermissionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppPermissionSelect, AppPermissionWithRelations } from '../../orm/input-types'; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppPermissionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppPermissionMutation(params: { - selection: ({ - fields: S & AppPermissionSelect; - } & HookStrictSelect, AppPermissionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppPermission: { - appPermission: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppPermissionMutation( + params: { + selection: { + fields: S & AppPermissionSelect; + } & HookStrictSelect, AppPermissionSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppPermission: { + appPermission: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppPermission: { + appPermission: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appPermission.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appPermission.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appPermissionKeys.detail(variables.id) + queryKey: appPermissionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appPermissionKeys.lists() + queryKey: appPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteMembershipTypeMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteMembershipTypeMutation.ts index e47c862781..71e81ffa9d 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteMembershipTypeMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteMembershipTypeMutation.ts @@ -4,77 +4,95 @@ * 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 { membershipTypeKeys } from "../query-keys"; -import { membershipTypeMutationKeys } from "../mutation-keys"; -import type { MembershipTypeSelect, MembershipTypeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypeSelect, MembershipTypeWithRelations } from "../../orm/input-types"; +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 { membershipTypeKeys } from '../query-keys'; +import { membershipTypeMutationKeys } from '../mutation-keys'; +import type { MembershipTypeSelect, MembershipTypeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { MembershipTypeSelect, MembershipTypeWithRelations } from '../../orm/input-types'; /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteMembershipTypeMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 123 }); * ``` */ -export function useDeleteMembershipTypeMutation(params: { - selection: ({ - fields: S & MembershipTypeSelect; - } & HookStrictSelect, MembershipTypeSelect>); -} & Omit; - }; -}, Error, { - id: number; -}>, "mutationFn">): UseMutationResult<{ - deleteMembershipType: { - membershipType: InferSelectResult; - }; -}, Error, { - id: number; -}>; -export function useDeleteMembershipTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteMembershipTypeMutation( + params: { + selection: { + fields: S & MembershipTypeSelect; + } & HookStrictSelect, MembershipTypeSelect>; + } & Omit< + UseMutationOptions< + { + deleteMembershipType: { + membershipType: InferSelectResult; + }; + }, + Error, + { + id: number; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteMembershipType: { + membershipType: InferSelectResult; + }; + }, + Error, + { + id: number; + } +>; +export function useDeleteMembershipTypeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: number; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipTypeMutationKeys.all, - mutationFn: ({ - id - }: { - id: number; - }) => getClient().membershipType.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: number }) => + getClient() + .membershipType.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: membershipTypeKeys.detail(variables.id) + queryKey: membershipTypeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: membershipTypeKeys.lists() + queryKey: membershipTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgAdminGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgAdminGrantMutation.ts index edea87def3..dfd89d90e2 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgAdminGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgAdminGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { orgAdminGrantKeys } from "../query-keys"; -import { orgAdminGrantMutationKeys } from "../mutation-keys"; -import type { OrgAdminGrantSelect, OrgAdminGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgAdminGrantSelect, OrgAdminGrantWithRelations } from "../../orm/input-types"; +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 { orgAdminGrantKeys } from '../query-keys'; +import { orgAdminGrantMutationKeys } from '../mutation-keys'; +import type { OrgAdminGrantSelect, OrgAdminGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgAdminGrantSelect, OrgAdminGrantWithRelations } from '../../orm/input-types'; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgAdminGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgAdminGrantMutation(params: { - selection: ({ - fields: S & OrgAdminGrantSelect; - } & HookStrictSelect, OrgAdminGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgAdminGrant: { - orgAdminGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgAdminGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgAdminGrantMutation( + params: { + selection: { + fields: S & OrgAdminGrantSelect; + } & HookStrictSelect, OrgAdminGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgAdminGrant: { + orgAdminGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgAdminGrant: { + orgAdminGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgAdminGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgAdminGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgAdminGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgAdminGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgAdminGrantKeys.detail(variables.id) + queryKey: orgAdminGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgAdminGrantKeys.lists() + queryKey: orgAdminGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgClaimedInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgClaimedInviteMutation.ts index d019fd186f..ecc7fc6301 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgClaimedInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgClaimedInviteMutation.ts @@ -4,77 +4,95 @@ * 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 { orgClaimedInviteKeys } from "../query-keys"; -import { orgClaimedInviteMutationKeys } from "../mutation-keys"; -import type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations } from "../../orm/input-types"; +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 { orgClaimedInviteKeys } from '../query-keys'; +import { orgClaimedInviteMutationKeys } from '../mutation-keys'; +import type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations } from '../../orm/input-types'; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgClaimedInviteMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgClaimedInviteMutation(params: { - selection: ({ - fields: S & OrgClaimedInviteSelect; - } & HookStrictSelect, OrgClaimedInviteSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgClaimedInvite: { - orgClaimedInvite: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgClaimedInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgClaimedInviteMutation( + params: { + selection: { + fields: S & OrgClaimedInviteSelect; + } & HookStrictSelect, OrgClaimedInviteSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgClaimedInvite: { + orgClaimedInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgClaimedInvite: { + orgClaimedInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgClaimedInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgClaimedInviteMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgClaimedInvite.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgClaimedInvite.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgClaimedInviteKeys.detail(variables.id) + queryKey: orgClaimedInviteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgClaimedInviteKeys.lists() + queryKey: orgClaimedInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgGrantMutation.ts index 1c70ad590d..3a1d1d9678 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { orgGrantKeys } from "../query-keys"; -import { orgGrantMutationKeys } from "../mutation-keys"; -import type { OrgGrantSelect, OrgGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgGrantSelect, OrgGrantWithRelations } from "../../orm/input-types"; +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 { orgGrantKeys } from '../query-keys'; +import { orgGrantMutationKeys } from '../mutation-keys'; +import type { OrgGrantSelect, OrgGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgGrantSelect, OrgGrantWithRelations } from '../../orm/input-types'; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgGrantMutation(params: { - selection: ({ - fields: S & OrgGrantSelect; - } & HookStrictSelect, OrgGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgGrant: { - orgGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgGrantMutation( + params: { + selection: { + fields: S & OrgGrantSelect; + } & HookStrictSelect, OrgGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgGrant: { + orgGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgGrant: { + orgGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgGrantKeys.detail(variables.id) + queryKey: orgGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgGrantKeys.lists() + queryKey: orgGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgInviteMutation.ts index 683cc75220..34ba212366 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgInviteMutation.ts @@ -4,77 +4,95 @@ * 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 { orgInviteKeys } from "../query-keys"; -import { orgInviteMutationKeys } from "../mutation-keys"; -import type { OrgInviteSelect, OrgInviteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgInviteSelect, OrgInviteWithRelations } from "../../orm/input-types"; +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 { orgInviteKeys } from '../query-keys'; +import { orgInviteMutationKeys } from '../mutation-keys'; +import type { OrgInviteSelect, OrgInviteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgInviteSelect, OrgInviteWithRelations } from '../../orm/input-types'; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgInviteMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgInviteMutation(params: { - selection: ({ - fields: S & OrgInviteSelect; - } & HookStrictSelect, OrgInviteSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgInvite: { - orgInvite: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgInviteMutation( + params: { + selection: { + fields: S & OrgInviteSelect; + } & HookStrictSelect, OrgInviteSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgInvite: { + orgInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgInvite: { + orgInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgInviteMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgInvite.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgInvite.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgInviteKeys.detail(variables.id) + queryKey: orgInviteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgInviteKeys.lists() + queryKey: orgInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMemberMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMemberMutation.ts index e8ea1303ca..ed6a257612 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMemberMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMemberMutation.ts @@ -4,77 +4,95 @@ * 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 { orgMemberKeys } from "../query-keys"; -import { orgMemberMutationKeys } from "../mutation-keys"; -import type { OrgMemberSelect, OrgMemberWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberSelect, OrgMemberWithRelations } from "../../orm/input-types"; +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 { orgMemberKeys } from '../query-keys'; +import { orgMemberMutationKeys } from '../mutation-keys'; +import type { OrgMemberSelect, OrgMemberWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgMemberSelect, OrgMemberWithRelations } from '../../orm/input-types'; /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgMemberMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgMemberMutation(params: { - selection: ({ - fields: S & OrgMemberSelect; - } & HookStrictSelect, OrgMemberSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgMember: { - orgMember: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgMemberMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgMemberMutation( + params: { + selection: { + fields: S & OrgMemberSelect; + } & HookStrictSelect, OrgMemberSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgMember: { + orgMember: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgMember: { + orgMember: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgMemberMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMemberMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgMember.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgMember.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgMemberKeys.detail(variables.id) + queryKey: orgMemberKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMemberKeys.lists() + queryKey: orgMemberKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMemberProfileMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMemberProfileMutation.ts index 5286d95f9e..ce00294d4f 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMemberProfileMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMemberProfileMutation.ts @@ -4,77 +4,95 @@ * 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 { orgMemberProfileKeys } from "../query-keys"; -import { orgMemberProfileMutationKeys } from "../mutation-keys"; -import type { OrgMemberProfileSelect, OrgMemberProfileWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberProfileSelect, OrgMemberProfileWithRelations } from "../../orm/input-types"; +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 { orgMemberProfileKeys } from '../query-keys'; +import { orgMemberProfileMutationKeys } from '../mutation-keys'; +import type { OrgMemberProfileSelect, OrgMemberProfileWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgMemberProfileSelect, OrgMemberProfileWithRelations } from '../../orm/input-types'; /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgMemberProfileMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgMemberProfileMutation(params: { - selection: ({ - fields: S & OrgMemberProfileSelect; - } & HookStrictSelect, OrgMemberProfileSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgMemberProfile: { - orgMemberProfile: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgMemberProfileMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgMemberProfileMutation( + params: { + selection: { + fields: S & OrgMemberProfileSelect; + } & HookStrictSelect, OrgMemberProfileSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgMemberProfile: { + orgMemberProfile: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgMemberProfile: { + orgMemberProfile: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgMemberProfileMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMemberProfileMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgMemberProfile.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgMemberProfile.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgMemberProfileKeys.detail(variables.id) + queryKey: orgMemberProfileKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMemberProfileKeys.lists() + queryKey: orgMemberProfileKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipDefaultMutation.ts index 6d4d915321..50fd076364 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipDefaultMutation.ts @@ -4,77 +4,101 @@ * 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 { orgMembershipDefaultKeys } from "../query-keys"; -import { orgMembershipDefaultMutationKeys } from "../mutation-keys"; -import type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations } from "../../orm/input-types"; +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 { orgMembershipDefaultKeys } from '../query-keys'; +import { orgMembershipDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, +} from '../../orm/input-types'; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgMembershipDefaultMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgMembershipDefaultMutation(params: { - selection: ({ - fields: S & OrgMembershipDefaultSelect; - } & HookStrictSelect, OrgMembershipDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgMembershipDefault: { - orgMembershipDefault: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgMembershipDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgMembershipDefaultMutation( + params: { + selection: { + fields: S & OrgMembershipDefaultSelect; + } & HookStrictSelect, OrgMembershipDefaultSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgMembershipDefault: { + orgMembershipDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgMembershipDefault: { + orgMembershipDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgMembershipDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipDefaultMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgMembershipDefault.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgMembershipDefault.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgMembershipDefaultKeys.detail(variables.id) + queryKey: orgMembershipDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMembershipDefaultKeys.lists() + queryKey: orgMembershipDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipMutation.ts index e8ffb4c5a0..62654c7ee2 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipMutation.ts @@ -4,77 +4,95 @@ * 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 { orgMembershipKeys } from "../query-keys"; -import { orgMembershipMutationKeys } from "../mutation-keys"; -import type { OrgMembershipSelect, OrgMembershipWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSelect, OrgMembershipWithRelations } from "../../orm/input-types"; +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 { orgMembershipKeys } from '../query-keys'; +import { orgMembershipMutationKeys } from '../mutation-keys'; +import type { OrgMembershipSelect, OrgMembershipWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgMembershipSelect, OrgMembershipWithRelations } from '../../orm/input-types'; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgMembershipMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgMembershipMutation(params: { - selection: ({ - fields: S & OrgMembershipSelect; - } & HookStrictSelect, OrgMembershipSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgMembership: { - orgMembership: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgMembershipMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgMembershipMutation( + params: { + selection: { + fields: S & OrgMembershipSelect; + } & HookStrictSelect, OrgMembershipSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgMembership: { + orgMembership: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgMembership: { + orgMembership: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgMembershipMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgMembership.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgMembership.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgMembershipKeys.detail(variables.id) + queryKey: orgMembershipKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMembershipKeys.lists() + queryKey: orgMembershipKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipSettingMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipSettingMutation.ts index bd058b5772..3d0695cf00 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipSettingMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgMembershipSettingMutation.ts @@ -4,77 +4,101 @@ * 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 { orgMembershipSettingKeys } from "../query-keys"; -import { orgMembershipSettingMutationKeys } from "../mutation-keys"; -import type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations } from "../../orm/input-types"; +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 { orgMembershipSettingKeys } from '../query-keys'; +import { orgMembershipSettingMutationKeys } from '../mutation-keys'; +import type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, +} from '../../orm/input-types'; /** * Per-entity settings for the memberships module - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgMembershipSettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgMembershipSettingMutation(params: { - selection: ({ - fields: S & OrgMembershipSettingSelect; - } & HookStrictSelect, OrgMembershipSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgMembershipSetting: { - orgMembershipSetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgMembershipSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgMembershipSettingMutation( + params: { + selection: { + fields: S & OrgMembershipSettingSelect; + } & HookStrictSelect, OrgMembershipSettingSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgMembershipSetting: { + orgMembershipSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgMembershipSetting: { + orgMembershipSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgMembershipSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipSettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgMembershipSetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgMembershipSetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgMembershipSettingKeys.detail(variables.id) + queryKey: orgMembershipSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMembershipSettingKeys.lists() + queryKey: orgMembershipSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgOwnerGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgOwnerGrantMutation.ts index 238ae1bb82..834c27ca6d 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgOwnerGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgOwnerGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { orgOwnerGrantKeys } from "../query-keys"; -import { orgOwnerGrantMutationKeys } from "../mutation-keys"; -import type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations } from "../../orm/input-types"; +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 { orgOwnerGrantKeys } from '../query-keys'; +import { orgOwnerGrantMutationKeys } from '../mutation-keys'; +import type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations } from '../../orm/input-types'; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgOwnerGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgOwnerGrantMutation(params: { - selection: ({ - fields: S & OrgOwnerGrantSelect; - } & HookStrictSelect, OrgOwnerGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgOwnerGrant: { - orgOwnerGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgOwnerGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgOwnerGrantMutation( + params: { + selection: { + fields: S & OrgOwnerGrantSelect; + } & HookStrictSelect, OrgOwnerGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgOwnerGrant: { + orgOwnerGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgOwnerGrant: { + orgOwnerGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgOwnerGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgOwnerGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgOwnerGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgOwnerGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgOwnerGrantKeys.detail(variables.id) + queryKey: orgOwnerGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgOwnerGrantKeys.lists() + queryKey: orgOwnerGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultGrantMutation.ts index 54e7d8f695..1b2e20d5bf 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultGrantMutation.ts @@ -4,77 +4,103 @@ * 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 { orgPermissionDefaultGrantKeys } from "../query-keys"; -import { orgPermissionDefaultGrantMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations } from "../../orm/input-types"; +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 { orgPermissionDefaultGrantKeys } from '../query-keys'; +import { orgPermissionDefaultGrantMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, +} from '../../orm/input-types'; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgPermissionDefaultGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgPermissionDefaultGrantMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultGrantSelect; - } & HookStrictSelect, OrgPermissionDefaultGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgPermissionDefaultGrant: { - orgPermissionDefaultGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgPermissionDefaultGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgPermissionDefaultGrantMutation< + S extends OrgPermissionDefaultGrantSelect, +>( + params: { + selection: { + fields: S & OrgPermissionDefaultGrantSelect; + } & HookStrictSelect, OrgPermissionDefaultGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgPermissionDefaultGrant: { + orgPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgPermissionDefaultGrant: { + orgPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgPermissionDefaultGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgPermissionDefaultGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgPermissionDefaultGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgPermissionDefaultGrantKeys.detail(variables.id) + queryKey: orgPermissionDefaultGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultGrantKeys.lists() + queryKey: orgPermissionDefaultGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultMutation.ts index 965581e3c8..a811eca533 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultMutation.ts @@ -4,77 +4,101 @@ * 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 { orgPermissionDefaultKeys } from "../query-keys"; -import { orgPermissionDefaultMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations } from "../../orm/input-types"; +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 { orgPermissionDefaultKeys } from '../query-keys'; +import { orgPermissionDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, +} from '../../orm/input-types'; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgPermissionDefaultMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgPermissionDefaultMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultSelect; - } & HookStrictSelect, OrgPermissionDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgPermissionDefault: { - orgPermissionDefault: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgPermissionDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgPermissionDefaultMutation( + params: { + selection: { + fields: S & OrgPermissionDefaultSelect; + } & HookStrictSelect, OrgPermissionDefaultSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgPermissionDefault: { + orgPermissionDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgPermissionDefault: { + orgPermissionDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgPermissionDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgPermissionDefault.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgPermissionDefault.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgPermissionDefaultKeys.detail(variables.id) + queryKey: orgPermissionDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultKeys.lists() + queryKey: orgPermissionDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultPermissionMutation.ts index c24a36281b..5cca833805 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionDefaultPermissionMutation.ts @@ -4,77 +4,109 @@ * 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 { orgPermissionDefaultPermissionKeys } from "../query-keys"; -import { orgPermissionDefaultPermissionMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations } from "../../orm/input-types"; +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 { orgPermissionDefaultPermissionKeys } from '../query-keys'; +import { orgPermissionDefaultPermissionMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, +} from '../../orm/input-types'; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgPermissionDefaultPermissionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgPermissionDefaultPermissionMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultPermissionSelect; - } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgPermissionDefaultPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgPermissionDefaultPermissionMutation< + S extends OrgPermissionDefaultPermissionSelect, +>( + params: { + selection: { + fields: S & OrgPermissionDefaultPermissionSelect; + } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgPermissionDefaultPermission: { + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgPermissionDefaultPermission: { + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgPermissionDefaultPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultPermissionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgPermissionDefaultPermission.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgPermissionDefaultPermission.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgPermissionDefaultPermissionKeys.detail(variables.id) + queryKey: orgPermissionDefaultPermissionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultPermissionKeys.lists() + queryKey: orgPermissionDefaultPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionMutation.ts index 0c8ab9603c..1c02a813ab 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useDeleteOrgPermissionMutation.ts @@ -4,77 +4,95 @@ * 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 { orgPermissionKeys } from "../query-keys"; -import { orgPermissionMutationKeys } from "../mutation-keys"; -import type { OrgPermissionSelect, OrgPermissionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionSelect, OrgPermissionWithRelations } from "../../orm/input-types"; +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 { orgPermissionKeys } from '../query-keys'; +import { orgPermissionMutationKeys } from '../mutation-keys'; +import type { OrgPermissionSelect, OrgPermissionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgPermissionSelect, OrgPermissionWithRelations } from '../../orm/input-types'; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgPermissionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgPermissionMutation(params: { - selection: ({ - fields: S & OrgPermissionSelect; - } & HookStrictSelect, OrgPermissionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgPermission: { - orgPermission: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgPermissionMutation( + params: { + selection: { + fields: S & OrgPermissionSelect; + } & HookStrictSelect, OrgPermissionSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgPermission: { + orgPermission: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgPermission: { + orgPermission: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgPermission.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgPermission.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgPermissionKeys.detail(variables.id) + queryKey: orgPermissionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgPermissionKeys.lists() + queryKey: orgPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useSubmitAppInviteCodeMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useSubmitAppInviteCodeMutation.ts index 1f00676434..e4bc10c97d 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useSubmitAppInviteCodeMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useSubmitAppInviteCodeMutation.ts @@ -4,39 +4,55 @@ * 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 { SubmitAppInviteCodeVariables } from "../../orm/mutation"; -import type { SubmitAppInviteCodePayloadSelect, SubmitAppInviteCodePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SubmitAppInviteCodeVariables } from "../../orm/mutation"; -export type { SubmitAppInviteCodePayloadSelect } from "../../orm/input-types"; -export function useSubmitAppInviteCodeMutation(params: { - selection: ({ - fields: S & SubmitAppInviteCodePayloadSelect; - } & HookStrictSelect, SubmitAppInviteCodePayloadSelect>); -} & Omit | null; -}, Error, SubmitAppInviteCodeVariables>, "mutationFn">): UseMutationResult<{ - submitAppInviteCode: InferSelectResult | null; -}, Error, SubmitAppInviteCodeVariables> { +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 { SubmitAppInviteCodeVariables } from '../../orm/mutation'; +import type { + SubmitAppInviteCodePayloadSelect, + SubmitAppInviteCodePayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SubmitAppInviteCodeVariables } from '../../orm/mutation'; +export type { SubmitAppInviteCodePayloadSelect } from '../../orm/input-types'; +export function useSubmitAppInviteCodeMutation( + params: { + selection: { + fields: S & SubmitAppInviteCodePayloadSelect; + } & HookStrictSelect, SubmitAppInviteCodePayloadSelect>; + } & Omit< + UseMutationOptions< + { + submitAppInviteCode: InferSelectResult | null; + }, + Error, + SubmitAppInviteCodeVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + submitAppInviteCode: InferSelectResult | null; + }, + Error, + SubmitAppInviteCodeVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.submitAppInviteCode(), - mutationFn: (variables: SubmitAppInviteCodeVariables) => getClient().mutation.submitAppInviteCode(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SubmitAppInviteCodeVariables) => + getClient() + .mutation.submitAppInviteCode(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useSubmitOrgInviteCodeMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useSubmitOrgInviteCodeMutation.ts index 7b0b388262..a2e71103be 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useSubmitOrgInviteCodeMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useSubmitOrgInviteCodeMutation.ts @@ -4,39 +4,55 @@ * 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 { SubmitOrgInviteCodeVariables } from "../../orm/mutation"; -import type { SubmitOrgInviteCodePayloadSelect, SubmitOrgInviteCodePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SubmitOrgInviteCodeVariables } from "../../orm/mutation"; -export type { SubmitOrgInviteCodePayloadSelect } from "../../orm/input-types"; -export function useSubmitOrgInviteCodeMutation(params: { - selection: ({ - fields: S & SubmitOrgInviteCodePayloadSelect; - } & HookStrictSelect, SubmitOrgInviteCodePayloadSelect>); -} & Omit | null; -}, Error, SubmitOrgInviteCodeVariables>, "mutationFn">): UseMutationResult<{ - submitOrgInviteCode: InferSelectResult | null; -}, Error, SubmitOrgInviteCodeVariables> { +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 { SubmitOrgInviteCodeVariables } from '../../orm/mutation'; +import type { + SubmitOrgInviteCodePayloadSelect, + SubmitOrgInviteCodePayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SubmitOrgInviteCodeVariables } from '../../orm/mutation'; +export type { SubmitOrgInviteCodePayloadSelect } from '../../orm/input-types'; +export function useSubmitOrgInviteCodeMutation( + params: { + selection: { + fields: S & SubmitOrgInviteCodePayloadSelect; + } & HookStrictSelect, SubmitOrgInviteCodePayloadSelect>; + } & Omit< + UseMutationOptions< + { + submitOrgInviteCode: InferSelectResult | null; + }, + Error, + SubmitOrgInviteCodeVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + submitOrgInviteCode: InferSelectResult | null; + }, + Error, + SubmitOrgInviteCodeVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.submitOrgInviteCode(), - mutationFn: (variables: SubmitOrgInviteCodeVariables) => getClient().mutation.submitOrgInviteCode(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SubmitOrgInviteCodeVariables) => + getClient() + .mutation.submitOrgInviteCode(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppAdminGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppAdminGrantMutation.ts index e3177b390a..a41e1b8b92 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppAdminGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppAdminGrantMutation.ts @@ -4,83 +4,113 @@ * 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 { appAdminGrantKeys } from "../query-keys"; -import { appAdminGrantMutationKeys } from "../mutation-keys"; -import type { AppAdminGrantSelect, AppAdminGrantWithRelations, AppAdminGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppAdminGrantSelect, AppAdminGrantWithRelations, AppAdminGrantPatch } from "../../orm/input-types"; +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 { appAdminGrantKeys } from '../query-keys'; +import { appAdminGrantMutationKeys } from '../mutation-keys'; +import type { + AppAdminGrantSelect, + AppAdminGrantWithRelations, + AppAdminGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppAdminGrantSelect, + AppAdminGrantWithRelations, + AppAdminGrantPatch, +} from '../../orm/input-types'; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppAdminGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appAdminGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppAdminGrantMutation(params: { - selection: ({ - fields: S & AppAdminGrantSelect; - } & HookStrictSelect, AppAdminGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - appAdminGrantPatch: AppAdminGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppAdminGrant: { - appAdminGrant: InferSelectResult; - }; -}, Error, { - id: string; - appAdminGrantPatch: AppAdminGrantPatch; -}>; -export function useUpdateAppAdminGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppAdminGrantMutation( + params: { + selection: { + fields: S & AppAdminGrantSelect; + } & HookStrictSelect, AppAdminGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateAppAdminGrant: { + appAdminGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + appAdminGrantPatch: AppAdminGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppAdminGrant: { + appAdminGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + appAdminGrantPatch: AppAdminGrantPatch; + } +>; +export function useUpdateAppAdminGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appAdminGrantPatch: AppAdminGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appAdminGrantMutationKeys.all, mutationFn: ({ id, - appAdminGrantPatch + appAdminGrantPatch, }: { id: string; appAdminGrantPatch: AppAdminGrantPatch; - }) => getClient().appAdminGrant.update({ - where: { - id - }, - data: appAdminGrantPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appAdminGrant.update({ + where: { + id, + }, + data: appAdminGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appAdminGrantKeys.detail(variables.id) + queryKey: appAdminGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appAdminGrantKeys.lists() + queryKey: appAdminGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppClaimedInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppClaimedInviteMutation.ts index ace4927aac..10b0e5aeb1 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppClaimedInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppClaimedInviteMutation.ts @@ -4,83 +4,113 @@ * 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 { appClaimedInviteKeys } from "../query-keys"; -import { appClaimedInviteMutationKeys } from "../mutation-keys"; -import type { AppClaimedInviteSelect, AppClaimedInviteWithRelations, AppClaimedInvitePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppClaimedInviteSelect, AppClaimedInviteWithRelations, AppClaimedInvitePatch } from "../../orm/input-types"; +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 { appClaimedInviteKeys } from '../query-keys'; +import { appClaimedInviteMutationKeys } from '../mutation-keys'; +import type { + AppClaimedInviteSelect, + AppClaimedInviteWithRelations, + AppClaimedInvitePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppClaimedInviteSelect, + AppClaimedInviteWithRelations, + AppClaimedInvitePatch, +} from '../../orm/input-types'; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppClaimedInviteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appClaimedInvitePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppClaimedInviteMutation(params: { - selection: ({ - fields: S & AppClaimedInviteSelect; - } & HookStrictSelect, AppClaimedInviteSelect>); -} & Omit; - }; -}, Error, { - id: string; - appClaimedInvitePatch: AppClaimedInvitePatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppClaimedInvite: { - appClaimedInvite: InferSelectResult; - }; -}, Error, { - id: string; - appClaimedInvitePatch: AppClaimedInvitePatch; -}>; -export function useUpdateAppClaimedInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppClaimedInviteMutation( + params: { + selection: { + fields: S & AppClaimedInviteSelect; + } & HookStrictSelect, AppClaimedInviteSelect>; + } & Omit< + UseMutationOptions< + { + updateAppClaimedInvite: { + appClaimedInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + appClaimedInvitePatch: AppClaimedInvitePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppClaimedInvite: { + appClaimedInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + appClaimedInvitePatch: AppClaimedInvitePatch; + } +>; +export function useUpdateAppClaimedInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appClaimedInvitePatch: AppClaimedInvitePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appClaimedInviteMutationKeys.all, mutationFn: ({ id, - appClaimedInvitePatch + appClaimedInvitePatch, }: { id: string; appClaimedInvitePatch: AppClaimedInvitePatch; - }) => getClient().appClaimedInvite.update({ - where: { - id - }, - data: appClaimedInvitePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appClaimedInvite.update({ + where: { + id, + }, + data: appClaimedInvitePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appClaimedInviteKeys.detail(variables.id) + queryKey: appClaimedInviteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appClaimedInviteKeys.lists() + queryKey: appClaimedInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppGrantMutation.ts index d1029cb1b5..d0cb6ba8fc 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppGrantMutation.ts @@ -4,83 +4,99 @@ * 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 { appGrantKeys } from "../query-keys"; -import { appGrantMutationKeys } from "../mutation-keys"; -import type { AppGrantSelect, AppGrantWithRelations, AppGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppGrantSelect, AppGrantWithRelations, AppGrantPatch } from "../../orm/input-types"; +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 { appGrantKeys } from '../query-keys'; +import { appGrantMutationKeys } from '../mutation-keys'; +import type { AppGrantSelect, AppGrantWithRelations, AppGrantPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppGrantSelect, AppGrantWithRelations, AppGrantPatch } from '../../orm/input-types'; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppGrantMutation(params: { - selection: ({ - fields: S & AppGrantSelect; - } & HookStrictSelect, AppGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - appGrantPatch: AppGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppGrant: { - appGrant: InferSelectResult; - }; -}, Error, { - id: string; - appGrantPatch: AppGrantPatch; -}>; -export function useUpdateAppGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppGrantMutation( + params: { + selection: { + fields: S & AppGrantSelect; + } & HookStrictSelect, AppGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateAppGrant: { + appGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + appGrantPatch: AppGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppGrant: { + appGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + appGrantPatch: AppGrantPatch; + } +>; +export function useUpdateAppGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appGrantPatch: AppGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appGrantMutationKeys.all, - mutationFn: ({ - id, - appGrantPatch - }: { - id: string; - appGrantPatch: AppGrantPatch; - }) => getClient().appGrant.update({ - where: { - id - }, - data: appGrantPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, appGrantPatch }: { id: string; appGrantPatch: AppGrantPatch }) => + getClient() + .appGrant.update({ + where: { + id, + }, + data: appGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appGrantKeys.detail(variables.id) + queryKey: appGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appGrantKeys.lists() + queryKey: appGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppInviteMutation.ts index 7518a079cd..c2e182b612 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppInviteMutation.ts @@ -4,83 +4,107 @@ * 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 { appInviteKeys } from "../query-keys"; -import { appInviteMutationKeys } from "../mutation-keys"; -import type { AppInviteSelect, AppInviteWithRelations, AppInvitePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppInviteSelect, AppInviteWithRelations, AppInvitePatch } from "../../orm/input-types"; +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 { appInviteKeys } from '../query-keys'; +import { appInviteMutationKeys } from '../mutation-keys'; +import type { + AppInviteSelect, + AppInviteWithRelations, + AppInvitePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppInviteSelect, + AppInviteWithRelations, + AppInvitePatch, +} from '../../orm/input-types'; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppInviteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appInvitePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppInviteMutation(params: { - selection: ({ - fields: S & AppInviteSelect; - } & HookStrictSelect, AppInviteSelect>); -} & Omit; - }; -}, Error, { - id: string; - appInvitePatch: AppInvitePatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppInvite: { - appInvite: InferSelectResult; - }; -}, Error, { - id: string; - appInvitePatch: AppInvitePatch; -}>; -export function useUpdateAppInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppInviteMutation( + params: { + selection: { + fields: S & AppInviteSelect; + } & HookStrictSelect, AppInviteSelect>; + } & Omit< + UseMutationOptions< + { + updateAppInvite: { + appInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + appInvitePatch: AppInvitePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppInvite: { + appInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + appInvitePatch: AppInvitePatch; + } +>; +export function useUpdateAppInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appInvitePatch: AppInvitePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appInviteMutationKeys.all, - mutationFn: ({ - id, - appInvitePatch - }: { - id: string; - appInvitePatch: AppInvitePatch; - }) => getClient().appInvite.update({ - where: { - id - }, - data: appInvitePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, appInvitePatch }: { id: string; appInvitePatch: AppInvitePatch }) => + getClient() + .appInvite.update({ + where: { + id, + }, + data: appInvitePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appInviteKeys.detail(variables.id) + queryKey: appInviteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appInviteKeys.lists() + queryKey: appInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppMembershipDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppMembershipDefaultMutation.ts index 55e06a2f75..72d872f428 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppMembershipDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppMembershipDefaultMutation.ts @@ -4,83 +4,113 @@ * 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 { appMembershipDefaultKeys } from "../query-keys"; -import { appMembershipDefaultMutationKeys } from "../mutation-keys"; -import type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations, AppMembershipDefaultPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations, AppMembershipDefaultPatch } from "../../orm/input-types"; +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 { appMembershipDefaultKeys } from '../query-keys'; +import { appMembershipDefaultMutationKeys } from '../mutation-keys'; +import type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, + AppMembershipDefaultPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, + AppMembershipDefaultPatch, +} from '../../orm/input-types'; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppMembershipDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appMembershipDefaultPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppMembershipDefaultMutation(params: { - selection: ({ - fields: S & AppMembershipDefaultSelect; - } & HookStrictSelect, AppMembershipDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; - appMembershipDefaultPatch: AppMembershipDefaultPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppMembershipDefault: { - appMembershipDefault: InferSelectResult; - }; -}, Error, { - id: string; - appMembershipDefaultPatch: AppMembershipDefaultPatch; -}>; -export function useUpdateAppMembershipDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppMembershipDefaultMutation( + params: { + selection: { + fields: S & AppMembershipDefaultSelect; + } & HookStrictSelect, AppMembershipDefaultSelect>; + } & Omit< + UseMutationOptions< + { + updateAppMembershipDefault: { + appMembershipDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + appMembershipDefaultPatch: AppMembershipDefaultPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppMembershipDefault: { + appMembershipDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + appMembershipDefaultPatch: AppMembershipDefaultPatch; + } +>; +export function useUpdateAppMembershipDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appMembershipDefaultPatch: AppMembershipDefaultPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appMembershipDefaultMutationKeys.all, mutationFn: ({ id, - appMembershipDefaultPatch + appMembershipDefaultPatch, }: { id: string; appMembershipDefaultPatch: AppMembershipDefaultPatch; - }) => getClient().appMembershipDefault.update({ - where: { - id - }, - data: appMembershipDefaultPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appMembershipDefault.update({ + where: { + id, + }, + data: appMembershipDefaultPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appMembershipDefaultKeys.detail(variables.id) + queryKey: appMembershipDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appMembershipDefaultKeys.lists() + queryKey: appMembershipDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppMembershipMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppMembershipMutation.ts index ac085aca42..7ead9bdc26 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppMembershipMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppMembershipMutation.ts @@ -4,83 +4,113 @@ * 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 { appMembershipKeys } from "../query-keys"; -import { appMembershipMutationKeys } from "../mutation-keys"; -import type { AppMembershipSelect, AppMembershipWithRelations, AppMembershipPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipSelect, AppMembershipWithRelations, AppMembershipPatch } from "../../orm/input-types"; +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 { appMembershipKeys } from '../query-keys'; +import { appMembershipMutationKeys } from '../mutation-keys'; +import type { + AppMembershipSelect, + AppMembershipWithRelations, + AppMembershipPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppMembershipSelect, + AppMembershipWithRelations, + AppMembershipPatch, +} from '../../orm/input-types'; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppMembershipMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appMembershipPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppMembershipMutation(params: { - selection: ({ - fields: S & AppMembershipSelect; - } & HookStrictSelect, AppMembershipSelect>); -} & Omit; - }; -}, Error, { - id: string; - appMembershipPatch: AppMembershipPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppMembership: { - appMembership: InferSelectResult; - }; -}, Error, { - id: string; - appMembershipPatch: AppMembershipPatch; -}>; -export function useUpdateAppMembershipMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppMembershipMutation( + params: { + selection: { + fields: S & AppMembershipSelect; + } & HookStrictSelect, AppMembershipSelect>; + } & Omit< + UseMutationOptions< + { + updateAppMembership: { + appMembership: InferSelectResult; + }; + }, + Error, + { + id: string; + appMembershipPatch: AppMembershipPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppMembership: { + appMembership: InferSelectResult; + }; + }, + Error, + { + id: string; + appMembershipPatch: AppMembershipPatch; + } +>; +export function useUpdateAppMembershipMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appMembershipPatch: AppMembershipPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appMembershipMutationKeys.all, mutationFn: ({ id, - appMembershipPatch + appMembershipPatch, }: { id: string; appMembershipPatch: AppMembershipPatch; - }) => getClient().appMembership.update({ - where: { - id - }, - data: appMembershipPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appMembership.update({ + where: { + id, + }, + data: appMembershipPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appMembershipKeys.detail(variables.id) + queryKey: appMembershipKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appMembershipKeys.lists() + queryKey: appMembershipKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppOwnerGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppOwnerGrantMutation.ts index 0d60b5aa2b..7db485406d 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppOwnerGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppOwnerGrantMutation.ts @@ -4,83 +4,113 @@ * 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 { appOwnerGrantKeys } from "../query-keys"; -import { appOwnerGrantMutationKeys } from "../mutation-keys"; -import type { AppOwnerGrantSelect, AppOwnerGrantWithRelations, AppOwnerGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppOwnerGrantSelect, AppOwnerGrantWithRelations, AppOwnerGrantPatch } from "../../orm/input-types"; +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 { appOwnerGrantKeys } from '../query-keys'; +import { appOwnerGrantMutationKeys } from '../mutation-keys'; +import type { + AppOwnerGrantSelect, + AppOwnerGrantWithRelations, + AppOwnerGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppOwnerGrantSelect, + AppOwnerGrantWithRelations, + AppOwnerGrantPatch, +} from '../../orm/input-types'; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppOwnerGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appOwnerGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppOwnerGrantMutation(params: { - selection: ({ - fields: S & AppOwnerGrantSelect; - } & HookStrictSelect, AppOwnerGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - appOwnerGrantPatch: AppOwnerGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppOwnerGrant: { - appOwnerGrant: InferSelectResult; - }; -}, Error, { - id: string; - appOwnerGrantPatch: AppOwnerGrantPatch; -}>; -export function useUpdateAppOwnerGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppOwnerGrantMutation( + params: { + selection: { + fields: S & AppOwnerGrantSelect; + } & HookStrictSelect, AppOwnerGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateAppOwnerGrant: { + appOwnerGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + appOwnerGrantPatch: AppOwnerGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppOwnerGrant: { + appOwnerGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + appOwnerGrantPatch: AppOwnerGrantPatch; + } +>; +export function useUpdateAppOwnerGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appOwnerGrantPatch: AppOwnerGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appOwnerGrantMutationKeys.all, mutationFn: ({ id, - appOwnerGrantPatch + appOwnerGrantPatch, }: { id: string; appOwnerGrantPatch: AppOwnerGrantPatch; - }) => getClient().appOwnerGrant.update({ - where: { - id - }, - data: appOwnerGrantPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appOwnerGrant.update({ + where: { + id, + }, + data: appOwnerGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appOwnerGrantKeys.detail(variables.id) + queryKey: appOwnerGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appOwnerGrantKeys.lists() + queryKey: appOwnerGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultGrantMutation.ts index 30317cc81b..8977a55082 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultGrantMutation.ts @@ -4,83 +4,115 @@ * 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 { appPermissionDefaultGrantKeys } from "../query-keys"; -import { appPermissionDefaultGrantMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations, AppPermissionDefaultGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations, AppPermissionDefaultGrantPatch } from "../../orm/input-types"; +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 { appPermissionDefaultGrantKeys } from '../query-keys'; +import { appPermissionDefaultGrantMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, + AppPermissionDefaultGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, + AppPermissionDefaultGrantPatch, +} from '../../orm/input-types'; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppPermissionDefaultGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appPermissionDefaultGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppPermissionDefaultGrantMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultGrantSelect; - } & HookStrictSelect, AppPermissionDefaultGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - appPermissionDefaultGrantPatch: AppPermissionDefaultGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppPermissionDefaultGrant: { - appPermissionDefaultGrant: InferSelectResult; - }; -}, Error, { - id: string; - appPermissionDefaultGrantPatch: AppPermissionDefaultGrantPatch; -}>; -export function useUpdateAppPermissionDefaultGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppPermissionDefaultGrantMutation< + S extends AppPermissionDefaultGrantSelect, +>( + params: { + selection: { + fields: S & AppPermissionDefaultGrantSelect; + } & HookStrictSelect, AppPermissionDefaultGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateAppPermissionDefaultGrant: { + appPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + appPermissionDefaultGrantPatch: AppPermissionDefaultGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppPermissionDefaultGrant: { + appPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + appPermissionDefaultGrantPatch: AppPermissionDefaultGrantPatch; + } +>; +export function useUpdateAppPermissionDefaultGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appPermissionDefaultGrantPatch: AppPermissionDefaultGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultGrantMutationKeys.all, mutationFn: ({ id, - appPermissionDefaultGrantPatch + appPermissionDefaultGrantPatch, }: { id: string; appPermissionDefaultGrantPatch: AppPermissionDefaultGrantPatch; - }) => getClient().appPermissionDefaultGrant.update({ - where: { - id - }, - data: appPermissionDefaultGrantPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appPermissionDefaultGrant.update({ + where: { + id, + }, + data: appPermissionDefaultGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appPermissionDefaultGrantKeys.detail(variables.id) + queryKey: appPermissionDefaultGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appPermissionDefaultGrantKeys.lists() + queryKey: appPermissionDefaultGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultMutation.ts index e170a57019..9933bb8ebc 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultMutation.ts @@ -4,83 +4,113 @@ * 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 { appPermissionDefaultKeys } from "../query-keys"; -import { appPermissionDefaultMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations, AppPermissionDefaultPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations, AppPermissionDefaultPatch } from "../../orm/input-types"; +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 { appPermissionDefaultKeys } from '../query-keys'; +import { appPermissionDefaultMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, + AppPermissionDefaultPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, + AppPermissionDefaultPatch, +} from '../../orm/input-types'; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppPermissionDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appPermissionDefaultPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppPermissionDefaultMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultSelect; - } & HookStrictSelect, AppPermissionDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; - appPermissionDefaultPatch: AppPermissionDefaultPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppPermissionDefault: { - appPermissionDefault: InferSelectResult; - }; -}, Error, { - id: string; - appPermissionDefaultPatch: AppPermissionDefaultPatch; -}>; -export function useUpdateAppPermissionDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppPermissionDefaultMutation( + params: { + selection: { + fields: S & AppPermissionDefaultSelect; + } & HookStrictSelect, AppPermissionDefaultSelect>; + } & Omit< + UseMutationOptions< + { + updateAppPermissionDefault: { + appPermissionDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + appPermissionDefaultPatch: AppPermissionDefaultPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppPermissionDefault: { + appPermissionDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + appPermissionDefaultPatch: AppPermissionDefaultPatch; + } +>; +export function useUpdateAppPermissionDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appPermissionDefaultPatch: AppPermissionDefaultPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultMutationKeys.all, mutationFn: ({ id, - appPermissionDefaultPatch + appPermissionDefaultPatch, }: { id: string; appPermissionDefaultPatch: AppPermissionDefaultPatch; - }) => getClient().appPermissionDefault.update({ - where: { - id - }, - data: appPermissionDefaultPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appPermissionDefault.update({ + where: { + id, + }, + data: appPermissionDefaultPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appPermissionDefaultKeys.detail(variables.id) + queryKey: appPermissionDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appPermissionDefaultKeys.lists() + queryKey: appPermissionDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultPermissionMutation.ts index 5b32f69f67..80340cd64c 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionDefaultPermissionMutation.ts @@ -4,83 +4,121 @@ * 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 { appPermissionDefaultPermissionKeys } from "../query-keys"; -import { appPermissionDefaultPermissionMutationKeys } from "../mutation-keys"; -import type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations, AppPermissionDefaultPermissionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations, AppPermissionDefaultPermissionPatch } from "../../orm/input-types"; +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 { appPermissionDefaultPermissionKeys } from '../query-keys'; +import { appPermissionDefaultPermissionMutationKeys } from '../mutation-keys'; +import type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, + AppPermissionDefaultPermissionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, + AppPermissionDefaultPermissionPatch, +} from '../../orm/input-types'; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppPermissionDefaultPermissionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appPermissionDefaultPermissionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppPermissionDefaultPermissionMutation(params: { - selection: ({ - fields: S & AppPermissionDefaultPermissionSelect; - } & HookStrictSelect, AppPermissionDefaultPermissionSelect>); -} & Omit; - }; -}, Error, { - id: string; - appPermissionDefaultPermissionPatch: AppPermissionDefaultPermissionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; - }; -}, Error, { - id: string; - appPermissionDefaultPermissionPatch: AppPermissionDefaultPermissionPatch; -}>; -export function useUpdateAppPermissionDefaultPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppPermissionDefaultPermissionMutation< + S extends AppPermissionDefaultPermissionSelect, +>( + params: { + selection: { + fields: S & AppPermissionDefaultPermissionSelect; + } & HookStrictSelect, AppPermissionDefaultPermissionSelect>; + } & Omit< + UseMutationOptions< + { + updateAppPermissionDefaultPermission: { + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + { + id: string; + appPermissionDefaultPermissionPatch: AppPermissionDefaultPermissionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppPermissionDefaultPermission: { + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + { + id: string; + appPermissionDefaultPermissionPatch: AppPermissionDefaultPermissionPatch; + } +>; +export function useUpdateAppPermissionDefaultPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appPermissionDefaultPermissionPatch: AppPermissionDefaultPermissionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionDefaultPermissionMutationKeys.all, mutationFn: ({ id, - appPermissionDefaultPermissionPatch + appPermissionDefaultPermissionPatch, }: { id: string; appPermissionDefaultPermissionPatch: AppPermissionDefaultPermissionPatch; - }) => getClient().appPermissionDefaultPermission.update({ - where: { - id - }, - data: appPermissionDefaultPermissionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appPermissionDefaultPermission.update({ + where: { + id, + }, + data: appPermissionDefaultPermissionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appPermissionDefaultPermissionKeys.detail(variables.id) + queryKey: appPermissionDefaultPermissionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appPermissionDefaultPermissionKeys.lists() + queryKey: appPermissionDefaultPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionMutation.ts index e75f177f32..0b42bacb2f 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateAppPermissionMutation.ts @@ -4,83 +4,113 @@ * 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 { appPermissionKeys } from "../query-keys"; -import { appPermissionMutationKeys } from "../mutation-keys"; -import type { AppPermissionSelect, AppPermissionWithRelations, AppPermissionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionSelect, AppPermissionWithRelations, AppPermissionPatch } from "../../orm/input-types"; +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 { appPermissionKeys } from '../query-keys'; +import { appPermissionMutationKeys } from '../mutation-keys'; +import type { + AppPermissionSelect, + AppPermissionWithRelations, + AppPermissionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionSelect, + AppPermissionWithRelations, + AppPermissionPatch, +} from '../../orm/input-types'; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppPermissionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appPermissionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppPermissionMutation(params: { - selection: ({ - fields: S & AppPermissionSelect; - } & HookStrictSelect, AppPermissionSelect>); -} & Omit; - }; -}, Error, { - id: string; - appPermissionPatch: AppPermissionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppPermission: { - appPermission: InferSelectResult; - }; -}, Error, { - id: string; - appPermissionPatch: AppPermissionPatch; -}>; -export function useUpdateAppPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppPermissionMutation( + params: { + selection: { + fields: S & AppPermissionSelect; + } & HookStrictSelect, AppPermissionSelect>; + } & Omit< + UseMutationOptions< + { + updateAppPermission: { + appPermission: InferSelectResult; + }; + }, + Error, + { + id: string; + appPermissionPatch: AppPermissionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppPermission: { + appPermission: InferSelectResult; + }; + }, + Error, + { + id: string; + appPermissionPatch: AppPermissionPatch; + } +>; +export function useUpdateAppPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appPermissionPatch: AppPermissionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appPermissionMutationKeys.all, mutationFn: ({ id, - appPermissionPatch + appPermissionPatch, }: { id: string; appPermissionPatch: AppPermissionPatch; - }) => getClient().appPermission.update({ - where: { - id - }, - data: appPermissionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appPermission.update({ + where: { + id, + }, + data: appPermissionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appPermissionKeys.detail(variables.id) + queryKey: appPermissionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appPermissionKeys.lists() + queryKey: appPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateMembershipTypeMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateMembershipTypeMutation.ts index a9d8ff080a..36101d2c0f 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateMembershipTypeMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateMembershipTypeMutation.ts @@ -4,83 +4,113 @@ * 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 { membershipTypeKeys } from "../query-keys"; -import { membershipTypeMutationKeys } from "../mutation-keys"; -import type { MembershipTypeSelect, MembershipTypeWithRelations, MembershipTypePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypeSelect, MembershipTypeWithRelations, MembershipTypePatch } from "../../orm/input-types"; +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 { membershipTypeKeys } from '../query-keys'; +import { membershipTypeMutationKeys } from '../mutation-keys'; +import type { + MembershipTypeSelect, + MembershipTypeWithRelations, + MembershipTypePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipTypeSelect, + MembershipTypeWithRelations, + MembershipTypePatch, +} from '../../orm/input-types'; /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateMembershipTypeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', membershipTypePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateMembershipTypeMutation(params: { - selection: ({ - fields: S & MembershipTypeSelect; - } & HookStrictSelect, MembershipTypeSelect>); -} & Omit; - }; -}, Error, { - id: number; - membershipTypePatch: MembershipTypePatch; -}>, "mutationFn">): UseMutationResult<{ - updateMembershipType: { - membershipType: InferSelectResult; - }; -}, Error, { - id: number; - membershipTypePatch: MembershipTypePatch; -}>; -export function useUpdateMembershipTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateMembershipTypeMutation( + params: { + selection: { + fields: S & MembershipTypeSelect; + } & HookStrictSelect, MembershipTypeSelect>; + } & Omit< + UseMutationOptions< + { + updateMembershipType: { + membershipType: InferSelectResult; + }; + }, + Error, + { + id: number; + membershipTypePatch: MembershipTypePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateMembershipType: { + membershipType: InferSelectResult; + }; + }, + Error, + { + id: number; + membershipTypePatch: MembershipTypePatch; + } +>; +export function useUpdateMembershipTypeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: number; + membershipTypePatch: MembershipTypePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipTypeMutationKeys.all, mutationFn: ({ id, - membershipTypePatch + membershipTypePatch, }: { id: number; membershipTypePatch: MembershipTypePatch; - }) => getClient().membershipType.update({ - where: { - id - }, - data: membershipTypePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .membershipType.update({ + where: { + id, + }, + data: membershipTypePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: membershipTypeKeys.detail(variables.id) + queryKey: membershipTypeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: membershipTypeKeys.lists() + queryKey: membershipTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgAdminGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgAdminGrantMutation.ts index 5313b46622..a33b9997e0 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgAdminGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgAdminGrantMutation.ts @@ -4,83 +4,113 @@ * 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 { orgAdminGrantKeys } from "../query-keys"; -import { orgAdminGrantMutationKeys } from "../mutation-keys"; -import type { OrgAdminGrantSelect, OrgAdminGrantWithRelations, OrgAdminGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgAdminGrantSelect, OrgAdminGrantWithRelations, OrgAdminGrantPatch } from "../../orm/input-types"; +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 { orgAdminGrantKeys } from '../query-keys'; +import { orgAdminGrantMutationKeys } from '../mutation-keys'; +import type { + OrgAdminGrantSelect, + OrgAdminGrantWithRelations, + OrgAdminGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgAdminGrantSelect, + OrgAdminGrantWithRelations, + OrgAdminGrantPatch, +} from '../../orm/input-types'; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgAdminGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgAdminGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgAdminGrantMutation(params: { - selection: ({ - fields: S & OrgAdminGrantSelect; - } & HookStrictSelect, OrgAdminGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgAdminGrantPatch: OrgAdminGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgAdminGrant: { - orgAdminGrant: InferSelectResult; - }; -}, Error, { - id: string; - orgAdminGrantPatch: OrgAdminGrantPatch; -}>; -export function useUpdateOrgAdminGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgAdminGrantMutation( + params: { + selection: { + fields: S & OrgAdminGrantSelect; + } & HookStrictSelect, OrgAdminGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgAdminGrant: { + orgAdminGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + orgAdminGrantPatch: OrgAdminGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgAdminGrant: { + orgAdminGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + orgAdminGrantPatch: OrgAdminGrantPatch; + } +>; +export function useUpdateOrgAdminGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgAdminGrantPatch: OrgAdminGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgAdminGrantMutationKeys.all, mutationFn: ({ id, - orgAdminGrantPatch + orgAdminGrantPatch, }: { id: string; orgAdminGrantPatch: OrgAdminGrantPatch; - }) => getClient().orgAdminGrant.update({ - where: { - id - }, - data: orgAdminGrantPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgAdminGrant.update({ + where: { + id, + }, + data: orgAdminGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgAdminGrantKeys.detail(variables.id) + queryKey: orgAdminGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgAdminGrantKeys.lists() + queryKey: orgAdminGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgClaimedInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgClaimedInviteMutation.ts index cf538ae266..536c3ba76b 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgClaimedInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgClaimedInviteMutation.ts @@ -4,83 +4,113 @@ * 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 { orgClaimedInviteKeys } from "../query-keys"; -import { orgClaimedInviteMutationKeys } from "../mutation-keys"; -import type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations, OrgClaimedInvitePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations, OrgClaimedInvitePatch } from "../../orm/input-types"; +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 { orgClaimedInviteKeys } from '../query-keys'; +import { orgClaimedInviteMutationKeys } from '../mutation-keys'; +import type { + OrgClaimedInviteSelect, + OrgClaimedInviteWithRelations, + OrgClaimedInvitePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgClaimedInviteSelect, + OrgClaimedInviteWithRelations, + OrgClaimedInvitePatch, +} from '../../orm/input-types'; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgClaimedInviteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgClaimedInvitePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgClaimedInviteMutation(params: { - selection: ({ - fields: S & OrgClaimedInviteSelect; - } & HookStrictSelect, OrgClaimedInviteSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgClaimedInvitePatch: OrgClaimedInvitePatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgClaimedInvite: { - orgClaimedInvite: InferSelectResult; - }; -}, Error, { - id: string; - orgClaimedInvitePatch: OrgClaimedInvitePatch; -}>; -export function useUpdateOrgClaimedInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgClaimedInviteMutation( + params: { + selection: { + fields: S & OrgClaimedInviteSelect; + } & HookStrictSelect, OrgClaimedInviteSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgClaimedInvite: { + orgClaimedInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + orgClaimedInvitePatch: OrgClaimedInvitePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgClaimedInvite: { + orgClaimedInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + orgClaimedInvitePatch: OrgClaimedInvitePatch; + } +>; +export function useUpdateOrgClaimedInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgClaimedInvitePatch: OrgClaimedInvitePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgClaimedInviteMutationKeys.all, mutationFn: ({ id, - orgClaimedInvitePatch + orgClaimedInvitePatch, }: { id: string; orgClaimedInvitePatch: OrgClaimedInvitePatch; - }) => getClient().orgClaimedInvite.update({ - where: { - id - }, - data: orgClaimedInvitePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgClaimedInvite.update({ + where: { + id, + }, + data: orgClaimedInvitePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgClaimedInviteKeys.detail(variables.id) + queryKey: orgClaimedInviteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgClaimedInviteKeys.lists() + queryKey: orgClaimedInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgGrantMutation.ts index fbf6b70a4a..50e7255807 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgGrantMutation.ts @@ -4,83 +4,99 @@ * 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 { orgGrantKeys } from "../query-keys"; -import { orgGrantMutationKeys } from "../mutation-keys"; -import type { OrgGrantSelect, OrgGrantWithRelations, OrgGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgGrantSelect, OrgGrantWithRelations, OrgGrantPatch } from "../../orm/input-types"; +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 { orgGrantKeys } from '../query-keys'; +import { orgGrantMutationKeys } from '../mutation-keys'; +import type { OrgGrantSelect, OrgGrantWithRelations, OrgGrantPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgGrantSelect, OrgGrantWithRelations, OrgGrantPatch } from '../../orm/input-types'; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgGrantMutation(params: { - selection: ({ - fields: S & OrgGrantSelect; - } & HookStrictSelect, OrgGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgGrantPatch: OrgGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgGrant: { - orgGrant: InferSelectResult; - }; -}, Error, { - id: string; - orgGrantPatch: OrgGrantPatch; -}>; -export function useUpdateOrgGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgGrantMutation( + params: { + selection: { + fields: S & OrgGrantSelect; + } & HookStrictSelect, OrgGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgGrant: { + orgGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + orgGrantPatch: OrgGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgGrant: { + orgGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + orgGrantPatch: OrgGrantPatch; + } +>; +export function useUpdateOrgGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgGrantPatch: OrgGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgGrantMutationKeys.all, - mutationFn: ({ - id, - orgGrantPatch - }: { - id: string; - orgGrantPatch: OrgGrantPatch; - }) => getClient().orgGrant.update({ - where: { - id - }, - data: orgGrantPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, orgGrantPatch }: { id: string; orgGrantPatch: OrgGrantPatch }) => + getClient() + .orgGrant.update({ + where: { + id, + }, + data: orgGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgGrantKeys.detail(variables.id) + queryKey: orgGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgGrantKeys.lists() + queryKey: orgGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgInviteMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgInviteMutation.ts index 19a0605abf..deae91a03c 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgInviteMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgInviteMutation.ts @@ -4,83 +4,107 @@ * 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 { orgInviteKeys } from "../query-keys"; -import { orgInviteMutationKeys } from "../mutation-keys"; -import type { OrgInviteSelect, OrgInviteWithRelations, OrgInvitePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgInviteSelect, OrgInviteWithRelations, OrgInvitePatch } from "../../orm/input-types"; +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 { orgInviteKeys } from '../query-keys'; +import { orgInviteMutationKeys } from '../mutation-keys'; +import type { + OrgInviteSelect, + OrgInviteWithRelations, + OrgInvitePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgInviteSelect, + OrgInviteWithRelations, + OrgInvitePatch, +} from '../../orm/input-types'; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgInviteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgInvitePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgInviteMutation(params: { - selection: ({ - fields: S & OrgInviteSelect; - } & HookStrictSelect, OrgInviteSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgInvitePatch: OrgInvitePatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgInvite: { - orgInvite: InferSelectResult; - }; -}, Error, { - id: string; - orgInvitePatch: OrgInvitePatch; -}>; -export function useUpdateOrgInviteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgInviteMutation( + params: { + selection: { + fields: S & OrgInviteSelect; + } & HookStrictSelect, OrgInviteSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgInvite: { + orgInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + orgInvitePatch: OrgInvitePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgInvite: { + orgInvite: InferSelectResult; + }; + }, + Error, + { + id: string; + orgInvitePatch: OrgInvitePatch; + } +>; +export function useUpdateOrgInviteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgInvitePatch: OrgInvitePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgInviteMutationKeys.all, - mutationFn: ({ - id, - orgInvitePatch - }: { - id: string; - orgInvitePatch: OrgInvitePatch; - }) => getClient().orgInvite.update({ - where: { - id - }, - data: orgInvitePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, orgInvitePatch }: { id: string; orgInvitePatch: OrgInvitePatch }) => + getClient() + .orgInvite.update({ + where: { + id, + }, + data: orgInvitePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgInviteKeys.detail(variables.id) + queryKey: orgInviteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgInviteKeys.lists() + queryKey: orgInviteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMemberMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMemberMutation.ts index 390400833a..9afc577fbd 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMemberMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMemberMutation.ts @@ -4,83 +4,107 @@ * 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 { orgMemberKeys } from "../query-keys"; -import { orgMemberMutationKeys } from "../mutation-keys"; -import type { OrgMemberSelect, OrgMemberWithRelations, OrgMemberPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberSelect, OrgMemberWithRelations, OrgMemberPatch } from "../../orm/input-types"; +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 { orgMemberKeys } from '../query-keys'; +import { orgMemberMutationKeys } from '../mutation-keys'; +import type { + OrgMemberSelect, + OrgMemberWithRelations, + OrgMemberPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMemberSelect, + OrgMemberWithRelations, + OrgMemberPatch, +} from '../../orm/input-types'; /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgMemberMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgMemberPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgMemberMutation(params: { - selection: ({ - fields: S & OrgMemberSelect; - } & HookStrictSelect, OrgMemberSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgMemberPatch: OrgMemberPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgMember: { - orgMember: InferSelectResult; - }; -}, Error, { - id: string; - orgMemberPatch: OrgMemberPatch; -}>; -export function useUpdateOrgMemberMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgMemberMutation( + params: { + selection: { + fields: S & OrgMemberSelect; + } & HookStrictSelect, OrgMemberSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgMember: { + orgMember: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMemberPatch: OrgMemberPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgMember: { + orgMember: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMemberPatch: OrgMemberPatch; + } +>; +export function useUpdateOrgMemberMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgMemberPatch: OrgMemberPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMemberMutationKeys.all, - mutationFn: ({ - id, - orgMemberPatch - }: { - id: string; - orgMemberPatch: OrgMemberPatch; - }) => getClient().orgMember.update({ - where: { - id - }, - data: orgMemberPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, orgMemberPatch }: { id: string; orgMemberPatch: OrgMemberPatch }) => + getClient() + .orgMember.update({ + where: { + id, + }, + data: orgMemberPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgMemberKeys.detail(variables.id) + queryKey: orgMemberKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMemberKeys.lists() + queryKey: orgMemberKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMemberProfileMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMemberProfileMutation.ts index 43708e1aa7..2dcb8b95c4 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMemberProfileMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMemberProfileMutation.ts @@ -4,83 +4,113 @@ * 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 { orgMemberProfileKeys } from "../query-keys"; -import { orgMemberProfileMutationKeys } from "../mutation-keys"; -import type { OrgMemberProfileSelect, OrgMemberProfileWithRelations, OrgMemberProfilePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberProfileSelect, OrgMemberProfileWithRelations, OrgMemberProfilePatch } from "../../orm/input-types"; +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 { orgMemberProfileKeys } from '../query-keys'; +import { orgMemberProfileMutationKeys } from '../mutation-keys'; +import type { + OrgMemberProfileSelect, + OrgMemberProfileWithRelations, + OrgMemberProfilePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMemberProfileSelect, + OrgMemberProfileWithRelations, + OrgMemberProfilePatch, +} from '../../orm/input-types'; /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgMemberProfileMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgMemberProfilePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgMemberProfileMutation(params: { - selection: ({ - fields: S & OrgMemberProfileSelect; - } & HookStrictSelect, OrgMemberProfileSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgMemberProfilePatch: OrgMemberProfilePatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgMemberProfile: { - orgMemberProfile: InferSelectResult; - }; -}, Error, { - id: string; - orgMemberProfilePatch: OrgMemberProfilePatch; -}>; -export function useUpdateOrgMemberProfileMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgMemberProfileMutation( + params: { + selection: { + fields: S & OrgMemberProfileSelect; + } & HookStrictSelect, OrgMemberProfileSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgMemberProfile: { + orgMemberProfile: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMemberProfilePatch: OrgMemberProfilePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgMemberProfile: { + orgMemberProfile: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMemberProfilePatch: OrgMemberProfilePatch; + } +>; +export function useUpdateOrgMemberProfileMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgMemberProfilePatch: OrgMemberProfilePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMemberProfileMutationKeys.all, mutationFn: ({ id, - orgMemberProfilePatch + orgMemberProfilePatch, }: { id: string; orgMemberProfilePatch: OrgMemberProfilePatch; - }) => getClient().orgMemberProfile.update({ - where: { - id - }, - data: orgMemberProfilePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgMemberProfile.update({ + where: { + id, + }, + data: orgMemberProfilePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgMemberProfileKeys.detail(variables.id) + queryKey: orgMemberProfileKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMemberProfileKeys.lists() + queryKey: orgMemberProfileKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipDefaultMutation.ts index 133c5cc253..4536a0d0fe 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipDefaultMutation.ts @@ -4,83 +4,113 @@ * 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 { orgMembershipDefaultKeys } from "../query-keys"; -import { orgMembershipDefaultMutationKeys } from "../mutation-keys"; -import type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations, OrgMembershipDefaultPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations, OrgMembershipDefaultPatch } from "../../orm/input-types"; +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 { orgMembershipDefaultKeys } from '../query-keys'; +import { orgMembershipDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, + OrgMembershipDefaultPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, + OrgMembershipDefaultPatch, +} from '../../orm/input-types'; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgMembershipDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgMembershipDefaultPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgMembershipDefaultMutation(params: { - selection: ({ - fields: S & OrgMembershipDefaultSelect; - } & HookStrictSelect, OrgMembershipDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgMembershipDefaultPatch: OrgMembershipDefaultPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgMembershipDefault: { - orgMembershipDefault: InferSelectResult; - }; -}, Error, { - id: string; - orgMembershipDefaultPatch: OrgMembershipDefaultPatch; -}>; -export function useUpdateOrgMembershipDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgMembershipDefaultMutation( + params: { + selection: { + fields: S & OrgMembershipDefaultSelect; + } & HookStrictSelect, OrgMembershipDefaultSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgMembershipDefault: { + orgMembershipDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMembershipDefaultPatch: OrgMembershipDefaultPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgMembershipDefault: { + orgMembershipDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMembershipDefaultPatch: OrgMembershipDefaultPatch; + } +>; +export function useUpdateOrgMembershipDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgMembershipDefaultPatch: OrgMembershipDefaultPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipDefaultMutationKeys.all, mutationFn: ({ id, - orgMembershipDefaultPatch + orgMembershipDefaultPatch, }: { id: string; orgMembershipDefaultPatch: OrgMembershipDefaultPatch; - }) => getClient().orgMembershipDefault.update({ - where: { - id - }, - data: orgMembershipDefaultPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgMembershipDefault.update({ + where: { + id, + }, + data: orgMembershipDefaultPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgMembershipDefaultKeys.detail(variables.id) + queryKey: orgMembershipDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMembershipDefaultKeys.lists() + queryKey: orgMembershipDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipMutation.ts index de791b8fe2..af8939d5ed 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipMutation.ts @@ -4,83 +4,113 @@ * 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 { orgMembershipKeys } from "../query-keys"; -import { orgMembershipMutationKeys } from "../mutation-keys"; -import type { OrgMembershipSelect, OrgMembershipWithRelations, OrgMembershipPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSelect, OrgMembershipWithRelations, OrgMembershipPatch } from "../../orm/input-types"; +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 { orgMembershipKeys } from '../query-keys'; +import { orgMembershipMutationKeys } from '../mutation-keys'; +import type { + OrgMembershipSelect, + OrgMembershipWithRelations, + OrgMembershipPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipSelect, + OrgMembershipWithRelations, + OrgMembershipPatch, +} from '../../orm/input-types'; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgMembershipMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgMembershipPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgMembershipMutation(params: { - selection: ({ - fields: S & OrgMembershipSelect; - } & HookStrictSelect, OrgMembershipSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgMembershipPatch: OrgMembershipPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgMembership: { - orgMembership: InferSelectResult; - }; -}, Error, { - id: string; - orgMembershipPatch: OrgMembershipPatch; -}>; -export function useUpdateOrgMembershipMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgMembershipMutation( + params: { + selection: { + fields: S & OrgMembershipSelect; + } & HookStrictSelect, OrgMembershipSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgMembership: { + orgMembership: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMembershipPatch: OrgMembershipPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgMembership: { + orgMembership: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMembershipPatch: OrgMembershipPatch; + } +>; +export function useUpdateOrgMembershipMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgMembershipPatch: OrgMembershipPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipMutationKeys.all, mutationFn: ({ id, - orgMembershipPatch + orgMembershipPatch, }: { id: string; orgMembershipPatch: OrgMembershipPatch; - }) => getClient().orgMembership.update({ - where: { - id - }, - data: orgMembershipPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgMembership.update({ + where: { + id, + }, + data: orgMembershipPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgMembershipKeys.detail(variables.id) + queryKey: orgMembershipKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMembershipKeys.lists() + queryKey: orgMembershipKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipSettingMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipSettingMutation.ts index 469d2def2b..fe9a9555f7 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipSettingMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgMembershipSettingMutation.ts @@ -4,83 +4,113 @@ * 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 { orgMembershipSettingKeys } from "../query-keys"; -import { orgMembershipSettingMutationKeys } from "../mutation-keys"; -import type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations, OrgMembershipSettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations, OrgMembershipSettingPatch } from "../../orm/input-types"; +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 { orgMembershipSettingKeys } from '../query-keys'; +import { orgMembershipSettingMutationKeys } from '../mutation-keys'; +import type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, + OrgMembershipSettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, + OrgMembershipSettingPatch, +} from '../../orm/input-types'; /** * Per-entity settings for the memberships module - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgMembershipSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgMembershipSettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgMembershipSettingMutation(params: { - selection: ({ - fields: S & OrgMembershipSettingSelect; - } & HookStrictSelect, OrgMembershipSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgMembershipSettingPatch: OrgMembershipSettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgMembershipSetting: { - orgMembershipSetting: InferSelectResult; - }; -}, Error, { - id: string; - orgMembershipSettingPatch: OrgMembershipSettingPatch; -}>; -export function useUpdateOrgMembershipSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgMembershipSettingMutation( + params: { + selection: { + fields: S & OrgMembershipSettingSelect; + } & HookStrictSelect, OrgMembershipSettingSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgMembershipSetting: { + orgMembershipSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMembershipSettingPatch: OrgMembershipSettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgMembershipSetting: { + orgMembershipSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + orgMembershipSettingPatch: OrgMembershipSettingPatch; + } +>; +export function useUpdateOrgMembershipSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgMembershipSettingPatch: OrgMembershipSettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgMembershipSettingMutationKeys.all, mutationFn: ({ id, - orgMembershipSettingPatch + orgMembershipSettingPatch, }: { id: string; orgMembershipSettingPatch: OrgMembershipSettingPatch; - }) => getClient().orgMembershipSetting.update({ - where: { - id - }, - data: orgMembershipSettingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgMembershipSetting.update({ + where: { + id, + }, + data: orgMembershipSettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgMembershipSettingKeys.detail(variables.id) + queryKey: orgMembershipSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgMembershipSettingKeys.lists() + queryKey: orgMembershipSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgOwnerGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgOwnerGrantMutation.ts index 8ceff72630..3bd0c3ac24 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgOwnerGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgOwnerGrantMutation.ts @@ -4,83 +4,113 @@ * 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 { orgOwnerGrantKeys } from "../query-keys"; -import { orgOwnerGrantMutationKeys } from "../mutation-keys"; -import type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations, OrgOwnerGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations, OrgOwnerGrantPatch } from "../../orm/input-types"; +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 { orgOwnerGrantKeys } from '../query-keys'; +import { orgOwnerGrantMutationKeys } from '../mutation-keys'; +import type { + OrgOwnerGrantSelect, + OrgOwnerGrantWithRelations, + OrgOwnerGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgOwnerGrantSelect, + OrgOwnerGrantWithRelations, + OrgOwnerGrantPatch, +} from '../../orm/input-types'; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgOwnerGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgOwnerGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgOwnerGrantMutation(params: { - selection: ({ - fields: S & OrgOwnerGrantSelect; - } & HookStrictSelect, OrgOwnerGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgOwnerGrantPatch: OrgOwnerGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgOwnerGrant: { - orgOwnerGrant: InferSelectResult; - }; -}, Error, { - id: string; - orgOwnerGrantPatch: OrgOwnerGrantPatch; -}>; -export function useUpdateOrgOwnerGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgOwnerGrantMutation( + params: { + selection: { + fields: S & OrgOwnerGrantSelect; + } & HookStrictSelect, OrgOwnerGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgOwnerGrant: { + orgOwnerGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + orgOwnerGrantPatch: OrgOwnerGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgOwnerGrant: { + orgOwnerGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + orgOwnerGrantPatch: OrgOwnerGrantPatch; + } +>; +export function useUpdateOrgOwnerGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgOwnerGrantPatch: OrgOwnerGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgOwnerGrantMutationKeys.all, mutationFn: ({ id, - orgOwnerGrantPatch + orgOwnerGrantPatch, }: { id: string; orgOwnerGrantPatch: OrgOwnerGrantPatch; - }) => getClient().orgOwnerGrant.update({ - where: { - id - }, - data: orgOwnerGrantPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgOwnerGrant.update({ + where: { + id, + }, + data: orgOwnerGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgOwnerGrantKeys.detail(variables.id) + queryKey: orgOwnerGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgOwnerGrantKeys.lists() + queryKey: orgOwnerGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultGrantMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultGrantMutation.ts index 2eb052a8a0..1f119f098b 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultGrantMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultGrantMutation.ts @@ -4,83 +4,115 @@ * 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 { orgPermissionDefaultGrantKeys } from "../query-keys"; -import { orgPermissionDefaultGrantMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations, OrgPermissionDefaultGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations, OrgPermissionDefaultGrantPatch } from "../../orm/input-types"; +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 { orgPermissionDefaultGrantKeys } from '../query-keys'; +import { orgPermissionDefaultGrantMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, + OrgPermissionDefaultGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, + OrgPermissionDefaultGrantPatch, +} from '../../orm/input-types'; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgPermissionDefaultGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgPermissionDefaultGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgPermissionDefaultGrantMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultGrantSelect; - } & HookStrictSelect, OrgPermissionDefaultGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgPermissionDefaultGrantPatch: OrgPermissionDefaultGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgPermissionDefaultGrant: { - orgPermissionDefaultGrant: InferSelectResult; - }; -}, Error, { - id: string; - orgPermissionDefaultGrantPatch: OrgPermissionDefaultGrantPatch; -}>; -export function useUpdateOrgPermissionDefaultGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgPermissionDefaultGrantMutation< + S extends OrgPermissionDefaultGrantSelect, +>( + params: { + selection: { + fields: S & OrgPermissionDefaultGrantSelect; + } & HookStrictSelect, OrgPermissionDefaultGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgPermissionDefaultGrant: { + orgPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + orgPermissionDefaultGrantPatch: OrgPermissionDefaultGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgPermissionDefaultGrant: { + orgPermissionDefaultGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + orgPermissionDefaultGrantPatch: OrgPermissionDefaultGrantPatch; + } +>; +export function useUpdateOrgPermissionDefaultGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgPermissionDefaultGrantPatch: OrgPermissionDefaultGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultGrantMutationKeys.all, mutationFn: ({ id, - orgPermissionDefaultGrantPatch + orgPermissionDefaultGrantPatch, }: { id: string; orgPermissionDefaultGrantPatch: OrgPermissionDefaultGrantPatch; - }) => getClient().orgPermissionDefaultGrant.update({ - where: { - id - }, - data: orgPermissionDefaultGrantPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgPermissionDefaultGrant.update({ + where: { + id, + }, + data: orgPermissionDefaultGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultGrantKeys.detail(variables.id) + queryKey: orgPermissionDefaultGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultGrantKeys.lists() + queryKey: orgPermissionDefaultGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultMutation.ts index 4bc67e6c15..b53a85a676 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultMutation.ts @@ -4,83 +4,113 @@ * 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 { orgPermissionDefaultKeys } from "../query-keys"; -import { orgPermissionDefaultMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations, OrgPermissionDefaultPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations, OrgPermissionDefaultPatch } from "../../orm/input-types"; +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 { orgPermissionDefaultKeys } from '../query-keys'; +import { orgPermissionDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, + OrgPermissionDefaultPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, + OrgPermissionDefaultPatch, +} from '../../orm/input-types'; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgPermissionDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgPermissionDefaultPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgPermissionDefaultMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultSelect; - } & HookStrictSelect, OrgPermissionDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgPermissionDefaultPatch: OrgPermissionDefaultPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgPermissionDefault: { - orgPermissionDefault: InferSelectResult; - }; -}, Error, { - id: string; - orgPermissionDefaultPatch: OrgPermissionDefaultPatch; -}>; -export function useUpdateOrgPermissionDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgPermissionDefaultMutation( + params: { + selection: { + fields: S & OrgPermissionDefaultSelect; + } & HookStrictSelect, OrgPermissionDefaultSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgPermissionDefault: { + orgPermissionDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + orgPermissionDefaultPatch: OrgPermissionDefaultPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgPermissionDefault: { + orgPermissionDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + orgPermissionDefaultPatch: OrgPermissionDefaultPatch; + } +>; +export function useUpdateOrgPermissionDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgPermissionDefaultPatch: OrgPermissionDefaultPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultMutationKeys.all, mutationFn: ({ id, - orgPermissionDefaultPatch + orgPermissionDefaultPatch, }: { id: string; orgPermissionDefaultPatch: OrgPermissionDefaultPatch; - }) => getClient().orgPermissionDefault.update({ - where: { - id - }, - data: orgPermissionDefaultPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgPermissionDefault.update({ + where: { + id, + }, + data: orgPermissionDefaultPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultKeys.detail(variables.id) + queryKey: orgPermissionDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultKeys.lists() + queryKey: orgPermissionDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultPermissionMutation.ts index 9e0d41f034..b5cfa27980 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionDefaultPermissionMutation.ts @@ -4,83 +4,121 @@ * 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 { orgPermissionDefaultPermissionKeys } from "../query-keys"; -import { orgPermissionDefaultPermissionMutationKeys } from "../mutation-keys"; -import type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations, OrgPermissionDefaultPermissionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations, OrgPermissionDefaultPermissionPatch } from "../../orm/input-types"; +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 { orgPermissionDefaultPermissionKeys } from '../query-keys'; +import { orgPermissionDefaultPermissionMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, + OrgPermissionDefaultPermissionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, + OrgPermissionDefaultPermissionPatch, +} from '../../orm/input-types'; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgPermissionDefaultPermissionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgPermissionDefaultPermissionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgPermissionDefaultPermissionMutation(params: { - selection: ({ - fields: S & OrgPermissionDefaultPermissionSelect; - } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgPermissionDefaultPermissionPatch: OrgPermissionDefaultPermissionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; - }; -}, Error, { - id: string; - orgPermissionDefaultPermissionPatch: OrgPermissionDefaultPermissionPatch; -}>; -export function useUpdateOrgPermissionDefaultPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgPermissionDefaultPermissionMutation< + S extends OrgPermissionDefaultPermissionSelect, +>( + params: { + selection: { + fields: S & OrgPermissionDefaultPermissionSelect; + } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgPermissionDefaultPermission: { + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + { + id: string; + orgPermissionDefaultPermissionPatch: OrgPermissionDefaultPermissionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgPermissionDefaultPermission: { + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; + }; + }, + Error, + { + id: string; + orgPermissionDefaultPermissionPatch: OrgPermissionDefaultPermissionPatch; + } +>; +export function useUpdateOrgPermissionDefaultPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgPermissionDefaultPermissionPatch: OrgPermissionDefaultPermissionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionDefaultPermissionMutationKeys.all, mutationFn: ({ id, - orgPermissionDefaultPermissionPatch + orgPermissionDefaultPermissionPatch, }: { id: string; orgPermissionDefaultPermissionPatch: OrgPermissionDefaultPermissionPatch; - }) => getClient().orgPermissionDefaultPermission.update({ - where: { - id - }, - data: orgPermissionDefaultPermissionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgPermissionDefaultPermission.update({ + where: { + id, + }, + data: orgPermissionDefaultPermissionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultPermissionKeys.detail(variables.id) + queryKey: orgPermissionDefaultPermissionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgPermissionDefaultPermissionKeys.lists() + queryKey: orgPermissionDefaultPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionMutation.ts b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionMutation.ts index e125d93c02..2704a2545e 100644 --- a/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionMutation.ts +++ b/sdk/constructive-react/src/admin/hooks/mutations/useUpdateOrgPermissionMutation.ts @@ -4,83 +4,113 @@ * 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 { orgPermissionKeys } from "../query-keys"; -import { orgPermissionMutationKeys } from "../mutation-keys"; -import type { OrgPermissionSelect, OrgPermissionWithRelations, OrgPermissionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionSelect, OrgPermissionWithRelations, OrgPermissionPatch } from "../../orm/input-types"; +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 { orgPermissionKeys } from '../query-keys'; +import { orgPermissionMutationKeys } from '../mutation-keys'; +import type { + OrgPermissionSelect, + OrgPermissionWithRelations, + OrgPermissionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionSelect, + OrgPermissionWithRelations, + OrgPermissionPatch, +} from '../../orm/input-types'; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgPermissionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgPermissionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgPermissionMutation(params: { - selection: ({ - fields: S & OrgPermissionSelect; - } & HookStrictSelect, OrgPermissionSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgPermissionPatch: OrgPermissionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgPermission: { - orgPermission: InferSelectResult; - }; -}, Error, { - id: string; - orgPermissionPatch: OrgPermissionPatch; -}>; -export function useUpdateOrgPermissionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgPermissionMutation( + params: { + selection: { + fields: S & OrgPermissionSelect; + } & HookStrictSelect, OrgPermissionSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgPermission: { + orgPermission: InferSelectResult; + }; + }, + Error, + { + id: string; + orgPermissionPatch: OrgPermissionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgPermission: { + orgPermission: InferSelectResult; + }; + }, + Error, + { + id: string; + orgPermissionPatch: OrgPermissionPatch; + } +>; +export function useUpdateOrgPermissionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgPermissionPatch: OrgPermissionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgPermissionMutationKeys.all, mutationFn: ({ id, - orgPermissionPatch + orgPermissionPatch, }: { id: string; orgPermissionPatch: OrgPermissionPatch; - }) => getClient().orgPermission.update({ - where: { - id - }, - data: orgPermissionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgPermission.update({ + where: { + id, + }, + data: orgPermissionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgPermissionKeys.detail(variables.id) + queryKey: orgPermissionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgPermissionKeys.lists() + queryKey: orgPermissionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/index.ts b/sdk/constructive-react/src/admin/hooks/queries/index.ts index 3b3731f4a3..bcdfd42350 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/index.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/index.ts @@ -3,63 +3,63 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useAppAdminGrantsQuery"; -export * from "./useAppAdminGrantQuery"; -export * from "./useAppClaimedInvitesQuery"; -export * from "./useAppClaimedInviteQuery"; -export * from "./useAppGrantsQuery"; -export * from "./useAppGrantQuery"; -export * from "./useAppInvitesQuery"; -export * from "./useAppInviteQuery"; -export * from "./useAppMembershipsQuery"; -export * from "./useAppMembershipQuery"; -export * from "./useAppMembershipDefaultsQuery"; -export * from "./useAppMembershipDefaultQuery"; -export * from "./useAppOwnerGrantsQuery"; -export * from "./useAppOwnerGrantQuery"; -export * from "./useAppPermissionsQuery"; -export * from "./useAppPermissionQuery"; -export * from "./useAppPermissionDefaultsQuery"; -export * from "./useAppPermissionDefaultQuery"; -export * from "./useAppPermissionDefaultGrantsQuery"; -export * from "./useAppPermissionDefaultGrantQuery"; -export * from "./useAppPermissionDefaultPermissionsQuery"; -export * from "./useAppPermissionDefaultPermissionQuery"; -export * from "./useMembershipTypesQuery"; -export * from "./useMembershipTypeQuery"; -export * from "./useOrgAdminGrantsQuery"; -export * from "./useOrgAdminGrantQuery"; -export * from "./useOrgClaimedInvitesQuery"; -export * from "./useOrgClaimedInviteQuery"; -export * from "./useOrgGrantsQuery"; -export * from "./useOrgGrantQuery"; -export * from "./useOrgInvitesQuery"; -export * from "./useOrgInviteQuery"; -export * from "./useOrgMembersQuery"; -export * from "./useOrgMemberQuery"; -export * from "./useOrgMemberProfilesQuery"; -export * from "./useOrgMemberProfileQuery"; -export * from "./useOrgMembershipsQuery"; -export * from "./useOrgMembershipQuery"; -export * from "./useOrgMembershipDefaultsQuery"; -export * from "./useOrgMembershipDefaultQuery"; -export * from "./useOrgMembershipSettingsQuery"; -export * from "./useOrgMembershipSettingQuery"; -export * from "./useOrgOwnerGrantsQuery"; -export * from "./useOrgOwnerGrantQuery"; -export * from "./useOrgPermissionsQuery"; -export * from "./useOrgPermissionQuery"; -export * from "./useOrgPermissionDefaultsQuery"; -export * from "./useOrgPermissionDefaultQuery"; -export * from "./useOrgPermissionDefaultGrantsQuery"; -export * from "./useOrgPermissionDefaultGrantQuery"; -export * from "./useOrgPermissionDefaultPermissionsQuery"; -export * from "./useOrgPermissionDefaultPermissionQuery"; -export * from "./useAppPermissionsGetByMaskQuery"; -export * from "./useAppPermissionsGetMaskQuery"; -export * from "./useAppPermissionsGetMaskByNamesQuery"; -export * from "./useAppPermissionsGetPaddedMaskQuery"; -export * from "./useOrgPermissionsGetByMaskQuery"; -export * from "./useOrgPermissionsGetMaskQuery"; -export * from "./useOrgPermissionsGetMaskByNamesQuery"; -export * from "./useOrgPermissionsGetPaddedMaskQuery"; \ No newline at end of file +export * from './useAppAdminGrantsQuery'; +export * from './useAppAdminGrantQuery'; +export * from './useAppClaimedInvitesQuery'; +export * from './useAppClaimedInviteQuery'; +export * from './useAppGrantsQuery'; +export * from './useAppGrantQuery'; +export * from './useAppInvitesQuery'; +export * from './useAppInviteQuery'; +export * from './useAppMembershipsQuery'; +export * from './useAppMembershipQuery'; +export * from './useAppMembershipDefaultsQuery'; +export * from './useAppMembershipDefaultQuery'; +export * from './useAppOwnerGrantsQuery'; +export * from './useAppOwnerGrantQuery'; +export * from './useAppPermissionsQuery'; +export * from './useAppPermissionQuery'; +export * from './useAppPermissionDefaultsQuery'; +export * from './useAppPermissionDefaultQuery'; +export * from './useAppPermissionDefaultGrantsQuery'; +export * from './useAppPermissionDefaultGrantQuery'; +export * from './useAppPermissionDefaultPermissionsQuery'; +export * from './useAppPermissionDefaultPermissionQuery'; +export * from './useMembershipTypesQuery'; +export * from './useMembershipTypeQuery'; +export * from './useOrgAdminGrantsQuery'; +export * from './useOrgAdminGrantQuery'; +export * from './useOrgClaimedInvitesQuery'; +export * from './useOrgClaimedInviteQuery'; +export * from './useOrgGrantsQuery'; +export * from './useOrgGrantQuery'; +export * from './useOrgInvitesQuery'; +export * from './useOrgInviteQuery'; +export * from './useOrgMembersQuery'; +export * from './useOrgMemberQuery'; +export * from './useOrgMemberProfilesQuery'; +export * from './useOrgMemberProfileQuery'; +export * from './useOrgMembershipsQuery'; +export * from './useOrgMembershipQuery'; +export * from './useOrgMembershipDefaultsQuery'; +export * from './useOrgMembershipDefaultQuery'; +export * from './useOrgMembershipSettingsQuery'; +export * from './useOrgMembershipSettingQuery'; +export * from './useOrgOwnerGrantsQuery'; +export * from './useOrgOwnerGrantQuery'; +export * from './useOrgPermissionsQuery'; +export * from './useOrgPermissionQuery'; +export * from './useOrgPermissionDefaultsQuery'; +export * from './useOrgPermissionDefaultQuery'; +export * from './useOrgPermissionDefaultGrantsQuery'; +export * from './useOrgPermissionDefaultGrantQuery'; +export * from './useOrgPermissionDefaultPermissionsQuery'; +export * from './useOrgPermissionDefaultPermissionQuery'; +export * from './useAppPermissionsGetByMaskQuery'; +export * from './useAppPermissionsGetMaskQuery'; +export * from './useAppPermissionsGetMaskByNamesQuery'; +export * from './useAppPermissionsGetPaddedMaskQuery'; +export * from './useOrgPermissionsGetByMaskQuery'; +export * from './useOrgPermissionsGetMaskQuery'; +export * from './useOrgPermissionsGetMaskByNamesQuery'; +export * from './useOrgPermissionsGetPaddedMaskQuery'; diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppAdminGrantQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppAdminGrantQuery.ts index c8289aced8..8cf929a7e4 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppAdminGrantQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppAdminGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { appAdminGrantKeys } from "../query-keys"; -import type { AppAdminGrantSelect, AppAdminGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppAdminGrantSelect, AppAdminGrantWithRelations } from "../../orm/input-types"; +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 { appAdminGrantKeys } from '../query-keys'; +import type { AppAdminGrantSelect, AppAdminGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppAdminGrantSelect, AppAdminGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appAdminGrantQueryKey = appAdminGrantKeys.detail; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { data, isLoading } = useAppAdminGrantQuery({ @@ -26,38 +26,52 @@ export const appAdminGrantQueryKey = appAdminGrantKeys.detail; * }); * ``` */ -export function useAppAdminGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppAdminGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppAdminGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppAdminGrantQuery< + S extends AppAdminGrantSelect, + TData = { + appAdminGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppAdminGrantSelect>; + } & Omit< + UseQueryOptions< + { + appAdminGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppAdminGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appAdminGrantKeys.detail(params.id), - queryFn: () => getClient().appAdminGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appAdminGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Records of admin role grants and revocations between members - * + * * @example * ```ts * const data = await fetchAppAdminGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchAppAdminGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appAdminGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appAdminGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Records of admin role grants and revocations between members - * + * * @example * ```ts * await prefetchAppAdminGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppAdminGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppAdminGrantSelect>; -}): Promise; -export async function prefetchAppAdminGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppAdminGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppAdminGrantSelect>; + } +): Promise; +export async function prefetchAppAdminGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appAdminGrantKeys.detail(params.id), - queryFn: () => getClient().appAdminGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appAdminGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppAdminGrantsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppAdminGrantsQuery.ts index 76f751e909..c41e3bfcf3 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppAdminGrantsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppAdminGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { appAdminGrantKeys } from "../query-keys"; -import type { AppAdminGrantSelect, AppAdminGrantWithRelations, AppAdminGrantFilter, AppAdminGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppAdminGrantSelect, AppAdminGrantWithRelations, AppAdminGrantFilter, AppAdminGrantOrderBy } from "../../orm/input-types"; +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 { appAdminGrantKeys } from '../query-keys'; +import type { + AppAdminGrantSelect, + AppAdminGrantWithRelations, + AppAdminGrantFilter, + AppAdminGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppAdminGrantSelect, + AppAdminGrantWithRelations, + AppAdminGrantFilter, + AppAdminGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appAdminGrantsQueryKey = appAdminGrantKeys.list; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { data, isLoading } = useAppAdminGrantsQuery({ @@ -30,33 +45,49 @@ export const appAdminGrantsQueryKey = appAdminGrantKeys.list; * }); * ``` */ -export function useAppAdminGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppAdminGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppAdminGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppAdminGrantsQuery< + S extends AppAdminGrantSelect, + TData = { + appAdminGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppAdminGrantSelect>; + } & Omit< + UseQueryOptions< + { + appAdminGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppAdminGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppAdminGrantSelect, + AppAdminGrantFilter, + AppAdminGrantOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appAdminGrantKeys.list(args), queryFn: () => getClient().appAdminGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Records of admin role grants and revocations between members - * + * * @example * ```ts * const data = await fetchAppAdminGrantsQuery({ @@ -70,35 +101,51 @@ export function useAppAdminGrantsQuery(params: { export async function fetchAppAdminGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppAdminGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppAdminGrantSelect>; }): Promise<{ appAdminGrants: ConnectionResult>; }>; export async function fetchAppAdminGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppAdminGrantSelect, + AppAdminGrantFilter, + AppAdminGrantOrderBy + >(params.selection); return getClient().appAdminGrant.findMany(args).unwrap(); } /** * Records of admin role grants and revocations between members - * + * * @example * ```ts * await prefetchAppAdminGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppAdminGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppAdminGrantSelect>; -}): Promise; -export async function prefetchAppAdminGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppAdminGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppAdminGrantSelect>; + } +): Promise; +export async function prefetchAppAdminGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + AppAdminGrantSelect, + AppAdminGrantFilter, + AppAdminGrantOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appAdminGrantKeys.list(args), - queryFn: () => getClient().appAdminGrant.findMany(args).unwrap() + queryFn: () => getClient().appAdminGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppClaimedInviteQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppClaimedInviteQuery.ts index c78a0b72bd..51d1c60d25 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppClaimedInviteQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppClaimedInviteQuery.ts @@ -4,20 +4,20 @@ * 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 { appClaimedInviteKeys } from "../query-keys"; -import type { AppClaimedInviteSelect, AppClaimedInviteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppClaimedInviteSelect, AppClaimedInviteWithRelations } from "../../orm/input-types"; +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 { appClaimedInviteKeys } from '../query-keys'; +import type { AppClaimedInviteSelect, AppClaimedInviteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppClaimedInviteSelect, AppClaimedInviteWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appClaimedInviteQueryKey = appClaimedInviteKeys.detail; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { data, isLoading } = useAppClaimedInviteQuery({ @@ -26,38 +26,52 @@ export const appClaimedInviteQueryKey = appClaimedInviteKeys.detail; * }); * ``` */ -export function useAppClaimedInviteQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppClaimedInviteSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppClaimedInviteQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppClaimedInviteQuery< + S extends AppClaimedInviteSelect, + TData = { + appClaimedInvite: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppClaimedInviteSelect>; + } & Omit< + UseQueryOptions< + { + appClaimedInvite: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppClaimedInviteQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appClaimedInviteKeys.detail(params.id), - queryFn: () => getClient().appClaimedInvite.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appClaimedInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```ts * const data = await fetchAppClaimedInviteQuery({ @@ -79,35 +93,46 @@ export async function fetchAppClaimedInviteQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appClaimedInvite.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appClaimedInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```ts * await prefetchAppClaimedInviteQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppClaimedInviteQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppClaimedInviteSelect>; -}): Promise; -export async function prefetchAppClaimedInviteQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppClaimedInviteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppClaimedInviteSelect>; + } +): Promise; +export async function prefetchAppClaimedInviteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appClaimedInviteKeys.detail(params.id), - queryFn: () => getClient().appClaimedInvite.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appClaimedInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppClaimedInvitesQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppClaimedInvitesQuery.ts index 01ed6a559e..678a0cd405 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppClaimedInvitesQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppClaimedInvitesQuery.ts @@ -4,20 +4,35 @@ * 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 { appClaimedInviteKeys } from "../query-keys"; -import type { AppClaimedInviteSelect, AppClaimedInviteWithRelations, AppClaimedInviteFilter, AppClaimedInviteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppClaimedInviteSelect, AppClaimedInviteWithRelations, AppClaimedInviteFilter, AppClaimedInviteOrderBy } from "../../orm/input-types"; +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 { appClaimedInviteKeys } from '../query-keys'; +import type { + AppClaimedInviteSelect, + AppClaimedInviteWithRelations, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppClaimedInviteSelect, + AppClaimedInviteWithRelations, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appClaimedInvitesQueryKey = appClaimedInviteKeys.list; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { data, isLoading } = useAppClaimedInvitesQuery({ @@ -30,33 +45,53 @@ export const appClaimedInvitesQueryKey = appClaimedInviteKeys.list; * }); * ``` */ -export function useAppClaimedInvitesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppClaimedInviteSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppClaimedInvitesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppClaimedInvitesQuery< + S extends AppClaimedInviteSelect, + TData = { + appClaimedInvites: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppClaimedInviteSelect>; + } & Omit< + UseQueryOptions< + { + appClaimedInvites: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppClaimedInvitesQuery( + params: { + selection: ListSelectionConfig< + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appClaimedInviteKeys.list(args), queryFn: () => getClient().appClaimedInvite.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```ts * const data = await fetchAppClaimedInvitesQuery({ @@ -70,35 +105,59 @@ export function useAppClaimedInvitesQuery(params: { export async function fetchAppClaimedInvitesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppClaimedInviteSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppClaimedInviteSelect>; }): Promise<{ appClaimedInvites: ConnectionResult>; }>; export async function fetchAppClaimedInvitesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy + >(params.selection); return getClient().appClaimedInvite.findMany(args).unwrap(); } /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```ts * await prefetchAppClaimedInvitesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppClaimedInvitesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppClaimedInviteSelect>; -}): Promise; -export async function prefetchAppClaimedInvitesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppClaimedInvitesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppClaimedInviteSelect>; + } +): Promise; +export async function prefetchAppClaimedInvitesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appClaimedInviteKeys.list(args), - queryFn: () => getClient().appClaimedInvite.findMany(args).unwrap() + queryFn: () => getClient().appClaimedInvite.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppGrantQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppGrantQuery.ts index f3f512eb61..a7a5d3304b 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppGrantQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { appGrantKeys } from "../query-keys"; -import type { AppGrantSelect, AppGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppGrantSelect, AppGrantWithRelations } from "../../orm/input-types"; +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 { appGrantKeys } from '../query-keys'; +import type { AppGrantSelect, AppGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppGrantSelect, AppGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appGrantQueryKey = appGrantKeys.detail; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { data, isLoading } = useAppGrantQuery({ @@ -26,38 +26,52 @@ export const appGrantQueryKey = appGrantKeys.detail; * }); * ``` */ -export function useAppGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppGrantQuery< + S extends AppGrantSelect, + TData = { + appGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppGrantSelect>; + } & Omit< + UseQueryOptions< + { + appGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appGrantKeys.detail(params.id), - queryFn: () => getClient().appGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```ts * const data = await fetchAppGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchAppGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```ts * await prefetchAppGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppGrantSelect>; -}): Promise; -export async function prefetchAppGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppGrantSelect>; + } +): Promise; +export async function prefetchAppGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appGrantKeys.detail(params.id), - queryFn: () => getClient().appGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppGrantsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppGrantsQuery.ts index 287cf9ce70..de0684b897 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppGrantsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { appGrantKeys } from "../query-keys"; -import type { AppGrantSelect, AppGrantWithRelations, AppGrantFilter, AppGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppGrantSelect, AppGrantWithRelations, AppGrantFilter, AppGrantOrderBy } from "../../orm/input-types"; +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 { appGrantKeys } from '../query-keys'; +import type { + AppGrantSelect, + AppGrantWithRelations, + AppGrantFilter, + AppGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppGrantSelect, + AppGrantWithRelations, + AppGrantFilter, + AppGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appGrantsQueryKey = appGrantKeys.list; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { data, isLoading } = useAppGrantsQuery({ @@ -30,33 +45,47 @@ export const appGrantsQueryKey = appGrantKeys.list; * }); * ``` */ -export function useAppGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppGrantsQuery< + S extends AppGrantSelect, + TData = { + appGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppGrantSelect>; + } & Omit< + UseQueryOptions< + { + appGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appGrantKeys.list(args), queryFn: () => getClient().appGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```ts * const data = await fetchAppGrantsQuery({ @@ -70,35 +99,47 @@ export function useAppGrantsQuery(params: { export async function fetchAppGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppGrantSelect>; }): Promise<{ appGrants: ConnectionResult>; }>; export async function fetchAppGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().appGrant.findMany(args).unwrap(); } /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```ts * await prefetchAppGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppGrantSelect>; -}): Promise; -export async function prefetchAppGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppGrantSelect>; + } +): Promise; +export async function prefetchAppGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: appGrantKeys.list(args), - queryFn: () => getClient().appGrant.findMany(args).unwrap() + queryFn: () => getClient().appGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppInviteQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppInviteQuery.ts index 8c0419a790..3a9293c3ef 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppInviteQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppInviteQuery.ts @@ -4,20 +4,20 @@ * 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 { appInviteKeys } from "../query-keys"; -import type { AppInviteSelect, AppInviteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppInviteSelect, AppInviteWithRelations } from "../../orm/input-types"; +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 { appInviteKeys } from '../query-keys'; +import type { AppInviteSelect, AppInviteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppInviteSelect, AppInviteWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appInviteQueryKey = appInviteKeys.detail; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { data, isLoading } = useAppInviteQuery({ @@ -26,38 +26,52 @@ export const appInviteQueryKey = appInviteKeys.detail; * }); * ``` */ -export function useAppInviteQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppInviteSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppInviteQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppInviteQuery< + S extends AppInviteSelect, + TData = { + appInvite: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppInviteSelect>; + } & Omit< + UseQueryOptions< + { + appInvite: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppInviteQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appInviteKeys.detail(params.id), - queryFn: () => getClient().appInvite.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```ts * const data = await fetchAppInviteQuery({ @@ -79,35 +93,46 @@ export async function fetchAppInviteQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appInvite.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```ts * await prefetchAppInviteQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppInviteQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppInviteSelect>; -}): Promise; -export async function prefetchAppInviteQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppInviteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppInviteSelect>; + } +): Promise; +export async function prefetchAppInviteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appInviteKeys.detail(params.id), - queryFn: () => getClient().appInvite.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppInvitesQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppInvitesQuery.ts index 5785deb2fa..a9d519625d 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppInvitesQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppInvitesQuery.ts @@ -4,20 +4,35 @@ * 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 { appInviteKeys } from "../query-keys"; -import type { AppInviteSelect, AppInviteWithRelations, AppInviteFilter, AppInviteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppInviteSelect, AppInviteWithRelations, AppInviteFilter, AppInviteOrderBy } from "../../orm/input-types"; +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 { appInviteKeys } from '../query-keys'; +import type { + AppInviteSelect, + AppInviteWithRelations, + AppInviteFilter, + AppInviteOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppInviteSelect, + AppInviteWithRelations, + AppInviteFilter, + AppInviteOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appInvitesQueryKey = appInviteKeys.list; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { data, isLoading } = useAppInvitesQuery({ @@ -30,33 +45,47 @@ export const appInvitesQueryKey = appInviteKeys.list; * }); * ``` */ -export function useAppInvitesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppInviteSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppInvitesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppInvitesQuery< + S extends AppInviteSelect, + TData = { + appInvites: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppInviteSelect>; + } & Omit< + UseQueryOptions< + { + appInvites: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppInvitesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appInviteKeys.list(args), queryFn: () => getClient().appInvite.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```ts * const data = await fetchAppInvitesQuery({ @@ -70,35 +99,47 @@ export function useAppInvitesQuery(params: { export async function fetchAppInvitesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppInviteSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppInviteSelect>; }): Promise<{ appInvites: ConnectionResult>; }>; export async function fetchAppInvitesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().appInvite.findMany(args).unwrap(); } /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```ts * await prefetchAppInvitesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppInvitesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppInviteSelect>; -}): Promise; -export async function prefetchAppInvitesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppInvitesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppInviteSelect>; + } +): Promise; +export async function prefetchAppInvitesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: appInviteKeys.list(args), - queryFn: () => getClient().appInvite.findMany(args).unwrap() + queryFn: () => getClient().appInvite.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipDefaultQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipDefaultQuery.ts index cf35d384a9..85b8b0dcb4 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipDefaultQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipDefaultQuery.ts @@ -4,20 +4,26 @@ * 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 { appMembershipDefaultKeys } from "../query-keys"; -import type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations } from "../../orm/input-types"; +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 { appMembershipDefaultKeys } from '../query-keys'; +import type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appMembershipDefaultQueryKey = appMembershipDefaultKeys.detail; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { data, isLoading } = useAppMembershipDefaultQuery({ @@ -26,38 +32,52 @@ export const appMembershipDefaultQueryKey = appMembershipDefaultKeys.detail; * }); * ``` */ -export function useAppMembershipDefaultQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppMembershipDefaultSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppMembershipDefaultQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppMembershipDefaultQuery< + S extends AppMembershipDefaultSelect, + TData = { + appMembershipDefault: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppMembershipDefaultSelect>; + } & Omit< + UseQueryOptions< + { + appMembershipDefault: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppMembershipDefaultQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appMembershipDefaultKeys.detail(params.id), - queryFn: () => getClient().appMembershipDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appMembershipDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```ts * const data = await fetchAppMembershipDefaultQuery({ @@ -79,35 +99,46 @@ export async function fetchAppMembershipDefaultQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appMembershipDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appMembershipDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```ts * await prefetchAppMembershipDefaultQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppMembershipDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppMembershipDefaultSelect>; -}): Promise; -export async function prefetchAppMembershipDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppMembershipDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppMembershipDefaultSelect>; + } +): Promise; +export async function prefetchAppMembershipDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appMembershipDefaultKeys.detail(params.id), - queryFn: () => getClient().appMembershipDefault.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appMembershipDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipDefaultsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipDefaultsQuery.ts index fb1a966d4c..a3722e7981 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipDefaultsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipDefaultsQuery.ts @@ -4,20 +4,35 @@ * 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 { appMembershipDefaultKeys } from "../query-keys"; -import type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations, AppMembershipDefaultFilter, AppMembershipDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipDefaultSelect, AppMembershipDefaultWithRelations, AppMembershipDefaultFilter, AppMembershipDefaultOrderBy } from "../../orm/input-types"; +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 { appMembershipDefaultKeys } from '../query-keys'; +import type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppMembershipDefaultSelect, + AppMembershipDefaultWithRelations, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appMembershipDefaultsQueryKey = appMembershipDefaultKeys.list; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { data, isLoading } = useAppMembershipDefaultsQuery({ @@ -30,33 +45,60 @@ export const appMembershipDefaultsQueryKey = appMembershipDefaultKeys.list; * }); * ``` */ -export function useAppMembershipDefaultsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppMembershipDefaultSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppMembershipDefaultsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppMembershipDefaultsQuery< + S extends AppMembershipDefaultSelect, + TData = { + appMembershipDefaults: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppMembershipDefaultSelect>; + } & Omit< + UseQueryOptions< + { + appMembershipDefaults: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppMembershipDefaultsQuery( + params: { + selection: ListSelectionConfig< + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appMembershipDefaultKeys.list(args), queryFn: () => getClient().appMembershipDefault.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```ts * const data = await fetchAppMembershipDefaultsQuery({ @@ -67,38 +109,70 @@ export function useAppMembershipDefaultsQuery(params: { * }); * ``` */ -export async function fetchAppMembershipDefaultsQuery(params: { +export async function fetchAppMembershipDefaultsQuery< + S extends AppMembershipDefaultSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppMembershipDefaultSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppMembershipDefaultSelect>; }): Promise<{ appMembershipDefaults: ConnectionResult>; }>; export async function fetchAppMembershipDefaultsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy + >(params.selection); return getClient().appMembershipDefault.findMany(args).unwrap(); } /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```ts * await prefetchAppMembershipDefaultsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppMembershipDefaultsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppMembershipDefaultSelect>; -}): Promise; -export async function prefetchAppMembershipDefaultsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppMembershipDefaultsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppMembershipDefaultSelect>; + } +): Promise; +export async function prefetchAppMembershipDefaultsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appMembershipDefaultKeys.list(args), - queryFn: () => getClient().appMembershipDefault.findMany(args).unwrap() + queryFn: () => getClient().appMembershipDefault.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipQuery.ts index a4c6de1743..53a941d1a3 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipQuery.ts @@ -4,20 +4,20 @@ * 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 { appMembershipKeys } from "../query-keys"; -import type { AppMembershipSelect, AppMembershipWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipSelect, AppMembershipWithRelations } from "../../orm/input-types"; +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 { appMembershipKeys } from '../query-keys'; +import type { AppMembershipSelect, AppMembershipWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppMembershipSelect, AppMembershipWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appMembershipQueryKey = appMembershipKeys.detail; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { data, isLoading } = useAppMembershipQuery({ @@ -26,38 +26,52 @@ export const appMembershipQueryKey = appMembershipKeys.detail; * }); * ``` */ -export function useAppMembershipQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppMembershipSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppMembershipQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppMembershipQuery< + S extends AppMembershipSelect, + TData = { + appMembership: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppMembershipSelect>; + } & Omit< + UseQueryOptions< + { + appMembership: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppMembershipQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appMembershipKeys.detail(params.id), - queryFn: () => getClient().appMembership.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appMembership.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```ts * const data = await fetchAppMembershipQuery({ @@ -79,35 +93,46 @@ export async function fetchAppMembershipQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appMembership.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appMembership.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```ts * await prefetchAppMembershipQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppMembershipQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppMembershipSelect>; -}): Promise; -export async function prefetchAppMembershipQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppMembershipQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppMembershipSelect>; + } +): Promise; +export async function prefetchAppMembershipQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appMembershipKeys.detail(params.id), - queryFn: () => getClient().appMembership.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appMembership.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipsQuery.ts index 1f3ff63298..4a7406a964 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppMembershipsQuery.ts @@ -4,20 +4,35 @@ * 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 { appMembershipKeys } from "../query-keys"; -import type { AppMembershipSelect, AppMembershipWithRelations, AppMembershipFilter, AppMembershipOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppMembershipSelect, AppMembershipWithRelations, AppMembershipFilter, AppMembershipOrderBy } from "../../orm/input-types"; +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 { appMembershipKeys } from '../query-keys'; +import type { + AppMembershipSelect, + AppMembershipWithRelations, + AppMembershipFilter, + AppMembershipOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppMembershipSelect, + AppMembershipWithRelations, + AppMembershipFilter, + AppMembershipOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appMembershipsQueryKey = appMembershipKeys.list; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { data, isLoading } = useAppMembershipsQuery({ @@ -30,33 +45,49 @@ export const appMembershipsQueryKey = appMembershipKeys.list; * }); * ``` */ -export function useAppMembershipsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppMembershipSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppMembershipsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppMembershipsQuery< + S extends AppMembershipSelect, + TData = { + appMemberships: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppMembershipSelect>; + } & Omit< + UseQueryOptions< + { + appMemberships: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppMembershipsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppMembershipSelect, + AppMembershipFilter, + AppMembershipOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appMembershipKeys.list(args), queryFn: () => getClient().appMembership.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```ts * const data = await fetchAppMembershipsQuery({ @@ -70,35 +101,51 @@ export function useAppMembershipsQuery(params: { export async function fetchAppMembershipsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppMembershipSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppMembershipSelect>; }): Promise<{ appMemberships: ConnectionResult>; }>; export async function fetchAppMembershipsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppMembershipSelect, + AppMembershipFilter, + AppMembershipOrderBy + >(params.selection); return getClient().appMembership.findMany(args).unwrap(); } /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```ts * await prefetchAppMembershipsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppMembershipsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppMembershipSelect>; -}): Promise; -export async function prefetchAppMembershipsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppMembershipsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppMembershipSelect>; + } +): Promise; +export async function prefetchAppMembershipsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + AppMembershipSelect, + AppMembershipFilter, + AppMembershipOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appMembershipKeys.list(args), - queryFn: () => getClient().appMembership.findMany(args).unwrap() + queryFn: () => getClient().appMembership.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppOwnerGrantQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppOwnerGrantQuery.ts index d7608d6cde..a26148bcab 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppOwnerGrantQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppOwnerGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { appOwnerGrantKeys } from "../query-keys"; -import type { AppOwnerGrantSelect, AppOwnerGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppOwnerGrantSelect, AppOwnerGrantWithRelations } from "../../orm/input-types"; +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 { appOwnerGrantKeys } from '../query-keys'; +import type { AppOwnerGrantSelect, AppOwnerGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppOwnerGrantSelect, AppOwnerGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appOwnerGrantQueryKey = appOwnerGrantKeys.detail; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { data, isLoading } = useAppOwnerGrantQuery({ @@ -26,38 +26,52 @@ export const appOwnerGrantQueryKey = appOwnerGrantKeys.detail; * }); * ``` */ -export function useAppOwnerGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppOwnerGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppOwnerGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppOwnerGrantQuery< + S extends AppOwnerGrantSelect, + TData = { + appOwnerGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppOwnerGrantSelect>; + } & Omit< + UseQueryOptions< + { + appOwnerGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppOwnerGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appOwnerGrantKeys.detail(params.id), - queryFn: () => getClient().appOwnerGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appOwnerGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Records of ownership transfers and grants between members - * + * * @example * ```ts * const data = await fetchAppOwnerGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchAppOwnerGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appOwnerGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appOwnerGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Records of ownership transfers and grants between members - * + * * @example * ```ts * await prefetchAppOwnerGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppOwnerGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppOwnerGrantSelect>; -}): Promise; -export async function prefetchAppOwnerGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppOwnerGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppOwnerGrantSelect>; + } +): Promise; +export async function prefetchAppOwnerGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appOwnerGrantKeys.detail(params.id), - queryFn: () => getClient().appOwnerGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appOwnerGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppOwnerGrantsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppOwnerGrantsQuery.ts index 5178778898..3cd73b539f 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppOwnerGrantsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppOwnerGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { appOwnerGrantKeys } from "../query-keys"; -import type { AppOwnerGrantSelect, AppOwnerGrantWithRelations, AppOwnerGrantFilter, AppOwnerGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppOwnerGrantSelect, AppOwnerGrantWithRelations, AppOwnerGrantFilter, AppOwnerGrantOrderBy } from "../../orm/input-types"; +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 { appOwnerGrantKeys } from '../query-keys'; +import type { + AppOwnerGrantSelect, + AppOwnerGrantWithRelations, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppOwnerGrantSelect, + AppOwnerGrantWithRelations, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appOwnerGrantsQueryKey = appOwnerGrantKeys.list; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { data, isLoading } = useAppOwnerGrantsQuery({ @@ -30,33 +45,49 @@ export const appOwnerGrantsQueryKey = appOwnerGrantKeys.list; * }); * ``` */ -export function useAppOwnerGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppOwnerGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppOwnerGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppOwnerGrantsQuery< + S extends AppOwnerGrantSelect, + TData = { + appOwnerGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppOwnerGrantSelect>; + } & Omit< + UseQueryOptions< + { + appOwnerGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppOwnerGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppOwnerGrantSelect, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appOwnerGrantKeys.list(args), queryFn: () => getClient().appOwnerGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Records of ownership transfers and grants between members - * + * * @example * ```ts * const data = await fetchAppOwnerGrantsQuery({ @@ -70,35 +101,51 @@ export function useAppOwnerGrantsQuery(params: { export async function fetchAppOwnerGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppOwnerGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppOwnerGrantSelect>; }): Promise<{ appOwnerGrants: ConnectionResult>; }>; export async function fetchAppOwnerGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppOwnerGrantSelect, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy + >(params.selection); return getClient().appOwnerGrant.findMany(args).unwrap(); } /** * Records of ownership transfers and grants between members - * + * * @example * ```ts * await prefetchAppOwnerGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppOwnerGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppOwnerGrantSelect>; -}): Promise; -export async function prefetchAppOwnerGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppOwnerGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppOwnerGrantSelect>; + } +): Promise; +export async function prefetchAppOwnerGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + AppOwnerGrantSelect, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appOwnerGrantKeys.list(args), - queryFn: () => getClient().appOwnerGrant.findMany(args).unwrap() + queryFn: () => getClient().appOwnerGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultGrantQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultGrantQuery.ts index b97106e368..1d596eba6e 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultGrantQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultGrantQuery.ts @@ -4,20 +4,26 @@ * 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 { appPermissionDefaultGrantKeys } from "../query-keys"; -import type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations } from "../../orm/input-types"; +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 { appPermissionDefaultGrantKeys } from '../query-keys'; +import type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionDefaultGrantQueryKey = appPermissionDefaultGrantKeys.detail; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionDefaultGrantQuery({ @@ -26,38 +32,55 @@ export const appPermissionDefaultGrantQueryKey = appPermissionDefaultGrantKeys.d * }); * ``` */ -export function useAppPermissionDefaultGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppPermissionDefaultGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionDefaultGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppPermissionDefaultGrantQuery< + S extends AppPermissionDefaultGrantSelect, + TData = { + appPermissionDefaultGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppPermissionDefaultGrantSelect>; + } & Omit< + UseQueryOptions< + { + appPermissionDefaultGrant: InferSelectResult< + AppPermissionDefaultGrantWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionDefaultGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appPermissionDefaultGrantKeys.detail(params.id), - queryFn: () => getClient().appPermissionDefaultGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appPermissionDefaultGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```ts * const data = await fetchAppPermissionDefaultGrantQuery({ @@ -66,7 +89,9 @@ export function useAppPermissionDefaultGrantQuery(params: { * }); * ``` */ -export async function fetchAppPermissionDefaultGrantQuery(params: { +export async function fetchAppPermissionDefaultGrantQuery< + S extends AppPermissionDefaultGrantSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +104,48 @@ export async function fetchAppPermissionDefaultGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appPermissionDefaultGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appPermissionDefaultGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```ts * await prefetchAppPermissionDefaultGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppPermissionDefaultGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppPermissionDefaultGrantSelect>; -}): Promise; -export async function prefetchAppPermissionDefaultGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppPermissionDefaultGrantQuery< + S extends AppPermissionDefaultGrantSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppPermissionDefaultGrantSelect>; + } +): Promise; +export async function prefetchAppPermissionDefaultGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appPermissionDefaultGrantKeys.detail(params.id), - queryFn: () => getClient().appPermissionDefaultGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appPermissionDefaultGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultGrantsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultGrantsQuery.ts index 930a920940..eeae2ad10f 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultGrantsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { appPermissionDefaultGrantKeys } from "../query-keys"; -import type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations, AppPermissionDefaultGrantFilter, AppPermissionDefaultGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantWithRelations, AppPermissionDefaultGrantFilter, AppPermissionDefaultGrantOrderBy } from "../../orm/input-types"; +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 { appPermissionDefaultGrantKeys } from '../query-keys'; +import type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantWithRelations, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionDefaultGrantsQueryKey = appPermissionDefaultGrantKeys.list; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionDefaultGrantsQuery({ @@ -30,33 +45,60 @@ export const appPermissionDefaultGrantsQueryKey = appPermissionDefaultGrantKeys. * }); * ``` */ -export function useAppPermissionDefaultGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionDefaultGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppPermissionDefaultGrantsQuery< + S extends AppPermissionDefaultGrantSelect, + TData = { + appPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultGrantSelect>; + } & Omit< + UseQueryOptions< + { + appPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionDefaultGrantsQuery( + params: { + selection: ListSelectionConfig< + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appPermissionDefaultGrantKeys.list(args), queryFn: () => getClient().appPermissionDefaultGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```ts * const data = await fetchAppPermissionDefaultGrantsQuery({ @@ -67,38 +109,74 @@ export function useAppPermissionDefaultGrantsQuery(params: { * }); * ``` */ -export async function fetchAppPermissionDefaultGrantsQuery(params: { +export async function fetchAppPermissionDefaultGrantsQuery< + S extends AppPermissionDefaultGrantSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultGrantSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultGrantSelect>; }): Promise<{ - appPermissionDefaultGrants: ConnectionResult>; + appPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; }>; export async function fetchAppPermissionDefaultGrantsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy + >(params.selection); return getClient().appPermissionDefaultGrant.findMany(args).unwrap(); } /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```ts * await prefetchAppPermissionDefaultGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppPermissionDefaultGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultGrantSelect>; -}): Promise; -export async function prefetchAppPermissionDefaultGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppPermissionDefaultGrantsQuery< + S extends AppPermissionDefaultGrantSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultGrantSelect>; + } +): Promise; +export async function prefetchAppPermissionDefaultGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appPermissionDefaultGrantKeys.list(args), - queryFn: () => getClient().appPermissionDefaultGrant.findMany(args).unwrap() + queryFn: () => getClient().appPermissionDefaultGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultPermissionQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultPermissionQuery.ts index beaaea8eb5..06aeafb892 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultPermissionQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultPermissionQuery.ts @@ -4,20 +4,26 @@ * 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 { appPermissionDefaultPermissionKeys } from "../query-keys"; -import type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations } from "../../orm/input-types"; +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 { appPermissionDefaultPermissionKeys } from '../query-keys'; +import type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionDefaultPermissionQueryKey = appPermissionDefaultPermissionKeys.detail; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionDefaultPermissionQuery({ @@ -26,38 +32,58 @@ export const appPermissionDefaultPermissionQueryKey = appPermissionDefaultPermis * }); * ``` */ -export function useAppPermissionDefaultPermissionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppPermissionDefaultPermissionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionDefaultPermissionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppPermissionDefaultPermissionQuery< + S extends AppPermissionDefaultPermissionSelect, + TData = { + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppPermissionDefaultPermissionSelect>; + } & Omit< + UseQueryOptions< + { + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionDefaultPermissionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appPermissionDefaultPermissionKeys.detail(params.id), - queryFn: () => getClient().appPermissionDefaultPermission.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appPermissionDefaultPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```ts * const data = await fetchAppPermissionDefaultPermissionQuery({ @@ -66,48 +92,66 @@ export function useAppPermissionDefaultPermissionQuery(params: { * }); * ``` */ -export async function fetchAppPermissionDefaultPermissionQuery(params: { +export async function fetchAppPermissionDefaultPermissionQuery< + S extends AppPermissionDefaultPermissionSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, AppPermissionDefaultPermissionSelect>; }): Promise<{ - appPermissionDefaultPermission: InferSelectResult | null; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; }>; export async function fetchAppPermissionDefaultPermissionQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appPermissionDefaultPermission.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appPermissionDefaultPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```ts * await prefetchAppPermissionDefaultPermissionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppPermissionDefaultPermissionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppPermissionDefaultPermissionSelect>; -}): Promise; -export async function prefetchAppPermissionDefaultPermissionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppPermissionDefaultPermissionQuery< + S extends AppPermissionDefaultPermissionSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppPermissionDefaultPermissionSelect>; + } +): Promise; +export async function prefetchAppPermissionDefaultPermissionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appPermissionDefaultPermissionKeys.detail(params.id), - queryFn: () => getClient().appPermissionDefaultPermission.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appPermissionDefaultPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultPermissionsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultPermissionsQuery.ts index 2b39887492..c83281765a 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultPermissionsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultPermissionsQuery.ts @@ -4,20 +4,35 @@ * 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 { appPermissionDefaultPermissionKeys } from "../query-keys"; -import type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations, AppPermissionDefaultPermissionFilter, AppPermissionDefaultPermissionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionWithRelations, AppPermissionDefaultPermissionFilter, AppPermissionDefaultPermissionOrderBy } from "../../orm/input-types"; +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 { appPermissionDefaultPermissionKeys } from '../query-keys'; +import type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionWithRelations, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionDefaultPermissionsQueryKey = appPermissionDefaultPermissionKeys.list; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionDefaultPermissionsQuery({ @@ -30,33 +45,64 @@ export const appPermissionDefaultPermissionsQueryKey = appPermissionDefaultPermi * }); * ``` */ -export function useAppPermissionDefaultPermissionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultPermissionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionDefaultPermissionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppPermissionDefaultPermissionsQuery< + S extends AppPermissionDefaultPermissionSelect, + TData = { + appPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultPermissionSelect>; + } & Omit< + UseQueryOptions< + { + appPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionDefaultPermissionsQuery( + params: { + selection: ListSelectionConfig< + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appPermissionDefaultPermissionKeys.list(args), queryFn: () => getClient().appPermissionDefaultPermission.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```ts * const data = await fetchAppPermissionDefaultPermissionsQuery({ @@ -67,38 +113,82 @@ export function useAppPermissionDefaultPermissionsQuery(params: { * }); * ``` */ -export async function fetchAppPermissionDefaultPermissionsQuery(params: { +export async function fetchAppPermissionDefaultPermissionsQuery< + S extends AppPermissionDefaultPermissionSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultPermissionSelect>; + } & Omit< + ListSelectionConfig< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultPermissionSelect>; }): Promise<{ - appPermissionDefaultPermissions: ConnectionResult>; + appPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; }>; export async function fetchAppPermissionDefaultPermissionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >(params.selection); return getClient().appPermissionDefaultPermission.findMany(args).unwrap(); } /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```ts * await prefetchAppPermissionDefaultPermissionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppPermissionDefaultPermissionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultPermissionSelect>; -}): Promise; -export async function prefetchAppPermissionDefaultPermissionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppPermissionDefaultPermissionsQuery< + S extends AppPermissionDefaultPermissionSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultPermissionSelect>; + } +): Promise; +export async function prefetchAppPermissionDefaultPermissionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appPermissionDefaultPermissionKeys.list(args), - queryFn: () => getClient().appPermissionDefaultPermission.findMany(args).unwrap() + queryFn: () => getClient().appPermissionDefaultPermission.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultQuery.ts index f21059f19b..d7c76c2a3a 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultQuery.ts @@ -4,20 +4,26 @@ * 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 { appPermissionDefaultKeys } from "../query-keys"; -import type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations } from "../../orm/input-types"; +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 { appPermissionDefaultKeys } from '../query-keys'; +import type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionDefaultQueryKey = appPermissionDefaultKeys.detail; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionDefaultQuery({ @@ -26,38 +32,52 @@ export const appPermissionDefaultQueryKey = appPermissionDefaultKeys.detail; * }); * ``` */ -export function useAppPermissionDefaultQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppPermissionDefaultSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionDefaultQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppPermissionDefaultQuery< + S extends AppPermissionDefaultSelect, + TData = { + appPermissionDefault: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppPermissionDefaultSelect>; + } & Omit< + UseQueryOptions< + { + appPermissionDefault: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionDefaultQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appPermissionDefaultKeys.detail(params.id), - queryFn: () => getClient().appPermissionDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appPermissionDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```ts * const data = await fetchAppPermissionDefaultQuery({ @@ -79,35 +99,46 @@ export async function fetchAppPermissionDefaultQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appPermissionDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appPermissionDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```ts * await prefetchAppPermissionDefaultQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppPermissionDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppPermissionDefaultSelect>; -}): Promise; -export async function prefetchAppPermissionDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppPermissionDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppPermissionDefaultSelect>; + } +): Promise; +export async function prefetchAppPermissionDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appPermissionDefaultKeys.detail(params.id), - queryFn: () => getClient().appPermissionDefault.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appPermissionDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultsQuery.ts index 37501b8ddd..44cdda731c 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionDefaultsQuery.ts @@ -4,20 +4,35 @@ * 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 { appPermissionDefaultKeys } from "../query-keys"; -import type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations, AppPermissionDefaultFilter, AppPermissionDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionDefaultSelect, AppPermissionDefaultWithRelations, AppPermissionDefaultFilter, AppPermissionDefaultOrderBy } from "../../orm/input-types"; +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 { appPermissionDefaultKeys } from '../query-keys'; +import type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppPermissionDefaultSelect, + AppPermissionDefaultWithRelations, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionDefaultsQueryKey = appPermissionDefaultKeys.list; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionDefaultsQuery({ @@ -30,33 +45,60 @@ export const appPermissionDefaultsQueryKey = appPermissionDefaultKeys.list; * }); * ``` */ -export function useAppPermissionDefaultsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionDefaultsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppPermissionDefaultsQuery< + S extends AppPermissionDefaultSelect, + TData = { + appPermissionDefaults: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultSelect>; + } & Omit< + UseQueryOptions< + { + appPermissionDefaults: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionDefaultsQuery( + params: { + selection: ListSelectionConfig< + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appPermissionDefaultKeys.list(args), queryFn: () => getClient().appPermissionDefault.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```ts * const data = await fetchAppPermissionDefaultsQuery({ @@ -67,38 +109,70 @@ export function useAppPermissionDefaultsQuery(params: { * }); * ``` */ -export async function fetchAppPermissionDefaultsQuery(params: { +export async function fetchAppPermissionDefaultsQuery< + S extends AppPermissionDefaultSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultSelect>; }): Promise<{ appPermissionDefaults: ConnectionResult>; }>; export async function fetchAppPermissionDefaultsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy + >(params.selection); return getClient().appPermissionDefault.findMany(args).unwrap(); } /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```ts * await prefetchAppPermissionDefaultsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppPermissionDefaultsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionDefaultSelect>; -}): Promise; -export async function prefetchAppPermissionDefaultsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppPermissionDefaultsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppPermissionDefaultSelect>; + } +): Promise; +export async function prefetchAppPermissionDefaultsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appPermissionDefaultKeys.list(args), - queryFn: () => getClient().appPermissionDefault.findMany(args).unwrap() + queryFn: () => getClient().appPermissionDefault.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionQuery.ts index cbf5f0277c..b89353ec63 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionQuery.ts @@ -4,20 +4,20 @@ * 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 { appPermissionKeys } from "../query-keys"; -import type { AppPermissionSelect, AppPermissionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionSelect, AppPermissionWithRelations } from "../../orm/input-types"; +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 { appPermissionKeys } from '../query-keys'; +import type { AppPermissionSelect, AppPermissionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppPermissionSelect, AppPermissionWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionQueryKey = appPermissionKeys.detail; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionQuery({ @@ -26,38 +26,52 @@ export const appPermissionQueryKey = appPermissionKeys.detail; * }); * ``` */ -export function useAppPermissionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppPermissionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppPermissionQuery< + S extends AppPermissionSelect, + TData = { + appPermission: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppPermissionSelect>; + } & Omit< + UseQueryOptions< + { + appPermission: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appPermissionKeys.detail(params.id), - queryFn: () => getClient().appPermission.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```ts * const data = await fetchAppPermissionQuery({ @@ -79,35 +93,46 @@ export async function fetchAppPermissionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appPermission.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```ts * await prefetchAppPermissionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppPermissionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppPermissionSelect>; -}): Promise; -export async function prefetchAppPermissionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppPermissionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppPermissionSelect>; + } +): Promise; +export async function prefetchAppPermissionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appPermissionKeys.detail(params.id), - queryFn: () => getClient().appPermission.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetByMaskQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetByMaskQuery.ts index 2d738be3ec..f735051548 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetByMaskQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetByMaskQuery.ts @@ -4,58 +4,77 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { AppPermissionsGetByMaskVariables } from "../../orm/query"; -import type { AppPermissionConnection } from "../../orm/input-types"; -export type { AppPermissionsGetByMaskVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { AppPermissionsGetByMaskVariables } from '../../orm/query'; +import type { AppPermissionConnection } from '../../orm/input-types'; +export type { AppPermissionsGetByMaskVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionsGetByMaskQueryKey = customQueryKeys.appPermissionsGetByMask; /** * Reads and enables pagination through a set of `AppPermission`. - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionsGetByMaskQuery({ variables: { after, first, mask, offset } }); - * + * * if (data?.appPermissionsGetByMask) { * console.log(data.appPermissionsGetByMask); * } * ``` */ -export function useAppPermissionsGetByMaskQuery(params?: { - variables?: AppPermissionsGetByMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionsGetByMaskQuery(params?: { - variables?: AppPermissionsGetByMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useAppPermissionsGetByMaskQuery< + TData = { + appPermissionsGetByMask: AppPermissionConnection | null; + }, +>( + params?: { + variables?: AppPermissionsGetByMaskVariables; + } & Omit< + UseQueryOptions< + { + appPermissionsGetByMask: AppPermissionConnection | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionsGetByMaskQuery< + TData = { + appPermissionsGetByMask: AppPermissionConnection | null; + }, +>( + params?: { + variables?: AppPermissionsGetByMaskVariables; + } & Omit< + UseQueryOptions< + { + appPermissionsGetByMask: AppPermissionConnection | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: appPermissionsGetByMaskQueryKey(variables), queryFn: () => getClient().query.appPermissionsGetByMask(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch appPermissionsGetByMask without React hooks - * + * * @example * ```ts * const data = await fetchAppPermissionsGetByMaskQuery({ variables: { after, first, mask, offset } }); @@ -69,18 +88,21 @@ export async function fetchAppPermissionsGetByMaskQuery(params?: { } /** * Prefetch appPermissionsGetByMask for SSR or cache warming - * + * * @example * ```ts * await prefetchAppPermissionsGetByMaskQuery(queryClient, { variables: { after, first, mask, offset } }); * ``` */ -export async function prefetchAppPermissionsGetByMaskQuery(queryClient: QueryClient, params?: { - variables?: AppPermissionsGetByMaskVariables; -}): Promise { +export async function prefetchAppPermissionsGetByMaskQuery( + queryClient: QueryClient, + params?: { + variables?: AppPermissionsGetByMaskVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: appPermissionsGetByMaskQueryKey(variables), - queryFn: () => getClient().query.appPermissionsGetByMask(variables).unwrap() + queryFn: () => getClient().query.appPermissionsGetByMask(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetMaskByNamesQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetMaskByNamesQuery.ts index 138cf5f722..cbfe1fad8f 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetMaskByNamesQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetMaskByNamesQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { AppPermissionsGetMaskByNamesVariables } from "../../orm/query"; -export type { AppPermissionsGetMaskByNamesVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { AppPermissionsGetMaskByNamesVariables } from '../../orm/query'; +export type { AppPermissionsGetMaskByNamesVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionsGetMaskByNamesQueryKey = customQueryKeys.appPermissionsGetMaskByNames; /** * Query hook for appPermissionsGetMaskByNames - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionsGetMaskByNamesQuery({ variables: { names } }); - * + * * if (data?.appPermissionsGetMaskByNames) { * console.log(data.appPermissionsGetMaskByNames); * } * ``` */ -export function useAppPermissionsGetMaskByNamesQuery(params?: { - variables?: AppPermissionsGetMaskByNamesVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionsGetMaskByNamesQuery(params?: { - variables?: AppPermissionsGetMaskByNamesVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useAppPermissionsGetMaskByNamesQuery< + TData = { + appPermissionsGetMaskByNames: string | null; + }, +>( + params?: { + variables?: AppPermissionsGetMaskByNamesVariables; + } & Omit< + UseQueryOptions< + { + appPermissionsGetMaskByNames: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionsGetMaskByNamesQuery< + TData = { + appPermissionsGetMaskByNames: string | null; + }, +>( + params?: { + variables?: AppPermissionsGetMaskByNamesVariables; + } & Omit< + UseQueryOptions< + { + appPermissionsGetMaskByNames: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: appPermissionsGetMaskByNamesQueryKey(variables), queryFn: () => getClient().query.appPermissionsGetMaskByNames(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch appPermissionsGetMaskByNames without React hooks - * + * * @example * ```ts * const data = await fetchAppPermissionsGetMaskByNamesQuery({ variables: { names } }); @@ -68,18 +87,21 @@ export async function fetchAppPermissionsGetMaskByNamesQuery(params?: { } /** * Prefetch appPermissionsGetMaskByNames for SSR or cache warming - * + * * @example * ```ts * await prefetchAppPermissionsGetMaskByNamesQuery(queryClient, { variables: { names } }); * ``` */ -export async function prefetchAppPermissionsGetMaskByNamesQuery(queryClient: QueryClient, params?: { - variables?: AppPermissionsGetMaskByNamesVariables; -}): Promise { +export async function prefetchAppPermissionsGetMaskByNamesQuery( + queryClient: QueryClient, + params?: { + variables?: AppPermissionsGetMaskByNamesVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: appPermissionsGetMaskByNamesQueryKey(variables), - queryFn: () => getClient().query.appPermissionsGetMaskByNames(variables).unwrap() + queryFn: () => getClient().query.appPermissionsGetMaskByNames(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetMaskQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetMaskQuery.ts index 286905956c..b1e3289da9 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetMaskQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetMaskQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { AppPermissionsGetMaskVariables } from "../../orm/query"; -export type { AppPermissionsGetMaskVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { AppPermissionsGetMaskVariables } from '../../orm/query'; +export type { AppPermissionsGetMaskVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionsGetMaskQueryKey = customQueryKeys.appPermissionsGetMask; /** * Query hook for appPermissionsGetMask - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionsGetMaskQuery({ variables: { ids } }); - * + * * if (data?.appPermissionsGetMask) { * console.log(data.appPermissionsGetMask); * } * ``` */ -export function useAppPermissionsGetMaskQuery(params?: { - variables?: AppPermissionsGetMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionsGetMaskQuery(params?: { - variables?: AppPermissionsGetMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useAppPermissionsGetMaskQuery< + TData = { + appPermissionsGetMask: string | null; + }, +>( + params?: { + variables?: AppPermissionsGetMaskVariables; + } & Omit< + UseQueryOptions< + { + appPermissionsGetMask: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionsGetMaskQuery< + TData = { + appPermissionsGetMask: string | null; + }, +>( + params?: { + variables?: AppPermissionsGetMaskVariables; + } & Omit< + UseQueryOptions< + { + appPermissionsGetMask: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: appPermissionsGetMaskQueryKey(variables), queryFn: () => getClient().query.appPermissionsGetMask(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch appPermissionsGetMask without React hooks - * + * * @example * ```ts * const data = await fetchAppPermissionsGetMaskQuery({ variables: { ids } }); @@ -68,18 +87,21 @@ export async function fetchAppPermissionsGetMaskQuery(params?: { } /** * Prefetch appPermissionsGetMask for SSR or cache warming - * + * * @example * ```ts * await prefetchAppPermissionsGetMaskQuery(queryClient, { variables: { ids } }); * ``` */ -export async function prefetchAppPermissionsGetMaskQuery(queryClient: QueryClient, params?: { - variables?: AppPermissionsGetMaskVariables; -}): Promise { +export async function prefetchAppPermissionsGetMaskQuery( + queryClient: QueryClient, + params?: { + variables?: AppPermissionsGetMaskVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: appPermissionsGetMaskQueryKey(variables), - queryFn: () => getClient().query.appPermissionsGetMask(variables).unwrap() + queryFn: () => getClient().query.appPermissionsGetMask(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetPaddedMaskQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetPaddedMaskQuery.ts index b2b5b81f88..cb504f8105 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetPaddedMaskQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsGetPaddedMaskQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { AppPermissionsGetPaddedMaskVariables } from "../../orm/query"; -export type { AppPermissionsGetPaddedMaskVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { AppPermissionsGetPaddedMaskVariables } from '../../orm/query'; +export type { AppPermissionsGetPaddedMaskVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionsGetPaddedMaskQueryKey = customQueryKeys.appPermissionsGetPaddedMask; /** * Query hook for appPermissionsGetPaddedMask - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionsGetPaddedMaskQuery({ variables: { mask } }); - * + * * if (data?.appPermissionsGetPaddedMask) { * console.log(data.appPermissionsGetPaddedMask); * } * ``` */ -export function useAppPermissionsGetPaddedMaskQuery(params?: { - variables?: AppPermissionsGetPaddedMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionsGetPaddedMaskQuery(params?: { - variables?: AppPermissionsGetPaddedMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useAppPermissionsGetPaddedMaskQuery< + TData = { + appPermissionsGetPaddedMask: string | null; + }, +>( + params?: { + variables?: AppPermissionsGetPaddedMaskVariables; + } & Omit< + UseQueryOptions< + { + appPermissionsGetPaddedMask: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionsGetPaddedMaskQuery< + TData = { + appPermissionsGetPaddedMask: string | null; + }, +>( + params?: { + variables?: AppPermissionsGetPaddedMaskVariables; + } & Omit< + UseQueryOptions< + { + appPermissionsGetPaddedMask: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: appPermissionsGetPaddedMaskQueryKey(variables), queryFn: () => getClient().query.appPermissionsGetPaddedMask(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch appPermissionsGetPaddedMask without React hooks - * + * * @example * ```ts * const data = await fetchAppPermissionsGetPaddedMaskQuery({ variables: { mask } }); @@ -68,18 +87,21 @@ export async function fetchAppPermissionsGetPaddedMaskQuery(params?: { } /** * Prefetch appPermissionsGetPaddedMask for SSR or cache warming - * + * * @example * ```ts * await prefetchAppPermissionsGetPaddedMaskQuery(queryClient, { variables: { mask } }); * ``` */ -export async function prefetchAppPermissionsGetPaddedMaskQuery(queryClient: QueryClient, params?: { - variables?: AppPermissionsGetPaddedMaskVariables; -}): Promise { +export async function prefetchAppPermissionsGetPaddedMaskQuery( + queryClient: QueryClient, + params?: { + variables?: AppPermissionsGetPaddedMaskVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: appPermissionsGetPaddedMaskQueryKey(variables), - queryFn: () => getClient().query.appPermissionsGetPaddedMask(variables).unwrap() + queryFn: () => getClient().query.appPermissionsGetPaddedMask(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsQuery.ts index 50ec39473f..67d25dcdce 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useAppPermissionsQuery.ts @@ -4,20 +4,35 @@ * 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 { appPermissionKeys } from "../query-keys"; -import type { AppPermissionSelect, AppPermissionWithRelations, AppPermissionFilter, AppPermissionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppPermissionSelect, AppPermissionWithRelations, AppPermissionFilter, AppPermissionOrderBy } from "../../orm/input-types"; +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 { appPermissionKeys } from '../query-keys'; +import type { + AppPermissionSelect, + AppPermissionWithRelations, + AppPermissionFilter, + AppPermissionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppPermissionSelect, + AppPermissionWithRelations, + AppPermissionFilter, + AppPermissionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appPermissionsQueryKey = appPermissionKeys.list; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { data, isLoading } = useAppPermissionsQuery({ @@ -30,33 +45,49 @@ export const appPermissionsQueryKey = appPermissionKeys.list; * }); * ``` */ -export function useAppPermissionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppPermissionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppPermissionsQuery< + S extends AppPermissionSelect, + TData = { + appPermissions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppPermissionSelect>; + } & Omit< + UseQueryOptions< + { + appPermissions: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppPermissionsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppPermissionSelect, + AppPermissionFilter, + AppPermissionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appPermissionKeys.list(args), queryFn: () => getClient().appPermission.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```ts * const data = await fetchAppPermissionsQuery({ @@ -70,35 +101,51 @@ export function useAppPermissionsQuery(params: { export async function fetchAppPermissionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppPermissionSelect>; }): Promise<{ appPermissions: ConnectionResult>; }>; export async function fetchAppPermissionsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppPermissionSelect, + AppPermissionFilter, + AppPermissionOrderBy + >(params.selection); return getClient().appPermission.findMany(args).unwrap(); } /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```ts * await prefetchAppPermissionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppPermissionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppPermissionSelect>; -}): Promise; -export async function prefetchAppPermissionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppPermissionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppPermissionSelect>; + } +): Promise; +export async function prefetchAppPermissionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + AppPermissionSelect, + AppPermissionFilter, + AppPermissionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appPermissionKeys.list(args), - queryFn: () => getClient().appPermission.findMany(args).unwrap() + queryFn: () => getClient().appPermission.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useMembershipTypeQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useMembershipTypeQuery.ts index 9467bf3816..e41a27d955 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useMembershipTypeQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useMembershipTypeQuery.ts @@ -4,20 +4,20 @@ * 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 { membershipTypeKeys } from "../query-keys"; -import type { MembershipTypeSelect, MembershipTypeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypeSelect, MembershipTypeWithRelations } from "../../orm/input-types"; +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 { membershipTypeKeys } from '../query-keys'; +import type { MembershipTypeSelect, MembershipTypeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { MembershipTypeSelect, MembershipTypeWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const membershipTypeQueryKey = membershipTypeKeys.detail; /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```tsx * const { data, isLoading } = useMembershipTypeQuery({ @@ -26,38 +26,52 @@ export const membershipTypeQueryKey = membershipTypeKeys.detail; * }); * ``` */ -export function useMembershipTypeQuery | null; -}>(params: { - id: number; - selection: { - fields: S; - } & HookStrictSelect, MembershipTypeSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useMembershipTypeQuery(params: { - id: number; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useMembershipTypeQuery< + S extends MembershipTypeSelect, + TData = { + membershipType: InferSelectResult | null; + }, +>( + params: { + id: number; + selection: { + fields: S; + } & HookStrictSelect, MembershipTypeSelect>; + } & Omit< + UseQueryOptions< + { + membershipType: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useMembershipTypeQuery( + params: { + id: number; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: membershipTypeKeys.detail(params.id), - queryFn: () => getClient().membershipType.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .membershipType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```ts * const data = await fetchMembershipTypeQuery({ @@ -79,35 +93,46 @@ export async function fetchMembershipTypeQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().membershipType.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .membershipType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```ts * await prefetchMembershipTypeQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchMembershipTypeQuery(queryClient: QueryClient, params: { - id: number; - selection: { - fields: S; - } & HookStrictSelect, MembershipTypeSelect>; -}): Promise; -export async function prefetchMembershipTypeQuery(queryClient: QueryClient, params: { - id: number; - selection: SelectionConfig; -}): Promise { +export async function prefetchMembershipTypeQuery( + queryClient: QueryClient, + params: { + id: number; + selection: { + fields: S; + } & HookStrictSelect, MembershipTypeSelect>; + } +): Promise; +export async function prefetchMembershipTypeQuery( + queryClient: QueryClient, + params: { + id: number; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: membershipTypeKeys.detail(params.id), - queryFn: () => getClient().membershipType.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .membershipType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useMembershipTypesQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useMembershipTypesQuery.ts index affcb2a28f..c148bab02a 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useMembershipTypesQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useMembershipTypesQuery.ts @@ -4,20 +4,35 @@ * 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 { membershipTypeKeys } from "../query-keys"; -import type { MembershipTypeSelect, MembershipTypeWithRelations, MembershipTypeFilter, MembershipTypeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypeSelect, MembershipTypeWithRelations, MembershipTypeFilter, MembershipTypeOrderBy } from "../../orm/input-types"; +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 { membershipTypeKeys } from '../query-keys'; +import type { + MembershipTypeSelect, + MembershipTypeWithRelations, + MembershipTypeFilter, + MembershipTypeOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + MembershipTypeSelect, + MembershipTypeWithRelations, + MembershipTypeFilter, + MembershipTypeOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const membershipTypesQueryKey = membershipTypeKeys.list; /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```tsx * const { data, isLoading } = useMembershipTypesQuery({ @@ -30,33 +45,53 @@ export const membershipTypesQueryKey = membershipTypeKeys.list; * }); * ``` */ -export function useMembershipTypesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipTypeSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useMembershipTypesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useMembershipTypesQuery< + S extends MembershipTypeSelect, + TData = { + membershipTypes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, MembershipTypeSelect>; + } & Omit< + UseQueryOptions< + { + membershipTypes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useMembershipTypesQuery( + params: { + selection: ListSelectionConfig< + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: membershipTypeKeys.list(args), queryFn: () => getClient().membershipType.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```ts * const data = await fetchMembershipTypesQuery({ @@ -70,35 +105,55 @@ export function useMembershipTypesQuery(params: { export async function fetchMembershipTypesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipTypeSelect>; + } & Omit, 'fields'> & + HookStrictSelect, MembershipTypeSelect>; }): Promise<{ membershipTypes: ConnectionResult>; }>; export async function fetchMembershipTypesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy + >(params.selection); return getClient().membershipType.findMany(args).unwrap(); } /** * Defines the different scopes of membership (e.g. App Member, Organization Member, Group Member) - * + * * @example * ```ts * await prefetchMembershipTypesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchMembershipTypesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipTypeSelect>; -}): Promise; -export async function prefetchMembershipTypesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchMembershipTypesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, MembershipTypeSelect>; + } +): Promise; +export async function prefetchMembershipTypesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: membershipTypeKeys.list(args), - queryFn: () => getClient().membershipType.findMany(args).unwrap() + queryFn: () => getClient().membershipType.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgAdminGrantQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgAdminGrantQuery.ts index f7ffed3d22..468412a98d 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgAdminGrantQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgAdminGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { orgAdminGrantKeys } from "../query-keys"; -import type { OrgAdminGrantSelect, OrgAdminGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgAdminGrantSelect, OrgAdminGrantWithRelations } from "../../orm/input-types"; +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 { orgAdminGrantKeys } from '../query-keys'; +import type { OrgAdminGrantSelect, OrgAdminGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgAdminGrantSelect, OrgAdminGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgAdminGrantQueryKey = orgAdminGrantKeys.detail; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { data, isLoading } = useOrgAdminGrantQuery({ @@ -26,38 +26,52 @@ export const orgAdminGrantQueryKey = orgAdminGrantKeys.detail; * }); * ``` */ -export function useOrgAdminGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgAdminGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgAdminGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgAdminGrantQuery< + S extends OrgAdminGrantSelect, + TData = { + orgAdminGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgAdminGrantSelect>; + } & Omit< + UseQueryOptions< + { + orgAdminGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgAdminGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgAdminGrantKeys.detail(params.id), - queryFn: () => getClient().orgAdminGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgAdminGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Records of admin role grants and revocations between members - * + * * @example * ```ts * const data = await fetchOrgAdminGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgAdminGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgAdminGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgAdminGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Records of admin role grants and revocations between members - * + * * @example * ```ts * await prefetchOrgAdminGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgAdminGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgAdminGrantSelect>; -}): Promise; -export async function prefetchOrgAdminGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgAdminGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgAdminGrantSelect>; + } +): Promise; +export async function prefetchOrgAdminGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgAdminGrantKeys.detail(params.id), - queryFn: () => getClient().orgAdminGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgAdminGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgAdminGrantsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgAdminGrantsQuery.ts index 8e72c6a06e..b79b6cfdd4 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgAdminGrantsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgAdminGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgAdminGrantKeys } from "../query-keys"; -import type { OrgAdminGrantSelect, OrgAdminGrantWithRelations, OrgAdminGrantFilter, OrgAdminGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgAdminGrantSelect, OrgAdminGrantWithRelations, OrgAdminGrantFilter, OrgAdminGrantOrderBy } from "../../orm/input-types"; +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 { orgAdminGrantKeys } from '../query-keys'; +import type { + OrgAdminGrantSelect, + OrgAdminGrantWithRelations, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgAdminGrantSelect, + OrgAdminGrantWithRelations, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgAdminGrantsQueryKey = orgAdminGrantKeys.list; /** * Records of admin role grants and revocations between members - * + * * @example * ```tsx * const { data, isLoading } = useOrgAdminGrantsQuery({ @@ -30,33 +45,49 @@ export const orgAdminGrantsQueryKey = orgAdminGrantKeys.list; * }); * ``` */ -export function useOrgAdminGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgAdminGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgAdminGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgAdminGrantsQuery< + S extends OrgAdminGrantSelect, + TData = { + orgAdminGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgAdminGrantSelect>; + } & Omit< + UseQueryOptions< + { + orgAdminGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgAdminGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgAdminGrantSelect, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgAdminGrantKeys.list(args), queryFn: () => getClient().orgAdminGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Records of admin role grants and revocations between members - * + * * @example * ```ts * const data = await fetchOrgAdminGrantsQuery({ @@ -70,35 +101,51 @@ export function useOrgAdminGrantsQuery(params: { export async function fetchOrgAdminGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgAdminGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgAdminGrantSelect>; }): Promise<{ orgAdminGrants: ConnectionResult>; }>; export async function fetchOrgAdminGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgAdminGrantSelect, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy + >(params.selection); return getClient().orgAdminGrant.findMany(args).unwrap(); } /** * Records of admin role grants and revocations between members - * + * * @example * ```ts * await prefetchOrgAdminGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgAdminGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgAdminGrantSelect>; -}): Promise; -export async function prefetchOrgAdminGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgAdminGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgAdminGrantSelect>; + } +): Promise; +export async function prefetchOrgAdminGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + OrgAdminGrantSelect, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgAdminGrantKeys.list(args), - queryFn: () => getClient().orgAdminGrant.findMany(args).unwrap() + queryFn: () => getClient().orgAdminGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgClaimedInviteQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgClaimedInviteQuery.ts index 87b07def39..bd0fcdb37f 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgClaimedInviteQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgClaimedInviteQuery.ts @@ -4,20 +4,20 @@ * 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 { orgClaimedInviteKeys } from "../query-keys"; -import type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations } from "../../orm/input-types"; +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 { orgClaimedInviteKeys } from '../query-keys'; +import type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgClaimedInviteQueryKey = orgClaimedInviteKeys.detail; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { data, isLoading } = useOrgClaimedInviteQuery({ @@ -26,38 +26,52 @@ export const orgClaimedInviteQueryKey = orgClaimedInviteKeys.detail; * }); * ``` */ -export function useOrgClaimedInviteQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgClaimedInviteSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgClaimedInviteQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgClaimedInviteQuery< + S extends OrgClaimedInviteSelect, + TData = { + orgClaimedInvite: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgClaimedInviteSelect>; + } & Omit< + UseQueryOptions< + { + orgClaimedInvite: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgClaimedInviteQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgClaimedInviteKeys.detail(params.id), - queryFn: () => getClient().orgClaimedInvite.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgClaimedInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```ts * const data = await fetchOrgClaimedInviteQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgClaimedInviteQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgClaimedInvite.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgClaimedInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```ts * await prefetchOrgClaimedInviteQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgClaimedInviteQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgClaimedInviteSelect>; -}): Promise; -export async function prefetchOrgClaimedInviteQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgClaimedInviteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgClaimedInviteSelect>; + } +): Promise; +export async function prefetchOrgClaimedInviteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgClaimedInviteKeys.detail(params.id), - queryFn: () => getClient().orgClaimedInvite.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgClaimedInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgClaimedInvitesQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgClaimedInvitesQuery.ts index 8e793c7da6..300fb5adfd 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgClaimedInvitesQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgClaimedInvitesQuery.ts @@ -4,20 +4,35 @@ * 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 { orgClaimedInviteKeys } from "../query-keys"; -import type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations, OrgClaimedInviteFilter, OrgClaimedInviteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgClaimedInviteSelect, OrgClaimedInviteWithRelations, OrgClaimedInviteFilter, OrgClaimedInviteOrderBy } from "../../orm/input-types"; +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 { orgClaimedInviteKeys } from '../query-keys'; +import type { + OrgClaimedInviteSelect, + OrgClaimedInviteWithRelations, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgClaimedInviteSelect, + OrgClaimedInviteWithRelations, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgClaimedInvitesQueryKey = orgClaimedInviteKeys.list; /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```tsx * const { data, isLoading } = useOrgClaimedInvitesQuery({ @@ -30,33 +45,53 @@ export const orgClaimedInvitesQueryKey = orgClaimedInviteKeys.list; * }); * ``` */ -export function useOrgClaimedInvitesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgClaimedInviteSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgClaimedInvitesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgClaimedInvitesQuery< + S extends OrgClaimedInviteSelect, + TData = { + orgClaimedInvites: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgClaimedInviteSelect>; + } & Omit< + UseQueryOptions< + { + orgClaimedInvites: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgClaimedInvitesQuery( + params: { + selection: ListSelectionConfig< + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgClaimedInviteKeys.list(args), queryFn: () => getClient().orgClaimedInvite.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```ts * const data = await fetchOrgClaimedInvitesQuery({ @@ -70,35 +105,59 @@ export function useOrgClaimedInvitesQuery(params: { export async function fetchOrgClaimedInvitesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgClaimedInviteSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgClaimedInviteSelect>; }): Promise<{ orgClaimedInvites: ConnectionResult>; }>; export async function fetchOrgClaimedInvitesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy + >(params.selection); return getClient().orgClaimedInvite.findMany(args).unwrap(); } /** * Records of successfully claimed invitations, linking senders to receivers - * + * * @example * ```ts * await prefetchOrgClaimedInvitesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgClaimedInvitesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgClaimedInviteSelect>; -}): Promise; -export async function prefetchOrgClaimedInvitesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgClaimedInvitesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgClaimedInviteSelect>; + } +): Promise; +export async function prefetchOrgClaimedInvitesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgClaimedInviteKeys.list(args), - queryFn: () => getClient().orgClaimedInvite.findMany(args).unwrap() + queryFn: () => getClient().orgClaimedInvite.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgGrantQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgGrantQuery.ts index 00a466121e..3d02f5cd44 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgGrantQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { orgGrantKeys } from "../query-keys"; -import type { OrgGrantSelect, OrgGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgGrantSelect, OrgGrantWithRelations } from "../../orm/input-types"; +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 { orgGrantKeys } from '../query-keys'; +import type { OrgGrantSelect, OrgGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgGrantSelect, OrgGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgGrantQueryKey = orgGrantKeys.detail; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { data, isLoading } = useOrgGrantQuery({ @@ -26,38 +26,52 @@ export const orgGrantQueryKey = orgGrantKeys.detail; * }); * ``` */ -export function useOrgGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgGrantQuery< + S extends OrgGrantSelect, + TData = { + orgGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgGrantSelect>; + } & Omit< + UseQueryOptions< + { + orgGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgGrantKeys.detail(params.id), - queryFn: () => getClient().orgGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```ts * const data = await fetchOrgGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```ts * await prefetchOrgGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgGrantSelect>; -}): Promise; -export async function prefetchOrgGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgGrantSelect>; + } +): Promise; +export async function prefetchOrgGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgGrantKeys.detail(params.id), - queryFn: () => getClient().orgGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgGrantsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgGrantsQuery.ts index 5fc2da120a..f402141302 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgGrantsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgGrantKeys } from "../query-keys"; -import type { OrgGrantSelect, OrgGrantWithRelations, OrgGrantFilter, OrgGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgGrantSelect, OrgGrantWithRelations, OrgGrantFilter, OrgGrantOrderBy } from "../../orm/input-types"; +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 { orgGrantKeys } from '../query-keys'; +import type { + OrgGrantSelect, + OrgGrantWithRelations, + OrgGrantFilter, + OrgGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgGrantSelect, + OrgGrantWithRelations, + OrgGrantFilter, + OrgGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgGrantsQueryKey = orgGrantKeys.list; /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```tsx * const { data, isLoading } = useOrgGrantsQuery({ @@ -30,33 +45,47 @@ export const orgGrantsQueryKey = orgGrantKeys.list; * }); * ``` */ -export function useOrgGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgGrantsQuery< + S extends OrgGrantSelect, + TData = { + orgGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgGrantSelect>; + } & Omit< + UseQueryOptions< + { + orgGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgGrantKeys.list(args), queryFn: () => getClient().orgGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```ts * const data = await fetchOrgGrantsQuery({ @@ -70,35 +99,47 @@ export function useOrgGrantsQuery(params: { export async function fetchOrgGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgGrantSelect>; }): Promise<{ orgGrants: ConnectionResult>; }>; export async function fetchOrgGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().orgGrant.findMany(args).unwrap(); } /** * Records of individual permission grants and revocations for members via bitmask - * + * * @example * ```ts * await prefetchOrgGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgGrantSelect>; -}): Promise; -export async function prefetchOrgGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgGrantSelect>; + } +): Promise; +export async function prefetchOrgGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: orgGrantKeys.list(args), - queryFn: () => getClient().orgGrant.findMany(args).unwrap() + queryFn: () => getClient().orgGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgInviteQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgInviteQuery.ts index d2c6f63e83..bf720507b3 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgInviteQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgInviteQuery.ts @@ -4,20 +4,20 @@ * 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 { orgInviteKeys } from "../query-keys"; -import type { OrgInviteSelect, OrgInviteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgInviteSelect, OrgInviteWithRelations } from "../../orm/input-types"; +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 { orgInviteKeys } from '../query-keys'; +import type { OrgInviteSelect, OrgInviteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgInviteSelect, OrgInviteWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgInviteQueryKey = orgInviteKeys.detail; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { data, isLoading } = useOrgInviteQuery({ @@ -26,38 +26,52 @@ export const orgInviteQueryKey = orgInviteKeys.detail; * }); * ``` */ -export function useOrgInviteQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgInviteSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgInviteQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgInviteQuery< + S extends OrgInviteSelect, + TData = { + orgInvite: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgInviteSelect>; + } & Omit< + UseQueryOptions< + { + orgInvite: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgInviteQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgInviteKeys.detail(params.id), - queryFn: () => getClient().orgInvite.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```ts * const data = await fetchOrgInviteQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgInviteQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgInvite.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```ts * await prefetchOrgInviteQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgInviteQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgInviteSelect>; -}): Promise; -export async function prefetchOrgInviteQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgInviteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgInviteSelect>; + } +): Promise; +export async function prefetchOrgInviteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgInviteKeys.detail(params.id), - queryFn: () => getClient().orgInvite.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgInvite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgInvitesQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgInvitesQuery.ts index eff9acf594..b5e0ee4dd5 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgInvitesQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgInvitesQuery.ts @@ -4,20 +4,35 @@ * 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 { orgInviteKeys } from "../query-keys"; -import type { OrgInviteSelect, OrgInviteWithRelations, OrgInviteFilter, OrgInviteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgInviteSelect, OrgInviteWithRelations, OrgInviteFilter, OrgInviteOrderBy } from "../../orm/input-types"; +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 { orgInviteKeys } from '../query-keys'; +import type { + OrgInviteSelect, + OrgInviteWithRelations, + OrgInviteFilter, + OrgInviteOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgInviteSelect, + OrgInviteWithRelations, + OrgInviteFilter, + OrgInviteOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgInvitesQueryKey = orgInviteKeys.list; /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```tsx * const { data, isLoading } = useOrgInvitesQuery({ @@ -30,33 +45,47 @@ export const orgInvitesQueryKey = orgInviteKeys.list; * }); * ``` */ -export function useOrgInvitesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgInviteSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgInvitesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgInvitesQuery< + S extends OrgInviteSelect, + TData = { + orgInvites: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgInviteSelect>; + } & Omit< + UseQueryOptions< + { + orgInvites: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgInvitesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgInviteKeys.list(args), queryFn: () => getClient().orgInvite.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```ts * const data = await fetchOrgInvitesQuery({ @@ -70,35 +99,47 @@ export function useOrgInvitesQuery(params: { export async function fetchOrgInvitesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgInviteSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgInviteSelect>; }): Promise<{ orgInvites: ConnectionResult>; }>; export async function fetchOrgInvitesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().orgInvite.findMany(args).unwrap(); } /** * Invitation records sent to prospective members via email, with token-based redemption and expiration - * + * * @example * ```ts * await prefetchOrgInvitesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgInvitesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgInviteSelect>; -}): Promise; -export async function prefetchOrgInvitesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgInvitesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgInviteSelect>; + } +): Promise; +export async function prefetchOrgInvitesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: orgInviteKeys.list(args), - queryFn: () => getClient().orgInvite.findMany(args).unwrap() + queryFn: () => getClient().orgInvite.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberProfileQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberProfileQuery.ts index f7c7b4cf2f..591bab6765 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberProfileQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberProfileQuery.ts @@ -4,20 +4,20 @@ * 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 { orgMemberProfileKeys } from "../query-keys"; -import type { OrgMemberProfileSelect, OrgMemberProfileWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberProfileSelect, OrgMemberProfileWithRelations } from "../../orm/input-types"; +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 { orgMemberProfileKeys } from '../query-keys'; +import type { OrgMemberProfileSelect, OrgMemberProfileWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgMemberProfileSelect, OrgMemberProfileWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMemberProfileQueryKey = orgMemberProfileKeys.detail; /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```tsx * const { data, isLoading } = useOrgMemberProfileQuery({ @@ -26,38 +26,52 @@ export const orgMemberProfileQueryKey = orgMemberProfileKeys.detail; * }); * ``` */ -export function useOrgMemberProfileQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMemberProfileSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMemberProfileQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgMemberProfileQuery< + S extends OrgMemberProfileSelect, + TData = { + orgMemberProfile: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMemberProfileSelect>; + } & Omit< + UseQueryOptions< + { + orgMemberProfile: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMemberProfileQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMemberProfileKeys.detail(params.id), - queryFn: () => getClient().orgMemberProfile.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgMemberProfile.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```ts * const data = await fetchOrgMemberProfileQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgMemberProfileQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgMemberProfile.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgMemberProfile.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```ts * await prefetchOrgMemberProfileQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgMemberProfileQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMemberProfileSelect>; -}): Promise; -export async function prefetchOrgMemberProfileQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgMemberProfileQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMemberProfileSelect>; + } +): Promise; +export async function prefetchOrgMemberProfileQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgMemberProfileKeys.detail(params.id), - queryFn: () => getClient().orgMemberProfile.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgMemberProfile.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberProfilesQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberProfilesQuery.ts index 57af322a3f..4aa4c8d07b 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberProfilesQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberProfilesQuery.ts @@ -4,20 +4,35 @@ * 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 { orgMemberProfileKeys } from "../query-keys"; -import type { OrgMemberProfileSelect, OrgMemberProfileWithRelations, OrgMemberProfileFilter, OrgMemberProfileOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberProfileSelect, OrgMemberProfileWithRelations, OrgMemberProfileFilter, OrgMemberProfileOrderBy } from "../../orm/input-types"; +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 { orgMemberProfileKeys } from '../query-keys'; +import type { + OrgMemberProfileSelect, + OrgMemberProfileWithRelations, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgMemberProfileSelect, + OrgMemberProfileWithRelations, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMemberProfilesQueryKey = orgMemberProfileKeys.list; /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```tsx * const { data, isLoading } = useOrgMemberProfilesQuery({ @@ -30,33 +45,53 @@ export const orgMemberProfilesQueryKey = orgMemberProfileKeys.list; * }); * ``` */ -export function useOrgMemberProfilesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMemberProfileSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMemberProfilesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgMemberProfilesQuery< + S extends OrgMemberProfileSelect, + TData = { + orgMemberProfiles: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgMemberProfileSelect>; + } & Omit< + UseQueryOptions< + { + orgMemberProfiles: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMemberProfilesQuery( + params: { + selection: ListSelectionConfig< + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMemberProfileKeys.list(args), queryFn: () => getClient().orgMemberProfile.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```ts * const data = await fetchOrgMemberProfilesQuery({ @@ -70,35 +105,59 @@ export function useOrgMemberProfilesQuery(params: { export async function fetchOrgMemberProfilesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMemberProfileSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgMemberProfileSelect>; }): Promise<{ orgMemberProfiles: ConnectionResult>; }>; export async function fetchOrgMemberProfilesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy + >(params.selection); return getClient().orgMemberProfile.findMany(args).unwrap(); } /** * Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) - * + * * @example * ```ts * await prefetchOrgMemberProfilesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgMemberProfilesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMemberProfileSelect>; -}): Promise; -export async function prefetchOrgMemberProfilesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgMemberProfilesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgMemberProfileSelect>; + } +): Promise; +export async function prefetchOrgMemberProfilesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgMemberProfileKeys.list(args), - queryFn: () => getClient().orgMemberProfile.findMany(args).unwrap() + queryFn: () => getClient().orgMemberProfile.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberQuery.ts index 829735430f..d222cf6e2b 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMemberQuery.ts @@ -4,20 +4,20 @@ * 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 { orgMemberKeys } from "../query-keys"; -import type { OrgMemberSelect, OrgMemberWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberSelect, OrgMemberWithRelations } from "../../orm/input-types"; +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 { orgMemberKeys } from '../query-keys'; +import type { OrgMemberSelect, OrgMemberWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgMemberSelect, OrgMemberWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMemberQueryKey = orgMemberKeys.detail; /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```tsx * const { data, isLoading } = useOrgMemberQuery({ @@ -26,38 +26,52 @@ export const orgMemberQueryKey = orgMemberKeys.detail; * }); * ``` */ -export function useOrgMemberQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMemberSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMemberQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgMemberQuery< + S extends OrgMemberSelect, + TData = { + orgMember: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMemberSelect>; + } & Omit< + UseQueryOptions< + { + orgMember: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMemberQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMemberKeys.detail(params.id), - queryFn: () => getClient().orgMember.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgMember.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```ts * const data = await fetchOrgMemberQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgMemberQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgMember.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgMember.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```ts * await prefetchOrgMemberQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgMemberQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMemberSelect>; -}): Promise; -export async function prefetchOrgMemberQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgMemberQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMemberSelect>; + } +): Promise; +export async function prefetchOrgMemberQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgMemberKeys.detail(params.id), - queryFn: () => getClient().orgMember.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgMember.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembersQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembersQuery.ts index f7185ccd5c..21929089ee 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembersQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembersQuery.ts @@ -4,20 +4,35 @@ * 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 { orgMemberKeys } from "../query-keys"; -import type { OrgMemberSelect, OrgMemberWithRelations, OrgMemberFilter, OrgMemberOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMemberSelect, OrgMemberWithRelations, OrgMemberFilter, OrgMemberOrderBy } from "../../orm/input-types"; +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 { orgMemberKeys } from '../query-keys'; +import type { + OrgMemberSelect, + OrgMemberWithRelations, + OrgMemberFilter, + OrgMemberOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgMemberSelect, + OrgMemberWithRelations, + OrgMemberFilter, + OrgMemberOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMembersQueryKey = orgMemberKeys.list; /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```tsx * const { data, isLoading } = useOrgMembersQuery({ @@ -30,33 +45,47 @@ export const orgMembersQueryKey = orgMemberKeys.list; * }); * ``` */ -export function useOrgMembersQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMemberSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMembersQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgMembersQuery< + S extends OrgMemberSelect, + TData = { + orgMembers: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgMemberSelect>; + } & Omit< + UseQueryOptions< + { + orgMembers: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMembersQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMemberKeys.list(args), queryFn: () => getClient().orgMember.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```ts * const data = await fetchOrgMembersQuery({ @@ -70,35 +99,47 @@ export function useOrgMembersQuery(params: { export async function fetchOrgMembersQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMemberSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgMemberSelect>; }): Promise<{ orgMembers: ConnectionResult>; }>; export async function fetchOrgMembersQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().orgMember.findMany(args).unwrap(); } /** * Simplified view of active members in an entity, used for listing who belongs to an org or group - * + * * @example * ```ts * await prefetchOrgMembersQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgMembersQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMemberSelect>; -}): Promise; -export async function prefetchOrgMembersQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgMembersQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgMemberSelect>; + } +): Promise; +export async function prefetchOrgMembersQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: orgMemberKeys.list(args), - queryFn: () => getClient().orgMember.findMany(args).unwrap() + queryFn: () => getClient().orgMember.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipDefaultQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipDefaultQuery.ts index 921cbb4462..b142d79be9 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipDefaultQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipDefaultQuery.ts @@ -4,20 +4,26 @@ * 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 { orgMembershipDefaultKeys } from "../query-keys"; -import type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations } from "../../orm/input-types"; +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 { orgMembershipDefaultKeys } from '../query-keys'; +import type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMembershipDefaultQueryKey = orgMembershipDefaultKeys.detail; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { data, isLoading } = useOrgMembershipDefaultQuery({ @@ -26,38 +32,52 @@ export const orgMembershipDefaultQueryKey = orgMembershipDefaultKeys.detail; * }); * ``` */ -export function useOrgMembershipDefaultQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMembershipDefaultSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMembershipDefaultQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgMembershipDefaultQuery< + S extends OrgMembershipDefaultSelect, + TData = { + orgMembershipDefault: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMembershipDefaultSelect>; + } & Omit< + UseQueryOptions< + { + orgMembershipDefault: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMembershipDefaultQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMembershipDefaultKeys.detail(params.id), - queryFn: () => getClient().orgMembershipDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgMembershipDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```ts * const data = await fetchOrgMembershipDefaultQuery({ @@ -79,35 +99,46 @@ export async function fetchOrgMembershipDefaultQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgMembershipDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgMembershipDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```ts * await prefetchOrgMembershipDefaultQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgMembershipDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMembershipDefaultSelect>; -}): Promise; -export async function prefetchOrgMembershipDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgMembershipDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMembershipDefaultSelect>; + } +): Promise; +export async function prefetchOrgMembershipDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgMembershipDefaultKeys.detail(params.id), - queryFn: () => getClient().orgMembershipDefault.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgMembershipDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipDefaultsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipDefaultsQuery.ts index 2334a63cab..06c715627c 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipDefaultsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipDefaultsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgMembershipDefaultKeys } from "../query-keys"; -import type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations, OrgMembershipDefaultFilter, OrgMembershipDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipDefaultSelect, OrgMembershipDefaultWithRelations, OrgMembershipDefaultFilter, OrgMembershipDefaultOrderBy } from "../../orm/input-types"; +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 { orgMembershipDefaultKeys } from '../query-keys'; +import type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgMembershipDefaultSelect, + OrgMembershipDefaultWithRelations, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMembershipDefaultsQueryKey = orgMembershipDefaultKeys.list; /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```tsx * const { data, isLoading } = useOrgMembershipDefaultsQuery({ @@ -30,33 +45,60 @@ export const orgMembershipDefaultsQueryKey = orgMembershipDefaultKeys.list; * }); * ``` */ -export function useOrgMembershipDefaultsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipDefaultSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMembershipDefaultsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgMembershipDefaultsQuery< + S extends OrgMembershipDefaultSelect, + TData = { + orgMembershipDefaults: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgMembershipDefaultSelect>; + } & Omit< + UseQueryOptions< + { + orgMembershipDefaults: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMembershipDefaultsQuery( + params: { + selection: ListSelectionConfig< + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMembershipDefaultKeys.list(args), queryFn: () => getClient().orgMembershipDefault.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```ts * const data = await fetchOrgMembershipDefaultsQuery({ @@ -67,38 +109,70 @@ export function useOrgMembershipDefaultsQuery(params: { * }); * ``` */ -export async function fetchOrgMembershipDefaultsQuery(params: { +export async function fetchOrgMembershipDefaultsQuery< + S extends OrgMembershipDefaultSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipDefaultSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgMembershipDefaultSelect>; }): Promise<{ orgMembershipDefaults: ConnectionResult>; }>; export async function fetchOrgMembershipDefaultsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy + >(params.selection); return getClient().orgMembershipDefault.findMany(args).unwrap(); } /** * Default membership settings per entity, controlling initial approval and verification state for new members - * + * * @example * ```ts * await prefetchOrgMembershipDefaultsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgMembershipDefaultsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipDefaultSelect>; -}): Promise; -export async function prefetchOrgMembershipDefaultsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgMembershipDefaultsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgMembershipDefaultSelect>; + } +): Promise; +export async function prefetchOrgMembershipDefaultsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgMembershipDefaultKeys.list(args), - queryFn: () => getClient().orgMembershipDefault.findMany(args).unwrap() + queryFn: () => getClient().orgMembershipDefault.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipQuery.ts index d0da361a7d..c251c5b23b 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipQuery.ts @@ -4,20 +4,20 @@ * 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 { orgMembershipKeys } from "../query-keys"; -import type { OrgMembershipSelect, OrgMembershipWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSelect, OrgMembershipWithRelations } from "../../orm/input-types"; +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 { orgMembershipKeys } from '../query-keys'; +import type { OrgMembershipSelect, OrgMembershipWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgMembershipSelect, OrgMembershipWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMembershipQueryKey = orgMembershipKeys.detail; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { data, isLoading } = useOrgMembershipQuery({ @@ -26,38 +26,52 @@ export const orgMembershipQueryKey = orgMembershipKeys.detail; * }); * ``` */ -export function useOrgMembershipQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMembershipSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMembershipQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgMembershipQuery< + S extends OrgMembershipSelect, + TData = { + orgMembership: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMembershipSelect>; + } & Omit< + UseQueryOptions< + { + orgMembership: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMembershipQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMembershipKeys.detail(params.id), - queryFn: () => getClient().orgMembership.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgMembership.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```ts * const data = await fetchOrgMembershipQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgMembershipQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgMembership.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgMembership.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```ts * await prefetchOrgMembershipQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgMembershipQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMembershipSelect>; -}): Promise; -export async function prefetchOrgMembershipQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgMembershipQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMembershipSelect>; + } +): Promise; +export async function prefetchOrgMembershipQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgMembershipKeys.detail(params.id), - queryFn: () => getClient().orgMembership.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgMembership.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipSettingQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipSettingQuery.ts index a70230e7b3..1e3f0d1670 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipSettingQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipSettingQuery.ts @@ -4,20 +4,26 @@ * 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 { orgMembershipSettingKeys } from "../query-keys"; -import type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations } from "../../orm/input-types"; +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 { orgMembershipSettingKeys } from '../query-keys'; +import type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMembershipSettingQueryKey = orgMembershipSettingKeys.detail; /** * Per-entity settings for the memberships module - * + * * @example * ```tsx * const { data, isLoading } = useOrgMembershipSettingQuery({ @@ -26,38 +32,52 @@ export const orgMembershipSettingQueryKey = orgMembershipSettingKeys.detail; * }); * ``` */ -export function useOrgMembershipSettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMembershipSettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMembershipSettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgMembershipSettingQuery< + S extends OrgMembershipSettingSelect, + TData = { + orgMembershipSetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMembershipSettingSelect>; + } & Omit< + UseQueryOptions< + { + orgMembershipSetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMembershipSettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMembershipSettingKeys.detail(params.id), - queryFn: () => getClient().orgMembershipSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgMembershipSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Per-entity settings for the memberships module - * + * * @example * ```ts * const data = await fetchOrgMembershipSettingQuery({ @@ -79,35 +99,46 @@ export async function fetchOrgMembershipSettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgMembershipSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgMembershipSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-entity settings for the memberships module - * + * * @example * ```ts * await prefetchOrgMembershipSettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgMembershipSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgMembershipSettingSelect>; -}): Promise; -export async function prefetchOrgMembershipSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgMembershipSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgMembershipSettingSelect>; + } +): Promise; +export async function prefetchOrgMembershipSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgMembershipSettingKeys.detail(params.id), - queryFn: () => getClient().orgMembershipSetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgMembershipSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipSettingsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipSettingsQuery.ts index 2d419c30a3..fe35b92d5f 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipSettingsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipSettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgMembershipSettingKeys } from "../query-keys"; -import type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations, OrgMembershipSettingFilter, OrgMembershipSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSettingSelect, OrgMembershipSettingWithRelations, OrgMembershipSettingFilter, OrgMembershipSettingOrderBy } from "../../orm/input-types"; +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 { orgMembershipSettingKeys } from '../query-keys'; +import type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgMembershipSettingSelect, + OrgMembershipSettingWithRelations, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMembershipSettingsQueryKey = orgMembershipSettingKeys.list; /** * Per-entity settings for the memberships module - * + * * @example * ```tsx * const { data, isLoading } = useOrgMembershipSettingsQuery({ @@ -30,33 +45,60 @@ export const orgMembershipSettingsQueryKey = orgMembershipSettingKeys.list; * }); * ``` */ -export function useOrgMembershipSettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipSettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMembershipSettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgMembershipSettingsQuery< + S extends OrgMembershipSettingSelect, + TData = { + orgMembershipSettings: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgMembershipSettingSelect>; + } & Omit< + UseQueryOptions< + { + orgMembershipSettings: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMembershipSettingsQuery( + params: { + selection: ListSelectionConfig< + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMembershipSettingKeys.list(args), queryFn: () => getClient().orgMembershipSetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Per-entity settings for the memberships module - * + * * @example * ```ts * const data = await fetchOrgMembershipSettingsQuery({ @@ -67,38 +109,70 @@ export function useOrgMembershipSettingsQuery(params: { * }); * ``` */ -export async function fetchOrgMembershipSettingsQuery(params: { +export async function fetchOrgMembershipSettingsQuery< + S extends OrgMembershipSettingSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipSettingSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgMembershipSettingSelect>; }): Promise<{ orgMembershipSettings: ConnectionResult>; }>; export async function fetchOrgMembershipSettingsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy + >(params.selection); return getClient().orgMembershipSetting.findMany(args).unwrap(); } /** * Per-entity settings for the memberships module - * + * * @example * ```ts * await prefetchOrgMembershipSettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgMembershipSettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipSettingSelect>; -}): Promise; -export async function prefetchOrgMembershipSettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgMembershipSettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgMembershipSettingSelect>; + } +): Promise; +export async function prefetchOrgMembershipSettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgMembershipSettingKeys.list(args), - queryFn: () => getClient().orgMembershipSetting.findMany(args).unwrap() + queryFn: () => getClient().orgMembershipSetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipsQuery.ts index e831284f49..2e620b4850 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgMembershipsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgMembershipKeys } from "../query-keys"; -import type { OrgMembershipSelect, OrgMembershipWithRelations, OrgMembershipFilter, OrgMembershipOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgMembershipSelect, OrgMembershipWithRelations, OrgMembershipFilter, OrgMembershipOrderBy } from "../../orm/input-types"; +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 { orgMembershipKeys } from '../query-keys'; +import type { + OrgMembershipSelect, + OrgMembershipWithRelations, + OrgMembershipFilter, + OrgMembershipOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgMembershipSelect, + OrgMembershipWithRelations, + OrgMembershipFilter, + OrgMembershipOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgMembershipsQueryKey = orgMembershipKeys.list; /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```tsx * const { data, isLoading } = useOrgMembershipsQuery({ @@ -30,33 +45,49 @@ export const orgMembershipsQueryKey = orgMembershipKeys.list; * }); * ``` */ -export function useOrgMembershipsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgMembershipsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgMembershipsQuery< + S extends OrgMembershipSelect, + TData = { + orgMemberships: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgMembershipSelect>; + } & Omit< + UseQueryOptions< + { + orgMemberships: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgMembershipsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgMembershipSelect, + OrgMembershipFilter, + OrgMembershipOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgMembershipKeys.list(args), queryFn: () => getClient().orgMembership.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```ts * const data = await fetchOrgMembershipsQuery({ @@ -70,35 +101,51 @@ export function useOrgMembershipsQuery(params: { export async function fetchOrgMembershipsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgMembershipSelect>; }): Promise<{ orgMemberships: ConnectionResult>; }>; export async function fetchOrgMembershipsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgMembershipSelect, + OrgMembershipFilter, + OrgMembershipOrderBy + >(params.selection); return getClient().orgMembership.findMany(args).unwrap(); } /** * Tracks membership records linking actors to entities with permission bitmasks, ownership, and admin status - * + * * @example * ```ts * await prefetchOrgMembershipsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgMembershipsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgMembershipSelect>; -}): Promise; -export async function prefetchOrgMembershipsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgMembershipsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgMembershipSelect>; + } +): Promise; +export async function prefetchOrgMembershipsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + OrgMembershipSelect, + OrgMembershipFilter, + OrgMembershipOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgMembershipKeys.list(args), - queryFn: () => getClient().orgMembership.findMany(args).unwrap() + queryFn: () => getClient().orgMembership.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgOwnerGrantQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgOwnerGrantQuery.ts index 8abf13a1be..a7c0bc4dde 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgOwnerGrantQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgOwnerGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { orgOwnerGrantKeys } from "../query-keys"; -import type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations } from "../../orm/input-types"; +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 { orgOwnerGrantKeys } from '../query-keys'; +import type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgOwnerGrantQueryKey = orgOwnerGrantKeys.detail; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { data, isLoading } = useOrgOwnerGrantQuery({ @@ -26,38 +26,52 @@ export const orgOwnerGrantQueryKey = orgOwnerGrantKeys.detail; * }); * ``` */ -export function useOrgOwnerGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgOwnerGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgOwnerGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgOwnerGrantQuery< + S extends OrgOwnerGrantSelect, + TData = { + orgOwnerGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgOwnerGrantSelect>; + } & Omit< + UseQueryOptions< + { + orgOwnerGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgOwnerGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgOwnerGrantKeys.detail(params.id), - queryFn: () => getClient().orgOwnerGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgOwnerGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Records of ownership transfers and grants between members - * + * * @example * ```ts * const data = await fetchOrgOwnerGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgOwnerGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgOwnerGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgOwnerGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Records of ownership transfers and grants between members - * + * * @example * ```ts * await prefetchOrgOwnerGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgOwnerGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgOwnerGrantSelect>; -}): Promise; -export async function prefetchOrgOwnerGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgOwnerGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgOwnerGrantSelect>; + } +): Promise; +export async function prefetchOrgOwnerGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgOwnerGrantKeys.detail(params.id), - queryFn: () => getClient().orgOwnerGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgOwnerGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgOwnerGrantsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgOwnerGrantsQuery.ts index 32f1c52132..5f22b3f8af 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgOwnerGrantsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgOwnerGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgOwnerGrantKeys } from "../query-keys"; -import type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations, OrgOwnerGrantFilter, OrgOwnerGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgOwnerGrantSelect, OrgOwnerGrantWithRelations, OrgOwnerGrantFilter, OrgOwnerGrantOrderBy } from "../../orm/input-types"; +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 { orgOwnerGrantKeys } from '../query-keys'; +import type { + OrgOwnerGrantSelect, + OrgOwnerGrantWithRelations, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgOwnerGrantSelect, + OrgOwnerGrantWithRelations, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgOwnerGrantsQueryKey = orgOwnerGrantKeys.list; /** * Records of ownership transfers and grants between members - * + * * @example * ```tsx * const { data, isLoading } = useOrgOwnerGrantsQuery({ @@ -30,33 +45,49 @@ export const orgOwnerGrantsQueryKey = orgOwnerGrantKeys.list; * }); * ``` */ -export function useOrgOwnerGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgOwnerGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgOwnerGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgOwnerGrantsQuery< + S extends OrgOwnerGrantSelect, + TData = { + orgOwnerGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgOwnerGrantSelect>; + } & Omit< + UseQueryOptions< + { + orgOwnerGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgOwnerGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgOwnerGrantSelect, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgOwnerGrantKeys.list(args), queryFn: () => getClient().orgOwnerGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Records of ownership transfers and grants between members - * + * * @example * ```ts * const data = await fetchOrgOwnerGrantsQuery({ @@ -70,35 +101,51 @@ export function useOrgOwnerGrantsQuery(params: { export async function fetchOrgOwnerGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgOwnerGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgOwnerGrantSelect>; }): Promise<{ orgOwnerGrants: ConnectionResult>; }>; export async function fetchOrgOwnerGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgOwnerGrantSelect, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy + >(params.selection); return getClient().orgOwnerGrant.findMany(args).unwrap(); } /** * Records of ownership transfers and grants between members - * + * * @example * ```ts * await prefetchOrgOwnerGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgOwnerGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgOwnerGrantSelect>; -}): Promise; -export async function prefetchOrgOwnerGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgOwnerGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgOwnerGrantSelect>; + } +): Promise; +export async function prefetchOrgOwnerGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + OrgOwnerGrantSelect, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgOwnerGrantKeys.list(args), - queryFn: () => getClient().orgOwnerGrant.findMany(args).unwrap() + queryFn: () => getClient().orgOwnerGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultGrantQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultGrantQuery.ts index 505ab0f72f..a2cec4a441 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultGrantQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultGrantQuery.ts @@ -4,20 +4,26 @@ * 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 { orgPermissionDefaultGrantKeys } from "../query-keys"; -import type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations } from "../../orm/input-types"; +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 { orgPermissionDefaultGrantKeys } from '../query-keys'; +import type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionDefaultGrantQueryKey = orgPermissionDefaultGrantKeys.detail; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionDefaultGrantQuery({ @@ -26,38 +32,55 @@ export const orgPermissionDefaultGrantQueryKey = orgPermissionDefaultGrantKeys.d * }); * ``` */ -export function useOrgPermissionDefaultGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgPermissionDefaultGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionDefaultGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgPermissionDefaultGrantQuery< + S extends OrgPermissionDefaultGrantSelect, + TData = { + orgPermissionDefaultGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgPermissionDefaultGrantSelect>; + } & Omit< + UseQueryOptions< + { + orgPermissionDefaultGrant: InferSelectResult< + OrgPermissionDefaultGrantWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionDefaultGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgPermissionDefaultGrantKeys.detail(params.id), - queryFn: () => getClient().orgPermissionDefaultGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgPermissionDefaultGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```ts * const data = await fetchOrgPermissionDefaultGrantQuery({ @@ -66,7 +89,9 @@ export function useOrgPermissionDefaultGrantQuery(params: { * }); * ``` */ -export async function fetchOrgPermissionDefaultGrantQuery(params: { +export async function fetchOrgPermissionDefaultGrantQuery< + S extends OrgPermissionDefaultGrantSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +104,48 @@ export async function fetchOrgPermissionDefaultGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgPermissionDefaultGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgPermissionDefaultGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```ts * await prefetchOrgPermissionDefaultGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgPermissionDefaultGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgPermissionDefaultGrantSelect>; -}): Promise; -export async function prefetchOrgPermissionDefaultGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgPermissionDefaultGrantQuery< + S extends OrgPermissionDefaultGrantSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgPermissionDefaultGrantSelect>; + } +): Promise; +export async function prefetchOrgPermissionDefaultGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgPermissionDefaultGrantKeys.detail(params.id), - queryFn: () => getClient().orgPermissionDefaultGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgPermissionDefaultGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultGrantsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultGrantsQuery.ts index eadc4938eb..606103b3e7 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultGrantsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgPermissionDefaultGrantKeys } from "../query-keys"; -import type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations, OrgPermissionDefaultGrantFilter, OrgPermissionDefaultGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantWithRelations, OrgPermissionDefaultGrantFilter, OrgPermissionDefaultGrantOrderBy } from "../../orm/input-types"; +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 { orgPermissionDefaultGrantKeys } from '../query-keys'; +import type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantWithRelations, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionDefaultGrantsQueryKey = orgPermissionDefaultGrantKeys.list; /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionDefaultGrantsQuery({ @@ -30,33 +45,60 @@ export const orgPermissionDefaultGrantsQueryKey = orgPermissionDefaultGrantKeys. * }); * ``` */ -export function useOrgPermissionDefaultGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionDefaultGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgPermissionDefaultGrantsQuery< + S extends OrgPermissionDefaultGrantSelect, + TData = { + orgPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultGrantSelect>; + } & Omit< + UseQueryOptions< + { + orgPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionDefaultGrantsQuery( + params: { + selection: ListSelectionConfig< + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgPermissionDefaultGrantKeys.list(args), queryFn: () => getClient().orgPermissionDefaultGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```ts * const data = await fetchOrgPermissionDefaultGrantsQuery({ @@ -67,38 +109,74 @@ export function useOrgPermissionDefaultGrantsQuery(params: { * }); * ``` */ -export async function fetchOrgPermissionDefaultGrantsQuery(params: { +export async function fetchOrgPermissionDefaultGrantsQuery< + S extends OrgPermissionDefaultGrantSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultGrantSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultGrantSelect>; }): Promise<{ - orgPermissionDefaultGrants: ConnectionResult>; + orgPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; }>; export async function fetchOrgPermissionDefaultGrantsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy + >(params.selection); return getClient().orgPermissionDefaultGrant.findMany(args).unwrap(); } /** * Audit log of permission additions and removals from the defaults bitmask - * + * * @example * ```ts * await prefetchOrgPermissionDefaultGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgPermissionDefaultGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultGrantSelect>; -}): Promise; -export async function prefetchOrgPermissionDefaultGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgPermissionDefaultGrantsQuery< + S extends OrgPermissionDefaultGrantSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultGrantSelect>; + } +): Promise; +export async function prefetchOrgPermissionDefaultGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgPermissionDefaultGrantKeys.list(args), - queryFn: () => getClient().orgPermissionDefaultGrant.findMany(args).unwrap() + queryFn: () => getClient().orgPermissionDefaultGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultPermissionQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultPermissionQuery.ts index 43beb70a88..a8d75d8141 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultPermissionQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultPermissionQuery.ts @@ -4,20 +4,26 @@ * 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 { orgPermissionDefaultPermissionKeys } from "../query-keys"; -import type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations } from "../../orm/input-types"; +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 { orgPermissionDefaultPermissionKeys } from '../query-keys'; +import type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionDefaultPermissionQueryKey = orgPermissionDefaultPermissionKeys.detail; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionDefaultPermissionQuery({ @@ -26,38 +32,58 @@ export const orgPermissionDefaultPermissionQueryKey = orgPermissionDefaultPermis * }); * ``` */ -export function useOrgPermissionDefaultPermissionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionDefaultPermissionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgPermissionDefaultPermissionQuery< + S extends OrgPermissionDefaultPermissionSelect, + TData = { + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; + } & Omit< + UseQueryOptions< + { + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionDefaultPermissionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgPermissionDefaultPermissionKeys.detail(params.id), - queryFn: () => getClient().orgPermissionDefaultPermission.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgPermissionDefaultPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```ts * const data = await fetchOrgPermissionDefaultPermissionQuery({ @@ -66,48 +92,66 @@ export function useOrgPermissionDefaultPermissionQuery(params: { * }); * ``` */ -export async function fetchOrgPermissionDefaultPermissionQuery(params: { +export async function fetchOrgPermissionDefaultPermissionQuery< + S extends OrgPermissionDefaultPermissionSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; }): Promise<{ - orgPermissionDefaultPermission: InferSelectResult | null; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; }>; export async function fetchOrgPermissionDefaultPermissionQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgPermissionDefaultPermission.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgPermissionDefaultPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```ts * await prefetchOrgPermissionDefaultPermissionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgPermissionDefaultPermissionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; -}): Promise; -export async function prefetchOrgPermissionDefaultPermissionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgPermissionDefaultPermissionQuery< + S extends OrgPermissionDefaultPermissionSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; + } +): Promise; +export async function prefetchOrgPermissionDefaultPermissionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgPermissionDefaultPermissionKeys.detail(params.id), - queryFn: () => getClient().orgPermissionDefaultPermission.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgPermissionDefaultPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultPermissionsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultPermissionsQuery.ts index 353fd22e9a..331c112c08 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultPermissionsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultPermissionsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgPermissionDefaultPermissionKeys } from "../query-keys"; -import type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations, OrgPermissionDefaultPermissionFilter, OrgPermissionDefaultPermissionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionWithRelations, OrgPermissionDefaultPermissionFilter, OrgPermissionDefaultPermissionOrderBy } from "../../orm/input-types"; +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 { orgPermissionDefaultPermissionKeys } from '../query-keys'; +import type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionWithRelations, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionDefaultPermissionsQueryKey = orgPermissionDefaultPermissionKeys.list; /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionDefaultPermissionsQuery({ @@ -30,33 +45,64 @@ export const orgPermissionDefaultPermissionsQueryKey = orgPermissionDefaultPermi * }); * ``` */ -export function useOrgPermissionDefaultPermissionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionDefaultPermissionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgPermissionDefaultPermissionsQuery< + S extends OrgPermissionDefaultPermissionSelect, + TData = { + orgPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultPermissionSelect>; + } & Omit< + UseQueryOptions< + { + orgPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionDefaultPermissionsQuery( + params: { + selection: ListSelectionConfig< + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgPermissionDefaultPermissionKeys.list(args), queryFn: () => getClient().orgPermissionDefaultPermission.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```ts * const data = await fetchOrgPermissionDefaultPermissionsQuery({ @@ -67,38 +113,82 @@ export function useOrgPermissionDefaultPermissionsQuery(params: { * }); * ``` */ -export async function fetchOrgPermissionDefaultPermissionsQuery(params: { +export async function fetchOrgPermissionDefaultPermissionsQuery< + S extends OrgPermissionDefaultPermissionSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; + } & Omit< + ListSelectionConfig< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultPermissionSelect>; }): Promise<{ - orgPermissionDefaultPermissions: ConnectionResult>; + orgPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; }>; export async function fetchOrgPermissionDefaultPermissionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >(params.selection); return getClient().orgPermissionDefaultPermission.findMany(args).unwrap(); } /** * Join table linking permission defaults to individual permissions; recompute trigger rebuilds the defaults bitmask - * + * * @example * ```ts * await prefetchOrgPermissionDefaultPermissionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgPermissionDefaultPermissionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultPermissionSelect>; -}): Promise; -export async function prefetchOrgPermissionDefaultPermissionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgPermissionDefaultPermissionsQuery< + S extends OrgPermissionDefaultPermissionSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultPermissionSelect>; + } +): Promise; +export async function prefetchOrgPermissionDefaultPermissionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgPermissionDefaultPermissionKeys.list(args), - queryFn: () => getClient().orgPermissionDefaultPermission.findMany(args).unwrap() + queryFn: () => getClient().orgPermissionDefaultPermission.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultQuery.ts index 9634093caa..9dc118fc7c 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultQuery.ts @@ -4,20 +4,26 @@ * 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 { orgPermissionDefaultKeys } from "../query-keys"; -import type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations } from "../../orm/input-types"; +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 { orgPermissionDefaultKeys } from '../query-keys'; +import type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionDefaultQueryKey = orgPermissionDefaultKeys.detail; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionDefaultQuery({ @@ -26,38 +32,52 @@ export const orgPermissionDefaultQueryKey = orgPermissionDefaultKeys.detail; * }); * ``` */ -export function useOrgPermissionDefaultQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgPermissionDefaultSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionDefaultQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgPermissionDefaultQuery< + S extends OrgPermissionDefaultSelect, + TData = { + orgPermissionDefault: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgPermissionDefaultSelect>; + } & Omit< + UseQueryOptions< + { + orgPermissionDefault: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionDefaultQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgPermissionDefaultKeys.detail(params.id), - queryFn: () => getClient().orgPermissionDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgPermissionDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```ts * const data = await fetchOrgPermissionDefaultQuery({ @@ -79,35 +99,46 @@ export async function fetchOrgPermissionDefaultQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgPermissionDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgPermissionDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```ts * await prefetchOrgPermissionDefaultQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgPermissionDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgPermissionDefaultSelect>; -}): Promise; -export async function prefetchOrgPermissionDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgPermissionDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgPermissionDefaultSelect>; + } +): Promise; +export async function prefetchOrgPermissionDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgPermissionDefaultKeys.detail(params.id), - queryFn: () => getClient().orgPermissionDefault.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgPermissionDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultsQuery.ts index 02463664a3..8bbff22406 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionDefaultsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgPermissionDefaultKeys } from "../query-keys"; -import type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations, OrgPermissionDefaultFilter, OrgPermissionDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionDefaultSelect, OrgPermissionDefaultWithRelations, OrgPermissionDefaultFilter, OrgPermissionDefaultOrderBy } from "../../orm/input-types"; +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 { orgPermissionDefaultKeys } from '../query-keys'; +import type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgPermissionDefaultSelect, + OrgPermissionDefaultWithRelations, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionDefaultsQueryKey = orgPermissionDefaultKeys.list; /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionDefaultsQuery({ @@ -30,33 +45,60 @@ export const orgPermissionDefaultsQueryKey = orgPermissionDefaultKeys.list; * }); * ``` */ -export function useOrgPermissionDefaultsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionDefaultsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgPermissionDefaultsQuery< + S extends OrgPermissionDefaultSelect, + TData = { + orgPermissionDefaults: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultSelect>; + } & Omit< + UseQueryOptions< + { + orgPermissionDefaults: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionDefaultsQuery( + params: { + selection: ListSelectionConfig< + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgPermissionDefaultKeys.list(args), queryFn: () => getClient().orgPermissionDefault.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```ts * const data = await fetchOrgPermissionDefaultsQuery({ @@ -67,38 +109,70 @@ export function useOrgPermissionDefaultsQuery(params: { * }); * ``` */ -export async function fetchOrgPermissionDefaultsQuery(params: { +export async function fetchOrgPermissionDefaultsQuery< + S extends OrgPermissionDefaultSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultSelect>; }): Promise<{ orgPermissionDefaults: ConnectionResult>; }>; export async function fetchOrgPermissionDefaultsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy + >(params.selection); return getClient().orgPermissionDefault.findMany(args).unwrap(); } /** * Stores the default permission bitmask assigned to new members upon joining - * + * * @example * ```ts * await prefetchOrgPermissionDefaultsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgPermissionDefaultsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionDefaultSelect>; -}): Promise; -export async function prefetchOrgPermissionDefaultsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgPermissionDefaultsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgPermissionDefaultSelect>; + } +): Promise; +export async function prefetchOrgPermissionDefaultsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgPermissionDefaultKeys.list(args), - queryFn: () => getClient().orgPermissionDefault.findMany(args).unwrap() + queryFn: () => getClient().orgPermissionDefault.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionQuery.ts index dcd0a0461c..4407aaeddb 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionQuery.ts @@ -4,20 +4,20 @@ * 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 { orgPermissionKeys } from "../query-keys"; -import type { OrgPermissionSelect, OrgPermissionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionSelect, OrgPermissionWithRelations } from "../../orm/input-types"; +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 { orgPermissionKeys } from '../query-keys'; +import type { OrgPermissionSelect, OrgPermissionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgPermissionSelect, OrgPermissionWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionQueryKey = orgPermissionKeys.detail; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionQuery({ @@ -26,38 +26,52 @@ export const orgPermissionQueryKey = orgPermissionKeys.detail; * }); * ``` */ -export function useOrgPermissionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgPermissionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgPermissionQuery< + S extends OrgPermissionSelect, + TData = { + orgPermission: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgPermissionSelect>; + } & Omit< + UseQueryOptions< + { + orgPermission: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgPermissionKeys.detail(params.id), - queryFn: () => getClient().orgPermission.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```ts * const data = await fetchOrgPermissionQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgPermissionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgPermission.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```ts * await prefetchOrgPermissionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgPermissionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgPermissionSelect>; -}): Promise; -export async function prefetchOrgPermissionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgPermissionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgPermissionSelect>; + } +): Promise; +export async function prefetchOrgPermissionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgPermissionKeys.detail(params.id), - queryFn: () => getClient().orgPermission.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgPermission.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetByMaskQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetByMaskQuery.ts index 6662345ec6..db38f6b5eb 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetByMaskQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetByMaskQuery.ts @@ -4,58 +4,77 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { OrgPermissionsGetByMaskVariables } from "../../orm/query"; -import type { OrgPermissionConnection } from "../../orm/input-types"; -export type { OrgPermissionsGetByMaskVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { OrgPermissionsGetByMaskVariables } from '../../orm/query'; +import type { OrgPermissionConnection } from '../../orm/input-types'; +export type { OrgPermissionsGetByMaskVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionsGetByMaskQueryKey = customQueryKeys.orgPermissionsGetByMask; /** * Reads and enables pagination through a set of `OrgPermission`. - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionsGetByMaskQuery({ variables: { after, first, mask, offset } }); - * + * * if (data?.orgPermissionsGetByMask) { * console.log(data.orgPermissionsGetByMask); * } * ``` */ -export function useOrgPermissionsGetByMaskQuery(params?: { - variables?: OrgPermissionsGetByMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionsGetByMaskQuery(params?: { - variables?: OrgPermissionsGetByMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useOrgPermissionsGetByMaskQuery< + TData = { + orgPermissionsGetByMask: OrgPermissionConnection | null; + }, +>( + params?: { + variables?: OrgPermissionsGetByMaskVariables; + } & Omit< + UseQueryOptions< + { + orgPermissionsGetByMask: OrgPermissionConnection | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionsGetByMaskQuery< + TData = { + orgPermissionsGetByMask: OrgPermissionConnection | null; + }, +>( + params?: { + variables?: OrgPermissionsGetByMaskVariables; + } & Omit< + UseQueryOptions< + { + orgPermissionsGetByMask: OrgPermissionConnection | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: orgPermissionsGetByMaskQueryKey(variables), queryFn: () => getClient().query.orgPermissionsGetByMask(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch orgPermissionsGetByMask without React hooks - * + * * @example * ```ts * const data = await fetchOrgPermissionsGetByMaskQuery({ variables: { after, first, mask, offset } }); @@ -69,18 +88,21 @@ export async function fetchOrgPermissionsGetByMaskQuery(params?: { } /** * Prefetch orgPermissionsGetByMask for SSR or cache warming - * + * * @example * ```ts * await prefetchOrgPermissionsGetByMaskQuery(queryClient, { variables: { after, first, mask, offset } }); * ``` */ -export async function prefetchOrgPermissionsGetByMaskQuery(queryClient: QueryClient, params?: { - variables?: OrgPermissionsGetByMaskVariables; -}): Promise { +export async function prefetchOrgPermissionsGetByMaskQuery( + queryClient: QueryClient, + params?: { + variables?: OrgPermissionsGetByMaskVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: orgPermissionsGetByMaskQueryKey(variables), - queryFn: () => getClient().query.orgPermissionsGetByMask(variables).unwrap() + queryFn: () => getClient().query.orgPermissionsGetByMask(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetMaskByNamesQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetMaskByNamesQuery.ts index 65e75257cc..99199bceeb 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetMaskByNamesQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetMaskByNamesQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { OrgPermissionsGetMaskByNamesVariables } from "../../orm/query"; -export type { OrgPermissionsGetMaskByNamesVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { OrgPermissionsGetMaskByNamesVariables } from '../../orm/query'; +export type { OrgPermissionsGetMaskByNamesVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionsGetMaskByNamesQueryKey = customQueryKeys.orgPermissionsGetMaskByNames; /** * Query hook for orgPermissionsGetMaskByNames - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionsGetMaskByNamesQuery({ variables: { names } }); - * + * * if (data?.orgPermissionsGetMaskByNames) { * console.log(data.orgPermissionsGetMaskByNames); * } * ``` */ -export function useOrgPermissionsGetMaskByNamesQuery(params?: { - variables?: OrgPermissionsGetMaskByNamesVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionsGetMaskByNamesQuery(params?: { - variables?: OrgPermissionsGetMaskByNamesVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useOrgPermissionsGetMaskByNamesQuery< + TData = { + orgPermissionsGetMaskByNames: string | null; + }, +>( + params?: { + variables?: OrgPermissionsGetMaskByNamesVariables; + } & Omit< + UseQueryOptions< + { + orgPermissionsGetMaskByNames: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionsGetMaskByNamesQuery< + TData = { + orgPermissionsGetMaskByNames: string | null; + }, +>( + params?: { + variables?: OrgPermissionsGetMaskByNamesVariables; + } & Omit< + UseQueryOptions< + { + orgPermissionsGetMaskByNames: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: orgPermissionsGetMaskByNamesQueryKey(variables), queryFn: () => getClient().query.orgPermissionsGetMaskByNames(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch orgPermissionsGetMaskByNames without React hooks - * + * * @example * ```ts * const data = await fetchOrgPermissionsGetMaskByNamesQuery({ variables: { names } }); @@ -68,18 +87,21 @@ export async function fetchOrgPermissionsGetMaskByNamesQuery(params?: { } /** * Prefetch orgPermissionsGetMaskByNames for SSR or cache warming - * + * * @example * ```ts * await prefetchOrgPermissionsGetMaskByNamesQuery(queryClient, { variables: { names } }); * ``` */ -export async function prefetchOrgPermissionsGetMaskByNamesQuery(queryClient: QueryClient, params?: { - variables?: OrgPermissionsGetMaskByNamesVariables; -}): Promise { +export async function prefetchOrgPermissionsGetMaskByNamesQuery( + queryClient: QueryClient, + params?: { + variables?: OrgPermissionsGetMaskByNamesVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: orgPermissionsGetMaskByNamesQueryKey(variables), - queryFn: () => getClient().query.orgPermissionsGetMaskByNames(variables).unwrap() + queryFn: () => getClient().query.orgPermissionsGetMaskByNames(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetMaskQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetMaskQuery.ts index 10498b5ab8..dad45181bf 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetMaskQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetMaskQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { OrgPermissionsGetMaskVariables } from "../../orm/query"; -export type { OrgPermissionsGetMaskVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { OrgPermissionsGetMaskVariables } from '../../orm/query'; +export type { OrgPermissionsGetMaskVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionsGetMaskQueryKey = customQueryKeys.orgPermissionsGetMask; /** * Query hook for orgPermissionsGetMask - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionsGetMaskQuery({ variables: { ids } }); - * + * * if (data?.orgPermissionsGetMask) { * console.log(data.orgPermissionsGetMask); * } * ``` */ -export function useOrgPermissionsGetMaskQuery(params?: { - variables?: OrgPermissionsGetMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionsGetMaskQuery(params?: { - variables?: OrgPermissionsGetMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useOrgPermissionsGetMaskQuery< + TData = { + orgPermissionsGetMask: string | null; + }, +>( + params?: { + variables?: OrgPermissionsGetMaskVariables; + } & Omit< + UseQueryOptions< + { + orgPermissionsGetMask: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionsGetMaskQuery< + TData = { + orgPermissionsGetMask: string | null; + }, +>( + params?: { + variables?: OrgPermissionsGetMaskVariables; + } & Omit< + UseQueryOptions< + { + orgPermissionsGetMask: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: orgPermissionsGetMaskQueryKey(variables), queryFn: () => getClient().query.orgPermissionsGetMask(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch orgPermissionsGetMask without React hooks - * + * * @example * ```ts * const data = await fetchOrgPermissionsGetMaskQuery({ variables: { ids } }); @@ -68,18 +87,21 @@ export async function fetchOrgPermissionsGetMaskQuery(params?: { } /** * Prefetch orgPermissionsGetMask for SSR or cache warming - * + * * @example * ```ts * await prefetchOrgPermissionsGetMaskQuery(queryClient, { variables: { ids } }); * ``` */ -export async function prefetchOrgPermissionsGetMaskQuery(queryClient: QueryClient, params?: { - variables?: OrgPermissionsGetMaskVariables; -}): Promise { +export async function prefetchOrgPermissionsGetMaskQuery( + queryClient: QueryClient, + params?: { + variables?: OrgPermissionsGetMaskVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: orgPermissionsGetMaskQueryKey(variables), - queryFn: () => getClient().query.orgPermissionsGetMask(variables).unwrap() + queryFn: () => getClient().query.orgPermissionsGetMask(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetPaddedMaskQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetPaddedMaskQuery.ts index 0b6889716a..4b4f80e725 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetPaddedMaskQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsGetPaddedMaskQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { OrgPermissionsGetPaddedMaskVariables } from "../../orm/query"; -export type { OrgPermissionsGetPaddedMaskVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { OrgPermissionsGetPaddedMaskVariables } from '../../orm/query'; +export type { OrgPermissionsGetPaddedMaskVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionsGetPaddedMaskQueryKey = customQueryKeys.orgPermissionsGetPaddedMask; /** * Query hook for orgPermissionsGetPaddedMask - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionsGetPaddedMaskQuery({ variables: { mask } }); - * + * * if (data?.orgPermissionsGetPaddedMask) { * console.log(data.orgPermissionsGetPaddedMask); * } * ``` */ -export function useOrgPermissionsGetPaddedMaskQuery(params?: { - variables?: OrgPermissionsGetPaddedMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionsGetPaddedMaskQuery(params?: { - variables?: OrgPermissionsGetPaddedMaskVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useOrgPermissionsGetPaddedMaskQuery< + TData = { + orgPermissionsGetPaddedMask: string | null; + }, +>( + params?: { + variables?: OrgPermissionsGetPaddedMaskVariables; + } & Omit< + UseQueryOptions< + { + orgPermissionsGetPaddedMask: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionsGetPaddedMaskQuery< + TData = { + orgPermissionsGetPaddedMask: string | null; + }, +>( + params?: { + variables?: OrgPermissionsGetPaddedMaskVariables; + } & Omit< + UseQueryOptions< + { + orgPermissionsGetPaddedMask: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: orgPermissionsGetPaddedMaskQueryKey(variables), queryFn: () => getClient().query.orgPermissionsGetPaddedMask(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch orgPermissionsGetPaddedMask without React hooks - * + * * @example * ```ts * const data = await fetchOrgPermissionsGetPaddedMaskQuery({ variables: { mask } }); @@ -68,18 +87,21 @@ export async function fetchOrgPermissionsGetPaddedMaskQuery(params?: { } /** * Prefetch orgPermissionsGetPaddedMask for SSR or cache warming - * + * * @example * ```ts * await prefetchOrgPermissionsGetPaddedMaskQuery(queryClient, { variables: { mask } }); * ``` */ -export async function prefetchOrgPermissionsGetPaddedMaskQuery(queryClient: QueryClient, params?: { - variables?: OrgPermissionsGetPaddedMaskVariables; -}): Promise { +export async function prefetchOrgPermissionsGetPaddedMaskQuery( + queryClient: QueryClient, + params?: { + variables?: OrgPermissionsGetPaddedMaskVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: orgPermissionsGetPaddedMaskQueryKey(variables), - queryFn: () => getClient().query.orgPermissionsGetPaddedMask(variables).unwrap() + queryFn: () => getClient().query.orgPermissionsGetPaddedMask(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsQuery.ts b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsQuery.ts index c663a05f3d..b5272fe6fe 100644 --- a/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsQuery.ts +++ b/sdk/constructive-react/src/admin/hooks/queries/useOrgPermissionsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgPermissionKeys } from "../query-keys"; -import type { OrgPermissionSelect, OrgPermissionWithRelations, OrgPermissionFilter, OrgPermissionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgPermissionSelect, OrgPermissionWithRelations, OrgPermissionFilter, OrgPermissionOrderBy } from "../../orm/input-types"; +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 { orgPermissionKeys } from '../query-keys'; +import type { + OrgPermissionSelect, + OrgPermissionWithRelations, + OrgPermissionFilter, + OrgPermissionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgPermissionSelect, + OrgPermissionWithRelations, + OrgPermissionFilter, + OrgPermissionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgPermissionsQueryKey = orgPermissionKeys.list; /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```tsx * const { data, isLoading } = useOrgPermissionsQuery({ @@ -30,33 +45,49 @@ export const orgPermissionsQueryKey = orgPermissionKeys.list; * }); * ``` */ -export function useOrgPermissionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgPermissionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgPermissionsQuery< + S extends OrgPermissionSelect, + TData = { + orgPermissions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgPermissionSelect>; + } & Omit< + UseQueryOptions< + { + orgPermissions: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgPermissionsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgPermissionSelect, + OrgPermissionFilter, + OrgPermissionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgPermissionKeys.list(args), queryFn: () => getClient().orgPermission.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```ts * const data = await fetchOrgPermissionsQuery({ @@ -70,35 +101,51 @@ export function useOrgPermissionsQuery(params: { export async function fetchOrgPermissionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgPermissionSelect>; }): Promise<{ orgPermissions: ConnectionResult>; }>; export async function fetchOrgPermissionsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgPermissionSelect, + OrgPermissionFilter, + OrgPermissionOrderBy + >(params.selection); return getClient().orgPermission.findMany(args).unwrap(); } /** * Defines available permissions as named bits within a bitmask, used by the RBAC system for access control - * + * * @example * ```ts * await prefetchOrgPermissionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgPermissionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgPermissionSelect>; -}): Promise; -export async function prefetchOrgPermissionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgPermissionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgPermissionSelect>; + } +): Promise; +export async function prefetchOrgPermissionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + OrgPermissionSelect, + OrgPermissionFilter, + OrgPermissionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgPermissionKeys.list(args), - queryFn: () => getClient().orgPermission.findMany(args).unwrap() + queryFn: () => getClient().orgPermission.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/admin/hooks/query-keys.ts b/sdk/constructive-react/src/admin/hooks/query-keys.ts index 9f06eb90d8..099fbc4c29 100644 --- a/sdk/constructive-react/src/admin/hooks/query-keys.ts +++ b/sdk/constructive-react/src/admin/hooks/query-keys.ts @@ -20,186 +20,244 @@ // ============================================================================ export const appAdminGrantKeys = { - /** All appAdminGrant queries */all: ["appadmingrant"] as const, - /** List query keys */lists: () => [...appAdminGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appAdminGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appAdminGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appAdminGrantKeys.details(), id] as const + /** All appAdminGrant queries */ all: ['appadmingrant'] as const, + /** List query keys */ lists: () => [...appAdminGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appAdminGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appAdminGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appAdminGrantKeys.details(), id] as const, } as const; export const appClaimedInviteKeys = { - /** All appClaimedInvite queries */all: ["appclaimedinvite"] as const, - /** List query keys */lists: () => [...appClaimedInviteKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appClaimedInviteKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appClaimedInviteKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appClaimedInviteKeys.details(), id] as const + /** All appClaimedInvite queries */ all: ['appclaimedinvite'] as const, + /** List query keys */ lists: () => [...appClaimedInviteKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appClaimedInviteKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appClaimedInviteKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appClaimedInviteKeys.details(), id] as const, } as const; export const appGrantKeys = { - /** All appGrant queries */all: ["appgrant"] as const, - /** List query keys */lists: () => [...appGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appGrantKeys.details(), id] as const + /** All appGrant queries */ all: ['appgrant'] as const, + /** List query keys */ lists: () => [...appGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appGrantKeys.details(), id] as const, } as const; export const appInviteKeys = { - /** All appInvite queries */all: ["appinvite"] as const, - /** List query keys */lists: () => [...appInviteKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appInviteKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appInviteKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appInviteKeys.details(), id] as const + /** All appInvite queries */ all: ['appinvite'] as const, + /** List query keys */ lists: () => [...appInviteKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appInviteKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appInviteKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appInviteKeys.details(), id] as const, } as const; export const appMembershipKeys = { - /** All appMembership queries */all: ["appmembership"] as const, - /** List query keys */lists: () => [...appMembershipKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appMembershipKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appMembershipKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appMembershipKeys.details(), id] as const + /** All appMembership queries */ all: ['appmembership'] as const, + /** List query keys */ lists: () => [...appMembershipKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appMembershipKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appMembershipKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appMembershipKeys.details(), id] as const, } as const; export const appMembershipDefaultKeys = { - /** All appMembershipDefault queries */all: ["appmembershipdefault"] as const, - /** List query keys */lists: () => [...appMembershipDefaultKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appMembershipDefaultKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appMembershipDefaultKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appMembershipDefaultKeys.details(), id] as const + /** All appMembershipDefault queries */ all: ['appmembershipdefault'] as const, + /** List query keys */ lists: () => [...appMembershipDefaultKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appMembershipDefaultKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appMembershipDefaultKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appMembershipDefaultKeys.details(), id] as const, } as const; export const appOwnerGrantKeys = { - /** All appOwnerGrant queries */all: ["appownergrant"] as const, - /** List query keys */lists: () => [...appOwnerGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appOwnerGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appOwnerGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appOwnerGrantKeys.details(), id] as const + /** All appOwnerGrant queries */ all: ['appownergrant'] as const, + /** List query keys */ lists: () => [...appOwnerGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appOwnerGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appOwnerGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appOwnerGrantKeys.details(), id] as const, } as const; export const appPermissionKeys = { - /** All appPermission queries */all: ["apppermission"] as const, - /** List query keys */lists: () => [...appPermissionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appPermissionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appPermissionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appPermissionKeys.details(), id] as const + /** All appPermission queries */ all: ['apppermission'] as const, + /** List query keys */ lists: () => [...appPermissionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appPermissionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appPermissionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appPermissionKeys.details(), id] as const, } as const; export const appPermissionDefaultKeys = { - /** All appPermissionDefault queries */all: ["apppermissiondefault"] as const, - /** List query keys */lists: () => [...appPermissionDefaultKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appPermissionDefaultKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appPermissionDefaultKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appPermissionDefaultKeys.details(), id] as const + /** All appPermissionDefault queries */ all: ['apppermissiondefault'] as const, + /** List query keys */ lists: () => [...appPermissionDefaultKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appPermissionDefaultKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appPermissionDefaultKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appPermissionDefaultKeys.details(), id] as const, } as const; export const appPermissionDefaultGrantKeys = { - /** All appPermissionDefaultGrant queries */all: ["apppermissiondefaultgrant"] as const, - /** List query keys */lists: () => [...appPermissionDefaultGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appPermissionDefaultGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appPermissionDefaultGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appPermissionDefaultGrantKeys.details(), id] as const + /** All appPermissionDefaultGrant queries */ all: ['apppermissiondefaultgrant'] as const, + /** List query keys */ lists: () => [...appPermissionDefaultGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appPermissionDefaultGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appPermissionDefaultGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appPermissionDefaultGrantKeys.details(), id] as const, } as const; export const appPermissionDefaultPermissionKeys = { - /** All appPermissionDefaultPermission queries */all: ["apppermissiondefaultpermission"] as const, - /** List query keys */lists: () => [...appPermissionDefaultPermissionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appPermissionDefaultPermissionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appPermissionDefaultPermissionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appPermissionDefaultPermissionKeys.details(), id] as const + /** All appPermissionDefaultPermission queries */ all: [ + 'apppermissiondefaultpermission', + ] as const, + /** List query keys */ lists: () => [...appPermissionDefaultPermissionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appPermissionDefaultPermissionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...appPermissionDefaultPermissionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appPermissionDefaultPermissionKeys.details(), id] as const, } as const; export const membershipTypeKeys = { - /** All membershipType queries */all: ["membershiptype"] as const, - /** List query keys */lists: () => [...membershipTypeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...membershipTypeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...membershipTypeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...membershipTypeKeys.details(), id] as const + /** All membershipType queries */ all: ['membershiptype'] as const, + /** List query keys */ lists: () => [...membershipTypeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...membershipTypeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...membershipTypeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...membershipTypeKeys.details(), id] as const, } as const; export const orgAdminGrantKeys = { - /** All orgAdminGrant queries */all: ["orgadmingrant"] as const, - /** List query keys */lists: () => [...orgAdminGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgAdminGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgAdminGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgAdminGrantKeys.details(), id] as const + /** All orgAdminGrant queries */ all: ['orgadmingrant'] as const, + /** List query keys */ lists: () => [...orgAdminGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgAdminGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgAdminGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgAdminGrantKeys.details(), id] as const, } as const; export const orgClaimedInviteKeys = { - /** All orgClaimedInvite queries */all: ["orgclaimedinvite"] as const, - /** List query keys */lists: () => [...orgClaimedInviteKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgClaimedInviteKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgClaimedInviteKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgClaimedInviteKeys.details(), id] as const + /** All orgClaimedInvite queries */ all: ['orgclaimedinvite'] as const, + /** List query keys */ lists: () => [...orgClaimedInviteKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgClaimedInviteKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgClaimedInviteKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgClaimedInviteKeys.details(), id] as const, } as const; export const orgGrantKeys = { - /** All orgGrant queries */all: ["orggrant"] as const, - /** List query keys */lists: () => [...orgGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgGrantKeys.details(), id] as const + /** All orgGrant queries */ all: ['orggrant'] as const, + /** List query keys */ lists: () => [...orgGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgGrantKeys.details(), id] as const, } as const; export const orgInviteKeys = { - /** All orgInvite queries */all: ["orginvite"] as const, - /** List query keys */lists: () => [...orgInviteKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgInviteKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgInviteKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgInviteKeys.details(), id] as const + /** All orgInvite queries */ all: ['orginvite'] as const, + /** List query keys */ lists: () => [...orgInviteKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgInviteKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgInviteKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgInviteKeys.details(), id] as const, } as const; export const orgMemberKeys = { - /** All orgMember queries */all: ["orgmember"] as const, - /** List query keys */lists: () => [...orgMemberKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgMemberKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgMemberKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgMemberKeys.details(), id] as const + /** All orgMember queries */ all: ['orgmember'] as const, + /** List query keys */ lists: () => [...orgMemberKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgMemberKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgMemberKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgMemberKeys.details(), id] as const, } as const; export const orgMemberProfileKeys = { - /** All orgMemberProfile queries */all: ["orgmemberprofile"] as const, - /** List query keys */lists: () => [...orgMemberProfileKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgMemberProfileKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgMemberProfileKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgMemberProfileKeys.details(), id] as const + /** All orgMemberProfile queries */ all: ['orgmemberprofile'] as const, + /** List query keys */ lists: () => [...orgMemberProfileKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgMemberProfileKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgMemberProfileKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgMemberProfileKeys.details(), id] as const, } as const; export const orgMembershipKeys = { - /** All orgMembership queries */all: ["orgmembership"] as const, - /** List query keys */lists: () => [...orgMembershipKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgMembershipKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgMembershipKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgMembershipKeys.details(), id] as const + /** All orgMembership queries */ all: ['orgmembership'] as const, + /** List query keys */ lists: () => [...orgMembershipKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgMembershipKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgMembershipKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgMembershipKeys.details(), id] as const, } as const; export const orgMembershipDefaultKeys = { - /** All orgMembershipDefault queries */all: ["orgmembershipdefault"] as const, - /** List query keys */lists: () => [...orgMembershipDefaultKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgMembershipDefaultKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgMembershipDefaultKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgMembershipDefaultKeys.details(), id] as const + /** All orgMembershipDefault queries */ all: ['orgmembershipdefault'] as const, + /** List query keys */ lists: () => [...orgMembershipDefaultKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgMembershipDefaultKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgMembershipDefaultKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgMembershipDefaultKeys.details(), id] as const, } as const; export const orgMembershipSettingKeys = { - /** All orgMembershipSetting queries */all: ["orgmembershipsetting"] as const, - /** List query keys */lists: () => [...orgMembershipSettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgMembershipSettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgMembershipSettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgMembershipSettingKeys.details(), id] as const + /** All orgMembershipSetting queries */ all: ['orgmembershipsetting'] as const, + /** List query keys */ lists: () => [...orgMembershipSettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgMembershipSettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgMembershipSettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgMembershipSettingKeys.details(), id] as const, } as const; export const orgOwnerGrantKeys = { - /** All orgOwnerGrant queries */all: ["orgownergrant"] as const, - /** List query keys */lists: () => [...orgOwnerGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgOwnerGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgOwnerGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgOwnerGrantKeys.details(), id] as const + /** All orgOwnerGrant queries */ all: ['orgownergrant'] as const, + /** List query keys */ lists: () => [...orgOwnerGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgOwnerGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgOwnerGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgOwnerGrantKeys.details(), id] as const, } as const; export const orgPermissionKeys = { - /** All orgPermission queries */all: ["orgpermission"] as const, - /** List query keys */lists: () => [...orgPermissionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgPermissionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgPermissionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgPermissionKeys.details(), id] as const + /** All orgPermission queries */ all: ['orgpermission'] as const, + /** List query keys */ lists: () => [...orgPermissionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgPermissionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgPermissionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgPermissionKeys.details(), id] as const, } as const; export const orgPermissionDefaultKeys = { - /** All orgPermissionDefault queries */all: ["orgpermissiondefault"] as const, - /** List query keys */lists: () => [...orgPermissionDefaultKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgPermissionDefaultKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgPermissionDefaultKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgPermissionDefaultKeys.details(), id] as const + /** All orgPermissionDefault queries */ all: ['orgpermissiondefault'] as const, + /** List query keys */ lists: () => [...orgPermissionDefaultKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgPermissionDefaultKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgPermissionDefaultKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgPermissionDefaultKeys.details(), id] as const, } as const; export const orgPermissionDefaultGrantKeys = { - /** All orgPermissionDefaultGrant queries */all: ["orgpermissiondefaultgrant"] as const, - /** List query keys */lists: () => [...orgPermissionDefaultGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgPermissionDefaultGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgPermissionDefaultGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgPermissionDefaultGrantKeys.details(), id] as const + /** All orgPermissionDefaultGrant queries */ all: ['orgpermissiondefaultgrant'] as const, + /** List query keys */ lists: () => [...orgPermissionDefaultGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgPermissionDefaultGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgPermissionDefaultGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgPermissionDefaultGrantKeys.details(), id] as const, } as const; export const orgPermissionDefaultPermissionKeys = { - /** All orgPermissionDefaultPermission queries */all: ["orgpermissiondefaultpermission"] as const, - /** List query keys */lists: () => [...orgPermissionDefaultPermissionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgPermissionDefaultPermissionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgPermissionDefaultPermissionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgPermissionDefaultPermissionKeys.details(), id] as const + /** All orgPermissionDefaultPermission queries */ all: [ + 'orgpermissiondefaultpermission', + ] as const, + /** List query keys */ lists: () => [...orgPermissionDefaultPermissionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgPermissionDefaultPermissionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...orgPermissionDefaultPermissionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgPermissionDefaultPermissionKeys.details(), id] as const, } as const; // ============================================================================ @@ -207,14 +265,26 @@ export const orgPermissionDefaultPermissionKeys = { // ============================================================================ export const customQueryKeys = { - /** Query key for appPermissionsGetByMask */appPermissionsGetByMask: (variables?: object) => ["appPermissionsGetByMask", variables] as const, - /** Query key for appPermissionsGetMask */appPermissionsGetMask: (variables?: object) => ["appPermissionsGetMask", variables] as const, - /** Query key for appPermissionsGetMaskByNames */appPermissionsGetMaskByNames: (variables?: object) => ["appPermissionsGetMaskByNames", variables] as const, - /** Query key for appPermissionsGetPaddedMask */appPermissionsGetPaddedMask: (variables?: object) => ["appPermissionsGetPaddedMask", variables] as const, - /** Query key for orgPermissionsGetByMask */orgPermissionsGetByMask: (variables?: object) => ["orgPermissionsGetByMask", variables] as const, - /** Query key for orgPermissionsGetMask */orgPermissionsGetMask: (variables?: object) => ["orgPermissionsGetMask", variables] as const, - /** Query key for orgPermissionsGetMaskByNames */orgPermissionsGetMaskByNames: (variables?: object) => ["orgPermissionsGetMaskByNames", variables] as const, - /** Query key for orgPermissionsGetPaddedMask */orgPermissionsGetPaddedMask: (variables?: object) => ["orgPermissionsGetPaddedMask", variables] as const + /** Query key for appPermissionsGetByMask */ appPermissionsGetByMask: (variables?: object) => + ['appPermissionsGetByMask', variables] as const, + /** Query key for appPermissionsGetMask */ appPermissionsGetMask: (variables?: object) => + ['appPermissionsGetMask', variables] as const, + /** Query key for appPermissionsGetMaskByNames */ appPermissionsGetMaskByNames: ( + variables?: object + ) => ['appPermissionsGetMaskByNames', variables] as const, + /** Query key for appPermissionsGetPaddedMask */ appPermissionsGetPaddedMask: ( + variables?: object + ) => ['appPermissionsGetPaddedMask', variables] as const, + /** Query key for orgPermissionsGetByMask */ orgPermissionsGetByMask: (variables?: object) => + ['orgPermissionsGetByMask', variables] as const, + /** Query key for orgPermissionsGetMask */ orgPermissionsGetMask: (variables?: object) => + ['orgPermissionsGetMask', variables] as const, + /** Query key for orgPermissionsGetMaskByNames */ orgPermissionsGetMaskByNames: ( + variables?: object + ) => ['orgPermissionsGetMaskByNames', variables] as const, + /** Query key for orgPermissionsGetPaddedMask */ orgPermissionsGetPaddedMask: ( + variables?: object + ) => ['orgPermissionsGetPaddedMask', variables] as const, } as const; /** @@ -265,7 +335,7 @@ export const queryKeys = { orgPermissionDefault: orgPermissionDefaultKeys, orgPermissionDefaultGrant: orgPermissionDefaultGrantKeys, orgPermissionDefaultPermission: orgPermissionDefaultPermissionKeys, - custom: customQueryKeys + custom: customQueryKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/admin/hooks/selection.ts b/sdk/constructive-react/src/admin/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/admin/hooks/selection.ts +++ b/sdk/constructive-react/src/admin/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/admin/index.ts b/sdk/constructive-react/src/admin/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/admin/index.ts +++ b/sdk/constructive-react/src/admin/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/admin/orm/client.ts b/sdk/constructive-react/src/admin/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/admin/orm/client.ts +++ b/sdk/constructive-react/src/admin/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/admin/orm/index.ts b/sdk/constructive-react/src/admin/orm/index.ts index 80f72b6711..05c2d70038 100644 --- a/sdk/constructive-react/src/admin/orm/index.ts +++ b/sdk/constructive-react/src/admin/orm/index.ts @@ -3,43 +3,43 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AppAdminGrantModel } from "./models/appAdminGrant"; -import { AppClaimedInviteModel } from "./models/appClaimedInvite"; -import { AppGrantModel } from "./models/appGrant"; -import { AppInviteModel } from "./models/appInvite"; -import { AppMembershipModel } from "./models/appMembership"; -import { AppMembershipDefaultModel } from "./models/appMembershipDefault"; -import { AppOwnerGrantModel } from "./models/appOwnerGrant"; -import { AppPermissionModel } from "./models/appPermission"; -import { AppPermissionDefaultModel } from "./models/appPermissionDefault"; -import { AppPermissionDefaultGrantModel } from "./models/appPermissionDefaultGrant"; -import { AppPermissionDefaultPermissionModel } from "./models/appPermissionDefaultPermission"; -import { MembershipTypeModel } from "./models/membershipType"; -import { OrgAdminGrantModel } from "./models/orgAdminGrant"; -import { OrgClaimedInviteModel } from "./models/orgClaimedInvite"; -import { OrgGrantModel } from "./models/orgGrant"; -import { OrgInviteModel } from "./models/orgInvite"; -import { OrgMemberModel } from "./models/orgMember"; -import { OrgMemberProfileModel } from "./models/orgMemberProfile"; -import { OrgMembershipModel } from "./models/orgMembership"; -import { OrgMembershipDefaultModel } from "./models/orgMembershipDefault"; -import { OrgMembershipSettingModel } from "./models/orgMembershipSetting"; -import { OrgOwnerGrantModel } from "./models/orgOwnerGrant"; -import { OrgPermissionModel } from "./models/orgPermission"; -import { OrgPermissionDefaultModel } from "./models/orgPermissionDefault"; -import { OrgPermissionDefaultGrantModel } from "./models/orgPermissionDefaultGrant"; -import { OrgPermissionDefaultPermissionModel } from "./models/orgPermissionDefaultPermission"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AppAdminGrantModel } from './models/appAdminGrant'; +import { AppClaimedInviteModel } from './models/appClaimedInvite'; +import { AppGrantModel } from './models/appGrant'; +import { AppInviteModel } from './models/appInvite'; +import { AppMembershipModel } from './models/appMembership'; +import { AppMembershipDefaultModel } from './models/appMembershipDefault'; +import { AppOwnerGrantModel } from './models/appOwnerGrant'; +import { AppPermissionModel } from './models/appPermission'; +import { AppPermissionDefaultModel } from './models/appPermissionDefault'; +import { AppPermissionDefaultGrantModel } from './models/appPermissionDefaultGrant'; +import { AppPermissionDefaultPermissionModel } from './models/appPermissionDefaultPermission'; +import { MembershipTypeModel } from './models/membershipType'; +import { OrgAdminGrantModel } from './models/orgAdminGrant'; +import { OrgClaimedInviteModel } from './models/orgClaimedInvite'; +import { OrgGrantModel } from './models/orgGrant'; +import { OrgInviteModel } from './models/orgInvite'; +import { OrgMemberModel } from './models/orgMember'; +import { OrgMemberProfileModel } from './models/orgMemberProfile'; +import { OrgMembershipModel } from './models/orgMembership'; +import { OrgMembershipDefaultModel } from './models/orgMembershipDefault'; +import { OrgMembershipSettingModel } from './models/orgMembershipSetting'; +import { OrgOwnerGrantModel } from './models/orgOwnerGrant'; +import { OrgPermissionModel } from './models/orgPermission'; +import { OrgPermissionDefaultModel } from './models/orgPermissionDefault'; +import { OrgPermissionDefaultGrantModel } from './models/orgPermissionDefaultGrant'; +import { OrgPermissionDefaultPermissionModel } from './models/orgPermissionDefaultPermission'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -93,6 +93,6 @@ export function createClient(config: OrmClientConfig) { orgPermissionDefaultGrant: new OrgPermissionDefaultGrantModel(client), orgPermissionDefaultPermission: new OrgPermissionDefaultPermissionModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/input-types.ts b/sdk/constructive-react/src/admin/orm/input-types.ts index 55d15ac97d..b6b48b9b04 100644 --- a/sdk/constructive-react/src/admin/orm/input-types.ts +++ b/sdk/constructive-react/src/admin/orm/input-types.ts @@ -702,12 +702,16 @@ export type AppClaimedInviteWithRelations = AppClaimedInvite & AppClaimedInviteR export type AppGrantWithRelations = AppGrant & AppGrantRelations; export type AppInviteWithRelations = AppInvite & AppInviteRelations; export type AppMembershipWithRelations = AppMembership & AppMembershipRelations; -export type AppMembershipDefaultWithRelations = AppMembershipDefault & AppMembershipDefaultRelations; +export type AppMembershipDefaultWithRelations = AppMembershipDefault & + AppMembershipDefaultRelations; export type AppOwnerGrantWithRelations = AppOwnerGrant & AppOwnerGrantRelations; export type AppPermissionWithRelations = AppPermission & AppPermissionRelations; -export type AppPermissionDefaultWithRelations = AppPermissionDefault & AppPermissionDefaultRelations; -export type AppPermissionDefaultGrantWithRelations = AppPermissionDefaultGrant & AppPermissionDefaultGrantRelations; -export type AppPermissionDefaultPermissionWithRelations = AppPermissionDefaultPermission & AppPermissionDefaultPermissionRelations; +export type AppPermissionDefaultWithRelations = AppPermissionDefault & + AppPermissionDefaultRelations; +export type AppPermissionDefaultGrantWithRelations = AppPermissionDefaultGrant & + AppPermissionDefaultGrantRelations; +export type AppPermissionDefaultPermissionWithRelations = AppPermissionDefaultPermission & + AppPermissionDefaultPermissionRelations; export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type OrgAdminGrantWithRelations = OrgAdminGrant & OrgAdminGrantRelations; export type OrgClaimedInviteWithRelations = OrgClaimedInvite & OrgClaimedInviteRelations; @@ -716,13 +720,18 @@ export type OrgInviteWithRelations = OrgInvite & OrgInviteRelations; export type OrgMemberWithRelations = OrgMember & OrgMemberRelations; export type OrgMemberProfileWithRelations = OrgMemberProfile & OrgMemberProfileRelations; export type OrgMembershipWithRelations = OrgMembership & OrgMembershipRelations; -export type OrgMembershipDefaultWithRelations = OrgMembershipDefault & OrgMembershipDefaultRelations; -export type OrgMembershipSettingWithRelations = OrgMembershipSetting & OrgMembershipSettingRelations; +export type OrgMembershipDefaultWithRelations = OrgMembershipDefault & + OrgMembershipDefaultRelations; +export type OrgMembershipSettingWithRelations = OrgMembershipSetting & + OrgMembershipSettingRelations; export type OrgOwnerGrantWithRelations = OrgOwnerGrant & OrgOwnerGrantRelations; export type OrgPermissionWithRelations = OrgPermission & OrgPermissionRelations; -export type OrgPermissionDefaultWithRelations = OrgPermissionDefault & OrgPermissionDefaultRelations; -export type OrgPermissionDefaultGrantWithRelations = OrgPermissionDefaultGrant & OrgPermissionDefaultGrantRelations; -export type OrgPermissionDefaultPermissionWithRelations = OrgPermissionDefaultPermission & OrgPermissionDefaultPermissionRelations; +export type OrgPermissionDefaultWithRelations = OrgPermissionDefault & + OrgPermissionDefaultRelations; +export type OrgPermissionDefaultGrantWithRelations = OrgPermissionDefaultGrant & + OrgPermissionDefaultGrantRelations; +export type OrgPermissionDefaultPermissionWithRelations = OrgPermissionDefaultPermission & + OrgPermissionDefaultPermissionRelations; // ============ Entity Select Types ============ export type AppAdminGrantSelect = { actorId?: boolean; @@ -1668,32 +1677,524 @@ export interface OrgPermissionDefaultPermissionFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type AppAdminGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppClaimedInviteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppInviteOrderBy = "CHANNEL_ASC" | "CHANNEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_COUNT_ASC" | "INVITE_COUNT_DESC" | "INVITE_LIMIT_ASC" | "INVITE_LIMIT_DESC" | "INVITE_TOKEN_ASC" | "INVITE_TOKEN_DESC" | "INVITE_VALID_ASC" | "INVITE_VALID_DESC" | "MULTIPLE_ASC" | "MULTIPLE_DESC" | "NATURAL" | "PHONE_ASC" | "PHONE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppMembershipOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "GRANTED_ASC" | "GRANTED_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_BANNED_ASC" | "IS_BANNED_DESC" | "IS_DISABLED_ASC" | "IS_DISABLED_DESC" | "IS_OWNER_ASC" | "IS_OWNER_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AppMembershipDefaultOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ID_ASC" | "ID_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AppOwnerGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppPermissionOrderBy = "BITNUM_ASC" | "BITNUM_DESC" | "BITSTR_ASC" | "BITSTR_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppPermissionDefaultOrderBy = "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppPermissionDefaultGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppPermissionDefaultPermissionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type MembershipTypeOrderBy = "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "HAS_USERS_TABLE_ENTRY_ASC" | "HAS_USERS_TABLE_ENTRY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARENT_MEMBERSHIP_TYPE_ASC" | "PARENT_MEMBERSHIP_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type OrgAdminGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgClaimedInviteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgInviteOrderBy = "CHANNEL_ASC" | "CHANNEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_COUNT_ASC" | "INVITE_COUNT_DESC" | "INVITE_LIMIT_ASC" | "INVITE_LIMIT_DESC" | "INVITE_TOKEN_ASC" | "INVITE_TOKEN_DESC" | "INVITE_VALID_ASC" | "INVITE_VALID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "MULTIPLE_ASC" | "MULTIPLE_DESC" | "NATURAL" | "PHONE_ASC" | "PHONE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgMemberOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgMemberProfileOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "BIO_ASC" | "BIO_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MEMBERSHIP_ID_ASC" | "MEMBERSHIP_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_PICTURE_ASC" | "PROFILE_PICTURE_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgMembershipOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTED_ASC" | "GRANTED_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_BANNED_ASC" | "IS_BANNED_DESC" | "IS_DISABLED_ASC" | "IS_DISABLED_DESC" | "IS_EXTERNAL_ASC" | "IS_EXTERNAL_DESC" | "IS_OWNER_ASC" | "IS_OWNER_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgMembershipDefaultOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgMembershipSettingOrderBy = "ALLOW_EXTERNAL_MEMBERS_ASC" | "ALLOW_EXTERNAL_MEMBERS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "CREATE_CHILD_CASCADE_ADMINS_ASC" | "CREATE_CHILD_CASCADE_ADMINS_DESC" | "CREATE_CHILD_CASCADE_MEMBERS_ASC" | "CREATE_CHILD_CASCADE_MEMBERS_DESC" | "CREATE_CHILD_CASCADE_OWNERS_ASC" | "CREATE_CHILD_CASCADE_OWNERS_DESC" | "DELETE_MEMBER_CASCADE_CHILDREN_ASC" | "DELETE_MEMBER_CASCADE_CHILDREN_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_PROFILE_ASSIGNMENT_MODE_ASC" | "INVITE_PROFILE_ASSIGNMENT_MODE_DESC" | "LIMIT_ALLOCATION_MODE_ASC" | "LIMIT_ALLOCATION_MODE_DESC" | "NATURAL" | "POPULATE_MEMBER_EMAIL_ASC" | "POPULATE_MEMBER_EMAIL_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgOwnerGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgPermissionOrderBy = "BITNUM_ASC" | "BITNUM_DESC" | "BITSTR_ASC" | "BITSTR_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgPermissionDefaultOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgPermissionDefaultGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgPermissionDefaultPermissionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppAdminGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppClaimedInviteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppInviteOrderBy = + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_COUNT_ASC' + | 'INVITE_COUNT_DESC' + | 'INVITE_LIMIT_ASC' + | 'INVITE_LIMIT_DESC' + | 'INVITE_TOKEN_ASC' + | 'INVITE_TOKEN_DESC' + | 'INVITE_VALID_ASC' + | 'INVITE_VALID_DESC' + | 'MULTIPLE_ASC' + | 'MULTIPLE_DESC' + | 'NATURAL' + | 'PHONE_ASC' + | 'PHONE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppMembershipOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'GRANTED_ASC' + | 'GRANTED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_BANNED_ASC' + | 'IS_BANNED_DESC' + | 'IS_DISABLED_ASC' + | 'IS_DISABLED_DESC' + | 'IS_OWNER_ASC' + | 'IS_OWNER_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AppMembershipDefaultOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AppOwnerGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppPermissionOrderBy = + | 'BITNUM_ASC' + | 'BITNUM_DESC' + | 'BITSTR_ASC' + | 'BITSTR_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppPermissionDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppPermissionDefaultGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppPermissionDefaultPermissionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type MembershipTypeOrderBy = + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARENT_MEMBERSHIP_TYPE_ASC' + | 'PARENT_MEMBERSHIP_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type OrgAdminGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgClaimedInviteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgInviteOrderBy = + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_COUNT_ASC' + | 'INVITE_COUNT_DESC' + | 'INVITE_LIMIT_ASC' + | 'INVITE_LIMIT_DESC' + | 'INVITE_TOKEN_ASC' + | 'INVITE_TOKEN_DESC' + | 'INVITE_VALID_ASC' + | 'INVITE_VALID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'MULTIPLE_ASC' + | 'MULTIPLE_DESC' + | 'NATURAL' + | 'PHONE_ASC' + | 'PHONE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgMemberOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgMemberProfileOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'BIO_ASC' + | 'BIO_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MEMBERSHIP_ID_ASC' + | 'MEMBERSHIP_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_PICTURE_ASC' + | 'PROFILE_PICTURE_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgMembershipOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTED_ASC' + | 'GRANTED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_BANNED_ASC' + | 'IS_BANNED_DESC' + | 'IS_DISABLED_ASC' + | 'IS_DISABLED_DESC' + | 'IS_EXTERNAL_ASC' + | 'IS_EXTERNAL_DESC' + | 'IS_OWNER_ASC' + | 'IS_OWNER_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgMembershipDefaultOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgMembershipSettingOrderBy = + | 'ALLOW_EXTERNAL_MEMBERS_ASC' + | 'ALLOW_EXTERNAL_MEMBERS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'CREATE_CHILD_CASCADE_ADMINS_ASC' + | 'CREATE_CHILD_CASCADE_ADMINS_DESC' + | 'CREATE_CHILD_CASCADE_MEMBERS_ASC' + | 'CREATE_CHILD_CASCADE_MEMBERS_DESC' + | 'CREATE_CHILD_CASCADE_OWNERS_ASC' + | 'CREATE_CHILD_CASCADE_OWNERS_DESC' + | 'DELETE_MEMBER_CASCADE_CHILDREN_ASC' + | 'DELETE_MEMBER_CASCADE_CHILDREN_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_PROFILE_ASSIGNMENT_MODE_ASC' + | 'INVITE_PROFILE_ASSIGNMENT_MODE_DESC' + | 'LIMIT_ALLOCATION_MODE_ASC' + | 'LIMIT_ALLOCATION_MODE_DESC' + | 'NATURAL' + | 'POPULATE_MEMBER_EMAIL_ASC' + | 'POPULATE_MEMBER_EMAIL_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgOwnerGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgPermissionOrderBy = + | 'BITNUM_ASC' + | 'BITNUM_DESC' + | 'BITSTR_ASC' + | 'BITSTR_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgPermissionDefaultOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgPermissionDefaultGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgPermissionDefaultPermissionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateAppAdminGrantInput { clientMutationId?: string; @@ -2396,13 +2897,13 @@ export interface DeleteOrgPermissionDefaultPermissionInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "AppPermission": { - "appPermissionDefaultGrantsByPermissionId": "AppPermissionDefaultGrant" + AppPermission: { + appPermissionDefaultGrantsByPermissionId: 'AppPermissionDefaultGrant', + }, + OrgPermission: { + orgPermissionDefaultGrantsByPermissionId: 'OrgPermissionDefaultGrant', + orgPermissionDefaultPermissionsByPermissionId: 'OrgPermissionDefaultPermission', }, - "OrgPermission": { - "orgPermissionDefaultGrantsByPermissionId": "OrgPermissionDefaultGrant", - "orgPermissionDefaultPermissionsByPermissionId": "OrgPermissionDefaultPermission" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -4885,4 +5386,4 @@ export type OrgPermissionDefaultPermissionEdgeSelect = { node?: { select: OrgPermissionDefaultPermissionSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/admin/orm/models/appAdminGrant.ts b/sdk/constructive-react/src/admin/orm/models/appAdminGrant.ts index 0c7dffaf81..cc7a22623e 100644 --- a/sdk/constructive-react/src/admin/orm/models/appAdminGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/appAdminGrant.ts @@ -3,56 +3,96 @@ * @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 { AppAdminGrant, AppAdminGrantWithRelations, AppAdminGrantSelect, AppAdminGrantFilter, AppAdminGrantOrderBy, CreateAppAdminGrantInput, UpdateAppAdminGrantInput, AppAdminGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppAdminGrant, + AppAdminGrantWithRelations, + AppAdminGrantSelect, + AppAdminGrantFilter, + AppAdminGrantOrderBy, + CreateAppAdminGrantInput, + UpdateAppAdminGrantInput, + AppAdminGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppAdminGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppAdminGrant", "appAdminGrants", 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 - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppAdminGrant', + 'appAdminGrants', + 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, + }, + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrants", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppAdminGrant", "appAdminGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppAdminGrant', + 'appAdminGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrant", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appAdminGrant": data.appAdminGrants?.nodes?.[0] ?? null - }) + appAdminGrant: data.appAdminGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppAdminGrant", "appAdminGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppAdminGrant', + 'appAdminGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrant", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appAdminGrant": data.appAdminGrants?.nodes?.[0] ?? null - }) + appAdminGrant: data.appAdminGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppAdminGrant", "createAppAdminGrant", "appAdminGrant", args.select, args.data, "CreateAppAdminGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppAdminGrant', + 'createAppAdminGrant', + 'appAdminGrant', + args.select, + args.data, + 'CreateAppAdminGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "createAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'createAppAdminGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppAdminGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppAdminGrant", "updateAppAdminGrant", "appAdminGrant", args.select, args.where.id, args.data, "UpdateAppAdminGrantInput", "id", "appAdminGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppAdminGrant', + 'updateAppAdminGrant', + 'appAdminGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppAdminGrantInput', + 'id', + 'appAdminGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "updateAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'updateAppAdminGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppAdminGrant", "deleteAppAdminGrant", "appAdminGrant", { - id: args.where.id - }, "DeleteAppAdminGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppAdminGrant', + 'deleteAppAdminGrant', + 'appAdminGrant', + { + id: args.where.id, + }, + 'DeleteAppAdminGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "deleteAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'deleteAppAdminGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appClaimedInvite.ts b/sdk/constructive-react/src/admin/orm/models/appClaimedInvite.ts index 66e752f4b1..598f1b15af 100644 --- a/sdk/constructive-react/src/admin/orm/models/appClaimedInvite.ts +++ b/sdk/constructive-react/src/admin/orm/models/appClaimedInvite.ts @@ -3,56 +3,96 @@ * @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 { AppClaimedInvite, AppClaimedInviteWithRelations, AppClaimedInviteSelect, AppClaimedInviteFilter, AppClaimedInviteOrderBy, CreateAppClaimedInviteInput, UpdateAppClaimedInviteInput, AppClaimedInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppClaimedInvite, + AppClaimedInviteWithRelations, + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy, + CreateAppClaimedInviteInput, + UpdateAppClaimedInviteInput, + AppClaimedInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppClaimedInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppClaimedInvite", "appClaimedInvites", 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 - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + 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, + }, + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvites", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppClaimedInvite", "appClaimedInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvite", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appClaimedInvite": data.appClaimedInvites?.nodes?.[0] ?? null - }) + appClaimedInvite: data.appClaimedInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppClaimedInvite", "appClaimedInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvite", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appClaimedInvite": data.appClaimedInvites?.nodes?.[0] ?? null - }) + appClaimedInvite: data.appClaimedInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppClaimedInvite", "createAppClaimedInvite", "appClaimedInvite", args.select, args.data, "CreateAppClaimedInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppClaimedInvite', + 'createAppClaimedInvite', + 'appClaimedInvite', + args.select, + args.data, + 'CreateAppClaimedInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "createAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'createAppClaimedInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppClaimedInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppClaimedInvite", "updateAppClaimedInvite", "appClaimedInvite", args.select, args.where.id, args.data, "UpdateAppClaimedInviteInput", "id", "appClaimedInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppClaimedInvite', + 'updateAppClaimedInvite', + 'appClaimedInvite', + args.select, + args.where.id, + args.data, + 'UpdateAppClaimedInviteInput', + 'id', + 'appClaimedInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "updateAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'updateAppClaimedInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppClaimedInvite", "deleteAppClaimedInvite", "appClaimedInvite", { - id: args.where.id - }, "DeleteAppClaimedInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppClaimedInvite', + 'deleteAppClaimedInvite', + 'appClaimedInvite', + { + id: args.where.id, + }, + 'DeleteAppClaimedInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "deleteAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'deleteAppClaimedInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appGrant.ts b/sdk/constructive-react/src/admin/orm/models/appGrant.ts index 13823f924b..d773ff6de1 100644 --- a/sdk/constructive-react/src/admin/orm/models/appGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/appGrant.ts @@ -3,56 +3,96 @@ * @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 { AppGrant, AppGrantWithRelations, AppGrantSelect, AppGrantFilter, AppGrantOrderBy, CreateAppGrantInput, UpdateAppGrantInput, AppGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppGrant, + AppGrantWithRelations, + AppGrantSelect, + AppGrantFilter, + AppGrantOrderBy, + CreateAppGrantInput, + UpdateAppGrantInput, + AppGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppGrant", "appGrants", 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 - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppGrant', + 'appGrants', + 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, + }, + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrants", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppGrant", "appGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppGrant', + 'appGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrant", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appGrant": data.appGrants?.nodes?.[0] ?? null - }) + appGrant: data.appGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppGrant", "appGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppGrant', + 'appGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrant", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appGrant": data.appGrants?.nodes?.[0] ?? null - }) + appGrant: data.appGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppGrant", "createAppGrant", "appGrant", args.select, args.data, "CreateAppGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppGrant', + 'createAppGrant', + 'appGrant', + args.select, + args.data, + 'CreateAppGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "createAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'createAppGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppGrant", "updateAppGrant", "appGrant", args.select, args.where.id, args.data, "UpdateAppGrantInput", "id", "appGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppGrant', + 'updateAppGrant', + 'appGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppGrantInput', + 'id', + 'appGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "updateAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'updateAppGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppGrant", "deleteAppGrant", "appGrant", { - id: args.where.id - }, "DeleteAppGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppGrant', + 'deleteAppGrant', + 'appGrant', + { + id: args.where.id, + }, + 'DeleteAppGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "deleteAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'deleteAppGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appInvite.ts b/sdk/constructive-react/src/admin/orm/models/appInvite.ts index 7320a2028b..3350bba65b 100644 --- a/sdk/constructive-react/src/admin/orm/models/appInvite.ts +++ b/sdk/constructive-react/src/admin/orm/models/appInvite.ts @@ -3,56 +3,96 @@ * @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 { AppInvite, AppInviteWithRelations, AppInviteSelect, AppInviteFilter, AppInviteOrderBy, CreateAppInviteInput, UpdateAppInviteInput, AppInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppInvite, + AppInviteWithRelations, + AppInviteSelect, + AppInviteFilter, + AppInviteOrderBy, + CreateAppInviteInput, + UpdateAppInviteInput, + AppInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppInvite", "appInvites", 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 - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppInvite', + 'appInvites', + 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, + }, + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvites", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppInvite", "appInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppInvite', + 'appInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvite", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appInvite": data.appInvites?.nodes?.[0] ?? null - }) + appInvite: data.appInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppInvite", "appInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppInvite', + 'appInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvite", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appInvite": data.appInvites?.nodes?.[0] ?? null - }) + appInvite: data.appInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppInvite", "createAppInvite", "appInvite", args.select, args.data, "CreateAppInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppInvite', + 'createAppInvite', + 'appInvite', + args.select, + args.data, + 'CreateAppInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "createAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'createAppInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppInvite", "updateAppInvite", "appInvite", args.select, args.where.id, args.data, "UpdateAppInviteInput", "id", "appInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppInvite', + 'updateAppInvite', + 'appInvite', + args.select, + args.where.id, + args.data, + 'UpdateAppInviteInput', + 'id', + 'appInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "updateAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'updateAppInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppInvite", "deleteAppInvite", "appInvite", { - id: args.where.id - }, "DeleteAppInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppInvite', + 'deleteAppInvite', + 'appInvite', + { + id: args.where.id, + }, + 'DeleteAppInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "deleteAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'deleteAppInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appMembership.ts b/sdk/constructive-react/src/admin/orm/models/appMembership.ts index 6732a31125..1faa691016 100644 --- a/sdk/constructive-react/src/admin/orm/models/appMembership.ts +++ b/sdk/constructive-react/src/admin/orm/models/appMembership.ts @@ -3,56 +3,96 @@ * @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 { AppMembership, AppMembershipWithRelations, AppMembershipSelect, AppMembershipFilter, AppMembershipOrderBy, CreateAppMembershipInput, UpdateAppMembershipInput, AppMembershipPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppMembership, + AppMembershipWithRelations, + AppMembershipSelect, + AppMembershipFilter, + AppMembershipOrderBy, + CreateAppMembershipInput, + UpdateAppMembershipInput, + AppMembershipPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppMembershipModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMemberships: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembership", "appMemberships", 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 - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppMembership', + 'appMemberships', + 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, + }, + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMemberships", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMemberships', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppMembership", "appMemberships", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppMembership', + 'appMemberships', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMembership", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMembership', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembership": data.appMemberships?.nodes?.[0] ?? null - }) + appMembership: data.appMemberships?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembership", "appMemberships", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppMembership', + 'appMemberships', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMembership", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMembership', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembership": data.appMemberships?.nodes?.[0] ?? null - }) + appMembership: data.appMemberships?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppMembership", "createAppMembership", "appMembership", args.select, args.data, "CreateAppMembershipInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppMembership', + 'createAppMembership', + 'appMembership', + args.select, + args.data, + 'CreateAppMembershipInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "createAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'createAppMembership', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppMembershipPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppMembership", "updateAppMembership", "appMembership", args.select, args.where.id, args.data, "UpdateAppMembershipInput", "id", "appMembershipPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppMembership', + 'updateAppMembership', + 'appMembership', + args.select, + args.where.id, + args.data, + 'UpdateAppMembershipInput', + 'id', + 'appMembershipPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "updateAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'updateAppMembership', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppMembership", "deleteAppMembership", "appMembership", { - id: args.where.id - }, "DeleteAppMembershipInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppMembership', + 'deleteAppMembership', + 'appMembership', + { + id: args.where.id, + }, + 'DeleteAppMembershipInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "deleteAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'deleteAppMembership', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appMembershipDefault.ts b/sdk/constructive-react/src/admin/orm/models/appMembershipDefault.ts index bfd6c3ee6e..efc0ab28ee 100644 --- a/sdk/constructive-react/src/admin/orm/models/appMembershipDefault.ts +++ b/sdk/constructive-react/src/admin/orm/models/appMembershipDefault.ts @@ -3,56 +3,98 @@ * @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 { AppMembershipDefault, AppMembershipDefaultWithRelations, AppMembershipDefaultSelect, AppMembershipDefaultFilter, AppMembershipDefaultOrderBy, CreateAppMembershipDefaultInput, UpdateAppMembershipDefaultInput, AppMembershipDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppMembershipDefault, + AppMembershipDefaultWithRelations, + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy, + CreateAppMembershipDefaultInput, + UpdateAppMembershipDefaultInput, + AppMembershipDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppMembershipDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appMembershipDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appMembershipDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembershipDefault", "appMembershipDefaults", 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 - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + 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, + }, + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefaults", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppMembershipDefault", "appMembershipDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefault", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembershipDefault": data.appMembershipDefaults?.nodes?.[0] ?? null - }) + appMembershipDefault: data.appMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembershipDefault", "appMembershipDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefault", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembershipDefault": data.appMembershipDefaults?.nodes?.[0] ?? null - }) + appMembershipDefault: data.appMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppMembershipDefault", "createAppMembershipDefault", "appMembershipDefault", args.select, args.data, "CreateAppMembershipDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppMembershipDefault', + 'createAppMembershipDefault', + 'appMembershipDefault', + args.select, + args.data, + 'CreateAppMembershipDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "createAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'createAppMembershipDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppMembershipDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppMembershipDefault", "updateAppMembershipDefault", "appMembershipDefault", args.select, args.where.id, args.data, "UpdateAppMembershipDefaultInput", "id", "appMembershipDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppMembershipDefault', + 'updateAppMembershipDefault', + 'appMembershipDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppMembershipDefaultInput', + 'id', + 'appMembershipDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "updateAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'updateAppMembershipDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppMembershipDefault", "deleteAppMembershipDefault", "appMembershipDefault", { - id: args.where.id - }, "DeleteAppMembershipDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppMembershipDefault', + 'deleteAppMembershipDefault', + 'appMembershipDefault', + { + id: args.where.id, + }, + 'DeleteAppMembershipDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "deleteAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'deleteAppMembershipDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appOwnerGrant.ts b/sdk/constructive-react/src/admin/orm/models/appOwnerGrant.ts index 8709dd4496..28f7d92d12 100644 --- a/sdk/constructive-react/src/admin/orm/models/appOwnerGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/appOwnerGrant.ts @@ -3,56 +3,96 @@ * @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 { AppOwnerGrant, AppOwnerGrantWithRelations, AppOwnerGrantSelect, AppOwnerGrantFilter, AppOwnerGrantOrderBy, CreateAppOwnerGrantInput, UpdateAppOwnerGrantInput, AppOwnerGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppOwnerGrant, + AppOwnerGrantWithRelations, + AppOwnerGrantSelect, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy, + CreateAppOwnerGrantInput, + UpdateAppOwnerGrantInput, + AppOwnerGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppOwnerGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppOwnerGrant", "appOwnerGrants", 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 - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + 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, + }, + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrants", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppOwnerGrant", "appOwnerGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrant", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appOwnerGrant": data.appOwnerGrants?.nodes?.[0] ?? null - }) + appOwnerGrant: data.appOwnerGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppOwnerGrant", "appOwnerGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrant", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appOwnerGrant": data.appOwnerGrants?.nodes?.[0] ?? null - }) + appOwnerGrant: data.appOwnerGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppOwnerGrant", "createAppOwnerGrant", "appOwnerGrant", args.select, args.data, "CreateAppOwnerGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppOwnerGrant', + 'createAppOwnerGrant', + 'appOwnerGrant', + args.select, + args.data, + 'CreateAppOwnerGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "createAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'createAppOwnerGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppOwnerGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppOwnerGrant", "updateAppOwnerGrant", "appOwnerGrant", args.select, args.where.id, args.data, "UpdateAppOwnerGrantInput", "id", "appOwnerGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppOwnerGrant', + 'updateAppOwnerGrant', + 'appOwnerGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppOwnerGrantInput', + 'id', + 'appOwnerGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "updateAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'updateAppOwnerGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppOwnerGrant", "deleteAppOwnerGrant", "appOwnerGrant", { - id: args.where.id - }, "DeleteAppOwnerGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppOwnerGrant', + 'deleteAppOwnerGrant', + 'appOwnerGrant', + { + id: args.where.id, + }, + 'DeleteAppOwnerGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "deleteAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'deleteAppOwnerGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appPermission.ts b/sdk/constructive-react/src/admin/orm/models/appPermission.ts index ebfaf30147..efa4812398 100644 --- a/sdk/constructive-react/src/admin/orm/models/appPermission.ts +++ b/sdk/constructive-react/src/admin/orm/models/appPermission.ts @@ -3,56 +3,96 @@ * @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 { AppPermission, AppPermissionWithRelations, AppPermissionSelect, AppPermissionFilter, AppPermissionOrderBy, CreateAppPermissionInput, UpdateAppPermissionInput, AppPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermission, + AppPermissionWithRelations, + AppPermissionSelect, + AppPermissionFilter, + AppPermissionOrderBy, + CreateAppPermissionInput, + UpdateAppPermissionInput, + AppPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermission", "appPermissions", 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 - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermission', + 'appPermissions', + 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, + }, + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermissions", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermission", "appPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermission', + 'appPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermission", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermission', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermission": data.appPermissions?.nodes?.[0] ?? null - }) + appPermission: data.appPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermission", "appPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermission', + 'appPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermission", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermission', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermission": data.appPermissions?.nodes?.[0] ?? null - }) + appPermission: data.appPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermission", "createAppPermission", "appPermission", args.select, args.data, "CreateAppPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermission', + 'createAppPermission', + 'appPermission', + args.select, + args.data, + 'CreateAppPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "createAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'createAppPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermission", "updateAppPermission", "appPermission", args.select, args.where.id, args.data, "UpdateAppPermissionInput", "id", "appPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermission', + 'updateAppPermission', + 'appPermission', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionInput', + 'id', + 'appPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "updateAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'updateAppPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermission", "deleteAppPermission", "appPermission", { - id: args.where.id - }, "DeleteAppPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermission', + 'deleteAppPermission', + 'appPermission', + { + id: args.where.id, + }, + 'DeleteAppPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "deleteAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'deleteAppPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appPermissionDefault.ts b/sdk/constructive-react/src/admin/orm/models/appPermissionDefault.ts index 682c13a467..c967364f31 100644 --- a/sdk/constructive-react/src/admin/orm/models/appPermissionDefault.ts +++ b/sdk/constructive-react/src/admin/orm/models/appPermissionDefault.ts @@ -3,56 +3,98 @@ * @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 { AppPermissionDefault, AppPermissionDefaultWithRelations, AppPermissionDefaultSelect, AppPermissionDefaultFilter, AppPermissionDefaultOrderBy, CreateAppPermissionDefaultInput, UpdateAppPermissionDefaultInput, AppPermissionDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefault, + AppPermissionDefaultWithRelations, + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy, + CreateAppPermissionDefaultInput, + UpdateAppPermissionDefaultInput, + AppPermissionDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefault", "appPermissionDefaults", 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 - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + 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, + }, + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefaults", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefault", "appPermissionDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefault", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefault": data.appPermissionDefaults?.nodes?.[0] ?? null - }) + appPermissionDefault: data.appPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefault", "appPermissionDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefault", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefault": data.appPermissionDefaults?.nodes?.[0] ?? null - }) + appPermissionDefault: data.appPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefault", "createAppPermissionDefault", "appPermissionDefault", args.select, args.data, "CreateAppPermissionDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefault', + 'createAppPermissionDefault', + 'appPermissionDefault', + args.select, + args.data, + 'CreateAppPermissionDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "createAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'createAppPermissionDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefault", "updateAppPermissionDefault", "appPermissionDefault", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultInput", "id", "appPermissionDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefault', + 'updateAppPermissionDefault', + 'appPermissionDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultInput', + 'id', + 'appPermissionDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "updateAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'updateAppPermissionDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefault", "deleteAppPermissionDefault", "appPermissionDefault", { - id: args.where.id - }, "DeleteAppPermissionDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefault', + 'deleteAppPermissionDefault', + 'appPermissionDefault', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "deleteAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'deleteAppPermissionDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultGrant.ts b/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultGrant.ts index a04d3770ba..b6a3b10748 100644 --- a/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultGrant.ts @@ -3,56 +3,98 @@ * @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 { AppPermissionDefaultGrant, AppPermissionDefaultGrantWithRelations, AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantFilter, AppPermissionDefaultGrantOrderBy, CreateAppPermissionDefaultGrantInput, UpdateAppPermissionDefaultGrantInput, AppPermissionDefaultGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefaultGrant, + AppPermissionDefaultGrantWithRelations, + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy, + CreateAppPermissionDefaultGrantInput, + UpdateAppPermissionDefaultGrantInput, + AppPermissionDefaultGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultGrants: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", 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 - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + 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, + }, + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrants", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrant", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrant', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultGrant": data.appPermissionDefaultGrants?.nodes?.[0] ?? null - }) + appPermissionDefaultGrant: data.appPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrant", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrant', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultGrant": data.appPermissionDefaultGrants?.nodes?.[0] ?? null - }) + appPermissionDefaultGrant: data.appPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefaultGrant", "createAppPermissionDefaultGrant", "appPermissionDefaultGrant", args.select, args.data, "CreateAppPermissionDefaultGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefaultGrant', + 'createAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + args.select, + args.data, + 'CreateAppPermissionDefaultGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "createAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'createAppPermissionDefaultGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefaultGrant", "updateAppPermissionDefaultGrant", "appPermissionDefaultGrant", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultGrantInput", "id", "appPermissionDefaultGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefaultGrant', + 'updateAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultGrantInput', + 'id', + 'appPermissionDefaultGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "updateAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'updateAppPermissionDefaultGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefaultGrant", "deleteAppPermissionDefaultGrant", "appPermissionDefaultGrant", { - id: args.where.id - }, "DeleteAppPermissionDefaultGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefaultGrant', + 'deleteAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "deleteAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'deleteAppPermissionDefaultGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultPermission.ts b/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultPermission.ts index 15217af996..6e47d9eeec 100644 --- a/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultPermission.ts +++ b/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultPermission.ts @@ -3,56 +3,109 @@ * @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 { AppPermissionDefaultPermission, AppPermissionDefaultPermissionWithRelations, AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionFilter, AppPermissionDefaultPermissionOrderBy, CreateAppPermissionDefaultPermissionInput, UpdateAppPermissionDefaultPermissionInput, AppPermissionDefaultPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefaultPermission, + AppPermissionDefaultPermissionWithRelations, + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy, + CreateAppPermissionDefaultPermissionInput, + UpdateAppPermissionDefaultPermissionInput, + AppPermissionDefaultPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermissions: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", 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 - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + 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, + }, + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermissions", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermission: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermission", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermission', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class AppPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultPermission": data.appPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + appPermissionDefaultPermission: data.appPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermission: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermission", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermission', document, variables, transform: (data: { @@ -93,74 +156,118 @@ export class AppPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultPermission": data.appPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + appPermissionDefaultPermission: data.appPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateAppPermissionDefaultPermissionInput['appPermissionDefaultPermission'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefaultPermission", "createAppPermissionDefaultPermission", "appPermissionDefaultPermission", args.select, args.data, "CreateAppPermissionDefaultPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefaultPermission', + 'createAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + args.select, + args.data, + 'CreateAppPermissionDefaultPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "createAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'createAppPermissionDefaultPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefaultPermission", "updateAppPermissionDefaultPermission", "appPermissionDefaultPermission", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultPermissionInput", "id", "appPermissionDefaultPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefaultPermission', + 'updateAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultPermissionInput', + 'id', + 'appPermissionDefaultPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "updateAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'updateAppPermissionDefaultPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefaultPermission", "deleteAppPermissionDefaultPermission", "appPermissionDefaultPermission", { - id: args.where.id - }, "DeleteAppPermissionDefaultPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefaultPermission', + 'deleteAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "deleteAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'deleteAppPermissionDefaultPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/index.ts b/sdk/constructive-react/src/admin/orm/models/index.ts index ba6cc4f424..0cac178e48 100644 --- a/sdk/constructive-react/src/admin/orm/models/index.ts +++ b/sdk/constructive-react/src/admin/orm/models/index.ts @@ -3,29 +3,29 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AppAdminGrantModel } from "./appAdminGrant"; -export { AppClaimedInviteModel } from "./appClaimedInvite"; -export { AppGrantModel } from "./appGrant"; -export { AppInviteModel } from "./appInvite"; -export { AppMembershipModel } from "./appMembership"; -export { AppMembershipDefaultModel } from "./appMembershipDefault"; -export { AppOwnerGrantModel } from "./appOwnerGrant"; -export { AppPermissionModel } from "./appPermission"; -export { AppPermissionDefaultModel } from "./appPermissionDefault"; -export { AppPermissionDefaultGrantModel } from "./appPermissionDefaultGrant"; -export { AppPermissionDefaultPermissionModel } from "./appPermissionDefaultPermission"; -export { MembershipTypeModel } from "./membershipType"; -export { OrgAdminGrantModel } from "./orgAdminGrant"; -export { OrgClaimedInviteModel } from "./orgClaimedInvite"; -export { OrgGrantModel } from "./orgGrant"; -export { OrgInviteModel } from "./orgInvite"; -export { OrgMemberModel } from "./orgMember"; -export { OrgMemberProfileModel } from "./orgMemberProfile"; -export { OrgMembershipModel } from "./orgMembership"; -export { OrgMembershipDefaultModel } from "./orgMembershipDefault"; -export { OrgMembershipSettingModel } from "./orgMembershipSetting"; -export { OrgOwnerGrantModel } from "./orgOwnerGrant"; -export { OrgPermissionModel } from "./orgPermission"; -export { OrgPermissionDefaultModel } from "./orgPermissionDefault"; -export { OrgPermissionDefaultGrantModel } from "./orgPermissionDefaultGrant"; -export { OrgPermissionDefaultPermissionModel } from "./orgPermissionDefaultPermission"; \ No newline at end of file +export { AppAdminGrantModel } from './appAdminGrant'; +export { AppClaimedInviteModel } from './appClaimedInvite'; +export { AppGrantModel } from './appGrant'; +export { AppInviteModel } from './appInvite'; +export { AppMembershipModel } from './appMembership'; +export { AppMembershipDefaultModel } from './appMembershipDefault'; +export { AppOwnerGrantModel } from './appOwnerGrant'; +export { AppPermissionModel } from './appPermission'; +export { AppPermissionDefaultModel } from './appPermissionDefault'; +export { AppPermissionDefaultGrantModel } from './appPermissionDefaultGrant'; +export { AppPermissionDefaultPermissionModel } from './appPermissionDefaultPermission'; +export { MembershipTypeModel } from './membershipType'; +export { OrgAdminGrantModel } from './orgAdminGrant'; +export { OrgClaimedInviteModel } from './orgClaimedInvite'; +export { OrgGrantModel } from './orgGrant'; +export { OrgInviteModel } from './orgInvite'; +export { OrgMemberModel } from './orgMember'; +export { OrgMemberProfileModel } from './orgMemberProfile'; +export { OrgMembershipModel } from './orgMembership'; +export { OrgMembershipDefaultModel } from './orgMembershipDefault'; +export { OrgMembershipSettingModel } from './orgMembershipSetting'; +export { OrgOwnerGrantModel } from './orgOwnerGrant'; +export { OrgPermissionModel } from './orgPermission'; +export { OrgPermissionDefaultModel } from './orgPermissionDefault'; +export { OrgPermissionDefaultGrantModel } from './orgPermissionDefaultGrant'; +export { OrgPermissionDefaultPermissionModel } from './orgPermissionDefaultPermission'; diff --git a/sdk/constructive-react/src/admin/orm/models/membershipType.ts b/sdk/constructive-react/src/admin/orm/models/membershipType.ts index e99dd207df..1ab7c15781 100644 --- a/sdk/constructive-react/src/admin/orm/models/membershipType.ts +++ b/sdk/constructive-react/src/admin/orm/models/membershipType.ts @@ -3,56 +3,96 @@ * @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 { MembershipType, MembershipTypeWithRelations, MembershipTypeSelect, MembershipTypeFilter, MembershipTypeOrderBy, CreateMembershipTypeInput, UpdateMembershipTypeInput, MembershipTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipType, + MembershipTypeWithRelations, + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy, + CreateMembershipTypeInput, + UpdateMembershipTypeInput, + MembershipTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipType", "membershipTypes", 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 - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipType', + 'membershipTypes', + 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, + }, + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipTypes", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipType", "membershipTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipType', + 'membershipTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipType", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MembershipTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipType": data.membershipTypes?.nodes?.[0] ?? null - }) + membershipType: data.membershipTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipType", "membershipTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipType', + 'membershipTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipType", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MembershipTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipType": data.membershipTypes?.nodes?.[0] ?? null - }) + membershipType: data.membershipTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipType", "createMembershipType", "membershipType", args.select, args.data, "CreateMembershipTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipType', + 'createMembershipType', + 'membershipType', + args.select, + args.data, + 'CreateMembershipTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "createMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'createMembershipType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: number; + }, + MembershipTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipType", "updateMembershipType", "membershipType", args.select, args.where.id, args.data, "UpdateMembershipTypeInput", "id", "membershipTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipType', + 'updateMembershipType', + 'membershipType', + args.select, + args.where.id, + args.data, + 'UpdateMembershipTypeInput', + 'id', + 'membershipTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "updateMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'updateMembershipType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: number; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: number; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipType", "deleteMembershipType", "membershipType", { - id: args.where.id - }, "DeleteMembershipTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipType', + 'deleteMembershipType', + 'membershipType', + { + id: args.where.id, + }, + 'DeleteMembershipTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "deleteMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'deleteMembershipType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgAdminGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgAdminGrant.ts index 2bd28d708d..9ef902aaa8 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgAdminGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgAdminGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgAdminGrant, OrgAdminGrantWithRelations, OrgAdminGrantSelect, OrgAdminGrantFilter, OrgAdminGrantOrderBy, CreateOrgAdminGrantInput, UpdateOrgAdminGrantInput, OrgAdminGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgAdminGrant, + OrgAdminGrantWithRelations, + OrgAdminGrantSelect, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy, + CreateOrgAdminGrantInput, + UpdateOrgAdminGrantInput, + OrgAdminGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgAdminGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgAdminGrant", "orgAdminGrants", 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 - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + 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, + }, + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrants", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgAdminGrant", "orgAdminGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrant", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgAdminGrant": data.orgAdminGrants?.nodes?.[0] ?? null - }) + orgAdminGrant: data.orgAdminGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgAdminGrant", "orgAdminGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrant", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgAdminGrant": data.orgAdminGrants?.nodes?.[0] ?? null - }) + orgAdminGrant: data.orgAdminGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgAdminGrant", "createOrgAdminGrant", "orgAdminGrant", args.select, args.data, "CreateOrgAdminGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgAdminGrant', + 'createOrgAdminGrant', + 'orgAdminGrant', + args.select, + args.data, + 'CreateOrgAdminGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "createOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'createOrgAdminGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgAdminGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgAdminGrant", "updateOrgAdminGrant", "orgAdminGrant", args.select, args.where.id, args.data, "UpdateOrgAdminGrantInput", "id", "orgAdminGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgAdminGrant', + 'updateOrgAdminGrant', + 'orgAdminGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgAdminGrantInput', + 'id', + 'orgAdminGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "updateOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'updateOrgAdminGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgAdminGrant", "deleteOrgAdminGrant", "orgAdminGrant", { - id: args.where.id - }, "DeleteOrgAdminGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgAdminGrant', + 'deleteOrgAdminGrant', + 'orgAdminGrant', + { + id: args.where.id, + }, + 'DeleteOrgAdminGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "deleteOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'deleteOrgAdminGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgClaimedInvite.ts b/sdk/constructive-react/src/admin/orm/models/orgClaimedInvite.ts index 3e5e549cb0..82b31bb474 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgClaimedInvite.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgClaimedInvite.ts @@ -3,56 +3,96 @@ * @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 { OrgClaimedInvite, OrgClaimedInviteWithRelations, OrgClaimedInviteSelect, OrgClaimedInviteFilter, OrgClaimedInviteOrderBy, CreateOrgClaimedInviteInput, UpdateOrgClaimedInviteInput, OrgClaimedInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgClaimedInvite, + OrgClaimedInviteWithRelations, + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy, + CreateOrgClaimedInviteInput, + UpdateOrgClaimedInviteInput, + OrgClaimedInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgClaimedInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgClaimedInvite", "orgClaimedInvites", 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 - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + 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, + }, + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvites", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgClaimedInvite", "orgClaimedInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvite", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgClaimedInvite": data.orgClaimedInvites?.nodes?.[0] ?? null - }) + orgClaimedInvite: data.orgClaimedInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgClaimedInvite", "orgClaimedInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvite", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgClaimedInvite": data.orgClaimedInvites?.nodes?.[0] ?? null - }) + orgClaimedInvite: data.orgClaimedInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgClaimedInvite", "createOrgClaimedInvite", "orgClaimedInvite", args.select, args.data, "CreateOrgClaimedInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgClaimedInvite', + 'createOrgClaimedInvite', + 'orgClaimedInvite', + args.select, + args.data, + 'CreateOrgClaimedInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "createOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'createOrgClaimedInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgClaimedInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgClaimedInvite", "updateOrgClaimedInvite", "orgClaimedInvite", args.select, args.where.id, args.data, "UpdateOrgClaimedInviteInput", "id", "orgClaimedInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgClaimedInvite', + 'updateOrgClaimedInvite', + 'orgClaimedInvite', + args.select, + args.where.id, + args.data, + 'UpdateOrgClaimedInviteInput', + 'id', + 'orgClaimedInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "updateOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'updateOrgClaimedInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgClaimedInvite", "deleteOrgClaimedInvite", "orgClaimedInvite", { - id: args.where.id - }, "DeleteOrgClaimedInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgClaimedInvite', + 'deleteOrgClaimedInvite', + 'orgClaimedInvite', + { + id: args.where.id, + }, + 'DeleteOrgClaimedInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "deleteOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'deleteOrgClaimedInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgGrant.ts index 8d61a4f545..467c6b11b9 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgGrant, OrgGrantWithRelations, OrgGrantSelect, OrgGrantFilter, OrgGrantOrderBy, CreateOrgGrantInput, UpdateOrgGrantInput, OrgGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgGrant, + OrgGrantWithRelations, + OrgGrantSelect, + OrgGrantFilter, + OrgGrantOrderBy, + CreateOrgGrantInput, + UpdateOrgGrantInput, + OrgGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgGrant", "orgGrants", 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 - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgGrant', + 'orgGrants', + 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, + }, + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrants", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgGrant", "orgGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgGrant', + 'orgGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrant", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgGrant": data.orgGrants?.nodes?.[0] ?? null - }) + orgGrant: data.orgGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgGrant", "orgGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgGrant', + 'orgGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrant", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgGrant": data.orgGrants?.nodes?.[0] ?? null - }) + orgGrant: data.orgGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgGrant", "createOrgGrant", "orgGrant", args.select, args.data, "CreateOrgGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgGrant', + 'createOrgGrant', + 'orgGrant', + args.select, + args.data, + 'CreateOrgGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "createOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'createOrgGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgGrant", "updateOrgGrant", "orgGrant", args.select, args.where.id, args.data, "UpdateOrgGrantInput", "id", "orgGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgGrant', + 'updateOrgGrant', + 'orgGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgGrantInput', + 'id', + 'orgGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "updateOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'updateOrgGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgGrant", "deleteOrgGrant", "orgGrant", { - id: args.where.id - }, "DeleteOrgGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgGrant', + 'deleteOrgGrant', + 'orgGrant', + { + id: args.where.id, + }, + 'DeleteOrgGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "deleteOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'deleteOrgGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgInvite.ts b/sdk/constructive-react/src/admin/orm/models/orgInvite.ts index 120f096740..50cc5eb9e6 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgInvite.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgInvite.ts @@ -3,56 +3,96 @@ * @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 { OrgInvite, OrgInviteWithRelations, OrgInviteSelect, OrgInviteFilter, OrgInviteOrderBy, CreateOrgInviteInput, UpdateOrgInviteInput, OrgInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgInvite, + OrgInviteWithRelations, + OrgInviteSelect, + OrgInviteFilter, + OrgInviteOrderBy, + CreateOrgInviteInput, + UpdateOrgInviteInput, + OrgInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgInvite", "orgInvites", 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 - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgInvite', + 'orgInvites', + 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, + }, + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvites", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgInvite", "orgInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgInvite', + 'orgInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvite", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgInvite": data.orgInvites?.nodes?.[0] ?? null - }) + orgInvite: data.orgInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgInvite", "orgInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgInvite', + 'orgInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvite", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgInvite": data.orgInvites?.nodes?.[0] ?? null - }) + orgInvite: data.orgInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgInvite", "createOrgInvite", "orgInvite", args.select, args.data, "CreateOrgInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgInvite', + 'createOrgInvite', + 'orgInvite', + args.select, + args.data, + 'CreateOrgInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "createOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'createOrgInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgInvite", "updateOrgInvite", "orgInvite", args.select, args.where.id, args.data, "UpdateOrgInviteInput", "id", "orgInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgInvite', + 'updateOrgInvite', + 'orgInvite', + args.select, + args.where.id, + args.data, + 'UpdateOrgInviteInput', + 'id', + 'orgInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "updateOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'updateOrgInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgInvite", "deleteOrgInvite", "orgInvite", { - id: args.where.id - }, "DeleteOrgInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgInvite', + 'deleteOrgInvite', + 'orgInvite', + { + id: args.where.id, + }, + 'DeleteOrgInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "deleteOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'deleteOrgInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgMember.ts b/sdk/constructive-react/src/admin/orm/models/orgMember.ts index 76ffb8c694..bf7ac25fe9 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMember.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMember.ts @@ -3,56 +3,96 @@ * @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 { OrgMember, OrgMemberWithRelations, OrgMemberSelect, OrgMemberFilter, OrgMemberOrderBy, CreateOrgMemberInput, UpdateOrgMemberInput, OrgMemberPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMember, + OrgMemberWithRelations, + OrgMemberSelect, + OrgMemberFilter, + OrgMemberOrderBy, + CreateOrgMemberInput, + UpdateOrgMemberInput, + OrgMemberPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMemberModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMember", "orgMembers", 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 - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMember', + 'orgMembers', + 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, + }, + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMembers", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMembers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMember: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMember", "orgMembers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMember', + 'orgMembers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMember", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMember', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMemberModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMember": data.orgMembers?.nodes?.[0] ?? null - }) + orgMember: data.orgMembers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMember: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMember", "orgMembers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMember', + 'orgMembers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMember", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMember', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMemberModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMember": data.orgMembers?.nodes?.[0] ?? null - }) + orgMember: data.orgMembers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMember", "createOrgMember", "orgMember", args.select, args.data, "CreateOrgMemberInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMember', + 'createOrgMember', + 'orgMember', + args.select, + args.data, + 'CreateOrgMemberInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "createOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'createOrgMember', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMemberPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMember", "updateOrgMember", "orgMember", args.select, args.where.id, args.data, "UpdateOrgMemberInput", "id", "orgMemberPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMember', + 'updateOrgMember', + 'orgMember', + args.select, + args.where.id, + args.data, + 'UpdateOrgMemberInput', + 'id', + 'orgMemberPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "updateOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'updateOrgMember', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMember", "deleteOrgMember", "orgMember", { - id: args.where.id - }, "DeleteOrgMemberInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMember', + 'deleteOrgMember', + 'orgMember', + { + id: args.where.id, + }, + 'DeleteOrgMemberInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "deleteOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'deleteOrgMember', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgMemberProfile.ts b/sdk/constructive-react/src/admin/orm/models/orgMemberProfile.ts index 4f0671ad74..9cecf8839b 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMemberProfile.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMemberProfile.ts @@ -3,56 +3,96 @@ * @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 { OrgMemberProfile, OrgMemberProfileWithRelations, OrgMemberProfileSelect, OrgMemberProfileFilter, OrgMemberProfileOrderBy, CreateOrgMemberProfileInput, UpdateOrgMemberProfileInput, OrgMemberProfilePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMemberProfile, + OrgMemberProfileWithRelations, + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy, + CreateOrgMemberProfileInput, + UpdateOrgMemberProfileInput, + OrgMemberProfilePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMemberProfileModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfiles: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMemberProfile", "orgMemberProfiles", 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 - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + 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, + }, + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfiles", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfiles', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfile: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMemberProfile", "orgMemberProfiles", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfile", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfile', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMemberProfileModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMemberProfile": data.orgMemberProfiles?.nodes?.[0] ?? null - }) + orgMemberProfile: data.orgMemberProfiles?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfile: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMemberProfile", "orgMemberProfiles", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfile", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfile', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMemberProfileModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMemberProfile": data.orgMemberProfiles?.nodes?.[0] ?? null - }) + orgMemberProfile: data.orgMemberProfiles?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMemberProfile", "createOrgMemberProfile", "orgMemberProfile", args.select, args.data, "CreateOrgMemberProfileInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMemberProfile', + 'createOrgMemberProfile', + 'orgMemberProfile', + args.select, + args.data, + 'CreateOrgMemberProfileInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "createOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'createOrgMemberProfile', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMemberProfilePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMemberProfile", "updateOrgMemberProfile", "orgMemberProfile", args.select, args.where.id, args.data, "UpdateOrgMemberProfileInput", "id", "orgMemberProfilePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMemberProfile', + 'updateOrgMemberProfile', + 'orgMemberProfile', + args.select, + args.where.id, + args.data, + 'UpdateOrgMemberProfileInput', + 'id', + 'orgMemberProfilePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "updateOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'updateOrgMemberProfile', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMemberProfile", "deleteOrgMemberProfile", "orgMemberProfile", { - id: args.where.id - }, "DeleteOrgMemberProfileInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMemberProfile', + 'deleteOrgMemberProfile', + 'orgMemberProfile', + { + id: args.where.id, + }, + 'DeleteOrgMemberProfileInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "deleteOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'deleteOrgMemberProfile', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgMembership.ts b/sdk/constructive-react/src/admin/orm/models/orgMembership.ts index 316b21c75c..06ee032ca8 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMembership.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMembership.ts @@ -3,56 +3,96 @@ * @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 { OrgMembership, OrgMembershipWithRelations, OrgMembershipSelect, OrgMembershipFilter, OrgMembershipOrderBy, CreateOrgMembershipInput, UpdateOrgMembershipInput, OrgMembershipPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembership, + OrgMembershipWithRelations, + OrgMembershipSelect, + OrgMembershipFilter, + OrgMembershipOrderBy, + CreateOrgMembershipInput, + UpdateOrgMembershipInput, + OrgMembershipPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberships: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembership", "orgMemberships", 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 - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembership', + 'orgMemberships', + 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, + }, + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMemberships", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMemberships', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembership", "orgMemberships", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembership', + 'orgMemberships', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMembership", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMembership', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembership": data.orgMemberships?.nodes?.[0] ?? null - }) + orgMembership: data.orgMemberships?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembership", "orgMemberships", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembership', + 'orgMemberships', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMembership", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMembership', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembership": data.orgMemberships?.nodes?.[0] ?? null - }) + orgMembership: data.orgMemberships?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembership", "createOrgMembership", "orgMembership", args.select, args.data, "CreateOrgMembershipInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembership', + 'createOrgMembership', + 'orgMembership', + args.select, + args.data, + 'CreateOrgMembershipInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "createOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'createOrgMembership', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembership", "updateOrgMembership", "orgMembership", args.select, args.where.id, args.data, "UpdateOrgMembershipInput", "id", "orgMembershipPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembership', + 'updateOrgMembership', + 'orgMembership', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipInput', + 'id', + 'orgMembershipPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "updateOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'updateOrgMembership', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembership", "deleteOrgMembership", "orgMembership", { - id: args.where.id - }, "DeleteOrgMembershipInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembership', + 'deleteOrgMembership', + 'orgMembership', + { + id: args.where.id, + }, + 'DeleteOrgMembershipInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "deleteOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'deleteOrgMembership', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgMembershipDefault.ts b/sdk/constructive-react/src/admin/orm/models/orgMembershipDefault.ts index 25472918b1..525619dfca 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMembershipDefault.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMembershipDefault.ts @@ -3,56 +3,98 @@ * @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 { OrgMembershipDefault, OrgMembershipDefaultWithRelations, OrgMembershipDefaultSelect, OrgMembershipDefaultFilter, OrgMembershipDefaultOrderBy, CreateOrgMembershipDefaultInput, UpdateOrgMembershipDefaultInput, OrgMembershipDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembershipDefault, + OrgMembershipDefaultWithRelations, + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy, + CreateOrgMembershipDefaultInput, + UpdateOrgMembershipDefaultInput, + OrgMembershipDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgMembershipDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgMembershipDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipDefault", "orgMembershipDefaults", 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 - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + 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, + }, + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefaults", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembershipDefault", "orgMembershipDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefault", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipDefault": data.orgMembershipDefaults?.nodes?.[0] ?? null - }) + orgMembershipDefault: data.orgMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipDefault", "orgMembershipDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefault", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipDefault": data.orgMembershipDefaults?.nodes?.[0] ?? null - }) + orgMembershipDefault: data.orgMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembershipDefault", "createOrgMembershipDefault", "orgMembershipDefault", args.select, args.data, "CreateOrgMembershipDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembershipDefault', + 'createOrgMembershipDefault', + 'orgMembershipDefault', + args.select, + args.data, + 'CreateOrgMembershipDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "createOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'createOrgMembershipDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembershipDefault", "updateOrgMembershipDefault", "orgMembershipDefault", args.select, args.where.id, args.data, "UpdateOrgMembershipDefaultInput", "id", "orgMembershipDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembershipDefault', + 'updateOrgMembershipDefault', + 'orgMembershipDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipDefaultInput', + 'id', + 'orgMembershipDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "updateOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'updateOrgMembershipDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembershipDefault", "deleteOrgMembershipDefault", "orgMembershipDefault", { - id: args.where.id - }, "DeleteOrgMembershipDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembershipDefault', + 'deleteOrgMembershipDefault', + 'orgMembershipDefault', + { + id: args.where.id, + }, + 'DeleteOrgMembershipDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "deleteOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'deleteOrgMembershipDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgMembershipSetting.ts b/sdk/constructive-react/src/admin/orm/models/orgMembershipSetting.ts index 3297c80b04..de551183d2 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMembershipSetting.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMembershipSetting.ts @@ -3,56 +3,98 @@ * @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 { OrgMembershipSetting, OrgMembershipSettingWithRelations, OrgMembershipSettingSelect, OrgMembershipSettingFilter, OrgMembershipSettingOrderBy, CreateOrgMembershipSettingInput, UpdateOrgMembershipSettingInput, OrgMembershipSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembershipSetting, + OrgMembershipSettingWithRelations, + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy, + CreateOrgMembershipSettingInput, + UpdateOrgMembershipSettingInput, + OrgMembershipSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgMembershipSettings: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgMembershipSettings: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipSetting", "orgMembershipSettings", 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 - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + 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, + }, + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSettings", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembershipSetting", "orgMembershipSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSetting", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSetting', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgMembershipSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipSetting": data.orgMembershipSettings?.nodes?.[0] ?? null - }) + orgMembershipSetting: data.orgMembershipSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipSetting", "orgMembershipSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSetting", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSetting', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgMembershipSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipSetting": data.orgMembershipSettings?.nodes?.[0] ?? null - }) + orgMembershipSetting: data.orgMembershipSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembershipSetting", "createOrgMembershipSetting", "orgMembershipSetting", args.select, args.data, "CreateOrgMembershipSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembershipSetting', + 'createOrgMembershipSetting', + 'orgMembershipSetting', + args.select, + args.data, + 'CreateOrgMembershipSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "createOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'createOrgMembershipSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembershipSetting", "updateOrgMembershipSetting", "orgMembershipSetting", args.select, args.where.id, args.data, "UpdateOrgMembershipSettingInput", "id", "orgMembershipSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembershipSetting', + 'updateOrgMembershipSetting', + 'orgMembershipSetting', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipSettingInput', + 'id', + 'orgMembershipSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "updateOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'updateOrgMembershipSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembershipSetting", "deleteOrgMembershipSetting", "orgMembershipSetting", { - id: args.where.id - }, "DeleteOrgMembershipSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembershipSetting', + 'deleteOrgMembershipSetting', + 'orgMembershipSetting', + { + id: args.where.id, + }, + 'DeleteOrgMembershipSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "deleteOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'deleteOrgMembershipSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgOwnerGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgOwnerGrant.ts index 163b918057..d99550bd73 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgOwnerGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgOwnerGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgOwnerGrant, OrgOwnerGrantWithRelations, OrgOwnerGrantSelect, OrgOwnerGrantFilter, OrgOwnerGrantOrderBy, CreateOrgOwnerGrantInput, UpdateOrgOwnerGrantInput, OrgOwnerGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgOwnerGrant, + OrgOwnerGrantWithRelations, + OrgOwnerGrantSelect, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy, + CreateOrgOwnerGrantInput, + UpdateOrgOwnerGrantInput, + OrgOwnerGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgOwnerGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgOwnerGrant", "orgOwnerGrants", 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 - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + 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, + }, + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrants", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgOwnerGrant", "orgOwnerGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrant", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgOwnerGrant": data.orgOwnerGrants?.nodes?.[0] ?? null - }) + orgOwnerGrant: data.orgOwnerGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgOwnerGrant", "orgOwnerGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrant", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgOwnerGrant": data.orgOwnerGrants?.nodes?.[0] ?? null - }) + orgOwnerGrant: data.orgOwnerGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgOwnerGrant", "createOrgOwnerGrant", "orgOwnerGrant", args.select, args.data, "CreateOrgOwnerGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgOwnerGrant', + 'createOrgOwnerGrant', + 'orgOwnerGrant', + args.select, + args.data, + 'CreateOrgOwnerGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "createOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'createOrgOwnerGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgOwnerGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgOwnerGrant", "updateOrgOwnerGrant", "orgOwnerGrant", args.select, args.where.id, args.data, "UpdateOrgOwnerGrantInput", "id", "orgOwnerGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgOwnerGrant', + 'updateOrgOwnerGrant', + 'orgOwnerGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgOwnerGrantInput', + 'id', + 'orgOwnerGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "updateOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'updateOrgOwnerGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgOwnerGrant", "deleteOrgOwnerGrant", "orgOwnerGrant", { - id: args.where.id - }, "DeleteOrgOwnerGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgOwnerGrant', + 'deleteOrgOwnerGrant', + 'orgOwnerGrant', + { + id: args.where.id, + }, + 'DeleteOrgOwnerGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "deleteOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'deleteOrgOwnerGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgPermission.ts b/sdk/constructive-react/src/admin/orm/models/orgPermission.ts index 76834b6851..e3aded7147 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgPermission.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgPermission.ts @@ -3,56 +3,96 @@ * @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 { OrgPermission, OrgPermissionWithRelations, OrgPermissionSelect, OrgPermissionFilter, OrgPermissionOrderBy, CreateOrgPermissionInput, UpdateOrgPermissionInput, OrgPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermission, + OrgPermissionWithRelations, + OrgPermissionSelect, + OrgPermissionFilter, + OrgPermissionOrderBy, + CreateOrgPermissionInput, + UpdateOrgPermissionInput, + OrgPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermission", "orgPermissions", 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 - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermission', + 'orgPermissions', + 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, + }, + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermissions", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermission", "orgPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermission', + 'orgPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermission", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermission', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermission": data.orgPermissions?.nodes?.[0] ?? null - }) + orgPermission: data.orgPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermission", "orgPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermission', + 'orgPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermission", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermission', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermission": data.orgPermissions?.nodes?.[0] ?? null - }) + orgPermission: data.orgPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermission", "createOrgPermission", "orgPermission", args.select, args.data, "CreateOrgPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermission', + 'createOrgPermission', + 'orgPermission', + args.select, + args.data, + 'CreateOrgPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "createOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'createOrgPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermission", "updateOrgPermission", "orgPermission", args.select, args.where.id, args.data, "UpdateOrgPermissionInput", "id", "orgPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermission', + 'updateOrgPermission', + 'orgPermission', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionInput', + 'id', + 'orgPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "updateOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'updateOrgPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermission", "deleteOrgPermission", "orgPermission", { - id: args.where.id - }, "DeleteOrgPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermission', + 'deleteOrgPermission', + 'orgPermission', + { + id: args.where.id, + }, + 'DeleteOrgPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "deleteOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'deleteOrgPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefault.ts b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefault.ts index b9fd8d9a5f..20ed957d15 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefault.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefault.ts @@ -3,56 +3,98 @@ * @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 { OrgPermissionDefault, OrgPermissionDefaultWithRelations, OrgPermissionDefaultSelect, OrgPermissionDefaultFilter, OrgPermissionDefaultOrderBy, CreateOrgPermissionDefaultInput, UpdateOrgPermissionDefaultInput, OrgPermissionDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefault, + OrgPermissionDefaultWithRelations, + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy, + CreateOrgPermissionDefaultInput, + UpdateOrgPermissionDefaultInput, + OrgPermissionDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefault", "orgPermissionDefaults", 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 - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + 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, + }, + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefaults", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefault", "orgPermissionDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefault", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefault": data.orgPermissionDefaults?.nodes?.[0] ?? null - }) + orgPermissionDefault: data.orgPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefault", "orgPermissionDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefault", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefault": data.orgPermissionDefaults?.nodes?.[0] ?? null - }) + orgPermissionDefault: data.orgPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefault", "createOrgPermissionDefault", "orgPermissionDefault", args.select, args.data, "CreateOrgPermissionDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefault', + 'createOrgPermissionDefault', + 'orgPermissionDefault', + args.select, + args.data, + 'CreateOrgPermissionDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "createOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'createOrgPermissionDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefault", "updateOrgPermissionDefault", "orgPermissionDefault", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultInput", "id", "orgPermissionDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefault', + 'updateOrgPermissionDefault', + 'orgPermissionDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultInput', + 'id', + 'orgPermissionDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "updateOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'updateOrgPermissionDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefault", "deleteOrgPermissionDefault", "orgPermissionDefault", { - id: args.where.id - }, "DeleteOrgPermissionDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefault', + 'deleteOrgPermissionDefault', + 'orgPermissionDefault', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "deleteOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'deleteOrgPermissionDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultGrant.ts index 0a3f198007..07d5976acb 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultGrant.ts @@ -3,56 +3,98 @@ * @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 { OrgPermissionDefaultGrant, OrgPermissionDefaultGrantWithRelations, OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantFilter, OrgPermissionDefaultGrantOrderBy, CreateOrgPermissionDefaultGrantInput, UpdateOrgPermissionDefaultGrantInput, OrgPermissionDefaultGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefaultGrant, + OrgPermissionDefaultGrantWithRelations, + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy, + CreateOrgPermissionDefaultGrantInput, + UpdateOrgPermissionDefaultGrantInput, + OrgPermissionDefaultGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultGrants: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", 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 - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + 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, + }, + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrants", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrant", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrant', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultGrant": data.orgPermissionDefaultGrants?.nodes?.[0] ?? null - }) + orgPermissionDefaultGrant: data.orgPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrant", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrant', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultGrant": data.orgPermissionDefaultGrants?.nodes?.[0] ?? null - }) + orgPermissionDefaultGrant: data.orgPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefaultGrant", "createOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", args.select, args.data, "CreateOrgPermissionDefaultGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefaultGrant', + 'createOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + args.select, + args.data, + 'CreateOrgPermissionDefaultGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "createOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'createOrgPermissionDefaultGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefaultGrant", "updateOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultGrantInput", "id", "orgPermissionDefaultGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefaultGrant', + 'updateOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultGrantInput', + 'id', + 'orgPermissionDefaultGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "updateOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'updateOrgPermissionDefaultGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefaultGrant", "deleteOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", { - id: args.where.id - }, "DeleteOrgPermissionDefaultGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefaultGrant', + 'deleteOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "deleteOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'deleteOrgPermissionDefaultGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultPermission.ts b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultPermission.ts index 66e7df7fd0..3339ceaeca 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultPermission.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultPermission.ts @@ -3,56 +3,109 @@ * @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 { OrgPermissionDefaultPermission, OrgPermissionDefaultPermissionWithRelations, OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionFilter, OrgPermissionDefaultPermissionOrderBy, CreateOrgPermissionDefaultPermissionInput, UpdateOrgPermissionDefaultPermissionInput, OrgPermissionDefaultPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefaultPermission, + OrgPermissionDefaultPermissionWithRelations, + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy, + CreateOrgPermissionDefaultPermissionInput, + UpdateOrgPermissionDefaultPermissionInput, + OrgPermissionDefaultPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermissions: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", 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 - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + 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, + }, + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermissions", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermission: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermission", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermission', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class OrgPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultPermission": data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + orgPermissionDefaultPermission: data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermission: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermission", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermission', document, variables, transform: (data: { @@ -93,74 +156,118 @@ export class OrgPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultPermission": data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + orgPermissionDefaultPermission: data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateOrgPermissionDefaultPermissionInput['orgPermissionDefaultPermission'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefaultPermission", "createOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", args.select, args.data, "CreateOrgPermissionDefaultPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefaultPermission', + 'createOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + args.select, + args.data, + 'CreateOrgPermissionDefaultPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "createOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'createOrgPermissionDefaultPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefaultPermission", "updateOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultPermissionInput", "id", "orgPermissionDefaultPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefaultPermission', + 'updateOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultPermissionInput', + 'id', + 'orgPermissionDefaultPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "updateOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'updateOrgPermissionDefaultPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefaultPermission", "deleteOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", { - id: args.where.id - }, "DeleteOrgPermissionDefaultPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefaultPermission', + 'deleteOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "deleteOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'deleteOrgPermissionDefaultPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/mutation/index.ts b/sdk/constructive-react/src/admin/orm/mutation/index.ts index 822d64e2f2..0e8e613d2e 100644 --- a/sdk/constructive-react/src/admin/orm/mutation/index.ts +++ b/sdk/constructive-react/src/admin/orm/mutation/index.ts @@ -3,11 +3,21 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, SubmitAppInviteCodeInput, SubmitOrgInviteCodeInput, ProvisionBucketPayload, SubmitAppInviteCodePayload, SubmitOrgInviteCodePayload, ProvisionBucketPayloadSelect, SubmitAppInviteCodePayloadSelect, SubmitOrgInviteCodePayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + SubmitAppInviteCodeInput, + SubmitOrgInviteCodeInput, + ProvisionBucketPayload, + SubmitAppInviteCodePayload, + SubmitOrgInviteCodePayload, + ProvisionBucketPayloadSelect, + SubmitAppInviteCodePayloadSelect, + SubmitOrgInviteCodePayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -26,47 +36,92 @@ export interface SubmitOrgInviteCodeVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - submitAppInviteCode: (args: SubmitAppInviteCodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - submitAppInviteCode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SubmitAppInviteCode", - fieldName: "submitAppInviteCode", - ...buildCustomDocument("mutation", "SubmitAppInviteCode", "submitAppInviteCode", options.select, args, [{ - name: "input", - type: "SubmitAppInviteCodeInput!" - }], connectionFieldsMap, "SubmitAppInviteCodePayload") - }), - submitOrgInviteCode: (args: SubmitOrgInviteCodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - submitOrgInviteCode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SubmitOrgInviteCode", - fieldName: "submitOrgInviteCode", - ...buildCustomDocument("mutation", "SubmitOrgInviteCode", "submitOrgInviteCode", options.select, args, [{ - name: "input", - type: "SubmitOrgInviteCodeInput!" - }], connectionFieldsMap, "SubmitOrgInviteCodePayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + submitAppInviteCode: ( + args: SubmitAppInviteCodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + submitAppInviteCode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SubmitAppInviteCode', + fieldName: 'submitAppInviteCode', + ...buildCustomDocument( + 'mutation', + 'SubmitAppInviteCode', + 'submitAppInviteCode', + options.select, + args, + [ + { + name: 'input', + type: 'SubmitAppInviteCodeInput!', + }, + ], + connectionFieldsMap, + 'SubmitAppInviteCodePayload' + ), + }), + submitOrgInviteCode: ( + args: SubmitOrgInviteCodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + submitOrgInviteCode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SubmitOrgInviteCode', + fieldName: 'submitOrgInviteCode', + ...buildCustomDocument( + 'mutation', + 'SubmitOrgInviteCode', + 'submitOrgInviteCode', + options.select, + args, + [ + { + name: 'input', + type: 'SubmitOrgInviteCodeInput!', + }, + ], + connectionFieldsMap, + 'SubmitOrgInviteCodePayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/query-builder.ts b/sdk/constructive-react/src/admin/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/admin/orm/query-builder.ts +++ b/sdk/constructive-react/src/admin/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/admin/orm/query/index.ts b/sdk/constructive-react/src/admin/orm/query/index.ts index 08db07b7be..da811891ce 100644 --- a/sdk/constructive-react/src/admin/orm/query/index.ts +++ b/sdk/constructive-react/src/admin/orm/query/index.ts @@ -3,11 +3,11 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AppPermissionConnection, OrgPermissionConnection } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { AppPermissionConnection, OrgPermissionConnection } from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AppPermissionsGetByMaskVariables { /** Read all values in the set after (below) this cursor. */ after?: string; @@ -52,135 +52,261 @@ export interface OrgPermissionsGetPaddedMaskVariables { } export function createQueryOperations(client: OrmClient) { return { - appPermissionsGetByMask: (args: AppPermissionsGetByMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetByMask: AppPermissionConnection | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetByMask", - fieldName: "appPermissionsGetByMask", - ...buildCustomDocument("query", "AppPermissionsGetByMask", "appPermissionsGetByMask", options?.select, args, [{ - name: "after", - type: "Cursor" - }, { - name: "first", - type: "Int" - }, { - name: "mask", - type: "BitString" - }, { - name: "offset", - type: "Int" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetMask: (args: AppPermissionsGetMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetMask: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetMask", - fieldName: "appPermissionsGetMask", - ...buildCustomDocument("query", "AppPermissionsGetMask", "appPermissionsGetMask", options?.select, args, [{ - name: "ids", - type: "[UUID]" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetMaskByNames: (args: AppPermissionsGetMaskByNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetMaskByNames: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetMaskByNames", - fieldName: "appPermissionsGetMaskByNames", - ...buildCustomDocument("query", "AppPermissionsGetMaskByNames", "appPermissionsGetMaskByNames", options?.select, args, [{ - name: "names", - type: "[String]" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetPaddedMask: (args: AppPermissionsGetPaddedMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetPaddedMask: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetPaddedMask", - fieldName: "appPermissionsGetPaddedMask", - ...buildCustomDocument("query", "AppPermissionsGetPaddedMask", "appPermissionsGetPaddedMask", options?.select, args, [{ - name: "mask", - type: "BitString" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetByMask: (args: OrgPermissionsGetByMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetByMask: OrgPermissionConnection | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetByMask", - fieldName: "orgPermissionsGetByMask", - ...buildCustomDocument("query", "OrgPermissionsGetByMask", "orgPermissionsGetByMask", options?.select, args, [{ - name: "after", - type: "Cursor" - }, { - name: "first", - type: "Int" - }, { - name: "mask", - type: "BitString" - }, { - name: "offset", - type: "Int" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetMask: (args: OrgPermissionsGetMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetMask: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetMask", - fieldName: "orgPermissionsGetMask", - ...buildCustomDocument("query", "OrgPermissionsGetMask", "orgPermissionsGetMask", options?.select, args, [{ - name: "ids", - type: "[UUID]" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetMaskByNames: (args: OrgPermissionsGetMaskByNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetMaskByNames: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetMaskByNames", - fieldName: "orgPermissionsGetMaskByNames", - ...buildCustomDocument("query", "OrgPermissionsGetMaskByNames", "orgPermissionsGetMaskByNames", options?.select, args, [{ - name: "names", - type: "[String]" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetPaddedMask: (args: OrgPermissionsGetPaddedMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetPaddedMask: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetPaddedMask", - fieldName: "orgPermissionsGetPaddedMask", - ...buildCustomDocument("query", "OrgPermissionsGetPaddedMask", "orgPermissionsGetPaddedMask", options?.select, args, [{ - name: "mask", - type: "BitString" - }], connectionFieldsMap, undefined) - }) + appPermissionsGetByMask: ( + args: AppPermissionsGetByMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetByMask: AppPermissionConnection | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetByMask', + fieldName: 'appPermissionsGetByMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetByMask', + 'appPermissionsGetByMask', + options?.select, + args, + [ + { + name: 'after', + type: 'Cursor', + }, + { + name: 'first', + type: 'Int', + }, + { + name: 'mask', + type: 'BitString', + }, + { + name: 'offset', + type: 'Int', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetMask: ( + args: AppPermissionsGetMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetMask', + fieldName: 'appPermissionsGetMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetMask', + 'appPermissionsGetMask', + options?.select, + args, + [ + { + name: 'ids', + type: '[UUID]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetMaskByNames: ( + args: AppPermissionsGetMaskByNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetMaskByNames: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetMaskByNames', + fieldName: 'appPermissionsGetMaskByNames', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetMaskByNames', + 'appPermissionsGetMaskByNames', + options?.select, + args, + [ + { + name: 'names', + type: '[String]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetPaddedMask: ( + args: AppPermissionsGetPaddedMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetPaddedMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetPaddedMask', + fieldName: 'appPermissionsGetPaddedMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetPaddedMask', + 'appPermissionsGetPaddedMask', + options?.select, + args, + [ + { + name: 'mask', + type: 'BitString', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetByMask: ( + args: OrgPermissionsGetByMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetByMask: OrgPermissionConnection | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetByMask', + fieldName: 'orgPermissionsGetByMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetByMask', + 'orgPermissionsGetByMask', + options?.select, + args, + [ + { + name: 'after', + type: 'Cursor', + }, + { + name: 'first', + type: 'Int', + }, + { + name: 'mask', + type: 'BitString', + }, + { + name: 'offset', + type: 'Int', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetMask: ( + args: OrgPermissionsGetMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetMask', + fieldName: 'orgPermissionsGetMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetMask', + 'orgPermissionsGetMask', + options?.select, + args, + [ + { + name: 'ids', + type: '[UUID]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetMaskByNames: ( + args: OrgPermissionsGetMaskByNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetMaskByNames: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetMaskByNames', + fieldName: 'orgPermissionsGetMaskByNames', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetMaskByNames', + 'orgPermissionsGetMaskByNames', + options?.select, + args, + [ + { + name: 'names', + type: '[String]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetPaddedMask: ( + args: OrgPermissionsGetPaddedMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetPaddedMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetPaddedMask', + fieldName: 'orgPermissionsGetPaddedMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetPaddedMask', + 'orgPermissionsGetPaddedMask', + options?.select, + args, + [ + { + name: 'mask', + type: 'BitString', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/orm/realtime.ts b/sdk/constructive-react/src/admin/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/admin/orm/realtime.ts +++ b/sdk/constructive-react/src/admin/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/admin/orm/select-types.ts b/sdk/constructive-react/src/admin/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/admin/orm/select-types.ts +++ b/sdk/constructive-react/src/admin/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/admin/schema-types.ts b/sdk/constructive-react/src/admin/schema-types.ts index 109c7afaa5..0714bf6c9d 100644 --- a/sdk/constructive-react/src/admin/schema-types.ts +++ b/sdk/constructive-react/src/admin/schema-types.ts @@ -4,61 +4,597 @@ * DO NOT EDIT - changes will be overwritten */ -import type { AppAdminGrant, AppClaimedInvite, AppGrant, AppInvite, AppMembership, AppMembershipDefault, AppOwnerGrant, AppPermission, AppPermissionDefault, AppPermissionDefaultGrant, AppPermissionDefaultPermission, MembershipType, OrgAdminGrant, OrgClaimedInvite, OrgGrant, OrgInvite, OrgMember, OrgMemberProfile, OrgMembership, OrgMembershipDefault, OrgMembershipSetting, OrgOwnerGrant, OrgPermission, OrgPermissionDefault, OrgPermissionDefaultGrant, OrgPermissionDefaultPermission, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + AppAdminGrant, + AppClaimedInvite, + AppGrant, + AppInvite, + AppMembership, + AppMembershipDefault, + AppOwnerGrant, + AppPermission, + AppPermissionDefault, + AppPermissionDefaultGrant, + AppPermissionDefaultPermission, + MembershipType, + OrgAdminGrant, + OrgClaimedInvite, + OrgGrant, + OrgInvite, + OrgMember, + OrgMemberProfile, + OrgMembership, + OrgMembershipDefault, + OrgMembershipSetting, + OrgOwnerGrant, + OrgPermission, + OrgPermissionDefault, + OrgPermissionDefaultGrant, + OrgPermissionDefaultPermission, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; export type ConstructiveInternalTypeEmail = unknown; export type ConstructiveInternalTypeImage = unknown; /** Methods to use when ordering `AppAdminGrant`. */ -export type AppAdminGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppAdminGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AppClaimedInvite`. */ -export type AppClaimedInviteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppClaimedInviteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AppGrant`. */ -export type AppGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AppInvite`. */ -export type AppInviteOrderBy = "CHANNEL_ASC" | "CHANNEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_COUNT_ASC" | "INVITE_COUNT_DESC" | "INVITE_LIMIT_ASC" | "INVITE_LIMIT_DESC" | "INVITE_TOKEN_ASC" | "INVITE_TOKEN_DESC" | "INVITE_VALID_ASC" | "INVITE_VALID_DESC" | "MULTIPLE_ASC" | "MULTIPLE_DESC" | "NATURAL" | "PHONE_ASC" | "PHONE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppInviteOrderBy = + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_COUNT_ASC' + | 'INVITE_COUNT_DESC' + | 'INVITE_LIMIT_ASC' + | 'INVITE_LIMIT_DESC' + | 'INVITE_TOKEN_ASC' + | 'INVITE_TOKEN_DESC' + | 'INVITE_VALID_ASC' + | 'INVITE_VALID_DESC' + | 'MULTIPLE_ASC' + | 'MULTIPLE_DESC' + | 'NATURAL' + | 'PHONE_ASC' + | 'PHONE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AppMembershipDefault`. */ -export type AppMembershipDefaultOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ID_ASC" | "ID_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type AppMembershipDefaultOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `AppMembership`. */ -export type AppMembershipOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "GRANTED_ASC" | "GRANTED_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_BANNED_ASC" | "IS_BANNED_DESC" | "IS_DISABLED_ASC" | "IS_DISABLED_DESC" | "IS_OWNER_ASC" | "IS_OWNER_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type AppMembershipOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'GRANTED_ASC' + | 'GRANTED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_BANNED_ASC' + | 'IS_BANNED_DESC' + | 'IS_DISABLED_ASC' + | 'IS_DISABLED_DESC' + | 'IS_OWNER_ASC' + | 'IS_OWNER_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `AppOwnerGrant`. */ -export type AppOwnerGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppOwnerGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AppPermissionDefaultGrant`. */ -export type AppPermissionDefaultGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppPermissionDefaultGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AppPermissionDefault`. */ -export type AppPermissionDefaultOrderBy = "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type AppPermissionDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `AppPermissionDefaultPermission`. */ -export type AppPermissionDefaultPermissionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppPermissionDefaultPermissionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AppPermission`. */ -export type AppPermissionOrderBy = "BITNUM_ASC" | "BITNUM_DESC" | "BITSTR_ASC" | "BITSTR_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type AppPermissionOrderBy = + | 'BITNUM_ASC' + | 'BITNUM_DESC' + | 'BITSTR_ASC' + | 'BITSTR_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `MembershipType`. */ -export type MembershipTypeOrderBy = "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "HAS_USERS_TABLE_ENTRY_ASC" | "HAS_USERS_TABLE_ENTRY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARENT_MEMBERSHIP_TYPE_ASC" | "PARENT_MEMBERSHIP_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type MembershipTypeOrderBy = + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARENT_MEMBERSHIP_TYPE_ASC' + | 'PARENT_MEMBERSHIP_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `OrgAdminGrant`. */ -export type OrgAdminGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgAdminGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `OrgClaimedInvite`. */ -export type OrgClaimedInviteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgClaimedInviteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `OrgGrant`. */ -export type OrgGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `OrgInvite`. */ -export type OrgInviteOrderBy = "CHANNEL_ASC" | "CHANNEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_COUNT_ASC" | "INVITE_COUNT_DESC" | "INVITE_LIMIT_ASC" | "INVITE_LIMIT_DESC" | "INVITE_TOKEN_ASC" | "INVITE_TOKEN_DESC" | "INVITE_VALID_ASC" | "INVITE_VALID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "MULTIPLE_ASC" | "MULTIPLE_DESC" | "NATURAL" | "PHONE_ASC" | "PHONE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgInviteOrderBy = + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_COUNT_ASC' + | 'INVITE_COUNT_DESC' + | 'INVITE_LIMIT_ASC' + | 'INVITE_LIMIT_DESC' + | 'INVITE_TOKEN_ASC' + | 'INVITE_TOKEN_DESC' + | 'INVITE_VALID_ASC' + | 'INVITE_VALID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'MULTIPLE_ASC' + | 'MULTIPLE_DESC' + | 'NATURAL' + | 'PHONE_ASC' + | 'PHONE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `OrgMember`. */ -export type OrgMemberOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type OrgMemberOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `OrgMemberProfile`. */ -export type OrgMemberProfileOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "BIO_ASC" | "BIO_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MEMBERSHIP_ID_ASC" | "MEMBERSHIP_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_PICTURE_ASC" | "PROFILE_PICTURE_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgMemberProfileOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'BIO_ASC' + | 'BIO_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MEMBERSHIP_ID_ASC' + | 'MEMBERSHIP_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_PICTURE_ASC' + | 'PROFILE_PICTURE_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `OrgMembershipDefault`. */ -export type OrgMembershipDefaultOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type OrgMembershipDefaultOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `OrgMembership`. */ -export type OrgMembershipOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTED_ASC" | "GRANTED_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_BANNED_ASC" | "IS_BANNED_DESC" | "IS_DISABLED_ASC" | "IS_DISABLED_DESC" | "IS_EXTERNAL_ASC" | "IS_EXTERNAL_DESC" | "IS_OWNER_ASC" | "IS_OWNER_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type OrgMembershipOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTED_ASC' + | 'GRANTED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_BANNED_ASC' + | 'IS_BANNED_DESC' + | 'IS_DISABLED_ASC' + | 'IS_DISABLED_DESC' + | 'IS_EXTERNAL_ASC' + | 'IS_EXTERNAL_DESC' + | 'IS_OWNER_ASC' + | 'IS_OWNER_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `OrgMembershipSetting`. */ -export type OrgMembershipSettingOrderBy = "ALLOW_EXTERNAL_MEMBERS_ASC" | "ALLOW_EXTERNAL_MEMBERS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "CREATE_CHILD_CASCADE_ADMINS_ASC" | "CREATE_CHILD_CASCADE_ADMINS_DESC" | "CREATE_CHILD_CASCADE_MEMBERS_ASC" | "CREATE_CHILD_CASCADE_MEMBERS_DESC" | "CREATE_CHILD_CASCADE_OWNERS_ASC" | "CREATE_CHILD_CASCADE_OWNERS_DESC" | "DELETE_MEMBER_CASCADE_CHILDREN_ASC" | "DELETE_MEMBER_CASCADE_CHILDREN_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_PROFILE_ASSIGNMENT_MODE_ASC" | "INVITE_PROFILE_ASSIGNMENT_MODE_DESC" | "LIMIT_ALLOCATION_MODE_ASC" | "LIMIT_ALLOCATION_MODE_DESC" | "NATURAL" | "POPULATE_MEMBER_EMAIL_ASC" | "POPULATE_MEMBER_EMAIL_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type OrgMembershipSettingOrderBy = + | 'ALLOW_EXTERNAL_MEMBERS_ASC' + | 'ALLOW_EXTERNAL_MEMBERS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'CREATE_CHILD_CASCADE_ADMINS_ASC' + | 'CREATE_CHILD_CASCADE_ADMINS_DESC' + | 'CREATE_CHILD_CASCADE_MEMBERS_ASC' + | 'CREATE_CHILD_CASCADE_MEMBERS_DESC' + | 'CREATE_CHILD_CASCADE_OWNERS_ASC' + | 'CREATE_CHILD_CASCADE_OWNERS_DESC' + | 'DELETE_MEMBER_CASCADE_CHILDREN_ASC' + | 'DELETE_MEMBER_CASCADE_CHILDREN_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_PROFILE_ASSIGNMENT_MODE_ASC' + | 'INVITE_PROFILE_ASSIGNMENT_MODE_DESC' + | 'LIMIT_ALLOCATION_MODE_ASC' + | 'LIMIT_ALLOCATION_MODE_DESC' + | 'NATURAL' + | 'POPULATE_MEMBER_EMAIL_ASC' + | 'POPULATE_MEMBER_EMAIL_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `OrgOwnerGrant`. */ -export type OrgOwnerGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgOwnerGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `OrgPermissionDefaultGrant`. */ -export type OrgPermissionDefaultGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgPermissionDefaultGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `OrgPermissionDefault`. */ -export type OrgPermissionDefaultOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type OrgPermissionDefaultOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `OrgPermissionDefaultPermission`. */ -export type OrgPermissionDefaultPermissionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgPermissionDefaultPermissionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `OrgPermission`. */ -export type OrgPermissionOrderBy = "BITNUM_ASC" | "BITNUM_DESC" | "BITSTR_ASC" | "BITSTR_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type OrgPermissionOrderBy = + | 'BITNUM_ASC' + | 'BITNUM_DESC' + | 'BITSTR_ASC' + | 'BITSTR_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** A filter to be used against `AppAdminGrant` object types. All fields are combined with a logical ‘and.’ */ export interface AppAdminGrantFilter { /** Filter by the object’s `actorId` field. */ @@ -3165,4 +3701,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/admin/types.ts b/sdk/constructive-react/src/admin/types.ts index 667b56baf1..6eaa0775bb 100644 --- a/sdk/constructive-react/src/admin/types.ts +++ b/sdk/constructive-react/src/admin/types.ts @@ -487,4 +487,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/hooks/client.ts b/sdk/constructive-react/src/agent/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/agent/hooks/client.ts +++ b/sdk/constructive-react/src/agent/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/agent/hooks/index.ts b/sdk/constructive-react/src/agent/hooks/index.ts index 9aa3e46ee2..2c9416d67b 100644 --- a/sdk/constructive-react/src/agent/hooks/index.ts +++ b/sdk/constructive-react/src/agent/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: Agent, AgentMessage, AgentPersona, AgentPlan, AgentPrompt, AgentResourceChunk, AgentResource, AgentTask, AgentThread - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/agent/hooks/invalidation.ts b/sdk/constructive-react/src/agent/hooks/invalidation.ts index 142979921d..237822f336 100644 --- a/sdk/constructive-react/src/agent/hooks/invalidation.ts +++ b/sdk/constructive-react/src/agent/hooks/invalidation.ts @@ -13,8 +13,18 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { agentKeys, agentMessageKeys, agentPersonaKeys, agentPlanKeys, agentPromptKeys, agentResourceChunkKeys, agentResourceKeys, agentTaskKeys, agentThreadKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + agentKeys, + agentMessageKeys, + agentPersonaKeys, + agentPlanKeys, + agentPromptKeys, + agentResourceChunkKeys, + agentResourceKeys, + agentTaskKeys, + agentThreadKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,105 +45,156 @@ import { agentKeys, agentMessageKeys, agentPersonaKeys, agentPlanKeys, agentProm * ``` */ export const invalidate = { - /** Invalidate agent queries */agent: { - /** Invalidate all agent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentKeys.all - }), - /** Invalidate agent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentKeys.lists() - }), - /** Invalidate a specific agent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentKeys.detail(id) - }) - }, - /** Invalidate agentMessage queries */agentMessage: { - /** Invalidate all agentMessage queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentMessageKeys.all - }), - /** Invalidate agentMessage list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentMessageKeys.lists() - }), - /** Invalidate a specific agentMessage */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentMessageKeys.detail(id) - }) - }, - /** Invalidate agentPersona queries */agentPersona: { - /** Invalidate all agentPersona queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentPersonaKeys.all - }), - /** Invalidate agentPersona list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentPersonaKeys.lists() - }), - /** Invalidate a specific agentPersona */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentPersonaKeys.detail(id) - }) - }, - /** Invalidate agentPlan queries */agentPlan: { - /** Invalidate all agentPlan queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentPlanKeys.all - }), - /** Invalidate agentPlan list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentPlanKeys.lists() - }), - /** Invalidate a specific agentPlan */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentPlanKeys.detail(id) - }) - }, - /** Invalidate agentPrompt queries */agentPrompt: { - /** Invalidate all agentPrompt queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentPromptKeys.all - }), - /** Invalidate agentPrompt list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentPromptKeys.lists() - }), - /** Invalidate a specific agentPrompt */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentPromptKeys.detail(id) - }) - }, - /** Invalidate agentResourceChunk queries */agentResourceChunk: { - /** Invalidate all agentResourceChunk queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentResourceChunkKeys.all - }), - /** Invalidate agentResourceChunk list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentResourceChunkKeys.lists() - }), - /** Invalidate a specific agentResourceChunk */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentResourceChunkKeys.detail(id) - }) - }, - /** Invalidate agentResource queries */agentResource: { - /** Invalidate all agentResource queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentResourceKeys.all - }), - /** Invalidate agentResource list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentResourceKeys.lists() - }), - /** Invalidate a specific agentResource */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentResourceKeys.detail(id) - }) - }, - /** Invalidate agentTask queries */agentTask: { - /** Invalidate all agentTask queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentTaskKeys.all - }), - /** Invalidate agentTask list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentTaskKeys.lists() - }), - /** Invalidate a specific agentTask */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentTaskKeys.detail(id) - }) - }, - /** Invalidate agentThread queries */agentThread: { - /** Invalidate all agentThread queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentThreadKeys.all - }), - /** Invalidate agentThread list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentThreadKeys.lists() - }), - /** Invalidate a specific agentThread */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentThreadKeys.detail(id) - }) - } + /** Invalidate agent queries */ agent: { + /** Invalidate all agent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentKeys.all, + }), + /** Invalidate agent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentKeys.lists(), + }), + /** Invalidate a specific agent */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: agentKeys.detail(id), + }), + }, + /** Invalidate agentMessage queries */ agentMessage: { + /** Invalidate all agentMessage queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentMessageKeys.all, + }), + /** Invalidate agentMessage list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentMessageKeys.lists(), + }), + /** Invalidate a specific agentMessage */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentMessageKeys.detail(id), + }), + }, + /** Invalidate agentPersona queries */ agentPersona: { + /** Invalidate all agentPersona queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentPersonaKeys.all, + }), + /** Invalidate agentPersona list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentPersonaKeys.lists(), + }), + /** Invalidate a specific agentPersona */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentPersonaKeys.detail(id), + }), + }, + /** Invalidate agentPlan queries */ agentPlan: { + /** Invalidate all agentPlan queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentPlanKeys.all, + }), + /** Invalidate agentPlan list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentPlanKeys.lists(), + }), + /** Invalidate a specific agentPlan */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentPlanKeys.detail(id), + }), + }, + /** Invalidate agentPrompt queries */ agentPrompt: { + /** Invalidate all agentPrompt queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentPromptKeys.all, + }), + /** Invalidate agentPrompt list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentPromptKeys.lists(), + }), + /** Invalidate a specific agentPrompt */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentPromptKeys.detail(id), + }), + }, + /** Invalidate agentResourceChunk queries */ agentResourceChunk: { + /** Invalidate all agentResourceChunk queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentResourceChunkKeys.all, + }), + /** Invalidate agentResourceChunk list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentResourceChunkKeys.lists(), + }), + /** Invalidate a specific agentResourceChunk */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentResourceChunkKeys.detail(id), + }), + }, + /** Invalidate agentResource queries */ agentResource: { + /** Invalidate all agentResource queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentResourceKeys.all, + }), + /** Invalidate agentResource list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentResourceKeys.lists(), + }), + /** Invalidate a specific agentResource */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentResourceKeys.detail(id), + }), + }, + /** Invalidate agentTask queries */ agentTask: { + /** Invalidate all agentTask queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentTaskKeys.all, + }), + /** Invalidate agentTask list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentTaskKeys.lists(), + }), + /** Invalidate a specific agentTask */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentTaskKeys.detail(id), + }), + }, + /** Invalidate agentThread queries */ agentThread: { + /** Invalidate all agentThread queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentThreadKeys.all, + }), + /** Invalidate agentThread list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentThreadKeys.lists(), + }), + /** Invalidate a specific agentThread */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentThreadKeys.detail(id), + }), + }, } as const; /** @@ -147,49 +208,67 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove agent from cache */agent: (queryClient: QueryClient, id: string | number) => { + /** Remove agent from cache */ agent: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: agentKeys.detail(id) + queryKey: agentKeys.detail(id), }); }, - /** Remove agentMessage from cache */agentMessage: (queryClient: QueryClient, id: string | number) => { + /** Remove agentMessage from cache */ agentMessage: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: agentMessageKeys.detail(id) + queryKey: agentMessageKeys.detail(id), }); }, - /** Remove agentPersona from cache */agentPersona: (queryClient: QueryClient, id: string | number) => { + /** Remove agentPersona from cache */ agentPersona: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: agentPersonaKeys.detail(id) + queryKey: agentPersonaKeys.detail(id), }); }, - /** Remove agentPlan from cache */agentPlan: (queryClient: QueryClient, id: string | number) => { + /** Remove agentPlan from cache */ agentPlan: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: agentPlanKeys.detail(id) + queryKey: agentPlanKeys.detail(id), }); }, - /** Remove agentPrompt from cache */agentPrompt: (queryClient: QueryClient, id: string | number) => { + /** Remove agentPrompt from cache */ agentPrompt: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: agentPromptKeys.detail(id) + queryKey: agentPromptKeys.detail(id), }); }, - /** Remove agentResourceChunk from cache */agentResourceChunk: (queryClient: QueryClient, id: string | number) => { + /** Remove agentResourceChunk from cache */ agentResourceChunk: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: agentResourceChunkKeys.detail(id) + queryKey: agentResourceChunkKeys.detail(id), }); }, - /** Remove agentResource from cache */agentResource: (queryClient: QueryClient, id: string | number) => { + /** Remove agentResource from cache */ agentResource: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: agentResourceKeys.detail(id) + queryKey: agentResourceKeys.detail(id), }); }, - /** Remove agentTask from cache */agentTask: (queryClient: QueryClient, id: string | number) => { + /** Remove agentTask from cache */ agentTask: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: agentTaskKeys.detail(id) + queryKey: agentTaskKeys.detail(id), }); }, - /** Remove agentThread from cache */agentThread: (queryClient: QueryClient, id: string | number) => { + /** Remove agentThread from cache */ agentThread: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: agentThreadKeys.detail(id) + queryKey: agentThreadKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/agent/hooks/mutation-keys.ts b/sdk/constructive-react/src/agent/hooks/mutation-keys.ts index 52af6cb489..fded782673 100644 --- a/sdk/constructive-react/src/agent/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/agent/hooks/mutation-keys.ts @@ -19,58 +19,82 @@ // ============================================================================ export const agentMutationKeys = { - /** All agent mutation keys */all: ["mutation", "agent"] as const, - /** Create agent mutation key */create: () => ["mutation", "agent", "create"] as const, - /** Update agent mutation key */update: (id: string | number) => ["mutation", "agent", "update", id] as const, - /** Delete agent mutation key */delete: (id: string | number) => ["mutation", "agent", "delete", id] as const + /** All agent mutation keys */ all: ['mutation', 'agent'] as const, + /** Create agent mutation key */ create: () => ['mutation', 'agent', 'create'] as const, + /** Update agent mutation key */ update: (id: string | number) => + ['mutation', 'agent', 'update', id] as const, + /** Delete agent mutation key */ delete: (id: string | number) => + ['mutation', 'agent', 'delete', id] as const, } as const; export const agentMessageMutationKeys = { - /** All agentMessage mutation keys */all: ["mutation", "agentmessage"] as const, - /** Create agentMessage mutation key */create: () => ["mutation", "agentmessage", "create"] as const, - /** Update agentMessage mutation key */update: (id: string | number) => ["mutation", "agentmessage", "update", id] as const, - /** Delete agentMessage mutation key */delete: (id: string | number) => ["mutation", "agentmessage", "delete", id] as const + /** All agentMessage mutation keys */ all: ['mutation', 'agentmessage'] as const, + /** Create agentMessage mutation key */ create: () => + ['mutation', 'agentmessage', 'create'] as const, + /** Update agentMessage mutation key */ update: (id: string | number) => + ['mutation', 'agentmessage', 'update', id] as const, + /** Delete agentMessage mutation key */ delete: (id: string | number) => + ['mutation', 'agentmessage', 'delete', id] as const, } as const; export const agentPersonaMutationKeys = { - /** All agentPersona mutation keys */all: ["mutation", "agentpersona"] as const, - /** Create agentPersona mutation key */create: () => ["mutation", "agentpersona", "create"] as const, - /** Update agentPersona mutation key */update: (id: string | number) => ["mutation", "agentpersona", "update", id] as const, - /** Delete agentPersona mutation key */delete: (id: string | number) => ["mutation", "agentpersona", "delete", id] as const + /** All agentPersona mutation keys */ all: ['mutation', 'agentpersona'] as const, + /** Create agentPersona mutation key */ create: () => + ['mutation', 'agentpersona', 'create'] as const, + /** Update agentPersona mutation key */ update: (id: string | number) => + ['mutation', 'agentpersona', 'update', id] as const, + /** Delete agentPersona mutation key */ delete: (id: string | number) => + ['mutation', 'agentpersona', 'delete', id] as const, } as const; export const agentPlanMutationKeys = { - /** All agentPlan mutation keys */all: ["mutation", "agentplan"] as const, - /** Create agentPlan mutation key */create: () => ["mutation", "agentplan", "create"] as const, - /** Update agentPlan mutation key */update: (id: string | number) => ["mutation", "agentplan", "update", id] as const, - /** Delete agentPlan mutation key */delete: (id: string | number) => ["mutation", "agentplan", "delete", id] as const + /** All agentPlan mutation keys */ all: ['mutation', 'agentplan'] as const, + /** Create agentPlan mutation key */ create: () => ['mutation', 'agentplan', 'create'] as const, + /** Update agentPlan mutation key */ update: (id: string | number) => + ['mutation', 'agentplan', 'update', id] as const, + /** Delete agentPlan mutation key */ delete: (id: string | number) => + ['mutation', 'agentplan', 'delete', id] as const, } as const; export const agentPromptMutationKeys = { - /** All agentPrompt mutation keys */all: ["mutation", "agentprompt"] as const, - /** Create agentPrompt mutation key */create: () => ["mutation", "agentprompt", "create"] as const, - /** Update agentPrompt mutation key */update: (id: string | number) => ["mutation", "agentprompt", "update", id] as const, - /** Delete agentPrompt mutation key */delete: (id: string | number) => ["mutation", "agentprompt", "delete", id] as const + /** All agentPrompt mutation keys */ all: ['mutation', 'agentprompt'] as const, + /** Create agentPrompt mutation key */ create: () => + ['mutation', 'agentprompt', 'create'] as const, + /** Update agentPrompt mutation key */ update: (id: string | number) => + ['mutation', 'agentprompt', 'update', id] as const, + /** Delete agentPrompt mutation key */ delete: (id: string | number) => + ['mutation', 'agentprompt', 'delete', id] as const, } as const; export const agentResourceChunkMutationKeys = { - /** All agentResourceChunk mutation keys */all: ["mutation", "agentresourcechunk"] as const, - /** Create agentResourceChunk mutation key */create: () => ["mutation", "agentresourcechunk", "create"] as const, - /** Update agentResourceChunk mutation key */update: (id: string | number) => ["mutation", "agentresourcechunk", "update", id] as const, - /** Delete agentResourceChunk mutation key */delete: (id: string | number) => ["mutation", "agentresourcechunk", "delete", id] as const + /** All agentResourceChunk mutation keys */ all: ['mutation', 'agentresourcechunk'] as const, + /** Create agentResourceChunk mutation key */ create: () => + ['mutation', 'agentresourcechunk', 'create'] as const, + /** Update agentResourceChunk mutation key */ update: (id: string | number) => + ['mutation', 'agentresourcechunk', 'update', id] as const, + /** Delete agentResourceChunk mutation key */ delete: (id: string | number) => + ['mutation', 'agentresourcechunk', 'delete', id] as const, } as const; export const agentResourceMutationKeys = { - /** All agentResource mutation keys */all: ["mutation", "agentresource"] as const, - /** Create agentResource mutation key */create: () => ["mutation", "agentresource", "create"] as const, - /** Update agentResource mutation key */update: (id: string | number) => ["mutation", "agentresource", "update", id] as const, - /** Delete agentResource mutation key */delete: (id: string | number) => ["mutation", "agentresource", "delete", id] as const + /** All agentResource mutation keys */ all: ['mutation', 'agentresource'] as const, + /** Create agentResource mutation key */ create: () => + ['mutation', 'agentresource', 'create'] as const, + /** Update agentResource mutation key */ update: (id: string | number) => + ['mutation', 'agentresource', 'update', id] as const, + /** Delete agentResource mutation key */ delete: (id: string | number) => + ['mutation', 'agentresource', 'delete', id] as const, } as const; export const agentTaskMutationKeys = { - /** All agentTask mutation keys */all: ["mutation", "agenttask"] as const, - /** Create agentTask mutation key */create: () => ["mutation", "agenttask", "create"] as const, - /** Update agentTask mutation key */update: (id: string | number) => ["mutation", "agenttask", "update", id] as const, - /** Delete agentTask mutation key */delete: (id: string | number) => ["mutation", "agenttask", "delete", id] as const + /** All agentTask mutation keys */ all: ['mutation', 'agenttask'] as const, + /** Create agentTask mutation key */ create: () => ['mutation', 'agenttask', 'create'] as const, + /** Update agentTask mutation key */ update: (id: string | number) => + ['mutation', 'agenttask', 'update', id] as const, + /** Delete agentTask mutation key */ delete: (id: string | number) => + ['mutation', 'agenttask', 'delete', id] as const, } as const; export const agentThreadMutationKeys = { - /** All agentThread mutation keys */all: ["mutation", "agentthread"] as const, - /** Create agentThread mutation key */create: () => ["mutation", "agentthread", "create"] as const, - /** Update agentThread mutation key */update: (id: string | number) => ["mutation", "agentthread", "update", id] as const, - /** Delete agentThread mutation key */delete: (id: string | number) => ["mutation", "agentthread", "delete", id] as const + /** All agentThread mutation keys */ all: ['mutation', 'agentthread'] as const, + /** Create agentThread mutation key */ create: () => + ['mutation', 'agentthread', 'create'] as const, + /** Update agentThread mutation key */ update: (id: string | number) => + ['mutation', 'agentthread', 'update', id] as const, + /** Delete agentThread mutation key */ delete: (id: string | number) => + ['mutation', 'agentthread', 'delete', id] as const, } as const; // ============================================================================ @@ -78,7 +102,10 @@ export const agentThreadMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), } as const; /** @@ -112,5 +139,5 @@ export const mutationKeys = { agentResource: agentResourceMutationKeys, agentTask: agentTaskMutationKeys, agentThread: agentThreadMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/agent/hooks/mutations/index.ts b/sdk/constructive-react/src/agent/hooks/mutations/index.ts index fda68299dc..f0e2d4f9fb 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/index.ts @@ -3,31 +3,31 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateAgentMutation"; -export * from "./useUpdateAgentMutation"; -export * from "./useDeleteAgentMutation"; -export * from "./useCreateAgentMessageMutation"; -export * from "./useUpdateAgentMessageMutation"; -export * from "./useDeleteAgentMessageMutation"; -export * from "./useCreateAgentPersonaMutation"; -export * from "./useUpdateAgentPersonaMutation"; -export * from "./useDeleteAgentPersonaMutation"; -export * from "./useCreateAgentPlanMutation"; -export * from "./useUpdateAgentPlanMutation"; -export * from "./useDeleteAgentPlanMutation"; -export * from "./useCreateAgentPromptMutation"; -export * from "./useUpdateAgentPromptMutation"; -export * from "./useDeleteAgentPromptMutation"; -export * from "./useCreateAgentResourceChunkMutation"; -export * from "./useUpdateAgentResourceChunkMutation"; -export * from "./useDeleteAgentResourceChunkMutation"; -export * from "./useCreateAgentResourceMutation"; -export * from "./useUpdateAgentResourceMutation"; -export * from "./useDeleteAgentResourceMutation"; -export * from "./useCreateAgentTaskMutation"; -export * from "./useUpdateAgentTaskMutation"; -export * from "./useDeleteAgentTaskMutation"; -export * from "./useCreateAgentThreadMutation"; -export * from "./useUpdateAgentThreadMutation"; -export * from "./useDeleteAgentThreadMutation"; -export * from "./useProvisionBucketMutation"; \ No newline at end of file +export * from './useCreateAgentMutation'; +export * from './useUpdateAgentMutation'; +export * from './useDeleteAgentMutation'; +export * from './useCreateAgentMessageMutation'; +export * from './useUpdateAgentMessageMutation'; +export * from './useDeleteAgentMessageMutation'; +export * from './useCreateAgentPersonaMutation'; +export * from './useUpdateAgentPersonaMutation'; +export * from './useDeleteAgentPersonaMutation'; +export * from './useCreateAgentPlanMutation'; +export * from './useUpdateAgentPlanMutation'; +export * from './useDeleteAgentPlanMutation'; +export * from './useCreateAgentPromptMutation'; +export * from './useUpdateAgentPromptMutation'; +export * from './useDeleteAgentPromptMutation'; +export * from './useCreateAgentResourceChunkMutation'; +export * from './useUpdateAgentResourceChunkMutation'; +export * from './useDeleteAgentResourceChunkMutation'; +export * from './useCreateAgentResourceMutation'; +export * from './useUpdateAgentResourceMutation'; +export * from './useDeleteAgentResourceMutation'; +export * from './useCreateAgentTaskMutation'; +export * from './useUpdateAgentTaskMutation'; +export * from './useDeleteAgentTaskMutation'; +export * from './useCreateAgentThreadMutation'; +export * from './useUpdateAgentThreadMutation'; +export * from './useDeleteAgentThreadMutation'; +export * from './useProvisionBucketMutation'; diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentMessageMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentMessageMutation.ts index 8abb527d74..8174a8589c 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentMessageMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentMessageMutation.ts @@ -4,62 +4,85 @@ * 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 { agentMessageKeys } from "../query-keys"; -import { agentMessageMutationKeys } from "../mutation-keys"; -import type { AgentMessageSelect, AgentMessageWithRelations, CreateAgentMessageInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentMessageSelect, AgentMessageWithRelations, CreateAgentMessageInput } from "../../orm/input-types"; +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 { agentMessageKeys } from '../query-keys'; +import { agentMessageMutationKeys } from '../mutation-keys'; +import type { + AgentMessageSelect, + AgentMessageWithRelations, + CreateAgentMessageInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentMessageSelect, + AgentMessageWithRelations, + CreateAgentMessageInput, +} from '../../orm/input-types'; /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentMessageMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentMessageMutation(params: { - selection: ({ - fields: S & AgentMessageSelect; - } & HookStrictSelect, AgentMessageSelect>); -} & Omit; - }; -}, Error, CreateAgentMessageInput["agentMessage"]>, "mutationFn">): UseMutationResult<{ - createAgentMessage: { - agentMessage: InferSelectResult; - }; -}, Error, CreateAgentMessageInput["agentMessage"]>; -export function useCreateAgentMessageMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentMessageMutation( + params: { + selection: { + fields: S & AgentMessageSelect; + } & HookStrictSelect, AgentMessageSelect>; + } & Omit< + UseMutationOptions< + { + createAgentMessage: { + agentMessage: InferSelectResult; + }; + }, + Error, + CreateAgentMessageInput['agentMessage'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentMessage: { + agentMessage: InferSelectResult; + }; + }, + Error, + CreateAgentMessageInput['agentMessage'] +>; +export function useCreateAgentMessageMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentMessageMutationKeys.create(), - mutationFn: (data: CreateAgentMessageInput["agentMessage"]) => getClient().agentMessage.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentMessageInput['agentMessage']) => + getClient() + .agentMessage.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentMessageKeys.lists() + queryKey: agentMessageKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentMutation.ts index dfff9e9063..ba2097157a 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentMutation.ts @@ -4,62 +4,77 @@ * 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 { agentKeys } from "../query-keys"; -import { agentMutationKeys } from "../mutation-keys"; -import type { AgentSelect, AgentWithRelations, CreateAgentInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentSelect, AgentWithRelations, CreateAgentInput } from "../../orm/input-types"; +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 { agentKeys } from '../query-keys'; +import { agentMutationKeys } from '../mutation-keys'; +import type { AgentSelect, AgentWithRelations, CreateAgentInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentSelect, AgentWithRelations, CreateAgentInput } from '../../orm/input-types'; /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentMutation(params: { - selection: ({ - fields: S & AgentSelect; - } & HookStrictSelect, AgentSelect>); -} & Omit; - }; -}, Error, CreateAgentInput["agent"]>, "mutationFn">): UseMutationResult<{ - createAgent: { - agent: InferSelectResult; - }; -}, Error, CreateAgentInput["agent"]>; -export function useCreateAgentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentMutation( + params: { + selection: { + fields: S & AgentSelect; + } & HookStrictSelect, AgentSelect>; + } & Omit< + UseMutationOptions< + { + createAgent: { + agent: InferSelectResult; + }; + }, + Error, + CreateAgentInput['agent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgent: { + agent: InferSelectResult; + }; + }, + Error, + CreateAgentInput['agent'] +>; +export function useCreateAgentMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentMutationKeys.create(), - mutationFn: (data: CreateAgentInput["agent"]) => getClient().agent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentInput['agent']) => + getClient() + .agent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentKeys.lists() + queryKey: agentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPersonaMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPersonaMutation.ts index bbd32a1023..f576ce7443 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPersonaMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPersonaMutation.ts @@ -4,62 +4,85 @@ * 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 { agentPersonaKeys } from "../query-keys"; -import { agentPersonaMutationKeys } from "../mutation-keys"; -import type { AgentPersonaSelect, AgentPersonaWithRelations, CreateAgentPersonaInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPersonaSelect, AgentPersonaWithRelations, CreateAgentPersonaInput } from "../../orm/input-types"; +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 { agentPersonaKeys } from '../query-keys'; +import { agentPersonaMutationKeys } from '../mutation-keys'; +import type { + AgentPersonaSelect, + AgentPersonaWithRelations, + CreateAgentPersonaInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentPersonaSelect, + AgentPersonaWithRelations, + CreateAgentPersonaInput, +} from '../../orm/input-types'; /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentPersonaMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentPersonaMutation(params: { - selection: ({ - fields: S & AgentPersonaSelect; - } & HookStrictSelect, AgentPersonaSelect>); -} & Omit; - }; -}, Error, CreateAgentPersonaInput["agentPersona"]>, "mutationFn">): UseMutationResult<{ - createAgentPersona: { - agentPersona: InferSelectResult; - }; -}, Error, CreateAgentPersonaInput["agentPersona"]>; -export function useCreateAgentPersonaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentPersonaMutation( + params: { + selection: { + fields: S & AgentPersonaSelect; + } & HookStrictSelect, AgentPersonaSelect>; + } & Omit< + UseMutationOptions< + { + createAgentPersona: { + agentPersona: InferSelectResult; + }; + }, + Error, + CreateAgentPersonaInput['agentPersona'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentPersona: { + agentPersona: InferSelectResult; + }; + }, + Error, + CreateAgentPersonaInput['agentPersona'] +>; +export function useCreateAgentPersonaMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPersonaMutationKeys.create(), - mutationFn: (data: CreateAgentPersonaInput["agentPersona"]) => getClient().agentPersona.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentPersonaInput['agentPersona']) => + getClient() + .agentPersona.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentPersonaKeys.lists() + queryKey: agentPersonaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPlanMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPlanMutation.ts index 69ebd7c646..1f66bc5348 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPlanMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPlanMutation.ts @@ -4,62 +4,85 @@ * 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 { agentPlanKeys } from "../query-keys"; -import { agentPlanMutationKeys } from "../mutation-keys"; -import type { AgentPlanSelect, AgentPlanWithRelations, CreateAgentPlanInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPlanSelect, AgentPlanWithRelations, CreateAgentPlanInput } from "../../orm/input-types"; +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 { agentPlanKeys } from '../query-keys'; +import { agentPlanMutationKeys } from '../mutation-keys'; +import type { + AgentPlanSelect, + AgentPlanWithRelations, + CreateAgentPlanInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentPlanSelect, + AgentPlanWithRelations, + CreateAgentPlanInput, +} from '../../orm/input-types'; /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentPlanMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentPlanMutation(params: { - selection: ({ - fields: S & AgentPlanSelect; - } & HookStrictSelect, AgentPlanSelect>); -} & Omit; - }; -}, Error, CreateAgentPlanInput["agentPlan"]>, "mutationFn">): UseMutationResult<{ - createAgentPlan: { - agentPlan: InferSelectResult; - }; -}, Error, CreateAgentPlanInput["agentPlan"]>; -export function useCreateAgentPlanMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentPlanMutation( + params: { + selection: { + fields: S & AgentPlanSelect; + } & HookStrictSelect, AgentPlanSelect>; + } & Omit< + UseMutationOptions< + { + createAgentPlan: { + agentPlan: InferSelectResult; + }; + }, + Error, + CreateAgentPlanInput['agentPlan'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentPlan: { + agentPlan: InferSelectResult; + }; + }, + Error, + CreateAgentPlanInput['agentPlan'] +>; +export function useCreateAgentPlanMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPlanMutationKeys.create(), - mutationFn: (data: CreateAgentPlanInput["agentPlan"]) => getClient().agentPlan.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentPlanInput['agentPlan']) => + getClient() + .agentPlan.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentPlanKeys.lists() + queryKey: agentPlanKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPromptMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPromptMutation.ts index d1311b611e..8bbcc906cd 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPromptMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentPromptMutation.ts @@ -4,62 +4,85 @@ * 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 { agentPromptKeys } from "../query-keys"; -import { agentPromptMutationKeys } from "../mutation-keys"; -import type { AgentPromptSelect, AgentPromptWithRelations, CreateAgentPromptInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPromptSelect, AgentPromptWithRelations, CreateAgentPromptInput } from "../../orm/input-types"; +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 { agentPromptKeys } from '../query-keys'; +import { agentPromptMutationKeys } from '../mutation-keys'; +import type { + AgentPromptSelect, + AgentPromptWithRelations, + CreateAgentPromptInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentPromptSelect, + AgentPromptWithRelations, + CreateAgentPromptInput, +} from '../../orm/input-types'; /** * Shared system prompt templates for agent conversations - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentPromptMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentPromptMutation(params: { - selection: ({ - fields: S & AgentPromptSelect; - } & HookStrictSelect, AgentPromptSelect>); -} & Omit; - }; -}, Error, CreateAgentPromptInput["agentPrompt"]>, "mutationFn">): UseMutationResult<{ - createAgentPrompt: { - agentPrompt: InferSelectResult; - }; -}, Error, CreateAgentPromptInput["agentPrompt"]>; -export function useCreateAgentPromptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentPromptMutation( + params: { + selection: { + fields: S & AgentPromptSelect; + } & HookStrictSelect, AgentPromptSelect>; + } & Omit< + UseMutationOptions< + { + createAgentPrompt: { + agentPrompt: InferSelectResult; + }; + }, + Error, + CreateAgentPromptInput['agentPrompt'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentPrompt: { + agentPrompt: InferSelectResult; + }; + }, + Error, + CreateAgentPromptInput['agentPrompt'] +>; +export function useCreateAgentPromptMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPromptMutationKeys.create(), - mutationFn: (data: CreateAgentPromptInput["agentPrompt"]) => getClient().agentPrompt.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentPromptInput['agentPrompt']) => + getClient() + .agentPrompt.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentPromptKeys.lists() + queryKey: agentPromptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentResourceChunkMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentResourceChunkMutation.ts index 619cd96360..3dffb0bb6c 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentResourceChunkMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentResourceChunkMutation.ts @@ -4,62 +4,88 @@ * 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 { agentResourceChunkKeys } from "../query-keys"; -import { agentResourceChunkMutationKeys } from "../mutation-keys"; -import type { AgentResourceChunkSelect, AgentResourceChunkWithRelations, CreateAgentResourceChunkInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceChunkSelect, AgentResourceChunkWithRelations, CreateAgentResourceChunkInput } from "../../orm/input-types"; +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 { agentResourceChunkKeys } from '../query-keys'; +import { agentResourceChunkMutationKeys } from '../mutation-keys'; +import type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, + CreateAgentResourceChunkInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, + CreateAgentResourceChunkInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a AgentResourceChunk - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentResourceChunkMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentResourceChunkMutation(params: { - selection: ({ - fields: S & AgentResourceChunkSelect; - } & HookStrictSelect, AgentResourceChunkSelect>); -} & Omit; - }; -}, Error, CreateAgentResourceChunkInput["agentResourceChunk"]>, "mutationFn">): UseMutationResult<{ - createAgentResourceChunk: { - agentResourceChunk: InferSelectResult; - }; -}, Error, CreateAgentResourceChunkInput["agentResourceChunk"]>; -export function useCreateAgentResourceChunkMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentResourceChunkMutation( + params: { + selection: { + fields: S & AgentResourceChunkSelect; + } & HookStrictSelect, AgentResourceChunkSelect>; + } & Omit< + UseMutationOptions< + { + createAgentResourceChunk: { + agentResourceChunk: InferSelectResult; + }; + }, + Error, + CreateAgentResourceChunkInput['agentResourceChunk'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentResourceChunk: { + agentResourceChunk: InferSelectResult; + }; + }, + Error, + CreateAgentResourceChunkInput['agentResourceChunk'] +>; +export function useCreateAgentResourceChunkMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentResourceChunkMutationKeys.create(), - mutationFn: (data: CreateAgentResourceChunkInput["agentResourceChunk"]) => getClient().agentResourceChunk.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentResourceChunkInput['agentResourceChunk']) => + getClient() + .agentResourceChunk.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentResourceChunkKeys.lists() + queryKey: agentResourceChunkKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentResourceMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentResourceMutation.ts index 74155789b0..87b7faafdd 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentResourceMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentResourceMutation.ts @@ -4,62 +4,85 @@ * 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 { agentResourceKeys } from "../query-keys"; -import { agentResourceMutationKeys } from "../mutation-keys"; -import type { AgentResourceSelect, AgentResourceWithRelations, CreateAgentResourceInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceSelect, AgentResourceWithRelations, CreateAgentResourceInput } from "../../orm/input-types"; +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 { agentResourceKeys } from '../query-keys'; +import { agentResourceMutationKeys } from '../mutation-keys'; +import type { + AgentResourceSelect, + AgentResourceWithRelations, + CreateAgentResourceInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentResourceSelect, + AgentResourceWithRelations, + CreateAgentResourceInput, +} from '../../orm/input-types'; /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentResourceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentResourceMutation(params: { - selection: ({ - fields: S & AgentResourceSelect; - } & HookStrictSelect, AgentResourceSelect>); -} & Omit; - }; -}, Error, CreateAgentResourceInput["agentResource"]>, "mutationFn">): UseMutationResult<{ - createAgentResource: { - agentResource: InferSelectResult; - }; -}, Error, CreateAgentResourceInput["agentResource"]>; -export function useCreateAgentResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentResourceMutation( + params: { + selection: { + fields: S & AgentResourceSelect; + } & HookStrictSelect, AgentResourceSelect>; + } & Omit< + UseMutationOptions< + { + createAgentResource: { + agentResource: InferSelectResult; + }; + }, + Error, + CreateAgentResourceInput['agentResource'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentResource: { + agentResource: InferSelectResult; + }; + }, + Error, + CreateAgentResourceInput['agentResource'] +>; +export function useCreateAgentResourceMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentResourceMutationKeys.create(), - mutationFn: (data: CreateAgentResourceInput["agentResource"]) => getClient().agentResource.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentResourceInput['agentResource']) => + getClient() + .agentResource.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentResourceKeys.lists() + queryKey: agentResourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentTaskMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentTaskMutation.ts index ca14aa9f51..7c32729d7f 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentTaskMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentTaskMutation.ts @@ -4,62 +4,85 @@ * 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 { agentTaskKeys } from "../query-keys"; -import { agentTaskMutationKeys } from "../mutation-keys"; -import type { AgentTaskSelect, AgentTaskWithRelations, CreateAgentTaskInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentTaskSelect, AgentTaskWithRelations, CreateAgentTaskInput } from "../../orm/input-types"; +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 { agentTaskKeys } from '../query-keys'; +import { agentTaskMutationKeys } from '../mutation-keys'; +import type { + AgentTaskSelect, + AgentTaskWithRelations, + CreateAgentTaskInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentTaskSelect, + AgentTaskWithRelations, + CreateAgentTaskInput, +} from '../../orm/input-types'; /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentTaskMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentTaskMutation(params: { - selection: ({ - fields: S & AgentTaskSelect; - } & HookStrictSelect, AgentTaskSelect>); -} & Omit; - }; -}, Error, CreateAgentTaskInput["agentTask"]>, "mutationFn">): UseMutationResult<{ - createAgentTask: { - agentTask: InferSelectResult; - }; -}, Error, CreateAgentTaskInput["agentTask"]>; -export function useCreateAgentTaskMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentTaskMutation( + params: { + selection: { + fields: S & AgentTaskSelect; + } & HookStrictSelect, AgentTaskSelect>; + } & Omit< + UseMutationOptions< + { + createAgentTask: { + agentTask: InferSelectResult; + }; + }, + Error, + CreateAgentTaskInput['agentTask'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentTask: { + agentTask: InferSelectResult; + }; + }, + Error, + CreateAgentTaskInput['agentTask'] +>; +export function useCreateAgentTaskMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentTaskMutationKeys.create(), - mutationFn: (data: CreateAgentTaskInput["agentTask"]) => getClient().agentTask.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentTaskInput['agentTask']) => + getClient() + .agentTask.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentTaskKeys.lists() + queryKey: agentTaskKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentThreadMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentThreadMutation.ts index 4aee640650..22f5f3cf55 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentThreadMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useCreateAgentThreadMutation.ts @@ -4,62 +4,85 @@ * 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 { agentThreadKeys } from "../query-keys"; -import { agentThreadMutationKeys } from "../mutation-keys"; -import type { AgentThreadSelect, AgentThreadWithRelations, CreateAgentThreadInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentThreadSelect, AgentThreadWithRelations, CreateAgentThreadInput } from "../../orm/input-types"; +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 { agentThreadKeys } from '../query-keys'; +import { agentThreadMutationKeys } from '../mutation-keys'; +import type { + AgentThreadSelect, + AgentThreadWithRelations, + CreateAgentThreadInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentThreadSelect, + AgentThreadWithRelations, + CreateAgentThreadInput, +} from '../../orm/input-types'; /** * Top-level AI/LLM conversation thread - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentThreadMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentThreadMutation(params: { - selection: ({ - fields: S & AgentThreadSelect; - } & HookStrictSelect, AgentThreadSelect>); -} & Omit; - }; -}, Error, CreateAgentThreadInput["agentThread"]>, "mutationFn">): UseMutationResult<{ - createAgentThread: { - agentThread: InferSelectResult; - }; -}, Error, CreateAgentThreadInput["agentThread"]>; -export function useCreateAgentThreadMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentThreadMutation( + params: { + selection: { + fields: S & AgentThreadSelect; + } & HookStrictSelect, AgentThreadSelect>; + } & Omit< + UseMutationOptions< + { + createAgentThread: { + agentThread: InferSelectResult; + }; + }, + Error, + CreateAgentThreadInput['agentThread'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentThread: { + agentThread: InferSelectResult; + }; + }, + Error, + CreateAgentThreadInput['agentThread'] +>; +export function useCreateAgentThreadMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentThreadMutationKeys.create(), - mutationFn: (data: CreateAgentThreadInput["agentThread"]) => getClient().agentThread.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentThreadInput['agentThread']) => + getClient() + .agentThread.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentThreadKeys.lists() + queryKey: agentThreadKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentMessageMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentMessageMutation.ts index 22726706f9..96214fda38 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentMessageMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentMessageMutation.ts @@ -4,77 +4,95 @@ * 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 { agentMessageKeys } from "../query-keys"; -import { agentMessageMutationKeys } from "../mutation-keys"; -import type { AgentMessageSelect, AgentMessageWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentMessageSelect, AgentMessageWithRelations } from "../../orm/input-types"; +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 { agentMessageKeys } from '../query-keys'; +import { agentMessageMutationKeys } from '../mutation-keys'; +import type { AgentMessageSelect, AgentMessageWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentMessageSelect, AgentMessageWithRelations } from '../../orm/input-types'; /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentMessageMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentMessageMutation(params: { - selection: ({ - fields: S & AgentMessageSelect; - } & HookStrictSelect, AgentMessageSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentMessage: { - agentMessage: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentMessageMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentMessageMutation( + params: { + selection: { + fields: S & AgentMessageSelect; + } & HookStrictSelect, AgentMessageSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentMessage: { + agentMessage: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentMessage: { + agentMessage: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentMessageMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentMessageMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentMessage.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentMessage.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentMessageKeys.detail(variables.id) + queryKey: agentMessageKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentMessageKeys.lists() + queryKey: agentMessageKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentMutation.ts index 929bd0625c..2413360723 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentMutation.ts @@ -4,77 +4,95 @@ * 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 { agentKeys } from "../query-keys"; -import { agentMutationKeys } from "../mutation-keys"; -import type { AgentSelect, AgentWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentSelect, AgentWithRelations } from "../../orm/input-types"; +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 { agentKeys } from '../query-keys'; +import { agentMutationKeys } from '../mutation-keys'; +import type { AgentSelect, AgentWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentSelect, AgentWithRelations } from '../../orm/input-types'; /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentMutation(params: { - selection: ({ - fields: S & AgentSelect; - } & HookStrictSelect, AgentSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgent: { - agent: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentMutation( + params: { + selection: { + fields: S & AgentSelect; + } & HookStrictSelect, AgentSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgent: { + agent: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgent: { + agent: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agent.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agent.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentKeys.detail(variables.id) + queryKey: agentKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentKeys.lists() + queryKey: agentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPersonaMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPersonaMutation.ts index 9e1c9120a2..f189e1faad 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPersonaMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPersonaMutation.ts @@ -4,77 +4,95 @@ * 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 { agentPersonaKeys } from "../query-keys"; -import { agentPersonaMutationKeys } from "../mutation-keys"; -import type { AgentPersonaSelect, AgentPersonaWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPersonaSelect, AgentPersonaWithRelations } from "../../orm/input-types"; +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 { agentPersonaKeys } from '../query-keys'; +import { agentPersonaMutationKeys } from '../mutation-keys'; +import type { AgentPersonaSelect, AgentPersonaWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentPersonaSelect, AgentPersonaWithRelations } from '../../orm/input-types'; /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentPersonaMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentPersonaMutation(params: { - selection: ({ - fields: S & AgentPersonaSelect; - } & HookStrictSelect, AgentPersonaSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentPersona: { - agentPersona: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentPersonaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentPersonaMutation( + params: { + selection: { + fields: S & AgentPersonaSelect; + } & HookStrictSelect, AgentPersonaSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentPersona: { + agentPersona: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentPersona: { + agentPersona: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentPersonaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPersonaMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentPersona.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentPersona.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentPersonaKeys.detail(variables.id) + queryKey: agentPersonaKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentPersonaKeys.lists() + queryKey: agentPersonaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPlanMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPlanMutation.ts index 6359bc1f09..480e8dc5b8 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPlanMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPlanMutation.ts @@ -4,77 +4,95 @@ * 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 { agentPlanKeys } from "../query-keys"; -import { agentPlanMutationKeys } from "../mutation-keys"; -import type { AgentPlanSelect, AgentPlanWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPlanSelect, AgentPlanWithRelations } from "../../orm/input-types"; +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 { agentPlanKeys } from '../query-keys'; +import { agentPlanMutationKeys } from '../mutation-keys'; +import type { AgentPlanSelect, AgentPlanWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentPlanSelect, AgentPlanWithRelations } from '../../orm/input-types'; /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentPlanMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentPlanMutation(params: { - selection: ({ - fields: S & AgentPlanSelect; - } & HookStrictSelect, AgentPlanSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentPlan: { - agentPlan: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentPlanMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentPlanMutation( + params: { + selection: { + fields: S & AgentPlanSelect; + } & HookStrictSelect, AgentPlanSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentPlan: { + agentPlan: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentPlan: { + agentPlan: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentPlanMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPlanMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentPlan.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentPlan.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentPlanKeys.detail(variables.id) + queryKey: agentPlanKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentPlanKeys.lists() + queryKey: agentPlanKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPromptMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPromptMutation.ts index f4bba67f55..2878dc2bff 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPromptMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentPromptMutation.ts @@ -4,77 +4,95 @@ * 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 { agentPromptKeys } from "../query-keys"; -import { agentPromptMutationKeys } from "../mutation-keys"; -import type { AgentPromptSelect, AgentPromptWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPromptSelect, AgentPromptWithRelations } from "../../orm/input-types"; +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 { agentPromptKeys } from '../query-keys'; +import { agentPromptMutationKeys } from '../mutation-keys'; +import type { AgentPromptSelect, AgentPromptWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentPromptSelect, AgentPromptWithRelations } from '../../orm/input-types'; /** * Shared system prompt templates for agent conversations - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentPromptMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentPromptMutation(params: { - selection: ({ - fields: S & AgentPromptSelect; - } & HookStrictSelect, AgentPromptSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentPrompt: { - agentPrompt: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentPromptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentPromptMutation( + params: { + selection: { + fields: S & AgentPromptSelect; + } & HookStrictSelect, AgentPromptSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentPrompt: { + agentPrompt: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentPrompt: { + agentPrompt: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentPromptMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPromptMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentPrompt.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentPrompt.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentPromptKeys.detail(variables.id) + queryKey: agentPromptKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentPromptKeys.lists() + queryKey: agentPromptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentResourceChunkMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentResourceChunkMutation.ts index a1344ef743..9bcb78fe6b 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentResourceChunkMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentResourceChunkMutation.ts @@ -4,77 +4,101 @@ * 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 { agentResourceChunkKeys } from "../query-keys"; -import { agentResourceChunkMutationKeys } from "../mutation-keys"; -import type { AgentResourceChunkSelect, AgentResourceChunkWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceChunkSelect, AgentResourceChunkWithRelations } from "../../orm/input-types"; +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 { agentResourceChunkKeys } from '../query-keys'; +import { agentResourceChunkMutationKeys } from '../mutation-keys'; +import type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a AgentResourceChunk with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentResourceChunkMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentResourceChunkMutation(params: { - selection: ({ - fields: S & AgentResourceChunkSelect; - } & HookStrictSelect, AgentResourceChunkSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentResourceChunk: { - agentResourceChunk: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentResourceChunkMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentResourceChunkMutation( + params: { + selection: { + fields: S & AgentResourceChunkSelect; + } & HookStrictSelect, AgentResourceChunkSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentResourceChunk: { + agentResourceChunk: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentResourceChunk: { + agentResourceChunk: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentResourceChunkMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentResourceChunkMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentResourceChunk.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentResourceChunk.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentResourceChunkKeys.detail(variables.id) + queryKey: agentResourceChunkKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentResourceChunkKeys.lists() + queryKey: agentResourceChunkKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentResourceMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentResourceMutation.ts index 181ee44b4e..575a7e01d5 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentResourceMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentResourceMutation.ts @@ -4,77 +4,95 @@ * 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 { agentResourceKeys } from "../query-keys"; -import { agentResourceMutationKeys } from "../mutation-keys"; -import type { AgentResourceSelect, AgentResourceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceSelect, AgentResourceWithRelations } from "../../orm/input-types"; +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 { agentResourceKeys } from '../query-keys'; +import { agentResourceMutationKeys } from '../mutation-keys'; +import type { AgentResourceSelect, AgentResourceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentResourceSelect, AgentResourceWithRelations } from '../../orm/input-types'; /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentResourceMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentResourceMutation(params: { - selection: ({ - fields: S & AgentResourceSelect; - } & HookStrictSelect, AgentResourceSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentResource: { - agentResource: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentResourceMutation( + params: { + selection: { + fields: S & AgentResourceSelect; + } & HookStrictSelect, AgentResourceSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentResource: { + agentResource: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentResource: { + agentResource: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentResourceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentResourceMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentResource.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentResource.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentResourceKeys.detail(variables.id) + queryKey: agentResourceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentResourceKeys.lists() + queryKey: agentResourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentTaskMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentTaskMutation.ts index 18d5a7e26e..8d4ac8ab93 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentTaskMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentTaskMutation.ts @@ -4,77 +4,95 @@ * 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 { agentTaskKeys } from "../query-keys"; -import { agentTaskMutationKeys } from "../mutation-keys"; -import type { AgentTaskSelect, AgentTaskWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentTaskSelect, AgentTaskWithRelations } from "../../orm/input-types"; +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 { agentTaskKeys } from '../query-keys'; +import { agentTaskMutationKeys } from '../mutation-keys'; +import type { AgentTaskSelect, AgentTaskWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentTaskSelect, AgentTaskWithRelations } from '../../orm/input-types'; /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentTaskMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentTaskMutation(params: { - selection: ({ - fields: S & AgentTaskSelect; - } & HookStrictSelect, AgentTaskSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentTask: { - agentTask: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentTaskMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentTaskMutation( + params: { + selection: { + fields: S & AgentTaskSelect; + } & HookStrictSelect, AgentTaskSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentTask: { + agentTask: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentTask: { + agentTask: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentTaskMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentTaskMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentTask.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentTask.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentTaskKeys.detail(variables.id) + queryKey: agentTaskKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentTaskKeys.lists() + queryKey: agentTaskKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentThreadMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentThreadMutation.ts index 40e6d57092..6800d76b65 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentThreadMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useDeleteAgentThreadMutation.ts @@ -4,77 +4,95 @@ * 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 { agentThreadKeys } from "../query-keys"; -import { agentThreadMutationKeys } from "../mutation-keys"; -import type { AgentThreadSelect, AgentThreadWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentThreadSelect, AgentThreadWithRelations } from "../../orm/input-types"; +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 { agentThreadKeys } from '../query-keys'; +import { agentThreadMutationKeys } from '../mutation-keys'; +import type { AgentThreadSelect, AgentThreadWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentThreadSelect, AgentThreadWithRelations } from '../../orm/input-types'; /** * Top-level AI/LLM conversation thread - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentThreadMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentThreadMutation(params: { - selection: ({ - fields: S & AgentThreadSelect; - } & HookStrictSelect, AgentThreadSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentThread: { - agentThread: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentThreadMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentThreadMutation( + params: { + selection: { + fields: S & AgentThreadSelect; + } & HookStrictSelect, AgentThreadSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentThread: { + agentThread: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentThread: { + agentThread: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentThreadMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentThreadMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentThread.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentThread.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentThreadKeys.detail(variables.id) + queryKey: agentThreadKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentThreadKeys.lists() + queryKey: agentThreadKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentMessageMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentMessageMutation.ts index 4e341d0875..f221fb4c2e 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentMessageMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentMessageMutation.ts @@ -4,83 +4,107 @@ * 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 { agentMessageKeys } from "../query-keys"; -import { agentMessageMutationKeys } from "../mutation-keys"; -import type { AgentMessageSelect, AgentMessageWithRelations, AgentMessagePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentMessageSelect, AgentMessageWithRelations, AgentMessagePatch } from "../../orm/input-types"; +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 { agentMessageKeys } from '../query-keys'; +import { agentMessageMutationKeys } from '../mutation-keys'; +import type { + AgentMessageSelect, + AgentMessageWithRelations, + AgentMessagePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentMessageSelect, + AgentMessageWithRelations, + AgentMessagePatch, +} from '../../orm/input-types'; /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentMessageMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentMessagePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentMessageMutation(params: { - selection: ({ - fields: S & AgentMessageSelect; - } & HookStrictSelect, AgentMessageSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentMessagePatch: AgentMessagePatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentMessage: { - agentMessage: InferSelectResult; - }; -}, Error, { - id: string; - agentMessagePatch: AgentMessagePatch; -}>; -export function useUpdateAgentMessageMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentMessageMutation( + params: { + selection: { + fields: S & AgentMessageSelect; + } & HookStrictSelect, AgentMessageSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentMessage: { + agentMessage: InferSelectResult; + }; + }, + Error, + { + id: string; + agentMessagePatch: AgentMessagePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentMessage: { + agentMessage: InferSelectResult; + }; + }, + Error, + { + id: string; + agentMessagePatch: AgentMessagePatch; + } +>; +export function useUpdateAgentMessageMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentMessagePatch: AgentMessagePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentMessageMutationKeys.all, - mutationFn: ({ - id, - agentMessagePatch - }: { - id: string; - agentMessagePatch: AgentMessagePatch; - }) => getClient().agentMessage.update({ - where: { - id - }, - data: agentMessagePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, agentMessagePatch }: { id: string; agentMessagePatch: AgentMessagePatch }) => + getClient() + .agentMessage.update({ + where: { + id, + }, + data: agentMessagePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentMessageKeys.detail(variables.id) + queryKey: agentMessageKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentMessageKeys.lists() + queryKey: agentMessageKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentMutation.ts index acd5d11fbf..4138dc4dc9 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentMutation.ts @@ -4,83 +4,99 @@ * 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 { agentKeys } from "../query-keys"; -import { agentMutationKeys } from "../mutation-keys"; -import type { AgentSelect, AgentWithRelations, AgentPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentSelect, AgentWithRelations, AgentPatch } from "../../orm/input-types"; +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 { agentKeys } from '../query-keys'; +import { agentMutationKeys } from '../mutation-keys'; +import type { AgentSelect, AgentWithRelations, AgentPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentSelect, AgentWithRelations, AgentPatch } from '../../orm/input-types'; /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentMutation(params: { - selection: ({ - fields: S & AgentSelect; - } & HookStrictSelect, AgentSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentPatch: AgentPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgent: { - agent: InferSelectResult; - }; -}, Error, { - id: string; - agentPatch: AgentPatch; -}>; -export function useUpdateAgentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentMutation( + params: { + selection: { + fields: S & AgentSelect; + } & HookStrictSelect, AgentSelect>; + } & Omit< + UseMutationOptions< + { + updateAgent: { + agent: InferSelectResult; + }; + }, + Error, + { + id: string; + agentPatch: AgentPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgent: { + agent: InferSelectResult; + }; + }, + Error, + { + id: string; + agentPatch: AgentPatch; + } +>; +export function useUpdateAgentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentPatch: AgentPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentMutationKeys.all, - mutationFn: ({ - id, - agentPatch - }: { - id: string; - agentPatch: AgentPatch; - }) => getClient().agent.update({ - where: { - id - }, - data: agentPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, agentPatch }: { id: string; agentPatch: AgentPatch }) => + getClient() + .agent.update({ + where: { + id, + }, + data: agentPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentKeys.detail(variables.id) + queryKey: agentKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentKeys.lists() + queryKey: agentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPersonaMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPersonaMutation.ts index 863e1985aa..e8e09c42bc 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPersonaMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPersonaMutation.ts @@ -4,83 +4,107 @@ * 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 { agentPersonaKeys } from "../query-keys"; -import { agentPersonaMutationKeys } from "../mutation-keys"; -import type { AgentPersonaSelect, AgentPersonaWithRelations, AgentPersonaPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPersonaSelect, AgentPersonaWithRelations, AgentPersonaPatch } from "../../orm/input-types"; +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 { agentPersonaKeys } from '../query-keys'; +import { agentPersonaMutationKeys } from '../mutation-keys'; +import type { + AgentPersonaSelect, + AgentPersonaWithRelations, + AgentPersonaPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentPersonaSelect, + AgentPersonaWithRelations, + AgentPersonaPatch, +} from '../../orm/input-types'; /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentPersonaMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentPersonaPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentPersonaMutation(params: { - selection: ({ - fields: S & AgentPersonaSelect; - } & HookStrictSelect, AgentPersonaSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentPersonaPatch: AgentPersonaPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentPersona: { - agentPersona: InferSelectResult; - }; -}, Error, { - id: string; - agentPersonaPatch: AgentPersonaPatch; -}>; -export function useUpdateAgentPersonaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentPersonaMutation( + params: { + selection: { + fields: S & AgentPersonaSelect; + } & HookStrictSelect, AgentPersonaSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentPersona: { + agentPersona: InferSelectResult; + }; + }, + Error, + { + id: string; + agentPersonaPatch: AgentPersonaPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentPersona: { + agentPersona: InferSelectResult; + }; + }, + Error, + { + id: string; + agentPersonaPatch: AgentPersonaPatch; + } +>; +export function useUpdateAgentPersonaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentPersonaPatch: AgentPersonaPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPersonaMutationKeys.all, - mutationFn: ({ - id, - agentPersonaPatch - }: { - id: string; - agentPersonaPatch: AgentPersonaPatch; - }) => getClient().agentPersona.update({ - where: { - id - }, - data: agentPersonaPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, agentPersonaPatch }: { id: string; agentPersonaPatch: AgentPersonaPatch }) => + getClient() + .agentPersona.update({ + where: { + id, + }, + data: agentPersonaPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentPersonaKeys.detail(variables.id) + queryKey: agentPersonaKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentPersonaKeys.lists() + queryKey: agentPersonaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPlanMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPlanMutation.ts index 9b4bcbd8d4..159936f825 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPlanMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPlanMutation.ts @@ -4,83 +4,107 @@ * 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 { agentPlanKeys } from "../query-keys"; -import { agentPlanMutationKeys } from "../mutation-keys"; -import type { AgentPlanSelect, AgentPlanWithRelations, AgentPlanPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPlanSelect, AgentPlanWithRelations, AgentPlanPatch } from "../../orm/input-types"; +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 { agentPlanKeys } from '../query-keys'; +import { agentPlanMutationKeys } from '../mutation-keys'; +import type { + AgentPlanSelect, + AgentPlanWithRelations, + AgentPlanPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentPlanSelect, + AgentPlanWithRelations, + AgentPlanPatch, +} from '../../orm/input-types'; /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentPlanMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentPlanPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentPlanMutation(params: { - selection: ({ - fields: S & AgentPlanSelect; - } & HookStrictSelect, AgentPlanSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentPlanPatch: AgentPlanPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentPlan: { - agentPlan: InferSelectResult; - }; -}, Error, { - id: string; - agentPlanPatch: AgentPlanPatch; -}>; -export function useUpdateAgentPlanMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentPlanMutation( + params: { + selection: { + fields: S & AgentPlanSelect; + } & HookStrictSelect, AgentPlanSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentPlan: { + agentPlan: InferSelectResult; + }; + }, + Error, + { + id: string; + agentPlanPatch: AgentPlanPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentPlan: { + agentPlan: InferSelectResult; + }; + }, + Error, + { + id: string; + agentPlanPatch: AgentPlanPatch; + } +>; +export function useUpdateAgentPlanMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentPlanPatch: AgentPlanPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPlanMutationKeys.all, - mutationFn: ({ - id, - agentPlanPatch - }: { - id: string; - agentPlanPatch: AgentPlanPatch; - }) => getClient().agentPlan.update({ - where: { - id - }, - data: agentPlanPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, agentPlanPatch }: { id: string; agentPlanPatch: AgentPlanPatch }) => + getClient() + .agentPlan.update({ + where: { + id, + }, + data: agentPlanPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentPlanKeys.detail(variables.id) + queryKey: agentPlanKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentPlanKeys.lists() + queryKey: agentPlanKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPromptMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPromptMutation.ts index 7d6686bf38..9db9d523f5 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPromptMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentPromptMutation.ts @@ -4,83 +4,107 @@ * 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 { agentPromptKeys } from "../query-keys"; -import { agentPromptMutationKeys } from "../mutation-keys"; -import type { AgentPromptSelect, AgentPromptWithRelations, AgentPromptPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPromptSelect, AgentPromptWithRelations, AgentPromptPatch } from "../../orm/input-types"; +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 { agentPromptKeys } from '../query-keys'; +import { agentPromptMutationKeys } from '../mutation-keys'; +import type { + AgentPromptSelect, + AgentPromptWithRelations, + AgentPromptPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentPromptSelect, + AgentPromptWithRelations, + AgentPromptPatch, +} from '../../orm/input-types'; /** * Shared system prompt templates for agent conversations - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentPromptMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentPromptPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentPromptMutation(params: { - selection: ({ - fields: S & AgentPromptSelect; - } & HookStrictSelect, AgentPromptSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentPromptPatch: AgentPromptPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentPrompt: { - agentPrompt: InferSelectResult; - }; -}, Error, { - id: string; - agentPromptPatch: AgentPromptPatch; -}>; -export function useUpdateAgentPromptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentPromptMutation( + params: { + selection: { + fields: S & AgentPromptSelect; + } & HookStrictSelect, AgentPromptSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentPrompt: { + agentPrompt: InferSelectResult; + }; + }, + Error, + { + id: string; + agentPromptPatch: AgentPromptPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentPrompt: { + agentPrompt: InferSelectResult; + }; + }, + Error, + { + id: string; + agentPromptPatch: AgentPromptPatch; + } +>; +export function useUpdateAgentPromptMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentPromptPatch: AgentPromptPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentPromptMutationKeys.all, - mutationFn: ({ - id, - agentPromptPatch - }: { - id: string; - agentPromptPatch: AgentPromptPatch; - }) => getClient().agentPrompt.update({ - where: { - id - }, - data: agentPromptPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, agentPromptPatch }: { id: string; agentPromptPatch: AgentPromptPatch }) => + getClient() + .agentPrompt.update({ + where: { + id, + }, + data: agentPromptPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentPromptKeys.detail(variables.id) + queryKey: agentPromptKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentPromptKeys.lists() + queryKey: agentPromptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentResourceChunkMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentResourceChunkMutation.ts index 3fba84e574..489d9fb15f 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentResourceChunkMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentResourceChunkMutation.ts @@ -4,83 +4,113 @@ * 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 { agentResourceChunkKeys } from "../query-keys"; -import { agentResourceChunkMutationKeys } from "../mutation-keys"; -import type { AgentResourceChunkSelect, AgentResourceChunkWithRelations, AgentResourceChunkPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceChunkSelect, AgentResourceChunkWithRelations, AgentResourceChunkPatch } from "../../orm/input-types"; +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 { agentResourceChunkKeys } from '../query-keys'; +import { agentResourceChunkMutationKeys } from '../mutation-keys'; +import type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, + AgentResourceChunkPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, + AgentResourceChunkPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a AgentResourceChunk - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentResourceChunkMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentResourceChunkPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentResourceChunkMutation(params: { - selection: ({ - fields: S & AgentResourceChunkSelect; - } & HookStrictSelect, AgentResourceChunkSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentResourceChunkPatch: AgentResourceChunkPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentResourceChunk: { - agentResourceChunk: InferSelectResult; - }; -}, Error, { - id: string; - agentResourceChunkPatch: AgentResourceChunkPatch; -}>; -export function useUpdateAgentResourceChunkMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentResourceChunkMutation( + params: { + selection: { + fields: S & AgentResourceChunkSelect; + } & HookStrictSelect, AgentResourceChunkSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentResourceChunk: { + agentResourceChunk: InferSelectResult; + }; + }, + Error, + { + id: string; + agentResourceChunkPatch: AgentResourceChunkPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentResourceChunk: { + agentResourceChunk: InferSelectResult; + }; + }, + Error, + { + id: string; + agentResourceChunkPatch: AgentResourceChunkPatch; + } +>; +export function useUpdateAgentResourceChunkMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentResourceChunkPatch: AgentResourceChunkPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentResourceChunkMutationKeys.all, mutationFn: ({ id, - agentResourceChunkPatch + agentResourceChunkPatch, }: { id: string; agentResourceChunkPatch: AgentResourceChunkPatch; - }) => getClient().agentResourceChunk.update({ - where: { - id - }, - data: agentResourceChunkPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .agentResourceChunk.update({ + where: { + id, + }, + data: agentResourceChunkPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentResourceChunkKeys.detail(variables.id) + queryKey: agentResourceChunkKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentResourceChunkKeys.lists() + queryKey: agentResourceChunkKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentResourceMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentResourceMutation.ts index 7510885cfd..64d0d6e47f 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentResourceMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentResourceMutation.ts @@ -4,83 +4,113 @@ * 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 { agentResourceKeys } from "../query-keys"; -import { agentResourceMutationKeys } from "../mutation-keys"; -import type { AgentResourceSelect, AgentResourceWithRelations, AgentResourcePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceSelect, AgentResourceWithRelations, AgentResourcePatch } from "../../orm/input-types"; +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 { agentResourceKeys } from '../query-keys'; +import { agentResourceMutationKeys } from '../mutation-keys'; +import type { + AgentResourceSelect, + AgentResourceWithRelations, + AgentResourcePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentResourceSelect, + AgentResourceWithRelations, + AgentResourcePatch, +} from '../../orm/input-types'; /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentResourceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentResourcePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentResourceMutation(params: { - selection: ({ - fields: S & AgentResourceSelect; - } & HookStrictSelect, AgentResourceSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentResourcePatch: AgentResourcePatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentResource: { - agentResource: InferSelectResult; - }; -}, Error, { - id: string; - agentResourcePatch: AgentResourcePatch; -}>; -export function useUpdateAgentResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentResourceMutation( + params: { + selection: { + fields: S & AgentResourceSelect; + } & HookStrictSelect, AgentResourceSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentResource: { + agentResource: InferSelectResult; + }; + }, + Error, + { + id: string; + agentResourcePatch: AgentResourcePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentResource: { + agentResource: InferSelectResult; + }; + }, + Error, + { + id: string; + agentResourcePatch: AgentResourcePatch; + } +>; +export function useUpdateAgentResourceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentResourcePatch: AgentResourcePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentResourceMutationKeys.all, mutationFn: ({ id, - agentResourcePatch + agentResourcePatch, }: { id: string; agentResourcePatch: AgentResourcePatch; - }) => getClient().agentResource.update({ - where: { - id - }, - data: agentResourcePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .agentResource.update({ + where: { + id, + }, + data: agentResourcePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentResourceKeys.detail(variables.id) + queryKey: agentResourceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentResourceKeys.lists() + queryKey: agentResourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentTaskMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentTaskMutation.ts index 4e23ab87d5..4fb8fd90a3 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentTaskMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentTaskMutation.ts @@ -4,83 +4,107 @@ * 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 { agentTaskKeys } from "../query-keys"; -import { agentTaskMutationKeys } from "../mutation-keys"; -import type { AgentTaskSelect, AgentTaskWithRelations, AgentTaskPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentTaskSelect, AgentTaskWithRelations, AgentTaskPatch } from "../../orm/input-types"; +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 { agentTaskKeys } from '../query-keys'; +import { agentTaskMutationKeys } from '../mutation-keys'; +import type { + AgentTaskSelect, + AgentTaskWithRelations, + AgentTaskPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentTaskSelect, + AgentTaskWithRelations, + AgentTaskPatch, +} from '../../orm/input-types'; /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentTaskMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentTaskPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentTaskMutation(params: { - selection: ({ - fields: S & AgentTaskSelect; - } & HookStrictSelect, AgentTaskSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentTaskPatch: AgentTaskPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentTask: { - agentTask: InferSelectResult; - }; -}, Error, { - id: string; - agentTaskPatch: AgentTaskPatch; -}>; -export function useUpdateAgentTaskMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentTaskMutation( + params: { + selection: { + fields: S & AgentTaskSelect; + } & HookStrictSelect, AgentTaskSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentTask: { + agentTask: InferSelectResult; + }; + }, + Error, + { + id: string; + agentTaskPatch: AgentTaskPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentTask: { + agentTask: InferSelectResult; + }; + }, + Error, + { + id: string; + agentTaskPatch: AgentTaskPatch; + } +>; +export function useUpdateAgentTaskMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentTaskPatch: AgentTaskPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentTaskMutationKeys.all, - mutationFn: ({ - id, - agentTaskPatch - }: { - id: string; - agentTaskPatch: AgentTaskPatch; - }) => getClient().agentTask.update({ - where: { - id - }, - data: agentTaskPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, agentTaskPatch }: { id: string; agentTaskPatch: AgentTaskPatch }) => + getClient() + .agentTask.update({ + where: { + id, + }, + data: agentTaskPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentTaskKeys.detail(variables.id) + queryKey: agentTaskKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentTaskKeys.lists() + queryKey: agentTaskKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentThreadMutation.ts b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentThreadMutation.ts index 7257da9985..50ecb7ef6e 100644 --- a/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentThreadMutation.ts +++ b/sdk/constructive-react/src/agent/hooks/mutations/useUpdateAgentThreadMutation.ts @@ -4,83 +4,107 @@ * 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 { agentThreadKeys } from "../query-keys"; -import { agentThreadMutationKeys } from "../mutation-keys"; -import type { AgentThreadSelect, AgentThreadWithRelations, AgentThreadPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentThreadSelect, AgentThreadWithRelations, AgentThreadPatch } from "../../orm/input-types"; +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 { agentThreadKeys } from '../query-keys'; +import { agentThreadMutationKeys } from '../mutation-keys'; +import type { + AgentThreadSelect, + AgentThreadWithRelations, + AgentThreadPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentThreadSelect, + AgentThreadWithRelations, + AgentThreadPatch, +} from '../../orm/input-types'; /** * Top-level AI/LLM conversation thread - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentThreadMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentThreadPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentThreadMutation(params: { - selection: ({ - fields: S & AgentThreadSelect; - } & HookStrictSelect, AgentThreadSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentThreadPatch: AgentThreadPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentThread: { - agentThread: InferSelectResult; - }; -}, Error, { - id: string; - agentThreadPatch: AgentThreadPatch; -}>; -export function useUpdateAgentThreadMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentThreadMutation( + params: { + selection: { + fields: S & AgentThreadSelect; + } & HookStrictSelect, AgentThreadSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentThread: { + agentThread: InferSelectResult; + }; + }, + Error, + { + id: string; + agentThreadPatch: AgentThreadPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentThread: { + agentThread: InferSelectResult; + }; + }, + Error, + { + id: string; + agentThreadPatch: AgentThreadPatch; + } +>; +export function useUpdateAgentThreadMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentThreadPatch: AgentThreadPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentThreadMutationKeys.all, - mutationFn: ({ - id, - agentThreadPatch - }: { - id: string; - agentThreadPatch: AgentThreadPatch; - }) => getClient().agentThread.update({ - where: { - id - }, - data: agentThreadPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, agentThreadPatch }: { id: string; agentThreadPatch: AgentThreadPatch }) => + getClient() + .agentThread.update({ + where: { + id, + }, + data: agentThreadPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentThreadKeys.detail(variables.id) + queryKey: agentThreadKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentThreadKeys.lists() + queryKey: agentThreadKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/index.ts b/sdk/constructive-react/src/agent/hooks/queries/index.ts index 5f86c181a0..de494d620e 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/index.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/index.ts @@ -3,21 +3,21 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useAgentsQuery"; -export * from "./useAgentQuery"; -export * from "./useAgentMessagesQuery"; -export * from "./useAgentMessageQuery"; -export * from "./useAgentPersonasQuery"; -export * from "./useAgentPersonaQuery"; -export * from "./useAgentPlansQuery"; -export * from "./useAgentPlanQuery"; -export * from "./useAgentPromptsQuery"; -export * from "./useAgentPromptQuery"; -export * from "./useAgentResourceChunksQuery"; -export * from "./useAgentResourceChunkQuery"; -export * from "./useAgentResourcesQuery"; -export * from "./useAgentResourceQuery"; -export * from "./useAgentTasksQuery"; -export * from "./useAgentTaskQuery"; -export * from "./useAgentThreadsQuery"; -export * from "./useAgentThreadQuery"; \ No newline at end of file +export * from './useAgentsQuery'; +export * from './useAgentQuery'; +export * from './useAgentMessagesQuery'; +export * from './useAgentMessageQuery'; +export * from './useAgentPersonasQuery'; +export * from './useAgentPersonaQuery'; +export * from './useAgentPlansQuery'; +export * from './useAgentPlanQuery'; +export * from './useAgentPromptsQuery'; +export * from './useAgentPromptQuery'; +export * from './useAgentResourceChunksQuery'; +export * from './useAgentResourceChunkQuery'; +export * from './useAgentResourcesQuery'; +export * from './useAgentResourceQuery'; +export * from './useAgentTasksQuery'; +export * from './useAgentTaskQuery'; +export * from './useAgentThreadsQuery'; +export * from './useAgentThreadQuery'; diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentMessageQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentMessageQuery.ts index e515d576e3..7edbaddeba 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentMessageQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentMessageQuery.ts @@ -4,20 +4,20 @@ * 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 { agentMessageKeys } from "../query-keys"; -import type { AgentMessageSelect, AgentMessageWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentMessageSelect, AgentMessageWithRelations } from "../../orm/input-types"; +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 { agentMessageKeys } from '../query-keys'; +import type { AgentMessageSelect, AgentMessageWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentMessageSelect, AgentMessageWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentMessageQueryKey = agentMessageKeys.detail; /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```tsx * const { data, isLoading } = useAgentMessageQuery({ @@ -26,38 +26,52 @@ export const agentMessageQueryKey = agentMessageKeys.detail; * }); * ``` */ -export function useAgentMessageQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentMessageSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentMessageQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentMessageQuery< + S extends AgentMessageSelect, + TData = { + agentMessage: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentMessageSelect>; + } & Omit< + UseQueryOptions< + { + agentMessage: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentMessageQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentMessageKeys.detail(params.id), - queryFn: () => getClient().agentMessage.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentMessage.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```ts * const data = await fetchAgentMessageQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentMessageQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentMessage.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentMessage.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```ts * await prefetchAgentMessageQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentMessageQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentMessageSelect>; -}): Promise; -export async function prefetchAgentMessageQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentMessageQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentMessageSelect>; + } +): Promise; +export async function prefetchAgentMessageQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentMessageKeys.detail(params.id), - queryFn: () => getClient().agentMessage.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentMessage.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentMessagesQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentMessagesQuery.ts index 085e6ddb7e..f7c39e51d7 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentMessagesQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentMessagesQuery.ts @@ -4,20 +4,35 @@ * 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 { agentMessageKeys } from "../query-keys"; -import type { AgentMessageSelect, AgentMessageWithRelations, AgentMessageFilter, AgentMessageOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentMessageSelect, AgentMessageWithRelations, AgentMessageFilter, AgentMessageOrderBy } from "../../orm/input-types"; +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 { agentMessageKeys } from '../query-keys'; +import type { + AgentMessageSelect, + AgentMessageWithRelations, + AgentMessageFilter, + AgentMessageOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentMessageSelect, + AgentMessageWithRelations, + AgentMessageFilter, + AgentMessageOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentMessagesQueryKey = agentMessageKeys.list; /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```tsx * const { data, isLoading } = useAgentMessagesQuery({ @@ -30,33 +45,47 @@ export const agentMessagesQueryKey = agentMessageKeys.list; * }); * ``` */ -export function useAgentMessagesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentMessageSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentMessagesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentMessagesQuery< + S extends AgentMessageSelect, + TData = { + agentMessages: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentMessageSelect>; + } & Omit< + UseQueryOptions< + { + agentMessages: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentMessagesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentMessageKeys.list(args), queryFn: () => getClient().agentMessage.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```ts * const data = await fetchAgentMessagesQuery({ @@ -70,35 +99,47 @@ export function useAgentMessagesQuery(params: { export async function fetchAgentMessagesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentMessageSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentMessageSelect>; }): Promise<{ agentMessages: ConnectionResult>; }>; export async function fetchAgentMessagesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().agentMessage.findMany(args).unwrap(); } /** * Message within an agent thread with TextPart/ToolPart jsonb parts - * + * * @example * ```ts * await prefetchAgentMessagesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentMessagesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentMessageSelect>; -}): Promise; -export async function prefetchAgentMessagesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentMessagesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentMessageSelect>; + } +): Promise; +export async function prefetchAgentMessagesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: agentMessageKeys.list(args), - queryFn: () => getClient().agentMessage.findMany(args).unwrap() + queryFn: () => getClient().agentMessage.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentPersonaQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentPersonaQuery.ts index 941be015b7..361f20fdae 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentPersonaQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentPersonaQuery.ts @@ -4,20 +4,20 @@ * 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 { agentPersonaKeys } from "../query-keys"; -import type { AgentPersonaSelect, AgentPersonaWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPersonaSelect, AgentPersonaWithRelations } from "../../orm/input-types"; +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 { agentPersonaKeys } from '../query-keys'; +import type { AgentPersonaSelect, AgentPersonaWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentPersonaSelect, AgentPersonaWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentPersonaQueryKey = agentPersonaKeys.detail; /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```tsx * const { data, isLoading } = useAgentPersonaQuery({ @@ -26,38 +26,52 @@ export const agentPersonaQueryKey = agentPersonaKeys.detail; * }); * ``` */ -export function useAgentPersonaQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentPersonaSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentPersonaQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentPersonaQuery< + S extends AgentPersonaSelect, + TData = { + agentPersona: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentPersonaSelect>; + } & Omit< + UseQueryOptions< + { + agentPersona: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentPersonaQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentPersonaKeys.detail(params.id), - queryFn: () => getClient().agentPersona.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentPersona.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```ts * const data = await fetchAgentPersonaQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentPersonaQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentPersona.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentPersona.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```ts * await prefetchAgentPersonaQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentPersonaQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentPersonaSelect>; -}): Promise; -export async function prefetchAgentPersonaQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentPersonaQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentPersonaSelect>; + } +): Promise; +export async function prefetchAgentPersonaQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentPersonaKeys.detail(params.id), - queryFn: () => getClient().agentPersona.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentPersona.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentPersonasQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentPersonasQuery.ts index 87ed9cb64d..995ac4a7e3 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentPersonasQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentPersonasQuery.ts @@ -4,20 +4,35 @@ * 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 { agentPersonaKeys } from "../query-keys"; -import type { AgentPersonaSelect, AgentPersonaWithRelations, AgentPersonaFilter, AgentPersonaOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPersonaSelect, AgentPersonaWithRelations, AgentPersonaFilter, AgentPersonaOrderBy } from "../../orm/input-types"; +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 { agentPersonaKeys } from '../query-keys'; +import type { + AgentPersonaSelect, + AgentPersonaWithRelations, + AgentPersonaFilter, + AgentPersonaOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentPersonaSelect, + AgentPersonaWithRelations, + AgentPersonaFilter, + AgentPersonaOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentPersonasQueryKey = agentPersonaKeys.list; /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```tsx * const { data, isLoading } = useAgentPersonasQuery({ @@ -30,33 +45,47 @@ export const agentPersonasQueryKey = agentPersonaKeys.list; * }); * ``` */ -export function useAgentPersonasQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPersonaSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentPersonasQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentPersonasQuery< + S extends AgentPersonaSelect, + TData = { + agentPersonas: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentPersonaSelect>; + } & Omit< + UseQueryOptions< + { + agentPersonas: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentPersonasQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentPersonaKeys.list(args), queryFn: () => getClient().agentPersona.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```ts * const data = await fetchAgentPersonasQuery({ @@ -70,35 +99,47 @@ export function useAgentPersonasQuery(params: { export async function fetchAgentPersonasQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPersonaSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentPersonaSelect>; }): Promise<{ agentPersonas: ConnectionResult>; }>; export async function fetchAgentPersonasQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().agentPersona.findMany(args).unwrap(); } /** * Agent persona templates (role, system prompt, default skills/knowledge) - * + * * @example * ```ts * await prefetchAgentPersonasQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentPersonasQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPersonaSelect>; -}): Promise; -export async function prefetchAgentPersonasQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentPersonasQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentPersonaSelect>; + } +): Promise; +export async function prefetchAgentPersonasQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: agentPersonaKeys.list(args), - queryFn: () => getClient().agentPersona.findMany(args).unwrap() + queryFn: () => getClient().agentPersona.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentPlanQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentPlanQuery.ts index 17373f5fed..d1bae113d8 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentPlanQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentPlanQuery.ts @@ -4,20 +4,20 @@ * 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 { agentPlanKeys } from "../query-keys"; -import type { AgentPlanSelect, AgentPlanWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPlanSelect, AgentPlanWithRelations } from "../../orm/input-types"; +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 { agentPlanKeys } from '../query-keys'; +import type { AgentPlanSelect, AgentPlanWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentPlanSelect, AgentPlanWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentPlanQueryKey = agentPlanKeys.detail; /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```tsx * const { data, isLoading } = useAgentPlanQuery({ @@ -26,38 +26,52 @@ export const agentPlanQueryKey = agentPlanKeys.detail; * }); * ``` */ -export function useAgentPlanQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentPlanSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentPlanQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentPlanQuery< + S extends AgentPlanSelect, + TData = { + agentPlan: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentPlanSelect>; + } & Omit< + UseQueryOptions< + { + agentPlan: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentPlanQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentPlanKeys.detail(params.id), - queryFn: () => getClient().agentPlan.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentPlan.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```ts * const data = await fetchAgentPlanQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentPlanQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentPlan.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentPlan.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```ts * await prefetchAgentPlanQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentPlanQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentPlanSelect>; -}): Promise; -export async function prefetchAgentPlanQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentPlanQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentPlanSelect>; + } +): Promise; +export async function prefetchAgentPlanQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentPlanKeys.detail(params.id), - queryFn: () => getClient().agentPlan.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentPlan.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentPlansQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentPlansQuery.ts index 1b3a6eb56c..d7610efe3d 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentPlansQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentPlansQuery.ts @@ -4,20 +4,35 @@ * 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 { agentPlanKeys } from "../query-keys"; -import type { AgentPlanSelect, AgentPlanWithRelations, AgentPlanFilter, AgentPlanOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPlanSelect, AgentPlanWithRelations, AgentPlanFilter, AgentPlanOrderBy } from "../../orm/input-types"; +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 { agentPlanKeys } from '../query-keys'; +import type { + AgentPlanSelect, + AgentPlanWithRelations, + AgentPlanFilter, + AgentPlanOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentPlanSelect, + AgentPlanWithRelations, + AgentPlanFilter, + AgentPlanOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentPlansQueryKey = agentPlanKeys.list; /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```tsx * const { data, isLoading } = useAgentPlansQuery({ @@ -30,33 +45,47 @@ export const agentPlansQueryKey = agentPlanKeys.list; * }); * ``` */ -export function useAgentPlansQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPlanSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentPlansQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentPlansQuery< + S extends AgentPlanSelect, + TData = { + agentPlans: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentPlanSelect>; + } & Omit< + UseQueryOptions< + { + agentPlans: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentPlansQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentPlanKeys.list(args), queryFn: () => getClient().agentPlan.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```ts * const data = await fetchAgentPlansQuery({ @@ -70,35 +99,47 @@ export function useAgentPlansQuery(params: { export async function fetchAgentPlansQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPlanSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentPlanSelect>; }): Promise<{ agentPlans: ConnectionResult>; }>; export async function fetchAgentPlansQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().agentPlan.findMany(args).unwrap(); } /** * Workflow plan attached to an agent thread with ordered tasks and optional approval gates - * + * * @example * ```ts * await prefetchAgentPlansQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentPlansQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPlanSelect>; -}): Promise; -export async function prefetchAgentPlansQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentPlansQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentPlanSelect>; + } +): Promise; +export async function prefetchAgentPlansQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: agentPlanKeys.list(args), - queryFn: () => getClient().agentPlan.findMany(args).unwrap() + queryFn: () => getClient().agentPlan.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentPromptQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentPromptQuery.ts index c0ebe1ea75..264bf47a6e 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentPromptQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentPromptQuery.ts @@ -4,20 +4,20 @@ * 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 { agentPromptKeys } from "../query-keys"; -import type { AgentPromptSelect, AgentPromptWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPromptSelect, AgentPromptWithRelations } from "../../orm/input-types"; +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 { agentPromptKeys } from '../query-keys'; +import type { AgentPromptSelect, AgentPromptWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentPromptSelect, AgentPromptWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentPromptQueryKey = agentPromptKeys.detail; /** * Shared system prompt templates for agent conversations - * + * * @example * ```tsx * const { data, isLoading } = useAgentPromptQuery({ @@ -26,38 +26,52 @@ export const agentPromptQueryKey = agentPromptKeys.detail; * }); * ``` */ -export function useAgentPromptQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentPromptSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentPromptQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentPromptQuery< + S extends AgentPromptSelect, + TData = { + agentPrompt: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentPromptSelect>; + } & Omit< + UseQueryOptions< + { + agentPrompt: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentPromptQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentPromptKeys.detail(params.id), - queryFn: () => getClient().agentPrompt.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentPrompt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Shared system prompt templates for agent conversations - * + * * @example * ```ts * const data = await fetchAgentPromptQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentPromptQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentPrompt.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentPrompt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Shared system prompt templates for agent conversations - * + * * @example * ```ts * await prefetchAgentPromptQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentPromptQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentPromptSelect>; -}): Promise; -export async function prefetchAgentPromptQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentPromptQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentPromptSelect>; + } +): Promise; +export async function prefetchAgentPromptQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentPromptKeys.detail(params.id), - queryFn: () => getClient().agentPrompt.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentPrompt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentPromptsQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentPromptsQuery.ts index c11e1f32f0..f64a84928c 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentPromptsQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentPromptsQuery.ts @@ -4,20 +4,35 @@ * 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 { agentPromptKeys } from "../query-keys"; -import type { AgentPromptSelect, AgentPromptWithRelations, AgentPromptFilter, AgentPromptOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentPromptSelect, AgentPromptWithRelations, AgentPromptFilter, AgentPromptOrderBy } from "../../orm/input-types"; +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 { agentPromptKeys } from '../query-keys'; +import type { + AgentPromptSelect, + AgentPromptWithRelations, + AgentPromptFilter, + AgentPromptOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentPromptSelect, + AgentPromptWithRelations, + AgentPromptFilter, + AgentPromptOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentPromptsQueryKey = agentPromptKeys.list; /** * Shared system prompt templates for agent conversations - * + * * @example * ```tsx * const { data, isLoading } = useAgentPromptsQuery({ @@ -30,33 +45,47 @@ export const agentPromptsQueryKey = agentPromptKeys.list; * }); * ``` */ -export function useAgentPromptsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPromptSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentPromptsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentPromptsQuery< + S extends AgentPromptSelect, + TData = { + agentPrompts: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentPromptSelect>; + } & Omit< + UseQueryOptions< + { + agentPrompts: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentPromptsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentPromptKeys.list(args), queryFn: () => getClient().agentPrompt.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Shared system prompt templates for agent conversations - * + * * @example * ```ts * const data = await fetchAgentPromptsQuery({ @@ -70,35 +99,47 @@ export function useAgentPromptsQuery(params: { export async function fetchAgentPromptsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPromptSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentPromptSelect>; }): Promise<{ agentPrompts: ConnectionResult>; }>; export async function fetchAgentPromptsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().agentPrompt.findMany(args).unwrap(); } /** * Shared system prompt templates for agent conversations - * + * * @example * ```ts * await prefetchAgentPromptsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentPromptsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentPromptSelect>; -}): Promise; -export async function prefetchAgentPromptsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentPromptsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentPromptSelect>; + } +): Promise; +export async function prefetchAgentPromptsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: agentPromptKeys.list(args), - queryFn: () => getClient().agentPrompt.findMany(args).unwrap() + queryFn: () => getClient().agentPrompt.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentQuery.ts index 658d6471bd..6dfe9735b4 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentQuery.ts @@ -4,20 +4,20 @@ * 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 { agentKeys } from "../query-keys"; -import type { AgentSelect, AgentWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentSelect, AgentWithRelations } from "../../orm/input-types"; +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 { agentKeys } from '../query-keys'; +import type { AgentSelect, AgentWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentSelect, AgentWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentQueryKey = agentKeys.detail; /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```tsx * const { data, isLoading } = useAgentQuery({ @@ -26,38 +26,52 @@ export const agentQueryKey = agentKeys.detail; * }); * ``` */ -export function useAgentQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentQuery< + S extends AgentSelect, + TData = { + agent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentSelect>; + } & Omit< + UseQueryOptions< + { + agent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentKeys.detail(params.id), - queryFn: () => getClient().agent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```ts * const data = await fetchAgentQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```ts * await prefetchAgentQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentSelect>; -}): Promise; -export async function prefetchAgentQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentSelect>; + } +): Promise; +export async function prefetchAgentQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentKeys.detail(params.id), - queryFn: () => getClient().agent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceChunkQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceChunkQuery.ts index d1cf0bcfb4..4923863a6f 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceChunkQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceChunkQuery.ts @@ -4,20 +4,26 @@ * 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 { agentResourceChunkKeys } from "../query-keys"; -import type { AgentResourceChunkSelect, AgentResourceChunkWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceChunkSelect, AgentResourceChunkWithRelations } from "../../orm/input-types"; +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 { agentResourceChunkKeys } from '../query-keys'; +import type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentResourceChunkQueryKey = agentResourceChunkKeys.detail; /** * Query hook for fetching a single AgentResourceChunk - * + * * @example * ```tsx * const { data, isLoading } = useAgentResourceChunkQuery({ @@ -26,38 +32,52 @@ export const agentResourceChunkQueryKey = agentResourceChunkKeys.detail; * }); * ``` */ -export function useAgentResourceChunkQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentResourceChunkSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentResourceChunkQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentResourceChunkQuery< + S extends AgentResourceChunkSelect, + TData = { + agentResourceChunk: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentResourceChunkSelect>; + } & Omit< + UseQueryOptions< + { + agentResourceChunk: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentResourceChunkQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentResourceChunkKeys.detail(params.id), - queryFn: () => getClient().agentResourceChunk.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentResourceChunk.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single AgentResourceChunk without React hooks - * + * * @example * ```ts * const data = await fetchAgentResourceChunkQuery({ @@ -79,35 +99,46 @@ export async function fetchAgentResourceChunkQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentResourceChunk.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentResourceChunk.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single AgentResourceChunk for SSR or cache warming - * + * * @example * ```ts * await prefetchAgentResourceChunkQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentResourceChunkQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentResourceChunkSelect>; -}): Promise; -export async function prefetchAgentResourceChunkQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentResourceChunkQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentResourceChunkSelect>; + } +): Promise; +export async function prefetchAgentResourceChunkQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentResourceChunkKeys.detail(params.id), - queryFn: () => getClient().agentResourceChunk.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentResourceChunk.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceChunksQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceChunksQuery.ts index 27dbf30fc9..ba4a3f4a8c 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceChunksQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceChunksQuery.ts @@ -4,20 +4,35 @@ * 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 { agentResourceChunkKeys } from "../query-keys"; -import type { AgentResourceChunkSelect, AgentResourceChunkWithRelations, AgentResourceChunkFilter, AgentResourceChunkOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceChunkSelect, AgentResourceChunkWithRelations, AgentResourceChunkFilter, AgentResourceChunkOrderBy } from "../../orm/input-types"; +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 { agentResourceChunkKeys } from '../query-keys'; +import type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentResourceChunkSelect, + AgentResourceChunkWithRelations, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentResourceChunksQueryKey = agentResourceChunkKeys.list; /** * Query hook for fetching AgentResourceChunk list - * + * * @example * ```tsx * const { data, isLoading } = useAgentResourceChunksQuery({ @@ -30,33 +45,58 @@ export const agentResourceChunksQueryKey = agentResourceChunkKeys.list; * }); * ``` */ -export function useAgentResourceChunksQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentResourceChunkSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentResourceChunksQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentResourceChunksQuery< + S extends AgentResourceChunkSelect, + TData = { + agentResourceChunks: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AgentResourceChunkSelect>; + } & Omit< + UseQueryOptions< + { + agentResourceChunks: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentResourceChunksQuery( + params: { + selection: ListSelectionConfig< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentResourceChunkKeys.list(args), queryFn: () => getClient().agentResourceChunk.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch AgentResourceChunk list without React hooks - * + * * @example * ```ts * const data = await fetchAgentResourceChunksQuery({ @@ -70,35 +110,62 @@ export function useAgentResourceChunksQuery(params: { export async function fetchAgentResourceChunksQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentResourceChunkSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentResourceChunkSelect>; }): Promise<{ agentResourceChunks: ConnectionResult>; }>; export async function fetchAgentResourceChunksQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + >(params.selection); return getClient().agentResourceChunk.findMany(args).unwrap(); } /** * Prefetch AgentResourceChunk list for SSR or cache warming - * + * * @example * ```ts * await prefetchAgentResourceChunksQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentResourceChunksQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentResourceChunkSelect>; -}): Promise; -export async function prefetchAgentResourceChunksQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentResourceChunksQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AgentResourceChunkSelect>; + } +): Promise; +export async function prefetchAgentResourceChunksQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: agentResourceChunkKeys.list(args), - queryFn: () => getClient().agentResourceChunk.findMany(args).unwrap() + queryFn: () => getClient().agentResourceChunk.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceQuery.ts index e6acdf4251..a3c3683e5c 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentResourceQuery.ts @@ -4,20 +4,20 @@ * 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 { agentResourceKeys } from "../query-keys"; -import type { AgentResourceSelect, AgentResourceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceSelect, AgentResourceWithRelations } from "../../orm/input-types"; +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 { agentResourceKeys } from '../query-keys'; +import type { AgentResourceSelect, AgentResourceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentResourceSelect, AgentResourceWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentResourceQueryKey = agentResourceKeys.detail; /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```tsx * const { data, isLoading } = useAgentResourceQuery({ @@ -26,38 +26,52 @@ export const agentResourceQueryKey = agentResourceKeys.detail; * }); * ``` */ -export function useAgentResourceQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentResourceSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentResourceQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentResourceQuery< + S extends AgentResourceSelect, + TData = { + agentResource: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentResourceSelect>; + } & Omit< + UseQueryOptions< + { + agentResource: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentResourceQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentResourceKeys.detail(params.id), - queryFn: () => getClient().agentResource.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentResource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```ts * const data = await fetchAgentResourceQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentResourceQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentResource.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentResource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```ts * await prefetchAgentResourceQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentResourceQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentResourceSelect>; -}): Promise; -export async function prefetchAgentResourceQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentResourceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentResourceSelect>; + } +): Promise; +export async function prefetchAgentResourceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentResourceKeys.detail(params.id), - queryFn: () => getClient().agentResource.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentResource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentResourcesQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentResourcesQuery.ts index 2694d68aba..1b96927b27 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentResourcesQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentResourcesQuery.ts @@ -4,20 +4,35 @@ * 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 { agentResourceKeys } from "../query-keys"; -import type { AgentResourceSelect, AgentResourceWithRelations, AgentResourceFilter, AgentResourceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentResourceSelect, AgentResourceWithRelations, AgentResourceFilter, AgentResourceOrderBy } from "../../orm/input-types"; +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 { agentResourceKeys } from '../query-keys'; +import type { + AgentResourceSelect, + AgentResourceWithRelations, + AgentResourceFilter, + AgentResourceOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentResourceSelect, + AgentResourceWithRelations, + AgentResourceFilter, + AgentResourceOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentResourcesQueryKey = agentResourceKeys.list; /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```tsx * const { data, isLoading } = useAgentResourcesQuery({ @@ -30,33 +45,49 @@ export const agentResourcesQueryKey = agentResourceKeys.list; * }); * ``` */ -export function useAgentResourcesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentResourceSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentResourcesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentResourcesQuery< + S extends AgentResourceSelect, + TData = { + agentResources: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentResourceSelect>; + } & Omit< + UseQueryOptions< + { + agentResources: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentResourcesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AgentResourceSelect, + AgentResourceFilter, + AgentResourceOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentResourceKeys.list(args), queryFn: () => getClient().agentResource.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```ts * const data = await fetchAgentResourcesQuery({ @@ -70,35 +101,51 @@ export function useAgentResourcesQuery(params: { export async function fetchAgentResourcesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentResourceSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentResourceSelect>; }): Promise<{ agentResources: ConnectionResult>; }>; export async function fetchAgentResourcesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AgentResourceSelect, + AgentResourceFilter, + AgentResourceOrderBy + >(params.selection); return getClient().agentResource.findMany(args).unwrap(); } /** * Unified skills and knowledge resources for agent retrieval - * + * * @example * ```ts * await prefetchAgentResourcesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentResourcesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentResourceSelect>; -}): Promise; -export async function prefetchAgentResourcesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentResourcesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentResourceSelect>; + } +): Promise; +export async function prefetchAgentResourcesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + AgentResourceSelect, + AgentResourceFilter, + AgentResourceOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: agentResourceKeys.list(args), - queryFn: () => getClient().agentResource.findMany(args).unwrap() + queryFn: () => getClient().agentResource.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentTaskQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentTaskQuery.ts index c3a00ad400..106cdb3332 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentTaskQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentTaskQuery.ts @@ -4,20 +4,20 @@ * 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 { agentTaskKeys } from "../query-keys"; -import type { AgentTaskSelect, AgentTaskWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentTaskSelect, AgentTaskWithRelations } from "../../orm/input-types"; +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 { agentTaskKeys } from '../query-keys'; +import type { AgentTaskSelect, AgentTaskWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentTaskSelect, AgentTaskWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentTaskQueryKey = agentTaskKeys.detail; /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```tsx * const { data, isLoading } = useAgentTaskQuery({ @@ -26,38 +26,52 @@ export const agentTaskQueryKey = agentTaskKeys.detail; * }); * ``` */ -export function useAgentTaskQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentTaskSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentTaskQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentTaskQuery< + S extends AgentTaskSelect, + TData = { + agentTask: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentTaskSelect>; + } & Omit< + UseQueryOptions< + { + agentTask: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentTaskQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentTaskKeys.detail(params.id), - queryFn: () => getClient().agentTask.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentTask.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```ts * const data = await fetchAgentTaskQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentTaskQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentTask.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentTask.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```ts * await prefetchAgentTaskQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentTaskQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentTaskSelect>; -}): Promise; -export async function prefetchAgentTaskQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentTaskQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentTaskSelect>; + } +): Promise; +export async function prefetchAgentTaskQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentTaskKeys.detail(params.id), - queryFn: () => getClient().agentTask.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentTask.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentTasksQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentTasksQuery.ts index a7dbbac244..2a5c180111 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentTasksQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentTasksQuery.ts @@ -4,20 +4,35 @@ * 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 { agentTaskKeys } from "../query-keys"; -import type { AgentTaskSelect, AgentTaskWithRelations, AgentTaskFilter, AgentTaskOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentTaskSelect, AgentTaskWithRelations, AgentTaskFilter, AgentTaskOrderBy } from "../../orm/input-types"; +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 { agentTaskKeys } from '../query-keys'; +import type { + AgentTaskSelect, + AgentTaskWithRelations, + AgentTaskFilter, + AgentTaskOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentTaskSelect, + AgentTaskWithRelations, + AgentTaskFilter, + AgentTaskOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentTasksQueryKey = agentTaskKeys.list; /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```tsx * const { data, isLoading } = useAgentTasksQuery({ @@ -30,33 +45,47 @@ export const agentTasksQueryKey = agentTaskKeys.list; * }); * ``` */ -export function useAgentTasksQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentTaskSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentTasksQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentTasksQuery< + S extends AgentTaskSelect, + TData = { + agentTasks: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentTaskSelect>; + } & Omit< + UseQueryOptions< + { + agentTasks: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentTasksQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentTaskKeys.list(args), queryFn: () => getClient().agentTask.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```ts * const data = await fetchAgentTasksQuery({ @@ -70,35 +99,47 @@ export function useAgentTasksQuery(params: { export async function fetchAgentTasksQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentTaskSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentTaskSelect>; }): Promise<{ agentTasks: ConnectionResult>; }>; export async function fetchAgentTasksQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().agentTask.findMany(args).unwrap(); } /** * Task within a plan, with ordering and optional approval gates - * + * * @example * ```ts * await prefetchAgentTasksQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentTasksQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentTaskSelect>; -}): Promise; -export async function prefetchAgentTasksQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentTasksQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentTaskSelect>; + } +): Promise; +export async function prefetchAgentTasksQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: agentTaskKeys.list(args), - queryFn: () => getClient().agentTask.findMany(args).unwrap() + queryFn: () => getClient().agentTask.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentThreadQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentThreadQuery.ts index 46b0542ed7..c32ed26694 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentThreadQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentThreadQuery.ts @@ -4,20 +4,20 @@ * 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 { agentThreadKeys } from "../query-keys"; -import type { AgentThreadSelect, AgentThreadWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentThreadSelect, AgentThreadWithRelations } from "../../orm/input-types"; +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 { agentThreadKeys } from '../query-keys'; +import type { AgentThreadSelect, AgentThreadWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentThreadSelect, AgentThreadWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentThreadQueryKey = agentThreadKeys.detail; /** * Top-level AI/LLM conversation thread - * + * * @example * ```tsx * const { data, isLoading } = useAgentThreadQuery({ @@ -26,38 +26,52 @@ export const agentThreadQueryKey = agentThreadKeys.detail; * }); * ``` */ -export function useAgentThreadQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentThreadSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentThreadQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentThreadQuery< + S extends AgentThreadSelect, + TData = { + agentThread: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentThreadSelect>; + } & Omit< + UseQueryOptions< + { + agentThread: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentThreadQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentThreadKeys.detail(params.id), - queryFn: () => getClient().agentThread.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentThread.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Top-level AI/LLM conversation thread - * + * * @example * ```ts * const data = await fetchAgentThreadQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentThreadQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentThread.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentThread.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Top-level AI/LLM conversation thread - * + * * @example * ```ts * await prefetchAgentThreadQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentThreadQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentThreadSelect>; -}): Promise; -export async function prefetchAgentThreadQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentThreadQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentThreadSelect>; + } +): Promise; +export async function prefetchAgentThreadQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentThreadKeys.detail(params.id), - queryFn: () => getClient().agentThread.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentThread.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentThreadsQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentThreadsQuery.ts index 30b88ecd9f..5921aaf570 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentThreadsQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentThreadsQuery.ts @@ -4,20 +4,35 @@ * 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 { agentThreadKeys } from "../query-keys"; -import type { AgentThreadSelect, AgentThreadWithRelations, AgentThreadFilter, AgentThreadOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentThreadSelect, AgentThreadWithRelations, AgentThreadFilter, AgentThreadOrderBy } from "../../orm/input-types"; +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 { agentThreadKeys } from '../query-keys'; +import type { + AgentThreadSelect, + AgentThreadWithRelations, + AgentThreadFilter, + AgentThreadOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentThreadSelect, + AgentThreadWithRelations, + AgentThreadFilter, + AgentThreadOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentThreadsQueryKey = agentThreadKeys.list; /** * Top-level AI/LLM conversation thread - * + * * @example * ```tsx * const { data, isLoading } = useAgentThreadsQuery({ @@ -30,33 +45,47 @@ export const agentThreadsQueryKey = agentThreadKeys.list; * }); * ``` */ -export function useAgentThreadsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentThreadSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentThreadsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentThreadsQuery< + S extends AgentThreadSelect, + TData = { + agentThreads: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentThreadSelect>; + } & Omit< + UseQueryOptions< + { + agentThreads: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentThreadsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentThreadKeys.list(args), queryFn: () => getClient().agentThread.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Top-level AI/LLM conversation thread - * + * * @example * ```ts * const data = await fetchAgentThreadsQuery({ @@ -70,35 +99,47 @@ export function useAgentThreadsQuery(params: { export async function fetchAgentThreadsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentThreadSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentThreadSelect>; }): Promise<{ agentThreads: ConnectionResult>; }>; export async function fetchAgentThreadsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().agentThread.findMany(args).unwrap(); } /** * Top-level AI/LLM conversation thread - * + * * @example * ```ts * await prefetchAgentThreadsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentThreadsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentThreadSelect>; -}): Promise; -export async function prefetchAgentThreadsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentThreadsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentThreadSelect>; + } +): Promise; +export async function prefetchAgentThreadsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: agentThreadKeys.list(args), - queryFn: () => getClient().agentThread.findMany(args).unwrap() + queryFn: () => getClient().agentThread.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/queries/useAgentsQuery.ts b/sdk/constructive-react/src/agent/hooks/queries/useAgentsQuery.ts index 17b13c7598..8ea7930db5 100644 --- a/sdk/constructive-react/src/agent/hooks/queries/useAgentsQuery.ts +++ b/sdk/constructive-react/src/agent/hooks/queries/useAgentsQuery.ts @@ -4,20 +4,35 @@ * 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 { agentKeys } from "../query-keys"; -import type { AgentSelect, AgentWithRelations, AgentFilter, AgentOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentSelect, AgentWithRelations, AgentFilter, AgentOrderBy } from "../../orm/input-types"; +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 { agentKeys } from '../query-keys'; +import type { + AgentSelect, + AgentWithRelations, + AgentFilter, + AgentOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentSelect, + AgentWithRelations, + AgentFilter, + AgentOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentsQueryKey = agentKeys.list; /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```tsx * const { data, isLoading } = useAgentsQuery({ @@ -30,33 +45,45 @@ export const agentsQueryKey = agentKeys.list; * }); * ``` */ -export function useAgentsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentsQuery< + S extends AgentSelect, + TData = { + agents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentSelect>; + } & Omit< + UseQueryOptions< + { + agents: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentKeys.list(args), queryFn: () => getClient().agent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```ts * const data = await fetchAgentsQuery({ @@ -70,7 +97,8 @@ export function useAgentsQuery(params: { export async function fetchAgentsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentSelect>; }): Promise<{ agents: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchAgentsQuery(params: { } /** * Agent instance registry (human-managed or ephemeral sub-agents) - * + * * @example * ```ts * await prefetchAgentsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentSelect>; -}): Promise; -export async function prefetchAgentsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchAgentsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentSelect>; + } +): Promise; +export async function prefetchAgentsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentKeys.list(args), - queryFn: () => getClient().agent.findMany(args).unwrap() + queryFn: () => getClient().agent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/agent/hooks/query-keys.ts b/sdk/constructive-react/src/agent/hooks/query-keys.ts index 96c3b4cfda..4ca08b3721 100644 --- a/sdk/constructive-react/src/agent/hooks/query-keys.ts +++ b/sdk/constructive-react/src/agent/hooks/query-keys.ts @@ -20,67 +20,85 @@ // ============================================================================ export const agentKeys = { - /** All agent queries */all: ["agent"] as const, - /** List query keys */lists: () => [...agentKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentKeys.details(), id] as const + /** All agent queries */ all: ['agent'] as const, + /** List query keys */ lists: () => [...agentKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentKeys.details(), id] as const, } as const; export const agentMessageKeys = { - /** All agentMessage queries */all: ["agentmessage"] as const, - /** List query keys */lists: () => [...agentMessageKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentMessageKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentMessageKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentMessageKeys.details(), id] as const + /** All agentMessage queries */ all: ['agentmessage'] as const, + /** List query keys */ lists: () => [...agentMessageKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentMessageKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentMessageKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentMessageKeys.details(), id] as const, } as const; export const agentPersonaKeys = { - /** All agentPersona queries */all: ["agentpersona"] as const, - /** List query keys */lists: () => [...agentPersonaKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentPersonaKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentPersonaKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentPersonaKeys.details(), id] as const + /** All agentPersona queries */ all: ['agentpersona'] as const, + /** List query keys */ lists: () => [...agentPersonaKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentPersonaKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentPersonaKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentPersonaKeys.details(), id] as const, } as const; export const agentPlanKeys = { - /** All agentPlan queries */all: ["agentplan"] as const, - /** List query keys */lists: () => [...agentPlanKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentPlanKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentPlanKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentPlanKeys.details(), id] as const + /** All agentPlan queries */ all: ['agentplan'] as const, + /** List query keys */ lists: () => [...agentPlanKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentPlanKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentPlanKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentPlanKeys.details(), id] as const, } as const; export const agentPromptKeys = { - /** All agentPrompt queries */all: ["agentprompt"] as const, - /** List query keys */lists: () => [...agentPromptKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentPromptKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentPromptKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentPromptKeys.details(), id] as const + /** All agentPrompt queries */ all: ['agentprompt'] as const, + /** List query keys */ lists: () => [...agentPromptKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentPromptKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentPromptKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentPromptKeys.details(), id] as const, } as const; export const agentResourceChunkKeys = { - /** All agentResourceChunk queries */all: ["agentresourcechunk"] as const, - /** List query keys */lists: () => [...agentResourceChunkKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentResourceChunkKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentResourceChunkKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentResourceChunkKeys.details(), id] as const + /** All agentResourceChunk queries */ all: ['agentresourcechunk'] as const, + /** List query keys */ lists: () => [...agentResourceChunkKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentResourceChunkKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentResourceChunkKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentResourceChunkKeys.details(), id] as const, } as const; export const agentResourceKeys = { - /** All agentResource queries */all: ["agentresource"] as const, - /** List query keys */lists: () => [...agentResourceKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentResourceKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentResourceKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentResourceKeys.details(), id] as const + /** All agentResource queries */ all: ['agentresource'] as const, + /** List query keys */ lists: () => [...agentResourceKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentResourceKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentResourceKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentResourceKeys.details(), id] as const, } as const; export const agentTaskKeys = { - /** All agentTask queries */all: ["agenttask"] as const, - /** List query keys */lists: () => [...agentTaskKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentTaskKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentTaskKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentTaskKeys.details(), id] as const + /** All agentTask queries */ all: ['agenttask'] as const, + /** List query keys */ lists: () => [...agentTaskKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentTaskKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentTaskKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentTaskKeys.details(), id] as const, } as const; export const agentThreadKeys = { - /** All agentThread queries */all: ["agentthread"] as const, - /** List query keys */lists: () => [...agentThreadKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentThreadKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentThreadKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentThreadKeys.details(), id] as const + /** All agentThread queries */ all: ['agentthread'] as const, + /** List query keys */ lists: () => [...agentThreadKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentThreadKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentThreadKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentThreadKeys.details(), id] as const, } as const; /** @@ -113,7 +131,7 @@ export const queryKeys = { agentResourceChunk: agentResourceChunkKeys, agentResource: agentResourceKeys, agentTask: agentTaskKeys, - agentThread: agentThreadKeys + agentThread: agentThreadKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/agent/hooks/selection.ts b/sdk/constructive-react/src/agent/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/agent/hooks/selection.ts +++ b/sdk/constructive-react/src/agent/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/agent/index.ts b/sdk/constructive-react/src/agent/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/agent/index.ts +++ b/sdk/constructive-react/src/agent/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/agent/orm/client.ts b/sdk/constructive-react/src/agent/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/agent/orm/client.ts +++ b/sdk/constructive-react/src/agent/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/agent/orm/index.ts b/sdk/constructive-react/src/agent/orm/index.ts index be2f54cdb8..5ca8fcc3eb 100644 --- a/sdk/constructive-react/src/agent/orm/index.ts +++ b/sdk/constructive-react/src/agent/orm/index.ts @@ -3,24 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AgentModel } from "./models/agent"; -import { AgentMessageModel } from "./models/agentMessage"; -import { AgentPersonaModel } from "./models/agentPersona"; -import { AgentPlanModel } from "./models/agentPlan"; -import { AgentPromptModel } from "./models/agentPrompt"; -import { AgentResourceChunkModel } from "./models/agentResourceChunk"; -import { AgentResourceModel } from "./models/agentResource"; -import { AgentTaskModel } from "./models/agentTask"; -import { AgentThreadModel } from "./models/agentThread"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AgentModel } from './models/agent'; +import { AgentMessageModel } from './models/agentMessage'; +import { AgentPersonaModel } from './models/agentPersona'; +import { AgentPlanModel } from './models/agentPlan'; +import { AgentPromptModel } from './models/agentPrompt'; +import { AgentResourceChunkModel } from './models/agentResourceChunk'; +import { AgentResourceModel } from './models/agentResource'; +import { AgentTaskModel } from './models/agentTask'; +import { AgentThreadModel } from './models/agentThread'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -56,6 +56,6 @@ export function createClient(config: OrmClientConfig) { agentResource: new AgentResourceModel(client), agentTask: new AgentTaskModel(client), agentThread: new AgentThreadModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/input-types.ts b/sdk/constructive-react/src/agent/orm/input-types.ts index c716bf9a92..3b5bf5f2b5 100644 --- a/sdk/constructive-react/src/agent/orm/input-types.ts +++ b/sdk/constructive-react/src/agent/orm/input-types.ts @@ -1151,15 +1151,288 @@ export interface AgentThreadFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type AgentOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_EPHEMERAL_ASC" | "IS_EPHEMERAL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PARENT_ID_ASC" | "PARENT_ID_DESC" | "PERSONA_ID_ASC" | "PERSONA_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentMessageOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AGENT_ID_ASC" | "AGENT_ID_DESC" | "AUTHOR_ROLE_ASC" | "AUTHOR_ROLE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MODEL_ASC" | "MODEL_DESC" | "NATURAL" | "PARTS_ASC" | "PARTS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "THREAD_ID_ASC" | "THREAD_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentPersonaOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentPlanOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "THREAD_ID_ASC" | "THREAD_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentPromptOrderBy = "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_DEFAULT_ASC" | "IS_DEFAULT_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentResourceChunkOrderBy = "AGENT_RESOURCE_ID_ASC" | "AGENT_RESOURCE_ID_DESC" | "BODY_ASC" | "BODY_DESC" | "CHUNK_INDEX_ASC" | "CHUNK_INDEX_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EMBEDDING_ASC" | "EMBEDDING_DESC" | "EMBEDDING_VECTOR_DISTANCE_ASC" | "EMBEDDING_VECTOR_DISTANCE_DESC" | "ID_ASC" | "ID_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentResourceOrderBy = "ARCHIVED_AT_ASC" | "ARCHIVED_AT_DESC" | "BODY_ASC" | "BODY_DESC" | "BODY_TRGM_SIMILARITY_ASC" | "BODY_TRGM_SIMILARITY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DESCRIPTION_TRGM_SIMILARITY_ASC" | "DESCRIPTION_TRGM_SIMILARITY_DESC" | "EMBEDDING_ASC" | "EMBEDDING_DESC" | "EMBEDDING_UPDATED_AT_ASC" | "EMBEDDING_UPDATED_AT_DESC" | "EMBEDDING_VECTOR_DISTANCE_ASC" | "EMBEDDING_VECTOR_DISTANCE_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ARCHIVED_ASC" | "IS_ARCHIVED_DESC" | "KEYWORDS_ASC" | "KEYWORDS_DESC" | "KIND_ASC" | "KIND_DESC" | "KIND_TRGM_SIMILARITY_ASC" | "KIND_TRGM_SIMILARITY_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_ASC" | "SEARCH_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "SEARCH_TSV_RANK_ASC" | "SEARCH_TSV_RANK_DESC" | "SLUG_ASC" | "SLUG_DESC" | "TITLE_ASC" | "TITLE_DESC" | "TITLE_TRGM_SIMILARITY_ASC" | "TITLE_TRGM_SIMILARITY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentTaskOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "APPROVAL_FEEDBACK_ASC" | "APPROVAL_FEEDBACK_DESC" | "APPROVAL_STATUS_ASC" | "APPROVAL_STATUS_DESC" | "APPROVED_AT_ASC" | "APPROVED_AT_DESC" | "APPROVED_BY_ASC" | "APPROVED_BY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORDER_INDEX_ASC" | "ORDER_INDEX_DESC" | "PLAN_ID_ASC" | "PLAN_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRES_APPROVAL_ASC" | "REQUIRES_APPROVAL_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentThreadOrderBy = "AGENT_ID_ASC" | "AGENT_ID_DESC" | "ARCHIVED_AT_ASC" | "ARCHIVED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ARCHIVED_ASC" | "IS_ARCHIVED_DESC" | "MODEL_ASC" | "MODEL_DESC" | "MODE_ASC" | "MODE_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PARENT_THREAD_ID_ASC" | "PARENT_THREAD_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROMPT_TEMPLATE_ID_ASC" | "PROMPT_TEMPLATE_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_EPHEMERAL_ASC' + | 'IS_EPHEMERAL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PARENT_ID_ASC' + | 'PARENT_ID_DESC' + | 'PERSONA_ID_ASC' + | 'PERSONA_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentMessageOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AGENT_ID_ASC' + | 'AGENT_ID_DESC' + | 'AUTHOR_ROLE_ASC' + | 'AUTHOR_ROLE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MODEL_ASC' + | 'MODEL_DESC' + | 'NATURAL' + | 'PARTS_ASC' + | 'PARTS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'THREAD_ID_ASC' + | 'THREAD_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentPersonaOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentPlanOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'THREAD_ID_ASC' + | 'THREAD_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentPromptOrderBy = + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_DEFAULT_ASC' + | 'IS_DEFAULT_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentResourceChunkOrderBy = + | 'AGENT_RESOURCE_ID_ASC' + | 'AGENT_RESOURCE_ID_DESC' + | 'BODY_ASC' + | 'BODY_DESC' + | 'CHUNK_INDEX_ASC' + | 'CHUNK_INDEX_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EMBEDDING_ASC' + | 'EMBEDDING_DESC' + | 'EMBEDDING_VECTOR_DISTANCE_ASC' + | 'EMBEDDING_VECTOR_DISTANCE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentResourceOrderBy = + | 'ARCHIVED_AT_ASC' + | 'ARCHIVED_AT_DESC' + | 'BODY_ASC' + | 'BODY_DESC' + | 'BODY_TRGM_SIMILARITY_ASC' + | 'BODY_TRGM_SIMILARITY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DESCRIPTION_TRGM_SIMILARITY_ASC' + | 'DESCRIPTION_TRGM_SIMILARITY_DESC' + | 'EMBEDDING_ASC' + | 'EMBEDDING_DESC' + | 'EMBEDDING_UPDATED_AT_ASC' + | 'EMBEDDING_UPDATED_AT_DESC' + | 'EMBEDDING_VECTOR_DISTANCE_ASC' + | 'EMBEDDING_VECTOR_DISTANCE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ARCHIVED_ASC' + | 'IS_ARCHIVED_DESC' + | 'KEYWORDS_ASC' + | 'KEYWORDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'KIND_TRGM_SIMILARITY_ASC' + | 'KIND_TRGM_SIMILARITY_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_ASC' + | 'SEARCH_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'SEARCH_TSV_RANK_ASC' + | 'SEARCH_TSV_RANK_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'TITLE_TRGM_SIMILARITY_ASC' + | 'TITLE_TRGM_SIMILARITY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentTaskOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'APPROVAL_FEEDBACK_ASC' + | 'APPROVAL_FEEDBACK_DESC' + | 'APPROVAL_STATUS_ASC' + | 'APPROVAL_STATUS_DESC' + | 'APPROVED_AT_ASC' + | 'APPROVED_AT_DESC' + | 'APPROVED_BY_ASC' + | 'APPROVED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORDER_INDEX_ASC' + | 'ORDER_INDEX_DESC' + | 'PLAN_ID_ASC' + | 'PLAN_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRES_APPROVAL_ASC' + | 'REQUIRES_APPROVAL_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentThreadOrderBy = + | 'AGENT_ID_ASC' + | 'AGENT_ID_DESC' + | 'ARCHIVED_AT_ASC' + | 'ARCHIVED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ARCHIVED_ASC' + | 'IS_ARCHIVED_DESC' + | 'MODEL_ASC' + | 'MODEL_DESC' + | 'MODE_ASC' + | 'MODE_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PARENT_THREAD_ID_ASC' + | 'PARENT_THREAD_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROMPT_TEMPLATE_ID_ASC' + | 'PROMPT_TEMPLATE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateAgentInput { clientMutationId?: string; @@ -1483,28 +1756,28 @@ export interface DeleteAgentThreadInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Agent": { - "agentMessages": "AgentMessage", - "agentThreads": "AgentThread", - "childAgents": "Agent" + Agent: { + agentMessages: 'AgentMessage', + agentThreads: 'AgentThread', + childAgents: 'Agent', }, - "AgentPersona": { - "agentsByPersonaId": "Agent" + AgentPersona: { + agentsByPersonaId: 'Agent', }, - "AgentPlan": { - "agentTasksByPlanId": "AgentTask" + AgentPlan: { + agentTasksByPlanId: 'AgentTask', }, - "AgentPrompt": { - "agentThreadsByPromptTemplateId": "AgentThread" + AgentPrompt: { + agentThreadsByPromptTemplateId: 'AgentThread', }, - "AgentResource": { - "agentResourceChunks": "AgentResourceChunk" + AgentResource: { + agentResourceChunks: 'AgentResourceChunk', + }, + AgentThread: { + agentMessagesByThreadId: 'AgentMessage', + agentPlansByThreadId: 'AgentPlan', + agentThreadsByParentThreadId: 'AgentThread', }, - "AgentThread": { - "agentMessagesByThreadId": "AgentMessage", - "agentPlansByThreadId": "AgentPlan", - "agentThreadsByParentThreadId": "AgentThread" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -2121,7 +2394,7 @@ export interface AgentTaskFilter { updatedAt?: DatetimeFilter; } /** Similarity metric for vector search */ -export type VectorMetric = "COSINE" | "IP" | "L2"; +export type VectorMetric = 'COSINE' | 'IP' | 'L2'; /** A filter to be used against `AgentResourceChunk` object types. All fields are combined with a logical ‘and.’ */ export interface AgentResourceChunkFilter { /** Filter by the object’s `agentResource` relation. */ @@ -3151,4 +3424,4 @@ export type AgentThreadEdgeSelect = { node?: { select: AgentThreadSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/agent/orm/models/agent.ts b/sdk/constructive-react/src/agent/orm/models/agent.ts index bf8233944a..72f4b04da0 100644 --- a/sdk/constructive-react/src/agent/orm/models/agent.ts +++ b/sdk/constructive-react/src/agent/orm/models/agent.ts @@ -3,56 +3,96 @@ * @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 { Agent, AgentWithRelations, AgentSelect, AgentFilter, AgentOrderBy, CreateAgentInput, UpdateAgentInput, AgentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Agent, + AgentWithRelations, + AgentSelect, + AgentFilter, + AgentOrderBy, + CreateAgentInput, + UpdateAgentInput, + AgentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Agent", "agents", 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 - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Agent', + 'agents', + 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, + }, + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agents", + operation: 'query', + operationName: 'Agent', + fieldName: 'agents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Agent", "agents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Agent', + 'agents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agent", + operation: 'query', + operationName: 'Agent', + fieldName: 'agent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentModel { nodes?: InferSelectResult[]; }; }) => ({ - "agent": data.agents?.nodes?.[0] ?? null - }) + agent: data.agents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Agent", "agents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Agent', + 'agents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agent", + operation: 'query', + operationName: 'Agent', + fieldName: 'agent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentModel { nodes?: InferSelectResult[]; }; }) => ({ - "agent": data.agents?.nodes?.[0] ?? null - }) + agent: data.agents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Agent", "createAgent", "agent", args.select, args.data, "CreateAgentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Agent', + 'createAgent', + 'agent', + args.select, + args.data, + 'CreateAgentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "createAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'createAgent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Agent", "updateAgent", "agent", args.select, args.where.id, args.data, "UpdateAgentInput", "id", "agentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Agent', + 'updateAgent', + 'agent', + args.select, + args.where.id, + args.data, + 'UpdateAgentInput', + 'id', + 'agentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "updateAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'updateAgent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Agent", "deleteAgent", "agent", { - id: args.where.id - }, "DeleteAgentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Agent', + 'deleteAgent', + 'agent', + { + id: args.where.id, + }, + 'DeleteAgentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "deleteAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'deleteAgent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/agentMessage.ts b/sdk/constructive-react/src/agent/orm/models/agentMessage.ts index 68995cfcec..ffa3a09734 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentMessage.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentMessage.ts @@ -3,56 +3,96 @@ * @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 { AgentMessage, AgentMessageWithRelations, AgentMessageSelect, AgentMessageFilter, AgentMessageOrderBy, CreateAgentMessageInput, UpdateAgentMessageInput, AgentMessagePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentMessage, + AgentMessageWithRelations, + AgentMessageSelect, + AgentMessageFilter, + AgentMessageOrderBy, + CreateAgentMessageInput, + UpdateAgentMessageInput, + AgentMessagePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentMessageModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessages: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentMessage", "agentMessages", 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 - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentMessage', + 'agentMessages', + 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, + }, + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessages", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessages', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessage: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentMessage", "agentMessages", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentMessage', + 'agentMessages', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessage", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessage', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentMessageModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentMessage": data.agentMessages?.nodes?.[0] ?? null - }) + agentMessage: data.agentMessages?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessage: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentMessage", "agentMessages", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentMessage', + 'agentMessages', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessage", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessage', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentMessageModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentMessage": data.agentMessages?.nodes?.[0] ?? null - }) + agentMessage: data.agentMessages?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentMessage", "createAgentMessage", "agentMessage", args.select, args.data, "CreateAgentMessageInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentMessage', + 'createAgentMessage', + 'agentMessage', + args.select, + args.data, + 'CreateAgentMessageInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "createAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'createAgentMessage', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentMessagePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentMessage", "updateAgentMessage", "agentMessage", args.select, args.where.id, args.data, "UpdateAgentMessageInput", "id", "agentMessagePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentMessage', + 'updateAgentMessage', + 'agentMessage', + args.select, + args.where.id, + args.data, + 'UpdateAgentMessageInput', + 'id', + 'agentMessagePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "updateAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'updateAgentMessage', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentMessage", "deleteAgentMessage", "agentMessage", { - id: args.where.id - }, "DeleteAgentMessageInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentMessage', + 'deleteAgentMessage', + 'agentMessage', + { + id: args.where.id, + }, + 'DeleteAgentMessageInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "deleteAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'deleteAgentMessage', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/agentPersona.ts b/sdk/constructive-react/src/agent/orm/models/agentPersona.ts index 4d25d25806..1391dbde2c 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentPersona.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentPersona.ts @@ -3,56 +3,96 @@ * @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 { AgentPersona, AgentPersonaWithRelations, AgentPersonaSelect, AgentPersonaFilter, AgentPersonaOrderBy, CreateAgentPersonaInput, UpdateAgentPersonaInput, AgentPersonaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPersona, + AgentPersonaWithRelations, + AgentPersonaSelect, + AgentPersonaFilter, + AgentPersonaOrderBy, + CreateAgentPersonaInput, + UpdateAgentPersonaInput, + AgentPersonaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPersonaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersonas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPersona", "agentPersonas", 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 - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPersona', + 'agentPersonas', + 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, + }, + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersonas", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersonas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersona: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPersona", "agentPersonas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPersona', + 'agentPersonas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersona", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersona', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPersonaModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPersona": data.agentPersonas?.nodes?.[0] ?? null - }) + agentPersona: data.agentPersonas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersona: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPersona", "agentPersonas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPersona', + 'agentPersonas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersona", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersona', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPersonaModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPersona": data.agentPersonas?.nodes?.[0] ?? null - }) + agentPersona: data.agentPersonas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPersona", "createAgentPersona", "agentPersona", args.select, args.data, "CreateAgentPersonaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPersona', + 'createAgentPersona', + 'agentPersona', + args.select, + args.data, + 'CreateAgentPersonaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "createAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'createAgentPersona', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPersonaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPersona", "updateAgentPersona", "agentPersona", args.select, args.where.id, args.data, "UpdateAgentPersonaInput", "id", "agentPersonaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPersona', + 'updateAgentPersona', + 'agentPersona', + args.select, + args.where.id, + args.data, + 'UpdateAgentPersonaInput', + 'id', + 'agentPersonaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "updateAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'updateAgentPersona', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPersona", "deleteAgentPersona", "agentPersona", { - id: args.where.id - }, "DeleteAgentPersonaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPersona', + 'deleteAgentPersona', + 'agentPersona', + { + id: args.where.id, + }, + 'DeleteAgentPersonaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "deleteAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'deleteAgentPersona', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/agentPlan.ts b/sdk/constructive-react/src/agent/orm/models/agentPlan.ts index 7c2939a364..9829718fee 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentPlan.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentPlan.ts @@ -3,56 +3,96 @@ * @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 { AgentPlan, AgentPlanWithRelations, AgentPlanSelect, AgentPlanFilter, AgentPlanOrderBy, CreateAgentPlanInput, UpdateAgentPlanInput, AgentPlanPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPlan, + AgentPlanWithRelations, + AgentPlanSelect, + AgentPlanFilter, + AgentPlanOrderBy, + CreateAgentPlanInput, + UpdateAgentPlanInput, + AgentPlanPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPlanModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlans: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPlan", "agentPlans", 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 - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPlan', + 'agentPlans', + 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, + }, + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlans", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlans', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlan: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPlan", "agentPlans", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPlan', + 'agentPlans', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlan", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlan', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPlanModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPlan": data.agentPlans?.nodes?.[0] ?? null - }) + agentPlan: data.agentPlans?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlan: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPlan", "agentPlans", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPlan', + 'agentPlans', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlan", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlan', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPlanModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPlan": data.agentPlans?.nodes?.[0] ?? null - }) + agentPlan: data.agentPlans?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPlan", "createAgentPlan", "agentPlan", args.select, args.data, "CreateAgentPlanInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPlan', + 'createAgentPlan', + 'agentPlan', + args.select, + args.data, + 'CreateAgentPlanInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "createAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'createAgentPlan', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPlanPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPlan", "updateAgentPlan", "agentPlan", args.select, args.where.id, args.data, "UpdateAgentPlanInput", "id", "agentPlanPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPlan', + 'updateAgentPlan', + 'agentPlan', + args.select, + args.where.id, + args.data, + 'UpdateAgentPlanInput', + 'id', + 'agentPlanPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "updateAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'updateAgentPlan', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPlan", "deleteAgentPlan", "agentPlan", { - id: args.where.id - }, "DeleteAgentPlanInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPlan', + 'deleteAgentPlan', + 'agentPlan', + { + id: args.where.id, + }, + 'DeleteAgentPlanInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "deleteAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'deleteAgentPlan', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/agentPrompt.ts b/sdk/constructive-react/src/agent/orm/models/agentPrompt.ts index 7d63959a91..e301bf6c99 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentPrompt.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentPrompt.ts @@ -3,56 +3,96 @@ * @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 { AgentPrompt, AgentPromptWithRelations, AgentPromptSelect, AgentPromptFilter, AgentPromptOrderBy, CreateAgentPromptInput, UpdateAgentPromptInput, AgentPromptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPrompt, + AgentPromptWithRelations, + AgentPromptSelect, + AgentPromptFilter, + AgentPromptOrderBy, + CreateAgentPromptInput, + UpdateAgentPromptInput, + AgentPromptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPromptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompts: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPrompt", "agentPrompts", 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 - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPrompt', + 'agentPrompts', + 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, + }, + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompts", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPrompt", "agentPrompts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPrompt', + 'agentPrompts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompt", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompt', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPromptModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPrompt": data.agentPrompts?.nodes?.[0] ?? null - }) + agentPrompt: data.agentPrompts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPrompt", "agentPrompts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPrompt', + 'agentPrompts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompt", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompt', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPromptModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPrompt": data.agentPrompts?.nodes?.[0] ?? null - }) + agentPrompt: data.agentPrompts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPrompt", "createAgentPrompt", "agentPrompt", args.select, args.data, "CreateAgentPromptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPrompt', + 'createAgentPrompt', + 'agentPrompt', + args.select, + args.data, + 'CreateAgentPromptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "createAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'createAgentPrompt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPromptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPrompt", "updateAgentPrompt", "agentPrompt", args.select, args.where.id, args.data, "UpdateAgentPromptInput", "id", "agentPromptPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPrompt', + 'updateAgentPrompt', + 'agentPrompt', + args.select, + args.where.id, + args.data, + 'UpdateAgentPromptInput', + 'id', + 'agentPromptPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "updateAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'updateAgentPrompt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPrompt", "deleteAgentPrompt", "agentPrompt", { - id: args.where.id - }, "DeleteAgentPromptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPrompt', + 'deleteAgentPrompt', + 'agentPrompt', + { + id: args.where.id, + }, + 'DeleteAgentPromptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "deleteAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'deleteAgentPrompt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/agentResource.ts b/sdk/constructive-react/src/agent/orm/models/agentResource.ts index 3dc0e3ad1e..7628b03b3c 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentResource.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentResource.ts @@ -3,56 +3,96 @@ * @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 { AgentResource, AgentResourceWithRelations, AgentResourceSelect, AgentResourceFilter, AgentResourceOrderBy, CreateAgentResourceInput, UpdateAgentResourceInput, AgentResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentResource, + AgentResourceWithRelations, + AgentResourceSelect, + AgentResourceFilter, + AgentResourceOrderBy, + CreateAgentResourceInput, + UpdateAgentResourceInput, + AgentResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResource", "agentResources", 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 - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentResource', + 'agentResources', + 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, + }, + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResources", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentResource", "agentResources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentResource', + 'agentResources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResource", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResource": data.agentResources?.nodes?.[0] ?? null - }) + agentResource: data.agentResources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResource", "agentResources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentResource', + 'agentResources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResource", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResource": data.agentResources?.nodes?.[0] ?? null - }) + agentResource: data.agentResources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentResource", "createAgentResource", "agentResource", args.select, args.data, "CreateAgentResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentResource', + 'createAgentResource', + 'agentResource', + args.select, + args.data, + 'CreateAgentResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "createAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'createAgentResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentResource", "updateAgentResource", "agentResource", args.select, args.where.id, args.data, "UpdateAgentResourceInput", "id", "agentResourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentResource', + 'updateAgentResource', + 'agentResource', + args.select, + args.where.id, + args.data, + 'UpdateAgentResourceInput', + 'id', + 'agentResourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "updateAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'updateAgentResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentResource", "deleteAgentResource", "agentResource", { - id: args.where.id - }, "DeleteAgentResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentResource', + 'deleteAgentResource', + 'agentResource', + { + id: args.where.id, + }, + 'DeleteAgentResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "deleteAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'deleteAgentResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/agentResourceChunk.ts b/sdk/constructive-react/src/agent/orm/models/agentResourceChunk.ts index 49158ba880..fd5edf82ac 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentResourceChunk.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentResourceChunk.ts @@ -3,56 +3,96 @@ * @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 { AgentResourceChunk, AgentResourceChunkWithRelations, AgentResourceChunkSelect, AgentResourceChunkFilter, AgentResourceChunkOrderBy, CreateAgentResourceChunkInput, UpdateAgentResourceChunkInput, AgentResourceChunkPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentResourceChunk, + AgentResourceChunkWithRelations, + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy, + CreateAgentResourceChunkInput, + UpdateAgentResourceChunkInput, + AgentResourceChunkPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentResourceChunkModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResourceChunk", "agentResourceChunks", 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 - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + 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, + }, + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunks", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentResourceChunk", "agentResourceChunks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunk", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunk', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentResourceChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResourceChunk": data.agentResourceChunks?.nodes?.[0] ?? null - }) + agentResourceChunk: data.agentResourceChunks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResourceChunk", "agentResourceChunks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunk", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunk', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentResourceChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResourceChunk": data.agentResourceChunks?.nodes?.[0] ?? null - }) + agentResourceChunk: data.agentResourceChunks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentResourceChunk", "createAgentResourceChunk", "agentResourceChunk", args.select, args.data, "CreateAgentResourceChunkInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentResourceChunk', + 'createAgentResourceChunk', + 'agentResourceChunk', + args.select, + args.data, + 'CreateAgentResourceChunkInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "createAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'createAgentResourceChunk', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentResourceChunkPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentResourceChunk", "updateAgentResourceChunk", "agentResourceChunk", args.select, args.where.id, args.data, "UpdateAgentResourceChunkInput", "id", "agentResourceChunkPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentResourceChunk', + 'updateAgentResourceChunk', + 'agentResourceChunk', + args.select, + args.where.id, + args.data, + 'UpdateAgentResourceChunkInput', + 'id', + 'agentResourceChunkPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "updateAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'updateAgentResourceChunk', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentResourceChunk", "deleteAgentResourceChunk", "agentResourceChunk", { - id: args.where.id - }, "DeleteAgentResourceChunkInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentResourceChunk', + 'deleteAgentResourceChunk', + 'agentResourceChunk', + { + id: args.where.id, + }, + 'DeleteAgentResourceChunkInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "deleteAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'deleteAgentResourceChunk', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/agentTask.ts b/sdk/constructive-react/src/agent/orm/models/agentTask.ts index 6eabf7f118..a4b3a1e367 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentTask.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentTask.ts @@ -3,56 +3,96 @@ * @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 { AgentTask, AgentTaskWithRelations, AgentTaskSelect, AgentTaskFilter, AgentTaskOrderBy, CreateAgentTaskInput, UpdateAgentTaskInput, AgentTaskPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentTask, + AgentTaskWithRelations, + AgentTaskSelect, + AgentTaskFilter, + AgentTaskOrderBy, + CreateAgentTaskInput, + UpdateAgentTaskInput, + AgentTaskPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentTaskModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTasks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentTask", "agentTasks", 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 - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentTask', + 'agentTasks', + 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, + }, + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTasks", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTasks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTask: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentTask", "agentTasks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentTask', + 'agentTasks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTask", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTask', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentTaskModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentTask": data.agentTasks?.nodes?.[0] ?? null - }) + agentTask: data.agentTasks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTask: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentTask", "agentTasks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentTask', + 'agentTasks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTask", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTask', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentTaskModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentTask": data.agentTasks?.nodes?.[0] ?? null - }) + agentTask: data.agentTasks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentTask", "createAgentTask", "agentTask", args.select, args.data, "CreateAgentTaskInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentTask', + 'createAgentTask', + 'agentTask', + args.select, + args.data, + 'CreateAgentTaskInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "createAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'createAgentTask', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentTaskPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentTask", "updateAgentTask", "agentTask", args.select, args.where.id, args.data, "UpdateAgentTaskInput", "id", "agentTaskPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentTask', + 'updateAgentTask', + 'agentTask', + args.select, + args.where.id, + args.data, + 'UpdateAgentTaskInput', + 'id', + 'agentTaskPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "updateAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'updateAgentTask', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentTask", "deleteAgentTask", "agentTask", { - id: args.where.id - }, "DeleteAgentTaskInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentTask', + 'deleteAgentTask', + 'agentTask', + { + id: args.where.id, + }, + 'DeleteAgentTaskInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "deleteAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'deleteAgentTask', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/agentThread.ts b/sdk/constructive-react/src/agent/orm/models/agentThread.ts index 6f1a410252..1ae2eb5a67 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentThread.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentThread.ts @@ -3,56 +3,96 @@ * @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 { AgentThread, AgentThreadWithRelations, AgentThreadSelect, AgentThreadFilter, AgentThreadOrderBy, CreateAgentThreadInput, UpdateAgentThreadInput, AgentThreadPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentThread, + AgentThreadWithRelations, + AgentThreadSelect, + AgentThreadFilter, + AgentThreadOrderBy, + CreateAgentThreadInput, + UpdateAgentThreadInput, + AgentThreadPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentThreadModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThreads: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentThread", "agentThreads", 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 - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentThread', + 'agentThreads', + 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, + }, + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThreads", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThreads', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThread: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentThread", "agentThreads", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentThread', + 'agentThreads', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThread", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThread', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentThreadModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentThread": data.agentThreads?.nodes?.[0] ?? null - }) + agentThread: data.agentThreads?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThread: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentThread", "agentThreads", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentThread', + 'agentThreads', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThread", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThread', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentThreadModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentThread": data.agentThreads?.nodes?.[0] ?? null - }) + agentThread: data.agentThreads?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentThread", "createAgentThread", "agentThread", args.select, args.data, "CreateAgentThreadInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentThread', + 'createAgentThread', + 'agentThread', + args.select, + args.data, + 'CreateAgentThreadInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "createAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'createAgentThread', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentThreadPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentThread", "updateAgentThread", "agentThread", args.select, args.where.id, args.data, "UpdateAgentThreadInput", "id", "agentThreadPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentThread', + 'updateAgentThread', + 'agentThread', + args.select, + args.where.id, + args.data, + 'UpdateAgentThreadInput', + 'id', + 'agentThreadPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "updateAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'updateAgentThread', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentThread", "deleteAgentThread", "agentThread", { - id: args.where.id - }, "DeleteAgentThreadInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentThread', + 'deleteAgentThread', + 'agentThread', + { + id: args.where.id, + }, + 'DeleteAgentThreadInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "deleteAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'deleteAgentThread', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/models/index.ts b/sdk/constructive-react/src/agent/orm/models/index.ts index b0397fe3ec..4d02471c8a 100644 --- a/sdk/constructive-react/src/agent/orm/models/index.ts +++ b/sdk/constructive-react/src/agent/orm/models/index.ts @@ -3,12 +3,12 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AgentModel } from "./agent"; -export { AgentMessageModel } from "./agentMessage"; -export { AgentPersonaModel } from "./agentPersona"; -export { AgentPlanModel } from "./agentPlan"; -export { AgentPromptModel } from "./agentPrompt"; -export { AgentResourceChunkModel } from "./agentResourceChunk"; -export { AgentResourceModel } from "./agentResource"; -export { AgentTaskModel } from "./agentTask"; -export { AgentThreadModel } from "./agentThread"; \ No newline at end of file +export { AgentModel } from './agent'; +export { AgentMessageModel } from './agentMessage'; +export { AgentPersonaModel } from './agentPersona'; +export { AgentPlanModel } from './agentPlan'; +export { AgentPromptModel } from './agentPrompt'; +export { AgentResourceChunkModel } from './agentResourceChunk'; +export { AgentResourceModel } from './agentResource'; +export { AgentTaskModel } from './agentTask'; +export { AgentThreadModel } from './agentThread'; diff --git a/sdk/constructive-react/src/agent/orm/mutation/index.ts b/sdk/constructive-react/src/agent/orm/mutation/index.ts index 1e981b094d..989afbcbd6 100644 --- a/sdk/constructive-react/src/agent/orm/mutation/index.ts +++ b/sdk/constructive-react/src/agent/orm/mutation/index.ts @@ -3,11 +3,15 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, ProvisionBucketPayload, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + ProvisionBucketPayload, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -20,19 +24,34 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/orm/query-builder.ts b/sdk/constructive-react/src/agent/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/agent/orm/query-builder.ts +++ b/sdk/constructive-react/src/agent/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/agent/orm/realtime.ts b/sdk/constructive-react/src/agent/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/agent/orm/realtime.ts +++ b/sdk/constructive-react/src/agent/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/agent/orm/select-types.ts b/sdk/constructive-react/src/agent/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/agent/orm/select-types.ts +++ b/sdk/constructive-react/src/agent/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/agent/schema-types.ts b/sdk/constructive-react/src/agent/schema-types.ts index ad07e00f42..2fe205b152 100644 --- a/sdk/constructive-react/src/agent/schema-types.ts +++ b/sdk/constructive-react/src/agent/schema-types.ts @@ -4,27 +4,327 @@ * DO NOT EDIT - changes will be overwritten */ -import type { Agent, AgentMessage, AgentPersona, AgentPlan, AgentPrompt, AgentResource, AgentResourceChunk, AgentTask, AgentThread, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + Agent, + AgentMessage, + AgentPersona, + AgentPlan, + AgentPrompt, + AgentResource, + AgentResourceChunk, + AgentTask, + AgentThread, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; /** Methods to use when ordering `AgentMessage`. */ -export type AgentMessageOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AGENT_ID_ASC" | "AGENT_ID_DESC" | "AUTHOR_ROLE_ASC" | "AUTHOR_ROLE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MODEL_ASC" | "MODEL_DESC" | "NATURAL" | "PARTS_ASC" | "PARTS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "THREAD_ID_ASC" | "THREAD_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentMessageOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AGENT_ID_ASC' + | 'AGENT_ID_DESC' + | 'AUTHOR_ROLE_ASC' + | 'AUTHOR_ROLE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MODEL_ASC' + | 'MODEL_DESC' + | 'NATURAL' + | 'PARTS_ASC' + | 'PARTS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'THREAD_ID_ASC' + | 'THREAD_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Agent`. */ -export type AgentOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_EPHEMERAL_ASC" | "IS_EPHEMERAL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PARENT_ID_ASC" | "PARENT_ID_DESC" | "PERSONA_ID_ASC" | "PERSONA_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_EPHEMERAL_ASC' + | 'IS_EPHEMERAL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PARENT_ID_ASC' + | 'PARENT_ID_DESC' + | 'PERSONA_ID_ASC' + | 'PERSONA_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AgentPersona`. */ -export type AgentPersonaOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type AgentPersonaOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `AgentPlan`. */ -export type AgentPlanOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "THREAD_ID_ASC" | "THREAD_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentPlanOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'THREAD_ID_ASC' + | 'THREAD_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AgentPrompt`. */ -export type AgentPromptOrderBy = "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_DEFAULT_ASC" | "IS_DEFAULT_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type AgentPromptOrderBy = + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_DEFAULT_ASC' + | 'IS_DEFAULT_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `AgentResourceChunk`. */ -export type AgentResourceChunkOrderBy = "AGENT_RESOURCE_ID_ASC" | "AGENT_RESOURCE_ID_DESC" | "BODY_ASC" | "BODY_DESC" | "CHUNK_INDEX_ASC" | "CHUNK_INDEX_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EMBEDDING_ASC" | "EMBEDDING_DESC" | "EMBEDDING_VECTOR_DISTANCE_ASC" | "EMBEDDING_VECTOR_DISTANCE_DESC" | "ID_ASC" | "ID_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentResourceChunkOrderBy = + | 'AGENT_RESOURCE_ID_ASC' + | 'AGENT_RESOURCE_ID_DESC' + | 'BODY_ASC' + | 'BODY_DESC' + | 'CHUNK_INDEX_ASC' + | 'CHUNK_INDEX_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EMBEDDING_ASC' + | 'EMBEDDING_DESC' + | 'EMBEDDING_VECTOR_DISTANCE_ASC' + | 'EMBEDDING_VECTOR_DISTANCE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AgentResource`. */ -export type AgentResourceOrderBy = "ARCHIVED_AT_ASC" | "ARCHIVED_AT_DESC" | "BODY_ASC" | "BODY_DESC" | "BODY_TRGM_SIMILARITY_ASC" | "BODY_TRGM_SIMILARITY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DESCRIPTION_TRGM_SIMILARITY_ASC" | "DESCRIPTION_TRGM_SIMILARITY_DESC" | "EMBEDDING_ASC" | "EMBEDDING_DESC" | "EMBEDDING_UPDATED_AT_ASC" | "EMBEDDING_UPDATED_AT_DESC" | "EMBEDDING_VECTOR_DISTANCE_ASC" | "EMBEDDING_VECTOR_DISTANCE_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ARCHIVED_ASC" | "IS_ARCHIVED_DESC" | "KEYWORDS_ASC" | "KEYWORDS_DESC" | "KIND_ASC" | "KIND_DESC" | "KIND_TRGM_SIMILARITY_ASC" | "KIND_TRGM_SIMILARITY_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_ASC" | "SEARCH_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "SEARCH_TSV_RANK_ASC" | "SEARCH_TSV_RANK_DESC" | "SLUG_ASC" | "SLUG_DESC" | "TITLE_ASC" | "TITLE_DESC" | "TITLE_TRGM_SIMILARITY_ASC" | "TITLE_TRGM_SIMILARITY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type AgentResourceOrderBy = + | 'ARCHIVED_AT_ASC' + | 'ARCHIVED_AT_DESC' + | 'BODY_ASC' + | 'BODY_DESC' + | 'BODY_TRGM_SIMILARITY_ASC' + | 'BODY_TRGM_SIMILARITY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DESCRIPTION_TRGM_SIMILARITY_ASC' + | 'DESCRIPTION_TRGM_SIMILARITY_DESC' + | 'EMBEDDING_ASC' + | 'EMBEDDING_DESC' + | 'EMBEDDING_UPDATED_AT_ASC' + | 'EMBEDDING_UPDATED_AT_DESC' + | 'EMBEDDING_VECTOR_DISTANCE_ASC' + | 'EMBEDDING_VECTOR_DISTANCE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ARCHIVED_ASC' + | 'IS_ARCHIVED_DESC' + | 'KEYWORDS_ASC' + | 'KEYWORDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'KIND_TRGM_SIMILARITY_ASC' + | 'KIND_TRGM_SIMILARITY_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_ASC' + | 'SEARCH_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'SEARCH_TSV_RANK_ASC' + | 'SEARCH_TSV_RANK_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'TITLE_TRGM_SIMILARITY_ASC' + | 'TITLE_TRGM_SIMILARITY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `AgentTask`. */ -export type AgentTaskOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "APPROVAL_FEEDBACK_ASC" | "APPROVAL_FEEDBACK_DESC" | "APPROVAL_STATUS_ASC" | "APPROVAL_STATUS_DESC" | "APPROVED_AT_ASC" | "APPROVED_AT_DESC" | "APPROVED_BY_ASC" | "APPROVED_BY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORDER_INDEX_ASC" | "ORDER_INDEX_DESC" | "PLAN_ID_ASC" | "PLAN_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRES_APPROVAL_ASC" | "REQUIRES_APPROVAL_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentTaskOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'APPROVAL_FEEDBACK_ASC' + | 'APPROVAL_FEEDBACK_DESC' + | 'APPROVAL_STATUS_ASC' + | 'APPROVAL_STATUS_DESC' + | 'APPROVED_AT_ASC' + | 'APPROVED_AT_DESC' + | 'APPROVED_BY_ASC' + | 'APPROVED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORDER_INDEX_ASC' + | 'ORDER_INDEX_DESC' + | 'PLAN_ID_ASC' + | 'PLAN_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRES_APPROVAL_ASC' + | 'REQUIRES_APPROVAL_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AgentThread`. */ -export type AgentThreadOrderBy = "AGENT_ID_ASC" | "AGENT_ID_DESC" | "ARCHIVED_AT_ASC" | "ARCHIVED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ARCHIVED_ASC" | "IS_ARCHIVED_DESC" | "MODEL_ASC" | "MODEL_DESC" | "MODE_ASC" | "MODE_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PARENT_THREAD_ID_ASC" | "PARENT_THREAD_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROMPT_TEMPLATE_ID_ASC" | "PROMPT_TEMPLATE_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentThreadOrderBy = + | 'AGENT_ID_ASC' + | 'AGENT_ID_DESC' + | 'ARCHIVED_AT_ASC' + | 'ARCHIVED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ARCHIVED_ASC' + | 'IS_ARCHIVED_DESC' + | 'MODEL_ASC' + | 'MODEL_DESC' + | 'MODE_ASC' + | 'MODE_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PARENT_THREAD_ID_ASC' + | 'PARENT_THREAD_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROMPT_TEMPLATE_ID_ASC' + | 'PROMPT_TEMPLATE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Similarity metric for vector search */ -export type VectorMetric = "COSINE" | "IP" | "L2"; +export type VectorMetric = 'COSINE' | 'IP' | 'L2'; /** A filter to be used against `Agent` object types. All fields are combined with a logical ‘and.’ */ export interface AgentFilter { /** Filter by the object’s `agentMessages` relation. */ @@ -1738,4 +2038,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/agent/types.ts b/sdk/constructive-react/src/agent/types.ts index ee077b732e..b72c97f05d 100644 --- a/sdk/constructive-react/src/agent/types.ts +++ b/sdk/constructive-react/src/agent/types.ts @@ -367,4 +367,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/hooks/client.ts b/sdk/constructive-react/src/api/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/api/hooks/client.ts +++ b/sdk/constructive-react/src/api/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/api/hooks/index.ts b/sdk/constructive-react/src/api/hooks/index.ts index 2842d49166..e6c552eee0 100644 --- a/sdk/constructive-react/src/api/hooks/index.ts +++ b/sdk/constructive-react/src/api/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: Api, ApiModule, ApiSchema, ApiSetting, AstMigration, CheckConstraint, CompositeType, CorsSetting, Database, DatabaseSetting, DatabaseTransfer, DefaultPrivilege, Domain, DomainEvent, DomainVerification, EmbeddingChunk, Enum, ExclusionConstraint, Field, ForeignKeyConstraint, FullTextSearch, Function, HostnameBinding, HttpRoute, Index, ManagedDomain, NodeTypeRegistry, Partition, PlatformApi, PlatformApiModule, PlatformApiSchema, PlatformApiSetting, PlatformCorsSetting, PlatformDomain, PlatformDomainEvent, PlatformDomainVerification, PlatformManagedDomain, PlatformSite, PlatformSiteMetadatum, PlatformSiteModule, PlatformSiteTheme, Policy, PrimaryKeyConstraint, PubkeySetting, RlsSetting, RouteBinding, Route, Schema, SchemaGrant, Site, SiteMetadatum, SiteModule, SiteTheme, SpatialRelation, SqlAction, Table, TableGrant, Trigger, TriggerFunction, UniqueConstraint, View, ViewGrant, ViewRule, ViewTable, WebauthnSetting - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/api/hooks/invalidation.ts b/sdk/constructive-react/src/api/hooks/invalidation.ts index 95f465fc78..c4da570efa 100644 --- a/sdk/constructive-react/src/api/hooks/invalidation.ts +++ b/sdk/constructive-react/src/api/hooks/invalidation.ts @@ -13,8 +13,74 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { apiKeys, apiModuleKeys, apiSchemaKeys, apiSettingKeys, astMigrationKeys, checkConstraintKeys, compositeTypeKeys, corsSettingKeys, databaseKeys, databaseSettingKeys, databaseTransferKeys, defaultPrivilegeKeys, domainKeys, domainEventKeys, domainVerificationKeys, embeddingChunkKeys, enumKeys, exclusionConstraintKeys, fieldKeys, foreignKeyConstraintKeys, fullTextSearchKeys, functionKeys, hostnameBindingKeys, httpRouteKeys, indexKeys, managedDomainKeys, nodeTypeRegistryKeys, partitionKeys, platformApiKeys, platformApiModuleKeys, platformApiSchemaKeys, platformApiSettingKeys, platformCorsSettingKeys, platformDomainKeys, platformDomainEventKeys, platformDomainVerificationKeys, platformManagedDomainKeys, platformSiteKeys, platformSiteMetadatumKeys, platformSiteModuleKeys, platformSiteThemeKeys, policyKeys, primaryKeyConstraintKeys, pubkeySettingKeys, rlsSettingKeys, routeBindingKeys, routeKeys, schemaKeys, schemaGrantKeys, siteKeys, siteMetadatumKeys, siteModuleKeys, siteThemeKeys, spatialRelationKeys, sqlActionKeys, tableKeys, tableGrantKeys, triggerKeys, triggerFunctionKeys, uniqueConstraintKeys, viewKeys, viewGrantKeys, viewRuleKeys, viewTableKeys, webauthnSettingKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + apiKeys, + apiModuleKeys, + apiSchemaKeys, + apiSettingKeys, + astMigrationKeys, + checkConstraintKeys, + compositeTypeKeys, + corsSettingKeys, + databaseKeys, + databaseSettingKeys, + databaseTransferKeys, + defaultPrivilegeKeys, + domainKeys, + domainEventKeys, + domainVerificationKeys, + embeddingChunkKeys, + enumKeys, + exclusionConstraintKeys, + fieldKeys, + foreignKeyConstraintKeys, + fullTextSearchKeys, + functionKeys, + hostnameBindingKeys, + httpRouteKeys, + indexKeys, + managedDomainKeys, + nodeTypeRegistryKeys, + partitionKeys, + platformApiKeys, + platformApiModuleKeys, + platformApiSchemaKeys, + platformApiSettingKeys, + platformCorsSettingKeys, + platformDomainKeys, + platformDomainEventKeys, + platformDomainVerificationKeys, + platformManagedDomainKeys, + platformSiteKeys, + platformSiteMetadatumKeys, + platformSiteModuleKeys, + platformSiteThemeKeys, + policyKeys, + primaryKeyConstraintKeys, + pubkeySettingKeys, + rlsSettingKeys, + routeBindingKeys, + routeKeys, + schemaKeys, + schemaGrantKeys, + siteKeys, + siteMetadatumKeys, + siteModuleKeys, + siteThemeKeys, + spatialRelationKeys, + sqlActionKeys, + tableKeys, + tableGrantKeys, + triggerKeys, + triggerFunctionKeys, + uniqueConstraintKeys, + viewKeys, + viewGrantKeys, + viewRuleKeys, + viewTableKeys, + webauthnSettingKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,721 +101,1066 @@ import { apiKeys, apiModuleKeys, apiSchemaKeys, apiSettingKeys, astMigrationKeys * ``` */ export const invalidate = { - /** Invalidate api queries */api: { - /** Invalidate all api queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiKeys.all - }), - /** Invalidate api list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiKeys.lists() - }), - /** Invalidate a specific api */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: apiKeys.detail(id) - }) - }, - /** Invalidate apiModule queries */apiModule: { - /** Invalidate all apiModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiModuleKeys.all - }), - /** Invalidate apiModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiModuleKeys.lists() - }), - /** Invalidate a specific apiModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: apiModuleKeys.detail(id) - }) - }, - /** Invalidate apiSchema queries */apiSchema: { - /** Invalidate all apiSchema queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiSchemaKeys.all - }), - /** Invalidate apiSchema list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiSchemaKeys.lists() - }), - /** Invalidate a specific apiSchema */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: apiSchemaKeys.detail(id) - }) - }, - /** Invalidate apiSetting queries */apiSetting: { - /** Invalidate all apiSetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiSettingKeys.all - }), - /** Invalidate apiSetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiSettingKeys.lists() - }), - /** Invalidate a specific apiSetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: apiSettingKeys.detail(id) - }) - }, - /** Invalidate astMigration queries */astMigration: { - /** Invalidate all astMigration queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: astMigrationKeys.all - }), - /** Invalidate astMigration list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: astMigrationKeys.lists() - }), - /** Invalidate a specific astMigration */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: astMigrationKeys.detail(id) - }) - }, - /** Invalidate checkConstraint queries */checkConstraint: { - /** Invalidate all checkConstraint queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: checkConstraintKeys.all - }), - /** Invalidate checkConstraint list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: checkConstraintKeys.lists() - }), - /** Invalidate a specific checkConstraint */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: checkConstraintKeys.detail(id) - }) - }, - /** Invalidate compositeType queries */compositeType: { - /** Invalidate all compositeType queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: compositeTypeKeys.all - }), - /** Invalidate compositeType list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: compositeTypeKeys.lists() - }), - /** Invalidate a specific compositeType */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: compositeTypeKeys.detail(id) - }) - }, - /** Invalidate corsSetting queries */corsSetting: { - /** Invalidate all corsSetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: corsSettingKeys.all - }), - /** Invalidate corsSetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: corsSettingKeys.lists() - }), - /** Invalidate a specific corsSetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: corsSettingKeys.detail(id) - }) - }, - /** Invalidate database queries */database: { - /** Invalidate all database queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseKeys.all - }), - /** Invalidate database list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseKeys.lists() - }), - /** Invalidate a specific database */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: databaseKeys.detail(id) - }) - }, - /** Invalidate databaseSetting queries */databaseSetting: { - /** Invalidate all databaseSetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseSettingKeys.all - }), - /** Invalidate databaseSetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseSettingKeys.lists() - }), - /** Invalidate a specific databaseSetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: databaseSettingKeys.detail(id) - }) - }, - /** Invalidate databaseTransfer queries */databaseTransfer: { - /** Invalidate all databaseTransfer queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseTransferKeys.all - }), - /** Invalidate databaseTransfer list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseTransferKeys.lists() - }), - /** Invalidate a specific databaseTransfer */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: databaseTransferKeys.detail(id) - }) - }, - /** Invalidate defaultPrivilege queries */defaultPrivilege: { - /** Invalidate all defaultPrivilege queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: defaultPrivilegeKeys.all - }), - /** Invalidate defaultPrivilege list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: defaultPrivilegeKeys.lists() - }), - /** Invalidate a specific defaultPrivilege */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: defaultPrivilegeKeys.detail(id) - }) - }, - /** Invalidate domain queries */domain: { - /** Invalidate all domain queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: domainKeys.all - }), - /** Invalidate domain list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: domainKeys.lists() - }), - /** Invalidate a specific domain */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: domainKeys.detail(id) - }) - }, - /** Invalidate domainEvent queries */domainEvent: { - /** Invalidate all domainEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: domainEventKeys.all - }), - /** Invalidate domainEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: domainEventKeys.lists() - }), - /** Invalidate a specific domainEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: domainEventKeys.detail(id) - }) - }, - /** Invalidate domainVerification queries */domainVerification: { - /** Invalidate all domainVerification queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: domainVerificationKeys.all - }), - /** Invalidate domainVerification list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: domainVerificationKeys.lists() - }), - /** Invalidate a specific domainVerification */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: domainVerificationKeys.detail(id) - }) - }, - /** Invalidate embeddingChunk queries */embeddingChunk: { - /** Invalidate all embeddingChunk queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: embeddingChunkKeys.all - }), - /** Invalidate embeddingChunk list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: embeddingChunkKeys.lists() - }), - /** Invalidate a specific embeddingChunk */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: embeddingChunkKeys.detail(id) - }) - }, - /** Invalidate enum queries */enum: { - /** Invalidate all enum queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: enumKeys.all - }), - /** Invalidate enum list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: enumKeys.lists() - }), - /** Invalidate a specific enum */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: enumKeys.detail(id) - }) - }, - /** Invalidate exclusionConstraint queries */exclusionConstraint: { - /** Invalidate all exclusionConstraint queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: exclusionConstraintKeys.all - }), - /** Invalidate exclusionConstraint list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: exclusionConstraintKeys.lists() - }), - /** Invalidate a specific exclusionConstraint */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: exclusionConstraintKeys.detail(id) - }) - }, - /** Invalidate field queries */field: { - /** Invalidate all field queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: fieldKeys.all - }), - /** Invalidate field list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: fieldKeys.lists() - }), - /** Invalidate a specific field */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: fieldKeys.detail(id) - }) - }, - /** Invalidate foreignKeyConstraint queries */foreignKeyConstraint: { - /** Invalidate all foreignKeyConstraint queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: foreignKeyConstraintKeys.all - }), - /** Invalidate foreignKeyConstraint list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: foreignKeyConstraintKeys.lists() - }), - /** Invalidate a specific foreignKeyConstraint */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: foreignKeyConstraintKeys.detail(id) - }) - }, - /** Invalidate fullTextSearch queries */fullTextSearch: { - /** Invalidate all fullTextSearch queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: fullTextSearchKeys.all - }), - /** Invalidate fullTextSearch list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: fullTextSearchKeys.lists() - }), - /** Invalidate a specific fullTextSearch */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: fullTextSearchKeys.detail(id) - }) - }, - /** Invalidate function queries */function: { - /** Invalidate all function queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionKeys.all - }), - /** Invalidate function list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionKeys.lists() - }), - /** Invalidate a specific function */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionKeys.detail(id) - }) - }, - /** Invalidate hostnameBinding queries */hostnameBinding: { - /** Invalidate all hostnameBinding queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: hostnameBindingKeys.all - }), - /** Invalidate hostnameBinding list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: hostnameBindingKeys.lists() - }), - /** Invalidate a specific hostnameBinding */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: hostnameBindingKeys.detail(id) - }) - }, - /** Invalidate httpRoute queries */httpRoute: { - /** Invalidate all httpRoute queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: httpRouteKeys.all - }), - /** Invalidate httpRoute list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: httpRouteKeys.lists() - }), - /** Invalidate a specific httpRoute */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: httpRouteKeys.detail(id) - }) - }, - /** Invalidate index queries */index: { - /** Invalidate all index queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: indexKeys.all - }), - /** Invalidate index list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: indexKeys.lists() - }), - /** Invalidate a specific index */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: indexKeys.detail(id) - }) - }, - /** Invalidate managedDomain queries */managedDomain: { - /** Invalidate all managedDomain queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: managedDomainKeys.all - }), - /** Invalidate managedDomain list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: managedDomainKeys.lists() - }), - /** Invalidate a specific managedDomain */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: managedDomainKeys.detail(id) - }) - }, - /** Invalidate nodeTypeRegistry queries */nodeTypeRegistry: { - /** Invalidate all nodeTypeRegistry queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: nodeTypeRegistryKeys.all - }), - /** Invalidate nodeTypeRegistry list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: nodeTypeRegistryKeys.lists() - }), - /** Invalidate a specific nodeTypeRegistry */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: nodeTypeRegistryKeys.detail(id) - }) - }, - /** Invalidate partition queries */partition: { - /** Invalidate all partition queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: partitionKeys.all - }), - /** Invalidate partition list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: partitionKeys.lists() - }), - /** Invalidate a specific partition */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: partitionKeys.detail(id) - }) - }, - /** Invalidate platformApi queries */platformApi: { - /** Invalidate all platformApi queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformApiKeys.all - }), - /** Invalidate platformApi list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformApiKeys.lists() - }), - /** Invalidate a specific platformApi */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformApiKeys.detail(id) - }) - }, - /** Invalidate platformApiModule queries */platformApiModule: { - /** Invalidate all platformApiModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformApiModuleKeys.all - }), - /** Invalidate platformApiModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformApiModuleKeys.lists() - }), - /** Invalidate a specific platformApiModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformApiModuleKeys.detail(id) - }) - }, - /** Invalidate platformApiSchema queries */platformApiSchema: { - /** Invalidate all platformApiSchema queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformApiSchemaKeys.all - }), - /** Invalidate platformApiSchema list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformApiSchemaKeys.lists() - }), - /** Invalidate a specific platformApiSchema */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformApiSchemaKeys.detail(id) - }) - }, - /** Invalidate platformApiSetting queries */platformApiSetting: { - /** Invalidate all platformApiSetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformApiSettingKeys.all - }), - /** Invalidate platformApiSetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformApiSettingKeys.lists() - }), - /** Invalidate a specific platformApiSetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformApiSettingKeys.detail(id) - }) - }, - /** Invalidate platformCorsSetting queries */platformCorsSetting: { - /** Invalidate all platformCorsSetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformCorsSettingKeys.all - }), - /** Invalidate platformCorsSetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformCorsSettingKeys.lists() - }), - /** Invalidate a specific platformCorsSetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformCorsSettingKeys.detail(id) - }) - }, - /** Invalidate platformDomain queries */platformDomain: { - /** Invalidate all platformDomain queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformDomainKeys.all - }), - /** Invalidate platformDomain list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformDomainKeys.lists() - }), - /** Invalidate a specific platformDomain */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformDomainKeys.detail(id) - }) - }, - /** Invalidate platformDomainEvent queries */platformDomainEvent: { - /** Invalidate all platformDomainEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformDomainEventKeys.all - }), - /** Invalidate platformDomainEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformDomainEventKeys.lists() - }), - /** Invalidate a specific platformDomainEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformDomainEventKeys.detail(id) - }) - }, - /** Invalidate platformDomainVerification queries */platformDomainVerification: { - /** Invalidate all platformDomainVerification queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformDomainVerificationKeys.all - }), - /** Invalidate platformDomainVerification list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformDomainVerificationKeys.lists() - }), - /** Invalidate a specific platformDomainVerification */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformDomainVerificationKeys.detail(id) - }) - }, - /** Invalidate platformManagedDomain queries */platformManagedDomain: { - /** Invalidate all platformManagedDomain queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformManagedDomainKeys.all - }), - /** Invalidate platformManagedDomain list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformManagedDomainKeys.lists() - }), - /** Invalidate a specific platformManagedDomain */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformManagedDomainKeys.detail(id) - }) - }, - /** Invalidate platformSite queries */platformSite: { - /** Invalidate all platformSite queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSiteKeys.all - }), - /** Invalidate platformSite list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSiteKeys.lists() - }), - /** Invalidate a specific platformSite */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformSiteKeys.detail(id) - }) - }, - /** Invalidate platformSiteMetadatum queries */platformSiteMetadatum: { - /** Invalidate all platformSiteMetadatum queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSiteMetadatumKeys.all - }), - /** Invalidate platformSiteMetadatum list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSiteMetadatumKeys.lists() - }), - /** Invalidate a specific platformSiteMetadatum */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformSiteMetadatumKeys.detail(id) - }) - }, - /** Invalidate platformSiteModule queries */platformSiteModule: { - /** Invalidate all platformSiteModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSiteModuleKeys.all - }), - /** Invalidate platformSiteModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSiteModuleKeys.lists() - }), - /** Invalidate a specific platformSiteModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformSiteModuleKeys.detail(id) - }) - }, - /** Invalidate platformSiteTheme queries */platformSiteTheme: { - /** Invalidate all platformSiteTheme queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSiteThemeKeys.all - }), - /** Invalidate platformSiteTheme list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSiteThemeKeys.lists() - }), - /** Invalidate a specific platformSiteTheme */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformSiteThemeKeys.detail(id) - }) - }, - /** Invalidate policy queries */policy: { - /** Invalidate all policy queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: policyKeys.all - }), - /** Invalidate policy list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: policyKeys.lists() - }), - /** Invalidate a specific policy */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: policyKeys.detail(id) - }) - }, - /** Invalidate primaryKeyConstraint queries */primaryKeyConstraint: { - /** Invalidate all primaryKeyConstraint queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: primaryKeyConstraintKeys.all - }), - /** Invalidate primaryKeyConstraint list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: primaryKeyConstraintKeys.lists() - }), - /** Invalidate a specific primaryKeyConstraint */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: primaryKeyConstraintKeys.detail(id) - }) - }, - /** Invalidate pubkeySetting queries */pubkeySetting: { - /** Invalidate all pubkeySetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: pubkeySettingKeys.all - }), - /** Invalidate pubkeySetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: pubkeySettingKeys.lists() - }), - /** Invalidate a specific pubkeySetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: pubkeySettingKeys.detail(id) - }) - }, - /** Invalidate rlsSetting queries */rlsSetting: { - /** Invalidate all rlsSetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: rlsSettingKeys.all - }), - /** Invalidate rlsSetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: rlsSettingKeys.lists() - }), - /** Invalidate a specific rlsSetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: rlsSettingKeys.detail(id) - }) - }, - /** Invalidate routeBinding queries */routeBinding: { - /** Invalidate all routeBinding queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: routeBindingKeys.all - }), - /** Invalidate routeBinding list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: routeBindingKeys.lists() - }), - /** Invalidate a specific routeBinding */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: routeBindingKeys.detail(id) - }) - }, - /** Invalidate route queries */route: { - /** Invalidate all route queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: routeKeys.all - }), - /** Invalidate route list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: routeKeys.lists() - }), - /** Invalidate a specific route */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: routeKeys.detail(id) - }) - }, - /** Invalidate schema queries */schema: { - /** Invalidate all schema queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: schemaKeys.all - }), - /** Invalidate schema list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: schemaKeys.lists() - }), - /** Invalidate a specific schema */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: schemaKeys.detail(id) - }) - }, - /** Invalidate schemaGrant queries */schemaGrant: { - /** Invalidate all schemaGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: schemaGrantKeys.all - }), - /** Invalidate schemaGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: schemaGrantKeys.lists() - }), - /** Invalidate a specific schemaGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: schemaGrantKeys.detail(id) - }) - }, - /** Invalidate site queries */site: { - /** Invalidate all site queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteKeys.all - }), - /** Invalidate site list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteKeys.lists() - }), - /** Invalidate a specific site */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: siteKeys.detail(id) - }) - }, - /** Invalidate siteMetadatum queries */siteMetadatum: { - /** Invalidate all siteMetadatum queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteMetadatumKeys.all - }), - /** Invalidate siteMetadatum list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteMetadatumKeys.lists() - }), - /** Invalidate a specific siteMetadatum */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: siteMetadatumKeys.detail(id) - }) - }, - /** Invalidate siteModule queries */siteModule: { - /** Invalidate all siteModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteModuleKeys.all - }), - /** Invalidate siteModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteModuleKeys.lists() - }), - /** Invalidate a specific siteModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: siteModuleKeys.detail(id) - }) - }, - /** Invalidate siteTheme queries */siteTheme: { - /** Invalidate all siteTheme queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteThemeKeys.all - }), - /** Invalidate siteTheme list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteThemeKeys.lists() - }), - /** Invalidate a specific siteTheme */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: siteThemeKeys.detail(id) - }) - }, - /** Invalidate spatialRelation queries */spatialRelation: { - /** Invalidate all spatialRelation queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: spatialRelationKeys.all - }), - /** Invalidate spatialRelation list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: spatialRelationKeys.lists() - }), - /** Invalidate a specific spatialRelation */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: spatialRelationKeys.detail(id) - }) - }, - /** Invalidate sqlAction queries */sqlAction: { - /** Invalidate all sqlAction queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: sqlActionKeys.all - }), - /** Invalidate sqlAction list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: sqlActionKeys.lists() - }), - /** Invalidate a specific sqlAction */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: sqlActionKeys.detail(id) - }) - }, - /** Invalidate table queries */table: { - /** Invalidate all table queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: tableKeys.all - }), - /** Invalidate table list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: tableKeys.lists() - }), - /** Invalidate a specific table */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: tableKeys.detail(id) - }) - }, - /** Invalidate tableGrant queries */tableGrant: { - /** Invalidate all tableGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: tableGrantKeys.all - }), - /** Invalidate tableGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: tableGrantKeys.lists() - }), - /** Invalidate a specific tableGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: tableGrantKeys.detail(id) - }) - }, - /** Invalidate trigger queries */trigger: { - /** Invalidate all trigger queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: triggerKeys.all - }), - /** Invalidate trigger list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: triggerKeys.lists() - }), - /** Invalidate a specific trigger */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: triggerKeys.detail(id) - }) - }, - /** Invalidate triggerFunction queries */triggerFunction: { - /** Invalidate all triggerFunction queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: triggerFunctionKeys.all - }), - /** Invalidate triggerFunction list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: triggerFunctionKeys.lists() - }), - /** Invalidate a specific triggerFunction */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: triggerFunctionKeys.detail(id) - }) - }, - /** Invalidate uniqueConstraint queries */uniqueConstraint: { - /** Invalidate all uniqueConstraint queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: uniqueConstraintKeys.all - }), - /** Invalidate uniqueConstraint list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: uniqueConstraintKeys.lists() - }), - /** Invalidate a specific uniqueConstraint */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: uniqueConstraintKeys.detail(id) - }) - }, - /** Invalidate view queries */view: { - /** Invalidate all view queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: viewKeys.all - }), - /** Invalidate view list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: viewKeys.lists() - }), - /** Invalidate a specific view */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: viewKeys.detail(id) - }) - }, - /** Invalidate viewGrant queries */viewGrant: { - /** Invalidate all viewGrant queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: viewGrantKeys.all - }), - /** Invalidate viewGrant list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: viewGrantKeys.lists() - }), - /** Invalidate a specific viewGrant */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: viewGrantKeys.detail(id) - }) - }, - /** Invalidate viewRule queries */viewRule: { - /** Invalidate all viewRule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: viewRuleKeys.all - }), - /** Invalidate viewRule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: viewRuleKeys.lists() - }), - /** Invalidate a specific viewRule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: viewRuleKeys.detail(id) - }) - }, - /** Invalidate viewTable queries */viewTable: { - /** Invalidate all viewTable queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: viewTableKeys.all - }), - /** Invalidate viewTable list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: viewTableKeys.lists() - }), - /** Invalidate a specific viewTable */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: viewTableKeys.detail(id) - }) - }, - /** Invalidate webauthnSetting queries */webauthnSetting: { - /** Invalidate all webauthnSetting queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webauthnSettingKeys.all - }), - /** Invalidate webauthnSetting list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webauthnSettingKeys.lists() - }), - /** Invalidate a specific webauthnSetting */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: webauthnSettingKeys.detail(id) - }) - } + /** Invalidate api queries */ api: { + /** Invalidate all api queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiKeys.all, + }), + /** Invalidate api list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiKeys.lists(), + }), + /** Invalidate a specific api */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: apiKeys.detail(id), + }), + }, + /** Invalidate apiModule queries */ apiModule: { + /** Invalidate all apiModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiModuleKeys.all, + }), + /** Invalidate apiModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiModuleKeys.lists(), + }), + /** Invalidate a specific apiModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: apiModuleKeys.detail(id), + }), + }, + /** Invalidate apiSchema queries */ apiSchema: { + /** Invalidate all apiSchema queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiSchemaKeys.all, + }), + /** Invalidate apiSchema list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiSchemaKeys.lists(), + }), + /** Invalidate a specific apiSchema */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: apiSchemaKeys.detail(id), + }), + }, + /** Invalidate apiSetting queries */ apiSetting: { + /** Invalidate all apiSetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiSettingKeys.all, + }), + /** Invalidate apiSetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiSettingKeys.lists(), + }), + /** Invalidate a specific apiSetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: apiSettingKeys.detail(id), + }), + }, + /** Invalidate astMigration queries */ astMigration: { + /** Invalidate all astMigration queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: astMigrationKeys.all, + }), + /** Invalidate astMigration list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: astMigrationKeys.lists(), + }), + /** Invalidate a specific astMigration */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: astMigrationKeys.detail(id), + }), + }, + /** Invalidate checkConstraint queries */ checkConstraint: { + /** Invalidate all checkConstraint queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: checkConstraintKeys.all, + }), + /** Invalidate checkConstraint list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: checkConstraintKeys.lists(), + }), + /** Invalidate a specific checkConstraint */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: checkConstraintKeys.detail(id), + }), + }, + /** Invalidate compositeType queries */ compositeType: { + /** Invalidate all compositeType queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: compositeTypeKeys.all, + }), + /** Invalidate compositeType list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: compositeTypeKeys.lists(), + }), + /** Invalidate a specific compositeType */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: compositeTypeKeys.detail(id), + }), + }, + /** Invalidate corsSetting queries */ corsSetting: { + /** Invalidate all corsSetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: corsSettingKeys.all, + }), + /** Invalidate corsSetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: corsSettingKeys.lists(), + }), + /** Invalidate a specific corsSetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: corsSettingKeys.detail(id), + }), + }, + /** Invalidate database queries */ database: { + /** Invalidate all database queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseKeys.all, + }), + /** Invalidate database list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseKeys.lists(), + }), + /** Invalidate a specific database */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: databaseKeys.detail(id), + }), + }, + /** Invalidate databaseSetting queries */ databaseSetting: { + /** Invalidate all databaseSetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseSettingKeys.all, + }), + /** Invalidate databaseSetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseSettingKeys.lists(), + }), + /** Invalidate a specific databaseSetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: databaseSettingKeys.detail(id), + }), + }, + /** Invalidate databaseTransfer queries */ databaseTransfer: { + /** Invalidate all databaseTransfer queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseTransferKeys.all, + }), + /** Invalidate databaseTransfer list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseTransferKeys.lists(), + }), + /** Invalidate a specific databaseTransfer */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: databaseTransferKeys.detail(id), + }), + }, + /** Invalidate defaultPrivilege queries */ defaultPrivilege: { + /** Invalidate all defaultPrivilege queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: defaultPrivilegeKeys.all, + }), + /** Invalidate defaultPrivilege list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: defaultPrivilegeKeys.lists(), + }), + /** Invalidate a specific defaultPrivilege */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: defaultPrivilegeKeys.detail(id), + }), + }, + /** Invalidate domain queries */ domain: { + /** Invalidate all domain queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: domainKeys.all, + }), + /** Invalidate domain list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: domainKeys.lists(), + }), + /** Invalidate a specific domain */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: domainKeys.detail(id), + }), + }, + /** Invalidate domainEvent queries */ domainEvent: { + /** Invalidate all domainEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: domainEventKeys.all, + }), + /** Invalidate domainEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: domainEventKeys.lists(), + }), + /** Invalidate a specific domainEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: domainEventKeys.detail(id), + }), + }, + /** Invalidate domainVerification queries */ domainVerification: { + /** Invalidate all domainVerification queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: domainVerificationKeys.all, + }), + /** Invalidate domainVerification list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: domainVerificationKeys.lists(), + }), + /** Invalidate a specific domainVerification */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: domainVerificationKeys.detail(id), + }), + }, + /** Invalidate embeddingChunk queries */ embeddingChunk: { + /** Invalidate all embeddingChunk queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: embeddingChunkKeys.all, + }), + /** Invalidate embeddingChunk list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: embeddingChunkKeys.lists(), + }), + /** Invalidate a specific embeddingChunk */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: embeddingChunkKeys.detail(id), + }), + }, + /** Invalidate enum queries */ enum: { + /** Invalidate all enum queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: enumKeys.all, + }), + /** Invalidate enum list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: enumKeys.lists(), + }), + /** Invalidate a specific enum */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: enumKeys.detail(id), + }), + }, + /** Invalidate exclusionConstraint queries */ exclusionConstraint: { + /** Invalidate all exclusionConstraint queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: exclusionConstraintKeys.all, + }), + /** Invalidate exclusionConstraint list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: exclusionConstraintKeys.lists(), + }), + /** Invalidate a specific exclusionConstraint */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: exclusionConstraintKeys.detail(id), + }), + }, + /** Invalidate field queries */ field: { + /** Invalidate all field queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: fieldKeys.all, + }), + /** Invalidate field list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: fieldKeys.lists(), + }), + /** Invalidate a specific field */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: fieldKeys.detail(id), + }), + }, + /** Invalidate foreignKeyConstraint queries */ foreignKeyConstraint: { + /** Invalidate all foreignKeyConstraint queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: foreignKeyConstraintKeys.all, + }), + /** Invalidate foreignKeyConstraint list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: foreignKeyConstraintKeys.lists(), + }), + /** Invalidate a specific foreignKeyConstraint */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: foreignKeyConstraintKeys.detail(id), + }), + }, + /** Invalidate fullTextSearch queries */ fullTextSearch: { + /** Invalidate all fullTextSearch queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: fullTextSearchKeys.all, + }), + /** Invalidate fullTextSearch list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: fullTextSearchKeys.lists(), + }), + /** Invalidate a specific fullTextSearch */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: fullTextSearchKeys.detail(id), + }), + }, + /** Invalidate function queries */ function: { + /** Invalidate all function queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionKeys.all, + }), + /** Invalidate function list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionKeys.lists(), + }), + /** Invalidate a specific function */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: functionKeys.detail(id), + }), + }, + /** Invalidate hostnameBinding queries */ hostnameBinding: { + /** Invalidate all hostnameBinding queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: hostnameBindingKeys.all, + }), + /** Invalidate hostnameBinding list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: hostnameBindingKeys.lists(), + }), + /** Invalidate a specific hostnameBinding */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: hostnameBindingKeys.detail(id), + }), + }, + /** Invalidate httpRoute queries */ httpRoute: { + /** Invalidate all httpRoute queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: httpRouteKeys.all, + }), + /** Invalidate httpRoute list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: httpRouteKeys.lists(), + }), + /** Invalidate a specific httpRoute */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: httpRouteKeys.detail(id), + }), + }, + /** Invalidate index queries */ index: { + /** Invalidate all index queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: indexKeys.all, + }), + /** Invalidate index list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: indexKeys.lists(), + }), + /** Invalidate a specific index */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: indexKeys.detail(id), + }), + }, + /** Invalidate managedDomain queries */ managedDomain: { + /** Invalidate all managedDomain queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: managedDomainKeys.all, + }), + /** Invalidate managedDomain list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: managedDomainKeys.lists(), + }), + /** Invalidate a specific managedDomain */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: managedDomainKeys.detail(id), + }), + }, + /** Invalidate nodeTypeRegistry queries */ nodeTypeRegistry: { + /** Invalidate all nodeTypeRegistry queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: nodeTypeRegistryKeys.all, + }), + /** Invalidate nodeTypeRegistry list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: nodeTypeRegistryKeys.lists(), + }), + /** Invalidate a specific nodeTypeRegistry */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: nodeTypeRegistryKeys.detail(id), + }), + }, + /** Invalidate partition queries */ partition: { + /** Invalidate all partition queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: partitionKeys.all, + }), + /** Invalidate partition list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: partitionKeys.lists(), + }), + /** Invalidate a specific partition */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: partitionKeys.detail(id), + }), + }, + /** Invalidate platformApi queries */ platformApi: { + /** Invalidate all platformApi queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformApiKeys.all, + }), + /** Invalidate platformApi list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformApiKeys.lists(), + }), + /** Invalidate a specific platformApi */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformApiKeys.detail(id), + }), + }, + /** Invalidate platformApiModule queries */ platformApiModule: { + /** Invalidate all platformApiModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformApiModuleKeys.all, + }), + /** Invalidate platformApiModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformApiModuleKeys.lists(), + }), + /** Invalidate a specific platformApiModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformApiModuleKeys.detail(id), + }), + }, + /** Invalidate platformApiSchema queries */ platformApiSchema: { + /** Invalidate all platformApiSchema queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformApiSchemaKeys.all, + }), + /** Invalidate platformApiSchema list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformApiSchemaKeys.lists(), + }), + /** Invalidate a specific platformApiSchema */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformApiSchemaKeys.detail(id), + }), + }, + /** Invalidate platformApiSetting queries */ platformApiSetting: { + /** Invalidate all platformApiSetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformApiSettingKeys.all, + }), + /** Invalidate platformApiSetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformApiSettingKeys.lists(), + }), + /** Invalidate a specific platformApiSetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformApiSettingKeys.detail(id), + }), + }, + /** Invalidate platformCorsSetting queries */ platformCorsSetting: { + /** Invalidate all platformCorsSetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformCorsSettingKeys.all, + }), + /** Invalidate platformCorsSetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformCorsSettingKeys.lists(), + }), + /** Invalidate a specific platformCorsSetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformCorsSettingKeys.detail(id), + }), + }, + /** Invalidate platformDomain queries */ platformDomain: { + /** Invalidate all platformDomain queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformDomainKeys.all, + }), + /** Invalidate platformDomain list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformDomainKeys.lists(), + }), + /** Invalidate a specific platformDomain */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformDomainKeys.detail(id), + }), + }, + /** Invalidate platformDomainEvent queries */ platformDomainEvent: { + /** Invalidate all platformDomainEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformDomainEventKeys.all, + }), + /** Invalidate platformDomainEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformDomainEventKeys.lists(), + }), + /** Invalidate a specific platformDomainEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformDomainEventKeys.detail(id), + }), + }, + /** Invalidate platformDomainVerification queries */ platformDomainVerification: { + /** Invalidate all platformDomainVerification queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformDomainVerificationKeys.all, + }), + /** Invalidate platformDomainVerification list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformDomainVerificationKeys.lists(), + }), + /** Invalidate a specific platformDomainVerification */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformDomainVerificationKeys.detail(id), + }), + }, + /** Invalidate platformManagedDomain queries */ platformManagedDomain: { + /** Invalidate all platformManagedDomain queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformManagedDomainKeys.all, + }), + /** Invalidate platformManagedDomain list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformManagedDomainKeys.lists(), + }), + /** Invalidate a specific platformManagedDomain */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformManagedDomainKeys.detail(id), + }), + }, + /** Invalidate platformSite queries */ platformSite: { + /** Invalidate all platformSite queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSiteKeys.all, + }), + /** Invalidate platformSite list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSiteKeys.lists(), + }), + /** Invalidate a specific platformSite */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformSiteKeys.detail(id), + }), + }, + /** Invalidate platformSiteMetadatum queries */ platformSiteMetadatum: { + /** Invalidate all platformSiteMetadatum queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSiteMetadatumKeys.all, + }), + /** Invalidate platformSiteMetadatum list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSiteMetadatumKeys.lists(), + }), + /** Invalidate a specific platformSiteMetadatum */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformSiteMetadatumKeys.detail(id), + }), + }, + /** Invalidate platformSiteModule queries */ platformSiteModule: { + /** Invalidate all platformSiteModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSiteModuleKeys.all, + }), + /** Invalidate platformSiteModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSiteModuleKeys.lists(), + }), + /** Invalidate a specific platformSiteModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformSiteModuleKeys.detail(id), + }), + }, + /** Invalidate platformSiteTheme queries */ platformSiteTheme: { + /** Invalidate all platformSiteTheme queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSiteThemeKeys.all, + }), + /** Invalidate platformSiteTheme list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSiteThemeKeys.lists(), + }), + /** Invalidate a specific platformSiteTheme */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformSiteThemeKeys.detail(id), + }), + }, + /** Invalidate policy queries */ policy: { + /** Invalidate all policy queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: policyKeys.all, + }), + /** Invalidate policy list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: policyKeys.lists(), + }), + /** Invalidate a specific policy */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: policyKeys.detail(id), + }), + }, + /** Invalidate primaryKeyConstraint queries */ primaryKeyConstraint: { + /** Invalidate all primaryKeyConstraint queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: primaryKeyConstraintKeys.all, + }), + /** Invalidate primaryKeyConstraint list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: primaryKeyConstraintKeys.lists(), + }), + /** Invalidate a specific primaryKeyConstraint */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: primaryKeyConstraintKeys.detail(id), + }), + }, + /** Invalidate pubkeySetting queries */ pubkeySetting: { + /** Invalidate all pubkeySetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: pubkeySettingKeys.all, + }), + /** Invalidate pubkeySetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: pubkeySettingKeys.lists(), + }), + /** Invalidate a specific pubkeySetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: pubkeySettingKeys.detail(id), + }), + }, + /** Invalidate rlsSetting queries */ rlsSetting: { + /** Invalidate all rlsSetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: rlsSettingKeys.all, + }), + /** Invalidate rlsSetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: rlsSettingKeys.lists(), + }), + /** Invalidate a specific rlsSetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: rlsSettingKeys.detail(id), + }), + }, + /** Invalidate routeBinding queries */ routeBinding: { + /** Invalidate all routeBinding queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: routeBindingKeys.all, + }), + /** Invalidate routeBinding list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: routeBindingKeys.lists(), + }), + /** Invalidate a specific routeBinding */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: routeBindingKeys.detail(id), + }), + }, + /** Invalidate route queries */ route: { + /** Invalidate all route queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: routeKeys.all, + }), + /** Invalidate route list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: routeKeys.lists(), + }), + /** Invalidate a specific route */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: routeKeys.detail(id), + }), + }, + /** Invalidate schema queries */ schema: { + /** Invalidate all schema queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: schemaKeys.all, + }), + /** Invalidate schema list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: schemaKeys.lists(), + }), + /** Invalidate a specific schema */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: schemaKeys.detail(id), + }), + }, + /** Invalidate schemaGrant queries */ schemaGrant: { + /** Invalidate all schemaGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: schemaGrantKeys.all, + }), + /** Invalidate schemaGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: schemaGrantKeys.lists(), + }), + /** Invalidate a specific schemaGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: schemaGrantKeys.detail(id), + }), + }, + /** Invalidate site queries */ site: { + /** Invalidate all site queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteKeys.all, + }), + /** Invalidate site list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteKeys.lists(), + }), + /** Invalidate a specific site */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: siteKeys.detail(id), + }), + }, + /** Invalidate siteMetadatum queries */ siteMetadatum: { + /** Invalidate all siteMetadatum queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteMetadatumKeys.all, + }), + /** Invalidate siteMetadatum list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteMetadatumKeys.lists(), + }), + /** Invalidate a specific siteMetadatum */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: siteMetadatumKeys.detail(id), + }), + }, + /** Invalidate siteModule queries */ siteModule: { + /** Invalidate all siteModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteModuleKeys.all, + }), + /** Invalidate siteModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteModuleKeys.lists(), + }), + /** Invalidate a specific siteModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: siteModuleKeys.detail(id), + }), + }, + /** Invalidate siteTheme queries */ siteTheme: { + /** Invalidate all siteTheme queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteThemeKeys.all, + }), + /** Invalidate siteTheme list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteThemeKeys.lists(), + }), + /** Invalidate a specific siteTheme */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: siteThemeKeys.detail(id), + }), + }, + /** Invalidate spatialRelation queries */ spatialRelation: { + /** Invalidate all spatialRelation queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: spatialRelationKeys.all, + }), + /** Invalidate spatialRelation list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: spatialRelationKeys.lists(), + }), + /** Invalidate a specific spatialRelation */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: spatialRelationKeys.detail(id), + }), + }, + /** Invalidate sqlAction queries */ sqlAction: { + /** Invalidate all sqlAction queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: sqlActionKeys.all, + }), + /** Invalidate sqlAction list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: sqlActionKeys.lists(), + }), + /** Invalidate a specific sqlAction */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: sqlActionKeys.detail(id), + }), + }, + /** Invalidate table queries */ table: { + /** Invalidate all table queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: tableKeys.all, + }), + /** Invalidate table list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: tableKeys.lists(), + }), + /** Invalidate a specific table */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: tableKeys.detail(id), + }), + }, + /** Invalidate tableGrant queries */ tableGrant: { + /** Invalidate all tableGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: tableGrantKeys.all, + }), + /** Invalidate tableGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: tableGrantKeys.lists(), + }), + /** Invalidate a specific tableGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: tableGrantKeys.detail(id), + }), + }, + /** Invalidate trigger queries */ trigger: { + /** Invalidate all trigger queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: triggerKeys.all, + }), + /** Invalidate trigger list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: triggerKeys.lists(), + }), + /** Invalidate a specific trigger */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: triggerKeys.detail(id), + }), + }, + /** Invalidate triggerFunction queries */ triggerFunction: { + /** Invalidate all triggerFunction queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: triggerFunctionKeys.all, + }), + /** Invalidate triggerFunction list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: triggerFunctionKeys.lists(), + }), + /** Invalidate a specific triggerFunction */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: triggerFunctionKeys.detail(id), + }), + }, + /** Invalidate uniqueConstraint queries */ uniqueConstraint: { + /** Invalidate all uniqueConstraint queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: uniqueConstraintKeys.all, + }), + /** Invalidate uniqueConstraint list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: uniqueConstraintKeys.lists(), + }), + /** Invalidate a specific uniqueConstraint */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: uniqueConstraintKeys.detail(id), + }), + }, + /** Invalidate view queries */ view: { + /** Invalidate all view queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: viewKeys.all, + }), + /** Invalidate view list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: viewKeys.lists(), + }), + /** Invalidate a specific view */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: viewKeys.detail(id), + }), + }, + /** Invalidate viewGrant queries */ viewGrant: { + /** Invalidate all viewGrant queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: viewGrantKeys.all, + }), + /** Invalidate viewGrant list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: viewGrantKeys.lists(), + }), + /** Invalidate a specific viewGrant */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: viewGrantKeys.detail(id), + }), + }, + /** Invalidate viewRule queries */ viewRule: { + /** Invalidate all viewRule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: viewRuleKeys.all, + }), + /** Invalidate viewRule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: viewRuleKeys.lists(), + }), + /** Invalidate a specific viewRule */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: viewRuleKeys.detail(id), + }), + }, + /** Invalidate viewTable queries */ viewTable: { + /** Invalidate all viewTable queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: viewTableKeys.all, + }), + /** Invalidate viewTable list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: viewTableKeys.lists(), + }), + /** Invalidate a specific viewTable */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: viewTableKeys.detail(id), + }), + }, + /** Invalidate webauthnSetting queries */ webauthnSetting: { + /** Invalidate all webauthnSetting queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webauthnSettingKeys.all, + }), + /** Invalidate webauthnSetting list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webauthnSettingKeys.lists(), + }), + /** Invalidate a specific webauthnSetting */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: webauthnSettingKeys.detail(id), + }), + }, } as const; /** @@ -763,329 +1174,455 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove api from cache */api: (queryClient: QueryClient, id: string | number) => { + /** Remove api from cache */ api: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: apiKeys.detail(id) + queryKey: apiKeys.detail(id), }); }, - /** Remove apiModule from cache */apiModule: (queryClient: QueryClient, id: string | number) => { + /** Remove apiModule from cache */ apiModule: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: apiModuleKeys.detail(id) + queryKey: apiModuleKeys.detail(id), }); }, - /** Remove apiSchema from cache */apiSchema: (queryClient: QueryClient, id: string | number) => { + /** Remove apiSchema from cache */ apiSchema: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: apiSchemaKeys.detail(id) + queryKey: apiSchemaKeys.detail(id), }); }, - /** Remove apiSetting from cache */apiSetting: (queryClient: QueryClient, id: string | number) => { + /** Remove apiSetting from cache */ apiSetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: apiSettingKeys.detail(id) + queryKey: apiSettingKeys.detail(id), }); }, - /** Remove astMigration from cache */astMigration: (queryClient: QueryClient, id: string | number) => { + /** Remove astMigration from cache */ astMigration: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: astMigrationKeys.detail(id) + queryKey: astMigrationKeys.detail(id), }); }, - /** Remove checkConstraint from cache */checkConstraint: (queryClient: QueryClient, id: string | number) => { + /** Remove checkConstraint from cache */ checkConstraint: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: checkConstraintKeys.detail(id) + queryKey: checkConstraintKeys.detail(id), }); }, - /** Remove compositeType from cache */compositeType: (queryClient: QueryClient, id: string | number) => { + /** Remove compositeType from cache */ compositeType: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: compositeTypeKeys.detail(id) + queryKey: compositeTypeKeys.detail(id), }); }, - /** Remove corsSetting from cache */corsSetting: (queryClient: QueryClient, id: string | number) => { + /** Remove corsSetting from cache */ corsSetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: corsSettingKeys.detail(id) + queryKey: corsSettingKeys.detail(id), }); }, - /** Remove database from cache */database: (queryClient: QueryClient, id: string | number) => { + /** Remove database from cache */ database: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: databaseKeys.detail(id) + queryKey: databaseKeys.detail(id), }); }, - /** Remove databaseSetting from cache */databaseSetting: (queryClient: QueryClient, id: string | number) => { + /** Remove databaseSetting from cache */ databaseSetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: databaseSettingKeys.detail(id) + queryKey: databaseSettingKeys.detail(id), }); }, - /** Remove databaseTransfer from cache */databaseTransfer: (queryClient: QueryClient, id: string | number) => { + /** Remove databaseTransfer from cache */ databaseTransfer: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: databaseTransferKeys.detail(id) + queryKey: databaseTransferKeys.detail(id), }); }, - /** Remove defaultPrivilege from cache */defaultPrivilege: (queryClient: QueryClient, id: string | number) => { + /** Remove defaultPrivilege from cache */ defaultPrivilege: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: defaultPrivilegeKeys.detail(id) + queryKey: defaultPrivilegeKeys.detail(id), }); }, - /** Remove domain from cache */domain: (queryClient: QueryClient, id: string | number) => { + /** Remove domain from cache */ domain: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: domainKeys.detail(id) + queryKey: domainKeys.detail(id), }); }, - /** Remove domainEvent from cache */domainEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove domainEvent from cache */ domainEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: domainEventKeys.detail(id) + queryKey: domainEventKeys.detail(id), }); }, - /** Remove domainVerification from cache */domainVerification: (queryClient: QueryClient, id: string | number) => { + /** Remove domainVerification from cache */ domainVerification: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: domainVerificationKeys.detail(id) + queryKey: domainVerificationKeys.detail(id), }); }, - /** Remove embeddingChunk from cache */embeddingChunk: (queryClient: QueryClient, id: string | number) => { + /** Remove embeddingChunk from cache */ embeddingChunk: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: embeddingChunkKeys.detail(id) + queryKey: embeddingChunkKeys.detail(id), }); }, - /** Remove enum from cache */enum: (queryClient: QueryClient, id: string | number) => { + /** Remove enum from cache */ enum: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: enumKeys.detail(id) + queryKey: enumKeys.detail(id), }); }, - /** Remove exclusionConstraint from cache */exclusionConstraint: (queryClient: QueryClient, id: string | number) => { + /** Remove exclusionConstraint from cache */ exclusionConstraint: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: exclusionConstraintKeys.detail(id) + queryKey: exclusionConstraintKeys.detail(id), }); }, - /** Remove field from cache */field: (queryClient: QueryClient, id: string | number) => { + /** Remove field from cache */ field: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: fieldKeys.detail(id) + queryKey: fieldKeys.detail(id), }); }, - /** Remove foreignKeyConstraint from cache */foreignKeyConstraint: (queryClient: QueryClient, id: string | number) => { + /** Remove foreignKeyConstraint from cache */ foreignKeyConstraint: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: foreignKeyConstraintKeys.detail(id) + queryKey: foreignKeyConstraintKeys.detail(id), }); }, - /** Remove fullTextSearch from cache */fullTextSearch: (queryClient: QueryClient, id: string | number) => { + /** Remove fullTextSearch from cache */ fullTextSearch: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: fullTextSearchKeys.detail(id) + queryKey: fullTextSearchKeys.detail(id), }); }, - /** Remove function from cache */function: (queryClient: QueryClient, id: string | number) => { + /** Remove function from cache */ function: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: functionKeys.detail(id) + queryKey: functionKeys.detail(id), }); }, - /** Remove hostnameBinding from cache */hostnameBinding: (queryClient: QueryClient, id: string | number) => { + /** Remove hostnameBinding from cache */ hostnameBinding: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: hostnameBindingKeys.detail(id) + queryKey: hostnameBindingKeys.detail(id), }); }, - /** Remove httpRoute from cache */httpRoute: (queryClient: QueryClient, id: string | number) => { + /** Remove httpRoute from cache */ httpRoute: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: httpRouteKeys.detail(id) + queryKey: httpRouteKeys.detail(id), }); }, - /** Remove index from cache */index: (queryClient: QueryClient, id: string | number) => { + /** Remove index from cache */ index: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: indexKeys.detail(id) + queryKey: indexKeys.detail(id), }); }, - /** Remove managedDomain from cache */managedDomain: (queryClient: QueryClient, id: string | number) => { + /** Remove managedDomain from cache */ managedDomain: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: managedDomainKeys.detail(id) + queryKey: managedDomainKeys.detail(id), }); }, - /** Remove nodeTypeRegistry from cache */nodeTypeRegistry: (queryClient: QueryClient, id: string | number) => { + /** Remove nodeTypeRegistry from cache */ nodeTypeRegistry: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: nodeTypeRegistryKeys.detail(id) + queryKey: nodeTypeRegistryKeys.detail(id), }); }, - /** Remove partition from cache */partition: (queryClient: QueryClient, id: string | number) => { + /** Remove partition from cache */ partition: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: partitionKeys.detail(id) + queryKey: partitionKeys.detail(id), }); }, - /** Remove platformApi from cache */platformApi: (queryClient: QueryClient, id: string | number) => { + /** Remove platformApi from cache */ platformApi: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformApiKeys.detail(id) + queryKey: platformApiKeys.detail(id), }); }, - /** Remove platformApiModule from cache */platformApiModule: (queryClient: QueryClient, id: string | number) => { + /** Remove platformApiModule from cache */ platformApiModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformApiModuleKeys.detail(id) + queryKey: platformApiModuleKeys.detail(id), }); }, - /** Remove platformApiSchema from cache */platformApiSchema: (queryClient: QueryClient, id: string | number) => { + /** Remove platformApiSchema from cache */ platformApiSchema: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformApiSchemaKeys.detail(id) + queryKey: platformApiSchemaKeys.detail(id), }); }, - /** Remove platformApiSetting from cache */platformApiSetting: (queryClient: QueryClient, id: string | number) => { + /** Remove platformApiSetting from cache */ platformApiSetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformApiSettingKeys.detail(id) + queryKey: platformApiSettingKeys.detail(id), }); }, - /** Remove platformCorsSetting from cache */platformCorsSetting: (queryClient: QueryClient, id: string | number) => { + /** Remove platformCorsSetting from cache */ platformCorsSetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformCorsSettingKeys.detail(id) + queryKey: platformCorsSettingKeys.detail(id), }); }, - /** Remove platformDomain from cache */platformDomain: (queryClient: QueryClient, id: string | number) => { + /** Remove platformDomain from cache */ platformDomain: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformDomainKeys.detail(id) + queryKey: platformDomainKeys.detail(id), }); }, - /** Remove platformDomainEvent from cache */platformDomainEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove platformDomainEvent from cache */ platformDomainEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformDomainEventKeys.detail(id) + queryKey: platformDomainEventKeys.detail(id), }); }, - /** Remove platformDomainVerification from cache */platformDomainVerification: (queryClient: QueryClient, id: string | number) => { + /** Remove platformDomainVerification from cache */ platformDomainVerification: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformDomainVerificationKeys.detail(id) + queryKey: platformDomainVerificationKeys.detail(id), }); }, - /** Remove platformManagedDomain from cache */platformManagedDomain: (queryClient: QueryClient, id: string | number) => { + /** Remove platformManagedDomain from cache */ platformManagedDomain: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformManagedDomainKeys.detail(id) + queryKey: platformManagedDomainKeys.detail(id), }); }, - /** Remove platformSite from cache */platformSite: (queryClient: QueryClient, id: string | number) => { + /** Remove platformSite from cache */ platformSite: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformSiteKeys.detail(id) + queryKey: platformSiteKeys.detail(id), }); }, - /** Remove platformSiteMetadatum from cache */platformSiteMetadatum: (queryClient: QueryClient, id: string | number) => { + /** Remove platformSiteMetadatum from cache */ platformSiteMetadatum: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformSiteMetadatumKeys.detail(id) + queryKey: platformSiteMetadatumKeys.detail(id), }); }, - /** Remove platformSiteModule from cache */platformSiteModule: (queryClient: QueryClient, id: string | number) => { + /** Remove platformSiteModule from cache */ platformSiteModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformSiteModuleKeys.detail(id) + queryKey: platformSiteModuleKeys.detail(id), }); }, - /** Remove platformSiteTheme from cache */platformSiteTheme: (queryClient: QueryClient, id: string | number) => { + /** Remove platformSiteTheme from cache */ platformSiteTheme: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformSiteThemeKeys.detail(id) + queryKey: platformSiteThemeKeys.detail(id), }); }, - /** Remove policy from cache */policy: (queryClient: QueryClient, id: string | number) => { + /** Remove policy from cache */ policy: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: policyKeys.detail(id) + queryKey: policyKeys.detail(id), }); }, - /** Remove primaryKeyConstraint from cache */primaryKeyConstraint: (queryClient: QueryClient, id: string | number) => { + /** Remove primaryKeyConstraint from cache */ primaryKeyConstraint: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: primaryKeyConstraintKeys.detail(id) + queryKey: primaryKeyConstraintKeys.detail(id), }); }, - /** Remove pubkeySetting from cache */pubkeySetting: (queryClient: QueryClient, id: string | number) => { + /** Remove pubkeySetting from cache */ pubkeySetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: pubkeySettingKeys.detail(id) + queryKey: pubkeySettingKeys.detail(id), }); }, - /** Remove rlsSetting from cache */rlsSetting: (queryClient: QueryClient, id: string | number) => { + /** Remove rlsSetting from cache */ rlsSetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: rlsSettingKeys.detail(id) + queryKey: rlsSettingKeys.detail(id), }); }, - /** Remove routeBinding from cache */routeBinding: (queryClient: QueryClient, id: string | number) => { + /** Remove routeBinding from cache */ routeBinding: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: routeBindingKeys.detail(id) + queryKey: routeBindingKeys.detail(id), }); }, - /** Remove route from cache */route: (queryClient: QueryClient, id: string | number) => { + /** Remove route from cache */ route: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: routeKeys.detail(id) + queryKey: routeKeys.detail(id), }); }, - /** Remove schema from cache */schema: (queryClient: QueryClient, id: string | number) => { + /** Remove schema from cache */ schema: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: schemaKeys.detail(id) + queryKey: schemaKeys.detail(id), }); }, - /** Remove schemaGrant from cache */schemaGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove schemaGrant from cache */ schemaGrant: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: schemaGrantKeys.detail(id) + queryKey: schemaGrantKeys.detail(id), }); }, - /** Remove site from cache */site: (queryClient: QueryClient, id: string | number) => { + /** Remove site from cache */ site: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: siteKeys.detail(id) + queryKey: siteKeys.detail(id), }); }, - /** Remove siteMetadatum from cache */siteMetadatum: (queryClient: QueryClient, id: string | number) => { + /** Remove siteMetadatum from cache */ siteMetadatum: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: siteMetadatumKeys.detail(id) + queryKey: siteMetadatumKeys.detail(id), }); }, - /** Remove siteModule from cache */siteModule: (queryClient: QueryClient, id: string | number) => { + /** Remove siteModule from cache */ siteModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: siteModuleKeys.detail(id) + queryKey: siteModuleKeys.detail(id), }); }, - /** Remove siteTheme from cache */siteTheme: (queryClient: QueryClient, id: string | number) => { + /** Remove siteTheme from cache */ siteTheme: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: siteThemeKeys.detail(id) + queryKey: siteThemeKeys.detail(id), }); }, - /** Remove spatialRelation from cache */spatialRelation: (queryClient: QueryClient, id: string | number) => { + /** Remove spatialRelation from cache */ spatialRelation: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: spatialRelationKeys.detail(id) + queryKey: spatialRelationKeys.detail(id), }); }, - /** Remove sqlAction from cache */sqlAction: (queryClient: QueryClient, id: string | number) => { + /** Remove sqlAction from cache */ sqlAction: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: sqlActionKeys.detail(id) + queryKey: sqlActionKeys.detail(id), }); }, - /** Remove table from cache */table: (queryClient: QueryClient, id: string | number) => { + /** Remove table from cache */ table: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: tableKeys.detail(id) + queryKey: tableKeys.detail(id), }); }, - /** Remove tableGrant from cache */tableGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove tableGrant from cache */ tableGrant: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: tableGrantKeys.detail(id) + queryKey: tableGrantKeys.detail(id), }); }, - /** Remove trigger from cache */trigger: (queryClient: QueryClient, id: string | number) => { + /** Remove trigger from cache */ trigger: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: triggerKeys.detail(id) + queryKey: triggerKeys.detail(id), }); }, - /** Remove triggerFunction from cache */triggerFunction: (queryClient: QueryClient, id: string | number) => { + /** Remove triggerFunction from cache */ triggerFunction: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: triggerFunctionKeys.detail(id) + queryKey: triggerFunctionKeys.detail(id), }); }, - /** Remove uniqueConstraint from cache */uniqueConstraint: (queryClient: QueryClient, id: string | number) => { + /** Remove uniqueConstraint from cache */ uniqueConstraint: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: uniqueConstraintKeys.detail(id) + queryKey: uniqueConstraintKeys.detail(id), }); }, - /** Remove view from cache */view: (queryClient: QueryClient, id: string | number) => { + /** Remove view from cache */ view: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: viewKeys.detail(id) + queryKey: viewKeys.detail(id), }); }, - /** Remove viewGrant from cache */viewGrant: (queryClient: QueryClient, id: string | number) => { + /** Remove viewGrant from cache */ viewGrant: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: viewGrantKeys.detail(id) + queryKey: viewGrantKeys.detail(id), }); }, - /** Remove viewRule from cache */viewRule: (queryClient: QueryClient, id: string | number) => { + /** Remove viewRule from cache */ viewRule: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: viewRuleKeys.detail(id) + queryKey: viewRuleKeys.detail(id), }); }, - /** Remove viewTable from cache */viewTable: (queryClient: QueryClient, id: string | number) => { + /** Remove viewTable from cache */ viewTable: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: viewTableKeys.detail(id) + queryKey: viewTableKeys.detail(id), }); }, - /** Remove webauthnSetting from cache */webauthnSetting: (queryClient: QueryClient, id: string | number) => { + /** Remove webauthnSetting from cache */ webauthnSetting: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: webauthnSettingKeys.detail(id) + queryKey: webauthnSettingKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/api/hooks/mutation-keys.ts b/sdk/constructive-react/src/api/hooks/mutation-keys.ts index f1e3ea79e8..2833f1da23 100644 --- a/sdk/constructive-react/src/api/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/api/hooks/mutation-keys.ts @@ -19,394 +19,571 @@ // ============================================================================ export const apiMutationKeys = { - /** All api mutation keys */all: ["mutation", "api"] as const, - /** Create api mutation key */create: () => ["mutation", "api", "create"] as const, - /** Update api mutation key */update: (id: string | number) => ["mutation", "api", "update", id] as const, - /** Delete api mutation key */delete: (id: string | number) => ["mutation", "api", "delete", id] as const + /** All api mutation keys */ all: ['mutation', 'api'] as const, + /** Create api mutation key */ create: () => ['mutation', 'api', 'create'] as const, + /** Update api mutation key */ update: (id: string | number) => + ['mutation', 'api', 'update', id] as const, + /** Delete api mutation key */ delete: (id: string | number) => + ['mutation', 'api', 'delete', id] as const, } as const; export const apiModuleMutationKeys = { - /** All apiModule mutation keys */all: ["mutation", "apimodule"] as const, - /** Create apiModule mutation key */create: () => ["mutation", "apimodule", "create"] as const, - /** Update apiModule mutation key */update: (id: string | number) => ["mutation", "apimodule", "update", id] as const, - /** Delete apiModule mutation key */delete: (id: string | number) => ["mutation", "apimodule", "delete", id] as const + /** All apiModule mutation keys */ all: ['mutation', 'apimodule'] as const, + /** Create apiModule mutation key */ create: () => ['mutation', 'apimodule', 'create'] as const, + /** Update apiModule mutation key */ update: (id: string | number) => + ['mutation', 'apimodule', 'update', id] as const, + /** Delete apiModule mutation key */ delete: (id: string | number) => + ['mutation', 'apimodule', 'delete', id] as const, } as const; export const apiSchemaMutationKeys = { - /** All apiSchema mutation keys */all: ["mutation", "apischema"] as const, - /** Create apiSchema mutation key */create: () => ["mutation", "apischema", "create"] as const, - /** Update apiSchema mutation key */update: (id: string | number) => ["mutation", "apischema", "update", id] as const, - /** Delete apiSchema mutation key */delete: (id: string | number) => ["mutation", "apischema", "delete", id] as const + /** All apiSchema mutation keys */ all: ['mutation', 'apischema'] as const, + /** Create apiSchema mutation key */ create: () => ['mutation', 'apischema', 'create'] as const, + /** Update apiSchema mutation key */ update: (id: string | number) => + ['mutation', 'apischema', 'update', id] as const, + /** Delete apiSchema mutation key */ delete: (id: string | number) => + ['mutation', 'apischema', 'delete', id] as const, } as const; export const apiSettingMutationKeys = { - /** All apiSetting mutation keys */all: ["mutation", "apisetting"] as const, - /** Create apiSetting mutation key */create: () => ["mutation", "apisetting", "create"] as const, - /** Update apiSetting mutation key */update: (id: string | number) => ["mutation", "apisetting", "update", id] as const, - /** Delete apiSetting mutation key */delete: (id: string | number) => ["mutation", "apisetting", "delete", id] as const + /** All apiSetting mutation keys */ all: ['mutation', 'apisetting'] as const, + /** Create apiSetting mutation key */ create: () => ['mutation', 'apisetting', 'create'] as const, + /** Update apiSetting mutation key */ update: (id: string | number) => + ['mutation', 'apisetting', 'update', id] as const, + /** Delete apiSetting mutation key */ delete: (id: string | number) => + ['mutation', 'apisetting', 'delete', id] as const, } as const; export const astMigrationMutationKeys = { - /** All astMigration mutation keys */all: ["mutation", "astmigration"] as const, - /** Create astMigration mutation key */create: () => ["mutation", "astmigration", "create"] as const, - /** Update astMigration mutation key */update: (id: string | number) => ["mutation", "astmigration", "update", id] as const, - /** Delete astMigration mutation key */delete: (id: string | number) => ["mutation", "astmigration", "delete", id] as const + /** All astMigration mutation keys */ all: ['mutation', 'astmigration'] as const, + /** Create astMigration mutation key */ create: () => + ['mutation', 'astmigration', 'create'] as const, + /** Update astMigration mutation key */ update: (id: string | number) => + ['mutation', 'astmigration', 'update', id] as const, + /** Delete astMigration mutation key */ delete: (id: string | number) => + ['mutation', 'astmigration', 'delete', id] as const, } as const; export const checkConstraintMutationKeys = { - /** All checkConstraint mutation keys */all: ["mutation", "checkconstraint"] as const, - /** Create checkConstraint mutation key */create: () => ["mutation", "checkconstraint", "create"] as const, - /** Update checkConstraint mutation key */update: (id: string | number) => ["mutation", "checkconstraint", "update", id] as const, - /** Delete checkConstraint mutation key */delete: (id: string | number) => ["mutation", "checkconstraint", "delete", id] as const + /** All checkConstraint mutation keys */ all: ['mutation', 'checkconstraint'] as const, + /** Create checkConstraint mutation key */ create: () => + ['mutation', 'checkconstraint', 'create'] as const, + /** Update checkConstraint mutation key */ update: (id: string | number) => + ['mutation', 'checkconstraint', 'update', id] as const, + /** Delete checkConstraint mutation key */ delete: (id: string | number) => + ['mutation', 'checkconstraint', 'delete', id] as const, } as const; export const compositeTypeMutationKeys = { - /** All compositeType mutation keys */all: ["mutation", "compositetype"] as const, - /** Create compositeType mutation key */create: () => ["mutation", "compositetype", "create"] as const, - /** Update compositeType mutation key */update: (id: string | number) => ["mutation", "compositetype", "update", id] as const, - /** Delete compositeType mutation key */delete: (id: string | number) => ["mutation", "compositetype", "delete", id] as const + /** All compositeType mutation keys */ all: ['mutation', 'compositetype'] as const, + /** Create compositeType mutation key */ create: () => + ['mutation', 'compositetype', 'create'] as const, + /** Update compositeType mutation key */ update: (id: string | number) => + ['mutation', 'compositetype', 'update', id] as const, + /** Delete compositeType mutation key */ delete: (id: string | number) => + ['mutation', 'compositetype', 'delete', id] as const, } as const; export const corsSettingMutationKeys = { - /** All corsSetting mutation keys */all: ["mutation", "corssetting"] as const, - /** Create corsSetting mutation key */create: () => ["mutation", "corssetting", "create"] as const, - /** Update corsSetting mutation key */update: (id: string | number) => ["mutation", "corssetting", "update", id] as const, - /** Delete corsSetting mutation key */delete: (id: string | number) => ["mutation", "corssetting", "delete", id] as const + /** All corsSetting mutation keys */ all: ['mutation', 'corssetting'] as const, + /** Create corsSetting mutation key */ create: () => + ['mutation', 'corssetting', 'create'] as const, + /** Update corsSetting mutation key */ update: (id: string | number) => + ['mutation', 'corssetting', 'update', id] as const, + /** Delete corsSetting mutation key */ delete: (id: string | number) => + ['mutation', 'corssetting', 'delete', id] as const, } as const; export const databaseMutationKeys = { - /** All database mutation keys */all: ["mutation", "database"] as const, - /** Create database mutation key */create: () => ["mutation", "database", "create"] as const, - /** Update database mutation key */update: (id: string | number) => ["mutation", "database", "update", id] as const, - /** Delete database mutation key */delete: (id: string | number) => ["mutation", "database", "delete", id] as const + /** All database mutation keys */ all: ['mutation', 'database'] as const, + /** Create database mutation key */ create: () => ['mutation', 'database', 'create'] as const, + /** Update database mutation key */ update: (id: string | number) => + ['mutation', 'database', 'update', id] as const, + /** Delete database mutation key */ delete: (id: string | number) => + ['mutation', 'database', 'delete', id] as const, } as const; export const databaseSettingMutationKeys = { - /** All databaseSetting mutation keys */all: ["mutation", "databasesetting"] as const, - /** Create databaseSetting mutation key */create: () => ["mutation", "databasesetting", "create"] as const, - /** Update databaseSetting mutation key */update: (id: string | number) => ["mutation", "databasesetting", "update", id] as const, - /** Delete databaseSetting mutation key */delete: (id: string | number) => ["mutation", "databasesetting", "delete", id] as const + /** All databaseSetting mutation keys */ all: ['mutation', 'databasesetting'] as const, + /** Create databaseSetting mutation key */ create: () => + ['mutation', 'databasesetting', 'create'] as const, + /** Update databaseSetting mutation key */ update: (id: string | number) => + ['mutation', 'databasesetting', 'update', id] as const, + /** Delete databaseSetting mutation key */ delete: (id: string | number) => + ['mutation', 'databasesetting', 'delete', id] as const, } as const; export const databaseTransferMutationKeys = { - /** All databaseTransfer mutation keys */all: ["mutation", "databasetransfer"] as const, - /** Create databaseTransfer mutation key */create: () => ["mutation", "databasetransfer", "create"] as const, - /** Update databaseTransfer mutation key */update: (id: string | number) => ["mutation", "databasetransfer", "update", id] as const, - /** Delete databaseTransfer mutation key */delete: (id: string | number) => ["mutation", "databasetransfer", "delete", id] as const + /** All databaseTransfer mutation keys */ all: ['mutation', 'databasetransfer'] as const, + /** Create databaseTransfer mutation key */ create: () => + ['mutation', 'databasetransfer', 'create'] as const, + /** Update databaseTransfer mutation key */ update: (id: string | number) => + ['mutation', 'databasetransfer', 'update', id] as const, + /** Delete databaseTransfer mutation key */ delete: (id: string | number) => + ['mutation', 'databasetransfer', 'delete', id] as const, } as const; export const defaultPrivilegeMutationKeys = { - /** All defaultPrivilege mutation keys */all: ["mutation", "defaultprivilege"] as const, - /** Create defaultPrivilege mutation key */create: () => ["mutation", "defaultprivilege", "create"] as const, - /** Update defaultPrivilege mutation key */update: (id: string | number) => ["mutation", "defaultprivilege", "update", id] as const, - /** Delete defaultPrivilege mutation key */delete: (id: string | number) => ["mutation", "defaultprivilege", "delete", id] as const + /** All defaultPrivilege mutation keys */ all: ['mutation', 'defaultprivilege'] as const, + /** Create defaultPrivilege mutation key */ create: () => + ['mutation', 'defaultprivilege', 'create'] as const, + /** Update defaultPrivilege mutation key */ update: (id: string | number) => + ['mutation', 'defaultprivilege', 'update', id] as const, + /** Delete defaultPrivilege mutation key */ delete: (id: string | number) => + ['mutation', 'defaultprivilege', 'delete', id] as const, } as const; export const domainMutationKeys = { - /** All domain mutation keys */all: ["mutation", "domain"] as const, - /** Create domain mutation key */create: () => ["mutation", "domain", "create"] as const, - /** Update domain mutation key */update: (id: string | number) => ["mutation", "domain", "update", id] as const, - /** Delete domain mutation key */delete: (id: string | number) => ["mutation", "domain", "delete", id] as const + /** All domain mutation keys */ all: ['mutation', 'domain'] as const, + /** Create domain mutation key */ create: () => ['mutation', 'domain', 'create'] as const, + /** Update domain mutation key */ update: (id: string | number) => + ['mutation', 'domain', 'update', id] as const, + /** Delete domain mutation key */ delete: (id: string | number) => + ['mutation', 'domain', 'delete', id] as const, } as const; export const domainEventMutationKeys = { - /** All domainEvent mutation keys */all: ["mutation", "domainevent"] as const, - /** Create domainEvent mutation key */create: () => ["mutation", "domainevent", "create"] as const, - /** Update domainEvent mutation key */update: (id: string | number) => ["mutation", "domainevent", "update", id] as const, - /** Delete domainEvent mutation key */delete: (id: string | number) => ["mutation", "domainevent", "delete", id] as const + /** All domainEvent mutation keys */ all: ['mutation', 'domainevent'] as const, + /** Create domainEvent mutation key */ create: () => + ['mutation', 'domainevent', 'create'] as const, + /** Update domainEvent mutation key */ update: (id: string | number) => + ['mutation', 'domainevent', 'update', id] as const, + /** Delete domainEvent mutation key */ delete: (id: string | number) => + ['mutation', 'domainevent', 'delete', id] as const, } as const; export const domainVerificationMutationKeys = { - /** All domainVerification mutation keys */all: ["mutation", "domainverification"] as const, - /** Create domainVerification mutation key */create: () => ["mutation", "domainverification", "create"] as const, - /** Update domainVerification mutation key */update: (id: string | number) => ["mutation", "domainverification", "update", id] as const, - /** Delete domainVerification mutation key */delete: (id: string | number) => ["mutation", "domainverification", "delete", id] as const + /** All domainVerification mutation keys */ all: ['mutation', 'domainverification'] as const, + /** Create domainVerification mutation key */ create: () => + ['mutation', 'domainverification', 'create'] as const, + /** Update domainVerification mutation key */ update: (id: string | number) => + ['mutation', 'domainverification', 'update', id] as const, + /** Delete domainVerification mutation key */ delete: (id: string | number) => + ['mutation', 'domainverification', 'delete', id] as const, } as const; export const embeddingChunkMutationKeys = { - /** All embeddingChunk mutation keys */all: ["mutation", "embeddingchunk"] as const, - /** Create embeddingChunk mutation key */create: () => ["mutation", "embeddingchunk", "create"] as const, - /** Update embeddingChunk mutation key */update: (id: string | number) => ["mutation", "embeddingchunk", "update", id] as const, - /** Delete embeddingChunk mutation key */delete: (id: string | number) => ["mutation", "embeddingchunk", "delete", id] as const + /** All embeddingChunk mutation keys */ all: ['mutation', 'embeddingchunk'] as const, + /** Create embeddingChunk mutation key */ create: () => + ['mutation', 'embeddingchunk', 'create'] as const, + /** Update embeddingChunk mutation key */ update: (id: string | number) => + ['mutation', 'embeddingchunk', 'update', id] as const, + /** Delete embeddingChunk mutation key */ delete: (id: string | number) => + ['mutation', 'embeddingchunk', 'delete', id] as const, } as const; export const enumMutationKeys = { - /** All enum mutation keys */all: ["mutation", "enum"] as const, - /** Create enum mutation key */create: () => ["mutation", "enum", "create"] as const, - /** Update enum mutation key */update: (id: string | number) => ["mutation", "enum", "update", id] as const, - /** Delete enum mutation key */delete: (id: string | number) => ["mutation", "enum", "delete", id] as const + /** All enum mutation keys */ all: ['mutation', 'enum'] as const, + /** Create enum mutation key */ create: () => ['mutation', 'enum', 'create'] as const, + /** Update enum mutation key */ update: (id: string | number) => + ['mutation', 'enum', 'update', id] as const, + /** Delete enum mutation key */ delete: (id: string | number) => + ['mutation', 'enum', 'delete', id] as const, } as const; export const exclusionConstraintMutationKeys = { - /** All exclusionConstraint mutation keys */all: ["mutation", "exclusionconstraint"] as const, - /** Create exclusionConstraint mutation key */create: () => ["mutation", "exclusionconstraint", "create"] as const, - /** Update exclusionConstraint mutation key */update: (id: string | number) => ["mutation", "exclusionconstraint", "update", id] as const, - /** Delete exclusionConstraint mutation key */delete: (id: string | number) => ["mutation", "exclusionconstraint", "delete", id] as const + /** All exclusionConstraint mutation keys */ all: ['mutation', 'exclusionconstraint'] as const, + /** Create exclusionConstraint mutation key */ create: () => + ['mutation', 'exclusionconstraint', 'create'] as const, + /** Update exclusionConstraint mutation key */ update: (id: string | number) => + ['mutation', 'exclusionconstraint', 'update', id] as const, + /** Delete exclusionConstraint mutation key */ delete: (id: string | number) => + ['mutation', 'exclusionconstraint', 'delete', id] as const, } as const; export const fieldMutationKeys = { - /** All field mutation keys */all: ["mutation", "field"] as const, - /** Create field mutation key */create: () => ["mutation", "field", "create"] as const, - /** Update field mutation key */update: (id: string | number) => ["mutation", "field", "update", id] as const, - /** Delete field mutation key */delete: (id: string | number) => ["mutation", "field", "delete", id] as const + /** All field mutation keys */ all: ['mutation', 'field'] as const, + /** Create field mutation key */ create: () => ['mutation', 'field', 'create'] as const, + /** Update field mutation key */ update: (id: string | number) => + ['mutation', 'field', 'update', id] as const, + /** Delete field mutation key */ delete: (id: string | number) => + ['mutation', 'field', 'delete', id] as const, } as const; export const foreignKeyConstraintMutationKeys = { - /** All foreignKeyConstraint mutation keys */all: ["mutation", "foreignkeyconstraint"] as const, - /** Create foreignKeyConstraint mutation key */create: () => ["mutation", "foreignkeyconstraint", "create"] as const, - /** Update foreignKeyConstraint mutation key */update: (id: string | number) => ["mutation", "foreignkeyconstraint", "update", id] as const, - /** Delete foreignKeyConstraint mutation key */delete: (id: string | number) => ["mutation", "foreignkeyconstraint", "delete", id] as const + /** All foreignKeyConstraint mutation keys */ all: ['mutation', 'foreignkeyconstraint'] as const, + /** Create foreignKeyConstraint mutation key */ create: () => + ['mutation', 'foreignkeyconstraint', 'create'] as const, + /** Update foreignKeyConstraint mutation key */ update: (id: string | number) => + ['mutation', 'foreignkeyconstraint', 'update', id] as const, + /** Delete foreignKeyConstraint mutation key */ delete: (id: string | number) => + ['mutation', 'foreignkeyconstraint', 'delete', id] as const, } as const; export const fullTextSearchMutationKeys = { - /** All fullTextSearch mutation keys */all: ["mutation", "fulltextsearch"] as const, - /** Create fullTextSearch mutation key */create: () => ["mutation", "fulltextsearch", "create"] as const, - /** Update fullTextSearch mutation key */update: (id: string | number) => ["mutation", "fulltextsearch", "update", id] as const, - /** Delete fullTextSearch mutation key */delete: (id: string | number) => ["mutation", "fulltextsearch", "delete", id] as const + /** All fullTextSearch mutation keys */ all: ['mutation', 'fulltextsearch'] as const, + /** Create fullTextSearch mutation key */ create: () => + ['mutation', 'fulltextsearch', 'create'] as const, + /** Update fullTextSearch mutation key */ update: (id: string | number) => + ['mutation', 'fulltextsearch', 'update', id] as const, + /** Delete fullTextSearch mutation key */ delete: (id: string | number) => + ['mutation', 'fulltextsearch', 'delete', id] as const, } as const; export const functionMutationKeys = { - /** All function mutation keys */all: ["mutation", "function"] as const, - /** Create function mutation key */create: () => ["mutation", "function", "create"] as const, - /** Update function mutation key */update: (id: string | number) => ["mutation", "function", "update", id] as const, - /** Delete function mutation key */delete: (id: string | number) => ["mutation", "function", "delete", id] as const + /** All function mutation keys */ all: ['mutation', 'function'] as const, + /** Create function mutation key */ create: () => ['mutation', 'function', 'create'] as const, + /** Update function mutation key */ update: (id: string | number) => + ['mutation', 'function', 'update', id] as const, + /** Delete function mutation key */ delete: (id: string | number) => + ['mutation', 'function', 'delete', id] as const, } as const; export const hostnameBindingMutationKeys = { - /** All hostnameBinding mutation keys */all: ["mutation", "hostnamebinding"] as const, - /** Create hostnameBinding mutation key */create: () => ["mutation", "hostnamebinding", "create"] as const, - /** Update hostnameBinding mutation key */update: (id: string | number) => ["mutation", "hostnamebinding", "update", id] as const, - /** Delete hostnameBinding mutation key */delete: (id: string | number) => ["mutation", "hostnamebinding", "delete", id] as const + /** All hostnameBinding mutation keys */ all: ['mutation', 'hostnamebinding'] as const, + /** Create hostnameBinding mutation key */ create: () => + ['mutation', 'hostnamebinding', 'create'] as const, + /** Update hostnameBinding mutation key */ update: (id: string | number) => + ['mutation', 'hostnamebinding', 'update', id] as const, + /** Delete hostnameBinding mutation key */ delete: (id: string | number) => + ['mutation', 'hostnamebinding', 'delete', id] as const, } as const; export const httpRouteMutationKeys = { - /** All httpRoute mutation keys */all: ["mutation", "httproute"] as const, - /** Create httpRoute mutation key */create: () => ["mutation", "httproute", "create"] as const, - /** Update httpRoute mutation key */update: (id: string | number) => ["mutation", "httproute", "update", id] as const, - /** Delete httpRoute mutation key */delete: (id: string | number) => ["mutation", "httproute", "delete", id] as const + /** All httpRoute mutation keys */ all: ['mutation', 'httproute'] as const, + /** Create httpRoute mutation key */ create: () => ['mutation', 'httproute', 'create'] as const, + /** Update httpRoute mutation key */ update: (id: string | number) => + ['mutation', 'httproute', 'update', id] as const, + /** Delete httpRoute mutation key */ delete: (id: string | number) => + ['mutation', 'httproute', 'delete', id] as const, } as const; export const indexMutationKeys = { - /** All index mutation keys */all: ["mutation", "index"] as const, - /** Create index mutation key */create: () => ["mutation", "index", "create"] as const, - /** Update index mutation key */update: (id: string | number) => ["mutation", "index", "update", id] as const, - /** Delete index mutation key */delete: (id: string | number) => ["mutation", "index", "delete", id] as const + /** All index mutation keys */ all: ['mutation', 'index'] as const, + /** Create index mutation key */ create: () => ['mutation', 'index', 'create'] as const, + /** Update index mutation key */ update: (id: string | number) => + ['mutation', 'index', 'update', id] as const, + /** Delete index mutation key */ delete: (id: string | number) => + ['mutation', 'index', 'delete', id] as const, } as const; export const managedDomainMutationKeys = { - /** All managedDomain mutation keys */all: ["mutation", "manageddomain"] as const, - /** Create managedDomain mutation key */create: () => ["mutation", "manageddomain", "create"] as const, - /** Update managedDomain mutation key */update: (id: string | number) => ["mutation", "manageddomain", "update", id] as const, - /** Delete managedDomain mutation key */delete: (id: string | number) => ["mutation", "manageddomain", "delete", id] as const + /** All managedDomain mutation keys */ all: ['mutation', 'manageddomain'] as const, + /** Create managedDomain mutation key */ create: () => + ['mutation', 'manageddomain', 'create'] as const, + /** Update managedDomain mutation key */ update: (id: string | number) => + ['mutation', 'manageddomain', 'update', id] as const, + /** Delete managedDomain mutation key */ delete: (id: string | number) => + ['mutation', 'manageddomain', 'delete', id] as const, } as const; export const nodeTypeRegistryMutationKeys = { - /** All nodeTypeRegistry mutation keys */all: ["mutation", "nodetyperegistry"] as const, - /** Create nodeTypeRegistry mutation key */create: () => ["mutation", "nodetyperegistry", "create"] as const, - /** Update nodeTypeRegistry mutation key */update: (id: string | number) => ["mutation", "nodetyperegistry", "update", id] as const, - /** Delete nodeTypeRegistry mutation key */delete: (id: string | number) => ["mutation", "nodetyperegistry", "delete", id] as const + /** All nodeTypeRegistry mutation keys */ all: ['mutation', 'nodetyperegistry'] as const, + /** Create nodeTypeRegistry mutation key */ create: () => + ['mutation', 'nodetyperegistry', 'create'] as const, + /** Update nodeTypeRegistry mutation key */ update: (id: string | number) => + ['mutation', 'nodetyperegistry', 'update', id] as const, + /** Delete nodeTypeRegistry mutation key */ delete: (id: string | number) => + ['mutation', 'nodetyperegistry', 'delete', id] as const, } as const; export const partitionMutationKeys = { - /** All partition mutation keys */all: ["mutation", "partition"] as const, - /** Create partition mutation key */create: () => ["mutation", "partition", "create"] as const, - /** Update partition mutation key */update: (id: string | number) => ["mutation", "partition", "update", id] as const, - /** Delete partition mutation key */delete: (id: string | number) => ["mutation", "partition", "delete", id] as const + /** All partition mutation keys */ all: ['mutation', 'partition'] as const, + /** Create partition mutation key */ create: () => ['mutation', 'partition', 'create'] as const, + /** Update partition mutation key */ update: (id: string | number) => + ['mutation', 'partition', 'update', id] as const, + /** Delete partition mutation key */ delete: (id: string | number) => + ['mutation', 'partition', 'delete', id] as const, } as const; export const platformApiMutationKeys = { - /** All platformApi mutation keys */all: ["mutation", "platformapi"] as const, - /** Create platformApi mutation key */create: () => ["mutation", "platformapi", "create"] as const, - /** Update platformApi mutation key */update: (id: string | number) => ["mutation", "platformapi", "update", id] as const, - /** Delete platformApi mutation key */delete: (id: string | number) => ["mutation", "platformapi", "delete", id] as const + /** All platformApi mutation keys */ all: ['mutation', 'platformapi'] as const, + /** Create platformApi mutation key */ create: () => + ['mutation', 'platformapi', 'create'] as const, + /** Update platformApi mutation key */ update: (id: string | number) => + ['mutation', 'platformapi', 'update', id] as const, + /** Delete platformApi mutation key */ delete: (id: string | number) => + ['mutation', 'platformapi', 'delete', id] as const, } as const; export const platformApiModuleMutationKeys = { - /** All platformApiModule mutation keys */all: ["mutation", "platformapimodule"] as const, - /** Create platformApiModule mutation key */create: () => ["mutation", "platformapimodule", "create"] as const, - /** Update platformApiModule mutation key */update: (id: string | number) => ["mutation", "platformapimodule", "update", id] as const, - /** Delete platformApiModule mutation key */delete: (id: string | number) => ["mutation", "platformapimodule", "delete", id] as const + /** All platformApiModule mutation keys */ all: ['mutation', 'platformapimodule'] as const, + /** Create platformApiModule mutation key */ create: () => + ['mutation', 'platformapimodule', 'create'] as const, + /** Update platformApiModule mutation key */ update: (id: string | number) => + ['mutation', 'platformapimodule', 'update', id] as const, + /** Delete platformApiModule mutation key */ delete: (id: string | number) => + ['mutation', 'platformapimodule', 'delete', id] as const, } as const; export const platformApiSchemaMutationKeys = { - /** All platformApiSchema mutation keys */all: ["mutation", "platformapischema"] as const, - /** Create platformApiSchema mutation key */create: () => ["mutation", "platformapischema", "create"] as const, - /** Update platformApiSchema mutation key */update: (id: string | number) => ["mutation", "platformapischema", "update", id] as const, - /** Delete platformApiSchema mutation key */delete: (id: string | number) => ["mutation", "platformapischema", "delete", id] as const + /** All platformApiSchema mutation keys */ all: ['mutation', 'platformapischema'] as const, + /** Create platformApiSchema mutation key */ create: () => + ['mutation', 'platformapischema', 'create'] as const, + /** Update platformApiSchema mutation key */ update: (id: string | number) => + ['mutation', 'platformapischema', 'update', id] as const, + /** Delete platformApiSchema mutation key */ delete: (id: string | number) => + ['mutation', 'platformapischema', 'delete', id] as const, } as const; export const platformApiSettingMutationKeys = { - /** All platformApiSetting mutation keys */all: ["mutation", "platformapisetting"] as const, - /** Create platformApiSetting mutation key */create: () => ["mutation", "platformapisetting", "create"] as const, - /** Update platformApiSetting mutation key */update: (id: string | number) => ["mutation", "platformapisetting", "update", id] as const, - /** Delete platformApiSetting mutation key */delete: (id: string | number) => ["mutation", "platformapisetting", "delete", id] as const + /** All platformApiSetting mutation keys */ all: ['mutation', 'platformapisetting'] as const, + /** Create platformApiSetting mutation key */ create: () => + ['mutation', 'platformapisetting', 'create'] as const, + /** Update platformApiSetting mutation key */ update: (id: string | number) => + ['mutation', 'platformapisetting', 'update', id] as const, + /** Delete platformApiSetting mutation key */ delete: (id: string | number) => + ['mutation', 'platformapisetting', 'delete', id] as const, } as const; export const platformCorsSettingMutationKeys = { - /** All platformCorsSetting mutation keys */all: ["mutation", "platformcorssetting"] as const, - /** Create platformCorsSetting mutation key */create: () => ["mutation", "platformcorssetting", "create"] as const, - /** Update platformCorsSetting mutation key */update: (id: string | number) => ["mutation", "platformcorssetting", "update", id] as const, - /** Delete platformCorsSetting mutation key */delete: (id: string | number) => ["mutation", "platformcorssetting", "delete", id] as const + /** All platformCorsSetting mutation keys */ all: ['mutation', 'platformcorssetting'] as const, + /** Create platformCorsSetting mutation key */ create: () => + ['mutation', 'platformcorssetting', 'create'] as const, + /** Update platformCorsSetting mutation key */ update: (id: string | number) => + ['mutation', 'platformcorssetting', 'update', id] as const, + /** Delete platformCorsSetting mutation key */ delete: (id: string | number) => + ['mutation', 'platformcorssetting', 'delete', id] as const, } as const; export const platformDomainMutationKeys = { - /** All platformDomain mutation keys */all: ["mutation", "platformdomain"] as const, - /** Create platformDomain mutation key */create: () => ["mutation", "platformdomain", "create"] as const, - /** Update platformDomain mutation key */update: (id: string | number) => ["mutation", "platformdomain", "update", id] as const, - /** Delete platformDomain mutation key */delete: (id: string | number) => ["mutation", "platformdomain", "delete", id] as const + /** All platformDomain mutation keys */ all: ['mutation', 'platformdomain'] as const, + /** Create platformDomain mutation key */ create: () => + ['mutation', 'platformdomain', 'create'] as const, + /** Update platformDomain mutation key */ update: (id: string | number) => + ['mutation', 'platformdomain', 'update', id] as const, + /** Delete platformDomain mutation key */ delete: (id: string | number) => + ['mutation', 'platformdomain', 'delete', id] as const, } as const; export const platformDomainEventMutationKeys = { - /** All platformDomainEvent mutation keys */all: ["mutation", "platformdomainevent"] as const, - /** Create platformDomainEvent mutation key */create: () => ["mutation", "platformdomainevent", "create"] as const, - /** Update platformDomainEvent mutation key */update: (id: string | number) => ["mutation", "platformdomainevent", "update", id] as const, - /** Delete platformDomainEvent mutation key */delete: (id: string | number) => ["mutation", "platformdomainevent", "delete", id] as const + /** All platformDomainEvent mutation keys */ all: ['mutation', 'platformdomainevent'] as const, + /** Create platformDomainEvent mutation key */ create: () => + ['mutation', 'platformdomainevent', 'create'] as const, + /** Update platformDomainEvent mutation key */ update: (id: string | number) => + ['mutation', 'platformdomainevent', 'update', id] as const, + /** Delete platformDomainEvent mutation key */ delete: (id: string | number) => + ['mutation', 'platformdomainevent', 'delete', id] as const, } as const; export const platformDomainVerificationMutationKeys = { - /** All platformDomainVerification mutation keys */all: ["mutation", "platformdomainverification"] as const, - /** Create platformDomainVerification mutation key */create: () => ["mutation", "platformdomainverification", "create"] as const, - /** Update platformDomainVerification mutation key */update: (id: string | number) => ["mutation", "platformdomainverification", "update", id] as const, - /** Delete platformDomainVerification mutation key */delete: (id: string | number) => ["mutation", "platformdomainverification", "delete", id] as const + /** All platformDomainVerification mutation keys */ all: [ + 'mutation', + 'platformdomainverification', + ] as const, + /** Create platformDomainVerification mutation key */ create: () => + ['mutation', 'platformdomainverification', 'create'] as const, + /** Update platformDomainVerification mutation key */ update: (id: string | number) => + ['mutation', 'platformdomainverification', 'update', id] as const, + /** Delete platformDomainVerification mutation key */ delete: (id: string | number) => + ['mutation', 'platformdomainverification', 'delete', id] as const, } as const; export const platformManagedDomainMutationKeys = { - /** All platformManagedDomain mutation keys */all: ["mutation", "platformmanageddomain"] as const, - /** Create platformManagedDomain mutation key */create: () => ["mutation", "platformmanageddomain", "create"] as const, - /** Update platformManagedDomain mutation key */update: (id: string | number) => ["mutation", "platformmanageddomain", "update", id] as const, - /** Delete platformManagedDomain mutation key */delete: (id: string | number) => ["mutation", "platformmanageddomain", "delete", id] as const + /** All platformManagedDomain mutation keys */ all: [ + 'mutation', + 'platformmanageddomain', + ] as const, + /** Create platformManagedDomain mutation key */ create: () => + ['mutation', 'platformmanageddomain', 'create'] as const, + /** Update platformManagedDomain mutation key */ update: (id: string | number) => + ['mutation', 'platformmanageddomain', 'update', id] as const, + /** Delete platformManagedDomain mutation key */ delete: (id: string | number) => + ['mutation', 'platformmanageddomain', 'delete', id] as const, } as const; export const platformSiteMutationKeys = { - /** All platformSite mutation keys */all: ["mutation", "platformsite"] as const, - /** Create platformSite mutation key */create: () => ["mutation", "platformsite", "create"] as const, - /** Update platformSite mutation key */update: (id: string | number) => ["mutation", "platformsite", "update", id] as const, - /** Delete platformSite mutation key */delete: (id: string | number) => ["mutation", "platformsite", "delete", id] as const + /** All platformSite mutation keys */ all: ['mutation', 'platformsite'] as const, + /** Create platformSite mutation key */ create: () => + ['mutation', 'platformsite', 'create'] as const, + /** Update platformSite mutation key */ update: (id: string | number) => + ['mutation', 'platformsite', 'update', id] as const, + /** Delete platformSite mutation key */ delete: (id: string | number) => + ['mutation', 'platformsite', 'delete', id] as const, } as const; export const platformSiteMetadatumMutationKeys = { - /** All platformSiteMetadatum mutation keys */all: ["mutation", "platformsitemetadatum"] as const, - /** Create platformSiteMetadatum mutation key */create: () => ["mutation", "platformsitemetadatum", "create"] as const, - /** Update platformSiteMetadatum mutation key */update: (id: string | number) => ["mutation", "platformsitemetadatum", "update", id] as const, - /** Delete platformSiteMetadatum mutation key */delete: (id: string | number) => ["mutation", "platformsitemetadatum", "delete", id] as const + /** All platformSiteMetadatum mutation keys */ all: [ + 'mutation', + 'platformsitemetadatum', + ] as const, + /** Create platformSiteMetadatum mutation key */ create: () => + ['mutation', 'platformsitemetadatum', 'create'] as const, + /** Update platformSiteMetadatum mutation key */ update: (id: string | number) => + ['mutation', 'platformsitemetadatum', 'update', id] as const, + /** Delete platformSiteMetadatum mutation key */ delete: (id: string | number) => + ['mutation', 'platformsitemetadatum', 'delete', id] as const, } as const; export const platformSiteModuleMutationKeys = { - /** All platformSiteModule mutation keys */all: ["mutation", "platformsitemodule"] as const, - /** Create platformSiteModule mutation key */create: () => ["mutation", "platformsitemodule", "create"] as const, - /** Update platformSiteModule mutation key */update: (id: string | number) => ["mutation", "platformsitemodule", "update", id] as const, - /** Delete platformSiteModule mutation key */delete: (id: string | number) => ["mutation", "platformsitemodule", "delete", id] as const + /** All platformSiteModule mutation keys */ all: ['mutation', 'platformsitemodule'] as const, + /** Create platformSiteModule mutation key */ create: () => + ['mutation', 'platformsitemodule', 'create'] as const, + /** Update platformSiteModule mutation key */ update: (id: string | number) => + ['mutation', 'platformsitemodule', 'update', id] as const, + /** Delete platformSiteModule mutation key */ delete: (id: string | number) => + ['mutation', 'platformsitemodule', 'delete', id] as const, } as const; export const platformSiteThemeMutationKeys = { - /** All platformSiteTheme mutation keys */all: ["mutation", "platformsitetheme"] as const, - /** Create platformSiteTheme mutation key */create: () => ["mutation", "platformsitetheme", "create"] as const, - /** Update platformSiteTheme mutation key */update: (id: string | number) => ["mutation", "platformsitetheme", "update", id] as const, - /** Delete platformSiteTheme mutation key */delete: (id: string | number) => ["mutation", "platformsitetheme", "delete", id] as const + /** All platformSiteTheme mutation keys */ all: ['mutation', 'platformsitetheme'] as const, + /** Create platformSiteTheme mutation key */ create: () => + ['mutation', 'platformsitetheme', 'create'] as const, + /** Update platformSiteTheme mutation key */ update: (id: string | number) => + ['mutation', 'platformsitetheme', 'update', id] as const, + /** Delete platformSiteTheme mutation key */ delete: (id: string | number) => + ['mutation', 'platformsitetheme', 'delete', id] as const, } as const; export const policyMutationKeys = { - /** All policy mutation keys */all: ["mutation", "policy"] as const, - /** Create policy mutation key */create: () => ["mutation", "policy", "create"] as const, - /** Update policy mutation key */update: (id: string | number) => ["mutation", "policy", "update", id] as const, - /** Delete policy mutation key */delete: (id: string | number) => ["mutation", "policy", "delete", id] as const + /** All policy mutation keys */ all: ['mutation', 'policy'] as const, + /** Create policy mutation key */ create: () => ['mutation', 'policy', 'create'] as const, + /** Update policy mutation key */ update: (id: string | number) => + ['mutation', 'policy', 'update', id] as const, + /** Delete policy mutation key */ delete: (id: string | number) => + ['mutation', 'policy', 'delete', id] as const, } as const; export const primaryKeyConstraintMutationKeys = { - /** All primaryKeyConstraint mutation keys */all: ["mutation", "primarykeyconstraint"] as const, - /** Create primaryKeyConstraint mutation key */create: () => ["mutation", "primarykeyconstraint", "create"] as const, - /** Update primaryKeyConstraint mutation key */update: (id: string | number) => ["mutation", "primarykeyconstraint", "update", id] as const, - /** Delete primaryKeyConstraint mutation key */delete: (id: string | number) => ["mutation", "primarykeyconstraint", "delete", id] as const + /** All primaryKeyConstraint mutation keys */ all: ['mutation', 'primarykeyconstraint'] as const, + /** Create primaryKeyConstraint mutation key */ create: () => + ['mutation', 'primarykeyconstraint', 'create'] as const, + /** Update primaryKeyConstraint mutation key */ update: (id: string | number) => + ['mutation', 'primarykeyconstraint', 'update', id] as const, + /** Delete primaryKeyConstraint mutation key */ delete: (id: string | number) => + ['mutation', 'primarykeyconstraint', 'delete', id] as const, } as const; export const pubkeySettingMutationKeys = { - /** All pubkeySetting mutation keys */all: ["mutation", "pubkeysetting"] as const, - /** Create pubkeySetting mutation key */create: () => ["mutation", "pubkeysetting", "create"] as const, - /** Update pubkeySetting mutation key */update: (id: string | number) => ["mutation", "pubkeysetting", "update", id] as const, - /** Delete pubkeySetting mutation key */delete: (id: string | number) => ["mutation", "pubkeysetting", "delete", id] as const + /** All pubkeySetting mutation keys */ all: ['mutation', 'pubkeysetting'] as const, + /** Create pubkeySetting mutation key */ create: () => + ['mutation', 'pubkeysetting', 'create'] as const, + /** Update pubkeySetting mutation key */ update: (id: string | number) => + ['mutation', 'pubkeysetting', 'update', id] as const, + /** Delete pubkeySetting mutation key */ delete: (id: string | number) => + ['mutation', 'pubkeysetting', 'delete', id] as const, } as const; export const rlsSettingMutationKeys = { - /** All rlsSetting mutation keys */all: ["mutation", "rlssetting"] as const, - /** Create rlsSetting mutation key */create: () => ["mutation", "rlssetting", "create"] as const, - /** Update rlsSetting mutation key */update: (id: string | number) => ["mutation", "rlssetting", "update", id] as const, - /** Delete rlsSetting mutation key */delete: (id: string | number) => ["mutation", "rlssetting", "delete", id] as const + /** All rlsSetting mutation keys */ all: ['mutation', 'rlssetting'] as const, + /** Create rlsSetting mutation key */ create: () => ['mutation', 'rlssetting', 'create'] as const, + /** Update rlsSetting mutation key */ update: (id: string | number) => + ['mutation', 'rlssetting', 'update', id] as const, + /** Delete rlsSetting mutation key */ delete: (id: string | number) => + ['mutation', 'rlssetting', 'delete', id] as const, } as const; export const routeBindingMutationKeys = { - /** All routeBinding mutation keys */all: ["mutation", "routebinding"] as const, - /** Create routeBinding mutation key */create: () => ["mutation", "routebinding", "create"] as const, - /** Update routeBinding mutation key */update: (id: string | number) => ["mutation", "routebinding", "update", id] as const, - /** Delete routeBinding mutation key */delete: (id: string | number) => ["mutation", "routebinding", "delete", id] as const + /** All routeBinding mutation keys */ all: ['mutation', 'routebinding'] as const, + /** Create routeBinding mutation key */ create: () => + ['mutation', 'routebinding', 'create'] as const, + /** Update routeBinding mutation key */ update: (id: string | number) => + ['mutation', 'routebinding', 'update', id] as const, + /** Delete routeBinding mutation key */ delete: (id: string | number) => + ['mutation', 'routebinding', 'delete', id] as const, } as const; export const routeMutationKeys = { - /** All route mutation keys */all: ["mutation", "route"] as const, - /** Create route mutation key */create: () => ["mutation", "route", "create"] as const, - /** Update route mutation key */update: (id: string | number) => ["mutation", "route", "update", id] as const, - /** Delete route mutation key */delete: (id: string | number) => ["mutation", "route", "delete", id] as const + /** All route mutation keys */ all: ['mutation', 'route'] as const, + /** Create route mutation key */ create: () => ['mutation', 'route', 'create'] as const, + /** Update route mutation key */ update: (id: string | number) => + ['mutation', 'route', 'update', id] as const, + /** Delete route mutation key */ delete: (id: string | number) => + ['mutation', 'route', 'delete', id] as const, } as const; export const schemaMutationKeys = { - /** All schema mutation keys */all: ["mutation", "schema"] as const, - /** Create schema mutation key */create: () => ["mutation", "schema", "create"] as const, - /** Update schema mutation key */update: (id: string | number) => ["mutation", "schema", "update", id] as const, - /** Delete schema mutation key */delete: (id: string | number) => ["mutation", "schema", "delete", id] as const + /** All schema mutation keys */ all: ['mutation', 'schema'] as const, + /** Create schema mutation key */ create: () => ['mutation', 'schema', 'create'] as const, + /** Update schema mutation key */ update: (id: string | number) => + ['mutation', 'schema', 'update', id] as const, + /** Delete schema mutation key */ delete: (id: string | number) => + ['mutation', 'schema', 'delete', id] as const, } as const; export const schemaGrantMutationKeys = { - /** All schemaGrant mutation keys */all: ["mutation", "schemagrant"] as const, - /** Create schemaGrant mutation key */create: () => ["mutation", "schemagrant", "create"] as const, - /** Update schemaGrant mutation key */update: (id: string | number) => ["mutation", "schemagrant", "update", id] as const, - /** Delete schemaGrant mutation key */delete: (id: string | number) => ["mutation", "schemagrant", "delete", id] as const + /** All schemaGrant mutation keys */ all: ['mutation', 'schemagrant'] as const, + /** Create schemaGrant mutation key */ create: () => + ['mutation', 'schemagrant', 'create'] as const, + /** Update schemaGrant mutation key */ update: (id: string | number) => + ['mutation', 'schemagrant', 'update', id] as const, + /** Delete schemaGrant mutation key */ delete: (id: string | number) => + ['mutation', 'schemagrant', 'delete', id] as const, } as const; export const siteMutationKeys = { - /** All site mutation keys */all: ["mutation", "site"] as const, - /** Create site mutation key */create: () => ["mutation", "site", "create"] as const, - /** Update site mutation key */update: (id: string | number) => ["mutation", "site", "update", id] as const, - /** Delete site mutation key */delete: (id: string | number) => ["mutation", "site", "delete", id] as const + /** All site mutation keys */ all: ['mutation', 'site'] as const, + /** Create site mutation key */ create: () => ['mutation', 'site', 'create'] as const, + /** Update site mutation key */ update: (id: string | number) => + ['mutation', 'site', 'update', id] as const, + /** Delete site mutation key */ delete: (id: string | number) => + ['mutation', 'site', 'delete', id] as const, } as const; export const siteMetadatumMutationKeys = { - /** All siteMetadatum mutation keys */all: ["mutation", "sitemetadatum"] as const, - /** Create siteMetadatum mutation key */create: () => ["mutation", "sitemetadatum", "create"] as const, - /** Update siteMetadatum mutation key */update: (id: string | number) => ["mutation", "sitemetadatum", "update", id] as const, - /** Delete siteMetadatum mutation key */delete: (id: string | number) => ["mutation", "sitemetadatum", "delete", id] as const + /** All siteMetadatum mutation keys */ all: ['mutation', 'sitemetadatum'] as const, + /** Create siteMetadatum mutation key */ create: () => + ['mutation', 'sitemetadatum', 'create'] as const, + /** Update siteMetadatum mutation key */ update: (id: string | number) => + ['mutation', 'sitemetadatum', 'update', id] as const, + /** Delete siteMetadatum mutation key */ delete: (id: string | number) => + ['mutation', 'sitemetadatum', 'delete', id] as const, } as const; export const siteModuleMutationKeys = { - /** All siteModule mutation keys */all: ["mutation", "sitemodule"] as const, - /** Create siteModule mutation key */create: () => ["mutation", "sitemodule", "create"] as const, - /** Update siteModule mutation key */update: (id: string | number) => ["mutation", "sitemodule", "update", id] as const, - /** Delete siteModule mutation key */delete: (id: string | number) => ["mutation", "sitemodule", "delete", id] as const + /** All siteModule mutation keys */ all: ['mutation', 'sitemodule'] as const, + /** Create siteModule mutation key */ create: () => ['mutation', 'sitemodule', 'create'] as const, + /** Update siteModule mutation key */ update: (id: string | number) => + ['mutation', 'sitemodule', 'update', id] as const, + /** Delete siteModule mutation key */ delete: (id: string | number) => + ['mutation', 'sitemodule', 'delete', id] as const, } as const; export const siteThemeMutationKeys = { - /** All siteTheme mutation keys */all: ["mutation", "sitetheme"] as const, - /** Create siteTheme mutation key */create: () => ["mutation", "sitetheme", "create"] as const, - /** Update siteTheme mutation key */update: (id: string | number) => ["mutation", "sitetheme", "update", id] as const, - /** Delete siteTheme mutation key */delete: (id: string | number) => ["mutation", "sitetheme", "delete", id] as const + /** All siteTheme mutation keys */ all: ['mutation', 'sitetheme'] as const, + /** Create siteTheme mutation key */ create: () => ['mutation', 'sitetheme', 'create'] as const, + /** Update siteTheme mutation key */ update: (id: string | number) => + ['mutation', 'sitetheme', 'update', id] as const, + /** Delete siteTheme mutation key */ delete: (id: string | number) => + ['mutation', 'sitetheme', 'delete', id] as const, } as const; export const spatialRelationMutationKeys = { - /** All spatialRelation mutation keys */all: ["mutation", "spatialrelation"] as const, - /** Create spatialRelation mutation key */create: () => ["mutation", "spatialrelation", "create"] as const, - /** Update spatialRelation mutation key */update: (id: string | number) => ["mutation", "spatialrelation", "update", id] as const, - /** Delete spatialRelation mutation key */delete: (id: string | number) => ["mutation", "spatialrelation", "delete", id] as const + /** All spatialRelation mutation keys */ all: ['mutation', 'spatialrelation'] as const, + /** Create spatialRelation mutation key */ create: () => + ['mutation', 'spatialrelation', 'create'] as const, + /** Update spatialRelation mutation key */ update: (id: string | number) => + ['mutation', 'spatialrelation', 'update', id] as const, + /** Delete spatialRelation mutation key */ delete: (id: string | number) => + ['mutation', 'spatialrelation', 'delete', id] as const, } as const; export const sqlActionMutationKeys = { - /** All sqlAction mutation keys */all: ["mutation", "sqlaction"] as const, - /** Create sqlAction mutation key */create: () => ["mutation", "sqlaction", "create"] as const, - /** Update sqlAction mutation key */update: (id: string | number) => ["mutation", "sqlaction", "update", id] as const, - /** Delete sqlAction mutation key */delete: (id: string | number) => ["mutation", "sqlaction", "delete", id] as const + /** All sqlAction mutation keys */ all: ['mutation', 'sqlaction'] as const, + /** Create sqlAction mutation key */ create: () => ['mutation', 'sqlaction', 'create'] as const, + /** Update sqlAction mutation key */ update: (id: string | number) => + ['mutation', 'sqlaction', 'update', id] as const, + /** Delete sqlAction mutation key */ delete: (id: string | number) => + ['mutation', 'sqlaction', 'delete', id] as const, } as const; export const tableMutationKeys = { - /** All table mutation keys */all: ["mutation", "table"] as const, - /** Create table mutation key */create: () => ["mutation", "table", "create"] as const, - /** Update table mutation key */update: (id: string | number) => ["mutation", "table", "update", id] as const, - /** Delete table mutation key */delete: (id: string | number) => ["mutation", "table", "delete", id] as const + /** All table mutation keys */ all: ['mutation', 'table'] as const, + /** Create table mutation key */ create: () => ['mutation', 'table', 'create'] as const, + /** Update table mutation key */ update: (id: string | number) => + ['mutation', 'table', 'update', id] as const, + /** Delete table mutation key */ delete: (id: string | number) => + ['mutation', 'table', 'delete', id] as const, } as const; export const tableGrantMutationKeys = { - /** All tableGrant mutation keys */all: ["mutation", "tablegrant"] as const, - /** Create tableGrant mutation key */create: () => ["mutation", "tablegrant", "create"] as const, - /** Update tableGrant mutation key */update: (id: string | number) => ["mutation", "tablegrant", "update", id] as const, - /** Delete tableGrant mutation key */delete: (id: string | number) => ["mutation", "tablegrant", "delete", id] as const + /** All tableGrant mutation keys */ all: ['mutation', 'tablegrant'] as const, + /** Create tableGrant mutation key */ create: () => ['mutation', 'tablegrant', 'create'] as const, + /** Update tableGrant mutation key */ update: (id: string | number) => + ['mutation', 'tablegrant', 'update', id] as const, + /** Delete tableGrant mutation key */ delete: (id: string | number) => + ['mutation', 'tablegrant', 'delete', id] as const, } as const; export const triggerMutationKeys = { - /** All trigger mutation keys */all: ["mutation", "trigger"] as const, - /** Create trigger mutation key */create: () => ["mutation", "trigger", "create"] as const, - /** Update trigger mutation key */update: (id: string | number) => ["mutation", "trigger", "update", id] as const, - /** Delete trigger mutation key */delete: (id: string | number) => ["mutation", "trigger", "delete", id] as const + /** All trigger mutation keys */ all: ['mutation', 'trigger'] as const, + /** Create trigger mutation key */ create: () => ['mutation', 'trigger', 'create'] as const, + /** Update trigger mutation key */ update: (id: string | number) => + ['mutation', 'trigger', 'update', id] as const, + /** Delete trigger mutation key */ delete: (id: string | number) => + ['mutation', 'trigger', 'delete', id] as const, } as const; export const triggerFunctionMutationKeys = { - /** All triggerFunction mutation keys */all: ["mutation", "triggerfunction"] as const, - /** Create triggerFunction mutation key */create: () => ["mutation", "triggerfunction", "create"] as const, - /** Update triggerFunction mutation key */update: (id: string | number) => ["mutation", "triggerfunction", "update", id] as const, - /** Delete triggerFunction mutation key */delete: (id: string | number) => ["mutation", "triggerfunction", "delete", id] as const + /** All triggerFunction mutation keys */ all: ['mutation', 'triggerfunction'] as const, + /** Create triggerFunction mutation key */ create: () => + ['mutation', 'triggerfunction', 'create'] as const, + /** Update triggerFunction mutation key */ update: (id: string | number) => + ['mutation', 'triggerfunction', 'update', id] as const, + /** Delete triggerFunction mutation key */ delete: (id: string | number) => + ['mutation', 'triggerfunction', 'delete', id] as const, } as const; export const uniqueConstraintMutationKeys = { - /** All uniqueConstraint mutation keys */all: ["mutation", "uniqueconstraint"] as const, - /** Create uniqueConstraint mutation key */create: () => ["mutation", "uniqueconstraint", "create"] as const, - /** Update uniqueConstraint mutation key */update: (id: string | number) => ["mutation", "uniqueconstraint", "update", id] as const, - /** Delete uniqueConstraint mutation key */delete: (id: string | number) => ["mutation", "uniqueconstraint", "delete", id] as const + /** All uniqueConstraint mutation keys */ all: ['mutation', 'uniqueconstraint'] as const, + /** Create uniqueConstraint mutation key */ create: () => + ['mutation', 'uniqueconstraint', 'create'] as const, + /** Update uniqueConstraint mutation key */ update: (id: string | number) => + ['mutation', 'uniqueconstraint', 'update', id] as const, + /** Delete uniqueConstraint mutation key */ delete: (id: string | number) => + ['mutation', 'uniqueconstraint', 'delete', id] as const, } as const; export const viewMutationKeys = { - /** All view mutation keys */all: ["mutation", "view"] as const, - /** Create view mutation key */create: () => ["mutation", "view", "create"] as const, - /** Update view mutation key */update: (id: string | number) => ["mutation", "view", "update", id] as const, - /** Delete view mutation key */delete: (id: string | number) => ["mutation", "view", "delete", id] as const + /** All view mutation keys */ all: ['mutation', 'view'] as const, + /** Create view mutation key */ create: () => ['mutation', 'view', 'create'] as const, + /** Update view mutation key */ update: (id: string | number) => + ['mutation', 'view', 'update', id] as const, + /** Delete view mutation key */ delete: (id: string | number) => + ['mutation', 'view', 'delete', id] as const, } as const; export const viewGrantMutationKeys = { - /** All viewGrant mutation keys */all: ["mutation", "viewgrant"] as const, - /** Create viewGrant mutation key */create: () => ["mutation", "viewgrant", "create"] as const, - /** Update viewGrant mutation key */update: (id: string | number) => ["mutation", "viewgrant", "update", id] as const, - /** Delete viewGrant mutation key */delete: (id: string | number) => ["mutation", "viewgrant", "delete", id] as const + /** All viewGrant mutation keys */ all: ['mutation', 'viewgrant'] as const, + /** Create viewGrant mutation key */ create: () => ['mutation', 'viewgrant', 'create'] as const, + /** Update viewGrant mutation key */ update: (id: string | number) => + ['mutation', 'viewgrant', 'update', id] as const, + /** Delete viewGrant mutation key */ delete: (id: string | number) => + ['mutation', 'viewgrant', 'delete', id] as const, } as const; export const viewRuleMutationKeys = { - /** All viewRule mutation keys */all: ["mutation", "viewrule"] as const, - /** Create viewRule mutation key */create: () => ["mutation", "viewrule", "create"] as const, - /** Update viewRule mutation key */update: (id: string | number) => ["mutation", "viewrule", "update", id] as const, - /** Delete viewRule mutation key */delete: (id: string | number) => ["mutation", "viewrule", "delete", id] as const + /** All viewRule mutation keys */ all: ['mutation', 'viewrule'] as const, + /** Create viewRule mutation key */ create: () => ['mutation', 'viewrule', 'create'] as const, + /** Update viewRule mutation key */ update: (id: string | number) => + ['mutation', 'viewrule', 'update', id] as const, + /** Delete viewRule mutation key */ delete: (id: string | number) => + ['mutation', 'viewrule', 'delete', id] as const, } as const; export const viewTableMutationKeys = { - /** All viewTable mutation keys */all: ["mutation", "viewtable"] as const, - /** Create viewTable mutation key */create: () => ["mutation", "viewtable", "create"] as const, - /** Update viewTable mutation key */update: (id: string | number) => ["mutation", "viewtable", "update", id] as const, - /** Delete viewTable mutation key */delete: (id: string | number) => ["mutation", "viewtable", "delete", id] as const + /** All viewTable mutation keys */ all: ['mutation', 'viewtable'] as const, + /** Create viewTable mutation key */ create: () => ['mutation', 'viewtable', 'create'] as const, + /** Update viewTable mutation key */ update: (id: string | number) => + ['mutation', 'viewtable', 'update', id] as const, + /** Delete viewTable mutation key */ delete: (id: string | number) => + ['mutation', 'viewtable', 'delete', id] as const, } as const; export const webauthnSettingMutationKeys = { - /** All webauthnSetting mutation keys */all: ["mutation", "webauthnsetting"] as const, - /** Create webauthnSetting mutation key */create: () => ["mutation", "webauthnsetting", "create"] as const, - /** Update webauthnSetting mutation key */update: (id: string | number) => ["mutation", "webauthnsetting", "update", id] as const, - /** Delete webauthnSetting mutation key */delete: (id: string | number) => ["mutation", "webauthnsetting", "delete", id] as const + /** All webauthnSetting mutation keys */ all: ['mutation', 'webauthnsetting'] as const, + /** Create webauthnSetting mutation key */ create: () => + ['mutation', 'webauthnsetting', 'create'] as const, + /** Update webauthnSetting mutation key */ update: (id: string | number) => + ['mutation', 'webauthnsetting', 'update', id] as const, + /** Delete webauthnSetting mutation key */ delete: (id: string | number) => + ['mutation', 'webauthnsetting', 'delete', id] as const, } as const; // ============================================================================ @@ -414,13 +591,34 @@ export const webauthnSettingMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for acceptDatabaseTransfer */acceptDatabaseTransfer: (identifier?: string) => identifier ? ["mutation", "acceptDatabaseTransfer", identifier] as const : ["mutation", "acceptDatabaseTransfer"] as const, - /** Mutation key for applyRls */applyRls: (identifier?: string) => identifier ? ["mutation", "applyRls", identifier] as const : ["mutation", "applyRls"] as const, - /** Mutation key for cancelDatabaseTransfer */cancelDatabaseTransfer: (identifier?: string) => identifier ? ["mutation", "cancelDatabaseTransfer", identifier] as const : ["mutation", "cancelDatabaseTransfer"] as const, - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const, - /** Mutation key for rejectDatabaseTransfer */rejectDatabaseTransfer: (identifier?: string) => identifier ? ["mutation", "rejectDatabaseTransfer", identifier] as const : ["mutation", "rejectDatabaseTransfer"] as const, - /** Mutation key for requestDatabase */requestDatabase: (identifier?: string) => identifier ? ["mutation", "requestDatabase", identifier] as const : ["mutation", "requestDatabase"] as const, - /** Mutation key for setFieldOrder */setFieldOrder: (identifier?: string) => identifier ? ["mutation", "setFieldOrder", identifier] as const : ["mutation", "setFieldOrder"] as const + /** Mutation key for acceptDatabaseTransfer */ acceptDatabaseTransfer: (identifier?: string) => + identifier + ? (['mutation', 'acceptDatabaseTransfer', identifier] as const) + : (['mutation', 'acceptDatabaseTransfer'] as const), + /** Mutation key for applyRls */ applyRls: (identifier?: string) => + identifier + ? (['mutation', 'applyRls', identifier] as const) + : (['mutation', 'applyRls'] as const), + /** Mutation key for cancelDatabaseTransfer */ cancelDatabaseTransfer: (identifier?: string) => + identifier + ? (['mutation', 'cancelDatabaseTransfer', identifier] as const) + : (['mutation', 'cancelDatabaseTransfer'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), + /** Mutation key for rejectDatabaseTransfer */ rejectDatabaseTransfer: (identifier?: string) => + identifier + ? (['mutation', 'rejectDatabaseTransfer', identifier] as const) + : (['mutation', 'rejectDatabaseTransfer'] as const), + /** Mutation key for requestDatabase */ requestDatabase: (identifier?: string) => + identifier + ? (['mutation', 'requestDatabase', identifier] as const) + : (['mutation', 'requestDatabase'] as const), + /** Mutation key for setFieldOrder */ setFieldOrder: (identifier?: string) => + identifier + ? (['mutation', 'setFieldOrder', identifier] as const) + : (['mutation', 'setFieldOrder'] as const), } as const; /** @@ -510,5 +708,5 @@ export const mutationKeys = { viewRule: viewRuleMutationKeys, viewTable: viewTableMutationKeys, webauthnSetting: webauthnSettingMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/api/hooks/mutations/index.ts b/sdk/constructive-react/src/api/hooks/mutations/index.ts index 60157399cb..6ddad50bcf 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/index.ts @@ -3,201 +3,201 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateApiMutation"; -export * from "./useUpdateApiMutation"; -export * from "./useDeleteApiMutation"; -export * from "./useCreateApiModuleMutation"; -export * from "./useUpdateApiModuleMutation"; -export * from "./useDeleteApiModuleMutation"; -export * from "./useCreateApiSchemaMutation"; -export * from "./useUpdateApiSchemaMutation"; -export * from "./useDeleteApiSchemaMutation"; -export * from "./useCreateApiSettingMutation"; -export * from "./useUpdateApiSettingMutation"; -export * from "./useDeleteApiSettingMutation"; -export * from "./useCreateAstMigrationMutation"; -export * from "./useCreateCheckConstraintMutation"; -export * from "./useUpdateCheckConstraintMutation"; -export * from "./useDeleteCheckConstraintMutation"; -export * from "./useCreateCompositeTypeMutation"; -export * from "./useUpdateCompositeTypeMutation"; -export * from "./useDeleteCompositeTypeMutation"; -export * from "./useCreateCorsSettingMutation"; -export * from "./useUpdateCorsSettingMutation"; -export * from "./useDeleteCorsSettingMutation"; -export * from "./useCreateDatabaseMutation"; -export * from "./useUpdateDatabaseMutation"; -export * from "./useDeleteDatabaseMutation"; -export * from "./useCreateDatabaseSettingMutation"; -export * from "./useUpdateDatabaseSettingMutation"; -export * from "./useDeleteDatabaseSettingMutation"; -export * from "./useCreateDatabaseTransferMutation"; -export * from "./useUpdateDatabaseTransferMutation"; -export * from "./useDeleteDatabaseTransferMutation"; -export * from "./useCreateDefaultPrivilegeMutation"; -export * from "./useUpdateDefaultPrivilegeMutation"; -export * from "./useDeleteDefaultPrivilegeMutation"; -export * from "./useCreateDomainMutation"; -export * from "./useUpdateDomainMutation"; -export * from "./useDeleteDomainMutation"; -export * from "./useCreateDomainEventMutation"; -export * from "./useUpdateDomainEventMutation"; -export * from "./useDeleteDomainEventMutation"; -export * from "./useCreateDomainVerificationMutation"; -export * from "./useUpdateDomainVerificationMutation"; -export * from "./useDeleteDomainVerificationMutation"; -export * from "./useCreateEmbeddingChunkMutation"; -export * from "./useUpdateEmbeddingChunkMutation"; -export * from "./useDeleteEmbeddingChunkMutation"; -export * from "./useCreateEnumMutation"; -export * from "./useUpdateEnumMutation"; -export * from "./useDeleteEnumMutation"; -export * from "./useCreateExclusionConstraintMutation"; -export * from "./useUpdateExclusionConstraintMutation"; -export * from "./useDeleteExclusionConstraintMutation"; -export * from "./useCreateFieldMutation"; -export * from "./useUpdateFieldMutation"; -export * from "./useDeleteFieldMutation"; -export * from "./useCreateForeignKeyConstraintMutation"; -export * from "./useUpdateForeignKeyConstraintMutation"; -export * from "./useDeleteForeignKeyConstraintMutation"; -export * from "./useCreateFullTextSearchMutation"; -export * from "./useUpdateFullTextSearchMutation"; -export * from "./useDeleteFullTextSearchMutation"; -export * from "./useCreateFunctionMutation"; -export * from "./useUpdateFunctionMutation"; -export * from "./useDeleteFunctionMutation"; -export * from "./useCreateHostnameBindingMutation"; -export * from "./useUpdateHostnameBindingMutation"; -export * from "./useDeleteHostnameBindingMutation"; -export * from "./useCreateHttpRouteMutation"; -export * from "./useUpdateHttpRouteMutation"; -export * from "./useDeleteHttpRouteMutation"; -export * from "./useCreateIndexMutation"; -export * from "./useUpdateIndexMutation"; -export * from "./useDeleteIndexMutation"; -export * from "./useCreateManagedDomainMutation"; -export * from "./useUpdateManagedDomainMutation"; -export * from "./useDeleteManagedDomainMutation"; -export * from "./useCreateNodeTypeRegistryMutation"; -export * from "./useUpdateNodeTypeRegistryMutation"; -export * from "./useDeleteNodeTypeRegistryMutation"; -export * from "./useCreatePartitionMutation"; -export * from "./useUpdatePartitionMutation"; -export * from "./useDeletePartitionMutation"; -export * from "./useCreatePlatformApiMutation"; -export * from "./useUpdatePlatformApiMutation"; -export * from "./useDeletePlatformApiMutation"; -export * from "./useCreatePlatformApiModuleMutation"; -export * from "./useUpdatePlatformApiModuleMutation"; -export * from "./useDeletePlatformApiModuleMutation"; -export * from "./useCreatePlatformApiSchemaMutation"; -export * from "./useUpdatePlatformApiSchemaMutation"; -export * from "./useDeletePlatformApiSchemaMutation"; -export * from "./useCreatePlatformApiSettingMutation"; -export * from "./useUpdatePlatformApiSettingMutation"; -export * from "./useDeletePlatformApiSettingMutation"; -export * from "./useCreatePlatformCorsSettingMutation"; -export * from "./useUpdatePlatformCorsSettingMutation"; -export * from "./useDeletePlatformCorsSettingMutation"; -export * from "./useCreatePlatformDomainMutation"; -export * from "./useUpdatePlatformDomainMutation"; -export * from "./useDeletePlatformDomainMutation"; -export * from "./useCreatePlatformDomainEventMutation"; -export * from "./useUpdatePlatformDomainEventMutation"; -export * from "./useDeletePlatformDomainEventMutation"; -export * from "./useCreatePlatformDomainVerificationMutation"; -export * from "./useUpdatePlatformDomainVerificationMutation"; -export * from "./useDeletePlatformDomainVerificationMutation"; -export * from "./useCreatePlatformManagedDomainMutation"; -export * from "./useUpdatePlatformManagedDomainMutation"; -export * from "./useDeletePlatformManagedDomainMutation"; -export * from "./useCreatePlatformSiteMutation"; -export * from "./useUpdatePlatformSiteMutation"; -export * from "./useDeletePlatformSiteMutation"; -export * from "./useCreatePlatformSiteMetadatumMutation"; -export * from "./useUpdatePlatformSiteMetadatumMutation"; -export * from "./useDeletePlatformSiteMetadatumMutation"; -export * from "./useCreatePlatformSiteModuleMutation"; -export * from "./useUpdatePlatformSiteModuleMutation"; -export * from "./useDeletePlatformSiteModuleMutation"; -export * from "./useCreatePlatformSiteThemeMutation"; -export * from "./useUpdatePlatformSiteThemeMutation"; -export * from "./useDeletePlatformSiteThemeMutation"; -export * from "./useCreatePolicyMutation"; -export * from "./useUpdatePolicyMutation"; -export * from "./useDeletePolicyMutation"; -export * from "./useCreatePrimaryKeyConstraintMutation"; -export * from "./useUpdatePrimaryKeyConstraintMutation"; -export * from "./useDeletePrimaryKeyConstraintMutation"; -export * from "./useCreatePubkeySettingMutation"; -export * from "./useUpdatePubkeySettingMutation"; -export * from "./useDeletePubkeySettingMutation"; -export * from "./useCreateRlsSettingMutation"; -export * from "./useUpdateRlsSettingMutation"; -export * from "./useDeleteRlsSettingMutation"; -export * from "./useCreateRouteBindingMutation"; -export * from "./useUpdateRouteBindingMutation"; -export * from "./useDeleteRouteBindingMutation"; -export * from "./useCreateRouteMutation"; -export * from "./useUpdateRouteMutation"; -export * from "./useDeleteRouteMutation"; -export * from "./useCreateSchemaMutation"; -export * from "./useUpdateSchemaMutation"; -export * from "./useDeleteSchemaMutation"; -export * from "./useCreateSchemaGrantMutation"; -export * from "./useUpdateSchemaGrantMutation"; -export * from "./useDeleteSchemaGrantMutation"; -export * from "./useCreateSiteMutation"; -export * from "./useUpdateSiteMutation"; -export * from "./useDeleteSiteMutation"; -export * from "./useCreateSiteMetadatumMutation"; -export * from "./useUpdateSiteMetadatumMutation"; -export * from "./useDeleteSiteMetadatumMutation"; -export * from "./useCreateSiteModuleMutation"; -export * from "./useUpdateSiteModuleMutation"; -export * from "./useDeleteSiteModuleMutation"; -export * from "./useCreateSiteThemeMutation"; -export * from "./useUpdateSiteThemeMutation"; -export * from "./useDeleteSiteThemeMutation"; -export * from "./useCreateSpatialRelationMutation"; -export * from "./useUpdateSpatialRelationMutation"; -export * from "./useDeleteSpatialRelationMutation"; -export * from "./useCreateSqlActionMutation"; -export * from "./useCreateTableMutation"; -export * from "./useUpdateTableMutation"; -export * from "./useDeleteTableMutation"; -export * from "./useCreateTableGrantMutation"; -export * from "./useUpdateTableGrantMutation"; -export * from "./useDeleteTableGrantMutation"; -export * from "./useCreateTriggerMutation"; -export * from "./useUpdateTriggerMutation"; -export * from "./useDeleteTriggerMutation"; -export * from "./useCreateTriggerFunctionMutation"; -export * from "./useUpdateTriggerFunctionMutation"; -export * from "./useDeleteTriggerFunctionMutation"; -export * from "./useCreateUniqueConstraintMutation"; -export * from "./useUpdateUniqueConstraintMutation"; -export * from "./useDeleteUniqueConstraintMutation"; -export * from "./useCreateViewMutation"; -export * from "./useUpdateViewMutation"; -export * from "./useDeleteViewMutation"; -export * from "./useCreateViewGrantMutation"; -export * from "./useUpdateViewGrantMutation"; -export * from "./useDeleteViewGrantMutation"; -export * from "./useCreateViewRuleMutation"; -export * from "./useUpdateViewRuleMutation"; -export * from "./useDeleteViewRuleMutation"; -export * from "./useCreateViewTableMutation"; -export * from "./useUpdateViewTableMutation"; -export * from "./useDeleteViewTableMutation"; -export * from "./useCreateWebauthnSettingMutation"; -export * from "./useUpdateWebauthnSettingMutation"; -export * from "./useDeleteWebauthnSettingMutation"; -export * from "./useAcceptDatabaseTransferMutation"; -export * from "./useApplyRlsMutation"; -export * from "./useCancelDatabaseTransferMutation"; -export * from "./useProvisionBucketMutation"; -export * from "./useRejectDatabaseTransferMutation"; -export * from "./useRequestDatabaseMutation"; -export * from "./useSetFieldOrderMutation"; \ No newline at end of file +export * from './useCreateApiMutation'; +export * from './useUpdateApiMutation'; +export * from './useDeleteApiMutation'; +export * from './useCreateApiModuleMutation'; +export * from './useUpdateApiModuleMutation'; +export * from './useDeleteApiModuleMutation'; +export * from './useCreateApiSchemaMutation'; +export * from './useUpdateApiSchemaMutation'; +export * from './useDeleteApiSchemaMutation'; +export * from './useCreateApiSettingMutation'; +export * from './useUpdateApiSettingMutation'; +export * from './useDeleteApiSettingMutation'; +export * from './useCreateAstMigrationMutation'; +export * from './useCreateCheckConstraintMutation'; +export * from './useUpdateCheckConstraintMutation'; +export * from './useDeleteCheckConstraintMutation'; +export * from './useCreateCompositeTypeMutation'; +export * from './useUpdateCompositeTypeMutation'; +export * from './useDeleteCompositeTypeMutation'; +export * from './useCreateCorsSettingMutation'; +export * from './useUpdateCorsSettingMutation'; +export * from './useDeleteCorsSettingMutation'; +export * from './useCreateDatabaseMutation'; +export * from './useUpdateDatabaseMutation'; +export * from './useDeleteDatabaseMutation'; +export * from './useCreateDatabaseSettingMutation'; +export * from './useUpdateDatabaseSettingMutation'; +export * from './useDeleteDatabaseSettingMutation'; +export * from './useCreateDatabaseTransferMutation'; +export * from './useUpdateDatabaseTransferMutation'; +export * from './useDeleteDatabaseTransferMutation'; +export * from './useCreateDefaultPrivilegeMutation'; +export * from './useUpdateDefaultPrivilegeMutation'; +export * from './useDeleteDefaultPrivilegeMutation'; +export * from './useCreateDomainMutation'; +export * from './useUpdateDomainMutation'; +export * from './useDeleteDomainMutation'; +export * from './useCreateDomainEventMutation'; +export * from './useUpdateDomainEventMutation'; +export * from './useDeleteDomainEventMutation'; +export * from './useCreateDomainVerificationMutation'; +export * from './useUpdateDomainVerificationMutation'; +export * from './useDeleteDomainVerificationMutation'; +export * from './useCreateEmbeddingChunkMutation'; +export * from './useUpdateEmbeddingChunkMutation'; +export * from './useDeleteEmbeddingChunkMutation'; +export * from './useCreateEnumMutation'; +export * from './useUpdateEnumMutation'; +export * from './useDeleteEnumMutation'; +export * from './useCreateExclusionConstraintMutation'; +export * from './useUpdateExclusionConstraintMutation'; +export * from './useDeleteExclusionConstraintMutation'; +export * from './useCreateFieldMutation'; +export * from './useUpdateFieldMutation'; +export * from './useDeleteFieldMutation'; +export * from './useCreateForeignKeyConstraintMutation'; +export * from './useUpdateForeignKeyConstraintMutation'; +export * from './useDeleteForeignKeyConstraintMutation'; +export * from './useCreateFullTextSearchMutation'; +export * from './useUpdateFullTextSearchMutation'; +export * from './useDeleteFullTextSearchMutation'; +export * from './useCreateFunctionMutation'; +export * from './useUpdateFunctionMutation'; +export * from './useDeleteFunctionMutation'; +export * from './useCreateHostnameBindingMutation'; +export * from './useUpdateHostnameBindingMutation'; +export * from './useDeleteHostnameBindingMutation'; +export * from './useCreateHttpRouteMutation'; +export * from './useUpdateHttpRouteMutation'; +export * from './useDeleteHttpRouteMutation'; +export * from './useCreateIndexMutation'; +export * from './useUpdateIndexMutation'; +export * from './useDeleteIndexMutation'; +export * from './useCreateManagedDomainMutation'; +export * from './useUpdateManagedDomainMutation'; +export * from './useDeleteManagedDomainMutation'; +export * from './useCreateNodeTypeRegistryMutation'; +export * from './useUpdateNodeTypeRegistryMutation'; +export * from './useDeleteNodeTypeRegistryMutation'; +export * from './useCreatePartitionMutation'; +export * from './useUpdatePartitionMutation'; +export * from './useDeletePartitionMutation'; +export * from './useCreatePlatformApiMutation'; +export * from './useUpdatePlatformApiMutation'; +export * from './useDeletePlatformApiMutation'; +export * from './useCreatePlatformApiModuleMutation'; +export * from './useUpdatePlatformApiModuleMutation'; +export * from './useDeletePlatformApiModuleMutation'; +export * from './useCreatePlatformApiSchemaMutation'; +export * from './useUpdatePlatformApiSchemaMutation'; +export * from './useDeletePlatformApiSchemaMutation'; +export * from './useCreatePlatformApiSettingMutation'; +export * from './useUpdatePlatformApiSettingMutation'; +export * from './useDeletePlatformApiSettingMutation'; +export * from './useCreatePlatformCorsSettingMutation'; +export * from './useUpdatePlatformCorsSettingMutation'; +export * from './useDeletePlatformCorsSettingMutation'; +export * from './useCreatePlatformDomainMutation'; +export * from './useUpdatePlatformDomainMutation'; +export * from './useDeletePlatformDomainMutation'; +export * from './useCreatePlatformDomainEventMutation'; +export * from './useUpdatePlatformDomainEventMutation'; +export * from './useDeletePlatformDomainEventMutation'; +export * from './useCreatePlatformDomainVerificationMutation'; +export * from './useUpdatePlatformDomainVerificationMutation'; +export * from './useDeletePlatformDomainVerificationMutation'; +export * from './useCreatePlatformManagedDomainMutation'; +export * from './useUpdatePlatformManagedDomainMutation'; +export * from './useDeletePlatformManagedDomainMutation'; +export * from './useCreatePlatformSiteMutation'; +export * from './useUpdatePlatformSiteMutation'; +export * from './useDeletePlatformSiteMutation'; +export * from './useCreatePlatformSiteMetadatumMutation'; +export * from './useUpdatePlatformSiteMetadatumMutation'; +export * from './useDeletePlatformSiteMetadatumMutation'; +export * from './useCreatePlatformSiteModuleMutation'; +export * from './useUpdatePlatformSiteModuleMutation'; +export * from './useDeletePlatformSiteModuleMutation'; +export * from './useCreatePlatformSiteThemeMutation'; +export * from './useUpdatePlatformSiteThemeMutation'; +export * from './useDeletePlatformSiteThemeMutation'; +export * from './useCreatePolicyMutation'; +export * from './useUpdatePolicyMutation'; +export * from './useDeletePolicyMutation'; +export * from './useCreatePrimaryKeyConstraintMutation'; +export * from './useUpdatePrimaryKeyConstraintMutation'; +export * from './useDeletePrimaryKeyConstraintMutation'; +export * from './useCreatePubkeySettingMutation'; +export * from './useUpdatePubkeySettingMutation'; +export * from './useDeletePubkeySettingMutation'; +export * from './useCreateRlsSettingMutation'; +export * from './useUpdateRlsSettingMutation'; +export * from './useDeleteRlsSettingMutation'; +export * from './useCreateRouteBindingMutation'; +export * from './useUpdateRouteBindingMutation'; +export * from './useDeleteRouteBindingMutation'; +export * from './useCreateRouteMutation'; +export * from './useUpdateRouteMutation'; +export * from './useDeleteRouteMutation'; +export * from './useCreateSchemaMutation'; +export * from './useUpdateSchemaMutation'; +export * from './useDeleteSchemaMutation'; +export * from './useCreateSchemaGrantMutation'; +export * from './useUpdateSchemaGrantMutation'; +export * from './useDeleteSchemaGrantMutation'; +export * from './useCreateSiteMutation'; +export * from './useUpdateSiteMutation'; +export * from './useDeleteSiteMutation'; +export * from './useCreateSiteMetadatumMutation'; +export * from './useUpdateSiteMetadatumMutation'; +export * from './useDeleteSiteMetadatumMutation'; +export * from './useCreateSiteModuleMutation'; +export * from './useUpdateSiteModuleMutation'; +export * from './useDeleteSiteModuleMutation'; +export * from './useCreateSiteThemeMutation'; +export * from './useUpdateSiteThemeMutation'; +export * from './useDeleteSiteThemeMutation'; +export * from './useCreateSpatialRelationMutation'; +export * from './useUpdateSpatialRelationMutation'; +export * from './useDeleteSpatialRelationMutation'; +export * from './useCreateSqlActionMutation'; +export * from './useCreateTableMutation'; +export * from './useUpdateTableMutation'; +export * from './useDeleteTableMutation'; +export * from './useCreateTableGrantMutation'; +export * from './useUpdateTableGrantMutation'; +export * from './useDeleteTableGrantMutation'; +export * from './useCreateTriggerMutation'; +export * from './useUpdateTriggerMutation'; +export * from './useDeleteTriggerMutation'; +export * from './useCreateTriggerFunctionMutation'; +export * from './useUpdateTriggerFunctionMutation'; +export * from './useDeleteTriggerFunctionMutation'; +export * from './useCreateUniqueConstraintMutation'; +export * from './useUpdateUniqueConstraintMutation'; +export * from './useDeleteUniqueConstraintMutation'; +export * from './useCreateViewMutation'; +export * from './useUpdateViewMutation'; +export * from './useDeleteViewMutation'; +export * from './useCreateViewGrantMutation'; +export * from './useUpdateViewGrantMutation'; +export * from './useDeleteViewGrantMutation'; +export * from './useCreateViewRuleMutation'; +export * from './useUpdateViewRuleMutation'; +export * from './useDeleteViewRuleMutation'; +export * from './useCreateViewTableMutation'; +export * from './useUpdateViewTableMutation'; +export * from './useDeleteViewTableMutation'; +export * from './useCreateWebauthnSettingMutation'; +export * from './useUpdateWebauthnSettingMutation'; +export * from './useDeleteWebauthnSettingMutation'; +export * from './useAcceptDatabaseTransferMutation'; +export * from './useApplyRlsMutation'; +export * from './useCancelDatabaseTransferMutation'; +export * from './useProvisionBucketMutation'; +export * from './useRejectDatabaseTransferMutation'; +export * from './useRequestDatabaseMutation'; +export * from './useSetFieldOrderMutation'; diff --git a/sdk/constructive-react/src/api/hooks/mutations/useAcceptDatabaseTransferMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useAcceptDatabaseTransferMutation.ts index 435c85c722..c31146bfe5 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useAcceptDatabaseTransferMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useAcceptDatabaseTransferMutation.ts @@ -4,39 +4,55 @@ * 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 { AcceptDatabaseTransferVariables } from "../../orm/mutation"; -import type { AcceptDatabaseTransferPayloadSelect, AcceptDatabaseTransferPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { AcceptDatabaseTransferVariables } from "../../orm/mutation"; -export type { AcceptDatabaseTransferPayloadSelect } from "../../orm/input-types"; -export function useAcceptDatabaseTransferMutation(params: { - selection: ({ - fields: S & AcceptDatabaseTransferPayloadSelect; - } & HookStrictSelect, AcceptDatabaseTransferPayloadSelect>); -} & Omit | null; -}, Error, AcceptDatabaseTransferVariables>, "mutationFn">): UseMutationResult<{ - acceptDatabaseTransfer: InferSelectResult | null; -}, Error, AcceptDatabaseTransferVariables> { +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 { AcceptDatabaseTransferVariables } from '../../orm/mutation'; +import type { + AcceptDatabaseTransferPayloadSelect, + AcceptDatabaseTransferPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AcceptDatabaseTransferVariables } from '../../orm/mutation'; +export type { AcceptDatabaseTransferPayloadSelect } from '../../orm/input-types'; +export function useAcceptDatabaseTransferMutation( + params: { + selection: { + fields: S & AcceptDatabaseTransferPayloadSelect; + } & HookStrictSelect, AcceptDatabaseTransferPayloadSelect>; + } & Omit< + UseMutationOptions< + { + acceptDatabaseTransfer: InferSelectResult | null; + }, + Error, + AcceptDatabaseTransferVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + acceptDatabaseTransfer: InferSelectResult | null; + }, + Error, + AcceptDatabaseTransferVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.acceptDatabaseTransfer(), - mutationFn: (variables: AcceptDatabaseTransferVariables) => getClient().mutation.acceptDatabaseTransfer(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: AcceptDatabaseTransferVariables) => + getClient() + .mutation.acceptDatabaseTransfer(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useApplyRlsMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useApplyRlsMutation.ts index 288e73df44..615b86adb8 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useApplyRlsMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useApplyRlsMutation.ts @@ -4,39 +4,52 @@ * 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 { ApplyRlsVariables } from "../../orm/mutation"; -import type { ApplyRlsPayloadSelect, ApplyRlsPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ApplyRlsVariables } from "../../orm/mutation"; -export type { ApplyRlsPayloadSelect } from "../../orm/input-types"; -export function useApplyRlsMutation(params: { - selection: ({ - fields: S & ApplyRlsPayloadSelect; - } & HookStrictSelect, ApplyRlsPayloadSelect>); -} & Omit | null; -}, Error, ApplyRlsVariables>, "mutationFn">): UseMutationResult<{ - applyRls: InferSelectResult | null; -}, Error, ApplyRlsVariables> { +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 { ApplyRlsVariables } from '../../orm/mutation'; +import type { ApplyRlsPayloadSelect, ApplyRlsPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ApplyRlsVariables } from '../../orm/mutation'; +export type { ApplyRlsPayloadSelect } from '../../orm/input-types'; +export function useApplyRlsMutation( + params: { + selection: { + fields: S & ApplyRlsPayloadSelect; + } & HookStrictSelect, ApplyRlsPayloadSelect>; + } & Omit< + UseMutationOptions< + { + applyRls: InferSelectResult | null; + }, + Error, + ApplyRlsVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + applyRls: InferSelectResult | null; + }, + Error, + ApplyRlsVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.applyRls(), - mutationFn: (variables: ApplyRlsVariables) => getClient().mutation.applyRls(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ApplyRlsVariables) => + getClient() + .mutation.applyRls(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCancelDatabaseTransferMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCancelDatabaseTransferMutation.ts index 82105f3ba4..99fa89988a 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCancelDatabaseTransferMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCancelDatabaseTransferMutation.ts @@ -4,39 +4,55 @@ * 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 { CancelDatabaseTransferVariables } from "../../orm/mutation"; -import type { CancelDatabaseTransferPayloadSelect, CancelDatabaseTransferPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { CancelDatabaseTransferVariables } from "../../orm/mutation"; -export type { CancelDatabaseTransferPayloadSelect } from "../../orm/input-types"; -export function useCancelDatabaseTransferMutation(params: { - selection: ({ - fields: S & CancelDatabaseTransferPayloadSelect; - } & HookStrictSelect, CancelDatabaseTransferPayloadSelect>); -} & Omit | null; -}, Error, CancelDatabaseTransferVariables>, "mutationFn">): UseMutationResult<{ - cancelDatabaseTransfer: InferSelectResult | null; -}, Error, CancelDatabaseTransferVariables> { +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 { CancelDatabaseTransferVariables } from '../../orm/mutation'; +import type { + CancelDatabaseTransferPayloadSelect, + CancelDatabaseTransferPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { CancelDatabaseTransferVariables } from '../../orm/mutation'; +export type { CancelDatabaseTransferPayloadSelect } from '../../orm/input-types'; +export function useCancelDatabaseTransferMutation( + params: { + selection: { + fields: S & CancelDatabaseTransferPayloadSelect; + } & HookStrictSelect, CancelDatabaseTransferPayloadSelect>; + } & Omit< + UseMutationOptions< + { + cancelDatabaseTransfer: InferSelectResult | null; + }, + Error, + CancelDatabaseTransferVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + cancelDatabaseTransfer: InferSelectResult | null; + }, + Error, + CancelDatabaseTransferVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.cancelDatabaseTransfer(), - mutationFn: (variables: CancelDatabaseTransferVariables) => getClient().mutation.cancelDatabaseTransfer(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: CancelDatabaseTransferVariables) => + getClient() + .mutation.cancelDatabaseTransfer(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateApiModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateApiModuleMutation.ts index 8a26642113..6ad8d0df99 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateApiModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateApiModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { apiModuleKeys } from "../query-keys"; -import { apiModuleMutationKeys } from "../mutation-keys"; -import type { ApiModuleSelect, ApiModuleWithRelations, CreateApiModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiModuleSelect, ApiModuleWithRelations, CreateApiModuleInput } from "../../orm/input-types"; +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 { apiModuleKeys } from '../query-keys'; +import { apiModuleMutationKeys } from '../mutation-keys'; +import type { + ApiModuleSelect, + ApiModuleWithRelations, + CreateApiModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ApiModuleSelect, + ApiModuleWithRelations, + CreateApiModuleInput, +} from '../../orm/input-types'; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useCreateApiModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateApiModuleMutation(params: { - selection: ({ - fields: S & ApiModuleSelect; - } & HookStrictSelect, ApiModuleSelect>); -} & Omit; - }; -}, Error, CreateApiModuleInput["apiModule"]>, "mutationFn">): UseMutationResult<{ - createApiModule: { - apiModule: InferSelectResult; - }; -}, Error, CreateApiModuleInput["apiModule"]>; -export function useCreateApiModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateApiModuleMutation( + params: { + selection: { + fields: S & ApiModuleSelect; + } & HookStrictSelect, ApiModuleSelect>; + } & Omit< + UseMutationOptions< + { + createApiModule: { + apiModule: InferSelectResult; + }; + }, + Error, + CreateApiModuleInput['apiModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createApiModule: { + apiModule: InferSelectResult; + }; + }, + Error, + CreateApiModuleInput['apiModule'] +>; +export function useCreateApiModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiModuleMutationKeys.create(), - mutationFn: (data: CreateApiModuleInput["apiModule"]) => getClient().apiModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateApiModuleInput['apiModule']) => + getClient() + .apiModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: apiModuleKeys.lists() + queryKey: apiModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateApiMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateApiMutation.ts index 4c5f022718..1ffaaef3f9 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateApiMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateApiMutation.ts @@ -4,62 +4,77 @@ * 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 { apiKeys } from "../query-keys"; -import { apiMutationKeys } from "../mutation-keys"; -import type { ApiSelect, ApiWithRelations, CreateApiInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSelect, ApiWithRelations, CreateApiInput } from "../../orm/input-types"; +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 { apiKeys } from '../query-keys'; +import { apiMutationKeys } from '../mutation-keys'; +import type { ApiSelect, ApiWithRelations, CreateApiInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSelect, ApiWithRelations, CreateApiInput } from '../../orm/input-types'; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useCreateApiMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateApiMutation(params: { - selection: ({ - fields: S & ApiSelect; - } & HookStrictSelect, ApiSelect>); -} & Omit; - }; -}, Error, CreateApiInput["api"]>, "mutationFn">): UseMutationResult<{ - createApi: { - api: InferSelectResult; - }; -}, Error, CreateApiInput["api"]>; -export function useCreateApiMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateApiMutation( + params: { + selection: { + fields: S & ApiSelect; + } & HookStrictSelect, ApiSelect>; + } & Omit< + UseMutationOptions< + { + createApi: { + api: InferSelectResult; + }; + }, + Error, + CreateApiInput['api'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createApi: { + api: InferSelectResult; + }; + }, + Error, + CreateApiInput['api'] +>; +export function useCreateApiMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiMutationKeys.create(), - mutationFn: (data: CreateApiInput["api"]) => getClient().api.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateApiInput['api']) => + getClient() + .api.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: apiKeys.lists() + queryKey: apiKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateApiSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateApiSchemaMutation.ts index 7d648b2862..47551e5271 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateApiSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateApiSchemaMutation.ts @@ -4,62 +4,85 @@ * 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 { apiSchemaKeys } from "../query-keys"; -import { apiSchemaMutationKeys } from "../mutation-keys"; -import type { ApiSchemaSelect, ApiSchemaWithRelations, CreateApiSchemaInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSchemaSelect, ApiSchemaWithRelations, CreateApiSchemaInput } from "../../orm/input-types"; +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 { apiSchemaKeys } from '../query-keys'; +import { apiSchemaMutationKeys } from '../mutation-keys'; +import type { + ApiSchemaSelect, + ApiSchemaWithRelations, + CreateApiSchemaInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ApiSchemaSelect, + ApiSchemaWithRelations, + CreateApiSchemaInput, +} from '../../orm/input-types'; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { mutate, isPending } = useCreateApiSchemaMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateApiSchemaMutation(params: { - selection: ({ - fields: S & ApiSchemaSelect; - } & HookStrictSelect, ApiSchemaSelect>); -} & Omit; - }; -}, Error, CreateApiSchemaInput["apiSchema"]>, "mutationFn">): UseMutationResult<{ - createApiSchema: { - apiSchema: InferSelectResult; - }; -}, Error, CreateApiSchemaInput["apiSchema"]>; -export function useCreateApiSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateApiSchemaMutation( + params: { + selection: { + fields: S & ApiSchemaSelect; + } & HookStrictSelect, ApiSchemaSelect>; + } & Omit< + UseMutationOptions< + { + createApiSchema: { + apiSchema: InferSelectResult; + }; + }, + Error, + CreateApiSchemaInput['apiSchema'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createApiSchema: { + apiSchema: InferSelectResult; + }; + }, + Error, + CreateApiSchemaInput['apiSchema'] +>; +export function useCreateApiSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSchemaMutationKeys.create(), - mutationFn: (data: CreateApiSchemaInput["apiSchema"]) => getClient().apiSchema.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateApiSchemaInput['apiSchema']) => + getClient() + .apiSchema.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: apiSchemaKeys.lists() + queryKey: apiSchemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateApiSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateApiSettingMutation.ts index 3d2335f218..efdc4740dc 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateApiSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateApiSettingMutation.ts @@ -4,62 +4,85 @@ * 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 { apiSettingKeys } from "../query-keys"; -import { apiSettingMutationKeys } from "../mutation-keys"; -import type { ApiSettingSelect, ApiSettingWithRelations, CreateApiSettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSettingSelect, ApiSettingWithRelations, CreateApiSettingInput } from "../../orm/input-types"; +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 { apiSettingKeys } from '../query-keys'; +import { apiSettingMutationKeys } from '../mutation-keys'; +import type { + ApiSettingSelect, + ApiSettingWithRelations, + CreateApiSettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ApiSettingSelect, + ApiSettingWithRelations, + CreateApiSettingInput, +} from '../../orm/input-types'; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { mutate, isPending } = useCreateApiSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateApiSettingMutation(params: { - selection: ({ - fields: S & ApiSettingSelect; - } & HookStrictSelect, ApiSettingSelect>); -} & Omit; - }; -}, Error, CreateApiSettingInput["apiSetting"]>, "mutationFn">): UseMutationResult<{ - createApiSetting: { - apiSetting: InferSelectResult; - }; -}, Error, CreateApiSettingInput["apiSetting"]>; -export function useCreateApiSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateApiSettingMutation( + params: { + selection: { + fields: S & ApiSettingSelect; + } & HookStrictSelect, ApiSettingSelect>; + } & Omit< + UseMutationOptions< + { + createApiSetting: { + apiSetting: InferSelectResult; + }; + }, + Error, + CreateApiSettingInput['apiSetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createApiSetting: { + apiSetting: InferSelectResult; + }; + }, + Error, + CreateApiSettingInput['apiSetting'] +>; +export function useCreateApiSettingMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSettingMutationKeys.create(), - mutationFn: (data: CreateApiSettingInput["apiSetting"]) => getClient().apiSetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateApiSettingInput['apiSetting']) => + getClient() + .apiSetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: apiSettingKeys.lists() + queryKey: apiSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateAstMigrationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateAstMigrationMutation.ts index b08dbc9397..7f9caacb12 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateAstMigrationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateAstMigrationMutation.ts @@ -4,62 +4,85 @@ * 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 { astMigrationKeys } from "../query-keys"; -import { astMigrationMutationKeys } from "../mutation-keys"; -import type { AstMigrationSelect, AstMigrationWithRelations, CreateAstMigrationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AstMigrationSelect, AstMigrationWithRelations, CreateAstMigrationInput } from "../../orm/input-types"; +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 { astMigrationKeys } from '../query-keys'; +import { astMigrationMutationKeys } from '../mutation-keys'; +import type { + AstMigrationSelect, + AstMigrationWithRelations, + CreateAstMigrationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AstMigrationSelect, + AstMigrationWithRelations, + CreateAstMigrationInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a AstMigration - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAstMigrationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAstMigrationMutation(params: { - selection: ({ - fields: S & AstMigrationSelect; - } & HookStrictSelect, AstMigrationSelect>); -} & Omit; - }; -}, Error, CreateAstMigrationInput["astMigration"]>, "mutationFn">): UseMutationResult<{ - createAstMigration: { - astMigration: InferSelectResult; - }; -}, Error, CreateAstMigrationInput["astMigration"]>; -export function useCreateAstMigrationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAstMigrationMutation( + params: { + selection: { + fields: S & AstMigrationSelect; + } & HookStrictSelect, AstMigrationSelect>; + } & Omit< + UseMutationOptions< + { + createAstMigration: { + astMigration: InferSelectResult; + }; + }, + Error, + CreateAstMigrationInput['astMigration'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAstMigration: { + astMigration: InferSelectResult; + }; + }, + Error, + CreateAstMigrationInput['astMigration'] +>; +export function useCreateAstMigrationMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: astMigrationMutationKeys.create(), - mutationFn: (data: CreateAstMigrationInput["astMigration"]) => getClient().astMigration.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAstMigrationInput['astMigration']) => + getClient() + .astMigration.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: astMigrationKeys.lists() + queryKey: astMigrationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateCheckConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateCheckConstraintMutation.ts index 5d86998f56..a20cc1e673 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateCheckConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateCheckConstraintMutation.ts @@ -4,62 +4,88 @@ * 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 { checkConstraintKeys } from "../query-keys"; -import { checkConstraintMutationKeys } from "../mutation-keys"; -import type { CheckConstraintSelect, CheckConstraintWithRelations, CreateCheckConstraintInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CheckConstraintSelect, CheckConstraintWithRelations, CreateCheckConstraintInput } from "../../orm/input-types"; +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 { checkConstraintKeys } from '../query-keys'; +import { checkConstraintMutationKeys } from '../mutation-keys'; +import type { + CheckConstraintSelect, + CheckConstraintWithRelations, + CreateCheckConstraintInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CheckConstraintSelect, + CheckConstraintWithRelations, + CreateCheckConstraintInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a CheckConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useCreateCheckConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateCheckConstraintMutation(params: { - selection: ({ - fields: S & CheckConstraintSelect; - } & HookStrictSelect, CheckConstraintSelect>); -} & Omit; - }; -}, Error, CreateCheckConstraintInput["checkConstraint"]>, "mutationFn">): UseMutationResult<{ - createCheckConstraint: { - checkConstraint: InferSelectResult; - }; -}, Error, CreateCheckConstraintInput["checkConstraint"]>; -export function useCreateCheckConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateCheckConstraintMutation( + params: { + selection: { + fields: S & CheckConstraintSelect; + } & HookStrictSelect, CheckConstraintSelect>; + } & Omit< + UseMutationOptions< + { + createCheckConstraint: { + checkConstraint: InferSelectResult; + }; + }, + Error, + CreateCheckConstraintInput['checkConstraint'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createCheckConstraint: { + checkConstraint: InferSelectResult; + }; + }, + Error, + CreateCheckConstraintInput['checkConstraint'] +>; +export function useCreateCheckConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: checkConstraintMutationKeys.create(), - mutationFn: (data: CreateCheckConstraintInput["checkConstraint"]) => getClient().checkConstraint.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateCheckConstraintInput['checkConstraint']) => + getClient() + .checkConstraint.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: checkConstraintKeys.lists() + queryKey: checkConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateCompositeTypeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateCompositeTypeMutation.ts index 4668ca0b76..732077fc88 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateCompositeTypeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateCompositeTypeMutation.ts @@ -4,62 +4,85 @@ * 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 { compositeTypeKeys } from "../query-keys"; -import { compositeTypeMutationKeys } from "../mutation-keys"; -import type { CompositeTypeSelect, CompositeTypeWithRelations, CreateCompositeTypeInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CompositeTypeSelect, CompositeTypeWithRelations, CreateCompositeTypeInput } from "../../orm/input-types"; +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 { compositeTypeKeys } from '../query-keys'; +import { compositeTypeMutationKeys } from '../mutation-keys'; +import type { + CompositeTypeSelect, + CompositeTypeWithRelations, + CreateCompositeTypeInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CompositeTypeSelect, + CompositeTypeWithRelations, + CreateCompositeTypeInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a CompositeType - * + * * @example * ```tsx * const { mutate, isPending } = useCreateCompositeTypeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateCompositeTypeMutation(params: { - selection: ({ - fields: S & CompositeTypeSelect; - } & HookStrictSelect, CompositeTypeSelect>); -} & Omit; - }; -}, Error, CreateCompositeTypeInput["compositeType"]>, "mutationFn">): UseMutationResult<{ - createCompositeType: { - compositeType: InferSelectResult; - }; -}, Error, CreateCompositeTypeInput["compositeType"]>; -export function useCreateCompositeTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateCompositeTypeMutation( + params: { + selection: { + fields: S & CompositeTypeSelect; + } & HookStrictSelect, CompositeTypeSelect>; + } & Omit< + UseMutationOptions< + { + createCompositeType: { + compositeType: InferSelectResult; + }; + }, + Error, + CreateCompositeTypeInput['compositeType'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createCompositeType: { + compositeType: InferSelectResult; + }; + }, + Error, + CreateCompositeTypeInput['compositeType'] +>; +export function useCreateCompositeTypeMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: compositeTypeMutationKeys.create(), - mutationFn: (data: CreateCompositeTypeInput["compositeType"]) => getClient().compositeType.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateCompositeTypeInput['compositeType']) => + getClient() + .compositeType.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: compositeTypeKeys.lists() + queryKey: compositeTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateCorsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateCorsSettingMutation.ts index 7c138bb6fd..8d578d786d 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateCorsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateCorsSettingMutation.ts @@ -4,62 +4,85 @@ * 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 { corsSettingKeys } from "../query-keys"; -import { corsSettingMutationKeys } from "../mutation-keys"; -import type { CorsSettingSelect, CorsSettingWithRelations, CreateCorsSettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CorsSettingSelect, CorsSettingWithRelations, CreateCorsSettingInput } from "../../orm/input-types"; +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 { corsSettingKeys } from '../query-keys'; +import { corsSettingMutationKeys } from '../mutation-keys'; +import type { + CorsSettingSelect, + CorsSettingWithRelations, + CreateCorsSettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CorsSettingSelect, + CorsSettingWithRelations, + CreateCorsSettingInput, +} from '../../orm/input-types'; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { mutate, isPending } = useCreateCorsSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateCorsSettingMutation(params: { - selection: ({ - fields: S & CorsSettingSelect; - } & HookStrictSelect, CorsSettingSelect>); -} & Omit; - }; -}, Error, CreateCorsSettingInput["corsSetting"]>, "mutationFn">): UseMutationResult<{ - createCorsSetting: { - corsSetting: InferSelectResult; - }; -}, Error, CreateCorsSettingInput["corsSetting"]>; -export function useCreateCorsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateCorsSettingMutation( + params: { + selection: { + fields: S & CorsSettingSelect; + } & HookStrictSelect, CorsSettingSelect>; + } & Omit< + UseMutationOptions< + { + createCorsSetting: { + corsSetting: InferSelectResult; + }; + }, + Error, + CreateCorsSettingInput['corsSetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createCorsSetting: { + corsSetting: InferSelectResult; + }; + }, + Error, + CreateCorsSettingInput['corsSetting'] +>; +export function useCreateCorsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: corsSettingMutationKeys.create(), - mutationFn: (data: CreateCorsSettingInput["corsSetting"]) => getClient().corsSetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateCorsSettingInput['corsSetting']) => + getClient() + .corsSetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: corsSettingKeys.lists() + queryKey: corsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseMutation.ts index 7f34cf0fc7..4ec18e908f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseMutation.ts @@ -4,62 +4,85 @@ * 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 { databaseKeys } from "../query-keys"; -import { databaseMutationKeys } from "../mutation-keys"; -import type { DatabaseSelect, DatabaseWithRelations, CreateDatabaseInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSelect, DatabaseWithRelations, CreateDatabaseInput } from "../../orm/input-types"; +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 { databaseKeys } from '../query-keys'; +import { databaseMutationKeys } from '../mutation-keys'; +import type { + DatabaseSelect, + DatabaseWithRelations, + CreateDatabaseInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseSelect, + DatabaseWithRelations, + CreateDatabaseInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a Database - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDatabaseMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDatabaseMutation(params: { - selection: ({ - fields: S & DatabaseSelect; - } & HookStrictSelect, DatabaseSelect>); -} & Omit; - }; -}, Error, CreateDatabaseInput["database"]>, "mutationFn">): UseMutationResult<{ - createDatabase: { - database: InferSelectResult; - }; -}, Error, CreateDatabaseInput["database"]>; -export function useCreateDatabaseMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDatabaseMutation( + params: { + selection: { + fields: S & DatabaseSelect; + } & HookStrictSelect, DatabaseSelect>; + } & Omit< + UseMutationOptions< + { + createDatabase: { + database: InferSelectResult; + }; + }, + Error, + CreateDatabaseInput['database'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDatabase: { + database: InferSelectResult; + }; + }, + Error, + CreateDatabaseInput['database'] +>; +export function useCreateDatabaseMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseMutationKeys.create(), - mutationFn: (data: CreateDatabaseInput["database"]) => getClient().database.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDatabaseInput['database']) => + getClient() + .database.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: databaseKeys.lists() + queryKey: databaseKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseSettingMutation.ts index f93f9f1eaf..c686c56d21 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseSettingMutation.ts @@ -4,62 +4,88 @@ * 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 { databaseSettingKeys } from "../query-keys"; -import { databaseSettingMutationKeys } from "../mutation-keys"; -import type { DatabaseSettingSelect, DatabaseSettingWithRelations, CreateDatabaseSettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingSelect, DatabaseSettingWithRelations, CreateDatabaseSettingInput } from "../../orm/input-types"; +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 { databaseSettingKeys } from '../query-keys'; +import { databaseSettingMutationKeys } from '../mutation-keys'; +import type { + DatabaseSettingSelect, + DatabaseSettingWithRelations, + CreateDatabaseSettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseSettingSelect, + DatabaseSettingWithRelations, + CreateDatabaseSettingInput, +} from '../../orm/input-types'; /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDatabaseSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDatabaseSettingMutation(params: { - selection: ({ - fields: S & DatabaseSettingSelect; - } & HookStrictSelect, DatabaseSettingSelect>); -} & Omit; - }; -}, Error, CreateDatabaseSettingInput["databaseSetting"]>, "mutationFn">): UseMutationResult<{ - createDatabaseSetting: { - databaseSetting: InferSelectResult; - }; -}, Error, CreateDatabaseSettingInput["databaseSetting"]>; -export function useCreateDatabaseSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDatabaseSettingMutation( + params: { + selection: { + fields: S & DatabaseSettingSelect; + } & HookStrictSelect, DatabaseSettingSelect>; + } & Omit< + UseMutationOptions< + { + createDatabaseSetting: { + databaseSetting: InferSelectResult; + }; + }, + Error, + CreateDatabaseSettingInput['databaseSetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDatabaseSetting: { + databaseSetting: InferSelectResult; + }; + }, + Error, + CreateDatabaseSettingInput['databaseSetting'] +>; +export function useCreateDatabaseSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseSettingMutationKeys.create(), - mutationFn: (data: CreateDatabaseSettingInput["databaseSetting"]) => getClient().databaseSetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDatabaseSettingInput['databaseSetting']) => + getClient() + .databaseSetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: databaseSettingKeys.lists() + queryKey: databaseSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseTransferMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseTransferMutation.ts index 3dca59e913..2103fe731c 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseTransferMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateDatabaseTransferMutation.ts @@ -4,62 +4,88 @@ * 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 { databaseTransferKeys } from "../query-keys"; -import { databaseTransferMutationKeys } from "../mutation-keys"; -import type { DatabaseTransferSelect, DatabaseTransferWithRelations, CreateDatabaseTransferInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseTransferSelect, DatabaseTransferWithRelations, CreateDatabaseTransferInput } from "../../orm/input-types"; +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 { databaseTransferKeys } from '../query-keys'; +import { databaseTransferMutationKeys } from '../mutation-keys'; +import type { + DatabaseTransferSelect, + DatabaseTransferWithRelations, + CreateDatabaseTransferInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseTransferSelect, + DatabaseTransferWithRelations, + CreateDatabaseTransferInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DatabaseTransfer - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDatabaseTransferMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDatabaseTransferMutation(params: { - selection: ({ - fields: S & DatabaseTransferSelect; - } & HookStrictSelect, DatabaseTransferSelect>); -} & Omit; - }; -}, Error, CreateDatabaseTransferInput["databaseTransfer"]>, "mutationFn">): UseMutationResult<{ - createDatabaseTransfer: { - databaseTransfer: InferSelectResult; - }; -}, Error, CreateDatabaseTransferInput["databaseTransfer"]>; -export function useCreateDatabaseTransferMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDatabaseTransferMutation( + params: { + selection: { + fields: S & DatabaseTransferSelect; + } & HookStrictSelect, DatabaseTransferSelect>; + } & Omit< + UseMutationOptions< + { + createDatabaseTransfer: { + databaseTransfer: InferSelectResult; + }; + }, + Error, + CreateDatabaseTransferInput['databaseTransfer'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDatabaseTransfer: { + databaseTransfer: InferSelectResult; + }; + }, + Error, + CreateDatabaseTransferInput['databaseTransfer'] +>; +export function useCreateDatabaseTransferMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseTransferMutationKeys.create(), - mutationFn: (data: CreateDatabaseTransferInput["databaseTransfer"]) => getClient().databaseTransfer.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDatabaseTransferInput['databaseTransfer']) => + getClient() + .databaseTransfer.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: databaseTransferKeys.lists() + queryKey: databaseTransferKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateDefaultPrivilegeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateDefaultPrivilegeMutation.ts index 0ec95f3a81..93680bfb21 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateDefaultPrivilegeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateDefaultPrivilegeMutation.ts @@ -4,62 +4,88 @@ * 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 { defaultPrivilegeKeys } from "../query-keys"; -import { defaultPrivilegeMutationKeys } from "../mutation-keys"; -import type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations, CreateDefaultPrivilegeInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations, CreateDefaultPrivilegeInput } from "../../orm/input-types"; +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 { defaultPrivilegeKeys } from '../query-keys'; +import { defaultPrivilegeMutationKeys } from '../mutation-keys'; +import type { + DefaultPrivilegeSelect, + DefaultPrivilegeWithRelations, + CreateDefaultPrivilegeInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DefaultPrivilegeSelect, + DefaultPrivilegeWithRelations, + CreateDefaultPrivilegeInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DefaultPrivilege - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDefaultPrivilegeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDefaultPrivilegeMutation(params: { - selection: ({ - fields: S & DefaultPrivilegeSelect; - } & HookStrictSelect, DefaultPrivilegeSelect>); -} & Omit; - }; -}, Error, CreateDefaultPrivilegeInput["defaultPrivilege"]>, "mutationFn">): UseMutationResult<{ - createDefaultPrivilege: { - defaultPrivilege: InferSelectResult; - }; -}, Error, CreateDefaultPrivilegeInput["defaultPrivilege"]>; -export function useCreateDefaultPrivilegeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDefaultPrivilegeMutation( + params: { + selection: { + fields: S & DefaultPrivilegeSelect; + } & HookStrictSelect, DefaultPrivilegeSelect>; + } & Omit< + UseMutationOptions< + { + createDefaultPrivilege: { + defaultPrivilege: InferSelectResult; + }; + }, + Error, + CreateDefaultPrivilegeInput['defaultPrivilege'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDefaultPrivilege: { + defaultPrivilege: InferSelectResult; + }; + }, + Error, + CreateDefaultPrivilegeInput['defaultPrivilege'] +>; +export function useCreateDefaultPrivilegeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: defaultPrivilegeMutationKeys.create(), - mutationFn: (data: CreateDefaultPrivilegeInput["defaultPrivilege"]) => getClient().defaultPrivilege.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDefaultPrivilegeInput['defaultPrivilege']) => + getClient() + .defaultPrivilege.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: defaultPrivilegeKeys.lists() + queryKey: defaultPrivilegeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainEventMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainEventMutation.ts index 6111db25b4..0b24354ddc 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainEventMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainEventMutation.ts @@ -4,62 +4,85 @@ * 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 { domainEventKeys } from "../query-keys"; -import { domainEventMutationKeys } from "../mutation-keys"; -import type { DomainEventSelect, DomainEventWithRelations, CreateDomainEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainEventSelect, DomainEventWithRelations, CreateDomainEventInput } from "../../orm/input-types"; +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 { domainEventKeys } from '../query-keys'; +import { domainEventMutationKeys } from '../mutation-keys'; +import type { + DomainEventSelect, + DomainEventWithRelations, + CreateDomainEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DomainEventSelect, + DomainEventWithRelations, + CreateDomainEventInput, +} from '../../orm/input-types'; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDomainEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDomainEventMutation(params: { - selection: ({ - fields: S & DomainEventSelect; - } & HookStrictSelect, DomainEventSelect>); -} & Omit; - }; -}, Error, CreateDomainEventInput["domainEvent"]>, "mutationFn">): UseMutationResult<{ - createDomainEvent: { - domainEvent: InferSelectResult; - }; -}, Error, CreateDomainEventInput["domainEvent"]>; -export function useCreateDomainEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDomainEventMutation( + params: { + selection: { + fields: S & DomainEventSelect; + } & HookStrictSelect, DomainEventSelect>; + } & Omit< + UseMutationOptions< + { + createDomainEvent: { + domainEvent: InferSelectResult; + }; + }, + Error, + CreateDomainEventInput['domainEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDomainEvent: { + domainEvent: InferSelectResult; + }; + }, + Error, + CreateDomainEventInput['domainEvent'] +>; +export function useCreateDomainEventMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainEventMutationKeys.create(), - mutationFn: (data: CreateDomainEventInput["domainEvent"]) => getClient().domainEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDomainEventInput['domainEvent']) => + getClient() + .domainEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: domainEventKeys.lists() + queryKey: domainEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainMutation.ts index 23cfdfb035..b9fe926762 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainMutation.ts @@ -4,62 +4,77 @@ * 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 { domainKeys } from "../query-keys"; -import { domainMutationKeys } from "../mutation-keys"; -import type { DomainSelect, DomainWithRelations, CreateDomainInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainSelect, DomainWithRelations, CreateDomainInput } from "../../orm/input-types"; +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 { domainKeys } from '../query-keys'; +import { domainMutationKeys } from '../mutation-keys'; +import type { DomainSelect, DomainWithRelations, CreateDomainInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DomainSelect, DomainWithRelations, CreateDomainInput } from '../../orm/input-types'; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDomainMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDomainMutation(params: { - selection: ({ - fields: S & DomainSelect; - } & HookStrictSelect, DomainSelect>); -} & Omit; - }; -}, Error, CreateDomainInput["domain"]>, "mutationFn">): UseMutationResult<{ - createDomain: { - domain: InferSelectResult; - }; -}, Error, CreateDomainInput["domain"]>; -export function useCreateDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDomainMutation( + params: { + selection: { + fields: S & DomainSelect; + } & HookStrictSelect, DomainSelect>; + } & Omit< + UseMutationOptions< + { + createDomain: { + domain: InferSelectResult; + }; + }, + Error, + CreateDomainInput['domain'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDomain: { + domain: InferSelectResult; + }; + }, + Error, + CreateDomainInput['domain'] +>; +export function useCreateDomainMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainMutationKeys.create(), - mutationFn: (data: CreateDomainInput["domain"]) => getClient().domain.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDomainInput['domain']) => + getClient() + .domain.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: domainKeys.lists() + queryKey: domainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainVerificationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainVerificationMutation.ts index 1d6eb48a46..c6f25b05ea 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainVerificationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateDomainVerificationMutation.ts @@ -4,62 +4,88 @@ * 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 { domainVerificationKeys } from "../query-keys"; -import { domainVerificationMutationKeys } from "../mutation-keys"; -import type { DomainVerificationSelect, DomainVerificationWithRelations, CreateDomainVerificationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainVerificationSelect, DomainVerificationWithRelations, CreateDomainVerificationInput } from "../../orm/input-types"; +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 { domainVerificationKeys } from '../query-keys'; +import { domainVerificationMutationKeys } from '../mutation-keys'; +import type { + DomainVerificationSelect, + DomainVerificationWithRelations, + CreateDomainVerificationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DomainVerificationSelect, + DomainVerificationWithRelations, + CreateDomainVerificationInput, +} from '../../orm/input-types'; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDomainVerificationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDomainVerificationMutation(params: { - selection: ({ - fields: S & DomainVerificationSelect; - } & HookStrictSelect, DomainVerificationSelect>); -} & Omit; - }; -}, Error, CreateDomainVerificationInput["domainVerification"]>, "mutationFn">): UseMutationResult<{ - createDomainVerification: { - domainVerification: InferSelectResult; - }; -}, Error, CreateDomainVerificationInput["domainVerification"]>; -export function useCreateDomainVerificationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDomainVerificationMutation( + params: { + selection: { + fields: S & DomainVerificationSelect; + } & HookStrictSelect, DomainVerificationSelect>; + } & Omit< + UseMutationOptions< + { + createDomainVerification: { + domainVerification: InferSelectResult; + }; + }, + Error, + CreateDomainVerificationInput['domainVerification'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDomainVerification: { + domainVerification: InferSelectResult; + }; + }, + Error, + CreateDomainVerificationInput['domainVerification'] +>; +export function useCreateDomainVerificationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainVerificationMutationKeys.create(), - mutationFn: (data: CreateDomainVerificationInput["domainVerification"]) => getClient().domainVerification.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDomainVerificationInput['domainVerification']) => + getClient() + .domainVerification.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: domainVerificationKeys.lists() + queryKey: domainVerificationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateEmbeddingChunkMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateEmbeddingChunkMutation.ts index f644c3bfb7..f63d86efb9 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateEmbeddingChunkMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateEmbeddingChunkMutation.ts @@ -4,62 +4,88 @@ * 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 { embeddingChunkKeys } from "../query-keys"; -import { embeddingChunkMutationKeys } from "../mutation-keys"; -import type { EmbeddingChunkSelect, EmbeddingChunkWithRelations, CreateEmbeddingChunkInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmbeddingChunkSelect, EmbeddingChunkWithRelations, CreateEmbeddingChunkInput } from "../../orm/input-types"; +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 { embeddingChunkKeys } from '../query-keys'; +import { embeddingChunkMutationKeys } from '../mutation-keys'; +import type { + EmbeddingChunkSelect, + EmbeddingChunkWithRelations, + CreateEmbeddingChunkInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EmbeddingChunkSelect, + EmbeddingChunkWithRelations, + CreateEmbeddingChunkInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a EmbeddingChunk - * + * * @example * ```tsx * const { mutate, isPending } = useCreateEmbeddingChunkMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateEmbeddingChunkMutation(params: { - selection: ({ - fields: S & EmbeddingChunkSelect; - } & HookStrictSelect, EmbeddingChunkSelect>); -} & Omit; - }; -}, Error, CreateEmbeddingChunkInput["embeddingChunk"]>, "mutationFn">): UseMutationResult<{ - createEmbeddingChunk: { - embeddingChunk: InferSelectResult; - }; -}, Error, CreateEmbeddingChunkInput["embeddingChunk"]>; -export function useCreateEmbeddingChunkMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateEmbeddingChunkMutation( + params: { + selection: { + fields: S & EmbeddingChunkSelect; + } & HookStrictSelect, EmbeddingChunkSelect>; + } & Omit< + UseMutationOptions< + { + createEmbeddingChunk: { + embeddingChunk: InferSelectResult; + }; + }, + Error, + CreateEmbeddingChunkInput['embeddingChunk'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createEmbeddingChunk: { + embeddingChunk: InferSelectResult; + }; + }, + Error, + CreateEmbeddingChunkInput['embeddingChunk'] +>; +export function useCreateEmbeddingChunkMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: embeddingChunkMutationKeys.create(), - mutationFn: (data: CreateEmbeddingChunkInput["embeddingChunk"]) => getClient().embeddingChunk.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateEmbeddingChunkInput['embeddingChunk']) => + getClient() + .embeddingChunk.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: embeddingChunkKeys.lists() + queryKey: embeddingChunkKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateEnumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateEnumMutation.ts index d0c818d810..94d606336b 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateEnumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateEnumMutation.ts @@ -4,62 +4,77 @@ * 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 { enumKeys } from "../query-keys"; -import { enumMutationKeys } from "../mutation-keys"; -import type { EnumSelect, EnumWithRelations, CreateEnumInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EnumSelect, EnumWithRelations, CreateEnumInput } from "../../orm/input-types"; +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 { enumKeys } from '../query-keys'; +import { enumMutationKeys } from '../mutation-keys'; +import type { EnumSelect, EnumWithRelations, CreateEnumInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EnumSelect, EnumWithRelations, CreateEnumInput } from '../../orm/input-types'; /** * Mutation hook for creating a Enum - * + * * @example * ```tsx * const { mutate, isPending } = useCreateEnumMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateEnumMutation(params: { - selection: ({ - fields: S & EnumSelect; - } & HookStrictSelect, EnumSelect>); -} & Omit; - }; -}, Error, CreateEnumInput["enum"]>, "mutationFn">): UseMutationResult<{ - createEnum: { - enum: InferSelectResult; - }; -}, Error, CreateEnumInput["enum"]>; -export function useCreateEnumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateEnumMutation( + params: { + selection: { + fields: S & EnumSelect; + } & HookStrictSelect, EnumSelect>; + } & Omit< + UseMutationOptions< + { + createEnum: { + enum: InferSelectResult; + }; + }, + Error, + CreateEnumInput['enum'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createEnum: { + enum: InferSelectResult; + }; + }, + Error, + CreateEnumInput['enum'] +>; +export function useCreateEnumMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: enumMutationKeys.create(), - mutationFn: (data: CreateEnumInput["enum"]) => getClient().enum.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateEnumInput['enum']) => + getClient() + .enum.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: enumKeys.lists() + queryKey: enumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateExclusionConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateExclusionConstraintMutation.ts index 165f4a9a44..82879503a8 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateExclusionConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateExclusionConstraintMutation.ts @@ -4,62 +4,88 @@ * 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 { exclusionConstraintKeys } from "../query-keys"; -import { exclusionConstraintMutationKeys } from "../mutation-keys"; -import type { ExclusionConstraintSelect, ExclusionConstraintWithRelations, CreateExclusionConstraintInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ExclusionConstraintSelect, ExclusionConstraintWithRelations, CreateExclusionConstraintInput } from "../../orm/input-types"; +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 { exclusionConstraintKeys } from '../query-keys'; +import { exclusionConstraintMutationKeys } from '../mutation-keys'; +import type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, + CreateExclusionConstraintInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, + CreateExclusionConstraintInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ExclusionConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useCreateExclusionConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateExclusionConstraintMutation(params: { - selection: ({ - fields: S & ExclusionConstraintSelect; - } & HookStrictSelect, ExclusionConstraintSelect>); -} & Omit; - }; -}, Error, CreateExclusionConstraintInput["exclusionConstraint"]>, "mutationFn">): UseMutationResult<{ - createExclusionConstraint: { - exclusionConstraint: InferSelectResult; - }; -}, Error, CreateExclusionConstraintInput["exclusionConstraint"]>; -export function useCreateExclusionConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateExclusionConstraintMutation( + params: { + selection: { + fields: S & ExclusionConstraintSelect; + } & HookStrictSelect, ExclusionConstraintSelect>; + } & Omit< + UseMutationOptions< + { + createExclusionConstraint: { + exclusionConstraint: InferSelectResult; + }; + }, + Error, + CreateExclusionConstraintInput['exclusionConstraint'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createExclusionConstraint: { + exclusionConstraint: InferSelectResult; + }; + }, + Error, + CreateExclusionConstraintInput['exclusionConstraint'] +>; +export function useCreateExclusionConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: exclusionConstraintMutationKeys.create(), - mutationFn: (data: CreateExclusionConstraintInput["exclusionConstraint"]) => getClient().exclusionConstraint.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateExclusionConstraintInput['exclusionConstraint']) => + getClient() + .exclusionConstraint.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: exclusionConstraintKeys.lists() + queryKey: exclusionConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateFieldMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateFieldMutation.ts index ebd5cd8057..a90bffd87c 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateFieldMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateFieldMutation.ts @@ -4,62 +4,77 @@ * 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 { fieldKeys } from "../query-keys"; -import { fieldMutationKeys } from "../mutation-keys"; -import type { FieldSelect, FieldWithRelations, CreateFieldInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FieldSelect, FieldWithRelations, CreateFieldInput } from "../../orm/input-types"; +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 { fieldKeys } from '../query-keys'; +import { fieldMutationKeys } from '../mutation-keys'; +import type { FieldSelect, FieldWithRelations, CreateFieldInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FieldSelect, FieldWithRelations, CreateFieldInput } from '../../orm/input-types'; /** * Mutation hook for creating a Field - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFieldMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFieldMutation(params: { - selection: ({ - fields: S & FieldSelect; - } & HookStrictSelect, FieldSelect>); -} & Omit; - }; -}, Error, CreateFieldInput["field"]>, "mutationFn">): UseMutationResult<{ - createField: { - field: InferSelectResult; - }; -}, Error, CreateFieldInput["field"]>; -export function useCreateFieldMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFieldMutation( + params: { + selection: { + fields: S & FieldSelect; + } & HookStrictSelect, FieldSelect>; + } & Omit< + UseMutationOptions< + { + createField: { + field: InferSelectResult; + }; + }, + Error, + CreateFieldInput['field'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createField: { + field: InferSelectResult; + }; + }, + Error, + CreateFieldInput['field'] +>; +export function useCreateFieldMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: fieldMutationKeys.create(), - mutationFn: (data: CreateFieldInput["field"]) => getClient().field.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFieldInput['field']) => + getClient() + .field.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: fieldKeys.lists() + queryKey: fieldKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateForeignKeyConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateForeignKeyConstraintMutation.ts index f45e153bb8..e7007f9c81 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateForeignKeyConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateForeignKeyConstraintMutation.ts @@ -4,62 +4,88 @@ * 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 { foreignKeyConstraintKeys } from "../query-keys"; -import { foreignKeyConstraintMutationKeys } from "../mutation-keys"; -import type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations, CreateForeignKeyConstraintInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations, CreateForeignKeyConstraintInput } from "../../orm/input-types"; +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 { foreignKeyConstraintKeys } from '../query-keys'; +import { foreignKeyConstraintMutationKeys } from '../mutation-keys'; +import type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, + CreateForeignKeyConstraintInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, + CreateForeignKeyConstraintInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ForeignKeyConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useCreateForeignKeyConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateForeignKeyConstraintMutation(params: { - selection: ({ - fields: S & ForeignKeyConstraintSelect; - } & HookStrictSelect, ForeignKeyConstraintSelect>); -} & Omit; - }; -}, Error, CreateForeignKeyConstraintInput["foreignKeyConstraint"]>, "mutationFn">): UseMutationResult<{ - createForeignKeyConstraint: { - foreignKeyConstraint: InferSelectResult; - }; -}, Error, CreateForeignKeyConstraintInput["foreignKeyConstraint"]>; -export function useCreateForeignKeyConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateForeignKeyConstraintMutation( + params: { + selection: { + fields: S & ForeignKeyConstraintSelect; + } & HookStrictSelect, ForeignKeyConstraintSelect>; + } & Omit< + UseMutationOptions< + { + createForeignKeyConstraint: { + foreignKeyConstraint: InferSelectResult; + }; + }, + Error, + CreateForeignKeyConstraintInput['foreignKeyConstraint'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createForeignKeyConstraint: { + foreignKeyConstraint: InferSelectResult; + }; + }, + Error, + CreateForeignKeyConstraintInput['foreignKeyConstraint'] +>; +export function useCreateForeignKeyConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: foreignKeyConstraintMutationKeys.create(), - mutationFn: (data: CreateForeignKeyConstraintInput["foreignKeyConstraint"]) => getClient().foreignKeyConstraint.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateForeignKeyConstraintInput['foreignKeyConstraint']) => + getClient() + .foreignKeyConstraint.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: foreignKeyConstraintKeys.lists() + queryKey: foreignKeyConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateFullTextSearchMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateFullTextSearchMutation.ts index f801680300..ac28e0a6fa 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateFullTextSearchMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateFullTextSearchMutation.ts @@ -4,62 +4,88 @@ * 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 { fullTextSearchKeys } from "../query-keys"; -import { fullTextSearchMutationKeys } from "../mutation-keys"; -import type { FullTextSearchSelect, FullTextSearchWithRelations, CreateFullTextSearchInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FullTextSearchSelect, FullTextSearchWithRelations, CreateFullTextSearchInput } from "../../orm/input-types"; +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 { fullTextSearchKeys } from '../query-keys'; +import { fullTextSearchMutationKeys } from '../mutation-keys'; +import type { + FullTextSearchSelect, + FullTextSearchWithRelations, + CreateFullTextSearchInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FullTextSearchSelect, + FullTextSearchWithRelations, + CreateFullTextSearchInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a FullTextSearch - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFullTextSearchMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFullTextSearchMutation(params: { - selection: ({ - fields: S & FullTextSearchSelect; - } & HookStrictSelect, FullTextSearchSelect>); -} & Omit; - }; -}, Error, CreateFullTextSearchInput["fullTextSearch"]>, "mutationFn">): UseMutationResult<{ - createFullTextSearch: { - fullTextSearch: InferSelectResult; - }; -}, Error, CreateFullTextSearchInput["fullTextSearch"]>; -export function useCreateFullTextSearchMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFullTextSearchMutation( + params: { + selection: { + fields: S & FullTextSearchSelect; + } & HookStrictSelect, FullTextSearchSelect>; + } & Omit< + UseMutationOptions< + { + createFullTextSearch: { + fullTextSearch: InferSelectResult; + }; + }, + Error, + CreateFullTextSearchInput['fullTextSearch'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFullTextSearch: { + fullTextSearch: InferSelectResult; + }; + }, + Error, + CreateFullTextSearchInput['fullTextSearch'] +>; +export function useCreateFullTextSearchMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: fullTextSearchMutationKeys.create(), - mutationFn: (data: CreateFullTextSearchInput["fullTextSearch"]) => getClient().fullTextSearch.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFullTextSearchInput['fullTextSearch']) => + getClient() + .fullTextSearch.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: fullTextSearchKeys.lists() + queryKey: fullTextSearchKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateFunctionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateFunctionMutation.ts index 570297d923..60018d9da3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateFunctionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateFunctionMutation.ts @@ -4,62 +4,85 @@ * 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 { functionKeys } from "../query-keys"; -import { functionMutationKeys } from "../mutation-keys"; -import type { FunctionSelect, FunctionWithRelations, CreateFunctionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionSelect, FunctionWithRelations, CreateFunctionInput } from "../../orm/input-types"; +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 { functionKeys } from '../query-keys'; +import { functionMutationKeys } from '../mutation-keys'; +import type { + FunctionSelect, + FunctionWithRelations, + CreateFunctionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionSelect, + FunctionWithRelations, + CreateFunctionInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a Function - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionMutation(params: { - selection: ({ - fields: S & FunctionSelect; - } & HookStrictSelect, FunctionSelect>); -} & Omit; - }; -}, Error, CreateFunctionInput["function"]>, "mutationFn">): UseMutationResult<{ - createFunction: { - function: InferSelectResult; - }; -}, Error, CreateFunctionInput["function"]>; -export function useCreateFunctionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionMutation( + params: { + selection: { + fields: S & FunctionSelect; + } & HookStrictSelect, FunctionSelect>; + } & Omit< + UseMutationOptions< + { + createFunction: { + function: InferSelectResult; + }; + }, + Error, + CreateFunctionInput['function'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunction: { + function: InferSelectResult; + }; + }, + Error, + CreateFunctionInput['function'] +>; +export function useCreateFunctionMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionMutationKeys.create(), - mutationFn: (data: CreateFunctionInput["function"]) => getClient().function.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionInput['function']) => + getClient() + .function.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionKeys.lists() + queryKey: functionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateHostnameBindingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateHostnameBindingMutation.ts index 3ce095f401..fc63661581 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateHostnameBindingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateHostnameBindingMutation.ts @@ -4,62 +4,88 @@ * 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 { hostnameBindingKeys } from "../query-keys"; -import { hostnameBindingMutationKeys } from "../mutation-keys"; -import type { HostnameBindingSelect, HostnameBindingWithRelations, CreateHostnameBindingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HostnameBindingSelect, HostnameBindingWithRelations, CreateHostnameBindingInput } from "../../orm/input-types"; +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 { hostnameBindingKeys } from '../query-keys'; +import { hostnameBindingMutationKeys } from '../mutation-keys'; +import type { + HostnameBindingSelect, + HostnameBindingWithRelations, + CreateHostnameBindingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + HostnameBindingSelect, + HostnameBindingWithRelations, + CreateHostnameBindingInput, +} from '../../orm/input-types'; /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```tsx * const { mutate, isPending } = useCreateHostnameBindingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateHostnameBindingMutation(params: { - selection: ({ - fields: S & HostnameBindingSelect; - } & HookStrictSelect, HostnameBindingSelect>); -} & Omit; - }; -}, Error, CreateHostnameBindingInput["hostnameBinding"]>, "mutationFn">): UseMutationResult<{ - createHostnameBinding: { - hostnameBinding: InferSelectResult; - }; -}, Error, CreateHostnameBindingInput["hostnameBinding"]>; -export function useCreateHostnameBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateHostnameBindingMutation( + params: { + selection: { + fields: S & HostnameBindingSelect; + } & HookStrictSelect, HostnameBindingSelect>; + } & Omit< + UseMutationOptions< + { + createHostnameBinding: { + hostnameBinding: InferSelectResult; + }; + }, + Error, + CreateHostnameBindingInput['hostnameBinding'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createHostnameBinding: { + hostnameBinding: InferSelectResult; + }; + }, + Error, + CreateHostnameBindingInput['hostnameBinding'] +>; +export function useCreateHostnameBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: hostnameBindingMutationKeys.create(), - mutationFn: (data: CreateHostnameBindingInput["hostnameBinding"]) => getClient().hostnameBinding.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateHostnameBindingInput['hostnameBinding']) => + getClient() + .hostnameBinding.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: hostnameBindingKeys.lists() + queryKey: hostnameBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateHttpRouteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateHttpRouteMutation.ts index 914c5890b4..dfac46d247 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateHttpRouteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateHttpRouteMutation.ts @@ -4,62 +4,85 @@ * 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 { httpRouteKeys } from "../query-keys"; -import { httpRouteMutationKeys } from "../mutation-keys"; -import type { HttpRouteSelect, HttpRouteWithRelations, CreateHttpRouteInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteSelect, HttpRouteWithRelations, CreateHttpRouteInput } from "../../orm/input-types"; +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 { httpRouteKeys } from '../query-keys'; +import { httpRouteMutationKeys } from '../mutation-keys'; +import type { + HttpRouteSelect, + HttpRouteWithRelations, + CreateHttpRouteInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + HttpRouteSelect, + HttpRouteWithRelations, + CreateHttpRouteInput, +} from '../../orm/input-types'; /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```tsx * const { mutate, isPending } = useCreateHttpRouteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateHttpRouteMutation(params: { - selection: ({ - fields: S & HttpRouteSelect; - } & HookStrictSelect, HttpRouteSelect>); -} & Omit; - }; -}, Error, CreateHttpRouteInput["httpRoute"]>, "mutationFn">): UseMutationResult<{ - createHttpRoute: { - httpRoute: InferSelectResult; - }; -}, Error, CreateHttpRouteInput["httpRoute"]>; -export function useCreateHttpRouteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateHttpRouteMutation( + params: { + selection: { + fields: S & HttpRouteSelect; + } & HookStrictSelect, HttpRouteSelect>; + } & Omit< + UseMutationOptions< + { + createHttpRoute: { + httpRoute: InferSelectResult; + }; + }, + Error, + CreateHttpRouteInput['httpRoute'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createHttpRoute: { + httpRoute: InferSelectResult; + }; + }, + Error, + CreateHttpRouteInput['httpRoute'] +>; +export function useCreateHttpRouteMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: httpRouteMutationKeys.create(), - mutationFn: (data: CreateHttpRouteInput["httpRoute"]) => getClient().httpRoute.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateHttpRouteInput['httpRoute']) => + getClient() + .httpRoute.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: httpRouteKeys.lists() + queryKey: httpRouteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateIndexMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateIndexMutation.ts index 53703573b7..d598e78bbc 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateIndexMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateIndexMutation.ts @@ -4,62 +4,77 @@ * 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 { indexKeys } from "../query-keys"; -import { indexMutationKeys } from "../mutation-keys"; -import type { IndexSelect, IndexWithRelations, CreateIndexInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IndexSelect, IndexWithRelations, CreateIndexInput } from "../../orm/input-types"; +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 { indexKeys } from '../query-keys'; +import { indexMutationKeys } from '../mutation-keys'; +import type { IndexSelect, IndexWithRelations, CreateIndexInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { IndexSelect, IndexWithRelations, CreateIndexInput } from '../../orm/input-types'; /** * Mutation hook for creating a Index - * + * * @example * ```tsx * const { mutate, isPending } = useCreateIndexMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateIndexMutation(params: { - selection: ({ - fields: S & IndexSelect; - } & HookStrictSelect, IndexSelect>); -} & Omit; - }; -}, Error, CreateIndexInput["index"]>, "mutationFn">): UseMutationResult<{ - createIndex: { - index: InferSelectResult; - }; -}, Error, CreateIndexInput["index"]>; -export function useCreateIndexMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateIndexMutation( + params: { + selection: { + fields: S & IndexSelect; + } & HookStrictSelect, IndexSelect>; + } & Omit< + UseMutationOptions< + { + createIndex: { + index: InferSelectResult; + }; + }, + Error, + CreateIndexInput['index'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createIndex: { + index: InferSelectResult; + }; + }, + Error, + CreateIndexInput['index'] +>; +export function useCreateIndexMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: indexMutationKeys.create(), - mutationFn: (data: CreateIndexInput["index"]) => getClient().index.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateIndexInput['index']) => + getClient() + .index.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: indexKeys.lists() + queryKey: indexKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateManagedDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateManagedDomainMutation.ts index 82e72ba383..8f126eb992 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateManagedDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateManagedDomainMutation.ts @@ -4,62 +4,85 @@ * 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 { managedDomainKeys } from "../query-keys"; -import { managedDomainMutationKeys } from "../mutation-keys"; -import type { ManagedDomainSelect, ManagedDomainWithRelations, CreateManagedDomainInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ManagedDomainSelect, ManagedDomainWithRelations, CreateManagedDomainInput } from "../../orm/input-types"; +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 { managedDomainKeys } from '../query-keys'; +import { managedDomainMutationKeys } from '../mutation-keys'; +import type { + ManagedDomainSelect, + ManagedDomainWithRelations, + CreateManagedDomainInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ManagedDomainSelect, + ManagedDomainWithRelations, + CreateManagedDomainInput, +} from '../../orm/input-types'; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { mutate, isPending } = useCreateManagedDomainMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateManagedDomainMutation(params: { - selection: ({ - fields: S & ManagedDomainSelect; - } & HookStrictSelect, ManagedDomainSelect>); -} & Omit; - }; -}, Error, CreateManagedDomainInput["managedDomain"]>, "mutationFn">): UseMutationResult<{ - createManagedDomain: { - managedDomain: InferSelectResult; - }; -}, Error, CreateManagedDomainInput["managedDomain"]>; -export function useCreateManagedDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateManagedDomainMutation( + params: { + selection: { + fields: S & ManagedDomainSelect; + } & HookStrictSelect, ManagedDomainSelect>; + } & Omit< + UseMutationOptions< + { + createManagedDomain: { + managedDomain: InferSelectResult; + }; + }, + Error, + CreateManagedDomainInput['managedDomain'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createManagedDomain: { + managedDomain: InferSelectResult; + }; + }, + Error, + CreateManagedDomainInput['managedDomain'] +>; +export function useCreateManagedDomainMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: managedDomainMutationKeys.create(), - mutationFn: (data: CreateManagedDomainInput["managedDomain"]) => getClient().managedDomain.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateManagedDomainInput['managedDomain']) => + getClient() + .managedDomain.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: managedDomainKeys.lists() + queryKey: managedDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateNodeTypeRegistryMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateNodeTypeRegistryMutation.ts index 6fed9569cc..584e4c995f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateNodeTypeRegistryMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateNodeTypeRegistryMutation.ts @@ -4,62 +4,88 @@ * 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 { nodeTypeRegistryKeys } from "../query-keys"; -import { nodeTypeRegistryMutationKeys } from "../mutation-keys"; -import type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations, CreateNodeTypeRegistryInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations, CreateNodeTypeRegistryInput } from "../../orm/input-types"; +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 { nodeTypeRegistryKeys } from '../query-keys'; +import { nodeTypeRegistryMutationKeys } from '../mutation-keys'; +import type { + NodeTypeRegistrySelect, + NodeTypeRegistryWithRelations, + CreateNodeTypeRegistryInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NodeTypeRegistrySelect, + NodeTypeRegistryWithRelations, + CreateNodeTypeRegistryInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a NodeTypeRegistry - * + * * @example * ```tsx * const { mutate, isPending } = useCreateNodeTypeRegistryMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateNodeTypeRegistryMutation(params: { - selection: ({ - fields: S & NodeTypeRegistrySelect; - } & HookStrictSelect, NodeTypeRegistrySelect>); -} & Omit; - }; -}, Error, CreateNodeTypeRegistryInput["nodeTypeRegistry"]>, "mutationFn">): UseMutationResult<{ - createNodeTypeRegistry: { - nodeTypeRegistry: InferSelectResult; - }; -}, Error, CreateNodeTypeRegistryInput["nodeTypeRegistry"]>; -export function useCreateNodeTypeRegistryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateNodeTypeRegistryMutation( + params: { + selection: { + fields: S & NodeTypeRegistrySelect; + } & HookStrictSelect, NodeTypeRegistrySelect>; + } & Omit< + UseMutationOptions< + { + createNodeTypeRegistry: { + nodeTypeRegistry: InferSelectResult; + }; + }, + Error, + CreateNodeTypeRegistryInput['nodeTypeRegistry'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createNodeTypeRegistry: { + nodeTypeRegistry: InferSelectResult; + }; + }, + Error, + CreateNodeTypeRegistryInput['nodeTypeRegistry'] +>; +export function useCreateNodeTypeRegistryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: nodeTypeRegistryMutationKeys.create(), - mutationFn: (data: CreateNodeTypeRegistryInput["nodeTypeRegistry"]) => getClient().nodeTypeRegistry.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateNodeTypeRegistryInput['nodeTypeRegistry']) => + getClient() + .nodeTypeRegistry.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: nodeTypeRegistryKeys.lists() + queryKey: nodeTypeRegistryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePartitionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePartitionMutation.ts index 957ad6f7ca..bc22bc90b0 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePartitionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePartitionMutation.ts @@ -4,62 +4,85 @@ * 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 { partitionKeys } from "../query-keys"; -import { partitionMutationKeys } from "../mutation-keys"; -import type { PartitionSelect, PartitionWithRelations, CreatePartitionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PartitionSelect, PartitionWithRelations, CreatePartitionInput } from "../../orm/input-types"; +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 { partitionKeys } from '../query-keys'; +import { partitionMutationKeys } from '../mutation-keys'; +import type { + PartitionSelect, + PartitionWithRelations, + CreatePartitionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PartitionSelect, + PartitionWithRelations, + CreatePartitionInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a Partition - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePartitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePartitionMutation(params: { - selection: ({ - fields: S & PartitionSelect; - } & HookStrictSelect, PartitionSelect>); -} & Omit; - }; -}, Error, CreatePartitionInput["partition"]>, "mutationFn">): UseMutationResult<{ - createPartition: { - partition: InferSelectResult; - }; -}, Error, CreatePartitionInput["partition"]>; -export function useCreatePartitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePartitionMutation( + params: { + selection: { + fields: S & PartitionSelect; + } & HookStrictSelect, PartitionSelect>; + } & Omit< + UseMutationOptions< + { + createPartition: { + partition: InferSelectResult; + }; + }, + Error, + CreatePartitionInput['partition'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPartition: { + partition: InferSelectResult; + }; + }, + Error, + CreatePartitionInput['partition'] +>; +export function useCreatePartitionMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: partitionMutationKeys.create(), - mutationFn: (data: CreatePartitionInput["partition"]) => getClient().partition.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePartitionInput['partition']) => + getClient() + .partition.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: partitionKeys.lists() + queryKey: partitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiModuleMutation.ts index c62305385a..3d294bcc41 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { platformApiModuleKeys } from "../query-keys"; -import { platformApiModuleMutationKeys } from "../mutation-keys"; -import type { PlatformApiModuleSelect, PlatformApiModuleWithRelations, CreatePlatformApiModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiModuleSelect, PlatformApiModuleWithRelations, CreatePlatformApiModuleInput } from "../../orm/input-types"; +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 { platformApiModuleKeys } from '../query-keys'; +import { platformApiModuleMutationKeys } from '../mutation-keys'; +import type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, + CreatePlatformApiModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, + CreatePlatformApiModuleInput, +} from '../../orm/input-types'; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformApiModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformApiModuleMutation(params: { - selection: ({ - fields: S & PlatformApiModuleSelect; - } & HookStrictSelect, PlatformApiModuleSelect>); -} & Omit; - }; -}, Error, CreatePlatformApiModuleInput["platformApiModule"]>, "mutationFn">): UseMutationResult<{ - createPlatformApiModule: { - platformApiModule: InferSelectResult; - }; -}, Error, CreatePlatformApiModuleInput["platformApiModule"]>; -export function useCreatePlatformApiModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformApiModuleMutation( + params: { + selection: { + fields: S & PlatformApiModuleSelect; + } & HookStrictSelect, PlatformApiModuleSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformApiModule: { + platformApiModule: InferSelectResult; + }; + }, + Error, + CreatePlatformApiModuleInput['platformApiModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformApiModule: { + platformApiModule: InferSelectResult; + }; + }, + Error, + CreatePlatformApiModuleInput['platformApiModule'] +>; +export function useCreatePlatformApiModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiModuleMutationKeys.create(), - mutationFn: (data: CreatePlatformApiModuleInput["platformApiModule"]) => getClient().platformApiModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformApiModuleInput['platformApiModule']) => + getClient() + .platformApiModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformApiModuleKeys.lists() + queryKey: platformApiModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiMutation.ts index e01f586d53..91c2ab0235 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiMutation.ts @@ -4,62 +4,85 @@ * 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 { platformApiKeys } from "../query-keys"; -import { platformApiMutationKeys } from "../mutation-keys"; -import type { PlatformApiSelect, PlatformApiWithRelations, CreatePlatformApiInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSelect, PlatformApiWithRelations, CreatePlatformApiInput } from "../../orm/input-types"; +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 { platformApiKeys } from '../query-keys'; +import { platformApiMutationKeys } from '../mutation-keys'; +import type { + PlatformApiSelect, + PlatformApiWithRelations, + CreatePlatformApiInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSelect, + PlatformApiWithRelations, + CreatePlatformApiInput, +} from '../../orm/input-types'; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformApiMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformApiMutation(params: { - selection: ({ - fields: S & PlatformApiSelect; - } & HookStrictSelect, PlatformApiSelect>); -} & Omit; - }; -}, Error, CreatePlatformApiInput["platformApi"]>, "mutationFn">): UseMutationResult<{ - createPlatformApi: { - platformApi: InferSelectResult; - }; -}, Error, CreatePlatformApiInput["platformApi"]>; -export function useCreatePlatformApiMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformApiMutation( + params: { + selection: { + fields: S & PlatformApiSelect; + } & HookStrictSelect, PlatformApiSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformApi: { + platformApi: InferSelectResult; + }; + }, + Error, + CreatePlatformApiInput['platformApi'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformApi: { + platformApi: InferSelectResult; + }; + }, + Error, + CreatePlatformApiInput['platformApi'] +>; +export function useCreatePlatformApiMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiMutationKeys.create(), - mutationFn: (data: CreatePlatformApiInput["platformApi"]) => getClient().platformApi.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformApiInput['platformApi']) => + getClient() + .platformApi.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformApiKeys.lists() + queryKey: platformApiKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiSchemaMutation.ts index 3d12803fc8..b71c4fd2c7 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiSchemaMutation.ts @@ -4,62 +4,88 @@ * 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 { platformApiSchemaKeys } from "../query-keys"; -import { platformApiSchemaMutationKeys } from "../mutation-keys"; -import type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations, CreatePlatformApiSchemaInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations, CreatePlatformApiSchemaInput } from "../../orm/input-types"; +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 { platformApiSchemaKeys } from '../query-keys'; +import { platformApiSchemaMutationKeys } from '../mutation-keys'; +import type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, + CreatePlatformApiSchemaInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, + CreatePlatformApiSchemaInput, +} from '../../orm/input-types'; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformApiSchemaMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformApiSchemaMutation(params: { - selection: ({ - fields: S & PlatformApiSchemaSelect; - } & HookStrictSelect, PlatformApiSchemaSelect>); -} & Omit; - }; -}, Error, CreatePlatformApiSchemaInput["platformApiSchema"]>, "mutationFn">): UseMutationResult<{ - createPlatformApiSchema: { - platformApiSchema: InferSelectResult; - }; -}, Error, CreatePlatformApiSchemaInput["platformApiSchema"]>; -export function useCreatePlatformApiSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformApiSchemaMutation( + params: { + selection: { + fields: S & PlatformApiSchemaSelect; + } & HookStrictSelect, PlatformApiSchemaSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformApiSchema: { + platformApiSchema: InferSelectResult; + }; + }, + Error, + CreatePlatformApiSchemaInput['platformApiSchema'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformApiSchema: { + platformApiSchema: InferSelectResult; + }; + }, + Error, + CreatePlatformApiSchemaInput['platformApiSchema'] +>; +export function useCreatePlatformApiSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiSchemaMutationKeys.create(), - mutationFn: (data: CreatePlatformApiSchemaInput["platformApiSchema"]) => getClient().platformApiSchema.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformApiSchemaInput['platformApiSchema']) => + getClient() + .platformApiSchema.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformApiSchemaKeys.lists() + queryKey: platformApiSchemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiSettingMutation.ts index dc3932b7e6..37a51a8613 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformApiSettingMutation.ts @@ -4,62 +4,88 @@ * 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 { platformApiSettingKeys } from "../query-keys"; -import { platformApiSettingMutationKeys } from "../mutation-keys"; -import type { PlatformApiSettingSelect, PlatformApiSettingWithRelations, CreatePlatformApiSettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSettingSelect, PlatformApiSettingWithRelations, CreatePlatformApiSettingInput } from "../../orm/input-types"; +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 { platformApiSettingKeys } from '../query-keys'; +import { platformApiSettingMutationKeys } from '../mutation-keys'; +import type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, + CreatePlatformApiSettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, + CreatePlatformApiSettingInput, +} from '../../orm/input-types'; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformApiSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformApiSettingMutation(params: { - selection: ({ - fields: S & PlatformApiSettingSelect; - } & HookStrictSelect, PlatformApiSettingSelect>); -} & Omit; - }; -}, Error, CreatePlatformApiSettingInput["platformApiSetting"]>, "mutationFn">): UseMutationResult<{ - createPlatformApiSetting: { - platformApiSetting: InferSelectResult; - }; -}, Error, CreatePlatformApiSettingInput["platformApiSetting"]>; -export function useCreatePlatformApiSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformApiSettingMutation( + params: { + selection: { + fields: S & PlatformApiSettingSelect; + } & HookStrictSelect, PlatformApiSettingSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformApiSetting: { + platformApiSetting: InferSelectResult; + }; + }, + Error, + CreatePlatformApiSettingInput['platformApiSetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformApiSetting: { + platformApiSetting: InferSelectResult; + }; + }, + Error, + CreatePlatformApiSettingInput['platformApiSetting'] +>; +export function useCreatePlatformApiSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiSettingMutationKeys.create(), - mutationFn: (data: CreatePlatformApiSettingInput["platformApiSetting"]) => getClient().platformApiSetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformApiSettingInput['platformApiSetting']) => + getClient() + .platformApiSetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformApiSettingKeys.lists() + queryKey: platformApiSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformCorsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformCorsSettingMutation.ts index 5ae256c499..1f68705cd7 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformCorsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformCorsSettingMutation.ts @@ -4,62 +4,88 @@ * 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 { platformCorsSettingKeys } from "../query-keys"; -import { platformCorsSettingMutationKeys } from "../mutation-keys"; -import type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations, CreatePlatformCorsSettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations, CreatePlatformCorsSettingInput } from "../../orm/input-types"; +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 { platformCorsSettingKeys } from '../query-keys'; +import { platformCorsSettingMutationKeys } from '../mutation-keys'; +import type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, + CreatePlatformCorsSettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, + CreatePlatformCorsSettingInput, +} from '../../orm/input-types'; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformCorsSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformCorsSettingMutation(params: { - selection: ({ - fields: S & PlatformCorsSettingSelect; - } & HookStrictSelect, PlatformCorsSettingSelect>); -} & Omit; - }; -}, Error, CreatePlatformCorsSettingInput["platformCorsSetting"]>, "mutationFn">): UseMutationResult<{ - createPlatformCorsSetting: { - platformCorsSetting: InferSelectResult; - }; -}, Error, CreatePlatformCorsSettingInput["platformCorsSetting"]>; -export function useCreatePlatformCorsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformCorsSettingMutation( + params: { + selection: { + fields: S & PlatformCorsSettingSelect; + } & HookStrictSelect, PlatformCorsSettingSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformCorsSetting: { + platformCorsSetting: InferSelectResult; + }; + }, + Error, + CreatePlatformCorsSettingInput['platformCorsSetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformCorsSetting: { + platformCorsSetting: InferSelectResult; + }; + }, + Error, + CreatePlatformCorsSettingInput['platformCorsSetting'] +>; +export function useCreatePlatformCorsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformCorsSettingMutationKeys.create(), - mutationFn: (data: CreatePlatformCorsSettingInput["platformCorsSetting"]) => getClient().platformCorsSetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformCorsSettingInput['platformCorsSetting']) => + getClient() + .platformCorsSetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformCorsSettingKeys.lists() + queryKey: platformCorsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainEventMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainEventMutation.ts index 69f60431e2..ad39f870d2 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainEventMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainEventMutation.ts @@ -4,62 +4,88 @@ * 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 { platformDomainEventKeys } from "../query-keys"; -import { platformDomainEventMutationKeys } from "../mutation-keys"; -import type { PlatformDomainEventSelect, PlatformDomainEventWithRelations, CreatePlatformDomainEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainEventSelect, PlatformDomainEventWithRelations, CreatePlatformDomainEventInput } from "../../orm/input-types"; +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 { platformDomainEventKeys } from '../query-keys'; +import { platformDomainEventMutationKeys } from '../mutation-keys'; +import type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, + CreatePlatformDomainEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, + CreatePlatformDomainEventInput, +} from '../../orm/input-types'; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformDomainEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformDomainEventMutation(params: { - selection: ({ - fields: S & PlatformDomainEventSelect; - } & HookStrictSelect, PlatformDomainEventSelect>); -} & Omit; - }; -}, Error, CreatePlatformDomainEventInput["platformDomainEvent"]>, "mutationFn">): UseMutationResult<{ - createPlatformDomainEvent: { - platformDomainEvent: InferSelectResult; - }; -}, Error, CreatePlatformDomainEventInput["platformDomainEvent"]>; -export function useCreatePlatformDomainEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformDomainEventMutation( + params: { + selection: { + fields: S & PlatformDomainEventSelect; + } & HookStrictSelect, PlatformDomainEventSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformDomainEvent: { + platformDomainEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformDomainEventInput['platformDomainEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformDomainEvent: { + platformDomainEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformDomainEventInput['platformDomainEvent'] +>; +export function useCreatePlatformDomainEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainEventMutationKeys.create(), - mutationFn: (data: CreatePlatformDomainEventInput["platformDomainEvent"]) => getClient().platformDomainEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformDomainEventInput['platformDomainEvent']) => + getClient() + .platformDomainEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformDomainEventKeys.lists() + queryKey: platformDomainEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainMutation.ts index 653d2b071a..df28aaa9da 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainMutation.ts @@ -4,62 +4,88 @@ * 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 { platformDomainKeys } from "../query-keys"; -import { platformDomainMutationKeys } from "../mutation-keys"; -import type { PlatformDomainSelect, PlatformDomainWithRelations, CreatePlatformDomainInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainSelect, PlatformDomainWithRelations, CreatePlatformDomainInput } from "../../orm/input-types"; +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 { platformDomainKeys } from '../query-keys'; +import { platformDomainMutationKeys } from '../mutation-keys'; +import type { + PlatformDomainSelect, + PlatformDomainWithRelations, + CreatePlatformDomainInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainSelect, + PlatformDomainWithRelations, + CreatePlatformDomainInput, +} from '../../orm/input-types'; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformDomainMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformDomainMutation(params: { - selection: ({ - fields: S & PlatformDomainSelect; - } & HookStrictSelect, PlatformDomainSelect>); -} & Omit; - }; -}, Error, CreatePlatformDomainInput["platformDomain"]>, "mutationFn">): UseMutationResult<{ - createPlatformDomain: { - platformDomain: InferSelectResult; - }; -}, Error, CreatePlatformDomainInput["platformDomain"]>; -export function useCreatePlatformDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformDomainMutation( + params: { + selection: { + fields: S & PlatformDomainSelect; + } & HookStrictSelect, PlatformDomainSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformDomain: { + platformDomain: InferSelectResult; + }; + }, + Error, + CreatePlatformDomainInput['platformDomain'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformDomain: { + platformDomain: InferSelectResult; + }; + }, + Error, + CreatePlatformDomainInput['platformDomain'] +>; +export function useCreatePlatformDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainMutationKeys.create(), - mutationFn: (data: CreatePlatformDomainInput["platformDomain"]) => getClient().platformDomain.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformDomainInput['platformDomain']) => + getClient() + .platformDomain.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformDomainKeys.lists() + queryKey: platformDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainVerificationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainVerificationMutation.ts index 45bbf8aa6a..2476cb015a 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainVerificationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformDomainVerificationMutation.ts @@ -4,62 +4,94 @@ * 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 { platformDomainVerificationKeys } from "../query-keys"; -import { platformDomainVerificationMutationKeys } from "../mutation-keys"; -import type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations, CreatePlatformDomainVerificationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations, CreatePlatformDomainVerificationInput } from "../../orm/input-types"; +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 { platformDomainVerificationKeys } from '../query-keys'; +import { platformDomainVerificationMutationKeys } from '../mutation-keys'; +import type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, + CreatePlatformDomainVerificationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, + CreatePlatformDomainVerificationInput, +} from '../../orm/input-types'; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformDomainVerificationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformDomainVerificationMutation(params: { - selection: ({ - fields: S & PlatformDomainVerificationSelect; - } & HookStrictSelect, PlatformDomainVerificationSelect>); -} & Omit; - }; -}, Error, CreatePlatformDomainVerificationInput["platformDomainVerification"]>, "mutationFn">): UseMutationResult<{ - createPlatformDomainVerification: { - platformDomainVerification: InferSelectResult; - }; -}, Error, CreatePlatformDomainVerificationInput["platformDomainVerification"]>; -export function useCreatePlatformDomainVerificationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformDomainVerificationMutation< + S extends PlatformDomainVerificationSelect, +>( + params: { + selection: { + fields: S & PlatformDomainVerificationSelect; + } & HookStrictSelect, PlatformDomainVerificationSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformDomainVerification: { + platformDomainVerification: InferSelectResult; + }; + }, + Error, + CreatePlatformDomainVerificationInput['platformDomainVerification'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformDomainVerification: { + platformDomainVerification: InferSelectResult; + }; + }, + Error, + CreatePlatformDomainVerificationInput['platformDomainVerification'] +>; +export function useCreatePlatformDomainVerificationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformDomainVerificationInput['platformDomainVerification'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainVerificationMutationKeys.create(), - mutationFn: (data: CreatePlatformDomainVerificationInput["platformDomainVerification"]) => getClient().platformDomainVerification.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformDomainVerificationInput['platformDomainVerification']) => + getClient() + .platformDomainVerification.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformDomainVerificationKeys.lists() + queryKey: platformDomainVerificationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformManagedDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformManagedDomainMutation.ts index 65d66b6062..be095e5e86 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformManagedDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformManagedDomainMutation.ts @@ -4,62 +4,88 @@ * 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 { platformManagedDomainKeys } from "../query-keys"; -import { platformManagedDomainMutationKeys } from "../mutation-keys"; -import type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations, CreatePlatformManagedDomainInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations, CreatePlatformManagedDomainInput } from "../../orm/input-types"; +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 { platformManagedDomainKeys } from '../query-keys'; +import { platformManagedDomainMutationKeys } from '../mutation-keys'; +import type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, + CreatePlatformManagedDomainInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, + CreatePlatformManagedDomainInput, +} from '../../orm/input-types'; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformManagedDomainMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformManagedDomainMutation(params: { - selection: ({ - fields: S & PlatformManagedDomainSelect; - } & HookStrictSelect, PlatformManagedDomainSelect>); -} & Omit; - }; -}, Error, CreatePlatformManagedDomainInput["platformManagedDomain"]>, "mutationFn">): UseMutationResult<{ - createPlatformManagedDomain: { - platformManagedDomain: InferSelectResult; - }; -}, Error, CreatePlatformManagedDomainInput["platformManagedDomain"]>; -export function useCreatePlatformManagedDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformManagedDomainMutation( + params: { + selection: { + fields: S & PlatformManagedDomainSelect; + } & HookStrictSelect, PlatformManagedDomainSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformManagedDomain: { + platformManagedDomain: InferSelectResult; + }; + }, + Error, + CreatePlatformManagedDomainInput['platformManagedDomain'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformManagedDomain: { + platformManagedDomain: InferSelectResult; + }; + }, + Error, + CreatePlatformManagedDomainInput['platformManagedDomain'] +>; +export function useCreatePlatformManagedDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformManagedDomainMutationKeys.create(), - mutationFn: (data: CreatePlatformManagedDomainInput["platformManagedDomain"]) => getClient().platformManagedDomain.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformManagedDomainInput['platformManagedDomain']) => + getClient() + .platformManagedDomain.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformManagedDomainKeys.lists() + queryKey: platformManagedDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteMetadatumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteMetadatumMutation.ts index 75d30264a9..201f49f9fc 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteMetadatumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteMetadatumMutation.ts @@ -4,62 +4,88 @@ * 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 { platformSiteMetadatumKeys } from "../query-keys"; -import { platformSiteMetadatumMutationKeys } from "../mutation-keys"; -import type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations, CreatePlatformSiteMetadatumInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations, CreatePlatformSiteMetadatumInput } from "../../orm/input-types"; +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 { platformSiteMetadatumKeys } from '../query-keys'; +import { platformSiteMetadatumMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, + CreatePlatformSiteMetadatumInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, + CreatePlatformSiteMetadatumInput, +} from '../../orm/input-types'; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformSiteMetadatumMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformSiteMetadatumMutation(params: { - selection: ({ - fields: S & PlatformSiteMetadatumSelect; - } & HookStrictSelect, PlatformSiteMetadatumSelect>); -} & Omit; - }; -}, Error, CreatePlatformSiteMetadatumInput["platformSiteMetadatum"]>, "mutationFn">): UseMutationResult<{ - createPlatformSiteMetadatum: { - platformSiteMetadatum: InferSelectResult; - }; -}, Error, CreatePlatformSiteMetadatumInput["platformSiteMetadatum"]>; -export function useCreatePlatformSiteMetadatumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformSiteMetadatumMutation( + params: { + selection: { + fields: S & PlatformSiteMetadatumSelect; + } & HookStrictSelect, PlatformSiteMetadatumSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformSiteMetadatum: { + platformSiteMetadatum: InferSelectResult; + }; + }, + Error, + CreatePlatformSiteMetadatumInput['platformSiteMetadatum'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformSiteMetadatum: { + platformSiteMetadatum: InferSelectResult; + }; + }, + Error, + CreatePlatformSiteMetadatumInput['platformSiteMetadatum'] +>; +export function useCreatePlatformSiteMetadatumMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteMetadatumMutationKeys.create(), - mutationFn: (data: CreatePlatformSiteMetadatumInput["platformSiteMetadatum"]) => getClient().platformSiteMetadatum.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformSiteMetadatumInput['platformSiteMetadatum']) => + getClient() + .platformSiteMetadatum.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformSiteMetadatumKeys.lists() + queryKey: platformSiteMetadatumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteModuleMutation.ts index 875cef1b05..bdf49ff4ab 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { platformSiteModuleKeys } from "../query-keys"; -import { platformSiteModuleMutationKeys } from "../mutation-keys"; -import type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations, CreatePlatformSiteModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations, CreatePlatformSiteModuleInput } from "../../orm/input-types"; +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 { platformSiteModuleKeys } from '../query-keys'; +import { platformSiteModuleMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, + CreatePlatformSiteModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, + CreatePlatformSiteModuleInput, +} from '../../orm/input-types'; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformSiteModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformSiteModuleMutation(params: { - selection: ({ - fields: S & PlatformSiteModuleSelect; - } & HookStrictSelect, PlatformSiteModuleSelect>); -} & Omit; - }; -}, Error, CreatePlatformSiteModuleInput["platformSiteModule"]>, "mutationFn">): UseMutationResult<{ - createPlatformSiteModule: { - platformSiteModule: InferSelectResult; - }; -}, Error, CreatePlatformSiteModuleInput["platformSiteModule"]>; -export function useCreatePlatformSiteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformSiteModuleMutation( + params: { + selection: { + fields: S & PlatformSiteModuleSelect; + } & HookStrictSelect, PlatformSiteModuleSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformSiteModule: { + platformSiteModule: InferSelectResult; + }; + }, + Error, + CreatePlatformSiteModuleInput['platformSiteModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformSiteModule: { + platformSiteModule: InferSelectResult; + }; + }, + Error, + CreatePlatformSiteModuleInput['platformSiteModule'] +>; +export function useCreatePlatformSiteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteModuleMutationKeys.create(), - mutationFn: (data: CreatePlatformSiteModuleInput["platformSiteModule"]) => getClient().platformSiteModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformSiteModuleInput['platformSiteModule']) => + getClient() + .platformSiteModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformSiteModuleKeys.lists() + queryKey: platformSiteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteMutation.ts index b3bff06691..af53c5ef06 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteMutation.ts @@ -4,62 +4,85 @@ * 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 { platformSiteKeys } from "../query-keys"; -import { platformSiteMutationKeys } from "../mutation-keys"; -import type { PlatformSiteSelect, PlatformSiteWithRelations, CreatePlatformSiteInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteSelect, PlatformSiteWithRelations, CreatePlatformSiteInput } from "../../orm/input-types"; +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 { platformSiteKeys } from '../query-keys'; +import { platformSiteMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteSelect, + PlatformSiteWithRelations, + CreatePlatformSiteInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteSelect, + PlatformSiteWithRelations, + CreatePlatformSiteInput, +} from '../../orm/input-types'; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformSiteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformSiteMutation(params: { - selection: ({ - fields: S & PlatformSiteSelect; - } & HookStrictSelect, PlatformSiteSelect>); -} & Omit; - }; -}, Error, CreatePlatformSiteInput["platformSite"]>, "mutationFn">): UseMutationResult<{ - createPlatformSite: { - platformSite: InferSelectResult; - }; -}, Error, CreatePlatformSiteInput["platformSite"]>; -export function useCreatePlatformSiteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformSiteMutation( + params: { + selection: { + fields: S & PlatformSiteSelect; + } & HookStrictSelect, PlatformSiteSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformSite: { + platformSite: InferSelectResult; + }; + }, + Error, + CreatePlatformSiteInput['platformSite'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformSite: { + platformSite: InferSelectResult; + }; + }, + Error, + CreatePlatformSiteInput['platformSite'] +>; +export function useCreatePlatformSiteMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteMutationKeys.create(), - mutationFn: (data: CreatePlatformSiteInput["platformSite"]) => getClient().platformSite.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformSiteInput['platformSite']) => + getClient() + .platformSite.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformSiteKeys.lists() + queryKey: platformSiteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteThemeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteThemeMutation.ts index 8458347373..cf081d31c3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteThemeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePlatformSiteThemeMutation.ts @@ -4,62 +4,88 @@ * 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 { platformSiteThemeKeys } from "../query-keys"; -import { platformSiteThemeMutationKeys } from "../mutation-keys"; -import type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations, CreatePlatformSiteThemeInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations, CreatePlatformSiteThemeInput } from "../../orm/input-types"; +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 { platformSiteThemeKeys } from '../query-keys'; +import { platformSiteThemeMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, + CreatePlatformSiteThemeInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, + CreatePlatformSiteThemeInput, +} from '../../orm/input-types'; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformSiteThemeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformSiteThemeMutation(params: { - selection: ({ - fields: S & PlatformSiteThemeSelect; - } & HookStrictSelect, PlatformSiteThemeSelect>); -} & Omit; - }; -}, Error, CreatePlatformSiteThemeInput["platformSiteTheme"]>, "mutationFn">): UseMutationResult<{ - createPlatformSiteTheme: { - platformSiteTheme: InferSelectResult; - }; -}, Error, CreatePlatformSiteThemeInput["platformSiteTheme"]>; -export function useCreatePlatformSiteThemeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformSiteThemeMutation( + params: { + selection: { + fields: S & PlatformSiteThemeSelect; + } & HookStrictSelect, PlatformSiteThemeSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformSiteTheme: { + platformSiteTheme: InferSelectResult; + }; + }, + Error, + CreatePlatformSiteThemeInput['platformSiteTheme'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformSiteTheme: { + platformSiteTheme: InferSelectResult; + }; + }, + Error, + CreatePlatformSiteThemeInput['platformSiteTheme'] +>; +export function useCreatePlatformSiteThemeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteThemeMutationKeys.create(), - mutationFn: (data: CreatePlatformSiteThemeInput["platformSiteTheme"]) => getClient().platformSiteTheme.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformSiteThemeInput['platformSiteTheme']) => + getClient() + .platformSiteTheme.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformSiteThemeKeys.lists() + queryKey: platformSiteThemeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePolicyMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePolicyMutation.ts index 95aed4f7eb..27702762dd 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePolicyMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePolicyMutation.ts @@ -4,62 +4,77 @@ * 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 { policyKeys } from "../query-keys"; -import { policyMutationKeys } from "../mutation-keys"; -import type { PolicySelect, PolicyWithRelations, CreatePolicyInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PolicySelect, PolicyWithRelations, CreatePolicyInput } from "../../orm/input-types"; +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 { policyKeys } from '../query-keys'; +import { policyMutationKeys } from '../mutation-keys'; +import type { PolicySelect, PolicyWithRelations, CreatePolicyInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PolicySelect, PolicyWithRelations, CreatePolicyInput } from '../../orm/input-types'; /** * Mutation hook for creating a Policy - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePolicyMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePolicyMutation(params: { - selection: ({ - fields: S & PolicySelect; - } & HookStrictSelect, PolicySelect>); -} & Omit; - }; -}, Error, CreatePolicyInput["policy"]>, "mutationFn">): UseMutationResult<{ - createPolicy: { - policy: InferSelectResult; - }; -}, Error, CreatePolicyInput["policy"]>; -export function useCreatePolicyMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePolicyMutation( + params: { + selection: { + fields: S & PolicySelect; + } & HookStrictSelect, PolicySelect>; + } & Omit< + UseMutationOptions< + { + createPolicy: { + policy: InferSelectResult; + }; + }, + Error, + CreatePolicyInput['policy'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPolicy: { + policy: InferSelectResult; + }; + }, + Error, + CreatePolicyInput['policy'] +>; +export function useCreatePolicyMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: policyMutationKeys.create(), - mutationFn: (data: CreatePolicyInput["policy"]) => getClient().policy.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePolicyInput['policy']) => + getClient() + .policy.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: policyKeys.lists() + queryKey: policyKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePrimaryKeyConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePrimaryKeyConstraintMutation.ts index 013152967a..87bdac4088 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePrimaryKeyConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePrimaryKeyConstraintMutation.ts @@ -4,62 +4,88 @@ * 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 { primaryKeyConstraintKeys } from "../query-keys"; -import { primaryKeyConstraintMutationKeys } from "../mutation-keys"; -import type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations, CreatePrimaryKeyConstraintInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations, CreatePrimaryKeyConstraintInput } from "../../orm/input-types"; +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 { primaryKeyConstraintKeys } from '../query-keys'; +import { primaryKeyConstraintMutationKeys } from '../mutation-keys'; +import type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, + CreatePrimaryKeyConstraintInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, + CreatePrimaryKeyConstraintInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PrimaryKeyConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePrimaryKeyConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePrimaryKeyConstraintMutation(params: { - selection: ({ - fields: S & PrimaryKeyConstraintSelect; - } & HookStrictSelect, PrimaryKeyConstraintSelect>); -} & Omit; - }; -}, Error, CreatePrimaryKeyConstraintInput["primaryKeyConstraint"]>, "mutationFn">): UseMutationResult<{ - createPrimaryKeyConstraint: { - primaryKeyConstraint: InferSelectResult; - }; -}, Error, CreatePrimaryKeyConstraintInput["primaryKeyConstraint"]>; -export function useCreatePrimaryKeyConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePrimaryKeyConstraintMutation( + params: { + selection: { + fields: S & PrimaryKeyConstraintSelect; + } & HookStrictSelect, PrimaryKeyConstraintSelect>; + } & Omit< + UseMutationOptions< + { + createPrimaryKeyConstraint: { + primaryKeyConstraint: InferSelectResult; + }; + }, + Error, + CreatePrimaryKeyConstraintInput['primaryKeyConstraint'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPrimaryKeyConstraint: { + primaryKeyConstraint: InferSelectResult; + }; + }, + Error, + CreatePrimaryKeyConstraintInput['primaryKeyConstraint'] +>; +export function useCreatePrimaryKeyConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: primaryKeyConstraintMutationKeys.create(), - mutationFn: (data: CreatePrimaryKeyConstraintInput["primaryKeyConstraint"]) => getClient().primaryKeyConstraint.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePrimaryKeyConstraintInput['primaryKeyConstraint']) => + getClient() + .primaryKeyConstraint.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: primaryKeyConstraintKeys.lists() + queryKey: primaryKeyConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreatePubkeySettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreatePubkeySettingMutation.ts index 3807aa0140..27eb209540 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreatePubkeySettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreatePubkeySettingMutation.ts @@ -4,62 +4,85 @@ * 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 { pubkeySettingKeys } from "../query-keys"; -import { pubkeySettingMutationKeys } from "../mutation-keys"; -import type { PubkeySettingSelect, PubkeySettingWithRelations, CreatePubkeySettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PubkeySettingSelect, PubkeySettingWithRelations, CreatePubkeySettingInput } from "../../orm/input-types"; +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 { pubkeySettingKeys } from '../query-keys'; +import { pubkeySettingMutationKeys } from '../mutation-keys'; +import type { + PubkeySettingSelect, + PubkeySettingWithRelations, + CreatePubkeySettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PubkeySettingSelect, + PubkeySettingWithRelations, + CreatePubkeySettingInput, +} from '../../orm/input-types'; /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePubkeySettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePubkeySettingMutation(params: { - selection: ({ - fields: S & PubkeySettingSelect; - } & HookStrictSelect, PubkeySettingSelect>); -} & Omit; - }; -}, Error, CreatePubkeySettingInput["pubkeySetting"]>, "mutationFn">): UseMutationResult<{ - createPubkeySetting: { - pubkeySetting: InferSelectResult; - }; -}, Error, CreatePubkeySettingInput["pubkeySetting"]>; -export function useCreatePubkeySettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePubkeySettingMutation( + params: { + selection: { + fields: S & PubkeySettingSelect; + } & HookStrictSelect, PubkeySettingSelect>; + } & Omit< + UseMutationOptions< + { + createPubkeySetting: { + pubkeySetting: InferSelectResult; + }; + }, + Error, + CreatePubkeySettingInput['pubkeySetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPubkeySetting: { + pubkeySetting: InferSelectResult; + }; + }, + Error, + CreatePubkeySettingInput['pubkeySetting'] +>; +export function useCreatePubkeySettingMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: pubkeySettingMutationKeys.create(), - mutationFn: (data: CreatePubkeySettingInput["pubkeySetting"]) => getClient().pubkeySetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePubkeySettingInput['pubkeySetting']) => + getClient() + .pubkeySetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: pubkeySettingKeys.lists() + queryKey: pubkeySettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateRlsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateRlsSettingMutation.ts index 7c2de96819..3fc4e90fd4 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateRlsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateRlsSettingMutation.ts @@ -4,62 +4,85 @@ * 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 { rlsSettingKeys } from "../query-keys"; -import { rlsSettingMutationKeys } from "../mutation-keys"; -import type { RlsSettingSelect, RlsSettingWithRelations, CreateRlsSettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsSettingSelect, RlsSettingWithRelations, CreateRlsSettingInput } from "../../orm/input-types"; +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 { rlsSettingKeys } from '../query-keys'; +import { rlsSettingMutationKeys } from '../mutation-keys'; +import type { + RlsSettingSelect, + RlsSettingWithRelations, + CreateRlsSettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RlsSettingSelect, + RlsSettingWithRelations, + CreateRlsSettingInput, +} from '../../orm/input-types'; /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRlsSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRlsSettingMutation(params: { - selection: ({ - fields: S & RlsSettingSelect; - } & HookStrictSelect, RlsSettingSelect>); -} & Omit; - }; -}, Error, CreateRlsSettingInput["rlsSetting"]>, "mutationFn">): UseMutationResult<{ - createRlsSetting: { - rlsSetting: InferSelectResult; - }; -}, Error, CreateRlsSettingInput["rlsSetting"]>; -export function useCreateRlsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRlsSettingMutation( + params: { + selection: { + fields: S & RlsSettingSelect; + } & HookStrictSelect, RlsSettingSelect>; + } & Omit< + UseMutationOptions< + { + createRlsSetting: { + rlsSetting: InferSelectResult; + }; + }, + Error, + CreateRlsSettingInput['rlsSetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRlsSetting: { + rlsSetting: InferSelectResult; + }; + }, + Error, + CreateRlsSettingInput['rlsSetting'] +>; +export function useCreateRlsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rlsSettingMutationKeys.create(), - mutationFn: (data: CreateRlsSettingInput["rlsSetting"]) => getClient().rlsSetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRlsSettingInput['rlsSetting']) => + getClient() + .rlsSetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: rlsSettingKeys.lists() + queryKey: rlsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateRouteBindingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateRouteBindingMutation.ts index 6f459971b0..82421aa2f0 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateRouteBindingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateRouteBindingMutation.ts @@ -4,62 +4,85 @@ * 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 { routeBindingKeys } from "../query-keys"; -import { routeBindingMutationKeys } from "../mutation-keys"; -import type { RouteBindingSelect, RouteBindingWithRelations, CreateRouteBindingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteBindingSelect, RouteBindingWithRelations, CreateRouteBindingInput } from "../../orm/input-types"; +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 { routeBindingKeys } from '../query-keys'; +import { routeBindingMutationKeys } from '../mutation-keys'; +import type { + RouteBindingSelect, + RouteBindingWithRelations, + CreateRouteBindingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RouteBindingSelect, + RouteBindingWithRelations, + CreateRouteBindingInput, +} from '../../orm/input-types'; /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRouteBindingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRouteBindingMutation(params: { - selection: ({ - fields: S & RouteBindingSelect; - } & HookStrictSelect, RouteBindingSelect>); -} & Omit; - }; -}, Error, CreateRouteBindingInput["routeBinding"]>, "mutationFn">): UseMutationResult<{ - createRouteBinding: { - routeBinding: InferSelectResult; - }; -}, Error, CreateRouteBindingInput["routeBinding"]>; -export function useCreateRouteBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRouteBindingMutation( + params: { + selection: { + fields: S & RouteBindingSelect; + } & HookStrictSelect, RouteBindingSelect>; + } & Omit< + UseMutationOptions< + { + createRouteBinding: { + routeBinding: InferSelectResult; + }; + }, + Error, + CreateRouteBindingInput['routeBinding'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRouteBinding: { + routeBinding: InferSelectResult; + }; + }, + Error, + CreateRouteBindingInput['routeBinding'] +>; +export function useCreateRouteBindingMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeBindingMutationKeys.create(), - mutationFn: (data: CreateRouteBindingInput["routeBinding"]) => getClient().routeBinding.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRouteBindingInput['routeBinding']) => + getClient() + .routeBinding.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: routeBindingKeys.lists() + queryKey: routeBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateRouteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateRouteMutation.ts index 7f7f730426..ebf1ae6026 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateRouteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateRouteMutation.ts @@ -4,62 +4,77 @@ * 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 { routeKeys } from "../query-keys"; -import { routeMutationKeys } from "../mutation-keys"; -import type { RouteSelect, RouteWithRelations, CreateRouteInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteSelect, RouteWithRelations, CreateRouteInput } from "../../orm/input-types"; +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 { routeKeys } from '../query-keys'; +import { routeMutationKeys } from '../mutation-keys'; +import type { RouteSelect, RouteWithRelations, CreateRouteInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RouteSelect, RouteWithRelations, CreateRouteInput } from '../../orm/input-types'; /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRouteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRouteMutation(params: { - selection: ({ - fields: S & RouteSelect; - } & HookStrictSelect, RouteSelect>); -} & Omit; - }; -}, Error, CreateRouteInput["route"]>, "mutationFn">): UseMutationResult<{ - createRoute: { - route: InferSelectResult; - }; -}, Error, CreateRouteInput["route"]>; -export function useCreateRouteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRouteMutation( + params: { + selection: { + fields: S & RouteSelect; + } & HookStrictSelect, RouteSelect>; + } & Omit< + UseMutationOptions< + { + createRoute: { + route: InferSelectResult; + }; + }, + Error, + CreateRouteInput['route'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRoute: { + route: InferSelectResult; + }; + }, + Error, + CreateRouteInput['route'] +>; +export function useCreateRouteMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeMutationKeys.create(), - mutationFn: (data: CreateRouteInput["route"]) => getClient().route.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRouteInput['route']) => + getClient() + .route.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: routeKeys.lists() + queryKey: routeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateSchemaGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateSchemaGrantMutation.ts index 1ec672f83f..80ebebb002 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateSchemaGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateSchemaGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { schemaGrantKeys } from "../query-keys"; -import { schemaGrantMutationKeys } from "../mutation-keys"; -import type { SchemaGrantSelect, SchemaGrantWithRelations, CreateSchemaGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaGrantSelect, SchemaGrantWithRelations, CreateSchemaGrantInput } from "../../orm/input-types"; +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 { schemaGrantKeys } from '../query-keys'; +import { schemaGrantMutationKeys } from '../mutation-keys'; +import type { + SchemaGrantSelect, + SchemaGrantWithRelations, + CreateSchemaGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SchemaGrantSelect, + SchemaGrantWithRelations, + CreateSchemaGrantInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a SchemaGrant - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSchemaGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSchemaGrantMutation(params: { - selection: ({ - fields: S & SchemaGrantSelect; - } & HookStrictSelect, SchemaGrantSelect>); -} & Omit; - }; -}, Error, CreateSchemaGrantInput["schemaGrant"]>, "mutationFn">): UseMutationResult<{ - createSchemaGrant: { - schemaGrant: InferSelectResult; - }; -}, Error, CreateSchemaGrantInput["schemaGrant"]>; -export function useCreateSchemaGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSchemaGrantMutation( + params: { + selection: { + fields: S & SchemaGrantSelect; + } & HookStrictSelect, SchemaGrantSelect>; + } & Omit< + UseMutationOptions< + { + createSchemaGrant: { + schemaGrant: InferSelectResult; + }; + }, + Error, + CreateSchemaGrantInput['schemaGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSchemaGrant: { + schemaGrant: InferSelectResult; + }; + }, + Error, + CreateSchemaGrantInput['schemaGrant'] +>; +export function useCreateSchemaGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: schemaGrantMutationKeys.create(), - mutationFn: (data: CreateSchemaGrantInput["schemaGrant"]) => getClient().schemaGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSchemaGrantInput['schemaGrant']) => + getClient() + .schemaGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: schemaGrantKeys.lists() + queryKey: schemaGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateSchemaMutation.ts index 6b9c1f1c24..427b850ef6 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateSchemaMutation.ts @@ -4,62 +4,77 @@ * 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 { schemaKeys } from "../query-keys"; -import { schemaMutationKeys } from "../mutation-keys"; -import type { SchemaSelect, SchemaWithRelations, CreateSchemaInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaSelect, SchemaWithRelations, CreateSchemaInput } from "../../orm/input-types"; +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 { schemaKeys } from '../query-keys'; +import { schemaMutationKeys } from '../mutation-keys'; +import type { SchemaSelect, SchemaWithRelations, CreateSchemaInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SchemaSelect, SchemaWithRelations, CreateSchemaInput } from '../../orm/input-types'; /** * Mutation hook for creating a Schema - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSchemaMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSchemaMutation(params: { - selection: ({ - fields: S & SchemaSelect; - } & HookStrictSelect, SchemaSelect>); -} & Omit; - }; -}, Error, CreateSchemaInput["schema"]>, "mutationFn">): UseMutationResult<{ - createSchema: { - schema: InferSelectResult; - }; -}, Error, CreateSchemaInput["schema"]>; -export function useCreateSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSchemaMutation( + params: { + selection: { + fields: S & SchemaSelect; + } & HookStrictSelect, SchemaSelect>; + } & Omit< + UseMutationOptions< + { + createSchema: { + schema: InferSelectResult; + }; + }, + Error, + CreateSchemaInput['schema'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSchema: { + schema: InferSelectResult; + }; + }, + Error, + CreateSchemaInput['schema'] +>; +export function useCreateSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: schemaMutationKeys.create(), - mutationFn: (data: CreateSchemaInput["schema"]) => getClient().schema.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSchemaInput['schema']) => + getClient() + .schema.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: schemaKeys.lists() + queryKey: schemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteMetadatumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteMetadatumMutation.ts index d54ae39aed..c406847469 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteMetadatumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteMetadatumMutation.ts @@ -4,62 +4,85 @@ * 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 { siteMetadatumKeys } from "../query-keys"; -import { siteMetadatumMutationKeys } from "../mutation-keys"; -import type { SiteMetadatumSelect, SiteMetadatumWithRelations, CreateSiteMetadatumInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteMetadatumSelect, SiteMetadatumWithRelations, CreateSiteMetadatumInput } from "../../orm/input-types"; +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 { siteMetadatumKeys } from '../query-keys'; +import { siteMetadatumMutationKeys } from '../mutation-keys'; +import type { + SiteMetadatumSelect, + SiteMetadatumWithRelations, + CreateSiteMetadatumInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteMetadatumSelect, + SiteMetadatumWithRelations, + CreateSiteMetadatumInput, +} from '../../orm/input-types'; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSiteMetadatumMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSiteMetadatumMutation(params: { - selection: ({ - fields: S & SiteMetadatumSelect; - } & HookStrictSelect, SiteMetadatumSelect>); -} & Omit; - }; -}, Error, CreateSiteMetadatumInput["siteMetadatum"]>, "mutationFn">): UseMutationResult<{ - createSiteMetadatum: { - siteMetadatum: InferSelectResult; - }; -}, Error, CreateSiteMetadatumInput["siteMetadatum"]>; -export function useCreateSiteMetadatumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSiteMetadatumMutation( + params: { + selection: { + fields: S & SiteMetadatumSelect; + } & HookStrictSelect, SiteMetadatumSelect>; + } & Omit< + UseMutationOptions< + { + createSiteMetadatum: { + siteMetadatum: InferSelectResult; + }; + }, + Error, + CreateSiteMetadatumInput['siteMetadatum'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSiteMetadatum: { + siteMetadatum: InferSelectResult; + }; + }, + Error, + CreateSiteMetadatumInput['siteMetadatum'] +>; +export function useCreateSiteMetadatumMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteMetadatumMutationKeys.create(), - mutationFn: (data: CreateSiteMetadatumInput["siteMetadatum"]) => getClient().siteMetadatum.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSiteMetadatumInput['siteMetadatum']) => + getClient() + .siteMetadatum.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: siteMetadatumKeys.lists() + queryKey: siteMetadatumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteModuleMutation.ts index 6184fe3794..c9fdcc7beb 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { siteModuleKeys } from "../query-keys"; -import { siteModuleMutationKeys } from "../mutation-keys"; -import type { SiteModuleSelect, SiteModuleWithRelations, CreateSiteModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteModuleSelect, SiteModuleWithRelations, CreateSiteModuleInput } from "../../orm/input-types"; +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 { siteModuleKeys } from '../query-keys'; +import { siteModuleMutationKeys } from '../mutation-keys'; +import type { + SiteModuleSelect, + SiteModuleWithRelations, + CreateSiteModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteModuleSelect, + SiteModuleWithRelations, + CreateSiteModuleInput, +} from '../../orm/input-types'; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSiteModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSiteModuleMutation(params: { - selection: ({ - fields: S & SiteModuleSelect; - } & HookStrictSelect, SiteModuleSelect>); -} & Omit; - }; -}, Error, CreateSiteModuleInput["siteModule"]>, "mutationFn">): UseMutationResult<{ - createSiteModule: { - siteModule: InferSelectResult; - }; -}, Error, CreateSiteModuleInput["siteModule"]>; -export function useCreateSiteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSiteModuleMutation( + params: { + selection: { + fields: S & SiteModuleSelect; + } & HookStrictSelect, SiteModuleSelect>; + } & Omit< + UseMutationOptions< + { + createSiteModule: { + siteModule: InferSelectResult; + }; + }, + Error, + CreateSiteModuleInput['siteModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSiteModule: { + siteModule: InferSelectResult; + }; + }, + Error, + CreateSiteModuleInput['siteModule'] +>; +export function useCreateSiteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteModuleMutationKeys.create(), - mutationFn: (data: CreateSiteModuleInput["siteModule"]) => getClient().siteModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSiteModuleInput['siteModule']) => + getClient() + .siteModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: siteModuleKeys.lists() + queryKey: siteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteMutation.ts index 9843edcf27..c5b3ab3908 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteMutation.ts @@ -4,62 +4,77 @@ * 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 { siteKeys } from "../query-keys"; -import { siteMutationKeys } from "../mutation-keys"; -import type { SiteSelect, SiteWithRelations, CreateSiteInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSelect, SiteWithRelations, CreateSiteInput } from "../../orm/input-types"; +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 { siteKeys } from '../query-keys'; +import { siteMutationKeys } from '../mutation-keys'; +import type { SiteSelect, SiteWithRelations, CreateSiteInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteSelect, SiteWithRelations, CreateSiteInput } from '../../orm/input-types'; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSiteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSiteMutation(params: { - selection: ({ - fields: S & SiteSelect; - } & HookStrictSelect, SiteSelect>); -} & Omit; - }; -}, Error, CreateSiteInput["site"]>, "mutationFn">): UseMutationResult<{ - createSite: { - site: InferSelectResult; - }; -}, Error, CreateSiteInput["site"]>; -export function useCreateSiteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSiteMutation( + params: { + selection: { + fields: S & SiteSelect; + } & HookStrictSelect, SiteSelect>; + } & Omit< + UseMutationOptions< + { + createSite: { + site: InferSelectResult; + }; + }, + Error, + CreateSiteInput['site'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSite: { + site: InferSelectResult; + }; + }, + Error, + CreateSiteInput['site'] +>; +export function useCreateSiteMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteMutationKeys.create(), - mutationFn: (data: CreateSiteInput["site"]) => getClient().site.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSiteInput['site']) => + getClient() + .site.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: siteKeys.lists() + queryKey: siteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteThemeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteThemeMutation.ts index a61dfe483d..c7402b914a 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteThemeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateSiteThemeMutation.ts @@ -4,62 +4,85 @@ * 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 { siteThemeKeys } from "../query-keys"; -import { siteThemeMutationKeys } from "../mutation-keys"; -import type { SiteThemeSelect, SiteThemeWithRelations, CreateSiteThemeInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteThemeSelect, SiteThemeWithRelations, CreateSiteThemeInput } from "../../orm/input-types"; +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 { siteThemeKeys } from '../query-keys'; +import { siteThemeMutationKeys } from '../mutation-keys'; +import type { + SiteThemeSelect, + SiteThemeWithRelations, + CreateSiteThemeInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteThemeSelect, + SiteThemeWithRelations, + CreateSiteThemeInput, +} from '../../orm/input-types'; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSiteThemeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSiteThemeMutation(params: { - selection: ({ - fields: S & SiteThemeSelect; - } & HookStrictSelect, SiteThemeSelect>); -} & Omit; - }; -}, Error, CreateSiteThemeInput["siteTheme"]>, "mutationFn">): UseMutationResult<{ - createSiteTheme: { - siteTheme: InferSelectResult; - }; -}, Error, CreateSiteThemeInput["siteTheme"]>; -export function useCreateSiteThemeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSiteThemeMutation( + params: { + selection: { + fields: S & SiteThemeSelect; + } & HookStrictSelect, SiteThemeSelect>; + } & Omit< + UseMutationOptions< + { + createSiteTheme: { + siteTheme: InferSelectResult; + }; + }, + Error, + CreateSiteThemeInput['siteTheme'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSiteTheme: { + siteTheme: InferSelectResult; + }; + }, + Error, + CreateSiteThemeInput['siteTheme'] +>; +export function useCreateSiteThemeMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteThemeMutationKeys.create(), - mutationFn: (data: CreateSiteThemeInput["siteTheme"]) => getClient().siteTheme.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSiteThemeInput['siteTheme']) => + getClient() + .siteTheme.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: siteThemeKeys.lists() + queryKey: siteThemeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateSpatialRelationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateSpatialRelationMutation.ts index de897af8b0..6b3aae995e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateSpatialRelationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateSpatialRelationMutation.ts @@ -4,62 +4,88 @@ * 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 { spatialRelationKeys } from "../query-keys"; -import { spatialRelationMutationKeys } from "../mutation-keys"; -import type { SpatialRelationSelect, SpatialRelationWithRelations, CreateSpatialRelationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SpatialRelationSelect, SpatialRelationWithRelations, CreateSpatialRelationInput } from "../../orm/input-types"; +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 { spatialRelationKeys } from '../query-keys'; +import { spatialRelationMutationKeys } from '../mutation-keys'; +import type { + SpatialRelationSelect, + SpatialRelationWithRelations, + CreateSpatialRelationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SpatialRelationSelect, + SpatialRelationWithRelations, + CreateSpatialRelationInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a SpatialRelation - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSpatialRelationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSpatialRelationMutation(params: { - selection: ({ - fields: S & SpatialRelationSelect; - } & HookStrictSelect, SpatialRelationSelect>); -} & Omit; - }; -}, Error, CreateSpatialRelationInput["spatialRelation"]>, "mutationFn">): UseMutationResult<{ - createSpatialRelation: { - spatialRelation: InferSelectResult; - }; -}, Error, CreateSpatialRelationInput["spatialRelation"]>; -export function useCreateSpatialRelationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSpatialRelationMutation( + params: { + selection: { + fields: S & SpatialRelationSelect; + } & HookStrictSelect, SpatialRelationSelect>; + } & Omit< + UseMutationOptions< + { + createSpatialRelation: { + spatialRelation: InferSelectResult; + }; + }, + Error, + CreateSpatialRelationInput['spatialRelation'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSpatialRelation: { + spatialRelation: InferSelectResult; + }; + }, + Error, + CreateSpatialRelationInput['spatialRelation'] +>; +export function useCreateSpatialRelationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: spatialRelationMutationKeys.create(), - mutationFn: (data: CreateSpatialRelationInput["spatialRelation"]) => getClient().spatialRelation.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSpatialRelationInput['spatialRelation']) => + getClient() + .spatialRelation.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: spatialRelationKeys.lists() + queryKey: spatialRelationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateSqlActionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateSqlActionMutation.ts index fbbd996b21..d8eaa7564f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateSqlActionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateSqlActionMutation.ts @@ -4,62 +4,85 @@ * 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 { sqlActionKeys } from "../query-keys"; -import { sqlActionMutationKeys } from "../mutation-keys"; -import type { SqlActionSelect, SqlActionWithRelations, CreateSqlActionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SqlActionSelect, SqlActionWithRelations, CreateSqlActionInput } from "../../orm/input-types"; +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 { sqlActionKeys } from '../query-keys'; +import { sqlActionMutationKeys } from '../mutation-keys'; +import type { + SqlActionSelect, + SqlActionWithRelations, + CreateSqlActionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SqlActionSelect, + SqlActionWithRelations, + CreateSqlActionInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a SqlAction - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSqlActionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSqlActionMutation(params: { - selection: ({ - fields: S & SqlActionSelect; - } & HookStrictSelect, SqlActionSelect>); -} & Omit; - }; -}, Error, CreateSqlActionInput["sqlAction"]>, "mutationFn">): UseMutationResult<{ - createSqlAction: { - sqlAction: InferSelectResult; - }; -}, Error, CreateSqlActionInput["sqlAction"]>; -export function useCreateSqlActionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSqlActionMutation( + params: { + selection: { + fields: S & SqlActionSelect; + } & HookStrictSelect, SqlActionSelect>; + } & Omit< + UseMutationOptions< + { + createSqlAction: { + sqlAction: InferSelectResult; + }; + }, + Error, + CreateSqlActionInput['sqlAction'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSqlAction: { + sqlAction: InferSelectResult; + }; + }, + Error, + CreateSqlActionInput['sqlAction'] +>; +export function useCreateSqlActionMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: sqlActionMutationKeys.create(), - mutationFn: (data: CreateSqlActionInput["sqlAction"]) => getClient().sqlAction.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSqlActionInput['sqlAction']) => + getClient() + .sqlAction.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: sqlActionKeys.lists() + queryKey: sqlActionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateTableGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateTableGrantMutation.ts index d44e93eecb..e111ab768a 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateTableGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateTableGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { tableGrantKeys } from "../query-keys"; -import { tableGrantMutationKeys } from "../mutation-keys"; -import type { TableGrantSelect, TableGrantWithRelations, CreateTableGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableGrantSelect, TableGrantWithRelations, CreateTableGrantInput } from "../../orm/input-types"; +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 { tableGrantKeys } from '../query-keys'; +import { tableGrantMutationKeys } from '../mutation-keys'; +import type { + TableGrantSelect, + TableGrantWithRelations, + CreateTableGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TableGrantSelect, + TableGrantWithRelations, + CreateTableGrantInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a TableGrant - * + * * @example * ```tsx * const { mutate, isPending } = useCreateTableGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateTableGrantMutation(params: { - selection: ({ - fields: S & TableGrantSelect; - } & HookStrictSelect, TableGrantSelect>); -} & Omit; - }; -}, Error, CreateTableGrantInput["tableGrant"]>, "mutationFn">): UseMutationResult<{ - createTableGrant: { - tableGrant: InferSelectResult; - }; -}, Error, CreateTableGrantInput["tableGrant"]>; -export function useCreateTableGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateTableGrantMutation( + params: { + selection: { + fields: S & TableGrantSelect; + } & HookStrictSelect, TableGrantSelect>; + } & Omit< + UseMutationOptions< + { + createTableGrant: { + tableGrant: InferSelectResult; + }; + }, + Error, + CreateTableGrantInput['tableGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createTableGrant: { + tableGrant: InferSelectResult; + }; + }, + Error, + CreateTableGrantInput['tableGrant'] +>; +export function useCreateTableGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: tableGrantMutationKeys.create(), - mutationFn: (data: CreateTableGrantInput["tableGrant"]) => getClient().tableGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateTableGrantInput['tableGrant']) => + getClient() + .tableGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: tableGrantKeys.lists() + queryKey: tableGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateTableMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateTableMutation.ts index 7038ab4116..a14469fe11 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateTableMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateTableMutation.ts @@ -4,62 +4,77 @@ * 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 { tableKeys } from "../query-keys"; -import { tableMutationKeys } from "../mutation-keys"; -import type { TableSelect, TableWithRelations, CreateTableInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableSelect, TableWithRelations, CreateTableInput } from "../../orm/input-types"; +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 { tableKeys } from '../query-keys'; +import { tableMutationKeys } from '../mutation-keys'; +import type { TableSelect, TableWithRelations, CreateTableInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TableSelect, TableWithRelations, CreateTableInput } from '../../orm/input-types'; /** * Mutation hook for creating a Table - * + * * @example * ```tsx * const { mutate, isPending } = useCreateTableMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateTableMutation(params: { - selection: ({ - fields: S & TableSelect; - } & HookStrictSelect, TableSelect>); -} & Omit; - }; -}, Error, CreateTableInput["table"]>, "mutationFn">): UseMutationResult<{ - createTable: { - table: InferSelectResult; - }; -}, Error, CreateTableInput["table"]>; -export function useCreateTableMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateTableMutation( + params: { + selection: { + fields: S & TableSelect; + } & HookStrictSelect, TableSelect>; + } & Omit< + UseMutationOptions< + { + createTable: { + table: InferSelectResult; + }; + }, + Error, + CreateTableInput['table'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createTable: { + table: InferSelectResult; + }; + }, + Error, + CreateTableInput['table'] +>; +export function useCreateTableMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: tableMutationKeys.create(), - mutationFn: (data: CreateTableInput["table"]) => getClient().table.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateTableInput['table']) => + getClient() + .table.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: tableKeys.lists() + queryKey: tableKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateTriggerFunctionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateTriggerFunctionMutation.ts index 553f42a945..f9e47f2bea 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateTriggerFunctionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateTriggerFunctionMutation.ts @@ -4,62 +4,88 @@ * 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 { triggerFunctionKeys } from "../query-keys"; -import { triggerFunctionMutationKeys } from "../mutation-keys"; -import type { TriggerFunctionSelect, TriggerFunctionWithRelations, CreateTriggerFunctionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerFunctionSelect, TriggerFunctionWithRelations, CreateTriggerFunctionInput } from "../../orm/input-types"; +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 { triggerFunctionKeys } from '../query-keys'; +import { triggerFunctionMutationKeys } from '../mutation-keys'; +import type { + TriggerFunctionSelect, + TriggerFunctionWithRelations, + CreateTriggerFunctionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TriggerFunctionSelect, + TriggerFunctionWithRelations, + CreateTriggerFunctionInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a TriggerFunction - * + * * @example * ```tsx * const { mutate, isPending } = useCreateTriggerFunctionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateTriggerFunctionMutation(params: { - selection: ({ - fields: S & TriggerFunctionSelect; - } & HookStrictSelect, TriggerFunctionSelect>); -} & Omit; - }; -}, Error, CreateTriggerFunctionInput["triggerFunction"]>, "mutationFn">): UseMutationResult<{ - createTriggerFunction: { - triggerFunction: InferSelectResult; - }; -}, Error, CreateTriggerFunctionInput["triggerFunction"]>; -export function useCreateTriggerFunctionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateTriggerFunctionMutation( + params: { + selection: { + fields: S & TriggerFunctionSelect; + } & HookStrictSelect, TriggerFunctionSelect>; + } & Omit< + UseMutationOptions< + { + createTriggerFunction: { + triggerFunction: InferSelectResult; + }; + }, + Error, + CreateTriggerFunctionInput['triggerFunction'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createTriggerFunction: { + triggerFunction: InferSelectResult; + }; + }, + Error, + CreateTriggerFunctionInput['triggerFunction'] +>; +export function useCreateTriggerFunctionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: triggerFunctionMutationKeys.create(), - mutationFn: (data: CreateTriggerFunctionInput["triggerFunction"]) => getClient().triggerFunction.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateTriggerFunctionInput['triggerFunction']) => + getClient() + .triggerFunction.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: triggerFunctionKeys.lists() + queryKey: triggerFunctionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateTriggerMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateTriggerMutation.ts index b5fac4c775..1a8e8a9f80 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateTriggerMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateTriggerMutation.ts @@ -4,62 +4,85 @@ * 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 { triggerKeys } from "../query-keys"; -import { triggerMutationKeys } from "../mutation-keys"; -import type { TriggerSelect, TriggerWithRelations, CreateTriggerInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerSelect, TriggerWithRelations, CreateTriggerInput } from "../../orm/input-types"; +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 { triggerKeys } from '../query-keys'; +import { triggerMutationKeys } from '../mutation-keys'; +import type { + TriggerSelect, + TriggerWithRelations, + CreateTriggerInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TriggerSelect, + TriggerWithRelations, + CreateTriggerInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a Trigger - * + * * @example * ```tsx * const { mutate, isPending } = useCreateTriggerMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateTriggerMutation(params: { - selection: ({ - fields: S & TriggerSelect; - } & HookStrictSelect, TriggerSelect>); -} & Omit; - }; -}, Error, CreateTriggerInput["trigger"]>, "mutationFn">): UseMutationResult<{ - createTrigger: { - trigger: InferSelectResult; - }; -}, Error, CreateTriggerInput["trigger"]>; -export function useCreateTriggerMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateTriggerMutation( + params: { + selection: { + fields: S & TriggerSelect; + } & HookStrictSelect, TriggerSelect>; + } & Omit< + UseMutationOptions< + { + createTrigger: { + trigger: InferSelectResult; + }; + }, + Error, + CreateTriggerInput['trigger'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createTrigger: { + trigger: InferSelectResult; + }; + }, + Error, + CreateTriggerInput['trigger'] +>; +export function useCreateTriggerMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: triggerMutationKeys.create(), - mutationFn: (data: CreateTriggerInput["trigger"]) => getClient().trigger.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateTriggerInput['trigger']) => + getClient() + .trigger.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: triggerKeys.lists() + queryKey: triggerKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateUniqueConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateUniqueConstraintMutation.ts index 083c8a98e5..9dde059c6d 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateUniqueConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateUniqueConstraintMutation.ts @@ -4,62 +4,88 @@ * 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 { uniqueConstraintKeys } from "../query-keys"; -import { uniqueConstraintMutationKeys } from "../mutation-keys"; -import type { UniqueConstraintSelect, UniqueConstraintWithRelations, CreateUniqueConstraintInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UniqueConstraintSelect, UniqueConstraintWithRelations, CreateUniqueConstraintInput } from "../../orm/input-types"; +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 { uniqueConstraintKeys } from '../query-keys'; +import { uniqueConstraintMutationKeys } from '../mutation-keys'; +import type { + UniqueConstraintSelect, + UniqueConstraintWithRelations, + CreateUniqueConstraintInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UniqueConstraintSelect, + UniqueConstraintWithRelations, + CreateUniqueConstraintInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a UniqueConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useCreateUniqueConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateUniqueConstraintMutation(params: { - selection: ({ - fields: S & UniqueConstraintSelect; - } & HookStrictSelect, UniqueConstraintSelect>); -} & Omit; - }; -}, Error, CreateUniqueConstraintInput["uniqueConstraint"]>, "mutationFn">): UseMutationResult<{ - createUniqueConstraint: { - uniqueConstraint: InferSelectResult; - }; -}, Error, CreateUniqueConstraintInput["uniqueConstraint"]>; -export function useCreateUniqueConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateUniqueConstraintMutation( + params: { + selection: { + fields: S & UniqueConstraintSelect; + } & HookStrictSelect, UniqueConstraintSelect>; + } & Omit< + UseMutationOptions< + { + createUniqueConstraint: { + uniqueConstraint: InferSelectResult; + }; + }, + Error, + CreateUniqueConstraintInput['uniqueConstraint'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createUniqueConstraint: { + uniqueConstraint: InferSelectResult; + }; + }, + Error, + CreateUniqueConstraintInput['uniqueConstraint'] +>; +export function useCreateUniqueConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: uniqueConstraintMutationKeys.create(), - mutationFn: (data: CreateUniqueConstraintInput["uniqueConstraint"]) => getClient().uniqueConstraint.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateUniqueConstraintInput['uniqueConstraint']) => + getClient() + .uniqueConstraint.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: uniqueConstraintKeys.lists() + queryKey: uniqueConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateViewGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateViewGrantMutation.ts index 58ddc84fcf..16b37b3791 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateViewGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateViewGrantMutation.ts @@ -4,62 +4,85 @@ * 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 { viewGrantKeys } from "../query-keys"; -import { viewGrantMutationKeys } from "../mutation-keys"; -import type { ViewGrantSelect, ViewGrantWithRelations, CreateViewGrantInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewGrantSelect, ViewGrantWithRelations, CreateViewGrantInput } from "../../orm/input-types"; +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 { viewGrantKeys } from '../query-keys'; +import { viewGrantMutationKeys } from '../mutation-keys'; +import type { + ViewGrantSelect, + ViewGrantWithRelations, + CreateViewGrantInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ViewGrantSelect, + ViewGrantWithRelations, + CreateViewGrantInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ViewGrant - * + * * @example * ```tsx * const { mutate, isPending } = useCreateViewGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateViewGrantMutation(params: { - selection: ({ - fields: S & ViewGrantSelect; - } & HookStrictSelect, ViewGrantSelect>); -} & Omit; - }; -}, Error, CreateViewGrantInput["viewGrant"]>, "mutationFn">): UseMutationResult<{ - createViewGrant: { - viewGrant: InferSelectResult; - }; -}, Error, CreateViewGrantInput["viewGrant"]>; -export function useCreateViewGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateViewGrantMutation( + params: { + selection: { + fields: S & ViewGrantSelect; + } & HookStrictSelect, ViewGrantSelect>; + } & Omit< + UseMutationOptions< + { + createViewGrant: { + viewGrant: InferSelectResult; + }; + }, + Error, + CreateViewGrantInput['viewGrant'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createViewGrant: { + viewGrant: InferSelectResult; + }; + }, + Error, + CreateViewGrantInput['viewGrant'] +>; +export function useCreateViewGrantMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewGrantMutationKeys.create(), - mutationFn: (data: CreateViewGrantInput["viewGrant"]) => getClient().viewGrant.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateViewGrantInput['viewGrant']) => + getClient() + .viewGrant.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: viewGrantKeys.lists() + queryKey: viewGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateViewMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateViewMutation.ts index c8dea791de..91e59f1e5a 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateViewMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateViewMutation.ts @@ -4,62 +4,77 @@ * 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 { viewKeys } from "../query-keys"; -import { viewMutationKeys } from "../mutation-keys"; -import type { ViewSelect, ViewWithRelations, CreateViewInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewSelect, ViewWithRelations, CreateViewInput } from "../../orm/input-types"; +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 { viewKeys } from '../query-keys'; +import { viewMutationKeys } from '../mutation-keys'; +import type { ViewSelect, ViewWithRelations, CreateViewInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewSelect, ViewWithRelations, CreateViewInput } from '../../orm/input-types'; /** * Mutation hook for creating a View - * + * * @example * ```tsx * const { mutate, isPending } = useCreateViewMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateViewMutation(params: { - selection: ({ - fields: S & ViewSelect; - } & HookStrictSelect, ViewSelect>); -} & Omit; - }; -}, Error, CreateViewInput["view"]>, "mutationFn">): UseMutationResult<{ - createView: { - view: InferSelectResult; - }; -}, Error, CreateViewInput["view"]>; -export function useCreateViewMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateViewMutation( + params: { + selection: { + fields: S & ViewSelect; + } & HookStrictSelect, ViewSelect>; + } & Omit< + UseMutationOptions< + { + createView: { + view: InferSelectResult; + }; + }, + Error, + CreateViewInput['view'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createView: { + view: InferSelectResult; + }; + }, + Error, + CreateViewInput['view'] +>; +export function useCreateViewMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewMutationKeys.create(), - mutationFn: (data: CreateViewInput["view"]) => getClient().view.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateViewInput['view']) => + getClient() + .view.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: viewKeys.lists() + queryKey: viewKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateViewRuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateViewRuleMutation.ts index 6412cacf3d..5b3cebb1b4 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateViewRuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateViewRuleMutation.ts @@ -4,62 +4,85 @@ * 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 { viewRuleKeys } from "../query-keys"; -import { viewRuleMutationKeys } from "../mutation-keys"; -import type { ViewRuleSelect, ViewRuleWithRelations, CreateViewRuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewRuleSelect, ViewRuleWithRelations, CreateViewRuleInput } from "../../orm/input-types"; +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 { viewRuleKeys } from '../query-keys'; +import { viewRuleMutationKeys } from '../mutation-keys'; +import type { + ViewRuleSelect, + ViewRuleWithRelations, + CreateViewRuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ViewRuleSelect, + ViewRuleWithRelations, + CreateViewRuleInput, +} from '../../orm/input-types'; /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateViewRuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateViewRuleMutation(params: { - selection: ({ - fields: S & ViewRuleSelect; - } & HookStrictSelect, ViewRuleSelect>); -} & Omit; - }; -}, Error, CreateViewRuleInput["viewRule"]>, "mutationFn">): UseMutationResult<{ - createViewRule: { - viewRule: InferSelectResult; - }; -}, Error, CreateViewRuleInput["viewRule"]>; -export function useCreateViewRuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateViewRuleMutation( + params: { + selection: { + fields: S & ViewRuleSelect; + } & HookStrictSelect, ViewRuleSelect>; + } & Omit< + UseMutationOptions< + { + createViewRule: { + viewRule: InferSelectResult; + }; + }, + Error, + CreateViewRuleInput['viewRule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createViewRule: { + viewRule: InferSelectResult; + }; + }, + Error, + CreateViewRuleInput['viewRule'] +>; +export function useCreateViewRuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewRuleMutationKeys.create(), - mutationFn: (data: CreateViewRuleInput["viewRule"]) => getClient().viewRule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateViewRuleInput['viewRule']) => + getClient() + .viewRule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: viewRuleKeys.lists() + queryKey: viewRuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateViewTableMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateViewTableMutation.ts index 7a212ca68d..f21006d6b3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateViewTableMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateViewTableMutation.ts @@ -4,62 +4,85 @@ * 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 { viewTableKeys } from "../query-keys"; -import { viewTableMutationKeys } from "../mutation-keys"; -import type { ViewTableSelect, ViewTableWithRelations, CreateViewTableInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewTableSelect, ViewTableWithRelations, CreateViewTableInput } from "../../orm/input-types"; +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 { viewTableKeys } from '../query-keys'; +import { viewTableMutationKeys } from '../mutation-keys'; +import type { + ViewTableSelect, + ViewTableWithRelations, + CreateViewTableInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ViewTableSelect, + ViewTableWithRelations, + CreateViewTableInput, +} from '../../orm/input-types'; /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```tsx * const { mutate, isPending } = useCreateViewTableMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateViewTableMutation(params: { - selection: ({ - fields: S & ViewTableSelect; - } & HookStrictSelect, ViewTableSelect>); -} & Omit; - }; -}, Error, CreateViewTableInput["viewTable"]>, "mutationFn">): UseMutationResult<{ - createViewTable: { - viewTable: InferSelectResult; - }; -}, Error, CreateViewTableInput["viewTable"]>; -export function useCreateViewTableMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateViewTableMutation( + params: { + selection: { + fields: S & ViewTableSelect; + } & HookStrictSelect, ViewTableSelect>; + } & Omit< + UseMutationOptions< + { + createViewTable: { + viewTable: InferSelectResult; + }; + }, + Error, + CreateViewTableInput['viewTable'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createViewTable: { + viewTable: InferSelectResult; + }; + }, + Error, + CreateViewTableInput['viewTable'] +>; +export function useCreateViewTableMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewTableMutationKeys.create(), - mutationFn: (data: CreateViewTableInput["viewTable"]) => getClient().viewTable.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateViewTableInput['viewTable']) => + getClient() + .viewTable.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: viewTableKeys.lists() + queryKey: viewTableKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useCreateWebauthnSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useCreateWebauthnSettingMutation.ts index a0147123e5..32f3cad325 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useCreateWebauthnSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useCreateWebauthnSettingMutation.ts @@ -4,62 +4,88 @@ * 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 { webauthnSettingKeys } from "../query-keys"; -import { webauthnSettingMutationKeys } from "../mutation-keys"; -import type { WebauthnSettingSelect, WebauthnSettingWithRelations, CreateWebauthnSettingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnSettingSelect, WebauthnSettingWithRelations, CreateWebauthnSettingInput } from "../../orm/input-types"; +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 { webauthnSettingKeys } from '../query-keys'; +import { webauthnSettingMutationKeys } from '../mutation-keys'; +import type { + WebauthnSettingSelect, + WebauthnSettingWithRelations, + CreateWebauthnSettingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnSettingSelect, + WebauthnSettingWithRelations, + CreateWebauthnSettingInput, +} from '../../orm/input-types'; /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```tsx * const { mutate, isPending } = useCreateWebauthnSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateWebauthnSettingMutation(params: { - selection: ({ - fields: S & WebauthnSettingSelect; - } & HookStrictSelect, WebauthnSettingSelect>); -} & Omit; - }; -}, Error, CreateWebauthnSettingInput["webauthnSetting"]>, "mutationFn">): UseMutationResult<{ - createWebauthnSetting: { - webauthnSetting: InferSelectResult; - }; -}, Error, CreateWebauthnSettingInput["webauthnSetting"]>; -export function useCreateWebauthnSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateWebauthnSettingMutation( + params: { + selection: { + fields: S & WebauthnSettingSelect; + } & HookStrictSelect, WebauthnSettingSelect>; + } & Omit< + UseMutationOptions< + { + createWebauthnSetting: { + webauthnSetting: InferSelectResult; + }; + }, + Error, + CreateWebauthnSettingInput['webauthnSetting'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createWebauthnSetting: { + webauthnSetting: InferSelectResult; + }; + }, + Error, + CreateWebauthnSettingInput['webauthnSetting'] +>; +export function useCreateWebauthnSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnSettingMutationKeys.create(), - mutationFn: (data: CreateWebauthnSettingInput["webauthnSetting"]) => getClient().webauthnSetting.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateWebauthnSettingInput['webauthnSetting']) => + getClient() + .webauthnSetting.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: webauthnSettingKeys.lists() + queryKey: webauthnSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiModuleMutation.ts index 6689270f15..43a5766070 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { apiModuleKeys } from "../query-keys"; -import { apiModuleMutationKeys } from "../mutation-keys"; -import type { ApiModuleSelect, ApiModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiModuleSelect, ApiModuleWithRelations } from "../../orm/input-types"; +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 { apiModuleKeys } from '../query-keys'; +import { apiModuleMutationKeys } from '../mutation-keys'; +import type { ApiModuleSelect, ApiModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiModuleSelect, ApiModuleWithRelations } from '../../orm/input-types'; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteApiModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteApiModuleMutation(params: { - selection: ({ - fields: S & ApiModuleSelect; - } & HookStrictSelect, ApiModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteApiModule: { - apiModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteApiModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteApiModuleMutation( + params: { + selection: { + fields: S & ApiModuleSelect; + } & HookStrictSelect, ApiModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteApiModule: { + apiModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteApiModule: { + apiModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteApiModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().apiModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .apiModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: apiModuleKeys.detail(variables.id) + queryKey: apiModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiModuleKeys.lists() + queryKey: apiModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiMutation.ts index de00d0bf7e..54c518339d 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiMutation.ts @@ -4,77 +4,95 @@ * 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 { apiKeys } from "../query-keys"; -import { apiMutationKeys } from "../mutation-keys"; -import type { ApiSelect, ApiWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSelect, ApiWithRelations } from "../../orm/input-types"; +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 { apiKeys } from '../query-keys'; +import { apiMutationKeys } from '../mutation-keys'; +import type { ApiSelect, ApiWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSelect, ApiWithRelations } from '../../orm/input-types'; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteApiMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteApiMutation(params: { - selection: ({ - fields: S & ApiSelect; - } & HookStrictSelect, ApiSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteApi: { - api: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteApiMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteApiMutation( + params: { + selection: { + fields: S & ApiSelect; + } & HookStrictSelect, ApiSelect>; + } & Omit< + UseMutationOptions< + { + deleteApi: { + api: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteApi: { + api: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteApiMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().api.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .api.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: apiKeys.detail(variables.id) + queryKey: apiKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiKeys.lists() + queryKey: apiKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiSchemaMutation.ts index 2229fd0a3b..e21e125451 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiSchemaMutation.ts @@ -4,77 +4,95 @@ * 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 { apiSchemaKeys } from "../query-keys"; -import { apiSchemaMutationKeys } from "../mutation-keys"; -import type { ApiSchemaSelect, ApiSchemaWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSchemaSelect, ApiSchemaWithRelations } from "../../orm/input-types"; +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 { apiSchemaKeys } from '../query-keys'; +import { apiSchemaMutationKeys } from '../mutation-keys'; +import type { ApiSchemaSelect, ApiSchemaWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSchemaSelect, ApiSchemaWithRelations } from '../../orm/input-types'; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteApiSchemaMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteApiSchemaMutation(params: { - selection: ({ - fields: S & ApiSchemaSelect; - } & HookStrictSelect, ApiSchemaSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteApiSchema: { - apiSchema: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteApiSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteApiSchemaMutation( + params: { + selection: { + fields: S & ApiSchemaSelect; + } & HookStrictSelect, ApiSchemaSelect>; + } & Omit< + UseMutationOptions< + { + deleteApiSchema: { + apiSchema: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteApiSchema: { + apiSchema: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteApiSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSchemaMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().apiSchema.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .apiSchema.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: apiSchemaKeys.detail(variables.id) + queryKey: apiSchemaKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiSchemaKeys.lists() + queryKey: apiSchemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiSettingMutation.ts index daf896d290..2c44130719 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteApiSettingMutation.ts @@ -4,77 +4,95 @@ * 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 { apiSettingKeys } from "../query-keys"; -import { apiSettingMutationKeys } from "../mutation-keys"; -import type { ApiSettingSelect, ApiSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSettingSelect, ApiSettingWithRelations } from "../../orm/input-types"; +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 { apiSettingKeys } from '../query-keys'; +import { apiSettingMutationKeys } from '../mutation-keys'; +import type { ApiSettingSelect, ApiSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSettingSelect, ApiSettingWithRelations } from '../../orm/input-types'; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteApiSettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteApiSettingMutation(params: { - selection: ({ - fields: S & ApiSettingSelect; - } & HookStrictSelect, ApiSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteApiSetting: { - apiSetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteApiSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteApiSettingMutation( + params: { + selection: { + fields: S & ApiSettingSelect; + } & HookStrictSelect, ApiSettingSelect>; + } & Omit< + UseMutationOptions< + { + deleteApiSetting: { + apiSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteApiSetting: { + apiSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteApiSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().apiSetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .apiSetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: apiSettingKeys.detail(variables.id) + queryKey: apiSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiSettingKeys.lists() + queryKey: apiSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteCheckConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteCheckConstraintMutation.ts index 054889d218..8f5aa71901 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteCheckConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteCheckConstraintMutation.ts @@ -4,77 +4,95 @@ * 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 { checkConstraintKeys } from "../query-keys"; -import { checkConstraintMutationKeys } from "../mutation-keys"; -import type { CheckConstraintSelect, CheckConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CheckConstraintSelect, CheckConstraintWithRelations } from "../../orm/input-types"; +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 { checkConstraintKeys } from '../query-keys'; +import { checkConstraintMutationKeys } from '../mutation-keys'; +import type { CheckConstraintSelect, CheckConstraintWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CheckConstraintSelect, CheckConstraintWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a CheckConstraint with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteCheckConstraintMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteCheckConstraintMutation(params: { - selection: ({ - fields: S & CheckConstraintSelect; - } & HookStrictSelect, CheckConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteCheckConstraint: { - checkConstraint: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteCheckConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteCheckConstraintMutation( + params: { + selection: { + fields: S & CheckConstraintSelect; + } & HookStrictSelect, CheckConstraintSelect>; + } & Omit< + UseMutationOptions< + { + deleteCheckConstraint: { + checkConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteCheckConstraint: { + checkConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteCheckConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: checkConstraintMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().checkConstraint.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .checkConstraint.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: checkConstraintKeys.detail(variables.id) + queryKey: checkConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: checkConstraintKeys.lists() + queryKey: checkConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteCompositeTypeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteCompositeTypeMutation.ts index 5398dbe2fc..661e08ff3a 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteCompositeTypeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteCompositeTypeMutation.ts @@ -4,77 +4,95 @@ * 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 { compositeTypeKeys } from "../query-keys"; -import { compositeTypeMutationKeys } from "../mutation-keys"; -import type { CompositeTypeSelect, CompositeTypeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CompositeTypeSelect, CompositeTypeWithRelations } from "../../orm/input-types"; +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 { compositeTypeKeys } from '../query-keys'; +import { compositeTypeMutationKeys } from '../mutation-keys'; +import type { CompositeTypeSelect, CompositeTypeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CompositeTypeSelect, CompositeTypeWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a CompositeType with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteCompositeTypeMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteCompositeTypeMutation(params: { - selection: ({ - fields: S & CompositeTypeSelect; - } & HookStrictSelect, CompositeTypeSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteCompositeType: { - compositeType: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteCompositeTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteCompositeTypeMutation( + params: { + selection: { + fields: S & CompositeTypeSelect; + } & HookStrictSelect, CompositeTypeSelect>; + } & Omit< + UseMutationOptions< + { + deleteCompositeType: { + compositeType: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteCompositeType: { + compositeType: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteCompositeTypeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: compositeTypeMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().compositeType.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .compositeType.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: compositeTypeKeys.detail(variables.id) + queryKey: compositeTypeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: compositeTypeKeys.lists() + queryKey: compositeTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteCorsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteCorsSettingMutation.ts index 8c5c993f14..b4a48e3fd2 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteCorsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteCorsSettingMutation.ts @@ -4,77 +4,95 @@ * 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 { corsSettingKeys } from "../query-keys"; -import { corsSettingMutationKeys } from "../mutation-keys"; -import type { CorsSettingSelect, CorsSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CorsSettingSelect, CorsSettingWithRelations } from "../../orm/input-types"; +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 { corsSettingKeys } from '../query-keys'; +import { corsSettingMutationKeys } from '../mutation-keys'; +import type { CorsSettingSelect, CorsSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CorsSettingSelect, CorsSettingWithRelations } from '../../orm/input-types'; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteCorsSettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteCorsSettingMutation(params: { - selection: ({ - fields: S & CorsSettingSelect; - } & HookStrictSelect, CorsSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteCorsSetting: { - corsSetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteCorsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteCorsSettingMutation( + params: { + selection: { + fields: S & CorsSettingSelect; + } & HookStrictSelect, CorsSettingSelect>; + } & Omit< + UseMutationOptions< + { + deleteCorsSetting: { + corsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteCorsSetting: { + corsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteCorsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: corsSettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().corsSetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .corsSetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: corsSettingKeys.detail(variables.id) + queryKey: corsSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: corsSettingKeys.lists() + queryKey: corsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseMutation.ts index 3e5b646020..dbfb72c032 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseMutation.ts @@ -4,77 +4,95 @@ * 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 { databaseKeys } from "../query-keys"; -import { databaseMutationKeys } from "../mutation-keys"; -import type { DatabaseSelect, DatabaseWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSelect, DatabaseWithRelations } from "../../orm/input-types"; +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 { databaseKeys } from '../query-keys'; +import { databaseMutationKeys } from '../mutation-keys'; +import type { DatabaseSelect, DatabaseWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DatabaseSelect, DatabaseWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Database with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDatabaseMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDatabaseMutation(params: { - selection: ({ - fields: S & DatabaseSelect; - } & HookStrictSelect, DatabaseSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDatabase: { - database: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDatabaseMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDatabaseMutation( + params: { + selection: { + fields: S & DatabaseSelect; + } & HookStrictSelect, DatabaseSelect>; + } & Omit< + UseMutationOptions< + { + deleteDatabase: { + database: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDatabase: { + database: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDatabaseMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().database.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .database.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: databaseKeys.detail(variables.id) + queryKey: databaseKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseKeys.lists() + queryKey: databaseKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseSettingMutation.ts index 41d30629b8..a08f6e9c6e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseSettingMutation.ts @@ -4,77 +4,95 @@ * 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 { databaseSettingKeys } from "../query-keys"; -import { databaseSettingMutationKeys } from "../mutation-keys"; -import type { DatabaseSettingSelect, DatabaseSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingSelect, DatabaseSettingWithRelations } from "../../orm/input-types"; +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 { databaseSettingKeys } from '../query-keys'; +import { databaseSettingMutationKeys } from '../mutation-keys'; +import type { DatabaseSettingSelect, DatabaseSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DatabaseSettingSelect, DatabaseSettingWithRelations } from '../../orm/input-types'; /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDatabaseSettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDatabaseSettingMutation(params: { - selection: ({ - fields: S & DatabaseSettingSelect; - } & HookStrictSelect, DatabaseSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDatabaseSetting: { - databaseSetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDatabaseSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDatabaseSettingMutation( + params: { + selection: { + fields: S & DatabaseSettingSelect; + } & HookStrictSelect, DatabaseSettingSelect>; + } & Omit< + UseMutationOptions< + { + deleteDatabaseSetting: { + databaseSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDatabaseSetting: { + databaseSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDatabaseSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseSettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().databaseSetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .databaseSetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: databaseSettingKeys.detail(variables.id) + queryKey: databaseSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseSettingKeys.lists() + queryKey: databaseSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseTransferMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseTransferMutation.ts index 0a90fa6178..5b6460e12e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseTransferMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDatabaseTransferMutation.ts @@ -4,77 +4,95 @@ * 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 { databaseTransferKeys } from "../query-keys"; -import { databaseTransferMutationKeys } from "../mutation-keys"; -import type { DatabaseTransferSelect, DatabaseTransferWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseTransferSelect, DatabaseTransferWithRelations } from "../../orm/input-types"; +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 { databaseTransferKeys } from '../query-keys'; +import { databaseTransferMutationKeys } from '../mutation-keys'; +import type { DatabaseTransferSelect, DatabaseTransferWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DatabaseTransferSelect, DatabaseTransferWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a DatabaseTransfer with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDatabaseTransferMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDatabaseTransferMutation(params: { - selection: ({ - fields: S & DatabaseTransferSelect; - } & HookStrictSelect, DatabaseTransferSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDatabaseTransfer: { - databaseTransfer: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDatabaseTransferMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDatabaseTransferMutation( + params: { + selection: { + fields: S & DatabaseTransferSelect; + } & HookStrictSelect, DatabaseTransferSelect>; + } & Omit< + UseMutationOptions< + { + deleteDatabaseTransfer: { + databaseTransfer: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDatabaseTransfer: { + databaseTransfer: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDatabaseTransferMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseTransferMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().databaseTransfer.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .databaseTransfer.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: databaseTransferKeys.detail(variables.id) + queryKey: databaseTransferKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseTransferKeys.lists() + queryKey: databaseTransferKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDefaultPrivilegeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDefaultPrivilegeMutation.ts index 693a70c7be..c9fe5cf73b 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDefaultPrivilegeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDefaultPrivilegeMutation.ts @@ -4,77 +4,95 @@ * 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 { defaultPrivilegeKeys } from "../query-keys"; -import { defaultPrivilegeMutationKeys } from "../mutation-keys"; -import type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations } from "../../orm/input-types"; +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 { defaultPrivilegeKeys } from '../query-keys'; +import { defaultPrivilegeMutationKeys } from '../mutation-keys'; +import type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a DefaultPrivilege with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDefaultPrivilegeMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDefaultPrivilegeMutation(params: { - selection: ({ - fields: S & DefaultPrivilegeSelect; - } & HookStrictSelect, DefaultPrivilegeSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDefaultPrivilege: { - defaultPrivilege: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDefaultPrivilegeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDefaultPrivilegeMutation( + params: { + selection: { + fields: S & DefaultPrivilegeSelect; + } & HookStrictSelect, DefaultPrivilegeSelect>; + } & Omit< + UseMutationOptions< + { + deleteDefaultPrivilege: { + defaultPrivilege: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDefaultPrivilege: { + defaultPrivilege: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDefaultPrivilegeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: defaultPrivilegeMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().defaultPrivilege.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .defaultPrivilege.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: defaultPrivilegeKeys.detail(variables.id) + queryKey: defaultPrivilegeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: defaultPrivilegeKeys.lists() + queryKey: defaultPrivilegeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainEventMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainEventMutation.ts index e927ac5d2b..4daa14ee6d 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainEventMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainEventMutation.ts @@ -4,77 +4,95 @@ * 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 { domainEventKeys } from "../query-keys"; -import { domainEventMutationKeys } from "../mutation-keys"; -import type { DomainEventSelect, DomainEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainEventSelect, DomainEventWithRelations } from "../../orm/input-types"; +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 { domainEventKeys } from '../query-keys'; +import { domainEventMutationKeys } from '../mutation-keys'; +import type { DomainEventSelect, DomainEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DomainEventSelect, DomainEventWithRelations } from '../../orm/input-types'; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDomainEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDomainEventMutation(params: { - selection: ({ - fields: S & DomainEventSelect; - } & HookStrictSelect, DomainEventSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDomainEvent: { - domainEvent: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDomainEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDomainEventMutation( + params: { + selection: { + fields: S & DomainEventSelect; + } & HookStrictSelect, DomainEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteDomainEvent: { + domainEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDomainEvent: { + domainEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDomainEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainEventMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().domainEvent.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .domainEvent.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: domainEventKeys.detail(variables.id) + queryKey: domainEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: domainEventKeys.lists() + queryKey: domainEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainMutation.ts index 1a43a6c743..0cf3facdd3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainMutation.ts @@ -4,77 +4,95 @@ * 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 { domainKeys } from "../query-keys"; -import { domainMutationKeys } from "../mutation-keys"; -import type { DomainSelect, DomainWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainSelect, DomainWithRelations } from "../../orm/input-types"; +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 { domainKeys } from '../query-keys'; +import { domainMutationKeys } from '../mutation-keys'; +import type { DomainSelect, DomainWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DomainSelect, DomainWithRelations } from '../../orm/input-types'; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDomainMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDomainMutation(params: { - selection: ({ - fields: S & DomainSelect; - } & HookStrictSelect, DomainSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDomain: { - domain: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDomainMutation( + params: { + selection: { + fields: S & DomainSelect; + } & HookStrictSelect, DomainSelect>; + } & Omit< + UseMutationOptions< + { + deleteDomain: { + domain: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDomain: { + domain: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().domain.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .domain.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: domainKeys.detail(variables.id) + queryKey: domainKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: domainKeys.lists() + queryKey: domainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainVerificationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainVerificationMutation.ts index f75c891571..6fdd5c5110 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainVerificationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteDomainVerificationMutation.ts @@ -4,77 +4,101 @@ * 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 { domainVerificationKeys } from "../query-keys"; -import { domainVerificationMutationKeys } from "../mutation-keys"; -import type { DomainVerificationSelect, DomainVerificationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainVerificationSelect, DomainVerificationWithRelations } from "../../orm/input-types"; +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 { domainVerificationKeys } from '../query-keys'; +import { domainVerificationMutationKeys } from '../mutation-keys'; +import type { + DomainVerificationSelect, + DomainVerificationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DomainVerificationSelect, + DomainVerificationWithRelations, +} from '../../orm/input-types'; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDomainVerificationMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDomainVerificationMutation(params: { - selection: ({ - fields: S & DomainVerificationSelect; - } & HookStrictSelect, DomainVerificationSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDomainVerification: { - domainVerification: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDomainVerificationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDomainVerificationMutation( + params: { + selection: { + fields: S & DomainVerificationSelect; + } & HookStrictSelect, DomainVerificationSelect>; + } & Omit< + UseMutationOptions< + { + deleteDomainVerification: { + domainVerification: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDomainVerification: { + domainVerification: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDomainVerificationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainVerificationMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().domainVerification.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .domainVerification.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: domainVerificationKeys.detail(variables.id) + queryKey: domainVerificationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: domainVerificationKeys.lists() + queryKey: domainVerificationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteEmbeddingChunkMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteEmbeddingChunkMutation.ts index f19fed6d53..405f15d48f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteEmbeddingChunkMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteEmbeddingChunkMutation.ts @@ -4,77 +4,95 @@ * 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 { embeddingChunkKeys } from "../query-keys"; -import { embeddingChunkMutationKeys } from "../mutation-keys"; -import type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from "../../orm/input-types"; +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 { embeddingChunkKeys } from '../query-keys'; +import { embeddingChunkMutationKeys } from '../mutation-keys'; +import type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a EmbeddingChunk with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteEmbeddingChunkMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteEmbeddingChunkMutation(params: { - selection: ({ - fields: S & EmbeddingChunkSelect; - } & HookStrictSelect, EmbeddingChunkSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteEmbeddingChunk: { - embeddingChunk: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteEmbeddingChunkMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteEmbeddingChunkMutation( + params: { + selection: { + fields: S & EmbeddingChunkSelect; + } & HookStrictSelect, EmbeddingChunkSelect>; + } & Omit< + UseMutationOptions< + { + deleteEmbeddingChunk: { + embeddingChunk: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteEmbeddingChunk: { + embeddingChunk: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteEmbeddingChunkMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: embeddingChunkMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().embeddingChunk.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .embeddingChunk.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: embeddingChunkKeys.detail(variables.id) + queryKey: embeddingChunkKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: embeddingChunkKeys.lists() + queryKey: embeddingChunkKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteEnumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteEnumMutation.ts index 5b012cdb6a..2b5f85b693 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteEnumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteEnumMutation.ts @@ -4,77 +4,95 @@ * 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 { enumKeys } from "../query-keys"; -import { enumMutationKeys } from "../mutation-keys"; -import type { EnumSelect, EnumWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EnumSelect, EnumWithRelations } from "../../orm/input-types"; +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 { enumKeys } from '../query-keys'; +import { enumMutationKeys } from '../mutation-keys'; +import type { EnumSelect, EnumWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EnumSelect, EnumWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Enum with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteEnumMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteEnumMutation(params: { - selection: ({ - fields: S & EnumSelect; - } & HookStrictSelect, EnumSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteEnum: { - enum: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteEnumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteEnumMutation( + params: { + selection: { + fields: S & EnumSelect; + } & HookStrictSelect, EnumSelect>; + } & Omit< + UseMutationOptions< + { + deleteEnum: { + enum: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteEnum: { + enum: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteEnumMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: enumMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().enum.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .enum.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: enumKeys.detail(variables.id) + queryKey: enumKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: enumKeys.lists() + queryKey: enumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteExclusionConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteExclusionConstraintMutation.ts index 97de858bc8..f015863a94 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteExclusionConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteExclusionConstraintMutation.ts @@ -4,77 +4,101 @@ * 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 { exclusionConstraintKeys } from "../query-keys"; -import { exclusionConstraintMutationKeys } from "../mutation-keys"; -import type { ExclusionConstraintSelect, ExclusionConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ExclusionConstraintSelect, ExclusionConstraintWithRelations } from "../../orm/input-types"; +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 { exclusionConstraintKeys } from '../query-keys'; +import { exclusionConstraintMutationKeys } from '../mutation-keys'; +import type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a ExclusionConstraint with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteExclusionConstraintMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteExclusionConstraintMutation(params: { - selection: ({ - fields: S & ExclusionConstraintSelect; - } & HookStrictSelect, ExclusionConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteExclusionConstraint: { - exclusionConstraint: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteExclusionConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteExclusionConstraintMutation( + params: { + selection: { + fields: S & ExclusionConstraintSelect; + } & HookStrictSelect, ExclusionConstraintSelect>; + } & Omit< + UseMutationOptions< + { + deleteExclusionConstraint: { + exclusionConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteExclusionConstraint: { + exclusionConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteExclusionConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: exclusionConstraintMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().exclusionConstraint.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .exclusionConstraint.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: exclusionConstraintKeys.detail(variables.id) + queryKey: exclusionConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: exclusionConstraintKeys.lists() + queryKey: exclusionConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteFieldMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteFieldMutation.ts index 3a24b6ea9b..96b9a2f6f3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteFieldMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteFieldMutation.ts @@ -4,77 +4,95 @@ * 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 { fieldKeys } from "../query-keys"; -import { fieldMutationKeys } from "../mutation-keys"; -import type { FieldSelect, FieldWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FieldSelect, FieldWithRelations } from "../../orm/input-types"; +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 { fieldKeys } from '../query-keys'; +import { fieldMutationKeys } from '../mutation-keys'; +import type { FieldSelect, FieldWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FieldSelect, FieldWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Field with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFieldMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFieldMutation(params: { - selection: ({ - fields: S & FieldSelect; - } & HookStrictSelect, FieldSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteField: { - field: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFieldMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFieldMutation( + params: { + selection: { + fields: S & FieldSelect; + } & HookStrictSelect, FieldSelect>; + } & Omit< + UseMutationOptions< + { + deleteField: { + field: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteField: { + field: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFieldMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: fieldMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().field.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .field.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: fieldKeys.detail(variables.id) + queryKey: fieldKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: fieldKeys.lists() + queryKey: fieldKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteForeignKeyConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteForeignKeyConstraintMutation.ts index 58c8b85f11..8c6df80cb1 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteForeignKeyConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteForeignKeyConstraintMutation.ts @@ -4,77 +4,101 @@ * 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 { foreignKeyConstraintKeys } from "../query-keys"; -import { foreignKeyConstraintMutationKeys } from "../mutation-keys"; -import type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations } from "../../orm/input-types"; +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 { foreignKeyConstraintKeys } from '../query-keys'; +import { foreignKeyConstraintMutationKeys } from '../mutation-keys'; +import type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a ForeignKeyConstraint with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteForeignKeyConstraintMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteForeignKeyConstraintMutation(params: { - selection: ({ - fields: S & ForeignKeyConstraintSelect; - } & HookStrictSelect, ForeignKeyConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteForeignKeyConstraint: { - foreignKeyConstraint: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteForeignKeyConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteForeignKeyConstraintMutation( + params: { + selection: { + fields: S & ForeignKeyConstraintSelect; + } & HookStrictSelect, ForeignKeyConstraintSelect>; + } & Omit< + UseMutationOptions< + { + deleteForeignKeyConstraint: { + foreignKeyConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteForeignKeyConstraint: { + foreignKeyConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteForeignKeyConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: foreignKeyConstraintMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().foreignKeyConstraint.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .foreignKeyConstraint.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: foreignKeyConstraintKeys.detail(variables.id) + queryKey: foreignKeyConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: foreignKeyConstraintKeys.lists() + queryKey: foreignKeyConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteFullTextSearchMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteFullTextSearchMutation.ts index 7e7a5901e9..ee81e5eee0 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteFullTextSearchMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteFullTextSearchMutation.ts @@ -4,77 +4,95 @@ * 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 { fullTextSearchKeys } from "../query-keys"; -import { fullTextSearchMutationKeys } from "../mutation-keys"; -import type { FullTextSearchSelect, FullTextSearchWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FullTextSearchSelect, FullTextSearchWithRelations } from "../../orm/input-types"; +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 { fullTextSearchKeys } from '../query-keys'; +import { fullTextSearchMutationKeys } from '../mutation-keys'; +import type { FullTextSearchSelect, FullTextSearchWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FullTextSearchSelect, FullTextSearchWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a FullTextSearch with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFullTextSearchMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFullTextSearchMutation(params: { - selection: ({ - fields: S & FullTextSearchSelect; - } & HookStrictSelect, FullTextSearchSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFullTextSearch: { - fullTextSearch: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFullTextSearchMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFullTextSearchMutation( + params: { + selection: { + fields: S & FullTextSearchSelect; + } & HookStrictSelect, FullTextSearchSelect>; + } & Omit< + UseMutationOptions< + { + deleteFullTextSearch: { + fullTextSearch: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFullTextSearch: { + fullTextSearch: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFullTextSearchMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: fullTextSearchMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().fullTextSearch.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .fullTextSearch.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: fullTextSearchKeys.detail(variables.id) + queryKey: fullTextSearchKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: fullTextSearchKeys.lists() + queryKey: fullTextSearchKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteFunctionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteFunctionMutation.ts index f2bcff9a43..c73fbc7fb7 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteFunctionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteFunctionMutation.ts @@ -4,77 +4,95 @@ * 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 { functionKeys } from "../query-keys"; -import { functionMutationKeys } from "../mutation-keys"; -import type { FunctionSelect, FunctionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionSelect, FunctionWithRelations } from "../../orm/input-types"; +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 { functionKeys } from '../query-keys'; +import { functionMutationKeys } from '../mutation-keys'; +import type { FunctionSelect, FunctionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionSelect, FunctionWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Function with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionMutation(params: { - selection: ({ - fields: S & FunctionSelect; - } & HookStrictSelect, FunctionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunction: { - function: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionMutation( + params: { + selection: { + fields: S & FunctionSelect; + } & HookStrictSelect, FunctionSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunction: { + function: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunction: { + function: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().function.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .function.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionKeys.detail(variables.id) + queryKey: functionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionKeys.lists() + queryKey: functionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteHostnameBindingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteHostnameBindingMutation.ts index cb019bc815..4df36c41ed 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteHostnameBindingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteHostnameBindingMutation.ts @@ -4,77 +4,95 @@ * 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 { hostnameBindingKeys } from "../query-keys"; -import { hostnameBindingMutationKeys } from "../mutation-keys"; -import type { HostnameBindingSelect, HostnameBindingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HostnameBindingSelect, HostnameBindingWithRelations } from "../../orm/input-types"; +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 { hostnameBindingKeys } from '../query-keys'; +import { hostnameBindingMutationKeys } from '../mutation-keys'; +import type { HostnameBindingSelect, HostnameBindingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { HostnameBindingSelect, HostnameBindingWithRelations } from '../../orm/input-types'; /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteHostnameBindingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteHostnameBindingMutation(params: { - selection: ({ - fields: S & HostnameBindingSelect; - } & HookStrictSelect, HostnameBindingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteHostnameBinding: { - hostnameBinding: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteHostnameBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteHostnameBindingMutation( + params: { + selection: { + fields: S & HostnameBindingSelect; + } & HookStrictSelect, HostnameBindingSelect>; + } & Omit< + UseMutationOptions< + { + deleteHostnameBinding: { + hostnameBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteHostnameBinding: { + hostnameBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteHostnameBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: hostnameBindingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().hostnameBinding.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .hostnameBinding.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: hostnameBindingKeys.detail(variables.id) + queryKey: hostnameBindingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: hostnameBindingKeys.lists() + queryKey: hostnameBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteHttpRouteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteHttpRouteMutation.ts index 9aae661158..cb6c46876b 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteHttpRouteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteHttpRouteMutation.ts @@ -4,77 +4,95 @@ * 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 { httpRouteKeys } from "../query-keys"; -import { httpRouteMutationKeys } from "../mutation-keys"; -import type { HttpRouteSelect, HttpRouteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteSelect, HttpRouteWithRelations } from "../../orm/input-types"; +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 { httpRouteKeys } from '../query-keys'; +import { httpRouteMutationKeys } from '../mutation-keys'; +import type { HttpRouteSelect, HttpRouteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { HttpRouteSelect, HttpRouteWithRelations } from '../../orm/input-types'; /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteHttpRouteMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteHttpRouteMutation(params: { - selection: ({ - fields: S & HttpRouteSelect; - } & HookStrictSelect, HttpRouteSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteHttpRoute: { - httpRoute: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteHttpRouteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteHttpRouteMutation( + params: { + selection: { + fields: S & HttpRouteSelect; + } & HookStrictSelect, HttpRouteSelect>; + } & Omit< + UseMutationOptions< + { + deleteHttpRoute: { + httpRoute: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteHttpRoute: { + httpRoute: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteHttpRouteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: httpRouteMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().httpRoute.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .httpRoute.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: httpRouteKeys.detail(variables.id) + queryKey: httpRouteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: httpRouteKeys.lists() + queryKey: httpRouteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteIndexMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteIndexMutation.ts index 377af62eef..68af9ba2df 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteIndexMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteIndexMutation.ts @@ -4,77 +4,95 @@ * 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 { indexKeys } from "../query-keys"; -import { indexMutationKeys } from "../mutation-keys"; -import type { IndexSelect, IndexWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IndexSelect, IndexWithRelations } from "../../orm/input-types"; +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 { indexKeys } from '../query-keys'; +import { indexMutationKeys } from '../mutation-keys'; +import type { IndexSelect, IndexWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { IndexSelect, IndexWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Index with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteIndexMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteIndexMutation(params: { - selection: ({ - fields: S & IndexSelect; - } & HookStrictSelect, IndexSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteIndex: { - index: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteIndexMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteIndexMutation( + params: { + selection: { + fields: S & IndexSelect; + } & HookStrictSelect, IndexSelect>; + } & Omit< + UseMutationOptions< + { + deleteIndex: { + index: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteIndex: { + index: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteIndexMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: indexMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().index.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .index.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: indexKeys.detail(variables.id) + queryKey: indexKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: indexKeys.lists() + queryKey: indexKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteManagedDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteManagedDomainMutation.ts index 8a70209369..2e2dc2ed4a 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteManagedDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteManagedDomainMutation.ts @@ -4,77 +4,95 @@ * 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 { managedDomainKeys } from "../query-keys"; -import { managedDomainMutationKeys } from "../mutation-keys"; -import type { ManagedDomainSelect, ManagedDomainWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ManagedDomainSelect, ManagedDomainWithRelations } from "../../orm/input-types"; +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 { managedDomainKeys } from '../query-keys'; +import { managedDomainMutationKeys } from '../mutation-keys'; +import type { ManagedDomainSelect, ManagedDomainWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ManagedDomainSelect, ManagedDomainWithRelations } from '../../orm/input-types'; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteManagedDomainMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteManagedDomainMutation(params: { - selection: ({ - fields: S & ManagedDomainSelect; - } & HookStrictSelect, ManagedDomainSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteManagedDomain: { - managedDomain: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteManagedDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteManagedDomainMutation( + params: { + selection: { + fields: S & ManagedDomainSelect; + } & HookStrictSelect, ManagedDomainSelect>; + } & Omit< + UseMutationOptions< + { + deleteManagedDomain: { + managedDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteManagedDomain: { + managedDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteManagedDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: managedDomainMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().managedDomain.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .managedDomain.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: managedDomainKeys.detail(variables.id) + queryKey: managedDomainKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: managedDomainKeys.lists() + queryKey: managedDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteNodeTypeRegistryMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteNodeTypeRegistryMutation.ts index 6637171d80..a7a6c2eced 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteNodeTypeRegistryMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteNodeTypeRegistryMutation.ts @@ -4,77 +4,95 @@ * 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 { nodeTypeRegistryKeys } from "../query-keys"; -import { nodeTypeRegistryMutationKeys } from "../mutation-keys"; -import type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations } from "../../orm/input-types"; +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 { nodeTypeRegistryKeys } from '../query-keys'; +import { nodeTypeRegistryMutationKeys } from '../mutation-keys'; +import type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a NodeTypeRegistry with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteNodeTypeRegistryMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ name: 'value-to-delete' }); * ``` */ -export function useDeleteNodeTypeRegistryMutation(params: { - selection: ({ - fields: S & NodeTypeRegistrySelect; - } & HookStrictSelect, NodeTypeRegistrySelect>); -} & Omit; - }; -}, Error, { - name: string; -}>, "mutationFn">): UseMutationResult<{ - deleteNodeTypeRegistry: { - nodeTypeRegistry: InferSelectResult; - }; -}, Error, { - name: string; -}>; -export function useDeleteNodeTypeRegistryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteNodeTypeRegistryMutation( + params: { + selection: { + fields: S & NodeTypeRegistrySelect; + } & HookStrictSelect, NodeTypeRegistrySelect>; + } & Omit< + UseMutationOptions< + { + deleteNodeTypeRegistry: { + nodeTypeRegistry: InferSelectResult; + }; + }, + Error, + { + name: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteNodeTypeRegistry: { + nodeTypeRegistry: InferSelectResult; + }; + }, + Error, + { + name: string; + } +>; +export function useDeleteNodeTypeRegistryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + name: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: nodeTypeRegistryMutationKeys.all, - mutationFn: ({ - name - }: { - name: string; - }) => getClient().nodeTypeRegistry.delete({ - where: { - name - }, - select: args.select - }).unwrap(), + mutationFn: ({ name }: { name: string }) => + getClient() + .nodeTypeRegistry.delete({ + where: { + name, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: nodeTypeRegistryKeys.detail(variables.name) + queryKey: nodeTypeRegistryKeys.detail(variables.name), }); queryClient.invalidateQueries({ - queryKey: nodeTypeRegistryKeys.lists() + queryKey: nodeTypeRegistryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePartitionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePartitionMutation.ts index 963d67e8da..987ddd72e3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePartitionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePartitionMutation.ts @@ -4,77 +4,95 @@ * 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 { partitionKeys } from "../query-keys"; -import { partitionMutationKeys } from "../mutation-keys"; -import type { PartitionSelect, PartitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PartitionSelect, PartitionWithRelations } from "../../orm/input-types"; +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 { partitionKeys } from '../query-keys'; +import { partitionMutationKeys } from '../mutation-keys'; +import type { PartitionSelect, PartitionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PartitionSelect, PartitionWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Partition with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePartitionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePartitionMutation(params: { - selection: ({ - fields: S & PartitionSelect; - } & HookStrictSelect, PartitionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePartition: { - partition: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePartitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePartitionMutation( + params: { + selection: { + fields: S & PartitionSelect; + } & HookStrictSelect, PartitionSelect>; + } & Omit< + UseMutationOptions< + { + deletePartition: { + partition: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePartition: { + partition: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePartitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: partitionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().partition.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .partition.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: partitionKeys.detail(variables.id) + queryKey: partitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: partitionKeys.lists() + queryKey: partitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiModuleMutation.ts index 2bf81f74c8..c063467c2f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { platformApiModuleKeys } from "../query-keys"; -import { platformApiModuleMutationKeys } from "../mutation-keys"; -import type { PlatformApiModuleSelect, PlatformApiModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiModuleSelect, PlatformApiModuleWithRelations } from "../../orm/input-types"; +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 { platformApiModuleKeys } from '../query-keys'; +import { platformApiModuleMutationKeys } from '../mutation-keys'; +import type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, +} from '../../orm/input-types'; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformApiModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformApiModuleMutation(params: { - selection: ({ - fields: S & PlatformApiModuleSelect; - } & HookStrictSelect, PlatformApiModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformApiModule: { - platformApiModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformApiModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformApiModuleMutation( + params: { + selection: { + fields: S & PlatformApiModuleSelect; + } & HookStrictSelect, PlatformApiModuleSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformApiModule: { + platformApiModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformApiModule: { + platformApiModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformApiModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformApiModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformApiModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformApiModuleKeys.detail(variables.id) + queryKey: platformApiModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformApiModuleKeys.lists() + queryKey: platformApiModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiMutation.ts index 6819f6f97e..fe62269435 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiMutation.ts @@ -4,77 +4,95 @@ * 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 { platformApiKeys } from "../query-keys"; -import { platformApiMutationKeys } from "../mutation-keys"; -import type { PlatformApiSelect, PlatformApiWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSelect, PlatformApiWithRelations } from "../../orm/input-types"; +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 { platformApiKeys } from '../query-keys'; +import { platformApiMutationKeys } from '../mutation-keys'; +import type { PlatformApiSelect, PlatformApiWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformApiSelect, PlatformApiWithRelations } from '../../orm/input-types'; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformApiMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformApiMutation(params: { - selection: ({ - fields: S & PlatformApiSelect; - } & HookStrictSelect, PlatformApiSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformApi: { - platformApi: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformApiMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformApiMutation( + params: { + selection: { + fields: S & PlatformApiSelect; + } & HookStrictSelect, PlatformApiSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformApi: { + platformApi: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformApi: { + platformApi: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformApiMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformApi.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformApi.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformApiKeys.detail(variables.id) + queryKey: platformApiKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformApiKeys.lists() + queryKey: platformApiKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiSchemaMutation.ts index f96fe1f576..c544b4aa31 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiSchemaMutation.ts @@ -4,77 +4,101 @@ * 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 { platformApiSchemaKeys } from "../query-keys"; -import { platformApiSchemaMutationKeys } from "../mutation-keys"; -import type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations } from "../../orm/input-types"; +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 { platformApiSchemaKeys } from '../query-keys'; +import { platformApiSchemaMutationKeys } from '../mutation-keys'; +import type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, +} from '../../orm/input-types'; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformApiSchemaMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformApiSchemaMutation(params: { - selection: ({ - fields: S & PlatformApiSchemaSelect; - } & HookStrictSelect, PlatformApiSchemaSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformApiSchema: { - platformApiSchema: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformApiSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformApiSchemaMutation( + params: { + selection: { + fields: S & PlatformApiSchemaSelect; + } & HookStrictSelect, PlatformApiSchemaSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformApiSchema: { + platformApiSchema: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformApiSchema: { + platformApiSchema: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformApiSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiSchemaMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformApiSchema.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformApiSchema.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformApiSchemaKeys.detail(variables.id) + queryKey: platformApiSchemaKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformApiSchemaKeys.lists() + queryKey: platformApiSchemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiSettingMutation.ts index a3a812576c..ad612f44f5 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformApiSettingMutation.ts @@ -4,77 +4,101 @@ * 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 { platformApiSettingKeys } from "../query-keys"; -import { platformApiSettingMutationKeys } from "../mutation-keys"; -import type { PlatformApiSettingSelect, PlatformApiSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSettingSelect, PlatformApiSettingWithRelations } from "../../orm/input-types"; +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 { platformApiSettingKeys } from '../query-keys'; +import { platformApiSettingMutationKeys } from '../mutation-keys'; +import type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, +} from '../../orm/input-types'; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformApiSettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformApiSettingMutation(params: { - selection: ({ - fields: S & PlatformApiSettingSelect; - } & HookStrictSelect, PlatformApiSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformApiSetting: { - platformApiSetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformApiSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformApiSettingMutation( + params: { + selection: { + fields: S & PlatformApiSettingSelect; + } & HookStrictSelect, PlatformApiSettingSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformApiSetting: { + platformApiSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformApiSetting: { + platformApiSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformApiSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiSettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformApiSetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformApiSetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformApiSettingKeys.detail(variables.id) + queryKey: platformApiSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformApiSettingKeys.lists() + queryKey: platformApiSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformCorsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformCorsSettingMutation.ts index 435ff5f4f9..9bd95e5725 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformCorsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformCorsSettingMutation.ts @@ -4,77 +4,101 @@ * 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 { platformCorsSettingKeys } from "../query-keys"; -import { platformCorsSettingMutationKeys } from "../mutation-keys"; -import type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations } from "../../orm/input-types"; +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 { platformCorsSettingKeys } from '../query-keys'; +import { platformCorsSettingMutationKeys } from '../mutation-keys'; +import type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, +} from '../../orm/input-types'; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformCorsSettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformCorsSettingMutation(params: { - selection: ({ - fields: S & PlatformCorsSettingSelect; - } & HookStrictSelect, PlatformCorsSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformCorsSetting: { - platformCorsSetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformCorsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformCorsSettingMutation( + params: { + selection: { + fields: S & PlatformCorsSettingSelect; + } & HookStrictSelect, PlatformCorsSettingSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformCorsSetting: { + platformCorsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformCorsSetting: { + platformCorsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformCorsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformCorsSettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformCorsSetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformCorsSetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformCorsSettingKeys.detail(variables.id) + queryKey: platformCorsSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformCorsSettingKeys.lists() + queryKey: platformCorsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainEventMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainEventMutation.ts index 701f8b6367..2d19c59fd0 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainEventMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainEventMutation.ts @@ -4,77 +4,101 @@ * 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 { platformDomainEventKeys } from "../query-keys"; -import { platformDomainEventMutationKeys } from "../mutation-keys"; -import type { PlatformDomainEventSelect, PlatformDomainEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainEventSelect, PlatformDomainEventWithRelations } from "../../orm/input-types"; +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 { platformDomainEventKeys } from '../query-keys'; +import { platformDomainEventMutationKeys } from '../mutation-keys'; +import type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, +} from '../../orm/input-types'; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformDomainEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformDomainEventMutation(params: { - selection: ({ - fields: S & PlatformDomainEventSelect; - } & HookStrictSelect, PlatformDomainEventSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformDomainEvent: { - platformDomainEvent: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformDomainEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformDomainEventMutation( + params: { + selection: { + fields: S & PlatformDomainEventSelect; + } & HookStrictSelect, PlatformDomainEventSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformDomainEvent: { + platformDomainEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformDomainEvent: { + platformDomainEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformDomainEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainEventMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformDomainEvent.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformDomainEvent.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformDomainEventKeys.detail(variables.id) + queryKey: platformDomainEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformDomainEventKeys.lists() + queryKey: platformDomainEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainMutation.ts index 3cb8458e3c..aadef780b9 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainMutation.ts @@ -4,77 +4,95 @@ * 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 { platformDomainKeys } from "../query-keys"; -import { platformDomainMutationKeys } from "../mutation-keys"; -import type { PlatformDomainSelect, PlatformDomainWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainSelect, PlatformDomainWithRelations } from "../../orm/input-types"; +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 { platformDomainKeys } from '../query-keys'; +import { platformDomainMutationKeys } from '../mutation-keys'; +import type { PlatformDomainSelect, PlatformDomainWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformDomainSelect, PlatformDomainWithRelations } from '../../orm/input-types'; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformDomainMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformDomainMutation(params: { - selection: ({ - fields: S & PlatformDomainSelect; - } & HookStrictSelect, PlatformDomainSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformDomain: { - platformDomain: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformDomainMutation( + params: { + selection: { + fields: S & PlatformDomainSelect; + } & HookStrictSelect, PlatformDomainSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformDomain: { + platformDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformDomain: { + platformDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformDomain.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformDomain.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformDomainKeys.detail(variables.id) + queryKey: platformDomainKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformDomainKeys.lists() + queryKey: platformDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainVerificationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainVerificationMutation.ts index f75c9bbf53..890e6df2ea 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainVerificationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformDomainVerificationMutation.ts @@ -4,77 +4,103 @@ * 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 { platformDomainVerificationKeys } from "../query-keys"; -import { platformDomainVerificationMutationKeys } from "../mutation-keys"; -import type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations } from "../../orm/input-types"; +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 { platformDomainVerificationKeys } from '../query-keys'; +import { platformDomainVerificationMutationKeys } from '../mutation-keys'; +import type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, +} from '../../orm/input-types'; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformDomainVerificationMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformDomainVerificationMutation(params: { - selection: ({ - fields: S & PlatformDomainVerificationSelect; - } & HookStrictSelect, PlatformDomainVerificationSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformDomainVerification: { - platformDomainVerification: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformDomainVerificationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformDomainVerificationMutation< + S extends PlatformDomainVerificationSelect, +>( + params: { + selection: { + fields: S & PlatformDomainVerificationSelect; + } & HookStrictSelect, PlatformDomainVerificationSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformDomainVerification: { + platformDomainVerification: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformDomainVerification: { + platformDomainVerification: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformDomainVerificationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainVerificationMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformDomainVerification.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformDomainVerification.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformDomainVerificationKeys.detail(variables.id) + queryKey: platformDomainVerificationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformDomainVerificationKeys.lists() + queryKey: platformDomainVerificationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformManagedDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformManagedDomainMutation.ts index dc85af8635..8c38a91a6e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformManagedDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformManagedDomainMutation.ts @@ -4,77 +4,101 @@ * 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 { platformManagedDomainKeys } from "../query-keys"; -import { platformManagedDomainMutationKeys } from "../mutation-keys"; -import type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations } from "../../orm/input-types"; +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 { platformManagedDomainKeys } from '../query-keys'; +import { platformManagedDomainMutationKeys } from '../mutation-keys'; +import type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, +} from '../../orm/input-types'; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformManagedDomainMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformManagedDomainMutation(params: { - selection: ({ - fields: S & PlatformManagedDomainSelect; - } & HookStrictSelect, PlatformManagedDomainSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformManagedDomain: { - platformManagedDomain: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformManagedDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformManagedDomainMutation( + params: { + selection: { + fields: S & PlatformManagedDomainSelect; + } & HookStrictSelect, PlatformManagedDomainSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformManagedDomain: { + platformManagedDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformManagedDomain: { + platformManagedDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformManagedDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformManagedDomainMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformManagedDomain.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformManagedDomain.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformManagedDomainKeys.detail(variables.id) + queryKey: platformManagedDomainKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformManagedDomainKeys.lists() + queryKey: platformManagedDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteMetadatumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteMetadatumMutation.ts index 6b306ddcbb..a9e55c370f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteMetadatumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteMetadatumMutation.ts @@ -4,77 +4,101 @@ * 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 { platformSiteMetadatumKeys } from "../query-keys"; -import { platformSiteMetadatumMutationKeys } from "../mutation-keys"; -import type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations } from "../../orm/input-types"; +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 { platformSiteMetadatumKeys } from '../query-keys'; +import { platformSiteMetadatumMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, +} from '../../orm/input-types'; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformSiteMetadatumMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformSiteMetadatumMutation(params: { - selection: ({ - fields: S & PlatformSiteMetadatumSelect; - } & HookStrictSelect, PlatformSiteMetadatumSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformSiteMetadatum: { - platformSiteMetadatum: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformSiteMetadatumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformSiteMetadatumMutation( + params: { + selection: { + fields: S & PlatformSiteMetadatumSelect; + } & HookStrictSelect, PlatformSiteMetadatumSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformSiteMetadatum: { + platformSiteMetadatum: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformSiteMetadatum: { + platformSiteMetadatum: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformSiteMetadatumMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteMetadatumMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformSiteMetadatum.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformSiteMetadatum.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformSiteMetadatumKeys.detail(variables.id) + queryKey: platformSiteMetadatumKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformSiteMetadatumKeys.lists() + queryKey: platformSiteMetadatumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteModuleMutation.ts index 5602e3ece7..f2f8efdb55 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { platformSiteModuleKeys } from "../query-keys"; -import { platformSiteModuleMutationKeys } from "../mutation-keys"; -import type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations } from "../../orm/input-types"; +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 { platformSiteModuleKeys } from '../query-keys'; +import { platformSiteModuleMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, +} from '../../orm/input-types'; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformSiteModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformSiteModuleMutation(params: { - selection: ({ - fields: S & PlatformSiteModuleSelect; - } & HookStrictSelect, PlatformSiteModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformSiteModule: { - platformSiteModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformSiteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformSiteModuleMutation( + params: { + selection: { + fields: S & PlatformSiteModuleSelect; + } & HookStrictSelect, PlatformSiteModuleSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformSiteModule: { + platformSiteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformSiteModule: { + platformSiteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformSiteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformSiteModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformSiteModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformSiteModuleKeys.detail(variables.id) + queryKey: platformSiteModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformSiteModuleKeys.lists() + queryKey: platformSiteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteMutation.ts index 6e7396c986..b96d489f08 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteMutation.ts @@ -4,77 +4,95 @@ * 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 { platformSiteKeys } from "../query-keys"; -import { platformSiteMutationKeys } from "../mutation-keys"; -import type { PlatformSiteSelect, PlatformSiteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteSelect, PlatformSiteWithRelations } from "../../orm/input-types"; +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 { platformSiteKeys } from '../query-keys'; +import { platformSiteMutationKeys } from '../mutation-keys'; +import type { PlatformSiteSelect, PlatformSiteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformSiteSelect, PlatformSiteWithRelations } from '../../orm/input-types'; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformSiteMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformSiteMutation(params: { - selection: ({ - fields: S & PlatformSiteSelect; - } & HookStrictSelect, PlatformSiteSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformSite: { - platformSite: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformSiteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformSiteMutation( + params: { + selection: { + fields: S & PlatformSiteSelect; + } & HookStrictSelect, PlatformSiteSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformSite: { + platformSite: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformSite: { + platformSite: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformSiteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformSite.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformSite.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformSiteKeys.detail(variables.id) + queryKey: platformSiteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformSiteKeys.lists() + queryKey: platformSiteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteThemeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteThemeMutation.ts index 3d29948e90..c3928ac7ba 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteThemeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePlatformSiteThemeMutation.ts @@ -4,77 +4,101 @@ * 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 { platformSiteThemeKeys } from "../query-keys"; -import { platformSiteThemeMutationKeys } from "../mutation-keys"; -import type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations } from "../../orm/input-types"; +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 { platformSiteThemeKeys } from '../query-keys'; +import { platformSiteThemeMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, +} from '../../orm/input-types'; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformSiteThemeMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformSiteThemeMutation(params: { - selection: ({ - fields: S & PlatformSiteThemeSelect; - } & HookStrictSelect, PlatformSiteThemeSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformSiteTheme: { - platformSiteTheme: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformSiteThemeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformSiteThemeMutation( + params: { + selection: { + fields: S & PlatformSiteThemeSelect; + } & HookStrictSelect, PlatformSiteThemeSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformSiteTheme: { + platformSiteTheme: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformSiteTheme: { + platformSiteTheme: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformSiteThemeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteThemeMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformSiteTheme.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformSiteTheme.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformSiteThemeKeys.detail(variables.id) + queryKey: platformSiteThemeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformSiteThemeKeys.lists() + queryKey: platformSiteThemeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePolicyMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePolicyMutation.ts index 109dc3a9bd..40ccfefbff 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePolicyMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePolicyMutation.ts @@ -4,77 +4,95 @@ * 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 { policyKeys } from "../query-keys"; -import { policyMutationKeys } from "../mutation-keys"; -import type { PolicySelect, PolicyWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PolicySelect, PolicyWithRelations } from "../../orm/input-types"; +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 { policyKeys } from '../query-keys'; +import { policyMutationKeys } from '../mutation-keys'; +import type { PolicySelect, PolicyWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PolicySelect, PolicyWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Policy with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePolicyMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePolicyMutation(params: { - selection: ({ - fields: S & PolicySelect; - } & HookStrictSelect, PolicySelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePolicy: { - policy: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePolicyMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePolicyMutation( + params: { + selection: { + fields: S & PolicySelect; + } & HookStrictSelect, PolicySelect>; + } & Omit< + UseMutationOptions< + { + deletePolicy: { + policy: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePolicy: { + policy: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePolicyMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: policyMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().policy.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .policy.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: policyKeys.detail(variables.id) + queryKey: policyKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: policyKeys.lists() + queryKey: policyKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePrimaryKeyConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePrimaryKeyConstraintMutation.ts index de2f793bcb..758c59ca77 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePrimaryKeyConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePrimaryKeyConstraintMutation.ts @@ -4,77 +4,101 @@ * 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 { primaryKeyConstraintKeys } from "../query-keys"; -import { primaryKeyConstraintMutationKeys } from "../mutation-keys"; -import type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations } from "../../orm/input-types"; +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 { primaryKeyConstraintKeys } from '../query-keys'; +import { primaryKeyConstraintMutationKeys } from '../mutation-keys'; +import type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a PrimaryKeyConstraint with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePrimaryKeyConstraintMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePrimaryKeyConstraintMutation(params: { - selection: ({ - fields: S & PrimaryKeyConstraintSelect; - } & HookStrictSelect, PrimaryKeyConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePrimaryKeyConstraint: { - primaryKeyConstraint: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePrimaryKeyConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePrimaryKeyConstraintMutation( + params: { + selection: { + fields: S & PrimaryKeyConstraintSelect; + } & HookStrictSelect, PrimaryKeyConstraintSelect>; + } & Omit< + UseMutationOptions< + { + deletePrimaryKeyConstraint: { + primaryKeyConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePrimaryKeyConstraint: { + primaryKeyConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePrimaryKeyConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: primaryKeyConstraintMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().primaryKeyConstraint.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .primaryKeyConstraint.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: primaryKeyConstraintKeys.detail(variables.id) + queryKey: primaryKeyConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: primaryKeyConstraintKeys.lists() + queryKey: primaryKeyConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeletePubkeySettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeletePubkeySettingMutation.ts index 8e46da4347..5b92100685 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeletePubkeySettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeletePubkeySettingMutation.ts @@ -4,77 +4,95 @@ * 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 { pubkeySettingKeys } from "../query-keys"; -import { pubkeySettingMutationKeys } from "../mutation-keys"; -import type { PubkeySettingSelect, PubkeySettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PubkeySettingSelect, PubkeySettingWithRelations } from "../../orm/input-types"; +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 { pubkeySettingKeys } from '../query-keys'; +import { pubkeySettingMutationKeys } from '../mutation-keys'; +import type { PubkeySettingSelect, PubkeySettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PubkeySettingSelect, PubkeySettingWithRelations } from '../../orm/input-types'; /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePubkeySettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePubkeySettingMutation(params: { - selection: ({ - fields: S & PubkeySettingSelect; - } & HookStrictSelect, PubkeySettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePubkeySetting: { - pubkeySetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePubkeySettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePubkeySettingMutation( + params: { + selection: { + fields: S & PubkeySettingSelect; + } & HookStrictSelect, PubkeySettingSelect>; + } & Omit< + UseMutationOptions< + { + deletePubkeySetting: { + pubkeySetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePubkeySetting: { + pubkeySetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePubkeySettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: pubkeySettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().pubkeySetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .pubkeySetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: pubkeySettingKeys.detail(variables.id) + queryKey: pubkeySettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: pubkeySettingKeys.lists() + queryKey: pubkeySettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteRlsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteRlsSettingMutation.ts index 64b785deb6..c97f9fc6cb 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteRlsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteRlsSettingMutation.ts @@ -4,77 +4,95 @@ * 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 { rlsSettingKeys } from "../query-keys"; -import { rlsSettingMutationKeys } from "../mutation-keys"; -import type { RlsSettingSelect, RlsSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsSettingSelect, RlsSettingWithRelations } from "../../orm/input-types"; +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 { rlsSettingKeys } from '../query-keys'; +import { rlsSettingMutationKeys } from '../mutation-keys'; +import type { RlsSettingSelect, RlsSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RlsSettingSelect, RlsSettingWithRelations } from '../../orm/input-types'; /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRlsSettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRlsSettingMutation(params: { - selection: ({ - fields: S & RlsSettingSelect; - } & HookStrictSelect, RlsSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRlsSetting: { - rlsSetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRlsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRlsSettingMutation( + params: { + selection: { + fields: S & RlsSettingSelect; + } & HookStrictSelect, RlsSettingSelect>; + } & Omit< + UseMutationOptions< + { + deleteRlsSetting: { + rlsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRlsSetting: { + rlsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRlsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rlsSettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().rlsSetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .rlsSetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: rlsSettingKeys.detail(variables.id) + queryKey: rlsSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: rlsSettingKeys.lists() + queryKey: rlsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteRouteBindingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteRouteBindingMutation.ts index 7c79dcbc30..e158ed3966 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteRouteBindingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteRouteBindingMutation.ts @@ -4,77 +4,95 @@ * 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 { routeBindingKeys } from "../query-keys"; -import { routeBindingMutationKeys } from "../mutation-keys"; -import type { RouteBindingSelect, RouteBindingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteBindingSelect, RouteBindingWithRelations } from "../../orm/input-types"; +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 { routeBindingKeys } from '../query-keys'; +import { routeBindingMutationKeys } from '../mutation-keys'; +import type { RouteBindingSelect, RouteBindingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RouteBindingSelect, RouteBindingWithRelations } from '../../orm/input-types'; /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRouteBindingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRouteBindingMutation(params: { - selection: ({ - fields: S & RouteBindingSelect; - } & HookStrictSelect, RouteBindingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRouteBinding: { - routeBinding: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRouteBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRouteBindingMutation( + params: { + selection: { + fields: S & RouteBindingSelect; + } & HookStrictSelect, RouteBindingSelect>; + } & Omit< + UseMutationOptions< + { + deleteRouteBinding: { + routeBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRouteBinding: { + routeBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRouteBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeBindingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().routeBinding.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .routeBinding.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: routeBindingKeys.detail(variables.id) + queryKey: routeBindingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: routeBindingKeys.lists() + queryKey: routeBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteRouteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteRouteMutation.ts index d28e23a772..34e4affc94 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteRouteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteRouteMutation.ts @@ -4,77 +4,95 @@ * 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 { routeKeys } from "../query-keys"; -import { routeMutationKeys } from "../mutation-keys"; -import type { RouteSelect, RouteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteSelect, RouteWithRelations } from "../../orm/input-types"; +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 { routeKeys } from '../query-keys'; +import { routeMutationKeys } from '../mutation-keys'; +import type { RouteSelect, RouteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RouteSelect, RouteWithRelations } from '../../orm/input-types'; /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRouteMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRouteMutation(params: { - selection: ({ - fields: S & RouteSelect; - } & HookStrictSelect, RouteSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRoute: { - route: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRouteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRouteMutation( + params: { + selection: { + fields: S & RouteSelect; + } & HookStrictSelect, RouteSelect>; + } & Omit< + UseMutationOptions< + { + deleteRoute: { + route: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRoute: { + route: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRouteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().route.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .route.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: routeKeys.detail(variables.id) + queryKey: routeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: routeKeys.lists() + queryKey: routeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSchemaGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSchemaGrantMutation.ts index 590b01f96c..f7e5535f9e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSchemaGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSchemaGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { schemaGrantKeys } from "../query-keys"; -import { schemaGrantMutationKeys } from "../mutation-keys"; -import type { SchemaGrantSelect, SchemaGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaGrantSelect, SchemaGrantWithRelations } from "../../orm/input-types"; +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 { schemaGrantKeys } from '../query-keys'; +import { schemaGrantMutationKeys } from '../mutation-keys'; +import type { SchemaGrantSelect, SchemaGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SchemaGrantSelect, SchemaGrantWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a SchemaGrant with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSchemaGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSchemaGrantMutation(params: { - selection: ({ - fields: S & SchemaGrantSelect; - } & HookStrictSelect, SchemaGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSchemaGrant: { - schemaGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSchemaGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSchemaGrantMutation( + params: { + selection: { + fields: S & SchemaGrantSelect; + } & HookStrictSelect, SchemaGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteSchemaGrant: { + schemaGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSchemaGrant: { + schemaGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSchemaGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: schemaGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().schemaGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .schemaGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: schemaGrantKeys.detail(variables.id) + queryKey: schemaGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: schemaGrantKeys.lists() + queryKey: schemaGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSchemaMutation.ts index c2d9df16d5..bec1dd04a2 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSchemaMutation.ts @@ -4,77 +4,95 @@ * 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 { schemaKeys } from "../query-keys"; -import { schemaMutationKeys } from "../mutation-keys"; -import type { SchemaSelect, SchemaWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaSelect, SchemaWithRelations } from "../../orm/input-types"; +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 { schemaKeys } from '../query-keys'; +import { schemaMutationKeys } from '../mutation-keys'; +import type { SchemaSelect, SchemaWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SchemaSelect, SchemaWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Schema with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSchemaMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSchemaMutation(params: { - selection: ({ - fields: S & SchemaSelect; - } & HookStrictSelect, SchemaSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSchema: { - schema: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSchemaMutation( + params: { + selection: { + fields: S & SchemaSelect; + } & HookStrictSelect, SchemaSelect>; + } & Omit< + UseMutationOptions< + { + deleteSchema: { + schema: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSchema: { + schema: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: schemaMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().schema.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .schema.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: schemaKeys.detail(variables.id) + queryKey: schemaKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: schemaKeys.lists() + queryKey: schemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteMetadatumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteMetadatumMutation.ts index 3b9007e4d9..eae89a49af 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteMetadatumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteMetadatumMutation.ts @@ -4,77 +4,95 @@ * 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 { siteMetadatumKeys } from "../query-keys"; -import { siteMetadatumMutationKeys } from "../mutation-keys"; -import type { SiteMetadatumSelect, SiteMetadatumWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteMetadatumSelect, SiteMetadatumWithRelations } from "../../orm/input-types"; +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 { siteMetadatumKeys } from '../query-keys'; +import { siteMetadatumMutationKeys } from '../mutation-keys'; +import type { SiteMetadatumSelect, SiteMetadatumWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteMetadatumSelect, SiteMetadatumWithRelations } from '../../orm/input-types'; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSiteMetadatumMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSiteMetadatumMutation(params: { - selection: ({ - fields: S & SiteMetadatumSelect; - } & HookStrictSelect, SiteMetadatumSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSiteMetadatum: { - siteMetadatum: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSiteMetadatumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSiteMetadatumMutation( + params: { + selection: { + fields: S & SiteMetadatumSelect; + } & HookStrictSelect, SiteMetadatumSelect>; + } & Omit< + UseMutationOptions< + { + deleteSiteMetadatum: { + siteMetadatum: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSiteMetadatum: { + siteMetadatum: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSiteMetadatumMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteMetadatumMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().siteMetadatum.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .siteMetadatum.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: siteMetadatumKeys.detail(variables.id) + queryKey: siteMetadatumKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteMetadatumKeys.lists() + queryKey: siteMetadatumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteModuleMutation.ts index 58ef365048..e8f5c9dcab 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { siteModuleKeys } from "../query-keys"; -import { siteModuleMutationKeys } from "../mutation-keys"; -import type { SiteModuleSelect, SiteModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteModuleSelect, SiteModuleWithRelations } from "../../orm/input-types"; +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 { siteModuleKeys } from '../query-keys'; +import { siteModuleMutationKeys } from '../mutation-keys'; +import type { SiteModuleSelect, SiteModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteModuleSelect, SiteModuleWithRelations } from '../../orm/input-types'; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSiteModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSiteModuleMutation(params: { - selection: ({ - fields: S & SiteModuleSelect; - } & HookStrictSelect, SiteModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSiteModule: { - siteModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSiteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSiteModuleMutation( + params: { + selection: { + fields: S & SiteModuleSelect; + } & HookStrictSelect, SiteModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteSiteModule: { + siteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSiteModule: { + siteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSiteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().siteModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .siteModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: siteModuleKeys.detail(variables.id) + queryKey: siteModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteModuleKeys.lists() + queryKey: siteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteMutation.ts index 5b8806f300..9b41e9492e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteMutation.ts @@ -4,77 +4,95 @@ * 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 { siteKeys } from "../query-keys"; -import { siteMutationKeys } from "../mutation-keys"; -import type { SiteSelect, SiteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSelect, SiteWithRelations } from "../../orm/input-types"; +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 { siteKeys } from '../query-keys'; +import { siteMutationKeys } from '../mutation-keys'; +import type { SiteSelect, SiteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteSelect, SiteWithRelations } from '../../orm/input-types'; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSiteMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSiteMutation(params: { - selection: ({ - fields: S & SiteSelect; - } & HookStrictSelect, SiteSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSite: { - site: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSiteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSiteMutation( + params: { + selection: { + fields: S & SiteSelect; + } & HookStrictSelect, SiteSelect>; + } & Omit< + UseMutationOptions< + { + deleteSite: { + site: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSite: { + site: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSiteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().site.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .site.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: siteKeys.detail(variables.id) + queryKey: siteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteKeys.lists() + queryKey: siteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteThemeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteThemeMutation.ts index d556d79e51..26d254e012 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteThemeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSiteThemeMutation.ts @@ -4,77 +4,95 @@ * 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 { siteThemeKeys } from "../query-keys"; -import { siteThemeMutationKeys } from "../mutation-keys"; -import type { SiteThemeSelect, SiteThemeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteThemeSelect, SiteThemeWithRelations } from "../../orm/input-types"; +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 { siteThemeKeys } from '../query-keys'; +import { siteThemeMutationKeys } from '../mutation-keys'; +import type { SiteThemeSelect, SiteThemeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteThemeSelect, SiteThemeWithRelations } from '../../orm/input-types'; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSiteThemeMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSiteThemeMutation(params: { - selection: ({ - fields: S & SiteThemeSelect; - } & HookStrictSelect, SiteThemeSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSiteTheme: { - siteTheme: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSiteThemeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSiteThemeMutation( + params: { + selection: { + fields: S & SiteThemeSelect; + } & HookStrictSelect, SiteThemeSelect>; + } & Omit< + UseMutationOptions< + { + deleteSiteTheme: { + siteTheme: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSiteTheme: { + siteTheme: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSiteThemeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteThemeMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().siteTheme.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .siteTheme.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: siteThemeKeys.detail(variables.id) + queryKey: siteThemeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteThemeKeys.lists() + queryKey: siteThemeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSpatialRelationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSpatialRelationMutation.ts index 407831cdaa..345a16fc5f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteSpatialRelationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteSpatialRelationMutation.ts @@ -4,77 +4,95 @@ * 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 { spatialRelationKeys } from "../query-keys"; -import { spatialRelationMutationKeys } from "../mutation-keys"; -import type { SpatialRelationSelect, SpatialRelationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SpatialRelationSelect, SpatialRelationWithRelations } from "../../orm/input-types"; +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 { spatialRelationKeys } from '../query-keys'; +import { spatialRelationMutationKeys } from '../mutation-keys'; +import type { SpatialRelationSelect, SpatialRelationWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SpatialRelationSelect, SpatialRelationWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a SpatialRelation with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSpatialRelationMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSpatialRelationMutation(params: { - selection: ({ - fields: S & SpatialRelationSelect; - } & HookStrictSelect, SpatialRelationSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSpatialRelation: { - spatialRelation: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSpatialRelationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSpatialRelationMutation( + params: { + selection: { + fields: S & SpatialRelationSelect; + } & HookStrictSelect, SpatialRelationSelect>; + } & Omit< + UseMutationOptions< + { + deleteSpatialRelation: { + spatialRelation: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSpatialRelation: { + spatialRelation: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSpatialRelationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: spatialRelationMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().spatialRelation.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .spatialRelation.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: spatialRelationKeys.detail(variables.id) + queryKey: spatialRelationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: spatialRelationKeys.lists() + queryKey: spatialRelationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteTableGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteTableGrantMutation.ts index 75ef57649b..de24465b5c 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteTableGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteTableGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { tableGrantKeys } from "../query-keys"; -import { tableGrantMutationKeys } from "../mutation-keys"; -import type { TableGrantSelect, TableGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableGrantSelect, TableGrantWithRelations } from "../../orm/input-types"; +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 { tableGrantKeys } from '../query-keys'; +import { tableGrantMutationKeys } from '../mutation-keys'; +import type { TableGrantSelect, TableGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TableGrantSelect, TableGrantWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a TableGrant with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteTableGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteTableGrantMutation(params: { - selection: ({ - fields: S & TableGrantSelect; - } & HookStrictSelect, TableGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteTableGrant: { - tableGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteTableGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteTableGrantMutation( + params: { + selection: { + fields: S & TableGrantSelect; + } & HookStrictSelect, TableGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteTableGrant: { + tableGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteTableGrant: { + tableGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteTableGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: tableGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().tableGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .tableGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: tableGrantKeys.detail(variables.id) + queryKey: tableGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: tableGrantKeys.lists() + queryKey: tableGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteTableMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteTableMutation.ts index 4462c066be..ab496db2fa 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteTableMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteTableMutation.ts @@ -4,77 +4,95 @@ * 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 { tableKeys } from "../query-keys"; -import { tableMutationKeys } from "../mutation-keys"; -import type { TableSelect, TableWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableSelect, TableWithRelations } from "../../orm/input-types"; +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 { tableKeys } from '../query-keys'; +import { tableMutationKeys } from '../mutation-keys'; +import type { TableSelect, TableWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TableSelect, TableWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Table with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteTableMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteTableMutation(params: { - selection: ({ - fields: S & TableSelect; - } & HookStrictSelect, TableSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteTable: { - table: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteTableMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteTableMutation( + params: { + selection: { + fields: S & TableSelect; + } & HookStrictSelect, TableSelect>; + } & Omit< + UseMutationOptions< + { + deleteTable: { + table: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteTable: { + table: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteTableMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: tableMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().table.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .table.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: tableKeys.detail(variables.id) + queryKey: tableKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: tableKeys.lists() + queryKey: tableKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteTriggerFunctionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteTriggerFunctionMutation.ts index d1e7c73631..d36f5b47f0 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteTriggerFunctionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteTriggerFunctionMutation.ts @@ -4,77 +4,95 @@ * 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 { triggerFunctionKeys } from "../query-keys"; -import { triggerFunctionMutationKeys } from "../mutation-keys"; -import type { TriggerFunctionSelect, TriggerFunctionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerFunctionSelect, TriggerFunctionWithRelations } from "../../orm/input-types"; +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 { triggerFunctionKeys } from '../query-keys'; +import { triggerFunctionMutationKeys } from '../mutation-keys'; +import type { TriggerFunctionSelect, TriggerFunctionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TriggerFunctionSelect, TriggerFunctionWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a TriggerFunction with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteTriggerFunctionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteTriggerFunctionMutation(params: { - selection: ({ - fields: S & TriggerFunctionSelect; - } & HookStrictSelect, TriggerFunctionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteTriggerFunction: { - triggerFunction: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteTriggerFunctionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteTriggerFunctionMutation( + params: { + selection: { + fields: S & TriggerFunctionSelect; + } & HookStrictSelect, TriggerFunctionSelect>; + } & Omit< + UseMutationOptions< + { + deleteTriggerFunction: { + triggerFunction: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteTriggerFunction: { + triggerFunction: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteTriggerFunctionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: triggerFunctionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().triggerFunction.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .triggerFunction.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: triggerFunctionKeys.detail(variables.id) + queryKey: triggerFunctionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: triggerFunctionKeys.lists() + queryKey: triggerFunctionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteTriggerMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteTriggerMutation.ts index e69a73d801..8b73999424 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteTriggerMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteTriggerMutation.ts @@ -4,77 +4,95 @@ * 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 { triggerKeys } from "../query-keys"; -import { triggerMutationKeys } from "../mutation-keys"; -import type { TriggerSelect, TriggerWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerSelect, TriggerWithRelations } from "../../orm/input-types"; +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 { triggerKeys } from '../query-keys'; +import { triggerMutationKeys } from '../mutation-keys'; +import type { TriggerSelect, TriggerWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TriggerSelect, TriggerWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a Trigger with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteTriggerMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteTriggerMutation(params: { - selection: ({ - fields: S & TriggerSelect; - } & HookStrictSelect, TriggerSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteTrigger: { - trigger: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteTriggerMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteTriggerMutation( + params: { + selection: { + fields: S & TriggerSelect; + } & HookStrictSelect, TriggerSelect>; + } & Omit< + UseMutationOptions< + { + deleteTrigger: { + trigger: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteTrigger: { + trigger: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteTriggerMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: triggerMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().trigger.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .trigger.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: triggerKeys.detail(variables.id) + queryKey: triggerKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: triggerKeys.lists() + queryKey: triggerKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteUniqueConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteUniqueConstraintMutation.ts index 85017f6181..583e889d85 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteUniqueConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteUniqueConstraintMutation.ts @@ -4,77 +4,95 @@ * 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 { uniqueConstraintKeys } from "../query-keys"; -import { uniqueConstraintMutationKeys } from "../mutation-keys"; -import type { UniqueConstraintSelect, UniqueConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UniqueConstraintSelect, UniqueConstraintWithRelations } from "../../orm/input-types"; +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 { uniqueConstraintKeys } from '../query-keys'; +import { uniqueConstraintMutationKeys } from '../mutation-keys'; +import type { UniqueConstraintSelect, UniqueConstraintWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UniqueConstraintSelect, UniqueConstraintWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a UniqueConstraint with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteUniqueConstraintMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteUniqueConstraintMutation(params: { - selection: ({ - fields: S & UniqueConstraintSelect; - } & HookStrictSelect, UniqueConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteUniqueConstraint: { - uniqueConstraint: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteUniqueConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteUniqueConstraintMutation( + params: { + selection: { + fields: S & UniqueConstraintSelect; + } & HookStrictSelect, UniqueConstraintSelect>; + } & Omit< + UseMutationOptions< + { + deleteUniqueConstraint: { + uniqueConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteUniqueConstraint: { + uniqueConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteUniqueConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: uniqueConstraintMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().uniqueConstraint.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .uniqueConstraint.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: uniqueConstraintKeys.detail(variables.id) + queryKey: uniqueConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: uniqueConstraintKeys.lists() + queryKey: uniqueConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewGrantMutation.ts index b8957ac3b5..7f16bee8e0 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewGrantMutation.ts @@ -4,77 +4,95 @@ * 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 { viewGrantKeys } from "../query-keys"; -import { viewGrantMutationKeys } from "../mutation-keys"; -import type { ViewGrantSelect, ViewGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewGrantSelect, ViewGrantWithRelations } from "../../orm/input-types"; +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 { viewGrantKeys } from '../query-keys'; +import { viewGrantMutationKeys } from '../mutation-keys'; +import type { ViewGrantSelect, ViewGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewGrantSelect, ViewGrantWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a ViewGrant with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteViewGrantMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteViewGrantMutation(params: { - selection: ({ - fields: S & ViewGrantSelect; - } & HookStrictSelect, ViewGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteViewGrant: { - viewGrant: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteViewGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteViewGrantMutation( + params: { + selection: { + fields: S & ViewGrantSelect; + } & HookStrictSelect, ViewGrantSelect>; + } & Omit< + UseMutationOptions< + { + deleteViewGrant: { + viewGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteViewGrant: { + viewGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteViewGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewGrantMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().viewGrant.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .viewGrant.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: viewGrantKeys.detail(variables.id) + queryKey: viewGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: viewGrantKeys.lists() + queryKey: viewGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewMutation.ts index 5be93107fb..4a51300ea5 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewMutation.ts @@ -4,77 +4,95 @@ * 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 { viewKeys } from "../query-keys"; -import { viewMutationKeys } from "../mutation-keys"; -import type { ViewSelect, ViewWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewSelect, ViewWithRelations } from "../../orm/input-types"; +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 { viewKeys } from '../query-keys'; +import { viewMutationKeys } from '../mutation-keys'; +import type { ViewSelect, ViewWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewSelect, ViewWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a View with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteViewMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteViewMutation(params: { - selection: ({ - fields: S & ViewSelect; - } & HookStrictSelect, ViewSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteView: { - view: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteViewMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteViewMutation( + params: { + selection: { + fields: S & ViewSelect; + } & HookStrictSelect, ViewSelect>; + } & Omit< + UseMutationOptions< + { + deleteView: { + view: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteView: { + view: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteViewMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().view.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .view.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: viewKeys.detail(variables.id) + queryKey: viewKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: viewKeys.lists() + queryKey: viewKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewRuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewRuleMutation.ts index 5f0212c11a..f8c472b0e0 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewRuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewRuleMutation.ts @@ -4,77 +4,95 @@ * 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 { viewRuleKeys } from "../query-keys"; -import { viewRuleMutationKeys } from "../mutation-keys"; -import type { ViewRuleSelect, ViewRuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewRuleSelect, ViewRuleWithRelations } from "../../orm/input-types"; +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 { viewRuleKeys } from '../query-keys'; +import { viewRuleMutationKeys } from '../mutation-keys'; +import type { ViewRuleSelect, ViewRuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewRuleSelect, ViewRuleWithRelations } from '../../orm/input-types'; /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteViewRuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteViewRuleMutation(params: { - selection: ({ - fields: S & ViewRuleSelect; - } & HookStrictSelect, ViewRuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteViewRule: { - viewRule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteViewRuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteViewRuleMutation( + params: { + selection: { + fields: S & ViewRuleSelect; + } & HookStrictSelect, ViewRuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteViewRule: { + viewRule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteViewRule: { + viewRule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteViewRuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewRuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().viewRule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .viewRule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: viewRuleKeys.detail(variables.id) + queryKey: viewRuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: viewRuleKeys.lists() + queryKey: viewRuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewTableMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewTableMutation.ts index 7ff41bd172..5172e33b9f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewTableMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteViewTableMutation.ts @@ -4,77 +4,95 @@ * 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 { viewTableKeys } from "../query-keys"; -import { viewTableMutationKeys } from "../mutation-keys"; -import type { ViewTableSelect, ViewTableWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewTableSelect, ViewTableWithRelations } from "../../orm/input-types"; +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 { viewTableKeys } from '../query-keys'; +import { viewTableMutationKeys } from '../mutation-keys'; +import type { ViewTableSelect, ViewTableWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewTableSelect, ViewTableWithRelations } from '../../orm/input-types'; /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteViewTableMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteViewTableMutation(params: { - selection: ({ - fields: S & ViewTableSelect; - } & HookStrictSelect, ViewTableSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteViewTable: { - viewTable: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteViewTableMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteViewTableMutation( + params: { + selection: { + fields: S & ViewTableSelect; + } & HookStrictSelect, ViewTableSelect>; + } & Omit< + UseMutationOptions< + { + deleteViewTable: { + viewTable: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteViewTable: { + viewTable: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteViewTableMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewTableMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().viewTable.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .viewTable.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: viewTableKeys.detail(variables.id) + queryKey: viewTableKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: viewTableKeys.lists() + queryKey: viewTableKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useDeleteWebauthnSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useDeleteWebauthnSettingMutation.ts index f873423efe..29651b5ac4 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useDeleteWebauthnSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useDeleteWebauthnSettingMutation.ts @@ -4,77 +4,95 @@ * 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 { webauthnSettingKeys } from "../query-keys"; -import { webauthnSettingMutationKeys } from "../mutation-keys"; -import type { WebauthnSettingSelect, WebauthnSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnSettingSelect, WebauthnSettingWithRelations } from "../../orm/input-types"; +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 { webauthnSettingKeys } from '../query-keys'; +import { webauthnSettingMutationKeys } from '../mutation-keys'; +import type { WebauthnSettingSelect, WebauthnSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { WebauthnSettingSelect, WebauthnSettingWithRelations } from '../../orm/input-types'; /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteWebauthnSettingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteWebauthnSettingMutation(params: { - selection: ({ - fields: S & WebauthnSettingSelect; - } & HookStrictSelect, WebauthnSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteWebauthnSetting: { - webauthnSetting: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteWebauthnSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteWebauthnSettingMutation( + params: { + selection: { + fields: S & WebauthnSettingSelect; + } & HookStrictSelect, WebauthnSettingSelect>; + } & Omit< + UseMutationOptions< + { + deleteWebauthnSetting: { + webauthnSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteWebauthnSetting: { + webauthnSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteWebauthnSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnSettingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().webauthnSetting.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .webauthnSetting.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: webauthnSettingKeys.detail(variables.id) + queryKey: webauthnSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webauthnSettingKeys.lists() + queryKey: webauthnSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useRejectDatabaseTransferMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useRejectDatabaseTransferMutation.ts index bae65750a2..10cdc7f840 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useRejectDatabaseTransferMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useRejectDatabaseTransferMutation.ts @@ -4,39 +4,55 @@ * 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 { RejectDatabaseTransferVariables } from "../../orm/mutation"; -import type { RejectDatabaseTransferPayloadSelect, RejectDatabaseTransferPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { RejectDatabaseTransferVariables } from "../../orm/mutation"; -export type { RejectDatabaseTransferPayloadSelect } from "../../orm/input-types"; -export function useRejectDatabaseTransferMutation(params: { - selection: ({ - fields: S & RejectDatabaseTransferPayloadSelect; - } & HookStrictSelect, RejectDatabaseTransferPayloadSelect>); -} & Omit | null; -}, Error, RejectDatabaseTransferVariables>, "mutationFn">): UseMutationResult<{ - rejectDatabaseTransfer: InferSelectResult | null; -}, Error, RejectDatabaseTransferVariables> { +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 { RejectDatabaseTransferVariables } from '../../orm/mutation'; +import type { + RejectDatabaseTransferPayloadSelect, + RejectDatabaseTransferPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { RejectDatabaseTransferVariables } from '../../orm/mutation'; +export type { RejectDatabaseTransferPayloadSelect } from '../../orm/input-types'; +export function useRejectDatabaseTransferMutation( + params: { + selection: { + fields: S & RejectDatabaseTransferPayloadSelect; + } & HookStrictSelect, RejectDatabaseTransferPayloadSelect>; + } & Omit< + UseMutationOptions< + { + rejectDatabaseTransfer: InferSelectResult | null; + }, + Error, + RejectDatabaseTransferVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + rejectDatabaseTransfer: InferSelectResult | null; + }, + Error, + RejectDatabaseTransferVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.rejectDatabaseTransfer(), - mutationFn: (variables: RejectDatabaseTransferVariables) => getClient().mutation.rejectDatabaseTransfer(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: RejectDatabaseTransferVariables) => + getClient() + .mutation.rejectDatabaseTransfer(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useRequestDatabaseMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useRequestDatabaseMutation.ts index bcf200935d..dc62ae693a 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useRequestDatabaseMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useRequestDatabaseMutation.ts @@ -4,39 +4,52 @@ * 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 { RequestDatabaseVariables } from "../../orm/mutation"; -import type { RequestDatabasePayloadSelect, RequestDatabasePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { RequestDatabaseVariables } from "../../orm/mutation"; -export type { RequestDatabasePayloadSelect } from "../../orm/input-types"; -export function useRequestDatabaseMutation(params: { - selection: ({ - fields: S & RequestDatabasePayloadSelect; - } & HookStrictSelect, RequestDatabasePayloadSelect>); -} & Omit | null; -}, Error, RequestDatabaseVariables>, "mutationFn">): UseMutationResult<{ - requestDatabase: InferSelectResult | null; -}, Error, RequestDatabaseVariables> { +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 { RequestDatabaseVariables } from '../../orm/mutation'; +import type { RequestDatabasePayloadSelect, RequestDatabasePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { RequestDatabaseVariables } from '../../orm/mutation'; +export type { RequestDatabasePayloadSelect } from '../../orm/input-types'; +export function useRequestDatabaseMutation( + params: { + selection: { + fields: S & RequestDatabasePayloadSelect; + } & HookStrictSelect, RequestDatabasePayloadSelect>; + } & Omit< + UseMutationOptions< + { + requestDatabase: InferSelectResult | null; + }, + Error, + RequestDatabaseVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + requestDatabase: InferSelectResult | null; + }, + Error, + RequestDatabaseVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.requestDatabase(), - mutationFn: (variables: RequestDatabaseVariables) => getClient().mutation.requestDatabase(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: RequestDatabaseVariables) => + getClient() + .mutation.requestDatabase(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useSetFieldOrderMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useSetFieldOrderMutation.ts index 26becc2d7d..e24d213dd3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useSetFieldOrderMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useSetFieldOrderMutation.ts @@ -4,39 +4,52 @@ * 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 { SetFieldOrderVariables } from "../../orm/mutation"; -import type { SetFieldOrderPayloadSelect, SetFieldOrderPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SetFieldOrderVariables } from "../../orm/mutation"; -export type { SetFieldOrderPayloadSelect } from "../../orm/input-types"; -export function useSetFieldOrderMutation(params: { - selection: ({ - fields: S & SetFieldOrderPayloadSelect; - } & HookStrictSelect, SetFieldOrderPayloadSelect>); -} & Omit | null; -}, Error, SetFieldOrderVariables>, "mutationFn">): UseMutationResult<{ - setFieldOrder: InferSelectResult | null; -}, Error, SetFieldOrderVariables> { +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 { SetFieldOrderVariables } from '../../orm/mutation'; +import type { SetFieldOrderPayloadSelect, SetFieldOrderPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SetFieldOrderVariables } from '../../orm/mutation'; +export type { SetFieldOrderPayloadSelect } from '../../orm/input-types'; +export function useSetFieldOrderMutation( + params: { + selection: { + fields: S & SetFieldOrderPayloadSelect; + } & HookStrictSelect, SetFieldOrderPayloadSelect>; + } & Omit< + UseMutationOptions< + { + setFieldOrder: InferSelectResult | null; + }, + Error, + SetFieldOrderVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + setFieldOrder: InferSelectResult | null; + }, + Error, + SetFieldOrderVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.setFieldOrder(), - mutationFn: (variables: SetFieldOrderVariables) => getClient().mutation.setFieldOrder(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SetFieldOrderVariables) => + getClient() + .mutation.setFieldOrder(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiModuleMutation.ts index 81dc1384f4..e0cb98d24c 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { apiModuleKeys } from "../query-keys"; -import { apiModuleMutationKeys } from "../mutation-keys"; -import type { ApiModuleSelect, ApiModuleWithRelations, ApiModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiModuleSelect, ApiModuleWithRelations, ApiModulePatch } from "../../orm/input-types"; +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 { apiModuleKeys } from '../query-keys'; +import { apiModuleMutationKeys } from '../mutation-keys'; +import type { + ApiModuleSelect, + ApiModuleWithRelations, + ApiModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ApiModuleSelect, + ApiModuleWithRelations, + ApiModulePatch, +} from '../../orm/input-types'; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateApiModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', apiModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateApiModuleMutation(params: { - selection: ({ - fields: S & ApiModuleSelect; - } & HookStrictSelect, ApiModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - apiModulePatch: ApiModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateApiModule: { - apiModule: InferSelectResult; - }; -}, Error, { - id: string; - apiModulePatch: ApiModulePatch; -}>; -export function useUpdateApiModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateApiModuleMutation( + params: { + selection: { + fields: S & ApiModuleSelect; + } & HookStrictSelect, ApiModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateApiModule: { + apiModule: InferSelectResult; + }; + }, + Error, + { + id: string; + apiModulePatch: ApiModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateApiModule: { + apiModule: InferSelectResult; + }; + }, + Error, + { + id: string; + apiModulePatch: ApiModulePatch; + } +>; +export function useUpdateApiModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + apiModulePatch: ApiModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiModuleMutationKeys.all, - mutationFn: ({ - id, - apiModulePatch - }: { - id: string; - apiModulePatch: ApiModulePatch; - }) => getClient().apiModule.update({ - where: { - id - }, - data: apiModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, apiModulePatch }: { id: string; apiModulePatch: ApiModulePatch }) => + getClient() + .apiModule.update({ + where: { + id, + }, + data: apiModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: apiModuleKeys.detail(variables.id) + queryKey: apiModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiModuleKeys.lists() + queryKey: apiModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiMutation.ts index 60b1aa5072..8b7a7de7eb 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiMutation.ts @@ -4,83 +4,99 @@ * 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 { apiKeys } from "../query-keys"; -import { apiMutationKeys } from "../mutation-keys"; -import type { ApiSelect, ApiWithRelations, ApiPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSelect, ApiWithRelations, ApiPatch } from "../../orm/input-types"; +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 { apiKeys } from '../query-keys'; +import { apiMutationKeys } from '../mutation-keys'; +import type { ApiSelect, ApiWithRelations, ApiPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSelect, ApiWithRelations, ApiPatch } from '../../orm/input-types'; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateApiMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', apiPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateApiMutation(params: { - selection: ({ - fields: S & ApiSelect; - } & HookStrictSelect, ApiSelect>); -} & Omit; - }; -}, Error, { - id: string; - apiPatch: ApiPatch; -}>, "mutationFn">): UseMutationResult<{ - updateApi: { - api: InferSelectResult; - }; -}, Error, { - id: string; - apiPatch: ApiPatch; -}>; -export function useUpdateApiMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateApiMutation( + params: { + selection: { + fields: S & ApiSelect; + } & HookStrictSelect, ApiSelect>; + } & Omit< + UseMutationOptions< + { + updateApi: { + api: InferSelectResult; + }; + }, + Error, + { + id: string; + apiPatch: ApiPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateApi: { + api: InferSelectResult; + }; + }, + Error, + { + id: string; + apiPatch: ApiPatch; + } +>; +export function useUpdateApiMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + apiPatch: ApiPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiMutationKeys.all, - mutationFn: ({ - id, - apiPatch - }: { - id: string; - apiPatch: ApiPatch; - }) => getClient().api.update({ - where: { - id - }, - data: apiPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, apiPatch }: { id: string; apiPatch: ApiPatch }) => + getClient() + .api.update({ + where: { + id, + }, + data: apiPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: apiKeys.detail(variables.id) + queryKey: apiKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiKeys.lists() + queryKey: apiKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiSchemaMutation.ts index 2b4b7a9775..6b8cfc7fa1 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiSchemaMutation.ts @@ -4,83 +4,107 @@ * 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 { apiSchemaKeys } from "../query-keys"; -import { apiSchemaMutationKeys } from "../mutation-keys"; -import type { ApiSchemaSelect, ApiSchemaWithRelations, ApiSchemaPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSchemaSelect, ApiSchemaWithRelations, ApiSchemaPatch } from "../../orm/input-types"; +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 { apiSchemaKeys } from '../query-keys'; +import { apiSchemaMutationKeys } from '../mutation-keys'; +import type { + ApiSchemaSelect, + ApiSchemaWithRelations, + ApiSchemaPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ApiSchemaSelect, + ApiSchemaWithRelations, + ApiSchemaPatch, +} from '../../orm/input-types'; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateApiSchemaMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', apiSchemaPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateApiSchemaMutation(params: { - selection: ({ - fields: S & ApiSchemaSelect; - } & HookStrictSelect, ApiSchemaSelect>); -} & Omit; - }; -}, Error, { - id: string; - apiSchemaPatch: ApiSchemaPatch; -}>, "mutationFn">): UseMutationResult<{ - updateApiSchema: { - apiSchema: InferSelectResult; - }; -}, Error, { - id: string; - apiSchemaPatch: ApiSchemaPatch; -}>; -export function useUpdateApiSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateApiSchemaMutation( + params: { + selection: { + fields: S & ApiSchemaSelect; + } & HookStrictSelect, ApiSchemaSelect>; + } & Omit< + UseMutationOptions< + { + updateApiSchema: { + apiSchema: InferSelectResult; + }; + }, + Error, + { + id: string; + apiSchemaPatch: ApiSchemaPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateApiSchema: { + apiSchema: InferSelectResult; + }; + }, + Error, + { + id: string; + apiSchemaPatch: ApiSchemaPatch; + } +>; +export function useUpdateApiSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + apiSchemaPatch: ApiSchemaPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSchemaMutationKeys.all, - mutationFn: ({ - id, - apiSchemaPatch - }: { - id: string; - apiSchemaPatch: ApiSchemaPatch; - }) => getClient().apiSchema.update({ - where: { - id - }, - data: apiSchemaPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, apiSchemaPatch }: { id: string; apiSchemaPatch: ApiSchemaPatch }) => + getClient() + .apiSchema.update({ + where: { + id, + }, + data: apiSchemaPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: apiSchemaKeys.detail(variables.id) + queryKey: apiSchemaKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiSchemaKeys.lists() + queryKey: apiSchemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiSettingMutation.ts index b75271764a..d90329fb7e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateApiSettingMutation.ts @@ -4,83 +4,107 @@ * 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 { apiSettingKeys } from "../query-keys"; -import { apiSettingMutationKeys } from "../mutation-keys"; -import type { ApiSettingSelect, ApiSettingWithRelations, ApiSettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSettingSelect, ApiSettingWithRelations, ApiSettingPatch } from "../../orm/input-types"; +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 { apiSettingKeys } from '../query-keys'; +import { apiSettingMutationKeys } from '../mutation-keys'; +import type { + ApiSettingSelect, + ApiSettingWithRelations, + ApiSettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ApiSettingSelect, + ApiSettingWithRelations, + ApiSettingPatch, +} from '../../orm/input-types'; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateApiSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', apiSettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateApiSettingMutation(params: { - selection: ({ - fields: S & ApiSettingSelect; - } & HookStrictSelect, ApiSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - apiSettingPatch: ApiSettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateApiSetting: { - apiSetting: InferSelectResult; - }; -}, Error, { - id: string; - apiSettingPatch: ApiSettingPatch; -}>; -export function useUpdateApiSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateApiSettingMutation( + params: { + selection: { + fields: S & ApiSettingSelect; + } & HookStrictSelect, ApiSettingSelect>; + } & Omit< + UseMutationOptions< + { + updateApiSetting: { + apiSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + apiSettingPatch: ApiSettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateApiSetting: { + apiSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + apiSettingPatch: ApiSettingPatch; + } +>; +export function useUpdateApiSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + apiSettingPatch: ApiSettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSettingMutationKeys.all, - mutationFn: ({ - id, - apiSettingPatch - }: { - id: string; - apiSettingPatch: ApiSettingPatch; - }) => getClient().apiSetting.update({ - where: { - id - }, - data: apiSettingPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, apiSettingPatch }: { id: string; apiSettingPatch: ApiSettingPatch }) => + getClient() + .apiSetting.update({ + where: { + id, + }, + data: apiSettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: apiSettingKeys.detail(variables.id) + queryKey: apiSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiSettingKeys.lists() + queryKey: apiSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateCheckConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateCheckConstraintMutation.ts index 8d5cdd80c3..9088de037f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateCheckConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateCheckConstraintMutation.ts @@ -4,83 +4,113 @@ * 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 { checkConstraintKeys } from "../query-keys"; -import { checkConstraintMutationKeys } from "../mutation-keys"; -import type { CheckConstraintSelect, CheckConstraintWithRelations, CheckConstraintPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CheckConstraintSelect, CheckConstraintWithRelations, CheckConstraintPatch } from "../../orm/input-types"; +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 { checkConstraintKeys } from '../query-keys'; +import { checkConstraintMutationKeys } from '../mutation-keys'; +import type { + CheckConstraintSelect, + CheckConstraintWithRelations, + CheckConstraintPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CheckConstraintSelect, + CheckConstraintWithRelations, + CheckConstraintPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a CheckConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateCheckConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', checkConstraintPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateCheckConstraintMutation(params: { - selection: ({ - fields: S & CheckConstraintSelect; - } & HookStrictSelect, CheckConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; - checkConstraintPatch: CheckConstraintPatch; -}>, "mutationFn">): UseMutationResult<{ - updateCheckConstraint: { - checkConstraint: InferSelectResult; - }; -}, Error, { - id: string; - checkConstraintPatch: CheckConstraintPatch; -}>; -export function useUpdateCheckConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateCheckConstraintMutation( + params: { + selection: { + fields: S & CheckConstraintSelect; + } & HookStrictSelect, CheckConstraintSelect>; + } & Omit< + UseMutationOptions< + { + updateCheckConstraint: { + checkConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + checkConstraintPatch: CheckConstraintPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateCheckConstraint: { + checkConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + checkConstraintPatch: CheckConstraintPatch; + } +>; +export function useUpdateCheckConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + checkConstraintPatch: CheckConstraintPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: checkConstraintMutationKeys.all, mutationFn: ({ id, - checkConstraintPatch + checkConstraintPatch, }: { id: string; checkConstraintPatch: CheckConstraintPatch; - }) => getClient().checkConstraint.update({ - where: { - id - }, - data: checkConstraintPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .checkConstraint.update({ + where: { + id, + }, + data: checkConstraintPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: checkConstraintKeys.detail(variables.id) + queryKey: checkConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: checkConstraintKeys.lists() + queryKey: checkConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateCompositeTypeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateCompositeTypeMutation.ts index 6219a2ebd3..a1ccc3706e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateCompositeTypeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateCompositeTypeMutation.ts @@ -4,83 +4,113 @@ * 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 { compositeTypeKeys } from "../query-keys"; -import { compositeTypeMutationKeys } from "../mutation-keys"; -import type { CompositeTypeSelect, CompositeTypeWithRelations, CompositeTypePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CompositeTypeSelect, CompositeTypeWithRelations, CompositeTypePatch } from "../../orm/input-types"; +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 { compositeTypeKeys } from '../query-keys'; +import { compositeTypeMutationKeys } from '../mutation-keys'; +import type { + CompositeTypeSelect, + CompositeTypeWithRelations, + CompositeTypePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CompositeTypeSelect, + CompositeTypeWithRelations, + CompositeTypePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a CompositeType - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateCompositeTypeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', compositeTypePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateCompositeTypeMutation(params: { - selection: ({ - fields: S & CompositeTypeSelect; - } & HookStrictSelect, CompositeTypeSelect>); -} & Omit; - }; -}, Error, { - id: string; - compositeTypePatch: CompositeTypePatch; -}>, "mutationFn">): UseMutationResult<{ - updateCompositeType: { - compositeType: InferSelectResult; - }; -}, Error, { - id: string; - compositeTypePatch: CompositeTypePatch; -}>; -export function useUpdateCompositeTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateCompositeTypeMutation( + params: { + selection: { + fields: S & CompositeTypeSelect; + } & HookStrictSelect, CompositeTypeSelect>; + } & Omit< + UseMutationOptions< + { + updateCompositeType: { + compositeType: InferSelectResult; + }; + }, + Error, + { + id: string; + compositeTypePatch: CompositeTypePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateCompositeType: { + compositeType: InferSelectResult; + }; + }, + Error, + { + id: string; + compositeTypePatch: CompositeTypePatch; + } +>; +export function useUpdateCompositeTypeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + compositeTypePatch: CompositeTypePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: compositeTypeMutationKeys.all, mutationFn: ({ id, - compositeTypePatch + compositeTypePatch, }: { id: string; compositeTypePatch: CompositeTypePatch; - }) => getClient().compositeType.update({ - where: { - id - }, - data: compositeTypePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .compositeType.update({ + where: { + id, + }, + data: compositeTypePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: compositeTypeKeys.detail(variables.id) + queryKey: compositeTypeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: compositeTypeKeys.lists() + queryKey: compositeTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateCorsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateCorsSettingMutation.ts index 2ccfaf32a7..fa21a3c656 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateCorsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateCorsSettingMutation.ts @@ -4,83 +4,107 @@ * 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 { corsSettingKeys } from "../query-keys"; -import { corsSettingMutationKeys } from "../mutation-keys"; -import type { CorsSettingSelect, CorsSettingWithRelations, CorsSettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CorsSettingSelect, CorsSettingWithRelations, CorsSettingPatch } from "../../orm/input-types"; +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 { corsSettingKeys } from '../query-keys'; +import { corsSettingMutationKeys } from '../mutation-keys'; +import type { + CorsSettingSelect, + CorsSettingWithRelations, + CorsSettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CorsSettingSelect, + CorsSettingWithRelations, + CorsSettingPatch, +} from '../../orm/input-types'; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateCorsSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', corsSettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateCorsSettingMutation(params: { - selection: ({ - fields: S & CorsSettingSelect; - } & HookStrictSelect, CorsSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - corsSettingPatch: CorsSettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateCorsSetting: { - corsSetting: InferSelectResult; - }; -}, Error, { - id: string; - corsSettingPatch: CorsSettingPatch; -}>; -export function useUpdateCorsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateCorsSettingMutation( + params: { + selection: { + fields: S & CorsSettingSelect; + } & HookStrictSelect, CorsSettingSelect>; + } & Omit< + UseMutationOptions< + { + updateCorsSetting: { + corsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + corsSettingPatch: CorsSettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateCorsSetting: { + corsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + corsSettingPatch: CorsSettingPatch; + } +>; +export function useUpdateCorsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + corsSettingPatch: CorsSettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: corsSettingMutationKeys.all, - mutationFn: ({ - id, - corsSettingPatch - }: { - id: string; - corsSettingPatch: CorsSettingPatch; - }) => getClient().corsSetting.update({ - where: { - id - }, - data: corsSettingPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, corsSettingPatch }: { id: string; corsSettingPatch: CorsSettingPatch }) => + getClient() + .corsSetting.update({ + where: { + id, + }, + data: corsSettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: corsSettingKeys.detail(variables.id) + queryKey: corsSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: corsSettingKeys.lists() + queryKey: corsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseMutation.ts index 9e596bc916..0f77a91ba2 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseMutation.ts @@ -4,83 +4,99 @@ * 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 { databaseKeys } from "../query-keys"; -import { databaseMutationKeys } from "../mutation-keys"; -import type { DatabaseSelect, DatabaseWithRelations, DatabasePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSelect, DatabaseWithRelations, DatabasePatch } from "../../orm/input-types"; +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 { databaseKeys } from '../query-keys'; +import { databaseMutationKeys } from '../mutation-keys'; +import type { DatabaseSelect, DatabaseWithRelations, DatabasePatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DatabaseSelect, DatabaseWithRelations, DatabasePatch } from '../../orm/input-types'; /** * Mutation hook for updating a Database - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDatabaseMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', databasePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDatabaseMutation(params: { - selection: ({ - fields: S & DatabaseSelect; - } & HookStrictSelect, DatabaseSelect>); -} & Omit; - }; -}, Error, { - id: string; - databasePatch: DatabasePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDatabase: { - database: InferSelectResult; - }; -}, Error, { - id: string; - databasePatch: DatabasePatch; -}>; -export function useUpdateDatabaseMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDatabaseMutation( + params: { + selection: { + fields: S & DatabaseSelect; + } & HookStrictSelect, DatabaseSelect>; + } & Omit< + UseMutationOptions< + { + updateDatabase: { + database: InferSelectResult; + }; + }, + Error, + { + id: string; + databasePatch: DatabasePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDatabase: { + database: InferSelectResult; + }; + }, + Error, + { + id: string; + databasePatch: DatabasePatch; + } +>; +export function useUpdateDatabaseMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databasePatch: DatabasePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseMutationKeys.all, - mutationFn: ({ - id, - databasePatch - }: { - id: string; - databasePatch: DatabasePatch; - }) => getClient().database.update({ - where: { - id - }, - data: databasePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, databasePatch }: { id: string; databasePatch: DatabasePatch }) => + getClient() + .database.update({ + where: { + id, + }, + data: databasePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: databaseKeys.detail(variables.id) + queryKey: databaseKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseKeys.lists() + queryKey: databaseKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseSettingMutation.ts index ec10dbb84b..32420818ad 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseSettingMutation.ts @@ -4,83 +4,113 @@ * 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 { databaseSettingKeys } from "../query-keys"; -import { databaseSettingMutationKeys } from "../mutation-keys"; -import type { DatabaseSettingSelect, DatabaseSettingWithRelations, DatabaseSettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingSelect, DatabaseSettingWithRelations, DatabaseSettingPatch } from "../../orm/input-types"; +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 { databaseSettingKeys } from '../query-keys'; +import { databaseSettingMutationKeys } from '../mutation-keys'; +import type { + DatabaseSettingSelect, + DatabaseSettingWithRelations, + DatabaseSettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseSettingSelect, + DatabaseSettingWithRelations, + DatabaseSettingPatch, +} from '../../orm/input-types'; /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDatabaseSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', databaseSettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDatabaseSettingMutation(params: { - selection: ({ - fields: S & DatabaseSettingSelect; - } & HookStrictSelect, DatabaseSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseSettingPatch: DatabaseSettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDatabaseSetting: { - databaseSetting: InferSelectResult; - }; -}, Error, { - id: string; - databaseSettingPatch: DatabaseSettingPatch; -}>; -export function useUpdateDatabaseSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDatabaseSettingMutation( + params: { + selection: { + fields: S & DatabaseSettingSelect; + } & HookStrictSelect, DatabaseSettingSelect>; + } & Omit< + UseMutationOptions< + { + updateDatabaseSetting: { + databaseSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseSettingPatch: DatabaseSettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDatabaseSetting: { + databaseSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseSettingPatch: DatabaseSettingPatch; + } +>; +export function useUpdateDatabaseSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseSettingPatch: DatabaseSettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseSettingMutationKeys.all, mutationFn: ({ id, - databaseSettingPatch + databaseSettingPatch, }: { id: string; databaseSettingPatch: DatabaseSettingPatch; - }) => getClient().databaseSetting.update({ - where: { - id - }, - data: databaseSettingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .databaseSetting.update({ + where: { + id, + }, + data: databaseSettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: databaseSettingKeys.detail(variables.id) + queryKey: databaseSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseSettingKeys.lists() + queryKey: databaseSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseTransferMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseTransferMutation.ts index 58728b415c..33628d38bd 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseTransferMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDatabaseTransferMutation.ts @@ -4,83 +4,113 @@ * 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 { databaseTransferKeys } from "../query-keys"; -import { databaseTransferMutationKeys } from "../mutation-keys"; -import type { DatabaseTransferSelect, DatabaseTransferWithRelations, DatabaseTransferPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseTransferSelect, DatabaseTransferWithRelations, DatabaseTransferPatch } from "../../orm/input-types"; +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 { databaseTransferKeys } from '../query-keys'; +import { databaseTransferMutationKeys } from '../mutation-keys'; +import type { + DatabaseTransferSelect, + DatabaseTransferWithRelations, + DatabaseTransferPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseTransferSelect, + DatabaseTransferWithRelations, + DatabaseTransferPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DatabaseTransfer - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDatabaseTransferMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', databaseTransferPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDatabaseTransferMutation(params: { - selection: ({ - fields: S & DatabaseTransferSelect; - } & HookStrictSelect, DatabaseTransferSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseTransferPatch: DatabaseTransferPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDatabaseTransfer: { - databaseTransfer: InferSelectResult; - }; -}, Error, { - id: string; - databaseTransferPatch: DatabaseTransferPatch; -}>; -export function useUpdateDatabaseTransferMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDatabaseTransferMutation( + params: { + selection: { + fields: S & DatabaseTransferSelect; + } & HookStrictSelect, DatabaseTransferSelect>; + } & Omit< + UseMutationOptions< + { + updateDatabaseTransfer: { + databaseTransfer: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseTransferPatch: DatabaseTransferPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDatabaseTransfer: { + databaseTransfer: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseTransferPatch: DatabaseTransferPatch; + } +>; +export function useUpdateDatabaseTransferMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseTransferPatch: DatabaseTransferPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseTransferMutationKeys.all, mutationFn: ({ id, - databaseTransferPatch + databaseTransferPatch, }: { id: string; databaseTransferPatch: DatabaseTransferPatch; - }) => getClient().databaseTransfer.update({ - where: { - id - }, - data: databaseTransferPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .databaseTransfer.update({ + where: { + id, + }, + data: databaseTransferPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: databaseTransferKeys.detail(variables.id) + queryKey: databaseTransferKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseTransferKeys.lists() + queryKey: databaseTransferKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDefaultPrivilegeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDefaultPrivilegeMutation.ts index 3cfca9c4fd..240dacb201 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDefaultPrivilegeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDefaultPrivilegeMutation.ts @@ -4,83 +4,113 @@ * 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 { defaultPrivilegeKeys } from "../query-keys"; -import { defaultPrivilegeMutationKeys } from "../mutation-keys"; -import type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations, DefaultPrivilegePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations, DefaultPrivilegePatch } from "../../orm/input-types"; +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 { defaultPrivilegeKeys } from '../query-keys'; +import { defaultPrivilegeMutationKeys } from '../mutation-keys'; +import type { + DefaultPrivilegeSelect, + DefaultPrivilegeWithRelations, + DefaultPrivilegePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DefaultPrivilegeSelect, + DefaultPrivilegeWithRelations, + DefaultPrivilegePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DefaultPrivilege - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDefaultPrivilegeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', defaultPrivilegePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDefaultPrivilegeMutation(params: { - selection: ({ - fields: S & DefaultPrivilegeSelect; - } & HookStrictSelect, DefaultPrivilegeSelect>); -} & Omit; - }; -}, Error, { - id: string; - defaultPrivilegePatch: DefaultPrivilegePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDefaultPrivilege: { - defaultPrivilege: InferSelectResult; - }; -}, Error, { - id: string; - defaultPrivilegePatch: DefaultPrivilegePatch; -}>; -export function useUpdateDefaultPrivilegeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDefaultPrivilegeMutation( + params: { + selection: { + fields: S & DefaultPrivilegeSelect; + } & HookStrictSelect, DefaultPrivilegeSelect>; + } & Omit< + UseMutationOptions< + { + updateDefaultPrivilege: { + defaultPrivilege: InferSelectResult; + }; + }, + Error, + { + id: string; + defaultPrivilegePatch: DefaultPrivilegePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDefaultPrivilege: { + defaultPrivilege: InferSelectResult; + }; + }, + Error, + { + id: string; + defaultPrivilegePatch: DefaultPrivilegePatch; + } +>; +export function useUpdateDefaultPrivilegeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + defaultPrivilegePatch: DefaultPrivilegePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: defaultPrivilegeMutationKeys.all, mutationFn: ({ id, - defaultPrivilegePatch + defaultPrivilegePatch, }: { id: string; defaultPrivilegePatch: DefaultPrivilegePatch; - }) => getClient().defaultPrivilege.update({ - where: { - id - }, - data: defaultPrivilegePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .defaultPrivilege.update({ + where: { + id, + }, + data: defaultPrivilegePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: defaultPrivilegeKeys.detail(variables.id) + queryKey: defaultPrivilegeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: defaultPrivilegeKeys.lists() + queryKey: defaultPrivilegeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainEventMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainEventMutation.ts index 971904d162..2b32c8ba78 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainEventMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainEventMutation.ts @@ -4,83 +4,107 @@ * 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 { domainEventKeys } from "../query-keys"; -import { domainEventMutationKeys } from "../mutation-keys"; -import type { DomainEventSelect, DomainEventWithRelations, DomainEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainEventSelect, DomainEventWithRelations, DomainEventPatch } from "../../orm/input-types"; +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 { domainEventKeys } from '../query-keys'; +import { domainEventMutationKeys } from '../mutation-keys'; +import type { + DomainEventSelect, + DomainEventWithRelations, + DomainEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DomainEventSelect, + DomainEventWithRelations, + DomainEventPatch, +} from '../../orm/input-types'; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDomainEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', domainEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDomainEventMutation(params: { - selection: ({ - fields: S & DomainEventSelect; - } & HookStrictSelect, DomainEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - domainEventPatch: DomainEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDomainEvent: { - domainEvent: InferSelectResult; - }; -}, Error, { - id: string; - domainEventPatch: DomainEventPatch; -}>; -export function useUpdateDomainEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDomainEventMutation( + params: { + selection: { + fields: S & DomainEventSelect; + } & HookStrictSelect, DomainEventSelect>; + } & Omit< + UseMutationOptions< + { + updateDomainEvent: { + domainEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + domainEventPatch: DomainEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDomainEvent: { + domainEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + domainEventPatch: DomainEventPatch; + } +>; +export function useUpdateDomainEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + domainEventPatch: DomainEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainEventMutationKeys.all, - mutationFn: ({ - id, - domainEventPatch - }: { - id: string; - domainEventPatch: DomainEventPatch; - }) => getClient().domainEvent.update({ - where: { - id - }, - data: domainEventPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, domainEventPatch }: { id: string; domainEventPatch: DomainEventPatch }) => + getClient() + .domainEvent.update({ + where: { + id, + }, + data: domainEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: domainEventKeys.detail(variables.id) + queryKey: domainEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: domainEventKeys.lists() + queryKey: domainEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainMutation.ts index 84ce9ba59b..3142ae157f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainMutation.ts @@ -4,83 +4,99 @@ * 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 { domainKeys } from "../query-keys"; -import { domainMutationKeys } from "../mutation-keys"; -import type { DomainSelect, DomainWithRelations, DomainPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainSelect, DomainWithRelations, DomainPatch } from "../../orm/input-types"; +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 { domainKeys } from '../query-keys'; +import { domainMutationKeys } from '../mutation-keys'; +import type { DomainSelect, DomainWithRelations, DomainPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DomainSelect, DomainWithRelations, DomainPatch } from '../../orm/input-types'; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDomainMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', domainPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDomainMutation(params: { - selection: ({ - fields: S & DomainSelect; - } & HookStrictSelect, DomainSelect>); -} & Omit; - }; -}, Error, { - id: string; - domainPatch: DomainPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDomain: { - domain: InferSelectResult; - }; -}, Error, { - id: string; - domainPatch: DomainPatch; -}>; -export function useUpdateDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDomainMutation( + params: { + selection: { + fields: S & DomainSelect; + } & HookStrictSelect, DomainSelect>; + } & Omit< + UseMutationOptions< + { + updateDomain: { + domain: InferSelectResult; + }; + }, + Error, + { + id: string; + domainPatch: DomainPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDomain: { + domain: InferSelectResult; + }; + }, + Error, + { + id: string; + domainPatch: DomainPatch; + } +>; +export function useUpdateDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + domainPatch: DomainPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainMutationKeys.all, - mutationFn: ({ - id, - domainPatch - }: { - id: string; - domainPatch: DomainPatch; - }) => getClient().domain.update({ - where: { - id - }, - data: domainPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, domainPatch }: { id: string; domainPatch: DomainPatch }) => + getClient() + .domain.update({ + where: { + id, + }, + data: domainPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: domainKeys.detail(variables.id) + queryKey: domainKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: domainKeys.lists() + queryKey: domainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainVerificationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainVerificationMutation.ts index 40f7ac72bd..9c714ddfc1 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainVerificationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateDomainVerificationMutation.ts @@ -4,83 +4,113 @@ * 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 { domainVerificationKeys } from "../query-keys"; -import { domainVerificationMutationKeys } from "../mutation-keys"; -import type { DomainVerificationSelect, DomainVerificationWithRelations, DomainVerificationPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainVerificationSelect, DomainVerificationWithRelations, DomainVerificationPatch } from "../../orm/input-types"; +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 { domainVerificationKeys } from '../query-keys'; +import { domainVerificationMutationKeys } from '../mutation-keys'; +import type { + DomainVerificationSelect, + DomainVerificationWithRelations, + DomainVerificationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DomainVerificationSelect, + DomainVerificationWithRelations, + DomainVerificationPatch, +} from '../../orm/input-types'; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDomainVerificationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', domainVerificationPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDomainVerificationMutation(params: { - selection: ({ - fields: S & DomainVerificationSelect; - } & HookStrictSelect, DomainVerificationSelect>); -} & Omit; - }; -}, Error, { - id: string; - domainVerificationPatch: DomainVerificationPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDomainVerification: { - domainVerification: InferSelectResult; - }; -}, Error, { - id: string; - domainVerificationPatch: DomainVerificationPatch; -}>; -export function useUpdateDomainVerificationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDomainVerificationMutation( + params: { + selection: { + fields: S & DomainVerificationSelect; + } & HookStrictSelect, DomainVerificationSelect>; + } & Omit< + UseMutationOptions< + { + updateDomainVerification: { + domainVerification: InferSelectResult; + }; + }, + Error, + { + id: string; + domainVerificationPatch: DomainVerificationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDomainVerification: { + domainVerification: InferSelectResult; + }; + }, + Error, + { + id: string; + domainVerificationPatch: DomainVerificationPatch; + } +>; +export function useUpdateDomainVerificationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + domainVerificationPatch: DomainVerificationPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainVerificationMutationKeys.all, mutationFn: ({ id, - domainVerificationPatch + domainVerificationPatch, }: { id: string; domainVerificationPatch: DomainVerificationPatch; - }) => getClient().domainVerification.update({ - where: { - id - }, - data: domainVerificationPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .domainVerification.update({ + where: { + id, + }, + data: domainVerificationPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: domainVerificationKeys.detail(variables.id) + queryKey: domainVerificationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: domainVerificationKeys.lists() + queryKey: domainVerificationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateEmbeddingChunkMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateEmbeddingChunkMutation.ts index 9ed14fa835..de871f0869 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateEmbeddingChunkMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateEmbeddingChunkMutation.ts @@ -4,83 +4,113 @@ * 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 { embeddingChunkKeys } from "../query-keys"; -import { embeddingChunkMutationKeys } from "../mutation-keys"; -import type { EmbeddingChunkSelect, EmbeddingChunkWithRelations, EmbeddingChunkPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmbeddingChunkSelect, EmbeddingChunkWithRelations, EmbeddingChunkPatch } from "../../orm/input-types"; +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 { embeddingChunkKeys } from '../query-keys'; +import { embeddingChunkMutationKeys } from '../mutation-keys'; +import type { + EmbeddingChunkSelect, + EmbeddingChunkWithRelations, + EmbeddingChunkPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EmbeddingChunkSelect, + EmbeddingChunkWithRelations, + EmbeddingChunkPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a EmbeddingChunk - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateEmbeddingChunkMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', embeddingChunkPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateEmbeddingChunkMutation(params: { - selection: ({ - fields: S & EmbeddingChunkSelect; - } & HookStrictSelect, EmbeddingChunkSelect>); -} & Omit; - }; -}, Error, { - id: string; - embeddingChunkPatch: EmbeddingChunkPatch; -}>, "mutationFn">): UseMutationResult<{ - updateEmbeddingChunk: { - embeddingChunk: InferSelectResult; - }; -}, Error, { - id: string; - embeddingChunkPatch: EmbeddingChunkPatch; -}>; -export function useUpdateEmbeddingChunkMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateEmbeddingChunkMutation( + params: { + selection: { + fields: S & EmbeddingChunkSelect; + } & HookStrictSelect, EmbeddingChunkSelect>; + } & Omit< + UseMutationOptions< + { + updateEmbeddingChunk: { + embeddingChunk: InferSelectResult; + }; + }, + Error, + { + id: string; + embeddingChunkPatch: EmbeddingChunkPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateEmbeddingChunk: { + embeddingChunk: InferSelectResult; + }; + }, + Error, + { + id: string; + embeddingChunkPatch: EmbeddingChunkPatch; + } +>; +export function useUpdateEmbeddingChunkMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + embeddingChunkPatch: EmbeddingChunkPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: embeddingChunkMutationKeys.all, mutationFn: ({ id, - embeddingChunkPatch + embeddingChunkPatch, }: { id: string; embeddingChunkPatch: EmbeddingChunkPatch; - }) => getClient().embeddingChunk.update({ - where: { - id - }, - data: embeddingChunkPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .embeddingChunk.update({ + where: { + id, + }, + data: embeddingChunkPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: embeddingChunkKeys.detail(variables.id) + queryKey: embeddingChunkKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: embeddingChunkKeys.lists() + queryKey: embeddingChunkKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateEnumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateEnumMutation.ts index 1296495006..2cb358b4f3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateEnumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateEnumMutation.ts @@ -4,83 +4,99 @@ * 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 { enumKeys } from "../query-keys"; -import { enumMutationKeys } from "../mutation-keys"; -import type { EnumSelect, EnumWithRelations, EnumPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EnumSelect, EnumWithRelations, EnumPatch } from "../../orm/input-types"; +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 { enumKeys } from '../query-keys'; +import { enumMutationKeys } from '../mutation-keys'; +import type { EnumSelect, EnumWithRelations, EnumPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EnumSelect, EnumWithRelations, EnumPatch } from '../../orm/input-types'; /** * Mutation hook for updating a Enum - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateEnumMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', enumPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateEnumMutation(params: { - selection: ({ - fields: S & EnumSelect; - } & HookStrictSelect, EnumSelect>); -} & Omit; - }; -}, Error, { - id: string; - enumPatch: EnumPatch; -}>, "mutationFn">): UseMutationResult<{ - updateEnum: { - enum: InferSelectResult; - }; -}, Error, { - id: string; - enumPatch: EnumPatch; -}>; -export function useUpdateEnumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateEnumMutation( + params: { + selection: { + fields: S & EnumSelect; + } & HookStrictSelect, EnumSelect>; + } & Omit< + UseMutationOptions< + { + updateEnum: { + enum: InferSelectResult; + }; + }, + Error, + { + id: string; + enumPatch: EnumPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateEnum: { + enum: InferSelectResult; + }; + }, + Error, + { + id: string; + enumPatch: EnumPatch; + } +>; +export function useUpdateEnumMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + enumPatch: EnumPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: enumMutationKeys.all, - mutationFn: ({ - id, - enumPatch - }: { - id: string; - enumPatch: EnumPatch; - }) => getClient().enum.update({ - where: { - id - }, - data: enumPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, enumPatch }: { id: string; enumPatch: EnumPatch }) => + getClient() + .enum.update({ + where: { + id, + }, + data: enumPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: enumKeys.detail(variables.id) + queryKey: enumKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: enumKeys.lists() + queryKey: enumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateExclusionConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateExclusionConstraintMutation.ts index 00388447c3..2ecdc3bd25 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateExclusionConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateExclusionConstraintMutation.ts @@ -4,83 +4,113 @@ * 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 { exclusionConstraintKeys } from "../query-keys"; -import { exclusionConstraintMutationKeys } from "../mutation-keys"; -import type { ExclusionConstraintSelect, ExclusionConstraintWithRelations, ExclusionConstraintPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ExclusionConstraintSelect, ExclusionConstraintWithRelations, ExclusionConstraintPatch } from "../../orm/input-types"; +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 { exclusionConstraintKeys } from '../query-keys'; +import { exclusionConstraintMutationKeys } from '../mutation-keys'; +import type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, + ExclusionConstraintPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, + ExclusionConstraintPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ExclusionConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateExclusionConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', exclusionConstraintPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateExclusionConstraintMutation(params: { - selection: ({ - fields: S & ExclusionConstraintSelect; - } & HookStrictSelect, ExclusionConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; - exclusionConstraintPatch: ExclusionConstraintPatch; -}>, "mutationFn">): UseMutationResult<{ - updateExclusionConstraint: { - exclusionConstraint: InferSelectResult; - }; -}, Error, { - id: string; - exclusionConstraintPatch: ExclusionConstraintPatch; -}>; -export function useUpdateExclusionConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateExclusionConstraintMutation( + params: { + selection: { + fields: S & ExclusionConstraintSelect; + } & HookStrictSelect, ExclusionConstraintSelect>; + } & Omit< + UseMutationOptions< + { + updateExclusionConstraint: { + exclusionConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + exclusionConstraintPatch: ExclusionConstraintPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateExclusionConstraint: { + exclusionConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + exclusionConstraintPatch: ExclusionConstraintPatch; + } +>; +export function useUpdateExclusionConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + exclusionConstraintPatch: ExclusionConstraintPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: exclusionConstraintMutationKeys.all, mutationFn: ({ id, - exclusionConstraintPatch + exclusionConstraintPatch, }: { id: string; exclusionConstraintPatch: ExclusionConstraintPatch; - }) => getClient().exclusionConstraint.update({ - where: { - id - }, - data: exclusionConstraintPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .exclusionConstraint.update({ + where: { + id, + }, + data: exclusionConstraintPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: exclusionConstraintKeys.detail(variables.id) + queryKey: exclusionConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: exclusionConstraintKeys.lists() + queryKey: exclusionConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateFieldMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateFieldMutation.ts index 8d95846ca0..33e20ed97b 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateFieldMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateFieldMutation.ts @@ -4,83 +4,99 @@ * 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 { fieldKeys } from "../query-keys"; -import { fieldMutationKeys } from "../mutation-keys"; -import type { FieldSelect, FieldWithRelations, FieldPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FieldSelect, FieldWithRelations, FieldPatch } from "../../orm/input-types"; +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 { fieldKeys } from '../query-keys'; +import { fieldMutationKeys } from '../mutation-keys'; +import type { FieldSelect, FieldWithRelations, FieldPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FieldSelect, FieldWithRelations, FieldPatch } from '../../orm/input-types'; /** * Mutation hook for updating a Field - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFieldMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', fieldPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFieldMutation(params: { - selection: ({ - fields: S & FieldSelect; - } & HookStrictSelect, FieldSelect>); -} & Omit; - }; -}, Error, { - id: string; - fieldPatch: FieldPatch; -}>, "mutationFn">): UseMutationResult<{ - updateField: { - field: InferSelectResult; - }; -}, Error, { - id: string; - fieldPatch: FieldPatch; -}>; -export function useUpdateFieldMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFieldMutation( + params: { + selection: { + fields: S & FieldSelect; + } & HookStrictSelect, FieldSelect>; + } & Omit< + UseMutationOptions< + { + updateField: { + field: InferSelectResult; + }; + }, + Error, + { + id: string; + fieldPatch: FieldPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateField: { + field: InferSelectResult; + }; + }, + Error, + { + id: string; + fieldPatch: FieldPatch; + } +>; +export function useUpdateFieldMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + fieldPatch: FieldPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: fieldMutationKeys.all, - mutationFn: ({ - id, - fieldPatch - }: { - id: string; - fieldPatch: FieldPatch; - }) => getClient().field.update({ - where: { - id - }, - data: fieldPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, fieldPatch }: { id: string; fieldPatch: FieldPatch }) => + getClient() + .field.update({ + where: { + id, + }, + data: fieldPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: fieldKeys.detail(variables.id) + queryKey: fieldKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: fieldKeys.lists() + queryKey: fieldKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateForeignKeyConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateForeignKeyConstraintMutation.ts index 71d66c764b..b918c3e4d8 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateForeignKeyConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateForeignKeyConstraintMutation.ts @@ -4,83 +4,113 @@ * 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 { foreignKeyConstraintKeys } from "../query-keys"; -import { foreignKeyConstraintMutationKeys } from "../mutation-keys"; -import type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations, ForeignKeyConstraintPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations, ForeignKeyConstraintPatch } from "../../orm/input-types"; +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 { foreignKeyConstraintKeys } from '../query-keys'; +import { foreignKeyConstraintMutationKeys } from '../mutation-keys'; +import type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, + ForeignKeyConstraintPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, + ForeignKeyConstraintPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ForeignKeyConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateForeignKeyConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', foreignKeyConstraintPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateForeignKeyConstraintMutation(params: { - selection: ({ - fields: S & ForeignKeyConstraintSelect; - } & HookStrictSelect, ForeignKeyConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; - foreignKeyConstraintPatch: ForeignKeyConstraintPatch; -}>, "mutationFn">): UseMutationResult<{ - updateForeignKeyConstraint: { - foreignKeyConstraint: InferSelectResult; - }; -}, Error, { - id: string; - foreignKeyConstraintPatch: ForeignKeyConstraintPatch; -}>; -export function useUpdateForeignKeyConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateForeignKeyConstraintMutation( + params: { + selection: { + fields: S & ForeignKeyConstraintSelect; + } & HookStrictSelect, ForeignKeyConstraintSelect>; + } & Omit< + UseMutationOptions< + { + updateForeignKeyConstraint: { + foreignKeyConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + foreignKeyConstraintPatch: ForeignKeyConstraintPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateForeignKeyConstraint: { + foreignKeyConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + foreignKeyConstraintPatch: ForeignKeyConstraintPatch; + } +>; +export function useUpdateForeignKeyConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + foreignKeyConstraintPatch: ForeignKeyConstraintPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: foreignKeyConstraintMutationKeys.all, mutationFn: ({ id, - foreignKeyConstraintPatch + foreignKeyConstraintPatch, }: { id: string; foreignKeyConstraintPatch: ForeignKeyConstraintPatch; - }) => getClient().foreignKeyConstraint.update({ - where: { - id - }, - data: foreignKeyConstraintPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .foreignKeyConstraint.update({ + where: { + id, + }, + data: foreignKeyConstraintPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: foreignKeyConstraintKeys.detail(variables.id) + queryKey: foreignKeyConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: foreignKeyConstraintKeys.lists() + queryKey: foreignKeyConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateFullTextSearchMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateFullTextSearchMutation.ts index 29ef806aa4..b0e14575ff 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateFullTextSearchMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateFullTextSearchMutation.ts @@ -4,83 +4,113 @@ * 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 { fullTextSearchKeys } from "../query-keys"; -import { fullTextSearchMutationKeys } from "../mutation-keys"; -import type { FullTextSearchSelect, FullTextSearchWithRelations, FullTextSearchPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FullTextSearchSelect, FullTextSearchWithRelations, FullTextSearchPatch } from "../../orm/input-types"; +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 { fullTextSearchKeys } from '../query-keys'; +import { fullTextSearchMutationKeys } from '../mutation-keys'; +import type { + FullTextSearchSelect, + FullTextSearchWithRelations, + FullTextSearchPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FullTextSearchSelect, + FullTextSearchWithRelations, + FullTextSearchPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a FullTextSearch - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFullTextSearchMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', fullTextSearchPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFullTextSearchMutation(params: { - selection: ({ - fields: S & FullTextSearchSelect; - } & HookStrictSelect, FullTextSearchSelect>); -} & Omit; - }; -}, Error, { - id: string; - fullTextSearchPatch: FullTextSearchPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFullTextSearch: { - fullTextSearch: InferSelectResult; - }; -}, Error, { - id: string; - fullTextSearchPatch: FullTextSearchPatch; -}>; -export function useUpdateFullTextSearchMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFullTextSearchMutation( + params: { + selection: { + fields: S & FullTextSearchSelect; + } & HookStrictSelect, FullTextSearchSelect>; + } & Omit< + UseMutationOptions< + { + updateFullTextSearch: { + fullTextSearch: InferSelectResult; + }; + }, + Error, + { + id: string; + fullTextSearchPatch: FullTextSearchPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFullTextSearch: { + fullTextSearch: InferSelectResult; + }; + }, + Error, + { + id: string; + fullTextSearchPatch: FullTextSearchPatch; + } +>; +export function useUpdateFullTextSearchMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + fullTextSearchPatch: FullTextSearchPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: fullTextSearchMutationKeys.all, mutationFn: ({ id, - fullTextSearchPatch + fullTextSearchPatch, }: { id: string; fullTextSearchPatch: FullTextSearchPatch; - }) => getClient().fullTextSearch.update({ - where: { - id - }, - data: fullTextSearchPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .fullTextSearch.update({ + where: { + id, + }, + data: fullTextSearchPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: fullTextSearchKeys.detail(variables.id) + queryKey: fullTextSearchKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: fullTextSearchKeys.lists() + queryKey: fullTextSearchKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateFunctionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateFunctionMutation.ts index 9383883f28..3abe2748da 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateFunctionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateFunctionMutation.ts @@ -4,83 +4,99 @@ * 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 { functionKeys } from "../query-keys"; -import { functionMutationKeys } from "../mutation-keys"; -import type { FunctionSelect, FunctionWithRelations, FunctionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionSelect, FunctionWithRelations, FunctionPatch } from "../../orm/input-types"; +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 { functionKeys } from '../query-keys'; +import { functionMutationKeys } from '../mutation-keys'; +import type { FunctionSelect, FunctionWithRelations, FunctionPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionSelect, FunctionWithRelations, FunctionPatch } from '../../orm/input-types'; /** * Mutation hook for updating a Function - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionMutation(params: { - selection: ({ - fields: S & FunctionSelect; - } & HookStrictSelect, FunctionSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionPatch: FunctionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunction: { - function: InferSelectResult; - }; -}, Error, { - id: string; - functionPatch: FunctionPatch; -}>; -export function useUpdateFunctionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionMutation( + params: { + selection: { + fields: S & FunctionSelect; + } & HookStrictSelect, FunctionSelect>; + } & Omit< + UseMutationOptions< + { + updateFunction: { + function: InferSelectResult; + }; + }, + Error, + { + id: string; + functionPatch: FunctionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunction: { + function: InferSelectResult; + }; + }, + Error, + { + id: string; + functionPatch: FunctionPatch; + } +>; +export function useUpdateFunctionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionPatch: FunctionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionMutationKeys.all, - mutationFn: ({ - id, - functionPatch - }: { - id: string; - functionPatch: FunctionPatch; - }) => getClient().function.update({ - where: { - id - }, - data: functionPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, functionPatch }: { id: string; functionPatch: FunctionPatch }) => + getClient() + .function.update({ + where: { + id, + }, + data: functionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionKeys.detail(variables.id) + queryKey: functionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionKeys.lists() + queryKey: functionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateHostnameBindingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateHostnameBindingMutation.ts index ac993624d4..a0eb04cd9f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateHostnameBindingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateHostnameBindingMutation.ts @@ -4,83 +4,113 @@ * 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 { hostnameBindingKeys } from "../query-keys"; -import { hostnameBindingMutationKeys } from "../mutation-keys"; -import type { HostnameBindingSelect, HostnameBindingWithRelations, HostnameBindingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HostnameBindingSelect, HostnameBindingWithRelations, HostnameBindingPatch } from "../../orm/input-types"; +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 { hostnameBindingKeys } from '../query-keys'; +import { hostnameBindingMutationKeys } from '../mutation-keys'; +import type { + HostnameBindingSelect, + HostnameBindingWithRelations, + HostnameBindingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + HostnameBindingSelect, + HostnameBindingWithRelations, + HostnameBindingPatch, +} from '../../orm/input-types'; /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateHostnameBindingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', hostnameBindingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateHostnameBindingMutation(params: { - selection: ({ - fields: S & HostnameBindingSelect; - } & HookStrictSelect, HostnameBindingSelect>); -} & Omit; - }; -}, Error, { - id: string; - hostnameBindingPatch: HostnameBindingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateHostnameBinding: { - hostnameBinding: InferSelectResult; - }; -}, Error, { - id: string; - hostnameBindingPatch: HostnameBindingPatch; -}>; -export function useUpdateHostnameBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateHostnameBindingMutation( + params: { + selection: { + fields: S & HostnameBindingSelect; + } & HookStrictSelect, HostnameBindingSelect>; + } & Omit< + UseMutationOptions< + { + updateHostnameBinding: { + hostnameBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + hostnameBindingPatch: HostnameBindingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateHostnameBinding: { + hostnameBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + hostnameBindingPatch: HostnameBindingPatch; + } +>; +export function useUpdateHostnameBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + hostnameBindingPatch: HostnameBindingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: hostnameBindingMutationKeys.all, mutationFn: ({ id, - hostnameBindingPatch + hostnameBindingPatch, }: { id: string; hostnameBindingPatch: HostnameBindingPatch; - }) => getClient().hostnameBinding.update({ - where: { - id - }, - data: hostnameBindingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .hostnameBinding.update({ + where: { + id, + }, + data: hostnameBindingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: hostnameBindingKeys.detail(variables.id) + queryKey: hostnameBindingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: hostnameBindingKeys.lists() + queryKey: hostnameBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateHttpRouteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateHttpRouteMutation.ts index 779e56cfee..be8e6ac971 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateHttpRouteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateHttpRouteMutation.ts @@ -4,83 +4,107 @@ * 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 { httpRouteKeys } from "../query-keys"; -import { httpRouteMutationKeys } from "../mutation-keys"; -import type { HttpRouteSelect, HttpRouteWithRelations, HttpRoutePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteSelect, HttpRouteWithRelations, HttpRoutePatch } from "../../orm/input-types"; +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 { httpRouteKeys } from '../query-keys'; +import { httpRouteMutationKeys } from '../mutation-keys'; +import type { + HttpRouteSelect, + HttpRouteWithRelations, + HttpRoutePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + HttpRouteSelect, + HttpRouteWithRelations, + HttpRoutePatch, +} from '../../orm/input-types'; /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateHttpRouteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', httpRoutePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateHttpRouteMutation(params: { - selection: ({ - fields: S & HttpRouteSelect; - } & HookStrictSelect, HttpRouteSelect>); -} & Omit; - }; -}, Error, { - id: string; - httpRoutePatch: HttpRoutePatch; -}>, "mutationFn">): UseMutationResult<{ - updateHttpRoute: { - httpRoute: InferSelectResult; - }; -}, Error, { - id: string; - httpRoutePatch: HttpRoutePatch; -}>; -export function useUpdateHttpRouteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateHttpRouteMutation( + params: { + selection: { + fields: S & HttpRouteSelect; + } & HookStrictSelect, HttpRouteSelect>; + } & Omit< + UseMutationOptions< + { + updateHttpRoute: { + httpRoute: InferSelectResult; + }; + }, + Error, + { + id: string; + httpRoutePatch: HttpRoutePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateHttpRoute: { + httpRoute: InferSelectResult; + }; + }, + Error, + { + id: string; + httpRoutePatch: HttpRoutePatch; + } +>; +export function useUpdateHttpRouteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + httpRoutePatch: HttpRoutePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: httpRouteMutationKeys.all, - mutationFn: ({ - id, - httpRoutePatch - }: { - id: string; - httpRoutePatch: HttpRoutePatch; - }) => getClient().httpRoute.update({ - where: { - id - }, - data: httpRoutePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, httpRoutePatch }: { id: string; httpRoutePatch: HttpRoutePatch }) => + getClient() + .httpRoute.update({ + where: { + id, + }, + data: httpRoutePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: httpRouteKeys.detail(variables.id) + queryKey: httpRouteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: httpRouteKeys.lists() + queryKey: httpRouteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateIndexMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateIndexMutation.ts index d51f0d4a96..75faed6de7 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateIndexMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateIndexMutation.ts @@ -4,83 +4,99 @@ * 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 { indexKeys } from "../query-keys"; -import { indexMutationKeys } from "../mutation-keys"; -import type { IndexSelect, IndexWithRelations, IndexPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IndexSelect, IndexWithRelations, IndexPatch } from "../../orm/input-types"; +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 { indexKeys } from '../query-keys'; +import { indexMutationKeys } from '../mutation-keys'; +import type { IndexSelect, IndexWithRelations, IndexPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { IndexSelect, IndexWithRelations, IndexPatch } from '../../orm/input-types'; /** * Mutation hook for updating a Index - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateIndexMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', indexPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateIndexMutation(params: { - selection: ({ - fields: S & IndexSelect; - } & HookStrictSelect, IndexSelect>); -} & Omit; - }; -}, Error, { - id: string; - indexPatch: IndexPatch; -}>, "mutationFn">): UseMutationResult<{ - updateIndex: { - index: InferSelectResult; - }; -}, Error, { - id: string; - indexPatch: IndexPatch; -}>; -export function useUpdateIndexMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateIndexMutation( + params: { + selection: { + fields: S & IndexSelect; + } & HookStrictSelect, IndexSelect>; + } & Omit< + UseMutationOptions< + { + updateIndex: { + index: InferSelectResult; + }; + }, + Error, + { + id: string; + indexPatch: IndexPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateIndex: { + index: InferSelectResult; + }; + }, + Error, + { + id: string; + indexPatch: IndexPatch; + } +>; +export function useUpdateIndexMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + indexPatch: IndexPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: indexMutationKeys.all, - mutationFn: ({ - id, - indexPatch - }: { - id: string; - indexPatch: IndexPatch; - }) => getClient().index.update({ - where: { - id - }, - data: indexPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, indexPatch }: { id: string; indexPatch: IndexPatch }) => + getClient() + .index.update({ + where: { + id, + }, + data: indexPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: indexKeys.detail(variables.id) + queryKey: indexKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: indexKeys.lists() + queryKey: indexKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateManagedDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateManagedDomainMutation.ts index 7bd51abebd..20c51177fa 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateManagedDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateManagedDomainMutation.ts @@ -4,83 +4,113 @@ * 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 { managedDomainKeys } from "../query-keys"; -import { managedDomainMutationKeys } from "../mutation-keys"; -import type { ManagedDomainSelect, ManagedDomainWithRelations, ManagedDomainPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ManagedDomainSelect, ManagedDomainWithRelations, ManagedDomainPatch } from "../../orm/input-types"; +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 { managedDomainKeys } from '../query-keys'; +import { managedDomainMutationKeys } from '../mutation-keys'; +import type { + ManagedDomainSelect, + ManagedDomainWithRelations, + ManagedDomainPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ManagedDomainSelect, + ManagedDomainWithRelations, + ManagedDomainPatch, +} from '../../orm/input-types'; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateManagedDomainMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', managedDomainPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateManagedDomainMutation(params: { - selection: ({ - fields: S & ManagedDomainSelect; - } & HookStrictSelect, ManagedDomainSelect>); -} & Omit; - }; -}, Error, { - id: string; - managedDomainPatch: ManagedDomainPatch; -}>, "mutationFn">): UseMutationResult<{ - updateManagedDomain: { - managedDomain: InferSelectResult; - }; -}, Error, { - id: string; - managedDomainPatch: ManagedDomainPatch; -}>; -export function useUpdateManagedDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateManagedDomainMutation( + params: { + selection: { + fields: S & ManagedDomainSelect; + } & HookStrictSelect, ManagedDomainSelect>; + } & Omit< + UseMutationOptions< + { + updateManagedDomain: { + managedDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + managedDomainPatch: ManagedDomainPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateManagedDomain: { + managedDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + managedDomainPatch: ManagedDomainPatch; + } +>; +export function useUpdateManagedDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + managedDomainPatch: ManagedDomainPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: managedDomainMutationKeys.all, mutationFn: ({ id, - managedDomainPatch + managedDomainPatch, }: { id: string; managedDomainPatch: ManagedDomainPatch; - }) => getClient().managedDomain.update({ - where: { - id - }, - data: managedDomainPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .managedDomain.update({ + where: { + id, + }, + data: managedDomainPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: managedDomainKeys.detail(variables.id) + queryKey: managedDomainKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: managedDomainKeys.lists() + queryKey: managedDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateNodeTypeRegistryMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateNodeTypeRegistryMutation.ts index 010bd85a7a..86d619ebbc 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateNodeTypeRegistryMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateNodeTypeRegistryMutation.ts @@ -4,83 +4,113 @@ * 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 { nodeTypeRegistryKeys } from "../query-keys"; -import { nodeTypeRegistryMutationKeys } from "../mutation-keys"; -import type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations, NodeTypeRegistryPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations, NodeTypeRegistryPatch } from "../../orm/input-types"; +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 { nodeTypeRegistryKeys } from '../query-keys'; +import { nodeTypeRegistryMutationKeys } from '../mutation-keys'; +import type { + NodeTypeRegistrySelect, + NodeTypeRegistryWithRelations, + NodeTypeRegistryPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NodeTypeRegistrySelect, + NodeTypeRegistryWithRelations, + NodeTypeRegistryPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a NodeTypeRegistry - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateNodeTypeRegistryMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'value-here', nodeTypeRegistryPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateNodeTypeRegistryMutation(params: { - selection: ({ - fields: S & NodeTypeRegistrySelect; - } & HookStrictSelect, NodeTypeRegistrySelect>); -} & Omit; - }; -}, Error, { - name: string; - nodeTypeRegistryPatch: NodeTypeRegistryPatch; -}>, "mutationFn">): UseMutationResult<{ - updateNodeTypeRegistry: { - nodeTypeRegistry: InferSelectResult; - }; -}, Error, { - name: string; - nodeTypeRegistryPatch: NodeTypeRegistryPatch; -}>; -export function useUpdateNodeTypeRegistryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateNodeTypeRegistryMutation( + params: { + selection: { + fields: S & NodeTypeRegistrySelect; + } & HookStrictSelect, NodeTypeRegistrySelect>; + } & Omit< + UseMutationOptions< + { + updateNodeTypeRegistry: { + nodeTypeRegistry: InferSelectResult; + }; + }, + Error, + { + name: string; + nodeTypeRegistryPatch: NodeTypeRegistryPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateNodeTypeRegistry: { + nodeTypeRegistry: InferSelectResult; + }; + }, + Error, + { + name: string; + nodeTypeRegistryPatch: NodeTypeRegistryPatch; + } +>; +export function useUpdateNodeTypeRegistryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + name: string; + nodeTypeRegistryPatch: NodeTypeRegistryPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: nodeTypeRegistryMutationKeys.all, mutationFn: ({ name, - nodeTypeRegistryPatch + nodeTypeRegistryPatch, }: { name: string; nodeTypeRegistryPatch: NodeTypeRegistryPatch; - }) => getClient().nodeTypeRegistry.update({ - where: { - name - }, - data: nodeTypeRegistryPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .nodeTypeRegistry.update({ + where: { + name, + }, + data: nodeTypeRegistryPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: nodeTypeRegistryKeys.detail(variables.name) + queryKey: nodeTypeRegistryKeys.detail(variables.name), }); queryClient.invalidateQueries({ - queryKey: nodeTypeRegistryKeys.lists() + queryKey: nodeTypeRegistryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePartitionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePartitionMutation.ts index d4fdbf45f3..ca02056eb9 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePartitionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePartitionMutation.ts @@ -4,83 +4,107 @@ * 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 { partitionKeys } from "../query-keys"; -import { partitionMutationKeys } from "../mutation-keys"; -import type { PartitionSelect, PartitionWithRelations, PartitionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PartitionSelect, PartitionWithRelations, PartitionPatch } from "../../orm/input-types"; +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 { partitionKeys } from '../query-keys'; +import { partitionMutationKeys } from '../mutation-keys'; +import type { + PartitionSelect, + PartitionWithRelations, + PartitionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PartitionSelect, + PartitionWithRelations, + PartitionPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a Partition - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePartitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', partitionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePartitionMutation(params: { - selection: ({ - fields: S & PartitionSelect; - } & HookStrictSelect, PartitionSelect>); -} & Omit; - }; -}, Error, { - id: string; - partitionPatch: PartitionPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePartition: { - partition: InferSelectResult; - }; -}, Error, { - id: string; - partitionPatch: PartitionPatch; -}>; -export function useUpdatePartitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePartitionMutation( + params: { + selection: { + fields: S & PartitionSelect; + } & HookStrictSelect, PartitionSelect>; + } & Omit< + UseMutationOptions< + { + updatePartition: { + partition: InferSelectResult; + }; + }, + Error, + { + id: string; + partitionPatch: PartitionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePartition: { + partition: InferSelectResult; + }; + }, + Error, + { + id: string; + partitionPatch: PartitionPatch; + } +>; +export function useUpdatePartitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + partitionPatch: PartitionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: partitionMutationKeys.all, - mutationFn: ({ - id, - partitionPatch - }: { - id: string; - partitionPatch: PartitionPatch; - }) => getClient().partition.update({ - where: { - id - }, - data: partitionPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, partitionPatch }: { id: string; partitionPatch: PartitionPatch }) => + getClient() + .partition.update({ + where: { + id, + }, + data: partitionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: partitionKeys.detail(variables.id) + queryKey: partitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: partitionKeys.lists() + queryKey: partitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiModuleMutation.ts index 4dd1c20b09..cd85ae813c 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { platformApiModuleKeys } from "../query-keys"; -import { platformApiModuleMutationKeys } from "../mutation-keys"; -import type { PlatformApiModuleSelect, PlatformApiModuleWithRelations, PlatformApiModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiModuleSelect, PlatformApiModuleWithRelations, PlatformApiModulePatch } from "../../orm/input-types"; +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 { platformApiModuleKeys } from '../query-keys'; +import { platformApiModuleMutationKeys } from '../mutation-keys'; +import type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, + PlatformApiModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, + PlatformApiModulePatch, +} from '../../orm/input-types'; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformApiModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformApiModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformApiModuleMutation(params: { - selection: ({ - fields: S & PlatformApiModuleSelect; - } & HookStrictSelect, PlatformApiModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformApiModulePatch: PlatformApiModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformApiModule: { - platformApiModule: InferSelectResult; - }; -}, Error, { - id: string; - platformApiModulePatch: PlatformApiModulePatch; -}>; -export function useUpdatePlatformApiModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformApiModuleMutation( + params: { + selection: { + fields: S & PlatformApiModuleSelect; + } & HookStrictSelect, PlatformApiModuleSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformApiModule: { + platformApiModule: InferSelectResult; + }; + }, + Error, + { + id: string; + platformApiModulePatch: PlatformApiModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformApiModule: { + platformApiModule: InferSelectResult; + }; + }, + Error, + { + id: string; + platformApiModulePatch: PlatformApiModulePatch; + } +>; +export function useUpdatePlatformApiModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformApiModulePatch: PlatformApiModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiModuleMutationKeys.all, mutationFn: ({ id, - platformApiModulePatch + platformApiModulePatch, }: { id: string; platformApiModulePatch: PlatformApiModulePatch; - }) => getClient().platformApiModule.update({ - where: { - id - }, - data: platformApiModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformApiModule.update({ + where: { + id, + }, + data: platformApiModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformApiModuleKeys.detail(variables.id) + queryKey: platformApiModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformApiModuleKeys.lists() + queryKey: platformApiModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiMutation.ts index 1b1ada0139..7cf22a2193 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiMutation.ts @@ -4,83 +4,107 @@ * 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 { platformApiKeys } from "../query-keys"; -import { platformApiMutationKeys } from "../mutation-keys"; -import type { PlatformApiSelect, PlatformApiWithRelations, PlatformApiPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSelect, PlatformApiWithRelations, PlatformApiPatch } from "../../orm/input-types"; +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 { platformApiKeys } from '../query-keys'; +import { platformApiMutationKeys } from '../mutation-keys'; +import type { + PlatformApiSelect, + PlatformApiWithRelations, + PlatformApiPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSelect, + PlatformApiWithRelations, + PlatformApiPatch, +} from '../../orm/input-types'; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformApiMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformApiPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformApiMutation(params: { - selection: ({ - fields: S & PlatformApiSelect; - } & HookStrictSelect, PlatformApiSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformApiPatch: PlatformApiPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformApi: { - platformApi: InferSelectResult; - }; -}, Error, { - id: string; - platformApiPatch: PlatformApiPatch; -}>; -export function useUpdatePlatformApiMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformApiMutation( + params: { + selection: { + fields: S & PlatformApiSelect; + } & HookStrictSelect, PlatformApiSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformApi: { + platformApi: InferSelectResult; + }; + }, + Error, + { + id: string; + platformApiPatch: PlatformApiPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformApi: { + platformApi: InferSelectResult; + }; + }, + Error, + { + id: string; + platformApiPatch: PlatformApiPatch; + } +>; +export function useUpdatePlatformApiMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformApiPatch: PlatformApiPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiMutationKeys.all, - mutationFn: ({ - id, - platformApiPatch - }: { - id: string; - platformApiPatch: PlatformApiPatch; - }) => getClient().platformApi.update({ - where: { - id - }, - data: platformApiPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, platformApiPatch }: { id: string; platformApiPatch: PlatformApiPatch }) => + getClient() + .platformApi.update({ + where: { + id, + }, + data: platformApiPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformApiKeys.detail(variables.id) + queryKey: platformApiKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformApiKeys.lists() + queryKey: platformApiKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiSchemaMutation.ts index 4dbcbd9bd7..d52dadf841 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiSchemaMutation.ts @@ -4,83 +4,113 @@ * 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 { platformApiSchemaKeys } from "../query-keys"; -import { platformApiSchemaMutationKeys } from "../mutation-keys"; -import type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations, PlatformApiSchemaPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations, PlatformApiSchemaPatch } from "../../orm/input-types"; +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 { platformApiSchemaKeys } from '../query-keys'; +import { platformApiSchemaMutationKeys } from '../mutation-keys'; +import type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, + PlatformApiSchemaPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, + PlatformApiSchemaPatch, +} from '../../orm/input-types'; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformApiSchemaMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformApiSchemaPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformApiSchemaMutation(params: { - selection: ({ - fields: S & PlatformApiSchemaSelect; - } & HookStrictSelect, PlatformApiSchemaSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformApiSchemaPatch: PlatformApiSchemaPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformApiSchema: { - platformApiSchema: InferSelectResult; - }; -}, Error, { - id: string; - platformApiSchemaPatch: PlatformApiSchemaPatch; -}>; -export function useUpdatePlatformApiSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformApiSchemaMutation( + params: { + selection: { + fields: S & PlatformApiSchemaSelect; + } & HookStrictSelect, PlatformApiSchemaSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformApiSchema: { + platformApiSchema: InferSelectResult; + }; + }, + Error, + { + id: string; + platformApiSchemaPatch: PlatformApiSchemaPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformApiSchema: { + platformApiSchema: InferSelectResult; + }; + }, + Error, + { + id: string; + platformApiSchemaPatch: PlatformApiSchemaPatch; + } +>; +export function useUpdatePlatformApiSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformApiSchemaPatch: PlatformApiSchemaPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiSchemaMutationKeys.all, mutationFn: ({ id, - platformApiSchemaPatch + platformApiSchemaPatch, }: { id: string; platformApiSchemaPatch: PlatformApiSchemaPatch; - }) => getClient().platformApiSchema.update({ - where: { - id - }, - data: platformApiSchemaPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformApiSchema.update({ + where: { + id, + }, + data: platformApiSchemaPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformApiSchemaKeys.detail(variables.id) + queryKey: platformApiSchemaKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformApiSchemaKeys.lists() + queryKey: platformApiSchemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiSettingMutation.ts index 178c6cfd36..d20514435c 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformApiSettingMutation.ts @@ -4,83 +4,113 @@ * 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 { platformApiSettingKeys } from "../query-keys"; -import { platformApiSettingMutationKeys } from "../mutation-keys"; -import type { PlatformApiSettingSelect, PlatformApiSettingWithRelations, PlatformApiSettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSettingSelect, PlatformApiSettingWithRelations, PlatformApiSettingPatch } from "../../orm/input-types"; +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 { platformApiSettingKeys } from '../query-keys'; +import { platformApiSettingMutationKeys } from '../mutation-keys'; +import type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, + PlatformApiSettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, + PlatformApiSettingPatch, +} from '../../orm/input-types'; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformApiSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformApiSettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformApiSettingMutation(params: { - selection: ({ - fields: S & PlatformApiSettingSelect; - } & HookStrictSelect, PlatformApiSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformApiSettingPatch: PlatformApiSettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformApiSetting: { - platformApiSetting: InferSelectResult; - }; -}, Error, { - id: string; - platformApiSettingPatch: PlatformApiSettingPatch; -}>; -export function useUpdatePlatformApiSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformApiSettingMutation( + params: { + selection: { + fields: S & PlatformApiSettingSelect; + } & HookStrictSelect, PlatformApiSettingSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformApiSetting: { + platformApiSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + platformApiSettingPatch: PlatformApiSettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformApiSetting: { + platformApiSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + platformApiSettingPatch: PlatformApiSettingPatch; + } +>; +export function useUpdatePlatformApiSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformApiSettingPatch: PlatformApiSettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformApiSettingMutationKeys.all, mutationFn: ({ id, - platformApiSettingPatch + platformApiSettingPatch, }: { id: string; platformApiSettingPatch: PlatformApiSettingPatch; - }) => getClient().platformApiSetting.update({ - where: { - id - }, - data: platformApiSettingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformApiSetting.update({ + where: { + id, + }, + data: platformApiSettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformApiSettingKeys.detail(variables.id) + queryKey: platformApiSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformApiSettingKeys.lists() + queryKey: platformApiSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformCorsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformCorsSettingMutation.ts index f903057d61..2a3063bd1b 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformCorsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformCorsSettingMutation.ts @@ -4,83 +4,113 @@ * 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 { platformCorsSettingKeys } from "../query-keys"; -import { platformCorsSettingMutationKeys } from "../mutation-keys"; -import type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations, PlatformCorsSettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations, PlatformCorsSettingPatch } from "../../orm/input-types"; +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 { platformCorsSettingKeys } from '../query-keys'; +import { platformCorsSettingMutationKeys } from '../mutation-keys'; +import type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, + PlatformCorsSettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, + PlatformCorsSettingPatch, +} from '../../orm/input-types'; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformCorsSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformCorsSettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformCorsSettingMutation(params: { - selection: ({ - fields: S & PlatformCorsSettingSelect; - } & HookStrictSelect, PlatformCorsSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformCorsSettingPatch: PlatformCorsSettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformCorsSetting: { - platformCorsSetting: InferSelectResult; - }; -}, Error, { - id: string; - platformCorsSettingPatch: PlatformCorsSettingPatch; -}>; -export function useUpdatePlatformCorsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformCorsSettingMutation( + params: { + selection: { + fields: S & PlatformCorsSettingSelect; + } & HookStrictSelect, PlatformCorsSettingSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformCorsSetting: { + platformCorsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + platformCorsSettingPatch: PlatformCorsSettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformCorsSetting: { + platformCorsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + platformCorsSettingPatch: PlatformCorsSettingPatch; + } +>; +export function useUpdatePlatformCorsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformCorsSettingPatch: PlatformCorsSettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformCorsSettingMutationKeys.all, mutationFn: ({ id, - platformCorsSettingPatch + platformCorsSettingPatch, }: { id: string; platformCorsSettingPatch: PlatformCorsSettingPatch; - }) => getClient().platformCorsSetting.update({ - where: { - id - }, - data: platformCorsSettingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformCorsSetting.update({ + where: { + id, + }, + data: platformCorsSettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformCorsSettingKeys.detail(variables.id) + queryKey: platformCorsSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformCorsSettingKeys.lists() + queryKey: platformCorsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainEventMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainEventMutation.ts index ffeb7dd012..9f252861f4 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainEventMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainEventMutation.ts @@ -4,83 +4,113 @@ * 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 { platformDomainEventKeys } from "../query-keys"; -import { platformDomainEventMutationKeys } from "../mutation-keys"; -import type { PlatformDomainEventSelect, PlatformDomainEventWithRelations, PlatformDomainEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainEventSelect, PlatformDomainEventWithRelations, PlatformDomainEventPatch } from "../../orm/input-types"; +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 { platformDomainEventKeys } from '../query-keys'; +import { platformDomainEventMutationKeys } from '../mutation-keys'; +import type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, + PlatformDomainEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, + PlatformDomainEventPatch, +} from '../../orm/input-types'; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformDomainEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformDomainEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformDomainEventMutation(params: { - selection: ({ - fields: S & PlatformDomainEventSelect; - } & HookStrictSelect, PlatformDomainEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformDomainEventPatch: PlatformDomainEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformDomainEvent: { - platformDomainEvent: InferSelectResult; - }; -}, Error, { - id: string; - platformDomainEventPatch: PlatformDomainEventPatch; -}>; -export function useUpdatePlatformDomainEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformDomainEventMutation( + params: { + selection: { + fields: S & PlatformDomainEventSelect; + } & HookStrictSelect, PlatformDomainEventSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformDomainEvent: { + platformDomainEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + platformDomainEventPatch: PlatformDomainEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformDomainEvent: { + platformDomainEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + platformDomainEventPatch: PlatformDomainEventPatch; + } +>; +export function useUpdatePlatformDomainEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformDomainEventPatch: PlatformDomainEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainEventMutationKeys.all, mutationFn: ({ id, - platformDomainEventPatch + platformDomainEventPatch, }: { id: string; platformDomainEventPatch: PlatformDomainEventPatch; - }) => getClient().platformDomainEvent.update({ - where: { - id - }, - data: platformDomainEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformDomainEvent.update({ + where: { + id, + }, + data: platformDomainEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformDomainEventKeys.detail(variables.id) + queryKey: platformDomainEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformDomainEventKeys.lists() + queryKey: platformDomainEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainMutation.ts index 51742a781b..2d96d9e9b5 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainMutation.ts @@ -4,83 +4,113 @@ * 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 { platformDomainKeys } from "../query-keys"; -import { platformDomainMutationKeys } from "../mutation-keys"; -import type { PlatformDomainSelect, PlatformDomainWithRelations, PlatformDomainPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainSelect, PlatformDomainWithRelations, PlatformDomainPatch } from "../../orm/input-types"; +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 { platformDomainKeys } from '../query-keys'; +import { platformDomainMutationKeys } from '../mutation-keys'; +import type { + PlatformDomainSelect, + PlatformDomainWithRelations, + PlatformDomainPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainSelect, + PlatformDomainWithRelations, + PlatformDomainPatch, +} from '../../orm/input-types'; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformDomainMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformDomainPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformDomainMutation(params: { - selection: ({ - fields: S & PlatformDomainSelect; - } & HookStrictSelect, PlatformDomainSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformDomainPatch: PlatformDomainPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformDomain: { - platformDomain: InferSelectResult; - }; -}, Error, { - id: string; - platformDomainPatch: PlatformDomainPatch; -}>; -export function useUpdatePlatformDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformDomainMutation( + params: { + selection: { + fields: S & PlatformDomainSelect; + } & HookStrictSelect, PlatformDomainSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformDomain: { + platformDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + platformDomainPatch: PlatformDomainPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformDomain: { + platformDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + platformDomainPatch: PlatformDomainPatch; + } +>; +export function useUpdatePlatformDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformDomainPatch: PlatformDomainPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainMutationKeys.all, mutationFn: ({ id, - platformDomainPatch + platformDomainPatch, }: { id: string; platformDomainPatch: PlatformDomainPatch; - }) => getClient().platformDomain.update({ - where: { - id - }, - data: platformDomainPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformDomain.update({ + where: { + id, + }, + data: platformDomainPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformDomainKeys.detail(variables.id) + queryKey: platformDomainKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformDomainKeys.lists() + queryKey: platformDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainVerificationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainVerificationMutation.ts index 784fad12b0..3c1fca2314 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainVerificationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformDomainVerificationMutation.ts @@ -4,83 +4,115 @@ * 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 { platformDomainVerificationKeys } from "../query-keys"; -import { platformDomainVerificationMutationKeys } from "../mutation-keys"; -import type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations, PlatformDomainVerificationPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations, PlatformDomainVerificationPatch } from "../../orm/input-types"; +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 { platformDomainVerificationKeys } from '../query-keys'; +import { platformDomainVerificationMutationKeys } from '../mutation-keys'; +import type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, + PlatformDomainVerificationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, + PlatformDomainVerificationPatch, +} from '../../orm/input-types'; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformDomainVerificationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformDomainVerificationPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformDomainVerificationMutation(params: { - selection: ({ - fields: S & PlatformDomainVerificationSelect; - } & HookStrictSelect, PlatformDomainVerificationSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformDomainVerificationPatch: PlatformDomainVerificationPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformDomainVerification: { - platformDomainVerification: InferSelectResult; - }; -}, Error, { - id: string; - platformDomainVerificationPatch: PlatformDomainVerificationPatch; -}>; -export function useUpdatePlatformDomainVerificationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformDomainVerificationMutation< + S extends PlatformDomainVerificationSelect, +>( + params: { + selection: { + fields: S & PlatformDomainVerificationSelect; + } & HookStrictSelect, PlatformDomainVerificationSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformDomainVerification: { + platformDomainVerification: InferSelectResult; + }; + }, + Error, + { + id: string; + platformDomainVerificationPatch: PlatformDomainVerificationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformDomainVerification: { + platformDomainVerification: InferSelectResult; + }; + }, + Error, + { + id: string; + platformDomainVerificationPatch: PlatformDomainVerificationPatch; + } +>; +export function useUpdatePlatformDomainVerificationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformDomainVerificationPatch: PlatformDomainVerificationPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformDomainVerificationMutationKeys.all, mutationFn: ({ id, - platformDomainVerificationPatch + platformDomainVerificationPatch, }: { id: string; platformDomainVerificationPatch: PlatformDomainVerificationPatch; - }) => getClient().platformDomainVerification.update({ - where: { - id - }, - data: platformDomainVerificationPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformDomainVerification.update({ + where: { + id, + }, + data: platformDomainVerificationPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformDomainVerificationKeys.detail(variables.id) + queryKey: platformDomainVerificationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformDomainVerificationKeys.lists() + queryKey: platformDomainVerificationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformManagedDomainMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformManagedDomainMutation.ts index 1d30871f43..013147ae06 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformManagedDomainMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformManagedDomainMutation.ts @@ -4,83 +4,113 @@ * 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 { platformManagedDomainKeys } from "../query-keys"; -import { platformManagedDomainMutationKeys } from "../mutation-keys"; -import type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations, PlatformManagedDomainPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations, PlatformManagedDomainPatch } from "../../orm/input-types"; +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 { platformManagedDomainKeys } from '../query-keys'; +import { platformManagedDomainMutationKeys } from '../mutation-keys'; +import type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, + PlatformManagedDomainPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, + PlatformManagedDomainPatch, +} from '../../orm/input-types'; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformManagedDomainMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformManagedDomainPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformManagedDomainMutation(params: { - selection: ({ - fields: S & PlatformManagedDomainSelect; - } & HookStrictSelect, PlatformManagedDomainSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformManagedDomainPatch: PlatformManagedDomainPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformManagedDomain: { - platformManagedDomain: InferSelectResult; - }; -}, Error, { - id: string; - platformManagedDomainPatch: PlatformManagedDomainPatch; -}>; -export function useUpdatePlatformManagedDomainMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformManagedDomainMutation( + params: { + selection: { + fields: S & PlatformManagedDomainSelect; + } & HookStrictSelect, PlatformManagedDomainSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformManagedDomain: { + platformManagedDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + platformManagedDomainPatch: PlatformManagedDomainPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformManagedDomain: { + platformManagedDomain: InferSelectResult; + }; + }, + Error, + { + id: string; + platformManagedDomainPatch: PlatformManagedDomainPatch; + } +>; +export function useUpdatePlatformManagedDomainMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformManagedDomainPatch: PlatformManagedDomainPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformManagedDomainMutationKeys.all, mutationFn: ({ id, - platformManagedDomainPatch + platformManagedDomainPatch, }: { id: string; platformManagedDomainPatch: PlatformManagedDomainPatch; - }) => getClient().platformManagedDomain.update({ - where: { - id - }, - data: platformManagedDomainPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformManagedDomain.update({ + where: { + id, + }, + data: platformManagedDomainPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformManagedDomainKeys.detail(variables.id) + queryKey: platformManagedDomainKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformManagedDomainKeys.lists() + queryKey: platformManagedDomainKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteMetadatumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteMetadatumMutation.ts index 12e53f6e6f..f360df54cf 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteMetadatumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteMetadatumMutation.ts @@ -4,83 +4,113 @@ * 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 { platformSiteMetadatumKeys } from "../query-keys"; -import { platformSiteMetadatumMutationKeys } from "../mutation-keys"; -import type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations, PlatformSiteMetadatumPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations, PlatformSiteMetadatumPatch } from "../../orm/input-types"; +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 { platformSiteMetadatumKeys } from '../query-keys'; +import { platformSiteMetadatumMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, + PlatformSiteMetadatumPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, + PlatformSiteMetadatumPatch, +} from '../../orm/input-types'; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformSiteMetadatumMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformSiteMetadatumPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformSiteMetadatumMutation(params: { - selection: ({ - fields: S & PlatformSiteMetadatumSelect; - } & HookStrictSelect, PlatformSiteMetadatumSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformSiteMetadatumPatch: PlatformSiteMetadatumPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformSiteMetadatum: { - platformSiteMetadatum: InferSelectResult; - }; -}, Error, { - id: string; - platformSiteMetadatumPatch: PlatformSiteMetadatumPatch; -}>; -export function useUpdatePlatformSiteMetadatumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformSiteMetadatumMutation( + params: { + selection: { + fields: S & PlatformSiteMetadatumSelect; + } & HookStrictSelect, PlatformSiteMetadatumSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformSiteMetadatum: { + platformSiteMetadatum: InferSelectResult; + }; + }, + Error, + { + id: string; + platformSiteMetadatumPatch: PlatformSiteMetadatumPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformSiteMetadatum: { + platformSiteMetadatum: InferSelectResult; + }; + }, + Error, + { + id: string; + platformSiteMetadatumPatch: PlatformSiteMetadatumPatch; + } +>; +export function useUpdatePlatformSiteMetadatumMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformSiteMetadatumPatch: PlatformSiteMetadatumPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteMetadatumMutationKeys.all, mutationFn: ({ id, - platformSiteMetadatumPatch + platformSiteMetadatumPatch, }: { id: string; platformSiteMetadatumPatch: PlatformSiteMetadatumPatch; - }) => getClient().platformSiteMetadatum.update({ - where: { - id - }, - data: platformSiteMetadatumPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformSiteMetadatum.update({ + where: { + id, + }, + data: platformSiteMetadatumPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformSiteMetadatumKeys.detail(variables.id) + queryKey: platformSiteMetadatumKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformSiteMetadatumKeys.lists() + queryKey: platformSiteMetadatumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteModuleMutation.ts index d0ded28e32..3208914447 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { platformSiteModuleKeys } from "../query-keys"; -import { platformSiteModuleMutationKeys } from "../mutation-keys"; -import type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations, PlatformSiteModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations, PlatformSiteModulePatch } from "../../orm/input-types"; +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 { platformSiteModuleKeys } from '../query-keys'; +import { platformSiteModuleMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, + PlatformSiteModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, + PlatformSiteModulePatch, +} from '../../orm/input-types'; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformSiteModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformSiteModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformSiteModuleMutation(params: { - selection: ({ - fields: S & PlatformSiteModuleSelect; - } & HookStrictSelect, PlatformSiteModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformSiteModulePatch: PlatformSiteModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformSiteModule: { - platformSiteModule: InferSelectResult; - }; -}, Error, { - id: string; - platformSiteModulePatch: PlatformSiteModulePatch; -}>; -export function useUpdatePlatformSiteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformSiteModuleMutation( + params: { + selection: { + fields: S & PlatformSiteModuleSelect; + } & HookStrictSelect, PlatformSiteModuleSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformSiteModule: { + platformSiteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + platformSiteModulePatch: PlatformSiteModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformSiteModule: { + platformSiteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + platformSiteModulePatch: PlatformSiteModulePatch; + } +>; +export function useUpdatePlatformSiteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformSiteModulePatch: PlatformSiteModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteModuleMutationKeys.all, mutationFn: ({ id, - platformSiteModulePatch + platformSiteModulePatch, }: { id: string; platformSiteModulePatch: PlatformSiteModulePatch; - }) => getClient().platformSiteModule.update({ - where: { - id - }, - data: platformSiteModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformSiteModule.update({ + where: { + id, + }, + data: platformSiteModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformSiteModuleKeys.detail(variables.id) + queryKey: platformSiteModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformSiteModuleKeys.lists() + queryKey: platformSiteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteMutation.ts index 4834fd31e9..379ac52a81 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteMutation.ts @@ -4,83 +4,107 @@ * 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 { platformSiteKeys } from "../query-keys"; -import { platformSiteMutationKeys } from "../mutation-keys"; -import type { PlatformSiteSelect, PlatformSiteWithRelations, PlatformSitePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteSelect, PlatformSiteWithRelations, PlatformSitePatch } from "../../orm/input-types"; +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 { platformSiteKeys } from '../query-keys'; +import { platformSiteMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteSelect, + PlatformSiteWithRelations, + PlatformSitePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteSelect, + PlatformSiteWithRelations, + PlatformSitePatch, +} from '../../orm/input-types'; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformSiteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformSitePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformSiteMutation(params: { - selection: ({ - fields: S & PlatformSiteSelect; - } & HookStrictSelect, PlatformSiteSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformSitePatch: PlatformSitePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformSite: { - platformSite: InferSelectResult; - }; -}, Error, { - id: string; - platformSitePatch: PlatformSitePatch; -}>; -export function useUpdatePlatformSiteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformSiteMutation( + params: { + selection: { + fields: S & PlatformSiteSelect; + } & HookStrictSelect, PlatformSiteSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformSite: { + platformSite: InferSelectResult; + }; + }, + Error, + { + id: string; + platformSitePatch: PlatformSitePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformSite: { + platformSite: InferSelectResult; + }; + }, + Error, + { + id: string; + platformSitePatch: PlatformSitePatch; + } +>; +export function useUpdatePlatformSiteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformSitePatch: PlatformSitePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteMutationKeys.all, - mutationFn: ({ - id, - platformSitePatch - }: { - id: string; - platformSitePatch: PlatformSitePatch; - }) => getClient().platformSite.update({ - where: { - id - }, - data: platformSitePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, platformSitePatch }: { id: string; platformSitePatch: PlatformSitePatch }) => + getClient() + .platformSite.update({ + where: { + id, + }, + data: platformSitePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformSiteKeys.detail(variables.id) + queryKey: platformSiteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformSiteKeys.lists() + queryKey: platformSiteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteThemeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteThemeMutation.ts index e9e19f6e2c..0eb575f926 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteThemeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePlatformSiteThemeMutation.ts @@ -4,83 +4,113 @@ * 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 { platformSiteThemeKeys } from "../query-keys"; -import { platformSiteThemeMutationKeys } from "../mutation-keys"; -import type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations, PlatformSiteThemePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations, PlatformSiteThemePatch } from "../../orm/input-types"; +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 { platformSiteThemeKeys } from '../query-keys'; +import { platformSiteThemeMutationKeys } from '../mutation-keys'; +import type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, + PlatformSiteThemePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, + PlatformSiteThemePatch, +} from '../../orm/input-types'; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformSiteThemeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformSiteThemePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformSiteThemeMutation(params: { - selection: ({ - fields: S & PlatformSiteThemeSelect; - } & HookStrictSelect, PlatformSiteThemeSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformSiteThemePatch: PlatformSiteThemePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformSiteTheme: { - platformSiteTheme: InferSelectResult; - }; -}, Error, { - id: string; - platformSiteThemePatch: PlatformSiteThemePatch; -}>; -export function useUpdatePlatformSiteThemeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformSiteThemeMutation( + params: { + selection: { + fields: S & PlatformSiteThemeSelect; + } & HookStrictSelect, PlatformSiteThemeSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformSiteTheme: { + platformSiteTheme: InferSelectResult; + }; + }, + Error, + { + id: string; + platformSiteThemePatch: PlatformSiteThemePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformSiteTheme: { + platformSiteTheme: InferSelectResult; + }; + }, + Error, + { + id: string; + platformSiteThemePatch: PlatformSiteThemePatch; + } +>; +export function useUpdatePlatformSiteThemeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformSiteThemePatch: PlatformSiteThemePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSiteThemeMutationKeys.all, mutationFn: ({ id, - platformSiteThemePatch + platformSiteThemePatch, }: { id: string; platformSiteThemePatch: PlatformSiteThemePatch; - }) => getClient().platformSiteTheme.update({ - where: { - id - }, - data: platformSiteThemePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformSiteTheme.update({ + where: { + id, + }, + data: platformSiteThemePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformSiteThemeKeys.detail(variables.id) + queryKey: platformSiteThemeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformSiteThemeKeys.lists() + queryKey: platformSiteThemeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePolicyMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePolicyMutation.ts index 9d8ae3ca02..0c975e2a25 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePolicyMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePolicyMutation.ts @@ -4,83 +4,99 @@ * 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 { policyKeys } from "../query-keys"; -import { policyMutationKeys } from "../mutation-keys"; -import type { PolicySelect, PolicyWithRelations, PolicyPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PolicySelect, PolicyWithRelations, PolicyPatch } from "../../orm/input-types"; +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 { policyKeys } from '../query-keys'; +import { policyMutationKeys } from '../mutation-keys'; +import type { PolicySelect, PolicyWithRelations, PolicyPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PolicySelect, PolicyWithRelations, PolicyPatch } from '../../orm/input-types'; /** * Mutation hook for updating a Policy - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePolicyMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', policyPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePolicyMutation(params: { - selection: ({ - fields: S & PolicySelect; - } & HookStrictSelect, PolicySelect>); -} & Omit; - }; -}, Error, { - id: string; - policyPatch: PolicyPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePolicy: { - policy: InferSelectResult; - }; -}, Error, { - id: string; - policyPatch: PolicyPatch; -}>; -export function useUpdatePolicyMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePolicyMutation( + params: { + selection: { + fields: S & PolicySelect; + } & HookStrictSelect, PolicySelect>; + } & Omit< + UseMutationOptions< + { + updatePolicy: { + policy: InferSelectResult; + }; + }, + Error, + { + id: string; + policyPatch: PolicyPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePolicy: { + policy: InferSelectResult; + }; + }, + Error, + { + id: string; + policyPatch: PolicyPatch; + } +>; +export function useUpdatePolicyMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + policyPatch: PolicyPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: policyMutationKeys.all, - mutationFn: ({ - id, - policyPatch - }: { - id: string; - policyPatch: PolicyPatch; - }) => getClient().policy.update({ - where: { - id - }, - data: policyPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, policyPatch }: { id: string; policyPatch: PolicyPatch }) => + getClient() + .policy.update({ + where: { + id, + }, + data: policyPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: policyKeys.detail(variables.id) + queryKey: policyKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: policyKeys.lists() + queryKey: policyKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePrimaryKeyConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePrimaryKeyConstraintMutation.ts index 1b7c26d42e..82f94721f3 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePrimaryKeyConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePrimaryKeyConstraintMutation.ts @@ -4,83 +4,113 @@ * 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 { primaryKeyConstraintKeys } from "../query-keys"; -import { primaryKeyConstraintMutationKeys } from "../mutation-keys"; -import type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations, PrimaryKeyConstraintPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations, PrimaryKeyConstraintPatch } from "../../orm/input-types"; +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 { primaryKeyConstraintKeys } from '../query-keys'; +import { primaryKeyConstraintMutationKeys } from '../mutation-keys'; +import type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, + PrimaryKeyConstraintPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, + PrimaryKeyConstraintPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a PrimaryKeyConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePrimaryKeyConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', primaryKeyConstraintPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePrimaryKeyConstraintMutation(params: { - selection: ({ - fields: S & PrimaryKeyConstraintSelect; - } & HookStrictSelect, PrimaryKeyConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; - primaryKeyConstraintPatch: PrimaryKeyConstraintPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePrimaryKeyConstraint: { - primaryKeyConstraint: InferSelectResult; - }; -}, Error, { - id: string; - primaryKeyConstraintPatch: PrimaryKeyConstraintPatch; -}>; -export function useUpdatePrimaryKeyConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePrimaryKeyConstraintMutation( + params: { + selection: { + fields: S & PrimaryKeyConstraintSelect; + } & HookStrictSelect, PrimaryKeyConstraintSelect>; + } & Omit< + UseMutationOptions< + { + updatePrimaryKeyConstraint: { + primaryKeyConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + primaryKeyConstraintPatch: PrimaryKeyConstraintPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePrimaryKeyConstraint: { + primaryKeyConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + primaryKeyConstraintPatch: PrimaryKeyConstraintPatch; + } +>; +export function useUpdatePrimaryKeyConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + primaryKeyConstraintPatch: PrimaryKeyConstraintPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: primaryKeyConstraintMutationKeys.all, mutationFn: ({ id, - primaryKeyConstraintPatch + primaryKeyConstraintPatch, }: { id: string; primaryKeyConstraintPatch: PrimaryKeyConstraintPatch; - }) => getClient().primaryKeyConstraint.update({ - where: { - id - }, - data: primaryKeyConstraintPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .primaryKeyConstraint.update({ + where: { + id, + }, + data: primaryKeyConstraintPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: primaryKeyConstraintKeys.detail(variables.id) + queryKey: primaryKeyConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: primaryKeyConstraintKeys.lists() + queryKey: primaryKeyConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePubkeySettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePubkeySettingMutation.ts index 4239e311b0..504e09ed3f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdatePubkeySettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdatePubkeySettingMutation.ts @@ -4,83 +4,113 @@ * 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 { pubkeySettingKeys } from "../query-keys"; -import { pubkeySettingMutationKeys } from "../mutation-keys"; -import type { PubkeySettingSelect, PubkeySettingWithRelations, PubkeySettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PubkeySettingSelect, PubkeySettingWithRelations, PubkeySettingPatch } from "../../orm/input-types"; +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 { pubkeySettingKeys } from '../query-keys'; +import { pubkeySettingMutationKeys } from '../mutation-keys'; +import type { + PubkeySettingSelect, + PubkeySettingWithRelations, + PubkeySettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PubkeySettingSelect, + PubkeySettingWithRelations, + PubkeySettingPatch, +} from '../../orm/input-types'; /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePubkeySettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', pubkeySettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePubkeySettingMutation(params: { - selection: ({ - fields: S & PubkeySettingSelect; - } & HookStrictSelect, PubkeySettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - pubkeySettingPatch: PubkeySettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePubkeySetting: { - pubkeySetting: InferSelectResult; - }; -}, Error, { - id: string; - pubkeySettingPatch: PubkeySettingPatch; -}>; -export function useUpdatePubkeySettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePubkeySettingMutation( + params: { + selection: { + fields: S & PubkeySettingSelect; + } & HookStrictSelect, PubkeySettingSelect>; + } & Omit< + UseMutationOptions< + { + updatePubkeySetting: { + pubkeySetting: InferSelectResult; + }; + }, + Error, + { + id: string; + pubkeySettingPatch: PubkeySettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePubkeySetting: { + pubkeySetting: InferSelectResult; + }; + }, + Error, + { + id: string; + pubkeySettingPatch: PubkeySettingPatch; + } +>; +export function useUpdatePubkeySettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + pubkeySettingPatch: PubkeySettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: pubkeySettingMutationKeys.all, mutationFn: ({ id, - pubkeySettingPatch + pubkeySettingPatch, }: { id: string; pubkeySettingPatch: PubkeySettingPatch; - }) => getClient().pubkeySetting.update({ - where: { - id - }, - data: pubkeySettingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .pubkeySetting.update({ + where: { + id, + }, + data: pubkeySettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: pubkeySettingKeys.detail(variables.id) + queryKey: pubkeySettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: pubkeySettingKeys.lists() + queryKey: pubkeySettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateRlsSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateRlsSettingMutation.ts index a46f45bc54..0f65b94c8d 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateRlsSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateRlsSettingMutation.ts @@ -4,83 +4,107 @@ * 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 { rlsSettingKeys } from "../query-keys"; -import { rlsSettingMutationKeys } from "../mutation-keys"; -import type { RlsSettingSelect, RlsSettingWithRelations, RlsSettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsSettingSelect, RlsSettingWithRelations, RlsSettingPatch } from "../../orm/input-types"; +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 { rlsSettingKeys } from '../query-keys'; +import { rlsSettingMutationKeys } from '../mutation-keys'; +import type { + RlsSettingSelect, + RlsSettingWithRelations, + RlsSettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RlsSettingSelect, + RlsSettingWithRelations, + RlsSettingPatch, +} from '../../orm/input-types'; /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRlsSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', rlsSettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRlsSettingMutation(params: { - selection: ({ - fields: S & RlsSettingSelect; - } & HookStrictSelect, RlsSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - rlsSettingPatch: RlsSettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateRlsSetting: { - rlsSetting: InferSelectResult; - }; -}, Error, { - id: string; - rlsSettingPatch: RlsSettingPatch; -}>; -export function useUpdateRlsSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRlsSettingMutation( + params: { + selection: { + fields: S & RlsSettingSelect; + } & HookStrictSelect, RlsSettingSelect>; + } & Omit< + UseMutationOptions< + { + updateRlsSetting: { + rlsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + rlsSettingPatch: RlsSettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRlsSetting: { + rlsSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + rlsSettingPatch: RlsSettingPatch; + } +>; +export function useUpdateRlsSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + rlsSettingPatch: RlsSettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rlsSettingMutationKeys.all, - mutationFn: ({ - id, - rlsSettingPatch - }: { - id: string; - rlsSettingPatch: RlsSettingPatch; - }) => getClient().rlsSetting.update({ - where: { - id - }, - data: rlsSettingPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, rlsSettingPatch }: { id: string; rlsSettingPatch: RlsSettingPatch }) => + getClient() + .rlsSetting.update({ + where: { + id, + }, + data: rlsSettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: rlsSettingKeys.detail(variables.id) + queryKey: rlsSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: rlsSettingKeys.lists() + queryKey: rlsSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateRouteBindingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateRouteBindingMutation.ts index c8e4cf87c0..cb3950c98c 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateRouteBindingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateRouteBindingMutation.ts @@ -4,83 +4,107 @@ * 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 { routeBindingKeys } from "../query-keys"; -import { routeBindingMutationKeys } from "../mutation-keys"; -import type { RouteBindingSelect, RouteBindingWithRelations, RouteBindingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteBindingSelect, RouteBindingWithRelations, RouteBindingPatch } from "../../orm/input-types"; +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 { routeBindingKeys } from '../query-keys'; +import { routeBindingMutationKeys } from '../mutation-keys'; +import type { + RouteBindingSelect, + RouteBindingWithRelations, + RouteBindingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RouteBindingSelect, + RouteBindingWithRelations, + RouteBindingPatch, +} from '../../orm/input-types'; /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRouteBindingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', routeBindingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRouteBindingMutation(params: { - selection: ({ - fields: S & RouteBindingSelect; - } & HookStrictSelect, RouteBindingSelect>); -} & Omit; - }; -}, Error, { - id: string; - routeBindingPatch: RouteBindingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateRouteBinding: { - routeBinding: InferSelectResult; - }; -}, Error, { - id: string; - routeBindingPatch: RouteBindingPatch; -}>; -export function useUpdateRouteBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRouteBindingMutation( + params: { + selection: { + fields: S & RouteBindingSelect; + } & HookStrictSelect, RouteBindingSelect>; + } & Omit< + UseMutationOptions< + { + updateRouteBinding: { + routeBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + routeBindingPatch: RouteBindingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRouteBinding: { + routeBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + routeBindingPatch: RouteBindingPatch; + } +>; +export function useUpdateRouteBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + routeBindingPatch: RouteBindingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeBindingMutationKeys.all, - mutationFn: ({ - id, - routeBindingPatch - }: { - id: string; - routeBindingPatch: RouteBindingPatch; - }) => getClient().routeBinding.update({ - where: { - id - }, - data: routeBindingPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, routeBindingPatch }: { id: string; routeBindingPatch: RouteBindingPatch }) => + getClient() + .routeBinding.update({ + where: { + id, + }, + data: routeBindingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: routeBindingKeys.detail(variables.id) + queryKey: routeBindingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: routeBindingKeys.lists() + queryKey: routeBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateRouteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateRouteMutation.ts index 9a383f8b0f..6100575cbd 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateRouteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateRouteMutation.ts @@ -4,83 +4,99 @@ * 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 { routeKeys } from "../query-keys"; -import { routeMutationKeys } from "../mutation-keys"; -import type { RouteSelect, RouteWithRelations, RoutePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteSelect, RouteWithRelations, RoutePatch } from "../../orm/input-types"; +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 { routeKeys } from '../query-keys'; +import { routeMutationKeys } from '../mutation-keys'; +import type { RouteSelect, RouteWithRelations, RoutePatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RouteSelect, RouteWithRelations, RoutePatch } from '../../orm/input-types'; /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRouteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', routePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRouteMutation(params: { - selection: ({ - fields: S & RouteSelect; - } & HookStrictSelect, RouteSelect>); -} & Omit; - }; -}, Error, { - id: string; - routePatch: RoutePatch; -}>, "mutationFn">): UseMutationResult<{ - updateRoute: { - route: InferSelectResult; - }; -}, Error, { - id: string; - routePatch: RoutePatch; -}>; -export function useUpdateRouteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRouteMutation( + params: { + selection: { + fields: S & RouteSelect; + } & HookStrictSelect, RouteSelect>; + } & Omit< + UseMutationOptions< + { + updateRoute: { + route: InferSelectResult; + }; + }, + Error, + { + id: string; + routePatch: RoutePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRoute: { + route: InferSelectResult; + }; + }, + Error, + { + id: string; + routePatch: RoutePatch; + } +>; +export function useUpdateRouteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + routePatch: RoutePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeMutationKeys.all, - mutationFn: ({ - id, - routePatch - }: { - id: string; - routePatch: RoutePatch; - }) => getClient().route.update({ - where: { - id - }, - data: routePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, routePatch }: { id: string; routePatch: RoutePatch }) => + getClient() + .route.update({ + where: { + id, + }, + data: routePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: routeKeys.detail(variables.id) + queryKey: routeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: routeKeys.lists() + queryKey: routeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSchemaGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSchemaGrantMutation.ts index a2c5acee82..a092451377 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSchemaGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSchemaGrantMutation.ts @@ -4,83 +4,107 @@ * 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 { schemaGrantKeys } from "../query-keys"; -import { schemaGrantMutationKeys } from "../mutation-keys"; -import type { SchemaGrantSelect, SchemaGrantWithRelations, SchemaGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaGrantSelect, SchemaGrantWithRelations, SchemaGrantPatch } from "../../orm/input-types"; +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 { schemaGrantKeys } from '../query-keys'; +import { schemaGrantMutationKeys } from '../mutation-keys'; +import type { + SchemaGrantSelect, + SchemaGrantWithRelations, + SchemaGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SchemaGrantSelect, + SchemaGrantWithRelations, + SchemaGrantPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a SchemaGrant - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSchemaGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', schemaGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSchemaGrantMutation(params: { - selection: ({ - fields: S & SchemaGrantSelect; - } & HookStrictSelect, SchemaGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - schemaGrantPatch: SchemaGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateSchemaGrant: { - schemaGrant: InferSelectResult; - }; -}, Error, { - id: string; - schemaGrantPatch: SchemaGrantPatch; -}>; -export function useUpdateSchemaGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSchemaGrantMutation( + params: { + selection: { + fields: S & SchemaGrantSelect; + } & HookStrictSelect, SchemaGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateSchemaGrant: { + schemaGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + schemaGrantPatch: SchemaGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSchemaGrant: { + schemaGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + schemaGrantPatch: SchemaGrantPatch; + } +>; +export function useUpdateSchemaGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + schemaGrantPatch: SchemaGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: schemaGrantMutationKeys.all, - mutationFn: ({ - id, - schemaGrantPatch - }: { - id: string; - schemaGrantPatch: SchemaGrantPatch; - }) => getClient().schemaGrant.update({ - where: { - id - }, - data: schemaGrantPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, schemaGrantPatch }: { id: string; schemaGrantPatch: SchemaGrantPatch }) => + getClient() + .schemaGrant.update({ + where: { + id, + }, + data: schemaGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: schemaGrantKeys.detail(variables.id) + queryKey: schemaGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: schemaGrantKeys.lists() + queryKey: schemaGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSchemaMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSchemaMutation.ts index 56b9f50de6..e9567a51ce 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSchemaMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSchemaMutation.ts @@ -4,83 +4,99 @@ * 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 { schemaKeys } from "../query-keys"; -import { schemaMutationKeys } from "../mutation-keys"; -import type { SchemaSelect, SchemaWithRelations, SchemaPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaSelect, SchemaWithRelations, SchemaPatch } from "../../orm/input-types"; +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 { schemaKeys } from '../query-keys'; +import { schemaMutationKeys } from '../mutation-keys'; +import type { SchemaSelect, SchemaWithRelations, SchemaPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SchemaSelect, SchemaWithRelations, SchemaPatch } from '../../orm/input-types'; /** * Mutation hook for updating a Schema - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSchemaMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', schemaPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSchemaMutation(params: { - selection: ({ - fields: S & SchemaSelect; - } & HookStrictSelect, SchemaSelect>); -} & Omit; - }; -}, Error, { - id: string; - schemaPatch: SchemaPatch; -}>, "mutationFn">): UseMutationResult<{ - updateSchema: { - schema: InferSelectResult; - }; -}, Error, { - id: string; - schemaPatch: SchemaPatch; -}>; -export function useUpdateSchemaMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSchemaMutation( + params: { + selection: { + fields: S & SchemaSelect; + } & HookStrictSelect, SchemaSelect>; + } & Omit< + UseMutationOptions< + { + updateSchema: { + schema: InferSelectResult; + }; + }, + Error, + { + id: string; + schemaPatch: SchemaPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSchema: { + schema: InferSelectResult; + }; + }, + Error, + { + id: string; + schemaPatch: SchemaPatch; + } +>; +export function useUpdateSchemaMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + schemaPatch: SchemaPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: schemaMutationKeys.all, - mutationFn: ({ - id, - schemaPatch - }: { - id: string; - schemaPatch: SchemaPatch; - }) => getClient().schema.update({ - where: { - id - }, - data: schemaPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, schemaPatch }: { id: string; schemaPatch: SchemaPatch }) => + getClient() + .schema.update({ + where: { + id, + }, + data: schemaPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: schemaKeys.detail(variables.id) + queryKey: schemaKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: schemaKeys.lists() + queryKey: schemaKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteMetadatumMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteMetadatumMutation.ts index e48512e7c5..712fcd7d9d 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteMetadatumMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteMetadatumMutation.ts @@ -4,83 +4,113 @@ * 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 { siteMetadatumKeys } from "../query-keys"; -import { siteMetadatumMutationKeys } from "../mutation-keys"; -import type { SiteMetadatumSelect, SiteMetadatumWithRelations, SiteMetadatumPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteMetadatumSelect, SiteMetadatumWithRelations, SiteMetadatumPatch } from "../../orm/input-types"; +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 { siteMetadatumKeys } from '../query-keys'; +import { siteMetadatumMutationKeys } from '../mutation-keys'; +import type { + SiteMetadatumSelect, + SiteMetadatumWithRelations, + SiteMetadatumPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteMetadatumSelect, + SiteMetadatumWithRelations, + SiteMetadatumPatch, +} from '../../orm/input-types'; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSiteMetadatumMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', siteMetadatumPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSiteMetadatumMutation(params: { - selection: ({ - fields: S & SiteMetadatumSelect; - } & HookStrictSelect, SiteMetadatumSelect>); -} & Omit; - }; -}, Error, { - id: string; - siteMetadatumPatch: SiteMetadatumPatch; -}>, "mutationFn">): UseMutationResult<{ - updateSiteMetadatum: { - siteMetadatum: InferSelectResult; - }; -}, Error, { - id: string; - siteMetadatumPatch: SiteMetadatumPatch; -}>; -export function useUpdateSiteMetadatumMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSiteMetadatumMutation( + params: { + selection: { + fields: S & SiteMetadatumSelect; + } & HookStrictSelect, SiteMetadatumSelect>; + } & Omit< + UseMutationOptions< + { + updateSiteMetadatum: { + siteMetadatum: InferSelectResult; + }; + }, + Error, + { + id: string; + siteMetadatumPatch: SiteMetadatumPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSiteMetadatum: { + siteMetadatum: InferSelectResult; + }; + }, + Error, + { + id: string; + siteMetadatumPatch: SiteMetadatumPatch; + } +>; +export function useUpdateSiteMetadatumMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + siteMetadatumPatch: SiteMetadatumPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteMetadatumMutationKeys.all, mutationFn: ({ id, - siteMetadatumPatch + siteMetadatumPatch, }: { id: string; siteMetadatumPatch: SiteMetadatumPatch; - }) => getClient().siteMetadatum.update({ - where: { - id - }, - data: siteMetadatumPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .siteMetadatum.update({ + where: { + id, + }, + data: siteMetadatumPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: siteMetadatumKeys.detail(variables.id) + queryKey: siteMetadatumKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteMetadatumKeys.lists() + queryKey: siteMetadatumKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteModuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteModuleMutation.ts index f99801a78f..b9769b1ec0 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteModuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { siteModuleKeys } from "../query-keys"; -import { siteModuleMutationKeys } from "../mutation-keys"; -import type { SiteModuleSelect, SiteModuleWithRelations, SiteModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteModuleSelect, SiteModuleWithRelations, SiteModulePatch } from "../../orm/input-types"; +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 { siteModuleKeys } from '../query-keys'; +import { siteModuleMutationKeys } from '../mutation-keys'; +import type { + SiteModuleSelect, + SiteModuleWithRelations, + SiteModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteModuleSelect, + SiteModuleWithRelations, + SiteModulePatch, +} from '../../orm/input-types'; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSiteModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', siteModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSiteModuleMutation(params: { - selection: ({ - fields: S & SiteModuleSelect; - } & HookStrictSelect, SiteModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - siteModulePatch: SiteModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateSiteModule: { - siteModule: InferSelectResult; - }; -}, Error, { - id: string; - siteModulePatch: SiteModulePatch; -}>; -export function useUpdateSiteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSiteModuleMutation( + params: { + selection: { + fields: S & SiteModuleSelect; + } & HookStrictSelect, SiteModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateSiteModule: { + siteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + siteModulePatch: SiteModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSiteModule: { + siteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + siteModulePatch: SiteModulePatch; + } +>; +export function useUpdateSiteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + siteModulePatch: SiteModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteModuleMutationKeys.all, - mutationFn: ({ - id, - siteModulePatch - }: { - id: string; - siteModulePatch: SiteModulePatch; - }) => getClient().siteModule.update({ - where: { - id - }, - data: siteModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, siteModulePatch }: { id: string; siteModulePatch: SiteModulePatch }) => + getClient() + .siteModule.update({ + where: { + id, + }, + data: siteModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: siteModuleKeys.detail(variables.id) + queryKey: siteModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteModuleKeys.lists() + queryKey: siteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteMutation.ts index 7d8129c253..e956a3f060 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteMutation.ts @@ -4,83 +4,99 @@ * 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 { siteKeys } from "../query-keys"; -import { siteMutationKeys } from "../mutation-keys"; -import type { SiteSelect, SiteWithRelations, SitePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSelect, SiteWithRelations, SitePatch } from "../../orm/input-types"; +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 { siteKeys } from '../query-keys'; +import { siteMutationKeys } from '../mutation-keys'; +import type { SiteSelect, SiteWithRelations, SitePatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteSelect, SiteWithRelations, SitePatch } from '../../orm/input-types'; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSiteMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', sitePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSiteMutation(params: { - selection: ({ - fields: S & SiteSelect; - } & HookStrictSelect, SiteSelect>); -} & Omit; - }; -}, Error, { - id: string; - sitePatch: SitePatch; -}>, "mutationFn">): UseMutationResult<{ - updateSite: { - site: InferSelectResult; - }; -}, Error, { - id: string; - sitePatch: SitePatch; -}>; -export function useUpdateSiteMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSiteMutation( + params: { + selection: { + fields: S & SiteSelect; + } & HookStrictSelect, SiteSelect>; + } & Omit< + UseMutationOptions< + { + updateSite: { + site: InferSelectResult; + }; + }, + Error, + { + id: string; + sitePatch: SitePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSite: { + site: InferSelectResult; + }; + }, + Error, + { + id: string; + sitePatch: SitePatch; + } +>; +export function useUpdateSiteMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + sitePatch: SitePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteMutationKeys.all, - mutationFn: ({ - id, - sitePatch - }: { - id: string; - sitePatch: SitePatch; - }) => getClient().site.update({ - where: { - id - }, - data: sitePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, sitePatch }: { id: string; sitePatch: SitePatch }) => + getClient() + .site.update({ + where: { + id, + }, + data: sitePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: siteKeys.detail(variables.id) + queryKey: siteKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteKeys.lists() + queryKey: siteKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteThemeMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteThemeMutation.ts index 8c32d84eda..ab60cde4cd 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteThemeMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSiteThemeMutation.ts @@ -4,83 +4,107 @@ * 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 { siteThemeKeys } from "../query-keys"; -import { siteThemeMutationKeys } from "../mutation-keys"; -import type { SiteThemeSelect, SiteThemeWithRelations, SiteThemePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteThemeSelect, SiteThemeWithRelations, SiteThemePatch } from "../../orm/input-types"; +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 { siteThemeKeys } from '../query-keys'; +import { siteThemeMutationKeys } from '../mutation-keys'; +import type { + SiteThemeSelect, + SiteThemeWithRelations, + SiteThemePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteThemeSelect, + SiteThemeWithRelations, + SiteThemePatch, +} from '../../orm/input-types'; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSiteThemeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', siteThemePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSiteThemeMutation(params: { - selection: ({ - fields: S & SiteThemeSelect; - } & HookStrictSelect, SiteThemeSelect>); -} & Omit; - }; -}, Error, { - id: string; - siteThemePatch: SiteThemePatch; -}>, "mutationFn">): UseMutationResult<{ - updateSiteTheme: { - siteTheme: InferSelectResult; - }; -}, Error, { - id: string; - siteThemePatch: SiteThemePatch; -}>; -export function useUpdateSiteThemeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSiteThemeMutation( + params: { + selection: { + fields: S & SiteThemeSelect; + } & HookStrictSelect, SiteThemeSelect>; + } & Omit< + UseMutationOptions< + { + updateSiteTheme: { + siteTheme: InferSelectResult; + }; + }, + Error, + { + id: string; + siteThemePatch: SiteThemePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSiteTheme: { + siteTheme: InferSelectResult; + }; + }, + Error, + { + id: string; + siteThemePatch: SiteThemePatch; + } +>; +export function useUpdateSiteThemeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + siteThemePatch: SiteThemePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteThemeMutationKeys.all, - mutationFn: ({ - id, - siteThemePatch - }: { - id: string; - siteThemePatch: SiteThemePatch; - }) => getClient().siteTheme.update({ - where: { - id - }, - data: siteThemePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, siteThemePatch }: { id: string; siteThemePatch: SiteThemePatch }) => + getClient() + .siteTheme.update({ + where: { + id, + }, + data: siteThemePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: siteThemeKeys.detail(variables.id) + queryKey: siteThemeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteThemeKeys.lists() + queryKey: siteThemeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSpatialRelationMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSpatialRelationMutation.ts index 067da6f126..a1ed7a8784 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateSpatialRelationMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateSpatialRelationMutation.ts @@ -4,83 +4,113 @@ * 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 { spatialRelationKeys } from "../query-keys"; -import { spatialRelationMutationKeys } from "../mutation-keys"; -import type { SpatialRelationSelect, SpatialRelationWithRelations, SpatialRelationPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SpatialRelationSelect, SpatialRelationWithRelations, SpatialRelationPatch } from "../../orm/input-types"; +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 { spatialRelationKeys } from '../query-keys'; +import { spatialRelationMutationKeys } from '../mutation-keys'; +import type { + SpatialRelationSelect, + SpatialRelationWithRelations, + SpatialRelationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SpatialRelationSelect, + SpatialRelationWithRelations, + SpatialRelationPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a SpatialRelation - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSpatialRelationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', spatialRelationPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSpatialRelationMutation(params: { - selection: ({ - fields: S & SpatialRelationSelect; - } & HookStrictSelect, SpatialRelationSelect>); -} & Omit; - }; -}, Error, { - id: string; - spatialRelationPatch: SpatialRelationPatch; -}>, "mutationFn">): UseMutationResult<{ - updateSpatialRelation: { - spatialRelation: InferSelectResult; - }; -}, Error, { - id: string; - spatialRelationPatch: SpatialRelationPatch; -}>; -export function useUpdateSpatialRelationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSpatialRelationMutation( + params: { + selection: { + fields: S & SpatialRelationSelect; + } & HookStrictSelect, SpatialRelationSelect>; + } & Omit< + UseMutationOptions< + { + updateSpatialRelation: { + spatialRelation: InferSelectResult; + }; + }, + Error, + { + id: string; + spatialRelationPatch: SpatialRelationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSpatialRelation: { + spatialRelation: InferSelectResult; + }; + }, + Error, + { + id: string; + spatialRelationPatch: SpatialRelationPatch; + } +>; +export function useUpdateSpatialRelationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + spatialRelationPatch: SpatialRelationPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: spatialRelationMutationKeys.all, mutationFn: ({ id, - spatialRelationPatch + spatialRelationPatch, }: { id: string; spatialRelationPatch: SpatialRelationPatch; - }) => getClient().spatialRelation.update({ - where: { - id - }, - data: spatialRelationPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .spatialRelation.update({ + where: { + id, + }, + data: spatialRelationPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: spatialRelationKeys.detail(variables.id) + queryKey: spatialRelationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: spatialRelationKeys.lists() + queryKey: spatialRelationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateTableGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateTableGrantMutation.ts index a06056b11a..c88b15da6f 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateTableGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateTableGrantMutation.ts @@ -4,83 +4,107 @@ * 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 { tableGrantKeys } from "../query-keys"; -import { tableGrantMutationKeys } from "../mutation-keys"; -import type { TableGrantSelect, TableGrantWithRelations, TableGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableGrantSelect, TableGrantWithRelations, TableGrantPatch } from "../../orm/input-types"; +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 { tableGrantKeys } from '../query-keys'; +import { tableGrantMutationKeys } from '../mutation-keys'; +import type { + TableGrantSelect, + TableGrantWithRelations, + TableGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TableGrantSelect, + TableGrantWithRelations, + TableGrantPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a TableGrant - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateTableGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', tableGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateTableGrantMutation(params: { - selection: ({ - fields: S & TableGrantSelect; - } & HookStrictSelect, TableGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - tableGrantPatch: TableGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateTableGrant: { - tableGrant: InferSelectResult; - }; -}, Error, { - id: string; - tableGrantPatch: TableGrantPatch; -}>; -export function useUpdateTableGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateTableGrantMutation( + params: { + selection: { + fields: S & TableGrantSelect; + } & HookStrictSelect, TableGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateTableGrant: { + tableGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + tableGrantPatch: TableGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateTableGrant: { + tableGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + tableGrantPatch: TableGrantPatch; + } +>; +export function useUpdateTableGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + tableGrantPatch: TableGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: tableGrantMutationKeys.all, - mutationFn: ({ - id, - tableGrantPatch - }: { - id: string; - tableGrantPatch: TableGrantPatch; - }) => getClient().tableGrant.update({ - where: { - id - }, - data: tableGrantPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, tableGrantPatch }: { id: string; tableGrantPatch: TableGrantPatch }) => + getClient() + .tableGrant.update({ + where: { + id, + }, + data: tableGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: tableGrantKeys.detail(variables.id) + queryKey: tableGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: tableGrantKeys.lists() + queryKey: tableGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateTableMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateTableMutation.ts index 9c5913d755..8c40391752 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateTableMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateTableMutation.ts @@ -4,83 +4,99 @@ * 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 { tableKeys } from "../query-keys"; -import { tableMutationKeys } from "../mutation-keys"; -import type { TableSelect, TableWithRelations, TablePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableSelect, TableWithRelations, TablePatch } from "../../orm/input-types"; +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 { tableKeys } from '../query-keys'; +import { tableMutationKeys } from '../mutation-keys'; +import type { TableSelect, TableWithRelations, TablePatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TableSelect, TableWithRelations, TablePatch } from '../../orm/input-types'; /** * Mutation hook for updating a Table - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateTableMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', tablePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateTableMutation(params: { - selection: ({ - fields: S & TableSelect; - } & HookStrictSelect, TableSelect>); -} & Omit; - }; -}, Error, { - id: string; - tablePatch: TablePatch; -}>, "mutationFn">): UseMutationResult<{ - updateTable: { - table: InferSelectResult; - }; -}, Error, { - id: string; - tablePatch: TablePatch; -}>; -export function useUpdateTableMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateTableMutation( + params: { + selection: { + fields: S & TableSelect; + } & HookStrictSelect, TableSelect>; + } & Omit< + UseMutationOptions< + { + updateTable: { + table: InferSelectResult; + }; + }, + Error, + { + id: string; + tablePatch: TablePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateTable: { + table: InferSelectResult; + }; + }, + Error, + { + id: string; + tablePatch: TablePatch; + } +>; +export function useUpdateTableMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + tablePatch: TablePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: tableMutationKeys.all, - mutationFn: ({ - id, - tablePatch - }: { - id: string; - tablePatch: TablePatch; - }) => getClient().table.update({ - where: { - id - }, - data: tablePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, tablePatch }: { id: string; tablePatch: TablePatch }) => + getClient() + .table.update({ + where: { + id, + }, + data: tablePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: tableKeys.detail(variables.id) + queryKey: tableKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: tableKeys.lists() + queryKey: tableKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateTriggerFunctionMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateTriggerFunctionMutation.ts index 209f120595..8f7beae217 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateTriggerFunctionMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateTriggerFunctionMutation.ts @@ -4,83 +4,113 @@ * 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 { triggerFunctionKeys } from "../query-keys"; -import { triggerFunctionMutationKeys } from "../mutation-keys"; -import type { TriggerFunctionSelect, TriggerFunctionWithRelations, TriggerFunctionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerFunctionSelect, TriggerFunctionWithRelations, TriggerFunctionPatch } from "../../orm/input-types"; +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 { triggerFunctionKeys } from '../query-keys'; +import { triggerFunctionMutationKeys } from '../mutation-keys'; +import type { + TriggerFunctionSelect, + TriggerFunctionWithRelations, + TriggerFunctionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TriggerFunctionSelect, + TriggerFunctionWithRelations, + TriggerFunctionPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a TriggerFunction - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateTriggerFunctionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', triggerFunctionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateTriggerFunctionMutation(params: { - selection: ({ - fields: S & TriggerFunctionSelect; - } & HookStrictSelect, TriggerFunctionSelect>); -} & Omit; - }; -}, Error, { - id: string; - triggerFunctionPatch: TriggerFunctionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateTriggerFunction: { - triggerFunction: InferSelectResult; - }; -}, Error, { - id: string; - triggerFunctionPatch: TriggerFunctionPatch; -}>; -export function useUpdateTriggerFunctionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateTriggerFunctionMutation( + params: { + selection: { + fields: S & TriggerFunctionSelect; + } & HookStrictSelect, TriggerFunctionSelect>; + } & Omit< + UseMutationOptions< + { + updateTriggerFunction: { + triggerFunction: InferSelectResult; + }; + }, + Error, + { + id: string; + triggerFunctionPatch: TriggerFunctionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateTriggerFunction: { + triggerFunction: InferSelectResult; + }; + }, + Error, + { + id: string; + triggerFunctionPatch: TriggerFunctionPatch; + } +>; +export function useUpdateTriggerFunctionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + triggerFunctionPatch: TriggerFunctionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: triggerFunctionMutationKeys.all, mutationFn: ({ id, - triggerFunctionPatch + triggerFunctionPatch, }: { id: string; triggerFunctionPatch: TriggerFunctionPatch; - }) => getClient().triggerFunction.update({ - where: { - id - }, - data: triggerFunctionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .triggerFunction.update({ + where: { + id, + }, + data: triggerFunctionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: triggerFunctionKeys.detail(variables.id) + queryKey: triggerFunctionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: triggerFunctionKeys.lists() + queryKey: triggerFunctionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateTriggerMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateTriggerMutation.ts index b66c2ce424..94b2f36774 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateTriggerMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateTriggerMutation.ts @@ -4,83 +4,99 @@ * 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 { triggerKeys } from "../query-keys"; -import { triggerMutationKeys } from "../mutation-keys"; -import type { TriggerSelect, TriggerWithRelations, TriggerPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerSelect, TriggerWithRelations, TriggerPatch } from "../../orm/input-types"; +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 { triggerKeys } from '../query-keys'; +import { triggerMutationKeys } from '../mutation-keys'; +import type { TriggerSelect, TriggerWithRelations, TriggerPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TriggerSelect, TriggerWithRelations, TriggerPatch } from '../../orm/input-types'; /** * Mutation hook for updating a Trigger - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateTriggerMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', triggerPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateTriggerMutation(params: { - selection: ({ - fields: S & TriggerSelect; - } & HookStrictSelect, TriggerSelect>); -} & Omit; - }; -}, Error, { - id: string; - triggerPatch: TriggerPatch; -}>, "mutationFn">): UseMutationResult<{ - updateTrigger: { - trigger: InferSelectResult; - }; -}, Error, { - id: string; - triggerPatch: TriggerPatch; -}>; -export function useUpdateTriggerMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateTriggerMutation( + params: { + selection: { + fields: S & TriggerSelect; + } & HookStrictSelect, TriggerSelect>; + } & Omit< + UseMutationOptions< + { + updateTrigger: { + trigger: InferSelectResult; + }; + }, + Error, + { + id: string; + triggerPatch: TriggerPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateTrigger: { + trigger: InferSelectResult; + }; + }, + Error, + { + id: string; + triggerPatch: TriggerPatch; + } +>; +export function useUpdateTriggerMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + triggerPatch: TriggerPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: triggerMutationKeys.all, - mutationFn: ({ - id, - triggerPatch - }: { - id: string; - triggerPatch: TriggerPatch; - }) => getClient().trigger.update({ - where: { - id - }, - data: triggerPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, triggerPatch }: { id: string; triggerPatch: TriggerPatch }) => + getClient() + .trigger.update({ + where: { + id, + }, + data: triggerPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: triggerKeys.detail(variables.id) + queryKey: triggerKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: triggerKeys.lists() + queryKey: triggerKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateUniqueConstraintMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateUniqueConstraintMutation.ts index aca5f85950..76e1185680 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateUniqueConstraintMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateUniqueConstraintMutation.ts @@ -4,83 +4,113 @@ * 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 { uniqueConstraintKeys } from "../query-keys"; -import { uniqueConstraintMutationKeys } from "../mutation-keys"; -import type { UniqueConstraintSelect, UniqueConstraintWithRelations, UniqueConstraintPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UniqueConstraintSelect, UniqueConstraintWithRelations, UniqueConstraintPatch } from "../../orm/input-types"; +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 { uniqueConstraintKeys } from '../query-keys'; +import { uniqueConstraintMutationKeys } from '../mutation-keys'; +import type { + UniqueConstraintSelect, + UniqueConstraintWithRelations, + UniqueConstraintPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UniqueConstraintSelect, + UniqueConstraintWithRelations, + UniqueConstraintPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a UniqueConstraint - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateUniqueConstraintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', uniqueConstraintPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateUniqueConstraintMutation(params: { - selection: ({ - fields: S & UniqueConstraintSelect; - } & HookStrictSelect, UniqueConstraintSelect>); -} & Omit; - }; -}, Error, { - id: string; - uniqueConstraintPatch: UniqueConstraintPatch; -}>, "mutationFn">): UseMutationResult<{ - updateUniqueConstraint: { - uniqueConstraint: InferSelectResult; - }; -}, Error, { - id: string; - uniqueConstraintPatch: UniqueConstraintPatch; -}>; -export function useUpdateUniqueConstraintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateUniqueConstraintMutation( + params: { + selection: { + fields: S & UniqueConstraintSelect; + } & HookStrictSelect, UniqueConstraintSelect>; + } & Omit< + UseMutationOptions< + { + updateUniqueConstraint: { + uniqueConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + uniqueConstraintPatch: UniqueConstraintPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateUniqueConstraint: { + uniqueConstraint: InferSelectResult; + }; + }, + Error, + { + id: string; + uniqueConstraintPatch: UniqueConstraintPatch; + } +>; +export function useUpdateUniqueConstraintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + uniqueConstraintPatch: UniqueConstraintPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: uniqueConstraintMutationKeys.all, mutationFn: ({ id, - uniqueConstraintPatch + uniqueConstraintPatch, }: { id: string; uniqueConstraintPatch: UniqueConstraintPatch; - }) => getClient().uniqueConstraint.update({ - where: { - id - }, - data: uniqueConstraintPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .uniqueConstraint.update({ + where: { + id, + }, + data: uniqueConstraintPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: uniqueConstraintKeys.detail(variables.id) + queryKey: uniqueConstraintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: uniqueConstraintKeys.lists() + queryKey: uniqueConstraintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewGrantMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewGrantMutation.ts index bee39e3763..a8db2ef129 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewGrantMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewGrantMutation.ts @@ -4,83 +4,107 @@ * 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 { viewGrantKeys } from "../query-keys"; -import { viewGrantMutationKeys } from "../mutation-keys"; -import type { ViewGrantSelect, ViewGrantWithRelations, ViewGrantPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewGrantSelect, ViewGrantWithRelations, ViewGrantPatch } from "../../orm/input-types"; +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 { viewGrantKeys } from '../query-keys'; +import { viewGrantMutationKeys } from '../mutation-keys'; +import type { + ViewGrantSelect, + ViewGrantWithRelations, + ViewGrantPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ViewGrantSelect, + ViewGrantWithRelations, + ViewGrantPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ViewGrant - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateViewGrantMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', viewGrantPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateViewGrantMutation(params: { - selection: ({ - fields: S & ViewGrantSelect; - } & HookStrictSelect, ViewGrantSelect>); -} & Omit; - }; -}, Error, { - id: string; - viewGrantPatch: ViewGrantPatch; -}>, "mutationFn">): UseMutationResult<{ - updateViewGrant: { - viewGrant: InferSelectResult; - }; -}, Error, { - id: string; - viewGrantPatch: ViewGrantPatch; -}>; -export function useUpdateViewGrantMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateViewGrantMutation( + params: { + selection: { + fields: S & ViewGrantSelect; + } & HookStrictSelect, ViewGrantSelect>; + } & Omit< + UseMutationOptions< + { + updateViewGrant: { + viewGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + viewGrantPatch: ViewGrantPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateViewGrant: { + viewGrant: InferSelectResult; + }; + }, + Error, + { + id: string; + viewGrantPatch: ViewGrantPatch; + } +>; +export function useUpdateViewGrantMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + viewGrantPatch: ViewGrantPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewGrantMutationKeys.all, - mutationFn: ({ - id, - viewGrantPatch - }: { - id: string; - viewGrantPatch: ViewGrantPatch; - }) => getClient().viewGrant.update({ - where: { - id - }, - data: viewGrantPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, viewGrantPatch }: { id: string; viewGrantPatch: ViewGrantPatch }) => + getClient() + .viewGrant.update({ + where: { + id, + }, + data: viewGrantPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: viewGrantKeys.detail(variables.id) + queryKey: viewGrantKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: viewGrantKeys.lists() + queryKey: viewGrantKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewMutation.ts index 6dfd042357..2d396a0593 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewMutation.ts @@ -4,83 +4,99 @@ * 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 { viewKeys } from "../query-keys"; -import { viewMutationKeys } from "../mutation-keys"; -import type { ViewSelect, ViewWithRelations, ViewPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewSelect, ViewWithRelations, ViewPatch } from "../../orm/input-types"; +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 { viewKeys } from '../query-keys'; +import { viewMutationKeys } from '../mutation-keys'; +import type { ViewSelect, ViewWithRelations, ViewPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewSelect, ViewWithRelations, ViewPatch } from '../../orm/input-types'; /** * Mutation hook for updating a View - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateViewMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', viewPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateViewMutation(params: { - selection: ({ - fields: S & ViewSelect; - } & HookStrictSelect, ViewSelect>); -} & Omit; - }; -}, Error, { - id: string; - viewPatch: ViewPatch; -}>, "mutationFn">): UseMutationResult<{ - updateView: { - view: InferSelectResult; - }; -}, Error, { - id: string; - viewPatch: ViewPatch; -}>; -export function useUpdateViewMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateViewMutation( + params: { + selection: { + fields: S & ViewSelect; + } & HookStrictSelect, ViewSelect>; + } & Omit< + UseMutationOptions< + { + updateView: { + view: InferSelectResult; + }; + }, + Error, + { + id: string; + viewPatch: ViewPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateView: { + view: InferSelectResult; + }; + }, + Error, + { + id: string; + viewPatch: ViewPatch; + } +>; +export function useUpdateViewMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + viewPatch: ViewPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewMutationKeys.all, - mutationFn: ({ - id, - viewPatch - }: { - id: string; - viewPatch: ViewPatch; - }) => getClient().view.update({ - where: { - id - }, - data: viewPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, viewPatch }: { id: string; viewPatch: ViewPatch }) => + getClient() + .view.update({ + where: { + id, + }, + data: viewPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: viewKeys.detail(variables.id) + queryKey: viewKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: viewKeys.lists() + queryKey: viewKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewRuleMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewRuleMutation.ts index 54e8ae38b4..4c1df0db5c 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewRuleMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewRuleMutation.ts @@ -4,83 +4,99 @@ * 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 { viewRuleKeys } from "../query-keys"; -import { viewRuleMutationKeys } from "../mutation-keys"; -import type { ViewRuleSelect, ViewRuleWithRelations, ViewRulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewRuleSelect, ViewRuleWithRelations, ViewRulePatch } from "../../orm/input-types"; +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 { viewRuleKeys } from '../query-keys'; +import { viewRuleMutationKeys } from '../mutation-keys'; +import type { ViewRuleSelect, ViewRuleWithRelations, ViewRulePatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewRuleSelect, ViewRuleWithRelations, ViewRulePatch } from '../../orm/input-types'; /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateViewRuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', viewRulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateViewRuleMutation(params: { - selection: ({ - fields: S & ViewRuleSelect; - } & HookStrictSelect, ViewRuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - viewRulePatch: ViewRulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateViewRule: { - viewRule: InferSelectResult; - }; -}, Error, { - id: string; - viewRulePatch: ViewRulePatch; -}>; -export function useUpdateViewRuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateViewRuleMutation( + params: { + selection: { + fields: S & ViewRuleSelect; + } & HookStrictSelect, ViewRuleSelect>; + } & Omit< + UseMutationOptions< + { + updateViewRule: { + viewRule: InferSelectResult; + }; + }, + Error, + { + id: string; + viewRulePatch: ViewRulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateViewRule: { + viewRule: InferSelectResult; + }; + }, + Error, + { + id: string; + viewRulePatch: ViewRulePatch; + } +>; +export function useUpdateViewRuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + viewRulePatch: ViewRulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewRuleMutationKeys.all, - mutationFn: ({ - id, - viewRulePatch - }: { - id: string; - viewRulePatch: ViewRulePatch; - }) => getClient().viewRule.update({ - where: { - id - }, - data: viewRulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, viewRulePatch }: { id: string; viewRulePatch: ViewRulePatch }) => + getClient() + .viewRule.update({ + where: { + id, + }, + data: viewRulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: viewRuleKeys.detail(variables.id) + queryKey: viewRuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: viewRuleKeys.lists() + queryKey: viewRuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewTableMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewTableMutation.ts index 77da8b82a3..34b1f03014 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewTableMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateViewTableMutation.ts @@ -4,83 +4,107 @@ * 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 { viewTableKeys } from "../query-keys"; -import { viewTableMutationKeys } from "../mutation-keys"; -import type { ViewTableSelect, ViewTableWithRelations, ViewTablePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewTableSelect, ViewTableWithRelations, ViewTablePatch } from "../../orm/input-types"; +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 { viewTableKeys } from '../query-keys'; +import { viewTableMutationKeys } from '../mutation-keys'; +import type { + ViewTableSelect, + ViewTableWithRelations, + ViewTablePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ViewTableSelect, + ViewTableWithRelations, + ViewTablePatch, +} from '../../orm/input-types'; /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateViewTableMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', viewTablePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateViewTableMutation(params: { - selection: ({ - fields: S & ViewTableSelect; - } & HookStrictSelect, ViewTableSelect>); -} & Omit; - }; -}, Error, { - id: string; - viewTablePatch: ViewTablePatch; -}>, "mutationFn">): UseMutationResult<{ - updateViewTable: { - viewTable: InferSelectResult; - }; -}, Error, { - id: string; - viewTablePatch: ViewTablePatch; -}>; -export function useUpdateViewTableMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateViewTableMutation( + params: { + selection: { + fields: S & ViewTableSelect; + } & HookStrictSelect, ViewTableSelect>; + } & Omit< + UseMutationOptions< + { + updateViewTable: { + viewTable: InferSelectResult; + }; + }, + Error, + { + id: string; + viewTablePatch: ViewTablePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateViewTable: { + viewTable: InferSelectResult; + }; + }, + Error, + { + id: string; + viewTablePatch: ViewTablePatch; + } +>; +export function useUpdateViewTableMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + viewTablePatch: ViewTablePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: viewTableMutationKeys.all, - mutationFn: ({ - id, - viewTablePatch - }: { - id: string; - viewTablePatch: ViewTablePatch; - }) => getClient().viewTable.update({ - where: { - id - }, - data: viewTablePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, viewTablePatch }: { id: string; viewTablePatch: ViewTablePatch }) => + getClient() + .viewTable.update({ + where: { + id, + }, + data: viewTablePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: viewTableKeys.detail(variables.id) + queryKey: viewTableKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: viewTableKeys.lists() + queryKey: viewTableKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/mutations/useUpdateWebauthnSettingMutation.ts b/sdk/constructive-react/src/api/hooks/mutations/useUpdateWebauthnSettingMutation.ts index 71e4c42975..18d606b93e 100644 --- a/sdk/constructive-react/src/api/hooks/mutations/useUpdateWebauthnSettingMutation.ts +++ b/sdk/constructive-react/src/api/hooks/mutations/useUpdateWebauthnSettingMutation.ts @@ -4,83 +4,113 @@ * 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 { webauthnSettingKeys } from "../query-keys"; -import { webauthnSettingMutationKeys } from "../mutation-keys"; -import type { WebauthnSettingSelect, WebauthnSettingWithRelations, WebauthnSettingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnSettingSelect, WebauthnSettingWithRelations, WebauthnSettingPatch } from "../../orm/input-types"; +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 { webauthnSettingKeys } from '../query-keys'; +import { webauthnSettingMutationKeys } from '../mutation-keys'; +import type { + WebauthnSettingSelect, + WebauthnSettingWithRelations, + WebauthnSettingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnSettingSelect, + WebauthnSettingWithRelations, + WebauthnSettingPatch, +} from '../../orm/input-types'; /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateWebauthnSettingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', webauthnSettingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateWebauthnSettingMutation(params: { - selection: ({ - fields: S & WebauthnSettingSelect; - } & HookStrictSelect, WebauthnSettingSelect>); -} & Omit; - }; -}, Error, { - id: string; - webauthnSettingPatch: WebauthnSettingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateWebauthnSetting: { - webauthnSetting: InferSelectResult; - }; -}, Error, { - id: string; - webauthnSettingPatch: WebauthnSettingPatch; -}>; -export function useUpdateWebauthnSettingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateWebauthnSettingMutation( + params: { + selection: { + fields: S & WebauthnSettingSelect; + } & HookStrictSelect, WebauthnSettingSelect>; + } & Omit< + UseMutationOptions< + { + updateWebauthnSetting: { + webauthnSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + webauthnSettingPatch: WebauthnSettingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateWebauthnSetting: { + webauthnSetting: InferSelectResult; + }; + }, + Error, + { + id: string; + webauthnSettingPatch: WebauthnSettingPatch; + } +>; +export function useUpdateWebauthnSettingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + webauthnSettingPatch: WebauthnSettingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnSettingMutationKeys.all, mutationFn: ({ id, - webauthnSettingPatch + webauthnSettingPatch, }: { id: string; webauthnSettingPatch: WebauthnSettingPatch; - }) => getClient().webauthnSetting.update({ - where: { - id - }, - data: webauthnSettingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .webauthnSetting.update({ + where: { + id, + }, + data: webauthnSettingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: webauthnSettingKeys.detail(variables.id) + queryKey: webauthnSettingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webauthnSettingKeys.lists() + queryKey: webauthnSettingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/index.ts b/sdk/constructive-react/src/api/hooks/queries/index.ts index 9e7da94ea5..9d17391987 100644 --- a/sdk/constructive-react/src/api/hooks/queries/index.ts +++ b/sdk/constructive-react/src/api/hooks/queries/index.ts @@ -3,137 +3,137 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useApisQuery"; -export * from "./useApiQuery"; -export * from "./useApiModulesQuery"; -export * from "./useApiModuleQuery"; -export * from "./useApiSchemasQuery"; -export * from "./useApiSchemaQuery"; -export * from "./useApiSettingsQuery"; -export * from "./useApiSettingQuery"; -export * from "./useAstMigrationsQuery"; -export * from "./useAstMigrationQuery"; -export * from "./useCheckConstraintsQuery"; -export * from "./useCheckConstraintQuery"; -export * from "./useCompositeTypesQuery"; -export * from "./useCompositeTypeQuery"; -export * from "./useCorsSettingsQuery"; -export * from "./useCorsSettingQuery"; -export * from "./useDatabasesQuery"; -export * from "./useDatabaseQuery"; -export * from "./useDatabaseSettingsQuery"; -export * from "./useDatabaseSettingQuery"; -export * from "./useDatabaseTransfersQuery"; -export * from "./useDatabaseTransferQuery"; -export * from "./useDefaultPrivilegesQuery"; -export * from "./useDefaultPrivilegeQuery"; -export * from "./useDomainsQuery"; -export * from "./useDomainQuery"; -export * from "./useDomainEventsQuery"; -export * from "./useDomainEventQuery"; -export * from "./useDomainVerificationsQuery"; -export * from "./useDomainVerificationQuery"; -export * from "./useEmbeddingChunksQuery"; -export * from "./useEmbeddingChunkQuery"; -export * from "./useEnumsQuery"; -export * from "./useEnumQuery"; -export * from "./useExclusionConstraintsQuery"; -export * from "./useExclusionConstraintQuery"; -export * from "./useFieldsQuery"; -export * from "./useFieldQuery"; -export * from "./useForeignKeyConstraintsQuery"; -export * from "./useForeignKeyConstraintQuery"; -export * from "./useFullTextSearchesQuery"; -export * from "./useFullTextSearchQuery"; -export * from "./useFunctionsQuery"; -export * from "./useFunctionQuery"; -export * from "./useHostnameBindingsQuery"; -export * from "./useHostnameBindingQuery"; -export * from "./useHttpRoutesQuery"; -export * from "./useHttpRouteQuery"; -export * from "./useIndicesQuery"; -export * from "./useIndexQuery"; -export * from "./useManagedDomainsQuery"; -export * from "./useManagedDomainQuery"; -export * from "./useNodeTypeRegistriesQuery"; -export * from "./useNodeTypeRegistryQuery"; -export * from "./usePartitionsQuery"; -export * from "./usePartitionQuery"; -export * from "./usePlatformApisQuery"; -export * from "./usePlatformApiQuery"; -export * from "./usePlatformApiModulesQuery"; -export * from "./usePlatformApiModuleQuery"; -export * from "./usePlatformApiSchemasQuery"; -export * from "./usePlatformApiSchemaQuery"; -export * from "./usePlatformApiSettingsQuery"; -export * from "./usePlatformApiSettingQuery"; -export * from "./usePlatformCorsSettingsQuery"; -export * from "./usePlatformCorsSettingQuery"; -export * from "./usePlatformDomainsQuery"; -export * from "./usePlatformDomainQuery"; -export * from "./usePlatformDomainEventsQuery"; -export * from "./usePlatformDomainEventQuery"; -export * from "./usePlatformDomainVerificationsQuery"; -export * from "./usePlatformDomainVerificationQuery"; -export * from "./usePlatformManagedDomainsQuery"; -export * from "./usePlatformManagedDomainQuery"; -export * from "./usePlatformSitesQuery"; -export * from "./usePlatformSiteQuery"; -export * from "./usePlatformSiteMetadataQuery"; -export * from "./usePlatformSiteMetadatumQuery"; -export * from "./usePlatformSiteModulesQuery"; -export * from "./usePlatformSiteModuleQuery"; -export * from "./usePlatformSiteThemesQuery"; -export * from "./usePlatformSiteThemeQuery"; -export * from "./usePoliciesQuery"; -export * from "./usePolicyQuery"; -export * from "./usePrimaryKeyConstraintsQuery"; -export * from "./usePrimaryKeyConstraintQuery"; -export * from "./usePubkeySettingsQuery"; -export * from "./usePubkeySettingQuery"; -export * from "./useRlsSettingsQuery"; -export * from "./useRlsSettingQuery"; -export * from "./useRouteBindingsQuery"; -export * from "./useRouteBindingQuery"; -export * from "./useRoutesQuery"; -export * from "./useRouteQuery"; -export * from "./useSchemasQuery"; -export * from "./useSchemaQuery"; -export * from "./useSchemaGrantsQuery"; -export * from "./useSchemaGrantQuery"; -export * from "./useSitesQuery"; -export * from "./useSiteQuery"; -export * from "./useSiteMetadataQuery"; -export * from "./useSiteMetadatumQuery"; -export * from "./useSiteModulesQuery"; -export * from "./useSiteModuleQuery"; -export * from "./useSiteThemesQuery"; -export * from "./useSiteThemeQuery"; -export * from "./useSpatialRelationsQuery"; -export * from "./useSpatialRelationQuery"; -export * from "./useSqlActionsQuery"; -export * from "./useSqlActionQuery"; -export * from "./useTablesQuery"; -export * from "./useTableQuery"; -export * from "./useTableGrantsQuery"; -export * from "./useTableGrantQuery"; -export * from "./useTriggersQuery"; -export * from "./useTriggerQuery"; -export * from "./useTriggerFunctionsQuery"; -export * from "./useTriggerFunctionQuery"; -export * from "./useUniqueConstraintsQuery"; -export * from "./useUniqueConstraintQuery"; -export * from "./useViewsQuery"; -export * from "./useViewQuery"; -export * from "./useViewGrantsQuery"; -export * from "./useViewGrantQuery"; -export * from "./useViewRulesQuery"; -export * from "./useViewRuleQuery"; -export * from "./useViewTablesQuery"; -export * from "./useViewTableQuery"; -export * from "./useWebauthnSettingsQuery"; -export * from "./useWebauthnSettingQuery"; -export * from "./useApiSchemaNamesQuery"; -export * from "./useApplyRegistryDefaultsQuery"; -export * from "./useResolveHttpRouteQuery"; -export * from "./useResolveRouteQuery"; \ No newline at end of file +export * from './useApisQuery'; +export * from './useApiQuery'; +export * from './useApiModulesQuery'; +export * from './useApiModuleQuery'; +export * from './useApiSchemasQuery'; +export * from './useApiSchemaQuery'; +export * from './useApiSettingsQuery'; +export * from './useApiSettingQuery'; +export * from './useAstMigrationsQuery'; +export * from './useAstMigrationQuery'; +export * from './useCheckConstraintsQuery'; +export * from './useCheckConstraintQuery'; +export * from './useCompositeTypesQuery'; +export * from './useCompositeTypeQuery'; +export * from './useCorsSettingsQuery'; +export * from './useCorsSettingQuery'; +export * from './useDatabasesQuery'; +export * from './useDatabaseQuery'; +export * from './useDatabaseSettingsQuery'; +export * from './useDatabaseSettingQuery'; +export * from './useDatabaseTransfersQuery'; +export * from './useDatabaseTransferQuery'; +export * from './useDefaultPrivilegesQuery'; +export * from './useDefaultPrivilegeQuery'; +export * from './useDomainsQuery'; +export * from './useDomainQuery'; +export * from './useDomainEventsQuery'; +export * from './useDomainEventQuery'; +export * from './useDomainVerificationsQuery'; +export * from './useDomainVerificationQuery'; +export * from './useEmbeddingChunksQuery'; +export * from './useEmbeddingChunkQuery'; +export * from './useEnumsQuery'; +export * from './useEnumQuery'; +export * from './useExclusionConstraintsQuery'; +export * from './useExclusionConstraintQuery'; +export * from './useFieldsQuery'; +export * from './useFieldQuery'; +export * from './useForeignKeyConstraintsQuery'; +export * from './useForeignKeyConstraintQuery'; +export * from './useFullTextSearchesQuery'; +export * from './useFullTextSearchQuery'; +export * from './useFunctionsQuery'; +export * from './useFunctionQuery'; +export * from './useHostnameBindingsQuery'; +export * from './useHostnameBindingQuery'; +export * from './useHttpRoutesQuery'; +export * from './useHttpRouteQuery'; +export * from './useIndicesQuery'; +export * from './useIndexQuery'; +export * from './useManagedDomainsQuery'; +export * from './useManagedDomainQuery'; +export * from './useNodeTypeRegistriesQuery'; +export * from './useNodeTypeRegistryQuery'; +export * from './usePartitionsQuery'; +export * from './usePartitionQuery'; +export * from './usePlatformApisQuery'; +export * from './usePlatformApiQuery'; +export * from './usePlatformApiModulesQuery'; +export * from './usePlatformApiModuleQuery'; +export * from './usePlatformApiSchemasQuery'; +export * from './usePlatformApiSchemaQuery'; +export * from './usePlatformApiSettingsQuery'; +export * from './usePlatformApiSettingQuery'; +export * from './usePlatformCorsSettingsQuery'; +export * from './usePlatformCorsSettingQuery'; +export * from './usePlatformDomainsQuery'; +export * from './usePlatformDomainQuery'; +export * from './usePlatformDomainEventsQuery'; +export * from './usePlatformDomainEventQuery'; +export * from './usePlatformDomainVerificationsQuery'; +export * from './usePlatformDomainVerificationQuery'; +export * from './usePlatformManagedDomainsQuery'; +export * from './usePlatformManagedDomainQuery'; +export * from './usePlatformSitesQuery'; +export * from './usePlatformSiteQuery'; +export * from './usePlatformSiteMetadataQuery'; +export * from './usePlatformSiteMetadatumQuery'; +export * from './usePlatformSiteModulesQuery'; +export * from './usePlatformSiteModuleQuery'; +export * from './usePlatformSiteThemesQuery'; +export * from './usePlatformSiteThemeQuery'; +export * from './usePoliciesQuery'; +export * from './usePolicyQuery'; +export * from './usePrimaryKeyConstraintsQuery'; +export * from './usePrimaryKeyConstraintQuery'; +export * from './usePubkeySettingsQuery'; +export * from './usePubkeySettingQuery'; +export * from './useRlsSettingsQuery'; +export * from './useRlsSettingQuery'; +export * from './useRouteBindingsQuery'; +export * from './useRouteBindingQuery'; +export * from './useRoutesQuery'; +export * from './useRouteQuery'; +export * from './useSchemasQuery'; +export * from './useSchemaQuery'; +export * from './useSchemaGrantsQuery'; +export * from './useSchemaGrantQuery'; +export * from './useSitesQuery'; +export * from './useSiteQuery'; +export * from './useSiteMetadataQuery'; +export * from './useSiteMetadatumQuery'; +export * from './useSiteModulesQuery'; +export * from './useSiteModuleQuery'; +export * from './useSiteThemesQuery'; +export * from './useSiteThemeQuery'; +export * from './useSpatialRelationsQuery'; +export * from './useSpatialRelationQuery'; +export * from './useSqlActionsQuery'; +export * from './useSqlActionQuery'; +export * from './useTablesQuery'; +export * from './useTableQuery'; +export * from './useTableGrantsQuery'; +export * from './useTableGrantQuery'; +export * from './useTriggersQuery'; +export * from './useTriggerQuery'; +export * from './useTriggerFunctionsQuery'; +export * from './useTriggerFunctionQuery'; +export * from './useUniqueConstraintsQuery'; +export * from './useUniqueConstraintQuery'; +export * from './useViewsQuery'; +export * from './useViewQuery'; +export * from './useViewGrantsQuery'; +export * from './useViewGrantQuery'; +export * from './useViewRulesQuery'; +export * from './useViewRuleQuery'; +export * from './useViewTablesQuery'; +export * from './useViewTableQuery'; +export * from './useWebauthnSettingsQuery'; +export * from './useWebauthnSettingQuery'; +export * from './useApiSchemaNamesQuery'; +export * from './useApplyRegistryDefaultsQuery'; +export * from './useResolveHttpRouteQuery'; +export * from './useResolveRouteQuery'; diff --git a/sdk/constructive-react/src/api/hooks/queries/useApiModuleQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApiModuleQuery.ts index 224b99ede8..94e8a8646e 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApiModuleQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApiModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { apiModuleKeys } from "../query-keys"; -import type { ApiModuleSelect, ApiModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiModuleSelect, ApiModuleWithRelations } from "../../orm/input-types"; +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 { apiModuleKeys } from '../query-keys'; +import type { ApiModuleSelect, ApiModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiModuleSelect, ApiModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiModuleQueryKey = apiModuleKeys.detail; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { data, isLoading } = useApiModuleQuery({ @@ -26,38 +26,52 @@ export const apiModuleQueryKey = apiModuleKeys.detail; * }); * ``` */ -export function useApiModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useApiModuleQuery< + S extends ApiModuleSelect, + TData = { + apiModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiModuleSelect>; + } & Omit< + UseQueryOptions< + { + apiModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiModuleKeys.detail(params.id), - queryFn: () => getClient().apiModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .apiModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```ts * const data = await fetchApiModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchApiModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().apiModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .apiModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```ts * await prefetchApiModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchApiModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiModuleSelect>; -}): Promise; -export async function prefetchApiModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchApiModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiModuleSelect>; + } +): Promise; +export async function prefetchApiModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: apiModuleKeys.detail(params.id), - queryFn: () => getClient().apiModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .apiModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApiModulesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApiModulesQuery.ts index 1a55f1b4a0..1c4ad91d90 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApiModulesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApiModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { apiModuleKeys } from "../query-keys"; -import type { ApiModuleSelect, ApiModuleWithRelations, ApiModuleFilter, ApiModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiModuleSelect, ApiModuleWithRelations, ApiModuleFilter, ApiModuleOrderBy } from "../../orm/input-types"; +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 { apiModuleKeys } from '../query-keys'; +import type { + ApiModuleSelect, + ApiModuleWithRelations, + ApiModuleFilter, + ApiModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ApiModuleSelect, + ApiModuleWithRelations, + ApiModuleFilter, + ApiModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiModulesQueryKey = apiModuleKeys.list; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { data, isLoading } = useApiModulesQuery({ @@ -30,33 +45,47 @@ export const apiModulesQueryKey = apiModuleKeys.list; * }); * ``` */ -export function useApiModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useApiModulesQuery< + S extends ApiModuleSelect, + TData = { + apiModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiModuleSelect>; + } & Omit< + UseQueryOptions< + { + apiModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiModuleKeys.list(args), queryFn: () => getClient().apiModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```ts * const data = await fetchApiModulesQuery({ @@ -70,35 +99,47 @@ export function useApiModulesQuery(params: { export async function fetchApiModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ApiModuleSelect>; }): Promise<{ apiModules: ConnectionResult>; }>; export async function fetchApiModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().apiModule.findMany(args).unwrap(); } /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```ts * await prefetchApiModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchApiModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiModuleSelect>; -}): Promise; -export async function prefetchApiModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchApiModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiModuleSelect>; + } +): Promise; +export async function prefetchApiModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: apiModuleKeys.list(args), - queryFn: () => getClient().apiModule.findMany(args).unwrap() + queryFn: () => getClient().apiModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApiQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApiQuery.ts index f6a0042476..f7c45a4c09 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApiQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApiQuery.ts @@ -4,20 +4,20 @@ * 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 { apiKeys } from "../query-keys"; -import type { ApiSelect, ApiWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSelect, ApiWithRelations } from "../../orm/input-types"; +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 { apiKeys } from '../query-keys'; +import type { ApiSelect, ApiWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSelect, ApiWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiQueryKey = apiKeys.detail; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { data, isLoading } = useApiQuery({ @@ -26,38 +26,52 @@ export const apiQueryKey = apiKeys.detail; * }); * ``` */ -export function useApiQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useApiQuery< + S extends ApiSelect, + TData = { + api: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiSelect>; + } & Omit< + UseQueryOptions< + { + api: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiKeys.detail(params.id), - queryFn: () => getClient().api.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .api.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * const data = await fetchApiQuery({ @@ -79,35 +93,46 @@ export async function fetchApiQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().api.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .api.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * await prefetchApiQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchApiQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiSelect>; -}): Promise; -export async function prefetchApiQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchApiQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiSelect>; + } +): Promise; +export async function prefetchApiQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: apiKeys.detail(params.id), - queryFn: () => getClient().api.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .api.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApiSchemaNamesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApiSchemaNamesQuery.ts index 2528c1ad89..1d45b38894 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApiSchemaNamesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApiSchemaNamesQuery.ts @@ -4,82 +4,102 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { ApiSchemaNamesVariables } from "../../orm/query"; -export type { ApiSchemaNamesVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { ApiSchemaNamesVariables } from '../../orm/query'; +export type { ApiSchemaNamesVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const apiSchemaNamesQueryKey = customQueryKeys.apiSchemaNames; /** * Query hook for apiSchemaNames - * + * * @example * ```tsx * const { data, isLoading } = useApiSchemaNamesQuery({ variables: { targetApiId } }); - * + * * if (data?.apiSchemaNames) { * console.log(data.apiSchemaNames); * } * ``` */ -export function useApiSchemaNamesQuery(params?: { - variables?: ApiSchemaNamesVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useApiSchemaNamesQuery(params?: { - variables?: ApiSchemaNamesVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useApiSchemaNamesQuery< + TData = { + apiSchemaNames: unknown | null; + }, +>( + params?: { + variables?: ApiSchemaNamesVariables; + } & Omit< + UseQueryOptions< + { + apiSchemaNames: unknown | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiSchemaNamesQuery< + TData = { + apiSchemaNames: unknown | null; + }, +>( + params?: { + variables?: ApiSchemaNamesVariables; + } & Omit< + UseQueryOptions< + { + apiSchemaNames: unknown | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: apiSchemaNamesQueryKey(variables), queryFn: () => getClient().query.apiSchemaNames(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch apiSchemaNames without React hooks - * + * * @example * ```ts * const data = await fetchApiSchemaNamesQuery({ variables: { targetApiId } }); * ``` */ -export async function fetchApiSchemaNamesQuery(params?: { - variables?: ApiSchemaNamesVariables; -}) { +export async function fetchApiSchemaNamesQuery(params?: { variables?: ApiSchemaNamesVariables }) { const variables = params?.variables ?? {}; return getClient().query.apiSchemaNames(variables).unwrap(); } /** * Prefetch apiSchemaNames for SSR or cache warming - * + * * @example * ```ts * await prefetchApiSchemaNamesQuery(queryClient, { variables: { targetApiId } }); * ``` */ -export async function prefetchApiSchemaNamesQuery(queryClient: QueryClient, params?: { - variables?: ApiSchemaNamesVariables; -}): Promise { +export async function prefetchApiSchemaNamesQuery( + queryClient: QueryClient, + params?: { + variables?: ApiSchemaNamesVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: apiSchemaNamesQueryKey(variables), - queryFn: () => getClient().query.apiSchemaNames(variables).unwrap() + queryFn: () => getClient().query.apiSchemaNames(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApiSchemaQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApiSchemaQuery.ts index 392097392c..7f7d4d992a 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApiSchemaQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApiSchemaQuery.ts @@ -4,20 +4,20 @@ * 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 { apiSchemaKeys } from "../query-keys"; -import type { ApiSchemaSelect, ApiSchemaWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSchemaSelect, ApiSchemaWithRelations } from "../../orm/input-types"; +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 { apiSchemaKeys } from '../query-keys'; +import type { ApiSchemaSelect, ApiSchemaWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSchemaSelect, ApiSchemaWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiSchemaQueryKey = apiSchemaKeys.detail; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { data, isLoading } = useApiSchemaQuery({ @@ -26,38 +26,52 @@ export const apiSchemaQueryKey = apiSchemaKeys.detail; * }); * ``` */ -export function useApiSchemaQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiSchemaSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiSchemaQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useApiSchemaQuery< + S extends ApiSchemaSelect, + TData = { + apiSchema: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiSchemaSelect>; + } & Omit< + UseQueryOptions< + { + apiSchema: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiSchemaQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiSchemaKeys.detail(params.id), - queryFn: () => getClient().apiSchema.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .apiSchema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```ts * const data = await fetchApiSchemaQuery({ @@ -79,35 +93,46 @@ export async function fetchApiSchemaQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().apiSchema.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .apiSchema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```ts * await prefetchApiSchemaQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchApiSchemaQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiSchemaSelect>; -}): Promise; -export async function prefetchApiSchemaQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchApiSchemaQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiSchemaSelect>; + } +): Promise; +export async function prefetchApiSchemaQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: apiSchemaKeys.detail(params.id), - queryFn: () => getClient().apiSchema.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .apiSchema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApiSchemasQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApiSchemasQuery.ts index 4c6f68c06e..bd9a28f5ba 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApiSchemasQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApiSchemasQuery.ts @@ -4,20 +4,35 @@ * 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 { apiSchemaKeys } from "../query-keys"; -import type { ApiSchemaSelect, ApiSchemaWithRelations, ApiSchemaFilter, ApiSchemaOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSchemaSelect, ApiSchemaWithRelations, ApiSchemaFilter, ApiSchemaOrderBy } from "../../orm/input-types"; +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 { apiSchemaKeys } from '../query-keys'; +import type { + ApiSchemaSelect, + ApiSchemaWithRelations, + ApiSchemaFilter, + ApiSchemaOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ApiSchemaSelect, + ApiSchemaWithRelations, + ApiSchemaFilter, + ApiSchemaOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiSchemasQueryKey = apiSchemaKeys.list; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { data, isLoading } = useApiSchemasQuery({ @@ -30,33 +45,47 @@ export const apiSchemasQueryKey = apiSchemaKeys.list; * }); * ``` */ -export function useApiSchemasQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSchemaSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiSchemasQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useApiSchemasQuery< + S extends ApiSchemaSelect, + TData = { + apiSchemas: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiSchemaSelect>; + } & Omit< + UseQueryOptions< + { + apiSchemas: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiSchemasQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiSchemaKeys.list(args), queryFn: () => getClient().apiSchema.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```ts * const data = await fetchApiSchemasQuery({ @@ -70,35 +99,47 @@ export function useApiSchemasQuery(params: { export async function fetchApiSchemasQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSchemaSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ApiSchemaSelect>; }): Promise<{ apiSchemas: ConnectionResult>; }>; export async function fetchApiSchemasQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().apiSchema.findMany(args).unwrap(); } /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```ts * await prefetchApiSchemasQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchApiSchemasQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSchemaSelect>; -}): Promise; -export async function prefetchApiSchemasQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchApiSchemasQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiSchemaSelect>; + } +): Promise; +export async function prefetchApiSchemasQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: apiSchemaKeys.list(args), - queryFn: () => getClient().apiSchema.findMany(args).unwrap() + queryFn: () => getClient().apiSchema.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApiSettingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApiSettingQuery.ts index 4ebf27223f..674ac430d4 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApiSettingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApiSettingQuery.ts @@ -4,20 +4,20 @@ * 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 { apiSettingKeys } from "../query-keys"; -import type { ApiSettingSelect, ApiSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSettingSelect, ApiSettingWithRelations } from "../../orm/input-types"; +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 { apiSettingKeys } from '../query-keys'; +import type { ApiSettingSelect, ApiSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSettingSelect, ApiSettingWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiSettingQueryKey = apiSettingKeys.detail; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { data, isLoading } = useApiSettingQuery({ @@ -26,38 +26,52 @@ export const apiSettingQueryKey = apiSettingKeys.detail; * }); * ``` */ -export function useApiSettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiSettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiSettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useApiSettingQuery< + S extends ApiSettingSelect, + TData = { + apiSetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiSettingSelect>; + } & Omit< + UseQueryOptions< + { + apiSetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiSettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiSettingKeys.detail(params.id), - queryFn: () => getClient().apiSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .apiSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```ts * const data = await fetchApiSettingQuery({ @@ -79,35 +93,46 @@ export async function fetchApiSettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().apiSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .apiSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```ts * await prefetchApiSettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchApiSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiSettingSelect>; -}): Promise; -export async function prefetchApiSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchApiSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiSettingSelect>; + } +): Promise; +export async function prefetchApiSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: apiSettingKeys.detail(params.id), - queryFn: () => getClient().apiSetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .apiSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApiSettingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApiSettingsQuery.ts index 8777f2ca3f..da0bec63d6 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApiSettingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApiSettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { apiSettingKeys } from "../query-keys"; -import type { ApiSettingSelect, ApiSettingWithRelations, ApiSettingFilter, ApiSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSettingSelect, ApiSettingWithRelations, ApiSettingFilter, ApiSettingOrderBy } from "../../orm/input-types"; +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 { apiSettingKeys } from '../query-keys'; +import type { + ApiSettingSelect, + ApiSettingWithRelations, + ApiSettingFilter, + ApiSettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ApiSettingSelect, + ApiSettingWithRelations, + ApiSettingFilter, + ApiSettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiSettingsQueryKey = apiSettingKeys.list; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { data, isLoading } = useApiSettingsQuery({ @@ -30,33 +45,47 @@ export const apiSettingsQueryKey = apiSettingKeys.list; * }); * ``` */ -export function useApiSettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiSettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useApiSettingsQuery< + S extends ApiSettingSelect, + TData = { + apiSettings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiSettingSelect>; + } & Omit< + UseQueryOptions< + { + apiSettings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiSettingsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiSettingKeys.list(args), queryFn: () => getClient().apiSetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```ts * const data = await fetchApiSettingsQuery({ @@ -70,35 +99,47 @@ export function useApiSettingsQuery(params: { export async function fetchApiSettingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSettingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ApiSettingSelect>; }): Promise<{ apiSettings: ConnectionResult>; }>; export async function fetchApiSettingsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().apiSetting.findMany(args).unwrap(); } /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```ts * await prefetchApiSettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchApiSettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSettingSelect>; -}): Promise; -export async function prefetchApiSettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchApiSettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiSettingSelect>; + } +): Promise; +export async function prefetchApiSettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: apiSettingKeys.list(args), - queryFn: () => getClient().apiSetting.findMany(args).unwrap() + queryFn: () => getClient().apiSetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApisQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApisQuery.ts index b21ac778c6..1109f42993 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApisQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApisQuery.ts @@ -4,20 +4,25 @@ * 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 { apiKeys } from "../query-keys"; -import type { ApiSelect, ApiWithRelations, ApiFilter, ApiOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSelect, ApiWithRelations, ApiFilter, ApiOrderBy } from "../../orm/input-types"; +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 { apiKeys } from '../query-keys'; +import type { ApiSelect, ApiWithRelations, ApiFilter, ApiOrderBy } from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { ApiSelect, ApiWithRelations, ApiFilter, ApiOrderBy } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apisQueryKey = apiKeys.list; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { data, isLoading } = useApisQuery({ @@ -30,33 +35,45 @@ export const apisQueryKey = apiKeys.list; * }); * ``` */ -export function useApisQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApisQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useApisQuery< + S extends ApiSelect, + TData = { + apis: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiSelect>; + } & Omit< + UseQueryOptions< + { + apis: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApisQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiKeys.list(args), queryFn: () => getClient().api.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * const data = await fetchApisQuery({ @@ -70,7 +87,8 @@ export function useApisQuery(params: { export async function fetchApisQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ApiSelect>; }): Promise<{ apis: ConnectionResult>; }>; @@ -82,23 +100,30 @@ export async function fetchApisQuery(params: { } /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * await prefetchApisQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchApisQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSelect>; -}): Promise; -export async function prefetchApisQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchApisQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiSelect>; + } +): Promise; +export async function prefetchApisQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: apiKeys.list(args), - queryFn: () => getClient().api.findMany(args).unwrap() + queryFn: () => getClient().api.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useApplyRegistryDefaultsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useApplyRegistryDefaultsQuery.ts index eec9a7c11e..ec2d0c9449 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useApplyRegistryDefaultsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useApplyRegistryDefaultsQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { ApplyRegistryDefaultsVariables } from "../../orm/query"; -export type { ApplyRegistryDefaultsVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { ApplyRegistryDefaultsVariables } from '../../orm/query'; +export type { ApplyRegistryDefaultsVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const applyRegistryDefaultsQueryKey = customQueryKeys.applyRegistryDefaults; /** * Query hook for applyRegistryDefaults - * + * * @example * ```tsx * const { data, isLoading } = useApplyRegistryDefaultsQuery({ variables: { data, nodeType } }); - * + * * if (data?.applyRegistryDefaults) { * console.log(data.applyRegistryDefaults); * } * ``` */ -export function useApplyRegistryDefaultsQuery(params?: { - variables?: ApplyRegistryDefaultsVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useApplyRegistryDefaultsQuery(params?: { - variables?: ApplyRegistryDefaultsVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useApplyRegistryDefaultsQuery< + TData = { + applyRegistryDefaults: unknown | null; + }, +>( + params?: { + variables?: ApplyRegistryDefaultsVariables; + } & Omit< + UseQueryOptions< + { + applyRegistryDefaults: unknown | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApplyRegistryDefaultsQuery< + TData = { + applyRegistryDefaults: unknown | null; + }, +>( + params?: { + variables?: ApplyRegistryDefaultsVariables; + } & Omit< + UseQueryOptions< + { + applyRegistryDefaults: unknown | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: applyRegistryDefaultsQueryKey(variables), queryFn: () => getClient().query.applyRegistryDefaults(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch applyRegistryDefaults without React hooks - * + * * @example * ```ts * const data = await fetchApplyRegistryDefaultsQuery({ variables: { data, nodeType } }); @@ -68,18 +87,21 @@ export async function fetchApplyRegistryDefaultsQuery(params?: { } /** * Prefetch applyRegistryDefaults for SSR or cache warming - * + * * @example * ```ts * await prefetchApplyRegistryDefaultsQuery(queryClient, { variables: { data, nodeType } }); * ``` */ -export async function prefetchApplyRegistryDefaultsQuery(queryClient: QueryClient, params?: { - variables?: ApplyRegistryDefaultsVariables; -}): Promise { +export async function prefetchApplyRegistryDefaultsQuery( + queryClient: QueryClient, + params?: { + variables?: ApplyRegistryDefaultsVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: applyRegistryDefaultsQueryKey(variables), - queryFn: () => getClient().query.applyRegistryDefaults(variables).unwrap() + queryFn: () => getClient().query.applyRegistryDefaults(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useAstMigrationQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useAstMigrationQuery.ts index 5faeb19b30..ef2c2a95e3 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useAstMigrationQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useAstMigrationQuery.ts @@ -4,20 +4,20 @@ * 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 { astMigrationKeys } from "../query-keys"; -import type { AstMigrationSelect, AstMigrationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AstMigrationSelect, AstMigrationWithRelations } from "../../orm/input-types"; +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 { astMigrationKeys } from '../query-keys'; +import type { AstMigrationSelect, AstMigrationWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AstMigrationSelect, AstMigrationWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const astMigrationQueryKey = astMigrationKeys.detail; /** * Query hook for fetching a single AstMigration - * + * * @example * ```tsx * const { data, isLoading } = useAstMigrationQuery({ @@ -26,38 +26,52 @@ export const astMigrationQueryKey = astMigrationKeys.detail; * }); * ``` */ -export function useAstMigrationQuery | null; -}>(params: { - id: number; - selection: { - fields: S; - } & HookStrictSelect, AstMigrationSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAstMigrationQuery(params: { - id: number; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAstMigrationQuery< + S extends AstMigrationSelect, + TData = { + astMigration: InferSelectResult | null; + }, +>( + params: { + id: number; + selection: { + fields: S; + } & HookStrictSelect, AstMigrationSelect>; + } & Omit< + UseQueryOptions< + { + astMigration: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAstMigrationQuery( + params: { + id: number; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: astMigrationKeys.detail(params.id), - queryFn: () => getClient().astMigration.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .astMigration.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single AstMigration without React hooks - * + * * @example * ```ts * const data = await fetchAstMigrationQuery({ @@ -79,35 +93,46 @@ export async function fetchAstMigrationQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().astMigration.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .astMigration.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single AstMigration for SSR or cache warming - * + * * @example * ```ts * await prefetchAstMigrationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAstMigrationQuery(queryClient: QueryClient, params: { - id: number; - selection: { - fields: S; - } & HookStrictSelect, AstMigrationSelect>; -}): Promise; -export async function prefetchAstMigrationQuery(queryClient: QueryClient, params: { - id: number; - selection: SelectionConfig; -}): Promise { +export async function prefetchAstMigrationQuery( + queryClient: QueryClient, + params: { + id: number; + selection: { + fields: S; + } & HookStrictSelect, AstMigrationSelect>; + } +): Promise; +export async function prefetchAstMigrationQuery( + queryClient: QueryClient, + params: { + id: number; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: astMigrationKeys.detail(params.id), - queryFn: () => getClient().astMigration.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .astMigration.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useAstMigrationsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useAstMigrationsQuery.ts index 0b4261673f..d2f3812967 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useAstMigrationsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useAstMigrationsQuery.ts @@ -4,20 +4,35 @@ * 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 { astMigrationKeys } from "../query-keys"; -import type { AstMigrationSelect, AstMigrationWithRelations, AstMigrationFilter, AstMigrationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AstMigrationSelect, AstMigrationWithRelations, AstMigrationFilter, AstMigrationOrderBy } from "../../orm/input-types"; +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 { astMigrationKeys } from '../query-keys'; +import type { + AstMigrationSelect, + AstMigrationWithRelations, + AstMigrationFilter, + AstMigrationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AstMigrationSelect, + AstMigrationWithRelations, + AstMigrationFilter, + AstMigrationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const astMigrationsQueryKey = astMigrationKeys.list; /** * Query hook for fetching AstMigration list - * + * * @example * ```tsx * const { data, isLoading } = useAstMigrationsQuery({ @@ -30,33 +45,47 @@ export const astMigrationsQueryKey = astMigrationKeys.list; * }); * ``` */ -export function useAstMigrationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AstMigrationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAstMigrationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAstMigrationsQuery< + S extends AstMigrationSelect, + TData = { + astMigrations: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AstMigrationSelect>; + } & Omit< + UseQueryOptions< + { + astMigrations: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAstMigrationsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: astMigrationKeys.list(args), queryFn: () => getClient().astMigration.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch AstMigration list without React hooks - * + * * @example * ```ts * const data = await fetchAstMigrationsQuery({ @@ -70,35 +99,47 @@ export function useAstMigrationsQuery(params: { export async function fetchAstMigrationsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AstMigrationSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AstMigrationSelect>; }): Promise<{ astMigrations: ConnectionResult>; }>; export async function fetchAstMigrationsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().astMigration.findMany(args).unwrap(); } /** * Prefetch AstMigration list for SSR or cache warming - * + * * @example * ```ts * await prefetchAstMigrationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAstMigrationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AstMigrationSelect>; -}): Promise; -export async function prefetchAstMigrationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAstMigrationsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AstMigrationSelect>; + } +): Promise; +export async function prefetchAstMigrationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: astMigrationKeys.list(args), - queryFn: () => getClient().astMigration.findMany(args).unwrap() + queryFn: () => getClient().astMigration.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useCheckConstraintQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useCheckConstraintQuery.ts index 192f408e0e..009bb1d0c0 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useCheckConstraintQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useCheckConstraintQuery.ts @@ -4,20 +4,20 @@ * 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 { checkConstraintKeys } from "../query-keys"; -import type { CheckConstraintSelect, CheckConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CheckConstraintSelect, CheckConstraintWithRelations } from "../../orm/input-types"; +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 { checkConstraintKeys } from '../query-keys'; +import type { CheckConstraintSelect, CheckConstraintWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CheckConstraintSelect, CheckConstraintWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const checkConstraintQueryKey = checkConstraintKeys.detail; /** * Query hook for fetching a single CheckConstraint - * + * * @example * ```tsx * const { data, isLoading } = useCheckConstraintQuery({ @@ -26,38 +26,52 @@ export const checkConstraintQueryKey = checkConstraintKeys.detail; * }); * ``` */ -export function useCheckConstraintQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CheckConstraintSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCheckConstraintQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCheckConstraintQuery< + S extends CheckConstraintSelect, + TData = { + checkConstraint: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CheckConstraintSelect>; + } & Omit< + UseQueryOptions< + { + checkConstraint: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCheckConstraintQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: checkConstraintKeys.detail(params.id), - queryFn: () => getClient().checkConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .checkConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single CheckConstraint without React hooks - * + * * @example * ```ts * const data = await fetchCheckConstraintQuery({ @@ -79,35 +93,46 @@ export async function fetchCheckConstraintQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().checkConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .checkConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single CheckConstraint for SSR or cache warming - * + * * @example * ```ts * await prefetchCheckConstraintQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCheckConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CheckConstraintSelect>; -}): Promise; -export async function prefetchCheckConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchCheckConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CheckConstraintSelect>; + } +): Promise; +export async function prefetchCheckConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: checkConstraintKeys.detail(params.id), - queryFn: () => getClient().checkConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .checkConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useCheckConstraintsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useCheckConstraintsQuery.ts index a104cf715e..8a3d4277b8 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useCheckConstraintsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useCheckConstraintsQuery.ts @@ -4,20 +4,35 @@ * 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 { checkConstraintKeys } from "../query-keys"; -import type { CheckConstraintSelect, CheckConstraintWithRelations, CheckConstraintFilter, CheckConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { CheckConstraintSelect, CheckConstraintWithRelations, CheckConstraintFilter, CheckConstraintOrderBy } from "../../orm/input-types"; +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 { checkConstraintKeys } from '../query-keys'; +import type { + CheckConstraintSelect, + CheckConstraintWithRelations, + CheckConstraintFilter, + CheckConstraintOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + CheckConstraintSelect, + CheckConstraintWithRelations, + CheckConstraintFilter, + CheckConstraintOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const checkConstraintsQueryKey = checkConstraintKeys.list; /** * Query hook for fetching CheckConstraint list - * + * * @example * ```tsx * const { data, isLoading } = useCheckConstraintsQuery({ @@ -30,33 +45,53 @@ export const checkConstraintsQueryKey = checkConstraintKeys.list; * }); * ``` */ -export function useCheckConstraintsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CheckConstraintSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCheckConstraintsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useCheckConstraintsQuery< + S extends CheckConstraintSelect, + TData = { + checkConstraints: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CheckConstraintSelect>; + } & Omit< + UseQueryOptions< + { + checkConstraints: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCheckConstraintsQuery( + params: { + selection: ListSelectionConfig< + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: checkConstraintKeys.list(args), queryFn: () => getClient().checkConstraint.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch CheckConstraint list without React hooks - * + * * @example * ```ts * const data = await fetchCheckConstraintsQuery({ @@ -70,35 +105,59 @@ export function useCheckConstraintsQuery(params: { export async function fetchCheckConstraintsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, CheckConstraintSelect>; + } & Omit, 'fields'> & + HookStrictSelect, CheckConstraintSelect>; }): Promise<{ checkConstraints: ConnectionResult>; }>; export async function fetchCheckConstraintsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy + >(params.selection); return getClient().checkConstraint.findMany(args).unwrap(); } /** * Prefetch CheckConstraint list for SSR or cache warming - * + * * @example * ```ts * await prefetchCheckConstraintsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchCheckConstraintsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CheckConstraintSelect>; -}): Promise; -export async function prefetchCheckConstraintsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchCheckConstraintsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CheckConstraintSelect>; + } +): Promise; +export async function prefetchCheckConstraintsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: checkConstraintKeys.list(args), - queryFn: () => getClient().checkConstraint.findMany(args).unwrap() + queryFn: () => getClient().checkConstraint.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useCompositeTypeQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useCompositeTypeQuery.ts index e7476d2a82..363f50d8a5 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useCompositeTypeQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useCompositeTypeQuery.ts @@ -4,20 +4,20 @@ * 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 { compositeTypeKeys } from "../query-keys"; -import type { CompositeTypeSelect, CompositeTypeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CompositeTypeSelect, CompositeTypeWithRelations } from "../../orm/input-types"; +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 { compositeTypeKeys } from '../query-keys'; +import type { CompositeTypeSelect, CompositeTypeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CompositeTypeSelect, CompositeTypeWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const compositeTypeQueryKey = compositeTypeKeys.detail; /** * Query hook for fetching a single CompositeType - * + * * @example * ```tsx * const { data, isLoading } = useCompositeTypeQuery({ @@ -26,38 +26,52 @@ export const compositeTypeQueryKey = compositeTypeKeys.detail; * }); * ``` */ -export function useCompositeTypeQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CompositeTypeSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCompositeTypeQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCompositeTypeQuery< + S extends CompositeTypeSelect, + TData = { + compositeType: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CompositeTypeSelect>; + } & Omit< + UseQueryOptions< + { + compositeType: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCompositeTypeQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: compositeTypeKeys.detail(params.id), - queryFn: () => getClient().compositeType.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .compositeType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single CompositeType without React hooks - * + * * @example * ```ts * const data = await fetchCompositeTypeQuery({ @@ -79,35 +93,46 @@ export async function fetchCompositeTypeQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().compositeType.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .compositeType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single CompositeType for SSR or cache warming - * + * * @example * ```ts * await prefetchCompositeTypeQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCompositeTypeQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CompositeTypeSelect>; -}): Promise; -export async function prefetchCompositeTypeQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchCompositeTypeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CompositeTypeSelect>; + } +): Promise; +export async function prefetchCompositeTypeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: compositeTypeKeys.detail(params.id), - queryFn: () => getClient().compositeType.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .compositeType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useCompositeTypesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useCompositeTypesQuery.ts index e7113c3ba0..5916d7ad23 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useCompositeTypesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useCompositeTypesQuery.ts @@ -4,20 +4,35 @@ * 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 { compositeTypeKeys } from "../query-keys"; -import type { CompositeTypeSelect, CompositeTypeWithRelations, CompositeTypeFilter, CompositeTypeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { CompositeTypeSelect, CompositeTypeWithRelations, CompositeTypeFilter, CompositeTypeOrderBy } from "../../orm/input-types"; +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 { compositeTypeKeys } from '../query-keys'; +import type { + CompositeTypeSelect, + CompositeTypeWithRelations, + CompositeTypeFilter, + CompositeTypeOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + CompositeTypeSelect, + CompositeTypeWithRelations, + CompositeTypeFilter, + CompositeTypeOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const compositeTypesQueryKey = compositeTypeKeys.list; /** * Query hook for fetching CompositeType list - * + * * @example * ```tsx * const { data, isLoading } = useCompositeTypesQuery({ @@ -30,33 +45,49 @@ export const compositeTypesQueryKey = compositeTypeKeys.list; * }); * ``` */ -export function useCompositeTypesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CompositeTypeSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCompositeTypesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useCompositeTypesQuery< + S extends CompositeTypeSelect, + TData = { + compositeTypes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CompositeTypeSelect>; + } & Omit< + UseQueryOptions< + { + compositeTypes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCompositeTypesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + CompositeTypeSelect, + CompositeTypeFilter, + CompositeTypeOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: compositeTypeKeys.list(args), queryFn: () => getClient().compositeType.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch CompositeType list without React hooks - * + * * @example * ```ts * const data = await fetchCompositeTypesQuery({ @@ -70,35 +101,51 @@ export function useCompositeTypesQuery(params: { export async function fetchCompositeTypesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, CompositeTypeSelect>; + } & Omit, 'fields'> & + HookStrictSelect, CompositeTypeSelect>; }): Promise<{ compositeTypes: ConnectionResult>; }>; export async function fetchCompositeTypesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + CompositeTypeSelect, + CompositeTypeFilter, + CompositeTypeOrderBy + >(params.selection); return getClient().compositeType.findMany(args).unwrap(); } /** * Prefetch CompositeType list for SSR or cache warming - * + * * @example * ```ts * await prefetchCompositeTypesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchCompositeTypesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CompositeTypeSelect>; -}): Promise; -export async function prefetchCompositeTypesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchCompositeTypesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CompositeTypeSelect>; + } +): Promise; +export async function prefetchCompositeTypesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + CompositeTypeSelect, + CompositeTypeFilter, + CompositeTypeOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: compositeTypeKeys.list(args), - queryFn: () => getClient().compositeType.findMany(args).unwrap() + queryFn: () => getClient().compositeType.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useCorsSettingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useCorsSettingQuery.ts index 1554c1a75f..093e953f88 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useCorsSettingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useCorsSettingQuery.ts @@ -4,20 +4,20 @@ * 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 { corsSettingKeys } from "../query-keys"; -import type { CorsSettingSelect, CorsSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CorsSettingSelect, CorsSettingWithRelations } from "../../orm/input-types"; +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 { corsSettingKeys } from '../query-keys'; +import type { CorsSettingSelect, CorsSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CorsSettingSelect, CorsSettingWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const corsSettingQueryKey = corsSettingKeys.detail; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { data, isLoading } = useCorsSettingQuery({ @@ -26,38 +26,52 @@ export const corsSettingQueryKey = corsSettingKeys.detail; * }); * ``` */ -export function useCorsSettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CorsSettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCorsSettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCorsSettingQuery< + S extends CorsSettingSelect, + TData = { + corsSetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CorsSettingSelect>; + } & Omit< + UseQueryOptions< + { + corsSetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCorsSettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: corsSettingKeys.detail(params.id), - queryFn: () => getClient().corsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .corsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```ts * const data = await fetchCorsSettingQuery({ @@ -79,35 +93,46 @@ export async function fetchCorsSettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().corsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .corsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```ts * await prefetchCorsSettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCorsSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CorsSettingSelect>; -}): Promise; -export async function prefetchCorsSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchCorsSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CorsSettingSelect>; + } +): Promise; +export async function prefetchCorsSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: corsSettingKeys.detail(params.id), - queryFn: () => getClient().corsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .corsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useCorsSettingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useCorsSettingsQuery.ts index 2de7570121..adcc22578b 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useCorsSettingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useCorsSettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { corsSettingKeys } from "../query-keys"; -import type { CorsSettingSelect, CorsSettingWithRelations, CorsSettingFilter, CorsSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { CorsSettingSelect, CorsSettingWithRelations, CorsSettingFilter, CorsSettingOrderBy } from "../../orm/input-types"; +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 { corsSettingKeys } from '../query-keys'; +import type { + CorsSettingSelect, + CorsSettingWithRelations, + CorsSettingFilter, + CorsSettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + CorsSettingSelect, + CorsSettingWithRelations, + CorsSettingFilter, + CorsSettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const corsSettingsQueryKey = corsSettingKeys.list; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { data, isLoading } = useCorsSettingsQuery({ @@ -30,33 +45,47 @@ export const corsSettingsQueryKey = corsSettingKeys.list; * }); * ``` */ -export function useCorsSettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CorsSettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCorsSettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useCorsSettingsQuery< + S extends CorsSettingSelect, + TData = { + corsSettings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CorsSettingSelect>; + } & Omit< + UseQueryOptions< + { + corsSettings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCorsSettingsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: corsSettingKeys.list(args), queryFn: () => getClient().corsSetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```ts * const data = await fetchCorsSettingsQuery({ @@ -70,35 +99,47 @@ export function useCorsSettingsQuery(params: { export async function fetchCorsSettingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, CorsSettingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, CorsSettingSelect>; }): Promise<{ corsSettings: ConnectionResult>; }>; export async function fetchCorsSettingsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().corsSetting.findMany(args).unwrap(); } /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```ts * await prefetchCorsSettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchCorsSettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CorsSettingSelect>; -}): Promise; -export async function prefetchCorsSettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchCorsSettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CorsSettingSelect>; + } +): Promise; +export async function prefetchCorsSettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: corsSettingKeys.list(args), - queryFn: () => getClient().corsSetting.findMany(args).unwrap() + queryFn: () => getClient().corsSetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDatabaseQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDatabaseQuery.ts index 69fa76e603..011c281d84 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDatabaseQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDatabaseQuery.ts @@ -4,20 +4,20 @@ * 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 { databaseKeys } from "../query-keys"; -import type { DatabaseSelect, DatabaseWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSelect, DatabaseWithRelations } from "../../orm/input-types"; +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 { databaseKeys } from '../query-keys'; +import type { DatabaseSelect, DatabaseWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DatabaseSelect, DatabaseWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseQueryKey = databaseKeys.detail; /** * Query hook for fetching a single Database - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseQuery({ @@ -26,38 +26,52 @@ export const databaseQueryKey = databaseKeys.detail; * }); * ``` */ -export function useDatabaseQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDatabaseQuery< + S extends DatabaseSelect, + TData = { + database: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseSelect>; + } & Omit< + UseQueryOptions< + { + database: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseKeys.detail(params.id), - queryFn: () => getClient().database.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .database.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Database without React hooks - * + * * @example * ```ts * const data = await fetchDatabaseQuery({ @@ -79,35 +93,46 @@ export async function fetchDatabaseQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().database.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .database.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Database for SSR or cache warming - * + * * @example * ```ts * await prefetchDatabaseQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDatabaseQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseSelect>; -}): Promise; -export async function prefetchDatabaseQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDatabaseQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseSelect>; + } +): Promise; +export async function prefetchDatabaseQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: databaseKeys.detail(params.id), - queryFn: () => getClient().database.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .database.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDatabaseSettingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDatabaseSettingQuery.ts index 02af203350..d3b3dc1cd1 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDatabaseSettingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDatabaseSettingQuery.ts @@ -4,20 +4,20 @@ * 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 { databaseSettingKeys } from "../query-keys"; -import type { DatabaseSettingSelect, DatabaseSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingSelect, DatabaseSettingWithRelations } from "../../orm/input-types"; +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 { databaseSettingKeys } from '../query-keys'; +import type { DatabaseSettingSelect, DatabaseSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DatabaseSettingSelect, DatabaseSettingWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseSettingQueryKey = databaseSettingKeys.detail; /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseSettingQuery({ @@ -26,38 +26,52 @@ export const databaseSettingQueryKey = databaseSettingKeys.detail; * }); * ``` */ -export function useDatabaseSettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseSettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseSettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDatabaseSettingQuery< + S extends DatabaseSettingSelect, + TData = { + databaseSetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseSettingSelect>; + } & Omit< + UseQueryOptions< + { + databaseSetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseSettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseSettingKeys.detail(params.id), - queryFn: () => getClient().databaseSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .databaseSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```ts * const data = await fetchDatabaseSettingQuery({ @@ -79,35 +93,46 @@ export async function fetchDatabaseSettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().databaseSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .databaseSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```ts * await prefetchDatabaseSettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDatabaseSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseSettingSelect>; -}): Promise; -export async function prefetchDatabaseSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDatabaseSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseSettingSelect>; + } +): Promise; +export async function prefetchDatabaseSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: databaseSettingKeys.detail(params.id), - queryFn: () => getClient().databaseSetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .databaseSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDatabaseSettingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDatabaseSettingsQuery.ts index 918f312dcd..b4110a6c97 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDatabaseSettingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDatabaseSettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { databaseSettingKeys } from "../query-keys"; -import type { DatabaseSettingSelect, DatabaseSettingWithRelations, DatabaseSettingFilter, DatabaseSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingSelect, DatabaseSettingWithRelations, DatabaseSettingFilter, DatabaseSettingOrderBy } from "../../orm/input-types"; +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 { databaseSettingKeys } from '../query-keys'; +import type { + DatabaseSettingSelect, + DatabaseSettingWithRelations, + DatabaseSettingFilter, + DatabaseSettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DatabaseSettingSelect, + DatabaseSettingWithRelations, + DatabaseSettingFilter, + DatabaseSettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseSettingsQueryKey = databaseSettingKeys.list; /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseSettingsQuery({ @@ -30,33 +45,53 @@ export const databaseSettingsQueryKey = databaseSettingKeys.list; * }); * ``` */ -export function useDatabaseSettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseSettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDatabaseSettingsQuery< + S extends DatabaseSettingSelect, + TData = { + databaseSettings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseSettingSelect>; + } & Omit< + UseQueryOptions< + { + databaseSettings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseSettingsQuery( + params: { + selection: ListSelectionConfig< + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseSettingKeys.list(args), queryFn: () => getClient().databaseSetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```ts * const data = await fetchDatabaseSettingsQuery({ @@ -70,35 +105,59 @@ export function useDatabaseSettingsQuery(params: { export async function fetchDatabaseSettingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSettingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseSettingSelect>; }): Promise<{ databaseSettings: ConnectionResult>; }>; export async function fetchDatabaseSettingsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy + >(params.selection); return getClient().databaseSetting.findMany(args).unwrap(); } /** * Scope-wide feature flags and settings; controls which platform features are available to all APIs in this scope - * + * * @example * ```ts * await prefetchDatabaseSettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDatabaseSettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSettingSelect>; -}): Promise; -export async function prefetchDatabaseSettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDatabaseSettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseSettingSelect>; + } +): Promise; +export async function prefetchDatabaseSettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: databaseSettingKeys.list(args), - queryFn: () => getClient().databaseSetting.findMany(args).unwrap() + queryFn: () => getClient().databaseSetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDatabaseTransferQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDatabaseTransferQuery.ts index 3854607228..483eb6fdbe 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDatabaseTransferQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDatabaseTransferQuery.ts @@ -4,20 +4,20 @@ * 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 { databaseTransferKeys } from "../query-keys"; -import type { DatabaseTransferSelect, DatabaseTransferWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseTransferSelect, DatabaseTransferWithRelations } from "../../orm/input-types"; +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 { databaseTransferKeys } from '../query-keys'; +import type { DatabaseTransferSelect, DatabaseTransferWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DatabaseTransferSelect, DatabaseTransferWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseTransferQueryKey = databaseTransferKeys.detail; /** * Query hook for fetching a single DatabaseTransfer - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseTransferQuery({ @@ -26,38 +26,52 @@ export const databaseTransferQueryKey = databaseTransferKeys.detail; * }); * ``` */ -export function useDatabaseTransferQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseTransferSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseTransferQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDatabaseTransferQuery< + S extends DatabaseTransferSelect, + TData = { + databaseTransfer: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseTransferSelect>; + } & Omit< + UseQueryOptions< + { + databaseTransfer: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseTransferQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseTransferKeys.detail(params.id), - queryFn: () => getClient().databaseTransfer.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .databaseTransfer.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DatabaseTransfer without React hooks - * + * * @example * ```ts * const data = await fetchDatabaseTransferQuery({ @@ -79,35 +93,46 @@ export async function fetchDatabaseTransferQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().databaseTransfer.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .databaseTransfer.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DatabaseTransfer for SSR or cache warming - * + * * @example * ```ts * await prefetchDatabaseTransferQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDatabaseTransferQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseTransferSelect>; -}): Promise; -export async function prefetchDatabaseTransferQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDatabaseTransferQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseTransferSelect>; + } +): Promise; +export async function prefetchDatabaseTransferQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: databaseTransferKeys.detail(params.id), - queryFn: () => getClient().databaseTransfer.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .databaseTransfer.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDatabaseTransfersQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDatabaseTransfersQuery.ts index 107789025d..44c987e9b0 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDatabaseTransfersQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDatabaseTransfersQuery.ts @@ -4,20 +4,35 @@ * 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 { databaseTransferKeys } from "../query-keys"; -import type { DatabaseTransferSelect, DatabaseTransferWithRelations, DatabaseTransferFilter, DatabaseTransferOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseTransferSelect, DatabaseTransferWithRelations, DatabaseTransferFilter, DatabaseTransferOrderBy } from "../../orm/input-types"; +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 { databaseTransferKeys } from '../query-keys'; +import type { + DatabaseTransferSelect, + DatabaseTransferWithRelations, + DatabaseTransferFilter, + DatabaseTransferOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DatabaseTransferSelect, + DatabaseTransferWithRelations, + DatabaseTransferFilter, + DatabaseTransferOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseTransfersQueryKey = databaseTransferKeys.list; /** * Query hook for fetching DatabaseTransfer list - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseTransfersQuery({ @@ -30,33 +45,53 @@ export const databaseTransfersQueryKey = databaseTransferKeys.list; * }); * ``` */ -export function useDatabaseTransfersQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseTransferSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseTransfersQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDatabaseTransfersQuery< + S extends DatabaseTransferSelect, + TData = { + databaseTransfers: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseTransferSelect>; + } & Omit< + UseQueryOptions< + { + databaseTransfers: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseTransfersQuery( + params: { + selection: ListSelectionConfig< + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseTransferKeys.list(args), queryFn: () => getClient().databaseTransfer.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DatabaseTransfer list without React hooks - * + * * @example * ```ts * const data = await fetchDatabaseTransfersQuery({ @@ -70,35 +105,59 @@ export function useDatabaseTransfersQuery(params: { export async function fetchDatabaseTransfersQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseTransferSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseTransferSelect>; }): Promise<{ databaseTransfers: ConnectionResult>; }>; export async function fetchDatabaseTransfersQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy + >(params.selection); return getClient().databaseTransfer.findMany(args).unwrap(); } /** * Prefetch DatabaseTransfer list for SSR or cache warming - * + * * @example * ```ts * await prefetchDatabaseTransfersQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDatabaseTransfersQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseTransferSelect>; -}): Promise; -export async function prefetchDatabaseTransfersQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDatabaseTransfersQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseTransferSelect>; + } +): Promise; +export async function prefetchDatabaseTransfersQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: databaseTransferKeys.list(args), - queryFn: () => getClient().databaseTransfer.findMany(args).unwrap() + queryFn: () => getClient().databaseTransfer.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDatabasesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDatabasesQuery.ts index 497cb5c8d1..c45a9af994 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDatabasesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDatabasesQuery.ts @@ -4,20 +4,35 @@ * 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 { databaseKeys } from "../query-keys"; -import type { DatabaseSelect, DatabaseWithRelations, DatabaseFilter, DatabaseOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSelect, DatabaseWithRelations, DatabaseFilter, DatabaseOrderBy } from "../../orm/input-types"; +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 { databaseKeys } from '../query-keys'; +import type { + DatabaseSelect, + DatabaseWithRelations, + DatabaseFilter, + DatabaseOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DatabaseSelect, + DatabaseWithRelations, + DatabaseFilter, + DatabaseOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databasesQueryKey = databaseKeys.list; /** * Query hook for fetching Database list - * + * * @example * ```tsx * const { data, isLoading } = useDatabasesQuery({ @@ -30,33 +45,47 @@ export const databasesQueryKey = databaseKeys.list; * }); * ``` */ -export function useDatabasesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabasesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDatabasesQuery< + S extends DatabaseSelect, + TData = { + databases: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseSelect>; + } & Omit< + UseQueryOptions< + { + databases: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabasesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseKeys.list(args), queryFn: () => getClient().database.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Database list without React hooks - * + * * @example * ```ts * const data = await fetchDatabasesQuery({ @@ -70,35 +99,47 @@ export function useDatabasesQuery(params: { export async function fetchDatabasesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseSelect>; }): Promise<{ databases: ConnectionResult>; }>; export async function fetchDatabasesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().database.findMany(args).unwrap(); } /** * Prefetch Database list for SSR or cache warming - * + * * @example * ```ts * await prefetchDatabasesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDatabasesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSelect>; -}): Promise; -export async function prefetchDatabasesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDatabasesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DatabaseSelect>; + } +): Promise; +export async function prefetchDatabasesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: databaseKeys.list(args), - queryFn: () => getClient().database.findMany(args).unwrap() + queryFn: () => getClient().database.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDefaultPrivilegeQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDefaultPrivilegeQuery.ts index 1e6a148e5c..c2649d9f16 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDefaultPrivilegeQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDefaultPrivilegeQuery.ts @@ -4,20 +4,20 @@ * 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 { defaultPrivilegeKeys } from "../query-keys"; -import type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations } from "../../orm/input-types"; +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 { defaultPrivilegeKeys } from '../query-keys'; +import type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const defaultPrivilegeQueryKey = defaultPrivilegeKeys.detail; /** * Query hook for fetching a single DefaultPrivilege - * + * * @example * ```tsx * const { data, isLoading } = useDefaultPrivilegeQuery({ @@ -26,38 +26,52 @@ export const defaultPrivilegeQueryKey = defaultPrivilegeKeys.detail; * }); * ``` */ -export function useDefaultPrivilegeQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DefaultPrivilegeSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDefaultPrivilegeQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDefaultPrivilegeQuery< + S extends DefaultPrivilegeSelect, + TData = { + defaultPrivilege: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DefaultPrivilegeSelect>; + } & Omit< + UseQueryOptions< + { + defaultPrivilege: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDefaultPrivilegeQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: defaultPrivilegeKeys.detail(params.id), - queryFn: () => getClient().defaultPrivilege.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .defaultPrivilege.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DefaultPrivilege without React hooks - * + * * @example * ```ts * const data = await fetchDefaultPrivilegeQuery({ @@ -79,35 +93,46 @@ export async function fetchDefaultPrivilegeQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().defaultPrivilege.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .defaultPrivilege.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DefaultPrivilege for SSR or cache warming - * + * * @example * ```ts * await prefetchDefaultPrivilegeQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDefaultPrivilegeQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DefaultPrivilegeSelect>; -}): Promise; -export async function prefetchDefaultPrivilegeQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDefaultPrivilegeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DefaultPrivilegeSelect>; + } +): Promise; +export async function prefetchDefaultPrivilegeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: defaultPrivilegeKeys.detail(params.id), - queryFn: () => getClient().defaultPrivilege.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .defaultPrivilege.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDefaultPrivilegesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDefaultPrivilegesQuery.ts index c1b669eb41..c3bdf66370 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDefaultPrivilegesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDefaultPrivilegesQuery.ts @@ -4,20 +4,35 @@ * 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 { defaultPrivilegeKeys } from "../query-keys"; -import type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations, DefaultPrivilegeFilter, DefaultPrivilegeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultPrivilegeSelect, DefaultPrivilegeWithRelations, DefaultPrivilegeFilter, DefaultPrivilegeOrderBy } from "../../orm/input-types"; +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 { defaultPrivilegeKeys } from '../query-keys'; +import type { + DefaultPrivilegeSelect, + DefaultPrivilegeWithRelations, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DefaultPrivilegeSelect, + DefaultPrivilegeWithRelations, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const defaultPrivilegesQueryKey = defaultPrivilegeKeys.list; /** * Query hook for fetching DefaultPrivilege list - * + * * @example * ```tsx * const { data, isLoading } = useDefaultPrivilegesQuery({ @@ -30,33 +45,53 @@ export const defaultPrivilegesQueryKey = defaultPrivilegeKeys.list; * }); * ``` */ -export function useDefaultPrivilegesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DefaultPrivilegeSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDefaultPrivilegesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDefaultPrivilegesQuery< + S extends DefaultPrivilegeSelect, + TData = { + defaultPrivileges: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DefaultPrivilegeSelect>; + } & Omit< + UseQueryOptions< + { + defaultPrivileges: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDefaultPrivilegesQuery( + params: { + selection: ListSelectionConfig< + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: defaultPrivilegeKeys.list(args), queryFn: () => getClient().defaultPrivilege.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DefaultPrivilege list without React hooks - * + * * @example * ```ts * const data = await fetchDefaultPrivilegesQuery({ @@ -70,35 +105,59 @@ export function useDefaultPrivilegesQuery(params: { export async function fetchDefaultPrivilegesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DefaultPrivilegeSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DefaultPrivilegeSelect>; }): Promise<{ defaultPrivileges: ConnectionResult>; }>; export async function fetchDefaultPrivilegesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy + >(params.selection); return getClient().defaultPrivilege.findMany(args).unwrap(); } /** * Prefetch DefaultPrivilege list for SSR or cache warming - * + * * @example * ```ts * await prefetchDefaultPrivilegesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDefaultPrivilegesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DefaultPrivilegeSelect>; -}): Promise; -export async function prefetchDefaultPrivilegesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDefaultPrivilegesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DefaultPrivilegeSelect>; + } +): Promise; +export async function prefetchDefaultPrivilegesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: defaultPrivilegeKeys.list(args), - queryFn: () => getClient().defaultPrivilege.findMany(args).unwrap() + queryFn: () => getClient().defaultPrivilege.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDomainEventQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDomainEventQuery.ts index 81df5520a7..269516a722 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDomainEventQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDomainEventQuery.ts @@ -4,20 +4,20 @@ * 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 { domainEventKeys } from "../query-keys"; -import type { DomainEventSelect, DomainEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainEventSelect, DomainEventWithRelations } from "../../orm/input-types"; +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 { domainEventKeys } from '../query-keys'; +import type { DomainEventSelect, DomainEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DomainEventSelect, DomainEventWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const domainEventQueryKey = domainEventKeys.detail; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { data, isLoading } = useDomainEventQuery({ @@ -26,38 +26,52 @@ export const domainEventQueryKey = domainEventKeys.detail; * }); * ``` */ -export function useDomainEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DomainEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDomainEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDomainEventQuery< + S extends DomainEventSelect, + TData = { + domainEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DomainEventSelect>; + } & Omit< + UseQueryOptions< + { + domainEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDomainEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: domainEventKeys.detail(params.id), - queryFn: () => getClient().domainEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .domainEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Audit trail of domain lifecycle events - * + * * @example * ```ts * const data = await fetchDomainEventQuery({ @@ -79,35 +93,46 @@ export async function fetchDomainEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().domainEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .domainEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Audit trail of domain lifecycle events - * + * * @example * ```ts * await prefetchDomainEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDomainEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DomainEventSelect>; -}): Promise; -export async function prefetchDomainEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDomainEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DomainEventSelect>; + } +): Promise; +export async function prefetchDomainEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: domainEventKeys.detail(params.id), - queryFn: () => getClient().domainEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .domainEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDomainEventsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDomainEventsQuery.ts index 9391e3fc1d..00a45955a4 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDomainEventsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDomainEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { domainEventKeys } from "../query-keys"; -import type { DomainEventSelect, DomainEventWithRelations, DomainEventFilter, DomainEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainEventSelect, DomainEventWithRelations, DomainEventFilter, DomainEventOrderBy } from "../../orm/input-types"; +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 { domainEventKeys } from '../query-keys'; +import type { + DomainEventSelect, + DomainEventWithRelations, + DomainEventFilter, + DomainEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DomainEventSelect, + DomainEventWithRelations, + DomainEventFilter, + DomainEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const domainEventsQueryKey = domainEventKeys.list; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { data, isLoading } = useDomainEventsQuery({ @@ -30,33 +45,47 @@ export const domainEventsQueryKey = domainEventKeys.list; * }); * ``` */ -export function useDomainEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDomainEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDomainEventsQuery< + S extends DomainEventSelect, + TData = { + domainEvents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DomainEventSelect>; + } & Omit< + UseQueryOptions< + { + domainEvents: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDomainEventsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: domainEventKeys.list(args), queryFn: () => getClient().domainEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Audit trail of domain lifecycle events - * + * * @example * ```ts * const data = await fetchDomainEventsQuery({ @@ -70,35 +99,47 @@ export function useDomainEventsQuery(params: { export async function fetchDomainEventsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainEventSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DomainEventSelect>; }): Promise<{ domainEvents: ConnectionResult>; }>; export async function fetchDomainEventsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().domainEvent.findMany(args).unwrap(); } /** * Audit trail of domain lifecycle events - * + * * @example * ```ts * await prefetchDomainEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDomainEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainEventSelect>; -}): Promise; -export async function prefetchDomainEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDomainEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DomainEventSelect>; + } +): Promise; +export async function prefetchDomainEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: domainEventKeys.list(args), - queryFn: () => getClient().domainEvent.findMany(args).unwrap() + queryFn: () => getClient().domainEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDomainQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDomainQuery.ts index 71306b80ba..3f134b4de9 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDomainQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDomainQuery.ts @@ -4,20 +4,20 @@ * 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 { domainKeys } from "../query-keys"; -import type { DomainSelect, DomainWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainSelect, DomainWithRelations } from "../../orm/input-types"; +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 { domainKeys } from '../query-keys'; +import type { DomainSelect, DomainWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DomainSelect, DomainWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const domainQueryKey = domainKeys.detail; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { data, isLoading } = useDomainQuery({ @@ -26,38 +26,52 @@ export const domainQueryKey = domainKeys.detail; * }); * ``` */ -export function useDomainQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DomainSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDomainQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDomainQuery< + S extends DomainSelect, + TData = { + domain: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DomainSelect>; + } & Omit< + UseQueryOptions< + { + domain: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDomainQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: domainKeys.detail(params.id), - queryFn: () => getClient().domain.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .domain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```ts * const data = await fetchDomainQuery({ @@ -79,35 +93,46 @@ export async function fetchDomainQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().domain.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .domain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```ts * await prefetchDomainQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDomainQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DomainSelect>; -}): Promise; -export async function prefetchDomainQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDomainQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DomainSelect>; + } +): Promise; +export async function prefetchDomainQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: domainKeys.detail(params.id), - queryFn: () => getClient().domain.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .domain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDomainVerificationQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDomainVerificationQuery.ts index 61255750a8..deb94d73e7 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDomainVerificationQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDomainVerificationQuery.ts @@ -4,20 +4,26 @@ * 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 { domainVerificationKeys } from "../query-keys"; -import type { DomainVerificationSelect, DomainVerificationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainVerificationSelect, DomainVerificationWithRelations } from "../../orm/input-types"; +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 { domainVerificationKeys } from '../query-keys'; +import type { + DomainVerificationSelect, + DomainVerificationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DomainVerificationSelect, + DomainVerificationWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const domainVerificationQueryKey = domainVerificationKeys.detail; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { data, isLoading } = useDomainVerificationQuery({ @@ -26,38 +32,52 @@ export const domainVerificationQueryKey = domainVerificationKeys.detail; * }); * ``` */ -export function useDomainVerificationQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DomainVerificationSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDomainVerificationQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDomainVerificationQuery< + S extends DomainVerificationSelect, + TData = { + domainVerification: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DomainVerificationSelect>; + } & Omit< + UseQueryOptions< + { + domainVerification: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDomainVerificationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: domainVerificationKeys.detail(params.id), - queryFn: () => getClient().domainVerification.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .domainVerification.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Ownership verification challenges issued for a domain - * + * * @example * ```ts * const data = await fetchDomainVerificationQuery({ @@ -79,35 +99,46 @@ export async function fetchDomainVerificationQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().domainVerification.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .domainVerification.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Ownership verification challenges issued for a domain - * + * * @example * ```ts * await prefetchDomainVerificationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDomainVerificationQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DomainVerificationSelect>; -}): Promise; -export async function prefetchDomainVerificationQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDomainVerificationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DomainVerificationSelect>; + } +): Promise; +export async function prefetchDomainVerificationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: domainVerificationKeys.detail(params.id), - queryFn: () => getClient().domainVerification.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .domainVerification.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDomainVerificationsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDomainVerificationsQuery.ts index 6a1f538007..cef0d9f645 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDomainVerificationsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDomainVerificationsQuery.ts @@ -4,20 +4,35 @@ * 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 { domainVerificationKeys } from "../query-keys"; -import type { DomainVerificationSelect, DomainVerificationWithRelations, DomainVerificationFilter, DomainVerificationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainVerificationSelect, DomainVerificationWithRelations, DomainVerificationFilter, DomainVerificationOrderBy } from "../../orm/input-types"; +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 { domainVerificationKeys } from '../query-keys'; +import type { + DomainVerificationSelect, + DomainVerificationWithRelations, + DomainVerificationFilter, + DomainVerificationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DomainVerificationSelect, + DomainVerificationWithRelations, + DomainVerificationFilter, + DomainVerificationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const domainVerificationsQueryKey = domainVerificationKeys.list; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { data, isLoading } = useDomainVerificationsQuery({ @@ -30,33 +45,58 @@ export const domainVerificationsQueryKey = domainVerificationKeys.list; * }); * ``` */ -export function useDomainVerificationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainVerificationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDomainVerificationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDomainVerificationsQuery< + S extends DomainVerificationSelect, + TData = { + domainVerifications: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DomainVerificationSelect>; + } & Omit< + UseQueryOptions< + { + domainVerifications: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDomainVerificationsQuery( + params: { + selection: ListSelectionConfig< + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: domainVerificationKeys.list(args), queryFn: () => getClient().domainVerification.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Ownership verification challenges issued for a domain - * + * * @example * ```ts * const data = await fetchDomainVerificationsQuery({ @@ -70,35 +110,62 @@ export function useDomainVerificationsQuery(params: { export async function fetchDomainVerificationsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainVerificationSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DomainVerificationSelect>; }): Promise<{ domainVerifications: ConnectionResult>; }>; export async function fetchDomainVerificationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy + >(params.selection); return getClient().domainVerification.findMany(args).unwrap(); } /** * Ownership verification challenges issued for a domain - * + * * @example * ```ts * await prefetchDomainVerificationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDomainVerificationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainVerificationSelect>; -}): Promise; -export async function prefetchDomainVerificationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDomainVerificationsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DomainVerificationSelect>; + } +): Promise; +export async function prefetchDomainVerificationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: domainVerificationKeys.list(args), - queryFn: () => getClient().domainVerification.findMany(args).unwrap() + queryFn: () => getClient().domainVerification.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useDomainsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useDomainsQuery.ts index 76a8fdca13..e480840c13 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useDomainsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useDomainsQuery.ts @@ -4,20 +4,35 @@ * 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 { domainKeys } from "../query-keys"; -import type { DomainSelect, DomainWithRelations, DomainFilter, DomainOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainSelect, DomainWithRelations, DomainFilter, DomainOrderBy } from "../../orm/input-types"; +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 { domainKeys } from '../query-keys'; +import type { + DomainSelect, + DomainWithRelations, + DomainFilter, + DomainOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DomainSelect, + DomainWithRelations, + DomainFilter, + DomainOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const domainsQueryKey = domainKeys.list; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { data, isLoading } = useDomainsQuery({ @@ -30,33 +45,45 @@ export const domainsQueryKey = domainKeys.list; * }); * ``` */ -export function useDomainsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDomainsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDomainsQuery< + S extends DomainSelect, + TData = { + domains: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DomainSelect>; + } & Omit< + UseQueryOptions< + { + domains: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDomainsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: domainKeys.list(args), queryFn: () => getClient().domain.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```ts * const data = await fetchDomainsQuery({ @@ -70,7 +97,8 @@ export function useDomainsQuery(params: { export async function fetchDomainsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DomainSelect>; }): Promise<{ domains: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchDomainsQuery(params: { } /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```ts * await prefetchDomainsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDomainsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainSelect>; -}): Promise; -export async function prefetchDomainsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchDomainsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DomainSelect>; + } +): Promise; +export async function prefetchDomainsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: domainKeys.list(args), - queryFn: () => getClient().domain.findMany(args).unwrap() + queryFn: () => getClient().domain.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useEmbeddingChunkQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useEmbeddingChunkQuery.ts index 2ad58e1f6e..b6c1923264 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useEmbeddingChunkQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useEmbeddingChunkQuery.ts @@ -4,20 +4,20 @@ * 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 { embeddingChunkKeys } from "../query-keys"; -import type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from "../../orm/input-types"; +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 { embeddingChunkKeys } from '../query-keys'; +import type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const embeddingChunkQueryKey = embeddingChunkKeys.detail; /** * Query hook for fetching a single EmbeddingChunk - * + * * @example * ```tsx * const { data, isLoading } = useEmbeddingChunkQuery({ @@ -26,38 +26,52 @@ export const embeddingChunkQueryKey = embeddingChunkKeys.detail; * }); * ``` */ -export function useEmbeddingChunkQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EmbeddingChunkSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEmbeddingChunkQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useEmbeddingChunkQuery< + S extends EmbeddingChunkSelect, + TData = { + embeddingChunk: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EmbeddingChunkSelect>; + } & Omit< + UseQueryOptions< + { + embeddingChunk: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEmbeddingChunkQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: embeddingChunkKeys.detail(params.id), - queryFn: () => getClient().embeddingChunk.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .embeddingChunk.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single EmbeddingChunk without React hooks - * + * * @example * ```ts * const data = await fetchEmbeddingChunkQuery({ @@ -79,35 +93,46 @@ export async function fetchEmbeddingChunkQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().embeddingChunk.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .embeddingChunk.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single EmbeddingChunk for SSR or cache warming - * + * * @example * ```ts * await prefetchEmbeddingChunkQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchEmbeddingChunkQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EmbeddingChunkSelect>; -}): Promise; -export async function prefetchEmbeddingChunkQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchEmbeddingChunkQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EmbeddingChunkSelect>; + } +): Promise; +export async function prefetchEmbeddingChunkQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: embeddingChunkKeys.detail(params.id), - queryFn: () => getClient().embeddingChunk.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .embeddingChunk.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useEmbeddingChunksQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useEmbeddingChunksQuery.ts index e720d5bcba..79caf38a37 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useEmbeddingChunksQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useEmbeddingChunksQuery.ts @@ -4,20 +4,35 @@ * 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 { embeddingChunkKeys } from "../query-keys"; -import type { EmbeddingChunkSelect, EmbeddingChunkWithRelations, EmbeddingChunkFilter, EmbeddingChunkOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmbeddingChunkSelect, EmbeddingChunkWithRelations, EmbeddingChunkFilter, EmbeddingChunkOrderBy } from "../../orm/input-types"; +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 { embeddingChunkKeys } from '../query-keys'; +import type { + EmbeddingChunkSelect, + EmbeddingChunkWithRelations, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + EmbeddingChunkSelect, + EmbeddingChunkWithRelations, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const embeddingChunksQueryKey = embeddingChunkKeys.list; /** * Query hook for fetching EmbeddingChunk list - * + * * @example * ```tsx * const { data, isLoading } = useEmbeddingChunksQuery({ @@ -30,33 +45,53 @@ export const embeddingChunksQueryKey = embeddingChunkKeys.list; * }); * ``` */ -export function useEmbeddingChunksQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EmbeddingChunkSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEmbeddingChunksQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useEmbeddingChunksQuery< + S extends EmbeddingChunkSelect, + TData = { + embeddingChunks: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EmbeddingChunkSelect>; + } & Omit< + UseQueryOptions< + { + embeddingChunks: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEmbeddingChunksQuery( + params: { + selection: ListSelectionConfig< + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: embeddingChunkKeys.list(args), queryFn: () => getClient().embeddingChunk.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch EmbeddingChunk list without React hooks - * + * * @example * ```ts * const data = await fetchEmbeddingChunksQuery({ @@ -70,35 +105,55 @@ export function useEmbeddingChunksQuery(params: { export async function fetchEmbeddingChunksQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, EmbeddingChunkSelect>; + } & Omit, 'fields'> & + HookStrictSelect, EmbeddingChunkSelect>; }): Promise<{ embeddingChunks: ConnectionResult>; }>; export async function fetchEmbeddingChunksQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy + >(params.selection); return getClient().embeddingChunk.findMany(args).unwrap(); } /** * Prefetch EmbeddingChunk list for SSR or cache warming - * + * * @example * ```ts * await prefetchEmbeddingChunksQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchEmbeddingChunksQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EmbeddingChunkSelect>; -}): Promise; -export async function prefetchEmbeddingChunksQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchEmbeddingChunksQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EmbeddingChunkSelect>; + } +): Promise; +export async function prefetchEmbeddingChunksQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: embeddingChunkKeys.list(args), - queryFn: () => getClient().embeddingChunk.findMany(args).unwrap() + queryFn: () => getClient().embeddingChunk.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useEnumQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useEnumQuery.ts index b8ab1c787a..f600ed3209 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useEnumQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useEnumQuery.ts @@ -4,20 +4,20 @@ * 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 { enumKeys } from "../query-keys"; -import type { EnumSelect, EnumWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EnumSelect, EnumWithRelations } from "../../orm/input-types"; +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 { enumKeys } from '../query-keys'; +import type { EnumSelect, EnumWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EnumSelect, EnumWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const enumQueryKey = enumKeys.detail; /** * Query hook for fetching a single Enum - * + * * @example * ```tsx * const { data, isLoading } = useEnumQuery({ @@ -26,38 +26,52 @@ export const enumQueryKey = enumKeys.detail; * }); * ``` */ -export function useEnumQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EnumSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEnumQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useEnumQuery< + S extends EnumSelect, + TData = { + enum: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EnumSelect>; + } & Omit< + UseQueryOptions< + { + enum: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEnumQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: enumKeys.detail(params.id), - queryFn: () => getClient().enum.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .enum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Enum without React hooks - * + * * @example * ```ts * const data = await fetchEnumQuery({ @@ -79,35 +93,46 @@ export async function fetchEnumQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().enum.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .enum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Enum for SSR or cache warming - * + * * @example * ```ts * await prefetchEnumQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchEnumQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EnumSelect>; -}): Promise; -export async function prefetchEnumQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchEnumQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EnumSelect>; + } +): Promise; +export async function prefetchEnumQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: enumKeys.detail(params.id), - queryFn: () => getClient().enum.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .enum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useEnumsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useEnumsQuery.ts index 3ee75017c3..83abc49ec1 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useEnumsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useEnumsQuery.ts @@ -4,20 +4,25 @@ * 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 { enumKeys } from "../query-keys"; -import type { EnumSelect, EnumWithRelations, EnumFilter, EnumOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { EnumSelect, EnumWithRelations, EnumFilter, EnumOrderBy } from "../../orm/input-types"; +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 { enumKeys } from '../query-keys'; +import type { EnumSelect, EnumWithRelations, EnumFilter, EnumOrderBy } from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { EnumSelect, EnumWithRelations, EnumFilter, EnumOrderBy } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const enumsQueryKey = enumKeys.list; /** * Query hook for fetching Enum list - * + * * @example * ```tsx * const { data, isLoading } = useEnumsQuery({ @@ -30,33 +35,45 @@ export const enumsQueryKey = enumKeys.list; * }); * ``` */ -export function useEnumsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EnumSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEnumsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useEnumsQuery< + S extends EnumSelect, + TData = { + enums: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EnumSelect>; + } & Omit< + UseQueryOptions< + { + enums: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEnumsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: enumKeys.list(args), queryFn: () => getClient().enum.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Enum list without React hooks - * + * * @example * ```ts * const data = await fetchEnumsQuery({ @@ -70,7 +87,8 @@ export function useEnumsQuery(params: { export async function fetchEnumsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, EnumSelect>; + } & Omit, 'fields'> & + HookStrictSelect, EnumSelect>; }): Promise<{ enums: ConnectionResult>; }>; @@ -82,23 +100,30 @@ export async function fetchEnumsQuery(params: { } /** * Prefetch Enum list for SSR or cache warming - * + * * @example * ```ts * await prefetchEnumsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchEnumsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EnumSelect>; -}): Promise; -export async function prefetchEnumsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchEnumsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EnumSelect>; + } +): Promise; +export async function prefetchEnumsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: enumKeys.list(args), - queryFn: () => getClient().enum.findMany(args).unwrap() + queryFn: () => getClient().enum.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useExclusionConstraintQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useExclusionConstraintQuery.ts index 8fa3e7e2ac..6bc83081eb 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useExclusionConstraintQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useExclusionConstraintQuery.ts @@ -4,20 +4,26 @@ * 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 { exclusionConstraintKeys } from "../query-keys"; -import type { ExclusionConstraintSelect, ExclusionConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ExclusionConstraintSelect, ExclusionConstraintWithRelations } from "../../orm/input-types"; +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 { exclusionConstraintKeys } from '../query-keys'; +import type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const exclusionConstraintQueryKey = exclusionConstraintKeys.detail; /** * Query hook for fetching a single ExclusionConstraint - * + * * @example * ```tsx * const { data, isLoading } = useExclusionConstraintQuery({ @@ -26,38 +32,52 @@ export const exclusionConstraintQueryKey = exclusionConstraintKeys.detail; * }); * ``` */ -export function useExclusionConstraintQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ExclusionConstraintSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useExclusionConstraintQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useExclusionConstraintQuery< + S extends ExclusionConstraintSelect, + TData = { + exclusionConstraint: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ExclusionConstraintSelect>; + } & Omit< + UseQueryOptions< + { + exclusionConstraint: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useExclusionConstraintQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: exclusionConstraintKeys.detail(params.id), - queryFn: () => getClient().exclusionConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .exclusionConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ExclusionConstraint without React hooks - * + * * @example * ```ts * const data = await fetchExclusionConstraintQuery({ @@ -79,35 +99,46 @@ export async function fetchExclusionConstraintQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().exclusionConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .exclusionConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ExclusionConstraint for SSR or cache warming - * + * * @example * ```ts * await prefetchExclusionConstraintQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchExclusionConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ExclusionConstraintSelect>; -}): Promise; -export async function prefetchExclusionConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchExclusionConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ExclusionConstraintSelect>; + } +): Promise; +export async function prefetchExclusionConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: exclusionConstraintKeys.detail(params.id), - queryFn: () => getClient().exclusionConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .exclusionConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useExclusionConstraintsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useExclusionConstraintsQuery.ts index e4bcc3e60e..732fbb6c95 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useExclusionConstraintsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useExclusionConstraintsQuery.ts @@ -4,20 +4,35 @@ * 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 { exclusionConstraintKeys } from "../query-keys"; -import type { ExclusionConstraintSelect, ExclusionConstraintWithRelations, ExclusionConstraintFilter, ExclusionConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ExclusionConstraintSelect, ExclusionConstraintWithRelations, ExclusionConstraintFilter, ExclusionConstraintOrderBy } from "../../orm/input-types"; +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 { exclusionConstraintKeys } from '../query-keys'; +import type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ExclusionConstraintSelect, + ExclusionConstraintWithRelations, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const exclusionConstraintsQueryKey = exclusionConstraintKeys.list; /** * Query hook for fetching ExclusionConstraint list - * + * * @example * ```tsx * const { data, isLoading } = useExclusionConstraintsQuery({ @@ -30,33 +45,58 @@ export const exclusionConstraintsQueryKey = exclusionConstraintKeys.list; * }); * ``` */ -export function useExclusionConstraintsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ExclusionConstraintSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useExclusionConstraintsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useExclusionConstraintsQuery< + S extends ExclusionConstraintSelect, + TData = { + exclusionConstraints: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ExclusionConstraintSelect>; + } & Omit< + UseQueryOptions< + { + exclusionConstraints: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useExclusionConstraintsQuery( + params: { + selection: ListSelectionConfig< + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: exclusionConstraintKeys.list(args), queryFn: () => getClient().exclusionConstraint.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ExclusionConstraint list without React hooks - * + * * @example * ```ts * const data = await fetchExclusionConstraintsQuery({ @@ -70,35 +110,65 @@ export function useExclusionConstraintsQuery(params: { export async function fetchExclusionConstraintsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ExclusionConstraintSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ExclusionConstraintSelect>; }): Promise<{ exclusionConstraints: ConnectionResult>; }>; export async function fetchExclusionConstraintsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy + >(params.selection); return getClient().exclusionConstraint.findMany(args).unwrap(); } /** * Prefetch ExclusionConstraint list for SSR or cache warming - * + * * @example * ```ts * await prefetchExclusionConstraintsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchExclusionConstraintsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ExclusionConstraintSelect>; -}): Promise; -export async function prefetchExclusionConstraintsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchExclusionConstraintsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ExclusionConstraintSelect>; + } +): Promise; +export async function prefetchExclusionConstraintsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: exclusionConstraintKeys.list(args), - queryFn: () => getClient().exclusionConstraint.findMany(args).unwrap() + queryFn: () => getClient().exclusionConstraint.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useFieldQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useFieldQuery.ts index 9c043d0cf4..c76c82d947 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useFieldQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useFieldQuery.ts @@ -4,20 +4,20 @@ * 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 { fieldKeys } from "../query-keys"; -import type { FieldSelect, FieldWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FieldSelect, FieldWithRelations } from "../../orm/input-types"; +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 { fieldKeys } from '../query-keys'; +import type { FieldSelect, FieldWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FieldSelect, FieldWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const fieldQueryKey = fieldKeys.detail; /** * Query hook for fetching a single Field - * + * * @example * ```tsx * const { data, isLoading } = useFieldQuery({ @@ -26,38 +26,52 @@ export const fieldQueryKey = fieldKeys.detail; * }); * ``` */ -export function useFieldQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FieldSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFieldQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFieldQuery< + S extends FieldSelect, + TData = { + field: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FieldSelect>; + } & Omit< + UseQueryOptions< + { + field: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFieldQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: fieldKeys.detail(params.id), - queryFn: () => getClient().field.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .field.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Field without React hooks - * + * * @example * ```ts * const data = await fetchFieldQuery({ @@ -79,35 +93,46 @@ export async function fetchFieldQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().field.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .field.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Field for SSR or cache warming - * + * * @example * ```ts * await prefetchFieldQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFieldQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FieldSelect>; -}): Promise; -export async function prefetchFieldQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFieldQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FieldSelect>; + } +): Promise; +export async function prefetchFieldQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: fieldKeys.detail(params.id), - queryFn: () => getClient().field.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .field.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useFieldsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useFieldsQuery.ts index 4a50f188b6..0458087473 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useFieldsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useFieldsQuery.ts @@ -4,20 +4,35 @@ * 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 { fieldKeys } from "../query-keys"; -import type { FieldSelect, FieldWithRelations, FieldFilter, FieldOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FieldSelect, FieldWithRelations, FieldFilter, FieldOrderBy } from "../../orm/input-types"; +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 { fieldKeys } from '../query-keys'; +import type { + FieldSelect, + FieldWithRelations, + FieldFilter, + FieldOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FieldSelect, + FieldWithRelations, + FieldFilter, + FieldOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const fieldsQueryKey = fieldKeys.list; /** * Query hook for fetching Field list - * + * * @example * ```tsx * const { data, isLoading } = useFieldsQuery({ @@ -30,33 +45,45 @@ export const fieldsQueryKey = fieldKeys.list; * }); * ``` */ -export function useFieldsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FieldSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFieldsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFieldsQuery< + S extends FieldSelect, + TData = { + fields: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FieldSelect>; + } & Omit< + UseQueryOptions< + { + fields: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFieldsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: fieldKeys.list(args), queryFn: () => getClient().field.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Field list without React hooks - * + * * @example * ```ts * const data = await fetchFieldsQuery({ @@ -70,7 +97,8 @@ export function useFieldsQuery(params: { export async function fetchFieldsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FieldSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FieldSelect>; }): Promise<{ fields: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchFieldsQuery(params: { } /** * Prefetch Field list for SSR or cache warming - * + * * @example * ```ts * await prefetchFieldsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFieldsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FieldSelect>; -}): Promise; -export async function prefetchFieldsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchFieldsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FieldSelect>; + } +): Promise; +export async function prefetchFieldsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: fieldKeys.list(args), - queryFn: () => getClient().field.findMany(args).unwrap() + queryFn: () => getClient().field.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useForeignKeyConstraintQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useForeignKeyConstraintQuery.ts index 79dd56638d..8f57a2aa79 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useForeignKeyConstraintQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useForeignKeyConstraintQuery.ts @@ -4,20 +4,26 @@ * 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 { foreignKeyConstraintKeys } from "../query-keys"; -import type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations } from "../../orm/input-types"; +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 { foreignKeyConstraintKeys } from '../query-keys'; +import type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const foreignKeyConstraintQueryKey = foreignKeyConstraintKeys.detail; /** * Query hook for fetching a single ForeignKeyConstraint - * + * * @example * ```tsx * const { data, isLoading } = useForeignKeyConstraintQuery({ @@ -26,38 +32,52 @@ export const foreignKeyConstraintQueryKey = foreignKeyConstraintKeys.detail; * }); * ``` */ -export function useForeignKeyConstraintQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ForeignKeyConstraintSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useForeignKeyConstraintQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useForeignKeyConstraintQuery< + S extends ForeignKeyConstraintSelect, + TData = { + foreignKeyConstraint: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ForeignKeyConstraintSelect>; + } & Omit< + UseQueryOptions< + { + foreignKeyConstraint: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useForeignKeyConstraintQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: foreignKeyConstraintKeys.detail(params.id), - queryFn: () => getClient().foreignKeyConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .foreignKeyConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ForeignKeyConstraint without React hooks - * + * * @example * ```ts * const data = await fetchForeignKeyConstraintQuery({ @@ -79,35 +99,46 @@ export async function fetchForeignKeyConstraintQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().foreignKeyConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .foreignKeyConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ForeignKeyConstraint for SSR or cache warming - * + * * @example * ```ts * await prefetchForeignKeyConstraintQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchForeignKeyConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ForeignKeyConstraintSelect>; -}): Promise; -export async function prefetchForeignKeyConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchForeignKeyConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ForeignKeyConstraintSelect>; + } +): Promise; +export async function prefetchForeignKeyConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: foreignKeyConstraintKeys.detail(params.id), - queryFn: () => getClient().foreignKeyConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .foreignKeyConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useForeignKeyConstraintsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useForeignKeyConstraintsQuery.ts index daf4e0c226..65b22f0544 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useForeignKeyConstraintsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useForeignKeyConstraintsQuery.ts @@ -4,20 +4,35 @@ * 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 { foreignKeyConstraintKeys } from "../query-keys"; -import type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations, ForeignKeyConstraintFilter, ForeignKeyConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ForeignKeyConstraintSelect, ForeignKeyConstraintWithRelations, ForeignKeyConstraintFilter, ForeignKeyConstraintOrderBy } from "../../orm/input-types"; +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 { foreignKeyConstraintKeys } from '../query-keys'; +import type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ForeignKeyConstraintSelect, + ForeignKeyConstraintWithRelations, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const foreignKeyConstraintsQueryKey = foreignKeyConstraintKeys.list; /** * Query hook for fetching ForeignKeyConstraint list - * + * * @example * ```tsx * const { data, isLoading } = useForeignKeyConstraintsQuery({ @@ -30,33 +45,60 @@ export const foreignKeyConstraintsQueryKey = foreignKeyConstraintKeys.list; * }); * ``` */ -export function useForeignKeyConstraintsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ForeignKeyConstraintSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useForeignKeyConstraintsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useForeignKeyConstraintsQuery< + S extends ForeignKeyConstraintSelect, + TData = { + foreignKeyConstraints: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ForeignKeyConstraintSelect>; + } & Omit< + UseQueryOptions< + { + foreignKeyConstraints: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useForeignKeyConstraintsQuery( + params: { + selection: ListSelectionConfig< + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: foreignKeyConstraintKeys.list(args), queryFn: () => getClient().foreignKeyConstraint.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ForeignKeyConstraint list without React hooks - * + * * @example * ```ts * const data = await fetchForeignKeyConstraintsQuery({ @@ -67,38 +109,70 @@ export function useForeignKeyConstraintsQuery(params: { * }); * ``` */ -export async function fetchForeignKeyConstraintsQuery(params: { +export async function fetchForeignKeyConstraintsQuery< + S extends ForeignKeyConstraintSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ForeignKeyConstraintSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ForeignKeyConstraintSelect>; }): Promise<{ foreignKeyConstraints: ConnectionResult>; }>; export async function fetchForeignKeyConstraintsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy + >(params.selection); return getClient().foreignKeyConstraint.findMany(args).unwrap(); } /** * Prefetch ForeignKeyConstraint list for SSR or cache warming - * + * * @example * ```ts * await prefetchForeignKeyConstraintsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchForeignKeyConstraintsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ForeignKeyConstraintSelect>; -}): Promise; -export async function prefetchForeignKeyConstraintsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchForeignKeyConstraintsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ForeignKeyConstraintSelect>; + } +): Promise; +export async function prefetchForeignKeyConstraintsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: foreignKeyConstraintKeys.list(args), - queryFn: () => getClient().foreignKeyConstraint.findMany(args).unwrap() + queryFn: () => getClient().foreignKeyConstraint.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useFullTextSearchQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useFullTextSearchQuery.ts index 733fe984f1..7a2c74b136 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useFullTextSearchQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useFullTextSearchQuery.ts @@ -4,20 +4,20 @@ * 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 { fullTextSearchKeys } from "../query-keys"; -import type { FullTextSearchSelect, FullTextSearchWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FullTextSearchSelect, FullTextSearchWithRelations } from "../../orm/input-types"; +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 { fullTextSearchKeys } from '../query-keys'; +import type { FullTextSearchSelect, FullTextSearchWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FullTextSearchSelect, FullTextSearchWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const fullTextSearchQueryKey = fullTextSearchKeys.detail; /** * Query hook for fetching a single FullTextSearch - * + * * @example * ```tsx * const { data, isLoading } = useFullTextSearchQuery({ @@ -26,38 +26,52 @@ export const fullTextSearchQueryKey = fullTextSearchKeys.detail; * }); * ``` */ -export function useFullTextSearchQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FullTextSearchSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFullTextSearchQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFullTextSearchQuery< + S extends FullTextSearchSelect, + TData = { + fullTextSearch: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FullTextSearchSelect>; + } & Omit< + UseQueryOptions< + { + fullTextSearch: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFullTextSearchQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: fullTextSearchKeys.detail(params.id), - queryFn: () => getClient().fullTextSearch.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .fullTextSearch.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single FullTextSearch without React hooks - * + * * @example * ```ts * const data = await fetchFullTextSearchQuery({ @@ -79,35 +93,46 @@ export async function fetchFullTextSearchQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().fullTextSearch.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .fullTextSearch.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single FullTextSearch for SSR or cache warming - * + * * @example * ```ts * await prefetchFullTextSearchQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFullTextSearchQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FullTextSearchSelect>; -}): Promise; -export async function prefetchFullTextSearchQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFullTextSearchQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FullTextSearchSelect>; + } +): Promise; +export async function prefetchFullTextSearchQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: fullTextSearchKeys.detail(params.id), - queryFn: () => getClient().fullTextSearch.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .fullTextSearch.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useFullTextSearchesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useFullTextSearchesQuery.ts index 7a0dfd1993..8c0d5db250 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useFullTextSearchesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useFullTextSearchesQuery.ts @@ -4,20 +4,35 @@ * 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 { fullTextSearchKeys } from "../query-keys"; -import type { FullTextSearchSelect, FullTextSearchWithRelations, FullTextSearchFilter, FullTextSearchOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FullTextSearchSelect, FullTextSearchWithRelations, FullTextSearchFilter, FullTextSearchOrderBy } from "../../orm/input-types"; +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 { fullTextSearchKeys } from '../query-keys'; +import type { + FullTextSearchSelect, + FullTextSearchWithRelations, + FullTextSearchFilter, + FullTextSearchOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FullTextSearchSelect, + FullTextSearchWithRelations, + FullTextSearchFilter, + FullTextSearchOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const fullTextSearchesQueryKey = fullTextSearchKeys.list; /** * Query hook for fetching FullTextSearch list - * + * * @example * ```tsx * const { data, isLoading } = useFullTextSearchesQuery({ @@ -30,33 +45,53 @@ export const fullTextSearchesQueryKey = fullTextSearchKeys.list; * }); * ``` */ -export function useFullTextSearchesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FullTextSearchSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFullTextSearchesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFullTextSearchesQuery< + S extends FullTextSearchSelect, + TData = { + fullTextSearches: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FullTextSearchSelect>; + } & Omit< + UseQueryOptions< + { + fullTextSearches: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFullTextSearchesQuery( + params: { + selection: ListSelectionConfig< + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: fullTextSearchKeys.list(args), queryFn: () => getClient().fullTextSearch.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch FullTextSearch list without React hooks - * + * * @example * ```ts * const data = await fetchFullTextSearchesQuery({ @@ -70,35 +105,55 @@ export function useFullTextSearchesQuery(params: { export async function fetchFullTextSearchesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FullTextSearchSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FullTextSearchSelect>; }): Promise<{ fullTextSearches: ConnectionResult>; }>; export async function fetchFullTextSearchesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy + >(params.selection); return getClient().fullTextSearch.findMany(args).unwrap(); } /** * Prefetch FullTextSearch list for SSR or cache warming - * + * * @example * ```ts * await prefetchFullTextSearchesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFullTextSearchesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FullTextSearchSelect>; -}): Promise; -export async function prefetchFullTextSearchesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFullTextSearchesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FullTextSearchSelect>; + } +): Promise; +export async function prefetchFullTextSearchesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: fullTextSearchKeys.list(args), - queryFn: () => getClient().fullTextSearch.findMany(args).unwrap() + queryFn: () => getClient().fullTextSearch.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useFunctionQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useFunctionQuery.ts index e9b7766405..d6251d5c34 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useFunctionQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useFunctionQuery.ts @@ -4,20 +4,20 @@ * 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 { functionKeys } from "../query-keys"; -import type { FunctionSelect, FunctionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionSelect, FunctionWithRelations } from "../../orm/input-types"; +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 { functionKeys } from '../query-keys'; +import type { FunctionSelect, FunctionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionSelect, FunctionWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionQueryKey = functionKeys.detail; /** * Query hook for fetching a single Function - * + * * @example * ```tsx * const { data, isLoading } = useFunctionQuery({ @@ -26,38 +26,52 @@ export const functionQueryKey = functionKeys.detail; * }); * ``` */ -export function useFunctionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionQuery< + S extends FunctionSelect, + TData = { + function: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionSelect>; + } & Omit< + UseQueryOptions< + { + function: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionKeys.detail(params.id), - queryFn: () => getClient().function.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .function.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Function without React hooks - * + * * @example * ```ts * const data = await fetchFunctionQuery({ @@ -79,35 +93,46 @@ export async function fetchFunctionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().function.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .function.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Function for SSR or cache warming - * + * * @example * ```ts * await prefetchFunctionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionSelect>; -}): Promise; -export async function prefetchFunctionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionSelect>; + } +): Promise; +export async function prefetchFunctionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionKeys.detail(params.id), - queryFn: () => getClient().function.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .function.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useFunctionsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useFunctionsQuery.ts index 9b55b275d4..68e1b0b380 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useFunctionsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useFunctionsQuery.ts @@ -4,20 +4,35 @@ * 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 { functionKeys } from "../query-keys"; -import type { FunctionSelect, FunctionWithRelations, FunctionFilter, FunctionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionSelect, FunctionWithRelations, FunctionFilter, FunctionOrderBy } from "../../orm/input-types"; +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 { functionKeys } from '../query-keys'; +import type { + FunctionSelect, + FunctionWithRelations, + FunctionFilter, + FunctionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionSelect, + FunctionWithRelations, + FunctionFilter, + FunctionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionsQueryKey = functionKeys.list; /** * Query hook for fetching Function list - * + * * @example * ```tsx * const { data, isLoading } = useFunctionsQuery({ @@ -30,33 +45,47 @@ export const functionsQueryKey = functionKeys.list; * }); * ``` */ -export function useFunctionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionsQuery< + S extends FunctionSelect, + TData = { + functions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionSelect>; + } & Omit< + UseQueryOptions< + { + functions: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionKeys.list(args), queryFn: () => getClient().function.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Function list without React hooks - * + * * @example * ```ts * const data = await fetchFunctionsQuery({ @@ -70,35 +99,47 @@ export function useFunctionsQuery(params: { export async function fetchFunctionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionSelect>; }): Promise<{ functions: ConnectionResult>; }>; export async function fetchFunctionsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().function.findMany(args).unwrap(); } /** * Prefetch Function list for SSR or cache warming - * + * * @example * ```ts * await prefetchFunctionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionSelect>; -}): Promise; -export async function prefetchFunctionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionSelect>; + } +): Promise; +export async function prefetchFunctionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: functionKeys.list(args), - queryFn: () => getClient().function.findMany(args).unwrap() + queryFn: () => getClient().function.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useHostnameBindingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useHostnameBindingQuery.ts index dc485081c3..d3c7621390 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useHostnameBindingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useHostnameBindingQuery.ts @@ -4,20 +4,20 @@ * 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 { hostnameBindingKeys } from "../query-keys"; -import type { HostnameBindingSelect, HostnameBindingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HostnameBindingSelect, HostnameBindingWithRelations } from "../../orm/input-types"; +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 { hostnameBindingKeys } from '../query-keys'; +import type { HostnameBindingSelect, HostnameBindingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { HostnameBindingSelect, HostnameBindingWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const hostnameBindingQueryKey = hostnameBindingKeys.detail; /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```tsx * const { data, isLoading } = useHostnameBindingQuery({ @@ -26,38 +26,52 @@ export const hostnameBindingQueryKey = hostnameBindingKeys.detail; * }); * ``` */ -export function useHostnameBindingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, HostnameBindingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useHostnameBindingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useHostnameBindingQuery< + S extends HostnameBindingSelect, + TData = { + hostnameBinding: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, HostnameBindingSelect>; + } & Omit< + UseQueryOptions< + { + hostnameBinding: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useHostnameBindingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: hostnameBindingKeys.detail(params.id), - queryFn: () => getClient().hostnameBinding.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .hostnameBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```ts * const data = await fetchHostnameBindingQuery({ @@ -79,35 +93,46 @@ export async function fetchHostnameBindingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().hostnameBinding.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .hostnameBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```ts * await prefetchHostnameBindingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchHostnameBindingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, HostnameBindingSelect>; -}): Promise; -export async function prefetchHostnameBindingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchHostnameBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, HostnameBindingSelect>; + } +): Promise; +export async function prefetchHostnameBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: hostnameBindingKeys.detail(params.id), - queryFn: () => getClient().hostnameBinding.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .hostnameBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useHostnameBindingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useHostnameBindingsQuery.ts index b4c3a662ef..44c53bc7a6 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useHostnameBindingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useHostnameBindingsQuery.ts @@ -4,20 +4,35 @@ * 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 { hostnameBindingKeys } from "../query-keys"; -import type { HostnameBindingSelect, HostnameBindingWithRelations, HostnameBindingFilter, HostnameBindingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { HostnameBindingSelect, HostnameBindingWithRelations, HostnameBindingFilter, HostnameBindingOrderBy } from "../../orm/input-types"; +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 { hostnameBindingKeys } from '../query-keys'; +import type { + HostnameBindingSelect, + HostnameBindingWithRelations, + HostnameBindingFilter, + HostnameBindingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + HostnameBindingSelect, + HostnameBindingWithRelations, + HostnameBindingFilter, + HostnameBindingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const hostnameBindingsQueryKey = hostnameBindingKeys.list; /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```tsx * const { data, isLoading } = useHostnameBindingsQuery({ @@ -30,33 +45,53 @@ export const hostnameBindingsQueryKey = hostnameBindingKeys.list; * }); * ``` */ -export function useHostnameBindingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, HostnameBindingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useHostnameBindingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useHostnameBindingsQuery< + S extends HostnameBindingSelect, + TData = { + hostnameBindings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, HostnameBindingSelect>; + } & Omit< + UseQueryOptions< + { + hostnameBindings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useHostnameBindingsQuery( + params: { + selection: ListSelectionConfig< + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: hostnameBindingKeys.list(args), queryFn: () => getClient().hostnameBinding.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```ts * const data = await fetchHostnameBindingsQuery({ @@ -70,35 +105,59 @@ export function useHostnameBindingsQuery(params: { export async function fetchHostnameBindingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, HostnameBindingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, HostnameBindingSelect>; }): Promise<{ hostnameBindings: ConnectionResult>; }>; export async function fetchHostnameBindingsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy + >(params.selection); return getClient().hostnameBinding.findMany(args).unwrap(); } /** * Compiled hostname index maintained by domain sync triggers; read only through the resolver - * + * * @example * ```ts * await prefetchHostnameBindingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchHostnameBindingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, HostnameBindingSelect>; -}): Promise; -export async function prefetchHostnameBindingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchHostnameBindingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, HostnameBindingSelect>; + } +): Promise; +export async function prefetchHostnameBindingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: hostnameBindingKeys.list(args), - queryFn: () => getClient().hostnameBinding.findMany(args).unwrap() + queryFn: () => getClient().hostnameBinding.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useHttpRouteQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useHttpRouteQuery.ts index 9a173a938b..d649477526 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useHttpRouteQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useHttpRouteQuery.ts @@ -4,20 +4,20 @@ * 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 { httpRouteKeys } from "../query-keys"; -import type { HttpRouteSelect, HttpRouteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteSelect, HttpRouteWithRelations } from "../../orm/input-types"; +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 { httpRouteKeys } from '../query-keys'; +import type { HttpRouteSelect, HttpRouteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { HttpRouteSelect, HttpRouteWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const httpRouteQueryKey = httpRouteKeys.detail; /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```tsx * const { data, isLoading } = useHttpRouteQuery({ @@ -26,38 +26,52 @@ export const httpRouteQueryKey = httpRouteKeys.detail; * }); * ``` */ -export function useHttpRouteQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, HttpRouteSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useHttpRouteQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useHttpRouteQuery< + S extends HttpRouteSelect, + TData = { + httpRoute: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, HttpRouteSelect>; + } & Omit< + UseQueryOptions< + { + httpRoute: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useHttpRouteQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: httpRouteKeys.detail(params.id), - queryFn: () => getClient().httpRoute.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .httpRoute.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```ts * const data = await fetchHttpRouteQuery({ @@ -79,35 +93,46 @@ export async function fetchHttpRouteQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().httpRoute.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .httpRoute.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```ts * await prefetchHttpRouteQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchHttpRouteQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, HttpRouteSelect>; -}): Promise; -export async function prefetchHttpRouteQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchHttpRouteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, HttpRouteSelect>; + } +): Promise; +export async function prefetchHttpRouteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: httpRouteKeys.detail(params.id), - queryFn: () => getClient().httpRoute.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .httpRoute.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useHttpRoutesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useHttpRoutesQuery.ts index 8ff7bce1f5..ae14ba7655 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useHttpRoutesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useHttpRoutesQuery.ts @@ -4,20 +4,35 @@ * 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 { httpRouteKeys } from "../query-keys"; -import type { HttpRouteSelect, HttpRouteWithRelations, HttpRouteFilter, HttpRouteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteSelect, HttpRouteWithRelations, HttpRouteFilter, HttpRouteOrderBy } from "../../orm/input-types"; +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 { httpRouteKeys } from '../query-keys'; +import type { + HttpRouteSelect, + HttpRouteWithRelations, + HttpRouteFilter, + HttpRouteOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + HttpRouteSelect, + HttpRouteWithRelations, + HttpRouteFilter, + HttpRouteOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const httpRoutesQueryKey = httpRouteKeys.list; /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```tsx * const { data, isLoading } = useHttpRoutesQuery({ @@ -30,33 +45,47 @@ export const httpRoutesQueryKey = httpRouteKeys.list; * }); * ``` */ -export function useHttpRoutesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, HttpRouteSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useHttpRoutesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useHttpRoutesQuery< + S extends HttpRouteSelect, + TData = { + httpRoutes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, HttpRouteSelect>; + } & Omit< + UseQueryOptions< + { + httpRoutes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useHttpRoutesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: httpRouteKeys.list(args), queryFn: () => getClient().httpRoute.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```ts * const data = await fetchHttpRoutesQuery({ @@ -70,35 +99,47 @@ export function useHttpRoutesQuery(params: { export async function fetchHttpRoutesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, HttpRouteSelect>; + } & Omit, 'fields'> & + HookStrictSelect, HttpRouteSelect>; }): Promise<{ httpRoutes: ConnectionResult>; }>; export async function fetchHttpRoutesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().httpRoute.findMany(args).unwrap(); } /** * Request-time HTTP routing authority: registered domain plus path prefix and optional method to a typed target - * + * * @example * ```ts * await prefetchHttpRoutesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchHttpRoutesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, HttpRouteSelect>; -}): Promise; -export async function prefetchHttpRoutesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchHttpRoutesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, HttpRouteSelect>; + } +): Promise; +export async function prefetchHttpRoutesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: httpRouteKeys.list(args), - queryFn: () => getClient().httpRoute.findMany(args).unwrap() + queryFn: () => getClient().httpRoute.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useIndexQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useIndexQuery.ts index b6b03ebf62..7feeda908f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useIndexQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useIndexQuery.ts @@ -4,20 +4,20 @@ * 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 { indexKeys } from "../query-keys"; -import type { IndexSelect, IndexWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IndexSelect, IndexWithRelations } from "../../orm/input-types"; +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 { indexKeys } from '../query-keys'; +import type { IndexSelect, IndexWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { IndexSelect, IndexWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const indexQueryKey = indexKeys.detail; /** * Query hook for fetching a single Index - * + * * @example * ```tsx * const { data, isLoading } = useIndexQuery({ @@ -26,38 +26,52 @@ export const indexQueryKey = indexKeys.detail; * }); * ``` */ -export function useIndexQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, IndexSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIndexQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useIndexQuery< + S extends IndexSelect, + TData = { + index: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, IndexSelect>; + } & Omit< + UseQueryOptions< + { + index: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIndexQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: indexKeys.detail(params.id), - queryFn: () => getClient().index.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .index.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Index without React hooks - * + * * @example * ```ts * const data = await fetchIndexQuery({ @@ -79,35 +93,46 @@ export async function fetchIndexQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().index.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .index.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Index for SSR or cache warming - * + * * @example * ```ts * await prefetchIndexQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchIndexQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, IndexSelect>; -}): Promise; -export async function prefetchIndexQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchIndexQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, IndexSelect>; + } +): Promise; +export async function prefetchIndexQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: indexKeys.detail(params.id), - queryFn: () => getClient().index.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .index.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useIndicesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useIndicesQuery.ts index d5121145cd..342fc8d523 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useIndicesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useIndicesQuery.ts @@ -4,20 +4,35 @@ * 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 { indexKeys } from "../query-keys"; -import type { IndexSelect, IndexWithRelations, IndexFilter, IndexOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { IndexSelect, IndexWithRelations, IndexFilter, IndexOrderBy } from "../../orm/input-types"; +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 { indexKeys } from '../query-keys'; +import type { + IndexSelect, + IndexWithRelations, + IndexFilter, + IndexOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + IndexSelect, + IndexWithRelations, + IndexFilter, + IndexOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const indicesQueryKey = indexKeys.list; /** * Query hook for fetching Index list - * + * * @example * ```tsx * const { data, isLoading } = useIndicesQuery({ @@ -30,33 +45,45 @@ export const indicesQueryKey = indexKeys.list; * }); * ``` */ -export function useIndicesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IndexSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIndicesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useIndicesQuery< + S extends IndexSelect, + TData = { + indices: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, IndexSelect>; + } & Omit< + UseQueryOptions< + { + indices: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIndicesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: indexKeys.list(args), queryFn: () => getClient().index.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Index list without React hooks - * + * * @example * ```ts * const data = await fetchIndicesQuery({ @@ -70,7 +97,8 @@ export function useIndicesQuery(params: { export async function fetchIndicesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, IndexSelect>; + } & Omit, 'fields'> & + HookStrictSelect, IndexSelect>; }): Promise<{ indices: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchIndicesQuery(params: { } /** * Prefetch Index list for SSR or cache warming - * + * * @example * ```ts * await prefetchIndicesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchIndicesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IndexSelect>; -}): Promise; -export async function prefetchIndicesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchIndicesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, IndexSelect>; + } +): Promise; +export async function prefetchIndicesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: indexKeys.list(args), - queryFn: () => getClient().index.findMany(args).unwrap() + queryFn: () => getClient().index.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useManagedDomainQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useManagedDomainQuery.ts index 8b86f1aa9a..77d6dab985 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useManagedDomainQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useManagedDomainQuery.ts @@ -4,20 +4,20 @@ * 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 { managedDomainKeys } from "../query-keys"; -import type { ManagedDomainSelect, ManagedDomainWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ManagedDomainSelect, ManagedDomainWithRelations } from "../../orm/input-types"; +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 { managedDomainKeys } from '../query-keys'; +import type { ManagedDomainSelect, ManagedDomainWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ManagedDomainSelect, ManagedDomainWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const managedDomainQueryKey = managedDomainKeys.detail; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { data, isLoading } = useManagedDomainQuery({ @@ -26,38 +26,52 @@ export const managedDomainQueryKey = managedDomainKeys.detail; * }); * ``` */ -export function useManagedDomainQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ManagedDomainSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useManagedDomainQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useManagedDomainQuery< + S extends ManagedDomainSelect, + TData = { + managedDomain: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ManagedDomainSelect>; + } & Omit< + UseQueryOptions< + { + managedDomain: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useManagedDomainQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: managedDomainKeys.detail(params.id), - queryFn: () => getClient().managedDomain.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .managedDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```ts * const data = await fetchManagedDomainQuery({ @@ -79,35 +93,46 @@ export async function fetchManagedDomainQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().managedDomain.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .managedDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```ts * await prefetchManagedDomainQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchManagedDomainQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ManagedDomainSelect>; -}): Promise; -export async function prefetchManagedDomainQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchManagedDomainQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ManagedDomainSelect>; + } +): Promise; +export async function prefetchManagedDomainQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: managedDomainKeys.detail(params.id), - queryFn: () => getClient().managedDomain.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .managedDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useManagedDomainsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useManagedDomainsQuery.ts index bdade39ef0..48093e6b1b 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useManagedDomainsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useManagedDomainsQuery.ts @@ -4,20 +4,35 @@ * 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 { managedDomainKeys } from "../query-keys"; -import type { ManagedDomainSelect, ManagedDomainWithRelations, ManagedDomainFilter, ManagedDomainOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ManagedDomainSelect, ManagedDomainWithRelations, ManagedDomainFilter, ManagedDomainOrderBy } from "../../orm/input-types"; +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 { managedDomainKeys } from '../query-keys'; +import type { + ManagedDomainSelect, + ManagedDomainWithRelations, + ManagedDomainFilter, + ManagedDomainOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ManagedDomainSelect, + ManagedDomainWithRelations, + ManagedDomainFilter, + ManagedDomainOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const managedDomainsQueryKey = managedDomainKeys.list; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { data, isLoading } = useManagedDomainsQuery({ @@ -30,33 +45,49 @@ export const managedDomainsQueryKey = managedDomainKeys.list; * }); * ``` */ -export function useManagedDomainsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ManagedDomainSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useManagedDomainsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useManagedDomainsQuery< + S extends ManagedDomainSelect, + TData = { + managedDomains: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ManagedDomainSelect>; + } & Omit< + UseQueryOptions< + { + managedDomains: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useManagedDomainsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ManagedDomainSelect, + ManagedDomainFilter, + ManagedDomainOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: managedDomainKeys.list(args), queryFn: () => getClient().managedDomain.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```ts * const data = await fetchManagedDomainsQuery({ @@ -70,35 +101,51 @@ export function useManagedDomainsQuery(params: { export async function fetchManagedDomainsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ManagedDomainSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ManagedDomainSelect>; }): Promise<{ managedDomains: ConnectionResult>; }>; export async function fetchManagedDomainsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ManagedDomainSelect, + ManagedDomainFilter, + ManagedDomainOrderBy + >(params.selection); return getClient().managedDomain.findMany(args).unwrap(); } /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```ts * await prefetchManagedDomainsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchManagedDomainsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ManagedDomainSelect>; -}): Promise; -export async function prefetchManagedDomainsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchManagedDomainsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ManagedDomainSelect>; + } +): Promise; +export async function prefetchManagedDomainsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + ManagedDomainSelect, + ManagedDomainFilter, + ManagedDomainOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: managedDomainKeys.list(args), - queryFn: () => getClient().managedDomain.findMany(args).unwrap() + queryFn: () => getClient().managedDomain.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useNodeTypeRegistriesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useNodeTypeRegistriesQuery.ts index a4da6ddff1..1a6d70d894 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useNodeTypeRegistriesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useNodeTypeRegistriesQuery.ts @@ -4,20 +4,35 @@ * 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 { nodeTypeRegistryKeys } from "../query-keys"; -import type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations, NodeTypeRegistryFilter, NodeTypeRegistryOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations, NodeTypeRegistryFilter, NodeTypeRegistryOrderBy } from "../../orm/input-types"; +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 { nodeTypeRegistryKeys } from '../query-keys'; +import type { + NodeTypeRegistrySelect, + NodeTypeRegistryWithRelations, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + NodeTypeRegistrySelect, + NodeTypeRegistryWithRelations, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const nodeTypeRegistriesQueryKey = nodeTypeRegistryKeys.list; /** * Query hook for fetching NodeTypeRegistry list - * + * * @example * ```tsx * const { data, isLoading } = useNodeTypeRegistriesQuery({ @@ -30,33 +45,53 @@ export const nodeTypeRegistriesQueryKey = nodeTypeRegistryKeys.list; * }); * ``` */ -export function useNodeTypeRegistriesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NodeTypeRegistrySelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNodeTypeRegistriesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useNodeTypeRegistriesQuery< + S extends NodeTypeRegistrySelect, + TData = { + nodeTypeRegistries: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NodeTypeRegistrySelect>; + } & Omit< + UseQueryOptions< + { + nodeTypeRegistries: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNodeTypeRegistriesQuery( + params: { + selection: ListSelectionConfig< + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: nodeTypeRegistryKeys.list(args), queryFn: () => getClient().nodeTypeRegistry.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch NodeTypeRegistry list without React hooks - * + * * @example * ```ts * const data = await fetchNodeTypeRegistriesQuery({ @@ -70,35 +105,59 @@ export function useNodeTypeRegistriesQuery(params: { export async function fetchNodeTypeRegistriesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, NodeTypeRegistrySelect>; + } & Omit, 'fields'> & + HookStrictSelect, NodeTypeRegistrySelect>; }): Promise<{ nodeTypeRegistries: ConnectionResult>; }>; export async function fetchNodeTypeRegistriesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy + >(params.selection); return getClient().nodeTypeRegistry.findMany(args).unwrap(); } /** * Prefetch NodeTypeRegistry list for SSR or cache warming - * + * * @example * ```ts * await prefetchNodeTypeRegistriesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchNodeTypeRegistriesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NodeTypeRegistrySelect>; -}): Promise; -export async function prefetchNodeTypeRegistriesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchNodeTypeRegistriesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NodeTypeRegistrySelect>; + } +): Promise; +export async function prefetchNodeTypeRegistriesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: nodeTypeRegistryKeys.list(args), - queryFn: () => getClient().nodeTypeRegistry.findMany(args).unwrap() + queryFn: () => getClient().nodeTypeRegistry.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useNodeTypeRegistryQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useNodeTypeRegistryQuery.ts index d858f3d118..082c1bada1 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useNodeTypeRegistryQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useNodeTypeRegistryQuery.ts @@ -4,20 +4,20 @@ * 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 { nodeTypeRegistryKeys } from "../query-keys"; -import type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations } from "../../orm/input-types"; +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 { nodeTypeRegistryKeys } from '../query-keys'; +import type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NodeTypeRegistrySelect, NodeTypeRegistryWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const nodeTypeRegistryQueryKey = nodeTypeRegistryKeys.detail; /** * Query hook for fetching a single NodeTypeRegistry - * + * * @example * ```tsx * const { data, isLoading } = useNodeTypeRegistryQuery({ @@ -26,38 +26,52 @@ export const nodeTypeRegistryQueryKey = nodeTypeRegistryKeys.detail; * }); * ``` */ -export function useNodeTypeRegistryQuery | null; -}>(params: { - name: string; - selection: { - fields: S; - } & HookStrictSelect, NodeTypeRegistrySelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNodeTypeRegistryQuery(params: { - name: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useNodeTypeRegistryQuery< + S extends NodeTypeRegistrySelect, + TData = { + nodeTypeRegistry: InferSelectResult | null; + }, +>( + params: { + name: string; + selection: { + fields: S; + } & HookStrictSelect, NodeTypeRegistrySelect>; + } & Omit< + UseQueryOptions< + { + nodeTypeRegistry: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNodeTypeRegistryQuery( + params: { + name: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: nodeTypeRegistryKeys.detail(params.name), - queryFn: () => getClient().nodeTypeRegistry.findOne({ - name: params.name, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .nodeTypeRegistry.findOne({ + name: params.name, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single NodeTypeRegistry without React hooks - * + * * @example * ```ts * const data = await fetchNodeTypeRegistryQuery({ @@ -79,35 +93,46 @@ export async function fetchNodeTypeRegistryQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().nodeTypeRegistry.findOne({ - name: params.name, - select: args.select - }).unwrap(); + return getClient() + .nodeTypeRegistry.findOne({ + name: params.name, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single NodeTypeRegistry for SSR or cache warming - * + * * @example * ```ts * await prefetchNodeTypeRegistryQuery(queryClient, { name: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchNodeTypeRegistryQuery(queryClient: QueryClient, params: { - name: string; - selection: { - fields: S; - } & HookStrictSelect, NodeTypeRegistrySelect>; -}): Promise; -export async function prefetchNodeTypeRegistryQuery(queryClient: QueryClient, params: { - name: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchNodeTypeRegistryQuery( + queryClient: QueryClient, + params: { + name: string; + selection: { + fields: S; + } & HookStrictSelect, NodeTypeRegistrySelect>; + } +): Promise; +export async function prefetchNodeTypeRegistryQuery( + queryClient: QueryClient, + params: { + name: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: nodeTypeRegistryKeys.detail(params.name), - queryFn: () => getClient().nodeTypeRegistry.findOne({ - name: params.name, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .nodeTypeRegistry.findOne({ + name: params.name, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePartitionQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePartitionQuery.ts index bdcbf2836c..0dfb7fdd99 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePartitionQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePartitionQuery.ts @@ -4,20 +4,20 @@ * 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 { partitionKeys } from "../query-keys"; -import type { PartitionSelect, PartitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PartitionSelect, PartitionWithRelations } from "../../orm/input-types"; +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 { partitionKeys } from '../query-keys'; +import type { PartitionSelect, PartitionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PartitionSelect, PartitionWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const partitionQueryKey = partitionKeys.detail; /** * Query hook for fetching a single Partition - * + * * @example * ```tsx * const { data, isLoading } = usePartitionQuery({ @@ -26,38 +26,52 @@ export const partitionQueryKey = partitionKeys.detail; * }); * ``` */ -export function usePartitionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PartitionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePartitionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePartitionQuery< + S extends PartitionSelect, + TData = { + partition: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PartitionSelect>; + } & Omit< + UseQueryOptions< + { + partition: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePartitionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: partitionKeys.detail(params.id), - queryFn: () => getClient().partition.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .partition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Partition without React hooks - * + * * @example * ```ts * const data = await fetchPartitionQuery({ @@ -79,35 +93,46 @@ export async function fetchPartitionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().partition.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .partition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Partition for SSR or cache warming - * + * * @example * ```ts * await prefetchPartitionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPartitionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PartitionSelect>; -}): Promise; -export async function prefetchPartitionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPartitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PartitionSelect>; + } +): Promise; +export async function prefetchPartitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: partitionKeys.detail(params.id), - queryFn: () => getClient().partition.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .partition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePartitionsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePartitionsQuery.ts index 04af7de0cb..3a61acc14c 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePartitionsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePartitionsQuery.ts @@ -4,20 +4,35 @@ * 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 { partitionKeys } from "../query-keys"; -import type { PartitionSelect, PartitionWithRelations, PartitionFilter, PartitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PartitionSelect, PartitionWithRelations, PartitionFilter, PartitionOrderBy } from "../../orm/input-types"; +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 { partitionKeys } from '../query-keys'; +import type { + PartitionSelect, + PartitionWithRelations, + PartitionFilter, + PartitionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PartitionSelect, + PartitionWithRelations, + PartitionFilter, + PartitionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const partitionsQueryKey = partitionKeys.list; /** * Query hook for fetching Partition list - * + * * @example * ```tsx * const { data, isLoading } = usePartitionsQuery({ @@ -30,33 +45,47 @@ export const partitionsQueryKey = partitionKeys.list; * }); * ``` */ -export function usePartitionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PartitionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePartitionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePartitionsQuery< + S extends PartitionSelect, + TData = { + partitions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PartitionSelect>; + } & Omit< + UseQueryOptions< + { + partitions: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePartitionsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: partitionKeys.list(args), queryFn: () => getClient().partition.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Partition list without React hooks - * + * * @example * ```ts * const data = await fetchPartitionsQuery({ @@ -70,35 +99,47 @@ export function usePartitionsQuery(params: { export async function fetchPartitionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PartitionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PartitionSelect>; }): Promise<{ partitions: ConnectionResult>; }>; export async function fetchPartitionsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().partition.findMany(args).unwrap(); } /** * Prefetch Partition list for SSR or cache warming - * + * * @example * ```ts * await prefetchPartitionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPartitionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PartitionSelect>; -}): Promise; -export async function prefetchPartitionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPartitionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PartitionSelect>; + } +): Promise; +export async function prefetchPartitionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: partitionKeys.list(args), - queryFn: () => getClient().partition.findMany(args).unwrap() + queryFn: () => getClient().partition.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiModuleQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiModuleQuery.ts index 58dfaf2c31..2418dee994 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiModuleQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { platformApiModuleKeys } from "../query-keys"; -import type { PlatformApiModuleSelect, PlatformApiModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiModuleSelect, PlatformApiModuleWithRelations } from "../../orm/input-types"; +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 { platformApiModuleKeys } from '../query-keys'; +import type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformApiModuleQueryKey = platformApiModuleKeys.detail; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { data, isLoading } = usePlatformApiModuleQuery({ @@ -26,38 +32,52 @@ export const platformApiModuleQueryKey = platformApiModuleKeys.detail; * }); * ``` */ -export function usePlatformApiModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformApiModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformApiModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformApiModuleQuery< + S extends PlatformApiModuleSelect, + TData = { + platformApiModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformApiModuleSelect>; + } & Omit< + UseQueryOptions< + { + platformApiModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformApiModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformApiModuleKeys.detail(params.id), - queryFn: () => getClient().platformApiModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformApiModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```ts * const data = await fetchPlatformApiModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformApiModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformApiModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformApiModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```ts * await prefetchPlatformApiModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformApiModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformApiModuleSelect>; -}): Promise; -export async function prefetchPlatformApiModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformApiModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformApiModuleSelect>; + } +): Promise; +export async function prefetchPlatformApiModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformApiModuleKeys.detail(params.id), - queryFn: () => getClient().platformApiModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformApiModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiModulesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiModulesQuery.ts index 138149e6f0..91f3e0ef81 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiModulesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformApiModuleKeys } from "../query-keys"; -import type { PlatformApiModuleSelect, PlatformApiModuleWithRelations, PlatformApiModuleFilter, PlatformApiModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiModuleSelect, PlatformApiModuleWithRelations, PlatformApiModuleFilter, PlatformApiModuleOrderBy } from "../../orm/input-types"; +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 { platformApiModuleKeys } from '../query-keys'; +import type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformApiModuleSelect, + PlatformApiModuleWithRelations, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformApiModulesQueryKey = platformApiModuleKeys.list; /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```tsx * const { data, isLoading } = usePlatformApiModulesQuery({ @@ -30,33 +45,53 @@ export const platformApiModulesQueryKey = platformApiModuleKeys.list; * }); * ``` */ -export function usePlatformApiModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformApiModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformApiModulesQuery< + S extends PlatformApiModuleSelect, + TData = { + platformApiModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiModuleSelect>; + } & Omit< + UseQueryOptions< + { + platformApiModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformApiModulesQuery( + params: { + selection: ListSelectionConfig< + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformApiModuleKeys.list(args), queryFn: () => getClient().platformApiModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```ts * const data = await fetchPlatformApiModulesQuery({ @@ -70,35 +105,59 @@ export function usePlatformApiModulesQuery(params: { export async function fetchPlatformApiModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiModuleSelect>; }): Promise<{ platformApiModules: ConnectionResult>; }>; export async function fetchPlatformApiModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy + >(params.selection); return getClient().platformApiModule.findMany(args).unwrap(); } /** * Server-side module configuration for an API surface; stores module name and JSON settings - * + * * @example * ```ts * await prefetchPlatformApiModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformApiModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiModuleSelect>; -}): Promise; -export async function prefetchPlatformApiModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformApiModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiModuleSelect>; + } +): Promise; +export async function prefetchPlatformApiModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformApiModuleKeys.list(args), - queryFn: () => getClient().platformApiModule.findMany(args).unwrap() + queryFn: () => getClient().platformApiModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiQuery.ts index b3027d1974..d3e15ed945 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiQuery.ts @@ -4,20 +4,20 @@ * 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 { platformApiKeys } from "../query-keys"; -import type { PlatformApiSelect, PlatformApiWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSelect, PlatformApiWithRelations } from "../../orm/input-types"; +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 { platformApiKeys } from '../query-keys'; +import type { PlatformApiSelect, PlatformApiWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformApiSelect, PlatformApiWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformApiQueryKey = platformApiKeys.detail; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { data, isLoading } = usePlatformApiQuery({ @@ -26,38 +26,52 @@ export const platformApiQueryKey = platformApiKeys.detail; * }); * ``` */ -export function usePlatformApiQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformApiSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformApiQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformApiQuery< + S extends PlatformApiSelect, + TData = { + platformApi: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformApiSelect>; + } & Omit< + UseQueryOptions< + { + platformApi: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformApiQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformApiKeys.detail(params.id), - queryFn: () => getClient().platformApi.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformApi.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * const data = await fetchPlatformApiQuery({ @@ -79,35 +93,46 @@ export async function fetchPlatformApiQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformApi.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformApi.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * await prefetchPlatformApiQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformApiQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformApiSelect>; -}): Promise; -export async function prefetchPlatformApiQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformApiQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformApiSelect>; + } +): Promise; +export async function prefetchPlatformApiQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformApiKeys.detail(params.id), - queryFn: () => getClient().platformApi.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformApi.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSchemaQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSchemaQuery.ts index 9dcf0fe779..844d32768c 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSchemaQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSchemaQuery.ts @@ -4,20 +4,26 @@ * 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 { platformApiSchemaKeys } from "../query-keys"; -import type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations } from "../../orm/input-types"; +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 { platformApiSchemaKeys } from '../query-keys'; +import type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformApiSchemaQueryKey = platformApiSchemaKeys.detail; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { data, isLoading } = usePlatformApiSchemaQuery({ @@ -26,38 +32,52 @@ export const platformApiSchemaQueryKey = platformApiSchemaKeys.detail; * }); * ``` */ -export function usePlatformApiSchemaQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformApiSchemaSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformApiSchemaQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformApiSchemaQuery< + S extends PlatformApiSchemaSelect, + TData = { + platformApiSchema: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformApiSchemaSelect>; + } & Omit< + UseQueryOptions< + { + platformApiSchema: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformApiSchemaQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformApiSchemaKeys.detail(params.id), - queryFn: () => getClient().platformApiSchema.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformApiSchema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```ts * const data = await fetchPlatformApiSchemaQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformApiSchemaQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformApiSchema.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformApiSchema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```ts * await prefetchPlatformApiSchemaQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformApiSchemaQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformApiSchemaSelect>; -}): Promise; -export async function prefetchPlatformApiSchemaQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformApiSchemaQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformApiSchemaSelect>; + } +): Promise; +export async function prefetchPlatformApiSchemaQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformApiSchemaKeys.detail(params.id), - queryFn: () => getClient().platformApiSchema.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformApiSchema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSchemasQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSchemasQuery.ts index f037581647..6fcf9c8737 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSchemasQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSchemasQuery.ts @@ -4,20 +4,35 @@ * 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 { platformApiSchemaKeys } from "../query-keys"; -import type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations, PlatformApiSchemaFilter, PlatformApiSchemaOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSchemaSelect, PlatformApiSchemaWithRelations, PlatformApiSchemaFilter, PlatformApiSchemaOrderBy } from "../../orm/input-types"; +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 { platformApiSchemaKeys } from '../query-keys'; +import type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformApiSchemaSelect, + PlatformApiSchemaWithRelations, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformApiSchemasQueryKey = platformApiSchemaKeys.list; /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```tsx * const { data, isLoading } = usePlatformApiSchemasQuery({ @@ -30,33 +45,53 @@ export const platformApiSchemasQueryKey = platformApiSchemaKeys.list; * }); * ``` */ -export function usePlatformApiSchemasQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSchemaSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformApiSchemasQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformApiSchemasQuery< + S extends PlatformApiSchemaSelect, + TData = { + platformApiSchemas: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiSchemaSelect>; + } & Omit< + UseQueryOptions< + { + platformApiSchemas: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformApiSchemasQuery( + params: { + selection: ListSelectionConfig< + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformApiSchemaKeys.list(args), queryFn: () => getClient().platformApiSchema.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```ts * const data = await fetchPlatformApiSchemasQuery({ @@ -70,35 +105,59 @@ export function usePlatformApiSchemasQuery(params: { export async function fetchPlatformApiSchemasQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSchemaSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiSchemaSelect>; }): Promise<{ platformApiSchemas: ConnectionResult>; }>; export async function fetchPlatformApiSchemasQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy + >(params.selection); return getClient().platformApiSchema.findMany(args).unwrap(); } /** * Join table linking API surfaces to the metaschema schemas they expose - * + * * @example * ```ts * await prefetchPlatformApiSchemasQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformApiSchemasQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSchemaSelect>; -}): Promise; -export async function prefetchPlatformApiSchemasQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformApiSchemasQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiSchemaSelect>; + } +): Promise; +export async function prefetchPlatformApiSchemasQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformApiSchemaKeys.list(args), - queryFn: () => getClient().platformApiSchema.findMany(args).unwrap() + queryFn: () => getClient().platformApiSchema.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSettingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSettingQuery.ts index e13d91d7db..0579751198 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSettingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSettingQuery.ts @@ -4,20 +4,26 @@ * 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 { platformApiSettingKeys } from "../query-keys"; -import type { PlatformApiSettingSelect, PlatformApiSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSettingSelect, PlatformApiSettingWithRelations } from "../../orm/input-types"; +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 { platformApiSettingKeys } from '../query-keys'; +import type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformApiSettingQueryKey = platformApiSettingKeys.detail; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { data, isLoading } = usePlatformApiSettingQuery({ @@ -26,38 +32,52 @@ export const platformApiSettingQueryKey = platformApiSettingKeys.detail; * }); * ``` */ -export function usePlatformApiSettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformApiSettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformApiSettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformApiSettingQuery< + S extends PlatformApiSettingSelect, + TData = { + platformApiSetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformApiSettingSelect>; + } & Omit< + UseQueryOptions< + { + platformApiSetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformApiSettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformApiSettingKeys.detail(params.id), - queryFn: () => getClient().platformApiSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformApiSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```ts * const data = await fetchPlatformApiSettingQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformApiSettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformApiSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformApiSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```ts * await prefetchPlatformApiSettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformApiSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformApiSettingSelect>; -}): Promise; -export async function prefetchPlatformApiSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformApiSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformApiSettingSelect>; + } +): Promise; +export async function prefetchPlatformApiSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformApiSettingKeys.detail(params.id), - queryFn: () => getClient().platformApiSetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformApiSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSettingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSettingsQuery.ts index a970a8cd6c..7832368ee2 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSettingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformApiSettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformApiSettingKeys } from "../query-keys"; -import type { PlatformApiSettingSelect, PlatformApiSettingWithRelations, PlatformApiSettingFilter, PlatformApiSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSettingSelect, PlatformApiSettingWithRelations, PlatformApiSettingFilter, PlatformApiSettingOrderBy } from "../../orm/input-types"; +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 { platformApiSettingKeys } from '../query-keys'; +import type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformApiSettingSelect, + PlatformApiSettingWithRelations, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformApiSettingsQueryKey = platformApiSettingKeys.list; /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```tsx * const { data, isLoading } = usePlatformApiSettingsQuery({ @@ -30,33 +45,58 @@ export const platformApiSettingsQueryKey = platformApiSettingKeys.list; * }); * ``` */ -export function usePlatformApiSettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformApiSettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformApiSettingsQuery< + S extends PlatformApiSettingSelect, + TData = { + platformApiSettings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformApiSettingSelect>; + } & Omit< + UseQueryOptions< + { + platformApiSettings: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformApiSettingsQuery( + params: { + selection: ListSelectionConfig< + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformApiSettingKeys.list(args), queryFn: () => getClient().platformApiSetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```ts * const data = await fetchPlatformApiSettingsQuery({ @@ -70,35 +110,62 @@ export function usePlatformApiSettingsQuery(params: { export async function fetchPlatformApiSettingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSettingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiSettingSelect>; }): Promise<{ platformApiSettings: ConnectionResult>; }>; export async function fetchPlatformApiSettingsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy + >(params.selection); return getClient().platformApiSetting.findMany(args).unwrap(); } /** * Per-API feature flag overrides; NULL columns inherit from database_settings - * + * * @example * ```ts * await prefetchPlatformApiSettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformApiSettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSettingSelect>; -}): Promise; -export async function prefetchPlatformApiSettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformApiSettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformApiSettingSelect>; + } +): Promise; +export async function prefetchPlatformApiSettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformApiSettingKeys.list(args), - queryFn: () => getClient().platformApiSetting.findMany(args).unwrap() + queryFn: () => getClient().platformApiSetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformApisQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformApisQuery.ts index 95fd134aa2..37b47ae91c 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformApisQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformApisQuery.ts @@ -4,20 +4,35 @@ * 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 { platformApiKeys } from "../query-keys"; -import type { PlatformApiSelect, PlatformApiWithRelations, PlatformApiFilter, PlatformApiOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformApiSelect, PlatformApiWithRelations, PlatformApiFilter, PlatformApiOrderBy } from "../../orm/input-types"; +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 { platformApiKeys } from '../query-keys'; +import type { + PlatformApiSelect, + PlatformApiWithRelations, + PlatformApiFilter, + PlatformApiOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformApiSelect, + PlatformApiWithRelations, + PlatformApiFilter, + PlatformApiOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformApisQueryKey = platformApiKeys.list; /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { data, isLoading } = usePlatformApisQuery({ @@ -30,33 +45,47 @@ export const platformApisQueryKey = platformApiKeys.list; * }); * ``` */ -export function usePlatformApisQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformApisQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformApisQuery< + S extends PlatformApiSelect, + TData = { + platformApis: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiSelect>; + } & Omit< + UseQueryOptions< + { + platformApis: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformApisQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformApiKeys.list(args), queryFn: () => getClient().platformApi.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * const data = await fetchPlatformApisQuery({ @@ -70,35 +99,47 @@ export function usePlatformApisQuery(params: { export async function fetchPlatformApisQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiSelect>; }): Promise<{ platformApis: ConnectionResult>; }>; export async function fetchPlatformApisQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().platformApi.findMany(args).unwrap(); } /** * API surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * await prefetchPlatformApisQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformApisQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformApiSelect>; -}): Promise; -export async function prefetchPlatformApisQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformApisQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformApiSelect>; + } +): Promise; +export async function prefetchPlatformApisQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: platformApiKeys.list(args), - queryFn: () => getClient().platformApi.findMany(args).unwrap() + queryFn: () => getClient().platformApi.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformCorsSettingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformCorsSettingQuery.ts index 7eccc1360e..2682f583cd 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformCorsSettingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformCorsSettingQuery.ts @@ -4,20 +4,26 @@ * 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 { platformCorsSettingKeys } from "../query-keys"; -import type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations } from "../../orm/input-types"; +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 { platformCorsSettingKeys } from '../query-keys'; +import type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformCorsSettingQueryKey = platformCorsSettingKeys.detail; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { data, isLoading } = usePlatformCorsSettingQuery({ @@ -26,38 +32,52 @@ export const platformCorsSettingQueryKey = platformCorsSettingKeys.detail; * }); * ``` */ -export function usePlatformCorsSettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformCorsSettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformCorsSettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformCorsSettingQuery< + S extends PlatformCorsSettingSelect, + TData = { + platformCorsSetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformCorsSettingSelect>; + } & Omit< + UseQueryOptions< + { + platformCorsSetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformCorsSettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformCorsSettingKeys.detail(params.id), - queryFn: () => getClient().platformCorsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformCorsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```ts * const data = await fetchPlatformCorsSettingQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformCorsSettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformCorsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformCorsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```ts * await prefetchPlatformCorsSettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformCorsSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformCorsSettingSelect>; -}): Promise; -export async function prefetchPlatformCorsSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformCorsSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformCorsSettingSelect>; + } +): Promise; +export async function prefetchPlatformCorsSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformCorsSettingKeys.detail(params.id), - queryFn: () => getClient().platformCorsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformCorsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformCorsSettingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformCorsSettingsQuery.ts index 07c6856b67..9fed2f7e0d 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformCorsSettingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformCorsSettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformCorsSettingKeys } from "../query-keys"; -import type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations, PlatformCorsSettingFilter, PlatformCorsSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformCorsSettingSelect, PlatformCorsSettingWithRelations, PlatformCorsSettingFilter, PlatformCorsSettingOrderBy } from "../../orm/input-types"; +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 { platformCorsSettingKeys } from '../query-keys'; +import type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformCorsSettingSelect, + PlatformCorsSettingWithRelations, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformCorsSettingsQueryKey = platformCorsSettingKeys.list; /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```tsx * const { data, isLoading } = usePlatformCorsSettingsQuery({ @@ -30,33 +45,58 @@ export const platformCorsSettingsQueryKey = platformCorsSettingKeys.list; * }); * ``` */ -export function usePlatformCorsSettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformCorsSettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformCorsSettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformCorsSettingsQuery< + S extends PlatformCorsSettingSelect, + TData = { + platformCorsSettings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformCorsSettingSelect>; + } & Omit< + UseQueryOptions< + { + platformCorsSettings: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformCorsSettingsQuery( + params: { + selection: ListSelectionConfig< + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformCorsSettingKeys.list(args), queryFn: () => getClient().platformCorsSetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```ts * const data = await fetchPlatformCorsSettingsQuery({ @@ -70,35 +110,65 @@ export function usePlatformCorsSettingsQuery(params: { export async function fetchPlatformCorsSettingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformCorsSettingSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformCorsSettingSelect>; }): Promise<{ platformCorsSettings: ConnectionResult>; }>; export async function fetchPlatformCorsSettingsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy + >(params.selection); return getClient().platformCorsSetting.findMany(args).unwrap(); } /** * Scope-wide and per-API CORS origin configuration; NULL api_id means scope-wide default - * + * * @example * ```ts * await prefetchPlatformCorsSettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformCorsSettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformCorsSettingSelect>; -}): Promise; -export async function prefetchPlatformCorsSettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformCorsSettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformCorsSettingSelect>; + } +): Promise; +export async function prefetchPlatformCorsSettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformCorsSettingKeys.list(args), - queryFn: () => getClient().platformCorsSetting.findMany(args).unwrap() + queryFn: () => getClient().platformCorsSetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainEventQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainEventQuery.ts index 00384a2abb..ab650f2d60 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainEventQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainEventQuery.ts @@ -4,20 +4,26 @@ * 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 { platformDomainEventKeys } from "../query-keys"; -import type { PlatformDomainEventSelect, PlatformDomainEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainEventSelect, PlatformDomainEventWithRelations } from "../../orm/input-types"; +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 { platformDomainEventKeys } from '../query-keys'; +import type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformDomainEventQueryKey = platformDomainEventKeys.detail; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { data, isLoading } = usePlatformDomainEventQuery({ @@ -26,38 +32,52 @@ export const platformDomainEventQueryKey = platformDomainEventKeys.detail; * }); * ``` */ -export function usePlatformDomainEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformDomainEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformDomainEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformDomainEventQuery< + S extends PlatformDomainEventSelect, + TData = { + platformDomainEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformDomainEventSelect>; + } & Omit< + UseQueryOptions< + { + platformDomainEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformDomainEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformDomainEventKeys.detail(params.id), - queryFn: () => getClient().platformDomainEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformDomainEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Audit trail of domain lifecycle events - * + * * @example * ```ts * const data = await fetchPlatformDomainEventQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformDomainEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformDomainEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformDomainEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Audit trail of domain lifecycle events - * + * * @example * ```ts * await prefetchPlatformDomainEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformDomainEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformDomainEventSelect>; -}): Promise; -export async function prefetchPlatformDomainEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformDomainEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformDomainEventSelect>; + } +): Promise; +export async function prefetchPlatformDomainEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformDomainEventKeys.detail(params.id), - queryFn: () => getClient().platformDomainEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformDomainEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainEventsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainEventsQuery.ts index 5d6add92d4..6125f039c3 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainEventsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformDomainEventKeys } from "../query-keys"; -import type { PlatformDomainEventSelect, PlatformDomainEventWithRelations, PlatformDomainEventFilter, PlatformDomainEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainEventSelect, PlatformDomainEventWithRelations, PlatformDomainEventFilter, PlatformDomainEventOrderBy } from "../../orm/input-types"; +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 { platformDomainEventKeys } from '../query-keys'; +import type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformDomainEventSelect, + PlatformDomainEventWithRelations, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformDomainEventsQueryKey = platformDomainEventKeys.list; /** * Audit trail of domain lifecycle events - * + * * @example * ```tsx * const { data, isLoading } = usePlatformDomainEventsQuery({ @@ -30,33 +45,58 @@ export const platformDomainEventsQueryKey = platformDomainEventKeys.list; * }); * ``` */ -export function usePlatformDomainEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformDomainEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformDomainEventsQuery< + S extends PlatformDomainEventSelect, + TData = { + platformDomainEvents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformDomainEventSelect>; + } & Omit< + UseQueryOptions< + { + platformDomainEvents: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformDomainEventsQuery( + params: { + selection: ListSelectionConfig< + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformDomainEventKeys.list(args), queryFn: () => getClient().platformDomainEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Audit trail of domain lifecycle events - * + * * @example * ```ts * const data = await fetchPlatformDomainEventsQuery({ @@ -70,35 +110,65 @@ export function usePlatformDomainEventsQuery(params: { export async function fetchPlatformDomainEventsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainEventSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformDomainEventSelect>; }): Promise<{ platformDomainEvents: ConnectionResult>; }>; export async function fetchPlatformDomainEventsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy + >(params.selection); return getClient().platformDomainEvent.findMany(args).unwrap(); } /** * Audit trail of domain lifecycle events - * + * * @example * ```ts * await prefetchPlatformDomainEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformDomainEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainEventSelect>; -}): Promise; -export async function prefetchPlatformDomainEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformDomainEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformDomainEventSelect>; + } +): Promise; +export async function prefetchPlatformDomainEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformDomainEventKeys.list(args), - queryFn: () => getClient().platformDomainEvent.findMany(args).unwrap() + queryFn: () => getClient().platformDomainEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainQuery.ts index 84abc3c805..1b2a850acc 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainQuery.ts @@ -4,20 +4,20 @@ * 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 { platformDomainKeys } from "../query-keys"; -import type { PlatformDomainSelect, PlatformDomainWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainSelect, PlatformDomainWithRelations } from "../../orm/input-types"; +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 { platformDomainKeys } from '../query-keys'; +import type { PlatformDomainSelect, PlatformDomainWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformDomainSelect, PlatformDomainWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformDomainQueryKey = platformDomainKeys.detail; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { data, isLoading } = usePlatformDomainQuery({ @@ -26,38 +26,52 @@ export const platformDomainQueryKey = platformDomainKeys.detail; * }); * ``` */ -export function usePlatformDomainQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformDomainSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformDomainQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformDomainQuery< + S extends PlatformDomainSelect, + TData = { + platformDomain: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformDomainSelect>; + } & Omit< + UseQueryOptions< + { + platformDomain: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformDomainQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformDomainKeys.detail(params.id), - queryFn: () => getClient().platformDomain.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```ts * const data = await fetchPlatformDomainQuery({ @@ -79,35 +93,46 @@ export async function fetchPlatformDomainQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformDomain.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```ts * await prefetchPlatformDomainQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformDomainQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformDomainSelect>; -}): Promise; -export async function prefetchPlatformDomainQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformDomainQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformDomainSelect>; + } +): Promise; +export async function prefetchPlatformDomainQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformDomainKeys.detail(params.id), - queryFn: () => getClient().platformDomain.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainVerificationQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainVerificationQuery.ts index 2fb91908a8..7e71d41a58 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainVerificationQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainVerificationQuery.ts @@ -4,20 +4,26 @@ * 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 { platformDomainVerificationKeys } from "../query-keys"; -import type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations } from "../../orm/input-types"; +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 { platformDomainVerificationKeys } from '../query-keys'; +import type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformDomainVerificationQueryKey = platformDomainVerificationKeys.detail; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { data, isLoading } = usePlatformDomainVerificationQuery({ @@ -26,38 +32,58 @@ export const platformDomainVerificationQueryKey = platformDomainVerificationKeys * }); * ``` */ -export function usePlatformDomainVerificationQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformDomainVerificationSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformDomainVerificationQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformDomainVerificationQuery< + S extends PlatformDomainVerificationSelect, + TData = { + platformDomainVerification: InferSelectResult< + PlatformDomainVerificationWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformDomainVerificationSelect>; + } & Omit< + UseQueryOptions< + { + platformDomainVerification: InferSelectResult< + PlatformDomainVerificationWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformDomainVerificationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformDomainVerificationKeys.detail(params.id), - queryFn: () => getClient().platformDomainVerification.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformDomainVerification.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Ownership verification challenges issued for a domain - * + * * @example * ```ts * const data = await fetchPlatformDomainVerificationQuery({ @@ -66,7 +92,9 @@ export function usePlatformDomainVerificationQuery(params: { * }); * ``` */ -export async function fetchPlatformDomainVerificationQuery(params: { +export async function fetchPlatformDomainVerificationQuery< + S extends PlatformDomainVerificationSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +107,48 @@ export async function fetchPlatformDomainVerificationQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformDomainVerification.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformDomainVerification.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Ownership verification challenges issued for a domain - * + * * @example * ```ts * await prefetchPlatformDomainVerificationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformDomainVerificationQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformDomainVerificationSelect>; -}): Promise; -export async function prefetchPlatformDomainVerificationQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformDomainVerificationQuery< + S extends PlatformDomainVerificationSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformDomainVerificationSelect>; + } +): Promise; +export async function prefetchPlatformDomainVerificationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformDomainVerificationKeys.detail(params.id), - queryFn: () => getClient().platformDomainVerification.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformDomainVerification.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainVerificationsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainVerificationsQuery.ts index 70e8a2c485..ba270d43f7 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainVerificationsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainVerificationsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformDomainVerificationKeys } from "../query-keys"; -import type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations, PlatformDomainVerificationFilter, PlatformDomainVerificationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainVerificationSelect, PlatformDomainVerificationWithRelations, PlatformDomainVerificationFilter, PlatformDomainVerificationOrderBy } from "../../orm/input-types"; +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 { platformDomainVerificationKeys } from '../query-keys'; +import type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformDomainVerificationSelect, + PlatformDomainVerificationWithRelations, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformDomainVerificationsQueryKey = platformDomainVerificationKeys.list; /** * Ownership verification challenges issued for a domain - * + * * @example * ```tsx * const { data, isLoading } = usePlatformDomainVerificationsQuery({ @@ -30,33 +45,60 @@ export const platformDomainVerificationsQueryKey = platformDomainVerificationKey * }); * ``` */ -export function usePlatformDomainVerificationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainVerificationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformDomainVerificationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformDomainVerificationsQuery< + S extends PlatformDomainVerificationSelect, + TData = { + platformDomainVerifications: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformDomainVerificationSelect>; + } & Omit< + UseQueryOptions< + { + platformDomainVerifications: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformDomainVerificationsQuery( + params: { + selection: ListSelectionConfig< + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformDomainVerificationKeys.list(args), queryFn: () => getClient().platformDomainVerification.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Ownership verification challenges issued for a domain - * + * * @example * ```ts * const data = await fetchPlatformDomainVerificationsQuery({ @@ -67,38 +109,74 @@ export function usePlatformDomainVerificationsQuery(params: { * }); * ``` */ -export async function fetchPlatformDomainVerificationsQuery(params: { +export async function fetchPlatformDomainVerificationsQuery< + S extends PlatformDomainVerificationSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainVerificationSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformDomainVerificationSelect>; }): Promise<{ - platformDomainVerifications: ConnectionResult>; + platformDomainVerifications: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformDomainVerificationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy + >(params.selection); return getClient().platformDomainVerification.findMany(args).unwrap(); } /** * Ownership verification challenges issued for a domain - * + * * @example * ```ts * await prefetchPlatformDomainVerificationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformDomainVerificationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainVerificationSelect>; -}): Promise; -export async function prefetchPlatformDomainVerificationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformDomainVerificationsQuery< + S extends PlatformDomainVerificationSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformDomainVerificationSelect>; + } +): Promise; +export async function prefetchPlatformDomainVerificationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformDomainVerificationKeys.list(args), - queryFn: () => getClient().platformDomainVerification.findMany(args).unwrap() + queryFn: () => getClient().platformDomainVerification.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainsQuery.ts index 23938b0320..0bdf2d9f03 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformDomainsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformDomainKeys } from "../query-keys"; -import type { PlatformDomainSelect, PlatformDomainWithRelations, PlatformDomainFilter, PlatformDomainOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformDomainSelect, PlatformDomainWithRelations, PlatformDomainFilter, PlatformDomainOrderBy } from "../../orm/input-types"; +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 { platformDomainKeys } from '../query-keys'; +import type { + PlatformDomainSelect, + PlatformDomainWithRelations, + PlatformDomainFilter, + PlatformDomainOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformDomainSelect, + PlatformDomainWithRelations, + PlatformDomainFilter, + PlatformDomainOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformDomainsQueryKey = platformDomainKeys.list; /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```tsx * const { data, isLoading } = usePlatformDomainsQuery({ @@ -30,33 +45,53 @@ export const platformDomainsQueryKey = platformDomainKeys.list; * }); * ``` */ -export function usePlatformDomainsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformDomainsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformDomainsQuery< + S extends PlatformDomainSelect, + TData = { + platformDomains: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformDomainSelect>; + } & Omit< + UseQueryOptions< + { + platformDomains: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformDomainsQuery( + params: { + selection: ListSelectionConfig< + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformDomainKeys.list(args), queryFn: () => getClient().platformDomain.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```ts * const data = await fetchPlatformDomainsQuery({ @@ -70,35 +105,55 @@ export function usePlatformDomainsQuery(params: { export async function fetchPlatformDomainsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformDomainSelect>; }): Promise<{ platformDomains: ConnectionResult>; }>; export async function fetchPlatformDomainsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy + >(params.selection); return getClient().platformDomain.findMany(args).unwrap(); } /** * Fully-qualified hostnames owned by this scope; each row claims its hostname globally through the catalog - * + * * @example * ```ts * await prefetchPlatformDomainsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformDomainsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformDomainSelect>; -}): Promise; -export async function prefetchPlatformDomainsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformDomainsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformDomainSelect>; + } +): Promise; +export async function prefetchPlatformDomainsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformDomainKeys.list(args), - queryFn: () => getClient().platformDomain.findMany(args).unwrap() + queryFn: () => getClient().platformDomain.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformManagedDomainQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformManagedDomainQuery.ts index 9287ceab02..ce7d6b2411 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformManagedDomainQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformManagedDomainQuery.ts @@ -4,20 +4,26 @@ * 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 { platformManagedDomainKeys } from "../query-keys"; -import type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations } from "../../orm/input-types"; +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 { platformManagedDomainKeys } from '../query-keys'; +import type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformManagedDomainQueryKey = platformManagedDomainKeys.detail; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { data, isLoading } = usePlatformManagedDomainQuery({ @@ -26,38 +32,52 @@ export const platformManagedDomainQueryKey = platformManagedDomainKeys.detail; * }); * ``` */ -export function usePlatformManagedDomainQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformManagedDomainSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformManagedDomainQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformManagedDomainQuery< + S extends PlatformManagedDomainSelect, + TData = { + platformManagedDomain: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformManagedDomainSelect>; + } & Omit< + UseQueryOptions< + { + platformManagedDomain: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformManagedDomainQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformManagedDomainKeys.detail(params.id), - queryFn: () => getClient().platformManagedDomain.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformManagedDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```ts * const data = await fetchPlatformManagedDomainQuery({ @@ -66,7 +86,9 @@ export function usePlatformManagedDomainQuery(params: { * }); * ``` */ -export async function fetchPlatformManagedDomainQuery(params: { +export async function fetchPlatformManagedDomainQuery< + S extends PlatformManagedDomainSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPlatformManagedDomainQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformManagedDomain.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformManagedDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```ts * await prefetchPlatformManagedDomainQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformManagedDomainQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformManagedDomainSelect>; -}): Promise; -export async function prefetchPlatformManagedDomainQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformManagedDomainQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformManagedDomainSelect>; + } +): Promise; +export async function prefetchPlatformManagedDomainQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformManagedDomainKeys.detail(params.id), - queryFn: () => getClient().platformManagedDomain.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformManagedDomain.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformManagedDomainsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformManagedDomainsQuery.ts index fb0bd7a6a4..dc9c0af281 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformManagedDomainsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformManagedDomainsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformManagedDomainKeys } from "../query-keys"; -import type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations, PlatformManagedDomainFilter, PlatformManagedDomainOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformManagedDomainSelect, PlatformManagedDomainWithRelations, PlatformManagedDomainFilter, PlatformManagedDomainOrderBy } from "../../orm/input-types"; +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 { platformManagedDomainKeys } from '../query-keys'; +import type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformManagedDomainSelect, + PlatformManagedDomainWithRelations, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformManagedDomainsQueryKey = platformManagedDomainKeys.list; /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```tsx * const { data, isLoading } = usePlatformManagedDomainsQuery({ @@ -30,33 +45,60 @@ export const platformManagedDomainsQueryKey = platformManagedDomainKeys.list; * }); * ``` */ -export function usePlatformManagedDomainsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformManagedDomainSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformManagedDomainsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformManagedDomainsQuery< + S extends PlatformManagedDomainSelect, + TData = { + platformManagedDomains: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformManagedDomainSelect>; + } & Omit< + UseQueryOptions< + { + platformManagedDomains: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformManagedDomainsQuery( + params: { + selection: ListSelectionConfig< + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformManagedDomainKeys.list(args), queryFn: () => getClient().platformManagedDomain.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```ts * const data = await fetchPlatformManagedDomainsQuery({ @@ -67,38 +109,72 @@ export function usePlatformManagedDomainsQuery(params: { * }); * ``` */ -export async function fetchPlatformManagedDomainsQuery(params: { +export async function fetchPlatformManagedDomainsQuery< + S extends PlatformManagedDomainSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformManagedDomainSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformManagedDomainSelect>; }): Promise<{ - platformManagedDomains: ConnectionResult>; + platformManagedDomains: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformManagedDomainsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy + >(params.selection); return getClient().platformManagedDomain.findMany(args).unwrap(); } /** * Platform-operated hostnames whose DNS and certificate lifecycle the platform drives - * + * * @example * ```ts * await prefetchPlatformManagedDomainsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformManagedDomainsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformManagedDomainSelect>; -}): Promise; -export async function prefetchPlatformManagedDomainsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformManagedDomainsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformManagedDomainSelect>; + } +): Promise; +export async function prefetchPlatformManagedDomainsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformManagedDomainKeys.list(args), - queryFn: () => getClient().platformManagedDomain.findMany(args).unwrap() + queryFn: () => getClient().platformManagedDomain.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteMetadataQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteMetadataQuery.ts index a3fa6850cc..8ad0688735 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteMetadataQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteMetadataQuery.ts @@ -4,20 +4,35 @@ * 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 { platformSiteMetadatumKeys } from "../query-keys"; -import type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations, PlatformSiteMetadatumFilter, PlatformSiteMetadatumOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations, PlatformSiteMetadatumFilter, PlatformSiteMetadatumOrderBy } from "../../orm/input-types"; +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 { platformSiteMetadatumKeys } from '../query-keys'; +import type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSiteMetadataQueryKey = platformSiteMetadatumKeys.list; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSiteMetadataQuery({ @@ -30,33 +45,60 @@ export const platformSiteMetadataQueryKey = platformSiteMetadatumKeys.list; * }); * ``` */ -export function usePlatformSiteMetadataQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteMetadatumSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSiteMetadataQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformSiteMetadataQuery< + S extends PlatformSiteMetadatumSelect, + TData = { + platformSiteMetadata: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformSiteMetadatumSelect>; + } & Omit< + UseQueryOptions< + { + platformSiteMetadata: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSiteMetadataQuery( + params: { + selection: ListSelectionConfig< + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSiteMetadatumKeys.list(args), queryFn: () => getClient().platformSiteMetadatum.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * SEO and social sharing metadata for a site surface - * + * * @example * ```ts * const data = await fetchPlatformSiteMetadataQuery({ @@ -67,38 +109,70 @@ export function usePlatformSiteMetadataQuery(params: { * }); * ``` */ -export async function fetchPlatformSiteMetadataQuery(params: { +export async function fetchPlatformSiteMetadataQuery< + S extends PlatformSiteMetadatumSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteMetadatumSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformSiteMetadatumSelect>; }): Promise<{ platformSiteMetadata: ConnectionResult>; }>; export async function fetchPlatformSiteMetadataQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy + >(params.selection); return getClient().platformSiteMetadatum.findMany(args).unwrap(); } /** * SEO and social sharing metadata for a site surface - * + * * @example * ```ts * await prefetchPlatformSiteMetadataQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformSiteMetadataQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteMetadatumSelect>; -}): Promise; -export async function prefetchPlatformSiteMetadataQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformSiteMetadataQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformSiteMetadatumSelect>; + } +): Promise; +export async function prefetchPlatformSiteMetadataQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformSiteMetadatumKeys.list(args), - queryFn: () => getClient().platformSiteMetadatum.findMany(args).unwrap() + queryFn: () => getClient().platformSiteMetadatum.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteMetadatumQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteMetadatumQuery.ts index 3ebb4ad80e..2f51197a03 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteMetadatumQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteMetadatumQuery.ts @@ -4,20 +4,26 @@ * 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 { platformSiteMetadatumKeys } from "../query-keys"; -import type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteMetadatumSelect, PlatformSiteMetadatumWithRelations } from "../../orm/input-types"; +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 { platformSiteMetadatumKeys } from '../query-keys'; +import type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSiteMetadatumQueryKey = platformSiteMetadatumKeys.detail; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSiteMetadatumQuery({ @@ -26,38 +32,52 @@ export const platformSiteMetadatumQueryKey = platformSiteMetadatumKeys.detail; * }); * ``` */ -export function usePlatformSiteMetadatumQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSiteMetadatumSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSiteMetadatumQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformSiteMetadatumQuery< + S extends PlatformSiteMetadatumSelect, + TData = { + platformSiteMetadatum: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSiteMetadatumSelect>; + } & Omit< + UseQueryOptions< + { + platformSiteMetadatum: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSiteMetadatumQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSiteMetadatumKeys.detail(params.id), - queryFn: () => getClient().platformSiteMetadatum.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformSiteMetadatum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * SEO and social sharing metadata for a site surface - * + * * @example * ```ts * const data = await fetchPlatformSiteMetadatumQuery({ @@ -66,7 +86,9 @@ export function usePlatformSiteMetadatumQuery(params: { * }); * ``` */ -export async function fetchPlatformSiteMetadatumQuery(params: { +export async function fetchPlatformSiteMetadatumQuery< + S extends PlatformSiteMetadatumSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPlatformSiteMetadatumQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformSiteMetadatum.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformSiteMetadatum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * SEO and social sharing metadata for a site surface - * + * * @example * ```ts * await prefetchPlatformSiteMetadatumQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformSiteMetadatumQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSiteMetadatumSelect>; -}): Promise; -export async function prefetchPlatformSiteMetadatumQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformSiteMetadatumQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSiteMetadatumSelect>; + } +): Promise; +export async function prefetchPlatformSiteMetadatumQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformSiteMetadatumKeys.detail(params.id), - queryFn: () => getClient().platformSiteMetadatum.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformSiteMetadatum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteModuleQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteModuleQuery.ts index 2f41597625..69042cee8c 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteModuleQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { platformSiteModuleKeys } from "../query-keys"; -import type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations } from "../../orm/input-types"; +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 { platformSiteModuleKeys } from '../query-keys'; +import type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSiteModuleQueryKey = platformSiteModuleKeys.detail; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSiteModuleQuery({ @@ -26,38 +32,52 @@ export const platformSiteModuleQueryKey = platformSiteModuleKeys.detail; * }); * ``` */ -export function usePlatformSiteModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSiteModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSiteModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformSiteModuleQuery< + S extends PlatformSiteModuleSelect, + TData = { + platformSiteModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSiteModuleSelect>; + } & Omit< + UseQueryOptions< + { + platformSiteModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSiteModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSiteModuleKeys.detail(params.id), - queryFn: () => getClient().platformSiteModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformSiteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```ts * const data = await fetchPlatformSiteModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformSiteModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformSiteModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformSiteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```ts * await prefetchPlatformSiteModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformSiteModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSiteModuleSelect>; -}): Promise; -export async function prefetchPlatformSiteModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformSiteModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSiteModuleSelect>; + } +): Promise; +export async function prefetchPlatformSiteModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformSiteModuleKeys.detail(params.id), - queryFn: () => getClient().platformSiteModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformSiteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteModulesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteModulesQuery.ts index e2cd5f31b3..0e8dbb154f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteModulesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformSiteModuleKeys } from "../query-keys"; -import type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations, PlatformSiteModuleFilter, PlatformSiteModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteModuleSelect, PlatformSiteModuleWithRelations, PlatformSiteModuleFilter, PlatformSiteModuleOrderBy } from "../../orm/input-types"; +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 { platformSiteModuleKeys } from '../query-keys'; +import type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformSiteModuleSelect, + PlatformSiteModuleWithRelations, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSiteModulesQueryKey = platformSiteModuleKeys.list; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSiteModulesQuery({ @@ -30,33 +45,58 @@ export const platformSiteModulesQueryKey = platformSiteModuleKeys.list; * }); * ``` */ -export function usePlatformSiteModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSiteModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformSiteModulesQuery< + S extends PlatformSiteModuleSelect, + TData = { + platformSiteModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformSiteModuleSelect>; + } & Omit< + UseQueryOptions< + { + platformSiteModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSiteModulesQuery( + params: { + selection: ListSelectionConfig< + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSiteModuleKeys.list(args), queryFn: () => getClient().platformSiteModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```ts * const data = await fetchPlatformSiteModulesQuery({ @@ -70,35 +110,62 @@ export function usePlatformSiteModulesQuery(params: { export async function fetchPlatformSiteModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSiteModuleSelect>; }): Promise<{ platformSiteModules: ConnectionResult>; }>; export async function fetchPlatformSiteModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy + >(params.selection); return getClient().platformSiteModule.findMany(args).unwrap(); } /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```ts * await prefetchPlatformSiteModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformSiteModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteModuleSelect>; -}): Promise; -export async function prefetchPlatformSiteModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformSiteModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformSiteModuleSelect>; + } +): Promise; +export async function prefetchPlatformSiteModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformSiteModuleKeys.list(args), - queryFn: () => getClient().platformSiteModule.findMany(args).unwrap() + queryFn: () => getClient().platformSiteModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteQuery.ts index 4eaa2208a2..73b8f31455 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteQuery.ts @@ -4,20 +4,20 @@ * 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 { platformSiteKeys } from "../query-keys"; -import type { PlatformSiteSelect, PlatformSiteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteSelect, PlatformSiteWithRelations } from "../../orm/input-types"; +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 { platformSiteKeys } from '../query-keys'; +import type { PlatformSiteSelect, PlatformSiteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformSiteSelect, PlatformSiteWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSiteQueryKey = platformSiteKeys.detail; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSiteQuery({ @@ -26,38 +26,52 @@ export const platformSiteQueryKey = platformSiteKeys.detail; * }); * ``` */ -export function usePlatformSiteQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSiteSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSiteQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformSiteQuery< + S extends PlatformSiteSelect, + TData = { + platformSite: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSiteSelect>; + } & Omit< + UseQueryOptions< + { + platformSite: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSiteQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSiteKeys.detail(params.id), - queryFn: () => getClient().platformSite.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformSite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * const data = await fetchPlatformSiteQuery({ @@ -79,35 +93,46 @@ export async function fetchPlatformSiteQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformSite.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformSite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * await prefetchPlatformSiteQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformSiteQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSiteSelect>; -}): Promise; -export async function prefetchPlatformSiteQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformSiteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSiteSelect>; + } +): Promise; +export async function prefetchPlatformSiteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformSiteKeys.detail(params.id), - queryFn: () => getClient().platformSite.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformSite.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteThemeQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteThemeQuery.ts index bb887a2056..78d72e4cb8 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteThemeQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteThemeQuery.ts @@ -4,20 +4,26 @@ * 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 { platformSiteThemeKeys } from "../query-keys"; -import type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations } from "../../orm/input-types"; +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 { platformSiteThemeKeys } from '../query-keys'; +import type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSiteThemeQueryKey = platformSiteThemeKeys.detail; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSiteThemeQuery({ @@ -26,38 +32,52 @@ export const platformSiteThemeQueryKey = platformSiteThemeKeys.detail; * }); * ``` */ -export function usePlatformSiteThemeQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSiteThemeSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSiteThemeQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformSiteThemeQuery< + S extends PlatformSiteThemeSelect, + TData = { + platformSiteTheme: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSiteThemeSelect>; + } & Omit< + UseQueryOptions< + { + platformSiteTheme: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSiteThemeQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSiteThemeKeys.detail(params.id), - queryFn: () => getClient().platformSiteTheme.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformSiteTheme.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```ts * const data = await fetchPlatformSiteThemeQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformSiteThemeQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformSiteTheme.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformSiteTheme.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```ts * await prefetchPlatformSiteThemeQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformSiteThemeQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSiteThemeSelect>; -}): Promise; -export async function prefetchPlatformSiteThemeQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformSiteThemeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSiteThemeSelect>; + } +): Promise; +export async function prefetchPlatformSiteThemeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformSiteThemeKeys.detail(params.id), - queryFn: () => getClient().platformSiteTheme.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformSiteTheme.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteThemesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteThemesQuery.ts index 0f3325f35d..083f3981f9 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteThemesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformSiteThemesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformSiteThemeKeys } from "../query-keys"; -import type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations, PlatformSiteThemeFilter, PlatformSiteThemeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteThemeSelect, PlatformSiteThemeWithRelations, PlatformSiteThemeFilter, PlatformSiteThemeOrderBy } from "../../orm/input-types"; +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 { platformSiteThemeKeys } from '../query-keys'; +import type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformSiteThemeSelect, + PlatformSiteThemeWithRelations, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSiteThemesQueryKey = platformSiteThemeKeys.list; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSiteThemesQuery({ @@ -30,33 +45,53 @@ export const platformSiteThemesQueryKey = platformSiteThemeKeys.list; * }); * ``` */ -export function usePlatformSiteThemesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteThemeSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSiteThemesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformSiteThemesQuery< + S extends PlatformSiteThemeSelect, + TData = { + platformSiteThemes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSiteThemeSelect>; + } & Omit< + UseQueryOptions< + { + platformSiteThemes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSiteThemesQuery( + params: { + selection: ListSelectionConfig< + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSiteThemeKeys.list(args), queryFn: () => getClient().platformSiteTheme.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```ts * const data = await fetchPlatformSiteThemesQuery({ @@ -70,35 +105,59 @@ export function usePlatformSiteThemesQuery(params: { export async function fetchPlatformSiteThemesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteThemeSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSiteThemeSelect>; }): Promise<{ platformSiteThemes: ConnectionResult>; }>; export async function fetchPlatformSiteThemesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy + >(params.selection); return getClient().platformSiteTheme.findMany(args).unwrap(); } /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```ts * await prefetchPlatformSiteThemesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformSiteThemesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteThemeSelect>; -}): Promise; -export async function prefetchPlatformSiteThemesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformSiteThemesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSiteThemeSelect>; + } +): Promise; +export async function prefetchPlatformSiteThemesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformSiteThemeKeys.list(args), - queryFn: () => getClient().platformSiteTheme.findMany(args).unwrap() + queryFn: () => getClient().platformSiteTheme.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePlatformSitesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePlatformSitesQuery.ts index 811ecbadb7..dd084be13f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePlatformSitesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePlatformSitesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformSiteKeys } from "../query-keys"; -import type { PlatformSiteSelect, PlatformSiteWithRelations, PlatformSiteFilter, PlatformSiteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSiteSelect, PlatformSiteWithRelations, PlatformSiteFilter, PlatformSiteOrderBy } from "../../orm/input-types"; +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 { platformSiteKeys } from '../query-keys'; +import type { + PlatformSiteSelect, + PlatformSiteWithRelations, + PlatformSiteFilter, + PlatformSiteOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformSiteSelect, + PlatformSiteWithRelations, + PlatformSiteFilter, + PlatformSiteOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSitesQueryKey = platformSiteKeys.list; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSitesQuery({ @@ -30,33 +45,47 @@ export const platformSitesQueryKey = platformSiteKeys.list; * }); * ``` */ -export function usePlatformSitesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSitesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformSitesQuery< + S extends PlatformSiteSelect, + TData = { + platformSites: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSiteSelect>; + } & Omit< + UseQueryOptions< + { + platformSites: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSitesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSiteKeys.list(args), queryFn: () => getClient().platformSite.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * const data = await fetchPlatformSitesQuery({ @@ -70,35 +99,47 @@ export function usePlatformSitesQuery(params: { export async function fetchPlatformSitesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSiteSelect>; }): Promise<{ platformSites: ConnectionResult>; }>; export async function fetchPlatformSitesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().platformSite.findMany(args).unwrap(); } /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * await prefetchPlatformSitesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformSitesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSiteSelect>; -}): Promise; -export async function prefetchPlatformSitesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformSitesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSiteSelect>; + } +): Promise; +export async function prefetchPlatformSitesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: platformSiteKeys.list(args), - queryFn: () => getClient().platformSite.findMany(args).unwrap() + queryFn: () => getClient().platformSite.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePoliciesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePoliciesQuery.ts index 0b364e2b89..1fb8368100 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePoliciesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePoliciesQuery.ts @@ -4,20 +4,35 @@ * 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 { policyKeys } from "../query-keys"; -import type { PolicySelect, PolicyWithRelations, PolicyFilter, PolicyOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PolicySelect, PolicyWithRelations, PolicyFilter, PolicyOrderBy } from "../../orm/input-types"; +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 { policyKeys } from '../query-keys'; +import type { + PolicySelect, + PolicyWithRelations, + PolicyFilter, + PolicyOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PolicySelect, + PolicyWithRelations, + PolicyFilter, + PolicyOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const policiesQueryKey = policyKeys.list; /** * Query hook for fetching Policy list - * + * * @example * ```tsx * const { data, isLoading } = usePoliciesQuery({ @@ -30,33 +45,45 @@ export const policiesQueryKey = policyKeys.list; * }); * ``` */ -export function usePoliciesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PolicySelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePoliciesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePoliciesQuery< + S extends PolicySelect, + TData = { + policies: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PolicySelect>; + } & Omit< + UseQueryOptions< + { + policies: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePoliciesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: policyKeys.list(args), queryFn: () => getClient().policy.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Policy list without React hooks - * + * * @example * ```ts * const data = await fetchPoliciesQuery({ @@ -70,7 +97,8 @@ export function usePoliciesQuery(params: { export async function fetchPoliciesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PolicySelect>; + } & Omit, 'fields'> & + HookStrictSelect, PolicySelect>; }): Promise<{ policies: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchPoliciesQuery(params: { } /** * Prefetch Policy list for SSR or cache warming - * + * * @example * ```ts * await prefetchPoliciesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPoliciesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PolicySelect>; -}): Promise; -export async function prefetchPoliciesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchPoliciesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PolicySelect>; + } +): Promise; +export async function prefetchPoliciesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: policyKeys.list(args), - queryFn: () => getClient().policy.findMany(args).unwrap() + queryFn: () => getClient().policy.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePolicyQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePolicyQuery.ts index 86ece9048f..f29abbd30d 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePolicyQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePolicyQuery.ts @@ -4,20 +4,20 @@ * 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 { policyKeys } from "../query-keys"; -import type { PolicySelect, PolicyWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PolicySelect, PolicyWithRelations } from "../../orm/input-types"; +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 { policyKeys } from '../query-keys'; +import type { PolicySelect, PolicyWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PolicySelect, PolicyWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const policyQueryKey = policyKeys.detail; /** * Query hook for fetching a single Policy - * + * * @example * ```tsx * const { data, isLoading } = usePolicyQuery({ @@ -26,38 +26,52 @@ export const policyQueryKey = policyKeys.detail; * }); * ``` */ -export function usePolicyQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PolicySelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePolicyQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePolicyQuery< + S extends PolicySelect, + TData = { + policy: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PolicySelect>; + } & Omit< + UseQueryOptions< + { + policy: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePolicyQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: policyKeys.detail(params.id), - queryFn: () => getClient().policy.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .policy.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Policy without React hooks - * + * * @example * ```ts * const data = await fetchPolicyQuery({ @@ -79,35 +93,46 @@ export async function fetchPolicyQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().policy.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .policy.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Policy for SSR or cache warming - * + * * @example * ```ts * await prefetchPolicyQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPolicyQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PolicySelect>; -}): Promise; -export async function prefetchPolicyQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPolicyQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PolicySelect>; + } +): Promise; +export async function prefetchPolicyQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: policyKeys.detail(params.id), - queryFn: () => getClient().policy.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .policy.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePrimaryKeyConstraintQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePrimaryKeyConstraintQuery.ts index b6cf15f969..4de5ac1f6d 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePrimaryKeyConstraintQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePrimaryKeyConstraintQuery.ts @@ -4,20 +4,26 @@ * 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 { primaryKeyConstraintKeys } from "../query-keys"; -import type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations } from "../../orm/input-types"; +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 { primaryKeyConstraintKeys } from '../query-keys'; +import type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const primaryKeyConstraintQueryKey = primaryKeyConstraintKeys.detail; /** * Query hook for fetching a single PrimaryKeyConstraint - * + * * @example * ```tsx * const { data, isLoading } = usePrimaryKeyConstraintQuery({ @@ -26,38 +32,52 @@ export const primaryKeyConstraintQueryKey = primaryKeyConstraintKeys.detail; * }); * ``` */ -export function usePrimaryKeyConstraintQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PrimaryKeyConstraintSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrimaryKeyConstraintQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePrimaryKeyConstraintQuery< + S extends PrimaryKeyConstraintSelect, + TData = { + primaryKeyConstraint: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrimaryKeyConstraintSelect>; + } & Omit< + UseQueryOptions< + { + primaryKeyConstraint: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrimaryKeyConstraintQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: primaryKeyConstraintKeys.detail(params.id), - queryFn: () => getClient().primaryKeyConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .primaryKeyConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single PrimaryKeyConstraint without React hooks - * + * * @example * ```ts * const data = await fetchPrimaryKeyConstraintQuery({ @@ -79,35 +99,46 @@ export async function fetchPrimaryKeyConstraintQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().primaryKeyConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .primaryKeyConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single PrimaryKeyConstraint for SSR or cache warming - * + * * @example * ```ts * await prefetchPrimaryKeyConstraintQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPrimaryKeyConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PrimaryKeyConstraintSelect>; -}): Promise; -export async function prefetchPrimaryKeyConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPrimaryKeyConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrimaryKeyConstraintSelect>; + } +): Promise; +export async function prefetchPrimaryKeyConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: primaryKeyConstraintKeys.detail(params.id), - queryFn: () => getClient().primaryKeyConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .primaryKeyConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePrimaryKeyConstraintsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePrimaryKeyConstraintsQuery.ts index 3486637342..6691abe29b 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePrimaryKeyConstraintsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePrimaryKeyConstraintsQuery.ts @@ -4,20 +4,35 @@ * 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 { primaryKeyConstraintKeys } from "../query-keys"; -import type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations, PrimaryKeyConstraintFilter, PrimaryKeyConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PrimaryKeyConstraintSelect, PrimaryKeyConstraintWithRelations, PrimaryKeyConstraintFilter, PrimaryKeyConstraintOrderBy } from "../../orm/input-types"; +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 { primaryKeyConstraintKeys } from '../query-keys'; +import type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintWithRelations, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const primaryKeyConstraintsQueryKey = primaryKeyConstraintKeys.list; /** * Query hook for fetching PrimaryKeyConstraint list - * + * * @example * ```tsx * const { data, isLoading } = usePrimaryKeyConstraintsQuery({ @@ -30,33 +45,60 @@ export const primaryKeyConstraintsQueryKey = primaryKeyConstraintKeys.list; * }); * ``` */ -export function usePrimaryKeyConstraintsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PrimaryKeyConstraintSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrimaryKeyConstraintsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePrimaryKeyConstraintsQuery< + S extends PrimaryKeyConstraintSelect, + TData = { + primaryKeyConstraints: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrimaryKeyConstraintSelect>; + } & Omit< + UseQueryOptions< + { + primaryKeyConstraints: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrimaryKeyConstraintsQuery( + params: { + selection: ListSelectionConfig< + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: primaryKeyConstraintKeys.list(args), queryFn: () => getClient().primaryKeyConstraint.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PrimaryKeyConstraint list without React hooks - * + * * @example * ```ts * const data = await fetchPrimaryKeyConstraintsQuery({ @@ -67,38 +109,70 @@ export function usePrimaryKeyConstraintsQuery(params: { * }); * ``` */ -export async function fetchPrimaryKeyConstraintsQuery(params: { +export async function fetchPrimaryKeyConstraintsQuery< + S extends PrimaryKeyConstraintSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PrimaryKeyConstraintSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrimaryKeyConstraintSelect>; }): Promise<{ primaryKeyConstraints: ConnectionResult>; }>; export async function fetchPrimaryKeyConstraintsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy + >(params.selection); return getClient().primaryKeyConstraint.findMany(args).unwrap(); } /** * Prefetch PrimaryKeyConstraint list for SSR or cache warming - * + * * @example * ```ts * await prefetchPrimaryKeyConstraintsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPrimaryKeyConstraintsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PrimaryKeyConstraintSelect>; -}): Promise; -export async function prefetchPrimaryKeyConstraintsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPrimaryKeyConstraintsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrimaryKeyConstraintSelect>; + } +): Promise; +export async function prefetchPrimaryKeyConstraintsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: primaryKeyConstraintKeys.list(args), - queryFn: () => getClient().primaryKeyConstraint.findMany(args).unwrap() + queryFn: () => getClient().primaryKeyConstraint.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePubkeySettingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePubkeySettingQuery.ts index 7253c98829..727a6be9a9 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePubkeySettingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePubkeySettingQuery.ts @@ -4,20 +4,20 @@ * 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 { pubkeySettingKeys } from "../query-keys"; -import type { PubkeySettingSelect, PubkeySettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PubkeySettingSelect, PubkeySettingWithRelations } from "../../orm/input-types"; +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 { pubkeySettingKeys } from '../query-keys'; +import type { PubkeySettingSelect, PubkeySettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PubkeySettingSelect, PubkeySettingWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const pubkeySettingQueryKey = pubkeySettingKeys.detail; /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```tsx * const { data, isLoading } = usePubkeySettingQuery({ @@ -26,38 +26,52 @@ export const pubkeySettingQueryKey = pubkeySettingKeys.detail; * }); * ``` */ -export function usePubkeySettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PubkeySettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePubkeySettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePubkeySettingQuery< + S extends PubkeySettingSelect, + TData = { + pubkeySetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PubkeySettingSelect>; + } & Omit< + UseQueryOptions< + { + pubkeySetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePubkeySettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: pubkeySettingKeys.detail(params.id), - queryFn: () => getClient().pubkeySetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .pubkeySetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```ts * const data = await fetchPubkeySettingQuery({ @@ -79,35 +93,46 @@ export async function fetchPubkeySettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().pubkeySetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .pubkeySetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```ts * await prefetchPubkeySettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPubkeySettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PubkeySettingSelect>; -}): Promise; -export async function prefetchPubkeySettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPubkeySettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PubkeySettingSelect>; + } +): Promise; +export async function prefetchPubkeySettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: pubkeySettingKeys.detail(params.id), - queryFn: () => getClient().pubkeySetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .pubkeySetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/usePubkeySettingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/usePubkeySettingsQuery.ts index 1cbd487ddf..dd9dfe8a09 100644 --- a/sdk/constructive-react/src/api/hooks/queries/usePubkeySettingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/usePubkeySettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { pubkeySettingKeys } from "../query-keys"; -import type { PubkeySettingSelect, PubkeySettingWithRelations, PubkeySettingFilter, PubkeySettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PubkeySettingSelect, PubkeySettingWithRelations, PubkeySettingFilter, PubkeySettingOrderBy } from "../../orm/input-types"; +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 { pubkeySettingKeys } from '../query-keys'; +import type { + PubkeySettingSelect, + PubkeySettingWithRelations, + PubkeySettingFilter, + PubkeySettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PubkeySettingSelect, + PubkeySettingWithRelations, + PubkeySettingFilter, + PubkeySettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const pubkeySettingsQueryKey = pubkeySettingKeys.list; /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```tsx * const { data, isLoading } = usePubkeySettingsQuery({ @@ -30,33 +45,49 @@ export const pubkeySettingsQueryKey = pubkeySettingKeys.list; * }); * ``` */ -export function usePubkeySettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PubkeySettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePubkeySettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePubkeySettingsQuery< + S extends PubkeySettingSelect, + TData = { + pubkeySettings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PubkeySettingSelect>; + } & Omit< + UseQueryOptions< + { + pubkeySettings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePubkeySettingsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PubkeySettingSelect, + PubkeySettingFilter, + PubkeySettingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: pubkeySettingKeys.list(args), queryFn: () => getClient().pubkeySetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```ts * const data = await fetchPubkeySettingsQuery({ @@ -70,35 +101,51 @@ export function usePubkeySettingsQuery(params: { export async function fetchPubkeySettingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PubkeySettingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PubkeySettingSelect>; }): Promise<{ pubkeySettings: ConnectionResult>; }>; export async function fetchPubkeySettingsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PubkeySettingSelect, + PubkeySettingFilter, + PubkeySettingOrderBy + >(params.selection); return getClient().pubkeySetting.findMany(args).unwrap(); } /** * Public-key crypto auth runtime configuration; typed references to the crypto sign-up/sign-in function plumbing - * + * * @example * ```ts * await prefetchPubkeySettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPubkeySettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PubkeySettingSelect>; -}): Promise; -export async function prefetchPubkeySettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPubkeySettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PubkeySettingSelect>; + } +): Promise; +export async function prefetchPubkeySettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + PubkeySettingSelect, + PubkeySettingFilter, + PubkeySettingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: pubkeySettingKeys.list(args), - queryFn: () => getClient().pubkeySetting.findMany(args).unwrap() + queryFn: () => getClient().pubkeySetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useResolveHttpRouteQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useResolveHttpRouteQuery.ts index b7e33b0735..104d052586 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useResolveHttpRouteQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useResolveHttpRouteQuery.ts @@ -4,65 +4,78 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { ResolveHttpRouteVariables } from "../../orm/query"; -import type { ResolveHttpRouteRecordSelect, ResolveHttpRouteRecord } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResolveHttpRouteVariables } from "../../orm/query"; -export type { ResolveHttpRouteRecordSelect } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { ResolveHttpRouteVariables } from '../../orm/query'; +import type { ResolveHttpRouteRecordSelect, ResolveHttpRouteRecord } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResolveHttpRouteVariables } from '../../orm/query'; +export type { ResolveHttpRouteRecordSelect } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resolveHttpRouteQueryKey = customQueryKeys.resolveHttpRoute; /** * Query hook for resolveHttpRoute - * + * * @example * ```tsx * const { data, isLoading } = useResolveHttpRouteQuery({ variables: { requestHost, requestMethod, requestPath }, selection: { fields: { id: true } } }); - * + * * if (data?.resolveHttpRoute) { * console.log(data.resolveHttpRoute); * } * ``` */ -export function useResolveHttpRouteQuery | null; -}>(params: { - variables?: ResolveHttpRouteVariables; - selection: ({ - fields: S & ResolveHttpRouteRecordSelect; - } & HookStrictSelect, ResolveHttpRouteRecordSelect>); -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResolveHttpRouteQuery(params: { - variables?: ResolveHttpRouteVariables; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResolveHttpRouteQuery< + S extends ResolveHttpRouteRecordSelect, + TData = { + resolveHttpRoute: InferSelectResult | null; + }, +>( + params: { + variables?: ResolveHttpRouteVariables; + selection: { + fields: S & ResolveHttpRouteRecordSelect; + } & HookStrictSelect, ResolveHttpRouteRecordSelect>; + } & Omit< + UseQueryOptions< + { + resolveHttpRoute: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResolveHttpRouteQuery( + params: { + variables?: ResolveHttpRouteVariables; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const variables = params.variables ?? {}; const args = buildSelectionArgs(params.selection); - const { - variables: _variables, - selection: _selection, - ...queryOptions - } = params ?? {}; + const { variables: _variables, selection: _selection, ...queryOptions } = params ?? {}; void _variables; void _selection; return useQuery({ queryKey: resolveHttpRouteQueryKey(variables), - queryFn: () => getClient().query.resolveHttpRoute(variables, { - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .query.resolveHttpRoute(variables, { + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch resolveHttpRoute without React hooks - * + * * @example * ```ts * const data = await fetchResolveHttpRouteQuery({ variables: { requestHost, requestMethod, requestPath }, selection: { fields: { id: true } } }); @@ -70,9 +83,9 @@ export function useResolveHttpRouteQuery(params: { */ export async function fetchResolveHttpRouteQuery(params: { variables?: ResolveHttpRouteVariables; - selection: ({ + selection: { fields: S & ResolveHttpRouteRecordSelect; - } & HookStrictSelect, ResolveHttpRouteRecordSelect>); + } & HookStrictSelect, ResolveHttpRouteRecordSelect>; }): Promise<{ resolveHttpRoute: InferSelectResult | null; }>; @@ -82,34 +95,45 @@ export async function fetchResolveHttpRouteQuery(params: { }) { const variables = params.variables ?? {}; const args = buildSelectionArgs(params.selection); - return getClient().query.resolveHttpRoute(variables, { - select: args.select - }).unwrap(); + return getClient() + .query.resolveHttpRoute(variables, { + select: args.select, + }) + .unwrap(); } /** * Prefetch resolveHttpRoute for SSR or cache warming - * + * * @example * ```ts * await prefetchResolveHttpRouteQuery(queryClient, { variables: { requestHost, requestMethod, requestPath }, selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResolveHttpRouteQuery(queryClient: QueryClient, params: { - variables?: ResolveHttpRouteVariables; - selection: ({ - fields: S & ResolveHttpRouteRecordSelect; - } & HookStrictSelect, ResolveHttpRouteRecordSelect>); -}): Promise; -export async function prefetchResolveHttpRouteQuery(queryClient: QueryClient, params: { - variables?: ResolveHttpRouteVariables; - selection: SelectionConfig; -}): Promise { +export async function prefetchResolveHttpRouteQuery( + queryClient: QueryClient, + params: { + variables?: ResolveHttpRouteVariables; + selection: { + fields: S & ResolveHttpRouteRecordSelect; + } & HookStrictSelect, ResolveHttpRouteRecordSelect>; + } +): Promise; +export async function prefetchResolveHttpRouteQuery( + queryClient: QueryClient, + params: { + variables?: ResolveHttpRouteVariables; + selection: SelectionConfig; + } +): Promise { const variables = params.variables ?? {}; const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resolveHttpRouteQueryKey(variables), - queryFn: () => getClient().query.resolveHttpRoute(variables, { - select: args.select - }).unwrap() + queryFn: () => + getClient() + .query.resolveHttpRoute(variables, { + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useResolveRouteQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useResolveRouteQuery.ts index 47c0d83a52..6986d75350 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useResolveRouteQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useResolveRouteQuery.ts @@ -4,65 +4,78 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { ResolveRouteVariables } from "../../orm/query"; -import type { ResolveRouteRecordSelect, ResolveRouteRecord } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResolveRouteVariables } from "../../orm/query"; -export type { ResolveRouteRecordSelect } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { ResolveRouteVariables } from '../../orm/query'; +import type { ResolveRouteRecordSelect, ResolveRouteRecord } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResolveRouteVariables } from '../../orm/query'; +export type { ResolveRouteRecordSelect } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resolveRouteQueryKey = customQueryKeys.resolveRoute; /** * Query hook for resolveRoute - * + * * @example * ```tsx * const { data, isLoading } = useResolveRouteQuery({ variables: { requestHost, requestMethod, requestPath }, selection: { fields: { id: true } } }); - * + * * if (data?.resolveRoute) { * console.log(data.resolveRoute); * } * ``` */ -export function useResolveRouteQuery | null; -}>(params: { - variables?: ResolveRouteVariables; - selection: ({ - fields: S & ResolveRouteRecordSelect; - } & HookStrictSelect, ResolveRouteRecordSelect>); -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResolveRouteQuery(params: { - variables?: ResolveRouteVariables; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResolveRouteQuery< + S extends ResolveRouteRecordSelect, + TData = { + resolveRoute: InferSelectResult | null; + }, +>( + params: { + variables?: ResolveRouteVariables; + selection: { + fields: S & ResolveRouteRecordSelect; + } & HookStrictSelect, ResolveRouteRecordSelect>; + } & Omit< + UseQueryOptions< + { + resolveRoute: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResolveRouteQuery( + params: { + variables?: ResolveRouteVariables; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const variables = params.variables ?? {}; const args = buildSelectionArgs(params.selection); - const { - variables: _variables, - selection: _selection, - ...queryOptions - } = params ?? {}; + const { variables: _variables, selection: _selection, ...queryOptions } = params ?? {}; void _variables; void _selection; return useQuery({ queryKey: resolveRouteQueryKey(variables), - queryFn: () => getClient().query.resolveRoute(variables, { - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .query.resolveRoute(variables, { + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch resolveRoute without React hooks - * + * * @example * ```ts * const data = await fetchResolveRouteQuery({ variables: { requestHost, requestMethod, requestPath }, selection: { fields: { id: true } } }); @@ -70,9 +83,9 @@ export function useResolveRouteQuery(params: { */ export async function fetchResolveRouteQuery(params: { variables?: ResolveRouteVariables; - selection: ({ + selection: { fields: S & ResolveRouteRecordSelect; - } & HookStrictSelect, ResolveRouteRecordSelect>); + } & HookStrictSelect, ResolveRouteRecordSelect>; }): Promise<{ resolveRoute: InferSelectResult | null; }>; @@ -82,34 +95,45 @@ export async function fetchResolveRouteQuery(params: { }) { const variables = params.variables ?? {}; const args = buildSelectionArgs(params.selection); - return getClient().query.resolveRoute(variables, { - select: args.select - }).unwrap(); + return getClient() + .query.resolveRoute(variables, { + select: args.select, + }) + .unwrap(); } /** * Prefetch resolveRoute for SSR or cache warming - * + * * @example * ```ts * await prefetchResolveRouteQuery(queryClient, { variables: { requestHost, requestMethod, requestPath }, selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResolveRouteQuery(queryClient: QueryClient, params: { - variables?: ResolveRouteVariables; - selection: ({ - fields: S & ResolveRouteRecordSelect; - } & HookStrictSelect, ResolveRouteRecordSelect>); -}): Promise; -export async function prefetchResolveRouteQuery(queryClient: QueryClient, params: { - variables?: ResolveRouteVariables; - selection: SelectionConfig; -}): Promise { +export async function prefetchResolveRouteQuery( + queryClient: QueryClient, + params: { + variables?: ResolveRouteVariables; + selection: { + fields: S & ResolveRouteRecordSelect; + } & HookStrictSelect, ResolveRouteRecordSelect>; + } +): Promise; +export async function prefetchResolveRouteQuery( + queryClient: QueryClient, + params: { + variables?: ResolveRouteVariables; + selection: SelectionConfig; + } +): Promise { const variables = params.variables ?? {}; const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resolveRouteQueryKey(variables), - queryFn: () => getClient().query.resolveRoute(variables, { - select: args.select - }).unwrap() + queryFn: () => + getClient() + .query.resolveRoute(variables, { + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useRlsSettingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useRlsSettingQuery.ts index 3ebcab185b..ab51f66fdf 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useRlsSettingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useRlsSettingQuery.ts @@ -4,20 +4,20 @@ * 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 { rlsSettingKeys } from "../query-keys"; -import type { RlsSettingSelect, RlsSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsSettingSelect, RlsSettingWithRelations } from "../../orm/input-types"; +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 { rlsSettingKeys } from '../query-keys'; +import type { RlsSettingSelect, RlsSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RlsSettingSelect, RlsSettingWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const rlsSettingQueryKey = rlsSettingKeys.detail; /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```tsx * const { data, isLoading } = useRlsSettingQuery({ @@ -26,38 +26,52 @@ export const rlsSettingQueryKey = rlsSettingKeys.detail; * }); * ``` */ -export function useRlsSettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RlsSettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRlsSettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRlsSettingQuery< + S extends RlsSettingSelect, + TData = { + rlsSetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RlsSettingSelect>; + } & Omit< + UseQueryOptions< + { + rlsSetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRlsSettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: rlsSettingKeys.detail(params.id), - queryFn: () => getClient().rlsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .rlsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```ts * const data = await fetchRlsSettingQuery({ @@ -79,35 +93,46 @@ export async function fetchRlsSettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().rlsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .rlsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```ts * await prefetchRlsSettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRlsSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RlsSettingSelect>; -}): Promise; -export async function prefetchRlsSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRlsSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RlsSettingSelect>; + } +): Promise; +export async function prefetchRlsSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: rlsSettingKeys.detail(params.id), - queryFn: () => getClient().rlsSetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .rlsSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useRlsSettingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useRlsSettingsQuery.ts index ab32a65fd7..b39bbdc5a3 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useRlsSettingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useRlsSettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { rlsSettingKeys } from "../query-keys"; -import type { RlsSettingSelect, RlsSettingWithRelations, RlsSettingFilter, RlsSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsSettingSelect, RlsSettingWithRelations, RlsSettingFilter, RlsSettingOrderBy } from "../../orm/input-types"; +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 { rlsSettingKeys } from '../query-keys'; +import type { + RlsSettingSelect, + RlsSettingWithRelations, + RlsSettingFilter, + RlsSettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RlsSettingSelect, + RlsSettingWithRelations, + RlsSettingFilter, + RlsSettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const rlsSettingsQueryKey = rlsSettingKeys.list; /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```tsx * const { data, isLoading } = useRlsSettingsQuery({ @@ -30,33 +45,47 @@ export const rlsSettingsQueryKey = rlsSettingKeys.list; * }); * ``` */ -export function useRlsSettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RlsSettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRlsSettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRlsSettingsQuery< + S extends RlsSettingSelect, + TData = { + rlsSettings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RlsSettingSelect>; + } & Omit< + UseQueryOptions< + { + rlsSettings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRlsSettingsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: rlsSettingKeys.list(args), queryFn: () => getClient().rlsSetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```ts * const data = await fetchRlsSettingsQuery({ @@ -70,35 +99,47 @@ export function useRlsSettingsQuery(params: { export async function fetchRlsSettingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RlsSettingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RlsSettingSelect>; }): Promise<{ rlsSettings: ConnectionResult>; }>; export async function fetchRlsSettingsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().rlsSetting.findMany(args).unwrap(); } /** * RLS module runtime configuration; typed references to the authenticate/current_role function plumbing - * + * * @example * ```ts * await prefetchRlsSettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRlsSettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RlsSettingSelect>; -}): Promise; -export async function prefetchRlsSettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRlsSettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RlsSettingSelect>; + } +): Promise; +export async function prefetchRlsSettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: rlsSettingKeys.list(args), - queryFn: () => getClient().rlsSetting.findMany(args).unwrap() + queryFn: () => getClient().rlsSetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useRouteBindingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useRouteBindingQuery.ts index 0d971cf63f..5a322c858f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useRouteBindingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useRouteBindingQuery.ts @@ -4,20 +4,20 @@ * 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 { routeBindingKeys } from "../query-keys"; -import type { RouteBindingSelect, RouteBindingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteBindingSelect, RouteBindingWithRelations } from "../../orm/input-types"; +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 { routeBindingKeys } from '../query-keys'; +import type { RouteBindingSelect, RouteBindingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RouteBindingSelect, RouteBindingWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const routeBindingQueryKey = routeBindingKeys.detail; /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```tsx * const { data, isLoading } = useRouteBindingQuery({ @@ -26,38 +26,52 @@ export const routeBindingQueryKey = routeBindingKeys.detail; * }); * ``` */ -export function useRouteBindingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RouteBindingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRouteBindingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRouteBindingQuery< + S extends RouteBindingSelect, + TData = { + routeBinding: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RouteBindingSelect>; + } & Omit< + UseQueryOptions< + { + routeBinding: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRouteBindingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: routeBindingKeys.detail(params.id), - queryFn: () => getClient().routeBinding.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .routeBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```ts * const data = await fetchRouteBindingQuery({ @@ -79,35 +93,46 @@ export async function fetchRouteBindingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().routeBinding.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .routeBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```ts * await prefetchRouteBindingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRouteBindingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RouteBindingSelect>; -}): Promise; -export async function prefetchRouteBindingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRouteBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RouteBindingSelect>; + } +): Promise; +export async function prefetchRouteBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: routeBindingKeys.detail(params.id), - queryFn: () => getClient().routeBinding.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .routeBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useRouteBindingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useRouteBindingsQuery.ts index 8dd5f81d01..f2915aa8ab 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useRouteBindingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useRouteBindingsQuery.ts @@ -4,20 +4,35 @@ * 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 { routeBindingKeys } from "../query-keys"; -import type { RouteBindingSelect, RouteBindingWithRelations, RouteBindingFilter, RouteBindingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteBindingSelect, RouteBindingWithRelations, RouteBindingFilter, RouteBindingOrderBy } from "../../orm/input-types"; +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 { routeBindingKeys } from '../query-keys'; +import type { + RouteBindingSelect, + RouteBindingWithRelations, + RouteBindingFilter, + RouteBindingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RouteBindingSelect, + RouteBindingWithRelations, + RouteBindingFilter, + RouteBindingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const routeBindingsQueryKey = routeBindingKeys.list; /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```tsx * const { data, isLoading } = useRouteBindingsQuery({ @@ -30,33 +45,47 @@ export const routeBindingsQueryKey = routeBindingKeys.list; * }); * ``` */ -export function useRouteBindingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteBindingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRouteBindingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRouteBindingsQuery< + S extends RouteBindingSelect, + TData = { + routeBindings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RouteBindingSelect>; + } & Omit< + UseQueryOptions< + { + routeBindings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRouteBindingsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: routeBindingKeys.list(args), queryFn: () => getClient().routeBinding.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```ts * const data = await fetchRouteBindingsQuery({ @@ -70,35 +99,47 @@ export function useRouteBindingsQuery(params: { export async function fetchRouteBindingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteBindingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RouteBindingSelect>; }): Promise<{ routeBindings: ConnectionResult>; }>; export async function fetchRouteBindingsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().routeBinding.findMany(args).unwrap(); } /** * Compiled route precedence index maintained by route sync triggers; carries typed target ids only, read through the resolver - * + * * @example * ```ts * await prefetchRouteBindingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRouteBindingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteBindingSelect>; -}): Promise; -export async function prefetchRouteBindingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRouteBindingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RouteBindingSelect>; + } +): Promise; +export async function prefetchRouteBindingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: routeBindingKeys.list(args), - queryFn: () => getClient().routeBinding.findMany(args).unwrap() + queryFn: () => getClient().routeBinding.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useRouteQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useRouteQuery.ts index 4d2193bb86..9f98730cd1 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useRouteQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useRouteQuery.ts @@ -4,20 +4,20 @@ * 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 { routeKeys } from "../query-keys"; -import type { RouteSelect, RouteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteSelect, RouteWithRelations } from "../../orm/input-types"; +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 { routeKeys } from '../query-keys'; +import type { RouteSelect, RouteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RouteSelect, RouteWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const routeQueryKey = routeKeys.detail; /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```tsx * const { data, isLoading } = useRouteQuery({ @@ -26,38 +26,52 @@ export const routeQueryKey = routeKeys.detail; * }); * ``` */ -export function useRouteQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RouteSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRouteQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRouteQuery< + S extends RouteSelect, + TData = { + route: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RouteSelect>; + } & Omit< + UseQueryOptions< + { + route: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRouteQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: routeKeys.detail(params.id), - queryFn: () => getClient().route.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .route.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```ts * const data = await fetchRouteQuery({ @@ -79,35 +93,46 @@ export async function fetchRouteQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().route.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .route.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```ts * await prefetchRouteQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRouteQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RouteSelect>; -}): Promise; -export async function prefetchRouteQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRouteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RouteSelect>; + } +): Promise; +export async function prefetchRouteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: routeKeys.detail(params.id), - queryFn: () => getClient().route.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .route.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useRoutesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useRoutesQuery.ts index 056db146a1..d77579d053 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useRoutesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useRoutesQuery.ts @@ -4,20 +4,35 @@ * 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 { routeKeys } from "../query-keys"; -import type { RouteSelect, RouteWithRelations, RouteFilter, RouteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteSelect, RouteWithRelations, RouteFilter, RouteOrderBy } from "../../orm/input-types"; +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 { routeKeys } from '../query-keys'; +import type { + RouteSelect, + RouteWithRelations, + RouteFilter, + RouteOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RouteSelect, + RouteWithRelations, + RouteFilter, + RouteOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const routesQueryKey = routeKeys.list; /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```tsx * const { data, isLoading } = useRoutesQuery({ @@ -30,33 +45,45 @@ export const routesQueryKey = routeKeys.list; * }); * ``` */ -export function useRoutesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRoutesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRoutesQuery< + S extends RouteSelect, + TData = { + routes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RouteSelect>; + } & Omit< + UseQueryOptions< + { + routes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRoutesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: routeKeys.list(args), queryFn: () => getClient().route.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```ts * const data = await fetchRoutesQuery({ @@ -70,7 +97,8 @@ export function useRoutesQuery(params: { export async function fetchRoutesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RouteSelect>; }): Promise<{ routes: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchRoutesQuery(params: { } /** * Routes binding a domain hostname and path to a typed catalog target - * + * * @example * ```ts * await prefetchRoutesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRoutesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteSelect>; -}): Promise; -export async function prefetchRoutesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchRoutesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RouteSelect>; + } +): Promise; +export async function prefetchRoutesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: routeKeys.list(args), - queryFn: () => getClient().route.findMany(args).unwrap() + queryFn: () => getClient().route.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSchemaGrantQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSchemaGrantQuery.ts index 878ed13347..b7f55b2864 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSchemaGrantQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSchemaGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { schemaGrantKeys } from "../query-keys"; -import type { SchemaGrantSelect, SchemaGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaGrantSelect, SchemaGrantWithRelations } from "../../orm/input-types"; +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 { schemaGrantKeys } from '../query-keys'; +import type { SchemaGrantSelect, SchemaGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SchemaGrantSelect, SchemaGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const schemaGrantQueryKey = schemaGrantKeys.detail; /** * Query hook for fetching a single SchemaGrant - * + * * @example * ```tsx * const { data, isLoading } = useSchemaGrantQuery({ @@ -26,38 +26,52 @@ export const schemaGrantQueryKey = schemaGrantKeys.detail; * }); * ``` */ -export function useSchemaGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SchemaGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSchemaGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSchemaGrantQuery< + S extends SchemaGrantSelect, + TData = { + schemaGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SchemaGrantSelect>; + } & Omit< + UseQueryOptions< + { + schemaGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSchemaGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: schemaGrantKeys.detail(params.id), - queryFn: () => getClient().schemaGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .schemaGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single SchemaGrant without React hooks - * + * * @example * ```ts * const data = await fetchSchemaGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchSchemaGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().schemaGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .schemaGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single SchemaGrant for SSR or cache warming - * + * * @example * ```ts * await prefetchSchemaGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSchemaGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SchemaGrantSelect>; -}): Promise; -export async function prefetchSchemaGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSchemaGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SchemaGrantSelect>; + } +): Promise; +export async function prefetchSchemaGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: schemaGrantKeys.detail(params.id), - queryFn: () => getClient().schemaGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .schemaGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSchemaGrantsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSchemaGrantsQuery.ts index fd6b94fdf0..2f90e0bc50 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSchemaGrantsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSchemaGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { schemaGrantKeys } from "../query-keys"; -import type { SchemaGrantSelect, SchemaGrantWithRelations, SchemaGrantFilter, SchemaGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaGrantSelect, SchemaGrantWithRelations, SchemaGrantFilter, SchemaGrantOrderBy } from "../../orm/input-types"; +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 { schemaGrantKeys } from '../query-keys'; +import type { + SchemaGrantSelect, + SchemaGrantWithRelations, + SchemaGrantFilter, + SchemaGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SchemaGrantSelect, + SchemaGrantWithRelations, + SchemaGrantFilter, + SchemaGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const schemaGrantsQueryKey = schemaGrantKeys.list; /** * Query hook for fetching SchemaGrant list - * + * * @example * ```tsx * const { data, isLoading } = useSchemaGrantsQuery({ @@ -30,33 +45,47 @@ export const schemaGrantsQueryKey = schemaGrantKeys.list; * }); * ``` */ -export function useSchemaGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SchemaGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSchemaGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSchemaGrantsQuery< + S extends SchemaGrantSelect, + TData = { + schemaGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SchemaGrantSelect>; + } & Omit< + UseQueryOptions< + { + schemaGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSchemaGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: schemaGrantKeys.list(args), queryFn: () => getClient().schemaGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch SchemaGrant list without React hooks - * + * * @example * ```ts * const data = await fetchSchemaGrantsQuery({ @@ -70,35 +99,47 @@ export function useSchemaGrantsQuery(params: { export async function fetchSchemaGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SchemaGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SchemaGrantSelect>; }): Promise<{ schemaGrants: ConnectionResult>; }>; export async function fetchSchemaGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().schemaGrant.findMany(args).unwrap(); } /** * Prefetch SchemaGrant list for SSR or cache warming - * + * * @example * ```ts * await prefetchSchemaGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSchemaGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SchemaGrantSelect>; -}): Promise; -export async function prefetchSchemaGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSchemaGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SchemaGrantSelect>; + } +): Promise; +export async function prefetchSchemaGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: schemaGrantKeys.list(args), - queryFn: () => getClient().schemaGrant.findMany(args).unwrap() + queryFn: () => getClient().schemaGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSchemaQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSchemaQuery.ts index 8631c95a6d..0d5d77bb9a 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSchemaQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSchemaQuery.ts @@ -4,20 +4,20 @@ * 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 { schemaKeys } from "../query-keys"; -import type { SchemaSelect, SchemaWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaSelect, SchemaWithRelations } from "../../orm/input-types"; +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 { schemaKeys } from '../query-keys'; +import type { SchemaSelect, SchemaWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SchemaSelect, SchemaWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const schemaQueryKey = schemaKeys.detail; /** * Query hook for fetching a single Schema - * + * * @example * ```tsx * const { data, isLoading } = useSchemaQuery({ @@ -26,38 +26,52 @@ export const schemaQueryKey = schemaKeys.detail; * }); * ``` */ -export function useSchemaQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SchemaSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSchemaQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSchemaQuery< + S extends SchemaSelect, + TData = { + schema: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SchemaSelect>; + } & Omit< + UseQueryOptions< + { + schema: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSchemaQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: schemaKeys.detail(params.id), - queryFn: () => getClient().schema.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .schema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Schema without React hooks - * + * * @example * ```ts * const data = await fetchSchemaQuery({ @@ -79,35 +93,46 @@ export async function fetchSchemaQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().schema.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .schema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Schema for SSR or cache warming - * + * * @example * ```ts * await prefetchSchemaQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSchemaQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SchemaSelect>; -}): Promise; -export async function prefetchSchemaQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSchemaQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SchemaSelect>; + } +): Promise; +export async function prefetchSchemaQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: schemaKeys.detail(params.id), - queryFn: () => getClient().schema.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .schema.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSchemasQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSchemasQuery.ts index 8a3fd8bc53..cdb879719e 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSchemasQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSchemasQuery.ts @@ -4,20 +4,35 @@ * 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 { schemaKeys } from "../query-keys"; -import type { SchemaSelect, SchemaWithRelations, SchemaFilter, SchemaOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SchemaSelect, SchemaWithRelations, SchemaFilter, SchemaOrderBy } from "../../orm/input-types"; +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 { schemaKeys } from '../query-keys'; +import type { + SchemaSelect, + SchemaWithRelations, + SchemaFilter, + SchemaOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SchemaSelect, + SchemaWithRelations, + SchemaFilter, + SchemaOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const schemasQueryKey = schemaKeys.list; /** * Query hook for fetching Schema list - * + * * @example * ```tsx * const { data, isLoading } = useSchemasQuery({ @@ -30,33 +45,45 @@ export const schemasQueryKey = schemaKeys.list; * }); * ``` */ -export function useSchemasQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SchemaSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSchemasQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSchemasQuery< + S extends SchemaSelect, + TData = { + schemas: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SchemaSelect>; + } & Omit< + UseQueryOptions< + { + schemas: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSchemasQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: schemaKeys.list(args), queryFn: () => getClient().schema.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Schema list without React hooks - * + * * @example * ```ts * const data = await fetchSchemasQuery({ @@ -70,7 +97,8 @@ export function useSchemasQuery(params: { export async function fetchSchemasQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SchemaSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SchemaSelect>; }): Promise<{ schemas: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchSchemasQuery(params: { } /** * Prefetch Schema list for SSR or cache warming - * + * * @example * ```ts * await prefetchSchemasQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSchemasQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SchemaSelect>; -}): Promise; -export async function prefetchSchemasQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchSchemasQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SchemaSelect>; + } +): Promise; +export async function prefetchSchemasQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: schemaKeys.list(args), - queryFn: () => getClient().schema.findMany(args).unwrap() + queryFn: () => getClient().schema.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSiteMetadataQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSiteMetadataQuery.ts index bef4f9c8aa..c89637c296 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSiteMetadataQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSiteMetadataQuery.ts @@ -4,20 +4,35 @@ * 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 { siteMetadatumKeys } from "../query-keys"; -import type { SiteMetadatumSelect, SiteMetadatumWithRelations, SiteMetadatumFilter, SiteMetadatumOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteMetadatumSelect, SiteMetadatumWithRelations, SiteMetadatumFilter, SiteMetadatumOrderBy } from "../../orm/input-types"; +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 { siteMetadatumKeys } from '../query-keys'; +import type { + SiteMetadatumSelect, + SiteMetadatumWithRelations, + SiteMetadatumFilter, + SiteMetadatumOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SiteMetadatumSelect, + SiteMetadatumWithRelations, + SiteMetadatumFilter, + SiteMetadatumOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteMetadataQueryKey = siteMetadatumKeys.list; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { data, isLoading } = useSiteMetadataQuery({ @@ -30,33 +45,49 @@ export const siteMetadataQueryKey = siteMetadatumKeys.list; * }); * ``` */ -export function useSiteMetadataQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteMetadatumSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteMetadataQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSiteMetadataQuery< + S extends SiteMetadatumSelect, + TData = { + siteMetadata: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteMetadatumSelect>; + } & Omit< + UseQueryOptions< + { + siteMetadata: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteMetadataQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + SiteMetadatumSelect, + SiteMetadatumFilter, + SiteMetadatumOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteMetadatumKeys.list(args), queryFn: () => getClient().siteMetadatum.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * SEO and social sharing metadata for a site surface - * + * * @example * ```ts * const data = await fetchSiteMetadataQuery({ @@ -70,35 +101,51 @@ export function useSiteMetadataQuery(params: { export async function fetchSiteMetadataQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteMetadatumSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SiteMetadatumSelect>; }): Promise<{ siteMetadata: ConnectionResult>; }>; export async function fetchSiteMetadataQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + SiteMetadatumSelect, + SiteMetadatumFilter, + SiteMetadatumOrderBy + >(params.selection); return getClient().siteMetadatum.findMany(args).unwrap(); } /** * SEO and social sharing metadata for a site surface - * + * * @example * ```ts * await prefetchSiteMetadataQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSiteMetadataQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteMetadatumSelect>; -}): Promise; -export async function prefetchSiteMetadataQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSiteMetadataQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteMetadatumSelect>; + } +): Promise; +export async function prefetchSiteMetadataQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + SiteMetadatumSelect, + SiteMetadatumFilter, + SiteMetadatumOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: siteMetadatumKeys.list(args), - queryFn: () => getClient().siteMetadatum.findMany(args).unwrap() + queryFn: () => getClient().siteMetadatum.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSiteMetadatumQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSiteMetadatumQuery.ts index 6d486a39f8..6d52856d50 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSiteMetadatumQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSiteMetadatumQuery.ts @@ -4,20 +4,20 @@ * 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 { siteMetadatumKeys } from "../query-keys"; -import type { SiteMetadatumSelect, SiteMetadatumWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteMetadatumSelect, SiteMetadatumWithRelations } from "../../orm/input-types"; +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 { siteMetadatumKeys } from '../query-keys'; +import type { SiteMetadatumSelect, SiteMetadatumWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteMetadatumSelect, SiteMetadatumWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteMetadatumQueryKey = siteMetadatumKeys.detail; /** * SEO and social sharing metadata for a site surface - * + * * @example * ```tsx * const { data, isLoading } = useSiteMetadatumQuery({ @@ -26,38 +26,52 @@ export const siteMetadatumQueryKey = siteMetadatumKeys.detail; * }); * ``` */ -export function useSiteMetadatumQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteMetadatumSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteMetadatumQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSiteMetadatumQuery< + S extends SiteMetadatumSelect, + TData = { + siteMetadatum: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteMetadatumSelect>; + } & Omit< + UseQueryOptions< + { + siteMetadatum: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteMetadatumQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteMetadatumKeys.detail(params.id), - queryFn: () => getClient().siteMetadatum.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .siteMetadatum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * SEO and social sharing metadata for a site surface - * + * * @example * ```ts * const data = await fetchSiteMetadatumQuery({ @@ -79,35 +93,46 @@ export async function fetchSiteMetadatumQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().siteMetadatum.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .siteMetadatum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * SEO and social sharing metadata for a site surface - * + * * @example * ```ts * await prefetchSiteMetadatumQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSiteMetadatumQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteMetadatumSelect>; -}): Promise; -export async function prefetchSiteMetadatumQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSiteMetadatumQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteMetadatumSelect>; + } +): Promise; +export async function prefetchSiteMetadatumQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: siteMetadatumKeys.detail(params.id), - queryFn: () => getClient().siteMetadatum.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .siteMetadatum.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSiteModuleQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSiteModuleQuery.ts index 68bd65ca88..96fd4cae7e 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSiteModuleQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSiteModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { siteModuleKeys } from "../query-keys"; -import type { SiteModuleSelect, SiteModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteModuleSelect, SiteModuleWithRelations } from "../../orm/input-types"; +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 { siteModuleKeys } from '../query-keys'; +import type { SiteModuleSelect, SiteModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteModuleSelect, SiteModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteModuleQueryKey = siteModuleKeys.detail; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { data, isLoading } = useSiteModuleQuery({ @@ -26,38 +26,52 @@ export const siteModuleQueryKey = siteModuleKeys.detail; * }); * ``` */ -export function useSiteModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSiteModuleQuery< + S extends SiteModuleSelect, + TData = { + siteModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteModuleSelect>; + } & Omit< + UseQueryOptions< + { + siteModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteModuleKeys.detail(params.id), - queryFn: () => getClient().siteModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .siteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```ts * const data = await fetchSiteModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchSiteModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().siteModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .siteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```ts * await prefetchSiteModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSiteModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteModuleSelect>; -}): Promise; -export async function prefetchSiteModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSiteModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteModuleSelect>; + } +): Promise; +export async function prefetchSiteModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: siteModuleKeys.detail(params.id), - queryFn: () => getClient().siteModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .siteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSiteModulesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSiteModulesQuery.ts index 4153b377f8..de6e142ca0 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSiteModulesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSiteModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { siteModuleKeys } from "../query-keys"; -import type { SiteModuleSelect, SiteModuleWithRelations, SiteModuleFilter, SiteModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteModuleSelect, SiteModuleWithRelations, SiteModuleFilter, SiteModuleOrderBy } from "../../orm/input-types"; +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 { siteModuleKeys } from '../query-keys'; +import type { + SiteModuleSelect, + SiteModuleWithRelations, + SiteModuleFilter, + SiteModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SiteModuleSelect, + SiteModuleWithRelations, + SiteModuleFilter, + SiteModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteModulesQueryKey = siteModuleKeys.list; /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```tsx * const { data, isLoading } = useSiteModulesQuery({ @@ -30,33 +45,47 @@ export const siteModulesQueryKey = siteModuleKeys.list; * }); * ``` */ -export function useSiteModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSiteModulesQuery< + S extends SiteModuleSelect, + TData = { + siteModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteModuleSelect>; + } & Omit< + UseQueryOptions< + { + siteModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteModuleKeys.list(args), queryFn: () => getClient().siteModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```ts * const data = await fetchSiteModulesQuery({ @@ -70,35 +99,47 @@ export function useSiteModulesQuery(params: { export async function fetchSiteModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SiteModuleSelect>; }): Promise<{ siteModules: ConnectionResult>; }>; export async function fetchSiteModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().siteModule.findMany(args).unwrap(); } /** * Frontend module configuration for a site surface; stores module name and JSON settings - * + * * @example * ```ts * await prefetchSiteModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSiteModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteModuleSelect>; -}): Promise; -export async function prefetchSiteModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSiteModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteModuleSelect>; + } +): Promise; +export async function prefetchSiteModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: siteModuleKeys.list(args), - queryFn: () => getClient().siteModule.findMany(args).unwrap() + queryFn: () => getClient().siteModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSiteQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSiteQuery.ts index 1efa73186a..38f9d30e8a 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSiteQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSiteQuery.ts @@ -4,20 +4,20 @@ * 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 { siteKeys } from "../query-keys"; -import type { SiteSelect, SiteWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSelect, SiteWithRelations } from "../../orm/input-types"; +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 { siteKeys } from '../query-keys'; +import type { SiteSelect, SiteWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteSelect, SiteWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteQueryKey = siteKeys.detail; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { data, isLoading } = useSiteQuery({ @@ -26,38 +26,52 @@ export const siteQueryKey = siteKeys.detail; * }); * ``` */ -export function useSiteQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSiteQuery< + S extends SiteSelect, + TData = { + site: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteSelect>; + } & Omit< + UseQueryOptions< + { + site: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteKeys.detail(params.id), - queryFn: () => getClient().site.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .site.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * const data = await fetchSiteQuery({ @@ -79,35 +93,46 @@ export async function fetchSiteQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().site.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .site.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * await prefetchSiteQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSiteQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteSelect>; -}): Promise; -export async function prefetchSiteQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSiteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteSelect>; + } +): Promise; +export async function prefetchSiteQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: siteKeys.detail(params.id), - queryFn: () => getClient().site.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .site.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSiteThemeQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSiteThemeQuery.ts index d170ad4ea1..a77c2a909d 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSiteThemeQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSiteThemeQuery.ts @@ -4,20 +4,20 @@ * 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 { siteThemeKeys } from "../query-keys"; -import type { SiteThemeSelect, SiteThemeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteThemeSelect, SiteThemeWithRelations } from "../../orm/input-types"; +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 { siteThemeKeys } from '../query-keys'; +import type { SiteThemeSelect, SiteThemeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SiteThemeSelect, SiteThemeWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteThemeQueryKey = siteThemeKeys.detail; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { data, isLoading } = useSiteThemeQuery({ @@ -26,38 +26,52 @@ export const siteThemeQueryKey = siteThemeKeys.detail; * }); * ``` */ -export function useSiteThemeQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteThemeSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteThemeQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSiteThemeQuery< + S extends SiteThemeSelect, + TData = { + siteTheme: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteThemeSelect>; + } & Omit< + UseQueryOptions< + { + siteTheme: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteThemeQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteThemeKeys.detail(params.id), - queryFn: () => getClient().siteTheme.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .siteTheme.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```ts * const data = await fetchSiteThemeQuery({ @@ -79,35 +93,46 @@ export async function fetchSiteThemeQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().siteTheme.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .siteTheme.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```ts * await prefetchSiteThemeQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSiteThemeQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteThemeSelect>; -}): Promise; -export async function prefetchSiteThemeQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSiteThemeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteThemeSelect>; + } +): Promise; +export async function prefetchSiteThemeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: siteThemeKeys.detail(params.id), - queryFn: () => getClient().siteTheme.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .siteTheme.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSiteThemesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSiteThemesQuery.ts index 775dc37442..308031714a 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSiteThemesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSiteThemesQuery.ts @@ -4,20 +4,35 @@ * 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 { siteThemeKeys } from "../query-keys"; -import type { SiteThemeSelect, SiteThemeWithRelations, SiteThemeFilter, SiteThemeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteThemeSelect, SiteThemeWithRelations, SiteThemeFilter, SiteThemeOrderBy } from "../../orm/input-types"; +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 { siteThemeKeys } from '../query-keys'; +import type { + SiteThemeSelect, + SiteThemeWithRelations, + SiteThemeFilter, + SiteThemeOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SiteThemeSelect, + SiteThemeWithRelations, + SiteThemeFilter, + SiteThemeOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteThemesQueryKey = siteThemeKeys.list; /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```tsx * const { data, isLoading } = useSiteThemesQuery({ @@ -30,33 +45,47 @@ export const siteThemesQueryKey = siteThemeKeys.list; * }); * ``` */ -export function useSiteThemesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteThemeSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteThemesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSiteThemesQuery< + S extends SiteThemeSelect, + TData = { + siteThemes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteThemeSelect>; + } & Omit< + UseQueryOptions< + { + siteThemes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteThemesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteThemeKeys.list(args), queryFn: () => getClient().siteTheme.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```ts * const data = await fetchSiteThemesQuery({ @@ -70,35 +99,47 @@ export function useSiteThemesQuery(params: { export async function fetchSiteThemesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteThemeSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SiteThemeSelect>; }): Promise<{ siteThemes: ConnectionResult>; }>; export async function fetchSiteThemesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().siteTheme.findMany(args).unwrap(); } /** * Theme (colors, fonts, design tokens) for a site surface - * + * * @example * ```ts * await prefetchSiteThemesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSiteThemesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteThemeSelect>; -}): Promise; -export async function prefetchSiteThemesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSiteThemesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteThemeSelect>; + } +): Promise; +export async function prefetchSiteThemesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: siteThemeKeys.list(args), - queryFn: () => getClient().siteTheme.findMany(args).unwrap() + queryFn: () => getClient().siteTheme.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSitesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSitesQuery.ts index 95ce073486..7769bfde6f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSitesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSitesQuery.ts @@ -4,20 +4,25 @@ * 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 { siteKeys } from "../query-keys"; -import type { SiteSelect, SiteWithRelations, SiteFilter, SiteOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSelect, SiteWithRelations, SiteFilter, SiteOrderBy } from "../../orm/input-types"; +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 { siteKeys } from '../query-keys'; +import type { SiteSelect, SiteWithRelations, SiteFilter, SiteOrderBy } from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { SiteSelect, SiteWithRelations, SiteFilter, SiteOrderBy } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const sitesQueryKey = siteKeys.list; /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```tsx * const { data, isLoading } = useSitesQuery({ @@ -30,33 +35,45 @@ export const sitesQueryKey = siteKeys.list; * }); * ``` */ -export function useSitesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSitesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSitesQuery< + S extends SiteSelect, + TData = { + sites: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteSelect>; + } & Omit< + UseQueryOptions< + { + sites: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSitesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteKeys.list(args), queryFn: () => getClient().site.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * const data = await fetchSitesQuery({ @@ -70,7 +87,8 @@ export function useSitesQuery(params: { export async function fetchSitesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SiteSelect>; }): Promise<{ sites: ConnectionResult>; }>; @@ -82,23 +100,30 @@ export async function fetchSitesQuery(params: { } /** * Site surfaces exposed by this scope; publication makes a surface bindable from other scopes - * + * * @example * ```ts * await prefetchSitesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSitesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteSelect>; -}): Promise; -export async function prefetchSitesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchSitesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteSelect>; + } +): Promise; +export async function prefetchSitesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: siteKeys.list(args), - queryFn: () => getClient().site.findMany(args).unwrap() + queryFn: () => getClient().site.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSpatialRelationQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSpatialRelationQuery.ts index 0af064de43..3c16e81489 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSpatialRelationQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSpatialRelationQuery.ts @@ -4,20 +4,20 @@ * 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 { spatialRelationKeys } from "../query-keys"; -import type { SpatialRelationSelect, SpatialRelationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SpatialRelationSelect, SpatialRelationWithRelations } from "../../orm/input-types"; +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 { spatialRelationKeys } from '../query-keys'; +import type { SpatialRelationSelect, SpatialRelationWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SpatialRelationSelect, SpatialRelationWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const spatialRelationQueryKey = spatialRelationKeys.detail; /** * Query hook for fetching a single SpatialRelation - * + * * @example * ```tsx * const { data, isLoading } = useSpatialRelationQuery({ @@ -26,38 +26,52 @@ export const spatialRelationQueryKey = spatialRelationKeys.detail; * }); * ``` */ -export function useSpatialRelationQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SpatialRelationSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSpatialRelationQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSpatialRelationQuery< + S extends SpatialRelationSelect, + TData = { + spatialRelation: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SpatialRelationSelect>; + } & Omit< + UseQueryOptions< + { + spatialRelation: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSpatialRelationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: spatialRelationKeys.detail(params.id), - queryFn: () => getClient().spatialRelation.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .spatialRelation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single SpatialRelation without React hooks - * + * * @example * ```ts * const data = await fetchSpatialRelationQuery({ @@ -79,35 +93,46 @@ export async function fetchSpatialRelationQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().spatialRelation.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .spatialRelation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single SpatialRelation for SSR or cache warming - * + * * @example * ```ts * await prefetchSpatialRelationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSpatialRelationQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SpatialRelationSelect>; -}): Promise; -export async function prefetchSpatialRelationQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSpatialRelationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SpatialRelationSelect>; + } +): Promise; +export async function prefetchSpatialRelationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: spatialRelationKeys.detail(params.id), - queryFn: () => getClient().spatialRelation.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .spatialRelation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSpatialRelationsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSpatialRelationsQuery.ts index 257a662789..ea1a3996d3 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSpatialRelationsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSpatialRelationsQuery.ts @@ -4,20 +4,35 @@ * 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 { spatialRelationKeys } from "../query-keys"; -import type { SpatialRelationSelect, SpatialRelationWithRelations, SpatialRelationFilter, SpatialRelationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SpatialRelationSelect, SpatialRelationWithRelations, SpatialRelationFilter, SpatialRelationOrderBy } from "../../orm/input-types"; +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 { spatialRelationKeys } from '../query-keys'; +import type { + SpatialRelationSelect, + SpatialRelationWithRelations, + SpatialRelationFilter, + SpatialRelationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SpatialRelationSelect, + SpatialRelationWithRelations, + SpatialRelationFilter, + SpatialRelationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const spatialRelationsQueryKey = spatialRelationKeys.list; /** * Query hook for fetching SpatialRelation list - * + * * @example * ```tsx * const { data, isLoading } = useSpatialRelationsQuery({ @@ -30,33 +45,53 @@ export const spatialRelationsQueryKey = spatialRelationKeys.list; * }); * ``` */ -export function useSpatialRelationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SpatialRelationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSpatialRelationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSpatialRelationsQuery< + S extends SpatialRelationSelect, + TData = { + spatialRelations: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SpatialRelationSelect>; + } & Omit< + UseQueryOptions< + { + spatialRelations: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSpatialRelationsQuery( + params: { + selection: ListSelectionConfig< + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: spatialRelationKeys.list(args), queryFn: () => getClient().spatialRelation.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch SpatialRelation list without React hooks - * + * * @example * ```ts * const data = await fetchSpatialRelationsQuery({ @@ -70,35 +105,59 @@ export function useSpatialRelationsQuery(params: { export async function fetchSpatialRelationsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SpatialRelationSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SpatialRelationSelect>; }): Promise<{ spatialRelations: ConnectionResult>; }>; export async function fetchSpatialRelationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy + >(params.selection); return getClient().spatialRelation.findMany(args).unwrap(); } /** * Prefetch SpatialRelation list for SSR or cache warming - * + * * @example * ```ts * await prefetchSpatialRelationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSpatialRelationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SpatialRelationSelect>; -}): Promise; -export async function prefetchSpatialRelationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSpatialRelationsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SpatialRelationSelect>; + } +): Promise; +export async function prefetchSpatialRelationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: spatialRelationKeys.list(args), - queryFn: () => getClient().spatialRelation.findMany(args).unwrap() + queryFn: () => getClient().spatialRelation.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSqlActionQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSqlActionQuery.ts index 6f3f63a21b..8ca9fab570 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSqlActionQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSqlActionQuery.ts @@ -4,20 +4,20 @@ * 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 { sqlActionKeys } from "../query-keys"; -import type { SqlActionSelect, SqlActionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SqlActionSelect, SqlActionWithRelations } from "../../orm/input-types"; +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 { sqlActionKeys } from '../query-keys'; +import type { SqlActionSelect, SqlActionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SqlActionSelect, SqlActionWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const sqlActionQueryKey = sqlActionKeys.detail; /** * Query hook for fetching a single SqlAction - * + * * @example * ```tsx * const { data, isLoading } = useSqlActionQuery({ @@ -26,38 +26,52 @@ export const sqlActionQueryKey = sqlActionKeys.detail; * }); * ``` */ -export function useSqlActionQuery | null; -}>(params: { - id: number; - selection: { - fields: S; - } & HookStrictSelect, SqlActionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSqlActionQuery(params: { - id: number; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSqlActionQuery< + S extends SqlActionSelect, + TData = { + sqlAction: InferSelectResult | null; + }, +>( + params: { + id: number; + selection: { + fields: S; + } & HookStrictSelect, SqlActionSelect>; + } & Omit< + UseQueryOptions< + { + sqlAction: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSqlActionQuery( + params: { + id: number; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: sqlActionKeys.detail(params.id), - queryFn: () => getClient().sqlAction.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .sqlAction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single SqlAction without React hooks - * + * * @example * ```ts * const data = await fetchSqlActionQuery({ @@ -79,35 +93,46 @@ export async function fetchSqlActionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().sqlAction.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .sqlAction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single SqlAction for SSR or cache warming - * + * * @example * ```ts * await prefetchSqlActionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSqlActionQuery(queryClient: QueryClient, params: { - id: number; - selection: { - fields: S; - } & HookStrictSelect, SqlActionSelect>; -}): Promise; -export async function prefetchSqlActionQuery(queryClient: QueryClient, params: { - id: number; - selection: SelectionConfig; -}): Promise { +export async function prefetchSqlActionQuery( + queryClient: QueryClient, + params: { + id: number; + selection: { + fields: S; + } & HookStrictSelect, SqlActionSelect>; + } +): Promise; +export async function prefetchSqlActionQuery( + queryClient: QueryClient, + params: { + id: number; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: sqlActionKeys.detail(params.id), - queryFn: () => getClient().sqlAction.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .sqlAction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useSqlActionsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useSqlActionsQuery.ts index cb5d2c2495..3ea449b0a2 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useSqlActionsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useSqlActionsQuery.ts @@ -4,20 +4,35 @@ * 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 { sqlActionKeys } from "../query-keys"; -import type { SqlActionSelect, SqlActionWithRelations, SqlActionFilter, SqlActionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SqlActionSelect, SqlActionWithRelations, SqlActionFilter, SqlActionOrderBy } from "../../orm/input-types"; +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 { sqlActionKeys } from '../query-keys'; +import type { + SqlActionSelect, + SqlActionWithRelations, + SqlActionFilter, + SqlActionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SqlActionSelect, + SqlActionWithRelations, + SqlActionFilter, + SqlActionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const sqlActionsQueryKey = sqlActionKeys.list; /** * Query hook for fetching SqlAction list - * + * * @example * ```tsx * const { data, isLoading } = useSqlActionsQuery({ @@ -30,33 +45,47 @@ export const sqlActionsQueryKey = sqlActionKeys.list; * }); * ``` */ -export function useSqlActionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SqlActionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSqlActionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSqlActionsQuery< + S extends SqlActionSelect, + TData = { + sqlActions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SqlActionSelect>; + } & Omit< + UseQueryOptions< + { + sqlActions: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSqlActionsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: sqlActionKeys.list(args), queryFn: () => getClient().sqlAction.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch SqlAction list without React hooks - * + * * @example * ```ts * const data = await fetchSqlActionsQuery({ @@ -70,35 +99,47 @@ export function useSqlActionsQuery(params: { export async function fetchSqlActionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SqlActionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SqlActionSelect>; }): Promise<{ sqlActions: ConnectionResult>; }>; export async function fetchSqlActionsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().sqlAction.findMany(args).unwrap(); } /** * Prefetch SqlAction list for SSR or cache warming - * + * * @example * ```ts * await prefetchSqlActionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSqlActionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SqlActionSelect>; -}): Promise; -export async function prefetchSqlActionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSqlActionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SqlActionSelect>; + } +): Promise; +export async function prefetchSqlActionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: sqlActionKeys.list(args), - queryFn: () => getClient().sqlAction.findMany(args).unwrap() + queryFn: () => getClient().sqlAction.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useTableGrantQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useTableGrantQuery.ts index e69499ba99..1214ca612d 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useTableGrantQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useTableGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { tableGrantKeys } from "../query-keys"; -import type { TableGrantSelect, TableGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableGrantSelect, TableGrantWithRelations } from "../../orm/input-types"; +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 { tableGrantKeys } from '../query-keys'; +import type { TableGrantSelect, TableGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TableGrantSelect, TableGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const tableGrantQueryKey = tableGrantKeys.detail; /** * Query hook for fetching a single TableGrant - * + * * @example * ```tsx * const { data, isLoading } = useTableGrantQuery({ @@ -26,38 +26,52 @@ export const tableGrantQueryKey = tableGrantKeys.detail; * }); * ``` */ -export function useTableGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TableGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTableGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useTableGrantQuery< + S extends TableGrantSelect, + TData = { + tableGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TableGrantSelect>; + } & Omit< + UseQueryOptions< + { + tableGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTableGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: tableGrantKeys.detail(params.id), - queryFn: () => getClient().tableGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .tableGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single TableGrant without React hooks - * + * * @example * ```ts * const data = await fetchTableGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchTableGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().tableGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .tableGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single TableGrant for SSR or cache warming - * + * * @example * ```ts * await prefetchTableGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchTableGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TableGrantSelect>; -}): Promise; -export async function prefetchTableGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchTableGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TableGrantSelect>; + } +): Promise; +export async function prefetchTableGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: tableGrantKeys.detail(params.id), - queryFn: () => getClient().tableGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .tableGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useTableGrantsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useTableGrantsQuery.ts index ef93d8463e..19f3f58c9c 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useTableGrantsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useTableGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { tableGrantKeys } from "../query-keys"; -import type { TableGrantSelect, TableGrantWithRelations, TableGrantFilter, TableGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableGrantSelect, TableGrantWithRelations, TableGrantFilter, TableGrantOrderBy } from "../../orm/input-types"; +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 { tableGrantKeys } from '../query-keys'; +import type { + TableGrantSelect, + TableGrantWithRelations, + TableGrantFilter, + TableGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + TableGrantSelect, + TableGrantWithRelations, + TableGrantFilter, + TableGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const tableGrantsQueryKey = tableGrantKeys.list; /** * Query hook for fetching TableGrant list - * + * * @example * ```tsx * const { data, isLoading } = useTableGrantsQuery({ @@ -30,33 +45,47 @@ export const tableGrantsQueryKey = tableGrantKeys.list; * }); * ``` */ -export function useTableGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TableGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTableGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useTableGrantsQuery< + S extends TableGrantSelect, + TData = { + tableGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TableGrantSelect>; + } & Omit< + UseQueryOptions< + { + tableGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTableGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: tableGrantKeys.list(args), queryFn: () => getClient().tableGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch TableGrant list without React hooks - * + * * @example * ```ts * const data = await fetchTableGrantsQuery({ @@ -70,35 +99,47 @@ export function useTableGrantsQuery(params: { export async function fetchTableGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, TableGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, TableGrantSelect>; }): Promise<{ tableGrants: ConnectionResult>; }>; export async function fetchTableGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().tableGrant.findMany(args).unwrap(); } /** * Prefetch TableGrant list for SSR or cache warming - * + * * @example * ```ts * await prefetchTableGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchTableGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TableGrantSelect>; -}): Promise; -export async function prefetchTableGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchTableGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TableGrantSelect>; + } +): Promise; +export async function prefetchTableGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: tableGrantKeys.list(args), - queryFn: () => getClient().tableGrant.findMany(args).unwrap() + queryFn: () => getClient().tableGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useTableQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useTableQuery.ts index 51223f9bc7..3ead8b326f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useTableQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useTableQuery.ts @@ -4,20 +4,20 @@ * 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 { tableKeys } from "../query-keys"; -import type { TableSelect, TableWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableSelect, TableWithRelations } from "../../orm/input-types"; +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 { tableKeys } from '../query-keys'; +import type { TableSelect, TableWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TableSelect, TableWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const tableQueryKey = tableKeys.detail; /** * Query hook for fetching a single Table - * + * * @example * ```tsx * const { data, isLoading } = useTableQuery({ @@ -26,38 +26,52 @@ export const tableQueryKey = tableKeys.detail; * }); * ``` */ -export function useTableQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TableSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTableQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useTableQuery< + S extends TableSelect, + TData = { + table: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TableSelect>; + } & Omit< + UseQueryOptions< + { + table: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTableQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: tableKeys.detail(params.id), - queryFn: () => getClient().table.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .table.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Table without React hooks - * + * * @example * ```ts * const data = await fetchTableQuery({ @@ -79,35 +93,46 @@ export async function fetchTableQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().table.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .table.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Table for SSR or cache warming - * + * * @example * ```ts * await prefetchTableQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchTableQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TableSelect>; -}): Promise; -export async function prefetchTableQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchTableQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TableSelect>; + } +): Promise; +export async function prefetchTableQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: tableKeys.detail(params.id), - queryFn: () => getClient().table.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .table.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useTablesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useTablesQuery.ts index e30189fb67..ded2092d61 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useTablesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useTablesQuery.ts @@ -4,20 +4,35 @@ * 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 { tableKeys } from "../query-keys"; -import type { TableSelect, TableWithRelations, TableFilter, TableOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { TableSelect, TableWithRelations, TableFilter, TableOrderBy } from "../../orm/input-types"; +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 { tableKeys } from '../query-keys'; +import type { + TableSelect, + TableWithRelations, + TableFilter, + TableOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + TableSelect, + TableWithRelations, + TableFilter, + TableOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const tablesQueryKey = tableKeys.list; /** * Query hook for fetching Table list - * + * * @example * ```tsx * const { data, isLoading } = useTablesQuery({ @@ -30,33 +45,45 @@ export const tablesQueryKey = tableKeys.list; * }); * ``` */ -export function useTablesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TableSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTablesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useTablesQuery< + S extends TableSelect, + TData = { + tables: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TableSelect>; + } & Omit< + UseQueryOptions< + { + tables: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTablesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: tableKeys.list(args), queryFn: () => getClient().table.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Table list without React hooks - * + * * @example * ```ts * const data = await fetchTablesQuery({ @@ -70,7 +97,8 @@ export function useTablesQuery(params: { export async function fetchTablesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, TableSelect>; + } & Omit, 'fields'> & + HookStrictSelect, TableSelect>; }): Promise<{ tables: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchTablesQuery(params: { } /** * Prefetch Table list for SSR or cache warming - * + * * @example * ```ts * await prefetchTablesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchTablesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TableSelect>; -}): Promise; -export async function prefetchTablesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchTablesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TableSelect>; + } +): Promise; +export async function prefetchTablesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: tableKeys.list(args), - queryFn: () => getClient().table.findMany(args).unwrap() + queryFn: () => getClient().table.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useTriggerFunctionQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useTriggerFunctionQuery.ts index 437be6b6ed..eadd5cd413 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useTriggerFunctionQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useTriggerFunctionQuery.ts @@ -4,20 +4,20 @@ * 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 { triggerFunctionKeys } from "../query-keys"; -import type { TriggerFunctionSelect, TriggerFunctionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerFunctionSelect, TriggerFunctionWithRelations } from "../../orm/input-types"; +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 { triggerFunctionKeys } from '../query-keys'; +import type { TriggerFunctionSelect, TriggerFunctionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TriggerFunctionSelect, TriggerFunctionWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const triggerFunctionQueryKey = triggerFunctionKeys.detail; /** * Query hook for fetching a single TriggerFunction - * + * * @example * ```tsx * const { data, isLoading } = useTriggerFunctionQuery({ @@ -26,38 +26,52 @@ export const triggerFunctionQueryKey = triggerFunctionKeys.detail; * }); * ``` */ -export function useTriggerFunctionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TriggerFunctionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTriggerFunctionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useTriggerFunctionQuery< + S extends TriggerFunctionSelect, + TData = { + triggerFunction: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TriggerFunctionSelect>; + } & Omit< + UseQueryOptions< + { + triggerFunction: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTriggerFunctionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: triggerFunctionKeys.detail(params.id), - queryFn: () => getClient().triggerFunction.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .triggerFunction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single TriggerFunction without React hooks - * + * * @example * ```ts * const data = await fetchTriggerFunctionQuery({ @@ -79,35 +93,46 @@ export async function fetchTriggerFunctionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().triggerFunction.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .triggerFunction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single TriggerFunction for SSR or cache warming - * + * * @example * ```ts * await prefetchTriggerFunctionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchTriggerFunctionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TriggerFunctionSelect>; -}): Promise; -export async function prefetchTriggerFunctionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchTriggerFunctionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TriggerFunctionSelect>; + } +): Promise; +export async function prefetchTriggerFunctionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: triggerFunctionKeys.detail(params.id), - queryFn: () => getClient().triggerFunction.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .triggerFunction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useTriggerFunctionsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useTriggerFunctionsQuery.ts index a3e224169c..d69ece4b6f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useTriggerFunctionsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useTriggerFunctionsQuery.ts @@ -4,20 +4,35 @@ * 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 { triggerFunctionKeys } from "../query-keys"; -import type { TriggerFunctionSelect, TriggerFunctionWithRelations, TriggerFunctionFilter, TriggerFunctionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerFunctionSelect, TriggerFunctionWithRelations, TriggerFunctionFilter, TriggerFunctionOrderBy } from "../../orm/input-types"; +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 { triggerFunctionKeys } from '../query-keys'; +import type { + TriggerFunctionSelect, + TriggerFunctionWithRelations, + TriggerFunctionFilter, + TriggerFunctionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + TriggerFunctionSelect, + TriggerFunctionWithRelations, + TriggerFunctionFilter, + TriggerFunctionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const triggerFunctionsQueryKey = triggerFunctionKeys.list; /** * Query hook for fetching TriggerFunction list - * + * * @example * ```tsx * const { data, isLoading } = useTriggerFunctionsQuery({ @@ -30,33 +45,53 @@ export const triggerFunctionsQueryKey = triggerFunctionKeys.list; * }); * ``` */ -export function useTriggerFunctionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TriggerFunctionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTriggerFunctionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useTriggerFunctionsQuery< + S extends TriggerFunctionSelect, + TData = { + triggerFunctions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TriggerFunctionSelect>; + } & Omit< + UseQueryOptions< + { + triggerFunctions: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTriggerFunctionsQuery( + params: { + selection: ListSelectionConfig< + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: triggerFunctionKeys.list(args), queryFn: () => getClient().triggerFunction.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch TriggerFunction list without React hooks - * + * * @example * ```ts * const data = await fetchTriggerFunctionsQuery({ @@ -70,35 +105,59 @@ export function useTriggerFunctionsQuery(params: { export async function fetchTriggerFunctionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, TriggerFunctionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, TriggerFunctionSelect>; }): Promise<{ triggerFunctions: ConnectionResult>; }>; export async function fetchTriggerFunctionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy + >(params.selection); return getClient().triggerFunction.findMany(args).unwrap(); } /** * Prefetch TriggerFunction list for SSR or cache warming - * + * * @example * ```ts * await prefetchTriggerFunctionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchTriggerFunctionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TriggerFunctionSelect>; -}): Promise; -export async function prefetchTriggerFunctionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchTriggerFunctionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TriggerFunctionSelect>; + } +): Promise; +export async function prefetchTriggerFunctionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: triggerFunctionKeys.list(args), - queryFn: () => getClient().triggerFunction.findMany(args).unwrap() + queryFn: () => getClient().triggerFunction.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useTriggerQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useTriggerQuery.ts index d79aa0d6e5..92d6ea2b58 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useTriggerQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useTriggerQuery.ts @@ -4,20 +4,20 @@ * 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 { triggerKeys } from "../query-keys"; -import type { TriggerSelect, TriggerWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerSelect, TriggerWithRelations } from "../../orm/input-types"; +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 { triggerKeys } from '../query-keys'; +import type { TriggerSelect, TriggerWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { TriggerSelect, TriggerWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const triggerQueryKey = triggerKeys.detail; /** * Query hook for fetching a single Trigger - * + * * @example * ```tsx * const { data, isLoading } = useTriggerQuery({ @@ -26,38 +26,52 @@ export const triggerQueryKey = triggerKeys.detail; * }); * ``` */ -export function useTriggerQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TriggerSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTriggerQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useTriggerQuery< + S extends TriggerSelect, + TData = { + trigger: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TriggerSelect>; + } & Omit< + UseQueryOptions< + { + trigger: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTriggerQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: triggerKeys.detail(params.id), - queryFn: () => getClient().trigger.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .trigger.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Trigger without React hooks - * + * * @example * ```ts * const data = await fetchTriggerQuery({ @@ -79,35 +93,46 @@ export async function fetchTriggerQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().trigger.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .trigger.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Trigger for SSR or cache warming - * + * * @example * ```ts * await prefetchTriggerQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchTriggerQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TriggerSelect>; -}): Promise; -export async function prefetchTriggerQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchTriggerQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TriggerSelect>; + } +): Promise; +export async function prefetchTriggerQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: triggerKeys.detail(params.id), - queryFn: () => getClient().trigger.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .trigger.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useTriggersQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useTriggersQuery.ts index 08aaae6fd8..cc111ea089 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useTriggersQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useTriggersQuery.ts @@ -4,20 +4,35 @@ * 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 { triggerKeys } from "../query-keys"; -import type { TriggerSelect, TriggerWithRelations, TriggerFilter, TriggerOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { TriggerSelect, TriggerWithRelations, TriggerFilter, TriggerOrderBy } from "../../orm/input-types"; +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 { triggerKeys } from '../query-keys'; +import type { + TriggerSelect, + TriggerWithRelations, + TriggerFilter, + TriggerOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + TriggerSelect, + TriggerWithRelations, + TriggerFilter, + TriggerOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const triggersQueryKey = triggerKeys.list; /** * Query hook for fetching Trigger list - * + * * @example * ```tsx * const { data, isLoading } = useTriggersQuery({ @@ -30,33 +45,47 @@ export const triggersQueryKey = triggerKeys.list; * }); * ``` */ -export function useTriggersQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TriggerSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTriggersQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useTriggersQuery< + S extends TriggerSelect, + TData = { + triggers: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TriggerSelect>; + } & Omit< + UseQueryOptions< + { + triggers: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTriggersQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: triggerKeys.list(args), queryFn: () => getClient().trigger.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Trigger list without React hooks - * + * * @example * ```ts * const data = await fetchTriggersQuery({ @@ -70,35 +99,47 @@ export function useTriggersQuery(params: { export async function fetchTriggersQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, TriggerSelect>; + } & Omit, 'fields'> & + HookStrictSelect, TriggerSelect>; }): Promise<{ triggers: ConnectionResult>; }>; export async function fetchTriggersQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().trigger.findMany(args).unwrap(); } /** * Prefetch Trigger list for SSR or cache warming - * + * * @example * ```ts * await prefetchTriggersQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchTriggersQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TriggerSelect>; -}): Promise; -export async function prefetchTriggersQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchTriggersQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TriggerSelect>; + } +): Promise; +export async function prefetchTriggersQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: triggerKeys.list(args), - queryFn: () => getClient().trigger.findMany(args).unwrap() + queryFn: () => getClient().trigger.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useUniqueConstraintQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useUniqueConstraintQuery.ts index 7e85a991bc..15552fe22f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useUniqueConstraintQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useUniqueConstraintQuery.ts @@ -4,20 +4,20 @@ * 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 { uniqueConstraintKeys } from "../query-keys"; -import type { UniqueConstraintSelect, UniqueConstraintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UniqueConstraintSelect, UniqueConstraintWithRelations } from "../../orm/input-types"; +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 { uniqueConstraintKeys } from '../query-keys'; +import type { UniqueConstraintSelect, UniqueConstraintWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UniqueConstraintSelect, UniqueConstraintWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const uniqueConstraintQueryKey = uniqueConstraintKeys.detail; /** * Query hook for fetching a single UniqueConstraint - * + * * @example * ```tsx * const { data, isLoading } = useUniqueConstraintQuery({ @@ -26,38 +26,52 @@ export const uniqueConstraintQueryKey = uniqueConstraintKeys.detail; * }); * ``` */ -export function useUniqueConstraintQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UniqueConstraintSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUniqueConstraintQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUniqueConstraintQuery< + S extends UniqueConstraintSelect, + TData = { + uniqueConstraint: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UniqueConstraintSelect>; + } & Omit< + UseQueryOptions< + { + uniqueConstraint: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUniqueConstraintQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: uniqueConstraintKeys.detail(params.id), - queryFn: () => getClient().uniqueConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .uniqueConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single UniqueConstraint without React hooks - * + * * @example * ```ts * const data = await fetchUniqueConstraintQuery({ @@ -79,35 +93,46 @@ export async function fetchUniqueConstraintQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().uniqueConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .uniqueConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single UniqueConstraint for SSR or cache warming - * + * * @example * ```ts * await prefetchUniqueConstraintQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchUniqueConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UniqueConstraintSelect>; -}): Promise; -export async function prefetchUniqueConstraintQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchUniqueConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UniqueConstraintSelect>; + } +): Promise; +export async function prefetchUniqueConstraintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: uniqueConstraintKeys.detail(params.id), - queryFn: () => getClient().uniqueConstraint.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .uniqueConstraint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useUniqueConstraintsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useUniqueConstraintsQuery.ts index 5ea7ebeb1d..b68770cf9a 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useUniqueConstraintsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useUniqueConstraintsQuery.ts @@ -4,20 +4,35 @@ * 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 { uniqueConstraintKeys } from "../query-keys"; -import type { UniqueConstraintSelect, UniqueConstraintWithRelations, UniqueConstraintFilter, UniqueConstraintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { UniqueConstraintSelect, UniqueConstraintWithRelations, UniqueConstraintFilter, UniqueConstraintOrderBy } from "../../orm/input-types"; +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 { uniqueConstraintKeys } from '../query-keys'; +import type { + UniqueConstraintSelect, + UniqueConstraintWithRelations, + UniqueConstraintFilter, + UniqueConstraintOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + UniqueConstraintSelect, + UniqueConstraintWithRelations, + UniqueConstraintFilter, + UniqueConstraintOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const uniqueConstraintsQueryKey = uniqueConstraintKeys.list; /** * Query hook for fetching UniqueConstraint list - * + * * @example * ```tsx * const { data, isLoading } = useUniqueConstraintsQuery({ @@ -30,33 +45,53 @@ export const uniqueConstraintsQueryKey = uniqueConstraintKeys.list; * }); * ``` */ -export function useUniqueConstraintsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UniqueConstraintSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUniqueConstraintsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useUniqueConstraintsQuery< + S extends UniqueConstraintSelect, + TData = { + uniqueConstraints: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UniqueConstraintSelect>; + } & Omit< + UseQueryOptions< + { + uniqueConstraints: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUniqueConstraintsQuery( + params: { + selection: ListSelectionConfig< + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: uniqueConstraintKeys.list(args), queryFn: () => getClient().uniqueConstraint.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch UniqueConstraint list without React hooks - * + * * @example * ```ts * const data = await fetchUniqueConstraintsQuery({ @@ -70,35 +105,59 @@ export function useUniqueConstraintsQuery(params: { export async function fetchUniqueConstraintsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, UniqueConstraintSelect>; + } & Omit, 'fields'> & + HookStrictSelect, UniqueConstraintSelect>; }): Promise<{ uniqueConstraints: ConnectionResult>; }>; export async function fetchUniqueConstraintsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy + >(params.selection); return getClient().uniqueConstraint.findMany(args).unwrap(); } /** * Prefetch UniqueConstraint list for SSR or cache warming - * + * * @example * ```ts * await prefetchUniqueConstraintsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchUniqueConstraintsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UniqueConstraintSelect>; -}): Promise; -export async function prefetchUniqueConstraintsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchUniqueConstraintsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UniqueConstraintSelect>; + } +): Promise; +export async function prefetchUniqueConstraintsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: uniqueConstraintKeys.list(args), - queryFn: () => getClient().uniqueConstraint.findMany(args).unwrap() + queryFn: () => getClient().uniqueConstraint.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useViewGrantQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useViewGrantQuery.ts index 80474024e2..6a75ed80c5 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useViewGrantQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useViewGrantQuery.ts @@ -4,20 +4,20 @@ * 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 { viewGrantKeys } from "../query-keys"; -import type { ViewGrantSelect, ViewGrantWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewGrantSelect, ViewGrantWithRelations } from "../../orm/input-types"; +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 { viewGrantKeys } from '../query-keys'; +import type { ViewGrantSelect, ViewGrantWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewGrantSelect, ViewGrantWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const viewGrantQueryKey = viewGrantKeys.detail; /** * Query hook for fetching a single ViewGrant - * + * * @example * ```tsx * const { data, isLoading } = useViewGrantQuery({ @@ -26,38 +26,52 @@ export const viewGrantQueryKey = viewGrantKeys.detail; * }); * ``` */ -export function useViewGrantQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ViewGrantSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useViewGrantQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useViewGrantQuery< + S extends ViewGrantSelect, + TData = { + viewGrant: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ViewGrantSelect>; + } & Omit< + UseQueryOptions< + { + viewGrant: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useViewGrantQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: viewGrantKeys.detail(params.id), - queryFn: () => getClient().viewGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .viewGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ViewGrant without React hooks - * + * * @example * ```ts * const data = await fetchViewGrantQuery({ @@ -79,35 +93,46 @@ export async function fetchViewGrantQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().viewGrant.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .viewGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ViewGrant for SSR or cache warming - * + * * @example * ```ts * await prefetchViewGrantQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchViewGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ViewGrantSelect>; -}): Promise; -export async function prefetchViewGrantQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchViewGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ViewGrantSelect>; + } +): Promise; +export async function prefetchViewGrantQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: viewGrantKeys.detail(params.id), - queryFn: () => getClient().viewGrant.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .viewGrant.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useViewGrantsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useViewGrantsQuery.ts index 4de5127316..6cef5c67d7 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useViewGrantsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useViewGrantsQuery.ts @@ -4,20 +4,35 @@ * 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 { viewGrantKeys } from "../query-keys"; -import type { ViewGrantSelect, ViewGrantWithRelations, ViewGrantFilter, ViewGrantOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewGrantSelect, ViewGrantWithRelations, ViewGrantFilter, ViewGrantOrderBy } from "../../orm/input-types"; +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 { viewGrantKeys } from '../query-keys'; +import type { + ViewGrantSelect, + ViewGrantWithRelations, + ViewGrantFilter, + ViewGrantOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ViewGrantSelect, + ViewGrantWithRelations, + ViewGrantFilter, + ViewGrantOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const viewGrantsQueryKey = viewGrantKeys.list; /** * Query hook for fetching ViewGrant list - * + * * @example * ```tsx * const { data, isLoading } = useViewGrantsQuery({ @@ -30,33 +45,47 @@ export const viewGrantsQueryKey = viewGrantKeys.list; * }); * ``` */ -export function useViewGrantsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewGrantSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useViewGrantsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useViewGrantsQuery< + S extends ViewGrantSelect, + TData = { + viewGrants: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ViewGrantSelect>; + } & Omit< + UseQueryOptions< + { + viewGrants: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useViewGrantsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: viewGrantKeys.list(args), queryFn: () => getClient().viewGrant.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ViewGrant list without React hooks - * + * * @example * ```ts * const data = await fetchViewGrantsQuery({ @@ -70,35 +99,47 @@ export function useViewGrantsQuery(params: { export async function fetchViewGrantsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewGrantSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ViewGrantSelect>; }): Promise<{ viewGrants: ConnectionResult>; }>; export async function fetchViewGrantsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().viewGrant.findMany(args).unwrap(); } /** * Prefetch ViewGrant list for SSR or cache warming - * + * * @example * ```ts * await prefetchViewGrantsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchViewGrantsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewGrantSelect>; -}): Promise; -export async function prefetchViewGrantsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchViewGrantsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ViewGrantSelect>; + } +): Promise; +export async function prefetchViewGrantsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: viewGrantKeys.list(args), - queryFn: () => getClient().viewGrant.findMany(args).unwrap() + queryFn: () => getClient().viewGrant.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useViewQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useViewQuery.ts index f75a1afedf..a8dd8fac2f 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useViewQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useViewQuery.ts @@ -4,20 +4,20 @@ * 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 { viewKeys } from "../query-keys"; -import type { ViewSelect, ViewWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewSelect, ViewWithRelations } from "../../orm/input-types"; +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 { viewKeys } from '../query-keys'; +import type { ViewSelect, ViewWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewSelect, ViewWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const viewQueryKey = viewKeys.detail; /** * Query hook for fetching a single View - * + * * @example * ```tsx * const { data, isLoading } = useViewQuery({ @@ -26,38 +26,52 @@ export const viewQueryKey = viewKeys.detail; * }); * ``` */ -export function useViewQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ViewSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useViewQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useViewQuery< + S extends ViewSelect, + TData = { + view: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ViewSelect>; + } & Omit< + UseQueryOptions< + { + view: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useViewQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: viewKeys.detail(params.id), - queryFn: () => getClient().view.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .view.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single View without React hooks - * + * * @example * ```ts * const data = await fetchViewQuery({ @@ -79,35 +93,46 @@ export async function fetchViewQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().view.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .view.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single View for SSR or cache warming - * + * * @example * ```ts * await prefetchViewQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchViewQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ViewSelect>; -}): Promise; -export async function prefetchViewQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchViewQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ViewSelect>; + } +): Promise; +export async function prefetchViewQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: viewKeys.detail(params.id), - queryFn: () => getClient().view.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .view.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useViewRuleQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useViewRuleQuery.ts index f3e07b5ac9..e9928b2f10 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useViewRuleQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useViewRuleQuery.ts @@ -4,20 +4,20 @@ * 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 { viewRuleKeys } from "../query-keys"; -import type { ViewRuleSelect, ViewRuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewRuleSelect, ViewRuleWithRelations } from "../../orm/input-types"; +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 { viewRuleKeys } from '../query-keys'; +import type { ViewRuleSelect, ViewRuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewRuleSelect, ViewRuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const viewRuleQueryKey = viewRuleKeys.detail; /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```tsx * const { data, isLoading } = useViewRuleQuery({ @@ -26,38 +26,52 @@ export const viewRuleQueryKey = viewRuleKeys.detail; * }); * ``` */ -export function useViewRuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ViewRuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useViewRuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useViewRuleQuery< + S extends ViewRuleSelect, + TData = { + viewRule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ViewRuleSelect>; + } & Omit< + UseQueryOptions< + { + viewRule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useViewRuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: viewRuleKeys.detail(params.id), - queryFn: () => getClient().viewRule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .viewRule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```ts * const data = await fetchViewRuleQuery({ @@ -79,35 +93,46 @@ export async function fetchViewRuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().viewRule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .viewRule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```ts * await prefetchViewRuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchViewRuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ViewRuleSelect>; -}): Promise; -export async function prefetchViewRuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchViewRuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ViewRuleSelect>; + } +): Promise; +export async function prefetchViewRuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: viewRuleKeys.detail(params.id), - queryFn: () => getClient().viewRule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .viewRule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useViewRulesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useViewRulesQuery.ts index ad168000cb..b01883cb5e 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useViewRulesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useViewRulesQuery.ts @@ -4,20 +4,35 @@ * 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 { viewRuleKeys } from "../query-keys"; -import type { ViewRuleSelect, ViewRuleWithRelations, ViewRuleFilter, ViewRuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewRuleSelect, ViewRuleWithRelations, ViewRuleFilter, ViewRuleOrderBy } from "../../orm/input-types"; +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 { viewRuleKeys } from '../query-keys'; +import type { + ViewRuleSelect, + ViewRuleWithRelations, + ViewRuleFilter, + ViewRuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ViewRuleSelect, + ViewRuleWithRelations, + ViewRuleFilter, + ViewRuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const viewRulesQueryKey = viewRuleKeys.list; /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```tsx * const { data, isLoading } = useViewRulesQuery({ @@ -30,33 +45,47 @@ export const viewRulesQueryKey = viewRuleKeys.list; * }); * ``` */ -export function useViewRulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewRuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useViewRulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useViewRulesQuery< + S extends ViewRuleSelect, + TData = { + viewRules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ViewRuleSelect>; + } & Omit< + UseQueryOptions< + { + viewRules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useViewRulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: viewRuleKeys.list(args), queryFn: () => getClient().viewRule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```ts * const data = await fetchViewRulesQuery({ @@ -70,35 +99,47 @@ export function useViewRulesQuery(params: { export async function fetchViewRulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewRuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ViewRuleSelect>; }): Promise<{ viewRules: ConnectionResult>; }>; export async function fetchViewRulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().viewRule.findMany(args).unwrap(); } /** * DO INSTEAD rules for views (e.g., read-only enforcement) - * + * * @example * ```ts * await prefetchViewRulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchViewRulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewRuleSelect>; -}): Promise; -export async function prefetchViewRulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchViewRulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ViewRuleSelect>; + } +): Promise; +export async function prefetchViewRulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: viewRuleKeys.list(args), - queryFn: () => getClient().viewRule.findMany(args).unwrap() + queryFn: () => getClient().viewRule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useViewTableQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useViewTableQuery.ts index ba40d193ed..c6fe2ddd58 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useViewTableQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useViewTableQuery.ts @@ -4,20 +4,20 @@ * 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 { viewTableKeys } from "../query-keys"; -import type { ViewTableSelect, ViewTableWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewTableSelect, ViewTableWithRelations } from "../../orm/input-types"; +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 { viewTableKeys } from '../query-keys'; +import type { ViewTableSelect, ViewTableWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ViewTableSelect, ViewTableWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const viewTableQueryKey = viewTableKeys.detail; /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```tsx * const { data, isLoading } = useViewTableQuery({ @@ -26,38 +26,52 @@ export const viewTableQueryKey = viewTableKeys.detail; * }); * ``` */ -export function useViewTableQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ViewTableSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useViewTableQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useViewTableQuery< + S extends ViewTableSelect, + TData = { + viewTable: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ViewTableSelect>; + } & Omit< + UseQueryOptions< + { + viewTable: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useViewTableQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: viewTableKeys.detail(params.id), - queryFn: () => getClient().viewTable.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .viewTable.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```ts * const data = await fetchViewTableQuery({ @@ -79,35 +93,46 @@ export async function fetchViewTableQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().viewTable.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .viewTable.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```ts * await prefetchViewTableQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchViewTableQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ViewTableSelect>; -}): Promise; -export async function prefetchViewTableQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchViewTableQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ViewTableSelect>; + } +): Promise; +export async function prefetchViewTableQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: viewTableKeys.detail(params.id), - queryFn: () => getClient().viewTable.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .viewTable.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useViewTablesQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useViewTablesQuery.ts index 520e332daf..379ad3c9e1 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useViewTablesQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useViewTablesQuery.ts @@ -4,20 +4,35 @@ * 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 { viewTableKeys } from "../query-keys"; -import type { ViewTableSelect, ViewTableWithRelations, ViewTableFilter, ViewTableOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewTableSelect, ViewTableWithRelations, ViewTableFilter, ViewTableOrderBy } from "../../orm/input-types"; +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 { viewTableKeys } from '../query-keys'; +import type { + ViewTableSelect, + ViewTableWithRelations, + ViewTableFilter, + ViewTableOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ViewTableSelect, + ViewTableWithRelations, + ViewTableFilter, + ViewTableOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const viewTablesQueryKey = viewTableKeys.list; /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```tsx * const { data, isLoading } = useViewTablesQuery({ @@ -30,33 +45,47 @@ export const viewTablesQueryKey = viewTableKeys.list; * }); * ``` */ -export function useViewTablesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewTableSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useViewTablesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useViewTablesQuery< + S extends ViewTableSelect, + TData = { + viewTables: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ViewTableSelect>; + } & Omit< + UseQueryOptions< + { + viewTables: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useViewTablesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: viewTableKeys.list(args), queryFn: () => getClient().viewTable.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```ts * const data = await fetchViewTablesQuery({ @@ -70,35 +99,47 @@ export function useViewTablesQuery(params: { export async function fetchViewTablesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewTableSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ViewTableSelect>; }): Promise<{ viewTables: ConnectionResult>; }>; export async function fetchViewTablesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().viewTable.findMany(args).unwrap(); } /** * Junction table linking views to their joined tables for referential integrity - * + * * @example * ```ts * await prefetchViewTablesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchViewTablesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewTableSelect>; -}): Promise; -export async function prefetchViewTablesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchViewTablesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ViewTableSelect>; + } +): Promise; +export async function prefetchViewTablesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: viewTableKeys.list(args), - queryFn: () => getClient().viewTable.findMany(args).unwrap() + queryFn: () => getClient().viewTable.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useViewsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useViewsQuery.ts index ef83be2c16..4b62bbe5a0 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useViewsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useViewsQuery.ts @@ -4,20 +4,25 @@ * 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 { viewKeys } from "../query-keys"; -import type { ViewSelect, ViewWithRelations, ViewFilter, ViewOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ViewSelect, ViewWithRelations, ViewFilter, ViewOrderBy } from "../../orm/input-types"; +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 { viewKeys } from '../query-keys'; +import type { ViewSelect, ViewWithRelations, ViewFilter, ViewOrderBy } from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { ViewSelect, ViewWithRelations, ViewFilter, ViewOrderBy } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const viewsQueryKey = viewKeys.list; /** * Query hook for fetching View list - * + * * @example * ```tsx * const { data, isLoading } = useViewsQuery({ @@ -30,33 +35,45 @@ export const viewsQueryKey = viewKeys.list; * }); * ``` */ -export function useViewsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useViewsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useViewsQuery< + S extends ViewSelect, + TData = { + views: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ViewSelect>; + } & Omit< + UseQueryOptions< + { + views: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useViewsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: viewKeys.list(args), queryFn: () => getClient().view.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch View list without React hooks - * + * * @example * ```ts * const data = await fetchViewsQuery({ @@ -70,7 +87,8 @@ export function useViewsQuery(params: { export async function fetchViewsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ViewSelect>; }): Promise<{ views: ConnectionResult>; }>; @@ -82,23 +100,30 @@ export async function fetchViewsQuery(params: { } /** * Prefetch View list for SSR or cache warming - * + * * @example * ```ts * await prefetchViewsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchViewsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ViewSelect>; -}): Promise; -export async function prefetchViewsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchViewsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ViewSelect>; + } +): Promise; +export async function prefetchViewsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: viewKeys.list(args), - queryFn: () => getClient().view.findMany(args).unwrap() + queryFn: () => getClient().view.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useWebauthnSettingQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useWebauthnSettingQuery.ts index 85c76bf939..e472ddd067 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useWebauthnSettingQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useWebauthnSettingQuery.ts @@ -4,20 +4,20 @@ * 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 { webauthnSettingKeys } from "../query-keys"; -import type { WebauthnSettingSelect, WebauthnSettingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnSettingSelect, WebauthnSettingWithRelations } from "../../orm/input-types"; +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 { webauthnSettingKeys } from '../query-keys'; +import type { WebauthnSettingSelect, WebauthnSettingWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { WebauthnSettingSelect, WebauthnSettingWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webauthnSettingQueryKey = webauthnSettingKeys.detail; /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```tsx * const { data, isLoading } = useWebauthnSettingQuery({ @@ -26,38 +26,52 @@ export const webauthnSettingQueryKey = webauthnSettingKeys.detail; * }); * ``` */ -export function useWebauthnSettingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebauthnSettingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebauthnSettingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useWebauthnSettingQuery< + S extends WebauthnSettingSelect, + TData = { + webauthnSetting: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebauthnSettingSelect>; + } & Omit< + UseQueryOptions< + { + webauthnSetting: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebauthnSettingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webauthnSettingKeys.detail(params.id), - queryFn: () => getClient().webauthnSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .webauthnSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```ts * const data = await fetchWebauthnSettingQuery({ @@ -79,35 +93,46 @@ export async function fetchWebauthnSettingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().webauthnSetting.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .webauthnSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```ts * await prefetchWebauthnSettingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchWebauthnSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebauthnSettingSelect>; -}): Promise; -export async function prefetchWebauthnSettingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchWebauthnSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebauthnSettingSelect>; + } +): Promise; +export async function prefetchWebauthnSettingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: webauthnSettingKeys.detail(params.id), - queryFn: () => getClient().webauthnSetting.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .webauthnSetting.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/queries/useWebauthnSettingsQuery.ts b/sdk/constructive-react/src/api/hooks/queries/useWebauthnSettingsQuery.ts index 859079ef62..37010cb312 100644 --- a/sdk/constructive-react/src/api/hooks/queries/useWebauthnSettingsQuery.ts +++ b/sdk/constructive-react/src/api/hooks/queries/useWebauthnSettingsQuery.ts @@ -4,20 +4,35 @@ * 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 { webauthnSettingKeys } from "../query-keys"; -import type { WebauthnSettingSelect, WebauthnSettingWithRelations, WebauthnSettingFilter, WebauthnSettingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnSettingSelect, WebauthnSettingWithRelations, WebauthnSettingFilter, WebauthnSettingOrderBy } from "../../orm/input-types"; +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 { webauthnSettingKeys } from '../query-keys'; +import type { + WebauthnSettingSelect, + WebauthnSettingWithRelations, + WebauthnSettingFilter, + WebauthnSettingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + WebauthnSettingSelect, + WebauthnSettingWithRelations, + WebauthnSettingFilter, + WebauthnSettingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webauthnSettingsQueryKey = webauthnSettingKeys.list; /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```tsx * const { data, isLoading } = useWebauthnSettingsQuery({ @@ -30,33 +45,53 @@ export const webauthnSettingsQueryKey = webauthnSettingKeys.list; * }); * ``` */ -export function useWebauthnSettingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnSettingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebauthnSettingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useWebauthnSettingsQuery< + S extends WebauthnSettingSelect, + TData = { + webauthnSettings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, WebauthnSettingSelect>; + } & Omit< + UseQueryOptions< + { + webauthnSettings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebauthnSettingsQuery( + params: { + selection: ListSelectionConfig< + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webauthnSettingKeys.list(args), queryFn: () => getClient().webauthnSetting.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```ts * const data = await fetchWebauthnSettingsQuery({ @@ -70,35 +105,59 @@ export function useWebauthnSettingsQuery(params: { export async function fetchWebauthnSettingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnSettingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, WebauthnSettingSelect>; }): Promise<{ webauthnSettings: ConnectionResult>; }>; export async function fetchWebauthnSettingsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy + >(params.selection); return getClient().webauthnSetting.findMany(args).unwrap(); } /** * WebAuthn/passkey runtime configuration; relying party options and typed references to the credential/session storage - * + * * @example * ```ts * await prefetchWebauthnSettingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchWebauthnSettingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnSettingSelect>; -}): Promise; -export async function prefetchWebauthnSettingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchWebauthnSettingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, WebauthnSettingSelect>; + } +): Promise; +export async function prefetchWebauthnSettingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: webauthnSettingKeys.list(args), - queryFn: () => getClient().webauthnSetting.findMany(args).unwrap() + queryFn: () => getClient().webauthnSetting.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/api/hooks/query-keys.ts b/sdk/constructive-react/src/api/hooks/query-keys.ts index d122807e4b..d0fc662153 100644 --- a/sdk/constructive-react/src/api/hooks/query-keys.ts +++ b/sdk/constructive-react/src/api/hooks/query-keys.ts @@ -20,459 +20,590 @@ // ============================================================================ export const apiKeys = { - /** All api queries */all: ["api"] as const, - /** List query keys */lists: () => [...apiKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...apiKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...apiKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...apiKeys.details(), id] as const + /** All api queries */ all: ['api'] as const, + /** List query keys */ lists: () => [...apiKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...apiKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...apiKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...apiKeys.details(), id] as const, } as const; export const apiModuleKeys = { - /** All apiModule queries */all: ["apimodule"] as const, - /** List query keys */lists: () => [...apiModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...apiModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...apiModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...apiModuleKeys.details(), id] as const + /** All apiModule queries */ all: ['apimodule'] as const, + /** List query keys */ lists: () => [...apiModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...apiModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...apiModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...apiModuleKeys.details(), id] as const, } as const; export const apiSchemaKeys = { - /** All apiSchema queries */all: ["apischema"] as const, - /** List query keys */lists: () => [...apiSchemaKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...apiSchemaKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...apiSchemaKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...apiSchemaKeys.details(), id] as const + /** All apiSchema queries */ all: ['apischema'] as const, + /** List query keys */ lists: () => [...apiSchemaKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...apiSchemaKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...apiSchemaKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...apiSchemaKeys.details(), id] as const, } as const; export const apiSettingKeys = { - /** All apiSetting queries */all: ["apisetting"] as const, - /** List query keys */lists: () => [...apiSettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...apiSettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...apiSettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...apiSettingKeys.details(), id] as const + /** All apiSetting queries */ all: ['apisetting'] as const, + /** List query keys */ lists: () => [...apiSettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...apiSettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...apiSettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...apiSettingKeys.details(), id] as const, } as const; export const astMigrationKeys = { - /** All astMigration queries */all: ["astmigration"] as const, - /** List query keys */lists: () => [...astMigrationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...astMigrationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...astMigrationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...astMigrationKeys.details(), id] as const + /** All astMigration queries */ all: ['astmigration'] as const, + /** List query keys */ lists: () => [...astMigrationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...astMigrationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...astMigrationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...astMigrationKeys.details(), id] as const, } as const; export const checkConstraintKeys = { - /** All checkConstraint queries */all: ["checkconstraint"] as const, - /** List query keys */lists: () => [...checkConstraintKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...checkConstraintKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...checkConstraintKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...checkConstraintKeys.details(), id] as const + /** All checkConstraint queries */ all: ['checkconstraint'] as const, + /** List query keys */ lists: () => [...checkConstraintKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...checkConstraintKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...checkConstraintKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...checkConstraintKeys.details(), id] as const, } as const; export const compositeTypeKeys = { - /** All compositeType queries */all: ["compositetype"] as const, - /** List query keys */lists: () => [...compositeTypeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...compositeTypeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...compositeTypeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...compositeTypeKeys.details(), id] as const + /** All compositeType queries */ all: ['compositetype'] as const, + /** List query keys */ lists: () => [...compositeTypeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...compositeTypeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...compositeTypeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...compositeTypeKeys.details(), id] as const, } as const; export const corsSettingKeys = { - /** All corsSetting queries */all: ["corssetting"] as const, - /** List query keys */lists: () => [...corsSettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...corsSettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...corsSettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...corsSettingKeys.details(), id] as const + /** All corsSetting queries */ all: ['corssetting'] as const, + /** List query keys */ lists: () => [...corsSettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...corsSettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...corsSettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...corsSettingKeys.details(), id] as const, } as const; export const databaseKeys = { - /** All database queries */all: ["database"] as const, - /** List query keys */lists: () => [...databaseKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...databaseKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...databaseKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...databaseKeys.details(), id] as const + /** All database queries */ all: ['database'] as const, + /** List query keys */ lists: () => [...databaseKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...databaseKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...databaseKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...databaseKeys.details(), id] as const, } as const; export const databaseSettingKeys = { - /** All databaseSetting queries */all: ["databasesetting"] as const, - /** List query keys */lists: () => [...databaseSettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...databaseSettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...databaseSettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...databaseSettingKeys.details(), id] as const + /** All databaseSetting queries */ all: ['databasesetting'] as const, + /** List query keys */ lists: () => [...databaseSettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...databaseSettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...databaseSettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...databaseSettingKeys.details(), id] as const, } as const; export const databaseTransferKeys = { - /** All databaseTransfer queries */all: ["databasetransfer"] as const, - /** List query keys */lists: () => [...databaseTransferKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...databaseTransferKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...databaseTransferKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...databaseTransferKeys.details(), id] as const + /** All databaseTransfer queries */ all: ['databasetransfer'] as const, + /** List query keys */ lists: () => [...databaseTransferKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...databaseTransferKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...databaseTransferKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...databaseTransferKeys.details(), id] as const, } as const; export const defaultPrivilegeKeys = { - /** All defaultPrivilege queries */all: ["defaultprivilege"] as const, - /** List query keys */lists: () => [...defaultPrivilegeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...defaultPrivilegeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...defaultPrivilegeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...defaultPrivilegeKeys.details(), id] as const + /** All defaultPrivilege queries */ all: ['defaultprivilege'] as const, + /** List query keys */ lists: () => [...defaultPrivilegeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...defaultPrivilegeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...defaultPrivilegeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...defaultPrivilegeKeys.details(), id] as const, } as const; export const domainKeys = { - /** All domain queries */all: ["domain"] as const, - /** List query keys */lists: () => [...domainKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...domainKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...domainKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...domainKeys.details(), id] as const + /** All domain queries */ all: ['domain'] as const, + /** List query keys */ lists: () => [...domainKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...domainKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...domainKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...domainKeys.details(), id] as const, } as const; export const domainEventKeys = { - /** All domainEvent queries */all: ["domainevent"] as const, - /** List query keys */lists: () => [...domainEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...domainEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...domainEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...domainEventKeys.details(), id] as const + /** All domainEvent queries */ all: ['domainevent'] as const, + /** List query keys */ lists: () => [...domainEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...domainEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...domainEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...domainEventKeys.details(), id] as const, } as const; export const domainVerificationKeys = { - /** All domainVerification queries */all: ["domainverification"] as const, - /** List query keys */lists: () => [...domainVerificationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...domainVerificationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...domainVerificationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...domainVerificationKeys.details(), id] as const + /** All domainVerification queries */ all: ['domainverification'] as const, + /** List query keys */ lists: () => [...domainVerificationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...domainVerificationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...domainVerificationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...domainVerificationKeys.details(), id] as const, } as const; export const embeddingChunkKeys = { - /** All embeddingChunk queries */all: ["embeddingchunk"] as const, - /** List query keys */lists: () => [...embeddingChunkKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...embeddingChunkKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...embeddingChunkKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...embeddingChunkKeys.details(), id] as const + /** All embeddingChunk queries */ all: ['embeddingchunk'] as const, + /** List query keys */ lists: () => [...embeddingChunkKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...embeddingChunkKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...embeddingChunkKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...embeddingChunkKeys.details(), id] as const, } as const; export const enumKeys = { - /** All enum queries */all: ["enum"] as const, - /** List query keys */lists: () => [...enumKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...enumKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...enumKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...enumKeys.details(), id] as const + /** All enum queries */ all: ['enum'] as const, + /** List query keys */ lists: () => [...enumKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...enumKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...enumKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...enumKeys.details(), id] as const, } as const; export const exclusionConstraintKeys = { - /** All exclusionConstraint queries */all: ["exclusionconstraint"] as const, - /** List query keys */lists: () => [...exclusionConstraintKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...exclusionConstraintKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...exclusionConstraintKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...exclusionConstraintKeys.details(), id] as const + /** All exclusionConstraint queries */ all: ['exclusionconstraint'] as const, + /** List query keys */ lists: () => [...exclusionConstraintKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...exclusionConstraintKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...exclusionConstraintKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...exclusionConstraintKeys.details(), id] as const, } as const; export const fieldKeys = { - /** All field queries */all: ["field"] as const, - /** List query keys */lists: () => [...fieldKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...fieldKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...fieldKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...fieldKeys.details(), id] as const + /** All field queries */ all: ['field'] as const, + /** List query keys */ lists: () => [...fieldKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...fieldKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...fieldKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...fieldKeys.details(), id] as const, } as const; export const foreignKeyConstraintKeys = { - /** All foreignKeyConstraint queries */all: ["foreignkeyconstraint"] as const, - /** List query keys */lists: () => [...foreignKeyConstraintKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...foreignKeyConstraintKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...foreignKeyConstraintKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...foreignKeyConstraintKeys.details(), id] as const + /** All foreignKeyConstraint queries */ all: ['foreignkeyconstraint'] as const, + /** List query keys */ lists: () => [...foreignKeyConstraintKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...foreignKeyConstraintKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...foreignKeyConstraintKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...foreignKeyConstraintKeys.details(), id] as const, } as const; export const fullTextSearchKeys = { - /** All fullTextSearch queries */all: ["fulltextsearch"] as const, - /** List query keys */lists: () => [...fullTextSearchKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...fullTextSearchKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...fullTextSearchKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...fullTextSearchKeys.details(), id] as const + /** All fullTextSearch queries */ all: ['fulltextsearch'] as const, + /** List query keys */ lists: () => [...fullTextSearchKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...fullTextSearchKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...fullTextSearchKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...fullTextSearchKeys.details(), id] as const, } as const; export const functionKeys = { - /** All function queries */all: ["function"] as const, - /** List query keys */lists: () => [...functionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionKeys.details(), id] as const + /** All function queries */ all: ['function'] as const, + /** List query keys */ lists: () => [...functionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionKeys.details(), id] as const, } as const; export const hostnameBindingKeys = { - /** All hostnameBinding queries */all: ["hostnamebinding"] as const, - /** List query keys */lists: () => [...hostnameBindingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...hostnameBindingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...hostnameBindingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...hostnameBindingKeys.details(), id] as const + /** All hostnameBinding queries */ all: ['hostnamebinding'] as const, + /** List query keys */ lists: () => [...hostnameBindingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...hostnameBindingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...hostnameBindingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...hostnameBindingKeys.details(), id] as const, } as const; export const httpRouteKeys = { - /** All httpRoute queries */all: ["httproute"] as const, - /** List query keys */lists: () => [...httpRouteKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...httpRouteKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...httpRouteKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...httpRouteKeys.details(), id] as const + /** All httpRoute queries */ all: ['httproute'] as const, + /** List query keys */ lists: () => [...httpRouteKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...httpRouteKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...httpRouteKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...httpRouteKeys.details(), id] as const, } as const; export const indexKeys = { - /** All index queries */all: ["index"] as const, - /** List query keys */lists: () => [...indexKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...indexKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...indexKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...indexKeys.details(), id] as const + /** All index queries */ all: ['index'] as const, + /** List query keys */ lists: () => [...indexKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...indexKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...indexKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...indexKeys.details(), id] as const, } as const; export const managedDomainKeys = { - /** All managedDomain queries */all: ["manageddomain"] as const, - /** List query keys */lists: () => [...managedDomainKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...managedDomainKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...managedDomainKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...managedDomainKeys.details(), id] as const + /** All managedDomain queries */ all: ['manageddomain'] as const, + /** List query keys */ lists: () => [...managedDomainKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...managedDomainKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...managedDomainKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...managedDomainKeys.details(), id] as const, } as const; export const nodeTypeRegistryKeys = { - /** All nodeTypeRegistry queries */all: ["nodetyperegistry"] as const, - /** List query keys */lists: () => [...nodeTypeRegistryKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...nodeTypeRegistryKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...nodeTypeRegistryKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...nodeTypeRegistryKeys.details(), id] as const + /** All nodeTypeRegistry queries */ all: ['nodetyperegistry'] as const, + /** List query keys */ lists: () => [...nodeTypeRegistryKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...nodeTypeRegistryKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...nodeTypeRegistryKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...nodeTypeRegistryKeys.details(), id] as const, } as const; export const partitionKeys = { - /** All partition queries */all: ["partition"] as const, - /** List query keys */lists: () => [...partitionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...partitionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...partitionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...partitionKeys.details(), id] as const + /** All partition queries */ all: ['partition'] as const, + /** List query keys */ lists: () => [...partitionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...partitionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...partitionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...partitionKeys.details(), id] as const, } as const; export const platformApiKeys = { - /** All platformApi queries */all: ["platformapi"] as const, - /** List query keys */lists: () => [...platformApiKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformApiKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformApiKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformApiKeys.details(), id] as const + /** All platformApi queries */ all: ['platformapi'] as const, + /** List query keys */ lists: () => [...platformApiKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformApiKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformApiKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformApiKeys.details(), id] as const, } as const; export const platformApiModuleKeys = { - /** All platformApiModule queries */all: ["platformapimodule"] as const, - /** List query keys */lists: () => [...platformApiModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformApiModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformApiModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformApiModuleKeys.details(), id] as const + /** All platformApiModule queries */ all: ['platformapimodule'] as const, + /** List query keys */ lists: () => [...platformApiModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformApiModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformApiModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformApiModuleKeys.details(), id] as const, } as const; export const platformApiSchemaKeys = { - /** All platformApiSchema queries */all: ["platformapischema"] as const, - /** List query keys */lists: () => [...platformApiSchemaKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformApiSchemaKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformApiSchemaKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformApiSchemaKeys.details(), id] as const + /** All platformApiSchema queries */ all: ['platformapischema'] as const, + /** List query keys */ lists: () => [...platformApiSchemaKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformApiSchemaKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformApiSchemaKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformApiSchemaKeys.details(), id] as const, } as const; export const platformApiSettingKeys = { - /** All platformApiSetting queries */all: ["platformapisetting"] as const, - /** List query keys */lists: () => [...platformApiSettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformApiSettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformApiSettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformApiSettingKeys.details(), id] as const + /** All platformApiSetting queries */ all: ['platformapisetting'] as const, + /** List query keys */ lists: () => [...platformApiSettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformApiSettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformApiSettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformApiSettingKeys.details(), id] as const, } as const; export const platformCorsSettingKeys = { - /** All platformCorsSetting queries */all: ["platformcorssetting"] as const, - /** List query keys */lists: () => [...platformCorsSettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformCorsSettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformCorsSettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformCorsSettingKeys.details(), id] as const + /** All platformCorsSetting queries */ all: ['platformcorssetting'] as const, + /** List query keys */ lists: () => [...platformCorsSettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformCorsSettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformCorsSettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformCorsSettingKeys.details(), id] as const, } as const; export const platformDomainKeys = { - /** All platformDomain queries */all: ["platformdomain"] as const, - /** List query keys */lists: () => [...platformDomainKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformDomainKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformDomainKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformDomainKeys.details(), id] as const + /** All platformDomain queries */ all: ['platformdomain'] as const, + /** List query keys */ lists: () => [...platformDomainKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformDomainKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformDomainKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformDomainKeys.details(), id] as const, } as const; export const platformDomainEventKeys = { - /** All platformDomainEvent queries */all: ["platformdomainevent"] as const, - /** List query keys */lists: () => [...platformDomainEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformDomainEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformDomainEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformDomainEventKeys.details(), id] as const + /** All platformDomainEvent queries */ all: ['platformdomainevent'] as const, + /** List query keys */ lists: () => [...platformDomainEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformDomainEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformDomainEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformDomainEventKeys.details(), id] as const, } as const; export const platformDomainVerificationKeys = { - /** All platformDomainVerification queries */all: ["platformdomainverification"] as const, - /** List query keys */lists: () => [...platformDomainVerificationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformDomainVerificationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformDomainVerificationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformDomainVerificationKeys.details(), id] as const + /** All platformDomainVerification queries */ all: ['platformdomainverification'] as const, + /** List query keys */ lists: () => [...platformDomainVerificationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformDomainVerificationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformDomainVerificationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformDomainVerificationKeys.details(), id] as const, } as const; export const platformManagedDomainKeys = { - /** All platformManagedDomain queries */all: ["platformmanageddomain"] as const, - /** List query keys */lists: () => [...platformManagedDomainKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformManagedDomainKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformManagedDomainKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformManagedDomainKeys.details(), id] as const + /** All platformManagedDomain queries */ all: ['platformmanageddomain'] as const, + /** List query keys */ lists: () => [...platformManagedDomainKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformManagedDomainKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformManagedDomainKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformManagedDomainKeys.details(), id] as const, } as const; export const platformSiteKeys = { - /** All platformSite queries */all: ["platformsite"] as const, - /** List query keys */lists: () => [...platformSiteKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformSiteKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformSiteKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformSiteKeys.details(), id] as const + /** All platformSite queries */ all: ['platformsite'] as const, + /** List query keys */ lists: () => [...platformSiteKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformSiteKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformSiteKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformSiteKeys.details(), id] as const, } as const; export const platformSiteMetadatumKeys = { - /** All platformSiteMetadatum queries */all: ["platformsitemetadatum"] as const, - /** List query keys */lists: () => [...platformSiteMetadatumKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformSiteMetadatumKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformSiteMetadatumKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformSiteMetadatumKeys.details(), id] as const + /** All platformSiteMetadatum queries */ all: ['platformsitemetadatum'] as const, + /** List query keys */ lists: () => [...platformSiteMetadatumKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformSiteMetadatumKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformSiteMetadatumKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformSiteMetadatumKeys.details(), id] as const, } as const; export const platformSiteModuleKeys = { - /** All platformSiteModule queries */all: ["platformsitemodule"] as const, - /** List query keys */lists: () => [...platformSiteModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformSiteModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformSiteModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformSiteModuleKeys.details(), id] as const + /** All platformSiteModule queries */ all: ['platformsitemodule'] as const, + /** List query keys */ lists: () => [...platformSiteModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformSiteModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformSiteModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformSiteModuleKeys.details(), id] as const, } as const; export const platformSiteThemeKeys = { - /** All platformSiteTheme queries */all: ["platformsitetheme"] as const, - /** List query keys */lists: () => [...platformSiteThemeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformSiteThemeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformSiteThemeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformSiteThemeKeys.details(), id] as const + /** All platformSiteTheme queries */ all: ['platformsitetheme'] as const, + /** List query keys */ lists: () => [...platformSiteThemeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformSiteThemeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformSiteThemeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformSiteThemeKeys.details(), id] as const, } as const; export const policyKeys = { - /** All policy queries */all: ["policy"] as const, - /** List query keys */lists: () => [...policyKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...policyKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...policyKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...policyKeys.details(), id] as const + /** All policy queries */ all: ['policy'] as const, + /** List query keys */ lists: () => [...policyKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...policyKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...policyKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...policyKeys.details(), id] as const, } as const; export const primaryKeyConstraintKeys = { - /** All primaryKeyConstraint queries */all: ["primarykeyconstraint"] as const, - /** List query keys */lists: () => [...primaryKeyConstraintKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...primaryKeyConstraintKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...primaryKeyConstraintKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...primaryKeyConstraintKeys.details(), id] as const + /** All primaryKeyConstraint queries */ all: ['primarykeyconstraint'] as const, + /** List query keys */ lists: () => [...primaryKeyConstraintKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...primaryKeyConstraintKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...primaryKeyConstraintKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...primaryKeyConstraintKeys.details(), id] as const, } as const; export const pubkeySettingKeys = { - /** All pubkeySetting queries */all: ["pubkeysetting"] as const, - /** List query keys */lists: () => [...pubkeySettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...pubkeySettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...pubkeySettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...pubkeySettingKeys.details(), id] as const + /** All pubkeySetting queries */ all: ['pubkeysetting'] as const, + /** List query keys */ lists: () => [...pubkeySettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...pubkeySettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...pubkeySettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...pubkeySettingKeys.details(), id] as const, } as const; export const rlsSettingKeys = { - /** All rlsSetting queries */all: ["rlssetting"] as const, - /** List query keys */lists: () => [...rlsSettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...rlsSettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...rlsSettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...rlsSettingKeys.details(), id] as const + /** All rlsSetting queries */ all: ['rlssetting'] as const, + /** List query keys */ lists: () => [...rlsSettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...rlsSettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...rlsSettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...rlsSettingKeys.details(), id] as const, } as const; export const routeBindingKeys = { - /** All routeBinding queries */all: ["routebinding"] as const, - /** List query keys */lists: () => [...routeBindingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...routeBindingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...routeBindingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...routeBindingKeys.details(), id] as const + /** All routeBinding queries */ all: ['routebinding'] as const, + /** List query keys */ lists: () => [...routeBindingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...routeBindingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...routeBindingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...routeBindingKeys.details(), id] as const, } as const; export const routeKeys = { - /** All route queries */all: ["route"] as const, - /** List query keys */lists: () => [...routeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...routeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...routeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...routeKeys.details(), id] as const + /** All route queries */ all: ['route'] as const, + /** List query keys */ lists: () => [...routeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...routeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...routeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...routeKeys.details(), id] as const, } as const; export const schemaKeys = { - /** All schema queries */all: ["schema"] as const, - /** List query keys */lists: () => [...schemaKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...schemaKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...schemaKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...schemaKeys.details(), id] as const + /** All schema queries */ all: ['schema'] as const, + /** List query keys */ lists: () => [...schemaKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...schemaKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...schemaKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...schemaKeys.details(), id] as const, } as const; export const schemaGrantKeys = { - /** All schemaGrant queries */all: ["schemagrant"] as const, - /** List query keys */lists: () => [...schemaGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...schemaGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...schemaGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...schemaGrantKeys.details(), id] as const + /** All schemaGrant queries */ all: ['schemagrant'] as const, + /** List query keys */ lists: () => [...schemaGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...schemaGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...schemaGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...schemaGrantKeys.details(), id] as const, } as const; export const siteKeys = { - /** All site queries */all: ["site"] as const, - /** List query keys */lists: () => [...siteKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...siteKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...siteKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...siteKeys.details(), id] as const + /** All site queries */ all: ['site'] as const, + /** List query keys */ lists: () => [...siteKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...siteKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...siteKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...siteKeys.details(), id] as const, } as const; export const siteMetadatumKeys = { - /** All siteMetadatum queries */all: ["sitemetadatum"] as const, - /** List query keys */lists: () => [...siteMetadatumKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...siteMetadatumKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...siteMetadatumKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...siteMetadatumKeys.details(), id] as const + /** All siteMetadatum queries */ all: ['sitemetadatum'] as const, + /** List query keys */ lists: () => [...siteMetadatumKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...siteMetadatumKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...siteMetadatumKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...siteMetadatumKeys.details(), id] as const, } as const; export const siteModuleKeys = { - /** All siteModule queries */all: ["sitemodule"] as const, - /** List query keys */lists: () => [...siteModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...siteModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...siteModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...siteModuleKeys.details(), id] as const + /** All siteModule queries */ all: ['sitemodule'] as const, + /** List query keys */ lists: () => [...siteModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...siteModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...siteModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...siteModuleKeys.details(), id] as const, } as const; export const siteThemeKeys = { - /** All siteTheme queries */all: ["sitetheme"] as const, - /** List query keys */lists: () => [...siteThemeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...siteThemeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...siteThemeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...siteThemeKeys.details(), id] as const + /** All siteTheme queries */ all: ['sitetheme'] as const, + /** List query keys */ lists: () => [...siteThemeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...siteThemeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...siteThemeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...siteThemeKeys.details(), id] as const, } as const; export const spatialRelationKeys = { - /** All spatialRelation queries */all: ["spatialrelation"] as const, - /** List query keys */lists: () => [...spatialRelationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...spatialRelationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...spatialRelationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...spatialRelationKeys.details(), id] as const + /** All spatialRelation queries */ all: ['spatialrelation'] as const, + /** List query keys */ lists: () => [...spatialRelationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...spatialRelationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...spatialRelationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...spatialRelationKeys.details(), id] as const, } as const; export const sqlActionKeys = { - /** All sqlAction queries */all: ["sqlaction"] as const, - /** List query keys */lists: () => [...sqlActionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...sqlActionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...sqlActionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...sqlActionKeys.details(), id] as const + /** All sqlAction queries */ all: ['sqlaction'] as const, + /** List query keys */ lists: () => [...sqlActionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...sqlActionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...sqlActionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...sqlActionKeys.details(), id] as const, } as const; export const tableKeys = { - /** All table queries */all: ["table"] as const, - /** List query keys */lists: () => [...tableKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...tableKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...tableKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...tableKeys.details(), id] as const + /** All table queries */ all: ['table'] as const, + /** List query keys */ lists: () => [...tableKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...tableKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...tableKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...tableKeys.details(), id] as const, } as const; export const tableGrantKeys = { - /** All tableGrant queries */all: ["tablegrant"] as const, - /** List query keys */lists: () => [...tableGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...tableGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...tableGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...tableGrantKeys.details(), id] as const + /** All tableGrant queries */ all: ['tablegrant'] as const, + /** List query keys */ lists: () => [...tableGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...tableGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...tableGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...tableGrantKeys.details(), id] as const, } as const; export const triggerKeys = { - /** All trigger queries */all: ["trigger"] as const, - /** List query keys */lists: () => [...triggerKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...triggerKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...triggerKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...triggerKeys.details(), id] as const + /** All trigger queries */ all: ['trigger'] as const, + /** List query keys */ lists: () => [...triggerKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...triggerKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...triggerKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...triggerKeys.details(), id] as const, } as const; export const triggerFunctionKeys = { - /** All triggerFunction queries */all: ["triggerfunction"] as const, - /** List query keys */lists: () => [...triggerFunctionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...triggerFunctionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...triggerFunctionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...triggerFunctionKeys.details(), id] as const + /** All triggerFunction queries */ all: ['triggerfunction'] as const, + /** List query keys */ lists: () => [...triggerFunctionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...triggerFunctionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...triggerFunctionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...triggerFunctionKeys.details(), id] as const, } as const; export const uniqueConstraintKeys = { - /** All uniqueConstraint queries */all: ["uniqueconstraint"] as const, - /** List query keys */lists: () => [...uniqueConstraintKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...uniqueConstraintKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...uniqueConstraintKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...uniqueConstraintKeys.details(), id] as const + /** All uniqueConstraint queries */ all: ['uniqueconstraint'] as const, + /** List query keys */ lists: () => [...uniqueConstraintKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...uniqueConstraintKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...uniqueConstraintKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...uniqueConstraintKeys.details(), id] as const, } as const; export const viewKeys = { - /** All view queries */all: ["view"] as const, - /** List query keys */lists: () => [...viewKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...viewKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...viewKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...viewKeys.details(), id] as const + /** All view queries */ all: ['view'] as const, + /** List query keys */ lists: () => [...viewKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...viewKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...viewKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...viewKeys.details(), id] as const, } as const; export const viewGrantKeys = { - /** All viewGrant queries */all: ["viewgrant"] as const, - /** List query keys */lists: () => [...viewGrantKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...viewGrantKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...viewGrantKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...viewGrantKeys.details(), id] as const + /** All viewGrant queries */ all: ['viewgrant'] as const, + /** List query keys */ lists: () => [...viewGrantKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...viewGrantKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...viewGrantKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...viewGrantKeys.details(), id] as const, } as const; export const viewRuleKeys = { - /** All viewRule queries */all: ["viewrule"] as const, - /** List query keys */lists: () => [...viewRuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...viewRuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...viewRuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...viewRuleKeys.details(), id] as const + /** All viewRule queries */ all: ['viewrule'] as const, + /** List query keys */ lists: () => [...viewRuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...viewRuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...viewRuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...viewRuleKeys.details(), id] as const, } as const; export const viewTableKeys = { - /** All viewTable queries */all: ["viewtable"] as const, - /** List query keys */lists: () => [...viewTableKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...viewTableKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...viewTableKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...viewTableKeys.details(), id] as const + /** All viewTable queries */ all: ['viewtable'] as const, + /** List query keys */ lists: () => [...viewTableKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...viewTableKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...viewTableKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...viewTableKeys.details(), id] as const, } as const; export const webauthnSettingKeys = { - /** All webauthnSetting queries */all: ["webauthnsetting"] as const, - /** List query keys */lists: () => [...webauthnSettingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...webauthnSettingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...webauthnSettingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...webauthnSettingKeys.details(), id] as const + /** All webauthnSetting queries */ all: ['webauthnsetting'] as const, + /** List query keys */ lists: () => [...webauthnSettingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...webauthnSettingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...webauthnSettingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...webauthnSettingKeys.details(), id] as const, } as const; // ============================================================================ @@ -480,10 +611,14 @@ export const webauthnSettingKeys = { // ============================================================================ export const customQueryKeys = { - /** Query key for apiSchemaNames */apiSchemaNames: (variables?: object) => ["apiSchemaNames", variables] as const, - /** Query key for applyRegistryDefaults */applyRegistryDefaults: (variables?: object) => ["applyRegistryDefaults", variables] as const, - /** Query key for resolveHttpRoute */resolveHttpRoute: (variables?: object) => ["resolveHttpRoute", variables] as const, - /** Query key for resolveRoute */resolveRoute: (variables?: object) => ["resolveRoute", variables] as const + /** Query key for apiSchemaNames */ apiSchemaNames: (variables?: object) => + ['apiSchemaNames', variables] as const, + /** Query key for applyRegistryDefaults */ applyRegistryDefaults: (variables?: object) => + ['applyRegistryDefaults', variables] as const, + /** Query key for resolveHttpRoute */ resolveHttpRoute: (variables?: object) => + ['resolveHttpRoute', variables] as const, + /** Query key for resolveRoute */ resolveRoute: (variables?: object) => + ['resolveRoute', variables] as const, } as const; /** @@ -573,7 +708,7 @@ export const queryKeys = { viewRule: viewRuleKeys, viewTable: viewTableKeys, webauthnSetting: webauthnSettingKeys, - custom: customQueryKeys + custom: customQueryKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/api/hooks/selection.ts b/sdk/constructive-react/src/api/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/api/hooks/selection.ts +++ b/sdk/constructive-react/src/api/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/api/index.ts b/sdk/constructive-react/src/api/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/api/index.ts +++ b/sdk/constructive-react/src/api/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/api/orm/client.ts b/sdk/constructive-react/src/api/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/api/orm/client.ts +++ b/sdk/constructive-react/src/api/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/api/orm/index.ts b/sdk/constructive-react/src/api/orm/index.ts index f2e5d03590..daef0c9123 100644 --- a/sdk/constructive-react/src/api/orm/index.ts +++ b/sdk/constructive-react/src/api/orm/index.ts @@ -3,82 +3,82 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { ApiModel } from "./models/api"; -import { ApiModuleModel } from "./models/apiModule"; -import { ApiSchemaModel } from "./models/apiSchema"; -import { ApiSettingModel } from "./models/apiSetting"; -import { AstMigrationModel } from "./models/astMigration"; -import { CheckConstraintModel } from "./models/checkConstraint"; -import { CompositeTypeModel } from "./models/compositeType"; -import { CorsSettingModel } from "./models/corsSetting"; -import { DatabaseModel } from "./models/database"; -import { DatabaseSettingModel } from "./models/databaseSetting"; -import { DatabaseTransferModel } from "./models/databaseTransfer"; -import { DefaultPrivilegeModel } from "./models/defaultPrivilege"; -import { DomainModel } from "./models/domain"; -import { DomainEventModel } from "./models/domainEvent"; -import { DomainVerificationModel } from "./models/domainVerification"; -import { EmbeddingChunkModel } from "./models/embeddingChunk"; -import { EnumModel } from "./models/enum"; -import { ExclusionConstraintModel } from "./models/exclusionConstraint"; -import { FieldModel } from "./models/field"; -import { ForeignKeyConstraintModel } from "./models/foreignKeyConstraint"; -import { FullTextSearchModel } from "./models/fullTextSearch"; -import { FunctionModel } from "./models/function"; -import { HostnameBindingModel } from "./models/hostnameBinding"; -import { HttpRouteModel } from "./models/httpRoute"; -import { IndexModel } from "./models/index"; -import { ManagedDomainModel } from "./models/managedDomain"; -import { NodeTypeRegistryModel } from "./models/nodeTypeRegistry"; -import { PartitionModel } from "./models/partition"; -import { PlatformApiModel } from "./models/platformApi"; -import { PlatformApiModuleModel } from "./models/platformApiModule"; -import { PlatformApiSchemaModel } from "./models/platformApiSchema"; -import { PlatformApiSettingModel } from "./models/platformApiSetting"; -import { PlatformCorsSettingModel } from "./models/platformCorsSetting"; -import { PlatformDomainModel } from "./models/platformDomain"; -import { PlatformDomainEventModel } from "./models/platformDomainEvent"; -import { PlatformDomainVerificationModel } from "./models/platformDomainVerification"; -import { PlatformManagedDomainModel } from "./models/platformManagedDomain"; -import { PlatformSiteModel } from "./models/platformSite"; -import { PlatformSiteMetadatumModel } from "./models/platformSiteMetadatum"; -import { PlatformSiteModuleModel } from "./models/platformSiteModule"; -import { PlatformSiteThemeModel } from "./models/platformSiteTheme"; -import { PolicyModel } from "./models/policy"; -import { PrimaryKeyConstraintModel } from "./models/primaryKeyConstraint"; -import { PubkeySettingModel } from "./models/pubkeySetting"; -import { RlsSettingModel } from "./models/rlsSetting"; -import { RouteBindingModel } from "./models/routeBinding"; -import { RouteModel } from "./models/route"; -import { SchemaModel } from "./models/schema"; -import { SchemaGrantModel } from "./models/schemaGrant"; -import { SiteModel } from "./models/site"; -import { SiteMetadatumModel } from "./models/siteMetadatum"; -import { SiteModuleModel } from "./models/siteModule"; -import { SiteThemeModel } from "./models/siteTheme"; -import { SpatialRelationModel } from "./models/spatialRelation"; -import { SqlActionModel } from "./models/sqlAction"; -import { TableModel } from "./models/table"; -import { TableGrantModel } from "./models/tableGrant"; -import { TriggerModel } from "./models/trigger"; -import { TriggerFunctionModel } from "./models/triggerFunction"; -import { UniqueConstraintModel } from "./models/uniqueConstraint"; -import { ViewModel } from "./models/view"; -import { ViewGrantModel } from "./models/viewGrant"; -import { ViewRuleModel } from "./models/viewRule"; -import { ViewTableModel } from "./models/viewTable"; -import { WebauthnSettingModel } from "./models/webauthnSetting"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { ApiModel } from './models/api'; +import { ApiModuleModel } from './models/apiModule'; +import { ApiSchemaModel } from './models/apiSchema'; +import { ApiSettingModel } from './models/apiSetting'; +import { AstMigrationModel } from './models/astMigration'; +import { CheckConstraintModel } from './models/checkConstraint'; +import { CompositeTypeModel } from './models/compositeType'; +import { CorsSettingModel } from './models/corsSetting'; +import { DatabaseModel } from './models/database'; +import { DatabaseSettingModel } from './models/databaseSetting'; +import { DatabaseTransferModel } from './models/databaseTransfer'; +import { DefaultPrivilegeModel } from './models/defaultPrivilege'; +import { DomainModel } from './models/domain'; +import { DomainEventModel } from './models/domainEvent'; +import { DomainVerificationModel } from './models/domainVerification'; +import { EmbeddingChunkModel } from './models/embeddingChunk'; +import { EnumModel } from './models/enum'; +import { ExclusionConstraintModel } from './models/exclusionConstraint'; +import { FieldModel } from './models/field'; +import { ForeignKeyConstraintModel } from './models/foreignKeyConstraint'; +import { FullTextSearchModel } from './models/fullTextSearch'; +import { FunctionModel } from './models/function'; +import { HostnameBindingModel } from './models/hostnameBinding'; +import { HttpRouteModel } from './models/httpRoute'; +import { IndexModel } from './models/index'; +import { ManagedDomainModel } from './models/managedDomain'; +import { NodeTypeRegistryModel } from './models/nodeTypeRegistry'; +import { PartitionModel } from './models/partition'; +import { PlatformApiModel } from './models/platformApi'; +import { PlatformApiModuleModel } from './models/platformApiModule'; +import { PlatformApiSchemaModel } from './models/platformApiSchema'; +import { PlatformApiSettingModel } from './models/platformApiSetting'; +import { PlatformCorsSettingModel } from './models/platformCorsSetting'; +import { PlatformDomainModel } from './models/platformDomain'; +import { PlatformDomainEventModel } from './models/platformDomainEvent'; +import { PlatformDomainVerificationModel } from './models/platformDomainVerification'; +import { PlatformManagedDomainModel } from './models/platformManagedDomain'; +import { PlatformSiteModel } from './models/platformSite'; +import { PlatformSiteMetadatumModel } from './models/platformSiteMetadatum'; +import { PlatformSiteModuleModel } from './models/platformSiteModule'; +import { PlatformSiteThemeModel } from './models/platformSiteTheme'; +import { PolicyModel } from './models/policy'; +import { PrimaryKeyConstraintModel } from './models/primaryKeyConstraint'; +import { PubkeySettingModel } from './models/pubkeySetting'; +import { RlsSettingModel } from './models/rlsSetting'; +import { RouteBindingModel } from './models/routeBinding'; +import { RouteModel } from './models/route'; +import { SchemaModel } from './models/schema'; +import { SchemaGrantModel } from './models/schemaGrant'; +import { SiteModel } from './models/site'; +import { SiteMetadatumModel } from './models/siteMetadatum'; +import { SiteModuleModel } from './models/siteModule'; +import { SiteThemeModel } from './models/siteTheme'; +import { SpatialRelationModel } from './models/spatialRelation'; +import { SqlActionModel } from './models/sqlAction'; +import { TableModel } from './models/table'; +import { TableGrantModel } from './models/tableGrant'; +import { TriggerModel } from './models/trigger'; +import { TriggerFunctionModel } from './models/triggerFunction'; +import { UniqueConstraintModel } from './models/uniqueConstraint'; +import { ViewModel } from './models/view'; +import { ViewGrantModel } from './models/viewGrant'; +import { ViewRuleModel } from './models/viewRule'; +import { ViewTableModel } from './models/viewTable'; +import { WebauthnSettingModel } from './models/webauthnSetting'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -171,6 +171,6 @@ export function createClient(config: OrmClientConfig) { viewTable: new ViewTableModel(client), webauthnSetting: new WebauthnSettingModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/input-types.ts b/sdk/constructive-react/src/api/orm/input-types.ts index 5e778de550..4396202b0a 100644 --- a/sdk/constructive-react/src/api/orm/input-types.ts +++ b/sdk/constructive-react/src/api/orm/input-types.ts @@ -231,8 +231,8 @@ export interface UUIDListFilter { anyGreaterThanOrEqualTo?: string; } // ============ Enum Types ============ -export type ApiExposureLevel = "EXPOSABLE" | "INTERNAL_ONLY" | "NEVER_EXPOSE"; -export type ObjectCategory = "APP" | "AUTH" | "CORE" | "MEMBERSHIPS" | "MODULE" | "PERMISSIONS"; +export type ApiExposureLevel = 'EXPOSABLE' | 'INTERNAL_ONLY' | 'NEVER_EXPOSE'; +export type ObjectCategory = 'APP' | 'AUTH' | 'CORE' | 'MEMBERSHIPS' | 'MODULE' | 'PERMISSIONS'; // ============ Custom Scalar Types ============ export type ConstructiveInternalTypeImage = unknown; /** API surfaces exposed by this scope; publication makes a surface bindable from other scopes */ @@ -1757,7 +1757,8 @@ export type EmbeddingChunkWithRelations = EmbeddingChunk & EmbeddingChunkRelatio export type EnumWithRelations = Enum & EnumRelations; export type ExclusionConstraintWithRelations = ExclusionConstraint & ExclusionConstraintRelations; export type FieldWithRelations = Field & FieldRelations; -export type ForeignKeyConstraintWithRelations = ForeignKeyConstraint & ForeignKeyConstraintRelations; +export type ForeignKeyConstraintWithRelations = ForeignKeyConstraint & + ForeignKeyConstraintRelations; export type FullTextSearchWithRelations = FullTextSearch & FullTextSearchRelations; export type FunctionWithRelations = Function & FunctionRelations; export type HostnameBindingWithRelations = HostnameBinding & HostnameBindingRelations; @@ -1773,14 +1774,18 @@ export type PlatformApiSettingWithRelations = PlatformApiSetting & PlatformApiSe export type PlatformCorsSettingWithRelations = PlatformCorsSetting & PlatformCorsSettingRelations; export type PlatformDomainWithRelations = PlatformDomain & PlatformDomainRelations; export type PlatformDomainEventWithRelations = PlatformDomainEvent & PlatformDomainEventRelations; -export type PlatformDomainVerificationWithRelations = PlatformDomainVerification & PlatformDomainVerificationRelations; -export type PlatformManagedDomainWithRelations = PlatformManagedDomain & PlatformManagedDomainRelations; +export type PlatformDomainVerificationWithRelations = PlatformDomainVerification & + PlatformDomainVerificationRelations; +export type PlatformManagedDomainWithRelations = PlatformManagedDomain & + PlatformManagedDomainRelations; export type PlatformSiteWithRelations = PlatformSite & PlatformSiteRelations; -export type PlatformSiteMetadatumWithRelations = PlatformSiteMetadatum & PlatformSiteMetadatumRelations; +export type PlatformSiteMetadatumWithRelations = PlatformSiteMetadatum & + PlatformSiteMetadatumRelations; export type PlatformSiteModuleWithRelations = PlatformSiteModule & PlatformSiteModuleRelations; export type PlatformSiteThemeWithRelations = PlatformSiteTheme & PlatformSiteThemeRelations; export type PolicyWithRelations = Policy & PolicyRelations; -export type PrimaryKeyConstraintWithRelations = PrimaryKeyConstraint & PrimaryKeyConstraintRelations; +export type PrimaryKeyConstraintWithRelations = PrimaryKeyConstraint & + PrimaryKeyConstraintRelations; export type PubkeySettingWithRelations = PubkeySetting & PubkeySettingRelations; export type RlsSettingWithRelations = RlsSetting & RlsSettingRelations; export type RouteBindingWithRelations = RouteBinding & RouteBindingRelations; @@ -6122,71 +6127,1742 @@ export interface WebauthnSettingFilter { userFieldId?: UUIDFilter; } // ============ OrderBy Types ============ -export type ApiOrderBy = "ANON_ROLE_ASC" | "ANON_ROLE_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DBNAME_ASC" | "DBNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_NAME_ASC" | "ROLE_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiModuleOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiSchemaOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiSettingOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AstMigrationOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYS_ASC" | "DEPLOYS_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REQUIRES_ASC" | "REQUIRES_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; -export type CheckConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EXPR_ASC" | "EXPR_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type CompositeTypeOrderBy = "ATTRIBUTES_ASC" | "ATTRIBUTES_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC"; -export type CorsSettingOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PLATFORM_ASC" | "PLATFORM_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_HASH_ASC" | "SCHEMA_HASH_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseSettingOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseTransferOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INITIATED_BY_ASC" | "INITIATED_BY_DESC" | "NATURAL" | "NOTES_ASC" | "NOTES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_APPROVED_ASC" | "SOURCE_APPROVED_AT_ASC" | "SOURCE_APPROVED_AT_DESC" | "SOURCE_APPROVED_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TARGET_APPROVED_ASC" | "TARGET_APPROVED_AT_ASC" | "TARGET_APPROVED_AT_DESC" | "TARGET_APPROVED_DESC" | "TARGET_OWNER_ID_ASC" | "TARGET_OWNER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DefaultPrivilegeOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "OBJECT_TYPE_ASC" | "OBJECT_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type DomainOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type DomainEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "DOMAIN_VERIFICATION_ID_ASC" | "DOMAIN_VERIFICATION_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DomainVerificationOrderBy = "ATTEMPTS_ASC" | "ATTEMPTS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LAST_CHECKED_AT_ASC" | "LAST_CHECKED_AT_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECORD_NAME_ASC" | "RECORD_NAME_DESC" | "RECORD_TYPE_ASC" | "RECORD_TYPE_DESC" | "RECORD_VALUE_ASC" | "RECORD_VALUE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type EmbeddingChunkOrderBy = "CHUNKING_TASK_NAME_ASC" | "CHUNKING_TASK_NAME_DESC" | "CHUNKS_TABLE_ID_ASC" | "CHUNKS_TABLE_ID_DESC" | "CHUNKS_TABLE_NAME_ASC" | "CHUNKS_TABLE_NAME_DESC" | "CHUNK_OVERLAP_ASC" | "CHUNK_OVERLAP_DESC" | "CHUNK_SIZE_ASC" | "CHUNK_SIZE_DESC" | "CHUNK_STRATEGY_ASC" | "CHUNK_STRATEGY_DESC" | "CONTENT_FIELD_NAME_ASC" | "CONTENT_FIELD_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DIMENSIONS_ASC" | "DIMENSIONS_DESC" | "EMBEDDING_FIELD_ID_ASC" | "EMBEDDING_FIELD_ID_DESC" | "EMBEDDING_MODEL_ASC" | "EMBEDDING_MODEL_DESC" | "EMBEDDING_PROVIDER_ASC" | "EMBEDDING_PROVIDER_DESC" | "ENQUEUE_CHUNKING_JOB_ASC" | "ENQUEUE_CHUNKING_JOB_DESC" | "ID_ASC" | "ID_DESC" | "METADATA_FIELDS_ASC" | "METADATA_FIELDS_DESC" | "METRIC_ASC" | "METRIC_DESC" | "NATURAL" | "PARENT_FK_FIELD_ID_ASC" | "PARENT_FK_FIELD_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_INDEXES_ASC" | "SEARCH_INDEXES_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type EnumOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC" | "VALUES_ASC" | "VALUES_DESC"; -export type ExclusionConstraintOrderBy = "ACCESS_METHOD_ASC" | "ACCESS_METHOD_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ELEMENT_EXPR_ASC" | "ELEMENT_EXPR_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPERATORS_ASC" | "OPERATORS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WHERE_CLAUSE_ASC" | "WHERE_CLAUSE_DESC"; -export type FieldOrderBy = "API_REQUIRED_ASC" | "API_REQUIRED_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CHK_ASC" | "CHK_DESC" | "CHK_EXPR_ASC" | "CHK_EXPR_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_VALUE_ASC" | "DEFAULT_VALUE_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_ORDER_ASC" | "FIELD_ORDER_DESC" | "GENERATION_EXPRESSION_ASC" | "GENERATION_EXPRESSION_DESC" | "GENERATION_TYPE_ASC" | "GENERATION_TYPE_DESC" | "IDENTITY_GENERATION_ASC" | "IDENTITY_GENERATION_DESC" | "IDENTITY_OPTIONS_ASC" | "IDENTITY_OPTIONS_DESC" | "ID_ASC" | "ID_DESC" | "IS_REQUIRED_ASC" | "IS_REQUIRED_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MAX_ASC" | "MAX_DESC" | "MIN_ASC" | "MIN_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REGEXP_ASC" | "REGEXP_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ForeignKeyConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACTION_ASC" | "DELETE_ACTION_DESC" | "DELETE_SET_FIELD_IDS_ASC" | "DELETE_SET_FIELD_IDS_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_IDS_ASC" | "REF_FIELD_IDS_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATE_ACTION_ASC" | "UPDATE_ACTION_DESC" | "WITH_PERIOD_ASC" | "WITH_PERIOD_DESC"; -export type FullTextSearchOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "ID_ASC" | "ID_DESC" | "LANGS_ASC" | "LANGS_DESC" | "LANG_COLUMN_ASC" | "LANG_COLUMN_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WEIGHTS_ASC" | "WEIGHTS_DESC"; -export type FunctionOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type HostnameBindingOrderBy = "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC"; -export type HttpRouteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_ID_ASC" | "TARGET_ID_DESC" | "TARGET_KIND_ASC" | "TARGET_KIND_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type IndexOrderBy = "ACCESS_METHOD_ASC" | "ACCESS_METHOD_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INCLUDE_FIELD_IDS_ASC" | "INCLUDE_FIELD_IDS_DESC" | "INDEX_PARAMS_ASC" | "INDEX_PARAMS_DESC" | "IS_UNIQUE_ASC" | "IS_UNIQUE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "OP_CLASSES_ASC" | "OP_CLASSES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WHERE_CLAUSE_ASC" | "WHERE_CLAUSE_DESC"; -export type ManagedDomainOrderBy = "ALLOW_PUBLIC_USAGE_ASC" | "ALLOW_PUBLIC_USAGE_DESC" | "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CERT_STATUS_ASC" | "CERT_STATUS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type NodeTypeRegistryOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMETER_SCHEMA_ASC" | "PARAMETER_SCHEMA_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "TAGS_ASC" | "TAGS_DESC"; -export type PartitionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "IS_PARENTED_ASC" | "IS_PARENTED_DESC" | "NAMING_PATTERN_ASC" | "NAMING_PATTERN_DESC" | "NATURAL" | "PARTITION_KEY_ID_ASC" | "PARTITION_KEY_ID_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "RETENTION_KEEP_TABLE_ASC" | "RETENTION_KEEP_TABLE_DESC" | "STRATEGY_ASC" | "STRATEGY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiOrderBy = "ANON_ROLE_ASC" | "ANON_ROLE_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DBNAME_ASC" | "DBNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_NAME_ASC" | "ROLE_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiModuleOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiSchemaOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiSettingOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformCorsSettingOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformDomainOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformDomainEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "DOMAIN_VERIFICATION_ID_ASC" | "DOMAIN_VERIFICATION_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformDomainVerificationOrderBy = "ATTEMPTS_ASC" | "ATTEMPTS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LAST_CHECKED_AT_ASC" | "LAST_CHECKED_AT_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECORD_NAME_ASC" | "RECORD_NAME_DESC" | "RECORD_TYPE_ASC" | "RECORD_TYPE_DESC" | "RECORD_VALUE_ASC" | "RECORD_VALUE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformManagedDomainOrderBy = "ALLOW_PUBLIC_USAGE_ASC" | "ALLOW_PUBLIC_USAGE_DESC" | "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CERT_STATUS_ASC" | "CERT_STATUS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformSiteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteMetadatumOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OG_IMAGE_ASC" | "OG_IMAGE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteModuleOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteThemeOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "THEME_ASC" | "THEME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PolicyOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "DISABLED_ASC" | "DISABLED_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PERMISSIVE_ASC" | "PERMISSIVE_DESC" | "POLICY_TYPE_ASC" | "POLICY_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITH_CHECK_ASC" | "WITH_CHECK_DESC"; -export type PrimaryKeyConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITHOUT_OVERLAPS_ASC" | "WITHOUT_OVERLAPS_DESC"; -export type PubkeySettingOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC" | "SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC" | "SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC" | "SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC" | "SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC" | "SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC" | "SIGN_UP_WITH_KEY_FUNCTION_ID_ASC" | "SIGN_UP_WITH_KEY_FUNCTION_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_FIELD_ASC" | "USER_FIELD_DESC"; -export type RlsSettingOrderBy = "AUTHENTICATE_FUNCTION_ID_ASC" | "AUTHENTICATE_FUNCTION_ID_DESC" | "AUTHENTICATE_SCHEMA_ID_ASC" | "AUTHENTICATE_SCHEMA_ID_DESC" | "AUTHENTICATE_STRICT_FUNCTION_ID_ASC" | "AUTHENTICATE_STRICT_FUNCTION_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CURRENT_IP_ADDRESS_FUNCTION_ID_ASC" | "CURRENT_IP_ADDRESS_FUNCTION_ID_DESC" | "CURRENT_ROLE_FUNCTION_ID_ASC" | "CURRENT_ROLE_FUNCTION_ID_DESC" | "CURRENT_ROLE_ID_FUNCTION_ID_ASC" | "CURRENT_ROLE_ID_FUNCTION_ID_DESC" | "CURRENT_USER_AGENT_FUNCTION_ID_ASC" | "CURRENT_USER_AGENT_FUNCTION_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_SCHEMA_ID_ASC" | "ROLE_SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type RouteBindingOrderBy = "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_API_ID_ASC" | "TARGET_API_ID_DESC" | "TARGET_FUNCTION_ID_ASC" | "TARGET_FUNCTION_ID_DESC" | "TARGET_SITE_ID_ASC" | "TARGET_SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type RouteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_API_ID_ASC" | "TARGET_API_ID_DESC" | "TARGET_FUNCTION_ID_ASC" | "TARGET_FUNCTION_ID_DESC" | "TARGET_SITE_ID_ASC" | "TARGET_SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SchemaOrderBy = "API_EXPOSURE_ASC" | "API_EXPOSURE_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLIC_ASC" | "IS_PUBLIC_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_NAME_ASC" | "SCHEMA_NAME_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SchemaGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteMetadatumOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OG_IMAGE_ASC" | "OG_IMAGE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteModuleOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteThemeOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "THEME_ASC" | "THEME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SpatialRelationOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPERATOR_ASC" | "OPERATOR_DESC" | "PARAM_NAME_ASC" | "PARAM_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_ID_ASC" | "REF_FIELD_ID_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SqlActionOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "DEPS_ASC" | "DEPS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; -export type TableOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INHERITS_ID_ASC" | "INHERITS_ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARTITIONED_ASC" | "PARTITIONED_DESC" | "PARTITION_KEY_NAMES_ASC" | "PARTITION_KEY_NAMES_DESC" | "PARTITION_KEY_TYPES_ASC" | "PARTITION_KEY_TYPES_DESC" | "PARTITION_STRATEGY_ASC" | "PARTITION_STRATEGY_DESC" | "PEOPLESTAMPS_ASC" | "PEOPLESTAMPS_DESC" | "PLURAL_NAME_ASC" | "PLURAL_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SINGULAR_NAME_ASC" | "SINGULAR_NAME_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "STEP_UP_ASC" | "STEP_UP_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TIMESTAMPS_ASC" | "TIMESTAMPS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USE_RLS_ASC" | "USE_RLS_DESC"; -export type TableGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type TriggerOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_ASC" | "EVENT_DESC" | "FUNCTION_NAME_ASC" | "FUNCTION_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type TriggerFunctionOrderBy = "CODE_ASC" | "CODE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type UniqueConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITHOUT_OVERLAPS_ASC" | "WITHOUT_OVERLAPS_DESC"; -export type ViewOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CHECK_OPTION_ASC" | "CHECK_OPTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "FILTER_DATA_ASC" | "FILTER_DATA_DESC" | "FILTER_TYPE_ASC" | "FILTER_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECURITY_BARRIER_ASC" | "SECURITY_BARRIER_DESC" | "SECURITY_INVOKER_ASC" | "SECURITY_INVOKER_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "VIEW_TYPE_ASC" | "VIEW_TYPE_DESC"; -export type ViewGrantOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC" | "WITH_GRANT_OPTION_ASC" | "WITH_GRANT_OPTION_DESC"; -export type ViewRuleOrderBy = "ACTION_ASC" | "ACTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_ASC" | "EVENT_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC"; -export type ViewTableOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOIN_ORDER_ASC" | "JOIN_ORDER_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC"; -export type WebauthnSettingOrderBy = "ATTESTATION_TYPE_ASC" | "ATTESTATION_TYPE_DESC" | "CHALLENGE_EXPIRY_SECONDS_ASC" | "CHALLENGE_EXPIRY_SECONDS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREDENTIALS_SCHEMA_ID_ASC" | "CREDENTIALS_SCHEMA_ID_DESC" | "CREDENTIALS_TABLE_ID_ASC" | "CREDENTIALS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORIGIN_ALLOWLIST_ASC" | "ORIGIN_ALLOWLIST_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRE_USER_VERIFICATION_ASC" | "REQUIRE_USER_VERIFICATION_DESC" | "RESIDENT_KEY_ASC" | "RESIDENT_KEY_DESC" | "RP_ID_ASC" | "RP_ID_DESC" | "RP_NAME_ASC" | "RP_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_SCHEMA_ID_ASC" | "SESSIONS_SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_SECRETS_SCHEMA_ID_ASC" | "SESSION_SECRETS_SCHEMA_ID_DESC" | "SESSION_SECRETS_TABLE_ID_ASC" | "SESSION_SECRETS_TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_FIELD_ID_ASC" | "USER_FIELD_ID_DESC"; +export type ApiOrderBy = + | 'ANON_ROLE_ASC' + | 'ANON_ROLE_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DBNAME_ASC' + | 'DBNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_NAME_ASC' + | 'ROLE_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiModuleOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiSchemaOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiSettingOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AstMigrationOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYS_ASC' + | 'DEPLOYS_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REQUIRES_ASC' + | 'REQUIRES_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; +export type CheckConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EXPR_ASC' + | 'EXPR_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type CompositeTypeOrderBy = + | 'ATTRIBUTES_ASC' + | 'ATTRIBUTES_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC'; +export type CorsSettingOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PLATFORM_ASC' + | 'PLATFORM_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_HASH_ASC' + | 'SCHEMA_HASH_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseSettingOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseTransferOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIATED_BY_ASC' + | 'INITIATED_BY_DESC' + | 'NATURAL' + | 'NOTES_ASC' + | 'NOTES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_APPROVED_ASC' + | 'SOURCE_APPROVED_AT_ASC' + | 'SOURCE_APPROVED_AT_DESC' + | 'SOURCE_APPROVED_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TARGET_APPROVED_ASC' + | 'TARGET_APPROVED_AT_ASC' + | 'TARGET_APPROVED_AT_DESC' + | 'TARGET_APPROVED_DESC' + | 'TARGET_OWNER_ID_ASC' + | 'TARGET_OWNER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DefaultPrivilegeOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'OBJECT_TYPE_ASC' + | 'OBJECT_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type DomainOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type DomainEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'DOMAIN_VERIFICATION_ID_ASC' + | 'DOMAIN_VERIFICATION_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DomainVerificationOrderBy = + | 'ATTEMPTS_ASC' + | 'ATTEMPTS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_CHECKED_AT_ASC' + | 'LAST_CHECKED_AT_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECORD_NAME_ASC' + | 'RECORD_NAME_DESC' + | 'RECORD_TYPE_ASC' + | 'RECORD_TYPE_DESC' + | 'RECORD_VALUE_ASC' + | 'RECORD_VALUE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type EmbeddingChunkOrderBy = + | 'CHUNKING_TASK_NAME_ASC' + | 'CHUNKING_TASK_NAME_DESC' + | 'CHUNKS_TABLE_ID_ASC' + | 'CHUNKS_TABLE_ID_DESC' + | 'CHUNKS_TABLE_NAME_ASC' + | 'CHUNKS_TABLE_NAME_DESC' + | 'CHUNK_OVERLAP_ASC' + | 'CHUNK_OVERLAP_DESC' + | 'CHUNK_SIZE_ASC' + | 'CHUNK_SIZE_DESC' + | 'CHUNK_STRATEGY_ASC' + | 'CHUNK_STRATEGY_DESC' + | 'CONTENT_FIELD_NAME_ASC' + | 'CONTENT_FIELD_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DIMENSIONS_ASC' + | 'DIMENSIONS_DESC' + | 'EMBEDDING_FIELD_ID_ASC' + | 'EMBEDDING_FIELD_ID_DESC' + | 'EMBEDDING_MODEL_ASC' + | 'EMBEDDING_MODEL_DESC' + | 'EMBEDDING_PROVIDER_ASC' + | 'EMBEDDING_PROVIDER_DESC' + | 'ENQUEUE_CHUNKING_JOB_ASC' + | 'ENQUEUE_CHUNKING_JOB_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'METADATA_FIELDS_ASC' + | 'METADATA_FIELDS_DESC' + | 'METRIC_ASC' + | 'METRIC_DESC' + | 'NATURAL' + | 'PARENT_FK_FIELD_ID_ASC' + | 'PARENT_FK_FIELD_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_INDEXES_ASC' + | 'SEARCH_INDEXES_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type EnumOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'VALUES_ASC' + | 'VALUES_DESC'; +export type ExclusionConstraintOrderBy = + | 'ACCESS_METHOD_ASC' + | 'ACCESS_METHOD_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ELEMENT_EXPR_ASC' + | 'ELEMENT_EXPR_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPERATORS_ASC' + | 'OPERATORS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WHERE_CLAUSE_ASC' + | 'WHERE_CLAUSE_DESC'; +export type FieldOrderBy = + | 'API_REQUIRED_ASC' + | 'API_REQUIRED_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CHK_ASC' + | 'CHK_DESC' + | 'CHK_EXPR_ASC' + | 'CHK_EXPR_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_VALUE_ASC' + | 'DEFAULT_VALUE_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_ORDER_ASC' + | 'FIELD_ORDER_DESC' + | 'GENERATION_EXPRESSION_ASC' + | 'GENERATION_EXPRESSION_DESC' + | 'GENERATION_TYPE_ASC' + | 'GENERATION_TYPE_DESC' + | 'IDENTITY_GENERATION_ASC' + | 'IDENTITY_GENERATION_DESC' + | 'IDENTITY_OPTIONS_ASC' + | 'IDENTITY_OPTIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_REQUIRED_ASC' + | 'IS_REQUIRED_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'MIN_ASC' + | 'MIN_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REGEXP_ASC' + | 'REGEXP_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ForeignKeyConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACTION_ASC' + | 'DELETE_ACTION_DESC' + | 'DELETE_SET_FIELD_IDS_ASC' + | 'DELETE_SET_FIELD_IDS_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_IDS_ASC' + | 'REF_FIELD_IDS_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATE_ACTION_ASC' + | 'UPDATE_ACTION_DESC' + | 'WITH_PERIOD_ASC' + | 'WITH_PERIOD_DESC'; +export type FullTextSearchOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LANGS_ASC' + | 'LANGS_DESC' + | 'LANG_COLUMN_ASC' + | 'LANG_COLUMN_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WEIGHTS_ASC' + | 'WEIGHTS_DESC'; +export type FunctionOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type HostnameBindingOrderBy = + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC'; +export type HttpRouteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_ID_ASC' + | 'TARGET_ID_DESC' + | 'TARGET_KIND_ASC' + | 'TARGET_KIND_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type IndexOrderBy = + | 'ACCESS_METHOD_ASC' + | 'ACCESS_METHOD_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INCLUDE_FIELD_IDS_ASC' + | 'INCLUDE_FIELD_IDS_DESC' + | 'INDEX_PARAMS_ASC' + | 'INDEX_PARAMS_DESC' + | 'IS_UNIQUE_ASC' + | 'IS_UNIQUE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'OP_CLASSES_ASC' + | 'OP_CLASSES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WHERE_CLAUSE_ASC' + | 'WHERE_CLAUSE_DESC'; +export type ManagedDomainOrderBy = + | 'ALLOW_PUBLIC_USAGE_ASC' + | 'ALLOW_PUBLIC_USAGE_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CERT_STATUS_ASC' + | 'CERT_STATUS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type NodeTypeRegistryOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMETER_SCHEMA_ASC' + | 'PARAMETER_SCHEMA_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC'; +export type PartitionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'IS_PARENTED_ASC' + | 'IS_PARENTED_DESC' + | 'NAMING_PATTERN_ASC' + | 'NAMING_PATTERN_DESC' + | 'NATURAL' + | 'PARTITION_KEY_ID_ASC' + | 'PARTITION_KEY_ID_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'RETENTION_KEEP_TABLE_ASC' + | 'RETENTION_KEEP_TABLE_DESC' + | 'STRATEGY_ASC' + | 'STRATEGY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiOrderBy = + | 'ANON_ROLE_ASC' + | 'ANON_ROLE_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DBNAME_ASC' + | 'DBNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_NAME_ASC' + | 'ROLE_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiModuleOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiSchemaOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiSettingOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformCorsSettingOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformDomainOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformDomainEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'DOMAIN_VERIFICATION_ID_ASC' + | 'DOMAIN_VERIFICATION_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformDomainVerificationOrderBy = + | 'ATTEMPTS_ASC' + | 'ATTEMPTS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_CHECKED_AT_ASC' + | 'LAST_CHECKED_AT_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECORD_NAME_ASC' + | 'RECORD_NAME_DESC' + | 'RECORD_TYPE_ASC' + | 'RECORD_TYPE_DESC' + | 'RECORD_VALUE_ASC' + | 'RECORD_VALUE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformManagedDomainOrderBy = + | 'ALLOW_PUBLIC_USAGE_ASC' + | 'ALLOW_PUBLIC_USAGE_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CERT_STATUS_ASC' + | 'CERT_STATUS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformSiteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteMetadatumOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OG_IMAGE_ASC' + | 'OG_IMAGE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteModuleOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteThemeOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'THEME_ASC' + | 'THEME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PolicyOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'DISABLED_ASC' + | 'DISABLED_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PERMISSIVE_ASC' + | 'PERMISSIVE_DESC' + | 'POLICY_TYPE_ASC' + | 'POLICY_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITH_CHECK_ASC' + | 'WITH_CHECK_DESC'; +export type PrimaryKeyConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITHOUT_OVERLAPS_ASC' + | 'WITHOUT_OVERLAPS_DESC'; +export type PubkeySettingOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC' + | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC' + | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC' + | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC' + | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC' + | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC' + | 'SIGN_UP_WITH_KEY_FUNCTION_ID_ASC' + | 'SIGN_UP_WITH_KEY_FUNCTION_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_FIELD_ASC' + | 'USER_FIELD_DESC'; +export type RlsSettingOrderBy = + | 'AUTHENTICATE_FUNCTION_ID_ASC' + | 'AUTHENTICATE_FUNCTION_ID_DESC' + | 'AUTHENTICATE_SCHEMA_ID_ASC' + | 'AUTHENTICATE_SCHEMA_ID_DESC' + | 'AUTHENTICATE_STRICT_FUNCTION_ID_ASC' + | 'AUTHENTICATE_STRICT_FUNCTION_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CURRENT_IP_ADDRESS_FUNCTION_ID_ASC' + | 'CURRENT_IP_ADDRESS_FUNCTION_ID_DESC' + | 'CURRENT_ROLE_FUNCTION_ID_ASC' + | 'CURRENT_ROLE_FUNCTION_ID_DESC' + | 'CURRENT_ROLE_ID_FUNCTION_ID_ASC' + | 'CURRENT_ROLE_ID_FUNCTION_ID_DESC' + | 'CURRENT_USER_AGENT_FUNCTION_ID_ASC' + | 'CURRENT_USER_AGENT_FUNCTION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_SCHEMA_ID_ASC' + | 'ROLE_SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type RouteBindingOrderBy = + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_API_ID_ASC' + | 'TARGET_API_ID_DESC' + | 'TARGET_FUNCTION_ID_ASC' + | 'TARGET_FUNCTION_ID_DESC' + | 'TARGET_SITE_ID_ASC' + | 'TARGET_SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type RouteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_API_ID_ASC' + | 'TARGET_API_ID_DESC' + | 'TARGET_FUNCTION_ID_ASC' + | 'TARGET_FUNCTION_ID_DESC' + | 'TARGET_SITE_ID_ASC' + | 'TARGET_SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SchemaOrderBy = + | 'API_EXPOSURE_ASC' + | 'API_EXPOSURE_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLIC_ASC' + | 'IS_PUBLIC_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_NAME_ASC' + | 'SCHEMA_NAME_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SchemaGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteMetadatumOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OG_IMAGE_ASC' + | 'OG_IMAGE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteModuleOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteThemeOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'THEME_ASC' + | 'THEME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SpatialRelationOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPERATOR_ASC' + | 'OPERATOR_DESC' + | 'PARAM_NAME_ASC' + | 'PARAM_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_ID_ASC' + | 'REF_FIELD_ID_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SqlActionOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'DEPS_ASC' + | 'DEPS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; +export type TableOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INHERITS_ID_ASC' + | 'INHERITS_ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARTITIONED_ASC' + | 'PARTITIONED_DESC' + | 'PARTITION_KEY_NAMES_ASC' + | 'PARTITION_KEY_NAMES_DESC' + | 'PARTITION_KEY_TYPES_ASC' + | 'PARTITION_KEY_TYPES_DESC' + | 'PARTITION_STRATEGY_ASC' + | 'PARTITION_STRATEGY_DESC' + | 'PEOPLESTAMPS_ASC' + | 'PEOPLESTAMPS_DESC' + | 'PLURAL_NAME_ASC' + | 'PLURAL_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SINGULAR_NAME_ASC' + | 'SINGULAR_NAME_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'STEP_UP_ASC' + | 'STEP_UP_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TIMESTAMPS_ASC' + | 'TIMESTAMPS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USE_RLS_ASC' + | 'USE_RLS_DESC'; +export type TableGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type TriggerOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'FUNCTION_NAME_ASC' + | 'FUNCTION_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type TriggerFunctionOrderBy = + | 'CODE_ASC' + | 'CODE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type UniqueConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITHOUT_OVERLAPS_ASC' + | 'WITHOUT_OVERLAPS_DESC'; +export type ViewOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CHECK_OPTION_ASC' + | 'CHECK_OPTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'FILTER_DATA_ASC' + | 'FILTER_DATA_DESC' + | 'FILTER_TYPE_ASC' + | 'FILTER_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECURITY_BARRIER_ASC' + | 'SECURITY_BARRIER_DESC' + | 'SECURITY_INVOKER_ASC' + | 'SECURITY_INVOKER_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'VIEW_TYPE_ASC' + | 'VIEW_TYPE_DESC'; +export type ViewGrantOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC' + | 'WITH_GRANT_OPTION_ASC' + | 'WITH_GRANT_OPTION_DESC'; +export type ViewRuleOrderBy = + | 'ACTION_ASC' + | 'ACTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC'; +export type ViewTableOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOIN_ORDER_ASC' + | 'JOIN_ORDER_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC'; +export type WebauthnSettingOrderBy = + | 'ATTESTATION_TYPE_ASC' + | 'ATTESTATION_TYPE_DESC' + | 'CHALLENGE_EXPIRY_SECONDS_ASC' + | 'CHALLENGE_EXPIRY_SECONDS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREDENTIALS_SCHEMA_ID_ASC' + | 'CREDENTIALS_SCHEMA_ID_DESC' + | 'CREDENTIALS_TABLE_ID_ASC' + | 'CREDENTIALS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORIGIN_ALLOWLIST_ASC' + | 'ORIGIN_ALLOWLIST_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRE_USER_VERIFICATION_ASC' + | 'REQUIRE_USER_VERIFICATION_DESC' + | 'RESIDENT_KEY_ASC' + | 'RESIDENT_KEY_DESC' + | 'RP_ID_ASC' + | 'RP_ID_DESC' + | 'RP_NAME_ASC' + | 'RP_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_SCHEMA_ID_ASC' + | 'SESSIONS_SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_SECRETS_SCHEMA_ID_ASC' + | 'SESSION_SECRETS_SCHEMA_ID_DESC' + | 'SESSION_SECRETS_TABLE_ID_ASC' + | 'SESSION_SECRETS_TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_FIELD_ID_ASC' + | 'USER_FIELD_ID_DESC'; // ============ CRUD Input Types ============ export interface CreateApiInput { clientMutationId?: string; @@ -8368,111 +10044,111 @@ export interface DeleteWebauthnSettingInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Api": { - "apiModules": "ApiModule", - "apiSchemas": "ApiSchema", - "corsSettings": "CorsSetting" + Api: { + apiModules: 'ApiModule', + apiSchemas: 'ApiSchema', + corsSettings: 'CorsSetting', }, - "Database": { - "checkConstraints": "CheckConstraint", - "compositeTypes": "CompositeType", - "databaseTransfers": "DatabaseTransfer", - "defaultPrivileges": "DefaultPrivilege", - "embeddingChunks": "EmbeddingChunk", - "enums": "Enum", - "exclusionConstraints": "ExclusionConstraint", - "fields": "Field", - "foreignKeyConstraints": "ForeignKeyConstraint", - "fullTextSearches": "FullTextSearch", - "functions": "Function", - "indices": "Index", - "partitions": "Partition", - "policies": "Policy", - "primaryKeyConstraints": "PrimaryKeyConstraint", - "schemaGrants": "SchemaGrant", - "schemas": "Schema", - "spatialRelations": "SpatialRelation", - "tableGrants": "TableGrant", - "tables": "Table", - "triggerFunctions": "TriggerFunction", - "triggers": "Trigger", - "uniqueConstraints": "UniqueConstraint", - "viewGrants": "ViewGrant", - "viewRules": "ViewRule", - "viewTables": "ViewTable", - "views": "View" + Database: { + checkConstraints: 'CheckConstraint', + compositeTypes: 'CompositeType', + databaseTransfers: 'DatabaseTransfer', + defaultPrivileges: 'DefaultPrivilege', + embeddingChunks: 'EmbeddingChunk', + enums: 'Enum', + exclusionConstraints: 'ExclusionConstraint', + fields: 'Field', + foreignKeyConstraints: 'ForeignKeyConstraint', + fullTextSearches: 'FullTextSearch', + functions: 'Function', + indices: 'Index', + partitions: 'Partition', + policies: 'Policy', + primaryKeyConstraints: 'PrimaryKeyConstraint', + schemaGrants: 'SchemaGrant', + schemas: 'Schema', + spatialRelations: 'SpatialRelation', + tableGrants: 'TableGrant', + tables: 'Table', + triggerFunctions: 'TriggerFunction', + triggers: 'Trigger', + uniqueConstraints: 'UniqueConstraint', + viewGrants: 'ViewGrant', + viewRules: 'ViewRule', + viewTables: 'ViewTable', + views: 'View', }, - "Domain": { - "domainEvents": "DomainEvent", - "domainVerifications": "DomainVerification", - "httpRoutes": "HttpRoute", - "routes": "Route" + Domain: { + domainEvents: 'DomainEvent', + domainVerifications: 'DomainVerification', + httpRoutes: 'HttpRoute', + routes: 'Route', }, - "Field": { - "spatialRelations": "SpatialRelation", - "spatialRelationsByRefFieldId": "SpatialRelation" + Field: { + spatialRelations: 'SpatialRelation', + spatialRelationsByRefFieldId: 'SpatialRelation', }, - "ManagedDomain": { - "domainEvents": "DomainEvent", - "domainVerifications": "DomainVerification" + ManagedDomain: { + domainEvents: 'DomainEvent', + domainVerifications: 'DomainVerification', }, - "PlatformApi": { - "platformApiModulesByApiId": "PlatformApiModule", - "platformApiSchemasByApiId": "PlatformApiSchema" + PlatformApi: { + platformApiModulesByApiId: 'PlatformApiModule', + platformApiSchemasByApiId: 'PlatformApiSchema', }, - "PlatformDomain": { - "platformDomainEventsByDomainId": "PlatformDomainEvent", - "platformDomainVerificationsByDomainId": "PlatformDomainVerification" + PlatformDomain: { + platformDomainEventsByDomainId: 'PlatformDomainEvent', + platformDomainVerificationsByDomainId: 'PlatformDomainVerification', }, - "PlatformManagedDomain": { - "platformDomainEventsByManagedDomainId": "PlatformDomainEvent", - "platformDomainVerificationsByManagedDomainId": "PlatformDomainVerification" + PlatformManagedDomain: { + platformDomainEventsByManagedDomainId: 'PlatformDomainEvent', + platformDomainVerificationsByManagedDomainId: 'PlatformDomainVerification', }, - "PlatformSite": { - "platformSiteMetadataBySiteId": "PlatformSiteMetadatum", - "platformSiteModulesBySiteId": "PlatformSiteModule", - "platformSiteThemesBySiteId": "PlatformSiteTheme" + PlatformSite: { + platformSiteMetadataBySiteId: 'PlatformSiteMetadatum', + platformSiteModulesBySiteId: 'PlatformSiteModule', + platformSiteThemesBySiteId: 'PlatformSiteTheme', }, - "Schema": { - "apiSchemas": "ApiSchema", - "compositeTypes": "CompositeType", - "defaultPrivileges": "DefaultPrivilege", - "enums": "Enum", - "functions": "Function", - "platformApiSchemas": "PlatformApiSchema", - "schemaGrants": "SchemaGrant", - "tables": "Table", - "views": "View" + Schema: { + apiSchemas: 'ApiSchema', + compositeTypes: 'CompositeType', + defaultPrivileges: 'DefaultPrivilege', + enums: 'Enum', + functions: 'Function', + platformApiSchemas: 'PlatformApiSchema', + schemaGrants: 'SchemaGrant', + tables: 'Table', + views: 'View', }, - "Site": { - "siteMetadata": "SiteMetadatum", - "siteModules": "SiteModule", - "siteThemes": "SiteTheme" + Site: { + siteMetadata: 'SiteMetadatum', + siteModules: 'SiteModule', + siteThemes: 'SiteTheme', }, - "Table": { - "checkConstraints": "CheckConstraint", - "embeddingChunks": "EmbeddingChunk", - "embeddingChunksByChunksTableId": "EmbeddingChunk", - "exclusionConstraints": "ExclusionConstraint", - "fields": "Field", - "foreignKeyConstraints": "ForeignKeyConstraint", - "fullTextSearches": "FullTextSearch", - "indices": "Index", - "policies": "Policy", - "primaryKeyConstraints": "PrimaryKeyConstraint", - "spatialRelations": "SpatialRelation", - "spatialRelationsByRefTableId": "SpatialRelation", - "tableGrants": "TableGrant", - "triggers": "Trigger", - "uniqueConstraints": "UniqueConstraint", - "viewTables": "ViewTable", - "views": "View" + Table: { + checkConstraints: 'CheckConstraint', + embeddingChunks: 'EmbeddingChunk', + embeddingChunksByChunksTableId: 'EmbeddingChunk', + exclusionConstraints: 'ExclusionConstraint', + fields: 'Field', + foreignKeyConstraints: 'ForeignKeyConstraint', + fullTextSearches: 'FullTextSearch', + indices: 'Index', + policies: 'Policy', + primaryKeyConstraints: 'PrimaryKeyConstraint', + spatialRelations: 'SpatialRelation', + spatialRelationsByRefTableId: 'SpatialRelation', + tableGrants: 'TableGrant', + triggers: 'Trigger', + uniqueConstraints: 'UniqueConstraint', + viewTables: 'ViewTable', + views: 'View', + }, + View: { + viewGrants: 'ViewGrant', + viewRules: 'ViewRule', + viewTables: 'ViewTable', }, - "View": { - "viewGrants": "ViewGrant", - "viewRules": "ViewRule", - "viewTables": "ViewTable" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface AcceptDatabaseTransferInput { @@ -16831,4 +18507,4 @@ export type WebauthnSettingEdgeSelect = { node?: { select: WebauthnSettingSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/api/orm/models/api.ts b/sdk/constructive-react/src/api/orm/models/api.ts index 6a90777ca7..4d60695731 100644 --- a/sdk/constructive-react/src/api/orm/models/api.ts +++ b/sdk/constructive-react/src/api/orm/models/api.ts @@ -3,56 +3,96 @@ * @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 { Api, ApiWithRelations, ApiSelect, ApiFilter, ApiOrderBy, CreateApiInput, UpdateApiInput, ApiPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Api, + ApiWithRelations, + ApiSelect, + ApiFilter, + ApiOrderBy, + CreateApiInput, + UpdateApiInput, + ApiPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apis: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Api", "apis", 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 - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Api', + 'apis', + 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, + }, + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "apis", + operation: 'query', + operationName: 'Api', + fieldName: 'apis', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ api: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Api", "apis", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Api', + 'apis', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "api", + operation: 'query', + operationName: 'Api', + fieldName: 'api', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "api": data.apis?.nodes?.[0] ?? null - }) + api: data.apis?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ api: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Api", "apis", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Api', + 'apis', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "api", + operation: 'query', + operationName: 'Api', + fieldName: 'api', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "api": data.apis?.nodes?.[0] ?? null - }) + api: data.apis?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Api", "createApi", "api", args.select, args.data, "CreateApiInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Api', + 'createApi', + 'api', + args.select, + args.data, + 'CreateApiInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "createApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'createApi', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Api", "updateApi", "api", args.select, args.where.id, args.data, "UpdateApiInput", "id", "apiPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Api', + 'updateApi', + 'api', + args.select, + args.where.id, + args.data, + 'UpdateApiInput', + 'id', + 'apiPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "updateApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'updateApi', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Api", "deleteApi", "api", { - id: args.where.id - }, "DeleteApiInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Api', + 'deleteApi', + 'api', + { + id: args.where.id, + }, + 'DeleteApiInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "deleteApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'deleteApi', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/apiModule.ts b/sdk/constructive-react/src/api/orm/models/apiModule.ts index ac4485467d..dd9bb29f76 100644 --- a/sdk/constructive-react/src/api/orm/models/apiModule.ts +++ b/sdk/constructive-react/src/api/orm/models/apiModule.ts @@ -3,56 +3,96 @@ * @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 { ApiModule, ApiModuleWithRelations, ApiModuleSelect, ApiModuleFilter, ApiModuleOrderBy, CreateApiModuleInput, UpdateApiModuleInput, ApiModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiModule, + ApiModuleWithRelations, + ApiModuleSelect, + ApiModuleFilter, + ApiModuleOrderBy, + CreateApiModuleInput, + UpdateApiModuleInput, + ApiModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiModule", "apiModules", 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 - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiModule', + 'apiModules', + 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, + }, + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModules", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiModule", "apiModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiModule', + 'apiModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModule", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiModule": data.apiModules?.nodes?.[0] ?? null - }) + apiModule: data.apiModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiModule", "apiModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiModule', + 'apiModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModule", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiModule": data.apiModules?.nodes?.[0] ?? null - }) + apiModule: data.apiModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiModule", "createApiModule", "apiModule", args.select, args.data, "CreateApiModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiModule', + 'createApiModule', + 'apiModule', + args.select, + args.data, + 'CreateApiModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "createApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'createApiModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiModule", "updateApiModule", "apiModule", args.select, args.where.id, args.data, "UpdateApiModuleInput", "id", "apiModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiModule', + 'updateApiModule', + 'apiModule', + args.select, + args.where.id, + args.data, + 'UpdateApiModuleInput', + 'id', + 'apiModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "updateApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'updateApiModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiModule", "deleteApiModule", "apiModule", { - id: args.where.id - }, "DeleteApiModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiModule', + 'deleteApiModule', + 'apiModule', + { + id: args.where.id, + }, + 'DeleteApiModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "deleteApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'deleteApiModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/apiSchema.ts b/sdk/constructive-react/src/api/orm/models/apiSchema.ts index 2545e4014a..2179728a2b 100644 --- a/sdk/constructive-react/src/api/orm/models/apiSchema.ts +++ b/sdk/constructive-react/src/api/orm/models/apiSchema.ts @@ -3,56 +3,96 @@ * @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 { ApiSchema, ApiSchemaWithRelations, ApiSchemaSelect, ApiSchemaFilter, ApiSchemaOrderBy, CreateApiSchemaInput, UpdateApiSchemaInput, ApiSchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSchema, + ApiSchemaWithRelations, + ApiSchemaSelect, + ApiSchemaFilter, + ApiSchemaOrderBy, + CreateApiSchemaInput, + UpdateApiSchemaInput, + ApiSchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSchema", "apiSchemas", 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 - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSchema', + 'apiSchemas', + 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, + }, + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchemas", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSchema", "apiSchemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSchema', + 'apiSchemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchema", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSchema": data.apiSchemas?.nodes?.[0] ?? null - }) + apiSchema: data.apiSchemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSchema", "apiSchemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSchema', + 'apiSchemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchema", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSchema": data.apiSchemas?.nodes?.[0] ?? null - }) + apiSchema: data.apiSchemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSchema", "createApiSchema", "apiSchema", args.select, args.data, "CreateApiSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSchema', + 'createApiSchema', + 'apiSchema', + args.select, + args.data, + 'CreateApiSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "createApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'createApiSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSchema", "updateApiSchema", "apiSchema", args.select, args.where.id, args.data, "UpdateApiSchemaInput", "id", "apiSchemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSchema', + 'updateApiSchema', + 'apiSchema', + args.select, + args.where.id, + args.data, + 'UpdateApiSchemaInput', + 'id', + 'apiSchemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "updateApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'updateApiSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSchema", "deleteApiSchema", "apiSchema", { - id: args.where.id - }, "DeleteApiSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSchema', + 'deleteApiSchema', + 'apiSchema', + { + id: args.where.id, + }, + 'DeleteApiSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "deleteApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'deleteApiSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/apiSetting.ts b/sdk/constructive-react/src/api/orm/models/apiSetting.ts index b2ba66ae85..01f1b5b74e 100644 --- a/sdk/constructive-react/src/api/orm/models/apiSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/apiSetting.ts @@ -3,56 +3,96 @@ * @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 { ApiSetting, ApiSettingWithRelations, ApiSettingSelect, ApiSettingFilter, ApiSettingOrderBy, CreateApiSettingInput, UpdateApiSettingInput, ApiSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSetting, + ApiSettingWithRelations, + ApiSettingSelect, + ApiSettingFilter, + ApiSettingOrderBy, + CreateApiSettingInput, + UpdateApiSettingInput, + ApiSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSetting", "apiSettings", 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 - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSetting', + 'apiSettings', + 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, + }, + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSettings", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSetting", "apiSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSetting', + 'apiSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSetting", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSetting": data.apiSettings?.nodes?.[0] ?? null - }) + apiSetting: data.apiSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSetting", "apiSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSetting', + 'apiSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSetting", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSetting": data.apiSettings?.nodes?.[0] ?? null - }) + apiSetting: data.apiSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSetting", "createApiSetting", "apiSetting", args.select, args.data, "CreateApiSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSetting', + 'createApiSetting', + 'apiSetting', + args.select, + args.data, + 'CreateApiSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "createApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'createApiSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSetting", "updateApiSetting", "apiSetting", args.select, args.where.id, args.data, "UpdateApiSettingInput", "id", "apiSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSetting', + 'updateApiSetting', + 'apiSetting', + args.select, + args.where.id, + args.data, + 'UpdateApiSettingInput', + 'id', + 'apiSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "updateApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'updateApiSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSetting", "deleteApiSetting", "apiSetting", { - id: args.where.id - }, "DeleteApiSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSetting', + 'deleteApiSetting', + 'apiSetting', + { + id: args.where.id, + }, + 'DeleteApiSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "deleteApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'deleteApiSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/astMigration.ts b/sdk/constructive-react/src/api/orm/models/astMigration.ts index b6f4db557f..bfcc5f455a 100644 --- a/sdk/constructive-react/src/api/orm/models/astMigration.ts +++ b/sdk/constructive-react/src/api/orm/models/astMigration.ts @@ -3,56 +3,96 @@ * @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 { AstMigration, AstMigrationWithRelations, AstMigrationSelect, AstMigrationFilter, AstMigrationOrderBy, CreateAstMigrationInput, UpdateAstMigrationInput, AstMigrationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AstMigration, + AstMigrationWithRelations, + AstMigrationSelect, + AstMigrationFilter, + AstMigrationOrderBy, + CreateAstMigrationInput, + UpdateAstMigrationInput, + AstMigrationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AstMigrationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigrations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AstMigration", "astMigrations", 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 - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AstMigration', + 'astMigrations', + 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, + }, + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigrations", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigrations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigration: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AstMigration", "astMigrations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AstMigration', + 'astMigrations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigration", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigration', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AstMigrationModel { nodes?: InferSelectResult[]; }; }) => ({ - "astMigration": data.astMigrations?.nodes?.[0] ?? null - }) + astMigration: data.astMigrations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigration: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AstMigration", "astMigrations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AstMigration', + 'astMigrations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigration", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigration', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class AstMigrationModel { nodes?: InferSelectResult[]; }; }) => ({ - "astMigration": data.astMigrations?.nodes?.[0] ?? null - }) + astMigration: data.astMigrations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAstMigration: { astMigration: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AstMigration", "createAstMigration", "astMigration", args.select, args.data, "CreateAstMigrationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AstMigration', + 'createAstMigration', + 'astMigration', + args.select, + args.data, + 'CreateAstMigrationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AstMigration", - fieldName: "createAstMigration", + operation: 'mutation', + operationName: 'AstMigration', + fieldName: 'createAstMigration', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/checkConstraint.ts b/sdk/constructive-react/src/api/orm/models/checkConstraint.ts index 2683f316fc..7f6054e6a4 100644 --- a/sdk/constructive-react/src/api/orm/models/checkConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/checkConstraint.ts @@ -3,56 +3,96 @@ * @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 { CheckConstraint, CheckConstraintWithRelations, CheckConstraintSelect, CheckConstraintFilter, CheckConstraintOrderBy, CreateCheckConstraintInput, UpdateCheckConstraintInput, CheckConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CheckConstraint, + CheckConstraintWithRelations, + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy, + CreateCheckConstraintInput, + UpdateCheckConstraintInput, + CheckConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CheckConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CheckConstraint", "checkConstraints", 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 - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CheckConstraint', + 'checkConstraints', + 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, + }, + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraints", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CheckConstraint", "checkConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CheckConstraint', + 'checkConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraint", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CheckConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "checkConstraint": data.checkConstraints?.nodes?.[0] ?? null - }) + checkConstraint: data.checkConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CheckConstraint", "checkConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CheckConstraint', + 'checkConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraint", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CheckConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "checkConstraint": data.checkConstraints?.nodes?.[0] ?? null - }) + checkConstraint: data.checkConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CheckConstraint", "createCheckConstraint", "checkConstraint", args.select, args.data, "CreateCheckConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CheckConstraint', + 'createCheckConstraint', + 'checkConstraint', + args.select, + args.data, + 'CreateCheckConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "createCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'createCheckConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CheckConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CheckConstraint", "updateCheckConstraint", "checkConstraint", args.select, args.where.id, args.data, "UpdateCheckConstraintInput", "id", "checkConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CheckConstraint', + 'updateCheckConstraint', + 'checkConstraint', + args.select, + args.where.id, + args.data, + 'UpdateCheckConstraintInput', + 'id', + 'checkConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "updateCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'updateCheckConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CheckConstraint", "deleteCheckConstraint", "checkConstraint", { - id: args.where.id - }, "DeleteCheckConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CheckConstraint', + 'deleteCheckConstraint', + 'checkConstraint', + { + id: args.where.id, + }, + 'DeleteCheckConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "deleteCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'deleteCheckConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/compositeType.ts b/sdk/constructive-react/src/api/orm/models/compositeType.ts index b9da115bea..72f4ab3adf 100644 --- a/sdk/constructive-react/src/api/orm/models/compositeType.ts +++ b/sdk/constructive-react/src/api/orm/models/compositeType.ts @@ -3,56 +3,96 @@ * @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 { CompositeType, CompositeTypeWithRelations, CompositeTypeSelect, CompositeTypeFilter, CompositeTypeOrderBy, CreateCompositeTypeInput, UpdateCompositeTypeInput, CompositeTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CompositeType, + CompositeTypeWithRelations, + CompositeTypeSelect, + CompositeTypeFilter, + CompositeTypeOrderBy, + CreateCompositeTypeInput, + UpdateCompositeTypeInput, + CompositeTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CompositeTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CompositeType", "compositeTypes", 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 - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CompositeType', + 'compositeTypes', + 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, + }, + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeTypes", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CompositeType", "compositeTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CompositeType', + 'compositeTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeType", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CompositeTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "compositeType": data.compositeTypes?.nodes?.[0] ?? null - }) + compositeType: data.compositeTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CompositeType", "compositeTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CompositeType', + 'compositeTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeType", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CompositeTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "compositeType": data.compositeTypes?.nodes?.[0] ?? null - }) + compositeType: data.compositeTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CompositeType", "createCompositeType", "compositeType", args.select, args.data, "CreateCompositeTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CompositeType', + 'createCompositeType', + 'compositeType', + args.select, + args.data, + 'CreateCompositeTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "createCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'createCompositeType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CompositeTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CompositeType", "updateCompositeType", "compositeType", args.select, args.where.id, args.data, "UpdateCompositeTypeInput", "id", "compositeTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CompositeType', + 'updateCompositeType', + 'compositeType', + args.select, + args.where.id, + args.data, + 'UpdateCompositeTypeInput', + 'id', + 'compositeTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "updateCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'updateCompositeType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CompositeType", "deleteCompositeType", "compositeType", { - id: args.where.id - }, "DeleteCompositeTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CompositeType', + 'deleteCompositeType', + 'compositeType', + { + id: args.where.id, + }, + 'DeleteCompositeTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "deleteCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'deleteCompositeType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/corsSetting.ts b/sdk/constructive-react/src/api/orm/models/corsSetting.ts index 27feb0bf5a..2e37465f00 100644 --- a/sdk/constructive-react/src/api/orm/models/corsSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/corsSetting.ts @@ -3,56 +3,96 @@ * @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 { CorsSetting, CorsSettingWithRelations, CorsSettingSelect, CorsSettingFilter, CorsSettingOrderBy, CreateCorsSettingInput, UpdateCorsSettingInput, CorsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CorsSetting, + CorsSettingWithRelations, + CorsSettingSelect, + CorsSettingFilter, + CorsSettingOrderBy, + CreateCorsSettingInput, + UpdateCorsSettingInput, + CorsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CorsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CorsSetting", "corsSettings", 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 - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CorsSetting', + 'corsSettings', + 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, + }, + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSettings", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CorsSetting", "corsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CorsSetting', + 'corsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSetting", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "corsSetting": data.corsSettings?.nodes?.[0] ?? null - }) + corsSetting: data.corsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CorsSetting", "corsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CorsSetting', + 'corsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSetting", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "corsSetting": data.corsSettings?.nodes?.[0] ?? null - }) + corsSetting: data.corsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CorsSetting", "createCorsSetting", "corsSetting", args.select, args.data, "CreateCorsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CorsSetting', + 'createCorsSetting', + 'corsSetting', + args.select, + args.data, + 'CreateCorsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "createCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'createCorsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CorsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CorsSetting", "updateCorsSetting", "corsSetting", args.select, args.where.id, args.data, "UpdateCorsSettingInput", "id", "corsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CorsSetting', + 'updateCorsSetting', + 'corsSetting', + args.select, + args.where.id, + args.data, + 'UpdateCorsSettingInput', + 'id', + 'corsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "updateCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'updateCorsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CorsSetting", "deleteCorsSetting", "corsSetting", { - id: args.where.id - }, "DeleteCorsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CorsSetting', + 'deleteCorsSetting', + 'corsSetting', + { + id: args.where.id, + }, + 'DeleteCorsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "deleteCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'deleteCorsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/database.ts b/sdk/constructive-react/src/api/orm/models/database.ts index 4ce0f8c1b5..41c99ba120 100644 --- a/sdk/constructive-react/src/api/orm/models/database.ts +++ b/sdk/constructive-react/src/api/orm/models/database.ts @@ -3,56 +3,96 @@ * @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 { Database, DatabaseWithRelations, DatabaseSelect, DatabaseFilter, DatabaseOrderBy, CreateDatabaseInput, UpdateDatabaseInput, DatabasePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Database, + DatabaseWithRelations, + DatabaseSelect, + DatabaseFilter, + DatabaseOrderBy, + CreateDatabaseInput, + UpdateDatabaseInput, + DatabasePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databases: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Database", "databases", 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 - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Database', + 'databases', + 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, + }, + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "databases", + operation: 'query', + operationName: 'Database', + fieldName: 'databases', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ database: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Database", "databases", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Database', + 'databases', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "database", + operation: 'query', + operationName: 'Database', + fieldName: 'database', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseModel { nodes?: InferSelectResult[]; }; }) => ({ - "database": data.databases?.nodes?.[0] ?? null - }) + database: data.databases?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ database: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Database", "databases", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Database', + 'databases', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "database", + operation: 'query', + operationName: 'Database', + fieldName: 'database', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseModel { nodes?: InferSelectResult[]; }; }) => ({ - "database": data.databases?.nodes?.[0] ?? null - }) + database: data.databases?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Database", "createDatabase", "database", args.select, args.data, "CreateDatabaseInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Database', + 'createDatabase', + 'database', + args.select, + args.data, + 'CreateDatabaseInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "createDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'createDatabase', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabasePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Database", "updateDatabase", "database", args.select, args.where.id, args.data, "UpdateDatabaseInput", "id", "databasePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Database', + 'updateDatabase', + 'database', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseInput', + 'id', + 'databasePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "updateDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'updateDatabase', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Database", "deleteDatabase", "database", { - id: args.where.id - }, "DeleteDatabaseInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Database', + 'deleteDatabase', + 'database', + { + id: args.where.id, + }, + 'DeleteDatabaseInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "deleteDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'deleteDatabase', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/databaseSetting.ts b/sdk/constructive-react/src/api/orm/models/databaseSetting.ts index 8060f8c85d..6743fdbdc2 100644 --- a/sdk/constructive-react/src/api/orm/models/databaseSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/databaseSetting.ts @@ -3,56 +3,96 @@ * @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 { DatabaseSetting, DatabaseSettingWithRelations, DatabaseSettingSelect, DatabaseSettingFilter, DatabaseSettingOrderBy, CreateDatabaseSettingInput, UpdateDatabaseSettingInput, DatabaseSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseSetting, + DatabaseSettingWithRelations, + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy, + CreateDatabaseSettingInput, + UpdateDatabaseSettingInput, + DatabaseSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSetting", "databaseSettings", 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 - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseSetting', + 'databaseSettings', + 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, + }, + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSettings", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseSetting", "databaseSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseSetting', + 'databaseSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSetting", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSetting": data.databaseSettings?.nodes?.[0] ?? null - }) + databaseSetting: data.databaseSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSetting", "databaseSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseSetting', + 'databaseSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSetting", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSetting": data.databaseSettings?.nodes?.[0] ?? null - }) + databaseSetting: data.databaseSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseSetting", "createDatabaseSetting", "databaseSetting", args.select, args.data, "CreateDatabaseSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseSetting', + 'createDatabaseSetting', + 'databaseSetting', + args.select, + args.data, + 'CreateDatabaseSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "createDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'createDatabaseSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseSetting", "updateDatabaseSetting", "databaseSetting", args.select, args.where.id, args.data, "UpdateDatabaseSettingInput", "id", "databaseSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseSetting', + 'updateDatabaseSetting', + 'databaseSetting', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseSettingInput', + 'id', + 'databaseSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "updateDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'updateDatabaseSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseSetting", "deleteDatabaseSetting", "databaseSetting", { - id: args.where.id - }, "DeleteDatabaseSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseSetting', + 'deleteDatabaseSetting', + 'databaseSetting', + { + id: args.where.id, + }, + 'DeleteDatabaseSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "deleteDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'deleteDatabaseSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/databaseTransfer.ts b/sdk/constructive-react/src/api/orm/models/databaseTransfer.ts index 76caea1f6d..9260ed2fb7 100644 --- a/sdk/constructive-react/src/api/orm/models/databaseTransfer.ts +++ b/sdk/constructive-react/src/api/orm/models/databaseTransfer.ts @@ -3,56 +3,96 @@ * @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 { DatabaseTransfer, DatabaseTransferWithRelations, DatabaseTransferSelect, DatabaseTransferFilter, DatabaseTransferOrderBy, CreateDatabaseTransferInput, UpdateDatabaseTransferInput, DatabaseTransferPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseTransfer, + DatabaseTransferWithRelations, + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy, + CreateDatabaseTransferInput, + UpdateDatabaseTransferInput, + DatabaseTransferPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseTransferModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseTransfer", "databaseTransfers", 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 - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseTransfer', + 'databaseTransfers', + 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, + }, + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfers", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfer: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseTransfer", "databaseTransfers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseTransfer', + 'databaseTransfers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfer", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfer', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseTransferModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseTransfer": data.databaseTransfers?.nodes?.[0] ?? null - }) + databaseTransfer: data.databaseTransfers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfer: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseTransfer", "databaseTransfers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseTransfer', + 'databaseTransfers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfer", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfer', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseTransferModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseTransfer": data.databaseTransfers?.nodes?.[0] ?? null - }) + databaseTransfer: data.databaseTransfers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseTransfer", "createDatabaseTransfer", "databaseTransfer", args.select, args.data, "CreateDatabaseTransferInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseTransfer', + 'createDatabaseTransfer', + 'databaseTransfer', + args.select, + args.data, + 'CreateDatabaseTransferInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "createDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'createDatabaseTransfer', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseTransferPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseTransfer", "updateDatabaseTransfer", "databaseTransfer", args.select, args.where.id, args.data, "UpdateDatabaseTransferInput", "id", "databaseTransferPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseTransfer', + 'updateDatabaseTransfer', + 'databaseTransfer', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseTransferInput', + 'id', + 'databaseTransferPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "updateDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'updateDatabaseTransfer', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseTransfer", "deleteDatabaseTransfer", "databaseTransfer", { - id: args.where.id - }, "DeleteDatabaseTransferInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseTransfer', + 'deleteDatabaseTransfer', + 'databaseTransfer', + { + id: args.where.id, + }, + 'DeleteDatabaseTransferInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "deleteDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'deleteDatabaseTransfer', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/defaultPrivilege.ts b/sdk/constructive-react/src/api/orm/models/defaultPrivilege.ts index dc42720521..8d964bf6a4 100644 --- a/sdk/constructive-react/src/api/orm/models/defaultPrivilege.ts +++ b/sdk/constructive-react/src/api/orm/models/defaultPrivilege.ts @@ -3,56 +3,96 @@ * @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 { DefaultPrivilege, DefaultPrivilegeWithRelations, DefaultPrivilegeSelect, DefaultPrivilegeFilter, DefaultPrivilegeOrderBy, CreateDefaultPrivilegeInput, UpdateDefaultPrivilegeInput, DefaultPrivilegePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DefaultPrivilege, + DefaultPrivilegeWithRelations, + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy, + CreateDefaultPrivilegeInput, + UpdateDefaultPrivilegeInput, + DefaultPrivilegePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DefaultPrivilegeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivileges: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultPrivilege", "defaultPrivileges", 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 - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + 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, + }, + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivileges", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivileges', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivilege: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DefaultPrivilege", "defaultPrivileges", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivilege", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivilege', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DefaultPrivilegeModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultPrivilege": data.defaultPrivileges?.nodes?.[0] ?? null - }) + defaultPrivilege: data.defaultPrivileges?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivilege: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultPrivilege", "defaultPrivileges", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivilege", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivilege', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DefaultPrivilegeModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultPrivilege": data.defaultPrivileges?.nodes?.[0] ?? null - }) + defaultPrivilege: data.defaultPrivileges?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DefaultPrivilege", "createDefaultPrivilege", "defaultPrivilege", args.select, args.data, "CreateDefaultPrivilegeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DefaultPrivilege', + 'createDefaultPrivilege', + 'defaultPrivilege', + args.select, + args.data, + 'CreateDefaultPrivilegeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "createDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'createDefaultPrivilege', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DefaultPrivilegePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DefaultPrivilege", "updateDefaultPrivilege", "defaultPrivilege", args.select, args.where.id, args.data, "UpdateDefaultPrivilegeInput", "id", "defaultPrivilegePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DefaultPrivilege', + 'updateDefaultPrivilege', + 'defaultPrivilege', + args.select, + args.where.id, + args.data, + 'UpdateDefaultPrivilegeInput', + 'id', + 'defaultPrivilegePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "updateDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'updateDefaultPrivilege', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DefaultPrivilege", "deleteDefaultPrivilege", "defaultPrivilege", { - id: args.where.id - }, "DeleteDefaultPrivilegeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DefaultPrivilege', + 'deleteDefaultPrivilege', + 'defaultPrivilege', + { + id: args.where.id, + }, + 'DeleteDefaultPrivilegeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "deleteDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'deleteDefaultPrivilege', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/domain.ts b/sdk/constructive-react/src/api/orm/models/domain.ts index 1576b5451f..d5d807ae4c 100644 --- a/sdk/constructive-react/src/api/orm/models/domain.ts +++ b/sdk/constructive-react/src/api/orm/models/domain.ts @@ -3,56 +3,96 @@ * @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 { Domain, DomainWithRelations, DomainSelect, DomainFilter, DomainOrderBy, CreateDomainInput, UpdateDomainInput, DomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Domain, + DomainWithRelations, + DomainSelect, + DomainFilter, + DomainOrderBy, + CreateDomainInput, + UpdateDomainInput, + DomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Domain", "domains", 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 - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Domain', + 'domains', + 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, + }, + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domains", + operation: 'query', + operationName: 'Domain', + fieldName: 'domains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Domain", "domains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Domain', + 'domains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domain", + operation: 'query', + operationName: 'Domain', + fieldName: 'domain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "domain": data.domains?.nodes?.[0] ?? null - }) + domain: data.domains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Domain", "domains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Domain', + 'domains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domain", + operation: 'query', + operationName: 'Domain', + fieldName: 'domain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "domain": data.domains?.nodes?.[0] ?? null - }) + domain: data.domains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Domain", "createDomain", "domain", args.select, args.data, "CreateDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Domain', + 'createDomain', + 'domain', + args.select, + args.data, + 'CreateDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "createDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'createDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Domain", "updateDomain", "domain", args.select, args.where.id, args.data, "UpdateDomainInput", "id", "domainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Domain', + 'updateDomain', + 'domain', + args.select, + args.where.id, + args.data, + 'UpdateDomainInput', + 'id', + 'domainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "updateDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'updateDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Domain", "deleteDomain", "domain", { - id: args.where.id - }, "DeleteDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Domain', + 'deleteDomain', + 'domain', + { + id: args.where.id, + }, + 'DeleteDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "deleteDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'deleteDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/domainEvent.ts b/sdk/constructive-react/src/api/orm/models/domainEvent.ts index a490c9c31f..7177a72702 100644 --- a/sdk/constructive-react/src/api/orm/models/domainEvent.ts +++ b/sdk/constructive-react/src/api/orm/models/domainEvent.ts @@ -3,56 +3,96 @@ * @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 { DomainEvent, DomainEventWithRelations, DomainEventSelect, DomainEventFilter, DomainEventOrderBy, CreateDomainEventInput, UpdateDomainEventInput, DomainEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainEvent, + DomainEventWithRelations, + DomainEventSelect, + DomainEventFilter, + DomainEventOrderBy, + CreateDomainEventInput, + UpdateDomainEventInput, + DomainEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainEvent", "domainEvents", 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 - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainEvent', + 'domainEvents', + 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, + }, + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvents", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainEvent", "domainEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainEvent', + 'domainEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvent", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainEvent": data.domainEvents?.nodes?.[0] ?? null - }) + domainEvent: data.domainEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainEvent", "domainEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainEvent', + 'domainEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvent", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainEvent": data.domainEvents?.nodes?.[0] ?? null - }) + domainEvent: data.domainEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainEvent", "createDomainEvent", "domainEvent", args.select, args.data, "CreateDomainEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainEvent', + 'createDomainEvent', + 'domainEvent', + args.select, + args.data, + 'CreateDomainEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "createDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'createDomainEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainEvent", "updateDomainEvent", "domainEvent", args.select, args.where.id, args.data, "UpdateDomainEventInput", "id", "domainEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainEvent', + 'updateDomainEvent', + 'domainEvent', + args.select, + args.where.id, + args.data, + 'UpdateDomainEventInput', + 'id', + 'domainEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "updateDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'updateDomainEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainEvent", "deleteDomainEvent", "domainEvent", { - id: args.where.id - }, "DeleteDomainEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainEvent', + 'deleteDomainEvent', + 'domainEvent', + { + id: args.where.id, + }, + 'DeleteDomainEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "deleteDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'deleteDomainEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/domainVerification.ts b/sdk/constructive-react/src/api/orm/models/domainVerification.ts index 60c8c2572f..b004e0b4da 100644 --- a/sdk/constructive-react/src/api/orm/models/domainVerification.ts +++ b/sdk/constructive-react/src/api/orm/models/domainVerification.ts @@ -3,56 +3,96 @@ * @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 { DomainVerification, DomainVerificationWithRelations, DomainVerificationSelect, DomainVerificationFilter, DomainVerificationOrderBy, CreateDomainVerificationInput, UpdateDomainVerificationInput, DomainVerificationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainVerification, + DomainVerificationWithRelations, + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy, + CreateDomainVerificationInput, + UpdateDomainVerificationInput, + DomainVerificationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainVerificationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerifications: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainVerification", "domainVerifications", 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 - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainVerification', + 'domainVerifications', + 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, + }, + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerifications", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerifications', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerification: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainVerification", "domainVerifications", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainVerification', + 'domainVerifications', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerification", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerification', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainVerification": data.domainVerifications?.nodes?.[0] ?? null - }) + domainVerification: data.domainVerifications?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerification: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainVerification", "domainVerifications", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainVerification', + 'domainVerifications', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerification", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerification', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainVerification": data.domainVerifications?.nodes?.[0] ?? null - }) + domainVerification: data.domainVerifications?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainVerification", "createDomainVerification", "domainVerification", args.select, args.data, "CreateDomainVerificationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainVerification', + 'createDomainVerification', + 'domainVerification', + args.select, + args.data, + 'CreateDomainVerificationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "createDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'createDomainVerification', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainVerificationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainVerification", "updateDomainVerification", "domainVerification", args.select, args.where.id, args.data, "UpdateDomainVerificationInput", "id", "domainVerificationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainVerification', + 'updateDomainVerification', + 'domainVerification', + args.select, + args.where.id, + args.data, + 'UpdateDomainVerificationInput', + 'id', + 'domainVerificationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "updateDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'updateDomainVerification', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainVerification", "deleteDomainVerification", "domainVerification", { - id: args.where.id - }, "DeleteDomainVerificationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainVerification', + 'deleteDomainVerification', + 'domainVerification', + { + id: args.where.id, + }, + 'DeleteDomainVerificationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "deleteDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'deleteDomainVerification', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/embeddingChunk.ts b/sdk/constructive-react/src/api/orm/models/embeddingChunk.ts index 5b0eae38d8..90af6f51a9 100644 --- a/sdk/constructive-react/src/api/orm/models/embeddingChunk.ts +++ b/sdk/constructive-react/src/api/orm/models/embeddingChunk.ts @@ -3,56 +3,96 @@ * @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 { EmbeddingChunk, EmbeddingChunkWithRelations, EmbeddingChunkSelect, EmbeddingChunkFilter, EmbeddingChunkOrderBy, CreateEmbeddingChunkInput, UpdateEmbeddingChunkInput, EmbeddingChunkPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EmbeddingChunk, + EmbeddingChunkWithRelations, + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy, + CreateEmbeddingChunkInput, + UpdateEmbeddingChunkInput, + EmbeddingChunkPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmbeddingChunkModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EmbeddingChunk", "embeddingChunks", 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 - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EmbeddingChunk', + 'embeddingChunks', + 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, + }, + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunks", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EmbeddingChunk", "embeddingChunks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EmbeddingChunk', + 'embeddingChunks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunk", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunk', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmbeddingChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "embeddingChunk": data.embeddingChunks?.nodes?.[0] ?? null - }) + embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EmbeddingChunk", "embeddingChunks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EmbeddingChunk', + 'embeddingChunks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunk", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunk', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmbeddingChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "embeddingChunk": data.embeddingChunks?.nodes?.[0] ?? null - }) + embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EmbeddingChunk", "createEmbeddingChunk", "embeddingChunk", args.select, args.data, "CreateEmbeddingChunkInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EmbeddingChunk', + 'createEmbeddingChunk', + 'embeddingChunk', + args.select, + args.data, + 'CreateEmbeddingChunkInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "createEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'createEmbeddingChunk', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmbeddingChunkPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EmbeddingChunk", "updateEmbeddingChunk", "embeddingChunk", args.select, args.where.id, args.data, "UpdateEmbeddingChunkInput", "id", "embeddingChunkPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EmbeddingChunk', + 'updateEmbeddingChunk', + 'embeddingChunk', + args.select, + args.where.id, + args.data, + 'UpdateEmbeddingChunkInput', + 'id', + 'embeddingChunkPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "updateEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'updateEmbeddingChunk', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EmbeddingChunk", "deleteEmbeddingChunk", "embeddingChunk", { - id: args.where.id - }, "DeleteEmbeddingChunkInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EmbeddingChunk', + 'deleteEmbeddingChunk', + 'embeddingChunk', + { + id: args.where.id, + }, + 'DeleteEmbeddingChunkInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "deleteEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'deleteEmbeddingChunk', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/enum.ts b/sdk/constructive-react/src/api/orm/models/enum.ts index a8face956a..b5f965ea6f 100644 --- a/sdk/constructive-react/src/api/orm/models/enum.ts +++ b/sdk/constructive-react/src/api/orm/models/enum.ts @@ -3,56 +3,96 @@ * @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 { Enum, EnumWithRelations, EnumSelect, EnumFilter, EnumOrderBy, CreateEnumInput, UpdateEnumInput, EnumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Enum, + EnumWithRelations, + EnumSelect, + EnumFilter, + EnumOrderBy, + CreateEnumInput, + UpdateEnumInput, + EnumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EnumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ enums: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Enum", "enums", 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 - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Enum', + 'enums', + 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, + }, + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enums", + operation: 'query', + operationName: 'Enum', + fieldName: 'enums', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ enum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Enum", "enums", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Enum', + 'enums', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enum", + operation: 'query', + operationName: 'Enum', + fieldName: 'enum', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EnumModel { nodes?: InferSelectResult[]; }; }) => ({ - "enum": data.enums?.nodes?.[0] ?? null - }) + enum: data.enums?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ enum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Enum", "enums", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Enum', + 'enums', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enum", + operation: 'query', + operationName: 'Enum', + fieldName: 'enum', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EnumModel { nodes?: InferSelectResult[]; }; }) => ({ - "enum": data.enums?.nodes?.[0] ?? null - }) + enum: data.enums?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Enum", "createEnum", "enum", args.select, args.data, "CreateEnumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Enum', + 'createEnum', + 'enum', + args.select, + args.data, + 'CreateEnumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "createEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'createEnum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EnumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Enum", "updateEnum", "enum", args.select, args.where.id, args.data, "UpdateEnumInput", "id", "enumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Enum', + 'updateEnum', + 'enum', + args.select, + args.where.id, + args.data, + 'UpdateEnumInput', + 'id', + 'enumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "updateEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'updateEnum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Enum", "deleteEnum", "enum", { - id: args.where.id - }, "DeleteEnumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Enum', + 'deleteEnum', + 'enum', + { + id: args.where.id, + }, + 'DeleteEnumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "deleteEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'deleteEnum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/exclusionConstraint.ts b/sdk/constructive-react/src/api/orm/models/exclusionConstraint.ts index a0d6320772..6cc388e197 100644 --- a/sdk/constructive-react/src/api/orm/models/exclusionConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/exclusionConstraint.ts @@ -3,56 +3,96 @@ * @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 { ExclusionConstraint, ExclusionConstraintWithRelations, ExclusionConstraintSelect, ExclusionConstraintFilter, ExclusionConstraintOrderBy, CreateExclusionConstraintInput, UpdateExclusionConstraintInput, ExclusionConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ExclusionConstraint, + ExclusionConstraintWithRelations, + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy, + CreateExclusionConstraintInput, + UpdateExclusionConstraintInput, + ExclusionConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ExclusionConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ExclusionConstraint", "exclusionConstraints", 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 - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + 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, + }, + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraints", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ExclusionConstraint", "exclusionConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraint", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ExclusionConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "exclusionConstraint": data.exclusionConstraints?.nodes?.[0] ?? null - }) + exclusionConstraint: data.exclusionConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ExclusionConstraint", "exclusionConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraint", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ExclusionConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "exclusionConstraint": data.exclusionConstraints?.nodes?.[0] ?? null - }) + exclusionConstraint: data.exclusionConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ExclusionConstraint", "createExclusionConstraint", "exclusionConstraint", args.select, args.data, "CreateExclusionConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ExclusionConstraint', + 'createExclusionConstraint', + 'exclusionConstraint', + args.select, + args.data, + 'CreateExclusionConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "createExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'createExclusionConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ExclusionConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ExclusionConstraint", "updateExclusionConstraint", "exclusionConstraint", args.select, args.where.id, args.data, "UpdateExclusionConstraintInput", "id", "exclusionConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ExclusionConstraint', + 'updateExclusionConstraint', + 'exclusionConstraint', + args.select, + args.where.id, + args.data, + 'UpdateExclusionConstraintInput', + 'id', + 'exclusionConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "updateExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'updateExclusionConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ExclusionConstraint", "deleteExclusionConstraint", "exclusionConstraint", { - id: args.where.id - }, "DeleteExclusionConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ExclusionConstraint', + 'deleteExclusionConstraint', + 'exclusionConstraint', + { + id: args.where.id, + }, + 'DeleteExclusionConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "deleteExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'deleteExclusionConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/field.ts b/sdk/constructive-react/src/api/orm/models/field.ts index 28d34da746..baa1994dbd 100644 --- a/sdk/constructive-react/src/api/orm/models/field.ts +++ b/sdk/constructive-react/src/api/orm/models/field.ts @@ -3,56 +3,96 @@ * @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 { Field, FieldWithRelations, FieldSelect, FieldFilter, FieldOrderBy, CreateFieldInput, UpdateFieldInput, FieldPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Field, + FieldWithRelations, + FieldSelect, + FieldFilter, + FieldOrderBy, + CreateFieldInput, + UpdateFieldInput, + FieldPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FieldModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fields: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Field", "fields", 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 - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Field', + 'fields', + 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, + }, + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "fields", + operation: 'query', + operationName: 'Field', + fieldName: 'fields', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ field: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Field", "fields", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Field', + 'fields', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "field", + operation: 'query', + operationName: 'Field', + fieldName: 'field', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "field": data.fields?.nodes?.[0] ?? null - }) + field: data.fields?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ field: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Field", "fields", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Field', + 'fields', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "field", + operation: 'query', + operationName: 'Field', + fieldName: 'field', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "field": data.fields?.nodes?.[0] ?? null - }) + field: data.fields?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Field", "createField", "field", args.select, args.data, "CreateFieldInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Field', + 'createField', + 'field', + args.select, + args.data, + 'CreateFieldInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "createField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'createField', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FieldPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Field", "updateField", "field", args.select, args.where.id, args.data, "UpdateFieldInput", "id", "fieldPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Field', + 'updateField', + 'field', + args.select, + args.where.id, + args.data, + 'UpdateFieldInput', + 'id', + 'fieldPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "updateField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'updateField', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Field", "deleteField", "field", { - id: args.where.id - }, "DeleteFieldInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Field', + 'deleteField', + 'field', + { + id: args.where.id, + }, + 'DeleteFieldInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "deleteField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'deleteField', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/foreignKeyConstraint.ts b/sdk/constructive-react/src/api/orm/models/foreignKeyConstraint.ts index 9d86ea7aa5..498b987bd0 100644 --- a/sdk/constructive-react/src/api/orm/models/foreignKeyConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/foreignKeyConstraint.ts @@ -3,56 +3,98 @@ * @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 { ForeignKeyConstraint, ForeignKeyConstraintWithRelations, ForeignKeyConstraintSelect, ForeignKeyConstraintFilter, ForeignKeyConstraintOrderBy, CreateForeignKeyConstraintInput, UpdateForeignKeyConstraintInput, ForeignKeyConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ForeignKeyConstraint, + ForeignKeyConstraintWithRelations, + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy, + CreateForeignKeyConstraintInput, + UpdateForeignKeyConstraintInput, + ForeignKeyConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ForeignKeyConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - foreignKeyConstraints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + foreignKeyConstraints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ForeignKeyConstraint", "foreignKeyConstraints", 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 - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + 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, + }, + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraints", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ foreignKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ForeignKeyConstraint", "foreignKeyConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraint", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ForeignKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "foreignKeyConstraint": data.foreignKeyConstraints?.nodes?.[0] ?? null - }) + foreignKeyConstraint: data.foreignKeyConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ foreignKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ForeignKeyConstraint", "foreignKeyConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraint", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ForeignKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "foreignKeyConstraint": data.foreignKeyConstraints?.nodes?.[0] ?? null - }) + foreignKeyConstraint: data.foreignKeyConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ForeignKeyConstraint", "createForeignKeyConstraint", "foreignKeyConstraint", args.select, args.data, "CreateForeignKeyConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ForeignKeyConstraint', + 'createForeignKeyConstraint', + 'foreignKeyConstraint', + args.select, + args.data, + 'CreateForeignKeyConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "createForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'createForeignKeyConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ForeignKeyConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ForeignKeyConstraint", "updateForeignKeyConstraint", "foreignKeyConstraint", args.select, args.where.id, args.data, "UpdateForeignKeyConstraintInput", "id", "foreignKeyConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ForeignKeyConstraint', + 'updateForeignKeyConstraint', + 'foreignKeyConstraint', + args.select, + args.where.id, + args.data, + 'UpdateForeignKeyConstraintInput', + 'id', + 'foreignKeyConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "updateForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'updateForeignKeyConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ForeignKeyConstraint", "deleteForeignKeyConstraint", "foreignKeyConstraint", { - id: args.where.id - }, "DeleteForeignKeyConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ForeignKeyConstraint', + 'deleteForeignKeyConstraint', + 'foreignKeyConstraint', + { + id: args.where.id, + }, + 'DeleteForeignKeyConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "deleteForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'deleteForeignKeyConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/fullTextSearch.ts b/sdk/constructive-react/src/api/orm/models/fullTextSearch.ts index 25db3c0ee1..1fc50cde73 100644 --- a/sdk/constructive-react/src/api/orm/models/fullTextSearch.ts +++ b/sdk/constructive-react/src/api/orm/models/fullTextSearch.ts @@ -3,56 +3,96 @@ * @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 { FullTextSearch, FullTextSearchWithRelations, FullTextSearchSelect, FullTextSearchFilter, FullTextSearchOrderBy, CreateFullTextSearchInput, UpdateFullTextSearchInput, FullTextSearchPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FullTextSearch, + FullTextSearchWithRelations, + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy, + CreateFullTextSearchInput, + UpdateFullTextSearchInput, + FullTextSearchPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FullTextSearchModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearches: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FullTextSearch", "fullTextSearches", 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 - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FullTextSearch', + 'fullTextSearches', + 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, + }, + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearches", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearches', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearch: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FullTextSearch", "fullTextSearches", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FullTextSearch', + 'fullTextSearches', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearch", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearch', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FullTextSearchModel { nodes?: InferSelectResult[]; }; }) => ({ - "fullTextSearch": data.fullTextSearches?.nodes?.[0] ?? null - }) + fullTextSearch: data.fullTextSearches?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearch: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FullTextSearch", "fullTextSearches", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FullTextSearch', + 'fullTextSearches', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearch", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearch', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FullTextSearchModel { nodes?: InferSelectResult[]; }; }) => ({ - "fullTextSearch": data.fullTextSearches?.nodes?.[0] ?? null - }) + fullTextSearch: data.fullTextSearches?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FullTextSearch", "createFullTextSearch", "fullTextSearch", args.select, args.data, "CreateFullTextSearchInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FullTextSearch', + 'createFullTextSearch', + 'fullTextSearch', + args.select, + args.data, + 'CreateFullTextSearchInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "createFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'createFullTextSearch', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FullTextSearchPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FullTextSearch", "updateFullTextSearch", "fullTextSearch", args.select, args.where.id, args.data, "UpdateFullTextSearchInput", "id", "fullTextSearchPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FullTextSearch', + 'updateFullTextSearch', + 'fullTextSearch', + args.select, + args.where.id, + args.data, + 'UpdateFullTextSearchInput', + 'id', + 'fullTextSearchPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "updateFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'updateFullTextSearch', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FullTextSearch", "deleteFullTextSearch", "fullTextSearch", { - id: args.where.id - }, "DeleteFullTextSearchInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FullTextSearch', + 'deleteFullTextSearch', + 'fullTextSearch', + { + id: args.where.id, + }, + 'DeleteFullTextSearchInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "deleteFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'deleteFullTextSearch', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/function.ts b/sdk/constructive-react/src/api/orm/models/function.ts index 03d957378d..fc8fba9b21 100644 --- a/sdk/constructive-react/src/api/orm/models/function.ts +++ b/sdk/constructive-react/src/api/orm/models/function.ts @@ -3,56 +3,96 @@ * @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 { Function, FunctionWithRelations, FunctionSelect, FunctionFilter, FunctionOrderBy, CreateFunctionInput, UpdateFunctionInput, FunctionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Function, + FunctionWithRelations, + FunctionSelect, + FunctionFilter, + FunctionOrderBy, + CreateFunctionInput, + UpdateFunctionInput, + FunctionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Function", "functions", 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 - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Function', + 'functions', + 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, + }, + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "functions", + operation: 'query', + operationName: 'Function', + fieldName: 'functions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ function: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Function", "functions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Function', + 'functions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "function", + operation: 'query', + operationName: 'Function', + fieldName: 'function', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "function": data.functions?.nodes?.[0] ?? null - }) + function: data.functions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ function: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Function", "functions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Function', + 'functions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "function", + operation: 'query', + operationName: 'Function', + fieldName: 'function', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "function": data.functions?.nodes?.[0] ?? null - }) + function: data.functions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Function", "createFunction", "function", args.select, args.data, "CreateFunctionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Function', + 'createFunction', + 'function', + args.select, + args.data, + 'CreateFunctionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "createFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'createFunction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Function", "updateFunction", "function", args.select, args.where.id, args.data, "UpdateFunctionInput", "id", "functionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Function', + 'updateFunction', + 'function', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInput', + 'id', + 'functionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "updateFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'updateFunction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Function", "deleteFunction", "function", { - id: args.where.id - }, "DeleteFunctionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Function', + 'deleteFunction', + 'function', + { + id: args.where.id, + }, + 'DeleteFunctionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "deleteFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'deleteFunction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/hostnameBinding.ts b/sdk/constructive-react/src/api/orm/models/hostnameBinding.ts index 3e42c2f357..f720f177ad 100644 --- a/sdk/constructive-react/src/api/orm/models/hostnameBinding.ts +++ b/sdk/constructive-react/src/api/orm/models/hostnameBinding.ts @@ -3,56 +3,96 @@ * @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 { HostnameBinding, HostnameBindingWithRelations, HostnameBindingSelect, HostnameBindingFilter, HostnameBindingOrderBy, CreateHostnameBindingInput, UpdateHostnameBindingInput, HostnameBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HostnameBinding, + HostnameBindingWithRelations, + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy, + CreateHostnameBindingInput, + UpdateHostnameBindingInput, + HostnameBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HostnameBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HostnameBinding", "hostnameBindings", 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 - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HostnameBinding', + 'hostnameBindings', + 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, + }, + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBindings", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HostnameBinding", "hostnameBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HostnameBinding', + 'hostnameBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBinding", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HostnameBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "hostnameBinding": data.hostnameBindings?.nodes?.[0] ?? null - }) + hostnameBinding: data.hostnameBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HostnameBinding", "hostnameBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HostnameBinding', + 'hostnameBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBinding", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HostnameBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "hostnameBinding": data.hostnameBindings?.nodes?.[0] ?? null - }) + hostnameBinding: data.hostnameBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HostnameBinding", "createHostnameBinding", "hostnameBinding", args.select, args.data, "CreateHostnameBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HostnameBinding', + 'createHostnameBinding', + 'hostnameBinding', + args.select, + args.data, + 'CreateHostnameBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "createHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'createHostnameBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HostnameBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HostnameBinding", "updateHostnameBinding", "hostnameBinding", args.select, args.where.id, args.data, "UpdateHostnameBindingInput", "id", "hostnameBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HostnameBinding', + 'updateHostnameBinding', + 'hostnameBinding', + args.select, + args.where.id, + args.data, + 'UpdateHostnameBindingInput', + 'id', + 'hostnameBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "updateHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'updateHostnameBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HostnameBinding", "deleteHostnameBinding", "hostnameBinding", { - id: args.where.id - }, "DeleteHostnameBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HostnameBinding', + 'deleteHostnameBinding', + 'hostnameBinding', + { + id: args.where.id, + }, + 'DeleteHostnameBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "deleteHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'deleteHostnameBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/httpRoute.ts b/sdk/constructive-react/src/api/orm/models/httpRoute.ts index 3264e720b6..0af2bf2fac 100644 --- a/sdk/constructive-react/src/api/orm/models/httpRoute.ts +++ b/sdk/constructive-react/src/api/orm/models/httpRoute.ts @@ -3,56 +3,96 @@ * @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 { HttpRoute, HttpRouteWithRelations, HttpRouteSelect, HttpRouteFilter, HttpRouteOrderBy, CreateHttpRouteInput, UpdateHttpRouteInput, HttpRoutePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HttpRoute, + HttpRouteWithRelations, + HttpRouteSelect, + HttpRouteFilter, + HttpRouteOrderBy, + CreateHttpRouteInput, + UpdateHttpRouteInput, + HttpRoutePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HttpRouteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoutes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRoute", "httpRoutes", 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 - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HttpRoute', + 'httpRoutes', + 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, + }, + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoutes", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoutes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoute: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HttpRoute", "httpRoutes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HttpRoute', + 'httpRoutes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoute", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoute', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HttpRouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRoute": data.httpRoutes?.nodes?.[0] ?? null - }) + httpRoute: data.httpRoutes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoute: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRoute", "httpRoutes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HttpRoute', + 'httpRoutes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoute", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoute', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HttpRouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRoute": data.httpRoutes?.nodes?.[0] ?? null - }) + httpRoute: data.httpRoutes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HttpRoute", "createHttpRoute", "httpRoute", args.select, args.data, "CreateHttpRouteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HttpRoute', + 'createHttpRoute', + 'httpRoute', + args.select, + args.data, + 'CreateHttpRouteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "createHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'createHttpRoute', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HttpRoutePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HttpRoute", "updateHttpRoute", "httpRoute", args.select, args.where.id, args.data, "UpdateHttpRouteInput", "id", "httpRoutePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HttpRoute', + 'updateHttpRoute', + 'httpRoute', + args.select, + args.where.id, + args.data, + 'UpdateHttpRouteInput', + 'id', + 'httpRoutePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "updateHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'updateHttpRoute', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HttpRoute", "deleteHttpRoute", "httpRoute", { - id: args.where.id - }, "DeleteHttpRouteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HttpRoute', + 'deleteHttpRoute', + 'httpRoute', + { + id: args.where.id, + }, + 'DeleteHttpRouteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "deleteHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'deleteHttpRoute', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/index.ts b/sdk/constructive-react/src/api/orm/models/index.ts index ec8f8de6a3..a9bb5c2667 100644 --- a/sdk/constructive-react/src/api/orm/models/index.ts +++ b/sdk/constructive-react/src/api/orm/models/index.ts @@ -3,68 +3,68 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { ApiModel } from "./api"; -export { ApiModuleModel } from "./apiModule"; -export { ApiSchemaModel } from "./apiSchema"; -export { ApiSettingModel } from "./apiSetting"; -export { AstMigrationModel } from "./astMigration"; -export { CheckConstraintModel } from "./checkConstraint"; -export { CompositeTypeModel } from "./compositeType"; -export { CorsSettingModel } from "./corsSetting"; -export { DatabaseModel } from "./database"; -export { DatabaseSettingModel } from "./databaseSetting"; -export { DatabaseTransferModel } from "./databaseTransfer"; -export { DefaultPrivilegeModel } from "./defaultPrivilege"; -export { DomainModel } from "./domain"; -export { DomainEventModel } from "./domainEvent"; -export { DomainVerificationModel } from "./domainVerification"; -export { EmbeddingChunkModel } from "./embeddingChunk"; -export { EnumModel } from "./enum"; -export { ExclusionConstraintModel } from "./exclusionConstraint"; -export { FieldModel } from "./field"; -export { ForeignKeyConstraintModel } from "./foreignKeyConstraint"; -export { FullTextSearchModel } from "./fullTextSearch"; -export { FunctionModel } from "./function"; -export { HostnameBindingModel } from "./hostnameBinding"; -export { HttpRouteModel } from "./httpRoute"; -export { IndexModel } from "./indexModel"; -export { ManagedDomainModel } from "./managedDomain"; -export { NodeTypeRegistryModel } from "./nodeTypeRegistry"; -export { PartitionModel } from "./partition"; -export { PlatformApiModel } from "./platformApi"; -export { PlatformApiModuleModel } from "./platformApiModule"; -export { PlatformApiSchemaModel } from "./platformApiSchema"; -export { PlatformApiSettingModel } from "./platformApiSetting"; -export { PlatformCorsSettingModel } from "./platformCorsSetting"; -export { PlatformDomainModel } from "./platformDomain"; -export { PlatformDomainEventModel } from "./platformDomainEvent"; -export { PlatformDomainVerificationModel } from "./platformDomainVerification"; -export { PlatformManagedDomainModel } from "./platformManagedDomain"; -export { PlatformSiteModel } from "./platformSite"; -export { PlatformSiteMetadatumModel } from "./platformSiteMetadatum"; -export { PlatformSiteModuleModel } from "./platformSiteModule"; -export { PlatformSiteThemeModel } from "./platformSiteTheme"; -export { PolicyModel } from "./policy"; -export { PrimaryKeyConstraintModel } from "./primaryKeyConstraint"; -export { PubkeySettingModel } from "./pubkeySetting"; -export { RlsSettingModel } from "./rlsSetting"; -export { RouteBindingModel } from "./routeBinding"; -export { RouteModel } from "./route"; -export { SchemaModel } from "./schema"; -export { SchemaGrantModel } from "./schemaGrant"; -export { SiteModel } from "./site"; -export { SiteMetadatumModel } from "./siteMetadatum"; -export { SiteModuleModel } from "./siteModule"; -export { SiteThemeModel } from "./siteTheme"; -export { SpatialRelationModel } from "./spatialRelation"; -export { SqlActionModel } from "./sqlAction"; -export { TableModel } from "./table"; -export { TableGrantModel } from "./tableGrant"; -export { TriggerModel } from "./trigger"; -export { TriggerFunctionModel } from "./triggerFunction"; -export { UniqueConstraintModel } from "./uniqueConstraint"; -export { ViewModel } from "./view"; -export { ViewGrantModel } from "./viewGrant"; -export { ViewRuleModel } from "./viewRule"; -export { ViewTableModel } from "./viewTable"; -export { WebauthnSettingModel } from "./webauthnSetting"; \ No newline at end of file +export { ApiModel } from './api'; +export { ApiModuleModel } from './apiModule'; +export { ApiSchemaModel } from './apiSchema'; +export { ApiSettingModel } from './apiSetting'; +export { AstMigrationModel } from './astMigration'; +export { CheckConstraintModel } from './checkConstraint'; +export { CompositeTypeModel } from './compositeType'; +export { CorsSettingModel } from './corsSetting'; +export { DatabaseModel } from './database'; +export { DatabaseSettingModel } from './databaseSetting'; +export { DatabaseTransferModel } from './databaseTransfer'; +export { DefaultPrivilegeModel } from './defaultPrivilege'; +export { DomainModel } from './domain'; +export { DomainEventModel } from './domainEvent'; +export { DomainVerificationModel } from './domainVerification'; +export { EmbeddingChunkModel } from './embeddingChunk'; +export { EnumModel } from './enum'; +export { ExclusionConstraintModel } from './exclusionConstraint'; +export { FieldModel } from './field'; +export { ForeignKeyConstraintModel } from './foreignKeyConstraint'; +export { FullTextSearchModel } from './fullTextSearch'; +export { FunctionModel } from './function'; +export { HostnameBindingModel } from './hostnameBinding'; +export { HttpRouteModel } from './httpRoute'; +export { IndexModel } from './indexModel'; +export { ManagedDomainModel } from './managedDomain'; +export { NodeTypeRegistryModel } from './nodeTypeRegistry'; +export { PartitionModel } from './partition'; +export { PlatformApiModel } from './platformApi'; +export { PlatformApiModuleModel } from './platformApiModule'; +export { PlatformApiSchemaModel } from './platformApiSchema'; +export { PlatformApiSettingModel } from './platformApiSetting'; +export { PlatformCorsSettingModel } from './platformCorsSetting'; +export { PlatformDomainModel } from './platformDomain'; +export { PlatformDomainEventModel } from './platformDomainEvent'; +export { PlatformDomainVerificationModel } from './platformDomainVerification'; +export { PlatformManagedDomainModel } from './platformManagedDomain'; +export { PlatformSiteModel } from './platformSite'; +export { PlatformSiteMetadatumModel } from './platformSiteMetadatum'; +export { PlatformSiteModuleModel } from './platformSiteModule'; +export { PlatformSiteThemeModel } from './platformSiteTheme'; +export { PolicyModel } from './policy'; +export { PrimaryKeyConstraintModel } from './primaryKeyConstraint'; +export { PubkeySettingModel } from './pubkeySetting'; +export { RlsSettingModel } from './rlsSetting'; +export { RouteBindingModel } from './routeBinding'; +export { RouteModel } from './route'; +export { SchemaModel } from './schema'; +export { SchemaGrantModel } from './schemaGrant'; +export { SiteModel } from './site'; +export { SiteMetadatumModel } from './siteMetadatum'; +export { SiteModuleModel } from './siteModule'; +export { SiteThemeModel } from './siteTheme'; +export { SpatialRelationModel } from './spatialRelation'; +export { SqlActionModel } from './sqlAction'; +export { TableModel } from './table'; +export { TableGrantModel } from './tableGrant'; +export { TriggerModel } from './trigger'; +export { TriggerFunctionModel } from './triggerFunction'; +export { UniqueConstraintModel } from './uniqueConstraint'; +export { ViewModel } from './view'; +export { ViewGrantModel } from './viewGrant'; +export { ViewRuleModel } from './viewRule'; +export { ViewTableModel } from './viewTable'; +export { WebauthnSettingModel } from './webauthnSetting'; diff --git a/sdk/constructive-react/src/api/orm/models/indexModel.ts b/sdk/constructive-react/src/api/orm/models/indexModel.ts index 38ebd55b62..919849c835 100644 --- a/sdk/constructive-react/src/api/orm/models/indexModel.ts +++ b/sdk/constructive-react/src/api/orm/models/indexModel.ts @@ -3,56 +3,96 @@ * @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 { Index, IndexWithRelations, IndexSelect, IndexFilter, IndexOrderBy, CreateIndexInput, UpdateIndexInput, IndexPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Index, + IndexWithRelations, + IndexSelect, + IndexFilter, + IndexOrderBy, + CreateIndexInput, + UpdateIndexInput, + IndexPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IndexModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ indices: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Index", "indices", 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 - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Index', + 'indices', + 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, + }, + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "indices", + operation: 'query', + operationName: 'Index', + fieldName: 'indices', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ index: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Index", "indices", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Index', + 'indices', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "index", + operation: 'query', + operationName: 'Index', + fieldName: 'index', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class IndexModel { nodes?: InferSelectResult[]; }; }) => ({ - "index": data.indices?.nodes?.[0] ?? null - }) + index: data.indices?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ index: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Index", "indices", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Index', + 'indices', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "index", + operation: 'query', + operationName: 'Index', + fieldName: 'index', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class IndexModel { nodes?: InferSelectResult[]; }; }) => ({ - "index": data.indices?.nodes?.[0] ?? null - }) + index: data.indices?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Index", "createIndex", "index", args.select, args.data, "CreateIndexInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Index', + 'createIndex', + 'index', + args.select, + args.data, + 'CreateIndexInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "createIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'createIndex', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IndexPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Index", "updateIndex", "index", args.select, args.where.id, args.data, "UpdateIndexInput", "id", "indexPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Index', + 'updateIndex', + 'index', + args.select, + args.where.id, + args.data, + 'UpdateIndexInput', + 'id', + 'indexPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "updateIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'updateIndex', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Index", "deleteIndex", "index", { - id: args.where.id - }, "DeleteIndexInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Index', + 'deleteIndex', + 'index', + { + id: args.where.id, + }, + 'DeleteIndexInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "deleteIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'deleteIndex', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/managedDomain.ts b/sdk/constructive-react/src/api/orm/models/managedDomain.ts index 780919d989..8b93f6e1ac 100644 --- a/sdk/constructive-react/src/api/orm/models/managedDomain.ts +++ b/sdk/constructive-react/src/api/orm/models/managedDomain.ts @@ -3,56 +3,96 @@ * @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 { ManagedDomain, ManagedDomainWithRelations, ManagedDomainSelect, ManagedDomainFilter, ManagedDomainOrderBy, CreateManagedDomainInput, UpdateManagedDomainInput, ManagedDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ManagedDomain, + ManagedDomainWithRelations, + ManagedDomainSelect, + ManagedDomainFilter, + ManagedDomainOrderBy, + CreateManagedDomainInput, + UpdateManagedDomainInput, + ManagedDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ManagedDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ManagedDomain", "managedDomains", 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 - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ManagedDomain', + 'managedDomains', + 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, + }, + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomains", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ManagedDomain", "managedDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ManagedDomain', + 'managedDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomain", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "managedDomain": data.managedDomains?.nodes?.[0] ?? null - }) + managedDomain: data.managedDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ManagedDomain", "managedDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ManagedDomain', + 'managedDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomain", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "managedDomain": data.managedDomains?.nodes?.[0] ?? null - }) + managedDomain: data.managedDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ManagedDomain", "createManagedDomain", "managedDomain", args.select, args.data, "CreateManagedDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ManagedDomain', + 'createManagedDomain', + 'managedDomain', + args.select, + args.data, + 'CreateManagedDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "createManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'createManagedDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ManagedDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ManagedDomain", "updateManagedDomain", "managedDomain", args.select, args.where.id, args.data, "UpdateManagedDomainInput", "id", "managedDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ManagedDomain', + 'updateManagedDomain', + 'managedDomain', + args.select, + args.where.id, + args.data, + 'UpdateManagedDomainInput', + 'id', + 'managedDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "updateManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'updateManagedDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ManagedDomain", "deleteManagedDomain", "managedDomain", { - id: args.where.id - }, "DeleteManagedDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ManagedDomain', + 'deleteManagedDomain', + 'managedDomain', + { + id: args.where.id, + }, + 'DeleteManagedDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "deleteManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'deleteManagedDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/nodeTypeRegistry.ts b/sdk/constructive-react/src/api/orm/models/nodeTypeRegistry.ts index 0124074e7a..ab4670e925 100644 --- a/sdk/constructive-react/src/api/orm/models/nodeTypeRegistry.ts +++ b/sdk/constructive-react/src/api/orm/models/nodeTypeRegistry.ts @@ -3,56 +3,96 @@ * @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 { NodeTypeRegistry, NodeTypeRegistryWithRelations, NodeTypeRegistrySelect, NodeTypeRegistryFilter, NodeTypeRegistryOrderBy, CreateNodeTypeRegistryInput, UpdateNodeTypeRegistryInput, NodeTypeRegistryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NodeTypeRegistry, + NodeTypeRegistryWithRelations, + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy, + CreateNodeTypeRegistryInput, + UpdateNodeTypeRegistryInput, + NodeTypeRegistryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NodeTypeRegistryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistries: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NodeTypeRegistry", "nodeTypeRegistries", 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 - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + 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, + }, + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistries", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistry: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NodeTypeRegistry", "nodeTypeRegistries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistry", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistry', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NodeTypeRegistryModel { nodes?: InferSelectResult[]; }; }) => ({ - "nodeTypeRegistry": data.nodeTypeRegistries?.nodes?.[0] ?? null - }) + nodeTypeRegistry: data.nodeTypeRegistries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - name: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + name: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistry: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NodeTypeRegistry", "nodeTypeRegistries", args.select, { - where: { - name: { - equalTo: args.name - } + const { document, variables } = buildFindManyDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + args.select, + { + where: { + name: { + equalTo: args.name, + }, + }, + first: 1, }, - first: 1 - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistry", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistry', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NodeTypeRegistryModel { nodes?: InferSelectResult[]; }; }) => ({ - "nodeTypeRegistry": data.nodeTypeRegistries?.nodes?.[0] ?? null - }) + nodeTypeRegistry: data.nodeTypeRegistries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NodeTypeRegistry", "createNodeTypeRegistry", "nodeTypeRegistry", args.select, args.data, "CreateNodeTypeRegistryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NodeTypeRegistry', + 'createNodeTypeRegistry', + 'nodeTypeRegistry', + args.select, + args.data, + 'CreateNodeTypeRegistryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "createNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'createNodeTypeRegistry', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + name: string; + }, + NodeTypeRegistryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NodeTypeRegistry", "updateNodeTypeRegistry", "nodeTypeRegistry", args.select, args.where.name, args.data, "UpdateNodeTypeRegistryInput", "name", "nodeTypeRegistryPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NodeTypeRegistry', + 'updateNodeTypeRegistry', + 'nodeTypeRegistry', + args.select, + args.where.name, + args.data, + 'UpdateNodeTypeRegistryInput', + 'name', + 'nodeTypeRegistryPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "updateNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'updateNodeTypeRegistry', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - name: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + name: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NodeTypeRegistry", "deleteNodeTypeRegistry", "nodeTypeRegistry", { - name: args.where.name - }, "DeleteNodeTypeRegistryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NodeTypeRegistry', + 'deleteNodeTypeRegistry', + 'nodeTypeRegistry', + { + name: args.where.name, + }, + 'DeleteNodeTypeRegistryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "deleteNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'deleteNodeTypeRegistry', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/partition.ts b/sdk/constructive-react/src/api/orm/models/partition.ts index f6b45122d8..1f848f6419 100644 --- a/sdk/constructive-react/src/api/orm/models/partition.ts +++ b/sdk/constructive-react/src/api/orm/models/partition.ts @@ -3,56 +3,96 @@ * @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 { Partition, PartitionWithRelations, PartitionSelect, PartitionFilter, PartitionOrderBy, CreatePartitionInput, UpdatePartitionInput, PartitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Partition, + PartitionWithRelations, + PartitionSelect, + PartitionFilter, + PartitionOrderBy, + CreatePartitionInput, + UpdatePartitionInput, + PartitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PartitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ partitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Partition", "partitions", 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 - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Partition', + 'partitions', + 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, + }, + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partitions", + operation: 'query', + operationName: 'Partition', + fieldName: 'partitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ partition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Partition", "partitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Partition', + 'partitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partition", + operation: 'query', + operationName: 'Partition', + fieldName: 'partition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PartitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "partition": data.partitions?.nodes?.[0] ?? null - }) + partition: data.partitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ partition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Partition", "partitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Partition', + 'partitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partition", + operation: 'query', + operationName: 'Partition', + fieldName: 'partition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PartitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "partition": data.partitions?.nodes?.[0] ?? null - }) + partition: data.partitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Partition", "createPartition", "partition", args.select, args.data, "CreatePartitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Partition', + 'createPartition', + 'partition', + args.select, + args.data, + 'CreatePartitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "createPartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'createPartition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PartitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Partition", "updatePartition", "partition", args.select, args.where.id, args.data, "UpdatePartitionInput", "id", "partitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Partition', + 'updatePartition', + 'partition', + args.select, + args.where.id, + args.data, + 'UpdatePartitionInput', + 'id', + 'partitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "updatePartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'updatePartition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Partition", "deletePartition", "partition", { - id: args.where.id - }, "DeletePartitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Partition', + 'deletePartition', + 'partition', + { + id: args.where.id, + }, + 'DeletePartitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "deletePartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'deletePartition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformApi.ts b/sdk/constructive-react/src/api/orm/models/platformApi.ts index e51486fdec..3eee59e6c8 100644 --- a/sdk/constructive-react/src/api/orm/models/platformApi.ts +++ b/sdk/constructive-react/src/api/orm/models/platformApi.ts @@ -3,56 +3,96 @@ * @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 { PlatformApi, PlatformApiWithRelations, PlatformApiSelect, PlatformApiFilter, PlatformApiOrderBy, CreatePlatformApiInput, UpdatePlatformApiInput, PlatformApiPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApi, + PlatformApiWithRelations, + PlatformApiSelect, + PlatformApiFilter, + PlatformApiOrderBy, + CreatePlatformApiInput, + UpdatePlatformApiInput, + PlatformApiPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApis: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApi", "platformApis", 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 - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApi', + 'platformApis', + 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, + }, + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApis", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApis', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApi: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApi", "platformApis", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApi', + 'platformApis', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApi", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApi', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApi": data.platformApis?.nodes?.[0] ?? null - }) + platformApi: data.platformApis?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApi: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApi", "platformApis", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApi', + 'platformApis', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApi", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApi', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApi": data.platformApis?.nodes?.[0] ?? null - }) + platformApi: data.platformApis?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApi", "createPlatformApi", "platformApi", args.select, args.data, "CreatePlatformApiInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApi', + 'createPlatformApi', + 'platformApi', + args.select, + args.data, + 'CreatePlatformApiInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "createPlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'createPlatformApi', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApi", "updatePlatformApi", "platformApi", args.select, args.where.id, args.data, "UpdatePlatformApiInput", "id", "platformApiPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApi', + 'updatePlatformApi', + 'platformApi', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiInput', + 'id', + 'platformApiPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "updatePlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'updatePlatformApi', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApi", "deletePlatformApi", "platformApi", { - id: args.where.id - }, "DeletePlatformApiInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApi', + 'deletePlatformApi', + 'platformApi', + { + id: args.where.id, + }, + 'DeletePlatformApiInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "deletePlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'deletePlatformApi', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformApiModule.ts b/sdk/constructive-react/src/api/orm/models/platformApiModule.ts index d4c89a7118..fe0fe89c45 100644 --- a/sdk/constructive-react/src/api/orm/models/platformApiModule.ts +++ b/sdk/constructive-react/src/api/orm/models/platformApiModule.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiModule, PlatformApiModuleWithRelations, PlatformApiModuleSelect, PlatformApiModuleFilter, PlatformApiModuleOrderBy, CreatePlatformApiModuleInput, UpdatePlatformApiModuleInput, PlatformApiModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiModule, + PlatformApiModuleWithRelations, + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy, + CreatePlatformApiModuleInput, + UpdatePlatformApiModuleInput, + PlatformApiModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiModule", "platformApiModules", 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 - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiModule', + 'platformApiModules', + 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, + }, + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModules", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiModule", "platformApiModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiModule', + 'platformApiModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModule", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiModule": data.platformApiModules?.nodes?.[0] ?? null - }) + platformApiModule: data.platformApiModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiModule", "platformApiModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiModule', + 'platformApiModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModule", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiModule": data.platformApiModules?.nodes?.[0] ?? null - }) + platformApiModule: data.platformApiModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiModule", "createPlatformApiModule", "platformApiModule", args.select, args.data, "CreatePlatformApiModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiModule', + 'createPlatformApiModule', + 'platformApiModule', + args.select, + args.data, + 'CreatePlatformApiModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "createPlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'createPlatformApiModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiModule", "updatePlatformApiModule", "platformApiModule", args.select, args.where.id, args.data, "UpdatePlatformApiModuleInput", "id", "platformApiModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiModule', + 'updatePlatformApiModule', + 'platformApiModule', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiModuleInput', + 'id', + 'platformApiModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "updatePlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'updatePlatformApiModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiModule", "deletePlatformApiModule", "platformApiModule", { - id: args.where.id - }, "DeletePlatformApiModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiModule', + 'deletePlatformApiModule', + 'platformApiModule', + { + id: args.where.id, + }, + 'DeletePlatformApiModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "deletePlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'deletePlatformApiModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformApiSchema.ts b/sdk/constructive-react/src/api/orm/models/platformApiSchema.ts index 8dee7b12ed..45d57c9570 100644 --- a/sdk/constructive-react/src/api/orm/models/platformApiSchema.ts +++ b/sdk/constructive-react/src/api/orm/models/platformApiSchema.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiSchema, PlatformApiSchemaWithRelations, PlatformApiSchemaSelect, PlatformApiSchemaFilter, PlatformApiSchemaOrderBy, CreatePlatformApiSchemaInput, UpdatePlatformApiSchemaInput, PlatformApiSchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiSchema, + PlatformApiSchemaWithRelations, + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy, + CreatePlatformApiSchemaInput, + UpdatePlatformApiSchemaInput, + PlatformApiSchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiSchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSchema", "platformApiSchemas", 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 - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + 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, + }, + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchemas", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiSchema", "platformApiSchemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchema", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSchema": data.platformApiSchemas?.nodes?.[0] ?? null - }) + platformApiSchema: data.platformApiSchemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSchema", "platformApiSchemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchema", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSchema": data.platformApiSchemas?.nodes?.[0] ?? null - }) + platformApiSchema: data.platformApiSchemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiSchema", "createPlatformApiSchema", "platformApiSchema", args.select, args.data, "CreatePlatformApiSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiSchema', + 'createPlatformApiSchema', + 'platformApiSchema', + args.select, + args.data, + 'CreatePlatformApiSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "createPlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'createPlatformApiSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiSchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiSchema", "updatePlatformApiSchema", "platformApiSchema", args.select, args.where.id, args.data, "UpdatePlatformApiSchemaInput", "id", "platformApiSchemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiSchema', + 'updatePlatformApiSchema', + 'platformApiSchema', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiSchemaInput', + 'id', + 'platformApiSchemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "updatePlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'updatePlatformApiSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiSchema", "deletePlatformApiSchema", "platformApiSchema", { - id: args.where.id - }, "DeletePlatformApiSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiSchema', + 'deletePlatformApiSchema', + 'platformApiSchema', + { + id: args.where.id, + }, + 'DeletePlatformApiSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "deletePlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'deletePlatformApiSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformApiSetting.ts b/sdk/constructive-react/src/api/orm/models/platformApiSetting.ts index 7326b52ed3..c84fedd66b 100644 --- a/sdk/constructive-react/src/api/orm/models/platformApiSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/platformApiSetting.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiSetting, PlatformApiSettingWithRelations, PlatformApiSettingSelect, PlatformApiSettingFilter, PlatformApiSettingOrderBy, CreatePlatformApiSettingInput, UpdatePlatformApiSettingInput, PlatformApiSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiSetting, + PlatformApiSettingWithRelations, + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy, + CreatePlatformApiSettingInput, + UpdatePlatformApiSettingInput, + PlatformApiSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSetting", "platformApiSettings", 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 - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiSetting', + 'platformApiSettings', + 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, + }, + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSettings", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiSetting", "platformApiSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiSetting', + 'platformApiSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSetting", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSetting": data.platformApiSettings?.nodes?.[0] ?? null - }) + platformApiSetting: data.platformApiSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSetting", "platformApiSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiSetting', + 'platformApiSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSetting", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSetting": data.platformApiSettings?.nodes?.[0] ?? null - }) + platformApiSetting: data.platformApiSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiSetting", "createPlatformApiSetting", "platformApiSetting", args.select, args.data, "CreatePlatformApiSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiSetting', + 'createPlatformApiSetting', + 'platformApiSetting', + args.select, + args.data, + 'CreatePlatformApiSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "createPlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'createPlatformApiSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiSetting", "updatePlatformApiSetting", "platformApiSetting", args.select, args.where.id, args.data, "UpdatePlatformApiSettingInput", "id", "platformApiSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiSetting', + 'updatePlatformApiSetting', + 'platformApiSetting', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiSettingInput', + 'id', + 'platformApiSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "updatePlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'updatePlatformApiSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiSetting", "deletePlatformApiSetting", "platformApiSetting", { - id: args.where.id - }, "DeletePlatformApiSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiSetting', + 'deletePlatformApiSetting', + 'platformApiSetting', + { + id: args.where.id, + }, + 'DeletePlatformApiSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "deletePlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'deletePlatformApiSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformCorsSetting.ts b/sdk/constructive-react/src/api/orm/models/platformCorsSetting.ts index 5d692ac827..02f5ce48f3 100644 --- a/sdk/constructive-react/src/api/orm/models/platformCorsSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/platformCorsSetting.ts @@ -3,56 +3,96 @@ * @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 { PlatformCorsSetting, PlatformCorsSettingWithRelations, PlatformCorsSettingSelect, PlatformCorsSettingFilter, PlatformCorsSettingOrderBy, CreatePlatformCorsSettingInput, UpdatePlatformCorsSettingInput, PlatformCorsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformCorsSetting, + PlatformCorsSettingWithRelations, + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy, + CreatePlatformCorsSettingInput, + UpdatePlatformCorsSettingInput, + PlatformCorsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformCorsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformCorsSetting", "platformCorsSettings", 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 - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + 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, + }, + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSettings", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformCorsSetting", "platformCorsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSetting", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformCorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformCorsSetting": data.platformCorsSettings?.nodes?.[0] ?? null - }) + platformCorsSetting: data.platformCorsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformCorsSetting", "platformCorsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSetting", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformCorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformCorsSetting": data.platformCorsSettings?.nodes?.[0] ?? null - }) + platformCorsSetting: data.platformCorsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformCorsSetting", "createPlatformCorsSetting", "platformCorsSetting", args.select, args.data, "CreatePlatformCorsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformCorsSetting', + 'createPlatformCorsSetting', + 'platformCorsSetting', + args.select, + args.data, + 'CreatePlatformCorsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "createPlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'createPlatformCorsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformCorsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformCorsSetting", "updatePlatformCorsSetting", "platformCorsSetting", args.select, args.where.id, args.data, "UpdatePlatformCorsSettingInput", "id", "platformCorsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformCorsSetting', + 'updatePlatformCorsSetting', + 'platformCorsSetting', + args.select, + args.where.id, + args.data, + 'UpdatePlatformCorsSettingInput', + 'id', + 'platformCorsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "updatePlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'updatePlatformCorsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformCorsSetting", "deletePlatformCorsSetting", "platformCorsSetting", { - id: args.where.id - }, "DeletePlatformCorsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformCorsSetting', + 'deletePlatformCorsSetting', + 'platformCorsSetting', + { + id: args.where.id, + }, + 'DeletePlatformCorsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "deletePlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'deletePlatformCorsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformDomain.ts b/sdk/constructive-react/src/api/orm/models/platformDomain.ts index e1c4721eee..a87fc3495a 100644 --- a/sdk/constructive-react/src/api/orm/models/platformDomain.ts +++ b/sdk/constructive-react/src/api/orm/models/platformDomain.ts @@ -3,56 +3,96 @@ * @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 { PlatformDomain, PlatformDomainWithRelations, PlatformDomainSelect, PlatformDomainFilter, PlatformDomainOrderBy, CreatePlatformDomainInput, UpdatePlatformDomainInput, PlatformDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomain, + PlatformDomainWithRelations, + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy, + CreatePlatformDomainInput, + UpdatePlatformDomainInput, + PlatformDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomain", "platformDomains", 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 - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomain', + 'platformDomains', + 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, + }, + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomains", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomain", "platformDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomain', + 'platformDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomain", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomain": data.platformDomains?.nodes?.[0] ?? null - }) + platformDomain: data.platformDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomain", "platformDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomain', + 'platformDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomain", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomain": data.platformDomains?.nodes?.[0] ?? null - }) + platformDomain: data.platformDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomain", "createPlatformDomain", "platformDomain", args.select, args.data, "CreatePlatformDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomain', + 'createPlatformDomain', + 'platformDomain', + args.select, + args.data, + 'CreatePlatformDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "createPlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'createPlatformDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomain", "updatePlatformDomain", "platformDomain", args.select, args.where.id, args.data, "UpdatePlatformDomainInput", "id", "platformDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomain', + 'updatePlatformDomain', + 'platformDomain', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainInput', + 'id', + 'platformDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "updatePlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'updatePlatformDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomain", "deletePlatformDomain", "platformDomain", { - id: args.where.id - }, "DeletePlatformDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomain', + 'deletePlatformDomain', + 'platformDomain', + { + id: args.where.id, + }, + 'DeletePlatformDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "deletePlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'deletePlatformDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformDomainEvent.ts b/sdk/constructive-react/src/api/orm/models/platformDomainEvent.ts index cf74bef292..0626ef3a7a 100644 --- a/sdk/constructive-react/src/api/orm/models/platformDomainEvent.ts +++ b/sdk/constructive-react/src/api/orm/models/platformDomainEvent.ts @@ -3,56 +3,96 @@ * @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 { PlatformDomainEvent, PlatformDomainEventWithRelations, PlatformDomainEventSelect, PlatformDomainEventFilter, PlatformDomainEventOrderBy, CreatePlatformDomainEventInput, UpdatePlatformDomainEventInput, PlatformDomainEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomainEvent, + PlatformDomainEventWithRelations, + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy, + CreatePlatformDomainEventInput, + UpdatePlatformDomainEventInput, + PlatformDomainEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainEvent", "platformDomainEvents", 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 - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + 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, + }, + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvents", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomainEvent", "platformDomainEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvent", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformDomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainEvent": data.platformDomainEvents?.nodes?.[0] ?? null - }) + platformDomainEvent: data.platformDomainEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainEvent", "platformDomainEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvent", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformDomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainEvent": data.platformDomainEvents?.nodes?.[0] ?? null - }) + platformDomainEvent: data.platformDomainEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomainEvent", "createPlatformDomainEvent", "platformDomainEvent", args.select, args.data, "CreatePlatformDomainEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomainEvent', + 'createPlatformDomainEvent', + 'platformDomainEvent', + args.select, + args.data, + 'CreatePlatformDomainEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "createPlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'createPlatformDomainEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomainEvent", "updatePlatformDomainEvent", "platformDomainEvent", args.select, args.where.id, args.data, "UpdatePlatformDomainEventInput", "id", "platformDomainEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomainEvent', + 'updatePlatformDomainEvent', + 'platformDomainEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainEventInput', + 'id', + 'platformDomainEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "updatePlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'updatePlatformDomainEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomainEvent", "deletePlatformDomainEvent", "platformDomainEvent", { - id: args.where.id - }, "DeletePlatformDomainEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomainEvent', + 'deletePlatformDomainEvent', + 'platformDomainEvent', + { + id: args.where.id, + }, + 'DeletePlatformDomainEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "deletePlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'deletePlatformDomainEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformDomainVerification.ts b/sdk/constructive-react/src/api/orm/models/platformDomainVerification.ts index c6066ed06f..92b3873048 100644 --- a/sdk/constructive-react/src/api/orm/models/platformDomainVerification.ts +++ b/sdk/constructive-react/src/api/orm/models/platformDomainVerification.ts @@ -3,56 +3,101 @@ * @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 { PlatformDomainVerification, PlatformDomainVerificationWithRelations, PlatformDomainVerificationSelect, PlatformDomainVerificationFilter, PlatformDomainVerificationOrderBy, CreatePlatformDomainVerificationInput, UpdatePlatformDomainVerificationInput, PlatformDomainVerificationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomainVerification, + PlatformDomainVerificationWithRelations, + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy, + CreatePlatformDomainVerificationInput, + UpdatePlatformDomainVerificationInput, + PlatformDomainVerificationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainVerificationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerifications: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerifications: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainVerification", "platformDomainVerifications", 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 - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + 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, + }, + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerifications", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerifications', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerification: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerification: InferSelectResult< + PlatformDomainVerificationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomainVerification", "platformDomainVerifications", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerification", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerification', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformDomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainVerification": data.platformDomainVerifications?.nodes?.[0] ?? null - }) + platformDomainVerification: data.platformDomainVerifications?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerification: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerification: InferSelectResult< + PlatformDomainVerificationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainVerification", "platformDomainVerifications", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerification", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerification', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformDomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainVerification": data.platformDomainVerifications?.nodes?.[0] ?? null - }) + platformDomainVerification: data.platformDomainVerifications?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomainVerification", "createPlatformDomainVerification", "platformDomainVerification", args.select, args.data, "CreatePlatformDomainVerificationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomainVerification', + 'createPlatformDomainVerification', + 'platformDomainVerification', + args.select, + args.data, + 'CreatePlatformDomainVerificationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "createPlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'createPlatformDomainVerification', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainVerificationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomainVerification", "updatePlatformDomainVerification", "platformDomainVerification", args.select, args.where.id, args.data, "UpdatePlatformDomainVerificationInput", "id", "platformDomainVerificationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomainVerification', + 'updatePlatformDomainVerification', + 'platformDomainVerification', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainVerificationInput', + 'id', + 'platformDomainVerificationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "updatePlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'updatePlatformDomainVerification', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomainVerification", "deletePlatformDomainVerification", "platformDomainVerification", { - id: args.where.id - }, "DeletePlatformDomainVerificationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomainVerification', + 'deletePlatformDomainVerification', + 'platformDomainVerification', + { + id: args.where.id, + }, + 'DeletePlatformDomainVerificationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "deletePlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'deletePlatformDomainVerification', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformManagedDomain.ts b/sdk/constructive-react/src/api/orm/models/platformManagedDomain.ts index 28aa514693..3c1cc45243 100644 --- a/sdk/constructive-react/src/api/orm/models/platformManagedDomain.ts +++ b/sdk/constructive-react/src/api/orm/models/platformManagedDomain.ts @@ -3,56 +3,98 @@ * @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 { PlatformManagedDomain, PlatformManagedDomainWithRelations, PlatformManagedDomainSelect, PlatformManagedDomainFilter, PlatformManagedDomainOrderBy, CreatePlatformManagedDomainInput, UpdatePlatformManagedDomainInput, PlatformManagedDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformManagedDomain, + PlatformManagedDomainWithRelations, + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy, + CreatePlatformManagedDomainInput, + UpdatePlatformManagedDomainInput, + PlatformManagedDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformManagedDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformManagedDomains: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformManagedDomains: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformManagedDomain", "platformManagedDomains", 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 - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + 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, + }, + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomains", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformManagedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformManagedDomain", "platformManagedDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomain", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomain', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformManagedDomain": data.platformManagedDomains?.nodes?.[0] ?? null - }) + platformManagedDomain: data.platformManagedDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformManagedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformManagedDomain", "platformManagedDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomain", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomain', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformManagedDomain": data.platformManagedDomains?.nodes?.[0] ?? null - }) + platformManagedDomain: data.platformManagedDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformManagedDomain", "createPlatformManagedDomain", "platformManagedDomain", args.select, args.data, "CreatePlatformManagedDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformManagedDomain', + 'createPlatformManagedDomain', + 'platformManagedDomain', + args.select, + args.data, + 'CreatePlatformManagedDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "createPlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'createPlatformManagedDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformManagedDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformManagedDomain", "updatePlatformManagedDomain", "platformManagedDomain", args.select, args.where.id, args.data, "UpdatePlatformManagedDomainInput", "id", "platformManagedDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformManagedDomain', + 'updatePlatformManagedDomain', + 'platformManagedDomain', + args.select, + args.where.id, + args.data, + 'UpdatePlatformManagedDomainInput', + 'id', + 'platformManagedDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "updatePlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'updatePlatformManagedDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformManagedDomain", "deletePlatformManagedDomain", "platformManagedDomain", { - id: args.where.id - }, "DeletePlatformManagedDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformManagedDomain', + 'deletePlatformManagedDomain', + 'platformManagedDomain', + { + id: args.where.id, + }, + 'DeletePlatformManagedDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "deletePlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'deletePlatformManagedDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformSite.ts b/sdk/constructive-react/src/api/orm/models/platformSite.ts index 7deeb9578e..4ac8c5a064 100644 --- a/sdk/constructive-react/src/api/orm/models/platformSite.ts +++ b/sdk/constructive-react/src/api/orm/models/platformSite.ts @@ -3,56 +3,96 @@ * @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 { PlatformSite, PlatformSiteWithRelations, PlatformSiteSelect, PlatformSiteFilter, PlatformSiteOrderBy, CreatePlatformSiteInput, UpdatePlatformSiteInput, PlatformSitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSite, + PlatformSiteWithRelations, + PlatformSiteSelect, + PlatformSiteFilter, + PlatformSiteOrderBy, + CreatePlatformSiteInput, + UpdatePlatformSiteInput, + PlatformSitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSite", "platformSites", 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 - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSite', + 'platformSites', + 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, + }, + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSites", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSite", "platformSites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSite', + 'platformSites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSite", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSite": data.platformSites?.nodes?.[0] ?? null - }) + platformSite: data.platformSites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSite", "platformSites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSite', + 'platformSites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSite", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSite": data.platformSites?.nodes?.[0] ?? null - }) + platformSite: data.platformSites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSite", "createPlatformSite", "platformSite", args.select, args.data, "CreatePlatformSiteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSite', + 'createPlatformSite', + 'platformSite', + args.select, + args.data, + 'CreatePlatformSiteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "createPlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'createPlatformSite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSite", "updatePlatformSite", "platformSite", args.select, args.where.id, args.data, "UpdatePlatformSiteInput", "id", "platformSitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSite', + 'updatePlatformSite', + 'platformSite', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteInput', + 'id', + 'platformSitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "updatePlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'updatePlatformSite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSite", "deletePlatformSite", "platformSite", { - id: args.where.id - }, "DeletePlatformSiteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSite', + 'deletePlatformSite', + 'platformSite', + { + id: args.where.id, + }, + 'DeletePlatformSiteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "deletePlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'deletePlatformSite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformSiteMetadatum.ts b/sdk/constructive-react/src/api/orm/models/platformSiteMetadatum.ts index 181e7e7b02..8ca55b3e2d 100644 --- a/sdk/constructive-react/src/api/orm/models/platformSiteMetadatum.ts +++ b/sdk/constructive-react/src/api/orm/models/platformSiteMetadatum.ts @@ -3,56 +3,98 @@ * @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 { PlatformSiteMetadatum, PlatformSiteMetadatumWithRelations, PlatformSiteMetadatumSelect, PlatformSiteMetadatumFilter, PlatformSiteMetadatumOrderBy, CreatePlatformSiteMetadatumInput, UpdatePlatformSiteMetadatumInput, PlatformSiteMetadatumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteMetadatum, + PlatformSiteMetadatumWithRelations, + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy, + CreatePlatformSiteMetadatumInput, + UpdatePlatformSiteMetadatumInput, + PlatformSiteMetadatumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteMetadatumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformSiteMetadata: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformSiteMetadata: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteMetadatum", "platformSiteMetadata", 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 - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + 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, + }, + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadata", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadata', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteMetadatum", "platformSiteMetadata", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadatum", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadatum', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformSiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteMetadatum": data.platformSiteMetadata?.nodes?.[0] ?? null - }) + platformSiteMetadatum: data.platformSiteMetadata?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteMetadatum", "platformSiteMetadata", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadatum", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadatum', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformSiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteMetadatum": data.platformSiteMetadata?.nodes?.[0] ?? null - }) + platformSiteMetadatum: data.platformSiteMetadata?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteMetadatum", "createPlatformSiteMetadatum", "platformSiteMetadatum", args.select, args.data, "CreatePlatformSiteMetadatumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteMetadatum', + 'createPlatformSiteMetadatum', + 'platformSiteMetadatum', + args.select, + args.data, + 'CreatePlatformSiteMetadatumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "createPlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'createPlatformSiteMetadatum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteMetadatumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteMetadatum", "updatePlatformSiteMetadatum", "platformSiteMetadatum", args.select, args.where.id, args.data, "UpdatePlatformSiteMetadatumInput", "id", "platformSiteMetadatumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteMetadatum', + 'updatePlatformSiteMetadatum', + 'platformSiteMetadatum', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteMetadatumInput', + 'id', + 'platformSiteMetadatumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "updatePlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'updatePlatformSiteMetadatum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteMetadatum", "deletePlatformSiteMetadatum", "platformSiteMetadatum", { - id: args.where.id - }, "DeletePlatformSiteMetadatumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteMetadatum', + 'deletePlatformSiteMetadatum', + 'platformSiteMetadatum', + { + id: args.where.id, + }, + 'DeletePlatformSiteMetadatumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "deletePlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'deletePlatformSiteMetadatum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformSiteModule.ts b/sdk/constructive-react/src/api/orm/models/platformSiteModule.ts index 0476688298..e01bb42a05 100644 --- a/sdk/constructive-react/src/api/orm/models/platformSiteModule.ts +++ b/sdk/constructive-react/src/api/orm/models/platformSiteModule.ts @@ -3,56 +3,96 @@ * @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 { PlatformSiteModule, PlatformSiteModuleWithRelations, PlatformSiteModuleSelect, PlatformSiteModuleFilter, PlatformSiteModuleOrderBy, CreatePlatformSiteModuleInput, UpdatePlatformSiteModuleInput, PlatformSiteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteModule, + PlatformSiteModuleWithRelations, + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy, + CreatePlatformSiteModuleInput, + UpdatePlatformSiteModuleInput, + PlatformSiteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteModule", "platformSiteModules", 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 - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteModule', + 'platformSiteModules', + 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, + }, + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModules", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteModule", "platformSiteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteModule', + 'platformSiteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModule", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteModule": data.platformSiteModules?.nodes?.[0] ?? null - }) + platformSiteModule: data.platformSiteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteModule", "platformSiteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteModule', + 'platformSiteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModule", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteModule": data.platformSiteModules?.nodes?.[0] ?? null - }) + platformSiteModule: data.platformSiteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteModule", "createPlatformSiteModule", "platformSiteModule", args.select, args.data, "CreatePlatformSiteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteModule', + 'createPlatformSiteModule', + 'platformSiteModule', + args.select, + args.data, + 'CreatePlatformSiteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "createPlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'createPlatformSiteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteModule", "updatePlatformSiteModule", "platformSiteModule", args.select, args.where.id, args.data, "UpdatePlatformSiteModuleInput", "id", "platformSiteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteModule', + 'updatePlatformSiteModule', + 'platformSiteModule', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteModuleInput', + 'id', + 'platformSiteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "updatePlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'updatePlatformSiteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteModule", "deletePlatformSiteModule", "platformSiteModule", { - id: args.where.id - }, "DeletePlatformSiteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteModule', + 'deletePlatformSiteModule', + 'platformSiteModule', + { + id: args.where.id, + }, + 'DeletePlatformSiteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "deletePlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'deletePlatformSiteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/platformSiteTheme.ts b/sdk/constructive-react/src/api/orm/models/platformSiteTheme.ts index bc002ebb11..585071722f 100644 --- a/sdk/constructive-react/src/api/orm/models/platformSiteTheme.ts +++ b/sdk/constructive-react/src/api/orm/models/platformSiteTheme.ts @@ -3,56 +3,96 @@ * @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 { PlatformSiteTheme, PlatformSiteThemeWithRelations, PlatformSiteThemeSelect, PlatformSiteThemeFilter, PlatformSiteThemeOrderBy, CreatePlatformSiteThemeInput, UpdatePlatformSiteThemeInput, PlatformSiteThemePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteTheme, + PlatformSiteThemeWithRelations, + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy, + CreatePlatformSiteThemeInput, + UpdatePlatformSiteThemeInput, + PlatformSiteThemePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteThemeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteThemes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteTheme", "platformSiteThemes", 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 - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + 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, + }, + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteThemes", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteThemes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteTheme", "platformSiteThemes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteTheme", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteTheme', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteTheme": data.platformSiteThemes?.nodes?.[0] ?? null - }) + platformSiteTheme: data.platformSiteThemes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteTheme", "platformSiteThemes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteTheme", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteTheme', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteTheme": data.platformSiteThemes?.nodes?.[0] ?? null - }) + platformSiteTheme: data.platformSiteThemes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteTheme", "createPlatformSiteTheme", "platformSiteTheme", args.select, args.data, "CreatePlatformSiteThemeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteTheme', + 'createPlatformSiteTheme', + 'platformSiteTheme', + args.select, + args.data, + 'CreatePlatformSiteThemeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "createPlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'createPlatformSiteTheme', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteThemePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteTheme", "updatePlatformSiteTheme", "platformSiteTheme", args.select, args.where.id, args.data, "UpdatePlatformSiteThemeInput", "id", "platformSiteThemePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteTheme', + 'updatePlatformSiteTheme', + 'platformSiteTheme', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteThemeInput', + 'id', + 'platformSiteThemePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "updatePlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'updatePlatformSiteTheme', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteTheme", "deletePlatformSiteTheme", "platformSiteTheme", { - id: args.where.id - }, "DeletePlatformSiteThemeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteTheme', + 'deletePlatformSiteTheme', + 'platformSiteTheme', + { + id: args.where.id, + }, + 'DeletePlatformSiteThemeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "deletePlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'deletePlatformSiteTheme', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/policy.ts b/sdk/constructive-react/src/api/orm/models/policy.ts index fd0c410789..0b50aa86d3 100644 --- a/sdk/constructive-react/src/api/orm/models/policy.ts +++ b/sdk/constructive-react/src/api/orm/models/policy.ts @@ -3,56 +3,96 @@ * @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 { Policy, PolicyWithRelations, PolicySelect, PolicyFilter, PolicyOrderBy, CreatePolicyInput, UpdatePolicyInput, PolicyPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Policy, + PolicyWithRelations, + PolicySelect, + PolicyFilter, + PolicyOrderBy, + CreatePolicyInput, + UpdatePolicyInput, + PolicyPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PolicyModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ policies: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Policy", "policies", 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 - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Policy', + 'policies', + 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, + }, + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policies", + operation: 'query', + operationName: 'Policy', + fieldName: 'policies', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ policy: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Policy", "policies", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Policy', + 'policies', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policy", + operation: 'query', + operationName: 'Policy', + fieldName: 'policy', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PolicyModel { nodes?: InferSelectResult[]; }; }) => ({ - "policy": data.policies?.nodes?.[0] ?? null - }) + policy: data.policies?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ policy: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Policy", "policies", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Policy', + 'policies', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policy", + operation: 'query', + operationName: 'Policy', + fieldName: 'policy', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PolicyModel { nodes?: InferSelectResult[]; }; }) => ({ - "policy": data.policies?.nodes?.[0] ?? null - }) + policy: data.policies?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Policy", "createPolicy", "policy", args.select, args.data, "CreatePolicyInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Policy', + 'createPolicy', + 'policy', + args.select, + args.data, + 'CreatePolicyInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "createPolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'createPolicy', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PolicyPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Policy", "updatePolicy", "policy", args.select, args.where.id, args.data, "UpdatePolicyInput", "id", "policyPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Policy', + 'updatePolicy', + 'policy', + args.select, + args.where.id, + args.data, + 'UpdatePolicyInput', + 'id', + 'policyPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "updatePolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'updatePolicy', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Policy", "deletePolicy", "policy", { - id: args.where.id - }, "DeletePolicyInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Policy', + 'deletePolicy', + 'policy', + { + id: args.where.id, + }, + 'DeletePolicyInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "deletePolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'deletePolicy', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/primaryKeyConstraint.ts b/sdk/constructive-react/src/api/orm/models/primaryKeyConstraint.ts index a1015e4a8d..65f2946d86 100644 --- a/sdk/constructive-react/src/api/orm/models/primaryKeyConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/primaryKeyConstraint.ts @@ -3,56 +3,98 @@ * @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 { PrimaryKeyConstraint, PrimaryKeyConstraintWithRelations, PrimaryKeyConstraintSelect, PrimaryKeyConstraintFilter, PrimaryKeyConstraintOrderBy, CreatePrimaryKeyConstraintInput, UpdatePrimaryKeyConstraintInput, PrimaryKeyConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PrimaryKeyConstraint, + PrimaryKeyConstraintWithRelations, + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy, + CreatePrimaryKeyConstraintInput, + UpdatePrimaryKeyConstraintInput, + PrimaryKeyConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PrimaryKeyConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - primaryKeyConstraints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + primaryKeyConstraints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PrimaryKeyConstraint", "primaryKeyConstraints", 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 - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + 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, + }, + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraints", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ primaryKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PrimaryKeyConstraint", "primaryKeyConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraint", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PrimaryKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "primaryKeyConstraint": data.primaryKeyConstraints?.nodes?.[0] ?? null - }) + primaryKeyConstraint: data.primaryKeyConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ primaryKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrimaryKeyConstraint", "primaryKeyConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraint", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PrimaryKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "primaryKeyConstraint": data.primaryKeyConstraints?.nodes?.[0] ?? null - }) + primaryKeyConstraint: data.primaryKeyConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrimaryKeyConstraint", "createPrimaryKeyConstraint", "primaryKeyConstraint", args.select, args.data, "CreatePrimaryKeyConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PrimaryKeyConstraint', + 'createPrimaryKeyConstraint', + 'primaryKeyConstraint', + args.select, + args.data, + 'CreatePrimaryKeyConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "createPrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'createPrimaryKeyConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrimaryKeyConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PrimaryKeyConstraint", "updatePrimaryKeyConstraint", "primaryKeyConstraint", args.select, args.where.id, args.data, "UpdatePrimaryKeyConstraintInput", "id", "primaryKeyConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PrimaryKeyConstraint', + 'updatePrimaryKeyConstraint', + 'primaryKeyConstraint', + args.select, + args.where.id, + args.data, + 'UpdatePrimaryKeyConstraintInput', + 'id', + 'primaryKeyConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "updatePrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'updatePrimaryKeyConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PrimaryKeyConstraint", "deletePrimaryKeyConstraint", "primaryKeyConstraint", { - id: args.where.id - }, "DeletePrimaryKeyConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PrimaryKeyConstraint', + 'deletePrimaryKeyConstraint', + 'primaryKeyConstraint', + { + id: args.where.id, + }, + 'DeletePrimaryKeyConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "deletePrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'deletePrimaryKeyConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/pubkeySetting.ts b/sdk/constructive-react/src/api/orm/models/pubkeySetting.ts index 0108538df3..e44627cac6 100644 --- a/sdk/constructive-react/src/api/orm/models/pubkeySetting.ts +++ b/sdk/constructive-react/src/api/orm/models/pubkeySetting.ts @@ -3,56 +3,96 @@ * @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 { PubkeySetting, PubkeySettingWithRelations, PubkeySettingSelect, PubkeySettingFilter, PubkeySettingOrderBy, CreatePubkeySettingInput, UpdatePubkeySettingInput, PubkeySettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PubkeySetting, + PubkeySettingWithRelations, + PubkeySettingSelect, + PubkeySettingFilter, + PubkeySettingOrderBy, + CreatePubkeySettingInput, + UpdatePubkeySettingInput, + PubkeySettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PubkeySettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PubkeySetting", "pubkeySettings", 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 - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PubkeySetting', + 'pubkeySettings', + 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, + }, + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySettings", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PubkeySetting", "pubkeySettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PubkeySetting', + 'pubkeySettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySetting", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PubkeySettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "pubkeySetting": data.pubkeySettings?.nodes?.[0] ?? null - }) + pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PubkeySetting", "pubkeySettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PubkeySetting', + 'pubkeySettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySetting", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PubkeySettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "pubkeySetting": data.pubkeySettings?.nodes?.[0] ?? null - }) + pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PubkeySetting", "createPubkeySetting", "pubkeySetting", args.select, args.data, "CreatePubkeySettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PubkeySetting', + 'createPubkeySetting', + 'pubkeySetting', + args.select, + args.data, + 'CreatePubkeySettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "createPubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'createPubkeySetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PubkeySettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PubkeySetting", "updatePubkeySetting", "pubkeySetting", args.select, args.where.id, args.data, "UpdatePubkeySettingInput", "id", "pubkeySettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PubkeySetting', + 'updatePubkeySetting', + 'pubkeySetting', + args.select, + args.where.id, + args.data, + 'UpdatePubkeySettingInput', + 'id', + 'pubkeySettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "updatePubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'updatePubkeySetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PubkeySetting", "deletePubkeySetting", "pubkeySetting", { - id: args.where.id - }, "DeletePubkeySettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PubkeySetting', + 'deletePubkeySetting', + 'pubkeySetting', + { + id: args.where.id, + }, + 'DeletePubkeySettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "deletePubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'deletePubkeySetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/rlsSetting.ts b/sdk/constructive-react/src/api/orm/models/rlsSetting.ts index 235ffd888c..f371074a3a 100644 --- a/sdk/constructive-react/src/api/orm/models/rlsSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/rlsSetting.ts @@ -3,56 +3,96 @@ * @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 { RlsSetting, RlsSettingWithRelations, RlsSettingSelect, RlsSettingFilter, RlsSettingOrderBy, CreateRlsSettingInput, UpdateRlsSettingInput, RlsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RlsSetting, + RlsSettingWithRelations, + RlsSettingSelect, + RlsSettingFilter, + RlsSettingOrderBy, + CreateRlsSettingInput, + UpdateRlsSettingInput, + RlsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RlsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RlsSetting", "rlsSettings", 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 - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RlsSetting', + 'rlsSettings', + 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, + }, + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSettings", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RlsSetting", "rlsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RlsSetting', + 'rlsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSetting", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RlsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsSetting": data.rlsSettings?.nodes?.[0] ?? null - }) + rlsSetting: data.rlsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RlsSetting", "rlsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RlsSetting', + 'rlsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSetting", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RlsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsSetting": data.rlsSettings?.nodes?.[0] ?? null - }) + rlsSetting: data.rlsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RlsSetting", "createRlsSetting", "rlsSetting", args.select, args.data, "CreateRlsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RlsSetting', + 'createRlsSetting', + 'rlsSetting', + args.select, + args.data, + 'CreateRlsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "createRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'createRlsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RlsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RlsSetting", "updateRlsSetting", "rlsSetting", args.select, args.where.id, args.data, "UpdateRlsSettingInput", "id", "rlsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RlsSetting', + 'updateRlsSetting', + 'rlsSetting', + args.select, + args.where.id, + args.data, + 'UpdateRlsSettingInput', + 'id', + 'rlsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "updateRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'updateRlsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RlsSetting", "deleteRlsSetting", "rlsSetting", { - id: args.where.id - }, "DeleteRlsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RlsSetting', + 'deleteRlsSetting', + 'rlsSetting', + { + id: args.where.id, + }, + 'DeleteRlsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "deleteRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'deleteRlsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/route.ts b/sdk/constructive-react/src/api/orm/models/route.ts index 1377ead14a..0fbf96934f 100644 --- a/sdk/constructive-react/src/api/orm/models/route.ts +++ b/sdk/constructive-react/src/api/orm/models/route.ts @@ -3,56 +3,96 @@ * @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 { Route, RouteWithRelations, RouteSelect, RouteFilter, RouteOrderBy, CreateRouteInput, UpdateRouteInput, RoutePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Route, + RouteWithRelations, + RouteSelect, + RouteFilter, + RouteOrderBy, + CreateRouteInput, + UpdateRouteInput, + RoutePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Route", "routes", 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 - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Route', + 'routes', + 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, + }, + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "routes", + operation: 'query', + operationName: 'Route', + fieldName: 'routes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ route: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Route", "routes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Route', + 'routes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "route", + operation: 'query', + operationName: 'Route', + fieldName: 'route', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "route": data.routes?.nodes?.[0] ?? null - }) + route: data.routes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ route: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Route", "routes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Route', + 'routes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "route", + operation: 'query', + operationName: 'Route', + fieldName: 'route', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "route": data.routes?.nodes?.[0] ?? null - }) + route: data.routes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Route", "createRoute", "route", args.select, args.data, "CreateRouteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Route', + 'createRoute', + 'route', + args.select, + args.data, + 'CreateRouteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "createRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'createRoute', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RoutePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Route", "updateRoute", "route", args.select, args.where.id, args.data, "UpdateRouteInput", "id", "routePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Route', + 'updateRoute', + 'route', + args.select, + args.where.id, + args.data, + 'UpdateRouteInput', + 'id', + 'routePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "updateRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'updateRoute', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Route", "deleteRoute", "route", { - id: args.where.id - }, "DeleteRouteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Route', + 'deleteRoute', + 'route', + { + id: args.where.id, + }, + 'DeleteRouteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "deleteRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'deleteRoute', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/routeBinding.ts b/sdk/constructive-react/src/api/orm/models/routeBinding.ts index 42c87f01af..3389ee7e37 100644 --- a/sdk/constructive-react/src/api/orm/models/routeBinding.ts +++ b/sdk/constructive-react/src/api/orm/models/routeBinding.ts @@ -3,56 +3,96 @@ * @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 { RouteBinding, RouteBindingWithRelations, RouteBindingSelect, RouteBindingFilter, RouteBindingOrderBy, CreateRouteBindingInput, UpdateRouteBindingInput, RouteBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RouteBinding, + RouteBindingWithRelations, + RouteBindingSelect, + RouteBindingFilter, + RouteBindingOrderBy, + CreateRouteBindingInput, + UpdateRouteBindingInput, + RouteBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RouteBinding", "routeBindings", 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 - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RouteBinding', + 'routeBindings', + 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, + }, + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBindings", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RouteBinding", "routeBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RouteBinding', + 'routeBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBinding", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeBinding": data.routeBindings?.nodes?.[0] ?? null - }) + routeBinding: data.routeBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RouteBinding", "routeBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RouteBinding', + 'routeBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBinding", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeBinding": data.routeBindings?.nodes?.[0] ?? null - }) + routeBinding: data.routeBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RouteBinding", "createRouteBinding", "routeBinding", args.select, args.data, "CreateRouteBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RouteBinding', + 'createRouteBinding', + 'routeBinding', + args.select, + args.data, + 'CreateRouteBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "createRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'createRouteBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RouteBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RouteBinding", "updateRouteBinding", "routeBinding", args.select, args.where.id, args.data, "UpdateRouteBindingInput", "id", "routeBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RouteBinding', + 'updateRouteBinding', + 'routeBinding', + args.select, + args.where.id, + args.data, + 'UpdateRouteBindingInput', + 'id', + 'routeBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "updateRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'updateRouteBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RouteBinding", "deleteRouteBinding", "routeBinding", { - id: args.where.id - }, "DeleteRouteBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RouteBinding', + 'deleteRouteBinding', + 'routeBinding', + { + id: args.where.id, + }, + 'DeleteRouteBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "deleteRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'deleteRouteBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/schema.ts b/sdk/constructive-react/src/api/orm/models/schema.ts index f8ae9d0a19..d9d34cae1a 100644 --- a/sdk/constructive-react/src/api/orm/models/schema.ts +++ b/sdk/constructive-react/src/api/orm/models/schema.ts @@ -3,56 +3,96 @@ * @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 { Schema, SchemaWithRelations, SchemaSelect, SchemaFilter, SchemaOrderBy, CreateSchemaInput, UpdateSchemaInput, SchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Schema, + SchemaWithRelations, + SchemaSelect, + SchemaFilter, + SchemaOrderBy, + CreateSchemaInput, + UpdateSchemaInput, + SchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Schema", "schemas", 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 - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Schema', + 'schemas', + 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, + }, + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schemas", + operation: 'query', + operationName: 'Schema', + fieldName: 'schemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Schema", "schemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Schema', + 'schemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schema", + operation: 'query', + operationName: 'Schema', + fieldName: 'schema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "schema": data.schemas?.nodes?.[0] ?? null - }) + schema: data.schemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ schema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Schema", "schemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Schema', + 'schemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schema", + operation: 'query', + operationName: 'Schema', + fieldName: 'schema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "schema": data.schemas?.nodes?.[0] ?? null - }) + schema: data.schemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Schema", "createSchema", "schema", args.select, args.data, "CreateSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Schema', + 'createSchema', + 'schema', + args.select, + args.data, + 'CreateSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "createSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'createSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Schema", "updateSchema", "schema", args.select, args.where.id, args.data, "UpdateSchemaInput", "id", "schemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Schema', + 'updateSchema', + 'schema', + args.select, + args.where.id, + args.data, + 'UpdateSchemaInput', + 'id', + 'schemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "updateSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'updateSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Schema", "deleteSchema", "schema", { - id: args.where.id - }, "DeleteSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Schema', + 'deleteSchema', + 'schema', + { + id: args.where.id, + }, + 'DeleteSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "deleteSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'deleteSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/schemaGrant.ts b/sdk/constructive-react/src/api/orm/models/schemaGrant.ts index 5c4171b93b..553345a2b3 100644 --- a/sdk/constructive-react/src/api/orm/models/schemaGrant.ts +++ b/sdk/constructive-react/src/api/orm/models/schemaGrant.ts @@ -3,56 +3,96 @@ * @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 { SchemaGrant, SchemaGrantWithRelations, SchemaGrantSelect, SchemaGrantFilter, SchemaGrantOrderBy, CreateSchemaGrantInput, UpdateSchemaGrantInput, SchemaGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SchemaGrant, + SchemaGrantWithRelations, + SchemaGrantSelect, + SchemaGrantFilter, + SchemaGrantOrderBy, + CreateSchemaGrantInput, + UpdateSchemaGrantInput, + SchemaGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SchemaGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SchemaGrant", "schemaGrants", 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 - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SchemaGrant', + 'schemaGrants', + 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, + }, + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrants", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SchemaGrant", "schemaGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SchemaGrant', + 'schemaGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrant", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SchemaGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "schemaGrant": data.schemaGrants?.nodes?.[0] ?? null - }) + schemaGrant: data.schemaGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SchemaGrant", "schemaGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SchemaGrant', + 'schemaGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrant", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SchemaGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "schemaGrant": data.schemaGrants?.nodes?.[0] ?? null - }) + schemaGrant: data.schemaGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SchemaGrant", "createSchemaGrant", "schemaGrant", args.select, args.data, "CreateSchemaGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SchemaGrant', + 'createSchemaGrant', + 'schemaGrant', + args.select, + args.data, + 'CreateSchemaGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "createSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'createSchemaGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SchemaGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SchemaGrant", "updateSchemaGrant", "schemaGrant", args.select, args.where.id, args.data, "UpdateSchemaGrantInput", "id", "schemaGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SchemaGrant', + 'updateSchemaGrant', + 'schemaGrant', + args.select, + args.where.id, + args.data, + 'UpdateSchemaGrantInput', + 'id', + 'schemaGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "updateSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'updateSchemaGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SchemaGrant", "deleteSchemaGrant", "schemaGrant", { - id: args.where.id - }, "DeleteSchemaGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SchemaGrant', + 'deleteSchemaGrant', + 'schemaGrant', + { + id: args.where.id, + }, + 'DeleteSchemaGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "deleteSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'deleteSchemaGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/site.ts b/sdk/constructive-react/src/api/orm/models/site.ts index 40992146a5..30c5c8f81a 100644 --- a/sdk/constructive-react/src/api/orm/models/site.ts +++ b/sdk/constructive-react/src/api/orm/models/site.ts @@ -3,56 +3,96 @@ * @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 { Site, SiteWithRelations, SiteSelect, SiteFilter, SiteOrderBy, CreateSiteInput, UpdateSiteInput, SitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Site, + SiteWithRelations, + SiteSelect, + SiteFilter, + SiteOrderBy, + CreateSiteInput, + UpdateSiteInput, + SitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Site", "sites", 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 - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Site', + 'sites', + 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, + }, + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "sites", + operation: 'query', + operationName: 'Site', + fieldName: 'sites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ site: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Site", "sites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Site', + 'sites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "site", + operation: 'query', + operationName: 'Site', + fieldName: 'site', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "site": data.sites?.nodes?.[0] ?? null - }) + site: data.sites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ site: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Site", "sites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Site', + 'sites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "site", + operation: 'query', + operationName: 'Site', + fieldName: 'site', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "site": data.sites?.nodes?.[0] ?? null - }) + site: data.sites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Site", "createSite", "site", args.select, args.data, "CreateSiteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Site', + 'createSite', + 'site', + args.select, + args.data, + 'CreateSiteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "createSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'createSite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Site", "updateSite", "site", args.select, args.where.id, args.data, "UpdateSiteInput", "id", "sitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Site', + 'updateSite', + 'site', + args.select, + args.where.id, + args.data, + 'UpdateSiteInput', + 'id', + 'sitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "updateSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'updateSite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Site", "deleteSite", "site", { - id: args.where.id - }, "DeleteSiteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Site', + 'deleteSite', + 'site', + { + id: args.where.id, + }, + 'DeleteSiteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "deleteSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'deleteSite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/siteMetadatum.ts b/sdk/constructive-react/src/api/orm/models/siteMetadatum.ts index c5119c2a96..1e8bc08f33 100644 --- a/sdk/constructive-react/src/api/orm/models/siteMetadatum.ts +++ b/sdk/constructive-react/src/api/orm/models/siteMetadatum.ts @@ -3,56 +3,96 @@ * @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 { SiteMetadatum, SiteMetadatumWithRelations, SiteMetadatumSelect, SiteMetadatumFilter, SiteMetadatumOrderBy, CreateSiteMetadatumInput, UpdateSiteMetadatumInput, SiteMetadatumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteMetadatum, + SiteMetadatumWithRelations, + SiteMetadatumSelect, + SiteMetadatumFilter, + SiteMetadatumOrderBy, + CreateSiteMetadatumInput, + UpdateSiteMetadatumInput, + SiteMetadatumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteMetadatumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadata: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteMetadatum", "siteMetadata", 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 - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteMetadatum', + 'siteMetadata', + 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, + }, + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadata", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadata', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteMetadatum", "siteMetadata", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteMetadatum', + 'siteMetadata', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadatum", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadatum', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteMetadatum": data.siteMetadata?.nodes?.[0] ?? null - }) + siteMetadatum: data.siteMetadata?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteMetadatum", "siteMetadata", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteMetadatum', + 'siteMetadata', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadatum", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadatum', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteMetadatum": data.siteMetadata?.nodes?.[0] ?? null - }) + siteMetadatum: data.siteMetadata?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteMetadatum", "createSiteMetadatum", "siteMetadatum", args.select, args.data, "CreateSiteMetadatumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteMetadatum', + 'createSiteMetadatum', + 'siteMetadatum', + args.select, + args.data, + 'CreateSiteMetadatumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "createSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'createSiteMetadatum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteMetadatumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteMetadatum", "updateSiteMetadatum", "siteMetadatum", args.select, args.where.id, args.data, "UpdateSiteMetadatumInput", "id", "siteMetadatumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteMetadatum', + 'updateSiteMetadatum', + 'siteMetadatum', + args.select, + args.where.id, + args.data, + 'UpdateSiteMetadatumInput', + 'id', + 'siteMetadatumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "updateSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'updateSiteMetadatum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteMetadatum", "deleteSiteMetadatum", "siteMetadatum", { - id: args.where.id - }, "DeleteSiteMetadatumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteMetadatum', + 'deleteSiteMetadatum', + 'siteMetadatum', + { + id: args.where.id, + }, + 'DeleteSiteMetadatumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "deleteSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'deleteSiteMetadatum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/siteModule.ts b/sdk/constructive-react/src/api/orm/models/siteModule.ts index 0cbd99db46..fe7f43bf62 100644 --- a/sdk/constructive-react/src/api/orm/models/siteModule.ts +++ b/sdk/constructive-react/src/api/orm/models/siteModule.ts @@ -3,56 +3,96 @@ * @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 { SiteModule, SiteModuleWithRelations, SiteModuleSelect, SiteModuleFilter, SiteModuleOrderBy, CreateSiteModuleInput, UpdateSiteModuleInput, SiteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteModule, + SiteModuleWithRelations, + SiteModuleSelect, + SiteModuleFilter, + SiteModuleOrderBy, + CreateSiteModuleInput, + UpdateSiteModuleInput, + SiteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteModule", "siteModules", 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 - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteModule', + 'siteModules', + 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, + }, + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModules", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteModule", "siteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteModule', + 'siteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModule", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteModule": data.siteModules?.nodes?.[0] ?? null - }) + siteModule: data.siteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteModule", "siteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteModule', + 'siteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModule", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteModule": data.siteModules?.nodes?.[0] ?? null - }) + siteModule: data.siteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteModule", "createSiteModule", "siteModule", args.select, args.data, "CreateSiteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteModule', + 'createSiteModule', + 'siteModule', + args.select, + args.data, + 'CreateSiteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "createSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'createSiteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteModule", "updateSiteModule", "siteModule", args.select, args.where.id, args.data, "UpdateSiteModuleInput", "id", "siteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteModule', + 'updateSiteModule', + 'siteModule', + args.select, + args.where.id, + args.data, + 'UpdateSiteModuleInput', + 'id', + 'siteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "updateSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'updateSiteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteModule", "deleteSiteModule", "siteModule", { - id: args.where.id - }, "DeleteSiteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteModule', + 'deleteSiteModule', + 'siteModule', + { + id: args.where.id, + }, + 'DeleteSiteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "deleteSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'deleteSiteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/siteTheme.ts b/sdk/constructive-react/src/api/orm/models/siteTheme.ts index 9244052766..51551f60db 100644 --- a/sdk/constructive-react/src/api/orm/models/siteTheme.ts +++ b/sdk/constructive-react/src/api/orm/models/siteTheme.ts @@ -3,56 +3,96 @@ * @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 { SiteTheme, SiteThemeWithRelations, SiteThemeSelect, SiteThemeFilter, SiteThemeOrderBy, CreateSiteThemeInput, UpdateSiteThemeInput, SiteThemePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteTheme, + SiteThemeWithRelations, + SiteThemeSelect, + SiteThemeFilter, + SiteThemeOrderBy, + CreateSiteThemeInput, + UpdateSiteThemeInput, + SiteThemePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteThemeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteThemes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteTheme", "siteThemes", 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 - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteTheme', + 'siteThemes', + 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, + }, + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteThemes", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteThemes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteTheme", "siteThemes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteTheme', + 'siteThemes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteTheme", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteTheme', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteTheme": data.siteThemes?.nodes?.[0] ?? null - }) + siteTheme: data.siteThemes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteTheme", "siteThemes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteTheme', + 'siteThemes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteTheme", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteTheme', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteTheme": data.siteThemes?.nodes?.[0] ?? null - }) + siteTheme: data.siteThemes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteTheme", "createSiteTheme", "siteTheme", args.select, args.data, "CreateSiteThemeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteTheme', + 'createSiteTheme', + 'siteTheme', + args.select, + args.data, + 'CreateSiteThemeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "createSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'createSiteTheme', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteThemePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteTheme", "updateSiteTheme", "siteTheme", args.select, args.where.id, args.data, "UpdateSiteThemeInput", "id", "siteThemePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteTheme', + 'updateSiteTheme', + 'siteTheme', + args.select, + args.where.id, + args.data, + 'UpdateSiteThemeInput', + 'id', + 'siteThemePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "updateSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'updateSiteTheme', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteTheme", "deleteSiteTheme", "siteTheme", { - id: args.where.id - }, "DeleteSiteThemeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteTheme', + 'deleteSiteTheme', + 'siteTheme', + { + id: args.where.id, + }, + 'DeleteSiteThemeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "deleteSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'deleteSiteTheme', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/spatialRelation.ts b/sdk/constructive-react/src/api/orm/models/spatialRelation.ts index 6ef5ccab36..31de43c115 100644 --- a/sdk/constructive-react/src/api/orm/models/spatialRelation.ts +++ b/sdk/constructive-react/src/api/orm/models/spatialRelation.ts @@ -3,56 +3,96 @@ * @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 { SpatialRelation, SpatialRelationWithRelations, SpatialRelationSelect, SpatialRelationFilter, SpatialRelationOrderBy, CreateSpatialRelationInput, UpdateSpatialRelationInput, SpatialRelationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SpatialRelation, + SpatialRelationWithRelations, + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy, + CreateSpatialRelationInput, + UpdateSpatialRelationInput, + SpatialRelationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SpatialRelationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SpatialRelation", "spatialRelations", 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 - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SpatialRelation', + 'spatialRelations', + 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, + }, + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelations", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SpatialRelation", "spatialRelations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SpatialRelation', + 'spatialRelations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelation", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelation', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SpatialRelationModel { nodes?: InferSelectResult[]; }; }) => ({ - "spatialRelation": data.spatialRelations?.nodes?.[0] ?? null - }) + spatialRelation: data.spatialRelations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SpatialRelation", "spatialRelations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SpatialRelation', + 'spatialRelations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelation", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelation', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SpatialRelationModel { nodes?: InferSelectResult[]; }; }) => ({ - "spatialRelation": data.spatialRelations?.nodes?.[0] ?? null - }) + spatialRelation: data.spatialRelations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SpatialRelation", "createSpatialRelation", "spatialRelation", args.select, args.data, "CreateSpatialRelationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SpatialRelation', + 'createSpatialRelation', + 'spatialRelation', + args.select, + args.data, + 'CreateSpatialRelationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "createSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'createSpatialRelation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SpatialRelationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SpatialRelation", "updateSpatialRelation", "spatialRelation", args.select, args.where.id, args.data, "UpdateSpatialRelationInput", "id", "spatialRelationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SpatialRelation', + 'updateSpatialRelation', + 'spatialRelation', + args.select, + args.where.id, + args.data, + 'UpdateSpatialRelationInput', + 'id', + 'spatialRelationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "updateSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'updateSpatialRelation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SpatialRelation", "deleteSpatialRelation", "spatialRelation", { - id: args.where.id - }, "DeleteSpatialRelationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SpatialRelation', + 'deleteSpatialRelation', + 'spatialRelation', + { + id: args.where.id, + }, + 'DeleteSpatialRelationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "deleteSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'deleteSpatialRelation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/sqlAction.ts b/sdk/constructive-react/src/api/orm/models/sqlAction.ts index 8099171baf..74b4418688 100644 --- a/sdk/constructive-react/src/api/orm/models/sqlAction.ts +++ b/sdk/constructive-react/src/api/orm/models/sqlAction.ts @@ -3,56 +3,96 @@ * @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 { SqlAction, SqlActionWithRelations, SqlActionSelect, SqlActionFilter, SqlActionOrderBy, CreateSqlActionInput, UpdateSqlActionInput, SqlActionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SqlAction, + SqlActionWithRelations, + SqlActionSelect, + SqlActionFilter, + SqlActionOrderBy, + CreateSqlActionInput, + UpdateSqlActionInput, + SqlActionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SqlActionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlActions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SqlAction", "sqlActions", 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 - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SqlAction', + 'sqlActions', + 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, + }, + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlActions", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlActions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlAction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SqlAction", "sqlActions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SqlAction', + 'sqlActions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlAction", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlAction', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SqlActionModel { nodes?: InferSelectResult[]; }; }) => ({ - "sqlAction": data.sqlActions?.nodes?.[0] ?? null - }) + sqlAction: data.sqlActions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlAction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SqlAction", "sqlActions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SqlAction', + 'sqlActions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlAction", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlAction', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class SqlActionModel { nodes?: InferSelectResult[]; }; }) => ({ - "sqlAction": data.sqlActions?.nodes?.[0] ?? null - }) + sqlAction: data.sqlActions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSqlAction: { sqlAction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SqlAction", "createSqlAction", "sqlAction", args.select, args.data, "CreateSqlActionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SqlAction', + 'createSqlAction', + 'sqlAction', + args.select, + args.data, + 'CreateSqlActionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SqlAction", - fieldName: "createSqlAction", + operation: 'mutation', + operationName: 'SqlAction', + fieldName: 'createSqlAction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/table.ts b/sdk/constructive-react/src/api/orm/models/table.ts index 5cb18d7cb1..1f8df77e80 100644 --- a/sdk/constructive-react/src/api/orm/models/table.ts +++ b/sdk/constructive-react/src/api/orm/models/table.ts @@ -3,56 +3,96 @@ * @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 { Table, TableWithRelations, TableSelect, TableFilter, TableOrderBy, CreateTableInput, UpdateTableInput, TablePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Table, + TableWithRelations, + TableSelect, + TableFilter, + TableOrderBy, + CreateTableInput, + UpdateTableInput, + TablePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TableModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tables: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Table", "tables", 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 - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Table', + 'tables', + 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, + }, + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "tables", + operation: 'query', + operationName: 'Table', + fieldName: 'tables', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ table: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Table", "tables", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Table', + 'tables', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "table", + operation: 'query', + operationName: 'Table', + fieldName: 'table', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TableModel { nodes?: InferSelectResult[]; }; }) => ({ - "table": data.tables?.nodes?.[0] ?? null - }) + table: data.tables?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ table: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Table", "tables", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Table', + 'tables', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "table", + operation: 'query', + operationName: 'Table', + fieldName: 'table', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TableModel { nodes?: InferSelectResult[]; }; }) => ({ - "table": data.tables?.nodes?.[0] ?? null - }) + table: data.tables?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Table", "createTable", "table", args.select, args.data, "CreateTableInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Table', + 'createTable', + 'table', + args.select, + args.data, + 'CreateTableInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "createTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'createTable', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TablePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Table", "updateTable", "table", args.select, args.where.id, args.data, "UpdateTableInput", "id", "tablePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Table', + 'updateTable', + 'table', + args.select, + args.where.id, + args.data, + 'UpdateTableInput', + 'id', + 'tablePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "updateTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'updateTable', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Table", "deleteTable", "table", { - id: args.where.id - }, "DeleteTableInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Table', + 'deleteTable', + 'table', + { + id: args.where.id, + }, + 'DeleteTableInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "deleteTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'deleteTable', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/tableGrant.ts b/sdk/constructive-react/src/api/orm/models/tableGrant.ts index 6e028cfbf7..b49372245a 100644 --- a/sdk/constructive-react/src/api/orm/models/tableGrant.ts +++ b/sdk/constructive-react/src/api/orm/models/tableGrant.ts @@ -3,56 +3,96 @@ * @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 { TableGrant, TableGrantWithRelations, TableGrantSelect, TableGrantFilter, TableGrantOrderBy, CreateTableGrantInput, UpdateTableGrantInput, TableGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TableGrant, + TableGrantWithRelations, + TableGrantSelect, + TableGrantFilter, + TableGrantOrderBy, + CreateTableGrantInput, + UpdateTableGrantInput, + TableGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TableGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TableGrant", "tableGrants", 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 - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TableGrant', + 'tableGrants', + 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, + }, + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrants", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TableGrant", "tableGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TableGrant', + 'tableGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrant", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TableGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "tableGrant": data.tableGrants?.nodes?.[0] ?? null - }) + tableGrant: data.tableGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TableGrant", "tableGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TableGrant', + 'tableGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrant", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TableGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "tableGrant": data.tableGrants?.nodes?.[0] ?? null - }) + tableGrant: data.tableGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TableGrant", "createTableGrant", "tableGrant", args.select, args.data, "CreateTableGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TableGrant', + 'createTableGrant', + 'tableGrant', + args.select, + args.data, + 'CreateTableGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "createTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'createTableGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TableGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TableGrant", "updateTableGrant", "tableGrant", args.select, args.where.id, args.data, "UpdateTableGrantInput", "id", "tableGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TableGrant', + 'updateTableGrant', + 'tableGrant', + args.select, + args.where.id, + args.data, + 'UpdateTableGrantInput', + 'id', + 'tableGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "updateTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'updateTableGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TableGrant", "deleteTableGrant", "tableGrant", { - id: args.where.id - }, "DeleteTableGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TableGrant', + 'deleteTableGrant', + 'tableGrant', + { + id: args.where.id, + }, + 'DeleteTableGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "deleteTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'deleteTableGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/trigger.ts b/sdk/constructive-react/src/api/orm/models/trigger.ts index bacb29512c..47169bc484 100644 --- a/sdk/constructive-react/src/api/orm/models/trigger.ts +++ b/sdk/constructive-react/src/api/orm/models/trigger.ts @@ -3,56 +3,96 @@ * @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 { Trigger, TriggerWithRelations, TriggerSelect, TriggerFilter, TriggerOrderBy, CreateTriggerInput, UpdateTriggerInput, TriggerPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Trigger, + TriggerWithRelations, + TriggerSelect, + TriggerFilter, + TriggerOrderBy, + CreateTriggerInput, + UpdateTriggerInput, + TriggerPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TriggerModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Trigger", "triggers", 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 - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Trigger', + 'triggers', + 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, + }, + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "triggers", + operation: 'query', + operationName: 'Trigger', + fieldName: 'triggers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ trigger: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Trigger", "triggers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Trigger', + 'triggers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "trigger", + operation: 'query', + operationName: 'Trigger', + fieldName: 'trigger', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TriggerModel { nodes?: InferSelectResult[]; }; }) => ({ - "trigger": data.triggers?.nodes?.[0] ?? null - }) + trigger: data.triggers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ trigger: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Trigger", "triggers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Trigger', + 'triggers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "trigger", + operation: 'query', + operationName: 'Trigger', + fieldName: 'trigger', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TriggerModel { nodes?: InferSelectResult[]; }; }) => ({ - "trigger": data.triggers?.nodes?.[0] ?? null - }) + trigger: data.triggers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Trigger", "createTrigger", "trigger", args.select, args.data, "CreateTriggerInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Trigger', + 'createTrigger', + 'trigger', + args.select, + args.data, + 'CreateTriggerInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "createTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'createTrigger', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TriggerPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Trigger", "updateTrigger", "trigger", args.select, args.where.id, args.data, "UpdateTriggerInput", "id", "triggerPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Trigger', + 'updateTrigger', + 'trigger', + args.select, + args.where.id, + args.data, + 'UpdateTriggerInput', + 'id', + 'triggerPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "updateTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'updateTrigger', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Trigger", "deleteTrigger", "trigger", { - id: args.where.id - }, "DeleteTriggerInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Trigger', + 'deleteTrigger', + 'trigger', + { + id: args.where.id, + }, + 'DeleteTriggerInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "deleteTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'deleteTrigger', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/triggerFunction.ts b/sdk/constructive-react/src/api/orm/models/triggerFunction.ts index 27384220c3..40d2ee283e 100644 --- a/sdk/constructive-react/src/api/orm/models/triggerFunction.ts +++ b/sdk/constructive-react/src/api/orm/models/triggerFunction.ts @@ -3,56 +3,96 @@ * @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 { TriggerFunction, TriggerFunctionWithRelations, TriggerFunctionSelect, TriggerFunctionFilter, TriggerFunctionOrderBy, CreateTriggerFunctionInput, UpdateTriggerFunctionInput, TriggerFunctionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TriggerFunction, + TriggerFunctionWithRelations, + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy, + CreateTriggerFunctionInput, + UpdateTriggerFunctionInput, + TriggerFunctionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TriggerFunctionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunctions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TriggerFunction", "triggerFunctions", 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 - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TriggerFunction', + 'triggerFunctions', + 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, + }, + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunctions", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunctions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TriggerFunction", "triggerFunctions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TriggerFunction', + 'triggerFunctions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunction", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunction', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TriggerFunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "triggerFunction": data.triggerFunctions?.nodes?.[0] ?? null - }) + triggerFunction: data.triggerFunctions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TriggerFunction", "triggerFunctions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TriggerFunction', + 'triggerFunctions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunction", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunction', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TriggerFunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "triggerFunction": data.triggerFunctions?.nodes?.[0] ?? null - }) + triggerFunction: data.triggerFunctions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TriggerFunction", "createTriggerFunction", "triggerFunction", args.select, args.data, "CreateTriggerFunctionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TriggerFunction', + 'createTriggerFunction', + 'triggerFunction', + args.select, + args.data, + 'CreateTriggerFunctionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "createTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'createTriggerFunction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TriggerFunctionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TriggerFunction", "updateTriggerFunction", "triggerFunction", args.select, args.where.id, args.data, "UpdateTriggerFunctionInput", "id", "triggerFunctionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TriggerFunction', + 'updateTriggerFunction', + 'triggerFunction', + args.select, + args.where.id, + args.data, + 'UpdateTriggerFunctionInput', + 'id', + 'triggerFunctionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "updateTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'updateTriggerFunction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TriggerFunction", "deleteTriggerFunction", "triggerFunction", { - id: args.where.id - }, "DeleteTriggerFunctionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TriggerFunction', + 'deleteTriggerFunction', + 'triggerFunction', + { + id: args.where.id, + }, + 'DeleteTriggerFunctionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "deleteTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'deleteTriggerFunction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/uniqueConstraint.ts b/sdk/constructive-react/src/api/orm/models/uniqueConstraint.ts index 2664f51152..0880a23e50 100644 --- a/sdk/constructive-react/src/api/orm/models/uniqueConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/uniqueConstraint.ts @@ -3,56 +3,96 @@ * @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 { UniqueConstraint, UniqueConstraintWithRelations, UniqueConstraintSelect, UniqueConstraintFilter, UniqueConstraintOrderBy, CreateUniqueConstraintInput, UpdateUniqueConstraintInput, UniqueConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UniqueConstraint, + UniqueConstraintWithRelations, + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy, + CreateUniqueConstraintInput, + UpdateUniqueConstraintInput, + UniqueConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UniqueConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UniqueConstraint", "uniqueConstraints", 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 - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UniqueConstraint', + 'uniqueConstraints', + 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, + }, + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraints", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UniqueConstraint", "uniqueConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UniqueConstraint', + 'uniqueConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraint", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UniqueConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "uniqueConstraint": data.uniqueConstraints?.nodes?.[0] ?? null - }) + uniqueConstraint: data.uniqueConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UniqueConstraint", "uniqueConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UniqueConstraint', + 'uniqueConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraint", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UniqueConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "uniqueConstraint": data.uniqueConstraints?.nodes?.[0] ?? null - }) + uniqueConstraint: data.uniqueConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UniqueConstraint", "createUniqueConstraint", "uniqueConstraint", args.select, args.data, "CreateUniqueConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UniqueConstraint', + 'createUniqueConstraint', + 'uniqueConstraint', + args.select, + args.data, + 'CreateUniqueConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "createUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'createUniqueConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UniqueConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UniqueConstraint", "updateUniqueConstraint", "uniqueConstraint", args.select, args.where.id, args.data, "UpdateUniqueConstraintInput", "id", "uniqueConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UniqueConstraint', + 'updateUniqueConstraint', + 'uniqueConstraint', + args.select, + args.where.id, + args.data, + 'UpdateUniqueConstraintInput', + 'id', + 'uniqueConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "updateUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'updateUniqueConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UniqueConstraint", "deleteUniqueConstraint", "uniqueConstraint", { - id: args.where.id - }, "DeleteUniqueConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UniqueConstraint', + 'deleteUniqueConstraint', + 'uniqueConstraint', + { + id: args.where.id, + }, + 'DeleteUniqueConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "deleteUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'deleteUniqueConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/view.ts b/sdk/constructive-react/src/api/orm/models/view.ts index aad1e83070..04afa60a84 100644 --- a/sdk/constructive-react/src/api/orm/models/view.ts +++ b/sdk/constructive-react/src/api/orm/models/view.ts @@ -3,56 +3,96 @@ * @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 { View, ViewWithRelations, ViewSelect, ViewFilter, ViewOrderBy, CreateViewInput, UpdateViewInput, ViewPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + View, + ViewWithRelations, + ViewSelect, + ViewFilter, + ViewOrderBy, + CreateViewInput, + UpdateViewInput, + ViewPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ views: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("View", "views", 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 - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'View', + 'views', + 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, + }, + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "views", + operation: 'query', + operationName: 'View', + fieldName: 'views', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ view: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("View", "views", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'View', + 'views', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "view", + operation: 'query', + operationName: 'View', + fieldName: 'view', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewModel { nodes?: InferSelectResult[]; }; }) => ({ - "view": data.views?.nodes?.[0] ?? null - }) + view: data.views?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ view: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("View", "views", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'View', + 'views', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "view", + operation: 'query', + operationName: 'View', + fieldName: 'view', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewModel { nodes?: InferSelectResult[]; }; }) => ({ - "view": data.views?.nodes?.[0] ?? null - }) + view: data.views?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("View", "createView", "view", args.select, args.data, "CreateViewInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'View', + 'createView', + 'view', + args.select, + args.data, + 'CreateViewInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "createView", + operation: 'mutation', + operationName: 'View', + fieldName: 'createView', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("View", "updateView", "view", args.select, args.where.id, args.data, "UpdateViewInput", "id", "viewPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'View', + 'updateView', + 'view', + args.select, + args.where.id, + args.data, + 'UpdateViewInput', + 'id', + 'viewPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "updateView", + operation: 'mutation', + operationName: 'View', + fieldName: 'updateView', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("View", "deleteView", "view", { - id: args.where.id - }, "DeleteViewInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'View', + 'deleteView', + 'view', + { + id: args.where.id, + }, + 'DeleteViewInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "deleteView", + operation: 'mutation', + operationName: 'View', + fieldName: 'deleteView', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/viewGrant.ts b/sdk/constructive-react/src/api/orm/models/viewGrant.ts index ee6c58946a..7f9b69a42c 100644 --- a/sdk/constructive-react/src/api/orm/models/viewGrant.ts +++ b/sdk/constructive-react/src/api/orm/models/viewGrant.ts @@ -3,56 +3,96 @@ * @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 { ViewGrant, ViewGrantWithRelations, ViewGrantSelect, ViewGrantFilter, ViewGrantOrderBy, CreateViewGrantInput, UpdateViewGrantInput, ViewGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewGrant, + ViewGrantWithRelations, + ViewGrantSelect, + ViewGrantFilter, + ViewGrantOrderBy, + CreateViewGrantInput, + UpdateViewGrantInput, + ViewGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewGrant", "viewGrants", 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 - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewGrant', + 'viewGrants', + 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, + }, + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrants", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewGrant", "viewGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewGrant', + 'viewGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrant", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewGrant": data.viewGrants?.nodes?.[0] ?? null - }) + viewGrant: data.viewGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewGrant", "viewGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewGrant', + 'viewGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrant", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewGrant": data.viewGrants?.nodes?.[0] ?? null - }) + viewGrant: data.viewGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewGrant", "createViewGrant", "viewGrant", args.select, args.data, "CreateViewGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewGrant', + 'createViewGrant', + 'viewGrant', + args.select, + args.data, + 'CreateViewGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "createViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'createViewGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewGrant", "updateViewGrant", "viewGrant", args.select, args.where.id, args.data, "UpdateViewGrantInput", "id", "viewGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewGrant', + 'updateViewGrant', + 'viewGrant', + args.select, + args.where.id, + args.data, + 'UpdateViewGrantInput', + 'id', + 'viewGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "updateViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'updateViewGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewGrant", "deleteViewGrant", "viewGrant", { - id: args.where.id - }, "DeleteViewGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewGrant', + 'deleteViewGrant', + 'viewGrant', + { + id: args.where.id, + }, + 'DeleteViewGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "deleteViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'deleteViewGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/viewRule.ts b/sdk/constructive-react/src/api/orm/models/viewRule.ts index 9d23a13997..df3eadd57c 100644 --- a/sdk/constructive-react/src/api/orm/models/viewRule.ts +++ b/sdk/constructive-react/src/api/orm/models/viewRule.ts @@ -3,56 +3,96 @@ * @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 { ViewRule, ViewRuleWithRelations, ViewRuleSelect, ViewRuleFilter, ViewRuleOrderBy, CreateViewRuleInput, UpdateViewRuleInput, ViewRulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewRule, + ViewRuleWithRelations, + ViewRuleSelect, + ViewRuleFilter, + ViewRuleOrderBy, + CreateViewRuleInput, + UpdateViewRuleInput, + ViewRulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewRuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewRule", "viewRules", 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 - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewRule', + 'viewRules', + 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, + }, + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRules", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewRule", "viewRules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewRule', + 'viewRules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRule", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewRuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewRule": data.viewRules?.nodes?.[0] ?? null - }) + viewRule: data.viewRules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewRule", "viewRules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewRule', + 'viewRules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRule", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewRuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewRule": data.viewRules?.nodes?.[0] ?? null - }) + viewRule: data.viewRules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewRule", "createViewRule", "viewRule", args.select, args.data, "CreateViewRuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewRule', + 'createViewRule', + 'viewRule', + args.select, + args.data, + 'CreateViewRuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "createViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'createViewRule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewRulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewRule", "updateViewRule", "viewRule", args.select, args.where.id, args.data, "UpdateViewRuleInput", "id", "viewRulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewRule', + 'updateViewRule', + 'viewRule', + args.select, + args.where.id, + args.data, + 'UpdateViewRuleInput', + 'id', + 'viewRulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "updateViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'updateViewRule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewRule", "deleteViewRule", "viewRule", { - id: args.where.id - }, "DeleteViewRuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewRule', + 'deleteViewRule', + 'viewRule', + { + id: args.where.id, + }, + 'DeleteViewRuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "deleteViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'deleteViewRule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/viewTable.ts b/sdk/constructive-react/src/api/orm/models/viewTable.ts index f28432a5cc..44308019a0 100644 --- a/sdk/constructive-react/src/api/orm/models/viewTable.ts +++ b/sdk/constructive-react/src/api/orm/models/viewTable.ts @@ -3,56 +3,96 @@ * @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 { ViewTable, ViewTableWithRelations, ViewTableSelect, ViewTableFilter, ViewTableOrderBy, CreateViewTableInput, UpdateViewTableInput, ViewTablePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewTable, + ViewTableWithRelations, + ViewTableSelect, + ViewTableFilter, + ViewTableOrderBy, + CreateViewTableInput, + UpdateViewTableInput, + ViewTablePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewTableModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTables: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewTable", "viewTables", 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 - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewTable', + 'viewTables', + 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, + }, + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTables", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTables', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTable: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewTable", "viewTables", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewTable', + 'viewTables', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTable", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTable', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewTableModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewTable": data.viewTables?.nodes?.[0] ?? null - }) + viewTable: data.viewTables?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTable: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewTable", "viewTables", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewTable', + 'viewTables', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTable", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTable', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewTableModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewTable": data.viewTables?.nodes?.[0] ?? null - }) + viewTable: data.viewTables?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewTable", "createViewTable", "viewTable", args.select, args.data, "CreateViewTableInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewTable', + 'createViewTable', + 'viewTable', + args.select, + args.data, + 'CreateViewTableInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "createViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'createViewTable', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewTablePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewTable", "updateViewTable", "viewTable", args.select, args.where.id, args.data, "UpdateViewTableInput", "id", "viewTablePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewTable', + 'updateViewTable', + 'viewTable', + args.select, + args.where.id, + args.data, + 'UpdateViewTableInput', + 'id', + 'viewTablePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "updateViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'updateViewTable', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewTable", "deleteViewTable", "viewTable", { - id: args.where.id - }, "DeleteViewTableInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewTable', + 'deleteViewTable', + 'viewTable', + { + id: args.where.id, + }, + 'DeleteViewTableInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "deleteViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'deleteViewTable', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/models/webauthnSetting.ts b/sdk/constructive-react/src/api/orm/models/webauthnSetting.ts index 8150003ac5..515c0dbcaa 100644 --- a/sdk/constructive-react/src/api/orm/models/webauthnSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/webauthnSetting.ts @@ -3,56 +3,96 @@ * @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 { WebauthnSetting, WebauthnSettingWithRelations, WebauthnSettingSelect, WebauthnSettingFilter, WebauthnSettingOrderBy, CreateWebauthnSettingInput, UpdateWebauthnSettingInput, WebauthnSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnSetting, + WebauthnSettingWithRelations, + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy, + CreateWebauthnSettingInput, + UpdateWebauthnSettingInput, + WebauthnSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnSetting", "webauthnSettings", 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 - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnSetting', + 'webauthnSettings', + 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, + }, + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSettings", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnSetting", "webauthnSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnSetting', + 'webauthnSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSetting", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnSetting": data.webauthnSettings?.nodes?.[0] ?? null - }) + webauthnSetting: data.webauthnSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnSetting", "webauthnSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnSetting', + 'webauthnSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSetting", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnSetting": data.webauthnSettings?.nodes?.[0] ?? null - }) + webauthnSetting: data.webauthnSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnSetting", "createWebauthnSetting", "webauthnSetting", args.select, args.data, "CreateWebauthnSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnSetting', + 'createWebauthnSetting', + 'webauthnSetting', + args.select, + args.data, + 'CreateWebauthnSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "createWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'createWebauthnSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnSetting", "updateWebauthnSetting", "webauthnSetting", args.select, args.where.id, args.data, "UpdateWebauthnSettingInput", "id", "webauthnSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnSetting', + 'updateWebauthnSetting', + 'webauthnSetting', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnSettingInput', + 'id', + 'webauthnSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "updateWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'updateWebauthnSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnSetting", "deleteWebauthnSetting", "webauthnSetting", { - id: args.where.id - }, "DeleteWebauthnSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnSetting', + 'deleteWebauthnSetting', + 'webauthnSetting', + { + id: args.where.id, + }, + 'DeleteWebauthnSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "deleteWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'deleteWebauthnSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/mutation/index.ts b/sdk/constructive-react/src/api/orm/mutation/index.ts index ad9dcc2e30..0192a395b1 100644 --- a/sdk/constructive-react/src/api/orm/mutation/index.ts +++ b/sdk/constructive-react/src/api/orm/mutation/index.ts @@ -3,11 +3,33 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AcceptDatabaseTransferInput, ApplyRlsInput, CancelDatabaseTransferInput, ProvisionBucketInput, RejectDatabaseTransferInput, RequestDatabaseInput, SetFieldOrderInput, AcceptDatabaseTransferPayload, ApplyRlsPayload, CancelDatabaseTransferPayload, ProvisionBucketPayload, RejectDatabaseTransferPayload, RequestDatabasePayload, SetFieldOrderPayload, AcceptDatabaseTransferPayloadSelect, ApplyRlsPayloadSelect, CancelDatabaseTransferPayloadSelect, ProvisionBucketPayloadSelect, RejectDatabaseTransferPayloadSelect, RequestDatabasePayloadSelect, SetFieldOrderPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + AcceptDatabaseTransferInput, + ApplyRlsInput, + CancelDatabaseTransferInput, + ProvisionBucketInput, + RejectDatabaseTransferInput, + RequestDatabaseInput, + SetFieldOrderInput, + AcceptDatabaseTransferPayload, + ApplyRlsPayload, + CancelDatabaseTransferPayload, + ProvisionBucketPayload, + RejectDatabaseTransferPayload, + RequestDatabasePayload, + SetFieldOrderPayload, + AcceptDatabaseTransferPayloadSelect, + ApplyRlsPayloadSelect, + CancelDatabaseTransferPayloadSelect, + ProvisionBucketPayloadSelect, + RejectDatabaseTransferPayloadSelect, + RequestDatabasePayloadSelect, + SetFieldOrderPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AcceptDatabaseTransferVariables { input: AcceptDatabaseTransferInput; } @@ -48,103 +70,208 @@ export interface SetFieldOrderVariables { } export function createMutationOperations(client: OrmClient) { return { - acceptDatabaseTransfer: (args: AcceptDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - acceptDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AcceptDatabaseTransfer", - fieldName: "acceptDatabaseTransfer", - ...buildCustomDocument("mutation", "AcceptDatabaseTransfer", "acceptDatabaseTransfer", options.select, args, [{ - name: "input", - type: "AcceptDatabaseTransferInput!" - }], connectionFieldsMap, "AcceptDatabaseTransferPayload") - }), - applyRls: (args: ApplyRlsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - applyRls: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ApplyRls", - fieldName: "applyRls", - ...buildCustomDocument("mutation", "ApplyRls", "applyRls", options.select, args, [{ - name: "input", - type: "ApplyRlsInput!" - }], connectionFieldsMap, "ApplyRlsPayload") - }), - cancelDatabaseTransfer: (args: CancelDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - cancelDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CancelDatabaseTransfer", - fieldName: "cancelDatabaseTransfer", - ...buildCustomDocument("mutation", "CancelDatabaseTransfer", "cancelDatabaseTransfer", options.select, args, [{ - name: "input", - type: "CancelDatabaseTransferInput!" - }], connectionFieldsMap, "CancelDatabaseTransferPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - rejectDatabaseTransfer: (args: RejectDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - rejectDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RejectDatabaseTransfer", - fieldName: "rejectDatabaseTransfer", - ...buildCustomDocument("mutation", "RejectDatabaseTransfer", "rejectDatabaseTransfer", options.select, args, [{ - name: "input", - type: "RejectDatabaseTransferInput!" - }], connectionFieldsMap, "RejectDatabaseTransferPayload") - }), - requestDatabase: (args: RequestDatabaseVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - requestDatabase: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RequestDatabase", - fieldName: "requestDatabase", - ...buildCustomDocument("mutation", "RequestDatabase", "requestDatabase", options.select, args, [{ - name: "input", - type: "RequestDatabaseInput!" - }], connectionFieldsMap, "RequestDatabasePayload") - }), - setFieldOrder: (args: SetFieldOrderVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setFieldOrder: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetFieldOrder", - fieldName: "setFieldOrder", - ...buildCustomDocument("mutation", "SetFieldOrder", "setFieldOrder", options.select, args, [{ - name: "input", - type: "SetFieldOrderInput!" - }], connectionFieldsMap, "SetFieldOrderPayload") - }) + acceptDatabaseTransfer: ( + args: AcceptDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + acceptDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AcceptDatabaseTransfer', + fieldName: 'acceptDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'AcceptDatabaseTransfer', + 'acceptDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'AcceptDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'AcceptDatabaseTransferPayload' + ), + }), + applyRls: ( + args: ApplyRlsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + applyRls: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ApplyRls', + fieldName: 'applyRls', + ...buildCustomDocument( + 'mutation', + 'ApplyRls', + 'applyRls', + options.select, + args, + [ + { + name: 'input', + type: 'ApplyRlsInput!', + }, + ], + connectionFieldsMap, + 'ApplyRlsPayload' + ), + }), + cancelDatabaseTransfer: ( + args: CancelDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + cancelDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CancelDatabaseTransfer', + fieldName: 'cancelDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'CancelDatabaseTransfer', + 'cancelDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'CancelDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'CancelDatabaseTransferPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + rejectDatabaseTransfer: ( + args: RejectDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + rejectDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RejectDatabaseTransfer', + fieldName: 'rejectDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'RejectDatabaseTransfer', + 'rejectDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'RejectDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'RejectDatabaseTransferPayload' + ), + }), + requestDatabase: ( + args: RequestDatabaseVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + requestDatabase: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RequestDatabase', + fieldName: 'requestDatabase', + ...buildCustomDocument( + 'mutation', + 'RequestDatabase', + 'requestDatabase', + options.select, + args, + [ + { + name: 'input', + type: 'RequestDatabaseInput!', + }, + ], + connectionFieldsMap, + 'RequestDatabasePayload' + ), + }), + setFieldOrder: ( + args: SetFieldOrderVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setFieldOrder: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetFieldOrder', + fieldName: 'setFieldOrder', + ...buildCustomDocument( + 'mutation', + 'SetFieldOrder', + 'setFieldOrder', + options.select, + args, + [ + { + name: 'input', + type: 'SetFieldOrderInput!', + }, + ], + connectionFieldsMap, + 'SetFieldOrderPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/query-builder.ts b/sdk/constructive-react/src/api/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/api/orm/query-builder.ts +++ b/sdk/constructive-react/src/api/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/api/orm/query/index.ts b/sdk/constructive-react/src/api/orm/query/index.ts index a8fb40e9c4..4136dc4b39 100644 --- a/sdk/constructive-react/src/api/orm/query/index.ts +++ b/sdk/constructive-react/src/api/orm/query/index.ts @@ -3,11 +3,16 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ResolveHttpRouteRecord, ResolveRouteRecord, ResolveHttpRouteRecordSelect, ResolveRouteRecordSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ResolveHttpRouteRecord, + ResolveRouteRecord, + ResolveHttpRouteRecordSelect, + ResolveRouteRecordSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface ApiSchemaNamesVariables { targetApiId?: string; } @@ -27,76 +32,141 @@ export interface ResolveRouteVariables { } export function createQueryOperations(client: OrmClient) { return { - apiSchemaNames: (args: ApiSchemaNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - apiSchemaNames: unknown | null; - }>({ - client, - operation: "query", - operationName: "ApiSchemaNames", - fieldName: "apiSchemaNames", - ...buildCustomDocument("query", "ApiSchemaNames", "apiSchemaNames", options?.select, args, [{ - name: "targetApiId", - type: "UUID" - }], connectionFieldsMap, undefined) - }), - applyRegistryDefaults: (args: ApplyRegistryDefaultsVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - applyRegistryDefaults: unknown | null; - }>({ - client, - operation: "query", - operationName: "ApplyRegistryDefaults", - fieldName: "applyRegistryDefaults", - ...buildCustomDocument("query", "ApplyRegistryDefaults", "applyRegistryDefaults", options?.select, args, [{ - name: "data", - type: "JSON" - }, { - name: "nodeType", - type: "String" - }], connectionFieldsMap, undefined) - }), - resolveHttpRoute: (args: ResolveHttpRouteVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resolveHttpRoute: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "ResolveHttpRoute", - fieldName: "resolveHttpRoute", - ...buildCustomDocument("query", "ResolveHttpRoute", "resolveHttpRoute", options.select, args, [{ - name: "requestHost", - type: "String" - }, { - name: "requestMethod", - type: "String" - }, { - name: "requestPath", - type: "String" - }], connectionFieldsMap, "ResolveHttpRouteRecord") - }), - resolveRoute: (args: ResolveRouteVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resolveRoute: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "ResolveRoute", - fieldName: "resolveRoute", - ...buildCustomDocument("query", "ResolveRoute", "resolveRoute", options.select, args, [{ - name: "requestHost", - type: "String" - }, { - name: "requestMethod", - type: "String" - }, { - name: "requestPath", - type: "String" - }], connectionFieldsMap, "ResolveRouteRecord") - }) + apiSchemaNames: ( + args: ApiSchemaNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + apiSchemaNames: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ApiSchemaNames', + fieldName: 'apiSchemaNames', + ...buildCustomDocument( + 'query', + 'ApiSchemaNames', + 'apiSchemaNames', + options?.select, + args, + [ + { + name: 'targetApiId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + applyRegistryDefaults: ( + args: ApplyRegistryDefaultsVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + applyRegistryDefaults: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ApplyRegistryDefaults', + fieldName: 'applyRegistryDefaults', + ...buildCustomDocument( + 'query', + 'ApplyRegistryDefaults', + 'applyRegistryDefaults', + options?.select, + args, + [ + { + name: 'data', + type: 'JSON', + }, + { + name: 'nodeType', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), + resolveHttpRoute: ( + args: ResolveHttpRouteVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resolveHttpRoute: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveHttpRoute', + fieldName: 'resolveHttpRoute', + ...buildCustomDocument( + 'query', + 'ResolveHttpRoute', + 'resolveHttpRoute', + options.select, + args, + [ + { + name: 'requestHost', + type: 'String', + }, + { + name: 'requestMethod', + type: 'String', + }, + { + name: 'requestPath', + type: 'String', + }, + ], + connectionFieldsMap, + 'ResolveHttpRouteRecord' + ), + }), + resolveRoute: ( + args: ResolveRouteVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resolveRoute: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveRoute', + fieldName: 'resolveRoute', + ...buildCustomDocument( + 'query', + 'ResolveRoute', + 'resolveRoute', + options.select, + args, + [ + { + name: 'requestHost', + type: 'String', + }, + { + name: 'requestMethod', + type: 'String', + }, + { + name: 'requestPath', + type: 'String', + }, + ], + connectionFieldsMap, + 'ResolveRouteRecord' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/orm/realtime.ts b/sdk/constructive-react/src/api/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/api/orm/realtime.ts +++ b/sdk/constructive-react/src/api/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/api/orm/select-types.ts b/sdk/constructive-react/src/api/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/api/orm/select-types.ts +++ b/sdk/constructive-react/src/api/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/api/schema-types.ts b/sdk/constructive-react/src/api/schema-types.ts index 395fee58d4..ab853e00f1 100644 --- a/sdk/constructive-react/src/api/schema-types.ts +++ b/sdk/constructive-react/src/api/schema-types.ts @@ -4,140 +4,1894 @@ * DO NOT EDIT - changes will be overwritten */ -import type { Api, ApiModule, ApiSchema, ApiSetting, AstMigration, CheckConstraint, CompositeType, CorsSetting, Database, DatabaseSetting, DatabaseTransfer, DefaultPrivilege, Domain, DomainEvent, DomainVerification, EmbeddingChunk, Enum, ExclusionConstraint, Field, ForeignKeyConstraint, FullTextSearch, Function, HostnameBinding, HttpRoute, Index, ManagedDomain, NodeTypeRegistry, Partition, PlatformApi, PlatformApiModule, PlatformApiSchema, PlatformApiSetting, PlatformCorsSetting, PlatformDomain, PlatformDomainEvent, PlatformDomainVerification, PlatformManagedDomain, PlatformSite, PlatformSiteMetadatum, PlatformSiteModule, PlatformSiteTheme, Policy, PrimaryKeyConstraint, PubkeySetting, RlsSetting, Route, RouteBinding, Schema, SchemaGrant, Site, SiteMetadatum, SiteModule, SiteTheme, SpatialRelation, SqlAction, Table, TableGrant, Trigger, TriggerFunction, UniqueConstraint, View, ViewGrant, ViewRule, ViewTable, WebauthnSetting, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + Api, + ApiModule, + ApiSchema, + ApiSetting, + AstMigration, + CheckConstraint, + CompositeType, + CorsSetting, + Database, + DatabaseSetting, + DatabaseTransfer, + DefaultPrivilege, + Domain, + DomainEvent, + DomainVerification, + EmbeddingChunk, + Enum, + ExclusionConstraint, + Field, + ForeignKeyConstraint, + FullTextSearch, + Function, + HostnameBinding, + HttpRoute, + Index, + ManagedDomain, + NodeTypeRegistry, + Partition, + PlatformApi, + PlatformApiModule, + PlatformApiSchema, + PlatformApiSetting, + PlatformCorsSetting, + PlatformDomain, + PlatformDomainEvent, + PlatformDomainVerification, + PlatformManagedDomain, + PlatformSite, + PlatformSiteMetadatum, + PlatformSiteModule, + PlatformSiteTheme, + Policy, + PrimaryKeyConstraint, + PubkeySetting, + RlsSetting, + Route, + RouteBinding, + Schema, + SchemaGrant, + Site, + SiteMetadatum, + SiteModule, + SiteTheme, + SpatialRelation, + SqlAction, + Table, + TableGrant, + Trigger, + TriggerFunction, + UniqueConstraint, + View, + ViewGrant, + ViewRule, + ViewTable, + WebauthnSetting, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; export type ConstructiveInternalTypeImage = unknown; -export type ApiExposureLevel = "EXPOSABLE" | "INTERNAL_ONLY" | "NEVER_EXPOSE"; +export type ApiExposureLevel = 'EXPOSABLE' | 'INTERNAL_ONLY' | 'NEVER_EXPOSE'; /** Methods to use when ordering `ApiModule`. */ -export type ApiModuleOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type ApiModuleOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Api`. */ -export type ApiOrderBy = "ANON_ROLE_ASC" | "ANON_ROLE_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DBNAME_ASC" | "DBNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_NAME_ASC" | "ROLE_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type ApiOrderBy = + | 'ANON_ROLE_ASC' + | 'ANON_ROLE_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DBNAME_ASC' + | 'DBNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_NAME_ASC' + | 'ROLE_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `ApiSchema`. */ -export type ApiSchemaOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type ApiSchemaOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `ApiSetting`. */ -export type ApiSettingOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type ApiSettingOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `AstMigration`. */ -export type AstMigrationOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYS_ASC" | "DEPLOYS_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REQUIRES_ASC" | "REQUIRES_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; +export type AstMigrationOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYS_ASC' + | 'DEPLOYS_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REQUIRES_ASC' + | 'REQUIRES_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; /** Methods to use when ordering `CheckConstraint`. */ -export type CheckConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EXPR_ASC" | "EXPR_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type CheckConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EXPR_ASC' + | 'EXPR_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `CompositeType`. */ -export type CompositeTypeOrderBy = "ATTRIBUTES_ASC" | "ATTRIBUTES_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC"; +export type CompositeTypeOrderBy = + | 'ATTRIBUTES_ASC' + | 'ATTRIBUTES_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC'; /** Methods to use when ordering `CorsSetting`. */ -export type CorsSettingOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type CorsSettingOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Database`. */ -export type DatabaseOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PLATFORM_ASC" | "PLATFORM_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_HASH_ASC" | "SCHEMA_HASH_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DatabaseOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PLATFORM_ASC' + | 'PLATFORM_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_HASH_ASC' + | 'SCHEMA_HASH_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `DatabaseSetting`. */ -export type DatabaseSettingOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DatabaseSettingOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `DatabaseTransfer`. */ -export type DatabaseTransferOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INITIATED_BY_ASC" | "INITIATED_BY_DESC" | "NATURAL" | "NOTES_ASC" | "NOTES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_APPROVED_ASC" | "SOURCE_APPROVED_AT_ASC" | "SOURCE_APPROVED_AT_DESC" | "SOURCE_APPROVED_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TARGET_APPROVED_ASC" | "TARGET_APPROVED_AT_ASC" | "TARGET_APPROVED_AT_DESC" | "TARGET_APPROVED_DESC" | "TARGET_OWNER_ID_ASC" | "TARGET_OWNER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DatabaseTransferOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIATED_BY_ASC' + | 'INITIATED_BY_DESC' + | 'NATURAL' + | 'NOTES_ASC' + | 'NOTES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_APPROVED_ASC' + | 'SOURCE_APPROVED_AT_ASC' + | 'SOURCE_APPROVED_AT_DESC' + | 'SOURCE_APPROVED_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TARGET_APPROVED_ASC' + | 'TARGET_APPROVED_AT_ASC' + | 'TARGET_APPROVED_AT_DESC' + | 'TARGET_APPROVED_DESC' + | 'TARGET_OWNER_ID_ASC' + | 'TARGET_OWNER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `DefaultPrivilege`. */ -export type DefaultPrivilegeOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "OBJECT_TYPE_ASC" | "OBJECT_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; +export type DefaultPrivilegeOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'OBJECT_TYPE_ASC' + | 'OBJECT_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; /** Methods to use when ordering `DomainEvent`. */ -export type DomainEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "DOMAIN_VERIFICATION_ID_ASC" | "DOMAIN_VERIFICATION_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DomainEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'DOMAIN_VERIFICATION_ID_ASC' + | 'DOMAIN_VERIFICATION_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Domain`. */ -export type DomainOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; +export type DomainOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; /** Methods to use when ordering `DomainVerification`. */ -export type DomainVerificationOrderBy = "ATTEMPTS_ASC" | "ATTEMPTS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LAST_CHECKED_AT_ASC" | "LAST_CHECKED_AT_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECORD_NAME_ASC" | "RECORD_NAME_DESC" | "RECORD_TYPE_ASC" | "RECORD_TYPE_DESC" | "RECORD_VALUE_ASC" | "RECORD_VALUE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; +export type DomainVerificationOrderBy = + | 'ATTEMPTS_ASC' + | 'ATTEMPTS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_CHECKED_AT_ASC' + | 'LAST_CHECKED_AT_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECORD_NAME_ASC' + | 'RECORD_NAME_DESC' + | 'RECORD_TYPE_ASC' + | 'RECORD_TYPE_DESC' + | 'RECORD_VALUE_ASC' + | 'RECORD_VALUE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; /** Methods to use when ordering `EmbeddingChunk`. */ -export type EmbeddingChunkOrderBy = "CHUNKING_TASK_NAME_ASC" | "CHUNKING_TASK_NAME_DESC" | "CHUNKS_TABLE_ID_ASC" | "CHUNKS_TABLE_ID_DESC" | "CHUNKS_TABLE_NAME_ASC" | "CHUNKS_TABLE_NAME_DESC" | "CHUNK_OVERLAP_ASC" | "CHUNK_OVERLAP_DESC" | "CHUNK_SIZE_ASC" | "CHUNK_SIZE_DESC" | "CHUNK_STRATEGY_ASC" | "CHUNK_STRATEGY_DESC" | "CONTENT_FIELD_NAME_ASC" | "CONTENT_FIELD_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DIMENSIONS_ASC" | "DIMENSIONS_DESC" | "EMBEDDING_FIELD_ID_ASC" | "EMBEDDING_FIELD_ID_DESC" | "EMBEDDING_MODEL_ASC" | "EMBEDDING_MODEL_DESC" | "EMBEDDING_PROVIDER_ASC" | "EMBEDDING_PROVIDER_DESC" | "ENQUEUE_CHUNKING_JOB_ASC" | "ENQUEUE_CHUNKING_JOB_DESC" | "ID_ASC" | "ID_DESC" | "METADATA_FIELDS_ASC" | "METADATA_FIELDS_DESC" | "METRIC_ASC" | "METRIC_DESC" | "NATURAL" | "PARENT_FK_FIELD_ID_ASC" | "PARENT_FK_FIELD_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_INDEXES_ASC" | "SEARCH_INDEXES_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type EmbeddingChunkOrderBy = + | 'CHUNKING_TASK_NAME_ASC' + | 'CHUNKING_TASK_NAME_DESC' + | 'CHUNKS_TABLE_ID_ASC' + | 'CHUNKS_TABLE_ID_DESC' + | 'CHUNKS_TABLE_NAME_ASC' + | 'CHUNKS_TABLE_NAME_DESC' + | 'CHUNK_OVERLAP_ASC' + | 'CHUNK_OVERLAP_DESC' + | 'CHUNK_SIZE_ASC' + | 'CHUNK_SIZE_DESC' + | 'CHUNK_STRATEGY_ASC' + | 'CHUNK_STRATEGY_DESC' + | 'CONTENT_FIELD_NAME_ASC' + | 'CONTENT_FIELD_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DIMENSIONS_ASC' + | 'DIMENSIONS_DESC' + | 'EMBEDDING_FIELD_ID_ASC' + | 'EMBEDDING_FIELD_ID_DESC' + | 'EMBEDDING_MODEL_ASC' + | 'EMBEDDING_MODEL_DESC' + | 'EMBEDDING_PROVIDER_ASC' + | 'EMBEDDING_PROVIDER_DESC' + | 'ENQUEUE_CHUNKING_JOB_ASC' + | 'ENQUEUE_CHUNKING_JOB_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'METADATA_FIELDS_ASC' + | 'METADATA_FIELDS_DESC' + | 'METRIC_ASC' + | 'METRIC_DESC' + | 'NATURAL' + | 'PARENT_FK_FIELD_ID_ASC' + | 'PARENT_FK_FIELD_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_INDEXES_ASC' + | 'SEARCH_INDEXES_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Enum`. */ -export type EnumOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC" | "VALUES_ASC" | "VALUES_DESC"; +export type EnumOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'VALUES_ASC' + | 'VALUES_DESC'; /** Methods to use when ordering `ExclusionConstraint`. */ -export type ExclusionConstraintOrderBy = "ACCESS_METHOD_ASC" | "ACCESS_METHOD_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ELEMENT_EXPR_ASC" | "ELEMENT_EXPR_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPERATORS_ASC" | "OPERATORS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WHERE_CLAUSE_ASC" | "WHERE_CLAUSE_DESC"; +export type ExclusionConstraintOrderBy = + | 'ACCESS_METHOD_ASC' + | 'ACCESS_METHOD_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ELEMENT_EXPR_ASC' + | 'ELEMENT_EXPR_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPERATORS_ASC' + | 'OPERATORS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WHERE_CLAUSE_ASC' + | 'WHERE_CLAUSE_DESC'; /** Methods to use when ordering `Field`. */ -export type FieldOrderBy = "API_REQUIRED_ASC" | "API_REQUIRED_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CHK_ASC" | "CHK_DESC" | "CHK_EXPR_ASC" | "CHK_EXPR_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_VALUE_ASC" | "DEFAULT_VALUE_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_ORDER_ASC" | "FIELD_ORDER_DESC" | "GENERATION_EXPRESSION_ASC" | "GENERATION_EXPRESSION_DESC" | "GENERATION_TYPE_ASC" | "GENERATION_TYPE_DESC" | "IDENTITY_GENERATION_ASC" | "IDENTITY_GENERATION_DESC" | "IDENTITY_OPTIONS_ASC" | "IDENTITY_OPTIONS_DESC" | "ID_ASC" | "ID_DESC" | "IS_REQUIRED_ASC" | "IS_REQUIRED_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MAX_ASC" | "MAX_DESC" | "MIN_ASC" | "MIN_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REGEXP_ASC" | "REGEXP_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type FieldOrderBy = + | 'API_REQUIRED_ASC' + | 'API_REQUIRED_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CHK_ASC' + | 'CHK_DESC' + | 'CHK_EXPR_ASC' + | 'CHK_EXPR_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_VALUE_ASC' + | 'DEFAULT_VALUE_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_ORDER_ASC' + | 'FIELD_ORDER_DESC' + | 'GENERATION_EXPRESSION_ASC' + | 'GENERATION_EXPRESSION_DESC' + | 'GENERATION_TYPE_ASC' + | 'GENERATION_TYPE_DESC' + | 'IDENTITY_GENERATION_ASC' + | 'IDENTITY_GENERATION_DESC' + | 'IDENTITY_OPTIONS_ASC' + | 'IDENTITY_OPTIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_REQUIRED_ASC' + | 'IS_REQUIRED_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'MIN_ASC' + | 'MIN_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REGEXP_ASC' + | 'REGEXP_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `ForeignKeyConstraint`. */ -export type ForeignKeyConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACTION_ASC" | "DELETE_ACTION_DESC" | "DELETE_SET_FIELD_IDS_ASC" | "DELETE_SET_FIELD_IDS_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_IDS_ASC" | "REF_FIELD_IDS_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATE_ACTION_ASC" | "UPDATE_ACTION_DESC" | "WITH_PERIOD_ASC" | "WITH_PERIOD_DESC"; +export type ForeignKeyConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACTION_ASC' + | 'DELETE_ACTION_DESC' + | 'DELETE_SET_FIELD_IDS_ASC' + | 'DELETE_SET_FIELD_IDS_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_IDS_ASC' + | 'REF_FIELD_IDS_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATE_ACTION_ASC' + | 'UPDATE_ACTION_DESC' + | 'WITH_PERIOD_ASC' + | 'WITH_PERIOD_DESC'; /** Methods to use when ordering `FullTextSearch`. */ -export type FullTextSearchOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "ID_ASC" | "ID_DESC" | "LANGS_ASC" | "LANGS_DESC" | "LANG_COLUMN_ASC" | "LANG_COLUMN_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WEIGHTS_ASC" | "WEIGHTS_DESC"; +export type FullTextSearchOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LANGS_ASC' + | 'LANGS_DESC' + | 'LANG_COLUMN_ASC' + | 'LANG_COLUMN_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WEIGHTS_ASC' + | 'WEIGHTS_DESC'; /** Methods to use when ordering `Function`. */ -export type FunctionOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; +export type FunctionOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; /** Methods to use when ordering `HostnameBinding`. */ -export type HostnameBindingOrderBy = "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC"; +export type HostnameBindingOrderBy = + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC'; /** Methods to use when ordering `HttpRoute`. */ -export type HttpRouteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_ID_ASC" | "TARGET_ID_DESC" | "TARGET_KIND_ASC" | "TARGET_KIND_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type HttpRouteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_ID_ASC' + | 'TARGET_ID_DESC' + | 'TARGET_KIND_ASC' + | 'TARGET_KIND_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `Index`. */ -export type IndexOrderBy = "ACCESS_METHOD_ASC" | "ACCESS_METHOD_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INCLUDE_FIELD_IDS_ASC" | "INCLUDE_FIELD_IDS_DESC" | "INDEX_PARAMS_ASC" | "INDEX_PARAMS_DESC" | "IS_UNIQUE_ASC" | "IS_UNIQUE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "OP_CLASSES_ASC" | "OP_CLASSES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WHERE_CLAUSE_ASC" | "WHERE_CLAUSE_DESC"; +export type IndexOrderBy = + | 'ACCESS_METHOD_ASC' + | 'ACCESS_METHOD_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INCLUDE_FIELD_IDS_ASC' + | 'INCLUDE_FIELD_IDS_DESC' + | 'INDEX_PARAMS_ASC' + | 'INDEX_PARAMS_DESC' + | 'IS_UNIQUE_ASC' + | 'IS_UNIQUE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'OP_CLASSES_ASC' + | 'OP_CLASSES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WHERE_CLAUSE_ASC' + | 'WHERE_CLAUSE_DESC'; /** Methods to use when ordering `ManagedDomain`. */ -export type ManagedDomainOrderBy = "ALLOW_PUBLIC_USAGE_ASC" | "ALLOW_PUBLIC_USAGE_DESC" | "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CERT_STATUS_ASC" | "CERT_STATUS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; +export type ManagedDomainOrderBy = + | 'ALLOW_PUBLIC_USAGE_ASC' + | 'ALLOW_PUBLIC_USAGE_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CERT_STATUS_ASC' + | 'CERT_STATUS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; /** Methods to use when ordering `NodeTypeRegistry`. */ -export type NodeTypeRegistryOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMETER_SCHEMA_ASC" | "PARAMETER_SCHEMA_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "TAGS_ASC" | "TAGS_DESC"; -export type ObjectCategory = "APP" | "AUTH" | "CORE" | "MEMBERSHIPS" | "MODULE" | "PERMISSIONS"; +export type NodeTypeRegistryOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMETER_SCHEMA_ASC' + | 'PARAMETER_SCHEMA_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC'; +export type ObjectCategory = 'APP' | 'AUTH' | 'CORE' | 'MEMBERSHIPS' | 'MODULE' | 'PERMISSIONS'; /** Methods to use when ordering `Partition`. */ -export type PartitionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "IS_PARENTED_ASC" | "IS_PARENTED_DESC" | "NAMING_PATTERN_ASC" | "NAMING_PATTERN_DESC" | "NATURAL" | "PARTITION_KEY_ID_ASC" | "PARTITION_KEY_ID_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "RETENTION_KEEP_TABLE_ASC" | "RETENTION_KEEP_TABLE_DESC" | "STRATEGY_ASC" | "STRATEGY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PartitionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'IS_PARENTED_ASC' + | 'IS_PARENTED_DESC' + | 'NAMING_PATTERN_ASC' + | 'NAMING_PATTERN_DESC' + | 'NATURAL' + | 'PARTITION_KEY_ID_ASC' + | 'PARTITION_KEY_ID_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'RETENTION_KEEP_TABLE_ASC' + | 'RETENTION_KEEP_TABLE_DESC' + | 'STRATEGY_ASC' + | 'STRATEGY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformApiModule`. */ -export type PlatformApiModuleOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformApiModuleOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformApi`. */ -export type PlatformApiOrderBy = "ANON_ROLE_ASC" | "ANON_ROLE_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DBNAME_ASC" | "DBNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_NAME_ASC" | "ROLE_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformApiOrderBy = + | 'ANON_ROLE_ASC' + | 'ANON_ROLE_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DBNAME_ASC' + | 'DBNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_NAME_ASC' + | 'ROLE_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformApiSchema`. */ -export type PlatformApiSchemaOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformApiSchemaOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformApiSetting`. */ -export type PlatformApiSettingOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformApiSettingOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformCorsSetting`. */ -export type PlatformCorsSettingOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformCorsSettingOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformDomainEvent`. */ -export type PlatformDomainEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "DOMAIN_VERIFICATION_ID_ASC" | "DOMAIN_VERIFICATION_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformDomainEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'DOMAIN_VERIFICATION_ID_ASC' + | 'DOMAIN_VERIFICATION_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformDomain`. */ -export type PlatformDomainOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; +export type PlatformDomainOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; /** Methods to use when ordering `PlatformDomainVerification`. */ -export type PlatformDomainVerificationOrderBy = "ATTEMPTS_ASC" | "ATTEMPTS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LAST_CHECKED_AT_ASC" | "LAST_CHECKED_AT_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECORD_NAME_ASC" | "RECORD_NAME_DESC" | "RECORD_TYPE_ASC" | "RECORD_TYPE_DESC" | "RECORD_VALUE_ASC" | "RECORD_VALUE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; +export type PlatformDomainVerificationOrderBy = + | 'ATTEMPTS_ASC' + | 'ATTEMPTS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_CHECKED_AT_ASC' + | 'LAST_CHECKED_AT_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECORD_NAME_ASC' + | 'RECORD_NAME_DESC' + | 'RECORD_TYPE_ASC' + | 'RECORD_TYPE_DESC' + | 'RECORD_VALUE_ASC' + | 'RECORD_VALUE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; /** Methods to use when ordering `PlatformManagedDomain`. */ -export type PlatformManagedDomainOrderBy = "ALLOW_PUBLIC_USAGE_ASC" | "ALLOW_PUBLIC_USAGE_DESC" | "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CERT_STATUS_ASC" | "CERT_STATUS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; +export type PlatformManagedDomainOrderBy = + | 'ALLOW_PUBLIC_USAGE_ASC' + | 'ALLOW_PUBLIC_USAGE_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CERT_STATUS_ASC' + | 'CERT_STATUS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; /** Methods to use when ordering `PlatformSiteMetadatum`. */ -export type PlatformSiteMetadatumOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OG_IMAGE_ASC" | "OG_IMAGE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformSiteMetadatumOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OG_IMAGE_ASC' + | 'OG_IMAGE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformSiteModule`. */ -export type PlatformSiteModuleOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformSiteModuleOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformSite`. */ -export type PlatformSiteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformSiteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformSiteTheme`. */ -export type PlatformSiteThemeOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "THEME_ASC" | "THEME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformSiteThemeOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'THEME_ASC' + | 'THEME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Policy`. */ -export type PolicyOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "DISABLED_ASC" | "DISABLED_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PERMISSIVE_ASC" | "PERMISSIVE_DESC" | "POLICY_TYPE_ASC" | "POLICY_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITH_CHECK_ASC" | "WITH_CHECK_DESC"; +export type PolicyOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'DISABLED_ASC' + | 'DISABLED_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PERMISSIVE_ASC' + | 'PERMISSIVE_DESC' + | 'POLICY_TYPE_ASC' + | 'POLICY_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITH_CHECK_ASC' + | 'WITH_CHECK_DESC'; /** Methods to use when ordering `PrimaryKeyConstraint`. */ -export type PrimaryKeyConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITHOUT_OVERLAPS_ASC" | "WITHOUT_OVERLAPS_DESC"; +export type PrimaryKeyConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITHOUT_OVERLAPS_ASC' + | 'WITHOUT_OVERLAPS_DESC'; /** Methods to use when ordering `PubkeySetting`. */ -export type PubkeySettingOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC" | "SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC" | "SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC" | "SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC" | "SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC" | "SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC" | "SIGN_UP_WITH_KEY_FUNCTION_ID_ASC" | "SIGN_UP_WITH_KEY_FUNCTION_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_FIELD_ASC" | "USER_FIELD_DESC"; +export type PubkeySettingOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC' + | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC' + | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC' + | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC' + | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC' + | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC' + | 'SIGN_UP_WITH_KEY_FUNCTION_ID_ASC' + | 'SIGN_UP_WITH_KEY_FUNCTION_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_FIELD_ASC' + | 'USER_FIELD_DESC'; /** Methods to use when ordering `RlsSetting`. */ -export type RlsSettingOrderBy = "AUTHENTICATE_FUNCTION_ID_ASC" | "AUTHENTICATE_FUNCTION_ID_DESC" | "AUTHENTICATE_SCHEMA_ID_ASC" | "AUTHENTICATE_SCHEMA_ID_DESC" | "AUTHENTICATE_STRICT_FUNCTION_ID_ASC" | "AUTHENTICATE_STRICT_FUNCTION_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CURRENT_IP_ADDRESS_FUNCTION_ID_ASC" | "CURRENT_IP_ADDRESS_FUNCTION_ID_DESC" | "CURRENT_ROLE_FUNCTION_ID_ASC" | "CURRENT_ROLE_FUNCTION_ID_DESC" | "CURRENT_ROLE_ID_FUNCTION_ID_ASC" | "CURRENT_ROLE_ID_FUNCTION_ID_DESC" | "CURRENT_USER_AGENT_FUNCTION_ID_ASC" | "CURRENT_USER_AGENT_FUNCTION_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_SCHEMA_ID_ASC" | "ROLE_SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type RlsSettingOrderBy = + | 'AUTHENTICATE_FUNCTION_ID_ASC' + | 'AUTHENTICATE_FUNCTION_ID_DESC' + | 'AUTHENTICATE_SCHEMA_ID_ASC' + | 'AUTHENTICATE_SCHEMA_ID_DESC' + | 'AUTHENTICATE_STRICT_FUNCTION_ID_ASC' + | 'AUTHENTICATE_STRICT_FUNCTION_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CURRENT_IP_ADDRESS_FUNCTION_ID_ASC' + | 'CURRENT_IP_ADDRESS_FUNCTION_ID_DESC' + | 'CURRENT_ROLE_FUNCTION_ID_ASC' + | 'CURRENT_ROLE_FUNCTION_ID_DESC' + | 'CURRENT_ROLE_ID_FUNCTION_ID_ASC' + | 'CURRENT_ROLE_ID_FUNCTION_ID_DESC' + | 'CURRENT_USER_AGENT_FUNCTION_ID_ASC' + | 'CURRENT_USER_AGENT_FUNCTION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_SCHEMA_ID_ASC' + | 'ROLE_SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `RouteBinding`. */ -export type RouteBindingOrderBy = "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_API_ID_ASC" | "TARGET_API_ID_DESC" | "TARGET_FUNCTION_ID_ASC" | "TARGET_FUNCTION_ID_DESC" | "TARGET_SITE_ID_ASC" | "TARGET_SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type RouteBindingOrderBy = + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_API_ID_ASC' + | 'TARGET_API_ID_DESC' + | 'TARGET_FUNCTION_ID_ASC' + | 'TARGET_FUNCTION_ID_DESC' + | 'TARGET_SITE_ID_ASC' + | 'TARGET_SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Route`. */ -export type RouteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_API_ID_ASC" | "TARGET_API_ID_DESC" | "TARGET_FUNCTION_ID_ASC" | "TARGET_FUNCTION_ID_DESC" | "TARGET_SITE_ID_ASC" | "TARGET_SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type RouteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_API_ID_ASC' + | 'TARGET_API_ID_DESC' + | 'TARGET_FUNCTION_ID_ASC' + | 'TARGET_FUNCTION_ID_DESC' + | 'TARGET_SITE_ID_ASC' + | 'TARGET_SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `SchemaGrant`. */ -export type SchemaGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type SchemaGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Schema`. */ -export type SchemaOrderBy = "API_EXPOSURE_ASC" | "API_EXPOSURE_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLIC_ASC" | "IS_PUBLIC_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_NAME_ASC" | "SCHEMA_NAME_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type SchemaOrderBy = + | 'API_EXPOSURE_ASC' + | 'API_EXPOSURE_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLIC_ASC' + | 'IS_PUBLIC_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_NAME_ASC' + | 'SCHEMA_NAME_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `SiteMetadatum`. */ -export type SiteMetadatumOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OG_IMAGE_ASC" | "OG_IMAGE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type SiteMetadatumOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OG_IMAGE_ASC' + | 'OG_IMAGE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `SiteModule`. */ -export type SiteModuleOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type SiteModuleOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Site`. */ -export type SiteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type SiteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `SiteTheme`. */ -export type SiteThemeOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "THEME_ASC" | "THEME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type SiteThemeOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'THEME_ASC' + | 'THEME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `SpatialRelation`. */ -export type SpatialRelationOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPERATOR_ASC" | "OPERATOR_DESC" | "PARAM_NAME_ASC" | "PARAM_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_ID_ASC" | "REF_FIELD_ID_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type SpatialRelationOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPERATOR_ASC' + | 'OPERATOR_DESC' + | 'PARAM_NAME_ASC' + | 'PARAM_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_ID_ASC' + | 'REF_FIELD_ID_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `SqlAction`. */ -export type SqlActionOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "DEPS_ASC" | "DEPS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; +export type SqlActionOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'DEPS_ASC' + | 'DEPS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; /** Methods to use when ordering `TableGrant`. */ -export type TableGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type TableGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Table`. */ -export type TableOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INHERITS_ID_ASC" | "INHERITS_ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARTITIONED_ASC" | "PARTITIONED_DESC" | "PARTITION_KEY_NAMES_ASC" | "PARTITION_KEY_NAMES_DESC" | "PARTITION_KEY_TYPES_ASC" | "PARTITION_KEY_TYPES_DESC" | "PARTITION_STRATEGY_ASC" | "PARTITION_STRATEGY_DESC" | "PEOPLESTAMPS_ASC" | "PEOPLESTAMPS_DESC" | "PLURAL_NAME_ASC" | "PLURAL_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SINGULAR_NAME_ASC" | "SINGULAR_NAME_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "STEP_UP_ASC" | "STEP_UP_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TIMESTAMPS_ASC" | "TIMESTAMPS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USE_RLS_ASC" | "USE_RLS_DESC"; +export type TableOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INHERITS_ID_ASC' + | 'INHERITS_ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARTITIONED_ASC' + | 'PARTITIONED_DESC' + | 'PARTITION_KEY_NAMES_ASC' + | 'PARTITION_KEY_NAMES_DESC' + | 'PARTITION_KEY_TYPES_ASC' + | 'PARTITION_KEY_TYPES_DESC' + | 'PARTITION_STRATEGY_ASC' + | 'PARTITION_STRATEGY_DESC' + | 'PEOPLESTAMPS_ASC' + | 'PEOPLESTAMPS_DESC' + | 'PLURAL_NAME_ASC' + | 'PLURAL_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SINGULAR_NAME_ASC' + | 'SINGULAR_NAME_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'STEP_UP_ASC' + | 'STEP_UP_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TIMESTAMPS_ASC' + | 'TIMESTAMPS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USE_RLS_ASC' + | 'USE_RLS_DESC'; /** Methods to use when ordering `TriggerFunction`. */ -export type TriggerFunctionOrderBy = "CODE_ASC" | "CODE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type TriggerFunctionOrderBy = + | 'CODE_ASC' + | 'CODE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Trigger`. */ -export type TriggerOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_ASC" | "EVENT_DESC" | "FUNCTION_NAME_ASC" | "FUNCTION_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type TriggerOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'FUNCTION_NAME_ASC' + | 'FUNCTION_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `UniqueConstraint`. */ -export type UniqueConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITHOUT_OVERLAPS_ASC" | "WITHOUT_OVERLAPS_DESC"; +export type UniqueConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITHOUT_OVERLAPS_ASC' + | 'WITHOUT_OVERLAPS_DESC'; /** Methods to use when ordering `ViewGrant`. */ -export type ViewGrantOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC" | "WITH_GRANT_OPTION_ASC" | "WITH_GRANT_OPTION_DESC"; +export type ViewGrantOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC' + | 'WITH_GRANT_OPTION_ASC' + | 'WITH_GRANT_OPTION_DESC'; /** Methods to use when ordering `View`. */ -export type ViewOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CHECK_OPTION_ASC" | "CHECK_OPTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "FILTER_DATA_ASC" | "FILTER_DATA_DESC" | "FILTER_TYPE_ASC" | "FILTER_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECURITY_BARRIER_ASC" | "SECURITY_BARRIER_DESC" | "SECURITY_INVOKER_ASC" | "SECURITY_INVOKER_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "VIEW_TYPE_ASC" | "VIEW_TYPE_DESC"; +export type ViewOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CHECK_OPTION_ASC' + | 'CHECK_OPTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'FILTER_DATA_ASC' + | 'FILTER_DATA_DESC' + | 'FILTER_TYPE_ASC' + | 'FILTER_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECURITY_BARRIER_ASC' + | 'SECURITY_BARRIER_DESC' + | 'SECURITY_INVOKER_ASC' + | 'SECURITY_INVOKER_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'VIEW_TYPE_ASC' + | 'VIEW_TYPE_DESC'; /** Methods to use when ordering `ViewRule`. */ -export type ViewRuleOrderBy = "ACTION_ASC" | "ACTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_ASC" | "EVENT_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC"; +export type ViewRuleOrderBy = + | 'ACTION_ASC' + | 'ACTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC'; /** Methods to use when ordering `ViewTable`. */ -export type ViewTableOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOIN_ORDER_ASC" | "JOIN_ORDER_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC"; +export type ViewTableOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOIN_ORDER_ASC' + | 'JOIN_ORDER_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC'; /** Methods to use when ordering `WebauthnSetting`. */ -export type WebauthnSettingOrderBy = "ATTESTATION_TYPE_ASC" | "ATTESTATION_TYPE_DESC" | "CHALLENGE_EXPIRY_SECONDS_ASC" | "CHALLENGE_EXPIRY_SECONDS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREDENTIALS_SCHEMA_ID_ASC" | "CREDENTIALS_SCHEMA_ID_DESC" | "CREDENTIALS_TABLE_ID_ASC" | "CREDENTIALS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORIGIN_ALLOWLIST_ASC" | "ORIGIN_ALLOWLIST_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRE_USER_VERIFICATION_ASC" | "REQUIRE_USER_VERIFICATION_DESC" | "RESIDENT_KEY_ASC" | "RESIDENT_KEY_DESC" | "RP_ID_ASC" | "RP_ID_DESC" | "RP_NAME_ASC" | "RP_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_SCHEMA_ID_ASC" | "SESSIONS_SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_SECRETS_SCHEMA_ID_ASC" | "SESSION_SECRETS_SCHEMA_ID_DESC" | "SESSION_SECRETS_TABLE_ID_ASC" | "SESSION_SECRETS_TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_FIELD_ID_ASC" | "USER_FIELD_ID_DESC"; +export type WebauthnSettingOrderBy = + | 'ATTESTATION_TYPE_ASC' + | 'ATTESTATION_TYPE_DESC' + | 'CHALLENGE_EXPIRY_SECONDS_ASC' + | 'CHALLENGE_EXPIRY_SECONDS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREDENTIALS_SCHEMA_ID_ASC' + | 'CREDENTIALS_SCHEMA_ID_DESC' + | 'CREDENTIALS_TABLE_ID_ASC' + | 'CREDENTIALS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORIGIN_ALLOWLIST_ASC' + | 'ORIGIN_ALLOWLIST_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRE_USER_VERIFICATION_ASC' + | 'REQUIRE_USER_VERIFICATION_DESC' + | 'RESIDENT_KEY_ASC' + | 'RESIDENT_KEY_DESC' + | 'RP_ID_ASC' + | 'RP_ID_DESC' + | 'RP_NAME_ASC' + | 'RP_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_SCHEMA_ID_ASC' + | 'SESSIONS_SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_SECRETS_SCHEMA_ID_ASC' + | 'SESSION_SECRETS_SCHEMA_ID_DESC' + | 'SESSION_SECRETS_TABLE_ID_ASC' + | 'SESSION_SECRETS_TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_FIELD_ID_ASC' + | 'USER_FIELD_ID_DESC'; export interface AcceptDatabaseTransferInput { clientMutationId?: string; transferId?: string; @@ -9247,4 +11001,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/api/types.ts b/sdk/constructive-react/src/api/types.ts index a6738bcfa2..7f201a963e 100644 --- a/sdk/constructive-react/src/api/types.ts +++ b/sdk/constructive-react/src/api/types.ts @@ -3,7 +3,7 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import type { ApiExposureLevel, ObjectCategory } from "./schema-types"; +import type { ApiExposureLevel, ObjectCategory } from './schema-types'; export type ConstructiveInternalTypeImage = unknown; export interface Api { anonRole: string | null; @@ -1098,4 +1098,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/hooks/client.ts b/sdk/constructive-react/src/auth/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/auth/hooks/client.ts +++ b/sdk/constructive-react/src/auth/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/auth/hooks/index.ts b/sdk/constructive-react/src/auth/hooks/index.ts index 0b7d2b968b..7d01e7b11d 100644 --- a/sdk/constructive-react/src/auth/hooks/index.ts +++ b/sdk/constructive-react/src/auth/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: AuditLogAuth, CryptoAddress, Email, IdentityProvider, OrgApiKeyList, PhoneNumber, Principal, PrincipalEntity, PrincipalScopeOverride, RoleType, UserConnectedAccount, User, WebauthnCredential - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/auth/hooks/invalidation.ts b/sdk/constructive-react/src/auth/hooks/invalidation.ts index 32ce162992..dfe4aad49c 100644 --- a/sdk/constructive-react/src/auth/hooks/invalidation.ts +++ b/sdk/constructive-react/src/auth/hooks/invalidation.ts @@ -13,8 +13,22 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { auditLogAuthKeys, cryptoAddressKeys, emailKeys, identityProviderKeys, orgApiKeyListKeys, phoneNumberKeys, principalKeys, principalEntityKeys, principalScopeOverrideKeys, roleTypeKeys, userConnectedAccountKeys, userKeys, webauthnCredentialKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + auditLogAuthKeys, + cryptoAddressKeys, + emailKeys, + identityProviderKeys, + orgApiKeyListKeys, + phoneNumberKeys, + principalKeys, + principalEntityKeys, + principalScopeOverrideKeys, + roleTypeKeys, + userConnectedAccountKeys, + userKeys, + webauthnCredentialKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,149 +49,218 @@ import { auditLogAuthKeys, cryptoAddressKeys, emailKeys, identityProviderKeys, o * ``` */ export const invalidate = { - /** Invalidate auditLogAuth queries */auditLogAuth: { - /** Invalidate all auditLogAuth queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: auditLogAuthKeys.all - }), - /** Invalidate auditLogAuth list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: auditLogAuthKeys.lists() - }), - /** Invalidate a specific auditLogAuth */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: auditLogAuthKeys.detail(id) - }) + /** Invalidate auditLogAuth queries */ auditLogAuth: { + /** Invalidate all auditLogAuth queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: auditLogAuthKeys.all, + }), + /** Invalidate auditLogAuth list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: auditLogAuthKeys.lists(), + }), + /** Invalidate a specific auditLogAuth */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: auditLogAuthKeys.detail(id), + }), }, - /** Invalidate cryptoAddress queries */cryptoAddress: { - /** Invalidate all cryptoAddress queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: cryptoAddressKeys.all - }), - /** Invalidate cryptoAddress list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: cryptoAddressKeys.lists() - }), - /** Invalidate a specific cryptoAddress */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: cryptoAddressKeys.detail(id) - }) + /** Invalidate cryptoAddress queries */ cryptoAddress: { + /** Invalidate all cryptoAddress queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: cryptoAddressKeys.all, + }), + /** Invalidate cryptoAddress list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: cryptoAddressKeys.lists(), + }), + /** Invalidate a specific cryptoAddress */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: cryptoAddressKeys.detail(id), + }), }, - /** Invalidate email queries */email: { - /** Invalidate all email queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: emailKeys.all - }), - /** Invalidate email list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: emailKeys.lists() - }), - /** Invalidate a specific email */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: emailKeys.detail(id) - }) + /** Invalidate email queries */ email: { + /** Invalidate all email queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: emailKeys.all, + }), + /** Invalidate email list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: emailKeys.lists(), + }), + /** Invalidate a specific email */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: emailKeys.detail(id), + }), }, - /** Invalidate identityProvider queries */identityProvider: { - /** Invalidate all identityProvider queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: identityProviderKeys.all - }), - /** Invalidate identityProvider list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: identityProviderKeys.lists() - }), - /** Invalidate a specific identityProvider */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: identityProviderKeys.detail(id) - }) + /** Invalidate identityProvider queries */ identityProvider: { + /** Invalidate all identityProvider queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: identityProviderKeys.all, + }), + /** Invalidate identityProvider list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: identityProviderKeys.lists(), + }), + /** Invalidate a specific identityProvider */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: identityProviderKeys.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 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 phoneNumber queries */phoneNumber: { - /** Invalidate all phoneNumber queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: phoneNumberKeys.all - }), - /** Invalidate phoneNumber list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: phoneNumberKeys.lists() - }), - /** Invalidate a specific phoneNumber */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: phoneNumberKeys.detail(id) - }) + /** Invalidate phoneNumber queries */ phoneNumber: { + /** Invalidate all phoneNumber queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: phoneNumberKeys.all, + }), + /** Invalidate phoneNumber list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: phoneNumberKeys.lists(), + }), + /** Invalidate a specific phoneNumber */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: phoneNumberKeys.detail(id), + }), }, - /** 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 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 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 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 roleType queries */roleType: { - /** Invalidate all roleType queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: roleTypeKeys.all - }), - /** Invalidate roleType list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: roleTypeKeys.lists() - }), - /** Invalidate a specific roleType */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: roleTypeKeys.detail(id) - }) + /** Invalidate roleType queries */ roleType: { + /** Invalidate all roleType queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: roleTypeKeys.all, + }), + /** Invalidate roleType list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: roleTypeKeys.lists(), + }), + /** Invalidate a specific roleType */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: roleTypeKeys.detail(id), + }), }, - /** Invalidate userConnectedAccount queries */userConnectedAccount: { - /** Invalidate all userConnectedAccount queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userConnectedAccountKeys.all - }), - /** Invalidate userConnectedAccount list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userConnectedAccountKeys.lists() - }), - /** Invalidate a specific userConnectedAccount */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: userConnectedAccountKeys.detail(id) - }) + /** Invalidate userConnectedAccount queries */ userConnectedAccount: { + /** Invalidate all userConnectedAccount queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userConnectedAccountKeys.all, + }), + /** Invalidate userConnectedAccount list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userConnectedAccountKeys.lists(), + }), + /** Invalidate a specific userConnectedAccount */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: userConnectedAccountKeys.detail(id), + }), }, - /** Invalidate user queries */user: { - /** Invalidate all user queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userKeys.all - }), - /** Invalidate user list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userKeys.lists() - }), - /** Invalidate a specific user */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: userKeys.detail(id) - }) + /** Invalidate user queries */ user: { + /** Invalidate all user queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userKeys.all, + }), + /** Invalidate user list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userKeys.lists(), + }), + /** Invalidate a specific user */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: userKeys.detail(id), + }), + }, + /** Invalidate webauthnCredential queries */ webauthnCredential: { + /** Invalidate all webauthnCredential queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webauthnCredentialKeys.all, + }), + /** Invalidate webauthnCredential list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webauthnCredentialKeys.lists(), + }), + /** Invalidate a specific webauthnCredential */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: webauthnCredentialKeys.detail(id), + }), }, - /** Invalidate webauthnCredential queries */webauthnCredential: { - /** Invalidate all webauthnCredential queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webauthnCredentialKeys.all - }), - /** Invalidate webauthnCredential list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webauthnCredentialKeys.lists() - }), - /** Invalidate a specific webauthnCredential */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: webauthnCredentialKeys.detail(id) - }) - } } as const; /** @@ -191,69 +274,96 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove auditLogAuth from cache */auditLogAuth: (queryClient: QueryClient, id: string | number) => { + /** Remove auditLogAuth from cache */ auditLogAuth: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: auditLogAuthKeys.detail(id) + queryKey: auditLogAuthKeys.detail(id), }); }, - /** Remove cryptoAddress from cache */cryptoAddress: (queryClient: QueryClient, id: string | number) => { + /** Remove cryptoAddress from cache */ cryptoAddress: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: cryptoAddressKeys.detail(id) + queryKey: cryptoAddressKeys.detail(id), }); }, - /** Remove email from cache */email: (queryClient: QueryClient, id: string | number) => { + /** Remove email from cache */ email: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: emailKeys.detail(id) + queryKey: emailKeys.detail(id), }); }, - /** Remove identityProvider from cache */identityProvider: (queryClient: QueryClient, id: string | number) => { + /** Remove identityProvider from cache */ identityProvider: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: identityProviderKeys.detail(id) + queryKey: identityProviderKeys.detail(id), }); }, - /** Remove orgApiKeyList from cache */orgApiKeyList: (queryClient: QueryClient, id: string | number) => { + /** Remove orgApiKeyList from cache */ orgApiKeyList: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgApiKeyListKeys.detail(id) + queryKey: orgApiKeyListKeys.detail(id), }); }, - /** Remove phoneNumber from cache */phoneNumber: (queryClient: QueryClient, id: string | number) => { + /** Remove phoneNumber from cache */ phoneNumber: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: phoneNumberKeys.detail(id) + queryKey: phoneNumberKeys.detail(id), }); }, - /** Remove principal from cache */principal: (queryClient: QueryClient, id: string | number) => { + /** Remove principal from cache */ principal: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: principalKeys.detail(id) + queryKey: principalKeys.detail(id), }); }, - /** Remove principalEntity from cache */principalEntity: (queryClient: QueryClient, id: string | number) => { + /** Remove principalEntity from cache */ principalEntity: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: principalEntityKeys.detail(id) + queryKey: principalEntityKeys.detail(id), }); }, - /** Remove principalScopeOverride from cache */principalScopeOverride: (queryClient: QueryClient, id: string | number) => { + /** Remove principalScopeOverride from cache */ principalScopeOverride: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: principalScopeOverrideKeys.detail(id) + queryKey: principalScopeOverrideKeys.detail(id), }); }, - /** Remove roleType from cache */roleType: (queryClient: QueryClient, id: string | number) => { + /** Remove roleType from cache */ roleType: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: roleTypeKeys.detail(id) + queryKey: roleTypeKeys.detail(id), }); }, - /** Remove userConnectedAccount from cache */userConnectedAccount: (queryClient: QueryClient, id: string | number) => { + /** Remove userConnectedAccount from cache */ userConnectedAccount: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: userConnectedAccountKeys.detail(id) + queryKey: userConnectedAccountKeys.detail(id), }); }, - /** Remove user from cache */user: (queryClient: QueryClient, id: string | number) => { + /** Remove user from cache */ user: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: userKeys.detail(id) + queryKey: userKeys.detail(id), }); }, - /** Remove webauthnCredential from cache */webauthnCredential: (queryClient: QueryClient, id: string | number) => { + /** Remove webauthnCredential from cache */ webauthnCredential: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: webauthnCredentialKeys.detail(id) + queryKey: webauthnCredentialKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/auth/hooks/mutation-keys.ts b/sdk/constructive-react/src/auth/hooks/mutation-keys.ts index c974b76a8f..f288e7b2b7 100644 --- a/sdk/constructive-react/src/auth/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/auth/hooks/mutation-keys.ts @@ -19,82 +19,120 @@ // ============================================================================ export const auditLogAuthMutationKeys = { - /** All auditLogAuth mutation keys */all: ["mutation", "auditlogauth"] as const, - /** Create auditLogAuth mutation key */create: () => ["mutation", "auditlogauth", "create"] as const, - /** Update auditLogAuth mutation key */update: (id: string | number) => ["mutation", "auditlogauth", "update", id] as const, - /** Delete auditLogAuth mutation key */delete: (id: string | number) => ["mutation", "auditlogauth", "delete", id] as const + /** All auditLogAuth mutation keys */ all: ['mutation', 'auditlogauth'] as const, + /** Create auditLogAuth mutation key */ create: () => + ['mutation', 'auditlogauth', 'create'] as const, + /** Update auditLogAuth mutation key */ update: (id: string | number) => + ['mutation', 'auditlogauth', 'update', id] as const, + /** Delete auditLogAuth mutation key */ delete: (id: string | number) => + ['mutation', 'auditlogauth', 'delete', id] as const, } as const; export const cryptoAddressMutationKeys = { - /** All cryptoAddress mutation keys */all: ["mutation", "cryptoaddress"] as const, - /** Create cryptoAddress mutation key */create: () => ["mutation", "cryptoaddress", "create"] as const, - /** Update cryptoAddress mutation key */update: (id: string | number) => ["mutation", "cryptoaddress", "update", id] as const, - /** Delete cryptoAddress mutation key */delete: (id: string | number) => ["mutation", "cryptoaddress", "delete", id] as const + /** All cryptoAddress mutation keys */ all: ['mutation', 'cryptoaddress'] as const, + /** Create cryptoAddress mutation key */ create: () => + ['mutation', 'cryptoaddress', 'create'] as const, + /** Update cryptoAddress mutation key */ update: (id: string | number) => + ['mutation', 'cryptoaddress', 'update', id] as const, + /** Delete cryptoAddress mutation key */ delete: (id: string | number) => + ['mutation', 'cryptoaddress', '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, - /** Update email mutation key */update: (id: string | number) => ["mutation", "email", "update", id] as const, - /** Delete email mutation key */delete: (id: string | number) => ["mutation", "email", "delete", id] as const + /** All email mutation keys */ all: ['mutation', 'email'] as const, + /** Create email mutation key */ create: () => ['mutation', 'email', 'create'] as const, + /** Update email mutation key */ update: (id: string | number) => + ['mutation', 'email', 'update', id] as const, + /** Delete email mutation key */ delete: (id: string | number) => + ['mutation', 'email', 'delete', id] as const, } as const; export const identityProviderMutationKeys = { - /** All identityProvider mutation keys */all: ["mutation", "identityprovider"] as const, - /** Create identityProvider mutation key */create: () => ["mutation", "identityprovider", "create"] as const, - /** Update identityProvider mutation key */update: (id: string | number) => ["mutation", "identityprovider", "update", id] as const, - /** Delete identityProvider mutation key */delete: (id: string | number) => ["mutation", "identityprovider", "delete", id] as const + /** All identityProvider mutation keys */ all: ['mutation', 'identityprovider'] as const, + /** Create identityProvider mutation key */ create: () => + ['mutation', 'identityprovider', 'create'] as const, + /** Update identityProvider mutation key */ update: (id: string | number) => + ['mutation', 'identityprovider', 'update', id] as const, + /** Delete identityProvider mutation key */ delete: (id: string | number) => + ['mutation', 'identityprovider', '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 + /** 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 phoneNumberMutationKeys = { - /** All phoneNumber mutation keys */all: ["mutation", "phonenumber"] as const, - /** Create phoneNumber mutation key */create: () => ["mutation", "phonenumber", "create"] as const, - /** Update phoneNumber mutation key */update: (id: string | number) => ["mutation", "phonenumber", "update", id] as const, - /** Delete phoneNumber mutation key */delete: (id: string | number) => ["mutation", "phonenumber", "delete", id] as const + /** All phoneNumber mutation keys */ all: ['mutation', 'phonenumber'] as const, + /** Create phoneNumber mutation key */ create: () => + ['mutation', 'phonenumber', 'create'] as const, + /** Update phoneNumber mutation key */ update: (id: string | number) => + ['mutation', 'phonenumber', 'update', id] as const, + /** Delete phoneNumber mutation key */ delete: (id: string | number) => + ['mutation', 'phonenumber', 'delete', id] as const, } as const; 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 + /** 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 + /** 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 + /** 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 roleTypeMutationKeys = { - /** All roleType mutation keys */all: ["mutation", "roletype"] as const, - /** Create roleType mutation key */create: () => ["mutation", "roletype", "create"] as const, - /** Update roleType mutation key */update: (id: string | number) => ["mutation", "roletype", "update", id] as const, - /** Delete roleType mutation key */delete: (id: string | number) => ["mutation", "roletype", "delete", id] as const + /** All roleType mutation keys */ all: ['mutation', 'roletype'] as const, + /** Create roleType mutation key */ create: () => ['mutation', 'roletype', 'create'] as const, + /** Update roleType mutation key */ update: (id: string | number) => + ['mutation', 'roletype', 'update', id] as const, + /** Delete roleType mutation key */ delete: (id: string | number) => + ['mutation', 'roletype', 'delete', id] as const, } as const; export const userConnectedAccountMutationKeys = { - /** All userConnectedAccount mutation keys */all: ["mutation", "userconnectedaccount"] as const, - /** Create userConnectedAccount mutation key */create: () => ["mutation", "userconnectedaccount", "create"] as const, - /** Update userConnectedAccount mutation key */update: (id: string | number) => ["mutation", "userconnectedaccount", "update", id] as const, - /** Delete userConnectedAccount mutation key */delete: (id: string | number) => ["mutation", "userconnectedaccount", "delete", id] as const + /** All userConnectedAccount mutation keys */ all: ['mutation', 'userconnectedaccount'] as const, + /** Create userConnectedAccount mutation key */ create: () => + ['mutation', 'userconnectedaccount', 'create'] as const, + /** Update userConnectedAccount mutation key */ update: (id: string | number) => + ['mutation', 'userconnectedaccount', 'update', id] as const, + /** Delete userConnectedAccount mutation key */ delete: (id: string | number) => + ['mutation', 'userconnectedaccount', '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, - /** Update user mutation key */update: (id: string | number) => ["mutation", "user", "update", id] as const, - /** Delete user mutation key */delete: (id: string | number) => ["mutation", "user", "delete", id] as const + /** All user mutation keys */ all: ['mutation', 'user'] as const, + /** Create user mutation key */ create: () => ['mutation', 'user', 'create'] as const, + /** Update user mutation key */ update: (id: string | number) => + ['mutation', 'user', 'update', id] as const, + /** Delete user mutation key */ delete: (id: string | number) => + ['mutation', 'user', 'delete', id] as const, } as const; export const webauthnCredentialMutationKeys = { - /** All webauthnCredential mutation keys */all: ["mutation", "webauthncredential"] as const, - /** Create webauthnCredential mutation key */create: () => ["mutation", "webauthncredential", "create"] as const, - /** Update webauthnCredential mutation key */update: (id: string | number) => ["mutation", "webauthncredential", "update", id] as const, - /** Delete webauthnCredential mutation key */delete: (id: string | number) => ["mutation", "webauthncredential", "delete", id] as const + /** All webauthnCredential mutation keys */ all: ['mutation', 'webauthncredential'] as const, + /** Create webauthnCredential mutation key */ create: () => + ['mutation', 'webauthncredential', 'create'] as const, + /** Update webauthnCredential mutation key */ update: (id: string | number) => + ['mutation', 'webauthncredential', 'update', id] as const, + /** Delete webauthnCredential mutation key */ delete: (id: string | number) => + ['mutation', 'webauthncredential', 'delete', id] as const, } as const; // ============================================================================ @@ -102,36 +140,124 @@ export const webauthnCredentialMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for checkPassword */checkPassword: (identifier?: string) => identifier ? ["mutation", "checkPassword", identifier] as const : ["mutation", "checkPassword"] as const, - /** Mutation key for confirmDeleteAccount */confirmDeleteAccount: (identifier?: string) => identifier ? ["mutation", "confirmDeleteAccount", identifier] as const : ["mutation", "confirmDeleteAccount"] as const, - /** Mutation key for createApiKey */createApiKey: (identifier?: string) => identifier ? ["mutation", "createApiKey", identifier] as const : ["mutation", "createApiKey"] as const, - /** Mutation key for createOrgApiKey */createOrgApiKey: (identifier?: string) => identifier ? ["mutation", "createOrgApiKey", identifier] as const : ["mutation", "createOrgApiKey"] as const, - /** Mutation key for createOrgPrincipal */createOrgPrincipal: (identifier?: string) => identifier ? ["mutation", "createOrgPrincipal", identifier] as const : ["mutation", "createOrgPrincipal"] as const, - /** Mutation key for deleteOrgPrincipal */deleteOrgPrincipal: (identifier?: string) => identifier ? ["mutation", "deleteOrgPrincipal", identifier] as const : ["mutation", "deleteOrgPrincipal"] as const, - /** Mutation key for deletePrincipal */deletePrincipal: (identifier?: string) => identifier ? ["mutation", "deletePrincipal", identifier] as const : ["mutation", "deletePrincipal"] as const, - /** Mutation key for disconnectAccount */disconnectAccount: (identifier?: string) => identifier ? ["mutation", "disconnectAccount", identifier] as const : ["mutation", "disconnectAccount"] as const, - /** Mutation key for extendTokenExpires */extendTokenExpires: (identifier?: string) => identifier ? ["mutation", "extendTokenExpires", identifier] as const : ["mutation", "extendTokenExpires"] as const, - /** Mutation key for forgotPassword */forgotPassword: (identifier?: string) => identifier ? ["mutation", "forgotPassword", identifier] as const : ["mutation", "forgotPassword"] as const, - /** Mutation key for linkIdentity */linkIdentity: (identifier?: string) => identifier ? ["mutation", "linkIdentity", identifier] as const : ["mutation", "linkIdentity"] as const, - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const, - /** Mutation key for provisionNewUser */provisionNewUser: (identifier?: string) => identifier ? ["mutation", "provisionNewUser", identifier] as const : ["mutation", "provisionNewUser"] as const, - /** Mutation key for requestCrossOriginToken */requestCrossOriginToken: (identifier?: string) => identifier ? ["mutation", "requestCrossOriginToken", identifier] as const : ["mutation", "requestCrossOriginToken"] as const, - /** Mutation key for resetPassword */resetPassword: (identifier?: string) => identifier ? ["mutation", "resetPassword", identifier] as const : ["mutation", "resetPassword"] as const, - /** Mutation key for revokeApiKey */revokeApiKey: (identifier?: string) => identifier ? ["mutation", "revokeApiKey", identifier] as const : ["mutation", "revokeApiKey"] as const, - /** Mutation key for revokeOrgApiKey */revokeOrgApiKey: (identifier?: string) => identifier ? ["mutation", "revokeOrgApiKey", identifier] as const : ["mutation", "revokeOrgApiKey"] as const, - /** Mutation key for revokeSession */revokeSession: (identifier?: string) => identifier ? ["mutation", "revokeSession", identifier] as const : ["mutation", "revokeSession"] as const, - /** Mutation key for sendAccountDeletionEmail */sendAccountDeletionEmail: (identifier?: string) => identifier ? ["mutation", "sendAccountDeletionEmail", identifier] as const : ["mutation", "sendAccountDeletionEmail"] as const, - /** Mutation key for sendVerificationEmail */sendVerificationEmail: (identifier?: string) => identifier ? ["mutation", "sendVerificationEmail", identifier] as const : ["mutation", "sendVerificationEmail"] as const, - /** Mutation key for setPassword */setPassword: (identifier?: string) => identifier ? ["mutation", "setPassword", identifier] as const : ["mutation", "setPassword"] as const, - /** Mutation key for signIn */signIn: (identifier?: string) => identifier ? ["mutation", "signIn", identifier] as const : ["mutation", "signIn"] as const, - /** Mutation key for signInCrossOrigin */signInCrossOrigin: (identifier?: string) => identifier ? ["mutation", "signInCrossOrigin", identifier] as const : ["mutation", "signInCrossOrigin"] as const, - /** Mutation key for signInSmsOtp */signInSmsOtp: (identifier?: string) => identifier ? ["mutation", "signInSmsOtp", identifier] as const : ["mutation", "signInSmsOtp"] as const, - /** Mutation key for signOut */signOut: (identifier?: string) => identifier ? ["mutation", "signOut", identifier] as const : ["mutation", "signOut"] as const, - /** Mutation key for signUp */signUp: (identifier?: string) => identifier ? ["mutation", "signUp", identifier] as const : ["mutation", "signUp"] as const, - /** Mutation key for signUpSms */signUpSms: (identifier?: string) => identifier ? ["mutation", "signUpSms", identifier] as const : ["mutation", "signUpSms"] as const, - /** Mutation key for verifyEmail */verifyEmail: (identifier?: string) => identifier ? ["mutation", "verifyEmail", identifier] as const : ["mutation", "verifyEmail"] as const, - /** Mutation key for verifyPassword */verifyPassword: (identifier?: string) => identifier ? ["mutation", "verifyPassword", identifier] as const : ["mutation", "verifyPassword"] as const, - /** Mutation key for verifyTotp */verifyTotp: (identifier?: string) => identifier ? ["mutation", "verifyTotp", identifier] as const : ["mutation", "verifyTotp"] as const + /** Mutation key for checkPassword */ checkPassword: (identifier?: string) => + identifier + ? (['mutation', 'checkPassword', identifier] as const) + : (['mutation', 'checkPassword'] as const), + /** Mutation key for confirmDeleteAccount */ confirmDeleteAccount: (identifier?: string) => + identifier + ? (['mutation', 'confirmDeleteAccount', identifier] as const) + : (['mutation', 'confirmDeleteAccount'] as const), + /** Mutation key for createApiKey */ createApiKey: (identifier?: string) => + identifier + ? (['mutation', 'createApiKey', identifier] as const) + : (['mutation', 'createApiKey'] as const), + /** Mutation key for createOrgApiKey */ createOrgApiKey: (identifier?: string) => + identifier + ? (['mutation', 'createOrgApiKey', identifier] as const) + : (['mutation', 'createOrgApiKey'] as const), + /** Mutation key for createOrgPrincipal */ createOrgPrincipal: (identifier?: string) => + identifier + ? (['mutation', 'createOrgPrincipal', identifier] as const) + : (['mutation', 'createOrgPrincipal'] as const), + /** Mutation key for deleteOrgPrincipal */ deleteOrgPrincipal: (identifier?: string) => + identifier + ? (['mutation', 'deleteOrgPrincipal', identifier] as const) + : (['mutation', 'deleteOrgPrincipal'] as const), + /** Mutation key for deletePrincipal */ deletePrincipal: (identifier?: string) => + identifier + ? (['mutation', 'deletePrincipal', identifier] as const) + : (['mutation', 'deletePrincipal'] as const), + /** Mutation key for disconnectAccount */ disconnectAccount: (identifier?: string) => + identifier + ? (['mutation', 'disconnectAccount', identifier] as const) + : (['mutation', 'disconnectAccount'] as const), + /** Mutation key for extendTokenExpires */ extendTokenExpires: (identifier?: string) => + identifier + ? (['mutation', 'extendTokenExpires', identifier] as const) + : (['mutation', 'extendTokenExpires'] as const), + /** Mutation key for forgotPassword */ forgotPassword: (identifier?: string) => + identifier + ? (['mutation', 'forgotPassword', identifier] as const) + : (['mutation', 'forgotPassword'] as const), + /** Mutation key for linkIdentity */ linkIdentity: (identifier?: string) => + identifier + ? (['mutation', 'linkIdentity', identifier] as const) + : (['mutation', 'linkIdentity'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), + /** Mutation key for provisionNewUser */ provisionNewUser: (identifier?: string) => + identifier + ? (['mutation', 'provisionNewUser', identifier] as const) + : (['mutation', 'provisionNewUser'] as const), + /** Mutation key for requestCrossOriginToken */ requestCrossOriginToken: (identifier?: string) => + identifier + ? (['mutation', 'requestCrossOriginToken', identifier] as const) + : (['mutation', 'requestCrossOriginToken'] as const), + /** Mutation key for resetPassword */ resetPassword: (identifier?: string) => + identifier + ? (['mutation', 'resetPassword', identifier] as const) + : (['mutation', 'resetPassword'] as const), + /** Mutation key for revokeApiKey */ revokeApiKey: (identifier?: string) => + identifier + ? (['mutation', 'revokeApiKey', identifier] as const) + : (['mutation', 'revokeApiKey'] as const), + /** Mutation key for revokeOrgApiKey */ revokeOrgApiKey: (identifier?: string) => + identifier + ? (['mutation', 'revokeOrgApiKey', identifier] as const) + : (['mutation', 'revokeOrgApiKey'] as const), + /** Mutation key for revokeSession */ revokeSession: (identifier?: string) => + identifier + ? (['mutation', 'revokeSession', identifier] as const) + : (['mutation', 'revokeSession'] as const), + /** Mutation key for sendAccountDeletionEmail */ sendAccountDeletionEmail: ( + identifier?: string + ) => + identifier + ? (['mutation', 'sendAccountDeletionEmail', identifier] as const) + : (['mutation', 'sendAccountDeletionEmail'] as const), + /** Mutation key for sendVerificationEmail */ sendVerificationEmail: (identifier?: string) => + identifier + ? (['mutation', 'sendVerificationEmail', identifier] as const) + : (['mutation', 'sendVerificationEmail'] as const), + /** Mutation key for setPassword */ setPassword: (identifier?: string) => + identifier + ? (['mutation', 'setPassword', identifier] as const) + : (['mutation', 'setPassword'] as const), + /** Mutation key for signIn */ signIn: (identifier?: string) => + identifier ? (['mutation', 'signIn', identifier] as const) : (['mutation', 'signIn'] as const), + /** Mutation key for signInCrossOrigin */ signInCrossOrigin: (identifier?: string) => + identifier + ? (['mutation', 'signInCrossOrigin', identifier] as const) + : (['mutation', 'signInCrossOrigin'] as const), + /** Mutation key for signInSmsOtp */ signInSmsOtp: (identifier?: string) => + identifier + ? (['mutation', 'signInSmsOtp', identifier] as const) + : (['mutation', 'signInSmsOtp'] as const), + /** Mutation key for signOut */ signOut: (identifier?: string) => + identifier + ? (['mutation', 'signOut', identifier] as const) + : (['mutation', 'signOut'] as const), + /** Mutation key for signUp */ signUp: (identifier?: string) => + identifier ? (['mutation', 'signUp', identifier] as const) : (['mutation', 'signUp'] as const), + /** Mutation key for signUpSms */ signUpSms: (identifier?: string) => + identifier + ? (['mutation', 'signUpSms', identifier] as const) + : (['mutation', 'signUpSms'] as const), + /** Mutation key for verifyEmail */ verifyEmail: (identifier?: string) => + identifier + ? (['mutation', 'verifyEmail', identifier] as const) + : (['mutation', 'verifyEmail'] as const), + /** Mutation key for verifyPassword */ verifyPassword: (identifier?: string) => + identifier + ? (['mutation', 'verifyPassword', identifier] as const) + : (['mutation', 'verifyPassword'] as const), + /** Mutation key for verifyTotp */ verifyTotp: (identifier?: string) => + identifier + ? (['mutation', 'verifyTotp', identifier] as const) + : (['mutation', 'verifyTotp'] as const), } as const; /** @@ -169,5 +295,5 @@ export const mutationKeys = { userConnectedAccount: userConnectedAccountMutationKeys, user: userMutationKeys, webauthnCredential: webauthnCredentialMutationKeys, - custom: customMutationKeys + 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 2541d7d5b9..5348c0d00f 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/index.ts @@ -3,62 +3,62 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateAuditLogAuthMutation"; -export * from "./useUpdateAuditLogAuthMutation"; -export * from "./useDeleteAuditLogAuthMutation"; -export * from "./useCreateCryptoAddressMutation"; -export * from "./useUpdateCryptoAddressMutation"; -export * from "./useDeleteCryptoAddressMutation"; -export * from "./useCreateEmailMutation"; -export * from "./useUpdateEmailMutation"; -export * from "./useDeleteEmailMutation"; -export * from "./useCreateIdentityProviderMutation"; -export * from "./useCreateOrgApiKeyListMutation"; -export * from "./useCreatePhoneNumberMutation"; -export * from "./useUpdatePhoneNumberMutation"; -export * from "./useDeletePhoneNumberMutation"; -export * from "./useCreatePrincipalMutation"; -export * from "./useCreatePrincipalEntityMutation"; -export * from "./useUpdatePrincipalEntityMutation"; -export * from "./useDeletePrincipalEntityMutation"; -export * from "./useCreatePrincipalScopeOverrideMutation"; -export * from "./useCreateRoleTypeMutation"; -export * from "./useUpdateRoleTypeMutation"; -export * from "./useDeleteRoleTypeMutation"; -export * from "./useCreateUserConnectedAccountMutation"; -export * from "./useCreateUserMutation"; -export * from "./useUpdateUserMutation"; -export * from "./useDeleteUserMutation"; -export * from "./useCreateWebauthnCredentialMutation"; -export * from "./useUpdateWebauthnCredentialMutation"; -export * from "./useDeleteWebauthnCredentialMutation"; -export * from "./useCheckPasswordMutation"; -export * from "./useConfirmDeleteAccountMutation"; -export * from "./useCreateApiKeyMutation"; -export * from "./useCreateOrgApiKeyMutation"; -export * from "./useCreateOrgPrincipalMutation"; -export * from "./useDeleteOrgPrincipalMutation"; -export * from "./useDeletePrincipalMutation"; -export * from "./useDisconnectAccountMutation"; -export * from "./useExtendTokenExpiresMutation"; -export * from "./useForgotPasswordMutation"; -export * from "./useLinkIdentityMutation"; -export * from "./useProvisionBucketMutation"; -export * from "./useProvisionNewUserMutation"; -export * from "./useRequestCrossOriginTokenMutation"; -export * from "./useResetPasswordMutation"; -export * from "./useRevokeApiKeyMutation"; -export * from "./useRevokeOrgApiKeyMutation"; -export * from "./useRevokeSessionMutation"; -export * from "./useSendAccountDeletionEmailMutation"; -export * from "./useSendVerificationEmailMutation"; -export * from "./useSetPasswordMutation"; -export * from "./useSignInMutation"; -export * from "./useSignInCrossOriginMutation"; -export * from "./useSignInSmsOtpMutation"; -export * from "./useSignOutMutation"; -export * from "./useSignUpMutation"; -export * from "./useSignUpSmsMutation"; -export * from "./useVerifyEmailMutation"; -export * from "./useVerifyPasswordMutation"; -export * from "./useVerifyTotpMutation"; \ No newline at end of file +export * from './useCreateAuditLogAuthMutation'; +export * from './useUpdateAuditLogAuthMutation'; +export * from './useDeleteAuditLogAuthMutation'; +export * from './useCreateCryptoAddressMutation'; +export * from './useUpdateCryptoAddressMutation'; +export * from './useDeleteCryptoAddressMutation'; +export * from './useCreateEmailMutation'; +export * from './useUpdateEmailMutation'; +export * from './useDeleteEmailMutation'; +export * from './useCreateIdentityProviderMutation'; +export * from './useCreateOrgApiKeyListMutation'; +export * from './useCreatePhoneNumberMutation'; +export * from './useUpdatePhoneNumberMutation'; +export * from './useDeletePhoneNumberMutation'; +export * from './useCreatePrincipalMutation'; +export * from './useCreatePrincipalEntityMutation'; +export * from './useUpdatePrincipalEntityMutation'; +export * from './useDeletePrincipalEntityMutation'; +export * from './useCreatePrincipalScopeOverrideMutation'; +export * from './useCreateRoleTypeMutation'; +export * from './useUpdateRoleTypeMutation'; +export * from './useDeleteRoleTypeMutation'; +export * from './useCreateUserConnectedAccountMutation'; +export * from './useCreateUserMutation'; +export * from './useUpdateUserMutation'; +export * from './useDeleteUserMutation'; +export * from './useCreateWebauthnCredentialMutation'; +export * from './useUpdateWebauthnCredentialMutation'; +export * from './useDeleteWebauthnCredentialMutation'; +export * from './useCheckPasswordMutation'; +export * from './useConfirmDeleteAccountMutation'; +export * from './useCreateApiKeyMutation'; +export * from './useCreateOrgApiKeyMutation'; +export * from './useCreateOrgPrincipalMutation'; +export * from './useDeleteOrgPrincipalMutation'; +export * from './useDeletePrincipalMutation'; +export * from './useDisconnectAccountMutation'; +export * from './useExtendTokenExpiresMutation'; +export * from './useForgotPasswordMutation'; +export * from './useLinkIdentityMutation'; +export * from './useProvisionBucketMutation'; +export * from './useProvisionNewUserMutation'; +export * from './useRequestCrossOriginTokenMutation'; +export * from './useResetPasswordMutation'; +export * from './useRevokeApiKeyMutation'; +export * from './useRevokeOrgApiKeyMutation'; +export * from './useRevokeSessionMutation'; +export * from './useSendAccountDeletionEmailMutation'; +export * from './useSendVerificationEmailMutation'; +export * from './useSetPasswordMutation'; +export * from './useSignInMutation'; +export * from './useSignInCrossOriginMutation'; +export * from './useSignInSmsOtpMutation'; +export * from './useSignOutMutation'; +export * from './useSignUpMutation'; +export * from './useSignUpSmsMutation'; +export * from './useVerifyEmailMutation'; +export * from './useVerifyPasswordMutation'; +export * from './useVerifyTotpMutation'; diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCheckPasswordMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCheckPasswordMutation.ts index 8b947796b6..36b79e2fed 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCheckPasswordMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCheckPasswordMutation.ts @@ -4,39 +4,52 @@ * 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 { CheckPasswordVariables } from "../../orm/mutation"; -import type { CheckPasswordPayloadSelect, CheckPasswordPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { CheckPasswordVariables } from "../../orm/mutation"; -export type { CheckPasswordPayloadSelect } from "../../orm/input-types"; -export function useCheckPasswordMutation(params: { - selection: ({ - fields: S & CheckPasswordPayloadSelect; - } & HookStrictSelect, CheckPasswordPayloadSelect>); -} & Omit | null; -}, Error, CheckPasswordVariables>, "mutationFn">): UseMutationResult<{ - checkPassword: InferSelectResult | null; -}, Error, CheckPasswordVariables> { +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 { CheckPasswordVariables } from '../../orm/mutation'; +import type { CheckPasswordPayloadSelect, CheckPasswordPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { CheckPasswordVariables } from '../../orm/mutation'; +export type { CheckPasswordPayloadSelect } from '../../orm/input-types'; +export function useCheckPasswordMutation( + params: { + selection: { + fields: S & CheckPasswordPayloadSelect; + } & HookStrictSelect, CheckPasswordPayloadSelect>; + } & Omit< + UseMutationOptions< + { + checkPassword: InferSelectResult | null; + }, + Error, + CheckPasswordVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + checkPassword: InferSelectResult | null; + }, + Error, + CheckPasswordVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.checkPassword(), - mutationFn: (variables: CheckPasswordVariables) => getClient().mutation.checkPassword(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: CheckPasswordVariables) => + getClient() + .mutation.checkPassword(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useConfirmDeleteAccountMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useConfirmDeleteAccountMutation.ts index 701b91e478..2a430d07ac 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useConfirmDeleteAccountMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useConfirmDeleteAccountMutation.ts @@ -4,39 +4,55 @@ * 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 { ConfirmDeleteAccountVariables } from "../../orm/mutation"; -import type { ConfirmDeleteAccountPayloadSelect, ConfirmDeleteAccountPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ConfirmDeleteAccountVariables } from "../../orm/mutation"; -export type { ConfirmDeleteAccountPayloadSelect } from "../../orm/input-types"; -export function useConfirmDeleteAccountMutation(params: { - selection: ({ - fields: S & ConfirmDeleteAccountPayloadSelect; - } & HookStrictSelect, ConfirmDeleteAccountPayloadSelect>); -} & Omit | null; -}, Error, ConfirmDeleteAccountVariables>, "mutationFn">): UseMutationResult<{ - confirmDeleteAccount: InferSelectResult | null; -}, Error, ConfirmDeleteAccountVariables> { +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 { ConfirmDeleteAccountVariables } from '../../orm/mutation'; +import type { + ConfirmDeleteAccountPayloadSelect, + ConfirmDeleteAccountPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ConfirmDeleteAccountVariables } from '../../orm/mutation'; +export type { ConfirmDeleteAccountPayloadSelect } from '../../orm/input-types'; +export function useConfirmDeleteAccountMutation( + params: { + selection: { + fields: S & ConfirmDeleteAccountPayloadSelect; + } & HookStrictSelect, ConfirmDeleteAccountPayloadSelect>; + } & Omit< + UseMutationOptions< + { + confirmDeleteAccount: InferSelectResult | null; + }, + Error, + ConfirmDeleteAccountVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + confirmDeleteAccount: InferSelectResult | null; + }, + Error, + ConfirmDeleteAccountVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.confirmDeleteAccount(), - mutationFn: (variables: ConfirmDeleteAccountVariables) => getClient().mutation.confirmDeleteAccount(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ConfirmDeleteAccountVariables) => + getClient() + .mutation.confirmDeleteAccount(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateApiKeyMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateApiKeyMutation.ts index a5b798b463..bd74ac134f 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateApiKeyMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateApiKeyMutation.ts @@ -4,39 +4,52 @@ * 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 { CreateApiKeyVariables } from "../../orm/mutation"; -import type { CreateApiKeyPayloadSelect, CreateApiKeyPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { CreateApiKeyVariables } from "../../orm/mutation"; -export type { CreateApiKeyPayloadSelect } from "../../orm/input-types"; -export function useCreateApiKeyMutation(params: { - selection: ({ - fields: S & CreateApiKeyPayloadSelect; - } & HookStrictSelect, CreateApiKeyPayloadSelect>); -} & Omit | null; -}, Error, CreateApiKeyVariables>, "mutationFn">): UseMutationResult<{ - createApiKey: InferSelectResult | null; -}, Error, CreateApiKeyVariables> { +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 { CreateApiKeyVariables } from '../../orm/mutation'; +import type { CreateApiKeyPayloadSelect, CreateApiKeyPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { CreateApiKeyVariables } from '../../orm/mutation'; +export type { CreateApiKeyPayloadSelect } from '../../orm/input-types'; +export function useCreateApiKeyMutation( + params: { + selection: { + fields: S & CreateApiKeyPayloadSelect; + } & HookStrictSelect, CreateApiKeyPayloadSelect>; + } & Omit< + UseMutationOptions< + { + createApiKey: InferSelectResult | null; + }, + Error, + CreateApiKeyVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + createApiKey: InferSelectResult | null; + }, + Error, + CreateApiKeyVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.createApiKey(), - mutationFn: (variables: CreateApiKeyVariables) => getClient().mutation.createApiKey(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: CreateApiKeyVariables) => + getClient() + .mutation.createApiKey(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateAuditLogAuthMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateAuditLogAuthMutation.ts index e440ea36e8..c4243ed469 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateAuditLogAuthMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateAuditLogAuthMutation.ts @@ -4,62 +4,85 @@ * 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 { auditLogAuthKeys } from "../query-keys"; -import { auditLogAuthMutationKeys } from "../mutation-keys"; -import type { AuditLogAuthSelect, AuditLogAuthWithRelations, CreateAuditLogAuthInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AuditLogAuthSelect, AuditLogAuthWithRelations, CreateAuditLogAuthInput } from "../../orm/input-types"; +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 { auditLogAuthKeys } from '../query-keys'; +import { auditLogAuthMutationKeys } from '../mutation-keys'; +import type { + AuditLogAuthSelect, + AuditLogAuthWithRelations, + CreateAuditLogAuthInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AuditLogAuthSelect, + AuditLogAuthWithRelations, + CreateAuditLogAuthInput, +} from '../../orm/input-types'; /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAuditLogAuthMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAuditLogAuthMutation(params: { - selection: ({ - fields: S & AuditLogAuthSelect; - } & HookStrictSelect, AuditLogAuthSelect>); -} & Omit; - }; -}, Error, CreateAuditLogAuthInput["auditLogAuth"]>, "mutationFn">): UseMutationResult<{ - createAuditLogAuth: { - auditLogAuth: InferSelectResult; - }; -}, Error, CreateAuditLogAuthInput["auditLogAuth"]>; -export function useCreateAuditLogAuthMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAuditLogAuthMutation( + params: { + selection: { + fields: S & AuditLogAuthSelect; + } & HookStrictSelect, AuditLogAuthSelect>; + } & Omit< + UseMutationOptions< + { + createAuditLogAuth: { + auditLogAuth: InferSelectResult; + }; + }, + Error, + CreateAuditLogAuthInput['auditLogAuth'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAuditLogAuth: { + auditLogAuth: InferSelectResult; + }; + }, + Error, + CreateAuditLogAuthInput['auditLogAuth'] +>; +export function useCreateAuditLogAuthMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: auditLogAuthMutationKeys.create(), - mutationFn: (data: CreateAuditLogAuthInput["auditLogAuth"]) => getClient().auditLogAuth.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAuditLogAuthInput['auditLogAuth']) => + getClient() + .auditLogAuth.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: auditLogAuthKeys.lists() + queryKey: auditLogAuthKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateCryptoAddressMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateCryptoAddressMutation.ts index 051db17d20..deda73055f 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateCryptoAddressMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateCryptoAddressMutation.ts @@ -4,62 +4,85 @@ * 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 { cryptoAddressKeys } from "../query-keys"; -import { cryptoAddressMutationKeys } from "../mutation-keys"; -import type { CryptoAddressSelect, CryptoAddressWithRelations, CreateCryptoAddressInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressSelect, CryptoAddressWithRelations, CreateCryptoAddressInput } from "../../orm/input-types"; +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 { cryptoAddressKeys } from '../query-keys'; +import { cryptoAddressMutationKeys } from '../mutation-keys'; +import type { + CryptoAddressSelect, + CryptoAddressWithRelations, + CreateCryptoAddressInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CryptoAddressSelect, + CryptoAddressWithRelations, + CreateCryptoAddressInput, +} from '../../orm/input-types'; /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```tsx * const { mutate, isPending } = useCreateCryptoAddressMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateCryptoAddressMutation(params: { - selection: ({ - fields: S & CryptoAddressSelect; - } & HookStrictSelect, CryptoAddressSelect>); -} & Omit; - }; -}, Error, CreateCryptoAddressInput["cryptoAddress"]>, "mutationFn">): UseMutationResult<{ - createCryptoAddress: { - cryptoAddress: InferSelectResult; - }; -}, Error, CreateCryptoAddressInput["cryptoAddress"]>; -export function useCreateCryptoAddressMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateCryptoAddressMutation( + params: { + selection: { + fields: S & CryptoAddressSelect; + } & HookStrictSelect, CryptoAddressSelect>; + } & Omit< + UseMutationOptions< + { + createCryptoAddress: { + cryptoAddress: InferSelectResult; + }; + }, + Error, + CreateCryptoAddressInput['cryptoAddress'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createCryptoAddress: { + cryptoAddress: InferSelectResult; + }; + }, + Error, + CreateCryptoAddressInput['cryptoAddress'] +>; +export function useCreateCryptoAddressMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAddressMutationKeys.create(), - mutationFn: (data: CreateCryptoAddressInput["cryptoAddress"]) => getClient().cryptoAddress.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateCryptoAddressInput['cryptoAddress']) => + getClient() + .cryptoAddress.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: cryptoAddressKeys.lists() + queryKey: cryptoAddressKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateEmailMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateEmailMutation.ts index 212625c18c..3adbfe3b33 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateEmailMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateEmailMutation.ts @@ -4,62 +4,77 @@ * 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 { emailKeys } from "../query-keys"; -import { emailMutationKeys } from "../mutation-keys"; -import type { EmailSelect, EmailWithRelations, CreateEmailInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailSelect, EmailWithRelations, CreateEmailInput } from "../../orm/input-types"; +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 { emailKeys } from '../query-keys'; +import { emailMutationKeys } from '../mutation-keys'; +import type { EmailSelect, EmailWithRelations, CreateEmailInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EmailSelect, EmailWithRelations, CreateEmailInput } from '../../orm/input-types'; /** * User email addresses with verification and primary-email management - * + * * @example * ```tsx * const { mutate, isPending } = useCreateEmailMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateEmailMutation(params: { - selection: ({ - fields: S & EmailSelect; - } & HookStrictSelect, EmailSelect>); -} & Omit; - }; -}, Error, CreateEmailInput["email"]>, "mutationFn">): UseMutationResult<{ - createEmail: { - email: InferSelectResult; - }; -}, Error, CreateEmailInput["email"]>; -export function useCreateEmailMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateEmailMutation( + params: { + selection: { + fields: S & EmailSelect; + } & HookStrictSelect, EmailSelect>; + } & Omit< + UseMutationOptions< + { + createEmail: { + email: InferSelectResult; + }; + }, + Error, + CreateEmailInput['email'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createEmail: { + email: InferSelectResult; + }; + }, + Error, + CreateEmailInput['email'] +>; +export function useCreateEmailMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: emailMutationKeys.create(), - mutationFn: (data: CreateEmailInput["email"]) => getClient().email.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateEmailInput['email']) => + getClient() + .email.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: emailKeys.lists() + queryKey: emailKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateIdentityProviderMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateIdentityProviderMutation.ts index 3f87bef181..157d07d899 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateIdentityProviderMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateIdentityProviderMutation.ts @@ -4,62 +4,88 @@ * 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 { identityProviderKeys } from "../query-keys"; -import { identityProviderMutationKeys } from "../mutation-keys"; -import type { IdentityProviderSelect, IdentityProviderWithRelations, CreateIdentityProviderInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IdentityProviderSelect, IdentityProviderWithRelations, CreateIdentityProviderInput } from "../../orm/input-types"; +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 { identityProviderKeys } from '../query-keys'; +import { identityProviderMutationKeys } from '../mutation-keys'; +import type { + IdentityProviderSelect, + IdentityProviderWithRelations, + CreateIdentityProviderInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IdentityProviderSelect, + IdentityProviderWithRelations, + CreateIdentityProviderInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a IdentityProvider - * + * * @example * ```tsx * const { mutate, isPending } = useCreateIdentityProviderMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateIdentityProviderMutation(params: { - selection: ({ - fields: S & IdentityProviderSelect; - } & HookStrictSelect, IdentityProviderSelect>); -} & Omit; - }; -}, Error, CreateIdentityProviderInput["identityProvider"]>, "mutationFn">): UseMutationResult<{ - createIdentityProvider: { - identityProvider: InferSelectResult; - }; -}, Error, CreateIdentityProviderInput["identityProvider"]>; -export function useCreateIdentityProviderMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateIdentityProviderMutation( + params: { + selection: { + fields: S & IdentityProviderSelect; + } & HookStrictSelect, IdentityProviderSelect>; + } & Omit< + UseMutationOptions< + { + createIdentityProvider: { + identityProvider: InferSelectResult; + }; + }, + Error, + CreateIdentityProviderInput['identityProvider'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createIdentityProvider: { + identityProvider: InferSelectResult; + }; + }, + Error, + CreateIdentityProviderInput['identityProvider'] +>; +export function useCreateIdentityProviderMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: identityProviderMutationKeys.create(), - mutationFn: (data: CreateIdentityProviderInput["identityProvider"]) => getClient().identityProvider.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateIdentityProviderInput['identityProvider']) => + getClient() + .identityProvider.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: identityProviderKeys.lists() + queryKey: identityProviderKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyListMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyListMutation.ts index a6f412a6d1..8ee7097912 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyListMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyListMutation.ts @@ -4,62 +4,85 @@ * 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"; +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; - }; -}, Error, CreateOrgApiKeyListInput["orgApiKeyList"]>, "mutationFn">): UseMutationResult<{ - createOrgApiKeyList: { - orgApiKeyList: InferSelectResult; - }; -}, Error, CreateOrgApiKeyListInput["orgApiKeyList"]>; -export function useCreateOrgApiKeyListMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + 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(), + mutationFn: (data: CreateOrgApiKeyListInput['orgApiKeyList']) => + getClient() + .orgApiKeyList.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgApiKeyListKeys.lists() + queryKey: orgApiKeyListKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyMutation.ts index 6ce7c81455..c04772ebde 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyMutation.ts @@ -4,39 +4,52 @@ * 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 | null; -}, Error, CreateOrgApiKeyVariables>, "mutationFn">): UseMutationResult<{ - createOrgApiKey: InferSelectResult | null; -}, Error, CreateOrgApiKeyVariables> { +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 ?? {}; + 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 + 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 index 3f9c71ca9d..26f019f9cc 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgPrincipalMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgPrincipalMutation.ts @@ -4,39 +4,55 @@ * 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 | null; -}, Error, CreateOrgPrincipalVariables>, "mutationFn">): UseMutationResult<{ - createOrgPrincipal: InferSelectResult | null; -}, Error, CreateOrgPrincipalVariables> { +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 ?? {}; + 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 + 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/useCreatePhoneNumberMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePhoneNumberMutation.ts index 70f62031de..7ccbf6084b 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePhoneNumberMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePhoneNumberMutation.ts @@ -4,62 +4,85 @@ * 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 { phoneNumberKeys } from "../query-keys"; -import { phoneNumberMutationKeys } from "../mutation-keys"; -import type { PhoneNumberSelect, PhoneNumberWithRelations, CreatePhoneNumberInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumberSelect, PhoneNumberWithRelations, CreatePhoneNumberInput } from "../../orm/input-types"; +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 { phoneNumberKeys } from '../query-keys'; +import { phoneNumberMutationKeys } from '../mutation-keys'; +import type { + PhoneNumberSelect, + PhoneNumberWithRelations, + CreatePhoneNumberInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PhoneNumberSelect, + PhoneNumberWithRelations, + CreatePhoneNumberInput, +} from '../../orm/input-types'; /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePhoneNumberMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePhoneNumberMutation(params: { - selection: ({ - fields: S & PhoneNumberSelect; - } & HookStrictSelect, PhoneNumberSelect>); -} & Omit; - }; -}, Error, CreatePhoneNumberInput["phoneNumber"]>, "mutationFn">): UseMutationResult<{ - createPhoneNumber: { - phoneNumber: InferSelectResult; - }; -}, Error, CreatePhoneNumberInput["phoneNumber"]>; -export function useCreatePhoneNumberMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePhoneNumberMutation( + params: { + selection: { + fields: S & PhoneNumberSelect; + } & HookStrictSelect, PhoneNumberSelect>; + } & Omit< + UseMutationOptions< + { + createPhoneNumber: { + phoneNumber: InferSelectResult; + }; + }, + Error, + CreatePhoneNumberInput['phoneNumber'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPhoneNumber: { + phoneNumber: InferSelectResult; + }; + }, + Error, + CreatePhoneNumberInput['phoneNumber'] +>; +export function useCreatePhoneNumberMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: phoneNumberMutationKeys.create(), - mutationFn: (data: CreatePhoneNumberInput["phoneNumber"]) => getClient().phoneNumber.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePhoneNumberInput['phoneNumber']) => + getClient() + .phoneNumber.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: phoneNumberKeys.lists() + queryKey: phoneNumberKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalEntityMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalEntityMutation.ts index a0a50c12bf..16edd29ff9 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalEntityMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalEntityMutation.ts @@ -4,62 +4,88 @@ * 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"; +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; - }; -}, Error, CreatePrincipalEntityInput["principalEntity"]>, "mutationFn">): UseMutationResult<{ - createPrincipalEntity: { - principalEntity: InferSelectResult; - }; -}, Error, CreatePrincipalEntityInput["principalEntity"]>; -export function useCreatePrincipalEntityMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + 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(), + mutationFn: (data: CreatePrincipalEntityInput['principalEntity']) => + getClient() + .principalEntity.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: principalEntityKeys.lists() + queryKey: principalEntityKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts index 1f58293867..6b805d782c 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts @@ -4,62 +4,85 @@ * 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"; +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; - }; -}, Error, CreatePrincipalInput["principal"]>, "mutationFn">): UseMutationResult<{ - createPrincipal: { - principal: InferSelectResult; - }; -}, Error, CreatePrincipalInput["principal"]>; -export function useCreatePrincipalMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + 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(), + mutationFn: (data: CreatePrincipalInput['principal']) => + getClient() + .principal.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: principalKeys.lists() + queryKey: principalKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalScopeOverrideMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalScopeOverrideMutation.ts index 17f2ba0989..c54e6183dd 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalScopeOverrideMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalScopeOverrideMutation.ts @@ -4,62 +4,88 @@ * 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"; +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; - }; -}, Error, CreatePrincipalScopeOverrideInput["principalScopeOverride"]>, "mutationFn">): UseMutationResult<{ - createPrincipalScopeOverride: { - principalScopeOverride: InferSelectResult; - }; -}, Error, CreatePrincipalScopeOverrideInput["principalScopeOverride"]>; -export function useCreatePrincipalScopeOverrideMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + 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(), + mutationFn: (data: CreatePrincipalScopeOverrideInput['principalScopeOverride']) => + getClient() + .principalScopeOverride.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: principalScopeOverrideKeys.lists() + queryKey: principalScopeOverrideKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateRoleTypeMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateRoleTypeMutation.ts index 0735090225..212be3f451 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateRoleTypeMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateRoleTypeMutation.ts @@ -4,62 +4,85 @@ * 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 { roleTypeKeys } from "../query-keys"; -import { roleTypeMutationKeys } from "../mutation-keys"; -import type { RoleTypeSelect, RoleTypeWithRelations, CreateRoleTypeInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RoleTypeSelect, RoleTypeWithRelations, CreateRoleTypeInput } from "../../orm/input-types"; +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 { roleTypeKeys } from '../query-keys'; +import { roleTypeMutationKeys } from '../mutation-keys'; +import type { + RoleTypeSelect, + RoleTypeWithRelations, + CreateRoleTypeInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RoleTypeSelect, + RoleTypeWithRelations, + CreateRoleTypeInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a RoleType - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRoleTypeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRoleTypeMutation(params: { - selection: ({ - fields: S & RoleTypeSelect; - } & HookStrictSelect, RoleTypeSelect>); -} & Omit; - }; -}, Error, CreateRoleTypeInput["roleType"]>, "mutationFn">): UseMutationResult<{ - createRoleType: { - roleType: InferSelectResult; - }; -}, Error, CreateRoleTypeInput["roleType"]>; -export function useCreateRoleTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRoleTypeMutation( + params: { + selection: { + fields: S & RoleTypeSelect; + } & HookStrictSelect, RoleTypeSelect>; + } & Omit< + UseMutationOptions< + { + createRoleType: { + roleType: InferSelectResult; + }; + }, + Error, + CreateRoleTypeInput['roleType'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRoleType: { + roleType: InferSelectResult; + }; + }, + Error, + CreateRoleTypeInput['roleType'] +>; +export function useCreateRoleTypeMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: roleTypeMutationKeys.create(), - mutationFn: (data: CreateRoleTypeInput["roleType"]) => getClient().roleType.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRoleTypeInput['roleType']) => + getClient() + .roleType.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: roleTypeKeys.lists() + queryKey: roleTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateUserConnectedAccountMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateUserConnectedAccountMutation.ts index f58264f449..6c0f3a5194 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateUserConnectedAccountMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateUserConnectedAccountMutation.ts @@ -4,62 +4,88 @@ * 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 { userConnectedAccountKeys } from "../query-keys"; -import { userConnectedAccountMutationKeys } from "../mutation-keys"; -import type { UserConnectedAccountSelect, UserConnectedAccountWithRelations, CreateUserConnectedAccountInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserConnectedAccountSelect, UserConnectedAccountWithRelations, CreateUserConnectedAccountInput } from "../../orm/input-types"; +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 { userConnectedAccountKeys } from '../query-keys'; +import { userConnectedAccountMutationKeys } from '../mutation-keys'; +import type { + UserConnectedAccountSelect, + UserConnectedAccountWithRelations, + CreateUserConnectedAccountInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserConnectedAccountSelect, + UserConnectedAccountWithRelations, + CreateUserConnectedAccountInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a UserConnectedAccount - * + * * @example * ```tsx * const { mutate, isPending } = useCreateUserConnectedAccountMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateUserConnectedAccountMutation(params: { - selection: ({ - fields: S & UserConnectedAccountSelect; - } & HookStrictSelect, UserConnectedAccountSelect>); -} & Omit; - }; -}, Error, CreateUserConnectedAccountInput["userConnectedAccount"]>, "mutationFn">): UseMutationResult<{ - createUserConnectedAccount: { - userConnectedAccount: InferSelectResult; - }; -}, Error, CreateUserConnectedAccountInput["userConnectedAccount"]>; -export function useCreateUserConnectedAccountMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateUserConnectedAccountMutation( + params: { + selection: { + fields: S & UserConnectedAccountSelect; + } & HookStrictSelect, UserConnectedAccountSelect>; + } & Omit< + UseMutationOptions< + { + createUserConnectedAccount: { + userConnectedAccount: InferSelectResult; + }; + }, + Error, + CreateUserConnectedAccountInput['userConnectedAccount'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createUserConnectedAccount: { + userConnectedAccount: InferSelectResult; + }; + }, + Error, + CreateUserConnectedAccountInput['userConnectedAccount'] +>; +export function useCreateUserConnectedAccountMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userConnectedAccountMutationKeys.create(), - mutationFn: (data: CreateUserConnectedAccountInput["userConnectedAccount"]) => getClient().userConnectedAccount.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateUserConnectedAccountInput['userConnectedAccount']) => + getClient() + .userConnectedAccount.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: userConnectedAccountKeys.lists() + queryKey: userConnectedAccountKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateUserMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateUserMutation.ts index 427a0dab6b..0d5bfff47e 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateUserMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateUserMutation.ts @@ -4,62 +4,77 @@ * 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 { userKeys } from "../query-keys"; -import { userMutationKeys } from "../mutation-keys"; -import type { UserSelect, UserWithRelations, CreateUserInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSelect, UserWithRelations, CreateUserInput } from "../../orm/input-types"; +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 { userKeys } from '../query-keys'; +import { userMutationKeys } from '../mutation-keys'; +import type { UserSelect, UserWithRelations, CreateUserInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserSelect, UserWithRelations, CreateUserInput } from '../../orm/input-types'; /** * Mutation hook for creating a User - * + * * @example * ```tsx * const { mutate, isPending } = useCreateUserMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateUserMutation(params: { - selection: ({ - fields: S & UserSelect; - } & HookStrictSelect, UserSelect>); -} & Omit; - }; -}, Error, CreateUserInput["user"]>, "mutationFn">): UseMutationResult<{ - createUser: { - user: InferSelectResult; - }; -}, Error, CreateUserInput["user"]>; -export function useCreateUserMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateUserMutation( + params: { + selection: { + fields: S & UserSelect; + } & HookStrictSelect, UserSelect>; + } & Omit< + UseMutationOptions< + { + createUser: { + user: InferSelectResult; + }; + }, + Error, + CreateUserInput['user'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createUser: { + user: InferSelectResult; + }; + }, + Error, + CreateUserInput['user'] +>; +export function useCreateUserMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userMutationKeys.create(), - mutationFn: (data: CreateUserInput["user"]) => getClient().user.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateUserInput['user']) => + getClient() + .user.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: userKeys.lists() + queryKey: userKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateWebauthnCredentialMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateWebauthnCredentialMutation.ts index 29200479d0..74dc8c6b9b 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useCreateWebauthnCredentialMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateWebauthnCredentialMutation.ts @@ -4,62 +4,88 @@ * 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 { webauthnCredentialKeys } from "../query-keys"; -import { webauthnCredentialMutationKeys } from "../mutation-keys"; -import type { WebauthnCredentialSelect, WebauthnCredentialWithRelations, CreateWebauthnCredentialInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialSelect, WebauthnCredentialWithRelations, CreateWebauthnCredentialInput } from "../../orm/input-types"; +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 { webauthnCredentialKeys } from '../query-keys'; +import { webauthnCredentialMutationKeys } from '../mutation-keys'; +import type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, + CreateWebauthnCredentialInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, + CreateWebauthnCredentialInput, +} from '../../orm/input-types'; /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateWebauthnCredentialMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateWebauthnCredentialMutation(params: { - selection: ({ - fields: S & WebauthnCredentialSelect; - } & HookStrictSelect, WebauthnCredentialSelect>); -} & Omit; - }; -}, Error, CreateWebauthnCredentialInput["webauthnCredential"]>, "mutationFn">): UseMutationResult<{ - createWebauthnCredential: { - webauthnCredential: InferSelectResult; - }; -}, Error, CreateWebauthnCredentialInput["webauthnCredential"]>; -export function useCreateWebauthnCredentialMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateWebauthnCredentialMutation( + params: { + selection: { + fields: S & WebauthnCredentialSelect; + } & HookStrictSelect, WebauthnCredentialSelect>; + } & Omit< + UseMutationOptions< + { + createWebauthnCredential: { + webauthnCredential: InferSelectResult; + }; + }, + Error, + CreateWebauthnCredentialInput['webauthnCredential'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createWebauthnCredential: { + webauthnCredential: InferSelectResult; + }; + }, + Error, + CreateWebauthnCredentialInput['webauthnCredential'] +>; +export function useCreateWebauthnCredentialMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnCredentialMutationKeys.create(), - mutationFn: (data: CreateWebauthnCredentialInput["webauthnCredential"]) => getClient().webauthnCredential.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateWebauthnCredentialInput['webauthnCredential']) => + getClient() + .webauthnCredential.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: webauthnCredentialKeys.lists() + queryKey: webauthnCredentialKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteAuditLogAuthMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteAuditLogAuthMutation.ts index df54933992..9fbfb12f51 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteAuditLogAuthMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteAuditLogAuthMutation.ts @@ -4,83 +4,99 @@ * 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 { auditLogAuthKeys } from "../query-keys"; -import { auditLogAuthMutationKeys } from "../mutation-keys"; -import type { AuditLogAuthSelect, AuditLogAuthWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AuditLogAuthSelect, AuditLogAuthWithRelations } from "../../orm/input-types"; +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 { auditLogAuthKeys } from '../query-keys'; +import { auditLogAuthMutationKeys } from '../mutation-keys'; +import type { AuditLogAuthSelect, AuditLogAuthWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AuditLogAuthSelect, AuditLogAuthWithRelations } from '../../orm/input-types'; /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAuditLogAuthMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAuditLogAuthMutation(params: { - selection: ({ - fields: S & AuditLogAuthSelect; - } & HookStrictSelect, AuditLogAuthSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAuditLogAuth: { - auditLogAuth: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteAuditLogAuthMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAuditLogAuthMutation( + params: { + selection: { + fields: S & AuditLogAuthSelect; + } & HookStrictSelect, AuditLogAuthSelect>; + } & Omit< + UseMutationOptions< + { + deleteAuditLogAuth: { + auditLogAuth: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAuditLogAuth: { + auditLogAuth: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteAuditLogAuthMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: auditLogAuthMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().auditLogAuth.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .auditLogAuth.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: auditLogAuthKeys.detail(variables.id) + queryKey: auditLogAuthKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: auditLogAuthKeys.lists() + queryKey: auditLogAuthKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteCryptoAddressMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteCryptoAddressMutation.ts index e29ff07a5d..34ad5f33d4 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteCryptoAddressMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteCryptoAddressMutation.ts @@ -4,77 +4,95 @@ * 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 { cryptoAddressKeys } from "../query-keys"; -import { cryptoAddressMutationKeys } from "../mutation-keys"; -import type { CryptoAddressSelect, CryptoAddressWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressSelect, CryptoAddressWithRelations } from "../../orm/input-types"; +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 { cryptoAddressKeys } from '../query-keys'; +import { cryptoAddressMutationKeys } from '../mutation-keys'; +import type { CryptoAddressSelect, CryptoAddressWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CryptoAddressSelect, CryptoAddressWithRelations } from '../../orm/input-types'; /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteCryptoAddressMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteCryptoAddressMutation(params: { - selection: ({ - fields: S & CryptoAddressSelect; - } & HookStrictSelect, CryptoAddressSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteCryptoAddress: { - cryptoAddress: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteCryptoAddressMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteCryptoAddressMutation( + params: { + selection: { + fields: S & CryptoAddressSelect; + } & HookStrictSelect, CryptoAddressSelect>; + } & Omit< + UseMutationOptions< + { + deleteCryptoAddress: { + cryptoAddress: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteCryptoAddress: { + cryptoAddress: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteCryptoAddressMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAddressMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().cryptoAddress.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .cryptoAddress.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: cryptoAddressKeys.detail(variables.id) + queryKey: cryptoAddressKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: cryptoAddressKeys.lists() + queryKey: cryptoAddressKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteEmailMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteEmailMutation.ts index fdc746a82b..ee92590236 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteEmailMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteEmailMutation.ts @@ -4,77 +4,95 @@ * 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 { emailKeys } from "../query-keys"; -import { emailMutationKeys } from "../mutation-keys"; -import type { EmailSelect, EmailWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailSelect, EmailWithRelations } from "../../orm/input-types"; +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 { emailKeys } from '../query-keys'; +import { emailMutationKeys } from '../mutation-keys'; +import type { EmailSelect, EmailWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EmailSelect, EmailWithRelations } from '../../orm/input-types'; /** * User email addresses with verification and primary-email management - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteEmailMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteEmailMutation(params: { - selection: ({ - fields: S & EmailSelect; - } & HookStrictSelect, EmailSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteEmail: { - email: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteEmailMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteEmailMutation( + params: { + selection: { + fields: S & EmailSelect; + } & HookStrictSelect, EmailSelect>; + } & Omit< + UseMutationOptions< + { + deleteEmail: { + email: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteEmail: { + email: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteEmailMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: emailMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().email.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .email.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: emailKeys.detail(variables.id) + queryKey: emailKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: emailKeys.lists() + queryKey: emailKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteOrgPrincipalMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteOrgPrincipalMutation.ts index 252cdc2611..a5fd0a0422 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteOrgPrincipalMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteOrgPrincipalMutation.ts @@ -4,39 +4,55 @@ * 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 | null; -}, Error, DeleteOrgPrincipalVariables>, "mutationFn">): UseMutationResult<{ - deleteOrgPrincipal: InferSelectResult | null; -}, Error, DeleteOrgPrincipalVariables> { +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 ?? {}; + 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 + 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/useDeletePhoneNumberMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePhoneNumberMutation.ts index ad5bcab4ae..7e4e74481c 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeletePhoneNumberMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePhoneNumberMutation.ts @@ -4,77 +4,95 @@ * 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 { phoneNumberKeys } from "../query-keys"; -import { phoneNumberMutationKeys } from "../mutation-keys"; -import type { PhoneNumberSelect, PhoneNumberWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumberSelect, PhoneNumberWithRelations } from "../../orm/input-types"; +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 { phoneNumberKeys } from '../query-keys'; +import { phoneNumberMutationKeys } from '../mutation-keys'; +import type { PhoneNumberSelect, PhoneNumberWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PhoneNumberSelect, PhoneNumberWithRelations } from '../../orm/input-types'; /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePhoneNumberMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePhoneNumberMutation(params: { - selection: ({ - fields: S & PhoneNumberSelect; - } & HookStrictSelect, PhoneNumberSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePhoneNumber: { - phoneNumber: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePhoneNumberMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePhoneNumberMutation( + params: { + selection: { + fields: S & PhoneNumberSelect; + } & HookStrictSelect, PhoneNumberSelect>; + } & Omit< + UseMutationOptions< + { + deletePhoneNumber: { + phoneNumber: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePhoneNumber: { + phoneNumber: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePhoneNumberMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: phoneNumberMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().phoneNumber.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .phoneNumber.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: phoneNumberKeys.detail(variables.id) + queryKey: phoneNumberKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: phoneNumberKeys.lists() + queryKey: phoneNumberKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalEntityMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalEntityMutation.ts index b0daa366e8..f084cb2466 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalEntityMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalEntityMutation.ts @@ -4,77 +4,95 @@ * 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"; +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; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePrincipalEntity: { - principalEntity: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePrincipalEntityMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + 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(), + mutationFn: ({ id }: { id: string }) => + getClient() + .principalEntity.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: principalEntityKeys.detail(variables.id) + queryKey: principalEntityKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: principalEntityKeys.lists() + queryKey: principalEntityKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalMutation.ts index 69f5449da9..7009505cc9 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalMutation.ts @@ -4,39 +4,52 @@ * 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 { DeletePrincipalVariables } from "../../orm/mutation"; -import type { DeletePrincipalPayloadSelect, DeletePrincipalPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { DeletePrincipalVariables } from "../../orm/mutation"; -export type { DeletePrincipalPayloadSelect } from "../../orm/input-types"; -export function useDeletePrincipalMutation(params: { - selection: ({ - fields: S & DeletePrincipalPayloadSelect; - } & HookStrictSelect, DeletePrincipalPayloadSelect>); -} & Omit | null; -}, Error, DeletePrincipalVariables>, "mutationFn">): UseMutationResult<{ - deletePrincipal: InferSelectResult | null; -}, Error, DeletePrincipalVariables> { +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 { DeletePrincipalVariables } from '../../orm/mutation'; +import type { DeletePrincipalPayloadSelect, DeletePrincipalPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { DeletePrincipalVariables } from '../../orm/mutation'; +export type { DeletePrincipalPayloadSelect } from '../../orm/input-types'; +export function useDeletePrincipalMutation( + params: { + selection: { + fields: S & DeletePrincipalPayloadSelect; + } & HookStrictSelect, DeletePrincipalPayloadSelect>; + } & Omit< + UseMutationOptions< + { + deletePrincipal: InferSelectResult | null; + }, + Error, + DeletePrincipalVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePrincipal: InferSelectResult | null; + }, + Error, + DeletePrincipalVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.deletePrincipal(), - mutationFn: (variables: DeletePrincipalVariables) => getClient().mutation.deletePrincipal(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: DeletePrincipalVariables) => + getClient() + .mutation.deletePrincipal(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteRoleTypeMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteRoleTypeMutation.ts index 97ff6f5c27..34495fa52d 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteRoleTypeMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteRoleTypeMutation.ts @@ -4,77 +4,95 @@ * 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 { roleTypeKeys } from "../query-keys"; -import { roleTypeMutationKeys } from "../mutation-keys"; -import type { RoleTypeSelect, RoleTypeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RoleTypeSelect, RoleTypeWithRelations } from "../../orm/input-types"; +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 { roleTypeKeys } from '../query-keys'; +import { roleTypeMutationKeys } from '../mutation-keys'; +import type { RoleTypeSelect, RoleTypeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RoleTypeSelect, RoleTypeWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a RoleType with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRoleTypeMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 123 }); * ``` */ -export function useDeleteRoleTypeMutation(params: { - selection: ({ - fields: S & RoleTypeSelect; - } & HookStrictSelect, RoleTypeSelect>); -} & Omit; - }; -}, Error, { - id: number; -}>, "mutationFn">): UseMutationResult<{ - deleteRoleType: { - roleType: InferSelectResult; - }; -}, Error, { - id: number; -}>; -export function useDeleteRoleTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRoleTypeMutation( + params: { + selection: { + fields: S & RoleTypeSelect; + } & HookStrictSelect, RoleTypeSelect>; + } & Omit< + UseMutationOptions< + { + deleteRoleType: { + roleType: InferSelectResult; + }; + }, + Error, + { + id: number; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRoleType: { + roleType: InferSelectResult; + }; + }, + Error, + { + id: number; + } +>; +export function useDeleteRoleTypeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: number; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: roleTypeMutationKeys.all, - mutationFn: ({ - id - }: { - id: number; - }) => getClient().roleType.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: number }) => + getClient() + .roleType.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: roleTypeKeys.detail(variables.id) + queryKey: roleTypeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: roleTypeKeys.lists() + queryKey: roleTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteUserMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteUserMutation.ts index 4981269b47..77880ad094 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteUserMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteUserMutation.ts @@ -4,77 +4,95 @@ * 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 { userKeys } from "../query-keys"; -import { userMutationKeys } from "../mutation-keys"; -import type { UserSelect, UserWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSelect, UserWithRelations } from "../../orm/input-types"; +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 { userKeys } from '../query-keys'; +import { userMutationKeys } from '../mutation-keys'; +import type { UserSelect, UserWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserSelect, UserWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a User with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteUserMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteUserMutation(params: { - selection: ({ - fields: S & UserSelect; - } & HookStrictSelect, UserSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteUser: { - user: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteUserMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteUserMutation( + params: { + selection: { + fields: S & UserSelect; + } & HookStrictSelect, UserSelect>; + } & Omit< + UseMutationOptions< + { + deleteUser: { + user: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteUser: { + user: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteUserMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().user.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .user.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: userKeys.detail(variables.id) + queryKey: userKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userKeys.lists() + queryKey: userKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteWebauthnCredentialMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteWebauthnCredentialMutation.ts index 5b88140a1a..fb94958fe9 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteWebauthnCredentialMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteWebauthnCredentialMutation.ts @@ -4,77 +4,101 @@ * 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 { webauthnCredentialKeys } from "../query-keys"; -import { webauthnCredentialMutationKeys } from "../mutation-keys"; -import type { WebauthnCredentialSelect, WebauthnCredentialWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialSelect, WebauthnCredentialWithRelations } from "../../orm/input-types"; +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 { webauthnCredentialKeys } from '../query-keys'; +import { webauthnCredentialMutationKeys } from '../mutation-keys'; +import type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, +} from '../../orm/input-types'; /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteWebauthnCredentialMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteWebauthnCredentialMutation(params: { - selection: ({ - fields: S & WebauthnCredentialSelect; - } & HookStrictSelect, WebauthnCredentialSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteWebauthnCredential: { - webauthnCredential: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteWebauthnCredentialMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteWebauthnCredentialMutation( + params: { + selection: { + fields: S & WebauthnCredentialSelect; + } & HookStrictSelect, WebauthnCredentialSelect>; + } & Omit< + UseMutationOptions< + { + deleteWebauthnCredential: { + webauthnCredential: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteWebauthnCredential: { + webauthnCredential: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteWebauthnCredentialMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnCredentialMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().webauthnCredential.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .webauthnCredential.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: webauthnCredentialKeys.detail(variables.id) + queryKey: webauthnCredentialKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webauthnCredentialKeys.lists() + queryKey: webauthnCredentialKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDisconnectAccountMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDisconnectAccountMutation.ts index ffb4102bf3..8efb938055 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDisconnectAccountMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDisconnectAccountMutation.ts @@ -4,39 +4,55 @@ * 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 { DisconnectAccountVariables } from "../../orm/mutation"; -import type { DisconnectAccountPayloadSelect, DisconnectAccountPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { DisconnectAccountVariables } from "../../orm/mutation"; -export type { DisconnectAccountPayloadSelect } from "../../orm/input-types"; -export function useDisconnectAccountMutation(params: { - selection: ({ - fields: S & DisconnectAccountPayloadSelect; - } & HookStrictSelect, DisconnectAccountPayloadSelect>); -} & Omit | null; -}, Error, DisconnectAccountVariables>, "mutationFn">): UseMutationResult<{ - disconnectAccount: InferSelectResult | null; -}, Error, DisconnectAccountVariables> { +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 { DisconnectAccountVariables } from '../../orm/mutation'; +import type { + DisconnectAccountPayloadSelect, + DisconnectAccountPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { DisconnectAccountVariables } from '../../orm/mutation'; +export type { DisconnectAccountPayloadSelect } from '../../orm/input-types'; +export function useDisconnectAccountMutation( + params: { + selection: { + fields: S & DisconnectAccountPayloadSelect; + } & HookStrictSelect, DisconnectAccountPayloadSelect>; + } & Omit< + UseMutationOptions< + { + disconnectAccount: InferSelectResult | null; + }, + Error, + DisconnectAccountVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + disconnectAccount: InferSelectResult | null; + }, + Error, + DisconnectAccountVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.disconnectAccount(), - mutationFn: (variables: DisconnectAccountVariables) => getClient().mutation.disconnectAccount(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: DisconnectAccountVariables) => + getClient() + .mutation.disconnectAccount(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useExtendTokenExpiresMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useExtendTokenExpiresMutation.ts index f9926e2859..d5d081a1fd 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useExtendTokenExpiresMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useExtendTokenExpiresMutation.ts @@ -4,39 +4,55 @@ * 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 { ExtendTokenExpiresVariables } from "../../orm/mutation"; -import type { ExtendTokenExpiresPayloadSelect, ExtendTokenExpiresPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ExtendTokenExpiresVariables } from "../../orm/mutation"; -export type { ExtendTokenExpiresPayloadSelect } from "../../orm/input-types"; -export function useExtendTokenExpiresMutation(params: { - selection: ({ - fields: S & ExtendTokenExpiresPayloadSelect; - } & HookStrictSelect, ExtendTokenExpiresPayloadSelect>); -} & Omit | null; -}, Error, ExtendTokenExpiresVariables>, "mutationFn">): UseMutationResult<{ - extendTokenExpires: InferSelectResult | null; -}, Error, ExtendTokenExpiresVariables> { +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 { ExtendTokenExpiresVariables } from '../../orm/mutation'; +import type { + ExtendTokenExpiresPayloadSelect, + ExtendTokenExpiresPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ExtendTokenExpiresVariables } from '../../orm/mutation'; +export type { ExtendTokenExpiresPayloadSelect } from '../../orm/input-types'; +export function useExtendTokenExpiresMutation( + params: { + selection: { + fields: S & ExtendTokenExpiresPayloadSelect; + } & HookStrictSelect, ExtendTokenExpiresPayloadSelect>; + } & Omit< + UseMutationOptions< + { + extendTokenExpires: InferSelectResult | null; + }, + Error, + ExtendTokenExpiresVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + extendTokenExpires: InferSelectResult | null; + }, + Error, + ExtendTokenExpiresVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.extendTokenExpires(), - mutationFn: (variables: ExtendTokenExpiresVariables) => getClient().mutation.extendTokenExpires(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ExtendTokenExpiresVariables) => + getClient() + .mutation.extendTokenExpires(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useForgotPasswordMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useForgotPasswordMutation.ts index ca6a01229b..a30ced3869 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useForgotPasswordMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useForgotPasswordMutation.ts @@ -4,39 +4,52 @@ * 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 { ForgotPasswordVariables } from "../../orm/mutation"; -import type { ForgotPasswordPayloadSelect, ForgotPasswordPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ForgotPasswordVariables } from "../../orm/mutation"; -export type { ForgotPasswordPayloadSelect } from "../../orm/input-types"; -export function useForgotPasswordMutation(params: { - selection: ({ - fields: S & ForgotPasswordPayloadSelect; - } & HookStrictSelect, ForgotPasswordPayloadSelect>); -} & Omit | null; -}, Error, ForgotPasswordVariables>, "mutationFn">): UseMutationResult<{ - forgotPassword: InferSelectResult | null; -}, Error, ForgotPasswordVariables> { +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 { ForgotPasswordVariables } from '../../orm/mutation'; +import type { ForgotPasswordPayloadSelect, ForgotPasswordPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ForgotPasswordVariables } from '../../orm/mutation'; +export type { ForgotPasswordPayloadSelect } from '../../orm/input-types'; +export function useForgotPasswordMutation( + params: { + selection: { + fields: S & ForgotPasswordPayloadSelect; + } & HookStrictSelect, ForgotPasswordPayloadSelect>; + } & Omit< + UseMutationOptions< + { + forgotPassword: InferSelectResult | null; + }, + Error, + ForgotPasswordVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + forgotPassword: InferSelectResult | null; + }, + Error, + ForgotPasswordVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.forgotPassword(), - mutationFn: (variables: ForgotPasswordVariables) => getClient().mutation.forgotPassword(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ForgotPasswordVariables) => + getClient() + .mutation.forgotPassword(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useLinkIdentityMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useLinkIdentityMutation.ts index 87f3101bf0..32d3ab0da7 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useLinkIdentityMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useLinkIdentityMutation.ts @@ -4,39 +4,52 @@ * 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 { LinkIdentityVariables } from "../../orm/mutation"; -import type { LinkIdentityPayloadSelect, LinkIdentityPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { LinkIdentityVariables } from "../../orm/mutation"; -export type { LinkIdentityPayloadSelect } from "../../orm/input-types"; -export function useLinkIdentityMutation(params: { - selection: ({ - fields: S & LinkIdentityPayloadSelect; - } & HookStrictSelect, LinkIdentityPayloadSelect>); -} & Omit | null; -}, Error, LinkIdentityVariables>, "mutationFn">): UseMutationResult<{ - linkIdentity: InferSelectResult | null; -}, Error, LinkIdentityVariables> { +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 { LinkIdentityVariables } from '../../orm/mutation'; +import type { LinkIdentityPayloadSelect, LinkIdentityPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { LinkIdentityVariables } from '../../orm/mutation'; +export type { LinkIdentityPayloadSelect } from '../../orm/input-types'; +export function useLinkIdentityMutation( + params: { + selection: { + fields: S & LinkIdentityPayloadSelect; + } & HookStrictSelect, LinkIdentityPayloadSelect>; + } & Omit< + UseMutationOptions< + { + linkIdentity: InferSelectResult | null; + }, + Error, + LinkIdentityVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + linkIdentity: InferSelectResult | null; + }, + Error, + LinkIdentityVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.linkIdentity(), - mutationFn: (variables: LinkIdentityVariables) => getClient().mutation.linkIdentity(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: LinkIdentityVariables) => + getClient() + .mutation.linkIdentity(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useProvisionNewUserMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useProvisionNewUserMutation.ts index b160b724b9..24964f5a67 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useProvisionNewUserMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useProvisionNewUserMutation.ts @@ -4,39 +4,52 @@ * 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 { ProvisionNewUserVariables } from "../../orm/mutation"; -import type { ProvisionNewUserPayloadSelect, ProvisionNewUserPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionNewUserVariables } from "../../orm/mutation"; -export type { ProvisionNewUserPayloadSelect } from "../../orm/input-types"; -export function useProvisionNewUserMutation(params: { - selection: ({ - fields: S & ProvisionNewUserPayloadSelect; - } & HookStrictSelect, ProvisionNewUserPayloadSelect>); -} & Omit | null; -}, Error, ProvisionNewUserVariables>, "mutationFn">): UseMutationResult<{ - provisionNewUser: InferSelectResult | null; -}, Error, ProvisionNewUserVariables> { +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 { ProvisionNewUserVariables } from '../../orm/mutation'; +import type { ProvisionNewUserPayloadSelect, ProvisionNewUserPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionNewUserVariables } from '../../orm/mutation'; +export type { ProvisionNewUserPayloadSelect } from '../../orm/input-types'; +export function useProvisionNewUserMutation( + params: { + selection: { + fields: S & ProvisionNewUserPayloadSelect; + } & HookStrictSelect, ProvisionNewUserPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionNewUser: InferSelectResult | null; + }, + Error, + ProvisionNewUserVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionNewUser: InferSelectResult | null; + }, + Error, + ProvisionNewUserVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionNewUser(), - mutationFn: (variables: ProvisionNewUserVariables) => getClient().mutation.provisionNewUser(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionNewUserVariables) => + getClient() + .mutation.provisionNewUser(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useRequestCrossOriginTokenMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useRequestCrossOriginTokenMutation.ts index be9da3d99d..e8575a3fa3 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useRequestCrossOriginTokenMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useRequestCrossOriginTokenMutation.ts @@ -4,39 +4,55 @@ * 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 { RequestCrossOriginTokenVariables } from "../../orm/mutation"; -import type { RequestCrossOriginTokenPayloadSelect, RequestCrossOriginTokenPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { RequestCrossOriginTokenVariables } from "../../orm/mutation"; -export type { RequestCrossOriginTokenPayloadSelect } from "../../orm/input-types"; -export function useRequestCrossOriginTokenMutation(params: { - selection: ({ - fields: S & RequestCrossOriginTokenPayloadSelect; - } & HookStrictSelect, RequestCrossOriginTokenPayloadSelect>); -} & Omit | null; -}, Error, RequestCrossOriginTokenVariables>, "mutationFn">): UseMutationResult<{ - requestCrossOriginToken: InferSelectResult | null; -}, Error, RequestCrossOriginTokenVariables> { +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 { RequestCrossOriginTokenVariables } from '../../orm/mutation'; +import type { + RequestCrossOriginTokenPayloadSelect, + RequestCrossOriginTokenPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { RequestCrossOriginTokenVariables } from '../../orm/mutation'; +export type { RequestCrossOriginTokenPayloadSelect } from '../../orm/input-types'; +export function useRequestCrossOriginTokenMutation( + params: { + selection: { + fields: S & RequestCrossOriginTokenPayloadSelect; + } & HookStrictSelect, RequestCrossOriginTokenPayloadSelect>; + } & Omit< + UseMutationOptions< + { + requestCrossOriginToken: InferSelectResult | null; + }, + Error, + RequestCrossOriginTokenVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + requestCrossOriginToken: InferSelectResult | null; + }, + Error, + RequestCrossOriginTokenVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.requestCrossOriginToken(), - mutationFn: (variables: RequestCrossOriginTokenVariables) => getClient().mutation.requestCrossOriginToken(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: RequestCrossOriginTokenVariables) => + getClient() + .mutation.requestCrossOriginToken(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useResetPasswordMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useResetPasswordMutation.ts index 77da459959..383cb8fa39 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useResetPasswordMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useResetPasswordMutation.ts @@ -4,39 +4,52 @@ * 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 { ResetPasswordVariables } from "../../orm/mutation"; -import type { ResetPasswordPayloadSelect, ResetPasswordPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ResetPasswordVariables } from "../../orm/mutation"; -export type { ResetPasswordPayloadSelect } from "../../orm/input-types"; -export function useResetPasswordMutation(params: { - selection: ({ - fields: S & ResetPasswordPayloadSelect; - } & HookStrictSelect, ResetPasswordPayloadSelect>); -} & Omit | null; -}, Error, ResetPasswordVariables>, "mutationFn">): UseMutationResult<{ - resetPassword: InferSelectResult | null; -}, Error, ResetPasswordVariables> { +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 { ResetPasswordVariables } from '../../orm/mutation'; +import type { ResetPasswordPayloadSelect, ResetPasswordPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ResetPasswordVariables } from '../../orm/mutation'; +export type { ResetPasswordPayloadSelect } from '../../orm/input-types'; +export function useResetPasswordMutation( + params: { + selection: { + fields: S & ResetPasswordPayloadSelect; + } & HookStrictSelect, ResetPasswordPayloadSelect>; + } & Omit< + UseMutationOptions< + { + resetPassword: InferSelectResult | null; + }, + Error, + ResetPasswordVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + resetPassword: InferSelectResult | null; + }, + Error, + ResetPasswordVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.resetPassword(), - mutationFn: (variables: ResetPasswordVariables) => getClient().mutation.resetPassword(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ResetPasswordVariables) => + getClient() + .mutation.resetPassword(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useRevokeApiKeyMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useRevokeApiKeyMutation.ts index 35ce15896f..68641999aa 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useRevokeApiKeyMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useRevokeApiKeyMutation.ts @@ -4,39 +4,52 @@ * 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 { RevokeApiKeyVariables } from "../../orm/mutation"; -import type { RevokeApiKeyPayloadSelect, RevokeApiKeyPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { RevokeApiKeyVariables } from "../../orm/mutation"; -export type { RevokeApiKeyPayloadSelect } from "../../orm/input-types"; -export function useRevokeApiKeyMutation(params: { - selection: ({ - fields: S & RevokeApiKeyPayloadSelect; - } & HookStrictSelect, RevokeApiKeyPayloadSelect>); -} & Omit | null; -}, Error, RevokeApiKeyVariables>, "mutationFn">): UseMutationResult<{ - revokeApiKey: InferSelectResult | null; -}, Error, RevokeApiKeyVariables> { +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 { RevokeApiKeyVariables } from '../../orm/mutation'; +import type { RevokeApiKeyPayloadSelect, RevokeApiKeyPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { RevokeApiKeyVariables } from '../../orm/mutation'; +export type { RevokeApiKeyPayloadSelect } from '../../orm/input-types'; +export function useRevokeApiKeyMutation( + params: { + selection: { + fields: S & RevokeApiKeyPayloadSelect; + } & HookStrictSelect, RevokeApiKeyPayloadSelect>; + } & Omit< + UseMutationOptions< + { + revokeApiKey: InferSelectResult | null; + }, + Error, + RevokeApiKeyVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + revokeApiKey: InferSelectResult | null; + }, + Error, + RevokeApiKeyVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.revokeApiKey(), - mutationFn: (variables: RevokeApiKeyVariables) => getClient().mutation.revokeApiKey(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: RevokeApiKeyVariables) => + getClient() + .mutation.revokeApiKey(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useRevokeOrgApiKeyMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useRevokeOrgApiKeyMutation.ts index 201df30504..69d97ad4c7 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useRevokeOrgApiKeyMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useRevokeOrgApiKeyMutation.ts @@ -4,39 +4,52 @@ * 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 | null; -}, Error, RevokeOrgApiKeyVariables>, "mutationFn">): UseMutationResult<{ - revokeOrgApiKey: InferSelectResult | null; -}, Error, RevokeOrgApiKeyVariables> { +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 ?? {}; + 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 + 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/useRevokeSessionMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useRevokeSessionMutation.ts index f14b0ebef2..773e73c5fa 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useRevokeSessionMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useRevokeSessionMutation.ts @@ -4,39 +4,52 @@ * 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 { RevokeSessionVariables } from "../../orm/mutation"; -import type { RevokeSessionPayloadSelect, RevokeSessionPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { RevokeSessionVariables } from "../../orm/mutation"; -export type { RevokeSessionPayloadSelect } from "../../orm/input-types"; -export function useRevokeSessionMutation(params: { - selection: ({ - fields: S & RevokeSessionPayloadSelect; - } & HookStrictSelect, RevokeSessionPayloadSelect>); -} & Omit | null; -}, Error, RevokeSessionVariables>, "mutationFn">): UseMutationResult<{ - revokeSession: InferSelectResult | null; -}, Error, RevokeSessionVariables> { +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 { RevokeSessionVariables } from '../../orm/mutation'; +import type { RevokeSessionPayloadSelect, RevokeSessionPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { RevokeSessionVariables } from '../../orm/mutation'; +export type { RevokeSessionPayloadSelect } from '../../orm/input-types'; +export function useRevokeSessionMutation( + params: { + selection: { + fields: S & RevokeSessionPayloadSelect; + } & HookStrictSelect, RevokeSessionPayloadSelect>; + } & Omit< + UseMutationOptions< + { + revokeSession: InferSelectResult | null; + }, + Error, + RevokeSessionVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + revokeSession: InferSelectResult | null; + }, + Error, + RevokeSessionVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.revokeSession(), - mutationFn: (variables: RevokeSessionVariables) => getClient().mutation.revokeSession(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: RevokeSessionVariables) => + getClient() + .mutation.revokeSession(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSendAccountDeletionEmailMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSendAccountDeletionEmailMutation.ts index 24c523afd8..55a1791180 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSendAccountDeletionEmailMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSendAccountDeletionEmailMutation.ts @@ -4,39 +4,57 @@ * 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 { SendAccountDeletionEmailVariables } from "../../orm/mutation"; -import type { SendAccountDeletionEmailPayloadSelect, SendAccountDeletionEmailPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SendAccountDeletionEmailVariables } from "../../orm/mutation"; -export type { SendAccountDeletionEmailPayloadSelect } from "../../orm/input-types"; -export function useSendAccountDeletionEmailMutation(params: { - selection: ({ - fields: S & SendAccountDeletionEmailPayloadSelect; - } & HookStrictSelect, SendAccountDeletionEmailPayloadSelect>); -} & Omit | null; -}, Error, SendAccountDeletionEmailVariables>, "mutationFn">): UseMutationResult<{ - sendAccountDeletionEmail: InferSelectResult | null; -}, Error, SendAccountDeletionEmailVariables> { +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 { SendAccountDeletionEmailVariables } from '../../orm/mutation'; +import type { + SendAccountDeletionEmailPayloadSelect, + SendAccountDeletionEmailPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SendAccountDeletionEmailVariables } from '../../orm/mutation'; +export type { SendAccountDeletionEmailPayloadSelect } from '../../orm/input-types'; +export function useSendAccountDeletionEmailMutation< + S extends SendAccountDeletionEmailPayloadSelect, +>( + params: { + selection: { + fields: S & SendAccountDeletionEmailPayloadSelect; + } & HookStrictSelect, SendAccountDeletionEmailPayloadSelect>; + } & Omit< + UseMutationOptions< + { + sendAccountDeletionEmail: InferSelectResult | null; + }, + Error, + SendAccountDeletionEmailVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + sendAccountDeletionEmail: InferSelectResult | null; + }, + Error, + SendAccountDeletionEmailVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.sendAccountDeletionEmail(), - mutationFn: (variables: SendAccountDeletionEmailVariables) => getClient().mutation.sendAccountDeletionEmail(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SendAccountDeletionEmailVariables) => + getClient() + .mutation.sendAccountDeletionEmail(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSendVerificationEmailMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSendVerificationEmailMutation.ts index da3c172d77..ea9ee0d767 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSendVerificationEmailMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSendVerificationEmailMutation.ts @@ -4,39 +4,55 @@ * 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 { SendVerificationEmailVariables } from "../../orm/mutation"; -import type { SendVerificationEmailPayloadSelect, SendVerificationEmailPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SendVerificationEmailVariables } from "../../orm/mutation"; -export type { SendVerificationEmailPayloadSelect } from "../../orm/input-types"; -export function useSendVerificationEmailMutation(params: { - selection: ({ - fields: S & SendVerificationEmailPayloadSelect; - } & HookStrictSelect, SendVerificationEmailPayloadSelect>); -} & Omit | null; -}, Error, SendVerificationEmailVariables>, "mutationFn">): UseMutationResult<{ - sendVerificationEmail: InferSelectResult | null; -}, Error, SendVerificationEmailVariables> { +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 { SendVerificationEmailVariables } from '../../orm/mutation'; +import type { + SendVerificationEmailPayloadSelect, + SendVerificationEmailPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SendVerificationEmailVariables } from '../../orm/mutation'; +export type { SendVerificationEmailPayloadSelect } from '../../orm/input-types'; +export function useSendVerificationEmailMutation( + params: { + selection: { + fields: S & SendVerificationEmailPayloadSelect; + } & HookStrictSelect, SendVerificationEmailPayloadSelect>; + } & Omit< + UseMutationOptions< + { + sendVerificationEmail: InferSelectResult | null; + }, + Error, + SendVerificationEmailVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + sendVerificationEmail: InferSelectResult | null; + }, + Error, + SendVerificationEmailVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.sendVerificationEmail(), - mutationFn: (variables: SendVerificationEmailVariables) => getClient().mutation.sendVerificationEmail(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SendVerificationEmailVariables) => + getClient() + .mutation.sendVerificationEmail(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSetPasswordMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSetPasswordMutation.ts index 2d549a37f6..af901aba16 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSetPasswordMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSetPasswordMutation.ts @@ -4,39 +4,52 @@ * 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 { SetPasswordVariables } from "../../orm/mutation"; -import type { SetPasswordPayloadSelect, SetPasswordPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SetPasswordVariables } from "../../orm/mutation"; -export type { SetPasswordPayloadSelect } from "../../orm/input-types"; -export function useSetPasswordMutation(params: { - selection: ({ - fields: S & SetPasswordPayloadSelect; - } & HookStrictSelect, SetPasswordPayloadSelect>); -} & Omit | null; -}, Error, SetPasswordVariables>, "mutationFn">): UseMutationResult<{ - setPassword: InferSelectResult | null; -}, Error, SetPasswordVariables> { +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 { SetPasswordVariables } from '../../orm/mutation'; +import type { SetPasswordPayloadSelect, SetPasswordPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SetPasswordVariables } from '../../orm/mutation'; +export type { SetPasswordPayloadSelect } from '../../orm/input-types'; +export function useSetPasswordMutation( + params: { + selection: { + fields: S & SetPasswordPayloadSelect; + } & HookStrictSelect, SetPasswordPayloadSelect>; + } & Omit< + UseMutationOptions< + { + setPassword: InferSelectResult | null; + }, + Error, + SetPasswordVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + setPassword: InferSelectResult | null; + }, + Error, + SetPasswordVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.setPassword(), - mutationFn: (variables: SetPasswordVariables) => getClient().mutation.setPassword(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SetPasswordVariables) => + getClient() + .mutation.setPassword(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSignInCrossOriginMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSignInCrossOriginMutation.ts index 33afe347a2..8afc114549 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSignInCrossOriginMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSignInCrossOriginMutation.ts @@ -4,39 +4,55 @@ * 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 { SignInCrossOriginVariables } from "../../orm/mutation"; -import type { SignInCrossOriginPayloadSelect, SignInCrossOriginPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SignInCrossOriginVariables } from "../../orm/mutation"; -export type { SignInCrossOriginPayloadSelect } from "../../orm/input-types"; -export function useSignInCrossOriginMutation(params: { - selection: ({ - fields: S & SignInCrossOriginPayloadSelect; - } & HookStrictSelect, SignInCrossOriginPayloadSelect>); -} & Omit | null; -}, Error, SignInCrossOriginVariables>, "mutationFn">): UseMutationResult<{ - signInCrossOrigin: InferSelectResult | null; -}, Error, SignInCrossOriginVariables> { +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 { SignInCrossOriginVariables } from '../../orm/mutation'; +import type { + SignInCrossOriginPayloadSelect, + SignInCrossOriginPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SignInCrossOriginVariables } from '../../orm/mutation'; +export type { SignInCrossOriginPayloadSelect } from '../../orm/input-types'; +export function useSignInCrossOriginMutation( + params: { + selection: { + fields: S & SignInCrossOriginPayloadSelect; + } & HookStrictSelect, SignInCrossOriginPayloadSelect>; + } & Omit< + UseMutationOptions< + { + signInCrossOrigin: InferSelectResult | null; + }, + Error, + SignInCrossOriginVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + signInCrossOrigin: InferSelectResult | null; + }, + Error, + SignInCrossOriginVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.signInCrossOrigin(), - mutationFn: (variables: SignInCrossOriginVariables) => getClient().mutation.signInCrossOrigin(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SignInCrossOriginVariables) => + getClient() + .mutation.signInCrossOrigin(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSignInMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSignInMutation.ts index e992762597..ff20ed5c4f 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSignInMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSignInMutation.ts @@ -4,39 +4,52 @@ * 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 { SignInVariables } from "../../orm/mutation"; -import type { SignInPayloadSelect, SignInPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SignInVariables } from "../../orm/mutation"; -export type { SignInPayloadSelect } from "../../orm/input-types"; -export function useSignInMutation(params: { - selection: ({ - fields: S & SignInPayloadSelect; - } & HookStrictSelect, SignInPayloadSelect>); -} & Omit | null; -}, Error, SignInVariables>, "mutationFn">): UseMutationResult<{ - signIn: InferSelectResult | null; -}, Error, SignInVariables> { +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 { SignInVariables } from '../../orm/mutation'; +import type { SignInPayloadSelect, SignInPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SignInVariables } from '../../orm/mutation'; +export type { SignInPayloadSelect } from '../../orm/input-types'; +export function useSignInMutation( + params: { + selection: { + fields: S & SignInPayloadSelect; + } & HookStrictSelect, SignInPayloadSelect>; + } & Omit< + UseMutationOptions< + { + signIn: InferSelectResult | null; + }, + Error, + SignInVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + signIn: InferSelectResult | null; + }, + Error, + SignInVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.signIn(), - mutationFn: (variables: SignInVariables) => getClient().mutation.signIn(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SignInVariables) => + getClient() + .mutation.signIn(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSignInSmsOtpMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSignInSmsOtpMutation.ts index e29545e07d..8e78c47f2a 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSignInSmsOtpMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSignInSmsOtpMutation.ts @@ -4,39 +4,52 @@ * 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 { SignInSmsOtpVariables } from "../../orm/mutation"; -import type { SignInSmsOtpPayloadSelect, SignInSmsOtpPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SignInSmsOtpVariables } from "../../orm/mutation"; -export type { SignInSmsOtpPayloadSelect } from "../../orm/input-types"; -export function useSignInSmsOtpMutation(params: { - selection: ({ - fields: S & SignInSmsOtpPayloadSelect; - } & HookStrictSelect, SignInSmsOtpPayloadSelect>); -} & Omit | null; -}, Error, SignInSmsOtpVariables>, "mutationFn">): UseMutationResult<{ - signInSmsOtp: InferSelectResult | null; -}, Error, SignInSmsOtpVariables> { +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 { SignInSmsOtpVariables } from '../../orm/mutation'; +import type { SignInSmsOtpPayloadSelect, SignInSmsOtpPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SignInSmsOtpVariables } from '../../orm/mutation'; +export type { SignInSmsOtpPayloadSelect } from '../../orm/input-types'; +export function useSignInSmsOtpMutation( + params: { + selection: { + fields: S & SignInSmsOtpPayloadSelect; + } & HookStrictSelect, SignInSmsOtpPayloadSelect>; + } & Omit< + UseMutationOptions< + { + signInSmsOtp: InferSelectResult | null; + }, + Error, + SignInSmsOtpVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + signInSmsOtp: InferSelectResult | null; + }, + Error, + SignInSmsOtpVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.signInSmsOtp(), - mutationFn: (variables: SignInSmsOtpVariables) => getClient().mutation.signInSmsOtp(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SignInSmsOtpVariables) => + getClient() + .mutation.signInSmsOtp(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSignOutMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSignOutMutation.ts index f8f728128e..fba4da1f53 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSignOutMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSignOutMutation.ts @@ -4,39 +4,52 @@ * 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 { SignOutVariables } from "../../orm/mutation"; -import type { SignOutPayloadSelect, SignOutPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SignOutVariables } from "../../orm/mutation"; -export type { SignOutPayloadSelect } from "../../orm/input-types"; -export function useSignOutMutation(params: { - selection: ({ - fields: S & SignOutPayloadSelect; - } & HookStrictSelect, SignOutPayloadSelect>); -} & Omit | null; -}, Error, SignOutVariables>, "mutationFn">): UseMutationResult<{ - signOut: InferSelectResult | null; -}, Error, SignOutVariables> { +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 { SignOutVariables } from '../../orm/mutation'; +import type { SignOutPayloadSelect, SignOutPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SignOutVariables } from '../../orm/mutation'; +export type { SignOutPayloadSelect } from '../../orm/input-types'; +export function useSignOutMutation( + params: { + selection: { + fields: S & SignOutPayloadSelect; + } & HookStrictSelect, SignOutPayloadSelect>; + } & Omit< + UseMutationOptions< + { + signOut: InferSelectResult | null; + }, + Error, + SignOutVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + signOut: InferSelectResult | null; + }, + Error, + SignOutVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.signOut(), - mutationFn: (variables: SignOutVariables) => getClient().mutation.signOut(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SignOutVariables) => + getClient() + .mutation.signOut(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSignUpMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSignUpMutation.ts index f8bbf28b4f..8dc94a8961 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSignUpMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSignUpMutation.ts @@ -4,39 +4,52 @@ * 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 { SignUpVariables } from "../../orm/mutation"; -import type { SignUpPayloadSelect, SignUpPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SignUpVariables } from "../../orm/mutation"; -export type { SignUpPayloadSelect } from "../../orm/input-types"; -export function useSignUpMutation(params: { - selection: ({ - fields: S & SignUpPayloadSelect; - } & HookStrictSelect, SignUpPayloadSelect>); -} & Omit | null; -}, Error, SignUpVariables>, "mutationFn">): UseMutationResult<{ - signUp: InferSelectResult | null; -}, Error, SignUpVariables> { +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 { SignUpVariables } from '../../orm/mutation'; +import type { SignUpPayloadSelect, SignUpPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SignUpVariables } from '../../orm/mutation'; +export type { SignUpPayloadSelect } from '../../orm/input-types'; +export function useSignUpMutation( + params: { + selection: { + fields: S & SignUpPayloadSelect; + } & HookStrictSelect, SignUpPayloadSelect>; + } & Omit< + UseMutationOptions< + { + signUp: InferSelectResult | null; + }, + Error, + SignUpVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + signUp: InferSelectResult | null; + }, + Error, + SignUpVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.signUp(), - mutationFn: (variables: SignUpVariables) => getClient().mutation.signUp(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SignUpVariables) => + getClient() + .mutation.signUp(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useSignUpSmsMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useSignUpSmsMutation.ts index 57cf29cbcd..f3c96f71ac 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useSignUpSmsMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useSignUpSmsMutation.ts @@ -4,39 +4,52 @@ * 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 { SignUpSmsVariables } from "../../orm/mutation"; -import type { SignUpSmsPayloadSelect, SignUpSmsPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SignUpSmsVariables } from "../../orm/mutation"; -export type { SignUpSmsPayloadSelect } from "../../orm/input-types"; -export function useSignUpSmsMutation(params: { - selection: ({ - fields: S & SignUpSmsPayloadSelect; - } & HookStrictSelect, SignUpSmsPayloadSelect>); -} & Omit | null; -}, Error, SignUpSmsVariables>, "mutationFn">): UseMutationResult<{ - signUpSms: InferSelectResult | null; -}, Error, SignUpSmsVariables> { +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 { SignUpSmsVariables } from '../../orm/mutation'; +import type { SignUpSmsPayloadSelect, SignUpSmsPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SignUpSmsVariables } from '../../orm/mutation'; +export type { SignUpSmsPayloadSelect } from '../../orm/input-types'; +export function useSignUpSmsMutation( + params: { + selection: { + fields: S & SignUpSmsPayloadSelect; + } & HookStrictSelect, SignUpSmsPayloadSelect>; + } & Omit< + UseMutationOptions< + { + signUpSms: InferSelectResult | null; + }, + Error, + SignUpSmsVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + signUpSms: InferSelectResult | null; + }, + Error, + SignUpSmsVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.signUpSms(), - mutationFn: (variables: SignUpSmsVariables) => getClient().mutation.signUpSms(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SignUpSmsVariables) => + getClient() + .mutation.signUpSms(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateAuditLogAuthMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateAuditLogAuthMutation.ts index 4dbbae56a7..5ca6d4324c 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateAuditLogAuthMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateAuditLogAuthMutation.ts @@ -4,61 +4,88 @@ * 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 { auditLogAuthKeys } from "../query-keys"; -import { auditLogAuthMutationKeys } from "../mutation-keys"; -import type { AuditLogAuthSelect, AuditLogAuthWithRelations, AuditLogAuthPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AuditLogAuthSelect, AuditLogAuthWithRelations, AuditLogAuthPatch } from "../../orm/input-types"; +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 { auditLogAuthKeys } from '../query-keys'; +import { auditLogAuthMutationKeys } from '../mutation-keys'; +import type { + AuditLogAuthSelect, + AuditLogAuthWithRelations, + AuditLogAuthPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AuditLogAuthSelect, + AuditLogAuthWithRelations, + AuditLogAuthPatch, +} from '../../orm/input-types'; /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAuditLogAuthMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', auditLogAuthPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAuditLogAuthMutation(params: { - selection: ({ - fields: S & AuditLogAuthSelect; - } & HookStrictSelect, AuditLogAuthSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - auditLogAuthPatch: AuditLogAuthPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAuditLogAuth: { - auditLogAuth: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - auditLogAuthPatch: AuditLogAuthPatch; -}>; -export function useUpdateAuditLogAuthMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAuditLogAuthMutation( + params: { + selection: { + fields: S & AuditLogAuthSelect; + } & HookStrictSelect, AuditLogAuthSelect>; + } & Omit< + UseMutationOptions< + { + updateAuditLogAuth: { + auditLogAuth: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + auditLogAuthPatch: AuditLogAuthPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAuditLogAuth: { + auditLogAuth: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + auditLogAuthPatch: AuditLogAuthPatch; + } +>; +export function useUpdateAuditLogAuthMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + auditLogAuthPatch: AuditLogAuthPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateAuditLogAuthMutation(params: { mutationFn: ({ id, createdAt, - auditLogAuthPatch + auditLogAuthPatch, }: { id: string; createdAt: string; auditLogAuthPatch: AuditLogAuthPatch; - }) => getClient().auditLogAuth.update({ - where: { - id, - createdAt - }, - data: auditLogAuthPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .auditLogAuth.update({ + where: { + id, + createdAt, + }, + data: auditLogAuthPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: auditLogAuthKeys.detail(variables.id) + queryKey: auditLogAuthKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: auditLogAuthKeys.lists() + queryKey: auditLogAuthKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateCryptoAddressMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateCryptoAddressMutation.ts index 8e628ab0c5..f154244b5c 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateCryptoAddressMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateCryptoAddressMutation.ts @@ -4,83 +4,113 @@ * 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 { cryptoAddressKeys } from "../query-keys"; -import { cryptoAddressMutationKeys } from "../mutation-keys"; -import type { CryptoAddressSelect, CryptoAddressWithRelations, CryptoAddressPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressSelect, CryptoAddressWithRelations, CryptoAddressPatch } from "../../orm/input-types"; +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 { cryptoAddressKeys } from '../query-keys'; +import { cryptoAddressMutationKeys } from '../mutation-keys'; +import type { + CryptoAddressSelect, + CryptoAddressWithRelations, + CryptoAddressPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CryptoAddressSelect, + CryptoAddressWithRelations, + CryptoAddressPatch, +} from '../../orm/input-types'; /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateCryptoAddressMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', cryptoAddressPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateCryptoAddressMutation(params: { - selection: ({ - fields: S & CryptoAddressSelect; - } & HookStrictSelect, CryptoAddressSelect>); -} & Omit; - }; -}, Error, { - id: string; - cryptoAddressPatch: CryptoAddressPatch; -}>, "mutationFn">): UseMutationResult<{ - updateCryptoAddress: { - cryptoAddress: InferSelectResult; - }; -}, Error, { - id: string; - cryptoAddressPatch: CryptoAddressPatch; -}>; -export function useUpdateCryptoAddressMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateCryptoAddressMutation( + params: { + selection: { + fields: S & CryptoAddressSelect; + } & HookStrictSelect, CryptoAddressSelect>; + } & Omit< + UseMutationOptions< + { + updateCryptoAddress: { + cryptoAddress: InferSelectResult; + }; + }, + Error, + { + id: string; + cryptoAddressPatch: CryptoAddressPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateCryptoAddress: { + cryptoAddress: InferSelectResult; + }; + }, + Error, + { + id: string; + cryptoAddressPatch: CryptoAddressPatch; + } +>; +export function useUpdateCryptoAddressMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + cryptoAddressPatch: CryptoAddressPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAddressMutationKeys.all, mutationFn: ({ id, - cryptoAddressPatch + cryptoAddressPatch, }: { id: string; cryptoAddressPatch: CryptoAddressPatch; - }) => getClient().cryptoAddress.update({ - where: { - id - }, - data: cryptoAddressPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .cryptoAddress.update({ + where: { + id, + }, + data: cryptoAddressPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: cryptoAddressKeys.detail(variables.id) + queryKey: cryptoAddressKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: cryptoAddressKeys.lists() + queryKey: cryptoAddressKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateEmailMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateEmailMutation.ts index dda1922112..94c754ac4d 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateEmailMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateEmailMutation.ts @@ -4,83 +4,99 @@ * 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 { emailKeys } from "../query-keys"; -import { emailMutationKeys } from "../mutation-keys"; -import type { EmailSelect, EmailWithRelations, EmailPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailSelect, EmailWithRelations, EmailPatch } from "../../orm/input-types"; +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 { emailKeys } from '../query-keys'; +import { emailMutationKeys } from '../mutation-keys'; +import type { EmailSelect, EmailWithRelations, EmailPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EmailSelect, EmailWithRelations, EmailPatch } from '../../orm/input-types'; /** * User email addresses with verification and primary-email management - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateEmailMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', emailPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateEmailMutation(params: { - selection: ({ - fields: S & EmailSelect; - } & HookStrictSelect, EmailSelect>); -} & Omit; - }; -}, Error, { - id: string; - emailPatch: EmailPatch; -}>, "mutationFn">): UseMutationResult<{ - updateEmail: { - email: InferSelectResult; - }; -}, Error, { - id: string; - emailPatch: EmailPatch; -}>; -export function useUpdateEmailMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateEmailMutation( + params: { + selection: { + fields: S & EmailSelect; + } & HookStrictSelect, EmailSelect>; + } & Omit< + UseMutationOptions< + { + updateEmail: { + email: InferSelectResult; + }; + }, + Error, + { + id: string; + emailPatch: EmailPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateEmail: { + email: InferSelectResult; + }; + }, + Error, + { + id: string; + emailPatch: EmailPatch; + } +>; +export function useUpdateEmailMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + emailPatch: EmailPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: emailMutationKeys.all, - mutationFn: ({ - id, - emailPatch - }: { - id: string; - emailPatch: EmailPatch; - }) => getClient().email.update({ - where: { - id - }, - data: emailPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, emailPatch }: { id: string; emailPatch: EmailPatch }) => + getClient() + .email.update({ + where: { + id, + }, + data: emailPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: emailKeys.detail(variables.id) + queryKey: emailKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: emailKeys.lists() + queryKey: emailKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePhoneNumberMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePhoneNumberMutation.ts index 0e8bfe1ae2..fa058b143b 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePhoneNumberMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePhoneNumberMutation.ts @@ -4,83 +4,107 @@ * 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 { phoneNumberKeys } from "../query-keys"; -import { phoneNumberMutationKeys } from "../mutation-keys"; -import type { PhoneNumberSelect, PhoneNumberWithRelations, PhoneNumberPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumberSelect, PhoneNumberWithRelations, PhoneNumberPatch } from "../../orm/input-types"; +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 { phoneNumberKeys } from '../query-keys'; +import { phoneNumberMutationKeys } from '../mutation-keys'; +import type { + PhoneNumberSelect, + PhoneNumberWithRelations, + PhoneNumberPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PhoneNumberSelect, + PhoneNumberWithRelations, + PhoneNumberPatch, +} from '../../orm/input-types'; /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePhoneNumberMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', phoneNumberPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePhoneNumberMutation(params: { - selection: ({ - fields: S & PhoneNumberSelect; - } & HookStrictSelect, PhoneNumberSelect>); -} & Omit; - }; -}, Error, { - id: string; - phoneNumberPatch: PhoneNumberPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePhoneNumber: { - phoneNumber: InferSelectResult; - }; -}, Error, { - id: string; - phoneNumberPatch: PhoneNumberPatch; -}>; -export function useUpdatePhoneNumberMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePhoneNumberMutation( + params: { + selection: { + fields: S & PhoneNumberSelect; + } & HookStrictSelect, PhoneNumberSelect>; + } & Omit< + UseMutationOptions< + { + updatePhoneNumber: { + phoneNumber: InferSelectResult; + }; + }, + Error, + { + id: string; + phoneNumberPatch: PhoneNumberPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePhoneNumber: { + phoneNumber: InferSelectResult; + }; + }, + Error, + { + id: string; + phoneNumberPatch: PhoneNumberPatch; + } +>; +export function useUpdatePhoneNumberMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + phoneNumberPatch: PhoneNumberPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: phoneNumberMutationKeys.all, - mutationFn: ({ - id, - phoneNumberPatch - }: { - id: string; - phoneNumberPatch: PhoneNumberPatch; - }) => getClient().phoneNumber.update({ - where: { - id - }, - data: phoneNumberPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, phoneNumberPatch }: { id: string; phoneNumberPatch: PhoneNumberPatch }) => + getClient() + .phoneNumber.update({ + where: { + id, + }, + data: phoneNumberPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: phoneNumberKeys.detail(variables.id) + queryKey: phoneNumberKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: phoneNumberKeys.lists() + queryKey: phoneNumberKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePrincipalEntityMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePrincipalEntityMutation.ts index eeb4341d9b..3c6e55c0a1 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePrincipalEntityMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePrincipalEntityMutation.ts @@ -4,83 +4,113 @@ * 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"; +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; - }; -}, Error, { - id: string; - principalEntityPatch: PrincipalEntityPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePrincipalEntity: { - principalEntity: InferSelectResult; - }; -}, Error, { - id: string; - principalEntityPatch: PrincipalEntityPatch; -}>; -export function useUpdatePrincipalEntityMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: principalEntityMutationKeys.all, mutationFn: ({ id, - principalEntityPatch + principalEntityPatch, }: { id: string; principalEntityPatch: PrincipalEntityPatch; - }) => getClient().principalEntity.update({ - where: { - id - }, - data: principalEntityPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .principalEntity.update({ + where: { + id, + }, + data: principalEntityPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: principalEntityKeys.detail(variables.id) + queryKey: principalEntityKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: principalEntityKeys.lists() + queryKey: principalEntityKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateRoleTypeMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateRoleTypeMutation.ts index 49179cac97..b25b4efcb1 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateRoleTypeMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateRoleTypeMutation.ts @@ -4,83 +4,99 @@ * 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 { roleTypeKeys } from "../query-keys"; -import { roleTypeMutationKeys } from "../mutation-keys"; -import type { RoleTypeSelect, RoleTypeWithRelations, RoleTypePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RoleTypeSelect, RoleTypeWithRelations, RoleTypePatch } from "../../orm/input-types"; +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 { roleTypeKeys } from '../query-keys'; +import { roleTypeMutationKeys } from '../mutation-keys'; +import type { RoleTypeSelect, RoleTypeWithRelations, RoleTypePatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RoleTypeSelect, RoleTypeWithRelations, RoleTypePatch } from '../../orm/input-types'; /** * Mutation hook for updating a RoleType - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRoleTypeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', roleTypePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRoleTypeMutation(params: { - selection: ({ - fields: S & RoleTypeSelect; - } & HookStrictSelect, RoleTypeSelect>); -} & Omit; - }; -}, Error, { - id: number; - roleTypePatch: RoleTypePatch; -}>, "mutationFn">): UseMutationResult<{ - updateRoleType: { - roleType: InferSelectResult; - }; -}, Error, { - id: number; - roleTypePatch: RoleTypePatch; -}>; -export function useUpdateRoleTypeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRoleTypeMutation( + params: { + selection: { + fields: S & RoleTypeSelect; + } & HookStrictSelect, RoleTypeSelect>; + } & Omit< + UseMutationOptions< + { + updateRoleType: { + roleType: InferSelectResult; + }; + }, + Error, + { + id: number; + roleTypePatch: RoleTypePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRoleType: { + roleType: InferSelectResult; + }; + }, + Error, + { + id: number; + roleTypePatch: RoleTypePatch; + } +>; +export function useUpdateRoleTypeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: number; + roleTypePatch: RoleTypePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: roleTypeMutationKeys.all, - mutationFn: ({ - id, - roleTypePatch - }: { - id: number; - roleTypePatch: RoleTypePatch; - }) => getClient().roleType.update({ - where: { - id - }, - data: roleTypePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, roleTypePatch }: { id: number; roleTypePatch: RoleTypePatch }) => + getClient() + .roleType.update({ + where: { + id, + }, + data: roleTypePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: roleTypeKeys.detail(variables.id) + queryKey: roleTypeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: roleTypeKeys.lists() + queryKey: roleTypeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateUserMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateUserMutation.ts index a775dc3473..d1ab025019 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateUserMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateUserMutation.ts @@ -4,83 +4,99 @@ * 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 { userKeys } from "../query-keys"; -import { userMutationKeys } from "../mutation-keys"; -import type { UserSelect, UserWithRelations, UserPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSelect, UserWithRelations, UserPatch } from "../../orm/input-types"; +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 { userKeys } from '../query-keys'; +import { userMutationKeys } from '../mutation-keys'; +import type { UserSelect, UserWithRelations, UserPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserSelect, UserWithRelations, UserPatch } from '../../orm/input-types'; /** * Mutation hook for updating a User - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateUserMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', userPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateUserMutation(params: { - selection: ({ - fields: S & UserSelect; - } & HookStrictSelect, UserSelect>); -} & Omit; - }; -}, Error, { - id: string; - userPatch: UserPatch; -}>, "mutationFn">): UseMutationResult<{ - updateUser: { - user: InferSelectResult; - }; -}, Error, { - id: string; - userPatch: UserPatch; -}>; -export function useUpdateUserMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateUserMutation( + params: { + selection: { + fields: S & UserSelect; + } & HookStrictSelect, UserSelect>; + } & Omit< + UseMutationOptions< + { + updateUser: { + user: InferSelectResult; + }; + }, + Error, + { + id: string; + userPatch: UserPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateUser: { + user: InferSelectResult; + }; + }, + Error, + { + id: string; + userPatch: UserPatch; + } +>; +export function useUpdateUserMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + userPatch: UserPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userMutationKeys.all, - mutationFn: ({ - id, - userPatch - }: { - id: string; - userPatch: UserPatch; - }) => getClient().user.update({ - where: { - id - }, - data: userPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, userPatch }: { id: string; userPatch: UserPatch }) => + getClient() + .user.update({ + where: { + id, + }, + data: userPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: userKeys.detail(variables.id) + queryKey: userKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userKeys.lists() + queryKey: userKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateWebauthnCredentialMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateWebauthnCredentialMutation.ts index b6e9efe6b3..1d92fd0787 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateWebauthnCredentialMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateWebauthnCredentialMutation.ts @@ -4,83 +4,113 @@ * 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 { webauthnCredentialKeys } from "../query-keys"; -import { webauthnCredentialMutationKeys } from "../mutation-keys"; -import type { WebauthnCredentialSelect, WebauthnCredentialWithRelations, WebauthnCredentialPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialSelect, WebauthnCredentialWithRelations, WebauthnCredentialPatch } from "../../orm/input-types"; +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 { webauthnCredentialKeys } from '../query-keys'; +import { webauthnCredentialMutationKeys } from '../mutation-keys'; +import type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, + WebauthnCredentialPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, + WebauthnCredentialPatch, +} from '../../orm/input-types'; /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateWebauthnCredentialMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', webauthnCredentialPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateWebauthnCredentialMutation(params: { - selection: ({ - fields: S & WebauthnCredentialSelect; - } & HookStrictSelect, WebauthnCredentialSelect>); -} & Omit; - }; -}, Error, { - id: string; - webauthnCredentialPatch: WebauthnCredentialPatch; -}>, "mutationFn">): UseMutationResult<{ - updateWebauthnCredential: { - webauthnCredential: InferSelectResult; - }; -}, Error, { - id: string; - webauthnCredentialPatch: WebauthnCredentialPatch; -}>; -export function useUpdateWebauthnCredentialMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateWebauthnCredentialMutation( + params: { + selection: { + fields: S & WebauthnCredentialSelect; + } & HookStrictSelect, WebauthnCredentialSelect>; + } & Omit< + UseMutationOptions< + { + updateWebauthnCredential: { + webauthnCredential: InferSelectResult; + }; + }, + Error, + { + id: string; + webauthnCredentialPatch: WebauthnCredentialPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateWebauthnCredential: { + webauthnCredential: InferSelectResult; + }; + }, + Error, + { + id: string; + webauthnCredentialPatch: WebauthnCredentialPatch; + } +>; +export function useUpdateWebauthnCredentialMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + webauthnCredentialPatch: WebauthnCredentialPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnCredentialMutationKeys.all, mutationFn: ({ id, - webauthnCredentialPatch + webauthnCredentialPatch, }: { id: string; webauthnCredentialPatch: WebauthnCredentialPatch; - }) => getClient().webauthnCredential.update({ - where: { - id - }, - data: webauthnCredentialPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .webauthnCredential.update({ + where: { + id, + }, + data: webauthnCredentialPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: webauthnCredentialKeys.detail(variables.id) + queryKey: webauthnCredentialKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webauthnCredentialKeys.lists() + queryKey: webauthnCredentialKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useVerifyEmailMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useVerifyEmailMutation.ts index 171904416e..6103a9bc14 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useVerifyEmailMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useVerifyEmailMutation.ts @@ -4,39 +4,52 @@ * 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 { VerifyEmailVariables } from "../../orm/mutation"; -import type { VerifyEmailPayloadSelect, VerifyEmailPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { VerifyEmailVariables } from "../../orm/mutation"; -export type { VerifyEmailPayloadSelect } from "../../orm/input-types"; -export function useVerifyEmailMutation(params: { - selection: ({ - fields: S & VerifyEmailPayloadSelect; - } & HookStrictSelect, VerifyEmailPayloadSelect>); -} & Omit | null; -}, Error, VerifyEmailVariables>, "mutationFn">): UseMutationResult<{ - verifyEmail: InferSelectResult | null; -}, Error, VerifyEmailVariables> { +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 { VerifyEmailVariables } from '../../orm/mutation'; +import type { VerifyEmailPayloadSelect, VerifyEmailPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { VerifyEmailVariables } from '../../orm/mutation'; +export type { VerifyEmailPayloadSelect } from '../../orm/input-types'; +export function useVerifyEmailMutation( + params: { + selection: { + fields: S & VerifyEmailPayloadSelect; + } & HookStrictSelect, VerifyEmailPayloadSelect>; + } & Omit< + UseMutationOptions< + { + verifyEmail: InferSelectResult | null; + }, + Error, + VerifyEmailVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + verifyEmail: InferSelectResult | null; + }, + Error, + VerifyEmailVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.verifyEmail(), - mutationFn: (variables: VerifyEmailVariables) => getClient().mutation.verifyEmail(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: VerifyEmailVariables) => + getClient() + .mutation.verifyEmail(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useVerifyPasswordMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useVerifyPasswordMutation.ts index 34229eeaba..0cd31b8f30 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useVerifyPasswordMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useVerifyPasswordMutation.ts @@ -4,39 +4,52 @@ * 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 { VerifyPasswordVariables } from "../../orm/mutation"; -import type { VerifyPasswordPayloadSelect, VerifyPasswordPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { VerifyPasswordVariables } from "../../orm/mutation"; -export type { VerifyPasswordPayloadSelect } from "../../orm/input-types"; -export function useVerifyPasswordMutation(params: { - selection: ({ - fields: S & VerifyPasswordPayloadSelect; - } & HookStrictSelect, VerifyPasswordPayloadSelect>); -} & Omit | null; -}, Error, VerifyPasswordVariables>, "mutationFn">): UseMutationResult<{ - verifyPassword: InferSelectResult | null; -}, Error, VerifyPasswordVariables> { +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 { VerifyPasswordVariables } from '../../orm/mutation'; +import type { VerifyPasswordPayloadSelect, VerifyPasswordPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { VerifyPasswordVariables } from '../../orm/mutation'; +export type { VerifyPasswordPayloadSelect } from '../../orm/input-types'; +export function useVerifyPasswordMutation( + params: { + selection: { + fields: S & VerifyPasswordPayloadSelect; + } & HookStrictSelect, VerifyPasswordPayloadSelect>; + } & Omit< + UseMutationOptions< + { + verifyPassword: InferSelectResult | null; + }, + Error, + VerifyPasswordVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + verifyPassword: InferSelectResult | null; + }, + Error, + VerifyPasswordVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.verifyPassword(), - mutationFn: (variables: VerifyPasswordVariables) => getClient().mutation.verifyPassword(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: VerifyPasswordVariables) => + getClient() + .mutation.verifyPassword(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useVerifyTotpMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useVerifyTotpMutation.ts index 9440a34326..418d599a71 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useVerifyTotpMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useVerifyTotpMutation.ts @@ -4,39 +4,52 @@ * 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 { VerifyTotpVariables } from "../../orm/mutation"; -import type { VerifyTotpPayloadSelect, VerifyTotpPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { VerifyTotpVariables } from "../../orm/mutation"; -export type { VerifyTotpPayloadSelect } from "../../orm/input-types"; -export function useVerifyTotpMutation(params: { - selection: ({ - fields: S & VerifyTotpPayloadSelect; - } & HookStrictSelect, VerifyTotpPayloadSelect>); -} & Omit | null; -}, Error, VerifyTotpVariables>, "mutationFn">): UseMutationResult<{ - verifyTotp: InferSelectResult | null; -}, Error, VerifyTotpVariables> { +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 { VerifyTotpVariables } from '../../orm/mutation'; +import type { VerifyTotpPayloadSelect, VerifyTotpPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { VerifyTotpVariables } from '../../orm/mutation'; +export type { VerifyTotpPayloadSelect } from '../../orm/input-types'; +export function useVerifyTotpMutation( + params: { + selection: { + fields: S & VerifyTotpPayloadSelect; + } & HookStrictSelect, VerifyTotpPayloadSelect>; + } & Omit< + UseMutationOptions< + { + verifyTotp: InferSelectResult | null; + }, + Error, + VerifyTotpVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + verifyTotp: InferSelectResult | null; + }, + Error, + VerifyTotpVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.verifyTotp(), - mutationFn: (variables: VerifyTotpVariables) => getClient().mutation.verifyTotp(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: VerifyTotpVariables) => + getClient() + .mutation.verifyTotp(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/index.ts b/sdk/constructive-react/src/auth/hooks/queries/index.ts index 14ce13ebc1..c08fb4d08d 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/index.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/index.ts @@ -3,33 +3,33 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useAuditLogAuthsQuery"; -export * from "./useAuditLogAuthQuery"; -export * from "./useCryptoAddressesQuery"; -export * from "./useCryptoAddressQuery"; -export * from "./useEmailsQuery"; -export * from "./useEmailQuery"; -export * from "./useIdentityProvidersQuery"; -export * from "./useOrgApiKeyListsQuery"; -export * from "./useOrgApiKeyListQuery"; -export * from "./usePhoneNumbersQuery"; -export * from "./usePhoneNumberQuery"; -export * from "./usePrincipalsQuery"; -export * from "./usePrincipalQuery"; -export * from "./usePrincipalEntitiesQuery"; -export * from "./usePrincipalEntityQuery"; -export * from "./usePrincipalScopeOverridesQuery"; -export * from "./usePrincipalScopeOverrideQuery"; -export * from "./useRoleTypesQuery"; -export * from "./useRoleTypeQuery"; -export * from "./useUserConnectedAccountsQuery"; -export * from "./useUserConnectedAccountQuery"; -export * from "./useUsersQuery"; -export * from "./useUserQuery"; -export * from "./useWebauthnCredentialsQuery"; -export * from "./useWebauthnCredentialQuery"; -export * from "./useCurrentIpAddressQuery"; -export * from "./useCurrentUserQuery"; -export * from "./useCurrentUserAgentQuery"; -export * from "./useCurrentUserIdQuery"; -export * from "./useRequireStepUpQuery"; \ No newline at end of file +export * from './useAuditLogAuthsQuery'; +export * from './useAuditLogAuthQuery'; +export * from './useCryptoAddressesQuery'; +export * from './useCryptoAddressQuery'; +export * from './useEmailsQuery'; +export * from './useEmailQuery'; +export * from './useIdentityProvidersQuery'; +export * from './useOrgApiKeyListsQuery'; +export * from './useOrgApiKeyListQuery'; +export * from './usePhoneNumbersQuery'; +export * from './usePhoneNumberQuery'; +export * from './usePrincipalsQuery'; +export * from './usePrincipalQuery'; +export * from './usePrincipalEntitiesQuery'; +export * from './usePrincipalEntityQuery'; +export * from './usePrincipalScopeOverridesQuery'; +export * from './usePrincipalScopeOverrideQuery'; +export * from './useRoleTypesQuery'; +export * from './useRoleTypeQuery'; +export * from './useUserConnectedAccountsQuery'; +export * from './useUserConnectedAccountQuery'; +export * from './useUsersQuery'; +export * from './useUserQuery'; +export * from './useWebauthnCredentialsQuery'; +export * from './useWebauthnCredentialQuery'; +export * from './useCurrentIpAddressQuery'; +export * from './useCurrentUserQuery'; +export * from './useCurrentUserAgentQuery'; +export * from './useCurrentUserIdQuery'; +export * from './useRequireStepUpQuery'; diff --git a/sdk/constructive-react/src/auth/hooks/queries/useAuditLogAuthQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useAuditLogAuthQuery.ts index 53a7ea90ec..e8f8622549 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useAuditLogAuthQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useAuditLogAuthQuery.ts @@ -4,20 +4,20 @@ * 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 { auditLogAuthKeys } from "../query-keys"; -import type { AuditLogAuthSelect, AuditLogAuthWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AuditLogAuthSelect, AuditLogAuthWithRelations } from "../../orm/input-types"; +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 { auditLogAuthKeys } from '../query-keys'; +import type { AuditLogAuthSelect, AuditLogAuthWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AuditLogAuthSelect, AuditLogAuthWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const auditLogAuthQueryKey = auditLogAuthKeys.detail; /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```tsx * const { data, isLoading } = useAuditLogAuthQuery({ @@ -26,38 +26,52 @@ export const auditLogAuthQueryKey = auditLogAuthKeys.detail; * }); * ``` */ -export function useAuditLogAuthQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AuditLogAuthSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAuditLogAuthQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAuditLogAuthQuery< + S extends AuditLogAuthSelect, + TData = { + auditLogAuth: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AuditLogAuthSelect>; + } & Omit< + UseQueryOptions< + { + auditLogAuth: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAuditLogAuthQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: auditLogAuthKeys.detail(params.id), - queryFn: () => getClient().auditLogAuth.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .auditLogAuth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```ts * const data = await fetchAuditLogAuthQuery({ @@ -79,35 +93,46 @@ export async function fetchAuditLogAuthQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().auditLogAuth.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .auditLogAuth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```ts * await prefetchAuditLogAuthQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAuditLogAuthQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AuditLogAuthSelect>; -}): Promise; -export async function prefetchAuditLogAuthQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAuditLogAuthQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AuditLogAuthSelect>; + } +): Promise; +export async function prefetchAuditLogAuthQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: auditLogAuthKeys.detail(params.id), - queryFn: () => getClient().auditLogAuth.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .auditLogAuth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useAuditLogAuthsQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useAuditLogAuthsQuery.ts index 17dada0c6e..ecd351deba 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useAuditLogAuthsQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useAuditLogAuthsQuery.ts @@ -4,20 +4,35 @@ * 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 { auditLogAuthKeys } from "../query-keys"; -import type { AuditLogAuthSelect, AuditLogAuthWithRelations, AuditLogAuthFilter, AuditLogAuthOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AuditLogAuthSelect, AuditLogAuthWithRelations, AuditLogAuthFilter, AuditLogAuthOrderBy } from "../../orm/input-types"; +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 { auditLogAuthKeys } from '../query-keys'; +import type { + AuditLogAuthSelect, + AuditLogAuthWithRelations, + AuditLogAuthFilter, + AuditLogAuthOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AuditLogAuthSelect, + AuditLogAuthWithRelations, + AuditLogAuthFilter, + AuditLogAuthOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const auditLogAuthsQueryKey = auditLogAuthKeys.list; /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```tsx * const { data, isLoading } = useAuditLogAuthsQuery({ @@ -30,33 +45,47 @@ export const auditLogAuthsQueryKey = auditLogAuthKeys.list; * }); * ``` */ -export function useAuditLogAuthsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AuditLogAuthSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAuditLogAuthsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAuditLogAuthsQuery< + S extends AuditLogAuthSelect, + TData = { + auditLogAuths: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AuditLogAuthSelect>; + } & Omit< + UseQueryOptions< + { + auditLogAuths: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAuditLogAuthsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: auditLogAuthKeys.list(args), queryFn: () => getClient().auditLogAuth.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```ts * const data = await fetchAuditLogAuthsQuery({ @@ -70,35 +99,47 @@ export function useAuditLogAuthsQuery(params: { export async function fetchAuditLogAuthsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AuditLogAuthSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AuditLogAuthSelect>; }): Promise<{ auditLogAuths: ConnectionResult>; }>; export async function fetchAuditLogAuthsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().auditLogAuth.findMany(args).unwrap(); } /** * Partitioned append-only audit log of authentication events (sign-in, sign-up, password changes, etc.) - * + * * @example * ```ts * await prefetchAuditLogAuthsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAuditLogAuthsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AuditLogAuthSelect>; -}): Promise; -export async function prefetchAuditLogAuthsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAuditLogAuthsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AuditLogAuthSelect>; + } +): Promise; +export async function prefetchAuditLogAuthsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: auditLogAuthKeys.list(args), - queryFn: () => getClient().auditLogAuth.findMany(args).unwrap() + queryFn: () => getClient().auditLogAuth.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useCryptoAddressQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useCryptoAddressQuery.ts index 31e345f3b2..71147292e5 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useCryptoAddressQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useCryptoAddressQuery.ts @@ -4,20 +4,20 @@ * 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 { cryptoAddressKeys } from "../query-keys"; -import type { CryptoAddressSelect, CryptoAddressWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressSelect, CryptoAddressWithRelations } from "../../orm/input-types"; +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 { cryptoAddressKeys } from '../query-keys'; +import type { CryptoAddressSelect, CryptoAddressWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CryptoAddressSelect, CryptoAddressWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const cryptoAddressQueryKey = cryptoAddressKeys.detail; /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```tsx * const { data, isLoading } = useCryptoAddressQuery({ @@ -26,38 +26,52 @@ export const cryptoAddressQueryKey = cryptoAddressKeys.detail; * }); * ``` */ -export function useCryptoAddressQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CryptoAddressSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCryptoAddressQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCryptoAddressQuery< + S extends CryptoAddressSelect, + TData = { + cryptoAddress: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CryptoAddressSelect>; + } & Omit< + UseQueryOptions< + { + cryptoAddress: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCryptoAddressQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: cryptoAddressKeys.detail(params.id), - queryFn: () => getClient().cryptoAddress.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .cryptoAddress.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```ts * const data = await fetchCryptoAddressQuery({ @@ -79,35 +93,46 @@ export async function fetchCryptoAddressQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().cryptoAddress.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .cryptoAddress.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```ts * await prefetchCryptoAddressQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCryptoAddressQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CryptoAddressSelect>; -}): Promise; -export async function prefetchCryptoAddressQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchCryptoAddressQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CryptoAddressSelect>; + } +): Promise; +export async function prefetchCryptoAddressQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: cryptoAddressKeys.detail(params.id), - queryFn: () => getClient().cryptoAddress.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .cryptoAddress.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useCryptoAddressesQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useCryptoAddressesQuery.ts index d60c56a481..ffb35cc205 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useCryptoAddressesQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useCryptoAddressesQuery.ts @@ -4,20 +4,35 @@ * 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 { cryptoAddressKeys } from "../query-keys"; -import type { CryptoAddressSelect, CryptoAddressWithRelations, CryptoAddressFilter, CryptoAddressOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressSelect, CryptoAddressWithRelations, CryptoAddressFilter, CryptoAddressOrderBy } from "../../orm/input-types"; +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 { cryptoAddressKeys } from '../query-keys'; +import type { + CryptoAddressSelect, + CryptoAddressWithRelations, + CryptoAddressFilter, + CryptoAddressOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + CryptoAddressSelect, + CryptoAddressWithRelations, + CryptoAddressFilter, + CryptoAddressOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const cryptoAddressesQueryKey = cryptoAddressKeys.list; /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```tsx * const { data, isLoading } = useCryptoAddressesQuery({ @@ -30,33 +45,49 @@ export const cryptoAddressesQueryKey = cryptoAddressKeys.list; * }); * ``` */ -export function useCryptoAddressesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAddressSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCryptoAddressesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useCryptoAddressesQuery< + S extends CryptoAddressSelect, + TData = { + cryptoAddresses: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CryptoAddressSelect>; + } & Omit< + UseQueryOptions< + { + cryptoAddresses: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCryptoAddressesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + CryptoAddressSelect, + CryptoAddressFilter, + CryptoAddressOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: cryptoAddressKeys.list(args), queryFn: () => getClient().cryptoAddress.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```ts * const data = await fetchCryptoAddressesQuery({ @@ -70,35 +101,51 @@ export function useCryptoAddressesQuery(params: { export async function fetchCryptoAddressesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAddressSelect>; + } & Omit, 'fields'> & + HookStrictSelect, CryptoAddressSelect>; }): Promise<{ cryptoAddresses: ConnectionResult>; }>; export async function fetchCryptoAddressesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + CryptoAddressSelect, + CryptoAddressFilter, + CryptoAddressOrderBy + >(params.selection); return getClient().cryptoAddress.findMany(args).unwrap(); } /** * Cryptocurrency wallet addresses owned by users, with network-specific validation and verification - * + * * @example * ```ts * await prefetchCryptoAddressesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchCryptoAddressesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAddressSelect>; -}): Promise; -export async function prefetchCryptoAddressesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchCryptoAddressesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CryptoAddressSelect>; + } +): Promise; +export async function prefetchCryptoAddressesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + CryptoAddressSelect, + CryptoAddressFilter, + CryptoAddressOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: cryptoAddressKeys.list(args), - queryFn: () => getClient().cryptoAddress.findMany(args).unwrap() + queryFn: () => getClient().cryptoAddress.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useCurrentIpAddressQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useCurrentIpAddressQuery.ts index 7e5aad96dd..525306e3b5 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useCurrentIpAddressQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useCurrentIpAddressQuery.ts @@ -4,46 +4,68 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; /** Query key factory - re-exported from query-keys.ts */ export const currentIpAddressQueryKey = customQueryKeys.currentIpAddress; /** * Query hook for currentIpAddress - * + * * @example * ```tsx * const { data, isLoading } = useCurrentIpAddressQuery(); - * + * * if (data?.currentIpAddress) { * console.log(data.currentIpAddress); * } * ``` */ -export function useCurrentIpAddressQuery(params?: Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useCurrentIpAddressQuery(params?: Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useCurrentIpAddressQuery< + TData = { + currentIpAddress: string | null; + }, +>( + params?: Omit< + UseQueryOptions< + { + currentIpAddress: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCurrentIpAddressQuery< + TData = { + currentIpAddress: string | null; + }, +>( + params?: Omit< + UseQueryOptions< + { + currentIpAddress: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const queryOptions = params ?? {}; return useQuery({ queryKey: currentIpAddressQueryKey(), queryFn: () => getClient().query.currentIpAddress().unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch currentIpAddress without React hooks - * + * * @example * ```ts * const data = await fetchCurrentIpAddressQuery(); @@ -54,7 +76,7 @@ export async function fetchCurrentIpAddressQuery() { } /** * Prefetch currentIpAddress for SSR or cache warming - * + * * @example * ```ts * await prefetchCurrentIpAddressQuery(queryClient); @@ -63,6 +85,6 @@ export async function fetchCurrentIpAddressQuery() { export async function prefetchCurrentIpAddressQuery(queryClient: QueryClient): Promise { await queryClient.prefetchQuery({ queryKey: currentIpAddressQueryKey(), - queryFn: () => getClient().query.currentIpAddress().unwrap() + queryFn: () => getClient().query.currentIpAddress().unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserAgentQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserAgentQuery.ts index c888c821c9..5a9c544d9f 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserAgentQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserAgentQuery.ts @@ -4,46 +4,68 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; /** Query key factory - re-exported from query-keys.ts */ export const currentUserAgentQueryKey = customQueryKeys.currentUserAgent; /** * Query hook for currentUserAgent - * + * * @example * ```tsx * const { data, isLoading } = useCurrentUserAgentQuery(); - * + * * if (data?.currentUserAgent) { * console.log(data.currentUserAgent); * } * ``` */ -export function useCurrentUserAgentQuery(params?: Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useCurrentUserAgentQuery(params?: Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useCurrentUserAgentQuery< + TData = { + currentUserAgent: string | null; + }, +>( + params?: Omit< + UseQueryOptions< + { + currentUserAgent: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCurrentUserAgentQuery< + TData = { + currentUserAgent: string | null; + }, +>( + params?: Omit< + UseQueryOptions< + { + currentUserAgent: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const queryOptions = params ?? {}; return useQuery({ queryKey: currentUserAgentQueryKey(), queryFn: () => getClient().query.currentUserAgent().unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch currentUserAgent without React hooks - * + * * @example * ```ts * const data = await fetchCurrentUserAgentQuery(); @@ -54,7 +76,7 @@ export async function fetchCurrentUserAgentQuery() { } /** * Prefetch currentUserAgent for SSR or cache warming - * + * * @example * ```ts * await prefetchCurrentUserAgentQuery(queryClient); @@ -63,6 +85,6 @@ export async function fetchCurrentUserAgentQuery() { export async function prefetchCurrentUserAgentQuery(queryClient: QueryClient): Promise { await queryClient.prefetchQuery({ queryKey: currentUserAgentQueryKey(), - queryFn: () => getClient().query.currentUserAgent().unwrap() + queryFn: () => getClient().query.currentUserAgent().unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserIdQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserIdQuery.ts index f1d0e844e0..5f65326cc9 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserIdQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserIdQuery.ts @@ -4,46 +4,68 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; /** Query key factory - re-exported from query-keys.ts */ export const currentUserIdQueryKey = customQueryKeys.currentUserId; /** * Query hook for currentUserId - * + * * @example * ```tsx * const { data, isLoading } = useCurrentUserIdQuery(); - * + * * if (data?.currentUserId) { * console.log(data.currentUserId); * } * ``` */ -export function useCurrentUserIdQuery(params?: Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useCurrentUserIdQuery(params?: Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useCurrentUserIdQuery< + TData = { + currentUserId: string | null; + }, +>( + params?: Omit< + UseQueryOptions< + { + currentUserId: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCurrentUserIdQuery< + TData = { + currentUserId: string | null; + }, +>( + params?: Omit< + UseQueryOptions< + { + currentUserId: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const queryOptions = params ?? {}; return useQuery({ queryKey: currentUserIdQueryKey(), queryFn: () => getClient().query.currentUserId().unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch currentUserId without React hooks - * + * * @example * ```ts * const data = await fetchCurrentUserIdQuery(); @@ -54,7 +76,7 @@ export async function fetchCurrentUserIdQuery() { } /** * Prefetch currentUserId for SSR or cache warming - * + * * @example * ```ts * await prefetchCurrentUserIdQuery(queryClient); @@ -63,6 +85,6 @@ export async function fetchCurrentUserIdQuery() { export async function prefetchCurrentUserIdQuery(queryClient: QueryClient): Promise { await queryClient.prefetchQuery({ queryKey: currentUserIdQueryKey(), - queryFn: () => getClient().query.currentUserId().unwrap() + queryFn: () => getClient().query.currentUserId().unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserQuery.ts index 00ceea9ff7..0bc463f039 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useCurrentUserQuery.ts @@ -4,99 +4,122 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { UserSelect, User } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSelect } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { UserSelect, User } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserSelect } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const currentUserQueryKey = customQueryKeys.currentUser; /** * Query hook for currentUser - * + * * @example * ```tsx * const { data, isLoading } = useCurrentUserQuery({ selection: { fields: { id: true } } }); - * + * * if (data?.currentUser) { * console.log(data.currentUser); * } * ``` */ -export function useCurrentUserQuery | null; -}>(params: { - selection: ({ - fields: S & UserSelect; - } & HookStrictSelect, UserSelect>); -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCurrentUserQuery(params: { - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCurrentUserQuery< + S extends UserSelect, + TData = { + currentUser: InferSelectResult | null; + }, +>( + params: { + selection: { + fields: S & UserSelect; + } & HookStrictSelect, UserSelect>; + } & Omit< + UseQueryOptions< + { + currentUser: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCurrentUserQuery( + params: { + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: currentUserQueryKey(), - queryFn: () => getClient().query.currentUser({ - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .query.currentUser({ + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch currentUser without React hooks - * + * * @example * ```ts * const data = await fetchCurrentUserQuery({ selection: { fields: { id: true } } }); * ``` */ export async function fetchCurrentUserQuery(params: { - selection: ({ + selection: { fields: S & UserSelect; - } & HookStrictSelect, UserSelect>); + } & HookStrictSelect, UserSelect>; }): Promise<{ currentUser: InferSelectResult | null; }>; -export async function fetchCurrentUserQuery(params: { - selection: SelectionConfig; -}) { +export async function fetchCurrentUserQuery(params: { selection: SelectionConfig }) { const args = buildSelectionArgs(params.selection); - return getClient().query.currentUser({ - select: args.select - }).unwrap(); + return getClient() + .query.currentUser({ + select: args.select, + }) + .unwrap(); } /** * Prefetch currentUser for SSR or cache warming - * + * * @example * ```ts * await prefetchCurrentUserQuery(queryClient, { selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCurrentUserQuery(queryClient: QueryClient, params: { - selection: ({ - fields: S & UserSelect; - } & HookStrictSelect, UserSelect>); -}): Promise; -export async function prefetchCurrentUserQuery(queryClient: QueryClient, params: { - selection: SelectionConfig; -}): Promise { +export async function prefetchCurrentUserQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S & UserSelect; + } & HookStrictSelect, UserSelect>; + } +): Promise; +export async function prefetchCurrentUserQuery( + queryClient: QueryClient, + params: { + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: currentUserQueryKey(), - queryFn: () => getClient().query.currentUser({ - select: args.select - }).unwrap() + queryFn: () => + getClient() + .query.currentUser({ + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useEmailQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useEmailQuery.ts index e59f29f561..8b2b353346 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useEmailQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useEmailQuery.ts @@ -4,20 +4,20 @@ * 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 { emailKeys } from "../query-keys"; -import type { EmailSelect, EmailWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailSelect, EmailWithRelations } from "../../orm/input-types"; +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 { emailKeys } from '../query-keys'; +import type { EmailSelect, EmailWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EmailSelect, EmailWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const emailQueryKey = emailKeys.detail; /** * User email addresses with verification and primary-email management - * + * * @example * ```tsx * const { data, isLoading } = useEmailQuery({ @@ -26,38 +26,52 @@ export const emailQueryKey = emailKeys.detail; * }); * ``` */ -export function useEmailQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EmailSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEmailQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useEmailQuery< + S extends EmailSelect, + TData = { + email: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EmailSelect>; + } & Omit< + UseQueryOptions< + { + email: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEmailQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: emailKeys.detail(params.id), - queryFn: () => getClient().email.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .email.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * User email addresses with verification and primary-email management - * + * * @example * ```ts * const data = await fetchEmailQuery({ @@ -79,35 +93,46 @@ export async function fetchEmailQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().email.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .email.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * User email addresses with verification and primary-email management - * + * * @example * ```ts * await prefetchEmailQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchEmailQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EmailSelect>; -}): Promise; -export async function prefetchEmailQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchEmailQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EmailSelect>; + } +): Promise; +export async function prefetchEmailQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: emailKeys.detail(params.id), - queryFn: () => getClient().email.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .email.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useEmailsQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useEmailsQuery.ts index f61af320c9..44aa1f0ce3 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useEmailsQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useEmailsQuery.ts @@ -4,20 +4,35 @@ * 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 { emailKeys } from "../query-keys"; -import type { EmailSelect, EmailWithRelations, EmailFilter, EmailOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailSelect, EmailWithRelations, EmailFilter, EmailOrderBy } from "../../orm/input-types"; +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 { emailKeys } from '../query-keys'; +import type { + EmailSelect, + EmailWithRelations, + EmailFilter, + EmailOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + EmailSelect, + EmailWithRelations, + EmailFilter, + EmailOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const emailsQueryKey = emailKeys.list; /** * User email addresses with verification and primary-email management - * + * * @example * ```tsx * const { data, isLoading } = useEmailsQuery({ @@ -30,33 +45,45 @@ export const emailsQueryKey = emailKeys.list; * }); * ``` */ -export function useEmailsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EmailSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEmailsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useEmailsQuery< + S extends EmailSelect, + TData = { + emails: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EmailSelect>; + } & Omit< + UseQueryOptions< + { + emails: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEmailsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: emailKeys.list(args), queryFn: () => getClient().email.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * User email addresses with verification and primary-email management - * + * * @example * ```ts * const data = await fetchEmailsQuery({ @@ -70,7 +97,8 @@ export function useEmailsQuery(params: { export async function fetchEmailsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, EmailSelect>; + } & Omit, 'fields'> & + HookStrictSelect, EmailSelect>; }): Promise<{ emails: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchEmailsQuery(params: { } /** * User email addresses with verification and primary-email management - * + * * @example * ```ts * await prefetchEmailsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchEmailsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EmailSelect>; -}): Promise; -export async function prefetchEmailsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchEmailsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EmailSelect>; + } +): Promise; +export async function prefetchEmailsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: emailKeys.list(args), - queryFn: () => getClient().email.findMany(args).unwrap() + queryFn: () => getClient().email.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useIdentityProvidersQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useIdentityProvidersQuery.ts index 2530f6cf83..a7dc247aaa 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useIdentityProvidersQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useIdentityProvidersQuery.ts @@ -4,20 +4,35 @@ * 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 { identityProviderKeys } from "../query-keys"; -import type { IdentityProviderSelect, IdentityProviderWithRelations, IdentityProviderFilter, IdentityProviderOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { IdentityProviderSelect, IdentityProviderWithRelations, IdentityProviderFilter, IdentityProviderOrderBy } from "../../orm/input-types"; +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 { identityProviderKeys } from '../query-keys'; +import type { + IdentityProviderSelect, + IdentityProviderWithRelations, + IdentityProviderFilter, + IdentityProviderOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + IdentityProviderSelect, + IdentityProviderWithRelations, + IdentityProviderFilter, + IdentityProviderOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const identityProvidersQueryKey = identityProviderKeys.list; /** * Query hook for fetching IdentityProvider list - * + * * @example * ```tsx * const { data, isLoading } = useIdentityProvidersQuery({ @@ -30,33 +45,53 @@ export const identityProvidersQueryKey = identityProviderKeys.list; * }); * ``` */ -export function useIdentityProvidersQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IdentityProviderSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIdentityProvidersQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useIdentityProvidersQuery< + S extends IdentityProviderSelect, + TData = { + identityProviders: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, IdentityProviderSelect>; + } & Omit< + UseQueryOptions< + { + identityProviders: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIdentityProvidersQuery( + params: { + selection: ListSelectionConfig< + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: identityProviderKeys.list(args), queryFn: () => getClient().identityProvider.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch IdentityProvider list without React hooks - * + * * @example * ```ts * const data = await fetchIdentityProvidersQuery({ @@ -70,35 +105,59 @@ export function useIdentityProvidersQuery(params: { export async function fetchIdentityProvidersQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, IdentityProviderSelect>; + } & Omit, 'fields'> & + HookStrictSelect, IdentityProviderSelect>; }): Promise<{ identityProviders: ConnectionResult>; }>; export async function fetchIdentityProvidersQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy + >(params.selection); return getClient().identityProvider.findMany(args).unwrap(); } /** * Prefetch IdentityProvider list for SSR or cache warming - * + * * @example * ```ts * await prefetchIdentityProvidersQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchIdentityProvidersQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IdentityProviderSelect>; -}): Promise; -export async function prefetchIdentityProvidersQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchIdentityProvidersQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, IdentityProviderSelect>; + } +): Promise; +export async function prefetchIdentityProvidersQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: identityProviderKeys.list(args), - queryFn: () => getClient().identityProvider.findMany(args).unwrap() + queryFn: () => getClient().identityProvider.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListQuery.ts index ef97597319..77ac426fde 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListQuery.ts @@ -4,20 +4,20 @@ * 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"; +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({ @@ -26,38 +26,52 @@ export const orgApiKeyListQueryKey = orgApiKeyListKeys.detail; * }); * ``` */ -export function useOrgApiKeyListQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgApiKeyListSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgApiKeyListQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +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 ?? {}; + 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 + 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({ @@ -79,35 +93,46 @@ export async function fetchOrgApiKeyListQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgApiKeyList.findOne({ - id: params.id, - select: args.select - }).unwrap(); + 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 { +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() + 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 index cb882f3744..3657e56ab4 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListsQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListsQuery.ts @@ -4,20 +4,35 @@ * 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"; +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({ @@ -30,33 +45,49 @@ export const orgApiKeyListsQueryKey = orgApiKeyListKeys.list; * }); * ``` */ -export function useOrgApiKeyListsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgApiKeyListSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgApiKeyListsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +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 + ...queryOptions, }); } /** * Fetch OrgApiKeyList list without React hooks - * + * * @example * ```ts * const data = await fetchOrgApiKeyListsQuery({ @@ -70,35 +101,51 @@ export function useOrgApiKeyListsQuery(params: { export async function fetchOrgApiKeyListsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgApiKeyListSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgApiKeyListSelect>; }): Promise<{ orgApiKeyLists: ConnectionResult>; }>; export async function fetchOrgApiKeyListsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + 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(params.selection); +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() + queryFn: () => getClient().orgApiKeyList.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/usePhoneNumberQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/usePhoneNumberQuery.ts index c0d53b3ad2..5e71658d7c 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/usePhoneNumberQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/usePhoneNumberQuery.ts @@ -4,20 +4,20 @@ * 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 { phoneNumberKeys } from "../query-keys"; -import type { PhoneNumberSelect, PhoneNumberWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumberSelect, PhoneNumberWithRelations } from "../../orm/input-types"; +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 { phoneNumberKeys } from '../query-keys'; +import type { PhoneNumberSelect, PhoneNumberWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PhoneNumberSelect, PhoneNumberWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const phoneNumberQueryKey = phoneNumberKeys.detail; /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```tsx * const { data, isLoading } = usePhoneNumberQuery({ @@ -26,38 +26,52 @@ export const phoneNumberQueryKey = phoneNumberKeys.detail; * }); * ``` */ -export function usePhoneNumberQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PhoneNumberSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePhoneNumberQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePhoneNumberQuery< + S extends PhoneNumberSelect, + TData = { + phoneNumber: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PhoneNumberSelect>; + } & Omit< + UseQueryOptions< + { + phoneNumber: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePhoneNumberQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: phoneNumberKeys.detail(params.id), - queryFn: () => getClient().phoneNumber.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .phoneNumber.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```ts * const data = await fetchPhoneNumberQuery({ @@ -79,35 +93,46 @@ export async function fetchPhoneNumberQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().phoneNumber.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .phoneNumber.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```ts * await prefetchPhoneNumberQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPhoneNumberQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PhoneNumberSelect>; -}): Promise; -export async function prefetchPhoneNumberQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPhoneNumberQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PhoneNumberSelect>; + } +): Promise; +export async function prefetchPhoneNumberQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: phoneNumberKeys.detail(params.id), - queryFn: () => getClient().phoneNumber.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .phoneNumber.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/usePhoneNumbersQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/usePhoneNumbersQuery.ts index d609d02231..1811e4e8f6 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/usePhoneNumbersQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/usePhoneNumbersQuery.ts @@ -4,20 +4,35 @@ * 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 { phoneNumberKeys } from "../query-keys"; -import type { PhoneNumberSelect, PhoneNumberWithRelations, PhoneNumberFilter, PhoneNumberOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumberSelect, PhoneNumberWithRelations, PhoneNumberFilter, PhoneNumberOrderBy } from "../../orm/input-types"; +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 { phoneNumberKeys } from '../query-keys'; +import type { + PhoneNumberSelect, + PhoneNumberWithRelations, + PhoneNumberFilter, + PhoneNumberOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PhoneNumberSelect, + PhoneNumberWithRelations, + PhoneNumberFilter, + PhoneNumberOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const phoneNumbersQueryKey = phoneNumberKeys.list; /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```tsx * const { data, isLoading } = usePhoneNumbersQuery({ @@ -30,33 +45,47 @@ export const phoneNumbersQueryKey = phoneNumberKeys.list; * }); * ``` */ -export function usePhoneNumbersQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PhoneNumberSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePhoneNumbersQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePhoneNumbersQuery< + S extends PhoneNumberSelect, + TData = { + phoneNumbers: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PhoneNumberSelect>; + } & Omit< + UseQueryOptions< + { + phoneNumbers: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePhoneNumbersQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: phoneNumberKeys.list(args), queryFn: () => getClient().phoneNumber.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```ts * const data = await fetchPhoneNumbersQuery({ @@ -70,35 +99,47 @@ export function usePhoneNumbersQuery(params: { export async function fetchPhoneNumbersQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PhoneNumberSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PhoneNumberSelect>; }): Promise<{ phoneNumbers: ConnectionResult>; }>; export async function fetchPhoneNumbersQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().phoneNumber.findMany(args).unwrap(); } /** * User phone numbers with country code, verification, and primary-number management - * + * * @example * ```ts * await prefetchPhoneNumbersQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPhoneNumbersQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PhoneNumberSelect>; -}): Promise; -export async function prefetchPhoneNumbersQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPhoneNumbersQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PhoneNumberSelect>; + } +): Promise; +export async function prefetchPhoneNumbersQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: phoneNumberKeys.list(args), - queryFn: () => getClient().phoneNumber.findMany(args).unwrap() + queryFn: () => getClient().phoneNumber.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 index db2f6da26e..0b56b03bcf 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntitiesQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntitiesQuery.ts @@ -4,20 +4,35 @@ * 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"; +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({ @@ -30,33 +45,53 @@ export const principalEntitiesQueryKey = principalEntityKeys.list; * }); * ``` */ -export function usePrincipalEntitiesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PrincipalEntitySelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrincipalEntitiesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +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 + ...queryOptions, }); } /** * Association table scoping principals to specific organizations - * + * * @example * ```ts * const data = await fetchPrincipalEntitiesQuery({ @@ -70,35 +105,59 @@ export function usePrincipalEntitiesQuery(params: { export async function fetchPrincipalEntitiesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PrincipalEntitySelect>; + } & Omit, 'fields'> & + HookStrictSelect, PrincipalEntitySelect>; }): Promise<{ principalEntities: ConnectionResult>; }>; export async function fetchPrincipalEntitiesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + 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; -}): Promise { - const args = buildListSelectionArgs(params.selection); +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() + 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 index 73d796576c..dac8ed3dce 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntityQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntityQuery.ts @@ -4,20 +4,20 @@ * 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"; +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({ @@ -26,38 +26,52 @@ export const principalEntityQueryKey = principalEntityKeys.detail; * }); * ``` */ -export function usePrincipalEntityQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PrincipalEntitySelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrincipalEntityQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +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 ?? {}; + 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 + 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({ @@ -79,35 +93,46 @@ export async function fetchPrincipalEntityQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().principalEntity.findOne({ - id: params.id, - select: args.select - }).unwrap(); + 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 { +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() + 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 index 9d368afd02..14b3d0a9d2 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalQuery.ts @@ -4,20 +4,20 @@ * 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"; +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({ @@ -26,38 +26,52 @@ export const principalQueryKey = principalKeys.detail; * }); * ``` */ -export function usePrincipalQuery | null; -}>(params: { - principalId: string; - selection: { - fields: S; - } & HookStrictSelect, PrincipalSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrincipalQuery(params: { - principalId: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +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 ?? {}; + 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 + 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({ @@ -79,35 +93,46 @@ export async function fetchPrincipalQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().principal.findOne({ - principalId: params.principalId, - select: args.select - }).unwrap(); + 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 { +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() + 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 index d6efbc13d0..9930844113 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverrideQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverrideQuery.ts @@ -4,20 +4,26 @@ * 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"; +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({ @@ -26,38 +32,52 @@ export const principalScopeOverrideQueryKey = principalScopeOverrideKeys.detail; * }); * ``` */ -export function usePrincipalScopeOverrideQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PrincipalScopeOverrideSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrincipalScopeOverrideQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +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 ?? {}; + 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 + 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({ @@ -66,7 +86,9 @@ export function usePrincipalScopeOverrideQuery(params: { * }); * ``` */ -export async function fetchPrincipalScopeOverrideQuery(params: { +export async function fetchPrincipalScopeOverrideQuery< + S extends PrincipalScopeOverrideSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPrincipalScopeOverrideQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().principalScopeOverride.findOne({ - id: params.id, - select: args.select - }).unwrap(); + 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 { +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() + 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 index fb7696bae0..521c5fdee6 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverridesQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverridesQuery.ts @@ -4,20 +4,35 @@ * 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"; +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({ @@ -30,33 +45,60 @@ export const principalScopeOverridesQueryKey = principalScopeOverrideKeys.list; * }); * ``` */ -export function usePrincipalScopeOverridesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PrincipalScopeOverrideSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrincipalScopeOverridesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +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 + ...queryOptions, }); } /** * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. - * + * * @example * ```ts * const data = await fetchPrincipalScopeOverridesQuery({ @@ -67,38 +109,72 @@ export function usePrincipalScopeOverridesQuery(params: { * }); * ``` */ -export async function fetchPrincipalScopeOverridesQuery(params: { +export async function fetchPrincipalScopeOverridesQuery< + S extends PrincipalScopeOverrideSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PrincipalScopeOverrideSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrincipalScopeOverrideSelect>; }): Promise<{ - principalScopeOverrides: ConnectionResult>; + principalScopeOverrides: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPrincipalScopeOverridesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + 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, "fields"> & HookStrictSelect, PrincipalScopeOverrideSelect>; -}): Promise; -export async function prefetchPrincipalScopeOverridesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +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() + 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 index 2671714bf7..1561904175 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalsQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalsQuery.ts @@ -4,20 +4,35 @@ * 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"; +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({ @@ -30,33 +45,47 @@ export const principalsQueryKey = principalKeys.list; * }); * ``` */ -export function usePrincipalsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PrincipalSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrincipalsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +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 + ...queryOptions, }); } /** * Scoped sub-identities (API keys and agents) with precomputed SPRT - * + * * @example * ```ts * const data = await fetchPrincipalsQuery({ @@ -70,35 +99,47 @@ export function usePrincipalsQuery(params: { export async function fetchPrincipalsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PrincipalSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PrincipalSelect>; }): Promise<{ principals: ConnectionResult>; }>; export async function fetchPrincipalsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + 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); +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() + queryFn: () => getClient().principal.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useRequireStepUpQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useRequireStepUpQuery.ts index abe586fb4d..115b29a859 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useRequireStepUpQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useRequireStepUpQuery.ts @@ -4,82 +4,102 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { RequireStepUpVariables } from "../../orm/query"; -export type { RequireStepUpVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { RequireStepUpVariables } from '../../orm/query'; +export type { RequireStepUpVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const requireStepUpQueryKey = customQueryKeys.requireStepUp; /** * Query hook for requireStepUp - * + * * @example * ```tsx * const { data, isLoading } = useRequireStepUpQuery({ variables: { stepUpType } }); - * + * * if (data?.requireStepUp) { * console.log(data.requireStepUp); * } * ``` */ -export function useRequireStepUpQuery(params?: { - variables?: RequireStepUpVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useRequireStepUpQuery(params?: { - variables?: RequireStepUpVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useRequireStepUpQuery< + TData = { + requireStepUp: boolean | null; + }, +>( + params?: { + variables?: RequireStepUpVariables; + } & Omit< + UseQueryOptions< + { + requireStepUp: boolean | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRequireStepUpQuery< + TData = { + requireStepUp: boolean | null; + }, +>( + params?: { + variables?: RequireStepUpVariables; + } & Omit< + UseQueryOptions< + { + requireStepUp: boolean | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: requireStepUpQueryKey(variables), queryFn: () => getClient().query.requireStepUp(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch requireStepUp without React hooks - * + * * @example * ```ts * const data = await fetchRequireStepUpQuery({ variables: { stepUpType } }); * ``` */ -export async function fetchRequireStepUpQuery(params?: { - variables?: RequireStepUpVariables; -}) { +export async function fetchRequireStepUpQuery(params?: { variables?: RequireStepUpVariables }) { const variables = params?.variables ?? {}; return getClient().query.requireStepUp(variables).unwrap(); } /** * Prefetch requireStepUp for SSR or cache warming - * + * * @example * ```ts * await prefetchRequireStepUpQuery(queryClient, { variables: { stepUpType } }); * ``` */ -export async function prefetchRequireStepUpQuery(queryClient: QueryClient, params?: { - variables?: RequireStepUpVariables; -}): Promise { +export async function prefetchRequireStepUpQuery( + queryClient: QueryClient, + params?: { + variables?: RequireStepUpVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: requireStepUpQueryKey(variables), - queryFn: () => getClient().query.requireStepUp(variables).unwrap() + queryFn: () => getClient().query.requireStepUp(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useRoleTypeQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useRoleTypeQuery.ts index c25adbe405..314085b876 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useRoleTypeQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useRoleTypeQuery.ts @@ -4,20 +4,20 @@ * 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 { roleTypeKeys } from "../query-keys"; -import type { RoleTypeSelect, RoleTypeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RoleTypeSelect, RoleTypeWithRelations } from "../../orm/input-types"; +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 { roleTypeKeys } from '../query-keys'; +import type { RoleTypeSelect, RoleTypeWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RoleTypeSelect, RoleTypeWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const roleTypeQueryKey = roleTypeKeys.detail; /** * Query hook for fetching a single RoleType - * + * * @example * ```tsx * const { data, isLoading } = useRoleTypeQuery({ @@ -26,38 +26,52 @@ export const roleTypeQueryKey = roleTypeKeys.detail; * }); * ``` */ -export function useRoleTypeQuery | null; -}>(params: { - id: number; - selection: { - fields: S; - } & HookStrictSelect, RoleTypeSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRoleTypeQuery(params: { - id: number; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRoleTypeQuery< + S extends RoleTypeSelect, + TData = { + roleType: InferSelectResult | null; + }, +>( + params: { + id: number; + selection: { + fields: S; + } & HookStrictSelect, RoleTypeSelect>; + } & Omit< + UseQueryOptions< + { + roleType: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRoleTypeQuery( + params: { + id: number; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: roleTypeKeys.detail(params.id), - queryFn: () => getClient().roleType.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .roleType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single RoleType without React hooks - * + * * @example * ```ts * const data = await fetchRoleTypeQuery({ @@ -79,35 +93,46 @@ export async function fetchRoleTypeQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().roleType.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .roleType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single RoleType for SSR or cache warming - * + * * @example * ```ts * await prefetchRoleTypeQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRoleTypeQuery(queryClient: QueryClient, params: { - id: number; - selection: { - fields: S; - } & HookStrictSelect, RoleTypeSelect>; -}): Promise; -export async function prefetchRoleTypeQuery(queryClient: QueryClient, params: { - id: number; - selection: SelectionConfig; -}): Promise { +export async function prefetchRoleTypeQuery( + queryClient: QueryClient, + params: { + id: number; + selection: { + fields: S; + } & HookStrictSelect, RoleTypeSelect>; + } +): Promise; +export async function prefetchRoleTypeQuery( + queryClient: QueryClient, + params: { + id: number; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: roleTypeKeys.detail(params.id), - queryFn: () => getClient().roleType.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .roleType.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useRoleTypesQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useRoleTypesQuery.ts index e29f0b6dab..9819ceed5d 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useRoleTypesQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useRoleTypesQuery.ts @@ -4,20 +4,35 @@ * 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 { roleTypeKeys } from "../query-keys"; -import type { RoleTypeSelect, RoleTypeWithRelations, RoleTypeFilter, RoleTypeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RoleTypeSelect, RoleTypeWithRelations, RoleTypeFilter, RoleTypeOrderBy } from "../../orm/input-types"; +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 { roleTypeKeys } from '../query-keys'; +import type { + RoleTypeSelect, + RoleTypeWithRelations, + RoleTypeFilter, + RoleTypeOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RoleTypeSelect, + RoleTypeWithRelations, + RoleTypeFilter, + RoleTypeOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const roleTypesQueryKey = roleTypeKeys.list; /** * Query hook for fetching RoleType list - * + * * @example * ```tsx * const { data, isLoading } = useRoleTypesQuery({ @@ -30,33 +45,47 @@ export const roleTypesQueryKey = roleTypeKeys.list; * }); * ``` */ -export function useRoleTypesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RoleTypeSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRoleTypesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRoleTypesQuery< + S extends RoleTypeSelect, + TData = { + roleTypes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RoleTypeSelect>; + } & Omit< + UseQueryOptions< + { + roleTypes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRoleTypesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: roleTypeKeys.list(args), queryFn: () => getClient().roleType.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch RoleType list without React hooks - * + * * @example * ```ts * const data = await fetchRoleTypesQuery({ @@ -70,35 +99,47 @@ export function useRoleTypesQuery(params: { export async function fetchRoleTypesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RoleTypeSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RoleTypeSelect>; }): Promise<{ roleTypes: ConnectionResult>; }>; export async function fetchRoleTypesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().roleType.findMany(args).unwrap(); } /** * Prefetch RoleType list for SSR or cache warming - * + * * @example * ```ts * await prefetchRoleTypesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRoleTypesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RoleTypeSelect>; -}): Promise; -export async function prefetchRoleTypesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRoleTypesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RoleTypeSelect>; + } +): Promise; +export async function prefetchRoleTypesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: roleTypeKeys.list(args), - queryFn: () => getClient().roleType.findMany(args).unwrap() + queryFn: () => getClient().roleType.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useUserConnectedAccountQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useUserConnectedAccountQuery.ts index 5688a81c6b..c904d68866 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useUserConnectedAccountQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useUserConnectedAccountQuery.ts @@ -4,20 +4,26 @@ * 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 { userConnectedAccountKeys } from "../query-keys"; -import type { UserConnectedAccountSelect, UserConnectedAccountWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserConnectedAccountSelect, UserConnectedAccountWithRelations } from "../../orm/input-types"; +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 { userConnectedAccountKeys } from '../query-keys'; +import type { + UserConnectedAccountSelect, + UserConnectedAccountWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserConnectedAccountSelect, + UserConnectedAccountWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userConnectedAccountQueryKey = userConnectedAccountKeys.detail; /** * Query hook for fetching a single UserConnectedAccount - * + * * @example * ```tsx * const { data, isLoading } = useUserConnectedAccountQuery({ @@ -26,38 +32,52 @@ export const userConnectedAccountQueryKey = userConnectedAccountKeys.detail; * }); * ``` */ -export function useUserConnectedAccountQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserConnectedAccountSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserConnectedAccountQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUserConnectedAccountQuery< + S extends UserConnectedAccountSelect, + TData = { + userConnectedAccount: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserConnectedAccountSelect>; + } & Omit< + UseQueryOptions< + { + userConnectedAccount: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserConnectedAccountQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userConnectedAccountKeys.detail(params.id), - queryFn: () => getClient().userConnectedAccount.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .userConnectedAccount.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single UserConnectedAccount without React hooks - * + * * @example * ```ts * const data = await fetchUserConnectedAccountQuery({ @@ -79,35 +99,46 @@ export async function fetchUserConnectedAccountQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().userConnectedAccount.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .userConnectedAccount.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single UserConnectedAccount for SSR or cache warming - * + * * @example * ```ts * await prefetchUserConnectedAccountQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchUserConnectedAccountQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserConnectedAccountSelect>; -}): Promise; -export async function prefetchUserConnectedAccountQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchUserConnectedAccountQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserConnectedAccountSelect>; + } +): Promise; +export async function prefetchUserConnectedAccountQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: userConnectedAccountKeys.detail(params.id), - queryFn: () => getClient().userConnectedAccount.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .userConnectedAccount.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useUserConnectedAccountsQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useUserConnectedAccountsQuery.ts index 1d345e2831..f4e42d7af1 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useUserConnectedAccountsQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useUserConnectedAccountsQuery.ts @@ -4,20 +4,35 @@ * 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 { userConnectedAccountKeys } from "../query-keys"; -import type { UserConnectedAccountSelect, UserConnectedAccountWithRelations, UserConnectedAccountFilter, UserConnectedAccountOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserConnectedAccountSelect, UserConnectedAccountWithRelations, UserConnectedAccountFilter, UserConnectedAccountOrderBy } from "../../orm/input-types"; +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 { userConnectedAccountKeys } from '../query-keys'; +import type { + UserConnectedAccountSelect, + UserConnectedAccountWithRelations, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + UserConnectedAccountSelect, + UserConnectedAccountWithRelations, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userConnectedAccountsQueryKey = userConnectedAccountKeys.list; /** * Query hook for fetching UserConnectedAccount list - * + * * @example * ```tsx * const { data, isLoading } = useUserConnectedAccountsQuery({ @@ -30,33 +45,60 @@ export const userConnectedAccountsQueryKey = userConnectedAccountKeys.list; * }); * ``` */ -export function useUserConnectedAccountsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserConnectedAccountSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserConnectedAccountsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useUserConnectedAccountsQuery< + S extends UserConnectedAccountSelect, + TData = { + userConnectedAccounts: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, UserConnectedAccountSelect>; + } & Omit< + UseQueryOptions< + { + userConnectedAccounts: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserConnectedAccountsQuery( + params: { + selection: ListSelectionConfig< + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userConnectedAccountKeys.list(args), queryFn: () => getClient().userConnectedAccount.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch UserConnectedAccount list without React hooks - * + * * @example * ```ts * const data = await fetchUserConnectedAccountsQuery({ @@ -67,38 +109,70 @@ export function useUserConnectedAccountsQuery(params: { * }); * ``` */ -export async function fetchUserConnectedAccountsQuery(params: { +export async function fetchUserConnectedAccountsQuery< + S extends UserConnectedAccountSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, UserConnectedAccountSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, UserConnectedAccountSelect>; }): Promise<{ userConnectedAccounts: ConnectionResult>; }>; export async function fetchUserConnectedAccountsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy + >(params.selection); return getClient().userConnectedAccount.findMany(args).unwrap(); } /** * Prefetch UserConnectedAccount list for SSR or cache warming - * + * * @example * ```ts * await prefetchUserConnectedAccountsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchUserConnectedAccountsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserConnectedAccountSelect>; -}): Promise; -export async function prefetchUserConnectedAccountsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchUserConnectedAccountsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, UserConnectedAccountSelect>; + } +): Promise; +export async function prefetchUserConnectedAccountsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: userConnectedAccountKeys.list(args), - queryFn: () => getClient().userConnectedAccount.findMany(args).unwrap() + queryFn: () => getClient().userConnectedAccount.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useUserQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useUserQuery.ts index 58021bdd40..03a7bb6bc4 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useUserQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useUserQuery.ts @@ -4,20 +4,20 @@ * 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 { userKeys } from "../query-keys"; -import type { UserSelect, UserWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSelect, UserWithRelations } from "../../orm/input-types"; +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 { userKeys } from '../query-keys'; +import type { UserSelect, UserWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserSelect, UserWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userQueryKey = userKeys.detail; /** * Query hook for fetching a single User - * + * * @example * ```tsx * const { data, isLoading } = useUserQuery({ @@ -26,38 +26,52 @@ export const userQueryKey = userKeys.detail; * }); * ``` */ -export function useUserQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUserQuery< + S extends UserSelect, + TData = { + user: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserSelect>; + } & Omit< + UseQueryOptions< + { + user: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userKeys.detail(params.id), - queryFn: () => getClient().user.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .user.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single User without React hooks - * + * * @example * ```ts * const data = await fetchUserQuery({ @@ -79,35 +93,46 @@ export async function fetchUserQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().user.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .user.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single User for SSR or cache warming - * + * * @example * ```ts * await prefetchUserQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchUserQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserSelect>; -}): Promise; -export async function prefetchUserQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchUserQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserSelect>; + } +): Promise; +export async function prefetchUserQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: userKeys.detail(params.id), - queryFn: () => getClient().user.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .user.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useUsersQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useUsersQuery.ts index b79c4854b3..478d3eab44 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useUsersQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useUsersQuery.ts @@ -4,20 +4,25 @@ * 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 { userKeys } from "../query-keys"; -import type { UserSelect, UserWithRelations, UserFilter, UserOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSelect, UserWithRelations, UserFilter, UserOrderBy } from "../../orm/input-types"; +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 { userKeys } from '../query-keys'; +import type { UserSelect, UserWithRelations, UserFilter, UserOrderBy } from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { UserSelect, UserWithRelations, UserFilter, UserOrderBy } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const usersQueryKey = userKeys.list; /** * Query hook for fetching User list - * + * * @example * ```tsx * const { data, isLoading } = useUsersQuery({ @@ -30,33 +35,45 @@ export const usersQueryKey = userKeys.list; * }); * ``` */ -export function useUsersQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUsersQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUsersQuery< + S extends UserSelect, + TData = { + users: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UserSelect>; + } & Omit< + UseQueryOptions< + { + users: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUsersQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userKeys.list(args), queryFn: () => getClient().user.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch User list without React hooks - * + * * @example * ```ts * const data = await fetchUsersQuery({ @@ -70,7 +87,8 @@ export function useUsersQuery(params: { export async function fetchUsersQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, UserSelect>; + } & Omit, 'fields'> & + HookStrictSelect, UserSelect>; }): Promise<{ users: ConnectionResult>; }>; @@ -82,23 +100,30 @@ export async function fetchUsersQuery(params: { } /** * Prefetch User list for SSR or cache warming - * + * * @example * ```ts * await prefetchUsersQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchUsersQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserSelect>; -}): Promise; -export async function prefetchUsersQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchUsersQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UserSelect>; + } +): Promise; +export async function prefetchUsersQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: userKeys.list(args), - queryFn: () => getClient().user.findMany(args).unwrap() + queryFn: () => getClient().user.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useWebauthnCredentialQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useWebauthnCredentialQuery.ts index e2cae123ba..f1d55d52fb 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useWebauthnCredentialQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useWebauthnCredentialQuery.ts @@ -4,20 +4,26 @@ * 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 { webauthnCredentialKeys } from "../query-keys"; -import type { WebauthnCredentialSelect, WebauthnCredentialWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialSelect, WebauthnCredentialWithRelations } from "../../orm/input-types"; +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 { webauthnCredentialKeys } from '../query-keys'; +import type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webauthnCredentialQueryKey = webauthnCredentialKeys.detail; /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```tsx * const { data, isLoading } = useWebauthnCredentialQuery({ @@ -26,38 +32,52 @@ export const webauthnCredentialQueryKey = webauthnCredentialKeys.detail; * }); * ``` */ -export function useWebauthnCredentialQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebauthnCredentialSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebauthnCredentialQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useWebauthnCredentialQuery< + S extends WebauthnCredentialSelect, + TData = { + webauthnCredential: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebauthnCredentialSelect>; + } & Omit< + UseQueryOptions< + { + webauthnCredential: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebauthnCredentialQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webauthnCredentialKeys.detail(params.id), - queryFn: () => getClient().webauthnCredential.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .webauthnCredential.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```ts * const data = await fetchWebauthnCredentialQuery({ @@ -79,35 +99,46 @@ export async function fetchWebauthnCredentialQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().webauthnCredential.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .webauthnCredential.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```ts * await prefetchWebauthnCredentialQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchWebauthnCredentialQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebauthnCredentialSelect>; -}): Promise; -export async function prefetchWebauthnCredentialQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchWebauthnCredentialQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebauthnCredentialSelect>; + } +): Promise; +export async function prefetchWebauthnCredentialQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: webauthnCredentialKeys.detail(params.id), - queryFn: () => getClient().webauthnCredential.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .webauthnCredential.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/auth/hooks/queries/useWebauthnCredentialsQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useWebauthnCredentialsQuery.ts index e9e40e2d6b..487b60768b 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/useWebauthnCredentialsQuery.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/useWebauthnCredentialsQuery.ts @@ -4,20 +4,35 @@ * 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 { webauthnCredentialKeys } from "../query-keys"; -import type { WebauthnCredentialSelect, WebauthnCredentialWithRelations, WebauthnCredentialFilter, WebauthnCredentialOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialSelect, WebauthnCredentialWithRelations, WebauthnCredentialFilter, WebauthnCredentialOrderBy } from "../../orm/input-types"; +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 { webauthnCredentialKeys } from '../query-keys'; +import type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + WebauthnCredentialSelect, + WebauthnCredentialWithRelations, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webauthnCredentialsQueryKey = webauthnCredentialKeys.list; /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```tsx * const { data, isLoading } = useWebauthnCredentialsQuery({ @@ -30,33 +45,58 @@ export const webauthnCredentialsQueryKey = webauthnCredentialKeys.list; * }); * ``` */ -export function useWebauthnCredentialsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnCredentialSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebauthnCredentialsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useWebauthnCredentialsQuery< + S extends WebauthnCredentialSelect, + TData = { + webauthnCredentials: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, WebauthnCredentialSelect>; + } & Omit< + UseQueryOptions< + { + webauthnCredentials: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebauthnCredentialsQuery( + params: { + selection: ListSelectionConfig< + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webauthnCredentialKeys.list(args), queryFn: () => getClient().webauthnCredential.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```ts * const data = await fetchWebauthnCredentialsQuery({ @@ -70,35 +110,62 @@ export function useWebauthnCredentialsQuery(params: { export async function fetchWebauthnCredentialsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnCredentialSelect>; + } & Omit, 'fields'> & + HookStrictSelect, WebauthnCredentialSelect>; }): Promise<{ webauthnCredentials: ConnectionResult>; }>; export async function fetchWebauthnCredentialsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy + >(params.selection); return getClient().webauthnCredential.findMany(args).unwrap(); } /** * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object. - * + * * @example * ```ts * await prefetchWebauthnCredentialsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchWebauthnCredentialsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnCredentialSelect>; -}): Promise; -export async function prefetchWebauthnCredentialsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchWebauthnCredentialsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, WebauthnCredentialSelect>; + } +): Promise; +export async function prefetchWebauthnCredentialsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: webauthnCredentialKeys.list(args), - queryFn: () => getClient().webauthnCredential.findMany(args).unwrap() + queryFn: () => getClient().webauthnCredential.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 49680959ad..037996584c 100644 --- a/sdk/constructive-react/src/auth/hooks/query-keys.ts +++ b/sdk/constructive-react/src/auth/hooks/query-keys.ts @@ -20,95 +20,121 @@ // ============================================================================ export const auditLogAuthKeys = { - /** All auditLogAuth queries */all: ["auditlogauth"] as const, - /** List query keys */lists: () => [...auditLogAuthKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...auditLogAuthKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...auditLogAuthKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...auditLogAuthKeys.details(), id] as const + /** All auditLogAuth queries */ all: ['auditlogauth'] as const, + /** List query keys */ lists: () => [...auditLogAuthKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...auditLogAuthKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...auditLogAuthKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...auditLogAuthKeys.details(), id] as const, } as const; export const cryptoAddressKeys = { - /** All cryptoAddress queries */all: ["cryptoaddress"] as const, - /** List query keys */lists: () => [...cryptoAddressKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...cryptoAddressKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...cryptoAddressKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...cryptoAddressKeys.details(), id] as const + /** All cryptoAddress queries */ all: ['cryptoaddress'] as const, + /** List query keys */ lists: () => [...cryptoAddressKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...cryptoAddressKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...cryptoAddressKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...cryptoAddressKeys.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, - /** List query key with variables */list: (variables?: object) => [...emailKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...emailKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...emailKeys.details(), id] as const + /** All email queries */ all: ['email'] as const, + /** List query keys */ lists: () => [...emailKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...emailKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...emailKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...emailKeys.details(), id] as const, } as const; export const identityProviderKeys = { - /** All identityProvider queries */all: ["identityprovider"] as const, - /** List query keys */lists: () => [...identityProviderKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...identityProviderKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...identityProviderKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...identityProviderKeys.details(), id] as const + /** All identityProvider queries */ all: ['identityprovider'] as const, + /** List query keys */ lists: () => [...identityProviderKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...identityProviderKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...identityProviderKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...identityProviderKeys.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 + /** 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 phoneNumberKeys = { - /** All phoneNumber queries */all: ["phonenumber"] as const, - /** List query keys */lists: () => [...phoneNumberKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...phoneNumberKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...phoneNumberKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...phoneNumberKeys.details(), id] as const + /** All phoneNumber queries */ all: ['phonenumber'] as const, + /** List query keys */ lists: () => [...phoneNumberKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...phoneNumberKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...phoneNumberKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...phoneNumberKeys.details(), id] as const, } as const; 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 + /** 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 + /** 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 + /** 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 roleTypeKeys = { - /** All roleType queries */all: ["roletype"] as const, - /** List query keys */lists: () => [...roleTypeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...roleTypeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...roleTypeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...roleTypeKeys.details(), id] as const + /** All roleType queries */ all: ['roletype'] as const, + /** List query keys */ lists: () => [...roleTypeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...roleTypeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...roleTypeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...roleTypeKeys.details(), id] as const, } as const; export const userConnectedAccountKeys = { - /** All userConnectedAccount queries */all: ["userconnectedaccount"] as const, - /** List query keys */lists: () => [...userConnectedAccountKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...userConnectedAccountKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...userConnectedAccountKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...userConnectedAccountKeys.details(), id] as const + /** All userConnectedAccount queries */ all: ['userconnectedaccount'] as const, + /** List query keys */ lists: () => [...userConnectedAccountKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...userConnectedAccountKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...userConnectedAccountKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...userConnectedAccountKeys.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, - /** List query key with variables */list: (variables?: object) => [...userKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...userKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...userKeys.details(), id] as const + /** All user queries */ all: ['user'] as const, + /** List query keys */ lists: () => [...userKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...userKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...userKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...userKeys.details(), id] as const, } as const; export const webauthnCredentialKeys = { - /** All webauthnCredential queries */all: ["webauthncredential"] as const, - /** List query keys */lists: () => [...webauthnCredentialKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...webauthnCredentialKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...webauthnCredentialKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...webauthnCredentialKeys.details(), id] as const + /** All webauthnCredential queries */ all: ['webauthncredential'] as const, + /** List query keys */ lists: () => [...webauthnCredentialKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...webauthnCredentialKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...webauthnCredentialKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...webauthnCredentialKeys.details(), id] as const, } as const; // ============================================================================ @@ -116,11 +142,12 @@ export const webauthnCredentialKeys = { // ============================================================================ export const customQueryKeys = { - /** Query key for currentIpAddress */currentIpAddress: () => ["currentIpAddress"] as const, - /** Query key for currentUser */currentUser: () => ["currentUser"] as const, - /** Query key for currentUserAgent */currentUserAgent: () => ["currentUserAgent"] as const, - /** Query key for currentUserId */currentUserId: () => ["currentUserId"] as const, - /** Query key for requireStepUp */requireStepUp: (variables?: object) => ["requireStepUp", variables] as const + /** Query key for currentIpAddress */ currentIpAddress: () => ['currentIpAddress'] as const, + /** Query key for currentUser */ currentUser: () => ['currentUser'] as const, + /** Query key for currentUserAgent */ currentUserAgent: () => ['currentUserAgent'] as const, + /** Query key for currentUserId */ currentUserId: () => ['currentUserId'] as const, + /** Query key for requireStepUp */ requireStepUp: (variables?: object) => + ['requireStepUp', variables] as const, } as const; /** @@ -158,7 +185,7 @@ export const queryKeys = { userConnectedAccount: userConnectedAccountKeys, user: userKeys, webauthnCredential: webauthnCredentialKeys, - custom: customQueryKeys + custom: customQueryKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/auth/hooks/selection.ts b/sdk/constructive-react/src/auth/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/auth/hooks/selection.ts +++ b/sdk/constructive-react/src/auth/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/auth/index.ts b/sdk/constructive-react/src/auth/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/auth/index.ts +++ b/sdk/constructive-react/src/auth/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/auth/orm/client.ts b/sdk/constructive-react/src/auth/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/auth/orm/client.ts +++ b/sdk/constructive-react/src/auth/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/auth/orm/index.ts b/sdk/constructive-react/src/auth/orm/index.ts index 7c5cb52e86..b677b5b306 100644 --- a/sdk/constructive-react/src/auth/orm/index.ts +++ b/sdk/constructive-react/src/auth/orm/index.ts @@ -3,30 +3,30 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AuditLogAuthModel } from "./models/auditLogAuth"; -import { CryptoAddressModel } from "./models/cryptoAddress"; -import { EmailModel } from "./models/email"; -import { IdentityProviderModel } from "./models/identityProvider"; -import { OrgApiKeyListModel } from "./models/orgApiKeyList"; -import { PhoneNumberModel } from "./models/phoneNumber"; -import { PrincipalModel } from "./models/principal"; -import { PrincipalEntityModel } from "./models/principalEntity"; -import { PrincipalScopeOverrideModel } from "./models/principalScopeOverride"; -import { RoleTypeModel } from "./models/roleType"; -import { UserConnectedAccountModel } from "./models/userConnectedAccount"; -import { UserModel } from "./models/user"; -import { WebauthnCredentialModel } from "./models/webauthnCredential"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AuditLogAuthModel } from './models/auditLogAuth'; +import { CryptoAddressModel } from './models/cryptoAddress'; +import { EmailModel } from './models/email'; +import { IdentityProviderModel } from './models/identityProvider'; +import { OrgApiKeyListModel } from './models/orgApiKeyList'; +import { PhoneNumberModel } from './models/phoneNumber'; +import { PrincipalModel } from './models/principal'; +import { PrincipalEntityModel } from './models/principalEntity'; +import { PrincipalScopeOverrideModel } from './models/principalScopeOverride'; +import { RoleTypeModel } from './models/roleType'; +import { UserConnectedAccountModel } from './models/userConnectedAccount'; +import { UserModel } from './models/user'; +import { WebauthnCredentialModel } from './models/webauthnCredential'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -67,6 +67,6 @@ export function createClient(config: OrmClientConfig) { user: new UserModel(client), webauthnCredential: new WebauthnCredentialModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/input-types.ts b/sdk/constructive-react/src/auth/orm/input-types.ts index e6132cfc3d..56374f8968 100644 --- a/sdk/constructive-react/src/auth/orm/input-types.ts +++ b/sdk/constructive-react/src/auth/orm/input-types.ts @@ -495,9 +495,11 @@ export type OrgApiKeyListWithRelations = OrgApiKeyList & OrgApiKeyListRelations; export type PhoneNumberWithRelations = PhoneNumber & PhoneNumberRelations; export type PrincipalWithRelations = Principal & PrincipalRelations; export type PrincipalEntityWithRelations = PrincipalEntity & PrincipalEntityRelations; -export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & PrincipalScopeOverrideRelations; +export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & + PrincipalScopeOverrideRelations; export type RoleTypeWithRelations = RoleType & RoleTypeRelations; -export type UserConnectedAccountWithRelations = UserConnectedAccount & UserConnectedAccountRelations; +export type UserConnectedAccountWithRelations = UserConnectedAccount & + UserConnectedAccountRelations; export type UserWithRelations = User & UserRelations; export type WebauthnCredentialWithRelations = WebauthnCredential & WebauthnCredentialRelations; // ============ Entity Select Types ============ @@ -1145,19 +1147,268 @@ export interface WebauthnCredentialFilter { webauthnUserId?: StringFilter; } // ============ OrderBy Types ============ -export type AuditLogAuthOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_ASC" | "EVENT_DESC" | "ID_ASC" | "ID_DESC" | "IP_ADDRESS_ASC" | "IP_ADDRESS_DESC" | "NATURAL" | "ORIGIN_ASC" | "ORIGIN_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "USER_AGENT_ASC" | "USER_AGENT_DESC"; -export type CryptoAddressOrderBy = "ADDRESS_ASC" | "ADDRESS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type EmailOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type IdentityProviderOrderBy = "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "ENABLED_ASC" | "ENABLED_DESC" | "KIND_ASC" | "KIND_DESC" | "NATURAL" | "SLUG_ASC" | "SLUG_DESC"; -export type OrgApiKeyListOrderBy = "ACCESS_LEVEL_ASC" | "ACCESS_LEVEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "KEY_ID_ASC" | "KEY_ID_DESC" | "LAST_USED_AT_ASC" | "LAST_USED_AT_DESC" | "MFA_LEVEL_ASC" | "MFA_LEVEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "ORG_ID_ASC" | "ORG_ID_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "REVOKED_AT_ASC" | "REVOKED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PhoneNumberOrderBy = "CC_ASC" | "CC_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUMBER_ASC" | "NUMBER_DESC" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PrincipalOrderBy = "BYPASS_STEP_UP_ASC" | "BYPASS_STEP_UP_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_ID_ASC" | "USER_ID_DESC" | "USE_ADMIN_OWNER_ASC" | "USE_ADMIN_OWNER_DESC"; -export type PrincipalEntityOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PrincipalScopeOverrideOrderBy = "ALLOWED_MASK_ASC" | "ALLOWED_MASK_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "MEMBERSHIP_TYPE_ASC" | "MEMBERSHIP_TYPE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USE_ADMIN_OWNER_ASC" | "USE_ADMIN_OWNER_DESC"; -export type RoleTypeOrderBy = "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type UserConnectedAccountOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DETAILS_ASC" | "DETAILS_DESC" | "IDENTIFIER_ASC" | "IDENTIFIER_DESC" | "ID_ASC" | "ID_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "SERVICE_ASC" | "SERVICE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type UserOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "DISPLAY_NAME_TRGM_SIMILARITY_ASC" | "DISPLAY_NAME_TRGM_SIMILARITY_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_PICTURE_ASC" | "PROFILE_PICTURE_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "SEARCH_TSV_ASC" | "SEARCH_TSV_DESC" | "SEARCH_TSV_RANK_ASC" | "SEARCH_TSV_RANK_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USERNAME_ASC" | "USERNAME_DESC"; -export type WebauthnCredentialOrderBy = "BACKUP_ELIGIBLE_ASC" | "BACKUP_ELIGIBLE_DESC" | "BACKUP_STATE_ASC" | "BACKUP_STATE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREDENTIAL_DEVICE_TYPE_ASC" | "CREDENTIAL_DEVICE_TYPE_DESC" | "CREDENTIAL_ID_ASC" | "CREDENTIAL_ID_DESC" | "ID_ASC" | "ID_DESC" | "LAST_USED_AT_ASC" | "LAST_USED_AT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PUBLIC_KEY_ASC" | "PUBLIC_KEY_DESC" | "SIGN_COUNT_ASC" | "SIGN_COUNT_DESC" | "TRANSPORTS_ASC" | "TRANSPORTS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WEBAUTHN_USER_ID_ASC" | "WEBAUTHN_USER_ID_DESC"; +export type AuditLogAuthOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IP_ADDRESS_ASC' + | 'IP_ADDRESS_DESC' + | 'NATURAL' + | 'ORIGIN_ASC' + | 'ORIGIN_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'USER_AGENT_ASC' + | 'USER_AGENT_DESC'; +export type CryptoAddressOrderBy = + | 'ADDRESS_ASC' + | 'ADDRESS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type EmailOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type IdentityProviderOrderBy = + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'ENABLED_ASC' + | 'ENABLED_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'NATURAL' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type OrgApiKeyListOrderBy = + | 'ACCESS_LEVEL_ASC' + | 'ACCESS_LEVEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KEY_ID_ASC' + | 'KEY_ID_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'MFA_LEVEL_ASC' + | 'MFA_LEVEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'ORG_ID_ASC' + | 'ORG_ID_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'REVOKED_AT_ASC' + | 'REVOKED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PhoneNumberOrderBy = + | 'CC_ASC' + | 'CC_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUMBER_ASC' + | 'NUMBER_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PrincipalOrderBy = + | 'BYPASS_STEP_UP_ASC' + | 'BYPASS_STEP_UP_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_ID_ASC' + | 'USER_ID_DESC' + | 'USE_ADMIN_OWNER_ASC' + | 'USE_ADMIN_OWNER_DESC'; +export type PrincipalEntityOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PrincipalScopeOverrideOrderBy = + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'MEMBERSHIP_TYPE_ASC' + | 'MEMBERSHIP_TYPE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USE_ADMIN_OWNER_ASC' + | 'USE_ADMIN_OWNER_DESC'; +export type RoleTypeOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type UserConnectedAccountOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DETAILS_ASC' + | 'DETAILS_DESC' + | 'IDENTIFIER_ASC' + | 'IDENTIFIER_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'SERVICE_ASC' + | 'SERVICE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type UserOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'DISPLAY_NAME_TRGM_SIMILARITY_ASC' + | 'DISPLAY_NAME_TRGM_SIMILARITY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_PICTURE_ASC' + | 'PROFILE_PICTURE_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'SEARCH_TSV_ASC' + | 'SEARCH_TSV_DESC' + | 'SEARCH_TSV_RANK_ASC' + | 'SEARCH_TSV_RANK_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USERNAME_ASC' + | 'USERNAME_DESC'; +export type WebauthnCredentialOrderBy = + | 'BACKUP_ELIGIBLE_ASC' + | 'BACKUP_ELIGIBLE_DESC' + | 'BACKUP_STATE_ASC' + | 'BACKUP_STATE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREDENTIAL_DEVICE_TYPE_ASC' + | 'CREDENTIAL_DEVICE_TYPE_DESC' + | 'CREDENTIAL_ID_ASC' + | 'CREDENTIAL_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PUBLIC_KEY_ASC' + | 'PUBLIC_KEY_DESC' + | 'SIGN_COUNT_ASC' + | 'SIGN_COUNT_DESC' + | 'TRANSPORTS_ASC' + | 'TRANSPORTS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WEBAUTHN_USER_ID_ASC' + | 'WEBAUTHN_USER_ID_DESC'; // ============ CRUD Input Types ============ export interface CreateAuditLogAuthInput { clientMutationId?: string; @@ -1512,24 +1763,24 @@ export interface DeleteWebauthnCredentialInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Principal": { - "principalEntities": "PrincipalEntity", - "principalScopeOverrides": "PrincipalScopeOverride" + Principal: { + principalEntities: 'PrincipalEntity', + principalScopeOverrides: 'PrincipalScopeOverride', }, - "RoleType": { - "usersByType": "User" + RoleType: { + usersByType: 'User', + }, + User: { + auditLogAuthsByActorId: 'AuditLogAuth', + ownedCryptoAddresses: 'CryptoAddress', + ownedEmails: 'Email', + ownedPhoneNumbers: 'PhoneNumber', + ownedPrincipalEntities: 'PrincipalEntity', + ownedPrincipals: 'Principal', + ownedWebauthnCredentials: 'WebauthnCredential', + principalEntitiesByEntityId: 'PrincipalEntity', + principals: 'Principal', }, - "User": { - "auditLogAuthsByActorId": "AuditLogAuth", - "ownedCryptoAddresses": "CryptoAddress", - "ownedEmails": "Email", - "ownedPhoneNumbers": "PhoneNumber", - "ownedPrincipalEntities": "PrincipalEntity", - "ownedPrincipals": "Principal", - "ownedWebauthnCredentials": "WebauthnCredential", - "principalEntitiesByEntityId": "PrincipalEntity", - "principals": "Principal" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface CheckPasswordInput { @@ -3705,4 +3956,4 @@ export type WebauthnCredentialEdgeSelect = { node?: { select: WebauthnCredentialSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/auth/orm/models/auditLogAuth.ts b/sdk/constructive-react/src/auth/orm/models/auditLogAuth.ts index 250bad2507..d0eee8faf1 100644 --- a/sdk/constructive-react/src/auth/orm/models/auditLogAuth.ts +++ b/sdk/constructive-react/src/auth/orm/models/auditLogAuth.ts @@ -3,56 +3,96 @@ * @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 { AuditLogAuth, AuditLogAuthWithRelations, AuditLogAuthSelect, AuditLogAuthFilter, AuditLogAuthOrderBy, CreateAuditLogAuthInput, UpdateAuditLogAuthInput, AuditLogAuthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AuditLogAuth, + AuditLogAuthWithRelations, + AuditLogAuthSelect, + AuditLogAuthFilter, + AuditLogAuthOrderBy, + CreateAuditLogAuthInput, + UpdateAuditLogAuthInput, + AuditLogAuthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AuditLogAuthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuths: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AuditLogAuth", "auditLogAuths", 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 - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AuditLogAuth', + 'auditLogAuths', + 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, + }, + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuths", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AuditLogAuth", "auditLogAuths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AuditLogAuth', + 'auditLogAuths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuth", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuth', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AuditLogAuthModel { nodes?: InferSelectResult[]; }; }) => ({ - "auditLogAuth": data.auditLogAuths?.nodes?.[0] ?? null - }) + auditLogAuth: data.auditLogAuths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AuditLogAuth", "auditLogAuths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AuditLogAuth', + 'auditLogAuths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuth", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuth', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class AuditLogAuthModel { nodes?: InferSelectResult[]; }; }) => ({ - "auditLogAuth": data.auditLogAuths?.nodes?.[0] ?? null - }) + auditLogAuth: data.auditLogAuths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AuditLogAuth", "createAuditLogAuth", "auditLogAuth", args.select, args.data, "CreateAuditLogAuthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AuditLogAuth', + 'createAuditLogAuth', + 'auditLogAuth', + args.select, + args.data, + 'CreateAuditLogAuthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "createAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'createAuditLogAuth', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + AuditLogAuthPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AuditLogAuth", "updateAuditLogAuth", "auditLogAuth", args.select, args.where.id, args.data, "UpdateAuditLogAuthInput", "id", "auditLogAuthPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'AuditLogAuth', + 'updateAuditLogAuth', + 'auditLogAuth', + args.select, + args.where.id, + args.data, + 'UpdateAuditLogAuthInput', + 'id', + 'auditLogAuthPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "updateAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'updateAuditLogAuth', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AuditLogAuth", "deleteAuditLogAuth", "auditLogAuth", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteAuditLogAuthInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AuditLogAuth', + 'deleteAuditLogAuth', + 'auditLogAuth', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteAuditLogAuthInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "deleteAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'deleteAuditLogAuth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/cryptoAddress.ts b/sdk/constructive-react/src/auth/orm/models/cryptoAddress.ts index dbf942ec7b..5dc26c76df 100644 --- a/sdk/constructive-react/src/auth/orm/models/cryptoAddress.ts +++ b/sdk/constructive-react/src/auth/orm/models/cryptoAddress.ts @@ -3,56 +3,96 @@ * @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 { CryptoAddress, CryptoAddressWithRelations, CryptoAddressSelect, CryptoAddressFilter, CryptoAddressOrderBy, CreateCryptoAddressInput, UpdateCryptoAddressInput, CryptoAddressPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAddress, + CryptoAddressWithRelations, + CryptoAddressSelect, + CryptoAddressFilter, + CryptoAddressOrderBy, + CreateCryptoAddressInput, + UpdateCryptoAddressInput, + CryptoAddressPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAddressModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddresses: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddress", "cryptoAddresses", 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 - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAddress', + 'cryptoAddresses', + 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, + }, + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddresses", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddresses', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddress: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAddress", "cryptoAddresses", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAddress', + 'cryptoAddresses', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddress", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddress', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CryptoAddressModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddress": data.cryptoAddresses?.nodes?.[0] ?? null - }) + cryptoAddress: data.cryptoAddresses?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddress: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddress", "cryptoAddresses", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAddress', + 'cryptoAddresses', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddress", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddress', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CryptoAddressModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddress": data.cryptoAddresses?.nodes?.[0] ?? null - }) + cryptoAddress: data.cryptoAddresses?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAddress", "createCryptoAddress", "cryptoAddress", args.select, args.data, "CreateCryptoAddressInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAddress', + 'createCryptoAddress', + 'cryptoAddress', + args.select, + args.data, + 'CreateCryptoAddressInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "createCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'createCryptoAddress', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAddressPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAddress", "updateCryptoAddress", "cryptoAddress", args.select, args.where.id, args.data, "UpdateCryptoAddressInput", "id", "cryptoAddressPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAddress', + 'updateCryptoAddress', + 'cryptoAddress', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAddressInput', + 'id', + 'cryptoAddressPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "updateCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'updateCryptoAddress', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAddress", "deleteCryptoAddress", "cryptoAddress", { - id: args.where.id - }, "DeleteCryptoAddressInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAddress', + 'deleteCryptoAddress', + 'cryptoAddress', + { + id: args.where.id, + }, + 'DeleteCryptoAddressInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "deleteCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'deleteCryptoAddress', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/email.ts b/sdk/constructive-react/src/auth/orm/models/email.ts index d3bf3812f5..eb60ea671f 100644 --- a/sdk/constructive-react/src/auth/orm/models/email.ts +++ b/sdk/constructive-react/src/auth/orm/models/email.ts @@ -3,56 +3,96 @@ * @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 { Email, EmailWithRelations, EmailSelect, EmailFilter, EmailOrderBy, CreateEmailInput, UpdateEmailInput, EmailPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Email, + EmailWithRelations, + EmailSelect, + EmailFilter, + EmailOrderBy, + CreateEmailInput, + UpdateEmailInput, + EmailPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmailModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emails: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Email", "emails", 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 - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Email', + 'emails', + 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, + }, + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "emails", + operation: 'query', + operationName: 'Email', + fieldName: 'emails', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ email: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Email", "emails", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Email', + 'emails', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "email", + operation: 'query', + operationName: 'Email', + fieldName: 'email', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmailModel { nodes?: InferSelectResult[]; }; }) => ({ - "email": data.emails?.nodes?.[0] ?? null - }) + email: data.emails?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ email: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Email", "emails", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Email', + 'emails', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "email", + operation: 'query', + operationName: 'Email', + fieldName: 'email', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmailModel { nodes?: InferSelectResult[]; }; }) => ({ - "email": data.emails?.nodes?.[0] ?? null - }) + email: data.emails?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Email", "createEmail", "email", args.select, args.data, "CreateEmailInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Email', + 'createEmail', + 'email', + args.select, + args.data, + 'CreateEmailInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "createEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'createEmail', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmailPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Email", "updateEmail", "email", args.select, args.where.id, args.data, "UpdateEmailInput", "id", "emailPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Email', + 'updateEmail', + 'email', + args.select, + args.where.id, + args.data, + 'UpdateEmailInput', + 'id', + 'emailPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "updateEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'updateEmail', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Email", "deleteEmail", "email", { - id: args.where.id - }, "DeleteEmailInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Email', + 'deleteEmail', + 'email', + { + id: args.where.id, + }, + 'DeleteEmailInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "deleteEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'deleteEmail', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/identityProvider.ts b/sdk/constructive-react/src/auth/orm/models/identityProvider.ts index f339ccf4d3..cdc672145c 100644 --- a/sdk/constructive-react/src/auth/orm/models/identityProvider.ts +++ b/sdk/constructive-react/src/auth/orm/models/identityProvider.ts @@ -3,56 +3,96 @@ * @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 { IdentityProvider, IdentityProviderWithRelations, IdentityProviderSelect, IdentityProviderFilter, IdentityProviderOrderBy, CreateIdentityProviderInput, UpdateIdentityProviderInput, IdentityProviderPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IdentityProvider, + IdentityProviderWithRelations, + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy, + CreateIdentityProviderInput, + UpdateIdentityProviderInput, + IdentityProviderPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IdentityProviderModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProviders: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvider", "identityProviders", 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 - }, "IdentityProviderFilter", "IdentityProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IdentityProvider', + 'identityProviders', + 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, + }, + 'IdentityProviderFilter', + 'IdentityProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvider", - fieldName: "identityProviders", + operation: 'query', + operationName: 'IdentityProvider', + fieldName: 'identityProviders', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IdentityProvider", "identityProviders", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IdentityProviderFilter", "IdentityProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IdentityProvider', + 'identityProviders', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IdentityProviderFilter', + 'IdentityProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvider", - fieldName: "identityProvider", + operation: 'query', + operationName: 'IdentityProvider', + fieldName: 'identityProvider', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class IdentityProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvider": data.identityProviders?.nodes?.[0] ?? null - }) + identityProvider: data.identityProviders?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIdentityProvider: { identityProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IdentityProvider", "createIdentityProvider", "identityProvider", args.select, args.data, "CreateIdentityProviderInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IdentityProvider', + 'createIdentityProvider', + 'identityProvider', + args.select, + args.data, + 'CreateIdentityProviderInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvider", - fieldName: "createIdentityProvider", + operation: 'mutation', + operationName: 'IdentityProvider', + fieldName: 'createIdentityProvider', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/index.ts b/sdk/constructive-react/src/auth/orm/models/index.ts index 114133e294..16f584ff03 100644 --- a/sdk/constructive-react/src/auth/orm/models/index.ts +++ b/sdk/constructive-react/src/auth/orm/models/index.ts @@ -3,16 +3,16 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AuditLogAuthModel } from "./auditLogAuth"; -export { CryptoAddressModel } from "./cryptoAddress"; -export { EmailModel } from "./email"; -export { IdentityProviderModel } from "./identityProvider"; -export { OrgApiKeyListModel } from "./orgApiKeyList"; -export { PhoneNumberModel } from "./phoneNumber"; -export { PrincipalModel } from "./principal"; -export { PrincipalEntityModel } from "./principalEntity"; -export { PrincipalScopeOverrideModel } from "./principalScopeOverride"; -export { RoleTypeModel } from "./roleType"; -export { UserConnectedAccountModel } from "./userConnectedAccount"; -export { UserModel } from "./user"; -export { WebauthnCredentialModel } from "./webauthnCredential"; \ No newline at end of file +export { AuditLogAuthModel } from './auditLogAuth'; +export { CryptoAddressModel } from './cryptoAddress'; +export { EmailModel } from './email'; +export { IdentityProviderModel } from './identityProvider'; +export { OrgApiKeyListModel } from './orgApiKeyList'; +export { PhoneNumberModel } from './phoneNumber'; +export { PrincipalModel } from './principal'; +export { PrincipalEntityModel } from './principalEntity'; +export { PrincipalScopeOverrideModel } from './principalScopeOverride'; +export { RoleTypeModel } from './roleType'; +export { UserConnectedAccountModel } from './userConnectedAccount'; +export { UserModel } from './user'; +export { WebauthnCredentialModel } from './webauthnCredential'; diff --git a/sdk/constructive-react/src/auth/orm/models/orgApiKeyList.ts b/sdk/constructive-react/src/auth/orm/models/orgApiKeyList.ts index 8c834057b7..fe7120ee8a 100644 --- a/sdk/constructive-react/src/auth/orm/models/orgApiKeyList.ts +++ b/sdk/constructive-react/src/auth/orm/models/orgApiKeyList.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyLists', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgApiKeyListModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgApiKeyList": data.orgApiKeyLists?.nodes?.[0] ?? null - }) + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgApiKeyList: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgApiKeyList", "orgApiKeyLists", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgApiKeyListFilter", "OrgApiKeyListOrderBy", connectionFieldsMap); + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgApiKeyList", - fieldName: "orgApiKeyList", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class OrgApiKeyListModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgApiKeyList": data.orgApiKeyLists?.nodes?.[0] ?? null - }) + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgApiKeyList: { orgApiKeyList: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgApiKeyList", "createOrgApiKeyList", "orgApiKeyList", args.select, args.data, "CreateOrgApiKeyListInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'OrgApiKeyList', + fieldName: 'createOrgApiKeyList', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/phoneNumber.ts b/sdk/constructive-react/src/auth/orm/models/phoneNumber.ts index 113fbf78bb..f005f23c34 100644 --- a/sdk/constructive-react/src/auth/orm/models/phoneNumber.ts +++ b/sdk/constructive-react/src/auth/orm/models/phoneNumber.ts @@ -3,56 +3,96 @@ * @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 { PhoneNumber, PhoneNumberWithRelations, PhoneNumberSelect, PhoneNumberFilter, PhoneNumberOrderBy, CreatePhoneNumberInput, UpdatePhoneNumberInput, PhoneNumberPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PhoneNumber, + PhoneNumberWithRelations, + PhoneNumberSelect, + PhoneNumberFilter, + PhoneNumberOrderBy, + CreatePhoneNumberInput, + UpdatePhoneNumberInput, + PhoneNumberPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PhoneNumberModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumber", "phoneNumbers", 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 - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PhoneNumber', + 'phoneNumbers', + 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, + }, + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumbers", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumbers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumber: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PhoneNumber", "phoneNumbers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PhoneNumber', + 'phoneNumbers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumber", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumber', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PhoneNumberModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumber": data.phoneNumbers?.nodes?.[0] ?? null - }) + phoneNumber: data.phoneNumbers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumber: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumber", "phoneNumbers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PhoneNumber', + 'phoneNumbers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumber", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumber', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PhoneNumberModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumber": data.phoneNumbers?.nodes?.[0] ?? null - }) + phoneNumber: data.phoneNumbers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PhoneNumber", "createPhoneNumber", "phoneNumber", args.select, args.data, "CreatePhoneNumberInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PhoneNumber', + 'createPhoneNumber', + 'phoneNumber', + args.select, + args.data, + 'CreatePhoneNumberInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "createPhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'createPhoneNumber', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PhoneNumberPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PhoneNumber", "updatePhoneNumber", "phoneNumber", args.select, args.where.id, args.data, "UpdatePhoneNumberInput", "id", "phoneNumberPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PhoneNumber', + 'updatePhoneNumber', + 'phoneNumber', + args.select, + args.where.id, + args.data, + 'UpdatePhoneNumberInput', + 'id', + 'phoneNumberPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "updatePhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'updatePhoneNumber', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PhoneNumber", "deletePhoneNumber", "phoneNumber", { - id: args.where.id - }, "DeletePhoneNumberInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PhoneNumber', + 'deletePhoneNumber', + 'phoneNumber', + { + id: args.where.id, + }, + 'DeletePhoneNumberInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "deletePhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'deletePhoneNumber', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/principal.ts b/sdk/constructive-react/src/auth/orm/models/principal.ts index 74f25735af..05e5aa400c 100644 --- a/sdk/constructive-react/src/auth/orm/models/principal.ts +++ b/sdk/constructive-react/src/auth/orm/models/principal.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'Principal', + fieldName: 'principals', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalModel { nodes?: InferSelectResult[]; }; }) => ({ - "principal": data.principals?.nodes?.[0] ?? null - }) + principal: data.principals?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - principalId: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + principalId: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principal: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Principal", "principals", args.select, { - where: { - principalId: { - equalTo: args.principalId - } + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + args.select, + { + where: { + principalId: { + equalTo: args.principalId, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalFilter", "PrincipalOrderBy", connectionFieldsMap); + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Principal", - fieldName: "principal", + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class PrincipalModel { nodes?: InferSelectResult[]; }; }) => ({ - "principal": data.principals?.nodes?.[0] ?? null - }) + principal: data.principals?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipal: { principal: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Principal", "createPrincipal", "principal", args.select, args.data, "CreatePrincipalInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'Principal', + fieldName: 'createPrincipal', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/principalEntity.ts b/sdk/constructive-react/src/auth/orm/models/principalEntity.ts index bb89e7c1ac..0c265501f5 100644 --- a/sdk/constructive-react/src/auth/orm/models/principalEntity.ts +++ b/sdk/constructive-react/src/auth/orm/models/principalEntity.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalEntityModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalEntity": data.principalEntities?.nodes?.[0] ?? null - }) + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalEntity: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalEntity", "principalEntities", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalEntityFilter", "PrincipalEntityOrderBy", connectionFieldsMap); + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalEntity", - fieldName: "principalEntity", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PrincipalEntityModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalEntity": data.principalEntities?.nodes?.[0] ?? null - }) + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalEntity: { principalEntity: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalEntity", "createPrincipalEntity", "principalEntity", args.select, args.data, "CreatePrincipalEntityInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'createPrincipalEntity', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'updatePrincipalEntity', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'deletePrincipalEntity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/principalScopeOverride.ts b/sdk/constructive-react/src/auth/orm/models/principalScopeOverride.ts index 44fc657725..3d3e7bedd3 100644 --- a/sdk/constructive-react/src/auth/orm/models/principalScopeOverride.ts +++ b/sdk/constructive-react/src/auth/orm/models/principalScopeOverride.ts @@ -3,56 +3,98 @@ * @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"; +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>; + 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); + 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", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverrides', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PrincipalScopeOverrideModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalScopeOverride": data.principalScopeOverrides?.nodes?.[0] ?? null - }) + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalScopeOverride: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalScopeOverride", "principalScopeOverrides", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalScopeOverrideFilter", "PrincipalScopeOverrideOrderBy", connectionFieldsMap); + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalScopeOverride", - fieldName: "principalScopeOverride", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PrincipalScopeOverrideModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalScopeOverride": data.principalScopeOverrides?.nodes?.[0] ?? null - }) + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalScopeOverride: { principalScopeOverride: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalScopeOverride", "createPrincipalScopeOverride", "principalScopeOverride", args.select, args.data, "CreatePrincipalScopeOverrideInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalScopeOverride', + fieldName: 'createPrincipalScopeOverride', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/roleType.ts b/sdk/constructive-react/src/auth/orm/models/roleType.ts index 9ad06fd49a..e8df4924bd 100644 --- a/sdk/constructive-react/src/auth/orm/models/roleType.ts +++ b/sdk/constructive-react/src/auth/orm/models/roleType.ts @@ -3,56 +3,96 @@ * @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 { RoleType, RoleTypeWithRelations, RoleTypeSelect, RoleTypeFilter, RoleTypeOrderBy, CreateRoleTypeInput, UpdateRoleTypeInput, RoleTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RoleType, + RoleTypeWithRelations, + RoleTypeSelect, + RoleTypeFilter, + RoleTypeOrderBy, + CreateRoleTypeInput, + UpdateRoleTypeInput, + RoleTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RoleTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ roleTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RoleType", "roleTypes", 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 - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RoleType', + 'roleTypes', + 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, + }, + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleTypes", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ roleType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RoleType", "roleTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RoleType', + 'roleTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleType", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RoleTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "roleType": data.roleTypes?.nodes?.[0] ?? null - }) + roleType: data.roleTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ roleType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RoleType", "roleTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RoleType', + 'roleTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleType", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RoleTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "roleType": data.roleTypes?.nodes?.[0] ?? null - }) + roleType: data.roleTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RoleType", "createRoleType", "roleType", args.select, args.data, "CreateRoleTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RoleType', + 'createRoleType', + 'roleType', + args.select, + args.data, + 'CreateRoleTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "createRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'createRoleType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: number; + }, + RoleTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RoleType", "updateRoleType", "roleType", args.select, args.where.id, args.data, "UpdateRoleTypeInput", "id", "roleTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RoleType', + 'updateRoleType', + 'roleType', + args.select, + args.where.id, + args.data, + 'UpdateRoleTypeInput', + 'id', + 'roleTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "updateRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'updateRoleType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: number; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: number; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RoleType", "deleteRoleType", "roleType", { - id: args.where.id - }, "DeleteRoleTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RoleType', + 'deleteRoleType', + 'roleType', + { + id: args.where.id, + }, + 'DeleteRoleTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "deleteRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'deleteRoleType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/user.ts b/sdk/constructive-react/src/auth/orm/models/user.ts index e1ba665fee..a35147a5ac 100644 --- a/sdk/constructive-react/src/auth/orm/models/user.ts +++ b/sdk/constructive-react/src/auth/orm/models/user.ts @@ -3,56 +3,96 @@ * @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 { User, UserWithRelations, UserSelect, UserFilter, UserOrderBy, CreateUserInput, UpdateUserInput, UserPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + User, + UserWithRelations, + UserSelect, + UserFilter, + UserOrderBy, + CreateUserInput, + UpdateUserInput, + UserPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ users: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("User", "users", 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 - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'User', + 'users', + 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, + }, + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "users", + operation: 'query', + operationName: 'User', + fieldName: 'users', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ user: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("User", "users", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'User', + 'users', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "user", + operation: 'query', + operationName: 'User', + fieldName: 'user', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserModel { nodes?: InferSelectResult[]; }; }) => ({ - "user": data.users?.nodes?.[0] ?? null - }) + user: data.users?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ user: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("User", "users", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'User', + 'users', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "user", + operation: 'query', + operationName: 'User', + fieldName: 'user', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserModel { nodes?: InferSelectResult[]; }; }) => ({ - "user": data.users?.nodes?.[0] ?? null - }) + user: data.users?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("User", "createUser", "user", args.select, args.data, "CreateUserInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'User', + 'createUser', + 'user', + args.select, + args.data, + 'CreateUserInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "createUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'createUser', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("User", "updateUser", "user", args.select, args.where.id, args.data, "UpdateUserInput", "id", "userPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'User', + 'updateUser', + 'user', + args.select, + args.where.id, + args.data, + 'UpdateUserInput', + 'id', + 'userPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "updateUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'updateUser', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("User", "deleteUser", "user", { - id: args.where.id - }, "DeleteUserInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'User', + 'deleteUser', + 'user', + { + id: args.where.id, + }, + 'DeleteUserInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "deleteUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'deleteUser', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/userConnectedAccount.ts b/sdk/constructive-react/src/auth/orm/models/userConnectedAccount.ts index a9666543ab..a2344afdf4 100644 --- a/sdk/constructive-react/src/auth/orm/models/userConnectedAccount.ts +++ b/sdk/constructive-react/src/auth/orm/models/userConnectedAccount.ts @@ -3,56 +3,98 @@ * @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 { UserConnectedAccount, UserConnectedAccountWithRelations, UserConnectedAccountSelect, UserConnectedAccountFilter, UserConnectedAccountOrderBy, CreateUserConnectedAccountInput, UpdateUserConnectedAccountInput, UserConnectedAccountPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserConnectedAccount, + UserConnectedAccountWithRelations, + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy, + CreateUserConnectedAccountInput, + UpdateUserConnectedAccountInput, + UserConnectedAccountPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserConnectedAccountModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - userConnectedAccounts: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + userConnectedAccounts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("UserConnectedAccount", "userConnectedAccounts", 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 - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + 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, + }, + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccounts", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccounts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userConnectedAccount: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserConnectedAccount", "userConnectedAccounts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccount", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccount', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class UserConnectedAccountModel { nodes?: InferSelectResult[]; }; }) => ({ - "userConnectedAccount": data.userConnectedAccounts?.nodes?.[0] ?? null - }) + userConnectedAccount: data.userConnectedAccounts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userConnectedAccount: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserConnectedAccount", "userConnectedAccounts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccount", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccount', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class UserConnectedAccountModel { nodes?: InferSelectResult[]; }; }) => ({ - "userConnectedAccount": data.userConnectedAccounts?.nodes?.[0] ?? null - }) + userConnectedAccount: data.userConnectedAccounts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserConnectedAccount: { userConnectedAccount: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserConnectedAccount", "createUserConnectedAccount", "userConnectedAccount", args.select, args.data, "CreateUserConnectedAccountInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserConnectedAccount', + 'createUserConnectedAccount', + 'userConnectedAccount', + args.select, + args.data, + 'CreateUserConnectedAccountInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserConnectedAccount", - fieldName: "createUserConnectedAccount", + operation: 'mutation', + operationName: 'UserConnectedAccount', + fieldName: 'createUserConnectedAccount', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/models/webauthnCredential.ts b/sdk/constructive-react/src/auth/orm/models/webauthnCredential.ts index 9760690ceb..bc31ef6a16 100644 --- a/sdk/constructive-react/src/auth/orm/models/webauthnCredential.ts +++ b/sdk/constructive-react/src/auth/orm/models/webauthnCredential.ts @@ -3,56 +3,96 @@ * @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 { WebauthnCredential, WebauthnCredentialWithRelations, WebauthnCredentialSelect, WebauthnCredentialFilter, WebauthnCredentialOrderBy, CreateWebauthnCredentialInput, UpdateWebauthnCredentialInput, WebauthnCredentialPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnCredential, + WebauthnCredentialWithRelations, + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy, + CreateWebauthnCredentialInput, + UpdateWebauthnCredentialInput, + WebauthnCredentialPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnCredentialModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentials: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredential", "webauthnCredentials", 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 - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnCredential', + 'webauthnCredentials', + 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, + }, + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredentials", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredentials', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredential: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnCredential", "webauthnCredentials", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnCredential', + 'webauthnCredentials', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredential", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredential', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnCredentialModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredential": data.webauthnCredentials?.nodes?.[0] ?? null - }) + webauthnCredential: data.webauthnCredentials?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredential: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredential", "webauthnCredentials", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnCredential', + 'webauthnCredentials', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredential", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredential', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnCredentialModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredential": data.webauthnCredentials?.nodes?.[0] ?? null - }) + webauthnCredential: data.webauthnCredentials?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnCredential", "createWebauthnCredential", "webauthnCredential", args.select, args.data, "CreateWebauthnCredentialInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnCredential', + 'createWebauthnCredential', + 'webauthnCredential', + args.select, + args.data, + 'CreateWebauthnCredentialInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "createWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'createWebauthnCredential', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnCredentialPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnCredential", "updateWebauthnCredential", "webauthnCredential", args.select, args.where.id, args.data, "UpdateWebauthnCredentialInput", "id", "webauthnCredentialPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnCredential', + 'updateWebauthnCredential', + 'webauthnCredential', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnCredentialInput', + 'id', + 'webauthnCredentialPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "updateWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'updateWebauthnCredential', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnCredential", "deleteWebauthnCredential", "webauthnCredential", { - id: args.where.id - }, "DeleteWebauthnCredentialInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnCredential', + 'deleteWebauthnCredential', + 'webauthnCredential', + { + id: args.where.id, + }, + 'DeleteWebauthnCredentialInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "deleteWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'deleteWebauthnCredential', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/mutation/index.ts b/sdk/constructive-react/src/auth/orm/mutation/index.ts index fcdc27d130..ae0973c7fb 100644 --- a/sdk/constructive-react/src/auth/orm/mutation/index.ts +++ b/sdk/constructive-react/src/auth/orm/mutation/index.ts @@ -3,11 +3,102 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { CheckPasswordInput, ConfirmDeleteAccountInput, CreateApiKeyInput, CreateOrgApiKeyInput, CreateOrgPrincipalInput, DeleteOrgPrincipalInput, DeletePrincipalInput, DisconnectAccountInput, ExtendTokenExpiresInput, ForgotPasswordInput, LinkIdentityInput, ProvisionBucketInput, ProvisionNewUserInput, RequestCrossOriginTokenInput, ResetPasswordInput, RevokeApiKeyInput, RevokeOrgApiKeyInput, RevokeSessionInput, SendAccountDeletionEmailInput, SendVerificationEmailInput, SetPasswordInput, SignInInput, SignInCrossOriginInput, SignInSmsOtpInput, SignOutInput, SignUpInput, SignUpSmsInput, VerifyEmailInput, VerifyPasswordInput, VerifyTotpInput, CheckPasswordPayload, ConfirmDeleteAccountPayload, CreateApiKeyPayload, CreateOrgApiKeyPayload, CreateOrgPrincipalPayload, DeleteOrgPrincipalPayload, DeletePrincipalPayload, DisconnectAccountPayload, ExtendTokenExpiresPayload, ForgotPasswordPayload, LinkIdentityPayload, ProvisionBucketPayload, ProvisionNewUserPayload, RequestCrossOriginTokenPayload, ResetPasswordPayload, RevokeApiKeyPayload, RevokeOrgApiKeyPayload, RevokeSessionPayload, SendAccountDeletionEmailPayload, SendVerificationEmailPayload, SetPasswordPayload, SignInPayload, SignInCrossOriginPayload, SignInSmsOtpPayload, SignOutPayload, SignUpPayload, SignUpSmsPayload, VerifyEmailPayload, VerifyPasswordPayload, VerifyTotpPayload, CheckPasswordPayloadSelect, ConfirmDeleteAccountPayloadSelect, CreateApiKeyPayloadSelect, CreateOrgApiKeyPayloadSelect, CreateOrgPrincipalPayloadSelect, DeleteOrgPrincipalPayloadSelect, DeletePrincipalPayloadSelect, DisconnectAccountPayloadSelect, ExtendTokenExpiresPayloadSelect, ForgotPasswordPayloadSelect, LinkIdentityPayloadSelect, ProvisionBucketPayloadSelect, ProvisionNewUserPayloadSelect, RequestCrossOriginTokenPayloadSelect, ResetPasswordPayloadSelect, RevokeApiKeyPayloadSelect, RevokeOrgApiKeyPayloadSelect, RevokeSessionPayloadSelect, SendAccountDeletionEmailPayloadSelect, SendVerificationEmailPayloadSelect, SetPasswordPayloadSelect, SignInPayloadSelect, SignInCrossOriginPayloadSelect, SignInSmsOtpPayloadSelect, SignOutPayloadSelect, SignUpPayloadSelect, SignUpSmsPayloadSelect, VerifyEmailPayloadSelect, VerifyPasswordPayloadSelect, VerifyTotpPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + CheckPasswordInput, + ConfirmDeleteAccountInput, + CreateApiKeyInput, + CreateOrgApiKeyInput, + CreateOrgPrincipalInput, + DeleteOrgPrincipalInput, + DeletePrincipalInput, + DisconnectAccountInput, + ExtendTokenExpiresInput, + ForgotPasswordInput, + LinkIdentityInput, + ProvisionBucketInput, + ProvisionNewUserInput, + RequestCrossOriginTokenInput, + ResetPasswordInput, + RevokeApiKeyInput, + RevokeOrgApiKeyInput, + RevokeSessionInput, + SendAccountDeletionEmailInput, + SendVerificationEmailInput, + SetPasswordInput, + SignInInput, + SignInCrossOriginInput, + SignInSmsOtpInput, + SignOutInput, + SignUpInput, + SignUpSmsInput, + VerifyEmailInput, + VerifyPasswordInput, + VerifyTotpInput, + CheckPasswordPayload, + ConfirmDeleteAccountPayload, + CreateApiKeyPayload, + CreateOrgApiKeyPayload, + CreateOrgPrincipalPayload, + DeleteOrgPrincipalPayload, + DeletePrincipalPayload, + DisconnectAccountPayload, + ExtendTokenExpiresPayload, + ForgotPasswordPayload, + LinkIdentityPayload, + ProvisionBucketPayload, + ProvisionNewUserPayload, + RequestCrossOriginTokenPayload, + ResetPasswordPayload, + RevokeApiKeyPayload, + RevokeOrgApiKeyPayload, + RevokeSessionPayload, + SendAccountDeletionEmailPayload, + SendVerificationEmailPayload, + SetPasswordPayload, + SignInPayload, + SignInCrossOriginPayload, + SignInSmsOtpPayload, + SignOutPayload, + SignUpPayload, + SignUpSmsPayload, + VerifyEmailPayload, + VerifyPasswordPayload, + VerifyTotpPayload, + CheckPasswordPayloadSelect, + ConfirmDeleteAccountPayloadSelect, + CreateApiKeyPayloadSelect, + CreateOrgApiKeyPayloadSelect, + CreateOrgPrincipalPayloadSelect, + DeleteOrgPrincipalPayloadSelect, + DeletePrincipalPayloadSelect, + DisconnectAccountPayloadSelect, + ExtendTokenExpiresPayloadSelect, + ForgotPasswordPayloadSelect, + LinkIdentityPayloadSelect, + ProvisionBucketPayloadSelect, + ProvisionNewUserPayloadSelect, + RequestCrossOriginTokenPayloadSelect, + ResetPasswordPayloadSelect, + RevokeApiKeyPayloadSelect, + RevokeOrgApiKeyPayloadSelect, + RevokeSessionPayloadSelect, + SendAccountDeletionEmailPayloadSelect, + SendVerificationEmailPayloadSelect, + SetPasswordPayloadSelect, + SignInPayloadSelect, + SignInCrossOriginPayloadSelect, + SignInSmsOtpPayloadSelect, + SignOutPayloadSelect, + SignUpPayloadSelect, + SignUpSmsPayloadSelect, + VerifyEmailPayloadSelect, + VerifyPasswordPayloadSelect, + VerifyTotpPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface CheckPasswordVariables { input: CheckPasswordInput; } @@ -107,425 +198,875 @@ export interface VerifyTotpVariables { } export function createMutationOperations(client: OrmClient) { return { - checkPassword: (args: CheckPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - checkPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CheckPassword", - fieldName: "checkPassword", - ...buildCustomDocument("mutation", "CheckPassword", "checkPassword", options.select, args, [{ - name: "input", - type: "CheckPasswordInput!" - }], connectionFieldsMap, "CheckPasswordPayload") - }), - confirmDeleteAccount: (args: ConfirmDeleteAccountVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - confirmDeleteAccount: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ConfirmDeleteAccount", - fieldName: "confirmDeleteAccount", - ...buildCustomDocument("mutation", "ConfirmDeleteAccount", "confirmDeleteAccount", options.select, args, [{ - name: "input", - type: "ConfirmDeleteAccountInput!" - }], connectionFieldsMap, "ConfirmDeleteAccountPayload") - }), - createApiKey: (args: CreateApiKeyVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - createApiKey: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CreateApiKey", - fieldName: "createApiKey", - ...buildCustomDocument("mutation", "CreateApiKey", "createApiKey", options.select, args, [{ - name: "input", - type: "CreateApiKeyInput!" - }], connectionFieldsMap, "CreateApiKeyPayload") - }), - 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") - }), - 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") - }), - 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") - }), - deletePrincipal: (args: DeletePrincipalVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - deletePrincipal: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "DeletePrincipal", - fieldName: "deletePrincipal", - ...buildCustomDocument("mutation", "DeletePrincipal", "deletePrincipal", options.select, args, [{ - name: "input", - type: "DeletePrincipalInput!" - }], connectionFieldsMap, "DeletePrincipalPayload") - }), - disconnectAccount: (args: DisconnectAccountVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - disconnectAccount: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "DisconnectAccount", - fieldName: "disconnectAccount", - ...buildCustomDocument("mutation", "DisconnectAccount", "disconnectAccount", options.select, args, [{ - name: "input", - type: "DisconnectAccountInput!" - }], connectionFieldsMap, "DisconnectAccountPayload") - }), - extendTokenExpires: (args: ExtendTokenExpiresVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - extendTokenExpires: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ExtendTokenExpires", - fieldName: "extendTokenExpires", - ...buildCustomDocument("mutation", "ExtendTokenExpires", "extendTokenExpires", options.select, args, [{ - name: "input", - type: "ExtendTokenExpiresInput!" - }], connectionFieldsMap, "ExtendTokenExpiresPayload") - }), - forgotPassword: (args: ForgotPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - forgotPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ForgotPassword", - fieldName: "forgotPassword", - ...buildCustomDocument("mutation", "ForgotPassword", "forgotPassword", options.select, args, [{ - name: "input", - type: "ForgotPasswordInput!" - }], connectionFieldsMap, "ForgotPasswordPayload") - }), - linkIdentity: (args: LinkIdentityVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - linkIdentity: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "LinkIdentity", - fieldName: "linkIdentity", - ...buildCustomDocument("mutation", "LinkIdentity", "linkIdentity", options.select, args, [{ - name: "input", - type: "LinkIdentityInput!" - }], connectionFieldsMap, "LinkIdentityPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - provisionNewUser: (args: ProvisionNewUserVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionNewUser: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionNewUser", - fieldName: "provisionNewUser", - ...buildCustomDocument("mutation", "ProvisionNewUser", "provisionNewUser", options.select, args, [{ - name: "input", - type: "ProvisionNewUserInput!" - }], connectionFieldsMap, "ProvisionNewUserPayload") - }), - requestCrossOriginToken: (args: RequestCrossOriginTokenVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - requestCrossOriginToken: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RequestCrossOriginToken", - fieldName: "requestCrossOriginToken", - ...buildCustomDocument("mutation", "RequestCrossOriginToken", "requestCrossOriginToken", options.select, args, [{ - name: "input", - type: "RequestCrossOriginTokenInput!" - }], connectionFieldsMap, "RequestCrossOriginTokenPayload") - }), - resetPassword: (args: ResetPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resetPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResetPassword", - fieldName: "resetPassword", - ...buildCustomDocument("mutation", "ResetPassword", "resetPassword", options.select, args, [{ - name: "input", - type: "ResetPasswordInput!" - }], connectionFieldsMap, "ResetPasswordPayload") - }), - revokeApiKey: (args: RevokeApiKeyVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - revokeApiKey: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RevokeApiKey", - fieldName: "revokeApiKey", - ...buildCustomDocument("mutation", "RevokeApiKey", "revokeApiKey", options.select, args, [{ - name: "input", - type: "RevokeApiKeyInput!" - }], connectionFieldsMap, "RevokeApiKeyPayload") - }), - 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") - }), - revokeSession: (args: RevokeSessionVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - revokeSession: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RevokeSession", - fieldName: "revokeSession", - ...buildCustomDocument("mutation", "RevokeSession", "revokeSession", options.select, args, [{ - name: "input", - type: "RevokeSessionInput!" - }], connectionFieldsMap, "RevokeSessionPayload") - }), - sendAccountDeletionEmail: (args: SendAccountDeletionEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - sendAccountDeletionEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SendAccountDeletionEmail", - fieldName: "sendAccountDeletionEmail", - ...buildCustomDocument("mutation", "SendAccountDeletionEmail", "sendAccountDeletionEmail", options.select, args, [{ - name: "input", - type: "SendAccountDeletionEmailInput!" - }], connectionFieldsMap, "SendAccountDeletionEmailPayload") - }), - sendVerificationEmail: (args: SendVerificationEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - sendVerificationEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SendVerificationEmail", - fieldName: "sendVerificationEmail", - ...buildCustomDocument("mutation", "SendVerificationEmail", "sendVerificationEmail", options.select, args, [{ - name: "input", - type: "SendVerificationEmailInput!" - }], connectionFieldsMap, "SendVerificationEmailPayload") - }), - setPassword: (args: SetPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetPassword", - fieldName: "setPassword", - ...buildCustomDocument("mutation", "SetPassword", "setPassword", options.select, args, [{ - name: "input", - type: "SetPasswordInput!" - }], connectionFieldsMap, "SetPasswordPayload") - }), - signIn: (args: SignInVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signIn: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignIn", - fieldName: "signIn", - ...buildCustomDocument("mutation", "SignIn", "signIn", options.select, args, [{ - name: "input", - type: "SignInInput!" - }], connectionFieldsMap, "SignInPayload") - }), - signInCrossOrigin: (args: SignInCrossOriginVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signInCrossOrigin: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignInCrossOrigin", - fieldName: "signInCrossOrigin", - ...buildCustomDocument("mutation", "SignInCrossOrigin", "signInCrossOrigin", options.select, args, [{ - name: "input", - type: "SignInCrossOriginInput!" - }], connectionFieldsMap, "SignInCrossOriginPayload") - }), - signInSmsOtp: (args: SignInSmsOtpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signInSmsOtp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignInSmsOtp", - fieldName: "signInSmsOtp", - ...buildCustomDocument("mutation", "SignInSmsOtp", "signInSmsOtp", options.select, args, [{ - name: "input", - type: "SignInSmsOtpInput!" - }], connectionFieldsMap, "SignInSmsOtpPayload") - }), - signOut: (args: SignOutVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signOut: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignOut", - fieldName: "signOut", - ...buildCustomDocument("mutation", "SignOut", "signOut", options.select, args, [{ - name: "input", - type: "SignOutInput!" - }], connectionFieldsMap, "SignOutPayload") - }), - signUp: (args: SignUpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signUp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignUp", - fieldName: "signUp", - ...buildCustomDocument("mutation", "SignUp", "signUp", options.select, args, [{ - name: "input", - type: "SignUpInput!" - }], connectionFieldsMap, "SignUpPayload") - }), - signUpSms: (args: SignUpSmsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signUpSms: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignUpSms", - fieldName: "signUpSms", - ...buildCustomDocument("mutation", "SignUpSms", "signUpSms", options.select, args, [{ - name: "input", - type: "SignUpSmsInput!" - }], connectionFieldsMap, "SignUpSmsPayload") - }), - verifyEmail: (args: VerifyEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyEmail", - fieldName: "verifyEmail", - ...buildCustomDocument("mutation", "VerifyEmail", "verifyEmail", options.select, args, [{ - name: "input", - type: "VerifyEmailInput!" - }], connectionFieldsMap, "VerifyEmailPayload") - }), - verifyPassword: (args: VerifyPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyPassword", - fieldName: "verifyPassword", - ...buildCustomDocument("mutation", "VerifyPassword", "verifyPassword", options.select, args, [{ - name: "input", - type: "VerifyPasswordInput!" - }], connectionFieldsMap, "VerifyPasswordPayload") - }), - verifyTotp: (args: VerifyTotpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyTotp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyTotp", - fieldName: "verifyTotp", - ...buildCustomDocument("mutation", "VerifyTotp", "verifyTotp", options.select, args, [{ - name: "input", - type: "VerifyTotpInput!" - }], connectionFieldsMap, "VerifyTotpPayload") - }) + checkPassword: ( + args: CheckPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + checkPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CheckPassword', + fieldName: 'checkPassword', + ...buildCustomDocument( + 'mutation', + 'CheckPassword', + 'checkPassword', + options.select, + args, + [ + { + name: 'input', + type: 'CheckPasswordInput!', + }, + ], + connectionFieldsMap, + 'CheckPasswordPayload' + ), + }), + confirmDeleteAccount: ( + args: ConfirmDeleteAccountVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + confirmDeleteAccount: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ConfirmDeleteAccount', + fieldName: 'confirmDeleteAccount', + ...buildCustomDocument( + 'mutation', + 'ConfirmDeleteAccount', + 'confirmDeleteAccount', + options.select, + args, + [ + { + name: 'input', + type: 'ConfirmDeleteAccountInput!', + }, + ], + connectionFieldsMap, + 'ConfirmDeleteAccountPayload' + ), + }), + createApiKey: ( + args: CreateApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateApiKey', + fieldName: 'createApiKey', + ...buildCustomDocument( + 'mutation', + 'CreateApiKey', + 'createApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'CreateApiKeyInput!', + }, + ], + connectionFieldsMap, + 'CreateApiKeyPayload' + ), + }), + 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' + ), + }), + 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' + ), + }), + 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' + ), + }), + deletePrincipal: ( + args: DeletePrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + deletePrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DeletePrincipal', + fieldName: 'deletePrincipal', + ...buildCustomDocument( + 'mutation', + 'DeletePrincipal', + 'deletePrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'DeletePrincipalInput!', + }, + ], + connectionFieldsMap, + 'DeletePrincipalPayload' + ), + }), + disconnectAccount: ( + args: DisconnectAccountVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + disconnectAccount: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DisconnectAccount', + fieldName: 'disconnectAccount', + ...buildCustomDocument( + 'mutation', + 'DisconnectAccount', + 'disconnectAccount', + options.select, + args, + [ + { + name: 'input', + type: 'DisconnectAccountInput!', + }, + ], + connectionFieldsMap, + 'DisconnectAccountPayload' + ), + }), + extendTokenExpires: ( + args: ExtendTokenExpiresVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + extendTokenExpires: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ExtendTokenExpires', + fieldName: 'extendTokenExpires', + ...buildCustomDocument( + 'mutation', + 'ExtendTokenExpires', + 'extendTokenExpires', + options.select, + args, + [ + { + name: 'input', + type: 'ExtendTokenExpiresInput!', + }, + ], + connectionFieldsMap, + 'ExtendTokenExpiresPayload' + ), + }), + forgotPassword: ( + args: ForgotPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + forgotPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ForgotPassword', + fieldName: 'forgotPassword', + ...buildCustomDocument( + 'mutation', + 'ForgotPassword', + 'forgotPassword', + options.select, + args, + [ + { + name: 'input', + type: 'ForgotPasswordInput!', + }, + ], + connectionFieldsMap, + 'ForgotPasswordPayload' + ), + }), + linkIdentity: ( + args: LinkIdentityVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + linkIdentity: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'LinkIdentity', + fieldName: 'linkIdentity', + ...buildCustomDocument( + 'mutation', + 'LinkIdentity', + 'linkIdentity', + options.select, + args, + [ + { + name: 'input', + type: 'LinkIdentityInput!', + }, + ], + connectionFieldsMap, + 'LinkIdentityPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + provisionNewUser: ( + args: ProvisionNewUserVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionNewUser: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionNewUser', + fieldName: 'provisionNewUser', + ...buildCustomDocument( + 'mutation', + 'ProvisionNewUser', + 'provisionNewUser', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionNewUserInput!', + }, + ], + connectionFieldsMap, + 'ProvisionNewUserPayload' + ), + }), + requestCrossOriginToken: ( + args: RequestCrossOriginTokenVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + requestCrossOriginToken: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RequestCrossOriginToken', + fieldName: 'requestCrossOriginToken', + ...buildCustomDocument( + 'mutation', + 'RequestCrossOriginToken', + 'requestCrossOriginToken', + options.select, + args, + [ + { + name: 'input', + type: 'RequestCrossOriginTokenInput!', + }, + ], + connectionFieldsMap, + 'RequestCrossOriginTokenPayload' + ), + }), + resetPassword: ( + args: ResetPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resetPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResetPassword', + fieldName: 'resetPassword', + ...buildCustomDocument( + 'mutation', + 'ResetPassword', + 'resetPassword', + options.select, + args, + [ + { + name: 'input', + type: 'ResetPasswordInput!', + }, + ], + connectionFieldsMap, + 'ResetPasswordPayload' + ), + }), + revokeApiKey: ( + args: RevokeApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeApiKey', + fieldName: 'revokeApiKey', + ...buildCustomDocument( + 'mutation', + 'RevokeApiKey', + 'revokeApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeApiKeyInput!', + }, + ], + connectionFieldsMap, + 'RevokeApiKeyPayload' + ), + }), + 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' + ), + }), + revokeSession: ( + args: RevokeSessionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeSession: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeSession', + fieldName: 'revokeSession', + ...buildCustomDocument( + 'mutation', + 'RevokeSession', + 'revokeSession', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeSessionInput!', + }, + ], + connectionFieldsMap, + 'RevokeSessionPayload' + ), + }), + sendAccountDeletionEmail: ( + args: SendAccountDeletionEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + sendAccountDeletionEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SendAccountDeletionEmail', + fieldName: 'sendAccountDeletionEmail', + ...buildCustomDocument( + 'mutation', + 'SendAccountDeletionEmail', + 'sendAccountDeletionEmail', + options.select, + args, + [ + { + name: 'input', + type: 'SendAccountDeletionEmailInput!', + }, + ], + connectionFieldsMap, + 'SendAccountDeletionEmailPayload' + ), + }), + sendVerificationEmail: ( + args: SendVerificationEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + sendVerificationEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SendVerificationEmail', + fieldName: 'sendVerificationEmail', + ...buildCustomDocument( + 'mutation', + 'SendVerificationEmail', + 'sendVerificationEmail', + options.select, + args, + [ + { + name: 'input', + type: 'SendVerificationEmailInput!', + }, + ], + connectionFieldsMap, + 'SendVerificationEmailPayload' + ), + }), + setPassword: ( + args: SetPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetPassword', + fieldName: 'setPassword', + ...buildCustomDocument( + 'mutation', + 'SetPassword', + 'setPassword', + options.select, + args, + [ + { + name: 'input', + type: 'SetPasswordInput!', + }, + ], + connectionFieldsMap, + 'SetPasswordPayload' + ), + }), + signIn: ( + args: SignInVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signIn: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignIn', + fieldName: 'signIn', + ...buildCustomDocument( + 'mutation', + 'SignIn', + 'signIn', + options.select, + args, + [ + { + name: 'input', + type: 'SignInInput!', + }, + ], + connectionFieldsMap, + 'SignInPayload' + ), + }), + signInCrossOrigin: ( + args: SignInCrossOriginVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signInCrossOrigin: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignInCrossOrigin', + fieldName: 'signInCrossOrigin', + ...buildCustomDocument( + 'mutation', + 'SignInCrossOrigin', + 'signInCrossOrigin', + options.select, + args, + [ + { + name: 'input', + type: 'SignInCrossOriginInput!', + }, + ], + connectionFieldsMap, + 'SignInCrossOriginPayload' + ), + }), + signInSmsOtp: ( + args: SignInSmsOtpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signInSmsOtp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignInSmsOtp', + fieldName: 'signInSmsOtp', + ...buildCustomDocument( + 'mutation', + 'SignInSmsOtp', + 'signInSmsOtp', + options.select, + args, + [ + { + name: 'input', + type: 'SignInSmsOtpInput!', + }, + ], + connectionFieldsMap, + 'SignInSmsOtpPayload' + ), + }), + signOut: ( + args: SignOutVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signOut: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignOut', + fieldName: 'signOut', + ...buildCustomDocument( + 'mutation', + 'SignOut', + 'signOut', + options.select, + args, + [ + { + name: 'input', + type: 'SignOutInput!', + }, + ], + connectionFieldsMap, + 'SignOutPayload' + ), + }), + signUp: ( + args: SignUpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signUp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignUp', + fieldName: 'signUp', + ...buildCustomDocument( + 'mutation', + 'SignUp', + 'signUp', + options.select, + args, + [ + { + name: 'input', + type: 'SignUpInput!', + }, + ], + connectionFieldsMap, + 'SignUpPayload' + ), + }), + signUpSms: ( + args: SignUpSmsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signUpSms: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignUpSms', + fieldName: 'signUpSms', + ...buildCustomDocument( + 'mutation', + 'SignUpSms', + 'signUpSms', + options.select, + args, + [ + { + name: 'input', + type: 'SignUpSmsInput!', + }, + ], + connectionFieldsMap, + 'SignUpSmsPayload' + ), + }), + verifyEmail: ( + args: VerifyEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyEmail', + fieldName: 'verifyEmail', + ...buildCustomDocument( + 'mutation', + 'VerifyEmail', + 'verifyEmail', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyEmailInput!', + }, + ], + connectionFieldsMap, + 'VerifyEmailPayload' + ), + }), + verifyPassword: ( + args: VerifyPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyPassword', + fieldName: 'verifyPassword', + ...buildCustomDocument( + 'mutation', + 'VerifyPassword', + 'verifyPassword', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyPasswordInput!', + }, + ], + connectionFieldsMap, + 'VerifyPasswordPayload' + ), + }), + verifyTotp: ( + args: VerifyTotpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyTotp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyTotp', + fieldName: 'verifyTotp', + ...buildCustomDocument( + 'mutation', + 'VerifyTotp', + 'verifyTotp', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyTotpInput!', + }, + ], + connectionFieldsMap, + 'VerifyTotpPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/query-builder.ts b/sdk/constructive-react/src/auth/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/auth/orm/query-builder.ts +++ b/sdk/constructive-react/src/auth/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/auth/orm/query/index.ts b/sdk/constructive-react/src/auth/orm/query/index.ts index 5a555d9687..d13999f7b4 100644 --- a/sdk/constructive-react/src/auth/orm/query/index.ts +++ b/sdk/constructive-react/src/auth/orm/query/index.ts @@ -3,73 +3,124 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { User, UserSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { User, UserSelect } from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface RequireStepUpVariables { stepUpType?: string; } export function createQueryOperations(client: OrmClient) { return { - currentIpAddress: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentIpAddress: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentIpAddress", - fieldName: "currentIpAddress", - ...buildCustomDocument("query", "CurrentIpAddress", "currentIpAddress", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - currentUser: (options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - currentUser: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "CurrentUser", - fieldName: "currentUser", - ...buildCustomDocument("query", "CurrentUser", "currentUser", options.select, undefined, [], connectionFieldsMap, "User") - }), - currentUserAgent: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentUserAgent: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentUserAgent", - fieldName: "currentUserAgent", - ...buildCustomDocument("query", "CurrentUserAgent", "currentUserAgent", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - currentUserId: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentUserId: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentUserId", - fieldName: "currentUserId", - ...buildCustomDocument("query", "CurrentUserId", "currentUserId", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - requireStepUp: (args: RequireStepUpVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - requireStepUp: boolean | null; - }>({ - client, - operation: "query", - operationName: "RequireStepUp", - fieldName: "requireStepUp", - ...buildCustomDocument("query", "RequireStepUp", "requireStepUp", options?.select, args, [{ - name: "stepUpType", - type: "String" - }], connectionFieldsMap, undefined) - }) + currentIpAddress: (options?: { select?: Record }) => + new QueryBuilder<{ + currentIpAddress: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentIpAddress', + fieldName: 'currentIpAddress', + ...buildCustomDocument( + 'query', + 'CurrentIpAddress', + 'currentIpAddress', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + currentUser: ( + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + currentUser: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUser', + fieldName: 'currentUser', + ...buildCustomDocument( + 'query', + 'CurrentUser', + 'currentUser', + options.select, + undefined, + [], + connectionFieldsMap, + 'User' + ), + }), + currentUserAgent: (options?: { select?: Record }) => + new QueryBuilder<{ + currentUserAgent: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUserAgent', + fieldName: 'currentUserAgent', + ...buildCustomDocument( + 'query', + 'CurrentUserAgent', + 'currentUserAgent', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + currentUserId: (options?: { select?: Record }) => + new QueryBuilder<{ + currentUserId: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUserId', + fieldName: 'currentUserId', + ...buildCustomDocument( + 'query', + 'CurrentUserId', + 'currentUserId', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + requireStepUp: ( + args: RequireStepUpVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + requireStepUp: boolean | null; + }>({ + client, + operation: 'query', + operationName: 'RequireStepUp', + fieldName: 'requireStepUp', + ...buildCustomDocument( + 'query', + 'RequireStepUp', + 'requireStepUp', + options?.select, + args, + [ + { + name: 'stepUpType', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/orm/realtime.ts b/sdk/constructive-react/src/auth/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/auth/orm/realtime.ts +++ b/sdk/constructive-react/src/auth/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/auth/orm/select-types.ts b/sdk/constructive-react/src/auth/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/auth/orm/select-types.ts +++ b/sdk/constructive-react/src/auth/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/auth/schema-types.ts b/sdk/constructive-react/src/auth/schema-types.ts index 592ca35da0..efbac343f6 100644 --- a/sdk/constructive-react/src/auth/schema-types.ts +++ b/sdk/constructive-react/src/auth/schema-types.ts @@ -4,37 +4,317 @@ * DO NOT EDIT - changes will be overwritten */ -import type { AuditLogAuth, CryptoAddress, Email, IdentityProvider, OrgApiKeyList, PhoneNumber, Principal, PrincipalEntity, PrincipalScopeOverride, RoleType, User, UserConnectedAccount, WebauthnCredential, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + AuditLogAuth, + CryptoAddress, + Email, + IdentityProvider, + OrgApiKeyList, + PhoneNumber, + Principal, + PrincipalEntity, + PrincipalScopeOverride, + RoleType, + User, + UserConnectedAccount, + WebauthnCredential, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; export type Base64EncodedBinary = unknown; export type ConstructiveInternalTypeEmail = unknown; export type ConstructiveInternalTypeImage = unknown; export type ConstructiveInternalTypeOrigin = unknown; /** Methods to use when ordering `AuditLogAuth`. */ -export type AuditLogAuthOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_ASC" | "EVENT_DESC" | "ID_ASC" | "ID_DESC" | "IP_ADDRESS_ASC" | "IP_ADDRESS_DESC" | "NATURAL" | "ORIGIN_ASC" | "ORIGIN_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "USER_AGENT_ASC" | "USER_AGENT_DESC"; +export type AuditLogAuthOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IP_ADDRESS_ASC' + | 'IP_ADDRESS_DESC' + | 'NATURAL' + | 'ORIGIN_ASC' + | 'ORIGIN_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'USER_AGENT_ASC' + | 'USER_AGENT_DESC'; /** Methods to use when ordering `CryptoAddress`. */ -export type CryptoAddressOrderBy = "ADDRESS_ASC" | "ADDRESS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type CryptoAddressOrderBy = + | 'ADDRESS_ASC' + | 'ADDRESS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Email`. */ -export type EmailOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type EmailOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `IdentityProvider`. */ -export type IdentityProviderOrderBy = "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "ENABLED_ASC" | "ENABLED_DESC" | "KIND_ASC" | "KIND_DESC" | "NATURAL" | "SLUG_ASC" | "SLUG_DESC"; +export type IdentityProviderOrderBy = + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'ENABLED_ASC' + | 'ENABLED_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'NATURAL' + | 'SLUG_ASC' + | 'SLUG_DESC'; /** Methods to use when ordering `OrgApiKeyList`. */ -export type OrgApiKeyListOrderBy = "ACCESS_LEVEL_ASC" | "ACCESS_LEVEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "KEY_ID_ASC" | "KEY_ID_DESC" | "LAST_USED_AT_ASC" | "LAST_USED_AT_DESC" | "MFA_LEVEL_ASC" | "MFA_LEVEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "ORG_ID_ASC" | "ORG_ID_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "REVOKED_AT_ASC" | "REVOKED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type OrgApiKeyListOrderBy = + | 'ACCESS_LEVEL_ASC' + | 'ACCESS_LEVEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KEY_ID_ASC' + | 'KEY_ID_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'MFA_LEVEL_ASC' + | 'MFA_LEVEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'ORG_ID_ASC' + | 'ORG_ID_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'REVOKED_AT_ASC' + | 'REVOKED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PhoneNumber`. */ -export type PhoneNumberOrderBy = "CC_ASC" | "CC_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUMBER_ASC" | "NUMBER_DESC" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PhoneNumberOrderBy = + | 'CC_ASC' + | 'CC_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUMBER_ASC' + | 'NUMBER_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PrincipalEntity`. */ -export type PrincipalEntityOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PrincipalEntityOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Principal`. */ -export type PrincipalOrderBy = "BYPASS_STEP_UP_ASC" | "BYPASS_STEP_UP_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_ID_ASC" | "USER_ID_DESC" | "USE_ADMIN_OWNER_ASC" | "USE_ADMIN_OWNER_DESC"; +export type PrincipalOrderBy = + | 'BYPASS_STEP_UP_ASC' + | 'BYPASS_STEP_UP_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_ID_ASC' + | 'USER_ID_DESC' + | 'USE_ADMIN_OWNER_ASC' + | 'USE_ADMIN_OWNER_DESC'; /** Methods to use when ordering `PrincipalScopeOverride`. */ -export type PrincipalScopeOverrideOrderBy = "ALLOWED_MASK_ASC" | "ALLOWED_MASK_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "MEMBERSHIP_TYPE_ASC" | "MEMBERSHIP_TYPE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USE_ADMIN_OWNER_ASC" | "USE_ADMIN_OWNER_DESC"; +export type PrincipalScopeOverrideOrderBy = + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'MEMBERSHIP_TYPE_ASC' + | 'MEMBERSHIP_TYPE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USE_ADMIN_OWNER_ASC' + | 'USE_ADMIN_OWNER_DESC'; /** Methods to use when ordering `RoleType`. */ -export type RoleTypeOrderBy = "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type RoleTypeOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `UserConnectedAccount`. */ -export type UserConnectedAccountOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DETAILS_ASC" | "DETAILS_DESC" | "IDENTIFIER_ASC" | "IDENTIFIER_DESC" | "ID_ASC" | "ID_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "SERVICE_ASC" | "SERVICE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type UserConnectedAccountOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DETAILS_ASC' + | 'DETAILS_DESC' + | 'IDENTIFIER_ASC' + | 'IDENTIFIER_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'SERVICE_ASC' + | 'SERVICE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `User`. */ -export type UserOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "DISPLAY_NAME_TRGM_SIMILARITY_ASC" | "DISPLAY_NAME_TRGM_SIMILARITY_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_PICTURE_ASC" | "PROFILE_PICTURE_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "SEARCH_TSV_ASC" | "SEARCH_TSV_DESC" | "SEARCH_TSV_RANK_ASC" | "SEARCH_TSV_RANK_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USERNAME_ASC" | "USERNAME_DESC"; +export type UserOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'DISPLAY_NAME_TRGM_SIMILARITY_ASC' + | 'DISPLAY_NAME_TRGM_SIMILARITY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_PICTURE_ASC' + | 'PROFILE_PICTURE_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'SEARCH_TSV_ASC' + | 'SEARCH_TSV_DESC' + | 'SEARCH_TSV_RANK_ASC' + | 'SEARCH_TSV_RANK_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USERNAME_ASC' + | 'USERNAME_DESC'; /** Methods to use when ordering `WebauthnCredential`. */ -export type WebauthnCredentialOrderBy = "BACKUP_ELIGIBLE_ASC" | "BACKUP_ELIGIBLE_DESC" | "BACKUP_STATE_ASC" | "BACKUP_STATE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREDENTIAL_DEVICE_TYPE_ASC" | "CREDENTIAL_DEVICE_TYPE_DESC" | "CREDENTIAL_ID_ASC" | "CREDENTIAL_ID_DESC" | "ID_ASC" | "ID_DESC" | "LAST_USED_AT_ASC" | "LAST_USED_AT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PUBLIC_KEY_ASC" | "PUBLIC_KEY_DESC" | "SIGN_COUNT_ASC" | "SIGN_COUNT_DESC" | "TRANSPORTS_ASC" | "TRANSPORTS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WEBAUTHN_USER_ID_ASC" | "WEBAUTHN_USER_ID_DESC"; +export type WebauthnCredentialOrderBy = + | 'BACKUP_ELIGIBLE_ASC' + | 'BACKUP_ELIGIBLE_DESC' + | 'BACKUP_STATE_ASC' + | 'BACKUP_STATE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREDENTIAL_DEVICE_TYPE_ASC' + | 'CREDENTIAL_DEVICE_TYPE_DESC' + | 'CREDENTIAL_ID_ASC' + | 'CREDENTIAL_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PUBLIC_KEY_ASC' + | 'PUBLIC_KEY_DESC' + | 'SIGN_COUNT_ASC' + | 'SIGN_COUNT_DESC' + | 'TRANSPORTS_ASC' + | 'TRANSPORTS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WEBAUTHN_USER_ID_ASC' + | 'WEBAUTHN_USER_ID_DESC'; /** A filter to be used against `AuditLogAuth` object types. All fields are combined with a logical ‘and.’ */ export interface AuditLogAuthFilter { /** Filter by the object’s `actor` relation. */ @@ -2133,4 +2413,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/auth/types.ts b/sdk/constructive-react/src/auth/types.ts index acc52cc536..c3ee09df88 100644 --- a/sdk/constructive-react/src/auth/types.ts +++ b/sdk/constructive-react/src/auth/types.ts @@ -364,4 +364,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/hooks/client.ts b/sdk/constructive-react/src/compute/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/compute/hooks/client.ts +++ b/sdk/constructive-react/src/compute/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/compute/hooks/index.ts b/sdk/constructive-react/src/compute/hooks/index.ts index 9f9b44e0d0..325c296880 100644 --- a/sdk/constructive-react/src/compute/hooks/index.ts +++ b/sdk/constructive-react/src/compute/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: DbPreset, FunctionApiBinding, FunctionDefinition, FunctionDeployment, FunctionDeploymentEvent, FunctionExecutionLog, FunctionGraphCommit, FunctionGraph, FunctionGraphExecution, FunctionGraphExecutionNodeState, FunctionGraphExecutionOutput, FunctionGraphObject, FunctionGraphRef, FunctionGraphStore, FunctionInvocationAttempt, FunctionInvocation, GetAllTreeNodesRecord, InfraCommit, InfraGetAllTreeNodesRecord, InfraObject, InfraRef, InfraStore, IntegrationProvider, Namespace, NamespaceEvent, PlatformFunctionApiBinding, PlatformFunctionDefinition, PlatformFunctionDeployment, PlatformFunctionDeploymentEvent, PlatformFunctionExecutionLog, PlatformFunctionInvocationAttempt, PlatformFunctionInvocation, PlatformInfraCommit, PlatformInfraGetAllTreeNodesRecord, PlatformInfraObject, PlatformInfraRef, PlatformInfraStore, PlatformNamespace, PlatformNamespaceEvent, PlatformResource, PlatformResourceDeclaredCapacity, PlatformResourceDefinition, PlatformResourceEvent, PlatformResourceInstallation, PlatformResourceStatusCheck, PlatformResourceUsageLog, PlatformResourceUsageSummary, PlatformResourceUtilization, PlatformResourcesHealth, PlatformResourcesRequirementsState, PlatformResourcesResolvedRequirement, PlatformWebhookEndpoint, PlatformWebhookEvent, Resource, ResourceDeclaredCapacity, ResourceDefinition, ResourceEvent, ResourceInstallation, ResourceStatusCheck, ResourceUsageLog, ResourceUsageSummary, ResourceUtilization, ResourcesHealth, ResourcesRequirementsState, ResourcesResolvedRequirement, WebhookEndpoint, WebhookEvent - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/compute/hooks/invalidation.ts b/sdk/constructive-react/src/compute/hooks/invalidation.ts index 7aa3451fd3..bbd9940b4f 100644 --- a/sdk/constructive-react/src/compute/hooks/invalidation.ts +++ b/sdk/constructive-react/src/compute/hooks/invalidation.ts @@ -13,8 +13,76 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { dbPresetKeys, functionApiBindingKeys, functionDefinitionKeys, functionDeploymentKeys, functionDeploymentEventKeys, functionExecutionLogKeys, functionGraphCommitKeys, functionGraphKeys, functionGraphExecutionKeys, functionGraphExecutionNodeStateKeys, functionGraphExecutionOutputKeys, functionGraphObjectKeys, functionGraphRefKeys, functionGraphStoreKeys, functionInvocationAttemptKeys, functionInvocationKeys, getAllTreeNodesRecordKeys, infraCommitKeys, infraGetAllTreeNodesRecordKeys, infraObjectKeys, infraRefKeys, infraStoreKeys, integrationProviderKeys, namespaceKeys, namespaceEventKeys, platformFunctionApiBindingKeys, platformFunctionDefinitionKeys, platformFunctionDeploymentKeys, platformFunctionDeploymentEventKeys, platformFunctionExecutionLogKeys, platformFunctionInvocationAttemptKeys, platformFunctionInvocationKeys, platformInfraCommitKeys, platformInfraGetAllTreeNodesRecordKeys, platformInfraObjectKeys, platformInfraRefKeys, platformInfraStoreKeys, platformNamespaceKeys, platformNamespaceEventKeys, platformResourceKeys, platformResourceDeclaredCapacityKeys, platformResourceDefinitionKeys, platformResourceEventKeys, platformResourceInstallationKeys, platformResourceStatusCheckKeys, platformResourceUsageLogKeys, platformResourceUsageSummaryKeys, platformResourceUtilizationKeys, platformResourcesHealthKeys, platformResourcesRequirementsStateKeys, platformResourcesResolvedRequirementKeys, platformWebhookEndpointKeys, platformWebhookEventKeys, resourceKeys, resourceDeclaredCapacityKeys, resourceDefinitionKeys, resourceEventKeys, resourceInstallationKeys, resourceStatusCheckKeys, resourceUsageLogKeys, resourceUsageSummaryKeys, resourceUtilizationKeys, resourcesHealthKeys, resourcesRequirementsStateKeys, resourcesResolvedRequirementKeys, webhookEndpointKeys, webhookEventKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + dbPresetKeys, + functionApiBindingKeys, + functionDefinitionKeys, + functionDeploymentKeys, + functionDeploymentEventKeys, + functionExecutionLogKeys, + functionGraphCommitKeys, + functionGraphKeys, + functionGraphExecutionKeys, + functionGraphExecutionNodeStateKeys, + functionGraphExecutionOutputKeys, + functionGraphObjectKeys, + functionGraphRefKeys, + functionGraphStoreKeys, + functionInvocationAttemptKeys, + functionInvocationKeys, + getAllTreeNodesRecordKeys, + infraCommitKeys, + infraGetAllTreeNodesRecordKeys, + infraObjectKeys, + infraRefKeys, + infraStoreKeys, + integrationProviderKeys, + namespaceKeys, + namespaceEventKeys, + platformFunctionApiBindingKeys, + platformFunctionDefinitionKeys, + platformFunctionDeploymentKeys, + platformFunctionDeploymentEventKeys, + platformFunctionExecutionLogKeys, + platformFunctionInvocationAttemptKeys, + platformFunctionInvocationKeys, + platformInfraCommitKeys, + platformInfraGetAllTreeNodesRecordKeys, + platformInfraObjectKeys, + platformInfraRefKeys, + platformInfraStoreKeys, + platformNamespaceKeys, + platformNamespaceEventKeys, + platformResourceKeys, + platformResourceDeclaredCapacityKeys, + platformResourceDefinitionKeys, + platformResourceEventKeys, + platformResourceInstallationKeys, + platformResourceStatusCheckKeys, + platformResourceUsageLogKeys, + platformResourceUsageSummaryKeys, + platformResourceUtilizationKeys, + platformResourcesHealthKeys, + platformResourcesRequirementsStateKeys, + platformResourcesResolvedRequirementKeys, + platformWebhookEndpointKeys, + platformWebhookEventKeys, + resourceKeys, + resourceDeclaredCapacityKeys, + resourceDefinitionKeys, + resourceEventKeys, + resourceInstallationKeys, + resourceStatusCheckKeys, + resourceUsageLogKeys, + resourceUsageSummaryKeys, + resourceUtilizationKeys, + resourcesHealthKeys, + resourcesRequirementsStateKeys, + resourcesResolvedRequirementKeys, + webhookEndpointKeys, + webhookEventKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,743 +103,1161 @@ import { dbPresetKeys, functionApiBindingKeys, functionDefinitionKeys, functionD * ``` */ export const invalidate = { - /** Invalidate dbPreset queries */dbPreset: { - /** Invalidate all dbPreset queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPresetKeys.all - }), - /** Invalidate dbPreset list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPresetKeys.lists() - }), - /** Invalidate a specific dbPreset */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: dbPresetKeys.detail(id) - }) - }, - /** Invalidate functionApiBinding queries */functionApiBinding: { - /** Invalidate all functionApiBinding queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionApiBindingKeys.all - }), - /** Invalidate functionApiBinding list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionApiBindingKeys.lists() - }), - /** Invalidate a specific functionApiBinding */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionApiBindingKeys.detail(id) - }) - }, - /** Invalidate functionDefinition queries */functionDefinition: { - /** Invalidate all functionDefinition queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionDefinitionKeys.all - }), - /** Invalidate functionDefinition list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionDefinitionKeys.lists() - }), - /** Invalidate a specific functionDefinition */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionDefinitionKeys.detail(id) - }) - }, - /** Invalidate functionDeployment queries */functionDeployment: { - /** Invalidate all functionDeployment queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionDeploymentKeys.all - }), - /** Invalidate functionDeployment list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionDeploymentKeys.lists() - }), - /** Invalidate a specific functionDeployment */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionDeploymentKeys.detail(id) - }) - }, - /** Invalidate functionDeploymentEvent queries */functionDeploymentEvent: { - /** Invalidate all functionDeploymentEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionDeploymentEventKeys.all - }), - /** Invalidate functionDeploymentEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionDeploymentEventKeys.lists() - }), - /** Invalidate a specific functionDeploymentEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionDeploymentEventKeys.detail(id) - }) - }, - /** Invalidate functionExecutionLog queries */functionExecutionLog: { - /** Invalidate all functionExecutionLog queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionExecutionLogKeys.all - }), - /** Invalidate functionExecutionLog list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionExecutionLogKeys.lists() - }), - /** Invalidate a specific functionExecutionLog */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionExecutionLogKeys.detail(id) - }) - }, - /** Invalidate functionGraphCommit queries */functionGraphCommit: { - /** Invalidate all functionGraphCommit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphCommitKeys.all - }), - /** Invalidate functionGraphCommit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphCommitKeys.lists() - }), - /** Invalidate a specific functionGraphCommit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionGraphCommitKeys.detail(id) - }) - }, - /** Invalidate functionGraph queries */functionGraph: { - /** Invalidate all functionGraph queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphKeys.all - }), - /** Invalidate functionGraph list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphKeys.lists() - }), - /** Invalidate a specific functionGraph */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionGraphKeys.detail(id) - }) - }, - /** Invalidate functionGraphExecution queries */functionGraphExecution: { - /** Invalidate all functionGraphExecution queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionKeys.all - }), - /** Invalidate functionGraphExecution list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionKeys.lists() - }), - /** Invalidate a specific functionGraphExecution */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionKeys.detail(id) - }) - }, - /** Invalidate functionGraphExecutionNodeState queries */functionGraphExecutionNodeState: { - /** Invalidate all functionGraphExecutionNodeState queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.all - }), - /** Invalidate functionGraphExecutionNodeState list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.lists() - }), - /** Invalidate a specific functionGraphExecutionNodeState */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.detail(id) - }) - }, - /** Invalidate functionGraphExecutionOutput queries */functionGraphExecutionOutput: { - /** Invalidate all functionGraphExecutionOutput queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionOutputKeys.all - }), - /** Invalidate functionGraphExecutionOutput list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionOutputKeys.lists() - }), - /** Invalidate a specific functionGraphExecutionOutput */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionOutputKeys.detail(id) - }) - }, - /** Invalidate functionGraphObject queries */functionGraphObject: { - /** Invalidate all functionGraphObject queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphObjectKeys.all - }), - /** Invalidate functionGraphObject list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphObjectKeys.lists() - }), - /** Invalidate a specific functionGraphObject */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionGraphObjectKeys.detail(id) - }) - }, - /** Invalidate functionGraphRef queries */functionGraphRef: { - /** Invalidate all functionGraphRef queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphRefKeys.all - }), - /** Invalidate functionGraphRef list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphRefKeys.lists() - }), - /** Invalidate a specific functionGraphRef */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionGraphRefKeys.detail(id) - }) - }, - /** Invalidate functionGraphStore queries */functionGraphStore: { - /** Invalidate all functionGraphStore queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphStoreKeys.all - }), - /** Invalidate functionGraphStore list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphStoreKeys.lists() - }), - /** Invalidate a specific functionGraphStore */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionGraphStoreKeys.detail(id) - }) - }, - /** Invalidate functionInvocationAttempt queries */functionInvocationAttempt: { - /** Invalidate all functionInvocationAttempt queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionInvocationAttemptKeys.all - }), - /** Invalidate functionInvocationAttempt list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionInvocationAttemptKeys.lists() - }), - /** Invalidate a specific functionInvocationAttempt */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionInvocationAttemptKeys.detail(id) - }) - }, - /** Invalidate functionInvocation queries */functionInvocation: { - /** Invalidate all functionInvocation queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionInvocationKeys.all - }), - /** Invalidate functionInvocation list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionInvocationKeys.lists() - }), - /** Invalidate a specific functionInvocation */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionInvocationKeys.detail(id) - }) - }, - /** Invalidate getAllTreeNodesRecord queries */getAllTreeNodesRecord: { - /** Invalidate all getAllTreeNodesRecord queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: getAllTreeNodesRecordKeys.all - }), - /** Invalidate getAllTreeNodesRecord list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: getAllTreeNodesRecordKeys.lists() - }), - /** Invalidate a specific getAllTreeNodesRecord */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: getAllTreeNodesRecordKeys.detail(id) - }) - }, - /** Invalidate infraCommit queries */infraCommit: { - /** Invalidate all infraCommit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraCommitKeys.all - }), - /** Invalidate infraCommit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraCommitKeys.lists() - }), - /** Invalidate a specific infraCommit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: infraCommitKeys.detail(id) - }) - }, - /** Invalidate infraGetAllTreeNodesRecord queries */infraGetAllTreeNodesRecord: { - /** Invalidate all infraGetAllTreeNodesRecord queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraGetAllTreeNodesRecordKeys.all - }), - /** Invalidate infraGetAllTreeNodesRecord list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraGetAllTreeNodesRecordKeys.lists() - }), - /** Invalidate a specific infraGetAllTreeNodesRecord */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: infraGetAllTreeNodesRecordKeys.detail(id) - }) - }, - /** Invalidate infraObject queries */infraObject: { - /** Invalidate all infraObject queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraObjectKeys.all - }), - /** Invalidate infraObject list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraObjectKeys.lists() - }), - /** Invalidate a specific infraObject */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: infraObjectKeys.detail(id) - }) - }, - /** Invalidate infraRef queries */infraRef: { - /** Invalidate all infraRef queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraRefKeys.all - }), - /** Invalidate infraRef list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraRefKeys.lists() - }), - /** Invalidate a specific infraRef */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: infraRefKeys.detail(id) - }) - }, - /** Invalidate infraStore queries */infraStore: { - /** Invalidate all infraStore queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraStoreKeys.all - }), - /** Invalidate infraStore list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraStoreKeys.lists() - }), - /** Invalidate a specific infraStore */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: infraStoreKeys.detail(id) - }) - }, - /** Invalidate integrationProvider queries */integrationProvider: { - /** Invalidate all integrationProvider queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: integrationProviderKeys.all - }), - /** Invalidate integrationProvider list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: integrationProviderKeys.lists() - }), - /** Invalidate a specific integrationProvider */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: integrationProviderKeys.detail(id) - }) - }, - /** Invalidate namespace queries */namespace: { - /** Invalidate all namespace queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceKeys.all - }), - /** Invalidate namespace list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceKeys.lists() - }), - /** Invalidate a specific namespace */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: namespaceKeys.detail(id) - }) - }, - /** Invalidate namespaceEvent queries */namespaceEvent: { - /** Invalidate all namespaceEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.all - }), - /** Invalidate namespaceEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.lists() - }), - /** Invalidate a specific namespaceEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.detail(id) - }) - }, - /** Invalidate platformFunctionApiBinding queries */platformFunctionApiBinding: { - /** Invalidate all platformFunctionApiBinding queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionApiBindingKeys.all - }), - /** Invalidate platformFunctionApiBinding list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionApiBindingKeys.lists() - }), - /** Invalidate a specific platformFunctionApiBinding */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformFunctionApiBindingKeys.detail(id) - }) - }, - /** Invalidate platformFunctionDefinition queries */platformFunctionDefinition: { - /** Invalidate all platformFunctionDefinition queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionDefinitionKeys.all - }), - /** Invalidate platformFunctionDefinition list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionDefinitionKeys.lists() - }), - /** Invalidate a specific platformFunctionDefinition */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformFunctionDefinitionKeys.detail(id) - }) - }, - /** Invalidate platformFunctionDeployment queries */platformFunctionDeployment: { - /** Invalidate all platformFunctionDeployment queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentKeys.all - }), - /** Invalidate platformFunctionDeployment list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentKeys.lists() - }), - /** Invalidate a specific platformFunctionDeployment */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentKeys.detail(id) - }) - }, - /** Invalidate platformFunctionDeploymentEvent queries */platformFunctionDeploymentEvent: { - /** Invalidate all platformFunctionDeploymentEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentEventKeys.all - }), - /** Invalidate platformFunctionDeploymentEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentEventKeys.lists() - }), - /** Invalidate a specific platformFunctionDeploymentEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentEventKeys.detail(id) - }) - }, - /** Invalidate platformFunctionExecutionLog queries */platformFunctionExecutionLog: { - /** Invalidate all platformFunctionExecutionLog queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionExecutionLogKeys.all - }), - /** Invalidate platformFunctionExecutionLog list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionExecutionLogKeys.lists() - }), - /** Invalidate a specific platformFunctionExecutionLog */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformFunctionExecutionLogKeys.detail(id) - }) - }, - /** Invalidate platformFunctionInvocationAttempt queries */platformFunctionInvocationAttempt: { - /** Invalidate all platformFunctionInvocationAttempt queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationAttemptKeys.all - }), - /** Invalidate platformFunctionInvocationAttempt list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationAttemptKeys.lists() - }), - /** Invalidate a specific platformFunctionInvocationAttempt */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationAttemptKeys.detail(id) - }) - }, - /** Invalidate platformFunctionInvocation queries */platformFunctionInvocation: { - /** Invalidate all platformFunctionInvocation queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationKeys.all - }), - /** Invalidate platformFunctionInvocation list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationKeys.lists() - }), - /** Invalidate a specific platformFunctionInvocation */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationKeys.detail(id) - }) - }, - /** Invalidate platformInfraCommit queries */platformInfraCommit: { - /** Invalidate all platformInfraCommit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.all - }), - /** Invalidate platformInfraCommit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.lists() - }), - /** Invalidate a specific platformInfraCommit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.detail(id) - }) - }, - /** Invalidate platformInfraGetAllTreeNodesRecord queries */platformInfraGetAllTreeNodesRecord: { - /** Invalidate all platformInfraGetAllTreeNodesRecord queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.all - }), - /** Invalidate platformInfraGetAllTreeNodesRecord list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.lists() - }), - /** Invalidate a specific platformInfraGetAllTreeNodesRecord */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.detail(id) - }) - }, - /** Invalidate platformInfraObject queries */platformInfraObject: { - /** Invalidate all platformInfraObject queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.all - }), - /** Invalidate platformInfraObject list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.lists() - }), - /** Invalidate a specific platformInfraObject */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.detail(id) - }) - }, - /** Invalidate platformInfraRef queries */platformInfraRef: { - /** Invalidate all platformInfraRef queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.all - }), - /** Invalidate platformInfraRef list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.lists() - }), - /** Invalidate a specific platformInfraRef */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.detail(id) - }) - }, - /** Invalidate platformInfraStore queries */platformInfraStore: { - /** Invalidate all platformInfraStore queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.all - }), - /** Invalidate platformInfraStore list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.lists() - }), - /** Invalidate a specific platformInfraStore */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.detail(id) - }) - }, - /** Invalidate platformNamespace queries */platformNamespace: { - /** Invalidate all platformNamespace queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.all - }), - /** Invalidate platformNamespace list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.lists() - }), - /** Invalidate a specific platformNamespace */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.detail(id) - }) - }, - /** Invalidate platformNamespaceEvent queries */platformNamespaceEvent: { - /** Invalidate all platformNamespaceEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.all - }), - /** Invalidate platformNamespaceEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.lists() - }), - /** Invalidate a specific platformNamespaceEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.detail(id) - }) - }, - /** Invalidate platformResource queries */platformResource: { - /** Invalidate all platformResource queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceKeys.all - }), - /** Invalidate platformResource list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceKeys.lists() - }), - /** Invalidate a specific platformResource */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceKeys.detail(id) - }) - }, - /** Invalidate platformResourceDeclaredCapacity queries */platformResourceDeclaredCapacity: { - /** Invalidate all platformResourceDeclaredCapacity queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceDeclaredCapacityKeys.all - }), - /** Invalidate platformResourceDeclaredCapacity list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceDeclaredCapacityKeys.lists() - }), - /** Invalidate a specific platformResourceDeclaredCapacity */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceDeclaredCapacityKeys.detail(id) - }) - }, - /** Invalidate platformResourceDefinition queries */platformResourceDefinition: { - /** Invalidate all platformResourceDefinition queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceDefinitionKeys.all - }), - /** Invalidate platformResourceDefinition list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceDefinitionKeys.lists() - }), - /** Invalidate a specific platformResourceDefinition */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceDefinitionKeys.detail(id) - }) - }, - /** Invalidate platformResourceEvent queries */platformResourceEvent: { - /** Invalidate all platformResourceEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceEventKeys.all - }), - /** Invalidate platformResourceEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceEventKeys.lists() - }), - /** Invalidate a specific platformResourceEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceEventKeys.detail(id) - }) - }, - /** Invalidate platformResourceInstallation queries */platformResourceInstallation: { - /** Invalidate all platformResourceInstallation queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceInstallationKeys.all - }), - /** Invalidate platformResourceInstallation list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceInstallationKeys.lists() - }), - /** Invalidate a specific platformResourceInstallation */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceInstallationKeys.detail(id) - }) - }, - /** Invalidate platformResourceStatusCheck queries */platformResourceStatusCheck: { - /** Invalidate all platformResourceStatusCheck queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceStatusCheckKeys.all - }), - /** Invalidate platformResourceStatusCheck list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceStatusCheckKeys.lists() - }), - /** Invalidate a specific platformResourceStatusCheck */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceStatusCheckKeys.detail(id) - }) - }, - /** Invalidate platformResourceUsageLog queries */platformResourceUsageLog: { - /** Invalidate all platformResourceUsageLog queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceUsageLogKeys.all - }), - /** Invalidate platformResourceUsageLog list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceUsageLogKeys.lists() - }), - /** Invalidate a specific platformResourceUsageLog */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceUsageLogKeys.detail(id) - }) - }, - /** Invalidate platformResourceUsageSummary queries */platformResourceUsageSummary: { - /** Invalidate all platformResourceUsageSummary queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceUsageSummaryKeys.all - }), - /** Invalidate platformResourceUsageSummary list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceUsageSummaryKeys.lists() - }), - /** Invalidate a specific platformResourceUsageSummary */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceUsageSummaryKeys.detail(id) - }) - }, - /** Invalidate platformResourceUtilization queries */platformResourceUtilization: { - /** Invalidate all platformResourceUtilization queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceUtilizationKeys.all - }), - /** Invalidate platformResourceUtilization list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourceUtilizationKeys.lists() - }), - /** Invalidate a specific platformResourceUtilization */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourceUtilizationKeys.detail(id) - }) - }, - /** Invalidate platformResourcesHealth queries */platformResourcesHealth: { - /** Invalidate all platformResourcesHealth queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourcesHealthKeys.all - }), - /** Invalidate platformResourcesHealth list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourcesHealthKeys.lists() - }), - /** Invalidate a specific platformResourcesHealth */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourcesHealthKeys.detail(id) - }) - }, - /** Invalidate platformResourcesRequirementsState queries */platformResourcesRequirementsState: { - /** Invalidate all platformResourcesRequirementsState queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourcesRequirementsStateKeys.all - }), - /** Invalidate platformResourcesRequirementsState list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourcesRequirementsStateKeys.lists() - }), - /** Invalidate a specific platformResourcesRequirementsState */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourcesRequirementsStateKeys.detail(id) - }) - }, - /** Invalidate platformResourcesResolvedRequirement queries */platformResourcesResolvedRequirement: { - /** Invalidate all platformResourcesResolvedRequirement queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourcesResolvedRequirementKeys.all - }), - /** Invalidate platformResourcesResolvedRequirement list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformResourcesResolvedRequirementKeys.lists() - }), - /** Invalidate a specific platformResourcesResolvedRequirement */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformResourcesResolvedRequirementKeys.detail(id) - }) - }, - /** Invalidate platformWebhookEndpoint queries */platformWebhookEndpoint: { - /** Invalidate all platformWebhookEndpoint queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformWebhookEndpointKeys.all - }), - /** Invalidate platformWebhookEndpoint list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformWebhookEndpointKeys.lists() - }), - /** Invalidate a specific platformWebhookEndpoint */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformWebhookEndpointKeys.detail(id) - }) - }, - /** Invalidate platformWebhookEvent queries */platformWebhookEvent: { - /** Invalidate all platformWebhookEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformWebhookEventKeys.all - }), - /** Invalidate platformWebhookEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformWebhookEventKeys.lists() - }), - /** Invalidate a specific platformWebhookEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformWebhookEventKeys.detail(id) - }) - }, - /** Invalidate resource queries */resource: { - /** Invalidate all resource queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceKeys.all - }), - /** Invalidate resource list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceKeys.lists() - }), - /** Invalidate a specific resource */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceKeys.detail(id) - }) - }, - /** Invalidate resourceDeclaredCapacity queries */resourceDeclaredCapacity: { - /** Invalidate all resourceDeclaredCapacity queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceDeclaredCapacityKeys.all - }), - /** Invalidate resourceDeclaredCapacity list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceDeclaredCapacityKeys.lists() - }), - /** Invalidate a specific resourceDeclaredCapacity */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceDeclaredCapacityKeys.detail(id) - }) - }, - /** Invalidate resourceDefinition queries */resourceDefinition: { - /** Invalidate all resourceDefinition queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceDefinitionKeys.all - }), - /** Invalidate resourceDefinition list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceDefinitionKeys.lists() - }), - /** Invalidate a specific resourceDefinition */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceDefinitionKeys.detail(id) - }) - }, - /** Invalidate resourceEvent queries */resourceEvent: { - /** Invalidate all resourceEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceEventKeys.all - }), - /** Invalidate resourceEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceEventKeys.lists() - }), - /** Invalidate a specific resourceEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceEventKeys.detail(id) - }) - }, - /** Invalidate resourceInstallation queries */resourceInstallation: { - /** Invalidate all resourceInstallation queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceInstallationKeys.all - }), - /** Invalidate resourceInstallation list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceInstallationKeys.lists() - }), - /** Invalidate a specific resourceInstallation */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceInstallationKeys.detail(id) - }) - }, - /** Invalidate resourceStatusCheck queries */resourceStatusCheck: { - /** Invalidate all resourceStatusCheck queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceStatusCheckKeys.all - }), - /** Invalidate resourceStatusCheck list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceStatusCheckKeys.lists() - }), - /** Invalidate a specific resourceStatusCheck */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceStatusCheckKeys.detail(id) - }) - }, - /** Invalidate resourceUsageLog queries */resourceUsageLog: { - /** Invalidate all resourceUsageLog queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceUsageLogKeys.all - }), - /** Invalidate resourceUsageLog list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceUsageLogKeys.lists() - }), - /** Invalidate a specific resourceUsageLog */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceUsageLogKeys.detail(id) - }) - }, - /** Invalidate resourceUsageSummary queries */resourceUsageSummary: { - /** Invalidate all resourceUsageSummary queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceUsageSummaryKeys.all - }), - /** Invalidate resourceUsageSummary list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceUsageSummaryKeys.lists() - }), - /** Invalidate a specific resourceUsageSummary */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceUsageSummaryKeys.detail(id) - }) - }, - /** Invalidate resourceUtilization queries */resourceUtilization: { - /** Invalidate all resourceUtilization queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceUtilizationKeys.all - }), - /** Invalidate resourceUtilization list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceUtilizationKeys.lists() - }), - /** Invalidate a specific resourceUtilization */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceUtilizationKeys.detail(id) - }) - }, - /** Invalidate resourcesHealth queries */resourcesHealth: { - /** Invalidate all resourcesHealth queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourcesHealthKeys.all - }), - /** Invalidate resourcesHealth list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourcesHealthKeys.lists() - }), - /** Invalidate a specific resourcesHealth */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourcesHealthKeys.detail(id) - }) - }, - /** Invalidate resourcesRequirementsState queries */resourcesRequirementsState: { - /** Invalidate all resourcesRequirementsState queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourcesRequirementsStateKeys.all - }), - /** Invalidate resourcesRequirementsState list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourcesRequirementsStateKeys.lists() - }), - /** Invalidate a specific resourcesRequirementsState */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourcesRequirementsStateKeys.detail(id) - }) - }, - /** Invalidate resourcesResolvedRequirement queries */resourcesResolvedRequirement: { - /** Invalidate all resourcesResolvedRequirement queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourcesResolvedRequirementKeys.all - }), - /** Invalidate resourcesResolvedRequirement list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourcesResolvedRequirementKeys.lists() - }), - /** Invalidate a specific resourcesResolvedRequirement */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourcesResolvedRequirementKeys.detail(id) - }) - }, - /** Invalidate webhookEndpoint queries */webhookEndpoint: { - /** Invalidate all webhookEndpoint queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webhookEndpointKeys.all - }), - /** Invalidate webhookEndpoint list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webhookEndpointKeys.lists() - }), - /** Invalidate a specific webhookEndpoint */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: webhookEndpointKeys.detail(id) - }) - }, - /** Invalidate webhookEvent queries */webhookEvent: { - /** Invalidate all webhookEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webhookEventKeys.all - }), - /** Invalidate webhookEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webhookEventKeys.lists() - }), - /** Invalidate a specific webhookEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: webhookEventKeys.detail(id) - }) - } + /** Invalidate dbPreset queries */ dbPreset: { + /** Invalidate all dbPreset queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPresetKeys.all, + }), + /** Invalidate dbPreset list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPresetKeys.lists(), + }), + /** Invalidate a specific dbPreset */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: dbPresetKeys.detail(id), + }), + }, + /** Invalidate functionApiBinding queries */ functionApiBinding: { + /** Invalidate all functionApiBinding queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.all, + }), + /** Invalidate functionApiBinding list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.lists(), + }), + /** Invalidate a specific functionApiBinding */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.detail(id), + }), + }, + /** Invalidate functionDefinition queries */ functionDefinition: { + /** Invalidate all functionDefinition queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.all, + }), + /** Invalidate functionDefinition list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.lists(), + }), + /** Invalidate a specific functionDefinition */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.detail(id), + }), + }, + /** Invalidate functionDeployment queries */ functionDeployment: { + /** Invalidate all functionDeployment queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.all, + }), + /** Invalidate functionDeployment list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.lists(), + }), + /** Invalidate a specific functionDeployment */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.detail(id), + }), + }, + /** Invalidate functionDeploymentEvent queries */ functionDeploymentEvent: { + /** Invalidate all functionDeploymentEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.all, + }), + /** Invalidate functionDeploymentEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.lists(), + }), + /** Invalidate a specific functionDeploymentEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.detail(id), + }), + }, + /** Invalidate functionExecutionLog queries */ functionExecutionLog: { + /** Invalidate all functionExecutionLog queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.all, + }), + /** Invalidate functionExecutionLog list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.lists(), + }), + /** Invalidate a specific functionExecutionLog */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.detail(id), + }), + }, + /** Invalidate functionGraphCommit queries */ functionGraphCommit: { + /** Invalidate all functionGraphCommit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.all, + }), + /** Invalidate functionGraphCommit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.lists(), + }), + /** Invalidate a specific functionGraphCommit */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.detail(id), + }), + }, + /** Invalidate functionGraph queries */ functionGraph: { + /** Invalidate all functionGraph queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.all, + }), + /** Invalidate functionGraph list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.lists(), + }), + /** Invalidate a specific functionGraph */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.detail(id), + }), + }, + /** Invalidate functionGraphExecution queries */ functionGraphExecution: { + /** Invalidate all functionGraphExecution queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.all, + }), + /** Invalidate functionGraphExecution list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.lists(), + }), + /** Invalidate a specific functionGraphExecution */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.detail(id), + }), + }, + /** Invalidate functionGraphExecutionNodeState queries */ functionGraphExecutionNodeState: { + /** Invalidate all functionGraphExecutionNodeState queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.all, + }), + /** Invalidate functionGraphExecutionNodeState list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.lists(), + }), + /** Invalidate a specific functionGraphExecutionNodeState */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.detail(id), + }), + }, + /** Invalidate functionGraphExecutionOutput queries */ functionGraphExecutionOutput: { + /** Invalidate all functionGraphExecutionOutput queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.all, + }), + /** Invalidate functionGraphExecutionOutput list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.lists(), + }), + /** Invalidate a specific functionGraphExecutionOutput */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.detail(id), + }), + }, + /** Invalidate functionGraphObject queries */ functionGraphObject: { + /** Invalidate all functionGraphObject queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.all, + }), + /** Invalidate functionGraphObject list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.lists(), + }), + /** Invalidate a specific functionGraphObject */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.detail(id), + }), + }, + /** Invalidate functionGraphRef queries */ functionGraphRef: { + /** Invalidate all functionGraphRef queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.all, + }), + /** Invalidate functionGraphRef list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.lists(), + }), + /** Invalidate a specific functionGraphRef */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.detail(id), + }), + }, + /** Invalidate functionGraphStore queries */ functionGraphStore: { + /** Invalidate all functionGraphStore queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.all, + }), + /** Invalidate functionGraphStore list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.lists(), + }), + /** Invalidate a specific functionGraphStore */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.detail(id), + }), + }, + /** Invalidate functionInvocationAttempt queries */ functionInvocationAttempt: { + /** Invalidate all functionInvocationAttempt queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionInvocationAttemptKeys.all, + }), + /** Invalidate functionInvocationAttempt list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionInvocationAttemptKeys.lists(), + }), + /** Invalidate a specific functionInvocationAttempt */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionInvocationAttemptKeys.detail(id), + }), + }, + /** Invalidate functionInvocation queries */ functionInvocation: { + /** Invalidate all functionInvocation queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.all, + }), + /** Invalidate functionInvocation list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.lists(), + }), + /** Invalidate a specific functionInvocation */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.detail(id), + }), + }, + /** Invalidate getAllTreeNodesRecord queries */ getAllTreeNodesRecord: { + /** Invalidate all getAllTreeNodesRecord queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: getAllTreeNodesRecordKeys.all, + }), + /** Invalidate getAllTreeNodesRecord list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: getAllTreeNodesRecordKeys.lists(), + }), + /** Invalidate a specific getAllTreeNodesRecord */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: getAllTreeNodesRecordKeys.detail(id), + }), + }, + /** Invalidate infraCommit queries */ infraCommit: { + /** Invalidate all infraCommit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraCommitKeys.all, + }), + /** Invalidate infraCommit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraCommitKeys.lists(), + }), + /** Invalidate a specific infraCommit */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: infraCommitKeys.detail(id), + }), + }, + /** Invalidate infraGetAllTreeNodesRecord queries */ infraGetAllTreeNodesRecord: { + /** Invalidate all infraGetAllTreeNodesRecord queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraGetAllTreeNodesRecordKeys.all, + }), + /** Invalidate infraGetAllTreeNodesRecord list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraGetAllTreeNodesRecordKeys.lists(), + }), + /** Invalidate a specific infraGetAllTreeNodesRecord */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: infraGetAllTreeNodesRecordKeys.detail(id), + }), + }, + /** Invalidate infraObject queries */ infraObject: { + /** Invalidate all infraObject queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraObjectKeys.all, + }), + /** Invalidate infraObject list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraObjectKeys.lists(), + }), + /** Invalidate a specific infraObject */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: infraObjectKeys.detail(id), + }), + }, + /** Invalidate infraRef queries */ infraRef: { + /** Invalidate all infraRef queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraRefKeys.all, + }), + /** Invalidate infraRef list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraRefKeys.lists(), + }), + /** Invalidate a specific infraRef */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: infraRefKeys.detail(id), + }), + }, + /** Invalidate infraStore queries */ infraStore: { + /** Invalidate all infraStore queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraStoreKeys.all, + }), + /** Invalidate infraStore list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraStoreKeys.lists(), + }), + /** Invalidate a specific infraStore */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: infraStoreKeys.detail(id), + }), + }, + /** Invalidate integrationProvider queries */ integrationProvider: { + /** Invalidate all integrationProvider queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: integrationProviderKeys.all, + }), + /** Invalidate integrationProvider list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: integrationProviderKeys.lists(), + }), + /** Invalidate a specific integrationProvider */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: integrationProviderKeys.detail(id), + }), + }, + /** Invalidate namespace queries */ namespace: { + /** Invalidate all namespace queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceKeys.all, + }), + /** Invalidate namespace list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceKeys.lists(), + }), + /** Invalidate a specific namespace */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: namespaceKeys.detail(id), + }), + }, + /** Invalidate namespaceEvent queries */ namespaceEvent: { + /** Invalidate all namespaceEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceEventKeys.all, + }), + /** Invalidate namespaceEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceEventKeys.lists(), + }), + /** Invalidate a specific namespaceEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: namespaceEventKeys.detail(id), + }), + }, + /** Invalidate platformFunctionApiBinding queries */ platformFunctionApiBinding: { + /** Invalidate all platformFunctionApiBinding queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionApiBindingKeys.all, + }), + /** Invalidate platformFunctionApiBinding list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionApiBindingKeys.lists(), + }), + /** Invalidate a specific platformFunctionApiBinding */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionApiBindingKeys.detail(id), + }), + }, + /** Invalidate platformFunctionDefinition queries */ platformFunctionDefinition: { + /** Invalidate all platformFunctionDefinition queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDefinitionKeys.all, + }), + /** Invalidate platformFunctionDefinition list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDefinitionKeys.lists(), + }), + /** Invalidate a specific platformFunctionDefinition */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDefinitionKeys.detail(id), + }), + }, + /** Invalidate platformFunctionDeployment queries */ platformFunctionDeployment: { + /** Invalidate all platformFunctionDeployment queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDeploymentKeys.all, + }), + /** Invalidate platformFunctionDeployment list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDeploymentKeys.lists(), + }), + /** Invalidate a specific platformFunctionDeployment */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDeploymentKeys.detail(id), + }), + }, + /** Invalidate platformFunctionDeploymentEvent queries */ platformFunctionDeploymentEvent: { + /** Invalidate all platformFunctionDeploymentEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDeploymentEventKeys.all, + }), + /** Invalidate platformFunctionDeploymentEvent list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDeploymentEventKeys.lists(), + }), + /** Invalidate a specific platformFunctionDeploymentEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionDeploymentEventKeys.detail(id), + }), + }, + /** Invalidate platformFunctionExecutionLog queries */ platformFunctionExecutionLog: { + /** Invalidate all platformFunctionExecutionLog queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionExecutionLogKeys.all, + }), + /** Invalidate platformFunctionExecutionLog list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionExecutionLogKeys.lists(), + }), + /** Invalidate a specific platformFunctionExecutionLog */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionExecutionLogKeys.detail(id), + }), + }, + /** Invalidate platformFunctionInvocationAttempt queries */ platformFunctionInvocationAttempt: { + /** Invalidate all platformFunctionInvocationAttempt queries */ all: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionInvocationAttemptKeys.all, + }), + /** Invalidate platformFunctionInvocationAttempt list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionInvocationAttemptKeys.lists(), + }), + /** Invalidate a specific platformFunctionInvocationAttempt */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionInvocationAttemptKeys.detail(id), + }), + }, + /** Invalidate platformFunctionInvocation queries */ platformFunctionInvocation: { + /** Invalidate all platformFunctionInvocation queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionInvocationKeys.all, + }), + /** Invalidate platformFunctionInvocation list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformFunctionInvocationKeys.lists(), + }), + /** Invalidate a specific platformFunctionInvocation */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformFunctionInvocationKeys.detail(id), + }), + }, + /** Invalidate platformInfraCommit queries */ platformInfraCommit: { + /** Invalidate all platformInfraCommit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraCommitKeys.all, + }), + /** Invalidate platformInfraCommit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraCommitKeys.lists(), + }), + /** Invalidate a specific platformInfraCommit */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraCommitKeys.detail(id), + }), + }, + /** Invalidate platformInfraGetAllTreeNodesRecord queries */ platformInfraGetAllTreeNodesRecord: { + /** Invalidate all platformInfraGetAllTreeNodesRecord queries */ all: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraGetAllTreeNodesRecordKeys.all, + }), + /** Invalidate platformInfraGetAllTreeNodesRecord list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraGetAllTreeNodesRecordKeys.lists(), + }), + /** Invalidate a specific platformInfraGetAllTreeNodesRecord */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraGetAllTreeNodesRecordKeys.detail(id), + }), + }, + /** Invalidate platformInfraObject queries */ platformInfraObject: { + /** Invalidate all platformInfraObject queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraObjectKeys.all, + }), + /** Invalidate platformInfraObject list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraObjectKeys.lists(), + }), + /** Invalidate a specific platformInfraObject */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraObjectKeys.detail(id), + }), + }, + /** Invalidate platformInfraRef queries */ platformInfraRef: { + /** Invalidate all platformInfraRef queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraRefKeys.all, + }), + /** Invalidate platformInfraRef list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraRefKeys.lists(), + }), + /** Invalidate a specific platformInfraRef */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraRefKeys.detail(id), + }), + }, + /** Invalidate platformInfraStore queries */ platformInfraStore: { + /** Invalidate all platformInfraStore queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraStoreKeys.all, + }), + /** Invalidate platformInfraStore list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraStoreKeys.lists(), + }), + /** Invalidate a specific platformInfraStore */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraStoreKeys.detail(id), + }), + }, + /** Invalidate platformNamespace queries */ platformNamespace: { + /** Invalidate all platformNamespace queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceKeys.all, + }), + /** Invalidate platformNamespace list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceKeys.lists(), + }), + /** Invalidate a specific platformNamespace */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceKeys.detail(id), + }), + }, + /** Invalidate platformNamespaceEvent queries */ platformNamespaceEvent: { + /** Invalidate all platformNamespaceEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceEventKeys.all, + }), + /** Invalidate platformNamespaceEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceEventKeys.lists(), + }), + /** Invalidate a specific platformNamespaceEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceEventKeys.detail(id), + }), + }, + /** Invalidate platformResource queries */ platformResource: { + /** Invalidate all platformResource queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceKeys.all, + }), + /** Invalidate platformResource list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceKeys.lists(), + }), + /** Invalidate a specific platformResource */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceKeys.detail(id), + }), + }, + /** Invalidate platformResourceDeclaredCapacity queries */ platformResourceDeclaredCapacity: { + /** Invalidate all platformResourceDeclaredCapacity queries */ all: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceDeclaredCapacityKeys.all, + }), + /** Invalidate platformResourceDeclaredCapacity list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceDeclaredCapacityKeys.lists(), + }), + /** Invalidate a specific platformResourceDeclaredCapacity */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceDeclaredCapacityKeys.detail(id), + }), + }, + /** Invalidate platformResourceDefinition queries */ platformResourceDefinition: { + /** Invalidate all platformResourceDefinition queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceDefinitionKeys.all, + }), + /** Invalidate platformResourceDefinition list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceDefinitionKeys.lists(), + }), + /** Invalidate a specific platformResourceDefinition */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceDefinitionKeys.detail(id), + }), + }, + /** Invalidate platformResourceEvent queries */ platformResourceEvent: { + /** Invalidate all platformResourceEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceEventKeys.all, + }), + /** Invalidate platformResourceEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceEventKeys.lists(), + }), + /** Invalidate a specific platformResourceEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceEventKeys.detail(id), + }), + }, + /** Invalidate platformResourceInstallation queries */ platformResourceInstallation: { + /** Invalidate all platformResourceInstallation queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceInstallationKeys.all, + }), + /** Invalidate platformResourceInstallation list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceInstallationKeys.lists(), + }), + /** Invalidate a specific platformResourceInstallation */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceInstallationKeys.detail(id), + }), + }, + /** Invalidate platformResourceStatusCheck queries */ platformResourceStatusCheck: { + /** Invalidate all platformResourceStatusCheck queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceStatusCheckKeys.all, + }), + /** Invalidate platformResourceStatusCheck list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceStatusCheckKeys.lists(), + }), + /** Invalidate a specific platformResourceStatusCheck */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceStatusCheckKeys.detail(id), + }), + }, + /** Invalidate platformResourceUsageLog queries */ platformResourceUsageLog: { + /** Invalidate all platformResourceUsageLog queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceUsageLogKeys.all, + }), + /** Invalidate platformResourceUsageLog list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceUsageLogKeys.lists(), + }), + /** Invalidate a specific platformResourceUsageLog */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceUsageLogKeys.detail(id), + }), + }, + /** Invalidate platformResourceUsageSummary queries */ platformResourceUsageSummary: { + /** Invalidate all platformResourceUsageSummary queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceUsageSummaryKeys.all, + }), + /** Invalidate platformResourceUsageSummary list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceUsageSummaryKeys.lists(), + }), + /** Invalidate a specific platformResourceUsageSummary */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceUsageSummaryKeys.detail(id), + }), + }, + /** Invalidate platformResourceUtilization queries */ platformResourceUtilization: { + /** Invalidate all platformResourceUtilization queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceUtilizationKeys.all, + }), + /** Invalidate platformResourceUtilization list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourceUtilizationKeys.lists(), + }), + /** Invalidate a specific platformResourceUtilization */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourceUtilizationKeys.detail(id), + }), + }, + /** Invalidate platformResourcesHealth queries */ platformResourcesHealth: { + /** Invalidate all platformResourcesHealth queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourcesHealthKeys.all, + }), + /** Invalidate platformResourcesHealth list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformResourcesHealthKeys.lists(), + }), + /** Invalidate a specific platformResourcesHealth */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourcesHealthKeys.detail(id), + }), + }, + /** Invalidate platformResourcesRequirementsState queries */ platformResourcesRequirementsState: { + /** Invalidate all platformResourcesRequirementsState queries */ all: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformResourcesRequirementsStateKeys.all, + }), + /** Invalidate platformResourcesRequirementsState list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformResourcesRequirementsStateKeys.lists(), + }), + /** Invalidate a specific platformResourcesRequirementsState */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourcesRequirementsStateKeys.detail(id), + }), + }, + /** Invalidate platformResourcesResolvedRequirement queries */ platformResourcesResolvedRequirement: + { + /** Invalidate all platformResourcesResolvedRequirement queries */ all: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformResourcesResolvedRequirementKeys.all, + }), + /** Invalidate platformResourcesResolvedRequirement list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformResourcesResolvedRequirementKeys.lists(), + }), + /** Invalidate a specific platformResourcesResolvedRequirement */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformResourcesResolvedRequirementKeys.detail(id), + }), + }, + /** Invalidate platformWebhookEndpoint queries */ platformWebhookEndpoint: { + /** Invalidate all platformWebhookEndpoint queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformWebhookEndpointKeys.all, + }), + /** Invalidate platformWebhookEndpoint list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformWebhookEndpointKeys.lists(), + }), + /** Invalidate a specific platformWebhookEndpoint */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformWebhookEndpointKeys.detail(id), + }), + }, + /** Invalidate platformWebhookEvent queries */ platformWebhookEvent: { + /** Invalidate all platformWebhookEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformWebhookEventKeys.all, + }), + /** Invalidate platformWebhookEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformWebhookEventKeys.lists(), + }), + /** Invalidate a specific platformWebhookEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformWebhookEventKeys.detail(id), + }), + }, + /** Invalidate resource queries */ resource: { + /** Invalidate all resource queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceKeys.all, + }), + /** Invalidate resource list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceKeys.lists(), + }), + /** Invalidate a specific resource */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: resourceKeys.detail(id), + }), + }, + /** Invalidate resourceDeclaredCapacity queries */ resourceDeclaredCapacity: { + /** Invalidate all resourceDeclaredCapacity queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceDeclaredCapacityKeys.all, + }), + /** Invalidate resourceDeclaredCapacity list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceDeclaredCapacityKeys.lists(), + }), + /** Invalidate a specific resourceDeclaredCapacity */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceDeclaredCapacityKeys.detail(id), + }), + }, + /** Invalidate resourceDefinition queries */ resourceDefinition: { + /** Invalidate all resourceDefinition queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceDefinitionKeys.all, + }), + /** Invalidate resourceDefinition list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceDefinitionKeys.lists(), + }), + /** Invalidate a specific resourceDefinition */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceDefinitionKeys.detail(id), + }), + }, + /** Invalidate resourceEvent queries */ resourceEvent: { + /** Invalidate all resourceEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceEventKeys.all, + }), + /** Invalidate resourceEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceEventKeys.lists(), + }), + /** Invalidate a specific resourceEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceEventKeys.detail(id), + }), + }, + /** Invalidate resourceInstallation queries */ resourceInstallation: { + /** Invalidate all resourceInstallation queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceInstallationKeys.all, + }), + /** Invalidate resourceInstallation list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceInstallationKeys.lists(), + }), + /** Invalidate a specific resourceInstallation */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceInstallationKeys.detail(id), + }), + }, + /** Invalidate resourceStatusCheck queries */ resourceStatusCheck: { + /** Invalidate all resourceStatusCheck queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceStatusCheckKeys.all, + }), + /** Invalidate resourceStatusCheck list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceStatusCheckKeys.lists(), + }), + /** Invalidate a specific resourceStatusCheck */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceStatusCheckKeys.detail(id), + }), + }, + /** Invalidate resourceUsageLog queries */ resourceUsageLog: { + /** Invalidate all resourceUsageLog queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceUsageLogKeys.all, + }), + /** Invalidate resourceUsageLog list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceUsageLogKeys.lists(), + }), + /** Invalidate a specific resourceUsageLog */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceUsageLogKeys.detail(id), + }), + }, + /** Invalidate resourceUsageSummary queries */ resourceUsageSummary: { + /** Invalidate all resourceUsageSummary queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceUsageSummaryKeys.all, + }), + /** Invalidate resourceUsageSummary list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceUsageSummaryKeys.lists(), + }), + /** Invalidate a specific resourceUsageSummary */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceUsageSummaryKeys.detail(id), + }), + }, + /** Invalidate resourceUtilization queries */ resourceUtilization: { + /** Invalidate all resourceUtilization queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceUtilizationKeys.all, + }), + /** Invalidate resourceUtilization list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceUtilizationKeys.lists(), + }), + /** Invalidate a specific resourceUtilization */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceUtilizationKeys.detail(id), + }), + }, + /** Invalidate resourcesHealth queries */ resourcesHealth: { + /** Invalidate all resourcesHealth queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourcesHealthKeys.all, + }), + /** Invalidate resourcesHealth list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourcesHealthKeys.lists(), + }), + /** Invalidate a specific resourcesHealth */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourcesHealthKeys.detail(id), + }), + }, + /** Invalidate resourcesRequirementsState queries */ resourcesRequirementsState: { + /** Invalidate all resourcesRequirementsState queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourcesRequirementsStateKeys.all, + }), + /** Invalidate resourcesRequirementsState list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourcesRequirementsStateKeys.lists(), + }), + /** Invalidate a specific resourcesRequirementsState */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourcesRequirementsStateKeys.detail(id), + }), + }, + /** Invalidate resourcesResolvedRequirement queries */ resourcesResolvedRequirement: { + /** Invalidate all resourcesResolvedRequirement queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourcesResolvedRequirementKeys.all, + }), + /** Invalidate resourcesResolvedRequirement list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourcesResolvedRequirementKeys.lists(), + }), + /** Invalidate a specific resourcesResolvedRequirement */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourcesResolvedRequirementKeys.detail(id), + }), + }, + /** Invalidate webhookEndpoint queries */ webhookEndpoint: { + /** Invalidate all webhookEndpoint queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webhookEndpointKeys.all, + }), + /** Invalidate webhookEndpoint list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webhookEndpointKeys.lists(), + }), + /** Invalidate a specific webhookEndpoint */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: webhookEndpointKeys.detail(id), + }), + }, + /** Invalidate webhookEvent queries */ webhookEvent: { + /** Invalidate all webhookEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webhookEventKeys.all, + }), + /** Invalidate webhookEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webhookEventKeys.lists(), + }), + /** Invalidate a specific webhookEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: webhookEventKeys.detail(id), + }), + }, } as const; /** @@ -785,339 +1271,526 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove dbPreset from cache */dbPreset: (queryClient: QueryClient, id: string | number) => { + /** Remove dbPreset from cache */ dbPreset: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: dbPresetKeys.detail(id) + queryKey: dbPresetKeys.detail(id), }); }, - /** Remove functionApiBinding from cache */functionApiBinding: (queryClient: QueryClient, id: string | number) => { + /** Remove functionApiBinding from cache */ functionApiBinding: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionApiBindingKeys.detail(id) + queryKey: functionApiBindingKeys.detail(id), }); }, - /** Remove functionDefinition from cache */functionDefinition: (queryClient: QueryClient, id: string | number) => { + /** Remove functionDefinition from cache */ functionDefinition: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionDefinitionKeys.detail(id) + queryKey: functionDefinitionKeys.detail(id), }); }, - /** Remove functionDeployment from cache */functionDeployment: (queryClient: QueryClient, id: string | number) => { + /** Remove functionDeployment from cache */ functionDeployment: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionDeploymentKeys.detail(id) + queryKey: functionDeploymentKeys.detail(id), }); }, - /** Remove functionDeploymentEvent from cache */functionDeploymentEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove functionDeploymentEvent from cache */ functionDeploymentEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionDeploymentEventKeys.detail(id) + queryKey: functionDeploymentEventKeys.detail(id), }); }, - /** Remove functionExecutionLog from cache */functionExecutionLog: (queryClient: QueryClient, id: string | number) => { + /** Remove functionExecutionLog from cache */ functionExecutionLog: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionExecutionLogKeys.detail(id) + queryKey: functionExecutionLogKeys.detail(id), }); }, - /** Remove functionGraphCommit from cache */functionGraphCommit: (queryClient: QueryClient, id: string | number) => { + /** Remove functionGraphCommit from cache */ functionGraphCommit: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionGraphCommitKeys.detail(id) + queryKey: functionGraphCommitKeys.detail(id), }); }, - /** Remove functionGraph from cache */functionGraph: (queryClient: QueryClient, id: string | number) => { + /** Remove functionGraph from cache */ functionGraph: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionGraphKeys.detail(id) + queryKey: functionGraphKeys.detail(id), }); }, - /** Remove functionGraphExecution from cache */functionGraphExecution: (queryClient: QueryClient, id: string | number) => { + /** Remove functionGraphExecution from cache */ functionGraphExecution: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionGraphExecutionKeys.detail(id) + queryKey: functionGraphExecutionKeys.detail(id), }); }, - /** Remove functionGraphExecutionNodeState from cache */functionGraphExecutionNodeState: (queryClient: QueryClient, id: string | number) => { + /** Remove functionGraphExecutionNodeState from cache */ functionGraphExecutionNodeState: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionGraphExecutionNodeStateKeys.detail(id) + queryKey: functionGraphExecutionNodeStateKeys.detail(id), }); }, - /** Remove functionGraphExecutionOutput from cache */functionGraphExecutionOutput: (queryClient: QueryClient, id: string | number) => { + /** Remove functionGraphExecutionOutput from cache */ functionGraphExecutionOutput: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionGraphExecutionOutputKeys.detail(id) + queryKey: functionGraphExecutionOutputKeys.detail(id), }); }, - /** Remove functionGraphObject from cache */functionGraphObject: (queryClient: QueryClient, id: string | number) => { + /** Remove functionGraphObject from cache */ functionGraphObject: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionGraphObjectKeys.detail(id) + queryKey: functionGraphObjectKeys.detail(id), }); }, - /** Remove functionGraphRef from cache */functionGraphRef: (queryClient: QueryClient, id: string | number) => { + /** Remove functionGraphRef from cache */ functionGraphRef: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionGraphRefKeys.detail(id) + queryKey: functionGraphRefKeys.detail(id), }); }, - /** Remove functionGraphStore from cache */functionGraphStore: (queryClient: QueryClient, id: string | number) => { + /** Remove functionGraphStore from cache */ functionGraphStore: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionGraphStoreKeys.detail(id) + queryKey: functionGraphStoreKeys.detail(id), }); }, - /** Remove functionInvocationAttempt from cache */functionInvocationAttempt: (queryClient: QueryClient, id: string | number) => { + /** Remove functionInvocationAttempt from cache */ functionInvocationAttempt: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionInvocationAttemptKeys.detail(id) + queryKey: functionInvocationAttemptKeys.detail(id), }); }, - /** Remove functionInvocation from cache */functionInvocation: (queryClient: QueryClient, id: string | number) => { + /** Remove functionInvocation from cache */ functionInvocation: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionInvocationKeys.detail(id) + queryKey: functionInvocationKeys.detail(id), }); }, - /** Remove getAllTreeNodesRecord from cache */getAllTreeNodesRecord: (queryClient: QueryClient, id: string | number) => { + /** Remove getAllTreeNodesRecord from cache */ getAllTreeNodesRecord: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: getAllTreeNodesRecordKeys.detail(id) + queryKey: getAllTreeNodesRecordKeys.detail(id), }); }, - /** Remove infraCommit from cache */infraCommit: (queryClient: QueryClient, id: string | number) => { + /** Remove infraCommit from cache */ infraCommit: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: infraCommitKeys.detail(id) + queryKey: infraCommitKeys.detail(id), }); }, - /** Remove infraGetAllTreeNodesRecord from cache */infraGetAllTreeNodesRecord: (queryClient: QueryClient, id: string | number) => { + /** Remove infraGetAllTreeNodesRecord from cache */ infraGetAllTreeNodesRecord: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: infraGetAllTreeNodesRecordKeys.detail(id) + queryKey: infraGetAllTreeNodesRecordKeys.detail(id), }); }, - /** Remove infraObject from cache */infraObject: (queryClient: QueryClient, id: string | number) => { + /** Remove infraObject from cache */ infraObject: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: infraObjectKeys.detail(id) + queryKey: infraObjectKeys.detail(id), }); }, - /** Remove infraRef from cache */infraRef: (queryClient: QueryClient, id: string | number) => { + /** Remove infraRef from cache */ infraRef: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: infraRefKeys.detail(id) + queryKey: infraRefKeys.detail(id), }); }, - /** Remove infraStore from cache */infraStore: (queryClient: QueryClient, id: string | number) => { + /** Remove infraStore from cache */ infraStore: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: infraStoreKeys.detail(id) + queryKey: infraStoreKeys.detail(id), }); }, - /** Remove integrationProvider from cache */integrationProvider: (queryClient: QueryClient, id: string | number) => { + /** Remove integrationProvider from cache */ integrationProvider: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: integrationProviderKeys.detail(id) + queryKey: integrationProviderKeys.detail(id), }); }, - /** Remove namespace from cache */namespace: (queryClient: QueryClient, id: string | number) => { + /** Remove namespace from cache */ namespace: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: namespaceKeys.detail(id) + queryKey: namespaceKeys.detail(id), }); }, - /** Remove namespaceEvent from cache */namespaceEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove namespaceEvent from cache */ namespaceEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: namespaceEventKeys.detail(id) + queryKey: namespaceEventKeys.detail(id), }); }, - /** Remove platformFunctionApiBinding from cache */platformFunctionApiBinding: (queryClient: QueryClient, id: string | number) => { + /** Remove platformFunctionApiBinding from cache */ platformFunctionApiBinding: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformFunctionApiBindingKeys.detail(id) + queryKey: platformFunctionApiBindingKeys.detail(id), }); }, - /** Remove platformFunctionDefinition from cache */platformFunctionDefinition: (queryClient: QueryClient, id: string | number) => { + /** Remove platformFunctionDefinition from cache */ platformFunctionDefinition: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformFunctionDefinitionKeys.detail(id) + queryKey: platformFunctionDefinitionKeys.detail(id), }); }, - /** Remove platformFunctionDeployment from cache */platformFunctionDeployment: (queryClient: QueryClient, id: string | number) => { + /** Remove platformFunctionDeployment from cache */ platformFunctionDeployment: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformFunctionDeploymentKeys.detail(id) + queryKey: platformFunctionDeploymentKeys.detail(id), }); }, - /** Remove platformFunctionDeploymentEvent from cache */platformFunctionDeploymentEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove platformFunctionDeploymentEvent from cache */ platformFunctionDeploymentEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformFunctionDeploymentEventKeys.detail(id) + queryKey: platformFunctionDeploymentEventKeys.detail(id), }); }, - /** Remove platformFunctionExecutionLog from cache */platformFunctionExecutionLog: (queryClient: QueryClient, id: string | number) => { + /** Remove platformFunctionExecutionLog from cache */ platformFunctionExecutionLog: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformFunctionExecutionLogKeys.detail(id) + queryKey: platformFunctionExecutionLogKeys.detail(id), }); }, - /** Remove platformFunctionInvocationAttempt from cache */platformFunctionInvocationAttempt: (queryClient: QueryClient, id: string | number) => { + /** Remove platformFunctionInvocationAttempt from cache */ platformFunctionInvocationAttempt: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformFunctionInvocationAttemptKeys.detail(id) + queryKey: platformFunctionInvocationAttemptKeys.detail(id), }); }, - /** Remove platformFunctionInvocation from cache */platformFunctionInvocation: (queryClient: QueryClient, id: string | number) => { + /** Remove platformFunctionInvocation from cache */ platformFunctionInvocation: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformFunctionInvocationKeys.detail(id) + queryKey: platformFunctionInvocationKeys.detail(id), }); }, - /** Remove platformInfraCommit from cache */platformInfraCommit: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraCommit from cache */ platformInfraCommit: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraCommitKeys.detail(id) + queryKey: platformInfraCommitKeys.detail(id), }); }, - /** Remove platformInfraGetAllTreeNodesRecord from cache */platformInfraGetAllTreeNodesRecord: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraGetAllTreeNodesRecord from cache */ platformInfraGetAllTreeNodesRecord: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.detail(id) + queryKey: platformInfraGetAllTreeNodesRecordKeys.detail(id), }); }, - /** Remove platformInfraObject from cache */platformInfraObject: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraObject from cache */ platformInfraObject: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraObjectKeys.detail(id) + queryKey: platformInfraObjectKeys.detail(id), }); }, - /** Remove platformInfraRef from cache */platformInfraRef: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraRef from cache */ platformInfraRef: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraRefKeys.detail(id) + queryKey: platformInfraRefKeys.detail(id), }); }, - /** Remove platformInfraStore from cache */platformInfraStore: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraStore from cache */ platformInfraStore: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraStoreKeys.detail(id) + queryKey: platformInfraStoreKeys.detail(id), }); }, - /** Remove platformNamespace from cache */platformNamespace: (queryClient: QueryClient, id: string | number) => { + /** Remove platformNamespace from cache */ platformNamespace: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformNamespaceKeys.detail(id) + queryKey: platformNamespaceKeys.detail(id), }); }, - /** Remove platformNamespaceEvent from cache */platformNamespaceEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove platformNamespaceEvent from cache */ platformNamespaceEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformNamespaceEventKeys.detail(id) + queryKey: platformNamespaceEventKeys.detail(id), }); }, - /** Remove platformResource from cache */platformResource: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResource from cache */ platformResource: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceKeys.detail(id) + queryKey: platformResourceKeys.detail(id), }); }, - /** Remove platformResourceDeclaredCapacity from cache */platformResourceDeclaredCapacity: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourceDeclaredCapacity from cache */ platformResourceDeclaredCapacity: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceDeclaredCapacityKeys.detail(id) + queryKey: platformResourceDeclaredCapacityKeys.detail(id), }); }, - /** Remove platformResourceDefinition from cache */platformResourceDefinition: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourceDefinition from cache */ platformResourceDefinition: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceDefinitionKeys.detail(id) + queryKey: platformResourceDefinitionKeys.detail(id), }); }, - /** Remove platformResourceEvent from cache */platformResourceEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourceEvent from cache */ platformResourceEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceEventKeys.detail(id) + queryKey: platformResourceEventKeys.detail(id), }); }, - /** Remove platformResourceInstallation from cache */platformResourceInstallation: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourceInstallation from cache */ platformResourceInstallation: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceInstallationKeys.detail(id) + queryKey: platformResourceInstallationKeys.detail(id), }); }, - /** Remove platformResourceStatusCheck from cache */platformResourceStatusCheck: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourceStatusCheck from cache */ platformResourceStatusCheck: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceStatusCheckKeys.detail(id) + queryKey: platformResourceStatusCheckKeys.detail(id), }); }, - /** Remove platformResourceUsageLog from cache */platformResourceUsageLog: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourceUsageLog from cache */ platformResourceUsageLog: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceUsageLogKeys.detail(id) + queryKey: platformResourceUsageLogKeys.detail(id), }); }, - /** Remove platformResourceUsageSummary from cache */platformResourceUsageSummary: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourceUsageSummary from cache */ platformResourceUsageSummary: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceUsageSummaryKeys.detail(id) + queryKey: platformResourceUsageSummaryKeys.detail(id), }); }, - /** Remove platformResourceUtilization from cache */platformResourceUtilization: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourceUtilization from cache */ platformResourceUtilization: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourceUtilizationKeys.detail(id) + queryKey: platformResourceUtilizationKeys.detail(id), }); }, - /** Remove platformResourcesHealth from cache */platformResourcesHealth: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourcesHealth from cache */ platformResourcesHealth: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourcesHealthKeys.detail(id) + queryKey: platformResourcesHealthKeys.detail(id), }); }, - /** Remove platformResourcesRequirementsState from cache */platformResourcesRequirementsState: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourcesRequirementsState from cache */ platformResourcesRequirementsState: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourcesRequirementsStateKeys.detail(id) + queryKey: platformResourcesRequirementsStateKeys.detail(id), }); }, - /** Remove platformResourcesResolvedRequirement from cache */platformResourcesResolvedRequirement: (queryClient: QueryClient, id: string | number) => { + /** Remove platformResourcesResolvedRequirement from cache */ platformResourcesResolvedRequirement: + (queryClient: QueryClient, id: string | number) => { + queryClient.removeQueries({ + queryKey: platformResourcesResolvedRequirementKeys.detail(id), + }); + }, + /** Remove platformWebhookEndpoint from cache */ platformWebhookEndpoint: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformResourcesResolvedRequirementKeys.detail(id) + queryKey: platformWebhookEndpointKeys.detail(id), }); }, - /** Remove platformWebhookEndpoint from cache */platformWebhookEndpoint: (queryClient: QueryClient, id: string | number) => { + /** Remove platformWebhookEvent from cache */ platformWebhookEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformWebhookEndpointKeys.detail(id) + queryKey: platformWebhookEventKeys.detail(id), }); }, - /** Remove platformWebhookEvent from cache */platformWebhookEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove resource from cache */ resource: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: platformWebhookEventKeys.detail(id) + queryKey: resourceKeys.detail(id), }); }, - /** Remove resource from cache */resource: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceDeclaredCapacity from cache */ resourceDeclaredCapacity: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceKeys.detail(id) + queryKey: resourceDeclaredCapacityKeys.detail(id), }); }, - /** Remove resourceDeclaredCapacity from cache */resourceDeclaredCapacity: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceDefinition from cache */ resourceDefinition: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceDeclaredCapacityKeys.detail(id) + queryKey: resourceDefinitionKeys.detail(id), }); }, - /** Remove resourceDefinition from cache */resourceDefinition: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceEvent from cache */ resourceEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceDefinitionKeys.detail(id) + queryKey: resourceEventKeys.detail(id), }); }, - /** Remove resourceEvent from cache */resourceEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceInstallation from cache */ resourceInstallation: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceEventKeys.detail(id) + queryKey: resourceInstallationKeys.detail(id), }); }, - /** Remove resourceInstallation from cache */resourceInstallation: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceStatusCheck from cache */ resourceStatusCheck: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceInstallationKeys.detail(id) + queryKey: resourceStatusCheckKeys.detail(id), }); }, - /** Remove resourceStatusCheck from cache */resourceStatusCheck: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceUsageLog from cache */ resourceUsageLog: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceStatusCheckKeys.detail(id) + queryKey: resourceUsageLogKeys.detail(id), }); }, - /** Remove resourceUsageLog from cache */resourceUsageLog: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceUsageSummary from cache */ resourceUsageSummary: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceUsageLogKeys.detail(id) + queryKey: resourceUsageSummaryKeys.detail(id), }); }, - /** Remove resourceUsageSummary from cache */resourceUsageSummary: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceUtilization from cache */ resourceUtilization: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceUsageSummaryKeys.detail(id) + queryKey: resourceUtilizationKeys.detail(id), }); }, - /** Remove resourceUtilization from cache */resourceUtilization: (queryClient: QueryClient, id: string | number) => { + /** Remove resourcesHealth from cache */ resourcesHealth: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceUtilizationKeys.detail(id) + queryKey: resourcesHealthKeys.detail(id), }); }, - /** Remove resourcesHealth from cache */resourcesHealth: (queryClient: QueryClient, id: string | number) => { + /** Remove resourcesRequirementsState from cache */ resourcesRequirementsState: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourcesHealthKeys.detail(id) + queryKey: resourcesRequirementsStateKeys.detail(id), }); }, - /** Remove resourcesRequirementsState from cache */resourcesRequirementsState: (queryClient: QueryClient, id: string | number) => { + /** Remove resourcesResolvedRequirement from cache */ resourcesResolvedRequirement: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourcesRequirementsStateKeys.detail(id) + queryKey: resourcesResolvedRequirementKeys.detail(id), }); }, - /** Remove resourcesResolvedRequirement from cache */resourcesResolvedRequirement: (queryClient: QueryClient, id: string | number) => { + /** Remove webhookEndpoint from cache */ webhookEndpoint: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourcesResolvedRequirementKeys.detail(id) + queryKey: webhookEndpointKeys.detail(id), }); }, - /** Remove webhookEndpoint from cache */webhookEndpoint: (queryClient: QueryClient, id: string | number) => { + /** Remove webhookEvent from cache */ webhookEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: webhookEndpointKeys.detail(id) + queryKey: webhookEventKeys.detail(id), }); }, - /** Remove webhookEvent from cache */webhookEvent: (queryClient: QueryClient, id: string | number) => { - queryClient.removeQueries({ - queryKey: webhookEventKeys.detail(id) - }); - } } as const; diff --git a/sdk/constructive-react/src/compute/hooks/mutation-keys.ts b/sdk/constructive-react/src/compute/hooks/mutation-keys.ts index b799ab8495..4fcd77cc9d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/compute/hooks/mutation-keys.ts @@ -19,406 +19,695 @@ // ============================================================================ export const dbPresetMutationKeys = { - /** All dbPreset mutation keys */all: ["mutation", "dbpreset"] as const, - /** Create dbPreset mutation key */create: () => ["mutation", "dbpreset", "create"] as const, - /** Update dbPreset mutation key */update: (id: string | number) => ["mutation", "dbpreset", "update", id] as const, - /** Delete dbPreset mutation key */delete: (id: string | number) => ["mutation", "dbpreset", "delete", id] as const + /** All dbPreset mutation keys */ all: ['mutation', 'dbpreset'] as const, + /** Create dbPreset mutation key */ create: () => ['mutation', 'dbpreset', 'create'] as const, + /** Update dbPreset mutation key */ update: (id: string | number) => + ['mutation', 'dbpreset', 'update', id] as const, + /** Delete dbPreset mutation key */ delete: (id: string | number) => + ['mutation', 'dbpreset', 'delete', id] as const, } as const; export const functionApiBindingMutationKeys = { - /** All functionApiBinding mutation keys */all: ["mutation", "functionapibinding"] as const, - /** Create functionApiBinding mutation key */create: () => ["mutation", "functionapibinding", "create"] as const, - /** Update functionApiBinding mutation key */update: (id: string | number) => ["mutation", "functionapibinding", "update", id] as const, - /** Delete functionApiBinding mutation key */delete: (id: string | number) => ["mutation", "functionapibinding", "delete", id] as const + /** All functionApiBinding mutation keys */ all: ['mutation', 'functionapibinding'] as const, + /** Create functionApiBinding mutation key */ create: () => + ['mutation', 'functionapibinding', 'create'] as const, + /** Update functionApiBinding mutation key */ update: (id: string | number) => + ['mutation', 'functionapibinding', 'update', id] as const, + /** Delete functionApiBinding mutation key */ delete: (id: string | number) => + ['mutation', 'functionapibinding', 'delete', id] as const, } as const; export const functionDefinitionMutationKeys = { - /** All functionDefinition mutation keys */all: ["mutation", "functiondefinition"] as const, - /** Create functionDefinition mutation key */create: () => ["mutation", "functiondefinition", "create"] as const, - /** Update functionDefinition mutation key */update: (id: string | number) => ["mutation", "functiondefinition", "update", id] as const, - /** Delete functionDefinition mutation key */delete: (id: string | number) => ["mutation", "functiondefinition", "delete", id] as const + /** All functionDefinition mutation keys */ all: ['mutation', 'functiondefinition'] as const, + /** Create functionDefinition mutation key */ create: () => + ['mutation', 'functiondefinition', 'create'] as const, + /** Update functionDefinition mutation key */ update: (id: string | number) => + ['mutation', 'functiondefinition', 'update', id] as const, + /** Delete functionDefinition mutation key */ delete: (id: string | number) => + ['mutation', 'functiondefinition', 'delete', id] as const, } as const; export const functionDeploymentMutationKeys = { - /** All functionDeployment mutation keys */all: ["mutation", "functiondeployment"] as const, - /** Create functionDeployment mutation key */create: () => ["mutation", "functiondeployment", "create"] as const, - /** Update functionDeployment mutation key */update: (id: string | number) => ["mutation", "functiondeployment", "update", id] as const, - /** Delete functionDeployment mutation key */delete: (id: string | number) => ["mutation", "functiondeployment", "delete", id] as const + /** All functionDeployment mutation keys */ all: ['mutation', 'functiondeployment'] as const, + /** Create functionDeployment mutation key */ create: () => + ['mutation', 'functiondeployment', 'create'] as const, + /** Update functionDeployment mutation key */ update: (id: string | number) => + ['mutation', 'functiondeployment', 'update', id] as const, + /** Delete functionDeployment mutation key */ delete: (id: string | number) => + ['mutation', 'functiondeployment', 'delete', id] as const, } as const; export const functionDeploymentEventMutationKeys = { - /** All functionDeploymentEvent mutation keys */all: ["mutation", "functiondeploymentevent"] as const, - /** Create functionDeploymentEvent mutation key */create: () => ["mutation", "functiondeploymentevent", "create"] as const, - /** Update functionDeploymentEvent mutation key */update: (id: string | number) => ["mutation", "functiondeploymentevent", "update", id] as const, - /** Delete functionDeploymentEvent mutation key */delete: (id: string | number) => ["mutation", "functiondeploymentevent", "delete", id] as const + /** All functionDeploymentEvent mutation keys */ all: [ + 'mutation', + 'functiondeploymentevent', + ] as const, + /** Create functionDeploymentEvent mutation key */ create: () => + ['mutation', 'functiondeploymentevent', 'create'] as const, + /** Update functionDeploymentEvent mutation key */ update: (id: string | number) => + ['mutation', 'functiondeploymentevent', 'update', id] as const, + /** Delete functionDeploymentEvent mutation key */ delete: (id: string | number) => + ['mutation', 'functiondeploymentevent', 'delete', id] as const, } as const; export const functionExecutionLogMutationKeys = { - /** All functionExecutionLog mutation keys */all: ["mutation", "functionexecutionlog"] as const, - /** Create functionExecutionLog mutation key */create: () => ["mutation", "functionexecutionlog", "create"] as const, - /** Update functionExecutionLog mutation key */update: (id: string | number) => ["mutation", "functionexecutionlog", "update", id] as const, - /** Delete functionExecutionLog mutation key */delete: (id: string | number) => ["mutation", "functionexecutionlog", "delete", id] as const + /** All functionExecutionLog mutation keys */ all: ['mutation', 'functionexecutionlog'] as const, + /** Create functionExecutionLog mutation key */ create: () => + ['mutation', 'functionexecutionlog', 'create'] as const, + /** Update functionExecutionLog mutation key */ update: (id: string | number) => + ['mutation', 'functionexecutionlog', 'update', id] as const, + /** Delete functionExecutionLog mutation key */ delete: (id: string | number) => + ['mutation', 'functionexecutionlog', 'delete', id] as const, } as const; export const functionGraphCommitMutationKeys = { - /** All functionGraphCommit mutation keys */all: ["mutation", "functiongraphcommit"] as const, - /** Create functionGraphCommit mutation key */create: () => ["mutation", "functiongraphcommit", "create"] as const, - /** Update functionGraphCommit mutation key */update: (id: string | number) => ["mutation", "functiongraphcommit", "update", id] as const, - /** Delete functionGraphCommit mutation key */delete: (id: string | number) => ["mutation", "functiongraphcommit", "delete", id] as const + /** All functionGraphCommit mutation keys */ all: ['mutation', 'functiongraphcommit'] as const, + /** Create functionGraphCommit mutation key */ create: () => + ['mutation', 'functiongraphcommit', 'create'] as const, + /** Update functionGraphCommit mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphcommit', 'update', id] as const, + /** Delete functionGraphCommit mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphcommit', 'delete', id] as const, } as const; export const 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 + /** 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 functionGraphExecutionMutationKeys = { - /** All functionGraphExecution mutation keys */all: ["mutation", "functiongraphexecution"] as const, - /** Create functionGraphExecution mutation key */create: () => ["mutation", "functiongraphexecution", "create"] as const, - /** Update functionGraphExecution mutation key */update: (id: string | number) => ["mutation", "functiongraphexecution", "update", id] as const, - /** Delete functionGraphExecution mutation key */delete: (id: string | number) => ["mutation", "functiongraphexecution", "delete", id] as const + /** All functionGraphExecution mutation keys */ all: [ + 'mutation', + 'functiongraphexecution', + ] as const, + /** Create functionGraphExecution mutation key */ create: () => + ['mutation', 'functiongraphexecution', 'create'] as const, + /** Update functionGraphExecution mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphexecution', 'update', id] as const, + /** Delete functionGraphExecution mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphexecution', 'delete', id] as const, } as const; export const functionGraphExecutionNodeStateMutationKeys = { - /** All functionGraphExecutionNodeState mutation keys */all: ["mutation", "functiongraphexecutionnodestate"] as const, - /** Create functionGraphExecutionNodeState mutation key */create: () => ["mutation", "functiongraphexecutionnodestate", "create"] as const, - /** Update functionGraphExecutionNodeState mutation key */update: (id: string | number) => ["mutation", "functiongraphexecutionnodestate", "update", id] as const, - /** Delete functionGraphExecutionNodeState mutation key */delete: (id: string | number) => ["mutation", "functiongraphexecutionnodestate", "delete", id] as const + /** All functionGraphExecutionNodeState mutation keys */ all: [ + 'mutation', + 'functiongraphexecutionnodestate', + ] as const, + /** Create functionGraphExecutionNodeState mutation key */ create: () => + ['mutation', 'functiongraphexecutionnodestate', 'create'] as const, + /** Update functionGraphExecutionNodeState mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphexecutionnodestate', 'update', id] as const, + /** Delete functionGraphExecutionNodeState mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphexecutionnodestate', 'delete', id] as const, } as const; export const functionGraphExecutionOutputMutationKeys = { - /** All functionGraphExecutionOutput mutation keys */all: ["mutation", "functiongraphexecutionoutput"] as const, - /** Create functionGraphExecutionOutput mutation key */create: () => ["mutation", "functiongraphexecutionoutput", "create"] as const, - /** Update functionGraphExecutionOutput mutation key */update: (id: string | number) => ["mutation", "functiongraphexecutionoutput", "update", id] as const, - /** Delete functionGraphExecutionOutput mutation key */delete: (id: string | number) => ["mutation", "functiongraphexecutionoutput", "delete", id] as const + /** All functionGraphExecutionOutput mutation keys */ all: [ + 'mutation', + 'functiongraphexecutionoutput', + ] as const, + /** Create functionGraphExecutionOutput mutation key */ create: () => + ['mutation', 'functiongraphexecutionoutput', 'create'] as const, + /** Update functionGraphExecutionOutput mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphexecutionoutput', 'update', id] as const, + /** Delete functionGraphExecutionOutput mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphexecutionoutput', 'delete', id] as const, } as const; export const functionGraphObjectMutationKeys = { - /** All functionGraphObject mutation keys */all: ["mutation", "functiongraphobject"] as const, - /** Create functionGraphObject mutation key */create: () => ["mutation", "functiongraphobject", "create"] as const, - /** Update functionGraphObject mutation key */update: (id: string | number) => ["mutation", "functiongraphobject", "update", id] as const, - /** Delete functionGraphObject mutation key */delete: (id: string | number) => ["mutation", "functiongraphobject", "delete", id] as const + /** All functionGraphObject mutation keys */ all: ['mutation', 'functiongraphobject'] as const, + /** Create functionGraphObject mutation key */ create: () => + ['mutation', 'functiongraphobject', 'create'] as const, + /** Update functionGraphObject mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphobject', 'update', id] as const, + /** Delete functionGraphObject mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphobject', 'delete', id] as const, } as const; export const functionGraphRefMutationKeys = { - /** All functionGraphRef mutation keys */all: ["mutation", "functiongraphref"] as const, - /** Create functionGraphRef mutation key */create: () => ["mutation", "functiongraphref", "create"] as const, - /** Update functionGraphRef mutation key */update: (id: string | number) => ["mutation", "functiongraphref", "update", id] as const, - /** Delete functionGraphRef mutation key */delete: (id: string | number) => ["mutation", "functiongraphref", "delete", id] as const + /** All functionGraphRef mutation keys */ all: ['mutation', 'functiongraphref'] as const, + /** Create functionGraphRef mutation key */ create: () => + ['mutation', 'functiongraphref', 'create'] as const, + /** Update functionGraphRef mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphref', 'update', id] as const, + /** Delete functionGraphRef mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphref', 'delete', id] as const, } as const; export const functionGraphStoreMutationKeys = { - /** All functionGraphStore mutation keys */all: ["mutation", "functiongraphstore"] as const, - /** Create functionGraphStore mutation key */create: () => ["mutation", "functiongraphstore", "create"] as const, - /** Update functionGraphStore mutation key */update: (id: string | number) => ["mutation", "functiongraphstore", "update", id] as const, - /** Delete functionGraphStore mutation key */delete: (id: string | number) => ["mutation", "functiongraphstore", "delete", id] as const + /** All functionGraphStore mutation keys */ all: ['mutation', 'functiongraphstore'] as const, + /** Create functionGraphStore mutation key */ create: () => + ['mutation', 'functiongraphstore', 'create'] as const, + /** Update functionGraphStore mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphstore', 'update', id] as const, + /** Delete functionGraphStore mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphstore', 'delete', id] as const, } as const; export const functionInvocationAttemptMutationKeys = { - /** All functionInvocationAttempt mutation keys */all: ["mutation", "functioninvocationattempt"] as const, - /** Create functionInvocationAttempt mutation key */create: () => ["mutation", "functioninvocationattempt", "create"] as const, - /** Update functionInvocationAttempt mutation key */update: (id: string | number) => ["mutation", "functioninvocationattempt", "update", id] as const, - /** Delete functionInvocationAttempt mutation key */delete: (id: string | number) => ["mutation", "functioninvocationattempt", "delete", id] as const + /** All functionInvocationAttempt mutation keys */ all: [ + 'mutation', + 'functioninvocationattempt', + ] as const, + /** Create functionInvocationAttempt mutation key */ create: () => + ['mutation', 'functioninvocationattempt', 'create'] as const, + /** Update functionInvocationAttempt mutation key */ update: (id: string | number) => + ['mutation', 'functioninvocationattempt', 'update', id] as const, + /** Delete functionInvocationAttempt mutation key */ delete: (id: string | number) => + ['mutation', 'functioninvocationattempt', 'delete', id] as const, } as const; export const functionInvocationMutationKeys = { - /** All functionInvocation mutation keys */all: ["mutation", "functioninvocation"] as const, - /** Create functionInvocation mutation key */create: () => ["mutation", "functioninvocation", "create"] as const, - /** Update functionInvocation mutation key */update: (id: string | number) => ["mutation", "functioninvocation", "update", id] as const, - /** Delete functionInvocation mutation key */delete: (id: string | number) => ["mutation", "functioninvocation", "delete", id] as const + /** All functionInvocation mutation keys */ all: ['mutation', 'functioninvocation'] as const, + /** Create functionInvocation mutation key */ create: () => + ['mutation', 'functioninvocation', 'create'] as const, + /** Update functionInvocation mutation key */ update: (id: string | number) => + ['mutation', 'functioninvocation', 'update', id] as const, + /** Delete functionInvocation mutation key */ delete: (id: string | number) => + ['mutation', 'functioninvocation', 'delete', id] as const, } as const; export const getAllTreeNodesRecordMutationKeys = { - /** All getAllTreeNodesRecord mutation keys */all: ["mutation", "getalltreenodesrecord"] as const, - /** Create getAllTreeNodesRecord mutation key */create: () => ["mutation", "getalltreenodesrecord", "create"] as const, - /** Update getAllTreeNodesRecord mutation key */update: (id: string | number) => ["mutation", "getalltreenodesrecord", "update", id] as const, - /** Delete getAllTreeNodesRecord mutation key */delete: (id: string | number) => ["mutation", "getalltreenodesrecord", "delete", id] as const + /** All getAllTreeNodesRecord mutation keys */ all: [ + 'mutation', + 'getalltreenodesrecord', + ] as const, + /** Create getAllTreeNodesRecord mutation key */ create: () => + ['mutation', 'getalltreenodesrecord', 'create'] as const, + /** Update getAllTreeNodesRecord mutation key */ update: (id: string | number) => + ['mutation', 'getalltreenodesrecord', 'update', id] as const, + /** Delete getAllTreeNodesRecord mutation key */ delete: (id: string | number) => + ['mutation', 'getalltreenodesrecord', 'delete', id] as const, } as const; export const infraCommitMutationKeys = { - /** All infraCommit mutation keys */all: ["mutation", "infracommit"] as const, - /** Create infraCommit mutation key */create: () => ["mutation", "infracommit", "create"] as const, - /** Update infraCommit mutation key */update: (id: string | number) => ["mutation", "infracommit", "update", id] as const, - /** Delete infraCommit mutation key */delete: (id: string | number) => ["mutation", "infracommit", "delete", id] as const + /** All infraCommit mutation keys */ all: ['mutation', 'infracommit'] as const, + /** Create infraCommit mutation key */ create: () => + ['mutation', 'infracommit', 'create'] as const, + /** Update infraCommit mutation key */ update: (id: string | number) => + ['mutation', 'infracommit', 'update', id] as const, + /** Delete infraCommit mutation key */ delete: (id: string | number) => + ['mutation', 'infracommit', 'delete', id] as const, } as const; export const infraGetAllTreeNodesRecordMutationKeys = { - /** All infraGetAllTreeNodesRecord mutation keys */all: ["mutation", "infragetalltreenodesrecord"] as const, - /** Create infraGetAllTreeNodesRecord mutation key */create: () => ["mutation", "infragetalltreenodesrecord", "create"] as const, - /** Update infraGetAllTreeNodesRecord mutation key */update: (id: string | number) => ["mutation", "infragetalltreenodesrecord", "update", id] as const, - /** Delete infraGetAllTreeNodesRecord mutation key */delete: (id: string | number) => ["mutation", "infragetalltreenodesrecord", "delete", id] as const + /** All infraGetAllTreeNodesRecord mutation keys */ all: [ + 'mutation', + 'infragetalltreenodesrecord', + ] as const, + /** Create infraGetAllTreeNodesRecord mutation key */ create: () => + ['mutation', 'infragetalltreenodesrecord', 'create'] as const, + /** Update infraGetAllTreeNodesRecord mutation key */ update: (id: string | number) => + ['mutation', 'infragetalltreenodesrecord', 'update', id] as const, + /** Delete infraGetAllTreeNodesRecord mutation key */ delete: (id: string | number) => + ['mutation', 'infragetalltreenodesrecord', 'delete', id] as const, } as const; export const infraObjectMutationKeys = { - /** All infraObject mutation keys */all: ["mutation", "infraobject"] as const, - /** Create infraObject mutation key */create: () => ["mutation", "infraobject", "create"] as const, - /** Update infraObject mutation key */update: (id: string | number) => ["mutation", "infraobject", "update", id] as const, - /** Delete infraObject mutation key */delete: (id: string | number) => ["mutation", "infraobject", "delete", id] as const + /** All infraObject mutation keys */ all: ['mutation', 'infraobject'] as const, + /** Create infraObject mutation key */ create: () => + ['mutation', 'infraobject', 'create'] as const, + /** Update infraObject mutation key */ update: (id: string | number) => + ['mutation', 'infraobject', 'update', id] as const, + /** Delete infraObject mutation key */ delete: (id: string | number) => + ['mutation', 'infraobject', 'delete', id] as const, } as const; export const infraRefMutationKeys = { - /** All infraRef mutation keys */all: ["mutation", "infraref"] as const, - /** Create infraRef mutation key */create: () => ["mutation", "infraref", "create"] as const, - /** Update infraRef mutation key */update: (id: string | number) => ["mutation", "infraref", "update", id] as const, - /** Delete infraRef mutation key */delete: (id: string | number) => ["mutation", "infraref", "delete", id] as const + /** All infraRef mutation keys */ all: ['mutation', 'infraref'] as const, + /** Create infraRef mutation key */ create: () => ['mutation', 'infraref', 'create'] as const, + /** Update infraRef mutation key */ update: (id: string | number) => + ['mutation', 'infraref', 'update', id] as const, + /** Delete infraRef mutation key */ delete: (id: string | number) => + ['mutation', 'infraref', 'delete', id] as const, } as const; export const infraStoreMutationKeys = { - /** All infraStore mutation keys */all: ["mutation", "infrastore"] as const, - /** Create infraStore mutation key */create: () => ["mutation", "infrastore", "create"] as const, - /** Update infraStore mutation key */update: (id: string | number) => ["mutation", "infrastore", "update", id] as const, - /** Delete infraStore mutation key */delete: (id: string | number) => ["mutation", "infrastore", "delete", id] as const + /** All infraStore mutation keys */ all: ['mutation', 'infrastore'] as const, + /** Create infraStore mutation key */ create: () => ['mutation', 'infrastore', 'create'] as const, + /** Update infraStore mutation key */ update: (id: string | number) => + ['mutation', 'infrastore', 'update', id] as const, + /** Delete infraStore mutation key */ delete: (id: string | number) => + ['mutation', 'infrastore', 'delete', id] as const, } as const; export const integrationProviderMutationKeys = { - /** All integrationProvider mutation keys */all: ["mutation", "integrationprovider"] as const, - /** Create integrationProvider mutation key */create: () => ["mutation", "integrationprovider", "create"] as const, - /** Update integrationProvider mutation key */update: (id: string | number) => ["mutation", "integrationprovider", "update", id] as const, - /** Delete integrationProvider mutation key */delete: (id: string | number) => ["mutation", "integrationprovider", "delete", id] as const + /** All integrationProvider mutation keys */ all: ['mutation', 'integrationprovider'] as const, + /** Create integrationProvider mutation key */ create: () => + ['mutation', 'integrationprovider', 'create'] as const, + /** Update integrationProvider mutation key */ update: (id: string | number) => + ['mutation', 'integrationprovider', 'update', id] as const, + /** Delete integrationProvider mutation key */ delete: (id: string | number) => + ['mutation', 'integrationprovider', 'delete', id] as const, } as const; export const namespaceMutationKeys = { - /** All namespace mutation keys */all: ["mutation", "namespace"] as const, - /** Create namespace mutation key */create: () => ["mutation", "namespace", "create"] as const, - /** Update namespace mutation key */update: (id: string | number) => ["mutation", "namespace", "update", id] as const, - /** Delete namespace mutation key */delete: (id: string | number) => ["mutation", "namespace", "delete", id] as const + /** All namespace mutation keys */ all: ['mutation', 'namespace'] as const, + /** Create namespace mutation key */ create: () => ['mutation', 'namespace', 'create'] as const, + /** Update namespace mutation key */ update: (id: string | number) => + ['mutation', 'namespace', 'update', id] as const, + /** Delete namespace mutation key */ delete: (id: string | number) => + ['mutation', 'namespace', 'delete', id] as const, } as const; export const namespaceEventMutationKeys = { - /** All namespaceEvent mutation keys */all: ["mutation", "namespaceevent"] as const, - /** Create namespaceEvent mutation key */create: () => ["mutation", "namespaceevent", "create"] as const, - /** Update namespaceEvent mutation key */update: (id: string | number) => ["mutation", "namespaceevent", "update", id] as const, - /** Delete namespaceEvent mutation key */delete: (id: string | number) => ["mutation", "namespaceevent", "delete", id] as const + /** All namespaceEvent mutation keys */ all: ['mutation', 'namespaceevent'] as const, + /** Create namespaceEvent mutation key */ create: () => + ['mutation', 'namespaceevent', 'create'] as const, + /** Update namespaceEvent mutation key */ update: (id: string | number) => + ['mutation', 'namespaceevent', 'update', id] as const, + /** Delete namespaceEvent mutation key */ delete: (id: string | number) => + ['mutation', 'namespaceevent', 'delete', id] as const, } as const; export const platformFunctionApiBindingMutationKeys = { - /** All platformFunctionApiBinding mutation keys */all: ["mutation", "platformfunctionapibinding"] as const, - /** Create platformFunctionApiBinding mutation key */create: () => ["mutation", "platformfunctionapibinding", "create"] as const, - /** Update platformFunctionApiBinding mutation key */update: (id: string | number) => ["mutation", "platformfunctionapibinding", "update", id] as const, - /** Delete platformFunctionApiBinding mutation key */delete: (id: string | number) => ["mutation", "platformfunctionapibinding", "delete", id] as const + /** All platformFunctionApiBinding mutation keys */ all: [ + 'mutation', + 'platformfunctionapibinding', + ] as const, + /** Create platformFunctionApiBinding mutation key */ create: () => + ['mutation', 'platformfunctionapibinding', 'create'] as const, + /** Update platformFunctionApiBinding mutation key */ update: (id: string | number) => + ['mutation', 'platformfunctionapibinding', 'update', id] as const, + /** Delete platformFunctionApiBinding mutation key */ delete: (id: string | number) => + ['mutation', 'platformfunctionapibinding', 'delete', id] as const, } as const; export const platformFunctionDefinitionMutationKeys = { - /** All platformFunctionDefinition mutation keys */all: ["mutation", "platformfunctiondefinition"] as const, - /** Create platformFunctionDefinition mutation key */create: () => ["mutation", "platformfunctiondefinition", "create"] as const, - /** Update platformFunctionDefinition mutation key */update: (id: string | number) => ["mutation", "platformfunctiondefinition", "update", id] as const, - /** Delete platformFunctionDefinition mutation key */delete: (id: string | number) => ["mutation", "platformfunctiondefinition", "delete", id] as const + /** All platformFunctionDefinition mutation keys */ all: [ + 'mutation', + 'platformfunctiondefinition', + ] as const, + /** Create platformFunctionDefinition mutation key */ create: () => + ['mutation', 'platformfunctiondefinition', 'create'] as const, + /** Update platformFunctionDefinition mutation key */ update: (id: string | number) => + ['mutation', 'platformfunctiondefinition', 'update', id] as const, + /** Delete platformFunctionDefinition mutation key */ delete: (id: string | number) => + ['mutation', 'platformfunctiondefinition', 'delete', id] as const, } as const; export const platformFunctionDeploymentMutationKeys = { - /** All platformFunctionDeployment mutation keys */all: ["mutation", "platformfunctiondeployment"] as const, - /** Create platformFunctionDeployment mutation key */create: () => ["mutation", "platformfunctiondeployment", "create"] as const, - /** Update platformFunctionDeployment mutation key */update: (id: string | number) => ["mutation", "platformfunctiondeployment", "update", id] as const, - /** Delete platformFunctionDeployment mutation key */delete: (id: string | number) => ["mutation", "platformfunctiondeployment", "delete", id] as const + /** All platformFunctionDeployment mutation keys */ all: [ + 'mutation', + 'platformfunctiondeployment', + ] as const, + /** Create platformFunctionDeployment mutation key */ create: () => + ['mutation', 'platformfunctiondeployment', 'create'] as const, + /** Update platformFunctionDeployment mutation key */ update: (id: string | number) => + ['mutation', 'platformfunctiondeployment', 'update', id] as const, + /** Delete platformFunctionDeployment mutation key */ delete: (id: string | number) => + ['mutation', 'platformfunctiondeployment', 'delete', id] as const, } as const; export const platformFunctionDeploymentEventMutationKeys = { - /** All platformFunctionDeploymentEvent mutation keys */all: ["mutation", "platformfunctiondeploymentevent"] as const, - /** Create platformFunctionDeploymentEvent mutation key */create: () => ["mutation", "platformfunctiondeploymentevent", "create"] as const, - /** Update platformFunctionDeploymentEvent mutation key */update: (id: string | number) => ["mutation", "platformfunctiondeploymentevent", "update", id] as const, - /** Delete platformFunctionDeploymentEvent mutation key */delete: (id: string | number) => ["mutation", "platformfunctiondeploymentevent", "delete", id] as const + /** All platformFunctionDeploymentEvent mutation keys */ all: [ + 'mutation', + 'platformfunctiondeploymentevent', + ] as const, + /** Create platformFunctionDeploymentEvent mutation key */ create: () => + ['mutation', 'platformfunctiondeploymentevent', 'create'] as const, + /** Update platformFunctionDeploymentEvent mutation key */ update: (id: string | number) => + ['mutation', 'platformfunctiondeploymentevent', 'update', id] as const, + /** Delete platformFunctionDeploymentEvent mutation key */ delete: (id: string | number) => + ['mutation', 'platformfunctiondeploymentevent', 'delete', id] as const, } as const; export const platformFunctionExecutionLogMutationKeys = { - /** All platformFunctionExecutionLog mutation keys */all: ["mutation", "platformfunctionexecutionlog"] as const, - /** Create platformFunctionExecutionLog mutation key */create: () => ["mutation", "platformfunctionexecutionlog", "create"] as const, - /** Update platformFunctionExecutionLog mutation key */update: (id: string | number) => ["mutation", "platformfunctionexecutionlog", "update", id] as const, - /** Delete platformFunctionExecutionLog mutation key */delete: (id: string | number) => ["mutation", "platformfunctionexecutionlog", "delete", id] as const + /** All platformFunctionExecutionLog mutation keys */ all: [ + 'mutation', + 'platformfunctionexecutionlog', + ] as const, + /** Create platformFunctionExecutionLog mutation key */ create: () => + ['mutation', 'platformfunctionexecutionlog', 'create'] as const, + /** Update platformFunctionExecutionLog mutation key */ update: (id: string | number) => + ['mutation', 'platformfunctionexecutionlog', 'update', id] as const, + /** Delete platformFunctionExecutionLog mutation key */ delete: (id: string | number) => + ['mutation', 'platformfunctionexecutionlog', 'delete', id] as const, } as const; export const platformFunctionInvocationAttemptMutationKeys = { - /** All platformFunctionInvocationAttempt mutation keys */all: ["mutation", "platformfunctioninvocationattempt"] as const, - /** Create platformFunctionInvocationAttempt mutation key */create: () => ["mutation", "platformfunctioninvocationattempt", "create"] as const, - /** Update platformFunctionInvocationAttempt mutation key */update: (id: string | number) => ["mutation", "platformfunctioninvocationattempt", "update", id] as const, - /** Delete platformFunctionInvocationAttempt mutation key */delete: (id: string | number) => ["mutation", "platformfunctioninvocationattempt", "delete", id] as const + /** All platformFunctionInvocationAttempt mutation keys */ all: [ + 'mutation', + 'platformfunctioninvocationattempt', + ] as const, + /** Create platformFunctionInvocationAttempt mutation key */ create: () => + ['mutation', 'platformfunctioninvocationattempt', 'create'] as const, + /** Update platformFunctionInvocationAttempt mutation key */ update: (id: string | number) => + ['mutation', 'platformfunctioninvocationattempt', 'update', id] as const, + /** Delete platformFunctionInvocationAttempt mutation key */ delete: (id: string | number) => + ['mutation', 'platformfunctioninvocationattempt', 'delete', id] as const, } as const; export const platformFunctionInvocationMutationKeys = { - /** All platformFunctionInvocation mutation keys */all: ["mutation", "platformfunctioninvocation"] as const, - /** Create platformFunctionInvocation mutation key */create: () => ["mutation", "platformfunctioninvocation", "create"] as const, - /** Update platformFunctionInvocation mutation key */update: (id: string | number) => ["mutation", "platformfunctioninvocation", "update", id] as const, - /** Delete platformFunctionInvocation mutation key */delete: (id: string | number) => ["mutation", "platformfunctioninvocation", "delete", id] as const + /** All platformFunctionInvocation mutation keys */ all: [ + 'mutation', + 'platformfunctioninvocation', + ] as const, + /** Create platformFunctionInvocation mutation key */ create: () => + ['mutation', 'platformfunctioninvocation', 'create'] as const, + /** Update platformFunctionInvocation mutation key */ update: (id: string | number) => + ['mutation', 'platformfunctioninvocation', 'update', id] as const, + /** Delete platformFunctionInvocation mutation key */ delete: (id: string | number) => + ['mutation', 'platformfunctioninvocation', 'delete', id] as const, } as const; export const platformInfraCommitMutationKeys = { - /** All platformInfraCommit mutation keys */all: ["mutation", "platforminfracommit"] as const, - /** Create platformInfraCommit mutation key */create: () => ["mutation", "platforminfracommit", "create"] as const, - /** Update platformInfraCommit mutation key */update: (id: string | number) => ["mutation", "platforminfracommit", "update", id] as const, - /** Delete platformInfraCommit mutation key */delete: (id: string | number) => ["mutation", "platforminfracommit", "delete", id] as const + /** All platformInfraCommit mutation keys */ all: ['mutation', 'platforminfracommit'] as const, + /** Create platformInfraCommit mutation key */ create: () => + ['mutation', 'platforminfracommit', 'create'] as const, + /** Update platformInfraCommit mutation key */ update: (id: string | number) => + ['mutation', 'platforminfracommit', 'update', id] as const, + /** Delete platformInfraCommit mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfracommit', 'delete', id] as const, } as const; export const platformInfraGetAllTreeNodesRecordMutationKeys = { - /** All platformInfraGetAllTreeNodesRecord mutation keys */all: ["mutation", "platforminfragetalltreenodesrecord"] as const, - /** Create platformInfraGetAllTreeNodesRecord mutation key */create: () => ["mutation", "platforminfragetalltreenodesrecord", "create"] as const, - /** Update platformInfraGetAllTreeNodesRecord mutation key */update: (id: string | number) => ["mutation", "platforminfragetalltreenodesrecord", "update", id] as const, - /** Delete platformInfraGetAllTreeNodesRecord mutation key */delete: (id: string | number) => ["mutation", "platforminfragetalltreenodesrecord", "delete", id] as const + /** All platformInfraGetAllTreeNodesRecord mutation keys */ all: [ + 'mutation', + 'platforminfragetalltreenodesrecord', + ] as const, + /** Create platformInfraGetAllTreeNodesRecord mutation key */ create: () => + ['mutation', 'platforminfragetalltreenodesrecord', 'create'] as const, + /** Update platformInfraGetAllTreeNodesRecord mutation key */ update: (id: string | number) => + ['mutation', 'platforminfragetalltreenodesrecord', 'update', id] as const, + /** Delete platformInfraGetAllTreeNodesRecord mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfragetalltreenodesrecord', 'delete', id] as const, } as const; export const platformInfraObjectMutationKeys = { - /** All platformInfraObject mutation keys */all: ["mutation", "platforminfraobject"] as const, - /** Create platformInfraObject mutation key */create: () => ["mutation", "platforminfraobject", "create"] as const, - /** Update platformInfraObject mutation key */update: (id: string | number) => ["mutation", "platforminfraobject", "update", id] as const, - /** Delete platformInfraObject mutation key */delete: (id: string | number) => ["mutation", "platforminfraobject", "delete", id] as const + /** All platformInfraObject mutation keys */ all: ['mutation', 'platforminfraobject'] as const, + /** Create platformInfraObject mutation key */ create: () => + ['mutation', 'platforminfraobject', 'create'] as const, + /** Update platformInfraObject mutation key */ update: (id: string | number) => + ['mutation', 'platforminfraobject', 'update', id] as const, + /** Delete platformInfraObject mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfraobject', 'delete', id] as const, } as const; export const platformInfraRefMutationKeys = { - /** All platformInfraRef mutation keys */all: ["mutation", "platforminfraref"] as const, - /** Create platformInfraRef mutation key */create: () => ["mutation", "platforminfraref", "create"] as const, - /** Update platformInfraRef mutation key */update: (id: string | number) => ["mutation", "platforminfraref", "update", id] as const, - /** Delete platformInfraRef mutation key */delete: (id: string | number) => ["mutation", "platforminfraref", "delete", id] as const + /** All platformInfraRef mutation keys */ all: ['mutation', 'platforminfraref'] as const, + /** Create platformInfraRef mutation key */ create: () => + ['mutation', 'platforminfraref', 'create'] as const, + /** Update platformInfraRef mutation key */ update: (id: string | number) => + ['mutation', 'platforminfraref', 'update', id] as const, + /** Delete platformInfraRef mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfraref', 'delete', id] as const, } as const; export const platformInfraStoreMutationKeys = { - /** All platformInfraStore mutation keys */all: ["mutation", "platforminfrastore"] as const, - /** Create platformInfraStore mutation key */create: () => ["mutation", "platforminfrastore", "create"] as const, - /** Update platformInfraStore mutation key */update: (id: string | number) => ["mutation", "platforminfrastore", "update", id] as const, - /** Delete platformInfraStore mutation key */delete: (id: string | number) => ["mutation", "platforminfrastore", "delete", id] as const + /** All platformInfraStore mutation keys */ all: ['mutation', 'platforminfrastore'] as const, + /** Create platformInfraStore mutation key */ create: () => + ['mutation', 'platforminfrastore', 'create'] as const, + /** Update platformInfraStore mutation key */ update: (id: string | number) => + ['mutation', 'platforminfrastore', 'update', id] as const, + /** Delete platformInfraStore mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfrastore', 'delete', id] as const, } as const; export const platformNamespaceMutationKeys = { - /** All platformNamespace mutation keys */all: ["mutation", "platformnamespace"] as const, - /** Create platformNamespace mutation key */create: () => ["mutation", "platformnamespace", "create"] as const, - /** Update platformNamespace mutation key */update: (id: string | number) => ["mutation", "platformnamespace", "update", id] as const, - /** Delete platformNamespace mutation key */delete: (id: string | number) => ["mutation", "platformnamespace", "delete", id] as const + /** All platformNamespace mutation keys */ all: ['mutation', 'platformnamespace'] as const, + /** Create platformNamespace mutation key */ create: () => + ['mutation', 'platformnamespace', 'create'] as const, + /** Update platformNamespace mutation key */ update: (id: string | number) => + ['mutation', 'platformnamespace', 'update', id] as const, + /** Delete platformNamespace mutation key */ delete: (id: string | number) => + ['mutation', 'platformnamespace', 'delete', id] as const, } as const; export const platformNamespaceEventMutationKeys = { - /** All platformNamespaceEvent mutation keys */all: ["mutation", "platformnamespaceevent"] as const, - /** Create platformNamespaceEvent mutation key */create: () => ["mutation", "platformnamespaceevent", "create"] as const, - /** Update platformNamespaceEvent mutation key */update: (id: string | number) => ["mutation", "platformnamespaceevent", "update", id] as const, - /** Delete platformNamespaceEvent mutation key */delete: (id: string | number) => ["mutation", "platformnamespaceevent", "delete", id] as const + /** All platformNamespaceEvent mutation keys */ all: [ + 'mutation', + 'platformnamespaceevent', + ] as const, + /** Create platformNamespaceEvent mutation key */ create: () => + ['mutation', 'platformnamespaceevent', 'create'] as const, + /** Update platformNamespaceEvent mutation key */ update: (id: string | number) => + ['mutation', 'platformnamespaceevent', 'update', id] as const, + /** Delete platformNamespaceEvent mutation key */ delete: (id: string | number) => + ['mutation', 'platformnamespaceevent', 'delete', id] as const, } as const; export const platformResourceMutationKeys = { - /** All platformResource mutation keys */all: ["mutation", "platformresource"] as const, - /** Create platformResource mutation key */create: () => ["mutation", "platformresource", "create"] as const, - /** Update platformResource mutation key */update: (id: string | number) => ["mutation", "platformresource", "update", id] as const, - /** Delete platformResource mutation key */delete: (id: string | number) => ["mutation", "platformresource", "delete", id] as const + /** All platformResource mutation keys */ all: ['mutation', 'platformresource'] as const, + /** Create platformResource mutation key */ create: () => + ['mutation', 'platformresource', 'create'] as const, + /** Update platformResource mutation key */ update: (id: string | number) => + ['mutation', 'platformresource', 'update', id] as const, + /** Delete platformResource mutation key */ delete: (id: string | number) => + ['mutation', 'platformresource', 'delete', id] as const, } as const; export const platformResourceDeclaredCapacityMutationKeys = { - /** All platformResourceDeclaredCapacity mutation keys */all: ["mutation", "platformresourcedeclaredcapacity"] as const, - /** Create platformResourceDeclaredCapacity mutation key */create: () => ["mutation", "platformresourcedeclaredcapacity", "create"] as const, - /** Update platformResourceDeclaredCapacity mutation key */update: (id: string | number) => ["mutation", "platformresourcedeclaredcapacity", "update", id] as const, - /** Delete platformResourceDeclaredCapacity mutation key */delete: (id: string | number) => ["mutation", "platformresourcedeclaredcapacity", "delete", id] as const + /** All platformResourceDeclaredCapacity mutation keys */ all: [ + 'mutation', + 'platformresourcedeclaredcapacity', + ] as const, + /** Create platformResourceDeclaredCapacity mutation key */ create: () => + ['mutation', 'platformresourcedeclaredcapacity', 'create'] as const, + /** Update platformResourceDeclaredCapacity mutation key */ update: (id: string | number) => + ['mutation', 'platformresourcedeclaredcapacity', 'update', id] as const, + /** Delete platformResourceDeclaredCapacity mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourcedeclaredcapacity', 'delete', id] as const, } as const; export const platformResourceDefinitionMutationKeys = { - /** All platformResourceDefinition mutation keys */all: ["mutation", "platformresourcedefinition"] as const, - /** Create platformResourceDefinition mutation key */create: () => ["mutation", "platformresourcedefinition", "create"] as const, - /** Update platformResourceDefinition mutation key */update: (id: string | number) => ["mutation", "platformresourcedefinition", "update", id] as const, - /** Delete platformResourceDefinition mutation key */delete: (id: string | number) => ["mutation", "platformresourcedefinition", "delete", id] as const + /** All platformResourceDefinition mutation keys */ all: [ + 'mutation', + 'platformresourcedefinition', + ] as const, + /** Create platformResourceDefinition mutation key */ create: () => + ['mutation', 'platformresourcedefinition', 'create'] as const, + /** Update platformResourceDefinition mutation key */ update: (id: string | number) => + ['mutation', 'platformresourcedefinition', 'update', id] as const, + /** Delete platformResourceDefinition mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourcedefinition', 'delete', id] as const, } as const; export const platformResourceEventMutationKeys = { - /** All platformResourceEvent mutation keys */all: ["mutation", "platformresourceevent"] as const, - /** Create platformResourceEvent mutation key */create: () => ["mutation", "platformresourceevent", "create"] as const, - /** Update platformResourceEvent mutation key */update: (id: string | number) => ["mutation", "platformresourceevent", "update", id] as const, - /** Delete platformResourceEvent mutation key */delete: (id: string | number) => ["mutation", "platformresourceevent", "delete", id] as const + /** All platformResourceEvent mutation keys */ all: [ + 'mutation', + 'platformresourceevent', + ] as const, + /** Create platformResourceEvent mutation key */ create: () => + ['mutation', 'platformresourceevent', 'create'] as const, + /** Update platformResourceEvent mutation key */ update: (id: string | number) => + ['mutation', 'platformresourceevent', 'update', id] as const, + /** Delete platformResourceEvent mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourceevent', 'delete', id] as const, } as const; export const platformResourceInstallationMutationKeys = { - /** All platformResourceInstallation mutation keys */all: ["mutation", "platformresourceinstallation"] as const, - /** Create platformResourceInstallation mutation key */create: () => ["mutation", "platformresourceinstallation", "create"] as const, - /** Update platformResourceInstallation mutation key */update: (id: string | number) => ["mutation", "platformresourceinstallation", "update", id] as const, - /** Delete platformResourceInstallation mutation key */delete: (id: string | number) => ["mutation", "platformresourceinstallation", "delete", id] as const + /** All platformResourceInstallation mutation keys */ all: [ + 'mutation', + 'platformresourceinstallation', + ] as const, + /** Create platformResourceInstallation mutation key */ create: () => + ['mutation', 'platformresourceinstallation', 'create'] as const, + /** Update platformResourceInstallation mutation key */ update: (id: string | number) => + ['mutation', 'platformresourceinstallation', 'update', id] as const, + /** Delete platformResourceInstallation mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourceinstallation', 'delete', id] as const, } as const; export const platformResourceStatusCheckMutationKeys = { - /** All platformResourceStatusCheck mutation keys */all: ["mutation", "platformresourcestatuscheck"] as const, - /** Create platformResourceStatusCheck mutation key */create: () => ["mutation", "platformresourcestatuscheck", "create"] as const, - /** Update platformResourceStatusCheck mutation key */update: (id: string | number) => ["mutation", "platformresourcestatuscheck", "update", id] as const, - /** Delete platformResourceStatusCheck mutation key */delete: (id: string | number) => ["mutation", "platformresourcestatuscheck", "delete", id] as const + /** All platformResourceStatusCheck mutation keys */ all: [ + 'mutation', + 'platformresourcestatuscheck', + ] as const, + /** Create platformResourceStatusCheck mutation key */ create: () => + ['mutation', 'platformresourcestatuscheck', 'create'] as const, + /** Update platformResourceStatusCheck mutation key */ update: (id: string | number) => + ['mutation', 'platformresourcestatuscheck', 'update', id] as const, + /** Delete platformResourceStatusCheck mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourcestatuscheck', 'delete', id] as const, } as const; export const platformResourceUsageLogMutationKeys = { - /** All platformResourceUsageLog mutation keys */all: ["mutation", "platformresourceusagelog"] as const, - /** Create platformResourceUsageLog mutation key */create: () => ["mutation", "platformresourceusagelog", "create"] as const, - /** Update platformResourceUsageLog mutation key */update: (id: string | number) => ["mutation", "platformresourceusagelog", "update", id] as const, - /** Delete platformResourceUsageLog mutation key */delete: (id: string | number) => ["mutation", "platformresourceusagelog", "delete", id] as const + /** All platformResourceUsageLog mutation keys */ all: [ + 'mutation', + 'platformresourceusagelog', + ] as const, + /** Create platformResourceUsageLog mutation key */ create: () => + ['mutation', 'platformresourceusagelog', 'create'] as const, + /** Update platformResourceUsageLog mutation key */ update: (id: string | number) => + ['mutation', 'platformresourceusagelog', 'update', id] as const, + /** Delete platformResourceUsageLog mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourceusagelog', 'delete', id] as const, } as const; export const platformResourceUsageSummaryMutationKeys = { - /** All platformResourceUsageSummary mutation keys */all: ["mutation", "platformresourceusagesummary"] as const, - /** Create platformResourceUsageSummary mutation key */create: () => ["mutation", "platformresourceusagesummary", "create"] as const, - /** Update platformResourceUsageSummary mutation key */update: (id: string | number) => ["mutation", "platformresourceusagesummary", "update", id] as const, - /** Delete platformResourceUsageSummary mutation key */delete: (id: string | number) => ["mutation", "platformresourceusagesummary", "delete", id] as const + /** All platformResourceUsageSummary mutation keys */ all: [ + 'mutation', + 'platformresourceusagesummary', + ] as const, + /** Create platformResourceUsageSummary mutation key */ create: () => + ['mutation', 'platformresourceusagesummary', 'create'] as const, + /** Update platformResourceUsageSummary mutation key */ update: (id: string | number) => + ['mutation', 'platformresourceusagesummary', 'update', id] as const, + /** Delete platformResourceUsageSummary mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourceusagesummary', 'delete', id] as const, } as const; export const platformResourceUtilizationMutationKeys = { - /** All platformResourceUtilization mutation keys */all: ["mutation", "platformresourceutilization"] as const, - /** Create platformResourceUtilization mutation key */create: () => ["mutation", "platformresourceutilization", "create"] as const, - /** Update platformResourceUtilization mutation key */update: (id: string | number) => ["mutation", "platformresourceutilization", "update", id] as const, - /** Delete platformResourceUtilization mutation key */delete: (id: string | number) => ["mutation", "platformresourceutilization", "delete", id] as const + /** All platformResourceUtilization mutation keys */ all: [ + 'mutation', + 'platformresourceutilization', + ] as const, + /** Create platformResourceUtilization mutation key */ create: () => + ['mutation', 'platformresourceutilization', 'create'] as const, + /** Update platformResourceUtilization mutation key */ update: (id: string | number) => + ['mutation', 'platformresourceutilization', 'update', id] as const, + /** Delete platformResourceUtilization mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourceutilization', 'delete', id] as const, } as const; export const platformResourcesHealthMutationKeys = { - /** All platformResourcesHealth mutation keys */all: ["mutation", "platformresourceshealth"] as const, - /** Create platformResourcesHealth mutation key */create: () => ["mutation", "platformresourceshealth", "create"] as const, - /** Update platformResourcesHealth mutation key */update: (id: string | number) => ["mutation", "platformresourceshealth", "update", id] as const, - /** Delete platformResourcesHealth mutation key */delete: (id: string | number) => ["mutation", "platformresourceshealth", "delete", id] as const + /** All platformResourcesHealth mutation keys */ all: [ + 'mutation', + 'platformresourceshealth', + ] as const, + /** Create platformResourcesHealth mutation key */ create: () => + ['mutation', 'platformresourceshealth', 'create'] as const, + /** Update platformResourcesHealth mutation key */ update: (id: string | number) => + ['mutation', 'platformresourceshealth', 'update', id] as const, + /** Delete platformResourcesHealth mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourceshealth', 'delete', id] as const, } as const; export const platformResourcesRequirementsStateMutationKeys = { - /** All platformResourcesRequirementsState mutation keys */all: ["mutation", "platformresourcesrequirementsstate"] as const, - /** Create platformResourcesRequirementsState mutation key */create: () => ["mutation", "platformresourcesrequirementsstate", "create"] as const, - /** Update platformResourcesRequirementsState mutation key */update: (id: string | number) => ["mutation", "platformresourcesrequirementsstate", "update", id] as const, - /** Delete platformResourcesRequirementsState mutation key */delete: (id: string | number) => ["mutation", "platformresourcesrequirementsstate", "delete", id] as const + /** All platformResourcesRequirementsState mutation keys */ all: [ + 'mutation', + 'platformresourcesrequirementsstate', + ] as const, + /** Create platformResourcesRequirementsState mutation key */ create: () => + ['mutation', 'platformresourcesrequirementsstate', 'create'] as const, + /** Update platformResourcesRequirementsState mutation key */ update: (id: string | number) => + ['mutation', 'platformresourcesrequirementsstate', 'update', id] as const, + /** Delete platformResourcesRequirementsState mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourcesrequirementsstate', 'delete', id] as const, } as const; export const platformResourcesResolvedRequirementMutationKeys = { - /** All platformResourcesResolvedRequirement mutation keys */all: ["mutation", "platformresourcesresolvedrequirement"] as const, - /** Create platformResourcesResolvedRequirement mutation key */create: () => ["mutation", "platformresourcesresolvedrequirement", "create"] as const, - /** Update platformResourcesResolvedRequirement mutation key */update: (id: string | number) => ["mutation", "platformresourcesresolvedrequirement", "update", id] as const, - /** Delete platformResourcesResolvedRequirement mutation key */delete: (id: string | number) => ["mutation", "platformresourcesresolvedrequirement", "delete", id] as const + /** All platformResourcesResolvedRequirement mutation keys */ all: [ + 'mutation', + 'platformresourcesresolvedrequirement', + ] as const, + /** Create platformResourcesResolvedRequirement mutation key */ create: () => + ['mutation', 'platformresourcesresolvedrequirement', 'create'] as const, + /** Update platformResourcesResolvedRequirement mutation key */ update: (id: string | number) => + ['mutation', 'platformresourcesresolvedrequirement', 'update', id] as const, + /** Delete platformResourcesResolvedRequirement mutation key */ delete: (id: string | number) => + ['mutation', 'platformresourcesresolvedrequirement', 'delete', id] as const, } as const; export const platformWebhookEndpointMutationKeys = { - /** All platformWebhookEndpoint mutation keys */all: ["mutation", "platformwebhookendpoint"] as const, - /** Create platformWebhookEndpoint mutation key */create: () => ["mutation", "platformwebhookendpoint", "create"] as const, - /** Update platformWebhookEndpoint mutation key */update: (id: string | number) => ["mutation", "platformwebhookendpoint", "update", id] as const, - /** Delete platformWebhookEndpoint mutation key */delete: (id: string | number) => ["mutation", "platformwebhookendpoint", "delete", id] as const + /** All platformWebhookEndpoint mutation keys */ all: [ + 'mutation', + 'platformwebhookendpoint', + ] as const, + /** Create platformWebhookEndpoint mutation key */ create: () => + ['mutation', 'platformwebhookendpoint', 'create'] as const, + /** Update platformWebhookEndpoint mutation key */ update: (id: string | number) => + ['mutation', 'platformwebhookendpoint', 'update', id] as const, + /** Delete platformWebhookEndpoint mutation key */ delete: (id: string | number) => + ['mutation', 'platformwebhookendpoint', 'delete', id] as const, } as const; export const platformWebhookEventMutationKeys = { - /** All platformWebhookEvent mutation keys */all: ["mutation", "platformwebhookevent"] as const, - /** Create platformWebhookEvent mutation key */create: () => ["mutation", "platformwebhookevent", "create"] as const, - /** Update platformWebhookEvent mutation key */update: (id: string | number) => ["mutation", "platformwebhookevent", "update", id] as const, - /** Delete platformWebhookEvent mutation key */delete: (id: string | number) => ["mutation", "platformwebhookevent", "delete", id] as const + /** All platformWebhookEvent mutation keys */ all: ['mutation', 'platformwebhookevent'] as const, + /** Create platformWebhookEvent mutation key */ create: () => + ['mutation', 'platformwebhookevent', 'create'] as const, + /** Update platformWebhookEvent mutation key */ update: (id: string | number) => + ['mutation', 'platformwebhookevent', 'update', id] as const, + /** Delete platformWebhookEvent mutation key */ delete: (id: string | number) => + ['mutation', 'platformwebhookevent', 'delete', id] as const, } as const; export const resourceMutationKeys = { - /** All resource mutation keys */all: ["mutation", "resource"] as const, - /** Create resource mutation key */create: () => ["mutation", "resource", "create"] as const, - /** Update resource mutation key */update: (id: string | number) => ["mutation", "resource", "update", id] as const, - /** Delete resource mutation key */delete: (id: string | number) => ["mutation", "resource", "delete", id] as const + /** All resource mutation keys */ all: ['mutation', 'resource'] as const, + /** Create resource mutation key */ create: () => ['mutation', 'resource', 'create'] as const, + /** Update resource mutation key */ update: (id: string | number) => + ['mutation', 'resource', 'update', id] as const, + /** Delete resource mutation key */ delete: (id: string | number) => + ['mutation', 'resource', 'delete', id] as const, } as const; export const resourceDeclaredCapacityMutationKeys = { - /** All resourceDeclaredCapacity mutation keys */all: ["mutation", "resourcedeclaredcapacity"] as const, - /** Create resourceDeclaredCapacity mutation key */create: () => ["mutation", "resourcedeclaredcapacity", "create"] as const, - /** Update resourceDeclaredCapacity mutation key */update: (id: string | number) => ["mutation", "resourcedeclaredcapacity", "update", id] as const, - /** Delete resourceDeclaredCapacity mutation key */delete: (id: string | number) => ["mutation", "resourcedeclaredcapacity", "delete", id] as const + /** All resourceDeclaredCapacity mutation keys */ all: [ + 'mutation', + 'resourcedeclaredcapacity', + ] as const, + /** Create resourceDeclaredCapacity mutation key */ create: () => + ['mutation', 'resourcedeclaredcapacity', 'create'] as const, + /** Update resourceDeclaredCapacity mutation key */ update: (id: string | number) => + ['mutation', 'resourcedeclaredcapacity', 'update', id] as const, + /** Delete resourceDeclaredCapacity mutation key */ delete: (id: string | number) => + ['mutation', 'resourcedeclaredcapacity', 'delete', id] as const, } as const; export const resourceDefinitionMutationKeys = { - /** All resourceDefinition mutation keys */all: ["mutation", "resourcedefinition"] as const, - /** Create resourceDefinition mutation key */create: () => ["mutation", "resourcedefinition", "create"] as const, - /** Update resourceDefinition mutation key */update: (id: string | number) => ["mutation", "resourcedefinition", "update", id] as const, - /** Delete resourceDefinition mutation key */delete: (id: string | number) => ["mutation", "resourcedefinition", "delete", id] as const + /** All resourceDefinition mutation keys */ all: ['mutation', 'resourcedefinition'] as const, + /** Create resourceDefinition mutation key */ create: () => + ['mutation', 'resourcedefinition', 'create'] as const, + /** Update resourceDefinition mutation key */ update: (id: string | number) => + ['mutation', 'resourcedefinition', 'update', id] as const, + /** Delete resourceDefinition mutation key */ delete: (id: string | number) => + ['mutation', 'resourcedefinition', 'delete', id] as const, } as const; export const resourceEventMutationKeys = { - /** All resourceEvent mutation keys */all: ["mutation", "resourceevent"] as const, - /** Create resourceEvent mutation key */create: () => ["mutation", "resourceevent", "create"] as const, - /** Update resourceEvent mutation key */update: (id: string | number) => ["mutation", "resourceevent", "update", id] as const, - /** Delete resourceEvent mutation key */delete: (id: string | number) => ["mutation", "resourceevent", "delete", id] as const + /** All resourceEvent mutation keys */ all: ['mutation', 'resourceevent'] as const, + /** Create resourceEvent mutation key */ create: () => + ['mutation', 'resourceevent', 'create'] as const, + /** Update resourceEvent mutation key */ update: (id: string | number) => + ['mutation', 'resourceevent', 'update', id] as const, + /** Delete resourceEvent mutation key */ delete: (id: string | number) => + ['mutation', 'resourceevent', 'delete', id] as const, } as const; export const resourceInstallationMutationKeys = { - /** All resourceInstallation mutation keys */all: ["mutation", "resourceinstallation"] as const, - /** Create resourceInstallation mutation key */create: () => ["mutation", "resourceinstallation", "create"] as const, - /** Update resourceInstallation mutation key */update: (id: string | number) => ["mutation", "resourceinstallation", "update", id] as const, - /** Delete resourceInstallation mutation key */delete: (id: string | number) => ["mutation", "resourceinstallation", "delete", id] as const + /** All resourceInstallation mutation keys */ all: ['mutation', 'resourceinstallation'] as const, + /** Create resourceInstallation mutation key */ create: () => + ['mutation', 'resourceinstallation', 'create'] as const, + /** Update resourceInstallation mutation key */ update: (id: string | number) => + ['mutation', 'resourceinstallation', 'update', id] as const, + /** Delete resourceInstallation mutation key */ delete: (id: string | number) => + ['mutation', 'resourceinstallation', 'delete', id] as const, } as const; export const resourceStatusCheckMutationKeys = { - /** All resourceStatusCheck mutation keys */all: ["mutation", "resourcestatuscheck"] as const, - /** Create resourceStatusCheck mutation key */create: () => ["mutation", "resourcestatuscheck", "create"] as const, - /** Update resourceStatusCheck mutation key */update: (id: string | number) => ["mutation", "resourcestatuscheck", "update", id] as const, - /** Delete resourceStatusCheck mutation key */delete: (id: string | number) => ["mutation", "resourcestatuscheck", "delete", id] as const + /** All resourceStatusCheck mutation keys */ all: ['mutation', 'resourcestatuscheck'] as const, + /** Create resourceStatusCheck mutation key */ create: () => + ['mutation', 'resourcestatuscheck', 'create'] as const, + /** Update resourceStatusCheck mutation key */ update: (id: string | number) => + ['mutation', 'resourcestatuscheck', 'update', id] as const, + /** Delete resourceStatusCheck mutation key */ delete: (id: string | number) => + ['mutation', 'resourcestatuscheck', 'delete', id] as const, } as const; export const resourceUsageLogMutationKeys = { - /** All resourceUsageLog mutation keys */all: ["mutation", "resourceusagelog"] as const, - /** Create resourceUsageLog mutation key */create: () => ["mutation", "resourceusagelog", "create"] as const, - /** Update resourceUsageLog mutation key */update: (id: string | number) => ["mutation", "resourceusagelog", "update", id] as const, - /** Delete resourceUsageLog mutation key */delete: (id: string | number) => ["mutation", "resourceusagelog", "delete", id] as const + /** All resourceUsageLog mutation keys */ all: ['mutation', 'resourceusagelog'] as const, + /** Create resourceUsageLog mutation key */ create: () => + ['mutation', 'resourceusagelog', 'create'] as const, + /** Update resourceUsageLog mutation key */ update: (id: string | number) => + ['mutation', 'resourceusagelog', 'update', id] as const, + /** Delete resourceUsageLog mutation key */ delete: (id: string | number) => + ['mutation', 'resourceusagelog', 'delete', id] as const, } as const; export const resourceUsageSummaryMutationKeys = { - /** All resourceUsageSummary mutation keys */all: ["mutation", "resourceusagesummary"] as const, - /** Create resourceUsageSummary mutation key */create: () => ["mutation", "resourceusagesummary", "create"] as const, - /** Update resourceUsageSummary mutation key */update: (id: string | number) => ["mutation", "resourceusagesummary", "update", id] as const, - /** Delete resourceUsageSummary mutation key */delete: (id: string | number) => ["mutation", "resourceusagesummary", "delete", id] as const + /** All resourceUsageSummary mutation keys */ all: ['mutation', 'resourceusagesummary'] as const, + /** Create resourceUsageSummary mutation key */ create: () => + ['mutation', 'resourceusagesummary', 'create'] as const, + /** Update resourceUsageSummary mutation key */ update: (id: string | number) => + ['mutation', 'resourceusagesummary', 'update', id] as const, + /** Delete resourceUsageSummary mutation key */ delete: (id: string | number) => + ['mutation', 'resourceusagesummary', 'delete', id] as const, } as const; export const resourceUtilizationMutationKeys = { - /** All resourceUtilization mutation keys */all: ["mutation", "resourceutilization"] as const, - /** Create resourceUtilization mutation key */create: () => ["mutation", "resourceutilization", "create"] as const, - /** Update resourceUtilization mutation key */update: (id: string | number) => ["mutation", "resourceutilization", "update", id] as const, - /** Delete resourceUtilization mutation key */delete: (id: string | number) => ["mutation", "resourceutilization", "delete", id] as const + /** All resourceUtilization mutation keys */ all: ['mutation', 'resourceutilization'] as const, + /** Create resourceUtilization mutation key */ create: () => + ['mutation', 'resourceutilization', 'create'] as const, + /** Update resourceUtilization mutation key */ update: (id: string | number) => + ['mutation', 'resourceutilization', 'update', id] as const, + /** Delete resourceUtilization mutation key */ delete: (id: string | number) => + ['mutation', 'resourceutilization', 'delete', id] as const, } as const; export const resourcesHealthMutationKeys = { - /** All resourcesHealth mutation keys */all: ["mutation", "resourceshealth"] as const, - /** Create resourcesHealth mutation key */create: () => ["mutation", "resourceshealth", "create"] as const, - /** Update resourcesHealth mutation key */update: (id: string | number) => ["mutation", "resourceshealth", "update", id] as const, - /** Delete resourcesHealth mutation key */delete: (id: string | number) => ["mutation", "resourceshealth", "delete", id] as const + /** All resourcesHealth mutation keys */ all: ['mutation', 'resourceshealth'] as const, + /** Create resourcesHealth mutation key */ create: () => + ['mutation', 'resourceshealth', 'create'] as const, + /** Update resourcesHealth mutation key */ update: (id: string | number) => + ['mutation', 'resourceshealth', 'update', id] as const, + /** Delete resourcesHealth mutation key */ delete: (id: string | number) => + ['mutation', 'resourceshealth', 'delete', id] as const, } as const; export const resourcesRequirementsStateMutationKeys = { - /** All resourcesRequirementsState mutation keys */all: ["mutation", "resourcesrequirementsstate"] as const, - /** Create resourcesRequirementsState mutation key */create: () => ["mutation", "resourcesrequirementsstate", "create"] as const, - /** Update resourcesRequirementsState mutation key */update: (id: string | number) => ["mutation", "resourcesrequirementsstate", "update", id] as const, - /** Delete resourcesRequirementsState mutation key */delete: (id: string | number) => ["mutation", "resourcesrequirementsstate", "delete", id] as const + /** All resourcesRequirementsState mutation keys */ all: [ + 'mutation', + 'resourcesrequirementsstate', + ] as const, + /** Create resourcesRequirementsState mutation key */ create: () => + ['mutation', 'resourcesrequirementsstate', 'create'] as const, + /** Update resourcesRequirementsState mutation key */ update: (id: string | number) => + ['mutation', 'resourcesrequirementsstate', 'update', id] as const, + /** Delete resourcesRequirementsState mutation key */ delete: (id: string | number) => + ['mutation', 'resourcesrequirementsstate', 'delete', id] as const, } as const; export const resourcesResolvedRequirementMutationKeys = { - /** All resourcesResolvedRequirement mutation keys */all: ["mutation", "resourcesresolvedrequirement"] as const, - /** Create resourcesResolvedRequirement mutation key */create: () => ["mutation", "resourcesresolvedrequirement", "create"] as const, - /** Update resourcesResolvedRequirement mutation key */update: (id: string | number) => ["mutation", "resourcesresolvedrequirement", "update", id] as const, - /** Delete resourcesResolvedRequirement mutation key */delete: (id: string | number) => ["mutation", "resourcesresolvedrequirement", "delete", id] as const + /** All resourcesResolvedRequirement mutation keys */ all: [ + 'mutation', + 'resourcesresolvedrequirement', + ] as const, + /** Create resourcesResolvedRequirement mutation key */ create: () => + ['mutation', 'resourcesresolvedrequirement', 'create'] as const, + /** Update resourcesResolvedRequirement mutation key */ update: (id: string | number) => + ['mutation', 'resourcesresolvedrequirement', 'update', id] as const, + /** Delete resourcesResolvedRequirement mutation key */ delete: (id: string | number) => + ['mutation', 'resourcesresolvedrequirement', 'delete', id] as const, } as const; export const webhookEndpointMutationKeys = { - /** All webhookEndpoint mutation keys */all: ["mutation", "webhookendpoint"] as const, - /** Create webhookEndpoint mutation key */create: () => ["mutation", "webhookendpoint", "create"] as const, - /** Update webhookEndpoint mutation key */update: (id: string | number) => ["mutation", "webhookendpoint", "update", id] as const, - /** Delete webhookEndpoint mutation key */delete: (id: string | number) => ["mutation", "webhookendpoint", "delete", id] as const + /** All webhookEndpoint mutation keys */ all: ['mutation', 'webhookendpoint'] as const, + /** Create webhookEndpoint mutation key */ create: () => + ['mutation', 'webhookendpoint', 'create'] as const, + /** Update webhookEndpoint mutation key */ update: (id: string | number) => + ['mutation', 'webhookendpoint', 'update', id] as const, + /** Delete webhookEndpoint mutation key */ delete: (id: string | number) => + ['mutation', 'webhookendpoint', 'delete', id] as const, } as const; export const webhookEventMutationKeys = { - /** All webhookEvent mutation keys */all: ["mutation", "webhookevent"] as const, - /** Create webhookEvent mutation key */create: () => ["mutation", "webhookevent", "create"] as const, - /** Update webhookEvent mutation key */update: (id: string | number) => ["mutation", "webhookevent", "update", id] as const, - /** Delete webhookEvent mutation key */delete: (id: string | number) => ["mutation", "webhookevent", "delete", id] as const + /** All webhookEvent mutation keys */ all: ['mutation', 'webhookevent'] as const, + /** Create webhookEvent mutation key */ create: () => + ['mutation', 'webhookevent', 'create'] as const, + /** Update webhookEvent mutation key */ update: (id: string | number) => + ['mutation', 'webhookevent', 'update', id] as const, + /** Delete webhookEvent mutation key */ delete: (id: string | number) => + ['mutation', 'webhookevent', 'delete', id] as const, } as const; // ============================================================================ @@ -426,34 +715,136 @@ export const webhookEventMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for addEdge */addEdge: (identifier?: string) => identifier ? ["mutation", "addEdge", identifier] as const : ["mutation", "addEdge"] as const, - /** Mutation key for addEdgeAndSave */addEdgeAndSave: (identifier?: string) => identifier ? ["mutation", "addEdgeAndSave", identifier] as const : ["mutation", "addEdgeAndSave"] as const, - /** Mutation key for addNode */addNode: (identifier?: string) => identifier ? ["mutation", "addNode", identifier] as const : ["mutation", "addNode"] as const, - /** Mutation key for addNodeAndSave */addNodeAndSave: (identifier?: string) => identifier ? ["mutation", "addNodeAndSave", identifier] as const : ["mutation", "addNodeAndSave"] as const, - /** Mutation key for copyGraph */copyGraph: (identifier?: string) => identifier ? ["mutation", "copyGraph", identifier] as const : ["mutation", "copyGraph"] as const, - /** Mutation key for importDefinitions */importDefinitions: (identifier?: string) => identifier ? ["mutation", "importDefinitions", identifier] as const : ["mutation", "importDefinitions"] as const, - /** Mutation key for importGraphJson */importGraphJson: (identifier?: string) => identifier ? ["mutation", "importGraphJson", identifier] as const : ["mutation", "importGraphJson"] as const, - /** Mutation key for infraInitEmptyRepo */infraInitEmptyRepo: (identifier?: string) => identifier ? ["mutation", "infraInitEmptyRepo", identifier] as const : ["mutation", "infraInitEmptyRepo"] as const, - /** Mutation key for infraInsertNodeAtPath */infraInsertNodeAtPath: (identifier?: string) => identifier ? ["mutation", "infraInsertNodeAtPath", identifier] as const : ["mutation", "infraInsertNodeAtPath"] as const, - /** Mutation key for infraSetDataAtPath */infraSetDataAtPath: (identifier?: string) => identifier ? ["mutation", "infraSetDataAtPath", identifier] as const : ["mutation", "infraSetDataAtPath"] as const, - /** Mutation key for initEmptyRepo */initEmptyRepo: (identifier?: string) => identifier ? ["mutation", "initEmptyRepo", identifier] as const : ["mutation", "initEmptyRepo"] as const, - /** Mutation key for insertNodeAtPath */insertNodeAtPath: (identifier?: string) => identifier ? ["mutation", "insertNodeAtPath", identifier] as const : ["mutation", "insertNodeAtPath"] as const, - /** Mutation key for platformInfraInitEmptyRepo */platformInfraInitEmptyRepo: (identifier?: string) => identifier ? ["mutation", "platformInfraInitEmptyRepo", identifier] as const : ["mutation", "platformInfraInitEmptyRepo"] as const, - /** Mutation key for platformInfraInsertNodeAtPath */platformInfraInsertNodeAtPath: (identifier?: string) => identifier ? ["mutation", "platformInfraInsertNodeAtPath", identifier] as const : ["mutation", "platformInfraInsertNodeAtPath"] as const, - /** Mutation key for platformInfraSetDataAtPath */platformInfraSetDataAtPath: (identifier?: string) => identifier ? ["mutation", "platformInfraSetDataAtPath", identifier] as const : ["mutation", "platformInfraSetDataAtPath"] as const, - /** Mutation key for platformResourceInstallationsInstall */platformResourceInstallationsInstall: (identifier?: string) => identifier ? ["mutation", "platformResourceInstallationsInstall", identifier] as const : ["mutation", "platformResourceInstallationsInstall"] as const, - /** Mutation key for platformResourceInstallationsRollback */platformResourceInstallationsRollback: (identifier?: string) => identifier ? ["mutation", "platformResourceInstallationsRollback", identifier] as const : ["mutation", "platformResourceInstallationsRollback"] as const, - /** Mutation key for platformResourceInstallationsUninstall */platformResourceInstallationsUninstall: (identifier?: string) => identifier ? ["mutation", "platformResourceInstallationsUninstall", identifier] as const : ["mutation", "platformResourceInstallationsUninstall"] as const, - /** Mutation key for platformResourceInstallationsUpgrade */platformResourceInstallationsUpgrade: (identifier?: string) => identifier ? ["mutation", "platformResourceInstallationsUpgrade", identifier] as const : ["mutation", "platformResourceInstallationsUpgrade"] as const, - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const, - /** Mutation key for resourceInstallationsInstall */resourceInstallationsInstall: (identifier?: string) => identifier ? ["mutation", "resourceInstallationsInstall", identifier] as const : ["mutation", "resourceInstallationsInstall"] as const, - /** Mutation key for resourceInstallationsRollback */resourceInstallationsRollback: (identifier?: string) => identifier ? ["mutation", "resourceInstallationsRollback", identifier] as const : ["mutation", "resourceInstallationsRollback"] as const, - /** Mutation key for resourceInstallationsUninstall */resourceInstallationsUninstall: (identifier?: string) => identifier ? ["mutation", "resourceInstallationsUninstall", identifier] as const : ["mutation", "resourceInstallationsUninstall"] as const, - /** Mutation key for resourceInstallationsUpgrade */resourceInstallationsUpgrade: (identifier?: string) => identifier ? ["mutation", "resourceInstallationsUpgrade", identifier] as const : ["mutation", "resourceInstallationsUpgrade"] as const, - /** Mutation key for saveGraph */saveGraph: (identifier?: string) => identifier ? ["mutation", "saveGraph", identifier] as const : ["mutation", "saveGraph"] as const, - /** Mutation key for setDataAtPath */setDataAtPath: (identifier?: string) => identifier ? ["mutation", "setDataAtPath", identifier] as const : ["mutation", "setDataAtPath"] as const, - /** Mutation key for startExecution */startExecution: (identifier?: string) => identifier ? ["mutation", "startExecution", identifier] as const : ["mutation", "startExecution"] as const, - /** Mutation key for validateFunctionGraph */validateFunctionGraph: (identifier?: string) => identifier ? ["mutation", "validateFunctionGraph", identifier] as const : ["mutation", "validateFunctionGraph"] as const + /** Mutation key for addEdge */ addEdge: (identifier?: string) => + identifier + ? (['mutation', 'addEdge', identifier] as const) + : (['mutation', 'addEdge'] as const), + /** Mutation key for addEdgeAndSave */ addEdgeAndSave: (identifier?: string) => + identifier + ? (['mutation', 'addEdgeAndSave', identifier] as const) + : (['mutation', 'addEdgeAndSave'] as const), + /** Mutation key for addNode */ addNode: (identifier?: string) => + identifier + ? (['mutation', 'addNode', identifier] as const) + : (['mutation', 'addNode'] as const), + /** Mutation key for addNodeAndSave */ addNodeAndSave: (identifier?: string) => + identifier + ? (['mutation', 'addNodeAndSave', identifier] as const) + : (['mutation', 'addNodeAndSave'] as const), + /** Mutation key for copyGraph */ copyGraph: (identifier?: string) => + identifier + ? (['mutation', 'copyGraph', identifier] as const) + : (['mutation', 'copyGraph'] as const), + /** Mutation key for importDefinitions */ importDefinitions: (identifier?: string) => + identifier + ? (['mutation', 'importDefinitions', identifier] as const) + : (['mutation', 'importDefinitions'] as const), + /** Mutation key for importGraphJson */ importGraphJson: (identifier?: string) => + identifier + ? (['mutation', 'importGraphJson', identifier] as const) + : (['mutation', 'importGraphJson'] as const), + /** Mutation key for infraInitEmptyRepo */ infraInitEmptyRepo: (identifier?: string) => + identifier + ? (['mutation', 'infraInitEmptyRepo', identifier] as const) + : (['mutation', 'infraInitEmptyRepo'] as const), + /** Mutation key for infraInsertNodeAtPath */ infraInsertNodeAtPath: (identifier?: string) => + identifier + ? (['mutation', 'infraInsertNodeAtPath', identifier] as const) + : (['mutation', 'infraInsertNodeAtPath'] as const), + /** Mutation key for infraSetDataAtPath */ infraSetDataAtPath: (identifier?: string) => + identifier + ? (['mutation', 'infraSetDataAtPath', identifier] as const) + : (['mutation', 'infraSetDataAtPath'] as const), + /** Mutation key for initEmptyRepo */ initEmptyRepo: (identifier?: string) => + identifier + ? (['mutation', 'initEmptyRepo', identifier] as const) + : (['mutation', 'initEmptyRepo'] as const), + /** Mutation key for insertNodeAtPath */ insertNodeAtPath: (identifier?: string) => + identifier + ? (['mutation', 'insertNodeAtPath', identifier] as const) + : (['mutation', 'insertNodeAtPath'] as const), + /** Mutation key for platformInfraInitEmptyRepo */ platformInfraInitEmptyRepo: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInfraInitEmptyRepo', identifier] as const) + : (['mutation', 'platformInfraInitEmptyRepo'] as const), + /** Mutation key for platformInfraInsertNodeAtPath */ platformInfraInsertNodeAtPath: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInfraInsertNodeAtPath', identifier] as const) + : (['mutation', 'platformInfraInsertNodeAtPath'] as const), + /** Mutation key for platformInfraSetDataAtPath */ platformInfraSetDataAtPath: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInfraSetDataAtPath', identifier] as const) + : (['mutation', 'platformInfraSetDataAtPath'] as const), + /** Mutation key for platformResourceInstallationsInstall */ platformResourceInstallationsInstall: + (identifier?: string) => + identifier + ? (['mutation', 'platformResourceInstallationsInstall', identifier] as const) + : (['mutation', 'platformResourceInstallationsInstall'] as const), + /** Mutation key for platformResourceInstallationsRollback */ platformResourceInstallationsRollback: + (identifier?: string) => + identifier + ? (['mutation', 'platformResourceInstallationsRollback', identifier] as const) + : (['mutation', 'platformResourceInstallationsRollback'] as const), + /** Mutation key for platformResourceInstallationsUninstall */ platformResourceInstallationsUninstall: + (identifier?: string) => + identifier + ? (['mutation', 'platformResourceInstallationsUninstall', identifier] as const) + : (['mutation', 'platformResourceInstallationsUninstall'] as const), + /** Mutation key for platformResourceInstallationsUpgrade */ platformResourceInstallationsUpgrade: + (identifier?: string) => + identifier + ? (['mutation', 'platformResourceInstallationsUpgrade', identifier] as const) + : (['mutation', 'platformResourceInstallationsUpgrade'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), + /** Mutation key for resourceInstallationsInstall */ resourceInstallationsInstall: ( + identifier?: string + ) => + identifier + ? (['mutation', 'resourceInstallationsInstall', identifier] as const) + : (['mutation', 'resourceInstallationsInstall'] as const), + /** Mutation key for resourceInstallationsRollback */ resourceInstallationsRollback: ( + identifier?: string + ) => + identifier + ? (['mutation', 'resourceInstallationsRollback', identifier] as const) + : (['mutation', 'resourceInstallationsRollback'] as const), + /** Mutation key for resourceInstallationsUninstall */ resourceInstallationsUninstall: ( + identifier?: string + ) => + identifier + ? (['mutation', 'resourceInstallationsUninstall', identifier] as const) + : (['mutation', 'resourceInstallationsUninstall'] as const), + /** Mutation key for resourceInstallationsUpgrade */ resourceInstallationsUpgrade: ( + identifier?: string + ) => + identifier + ? (['mutation', 'resourceInstallationsUpgrade', identifier] as const) + : (['mutation', 'resourceInstallationsUpgrade'] as const), + /** Mutation key for saveGraph */ saveGraph: (identifier?: string) => + identifier + ? (['mutation', 'saveGraph', identifier] as const) + : (['mutation', 'saveGraph'] as const), + /** Mutation key for setDataAtPath */ setDataAtPath: (identifier?: string) => + identifier + ? (['mutation', 'setDataAtPath', identifier] as const) + : (['mutation', 'setDataAtPath'] as const), + /** Mutation key for startExecution */ startExecution: (identifier?: string) => + identifier + ? (['mutation', 'startExecution', identifier] as const) + : (['mutation', 'startExecution'] as const), + /** Mutation key for validateFunctionGraph */ validateFunctionGraph: (identifier?: string) => + identifier + ? (['mutation', 'validateFunctionGraph', identifier] as const) + : (['mutation', 'validateFunctionGraph'] as const), } as const; /** @@ -545,5 +936,5 @@ export const mutationKeys = { resourcesResolvedRequirement: resourcesResolvedRequirementMutationKeys, webhookEndpoint: webhookEndpointMutationKeys, webhookEvent: webhookEventMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/compute/hooks/mutations/index.ts b/sdk/constructive-react/src/compute/hooks/mutations/index.ts index d248cb1531..206dbbb82b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/index.ts @@ -3,206 +3,206 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateDbPresetMutation"; -export * from "./useUpdateDbPresetMutation"; -export * from "./useDeleteDbPresetMutation"; -export * from "./useCreateFunctionApiBindingMutation"; -export * from "./useUpdateFunctionApiBindingMutation"; -export * from "./useDeleteFunctionApiBindingMutation"; -export * from "./useCreateFunctionDefinitionMutation"; -export * from "./useUpdateFunctionDefinitionMutation"; -export * from "./useDeleteFunctionDefinitionMutation"; -export * from "./useCreateFunctionDeploymentMutation"; -export * from "./useUpdateFunctionDeploymentMutation"; -export * from "./useDeleteFunctionDeploymentMutation"; -export * from "./useCreateFunctionDeploymentEventMutation"; -export * from "./useUpdateFunctionDeploymentEventMutation"; -export * from "./useDeleteFunctionDeploymentEventMutation"; -export * from "./useCreateFunctionExecutionLogMutation"; -export * from "./useUpdateFunctionExecutionLogMutation"; -export * from "./useDeleteFunctionExecutionLogMutation"; -export * from "./useCreateFunctionGraphCommitMutation"; -export * from "./useUpdateFunctionGraphCommitMutation"; -export * from "./useDeleteFunctionGraphCommitMutation"; -export * from "./useCreateFunctionGraphMutation"; -export * from "./useUpdateFunctionGraphMutation"; -export * from "./useDeleteFunctionGraphMutation"; -export * from "./useCreateFunctionGraphExecutionMutation"; -export * from "./useUpdateFunctionGraphExecutionMutation"; -export * from "./useDeleteFunctionGraphExecutionMutation"; -export * from "./useCreateFunctionGraphExecutionNodeStateMutation"; -export * from "./useUpdateFunctionGraphExecutionNodeStateMutation"; -export * from "./useDeleteFunctionGraphExecutionNodeStateMutation"; -export * from "./useCreateFunctionGraphExecutionOutputMutation"; -export * from "./useUpdateFunctionGraphExecutionOutputMutation"; -export * from "./useDeleteFunctionGraphExecutionOutputMutation"; -export * from "./useCreateFunctionGraphObjectMutation"; -export * from "./useUpdateFunctionGraphObjectMutation"; -export * from "./useDeleteFunctionGraphObjectMutation"; -export * from "./useCreateFunctionGraphRefMutation"; -export * from "./useUpdateFunctionGraphRefMutation"; -export * from "./useDeleteFunctionGraphRefMutation"; -export * from "./useCreateFunctionGraphStoreMutation"; -export * from "./useUpdateFunctionGraphStoreMutation"; -export * from "./useDeleteFunctionGraphStoreMutation"; -export * from "./useCreateFunctionInvocationAttemptMutation"; -export * from "./useUpdateFunctionInvocationAttemptMutation"; -export * from "./useDeleteFunctionInvocationAttemptMutation"; -export * from "./useCreateFunctionInvocationMutation"; -export * from "./useUpdateFunctionInvocationMutation"; -export * from "./useDeleteFunctionInvocationMutation"; -export * from "./useCreateGetAllTreeNodesRecordMutation"; -export * from "./useCreateInfraCommitMutation"; -export * from "./useUpdateInfraCommitMutation"; -export * from "./useDeleteInfraCommitMutation"; -export * from "./useCreateInfraGetAllTreeNodesRecordMutation"; -export * from "./useCreateInfraObjectMutation"; -export * from "./useUpdateInfraObjectMutation"; -export * from "./useDeleteInfraObjectMutation"; -export * from "./useCreateInfraRefMutation"; -export * from "./useUpdateInfraRefMutation"; -export * from "./useDeleteInfraRefMutation"; -export * from "./useCreateInfraStoreMutation"; -export * from "./useUpdateInfraStoreMutation"; -export * from "./useDeleteInfraStoreMutation"; -export * from "./useCreateIntegrationProviderMutation"; -export * from "./useUpdateIntegrationProviderMutation"; -export * from "./useDeleteIntegrationProviderMutation"; -export * from "./useCreateNamespaceMutation"; -export * from "./useUpdateNamespaceMutation"; -export * from "./useDeleteNamespaceMutation"; -export * from "./useCreateNamespaceEventMutation"; -export * from "./useUpdateNamespaceEventMutation"; -export * from "./useDeleteNamespaceEventMutation"; -export * from "./useCreatePlatformFunctionApiBindingMutation"; -export * from "./useUpdatePlatformFunctionApiBindingMutation"; -export * from "./useDeletePlatformFunctionApiBindingMutation"; -export * from "./useCreatePlatformFunctionDefinitionMutation"; -export * from "./useUpdatePlatformFunctionDefinitionMutation"; -export * from "./useDeletePlatformFunctionDefinitionMutation"; -export * from "./useCreatePlatformFunctionDeploymentMutation"; -export * from "./useUpdatePlatformFunctionDeploymentMutation"; -export * from "./useDeletePlatformFunctionDeploymentMutation"; -export * from "./useCreatePlatformFunctionDeploymentEventMutation"; -export * from "./useUpdatePlatformFunctionDeploymentEventMutation"; -export * from "./useDeletePlatformFunctionDeploymentEventMutation"; -export * from "./useCreatePlatformFunctionExecutionLogMutation"; -export * from "./useUpdatePlatformFunctionExecutionLogMutation"; -export * from "./useDeletePlatformFunctionExecutionLogMutation"; -export * from "./useCreatePlatformFunctionInvocationAttemptMutation"; -export * from "./useUpdatePlatformFunctionInvocationAttemptMutation"; -export * from "./useDeletePlatformFunctionInvocationAttemptMutation"; -export * from "./useCreatePlatformFunctionInvocationMutation"; -export * from "./useUpdatePlatformFunctionInvocationMutation"; -export * from "./useDeletePlatformFunctionInvocationMutation"; -export * from "./useCreatePlatformInfraCommitMutation"; -export * from "./useUpdatePlatformInfraCommitMutation"; -export * from "./useDeletePlatformInfraCommitMutation"; -export * from "./useCreatePlatformInfraGetAllTreeNodesRecordMutation"; -export * from "./useCreatePlatformInfraObjectMutation"; -export * from "./useUpdatePlatformInfraObjectMutation"; -export * from "./useDeletePlatformInfraObjectMutation"; -export * from "./useCreatePlatformInfraRefMutation"; -export * from "./useUpdatePlatformInfraRefMutation"; -export * from "./useDeletePlatformInfraRefMutation"; -export * from "./useCreatePlatformInfraStoreMutation"; -export * from "./useUpdatePlatformInfraStoreMutation"; -export * from "./useDeletePlatformInfraStoreMutation"; -export * from "./useCreatePlatformNamespaceMutation"; -export * from "./useUpdatePlatformNamespaceMutation"; -export * from "./useDeletePlatformNamespaceMutation"; -export * from "./useCreatePlatformNamespaceEventMutation"; -export * from "./useUpdatePlatformNamespaceEventMutation"; -export * from "./useDeletePlatformNamespaceEventMutation"; -export * from "./useCreatePlatformResourceMutation"; -export * from "./useUpdatePlatformResourceMutation"; -export * from "./useDeletePlatformResourceMutation"; -export * from "./useCreatePlatformResourceDeclaredCapacityMutation"; -export * from "./useCreatePlatformResourceDefinitionMutation"; -export * from "./useUpdatePlatformResourceDefinitionMutation"; -export * from "./useDeletePlatformResourceDefinitionMutation"; -export * from "./useCreatePlatformResourceEventMutation"; -export * from "./useUpdatePlatformResourceEventMutation"; -export * from "./useDeletePlatformResourceEventMutation"; -export * from "./useCreatePlatformResourceInstallationMutation"; -export * from "./useUpdatePlatformResourceInstallationMutation"; -export * from "./useDeletePlatformResourceInstallationMutation"; -export * from "./useCreatePlatformResourceStatusCheckMutation"; -export * from "./useUpdatePlatformResourceStatusCheckMutation"; -export * from "./useDeletePlatformResourceStatusCheckMutation"; -export * from "./useCreatePlatformResourceUsageLogMutation"; -export * from "./useUpdatePlatformResourceUsageLogMutation"; -export * from "./useDeletePlatformResourceUsageLogMutation"; -export * from "./useCreatePlatformResourceUsageSummaryMutation"; -export * from "./useUpdatePlatformResourceUsageSummaryMutation"; -export * from "./useDeletePlatformResourceUsageSummaryMutation"; -export * from "./useCreatePlatformResourceUtilizationMutation"; -export * from "./useCreatePlatformResourcesHealthMutation"; -export * from "./useCreatePlatformResourcesRequirementsStateMutation"; -export * from "./useCreatePlatformResourcesResolvedRequirementMutation"; -export * from "./useCreatePlatformWebhookEndpointMutation"; -export * from "./useUpdatePlatformWebhookEndpointMutation"; -export * from "./useDeletePlatformWebhookEndpointMutation"; -export * from "./useCreatePlatformWebhookEventMutation"; -export * from "./useUpdatePlatformWebhookEventMutation"; -export * from "./useDeletePlatformWebhookEventMutation"; -export * from "./useCreateResourceMutation"; -export * from "./useUpdateResourceMutation"; -export * from "./useDeleteResourceMutation"; -export * from "./useCreateResourceDeclaredCapacityMutation"; -export * from "./useCreateResourceDefinitionMutation"; -export * from "./useUpdateResourceDefinitionMutation"; -export * from "./useDeleteResourceDefinitionMutation"; -export * from "./useCreateResourceEventMutation"; -export * from "./useUpdateResourceEventMutation"; -export * from "./useDeleteResourceEventMutation"; -export * from "./useCreateResourceInstallationMutation"; -export * from "./useUpdateResourceInstallationMutation"; -export * from "./useDeleteResourceInstallationMutation"; -export * from "./useCreateResourceStatusCheckMutation"; -export * from "./useUpdateResourceStatusCheckMutation"; -export * from "./useDeleteResourceStatusCheckMutation"; -export * from "./useCreateResourceUsageLogMutation"; -export * from "./useUpdateResourceUsageLogMutation"; -export * from "./useDeleteResourceUsageLogMutation"; -export * from "./useCreateResourceUsageSummaryMutation"; -export * from "./useUpdateResourceUsageSummaryMutation"; -export * from "./useDeleteResourceUsageSummaryMutation"; -export * from "./useCreateResourceUtilizationMutation"; -export * from "./useCreateResourcesHealthMutation"; -export * from "./useCreateResourcesRequirementsStateMutation"; -export * from "./useCreateResourcesResolvedRequirementMutation"; -export * from "./useCreateWebhookEndpointMutation"; -export * from "./useUpdateWebhookEndpointMutation"; -export * from "./useDeleteWebhookEndpointMutation"; -export * from "./useCreateWebhookEventMutation"; -export * from "./useUpdateWebhookEventMutation"; -export * from "./useDeleteWebhookEventMutation"; -export * from "./useAddEdgeMutation"; -export * from "./useAddEdgeAndSaveMutation"; -export * from "./useAddNodeMutation"; -export * from "./useAddNodeAndSaveMutation"; -export * from "./useCopyGraphMutation"; -export * from "./useImportDefinitionsMutation"; -export * from "./useImportGraphJsonMutation"; -export * from "./useInfraInitEmptyRepoMutation"; -export * from "./useInfraInsertNodeAtPathMutation"; -export * from "./useInfraSetDataAtPathMutation"; -export * from "./useInitEmptyRepoMutation"; -export * from "./useInsertNodeAtPathMutation"; -export * from "./usePlatformInfraInitEmptyRepoMutation"; -export * from "./usePlatformInfraInsertNodeAtPathMutation"; -export * from "./usePlatformInfraSetDataAtPathMutation"; -export * from "./usePlatformResourceInstallationsInstallMutation"; -export * from "./usePlatformResourceInstallationsRollbackMutation"; -export * from "./usePlatformResourceInstallationsUninstallMutation"; -export * from "./usePlatformResourceInstallationsUpgradeMutation"; -export * from "./useProvisionBucketMutation"; -export * from "./useResourceInstallationsInstallMutation"; -export * from "./useResourceInstallationsRollbackMutation"; -export * from "./useResourceInstallationsUninstallMutation"; -export * from "./useResourceInstallationsUpgradeMutation"; -export * from "./useSaveGraphMutation"; -export * from "./useSetDataAtPathMutation"; -export * from "./useStartExecutionMutation"; -export * from "./useValidateFunctionGraphMutation"; \ No newline at end of file +export * from './useCreateDbPresetMutation'; +export * from './useUpdateDbPresetMutation'; +export * from './useDeleteDbPresetMutation'; +export * from './useCreateFunctionApiBindingMutation'; +export * from './useUpdateFunctionApiBindingMutation'; +export * from './useDeleteFunctionApiBindingMutation'; +export * from './useCreateFunctionDefinitionMutation'; +export * from './useUpdateFunctionDefinitionMutation'; +export * from './useDeleteFunctionDefinitionMutation'; +export * from './useCreateFunctionDeploymentMutation'; +export * from './useUpdateFunctionDeploymentMutation'; +export * from './useDeleteFunctionDeploymentMutation'; +export * from './useCreateFunctionDeploymentEventMutation'; +export * from './useUpdateFunctionDeploymentEventMutation'; +export * from './useDeleteFunctionDeploymentEventMutation'; +export * from './useCreateFunctionExecutionLogMutation'; +export * from './useUpdateFunctionExecutionLogMutation'; +export * from './useDeleteFunctionExecutionLogMutation'; +export * from './useCreateFunctionGraphCommitMutation'; +export * from './useUpdateFunctionGraphCommitMutation'; +export * from './useDeleteFunctionGraphCommitMutation'; +export * from './useCreateFunctionGraphMutation'; +export * from './useUpdateFunctionGraphMutation'; +export * from './useDeleteFunctionGraphMutation'; +export * from './useCreateFunctionGraphExecutionMutation'; +export * from './useUpdateFunctionGraphExecutionMutation'; +export * from './useDeleteFunctionGraphExecutionMutation'; +export * from './useCreateFunctionGraphExecutionNodeStateMutation'; +export * from './useUpdateFunctionGraphExecutionNodeStateMutation'; +export * from './useDeleteFunctionGraphExecutionNodeStateMutation'; +export * from './useCreateFunctionGraphExecutionOutputMutation'; +export * from './useUpdateFunctionGraphExecutionOutputMutation'; +export * from './useDeleteFunctionGraphExecutionOutputMutation'; +export * from './useCreateFunctionGraphObjectMutation'; +export * from './useUpdateFunctionGraphObjectMutation'; +export * from './useDeleteFunctionGraphObjectMutation'; +export * from './useCreateFunctionGraphRefMutation'; +export * from './useUpdateFunctionGraphRefMutation'; +export * from './useDeleteFunctionGraphRefMutation'; +export * from './useCreateFunctionGraphStoreMutation'; +export * from './useUpdateFunctionGraphStoreMutation'; +export * from './useDeleteFunctionGraphStoreMutation'; +export * from './useCreateFunctionInvocationAttemptMutation'; +export * from './useUpdateFunctionInvocationAttemptMutation'; +export * from './useDeleteFunctionInvocationAttemptMutation'; +export * from './useCreateFunctionInvocationMutation'; +export * from './useUpdateFunctionInvocationMutation'; +export * from './useDeleteFunctionInvocationMutation'; +export * from './useCreateGetAllTreeNodesRecordMutation'; +export * from './useCreateInfraCommitMutation'; +export * from './useUpdateInfraCommitMutation'; +export * from './useDeleteInfraCommitMutation'; +export * from './useCreateInfraGetAllTreeNodesRecordMutation'; +export * from './useCreateInfraObjectMutation'; +export * from './useUpdateInfraObjectMutation'; +export * from './useDeleteInfraObjectMutation'; +export * from './useCreateInfraRefMutation'; +export * from './useUpdateInfraRefMutation'; +export * from './useDeleteInfraRefMutation'; +export * from './useCreateInfraStoreMutation'; +export * from './useUpdateInfraStoreMutation'; +export * from './useDeleteInfraStoreMutation'; +export * from './useCreateIntegrationProviderMutation'; +export * from './useUpdateIntegrationProviderMutation'; +export * from './useDeleteIntegrationProviderMutation'; +export * from './useCreateNamespaceMutation'; +export * from './useUpdateNamespaceMutation'; +export * from './useDeleteNamespaceMutation'; +export * from './useCreateNamespaceEventMutation'; +export * from './useUpdateNamespaceEventMutation'; +export * from './useDeleteNamespaceEventMutation'; +export * from './useCreatePlatformFunctionApiBindingMutation'; +export * from './useUpdatePlatformFunctionApiBindingMutation'; +export * from './useDeletePlatformFunctionApiBindingMutation'; +export * from './useCreatePlatformFunctionDefinitionMutation'; +export * from './useUpdatePlatformFunctionDefinitionMutation'; +export * from './useDeletePlatformFunctionDefinitionMutation'; +export * from './useCreatePlatformFunctionDeploymentMutation'; +export * from './useUpdatePlatformFunctionDeploymentMutation'; +export * from './useDeletePlatformFunctionDeploymentMutation'; +export * from './useCreatePlatformFunctionDeploymentEventMutation'; +export * from './useUpdatePlatformFunctionDeploymentEventMutation'; +export * from './useDeletePlatformFunctionDeploymentEventMutation'; +export * from './useCreatePlatformFunctionExecutionLogMutation'; +export * from './useUpdatePlatformFunctionExecutionLogMutation'; +export * from './useDeletePlatformFunctionExecutionLogMutation'; +export * from './useCreatePlatformFunctionInvocationAttemptMutation'; +export * from './useUpdatePlatformFunctionInvocationAttemptMutation'; +export * from './useDeletePlatformFunctionInvocationAttemptMutation'; +export * from './useCreatePlatformFunctionInvocationMutation'; +export * from './useUpdatePlatformFunctionInvocationMutation'; +export * from './useDeletePlatformFunctionInvocationMutation'; +export * from './useCreatePlatformInfraCommitMutation'; +export * from './useUpdatePlatformInfraCommitMutation'; +export * from './useDeletePlatformInfraCommitMutation'; +export * from './useCreatePlatformInfraGetAllTreeNodesRecordMutation'; +export * from './useCreatePlatformInfraObjectMutation'; +export * from './useUpdatePlatformInfraObjectMutation'; +export * from './useDeletePlatformInfraObjectMutation'; +export * from './useCreatePlatformInfraRefMutation'; +export * from './useUpdatePlatformInfraRefMutation'; +export * from './useDeletePlatformInfraRefMutation'; +export * from './useCreatePlatformInfraStoreMutation'; +export * from './useUpdatePlatformInfraStoreMutation'; +export * from './useDeletePlatformInfraStoreMutation'; +export * from './useCreatePlatformNamespaceMutation'; +export * from './useUpdatePlatformNamespaceMutation'; +export * from './useDeletePlatformNamespaceMutation'; +export * from './useCreatePlatformNamespaceEventMutation'; +export * from './useUpdatePlatformNamespaceEventMutation'; +export * from './useDeletePlatformNamespaceEventMutation'; +export * from './useCreatePlatformResourceMutation'; +export * from './useUpdatePlatformResourceMutation'; +export * from './useDeletePlatformResourceMutation'; +export * from './useCreatePlatformResourceDeclaredCapacityMutation'; +export * from './useCreatePlatformResourceDefinitionMutation'; +export * from './useUpdatePlatformResourceDefinitionMutation'; +export * from './useDeletePlatformResourceDefinitionMutation'; +export * from './useCreatePlatformResourceEventMutation'; +export * from './useUpdatePlatformResourceEventMutation'; +export * from './useDeletePlatformResourceEventMutation'; +export * from './useCreatePlatformResourceInstallationMutation'; +export * from './useUpdatePlatformResourceInstallationMutation'; +export * from './useDeletePlatformResourceInstallationMutation'; +export * from './useCreatePlatformResourceStatusCheckMutation'; +export * from './useUpdatePlatformResourceStatusCheckMutation'; +export * from './useDeletePlatformResourceStatusCheckMutation'; +export * from './useCreatePlatformResourceUsageLogMutation'; +export * from './useUpdatePlatformResourceUsageLogMutation'; +export * from './useDeletePlatformResourceUsageLogMutation'; +export * from './useCreatePlatformResourceUsageSummaryMutation'; +export * from './useUpdatePlatformResourceUsageSummaryMutation'; +export * from './useDeletePlatformResourceUsageSummaryMutation'; +export * from './useCreatePlatformResourceUtilizationMutation'; +export * from './useCreatePlatformResourcesHealthMutation'; +export * from './useCreatePlatformResourcesRequirementsStateMutation'; +export * from './useCreatePlatformResourcesResolvedRequirementMutation'; +export * from './useCreatePlatformWebhookEndpointMutation'; +export * from './useUpdatePlatformWebhookEndpointMutation'; +export * from './useDeletePlatformWebhookEndpointMutation'; +export * from './useCreatePlatformWebhookEventMutation'; +export * from './useUpdatePlatformWebhookEventMutation'; +export * from './useDeletePlatformWebhookEventMutation'; +export * from './useCreateResourceMutation'; +export * from './useUpdateResourceMutation'; +export * from './useDeleteResourceMutation'; +export * from './useCreateResourceDeclaredCapacityMutation'; +export * from './useCreateResourceDefinitionMutation'; +export * from './useUpdateResourceDefinitionMutation'; +export * from './useDeleteResourceDefinitionMutation'; +export * from './useCreateResourceEventMutation'; +export * from './useUpdateResourceEventMutation'; +export * from './useDeleteResourceEventMutation'; +export * from './useCreateResourceInstallationMutation'; +export * from './useUpdateResourceInstallationMutation'; +export * from './useDeleteResourceInstallationMutation'; +export * from './useCreateResourceStatusCheckMutation'; +export * from './useUpdateResourceStatusCheckMutation'; +export * from './useDeleteResourceStatusCheckMutation'; +export * from './useCreateResourceUsageLogMutation'; +export * from './useUpdateResourceUsageLogMutation'; +export * from './useDeleteResourceUsageLogMutation'; +export * from './useCreateResourceUsageSummaryMutation'; +export * from './useUpdateResourceUsageSummaryMutation'; +export * from './useDeleteResourceUsageSummaryMutation'; +export * from './useCreateResourceUtilizationMutation'; +export * from './useCreateResourcesHealthMutation'; +export * from './useCreateResourcesRequirementsStateMutation'; +export * from './useCreateResourcesResolvedRequirementMutation'; +export * from './useCreateWebhookEndpointMutation'; +export * from './useUpdateWebhookEndpointMutation'; +export * from './useDeleteWebhookEndpointMutation'; +export * from './useCreateWebhookEventMutation'; +export * from './useUpdateWebhookEventMutation'; +export * from './useDeleteWebhookEventMutation'; +export * from './useAddEdgeMutation'; +export * from './useAddEdgeAndSaveMutation'; +export * from './useAddNodeMutation'; +export * from './useAddNodeAndSaveMutation'; +export * from './useCopyGraphMutation'; +export * from './useImportDefinitionsMutation'; +export * from './useImportGraphJsonMutation'; +export * from './useInfraInitEmptyRepoMutation'; +export * from './useInfraInsertNodeAtPathMutation'; +export * from './useInfraSetDataAtPathMutation'; +export * from './useInitEmptyRepoMutation'; +export * from './useInsertNodeAtPathMutation'; +export * from './usePlatformInfraInitEmptyRepoMutation'; +export * from './usePlatformInfraInsertNodeAtPathMutation'; +export * from './usePlatformInfraSetDataAtPathMutation'; +export * from './usePlatformResourceInstallationsInstallMutation'; +export * from './usePlatformResourceInstallationsRollbackMutation'; +export * from './usePlatformResourceInstallationsUninstallMutation'; +export * from './usePlatformResourceInstallationsUpgradeMutation'; +export * from './useProvisionBucketMutation'; +export * from './useResourceInstallationsInstallMutation'; +export * from './useResourceInstallationsRollbackMutation'; +export * from './useResourceInstallationsUninstallMutation'; +export * from './useResourceInstallationsUpgradeMutation'; +export * from './useSaveGraphMutation'; +export * from './useSetDataAtPathMutation'; +export * from './useStartExecutionMutation'; +export * from './useValidateFunctionGraphMutation'; diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeAndSaveMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeAndSaveMutation.ts index cca9619948..214c3a81b7 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeAndSaveMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeAndSaveMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { AddEdgeAndSaveVariables } from "../../orm/mutation"; -import type { AddEdgeAndSavePayloadSelect, AddEdgeAndSavePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { AddEdgeAndSaveVariables } from "../../orm/mutation"; -export type { AddEdgeAndSavePayloadSelect } from "../../orm/input-types"; -export function useAddEdgeAndSaveMutation(params: { - selection: ({ - fields: S & AddEdgeAndSavePayloadSelect; - } & HookStrictSelect, AddEdgeAndSavePayloadSelect>); -} & Omit | null; -}, Error, AddEdgeAndSaveVariables>, "mutationFn">): UseMutationResult<{ - addEdgeAndSave: InferSelectResult | null; -}, Error, AddEdgeAndSaveVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { AddEdgeAndSaveVariables } from '../../orm/mutation'; +import type { AddEdgeAndSavePayloadSelect, AddEdgeAndSavePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AddEdgeAndSaveVariables } from '../../orm/mutation'; +export type { AddEdgeAndSavePayloadSelect } from '../../orm/input-types'; +export function useAddEdgeAndSaveMutation( + params: { + selection: { + fields: S & AddEdgeAndSavePayloadSelect; + } & HookStrictSelect, AddEdgeAndSavePayloadSelect>; + } & Omit< + UseMutationOptions< + { + addEdgeAndSave: InferSelectResult | null; + }, + Error, + AddEdgeAndSaveVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + addEdgeAndSave: InferSelectResult | null; + }, + Error, + AddEdgeAndSaveVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.addEdgeAndSave(), - mutationFn: (variables: AddEdgeAndSaveVariables) => getClient().mutation.addEdgeAndSave(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: AddEdgeAndSaveVariables) => + getClient() + .mutation.addEdgeAndSave(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeMutation.ts index 31c230528b..e79559bdd4 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { AddEdgeVariables } from "../../orm/mutation"; -import type { AddEdgePayloadSelect, AddEdgePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { AddEdgeVariables } from "../../orm/mutation"; -export type { AddEdgePayloadSelect } from "../../orm/input-types"; -export function useAddEdgeMutation(params: { - selection: ({ - fields: S & AddEdgePayloadSelect; - } & HookStrictSelect, AddEdgePayloadSelect>); -} & Omit | null; -}, Error, AddEdgeVariables>, "mutationFn">): UseMutationResult<{ - addEdge: InferSelectResult | null; -}, Error, AddEdgeVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { AddEdgeVariables } from '../../orm/mutation'; +import type { AddEdgePayloadSelect, AddEdgePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AddEdgeVariables } from '../../orm/mutation'; +export type { AddEdgePayloadSelect } from '../../orm/input-types'; +export function useAddEdgeMutation( + params: { + selection: { + fields: S & AddEdgePayloadSelect; + } & HookStrictSelect, AddEdgePayloadSelect>; + } & Omit< + UseMutationOptions< + { + addEdge: InferSelectResult | null; + }, + Error, + AddEdgeVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + addEdge: InferSelectResult | null; + }, + Error, + AddEdgeVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.addEdge(), - mutationFn: (variables: AddEdgeVariables) => getClient().mutation.addEdge(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: AddEdgeVariables) => + getClient() + .mutation.addEdge(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeAndSaveMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeAndSaveMutation.ts index 0094a42aaf..7d87df31e2 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeAndSaveMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeAndSaveMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { AddNodeAndSaveVariables } from "../../orm/mutation"; -import type { AddNodeAndSavePayloadSelect, AddNodeAndSavePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { AddNodeAndSaveVariables } from "../../orm/mutation"; -export type { AddNodeAndSavePayloadSelect } from "../../orm/input-types"; -export function useAddNodeAndSaveMutation(params: { - selection: ({ - fields: S & AddNodeAndSavePayloadSelect; - } & HookStrictSelect, AddNodeAndSavePayloadSelect>); -} & Omit | null; -}, Error, AddNodeAndSaveVariables>, "mutationFn">): UseMutationResult<{ - addNodeAndSave: InferSelectResult | null; -}, Error, AddNodeAndSaveVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { AddNodeAndSaveVariables } from '../../orm/mutation'; +import type { AddNodeAndSavePayloadSelect, AddNodeAndSavePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AddNodeAndSaveVariables } from '../../orm/mutation'; +export type { AddNodeAndSavePayloadSelect } from '../../orm/input-types'; +export function useAddNodeAndSaveMutation( + params: { + selection: { + fields: S & AddNodeAndSavePayloadSelect; + } & HookStrictSelect, AddNodeAndSavePayloadSelect>; + } & Omit< + UseMutationOptions< + { + addNodeAndSave: InferSelectResult | null; + }, + Error, + AddNodeAndSaveVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + addNodeAndSave: InferSelectResult | null; + }, + Error, + AddNodeAndSaveVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.addNodeAndSave(), - mutationFn: (variables: AddNodeAndSaveVariables) => getClient().mutation.addNodeAndSave(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: AddNodeAndSaveVariables) => + getClient() + .mutation.addNodeAndSave(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeMutation.ts index 6bdaf1ffc2..baddff020f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { AddNodeVariables } from "../../orm/mutation"; -import type { AddNodePayloadSelect, AddNodePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { AddNodeVariables } from "../../orm/mutation"; -export type { AddNodePayloadSelect } from "../../orm/input-types"; -export function useAddNodeMutation(params: { - selection: ({ - fields: S & AddNodePayloadSelect; - } & HookStrictSelect, AddNodePayloadSelect>); -} & Omit | null; -}, Error, AddNodeVariables>, "mutationFn">): UseMutationResult<{ - addNode: InferSelectResult | null; -}, Error, AddNodeVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { AddNodeVariables } from '../../orm/mutation'; +import type { AddNodePayloadSelect, AddNodePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AddNodeVariables } from '../../orm/mutation'; +export type { AddNodePayloadSelect } from '../../orm/input-types'; +export function useAddNodeMutation( + params: { + selection: { + fields: S & AddNodePayloadSelect; + } & HookStrictSelect, AddNodePayloadSelect>; + } & Omit< + UseMutationOptions< + { + addNode: InferSelectResult | null; + }, + Error, + AddNodeVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + addNode: InferSelectResult | null; + }, + Error, + AddNodeVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.addNode(), - mutationFn: (variables: AddNodeVariables) => getClient().mutation.addNode(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: AddNodeVariables) => + getClient() + .mutation.addNode(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCopyGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCopyGraphMutation.ts index bb73edf2ae..5ecc7fe417 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCopyGraphMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCopyGraphMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { CopyGraphVariables } from "../../orm/mutation"; -import type { CopyGraphPayloadSelect, CopyGraphPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { CopyGraphVariables } from "../../orm/mutation"; -export type { CopyGraphPayloadSelect } from "../../orm/input-types"; -export function useCopyGraphMutation(params: { - selection: ({ - fields: S & CopyGraphPayloadSelect; - } & HookStrictSelect, CopyGraphPayloadSelect>); -} & Omit | null; -}, Error, CopyGraphVariables>, "mutationFn">): UseMutationResult<{ - copyGraph: InferSelectResult | null; -}, Error, CopyGraphVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { CopyGraphVariables } from '../../orm/mutation'; +import type { CopyGraphPayloadSelect, CopyGraphPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { CopyGraphVariables } from '../../orm/mutation'; +export type { CopyGraphPayloadSelect } from '../../orm/input-types'; +export function useCopyGraphMutation( + params: { + selection: { + fields: S & CopyGraphPayloadSelect; + } & HookStrictSelect, CopyGraphPayloadSelect>; + } & Omit< + UseMutationOptions< + { + copyGraph: InferSelectResult | null; + }, + Error, + CopyGraphVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + copyGraph: InferSelectResult | null; + }, + Error, + CopyGraphVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.copyGraph(), - mutationFn: (variables: CopyGraphVariables) => getClient().mutation.copyGraph(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: CopyGraphVariables) => + getClient() + .mutation.copyGraph(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateDbPresetMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateDbPresetMutation.ts index 4025ea01cb..a415acccb6 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateDbPresetMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateDbPresetMutation.ts @@ -4,62 +4,85 @@ * 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 { dbPresetKeys } from "../query-keys"; -import { dbPresetMutationKeys } from "../mutation-keys"; -import type { DbPresetSelect, DbPresetWithRelations, CreateDbPresetInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations, CreateDbPresetInput } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import { dbPresetMutationKeys } from '../mutation-keys'; +import type { + DbPresetSelect, + DbPresetWithRelations, + CreateDbPresetInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DbPresetSelect, + DbPresetWithRelations, + CreateDbPresetInput, +} from '../../orm/input-types'; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDbPresetMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDbPresetMutation(params: { - selection: ({ - fields: S & DbPresetSelect; - } & HookStrictSelect, DbPresetSelect>); -} & Omit; - }; -}, Error, CreateDbPresetInput["dbPreset"]>, "mutationFn">): UseMutationResult<{ - createDbPreset: { - dbPreset: InferSelectResult; - }; -}, Error, CreateDbPresetInput["dbPreset"]>; -export function useCreateDbPresetMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDbPresetMutation( + params: { + selection: { + fields: S & DbPresetSelect; + } & HookStrictSelect, DbPresetSelect>; + } & Omit< + UseMutationOptions< + { + createDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + CreateDbPresetInput['dbPreset'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + CreateDbPresetInput['dbPreset'] +>; +export function useCreateDbPresetMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetMutationKeys.create(), - mutationFn: (data: CreateDbPresetInput["dbPreset"]) => getClient().dbPreset.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDbPresetInput['dbPreset']) => + getClient() + .dbPreset.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: dbPresetKeys.lists() + queryKey: dbPresetKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionApiBindingMutation.ts index 58bfcf940d..d6daa06138 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionApiBindingMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionApiBindingMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionApiBindingKeys } from "../query-keys"; -import { functionApiBindingMutationKeys } from "../mutation-keys"; -import type { FunctionApiBindingSelect, FunctionApiBindingWithRelations, CreateFunctionApiBindingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionApiBindingSelect, FunctionApiBindingWithRelations, CreateFunctionApiBindingInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import { functionApiBindingMutationKeys } from '../mutation-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + CreateFunctionApiBindingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + CreateFunctionApiBindingInput, +} from '../../orm/input-types'; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionApiBindingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionApiBindingMutation(params: { - selection: ({ - fields: S & FunctionApiBindingSelect; - } & HookStrictSelect, FunctionApiBindingSelect>); -} & Omit; - }; -}, Error, CreateFunctionApiBindingInput["functionApiBinding"]>, "mutationFn">): UseMutationResult<{ - createFunctionApiBinding: { - functionApiBinding: InferSelectResult; - }; -}, Error, CreateFunctionApiBindingInput["functionApiBinding"]>; -export function useCreateFunctionApiBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionApiBindingMutation( + params: { + selection: { + fields: S & FunctionApiBindingSelect; + } & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + CreateFunctionApiBindingInput['functionApiBinding'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + CreateFunctionApiBindingInput['functionApiBinding'] +>; +export function useCreateFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionApiBindingMutationKeys.create(), - mutationFn: (data: CreateFunctionApiBindingInput["functionApiBinding"]) => getClient().functionApiBinding.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionApiBindingInput['functionApiBinding']) => + getClient() + .functionApiBinding.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionApiBindingKeys.lists() + queryKey: functionApiBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDefinitionMutation.ts index d8e3065af1..5c6f608dfa 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDefinitionMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDefinitionKeys } from "../query-keys"; -import { functionDefinitionMutationKeys } from "../mutation-keys"; -import type { FunctionDefinitionSelect, FunctionDefinitionWithRelations, CreateFunctionDefinitionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDefinitionSelect, FunctionDefinitionWithRelations, CreateFunctionDefinitionInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import { functionDefinitionMutationKeys } from '../mutation-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + CreateFunctionDefinitionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + CreateFunctionDefinitionInput, +} from '../../orm/input-types'; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionDefinitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionDefinitionMutation(params: { - selection: ({ - fields: S & FunctionDefinitionSelect; - } & HookStrictSelect, FunctionDefinitionSelect>); -} & Omit; - }; -}, Error, CreateFunctionDefinitionInput["functionDefinition"]>, "mutationFn">): UseMutationResult<{ - createFunctionDefinition: { - functionDefinition: InferSelectResult; - }; -}, Error, CreateFunctionDefinitionInput["functionDefinition"]>; -export function useCreateFunctionDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionDefinitionMutation( + params: { + selection: { + fields: S & FunctionDefinitionSelect; + } & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + CreateFunctionDefinitionInput['functionDefinition'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + CreateFunctionDefinitionInput['functionDefinition'] +>; +export function useCreateFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDefinitionMutationKeys.create(), - mutationFn: (data: CreateFunctionDefinitionInput["functionDefinition"]) => getClient().functionDefinition.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionDefinitionInput['functionDefinition']) => + getClient() + .functionDefinition.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionDefinitionKeys.lists() + queryKey: functionDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentEventMutation.ts index fa5f0510d9..2748474f25 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentEventMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentEventKeys } from "../query-keys"; -import { functionDeploymentEventMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations, CreateFunctionDeploymentEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations, CreateFunctionDeploymentEventInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import { functionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + CreateFunctionDeploymentEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + CreateFunctionDeploymentEventInput, +} from '../../orm/input-types'; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionDeploymentEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionDeploymentEventMutation(params: { - selection: ({ - fields: S & FunctionDeploymentEventSelect; - } & HookStrictSelect, FunctionDeploymentEventSelect>); -} & Omit; - }; -}, Error, CreateFunctionDeploymentEventInput["functionDeploymentEvent"]>, "mutationFn">): UseMutationResult<{ - createFunctionDeploymentEvent: { - functionDeploymentEvent: InferSelectResult; - }; -}, Error, CreateFunctionDeploymentEventInput["functionDeploymentEvent"]>; -export function useCreateFunctionDeploymentEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionDeploymentEventMutation( + params: { + selection: { + fields: S & FunctionDeploymentEventSelect; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentEventInput['functionDeploymentEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentEventInput['functionDeploymentEvent'] +>; +export function useCreateFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDeploymentEventMutationKeys.create(), - mutationFn: (data: CreateFunctionDeploymentEventInput["functionDeploymentEvent"]) => getClient().functionDeploymentEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionDeploymentEventInput['functionDeploymentEvent']) => + getClient() + .functionDeploymentEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionDeploymentEventKeys.lists() + queryKey: functionDeploymentEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentMutation.ts index 2bfe770c74..114ae46afc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentKeys } from "../query-keys"; -import { functionDeploymentMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentSelect, FunctionDeploymentWithRelations, CreateFunctionDeploymentInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentSelect, FunctionDeploymentWithRelations, CreateFunctionDeploymentInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import { functionDeploymentMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + CreateFunctionDeploymentInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + CreateFunctionDeploymentInput, +} from '../../orm/input-types'; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionDeploymentMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionDeploymentMutation(params: { - selection: ({ - fields: S & FunctionDeploymentSelect; - } & HookStrictSelect, FunctionDeploymentSelect>); -} & Omit; - }; -}, Error, CreateFunctionDeploymentInput["functionDeployment"]>, "mutationFn">): UseMutationResult<{ - createFunctionDeployment: { - functionDeployment: InferSelectResult; - }; -}, Error, CreateFunctionDeploymentInput["functionDeployment"]>; -export function useCreateFunctionDeploymentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionDeploymentMutation( + params: { + selection: { + fields: S & FunctionDeploymentSelect; + } & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentInput['functionDeployment'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentInput['functionDeployment'] +>; +export function useCreateFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDeploymentMutationKeys.create(), - mutationFn: (data: CreateFunctionDeploymentInput["functionDeployment"]) => getClient().functionDeployment.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionDeploymentInput['functionDeployment']) => + getClient() + .functionDeployment.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionDeploymentKeys.lists() + queryKey: functionDeploymentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionExecutionLogMutation.ts index db61f84b12..1eebcc0105 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionExecutionLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionExecutionLogMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionExecutionLogKeys } from "../query-keys"; -import { functionExecutionLogMutationKeys } from "../mutation-keys"; -import type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations, CreateFunctionExecutionLogInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations, CreateFunctionExecutionLogInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import { functionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + CreateFunctionExecutionLogInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + CreateFunctionExecutionLogInput, +} from '../../orm/input-types'; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionExecutionLogMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionExecutionLogMutation(params: { - selection: ({ - fields: S & FunctionExecutionLogSelect; - } & HookStrictSelect, FunctionExecutionLogSelect>); -} & Omit; - }; -}, Error, CreateFunctionExecutionLogInput["functionExecutionLog"]>, "mutationFn">): UseMutationResult<{ - createFunctionExecutionLog: { - functionExecutionLog: InferSelectResult; - }; -}, Error, CreateFunctionExecutionLogInput["functionExecutionLog"]>; -export function useCreateFunctionExecutionLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionExecutionLogMutation( + params: { + selection: { + fields: S & FunctionExecutionLogSelect; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + CreateFunctionExecutionLogInput['functionExecutionLog'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + CreateFunctionExecutionLogInput['functionExecutionLog'] +>; +export function useCreateFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionExecutionLogMutationKeys.create(), - mutationFn: (data: CreateFunctionExecutionLogInput["functionExecutionLog"]) => getClient().functionExecutionLog.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionExecutionLogInput['functionExecutionLog']) => + getClient() + .functionExecutionLog.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionExecutionLogKeys.lists() + queryKey: functionExecutionLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphCommitMutation.ts index e51ada92fd..2c95e04e11 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphCommitMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphCommitKeys } from "../query-keys"; -import { functionGraphCommitMutationKeys } from "../mutation-keys"; -import type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations, CreateFunctionGraphCommitInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations, CreateFunctionGraphCommitInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import { functionGraphCommitMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + CreateFunctionGraphCommitInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + CreateFunctionGraphCommitInput, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionGraphCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionGraphCommitMutation(params: { - selection: ({ - fields: S & FunctionGraphCommitSelect; - } & HookStrictSelect, FunctionGraphCommitSelect>); -} & Omit; - }; -}, Error, CreateFunctionGraphCommitInput["functionGraphCommit"]>, "mutationFn">): UseMutationResult<{ - createFunctionGraphCommit: { - functionGraphCommit: InferSelectResult; - }; -}, Error, CreateFunctionGraphCommitInput["functionGraphCommit"]>; -export function useCreateFunctionGraphCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionGraphCommitMutation( + params: { + selection: { + fields: S & FunctionGraphCommitSelect; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphCommitInput['functionGraphCommit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphCommitInput['functionGraphCommit'] +>; +export function useCreateFunctionGraphCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphCommitMutationKeys.create(), - mutationFn: (data: CreateFunctionGraphCommitInput["functionGraphCommit"]) => getClient().functionGraphCommit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionGraphCommitInput['functionGraphCommit']) => + getClient() + .functionGraphCommit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionGraphCommitKeys.lists() + queryKey: functionGraphCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionMutation.ts index 1876c49d33..ff10d231cb 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionKeys } from "../query-keys"; -import { functionGraphExecutionMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations, CreateFunctionGraphExecutionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations, CreateFunctionGraphExecutionInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import { functionGraphExecutionMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + CreateFunctionGraphExecutionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + CreateFunctionGraphExecutionInput, +} from '../../orm/input-types'; /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionGraphExecutionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionGraphExecutionMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionSelect; - } & HookStrictSelect, FunctionGraphExecutionSelect>); -} & Omit; - }; -}, Error, CreateFunctionGraphExecutionInput["functionGraphExecution"]>, "mutationFn">): UseMutationResult<{ - createFunctionGraphExecution: { - functionGraphExecution: InferSelectResult; - }; -}, Error, CreateFunctionGraphExecutionInput["functionGraphExecution"]>; -export function useCreateFunctionGraphExecutionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionGraphExecutionMutation( + params: { + selection: { + fields: S & FunctionGraphExecutionSelect; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphExecutionInput['functionGraphExecution'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphExecutionInput['functionGraphExecution'] +>; +export function useCreateFunctionGraphExecutionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphExecutionMutationKeys.create(), - mutationFn: (data: CreateFunctionGraphExecutionInput["functionGraphExecution"]) => getClient().functionGraphExecution.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionGraphExecutionInput['functionGraphExecution']) => + getClient() + .functionGraphExecution.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionGraphExecutionKeys.lists() + queryKey: functionGraphExecutionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionNodeStateMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionNodeStateMutation.ts index 952f55e694..f722811efd 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionNodeStateMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionNodeStateMutation.ts @@ -4,62 +4,102 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionNodeStateKeys } from "../query-keys"; -import { functionGraphExecutionNodeStateMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations, CreateFunctionGraphExecutionNodeStateInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations, CreateFunctionGraphExecutionNodeStateInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import { functionGraphExecutionNodeStateMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + CreateFunctionGraphExecutionNodeStateInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + CreateFunctionGraphExecutionNodeStateInput, +} from '../../orm/input-types'; /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionGraphExecutionNodeStateMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionGraphExecutionNodeStateMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionNodeStateSelect; - } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>); -} & Omit; - }; -}, Error, CreateFunctionGraphExecutionNodeStateInput["functionGraphExecutionNodeState"]>, "mutationFn">): UseMutationResult<{ - createFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; - }; -}, Error, CreateFunctionGraphExecutionNodeStateInput["functionGraphExecutionNodeState"]>; -export function useCreateFunctionGraphExecutionNodeStateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionGraphExecutionNodeStateMutation< + S extends FunctionGraphExecutionNodeStateSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionNodeStateSelect; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] +>; +export function useCreateFunctionGraphExecutionNodeStateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphExecutionNodeStateMutationKeys.create(), - mutationFn: (data: CreateFunctionGraphExecutionNodeStateInput["functionGraphExecutionNodeState"]) => getClient().functionGraphExecutionNodeState.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + ) => + getClient() + .functionGraphExecutionNodeState.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.lists() + queryKey: functionGraphExecutionNodeStateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionOutputMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionOutputMutation.ts index 77bc4f822c..baf6b7f9ac 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionOutputMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionOutputMutation.ts @@ -4,62 +4,97 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionOutputKeys } from "../query-keys"; -import { functionGraphExecutionOutputMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations, CreateFunctionGraphExecutionOutputInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations, CreateFunctionGraphExecutionOutputInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import { functionGraphExecutionOutputMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + CreateFunctionGraphExecutionOutputInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + CreateFunctionGraphExecutionOutputInput, +} from '../../orm/input-types'; /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionGraphExecutionOutputMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionGraphExecutionOutputMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionOutputSelect; - } & HookStrictSelect, FunctionGraphExecutionOutputSelect>); -} & Omit; - }; -}, Error, CreateFunctionGraphExecutionOutputInput["functionGraphExecutionOutput"]>, "mutationFn">): UseMutationResult<{ - createFunctionGraphExecutionOutput: { - functionGraphExecutionOutput: InferSelectResult; - }; -}, Error, CreateFunctionGraphExecutionOutputInput["functionGraphExecutionOutput"]>; -export function useCreateFunctionGraphExecutionOutputMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionGraphExecutionOutputMutation< + S extends FunctionGraphExecutionOutputSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionOutputSelect; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + >; + }; + }, + Error, + CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput'] +>; +export function useCreateFunctionGraphExecutionOutputMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphExecutionOutputMutationKeys.create(), - mutationFn: (data: CreateFunctionGraphExecutionOutputInput["functionGraphExecutionOutput"]) => getClient().functionGraphExecutionOutput.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput']) => + getClient() + .functionGraphExecutionOutput.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionGraphExecutionOutputKeys.lists() + queryKey: functionGraphExecutionOutputKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts index 1383454c82..63532d7f17 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts @@ -4,62 +4,85 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphKeys } from "../query-keys"; -import { functionGraphMutationKeys } from "../mutation-keys"; -import type { FunctionGraphSelect, FunctionGraphWithRelations, CreateFunctionGraphInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphSelect, FunctionGraphWithRelations, CreateFunctionGraphInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import { functionGraphMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphSelect, + FunctionGraphWithRelations, + CreateFunctionGraphInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphSelect, + FunctionGraphWithRelations, + CreateFunctionGraphInput, +} from '../../orm/input-types'; /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionGraphMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionGraphMutation(params: { - selection: ({ - fields: S & FunctionGraphSelect; - } & HookStrictSelect, FunctionGraphSelect>); -} & Omit; - }; -}, Error, CreateFunctionGraphInput["functionGraph"]>, "mutationFn">): UseMutationResult<{ - createFunctionGraph: { - functionGraph: InferSelectResult; - }; -}, Error, CreateFunctionGraphInput["functionGraph"]>; -export function useCreateFunctionGraphMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionGraphMutation( + params: { + selection: { + fields: S & FunctionGraphSelect; + } & HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphInput['functionGraph'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphInput['functionGraph'] +>; +export function useCreateFunctionGraphMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphMutationKeys.create(), - mutationFn: (data: CreateFunctionGraphInput["functionGraph"]) => getClient().functionGraph.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionGraphInput['functionGraph']) => + getClient() + .functionGraph.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionGraphKeys.lists() + queryKey: functionGraphKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphObjectMutation.ts index 6dbdd82e3d..161d0809c0 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphObjectMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphObjectKeys } from "../query-keys"; -import { functionGraphObjectMutationKeys } from "../mutation-keys"; -import type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations, CreateFunctionGraphObjectInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations, CreateFunctionGraphObjectInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import { functionGraphObjectMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + CreateFunctionGraphObjectInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + CreateFunctionGraphObjectInput, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionGraphObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionGraphObjectMutation(params: { - selection: ({ - fields: S & FunctionGraphObjectSelect; - } & HookStrictSelect, FunctionGraphObjectSelect>); -} & Omit; - }; -}, Error, CreateFunctionGraphObjectInput["functionGraphObject"]>, "mutationFn">): UseMutationResult<{ - createFunctionGraphObject: { - functionGraphObject: InferSelectResult; - }; -}, Error, CreateFunctionGraphObjectInput["functionGraphObject"]>; -export function useCreateFunctionGraphObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionGraphObjectMutation( + params: { + selection: { + fields: S & FunctionGraphObjectSelect; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphObjectInput['functionGraphObject'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphObjectInput['functionGraphObject'] +>; +export function useCreateFunctionGraphObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphObjectMutationKeys.create(), - mutationFn: (data: CreateFunctionGraphObjectInput["functionGraphObject"]) => getClient().functionGraphObject.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionGraphObjectInput['functionGraphObject']) => + getClient() + .functionGraphObject.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionGraphObjectKeys.lists() + queryKey: functionGraphObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphRefMutation.ts index afd6cd11a2..bd7d8c0193 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphRefMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphRefKeys } from "../query-keys"; -import { functionGraphRefMutationKeys } from "../mutation-keys"; -import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations, CreateFunctionGraphRefInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations, CreateFunctionGraphRefInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import { functionGraphRefMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + CreateFunctionGraphRefInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + CreateFunctionGraphRefInput, +} from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionGraphRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionGraphRefMutation(params: { - selection: ({ - fields: S & FunctionGraphRefSelect; - } & HookStrictSelect, FunctionGraphRefSelect>); -} & Omit; - }; -}, Error, CreateFunctionGraphRefInput["functionGraphRef"]>, "mutationFn">): UseMutationResult<{ - createFunctionGraphRef: { - functionGraphRef: InferSelectResult; - }; -}, Error, CreateFunctionGraphRefInput["functionGraphRef"]>; -export function useCreateFunctionGraphRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionGraphRefMutation( + params: { + selection: { + fields: S & FunctionGraphRefSelect; + } & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphRefInput['functionGraphRef'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphRefInput['functionGraphRef'] +>; +export function useCreateFunctionGraphRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphRefMutationKeys.create(), - mutationFn: (data: CreateFunctionGraphRefInput["functionGraphRef"]) => getClient().functionGraphRef.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionGraphRefInput['functionGraphRef']) => + getClient() + .functionGraphRef.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionGraphRefKeys.lists() + queryKey: functionGraphRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphStoreMutation.ts index b0842c5a7a..c0e3e497a9 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphStoreMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphStoreKeys } from "../query-keys"; -import { functionGraphStoreMutationKeys } from "../mutation-keys"; -import type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations, CreateFunctionGraphStoreInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations, CreateFunctionGraphStoreInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import { functionGraphStoreMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + CreateFunctionGraphStoreInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + CreateFunctionGraphStoreInput, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionGraphStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionGraphStoreMutation(params: { - selection: ({ - fields: S & FunctionGraphStoreSelect; - } & HookStrictSelect, FunctionGraphStoreSelect>); -} & Omit; - }; -}, Error, CreateFunctionGraphStoreInput["functionGraphStore"]>, "mutationFn">): UseMutationResult<{ - createFunctionGraphStore: { - functionGraphStore: InferSelectResult; - }; -}, Error, CreateFunctionGraphStoreInput["functionGraphStore"]>; -export function useCreateFunctionGraphStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionGraphStoreMutation( + params: { + selection: { + fields: S & FunctionGraphStoreSelect; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphStoreInput['functionGraphStore'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphStoreInput['functionGraphStore'] +>; +export function useCreateFunctionGraphStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphStoreMutationKeys.create(), - mutationFn: (data: CreateFunctionGraphStoreInput["functionGraphStore"]) => getClient().functionGraphStore.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionGraphStoreInput['functionGraphStore']) => + getClient() + .functionGraphStore.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionGraphStoreKeys.lists() + queryKey: functionGraphStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationAttemptMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationAttemptMutation.ts index 6fb8bc51c4..b7fa2222f2 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationAttemptMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationAttemptMutation.ts @@ -4,62 +4,94 @@ * 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 { functionInvocationAttemptKeys } from "../query-keys"; -import { functionInvocationAttemptMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations, CreateFunctionInvocationAttemptInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations, CreateFunctionInvocationAttemptInput } from "../../orm/input-types"; +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 { functionInvocationAttemptKeys } from '../query-keys'; +import { functionInvocationAttemptMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, + CreateFunctionInvocationAttemptInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, + CreateFunctionInvocationAttemptInput, +} from '../../orm/input-types'; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionInvocationAttemptMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionInvocationAttemptMutation(params: { - selection: ({ - fields: S & FunctionInvocationAttemptSelect; - } & HookStrictSelect, FunctionInvocationAttemptSelect>); -} & Omit; - }; -}, Error, CreateFunctionInvocationAttemptInput["functionInvocationAttempt"]>, "mutationFn">): UseMutationResult<{ - createFunctionInvocationAttempt: { - functionInvocationAttempt: InferSelectResult; - }; -}, Error, CreateFunctionInvocationAttemptInput["functionInvocationAttempt"]>; -export function useCreateFunctionInvocationAttemptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionInvocationAttemptMutation< + S extends FunctionInvocationAttemptSelect, +>( + params: { + selection: { + fields: S & FunctionInvocationAttemptSelect; + } & HookStrictSelect, FunctionInvocationAttemptSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionInvocationAttempt: { + functionInvocationAttempt: InferSelectResult; + }; + }, + Error, + CreateFunctionInvocationAttemptInput['functionInvocationAttempt'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionInvocationAttempt: { + functionInvocationAttempt: InferSelectResult; + }; + }, + Error, + CreateFunctionInvocationAttemptInput['functionInvocationAttempt'] +>; +export function useCreateFunctionInvocationAttemptMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateFunctionInvocationAttemptInput['functionInvocationAttempt'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionInvocationAttemptMutationKeys.create(), - mutationFn: (data: CreateFunctionInvocationAttemptInput["functionInvocationAttempt"]) => getClient().functionInvocationAttempt.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionInvocationAttemptInput['functionInvocationAttempt']) => + getClient() + .functionInvocationAttempt.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionInvocationAttemptKeys.lists() + queryKey: functionInvocationAttemptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationMutation.ts index fb5ab3b32a..d0f21d2469 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionInvocationKeys } from "../query-keys"; -import { functionInvocationMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationSelect, FunctionInvocationWithRelations, CreateFunctionInvocationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationSelect, FunctionInvocationWithRelations, CreateFunctionInvocationInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import { functionInvocationMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + CreateFunctionInvocationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + CreateFunctionInvocationInput, +} from '../../orm/input-types'; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionInvocationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionInvocationMutation(params: { - selection: ({ - fields: S & FunctionInvocationSelect; - } & HookStrictSelect, FunctionInvocationSelect>); -} & Omit; - }; -}, Error, CreateFunctionInvocationInput["functionInvocation"]>, "mutationFn">): UseMutationResult<{ - createFunctionInvocation: { - functionInvocation: InferSelectResult; - }; -}, Error, CreateFunctionInvocationInput["functionInvocation"]>; -export function useCreateFunctionInvocationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionInvocationMutation( + params: { + selection: { + fields: S & FunctionInvocationSelect; + } & HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + CreateFunctionInvocationInput['functionInvocation'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + CreateFunctionInvocationInput['functionInvocation'] +>; +export function useCreateFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionInvocationMutationKeys.create(), - mutationFn: (data: CreateFunctionInvocationInput["functionInvocation"]) => getClient().functionInvocation.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionInvocationInput['functionInvocation']) => + getClient() + .functionInvocation.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionInvocationKeys.lists() + queryKey: functionInvocationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateGetAllTreeNodesRecordMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateGetAllTreeNodesRecordMutation.ts index 9350f7f00c..5a0447b6b9 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateGetAllTreeNodesRecordMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateGetAllTreeNodesRecordMutation.ts @@ -4,62 +4,88 @@ * 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 { getAllTreeNodesRecordKeys } from "../query-keys"; -import { getAllTreeNodesRecordMutationKeys } from "../mutation-keys"; -import type { GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordWithRelations, CreateGetAllTreeNodesRecordInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordWithRelations, CreateGetAllTreeNodesRecordInput } from "../../orm/input-types"; +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 { getAllTreeNodesRecordKeys } from '../query-keys'; +import { getAllTreeNodesRecordMutationKeys } from '../mutation-keys'; +import type { + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordWithRelations, + CreateGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordWithRelations, + CreateGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a GetAllTreeNodesRecord - * + * * @example * ```tsx * const { mutate, isPending } = useCreateGetAllTreeNodesRecordMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateGetAllTreeNodesRecordMutation(params: { - selection: ({ - fields: S & GetAllTreeNodesRecordSelect; - } & HookStrictSelect, GetAllTreeNodesRecordSelect>); -} & Omit; - }; -}, Error, CreateGetAllTreeNodesRecordInput["getAllTreeNodesRecord"]>, "mutationFn">): UseMutationResult<{ - createGetAllTreeNodesRecord: { - getAllTreeNodesRecord: InferSelectResult; - }; -}, Error, CreateGetAllTreeNodesRecordInput["getAllTreeNodesRecord"]>; -export function useCreateGetAllTreeNodesRecordMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateGetAllTreeNodesRecordMutation( + params: { + selection: { + fields: S & GetAllTreeNodesRecordSelect; + } & HookStrictSelect, GetAllTreeNodesRecordSelect>; + } & Omit< + UseMutationOptions< + { + createGetAllTreeNodesRecord: { + getAllTreeNodesRecord: InferSelectResult; + }; + }, + Error, + CreateGetAllTreeNodesRecordInput['getAllTreeNodesRecord'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createGetAllTreeNodesRecord: { + getAllTreeNodesRecord: InferSelectResult; + }; + }, + Error, + CreateGetAllTreeNodesRecordInput['getAllTreeNodesRecord'] +>; +export function useCreateGetAllTreeNodesRecordMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: getAllTreeNodesRecordMutationKeys.create(), - mutationFn: (data: CreateGetAllTreeNodesRecordInput["getAllTreeNodesRecord"]) => getClient().getAllTreeNodesRecord.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateGetAllTreeNodesRecordInput['getAllTreeNodesRecord']) => + getClient() + .getAllTreeNodesRecord.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: getAllTreeNodesRecordKeys.lists() + queryKey: getAllTreeNodesRecordKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraCommitMutation.ts index 090f055801..273e1ab40a 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraCommitMutation.ts @@ -4,62 +4,85 @@ * 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 { infraCommitKeys } from "../query-keys"; -import { infraCommitMutationKeys } from "../mutation-keys"; -import type { InfraCommitSelect, InfraCommitWithRelations, CreateInfraCommitInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraCommitSelect, InfraCommitWithRelations, CreateInfraCommitInput } from "../../orm/input-types"; +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 { infraCommitKeys } from '../query-keys'; +import { infraCommitMutationKeys } from '../mutation-keys'; +import type { + InfraCommitSelect, + InfraCommitWithRelations, + CreateInfraCommitInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraCommitSelect, + InfraCommitWithRelations, + CreateInfraCommitInput, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInfraCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInfraCommitMutation(params: { - selection: ({ - fields: S & InfraCommitSelect; - } & HookStrictSelect, InfraCommitSelect>); -} & Omit; - }; -}, Error, CreateInfraCommitInput["infraCommit"]>, "mutationFn">): UseMutationResult<{ - createInfraCommit: { - infraCommit: InferSelectResult; - }; -}, Error, CreateInfraCommitInput["infraCommit"]>; -export function useCreateInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInfraCommitMutation( + params: { + selection: { + fields: S & InfraCommitSelect; + } & HookStrictSelect, InfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + createInfraCommit: { + infraCommit: InferSelectResult; + }; + }, + Error, + CreateInfraCommitInput['infraCommit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInfraCommit: { + infraCommit: InferSelectResult; + }; + }, + Error, + CreateInfraCommitInput['infraCommit'] +>; +export function useCreateInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraCommitMutationKeys.create(), - mutationFn: (data: CreateInfraCommitInput["infraCommit"]) => getClient().infraCommit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInfraCommitInput['infraCommit']) => + getClient() + .infraCommit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: infraCommitKeys.lists() + queryKey: infraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraGetAllTreeNodesRecordMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraGetAllTreeNodesRecordMutation.ts index aa1388ea1f..18fab59dfb 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraGetAllTreeNodesRecordMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraGetAllTreeNodesRecordMutation.ts @@ -4,62 +4,94 @@ * 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 { infraGetAllTreeNodesRecordKeys } from "../query-keys"; -import { infraGetAllTreeNodesRecordMutationKeys } from "../mutation-keys"; -import type { InfraGetAllTreeNodesRecordSelect, InfraGetAllTreeNodesRecordWithRelations, CreateInfraGetAllTreeNodesRecordInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraGetAllTreeNodesRecordSelect, InfraGetAllTreeNodesRecordWithRelations, CreateInfraGetAllTreeNodesRecordInput } from "../../orm/input-types"; +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 { infraGetAllTreeNodesRecordKeys } from '../query-keys'; +import { infraGetAllTreeNodesRecordMutationKeys } from '../mutation-keys'; +import type { + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordWithRelations, + CreateInfraGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordWithRelations, + CreateInfraGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a InfraGetAllTreeNodesRecord - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInfraGetAllTreeNodesRecordMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInfraGetAllTreeNodesRecordMutation(params: { - selection: ({ - fields: S & InfraGetAllTreeNodesRecordSelect; - } & HookStrictSelect, InfraGetAllTreeNodesRecordSelect>); -} & Omit; - }; -}, Error, CreateInfraGetAllTreeNodesRecordInput["infraGetAllTreeNodesRecord"]>, "mutationFn">): UseMutationResult<{ - createInfraGetAllTreeNodesRecord: { - infraGetAllTreeNodesRecord: InferSelectResult; - }; -}, Error, CreateInfraGetAllTreeNodesRecordInput["infraGetAllTreeNodesRecord"]>; -export function useCreateInfraGetAllTreeNodesRecordMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInfraGetAllTreeNodesRecordMutation< + S extends InfraGetAllTreeNodesRecordSelect, +>( + params: { + selection: { + fields: S & InfraGetAllTreeNodesRecordSelect; + } & HookStrictSelect, InfraGetAllTreeNodesRecordSelect>; + } & Omit< + UseMutationOptions< + { + createInfraGetAllTreeNodesRecord: { + infraGetAllTreeNodesRecord: InferSelectResult; + }; + }, + Error, + CreateInfraGetAllTreeNodesRecordInput['infraGetAllTreeNodesRecord'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInfraGetAllTreeNodesRecord: { + infraGetAllTreeNodesRecord: InferSelectResult; + }; + }, + Error, + CreateInfraGetAllTreeNodesRecordInput['infraGetAllTreeNodesRecord'] +>; +export function useCreateInfraGetAllTreeNodesRecordMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateInfraGetAllTreeNodesRecordInput['infraGetAllTreeNodesRecord'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraGetAllTreeNodesRecordMutationKeys.create(), - mutationFn: (data: CreateInfraGetAllTreeNodesRecordInput["infraGetAllTreeNodesRecord"]) => getClient().infraGetAllTreeNodesRecord.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInfraGetAllTreeNodesRecordInput['infraGetAllTreeNodesRecord']) => + getClient() + .infraGetAllTreeNodesRecord.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: infraGetAllTreeNodesRecordKeys.lists() + queryKey: infraGetAllTreeNodesRecordKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraObjectMutation.ts index cb3ed0f3c1..770c486e1b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraObjectMutation.ts @@ -4,62 +4,85 @@ * 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 { infraObjectKeys } from "../query-keys"; -import { infraObjectMutationKeys } from "../mutation-keys"; -import type { InfraObjectSelect, InfraObjectWithRelations, CreateInfraObjectInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraObjectSelect, InfraObjectWithRelations, CreateInfraObjectInput } from "../../orm/input-types"; +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 { infraObjectKeys } from '../query-keys'; +import { infraObjectMutationKeys } from '../mutation-keys'; +import type { + InfraObjectSelect, + InfraObjectWithRelations, + CreateInfraObjectInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraObjectSelect, + InfraObjectWithRelations, + CreateInfraObjectInput, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInfraObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInfraObjectMutation(params: { - selection: ({ - fields: S & InfraObjectSelect; - } & HookStrictSelect, InfraObjectSelect>); -} & Omit; - }; -}, Error, CreateInfraObjectInput["infraObject"]>, "mutationFn">): UseMutationResult<{ - createInfraObject: { - infraObject: InferSelectResult; - }; -}, Error, CreateInfraObjectInput["infraObject"]>; -export function useCreateInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInfraObjectMutation( + params: { + selection: { + fields: S & InfraObjectSelect; + } & HookStrictSelect, InfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + createInfraObject: { + infraObject: InferSelectResult; + }; + }, + Error, + CreateInfraObjectInput['infraObject'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInfraObject: { + infraObject: InferSelectResult; + }; + }, + Error, + CreateInfraObjectInput['infraObject'] +>; +export function useCreateInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraObjectMutationKeys.create(), - mutationFn: (data: CreateInfraObjectInput["infraObject"]) => getClient().infraObject.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInfraObjectInput['infraObject']) => + getClient() + .infraObject.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: infraObjectKeys.lists() + queryKey: infraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraRefMutation.ts index 472b84322d..d0894ecb75 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraRefMutation.ts @@ -4,62 +4,85 @@ * 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 { infraRefKeys } from "../query-keys"; -import { infraRefMutationKeys } from "../mutation-keys"; -import type { InfraRefSelect, InfraRefWithRelations, CreateInfraRefInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraRefSelect, InfraRefWithRelations, CreateInfraRefInput } from "../../orm/input-types"; +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 { infraRefKeys } from '../query-keys'; +import { infraRefMutationKeys } from '../mutation-keys'; +import type { + InfraRefSelect, + InfraRefWithRelations, + CreateInfraRefInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraRefSelect, + InfraRefWithRelations, + CreateInfraRefInput, +} from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInfraRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInfraRefMutation(params: { - selection: ({ - fields: S & InfraRefSelect; - } & HookStrictSelect, InfraRefSelect>); -} & Omit; - }; -}, Error, CreateInfraRefInput["infraRef"]>, "mutationFn">): UseMutationResult<{ - createInfraRef: { - infraRef: InferSelectResult; - }; -}, Error, CreateInfraRefInput["infraRef"]>; -export function useCreateInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInfraRefMutation( + params: { + selection: { + fields: S & InfraRefSelect; + } & HookStrictSelect, InfraRefSelect>; + } & Omit< + UseMutationOptions< + { + createInfraRef: { + infraRef: InferSelectResult; + }; + }, + Error, + CreateInfraRefInput['infraRef'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInfraRef: { + infraRef: InferSelectResult; + }; + }, + Error, + CreateInfraRefInput['infraRef'] +>; +export function useCreateInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraRefMutationKeys.create(), - mutationFn: (data: CreateInfraRefInput["infraRef"]) => getClient().infraRef.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInfraRefInput['infraRef']) => + getClient() + .infraRef.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: infraRefKeys.lists() + queryKey: infraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraStoreMutation.ts index 2bbc0e3b8e..f8f78f97d9 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateInfraStoreMutation.ts @@ -4,62 +4,85 @@ * 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 { infraStoreKeys } from "../query-keys"; -import { infraStoreMutationKeys } from "../mutation-keys"; -import type { InfraStoreSelect, InfraStoreWithRelations, CreateInfraStoreInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraStoreSelect, InfraStoreWithRelations, CreateInfraStoreInput } from "../../orm/input-types"; +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 { infraStoreKeys } from '../query-keys'; +import { infraStoreMutationKeys } from '../mutation-keys'; +import type { + InfraStoreSelect, + InfraStoreWithRelations, + CreateInfraStoreInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraStoreSelect, + InfraStoreWithRelations, + CreateInfraStoreInput, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInfraStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInfraStoreMutation(params: { - selection: ({ - fields: S & InfraStoreSelect; - } & HookStrictSelect, InfraStoreSelect>); -} & Omit; - }; -}, Error, CreateInfraStoreInput["infraStore"]>, "mutationFn">): UseMutationResult<{ - createInfraStore: { - infraStore: InferSelectResult; - }; -}, Error, CreateInfraStoreInput["infraStore"]>; -export function useCreateInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInfraStoreMutation( + params: { + selection: { + fields: S & InfraStoreSelect; + } & HookStrictSelect, InfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + createInfraStore: { + infraStore: InferSelectResult; + }; + }, + Error, + CreateInfraStoreInput['infraStore'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInfraStore: { + infraStore: InferSelectResult; + }; + }, + Error, + CreateInfraStoreInput['infraStore'] +>; +export function useCreateInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraStoreMutationKeys.create(), - mutationFn: (data: CreateInfraStoreInput["infraStore"]) => getClient().infraStore.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInfraStoreInput['infraStore']) => + getClient() + .infraStore.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: infraStoreKeys.lists() + queryKey: infraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateIntegrationProviderMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateIntegrationProviderMutation.ts index 932e37303e..df67c292b1 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateIntegrationProviderMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateIntegrationProviderMutation.ts @@ -4,62 +4,88 @@ * 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 { integrationProviderKeys } from "../query-keys"; -import { integrationProviderMutationKeys } from "../mutation-keys"; -import type { IntegrationProviderSelect, IntegrationProviderWithRelations, CreateIntegrationProviderInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProviderSelect, IntegrationProviderWithRelations, CreateIntegrationProviderInput } from "../../orm/input-types"; +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 { integrationProviderKeys } from '../query-keys'; +import { integrationProviderMutationKeys } from '../mutation-keys'; +import type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, + CreateIntegrationProviderInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, + CreateIntegrationProviderInput, +} from '../../orm/input-types'; /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateIntegrationProviderMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateIntegrationProviderMutation(params: { - selection: ({ - fields: S & IntegrationProviderSelect; - } & HookStrictSelect, IntegrationProviderSelect>); -} & Omit; - }; -}, Error, CreateIntegrationProviderInput["integrationProvider"]>, "mutationFn">): UseMutationResult<{ - createIntegrationProvider: { - integrationProvider: InferSelectResult; - }; -}, Error, CreateIntegrationProviderInput["integrationProvider"]>; -export function useCreateIntegrationProviderMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateIntegrationProviderMutation( + params: { + selection: { + fields: S & IntegrationProviderSelect; + } & HookStrictSelect, IntegrationProviderSelect>; + } & Omit< + UseMutationOptions< + { + createIntegrationProvider: { + integrationProvider: InferSelectResult; + }; + }, + Error, + CreateIntegrationProviderInput['integrationProvider'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createIntegrationProvider: { + integrationProvider: InferSelectResult; + }; + }, + Error, + CreateIntegrationProviderInput['integrationProvider'] +>; +export function useCreateIntegrationProviderMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: integrationProviderMutationKeys.create(), - mutationFn: (data: CreateIntegrationProviderInput["integrationProvider"]) => getClient().integrationProvider.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateIntegrationProviderInput['integrationProvider']) => + getClient() + .integrationProvider.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: integrationProviderKeys.lists() + queryKey: integrationProviderKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateNamespaceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateNamespaceEventMutation.ts index 160b957517..18fc4fff8b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateNamespaceEventMutation.ts @@ -4,62 +4,88 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import { namespaceEventMutationKeys } from "../mutation-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations, CreateNamespaceEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations, CreateNamespaceEventInput } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import { namespaceEventMutationKeys } from '../mutation-keys'; +import type { + NamespaceEventSelect, + NamespaceEventWithRelations, + CreateNamespaceEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceEventSelect, + NamespaceEventWithRelations, + CreateNamespaceEventInput, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useCreateNamespaceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateNamespaceEventMutation(params: { - selection: ({ - fields: S & NamespaceEventSelect; - } & HookStrictSelect, NamespaceEventSelect>); -} & Omit; - }; -}, Error, CreateNamespaceEventInput["namespaceEvent"]>, "mutationFn">): UseMutationResult<{ - createNamespaceEvent: { - namespaceEvent: InferSelectResult; - }; -}, Error, CreateNamespaceEventInput["namespaceEvent"]>; -export function useCreateNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateNamespaceEventMutation( + params: { + selection: { + fields: S & NamespaceEventSelect; + } & HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + createNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + CreateNamespaceEventInput['namespaceEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + CreateNamespaceEventInput['namespaceEvent'] +>; +export function useCreateNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceEventMutationKeys.create(), - mutationFn: (data: CreateNamespaceEventInput["namespaceEvent"]) => getClient().namespaceEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateNamespaceEventInput['namespaceEvent']) => + getClient() + .namespaceEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.lists() + queryKey: namespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateNamespaceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateNamespaceMutation.ts index b175a2b074..1bad42cc00 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateNamespaceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateNamespaceMutation.ts @@ -4,62 +4,85 @@ * 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 { namespaceKeys } from "../query-keys"; -import { namespaceMutationKeys } from "../mutation-keys"; -import type { NamespaceSelect, NamespaceWithRelations, CreateNamespaceInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations, CreateNamespaceInput } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import { namespaceMutationKeys } from '../mutation-keys'; +import type { + NamespaceSelect, + NamespaceWithRelations, + CreateNamespaceInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceSelect, + NamespaceWithRelations, + CreateNamespaceInput, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useCreateNamespaceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateNamespaceMutation(params: { - selection: ({ - fields: S & NamespaceSelect; - } & HookStrictSelect, NamespaceSelect>); -} & Omit; - }; -}, Error, CreateNamespaceInput["namespace"]>, "mutationFn">): UseMutationResult<{ - createNamespace: { - namespace: InferSelectResult; - }; -}, Error, CreateNamespaceInput["namespace"]>; -export function useCreateNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateNamespaceMutation( + params: { + selection: { + fields: S & NamespaceSelect; + } & HookStrictSelect, NamespaceSelect>; + } & Omit< + UseMutationOptions< + { + createNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + CreateNamespaceInput['namespace'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + CreateNamespaceInput['namespace'] +>; +export function useCreateNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceMutationKeys.create(), - mutationFn: (data: CreateNamespaceInput["namespace"]) => getClient().namespace.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateNamespaceInput['namespace']) => + getClient() + .namespace.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: namespaceKeys.lists() + queryKey: namespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionApiBindingMutation.ts index d2b1da63bb..ab6b636c50 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionApiBindingMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionApiBindingMutation.ts @@ -4,62 +4,94 @@ * 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 { platformFunctionApiBindingKeys } from "../query-keys"; -import { platformFunctionApiBindingMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations, CreatePlatformFunctionApiBindingInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations, CreatePlatformFunctionApiBindingInput } from "../../orm/input-types"; +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 { platformFunctionApiBindingKeys } from '../query-keys'; +import { platformFunctionApiBindingMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, + CreatePlatformFunctionApiBindingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, + CreatePlatformFunctionApiBindingInput, +} from '../../orm/input-types'; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformFunctionApiBindingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformFunctionApiBindingMutation(params: { - selection: ({ - fields: S & PlatformFunctionApiBindingSelect; - } & HookStrictSelect, PlatformFunctionApiBindingSelect>); -} & Omit; - }; -}, Error, CreatePlatformFunctionApiBindingInput["platformFunctionApiBinding"]>, "mutationFn">): UseMutationResult<{ - createPlatformFunctionApiBinding: { - platformFunctionApiBinding: InferSelectResult; - }; -}, Error, CreatePlatformFunctionApiBindingInput["platformFunctionApiBinding"]>; -export function useCreatePlatformFunctionApiBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformFunctionApiBindingMutation< + S extends PlatformFunctionApiBindingSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionApiBindingSelect; + } & HookStrictSelect, PlatformFunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformFunctionApiBinding: { + platformFunctionApiBinding: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionApiBindingInput['platformFunctionApiBinding'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformFunctionApiBinding: { + platformFunctionApiBinding: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionApiBindingInput['platformFunctionApiBinding'] +>; +export function useCreatePlatformFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformFunctionApiBindingInput['platformFunctionApiBinding'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionApiBindingMutationKeys.create(), - mutationFn: (data: CreatePlatformFunctionApiBindingInput["platformFunctionApiBinding"]) => getClient().platformFunctionApiBinding.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformFunctionApiBindingInput['platformFunctionApiBinding']) => + getClient() + .platformFunctionApiBinding.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformFunctionApiBindingKeys.lists() + queryKey: platformFunctionApiBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDefinitionMutation.ts index 82a680bda1..0baf283c1f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDefinitionMutation.ts @@ -4,62 +4,94 @@ * 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 { platformFunctionDefinitionKeys } from "../query-keys"; -import { platformFunctionDefinitionMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations, CreatePlatformFunctionDefinitionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations, CreatePlatformFunctionDefinitionInput } from "../../orm/input-types"; +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 { platformFunctionDefinitionKeys } from '../query-keys'; +import { platformFunctionDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, + CreatePlatformFunctionDefinitionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, + CreatePlatformFunctionDefinitionInput, +} from '../../orm/input-types'; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformFunctionDefinitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformFunctionDefinitionMutation(params: { - selection: ({ - fields: S & PlatformFunctionDefinitionSelect; - } & HookStrictSelect, PlatformFunctionDefinitionSelect>); -} & Omit; - }; -}, Error, CreatePlatformFunctionDefinitionInput["platformFunctionDefinition"]>, "mutationFn">): UseMutationResult<{ - createPlatformFunctionDefinition: { - platformFunctionDefinition: InferSelectResult; - }; -}, Error, CreatePlatformFunctionDefinitionInput["platformFunctionDefinition"]>; -export function useCreatePlatformFunctionDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformFunctionDefinitionMutation< + S extends PlatformFunctionDefinitionSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDefinitionSelect; + } & HookStrictSelect, PlatformFunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionDefinitionInput['platformFunctionDefinition'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionDefinitionInput['platformFunctionDefinition'] +>; +export function useCreatePlatformFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformFunctionDefinitionInput['platformFunctionDefinition'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionDefinitionMutationKeys.create(), - mutationFn: (data: CreatePlatformFunctionDefinitionInput["platformFunctionDefinition"]) => getClient().platformFunctionDefinition.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformFunctionDefinitionInput['platformFunctionDefinition']) => + getClient() + .platformFunctionDefinition.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformFunctionDefinitionKeys.lists() + queryKey: platformFunctionDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDeploymentEventMutation.ts index b589a61f08..af9f152070 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDeploymentEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDeploymentEventMutation.ts @@ -4,62 +4,102 @@ * 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 { platformFunctionDeploymentEventKeys } from "../query-keys"; -import { platformFunctionDeploymentEventMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations, CreatePlatformFunctionDeploymentEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations, CreatePlatformFunctionDeploymentEventInput } from "../../orm/input-types"; +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 { platformFunctionDeploymentEventKeys } from '../query-keys'; +import { platformFunctionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, + CreatePlatformFunctionDeploymentEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, + CreatePlatformFunctionDeploymentEventInput, +} from '../../orm/input-types'; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformFunctionDeploymentEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformFunctionDeploymentEventMutation(params: { - selection: ({ - fields: S & PlatformFunctionDeploymentEventSelect; - } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>); -} & Omit; - }; -}, Error, CreatePlatformFunctionDeploymentEventInput["platformFunctionDeploymentEvent"]>, "mutationFn">): UseMutationResult<{ - createPlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; - }; -}, Error, CreatePlatformFunctionDeploymentEventInput["platformFunctionDeploymentEvent"]>; -export function useCreatePlatformFunctionDeploymentEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformFunctionDeploymentEventMutation< + S extends PlatformFunctionDeploymentEventSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDeploymentEventSelect; + } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformFunctionDeploymentEvent: { + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; + }; + }, + Error, + CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformFunctionDeploymentEvent: { + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; + }; + }, + Error, + CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent'] +>; +export function useCreatePlatformFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionDeploymentEventMutationKeys.create(), - mutationFn: (data: CreatePlatformFunctionDeploymentEventInput["platformFunctionDeploymentEvent"]) => getClient().platformFunctionDeploymentEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent'] + ) => + getClient() + .platformFunctionDeploymentEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentEventKeys.lists() + queryKey: platformFunctionDeploymentEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDeploymentMutation.ts index 961617c4ff..5cc2c1311c 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDeploymentMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionDeploymentMutation.ts @@ -4,62 +4,94 @@ * 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 { platformFunctionDeploymentKeys } from "../query-keys"; -import { platformFunctionDeploymentMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations, CreatePlatformFunctionDeploymentInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations, CreatePlatformFunctionDeploymentInput } from "../../orm/input-types"; +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 { platformFunctionDeploymentKeys } from '../query-keys'; +import { platformFunctionDeploymentMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, + CreatePlatformFunctionDeploymentInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, + CreatePlatformFunctionDeploymentInput, +} from '../../orm/input-types'; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformFunctionDeploymentMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformFunctionDeploymentMutation(params: { - selection: ({ - fields: S & PlatformFunctionDeploymentSelect; - } & HookStrictSelect, PlatformFunctionDeploymentSelect>); -} & Omit; - }; -}, Error, CreatePlatformFunctionDeploymentInput["platformFunctionDeployment"]>, "mutationFn">): UseMutationResult<{ - createPlatformFunctionDeployment: { - platformFunctionDeployment: InferSelectResult; - }; -}, Error, CreatePlatformFunctionDeploymentInput["platformFunctionDeployment"]>; -export function useCreatePlatformFunctionDeploymentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformFunctionDeploymentMutation< + S extends PlatformFunctionDeploymentSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDeploymentSelect; + } & HookStrictSelect, PlatformFunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformFunctionDeployment: { + platformFunctionDeployment: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionDeploymentInput['platformFunctionDeployment'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformFunctionDeployment: { + platformFunctionDeployment: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionDeploymentInput['platformFunctionDeployment'] +>; +export function useCreatePlatformFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformFunctionDeploymentInput['platformFunctionDeployment'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionDeploymentMutationKeys.create(), - mutationFn: (data: CreatePlatformFunctionDeploymentInput["platformFunctionDeployment"]) => getClient().platformFunctionDeployment.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformFunctionDeploymentInput['platformFunctionDeployment']) => + getClient() + .platformFunctionDeployment.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentKeys.lists() + queryKey: platformFunctionDeploymentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionExecutionLogMutation.ts index 3d6a969d78..e2aae4e319 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionExecutionLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionExecutionLogMutation.ts @@ -4,62 +4,97 @@ * 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 { platformFunctionExecutionLogKeys } from "../query-keys"; -import { platformFunctionExecutionLogMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations, CreatePlatformFunctionExecutionLogInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations, CreatePlatformFunctionExecutionLogInput } from "../../orm/input-types"; +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 { platformFunctionExecutionLogKeys } from '../query-keys'; +import { platformFunctionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, + CreatePlatformFunctionExecutionLogInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, + CreatePlatformFunctionExecutionLogInput, +} from '../../orm/input-types'; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformFunctionExecutionLogMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformFunctionExecutionLogMutation(params: { - selection: ({ - fields: S & PlatformFunctionExecutionLogSelect; - } & HookStrictSelect, PlatformFunctionExecutionLogSelect>); -} & Omit; - }; -}, Error, CreatePlatformFunctionExecutionLogInput["platformFunctionExecutionLog"]>, "mutationFn">): UseMutationResult<{ - createPlatformFunctionExecutionLog: { - platformFunctionExecutionLog: InferSelectResult; - }; -}, Error, CreatePlatformFunctionExecutionLogInput["platformFunctionExecutionLog"]>; -export function useCreatePlatformFunctionExecutionLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformFunctionExecutionLogMutation< + S extends PlatformFunctionExecutionLogSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionExecutionLogSelect; + } & HookStrictSelect, PlatformFunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + >; + }; + }, + Error, + CreatePlatformFunctionExecutionLogInput['platformFunctionExecutionLog'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionExecutionLogInput['platformFunctionExecutionLog'] +>; +export function useCreatePlatformFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformFunctionExecutionLogInput['platformFunctionExecutionLog'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionExecutionLogMutationKeys.create(), - mutationFn: (data: CreatePlatformFunctionExecutionLogInput["platformFunctionExecutionLog"]) => getClient().platformFunctionExecutionLog.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformFunctionExecutionLogInput['platformFunctionExecutionLog']) => + getClient() + .platformFunctionExecutionLog.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformFunctionExecutionLogKeys.lists() + queryKey: platformFunctionExecutionLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionInvocationAttemptMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionInvocationAttemptMutation.ts index 1b42bc2a5e..652e64ae7e 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionInvocationAttemptMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionInvocationAttemptMutation.ts @@ -4,62 +4,102 @@ * 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 { platformFunctionInvocationAttemptKeys } from "../query-keys"; -import { platformFunctionInvocationAttemptMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations, CreatePlatformFunctionInvocationAttemptInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations, CreatePlatformFunctionInvocationAttemptInput } from "../../orm/input-types"; +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 { platformFunctionInvocationAttemptKeys } from '../query-keys'; +import { platformFunctionInvocationAttemptMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, + CreatePlatformFunctionInvocationAttemptInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, + CreatePlatformFunctionInvocationAttemptInput, +} from '../../orm/input-types'; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformFunctionInvocationAttemptMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformFunctionInvocationAttemptMutation(params: { - selection: ({ - fields: S & PlatformFunctionInvocationAttemptSelect; - } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>); -} & Omit; - }; -}, Error, CreatePlatformFunctionInvocationAttemptInput["platformFunctionInvocationAttempt"]>, "mutationFn">): UseMutationResult<{ - createPlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; - }; -}, Error, CreatePlatformFunctionInvocationAttemptInput["platformFunctionInvocationAttempt"]>; -export function useCreatePlatformFunctionInvocationAttemptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformFunctionInvocationAttemptMutation< + S extends PlatformFunctionInvocationAttemptSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionInvocationAttemptSelect; + } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformFunctionInvocationAttempt: { + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; + }; + }, + Error, + CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformFunctionInvocationAttempt: { + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; + }; + }, + Error, + CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt'] +>; +export function useCreatePlatformFunctionInvocationAttemptMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionInvocationAttemptMutationKeys.create(), - mutationFn: (data: CreatePlatformFunctionInvocationAttemptInput["platformFunctionInvocationAttempt"]) => getClient().platformFunctionInvocationAttempt.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt'] + ) => + getClient() + .platformFunctionInvocationAttempt.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationAttemptKeys.lists() + queryKey: platformFunctionInvocationAttemptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionInvocationMutation.ts index 9035ca4ddb..7411b3372d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionInvocationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformFunctionInvocationMutation.ts @@ -4,62 +4,94 @@ * 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 { platformFunctionInvocationKeys } from "../query-keys"; -import { platformFunctionInvocationMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations, CreatePlatformFunctionInvocationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations, CreatePlatformFunctionInvocationInput } from "../../orm/input-types"; +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 { platformFunctionInvocationKeys } from '../query-keys'; +import { platformFunctionInvocationMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, + CreatePlatformFunctionInvocationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, + CreatePlatformFunctionInvocationInput, +} from '../../orm/input-types'; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformFunctionInvocationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformFunctionInvocationMutation(params: { - selection: ({ - fields: S & PlatformFunctionInvocationSelect; - } & HookStrictSelect, PlatformFunctionInvocationSelect>); -} & Omit; - }; -}, Error, CreatePlatformFunctionInvocationInput["platformFunctionInvocation"]>, "mutationFn">): UseMutationResult<{ - createPlatformFunctionInvocation: { - platformFunctionInvocation: InferSelectResult; - }; -}, Error, CreatePlatformFunctionInvocationInput["platformFunctionInvocation"]>; -export function useCreatePlatformFunctionInvocationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformFunctionInvocationMutation< + S extends PlatformFunctionInvocationSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionInvocationSelect; + } & HookStrictSelect, PlatformFunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionInvocationInput['platformFunctionInvocation'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }, + Error, + CreatePlatformFunctionInvocationInput['platformFunctionInvocation'] +>; +export function useCreatePlatformFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformFunctionInvocationInput['platformFunctionInvocation'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionInvocationMutationKeys.create(), - mutationFn: (data: CreatePlatformFunctionInvocationInput["platformFunctionInvocation"]) => getClient().platformFunctionInvocation.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformFunctionInvocationInput['platformFunctionInvocation']) => + getClient() + .platformFunctionInvocation.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationKeys.lists() + queryKey: platformFunctionInvocationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraCommitMutation.ts index 34dcf9dee1..eeacf3c389 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraCommitMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import { platformInfraCommitMutationKeys } from "../mutation-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, CreatePlatformInfraCommitInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, CreatePlatformInfraCommitInput } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import { platformInfraCommitMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + CreatePlatformInfraCommitInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + CreatePlatformInfraCommitInput, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraCommitMutation(params: { - selection: ({ - fields: S & PlatformInfraCommitSelect; - } & HookStrictSelect, PlatformInfraCommitSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraCommitInput["platformInfraCommit"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraCommit: { - platformInfraCommit: InferSelectResult; - }; -}, Error, CreatePlatformInfraCommitInput["platformInfraCommit"]>; -export function useCreatePlatformInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraCommitMutation( + params: { + selection: { + fields: S & PlatformInfraCommitSelect; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraCommitInput['platformInfraCommit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraCommitInput['platformInfraCommit'] +>; +export function useCreatePlatformInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraCommitMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraCommitInput["platformInfraCommit"]) => getClient().platformInfraCommit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInfraCommitInput['platformInfraCommit']) => + getClient() + .platformInfraCommit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.lists() + queryKey: platformInfraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraGetAllTreeNodesRecordMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraGetAllTreeNodesRecordMutation.ts index 2e7049829e..13b05cd0de 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraGetAllTreeNodesRecordMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraGetAllTreeNodesRecordMutation.ts @@ -4,62 +4,102 @@ * 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 { platformInfraGetAllTreeNodesRecordKeys } from "../query-keys"; -import { platformInfraGetAllTreeNodesRecordMutationKeys } from "../mutation-keys"; -import type { PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordWithRelations, CreatePlatformInfraGetAllTreeNodesRecordInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordWithRelations, CreatePlatformInfraGetAllTreeNodesRecordInput } from "../../orm/input-types"; +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 { platformInfraGetAllTreeNodesRecordKeys } from '../query-keys'; +import { platformInfraGetAllTreeNodesRecordMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordWithRelations, + CreatePlatformInfraGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordWithRelations, + CreatePlatformInfraGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformInfraGetAllTreeNodesRecord - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraGetAllTreeNodesRecordMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraGetAllTreeNodesRecordMutation(params: { - selection: ({ - fields: S & PlatformInfraGetAllTreeNodesRecordSelect; - } & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraGetAllTreeNodesRecordInput["platformInfraGetAllTreeNodesRecord"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraGetAllTreeNodesRecord: { - platformInfraGetAllTreeNodesRecord: InferSelectResult; - }; -}, Error, CreatePlatformInfraGetAllTreeNodesRecordInput["platformInfraGetAllTreeNodesRecord"]>; -export function useCreatePlatformInfraGetAllTreeNodesRecordMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraGetAllTreeNodesRecordMutation< + S extends PlatformInfraGetAllTreeNodesRecordSelect, +>( + params: { + selection: { + fields: S & PlatformInfraGetAllTreeNodesRecordSelect; + } & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraGetAllTreeNodesRecord: { + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; + }; + }, + Error, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraGetAllTreeNodesRecord: { + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; + }; + }, + Error, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] +>; +export function useCreatePlatformInfraGetAllTreeNodesRecordMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraGetAllTreeNodesRecordMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraGetAllTreeNodesRecordInput["platformInfraGetAllTreeNodesRecord"]) => getClient().platformInfraGetAllTreeNodesRecord.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + ) => + getClient() + .platformInfraGetAllTreeNodesRecord.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.lists() + queryKey: platformInfraGetAllTreeNodesRecordKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraObjectMutation.ts index f1c6306a5b..94102a057a 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraObjectMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import { platformInfraObjectMutationKeys } from "../mutation-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, CreatePlatformInfraObjectInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, CreatePlatformInfraObjectInput } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import { platformInfraObjectMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + CreatePlatformInfraObjectInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + CreatePlatformInfraObjectInput, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraObjectMutation(params: { - selection: ({ - fields: S & PlatformInfraObjectSelect; - } & HookStrictSelect, PlatformInfraObjectSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraObjectInput["platformInfraObject"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraObject: { - platformInfraObject: InferSelectResult; - }; -}, Error, CreatePlatformInfraObjectInput["platformInfraObject"]>; -export function useCreatePlatformInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraObjectMutation( + params: { + selection: { + fields: S & PlatformInfraObjectSelect; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraObjectInput['platformInfraObject'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraObjectInput['platformInfraObject'] +>; +export function useCreatePlatformInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraObjectMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraObjectInput["platformInfraObject"]) => getClient().platformInfraObject.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInfraObjectInput['platformInfraObject']) => + getClient() + .platformInfraObject.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.lists() + queryKey: platformInfraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraRefMutation.ts index f149ce5248..a022b59d37 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraRefMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import { platformInfraRefMutationKeys } from "../mutation-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, CreatePlatformInfraRefInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, CreatePlatformInfraRefInput } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import { platformInfraRefMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + CreatePlatformInfraRefInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + CreatePlatformInfraRefInput, +} from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraRefMutation(params: { - selection: ({ - fields: S & PlatformInfraRefSelect; - } & HookStrictSelect, PlatformInfraRefSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraRefInput["platformInfraRef"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraRef: { - platformInfraRef: InferSelectResult; - }; -}, Error, CreatePlatformInfraRefInput["platformInfraRef"]>; -export function useCreatePlatformInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraRefMutation( + params: { + selection: { + fields: S & PlatformInfraRefSelect; + } & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraRefInput['platformInfraRef'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraRefInput['platformInfraRef'] +>; +export function useCreatePlatformInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraRefMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraRefInput["platformInfraRef"]) => getClient().platformInfraRef.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInfraRefInput['platformInfraRef']) => + getClient() + .platformInfraRef.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.lists() + queryKey: platformInfraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraStoreMutation.ts index 8083934684..8d493f0e58 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformInfraStoreMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import { platformInfraStoreMutationKeys } from "../mutation-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, CreatePlatformInfraStoreInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, CreatePlatformInfraStoreInput } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import { platformInfraStoreMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + CreatePlatformInfraStoreInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + CreatePlatformInfraStoreInput, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraStoreMutation(params: { - selection: ({ - fields: S & PlatformInfraStoreSelect; - } & HookStrictSelect, PlatformInfraStoreSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraStoreInput["platformInfraStore"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraStore: { - platformInfraStore: InferSelectResult; - }; -}, Error, CreatePlatformInfraStoreInput["platformInfraStore"]>; -export function useCreatePlatformInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraStoreMutation( + params: { + selection: { + fields: S & PlatformInfraStoreSelect; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraStoreInput['platformInfraStore'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraStoreInput['platformInfraStore'] +>; +export function useCreatePlatformInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraStoreMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraStoreInput["platformInfraStore"]) => getClient().platformInfraStore.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInfraStoreInput['platformInfraStore']) => + getClient() + .platformInfraStore.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.lists() + queryKey: platformInfraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformNamespaceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformNamespaceEventMutation.ts index e058c44a93..28d55d5bfc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformNamespaceEventMutation.ts @@ -4,62 +4,88 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import { platformNamespaceEventMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, CreatePlatformNamespaceEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, CreatePlatformNamespaceEventInput } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import { platformNamespaceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + CreatePlatformNamespaceEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + CreatePlatformNamespaceEventInput, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformNamespaceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformNamespaceEventMutation(params: { - selection: ({ - fields: S & PlatformNamespaceEventSelect; - } & HookStrictSelect, PlatformNamespaceEventSelect>); -} & Omit; - }; -}, Error, CreatePlatformNamespaceEventInput["platformNamespaceEvent"]>, "mutationFn">): UseMutationResult<{ - createPlatformNamespaceEvent: { - platformNamespaceEvent: InferSelectResult; - }; -}, Error, CreatePlatformNamespaceEventInput["platformNamespaceEvent"]>; -export function useCreatePlatformNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformNamespaceEventMutation( + params: { + selection: { + fields: S & PlatformNamespaceEventSelect; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformNamespaceEventInput['platformNamespaceEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformNamespaceEventInput['platformNamespaceEvent'] +>; +export function useCreatePlatformNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceEventMutationKeys.create(), - mutationFn: (data: CreatePlatformNamespaceEventInput["platformNamespaceEvent"]) => getClient().platformNamespaceEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformNamespaceEventInput['platformNamespaceEvent']) => + getClient() + .platformNamespaceEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.lists() + queryKey: platformNamespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformNamespaceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformNamespaceMutation.ts index 7fb26987b8..ffd9d34339 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformNamespaceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformNamespaceMutation.ts @@ -4,62 +4,88 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import { platformNamespaceMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, CreatePlatformNamespaceInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, CreatePlatformNamespaceInput } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import { platformNamespaceMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + CreatePlatformNamespaceInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + CreatePlatformNamespaceInput, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformNamespaceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformNamespaceMutation(params: { - selection: ({ - fields: S & PlatformNamespaceSelect; - } & HookStrictSelect, PlatformNamespaceSelect>); -} & Omit; - }; -}, Error, CreatePlatformNamespaceInput["platformNamespace"]>, "mutationFn">): UseMutationResult<{ - createPlatformNamespace: { - platformNamespace: InferSelectResult; - }; -}, Error, CreatePlatformNamespaceInput["platformNamespace"]>; -export function useCreatePlatformNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformNamespaceMutation( + params: { + selection: { + fields: S & PlatformNamespaceSelect; + } & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + CreatePlatformNamespaceInput['platformNamespace'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + CreatePlatformNamespaceInput['platformNamespace'] +>; +export function useCreatePlatformNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceMutationKeys.create(), - mutationFn: (data: CreatePlatformNamespaceInput["platformNamespace"]) => getClient().platformNamespace.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformNamespaceInput['platformNamespace']) => + getClient() + .platformNamespace.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.lists() + queryKey: platformNamespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceDeclaredCapacityMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceDeclaredCapacityMutation.ts index b6a92aa09f..020666b1c4 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceDeclaredCapacityMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceDeclaredCapacityMutation.ts @@ -4,62 +4,102 @@ * 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 { platformResourceDeclaredCapacityKeys } from "../query-keys"; -import { platformResourceDeclaredCapacityMutationKeys } from "../mutation-keys"; -import type { PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityWithRelations, CreatePlatformResourceDeclaredCapacityInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityWithRelations, CreatePlatformResourceDeclaredCapacityInput } from "../../orm/input-types"; +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 { platformResourceDeclaredCapacityKeys } from '../query-keys'; +import { platformResourceDeclaredCapacityMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityWithRelations, + CreatePlatformResourceDeclaredCapacityInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityWithRelations, + CreatePlatformResourceDeclaredCapacityInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformResourceDeclaredCapacity - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceDeclaredCapacityMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceDeclaredCapacityMutation(params: { - selection: ({ - fields: S & PlatformResourceDeclaredCapacitySelect; - } & HookStrictSelect, PlatformResourceDeclaredCapacitySelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceDeclaredCapacityInput["platformResourceDeclaredCapacity"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourceDeclaredCapacity: { - platformResourceDeclaredCapacity: InferSelectResult; - }; -}, Error, CreatePlatformResourceDeclaredCapacityInput["platformResourceDeclaredCapacity"]>; -export function useCreatePlatformResourceDeclaredCapacityMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceDeclaredCapacityMutation< + S extends PlatformResourceDeclaredCapacitySelect, +>( + params: { + selection: { + fields: S & PlatformResourceDeclaredCapacitySelect; + } & HookStrictSelect, PlatformResourceDeclaredCapacitySelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourceDeclaredCapacity: { + platformResourceDeclaredCapacity: InferSelectResult< + PlatformResourceDeclaredCapacityWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourceDeclaredCapacityInput['platformResourceDeclaredCapacity'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourceDeclaredCapacity: { + platformResourceDeclaredCapacity: InferSelectResult< + PlatformResourceDeclaredCapacityWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourceDeclaredCapacityInput['platformResourceDeclaredCapacity'] +>; +export function useCreatePlatformResourceDeclaredCapacityMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformResourceDeclaredCapacityInput['platformResourceDeclaredCapacity'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceDeclaredCapacityMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceDeclaredCapacityInput["platformResourceDeclaredCapacity"]) => getClient().platformResourceDeclaredCapacity.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreatePlatformResourceDeclaredCapacityInput['platformResourceDeclaredCapacity'] + ) => + getClient() + .platformResourceDeclaredCapacity.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceDeclaredCapacityKeys.lists() + queryKey: platformResourceDeclaredCapacityKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceDefinitionMutation.ts index 1086ca55cd..c87268a8f5 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceDefinitionMutation.ts @@ -4,62 +4,94 @@ * 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 { platformResourceDefinitionKeys } from "../query-keys"; -import { platformResourceDefinitionMutationKeys } from "../mutation-keys"; -import type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations, CreatePlatformResourceDefinitionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations, CreatePlatformResourceDefinitionInput } from "../../orm/input-types"; +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 { platformResourceDefinitionKeys } from '../query-keys'; +import { platformResourceDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, + CreatePlatformResourceDefinitionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, + CreatePlatformResourceDefinitionInput, +} from '../../orm/input-types'; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceDefinitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceDefinitionMutation(params: { - selection: ({ - fields: S & PlatformResourceDefinitionSelect; - } & HookStrictSelect, PlatformResourceDefinitionSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceDefinitionInput["platformResourceDefinition"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourceDefinition: { - platformResourceDefinition: InferSelectResult; - }; -}, Error, CreatePlatformResourceDefinitionInput["platformResourceDefinition"]>; -export function useCreatePlatformResourceDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceDefinitionMutation< + S extends PlatformResourceDefinitionSelect, +>( + params: { + selection: { + fields: S & PlatformResourceDefinitionSelect; + } & HookStrictSelect, PlatformResourceDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourceDefinition: { + platformResourceDefinition: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceDefinitionInput['platformResourceDefinition'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourceDefinition: { + platformResourceDefinition: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceDefinitionInput['platformResourceDefinition'] +>; +export function useCreatePlatformResourceDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformResourceDefinitionInput['platformResourceDefinition'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceDefinitionMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceDefinitionInput["platformResourceDefinition"]) => getClient().platformResourceDefinition.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourceDefinitionInput['platformResourceDefinition']) => + getClient() + .platformResourceDefinition.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceDefinitionKeys.lists() + queryKey: platformResourceDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceEventMutation.ts index 242f1f43b8..a459e2a53f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceEventMutation.ts @@ -4,62 +4,88 @@ * 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 { platformResourceEventKeys } from "../query-keys"; -import { platformResourceEventMutationKeys } from "../mutation-keys"; -import type { PlatformResourceEventSelect, PlatformResourceEventWithRelations, CreatePlatformResourceEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceEventSelect, PlatformResourceEventWithRelations, CreatePlatformResourceEventInput } from "../../orm/input-types"; +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 { platformResourceEventKeys } from '../query-keys'; +import { platformResourceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, + CreatePlatformResourceEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, + CreatePlatformResourceEventInput, +} from '../../orm/input-types'; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceEventMutation(params: { - selection: ({ - fields: S & PlatformResourceEventSelect; - } & HookStrictSelect, PlatformResourceEventSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceEventInput["platformResourceEvent"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourceEvent: { - platformResourceEvent: InferSelectResult; - }; -}, Error, CreatePlatformResourceEventInput["platformResourceEvent"]>; -export function useCreatePlatformResourceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceEventMutation( + params: { + selection: { + fields: S & PlatformResourceEventSelect; + } & HookStrictSelect, PlatformResourceEventSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourceEvent: { + platformResourceEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceEventInput['platformResourceEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourceEvent: { + platformResourceEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceEventInput['platformResourceEvent'] +>; +export function useCreatePlatformResourceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceEventMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceEventInput["platformResourceEvent"]) => getClient().platformResourceEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourceEventInput['platformResourceEvent']) => + getClient() + .platformResourceEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceEventKeys.lists() + queryKey: platformResourceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceInstallationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceInstallationMutation.ts index 9819cc4fbc..c28dcb56dc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceInstallationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceInstallationMutation.ts @@ -4,62 +4,97 @@ * 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 { platformResourceInstallationKeys } from "../query-keys"; -import { platformResourceInstallationMutationKeys } from "../mutation-keys"; -import type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations, CreatePlatformResourceInstallationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations, CreatePlatformResourceInstallationInput } from "../../orm/input-types"; +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 { platformResourceInstallationKeys } from '../query-keys'; +import { platformResourceInstallationMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, + CreatePlatformResourceInstallationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, + CreatePlatformResourceInstallationInput, +} from '../../orm/input-types'; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceInstallationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceInstallationMutation(params: { - selection: ({ - fields: S & PlatformResourceInstallationSelect; - } & HookStrictSelect, PlatformResourceInstallationSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceInstallationInput["platformResourceInstallation"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourceInstallation: { - platformResourceInstallation: InferSelectResult; - }; -}, Error, CreatePlatformResourceInstallationInput["platformResourceInstallation"]>; -export function useCreatePlatformResourceInstallationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceInstallationMutation< + S extends PlatformResourceInstallationSelect, +>( + params: { + selection: { + fields: S & PlatformResourceInstallationSelect; + } & HookStrictSelect, PlatformResourceInstallationSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourceInstallation: { + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourceInstallationInput['platformResourceInstallation'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourceInstallation: { + platformResourceInstallation: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceInstallationInput['platformResourceInstallation'] +>; +export function useCreatePlatformResourceInstallationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformResourceInstallationInput['platformResourceInstallation'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceInstallationMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceInstallationInput["platformResourceInstallation"]) => getClient().platformResourceInstallation.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourceInstallationInput['platformResourceInstallation']) => + getClient() + .platformResourceInstallation.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceInstallationKeys.lists() + queryKey: platformResourceInstallationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceMutation.ts index ac32aa02e8..a9554e2496 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceMutation.ts @@ -4,62 +4,88 @@ * 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 { platformResourceKeys } from "../query-keys"; -import { platformResourceMutationKeys } from "../mutation-keys"; -import type { PlatformResourceSelect, PlatformResourceWithRelations, CreatePlatformResourceInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceSelect, PlatformResourceWithRelations, CreatePlatformResourceInput } from "../../orm/input-types"; +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 { platformResourceKeys } from '../query-keys'; +import { platformResourceMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceSelect, + PlatformResourceWithRelations, + CreatePlatformResourceInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceSelect, + PlatformResourceWithRelations, + CreatePlatformResourceInput, +} from '../../orm/input-types'; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceMutation(params: { - selection: ({ - fields: S & PlatformResourceSelect; - } & HookStrictSelect, PlatformResourceSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceInput["platformResource"]>, "mutationFn">): UseMutationResult<{ - createPlatformResource: { - platformResource: InferSelectResult; - }; -}, Error, CreatePlatformResourceInput["platformResource"]>; -export function useCreatePlatformResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceMutation( + params: { + selection: { + fields: S & PlatformResourceSelect; + } & HookStrictSelect, PlatformResourceSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResource: { + platformResource: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceInput['platformResource'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResource: { + platformResource: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceInput['platformResource'] +>; +export function useCreatePlatformResourceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceInput["platformResource"]) => getClient().platformResource.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourceInput['platformResource']) => + getClient() + .platformResource.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceKeys.lists() + queryKey: platformResourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceStatusCheckMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceStatusCheckMutation.ts index e62290bd80..dd6f667bae 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceStatusCheckMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceStatusCheckMutation.ts @@ -4,62 +4,97 @@ * 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 { platformResourceStatusCheckKeys } from "../query-keys"; -import { platformResourceStatusCheckMutationKeys } from "../mutation-keys"; -import type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations, CreatePlatformResourceStatusCheckInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations, CreatePlatformResourceStatusCheckInput } from "../../orm/input-types"; +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 { platformResourceStatusCheckKeys } from '../query-keys'; +import { platformResourceStatusCheckMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, + CreatePlatformResourceStatusCheckInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, + CreatePlatformResourceStatusCheckInput, +} from '../../orm/input-types'; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceStatusCheckMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceStatusCheckMutation(params: { - selection: ({ - fields: S & PlatformResourceStatusCheckSelect; - } & HookStrictSelect, PlatformResourceStatusCheckSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceStatusCheckInput["platformResourceStatusCheck"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourceStatusCheck: { - platformResourceStatusCheck: InferSelectResult; - }; -}, Error, CreatePlatformResourceStatusCheckInput["platformResourceStatusCheck"]>; -export function useCreatePlatformResourceStatusCheckMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceStatusCheckMutation< + S extends PlatformResourceStatusCheckSelect, +>( + params: { + selection: { + fields: S & PlatformResourceStatusCheckSelect; + } & HookStrictSelect, PlatformResourceStatusCheckSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourceStatusCheck: { + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourceStatusCheckInput['platformResourceStatusCheck'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourceStatusCheck: { + platformResourceStatusCheck: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceStatusCheckInput['platformResourceStatusCheck'] +>; +export function useCreatePlatformResourceStatusCheckMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformResourceStatusCheckInput['platformResourceStatusCheck'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceStatusCheckMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceStatusCheckInput["platformResourceStatusCheck"]) => getClient().platformResourceStatusCheck.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourceStatusCheckInput['platformResourceStatusCheck']) => + getClient() + .platformResourceStatusCheck.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceStatusCheckKeys.lists() + queryKey: platformResourceStatusCheckKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUsageLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUsageLogMutation.ts index 25c9f73b94..bb7884318a 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUsageLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUsageLogMutation.ts @@ -4,62 +4,88 @@ * 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 { platformResourceUsageLogKeys } from "../query-keys"; -import { platformResourceUsageLogMutationKeys } from "../mutation-keys"; -import type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations, CreatePlatformResourceUsageLogInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations, CreatePlatformResourceUsageLogInput } from "../../orm/input-types"; +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 { platformResourceUsageLogKeys } from '../query-keys'; +import { platformResourceUsageLogMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, + CreatePlatformResourceUsageLogInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, + CreatePlatformResourceUsageLogInput, +} from '../../orm/input-types'; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceUsageLogMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceUsageLogMutation(params: { - selection: ({ - fields: S & PlatformResourceUsageLogSelect; - } & HookStrictSelect, PlatformResourceUsageLogSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceUsageLogInput["platformResourceUsageLog"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourceUsageLog: { - platformResourceUsageLog: InferSelectResult; - }; -}, Error, CreatePlatformResourceUsageLogInput["platformResourceUsageLog"]>; -export function useCreatePlatformResourceUsageLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceUsageLogMutation( + params: { + selection: { + fields: S & PlatformResourceUsageLogSelect; + } & HookStrictSelect, PlatformResourceUsageLogSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourceUsageLog: { + platformResourceUsageLog: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceUsageLogInput['platformResourceUsageLog'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourceUsageLog: { + platformResourceUsageLog: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceUsageLogInput['platformResourceUsageLog'] +>; +export function useCreatePlatformResourceUsageLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceUsageLogMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceUsageLogInput["platformResourceUsageLog"]) => getClient().platformResourceUsageLog.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourceUsageLogInput['platformResourceUsageLog']) => + getClient() + .platformResourceUsageLog.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceUsageLogKeys.lists() + queryKey: platformResourceUsageLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUsageSummaryMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUsageSummaryMutation.ts index 140463be54..42e7365334 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUsageSummaryMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUsageSummaryMutation.ts @@ -4,62 +4,97 @@ * 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 { platformResourceUsageSummaryKeys } from "../query-keys"; -import { platformResourceUsageSummaryMutationKeys } from "../mutation-keys"; -import type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations, CreatePlatformResourceUsageSummaryInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations, CreatePlatformResourceUsageSummaryInput } from "../../orm/input-types"; +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 { platformResourceUsageSummaryKeys } from '../query-keys'; +import { platformResourceUsageSummaryMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, + CreatePlatformResourceUsageSummaryInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, + CreatePlatformResourceUsageSummaryInput, +} from '../../orm/input-types'; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceUsageSummaryMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceUsageSummaryMutation(params: { - selection: ({ - fields: S & PlatformResourceUsageSummarySelect; - } & HookStrictSelect, PlatformResourceUsageSummarySelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceUsageSummaryInput["platformResourceUsageSummary"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourceUsageSummary: { - platformResourceUsageSummary: InferSelectResult; - }; -}, Error, CreatePlatformResourceUsageSummaryInput["platformResourceUsageSummary"]>; -export function useCreatePlatformResourceUsageSummaryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceUsageSummaryMutation< + S extends PlatformResourceUsageSummarySelect, +>( + params: { + selection: { + fields: S & PlatformResourceUsageSummarySelect; + } & HookStrictSelect, PlatformResourceUsageSummarySelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourceUsageSummary: { + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourceUsageSummaryInput['platformResourceUsageSummary'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourceUsageSummary: { + platformResourceUsageSummary: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceUsageSummaryInput['platformResourceUsageSummary'] +>; +export function useCreatePlatformResourceUsageSummaryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformResourceUsageSummaryInput['platformResourceUsageSummary'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceUsageSummaryMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceUsageSummaryInput["platformResourceUsageSummary"]) => getClient().platformResourceUsageSummary.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourceUsageSummaryInput['platformResourceUsageSummary']) => + getClient() + .platformResourceUsageSummary.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceUsageSummaryKeys.lists() + queryKey: platformResourceUsageSummaryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUtilizationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUtilizationMutation.ts index c1f8073a5c..c29fc2a562 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUtilizationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourceUtilizationMutation.ts @@ -4,62 +4,97 @@ * 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 { platformResourceUtilizationKeys } from "../query-keys"; -import { platformResourceUtilizationMutationKeys } from "../mutation-keys"; -import type { PlatformResourceUtilizationSelect, PlatformResourceUtilizationWithRelations, CreatePlatformResourceUtilizationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUtilizationSelect, PlatformResourceUtilizationWithRelations, CreatePlatformResourceUtilizationInput } from "../../orm/input-types"; +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 { platformResourceUtilizationKeys } from '../query-keys'; +import { platformResourceUtilizationMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationWithRelations, + CreatePlatformResourceUtilizationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationWithRelations, + CreatePlatformResourceUtilizationInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformResourceUtilization - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourceUtilizationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourceUtilizationMutation(params: { - selection: ({ - fields: S & PlatformResourceUtilizationSelect; - } & HookStrictSelect, PlatformResourceUtilizationSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourceUtilizationInput["platformResourceUtilization"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourceUtilization: { - platformResourceUtilization: InferSelectResult; - }; -}, Error, CreatePlatformResourceUtilizationInput["platformResourceUtilization"]>; -export function useCreatePlatformResourceUtilizationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourceUtilizationMutation< + S extends PlatformResourceUtilizationSelect, +>( + params: { + selection: { + fields: S & PlatformResourceUtilizationSelect; + } & HookStrictSelect, PlatformResourceUtilizationSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourceUtilization: { + platformResourceUtilization: InferSelectResult< + PlatformResourceUtilizationWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourceUtilizationInput['platformResourceUtilization'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourceUtilization: { + platformResourceUtilization: InferSelectResult; + }; + }, + Error, + CreatePlatformResourceUtilizationInput['platformResourceUtilization'] +>; +export function useCreatePlatformResourceUtilizationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformResourceUtilizationInput['platformResourceUtilization'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceUtilizationMutationKeys.create(), - mutationFn: (data: CreatePlatformResourceUtilizationInput["platformResourceUtilization"]) => getClient().platformResourceUtilization.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourceUtilizationInput['platformResourceUtilization']) => + getClient() + .platformResourceUtilization.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourceUtilizationKeys.lists() + queryKey: platformResourceUtilizationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesHealthMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesHealthMutation.ts index c1be407db9..f2157eba58 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesHealthMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesHealthMutation.ts @@ -4,62 +4,88 @@ * 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 { platformResourcesHealthKeys } from "../query-keys"; -import { platformResourcesHealthMutationKeys } from "../mutation-keys"; -import type { PlatformResourcesHealthSelect, PlatformResourcesHealthWithRelations, CreatePlatformResourcesHealthInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourcesHealthSelect, PlatformResourcesHealthWithRelations, CreatePlatformResourcesHealthInput } from "../../orm/input-types"; +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 { platformResourcesHealthKeys } from '../query-keys'; +import { platformResourcesHealthMutationKeys } from '../mutation-keys'; +import type { + PlatformResourcesHealthSelect, + PlatformResourcesHealthWithRelations, + CreatePlatformResourcesHealthInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourcesHealthSelect, + PlatformResourcesHealthWithRelations, + CreatePlatformResourcesHealthInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformResourcesHealth - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourcesHealthMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourcesHealthMutation(params: { - selection: ({ - fields: S & PlatformResourcesHealthSelect; - } & HookStrictSelect, PlatformResourcesHealthSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourcesHealthInput["platformResourcesHealth"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourcesHealth: { - platformResourcesHealth: InferSelectResult; - }; -}, Error, CreatePlatformResourcesHealthInput["platformResourcesHealth"]>; -export function useCreatePlatformResourcesHealthMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourcesHealthMutation( + params: { + selection: { + fields: S & PlatformResourcesHealthSelect; + } & HookStrictSelect, PlatformResourcesHealthSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourcesHealth: { + platformResourcesHealth: InferSelectResult; + }; + }, + Error, + CreatePlatformResourcesHealthInput['platformResourcesHealth'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourcesHealth: { + platformResourcesHealth: InferSelectResult; + }; + }, + Error, + CreatePlatformResourcesHealthInput['platformResourcesHealth'] +>; +export function useCreatePlatformResourcesHealthMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourcesHealthMutationKeys.create(), - mutationFn: (data: CreatePlatformResourcesHealthInput["platformResourcesHealth"]) => getClient().platformResourcesHealth.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformResourcesHealthInput['platformResourcesHealth']) => + getClient() + .platformResourcesHealth.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourcesHealthKeys.lists() + queryKey: platformResourcesHealthKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesRequirementsStateMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesRequirementsStateMutation.ts index 2f02f0a571..57e2f93f58 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesRequirementsStateMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesRequirementsStateMutation.ts @@ -4,62 +4,102 @@ * 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 { platformResourcesRequirementsStateKeys } from "../query-keys"; -import { platformResourcesRequirementsStateMutationKeys } from "../mutation-keys"; -import type { PlatformResourcesRequirementsStateSelect, PlatformResourcesRequirementsStateWithRelations, CreatePlatformResourcesRequirementsStateInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourcesRequirementsStateSelect, PlatformResourcesRequirementsStateWithRelations, CreatePlatformResourcesRequirementsStateInput } from "../../orm/input-types"; +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 { platformResourcesRequirementsStateKeys } from '../query-keys'; +import { platformResourcesRequirementsStateMutationKeys } from '../mutation-keys'; +import type { + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateWithRelations, + CreatePlatformResourcesRequirementsStateInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateWithRelations, + CreatePlatformResourcesRequirementsStateInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformResourcesRequirementsState - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourcesRequirementsStateMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourcesRequirementsStateMutation(params: { - selection: ({ - fields: S & PlatformResourcesRequirementsStateSelect; - } & HookStrictSelect, PlatformResourcesRequirementsStateSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourcesRequirementsStateInput["platformResourcesRequirementsState"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourcesRequirementsState: { - platformResourcesRequirementsState: InferSelectResult; - }; -}, Error, CreatePlatformResourcesRequirementsStateInput["platformResourcesRequirementsState"]>; -export function useCreatePlatformResourcesRequirementsStateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourcesRequirementsStateMutation< + S extends PlatformResourcesRequirementsStateSelect, +>( + params: { + selection: { + fields: S & PlatformResourcesRequirementsStateSelect; + } & HookStrictSelect, PlatformResourcesRequirementsStateSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourcesRequirementsState: { + platformResourcesRequirementsState: InferSelectResult< + PlatformResourcesRequirementsStateWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourcesRequirementsStateInput['platformResourcesRequirementsState'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourcesRequirementsState: { + platformResourcesRequirementsState: InferSelectResult< + PlatformResourcesRequirementsStateWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourcesRequirementsStateInput['platformResourcesRequirementsState'] +>; +export function useCreatePlatformResourcesRequirementsStateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformResourcesRequirementsStateInput['platformResourcesRequirementsState'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourcesRequirementsStateMutationKeys.create(), - mutationFn: (data: CreatePlatformResourcesRequirementsStateInput["platformResourcesRequirementsState"]) => getClient().platformResourcesRequirementsState.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreatePlatformResourcesRequirementsStateInput['platformResourcesRequirementsState'] + ) => + getClient() + .platformResourcesRequirementsState.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourcesRequirementsStateKeys.lists() + queryKey: platformResourcesRequirementsStateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesResolvedRequirementMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesResolvedRequirementMutation.ts index c665df315e..6a037c2326 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesResolvedRequirementMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformResourcesResolvedRequirementMutation.ts @@ -4,62 +4,102 @@ * 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 { platformResourcesResolvedRequirementKeys } from "../query-keys"; -import { platformResourcesResolvedRequirementMutationKeys } from "../mutation-keys"; -import type { PlatformResourcesResolvedRequirementSelect, PlatformResourcesResolvedRequirementWithRelations, CreatePlatformResourcesResolvedRequirementInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourcesResolvedRequirementSelect, PlatformResourcesResolvedRequirementWithRelations, CreatePlatformResourcesResolvedRequirementInput } from "../../orm/input-types"; +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 { platformResourcesResolvedRequirementKeys } from '../query-keys'; +import { platformResourcesResolvedRequirementMutationKeys } from '../mutation-keys'; +import type { + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementWithRelations, + CreatePlatformResourcesResolvedRequirementInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementWithRelations, + CreatePlatformResourcesResolvedRequirementInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformResourcesResolvedRequirement - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformResourcesResolvedRequirementMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformResourcesResolvedRequirementMutation(params: { - selection: ({ - fields: S & PlatformResourcesResolvedRequirementSelect; - } & HookStrictSelect, PlatformResourcesResolvedRequirementSelect>); -} & Omit; - }; -}, Error, CreatePlatformResourcesResolvedRequirementInput["platformResourcesResolvedRequirement"]>, "mutationFn">): UseMutationResult<{ - createPlatformResourcesResolvedRequirement: { - platformResourcesResolvedRequirement: InferSelectResult; - }; -}, Error, CreatePlatformResourcesResolvedRequirementInput["platformResourcesResolvedRequirement"]>; -export function useCreatePlatformResourcesResolvedRequirementMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformResourcesResolvedRequirementMutation< + S extends PlatformResourcesResolvedRequirementSelect, +>( + params: { + selection: { + fields: S & PlatformResourcesResolvedRequirementSelect; + } & HookStrictSelect, PlatformResourcesResolvedRequirementSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformResourcesResolvedRequirement: { + platformResourcesResolvedRequirement: InferSelectResult< + PlatformResourcesResolvedRequirementWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourcesResolvedRequirementInput['platformResourcesResolvedRequirement'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformResourcesResolvedRequirement: { + platformResourcesResolvedRequirement: InferSelectResult< + PlatformResourcesResolvedRequirementWithRelations, + S + >; + }; + }, + Error, + CreatePlatformResourcesResolvedRequirementInput['platformResourcesResolvedRequirement'] +>; +export function useCreatePlatformResourcesResolvedRequirementMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformResourcesResolvedRequirementInput['platformResourcesResolvedRequirement'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourcesResolvedRequirementMutationKeys.create(), - mutationFn: (data: CreatePlatformResourcesResolvedRequirementInput["platformResourcesResolvedRequirement"]) => getClient().platformResourcesResolvedRequirement.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreatePlatformResourcesResolvedRequirementInput['platformResourcesResolvedRequirement'] + ) => + getClient() + .platformResourcesResolvedRequirement.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformResourcesResolvedRequirementKeys.lists() + queryKey: platformResourcesResolvedRequirementKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformWebhookEndpointMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformWebhookEndpointMutation.ts index 7007091f70..cd10275c76 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformWebhookEndpointMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformWebhookEndpointMutation.ts @@ -4,62 +4,88 @@ * 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 { platformWebhookEndpointKeys } from "../query-keys"; -import { platformWebhookEndpointMutationKeys } from "../mutation-keys"; -import type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations, CreatePlatformWebhookEndpointInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations, CreatePlatformWebhookEndpointInput } from "../../orm/input-types"; +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 { platformWebhookEndpointKeys } from '../query-keys'; +import { platformWebhookEndpointMutationKeys } from '../mutation-keys'; +import type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, + CreatePlatformWebhookEndpointInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, + CreatePlatformWebhookEndpointInput, +} from '../../orm/input-types'; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformWebhookEndpointMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformWebhookEndpointMutation(params: { - selection: ({ - fields: S & PlatformWebhookEndpointSelect; - } & HookStrictSelect, PlatformWebhookEndpointSelect>); -} & Omit; - }; -}, Error, CreatePlatformWebhookEndpointInput["platformWebhookEndpoint"]>, "mutationFn">): UseMutationResult<{ - createPlatformWebhookEndpoint: { - platformWebhookEndpoint: InferSelectResult; - }; -}, Error, CreatePlatformWebhookEndpointInput["platformWebhookEndpoint"]>; -export function useCreatePlatformWebhookEndpointMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformWebhookEndpointMutation( + params: { + selection: { + fields: S & PlatformWebhookEndpointSelect; + } & HookStrictSelect, PlatformWebhookEndpointSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformWebhookEndpoint: { + platformWebhookEndpoint: InferSelectResult; + }; + }, + Error, + CreatePlatformWebhookEndpointInput['platformWebhookEndpoint'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformWebhookEndpoint: { + platformWebhookEndpoint: InferSelectResult; + }; + }, + Error, + CreatePlatformWebhookEndpointInput['platformWebhookEndpoint'] +>; +export function useCreatePlatformWebhookEndpointMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformWebhookEndpointMutationKeys.create(), - mutationFn: (data: CreatePlatformWebhookEndpointInput["platformWebhookEndpoint"]) => getClient().platformWebhookEndpoint.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformWebhookEndpointInput['platformWebhookEndpoint']) => + getClient() + .platformWebhookEndpoint.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformWebhookEndpointKeys.lists() + queryKey: platformWebhookEndpointKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformWebhookEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformWebhookEventMutation.ts index 09332de9a6..7260efbc4b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformWebhookEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreatePlatformWebhookEventMutation.ts @@ -4,62 +4,88 @@ * 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 { platformWebhookEventKeys } from "../query-keys"; -import { platformWebhookEventMutationKeys } from "../mutation-keys"; -import type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations, CreatePlatformWebhookEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations, CreatePlatformWebhookEventInput } from "../../orm/input-types"; +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 { platformWebhookEventKeys } from '../query-keys'; +import { platformWebhookEventMutationKeys } from '../mutation-keys'; +import type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, + CreatePlatformWebhookEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, + CreatePlatformWebhookEventInput, +} from '../../orm/input-types'; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformWebhookEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformWebhookEventMutation(params: { - selection: ({ - fields: S & PlatformWebhookEventSelect; - } & HookStrictSelect, PlatformWebhookEventSelect>); -} & Omit; - }; -}, Error, CreatePlatformWebhookEventInput["platformWebhookEvent"]>, "mutationFn">): UseMutationResult<{ - createPlatformWebhookEvent: { - platformWebhookEvent: InferSelectResult; - }; -}, Error, CreatePlatformWebhookEventInput["platformWebhookEvent"]>; -export function useCreatePlatformWebhookEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformWebhookEventMutation( + params: { + selection: { + fields: S & PlatformWebhookEventSelect; + } & HookStrictSelect, PlatformWebhookEventSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformWebhookEvent: { + platformWebhookEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformWebhookEventInput['platformWebhookEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformWebhookEvent: { + platformWebhookEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformWebhookEventInput['platformWebhookEvent'] +>; +export function useCreatePlatformWebhookEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformWebhookEventMutationKeys.create(), - mutationFn: (data: CreatePlatformWebhookEventInput["platformWebhookEvent"]) => getClient().platformWebhookEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformWebhookEventInput['platformWebhookEvent']) => + getClient() + .platformWebhookEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformWebhookEventKeys.lists() + queryKey: platformWebhookEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceDeclaredCapacityMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceDeclaredCapacityMutation.ts index 7724f95322..ccb4c7b2c6 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceDeclaredCapacityMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceDeclaredCapacityMutation.ts @@ -4,62 +4,88 @@ * 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 { resourceDeclaredCapacityKeys } from "../query-keys"; -import { resourceDeclaredCapacityMutationKeys } from "../mutation-keys"; -import type { ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityWithRelations, CreateResourceDeclaredCapacityInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityWithRelations, CreateResourceDeclaredCapacityInput } from "../../orm/input-types"; +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 { resourceDeclaredCapacityKeys } from '../query-keys'; +import { resourceDeclaredCapacityMutationKeys } from '../mutation-keys'; +import type { + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityWithRelations, + CreateResourceDeclaredCapacityInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityWithRelations, + CreateResourceDeclaredCapacityInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ResourceDeclaredCapacity - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceDeclaredCapacityMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceDeclaredCapacityMutation(params: { - selection: ({ - fields: S & ResourceDeclaredCapacitySelect; - } & HookStrictSelect, ResourceDeclaredCapacitySelect>); -} & Omit; - }; -}, Error, CreateResourceDeclaredCapacityInput["resourceDeclaredCapacity"]>, "mutationFn">): UseMutationResult<{ - createResourceDeclaredCapacity: { - resourceDeclaredCapacity: InferSelectResult; - }; -}, Error, CreateResourceDeclaredCapacityInput["resourceDeclaredCapacity"]>; -export function useCreateResourceDeclaredCapacityMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceDeclaredCapacityMutation( + params: { + selection: { + fields: S & ResourceDeclaredCapacitySelect; + } & HookStrictSelect, ResourceDeclaredCapacitySelect>; + } & Omit< + UseMutationOptions< + { + createResourceDeclaredCapacity: { + resourceDeclaredCapacity: InferSelectResult; + }; + }, + Error, + CreateResourceDeclaredCapacityInput['resourceDeclaredCapacity'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceDeclaredCapacity: { + resourceDeclaredCapacity: InferSelectResult; + }; + }, + Error, + CreateResourceDeclaredCapacityInput['resourceDeclaredCapacity'] +>; +export function useCreateResourceDeclaredCapacityMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceDeclaredCapacityMutationKeys.create(), - mutationFn: (data: CreateResourceDeclaredCapacityInput["resourceDeclaredCapacity"]) => getClient().resourceDeclaredCapacity.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceDeclaredCapacityInput['resourceDeclaredCapacity']) => + getClient() + .resourceDeclaredCapacity.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceDeclaredCapacityKeys.lists() + queryKey: resourceDeclaredCapacityKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceDefinitionMutation.ts index 3d4c894d5f..807b41772c 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceDefinitionMutation.ts @@ -4,62 +4,88 @@ * 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 { resourceDefinitionKeys } from "../query-keys"; -import { resourceDefinitionMutationKeys } from "../mutation-keys"; -import type { ResourceDefinitionSelect, ResourceDefinitionWithRelations, CreateResourceDefinitionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceDefinitionSelect, ResourceDefinitionWithRelations, CreateResourceDefinitionInput } from "../../orm/input-types"; +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 { resourceDefinitionKeys } from '../query-keys'; +import { resourceDefinitionMutationKeys } from '../mutation-keys'; +import type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, + CreateResourceDefinitionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, + CreateResourceDefinitionInput, +} from '../../orm/input-types'; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceDefinitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceDefinitionMutation(params: { - selection: ({ - fields: S & ResourceDefinitionSelect; - } & HookStrictSelect, ResourceDefinitionSelect>); -} & Omit; - }; -}, Error, CreateResourceDefinitionInput["resourceDefinition"]>, "mutationFn">): UseMutationResult<{ - createResourceDefinition: { - resourceDefinition: InferSelectResult; - }; -}, Error, CreateResourceDefinitionInput["resourceDefinition"]>; -export function useCreateResourceDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceDefinitionMutation( + params: { + selection: { + fields: S & ResourceDefinitionSelect; + } & HookStrictSelect, ResourceDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + createResourceDefinition: { + resourceDefinition: InferSelectResult; + }; + }, + Error, + CreateResourceDefinitionInput['resourceDefinition'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceDefinition: { + resourceDefinition: InferSelectResult; + }; + }, + Error, + CreateResourceDefinitionInput['resourceDefinition'] +>; +export function useCreateResourceDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceDefinitionMutationKeys.create(), - mutationFn: (data: CreateResourceDefinitionInput["resourceDefinition"]) => getClient().resourceDefinition.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceDefinitionInput['resourceDefinition']) => + getClient() + .resourceDefinition.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceDefinitionKeys.lists() + queryKey: resourceDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceEventMutation.ts index 57faadc60e..8a347cfc3e 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceEventMutation.ts @@ -4,62 +4,85 @@ * 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 { resourceEventKeys } from "../query-keys"; -import { resourceEventMutationKeys } from "../mutation-keys"; -import type { ResourceEventSelect, ResourceEventWithRelations, CreateResourceEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceEventSelect, ResourceEventWithRelations, CreateResourceEventInput } from "../../orm/input-types"; +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 { resourceEventKeys } from '../query-keys'; +import { resourceEventMutationKeys } from '../mutation-keys'; +import type { + ResourceEventSelect, + ResourceEventWithRelations, + CreateResourceEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceEventSelect, + ResourceEventWithRelations, + CreateResourceEventInput, +} from '../../orm/input-types'; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceEventMutation(params: { - selection: ({ - fields: S & ResourceEventSelect; - } & HookStrictSelect, ResourceEventSelect>); -} & Omit; - }; -}, Error, CreateResourceEventInput["resourceEvent"]>, "mutationFn">): UseMutationResult<{ - createResourceEvent: { - resourceEvent: InferSelectResult; - }; -}, Error, CreateResourceEventInput["resourceEvent"]>; -export function useCreateResourceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceEventMutation( + params: { + selection: { + fields: S & ResourceEventSelect; + } & HookStrictSelect, ResourceEventSelect>; + } & Omit< + UseMutationOptions< + { + createResourceEvent: { + resourceEvent: InferSelectResult; + }; + }, + Error, + CreateResourceEventInput['resourceEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceEvent: { + resourceEvent: InferSelectResult; + }; + }, + Error, + CreateResourceEventInput['resourceEvent'] +>; +export function useCreateResourceEventMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceEventMutationKeys.create(), - mutationFn: (data: CreateResourceEventInput["resourceEvent"]) => getClient().resourceEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceEventInput['resourceEvent']) => + getClient() + .resourceEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceEventKeys.lists() + queryKey: resourceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceInstallationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceInstallationMutation.ts index c0cb2fd5aa..2426925b50 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceInstallationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceInstallationMutation.ts @@ -4,62 +4,88 @@ * 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 { resourceInstallationKeys } from "../query-keys"; -import { resourceInstallationMutationKeys } from "../mutation-keys"; -import type { ResourceInstallationSelect, ResourceInstallationWithRelations, CreateResourceInstallationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationSelect, ResourceInstallationWithRelations, CreateResourceInstallationInput } from "../../orm/input-types"; +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 { resourceInstallationKeys } from '../query-keys'; +import { resourceInstallationMutationKeys } from '../mutation-keys'; +import type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, + CreateResourceInstallationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, + CreateResourceInstallationInput, +} from '../../orm/input-types'; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceInstallationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceInstallationMutation(params: { - selection: ({ - fields: S & ResourceInstallationSelect; - } & HookStrictSelect, ResourceInstallationSelect>); -} & Omit; - }; -}, Error, CreateResourceInstallationInput["resourceInstallation"]>, "mutationFn">): UseMutationResult<{ - createResourceInstallation: { - resourceInstallation: InferSelectResult; - }; -}, Error, CreateResourceInstallationInput["resourceInstallation"]>; -export function useCreateResourceInstallationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceInstallationMutation( + params: { + selection: { + fields: S & ResourceInstallationSelect; + } & HookStrictSelect, ResourceInstallationSelect>; + } & Omit< + UseMutationOptions< + { + createResourceInstallation: { + resourceInstallation: InferSelectResult; + }; + }, + Error, + CreateResourceInstallationInput['resourceInstallation'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceInstallation: { + resourceInstallation: InferSelectResult; + }; + }, + Error, + CreateResourceInstallationInput['resourceInstallation'] +>; +export function useCreateResourceInstallationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceInstallationMutationKeys.create(), - mutationFn: (data: CreateResourceInstallationInput["resourceInstallation"]) => getClient().resourceInstallation.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceInstallationInput['resourceInstallation']) => + getClient() + .resourceInstallation.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceInstallationKeys.lists() + queryKey: resourceInstallationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceMutation.ts index cd74eda8e4..d545e49d7e 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceMutation.ts @@ -4,62 +4,85 @@ * 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 { resourceKeys } from "../query-keys"; -import { resourceMutationKeys } from "../mutation-keys"; -import type { ResourceSelect, ResourceWithRelations, CreateResourceInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceSelect, ResourceWithRelations, CreateResourceInput } from "../../orm/input-types"; +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 { resourceKeys } from '../query-keys'; +import { resourceMutationKeys } from '../mutation-keys'; +import type { + ResourceSelect, + ResourceWithRelations, + CreateResourceInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceSelect, + ResourceWithRelations, + CreateResourceInput, +} from '../../orm/input-types'; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceMutation(params: { - selection: ({ - fields: S & ResourceSelect; - } & HookStrictSelect, ResourceSelect>); -} & Omit; - }; -}, Error, CreateResourceInput["resource"]>, "mutationFn">): UseMutationResult<{ - createResource: { - resource: InferSelectResult; - }; -}, Error, CreateResourceInput["resource"]>; -export function useCreateResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceMutation( + params: { + selection: { + fields: S & ResourceSelect; + } & HookStrictSelect, ResourceSelect>; + } & Omit< + UseMutationOptions< + { + createResource: { + resource: InferSelectResult; + }; + }, + Error, + CreateResourceInput['resource'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResource: { + resource: InferSelectResult; + }; + }, + Error, + CreateResourceInput['resource'] +>; +export function useCreateResourceMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceMutationKeys.create(), - mutationFn: (data: CreateResourceInput["resource"]) => getClient().resource.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceInput['resource']) => + getClient() + .resource.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceKeys.lists() + queryKey: resourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceStatusCheckMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceStatusCheckMutation.ts index 333ff27772..909f0e4300 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceStatusCheckMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceStatusCheckMutation.ts @@ -4,62 +4,88 @@ * 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 { resourceStatusCheckKeys } from "../query-keys"; -import { resourceStatusCheckMutationKeys } from "../mutation-keys"; -import type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations, CreateResourceStatusCheckInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations, CreateResourceStatusCheckInput } from "../../orm/input-types"; +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 { resourceStatusCheckKeys } from '../query-keys'; +import { resourceStatusCheckMutationKeys } from '../mutation-keys'; +import type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, + CreateResourceStatusCheckInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, + CreateResourceStatusCheckInput, +} from '../../orm/input-types'; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceStatusCheckMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceStatusCheckMutation(params: { - selection: ({ - fields: S & ResourceStatusCheckSelect; - } & HookStrictSelect, ResourceStatusCheckSelect>); -} & Omit; - }; -}, Error, CreateResourceStatusCheckInput["resourceStatusCheck"]>, "mutationFn">): UseMutationResult<{ - createResourceStatusCheck: { - resourceStatusCheck: InferSelectResult; - }; -}, Error, CreateResourceStatusCheckInput["resourceStatusCheck"]>; -export function useCreateResourceStatusCheckMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceStatusCheckMutation( + params: { + selection: { + fields: S & ResourceStatusCheckSelect; + } & HookStrictSelect, ResourceStatusCheckSelect>; + } & Omit< + UseMutationOptions< + { + createResourceStatusCheck: { + resourceStatusCheck: InferSelectResult; + }; + }, + Error, + CreateResourceStatusCheckInput['resourceStatusCheck'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceStatusCheck: { + resourceStatusCheck: InferSelectResult; + }; + }, + Error, + CreateResourceStatusCheckInput['resourceStatusCheck'] +>; +export function useCreateResourceStatusCheckMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceStatusCheckMutationKeys.create(), - mutationFn: (data: CreateResourceStatusCheckInput["resourceStatusCheck"]) => getClient().resourceStatusCheck.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceStatusCheckInput['resourceStatusCheck']) => + getClient() + .resourceStatusCheck.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceStatusCheckKeys.lists() + queryKey: resourceStatusCheckKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUsageLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUsageLogMutation.ts index ebfcac3af3..cb6d12ff76 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUsageLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUsageLogMutation.ts @@ -4,62 +4,88 @@ * 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 { resourceUsageLogKeys } from "../query-keys"; -import { resourceUsageLogMutationKeys } from "../mutation-keys"; -import type { ResourceUsageLogSelect, ResourceUsageLogWithRelations, CreateResourceUsageLogInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageLogSelect, ResourceUsageLogWithRelations, CreateResourceUsageLogInput } from "../../orm/input-types"; +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 { resourceUsageLogKeys } from '../query-keys'; +import { resourceUsageLogMutationKeys } from '../mutation-keys'; +import type { + ResourceUsageLogSelect, + ResourceUsageLogWithRelations, + CreateResourceUsageLogInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceUsageLogSelect, + ResourceUsageLogWithRelations, + CreateResourceUsageLogInput, +} from '../../orm/input-types'; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceUsageLogMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceUsageLogMutation(params: { - selection: ({ - fields: S & ResourceUsageLogSelect; - } & HookStrictSelect, ResourceUsageLogSelect>); -} & Omit; - }; -}, Error, CreateResourceUsageLogInput["resourceUsageLog"]>, "mutationFn">): UseMutationResult<{ - createResourceUsageLog: { - resourceUsageLog: InferSelectResult; - }; -}, Error, CreateResourceUsageLogInput["resourceUsageLog"]>; -export function useCreateResourceUsageLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceUsageLogMutation( + params: { + selection: { + fields: S & ResourceUsageLogSelect; + } & HookStrictSelect, ResourceUsageLogSelect>; + } & Omit< + UseMutationOptions< + { + createResourceUsageLog: { + resourceUsageLog: InferSelectResult; + }; + }, + Error, + CreateResourceUsageLogInput['resourceUsageLog'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceUsageLog: { + resourceUsageLog: InferSelectResult; + }; + }, + Error, + CreateResourceUsageLogInput['resourceUsageLog'] +>; +export function useCreateResourceUsageLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceUsageLogMutationKeys.create(), - mutationFn: (data: CreateResourceUsageLogInput["resourceUsageLog"]) => getClient().resourceUsageLog.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceUsageLogInput['resourceUsageLog']) => + getClient() + .resourceUsageLog.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceUsageLogKeys.lists() + queryKey: resourceUsageLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUsageSummaryMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUsageSummaryMutation.ts index e5a6b51cbc..670f37b468 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUsageSummaryMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUsageSummaryMutation.ts @@ -4,62 +4,88 @@ * 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 { resourceUsageSummaryKeys } from "../query-keys"; -import { resourceUsageSummaryMutationKeys } from "../mutation-keys"; -import type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations, CreateResourceUsageSummaryInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations, CreateResourceUsageSummaryInput } from "../../orm/input-types"; +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 { resourceUsageSummaryKeys } from '../query-keys'; +import { resourceUsageSummaryMutationKeys } from '../mutation-keys'; +import type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, + CreateResourceUsageSummaryInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, + CreateResourceUsageSummaryInput, +} from '../../orm/input-types'; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceUsageSummaryMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceUsageSummaryMutation(params: { - selection: ({ - fields: S & ResourceUsageSummarySelect; - } & HookStrictSelect, ResourceUsageSummarySelect>); -} & Omit; - }; -}, Error, CreateResourceUsageSummaryInput["resourceUsageSummary"]>, "mutationFn">): UseMutationResult<{ - createResourceUsageSummary: { - resourceUsageSummary: InferSelectResult; - }; -}, Error, CreateResourceUsageSummaryInput["resourceUsageSummary"]>; -export function useCreateResourceUsageSummaryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceUsageSummaryMutation( + params: { + selection: { + fields: S & ResourceUsageSummarySelect; + } & HookStrictSelect, ResourceUsageSummarySelect>; + } & Omit< + UseMutationOptions< + { + createResourceUsageSummary: { + resourceUsageSummary: InferSelectResult; + }; + }, + Error, + CreateResourceUsageSummaryInput['resourceUsageSummary'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceUsageSummary: { + resourceUsageSummary: InferSelectResult; + }; + }, + Error, + CreateResourceUsageSummaryInput['resourceUsageSummary'] +>; +export function useCreateResourceUsageSummaryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceUsageSummaryMutationKeys.create(), - mutationFn: (data: CreateResourceUsageSummaryInput["resourceUsageSummary"]) => getClient().resourceUsageSummary.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceUsageSummaryInput['resourceUsageSummary']) => + getClient() + .resourceUsageSummary.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceUsageSummaryKeys.lists() + queryKey: resourceUsageSummaryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUtilizationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUtilizationMutation.ts index 680680814a..05250fd177 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUtilizationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourceUtilizationMutation.ts @@ -4,62 +4,88 @@ * 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 { resourceUtilizationKeys } from "../query-keys"; -import { resourceUtilizationMutationKeys } from "../mutation-keys"; -import type { ResourceUtilizationSelect, ResourceUtilizationWithRelations, CreateResourceUtilizationInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUtilizationSelect, ResourceUtilizationWithRelations, CreateResourceUtilizationInput } from "../../orm/input-types"; +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 { resourceUtilizationKeys } from '../query-keys'; +import { resourceUtilizationMutationKeys } from '../mutation-keys'; +import type { + ResourceUtilizationSelect, + ResourceUtilizationWithRelations, + CreateResourceUtilizationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceUtilizationSelect, + ResourceUtilizationWithRelations, + CreateResourceUtilizationInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ResourceUtilization - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceUtilizationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceUtilizationMutation(params: { - selection: ({ - fields: S & ResourceUtilizationSelect; - } & HookStrictSelect, ResourceUtilizationSelect>); -} & Omit; - }; -}, Error, CreateResourceUtilizationInput["resourceUtilization"]>, "mutationFn">): UseMutationResult<{ - createResourceUtilization: { - resourceUtilization: InferSelectResult; - }; -}, Error, CreateResourceUtilizationInput["resourceUtilization"]>; -export function useCreateResourceUtilizationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceUtilizationMutation( + params: { + selection: { + fields: S & ResourceUtilizationSelect; + } & HookStrictSelect, ResourceUtilizationSelect>; + } & Omit< + UseMutationOptions< + { + createResourceUtilization: { + resourceUtilization: InferSelectResult; + }; + }, + Error, + CreateResourceUtilizationInput['resourceUtilization'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceUtilization: { + resourceUtilization: InferSelectResult; + }; + }, + Error, + CreateResourceUtilizationInput['resourceUtilization'] +>; +export function useCreateResourceUtilizationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceUtilizationMutationKeys.create(), - mutationFn: (data: CreateResourceUtilizationInput["resourceUtilization"]) => getClient().resourceUtilization.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceUtilizationInput['resourceUtilization']) => + getClient() + .resourceUtilization.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceUtilizationKeys.lists() + queryKey: resourceUtilizationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesHealthMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesHealthMutation.ts index 98e37dca44..9ffeb3b510 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesHealthMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesHealthMutation.ts @@ -4,62 +4,88 @@ * 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 { resourcesHealthKeys } from "../query-keys"; -import { resourcesHealthMutationKeys } from "../mutation-keys"; -import type { ResourcesHealthSelect, ResourcesHealthWithRelations, CreateResourcesHealthInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourcesHealthSelect, ResourcesHealthWithRelations, CreateResourcesHealthInput } from "../../orm/input-types"; +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 { resourcesHealthKeys } from '../query-keys'; +import { resourcesHealthMutationKeys } from '../mutation-keys'; +import type { + ResourcesHealthSelect, + ResourcesHealthWithRelations, + CreateResourcesHealthInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourcesHealthSelect, + ResourcesHealthWithRelations, + CreateResourcesHealthInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ResourcesHealth - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourcesHealthMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourcesHealthMutation(params: { - selection: ({ - fields: S & ResourcesHealthSelect; - } & HookStrictSelect, ResourcesHealthSelect>); -} & Omit; - }; -}, Error, CreateResourcesHealthInput["resourcesHealth"]>, "mutationFn">): UseMutationResult<{ - createResourcesHealth: { - resourcesHealth: InferSelectResult; - }; -}, Error, CreateResourcesHealthInput["resourcesHealth"]>; -export function useCreateResourcesHealthMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourcesHealthMutation( + params: { + selection: { + fields: S & ResourcesHealthSelect; + } & HookStrictSelect, ResourcesHealthSelect>; + } & Omit< + UseMutationOptions< + { + createResourcesHealth: { + resourcesHealth: InferSelectResult; + }; + }, + Error, + CreateResourcesHealthInput['resourcesHealth'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourcesHealth: { + resourcesHealth: InferSelectResult; + }; + }, + Error, + CreateResourcesHealthInput['resourcesHealth'] +>; +export function useCreateResourcesHealthMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourcesHealthMutationKeys.create(), - mutationFn: (data: CreateResourcesHealthInput["resourcesHealth"]) => getClient().resourcesHealth.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourcesHealthInput['resourcesHealth']) => + getClient() + .resourcesHealth.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourcesHealthKeys.lists() + queryKey: resourcesHealthKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesRequirementsStateMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesRequirementsStateMutation.ts index 5f497d2560..0f2461e6a4 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesRequirementsStateMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesRequirementsStateMutation.ts @@ -4,62 +4,94 @@ * 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 { resourcesRequirementsStateKeys } from "../query-keys"; -import { resourcesRequirementsStateMutationKeys } from "../mutation-keys"; -import type { ResourcesRequirementsStateSelect, ResourcesRequirementsStateWithRelations, CreateResourcesRequirementsStateInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourcesRequirementsStateSelect, ResourcesRequirementsStateWithRelations, CreateResourcesRequirementsStateInput } from "../../orm/input-types"; +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 { resourcesRequirementsStateKeys } from '../query-keys'; +import { resourcesRequirementsStateMutationKeys } from '../mutation-keys'; +import type { + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateWithRelations, + CreateResourcesRequirementsStateInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateWithRelations, + CreateResourcesRequirementsStateInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ResourcesRequirementsState - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourcesRequirementsStateMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourcesRequirementsStateMutation(params: { - selection: ({ - fields: S & ResourcesRequirementsStateSelect; - } & HookStrictSelect, ResourcesRequirementsStateSelect>); -} & Omit; - }; -}, Error, CreateResourcesRequirementsStateInput["resourcesRequirementsState"]>, "mutationFn">): UseMutationResult<{ - createResourcesRequirementsState: { - resourcesRequirementsState: InferSelectResult; - }; -}, Error, CreateResourcesRequirementsStateInput["resourcesRequirementsState"]>; -export function useCreateResourcesRequirementsStateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourcesRequirementsStateMutation< + S extends ResourcesRequirementsStateSelect, +>( + params: { + selection: { + fields: S & ResourcesRequirementsStateSelect; + } & HookStrictSelect, ResourcesRequirementsStateSelect>; + } & Omit< + UseMutationOptions< + { + createResourcesRequirementsState: { + resourcesRequirementsState: InferSelectResult; + }; + }, + Error, + CreateResourcesRequirementsStateInput['resourcesRequirementsState'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourcesRequirementsState: { + resourcesRequirementsState: InferSelectResult; + }; + }, + Error, + CreateResourcesRequirementsStateInput['resourcesRequirementsState'] +>; +export function useCreateResourcesRequirementsStateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateResourcesRequirementsStateInput['resourcesRequirementsState'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourcesRequirementsStateMutationKeys.create(), - mutationFn: (data: CreateResourcesRequirementsStateInput["resourcesRequirementsState"]) => getClient().resourcesRequirementsState.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourcesRequirementsStateInput['resourcesRequirementsState']) => + getClient() + .resourcesRequirementsState.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourcesRequirementsStateKeys.lists() + queryKey: resourcesRequirementsStateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesResolvedRequirementMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesResolvedRequirementMutation.ts index 5b04620372..0e6d9c55a7 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesResolvedRequirementMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateResourcesResolvedRequirementMutation.ts @@ -4,62 +4,97 @@ * 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 { resourcesResolvedRequirementKeys } from "../query-keys"; -import { resourcesResolvedRequirementMutationKeys } from "../mutation-keys"; -import type { ResourcesResolvedRequirementSelect, ResourcesResolvedRequirementWithRelations, CreateResourcesResolvedRequirementInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourcesResolvedRequirementSelect, ResourcesResolvedRequirementWithRelations, CreateResourcesResolvedRequirementInput } from "../../orm/input-types"; +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 { resourcesResolvedRequirementKeys } from '../query-keys'; +import { resourcesResolvedRequirementMutationKeys } from '../mutation-keys'; +import type { + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementWithRelations, + CreateResourcesResolvedRequirementInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementWithRelations, + CreateResourcesResolvedRequirementInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ResourcesResolvedRequirement - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourcesResolvedRequirementMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourcesResolvedRequirementMutation(params: { - selection: ({ - fields: S & ResourcesResolvedRequirementSelect; - } & HookStrictSelect, ResourcesResolvedRequirementSelect>); -} & Omit; - }; -}, Error, CreateResourcesResolvedRequirementInput["resourcesResolvedRequirement"]>, "mutationFn">): UseMutationResult<{ - createResourcesResolvedRequirement: { - resourcesResolvedRequirement: InferSelectResult; - }; -}, Error, CreateResourcesResolvedRequirementInput["resourcesResolvedRequirement"]>; -export function useCreateResourcesResolvedRequirementMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourcesResolvedRequirementMutation< + S extends ResourcesResolvedRequirementSelect, +>( + params: { + selection: { + fields: S & ResourcesResolvedRequirementSelect; + } & HookStrictSelect, ResourcesResolvedRequirementSelect>; + } & Omit< + UseMutationOptions< + { + createResourcesResolvedRequirement: { + resourcesResolvedRequirement: InferSelectResult< + ResourcesResolvedRequirementWithRelations, + S + >; + }; + }, + Error, + CreateResourcesResolvedRequirementInput['resourcesResolvedRequirement'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourcesResolvedRequirement: { + resourcesResolvedRequirement: InferSelectResult; + }; + }, + Error, + CreateResourcesResolvedRequirementInput['resourcesResolvedRequirement'] +>; +export function useCreateResourcesResolvedRequirementMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateResourcesResolvedRequirementInput['resourcesResolvedRequirement'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourcesResolvedRequirementMutationKeys.create(), - mutationFn: (data: CreateResourcesResolvedRequirementInput["resourcesResolvedRequirement"]) => getClient().resourcesResolvedRequirement.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourcesResolvedRequirementInput['resourcesResolvedRequirement']) => + getClient() + .resourcesResolvedRequirement.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourcesResolvedRequirementKeys.lists() + queryKey: resourcesResolvedRequirementKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateWebhookEndpointMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateWebhookEndpointMutation.ts index ed41c8e1f0..1f60b0306b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateWebhookEndpointMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateWebhookEndpointMutation.ts @@ -4,62 +4,88 @@ * 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 { webhookEndpointKeys } from "../query-keys"; -import { webhookEndpointMutationKeys } from "../mutation-keys"; -import type { WebhookEndpointSelect, WebhookEndpointWithRelations, CreateWebhookEndpointInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEndpointSelect, WebhookEndpointWithRelations, CreateWebhookEndpointInput } from "../../orm/input-types"; +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 { webhookEndpointKeys } from '../query-keys'; +import { webhookEndpointMutationKeys } from '../mutation-keys'; +import type { + WebhookEndpointSelect, + WebhookEndpointWithRelations, + CreateWebhookEndpointInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebhookEndpointSelect, + WebhookEndpointWithRelations, + CreateWebhookEndpointInput, +} from '../../orm/input-types'; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { mutate, isPending } = useCreateWebhookEndpointMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateWebhookEndpointMutation(params: { - selection: ({ - fields: S & WebhookEndpointSelect; - } & HookStrictSelect, WebhookEndpointSelect>); -} & Omit; - }; -}, Error, CreateWebhookEndpointInput["webhookEndpoint"]>, "mutationFn">): UseMutationResult<{ - createWebhookEndpoint: { - webhookEndpoint: InferSelectResult; - }; -}, Error, CreateWebhookEndpointInput["webhookEndpoint"]>; -export function useCreateWebhookEndpointMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateWebhookEndpointMutation( + params: { + selection: { + fields: S & WebhookEndpointSelect; + } & HookStrictSelect, WebhookEndpointSelect>; + } & Omit< + UseMutationOptions< + { + createWebhookEndpoint: { + webhookEndpoint: InferSelectResult; + }; + }, + Error, + CreateWebhookEndpointInput['webhookEndpoint'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createWebhookEndpoint: { + webhookEndpoint: InferSelectResult; + }; + }, + Error, + CreateWebhookEndpointInput['webhookEndpoint'] +>; +export function useCreateWebhookEndpointMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookEndpointMutationKeys.create(), - mutationFn: (data: CreateWebhookEndpointInput["webhookEndpoint"]) => getClient().webhookEndpoint.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateWebhookEndpointInput['webhookEndpoint']) => + getClient() + .webhookEndpoint.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: webhookEndpointKeys.lists() + queryKey: webhookEndpointKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateWebhookEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateWebhookEventMutation.ts index 94dfd072ee..bb0b45a760 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useCreateWebhookEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateWebhookEventMutation.ts @@ -4,62 +4,85 @@ * 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 { webhookEventKeys } from "../query-keys"; -import { webhookEventMutationKeys } from "../mutation-keys"; -import type { WebhookEventSelect, WebhookEventWithRelations, CreateWebhookEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEventSelect, WebhookEventWithRelations, CreateWebhookEventInput } from "../../orm/input-types"; +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 { webhookEventKeys } from '../query-keys'; +import { webhookEventMutationKeys } from '../mutation-keys'; +import type { + WebhookEventSelect, + WebhookEventWithRelations, + CreateWebhookEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebhookEventSelect, + WebhookEventWithRelations, + CreateWebhookEventInput, +} from '../../orm/input-types'; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { mutate, isPending } = useCreateWebhookEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateWebhookEventMutation(params: { - selection: ({ - fields: S & WebhookEventSelect; - } & HookStrictSelect, WebhookEventSelect>); -} & Omit; - }; -}, Error, CreateWebhookEventInput["webhookEvent"]>, "mutationFn">): UseMutationResult<{ - createWebhookEvent: { - webhookEvent: InferSelectResult; - }; -}, Error, CreateWebhookEventInput["webhookEvent"]>; -export function useCreateWebhookEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateWebhookEventMutation( + params: { + selection: { + fields: S & WebhookEventSelect; + } & HookStrictSelect, WebhookEventSelect>; + } & Omit< + UseMutationOptions< + { + createWebhookEvent: { + webhookEvent: InferSelectResult; + }; + }, + Error, + CreateWebhookEventInput['webhookEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createWebhookEvent: { + webhookEvent: InferSelectResult; + }; + }, + Error, + CreateWebhookEventInput['webhookEvent'] +>; +export function useCreateWebhookEventMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookEventMutationKeys.create(), - mutationFn: (data: CreateWebhookEventInput["webhookEvent"]) => getClient().webhookEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateWebhookEventInput['webhookEvent']) => + getClient() + .webhookEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: webhookEventKeys.lists() + queryKey: webhookEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteDbPresetMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteDbPresetMutation.ts index 9effbb9689..4408dd0b6f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteDbPresetMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteDbPresetMutation.ts @@ -4,77 +4,95 @@ * 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 { dbPresetKeys } from "../query-keys"; -import { dbPresetMutationKeys } from "../mutation-keys"; -import type { DbPresetSelect, DbPresetWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import { dbPresetMutationKeys } from '../mutation-keys'; +import type { DbPresetSelect, DbPresetWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPresetSelect, DbPresetWithRelations } from '../../orm/input-types'; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDbPresetMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDbPresetMutation(params: { - selection: ({ - fields: S & DbPresetSelect; - } & HookStrictSelect, DbPresetSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDbPreset: { - dbPreset: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDbPresetMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDbPresetMutation( + params: { + selection: { + fields: S & DbPresetSelect; + } & HookStrictSelect, DbPresetSelect>; + } & Omit< + UseMutationOptions< + { + deleteDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDbPresetMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().dbPreset.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .dbPreset.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: dbPresetKeys.detail(variables.id) + queryKey: dbPresetKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPresetKeys.lists() + queryKey: dbPresetKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionApiBindingMutation.ts index c8bddce589..3747959696 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionApiBindingMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionApiBindingMutation.ts @@ -4,77 +4,101 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionApiBindingKeys } from "../query-keys"; -import { functionApiBindingMutationKeys } from "../mutation-keys"; -import type { FunctionApiBindingSelect, FunctionApiBindingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionApiBindingSelect, FunctionApiBindingWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import { functionApiBindingMutationKeys } from '../mutation-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, +} from '../../orm/input-types'; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionApiBindingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionApiBindingMutation(params: { - selection: ({ - fields: S & FunctionApiBindingSelect; - } & HookStrictSelect, FunctionApiBindingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionApiBinding: { - functionApiBinding: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionApiBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionApiBindingMutation( + params: { + selection: { + fields: S & FunctionApiBindingSelect; + } & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionApiBindingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().functionApiBinding.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .functionApiBinding.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionApiBindingKeys.detail(variables.id) + queryKey: functionApiBindingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionApiBindingKeys.lists() + queryKey: functionApiBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDefinitionMutation.ts index be8482883e..ae239c2a10 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDefinitionMutation.ts @@ -4,77 +4,101 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDefinitionKeys } from "../query-keys"; -import { functionDefinitionMutationKeys } from "../mutation-keys"; -import type { FunctionDefinitionSelect, FunctionDefinitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDefinitionSelect, FunctionDefinitionWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import { functionDefinitionMutationKeys } from '../mutation-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, +} from '../../orm/input-types'; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionDefinitionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionDefinitionMutation(params: { - selection: ({ - fields: S & FunctionDefinitionSelect; - } & HookStrictSelect, FunctionDefinitionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionDefinition: { - functionDefinition: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionDefinitionMutation( + params: { + selection: { + fields: S & FunctionDefinitionSelect; + } & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDefinitionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().functionDefinition.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .functionDefinition.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionDefinitionKeys.detail(variables.id) + queryKey: functionDefinitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionDefinitionKeys.lists() + queryKey: functionDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentEventMutation.ts index 4f2fbcf9a2..a5577c17e0 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentEventMutation.ts @@ -4,83 +4,105 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentEventKeys } from "../query-keys"; -import { functionDeploymentEventMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import { functionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionDeploymentEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionDeploymentEventMutation(params: { - selection: ({ - fields: S & FunctionDeploymentEventSelect; - } & HookStrictSelect, FunctionDeploymentEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionDeploymentEvent: { - functionDeploymentEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteFunctionDeploymentEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionDeploymentEventMutation( + params: { + selection: { + fields: S & FunctionDeploymentEventSelect; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDeploymentEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().functionDeploymentEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionDeploymentEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionDeploymentEventKeys.detail(variables.id) + queryKey: functionDeploymentEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionDeploymentEventKeys.lists() + queryKey: functionDeploymentEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentMutation.ts index 9c67326377..24faf97f4b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentMutation.ts @@ -4,77 +4,101 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentKeys } from "../query-keys"; -import { functionDeploymentMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentSelect, FunctionDeploymentWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentSelect, FunctionDeploymentWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import { functionDeploymentMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, +} from '../../orm/input-types'; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionDeploymentMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionDeploymentMutation(params: { - selection: ({ - fields: S & FunctionDeploymentSelect; - } & HookStrictSelect, FunctionDeploymentSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionDeployment: { - functionDeployment: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionDeploymentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionDeploymentMutation( + params: { + selection: { + fields: S & FunctionDeploymentSelect; + } & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDeploymentMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().functionDeployment.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .functionDeployment.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionDeploymentKeys.detail(variables.id) + queryKey: functionDeploymentKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionDeploymentKeys.lists() + queryKey: functionDeploymentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionExecutionLogMutation.ts index 6196fc095e..2847f05358 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionExecutionLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionExecutionLogMutation.ts @@ -4,83 +4,105 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionExecutionLogKeys } from "../query-keys"; -import { functionExecutionLogMutationKeys } from "../mutation-keys"; -import type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import { functionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, +} from '../../orm/input-types'; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionExecutionLogMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionExecutionLogMutation(params: { - selection: ({ - fields: S & FunctionExecutionLogSelect; - } & HookStrictSelect, FunctionExecutionLogSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionExecutionLog: { - functionExecutionLog: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteFunctionExecutionLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionExecutionLogMutation( + params: { + selection: { + fields: S & FunctionExecutionLogSelect; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionExecutionLogMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().functionExecutionLog.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionExecutionLog.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionExecutionLogKeys.detail(variables.id) + queryKey: functionExecutionLogKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionExecutionLogKeys.lists() + queryKey: functionExecutionLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphCommitMutation.ts index c524101265..ffe6e976ba 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphCommitMutation.ts @@ -4,83 +4,105 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphCommitKeys } from "../query-keys"; -import { functionGraphCommitMutationKeys } from "../mutation-keys"; -import type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import { functionGraphCommitMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionGraphCommitMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionGraphCommitMutation(params: { - selection: ({ - fields: S & FunctionGraphCommitSelect; - } & HookStrictSelect, FunctionGraphCommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionGraphCommit: { - functionGraphCommit: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeleteFunctionGraphCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionGraphCommitMutation( + params: { + selection: { + fields: S & FunctionGraphCommitSelect; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeleteFunctionGraphCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphCommitMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().functionGraphCommit.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .functionGraphCommit.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionGraphCommitKeys.detail(variables.id) + queryKey: functionGraphCommitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphCommitKeys.lists() + queryKey: functionGraphCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionMutation.ts index 32a88668ef..976deb68f8 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionMutation.ts @@ -4,83 +4,105 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionKeys } from "../query-keys"; -import { functionGraphExecutionMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import { functionGraphExecutionMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, +} from '../../orm/input-types'; /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionGraphExecutionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionGraphExecutionMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionSelect; - } & HookStrictSelect, FunctionGraphExecutionSelect>); -} & Omit; - }; -}, Error, { - id: string; - startedAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionGraphExecution: { - functionGraphExecution: InferSelectResult; - }; -}, Error, { - id: string; - startedAt: string; -}>; -export function useDeleteFunctionGraphExecutionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionGraphExecutionMutation( + params: { + selection: { + fields: S & FunctionGraphExecutionSelect; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + { + id: string; + startedAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + { + id: string; + startedAt: string; + } +>; +export function useDeleteFunctionGraphExecutionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + startedAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphExecutionMutationKeys.all, - mutationFn: ({ - id, - startedAt - }: { - id: string; - startedAt: string; - }) => getClient().functionGraphExecution.delete({ - where: { - id, - startedAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, startedAt }: { id: string; startedAt: string }) => + getClient() + .functionGraphExecution.delete({ + where: { + id, + startedAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionGraphExecutionKeys.detail(variables.id) + queryKey: functionGraphExecutionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphExecutionKeys.lists() + queryKey: functionGraphExecutionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionNodeStateMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionNodeStateMutation.ts index bcbb337d9f..d1195ca049 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionNodeStateMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionNodeStateMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionNodeStateKeys } from "../query-keys"; -import { functionGraphExecutionNodeStateMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import { functionGraphExecutionNodeStateMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, +} from '../../orm/input-types'; /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionGraphExecutionNodeStateMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionGraphExecutionNodeStateMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionNodeStateSelect; - } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteFunctionGraphExecutionNodeStateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionGraphExecutionNodeStateMutation< + S extends FunctionGraphExecutionNodeStateSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionNodeStateSelect; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionGraphExecutionNodeStateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphExecutionNodeStateMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().functionGraphExecutionNodeState.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionGraphExecutionNodeState.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionGraphExecutionNodeStateKeys.detail(variables.id) + queryKey: functionGraphExecutionNodeStateKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.lists() + queryKey: functionGraphExecutionNodeStateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionOutputMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionOutputMutation.ts index 30e1ecf02e..83a99597d5 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionOutputMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionOutputMutation.ts @@ -4,83 +4,110 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionOutputKeys } from "../query-keys"; -import { functionGraphExecutionOutputMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import { functionGraphExecutionOutputMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, +} from '../../orm/input-types'; /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionGraphExecutionOutputMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionGraphExecutionOutputMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionOutputSelect; - } & HookStrictSelect, FunctionGraphExecutionOutputSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionGraphExecutionOutput: { - functionGraphExecutionOutput: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteFunctionGraphExecutionOutputMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionGraphExecutionOutputMutation< + S extends FunctionGraphExecutionOutputSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionOutputSelect; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionGraphExecutionOutputMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphExecutionOutputMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().functionGraphExecutionOutput.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionGraphExecutionOutput.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionGraphExecutionOutputKeys.detail(variables.id) + queryKey: functionGraphExecutionOutputKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphExecutionOutputKeys.lists() + queryKey: functionGraphExecutionOutputKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphMutation.ts index a92b76d59f..65c66edd38 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphMutation.ts @@ -4,77 +4,95 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphKeys } from "../query-keys"; -import { functionGraphMutationKeys } from "../mutation-keys"; -import type { FunctionGraphSelect, FunctionGraphWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphSelect, FunctionGraphWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import { functionGraphMutationKeys } from '../mutation-keys'; +import type { FunctionGraphSelect, FunctionGraphWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionGraphSelect, FunctionGraphWithRelations } from '../../orm/input-types'; /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionGraphMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionGraphMutation(params: { - selection: ({ - fields: S & FunctionGraphSelect; - } & HookStrictSelect, FunctionGraphSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionGraph: { - functionGraph: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionGraphMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionGraphMutation( + params: { + selection: { + fields: S & FunctionGraphSelect; + } & HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionGraphMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().functionGraph.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .functionGraph.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionGraphKeys.detail(variables.id) + queryKey: functionGraphKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphKeys.lists() + queryKey: functionGraphKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphObjectMutation.ts index 11a844377c..7814d06dcc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphObjectMutation.ts @@ -4,83 +4,105 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphObjectKeys } from "../query-keys"; -import { functionGraphObjectMutationKeys } from "../mutation-keys"; -import type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import { functionGraphObjectMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionGraphObjectMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionGraphObjectMutation(params: { - selection: ({ - fields: S & FunctionGraphObjectSelect; - } & HookStrictSelect, FunctionGraphObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionGraphObject: { - functionGraphObject: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeleteFunctionGraphObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionGraphObjectMutation( + params: { + selection: { + fields: S & FunctionGraphObjectSelect; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeleteFunctionGraphObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphObjectMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().functionGraphObject.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .functionGraphObject.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionGraphObjectKeys.detail(variables.id) + queryKey: functionGraphObjectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphObjectKeys.lists() + queryKey: functionGraphObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphRefMutation.ts index fca57a1f10..16aaadeb47 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphRefMutation.ts @@ -4,83 +4,99 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphRefKeys } from "../query-keys"; -import { functionGraphRefMutationKeys } from "../mutation-keys"; -import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import { functionGraphRefMutationKeys } from '../mutation-keys'; +import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionGraphRefMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionGraphRefMutation(params: { - selection: ({ - fields: S & FunctionGraphRefSelect; - } & HookStrictSelect, FunctionGraphRefSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionGraphRef: { - functionGraphRef: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeleteFunctionGraphRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionGraphRefMutation( + params: { + selection: { + fields: S & FunctionGraphRefSelect; + } & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeleteFunctionGraphRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphRefMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().functionGraphRef.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .functionGraphRef.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionGraphRefKeys.detail(variables.id) + queryKey: functionGraphRefKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphRefKeys.lists() + queryKey: functionGraphRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphStoreMutation.ts index 7ee67fab14..33467b80e7 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphStoreMutation.ts @@ -4,77 +4,101 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphStoreKeys } from "../query-keys"; -import { functionGraphStoreMutationKeys } from "../mutation-keys"; -import type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import { functionGraphStoreMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionGraphStoreMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionGraphStoreMutation(params: { - selection: ({ - fields: S & FunctionGraphStoreSelect; - } & HookStrictSelect, FunctionGraphStoreSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionGraphStore: { - functionGraphStore: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionGraphStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionGraphStoreMutation( + params: { + selection: { + fields: S & FunctionGraphStoreSelect; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionGraphStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphStoreMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().functionGraphStore.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .functionGraphStore.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionGraphStoreKeys.detail(variables.id) + queryKey: functionGraphStoreKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphStoreKeys.lists() + queryKey: functionGraphStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationAttemptMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationAttemptMutation.ts index aba37523f7..5c208946ca 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationAttemptMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationAttemptMutation.ts @@ -4,83 +4,107 @@ * 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 { functionInvocationAttemptKeys } from "../query-keys"; -import { functionInvocationAttemptMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations } from "../../orm/input-types"; +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 { functionInvocationAttemptKeys } from '../query-keys'; +import { functionInvocationAttemptMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, +} from '../../orm/input-types'; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionInvocationAttemptMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionInvocationAttemptMutation(params: { - selection: ({ - fields: S & FunctionInvocationAttemptSelect; - } & HookStrictSelect, FunctionInvocationAttemptSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionInvocationAttempt: { - functionInvocationAttempt: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteFunctionInvocationAttemptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionInvocationAttemptMutation< + S extends FunctionInvocationAttemptSelect, +>( + params: { + selection: { + fields: S & FunctionInvocationAttemptSelect; + } & HookStrictSelect, FunctionInvocationAttemptSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionInvocationAttempt: { + functionInvocationAttempt: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionInvocationAttempt: { + functionInvocationAttempt: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionInvocationAttemptMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionInvocationAttemptMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().functionInvocationAttempt.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionInvocationAttempt.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionInvocationAttemptKeys.detail(variables.id) + queryKey: functionInvocationAttemptKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionInvocationAttemptKeys.lists() + queryKey: functionInvocationAttemptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationMutation.ts index a8eff6eefe..37c5c38cdc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationMutation.ts @@ -4,83 +4,105 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionInvocationKeys } from "../query-keys"; -import { functionInvocationMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationSelect, FunctionInvocationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationSelect, FunctionInvocationWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import { functionInvocationMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, +} from '../../orm/input-types'; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionInvocationMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionInvocationMutation(params: { - selection: ({ - fields: S & FunctionInvocationSelect; - } & HookStrictSelect, FunctionInvocationSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionInvocation: { - functionInvocation: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteFunctionInvocationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionInvocationMutation( + params: { + selection: { + fields: S & FunctionInvocationSelect; + } & HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionInvocationMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().functionInvocation.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionInvocation.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionInvocationKeys.detail(variables.id) + queryKey: functionInvocationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionInvocationKeys.lists() + queryKey: functionInvocationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraCommitMutation.ts index 9681d68015..2898345e92 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraCommitMutation.ts @@ -4,83 +4,99 @@ * 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 { infraCommitKeys } from "../query-keys"; -import { infraCommitMutationKeys } from "../mutation-keys"; -import type { InfraCommitSelect, InfraCommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraCommitSelect, InfraCommitWithRelations } from "../../orm/input-types"; +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 { infraCommitKeys } from '../query-keys'; +import { infraCommitMutationKeys } from '../mutation-keys'; +import type { InfraCommitSelect, InfraCommitWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraCommitSelect, InfraCommitWithRelations } from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInfraCommitMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInfraCommitMutation(params: { - selection: ({ - fields: S & InfraCommitSelect; - } & HookStrictSelect, InfraCommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInfraCommit: { - infraCommit: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; -}>; -export function useDeleteInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInfraCommitMutation( + params: { + selection: { + fields: S & InfraCommitSelect; + } & HookStrictSelect, InfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + deleteInfraCommit: { + infraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInfraCommit: { + infraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraCommitMutationKeys.all, - mutationFn: ({ - id, - databaseId - }: { - id: string; - databaseId: string; - }) => getClient().infraCommit.delete({ - where: { - id, - databaseId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .infraCommit.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: infraCommitKeys.detail(variables.id) + queryKey: infraCommitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraCommitKeys.lists() + queryKey: infraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraObjectMutation.ts index d351b7bcf6..294ad31ff2 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraObjectMutation.ts @@ -4,83 +4,99 @@ * 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 { infraObjectKeys } from "../query-keys"; -import { infraObjectMutationKeys } from "../mutation-keys"; -import type { InfraObjectSelect, InfraObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraObjectSelect, InfraObjectWithRelations } from "../../orm/input-types"; +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 { infraObjectKeys } from '../query-keys'; +import { infraObjectMutationKeys } from '../mutation-keys'; +import type { InfraObjectSelect, InfraObjectWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraObjectSelect, InfraObjectWithRelations } from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInfraObjectMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInfraObjectMutation(params: { - selection: ({ - fields: S & InfraObjectSelect; - } & HookStrictSelect, InfraObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInfraObject: { - infraObject: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; -}>; -export function useDeleteInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInfraObjectMutation( + params: { + selection: { + fields: S & InfraObjectSelect; + } & HookStrictSelect, InfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + deleteInfraObject: { + infraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInfraObject: { + infraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraObjectMutationKeys.all, - mutationFn: ({ - id, - databaseId - }: { - id: string; - databaseId: string; - }) => getClient().infraObject.delete({ - where: { - id, - databaseId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .infraObject.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: infraObjectKeys.detail(variables.id) + queryKey: infraObjectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraObjectKeys.lists() + queryKey: infraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraRefMutation.ts index 0573644340..f8dace23bc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraRefMutation.ts @@ -4,83 +4,99 @@ * 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 { infraRefKeys } from "../query-keys"; -import { infraRefMutationKeys } from "../mutation-keys"; -import type { InfraRefSelect, InfraRefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraRefSelect, InfraRefWithRelations } from "../../orm/input-types"; +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 { infraRefKeys } from '../query-keys'; +import { infraRefMutationKeys } from '../mutation-keys'; +import type { InfraRefSelect, InfraRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraRefSelect, InfraRefWithRelations } from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInfraRefMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInfraRefMutation(params: { - selection: ({ - fields: S & InfraRefSelect; - } & HookStrictSelect, InfraRefSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInfraRef: { - infraRef: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; -}>; -export function useDeleteInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInfraRefMutation( + params: { + selection: { + fields: S & InfraRefSelect; + } & HookStrictSelect, InfraRefSelect>; + } & Omit< + UseMutationOptions< + { + deleteInfraRef: { + infraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInfraRef: { + infraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraRefMutationKeys.all, - mutationFn: ({ - id, - databaseId - }: { - id: string; - databaseId: string; - }) => getClient().infraRef.delete({ - where: { - id, - databaseId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .infraRef.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: infraRefKeys.detail(variables.id) + queryKey: infraRefKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraRefKeys.lists() + queryKey: infraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraStoreMutation.ts index 55b4b16fdd..e1c82fe7d6 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteInfraStoreMutation.ts @@ -4,77 +4,95 @@ * 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 { infraStoreKeys } from "../query-keys"; -import { infraStoreMutationKeys } from "../mutation-keys"; -import type { InfraStoreSelect, InfraStoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraStoreSelect, InfraStoreWithRelations } from "../../orm/input-types"; +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 { infraStoreKeys } from '../query-keys'; +import { infraStoreMutationKeys } from '../mutation-keys'; +import type { InfraStoreSelect, InfraStoreWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraStoreSelect, InfraStoreWithRelations } from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInfraStoreMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInfraStoreMutation(params: { - selection: ({ - fields: S & InfraStoreSelect; - } & HookStrictSelect, InfraStoreSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInfraStore: { - infraStore: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInfraStoreMutation( + params: { + selection: { + fields: S & InfraStoreSelect; + } & HookStrictSelect, InfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + deleteInfraStore: { + infraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInfraStore: { + infraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraStoreMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().infraStore.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .infraStore.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: infraStoreKeys.detail(variables.id) + queryKey: infraStoreKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraStoreKeys.lists() + queryKey: infraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteIntegrationProviderMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteIntegrationProviderMutation.ts index be44a2803f..a668dec0a5 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteIntegrationProviderMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteIntegrationProviderMutation.ts @@ -4,77 +4,101 @@ * 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 { integrationProviderKeys } from "../query-keys"; -import { integrationProviderMutationKeys } from "../mutation-keys"; -import type { IntegrationProviderSelect, IntegrationProviderWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProviderSelect, IntegrationProviderWithRelations } from "../../orm/input-types"; +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 { integrationProviderKeys } from '../query-keys'; +import { integrationProviderMutationKeys } from '../mutation-keys'; +import type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, +} from '../../orm/input-types'; /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteIntegrationProviderMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteIntegrationProviderMutation(params: { - selection: ({ - fields: S & IntegrationProviderSelect; - } & HookStrictSelect, IntegrationProviderSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteIntegrationProvider: { - integrationProvider: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteIntegrationProviderMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteIntegrationProviderMutation( + params: { + selection: { + fields: S & IntegrationProviderSelect; + } & HookStrictSelect, IntegrationProviderSelect>; + } & Omit< + UseMutationOptions< + { + deleteIntegrationProvider: { + integrationProvider: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteIntegrationProvider: { + integrationProvider: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteIntegrationProviderMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: integrationProviderMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().integrationProvider.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .integrationProvider.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: integrationProviderKeys.detail(variables.id) + queryKey: integrationProviderKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: integrationProviderKeys.lists() + queryKey: integrationProviderKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteNamespaceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteNamespaceEventMutation.ts index 6c6f82a508..e48ce652c4 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteNamespaceEventMutation.ts @@ -4,83 +4,99 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import { namespaceEventMutationKeys } from "../mutation-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import { namespaceEventMutationKeys } from '../mutation-keys'; +import type { NamespaceEventSelect, NamespaceEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceEventSelect, NamespaceEventWithRelations } from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteNamespaceEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteNamespaceEventMutation(params: { - selection: ({ - fields: S & NamespaceEventSelect; - } & HookStrictSelect, NamespaceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteNamespaceEvent: { - namespaceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteNamespaceEventMutation( + params: { + selection: { + fields: S & NamespaceEventSelect; + } & HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().namespaceEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .namespaceEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: namespaceEventKeys.detail(variables.id) + queryKey: namespaceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.lists() + queryKey: namespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteNamespaceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteNamespaceMutation.ts index c5c1ba874a..1c6e408df6 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteNamespaceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteNamespaceMutation.ts @@ -4,77 +4,95 @@ * 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 { namespaceKeys } from "../query-keys"; -import { namespaceMutationKeys } from "../mutation-keys"; -import type { NamespaceSelect, NamespaceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import { namespaceMutationKeys } from '../mutation-keys'; +import type { NamespaceSelect, NamespaceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceSelect, NamespaceWithRelations } from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteNamespaceMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteNamespaceMutation(params: { - selection: ({ - fields: S & NamespaceSelect; - } & HookStrictSelect, NamespaceSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteNamespace: { - namespace: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteNamespaceMutation( + params: { + selection: { + fields: S & NamespaceSelect; + } & HookStrictSelect, NamespaceSelect>; + } & Omit< + UseMutationOptions< + { + deleteNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().namespace.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .namespace.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: namespaceKeys.detail(variables.id) + queryKey: namespaceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceKeys.lists() + queryKey: namespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionApiBindingMutation.ts index 4442926dbd..9d916cf9e3 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionApiBindingMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionApiBindingMutation.ts @@ -4,77 +4,103 @@ * 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 { platformFunctionApiBindingKeys } from "../query-keys"; -import { platformFunctionApiBindingMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations } from "../../orm/input-types"; +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 { platformFunctionApiBindingKeys } from '../query-keys'; +import { platformFunctionApiBindingMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, +} from '../../orm/input-types'; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformFunctionApiBindingMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformFunctionApiBindingMutation(params: { - selection: ({ - fields: S & PlatformFunctionApiBindingSelect; - } & HookStrictSelect, PlatformFunctionApiBindingSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformFunctionApiBinding: { - platformFunctionApiBinding: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformFunctionApiBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformFunctionApiBindingMutation< + S extends PlatformFunctionApiBindingSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionApiBindingSelect; + } & HookStrictSelect, PlatformFunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformFunctionApiBinding: { + platformFunctionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformFunctionApiBinding: { + platformFunctionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionApiBindingMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformFunctionApiBinding.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformFunctionApiBinding.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformFunctionApiBindingKeys.detail(variables.id) + queryKey: platformFunctionApiBindingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionApiBindingKeys.lists() + queryKey: platformFunctionApiBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDefinitionMutation.ts index c3a1fc335c..7dc79a9a34 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDefinitionMutation.ts @@ -4,77 +4,103 @@ * 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 { platformFunctionDefinitionKeys } from "../query-keys"; -import { platformFunctionDefinitionMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations } from "../../orm/input-types"; +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 { platformFunctionDefinitionKeys } from '../query-keys'; +import { platformFunctionDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, +} from '../../orm/input-types'; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformFunctionDefinitionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformFunctionDefinitionMutation(params: { - selection: ({ - fields: S & PlatformFunctionDefinitionSelect; - } & HookStrictSelect, PlatformFunctionDefinitionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformFunctionDefinition: { - platformFunctionDefinition: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformFunctionDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformFunctionDefinitionMutation< + S extends PlatformFunctionDefinitionSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDefinitionSelect; + } & HookStrictSelect, PlatformFunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionDefinitionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformFunctionDefinition.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformFunctionDefinition.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformFunctionDefinitionKeys.detail(variables.id) + queryKey: platformFunctionDefinitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionDefinitionKeys.lists() + queryKey: platformFunctionDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDeploymentEventMutation.ts index 8436bd50a2..807139e8b0 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDeploymentEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDeploymentEventMutation.ts @@ -4,83 +4,113 @@ * 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 { platformFunctionDeploymentEventKeys } from "../query-keys"; -import { platformFunctionDeploymentEventMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations } from "../../orm/input-types"; +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 { platformFunctionDeploymentEventKeys } from '../query-keys'; +import { platformFunctionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformFunctionDeploymentEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformFunctionDeploymentEventMutation(params: { - selection: ({ - fields: S & PlatformFunctionDeploymentEventSelect; - } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeletePlatformFunctionDeploymentEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformFunctionDeploymentEventMutation< + S extends PlatformFunctionDeploymentEventSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDeploymentEventSelect; + } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformFunctionDeploymentEvent: { + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformFunctionDeploymentEvent: { + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeletePlatformFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionDeploymentEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().platformFunctionDeploymentEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .platformFunctionDeploymentEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformFunctionDeploymentEventKeys.detail(variables.id) + queryKey: platformFunctionDeploymentEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentEventKeys.lists() + queryKey: platformFunctionDeploymentEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDeploymentMutation.ts index ae4218b1d6..fd8e2fc170 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDeploymentMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionDeploymentMutation.ts @@ -4,77 +4,103 @@ * 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 { platformFunctionDeploymentKeys } from "../query-keys"; -import { platformFunctionDeploymentMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations } from "../../orm/input-types"; +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 { platformFunctionDeploymentKeys } from '../query-keys'; +import { platformFunctionDeploymentMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, +} from '../../orm/input-types'; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformFunctionDeploymentMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformFunctionDeploymentMutation(params: { - selection: ({ - fields: S & PlatformFunctionDeploymentSelect; - } & HookStrictSelect, PlatformFunctionDeploymentSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformFunctionDeployment: { - platformFunctionDeployment: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformFunctionDeploymentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformFunctionDeploymentMutation< + S extends PlatformFunctionDeploymentSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDeploymentSelect; + } & HookStrictSelect, PlatformFunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformFunctionDeployment: { + platformFunctionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformFunctionDeployment: { + platformFunctionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionDeploymentMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformFunctionDeployment.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformFunctionDeployment.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformFunctionDeploymentKeys.detail(variables.id) + queryKey: platformFunctionDeploymentKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentKeys.lists() + queryKey: platformFunctionDeploymentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionExecutionLogMutation.ts index 1a3a325028..c39000ca02 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionExecutionLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionExecutionLogMutation.ts @@ -4,83 +4,110 @@ * 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 { platformFunctionExecutionLogKeys } from "../query-keys"; -import { platformFunctionExecutionLogMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations } from "../../orm/input-types"; +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 { platformFunctionExecutionLogKeys } from '../query-keys'; +import { platformFunctionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, +} from '../../orm/input-types'; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformFunctionExecutionLogMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformFunctionExecutionLogMutation(params: { - selection: ({ - fields: S & PlatformFunctionExecutionLogSelect; - } & HookStrictSelect, PlatformFunctionExecutionLogSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformFunctionExecutionLog: { - platformFunctionExecutionLog: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeletePlatformFunctionExecutionLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformFunctionExecutionLogMutation< + S extends PlatformFunctionExecutionLogSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionExecutionLogSelect; + } & HookStrictSelect, PlatformFunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeletePlatformFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionExecutionLogMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().platformFunctionExecutionLog.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .platformFunctionExecutionLog.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformFunctionExecutionLogKeys.detail(variables.id) + queryKey: platformFunctionExecutionLogKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionExecutionLogKeys.lists() + queryKey: platformFunctionExecutionLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionInvocationAttemptMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionInvocationAttemptMutation.ts index d5e8d1dc42..048e2674ad 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionInvocationAttemptMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionInvocationAttemptMutation.ts @@ -4,83 +4,113 @@ * 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 { platformFunctionInvocationAttemptKeys } from "../query-keys"; -import { platformFunctionInvocationAttemptMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations } from "../../orm/input-types"; +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 { platformFunctionInvocationAttemptKeys } from '../query-keys'; +import { platformFunctionInvocationAttemptMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, +} from '../../orm/input-types'; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformFunctionInvocationAttemptMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformFunctionInvocationAttemptMutation(params: { - selection: ({ - fields: S & PlatformFunctionInvocationAttemptSelect; - } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeletePlatformFunctionInvocationAttemptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformFunctionInvocationAttemptMutation< + S extends PlatformFunctionInvocationAttemptSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionInvocationAttemptSelect; + } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformFunctionInvocationAttempt: { + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformFunctionInvocationAttempt: { + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeletePlatformFunctionInvocationAttemptMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionInvocationAttemptMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().platformFunctionInvocationAttempt.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .platformFunctionInvocationAttempt.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformFunctionInvocationAttemptKeys.detail(variables.id) + queryKey: platformFunctionInvocationAttemptKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationAttemptKeys.lists() + queryKey: platformFunctionInvocationAttemptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionInvocationMutation.ts index 24694a0b5f..042268d308 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionInvocationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformFunctionInvocationMutation.ts @@ -4,83 +4,107 @@ * 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 { platformFunctionInvocationKeys } from "../query-keys"; -import { platformFunctionInvocationMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations } from "../../orm/input-types"; +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 { platformFunctionInvocationKeys } from '../query-keys'; +import { platformFunctionInvocationMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, +} from '../../orm/input-types'; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformFunctionInvocationMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformFunctionInvocationMutation(params: { - selection: ({ - fields: S & PlatformFunctionInvocationSelect; - } & HookStrictSelect, PlatformFunctionInvocationSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformFunctionInvocation: { - platformFunctionInvocation: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeletePlatformFunctionInvocationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformFunctionInvocationMutation< + S extends PlatformFunctionInvocationSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionInvocationSelect; + } & HookStrictSelect, PlatformFunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeletePlatformFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionInvocationMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().platformFunctionInvocation.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .platformFunctionInvocation.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformFunctionInvocationKeys.detail(variables.id) + queryKey: platformFunctionInvocationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationKeys.lists() + queryKey: platformFunctionInvocationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraCommitMutation.ts index bcc288fa83..6df9d8656c 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraCommitMutation.ts @@ -4,83 +4,105 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import { platformInfraCommitMutationKeys } from "../mutation-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import { platformInfraCommitMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformInfraCommitMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformInfraCommitMutation(params: { - selection: ({ - fields: S & PlatformInfraCommitSelect; - } & HookStrictSelect, PlatformInfraCommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformInfraCommit: { - platformInfraCommit: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeletePlatformInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformInfraCommitMutation( + params: { + selection: { + fields: S & PlatformInfraCommitSelect; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeletePlatformInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraCommitMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().platformInfraCommit.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .platformInfraCommit.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformInfraCommitKeys.detail(variables.id) + queryKey: platformInfraCommitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.lists() + queryKey: platformInfraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraObjectMutation.ts index d619cb36c9..6eca19dfc7 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraObjectMutation.ts @@ -4,83 +4,105 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import { platformInfraObjectMutationKeys } from "../mutation-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import { platformInfraObjectMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformInfraObjectMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformInfraObjectMutation(params: { - selection: ({ - fields: S & PlatformInfraObjectSelect; - } & HookStrictSelect, PlatformInfraObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformInfraObject: { - platformInfraObject: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeletePlatformInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformInfraObjectMutation( + params: { + selection: { + fields: S & PlatformInfraObjectSelect; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeletePlatformInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraObjectMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().platformInfraObject.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .platformInfraObject.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformInfraObjectKeys.detail(variables.id) + queryKey: platformInfraObjectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.lists() + queryKey: platformInfraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraRefMutation.ts index b53e4151fc..7dbb34e61f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraRefMutation.ts @@ -4,83 +4,99 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import { platformInfraRefMutationKeys } from "../mutation-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import { platformInfraRefMutationKeys } from '../mutation-keys'; +import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformInfraRefMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformInfraRefMutation(params: { - selection: ({ - fields: S & PlatformInfraRefSelect; - } & HookStrictSelect, PlatformInfraRefSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformInfraRef: { - platformInfraRef: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeletePlatformInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformInfraRefMutation( + params: { + selection: { + fields: S & PlatformInfraRefSelect; + } & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeletePlatformInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraRefMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().platformInfraRef.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .platformInfraRef.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformInfraRefKeys.detail(variables.id) + queryKey: platformInfraRefKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.lists() + queryKey: platformInfraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraStoreMutation.ts index f855494f86..7fae6cd5f0 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformInfraStoreMutation.ts @@ -4,77 +4,101 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import { platformInfraStoreMutationKeys } from "../mutation-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import { platformInfraStoreMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformInfraStoreMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformInfraStoreMutation(params: { - selection: ({ - fields: S & PlatformInfraStoreSelect; - } & HookStrictSelect, PlatformInfraStoreSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformInfraStore: { - platformInfraStore: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformInfraStoreMutation( + params: { + selection: { + fields: S & PlatformInfraStoreSelect; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraStoreMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformInfraStore.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformInfraStore.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformInfraStoreKeys.detail(variables.id) + queryKey: platformInfraStoreKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.lists() + queryKey: platformInfraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformNamespaceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformNamespaceEventMutation.ts index e2bea11fe0..c248e1eaa5 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformNamespaceEventMutation.ts @@ -4,83 +4,105 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import { platformNamespaceEventMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import { platformNamespaceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformNamespaceEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformNamespaceEventMutation(params: { - selection: ({ - fields: S & PlatformNamespaceEventSelect; - } & HookStrictSelect, PlatformNamespaceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformNamespaceEvent: { - platformNamespaceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeletePlatformNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformNamespaceEventMutation( + params: { + selection: { + fields: S & PlatformNamespaceEventSelect; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeletePlatformNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().platformNamespaceEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .platformNamespaceEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformNamespaceEventKeys.detail(variables.id) + queryKey: platformNamespaceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.lists() + queryKey: platformNamespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformNamespaceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformNamespaceMutation.ts index 2e7fb1b8a4..86ca139c3b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformNamespaceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformNamespaceMutation.ts @@ -4,77 +4,101 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import { platformNamespaceMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import { platformNamespaceMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformNamespaceMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformNamespaceMutation(params: { - selection: ({ - fields: S & PlatformNamespaceSelect; - } & HookStrictSelect, PlatformNamespaceSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformNamespace: { - platformNamespace: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformNamespaceMutation( + params: { + selection: { + fields: S & PlatformNamespaceSelect; + } & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformNamespace.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformNamespace.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformNamespaceKeys.detail(variables.id) + queryKey: platformNamespaceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.lists() + queryKey: platformNamespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceDefinitionMutation.ts index cd1c1fe39c..05d703c7bc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceDefinitionMutation.ts @@ -4,77 +4,103 @@ * 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 { platformResourceDefinitionKeys } from "../query-keys"; -import { platformResourceDefinitionMutationKeys } from "../mutation-keys"; -import type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations } from "../../orm/input-types"; +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 { platformResourceDefinitionKeys } from '../query-keys'; +import { platformResourceDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, +} from '../../orm/input-types'; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformResourceDefinitionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformResourceDefinitionMutation(params: { - selection: ({ - fields: S & PlatformResourceDefinitionSelect; - } & HookStrictSelect, PlatformResourceDefinitionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformResourceDefinition: { - platformResourceDefinition: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformResourceDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformResourceDefinitionMutation< + S extends PlatformResourceDefinitionSelect, +>( + params: { + selection: { + fields: S & PlatformResourceDefinitionSelect; + } & HookStrictSelect, PlatformResourceDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformResourceDefinition: { + platformResourceDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformResourceDefinition: { + platformResourceDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformResourceDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceDefinitionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformResourceDefinition.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformResourceDefinition.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformResourceDefinitionKeys.detail(variables.id) + queryKey: platformResourceDefinitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceDefinitionKeys.lists() + queryKey: platformResourceDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceEventMutation.ts index 0f9b3e9d90..c3b45c7e97 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceEventMutation.ts @@ -4,83 +4,105 @@ * 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 { platformResourceEventKeys } from "../query-keys"; -import { platformResourceEventMutationKeys } from "../mutation-keys"; -import type { PlatformResourceEventSelect, PlatformResourceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceEventSelect, PlatformResourceEventWithRelations } from "../../orm/input-types"; +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 { platformResourceEventKeys } from '../query-keys'; +import { platformResourceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, +} from '../../orm/input-types'; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformResourceEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformResourceEventMutation(params: { - selection: ({ - fields: S & PlatformResourceEventSelect; - } & HookStrictSelect, PlatformResourceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformResourceEvent: { - platformResourceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeletePlatformResourceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformResourceEventMutation( + params: { + selection: { + fields: S & PlatformResourceEventSelect; + } & HookStrictSelect, PlatformResourceEventSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformResourceEvent: { + platformResourceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformResourceEvent: { + platformResourceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeletePlatformResourceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().platformResourceEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .platformResourceEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformResourceEventKeys.detail(variables.id) + queryKey: platformResourceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceEventKeys.lists() + queryKey: platformResourceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceInstallationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceInstallationMutation.ts index b70bb37197..8ee97ae6a5 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceInstallationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceInstallationMutation.ts @@ -4,77 +4,106 @@ * 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 { platformResourceInstallationKeys } from "../query-keys"; -import { platformResourceInstallationMutationKeys } from "../mutation-keys"; -import type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations } from "../../orm/input-types"; +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 { platformResourceInstallationKeys } from '../query-keys'; +import { platformResourceInstallationMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, +} from '../../orm/input-types'; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformResourceInstallationMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformResourceInstallationMutation(params: { - selection: ({ - fields: S & PlatformResourceInstallationSelect; - } & HookStrictSelect, PlatformResourceInstallationSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformResourceInstallation: { - platformResourceInstallation: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformResourceInstallationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformResourceInstallationMutation< + S extends PlatformResourceInstallationSelect, +>( + params: { + selection: { + fields: S & PlatformResourceInstallationSelect; + } & HookStrictSelect, PlatformResourceInstallationSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformResourceInstallation: { + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + >; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformResourceInstallation: { + platformResourceInstallation: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformResourceInstallationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceInstallationMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformResourceInstallation.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformResourceInstallation.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformResourceInstallationKeys.detail(variables.id) + queryKey: platformResourceInstallationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceInstallationKeys.lists() + queryKey: platformResourceInstallationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceMutation.ts index c02651c37f..16b01dc247 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceMutation.ts @@ -4,77 +4,95 @@ * 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 { platformResourceKeys } from "../query-keys"; -import { platformResourceMutationKeys } from "../mutation-keys"; -import type { PlatformResourceSelect, PlatformResourceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceSelect, PlatformResourceWithRelations } from "../../orm/input-types"; +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 { platformResourceKeys } from '../query-keys'; +import { platformResourceMutationKeys } from '../mutation-keys'; +import type { PlatformResourceSelect, PlatformResourceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformResourceSelect, PlatformResourceWithRelations } from '../../orm/input-types'; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformResourceMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformResourceMutation(params: { - selection: ({ - fields: S & PlatformResourceSelect; - } & HookStrictSelect, PlatformResourceSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformResource: { - platformResource: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformResourceMutation( + params: { + selection: { + fields: S & PlatformResourceSelect; + } & HookStrictSelect, PlatformResourceSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformResource: { + platformResource: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformResource: { + platformResource: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformResourceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformResource.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformResource.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformResourceKeys.detail(variables.id) + queryKey: platformResourceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceKeys.lists() + queryKey: platformResourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceStatusCheckMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceStatusCheckMutation.ts index 5c6bdc895a..9574c95da3 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceStatusCheckMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceStatusCheckMutation.ts @@ -4,77 +4,106 @@ * 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 { platformResourceStatusCheckKeys } from "../query-keys"; -import { platformResourceStatusCheckMutationKeys } from "../mutation-keys"; -import type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations } from "../../orm/input-types"; +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 { platformResourceStatusCheckKeys } from '../query-keys'; +import { platformResourceStatusCheckMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, +} from '../../orm/input-types'; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformResourceStatusCheckMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformResourceStatusCheckMutation(params: { - selection: ({ - fields: S & PlatformResourceStatusCheckSelect; - } & HookStrictSelect, PlatformResourceStatusCheckSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformResourceStatusCheck: { - platformResourceStatusCheck: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformResourceStatusCheckMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformResourceStatusCheckMutation< + S extends PlatformResourceStatusCheckSelect, +>( + params: { + selection: { + fields: S & PlatformResourceStatusCheckSelect; + } & HookStrictSelect, PlatformResourceStatusCheckSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformResourceStatusCheck: { + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + >; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformResourceStatusCheck: { + platformResourceStatusCheck: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformResourceStatusCheckMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceStatusCheckMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformResourceStatusCheck.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformResourceStatusCheck.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformResourceStatusCheckKeys.detail(variables.id) + queryKey: platformResourceStatusCheckKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceStatusCheckKeys.lists() + queryKey: platformResourceStatusCheckKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceUsageLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceUsageLogMutation.ts index b1436fbd98..805abc882f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceUsageLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceUsageLogMutation.ts @@ -4,83 +4,105 @@ * 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 { platformResourceUsageLogKeys } from "../query-keys"; -import { platformResourceUsageLogMutationKeys } from "../mutation-keys"; -import type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations } from "../../orm/input-types"; +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 { platformResourceUsageLogKeys } from '../query-keys'; +import { platformResourceUsageLogMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, +} from '../../orm/input-types'; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformResourceUsageLogMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformResourceUsageLogMutation(params: { - selection: ({ - fields: S & PlatformResourceUsageLogSelect; - } & HookStrictSelect, PlatformResourceUsageLogSelect>); -} & Omit; - }; -}, Error, { - id: string; - sampledAt: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformResourceUsageLog: { - platformResourceUsageLog: InferSelectResult; - }; -}, Error, { - id: string; - sampledAt: string; -}>; -export function useDeletePlatformResourceUsageLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformResourceUsageLogMutation( + params: { + selection: { + fields: S & PlatformResourceUsageLogSelect; + } & HookStrictSelect, PlatformResourceUsageLogSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformResourceUsageLog: { + platformResourceUsageLog: InferSelectResult; + }; + }, + Error, + { + id: string; + sampledAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformResourceUsageLog: { + platformResourceUsageLog: InferSelectResult; + }; + }, + Error, + { + id: string; + sampledAt: string; + } +>; +export function useDeletePlatformResourceUsageLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + sampledAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceUsageLogMutationKeys.all, - mutationFn: ({ - id, - sampledAt - }: { - id: string; - sampledAt: string; - }) => getClient().platformResourceUsageLog.delete({ - where: { - id, - sampledAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, sampledAt }: { id: string; sampledAt: string }) => + getClient() + .platformResourceUsageLog.delete({ + where: { + id, + sampledAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformResourceUsageLogKeys.detail(variables.id) + queryKey: platformResourceUsageLogKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceUsageLogKeys.lists() + queryKey: platformResourceUsageLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceUsageSummaryMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceUsageSummaryMutation.ts index f091942423..86d0509586 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceUsageSummaryMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformResourceUsageSummaryMutation.ts @@ -4,83 +4,110 @@ * 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 { platformResourceUsageSummaryKeys } from "../query-keys"; -import { platformResourceUsageSummaryMutationKeys } from "../mutation-keys"; -import type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations } from "../../orm/input-types"; +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 { platformResourceUsageSummaryKeys } from '../query-keys'; +import { platformResourceUsageSummaryMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, +} from '../../orm/input-types'; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformResourceUsageSummaryMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformResourceUsageSummaryMutation(params: { - selection: ({ - fields: S & PlatformResourceUsageSummarySelect; - } & HookStrictSelect, PlatformResourceUsageSummarySelect>); -} & Omit; - }; -}, Error, { - id: string; - date: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformResourceUsageSummary: { - platformResourceUsageSummary: InferSelectResult; - }; -}, Error, { - id: string; - date: string; -}>; -export function useDeletePlatformResourceUsageSummaryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformResourceUsageSummaryMutation< + S extends PlatformResourceUsageSummarySelect, +>( + params: { + selection: { + fields: S & PlatformResourceUsageSummarySelect; + } & HookStrictSelect, PlatformResourceUsageSummarySelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformResourceUsageSummary: { + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + >; + }; + }, + Error, + { + id: string; + date: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformResourceUsageSummary: { + platformResourceUsageSummary: InferSelectResult; + }; + }, + Error, + { + id: string; + date: string; + } +>; +export function useDeletePlatformResourceUsageSummaryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + date: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceUsageSummaryMutationKeys.all, - mutationFn: ({ - id, - date - }: { - id: string; - date: string; - }) => getClient().platformResourceUsageSummary.delete({ - where: { - id, - date - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, date }: { id: string; date: string }) => + getClient() + .platformResourceUsageSummary.delete({ + where: { + id, + date, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformResourceUsageSummaryKeys.detail(variables.id) + queryKey: platformResourceUsageSummaryKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceUsageSummaryKeys.lists() + queryKey: platformResourceUsageSummaryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformWebhookEndpointMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformWebhookEndpointMutation.ts index 71feaeae09..4ae16299b4 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformWebhookEndpointMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformWebhookEndpointMutation.ts @@ -4,77 +4,101 @@ * 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 { platformWebhookEndpointKeys } from "../query-keys"; -import { platformWebhookEndpointMutationKeys } from "../mutation-keys"; -import type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations } from "../../orm/input-types"; +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 { platformWebhookEndpointKeys } from '../query-keys'; +import { platformWebhookEndpointMutationKeys } from '../mutation-keys'; +import type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, +} from '../../orm/input-types'; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformWebhookEndpointMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformWebhookEndpointMutation(params: { - selection: ({ - fields: S & PlatformWebhookEndpointSelect; - } & HookStrictSelect, PlatformWebhookEndpointSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformWebhookEndpoint: { - platformWebhookEndpoint: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformWebhookEndpointMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformWebhookEndpointMutation( + params: { + selection: { + fields: S & PlatformWebhookEndpointSelect; + } & HookStrictSelect, PlatformWebhookEndpointSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformWebhookEndpoint: { + platformWebhookEndpoint: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformWebhookEndpoint: { + platformWebhookEndpoint: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformWebhookEndpointMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformWebhookEndpointMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformWebhookEndpoint.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformWebhookEndpoint.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformWebhookEndpointKeys.detail(variables.id) + queryKey: platformWebhookEndpointKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformWebhookEndpointKeys.lists() + queryKey: platformWebhookEndpointKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformWebhookEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformWebhookEventMutation.ts index 5aae086b5e..c4ce7ad815 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformWebhookEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeletePlatformWebhookEventMutation.ts @@ -4,77 +4,101 @@ * 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 { platformWebhookEventKeys } from "../query-keys"; -import { platformWebhookEventMutationKeys } from "../mutation-keys"; -import type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations } from "../../orm/input-types"; +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 { platformWebhookEventKeys } from '../query-keys'; +import { platformWebhookEventMutationKeys } from '../mutation-keys'; +import type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, +} from '../../orm/input-types'; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformWebhookEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformWebhookEventMutation(params: { - selection: ({ - fields: S & PlatformWebhookEventSelect; - } & HookStrictSelect, PlatformWebhookEventSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformWebhookEvent: { - platformWebhookEvent: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformWebhookEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformWebhookEventMutation( + params: { + selection: { + fields: S & PlatformWebhookEventSelect; + } & HookStrictSelect, PlatformWebhookEventSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformWebhookEvent: { + platformWebhookEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformWebhookEvent: { + platformWebhookEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformWebhookEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformWebhookEventMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformWebhookEvent.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformWebhookEvent.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformWebhookEventKeys.detail(variables.id) + queryKey: platformWebhookEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformWebhookEventKeys.lists() + queryKey: platformWebhookEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceDefinitionMutation.ts index b1439af36c..45fb0c71aa 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceDefinitionMutation.ts @@ -4,77 +4,101 @@ * 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 { resourceDefinitionKeys } from "../query-keys"; -import { resourceDefinitionMutationKeys } from "../mutation-keys"; -import type { ResourceDefinitionSelect, ResourceDefinitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceDefinitionSelect, ResourceDefinitionWithRelations } from "../../orm/input-types"; +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 { resourceDefinitionKeys } from '../query-keys'; +import { resourceDefinitionMutationKeys } from '../mutation-keys'; +import type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, +} from '../../orm/input-types'; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteResourceDefinitionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteResourceDefinitionMutation(params: { - selection: ({ - fields: S & ResourceDefinitionSelect; - } & HookStrictSelect, ResourceDefinitionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteResourceDefinition: { - resourceDefinition: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteResourceDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteResourceDefinitionMutation( + params: { + selection: { + fields: S & ResourceDefinitionSelect; + } & HookStrictSelect, ResourceDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + deleteResourceDefinition: { + resourceDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteResourceDefinition: { + resourceDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteResourceDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceDefinitionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().resourceDefinition.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .resourceDefinition.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: resourceDefinitionKeys.detail(variables.id) + queryKey: resourceDefinitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceDefinitionKeys.lists() + queryKey: resourceDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceEventMutation.ts index f2e3ca605b..5ee7ed7f19 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceEventMutation.ts @@ -4,83 +4,99 @@ * 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 { resourceEventKeys } from "../query-keys"; -import { resourceEventMutationKeys } from "../mutation-keys"; -import type { ResourceEventSelect, ResourceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceEventSelect, ResourceEventWithRelations } from "../../orm/input-types"; +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 { resourceEventKeys } from '../query-keys'; +import { resourceEventMutationKeys } from '../mutation-keys'; +import type { ResourceEventSelect, ResourceEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceEventSelect, ResourceEventWithRelations } from '../../orm/input-types'; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteResourceEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteResourceEventMutation(params: { - selection: ({ - fields: S & ResourceEventSelect; - } & HookStrictSelect, ResourceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteResourceEvent: { - resourceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteResourceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteResourceEventMutation( + params: { + selection: { + fields: S & ResourceEventSelect; + } & HookStrictSelect, ResourceEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteResourceEvent: { + resourceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteResourceEvent: { + resourceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteResourceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().resourceEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .resourceEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: resourceEventKeys.detail(variables.id) + queryKey: resourceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceEventKeys.lists() + queryKey: resourceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceInstallationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceInstallationMutation.ts index 40ec17b24a..5197e08759 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceInstallationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceInstallationMutation.ts @@ -4,77 +4,101 @@ * 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 { resourceInstallationKeys } from "../query-keys"; -import { resourceInstallationMutationKeys } from "../mutation-keys"; -import type { ResourceInstallationSelect, ResourceInstallationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationSelect, ResourceInstallationWithRelations } from "../../orm/input-types"; +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 { resourceInstallationKeys } from '../query-keys'; +import { resourceInstallationMutationKeys } from '../mutation-keys'; +import type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, +} from '../../orm/input-types'; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteResourceInstallationMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteResourceInstallationMutation(params: { - selection: ({ - fields: S & ResourceInstallationSelect; - } & HookStrictSelect, ResourceInstallationSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteResourceInstallation: { - resourceInstallation: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteResourceInstallationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteResourceInstallationMutation( + params: { + selection: { + fields: S & ResourceInstallationSelect; + } & HookStrictSelect, ResourceInstallationSelect>; + } & Omit< + UseMutationOptions< + { + deleteResourceInstallation: { + resourceInstallation: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteResourceInstallation: { + resourceInstallation: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteResourceInstallationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceInstallationMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().resourceInstallation.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .resourceInstallation.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: resourceInstallationKeys.detail(variables.id) + queryKey: resourceInstallationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceInstallationKeys.lists() + queryKey: resourceInstallationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceMutation.ts index 62bca4c114..647b2f9aff 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceMutation.ts @@ -4,77 +4,95 @@ * 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 { resourceKeys } from "../query-keys"; -import { resourceMutationKeys } from "../mutation-keys"; -import type { ResourceSelect, ResourceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceSelect, ResourceWithRelations } from "../../orm/input-types"; +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 { resourceKeys } from '../query-keys'; +import { resourceMutationKeys } from '../mutation-keys'; +import type { ResourceSelect, ResourceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceSelect, ResourceWithRelations } from '../../orm/input-types'; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteResourceMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteResourceMutation(params: { - selection: ({ - fields: S & ResourceSelect; - } & HookStrictSelect, ResourceSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteResource: { - resource: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteResourceMutation( + params: { + selection: { + fields: S & ResourceSelect; + } & HookStrictSelect, ResourceSelect>; + } & Omit< + UseMutationOptions< + { + deleteResource: { + resource: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteResource: { + resource: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteResourceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().resource.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .resource.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: resourceKeys.detail(variables.id) + queryKey: resourceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceKeys.lists() + queryKey: resourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceStatusCheckMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceStatusCheckMutation.ts index 41410298ca..3b7cef4ce5 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceStatusCheckMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceStatusCheckMutation.ts @@ -4,77 +4,101 @@ * 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 { resourceStatusCheckKeys } from "../query-keys"; -import { resourceStatusCheckMutationKeys } from "../mutation-keys"; -import type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations } from "../../orm/input-types"; +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 { resourceStatusCheckKeys } from '../query-keys'; +import { resourceStatusCheckMutationKeys } from '../mutation-keys'; +import type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, +} from '../../orm/input-types'; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteResourceStatusCheckMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteResourceStatusCheckMutation(params: { - selection: ({ - fields: S & ResourceStatusCheckSelect; - } & HookStrictSelect, ResourceStatusCheckSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteResourceStatusCheck: { - resourceStatusCheck: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteResourceStatusCheckMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteResourceStatusCheckMutation( + params: { + selection: { + fields: S & ResourceStatusCheckSelect; + } & HookStrictSelect, ResourceStatusCheckSelect>; + } & Omit< + UseMutationOptions< + { + deleteResourceStatusCheck: { + resourceStatusCheck: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteResourceStatusCheck: { + resourceStatusCheck: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteResourceStatusCheckMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceStatusCheckMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().resourceStatusCheck.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .resourceStatusCheck.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: resourceStatusCheckKeys.detail(variables.id) + queryKey: resourceStatusCheckKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceStatusCheckKeys.lists() + queryKey: resourceStatusCheckKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceUsageLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceUsageLogMutation.ts index fb0e33aa1a..4404597e53 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceUsageLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceUsageLogMutation.ts @@ -4,83 +4,99 @@ * 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 { resourceUsageLogKeys } from "../query-keys"; -import { resourceUsageLogMutationKeys } from "../mutation-keys"; -import type { ResourceUsageLogSelect, ResourceUsageLogWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageLogSelect, ResourceUsageLogWithRelations } from "../../orm/input-types"; +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 { resourceUsageLogKeys } from '../query-keys'; +import { resourceUsageLogMutationKeys } from '../mutation-keys'; +import type { ResourceUsageLogSelect, ResourceUsageLogWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceUsageLogSelect, ResourceUsageLogWithRelations } from '../../orm/input-types'; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteResourceUsageLogMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteResourceUsageLogMutation(params: { - selection: ({ - fields: S & ResourceUsageLogSelect; - } & HookStrictSelect, ResourceUsageLogSelect>); -} & Omit; - }; -}, Error, { - id: string; - sampledAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteResourceUsageLog: { - resourceUsageLog: InferSelectResult; - }; -}, Error, { - id: string; - sampledAt: string; -}>; -export function useDeleteResourceUsageLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteResourceUsageLogMutation( + params: { + selection: { + fields: S & ResourceUsageLogSelect; + } & HookStrictSelect, ResourceUsageLogSelect>; + } & Omit< + UseMutationOptions< + { + deleteResourceUsageLog: { + resourceUsageLog: InferSelectResult; + }; + }, + Error, + { + id: string; + sampledAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteResourceUsageLog: { + resourceUsageLog: InferSelectResult; + }; + }, + Error, + { + id: string; + sampledAt: string; + } +>; +export function useDeleteResourceUsageLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + sampledAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceUsageLogMutationKeys.all, - mutationFn: ({ - id, - sampledAt - }: { - id: string; - sampledAt: string; - }) => getClient().resourceUsageLog.delete({ - where: { - id, - sampledAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, sampledAt }: { id: string; sampledAt: string }) => + getClient() + .resourceUsageLog.delete({ + where: { + id, + sampledAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: resourceUsageLogKeys.detail(variables.id) + queryKey: resourceUsageLogKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceUsageLogKeys.lists() + queryKey: resourceUsageLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceUsageSummaryMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceUsageSummaryMutation.ts index bd80b8b271..314d4d734f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceUsageSummaryMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteResourceUsageSummaryMutation.ts @@ -4,83 +4,105 @@ * 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 { resourceUsageSummaryKeys } from "../query-keys"; -import { resourceUsageSummaryMutationKeys } from "../mutation-keys"; -import type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations } from "../../orm/input-types"; +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 { resourceUsageSummaryKeys } from '../query-keys'; +import { resourceUsageSummaryMutationKeys } from '../mutation-keys'; +import type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, +} from '../../orm/input-types'; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteResourceUsageSummaryMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteResourceUsageSummaryMutation(params: { - selection: ({ - fields: S & ResourceUsageSummarySelect; - } & HookStrictSelect, ResourceUsageSummarySelect>); -} & Omit; - }; -}, Error, { - id: string; - date: string; -}>, "mutationFn">): UseMutationResult<{ - deleteResourceUsageSummary: { - resourceUsageSummary: InferSelectResult; - }; -}, Error, { - id: string; - date: string; -}>; -export function useDeleteResourceUsageSummaryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteResourceUsageSummaryMutation( + params: { + selection: { + fields: S & ResourceUsageSummarySelect; + } & HookStrictSelect, ResourceUsageSummarySelect>; + } & Omit< + UseMutationOptions< + { + deleteResourceUsageSummary: { + resourceUsageSummary: InferSelectResult; + }; + }, + Error, + { + id: string; + date: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteResourceUsageSummary: { + resourceUsageSummary: InferSelectResult; + }; + }, + Error, + { + id: string; + date: string; + } +>; +export function useDeleteResourceUsageSummaryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + date: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceUsageSummaryMutationKeys.all, - mutationFn: ({ - id, - date - }: { - id: string; - date: string; - }) => getClient().resourceUsageSummary.delete({ - where: { - id, - date - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, date }: { id: string; date: string }) => + getClient() + .resourceUsageSummary.delete({ + where: { + id, + date, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: resourceUsageSummaryKeys.detail(variables.id) + queryKey: resourceUsageSummaryKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceUsageSummaryKeys.lists() + queryKey: resourceUsageSummaryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteWebhookEndpointMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteWebhookEndpointMutation.ts index 9cc0c22fdf..efbbdee833 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteWebhookEndpointMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteWebhookEndpointMutation.ts @@ -4,77 +4,95 @@ * 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 { webhookEndpointKeys } from "../query-keys"; -import { webhookEndpointMutationKeys } from "../mutation-keys"; -import type { WebhookEndpointSelect, WebhookEndpointWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEndpointSelect, WebhookEndpointWithRelations } from "../../orm/input-types"; +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 { webhookEndpointKeys } from '../query-keys'; +import { webhookEndpointMutationKeys } from '../mutation-keys'; +import type { WebhookEndpointSelect, WebhookEndpointWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { WebhookEndpointSelect, WebhookEndpointWithRelations } from '../../orm/input-types'; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteWebhookEndpointMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteWebhookEndpointMutation(params: { - selection: ({ - fields: S & WebhookEndpointSelect; - } & HookStrictSelect, WebhookEndpointSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteWebhookEndpoint: { - webhookEndpoint: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteWebhookEndpointMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteWebhookEndpointMutation( + params: { + selection: { + fields: S & WebhookEndpointSelect; + } & HookStrictSelect, WebhookEndpointSelect>; + } & Omit< + UseMutationOptions< + { + deleteWebhookEndpoint: { + webhookEndpoint: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteWebhookEndpoint: { + webhookEndpoint: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteWebhookEndpointMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookEndpointMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().webhookEndpoint.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .webhookEndpoint.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: webhookEndpointKeys.detail(variables.id) + queryKey: webhookEndpointKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webhookEndpointKeys.lists() + queryKey: webhookEndpointKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteWebhookEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteWebhookEventMutation.ts index 1f64fd57b4..62162a85f1 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteWebhookEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteWebhookEventMutation.ts @@ -4,77 +4,95 @@ * 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 { webhookEventKeys } from "../query-keys"; -import { webhookEventMutationKeys } from "../mutation-keys"; -import type { WebhookEventSelect, WebhookEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEventSelect, WebhookEventWithRelations } from "../../orm/input-types"; +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 { webhookEventKeys } from '../query-keys'; +import { webhookEventMutationKeys } from '../mutation-keys'; +import type { WebhookEventSelect, WebhookEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { WebhookEventSelect, WebhookEventWithRelations } from '../../orm/input-types'; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteWebhookEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteWebhookEventMutation(params: { - selection: ({ - fields: S & WebhookEventSelect; - } & HookStrictSelect, WebhookEventSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteWebhookEvent: { - webhookEvent: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteWebhookEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteWebhookEventMutation( + params: { + selection: { + fields: S & WebhookEventSelect; + } & HookStrictSelect, WebhookEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteWebhookEvent: { + webhookEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteWebhookEvent: { + webhookEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteWebhookEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookEventMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().webhookEvent.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .webhookEvent.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: webhookEventKeys.detail(variables.id) + queryKey: webhookEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webhookEventKeys.lists() + queryKey: webhookEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useImportDefinitionsMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useImportDefinitionsMutation.ts index 7930d29fe0..1554fa5a65 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useImportDefinitionsMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useImportDefinitionsMutation.ts @@ -4,39 +4,55 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ImportDefinitionsVariables } from "../../orm/mutation"; -import type { ImportDefinitionsPayloadSelect, ImportDefinitionsPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ImportDefinitionsVariables } from "../../orm/mutation"; -export type { ImportDefinitionsPayloadSelect } from "../../orm/input-types"; -export function useImportDefinitionsMutation(params: { - selection: ({ - fields: S & ImportDefinitionsPayloadSelect; - } & HookStrictSelect, ImportDefinitionsPayloadSelect>); -} & Omit | null; -}, Error, ImportDefinitionsVariables>, "mutationFn">): UseMutationResult<{ - importDefinitions: InferSelectResult | null; -}, Error, ImportDefinitionsVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ImportDefinitionsVariables } from '../../orm/mutation'; +import type { + ImportDefinitionsPayloadSelect, + ImportDefinitionsPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ImportDefinitionsVariables } from '../../orm/mutation'; +export type { ImportDefinitionsPayloadSelect } from '../../orm/input-types'; +export function useImportDefinitionsMutation( + params: { + selection: { + fields: S & ImportDefinitionsPayloadSelect; + } & HookStrictSelect, ImportDefinitionsPayloadSelect>; + } & Omit< + UseMutationOptions< + { + importDefinitions: InferSelectResult | null; + }, + Error, + ImportDefinitionsVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + importDefinitions: InferSelectResult | null; + }, + Error, + ImportDefinitionsVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.importDefinitions(), - mutationFn: (variables: ImportDefinitionsVariables) => getClient().mutation.importDefinitions(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ImportDefinitionsVariables) => + getClient() + .mutation.importDefinitions(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useImportGraphJsonMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useImportGraphJsonMutation.ts index 6bc4537016..00b6d1e68d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useImportGraphJsonMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useImportGraphJsonMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ImportGraphJsonVariables } from "../../orm/mutation"; -import type { ImportGraphJsonPayloadSelect, ImportGraphJsonPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ImportGraphJsonVariables } from "../../orm/mutation"; -export type { ImportGraphJsonPayloadSelect } from "../../orm/input-types"; -export function useImportGraphJsonMutation(params: { - selection: ({ - fields: S & ImportGraphJsonPayloadSelect; - } & HookStrictSelect, ImportGraphJsonPayloadSelect>); -} & Omit | null; -}, Error, ImportGraphJsonVariables>, "mutationFn">): UseMutationResult<{ - importGraphJson: InferSelectResult | null; -}, Error, ImportGraphJsonVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ImportGraphJsonVariables } from '../../orm/mutation'; +import type { ImportGraphJsonPayloadSelect, ImportGraphJsonPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ImportGraphJsonVariables } from '../../orm/mutation'; +export type { ImportGraphJsonPayloadSelect } from '../../orm/input-types'; +export function useImportGraphJsonMutation( + params: { + selection: { + fields: S & ImportGraphJsonPayloadSelect; + } & HookStrictSelect, ImportGraphJsonPayloadSelect>; + } & Omit< + UseMutationOptions< + { + importGraphJson: InferSelectResult | null; + }, + Error, + ImportGraphJsonVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + importGraphJson: InferSelectResult | null; + }, + Error, + ImportGraphJsonVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.importGraphJson(), - mutationFn: (variables: ImportGraphJsonVariables) => getClient().mutation.importGraphJson(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ImportGraphJsonVariables) => + getClient() + .mutation.importGraphJson(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useInfraInitEmptyRepoMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useInfraInitEmptyRepoMutation.ts index 5aefb24632..93e94ad35e 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useInfraInitEmptyRepoMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useInfraInitEmptyRepoMutation.ts @@ -4,39 +4,55 @@ * 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 { InfraInitEmptyRepoVariables } from "../../orm/mutation"; -import type { InfraInitEmptyRepoPayloadSelect, InfraInitEmptyRepoPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { InfraInitEmptyRepoVariables } from "../../orm/mutation"; -export type { InfraInitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export function useInfraInitEmptyRepoMutation(params: { - selection: ({ - fields: S & InfraInitEmptyRepoPayloadSelect; - } & HookStrictSelect, InfraInitEmptyRepoPayloadSelect>); -} & Omit | null; -}, Error, InfraInitEmptyRepoVariables>, "mutationFn">): UseMutationResult<{ - infraInitEmptyRepo: InferSelectResult | null; -}, Error, InfraInitEmptyRepoVariables> { +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 { InfraInitEmptyRepoVariables } from '../../orm/mutation'; +import type { + InfraInitEmptyRepoPayloadSelect, + InfraInitEmptyRepoPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InfraInitEmptyRepoVariables } from '../../orm/mutation'; +export type { InfraInitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export function useInfraInitEmptyRepoMutation( + params: { + selection: { + fields: S & InfraInitEmptyRepoPayloadSelect; + } & HookStrictSelect, InfraInitEmptyRepoPayloadSelect>; + } & Omit< + UseMutationOptions< + { + infraInitEmptyRepo: InferSelectResult | null; + }, + Error, + InfraInitEmptyRepoVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + infraInitEmptyRepo: InferSelectResult | null; + }, + Error, + InfraInitEmptyRepoVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.infraInitEmptyRepo(), - mutationFn: (variables: InfraInitEmptyRepoVariables) => getClient().mutation.infraInitEmptyRepo(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: InfraInitEmptyRepoVariables) => + getClient() + .mutation.infraInitEmptyRepo(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useInfraInsertNodeAtPathMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useInfraInsertNodeAtPathMutation.ts index 6f87a9876f..17eac12e32 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useInfraInsertNodeAtPathMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useInfraInsertNodeAtPathMutation.ts @@ -4,39 +4,55 @@ * 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 { InfraInsertNodeAtPathVariables } from "../../orm/mutation"; -import type { InfraInsertNodeAtPathPayloadSelect, InfraInsertNodeAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { InfraInsertNodeAtPathVariables } from "../../orm/mutation"; -export type { InfraInsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export function useInfraInsertNodeAtPathMutation(params: { - selection: ({ - fields: S & InfraInsertNodeAtPathPayloadSelect; - } & HookStrictSelect, InfraInsertNodeAtPathPayloadSelect>); -} & Omit | null; -}, Error, InfraInsertNodeAtPathVariables>, "mutationFn">): UseMutationResult<{ - infraInsertNodeAtPath: InferSelectResult | null; -}, Error, InfraInsertNodeAtPathVariables> { +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 { InfraInsertNodeAtPathVariables } from '../../orm/mutation'; +import type { + InfraInsertNodeAtPathPayloadSelect, + InfraInsertNodeAtPathPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InfraInsertNodeAtPathVariables } from '../../orm/mutation'; +export type { InfraInsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export function useInfraInsertNodeAtPathMutation( + params: { + selection: { + fields: S & InfraInsertNodeAtPathPayloadSelect; + } & HookStrictSelect, InfraInsertNodeAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + infraInsertNodeAtPath: InferSelectResult | null; + }, + Error, + InfraInsertNodeAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + infraInsertNodeAtPath: InferSelectResult | null; + }, + Error, + InfraInsertNodeAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.infraInsertNodeAtPath(), - mutationFn: (variables: InfraInsertNodeAtPathVariables) => getClient().mutation.infraInsertNodeAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: InfraInsertNodeAtPathVariables) => + getClient() + .mutation.infraInsertNodeAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useInfraSetDataAtPathMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useInfraSetDataAtPathMutation.ts index cb895fac6b..50a6867d2d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useInfraSetDataAtPathMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useInfraSetDataAtPathMutation.ts @@ -4,39 +4,55 @@ * 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 { InfraSetDataAtPathVariables } from "../../orm/mutation"; -import type { InfraSetDataAtPathPayloadSelect, InfraSetDataAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { InfraSetDataAtPathVariables } from "../../orm/mutation"; -export type { InfraSetDataAtPathPayloadSelect } from "../../orm/input-types"; -export function useInfraSetDataAtPathMutation(params: { - selection: ({ - fields: S & InfraSetDataAtPathPayloadSelect; - } & HookStrictSelect, InfraSetDataAtPathPayloadSelect>); -} & Omit | null; -}, Error, InfraSetDataAtPathVariables>, "mutationFn">): UseMutationResult<{ - infraSetDataAtPath: InferSelectResult | null; -}, Error, InfraSetDataAtPathVariables> { +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 { InfraSetDataAtPathVariables } from '../../orm/mutation'; +import type { + InfraSetDataAtPathPayloadSelect, + InfraSetDataAtPathPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InfraSetDataAtPathVariables } from '../../orm/mutation'; +export type { InfraSetDataAtPathPayloadSelect } from '../../orm/input-types'; +export function useInfraSetDataAtPathMutation( + params: { + selection: { + fields: S & InfraSetDataAtPathPayloadSelect; + } & HookStrictSelect, InfraSetDataAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + infraSetDataAtPath: InferSelectResult | null; + }, + Error, + InfraSetDataAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + infraSetDataAtPath: InferSelectResult | null; + }, + Error, + InfraSetDataAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.infraSetDataAtPath(), - mutationFn: (variables: InfraSetDataAtPathVariables) => getClient().mutation.infraSetDataAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: InfraSetDataAtPathVariables) => + getClient() + .mutation.infraSetDataAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useInitEmptyRepoMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useInitEmptyRepoMutation.ts index eaebea4a83..f82dc9e02c 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useInitEmptyRepoMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useInitEmptyRepoMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { InitEmptyRepoVariables } from "../../orm/mutation"; -import type { InitEmptyRepoPayloadSelect, InitEmptyRepoPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { InitEmptyRepoVariables } from "../../orm/mutation"; -export type { InitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export function useInitEmptyRepoMutation(params: { - selection: ({ - fields: S & InitEmptyRepoPayloadSelect; - } & HookStrictSelect, InitEmptyRepoPayloadSelect>); -} & Omit | null; -}, Error, InitEmptyRepoVariables>, "mutationFn">): UseMutationResult<{ - initEmptyRepo: InferSelectResult | null; -}, Error, InitEmptyRepoVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { InitEmptyRepoVariables } from '../../orm/mutation'; +import type { InitEmptyRepoPayloadSelect, InitEmptyRepoPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InitEmptyRepoVariables } from '../../orm/mutation'; +export type { InitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export function useInitEmptyRepoMutation( + params: { + selection: { + fields: S & InitEmptyRepoPayloadSelect; + } & HookStrictSelect, InitEmptyRepoPayloadSelect>; + } & Omit< + UseMutationOptions< + { + initEmptyRepo: InferSelectResult | null; + }, + Error, + InitEmptyRepoVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + initEmptyRepo: InferSelectResult | null; + }, + Error, + InitEmptyRepoVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.initEmptyRepo(), - mutationFn: (variables: InitEmptyRepoVariables) => getClient().mutation.initEmptyRepo(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: InitEmptyRepoVariables) => + getClient() + .mutation.initEmptyRepo(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useInsertNodeAtPathMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useInsertNodeAtPathMutation.ts index c7b39646ad..9da7a1bd56 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useInsertNodeAtPathMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useInsertNodeAtPathMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { InsertNodeAtPathVariables } from "../../orm/mutation"; -import type { InsertNodeAtPathPayloadSelect, InsertNodeAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { InsertNodeAtPathVariables } from "../../orm/mutation"; -export type { InsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export function useInsertNodeAtPathMutation(params: { - selection: ({ - fields: S & InsertNodeAtPathPayloadSelect; - } & HookStrictSelect, InsertNodeAtPathPayloadSelect>); -} & Omit | null; -}, Error, InsertNodeAtPathVariables>, "mutationFn">): UseMutationResult<{ - insertNodeAtPath: InferSelectResult | null; -}, Error, InsertNodeAtPathVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { InsertNodeAtPathVariables } from '../../orm/mutation'; +import type { InsertNodeAtPathPayloadSelect, InsertNodeAtPathPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InsertNodeAtPathVariables } from '../../orm/mutation'; +export type { InsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export function useInsertNodeAtPathMutation( + params: { + selection: { + fields: S & InsertNodeAtPathPayloadSelect; + } & HookStrictSelect, InsertNodeAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + insertNodeAtPath: InferSelectResult | null; + }, + Error, + InsertNodeAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + insertNodeAtPath: InferSelectResult | null; + }, + Error, + InsertNodeAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.insertNodeAtPath(), - mutationFn: (variables: InsertNodeAtPathVariables) => getClient().mutation.insertNodeAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: InsertNodeAtPathVariables) => + getClient() + .mutation.insertNodeAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraInitEmptyRepoMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraInitEmptyRepoMutation.ts index b342c2f6d5..96a1c5190a 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraInitEmptyRepoMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraInitEmptyRepoMutation.ts @@ -4,39 +4,57 @@ * 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 { PlatformInfraInitEmptyRepoVariables } from "../../orm/mutation"; -import type { PlatformInfraInitEmptyRepoPayloadSelect, PlatformInfraInitEmptyRepoPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInfraInitEmptyRepoVariables } from "../../orm/mutation"; -export type { PlatformInfraInitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export function usePlatformInfraInitEmptyRepoMutation(params: { - selection: ({ - fields: S & PlatformInfraInitEmptyRepoPayloadSelect; - } & HookStrictSelect, PlatformInfraInitEmptyRepoPayloadSelect>); -} & Omit | null; -}, Error, PlatformInfraInitEmptyRepoVariables>, "mutationFn">): UseMutationResult<{ - platformInfraInitEmptyRepo: InferSelectResult | null; -}, Error, PlatformInfraInitEmptyRepoVariables> { +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 { PlatformInfraInitEmptyRepoVariables } from '../../orm/mutation'; +import type { + PlatformInfraInitEmptyRepoPayloadSelect, + PlatformInfraInitEmptyRepoPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInfraInitEmptyRepoVariables } from '../../orm/mutation'; +export type { PlatformInfraInitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export function usePlatformInfraInitEmptyRepoMutation< + S extends PlatformInfraInitEmptyRepoPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInfraInitEmptyRepoPayloadSelect; + } & HookStrictSelect, PlatformInfraInitEmptyRepoPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInfraInitEmptyRepo: InferSelectResult | null; + }, + Error, + PlatformInfraInitEmptyRepoVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInfraInitEmptyRepo: InferSelectResult | null; + }, + Error, + PlatformInfraInitEmptyRepoVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInfraInitEmptyRepo(), - mutationFn: (variables: PlatformInfraInitEmptyRepoVariables) => getClient().mutation.platformInfraInitEmptyRepo(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInfraInitEmptyRepoVariables) => + getClient() + .mutation.platformInfraInitEmptyRepo(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraInsertNodeAtPathMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraInsertNodeAtPathMutation.ts index 53e17ecc04..94f08d7d64 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraInsertNodeAtPathMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraInsertNodeAtPathMutation.ts @@ -4,39 +4,63 @@ * 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 { PlatformInfraInsertNodeAtPathVariables } from "../../orm/mutation"; -import type { PlatformInfraInsertNodeAtPathPayloadSelect, PlatformInfraInsertNodeAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInfraInsertNodeAtPathVariables } from "../../orm/mutation"; -export type { PlatformInfraInsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export function usePlatformInfraInsertNodeAtPathMutation(params: { - selection: ({ - fields: S & PlatformInfraInsertNodeAtPathPayloadSelect; - } & HookStrictSelect, PlatformInfraInsertNodeAtPathPayloadSelect>); -} & Omit | null; -}, Error, PlatformInfraInsertNodeAtPathVariables>, "mutationFn">): UseMutationResult<{ - platformInfraInsertNodeAtPath: InferSelectResult | null; -}, Error, PlatformInfraInsertNodeAtPathVariables> { +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 { PlatformInfraInsertNodeAtPathVariables } from '../../orm/mutation'; +import type { + PlatformInfraInsertNodeAtPathPayloadSelect, + PlatformInfraInsertNodeAtPathPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInfraInsertNodeAtPathVariables } from '../../orm/mutation'; +export type { PlatformInfraInsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export function usePlatformInfraInsertNodeAtPathMutation< + S extends PlatformInfraInsertNodeAtPathPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInfraInsertNodeAtPathPayloadSelect; + } & HookStrictSelect, PlatformInfraInsertNodeAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }, + Error, + PlatformInfraInsertNodeAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }, + Error, + PlatformInfraInsertNodeAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInfraInsertNodeAtPath(), - mutationFn: (variables: PlatformInfraInsertNodeAtPathVariables) => getClient().mutation.platformInfraInsertNodeAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInfraInsertNodeAtPathVariables) => + getClient() + .mutation.platformInfraInsertNodeAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraSetDataAtPathMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraSetDataAtPathMutation.ts index 9dd67f6614..4a32fdf323 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraSetDataAtPathMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformInfraSetDataAtPathMutation.ts @@ -4,39 +4,57 @@ * 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 { PlatformInfraSetDataAtPathVariables } from "../../orm/mutation"; -import type { PlatformInfraSetDataAtPathPayloadSelect, PlatformInfraSetDataAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInfraSetDataAtPathVariables } from "../../orm/mutation"; -export type { PlatformInfraSetDataAtPathPayloadSelect } from "../../orm/input-types"; -export function usePlatformInfraSetDataAtPathMutation(params: { - selection: ({ - fields: S & PlatformInfraSetDataAtPathPayloadSelect; - } & HookStrictSelect, PlatformInfraSetDataAtPathPayloadSelect>); -} & Omit | null; -}, Error, PlatformInfraSetDataAtPathVariables>, "mutationFn">): UseMutationResult<{ - platformInfraSetDataAtPath: InferSelectResult | null; -}, Error, PlatformInfraSetDataAtPathVariables> { +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 { PlatformInfraSetDataAtPathVariables } from '../../orm/mutation'; +import type { + PlatformInfraSetDataAtPathPayloadSelect, + PlatformInfraSetDataAtPathPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInfraSetDataAtPathVariables } from '../../orm/mutation'; +export type { PlatformInfraSetDataAtPathPayloadSelect } from '../../orm/input-types'; +export function usePlatformInfraSetDataAtPathMutation< + S extends PlatformInfraSetDataAtPathPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInfraSetDataAtPathPayloadSelect; + } & HookStrictSelect, PlatformInfraSetDataAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInfraSetDataAtPath: InferSelectResult | null; + }, + Error, + PlatformInfraSetDataAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInfraSetDataAtPath: InferSelectResult | null; + }, + Error, + PlatformInfraSetDataAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInfraSetDataAtPath(), - mutationFn: (variables: PlatformInfraSetDataAtPathVariables) => getClient().mutation.platformInfraSetDataAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInfraSetDataAtPathVariables) => + getClient() + .mutation.platformInfraSetDataAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsInstallMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsInstallMutation.ts index a85f4544fc..108521364d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsInstallMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsInstallMutation.ts @@ -4,39 +4,63 @@ * 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 { PlatformResourceInstallationsInstallVariables } from "../../orm/mutation"; -import type { PlatformResourceInstallationsInstallPayloadSelect, PlatformResourceInstallationsInstallPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationsInstallVariables } from "../../orm/mutation"; -export type { PlatformResourceInstallationsInstallPayloadSelect } from "../../orm/input-types"; -export function usePlatformResourceInstallationsInstallMutation(params: { - selection: ({ - fields: S & PlatformResourceInstallationsInstallPayloadSelect; - } & HookStrictSelect, PlatformResourceInstallationsInstallPayloadSelect>); -} & Omit | null; -}, Error, PlatformResourceInstallationsInstallVariables>, "mutationFn">): UseMutationResult<{ - platformResourceInstallationsInstall: InferSelectResult | null; -}, Error, PlatformResourceInstallationsInstallVariables> { +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 { PlatformResourceInstallationsInstallVariables } from '../../orm/mutation'; +import type { + PlatformResourceInstallationsInstallPayloadSelect, + PlatformResourceInstallationsInstallPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformResourceInstallationsInstallVariables } from '../../orm/mutation'; +export type { PlatformResourceInstallationsInstallPayloadSelect } from '../../orm/input-types'; +export function usePlatformResourceInstallationsInstallMutation< + S extends PlatformResourceInstallationsInstallPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformResourceInstallationsInstallPayloadSelect; + } & HookStrictSelect, PlatformResourceInstallationsInstallPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformResourceInstallationsInstall: InferSelectResult< + PlatformResourceInstallationsInstallPayload, + S + > | null; + }, + Error, + PlatformResourceInstallationsInstallVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformResourceInstallationsInstall: InferSelectResult< + PlatformResourceInstallationsInstallPayload, + S + > | null; + }, + Error, + PlatformResourceInstallationsInstallVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformResourceInstallationsInstall(), - mutationFn: (variables: PlatformResourceInstallationsInstallVariables) => getClient().mutation.platformResourceInstallationsInstall(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformResourceInstallationsInstallVariables) => + getClient() + .mutation.platformResourceInstallationsInstall(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsRollbackMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsRollbackMutation.ts index 7bc4f695e2..e578c91d4c 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsRollbackMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsRollbackMutation.ts @@ -4,39 +4,63 @@ * 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 { PlatformResourceInstallationsRollbackVariables } from "../../orm/mutation"; -import type { PlatformResourceInstallationsRollbackPayloadSelect, PlatformResourceInstallationsRollbackPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationsRollbackVariables } from "../../orm/mutation"; -export type { PlatformResourceInstallationsRollbackPayloadSelect } from "../../orm/input-types"; -export function usePlatformResourceInstallationsRollbackMutation(params: { - selection: ({ - fields: S & PlatformResourceInstallationsRollbackPayloadSelect; - } & HookStrictSelect, PlatformResourceInstallationsRollbackPayloadSelect>); -} & Omit | null; -}, Error, PlatformResourceInstallationsRollbackVariables>, "mutationFn">): UseMutationResult<{ - platformResourceInstallationsRollback: InferSelectResult | null; -}, Error, PlatformResourceInstallationsRollbackVariables> { +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 { PlatformResourceInstallationsRollbackVariables } from '../../orm/mutation'; +import type { + PlatformResourceInstallationsRollbackPayloadSelect, + PlatformResourceInstallationsRollbackPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformResourceInstallationsRollbackVariables } from '../../orm/mutation'; +export type { PlatformResourceInstallationsRollbackPayloadSelect } from '../../orm/input-types'; +export function usePlatformResourceInstallationsRollbackMutation< + S extends PlatformResourceInstallationsRollbackPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformResourceInstallationsRollbackPayloadSelect; + } & HookStrictSelect, PlatformResourceInstallationsRollbackPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformResourceInstallationsRollback: InferSelectResult< + PlatformResourceInstallationsRollbackPayload, + S + > | null; + }, + Error, + PlatformResourceInstallationsRollbackVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformResourceInstallationsRollback: InferSelectResult< + PlatformResourceInstallationsRollbackPayload, + S + > | null; + }, + Error, + PlatformResourceInstallationsRollbackVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformResourceInstallationsRollback(), - mutationFn: (variables: PlatformResourceInstallationsRollbackVariables) => getClient().mutation.platformResourceInstallationsRollback(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformResourceInstallationsRollbackVariables) => + getClient() + .mutation.platformResourceInstallationsRollback(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsUninstallMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsUninstallMutation.ts index ccfa5174c8..672a7ef7c9 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsUninstallMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsUninstallMutation.ts @@ -4,39 +4,63 @@ * 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 { PlatformResourceInstallationsUninstallVariables } from "../../orm/mutation"; -import type { PlatformResourceInstallationsUninstallPayloadSelect, PlatformResourceInstallationsUninstallPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationsUninstallVariables } from "../../orm/mutation"; -export type { PlatformResourceInstallationsUninstallPayloadSelect } from "../../orm/input-types"; -export function usePlatformResourceInstallationsUninstallMutation(params: { - selection: ({ - fields: S & PlatformResourceInstallationsUninstallPayloadSelect; - } & HookStrictSelect, PlatformResourceInstallationsUninstallPayloadSelect>); -} & Omit | null; -}, Error, PlatformResourceInstallationsUninstallVariables>, "mutationFn">): UseMutationResult<{ - platformResourceInstallationsUninstall: InferSelectResult | null; -}, Error, PlatformResourceInstallationsUninstallVariables> { +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 { PlatformResourceInstallationsUninstallVariables } from '../../orm/mutation'; +import type { + PlatformResourceInstallationsUninstallPayloadSelect, + PlatformResourceInstallationsUninstallPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformResourceInstallationsUninstallVariables } from '../../orm/mutation'; +export type { PlatformResourceInstallationsUninstallPayloadSelect } from '../../orm/input-types'; +export function usePlatformResourceInstallationsUninstallMutation< + S extends PlatformResourceInstallationsUninstallPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformResourceInstallationsUninstallPayloadSelect; + } & HookStrictSelect, PlatformResourceInstallationsUninstallPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformResourceInstallationsUninstall: InferSelectResult< + PlatformResourceInstallationsUninstallPayload, + S + > | null; + }, + Error, + PlatformResourceInstallationsUninstallVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformResourceInstallationsUninstall: InferSelectResult< + PlatformResourceInstallationsUninstallPayload, + S + > | null; + }, + Error, + PlatformResourceInstallationsUninstallVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformResourceInstallationsUninstall(), - mutationFn: (variables: PlatformResourceInstallationsUninstallVariables) => getClient().mutation.platformResourceInstallationsUninstall(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformResourceInstallationsUninstallVariables) => + getClient() + .mutation.platformResourceInstallationsUninstall(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsUpgradeMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsUpgradeMutation.ts index f190d726ac..49c430a414 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsUpgradeMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/usePlatformResourceInstallationsUpgradeMutation.ts @@ -4,39 +4,63 @@ * 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 { PlatformResourceInstallationsUpgradeVariables } from "../../orm/mutation"; -import type { PlatformResourceInstallationsUpgradePayloadSelect, PlatformResourceInstallationsUpgradePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationsUpgradeVariables } from "../../orm/mutation"; -export type { PlatformResourceInstallationsUpgradePayloadSelect } from "../../orm/input-types"; -export function usePlatformResourceInstallationsUpgradeMutation(params: { - selection: ({ - fields: S & PlatformResourceInstallationsUpgradePayloadSelect; - } & HookStrictSelect, PlatformResourceInstallationsUpgradePayloadSelect>); -} & Omit | null; -}, Error, PlatformResourceInstallationsUpgradeVariables>, "mutationFn">): UseMutationResult<{ - platformResourceInstallationsUpgrade: InferSelectResult | null; -}, Error, PlatformResourceInstallationsUpgradeVariables> { +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 { PlatformResourceInstallationsUpgradeVariables } from '../../orm/mutation'; +import type { + PlatformResourceInstallationsUpgradePayloadSelect, + PlatformResourceInstallationsUpgradePayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformResourceInstallationsUpgradeVariables } from '../../orm/mutation'; +export type { PlatformResourceInstallationsUpgradePayloadSelect } from '../../orm/input-types'; +export function usePlatformResourceInstallationsUpgradeMutation< + S extends PlatformResourceInstallationsUpgradePayloadSelect, +>( + params: { + selection: { + fields: S & PlatformResourceInstallationsUpgradePayloadSelect; + } & HookStrictSelect, PlatformResourceInstallationsUpgradePayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformResourceInstallationsUpgrade: InferSelectResult< + PlatformResourceInstallationsUpgradePayload, + S + > | null; + }, + Error, + PlatformResourceInstallationsUpgradeVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformResourceInstallationsUpgrade: InferSelectResult< + PlatformResourceInstallationsUpgradePayload, + S + > | null; + }, + Error, + PlatformResourceInstallationsUpgradeVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformResourceInstallationsUpgrade(), - mutationFn: (variables: PlatformResourceInstallationsUpgradeVariables) => getClient().mutation.platformResourceInstallationsUpgrade(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformResourceInstallationsUpgradeVariables) => + getClient() + .mutation.platformResourceInstallationsUpgrade(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsInstallMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsInstallMutation.ts index cf5bc752af..f42cec9f5e 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsInstallMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsInstallMutation.ts @@ -4,39 +4,60 @@ * 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 { ResourceInstallationsInstallVariables } from "../../orm/mutation"; -import type { ResourceInstallationsInstallPayloadSelect, ResourceInstallationsInstallPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationsInstallVariables } from "../../orm/mutation"; -export type { ResourceInstallationsInstallPayloadSelect } from "../../orm/input-types"; -export function useResourceInstallationsInstallMutation(params: { - selection: ({ - fields: S & ResourceInstallationsInstallPayloadSelect; - } & HookStrictSelect, ResourceInstallationsInstallPayloadSelect>); -} & Omit | null; -}, Error, ResourceInstallationsInstallVariables>, "mutationFn">): UseMutationResult<{ - resourceInstallationsInstall: InferSelectResult | null; -}, Error, ResourceInstallationsInstallVariables> { +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 { ResourceInstallationsInstallVariables } from '../../orm/mutation'; +import type { + ResourceInstallationsInstallPayloadSelect, + ResourceInstallationsInstallPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ResourceInstallationsInstallVariables } from '../../orm/mutation'; +export type { ResourceInstallationsInstallPayloadSelect } from '../../orm/input-types'; +export function useResourceInstallationsInstallMutation< + S extends ResourceInstallationsInstallPayloadSelect, +>( + params: { + selection: { + fields: S & ResourceInstallationsInstallPayloadSelect; + } & HookStrictSelect, ResourceInstallationsInstallPayloadSelect>; + } & Omit< + UseMutationOptions< + { + resourceInstallationsInstall: InferSelectResult< + ResourceInstallationsInstallPayload, + S + > | null; + }, + Error, + ResourceInstallationsInstallVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + resourceInstallationsInstall: InferSelectResult | null; + }, + Error, + ResourceInstallationsInstallVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.resourceInstallationsInstall(), - mutationFn: (variables: ResourceInstallationsInstallVariables) => getClient().mutation.resourceInstallationsInstall(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ResourceInstallationsInstallVariables) => + getClient() + .mutation.resourceInstallationsInstall(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsRollbackMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsRollbackMutation.ts index cc0940c33e..fdf9ad9884 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsRollbackMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsRollbackMutation.ts @@ -4,39 +4,63 @@ * 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 { ResourceInstallationsRollbackVariables } from "../../orm/mutation"; -import type { ResourceInstallationsRollbackPayloadSelect, ResourceInstallationsRollbackPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationsRollbackVariables } from "../../orm/mutation"; -export type { ResourceInstallationsRollbackPayloadSelect } from "../../orm/input-types"; -export function useResourceInstallationsRollbackMutation(params: { - selection: ({ - fields: S & ResourceInstallationsRollbackPayloadSelect; - } & HookStrictSelect, ResourceInstallationsRollbackPayloadSelect>); -} & Omit | null; -}, Error, ResourceInstallationsRollbackVariables>, "mutationFn">): UseMutationResult<{ - resourceInstallationsRollback: InferSelectResult | null; -}, Error, ResourceInstallationsRollbackVariables> { +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 { ResourceInstallationsRollbackVariables } from '../../orm/mutation'; +import type { + ResourceInstallationsRollbackPayloadSelect, + ResourceInstallationsRollbackPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ResourceInstallationsRollbackVariables } from '../../orm/mutation'; +export type { ResourceInstallationsRollbackPayloadSelect } from '../../orm/input-types'; +export function useResourceInstallationsRollbackMutation< + S extends ResourceInstallationsRollbackPayloadSelect, +>( + params: { + selection: { + fields: S & ResourceInstallationsRollbackPayloadSelect; + } & HookStrictSelect, ResourceInstallationsRollbackPayloadSelect>; + } & Omit< + UseMutationOptions< + { + resourceInstallationsRollback: InferSelectResult< + ResourceInstallationsRollbackPayload, + S + > | null; + }, + Error, + ResourceInstallationsRollbackVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + resourceInstallationsRollback: InferSelectResult< + ResourceInstallationsRollbackPayload, + S + > | null; + }, + Error, + ResourceInstallationsRollbackVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.resourceInstallationsRollback(), - mutationFn: (variables: ResourceInstallationsRollbackVariables) => getClient().mutation.resourceInstallationsRollback(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ResourceInstallationsRollbackVariables) => + getClient() + .mutation.resourceInstallationsRollback(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsUninstallMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsUninstallMutation.ts index a4799c357e..2cc55a9ff8 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsUninstallMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsUninstallMutation.ts @@ -4,39 +4,63 @@ * 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 { ResourceInstallationsUninstallVariables } from "../../orm/mutation"; -import type { ResourceInstallationsUninstallPayloadSelect, ResourceInstallationsUninstallPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationsUninstallVariables } from "../../orm/mutation"; -export type { ResourceInstallationsUninstallPayloadSelect } from "../../orm/input-types"; -export function useResourceInstallationsUninstallMutation(params: { - selection: ({ - fields: S & ResourceInstallationsUninstallPayloadSelect; - } & HookStrictSelect, ResourceInstallationsUninstallPayloadSelect>); -} & Omit | null; -}, Error, ResourceInstallationsUninstallVariables>, "mutationFn">): UseMutationResult<{ - resourceInstallationsUninstall: InferSelectResult | null; -}, Error, ResourceInstallationsUninstallVariables> { +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 { ResourceInstallationsUninstallVariables } from '../../orm/mutation'; +import type { + ResourceInstallationsUninstallPayloadSelect, + ResourceInstallationsUninstallPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ResourceInstallationsUninstallVariables } from '../../orm/mutation'; +export type { ResourceInstallationsUninstallPayloadSelect } from '../../orm/input-types'; +export function useResourceInstallationsUninstallMutation< + S extends ResourceInstallationsUninstallPayloadSelect, +>( + params: { + selection: { + fields: S & ResourceInstallationsUninstallPayloadSelect; + } & HookStrictSelect, ResourceInstallationsUninstallPayloadSelect>; + } & Omit< + UseMutationOptions< + { + resourceInstallationsUninstall: InferSelectResult< + ResourceInstallationsUninstallPayload, + S + > | null; + }, + Error, + ResourceInstallationsUninstallVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + resourceInstallationsUninstall: InferSelectResult< + ResourceInstallationsUninstallPayload, + S + > | null; + }, + Error, + ResourceInstallationsUninstallVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.resourceInstallationsUninstall(), - mutationFn: (variables: ResourceInstallationsUninstallVariables) => getClient().mutation.resourceInstallationsUninstall(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ResourceInstallationsUninstallVariables) => + getClient() + .mutation.resourceInstallationsUninstall(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsUpgradeMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsUpgradeMutation.ts index f84ff9f94a..f42c0c8f0f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsUpgradeMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useResourceInstallationsUpgradeMutation.ts @@ -4,39 +4,60 @@ * 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 { ResourceInstallationsUpgradeVariables } from "../../orm/mutation"; -import type { ResourceInstallationsUpgradePayloadSelect, ResourceInstallationsUpgradePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationsUpgradeVariables } from "../../orm/mutation"; -export type { ResourceInstallationsUpgradePayloadSelect } from "../../orm/input-types"; -export function useResourceInstallationsUpgradeMutation(params: { - selection: ({ - fields: S & ResourceInstallationsUpgradePayloadSelect; - } & HookStrictSelect, ResourceInstallationsUpgradePayloadSelect>); -} & Omit | null; -}, Error, ResourceInstallationsUpgradeVariables>, "mutationFn">): UseMutationResult<{ - resourceInstallationsUpgrade: InferSelectResult | null; -}, Error, ResourceInstallationsUpgradeVariables> { +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 { ResourceInstallationsUpgradeVariables } from '../../orm/mutation'; +import type { + ResourceInstallationsUpgradePayloadSelect, + ResourceInstallationsUpgradePayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ResourceInstallationsUpgradeVariables } from '../../orm/mutation'; +export type { ResourceInstallationsUpgradePayloadSelect } from '../../orm/input-types'; +export function useResourceInstallationsUpgradeMutation< + S extends ResourceInstallationsUpgradePayloadSelect, +>( + params: { + selection: { + fields: S & ResourceInstallationsUpgradePayloadSelect; + } & HookStrictSelect, ResourceInstallationsUpgradePayloadSelect>; + } & Omit< + UseMutationOptions< + { + resourceInstallationsUpgrade: InferSelectResult< + ResourceInstallationsUpgradePayload, + S + > | null; + }, + Error, + ResourceInstallationsUpgradeVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + resourceInstallationsUpgrade: InferSelectResult | null; + }, + Error, + ResourceInstallationsUpgradeVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.resourceInstallationsUpgrade(), - mutationFn: (variables: ResourceInstallationsUpgradeVariables) => getClient().mutation.resourceInstallationsUpgrade(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ResourceInstallationsUpgradeVariables) => + getClient() + .mutation.resourceInstallationsUpgrade(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useSaveGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useSaveGraphMutation.ts index cebc8186e9..83f1a5d1d8 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useSaveGraphMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useSaveGraphMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { SaveGraphVariables } from "../../orm/mutation"; -import type { SaveGraphPayloadSelect, SaveGraphPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SaveGraphVariables } from "../../orm/mutation"; -export type { SaveGraphPayloadSelect } from "../../orm/input-types"; -export function useSaveGraphMutation(params: { - selection: ({ - fields: S & SaveGraphPayloadSelect; - } & HookStrictSelect, SaveGraphPayloadSelect>); -} & Omit | null; -}, Error, SaveGraphVariables>, "mutationFn">): UseMutationResult<{ - saveGraph: InferSelectResult | null; -}, Error, SaveGraphVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { SaveGraphVariables } from '../../orm/mutation'; +import type { SaveGraphPayloadSelect, SaveGraphPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SaveGraphVariables } from '../../orm/mutation'; +export type { SaveGraphPayloadSelect } from '../../orm/input-types'; +export function useSaveGraphMutation( + params: { + selection: { + fields: S & SaveGraphPayloadSelect; + } & HookStrictSelect, SaveGraphPayloadSelect>; + } & Omit< + UseMutationOptions< + { + saveGraph: InferSelectResult | null; + }, + Error, + SaveGraphVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + saveGraph: InferSelectResult | null; + }, + Error, + SaveGraphVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.saveGraph(), - mutationFn: (variables: SaveGraphVariables) => getClient().mutation.saveGraph(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SaveGraphVariables) => + getClient() + .mutation.saveGraph(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useSetDataAtPathMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useSetDataAtPathMutation.ts index 059f3d68a3..63f39667a0 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useSetDataAtPathMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useSetDataAtPathMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { SetDataAtPathVariables } from "../../orm/mutation"; -import type { SetDataAtPathPayloadSelect, SetDataAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SetDataAtPathVariables } from "../../orm/mutation"; -export type { SetDataAtPathPayloadSelect } from "../../orm/input-types"; -export function useSetDataAtPathMutation(params: { - selection: ({ - fields: S & SetDataAtPathPayloadSelect; - } & HookStrictSelect, SetDataAtPathPayloadSelect>); -} & Omit | null; -}, Error, SetDataAtPathVariables>, "mutationFn">): UseMutationResult<{ - setDataAtPath: InferSelectResult | null; -}, Error, SetDataAtPathVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { SetDataAtPathVariables } from '../../orm/mutation'; +import type { SetDataAtPathPayloadSelect, SetDataAtPathPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SetDataAtPathVariables } from '../../orm/mutation'; +export type { SetDataAtPathPayloadSelect } from '../../orm/input-types'; +export function useSetDataAtPathMutation( + params: { + selection: { + fields: S & SetDataAtPathPayloadSelect; + } & HookStrictSelect, SetDataAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + setDataAtPath: InferSelectResult | null; + }, + Error, + SetDataAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + setDataAtPath: InferSelectResult | null; + }, + Error, + SetDataAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.setDataAtPath(), - mutationFn: (variables: SetDataAtPathVariables) => getClient().mutation.setDataAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SetDataAtPathVariables) => + getClient() + .mutation.setDataAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useStartExecutionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useStartExecutionMutation.ts index 14dc01eb97..04c6c2cbef 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useStartExecutionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useStartExecutionMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { StartExecutionVariables } from "../../orm/mutation"; -import type { StartExecutionPayloadSelect, StartExecutionPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { StartExecutionVariables } from "../../orm/mutation"; -export type { StartExecutionPayloadSelect } from "../../orm/input-types"; -export function useStartExecutionMutation(params: { - selection: ({ - fields: S & StartExecutionPayloadSelect; - } & HookStrictSelect, StartExecutionPayloadSelect>); -} & Omit | null; -}, Error, StartExecutionVariables>, "mutationFn">): UseMutationResult<{ - startExecution: InferSelectResult | null; -}, Error, StartExecutionVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { StartExecutionVariables } from '../../orm/mutation'; +import type { StartExecutionPayloadSelect, StartExecutionPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { StartExecutionVariables } from '../../orm/mutation'; +export type { StartExecutionPayloadSelect } from '../../orm/input-types'; +export function useStartExecutionMutation( + params: { + selection: { + fields: S & StartExecutionPayloadSelect; + } & HookStrictSelect, StartExecutionPayloadSelect>; + } & Omit< + UseMutationOptions< + { + startExecution: InferSelectResult | null; + }, + Error, + StartExecutionVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + startExecution: InferSelectResult | null; + }, + Error, + StartExecutionVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.startExecution(), - mutationFn: (variables: StartExecutionVariables) => getClient().mutation.startExecution(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: StartExecutionVariables) => + getClient() + .mutation.startExecution(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateDbPresetMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateDbPresetMutation.ts index 30128b8bcd..3b7a6edec2 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateDbPresetMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateDbPresetMutation.ts @@ -4,83 +4,99 @@ * 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 { dbPresetKeys } from "../query-keys"; -import { dbPresetMutationKeys } from "../mutation-keys"; -import type { DbPresetSelect, DbPresetWithRelations, DbPresetPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations, DbPresetPatch } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import { dbPresetMutationKeys } from '../mutation-keys'; +import type { DbPresetSelect, DbPresetWithRelations, DbPresetPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPresetSelect, DbPresetWithRelations, DbPresetPatch } from '../../orm/input-types'; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDbPresetMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', dbPresetPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDbPresetMutation(params: { - selection: ({ - fields: S & DbPresetSelect; - } & HookStrictSelect, DbPresetSelect>); -} & Omit; - }; -}, Error, { - id: string; - dbPresetPatch: DbPresetPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDbPreset: { - dbPreset: InferSelectResult; - }; -}, Error, { - id: string; - dbPresetPatch: DbPresetPatch; -}>; -export function useUpdateDbPresetMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDbPresetMutation( + params: { + selection: { + fields: S & DbPresetSelect; + } & HookStrictSelect, DbPresetSelect>; + } & Omit< + UseMutationOptions< + { + updateDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPresetPatch: DbPresetPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPresetPatch: DbPresetPatch; + } +>; +export function useUpdateDbPresetMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + dbPresetPatch: DbPresetPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetMutationKeys.all, - mutationFn: ({ - id, - dbPresetPatch - }: { - id: string; - dbPresetPatch: DbPresetPatch; - }) => getClient().dbPreset.update({ - where: { - id - }, - data: dbPresetPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, dbPresetPatch }: { id: string; dbPresetPatch: DbPresetPatch }) => + getClient() + .dbPreset.update({ + where: { + id, + }, + data: dbPresetPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: dbPresetKeys.detail(variables.id) + queryKey: dbPresetKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPresetKeys.lists() + queryKey: dbPresetKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionApiBindingMutation.ts index fbe3495a24..22b65cd5ff 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionApiBindingMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionApiBindingMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionApiBindingKeys } from "../query-keys"; -import { functionApiBindingMutationKeys } from "../mutation-keys"; -import type { FunctionApiBindingSelect, FunctionApiBindingWithRelations, FunctionApiBindingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionApiBindingSelect, FunctionApiBindingWithRelations, FunctionApiBindingPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import { functionApiBindingMutationKeys } from '../mutation-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + FunctionApiBindingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + FunctionApiBindingPatch, +} from '../../orm/input-types'; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionApiBindingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionApiBindingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionApiBindingMutation(params: { - selection: ({ - fields: S & FunctionApiBindingSelect; - } & HookStrictSelect, FunctionApiBindingSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionApiBindingPatch: FunctionApiBindingPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionApiBinding: { - functionApiBinding: InferSelectResult; - }; -}, Error, { - id: string; - functionApiBindingPatch: FunctionApiBindingPatch; -}>; -export function useUpdateFunctionApiBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionApiBindingMutation( + params: { + selection: { + fields: S & FunctionApiBindingSelect; + } & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; + } +>; +export function useUpdateFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionApiBindingMutationKeys.all, mutationFn: ({ id, - functionApiBindingPatch + functionApiBindingPatch, }: { id: string; functionApiBindingPatch: FunctionApiBindingPatch; - }) => getClient().functionApiBinding.update({ - where: { - id - }, - data: functionApiBindingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionApiBinding.update({ + where: { + id, + }, + data: functionApiBindingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionApiBindingKeys.detail(variables.id) + queryKey: functionApiBindingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionApiBindingKeys.lists() + queryKey: functionApiBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDefinitionMutation.ts index 4fd59d1650..948cd642cc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDefinitionMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDefinitionKeys } from "../query-keys"; -import { functionDefinitionMutationKeys } from "../mutation-keys"; -import type { FunctionDefinitionSelect, FunctionDefinitionWithRelations, FunctionDefinitionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDefinitionSelect, FunctionDefinitionWithRelations, FunctionDefinitionPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import { functionDefinitionMutationKeys } from '../mutation-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + FunctionDefinitionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + FunctionDefinitionPatch, +} from '../../orm/input-types'; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionDefinitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionDefinitionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionDefinitionMutation(params: { - selection: ({ - fields: S & FunctionDefinitionSelect; - } & HookStrictSelect, FunctionDefinitionSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionDefinitionPatch: FunctionDefinitionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionDefinition: { - functionDefinition: InferSelectResult; - }; -}, Error, { - id: string; - functionDefinitionPatch: FunctionDefinitionPatch; -}>; -export function useUpdateFunctionDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionDefinitionMutation( + params: { + selection: { + fields: S & FunctionDefinitionSelect; + } & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; + } +>; +export function useUpdateFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDefinitionMutationKeys.all, mutationFn: ({ id, - functionDefinitionPatch + functionDefinitionPatch, }: { id: string; functionDefinitionPatch: FunctionDefinitionPatch; - }) => getClient().functionDefinition.update({ - where: { - id - }, - data: functionDefinitionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionDefinition.update({ + where: { + id, + }, + data: functionDefinitionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionDefinitionKeys.detail(variables.id) + queryKey: functionDefinitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionDefinitionKeys.lists() + queryKey: functionDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentEventMutation.ts index 2304a50b5b..7ff147d922 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentEventMutation.ts @@ -4,61 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentEventKeys } from "../query-keys"; -import { functionDeploymentEventMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations, FunctionDeploymentEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations, FunctionDeploymentEventPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import { functionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventPatch, +} from '../../orm/input-types'; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionDeploymentEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionDeploymentEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionDeploymentEventMutation(params: { - selection: ({ - fields: S & FunctionDeploymentEventSelect; - } & HookStrictSelect, FunctionDeploymentEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - functionDeploymentEventPatch: FunctionDeploymentEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionDeploymentEvent: { - functionDeploymentEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - functionDeploymentEventPatch: FunctionDeploymentEventPatch; -}>; -export function useUpdateFunctionDeploymentEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionDeploymentEventMutation( + params: { + selection: { + fields: S & FunctionDeploymentEventSelect; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; + } +>; +export function useUpdateFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateFunctionDeploymentEventMutation(params: { mutationFn: ({ id, createdAt, - functionDeploymentEventPatch + functionDeploymentEventPatch, }: { id: string; createdAt: string; functionDeploymentEventPatch: FunctionDeploymentEventPatch; - }) => getClient().functionDeploymentEvent.update({ - where: { - id, - createdAt - }, - data: functionDeploymentEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionDeploymentEvent.update({ + where: { + id, + createdAt, + }, + data: functionDeploymentEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionDeploymentEventKeys.detail(variables.id) + queryKey: functionDeploymentEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionDeploymentEventKeys.lists() + queryKey: functionDeploymentEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentMutation.ts index ff1e688d6d..a3ca7c8bca 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentKeys } from "../query-keys"; -import { functionDeploymentMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentSelect, FunctionDeploymentWithRelations, FunctionDeploymentPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentSelect, FunctionDeploymentWithRelations, FunctionDeploymentPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import { functionDeploymentMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + FunctionDeploymentPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + FunctionDeploymentPatch, +} from '../../orm/input-types'; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionDeploymentMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionDeploymentPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionDeploymentMutation(params: { - selection: ({ - fields: S & FunctionDeploymentSelect; - } & HookStrictSelect, FunctionDeploymentSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionDeploymentPatch: FunctionDeploymentPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionDeployment: { - functionDeployment: InferSelectResult; - }; -}, Error, { - id: string; - functionDeploymentPatch: FunctionDeploymentPatch; -}>; -export function useUpdateFunctionDeploymentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionDeploymentMutation( + params: { + selection: { + fields: S & FunctionDeploymentSelect; + } & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; + } +>; +export function useUpdateFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDeploymentMutationKeys.all, mutationFn: ({ id, - functionDeploymentPatch + functionDeploymentPatch, }: { id: string; functionDeploymentPatch: FunctionDeploymentPatch; - }) => getClient().functionDeployment.update({ - where: { - id - }, - data: functionDeploymentPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionDeployment.update({ + where: { + id, + }, + data: functionDeploymentPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionDeploymentKeys.detail(variables.id) + queryKey: functionDeploymentKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionDeploymentKeys.lists() + queryKey: functionDeploymentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionExecutionLogMutation.ts index 895477a01b..98d04bfe4f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionExecutionLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionExecutionLogMutation.ts @@ -4,61 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionExecutionLogKeys } from "../query-keys"; -import { functionExecutionLogMutationKeys } from "../mutation-keys"; -import type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations, FunctionExecutionLogPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations, FunctionExecutionLogPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import { functionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + FunctionExecutionLogPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + FunctionExecutionLogPatch, +} from '../../orm/input-types'; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionExecutionLogMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionExecutionLogPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionExecutionLogMutation(params: { - selection: ({ - fields: S & FunctionExecutionLogSelect; - } & HookStrictSelect, FunctionExecutionLogSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - functionExecutionLogPatch: FunctionExecutionLogPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionExecutionLog: { - functionExecutionLog: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - functionExecutionLogPatch: FunctionExecutionLogPatch; -}>; -export function useUpdateFunctionExecutionLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionExecutionLogMutation( + params: { + selection: { + fields: S & FunctionExecutionLogSelect; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; + } +>; +export function useUpdateFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateFunctionExecutionLogMutation(params: { mutationFn: ({ id, createdAt, - functionExecutionLogPatch + functionExecutionLogPatch, }: { id: string; createdAt: string; functionExecutionLogPatch: FunctionExecutionLogPatch; - }) => getClient().functionExecutionLog.update({ - where: { - id, - createdAt - }, - data: functionExecutionLogPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionExecutionLog.update({ + where: { + id, + createdAt, + }, + data: functionExecutionLogPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionExecutionLogKeys.detail(variables.id) + queryKey: functionExecutionLogKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionExecutionLogKeys.lists() + queryKey: functionExecutionLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphCommitMutation.ts index 164cbfa11c..6b71ec04ea 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphCommitMutation.ts @@ -4,61 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphCommitKeys } from "../query-keys"; -import { functionGraphCommitMutationKeys } from "../mutation-keys"; -import type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations, FunctionGraphCommitPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations, FunctionGraphCommitPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import { functionGraphCommitMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + FunctionGraphCommitPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + FunctionGraphCommitPatch, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionGraphCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionGraphCommitPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionGraphCommitMutation(params: { - selection: ({ - fields: S & FunctionGraphCommitSelect; - } & HookStrictSelect, FunctionGraphCommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - functionGraphCommitPatch: FunctionGraphCommitPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionGraphCommit: { - functionGraphCommit: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - functionGraphCommitPatch: FunctionGraphCommitPatch; -}>; -export function useUpdateFunctionGraphCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionGraphCommitMutation( + params: { + selection: { + fields: S & FunctionGraphCommitSelect; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; + } +>; +export function useUpdateFunctionGraphCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateFunctionGraphCommitMutation(params: { mutationFn: ({ id, scopeId, - functionGraphCommitPatch + functionGraphCommitPatch, }: { id: string; scopeId: string; functionGraphCommitPatch: FunctionGraphCommitPatch; - }) => getClient().functionGraphCommit.update({ - where: { - id, - scopeId - }, - data: functionGraphCommitPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionGraphCommit.update({ + where: { + id, + scopeId, + }, + data: functionGraphCommitPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionGraphCommitKeys.detail(variables.id) + queryKey: functionGraphCommitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphCommitKeys.lists() + queryKey: functionGraphCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionMutation.ts index 73632da52e..f01629e070 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionMutation.ts @@ -4,61 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionKeys } from "../query-keys"; -import { functionGraphExecutionMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations, FunctionGraphExecutionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations, FunctionGraphExecutionPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import { functionGraphExecutionMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionPatch, +} from '../../orm/input-types'; /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionGraphExecutionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionGraphExecutionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionGraphExecutionMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionSelect; - } & HookStrictSelect, FunctionGraphExecutionSelect>); -} & Omit; - }; -}, Error, { - id: string; - startedAt: string; - functionGraphExecutionPatch: FunctionGraphExecutionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionGraphExecution: { - functionGraphExecution: InferSelectResult; - }; -}, Error, { - id: string; - startedAt: string; - functionGraphExecutionPatch: FunctionGraphExecutionPatch; -}>; -export function useUpdateFunctionGraphExecutionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionGraphExecutionMutation( + params: { + selection: { + fields: S & FunctionGraphExecutionSelect; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + { + id: string; + startedAt: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + { + id: string; + startedAt: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; + } +>; +export function useUpdateFunctionGraphExecutionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + startedAt: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateFunctionGraphExecutionMutation(params: { mutationFn: ({ id, startedAt, - functionGraphExecutionPatch + functionGraphExecutionPatch, }: { id: string; startedAt: string; functionGraphExecutionPatch: FunctionGraphExecutionPatch; - }) => getClient().functionGraphExecution.update({ - where: { - id, - startedAt - }, - data: functionGraphExecutionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionGraphExecution.update({ + where: { + id, + startedAt, + }, + data: functionGraphExecutionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionGraphExecutionKeys.detail(variables.id) + queryKey: functionGraphExecutionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphExecutionKeys.lists() + queryKey: functionGraphExecutionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionNodeStateMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionNodeStateMutation.ts index a5f00e1843..d3ab51e70f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionNodeStateMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionNodeStateMutation.ts @@ -4,61 +4,96 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionNodeStateKeys } from "../query-keys"; -import { functionGraphExecutionNodeStateMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStatePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStatePatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import { functionGraphExecutionNodeStateMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStatePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStatePatch, +} from '../../orm/input-types'; /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionGraphExecutionNodeStateMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionGraphExecutionNodeStatePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionGraphExecutionNodeStateMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionNodeStateSelect; - } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; -}>; -export function useUpdateFunctionGraphExecutionNodeStateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionGraphExecutionNodeStateMutation< + S extends FunctionGraphExecutionNodeStateSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionNodeStateSelect; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; + } +>; +export function useUpdateFunctionGraphExecutionNodeStateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +101,30 @@ export function useUpdateFunctionGraphExecutionNodeStateMutation(params: { mutationFn: ({ id, createdAt, - functionGraphExecutionNodeStatePatch + functionGraphExecutionNodeStatePatch, }: { id: string; createdAt: string; functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; - }) => getClient().functionGraphExecutionNodeState.update({ - where: { - id, - createdAt - }, - data: functionGraphExecutionNodeStatePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionGraphExecutionNodeState.update({ + where: { + id, + createdAt, + }, + data: functionGraphExecutionNodeStatePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.detail(variables.id) + queryKey: functionGraphExecutionNodeStateKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.lists() + queryKey: functionGraphExecutionNodeStateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionOutputMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionOutputMutation.ts index fc7cf007fc..3ac4ce3664 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionOutputMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionOutputMutation.ts @@ -4,61 +4,93 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionOutputKeys } from "../query-keys"; -import { functionGraphExecutionOutputMutationKeys } from "../mutation-keys"; -import type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations, FunctionGraphExecutionOutputPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations, FunctionGraphExecutionOutputPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import { functionGraphExecutionOutputMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputPatch, +} from '../../orm/input-types'; /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionGraphExecutionOutputMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionGraphExecutionOutputPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionGraphExecutionOutputMutation(params: { - selection: ({ - fields: S & FunctionGraphExecutionOutputSelect; - } & HookStrictSelect, FunctionGraphExecutionOutputSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionGraphExecutionOutput: { - functionGraphExecutionOutput: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; -}>; -export function useUpdateFunctionGraphExecutionOutputMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionGraphExecutionOutputMutation< + S extends FunctionGraphExecutionOutputSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionOutputSelect; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; + } +>; +export function useUpdateFunctionGraphExecutionOutputMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +98,30 @@ export function useUpdateFunctionGraphExecutionOutputMutation(params: { mutationFn: ({ id, createdAt, - functionGraphExecutionOutputPatch + functionGraphExecutionOutputPatch, }: { id: string; createdAt: string; functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; - }) => getClient().functionGraphExecutionOutput.update({ - where: { - id, - createdAt - }, - data: functionGraphExecutionOutputPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionGraphExecutionOutput.update({ + where: { + id, + createdAt, + }, + data: functionGraphExecutionOutputPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionGraphExecutionOutputKeys.detail(variables.id) + queryKey: functionGraphExecutionOutputKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphExecutionOutputKeys.lists() + queryKey: functionGraphExecutionOutputKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphMutation.ts index 3b45437db6..149459636f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphKeys } from "../query-keys"; -import { functionGraphMutationKeys } from "../mutation-keys"; -import type { FunctionGraphSelect, FunctionGraphWithRelations, FunctionGraphPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphSelect, FunctionGraphWithRelations, FunctionGraphPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import { functionGraphMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphSelect, + FunctionGraphWithRelations, + FunctionGraphPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphSelect, + FunctionGraphWithRelations, + FunctionGraphPatch, +} from '../../orm/input-types'; /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionGraphMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionGraphPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionGraphMutation(params: { - selection: ({ - fields: S & FunctionGraphSelect; - } & HookStrictSelect, FunctionGraphSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionGraphPatch: FunctionGraphPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionGraph: { - functionGraph: InferSelectResult; - }; -}, Error, { - id: string; - functionGraphPatch: FunctionGraphPatch; -}>; -export function useUpdateFunctionGraphMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionGraphMutation( + params: { + selection: { + fields: S & FunctionGraphSelect; + } & HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + { + id: string; + functionGraphPatch: FunctionGraphPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + { + id: string; + functionGraphPatch: FunctionGraphPatch; + } +>; +export function useUpdateFunctionGraphMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionGraphPatch: FunctionGraphPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphMutationKeys.all, mutationFn: ({ id, - functionGraphPatch + functionGraphPatch, }: { id: string; functionGraphPatch: FunctionGraphPatch; - }) => getClient().functionGraph.update({ - where: { - id - }, - data: functionGraphPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionGraph.update({ + where: { + id, + }, + data: functionGraphPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionGraphKeys.detail(variables.id) + queryKey: functionGraphKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphKeys.lists() + queryKey: functionGraphKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphObjectMutation.ts index 6289be92fe..b81861d8e1 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphObjectMutation.ts @@ -4,61 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphObjectKeys } from "../query-keys"; -import { functionGraphObjectMutationKeys } from "../mutation-keys"; -import type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations, FunctionGraphObjectPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations, FunctionGraphObjectPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import { functionGraphObjectMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + FunctionGraphObjectPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + FunctionGraphObjectPatch, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionGraphObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionGraphObjectPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionGraphObjectMutation(params: { - selection: ({ - fields: S & FunctionGraphObjectSelect; - } & HookStrictSelect, FunctionGraphObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - functionGraphObjectPatch: FunctionGraphObjectPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionGraphObject: { - functionGraphObject: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - functionGraphObjectPatch: FunctionGraphObjectPatch; -}>; -export function useUpdateFunctionGraphObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionGraphObjectMutation( + params: { + selection: { + fields: S & FunctionGraphObjectSelect; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; + } +>; +export function useUpdateFunctionGraphObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateFunctionGraphObjectMutation(params: { mutationFn: ({ id, scopeId, - functionGraphObjectPatch + functionGraphObjectPatch, }: { id: string; scopeId: string; functionGraphObjectPatch: FunctionGraphObjectPatch; - }) => getClient().functionGraphObject.update({ - where: { - id, - scopeId - }, - data: functionGraphObjectPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionGraphObject.update({ + where: { + id, + scopeId, + }, + data: functionGraphObjectPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionGraphObjectKeys.detail(variables.id) + queryKey: functionGraphObjectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphObjectKeys.lists() + queryKey: functionGraphObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphRefMutation.ts index f8bb9bac0a..2baf1e74c0 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphRefMutation.ts @@ -4,61 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphRefKeys } from "../query-keys"; -import { functionGraphRefMutationKeys } from "../mutation-keys"; -import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations, FunctionGraphRefPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations, FunctionGraphRefPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import { functionGraphRefMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + FunctionGraphRefPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + FunctionGraphRefPatch, +} from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionGraphRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionGraphRefPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionGraphRefMutation(params: { - selection: ({ - fields: S & FunctionGraphRefSelect; - } & HookStrictSelect, FunctionGraphRefSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - functionGraphRefPatch: FunctionGraphRefPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionGraphRef: { - functionGraphRef: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - functionGraphRefPatch: FunctionGraphRefPatch; -}>; -export function useUpdateFunctionGraphRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionGraphRefMutation( + params: { + selection: { + fields: S & FunctionGraphRefSelect; + } & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + functionGraphRefPatch: FunctionGraphRefPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + functionGraphRefPatch: FunctionGraphRefPatch; + } +>; +export function useUpdateFunctionGraphRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + functionGraphRefPatch: FunctionGraphRefPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateFunctionGraphRefMutation(params: { mutationFn: ({ id, scopeId, - functionGraphRefPatch + functionGraphRefPatch, }: { id: string; scopeId: string; functionGraphRefPatch: FunctionGraphRefPatch; - }) => getClient().functionGraphRef.update({ - where: { - id, - scopeId - }, - data: functionGraphRefPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionGraphRef.update({ + where: { + id, + scopeId, + }, + data: functionGraphRefPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionGraphRefKeys.detail(variables.id) + queryKey: functionGraphRefKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphRefKeys.lists() + queryKey: functionGraphRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphStoreMutation.ts index 16c8b0d78b..5f57880f0a 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphStoreMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphStoreKeys } from "../query-keys"; -import { functionGraphStoreMutationKeys } from "../mutation-keys"; -import type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations, FunctionGraphStorePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations, FunctionGraphStorePatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import { functionGraphStoreMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + FunctionGraphStorePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + FunctionGraphStorePatch, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionGraphStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionGraphStorePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionGraphStoreMutation(params: { - selection: ({ - fields: S & FunctionGraphStoreSelect; - } & HookStrictSelect, FunctionGraphStoreSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionGraphStorePatch: FunctionGraphStorePatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionGraphStore: { - functionGraphStore: InferSelectResult; - }; -}, Error, { - id: string; - functionGraphStorePatch: FunctionGraphStorePatch; -}>; -export function useUpdateFunctionGraphStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionGraphStoreMutation( + params: { + selection: { + fields: S & FunctionGraphStoreSelect; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + { + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + { + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; + } +>; +export function useUpdateFunctionGraphStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionGraphStoreMutationKeys.all, mutationFn: ({ id, - functionGraphStorePatch + functionGraphStorePatch, }: { id: string; functionGraphStorePatch: FunctionGraphStorePatch; - }) => getClient().functionGraphStore.update({ - where: { - id - }, - data: functionGraphStorePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionGraphStore.update({ + where: { + id, + }, + data: functionGraphStorePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionGraphStoreKeys.detail(variables.id) + queryKey: functionGraphStoreKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionGraphStoreKeys.lists() + queryKey: functionGraphStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationAttemptMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationAttemptMutation.ts index d964d474c2..72cdffbcac 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationAttemptMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationAttemptMutation.ts @@ -4,61 +4,90 @@ * 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 { functionInvocationAttemptKeys } from "../query-keys"; -import { functionInvocationAttemptMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations, FunctionInvocationAttemptPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations, FunctionInvocationAttemptPatch } from "../../orm/input-types"; +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 { functionInvocationAttemptKeys } from '../query-keys'; +import { functionInvocationAttemptMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, + FunctionInvocationAttemptPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, + FunctionInvocationAttemptPatch, +} from '../../orm/input-types'; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionInvocationAttemptMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionInvocationAttemptPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionInvocationAttemptMutation(params: { - selection: ({ - fields: S & FunctionInvocationAttemptSelect; - } & HookStrictSelect, FunctionInvocationAttemptSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - functionInvocationAttemptPatch: FunctionInvocationAttemptPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionInvocationAttempt: { - functionInvocationAttempt: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - functionInvocationAttemptPatch: FunctionInvocationAttemptPatch; -}>; -export function useUpdateFunctionInvocationAttemptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionInvocationAttemptMutation< + S extends FunctionInvocationAttemptSelect, +>( + params: { + selection: { + fields: S & FunctionInvocationAttemptSelect; + } & HookStrictSelect, FunctionInvocationAttemptSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionInvocationAttempt: { + functionInvocationAttempt: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionInvocationAttemptPatch: FunctionInvocationAttemptPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionInvocationAttempt: { + functionInvocationAttempt: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionInvocationAttemptPatch: FunctionInvocationAttemptPatch; + } +>; +export function useUpdateFunctionInvocationAttemptMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionInvocationAttemptPatch: FunctionInvocationAttemptPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +95,30 @@ export function useUpdateFunctionInvocationAttemptMutation(params: { mutationFn: ({ id, createdAt, - functionInvocationAttemptPatch + functionInvocationAttemptPatch, }: { id: string; createdAt: string; functionInvocationAttemptPatch: FunctionInvocationAttemptPatch; - }) => getClient().functionInvocationAttempt.update({ - where: { - id, - createdAt - }, - data: functionInvocationAttemptPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionInvocationAttempt.update({ + where: { + id, + createdAt, + }, + data: functionInvocationAttemptPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionInvocationAttemptKeys.detail(variables.id) + queryKey: functionInvocationAttemptKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionInvocationAttemptKeys.lists() + queryKey: functionInvocationAttemptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationMutation.ts index 7badba5565..eba1c15957 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationMutation.ts @@ -4,61 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionInvocationKeys } from "../query-keys"; -import { functionInvocationMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationSelect, FunctionInvocationWithRelations, FunctionInvocationPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationSelect, FunctionInvocationWithRelations, FunctionInvocationPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import { functionInvocationMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + FunctionInvocationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + FunctionInvocationPatch, +} from '../../orm/input-types'; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionInvocationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionInvocationPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionInvocationMutation(params: { - selection: ({ - fields: S & FunctionInvocationSelect; - } & HookStrictSelect, FunctionInvocationSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - functionInvocationPatch: FunctionInvocationPatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionInvocation: { - functionInvocation: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - functionInvocationPatch: FunctionInvocationPatch; -}>; -export function useUpdateFunctionInvocationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionInvocationMutation( + params: { + selection: { + fields: S & FunctionInvocationSelect; + } & HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionInvocationPatch: FunctionInvocationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionInvocationPatch: FunctionInvocationPatch; + } +>; +export function useUpdateFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionInvocationPatch: FunctionInvocationPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateFunctionInvocationMutation(params: { mutationFn: ({ id, createdAt, - functionInvocationPatch + functionInvocationPatch, }: { id: string; createdAt: string; functionInvocationPatch: FunctionInvocationPatch; - }) => getClient().functionInvocation.update({ - where: { - id, - createdAt - }, - data: functionInvocationPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionInvocation.update({ + where: { + id, + createdAt, + }, + data: functionInvocationPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionInvocationKeys.detail(variables.id) + queryKey: functionInvocationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionInvocationKeys.lists() + queryKey: functionInvocationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraCommitMutation.ts index cc78546b61..bd760f8de4 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraCommitMutation.ts @@ -4,61 +4,88 @@ * 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 { infraCommitKeys } from "../query-keys"; -import { infraCommitMutationKeys } from "../mutation-keys"; -import type { InfraCommitSelect, InfraCommitWithRelations, InfraCommitPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraCommitSelect, InfraCommitWithRelations, InfraCommitPatch } from "../../orm/input-types"; +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 { infraCommitKeys } from '../query-keys'; +import { infraCommitMutationKeys } from '../mutation-keys'; +import type { + InfraCommitSelect, + InfraCommitWithRelations, + InfraCommitPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraCommitSelect, + InfraCommitWithRelations, + InfraCommitPatch, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInfraCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', infraCommitPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInfraCommitMutation(params: { - selection: ({ - fields: S & InfraCommitSelect; - } & HookStrictSelect, InfraCommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; - infraCommitPatch: InfraCommitPatch; -}>, "mutationFn">): UseMutationResult<{ - updateInfraCommit: { - infraCommit: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; - infraCommitPatch: InfraCommitPatch; -}>; -export function useUpdateInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInfraCommitMutation( + params: { + selection: { + fields: S & InfraCommitSelect; + } & HookStrictSelect, InfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + updateInfraCommit: { + infraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + infraCommitPatch: InfraCommitPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInfraCommit: { + infraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + infraCommitPatch: InfraCommitPatch; + } +>; +export function useUpdateInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + infraCommitPatch: InfraCommitPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateInfraCommitMutation(params: { mutationFn: ({ id, databaseId, - infraCommitPatch + infraCommitPatch, }: { id: string; databaseId: string; infraCommitPatch: InfraCommitPatch; - }) => getClient().infraCommit.update({ - where: { - id, - databaseId - }, - data: infraCommitPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .infraCommit.update({ + where: { + id, + databaseId, + }, + data: infraCommitPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: infraCommitKeys.detail(variables.id) + queryKey: infraCommitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraCommitKeys.lists() + queryKey: infraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraObjectMutation.ts index 1c5105fc8e..18ea5ff54e 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraObjectMutation.ts @@ -4,61 +4,88 @@ * 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 { infraObjectKeys } from "../query-keys"; -import { infraObjectMutationKeys } from "../mutation-keys"; -import type { InfraObjectSelect, InfraObjectWithRelations, InfraObjectPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraObjectSelect, InfraObjectWithRelations, InfraObjectPatch } from "../../orm/input-types"; +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 { infraObjectKeys } from '../query-keys'; +import { infraObjectMutationKeys } from '../mutation-keys'; +import type { + InfraObjectSelect, + InfraObjectWithRelations, + InfraObjectPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraObjectSelect, + InfraObjectWithRelations, + InfraObjectPatch, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInfraObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', infraObjectPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInfraObjectMutation(params: { - selection: ({ - fields: S & InfraObjectSelect; - } & HookStrictSelect, InfraObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; - infraObjectPatch: InfraObjectPatch; -}>, "mutationFn">): UseMutationResult<{ - updateInfraObject: { - infraObject: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; - infraObjectPatch: InfraObjectPatch; -}>; -export function useUpdateInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInfraObjectMutation( + params: { + selection: { + fields: S & InfraObjectSelect; + } & HookStrictSelect, InfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + updateInfraObject: { + infraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + infraObjectPatch: InfraObjectPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInfraObject: { + infraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + infraObjectPatch: InfraObjectPatch; + } +>; +export function useUpdateInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + infraObjectPatch: InfraObjectPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateInfraObjectMutation(params: { mutationFn: ({ id, databaseId, - infraObjectPatch + infraObjectPatch, }: { id: string; databaseId: string; infraObjectPatch: InfraObjectPatch; - }) => getClient().infraObject.update({ - where: { - id, - databaseId - }, - data: infraObjectPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .infraObject.update({ + where: { + id, + databaseId, + }, + data: infraObjectPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: infraObjectKeys.detail(variables.id) + queryKey: infraObjectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraObjectKeys.lists() + queryKey: infraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraRefMutation.ts index 4ec1661767..bce4ac1f35 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraRefMutation.ts @@ -4,61 +4,80 @@ * 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 { infraRefKeys } from "../query-keys"; -import { infraRefMutationKeys } from "../mutation-keys"; -import type { InfraRefSelect, InfraRefWithRelations, InfraRefPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraRefSelect, InfraRefWithRelations, InfraRefPatch } from "../../orm/input-types"; +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 { infraRefKeys } from '../query-keys'; +import { infraRefMutationKeys } from '../mutation-keys'; +import type { InfraRefSelect, InfraRefWithRelations, InfraRefPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraRefSelect, InfraRefWithRelations, InfraRefPatch } from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInfraRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', infraRefPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInfraRefMutation(params: { - selection: ({ - fields: S & InfraRefSelect; - } & HookStrictSelect, InfraRefSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; - infraRefPatch: InfraRefPatch; -}>, "mutationFn">): UseMutationResult<{ - updateInfraRef: { - infraRef: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; - infraRefPatch: InfraRefPatch; -}>; -export function useUpdateInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInfraRefMutation( + params: { + selection: { + fields: S & InfraRefSelect; + } & HookStrictSelect, InfraRefSelect>; + } & Omit< + UseMutationOptions< + { + updateInfraRef: { + infraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + infraRefPatch: InfraRefPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInfraRef: { + infraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + infraRefPatch: InfraRefPatch; + } +>; +export function useUpdateInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + infraRefPatch: InfraRefPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +85,30 @@ export function useUpdateInfraRefMutation(params: { mutationFn: ({ id, databaseId, - infraRefPatch + infraRefPatch, }: { id: string; databaseId: string; infraRefPatch: InfraRefPatch; - }) => getClient().infraRef.update({ - where: { - id, - databaseId - }, - data: infraRefPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .infraRef.update({ + where: { + id, + databaseId, + }, + data: infraRefPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: infraRefKeys.detail(variables.id) + queryKey: infraRefKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraRefKeys.lists() + queryKey: infraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraStoreMutation.ts index c83bfc358a..997f8014cb 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateInfraStoreMutation.ts @@ -4,83 +4,107 @@ * 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 { infraStoreKeys } from "../query-keys"; -import { infraStoreMutationKeys } from "../mutation-keys"; -import type { InfraStoreSelect, InfraStoreWithRelations, InfraStorePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraStoreSelect, InfraStoreWithRelations, InfraStorePatch } from "../../orm/input-types"; +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 { infraStoreKeys } from '../query-keys'; +import { infraStoreMutationKeys } from '../mutation-keys'; +import type { + InfraStoreSelect, + InfraStoreWithRelations, + InfraStorePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraStoreSelect, + InfraStoreWithRelations, + InfraStorePatch, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInfraStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', infraStorePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInfraStoreMutation(params: { - selection: ({ - fields: S & InfraStoreSelect; - } & HookStrictSelect, InfraStoreSelect>); -} & Omit; - }; -}, Error, { - id: string; - infraStorePatch: InfraStorePatch; -}>, "mutationFn">): UseMutationResult<{ - updateInfraStore: { - infraStore: InferSelectResult; - }; -}, Error, { - id: string; - infraStorePatch: InfraStorePatch; -}>; -export function useUpdateInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInfraStoreMutation( + params: { + selection: { + fields: S & InfraStoreSelect; + } & HookStrictSelect, InfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + updateInfraStore: { + infraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + infraStorePatch: InfraStorePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInfraStore: { + infraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + infraStorePatch: InfraStorePatch; + } +>; +export function useUpdateInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + infraStorePatch: InfraStorePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraStoreMutationKeys.all, - mutationFn: ({ - id, - infraStorePatch - }: { - id: string; - infraStorePatch: InfraStorePatch; - }) => getClient().infraStore.update({ - where: { - id - }, - data: infraStorePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, infraStorePatch }: { id: string; infraStorePatch: InfraStorePatch }) => + getClient() + .infraStore.update({ + where: { + id, + }, + data: infraStorePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: infraStoreKeys.detail(variables.id) + queryKey: infraStoreKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraStoreKeys.lists() + queryKey: infraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateIntegrationProviderMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateIntegrationProviderMutation.ts index 71abb4f49b..ba8a8dbcc2 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateIntegrationProviderMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateIntegrationProviderMutation.ts @@ -4,83 +4,113 @@ * 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 { integrationProviderKeys } from "../query-keys"; -import { integrationProviderMutationKeys } from "../mutation-keys"; -import type { IntegrationProviderSelect, IntegrationProviderWithRelations, IntegrationProviderPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProviderSelect, IntegrationProviderWithRelations, IntegrationProviderPatch } from "../../orm/input-types"; +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 { integrationProviderKeys } from '../query-keys'; +import { integrationProviderMutationKeys } from '../mutation-keys'; +import type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, + IntegrationProviderPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, + IntegrationProviderPatch, +} from '../../orm/input-types'; /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateIntegrationProviderMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', integrationProviderPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateIntegrationProviderMutation(params: { - selection: ({ - fields: S & IntegrationProviderSelect; - } & HookStrictSelect, IntegrationProviderSelect>); -} & Omit; - }; -}, Error, { - id: string; - integrationProviderPatch: IntegrationProviderPatch; -}>, "mutationFn">): UseMutationResult<{ - updateIntegrationProvider: { - integrationProvider: InferSelectResult; - }; -}, Error, { - id: string; - integrationProviderPatch: IntegrationProviderPatch; -}>; -export function useUpdateIntegrationProviderMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateIntegrationProviderMutation( + params: { + selection: { + fields: S & IntegrationProviderSelect; + } & HookStrictSelect, IntegrationProviderSelect>; + } & Omit< + UseMutationOptions< + { + updateIntegrationProvider: { + integrationProvider: InferSelectResult; + }; + }, + Error, + { + id: string; + integrationProviderPatch: IntegrationProviderPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateIntegrationProvider: { + integrationProvider: InferSelectResult; + }; + }, + Error, + { + id: string; + integrationProviderPatch: IntegrationProviderPatch; + } +>; +export function useUpdateIntegrationProviderMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + integrationProviderPatch: IntegrationProviderPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: integrationProviderMutationKeys.all, mutationFn: ({ id, - integrationProviderPatch + integrationProviderPatch, }: { id: string; integrationProviderPatch: IntegrationProviderPatch; - }) => getClient().integrationProvider.update({ - where: { - id - }, - data: integrationProviderPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .integrationProvider.update({ + where: { + id, + }, + data: integrationProviderPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: integrationProviderKeys.detail(variables.id) + queryKey: integrationProviderKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: integrationProviderKeys.lists() + queryKey: integrationProviderKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateNamespaceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateNamespaceEventMutation.ts index e1fcf072cd..c37dff3a26 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateNamespaceEventMutation.ts @@ -4,61 +4,88 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import { namespaceEventMutationKeys } from "../mutation-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations, NamespaceEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations, NamespaceEventPatch } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import { namespaceEventMutationKeys } from '../mutation-keys'; +import type { + NamespaceEventSelect, + NamespaceEventWithRelations, + NamespaceEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceEventSelect, + NamespaceEventWithRelations, + NamespaceEventPatch, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateNamespaceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', namespaceEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateNamespaceEventMutation(params: { - selection: ({ - fields: S & NamespaceEventSelect; - } & HookStrictSelect, NamespaceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - namespaceEventPatch: NamespaceEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updateNamespaceEvent: { - namespaceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - namespaceEventPatch: NamespaceEventPatch; -}>; -export function useUpdateNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateNamespaceEventMutation( + params: { + selection: { + fields: S & NamespaceEventSelect; + } & HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + updateNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + namespaceEventPatch: NamespaceEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + namespaceEventPatch: NamespaceEventPatch; + } +>; +export function useUpdateNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + namespaceEventPatch: NamespaceEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateNamespaceEventMutation(params: { mutationFn: ({ id, createdAt, - namespaceEventPatch + namespaceEventPatch, }: { id: string; createdAt: string; namespaceEventPatch: NamespaceEventPatch; - }) => getClient().namespaceEvent.update({ - where: { - id, - createdAt - }, - data: namespaceEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .namespaceEvent.update({ + where: { + id, + createdAt, + }, + data: namespaceEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.detail(variables.id) + queryKey: namespaceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.lists() + queryKey: namespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateNamespaceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateNamespaceMutation.ts index 2f3e6eef5c..564be0dc4d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateNamespaceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateNamespaceMutation.ts @@ -4,83 +4,107 @@ * 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 { namespaceKeys } from "../query-keys"; -import { namespaceMutationKeys } from "../mutation-keys"; -import type { NamespaceSelect, NamespaceWithRelations, NamespacePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations, NamespacePatch } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import { namespaceMutationKeys } from '../mutation-keys'; +import type { + NamespaceSelect, + NamespaceWithRelations, + NamespacePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceSelect, + NamespaceWithRelations, + NamespacePatch, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateNamespaceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', namespacePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateNamespaceMutation(params: { - selection: ({ - fields: S & NamespaceSelect; - } & HookStrictSelect, NamespaceSelect>); -} & Omit; - }; -}, Error, { - id: string; - namespacePatch: NamespacePatch; -}>, "mutationFn">): UseMutationResult<{ - updateNamespace: { - namespace: InferSelectResult; - }; -}, Error, { - id: string; - namespacePatch: NamespacePatch; -}>; -export function useUpdateNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateNamespaceMutation( + params: { + selection: { + fields: S & NamespaceSelect; + } & HookStrictSelect, NamespaceSelect>; + } & Omit< + UseMutationOptions< + { + updateNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + { + id: string; + namespacePatch: NamespacePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + { + id: string; + namespacePatch: NamespacePatch; + } +>; +export function useUpdateNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + namespacePatch: NamespacePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceMutationKeys.all, - mutationFn: ({ - id, - namespacePatch - }: { - id: string; - namespacePatch: NamespacePatch; - }) => getClient().namespace.update({ - where: { - id - }, - data: namespacePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, namespacePatch }: { id: string; namespacePatch: NamespacePatch }) => + getClient() + .namespace.update({ + where: { + id, + }, + data: namespacePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: namespaceKeys.detail(variables.id) + queryKey: namespaceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceKeys.lists() + queryKey: namespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionApiBindingMutation.ts index 61378b301b..b80aa91321 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionApiBindingMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionApiBindingMutation.ts @@ -4,83 +4,115 @@ * 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 { platformFunctionApiBindingKeys } from "../query-keys"; -import { platformFunctionApiBindingMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations, PlatformFunctionApiBindingPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations, PlatformFunctionApiBindingPatch } from "../../orm/input-types"; +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 { platformFunctionApiBindingKeys } from '../query-keys'; +import { platformFunctionApiBindingMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, + PlatformFunctionApiBindingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, + PlatformFunctionApiBindingPatch, +} from '../../orm/input-types'; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformFunctionApiBindingMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformFunctionApiBindingPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformFunctionApiBindingMutation(params: { - selection: ({ - fields: S & PlatformFunctionApiBindingSelect; - } & HookStrictSelect, PlatformFunctionApiBindingSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformFunctionApiBindingPatch: PlatformFunctionApiBindingPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformFunctionApiBinding: { - platformFunctionApiBinding: InferSelectResult; - }; -}, Error, { - id: string; - platformFunctionApiBindingPatch: PlatformFunctionApiBindingPatch; -}>; -export function useUpdatePlatformFunctionApiBindingMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformFunctionApiBindingMutation< + S extends PlatformFunctionApiBindingSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionApiBindingSelect; + } & HookStrictSelect, PlatformFunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformFunctionApiBinding: { + platformFunctionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + platformFunctionApiBindingPatch: PlatformFunctionApiBindingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformFunctionApiBinding: { + platformFunctionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + platformFunctionApiBindingPatch: PlatformFunctionApiBindingPatch; + } +>; +export function useUpdatePlatformFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformFunctionApiBindingPatch: PlatformFunctionApiBindingPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionApiBindingMutationKeys.all, mutationFn: ({ id, - platformFunctionApiBindingPatch + platformFunctionApiBindingPatch, }: { id: string; platformFunctionApiBindingPatch: PlatformFunctionApiBindingPatch; - }) => getClient().platformFunctionApiBinding.update({ - where: { - id - }, - data: platformFunctionApiBindingPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformFunctionApiBinding.update({ + where: { + id, + }, + data: platformFunctionApiBindingPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformFunctionApiBindingKeys.detail(variables.id) + queryKey: platformFunctionApiBindingKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionApiBindingKeys.lists() + queryKey: platformFunctionApiBindingKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDefinitionMutation.ts index a7bf594166..6d56a3b1bb 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDefinitionMutation.ts @@ -4,83 +4,115 @@ * 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 { platformFunctionDefinitionKeys } from "../query-keys"; -import { platformFunctionDefinitionMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionPatch } from "../../orm/input-types"; +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 { platformFunctionDefinitionKeys } from '../query-keys'; +import { platformFunctionDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, + PlatformFunctionDefinitionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, + PlatformFunctionDefinitionPatch, +} from '../../orm/input-types'; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformFunctionDefinitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformFunctionDefinitionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformFunctionDefinitionMutation(params: { - selection: ({ - fields: S & PlatformFunctionDefinitionSelect; - } & HookStrictSelect, PlatformFunctionDefinitionSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformFunctionDefinitionPatch: PlatformFunctionDefinitionPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformFunctionDefinition: { - platformFunctionDefinition: InferSelectResult; - }; -}, Error, { - id: string; - platformFunctionDefinitionPatch: PlatformFunctionDefinitionPatch; -}>; -export function useUpdatePlatformFunctionDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformFunctionDefinitionMutation< + S extends PlatformFunctionDefinitionSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDefinitionSelect; + } & HookStrictSelect, PlatformFunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + platformFunctionDefinitionPatch: PlatformFunctionDefinitionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + platformFunctionDefinitionPatch: PlatformFunctionDefinitionPatch; + } +>; +export function useUpdatePlatformFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformFunctionDefinitionPatch: PlatformFunctionDefinitionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionDefinitionMutationKeys.all, mutationFn: ({ id, - platformFunctionDefinitionPatch + platformFunctionDefinitionPatch, }: { id: string; platformFunctionDefinitionPatch: PlatformFunctionDefinitionPatch; - }) => getClient().platformFunctionDefinition.update({ - where: { - id - }, - data: platformFunctionDefinitionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformFunctionDefinition.update({ + where: { + id, + }, + data: platformFunctionDefinitionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformFunctionDefinitionKeys.detail(variables.id) + queryKey: platformFunctionDefinitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionDefinitionKeys.lists() + queryKey: platformFunctionDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDeploymentEventMutation.ts index 876ba0054c..69182d4cf3 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDeploymentEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDeploymentEventMutation.ts @@ -4,61 +4,96 @@ * 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 { platformFunctionDeploymentEventKeys } from "../query-keys"; -import { platformFunctionDeploymentEventMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations, PlatformFunctionDeploymentEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations, PlatformFunctionDeploymentEventPatch } from "../../orm/input-types"; +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 { platformFunctionDeploymentEventKeys } from '../query-keys'; +import { platformFunctionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, + PlatformFunctionDeploymentEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, + PlatformFunctionDeploymentEventPatch, +} from '../../orm/input-types'; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformFunctionDeploymentEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformFunctionDeploymentEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformFunctionDeploymentEventMutation(params: { - selection: ({ - fields: S & PlatformFunctionDeploymentEventSelect; - } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - platformFunctionDeploymentEventPatch: PlatformFunctionDeploymentEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - platformFunctionDeploymentEventPatch: PlatformFunctionDeploymentEventPatch; -}>; -export function useUpdatePlatformFunctionDeploymentEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformFunctionDeploymentEventMutation< + S extends PlatformFunctionDeploymentEventSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDeploymentEventSelect; + } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformFunctionDeploymentEvent: { + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + platformFunctionDeploymentEventPatch: PlatformFunctionDeploymentEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformFunctionDeploymentEvent: { + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + platformFunctionDeploymentEventPatch: PlatformFunctionDeploymentEventPatch; + } +>; +export function useUpdatePlatformFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + platformFunctionDeploymentEventPatch: PlatformFunctionDeploymentEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +101,30 @@ export function useUpdatePlatformFunctionDeploymentEventMutation(params: { mutationFn: ({ id, createdAt, - platformFunctionDeploymentEventPatch + platformFunctionDeploymentEventPatch, }: { id: string; createdAt: string; platformFunctionDeploymentEventPatch: PlatformFunctionDeploymentEventPatch; - }) => getClient().platformFunctionDeploymentEvent.update({ - where: { - id, - createdAt - }, - data: platformFunctionDeploymentEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformFunctionDeploymentEvent.update({ + where: { + id, + createdAt, + }, + data: platformFunctionDeploymentEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentEventKeys.detail(variables.id) + queryKey: platformFunctionDeploymentEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentEventKeys.lists() + queryKey: platformFunctionDeploymentEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDeploymentMutation.ts index 76e9703eb4..bae68d87b4 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDeploymentMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionDeploymentMutation.ts @@ -4,83 +4,115 @@ * 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 { platformFunctionDeploymentKeys } from "../query-keys"; -import { platformFunctionDeploymentMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations, PlatformFunctionDeploymentPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations, PlatformFunctionDeploymentPatch } from "../../orm/input-types"; +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 { platformFunctionDeploymentKeys } from '../query-keys'; +import { platformFunctionDeploymentMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, + PlatformFunctionDeploymentPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, + PlatformFunctionDeploymentPatch, +} from '../../orm/input-types'; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformFunctionDeploymentMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformFunctionDeploymentPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformFunctionDeploymentMutation(params: { - selection: ({ - fields: S & PlatformFunctionDeploymentSelect; - } & HookStrictSelect, PlatformFunctionDeploymentSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformFunctionDeploymentPatch: PlatformFunctionDeploymentPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformFunctionDeployment: { - platformFunctionDeployment: InferSelectResult; - }; -}, Error, { - id: string; - platformFunctionDeploymentPatch: PlatformFunctionDeploymentPatch; -}>; -export function useUpdatePlatformFunctionDeploymentMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformFunctionDeploymentMutation< + S extends PlatformFunctionDeploymentSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionDeploymentSelect; + } & HookStrictSelect, PlatformFunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformFunctionDeployment: { + platformFunctionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + platformFunctionDeploymentPatch: PlatformFunctionDeploymentPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformFunctionDeployment: { + platformFunctionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + platformFunctionDeploymentPatch: PlatformFunctionDeploymentPatch; + } +>; +export function useUpdatePlatformFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformFunctionDeploymentPatch: PlatformFunctionDeploymentPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformFunctionDeploymentMutationKeys.all, mutationFn: ({ id, - platformFunctionDeploymentPatch + platformFunctionDeploymentPatch, }: { id: string; platformFunctionDeploymentPatch: PlatformFunctionDeploymentPatch; - }) => getClient().platformFunctionDeployment.update({ - where: { - id - }, - data: platformFunctionDeploymentPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformFunctionDeployment.update({ + where: { + id, + }, + data: platformFunctionDeploymentPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentKeys.detail(variables.id) + queryKey: platformFunctionDeploymentKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionDeploymentKeys.lists() + queryKey: platformFunctionDeploymentKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionExecutionLogMutation.ts index f1950721af..0e89a8804d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionExecutionLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionExecutionLogMutation.ts @@ -4,61 +4,93 @@ * 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 { platformFunctionExecutionLogKeys } from "../query-keys"; -import { platformFunctionExecutionLogMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogPatch } from "../../orm/input-types"; +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 { platformFunctionExecutionLogKeys } from '../query-keys'; +import { platformFunctionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, + PlatformFunctionExecutionLogPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, + PlatformFunctionExecutionLogPatch, +} from '../../orm/input-types'; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformFunctionExecutionLogMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformFunctionExecutionLogPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformFunctionExecutionLogMutation(params: { - selection: ({ - fields: S & PlatformFunctionExecutionLogSelect; - } & HookStrictSelect, PlatformFunctionExecutionLogSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - platformFunctionExecutionLogPatch: PlatformFunctionExecutionLogPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformFunctionExecutionLog: { - platformFunctionExecutionLog: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - platformFunctionExecutionLogPatch: PlatformFunctionExecutionLogPatch; -}>; -export function useUpdatePlatformFunctionExecutionLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformFunctionExecutionLogMutation< + S extends PlatformFunctionExecutionLogSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionExecutionLogSelect; + } & HookStrictSelect, PlatformFunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + platformFunctionExecutionLogPatch: PlatformFunctionExecutionLogPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformFunctionExecutionLogPatch: PlatformFunctionExecutionLogPatch; + } +>; +export function useUpdatePlatformFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + platformFunctionExecutionLogPatch: PlatformFunctionExecutionLogPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +98,30 @@ export function useUpdatePlatformFunctionExecutionLogMutation(params: { mutationFn: ({ id, createdAt, - platformFunctionExecutionLogPatch + platformFunctionExecutionLogPatch, }: { id: string; createdAt: string; platformFunctionExecutionLogPatch: PlatformFunctionExecutionLogPatch; - }) => getClient().platformFunctionExecutionLog.update({ - where: { - id, - createdAt - }, - data: platformFunctionExecutionLogPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformFunctionExecutionLog.update({ + where: { + id, + createdAt, + }, + data: platformFunctionExecutionLogPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformFunctionExecutionLogKeys.detail(variables.id) + queryKey: platformFunctionExecutionLogKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionExecutionLogKeys.lists() + queryKey: platformFunctionExecutionLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionInvocationAttemptMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionInvocationAttemptMutation.ts index 285ee44fc7..4d35d990ba 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionInvocationAttemptMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionInvocationAttemptMutation.ts @@ -4,61 +4,96 @@ * 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 { platformFunctionInvocationAttemptKeys } from "../query-keys"; -import { platformFunctionInvocationAttemptMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations, PlatformFunctionInvocationAttemptPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations, PlatformFunctionInvocationAttemptPatch } from "../../orm/input-types"; +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 { platformFunctionInvocationAttemptKeys } from '../query-keys'; +import { platformFunctionInvocationAttemptMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, + PlatformFunctionInvocationAttemptPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, + PlatformFunctionInvocationAttemptPatch, +} from '../../orm/input-types'; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformFunctionInvocationAttemptMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformFunctionInvocationAttemptPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformFunctionInvocationAttemptMutation(params: { - selection: ({ - fields: S & PlatformFunctionInvocationAttemptSelect; - } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - platformFunctionInvocationAttemptPatch: PlatformFunctionInvocationAttemptPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - platformFunctionInvocationAttemptPatch: PlatformFunctionInvocationAttemptPatch; -}>; -export function useUpdatePlatformFunctionInvocationAttemptMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformFunctionInvocationAttemptMutation< + S extends PlatformFunctionInvocationAttemptSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionInvocationAttemptSelect; + } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformFunctionInvocationAttempt: { + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + platformFunctionInvocationAttemptPatch: PlatformFunctionInvocationAttemptPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformFunctionInvocationAttempt: { + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + platformFunctionInvocationAttemptPatch: PlatformFunctionInvocationAttemptPatch; + } +>; +export function useUpdatePlatformFunctionInvocationAttemptMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + platformFunctionInvocationAttemptPatch: PlatformFunctionInvocationAttemptPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +101,30 @@ export function useUpdatePlatformFunctionInvocationAttemptMutation(params: { mutationFn: ({ id, createdAt, - platformFunctionInvocationAttemptPatch + platformFunctionInvocationAttemptPatch, }: { id: string; createdAt: string; platformFunctionInvocationAttemptPatch: PlatformFunctionInvocationAttemptPatch; - }) => getClient().platformFunctionInvocationAttempt.update({ - where: { - id, - createdAt - }, - data: platformFunctionInvocationAttemptPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformFunctionInvocationAttempt.update({ + where: { + id, + createdAt, + }, + data: platformFunctionInvocationAttemptPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationAttemptKeys.detail(variables.id) + queryKey: platformFunctionInvocationAttemptKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationAttemptKeys.lists() + queryKey: platformFunctionInvocationAttemptKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionInvocationMutation.ts index 8b6ead2b2a..c13f1e4ab8 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionInvocationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformFunctionInvocationMutation.ts @@ -4,61 +4,90 @@ * 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 { platformFunctionInvocationKeys } from "../query-keys"; -import { platformFunctionInvocationMutationKeys } from "../mutation-keys"; -import type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationPatch } from "../../orm/input-types"; +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 { platformFunctionInvocationKeys } from '../query-keys'; +import { platformFunctionInvocationMutationKeys } from '../mutation-keys'; +import type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, + PlatformFunctionInvocationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, + PlatformFunctionInvocationPatch, +} from '../../orm/input-types'; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformFunctionInvocationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformFunctionInvocationPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformFunctionInvocationMutation(params: { - selection: ({ - fields: S & PlatformFunctionInvocationSelect; - } & HookStrictSelect, PlatformFunctionInvocationSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - platformFunctionInvocationPatch: PlatformFunctionInvocationPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformFunctionInvocation: { - platformFunctionInvocation: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - platformFunctionInvocationPatch: PlatformFunctionInvocationPatch; -}>; -export function useUpdatePlatformFunctionInvocationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformFunctionInvocationMutation< + S extends PlatformFunctionInvocationSelect, +>( + params: { + selection: { + fields: S & PlatformFunctionInvocationSelect; + } & HookStrictSelect, PlatformFunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformFunctionInvocationPatch: PlatformFunctionInvocationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformFunctionInvocationPatch: PlatformFunctionInvocationPatch; + } +>; +export function useUpdatePlatformFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + platformFunctionInvocationPatch: PlatformFunctionInvocationPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +95,30 @@ export function useUpdatePlatformFunctionInvocationMutation(params: { mutationFn: ({ id, createdAt, - platformFunctionInvocationPatch + platformFunctionInvocationPatch, }: { id: string; createdAt: string; platformFunctionInvocationPatch: PlatformFunctionInvocationPatch; - }) => getClient().platformFunctionInvocation.update({ - where: { - id, - createdAt - }, - data: platformFunctionInvocationPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformFunctionInvocation.update({ + where: { + id, + createdAt, + }, + data: platformFunctionInvocationPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationKeys.detail(variables.id) + queryKey: platformFunctionInvocationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformFunctionInvocationKeys.lists() + queryKey: platformFunctionInvocationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraCommitMutation.ts index 10372f3529..352d9d725e 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraCommitMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraCommitMutation.ts @@ -4,61 +4,88 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import { platformInfraCommitMutationKeys } from "../mutation-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, PlatformInfraCommitPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, PlatformInfraCommitPatch } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import { platformInfraCommitMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + PlatformInfraCommitPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + PlatformInfraCommitPatch, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformInfraCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformInfraCommitPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformInfraCommitMutation(params: { - selection: ({ - fields: S & PlatformInfraCommitSelect; - } & HookStrictSelect, PlatformInfraCommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraCommitPatch: PlatformInfraCommitPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformInfraCommit: { - platformInfraCommit: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraCommitPatch: PlatformInfraCommitPatch; -}>; -export function useUpdatePlatformInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformInfraCommitMutation( + params: { + selection: { + fields: S & PlatformInfraCommitSelect; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraCommitPatch: PlatformInfraCommitPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraCommitPatch: PlatformInfraCommitPatch; + } +>; +export function useUpdatePlatformInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + platformInfraCommitPatch: PlatformInfraCommitPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformInfraCommitMutation(params: { mutationFn: ({ id, scopeId, - platformInfraCommitPatch + platformInfraCommitPatch, }: { id: string; scopeId: string; platformInfraCommitPatch: PlatformInfraCommitPatch; - }) => getClient().platformInfraCommit.update({ - where: { - id, - scopeId - }, - data: platformInfraCommitPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformInfraCommit.update({ + where: { + id, + scopeId, + }, + data: platformInfraCommitPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.detail(variables.id) + queryKey: platformInfraCommitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.lists() + queryKey: platformInfraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraObjectMutation.ts index 7e3a3952c0..95ba3993cf 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraObjectMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraObjectMutation.ts @@ -4,61 +4,88 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import { platformInfraObjectMutationKeys } from "../mutation-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, PlatformInfraObjectPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, PlatformInfraObjectPatch } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import { platformInfraObjectMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + PlatformInfraObjectPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + PlatformInfraObjectPatch, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformInfraObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformInfraObjectPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformInfraObjectMutation(params: { - selection: ({ - fields: S & PlatformInfraObjectSelect; - } & HookStrictSelect, PlatformInfraObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraObjectPatch: PlatformInfraObjectPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformInfraObject: { - platformInfraObject: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraObjectPatch: PlatformInfraObjectPatch; -}>; -export function useUpdatePlatformInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformInfraObjectMutation( + params: { + selection: { + fields: S & PlatformInfraObjectSelect; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraObjectPatch: PlatformInfraObjectPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraObjectPatch: PlatformInfraObjectPatch; + } +>; +export function useUpdatePlatformInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + platformInfraObjectPatch: PlatformInfraObjectPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformInfraObjectMutation(params: { mutationFn: ({ id, scopeId, - platformInfraObjectPatch + platformInfraObjectPatch, }: { id: string; scopeId: string; platformInfraObjectPatch: PlatformInfraObjectPatch; - }) => getClient().platformInfraObject.update({ - where: { - id, - scopeId - }, - data: platformInfraObjectPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformInfraObject.update({ + where: { + id, + scopeId, + }, + data: platformInfraObjectPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.detail(variables.id) + queryKey: platformInfraObjectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.lists() + queryKey: platformInfraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraRefMutation.ts index c1d8352105..081a40d0f4 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraRefMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraRefMutation.ts @@ -4,61 +4,88 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import { platformInfraRefMutationKeys } from "../mutation-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, PlatformInfraRefPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, PlatformInfraRefPatch } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import { platformInfraRefMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + PlatformInfraRefPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + PlatformInfraRefPatch, +} from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformInfraRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformInfraRefPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformInfraRefMutation(params: { - selection: ({ - fields: S & PlatformInfraRefSelect; - } & HookStrictSelect, PlatformInfraRefSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraRefPatch: PlatformInfraRefPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformInfraRef: { - platformInfraRef: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraRefPatch: PlatformInfraRefPatch; -}>; -export function useUpdatePlatformInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformInfraRefMutation( + params: { + selection: { + fields: S & PlatformInfraRefSelect; + } & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraRefPatch: PlatformInfraRefPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraRefPatch: PlatformInfraRefPatch; + } +>; +export function useUpdatePlatformInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + platformInfraRefPatch: PlatformInfraRefPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformInfraRefMutation(params: { mutationFn: ({ id, scopeId, - platformInfraRefPatch + platformInfraRefPatch, }: { id: string; scopeId: string; platformInfraRefPatch: PlatformInfraRefPatch; - }) => getClient().platformInfraRef.update({ - where: { - id, - scopeId - }, - data: platformInfraRefPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformInfraRef.update({ + where: { + id, + scopeId, + }, + data: platformInfraRefPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.detail(variables.id) + queryKey: platformInfraRefKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.lists() + queryKey: platformInfraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraStoreMutation.ts index cde6095f16..ada46aa80d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraStoreMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformInfraStoreMutation.ts @@ -4,83 +4,113 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import { platformInfraStoreMutationKeys } from "../mutation-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, PlatformInfraStorePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, PlatformInfraStorePatch } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import { platformInfraStoreMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + PlatformInfraStorePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + PlatformInfraStorePatch, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformInfraStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformInfraStorePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformInfraStoreMutation(params: { - selection: ({ - fields: S & PlatformInfraStoreSelect; - } & HookStrictSelect, PlatformInfraStoreSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformInfraStorePatch: PlatformInfraStorePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformInfraStore: { - platformInfraStore: InferSelectResult; - }; -}, Error, { - id: string; - platformInfraStorePatch: PlatformInfraStorePatch; -}>; -export function useUpdatePlatformInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformInfraStoreMutation( + params: { + selection: { + fields: S & PlatformInfraStoreSelect; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + platformInfraStorePatch: PlatformInfraStorePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + platformInfraStorePatch: PlatformInfraStorePatch; + } +>; +export function useUpdatePlatformInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformInfraStorePatch: PlatformInfraStorePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraStoreMutationKeys.all, mutationFn: ({ id, - platformInfraStorePatch + platformInfraStorePatch, }: { id: string; platformInfraStorePatch: PlatformInfraStorePatch; - }) => getClient().platformInfraStore.update({ - where: { - id - }, - data: platformInfraStorePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformInfraStore.update({ + where: { + id, + }, + data: platformInfraStorePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.detail(variables.id) + queryKey: platformInfraStoreKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.lists() + queryKey: platformInfraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformNamespaceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformNamespaceEventMutation.ts index 85c7f4452d..9ca416fd9c 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformNamespaceEventMutation.ts @@ -4,61 +4,88 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import { platformNamespaceEventMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, PlatformNamespaceEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, PlatformNamespaceEventPatch } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import { platformNamespaceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventPatch, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformNamespaceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformNamespaceEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformNamespaceEventMutation(params: { - selection: ({ - fields: S & PlatformNamespaceEventSelect; - } & HookStrictSelect, PlatformNamespaceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - platformNamespaceEventPatch: PlatformNamespaceEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformNamespaceEvent: { - platformNamespaceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - platformNamespaceEventPatch: PlatformNamespaceEventPatch; -}>; -export function useUpdatePlatformNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformNamespaceEventMutation( + params: { + selection: { + fields: S & PlatformNamespaceEventSelect; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformNamespaceEventPatch: PlatformNamespaceEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformNamespaceEventPatch: PlatformNamespaceEventPatch; + } +>; +export function useUpdatePlatformNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + platformNamespaceEventPatch: PlatformNamespaceEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformNamespaceEventMutation(params: { mutationFn: ({ id, createdAt, - platformNamespaceEventPatch + platformNamespaceEventPatch, }: { id: string; createdAt: string; platformNamespaceEventPatch: PlatformNamespaceEventPatch; - }) => getClient().platformNamespaceEvent.update({ - where: { - id, - createdAt - }, - data: platformNamespaceEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformNamespaceEvent.update({ + where: { + id, + createdAt, + }, + data: platformNamespaceEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.detail(variables.id) + queryKey: platformNamespaceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.lists() + queryKey: platformNamespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformNamespaceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformNamespaceMutation.ts index f09f6cd414..de626ae084 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformNamespaceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformNamespaceMutation.ts @@ -4,83 +4,113 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import { platformNamespaceMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, PlatformNamespacePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, PlatformNamespacePatch } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import { platformNamespaceMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + PlatformNamespacePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + PlatformNamespacePatch, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformNamespaceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformNamespacePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformNamespaceMutation(params: { - selection: ({ - fields: S & PlatformNamespaceSelect; - } & HookStrictSelect, PlatformNamespaceSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformNamespacePatch: PlatformNamespacePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformNamespace: { - platformNamespace: InferSelectResult; - }; -}, Error, { - id: string; - platformNamespacePatch: PlatformNamespacePatch; -}>; -export function useUpdatePlatformNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformNamespaceMutation( + params: { + selection: { + fields: S & PlatformNamespaceSelect; + } & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + { + id: string; + platformNamespacePatch: PlatformNamespacePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + { + id: string; + platformNamespacePatch: PlatformNamespacePatch; + } +>; +export function useUpdatePlatformNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformNamespacePatch: PlatformNamespacePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceMutationKeys.all, mutationFn: ({ id, - platformNamespacePatch + platformNamespacePatch, }: { id: string; platformNamespacePatch: PlatformNamespacePatch; - }) => getClient().platformNamespace.update({ - where: { - id - }, - data: platformNamespacePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformNamespace.update({ + where: { + id, + }, + data: platformNamespacePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.detail(variables.id) + queryKey: platformNamespaceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.lists() + queryKey: platformNamespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceDefinitionMutation.ts index 030927c044..dfb5fe83ea 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceDefinitionMutation.ts @@ -4,83 +4,115 @@ * 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 { platformResourceDefinitionKeys } from "../query-keys"; -import { platformResourceDefinitionMutationKeys } from "../mutation-keys"; -import type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations, PlatformResourceDefinitionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations, PlatformResourceDefinitionPatch } from "../../orm/input-types"; +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 { platformResourceDefinitionKeys } from '../query-keys'; +import { platformResourceDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, + PlatformResourceDefinitionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, + PlatformResourceDefinitionPatch, +} from '../../orm/input-types'; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformResourceDefinitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformResourceDefinitionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformResourceDefinitionMutation(params: { - selection: ({ - fields: S & PlatformResourceDefinitionSelect; - } & HookStrictSelect, PlatformResourceDefinitionSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformResourceDefinitionPatch: PlatformResourceDefinitionPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformResourceDefinition: { - platformResourceDefinition: InferSelectResult; - }; -}, Error, { - id: string; - platformResourceDefinitionPatch: PlatformResourceDefinitionPatch; -}>; -export function useUpdatePlatformResourceDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformResourceDefinitionMutation< + S extends PlatformResourceDefinitionSelect, +>( + params: { + selection: { + fields: S & PlatformResourceDefinitionSelect; + } & HookStrictSelect, PlatformResourceDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformResourceDefinition: { + platformResourceDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + platformResourceDefinitionPatch: PlatformResourceDefinitionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformResourceDefinition: { + platformResourceDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + platformResourceDefinitionPatch: PlatformResourceDefinitionPatch; + } +>; +export function useUpdatePlatformResourceDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformResourceDefinitionPatch: PlatformResourceDefinitionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceDefinitionMutationKeys.all, mutationFn: ({ id, - platformResourceDefinitionPatch + platformResourceDefinitionPatch, }: { id: string; platformResourceDefinitionPatch: PlatformResourceDefinitionPatch; - }) => getClient().platformResourceDefinition.update({ - where: { - id - }, - data: platformResourceDefinitionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformResourceDefinition.update({ + where: { + id, + }, + data: platformResourceDefinitionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformResourceDefinitionKeys.detail(variables.id) + queryKey: platformResourceDefinitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceDefinitionKeys.lists() + queryKey: platformResourceDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceEventMutation.ts index 733c29b841..ea3918a68b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceEventMutation.ts @@ -4,61 +4,88 @@ * 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 { platformResourceEventKeys } from "../query-keys"; -import { platformResourceEventMutationKeys } from "../mutation-keys"; -import type { PlatformResourceEventSelect, PlatformResourceEventWithRelations, PlatformResourceEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceEventSelect, PlatformResourceEventWithRelations, PlatformResourceEventPatch } from "../../orm/input-types"; +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 { platformResourceEventKeys } from '../query-keys'; +import { platformResourceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, + PlatformResourceEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, + PlatformResourceEventPatch, +} from '../../orm/input-types'; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformResourceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformResourceEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformResourceEventMutation(params: { - selection: ({ - fields: S & PlatformResourceEventSelect; - } & HookStrictSelect, PlatformResourceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - platformResourceEventPatch: PlatformResourceEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformResourceEvent: { - platformResourceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - platformResourceEventPatch: PlatformResourceEventPatch; -}>; -export function useUpdatePlatformResourceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformResourceEventMutation( + params: { + selection: { + fields: S & PlatformResourceEventSelect; + } & HookStrictSelect, PlatformResourceEventSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformResourceEvent: { + platformResourceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformResourceEventPatch: PlatformResourceEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformResourceEvent: { + platformResourceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformResourceEventPatch: PlatformResourceEventPatch; + } +>; +export function useUpdatePlatformResourceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + platformResourceEventPatch: PlatformResourceEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformResourceEventMutation(params: { mutationFn: ({ id, createdAt, - platformResourceEventPatch + platformResourceEventPatch, }: { id: string; createdAt: string; platformResourceEventPatch: PlatformResourceEventPatch; - }) => getClient().platformResourceEvent.update({ - where: { - id, - createdAt - }, - data: platformResourceEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformResourceEvent.update({ + where: { + id, + createdAt, + }, + data: platformResourceEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformResourceEventKeys.detail(variables.id) + queryKey: platformResourceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceEventKeys.lists() + queryKey: platformResourceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceInstallationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceInstallationMutation.ts index 70df7a7921..91602d1993 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceInstallationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceInstallationMutation.ts @@ -4,83 +4,118 @@ * 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 { platformResourceInstallationKeys } from "../query-keys"; -import { platformResourceInstallationMutationKeys } from "../mutation-keys"; -import type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations, PlatformResourceInstallationPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations, PlatformResourceInstallationPatch } from "../../orm/input-types"; +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 { platformResourceInstallationKeys } from '../query-keys'; +import { platformResourceInstallationMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, + PlatformResourceInstallationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, + PlatformResourceInstallationPatch, +} from '../../orm/input-types'; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformResourceInstallationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformResourceInstallationPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformResourceInstallationMutation(params: { - selection: ({ - fields: S & PlatformResourceInstallationSelect; - } & HookStrictSelect, PlatformResourceInstallationSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformResourceInstallationPatch: PlatformResourceInstallationPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformResourceInstallation: { - platformResourceInstallation: InferSelectResult; - }; -}, Error, { - id: string; - platformResourceInstallationPatch: PlatformResourceInstallationPatch; -}>; -export function useUpdatePlatformResourceInstallationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformResourceInstallationMutation< + S extends PlatformResourceInstallationSelect, +>( + params: { + selection: { + fields: S & PlatformResourceInstallationSelect; + } & HookStrictSelect, PlatformResourceInstallationSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformResourceInstallation: { + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + >; + }; + }, + Error, + { + id: string; + platformResourceInstallationPatch: PlatformResourceInstallationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformResourceInstallation: { + platformResourceInstallation: InferSelectResult; + }; + }, + Error, + { + id: string; + platformResourceInstallationPatch: PlatformResourceInstallationPatch; + } +>; +export function useUpdatePlatformResourceInstallationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformResourceInstallationPatch: PlatformResourceInstallationPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceInstallationMutationKeys.all, mutationFn: ({ id, - platformResourceInstallationPatch + platformResourceInstallationPatch, }: { id: string; platformResourceInstallationPatch: PlatformResourceInstallationPatch; - }) => getClient().platformResourceInstallation.update({ - where: { - id - }, - data: platformResourceInstallationPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformResourceInstallation.update({ + where: { + id, + }, + data: platformResourceInstallationPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformResourceInstallationKeys.detail(variables.id) + queryKey: platformResourceInstallationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceInstallationKeys.lists() + queryKey: platformResourceInstallationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceMutation.ts index 419596bf29..79bdd47108 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceMutation.ts @@ -4,83 +4,113 @@ * 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 { platformResourceKeys } from "../query-keys"; -import { platformResourceMutationKeys } from "../mutation-keys"; -import type { PlatformResourceSelect, PlatformResourceWithRelations, PlatformResourcePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceSelect, PlatformResourceWithRelations, PlatformResourcePatch } from "../../orm/input-types"; +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 { platformResourceKeys } from '../query-keys'; +import { platformResourceMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceSelect, + PlatformResourceWithRelations, + PlatformResourcePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceSelect, + PlatformResourceWithRelations, + PlatformResourcePatch, +} from '../../orm/input-types'; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformResourceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformResourcePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformResourceMutation(params: { - selection: ({ - fields: S & PlatformResourceSelect; - } & HookStrictSelect, PlatformResourceSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformResourcePatch: PlatformResourcePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformResource: { - platformResource: InferSelectResult; - }; -}, Error, { - id: string; - platformResourcePatch: PlatformResourcePatch; -}>; -export function useUpdatePlatformResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformResourceMutation( + params: { + selection: { + fields: S & PlatformResourceSelect; + } & HookStrictSelect, PlatformResourceSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformResource: { + platformResource: InferSelectResult; + }; + }, + Error, + { + id: string; + platformResourcePatch: PlatformResourcePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformResource: { + platformResource: InferSelectResult; + }; + }, + Error, + { + id: string; + platformResourcePatch: PlatformResourcePatch; + } +>; +export function useUpdatePlatformResourceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformResourcePatch: PlatformResourcePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceMutationKeys.all, mutationFn: ({ id, - platformResourcePatch + platformResourcePatch, }: { id: string; platformResourcePatch: PlatformResourcePatch; - }) => getClient().platformResource.update({ - where: { - id - }, - data: platformResourcePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformResource.update({ + where: { + id, + }, + data: platformResourcePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformResourceKeys.detail(variables.id) + queryKey: platformResourceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceKeys.lists() + queryKey: platformResourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceStatusCheckMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceStatusCheckMutation.ts index d9f95019cf..6d6565445b 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceStatusCheckMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceStatusCheckMutation.ts @@ -4,83 +4,118 @@ * 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 { platformResourceStatusCheckKeys } from "../query-keys"; -import { platformResourceStatusCheckMutationKeys } from "../mutation-keys"; -import type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations, PlatformResourceStatusCheckPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations, PlatformResourceStatusCheckPatch } from "../../orm/input-types"; +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 { platformResourceStatusCheckKeys } from '../query-keys'; +import { platformResourceStatusCheckMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, + PlatformResourceStatusCheckPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, + PlatformResourceStatusCheckPatch, +} from '../../orm/input-types'; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformResourceStatusCheckMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformResourceStatusCheckPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformResourceStatusCheckMutation(params: { - selection: ({ - fields: S & PlatformResourceStatusCheckSelect; - } & HookStrictSelect, PlatformResourceStatusCheckSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformResourceStatusCheckPatch: PlatformResourceStatusCheckPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformResourceStatusCheck: { - platformResourceStatusCheck: InferSelectResult; - }; -}, Error, { - id: string; - platformResourceStatusCheckPatch: PlatformResourceStatusCheckPatch; -}>; -export function useUpdatePlatformResourceStatusCheckMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformResourceStatusCheckMutation< + S extends PlatformResourceStatusCheckSelect, +>( + params: { + selection: { + fields: S & PlatformResourceStatusCheckSelect; + } & HookStrictSelect, PlatformResourceStatusCheckSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformResourceStatusCheck: { + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + >; + }; + }, + Error, + { + id: string; + platformResourceStatusCheckPatch: PlatformResourceStatusCheckPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformResourceStatusCheck: { + platformResourceStatusCheck: InferSelectResult; + }; + }, + Error, + { + id: string; + platformResourceStatusCheckPatch: PlatformResourceStatusCheckPatch; + } +>; +export function useUpdatePlatformResourceStatusCheckMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformResourceStatusCheckPatch: PlatformResourceStatusCheckPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformResourceStatusCheckMutationKeys.all, mutationFn: ({ id, - platformResourceStatusCheckPatch + platformResourceStatusCheckPatch, }: { id: string; platformResourceStatusCheckPatch: PlatformResourceStatusCheckPatch; - }) => getClient().platformResourceStatusCheck.update({ - where: { - id - }, - data: platformResourceStatusCheckPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformResourceStatusCheck.update({ + where: { + id, + }, + data: platformResourceStatusCheckPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformResourceStatusCheckKeys.detail(variables.id) + queryKey: platformResourceStatusCheckKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceStatusCheckKeys.lists() + queryKey: platformResourceStatusCheckKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceUsageLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceUsageLogMutation.ts index e0e35d74cd..c6a77dff60 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceUsageLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceUsageLogMutation.ts @@ -4,61 +4,88 @@ * 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 { platformResourceUsageLogKeys } from "../query-keys"; -import { platformResourceUsageLogMutationKeys } from "../mutation-keys"; -import type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations, PlatformResourceUsageLogPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations, PlatformResourceUsageLogPatch } from "../../orm/input-types"; +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 { platformResourceUsageLogKeys } from '../query-keys'; +import { platformResourceUsageLogMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, + PlatformResourceUsageLogPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, + PlatformResourceUsageLogPatch, +} from '../../orm/input-types'; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformResourceUsageLogMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformResourceUsageLogPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformResourceUsageLogMutation(params: { - selection: ({ - fields: S & PlatformResourceUsageLogSelect; - } & HookStrictSelect, PlatformResourceUsageLogSelect>); -} & Omit; - }; -}, Error, { - id: string; - sampledAt: string; - platformResourceUsageLogPatch: PlatformResourceUsageLogPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformResourceUsageLog: { - platformResourceUsageLog: InferSelectResult; - }; -}, Error, { - id: string; - sampledAt: string; - platformResourceUsageLogPatch: PlatformResourceUsageLogPatch; -}>; -export function useUpdatePlatformResourceUsageLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformResourceUsageLogMutation( + params: { + selection: { + fields: S & PlatformResourceUsageLogSelect; + } & HookStrictSelect, PlatformResourceUsageLogSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformResourceUsageLog: { + platformResourceUsageLog: InferSelectResult; + }; + }, + Error, + { + id: string; + sampledAt: string; + platformResourceUsageLogPatch: PlatformResourceUsageLogPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformResourceUsageLog: { + platformResourceUsageLog: InferSelectResult; + }; + }, + Error, + { + id: string; + sampledAt: string; + platformResourceUsageLogPatch: PlatformResourceUsageLogPatch; + } +>; +export function useUpdatePlatformResourceUsageLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + sampledAt: string; + platformResourceUsageLogPatch: PlatformResourceUsageLogPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformResourceUsageLogMutation(params: { mutationFn: ({ id, sampledAt, - platformResourceUsageLogPatch + platformResourceUsageLogPatch, }: { id: string; sampledAt: string; platformResourceUsageLogPatch: PlatformResourceUsageLogPatch; - }) => getClient().platformResourceUsageLog.update({ - where: { - id, - sampledAt - }, - data: platformResourceUsageLogPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformResourceUsageLog.update({ + where: { + id, + sampledAt, + }, + data: platformResourceUsageLogPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformResourceUsageLogKeys.detail(variables.id) + queryKey: platformResourceUsageLogKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceUsageLogKeys.lists() + queryKey: platformResourceUsageLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceUsageSummaryMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceUsageSummaryMutation.ts index 10a520660a..68b068db6f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceUsageSummaryMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformResourceUsageSummaryMutation.ts @@ -4,61 +4,93 @@ * 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 { platformResourceUsageSummaryKeys } from "../query-keys"; -import { platformResourceUsageSummaryMutationKeys } from "../mutation-keys"; -import type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations, PlatformResourceUsageSummaryPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations, PlatformResourceUsageSummaryPatch } from "../../orm/input-types"; +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 { platformResourceUsageSummaryKeys } from '../query-keys'; +import { platformResourceUsageSummaryMutationKeys } from '../mutation-keys'; +import type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, + PlatformResourceUsageSummaryPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, + PlatformResourceUsageSummaryPatch, +} from '../../orm/input-types'; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformResourceUsageSummaryMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformResourceUsageSummaryPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformResourceUsageSummaryMutation(params: { - selection: ({ - fields: S & PlatformResourceUsageSummarySelect; - } & HookStrictSelect, PlatformResourceUsageSummarySelect>); -} & Omit; - }; -}, Error, { - id: string; - date: string; - platformResourceUsageSummaryPatch: PlatformResourceUsageSummaryPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformResourceUsageSummary: { - platformResourceUsageSummary: InferSelectResult; - }; -}, Error, { - id: string; - date: string; - platformResourceUsageSummaryPatch: PlatformResourceUsageSummaryPatch; -}>; -export function useUpdatePlatformResourceUsageSummaryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformResourceUsageSummaryMutation< + S extends PlatformResourceUsageSummarySelect, +>( + params: { + selection: { + fields: S & PlatformResourceUsageSummarySelect; + } & HookStrictSelect, PlatformResourceUsageSummarySelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformResourceUsageSummary: { + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + >; + }; + }, + Error, + { + id: string; + date: string; + platformResourceUsageSummaryPatch: PlatformResourceUsageSummaryPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformResourceUsageSummary: { + platformResourceUsageSummary: InferSelectResult; + }; + }, + Error, + { + id: string; + date: string; + platformResourceUsageSummaryPatch: PlatformResourceUsageSummaryPatch; + } +>; +export function useUpdatePlatformResourceUsageSummaryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + date: string; + platformResourceUsageSummaryPatch: PlatformResourceUsageSummaryPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +98,30 @@ export function useUpdatePlatformResourceUsageSummaryMutation(params: { mutationFn: ({ id, date, - platformResourceUsageSummaryPatch + platformResourceUsageSummaryPatch, }: { id: string; date: string; platformResourceUsageSummaryPatch: PlatformResourceUsageSummaryPatch; - }) => getClient().platformResourceUsageSummary.update({ - where: { - id, - date - }, - data: platformResourceUsageSummaryPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformResourceUsageSummary.update({ + where: { + id, + date, + }, + data: platformResourceUsageSummaryPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformResourceUsageSummaryKeys.detail(variables.id) + queryKey: platformResourceUsageSummaryKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformResourceUsageSummaryKeys.lists() + queryKey: platformResourceUsageSummaryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformWebhookEndpointMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformWebhookEndpointMutation.ts index b583c15b70..ccbcff5867 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformWebhookEndpointMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformWebhookEndpointMutation.ts @@ -4,83 +4,113 @@ * 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 { platformWebhookEndpointKeys } from "../query-keys"; -import { platformWebhookEndpointMutationKeys } from "../mutation-keys"; -import type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations, PlatformWebhookEndpointPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations, PlatformWebhookEndpointPatch } from "../../orm/input-types"; +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 { platformWebhookEndpointKeys } from '../query-keys'; +import { platformWebhookEndpointMutationKeys } from '../mutation-keys'; +import type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, + PlatformWebhookEndpointPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, + PlatformWebhookEndpointPatch, +} from '../../orm/input-types'; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformWebhookEndpointMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformWebhookEndpointPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformWebhookEndpointMutation(params: { - selection: ({ - fields: S & PlatformWebhookEndpointSelect; - } & HookStrictSelect, PlatformWebhookEndpointSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformWebhookEndpointPatch: PlatformWebhookEndpointPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformWebhookEndpoint: { - platformWebhookEndpoint: InferSelectResult; - }; -}, Error, { - id: string; - platformWebhookEndpointPatch: PlatformWebhookEndpointPatch; -}>; -export function useUpdatePlatformWebhookEndpointMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformWebhookEndpointMutation( + params: { + selection: { + fields: S & PlatformWebhookEndpointSelect; + } & HookStrictSelect, PlatformWebhookEndpointSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformWebhookEndpoint: { + platformWebhookEndpoint: InferSelectResult; + }; + }, + Error, + { + id: string; + platformWebhookEndpointPatch: PlatformWebhookEndpointPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformWebhookEndpoint: { + platformWebhookEndpoint: InferSelectResult; + }; + }, + Error, + { + id: string; + platformWebhookEndpointPatch: PlatformWebhookEndpointPatch; + } +>; +export function useUpdatePlatformWebhookEndpointMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformWebhookEndpointPatch: PlatformWebhookEndpointPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformWebhookEndpointMutationKeys.all, mutationFn: ({ id, - platformWebhookEndpointPatch + platformWebhookEndpointPatch, }: { id: string; platformWebhookEndpointPatch: PlatformWebhookEndpointPatch; - }) => getClient().platformWebhookEndpoint.update({ - where: { - id - }, - data: platformWebhookEndpointPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformWebhookEndpoint.update({ + where: { + id, + }, + data: platformWebhookEndpointPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformWebhookEndpointKeys.detail(variables.id) + queryKey: platformWebhookEndpointKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformWebhookEndpointKeys.lists() + queryKey: platformWebhookEndpointKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformWebhookEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformWebhookEventMutation.ts index 3ae6857044..e1e013b78f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformWebhookEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdatePlatformWebhookEventMutation.ts @@ -4,83 +4,113 @@ * 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 { platformWebhookEventKeys } from "../query-keys"; -import { platformWebhookEventMutationKeys } from "../mutation-keys"; -import type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations, PlatformWebhookEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations, PlatformWebhookEventPatch } from "../../orm/input-types"; +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 { platformWebhookEventKeys } from '../query-keys'; +import { platformWebhookEventMutationKeys } from '../mutation-keys'; +import type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, + PlatformWebhookEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, + PlatformWebhookEventPatch, +} from '../../orm/input-types'; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformWebhookEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformWebhookEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformWebhookEventMutation(params: { - selection: ({ - fields: S & PlatformWebhookEventSelect; - } & HookStrictSelect, PlatformWebhookEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformWebhookEventPatch: PlatformWebhookEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformWebhookEvent: { - platformWebhookEvent: InferSelectResult; - }; -}, Error, { - id: string; - platformWebhookEventPatch: PlatformWebhookEventPatch; -}>; -export function useUpdatePlatformWebhookEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformWebhookEventMutation( + params: { + selection: { + fields: S & PlatformWebhookEventSelect; + } & HookStrictSelect, PlatformWebhookEventSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformWebhookEvent: { + platformWebhookEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + platformWebhookEventPatch: PlatformWebhookEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformWebhookEvent: { + platformWebhookEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + platformWebhookEventPatch: PlatformWebhookEventPatch; + } +>; +export function useUpdatePlatformWebhookEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformWebhookEventPatch: PlatformWebhookEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformWebhookEventMutationKeys.all, mutationFn: ({ id, - platformWebhookEventPatch + platformWebhookEventPatch, }: { id: string; platformWebhookEventPatch: PlatformWebhookEventPatch; - }) => getClient().platformWebhookEvent.update({ - where: { - id - }, - data: platformWebhookEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformWebhookEvent.update({ + where: { + id, + }, + data: platformWebhookEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformWebhookEventKeys.detail(variables.id) + queryKey: platformWebhookEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformWebhookEventKeys.lists() + queryKey: platformWebhookEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceDefinitionMutation.ts index 9bd928f13d..9e44235168 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceDefinitionMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceDefinitionMutation.ts @@ -4,83 +4,113 @@ * 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 { resourceDefinitionKeys } from "../query-keys"; -import { resourceDefinitionMutationKeys } from "../mutation-keys"; -import type { ResourceDefinitionSelect, ResourceDefinitionWithRelations, ResourceDefinitionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceDefinitionSelect, ResourceDefinitionWithRelations, ResourceDefinitionPatch } from "../../orm/input-types"; +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 { resourceDefinitionKeys } from '../query-keys'; +import { resourceDefinitionMutationKeys } from '../mutation-keys'; +import type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, + ResourceDefinitionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, + ResourceDefinitionPatch, +} from '../../orm/input-types'; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateResourceDefinitionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', resourceDefinitionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateResourceDefinitionMutation(params: { - selection: ({ - fields: S & ResourceDefinitionSelect; - } & HookStrictSelect, ResourceDefinitionSelect>); -} & Omit; - }; -}, Error, { - id: string; - resourceDefinitionPatch: ResourceDefinitionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateResourceDefinition: { - resourceDefinition: InferSelectResult; - }; -}, Error, { - id: string; - resourceDefinitionPatch: ResourceDefinitionPatch; -}>; -export function useUpdateResourceDefinitionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateResourceDefinitionMutation( + params: { + selection: { + fields: S & ResourceDefinitionSelect; + } & HookStrictSelect, ResourceDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + updateResourceDefinition: { + resourceDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + resourceDefinitionPatch: ResourceDefinitionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateResourceDefinition: { + resourceDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + resourceDefinitionPatch: ResourceDefinitionPatch; + } +>; +export function useUpdateResourceDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + resourceDefinitionPatch: ResourceDefinitionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceDefinitionMutationKeys.all, mutationFn: ({ id, - resourceDefinitionPatch + resourceDefinitionPatch, }: { id: string; resourceDefinitionPatch: ResourceDefinitionPatch; - }) => getClient().resourceDefinition.update({ - where: { - id - }, - data: resourceDefinitionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .resourceDefinition.update({ + where: { + id, + }, + data: resourceDefinitionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: resourceDefinitionKeys.detail(variables.id) + queryKey: resourceDefinitionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceDefinitionKeys.lists() + queryKey: resourceDefinitionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceEventMutation.ts index dca1333273..dc1e9b08fc 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceEventMutation.ts @@ -4,61 +4,88 @@ * 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 { resourceEventKeys } from "../query-keys"; -import { resourceEventMutationKeys } from "../mutation-keys"; -import type { ResourceEventSelect, ResourceEventWithRelations, ResourceEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceEventSelect, ResourceEventWithRelations, ResourceEventPatch } from "../../orm/input-types"; +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 { resourceEventKeys } from '../query-keys'; +import { resourceEventMutationKeys } from '../mutation-keys'; +import type { + ResourceEventSelect, + ResourceEventWithRelations, + ResourceEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceEventSelect, + ResourceEventWithRelations, + ResourceEventPatch, +} from '../../orm/input-types'; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateResourceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', resourceEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateResourceEventMutation(params: { - selection: ({ - fields: S & ResourceEventSelect; - } & HookStrictSelect, ResourceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - resourceEventPatch: ResourceEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updateResourceEvent: { - resourceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - resourceEventPatch: ResourceEventPatch; -}>; -export function useUpdateResourceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateResourceEventMutation( + params: { + selection: { + fields: S & ResourceEventSelect; + } & HookStrictSelect, ResourceEventSelect>; + } & Omit< + UseMutationOptions< + { + updateResourceEvent: { + resourceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + resourceEventPatch: ResourceEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateResourceEvent: { + resourceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + resourceEventPatch: ResourceEventPatch; + } +>; +export function useUpdateResourceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + resourceEventPatch: ResourceEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateResourceEventMutation(params: { mutationFn: ({ id, createdAt, - resourceEventPatch + resourceEventPatch, }: { id: string; createdAt: string; resourceEventPatch: ResourceEventPatch; - }) => getClient().resourceEvent.update({ - where: { - id, - createdAt - }, - data: resourceEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .resourceEvent.update({ + where: { + id, + createdAt, + }, + data: resourceEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: resourceEventKeys.detail(variables.id) + queryKey: resourceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceEventKeys.lists() + queryKey: resourceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceInstallationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceInstallationMutation.ts index c05443011f..06b74c1d2d 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceInstallationMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceInstallationMutation.ts @@ -4,83 +4,113 @@ * 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 { resourceInstallationKeys } from "../query-keys"; -import { resourceInstallationMutationKeys } from "../mutation-keys"; -import type { ResourceInstallationSelect, ResourceInstallationWithRelations, ResourceInstallationPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationSelect, ResourceInstallationWithRelations, ResourceInstallationPatch } from "../../orm/input-types"; +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 { resourceInstallationKeys } from '../query-keys'; +import { resourceInstallationMutationKeys } from '../mutation-keys'; +import type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, + ResourceInstallationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, + ResourceInstallationPatch, +} from '../../orm/input-types'; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateResourceInstallationMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', resourceInstallationPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateResourceInstallationMutation(params: { - selection: ({ - fields: S & ResourceInstallationSelect; - } & HookStrictSelect, ResourceInstallationSelect>); -} & Omit; - }; -}, Error, { - id: string; - resourceInstallationPatch: ResourceInstallationPatch; -}>, "mutationFn">): UseMutationResult<{ - updateResourceInstallation: { - resourceInstallation: InferSelectResult; - }; -}, Error, { - id: string; - resourceInstallationPatch: ResourceInstallationPatch; -}>; -export function useUpdateResourceInstallationMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateResourceInstallationMutation( + params: { + selection: { + fields: S & ResourceInstallationSelect; + } & HookStrictSelect, ResourceInstallationSelect>; + } & Omit< + UseMutationOptions< + { + updateResourceInstallation: { + resourceInstallation: InferSelectResult; + }; + }, + Error, + { + id: string; + resourceInstallationPatch: ResourceInstallationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateResourceInstallation: { + resourceInstallation: InferSelectResult; + }; + }, + Error, + { + id: string; + resourceInstallationPatch: ResourceInstallationPatch; + } +>; +export function useUpdateResourceInstallationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + resourceInstallationPatch: ResourceInstallationPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceInstallationMutationKeys.all, mutationFn: ({ id, - resourceInstallationPatch + resourceInstallationPatch, }: { id: string; resourceInstallationPatch: ResourceInstallationPatch; - }) => getClient().resourceInstallation.update({ - where: { - id - }, - data: resourceInstallationPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .resourceInstallation.update({ + where: { + id, + }, + data: resourceInstallationPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: resourceInstallationKeys.detail(variables.id) + queryKey: resourceInstallationKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceInstallationKeys.lists() + queryKey: resourceInstallationKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceMutation.ts index 7e8bab7d46..034de88cf1 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceMutation.ts @@ -4,83 +4,99 @@ * 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 { resourceKeys } from "../query-keys"; -import { resourceMutationKeys } from "../mutation-keys"; -import type { ResourceSelect, ResourceWithRelations, ResourcePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceSelect, ResourceWithRelations, ResourcePatch } from "../../orm/input-types"; +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 { resourceKeys } from '../query-keys'; +import { resourceMutationKeys } from '../mutation-keys'; +import type { ResourceSelect, ResourceWithRelations, ResourcePatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceSelect, ResourceWithRelations, ResourcePatch } from '../../orm/input-types'; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateResourceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', resourcePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateResourceMutation(params: { - selection: ({ - fields: S & ResourceSelect; - } & HookStrictSelect, ResourceSelect>); -} & Omit; - }; -}, Error, { - id: string; - resourcePatch: ResourcePatch; -}>, "mutationFn">): UseMutationResult<{ - updateResource: { - resource: InferSelectResult; - }; -}, Error, { - id: string; - resourcePatch: ResourcePatch; -}>; -export function useUpdateResourceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateResourceMutation( + params: { + selection: { + fields: S & ResourceSelect; + } & HookStrictSelect, ResourceSelect>; + } & Omit< + UseMutationOptions< + { + updateResource: { + resource: InferSelectResult; + }; + }, + Error, + { + id: string; + resourcePatch: ResourcePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateResource: { + resource: InferSelectResult; + }; + }, + Error, + { + id: string; + resourcePatch: ResourcePatch; + } +>; +export function useUpdateResourceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + resourcePatch: ResourcePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceMutationKeys.all, - mutationFn: ({ - id, - resourcePatch - }: { - id: string; - resourcePatch: ResourcePatch; - }) => getClient().resource.update({ - where: { - id - }, - data: resourcePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, resourcePatch }: { id: string; resourcePatch: ResourcePatch }) => + getClient() + .resource.update({ + where: { + id, + }, + data: resourcePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: resourceKeys.detail(variables.id) + queryKey: resourceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceKeys.lists() + queryKey: resourceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceStatusCheckMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceStatusCheckMutation.ts index 7f04107ba9..fcc5f471c8 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceStatusCheckMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceStatusCheckMutation.ts @@ -4,83 +4,113 @@ * 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 { resourceStatusCheckKeys } from "../query-keys"; -import { resourceStatusCheckMutationKeys } from "../mutation-keys"; -import type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations, ResourceStatusCheckPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations, ResourceStatusCheckPatch } from "../../orm/input-types"; +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 { resourceStatusCheckKeys } from '../query-keys'; +import { resourceStatusCheckMutationKeys } from '../mutation-keys'; +import type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, + ResourceStatusCheckPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, + ResourceStatusCheckPatch, +} from '../../orm/input-types'; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateResourceStatusCheckMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', resourceStatusCheckPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateResourceStatusCheckMutation(params: { - selection: ({ - fields: S & ResourceStatusCheckSelect; - } & HookStrictSelect, ResourceStatusCheckSelect>); -} & Omit; - }; -}, Error, { - id: string; - resourceStatusCheckPatch: ResourceStatusCheckPatch; -}>, "mutationFn">): UseMutationResult<{ - updateResourceStatusCheck: { - resourceStatusCheck: InferSelectResult; - }; -}, Error, { - id: string; - resourceStatusCheckPatch: ResourceStatusCheckPatch; -}>; -export function useUpdateResourceStatusCheckMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateResourceStatusCheckMutation( + params: { + selection: { + fields: S & ResourceStatusCheckSelect; + } & HookStrictSelect, ResourceStatusCheckSelect>; + } & Omit< + UseMutationOptions< + { + updateResourceStatusCheck: { + resourceStatusCheck: InferSelectResult; + }; + }, + Error, + { + id: string; + resourceStatusCheckPatch: ResourceStatusCheckPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateResourceStatusCheck: { + resourceStatusCheck: InferSelectResult; + }; + }, + Error, + { + id: string; + resourceStatusCheckPatch: ResourceStatusCheckPatch; + } +>; +export function useUpdateResourceStatusCheckMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + resourceStatusCheckPatch: ResourceStatusCheckPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceStatusCheckMutationKeys.all, mutationFn: ({ id, - resourceStatusCheckPatch + resourceStatusCheckPatch, }: { id: string; resourceStatusCheckPatch: ResourceStatusCheckPatch; - }) => getClient().resourceStatusCheck.update({ - where: { - id - }, - data: resourceStatusCheckPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .resourceStatusCheck.update({ + where: { + id, + }, + data: resourceStatusCheckPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: resourceStatusCheckKeys.detail(variables.id) + queryKey: resourceStatusCheckKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceStatusCheckKeys.lists() + queryKey: resourceStatusCheckKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceUsageLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceUsageLogMutation.ts index f5e8d2393f..093a08fbff 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceUsageLogMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceUsageLogMutation.ts @@ -4,61 +4,88 @@ * 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 { resourceUsageLogKeys } from "../query-keys"; -import { resourceUsageLogMutationKeys } from "../mutation-keys"; -import type { ResourceUsageLogSelect, ResourceUsageLogWithRelations, ResourceUsageLogPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageLogSelect, ResourceUsageLogWithRelations, ResourceUsageLogPatch } from "../../orm/input-types"; +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 { resourceUsageLogKeys } from '../query-keys'; +import { resourceUsageLogMutationKeys } from '../mutation-keys'; +import type { + ResourceUsageLogSelect, + ResourceUsageLogWithRelations, + ResourceUsageLogPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceUsageLogSelect, + ResourceUsageLogWithRelations, + ResourceUsageLogPatch, +} from '../../orm/input-types'; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateResourceUsageLogMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', resourceUsageLogPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateResourceUsageLogMutation(params: { - selection: ({ - fields: S & ResourceUsageLogSelect; - } & HookStrictSelect, ResourceUsageLogSelect>); -} & Omit; - }; -}, Error, { - id: string; - sampledAt: string; - resourceUsageLogPatch: ResourceUsageLogPatch; -}>, "mutationFn">): UseMutationResult<{ - updateResourceUsageLog: { - resourceUsageLog: InferSelectResult; - }; -}, Error, { - id: string; - sampledAt: string; - resourceUsageLogPatch: ResourceUsageLogPatch; -}>; -export function useUpdateResourceUsageLogMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateResourceUsageLogMutation( + params: { + selection: { + fields: S & ResourceUsageLogSelect; + } & HookStrictSelect, ResourceUsageLogSelect>; + } & Omit< + UseMutationOptions< + { + updateResourceUsageLog: { + resourceUsageLog: InferSelectResult; + }; + }, + Error, + { + id: string; + sampledAt: string; + resourceUsageLogPatch: ResourceUsageLogPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateResourceUsageLog: { + resourceUsageLog: InferSelectResult; + }; + }, + Error, + { + id: string; + sampledAt: string; + resourceUsageLogPatch: ResourceUsageLogPatch; + } +>; +export function useUpdateResourceUsageLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + sampledAt: string; + resourceUsageLogPatch: ResourceUsageLogPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateResourceUsageLogMutation(params: { mutationFn: ({ id, sampledAt, - resourceUsageLogPatch + resourceUsageLogPatch, }: { id: string; sampledAt: string; resourceUsageLogPatch: ResourceUsageLogPatch; - }) => getClient().resourceUsageLog.update({ - where: { - id, - sampledAt - }, - data: resourceUsageLogPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .resourceUsageLog.update({ + where: { + id, + sampledAt, + }, + data: resourceUsageLogPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: resourceUsageLogKeys.detail(variables.id) + queryKey: resourceUsageLogKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceUsageLogKeys.lists() + queryKey: resourceUsageLogKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceUsageSummaryMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceUsageSummaryMutation.ts index 83d3c62586..41fa49e9d2 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceUsageSummaryMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateResourceUsageSummaryMutation.ts @@ -4,61 +4,88 @@ * 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 { resourceUsageSummaryKeys } from "../query-keys"; -import { resourceUsageSummaryMutationKeys } from "../mutation-keys"; -import type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations, ResourceUsageSummaryPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations, ResourceUsageSummaryPatch } from "../../orm/input-types"; +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 { resourceUsageSummaryKeys } from '../query-keys'; +import { resourceUsageSummaryMutationKeys } from '../mutation-keys'; +import type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, + ResourceUsageSummaryPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, + ResourceUsageSummaryPatch, +} from '../../orm/input-types'; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateResourceUsageSummaryMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', resourceUsageSummaryPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateResourceUsageSummaryMutation(params: { - selection: ({ - fields: S & ResourceUsageSummarySelect; - } & HookStrictSelect, ResourceUsageSummarySelect>); -} & Omit; - }; -}, Error, { - id: string; - date: string; - resourceUsageSummaryPatch: ResourceUsageSummaryPatch; -}>, "mutationFn">): UseMutationResult<{ - updateResourceUsageSummary: { - resourceUsageSummary: InferSelectResult; - }; -}, Error, { - id: string; - date: string; - resourceUsageSummaryPatch: ResourceUsageSummaryPatch; -}>; -export function useUpdateResourceUsageSummaryMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateResourceUsageSummaryMutation( + params: { + selection: { + fields: S & ResourceUsageSummarySelect; + } & HookStrictSelect, ResourceUsageSummarySelect>; + } & Omit< + UseMutationOptions< + { + updateResourceUsageSummary: { + resourceUsageSummary: InferSelectResult; + }; + }, + Error, + { + id: string; + date: string; + resourceUsageSummaryPatch: ResourceUsageSummaryPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateResourceUsageSummary: { + resourceUsageSummary: InferSelectResult; + }; + }, + Error, + { + id: string; + date: string; + resourceUsageSummaryPatch: ResourceUsageSummaryPatch; + } +>; +export function useUpdateResourceUsageSummaryMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + date: string; + resourceUsageSummaryPatch: ResourceUsageSummaryPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateResourceUsageSummaryMutation(params: { mutationFn: ({ id, date, - resourceUsageSummaryPatch + resourceUsageSummaryPatch, }: { id: string; date: string; resourceUsageSummaryPatch: ResourceUsageSummaryPatch; - }) => getClient().resourceUsageSummary.update({ - where: { - id, - date - }, - data: resourceUsageSummaryPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .resourceUsageSummary.update({ + where: { + id, + date, + }, + data: resourceUsageSummaryPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: resourceUsageSummaryKeys.detail(variables.id) + queryKey: resourceUsageSummaryKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceUsageSummaryKeys.lists() + queryKey: resourceUsageSummaryKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateWebhookEndpointMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateWebhookEndpointMutation.ts index 152df97d59..c9a6244775 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateWebhookEndpointMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateWebhookEndpointMutation.ts @@ -4,83 +4,113 @@ * 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 { webhookEndpointKeys } from "../query-keys"; -import { webhookEndpointMutationKeys } from "../mutation-keys"; -import type { WebhookEndpointSelect, WebhookEndpointWithRelations, WebhookEndpointPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEndpointSelect, WebhookEndpointWithRelations, WebhookEndpointPatch } from "../../orm/input-types"; +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 { webhookEndpointKeys } from '../query-keys'; +import { webhookEndpointMutationKeys } from '../mutation-keys'; +import type { + WebhookEndpointSelect, + WebhookEndpointWithRelations, + WebhookEndpointPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebhookEndpointSelect, + WebhookEndpointWithRelations, + WebhookEndpointPatch, +} from '../../orm/input-types'; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateWebhookEndpointMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', webhookEndpointPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateWebhookEndpointMutation(params: { - selection: ({ - fields: S & WebhookEndpointSelect; - } & HookStrictSelect, WebhookEndpointSelect>); -} & Omit; - }; -}, Error, { - id: string; - webhookEndpointPatch: WebhookEndpointPatch; -}>, "mutationFn">): UseMutationResult<{ - updateWebhookEndpoint: { - webhookEndpoint: InferSelectResult; - }; -}, Error, { - id: string; - webhookEndpointPatch: WebhookEndpointPatch; -}>; -export function useUpdateWebhookEndpointMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateWebhookEndpointMutation( + params: { + selection: { + fields: S & WebhookEndpointSelect; + } & HookStrictSelect, WebhookEndpointSelect>; + } & Omit< + UseMutationOptions< + { + updateWebhookEndpoint: { + webhookEndpoint: InferSelectResult; + }; + }, + Error, + { + id: string; + webhookEndpointPatch: WebhookEndpointPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateWebhookEndpoint: { + webhookEndpoint: InferSelectResult; + }; + }, + Error, + { + id: string; + webhookEndpointPatch: WebhookEndpointPatch; + } +>; +export function useUpdateWebhookEndpointMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + webhookEndpointPatch: WebhookEndpointPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookEndpointMutationKeys.all, mutationFn: ({ id, - webhookEndpointPatch + webhookEndpointPatch, }: { id: string; webhookEndpointPatch: WebhookEndpointPatch; - }) => getClient().webhookEndpoint.update({ - where: { - id - }, - data: webhookEndpointPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .webhookEndpoint.update({ + where: { + id, + }, + data: webhookEndpointPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: webhookEndpointKeys.detail(variables.id) + queryKey: webhookEndpointKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webhookEndpointKeys.lists() + queryKey: webhookEndpointKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateWebhookEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateWebhookEventMutation.ts index 4bc9617b4f..aa6cbb9dcb 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateWebhookEventMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateWebhookEventMutation.ts @@ -4,83 +4,107 @@ * 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 { webhookEventKeys } from "../query-keys"; -import { webhookEventMutationKeys } from "../mutation-keys"; -import type { WebhookEventSelect, WebhookEventWithRelations, WebhookEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEventSelect, WebhookEventWithRelations, WebhookEventPatch } from "../../orm/input-types"; +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 { webhookEventKeys } from '../query-keys'; +import { webhookEventMutationKeys } from '../mutation-keys'; +import type { + WebhookEventSelect, + WebhookEventWithRelations, + WebhookEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebhookEventSelect, + WebhookEventWithRelations, + WebhookEventPatch, +} from '../../orm/input-types'; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateWebhookEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', webhookEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateWebhookEventMutation(params: { - selection: ({ - fields: S & WebhookEventSelect; - } & HookStrictSelect, WebhookEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - webhookEventPatch: WebhookEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updateWebhookEvent: { - webhookEvent: InferSelectResult; - }; -}, Error, { - id: string; - webhookEventPatch: WebhookEventPatch; -}>; -export function useUpdateWebhookEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateWebhookEventMutation( + params: { + selection: { + fields: S & WebhookEventSelect; + } & HookStrictSelect, WebhookEventSelect>; + } & Omit< + UseMutationOptions< + { + updateWebhookEvent: { + webhookEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + webhookEventPatch: WebhookEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateWebhookEvent: { + webhookEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + webhookEventPatch: WebhookEventPatch; + } +>; +export function useUpdateWebhookEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + webhookEventPatch: WebhookEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookEventMutationKeys.all, - mutationFn: ({ - id, - webhookEventPatch - }: { - id: string; - webhookEventPatch: WebhookEventPatch; - }) => getClient().webhookEvent.update({ - where: { - id - }, - data: webhookEventPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, webhookEventPatch }: { id: string; webhookEventPatch: WebhookEventPatch }) => + getClient() + .webhookEvent.update({ + where: { + id, + }, + data: webhookEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: webhookEventKeys.detail(variables.id) + queryKey: webhookEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webhookEventKeys.lists() + queryKey: webhookEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useValidateFunctionGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useValidateFunctionGraphMutation.ts index 590874e830..c6cd62a410 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/useValidateFunctionGraphMutation.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/useValidateFunctionGraphMutation.ts @@ -4,39 +4,55 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ValidateFunctionGraphVariables } from "../../orm/mutation"; -import type { ValidateFunctionGraphPayloadSelect, ValidateFunctionGraphPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ValidateFunctionGraphVariables } from "../../orm/mutation"; -export type { ValidateFunctionGraphPayloadSelect } from "../../orm/input-types"; -export function useValidateFunctionGraphMutation(params: { - selection: ({ - fields: S & ValidateFunctionGraphPayloadSelect; - } & HookStrictSelect, ValidateFunctionGraphPayloadSelect>); -} & Omit | null; -}, Error, ValidateFunctionGraphVariables>, "mutationFn">): UseMutationResult<{ - validateFunctionGraph: InferSelectResult | null; -}, Error, ValidateFunctionGraphVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ValidateFunctionGraphVariables } from '../../orm/mutation'; +import type { + ValidateFunctionGraphPayloadSelect, + ValidateFunctionGraphPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ValidateFunctionGraphVariables } from '../../orm/mutation'; +export type { ValidateFunctionGraphPayloadSelect } from '../../orm/input-types'; +export function useValidateFunctionGraphMutation( + params: { + selection: { + fields: S & ValidateFunctionGraphPayloadSelect; + } & HookStrictSelect, ValidateFunctionGraphPayloadSelect>; + } & Omit< + UseMutationOptions< + { + validateFunctionGraph: InferSelectResult | null; + }, + Error, + ValidateFunctionGraphVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + validateFunctionGraph: InferSelectResult | null; + }, + Error, + ValidateFunctionGraphVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.validateFunctionGraph(), - mutationFn: (variables: ValidateFunctionGraphVariables) => getClient().mutation.validateFunctionGraph(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ValidateFunctionGraphVariables) => + getClient() + .mutation.validateFunctionGraph(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/index.ts b/sdk/constructive-react/src/compute/hooks/queries/index.ts index e2a3900b12..d8346e3825 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/index.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/index.ts @@ -3,127 +3,127 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useDbPresetsQuery"; -export * from "./useDbPresetQuery"; -export * from "./useFunctionApiBindingsQuery"; -export * from "./useFunctionApiBindingQuery"; -export * from "./useFunctionDefinitionsQuery"; -export * from "./useFunctionDefinitionQuery"; -export * from "./useFunctionDeploymentsQuery"; -export * from "./useFunctionDeploymentQuery"; -export * from "./useFunctionDeploymentEventsQuery"; -export * from "./useFunctionDeploymentEventQuery"; -export * from "./useFunctionExecutionLogsQuery"; -export * from "./useFunctionExecutionLogQuery"; -export * from "./useFunctionGraphCommitsQuery"; -export * from "./useFunctionGraphCommitQuery"; -export * from "./useFunctionGraphsQuery"; -export * from "./useFunctionGraphQuery"; -export * from "./useFunctionGraphExecutionsQuery"; -export * from "./useFunctionGraphExecutionQuery"; -export * from "./useFunctionGraphExecutionNodeStatesQuery"; -export * from "./useFunctionGraphExecutionNodeStateQuery"; -export * from "./useFunctionGraphExecutionOutputsQuery"; -export * from "./useFunctionGraphExecutionOutputQuery"; -export * from "./useFunctionGraphObjectsQuery"; -export * from "./useFunctionGraphObjectQuery"; -export * from "./useFunctionGraphRefsQuery"; -export * from "./useFunctionGraphRefQuery"; -export * from "./useFunctionGraphStoresQuery"; -export * from "./useFunctionGraphStoreQuery"; -export * from "./useFunctionInvocationAttemptsQuery"; -export * from "./useFunctionInvocationAttemptQuery"; -export * from "./useFunctionInvocationsQuery"; -export * from "./useFunctionInvocationQuery"; -export * from "./useGetAllTreeNodesQuery"; -export * from "./useInfraCommitsQuery"; -export * from "./useInfraCommitQuery"; -export * from "./useInfraGetAllTreeNodesQuery"; -export * from "./useInfraObjectsQuery"; -export * from "./useInfraObjectQuery"; -export * from "./useInfraRefsQuery"; -export * from "./useInfraRefQuery"; -export * from "./useInfraStoresQuery"; -export * from "./useInfraStoreQuery"; -export * from "./useIntegrationProvidersQuery"; -export * from "./useIntegrationProviderQuery"; -export * from "./useNamespacesQuery"; -export * from "./useNamespaceQuery"; -export * from "./useNamespaceEventsQuery"; -export * from "./useNamespaceEventQuery"; -export * from "./usePlatformFunctionApiBindingsQuery"; -export * from "./usePlatformFunctionApiBindingQuery"; -export * from "./usePlatformFunctionDefinitionsQuery"; -export * from "./usePlatformFunctionDefinitionQuery"; -export * from "./usePlatformFunctionDeploymentsQuery"; -export * from "./usePlatformFunctionDeploymentQuery"; -export * from "./usePlatformFunctionDeploymentEventsQuery"; -export * from "./usePlatformFunctionDeploymentEventQuery"; -export * from "./usePlatformFunctionExecutionLogsQuery"; -export * from "./usePlatformFunctionExecutionLogQuery"; -export * from "./usePlatformFunctionInvocationAttemptsQuery"; -export * from "./usePlatformFunctionInvocationAttemptQuery"; -export * from "./usePlatformFunctionInvocationsQuery"; -export * from "./usePlatformFunctionInvocationQuery"; -export * from "./usePlatformInfraCommitsQuery"; -export * from "./usePlatformInfraCommitQuery"; -export * from "./usePlatformInfraGetAllTreeNodesQuery"; -export * from "./usePlatformInfraObjectsQuery"; -export * from "./usePlatformInfraObjectQuery"; -export * from "./usePlatformInfraRefsQuery"; -export * from "./usePlatformInfraRefQuery"; -export * from "./usePlatformInfraStoresQuery"; -export * from "./usePlatformInfraStoreQuery"; -export * from "./usePlatformNamespacesQuery"; -export * from "./usePlatformNamespaceQuery"; -export * from "./usePlatformNamespaceEventsQuery"; -export * from "./usePlatformNamespaceEventQuery"; -export * from "./usePlatformResourcesQuery"; -export * from "./usePlatformResourceQuery"; -export * from "./usePlatformResourceDeclaredCapacitiesQuery"; -export * from "./usePlatformResourceDefinitionsQuery"; -export * from "./usePlatformResourceDefinitionQuery"; -export * from "./usePlatformResourceEventsQuery"; -export * from "./usePlatformResourceEventQuery"; -export * from "./usePlatformResourceInstallationsQuery"; -export * from "./usePlatformResourceInstallationQuery"; -export * from "./usePlatformResourceStatusChecksQuery"; -export * from "./usePlatformResourceStatusCheckQuery"; -export * from "./usePlatformResourceUsageLogsQuery"; -export * from "./usePlatformResourceUsageLogQuery"; -export * from "./usePlatformResourceUsageSummariesQuery"; -export * from "./usePlatformResourceUsageSummaryQuery"; -export * from "./usePlatformResourceUtilizationsQuery"; -export * from "./usePlatformResourcesHealthsQuery"; -export * from "./usePlatformResourcesHealthQuery"; -export * from "./usePlatformResourcesRequirementsStatesQuery"; -export * from "./usePlatformResourcesResolvedRequirementsQuery"; -export * from "./usePlatformWebhookEndpointsQuery"; -export * from "./usePlatformWebhookEndpointQuery"; -export * from "./usePlatformWebhookEventsQuery"; -export * from "./usePlatformWebhookEventQuery"; -export * from "./useResourcesQuery"; -export * from "./useResourceQuery"; -export * from "./useResourceDeclaredCapacitiesQuery"; -export * from "./useResourceDefinitionsQuery"; -export * from "./useResourceDefinitionQuery"; -export * from "./useResourceEventsQuery"; -export * from "./useResourceEventQuery"; -export * from "./useResourceInstallationsQuery"; -export * from "./useResourceInstallationQuery"; -export * from "./useResourceStatusChecksQuery"; -export * from "./useResourceStatusCheckQuery"; -export * from "./useResourceUsageLogsQuery"; -export * from "./useResourceUsageLogQuery"; -export * from "./useResourceUsageSummariesQuery"; -export * from "./useResourceUsageSummaryQuery"; -export * from "./useResourceUtilizationsQuery"; -export * from "./useResourcesHealthsQuery"; -export * from "./useResourcesHealthQuery"; -export * from "./useResourcesRequirementsStatesQuery"; -export * from "./useResourcesResolvedRequirementsQuery"; -export * from "./useWebhookEndpointsQuery"; -export * from "./useWebhookEndpointQuery"; -export * from "./useWebhookEventsQuery"; -export * from "./useWebhookEventQuery"; -export * from "./useReadFunctionGraphQuery"; \ No newline at end of file +export * from './useDbPresetsQuery'; +export * from './useDbPresetQuery'; +export * from './useFunctionApiBindingsQuery'; +export * from './useFunctionApiBindingQuery'; +export * from './useFunctionDefinitionsQuery'; +export * from './useFunctionDefinitionQuery'; +export * from './useFunctionDeploymentsQuery'; +export * from './useFunctionDeploymentQuery'; +export * from './useFunctionDeploymentEventsQuery'; +export * from './useFunctionDeploymentEventQuery'; +export * from './useFunctionExecutionLogsQuery'; +export * from './useFunctionExecutionLogQuery'; +export * from './useFunctionGraphCommitsQuery'; +export * from './useFunctionGraphCommitQuery'; +export * from './useFunctionGraphsQuery'; +export * from './useFunctionGraphQuery'; +export * from './useFunctionGraphExecutionsQuery'; +export * from './useFunctionGraphExecutionQuery'; +export * from './useFunctionGraphExecutionNodeStatesQuery'; +export * from './useFunctionGraphExecutionNodeStateQuery'; +export * from './useFunctionGraphExecutionOutputsQuery'; +export * from './useFunctionGraphExecutionOutputQuery'; +export * from './useFunctionGraphObjectsQuery'; +export * from './useFunctionGraphObjectQuery'; +export * from './useFunctionGraphRefsQuery'; +export * from './useFunctionGraphRefQuery'; +export * from './useFunctionGraphStoresQuery'; +export * from './useFunctionGraphStoreQuery'; +export * from './useFunctionInvocationAttemptsQuery'; +export * from './useFunctionInvocationAttemptQuery'; +export * from './useFunctionInvocationsQuery'; +export * from './useFunctionInvocationQuery'; +export * from './useGetAllTreeNodesQuery'; +export * from './useInfraCommitsQuery'; +export * from './useInfraCommitQuery'; +export * from './useInfraGetAllTreeNodesQuery'; +export * from './useInfraObjectsQuery'; +export * from './useInfraObjectQuery'; +export * from './useInfraRefsQuery'; +export * from './useInfraRefQuery'; +export * from './useInfraStoresQuery'; +export * from './useInfraStoreQuery'; +export * from './useIntegrationProvidersQuery'; +export * from './useIntegrationProviderQuery'; +export * from './useNamespacesQuery'; +export * from './useNamespaceQuery'; +export * from './useNamespaceEventsQuery'; +export * from './useNamespaceEventQuery'; +export * from './usePlatformFunctionApiBindingsQuery'; +export * from './usePlatformFunctionApiBindingQuery'; +export * from './usePlatformFunctionDefinitionsQuery'; +export * from './usePlatformFunctionDefinitionQuery'; +export * from './usePlatformFunctionDeploymentsQuery'; +export * from './usePlatformFunctionDeploymentQuery'; +export * from './usePlatformFunctionDeploymentEventsQuery'; +export * from './usePlatformFunctionDeploymentEventQuery'; +export * from './usePlatformFunctionExecutionLogsQuery'; +export * from './usePlatformFunctionExecutionLogQuery'; +export * from './usePlatformFunctionInvocationAttemptsQuery'; +export * from './usePlatformFunctionInvocationAttemptQuery'; +export * from './usePlatformFunctionInvocationsQuery'; +export * from './usePlatformFunctionInvocationQuery'; +export * from './usePlatformInfraCommitsQuery'; +export * from './usePlatformInfraCommitQuery'; +export * from './usePlatformInfraGetAllTreeNodesQuery'; +export * from './usePlatformInfraObjectsQuery'; +export * from './usePlatformInfraObjectQuery'; +export * from './usePlatformInfraRefsQuery'; +export * from './usePlatformInfraRefQuery'; +export * from './usePlatformInfraStoresQuery'; +export * from './usePlatformInfraStoreQuery'; +export * from './usePlatformNamespacesQuery'; +export * from './usePlatformNamespaceQuery'; +export * from './usePlatformNamespaceEventsQuery'; +export * from './usePlatformNamespaceEventQuery'; +export * from './usePlatformResourcesQuery'; +export * from './usePlatformResourceQuery'; +export * from './usePlatformResourceDeclaredCapacitiesQuery'; +export * from './usePlatformResourceDefinitionsQuery'; +export * from './usePlatformResourceDefinitionQuery'; +export * from './usePlatformResourceEventsQuery'; +export * from './usePlatformResourceEventQuery'; +export * from './usePlatformResourceInstallationsQuery'; +export * from './usePlatformResourceInstallationQuery'; +export * from './usePlatformResourceStatusChecksQuery'; +export * from './usePlatformResourceStatusCheckQuery'; +export * from './usePlatformResourceUsageLogsQuery'; +export * from './usePlatformResourceUsageLogQuery'; +export * from './usePlatformResourceUsageSummariesQuery'; +export * from './usePlatformResourceUsageSummaryQuery'; +export * from './usePlatformResourceUtilizationsQuery'; +export * from './usePlatformResourcesHealthsQuery'; +export * from './usePlatformResourcesHealthQuery'; +export * from './usePlatformResourcesRequirementsStatesQuery'; +export * from './usePlatformResourcesResolvedRequirementsQuery'; +export * from './usePlatformWebhookEndpointsQuery'; +export * from './usePlatformWebhookEndpointQuery'; +export * from './usePlatformWebhookEventsQuery'; +export * from './usePlatformWebhookEventQuery'; +export * from './useResourcesQuery'; +export * from './useResourceQuery'; +export * from './useResourceDeclaredCapacitiesQuery'; +export * from './useResourceDefinitionsQuery'; +export * from './useResourceDefinitionQuery'; +export * from './useResourceEventsQuery'; +export * from './useResourceEventQuery'; +export * from './useResourceInstallationsQuery'; +export * from './useResourceInstallationQuery'; +export * from './useResourceStatusChecksQuery'; +export * from './useResourceStatusCheckQuery'; +export * from './useResourceUsageLogsQuery'; +export * from './useResourceUsageLogQuery'; +export * from './useResourceUsageSummariesQuery'; +export * from './useResourceUsageSummaryQuery'; +export * from './useResourceUtilizationsQuery'; +export * from './useResourcesHealthsQuery'; +export * from './useResourcesHealthQuery'; +export * from './useResourcesRequirementsStatesQuery'; +export * from './useResourcesResolvedRequirementsQuery'; +export * from './useWebhookEndpointsQuery'; +export * from './useWebhookEndpointQuery'; +export * from './useWebhookEventsQuery'; +export * from './useWebhookEventQuery'; +export * from './useReadFunctionGraphQuery'; diff --git a/sdk/constructive-react/src/compute/hooks/queries/useDbPresetQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useDbPresetQuery.ts index f4a5621477..73c6743a01 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useDbPresetQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useDbPresetQuery.ts @@ -4,20 +4,20 @@ * 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 { dbPresetKeys } from "../query-keys"; -import type { DbPresetSelect, DbPresetWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import type { DbPresetSelect, DbPresetWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPresetSelect, DbPresetWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPresetQueryKey = dbPresetKeys.detail; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { data, isLoading } = useDbPresetQuery({ @@ -26,38 +26,52 @@ export const dbPresetQueryKey = dbPresetKeys.detail; * }); * ``` */ -export function useDbPresetQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPresetSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPresetQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDbPresetQuery< + S extends DbPresetSelect, + TData = { + dbPreset: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPresetSelect>; + } & Omit< + UseQueryOptions< + { + dbPreset: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPresetQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPresetKeys.detail(params.id), - queryFn: () => getClient().dbPreset.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .dbPreset.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```ts * const data = await fetchDbPresetQuery({ @@ -79,35 +93,46 @@ export async function fetchDbPresetQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().dbPreset.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .dbPreset.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```ts * await prefetchDbPresetQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDbPresetQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPresetSelect>; -}): Promise; -export async function prefetchDbPresetQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDbPresetQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPresetSelect>; + } +): Promise; +export async function prefetchDbPresetQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: dbPresetKeys.detail(params.id), - queryFn: () => getClient().dbPreset.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .dbPreset.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useDbPresetsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useDbPresetsQuery.ts index 17f3ecabf1..1aa1bdb140 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useDbPresetsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useDbPresetsQuery.ts @@ -4,20 +4,35 @@ * 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 { dbPresetKeys } from "../query-keys"; -import type { DbPresetSelect, DbPresetWithRelations, DbPresetFilter, DbPresetOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations, DbPresetFilter, DbPresetOrderBy } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import type { + DbPresetSelect, + DbPresetWithRelations, + DbPresetFilter, + DbPresetOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DbPresetSelect, + DbPresetWithRelations, + DbPresetFilter, + DbPresetOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPresetsQueryKey = dbPresetKeys.list; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { data, isLoading } = useDbPresetsQuery({ @@ -30,33 +45,47 @@ export const dbPresetsQueryKey = dbPresetKeys.list; * }); * ``` */ -export function useDbPresetsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPresetsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDbPresetsQuery< + S extends DbPresetSelect, + TData = { + dbPresets: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetSelect>; + } & Omit< + UseQueryOptions< + { + dbPresets: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPresetsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPresetKeys.list(args), queryFn: () => getClient().dbPreset.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```ts * const data = await fetchDbPresetsQuery({ @@ -70,35 +99,47 @@ export function useDbPresetsQuery(params: { export async function fetchDbPresetsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetSelect>; }): Promise<{ dbPresets: ConnectionResult>; }>; export async function fetchDbPresetsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().dbPreset.findMany(args).unwrap(); } /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```ts * await prefetchDbPresetsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDbPresetsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetSelect>; -}): Promise; -export async function prefetchDbPresetsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDbPresetsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetSelect>; + } +): Promise; +export async function prefetchDbPresetsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: dbPresetKeys.list(args), - queryFn: () => getClient().dbPreset.findMany(args).unwrap() + queryFn: () => getClient().dbPreset.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingQuery.ts index 3b7bd67d6b..b0a007026e 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionApiBindingKeys } from "../query-keys"; -import type { FunctionApiBindingSelect, FunctionApiBindingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionApiBindingSelect, FunctionApiBindingWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionApiBindingQueryKey = functionApiBindingKeys.detail; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { data, isLoading } = useFunctionApiBindingQuery({ @@ -26,38 +32,52 @@ export const functionApiBindingQueryKey = functionApiBindingKeys.detail; * }); * ``` */ -export function useFunctionApiBindingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionApiBindingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionApiBindingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionApiBindingQuery< + S extends FunctionApiBindingSelect, + TData = { + functionApiBinding: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseQueryOptions< + { + functionApiBinding: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionApiBindingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionApiBindingKeys.detail(params.id), - queryFn: () => getClient().functionApiBinding.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```ts * const data = await fetchFunctionApiBindingQuery({ @@ -79,35 +99,46 @@ export async function fetchFunctionApiBindingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionApiBinding.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```ts * await prefetchFunctionApiBindingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionApiBindingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionApiBindingSelect>; -}): Promise; -export async function prefetchFunctionApiBindingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionApiBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionApiBindingSelect>; + } +): Promise; +export async function prefetchFunctionApiBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionApiBindingKeys.detail(params.id), - queryFn: () => getClient().functionApiBinding.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingsQuery.ts index 4b50ae5884..778b7f6daf 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionApiBindingKeys } from "../query-keys"; -import type { FunctionApiBindingSelect, FunctionApiBindingWithRelations, FunctionApiBindingFilter, FunctionApiBindingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionApiBindingSelect, FunctionApiBindingWithRelations, FunctionApiBindingFilter, FunctionApiBindingOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionApiBindingsQueryKey = functionApiBindingKeys.list; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { data, isLoading } = useFunctionApiBindingsQuery({ @@ -30,33 +45,58 @@ export const functionApiBindingsQueryKey = functionApiBindingKeys.list; * }); * ``` */ -export function useFunctionApiBindingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionApiBindingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionApiBindingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionApiBindingsQuery< + S extends FunctionApiBindingSelect, + TData = { + functionApiBindings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseQueryOptions< + { + functionApiBindings: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionApiBindingsQuery( + params: { + selection: ListSelectionConfig< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionApiBindingKeys.list(args), queryFn: () => getClient().functionApiBinding.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```ts * const data = await fetchFunctionApiBindingsQuery({ @@ -70,35 +110,62 @@ export function useFunctionApiBindingsQuery(params: { export async function fetchFunctionApiBindingsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionApiBindingSelect>; }): Promise<{ functionApiBindings: ConnectionResult>; }>; export async function fetchFunctionApiBindingsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >(params.selection); return getClient().functionApiBinding.findMany(args).unwrap(); } /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```ts * await prefetchFunctionApiBindingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionApiBindingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionApiBindingSelect>; -}): Promise; -export async function prefetchFunctionApiBindingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionApiBindingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionApiBindingSelect>; + } +): Promise; +export async function prefetchFunctionApiBindingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionApiBindingKeys.list(args), - queryFn: () => getClient().functionApiBinding.findMany(args).unwrap() + queryFn: () => getClient().functionApiBinding.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionQuery.ts index 48f9b3be68..c6d10b7109 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDefinitionKeys } from "../query-keys"; -import type { FunctionDefinitionSelect, FunctionDefinitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDefinitionSelect, FunctionDefinitionWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionDefinitionQueryKey = functionDefinitionKeys.detail; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { data, isLoading } = useFunctionDefinitionQuery({ @@ -26,38 +32,52 @@ export const functionDefinitionQueryKey = functionDefinitionKeys.detail; * }); * ``` */ -export function useFunctionDefinitionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionDefinitionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionDefinitionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionDefinitionQuery< + S extends FunctionDefinitionSelect, + TData = { + functionDefinition: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + functionDefinition: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDefinitionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionDefinitionKeys.detail(params.id), - queryFn: () => getClient().functionDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```ts * const data = await fetchFunctionDefinitionQuery({ @@ -79,35 +99,46 @@ export async function fetchFunctionDefinitionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```ts * await prefetchFunctionDefinitionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionDefinitionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionDefinitionSelect>; -}): Promise; -export async function prefetchFunctionDefinitionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDefinitionSelect>; + } +): Promise; +export async function prefetchFunctionDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionDefinitionKeys.detail(params.id), - queryFn: () => getClient().functionDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionsQuery.ts index 0772c543fa..5087f1f27a 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionDefinitionKeys } from "../query-keys"; -import type { FunctionDefinitionSelect, FunctionDefinitionWithRelations, FunctionDefinitionFilter, FunctionDefinitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDefinitionSelect, FunctionDefinitionWithRelations, FunctionDefinitionFilter, FunctionDefinitionOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionDefinitionsQueryKey = functionDefinitionKeys.list; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { data, isLoading } = useFunctionDefinitionsQuery({ @@ -30,33 +45,58 @@ export const functionDefinitionsQueryKey = functionDefinitionKeys.list; * }); * ``` */ -export function useFunctionDefinitionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDefinitionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionDefinitionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionDefinitionsQuery< + S extends FunctionDefinitionSelect, + TData = { + functionDefinitions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + functionDefinitions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDefinitionsQuery( + params: { + selection: ListSelectionConfig< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionDefinitionKeys.list(args), queryFn: () => getClient().functionDefinition.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```ts * const data = await fetchFunctionDefinitionsQuery({ @@ -70,35 +110,62 @@ export function useFunctionDefinitionsQuery(params: { export async function fetchFunctionDefinitionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionDefinitionSelect>; }): Promise<{ functionDefinitions: ConnectionResult>; }>; export async function fetchFunctionDefinitionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >(params.selection); return getClient().functionDefinition.findMany(args).unwrap(); } /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```ts * await prefetchFunctionDefinitionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionDefinitionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDefinitionSelect>; -}): Promise; -export async function prefetchFunctionDefinitionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDefinitionSelect>; + } +): Promise; +export async function prefetchFunctionDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionDefinitionKeys.list(args), - queryFn: () => getClient().functionDefinition.findMany(args).unwrap() + queryFn: () => getClient().functionDefinition.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventQuery.ts index 5ef61235d0..8eaed05c76 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentEventKeys } from "../query-keys"; -import type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionDeploymentEventQueryKey = functionDeploymentEventKeys.detail; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { data, isLoading } = useFunctionDeploymentEventQuery({ @@ -26,38 +32,52 @@ export const functionDeploymentEventQueryKey = functionDeploymentEventKeys.detai * }); * ``` */ -export function useFunctionDeploymentEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionDeploymentEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionDeploymentEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionDeploymentEventQuery< + S extends FunctionDeploymentEventSelect, + TData = { + functionDeploymentEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseQueryOptions< + { + functionDeploymentEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionDeploymentEventKeys.detail(params.id), - queryFn: () => getClient().functionDeploymentEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```ts * const data = await fetchFunctionDeploymentEventQuery({ @@ -66,7 +86,9 @@ export function useFunctionDeploymentEventQuery(params: { * }); * ``` */ -export async function fetchFunctionDeploymentEventQuery(params: { +export async function fetchFunctionDeploymentEventQuery< + S extends FunctionDeploymentEventSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchFunctionDeploymentEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionDeploymentEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```ts * await prefetchFunctionDeploymentEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionDeploymentEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionDeploymentEventSelect>; -}): Promise; -export async function prefetchFunctionDeploymentEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionDeploymentEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionDeploymentEventKeys.detail(params.id), - queryFn: () => getClient().functionDeploymentEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventsQuery.ts index 30e7d06cba..a2f06adeb7 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionDeploymentEventKeys } from "../query-keys"; -import type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations, FunctionDeploymentEventFilter, FunctionDeploymentEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentEventSelect, FunctionDeploymentEventWithRelations, FunctionDeploymentEventFilter, FunctionDeploymentEventOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionDeploymentEventsQueryKey = functionDeploymentEventKeys.list; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { data, isLoading } = useFunctionDeploymentEventsQuery({ @@ -30,33 +45,60 @@ export const functionDeploymentEventsQueryKey = functionDeploymentEventKeys.list * }); * ``` */ -export function useFunctionDeploymentEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionDeploymentEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionDeploymentEventsQuery< + S extends FunctionDeploymentEventSelect, + TData = { + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseQueryOptions< + { + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentEventsQuery( + params: { + selection: ListSelectionConfig< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionDeploymentEventKeys.list(args), queryFn: () => getClient().functionDeploymentEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```ts * const data = await fetchFunctionDeploymentEventsQuery({ @@ -67,38 +109,74 @@ export function useFunctionDeploymentEventsQuery(params: { * }); * ``` */ -export async function fetchFunctionDeploymentEventsQuery(params: { +export async function fetchFunctionDeploymentEventsQuery< + S extends FunctionDeploymentEventSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentEventSelect>; }): Promise<{ - functionDeploymentEvents: ConnectionResult>; + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; }>; export async function fetchFunctionDeploymentEventsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >(params.selection); return getClient().functionDeploymentEvent.findMany(args).unwrap(); } /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```ts * await prefetchFunctionDeploymentEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionDeploymentEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentEventSelect>; -}): Promise; -export async function prefetchFunctionDeploymentEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionDeploymentEventsQuery< + S extends FunctionDeploymentEventSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentEventSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionDeploymentEventKeys.list(args), - queryFn: () => getClient().functionDeploymentEvent.findMany(args).unwrap() + queryFn: () => getClient().functionDeploymentEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentQuery.ts index 3ce17c5e83..b772650df6 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentKeys } from "../query-keys"; -import type { FunctionDeploymentSelect, FunctionDeploymentWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentSelect, FunctionDeploymentWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionDeploymentQueryKey = functionDeploymentKeys.detail; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { data, isLoading } = useFunctionDeploymentQuery({ @@ -26,38 +32,52 @@ export const functionDeploymentQueryKey = functionDeploymentKeys.detail; * }); * ``` */ -export function useFunctionDeploymentQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionDeploymentSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionDeploymentQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionDeploymentQuery< + S extends FunctionDeploymentSelect, + TData = { + functionDeployment: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseQueryOptions< + { + functionDeployment: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionDeploymentKeys.detail(params.id), - queryFn: () => getClient().functionDeployment.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```ts * const data = await fetchFunctionDeploymentQuery({ @@ -79,35 +99,46 @@ export async function fetchFunctionDeploymentQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionDeployment.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```ts * await prefetchFunctionDeploymentQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionDeploymentQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionDeploymentSelect>; -}): Promise; -export async function prefetchFunctionDeploymentQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionDeploymentQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionDeploymentKeys.detail(params.id), - queryFn: () => getClient().functionDeployment.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentsQuery.ts index 5bcaa1a3b6..420e1aed5a 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionDeploymentKeys } from "../query-keys"; -import type { FunctionDeploymentSelect, FunctionDeploymentWithRelations, FunctionDeploymentFilter, FunctionDeploymentOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentSelect, FunctionDeploymentWithRelations, FunctionDeploymentFilter, FunctionDeploymentOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionDeploymentsQueryKey = functionDeploymentKeys.list; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { data, isLoading } = useFunctionDeploymentsQuery({ @@ -30,33 +45,58 @@ export const functionDeploymentsQueryKey = functionDeploymentKeys.list; * }); * ``` */ -export function useFunctionDeploymentsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionDeploymentsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionDeploymentsQuery< + S extends FunctionDeploymentSelect, + TData = { + functionDeployments: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseQueryOptions< + { + functionDeployments: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentsQuery( + params: { + selection: ListSelectionConfig< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionDeploymentKeys.list(args), queryFn: () => getClient().functionDeployment.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```ts * const data = await fetchFunctionDeploymentsQuery({ @@ -70,35 +110,62 @@ export function useFunctionDeploymentsQuery(params: { export async function fetchFunctionDeploymentsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionDeploymentSelect>; }): Promise<{ functionDeployments: ConnectionResult>; }>; export async function fetchFunctionDeploymentsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >(params.selection); return getClient().functionDeployment.findMany(args).unwrap(); } /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```ts * await prefetchFunctionDeploymentsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionDeploymentsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentSelect>; -}): Promise; -export async function prefetchFunctionDeploymentsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionDeploymentsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionDeploymentKeys.list(args), - queryFn: () => getClient().functionDeployment.findMany(args).unwrap() + queryFn: () => getClient().functionDeployment.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogQuery.ts index 29eecc67b1..074fef50e0 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionExecutionLogKeys } from "../query-keys"; -import type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionExecutionLogQueryKey = functionExecutionLogKeys.detail; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { data, isLoading } = useFunctionExecutionLogQuery({ @@ -26,38 +32,52 @@ export const functionExecutionLogQueryKey = functionExecutionLogKeys.detail; * }); * ``` */ -export function useFunctionExecutionLogQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionExecutionLogSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionExecutionLogQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionExecutionLogQuery< + S extends FunctionExecutionLogSelect, + TData = { + functionExecutionLog: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseQueryOptions< + { + functionExecutionLog: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionExecutionLogQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionExecutionLogKeys.detail(params.id), - queryFn: () => getClient().functionExecutionLog.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function execution logs — structured console output per invocation - * + * * @example * ```ts * const data = await fetchFunctionExecutionLogQuery({ @@ -79,35 +99,46 @@ export async function fetchFunctionExecutionLogQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionExecutionLog.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function execution logs — structured console output per invocation - * + * * @example * ```ts * await prefetchFunctionExecutionLogQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionExecutionLogQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionExecutionLogSelect>; -}): Promise; -export async function prefetchFunctionExecutionLogQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionExecutionLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } +): Promise; +export async function prefetchFunctionExecutionLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionExecutionLogKeys.detail(params.id), - queryFn: () => getClient().functionExecutionLog.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogsQuery.ts index 899028e34b..b76b950fa5 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionExecutionLogKeys } from "../query-keys"; -import type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations, FunctionExecutionLogFilter, FunctionExecutionLogOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionExecutionLogSelect, FunctionExecutionLogWithRelations, FunctionExecutionLogFilter, FunctionExecutionLogOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionExecutionLogsQueryKey = functionExecutionLogKeys.list; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { data, isLoading } = useFunctionExecutionLogsQuery({ @@ -30,33 +45,60 @@ export const functionExecutionLogsQueryKey = functionExecutionLogKeys.list; * }); * ``` */ -export function useFunctionExecutionLogsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionExecutionLogSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionExecutionLogsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionExecutionLogsQuery< + S extends FunctionExecutionLogSelect, + TData = { + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseQueryOptions< + { + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionExecutionLogsQuery( + params: { + selection: ListSelectionConfig< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionExecutionLogKeys.list(args), queryFn: () => getClient().functionExecutionLog.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function execution logs — structured console output per invocation - * + * * @example * ```ts * const data = await fetchFunctionExecutionLogsQuery({ @@ -67,38 +109,70 @@ export function useFunctionExecutionLogsQuery(params: { * }); * ``` */ -export async function fetchFunctionExecutionLogsQuery(params: { +export async function fetchFunctionExecutionLogsQuery< + S extends FunctionExecutionLogSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionExecutionLogSelect>; }): Promise<{ functionExecutionLogs: ConnectionResult>; }>; export async function fetchFunctionExecutionLogsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >(params.selection); return getClient().functionExecutionLog.findMany(args).unwrap(); } /** * Function execution logs — structured console output per invocation - * + * * @example * ```ts * await prefetchFunctionExecutionLogsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionExecutionLogsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionExecutionLogSelect>; -}): Promise; -export async function prefetchFunctionExecutionLogsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionExecutionLogsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionExecutionLogSelect>; + } +): Promise; +export async function prefetchFunctionExecutionLogsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionExecutionLogKeys.list(args), - queryFn: () => getClient().functionExecutionLog.findMany(args).unwrap() + queryFn: () => getClient().functionExecutionLog.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitQuery.ts index 766f8ba08f..f96a53deff 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphCommitKeys } from "../query-keys"; -import type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphCommitQueryKey = functionGraphCommitKeys.detail; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphCommitQuery({ @@ -26,38 +32,52 @@ export const functionGraphCommitQueryKey = functionGraphCommitKeys.detail; * }); * ``` */ -export function useFunctionGraphCommitQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphCommitSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphCommitQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionGraphCommitQuery< + S extends FunctionGraphCommitSelect, + TData = { + functionGraphCommit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphCommit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphCommitQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphCommitKeys.detail(params.id), - queryFn: () => getClient().functionGraphCommit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionGraphCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchFunctionGraphCommitQuery({ @@ -79,35 +99,46 @@ export async function fetchFunctionGraphCommitQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionGraphCommit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionGraphCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchFunctionGraphCommitQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionGraphCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphCommitSelect>; -}): Promise; -export async function prefetchFunctionGraphCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionGraphCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } +): Promise; +export async function prefetchFunctionGraphCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphCommitKeys.detail(params.id), - queryFn: () => getClient().functionGraphCommit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionGraphCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitsQuery.ts index 577ea0e4e5..ce85d7e246 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionGraphCommitKeys } from "../query-keys"; -import type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations, FunctionGraphCommitFilter, FunctionGraphCommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphCommitSelect, FunctionGraphCommitWithRelations, FunctionGraphCommitFilter, FunctionGraphCommitOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphCommitsQueryKey = functionGraphCommitKeys.list; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphCommitsQuery({ @@ -30,33 +45,58 @@ export const functionGraphCommitsQueryKey = functionGraphCommitKeys.list; * }); * ``` */ -export function useFunctionGraphCommitsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphCommitSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphCommitsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionGraphCommitsQuery< + S extends FunctionGraphCommitSelect, + TData = { + functionGraphCommits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphCommits: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphCommitsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphCommitKeys.list(args), queryFn: () => getClient().functionGraphCommit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchFunctionGraphCommitsQuery({ @@ -70,35 +110,65 @@ export function useFunctionGraphCommitsQuery(params: { export async function fetchFunctionGraphCommitsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphCommitSelect>; }): Promise<{ functionGraphCommits: ConnectionResult>; }>; export async function fetchFunctionGraphCommitsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >(params.selection); return getClient().functionGraphCommit.findMany(args).unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchFunctionGraphCommitsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionGraphCommitsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphCommitSelect>; -}): Promise; -export async function prefetchFunctionGraphCommitsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionGraphCommitsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphCommitSelect>; + } +): Promise; +export async function prefetchFunctionGraphCommitsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphCommitKeys.list(args), - queryFn: () => getClient().functionGraphCommit.findMany(args).unwrap() + queryFn: () => getClient().functionGraphCommit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStateQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStateQuery.ts index 9065679905..c782b92ef3 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStateQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStateQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionNodeStateKeys } from "../query-keys"; -import type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphExecutionNodeStateQueryKey = functionGraphExecutionNodeStateKeys.detail; /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphExecutionNodeStateQuery({ @@ -26,38 +32,58 @@ export const functionGraphExecutionNodeStateQueryKey = functionGraphExecutionNod * }); * ``` */ -export function useFunctionGraphExecutionNodeStateQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphExecutionNodeStateQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionGraphExecutionNodeStateQuery< + S extends FunctionGraphExecutionNodeStateSelect, + TData = { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionNodeStateQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphExecutionNodeStateKeys.detail(params.id), - queryFn: () => getClient().functionGraphExecutionNodeState.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionGraphExecutionNodeState.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```ts * const data = await fetchFunctionGraphExecutionNodeStateQuery({ @@ -66,48 +92,66 @@ export function useFunctionGraphExecutionNodeStateQuery(params: { * }); * ``` */ -export async function fetchFunctionGraphExecutionNodeStateQuery(params: { +export async function fetchFunctionGraphExecutionNodeStateQuery< + S extends FunctionGraphExecutionNodeStateSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; }): Promise<{ - functionGraphExecutionNodeState: InferSelectResult | null; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; }>; export async function fetchFunctionGraphExecutionNodeStateQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionGraphExecutionNodeState.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionGraphExecutionNodeState.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```ts * await prefetchFunctionGraphExecutionNodeStateQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionGraphExecutionNodeStateQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; -}): Promise; -export async function prefetchFunctionGraphExecutionNodeStateQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionGraphExecutionNodeStateQuery< + S extends FunctionGraphExecutionNodeStateSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionNodeStateQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphExecutionNodeStateKeys.detail(params.id), - queryFn: () => getClient().functionGraphExecutionNodeState.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionGraphExecutionNodeState.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStatesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStatesQuery.ts index bebd28ff21..5240e30f9e 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStatesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStatesQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionGraphExecutionNodeStateKeys } from "../query-keys"; -import type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphExecutionNodeStatesQueryKey = functionGraphExecutionNodeStateKeys.list; /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphExecutionNodeStatesQuery({ @@ -30,33 +45,64 @@ export const functionGraphExecutionNodeStatesQueryKey = functionGraphExecutionNo * }); * ``` */ -export function useFunctionGraphExecutionNodeStatesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphExecutionNodeStatesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionGraphExecutionNodeStatesQuery< + S extends FunctionGraphExecutionNodeStateSelect, + TData = { + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionNodeStatesQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphExecutionNodeStateKeys.list(args), queryFn: () => getClient().functionGraphExecutionNodeState.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```ts * const data = await fetchFunctionGraphExecutionNodeStatesQuery({ @@ -67,38 +113,82 @@ export function useFunctionGraphExecutionNodeStatesQuery(params: { * }); * ``` */ -export async function fetchFunctionGraphExecutionNodeStatesQuery(params: { +export async function fetchFunctionGraphExecutionNodeStatesQuery< + S extends FunctionGraphExecutionNodeStateSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; }): Promise<{ - functionGraphExecutionNodeStates: ConnectionResult>; + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; }>; export async function fetchFunctionGraphExecutionNodeStatesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >(params.selection); return getClient().functionGraphExecutionNodeState.findMany(args).unwrap(); } /** * Per-node execution state — tracks individual node lifecycle for debugging - * + * * @example * ```ts * await prefetchFunctionGraphExecutionNodeStatesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionGraphExecutionNodeStatesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; -}): Promise; -export async function prefetchFunctionGraphExecutionNodeStatesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionGraphExecutionNodeStatesQuery< + S extends FunctionGraphExecutionNodeStateSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionNodeStatesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphExecutionNodeStateKeys.list(args), - queryFn: () => getClient().functionGraphExecutionNodeState.findMany(args).unwrap() + queryFn: () => getClient().functionGraphExecutionNodeState.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputQuery.ts index 0cdd96a2e5..0ec4a9114f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionOutputKeys } from "../query-keys"; -import type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphExecutionOutputQueryKey = functionGraphExecutionOutputKeys.detail; /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphExecutionOutputQuery({ @@ -26,38 +32,58 @@ export const functionGraphExecutionOutputQueryKey = functionGraphExecutionOutput * }); * ``` */ -export function useFunctionGraphExecutionOutputQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphExecutionOutputQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionGraphExecutionOutputQuery< + S extends FunctionGraphExecutionOutputSelect, + TData = { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionOutputQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphExecutionOutputKeys.detail(params.id), - queryFn: () => getClient().functionGraphExecutionOutput.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionGraphExecutionOutput.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```ts * const data = await fetchFunctionGraphExecutionOutputQuery({ @@ -66,48 +92,66 @@ export function useFunctionGraphExecutionOutputQuery(params: { * }); * ``` */ -export async function fetchFunctionGraphExecutionOutputQuery(params: { +export async function fetchFunctionGraphExecutionOutputQuery< + S extends FunctionGraphExecutionOutputSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; }): Promise<{ - functionGraphExecutionOutput: InferSelectResult | null; + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; }>; export async function fetchFunctionGraphExecutionOutputQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionGraphExecutionOutput.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionGraphExecutionOutput.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```ts * await prefetchFunctionGraphExecutionOutputQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionGraphExecutionOutputQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; -}): Promise; -export async function prefetchFunctionGraphExecutionOutputQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionGraphExecutionOutputQuery< + S extends FunctionGraphExecutionOutputSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionOutputQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphExecutionOutputKeys.detail(params.id), - queryFn: () => getClient().functionGraphExecutionOutput.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionGraphExecutionOutput.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputsQuery.ts index d890dd445e..79ee1cf117 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionGraphExecutionOutputKeys } from "../query-keys"; -import type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations, FunctionGraphExecutionOutputFilter, FunctionGraphExecutionOutputOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputWithRelations, FunctionGraphExecutionOutputFilter, FunctionGraphExecutionOutputOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphExecutionOutputsQueryKey = functionGraphExecutionOutputKeys.list; /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphExecutionOutputsQuery({ @@ -30,33 +45,64 @@ export const functionGraphExecutionOutputsQueryKey = functionGraphExecutionOutpu * }); * ``` */ -export function useFunctionGraphExecutionOutputsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionOutputSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphExecutionOutputsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionGraphExecutionOutputsQuery< + S extends FunctionGraphExecutionOutputSelect, + TData = { + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionOutputsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphExecutionOutputKeys.list(args), queryFn: () => getClient().functionGraphExecutionOutput.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```ts * const data = await fetchFunctionGraphExecutionOutputsQuery({ @@ -67,38 +113,78 @@ export function useFunctionGraphExecutionOutputsQuery(params: { * }); * ``` */ -export async function fetchFunctionGraphExecutionOutputsQuery(params: { +export async function fetchFunctionGraphExecutionOutputsQuery< + S extends FunctionGraphExecutionOutputSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionOutputSelect>; }): Promise<{ - functionGraphExecutionOutputs: ConnectionResult>; + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; }>; export async function fetchFunctionGraphExecutionOutputsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >(params.selection); return getClient().functionGraphExecutionOutput.findMany(args).unwrap(); } /** * Content-addressed store for execution outputs — hash-referenced from node_outputs - * + * * @example * ```ts * await prefetchFunctionGraphExecutionOutputsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionGraphExecutionOutputsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionOutputSelect>; -}): Promise; -export async function prefetchFunctionGraphExecutionOutputsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionGraphExecutionOutputsQuery< + S extends FunctionGraphExecutionOutputSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionOutputsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphExecutionOutputKeys.list(args), - queryFn: () => getClient().functionGraphExecutionOutput.findMany(args).unwrap() + queryFn: () => getClient().functionGraphExecutionOutput.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionQuery.ts index 22b3ef8622..0df800ce67 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphExecutionKeys } from "../query-keys"; -import type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphExecutionQueryKey = functionGraphExecutionKeys.detail; /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphExecutionQuery({ @@ -26,38 +32,52 @@ export const functionGraphExecutionQueryKey = functionGraphExecutionKeys.detail; * }); * ``` */ -export function useFunctionGraphExecutionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphExecutionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphExecutionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionGraphExecutionQuery< + S extends FunctionGraphExecutionSelect, + TData = { + functionGraphExecution: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecution: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphExecutionKeys.detail(params.id), - queryFn: () => getClient().functionGraphExecution.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionGraphExecution.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```ts * const data = await fetchFunctionGraphExecutionQuery({ @@ -66,7 +86,9 @@ export function useFunctionGraphExecutionQuery(params: { * }); * ``` */ -export async function fetchFunctionGraphExecutionQuery(params: { +export async function fetchFunctionGraphExecutionQuery< + S extends FunctionGraphExecutionSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchFunctionGraphExecutionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionGraphExecution.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionGraphExecution.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```ts * await prefetchFunctionGraphExecutionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionGraphExecutionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphExecutionSelect>; -}): Promise; -export async function prefetchFunctionGraphExecutionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionGraphExecutionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphExecutionKeys.detail(params.id), - queryFn: () => getClient().functionGraphExecution.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionGraphExecution.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionsQuery.ts index 2fa537f1ec..a8910329fe 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionGraphExecutionKeys } from "../query-keys"; -import type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations, FunctionGraphExecutionFilter, FunctionGraphExecutionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphExecutionSelect, FunctionGraphExecutionWithRelations, FunctionGraphExecutionFilter, FunctionGraphExecutionOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphExecutionsQueryKey = functionGraphExecutionKeys.list; /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphExecutionsQuery({ @@ -30,33 +45,60 @@ export const functionGraphExecutionsQueryKey = functionGraphExecutionKeys.list; * }); * ``` */ -export function useFunctionGraphExecutionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphExecutionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionGraphExecutionsQuery< + S extends FunctionGraphExecutionSelect, + TData = { + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphExecutionKeys.list(args), queryFn: () => getClient().functionGraphExecution.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```ts * const data = await fetchFunctionGraphExecutionsQuery({ @@ -67,38 +109,72 @@ export function useFunctionGraphExecutionsQuery(params: { * }); * ``` */ -export async function fetchFunctionGraphExecutionsQuery(params: { +export async function fetchFunctionGraphExecutionsQuery< + S extends FunctionGraphExecutionSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionSelect>; }): Promise<{ - functionGraphExecutions: ConnectionResult>; + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; }>; export async function fetchFunctionGraphExecutionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >(params.selection); return getClient().functionGraphExecution.findMany(args).unwrap(); } /** * Ephemeral execution state for flow graph evaluation - * + * * @example * ```ts * await prefetchFunctionGraphExecutionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionGraphExecutionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphExecutionSelect>; -}): Promise; -export async function prefetchFunctionGraphExecutionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionGraphExecutionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphExecutionKeys.list(args), - queryFn: () => getClient().functionGraphExecution.findMany(args).unwrap() + queryFn: () => getClient().functionGraphExecution.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectQuery.ts index 4690a05b4e..984d9dfdb1 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphObjectKeys } from "../query-keys"; -import type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const getNodeAtPathQueryKey = functionGraphObjectKeys.detail; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphObjectQuery({ @@ -26,38 +32,52 @@ export const getNodeAtPathQueryKey = functionGraphObjectKeys.detail; * }); * ``` */ -export function useFunctionGraphObjectQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphObjectSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphObjectQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionGraphObjectQuery< + S extends FunctionGraphObjectSelect, + TData = { + getNodeAtPath: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseQueryOptions< + { + getNodeAtPath: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphObjectQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphObjectKeys.detail(params.id), - queryFn: () => getClient().functionGraphObject.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionGraphObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchFunctionGraphObjectQuery({ @@ -79,35 +99,46 @@ export async function fetchFunctionGraphObjectQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionGraphObject.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionGraphObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchFunctionGraphObjectQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionGraphObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphObjectSelect>; -}): Promise; -export async function prefetchFunctionGraphObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionGraphObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } +): Promise; +export async function prefetchFunctionGraphObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphObjectKeys.detail(params.id), - queryFn: () => getClient().functionGraphObject.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionGraphObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectsQuery.ts index d171548a9a..0582ac5d79 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionGraphObjectKeys } from "../query-keys"; -import type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations, FunctionGraphObjectFilter, FunctionGraphObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphObjectSelect, FunctionGraphObjectWithRelations, FunctionGraphObjectFilter, FunctionGraphObjectOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphObjectsQueryKey = functionGraphObjectKeys.list; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphObjectsQuery({ @@ -30,33 +45,58 @@ export const functionGraphObjectsQueryKey = functionGraphObjectKeys.list; * }); * ``` */ -export function useFunctionGraphObjectsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphObjectSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphObjectsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionGraphObjectsQuery< + S extends FunctionGraphObjectSelect, + TData = { + functionGraphObjects: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphObjects: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphObjectsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphObjectKeys.list(args), queryFn: () => getClient().functionGraphObject.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchFunctionGraphObjectsQuery({ @@ -70,35 +110,65 @@ export function useFunctionGraphObjectsQuery(params: { export async function fetchFunctionGraphObjectsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphObjectSelect>; }): Promise<{ functionGraphObjects: ConnectionResult>; }>; export async function fetchFunctionGraphObjectsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >(params.selection); return getClient().functionGraphObject.findMany(args).unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchFunctionGraphObjectsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionGraphObjectsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphObjectSelect>; -}): Promise; -export async function prefetchFunctionGraphObjectsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionGraphObjectsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphObjectSelect>; + } +): Promise; +export async function prefetchFunctionGraphObjectsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphObjectKeys.list(args), - queryFn: () => getClient().functionGraphObject.findMany(args).unwrap() + queryFn: () => getClient().functionGraphObject.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphQuery.ts index 70c13189f3..7ab189edfa 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphQuery.ts @@ -4,20 +4,20 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphKeys } from "../query-keys"; -import type { FunctionGraphSelect, FunctionGraphWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphSelect, FunctionGraphWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import type { FunctionGraphSelect, FunctionGraphWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionGraphSelect, FunctionGraphWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphQueryKey = functionGraphKeys.detail; /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphQuery({ @@ -26,38 +26,52 @@ export const functionGraphQueryKey = functionGraphKeys.detail; * }); * ``` */ -export function useFunctionGraphQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionGraphQuery< + S extends FunctionGraphSelect, + TData = { + functionGraph: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseQueryOptions< + { + functionGraph: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphKeys.detail(params.id), - queryFn: () => getClient().functionGraph.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionGraph.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```ts * const data = await fetchFunctionGraphQuery({ @@ -79,35 +93,46 @@ export async function fetchFunctionGraphQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionGraph.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionGraph.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```ts * await prefetchFunctionGraphQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionGraphQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphSelect>; -}): Promise; -export async function prefetchFunctionGraphQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionGraphQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphSelect>; + } +): Promise; +export async function prefetchFunctionGraphQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphKeys.detail(params.id), - queryFn: () => getClient().functionGraph.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionGraph.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefQuery.ts index fd7890583f..d6b4563bbe 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefQuery.ts @@ -4,20 +4,20 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphRefKeys } from "../query-keys"; -import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphRefQueryKey = functionGraphRefKeys.detail; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphRefQuery({ @@ -26,38 +26,52 @@ export const functionGraphRefQueryKey = functionGraphRefKeys.detail; * }); * ``` */ -export function useFunctionGraphRefQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphRefSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphRefQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionGraphRefQuery< + S extends FunctionGraphRefSelect, + TData = { + functionGraphRef: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphRef: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphRefQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphRefKeys.detail(params.id), - queryFn: () => getClient().functionGraphRef.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionGraphRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchFunctionGraphRefQuery({ @@ -79,35 +93,46 @@ export async function fetchFunctionGraphRefQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionGraphRef.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionGraphRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchFunctionGraphRefQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionGraphRefQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphRefSelect>; -}): Promise; -export async function prefetchFunctionGraphRefQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionGraphRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphRefSelect>; + } +): Promise; +export async function prefetchFunctionGraphRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphRefKeys.detail(params.id), - queryFn: () => getClient().functionGraphRef.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionGraphRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefsQuery.ts index e50825eeff..9180bbfc54 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionGraphRefKeys } from "../query-keys"; -import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations, FunctionGraphRefFilter, FunctionGraphRefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations, FunctionGraphRefFilter, FunctionGraphRefOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphRefsQueryKey = functionGraphRefKeys.list; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphRefsQuery({ @@ -30,33 +45,53 @@ export const functionGraphRefsQueryKey = functionGraphRefKeys.list; * }); * ``` */ -export function useFunctionGraphRefsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphRefSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphRefsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionGraphRefsQuery< + S extends FunctionGraphRefSelect, + TData = { + functionGraphRefs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphRefs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphRefsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphRefKeys.list(args), queryFn: () => getClient().functionGraphRef.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchFunctionGraphRefsQuery({ @@ -70,35 +105,59 @@ export function useFunctionGraphRefsQuery(params: { export async function fetchFunctionGraphRefsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphRefSelect>; }): Promise<{ functionGraphRefs: ConnectionResult>; }>; export async function fetchFunctionGraphRefsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >(params.selection); return getClient().functionGraphRef.findMany(args).unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchFunctionGraphRefsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionGraphRefsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphRefSelect>; -}): Promise; -export async function prefetchFunctionGraphRefsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionGraphRefsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphRefSelect>; + } +): Promise; +export async function prefetchFunctionGraphRefsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphRefKeys.list(args), - queryFn: () => getClient().functionGraphRef.findMany(args).unwrap() + queryFn: () => getClient().functionGraphRef.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoreQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoreQuery.ts index 3099f32e4a..405477734c 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoreQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoreQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionGraphStoreKeys } from "../query-keys"; -import type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphStoreQueryKey = functionGraphStoreKeys.detail; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphStoreQuery({ @@ -26,38 +32,52 @@ export const functionGraphStoreQueryKey = functionGraphStoreKeys.detail; * }); * ``` */ -export function useFunctionGraphStoreQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphStoreSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphStoreQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionGraphStoreQuery< + S extends FunctionGraphStoreSelect, + TData = { + functionGraphStore: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphStore: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphStoreQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphStoreKeys.detail(params.id), - queryFn: () => getClient().functionGraphStore.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionGraphStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchFunctionGraphStoreQuery({ @@ -79,35 +99,46 @@ export async function fetchFunctionGraphStoreQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionGraphStore.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionGraphStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchFunctionGraphStoreQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionGraphStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionGraphStoreSelect>; -}): Promise; -export async function prefetchFunctionGraphStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionGraphStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } +): Promise; +export async function prefetchFunctionGraphStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphStoreKeys.detail(params.id), - queryFn: () => getClient().functionGraphStore.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionGraphStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoresQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoresQuery.ts index 9ad304eb4c..e9dc35a66e 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoresQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoresQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionGraphStoreKeys } from "../query-keys"; -import type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations, FunctionGraphStoreFilter, FunctionGraphStoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphStoreSelect, FunctionGraphStoreWithRelations, FunctionGraphStoreFilter, FunctionGraphStoreOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphStoresQueryKey = functionGraphStoreKeys.list; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphStoresQuery({ @@ -30,33 +45,58 @@ export const functionGraphStoresQueryKey = functionGraphStoreKeys.list; * }); * ``` */ -export function useFunctionGraphStoresQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphStoreSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphStoresQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionGraphStoresQuery< + S extends FunctionGraphStoreSelect, + TData = { + functionGraphStores: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphStores: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphStoresQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphStoreKeys.list(args), queryFn: () => getClient().functionGraphStore.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchFunctionGraphStoresQuery({ @@ -70,35 +110,62 @@ export function useFunctionGraphStoresQuery(params: { export async function fetchFunctionGraphStoresQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphStoreSelect>; }): Promise<{ functionGraphStores: ConnectionResult>; }>; export async function fetchFunctionGraphStoresQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >(params.selection); return getClient().functionGraphStore.findMany(args).unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchFunctionGraphStoresQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionGraphStoresQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphStoreSelect>; -}): Promise; -export async function prefetchFunctionGraphStoresQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionGraphStoresQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphStoreSelect>; + } +): Promise; +export async function prefetchFunctionGraphStoresQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphStoreKeys.list(args), - queryFn: () => getClient().functionGraphStore.findMany(args).unwrap() + queryFn: () => getClient().functionGraphStore.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphsQuery.ts index 67474b4820..8ab60ddbb2 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionGraphKeys } from "../query-keys"; -import type { FunctionGraphSelect, FunctionGraphWithRelations, FunctionGraphFilter, FunctionGraphOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionGraphSelect, FunctionGraphWithRelations, FunctionGraphFilter, FunctionGraphOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import type { + FunctionGraphSelect, + FunctionGraphWithRelations, + FunctionGraphFilter, + FunctionGraphOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphSelect, + FunctionGraphWithRelations, + FunctionGraphFilter, + FunctionGraphOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphsQueryKey = functionGraphKeys.list; /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```tsx * const { data, isLoading } = useFunctionGraphsQuery({ @@ -30,33 +45,49 @@ export const functionGraphsQueryKey = functionGraphKeys.list; * }); * ``` */ -export function useFunctionGraphsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionGraphsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionGraphsQuery< + S extends FunctionGraphSelect, + TData = { + functionGraphs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphKeys.list(args), queryFn: () => getClient().functionGraph.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```ts * const data = await fetchFunctionGraphsQuery({ @@ -70,35 +101,51 @@ export function useFunctionGraphsQuery(params: { export async function fetchFunctionGraphsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphSelect>; }): Promise<{ functionGraphs: ConnectionResult>; }>; export async function fetchFunctionGraphsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy + >(params.selection); return getClient().functionGraph.findMany(args).unwrap(); } /** * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store - * + * * @example * ```ts * await prefetchFunctionGraphsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionGraphsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionGraphSelect>; -}): Promise; -export async function prefetchFunctionGraphsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionGraphsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphSelect>; + } +): Promise; +export async function prefetchFunctionGraphsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphKeys.list(args), - queryFn: () => getClient().functionGraph.findMany(args).unwrap() + queryFn: () => getClient().functionGraph.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationAttemptQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationAttemptQuery.ts index 5cc7d11f86..bd568c3ad8 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationAttemptQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationAttemptQuery.ts @@ -4,20 +4,26 @@ * 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 { functionInvocationAttemptKeys } from "../query-keys"; -import type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations } from "../../orm/input-types"; +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 { functionInvocationAttemptKeys } from '../query-keys'; +import type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionInvocationAttemptQueryKey = functionInvocationAttemptKeys.detail; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { data, isLoading } = useFunctionInvocationAttemptQuery({ @@ -26,38 +32,55 @@ export const functionInvocationAttemptQueryKey = functionInvocationAttemptKeys.d * }); * ``` */ -export function useFunctionInvocationAttemptQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionInvocationAttemptSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionInvocationAttemptQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionInvocationAttemptQuery< + S extends FunctionInvocationAttemptSelect, + TData = { + functionInvocationAttempt: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationAttemptSelect>; + } & Omit< + UseQueryOptions< + { + functionInvocationAttempt: InferSelectResult< + FunctionInvocationAttemptWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionInvocationAttemptQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionInvocationAttemptKeys.detail(params.id), - queryFn: () => getClient().functionInvocationAttempt.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionInvocationAttempt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```ts * const data = await fetchFunctionInvocationAttemptQuery({ @@ -66,7 +89,9 @@ export function useFunctionInvocationAttemptQuery(params: { * }); * ``` */ -export async function fetchFunctionInvocationAttemptQuery(params: { +export async function fetchFunctionInvocationAttemptQuery< + S extends FunctionInvocationAttemptSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +104,48 @@ export async function fetchFunctionInvocationAttemptQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionInvocationAttempt.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionInvocationAttempt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```ts * await prefetchFunctionInvocationAttemptQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionInvocationAttemptQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionInvocationAttemptSelect>; -}): Promise; -export async function prefetchFunctionInvocationAttemptQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionInvocationAttemptQuery< + S extends FunctionInvocationAttemptSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationAttemptSelect>; + } +): Promise; +export async function prefetchFunctionInvocationAttemptQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionInvocationAttemptKeys.detail(params.id), - queryFn: () => getClient().functionInvocationAttempt.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionInvocationAttempt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationAttemptsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationAttemptsQuery.ts index b983f75c18..5834fdf92d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationAttemptsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationAttemptsQuery.ts @@ -4,20 +4,35 @@ * 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 { functionInvocationAttemptKeys } from "../query-keys"; -import type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations, FunctionInvocationAttemptFilter, FunctionInvocationAttemptOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationAttemptSelect, FunctionInvocationAttemptWithRelations, FunctionInvocationAttemptFilter, FunctionInvocationAttemptOrderBy } from "../../orm/input-types"; +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 { functionInvocationAttemptKeys } from '../query-keys'; +import type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptWithRelations, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionInvocationAttemptsQueryKey = functionInvocationAttemptKeys.list; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { data, isLoading } = useFunctionInvocationAttemptsQuery({ @@ -30,33 +45,60 @@ export const functionInvocationAttemptsQueryKey = functionInvocationAttemptKeys. * }); * ``` */ -export function useFunctionInvocationAttemptsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationAttemptSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionInvocationAttemptsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionInvocationAttemptsQuery< + S extends FunctionInvocationAttemptSelect, + TData = { + functionInvocationAttempts: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationAttemptSelect>; + } & Omit< + UseQueryOptions< + { + functionInvocationAttempts: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionInvocationAttemptsQuery( + params: { + selection: ListSelectionConfig< + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionInvocationAttemptKeys.list(args), queryFn: () => getClient().functionInvocationAttempt.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```ts * const data = await fetchFunctionInvocationAttemptsQuery({ @@ -67,38 +109,74 @@ export function useFunctionInvocationAttemptsQuery(params: { * }); * ``` */ -export async function fetchFunctionInvocationAttemptsQuery(params: { +export async function fetchFunctionInvocationAttemptsQuery< + S extends FunctionInvocationAttemptSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationAttemptSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationAttemptSelect>; }): Promise<{ - functionInvocationAttempts: ConnectionResult>; + functionInvocationAttempts: ConnectionResult< + InferSelectResult + >; }>; export async function fetchFunctionInvocationAttemptsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy + >(params.selection); return getClient().functionInvocationAttempt.findMany(args).unwrap(); } /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```ts * await prefetchFunctionInvocationAttemptsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionInvocationAttemptsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationAttemptSelect>; -}): Promise; -export async function prefetchFunctionInvocationAttemptsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionInvocationAttemptsQuery< + S extends FunctionInvocationAttemptSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationAttemptSelect>; + } +): Promise; +export async function prefetchFunctionInvocationAttemptsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionInvocationAttemptKeys.list(args), - queryFn: () => getClient().functionInvocationAttempt.findMany(args).unwrap() + queryFn: () => getClient().functionInvocationAttempt.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationQuery.ts index 59cf9f18ce..5729c44566 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionInvocationKeys } from "../query-keys"; -import type { FunctionInvocationSelect, FunctionInvocationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationSelect, FunctionInvocationWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionInvocationQueryKey = functionInvocationKeys.detail; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { data, isLoading } = useFunctionInvocationQuery({ @@ -26,38 +32,52 @@ export const functionInvocationQueryKey = functionInvocationKeys.detail; * }); * ``` */ -export function useFunctionInvocationQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionInvocationSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionInvocationQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionInvocationQuery< + S extends FunctionInvocationSelect, + TData = { + functionInvocation: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseQueryOptions< + { + functionInvocation: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionInvocationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionInvocationKeys.detail(params.id), - queryFn: () => getClient().functionInvocation.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```ts * const data = await fetchFunctionInvocationQuery({ @@ -79,35 +99,46 @@ export async function fetchFunctionInvocationQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionInvocation.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```ts * await prefetchFunctionInvocationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionInvocationQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionInvocationSelect>; -}): Promise; -export async function prefetchFunctionInvocationQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionInvocationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationSelect>; + } +): Promise; +export async function prefetchFunctionInvocationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionInvocationKeys.detail(params.id), - queryFn: () => getClient().functionInvocation.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationsQuery.ts index 3ac0359754..cf5e806d42 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionInvocationKeys } from "../query-keys"; -import type { FunctionInvocationSelect, FunctionInvocationWithRelations, FunctionInvocationFilter, FunctionInvocationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationSelect, FunctionInvocationWithRelations, FunctionInvocationFilter, FunctionInvocationOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + FunctionInvocationFilter, + FunctionInvocationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + FunctionInvocationFilter, + FunctionInvocationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionInvocationsQueryKey = functionInvocationKeys.list; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { data, isLoading } = useFunctionInvocationsQuery({ @@ -30,33 +45,58 @@ export const functionInvocationsQueryKey = functionInvocationKeys.list; * }); * ``` */ -export function useFunctionInvocationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionInvocationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionInvocationsQuery< + S extends FunctionInvocationSelect, + TData = { + functionInvocations: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseQueryOptions< + { + functionInvocations: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionInvocationsQuery( + params: { + selection: ListSelectionConfig< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionInvocationKeys.list(args), queryFn: () => getClient().functionInvocation.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```ts * const data = await fetchFunctionInvocationsQuery({ @@ -70,35 +110,62 @@ export function useFunctionInvocationsQuery(params: { export async function fetchFunctionInvocationsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionInvocationSelect>; }): Promise<{ functionInvocations: ConnectionResult>; }>; export async function fetchFunctionInvocationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >(params.selection); return getClient().functionInvocation.findMany(args).unwrap(); } /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```ts * await prefetchFunctionInvocationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionInvocationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationSelect>; -}): Promise; -export async function prefetchFunctionInvocationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionInvocationsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationSelect>; + } +): Promise; +export async function prefetchFunctionInvocationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionInvocationKeys.list(args), - queryFn: () => getClient().functionInvocation.findMany(args).unwrap() + queryFn: () => getClient().functionInvocation.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useGetAllTreeNodesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useGetAllTreeNodesQuery.ts index a2467bbcce..cd2cf0083d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useGetAllTreeNodesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useGetAllTreeNodesQuery.ts @@ -4,20 +4,35 @@ * 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 { getAllTreeNodesRecordKeys } from "../query-keys"; -import type { GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; +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 { getAllTreeNodesRecordKeys } from '../query-keys'; +import type { + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const getAllTreeNodesQueryKey = getAllTreeNodesRecordKeys.list; /** * Query hook for fetching GetAllTreeNodesRecord list - * + * * @example * ```tsx * const { data, isLoading } = useGetAllTreeNodesQuery({ @@ -30,33 +45,56 @@ export const getAllTreeNodesQueryKey = getAllTreeNodesRecordKeys.list; * }); * ``` */ -export function useGetAllTreeNodesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, GetAllTreeNodesRecordSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useGetAllTreeNodesQuery< + S extends GetAllTreeNodesRecordSelect, + TData = { + getAllTreeNodes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GetAllTreeNodesRecordSelect>; + } & Omit< + UseQueryOptions< + { + getAllTreeNodes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGetAllTreeNodesQuery( + params: { + selection: ListSelectionConfig< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: getAllTreeNodesRecordKeys.list(args), queryFn: () => getClient().getAllTreeNodesRecord.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch GetAllTreeNodesRecord list without React hooks - * + * * @example * ```ts * const data = await fetchGetAllTreeNodesQuery({ @@ -70,35 +108,65 @@ export function useGetAllTreeNodesQuery(params: { export async function fetchGetAllTreeNodesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, GetAllTreeNodesRecordSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GetAllTreeNodesRecordSelect>; }): Promise<{ getAllTreeNodes: ConnectionResult>; }>; export async function fetchGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >(params.selection); return getClient().getAllTreeNodesRecord.findMany(args).unwrap(); } /** * Prefetch GetAllTreeNodesRecord list for SSR or cache warming - * + * * @example * ```ts * await prefetchGetAllTreeNodesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, GetAllTreeNodesRecordSelect>; -}): Promise; -export async function prefetchGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchGetAllTreeNodesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GetAllTreeNodesRecordSelect>; + } +): Promise; +export async function prefetchGetAllTreeNodesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: getAllTreeNodesRecordKeys.list(args), - queryFn: () => getClient().getAllTreeNodesRecord.findMany(args).unwrap() + queryFn: () => getClient().getAllTreeNodesRecord.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraCommitQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraCommitQuery.ts index 85568ac0cb..3118bbd86f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraCommitQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraCommitQuery.ts @@ -4,20 +4,20 @@ * 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 { infraCommitKeys } from "../query-keys"; -import type { InfraCommitSelect, InfraCommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraCommitSelect, InfraCommitWithRelations } from "../../orm/input-types"; +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 { infraCommitKeys } from '../query-keys'; +import type { InfraCommitSelect, InfraCommitWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraCommitSelect, InfraCommitWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraCommitQueryKey = infraCommitKeys.detail; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = useInfraCommitQuery({ @@ -26,38 +26,52 @@ export const infraCommitQueryKey = infraCommitKeys.detail; * }); * ``` */ -export function useInfraCommitQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraCommitSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraCommitQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInfraCommitQuery< + S extends InfraCommitSelect, + TData = { + infraCommit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraCommitSelect>; + } & Omit< + UseQueryOptions< + { + infraCommit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraCommitQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraCommitKeys.detail(params.id), - queryFn: () => getClient().infraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .infraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchInfraCommitQuery({ @@ -79,35 +93,46 @@ export async function fetchInfraCommitQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().infraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .infraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchInfraCommitQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInfraCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraCommitSelect>; -}): Promise; -export async function prefetchInfraCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInfraCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraCommitSelect>; + } +): Promise; +export async function prefetchInfraCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: infraCommitKeys.detail(params.id), - queryFn: () => getClient().infraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .infraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraCommitsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraCommitsQuery.ts index dab3e77975..22994751ea 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraCommitsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraCommitsQuery.ts @@ -4,20 +4,35 @@ * 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 { infraCommitKeys } from "../query-keys"; -import type { InfraCommitSelect, InfraCommitWithRelations, InfraCommitFilter, InfraCommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraCommitSelect, InfraCommitWithRelations, InfraCommitFilter, InfraCommitOrderBy } from "../../orm/input-types"; +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 { infraCommitKeys } from '../query-keys'; +import type { + InfraCommitSelect, + InfraCommitWithRelations, + InfraCommitFilter, + InfraCommitOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InfraCommitSelect, + InfraCommitWithRelations, + InfraCommitFilter, + InfraCommitOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraCommitsQueryKey = infraCommitKeys.list; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = useInfraCommitsQuery({ @@ -30,33 +45,47 @@ export const infraCommitsQueryKey = infraCommitKeys.list; * }); * ``` */ -export function useInfraCommitsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraCommitSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraCommitsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInfraCommitsQuery< + S extends InfraCommitSelect, + TData = { + infraCommits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraCommitSelect>; + } & Omit< + UseQueryOptions< + { + infraCommits: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraCommitsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraCommitKeys.list(args), queryFn: () => getClient().infraCommit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchInfraCommitsQuery({ @@ -70,35 +99,47 @@ export function useInfraCommitsQuery(params: { export async function fetchInfraCommitsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraCommitSelect>; + } & Omit, 'fields'> & + HookStrictSelect, InfraCommitSelect>; }): Promise<{ infraCommits: ConnectionResult>; }>; export async function fetchInfraCommitsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().infraCommit.findMany(args).unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchInfraCommitsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInfraCommitsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraCommitSelect>; -}): Promise; -export async function prefetchInfraCommitsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInfraCommitsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraCommitSelect>; + } +): Promise; +export async function prefetchInfraCommitsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: infraCommitKeys.list(args), - queryFn: () => getClient().infraCommit.findMany(args).unwrap() + queryFn: () => getClient().infraCommit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraGetAllTreeNodesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraGetAllTreeNodesQuery.ts index 2ad0ece613..6c0a8d463c 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraGetAllTreeNodesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraGetAllTreeNodesQuery.ts @@ -4,20 +4,35 @@ * 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 { infraGetAllTreeNodesRecordKeys } from "../query-keys"; -import type { InfraGetAllTreeNodesRecordSelect, InfraGetAllTreeNodesRecordWithRelations, InfraGetAllTreeNodesRecordFilter, InfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraGetAllTreeNodesRecordSelect, InfraGetAllTreeNodesRecordWithRelations, InfraGetAllTreeNodesRecordFilter, InfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; +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 { infraGetAllTreeNodesRecordKeys } from '../query-keys'; +import type { + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordWithRelations, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordWithRelations, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraGetAllTreeNodesQueryKey = infraGetAllTreeNodesRecordKeys.list; /** * Query hook for fetching InfraGetAllTreeNodesRecord list - * + * * @example * ```tsx * const { data, isLoading } = useInfraGetAllTreeNodesQuery({ @@ -30,33 +45,60 @@ export const infraGetAllTreeNodesQueryKey = infraGetAllTreeNodesRecordKeys.list; * }); * ``` */ -export function useInfraGetAllTreeNodesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraGetAllTreeNodesRecordSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInfraGetAllTreeNodesQuery< + S extends InfraGetAllTreeNodesRecordSelect, + TData = { + infraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InfraGetAllTreeNodesRecordSelect>; + } & Omit< + UseQueryOptions< + { + infraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraGetAllTreeNodesQuery( + params: { + selection: ListSelectionConfig< + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraGetAllTreeNodesRecordKeys.list(args), queryFn: () => getClient().infraGetAllTreeNodesRecord.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch InfraGetAllTreeNodesRecord list without React hooks - * + * * @example * ```ts * const data = await fetchInfraGetAllTreeNodesQuery({ @@ -67,38 +109,72 @@ export function useInfraGetAllTreeNodesQuery(params: { * }); * ``` */ -export async function fetchInfraGetAllTreeNodesQuery(params: { +export async function fetchInfraGetAllTreeNodesQuery< + S extends InfraGetAllTreeNodesRecordSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraGetAllTreeNodesRecordSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InfraGetAllTreeNodesRecordSelect>; }): Promise<{ - infraGetAllTreeNodes: ConnectionResult>; + infraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }>; export async function fetchInfraGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy + >(params.selection); return getClient().infraGetAllTreeNodesRecord.findMany(args).unwrap(); } /** * Prefetch InfraGetAllTreeNodesRecord list for SSR or cache warming - * + * * @example * ```ts * await prefetchInfraGetAllTreeNodesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInfraGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraGetAllTreeNodesRecordSelect>; -}): Promise; -export async function prefetchInfraGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInfraGetAllTreeNodesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InfraGetAllTreeNodesRecordSelect>; + } +): Promise; +export async function prefetchInfraGetAllTreeNodesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: infraGetAllTreeNodesRecordKeys.list(args), - queryFn: () => getClient().infraGetAllTreeNodesRecord.findMany(args).unwrap() + queryFn: () => getClient().infraGetAllTreeNodesRecord.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraObjectQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraObjectQuery.ts index f2e32084d8..c8c12d925b 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraObjectQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraObjectQuery.ts @@ -4,20 +4,20 @@ * 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 { infraObjectKeys } from "../query-keys"; -import type { InfraObjectSelect, InfraObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraObjectSelect, InfraObjectWithRelations } from "../../orm/input-types"; +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 { infraObjectKeys } from '../query-keys'; +import type { InfraObjectSelect, InfraObjectWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraObjectSelect, InfraObjectWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraGetNodeAtPathQueryKey = infraObjectKeys.detail; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = useInfraObjectQuery({ @@ -26,38 +26,52 @@ export const infraGetNodeAtPathQueryKey = infraObjectKeys.detail; * }); * ``` */ -export function useInfraObjectQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraObjectSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraObjectQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInfraObjectQuery< + S extends InfraObjectSelect, + TData = { + infraGetNodeAtPath: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraObjectSelect>; + } & Omit< + UseQueryOptions< + { + infraGetNodeAtPath: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraObjectQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraObjectKeys.detail(params.id), - queryFn: () => getClient().infraObject.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .infraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchInfraObjectQuery({ @@ -79,35 +93,46 @@ export async function fetchInfraObjectQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().infraObject.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .infraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchInfraObjectQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInfraObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraObjectSelect>; -}): Promise; -export async function prefetchInfraObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInfraObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraObjectSelect>; + } +): Promise; +export async function prefetchInfraObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: infraObjectKeys.detail(params.id), - queryFn: () => getClient().infraObject.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .infraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraObjectsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraObjectsQuery.ts index 265f0d644f..4489e6fb40 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraObjectsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraObjectsQuery.ts @@ -4,20 +4,35 @@ * 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 { infraObjectKeys } from "../query-keys"; -import type { InfraObjectSelect, InfraObjectWithRelations, InfraObjectFilter, InfraObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraObjectSelect, InfraObjectWithRelations, InfraObjectFilter, InfraObjectOrderBy } from "../../orm/input-types"; +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 { infraObjectKeys } from '../query-keys'; +import type { + InfraObjectSelect, + InfraObjectWithRelations, + InfraObjectFilter, + InfraObjectOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InfraObjectSelect, + InfraObjectWithRelations, + InfraObjectFilter, + InfraObjectOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraObjectsQueryKey = infraObjectKeys.list; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = useInfraObjectsQuery({ @@ -30,33 +45,47 @@ export const infraObjectsQueryKey = infraObjectKeys.list; * }); * ``` */ -export function useInfraObjectsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraObjectSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraObjectsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInfraObjectsQuery< + S extends InfraObjectSelect, + TData = { + infraObjects: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraObjectSelect>; + } & Omit< + UseQueryOptions< + { + infraObjects: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraObjectsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraObjectKeys.list(args), queryFn: () => getClient().infraObject.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchInfraObjectsQuery({ @@ -70,35 +99,47 @@ export function useInfraObjectsQuery(params: { export async function fetchInfraObjectsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraObjectSelect>; + } & Omit, 'fields'> & + HookStrictSelect, InfraObjectSelect>; }): Promise<{ infraObjects: ConnectionResult>; }>; export async function fetchInfraObjectsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().infraObject.findMany(args).unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchInfraObjectsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInfraObjectsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraObjectSelect>; -}): Promise; -export async function prefetchInfraObjectsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInfraObjectsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraObjectSelect>; + } +): Promise; +export async function prefetchInfraObjectsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: infraObjectKeys.list(args), - queryFn: () => getClient().infraObject.findMany(args).unwrap() + queryFn: () => getClient().infraObject.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraRefQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraRefQuery.ts index d5c93cb8e1..ffbeab1418 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraRefQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraRefQuery.ts @@ -4,20 +4,20 @@ * 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 { infraRefKeys } from "../query-keys"; -import type { InfraRefSelect, InfraRefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraRefSelect, InfraRefWithRelations } from "../../orm/input-types"; +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 { infraRefKeys } from '../query-keys'; +import type { InfraRefSelect, InfraRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraRefSelect, InfraRefWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraRefQueryKey = infraRefKeys.detail; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = useInfraRefQuery({ @@ -26,38 +26,52 @@ export const infraRefQueryKey = infraRefKeys.detail; * }); * ``` */ -export function useInfraRefQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraRefSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraRefQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInfraRefQuery< + S extends InfraRefSelect, + TData = { + infraRef: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraRefSelect>; + } & Omit< + UseQueryOptions< + { + infraRef: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraRefQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraRefKeys.detail(params.id), - queryFn: () => getClient().infraRef.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .infraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchInfraRefQuery({ @@ -79,35 +93,46 @@ export async function fetchInfraRefQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().infraRef.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .infraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchInfraRefQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInfraRefQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraRefSelect>; -}): Promise; -export async function prefetchInfraRefQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInfraRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraRefSelect>; + } +): Promise; +export async function prefetchInfraRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: infraRefKeys.detail(params.id), - queryFn: () => getClient().infraRef.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .infraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraRefsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraRefsQuery.ts index a5a43a744e..c3879b8d09 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraRefsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraRefsQuery.ts @@ -4,20 +4,35 @@ * 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 { infraRefKeys } from "../query-keys"; -import type { InfraRefSelect, InfraRefWithRelations, InfraRefFilter, InfraRefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraRefSelect, InfraRefWithRelations, InfraRefFilter, InfraRefOrderBy } from "../../orm/input-types"; +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 { infraRefKeys } from '../query-keys'; +import type { + InfraRefSelect, + InfraRefWithRelations, + InfraRefFilter, + InfraRefOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InfraRefSelect, + InfraRefWithRelations, + InfraRefFilter, + InfraRefOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraRefsQueryKey = infraRefKeys.list; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = useInfraRefsQuery({ @@ -30,33 +45,47 @@ export const infraRefsQueryKey = infraRefKeys.list; * }); * ``` */ -export function useInfraRefsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraRefSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraRefsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInfraRefsQuery< + S extends InfraRefSelect, + TData = { + infraRefs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraRefSelect>; + } & Omit< + UseQueryOptions< + { + infraRefs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraRefsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraRefKeys.list(args), queryFn: () => getClient().infraRef.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchInfraRefsQuery({ @@ -70,35 +99,47 @@ export function useInfraRefsQuery(params: { export async function fetchInfraRefsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraRefSelect>; + } & Omit, 'fields'> & + HookStrictSelect, InfraRefSelect>; }): Promise<{ infraRefs: ConnectionResult>; }>; export async function fetchInfraRefsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().infraRef.findMany(args).unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchInfraRefsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInfraRefsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraRefSelect>; -}): Promise; -export async function prefetchInfraRefsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInfraRefsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraRefSelect>; + } +): Promise; +export async function prefetchInfraRefsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: infraRefKeys.list(args), - queryFn: () => getClient().infraRef.findMany(args).unwrap() + queryFn: () => getClient().infraRef.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraStoreQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraStoreQuery.ts index 3cb3394c61..405081c104 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraStoreQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraStoreQuery.ts @@ -4,20 +4,20 @@ * 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 { infraStoreKeys } from "../query-keys"; -import type { InfraStoreSelect, InfraStoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraStoreSelect, InfraStoreWithRelations } from "../../orm/input-types"; +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 { infraStoreKeys } from '../query-keys'; +import type { InfraStoreSelect, InfraStoreWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InfraStoreSelect, InfraStoreWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraStoreQueryKey = infraStoreKeys.detail; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = useInfraStoreQuery({ @@ -26,38 +26,52 @@ export const infraStoreQueryKey = infraStoreKeys.detail; * }); * ``` */ -export function useInfraStoreQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraStoreSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraStoreQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInfraStoreQuery< + S extends InfraStoreSelect, + TData = { + infraStore: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraStoreSelect>; + } & Omit< + UseQueryOptions< + { + infraStore: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraStoreQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraStoreKeys.detail(params.id), - queryFn: () => getClient().infraStore.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .infraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchInfraStoreQuery({ @@ -79,35 +93,46 @@ export async function fetchInfraStoreQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().infraStore.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .infraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchInfraStoreQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInfraStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraStoreSelect>; -}): Promise; -export async function prefetchInfraStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInfraStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraStoreSelect>; + } +): Promise; +export async function prefetchInfraStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: infraStoreKeys.detail(params.id), - queryFn: () => getClient().infraStore.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .infraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useInfraStoresQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useInfraStoresQuery.ts index aae211b10a..7477224d50 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useInfraStoresQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useInfraStoresQuery.ts @@ -4,20 +4,35 @@ * 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 { infraStoreKeys } from "../query-keys"; -import type { InfraStoreSelect, InfraStoreWithRelations, InfraStoreFilter, InfraStoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraStoreSelect, InfraStoreWithRelations, InfraStoreFilter, InfraStoreOrderBy } from "../../orm/input-types"; +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 { infraStoreKeys } from '../query-keys'; +import type { + InfraStoreSelect, + InfraStoreWithRelations, + InfraStoreFilter, + InfraStoreOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InfraStoreSelect, + InfraStoreWithRelations, + InfraStoreFilter, + InfraStoreOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraStoresQueryKey = infraStoreKeys.list; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = useInfraStoresQuery({ @@ -30,33 +45,47 @@ export const infraStoresQueryKey = infraStoreKeys.list; * }); * ``` */ -export function useInfraStoresQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraStoreSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraStoresQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInfraStoresQuery< + S extends InfraStoreSelect, + TData = { + infraStores: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraStoreSelect>; + } & Omit< + UseQueryOptions< + { + infraStores: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraStoresQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraStoreKeys.list(args), queryFn: () => getClient().infraStore.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchInfraStoresQuery({ @@ -70,35 +99,47 @@ export function useInfraStoresQuery(params: { export async function fetchInfraStoresQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraStoreSelect>; + } & Omit, 'fields'> & + HookStrictSelect, InfraStoreSelect>; }): Promise<{ infraStores: ConnectionResult>; }>; export async function fetchInfraStoresQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().infraStore.findMany(args).unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchInfraStoresQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInfraStoresQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraStoreSelect>; -}): Promise; -export async function prefetchInfraStoresQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInfraStoresQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraStoreSelect>; + } +): Promise; +export async function prefetchInfraStoresQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: infraStoreKeys.list(args), - queryFn: () => getClient().infraStore.findMany(args).unwrap() + queryFn: () => getClient().infraStore.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useIntegrationProviderQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useIntegrationProviderQuery.ts index 6441b144e9..db6de7e417 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useIntegrationProviderQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useIntegrationProviderQuery.ts @@ -4,20 +4,26 @@ * 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 { integrationProviderKeys } from "../query-keys"; -import type { IntegrationProviderSelect, IntegrationProviderWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProviderSelect, IntegrationProviderWithRelations } from "../../orm/input-types"; +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 { integrationProviderKeys } from '../query-keys'; +import type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const integrationProviderQueryKey = integrationProviderKeys.detail; /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```tsx * const { data, isLoading } = useIntegrationProviderQuery({ @@ -26,38 +32,52 @@ export const integrationProviderQueryKey = integrationProviderKeys.detail; * }); * ``` */ -export function useIntegrationProviderQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, IntegrationProviderSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIntegrationProviderQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useIntegrationProviderQuery< + S extends IntegrationProviderSelect, + TData = { + integrationProvider: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, IntegrationProviderSelect>; + } & Omit< + UseQueryOptions< + { + integrationProvider: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIntegrationProviderQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: integrationProviderKeys.detail(params.id), - queryFn: () => getClient().integrationProvider.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .integrationProvider.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```ts * const data = await fetchIntegrationProviderQuery({ @@ -79,35 +99,46 @@ export async function fetchIntegrationProviderQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().integrationProvider.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .integrationProvider.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```ts * await prefetchIntegrationProviderQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchIntegrationProviderQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, IntegrationProviderSelect>; -}): Promise; -export async function prefetchIntegrationProviderQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchIntegrationProviderQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, IntegrationProviderSelect>; + } +): Promise; +export async function prefetchIntegrationProviderQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: integrationProviderKeys.detail(params.id), - queryFn: () => getClient().integrationProvider.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .integrationProvider.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useIntegrationProvidersQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useIntegrationProvidersQuery.ts index 8325bb7fd8..3b5839ae4a 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useIntegrationProvidersQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useIntegrationProvidersQuery.ts @@ -4,20 +4,35 @@ * 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 { integrationProviderKeys } from "../query-keys"; -import type { IntegrationProviderSelect, IntegrationProviderWithRelations, IntegrationProviderFilter, IntegrationProviderOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProviderSelect, IntegrationProviderWithRelations, IntegrationProviderFilter, IntegrationProviderOrderBy } from "../../orm/input-types"; +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 { integrationProviderKeys } from '../query-keys'; +import type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, + IntegrationProviderFilter, + IntegrationProviderOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + IntegrationProviderSelect, + IntegrationProviderWithRelations, + IntegrationProviderFilter, + IntegrationProviderOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const integrationProvidersQueryKey = integrationProviderKeys.list; /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```tsx * const { data, isLoading } = useIntegrationProvidersQuery({ @@ -30,33 +45,58 @@ export const integrationProvidersQueryKey = integrationProviderKeys.list; * }); * ``` */ -export function useIntegrationProvidersQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IntegrationProviderSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIntegrationProvidersQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useIntegrationProvidersQuery< + S extends IntegrationProviderSelect, + TData = { + integrationProviders: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IntegrationProviderSelect>; + } & Omit< + UseQueryOptions< + { + integrationProviders: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIntegrationProvidersQuery( + params: { + selection: ListSelectionConfig< + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: integrationProviderKeys.list(args), queryFn: () => getClient().integrationProvider.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```ts * const data = await fetchIntegrationProvidersQuery({ @@ -70,35 +110,65 @@ export function useIntegrationProvidersQuery(params: { export async function fetchIntegrationProvidersQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, IntegrationProviderSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IntegrationProviderSelect>; }): Promise<{ integrationProviders: ConnectionResult>; }>; export async function fetchIntegrationProvidersQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy + >(params.selection); return getClient().integrationProvider.findMany(args).unwrap(); } /** * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth. - * + * * @example * ```ts * await prefetchIntegrationProvidersQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchIntegrationProvidersQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IntegrationProviderSelect>; -}): Promise; -export async function prefetchIntegrationProvidersQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchIntegrationProvidersQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IntegrationProviderSelect>; + } +): Promise; +export async function prefetchIntegrationProvidersQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: integrationProviderKeys.list(args), - queryFn: () => getClient().integrationProvider.findMany(args).unwrap() + queryFn: () => getClient().integrationProvider.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useNamespaceEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useNamespaceEventQuery.ts index 044fe5c8b3..9206e4efee 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useNamespaceEventQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useNamespaceEventQuery.ts @@ -4,20 +4,20 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import type { NamespaceEventSelect, NamespaceEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceEventSelect, NamespaceEventWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespaceEventQueryKey = namespaceEventKeys.detail; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { data, isLoading } = useNamespaceEventQuery({ @@ -26,38 +26,52 @@ export const namespaceEventQueryKey = namespaceEventKeys.detail; * }); * ``` */ -export function useNamespaceEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespaceEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useNamespaceEventQuery< + S extends NamespaceEventSelect, + TData = { + namespaceEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseQueryOptions< + { + namespaceEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespaceEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceEventKeys.detail(params.id), - queryFn: () => getClient().namespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .namespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * const data = await fetchNamespaceEventQuery({ @@ -79,35 +93,46 @@ export async function fetchNamespaceEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().namespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .namespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * await prefetchNamespaceEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchNamespaceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceEventSelect>; -}): Promise; -export async function prefetchNamespaceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchNamespaceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceEventSelect>; + } +): Promise; +export async function prefetchNamespaceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: namespaceEventKeys.detail(params.id), - queryFn: () => getClient().namespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .namespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useNamespaceEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useNamespaceEventsQuery.ts index c1f828314f..ba942976cf 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useNamespaceEventsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useNamespaceEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations, NamespaceEventFilter, NamespaceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations, NamespaceEventFilter, NamespaceEventOrderBy } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import type { + NamespaceEventSelect, + NamespaceEventWithRelations, + NamespaceEventFilter, + NamespaceEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + NamespaceEventSelect, + NamespaceEventWithRelations, + NamespaceEventFilter, + NamespaceEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespaceEventsQueryKey = namespaceEventKeys.list; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { data, isLoading } = useNamespaceEventsQuery({ @@ -30,33 +45,53 @@ export const namespaceEventsQueryKey = namespaceEventKeys.list; * }); * ``` */ -export function useNamespaceEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespaceEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useNamespaceEventsQuery< + S extends NamespaceEventSelect, + TData = { + namespaceEvents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseQueryOptions< + { + namespaceEvents: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespaceEventsQuery( + params: { + selection: ListSelectionConfig< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceEventKeys.list(args), queryFn: () => getClient().namespaceEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * const data = await fetchNamespaceEventsQuery({ @@ -70,35 +105,55 @@ export function useNamespaceEventsQuery(params: { export async function fetchNamespaceEventsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceEventSelect>; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceEventSelect>; }): Promise<{ namespaceEvents: ConnectionResult>; }>; export async function fetchNamespaceEventsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >(params.selection); return getClient().namespaceEvent.findMany(args).unwrap(); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * await prefetchNamespaceEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchNamespaceEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceEventSelect>; -}): Promise; -export async function prefetchNamespaceEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchNamespaceEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceEventSelect>; + } +): Promise; +export async function prefetchNamespaceEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: namespaceEventKeys.list(args), - queryFn: () => getClient().namespaceEvent.findMany(args).unwrap() + queryFn: () => getClient().namespaceEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useNamespaceQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useNamespaceQuery.ts index 5a1f0dae7b..ffd1130133 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useNamespaceQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useNamespaceQuery.ts @@ -4,20 +4,20 @@ * 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 { namespaceKeys } from "../query-keys"; -import type { NamespaceSelect, NamespaceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import type { NamespaceSelect, NamespaceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceSelect, NamespaceWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespaceQueryKey = namespaceKeys.detail; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { data, isLoading } = useNamespaceQuery({ @@ -26,38 +26,52 @@ export const namespaceQueryKey = namespaceKeys.detail; * }); * ``` */ -export function useNamespaceQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespaceQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useNamespaceQuery< + S extends NamespaceSelect, + TData = { + namespace: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceSelect>; + } & Omit< + UseQueryOptions< + { + namespace: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespaceQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceKeys.detail(params.id), - queryFn: () => getClient().namespace.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .namespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * const data = await fetchNamespaceQuery({ @@ -79,35 +93,46 @@ export async function fetchNamespaceQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().namespace.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .namespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * await prefetchNamespaceQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchNamespaceQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceSelect>; -}): Promise; -export async function prefetchNamespaceQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchNamespaceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceSelect>; + } +): Promise; +export async function prefetchNamespaceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: namespaceKeys.detail(params.id), - queryFn: () => getClient().namespace.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .namespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useNamespacesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useNamespacesQuery.ts index eef6ff4100..291ce7dbd6 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useNamespacesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useNamespacesQuery.ts @@ -4,20 +4,35 @@ * 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 { namespaceKeys } from "../query-keys"; -import type { NamespaceSelect, NamespaceWithRelations, NamespaceFilter, NamespaceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations, NamespaceFilter, NamespaceOrderBy } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import type { + NamespaceSelect, + NamespaceWithRelations, + NamespaceFilter, + NamespaceOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + NamespaceSelect, + NamespaceWithRelations, + NamespaceFilter, + NamespaceOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespacesQueryKey = namespaceKeys.list; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { data, isLoading } = useNamespacesQuery({ @@ -30,33 +45,47 @@ export const namespacesQueryKey = namespaceKeys.list; * }); * ``` */ -export function useNamespacesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespacesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useNamespacesQuery< + S extends NamespaceSelect, + TData = { + namespaces: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceSelect>; + } & Omit< + UseQueryOptions< + { + namespaces: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespacesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceKeys.list(args), queryFn: () => getClient().namespace.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * const data = await fetchNamespacesQuery({ @@ -70,35 +99,47 @@ export function useNamespacesQuery(params: { export async function fetchNamespacesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceSelect>; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceSelect>; }): Promise<{ namespaces: ConnectionResult>; }>; export async function fetchNamespacesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().namespace.findMany(args).unwrap(); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * await prefetchNamespacesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchNamespacesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceSelect>; -}): Promise; -export async function prefetchNamespacesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchNamespacesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceSelect>; + } +): Promise; +export async function prefetchNamespacesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: namespaceKeys.list(args), - queryFn: () => getClient().namespace.findMany(args).unwrap() + queryFn: () => getClient().namespace.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionApiBindingQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionApiBindingQuery.ts index 644483b8d2..4b32c0592a 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionApiBindingQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionApiBindingQuery.ts @@ -4,20 +4,26 @@ * 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 { platformFunctionApiBindingKeys } from "../query-keys"; -import type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations } from "../../orm/input-types"; +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 { platformFunctionApiBindingKeys } from '../query-keys'; +import type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionApiBindingQueryKey = platformFunctionApiBindingKeys.detail; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionApiBindingQuery({ @@ -26,38 +32,58 @@ export const platformFunctionApiBindingQueryKey = platformFunctionApiBindingKeys * }); * ``` */ -export function usePlatformFunctionApiBindingQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionApiBindingSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionApiBindingQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformFunctionApiBindingQuery< + S extends PlatformFunctionApiBindingSelect, + TData = { + platformFunctionApiBinding: InferSelectResult< + PlatformFunctionApiBindingWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionApiBindingSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionApiBinding: InferSelectResult< + PlatformFunctionApiBindingWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionApiBindingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionApiBindingKeys.detail(params.id), - queryFn: () => getClient().platformFunctionApiBinding.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformFunctionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```ts * const data = await fetchPlatformFunctionApiBindingQuery({ @@ -66,7 +92,9 @@ export function usePlatformFunctionApiBindingQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionApiBindingQuery(params: { +export async function fetchPlatformFunctionApiBindingQuery< + S extends PlatformFunctionApiBindingSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +107,48 @@ export async function fetchPlatformFunctionApiBindingQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformFunctionApiBinding.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformFunctionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```ts * await prefetchPlatformFunctionApiBindingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformFunctionApiBindingQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionApiBindingSelect>; -}): Promise; -export async function prefetchPlatformFunctionApiBindingQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformFunctionApiBindingQuery< + S extends PlatformFunctionApiBindingSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionApiBindingSelect>; + } +): Promise; +export async function prefetchPlatformFunctionApiBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionApiBindingKeys.detail(params.id), - queryFn: () => getClient().platformFunctionApiBinding.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformFunctionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionApiBindingsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionApiBindingsQuery.ts index b0b682625f..cd2c01b437 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionApiBindingsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionApiBindingsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformFunctionApiBindingKeys } from "../query-keys"; -import type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations, PlatformFunctionApiBindingFilter, PlatformFunctionApiBindingOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingWithRelations, PlatformFunctionApiBindingFilter, PlatformFunctionApiBindingOrderBy } from "../../orm/input-types"; +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 { platformFunctionApiBindingKeys } from '../query-keys'; +import type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingWithRelations, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionApiBindingsQueryKey = platformFunctionApiBindingKeys.list; /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionApiBindingsQuery({ @@ -30,33 +45,60 @@ export const platformFunctionApiBindingsQueryKey = platformFunctionApiBindingKey * }); * ``` */ -export function usePlatformFunctionApiBindingsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionApiBindingSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionApiBindingsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformFunctionApiBindingsQuery< + S extends PlatformFunctionApiBindingSelect, + TData = { + platformFunctionApiBindings: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionApiBindingSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionApiBindings: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionApiBindingsQuery( + params: { + selection: ListSelectionConfig< + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionApiBindingKeys.list(args), queryFn: () => getClient().platformFunctionApiBinding.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```ts * const data = await fetchPlatformFunctionApiBindingsQuery({ @@ -67,38 +109,74 @@ export function usePlatformFunctionApiBindingsQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionApiBindingsQuery(params: { +export async function fetchPlatformFunctionApiBindingsQuery< + S extends PlatformFunctionApiBindingSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionApiBindingSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionApiBindingSelect>; }): Promise<{ - platformFunctionApiBindings: ConnectionResult>; + platformFunctionApiBindings: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformFunctionApiBindingsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy + >(params.selection); return getClient().platformFunctionApiBinding.findMany(args).unwrap(); } /** * Join table binding function definitions to API endpoints with per-binding alias and config - * + * * @example * ```ts * await prefetchPlatformFunctionApiBindingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformFunctionApiBindingsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionApiBindingSelect>; -}): Promise; -export async function prefetchPlatformFunctionApiBindingsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformFunctionApiBindingsQuery< + S extends PlatformFunctionApiBindingSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionApiBindingSelect>; + } +): Promise; +export async function prefetchPlatformFunctionApiBindingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionApiBindingKeys.list(args), - queryFn: () => getClient().platformFunctionApiBinding.findMany(args).unwrap() + queryFn: () => getClient().platformFunctionApiBinding.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDefinitionQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDefinitionQuery.ts index d9d2588121..0837645bb4 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDefinitionQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDefinitionQuery.ts @@ -4,20 +4,26 @@ * 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 { platformFunctionDefinitionKeys } from "../query-keys"; -import type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations } from "../../orm/input-types"; +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 { platformFunctionDefinitionKeys } from '../query-keys'; +import type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionDefinitionQueryKey = platformFunctionDefinitionKeys.detail; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionDefinitionQuery({ @@ -26,38 +32,58 @@ export const platformFunctionDefinitionQueryKey = platformFunctionDefinitionKeys * }); * ``` */ -export function usePlatformFunctionDefinitionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionDefinitionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionDefinitionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformFunctionDefinitionQuery< + S extends PlatformFunctionDefinitionSelect, + TData = { + platformFunctionDefinition: InferSelectResult< + PlatformFunctionDefinitionWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionDefinition: InferSelectResult< + PlatformFunctionDefinitionWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionDefinitionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionDefinitionKeys.detail(params.id), - queryFn: () => getClient().platformFunctionDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformFunctionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```ts * const data = await fetchPlatformFunctionDefinitionQuery({ @@ -66,7 +92,9 @@ export function usePlatformFunctionDefinitionQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionDefinitionQuery(params: { +export async function fetchPlatformFunctionDefinitionQuery< + S extends PlatformFunctionDefinitionSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +107,48 @@ export async function fetchPlatformFunctionDefinitionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformFunctionDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformFunctionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```ts * await prefetchPlatformFunctionDefinitionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformFunctionDefinitionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionDefinitionSelect>; -}): Promise; -export async function prefetchPlatformFunctionDefinitionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformFunctionDefinitionQuery< + S extends PlatformFunctionDefinitionSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionDefinitionSelect>; + } +): Promise; +export async function prefetchPlatformFunctionDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionDefinitionKeys.detail(params.id), - queryFn: () => getClient().platformFunctionDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformFunctionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDefinitionsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDefinitionsQuery.ts index 896fddac28..0861333a01 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDefinitionsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDefinitionsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformFunctionDefinitionKeys } from "../query-keys"; -import type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionFilter, PlatformFunctionDefinitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionFilter, PlatformFunctionDefinitionOrderBy } from "../../orm/input-types"; +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 { platformFunctionDefinitionKeys } from '../query-keys'; +import type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionWithRelations, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionDefinitionsQueryKey = platformFunctionDefinitionKeys.list; /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionDefinitionsQuery({ @@ -30,33 +45,60 @@ export const platformFunctionDefinitionsQueryKey = platformFunctionDefinitionKey * }); * ``` */ -export function usePlatformFunctionDefinitionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDefinitionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionDefinitionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformFunctionDefinitionsQuery< + S extends PlatformFunctionDefinitionSelect, + TData = { + platformFunctionDefinitions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionDefinitions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionDefinitionsQuery( + params: { + selection: ListSelectionConfig< + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionDefinitionKeys.list(args), queryFn: () => getClient().platformFunctionDefinition.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```ts * const data = await fetchPlatformFunctionDefinitionsQuery({ @@ -67,38 +109,74 @@ export function usePlatformFunctionDefinitionsQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionDefinitionsQuery(params: { +export async function fetchPlatformFunctionDefinitionsQuery< + S extends PlatformFunctionDefinitionSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDefinitionSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionDefinitionSelect>; }): Promise<{ - platformFunctionDefinitions: ConnectionResult>; + platformFunctionDefinitions: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformFunctionDefinitionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy + >(params.selection); return getClient().platformFunctionDefinition.findMany(args).unwrap(); } /** * Function definitions — registered cloud functions with routing, queue, and retry configuration - * + * * @example * ```ts * await prefetchPlatformFunctionDefinitionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformFunctionDefinitionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDefinitionSelect>; -}): Promise; -export async function prefetchPlatformFunctionDefinitionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformFunctionDefinitionsQuery< + S extends PlatformFunctionDefinitionSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionDefinitionSelect>; + } +): Promise; +export async function prefetchPlatformFunctionDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionDefinitionKeys.list(args), - queryFn: () => getClient().platformFunctionDefinition.findMany(args).unwrap() + queryFn: () => getClient().platformFunctionDefinition.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentEventQuery.ts index 00bf2e721d..27af3849ce 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentEventQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentEventQuery.ts @@ -4,20 +4,26 @@ * 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 { platformFunctionDeploymentEventKeys } from "../query-keys"; -import type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations } from "../../orm/input-types"; +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 { platformFunctionDeploymentEventKeys } from '../query-keys'; +import type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionDeploymentEventQueryKey = platformFunctionDeploymentEventKeys.detail; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionDeploymentEventQuery({ @@ -26,38 +32,58 @@ export const platformFunctionDeploymentEventQueryKey = platformFunctionDeploymen * }); * ``` */ -export function usePlatformFunctionDeploymentEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionDeploymentEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformFunctionDeploymentEventQuery< + S extends PlatformFunctionDeploymentEventSelect, + TData = { + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionDeploymentEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionDeploymentEventKeys.detail(params.id), - queryFn: () => getClient().platformFunctionDeploymentEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformFunctionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```ts * const data = await fetchPlatformFunctionDeploymentEventQuery({ @@ -66,48 +92,66 @@ export function usePlatformFunctionDeploymentEventQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionDeploymentEventQuery(params: { +export async function fetchPlatformFunctionDeploymentEventQuery< + S extends PlatformFunctionDeploymentEventSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; }): Promise<{ - platformFunctionDeploymentEvent: InferSelectResult | null; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; }>; export async function fetchPlatformFunctionDeploymentEventQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformFunctionDeploymentEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformFunctionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```ts * await prefetchPlatformFunctionDeploymentEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformFunctionDeploymentEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; -}): Promise; -export async function prefetchPlatformFunctionDeploymentEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformFunctionDeploymentEventQuery< + S extends PlatformFunctionDeploymentEventSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; + } +): Promise; +export async function prefetchPlatformFunctionDeploymentEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionDeploymentEventKeys.detail(params.id), - queryFn: () => getClient().platformFunctionDeploymentEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformFunctionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentEventsQuery.ts index 9961d173ee..07de6da60f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentEventsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformFunctionDeploymentEventKeys } from "../query-keys"; -import type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventWithRelations, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy } from "../../orm/input-types"; +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 { platformFunctionDeploymentEventKeys } from '../query-keys'; +import type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventWithRelations, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionDeploymentEventsQueryKey = platformFunctionDeploymentEventKeys.list; /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionDeploymentEventsQuery({ @@ -30,33 +45,64 @@ export const platformFunctionDeploymentEventsQueryKey = platformFunctionDeployme * }); * ``` */ -export function usePlatformFunctionDeploymentEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionDeploymentEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformFunctionDeploymentEventsQuery< + S extends PlatformFunctionDeploymentEventSelect, + TData = { + platformFunctionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformFunctionDeploymentEventSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionDeploymentEventsQuery( + params: { + selection: ListSelectionConfig< + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionDeploymentEventKeys.list(args), queryFn: () => getClient().platformFunctionDeploymentEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```ts * const data = await fetchPlatformFunctionDeploymentEventsQuery({ @@ -67,38 +113,82 @@ export function usePlatformFunctionDeploymentEventsQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionDeploymentEventsQuery(params: { +export async function fetchPlatformFunctionDeploymentEventsQuery< + S extends PlatformFunctionDeploymentEventSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; + } & Omit< + ListSelectionConfig< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformFunctionDeploymentEventSelect>; }): Promise<{ - platformFunctionDeploymentEvents: ConnectionResult>; + platformFunctionDeploymentEvents: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformFunctionDeploymentEventsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >(params.selection); return getClient().platformFunctionDeploymentEvent.findMany(args).unwrap(); } /** * Deployment lifecycle events — audit log of provisioning, scaling, and failure events - * + * * @example * ```ts * await prefetchPlatformFunctionDeploymentEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformFunctionDeploymentEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDeploymentEventSelect>; -}): Promise; -export async function prefetchPlatformFunctionDeploymentEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformFunctionDeploymentEventsQuery< + S extends PlatformFunctionDeploymentEventSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformFunctionDeploymentEventSelect>; + } +): Promise; +export async function prefetchPlatformFunctionDeploymentEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionDeploymentEventKeys.list(args), - queryFn: () => getClient().platformFunctionDeploymentEvent.findMany(args).unwrap() + queryFn: () => getClient().platformFunctionDeploymentEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentQuery.ts index 8462f8e6bd..5f33024b85 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentQuery.ts @@ -4,20 +4,26 @@ * 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 { platformFunctionDeploymentKeys } from "../query-keys"; -import type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations } from "../../orm/input-types"; +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 { platformFunctionDeploymentKeys } from '../query-keys'; +import type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionDeploymentQueryKey = platformFunctionDeploymentKeys.detail; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionDeploymentQuery({ @@ -26,38 +32,58 @@ export const platformFunctionDeploymentQueryKey = platformFunctionDeploymentKeys * }); * ``` */ -export function usePlatformFunctionDeploymentQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionDeploymentSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionDeploymentQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformFunctionDeploymentQuery< + S extends PlatformFunctionDeploymentSelect, + TData = { + platformFunctionDeployment: InferSelectResult< + PlatformFunctionDeploymentWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionDeploymentSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionDeployment: InferSelectResult< + PlatformFunctionDeploymentWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionDeploymentQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionDeploymentKeys.detail(params.id), - queryFn: () => getClient().platformFunctionDeployment.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformFunctionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```ts * const data = await fetchPlatformFunctionDeploymentQuery({ @@ -66,7 +92,9 @@ export function usePlatformFunctionDeploymentQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionDeploymentQuery(params: { +export async function fetchPlatformFunctionDeploymentQuery< + S extends PlatformFunctionDeploymentSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +107,48 @@ export async function fetchPlatformFunctionDeploymentQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformFunctionDeployment.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformFunctionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```ts * await prefetchPlatformFunctionDeploymentQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformFunctionDeploymentQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionDeploymentSelect>; -}): Promise; -export async function prefetchPlatformFunctionDeploymentQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformFunctionDeploymentQuery< + S extends PlatformFunctionDeploymentSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionDeploymentSelect>; + } +): Promise; +export async function prefetchPlatformFunctionDeploymentQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionDeploymentKeys.detail(params.id), - queryFn: () => getClient().platformFunctionDeployment.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformFunctionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentsQuery.ts index 34f9fd940c..e63e227ff3 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionDeploymentsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformFunctionDeploymentKeys } from "../query-keys"; -import type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations, PlatformFunctionDeploymentFilter, PlatformFunctionDeploymentOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentWithRelations, PlatformFunctionDeploymentFilter, PlatformFunctionDeploymentOrderBy } from "../../orm/input-types"; +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 { platformFunctionDeploymentKeys } from '../query-keys'; +import type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentWithRelations, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionDeploymentsQueryKey = platformFunctionDeploymentKeys.list; /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionDeploymentsQuery({ @@ -30,33 +45,60 @@ export const platformFunctionDeploymentsQueryKey = platformFunctionDeploymentKey * }); * ``` */ -export function usePlatformFunctionDeploymentsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDeploymentSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionDeploymentsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformFunctionDeploymentsQuery< + S extends PlatformFunctionDeploymentSelect, + TData = { + platformFunctionDeployments: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionDeploymentSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionDeployments: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionDeploymentsQuery( + params: { + selection: ListSelectionConfig< + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionDeploymentKeys.list(args), queryFn: () => getClient().platformFunctionDeployment.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```ts * const data = await fetchPlatformFunctionDeploymentsQuery({ @@ -67,38 +109,74 @@ export function usePlatformFunctionDeploymentsQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionDeploymentsQuery(params: { +export async function fetchPlatformFunctionDeploymentsQuery< + S extends PlatformFunctionDeploymentSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDeploymentSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionDeploymentSelect>; }): Promise<{ - platformFunctionDeployments: ConnectionResult>; + platformFunctionDeployments: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformFunctionDeploymentsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy + >(params.selection); return getClient().platformFunctionDeployment.findMany(args).unwrap(); } /** * Function deployment bindings — ties a handler image to a namespace for Knative provisioning and routing (one row per handler image per namespace) - * + * * @example * ```ts * await prefetchPlatformFunctionDeploymentsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformFunctionDeploymentsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionDeploymentSelect>; -}): Promise; -export async function prefetchPlatformFunctionDeploymentsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformFunctionDeploymentsQuery< + S extends PlatformFunctionDeploymentSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionDeploymentSelect>; + } +): Promise; +export async function prefetchPlatformFunctionDeploymentsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionDeploymentKeys.list(args), - queryFn: () => getClient().platformFunctionDeployment.findMany(args).unwrap() + queryFn: () => getClient().platformFunctionDeployment.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionExecutionLogQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionExecutionLogQuery.ts index 1455c35110..728063f3eb 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionExecutionLogQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionExecutionLogQuery.ts @@ -4,20 +4,26 @@ * 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 { platformFunctionExecutionLogKeys } from "../query-keys"; -import type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations } from "../../orm/input-types"; +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 { platformFunctionExecutionLogKeys } from '../query-keys'; +import type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionExecutionLogQueryKey = platformFunctionExecutionLogKeys.detail; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionExecutionLogQuery({ @@ -26,38 +32,58 @@ export const platformFunctionExecutionLogQueryKey = platformFunctionExecutionLog * }); * ``` */ -export function usePlatformFunctionExecutionLogQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionExecutionLogSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionExecutionLogQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformFunctionExecutionLogQuery< + S extends PlatformFunctionExecutionLogSelect, + TData = { + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionExecutionLogSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionExecutionLogQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionExecutionLogKeys.detail(params.id), - queryFn: () => getClient().platformFunctionExecutionLog.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformFunctionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function execution logs — structured console output per invocation - * + * * @example * ```ts * const data = await fetchPlatformFunctionExecutionLogQuery({ @@ -66,48 +92,66 @@ export function usePlatformFunctionExecutionLogQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionExecutionLogQuery(params: { +export async function fetchPlatformFunctionExecutionLogQuery< + S extends PlatformFunctionExecutionLogSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, PlatformFunctionExecutionLogSelect>; }): Promise<{ - platformFunctionExecutionLog: InferSelectResult | null; + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; }>; export async function fetchPlatformFunctionExecutionLogQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformFunctionExecutionLog.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformFunctionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function execution logs — structured console output per invocation - * + * * @example * ```ts * await prefetchPlatformFunctionExecutionLogQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformFunctionExecutionLogQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionExecutionLogSelect>; -}): Promise; -export async function prefetchPlatformFunctionExecutionLogQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformFunctionExecutionLogQuery< + S extends PlatformFunctionExecutionLogSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionExecutionLogSelect>; + } +): Promise; +export async function prefetchPlatformFunctionExecutionLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionExecutionLogKeys.detail(params.id), - queryFn: () => getClient().platformFunctionExecutionLog.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformFunctionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionExecutionLogsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionExecutionLogsQuery.ts index 6ffc8a8c11..4f8fa917ee 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionExecutionLogsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionExecutionLogsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformFunctionExecutionLogKeys } from "../query-keys"; -import type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy } from "../../orm/input-types"; +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 { platformFunctionExecutionLogKeys } from '../query-keys'; +import type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogWithRelations, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionExecutionLogsQueryKey = platformFunctionExecutionLogKeys.list; /** * Function execution logs — structured console output per invocation - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionExecutionLogsQuery({ @@ -30,33 +45,64 @@ export const platformFunctionExecutionLogsQueryKey = platformFunctionExecutionLo * }); * ``` */ -export function usePlatformFunctionExecutionLogsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionExecutionLogSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionExecutionLogsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformFunctionExecutionLogsQuery< + S extends PlatformFunctionExecutionLogSelect, + TData = { + platformFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformFunctionExecutionLogSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionExecutionLogsQuery( + params: { + selection: ListSelectionConfig< + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionExecutionLogKeys.list(args), queryFn: () => getClient().platformFunctionExecutionLog.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function execution logs — structured console output per invocation - * + * * @example * ```ts * const data = await fetchPlatformFunctionExecutionLogsQuery({ @@ -67,38 +113,78 @@ export function usePlatformFunctionExecutionLogsQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionExecutionLogsQuery(params: { +export async function fetchPlatformFunctionExecutionLogsQuery< + S extends PlatformFunctionExecutionLogSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionExecutionLogSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionExecutionLogSelect>; }): Promise<{ - platformFunctionExecutionLogs: ConnectionResult>; + platformFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformFunctionExecutionLogsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + >(params.selection); return getClient().platformFunctionExecutionLog.findMany(args).unwrap(); } /** * Function execution logs — structured console output per invocation - * + * * @example * ```ts * await prefetchPlatformFunctionExecutionLogsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformFunctionExecutionLogsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionExecutionLogSelect>; -}): Promise; -export async function prefetchPlatformFunctionExecutionLogsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformFunctionExecutionLogsQuery< + S extends PlatformFunctionExecutionLogSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformFunctionExecutionLogSelect>; + } +): Promise; +export async function prefetchPlatformFunctionExecutionLogsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionExecutionLogKeys.list(args), - queryFn: () => getClient().platformFunctionExecutionLog.findMany(args).unwrap() + queryFn: () => getClient().platformFunctionExecutionLog.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationAttemptQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationAttemptQuery.ts index 56f228cbc1..480490b663 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationAttemptQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationAttemptQuery.ts @@ -4,20 +4,27 @@ * 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 { platformFunctionInvocationAttemptKeys } from "../query-keys"; -import type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations } from "../../orm/input-types"; +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 { platformFunctionInvocationAttemptKeys } from '../query-keys'; +import type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ -export const platformFunctionInvocationAttemptQueryKey = platformFunctionInvocationAttemptKeys.detail; +export const platformFunctionInvocationAttemptQueryKey = + platformFunctionInvocationAttemptKeys.detail; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionInvocationAttemptQuery({ @@ -26,38 +33,58 @@ export const platformFunctionInvocationAttemptQueryKey = platformFunctionInvocat * }); * ``` */ -export function usePlatformFunctionInvocationAttemptQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionInvocationAttemptQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformFunctionInvocationAttemptQuery< + S extends PlatformFunctionInvocationAttemptSelect, + TData = { + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionInvocationAttemptQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionInvocationAttemptKeys.detail(params.id), - queryFn: () => getClient().platformFunctionInvocationAttempt.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformFunctionInvocationAttempt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```ts * const data = await fetchPlatformFunctionInvocationAttemptQuery({ @@ -66,48 +93,66 @@ export function usePlatformFunctionInvocationAttemptQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionInvocationAttemptQuery(params: { +export async function fetchPlatformFunctionInvocationAttemptQuery< + S extends PlatformFunctionInvocationAttemptSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; }): Promise<{ - platformFunctionInvocationAttempt: InferSelectResult | null; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; }>; export async function fetchPlatformFunctionInvocationAttemptQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformFunctionInvocationAttempt.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformFunctionInvocationAttempt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```ts * await prefetchPlatformFunctionInvocationAttemptQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformFunctionInvocationAttemptQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; -}): Promise; -export async function prefetchPlatformFunctionInvocationAttemptQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformFunctionInvocationAttemptQuery< + S extends PlatformFunctionInvocationAttemptSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; + } +): Promise; +export async function prefetchPlatformFunctionInvocationAttemptQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionInvocationAttemptKeys.detail(params.id), - queryFn: () => getClient().platformFunctionInvocationAttempt.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformFunctionInvocationAttempt.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationAttemptsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationAttemptsQuery.ts index 40d4abc8d2..c4af807cd4 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationAttemptsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationAttemptsQuery.ts @@ -4,20 +4,36 @@ * 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 { platformFunctionInvocationAttemptKeys } from "../query-keys"; -import type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptWithRelations, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy } from "../../orm/input-types"; +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 { platformFunctionInvocationAttemptKeys } from '../query-keys'; +import type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptWithRelations, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ -export const platformFunctionInvocationAttemptsQueryKey = platformFunctionInvocationAttemptKeys.list; +export const platformFunctionInvocationAttemptsQueryKey = + platformFunctionInvocationAttemptKeys.list; /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionInvocationAttemptsQuery({ @@ -30,33 +46,64 @@ export const platformFunctionInvocationAttemptsQueryKey = platformFunctionInvoca * }); * ``` */ -export function usePlatformFunctionInvocationAttemptsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionInvocationAttemptsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformFunctionInvocationAttemptsQuery< + S extends PlatformFunctionInvocationAttemptSelect, + TData = { + platformFunctionInvocationAttempts: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionInvocationAttempts: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionInvocationAttemptsQuery( + params: { + selection: ListSelectionConfig< + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionInvocationAttemptKeys.list(args), queryFn: () => getClient().platformFunctionInvocationAttempt.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```ts * const data = await fetchPlatformFunctionInvocationAttemptsQuery({ @@ -67,38 +114,82 @@ export function usePlatformFunctionInvocationAttemptsQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionInvocationAttemptsQuery(params: { +export async function fetchPlatformFunctionInvocationAttemptsQuery< + S extends PlatformFunctionInvocationAttemptSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; + } & Omit< + ListSelectionConfig< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; }): Promise<{ - platformFunctionInvocationAttempts: ConnectionResult>; + platformFunctionInvocationAttempts: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformFunctionInvocationAttemptsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >(params.selection); return getClient().platformFunctionInvocationAttempt.findMany(args).unwrap(); } /** * Function invocation attempts — one row per worker attempt (including failed retries) with duration and error detail - * + * * @example * ```ts * await prefetchPlatformFunctionInvocationAttemptsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformFunctionInvocationAttemptsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; -}): Promise; -export async function prefetchPlatformFunctionInvocationAttemptsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformFunctionInvocationAttemptsQuery< + S extends PlatformFunctionInvocationAttemptSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformFunctionInvocationAttemptSelect>; + } +): Promise; +export async function prefetchPlatformFunctionInvocationAttemptsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionInvocationAttemptKeys.list(args), - queryFn: () => getClient().platformFunctionInvocationAttempt.findMany(args).unwrap() + queryFn: () => getClient().platformFunctionInvocationAttempt.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationQuery.ts index 98d72ffaa6..87fb47358b 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationQuery.ts @@ -4,20 +4,26 @@ * 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 { platformFunctionInvocationKeys } from "../query-keys"; -import type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations } from "../../orm/input-types"; +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 { platformFunctionInvocationKeys } from '../query-keys'; +import type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionInvocationQueryKey = platformFunctionInvocationKeys.detail; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionInvocationQuery({ @@ -26,38 +32,58 @@ export const platformFunctionInvocationQueryKey = platformFunctionInvocationKeys * }); * ``` */ -export function usePlatformFunctionInvocationQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionInvocationSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionInvocationQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformFunctionInvocationQuery< + S extends PlatformFunctionInvocationSelect, + TData = { + platformFunctionInvocation: InferSelectResult< + PlatformFunctionInvocationWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionInvocationSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionInvocation: InferSelectResult< + PlatformFunctionInvocationWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionInvocationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionInvocationKeys.detail(params.id), - queryFn: () => getClient().platformFunctionInvocation.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformFunctionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```ts * const data = await fetchPlatformFunctionInvocationQuery({ @@ -66,7 +92,9 @@ export function usePlatformFunctionInvocationQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionInvocationQuery(params: { +export async function fetchPlatformFunctionInvocationQuery< + S extends PlatformFunctionInvocationSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +107,48 @@ export async function fetchPlatformFunctionInvocationQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformFunctionInvocation.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformFunctionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```ts * await prefetchPlatformFunctionInvocationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformFunctionInvocationQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformFunctionInvocationSelect>; -}): Promise; -export async function prefetchPlatformFunctionInvocationQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformFunctionInvocationQuery< + S extends PlatformFunctionInvocationSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformFunctionInvocationSelect>; + } +): Promise; +export async function prefetchPlatformFunctionInvocationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionInvocationKeys.detail(params.id), - queryFn: () => getClient().platformFunctionInvocation.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformFunctionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationsQuery.ts index ad62dcc49f..98b1ca6e79 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformFunctionInvocationsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformFunctionInvocationKeys } from "../query-keys"; -import type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationFilter, PlatformFunctionInvocationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformFunctionInvocationSelect, PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationFilter, PlatformFunctionInvocationOrderBy } from "../../orm/input-types"; +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 { platformFunctionInvocationKeys } from '../query-keys'; +import type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationWithRelations, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformFunctionInvocationsQueryKey = platformFunctionInvocationKeys.list; /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```tsx * const { data, isLoading } = usePlatformFunctionInvocationsQuery({ @@ -30,33 +45,60 @@ export const platformFunctionInvocationsQueryKey = platformFunctionInvocationKey * }); * ``` */ -export function usePlatformFunctionInvocationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionInvocationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformFunctionInvocationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformFunctionInvocationsQuery< + S extends PlatformFunctionInvocationSelect, + TData = { + platformFunctionInvocations: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionInvocationSelect>; + } & Omit< + UseQueryOptions< + { + platformFunctionInvocations: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformFunctionInvocationsQuery( + params: { + selection: ListSelectionConfig< + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformFunctionInvocationKeys.list(args), queryFn: () => getClient().platformFunctionInvocation.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```ts * const data = await fetchPlatformFunctionInvocationsQuery({ @@ -67,38 +109,74 @@ export function usePlatformFunctionInvocationsQuery(params: { * }); * ``` */ -export async function fetchPlatformFunctionInvocationsQuery(params: { +export async function fetchPlatformFunctionInvocationsQuery< + S extends PlatformFunctionInvocationSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionInvocationSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionInvocationSelect>; }): Promise<{ - platformFunctionInvocations: ConnectionResult>; + platformFunctionInvocations: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformFunctionInvocationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy + >(params.selection); return getClient().platformFunctionInvocation.findMany(args).unwrap(); } /** * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug. - * + * * @example * ```ts * await prefetchPlatformFunctionInvocationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformFunctionInvocationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformFunctionInvocationSelect>; -}): Promise; -export async function prefetchPlatformFunctionInvocationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformFunctionInvocationsQuery< + S extends PlatformFunctionInvocationSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformFunctionInvocationSelect>; + } +): Promise; +export async function prefetchPlatformFunctionInvocationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformFunctionInvocationKeys.list(args), - queryFn: () => getClient().platformFunctionInvocation.findMany(args).unwrap() + queryFn: () => getClient().platformFunctionInvocation.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraCommitQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraCommitQuery.ts index b158df5fac..bd0d25a147 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraCommitQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraCommitQuery.ts @@ -4,20 +4,26 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraCommitQueryKey = platformInfraCommitKeys.detail; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraCommitQuery({ @@ -26,38 +32,52 @@ export const platformInfraCommitQueryKey = platformInfraCommitKeys.detail; * }); * ``` */ -export function usePlatformInfraCommitQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraCommitSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraCommitQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInfraCommitQuery< + S extends PlatformInfraCommitSelect, + TData = { + platformInfraCommit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraCommit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraCommitQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraCommitKeys.detail(params.id), - queryFn: () => getClient().platformInfraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInfraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchPlatformInfraCommitQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformInfraCommitQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInfraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInfraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchPlatformInfraCommitQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInfraCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraCommitSelect>; -}): Promise; -export async function prefetchPlatformInfraCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInfraCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } +): Promise; +export async function prefetchPlatformInfraCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraCommitKeys.detail(params.id), - queryFn: () => getClient().platformInfraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInfraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraCommitsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraCommitsQuery.ts index 0a943e49ba..bebab98fce 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraCommitsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraCommitsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraCommitsQueryKey = platformInfraCommitKeys.list; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraCommitsQuery({ @@ -30,33 +45,58 @@ export const platformInfraCommitsQueryKey = platformInfraCommitKeys.list; * }); * ``` */ -export function usePlatformInfraCommitsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraCommitSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraCommitsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraCommitsQuery< + S extends PlatformInfraCommitSelect, + TData = { + platformInfraCommits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraCommits: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraCommitsQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraCommitKeys.list(args), queryFn: () => getClient().platformInfraCommit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchPlatformInfraCommitsQuery({ @@ -70,35 +110,65 @@ export function usePlatformInfraCommitsQuery(params: { export async function fetchPlatformInfraCommitsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraCommitSelect>; }): Promise<{ platformInfraCommits: ConnectionResult>; }>; export async function fetchPlatformInfraCommitsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >(params.selection); return getClient().platformInfraCommit.findMany(args).unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchPlatformInfraCommitsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraCommitsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraCommitSelect>; -}): Promise; -export async function prefetchPlatformInfraCommitsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraCommitsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraCommitSelect>; + } +): Promise; +export async function prefetchPlatformInfraCommitsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraCommitKeys.list(args), - queryFn: () => getClient().platformInfraCommit.findMany(args).unwrap() + queryFn: () => getClient().platformInfraCommit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraGetAllTreeNodesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraGetAllTreeNodesQuery.ts index c847912e69..558fe2f081 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraGetAllTreeNodesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraGetAllTreeNodesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraGetAllTreeNodesRecordKeys } from "../query-keys"; -import type { PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; +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 { platformInfraGetAllTreeNodesRecordKeys } from '../query-keys'; +import type { + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraGetAllTreeNodesQueryKey = platformInfraGetAllTreeNodesRecordKeys.list; /** * Query hook for fetching PlatformInfraGetAllTreeNodesRecord list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraGetAllTreeNodesQuery({ @@ -30,33 +45,64 @@ export const platformInfraGetAllTreeNodesQueryKey = platformInfraGetAllTreeNodes * }); * ``` */ -export function usePlatformInfraGetAllTreeNodesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraGetAllTreeNodesQuery< + S extends PlatformInfraGetAllTreeNodesRecordSelect, + TData = { + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraGetAllTreeNodesQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraGetAllTreeNodesRecordKeys.list(args), queryFn: () => getClient().platformInfraGetAllTreeNodesRecord.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformInfraGetAllTreeNodesRecord list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformInfraGetAllTreeNodesQuery({ @@ -67,38 +113,82 @@ export function usePlatformInfraGetAllTreeNodesQuery(params: { * }); * ``` */ -export async function fetchPlatformInfraGetAllTreeNodesQuery(params: { +export async function fetchPlatformInfraGetAllTreeNodesQuery< + S extends PlatformInfraGetAllTreeNodesRecordSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; + } & Omit< + ListSelectionConfig< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; }): Promise<{ - platformInfraGetAllTreeNodes: ConnectionResult>; + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformInfraGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >(params.selection); return getClient().platformInfraGetAllTreeNodesRecord.findMany(args).unwrap(); } /** * Prefetch PlatformInfraGetAllTreeNodesRecord list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformInfraGetAllTreeNodesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; -}): Promise; -export async function prefetchPlatformInfraGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraGetAllTreeNodesQuery< + S extends PlatformInfraGetAllTreeNodesRecordSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; + } +): Promise; +export async function prefetchPlatformInfraGetAllTreeNodesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraGetAllTreeNodesRecordKeys.list(args), - queryFn: () => getClient().platformInfraGetAllTreeNodesRecord.findMany(args).unwrap() + queryFn: () => getClient().platformInfraGetAllTreeNodesRecord.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraObjectQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraObjectQuery.ts index adfcfb1c63..f3e5bdd938 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraObjectQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraObjectQuery.ts @@ -4,20 +4,26 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraGetNodeAtPathQueryKey = platformInfraObjectKeys.detail; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraObjectQuery({ @@ -26,38 +32,52 @@ export const platformInfraGetNodeAtPathQueryKey = platformInfraObjectKeys.detail * }); * ``` */ -export function usePlatformInfraObjectQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraObjectSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraObjectQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInfraObjectQuery< + S extends PlatformInfraObjectSelect, + TData = { + platformInfraGetNodeAtPath: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraGetNodeAtPath: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraObjectQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraObjectKeys.detail(params.id), - queryFn: () => getClient().platformInfraObject.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInfraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchPlatformInfraObjectQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformInfraObjectQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInfraObject.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInfraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchPlatformInfraObjectQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInfraObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraObjectSelect>; -}): Promise; -export async function prefetchPlatformInfraObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInfraObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } +): Promise; +export async function prefetchPlatformInfraObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraObjectKeys.detail(params.id), - queryFn: () => getClient().platformInfraObject.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInfraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraObjectsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraObjectsQuery.ts index 9404057e6b..ea51820b7b 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraObjectsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraObjectsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraObjectsQueryKey = platformInfraObjectKeys.list; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraObjectsQuery({ @@ -30,33 +45,58 @@ export const platformInfraObjectsQueryKey = platformInfraObjectKeys.list; * }); * ``` */ -export function usePlatformInfraObjectsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraObjectSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraObjectsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraObjectsQuery< + S extends PlatformInfraObjectSelect, + TData = { + platformInfraObjects: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraObjects: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraObjectsQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraObjectKeys.list(args), queryFn: () => getClient().platformInfraObject.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchPlatformInfraObjectsQuery({ @@ -70,35 +110,65 @@ export function usePlatformInfraObjectsQuery(params: { export async function fetchPlatformInfraObjectsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraObjectSelect>; }): Promise<{ platformInfraObjects: ConnectionResult>; }>; export async function fetchPlatformInfraObjectsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >(params.selection); return getClient().platformInfraObject.findMany(args).unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchPlatformInfraObjectsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraObjectsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraObjectSelect>; -}): Promise; -export async function prefetchPlatformInfraObjectsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraObjectsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraObjectSelect>; + } +): Promise; +export async function prefetchPlatformInfraObjectsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraObjectKeys.list(args), - queryFn: () => getClient().platformInfraObject.findMany(args).unwrap() + queryFn: () => getClient().platformInfraObject.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraRefQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraRefQuery.ts index 3b4c58060b..4421bd3010 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraRefQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraRefQuery.ts @@ -4,20 +4,20 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraRefQueryKey = platformInfraRefKeys.detail; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraRefQuery({ @@ -26,38 +26,52 @@ export const platformInfraRefQueryKey = platformInfraRefKeys.detail; * }); * ``` */ -export function usePlatformInfraRefQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraRefSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraRefQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInfraRefQuery< + S extends PlatformInfraRefSelect, + TData = { + platformInfraRef: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraRef: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraRefQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraRefKeys.detail(params.id), - queryFn: () => getClient().platformInfraRef.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInfraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchPlatformInfraRefQuery({ @@ -79,35 +93,46 @@ export async function fetchPlatformInfraRefQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInfraRef.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInfraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchPlatformInfraRefQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInfraRefQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraRefSelect>; -}): Promise; -export async function prefetchPlatformInfraRefQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInfraRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraRefSelect>; + } +): Promise; +export async function prefetchPlatformInfraRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraRefKeys.detail(params.id), - queryFn: () => getClient().platformInfraRef.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInfraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraRefsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraRefsQuery.ts index 7277477566..00d161821b 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraRefsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraRefsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, PlatformInfraRefFilter, PlatformInfraRefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, PlatformInfraRefFilter, PlatformInfraRefOrderBy } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraRefsQueryKey = platformInfraRefKeys.list; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraRefsQuery({ @@ -30,33 +45,53 @@ export const platformInfraRefsQueryKey = platformInfraRefKeys.list; * }); * ``` */ -export function usePlatformInfraRefsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraRefSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraRefsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraRefsQuery< + S extends PlatformInfraRefSelect, + TData = { + platformInfraRefs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraRefs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraRefsQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraRefKeys.list(args), queryFn: () => getClient().platformInfraRef.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchPlatformInfraRefsQuery({ @@ -70,35 +105,59 @@ export function usePlatformInfraRefsQuery(params: { export async function fetchPlatformInfraRefsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformInfraRefSelect>; }): Promise<{ platformInfraRefs: ConnectionResult>; }>; export async function fetchPlatformInfraRefsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >(params.selection); return getClient().platformInfraRef.findMany(args).unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchPlatformInfraRefsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraRefsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraRefSelect>; -}): Promise; -export async function prefetchPlatformInfraRefsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraRefsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformInfraRefSelect>; + } +): Promise; +export async function prefetchPlatformInfraRefsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraRefKeys.list(args), - queryFn: () => getClient().platformInfraRef.findMany(args).unwrap() + queryFn: () => getClient().platformInfraRef.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraStoreQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraStoreQuery.ts index 4c98746c37..de3ae8a8ac 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraStoreQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraStoreQuery.ts @@ -4,20 +4,26 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraStoreQueryKey = platformInfraStoreKeys.detail; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraStoreQuery({ @@ -26,38 +32,52 @@ export const platformInfraStoreQueryKey = platformInfraStoreKeys.detail; * }); * ``` */ -export function usePlatformInfraStoreQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraStoreSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraStoreQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInfraStoreQuery< + S extends PlatformInfraStoreSelect, + TData = { + platformInfraStore: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraStore: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraStoreQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraStoreKeys.detail(params.id), - queryFn: () => getClient().platformInfraStore.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInfraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchPlatformInfraStoreQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformInfraStoreQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInfraStore.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInfraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchPlatformInfraStoreQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInfraStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraStoreSelect>; -}): Promise; -export async function prefetchPlatformInfraStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInfraStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } +): Promise; +export async function prefetchPlatformInfraStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraStoreKeys.detail(params.id), - queryFn: () => getClient().platformInfraStore.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInfraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraStoresQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraStoresQuery.ts index 9f0b76f788..8b7fb24bcf 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraStoresQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformInfraStoresQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraStoresQueryKey = platformInfraStoreKeys.list; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraStoresQuery({ @@ -30,33 +45,58 @@ export const platformInfraStoresQueryKey = platformInfraStoreKeys.list; * }); * ``` */ -export function usePlatformInfraStoresQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraStoreSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraStoresQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraStoresQuery< + S extends PlatformInfraStoreSelect, + TData = { + platformInfraStores: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraStores: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraStoresQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraStoreKeys.list(args), queryFn: () => getClient().platformInfraStore.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchPlatformInfraStoresQuery({ @@ -70,35 +110,62 @@ export function usePlatformInfraStoresQuery(params: { export async function fetchPlatformInfraStoresQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformInfraStoreSelect>; }): Promise<{ platformInfraStores: ConnectionResult>; }>; export async function fetchPlatformInfraStoresQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >(params.selection); return getClient().platformInfraStore.findMany(args).unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchPlatformInfraStoresQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraStoresQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraStoreSelect>; -}): Promise; -export async function prefetchPlatformInfraStoresQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraStoresQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraStoreSelect>; + } +): Promise; +export async function prefetchPlatformInfraStoresQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraStoreKeys.list(args), - queryFn: () => getClient().platformInfraStore.findMany(args).unwrap() + queryFn: () => getClient().platformInfraStore.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceEventQuery.ts index ce016b7930..7801c80b9e 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceEventQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceEventQuery.ts @@ -4,20 +4,26 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformNamespaceEventQueryKey = platformNamespaceEventKeys.detail; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { data, isLoading } = usePlatformNamespaceEventQuery({ @@ -26,38 +32,52 @@ export const platformNamespaceEventQueryKey = platformNamespaceEventKeys.detail; * }); * ``` */ -export function usePlatformNamespaceEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformNamespaceEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformNamespaceEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformNamespaceEventQuery< + S extends PlatformNamespaceEventSelect, + TData = { + platformNamespaceEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseQueryOptions< + { + platformNamespaceEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformNamespaceEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformNamespaceEventKeys.detail(params.id), - queryFn: () => getClient().platformNamespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformNamespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * const data = await fetchPlatformNamespaceEventQuery({ @@ -66,7 +86,9 @@ export function usePlatformNamespaceEventQuery(params: { * }); * ``` */ -export async function fetchPlatformNamespaceEventQuery(params: { +export async function fetchPlatformNamespaceEventQuery< + S extends PlatformNamespaceEventSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPlatformNamespaceEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformNamespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformNamespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * await prefetchPlatformNamespaceEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformNamespaceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformNamespaceEventSelect>; -}): Promise; -export async function prefetchPlatformNamespaceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformNamespaceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } +): Promise; +export async function prefetchPlatformNamespaceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformNamespaceEventKeys.detail(params.id), - queryFn: () => getClient().platformNamespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformNamespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceEventsQuery.ts index de7b7a36af..1d906fbe67 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceEventsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformNamespaceEventsQueryKey = platformNamespaceEventKeys.list; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { data, isLoading } = usePlatformNamespaceEventsQuery({ @@ -30,33 +45,60 @@ export const platformNamespaceEventsQueryKey = platformNamespaceEventKeys.list; * }); * ``` */ -export function usePlatformNamespaceEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformNamespaceEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformNamespaceEventsQuery< + S extends PlatformNamespaceEventSelect, + TData = { + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseQueryOptions< + { + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformNamespaceEventsQuery( + params: { + selection: ListSelectionConfig< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformNamespaceEventKeys.list(args), queryFn: () => getClient().platformNamespaceEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * const data = await fetchPlatformNamespaceEventsQuery({ @@ -67,38 +109,72 @@ export function usePlatformNamespaceEventsQuery(params: { * }); * ``` */ -export async function fetchPlatformNamespaceEventsQuery(params: { +export async function fetchPlatformNamespaceEventsQuery< + S extends PlatformNamespaceEventSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformNamespaceEventSelect>; }): Promise<{ - platformNamespaceEvents: ConnectionResult>; + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformNamespaceEventsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >(params.selection); return getClient().platformNamespaceEvent.findMany(args).unwrap(); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * await prefetchPlatformNamespaceEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformNamespaceEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceEventSelect>; -}): Promise; -export async function prefetchPlatformNamespaceEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformNamespaceEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformNamespaceEventSelect>; + } +): Promise; +export async function prefetchPlatformNamespaceEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformNamespaceEventKeys.list(args), - queryFn: () => getClient().platformNamespaceEvent.findMany(args).unwrap() + queryFn: () => getClient().platformNamespaceEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceQuery.ts index f86d3cd316..962f42695f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespaceQuery.ts @@ -4,20 +4,26 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformNamespaceQueryKey = platformNamespaceKeys.detail; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { data, isLoading } = usePlatformNamespaceQuery({ @@ -26,38 +32,52 @@ export const platformNamespaceQueryKey = platformNamespaceKeys.detail; * }); * ``` */ -export function usePlatformNamespaceQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformNamespaceSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformNamespaceQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformNamespaceQuery< + S extends PlatformNamespaceSelect, + TData = { + platformNamespace: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseQueryOptions< + { + platformNamespace: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformNamespaceQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformNamespaceKeys.detail(params.id), - queryFn: () => getClient().platformNamespace.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformNamespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * const data = await fetchPlatformNamespaceQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformNamespaceQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformNamespace.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformNamespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * await prefetchPlatformNamespaceQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformNamespaceQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformNamespaceSelect>; -}): Promise; -export async function prefetchPlatformNamespaceQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformNamespaceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformNamespaceSelect>; + } +): Promise; +export async function prefetchPlatformNamespaceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformNamespaceKeys.detail(params.id), - queryFn: () => getClient().platformNamespace.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformNamespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespacesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespacesQuery.ts index d3c468650c..08c0cd485b 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespacesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformNamespacesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, PlatformNamespaceFilter, PlatformNamespaceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, PlatformNamespaceFilter, PlatformNamespaceOrderBy } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformNamespacesQueryKey = platformNamespaceKeys.list; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { data, isLoading } = usePlatformNamespacesQuery({ @@ -30,33 +45,53 @@ export const platformNamespacesQueryKey = platformNamespaceKeys.list; * }); * ``` */ -export function usePlatformNamespacesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformNamespacesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformNamespacesQuery< + S extends PlatformNamespaceSelect, + TData = { + platformNamespaces: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseQueryOptions< + { + platformNamespaces: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformNamespacesQuery( + params: { + selection: ListSelectionConfig< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformNamespaceKeys.list(args), queryFn: () => getClient().platformNamespace.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * const data = await fetchPlatformNamespacesQuery({ @@ -70,35 +105,59 @@ export function usePlatformNamespacesQuery(params: { export async function fetchPlatformNamespacesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformNamespaceSelect>; }): Promise<{ platformNamespaces: ConnectionResult>; }>; export async function fetchPlatformNamespacesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >(params.selection); return getClient().platformNamespace.findMany(args).unwrap(); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * await prefetchPlatformNamespacesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformNamespacesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceSelect>; -}): Promise; -export async function prefetchPlatformNamespacesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformNamespacesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformNamespaceSelect>; + } +): Promise; +export async function prefetchPlatformNamespacesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformNamespaceKeys.list(args), - queryFn: () => getClient().platformNamespace.findMany(args).unwrap() + queryFn: () => getClient().platformNamespace.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDeclaredCapacitiesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDeclaredCapacitiesQuery.ts index 1493b33299..48df11dd9f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDeclaredCapacitiesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDeclaredCapacitiesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceDeclaredCapacityKeys } from "../query-keys"; -import type { PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityWithRelations, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityWithRelations, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy } from "../../orm/input-types"; +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 { platformResourceDeclaredCapacityKeys } from '../query-keys'; +import type { + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityWithRelations, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityWithRelations, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceDeclaredCapacitiesQueryKey = platformResourceDeclaredCapacityKeys.list; /** * Query hook for fetching PlatformResourceDeclaredCapacity list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceDeclaredCapacitiesQuery({ @@ -30,33 +45,64 @@ export const platformResourceDeclaredCapacitiesQueryKey = platformResourceDeclar * }); * ``` */ -export function usePlatformResourceDeclaredCapacitiesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceDeclaredCapacitySelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceDeclaredCapacitiesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourceDeclaredCapacitiesQuery< + S extends PlatformResourceDeclaredCapacitySelect, + TData = { + platformResourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourceDeclaredCapacitySelect>; + } & Omit< + UseQueryOptions< + { + platformResourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceDeclaredCapacitiesQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceDeclaredCapacityKeys.list(args), queryFn: () => getClient().platformResourceDeclaredCapacity.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformResourceDeclaredCapacity list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformResourceDeclaredCapacitiesQuery({ @@ -67,38 +113,82 @@ export function usePlatformResourceDeclaredCapacitiesQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceDeclaredCapacitiesQuery(params: { +export async function fetchPlatformResourceDeclaredCapacitiesQuery< + S extends PlatformResourceDeclaredCapacitySelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceDeclaredCapacitySelect>; + } & Omit< + ListSelectionConfig< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourceDeclaredCapacitySelect>; }): Promise<{ - platformResourceDeclaredCapacities: ConnectionResult>; + platformResourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourceDeclaredCapacitiesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >(params.selection); return getClient().platformResourceDeclaredCapacity.findMany(args).unwrap(); } /** * Prefetch PlatformResourceDeclaredCapacity list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformResourceDeclaredCapacitiesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourceDeclaredCapacitiesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceDeclaredCapacitySelect>; -}): Promise; -export async function prefetchPlatformResourceDeclaredCapacitiesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourceDeclaredCapacitiesQuery< + S extends PlatformResourceDeclaredCapacitySelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourceDeclaredCapacitySelect>; + } +): Promise; +export async function prefetchPlatformResourceDeclaredCapacitiesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceDeclaredCapacityKeys.list(args), - queryFn: () => getClient().platformResourceDeclaredCapacity.findMany(args).unwrap() + queryFn: () => getClient().platformResourceDeclaredCapacity.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDefinitionQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDefinitionQuery.ts index 92881437b0..4d4cbe9591 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDefinitionQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDefinitionQuery.ts @@ -4,20 +4,26 @@ * 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 { platformResourceDefinitionKeys } from "../query-keys"; -import type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations } from "../../orm/input-types"; +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 { platformResourceDefinitionKeys } from '../query-keys'; +import type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceDefinitionQueryKey = platformResourceDefinitionKeys.detail; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceDefinitionQuery({ @@ -26,38 +32,58 @@ export const platformResourceDefinitionQueryKey = platformResourceDefinitionKeys * }); * ``` */ -export function usePlatformResourceDefinitionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceDefinitionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceDefinitionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformResourceDefinitionQuery< + S extends PlatformResourceDefinitionSelect, + TData = { + platformResourceDefinition: InferSelectResult< + PlatformResourceDefinitionWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceDefinition: InferSelectResult< + PlatformResourceDefinitionWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceDefinitionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceDefinitionKeys.detail(params.id), - queryFn: () => getClient().platformResourceDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformResourceDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```ts * const data = await fetchPlatformResourceDefinitionQuery({ @@ -66,7 +92,9 @@ export function usePlatformResourceDefinitionQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceDefinitionQuery(params: { +export async function fetchPlatformResourceDefinitionQuery< + S extends PlatformResourceDefinitionSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +107,48 @@ export async function fetchPlatformResourceDefinitionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformResourceDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformResourceDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```ts * await prefetchPlatformResourceDefinitionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformResourceDefinitionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceDefinitionSelect>; -}): Promise; -export async function prefetchPlatformResourceDefinitionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformResourceDefinitionQuery< + S extends PlatformResourceDefinitionSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceDefinitionSelect>; + } +): Promise; +export async function prefetchPlatformResourceDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceDefinitionKeys.detail(params.id), - queryFn: () => getClient().platformResourceDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformResourceDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDefinitionsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDefinitionsQuery.ts index ad36215a5f..89da0841ba 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDefinitionsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceDefinitionsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceDefinitionKeys } from "../query-keys"; -import type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations, PlatformResourceDefinitionFilter, PlatformResourceDefinitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceDefinitionSelect, PlatformResourceDefinitionWithRelations, PlatformResourceDefinitionFilter, PlatformResourceDefinitionOrderBy } from "../../orm/input-types"; +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 { platformResourceDefinitionKeys } from '../query-keys'; +import type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionWithRelations, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceDefinitionsQueryKey = platformResourceDefinitionKeys.list; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceDefinitionsQuery({ @@ -30,33 +45,60 @@ export const platformResourceDefinitionsQueryKey = platformResourceDefinitionKey * }); * ``` */ -export function usePlatformResourceDefinitionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceDefinitionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceDefinitionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourceDefinitionsQuery< + S extends PlatformResourceDefinitionSelect, + TData = { + platformResourceDefinitions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceDefinitions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceDefinitionsQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceDefinitionKeys.list(args), queryFn: () => getClient().platformResourceDefinition.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```ts * const data = await fetchPlatformResourceDefinitionsQuery({ @@ -67,38 +109,74 @@ export function usePlatformResourceDefinitionsQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceDefinitionsQuery(params: { +export async function fetchPlatformResourceDefinitionsQuery< + S extends PlatformResourceDefinitionSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceDefinitionSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceDefinitionSelect>; }): Promise<{ - platformResourceDefinitions: ConnectionResult>; + platformResourceDefinitions: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourceDefinitionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy + >(params.selection); return getClient().platformResourceDefinition.findMany(args).unwrap(); } /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```ts * await prefetchPlatformResourceDefinitionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourceDefinitionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceDefinitionSelect>; -}): Promise; -export async function prefetchPlatformResourceDefinitionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourceDefinitionsQuery< + S extends PlatformResourceDefinitionSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceDefinitionSelect>; + } +): Promise; +export async function prefetchPlatformResourceDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceDefinitionKeys.list(args), - queryFn: () => getClient().platformResourceDefinition.findMany(args).unwrap() + queryFn: () => getClient().platformResourceDefinition.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceEventQuery.ts index 0c4e8daf21..b867d9effa 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceEventQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceEventQuery.ts @@ -4,20 +4,26 @@ * 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 { platformResourceEventKeys } from "../query-keys"; -import type { PlatformResourceEventSelect, PlatformResourceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceEventSelect, PlatformResourceEventWithRelations } from "../../orm/input-types"; +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 { platformResourceEventKeys } from '../query-keys'; +import type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceEventQueryKey = platformResourceEventKeys.detail; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceEventQuery({ @@ -26,38 +32,52 @@ export const platformResourceEventQueryKey = platformResourceEventKeys.detail; * }); * ``` */ -export function usePlatformResourceEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformResourceEventQuery< + S extends PlatformResourceEventSelect, + TData = { + platformResourceEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceEventSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceEventKeys.detail(params.id), - queryFn: () => getClient().platformResourceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformResourceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```ts * const data = await fetchPlatformResourceEventQuery({ @@ -66,7 +86,9 @@ export function usePlatformResourceEventQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceEventQuery(params: { +export async function fetchPlatformResourceEventQuery< + S extends PlatformResourceEventSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPlatformResourceEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformResourceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformResourceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```ts * await prefetchPlatformResourceEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformResourceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceEventSelect>; -}): Promise; -export async function prefetchPlatformResourceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformResourceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceEventSelect>; + } +): Promise; +export async function prefetchPlatformResourceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceEventKeys.detail(params.id), - queryFn: () => getClient().platformResourceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformResourceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceEventsQuery.ts index cd2775fe51..33c9cf6caf 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceEventsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceEventKeys } from "../query-keys"; -import type { PlatformResourceEventSelect, PlatformResourceEventWithRelations, PlatformResourceEventFilter, PlatformResourceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceEventSelect, PlatformResourceEventWithRelations, PlatformResourceEventFilter, PlatformResourceEventOrderBy } from "../../orm/input-types"; +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 { platformResourceEventKeys } from '../query-keys'; +import type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceEventSelect, + PlatformResourceEventWithRelations, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceEventsQueryKey = platformResourceEventKeys.list; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceEventsQuery({ @@ -30,33 +45,60 @@ export const platformResourceEventsQueryKey = platformResourceEventKeys.list; * }); * ``` */ -export function usePlatformResourceEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourceEventsQuery< + S extends PlatformResourceEventSelect, + TData = { + platformResourceEvents: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceEventSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceEvents: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceEventsQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceEventKeys.list(args), queryFn: () => getClient().platformResourceEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```ts * const data = await fetchPlatformResourceEventsQuery({ @@ -67,38 +109,72 @@ export function usePlatformResourceEventsQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceEventsQuery(params: { +export async function fetchPlatformResourceEventsQuery< + S extends PlatformResourceEventSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceEventSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceEventSelect>; }): Promise<{ - platformResourceEvents: ConnectionResult>; + platformResourceEvents: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourceEventsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy + >(params.selection); return getClient().platformResourceEvent.findMany(args).unwrap(); } /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```ts * await prefetchPlatformResourceEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourceEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceEventSelect>; -}): Promise; -export async function prefetchPlatformResourceEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourceEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceEventSelect>; + } +): Promise; +export async function prefetchPlatformResourceEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceEventKeys.list(args), - queryFn: () => getClient().platformResourceEvent.findMany(args).unwrap() + queryFn: () => getClient().platformResourceEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceInstallationQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceInstallationQuery.ts index a7b6f17bd7..236e9f29bc 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceInstallationQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceInstallationQuery.ts @@ -4,20 +4,26 @@ * 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 { platformResourceInstallationKeys } from "../query-keys"; -import type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations } from "../../orm/input-types"; +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 { platformResourceInstallationKeys } from '../query-keys'; +import type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceInstallationQueryKey = platformResourceInstallationKeys.detail; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceInstallationQuery({ @@ -26,38 +32,58 @@ export const platformResourceInstallationQueryKey = platformResourceInstallation * }); * ``` */ -export function usePlatformResourceInstallationQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceInstallationSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceInstallationQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformResourceInstallationQuery< + S extends PlatformResourceInstallationSelect, + TData = { + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceInstallationSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceInstallationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceInstallationKeys.detail(params.id), - queryFn: () => getClient().platformResourceInstallation.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformResourceInstallation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```ts * const data = await fetchPlatformResourceInstallationQuery({ @@ -66,48 +92,66 @@ export function usePlatformResourceInstallationQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceInstallationQuery(params: { +export async function fetchPlatformResourceInstallationQuery< + S extends PlatformResourceInstallationSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, PlatformResourceInstallationSelect>; }): Promise<{ - platformResourceInstallation: InferSelectResult | null; + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; }>; export async function fetchPlatformResourceInstallationQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformResourceInstallation.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformResourceInstallation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```ts * await prefetchPlatformResourceInstallationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformResourceInstallationQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceInstallationSelect>; -}): Promise; -export async function prefetchPlatformResourceInstallationQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformResourceInstallationQuery< + S extends PlatformResourceInstallationSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceInstallationSelect>; + } +): Promise; +export async function prefetchPlatformResourceInstallationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceInstallationKeys.detail(params.id), - queryFn: () => getClient().platformResourceInstallation.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformResourceInstallation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceInstallationsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceInstallationsQuery.ts index 90bd16fb89..b1d937172d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceInstallationsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceInstallationsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceInstallationKeys } from "../query-keys"; -import type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations, PlatformResourceInstallationFilter, PlatformResourceInstallationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceInstallationSelect, PlatformResourceInstallationWithRelations, PlatformResourceInstallationFilter, PlatformResourceInstallationOrderBy } from "../../orm/input-types"; +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 { platformResourceInstallationKeys } from '../query-keys'; +import type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceInstallationSelect, + PlatformResourceInstallationWithRelations, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceInstallationsQueryKey = platformResourceInstallationKeys.list; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceInstallationsQuery({ @@ -30,33 +45,64 @@ export const platformResourceInstallationsQueryKey = platformResourceInstallatio * }); * ``` */ -export function usePlatformResourceInstallationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceInstallationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceInstallationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourceInstallationsQuery< + S extends PlatformResourceInstallationSelect, + TData = { + platformResourceInstallations: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourceInstallationSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceInstallations: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceInstallationsQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceInstallationKeys.list(args), queryFn: () => getClient().platformResourceInstallation.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```ts * const data = await fetchPlatformResourceInstallationsQuery({ @@ -67,38 +113,78 @@ export function usePlatformResourceInstallationsQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceInstallationsQuery(params: { +export async function fetchPlatformResourceInstallationsQuery< + S extends PlatformResourceInstallationSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceInstallationSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceInstallationSelect>; }): Promise<{ - platformResourceInstallations: ConnectionResult>; + platformResourceInstallations: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourceInstallationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + >(params.selection); return getClient().platformResourceInstallation.findMany(args).unwrap(); } /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```ts * await prefetchPlatformResourceInstallationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourceInstallationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceInstallationSelect>; -}): Promise; -export async function prefetchPlatformResourceInstallationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourceInstallationsQuery< + S extends PlatformResourceInstallationSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourceInstallationSelect>; + } +): Promise; +export async function prefetchPlatformResourceInstallationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceInstallationKeys.list(args), - queryFn: () => getClient().platformResourceInstallation.findMany(args).unwrap() + queryFn: () => getClient().platformResourceInstallation.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceQuery.ts index ecd09560bc..c3607f712d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceQuery.ts @@ -4,20 +4,20 @@ * 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 { platformResourceKeys } from "../query-keys"; -import type { PlatformResourceSelect, PlatformResourceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceSelect, PlatformResourceWithRelations } from "../../orm/input-types"; +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 { platformResourceKeys } from '../query-keys'; +import type { PlatformResourceSelect, PlatformResourceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformResourceSelect, PlatformResourceWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceQueryKey = platformResourceKeys.detail; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceQuery({ @@ -26,38 +26,52 @@ export const platformResourceQueryKey = platformResourceKeys.detail; * }); * ``` */ -export function usePlatformResourceQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformResourceQuery< + S extends PlatformResourceSelect, + TData = { + platformResource: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceSelect>; + } & Omit< + UseQueryOptions< + { + platformResource: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceKeys.detail(params.id), - queryFn: () => getClient().platformResource.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformResource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```ts * const data = await fetchPlatformResourceQuery({ @@ -79,35 +93,46 @@ export async function fetchPlatformResourceQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformResource.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformResource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```ts * await prefetchPlatformResourceQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformResourceQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceSelect>; -}): Promise; -export async function prefetchPlatformResourceQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformResourceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceSelect>; + } +): Promise; +export async function prefetchPlatformResourceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceKeys.detail(params.id), - queryFn: () => getClient().platformResource.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformResource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceStatusCheckQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceStatusCheckQuery.ts index 95bdac15c8..74b9b5eb2f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceStatusCheckQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceStatusCheckQuery.ts @@ -4,20 +4,26 @@ * 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 { platformResourceStatusCheckKeys } from "../query-keys"; -import type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations } from "../../orm/input-types"; +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 { platformResourceStatusCheckKeys } from '../query-keys'; +import type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceStatusCheckQueryKey = platformResourceStatusCheckKeys.detail; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceStatusCheckQuery({ @@ -26,38 +32,58 @@ export const platformResourceStatusCheckQueryKey = platformResourceStatusCheckKe * }); * ``` */ -export function usePlatformResourceStatusCheckQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceStatusCheckSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceStatusCheckQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformResourceStatusCheckQuery< + S extends PlatformResourceStatusCheckSelect, + TData = { + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceStatusCheckSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceStatusCheckQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceStatusCheckKeys.detail(params.id), - queryFn: () => getClient().platformResourceStatusCheck.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformResourceStatusCheck.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```ts * const data = await fetchPlatformResourceStatusCheckQuery({ @@ -66,48 +92,66 @@ export function usePlatformResourceStatusCheckQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceStatusCheckQuery(params: { +export async function fetchPlatformResourceStatusCheckQuery< + S extends PlatformResourceStatusCheckSelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, PlatformResourceStatusCheckSelect>; }): Promise<{ - platformResourceStatusCheck: InferSelectResult | null; + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; }>; export async function fetchPlatformResourceStatusCheckQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformResourceStatusCheck.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformResourceStatusCheck.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```ts * await prefetchPlatformResourceStatusCheckQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformResourceStatusCheckQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceStatusCheckSelect>; -}): Promise; -export async function prefetchPlatformResourceStatusCheckQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformResourceStatusCheckQuery< + S extends PlatformResourceStatusCheckSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceStatusCheckSelect>; + } +): Promise; +export async function prefetchPlatformResourceStatusCheckQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceStatusCheckKeys.detail(params.id), - queryFn: () => getClient().platformResourceStatusCheck.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformResourceStatusCheck.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceStatusChecksQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceStatusChecksQuery.ts index 9a456e46e3..b644563c0d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceStatusChecksQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceStatusChecksQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceStatusCheckKeys } from "../query-keys"; -import type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations, PlatformResourceStatusCheckFilter, PlatformResourceStatusCheckOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckWithRelations, PlatformResourceStatusCheckFilter, PlatformResourceStatusCheckOrderBy } from "../../orm/input-types"; +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 { platformResourceStatusCheckKeys } from '../query-keys'; +import type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckWithRelations, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceStatusChecksQueryKey = platformResourceStatusCheckKeys.list; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceStatusChecksQuery({ @@ -30,33 +45,60 @@ export const platformResourceStatusChecksQueryKey = platformResourceStatusCheckK * }); * ``` */ -export function usePlatformResourceStatusChecksQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceStatusCheckSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceStatusChecksQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourceStatusChecksQuery< + S extends PlatformResourceStatusCheckSelect, + TData = { + platformResourceStatusChecks: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceStatusCheckSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceStatusChecks: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceStatusChecksQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceStatusCheckKeys.list(args), queryFn: () => getClient().platformResourceStatusCheck.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```ts * const data = await fetchPlatformResourceStatusChecksQuery({ @@ -67,38 +109,74 @@ export function usePlatformResourceStatusChecksQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceStatusChecksQuery(params: { +export async function fetchPlatformResourceStatusChecksQuery< + S extends PlatformResourceStatusCheckSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceStatusCheckSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceStatusCheckSelect>; }): Promise<{ - platformResourceStatusChecks: ConnectionResult>; + platformResourceStatusChecks: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourceStatusChecksQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + >(params.selection); return getClient().platformResourceStatusCheck.findMany(args).unwrap(); } /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```ts * await prefetchPlatformResourceStatusChecksQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourceStatusChecksQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceStatusCheckSelect>; -}): Promise; -export async function prefetchPlatformResourceStatusChecksQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourceStatusChecksQuery< + S extends PlatformResourceStatusCheckSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceStatusCheckSelect>; + } +): Promise; +export async function prefetchPlatformResourceStatusChecksQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceStatusCheckKeys.list(args), - queryFn: () => getClient().platformResourceStatusCheck.findMany(args).unwrap() + queryFn: () => getClient().platformResourceStatusCheck.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageLogQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageLogQuery.ts index 5051e33d3b..9676a774f1 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageLogQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageLogQuery.ts @@ -4,20 +4,26 @@ * 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 { platformResourceUsageLogKeys } from "../query-keys"; -import type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations } from "../../orm/input-types"; +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 { platformResourceUsageLogKeys } from '../query-keys'; +import type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceUsageLogQueryKey = platformResourceUsageLogKeys.detail; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceUsageLogQuery({ @@ -26,38 +32,55 @@ export const platformResourceUsageLogQueryKey = platformResourceUsageLogKeys.det * }); * ``` */ -export function usePlatformResourceUsageLogQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceUsageLogSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceUsageLogQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformResourceUsageLogQuery< + S extends PlatformResourceUsageLogSelect, + TData = { + platformResourceUsageLog: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceUsageLogSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceUsageLog: InferSelectResult< + PlatformResourceUsageLogWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceUsageLogQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceUsageLogKeys.detail(params.id), - queryFn: () => getClient().platformResourceUsageLog.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformResourceUsageLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```ts * const data = await fetchPlatformResourceUsageLogQuery({ @@ -66,7 +89,9 @@ export function usePlatformResourceUsageLogQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceUsageLogQuery(params: { +export async function fetchPlatformResourceUsageLogQuery< + S extends PlatformResourceUsageLogSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +104,48 @@ export async function fetchPlatformResourceUsageLogQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformResourceUsageLog.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformResourceUsageLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```ts * await prefetchPlatformResourceUsageLogQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformResourceUsageLogQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceUsageLogSelect>; -}): Promise; -export async function prefetchPlatformResourceUsageLogQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformResourceUsageLogQuery< + S extends PlatformResourceUsageLogSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceUsageLogSelect>; + } +): Promise; +export async function prefetchPlatformResourceUsageLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceUsageLogKeys.detail(params.id), - queryFn: () => getClient().platformResourceUsageLog.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformResourceUsageLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageLogsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageLogsQuery.ts index cfaafe8b7f..0bf8ad7131 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageLogsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageLogsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceUsageLogKeys } from "../query-keys"; -import type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations, PlatformResourceUsageLogFilter, PlatformResourceUsageLogOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageLogSelect, PlatformResourceUsageLogWithRelations, PlatformResourceUsageLogFilter, PlatformResourceUsageLogOrderBy } from "../../orm/input-types"; +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 { platformResourceUsageLogKeys } from '../query-keys'; +import type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogWithRelations, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceUsageLogsQueryKey = platformResourceUsageLogKeys.list; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceUsageLogsQuery({ @@ -30,33 +45,60 @@ export const platformResourceUsageLogsQueryKey = platformResourceUsageLogKeys.li * }); * ``` */ -export function usePlatformResourceUsageLogsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUsageLogSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceUsageLogsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourceUsageLogsQuery< + S extends PlatformResourceUsageLogSelect, + TData = { + platformResourceUsageLogs: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceUsageLogSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceUsageLogs: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceUsageLogsQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceUsageLogKeys.list(args), queryFn: () => getClient().platformResourceUsageLog.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```ts * const data = await fetchPlatformResourceUsageLogsQuery({ @@ -67,38 +109,74 @@ export function usePlatformResourceUsageLogsQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceUsageLogsQuery(params: { +export async function fetchPlatformResourceUsageLogsQuery< + S extends PlatformResourceUsageLogSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUsageLogSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceUsageLogSelect>; }): Promise<{ - platformResourceUsageLogs: ConnectionResult>; + platformResourceUsageLogs: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourceUsageLogsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy + >(params.selection); return getClient().platformResourceUsageLog.findMany(args).unwrap(); } /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```ts * await prefetchPlatformResourceUsageLogsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourceUsageLogsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUsageLogSelect>; -}): Promise; -export async function prefetchPlatformResourceUsageLogsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourceUsageLogsQuery< + S extends PlatformResourceUsageLogSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceUsageLogSelect>; + } +): Promise; +export async function prefetchPlatformResourceUsageLogsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceUsageLogKeys.list(args), - queryFn: () => getClient().platformResourceUsageLog.findMany(args).unwrap() + queryFn: () => getClient().platformResourceUsageLog.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageSummariesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageSummariesQuery.ts index 663d253f6c..bf5980e218 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageSummariesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageSummariesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceUsageSummaryKeys } from "../query-keys"; -import type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations, PlatformResourceUsageSummaryFilter, PlatformResourceUsageSummaryOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations, PlatformResourceUsageSummaryFilter, PlatformResourceUsageSummaryOrderBy } from "../../orm/input-types"; +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 { platformResourceUsageSummaryKeys } from '../query-keys'; +import type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceUsageSummariesQueryKey = platformResourceUsageSummaryKeys.list; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceUsageSummariesQuery({ @@ -30,33 +45,64 @@ export const platformResourceUsageSummariesQueryKey = platformResourceUsageSumma * }); * ``` */ -export function usePlatformResourceUsageSummariesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUsageSummarySelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceUsageSummariesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourceUsageSummariesQuery< + S extends PlatformResourceUsageSummarySelect, + TData = { + platformResourceUsageSummaries: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourceUsageSummarySelect>; + } & Omit< + UseQueryOptions< + { + platformResourceUsageSummaries: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceUsageSummariesQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceUsageSummaryKeys.list(args), queryFn: () => getClient().platformResourceUsageSummary.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```ts * const data = await fetchPlatformResourceUsageSummariesQuery({ @@ -67,38 +113,78 @@ export function usePlatformResourceUsageSummariesQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceUsageSummariesQuery(params: { +export async function fetchPlatformResourceUsageSummariesQuery< + S extends PlatformResourceUsageSummarySelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUsageSummarySelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceUsageSummarySelect>; }): Promise<{ - platformResourceUsageSummaries: ConnectionResult>; + platformResourceUsageSummaries: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourceUsageSummariesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + >(params.selection); return getClient().platformResourceUsageSummary.findMany(args).unwrap(); } /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```ts * await prefetchPlatformResourceUsageSummariesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourceUsageSummariesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUsageSummarySelect>; -}): Promise; -export async function prefetchPlatformResourceUsageSummariesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourceUsageSummariesQuery< + S extends PlatformResourceUsageSummarySelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourceUsageSummarySelect>; + } +): Promise; +export async function prefetchPlatformResourceUsageSummariesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceUsageSummaryKeys.list(args), - queryFn: () => getClient().platformResourceUsageSummary.findMany(args).unwrap() + queryFn: () => getClient().platformResourceUsageSummary.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageSummaryQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageSummaryQuery.ts index b29338aac7..9e8e100a01 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageSummaryQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUsageSummaryQuery.ts @@ -4,20 +4,26 @@ * 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 { platformResourceUsageSummaryKeys } from "../query-keys"; -import type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryWithRelations } from "../../orm/input-types"; +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 { platformResourceUsageSummaryKeys } from '../query-keys'; +import type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceUsageSummaryQueryKey = platformResourceUsageSummaryKeys.detail; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceUsageSummaryQuery({ @@ -26,38 +32,58 @@ export const platformResourceUsageSummaryQueryKey = platformResourceUsageSummary * }); * ``` */ -export function usePlatformResourceUsageSummaryQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceUsageSummarySelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceUsageSummaryQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformResourceUsageSummaryQuery< + S extends PlatformResourceUsageSummarySelect, + TData = { + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceUsageSummarySelect>; + } & Omit< + UseQueryOptions< + { + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceUsageSummaryQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceUsageSummaryKeys.detail(params.id), - queryFn: () => getClient().platformResourceUsageSummary.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformResourceUsageSummary.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```ts * const data = await fetchPlatformResourceUsageSummaryQuery({ @@ -66,48 +92,66 @@ export function usePlatformResourceUsageSummaryQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceUsageSummaryQuery(params: { +export async function fetchPlatformResourceUsageSummaryQuery< + S extends PlatformResourceUsageSummarySelect, +>(params: { id: string; selection: { fields: S; } & HookStrictSelect, PlatformResourceUsageSummarySelect>; }): Promise<{ - platformResourceUsageSummary: InferSelectResult | null; + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; }>; export async function fetchPlatformResourceUsageSummaryQuery(params: { id: string; selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformResourceUsageSummary.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformResourceUsageSummary.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```ts * await prefetchPlatformResourceUsageSummaryQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformResourceUsageSummaryQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourceUsageSummarySelect>; -}): Promise; -export async function prefetchPlatformResourceUsageSummaryQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformResourceUsageSummaryQuery< + S extends PlatformResourceUsageSummarySelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourceUsageSummarySelect>; + } +): Promise; +export async function prefetchPlatformResourceUsageSummaryQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceUsageSummaryKeys.detail(params.id), - queryFn: () => getClient().platformResourceUsageSummary.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformResourceUsageSummary.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUtilizationsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUtilizationsQuery.ts index e19ba272cc..cf2db270f5 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUtilizationsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourceUtilizationsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceUtilizationKeys } from "../query-keys"; -import type { PlatformResourceUtilizationSelect, PlatformResourceUtilizationWithRelations, PlatformResourceUtilizationFilter, PlatformResourceUtilizationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceUtilizationSelect, PlatformResourceUtilizationWithRelations, PlatformResourceUtilizationFilter, PlatformResourceUtilizationOrderBy } from "../../orm/input-types"; +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 { platformResourceUtilizationKeys } from '../query-keys'; +import type { + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationWithRelations, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationWithRelations, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourceUtilizationsQueryKey = platformResourceUtilizationKeys.list; /** * Query hook for fetching PlatformResourceUtilization list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourceUtilizationsQuery({ @@ -30,33 +45,60 @@ export const platformResourceUtilizationsQueryKey = platformResourceUtilizationK * }); * ``` */ -export function usePlatformResourceUtilizationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUtilizationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourceUtilizationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourceUtilizationsQuery< + S extends PlatformResourceUtilizationSelect, + TData = { + platformResourceUtilizations: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceUtilizationSelect>; + } & Omit< + UseQueryOptions< + { + platformResourceUtilizations: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourceUtilizationsQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceUtilizationKeys.list(args), queryFn: () => getClient().platformResourceUtilization.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformResourceUtilization list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformResourceUtilizationsQuery({ @@ -67,38 +109,74 @@ export function usePlatformResourceUtilizationsQuery(params: { * }); * ``` */ -export async function fetchPlatformResourceUtilizationsQuery(params: { +export async function fetchPlatformResourceUtilizationsQuery< + S extends PlatformResourceUtilizationSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUtilizationSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceUtilizationSelect>; }): Promise<{ - platformResourceUtilizations: ConnectionResult>; + platformResourceUtilizations: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourceUtilizationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + >(params.selection); return getClient().platformResourceUtilization.findMany(args).unwrap(); } /** * Prefetch PlatformResourceUtilization list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformResourceUtilizationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourceUtilizationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceUtilizationSelect>; -}): Promise; -export async function prefetchPlatformResourceUtilizationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourceUtilizationsQuery< + S extends PlatformResourceUtilizationSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourceUtilizationSelect>; + } +): Promise; +export async function prefetchPlatformResourceUtilizationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceUtilizationKeys.list(args), - queryFn: () => getClient().platformResourceUtilization.findMany(args).unwrap() + queryFn: () => getClient().platformResourceUtilization.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesHealthQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesHealthQuery.ts index edc31b85cb..8b9664c71d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesHealthQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesHealthQuery.ts @@ -4,20 +4,26 @@ * 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 { platformResourcesHealthKeys } from "../query-keys"; -import type { PlatformResourcesHealthSelect, PlatformResourcesHealthWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourcesHealthSelect, PlatformResourcesHealthWithRelations } from "../../orm/input-types"; +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 { platformResourcesHealthKeys } from '../query-keys'; +import type { + PlatformResourcesHealthSelect, + PlatformResourcesHealthWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformResourcesHealthSelect, + PlatformResourcesHealthWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourcesHealthQueryKey = platformResourcesHealthKeys.detail; /** * Query hook for fetching a single PlatformResourcesHealth - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourcesHealthQuery({ @@ -26,38 +32,52 @@ export const platformResourcesHealthQueryKey = platformResourcesHealthKeys.detai * }); * ``` */ -export function usePlatformResourcesHealthQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourcesHealthSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourcesHealthQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformResourcesHealthQuery< + S extends PlatformResourcesHealthSelect, + TData = { + platformResourcesHealth: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourcesHealthSelect>; + } & Omit< + UseQueryOptions< + { + platformResourcesHealth: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourcesHealthQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourcesHealthKeys.detail(params.id), - queryFn: () => getClient().platformResourcesHealth.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformResourcesHealth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single PlatformResourcesHealth without React hooks - * + * * @example * ```ts * const data = await fetchPlatformResourcesHealthQuery({ @@ -66,7 +86,9 @@ export function usePlatformResourcesHealthQuery(params: { * }); * ``` */ -export async function fetchPlatformResourcesHealthQuery(params: { +export async function fetchPlatformResourcesHealthQuery< + S extends PlatformResourcesHealthSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPlatformResourcesHealthQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformResourcesHealth.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformResourcesHealth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single PlatformResourcesHealth for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformResourcesHealthQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformResourcesHealthQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformResourcesHealthSelect>; -}): Promise; -export async function prefetchPlatformResourcesHealthQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformResourcesHealthQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformResourcesHealthSelect>; + } +): Promise; +export async function prefetchPlatformResourcesHealthQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourcesHealthKeys.detail(params.id), - queryFn: () => getClient().platformResourcesHealth.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformResourcesHealth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesHealthsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesHealthsQuery.ts index 31c825e375..d023bcb05a 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesHealthsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesHealthsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourcesHealthKeys } from "../query-keys"; -import type { PlatformResourcesHealthSelect, PlatformResourcesHealthWithRelations, PlatformResourcesHealthFilter, PlatformResourcesHealthOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourcesHealthSelect, PlatformResourcesHealthWithRelations, PlatformResourcesHealthFilter, PlatformResourcesHealthOrderBy } from "../../orm/input-types"; +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 { platformResourcesHealthKeys } from '../query-keys'; +import type { + PlatformResourcesHealthSelect, + PlatformResourcesHealthWithRelations, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourcesHealthSelect, + PlatformResourcesHealthWithRelations, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourcesHealthsQueryKey = platformResourcesHealthKeys.list; /** * Query hook for fetching PlatformResourcesHealth list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourcesHealthsQuery({ @@ -30,33 +45,60 @@ export const platformResourcesHealthsQueryKey = platformResourcesHealthKeys.list * }); * ``` */ -export function usePlatformResourcesHealthsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesHealthSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourcesHealthsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourcesHealthsQuery< + S extends PlatformResourcesHealthSelect, + TData = { + platformResourcesHealths: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourcesHealthSelect>; + } & Omit< + UseQueryOptions< + { + platformResourcesHealths: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourcesHealthsQuery( + params: { + selection: ListSelectionConfig< + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourcesHealthKeys.list(args), queryFn: () => getClient().platformResourcesHealth.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformResourcesHealth list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformResourcesHealthsQuery({ @@ -67,38 +109,74 @@ export function usePlatformResourcesHealthsQuery(params: { * }); * ``` */ -export async function fetchPlatformResourcesHealthsQuery(params: { +export async function fetchPlatformResourcesHealthsQuery< + S extends PlatformResourcesHealthSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesHealthSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourcesHealthSelect>; }): Promise<{ - platformResourcesHealths: ConnectionResult>; + platformResourcesHealths: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourcesHealthsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy + >(params.selection); return getClient().platformResourcesHealth.findMany(args).unwrap(); } /** * Prefetch PlatformResourcesHealth list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformResourcesHealthsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourcesHealthsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesHealthSelect>; -}): Promise; -export async function prefetchPlatformResourcesHealthsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourcesHealthsQuery< + S extends PlatformResourcesHealthSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformResourcesHealthSelect>; + } +): Promise; +export async function prefetchPlatformResourcesHealthsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourcesHealthKeys.list(args), - queryFn: () => getClient().platformResourcesHealth.findMany(args).unwrap() + queryFn: () => getClient().platformResourcesHealth.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesQuery.ts index b8b7e69132..9349284dd9 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformResourceKeys } from "../query-keys"; -import type { PlatformResourceSelect, PlatformResourceWithRelations, PlatformResourceFilter, PlatformResourceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourceSelect, PlatformResourceWithRelations, PlatformResourceFilter, PlatformResourceOrderBy } from "../../orm/input-types"; +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 { platformResourceKeys } from '../query-keys'; +import type { + PlatformResourceSelect, + PlatformResourceWithRelations, + PlatformResourceFilter, + PlatformResourceOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourceSelect, + PlatformResourceWithRelations, + PlatformResourceFilter, + PlatformResourceOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformResourcesQueryKey = platformResourceKeys.list; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourcesQuery({ @@ -30,33 +45,53 @@ export const platformResourcesQueryKey = platformResourceKeys.list; * }); * ``` */ -export function usePlatformResourcesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourcesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourcesQuery< + S extends PlatformResourceSelect, + TData = { + platformResources: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformResourceSelect>; + } & Omit< + UseQueryOptions< + { + platformResources: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourcesQuery( + params: { + selection: ListSelectionConfig< + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourceKeys.list(args), queryFn: () => getClient().platformResource.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```ts * const data = await fetchPlatformResourcesQuery({ @@ -70,35 +105,59 @@ export function usePlatformResourcesQuery(params: { export async function fetchPlatformResourcesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformResourceSelect>; }): Promise<{ platformResources: ConnectionResult>; }>; export async function fetchPlatformResourcesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy + >(params.selection); return getClient().platformResource.findMany(args).unwrap(); } /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```ts * await prefetchPlatformResourcesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourcesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourceSelect>; -}): Promise; -export async function prefetchPlatformResourcesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourcesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformResourceSelect>; + } +): Promise; +export async function prefetchPlatformResourcesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourceKeys.list(args), - queryFn: () => getClient().platformResource.findMany(args).unwrap() + queryFn: () => getClient().platformResource.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesRequirementsStatesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesRequirementsStatesQuery.ts index d91bac19ea..9aa8b9f34b 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesRequirementsStatesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesRequirementsStatesQuery.ts @@ -4,20 +4,36 @@ * 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 { platformResourcesRequirementsStateKeys } from "../query-keys"; -import type { PlatformResourcesRequirementsStateSelect, PlatformResourcesRequirementsStateWithRelations, PlatformResourcesRequirementsStateFilter, PlatformResourcesRequirementsStateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourcesRequirementsStateSelect, PlatformResourcesRequirementsStateWithRelations, PlatformResourcesRequirementsStateFilter, PlatformResourcesRequirementsStateOrderBy } from "../../orm/input-types"; +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 { platformResourcesRequirementsStateKeys } from '../query-keys'; +import type { + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateWithRelations, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateWithRelations, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ -export const platformResourcesRequirementsStatesQueryKey = platformResourcesRequirementsStateKeys.list; +export const platformResourcesRequirementsStatesQueryKey = + platformResourcesRequirementsStateKeys.list; /** * Query hook for fetching PlatformResourcesRequirementsState list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourcesRequirementsStatesQuery({ @@ -30,33 +46,64 @@ export const platformResourcesRequirementsStatesQueryKey = platformResourcesRequ * }); * ``` */ -export function usePlatformResourcesRequirementsStatesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesRequirementsStateSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourcesRequirementsStatesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourcesRequirementsStatesQuery< + S extends PlatformResourcesRequirementsStateSelect, + TData = { + platformResourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourcesRequirementsStateSelect>; + } & Omit< + UseQueryOptions< + { + platformResourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourcesRequirementsStatesQuery( + params: { + selection: ListSelectionConfig< + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourcesRequirementsStateKeys.list(args), queryFn: () => getClient().platformResourcesRequirementsState.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformResourcesRequirementsState list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformResourcesRequirementsStatesQuery({ @@ -67,38 +114,82 @@ export function usePlatformResourcesRequirementsStatesQuery(params: { * }); * ``` */ -export async function fetchPlatformResourcesRequirementsStatesQuery(params: { +export async function fetchPlatformResourcesRequirementsStatesQuery< + S extends PlatformResourcesRequirementsStateSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesRequirementsStateSelect>; + } & Omit< + ListSelectionConfig< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourcesRequirementsStateSelect>; }): Promise<{ - platformResourcesRequirementsStates: ConnectionResult>; + platformResourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourcesRequirementsStatesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >(params.selection); return getClient().platformResourcesRequirementsState.findMany(args).unwrap(); } /** * Prefetch PlatformResourcesRequirementsState list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformResourcesRequirementsStatesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourcesRequirementsStatesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesRequirementsStateSelect>; -}): Promise; -export async function prefetchPlatformResourcesRequirementsStatesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourcesRequirementsStatesQuery< + S extends PlatformResourcesRequirementsStateSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourcesRequirementsStateSelect>; + } +): Promise; +export async function prefetchPlatformResourcesRequirementsStatesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourcesRequirementsStateKeys.list(args), - queryFn: () => getClient().platformResourcesRequirementsState.findMany(args).unwrap() + queryFn: () => getClient().platformResourcesRequirementsState.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesResolvedRequirementsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesResolvedRequirementsQuery.ts index 2407b32102..e3194473e8 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesResolvedRequirementsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformResourcesResolvedRequirementsQuery.ts @@ -4,20 +4,36 @@ * 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 { platformResourcesResolvedRequirementKeys } from "../query-keys"; -import type { PlatformResourcesResolvedRequirementSelect, PlatformResourcesResolvedRequirementWithRelations, PlatformResourcesResolvedRequirementFilter, PlatformResourcesResolvedRequirementOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformResourcesResolvedRequirementSelect, PlatformResourcesResolvedRequirementWithRelations, PlatformResourcesResolvedRequirementFilter, PlatformResourcesResolvedRequirementOrderBy } from "../../orm/input-types"; +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 { platformResourcesResolvedRequirementKeys } from '../query-keys'; +import type { + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementWithRelations, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementWithRelations, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ -export const platformResourcesResolvedRequirementsQueryKey = platformResourcesResolvedRequirementKeys.list; +export const platformResourcesResolvedRequirementsQueryKey = + platformResourcesResolvedRequirementKeys.list; /** * Query hook for fetching PlatformResourcesResolvedRequirement list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformResourcesResolvedRequirementsQuery({ @@ -30,33 +46,64 @@ export const platformResourcesResolvedRequirementsQueryKey = platformResourcesRe * }); * ``` */ -export function usePlatformResourcesResolvedRequirementsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesResolvedRequirementSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformResourcesResolvedRequirementsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformResourcesResolvedRequirementsQuery< + S extends PlatformResourcesResolvedRequirementSelect, + TData = { + platformResourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourcesResolvedRequirementSelect>; + } & Omit< + UseQueryOptions< + { + platformResourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformResourcesResolvedRequirementsQuery( + params: { + selection: ListSelectionConfig< + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformResourcesResolvedRequirementKeys.list(args), queryFn: () => getClient().platformResourcesResolvedRequirement.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformResourcesResolvedRequirement list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformResourcesResolvedRequirementsQuery({ @@ -67,38 +114,82 @@ export function usePlatformResourcesResolvedRequirementsQuery(params: { * }); * ``` */ -export async function fetchPlatformResourcesResolvedRequirementsQuery(params: { +export async function fetchPlatformResourcesResolvedRequirementsQuery< + S extends PlatformResourcesResolvedRequirementSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesResolvedRequirementSelect>; + } & Omit< + ListSelectionConfig< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourcesResolvedRequirementSelect>; }): Promise<{ - platformResourcesResolvedRequirements: ConnectionResult>; + platformResourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformResourcesResolvedRequirementsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >(params.selection); return getClient().platformResourcesResolvedRequirement.findMany(args).unwrap(); } /** * Prefetch PlatformResourcesResolvedRequirement list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformResourcesResolvedRequirementsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformResourcesResolvedRequirementsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformResourcesResolvedRequirementSelect>; -}): Promise; -export async function prefetchPlatformResourcesResolvedRequirementsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformResourcesResolvedRequirementsQuery< + S extends PlatformResourcesResolvedRequirementSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformResourcesResolvedRequirementSelect>; + } +): Promise; +export async function prefetchPlatformResourcesResolvedRequirementsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformResourcesResolvedRequirementKeys.list(args), - queryFn: () => getClient().platformResourcesResolvedRequirement.findMany(args).unwrap() + queryFn: () => getClient().platformResourcesResolvedRequirement.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEndpointQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEndpointQuery.ts index 88092e41e1..f6a649b23f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEndpointQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEndpointQuery.ts @@ -4,20 +4,26 @@ * 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 { platformWebhookEndpointKeys } from "../query-keys"; -import type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations } from "../../orm/input-types"; +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 { platformWebhookEndpointKeys } from '../query-keys'; +import type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformWebhookEndpointQueryKey = platformWebhookEndpointKeys.detail; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { data, isLoading } = usePlatformWebhookEndpointQuery({ @@ -26,38 +32,52 @@ export const platformWebhookEndpointQueryKey = platformWebhookEndpointKeys.detai * }); * ``` */ -export function usePlatformWebhookEndpointQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformWebhookEndpointSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformWebhookEndpointQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformWebhookEndpointQuery< + S extends PlatformWebhookEndpointSelect, + TData = { + platformWebhookEndpoint: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformWebhookEndpointSelect>; + } & Omit< + UseQueryOptions< + { + platformWebhookEndpoint: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformWebhookEndpointQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformWebhookEndpointKeys.detail(params.id), - queryFn: () => getClient().platformWebhookEndpoint.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformWebhookEndpoint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```ts * const data = await fetchPlatformWebhookEndpointQuery({ @@ -66,7 +86,9 @@ export function usePlatformWebhookEndpointQuery(params: { * }); * ``` */ -export async function fetchPlatformWebhookEndpointQuery(params: { +export async function fetchPlatformWebhookEndpointQuery< + S extends PlatformWebhookEndpointSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPlatformWebhookEndpointQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformWebhookEndpoint.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformWebhookEndpoint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```ts * await prefetchPlatformWebhookEndpointQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformWebhookEndpointQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformWebhookEndpointSelect>; -}): Promise; -export async function prefetchPlatformWebhookEndpointQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformWebhookEndpointQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformWebhookEndpointSelect>; + } +): Promise; +export async function prefetchPlatformWebhookEndpointQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformWebhookEndpointKeys.detail(params.id), - queryFn: () => getClient().platformWebhookEndpoint.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformWebhookEndpoint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEndpointsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEndpointsQuery.ts index 6d3545547e..a168c439b8 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEndpointsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEndpointsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformWebhookEndpointKeys } from "../query-keys"; -import type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations, PlatformWebhookEndpointFilter, PlatformWebhookEndpointOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEndpointSelect, PlatformWebhookEndpointWithRelations, PlatformWebhookEndpointFilter, PlatformWebhookEndpointOrderBy } from "../../orm/input-types"; +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 { platformWebhookEndpointKeys } from '../query-keys'; +import type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointWithRelations, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformWebhookEndpointsQueryKey = platformWebhookEndpointKeys.list; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { data, isLoading } = usePlatformWebhookEndpointsQuery({ @@ -30,33 +45,60 @@ export const platformWebhookEndpointsQueryKey = platformWebhookEndpointKeys.list * }); * ``` */ -export function usePlatformWebhookEndpointsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformWebhookEndpointSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformWebhookEndpointsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformWebhookEndpointsQuery< + S extends PlatformWebhookEndpointSelect, + TData = { + platformWebhookEndpoints: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformWebhookEndpointSelect>; + } & Omit< + UseQueryOptions< + { + platformWebhookEndpoints: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformWebhookEndpointsQuery( + params: { + selection: ListSelectionConfig< + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformWebhookEndpointKeys.list(args), queryFn: () => getClient().platformWebhookEndpoint.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```ts * const data = await fetchPlatformWebhookEndpointsQuery({ @@ -67,38 +109,74 @@ export function usePlatformWebhookEndpointsQuery(params: { * }); * ``` */ -export async function fetchPlatformWebhookEndpointsQuery(params: { +export async function fetchPlatformWebhookEndpointsQuery< + S extends PlatformWebhookEndpointSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformWebhookEndpointSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformWebhookEndpointSelect>; }): Promise<{ - platformWebhookEndpoints: ConnectionResult>; + platformWebhookEndpoints: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformWebhookEndpointsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy + >(params.selection); return getClient().platformWebhookEndpoint.findMany(args).unwrap(); } /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```ts * await prefetchPlatformWebhookEndpointsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformWebhookEndpointsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformWebhookEndpointSelect>; -}): Promise; -export async function prefetchPlatformWebhookEndpointsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformWebhookEndpointsQuery< + S extends PlatformWebhookEndpointSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformWebhookEndpointSelect>; + } +): Promise; +export async function prefetchPlatformWebhookEndpointsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformWebhookEndpointKeys.list(args), - queryFn: () => getClient().platformWebhookEndpoint.findMany(args).unwrap() + queryFn: () => getClient().platformWebhookEndpoint.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEventQuery.ts index 968b89f448..1a5277e3e1 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEventQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEventQuery.ts @@ -4,20 +4,26 @@ * 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 { platformWebhookEventKeys } from "../query-keys"; -import type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations } from "../../orm/input-types"; +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 { platformWebhookEventKeys } from '../query-keys'; +import type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformWebhookEventQueryKey = platformWebhookEventKeys.detail; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { data, isLoading } = usePlatformWebhookEventQuery({ @@ -26,38 +32,52 @@ export const platformWebhookEventQueryKey = platformWebhookEventKeys.detail; * }); * ``` */ -export function usePlatformWebhookEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformWebhookEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformWebhookEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformWebhookEventQuery< + S extends PlatformWebhookEventSelect, + TData = { + platformWebhookEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformWebhookEventSelect>; + } & Omit< + UseQueryOptions< + { + platformWebhookEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformWebhookEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformWebhookEventKeys.detail(params.id), - queryFn: () => getClient().platformWebhookEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformWebhookEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```ts * const data = await fetchPlatformWebhookEventQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformWebhookEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformWebhookEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformWebhookEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```ts * await prefetchPlatformWebhookEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformWebhookEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformWebhookEventSelect>; -}): Promise; -export async function prefetchPlatformWebhookEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformWebhookEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformWebhookEventSelect>; + } +): Promise; +export async function prefetchPlatformWebhookEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformWebhookEventKeys.detail(params.id), - queryFn: () => getClient().platformWebhookEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformWebhookEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEventsQuery.ts index 30c081082e..3a212a8821 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEventsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/usePlatformWebhookEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformWebhookEventKeys } from "../query-keys"; -import type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations, PlatformWebhookEventFilter, PlatformWebhookEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformWebhookEventSelect, PlatformWebhookEventWithRelations, PlatformWebhookEventFilter, PlatformWebhookEventOrderBy } from "../../orm/input-types"; +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 { platformWebhookEventKeys } from '../query-keys'; +import type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformWebhookEventSelect, + PlatformWebhookEventWithRelations, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformWebhookEventsQueryKey = platformWebhookEventKeys.list; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { data, isLoading } = usePlatformWebhookEventsQuery({ @@ -30,33 +45,60 @@ export const platformWebhookEventsQueryKey = platformWebhookEventKeys.list; * }); * ``` */ -export function usePlatformWebhookEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformWebhookEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformWebhookEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformWebhookEventsQuery< + S extends PlatformWebhookEventSelect, + TData = { + platformWebhookEvents: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformWebhookEventSelect>; + } & Omit< + UseQueryOptions< + { + platformWebhookEvents: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformWebhookEventsQuery( + params: { + selection: ListSelectionConfig< + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformWebhookEventKeys.list(args), queryFn: () => getClient().platformWebhookEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```ts * const data = await fetchPlatformWebhookEventsQuery({ @@ -67,38 +109,70 @@ export function usePlatformWebhookEventsQuery(params: { * }); * ``` */ -export async function fetchPlatformWebhookEventsQuery(params: { +export async function fetchPlatformWebhookEventsQuery< + S extends PlatformWebhookEventSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformWebhookEventSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformWebhookEventSelect>; }): Promise<{ platformWebhookEvents: ConnectionResult>; }>; export async function fetchPlatformWebhookEventsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy + >(params.selection); return getClient().platformWebhookEvent.findMany(args).unwrap(); } /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```ts * await prefetchPlatformWebhookEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformWebhookEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformWebhookEventSelect>; -}): Promise; -export async function prefetchPlatformWebhookEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformWebhookEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformWebhookEventSelect>; + } +): Promise; +export async function prefetchPlatformWebhookEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformWebhookEventKeys.list(args), - queryFn: () => getClient().platformWebhookEvent.findMany(args).unwrap() + queryFn: () => getClient().platformWebhookEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useReadFunctionGraphQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useReadFunctionGraphQuery.ts index 43ab1d8f68..83fbb4ee52 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useReadFunctionGraphQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useReadFunctionGraphQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { ReadFunctionGraphVariables } from "../../orm/query"; -export type { ReadFunctionGraphVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { ReadFunctionGraphVariables } from '../../orm/query'; +export type { ReadFunctionGraphVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const readFunctionGraphQueryKey = customQueryKeys.readFunctionGraph; /** * Query hook for readFunctionGraph - * + * * @example * ```tsx * const { data, isLoading } = useReadFunctionGraphQuery({ variables: { graphId } }); - * + * * if (data?.readFunctionGraph) { * console.log(data.readFunctionGraph); * } * ``` */ -export function useReadFunctionGraphQuery(params?: { - variables?: ReadFunctionGraphVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useReadFunctionGraphQuery(params?: { - variables?: ReadFunctionGraphVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useReadFunctionGraphQuery< + TData = { + readFunctionGraph: unknown | null; + }, +>( + params?: { + variables?: ReadFunctionGraphVariables; + } & Omit< + UseQueryOptions< + { + readFunctionGraph: unknown | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useReadFunctionGraphQuery< + TData = { + readFunctionGraph: unknown | null; + }, +>( + params?: { + variables?: ReadFunctionGraphVariables; + } & Omit< + UseQueryOptions< + { + readFunctionGraph: unknown | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: readFunctionGraphQueryKey(variables), queryFn: () => getClient().query.readFunctionGraph(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch readFunctionGraph without React hooks - * + * * @example * ```ts * const data = await fetchReadFunctionGraphQuery({ variables: { graphId } }); @@ -68,18 +87,21 @@ export async function fetchReadFunctionGraphQuery(params?: { } /** * Prefetch readFunctionGraph for SSR or cache warming - * + * * @example * ```ts * await prefetchReadFunctionGraphQuery(queryClient, { variables: { graphId } }); * ``` */ -export async function prefetchReadFunctionGraphQuery(queryClient: QueryClient, params?: { - variables?: ReadFunctionGraphVariables; -}): Promise { +export async function prefetchReadFunctionGraphQuery( + queryClient: QueryClient, + params?: { + variables?: ReadFunctionGraphVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: readFunctionGraphQueryKey(variables), - queryFn: () => getClient().query.readFunctionGraph(variables).unwrap() + queryFn: () => getClient().query.readFunctionGraph(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceDeclaredCapacitiesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceDeclaredCapacitiesQuery.ts index 902cb713bf..edcda11fe2 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceDeclaredCapacitiesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceDeclaredCapacitiesQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceDeclaredCapacityKeys } from "../query-keys"; -import type { ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityWithRelations, ResourceDeclaredCapacityFilter, ResourceDeclaredCapacityOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityWithRelations, ResourceDeclaredCapacityFilter, ResourceDeclaredCapacityOrderBy } from "../../orm/input-types"; +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 { resourceDeclaredCapacityKeys } from '../query-keys'; +import type { + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityWithRelations, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityWithRelations, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceDeclaredCapacitiesQueryKey = resourceDeclaredCapacityKeys.list; /** * Query hook for fetching ResourceDeclaredCapacity list - * + * * @example * ```tsx * const { data, isLoading } = useResourceDeclaredCapacitiesQuery({ @@ -30,33 +45,60 @@ export const resourceDeclaredCapacitiesQueryKey = resourceDeclaredCapacityKeys.l * }); * ``` */ -export function useResourceDeclaredCapacitiesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceDeclaredCapacitySelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceDeclaredCapacitiesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceDeclaredCapacitiesQuery< + S extends ResourceDeclaredCapacitySelect, + TData = { + resourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceDeclaredCapacitySelect>; + } & Omit< + UseQueryOptions< + { + resourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceDeclaredCapacitiesQuery( + params: { + selection: ListSelectionConfig< + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceDeclaredCapacityKeys.list(args), queryFn: () => getClient().resourceDeclaredCapacity.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ResourceDeclaredCapacity list without React hooks - * + * * @example * ```ts * const data = await fetchResourceDeclaredCapacitiesQuery({ @@ -67,38 +109,74 @@ export function useResourceDeclaredCapacitiesQuery(params: { * }); * ``` */ -export async function fetchResourceDeclaredCapacitiesQuery(params: { +export async function fetchResourceDeclaredCapacitiesQuery< + S extends ResourceDeclaredCapacitySelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceDeclaredCapacitySelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceDeclaredCapacitySelect>; }): Promise<{ - resourceDeclaredCapacities: ConnectionResult>; + resourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; }>; export async function fetchResourceDeclaredCapacitiesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy + >(params.selection); return getClient().resourceDeclaredCapacity.findMany(args).unwrap(); } /** * Prefetch ResourceDeclaredCapacity list for SSR or cache warming - * + * * @example * ```ts * await prefetchResourceDeclaredCapacitiesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceDeclaredCapacitiesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceDeclaredCapacitySelect>; -}): Promise; -export async function prefetchResourceDeclaredCapacitiesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceDeclaredCapacitiesQuery< + S extends ResourceDeclaredCapacitySelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceDeclaredCapacitySelect>; + } +): Promise; +export async function prefetchResourceDeclaredCapacitiesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceDeclaredCapacityKeys.list(args), - queryFn: () => getClient().resourceDeclaredCapacity.findMany(args).unwrap() + queryFn: () => getClient().resourceDeclaredCapacity.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceDefinitionQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceDefinitionQuery.ts index 626b0892d5..44dc9ab795 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceDefinitionQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceDefinitionQuery.ts @@ -4,20 +4,26 @@ * 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 { resourceDefinitionKeys } from "../query-keys"; -import type { ResourceDefinitionSelect, ResourceDefinitionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceDefinitionSelect, ResourceDefinitionWithRelations } from "../../orm/input-types"; +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 { resourceDefinitionKeys } from '../query-keys'; +import type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceDefinitionQueryKey = resourceDefinitionKeys.detail; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { data, isLoading } = useResourceDefinitionQuery({ @@ -26,38 +32,52 @@ export const resourceDefinitionQueryKey = resourceDefinitionKeys.detail; * }); * ``` */ -export function useResourceDefinitionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceDefinitionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceDefinitionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourceDefinitionQuery< + S extends ResourceDefinitionSelect, + TData = { + resourceDefinition: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + resourceDefinition: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceDefinitionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceDefinitionKeys.detail(params.id), - queryFn: () => getClient().resourceDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resourceDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```ts * const data = await fetchResourceDefinitionQuery({ @@ -79,35 +99,46 @@ export async function fetchResourceDefinitionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resourceDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resourceDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```ts * await prefetchResourceDefinitionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourceDefinitionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceDefinitionSelect>; -}): Promise; -export async function prefetchResourceDefinitionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourceDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceDefinitionSelect>; + } +): Promise; +export async function prefetchResourceDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourceDefinitionKeys.detail(params.id), - queryFn: () => getClient().resourceDefinition.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resourceDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceDefinitionsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceDefinitionsQuery.ts index 1f13db6fdc..f0c242b38e 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceDefinitionsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceDefinitionsQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceDefinitionKeys } from "../query-keys"; -import type { ResourceDefinitionSelect, ResourceDefinitionWithRelations, ResourceDefinitionFilter, ResourceDefinitionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceDefinitionSelect, ResourceDefinitionWithRelations, ResourceDefinitionFilter, ResourceDefinitionOrderBy } from "../../orm/input-types"; +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 { resourceDefinitionKeys } from '../query-keys'; +import type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceDefinitionSelect, + ResourceDefinitionWithRelations, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceDefinitionsQueryKey = resourceDefinitionKeys.list; /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```tsx * const { data, isLoading } = useResourceDefinitionsQuery({ @@ -30,33 +45,58 @@ export const resourceDefinitionsQueryKey = resourceDefinitionKeys.list; * }); * ``` */ -export function useResourceDefinitionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceDefinitionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceDefinitionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceDefinitionsQuery< + S extends ResourceDefinitionSelect, + TData = { + resourceDefinitions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + resourceDefinitions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceDefinitionsQuery( + params: { + selection: ListSelectionConfig< + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceDefinitionKeys.list(args), queryFn: () => getClient().resourceDefinition.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```ts * const data = await fetchResourceDefinitionsQuery({ @@ -70,35 +110,62 @@ export function useResourceDefinitionsQuery(params: { export async function fetchResourceDefinitionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceDefinitionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ResourceDefinitionSelect>; }): Promise<{ resourceDefinitions: ConnectionResult>; }>; export async function fetchResourceDefinitionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy + >(params.selection); return getClient().resourceDefinition.findMany(args).unwrap(); } /** * Resource definitions — templates for resource kinds declaring default spec and secret/config requirements - * + * * @example * ```ts * await prefetchResourceDefinitionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceDefinitionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceDefinitionSelect>; -}): Promise; -export async function prefetchResourceDefinitionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceDefinitionSelect>; + } +): Promise; +export async function prefetchResourceDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceDefinitionKeys.list(args), - queryFn: () => getClient().resourceDefinition.findMany(args).unwrap() + queryFn: () => getClient().resourceDefinition.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceEventQuery.ts index 8d7162574a..96b509f321 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceEventQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceEventQuery.ts @@ -4,20 +4,20 @@ * 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 { resourceEventKeys } from "../query-keys"; -import type { ResourceEventSelect, ResourceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceEventSelect, ResourceEventWithRelations } from "../../orm/input-types"; +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 { resourceEventKeys } from '../query-keys'; +import type { ResourceEventSelect, ResourceEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceEventSelect, ResourceEventWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceEventQueryKey = resourceEventKeys.detail; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { data, isLoading } = useResourceEventQuery({ @@ -26,38 +26,52 @@ export const resourceEventQueryKey = resourceEventKeys.detail; * }); * ``` */ -export function useResourceEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourceEventQuery< + S extends ResourceEventSelect, + TData = { + resourceEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceEventSelect>; + } & Omit< + UseQueryOptions< + { + resourceEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceEventKeys.detail(params.id), - queryFn: () => getClient().resourceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resourceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```ts * const data = await fetchResourceEventQuery({ @@ -79,35 +93,46 @@ export async function fetchResourceEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resourceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resourceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```ts * await prefetchResourceEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceEventSelect>; -}): Promise; -export async function prefetchResourceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceEventSelect>; + } +): Promise; +export async function prefetchResourceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourceEventKeys.detail(params.id), - queryFn: () => getClient().resourceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resourceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceEventsQuery.ts index 559d9cbf0b..079396bb54 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceEventsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceEventKeys } from "../query-keys"; -import type { ResourceEventSelect, ResourceEventWithRelations, ResourceEventFilter, ResourceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceEventSelect, ResourceEventWithRelations, ResourceEventFilter, ResourceEventOrderBy } from "../../orm/input-types"; +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 { resourceEventKeys } from '../query-keys'; +import type { + ResourceEventSelect, + ResourceEventWithRelations, + ResourceEventFilter, + ResourceEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceEventSelect, + ResourceEventWithRelations, + ResourceEventFilter, + ResourceEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceEventsQueryKey = resourceEventKeys.list; /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```tsx * const { data, isLoading } = useResourceEventsQuery({ @@ -30,33 +45,49 @@ export const resourceEventsQueryKey = resourceEventKeys.list; * }); * ``` */ -export function useResourceEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceEventsQuery< + S extends ResourceEventSelect, + TData = { + resourceEvents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourceEventSelect>; + } & Omit< + UseQueryOptions< + { + resourceEvents: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceEventsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceEventSelect, + ResourceEventFilter, + ResourceEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceEventKeys.list(args), queryFn: () => getClient().resourceEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```ts * const data = await fetchResourceEventsQuery({ @@ -70,35 +101,51 @@ export function useResourceEventsQuery(params: { export async function fetchResourceEventsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceEventSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ResourceEventSelect>; }): Promise<{ resourceEvents: ConnectionResult>; }>; export async function fetchResourceEventsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceEventSelect, + ResourceEventFilter, + ResourceEventOrderBy + >(params.selection); return getClient().resourceEvent.findMany(args).unwrap(); } /** * Resource lifecycle events — audit log of provisioning, updates, and failure events - * + * * @example * ```ts * await prefetchResourceEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceEventSelect>; -}): Promise; -export async function prefetchResourceEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourceEventSelect>; + } +): Promise; +export async function prefetchResourceEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + ResourceEventSelect, + ResourceEventFilter, + ResourceEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceEventKeys.list(args), - queryFn: () => getClient().resourceEvent.findMany(args).unwrap() + queryFn: () => getClient().resourceEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceInstallationQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceInstallationQuery.ts index acff464ea0..9b5c0bdbf6 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceInstallationQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceInstallationQuery.ts @@ -4,20 +4,26 @@ * 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 { resourceInstallationKeys } from "../query-keys"; -import type { ResourceInstallationSelect, ResourceInstallationWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationSelect, ResourceInstallationWithRelations } from "../../orm/input-types"; +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 { resourceInstallationKeys } from '../query-keys'; +import type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceInstallationQueryKey = resourceInstallationKeys.detail; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { data, isLoading } = useResourceInstallationQuery({ @@ -26,38 +32,52 @@ export const resourceInstallationQueryKey = resourceInstallationKeys.detail; * }); * ``` */ -export function useResourceInstallationQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceInstallationSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceInstallationQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourceInstallationQuery< + S extends ResourceInstallationSelect, + TData = { + resourceInstallation: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceInstallationSelect>; + } & Omit< + UseQueryOptions< + { + resourceInstallation: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceInstallationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceInstallationKeys.detail(params.id), - queryFn: () => getClient().resourceInstallation.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resourceInstallation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```ts * const data = await fetchResourceInstallationQuery({ @@ -79,35 +99,46 @@ export async function fetchResourceInstallationQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resourceInstallation.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resourceInstallation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```ts * await prefetchResourceInstallationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourceInstallationQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceInstallationSelect>; -}): Promise; -export async function prefetchResourceInstallationQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourceInstallationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceInstallationSelect>; + } +): Promise; +export async function prefetchResourceInstallationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourceInstallationKeys.detail(params.id), - queryFn: () => getClient().resourceInstallation.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resourceInstallation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceInstallationsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceInstallationsQuery.ts index e6d6569629..1dda55a90f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceInstallationsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceInstallationsQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceInstallationKeys } from "../query-keys"; -import type { ResourceInstallationSelect, ResourceInstallationWithRelations, ResourceInstallationFilter, ResourceInstallationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceInstallationSelect, ResourceInstallationWithRelations, ResourceInstallationFilter, ResourceInstallationOrderBy } from "../../orm/input-types"; +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 { resourceInstallationKeys } from '../query-keys'; +import type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, + ResourceInstallationFilter, + ResourceInstallationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceInstallationSelect, + ResourceInstallationWithRelations, + ResourceInstallationFilter, + ResourceInstallationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceInstallationsQueryKey = resourceInstallationKeys.list; /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```tsx * const { data, isLoading } = useResourceInstallationsQuery({ @@ -30,33 +45,60 @@ export const resourceInstallationsQueryKey = resourceInstallationKeys.list; * }); * ``` */ -export function useResourceInstallationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceInstallationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceInstallationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceInstallationsQuery< + S extends ResourceInstallationSelect, + TData = { + resourceInstallations: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceInstallationSelect>; + } & Omit< + UseQueryOptions< + { + resourceInstallations: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceInstallationsQuery( + params: { + selection: ListSelectionConfig< + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceInstallationKeys.list(args), queryFn: () => getClient().resourceInstallation.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```ts * const data = await fetchResourceInstallationsQuery({ @@ -67,38 +109,70 @@ export function useResourceInstallationsQuery(params: { * }); * ``` */ -export async function fetchResourceInstallationsQuery(params: { +export async function fetchResourceInstallationsQuery< + S extends ResourceInstallationSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceInstallationSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceInstallationSelect>; }): Promise<{ resourceInstallations: ConnectionResult>; }>; export async function fetchResourceInstallationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy + >(params.selection); return getClient().resourceInstallation.findMany(args).unwrap(); } /** * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback - * + * * @example * ```ts * await prefetchResourceInstallationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceInstallationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceInstallationSelect>; -}): Promise; -export async function prefetchResourceInstallationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceInstallationsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceInstallationSelect>; + } +): Promise; +export async function prefetchResourceInstallationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceInstallationKeys.list(args), - queryFn: () => getClient().resourceInstallation.findMany(args).unwrap() + queryFn: () => getClient().resourceInstallation.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceQuery.ts index 29c656213a..97a42f8334 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceQuery.ts @@ -4,20 +4,20 @@ * 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 { resourceKeys } from "../query-keys"; -import type { ResourceSelect, ResourceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceSelect, ResourceWithRelations } from "../../orm/input-types"; +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 { resourceKeys } from '../query-keys'; +import type { ResourceSelect, ResourceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceSelect, ResourceWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceQueryKey = resourceKeys.detail; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { data, isLoading } = useResourceQuery({ @@ -26,38 +26,52 @@ export const resourceQueryKey = resourceKeys.detail; * }); * ``` */ -export function useResourceQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourceQuery< + S extends ResourceSelect, + TData = { + resource: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceSelect>; + } & Omit< + UseQueryOptions< + { + resource: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceKeys.detail(params.id), - queryFn: () => getClient().resource.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```ts * const data = await fetchResourceQuery({ @@ -79,35 +93,46 @@ export async function fetchResourceQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resource.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```ts * await prefetchResourceQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourceQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceSelect>; -}): Promise; -export async function prefetchResourceQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceSelect>; + } +): Promise; +export async function prefetchResourceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourceKeys.detail(params.id), - queryFn: () => getClient().resource.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resource.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceStatusCheckQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceStatusCheckQuery.ts index 7bf5ab54e3..afae44e7d7 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceStatusCheckQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceStatusCheckQuery.ts @@ -4,20 +4,26 @@ * 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 { resourceStatusCheckKeys } from "../query-keys"; -import type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations } from "../../orm/input-types"; +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 { resourceStatusCheckKeys } from '../query-keys'; +import type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceStatusCheckQueryKey = resourceStatusCheckKeys.detail; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { data, isLoading } = useResourceStatusCheckQuery({ @@ -26,38 +32,52 @@ export const resourceStatusCheckQueryKey = resourceStatusCheckKeys.detail; * }); * ``` */ -export function useResourceStatusCheckQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceStatusCheckSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceStatusCheckQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourceStatusCheckQuery< + S extends ResourceStatusCheckSelect, + TData = { + resourceStatusCheck: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceStatusCheckSelect>; + } & Omit< + UseQueryOptions< + { + resourceStatusCheck: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceStatusCheckQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceStatusCheckKeys.detail(params.id), - queryFn: () => getClient().resourceStatusCheck.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resourceStatusCheck.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```ts * const data = await fetchResourceStatusCheckQuery({ @@ -79,35 +99,46 @@ export async function fetchResourceStatusCheckQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resourceStatusCheck.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resourceStatusCheck.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```ts * await prefetchResourceStatusCheckQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourceStatusCheckQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceStatusCheckSelect>; -}): Promise; -export async function prefetchResourceStatusCheckQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourceStatusCheckQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceStatusCheckSelect>; + } +): Promise; +export async function prefetchResourceStatusCheckQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourceStatusCheckKeys.detail(params.id), - queryFn: () => getClient().resourceStatusCheck.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resourceStatusCheck.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceStatusChecksQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceStatusChecksQuery.ts index e43ce1dcd5..50d72d914d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceStatusChecksQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceStatusChecksQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceStatusCheckKeys } from "../query-keys"; -import type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations, ResourceStatusCheckFilter, ResourceStatusCheckOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceStatusCheckSelect, ResourceStatusCheckWithRelations, ResourceStatusCheckFilter, ResourceStatusCheckOrderBy } from "../../orm/input-types"; +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 { resourceStatusCheckKeys } from '../query-keys'; +import type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceStatusCheckSelect, + ResourceStatusCheckWithRelations, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceStatusChecksQueryKey = resourceStatusCheckKeys.list; /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```tsx * const { data, isLoading } = useResourceStatusChecksQuery({ @@ -30,33 +45,58 @@ export const resourceStatusChecksQueryKey = resourceStatusCheckKeys.list; * }); * ``` */ -export function useResourceStatusChecksQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceStatusCheckSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceStatusChecksQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceStatusChecksQuery< + S extends ResourceStatusCheckSelect, + TData = { + resourceStatusChecks: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceStatusCheckSelect>; + } & Omit< + UseQueryOptions< + { + resourceStatusChecks: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceStatusChecksQuery( + params: { + selection: ListSelectionConfig< + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceStatusCheckKeys.list(args), queryFn: () => getClient().resourceStatusCheck.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```ts * const data = await fetchResourceStatusChecksQuery({ @@ -70,35 +110,65 @@ export function useResourceStatusChecksQuery(params: { export async function fetchResourceStatusChecksQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceStatusCheckSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceStatusCheckSelect>; }): Promise<{ resourceStatusChecks: ConnectionResult>; }>; export async function fetchResourceStatusChecksQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy + >(params.selection); return getClient().resourceStatusCheck.findMany(args).unwrap(); } /** * On-demand resource status checks — diagnostic snapshots from the runtime (K8s status, conditions, log tails) - * + * * @example * ```ts * await prefetchResourceStatusChecksQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceStatusChecksQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceStatusCheckSelect>; -}): Promise; -export async function prefetchResourceStatusChecksQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceStatusChecksQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceStatusCheckSelect>; + } +): Promise; +export async function prefetchResourceStatusChecksQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceStatusCheckKeys.list(args), - queryFn: () => getClient().resourceStatusCheck.findMany(args).unwrap() + queryFn: () => getClient().resourceStatusCheck.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageLogQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageLogQuery.ts index 57513b622a..a5e61f201d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageLogQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageLogQuery.ts @@ -4,20 +4,20 @@ * 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 { resourceUsageLogKeys } from "../query-keys"; -import type { ResourceUsageLogSelect, ResourceUsageLogWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageLogSelect, ResourceUsageLogWithRelations } from "../../orm/input-types"; +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 { resourceUsageLogKeys } from '../query-keys'; +import type { ResourceUsageLogSelect, ResourceUsageLogWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceUsageLogSelect, ResourceUsageLogWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceUsageLogQueryKey = resourceUsageLogKeys.detail; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { data, isLoading } = useResourceUsageLogQuery({ @@ -26,38 +26,52 @@ export const resourceUsageLogQueryKey = resourceUsageLogKeys.detail; * }); * ``` */ -export function useResourceUsageLogQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceUsageLogSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceUsageLogQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourceUsageLogQuery< + S extends ResourceUsageLogSelect, + TData = { + resourceUsageLog: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceUsageLogSelect>; + } & Omit< + UseQueryOptions< + { + resourceUsageLog: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceUsageLogQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceUsageLogKeys.detail(params.id), - queryFn: () => getClient().resourceUsageLog.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resourceUsageLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```ts * const data = await fetchResourceUsageLogQuery({ @@ -79,35 +93,46 @@ export async function fetchResourceUsageLogQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resourceUsageLog.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resourceUsageLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```ts * await prefetchResourceUsageLogQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourceUsageLogQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceUsageLogSelect>; -}): Promise; -export async function prefetchResourceUsageLogQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourceUsageLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceUsageLogSelect>; + } +): Promise; +export async function prefetchResourceUsageLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourceUsageLogKeys.detail(params.id), - queryFn: () => getClient().resourceUsageLog.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resourceUsageLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageLogsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageLogsQuery.ts index e86af737ea..1968faeb25 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageLogsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageLogsQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceUsageLogKeys } from "../query-keys"; -import type { ResourceUsageLogSelect, ResourceUsageLogWithRelations, ResourceUsageLogFilter, ResourceUsageLogOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageLogSelect, ResourceUsageLogWithRelations, ResourceUsageLogFilter, ResourceUsageLogOrderBy } from "../../orm/input-types"; +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 { resourceUsageLogKeys } from '../query-keys'; +import type { + ResourceUsageLogSelect, + ResourceUsageLogWithRelations, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceUsageLogSelect, + ResourceUsageLogWithRelations, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceUsageLogsQueryKey = resourceUsageLogKeys.list; /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```tsx * const { data, isLoading } = useResourceUsageLogsQuery({ @@ -30,33 +45,53 @@ export const resourceUsageLogsQueryKey = resourceUsageLogKeys.list; * }); * ``` */ -export function useResourceUsageLogsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUsageLogSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceUsageLogsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceUsageLogsQuery< + S extends ResourceUsageLogSelect, + TData = { + resourceUsageLogs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourceUsageLogSelect>; + } & Omit< + UseQueryOptions< + { + resourceUsageLogs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceUsageLogsQuery( + params: { + selection: ListSelectionConfig< + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceUsageLogKeys.list(args), queryFn: () => getClient().resourceUsageLog.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```ts * const data = await fetchResourceUsageLogsQuery({ @@ -70,35 +105,59 @@ export function useResourceUsageLogsQuery(params: { export async function fetchResourceUsageLogsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUsageLogSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ResourceUsageLogSelect>; }): Promise<{ resourceUsageLogs: ConnectionResult>; }>; export async function fetchResourceUsageLogsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy + >(params.selection); return getClient().resourceUsageLog.findMany(args).unwrap(); } /** * Raw resource usage log — interval-accounting measurements from heartbeats (self), the reconciler (observer), and the namespace-grain collector (prometheus) - * + * * @example * ```ts * await prefetchResourceUsageLogsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceUsageLogsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUsageLogSelect>; -}): Promise; -export async function prefetchResourceUsageLogsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceUsageLogsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourceUsageLogSelect>; + } +): Promise; +export async function prefetchResourceUsageLogsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceUsageLogKeys.list(args), - queryFn: () => getClient().resourceUsageLog.findMany(args).unwrap() + queryFn: () => getClient().resourceUsageLog.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageSummariesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageSummariesQuery.ts index 7b8539aece..ea2c03418f 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageSummariesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageSummariesQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceUsageSummaryKeys } from "../query-keys"; -import type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations, ResourceUsageSummaryFilter, ResourceUsageSummaryOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations, ResourceUsageSummaryFilter, ResourceUsageSummaryOrderBy } from "../../orm/input-types"; +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 { resourceUsageSummaryKeys } from '../query-keys'; +import type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceUsageSummariesQueryKey = resourceUsageSummaryKeys.list; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { data, isLoading } = useResourceUsageSummariesQuery({ @@ -30,33 +45,60 @@ export const resourceUsageSummariesQueryKey = resourceUsageSummaryKeys.list; * }); * ``` */ -export function useResourceUsageSummariesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUsageSummarySelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceUsageSummariesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceUsageSummariesQuery< + S extends ResourceUsageSummarySelect, + TData = { + resourceUsageSummaries: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceUsageSummarySelect>; + } & Omit< + UseQueryOptions< + { + resourceUsageSummaries: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceUsageSummariesQuery( + params: { + selection: ListSelectionConfig< + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceUsageSummaryKeys.list(args), queryFn: () => getClient().resourceUsageSummary.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```ts * const data = await fetchResourceUsageSummariesQuery({ @@ -67,38 +109,70 @@ export function useResourceUsageSummariesQuery(params: { * }); * ``` */ -export async function fetchResourceUsageSummariesQuery(params: { +export async function fetchResourceUsageSummariesQuery< + S extends ResourceUsageSummarySelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUsageSummarySelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceUsageSummarySelect>; }): Promise<{ resourceUsageSummaries: ConnectionResult>; }>; export async function fetchResourceUsageSummariesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy + >(params.selection); return getClient().resourceUsageSummary.findMany(args).unwrap(); } /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```ts * await prefetchResourceUsageSummariesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceUsageSummariesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUsageSummarySelect>; -}): Promise; -export async function prefetchResourceUsageSummariesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceUsageSummariesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceUsageSummarySelect>; + } +): Promise; +export async function prefetchResourceUsageSummariesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceUsageSummaryKeys.list(args), - queryFn: () => getClient().resourceUsageSummary.findMany(args).unwrap() + queryFn: () => getClient().resourceUsageSummary.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageSummaryQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageSummaryQuery.ts index 8b0dbf030f..91bab99106 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageSummaryQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceUsageSummaryQuery.ts @@ -4,20 +4,26 @@ * 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 { resourceUsageSummaryKeys } from "../query-keys"; -import type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUsageSummarySelect, ResourceUsageSummaryWithRelations } from "../../orm/input-types"; +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 { resourceUsageSummaryKeys } from '../query-keys'; +import type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceUsageSummarySelect, + ResourceUsageSummaryWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceUsageSummaryQueryKey = resourceUsageSummaryKeys.detail; /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```tsx * const { data, isLoading } = useResourceUsageSummaryQuery({ @@ -26,38 +32,52 @@ export const resourceUsageSummaryQueryKey = resourceUsageSummaryKeys.detail; * }); * ``` */ -export function useResourceUsageSummaryQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceUsageSummarySelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceUsageSummaryQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourceUsageSummaryQuery< + S extends ResourceUsageSummarySelect, + TData = { + resourceUsageSummary: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceUsageSummarySelect>; + } & Omit< + UseQueryOptions< + { + resourceUsageSummary: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceUsageSummaryQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceUsageSummaryKeys.detail(params.id), - queryFn: () => getClient().resourceUsageSummary.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resourceUsageSummary.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```ts * const data = await fetchResourceUsageSummaryQuery({ @@ -79,35 +99,46 @@ export async function fetchResourceUsageSummaryQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resourceUsageSummary.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resourceUsageSummary.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Resource usage summaries — runtime seconds, GB-seconds, and max gauges per (resource, namespace, day); resource_id-NULL rows are namespace-grain totals - * + * * @example * ```ts * await prefetchResourceUsageSummaryQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourceUsageSummaryQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceUsageSummarySelect>; -}): Promise; -export async function prefetchResourceUsageSummaryQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourceUsageSummaryQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceUsageSummarySelect>; + } +): Promise; +export async function prefetchResourceUsageSummaryQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourceUsageSummaryKeys.detail(params.id), - queryFn: () => getClient().resourceUsageSummary.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resourceUsageSummary.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourceUtilizationsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourceUtilizationsQuery.ts index 5819b16c03..3b67a23684 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourceUtilizationsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourceUtilizationsQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceUtilizationKeys } from "../query-keys"; -import type { ResourceUtilizationSelect, ResourceUtilizationWithRelations, ResourceUtilizationFilter, ResourceUtilizationOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceUtilizationSelect, ResourceUtilizationWithRelations, ResourceUtilizationFilter, ResourceUtilizationOrderBy } from "../../orm/input-types"; +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 { resourceUtilizationKeys } from '../query-keys'; +import type { + ResourceUtilizationSelect, + ResourceUtilizationWithRelations, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceUtilizationSelect, + ResourceUtilizationWithRelations, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceUtilizationsQueryKey = resourceUtilizationKeys.list; /** * Query hook for fetching ResourceUtilization list - * + * * @example * ```tsx * const { data, isLoading } = useResourceUtilizationsQuery({ @@ -30,33 +45,58 @@ export const resourceUtilizationsQueryKey = resourceUtilizationKeys.list; * }); * ``` */ -export function useResourceUtilizationsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUtilizationSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceUtilizationsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceUtilizationsQuery< + S extends ResourceUtilizationSelect, + TData = { + resourceUtilizations: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceUtilizationSelect>; + } & Omit< + UseQueryOptions< + { + resourceUtilizations: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceUtilizationsQuery( + params: { + selection: ListSelectionConfig< + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceUtilizationKeys.list(args), queryFn: () => getClient().resourceUtilization.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ResourceUtilization list without React hooks - * + * * @example * ```ts * const data = await fetchResourceUtilizationsQuery({ @@ -70,35 +110,65 @@ export function useResourceUtilizationsQuery(params: { export async function fetchResourceUtilizationsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUtilizationSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceUtilizationSelect>; }): Promise<{ resourceUtilizations: ConnectionResult>; }>; export async function fetchResourceUtilizationsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy + >(params.selection); return getClient().resourceUtilization.findMany(args).unwrap(); } /** * Prefetch ResourceUtilization list for SSR or cache warming - * + * * @example * ```ts * await prefetchResourceUtilizationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceUtilizationsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceUtilizationSelect>; -}): Promise; -export async function prefetchResourceUtilizationsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceUtilizationsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourceUtilizationSelect>; + } +): Promise; +export async function prefetchResourceUtilizationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceUtilizationKeys.list(args), - queryFn: () => getClient().resourceUtilization.findMany(args).unwrap() + queryFn: () => getClient().resourceUtilization.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourcesHealthQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourcesHealthQuery.ts index 9ffae93546..433e591020 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourcesHealthQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourcesHealthQuery.ts @@ -4,20 +4,20 @@ * 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 { resourcesHealthKeys } from "../query-keys"; -import type { ResourcesHealthSelect, ResourcesHealthWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourcesHealthSelect, ResourcesHealthWithRelations } from "../../orm/input-types"; +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 { resourcesHealthKeys } from '../query-keys'; +import type { ResourcesHealthSelect, ResourcesHealthWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourcesHealthSelect, ResourcesHealthWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourcesHealthQueryKey = resourcesHealthKeys.detail; /** * Query hook for fetching a single ResourcesHealth - * + * * @example * ```tsx * const { data, isLoading } = useResourcesHealthQuery({ @@ -26,38 +26,52 @@ export const resourcesHealthQueryKey = resourcesHealthKeys.detail; * }); * ``` */ -export function useResourcesHealthQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourcesHealthSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourcesHealthQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourcesHealthQuery< + S extends ResourcesHealthSelect, + TData = { + resourcesHealth: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourcesHealthSelect>; + } & Omit< + UseQueryOptions< + { + resourcesHealth: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourcesHealthQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourcesHealthKeys.detail(params.id), - queryFn: () => getClient().resourcesHealth.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resourcesHealth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ResourcesHealth without React hooks - * + * * @example * ```ts * const data = await fetchResourcesHealthQuery({ @@ -79,35 +93,46 @@ export async function fetchResourcesHealthQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resourcesHealth.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resourcesHealth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ResourcesHealth for SSR or cache warming - * + * * @example * ```ts * await prefetchResourcesHealthQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourcesHealthQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourcesHealthSelect>; -}): Promise; -export async function prefetchResourcesHealthQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourcesHealthQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourcesHealthSelect>; + } +): Promise; +export async function prefetchResourcesHealthQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourcesHealthKeys.detail(params.id), - queryFn: () => getClient().resourcesHealth.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resourcesHealth.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourcesHealthsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourcesHealthsQuery.ts index 5b96f98c94..942a6f38db 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourcesHealthsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourcesHealthsQuery.ts @@ -4,20 +4,35 @@ * 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 { resourcesHealthKeys } from "../query-keys"; -import type { ResourcesHealthSelect, ResourcesHealthWithRelations, ResourcesHealthFilter, ResourcesHealthOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourcesHealthSelect, ResourcesHealthWithRelations, ResourcesHealthFilter, ResourcesHealthOrderBy } from "../../orm/input-types"; +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 { resourcesHealthKeys } from '../query-keys'; +import type { + ResourcesHealthSelect, + ResourcesHealthWithRelations, + ResourcesHealthFilter, + ResourcesHealthOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourcesHealthSelect, + ResourcesHealthWithRelations, + ResourcesHealthFilter, + ResourcesHealthOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourcesHealthsQueryKey = resourcesHealthKeys.list; /** * Query hook for fetching ResourcesHealth list - * + * * @example * ```tsx * const { data, isLoading } = useResourcesHealthsQuery({ @@ -30,33 +45,53 @@ export const resourcesHealthsQueryKey = resourcesHealthKeys.list; * }); * ``` */ -export function useResourcesHealthsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesHealthSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourcesHealthsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourcesHealthsQuery< + S extends ResourcesHealthSelect, + TData = { + resourcesHealths: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourcesHealthSelect>; + } & Omit< + UseQueryOptions< + { + resourcesHealths: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourcesHealthsQuery( + params: { + selection: ListSelectionConfig< + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourcesHealthKeys.list(args), queryFn: () => getClient().resourcesHealth.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ResourcesHealth list without React hooks - * + * * @example * ```ts * const data = await fetchResourcesHealthsQuery({ @@ -70,35 +105,59 @@ export function useResourcesHealthsQuery(params: { export async function fetchResourcesHealthsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesHealthSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ResourcesHealthSelect>; }): Promise<{ resourcesHealths: ConnectionResult>; }>; export async function fetchResourcesHealthsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy + >(params.selection); return getClient().resourcesHealth.findMany(args).unwrap(); } /** * Prefetch ResourcesHealth list for SSR or cache warming - * + * * @example * ```ts * await prefetchResourcesHealthsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourcesHealthsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesHealthSelect>; -}): Promise; -export async function prefetchResourcesHealthsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourcesHealthsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourcesHealthSelect>; + } +): Promise; +export async function prefetchResourcesHealthsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourcesHealthKeys.list(args), - queryFn: () => getClient().resourcesHealth.findMany(args).unwrap() + queryFn: () => getClient().resourcesHealth.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourcesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourcesQuery.ts index 2195d5ccd9..2894bdfe8d 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourcesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourcesQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceKeys } from "../query-keys"; -import type { ResourceSelect, ResourceWithRelations, ResourceFilter, ResourceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceSelect, ResourceWithRelations, ResourceFilter, ResourceOrderBy } from "../../orm/input-types"; +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 { resourceKeys } from '../query-keys'; +import type { + ResourceSelect, + ResourceWithRelations, + ResourceFilter, + ResourceOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceSelect, + ResourceWithRelations, + ResourceFilter, + ResourceOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourcesQueryKey = resourceKeys.list; /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```tsx * const { data, isLoading } = useResourcesQuery({ @@ -30,33 +45,47 @@ export const resourcesQueryKey = resourceKeys.list; * }); * ``` */ -export function useResourcesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourcesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourcesQuery< + S extends ResourceSelect, + TData = { + resources: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourceSelect>; + } & Omit< + UseQueryOptions< + { + resources: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourcesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceKeys.list(args), queryFn: () => getClient().resource.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```ts * const data = await fetchResourcesQuery({ @@ -70,35 +99,47 @@ export function useResourcesQuery(params: { export async function fetchResourcesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ResourceSelect>; }): Promise<{ resources: ConnectionResult>; }>; export async function fetchResourcesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().resource.findMany(args).unwrap(); } /** * Unified K8s resource declarations — stores desired state (spec) and observed state (status) for all resource kinds within a namespace - * + * * @example * ```ts * await prefetchResourcesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourcesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceSelect>; -}): Promise; -export async function prefetchResourcesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourcesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourceSelect>; + } +): Promise; +export async function prefetchResourcesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: resourceKeys.list(args), - queryFn: () => getClient().resource.findMany(args).unwrap() + queryFn: () => getClient().resource.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourcesRequirementsStatesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourcesRequirementsStatesQuery.ts index 9042c06135..90d81ca973 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourcesRequirementsStatesQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourcesRequirementsStatesQuery.ts @@ -4,20 +4,35 @@ * 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 { resourcesRequirementsStateKeys } from "../query-keys"; -import type { ResourcesRequirementsStateSelect, ResourcesRequirementsStateWithRelations, ResourcesRequirementsStateFilter, ResourcesRequirementsStateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourcesRequirementsStateSelect, ResourcesRequirementsStateWithRelations, ResourcesRequirementsStateFilter, ResourcesRequirementsStateOrderBy } from "../../orm/input-types"; +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 { resourcesRequirementsStateKeys } from '../query-keys'; +import type { + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateWithRelations, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateWithRelations, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourcesRequirementsStatesQueryKey = resourcesRequirementsStateKeys.list; /** * Query hook for fetching ResourcesRequirementsState list - * + * * @example * ```tsx * const { data, isLoading } = useResourcesRequirementsStatesQuery({ @@ -30,33 +45,60 @@ export const resourcesRequirementsStatesQueryKey = resourcesRequirementsStateKey * }); * ``` */ -export function useResourcesRequirementsStatesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesRequirementsStateSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourcesRequirementsStatesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourcesRequirementsStatesQuery< + S extends ResourcesRequirementsStateSelect, + TData = { + resourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourcesRequirementsStateSelect>; + } & Omit< + UseQueryOptions< + { + resourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourcesRequirementsStatesQuery( + params: { + selection: ListSelectionConfig< + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourcesRequirementsStateKeys.list(args), queryFn: () => getClient().resourcesRequirementsState.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ResourcesRequirementsState list without React hooks - * + * * @example * ```ts * const data = await fetchResourcesRequirementsStatesQuery({ @@ -67,38 +109,74 @@ export function useResourcesRequirementsStatesQuery(params: { * }); * ``` */ -export async function fetchResourcesRequirementsStatesQuery(params: { +export async function fetchResourcesRequirementsStatesQuery< + S extends ResourcesRequirementsStateSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesRequirementsStateSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourcesRequirementsStateSelect>; }): Promise<{ - resourcesRequirementsStates: ConnectionResult>; + resourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; }>; export async function fetchResourcesRequirementsStatesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy + >(params.selection); return getClient().resourcesRequirementsState.findMany(args).unwrap(); } /** * Prefetch ResourcesRequirementsState list for SSR or cache warming - * + * * @example * ```ts * await prefetchResourcesRequirementsStatesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourcesRequirementsStatesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesRequirementsStateSelect>; -}): Promise; -export async function prefetchResourcesRequirementsStatesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourcesRequirementsStatesQuery< + S extends ResourcesRequirementsStateSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourcesRequirementsStateSelect>; + } +): Promise; +export async function prefetchResourcesRequirementsStatesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourcesRequirementsStateKeys.list(args), - queryFn: () => getClient().resourcesRequirementsState.findMany(args).unwrap() + queryFn: () => getClient().resourcesRequirementsState.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useResourcesResolvedRequirementsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useResourcesResolvedRequirementsQuery.ts index 883861a8bd..207d7427e7 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useResourcesResolvedRequirementsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useResourcesResolvedRequirementsQuery.ts @@ -4,20 +4,35 @@ * 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 { resourcesResolvedRequirementKeys } from "../query-keys"; -import type { ResourcesResolvedRequirementSelect, ResourcesResolvedRequirementWithRelations, ResourcesResolvedRequirementFilter, ResourcesResolvedRequirementOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourcesResolvedRequirementSelect, ResourcesResolvedRequirementWithRelations, ResourcesResolvedRequirementFilter, ResourcesResolvedRequirementOrderBy } from "../../orm/input-types"; +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 { resourcesResolvedRequirementKeys } from '../query-keys'; +import type { + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementWithRelations, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementWithRelations, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourcesResolvedRequirementsQueryKey = resourcesResolvedRequirementKeys.list; /** * Query hook for fetching ResourcesResolvedRequirement list - * + * * @example * ```tsx * const { data, isLoading } = useResourcesResolvedRequirementsQuery({ @@ -30,33 +45,64 @@ export const resourcesResolvedRequirementsQueryKey = resourcesResolvedRequiremen * }); * ``` */ -export function useResourcesResolvedRequirementsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesResolvedRequirementSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourcesResolvedRequirementsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourcesResolvedRequirementsQuery< + S extends ResourcesResolvedRequirementSelect, + TData = { + resourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + >, + 'fields' + > & + HookStrictSelect, ResourcesResolvedRequirementSelect>; + } & Omit< + UseQueryOptions< + { + resourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourcesResolvedRequirementsQuery( + params: { + selection: ListSelectionConfig< + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourcesResolvedRequirementKeys.list(args), queryFn: () => getClient().resourcesResolvedRequirement.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ResourcesResolvedRequirement list without React hooks - * + * * @example * ```ts * const data = await fetchResourcesResolvedRequirementsQuery({ @@ -67,38 +113,78 @@ export function useResourcesResolvedRequirementsQuery(params: { * }); * ``` */ -export async function fetchResourcesResolvedRequirementsQuery(params: { +export async function fetchResourcesResolvedRequirementsQuery< + S extends ResourcesResolvedRequirementSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesResolvedRequirementSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ResourcesResolvedRequirementSelect>; }): Promise<{ - resourcesResolvedRequirements: ConnectionResult>; + resourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; }>; export async function fetchResourcesResolvedRequirementsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + >(params.selection); return getClient().resourcesResolvedRequirement.findMany(args).unwrap(); } /** * Prefetch ResourcesResolvedRequirement list for SSR or cache warming - * + * * @example * ```ts * await prefetchResourcesResolvedRequirementsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourcesResolvedRequirementsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourcesResolvedRequirementSelect>; -}): Promise; -export async function prefetchResourcesResolvedRequirementsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourcesResolvedRequirementsQuery< + S extends ResourcesResolvedRequirementSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + >, + 'fields' + > & + HookStrictSelect, ResourcesResolvedRequirementSelect>; + } +): Promise; +export async function prefetchResourcesResolvedRequirementsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourcesResolvedRequirementKeys.list(args), - queryFn: () => getClient().resourcesResolvedRequirement.findMany(args).unwrap() + queryFn: () => getClient().resourcesResolvedRequirement.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useWebhookEndpointQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useWebhookEndpointQuery.ts index 6cf78d16cd..c8432009d4 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useWebhookEndpointQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useWebhookEndpointQuery.ts @@ -4,20 +4,20 @@ * 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 { webhookEndpointKeys } from "../query-keys"; -import type { WebhookEndpointSelect, WebhookEndpointWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEndpointSelect, WebhookEndpointWithRelations } from "../../orm/input-types"; +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 { webhookEndpointKeys } from '../query-keys'; +import type { WebhookEndpointSelect, WebhookEndpointWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { WebhookEndpointSelect, WebhookEndpointWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webhookEndpointQueryKey = webhookEndpointKeys.detail; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { data, isLoading } = useWebhookEndpointQuery({ @@ -26,38 +26,52 @@ export const webhookEndpointQueryKey = webhookEndpointKeys.detail; * }); * ``` */ -export function useWebhookEndpointQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebhookEndpointSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebhookEndpointQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useWebhookEndpointQuery< + S extends WebhookEndpointSelect, + TData = { + webhookEndpoint: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebhookEndpointSelect>; + } & Omit< + UseQueryOptions< + { + webhookEndpoint: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebhookEndpointQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webhookEndpointKeys.detail(params.id), - queryFn: () => getClient().webhookEndpoint.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .webhookEndpoint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```ts * const data = await fetchWebhookEndpointQuery({ @@ -79,35 +93,46 @@ export async function fetchWebhookEndpointQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().webhookEndpoint.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .webhookEndpoint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```ts * await prefetchWebhookEndpointQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchWebhookEndpointQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebhookEndpointSelect>; -}): Promise; -export async function prefetchWebhookEndpointQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchWebhookEndpointQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebhookEndpointSelect>; + } +): Promise; +export async function prefetchWebhookEndpointQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: webhookEndpointKeys.detail(params.id), - queryFn: () => getClient().webhookEndpoint.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .webhookEndpoint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useWebhookEndpointsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useWebhookEndpointsQuery.ts index 8c219f71c9..44110a0926 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useWebhookEndpointsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useWebhookEndpointsQuery.ts @@ -4,20 +4,35 @@ * 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 { webhookEndpointKeys } from "../query-keys"; -import type { WebhookEndpointSelect, WebhookEndpointWithRelations, WebhookEndpointFilter, WebhookEndpointOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEndpointSelect, WebhookEndpointWithRelations, WebhookEndpointFilter, WebhookEndpointOrderBy } from "../../orm/input-types"; +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 { webhookEndpointKeys } from '../query-keys'; +import type { + WebhookEndpointSelect, + WebhookEndpointWithRelations, + WebhookEndpointFilter, + WebhookEndpointOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + WebhookEndpointSelect, + WebhookEndpointWithRelations, + WebhookEndpointFilter, + WebhookEndpointOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webhookEndpointsQueryKey = webhookEndpointKeys.list; /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```tsx * const { data, isLoading } = useWebhookEndpointsQuery({ @@ -30,33 +45,53 @@ export const webhookEndpointsQueryKey = webhookEndpointKeys.list; * }); * ``` */ -export function useWebhookEndpointsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookEndpointSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebhookEndpointsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useWebhookEndpointsQuery< + S extends WebhookEndpointSelect, + TData = { + webhookEndpoints: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, WebhookEndpointSelect>; + } & Omit< + UseQueryOptions< + { + webhookEndpoints: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebhookEndpointsQuery( + params: { + selection: ListSelectionConfig< + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webhookEndpointKeys.list(args), queryFn: () => getClient().webhookEndpoint.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```ts * const data = await fetchWebhookEndpointsQuery({ @@ -70,35 +105,59 @@ export function useWebhookEndpointsQuery(params: { export async function fetchWebhookEndpointsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookEndpointSelect>; + } & Omit, 'fields'> & + HookStrictSelect, WebhookEndpointSelect>; }): Promise<{ webhookEndpoints: ConnectionResult>; }>; export async function fetchWebhookEndpointsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy + >(params.selection); return getClient().webhookEndpoint.findMany(args).unwrap(); } /** * Webhook route authority: (host, path) -> function task_identifier invoked through the webhook channel, with provider, signing-secret reference, and replay window - * + * * @example * ```ts * await prefetchWebhookEndpointsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchWebhookEndpointsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookEndpointSelect>; -}): Promise; -export async function prefetchWebhookEndpointsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchWebhookEndpointsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, WebhookEndpointSelect>; + } +): Promise; +export async function prefetchWebhookEndpointsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: webhookEndpointKeys.list(args), - queryFn: () => getClient().webhookEndpoint.findMany(args).unwrap() + queryFn: () => getClient().webhookEndpoint.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useWebhookEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useWebhookEventQuery.ts index 495942cc1f..bce0307f58 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useWebhookEventQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useWebhookEventQuery.ts @@ -4,20 +4,20 @@ * 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 { webhookEventKeys } from "../query-keys"; -import type { WebhookEventSelect, WebhookEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEventSelect, WebhookEventWithRelations } from "../../orm/input-types"; +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 { webhookEventKeys } from '../query-keys'; +import type { WebhookEventSelect, WebhookEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { WebhookEventSelect, WebhookEventWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webhookEventQueryKey = webhookEventKeys.detail; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { data, isLoading } = useWebhookEventQuery({ @@ -26,38 +26,52 @@ export const webhookEventQueryKey = webhookEventKeys.detail; * }); * ``` */ -export function useWebhookEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebhookEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebhookEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useWebhookEventQuery< + S extends WebhookEventSelect, + TData = { + webhookEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebhookEventSelect>; + } & Omit< + UseQueryOptions< + { + webhookEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebhookEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webhookEventKeys.detail(params.id), - queryFn: () => getClient().webhookEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .webhookEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```ts * const data = await fetchWebhookEventQuery({ @@ -79,35 +93,46 @@ export async function fetchWebhookEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().webhookEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .webhookEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```ts * await prefetchWebhookEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchWebhookEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebhookEventSelect>; -}): Promise; -export async function prefetchWebhookEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchWebhookEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebhookEventSelect>; + } +): Promise; +export async function prefetchWebhookEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: webhookEventKeys.detail(params.id), - queryFn: () => getClient().webhookEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .webhookEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/queries/useWebhookEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useWebhookEventsQuery.ts index 13839cc4ea..9d30f8f653 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/useWebhookEventsQuery.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/useWebhookEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { webhookEventKeys } from "../query-keys"; -import type { WebhookEventSelect, WebhookEventWithRelations, WebhookEventFilter, WebhookEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookEventSelect, WebhookEventWithRelations, WebhookEventFilter, WebhookEventOrderBy } from "../../orm/input-types"; +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 { webhookEventKeys } from '../query-keys'; +import type { + WebhookEventSelect, + WebhookEventWithRelations, + WebhookEventFilter, + WebhookEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + WebhookEventSelect, + WebhookEventWithRelations, + WebhookEventFilter, + WebhookEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webhookEventsQueryKey = webhookEventKeys.list; /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```tsx * const { data, isLoading } = useWebhookEventsQuery({ @@ -30,33 +45,47 @@ export const webhookEventsQueryKey = webhookEventKeys.list; * }); * ``` */ -export function useWebhookEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebhookEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useWebhookEventsQuery< + S extends WebhookEventSelect, + TData = { + webhookEvents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, WebhookEventSelect>; + } & Omit< + UseQueryOptions< + { + webhookEvents: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebhookEventsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webhookEventKeys.list(args), queryFn: () => getClient().webhookEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```ts * const data = await fetchWebhookEventsQuery({ @@ -70,35 +99,47 @@ export function useWebhookEventsQuery(params: { export async function fetchWebhookEventsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookEventSelect>; + } & Omit, 'fields'> & + HookStrictSelect, WebhookEventSelect>; }): Promise<{ webhookEvents: ConnectionResult>; }>; export async function fetchWebhookEventsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().webhookEvent.findMany(args).unwrap(); } /** * Durable webhook acceptance log — one row per accepted delivery, deduplicated on (endpoint_id, external_event_id), linked to the pending function invocation it enqueued - * + * * @example * ```ts * await prefetchWebhookEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchWebhookEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookEventSelect>; -}): Promise; -export async function prefetchWebhookEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchWebhookEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, WebhookEventSelect>; + } +): Promise; +export async function prefetchWebhookEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: webhookEventKeys.list(args), - queryFn: () => getClient().webhookEvent.findMany(args).unwrap() + queryFn: () => getClient().webhookEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/compute/hooks/query-keys.ts b/sdk/constructive-react/src/compute/hooks/query-keys.ts index a6d45c741d..deb13ac5af 100644 --- a/sdk/constructive-react/src/compute/hooks/query-keys.ts +++ b/sdk/constructive-react/src/compute/hooks/query-keys.ts @@ -20,473 +20,647 @@ // ============================================================================ export const dbPresetKeys = { - /** All dbPreset queries */all: ["dbpreset"] as const, - /** List query keys */lists: () => [...dbPresetKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...dbPresetKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...dbPresetKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...dbPresetKeys.details(), id] as const + /** All dbPreset queries */ all: ['dbpreset'] as const, + /** List query keys */ lists: () => [...dbPresetKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...dbPresetKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...dbPresetKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...dbPresetKeys.details(), id] as const, } as const; export const functionApiBindingKeys = { - /** All functionApiBinding queries */all: ["functionapibinding"] as const, - /** List query keys */lists: () => [...functionApiBindingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionApiBindingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionApiBindingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionApiBindingKeys.details(), id] as const + /** All functionApiBinding queries */ all: ['functionapibinding'] as const, + /** List query keys */ lists: () => [...functionApiBindingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionApiBindingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionApiBindingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionApiBindingKeys.details(), id] as const, } as const; export const functionDefinitionKeys = { - /** All functionDefinition queries */all: ["functiondefinition"] as const, - /** List query keys */lists: () => [...functionDefinitionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionDefinitionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionDefinitionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionDefinitionKeys.details(), id] as const + /** All functionDefinition queries */ all: ['functiondefinition'] as const, + /** List query keys */ lists: () => [...functionDefinitionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionDefinitionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionDefinitionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionDefinitionKeys.details(), id] as const, } as const; export const functionDeploymentKeys = { - /** All functionDeployment queries */all: ["functiondeployment"] as const, - /** List query keys */lists: () => [...functionDeploymentKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionDeploymentKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionDeploymentKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionDeploymentKeys.details(), id] as const + /** All functionDeployment queries */ all: ['functiondeployment'] as const, + /** List query keys */ lists: () => [...functionDeploymentKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionDeploymentKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionDeploymentKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionDeploymentKeys.details(), id] as const, } as const; export const functionDeploymentEventKeys = { - /** All functionDeploymentEvent queries */all: ["functiondeploymentevent"] as const, - /** List query keys */lists: () => [...functionDeploymentEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionDeploymentEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionDeploymentEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionDeploymentEventKeys.details(), id] as const + /** All functionDeploymentEvent queries */ all: ['functiondeploymentevent'] as const, + /** List query keys */ lists: () => [...functionDeploymentEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionDeploymentEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionDeploymentEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionDeploymentEventKeys.details(), id] as const, } as const; export const functionExecutionLogKeys = { - /** All functionExecutionLog queries */all: ["functionexecutionlog"] as const, - /** List query keys */lists: () => [...functionExecutionLogKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionExecutionLogKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionExecutionLogKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionExecutionLogKeys.details(), id] as const + /** All functionExecutionLog queries */ all: ['functionexecutionlog'] as const, + /** List query keys */ lists: () => [...functionExecutionLogKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionExecutionLogKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionExecutionLogKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionExecutionLogKeys.details(), id] as const, } as const; export const functionGraphCommitKeys = { - /** All functionGraphCommit queries */all: ["functiongraphcommit"] as const, - /** List query keys */lists: () => [...functionGraphCommitKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionGraphCommitKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionGraphCommitKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionGraphCommitKeys.details(), id] as const + /** All functionGraphCommit queries */ all: ['functiongraphcommit'] as const, + /** List query keys */ lists: () => [...functionGraphCommitKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphCommitKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphCommitKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphCommitKeys.details(), id] as const, } as const; export const 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 + /** 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 functionGraphExecutionKeys = { - /** All functionGraphExecution queries */all: ["functiongraphexecution"] as const, - /** List query keys */lists: () => [...functionGraphExecutionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionGraphExecutionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionGraphExecutionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionGraphExecutionKeys.details(), id] as const + /** All functionGraphExecution queries */ all: ['functiongraphexecution'] as const, + /** List query keys */ lists: () => [...functionGraphExecutionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphExecutionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphExecutionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphExecutionKeys.details(), id] as const, } as const; export const functionGraphExecutionNodeStateKeys = { - /** All functionGraphExecutionNodeState queries */all: ["functiongraphexecutionnodestate"] as const, - /** List query keys */lists: () => [...functionGraphExecutionNodeStateKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionGraphExecutionNodeStateKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionGraphExecutionNodeStateKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionGraphExecutionNodeStateKeys.details(), id] as const + /** All functionGraphExecutionNodeState queries */ all: [ + 'functiongraphexecutionnodestate', + ] as const, + /** List query keys */ lists: () => [...functionGraphExecutionNodeStateKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphExecutionNodeStateKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...functionGraphExecutionNodeStateKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphExecutionNodeStateKeys.details(), id] as const, } as const; export const functionGraphExecutionOutputKeys = { - /** All functionGraphExecutionOutput queries */all: ["functiongraphexecutionoutput"] as const, - /** List query keys */lists: () => [...functionGraphExecutionOutputKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionGraphExecutionOutputKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionGraphExecutionOutputKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionGraphExecutionOutputKeys.details(), id] as const + /** All functionGraphExecutionOutput queries */ all: ['functiongraphexecutionoutput'] as const, + /** List query keys */ lists: () => [...functionGraphExecutionOutputKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphExecutionOutputKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...functionGraphExecutionOutputKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphExecutionOutputKeys.details(), id] as const, } as const; export const functionGraphObjectKeys = { - /** All functionGraphObject queries */all: ["functiongraphobject"] as const, - /** List query keys */lists: () => [...functionGraphObjectKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionGraphObjectKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionGraphObjectKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionGraphObjectKeys.details(), id] as const + /** All functionGraphObject queries */ all: ['functiongraphobject'] as const, + /** List query keys */ lists: () => [...functionGraphObjectKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphObjectKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphObjectKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphObjectKeys.details(), id] as const, } as const; export const functionGraphRefKeys = { - /** All functionGraphRef queries */all: ["functiongraphref"] as const, - /** List query keys */lists: () => [...functionGraphRefKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionGraphRefKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionGraphRefKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionGraphRefKeys.details(), id] as const + /** All functionGraphRef queries */ all: ['functiongraphref'] as const, + /** List query keys */ lists: () => [...functionGraphRefKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphRefKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphRefKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphRefKeys.details(), id] as const, } as const; export const functionGraphStoreKeys = { - /** All functionGraphStore queries */all: ["functiongraphstore"] as const, - /** List query keys */lists: () => [...functionGraphStoreKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionGraphStoreKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionGraphStoreKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionGraphStoreKeys.details(), id] as const + /** All functionGraphStore queries */ all: ['functiongraphstore'] as const, + /** List query keys */ lists: () => [...functionGraphStoreKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphStoreKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphStoreKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphStoreKeys.details(), id] as const, } as const; export const functionInvocationAttemptKeys = { - /** All functionInvocationAttempt queries */all: ["functioninvocationattempt"] as const, - /** List query keys */lists: () => [...functionInvocationAttemptKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionInvocationAttemptKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionInvocationAttemptKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionInvocationAttemptKeys.details(), id] as const + /** All functionInvocationAttempt queries */ all: ['functioninvocationattempt'] as const, + /** List query keys */ lists: () => [...functionInvocationAttemptKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionInvocationAttemptKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionInvocationAttemptKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionInvocationAttemptKeys.details(), id] as const, } as const; export const functionInvocationKeys = { - /** All functionInvocation queries */all: ["functioninvocation"] as const, - /** List query keys */lists: () => [...functionInvocationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionInvocationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionInvocationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionInvocationKeys.details(), id] as const + /** All functionInvocation queries */ all: ['functioninvocation'] as const, + /** List query keys */ lists: () => [...functionInvocationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionInvocationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionInvocationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionInvocationKeys.details(), id] as const, } as const; export const getAllTreeNodesRecordKeys = { - /** All getAllTreeNodesRecord queries */all: ["getalltreenodesrecord"] as const, - /** List query keys */lists: () => [...getAllTreeNodesRecordKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...getAllTreeNodesRecordKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...getAllTreeNodesRecordKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...getAllTreeNodesRecordKeys.details(), id] as const + /** All getAllTreeNodesRecord queries */ all: ['getalltreenodesrecord'] as const, + /** List query keys */ lists: () => [...getAllTreeNodesRecordKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...getAllTreeNodesRecordKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...getAllTreeNodesRecordKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...getAllTreeNodesRecordKeys.details(), id] as const, } as const; export const infraCommitKeys = { - /** All infraCommit queries */all: ["infracommit"] as const, - /** List query keys */lists: () => [...infraCommitKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...infraCommitKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...infraCommitKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...infraCommitKeys.details(), id] as const + /** All infraCommit queries */ all: ['infracommit'] as const, + /** List query keys */ lists: () => [...infraCommitKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...infraCommitKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...infraCommitKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...infraCommitKeys.details(), id] as const, } as const; export const infraGetAllTreeNodesRecordKeys = { - /** All infraGetAllTreeNodesRecord queries */all: ["infragetalltreenodesrecord"] as const, - /** List query keys */lists: () => [...infraGetAllTreeNodesRecordKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...infraGetAllTreeNodesRecordKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...infraGetAllTreeNodesRecordKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...infraGetAllTreeNodesRecordKeys.details(), id] as const + /** All infraGetAllTreeNodesRecord queries */ all: ['infragetalltreenodesrecord'] as const, + /** List query keys */ lists: () => [...infraGetAllTreeNodesRecordKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...infraGetAllTreeNodesRecordKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...infraGetAllTreeNodesRecordKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...infraGetAllTreeNodesRecordKeys.details(), id] as const, } as const; export const infraObjectKeys = { - /** All infraObject queries */all: ["infraobject"] as const, - /** List query keys */lists: () => [...infraObjectKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...infraObjectKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...infraObjectKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...infraObjectKeys.details(), id] as const + /** All infraObject queries */ all: ['infraobject'] as const, + /** List query keys */ lists: () => [...infraObjectKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...infraObjectKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...infraObjectKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...infraObjectKeys.details(), id] as const, } as const; export const infraRefKeys = { - /** All infraRef queries */all: ["infraref"] as const, - /** List query keys */lists: () => [...infraRefKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...infraRefKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...infraRefKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...infraRefKeys.details(), id] as const + /** All infraRef queries */ all: ['infraref'] as const, + /** List query keys */ lists: () => [...infraRefKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...infraRefKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...infraRefKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...infraRefKeys.details(), id] as const, } as const; export const infraStoreKeys = { - /** All infraStore queries */all: ["infrastore"] as const, - /** List query keys */lists: () => [...infraStoreKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...infraStoreKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...infraStoreKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...infraStoreKeys.details(), id] as const + /** All infraStore queries */ all: ['infrastore'] as const, + /** List query keys */ lists: () => [...infraStoreKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...infraStoreKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...infraStoreKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...infraStoreKeys.details(), id] as const, } as const; export const integrationProviderKeys = { - /** All integrationProvider queries */all: ["integrationprovider"] as const, - /** List query keys */lists: () => [...integrationProviderKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...integrationProviderKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...integrationProviderKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...integrationProviderKeys.details(), id] as const + /** All integrationProvider queries */ all: ['integrationprovider'] as const, + /** List query keys */ lists: () => [...integrationProviderKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...integrationProviderKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...integrationProviderKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...integrationProviderKeys.details(), id] as const, } as const; export const namespaceKeys = { - /** All namespace queries */all: ["namespace"] as const, - /** List query keys */lists: () => [...namespaceKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...namespaceKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...namespaceKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...namespaceKeys.details(), id] as const + /** All namespace queries */ all: ['namespace'] as const, + /** List query keys */ lists: () => [...namespaceKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...namespaceKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...namespaceKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...namespaceKeys.details(), id] as const, } as const; export const namespaceEventKeys = { - /** All namespaceEvent queries */all: ["namespaceevent"] as const, - /** List query keys */lists: () => [...namespaceEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...namespaceEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...namespaceEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...namespaceEventKeys.details(), id] as const + /** All namespaceEvent queries */ all: ['namespaceevent'] as const, + /** List query keys */ lists: () => [...namespaceEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...namespaceEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...namespaceEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...namespaceEventKeys.details(), id] as const, } as const; export const platformFunctionApiBindingKeys = { - /** All platformFunctionApiBinding queries */all: ["platformfunctionapibinding"] as const, - /** List query keys */lists: () => [...platformFunctionApiBindingKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformFunctionApiBindingKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformFunctionApiBindingKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformFunctionApiBindingKeys.details(), id] as const + /** All platformFunctionApiBinding queries */ all: ['platformfunctionapibinding'] as const, + /** List query keys */ lists: () => [...platformFunctionApiBindingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformFunctionApiBindingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformFunctionApiBindingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformFunctionApiBindingKeys.details(), id] as const, } as const; export const platformFunctionDefinitionKeys = { - /** All platformFunctionDefinition queries */all: ["platformfunctiondefinition"] as const, - /** List query keys */lists: () => [...platformFunctionDefinitionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformFunctionDefinitionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformFunctionDefinitionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformFunctionDefinitionKeys.details(), id] as const + /** All platformFunctionDefinition queries */ all: ['platformfunctiondefinition'] as const, + /** List query keys */ lists: () => [...platformFunctionDefinitionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformFunctionDefinitionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformFunctionDefinitionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformFunctionDefinitionKeys.details(), id] as const, } as const; export const platformFunctionDeploymentKeys = { - /** All platformFunctionDeployment queries */all: ["platformfunctiondeployment"] as const, - /** List query keys */lists: () => [...platformFunctionDeploymentKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformFunctionDeploymentKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformFunctionDeploymentKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformFunctionDeploymentKeys.details(), id] as const + /** All platformFunctionDeployment queries */ all: ['platformfunctiondeployment'] as const, + /** List query keys */ lists: () => [...platformFunctionDeploymentKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformFunctionDeploymentKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformFunctionDeploymentKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformFunctionDeploymentKeys.details(), id] as const, } as const; export const platformFunctionDeploymentEventKeys = { - /** All platformFunctionDeploymentEvent queries */all: ["platformfunctiondeploymentevent"] as const, - /** List query keys */lists: () => [...platformFunctionDeploymentEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformFunctionDeploymentEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformFunctionDeploymentEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformFunctionDeploymentEventKeys.details(), id] as const + /** All platformFunctionDeploymentEvent queries */ all: [ + 'platformfunctiondeploymentevent', + ] as const, + /** List query keys */ lists: () => [...platformFunctionDeploymentEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformFunctionDeploymentEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformFunctionDeploymentEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformFunctionDeploymentEventKeys.details(), id] as const, } as const; export const platformFunctionExecutionLogKeys = { - /** All platformFunctionExecutionLog queries */all: ["platformfunctionexecutionlog"] as const, - /** List query keys */lists: () => [...platformFunctionExecutionLogKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformFunctionExecutionLogKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformFunctionExecutionLogKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformFunctionExecutionLogKeys.details(), id] as const + /** All platformFunctionExecutionLog queries */ all: ['platformfunctionexecutionlog'] as const, + /** List query keys */ lists: () => [...platformFunctionExecutionLogKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformFunctionExecutionLogKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformFunctionExecutionLogKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformFunctionExecutionLogKeys.details(), id] as const, } as const; export const platformFunctionInvocationAttemptKeys = { - /** All platformFunctionInvocationAttempt queries */all: ["platformfunctioninvocationattempt"] as const, - /** List query keys */lists: () => [...platformFunctionInvocationAttemptKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformFunctionInvocationAttemptKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformFunctionInvocationAttemptKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformFunctionInvocationAttemptKeys.details(), id] as const + /** All platformFunctionInvocationAttempt queries */ all: [ + 'platformfunctioninvocationattempt', + ] as const, + /** List query keys */ lists: () => + [...platformFunctionInvocationAttemptKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformFunctionInvocationAttemptKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformFunctionInvocationAttemptKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformFunctionInvocationAttemptKeys.details(), id] as const, } as const; export const platformFunctionInvocationKeys = { - /** All platformFunctionInvocation queries */all: ["platformfunctioninvocation"] as const, - /** List query keys */lists: () => [...platformFunctionInvocationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformFunctionInvocationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformFunctionInvocationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformFunctionInvocationKeys.details(), id] as const + /** All platformFunctionInvocation queries */ all: ['platformfunctioninvocation'] as const, + /** List query keys */ lists: () => [...platformFunctionInvocationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformFunctionInvocationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformFunctionInvocationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformFunctionInvocationKeys.details(), id] as const, } as const; export const platformInfraCommitKeys = { - /** All platformInfraCommit queries */all: ["platforminfracommit"] as const, - /** List query keys */lists: () => [...platformInfraCommitKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraCommitKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraCommitKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraCommitKeys.details(), id] as const + /** All platformInfraCommit queries */ all: ['platforminfracommit'] as const, + /** List query keys */ lists: () => [...platformInfraCommitKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraCommitKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInfraCommitKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraCommitKeys.details(), id] as const, } as const; export const platformInfraGetAllTreeNodesRecordKeys = { - /** All platformInfraGetAllTreeNodesRecord queries */all: ["platforminfragetalltreenodesrecord"] as const, - /** List query keys */lists: () => [...platformInfraGetAllTreeNodesRecordKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraGetAllTreeNodesRecordKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraGetAllTreeNodesRecordKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraGetAllTreeNodesRecordKeys.details(), id] as const + /** All platformInfraGetAllTreeNodesRecord queries */ all: [ + 'platforminfragetalltreenodesrecord', + ] as const, + /** List query keys */ lists: () => + [...platformInfraGetAllTreeNodesRecordKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraGetAllTreeNodesRecordKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformInfraGetAllTreeNodesRecordKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraGetAllTreeNodesRecordKeys.details(), id] as const, } as const; export const platformInfraObjectKeys = { - /** All platformInfraObject queries */all: ["platforminfraobject"] as const, - /** List query keys */lists: () => [...platformInfraObjectKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraObjectKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraObjectKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraObjectKeys.details(), id] as const + /** All platformInfraObject queries */ all: ['platforminfraobject'] as const, + /** List query keys */ lists: () => [...platformInfraObjectKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraObjectKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInfraObjectKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraObjectKeys.details(), id] as const, } as const; export const platformInfraRefKeys = { - /** All platformInfraRef queries */all: ["platforminfraref"] as const, - /** List query keys */lists: () => [...platformInfraRefKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraRefKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraRefKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraRefKeys.details(), id] as const + /** All platformInfraRef queries */ all: ['platforminfraref'] as const, + /** List query keys */ lists: () => [...platformInfraRefKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraRefKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInfraRefKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraRefKeys.details(), id] as const, } as const; export const platformInfraStoreKeys = { - /** All platformInfraStore queries */all: ["platforminfrastore"] as const, - /** List query keys */lists: () => [...platformInfraStoreKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraStoreKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraStoreKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraStoreKeys.details(), id] as const + /** All platformInfraStore queries */ all: ['platforminfrastore'] as const, + /** List query keys */ lists: () => [...platformInfraStoreKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraStoreKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInfraStoreKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraStoreKeys.details(), id] as const, } as const; export const platformNamespaceKeys = { - /** All platformNamespace queries */all: ["platformnamespace"] as const, - /** List query keys */lists: () => [...platformNamespaceKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformNamespaceKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformNamespaceKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformNamespaceKeys.details(), id] as const + /** All platformNamespace queries */ all: ['platformnamespace'] as const, + /** List query keys */ lists: () => [...platformNamespaceKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformNamespaceKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformNamespaceKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformNamespaceKeys.details(), id] as const, } as const; export const platformNamespaceEventKeys = { - /** All platformNamespaceEvent queries */all: ["platformnamespaceevent"] as const, - /** List query keys */lists: () => [...platformNamespaceEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformNamespaceEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformNamespaceEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformNamespaceEventKeys.details(), id] as const + /** All platformNamespaceEvent queries */ all: ['platformnamespaceevent'] as const, + /** List query keys */ lists: () => [...platformNamespaceEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformNamespaceEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformNamespaceEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformNamespaceEventKeys.details(), id] as const, } as const; export const platformResourceKeys = { - /** All platformResource queries */all: ["platformresource"] as const, - /** List query keys */lists: () => [...platformResourceKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceKeys.details(), id] as const + /** All platformResource queries */ all: ['platformresource'] as const, + /** List query keys */ lists: () => [...platformResourceKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformResourceKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceKeys.details(), id] as const, } as const; export const platformResourceDeclaredCapacityKeys = { - /** All platformResourceDeclaredCapacity queries */all: ["platformresourcedeclaredcapacity"] as const, - /** List query keys */lists: () => [...platformResourceDeclaredCapacityKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceDeclaredCapacityKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceDeclaredCapacityKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceDeclaredCapacityKeys.details(), id] as const + /** All platformResourceDeclaredCapacity queries */ all: [ + 'platformresourcedeclaredcapacity', + ] as const, + /** List query keys */ lists: () => + [...platformResourceDeclaredCapacityKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceDeclaredCapacityKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformResourceDeclaredCapacityKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceDeclaredCapacityKeys.details(), id] as const, } as const; export const platformResourceDefinitionKeys = { - /** All platformResourceDefinition queries */all: ["platformresourcedefinition"] as const, - /** List query keys */lists: () => [...platformResourceDefinitionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceDefinitionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceDefinitionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceDefinitionKeys.details(), id] as const + /** All platformResourceDefinition queries */ all: ['platformresourcedefinition'] as const, + /** List query keys */ lists: () => [...platformResourceDefinitionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceDefinitionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformResourceDefinitionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceDefinitionKeys.details(), id] as const, } as const; export const platformResourceEventKeys = { - /** All platformResourceEvent queries */all: ["platformresourceevent"] as const, - /** List query keys */lists: () => [...platformResourceEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceEventKeys.details(), id] as const + /** All platformResourceEvent queries */ all: ['platformresourceevent'] as const, + /** List query keys */ lists: () => [...platformResourceEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformResourceEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceEventKeys.details(), id] as const, } as const; export const platformResourceInstallationKeys = { - /** All platformResourceInstallation queries */all: ["platformresourceinstallation"] as const, - /** List query keys */lists: () => [...platformResourceInstallationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceInstallationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceInstallationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceInstallationKeys.details(), id] as const + /** All platformResourceInstallation queries */ all: ['platformresourceinstallation'] as const, + /** List query keys */ lists: () => [...platformResourceInstallationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceInstallationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformResourceInstallationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceInstallationKeys.details(), id] as const, } as const; export const platformResourceStatusCheckKeys = { - /** All platformResourceStatusCheck queries */all: ["platformresourcestatuscheck"] as const, - /** List query keys */lists: () => [...platformResourceStatusCheckKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceStatusCheckKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceStatusCheckKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceStatusCheckKeys.details(), id] as const + /** All platformResourceStatusCheck queries */ all: ['platformresourcestatuscheck'] as const, + /** List query keys */ lists: () => [...platformResourceStatusCheckKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceStatusCheckKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformResourceStatusCheckKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceStatusCheckKeys.details(), id] as const, } as const; export const platformResourceUsageLogKeys = { - /** All platformResourceUsageLog queries */all: ["platformresourceusagelog"] as const, - /** List query keys */lists: () => [...platformResourceUsageLogKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceUsageLogKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceUsageLogKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceUsageLogKeys.details(), id] as const + /** All platformResourceUsageLog queries */ all: ['platformresourceusagelog'] as const, + /** List query keys */ lists: () => [...platformResourceUsageLogKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceUsageLogKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformResourceUsageLogKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceUsageLogKeys.details(), id] as const, } as const; export const platformResourceUsageSummaryKeys = { - /** All platformResourceUsageSummary queries */all: ["platformresourceusagesummary"] as const, - /** List query keys */lists: () => [...platformResourceUsageSummaryKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceUsageSummaryKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceUsageSummaryKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceUsageSummaryKeys.details(), id] as const + /** All platformResourceUsageSummary queries */ all: ['platformresourceusagesummary'] as const, + /** List query keys */ lists: () => [...platformResourceUsageSummaryKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceUsageSummaryKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformResourceUsageSummaryKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceUsageSummaryKeys.details(), id] as const, } as const; export const platformResourceUtilizationKeys = { - /** All platformResourceUtilization queries */all: ["platformresourceutilization"] as const, - /** List query keys */lists: () => [...platformResourceUtilizationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourceUtilizationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourceUtilizationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourceUtilizationKeys.details(), id] as const + /** All platformResourceUtilization queries */ all: ['platformresourceutilization'] as const, + /** List query keys */ lists: () => [...platformResourceUtilizationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourceUtilizationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformResourceUtilizationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourceUtilizationKeys.details(), id] as const, } as const; export const platformResourcesHealthKeys = { - /** All platformResourcesHealth queries */all: ["platformresourceshealth"] as const, - /** List query keys */lists: () => [...platformResourcesHealthKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourcesHealthKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourcesHealthKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourcesHealthKeys.details(), id] as const + /** All platformResourcesHealth queries */ all: ['platformresourceshealth'] as const, + /** List query keys */ lists: () => [...platformResourcesHealthKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourcesHealthKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformResourcesHealthKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourcesHealthKeys.details(), id] as const, } as const; export const platformResourcesRequirementsStateKeys = { - /** All platformResourcesRequirementsState queries */all: ["platformresourcesrequirementsstate"] as const, - /** List query keys */lists: () => [...platformResourcesRequirementsStateKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourcesRequirementsStateKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourcesRequirementsStateKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourcesRequirementsStateKeys.details(), id] as const + /** All platformResourcesRequirementsState queries */ all: [ + 'platformresourcesrequirementsstate', + ] as const, + /** List query keys */ lists: () => + [...platformResourcesRequirementsStateKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourcesRequirementsStateKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformResourcesRequirementsStateKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourcesRequirementsStateKeys.details(), id] as const, } as const; export const platformResourcesResolvedRequirementKeys = { - /** All platformResourcesResolvedRequirement queries */all: ["platformresourcesresolvedrequirement"] as const, - /** List query keys */lists: () => [...platformResourcesResolvedRequirementKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformResourcesResolvedRequirementKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformResourcesResolvedRequirementKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformResourcesResolvedRequirementKeys.details(), id] as const + /** All platformResourcesResolvedRequirement queries */ all: [ + 'platformresourcesresolvedrequirement', + ] as const, + /** List query keys */ lists: () => + [...platformResourcesResolvedRequirementKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformResourcesResolvedRequirementKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformResourcesResolvedRequirementKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformResourcesResolvedRequirementKeys.details(), id] as const, } as const; export const platformWebhookEndpointKeys = { - /** All platformWebhookEndpoint queries */all: ["platformwebhookendpoint"] as const, - /** List query keys */lists: () => [...platformWebhookEndpointKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformWebhookEndpointKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformWebhookEndpointKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformWebhookEndpointKeys.details(), id] as const + /** All platformWebhookEndpoint queries */ all: ['platformwebhookendpoint'] as const, + /** List query keys */ lists: () => [...platformWebhookEndpointKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformWebhookEndpointKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformWebhookEndpointKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformWebhookEndpointKeys.details(), id] as const, } as const; export const platformWebhookEventKeys = { - /** All platformWebhookEvent queries */all: ["platformwebhookevent"] as const, - /** List query keys */lists: () => [...platformWebhookEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformWebhookEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformWebhookEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformWebhookEventKeys.details(), id] as const + /** All platformWebhookEvent queries */ all: ['platformwebhookevent'] as const, + /** List query keys */ lists: () => [...platformWebhookEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformWebhookEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformWebhookEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformWebhookEventKeys.details(), id] as const, } as const; export const resourceKeys = { - /** All resource queries */all: ["resource"] as const, - /** List query keys */lists: () => [...resourceKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceKeys.details(), id] as const + /** All resource queries */ all: ['resource'] as const, + /** List query keys */ lists: () => [...resourceKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceKeys.details(), id] as const, } as const; export const resourceDeclaredCapacityKeys = { - /** All resourceDeclaredCapacity queries */all: ["resourcedeclaredcapacity"] as const, - /** List query keys */lists: () => [...resourceDeclaredCapacityKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceDeclaredCapacityKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceDeclaredCapacityKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceDeclaredCapacityKeys.details(), id] as const + /** All resourceDeclaredCapacity queries */ all: ['resourcedeclaredcapacity'] as const, + /** List query keys */ lists: () => [...resourceDeclaredCapacityKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceDeclaredCapacityKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceDeclaredCapacityKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceDeclaredCapacityKeys.details(), id] as const, } as const; export const resourceDefinitionKeys = { - /** All resourceDefinition queries */all: ["resourcedefinition"] as const, - /** List query keys */lists: () => [...resourceDefinitionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceDefinitionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceDefinitionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceDefinitionKeys.details(), id] as const + /** All resourceDefinition queries */ all: ['resourcedefinition'] as const, + /** List query keys */ lists: () => [...resourceDefinitionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceDefinitionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceDefinitionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceDefinitionKeys.details(), id] as const, } as const; export const resourceEventKeys = { - /** All resourceEvent queries */all: ["resourceevent"] as const, - /** List query keys */lists: () => [...resourceEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceEventKeys.details(), id] as const + /** All resourceEvent queries */ all: ['resourceevent'] as const, + /** List query keys */ lists: () => [...resourceEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceEventKeys.details(), id] as const, } as const; export const resourceInstallationKeys = { - /** All resourceInstallation queries */all: ["resourceinstallation"] as const, - /** List query keys */lists: () => [...resourceInstallationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceInstallationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceInstallationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceInstallationKeys.details(), id] as const + /** All resourceInstallation queries */ all: ['resourceinstallation'] as const, + /** List query keys */ lists: () => [...resourceInstallationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceInstallationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceInstallationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceInstallationKeys.details(), id] as const, } as const; export const resourceStatusCheckKeys = { - /** All resourceStatusCheck queries */all: ["resourcestatuscheck"] as const, - /** List query keys */lists: () => [...resourceStatusCheckKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceStatusCheckKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceStatusCheckKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceStatusCheckKeys.details(), id] as const + /** All resourceStatusCheck queries */ all: ['resourcestatuscheck'] as const, + /** List query keys */ lists: () => [...resourceStatusCheckKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceStatusCheckKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceStatusCheckKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceStatusCheckKeys.details(), id] as const, } as const; export const resourceUsageLogKeys = { - /** All resourceUsageLog queries */all: ["resourceusagelog"] as const, - /** List query keys */lists: () => [...resourceUsageLogKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceUsageLogKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceUsageLogKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceUsageLogKeys.details(), id] as const + /** All resourceUsageLog queries */ all: ['resourceusagelog'] as const, + /** List query keys */ lists: () => [...resourceUsageLogKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceUsageLogKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceUsageLogKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceUsageLogKeys.details(), id] as const, } as const; export const resourceUsageSummaryKeys = { - /** All resourceUsageSummary queries */all: ["resourceusagesummary"] as const, - /** List query keys */lists: () => [...resourceUsageSummaryKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceUsageSummaryKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceUsageSummaryKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceUsageSummaryKeys.details(), id] as const + /** All resourceUsageSummary queries */ all: ['resourceusagesummary'] as const, + /** List query keys */ lists: () => [...resourceUsageSummaryKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceUsageSummaryKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceUsageSummaryKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceUsageSummaryKeys.details(), id] as const, } as const; export const resourceUtilizationKeys = { - /** All resourceUtilization queries */all: ["resourceutilization"] as const, - /** List query keys */lists: () => [...resourceUtilizationKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceUtilizationKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceUtilizationKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceUtilizationKeys.details(), id] as const + /** All resourceUtilization queries */ all: ['resourceutilization'] as const, + /** List query keys */ lists: () => [...resourceUtilizationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceUtilizationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceUtilizationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceUtilizationKeys.details(), id] as const, } as const; export const resourcesHealthKeys = { - /** All resourcesHealth queries */all: ["resourceshealth"] as const, - /** List query keys */lists: () => [...resourcesHealthKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourcesHealthKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourcesHealthKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourcesHealthKeys.details(), id] as const + /** All resourcesHealth queries */ all: ['resourceshealth'] as const, + /** List query keys */ lists: () => [...resourcesHealthKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourcesHealthKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourcesHealthKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourcesHealthKeys.details(), id] as const, } as const; export const resourcesRequirementsStateKeys = { - /** All resourcesRequirementsState queries */all: ["resourcesrequirementsstate"] as const, - /** List query keys */lists: () => [...resourcesRequirementsStateKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourcesRequirementsStateKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourcesRequirementsStateKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourcesRequirementsStateKeys.details(), id] as const + /** All resourcesRequirementsState queries */ all: ['resourcesrequirementsstate'] as const, + /** List query keys */ lists: () => [...resourcesRequirementsStateKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourcesRequirementsStateKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...resourcesRequirementsStateKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourcesRequirementsStateKeys.details(), id] as const, } as const; export const resourcesResolvedRequirementKeys = { - /** All resourcesResolvedRequirement queries */all: ["resourcesresolvedrequirement"] as const, - /** List query keys */lists: () => [...resourcesResolvedRequirementKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourcesResolvedRequirementKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourcesResolvedRequirementKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourcesResolvedRequirementKeys.details(), id] as const + /** All resourcesResolvedRequirement queries */ all: ['resourcesresolvedrequirement'] as const, + /** List query keys */ lists: () => [...resourcesResolvedRequirementKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourcesResolvedRequirementKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...resourcesResolvedRequirementKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourcesResolvedRequirementKeys.details(), id] as const, } as const; export const webhookEndpointKeys = { - /** All webhookEndpoint queries */all: ["webhookendpoint"] as const, - /** List query keys */lists: () => [...webhookEndpointKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...webhookEndpointKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...webhookEndpointKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...webhookEndpointKeys.details(), id] as const + /** All webhookEndpoint queries */ all: ['webhookendpoint'] as const, + /** List query keys */ lists: () => [...webhookEndpointKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...webhookEndpointKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...webhookEndpointKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...webhookEndpointKeys.details(), id] as const, } as const; export const webhookEventKeys = { - /** All webhookEvent queries */all: ["webhookevent"] as const, - /** List query keys */lists: () => [...webhookEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...webhookEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...webhookEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...webhookEventKeys.details(), id] as const + /** All webhookEvent queries */ all: ['webhookevent'] as const, + /** List query keys */ lists: () => [...webhookEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...webhookEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...webhookEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...webhookEventKeys.details(), id] as const, } as const; // ============================================================================ @@ -494,7 +668,8 @@ export const webhookEventKeys = { // ============================================================================ export const customQueryKeys = { - /** Query key for readFunctionGraph */readFunctionGraph: (variables?: object) => ["readFunctionGraph", variables] as const + /** Query key for readFunctionGraph */ readFunctionGraph: (variables?: object) => + ['readFunctionGraph', variables] as const, } as const; /** @@ -586,7 +761,7 @@ export const queryKeys = { resourcesResolvedRequirement: resourcesResolvedRequirementKeys, webhookEndpoint: webhookEndpointKeys, webhookEvent: webhookEventKeys, - custom: customQueryKeys + custom: customQueryKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/compute/hooks/selection.ts b/sdk/constructive-react/src/compute/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/compute/hooks/selection.ts +++ b/sdk/constructive-react/src/compute/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/compute/index.ts b/sdk/constructive-react/src/compute/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/compute/index.ts +++ b/sdk/constructive-react/src/compute/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/compute/orm/client.ts b/sdk/constructive-react/src/compute/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/compute/orm/client.ts +++ b/sdk/constructive-react/src/compute/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/compute/orm/index.ts b/sdk/constructive-react/src/compute/orm/index.ts index 097bc38eea..933b08ed35 100644 --- a/sdk/constructive-react/src/compute/orm/index.ts +++ b/sdk/constructive-react/src/compute/orm/index.ts @@ -3,84 +3,84 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { DbPresetModel } from "./models/dbPreset"; -import { FunctionApiBindingModel } from "./models/functionApiBinding"; -import { FunctionDefinitionModel } from "./models/functionDefinition"; -import { FunctionDeploymentModel } from "./models/functionDeployment"; -import { FunctionDeploymentEventModel } from "./models/functionDeploymentEvent"; -import { FunctionExecutionLogModel } from "./models/functionExecutionLog"; -import { FunctionGraphCommitModel } from "./models/functionGraphCommit"; -import { FunctionGraphModel } from "./models/functionGraph"; -import { FunctionGraphExecutionModel } from "./models/functionGraphExecution"; -import { FunctionGraphExecutionNodeStateModel } from "./models/functionGraphExecutionNodeState"; -import { FunctionGraphExecutionOutputModel } from "./models/functionGraphExecutionOutput"; -import { FunctionGraphObjectModel } from "./models/functionGraphObject"; -import { FunctionGraphRefModel } from "./models/functionGraphRef"; -import { FunctionGraphStoreModel } from "./models/functionGraphStore"; -import { FunctionInvocationAttemptModel } from "./models/functionInvocationAttempt"; -import { FunctionInvocationModel } from "./models/functionInvocation"; -import { GetAllTreeNodesRecordModel } from "./models/getAllTreeNodesRecord"; -import { InfraCommitModel } from "./models/infraCommit"; -import { InfraGetAllTreeNodesRecordModel } from "./models/infraGetAllTreeNodesRecord"; -import { InfraObjectModel } from "./models/infraObject"; -import { InfraRefModel } from "./models/infraRef"; -import { InfraStoreModel } from "./models/infraStore"; -import { IntegrationProviderModel } from "./models/integrationProvider"; -import { NamespaceModel } from "./models/namespace"; -import { NamespaceEventModel } from "./models/namespaceEvent"; -import { PlatformFunctionApiBindingModel } from "./models/platformFunctionApiBinding"; -import { PlatformFunctionDefinitionModel } from "./models/platformFunctionDefinition"; -import { PlatformFunctionDeploymentModel } from "./models/platformFunctionDeployment"; -import { PlatformFunctionDeploymentEventModel } from "./models/platformFunctionDeploymentEvent"; -import { PlatformFunctionExecutionLogModel } from "./models/platformFunctionExecutionLog"; -import { PlatformFunctionInvocationAttemptModel } from "./models/platformFunctionInvocationAttempt"; -import { PlatformFunctionInvocationModel } from "./models/platformFunctionInvocation"; -import { PlatformInfraCommitModel } from "./models/platformInfraCommit"; -import { PlatformInfraGetAllTreeNodesRecordModel } from "./models/platformInfraGetAllTreeNodesRecord"; -import { PlatformInfraObjectModel } from "./models/platformInfraObject"; -import { PlatformInfraRefModel } from "./models/platformInfraRef"; -import { PlatformInfraStoreModel } from "./models/platformInfraStore"; -import { PlatformNamespaceModel } from "./models/platformNamespace"; -import { PlatformNamespaceEventModel } from "./models/platformNamespaceEvent"; -import { PlatformResourceModel } from "./models/platformResource"; -import { PlatformResourceDeclaredCapacityModel } from "./models/platformResourceDeclaredCapacity"; -import { PlatformResourceDefinitionModel } from "./models/platformResourceDefinition"; -import { PlatformResourceEventModel } from "./models/platformResourceEvent"; -import { PlatformResourceInstallationModel } from "./models/platformResourceInstallation"; -import { PlatformResourceStatusCheckModel } from "./models/platformResourceStatusCheck"; -import { PlatformResourceUsageLogModel } from "./models/platformResourceUsageLog"; -import { PlatformResourceUsageSummaryModel } from "./models/platformResourceUsageSummary"; -import { PlatformResourceUtilizationModel } from "./models/platformResourceUtilization"; -import { PlatformResourcesHealthModel } from "./models/platformResourcesHealth"; -import { PlatformResourcesRequirementsStateModel } from "./models/platformResourcesRequirementsState"; -import { PlatformResourcesResolvedRequirementModel } from "./models/platformResourcesResolvedRequirement"; -import { PlatformWebhookEndpointModel } from "./models/platformWebhookEndpoint"; -import { PlatformWebhookEventModel } from "./models/platformWebhookEvent"; -import { ResourceModel } from "./models/resource"; -import { ResourceDeclaredCapacityModel } from "./models/resourceDeclaredCapacity"; -import { ResourceDefinitionModel } from "./models/resourceDefinition"; -import { ResourceEventModel } from "./models/resourceEvent"; -import { ResourceInstallationModel } from "./models/resourceInstallation"; -import { ResourceStatusCheckModel } from "./models/resourceStatusCheck"; -import { ResourceUsageLogModel } from "./models/resourceUsageLog"; -import { ResourceUsageSummaryModel } from "./models/resourceUsageSummary"; -import { ResourceUtilizationModel } from "./models/resourceUtilization"; -import { ResourcesHealthModel } from "./models/resourcesHealth"; -import { ResourcesRequirementsStateModel } from "./models/resourcesRequirementsState"; -import { ResourcesResolvedRequirementModel } from "./models/resourcesResolvedRequirement"; -import { WebhookEndpointModel } from "./models/webhookEndpoint"; -import { WebhookEventModel } from "./models/webhookEvent"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { DbPresetModel } from './models/dbPreset'; +import { FunctionApiBindingModel } from './models/functionApiBinding'; +import { FunctionDefinitionModel } from './models/functionDefinition'; +import { FunctionDeploymentModel } from './models/functionDeployment'; +import { FunctionDeploymentEventModel } from './models/functionDeploymentEvent'; +import { FunctionExecutionLogModel } from './models/functionExecutionLog'; +import { FunctionGraphCommitModel } from './models/functionGraphCommit'; +import { FunctionGraphModel } from './models/functionGraph'; +import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; +import { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; +import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecutionOutput'; +import { FunctionGraphObjectModel } from './models/functionGraphObject'; +import { FunctionGraphRefModel } from './models/functionGraphRef'; +import { FunctionGraphStoreModel } from './models/functionGraphStore'; +import { FunctionInvocationAttemptModel } from './models/functionInvocationAttempt'; +import { FunctionInvocationModel } from './models/functionInvocation'; +import { GetAllTreeNodesRecordModel } from './models/getAllTreeNodesRecord'; +import { InfraCommitModel } from './models/infraCommit'; +import { InfraGetAllTreeNodesRecordModel } from './models/infraGetAllTreeNodesRecord'; +import { InfraObjectModel } from './models/infraObject'; +import { InfraRefModel } from './models/infraRef'; +import { InfraStoreModel } from './models/infraStore'; +import { IntegrationProviderModel } from './models/integrationProvider'; +import { NamespaceModel } from './models/namespace'; +import { NamespaceEventModel } from './models/namespaceEvent'; +import { PlatformFunctionApiBindingModel } from './models/platformFunctionApiBinding'; +import { PlatformFunctionDefinitionModel } from './models/platformFunctionDefinition'; +import { PlatformFunctionDeploymentModel } from './models/platformFunctionDeployment'; +import { PlatformFunctionDeploymentEventModel } from './models/platformFunctionDeploymentEvent'; +import { PlatformFunctionExecutionLogModel } from './models/platformFunctionExecutionLog'; +import { PlatformFunctionInvocationAttemptModel } from './models/platformFunctionInvocationAttempt'; +import { PlatformFunctionInvocationModel } from './models/platformFunctionInvocation'; +import { PlatformInfraCommitModel } from './models/platformInfraCommit'; +import { PlatformInfraGetAllTreeNodesRecordModel } from './models/platformInfraGetAllTreeNodesRecord'; +import { PlatformInfraObjectModel } from './models/platformInfraObject'; +import { PlatformInfraRefModel } from './models/platformInfraRef'; +import { PlatformInfraStoreModel } from './models/platformInfraStore'; +import { PlatformNamespaceModel } from './models/platformNamespace'; +import { PlatformNamespaceEventModel } from './models/platformNamespaceEvent'; +import { PlatformResourceModel } from './models/platformResource'; +import { PlatformResourceDeclaredCapacityModel } from './models/platformResourceDeclaredCapacity'; +import { PlatformResourceDefinitionModel } from './models/platformResourceDefinition'; +import { PlatformResourceEventModel } from './models/platformResourceEvent'; +import { PlatformResourceInstallationModel } from './models/platformResourceInstallation'; +import { PlatformResourceStatusCheckModel } from './models/platformResourceStatusCheck'; +import { PlatformResourceUsageLogModel } from './models/platformResourceUsageLog'; +import { PlatformResourceUsageSummaryModel } from './models/platformResourceUsageSummary'; +import { PlatformResourceUtilizationModel } from './models/platformResourceUtilization'; +import { PlatformResourcesHealthModel } from './models/platformResourcesHealth'; +import { PlatformResourcesRequirementsStateModel } from './models/platformResourcesRequirementsState'; +import { PlatformResourcesResolvedRequirementModel } from './models/platformResourcesResolvedRequirement'; +import { PlatformWebhookEndpointModel } from './models/platformWebhookEndpoint'; +import { PlatformWebhookEventModel } from './models/platformWebhookEvent'; +import { ResourceModel } from './models/resource'; +import { ResourceDeclaredCapacityModel } from './models/resourceDeclaredCapacity'; +import { ResourceDefinitionModel } from './models/resourceDefinition'; +import { ResourceEventModel } from './models/resourceEvent'; +import { ResourceInstallationModel } from './models/resourceInstallation'; +import { ResourceStatusCheckModel } from './models/resourceStatusCheck'; +import { ResourceUsageLogModel } from './models/resourceUsageLog'; +import { ResourceUsageSummaryModel } from './models/resourceUsageSummary'; +import { ResourceUtilizationModel } from './models/resourceUtilization'; +import { ResourcesHealthModel } from './models/resourcesHealth'; +import { ResourcesRequirementsStateModel } from './models/resourcesRequirementsState'; +import { ResourcesResolvedRequirementModel } from './models/resourcesResolvedRequirement'; +import { WebhookEndpointModel } from './models/webhookEndpoint'; +import { WebhookEventModel } from './models/webhookEvent'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -175,6 +175,6 @@ export function createClient(config: OrmClientConfig) { webhookEndpoint: new WebhookEndpointModel(client), webhookEvent: new WebhookEventModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/input-types.ts b/sdk/constructive-react/src/compute/orm/input-types.ts index 24e4a3d10c..6ff0184126 100644 --- a/sdk/constructive-react/src/compute/orm/input-types.ts +++ b/sdk/constructive-react/src/compute/orm/input-types.ts @@ -2038,67 +2038,102 @@ export type DbPresetWithRelations = DbPreset & DbPresetRelations; export type FunctionApiBindingWithRelations = FunctionApiBinding & FunctionApiBindingRelations; export type FunctionDefinitionWithRelations = FunctionDefinition & FunctionDefinitionRelations; export type FunctionDeploymentWithRelations = FunctionDeployment & FunctionDeploymentRelations; -export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & FunctionDeploymentEventRelations; -export type FunctionExecutionLogWithRelations = FunctionExecutionLog & FunctionExecutionLogRelations; +export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & + FunctionDeploymentEventRelations; +export type FunctionExecutionLogWithRelations = FunctionExecutionLog & + FunctionExecutionLogRelations; export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGraphCommitRelations; export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; -export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & FunctionGraphExecutionRelations; -export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & FunctionGraphExecutionNodeStateRelations; -export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & FunctionGraphExecutionOutputRelations; +export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & + FunctionGraphExecutionRelations; +export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & + FunctionGraphExecutionNodeStateRelations; +export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & + FunctionGraphExecutionOutputRelations; export type FunctionGraphObjectWithRelations = FunctionGraphObject & FunctionGraphObjectRelations; export type FunctionGraphRefWithRelations = FunctionGraphRef & FunctionGraphRefRelations; export type FunctionGraphStoreWithRelations = FunctionGraphStore & FunctionGraphStoreRelations; -export type FunctionInvocationAttemptWithRelations = FunctionInvocationAttempt & FunctionInvocationAttemptRelations; +export type FunctionInvocationAttemptWithRelations = FunctionInvocationAttempt & + FunctionInvocationAttemptRelations; export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; -export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & GetAllTreeNodesRecordRelations; +export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & + GetAllTreeNodesRecordRelations; export type InfraCommitWithRelations = InfraCommit & InfraCommitRelations; -export type InfraGetAllTreeNodesRecordWithRelations = InfraGetAllTreeNodesRecord & InfraGetAllTreeNodesRecordRelations; +export type InfraGetAllTreeNodesRecordWithRelations = InfraGetAllTreeNodesRecord & + InfraGetAllTreeNodesRecordRelations; export type InfraObjectWithRelations = InfraObject & InfraObjectRelations; export type InfraRefWithRelations = InfraRef & InfraRefRelations; export type InfraStoreWithRelations = InfraStore & InfraStoreRelations; export type IntegrationProviderWithRelations = IntegrationProvider & IntegrationProviderRelations; export type NamespaceWithRelations = Namespace & NamespaceRelations; export type NamespaceEventWithRelations = NamespaceEvent & NamespaceEventRelations; -export type PlatformFunctionApiBindingWithRelations = PlatformFunctionApiBinding & PlatformFunctionApiBindingRelations; -export type PlatformFunctionDefinitionWithRelations = PlatformFunctionDefinition & PlatformFunctionDefinitionRelations; -export type PlatformFunctionDeploymentWithRelations = PlatformFunctionDeployment & PlatformFunctionDeploymentRelations; -export type PlatformFunctionDeploymentEventWithRelations = PlatformFunctionDeploymentEvent & PlatformFunctionDeploymentEventRelations; -export type PlatformFunctionExecutionLogWithRelations = PlatformFunctionExecutionLog & PlatformFunctionExecutionLogRelations; -export type PlatformFunctionInvocationAttemptWithRelations = PlatformFunctionInvocationAttempt & PlatformFunctionInvocationAttemptRelations; -export type PlatformFunctionInvocationWithRelations = PlatformFunctionInvocation & PlatformFunctionInvocationRelations; +export type PlatformFunctionApiBindingWithRelations = PlatformFunctionApiBinding & + PlatformFunctionApiBindingRelations; +export type PlatformFunctionDefinitionWithRelations = PlatformFunctionDefinition & + PlatformFunctionDefinitionRelations; +export type PlatformFunctionDeploymentWithRelations = PlatformFunctionDeployment & + PlatformFunctionDeploymentRelations; +export type PlatformFunctionDeploymentEventWithRelations = PlatformFunctionDeploymentEvent & + PlatformFunctionDeploymentEventRelations; +export type PlatformFunctionExecutionLogWithRelations = PlatformFunctionExecutionLog & + PlatformFunctionExecutionLogRelations; +export type PlatformFunctionInvocationAttemptWithRelations = PlatformFunctionInvocationAttempt & + PlatformFunctionInvocationAttemptRelations; +export type PlatformFunctionInvocationWithRelations = PlatformFunctionInvocation & + PlatformFunctionInvocationRelations; export type PlatformInfraCommitWithRelations = PlatformInfraCommit & PlatformInfraCommitRelations; -export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & PlatformInfraGetAllTreeNodesRecordRelations; +export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & + PlatformInfraGetAllTreeNodesRecordRelations; export type PlatformInfraObjectWithRelations = PlatformInfraObject & PlatformInfraObjectRelations; export type PlatformInfraRefWithRelations = PlatformInfraRef & PlatformInfraRefRelations; export type PlatformInfraStoreWithRelations = PlatformInfraStore & PlatformInfraStoreRelations; export type PlatformNamespaceWithRelations = PlatformNamespace & PlatformNamespaceRelations; -export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & PlatformNamespaceEventRelations; +export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & + PlatformNamespaceEventRelations; export type PlatformResourceWithRelations = PlatformResource & PlatformResourceRelations; -export type PlatformResourceDeclaredCapacityWithRelations = PlatformResourceDeclaredCapacity & PlatformResourceDeclaredCapacityRelations; -export type PlatformResourceDefinitionWithRelations = PlatformResourceDefinition & PlatformResourceDefinitionRelations; -export type PlatformResourceEventWithRelations = PlatformResourceEvent & PlatformResourceEventRelations; -export type PlatformResourceInstallationWithRelations = PlatformResourceInstallation & PlatformResourceInstallationRelations; -export type PlatformResourceStatusCheckWithRelations = PlatformResourceStatusCheck & PlatformResourceStatusCheckRelations; -export type PlatformResourceUsageLogWithRelations = PlatformResourceUsageLog & PlatformResourceUsageLogRelations; -export type PlatformResourceUsageSummaryWithRelations = PlatformResourceUsageSummary & PlatformResourceUsageSummaryRelations; -export type PlatformResourceUtilizationWithRelations = PlatformResourceUtilization & PlatformResourceUtilizationRelations; -export type PlatformResourcesHealthWithRelations = PlatformResourcesHealth & PlatformResourcesHealthRelations; -export type PlatformResourcesRequirementsStateWithRelations = PlatformResourcesRequirementsState & PlatformResourcesRequirementsStateRelations; -export type PlatformResourcesResolvedRequirementWithRelations = PlatformResourcesResolvedRequirement & PlatformResourcesResolvedRequirementRelations; -export type PlatformWebhookEndpointWithRelations = PlatformWebhookEndpoint & PlatformWebhookEndpointRelations; -export type PlatformWebhookEventWithRelations = PlatformWebhookEvent & PlatformWebhookEventRelations; +export type PlatformResourceDeclaredCapacityWithRelations = PlatformResourceDeclaredCapacity & + PlatformResourceDeclaredCapacityRelations; +export type PlatformResourceDefinitionWithRelations = PlatformResourceDefinition & + PlatformResourceDefinitionRelations; +export type PlatformResourceEventWithRelations = PlatformResourceEvent & + PlatformResourceEventRelations; +export type PlatformResourceInstallationWithRelations = PlatformResourceInstallation & + PlatformResourceInstallationRelations; +export type PlatformResourceStatusCheckWithRelations = PlatformResourceStatusCheck & + PlatformResourceStatusCheckRelations; +export type PlatformResourceUsageLogWithRelations = PlatformResourceUsageLog & + PlatformResourceUsageLogRelations; +export type PlatformResourceUsageSummaryWithRelations = PlatformResourceUsageSummary & + PlatformResourceUsageSummaryRelations; +export type PlatformResourceUtilizationWithRelations = PlatformResourceUtilization & + PlatformResourceUtilizationRelations; +export type PlatformResourcesHealthWithRelations = PlatformResourcesHealth & + PlatformResourcesHealthRelations; +export type PlatformResourcesRequirementsStateWithRelations = PlatformResourcesRequirementsState & + PlatformResourcesRequirementsStateRelations; +export type PlatformResourcesResolvedRequirementWithRelations = + PlatformResourcesResolvedRequirement & PlatformResourcesResolvedRequirementRelations; +export type PlatformWebhookEndpointWithRelations = PlatformWebhookEndpoint & + PlatformWebhookEndpointRelations; +export type PlatformWebhookEventWithRelations = PlatformWebhookEvent & + PlatformWebhookEventRelations; export type ResourceWithRelations = Resource & ResourceRelations; -export type ResourceDeclaredCapacityWithRelations = ResourceDeclaredCapacity & ResourceDeclaredCapacityRelations; +export type ResourceDeclaredCapacityWithRelations = ResourceDeclaredCapacity & + ResourceDeclaredCapacityRelations; export type ResourceDefinitionWithRelations = ResourceDefinition & ResourceDefinitionRelations; export type ResourceEventWithRelations = ResourceEvent & ResourceEventRelations; -export type ResourceInstallationWithRelations = ResourceInstallation & ResourceInstallationRelations; +export type ResourceInstallationWithRelations = ResourceInstallation & + ResourceInstallationRelations; export type ResourceStatusCheckWithRelations = ResourceStatusCheck & ResourceStatusCheckRelations; export type ResourceUsageLogWithRelations = ResourceUsageLog & ResourceUsageLogRelations; -export type ResourceUsageSummaryWithRelations = ResourceUsageSummary & ResourceUsageSummaryRelations; +export type ResourceUsageSummaryWithRelations = ResourceUsageSummary & + ResourceUsageSummaryRelations; export type ResourceUtilizationWithRelations = ResourceUtilization & ResourceUtilizationRelations; export type ResourcesHealthWithRelations = ResourcesHealth & ResourcesHealthRelations; -export type ResourcesRequirementsStateWithRelations = ResourcesRequirementsState & ResourcesRequirementsStateRelations; -export type ResourcesResolvedRequirementWithRelations = ResourcesResolvedRequirement & ResourcesResolvedRequirementRelations; +export type ResourcesRequirementsStateWithRelations = ResourcesRequirementsState & + ResourcesRequirementsStateRelations; +export type ResourcesResolvedRequirementWithRelations = ResourcesResolvedRequirement & + ResourcesResolvedRequirementRelations; export type WebhookEndpointWithRelations = WebhookEndpoint & WebhookEndpointRelations; export type WebhookEventWithRelations = WebhookEvent & WebhookEventRelations; // ============ Entity Select Types ============ @@ -5659,73 +5694,1942 @@ export interface WebhookEventFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type DbPresetOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MODULES_HASH_ASC" | "MODULES_HASH_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type FunctionApiBindingOrderBy = "ALIAS_ASC" | "ALIAS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type FunctionDefinitionOrderBy = "ACCESS_CHANNELS_ASC" | "ACCESS_CHANNELS_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FN_CATEGORY_ASC" | "FN_CATEGORY_DESC" | "FUNCTION_COLUMNS_ASC" | "FUNCTION_COLUMNS_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "INPUTS_ASC" | "INPUTS_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "MAX_ATTEMPTS_ASC" | "MAX_ATTEMPTS_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MODULE_TABLE_ASC" | "MODULE_TABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUTPUTS_ASC" | "OUTPUTS_DESC" | "PAYLOAD_ARGS_ASC" | "PAYLOAD_ARGS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "PROPS_ASC" | "PROPS_DESC" | "PROTECTED_ASC" | "PROTECTED_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "QUEUE_NAME_ASC" | "QUEUE_NAME_DESC" | "REQUIRED_BUCKETS_ASC" | "REQUIRED_BUCKETS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_MODELS_ASC" | "REQUIRED_MODELS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RUNTIME_ASC" | "RUNTIME_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "TARGET_FUNCTION_ASC" | "TARGET_FUNCTION_DESC" | "TARGET_SCHEMA_ASC" | "TARGET_SCHEMA_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VOLATILE_ASC" | "VOLATILE_DESC"; -export type FunctionDeploymentOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "HANDLER_NAME_ASC" | "HANDLER_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "IMAGE_VERSION_ASC" | "IMAGE_VERSION_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_AT_ASC" | "LAST_ERROR_AT_DESC" | "LAST_ERROR_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SERVICE_NAME_ASC" | "SERVICE_NAME_DESC" | "SERVICE_URL_ASC" | "SERVICE_URL_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type FunctionDeploymentEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYMENT_ID_ASC" | "DEPLOYMENT_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type FunctionExecutionLogOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LOG_LEVEL_ASC" | "LOG_LEVEL_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type FunctionGraphCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type FunctionGraphOrderBy = "CONTEXT_ASC" | "CONTEXT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DEFINITIONS_COMMIT_ID_ASC" | "DEFINITIONS_COMMIT_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_VALID_ASC" | "IS_VALID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALIDATION_ERRORS_ASC" | "VALIDATION_ERRORS_DESC"; -export type FunctionGraphExecutionOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CURRENT_WAVE_ASC" | "CURRENT_WAVE_DESC" | "DEFINITIONS_COMMIT_ID_ASC" | "DEFINITIONS_COMMIT_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ERROR_CODE_ASC" | "ERROR_CODE_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXECUTION_PLAN_ASC" | "EXECUTION_PLAN_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ID_ASC" | "ID_DESC" | "INPUT_PAYLOAD_ASC" | "INPUT_PAYLOAD_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LAST_PROGRESS_AT_ASC" | "LAST_PROGRESS_AT_DESC" | "MAX_PENDING_JOBS_ASC" | "MAX_PENDING_JOBS_DESC" | "MAX_TICKS_ASC" | "MAX_TICKS_DESC" | "NATURAL" | "NODE_OUTPUTS_ASC" | "NODE_OUTPUTS_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "OUTPUT_NAMES_ASC" | "OUTPUT_NAMES_DESC" | "OUTPUT_NODE_ASC" | "OUTPUT_NODE_DESC" | "OUTPUT_PAYLOAD_ASC" | "OUTPUT_PAYLOAD_DESC" | "OUTPUT_PORT_ASC" | "OUTPUT_PORT_DESC" | "PARENT_EXECUTION_ID_ASC" | "PARENT_EXECUTION_ID_DESC" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PARENT_NODE_NAME_ASC" | "PARENT_NODE_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TICK_COUNT_ASC" | "TICK_COUNT_DESC" | "TIMEOUT_AT_ASC" | "TIMEOUT_AT_DESC"; -export type FunctionGraphExecutionNodeStateOrderBy = "CALLBACK_INPUTS_ASC" | "CALLBACK_INPUTS_DESC" | "CALLBACK_META_ASC" | "CALLBACK_META_DESC" | "CALLBACK_TOKEN_HASH_ASC" | "CALLBACK_TOKEN_HASH_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ERROR_CODE_ASC" | "ERROR_CODE_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXECUTION_ID_ASC" | "EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODE_NAME_ASC" | "NODE_NAME_DESC" | "NODE_PATH_ASC" | "NODE_PATH_DESC" | "OUTPUT_ID_ASC" | "OUTPUT_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type FunctionGraphExecutionOutputOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionGraphObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionGraphRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type FunctionGraphStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionInvocationAttemptOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ATTEMPT_ASC" | "ATTEMPT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ERROR_DETAIL_ASC" | "ERROR_DETAIL_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type FunctionInvocationOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "API_BINDING_ID_ASC" | "API_BINDING_ID_DESC" | "CHANNEL_ASC" | "CHANNEL_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFINITION_SCOPE_ASC" | "DEFINITION_SCOPE_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "GRAPH_EXECUTION_ID_ASC" | "GRAPH_EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOB_ID_ASC" | "JOB_ID_DESC" | "NATURAL" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVENANCE_ASC" | "PROVENANCE_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type GetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type InfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type InfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type InfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type InfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type InfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type IntegrationProviderOrderBy = "BRAND_ASC" | "BRAND_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "LOGO_ASC" | "LOGO_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionApiBindingOrderBy = "ALIAS_ASC" | "ALIAS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionDefinitionOrderBy = "ACCESS_CHANNELS_ASC" | "ACCESS_CHANNELS_DESC" | "BILLABLE_ASC" | "BILLABLE_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FN_CATEGORY_ASC" | "FN_CATEGORY_DESC" | "FUNCTION_COLUMNS_ASC" | "FUNCTION_COLUMNS_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "INPUTS_ASC" | "INPUTS_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "MAX_ATTEMPTS_ASC" | "MAX_ATTEMPTS_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MODULE_TABLE_ASC" | "MODULE_TABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUTPUTS_ASC" | "OUTPUTS_DESC" | "PAYLOAD_ARGS_ASC" | "PAYLOAD_ARGS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "PROPS_ASC" | "PROPS_DESC" | "PROTECTED_ASC" | "PROTECTED_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "QUEUE_NAME_ASC" | "QUEUE_NAME_DESC" | "REQUIRED_BUCKETS_ASC" | "REQUIRED_BUCKETS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_MODELS_ASC" | "REQUIRED_MODELS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RUNTIME_ASC" | "RUNTIME_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SYSTEM_ASC" | "SYSTEM_DESC" | "TARGET_FUNCTION_ASC" | "TARGET_FUNCTION_DESC" | "TARGET_SCHEMA_ASC" | "TARGET_SCHEMA_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VOLATILE_ASC" | "VOLATILE_DESC"; -export type PlatformFunctionDeploymentOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "HANDLER_NAME_ASC" | "HANDLER_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "IMAGE_VERSION_ASC" | "IMAGE_VERSION_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_AT_ASC" | "LAST_ERROR_AT_DESC" | "LAST_ERROR_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SERVICE_NAME_ASC" | "SERVICE_NAME_DESC" | "SERVICE_URL_ASC" | "SERVICE_URL_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformFunctionDeploymentEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEPLOYMENT_ID_ASC" | "DEPLOYMENT_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionExecutionLogOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LOG_LEVEL_ASC" | "LOG_LEVEL_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformFunctionInvocationAttemptOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ATTEMPT_ASC" | "ATTEMPT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ERROR_DETAIL_ASC" | "ERROR_DETAIL_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformFunctionInvocationOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "API_BINDING_ID_ASC" | "API_BINDING_ID_DESC" | "CHANNEL_ASC" | "CHANNEL_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_SCOPE_ASC" | "DEFINITION_SCOPE_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "GRAPH_EXECUTION_ID_ASC" | "GRAPH_EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOB_ID_ASC" | "JOB_ID_DESC" | "NATURAL" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVENANCE_ASC" | "PROVENANCE_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformInfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type PlatformInfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type PlatformInfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformInfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type PlatformInfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformNamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformNamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformResourceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceDeclaredCapacityOrderBy = "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "IS_TRANSIENT_ASC" | "IS_TRANSIENT_DESC" | "KIND_ASC" | "KIND_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "POD_COUNT_MAX_ASC" | "POD_COUNT_MAX_DESC" | "POD_COUNT_MIN_ASC" | "POD_COUNT_MIN_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "SOURCE_ID_ASC" | "SOURCE_ID_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC"; -export type PlatformResourceDefinitionOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DEFAULT_SPEC_ASC" | "DEFAULT_SPEC_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STEP_UP_MIN_AGE_ASC" | "STEP_UP_MIN_AGE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC"; -export type PlatformResourceInstallationOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMS_ASC" | "PARAMS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceStatusCheckOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUESTED_AT_ASC" | "REQUESTED_AT_DESC" | "REQUESTED_BY_ASC" | "REQUESTED_BY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type PlatformResourceUsageLogOrderBy = "CPU_MILLICORES_ASC" | "CPU_MILLICORES_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_SECONDS_ASC" | "INTERVAL_SECONDS_DESC" | "MEMORY_BYTES_ASC" | "MEMORY_BYTES_DESC" | "METRICS_ASC" | "METRICS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SAMPLED_AT_ASC" | "SAMPLED_AT_DESC" | "SOURCE_ASC" | "SOURCE_DESC"; -export type PlatformResourceUsageSummaryOrderBy = "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "ID_ASC" | "ID_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type PlatformResourceUtilizationOrderBy = "AVG_MEMORY_BYTES_ASC" | "AVG_MEMORY_BYTES_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_PEAK_UTILIZATION_ASC" | "CPU_PEAK_UTILIZATION_DESC" | "CPU_REQUEST_HEADROOM_MILLICORES_ASC" | "CPU_REQUEST_HEADROOM_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "KIND_ASC" | "KIND_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_PEAK_UTILIZATION_ASC" | "MEMORY_PEAK_UTILIZATION_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MEMORY_REQUEST_HEADROOM_BYTES_ASC" | "MEMORY_REQUEST_HEADROOM_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type PlatformResourcesHealthOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_DETAIL_ASC" | "STATUS_DETAIL_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourcesRequirementsStateOrderBy = "CONFIG_HASH_ASC" | "CONFIG_HASH_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NATURAL" | "REQUIREMENTS_HASH_ASC" | "REQUIREMENTS_HASH_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_HASH_ASC" | "SECRETS_HASH_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type PlatformResourcesResolvedRequirementOrderBy = "ATOM_ID_ASC" | "ATOM_ID_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRESENT_ASC" | "PRESENT_DESC" | "REQUIRED_ASC" | "REQUIRED_DESC" | "REQUIREMENT_KIND_ASC" | "REQUIREMENT_KIND_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type PlatformWebhookEndpointOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "HOST_ASC" | "HOST_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "REPLAY_WINDOW_SECONDS_ASC" | "REPLAY_WINDOW_SECONDS_DESC" | "SIGNING_SECRET_NAME_ASC" | "SIGNING_SECRET_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformWebhookEventOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENDPOINT_ID_ASC" | "ENDPOINT_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXTERNAL_EVENT_ID_ASC" | "EXTERNAL_EVENT_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVIDER_TIMESTAMP_ASC" | "PROVIDER_TIMESTAMP_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ResourceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceDeclaredCapacityOrderBy = "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "IS_TRANSIENT_ASC" | "IS_TRANSIENT_DESC" | "KIND_ASC" | "KIND_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "POD_COUNT_MAX_ASC" | "POD_COUNT_MAX_DESC" | "POD_COUNT_MIN_ASC" | "POD_COUNT_MIN_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "SOURCE_ID_ASC" | "SOURCE_ID_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC"; -export type ResourceDefinitionOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_SPEC_ASC" | "DEFAULT_SPEC_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STEP_UP_MIN_AGE_ASC" | "STEP_UP_MIN_AGE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC"; -export type ResourceInstallationOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMS_ASC" | "PARAMS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceStatusCheckOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUESTED_AT_ASC" | "REQUESTED_AT_DESC" | "REQUESTED_BY_ASC" | "REQUESTED_BY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type ResourceUsageLogOrderBy = "CPU_MILLICORES_ASC" | "CPU_MILLICORES_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_SECONDS_ASC" | "INTERVAL_SECONDS_DESC" | "MEMORY_BYTES_ASC" | "MEMORY_BYTES_DESC" | "METRICS_ASC" | "METRICS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SAMPLED_AT_ASC" | "SAMPLED_AT_DESC" | "SOURCE_ASC" | "SOURCE_DESC"; -export type ResourceUsageSummaryOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "ID_ASC" | "ID_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type ResourceUtilizationOrderBy = "AVG_MEMORY_BYTES_ASC" | "AVG_MEMORY_BYTES_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_PEAK_UTILIZATION_ASC" | "CPU_PEAK_UTILIZATION_DESC" | "CPU_REQUEST_HEADROOM_MILLICORES_ASC" | "CPU_REQUEST_HEADROOM_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "KIND_ASC" | "KIND_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_PEAK_UTILIZATION_ASC" | "MEMORY_PEAK_UTILIZATION_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MEMORY_REQUEST_HEADROOM_BYTES_ASC" | "MEMORY_REQUEST_HEADROOM_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type ResourcesHealthOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_DETAIL_ASC" | "STATUS_DETAIL_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourcesRequirementsStateOrderBy = "CONFIG_HASH_ASC" | "CONFIG_HASH_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NATURAL" | "REQUIREMENTS_HASH_ASC" | "REQUIREMENTS_HASH_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_HASH_ASC" | "SECRETS_HASH_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type ResourcesResolvedRequirementOrderBy = "ATOM_ID_ASC" | "ATOM_ID_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRESENT_ASC" | "PRESENT_DESC" | "REQUIRED_ASC" | "REQUIRED_DESC" | "REQUIREMENT_KIND_ASC" | "REQUIREMENT_KIND_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type WebhookEndpointOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "HOST_ASC" | "HOST_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "REPLAY_WINDOW_SECONDS_ASC" | "REPLAY_WINDOW_SECONDS_DESC" | "SIGNING_SECRET_NAME_ASC" | "SIGNING_SECRET_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type WebhookEventOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENDPOINT_ID_ASC" | "ENDPOINT_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXTERNAL_EVENT_ID_ASC" | "EXTERNAL_EVENT_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVIDER_TIMESTAMP_ASC" | "PROVIDER_TIMESTAMP_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DbPresetOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MODULES_HASH_ASC' + | 'MODULES_HASH_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type FunctionApiBindingOrderBy = + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type FunctionDefinitionOrderBy = + | 'ACCESS_CHANNELS_ASC' + | 'ACCESS_CHANNELS_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FN_CATEGORY_ASC' + | 'FN_CATEGORY_DESC' + | 'FUNCTION_COLUMNS_ASC' + | 'FUNCTION_COLUMNS_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MODULE_TABLE_ASC' + | 'MODULE_TABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PAYLOAD_ARGS_ASC' + | 'PAYLOAD_ARGS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'PROTECTED_ASC' + | 'PROTECTED_DESC' + | 'PUBLISHED_AT_ASC' + | 'PUBLISHED_AT_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'TARGET_FUNCTION_ASC' + | 'TARGET_FUNCTION_DESC' + | 'TARGET_SCHEMA_ASC' + | 'TARGET_SCHEMA_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC'; +export type FunctionDeploymentOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'HANDLER_NAME_ASC' + | 'HANDLER_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'IMAGE_VERSION_ASC' + | 'IMAGE_VERSION_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type FunctionDeploymentEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type FunctionExecutionLogOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type FunctionGraphCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type FunctionGraphOrderBy = + | 'CONTEXT_ASC' + | 'CONTEXT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VALID_ASC' + | 'IS_VALID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALIDATION_ERRORS_ASC' + | 'VALIDATION_ERRORS_DESC'; +export type FunctionGraphExecutionOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CURRENT_WAVE_ASC' + | 'CURRENT_WAVE_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXECUTION_PLAN_ASC' + | 'EXECUTION_PLAN_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INPUT_PAYLOAD_ASC' + | 'INPUT_PAYLOAD_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LAST_PROGRESS_AT_ASC' + | 'LAST_PROGRESS_AT_DESC' + | 'MAX_PENDING_JOBS_ASC' + | 'MAX_PENDING_JOBS_DESC' + | 'MAX_TICKS_ASC' + | 'MAX_TICKS_DESC' + | 'NATURAL' + | 'NODE_OUTPUTS_ASC' + | 'NODE_OUTPUTS_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'OUTPUT_NAMES_ASC' + | 'OUTPUT_NAMES_DESC' + | 'OUTPUT_NODE_ASC' + | 'OUTPUT_NODE_DESC' + | 'OUTPUT_PAYLOAD_ASC' + | 'OUTPUT_PAYLOAD_DESC' + | 'OUTPUT_PORT_ASC' + | 'OUTPUT_PORT_DESC' + | 'PARENT_EXECUTION_ID_ASC' + | 'PARENT_EXECUTION_ID_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PARENT_NODE_NAME_ASC' + | 'PARENT_NODE_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TICK_COUNT_ASC' + | 'TICK_COUNT_DESC' + | 'TIMEOUT_AT_ASC' + | 'TIMEOUT_AT_DESC'; +export type FunctionGraphExecutionNodeStateOrderBy = + | 'CALLBACK_INPUTS_ASC' + | 'CALLBACK_INPUTS_DESC' + | 'CALLBACK_META_ASC' + | 'CALLBACK_META_DESC' + | 'CALLBACK_TOKEN_HASH_ASC' + | 'CALLBACK_TOKEN_HASH_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXECUTION_ID_ASC' + | 'EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODE_NAME_ASC' + | 'NODE_NAME_DESC' + | 'NODE_PATH_ASC' + | 'NODE_PATH_DESC' + | 'OUTPUT_ID_ASC' + | 'OUTPUT_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type FunctionGraphExecutionOutputOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionGraphObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionGraphRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type FunctionGraphStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionInvocationAttemptOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ATTEMPT_ASC' + | 'ATTEMPT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ERROR_DETAIL_ASC' + | 'ERROR_DETAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type FunctionInvocationOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'API_BINDING_ID_ASC' + | 'API_BINDING_ID_DESC' + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFINITION_SCOPE_ASC' + | 'DEFINITION_SCOPE_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'NATURAL' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVENANCE_ASC' + | 'PROVENANCE_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type GetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type InfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type InfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type InfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type InfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type InfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type IntegrationProviderOrderBy = + | 'BRAND_ASC' + | 'BRAND_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LOGO_ASC' + | 'LOGO_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionApiBindingOrderBy = + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionDefinitionOrderBy = + | 'ACCESS_CHANNELS_ASC' + | 'ACCESS_CHANNELS_DESC' + | 'BILLABLE_ASC' + | 'BILLABLE_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FN_CATEGORY_ASC' + | 'FN_CATEGORY_DESC' + | 'FUNCTION_COLUMNS_ASC' + | 'FUNCTION_COLUMNS_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MODULE_TABLE_ASC' + | 'MODULE_TABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PAYLOAD_ARGS_ASC' + | 'PAYLOAD_ARGS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'PROTECTED_ASC' + | 'PROTECTED_DESC' + | 'PUBLISHED_AT_ASC' + | 'PUBLISHED_AT_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SYSTEM_ASC' + | 'SYSTEM_DESC' + | 'TARGET_FUNCTION_ASC' + | 'TARGET_FUNCTION_DESC' + | 'TARGET_SCHEMA_ASC' + | 'TARGET_SCHEMA_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC'; +export type PlatformFunctionDeploymentOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'HANDLER_NAME_ASC' + | 'HANDLER_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'IMAGE_VERSION_ASC' + | 'IMAGE_VERSION_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformFunctionDeploymentEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionExecutionLogOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformFunctionInvocationAttemptOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ATTEMPT_ASC' + | 'ATTEMPT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ERROR_DETAIL_ASC' + | 'ERROR_DETAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformFunctionInvocationOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'API_BINDING_ID_ASC' + | 'API_BINDING_ID_DESC' + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_SCOPE_ASC' + | 'DEFINITION_SCOPE_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'NATURAL' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVENANCE_ASC' + | 'PROVENANCE_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformInfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type PlatformInfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type PlatformInfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformInfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type PlatformInfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformNamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformNamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformResourceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceDeclaredCapacityOrderBy = + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'IS_TRANSIENT_ASC' + | 'IS_TRANSIENT_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'POD_COUNT_MAX_ASC' + | 'POD_COUNT_MAX_DESC' + | 'POD_COUNT_MIN_ASC' + | 'POD_COUNT_MIN_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'SOURCE_ID_ASC' + | 'SOURCE_ID_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC'; +export type PlatformResourceDefinitionOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DEFAULT_SPEC_ASC' + | 'DEFAULT_SPEC_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STEP_UP_MIN_AGE_ASC' + | 'STEP_UP_MIN_AGE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC'; +export type PlatformResourceInstallationOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMS_ASC' + | 'PARAMS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceStatusCheckOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUESTED_AT_ASC' + | 'REQUESTED_AT_DESC' + | 'REQUESTED_BY_ASC' + | 'REQUESTED_BY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type PlatformResourceUsageLogOrderBy = + | 'CPU_MILLICORES_ASC' + | 'CPU_MILLICORES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_SECONDS_ASC' + | 'INTERVAL_SECONDS_DESC' + | 'MEMORY_BYTES_ASC' + | 'MEMORY_BYTES_DESC' + | 'METRICS_ASC' + | 'METRICS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SAMPLED_AT_ASC' + | 'SAMPLED_AT_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC'; +export type PlatformResourceUsageSummaryOrderBy = + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type PlatformResourceUtilizationOrderBy = + | 'AVG_MEMORY_BYTES_ASC' + | 'AVG_MEMORY_BYTES_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_PEAK_UTILIZATION_ASC' + | 'CPU_PEAK_UTILIZATION_DESC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_ASC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_PEAK_UTILIZATION_ASC' + | 'MEMORY_PEAK_UTILIZATION_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_ASC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type PlatformResourcesHealthOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_DETAIL_ASC' + | 'STATUS_DETAIL_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourcesRequirementsStateOrderBy = + | 'CONFIG_HASH_ASC' + | 'CONFIG_HASH_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NATURAL' + | 'REQUIREMENTS_HASH_ASC' + | 'REQUIREMENTS_HASH_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_HASH_ASC' + | 'SECRETS_HASH_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type PlatformResourcesResolvedRequirementOrderBy = + | 'ATOM_ID_ASC' + | 'ATOM_ID_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRESENT_ASC' + | 'PRESENT_DESC' + | 'REQUIRED_ASC' + | 'REQUIRED_DESC' + | 'REQUIREMENT_KIND_ASC' + | 'REQUIREMENT_KIND_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type PlatformWebhookEndpointOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'HOST_ASC' + | 'HOST_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'REPLAY_WINDOW_SECONDS_ASC' + | 'REPLAY_WINDOW_SECONDS_DESC' + | 'SIGNING_SECRET_NAME_ASC' + | 'SIGNING_SECRET_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformWebhookEventOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENDPOINT_ID_ASC' + | 'ENDPOINT_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXTERNAL_EVENT_ID_ASC' + | 'EXTERNAL_EVENT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVIDER_TIMESTAMP_ASC' + | 'PROVIDER_TIMESTAMP_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ResourceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceDeclaredCapacityOrderBy = + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'IS_TRANSIENT_ASC' + | 'IS_TRANSIENT_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'POD_COUNT_MAX_ASC' + | 'POD_COUNT_MAX_DESC' + | 'POD_COUNT_MIN_ASC' + | 'POD_COUNT_MIN_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'SOURCE_ID_ASC' + | 'SOURCE_ID_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC'; +export type ResourceDefinitionOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_SPEC_ASC' + | 'DEFAULT_SPEC_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STEP_UP_MIN_AGE_ASC' + | 'STEP_UP_MIN_AGE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC'; +export type ResourceInstallationOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMS_ASC' + | 'PARAMS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceStatusCheckOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUESTED_AT_ASC' + | 'REQUESTED_AT_DESC' + | 'REQUESTED_BY_ASC' + | 'REQUESTED_BY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type ResourceUsageLogOrderBy = + | 'CPU_MILLICORES_ASC' + | 'CPU_MILLICORES_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_SECONDS_ASC' + | 'INTERVAL_SECONDS_DESC' + | 'MEMORY_BYTES_ASC' + | 'MEMORY_BYTES_DESC' + | 'METRICS_ASC' + | 'METRICS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SAMPLED_AT_ASC' + | 'SAMPLED_AT_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC'; +export type ResourceUsageSummaryOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type ResourceUtilizationOrderBy = + | 'AVG_MEMORY_BYTES_ASC' + | 'AVG_MEMORY_BYTES_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_PEAK_UTILIZATION_ASC' + | 'CPU_PEAK_UTILIZATION_DESC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_ASC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_PEAK_UTILIZATION_ASC' + | 'MEMORY_PEAK_UTILIZATION_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_ASC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type ResourcesHealthOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_DETAIL_ASC' + | 'STATUS_DETAIL_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourcesRequirementsStateOrderBy = + | 'CONFIG_HASH_ASC' + | 'CONFIG_HASH_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NATURAL' + | 'REQUIREMENTS_HASH_ASC' + | 'REQUIREMENTS_HASH_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_HASH_ASC' + | 'SECRETS_HASH_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type ResourcesResolvedRequirementOrderBy = + | 'ATOM_ID_ASC' + | 'ATOM_ID_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRESENT_ASC' + | 'PRESENT_DESC' + | 'REQUIRED_ASC' + | 'REQUIRED_DESC' + | 'REQUIREMENT_KIND_ASC' + | 'REQUIREMENT_KIND_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type WebhookEndpointOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'HOST_ASC' + | 'HOST_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'REPLAY_WINDOW_SECONDS_ASC' + | 'REPLAY_WINDOW_SECONDS_DESC' + | 'SIGNING_SECRET_NAME_ASC' + | 'SIGNING_SECRET_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type WebhookEventOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENDPOINT_ID_ASC' + | 'ENDPOINT_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXTERNAL_EVENT_ID_ASC' + | 'EXTERNAL_EVENT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVIDER_TIMESTAMP_ASC' + | 'PROVIDER_TIMESTAMP_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateDbPresetInput { clientMutationId?: string; @@ -8206,62 +10110,62 @@ export interface DeleteWebhookEventInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "FunctionApiBinding": { - "functionInvocationsByApiBindingId": "FunctionInvocation" + FunctionApiBinding: { + functionInvocationsByApiBindingId: 'FunctionInvocation', }, - "FunctionDefinition": { - "functionApiBindings": "FunctionApiBinding", - "webhookEndpoints": "WebhookEndpoint" + FunctionDefinition: { + functionApiBindings: 'FunctionApiBinding', + webhookEndpoints: 'WebhookEndpoint', }, - "FunctionGraph": { - "functionGraphExecutionsByGraphId": "FunctionGraphExecution", - "platformFunctionDefinitionsByGraphId": "PlatformFunctionDefinition" + FunctionGraph: { + functionGraphExecutionsByGraphId: 'FunctionGraphExecution', + platformFunctionDefinitionsByGraphId: 'PlatformFunctionDefinition', }, - "Namespace": { - "functionDeployments": "FunctionDeployment", - "resourceDefinitions": "ResourceDefinition", - "resourceInstallations": "ResourceInstallation", - "resources": "Resource", - "webhookEndpoints": "WebhookEndpoint" + Namespace: { + functionDeployments: 'FunctionDeployment', + resourceDefinitions: 'ResourceDefinition', + resourceInstallations: 'ResourceInstallation', + resources: 'Resource', + webhookEndpoints: 'WebhookEndpoint', }, - "PlatformFunctionApiBinding": { - "platformFunctionInvocationsByApiBindingId": "PlatformFunctionInvocation" + PlatformFunctionApiBinding: { + platformFunctionInvocationsByApiBindingId: 'PlatformFunctionInvocation', }, - "PlatformFunctionDefinition": { - "platformFunctionApiBindingsByFunctionDefinitionId": "PlatformFunctionApiBinding", - "platformWebhookEndpointsByFunctionDefinitionId": "PlatformWebhookEndpoint" + PlatformFunctionDefinition: { + platformFunctionApiBindingsByFunctionDefinitionId: 'PlatformFunctionApiBinding', + platformWebhookEndpointsByFunctionDefinitionId: 'PlatformWebhookEndpoint', }, - "PlatformNamespace": { - "platformFunctionDeploymentsByNamespaceId": "PlatformFunctionDeployment", - "platformResourceDefinitionsByNamespaceId": "PlatformResourceDefinition", - "platformResourceInstallationsByNamespaceId": "PlatformResourceInstallation", - "platformResourcesByNamespaceId": "PlatformResource", - "platformWebhookEndpointsByNamespaceId": "PlatformWebhookEndpoint" + PlatformNamespace: { + platformFunctionDeploymentsByNamespaceId: 'PlatformFunctionDeployment', + platformResourceDefinitionsByNamespaceId: 'PlatformResourceDefinition', + platformResourceInstallationsByNamespaceId: 'PlatformResourceInstallation', + platformResourcesByNamespaceId: 'PlatformResource', + platformWebhookEndpointsByNamespaceId: 'PlatformWebhookEndpoint', }, - "PlatformResource": { - "platformResourceStatusChecksByResourceId": "PlatformResourceStatusCheck" + PlatformResource: { + platformResourceStatusChecksByResourceId: 'PlatformResourceStatusCheck', }, - "PlatformResourceDefinition": { - "platformResourcesByResourceDefinitionId": "PlatformResource" + PlatformResourceDefinition: { + platformResourcesByResourceDefinitionId: 'PlatformResource', }, - "PlatformResourceInstallation": { - "platformResourcesByInstallationId": "PlatformResource" + PlatformResourceInstallation: { + platformResourcesByInstallationId: 'PlatformResource', }, - "PlatformWebhookEndpoint": { - "platformWebhookEventsByEndpointId": "PlatformWebhookEvent" + PlatformWebhookEndpoint: { + platformWebhookEventsByEndpointId: 'PlatformWebhookEvent', }, - "Resource": { - "resourceStatusChecks": "ResourceStatusCheck" + Resource: { + resourceStatusChecks: 'ResourceStatusCheck', }, - "ResourceDefinition": { - "resources": "Resource" + ResourceDefinition: { + resources: 'Resource', }, - "ResourceInstallation": { - "resourcesByInstallationId": "Resource" + ResourceInstallation: { + resourcesByInstallationId: 'Resource', + }, + WebhookEndpoint: { + webhookEventsByEndpointId: 'WebhookEvent', }, - "WebhookEndpoint": { - "webhookEventsByEndpointId": "WebhookEvent" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface AddEdgeInput { @@ -14975,4 +16879,4 @@ export type WebhookEventEdgeSelect = { node?: { select: WebhookEventSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/compute/orm/models/dbPreset.ts b/sdk/constructive-react/src/compute/orm/models/dbPreset.ts index 15b60268b5..a3e824a674 100644 --- a/sdk/constructive-react/src/compute/orm/models/dbPreset.ts +++ b/sdk/constructive-react/src/compute/orm/models/dbPreset.ts @@ -3,56 +3,96 @@ * @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 { DbPreset, DbPresetWithRelations, DbPresetSelect, DbPresetFilter, DbPresetOrderBy, CreateDbPresetInput, UpdateDbPresetInput, DbPresetPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPreset, + DbPresetWithRelations, + DbPresetSelect, + DbPresetFilter, + DbPresetOrderBy, + CreateDbPresetInput, + UpdateDbPresetInput, + DbPresetPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", 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 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + 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, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPresets", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPresets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPreset", "dbPresets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPreset", "createDbPreset", "dbPreset", args.select, args.data, "CreateDbPresetInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPreset', + 'createDbPreset', + 'dbPreset', + args.select, + args.data, + 'CreateDbPresetInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "createDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'createDbPreset', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPreset", "updateDbPreset", "dbPreset", args.select, args.where.id, args.data, "UpdateDbPresetInput", "id", "dbPresetPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPreset', + 'updateDbPreset', + 'dbPreset', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetInput', + 'id', + 'dbPresetPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "updateDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'updateDbPreset', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPreset", "deleteDbPreset", "dbPreset", { - id: args.where.id - }, "DeleteDbPresetInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPreset', + 'deleteDbPreset', + 'dbPreset', + { + id: args.where.id, + }, + 'DeleteDbPresetInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "deleteDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'deleteDbPreset', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionApiBinding.ts b/sdk/constructive-react/src/compute/orm/models/functionApiBinding.ts index 209cd4b4d5..a98f9d2a06 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionApiBinding.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionApiBinding.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionApiBinding, FunctionApiBindingWithRelations, FunctionApiBindingSelect, FunctionApiBindingFilter, FunctionApiBindingOrderBy, CreateFunctionApiBindingInput, UpdateFunctionApiBindingInput, FunctionApiBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionApiBinding, + FunctionApiBindingWithRelations, + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, + CreateFunctionApiBindingInput, + UpdateFunctionApiBindingInput, + FunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionApiBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBindings", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBinding", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionApiBinding": data.functionApiBindings?.nodes?.[0] ?? null - }) + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBinding", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionApiBinding": data.functionApiBindings?.nodes?.[0] ?? null - }) + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionApiBinding", "createFunctionApiBinding", "functionApiBinding", args.select, args.data, "CreateFunctionApiBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionApiBinding', + 'createFunctionApiBinding', + 'functionApiBinding', + args.select, + args.data, + 'CreateFunctionApiBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "createFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'createFunctionApiBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionApiBinding", "updateFunctionApiBinding", "functionApiBinding", args.select, args.where.id, args.data, "UpdateFunctionApiBindingInput", "id", "functionApiBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionApiBinding', + 'updateFunctionApiBinding', + 'functionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdateFunctionApiBindingInput', + 'id', + 'functionApiBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "updateFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'updateFunctionApiBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionApiBinding", "deleteFunctionApiBinding", "functionApiBinding", { - id: args.where.id - }, "DeleteFunctionApiBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionApiBinding', + 'deleteFunctionApiBinding', + 'functionApiBinding', + { + id: args.where.id, + }, + 'DeleteFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "deleteFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'deleteFunctionApiBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionDefinition.ts b/sdk/constructive-react/src/compute/orm/models/functionDefinition.ts index 4ca2f5b29f..be6cb3ac27 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionDefinition.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionDefinition.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDefinition, FunctionDefinitionWithRelations, FunctionDefinitionSelect, FunctionDefinitionFilter, FunctionDefinitionOrderBy, CreateFunctionDefinitionInput, UpdateFunctionDefinitionInput, FunctionDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDefinition, + FunctionDefinitionWithRelations, + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, + CreateFunctionDefinitionInput, + UpdateFunctionDefinitionInput, + FunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinitions", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinition", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDefinition": data.functionDefinitions?.nodes?.[0] ?? null - }) + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinition", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDefinition": data.functionDefinitions?.nodes?.[0] ?? null - }) + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDefinition", "createFunctionDefinition", "functionDefinition", args.select, args.data, "CreateFunctionDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDefinition', + 'createFunctionDefinition', + 'functionDefinition', + args.select, + args.data, + 'CreateFunctionDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "createFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'createFunctionDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDefinition", "updateFunctionDefinition", "functionDefinition", args.select, args.where.id, args.data, "UpdateFunctionDefinitionInput", "id", "functionDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDefinition', + 'updateFunctionDefinition', + 'functionDefinition', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDefinitionInput', + 'id', + 'functionDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "updateFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'updateFunctionDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDefinition", "deleteFunctionDefinition", "functionDefinition", { - id: args.where.id - }, "DeleteFunctionDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDefinition', + 'deleteFunctionDefinition', + 'functionDefinition', + { + id: args.where.id, + }, + 'DeleteFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "deleteFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'deleteFunctionDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionDeployment.ts b/sdk/constructive-react/src/compute/orm/models/functionDeployment.ts index 7470fc406f..d54820ebba 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionDeployment.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionDeployment.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeployment, FunctionDeploymentWithRelations, FunctionDeploymentSelect, FunctionDeploymentFilter, FunctionDeploymentOrderBy, CreateFunctionDeploymentInput, UpdateFunctionDeploymentInput, FunctionDeploymentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeployment, + FunctionDeploymentWithRelations, + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, + CreateFunctionDeploymentInput, + UpdateFunctionDeploymentInput, + FunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployments: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeployment", "functionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployments", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployments', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployment: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeployment", "functionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployment", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeployment": data.functionDeployments?.nodes?.[0] ?? null - }) + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployment: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeployment", "functionDeployments", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployment", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeployment": data.functionDeployments?.nodes?.[0] ?? null - }) + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeployment", "createFunctionDeployment", "functionDeployment", args.select, args.data, "CreateFunctionDeploymentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeployment', + 'createFunctionDeployment', + 'functionDeployment', + args.select, + args.data, + 'CreateFunctionDeploymentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "createFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'createFunctionDeployment', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeployment", "updateFunctionDeployment", "functionDeployment", args.select, args.where.id, args.data, "UpdateFunctionDeploymentInput", "id", "functionDeploymentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeployment', + 'updateFunctionDeployment', + 'functionDeployment', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentInput', + 'id', + 'functionDeploymentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "updateFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'updateFunctionDeployment', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeployment", "deleteFunctionDeployment", "functionDeployment", { - id: args.where.id - }, "DeleteFunctionDeploymentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeployment', + 'deleteFunctionDeployment', + 'functionDeployment', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "deleteFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'deleteFunctionDeployment', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionDeploymentEvent.ts b/sdk/constructive-react/src/compute/orm/models/functionDeploymentEvent.ts index 1f61187c84..6b95be6471 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionDeploymentEvent.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionDeploymentEvent.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeploymentEvent, FunctionDeploymentEventWithRelations, FunctionDeploymentEventSelect, FunctionDeploymentEventFilter, FunctionDeploymentEventOrderBy, CreateFunctionDeploymentEventInput, UpdateFunctionDeploymentEventInput, FunctionDeploymentEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentEvent, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, + CreateFunctionDeploymentEventInput, + UpdateFunctionDeploymentEventInput, + FunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionDeploymentEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvents", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvent", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentEvent": data.functionDeploymentEvents?.nodes?.[0] ?? null - }) + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvent", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentEvent": data.functionDeploymentEvents?.nodes?.[0] ?? null - }) + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeploymentEvent", "createFunctionDeploymentEvent", "functionDeploymentEvent", args.select, args.data, "CreateFunctionDeploymentEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentEvent', + 'createFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.data, + 'CreateFunctionDeploymentEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "createFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'createFunctionDeploymentEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeploymentEvent", "updateFunctionDeploymentEvent", "functionDeploymentEvent", args.select, args.where.id, args.data, "UpdateFunctionDeploymentEventInput", "id", "functionDeploymentEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentEvent', + 'updateFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentEventInput', + 'id', + 'functionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "updateFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'updateFunctionDeploymentEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeploymentEvent", "deleteFunctionDeploymentEvent", "functionDeploymentEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionDeploymentEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentEvent', + 'deleteFunctionDeploymentEvent', + 'functionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "deleteFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'deleteFunctionDeploymentEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionExecutionLog.ts b/sdk/constructive-react/src/compute/orm/models/functionExecutionLog.ts index f1249a036a..a581eeab83 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionExecutionLog.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionExecutionLog.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionExecutionLog, FunctionExecutionLogWithRelations, FunctionExecutionLogSelect, FunctionExecutionLogFilter, FunctionExecutionLogOrderBy, CreateFunctionExecutionLogInput, UpdateFunctionExecutionLogInput, FunctionExecutionLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionExecutionLog, + FunctionExecutionLogWithRelations, + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, + CreateFunctionExecutionLogInput, + UpdateFunctionExecutionLogInput, + FunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionExecutionLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionExecutionLogs: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLogs", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionExecutionLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLog", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionExecutionLog": data.functionExecutionLogs?.nodes?.[0] ?? null - }) + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionExecutionLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLog", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionExecutionLog": data.functionExecutionLogs?.nodes?.[0] ?? null - }) + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionExecutionLog", "createFunctionExecutionLog", "functionExecutionLog", args.select, args.data, "CreateFunctionExecutionLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionExecutionLog', + 'createFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.data, + 'CreateFunctionExecutionLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "createFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'createFunctionExecutionLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionExecutionLog", "updateFunctionExecutionLog", "functionExecutionLog", args.select, args.where.id, args.data, "UpdateFunctionExecutionLogInput", "id", "functionExecutionLogPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionExecutionLog', + 'updateFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateFunctionExecutionLogInput', + 'id', + 'functionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "updateFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'updateFunctionExecutionLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionExecutionLog", "deleteFunctionExecutionLog", "functionExecutionLog", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionExecutionLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionExecutionLog', + 'deleteFunctionExecutionLog', + 'functionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "deleteFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'deleteFunctionExecutionLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraph.ts b/sdk/constructive-react/src/compute/orm/models/functionGraph.ts index b06366eed7..8355e31658 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionGraph.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionGraph.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraph, FunctionGraphWithRelations, FunctionGraphSelect, FunctionGraphFilter, FunctionGraphOrderBy, CreateFunctionGraphInput, UpdateFunctionGraphInput, FunctionGraphPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraph, + FunctionGraphWithRelations, + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy, + CreateFunctionGraphInput, + UpdateFunctionGraphInput, + FunctionGraphPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraph", "functionGraphs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraphs", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraphs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraph: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraph", "functionGraphs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraph", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraph": data.functionGraphs?.nodes?.[0] ?? null - }) + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraph: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraph", "functionGraphs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraph", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionGraphModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraph": data.functionGraphs?.nodes?.[0] ?? null - }) + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraph", "createFunctionGraph", "functionGraph", args.select, args.data, "CreateFunctionGraphInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraph', + 'createFunctionGraph', + 'functionGraph', + args.select, + args.data, + 'CreateFunctionGraphInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "createFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'createFunctionGraph', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraph", "updateFunctionGraph", "functionGraph", args.select, args.where.id, args.data, "UpdateFunctionGraphInput", "id", "functionGraphPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraph', + 'updateFunctionGraph', + 'functionGraph', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphInput', + 'id', + 'functionGraphPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "updateFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'updateFunctionGraph', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraph", "deleteFunctionGraph", "functionGraph", { - id: args.where.id - }, "DeleteFunctionGraphInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraph', + 'deleteFunctionGraph', + 'functionGraph', + { + id: args.where.id, + }, + 'DeleteFunctionGraphInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "deleteFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'deleteFunctionGraph', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphCommit.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphCommit.ts index fc4f86a006..cd7d7dad08 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionGraphCommit.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphCommit.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphCommit, FunctionGraphCommitWithRelations, FunctionGraphCommitSelect, FunctionGraphCommitFilter, FunctionGraphCommitOrderBy, CreateFunctionGraphCommitInput, UpdateFunctionGraphCommitInput, FunctionGraphCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphCommit, + FunctionGraphCommitWithRelations, + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, + CreateFunctionGraphCommitInput, + UpdateFunctionGraphCommitInput, + FunctionGraphCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommits", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommit", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphCommit": data.functionGraphCommits?.nodes?.[0] ?? null - }) + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommit", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionGraphCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphCommit": data.functionGraphCommits?.nodes?.[0] ?? null - }) + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphCommit", "createFunctionGraphCommit", "functionGraphCommit", args.select, args.data, "CreateFunctionGraphCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphCommit', + 'createFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.data, + 'CreateFunctionGraphCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "createFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'createFunctionGraphCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphCommit", "updateFunctionGraphCommit", "functionGraphCommit", args.select, args.where.id, args.data, "UpdateFunctionGraphCommitInput", "id", "functionGraphCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphCommit', + 'updateFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphCommitInput', + 'id', + 'functionGraphCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "updateFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'updateFunctionGraphCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphCommit", "deleteFunctionGraphCommit", "functionGraphCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphCommit', + 'deleteFunctionGraphCommit', + 'functionGraphCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "deleteFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'deleteFunctionGraphCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphExecution.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphExecution.ts index 19bf0d3f80..36ba0d39b8 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionGraphExecution.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphExecution.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecution, FunctionGraphExecutionWithRelations, FunctionGraphExecutionSelect, FunctionGraphExecutionFilter, FunctionGraphExecutionOrderBy, CreateFunctionGraphExecutionInput, UpdateFunctionGraphExecutionInput, FunctionGraphExecutionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecution, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, + CreateFunctionGraphExecutionInput, + UpdateFunctionGraphExecutionInput, + FunctionGraphExecutionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecutions", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecutions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphExecution: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecution", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionGraphExecutionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecution": data.functionGraphExecutions?.nodes?.[0] ?? null - }) + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphExecution: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecution", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionGraphExecutionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecution": data.functionGraphExecutions?.nodes?.[0] ?? null - }) + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecution", "createFunctionGraphExecution", "functionGraphExecution", args.select, args.data, "CreateFunctionGraphExecutionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecution', + 'createFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.data, + 'CreateFunctionGraphExecutionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "createFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'createFunctionGraphExecution', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + startedAt: string; + }, + FunctionGraphExecutionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecution", "updateFunctionGraphExecution", "functionGraphExecution", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionInput", "id", "functionGraphExecutionPatch", connectionFieldsMap, { - startedAt: args.where.startedAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecution', + 'updateFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionInput', + 'id', + 'functionGraphExecutionPatch', + connectionFieldsMap, + { + startedAt: args.where.startedAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "updateFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'updateFunctionGraphExecution', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - startedAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + startedAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecution", "deleteFunctionGraphExecution", "functionGraphExecution", { - id: args.where.id, - startedAt: args.where.startedAt - }, "DeleteFunctionGraphExecutionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecution', + 'deleteFunctionGraphExecution', + 'functionGraphExecution', + { + id: args.where.id, + startedAt: args.where.startedAt, + }, + 'DeleteFunctionGraphExecutionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "deleteFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'deleteFunctionGraphExecution', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionNodeState.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionNodeState.ts index 8640ca634a..734317c006 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionNodeState.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionNodeState.ts @@ -3,56 +3,109 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecutionNodeState, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy, CreateFunctionGraphExecutionNodeStateInput, UpdateFunctionGraphExecutionNodeStateInput, FunctionGraphExecutionNodeStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionNodeState, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, + CreateFunctionGraphExecutionNodeStateInput, + UpdateFunctionGraphExecutionNodeStateInput, + FunctionGraphExecutionNodeStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionNodeStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeStates: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeStates", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeState: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeState", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class FunctionGraphExecutionNodeStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionNodeState": data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null - }) + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeState: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeState", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', document, variables, transform: (data: { @@ -93,79 +156,123 @@ export class FunctionGraphExecutionNodeStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionNodeState": data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null - }) + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecutionNodeState", "createFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", args.select, args.data, "CreateFunctionGraphExecutionNodeStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionNodeState', + 'createFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.data, + 'CreateFunctionGraphExecutionNodeStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "createFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'createFunctionGraphExecutionNodeState', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionNodeStatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecutionNodeState", "updateFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionNodeStateInput", "id", "functionGraphExecutionNodeStatePatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionNodeState', + 'updateFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionNodeStateInput', + 'id', + 'functionGraphExecutionNodeStatePatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "updateFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'updateFunctionGraphExecutionNodeState', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecutionNodeState", "deleteFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionGraphExecutionNodeStateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionNodeState', + 'deleteFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionNodeStateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "deleteFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'deleteFunctionGraphExecutionNodeState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionOutput.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionOutput.ts index f2353e75de..c9a5085e5e 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionOutput.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionOutput.ts @@ -3,56 +3,109 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecutionOutput, FunctionGraphExecutionOutputWithRelations, FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputFilter, FunctionGraphExecutionOutputOrderBy, CreateFunctionGraphExecutionOutputInput, UpdateFunctionGraphExecutionOutputInput, FunctionGraphExecutionOutputPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionOutput, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, + CreateFunctionGraphExecutionOutputInput, + UpdateFunctionGraphExecutionOutputInput, + FunctionGraphExecutionOutputPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionOutputModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutputs: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutputs", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutputs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutput: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutput", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class FunctionGraphExecutionOutputModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionOutput": data.functionGraphExecutionOutputs?.nodes?.[0] ?? null - }) + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutput: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutput", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class FunctionGraphExecutionOutputModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionOutput": data.functionGraphExecutionOutputs?.nodes?.[0] ?? null - }) + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecutionOutput", "createFunctionGraphExecutionOutput", "functionGraphExecutionOutput", args.select, args.data, "CreateFunctionGraphExecutionOutputInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionOutput', + 'createFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.data, + 'CreateFunctionGraphExecutionOutputInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "createFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'createFunctionGraphExecutionOutput', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionOutputPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecutionOutput", "updateFunctionGraphExecutionOutput", "functionGraphExecutionOutput", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionOutputInput", "id", "functionGraphExecutionOutputPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionOutput', + 'updateFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionOutputInput', + 'id', + 'functionGraphExecutionOutputPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "updateFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'updateFunctionGraphExecutionOutput', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecutionOutput", "deleteFunctionGraphExecutionOutput", "functionGraphExecutionOutput", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionGraphExecutionOutputInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionOutput', + 'deleteFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionOutputInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "deleteFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'deleteFunctionGraphExecutionOutput', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphObject.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphObject.ts index fecd1e433b..d1f358a726 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionGraphObject.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphObject.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphObject, FunctionGraphObjectWithRelations, FunctionGraphObjectSelect, FunctionGraphObjectFilter, FunctionGraphObjectOrderBy, CreateFunctionGraphObjectInput, UpdateFunctionGraphObjectInput, FunctionGraphObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphObject, + FunctionGraphObjectWithRelations, + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, + CreateFunctionGraphObjectInput, + UpdateFunctionGraphObjectInput, + FunctionGraphObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphObject", "functionGraphObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphObjectFilter", "FunctionGraphObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObjects", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphObject", "functionGraphObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphObjectFilter", "FunctionGraphObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObject", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class FunctionGraphObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphObject": data.functionGraphObjects?.nodes?.[0] ?? null - }) + functionGraphObject: data.functionGraphObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("FunctionGraphObject", "getNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'FunctionGraphObject', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObject", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphObject", "createFunctionGraphObject", "functionGraphObject", args.select, args.data, "CreateFunctionGraphObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphObject', + 'createFunctionGraphObject', + 'functionGraphObject', + args.select, + args.data, + 'CreateFunctionGraphObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "createFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'createFunctionGraphObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphObject", "updateFunctionGraphObject", "functionGraphObject", args.select, args.where.id, args.data, "UpdateFunctionGraphObjectInput", "id", "functionGraphObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphObject', + 'updateFunctionGraphObject', + 'functionGraphObject', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphObjectInput', + 'id', + 'functionGraphObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "updateFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'updateFunctionGraphObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphObject", "deleteFunctionGraphObject", "functionGraphObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphObject', + 'deleteFunctionGraphObject', + 'functionGraphObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "deleteFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'deleteFunctionGraphObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphRef.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphRef.ts index 31993a8a93..c4ee3889eb 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionGraphRef.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphRef.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphRef, FunctionGraphRefWithRelations, FunctionGraphRefSelect, FunctionGraphRefFilter, FunctionGraphRefOrderBy, CreateFunctionGraphRefInput, UpdateFunctionGraphRefInput, FunctionGraphRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphRef, + FunctionGraphRefWithRelations, + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, + CreateFunctionGraphRefInput, + UpdateFunctionGraphRefInput, + FunctionGraphRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRefs", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRef", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphRef": data.functionGraphRefs?.nodes?.[0] ?? null - }) + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRef", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionGraphRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphRef": data.functionGraphRefs?.nodes?.[0] ?? null - }) + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphRef", "createFunctionGraphRef", "functionGraphRef", args.select, args.data, "CreateFunctionGraphRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphRef', + 'createFunctionGraphRef', + 'functionGraphRef', + args.select, + args.data, + 'CreateFunctionGraphRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "createFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'createFunctionGraphRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphRef", "updateFunctionGraphRef", "functionGraphRef", args.select, args.where.id, args.data, "UpdateFunctionGraphRefInput", "id", "functionGraphRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphRef', + 'updateFunctionGraphRef', + 'functionGraphRef', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphRefInput', + 'id', + 'functionGraphRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "updateFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'updateFunctionGraphRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphRef", "deleteFunctionGraphRef", "functionGraphRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphRef', + 'deleteFunctionGraphRef', + 'functionGraphRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "deleteFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'deleteFunctionGraphRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphStore.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphStore.ts index c4d13ac9ee..6d1f384449 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionGraphStore.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphStore.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphStore, FunctionGraphStoreWithRelations, FunctionGraphStoreSelect, FunctionGraphStoreFilter, FunctionGraphStoreOrderBy, CreateFunctionGraphStoreInput, UpdateFunctionGraphStoreInput, FunctionGraphStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphStore, + FunctionGraphStoreWithRelations, + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, + CreateFunctionGraphStoreInput, + UpdateFunctionGraphStoreInput, + FunctionGraphStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStores", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStore", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphStore": data.functionGraphStores?.nodes?.[0] ?? null - }) + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStore", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionGraphStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphStore": data.functionGraphStores?.nodes?.[0] ?? null - }) + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphStore", "createFunctionGraphStore", "functionGraphStore", args.select, args.data, "CreateFunctionGraphStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphStore', + 'createFunctionGraphStore', + 'functionGraphStore', + args.select, + args.data, + 'CreateFunctionGraphStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "createFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'createFunctionGraphStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphStore", "updateFunctionGraphStore", "functionGraphStore", args.select, args.where.id, args.data, "UpdateFunctionGraphStoreInput", "id", "functionGraphStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphStore', + 'updateFunctionGraphStore', + 'functionGraphStore', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphStoreInput', + 'id', + 'functionGraphStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "updateFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'updateFunctionGraphStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphStore", "deleteFunctionGraphStore", "functionGraphStore", { - id: args.where.id - }, "DeleteFunctionGraphStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphStore', + 'deleteFunctionGraphStore', + 'functionGraphStore', + { + id: args.where.id, + }, + 'DeleteFunctionGraphStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "deleteFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'deleteFunctionGraphStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionInvocation.ts b/sdk/constructive-react/src/compute/orm/models/functionInvocation.ts index e9bd71267a..3589bf5a1d 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionInvocation.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionInvocation.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionInvocation, FunctionInvocationWithRelations, FunctionInvocationSelect, FunctionInvocationFilter, FunctionInvocationOrderBy, CreateFunctionInvocationInput, UpdateFunctionInvocationInput, FunctionInvocationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionInvocation, + FunctionInvocationWithRelations, + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy, + CreateFunctionInvocationInput, + UpdateFunctionInvocationInput, + FunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocation", "functionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocations", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocation", "functionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocation", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocation": data.functionInvocations?.nodes?.[0] ?? null - }) + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocation", "functionInvocations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocation", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocation": data.functionInvocations?.nodes?.[0] ?? null - }) + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocation", "createFunctionInvocation", "functionInvocation", args.select, args.data, "CreateFunctionInvocationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocation', + 'createFunctionInvocation', + 'functionInvocation', + args.select, + args.data, + 'CreateFunctionInvocationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "createFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'createFunctionInvocation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocation", "updateFunctionInvocation", "functionInvocation", args.select, args.where.id, args.data, "UpdateFunctionInvocationInput", "id", "functionInvocationPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocation', + 'updateFunctionInvocation', + 'functionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationInput', + 'id', + 'functionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "updateFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'updateFunctionInvocation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocation", "deleteFunctionInvocation", "functionInvocation", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionInvocationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocation', + 'deleteFunctionInvocation', + 'functionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "deleteFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'deleteFunctionInvocation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionInvocationAttempt.ts b/sdk/constructive-react/src/compute/orm/models/functionInvocationAttempt.ts index 3f660a869e..710ddec0b8 100644 --- a/sdk/constructive-react/src/compute/orm/models/functionInvocationAttempt.ts +++ b/sdk/constructive-react/src/compute/orm/models/functionInvocationAttempt.ts @@ -3,56 +3,98 @@ * @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 { FunctionInvocationAttempt, FunctionInvocationAttemptWithRelations, FunctionInvocationAttemptSelect, FunctionInvocationAttemptFilter, FunctionInvocationAttemptOrderBy, CreateFunctionInvocationAttemptInput, UpdateFunctionInvocationAttemptInput, FunctionInvocationAttemptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionInvocationAttempt, + FunctionInvocationAttemptWithRelations, + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy, + CreateFunctionInvocationAttemptInput, + UpdateFunctionInvocationAttemptInput, + FunctionInvocationAttemptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationAttemptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionInvocationAttempts: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocationAttempts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationAttempt", "functionInvocationAttempts", 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 - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + 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, + }, + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempts", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationAttempt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocationAttempt", "functionInvocationAttempts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempt", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempt', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationAttempt": data.functionInvocationAttempts?.nodes?.[0] ?? null - }) + functionInvocationAttempt: data.functionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationAttempt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationAttempt", "functionInvocationAttempts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempt", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempt', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationAttempt": data.functionInvocationAttempts?.nodes?.[0] ?? null - }) + functionInvocationAttempt: data.functionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocationAttempt", "createFunctionInvocationAttempt", "functionInvocationAttempt", args.select, args.data, "CreateFunctionInvocationAttemptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocationAttempt', + 'createFunctionInvocationAttempt', + 'functionInvocationAttempt', + args.select, + args.data, + 'CreateFunctionInvocationAttemptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "createFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'createFunctionInvocationAttempt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationAttemptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocationAttempt", "updateFunctionInvocationAttempt", "functionInvocationAttempt", args.select, args.where.id, args.data, "UpdateFunctionInvocationAttemptInput", "id", "functionInvocationAttemptPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocationAttempt', + 'updateFunctionInvocationAttempt', + 'functionInvocationAttempt', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationAttemptInput', + 'id', + 'functionInvocationAttemptPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "updateFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'updateFunctionInvocationAttempt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocationAttempt", "deleteFunctionInvocationAttempt", "functionInvocationAttempt", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionInvocationAttemptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocationAttempt', + 'deleteFunctionInvocationAttempt', + 'functionInvocationAttempt', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationAttemptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "deleteFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'deleteFunctionInvocationAttempt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/getAllTreeNodesRecord.ts b/sdk/constructive-react/src/compute/orm/models/getAllTreeNodesRecord.ts index bb9b696c09..00f51d01f7 100644 --- a/sdk/constructive-react/src/compute/orm/models/getAllTreeNodesRecord.ts +++ b/sdk/constructive-react/src/compute/orm/models/getAllTreeNodesRecord.ts @@ -3,56 +3,96 @@ * @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 { GetAllTreeNodesRecord, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy, CreateGetAllTreeNodesRecordInput, UpdateGetAllTreeNodesRecordInput, GetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GetAllTreeNodesRecord, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, + CreateGetAllTreeNodesRecordInput, + UpdateGetAllTreeNodesRecordInput, + GetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GetAllTreeNodesRecord", "getAllTreeNodes", 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 - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + 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, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodes", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodesRecord: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GetAllTreeNodesRecord", "getAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodesRecord", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class GetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "getAllTreeNodesRecord": data.getAllTreeNodes?.nodes?.[0] ?? null - }) + getAllTreeNodesRecord: data.getAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGetAllTreeNodesRecord: { getAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GetAllTreeNodesRecord", "createGetAllTreeNodesRecord", "getAllTreeNodesRecord", args.select, args.data, "CreateGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GetAllTreeNodesRecord', + 'createGetAllTreeNodesRecord', + 'getAllTreeNodesRecord', + args.select, + args.data, + 'CreateGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GetAllTreeNodesRecord", - fieldName: "createGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'createGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/index.ts b/sdk/constructive-react/src/compute/orm/models/index.ts index 90c96202f6..c06f5f3db6 100644 --- a/sdk/constructive-react/src/compute/orm/models/index.ts +++ b/sdk/constructive-react/src/compute/orm/models/index.ts @@ -3,70 +3,70 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { DbPresetModel } from "./dbPreset"; -export { FunctionApiBindingModel } from "./functionApiBinding"; -export { FunctionDefinitionModel } from "./functionDefinition"; -export { FunctionDeploymentModel } from "./functionDeployment"; -export { FunctionDeploymentEventModel } from "./functionDeploymentEvent"; -export { FunctionExecutionLogModel } from "./functionExecutionLog"; -export { FunctionGraphCommitModel } from "./functionGraphCommit"; -export { FunctionGraphModel } from "./functionGraph"; -export { FunctionGraphExecutionModel } from "./functionGraphExecution"; -export { FunctionGraphExecutionNodeStateModel } from "./functionGraphExecutionNodeState"; -export { FunctionGraphExecutionOutputModel } from "./functionGraphExecutionOutput"; -export { FunctionGraphObjectModel } from "./functionGraphObject"; -export { FunctionGraphRefModel } from "./functionGraphRef"; -export { FunctionGraphStoreModel } from "./functionGraphStore"; -export { FunctionInvocationAttemptModel } from "./functionInvocationAttempt"; -export { FunctionInvocationModel } from "./functionInvocation"; -export { GetAllTreeNodesRecordModel } from "./getAllTreeNodesRecord"; -export { InfraCommitModel } from "./infraCommit"; -export { InfraGetAllTreeNodesRecordModel } from "./infraGetAllTreeNodesRecord"; -export { InfraObjectModel } from "./infraObject"; -export { InfraRefModel } from "./infraRef"; -export { InfraStoreModel } from "./infraStore"; -export { IntegrationProviderModel } from "./integrationProvider"; -export { NamespaceModel } from "./namespace"; -export { NamespaceEventModel } from "./namespaceEvent"; -export { PlatformFunctionApiBindingModel } from "./platformFunctionApiBinding"; -export { PlatformFunctionDefinitionModel } from "./platformFunctionDefinition"; -export { PlatformFunctionDeploymentModel } from "./platformFunctionDeployment"; -export { PlatformFunctionDeploymentEventModel } from "./platformFunctionDeploymentEvent"; -export { PlatformFunctionExecutionLogModel } from "./platformFunctionExecutionLog"; -export { PlatformFunctionInvocationAttemptModel } from "./platformFunctionInvocationAttempt"; -export { PlatformFunctionInvocationModel } from "./platformFunctionInvocation"; -export { PlatformInfraCommitModel } from "./platformInfraCommit"; -export { PlatformInfraGetAllTreeNodesRecordModel } from "./platformInfraGetAllTreeNodesRecord"; -export { PlatformInfraObjectModel } from "./platformInfraObject"; -export { PlatformInfraRefModel } from "./platformInfraRef"; -export { PlatformInfraStoreModel } from "./platformInfraStore"; -export { PlatformNamespaceModel } from "./platformNamespace"; -export { PlatformNamespaceEventModel } from "./platformNamespaceEvent"; -export { PlatformResourceModel } from "./platformResource"; -export { PlatformResourceDeclaredCapacityModel } from "./platformResourceDeclaredCapacity"; -export { PlatformResourceDefinitionModel } from "./platformResourceDefinition"; -export { PlatformResourceEventModel } from "./platformResourceEvent"; -export { PlatformResourceInstallationModel } from "./platformResourceInstallation"; -export { PlatformResourceStatusCheckModel } from "./platformResourceStatusCheck"; -export { PlatformResourceUsageLogModel } from "./platformResourceUsageLog"; -export { PlatformResourceUsageSummaryModel } from "./platformResourceUsageSummary"; -export { PlatformResourceUtilizationModel } from "./platformResourceUtilization"; -export { PlatformResourcesHealthModel } from "./platformResourcesHealth"; -export { PlatformResourcesRequirementsStateModel } from "./platformResourcesRequirementsState"; -export { PlatformResourcesResolvedRequirementModel } from "./platformResourcesResolvedRequirement"; -export { PlatformWebhookEndpointModel } from "./platformWebhookEndpoint"; -export { PlatformWebhookEventModel } from "./platformWebhookEvent"; -export { ResourceModel } from "./resource"; -export { ResourceDeclaredCapacityModel } from "./resourceDeclaredCapacity"; -export { ResourceDefinitionModel } from "./resourceDefinition"; -export { ResourceEventModel } from "./resourceEvent"; -export { ResourceInstallationModel } from "./resourceInstallation"; -export { ResourceStatusCheckModel } from "./resourceStatusCheck"; -export { ResourceUsageLogModel } from "./resourceUsageLog"; -export { ResourceUsageSummaryModel } from "./resourceUsageSummary"; -export { ResourceUtilizationModel } from "./resourceUtilization"; -export { ResourcesHealthModel } from "./resourcesHealth"; -export { ResourcesRequirementsStateModel } from "./resourcesRequirementsState"; -export { ResourcesResolvedRequirementModel } from "./resourcesResolvedRequirement"; -export { WebhookEndpointModel } from "./webhookEndpoint"; -export { WebhookEventModel } from "./webhookEvent"; \ No newline at end of file +export { DbPresetModel } from './dbPreset'; +export { FunctionApiBindingModel } from './functionApiBinding'; +export { FunctionDefinitionModel } from './functionDefinition'; +export { FunctionDeploymentModel } from './functionDeployment'; +export { FunctionDeploymentEventModel } from './functionDeploymentEvent'; +export { FunctionExecutionLogModel } from './functionExecutionLog'; +export { FunctionGraphCommitModel } from './functionGraphCommit'; +export { FunctionGraphModel } from './functionGraph'; +export { FunctionGraphExecutionModel } from './functionGraphExecution'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; +export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutput'; +export { FunctionGraphObjectModel } from './functionGraphObject'; +export { FunctionGraphRefModel } from './functionGraphRef'; +export { FunctionGraphStoreModel } from './functionGraphStore'; +export { FunctionInvocationAttemptModel } from './functionInvocationAttempt'; +export { FunctionInvocationModel } from './functionInvocation'; +export { GetAllTreeNodesRecordModel } from './getAllTreeNodesRecord'; +export { InfraCommitModel } from './infraCommit'; +export { InfraGetAllTreeNodesRecordModel } from './infraGetAllTreeNodesRecord'; +export { InfraObjectModel } from './infraObject'; +export { InfraRefModel } from './infraRef'; +export { InfraStoreModel } from './infraStore'; +export { IntegrationProviderModel } from './integrationProvider'; +export { NamespaceModel } from './namespace'; +export { NamespaceEventModel } from './namespaceEvent'; +export { PlatformFunctionApiBindingModel } from './platformFunctionApiBinding'; +export { PlatformFunctionDefinitionModel } from './platformFunctionDefinition'; +export { PlatformFunctionDeploymentModel } from './platformFunctionDeployment'; +export { PlatformFunctionDeploymentEventModel } from './platformFunctionDeploymentEvent'; +export { PlatformFunctionExecutionLogModel } from './platformFunctionExecutionLog'; +export { PlatformFunctionInvocationAttemptModel } from './platformFunctionInvocationAttempt'; +export { PlatformFunctionInvocationModel } from './platformFunctionInvocation'; +export { PlatformInfraCommitModel } from './platformInfraCommit'; +export { PlatformInfraGetAllTreeNodesRecordModel } from './platformInfraGetAllTreeNodesRecord'; +export { PlatformInfraObjectModel } from './platformInfraObject'; +export { PlatformInfraRefModel } from './platformInfraRef'; +export { PlatformInfraStoreModel } from './platformInfraStore'; +export { PlatformNamespaceModel } from './platformNamespace'; +export { PlatformNamespaceEventModel } from './platformNamespaceEvent'; +export { PlatformResourceModel } from './platformResource'; +export { PlatformResourceDeclaredCapacityModel } from './platformResourceDeclaredCapacity'; +export { PlatformResourceDefinitionModel } from './platformResourceDefinition'; +export { PlatformResourceEventModel } from './platformResourceEvent'; +export { PlatformResourceInstallationModel } from './platformResourceInstallation'; +export { PlatformResourceStatusCheckModel } from './platformResourceStatusCheck'; +export { PlatformResourceUsageLogModel } from './platformResourceUsageLog'; +export { PlatformResourceUsageSummaryModel } from './platformResourceUsageSummary'; +export { PlatformResourceUtilizationModel } from './platformResourceUtilization'; +export { PlatformResourcesHealthModel } from './platformResourcesHealth'; +export { PlatformResourcesRequirementsStateModel } from './platformResourcesRequirementsState'; +export { PlatformResourcesResolvedRequirementModel } from './platformResourcesResolvedRequirement'; +export { PlatformWebhookEndpointModel } from './platformWebhookEndpoint'; +export { PlatformWebhookEventModel } from './platformWebhookEvent'; +export { ResourceModel } from './resource'; +export { ResourceDeclaredCapacityModel } from './resourceDeclaredCapacity'; +export { ResourceDefinitionModel } from './resourceDefinition'; +export { ResourceEventModel } from './resourceEvent'; +export { ResourceInstallationModel } from './resourceInstallation'; +export { ResourceStatusCheckModel } from './resourceStatusCheck'; +export { ResourceUsageLogModel } from './resourceUsageLog'; +export { ResourceUsageSummaryModel } from './resourceUsageSummary'; +export { ResourceUtilizationModel } from './resourceUtilization'; +export { ResourcesHealthModel } from './resourcesHealth'; +export { ResourcesRequirementsStateModel } from './resourcesRequirementsState'; +export { ResourcesResolvedRequirementModel } from './resourcesResolvedRequirement'; +export { WebhookEndpointModel } from './webhookEndpoint'; +export { WebhookEventModel } from './webhookEvent'; diff --git a/sdk/constructive-react/src/compute/orm/models/infraCommit.ts b/sdk/constructive-react/src/compute/orm/models/infraCommit.ts index 657f82c32c..379750f7f9 100644 --- a/sdk/constructive-react/src/compute/orm/models/infraCommit.ts +++ b/sdk/constructive-react/src/compute/orm/models/infraCommit.ts @@ -3,56 +3,96 @@ * @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 { InfraCommit, InfraCommitWithRelations, InfraCommitSelect, InfraCommitFilter, InfraCommitOrderBy, CreateInfraCommitInput, UpdateInfraCommitInput, InfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraCommit, + InfraCommitWithRelations, + InfraCommitSelect, + InfraCommitFilter, + InfraCommitOrderBy, + CreateInfraCommitInput, + UpdateInfraCommitInput, + InfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraCommit", "infraCommits", 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 - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraCommit', + 'infraCommits', + 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, + }, + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommits", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraCommit", "infraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraCommit', + 'infraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommit", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraCommit": data.infraCommits?.nodes?.[0] ?? null - }) + infraCommit: data.infraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraCommit", "infraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraCommit', + 'infraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommit", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class InfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraCommit": data.infraCommits?.nodes?.[0] ?? null - }) + infraCommit: data.infraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraCommit", "createInfraCommit", "infraCommit", args.select, args.data, "CreateInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraCommit', + 'createInfraCommit', + 'infraCommit', + args.select, + args.data, + 'CreateInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "createInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'createInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraCommit", "updateInfraCommit", "infraCommit", args.select, args.where.id, args.data, "UpdateInfraCommitInput", "id", "infraCommitPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraCommit', + 'updateInfraCommit', + 'infraCommit', + args.select, + args.where.id, + args.data, + 'UpdateInfraCommitInput', + 'id', + 'infraCommitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "updateInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'updateInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraCommit", "deleteInfraCommit", "infraCommit", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraCommit', + 'deleteInfraCommit', + 'infraCommit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "deleteInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'deleteInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/infraGetAllTreeNodesRecord.ts b/sdk/constructive-react/src/compute/orm/models/infraGetAllTreeNodesRecord.ts index 8df5146d17..7f2e31d467 100644 --- a/sdk/constructive-react/src/compute/orm/models/infraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-react/src/compute/orm/models/infraGetAllTreeNodesRecord.ts @@ -3,56 +3,101 @@ * @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 { InfraGetAllTreeNodesRecord, InfraGetAllTreeNodesRecordWithRelations, InfraGetAllTreeNodesRecordSelect, InfraGetAllTreeNodesRecordFilter, InfraGetAllTreeNodesRecordsOrderBy, CreateInfraGetAllTreeNodesRecordInput, UpdateInfraGetAllTreeNodesRecordInput, InfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraGetAllTreeNodesRecord, + InfraGetAllTreeNodesRecordWithRelations, + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy, + CreateInfraGetAllTreeNodesRecordInput, + UpdateInfraGetAllTreeNodesRecordInput, + InfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - infraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + infraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("InfraGetAllTreeNodesRecord", "infraGetAllTreeNodes", 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 - }, "InfraGetAllTreeNodesRecordFilter", "InfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodes', + 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, + }, + 'InfraGetAllTreeNodesRecordFilter', + 'InfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "infraGetAllTreeNodes", + operation: 'query', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'infraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - infraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + infraGetAllTreeNodesRecord: InferSelectResult< + InfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraGetAllTreeNodesRecord", "infraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraGetAllTreeNodesRecordFilter", "InfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraGetAllTreeNodesRecordFilter', + 'InfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "infraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'infraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +105,35 @@ export class InfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraGetAllTreeNodesRecord": data.infraGetAllTreeNodes?.nodes?.[0] ?? null - }) + infraGetAllTreeNodesRecord: data.infraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraGetAllTreeNodesRecord: { infraGetAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraGetAllTreeNodesRecord", "createInfraGetAllTreeNodesRecord", "infraGetAllTreeNodesRecord", args.select, args.data, "CreateInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraGetAllTreeNodesRecord', + 'createInfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreateInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "createInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'createInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/infraObject.ts b/sdk/constructive-react/src/compute/orm/models/infraObject.ts index c6a0b8eb4e..ef01fc62a4 100644 --- a/sdk/constructive-react/src/compute/orm/models/infraObject.ts +++ b/sdk/constructive-react/src/compute/orm/models/infraObject.ts @@ -3,56 +3,96 @@ * @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 { InfraObject, InfraObjectWithRelations, InfraObjectSelect, InfraObjectFilter, InfraObjectOrderBy, CreateInfraObjectInput, UpdateInfraObjectInput, InfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraObject, + InfraObjectWithRelations, + InfraObjectSelect, + InfraObjectFilter, + InfraObjectOrderBy, + CreateInfraObjectInput, + UpdateInfraObjectInput, + InfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraObject", "infraObjects", 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 - }, "InfraObjectFilter", "InfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraObject', + 'infraObjects', + 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, + }, + 'InfraObjectFilter', + 'InfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObjects", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraObject", "infraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraObjectFilter", "InfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraObject', + 'infraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraObjectFilter', + 'InfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObject", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class InfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraObject": data.infraObjects?.nodes?.[0] ?? null - }) + infraObject: data.infraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("InfraObject", "infraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'InfraObject', + 'infraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObject", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraObject", "createInfraObject", "infraObject", args.select, args.data, "CreateInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraObject', + 'createInfraObject', + 'infraObject', + args.select, + args.data, + 'CreateInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "createInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'createInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraObject", "updateInfraObject", "infraObject", args.select, args.where.id, args.data, "UpdateInfraObjectInput", "id", "infraObjectPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraObject', + 'updateInfraObject', + 'infraObject', + args.select, + args.where.id, + args.data, + 'UpdateInfraObjectInput', + 'id', + 'infraObjectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "updateInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'updateInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraObject", "deleteInfraObject", "infraObject", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraObject', + 'deleteInfraObject', + 'infraObject', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "deleteInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'deleteInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/infraRef.ts b/sdk/constructive-react/src/compute/orm/models/infraRef.ts index 57fdd343e9..bcc1a9d568 100644 --- a/sdk/constructive-react/src/compute/orm/models/infraRef.ts +++ b/sdk/constructive-react/src/compute/orm/models/infraRef.ts @@ -3,56 +3,96 @@ * @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 { InfraRef, InfraRefWithRelations, InfraRefSelect, InfraRefFilter, InfraRefOrderBy, CreateInfraRefInput, UpdateInfraRefInput, InfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraRef, + InfraRefWithRelations, + InfraRefSelect, + InfraRefFilter, + InfraRefOrderBy, + CreateInfraRefInput, + UpdateInfraRefInput, + InfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraRef", "infraRefs", 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 - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraRef', + 'infraRefs', + 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, + }, + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRefs", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraRef", "infraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraRef', + 'infraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRef", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraRef": data.infraRefs?.nodes?.[0] ?? null - }) + infraRef: data.infraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraRef", "infraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraRef', + 'infraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRef", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class InfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraRef": data.infraRefs?.nodes?.[0] ?? null - }) + infraRef: data.infraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraRef", "createInfraRef", "infraRef", args.select, args.data, "CreateInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraRef', + 'createInfraRef', + 'infraRef', + args.select, + args.data, + 'CreateInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "createInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'createInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraRef", "updateInfraRef", "infraRef", args.select, args.where.id, args.data, "UpdateInfraRefInput", "id", "infraRefPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraRef', + 'updateInfraRef', + 'infraRef', + args.select, + args.where.id, + args.data, + 'UpdateInfraRefInput', + 'id', + 'infraRefPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "updateInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'updateInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraRef", "deleteInfraRef", "infraRef", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraRef', + 'deleteInfraRef', + 'infraRef', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "deleteInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'deleteInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/infraStore.ts b/sdk/constructive-react/src/compute/orm/models/infraStore.ts index 3d2d19bdcc..a0ed0dbe7b 100644 --- a/sdk/constructive-react/src/compute/orm/models/infraStore.ts +++ b/sdk/constructive-react/src/compute/orm/models/infraStore.ts @@ -3,56 +3,96 @@ * @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 { InfraStore, InfraStoreWithRelations, InfraStoreSelect, InfraStoreFilter, InfraStoreOrderBy, CreateInfraStoreInput, UpdateInfraStoreInput, InfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraStore, + InfraStoreWithRelations, + InfraStoreSelect, + InfraStoreFilter, + InfraStoreOrderBy, + CreateInfraStoreInput, + UpdateInfraStoreInput, + InfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraStore", "infraStores", 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 - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraStore', + 'infraStores', + 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, + }, + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStores", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraStore", "infraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraStore', + 'infraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStore", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraStore": data.infraStores?.nodes?.[0] ?? null - }) + infraStore: data.infraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraStore", "infraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraStore', + 'infraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStore", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraStore": data.infraStores?.nodes?.[0] ?? null - }) + infraStore: data.infraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraStore", "createInfraStore", "infraStore", args.select, args.data, "CreateInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraStore', + 'createInfraStore', + 'infraStore', + args.select, + args.data, + 'CreateInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "createInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'createInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraStore", "updateInfraStore", "infraStore", args.select, args.where.id, args.data, "UpdateInfraStoreInput", "id", "infraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraStore', + 'updateInfraStore', + 'infraStore', + args.select, + args.where.id, + args.data, + 'UpdateInfraStoreInput', + 'id', + 'infraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "updateInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'updateInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraStore", "deleteInfraStore", "infraStore", { - id: args.where.id - }, "DeleteInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraStore', + 'deleteInfraStore', + 'infraStore', + { + id: args.where.id, + }, + 'DeleteInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "deleteInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'deleteInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/integrationProvider.ts b/sdk/constructive-react/src/compute/orm/models/integrationProvider.ts index bd4fa0c4d6..c79ad9375c 100644 --- a/sdk/constructive-react/src/compute/orm/models/integrationProvider.ts +++ b/sdk/constructive-react/src/compute/orm/models/integrationProvider.ts @@ -3,56 +3,96 @@ * @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 { IntegrationProvider, IntegrationProviderWithRelations, IntegrationProviderSelect, IntegrationProviderFilter, IntegrationProviderOrderBy, CreateIntegrationProviderInput, UpdateIntegrationProviderInput, IntegrationProviderPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IntegrationProvider, + IntegrationProviderWithRelations, + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy, + CreateIntegrationProviderInput, + UpdateIntegrationProviderInput, + IntegrationProviderPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IntegrationProviderModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProviders: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvider", "integrationProviders", 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 - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IntegrationProvider', + 'integrationProviders', + 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, + }, + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProviders", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProviders', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IntegrationProvider", "integrationProviders", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IntegrationProvider', + 'integrationProviders', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProvider", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProvider', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class IntegrationProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvider": data.integrationProviders?.nodes?.[0] ?? null - }) + integrationProvider: data.integrationProviders?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvider", "integrationProviders", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IntegrationProvider', + 'integrationProviders', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProvider", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProvider', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class IntegrationProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvider": data.integrationProviders?.nodes?.[0] ?? null - }) + integrationProvider: data.integrationProviders?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IntegrationProvider", "createIntegrationProvider", "integrationProvider", args.select, args.data, "CreateIntegrationProviderInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IntegrationProvider', + 'createIntegrationProvider', + 'integrationProvider', + args.select, + args.data, + 'CreateIntegrationProviderInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "createIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'createIntegrationProvider', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IntegrationProviderPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IntegrationProvider", "updateIntegrationProvider", "integrationProvider", args.select, args.where.id, args.data, "UpdateIntegrationProviderInput", "id", "integrationProviderPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IntegrationProvider', + 'updateIntegrationProvider', + 'integrationProvider', + args.select, + args.where.id, + args.data, + 'UpdateIntegrationProviderInput', + 'id', + 'integrationProviderPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "updateIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'updateIntegrationProvider', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IntegrationProvider", "deleteIntegrationProvider", "integrationProvider", { - id: args.where.id - }, "DeleteIntegrationProviderInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IntegrationProvider', + 'deleteIntegrationProvider', + 'integrationProvider', + { + id: args.where.id, + }, + 'DeleteIntegrationProviderInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "deleteIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'deleteIntegrationProvider', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/namespace.ts b/sdk/constructive-react/src/compute/orm/models/namespace.ts index 8c2bf42876..4e300068cd 100644 --- a/sdk/constructive-react/src/compute/orm/models/namespace.ts +++ b/sdk/constructive-react/src/compute/orm/models/namespace.ts @@ -3,56 +3,96 @@ * @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 { Namespace, NamespaceWithRelations, NamespaceSelect, NamespaceFilter, NamespaceOrderBy, CreateNamespaceInput, UpdateNamespaceInput, NamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Namespace, + NamespaceWithRelations, + NamespaceSelect, + NamespaceFilter, + NamespaceOrderBy, + CreateNamespaceInput, + UpdateNamespaceInput, + NamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", 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 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + 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, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespaces", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Namespace", "namespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Namespace", "createNamespace", "namespace", args.select, args.data, "CreateNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Namespace', + 'createNamespace', + 'namespace', + args.select, + args.data, + 'CreateNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "createNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'createNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Namespace", "updateNamespace", "namespace", args.select, args.where.id, args.data, "UpdateNamespaceInput", "id", "namespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Namespace', + 'updateNamespace', + 'namespace', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceInput', + 'id', + 'namespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "updateNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'updateNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Namespace", "deleteNamespace", "namespace", { - id: args.where.id - }, "DeleteNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Namespace', + 'deleteNamespace', + 'namespace', + { + id: args.where.id, + }, + 'DeleteNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "deleteNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'deleteNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/namespaceEvent.ts b/sdk/constructive-react/src/compute/orm/models/namespaceEvent.ts index 5fab4853c7..494442c263 100644 --- a/sdk/constructive-react/src/compute/orm/models/namespaceEvent.ts +++ b/sdk/constructive-react/src/compute/orm/models/namespaceEvent.ts @@ -3,56 +3,96 @@ * @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 { NamespaceEvent, NamespaceEventWithRelations, NamespaceEventSelect, NamespaceEventFilter, NamespaceEventOrderBy, CreateNamespaceEventInput, UpdateNamespaceEventInput, NamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceEvent, + NamespaceEventWithRelations, + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy, + CreateNamespaceEventInput, + UpdateNamespaceEventInput, + NamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", 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 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + 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, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvents", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceEvent", "createNamespaceEvent", "namespaceEvent", args.select, args.data, "CreateNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceEvent', + 'createNamespaceEvent', + 'namespaceEvent', + args.select, + args.data, + 'CreateNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "createNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'createNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + NamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceEvent", "updateNamespaceEvent", "namespaceEvent", args.select, args.where.id, args.data, "UpdateNamespaceEventInput", "id", "namespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceEvent', + 'updateNamespaceEvent', + 'namespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceEventInput', + 'id', + 'namespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "updateNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'updateNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceEvent", "deleteNamespaceEvent", "namespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceEvent', + 'deleteNamespaceEvent', + 'namespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "deleteNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'deleteNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformFunctionApiBinding.ts b/sdk/constructive-react/src/compute/orm/models/platformFunctionApiBinding.ts index 6f3cffb12b..c74d4423e8 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformFunctionApiBinding.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformFunctionApiBinding.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionApiBinding, PlatformFunctionApiBindingWithRelations, PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingFilter, PlatformFunctionApiBindingOrderBy, CreatePlatformFunctionApiBindingInput, UpdatePlatformFunctionApiBindingInput, PlatformFunctionApiBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionApiBinding, + PlatformFunctionApiBindingWithRelations, + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy, + CreatePlatformFunctionApiBindingInput, + UpdatePlatformFunctionApiBindingInput, + PlatformFunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionApiBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBindings: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBindings: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", 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 - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + 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, + }, + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBindings", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBinding: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBinding: InferSelectResult< + PlatformFunctionApiBindingWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBinding", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBinding', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionApiBinding": data.platformFunctionApiBindings?.nodes?.[0] ?? null - }) + platformFunctionApiBinding: data.platformFunctionApiBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBinding: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBinding: InferSelectResult< + PlatformFunctionApiBindingWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBinding", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBinding', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionApiBinding": data.platformFunctionApiBindings?.nodes?.[0] ?? null - }) + platformFunctionApiBinding: data.platformFunctionApiBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionApiBinding", "createPlatformFunctionApiBinding", "platformFunctionApiBinding", args.select, args.data, "CreatePlatformFunctionApiBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionApiBinding', + 'createPlatformFunctionApiBinding', + 'platformFunctionApiBinding', + args.select, + args.data, + 'CreatePlatformFunctionApiBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "createPlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'createPlatformFunctionApiBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionApiBinding", "updatePlatformFunctionApiBinding", "platformFunctionApiBinding", args.select, args.where.id, args.data, "UpdatePlatformFunctionApiBindingInput", "id", "platformFunctionApiBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionApiBinding', + 'updatePlatformFunctionApiBinding', + 'platformFunctionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionApiBindingInput', + 'id', + 'platformFunctionApiBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "updatePlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'updatePlatformFunctionApiBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionApiBinding", "deletePlatformFunctionApiBinding", "platformFunctionApiBinding", { - id: args.where.id - }, "DeletePlatformFunctionApiBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionApiBinding', + 'deletePlatformFunctionApiBinding', + 'platformFunctionApiBinding', + { + id: args.where.id, + }, + 'DeletePlatformFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "deletePlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'deletePlatformFunctionApiBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformFunctionDefinition.ts b/sdk/constructive-react/src/compute/orm/models/platformFunctionDefinition.ts index 43593c7d71..7422743780 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformFunctionDefinition.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformFunctionDefinition.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionDefinition, PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionFilter, PlatformFunctionDefinitionOrderBy, CreatePlatformFunctionDefinitionInput, UpdatePlatformFunctionDefinitionInput, PlatformFunctionDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDefinition, + PlatformFunctionDefinitionWithRelations, + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy, + CreatePlatformFunctionDefinitionInput, + UpdatePlatformFunctionDefinitionInput, + PlatformFunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinitions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinitions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", 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 - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + 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, + }, + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinitions", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinition: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinition: InferSelectResult< + PlatformFunctionDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinition", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinition', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDefinition": data.platformFunctionDefinitions?.nodes?.[0] ?? null - }) + platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinition: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinition: InferSelectResult< + PlatformFunctionDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinition", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinition', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDefinition": data.platformFunctionDefinitions?.nodes?.[0] ?? null - }) + platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDefinition", "createPlatformFunctionDefinition", "platformFunctionDefinition", args.select, args.data, "CreatePlatformFunctionDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDefinition', + 'createPlatformFunctionDefinition', + 'platformFunctionDefinition', + args.select, + args.data, + 'CreatePlatformFunctionDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "createPlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'createPlatformFunctionDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDefinition", "updatePlatformFunctionDefinition", "platformFunctionDefinition", args.select, args.where.id, args.data, "UpdatePlatformFunctionDefinitionInput", "id", "platformFunctionDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDefinition', + 'updatePlatformFunctionDefinition', + 'platformFunctionDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDefinitionInput', + 'id', + 'platformFunctionDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "updatePlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'updatePlatformFunctionDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDefinition", "deletePlatformFunctionDefinition", "platformFunctionDefinition", { - id: args.where.id - }, "DeletePlatformFunctionDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDefinition', + 'deletePlatformFunctionDefinition', + 'platformFunctionDefinition', + { + id: args.where.id, + }, + 'DeletePlatformFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "deletePlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'deletePlatformFunctionDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformFunctionDeployment.ts b/sdk/constructive-react/src/compute/orm/models/platformFunctionDeployment.ts index d525b179ba..6331c14b14 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformFunctionDeployment.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformFunctionDeployment.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionDeployment, PlatformFunctionDeploymentWithRelations, PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentFilter, PlatformFunctionDeploymentOrderBy, CreatePlatformFunctionDeploymentInput, UpdatePlatformFunctionDeploymentInput, PlatformFunctionDeploymentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDeployment, + PlatformFunctionDeploymentWithRelations, + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy, + CreatePlatformFunctionDeploymentInput, + UpdatePlatformFunctionDeploymentInput, + PlatformFunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDeploymentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployments: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployments: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeployment", "platformFunctionDeployments", 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 - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + 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, + }, + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployments", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployments', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployment: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployment: InferSelectResult< + PlatformFunctionDeploymentWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDeployment", "platformFunctionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployment", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployment', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeployment": data.platformFunctionDeployments?.nodes?.[0] ?? null - }) + platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployment: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployment: InferSelectResult< + PlatformFunctionDeploymentWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeployment", "platformFunctionDeployments", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployment", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployment', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeployment": data.platformFunctionDeployments?.nodes?.[0] ?? null - }) + platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDeployment", "createPlatformFunctionDeployment", "platformFunctionDeployment", args.select, args.data, "CreatePlatformFunctionDeploymentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDeployment', + 'createPlatformFunctionDeployment', + 'platformFunctionDeployment', + args.select, + args.data, + 'CreatePlatformFunctionDeploymentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "createPlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'createPlatformFunctionDeployment', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDeployment", "updatePlatformFunctionDeployment", "platformFunctionDeployment", args.select, args.where.id, args.data, "UpdatePlatformFunctionDeploymentInput", "id", "platformFunctionDeploymentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDeployment', + 'updatePlatformFunctionDeployment', + 'platformFunctionDeployment', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDeploymentInput', + 'id', + 'platformFunctionDeploymentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "updatePlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'updatePlatformFunctionDeployment', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDeployment", "deletePlatformFunctionDeployment", "platformFunctionDeployment", { - id: args.where.id - }, "DeletePlatformFunctionDeploymentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDeployment', + 'deletePlatformFunctionDeployment', + 'platformFunctionDeployment', + { + id: args.where.id, + }, + 'DeletePlatformFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "deletePlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'deletePlatformFunctionDeployment', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformFunctionDeploymentEvent.ts b/sdk/constructive-react/src/compute/orm/models/platformFunctionDeploymentEvent.ts index b0e61986d3..9e28f1c2c4 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformFunctionDeploymentEvent.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformFunctionDeploymentEvent.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionDeploymentEvent, PlatformFunctionDeploymentEventWithRelations, PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy, CreatePlatformFunctionDeploymentEventInput, UpdatePlatformFunctionDeploymentEventInput, PlatformFunctionDeploymentEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDeploymentEvent, + PlatformFunctionDeploymentEventWithRelations, + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy, + CreatePlatformFunctionDeploymentEventInput, + UpdatePlatformFunctionDeploymentEventInput, + PlatformFunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDeploymentEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvents: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", 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 - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + 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, + }, + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvents", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvent: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvent", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvent', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformFunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeploymentEvent": data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null - }) + platformFunctionDeploymentEvent: data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvent: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvent", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvent', document, variables, transform: (data: { @@ -93,79 +156,123 @@ export class PlatformFunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeploymentEvent": data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null - }) + platformFunctionDeploymentEvent: data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDeploymentEvent", "createPlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", args.select, args.data, "CreatePlatformFunctionDeploymentEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDeploymentEvent', + 'createPlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + args.select, + args.data, + 'CreatePlatformFunctionDeploymentEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "createPlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'createPlatformFunctionDeploymentEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDeploymentEvent", "updatePlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", args.select, args.where.id, args.data, "UpdatePlatformFunctionDeploymentEventInput", "id", "platformFunctionDeploymentEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDeploymentEvent', + 'updatePlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDeploymentEventInput', + 'id', + 'platformFunctionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "updatePlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'updatePlatformFunctionDeploymentEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDeploymentEvent", "deletePlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionDeploymentEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDeploymentEvent', + 'deletePlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "deletePlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'deletePlatformFunctionDeploymentEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformFunctionExecutionLog.ts b/sdk/constructive-react/src/compute/orm/models/platformFunctionExecutionLog.ts index c2b531e089..1fe6df0cf8 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformFunctionExecutionLog.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformFunctionExecutionLog.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionExecutionLog, PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy, CreatePlatformFunctionExecutionLogInput, UpdatePlatformFunctionExecutionLogInput, PlatformFunctionExecutionLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionExecutionLog, + PlatformFunctionExecutionLogWithRelations, + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy, + CreatePlatformFunctionExecutionLogInput, + UpdatePlatformFunctionExecutionLogInput, + PlatformFunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionExecutionLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLogs: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", 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 - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + 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, + }, + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLogs", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLog: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLog", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLog', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformFunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionExecutionLog": data.platformFunctionExecutionLogs?.nodes?.[0] ?? null - }) + platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLog: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLog", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLog', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class PlatformFunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionExecutionLog": data.platformFunctionExecutionLogs?.nodes?.[0] ?? null - }) + platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionExecutionLog", "createPlatformFunctionExecutionLog", "platformFunctionExecutionLog", args.select, args.data, "CreatePlatformFunctionExecutionLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionExecutionLog', + 'createPlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + args.select, + args.data, + 'CreatePlatformFunctionExecutionLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "createPlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'createPlatformFunctionExecutionLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionExecutionLog", "updatePlatformFunctionExecutionLog", "platformFunctionExecutionLog", args.select, args.where.id, args.data, "UpdatePlatformFunctionExecutionLogInput", "id", "platformFunctionExecutionLogPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionExecutionLog', + 'updatePlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionExecutionLogInput', + 'id', + 'platformFunctionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "updatePlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'updatePlatformFunctionExecutionLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionExecutionLog", "deletePlatformFunctionExecutionLog", "platformFunctionExecutionLog", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionExecutionLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionExecutionLog', + 'deletePlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "deletePlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'deletePlatformFunctionExecutionLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformFunctionInvocation.ts b/sdk/constructive-react/src/compute/orm/models/platformFunctionInvocation.ts index 79e7507dc9..f52ba9df33 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformFunctionInvocation.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformFunctionInvocation.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionInvocation, PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationSelect, PlatformFunctionInvocationFilter, PlatformFunctionInvocationOrderBy, CreatePlatformFunctionInvocationInput, UpdatePlatformFunctionInvocationInput, PlatformFunctionInvocationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionInvocation, + PlatformFunctionInvocationWithRelations, + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy, + CreatePlatformFunctionInvocationInput, + UpdatePlatformFunctionInvocationInput, + PlatformFunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionInvocationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocation", "platformFunctionInvocations", 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 - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + 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, + }, + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocations", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocation: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocation: InferSelectResult< + PlatformFunctionInvocationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionInvocation", "platformFunctionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocation", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocation', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocation": data.platformFunctionInvocations?.nodes?.[0] ?? null - }) + platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocation: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocation: InferSelectResult< + PlatformFunctionInvocationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocation", "platformFunctionInvocations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocation", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocation', document, variables, transform: (data: { @@ -93,79 +148,111 @@ export class PlatformFunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocation": data.platformFunctionInvocations?.nodes?.[0] ?? null - }) + platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionInvocation", "createPlatformFunctionInvocation", "platformFunctionInvocation", args.select, args.data, "CreatePlatformFunctionInvocationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionInvocation', + 'createPlatformFunctionInvocation', + 'platformFunctionInvocation', + args.select, + args.data, + 'CreatePlatformFunctionInvocationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "createPlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'createPlatformFunctionInvocation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionInvocation", "updatePlatformFunctionInvocation", "platformFunctionInvocation", args.select, args.where.id, args.data, "UpdatePlatformFunctionInvocationInput", "id", "platformFunctionInvocationPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionInvocation', + 'updatePlatformFunctionInvocation', + 'platformFunctionInvocation', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionInvocationInput', + 'id', + 'platformFunctionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "updatePlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'updatePlatformFunctionInvocation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionInvocation", "deletePlatformFunctionInvocation", "platformFunctionInvocation", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionInvocationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionInvocation', + 'deletePlatformFunctionInvocation', + 'platformFunctionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionInvocationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "deletePlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'deletePlatformFunctionInvocation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformFunctionInvocationAttempt.ts b/sdk/constructive-react/src/compute/orm/models/platformFunctionInvocationAttempt.ts index 80c28fc7c6..a1db7bbe0a 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformFunctionInvocationAttempt.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformFunctionInvocationAttempt.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionInvocationAttempt, PlatformFunctionInvocationAttemptWithRelations, PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy, CreatePlatformFunctionInvocationAttemptInput, UpdatePlatformFunctionInvocationAttemptInput, PlatformFunctionInvocationAttemptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionInvocationAttempt, + PlatformFunctionInvocationAttemptWithRelations, + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy, + CreatePlatformFunctionInvocationAttemptInput, + UpdatePlatformFunctionInvocationAttemptInput, + PlatformFunctionInvocationAttemptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionInvocationAttemptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempts: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", 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 - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + 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, + }, + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempts", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempt: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempt", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempt', document, variables, transform: (data: { @@ -60,32 +113,43 @@ export class PlatformFunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocationAttempt": data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null - }) + platformFunctionInvocationAttempt: + data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempt: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempt", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempt', document, variables, transform: (data: { @@ -93,79 +157,124 @@ export class PlatformFunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocationAttempt": data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null - }) + platformFunctionInvocationAttempt: + data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionInvocationAttempt", "createPlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", args.select, args.data, "CreatePlatformFunctionInvocationAttemptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionInvocationAttempt', + 'createPlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + args.select, + args.data, + 'CreatePlatformFunctionInvocationAttemptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "createPlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'createPlatformFunctionInvocationAttempt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionInvocationAttemptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionInvocationAttempt", "updatePlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", args.select, args.where.id, args.data, "UpdatePlatformFunctionInvocationAttemptInput", "id", "platformFunctionInvocationAttemptPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionInvocationAttempt', + 'updatePlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionInvocationAttemptInput', + 'id', + 'platformFunctionInvocationAttemptPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "updatePlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'updatePlatformFunctionInvocationAttempt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionInvocationAttempt", "deletePlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionInvocationAttemptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionInvocationAttempt', + 'deletePlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionInvocationAttemptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "deletePlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'deletePlatformFunctionInvocationAttempt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformInfraCommit.ts b/sdk/constructive-react/src/compute/orm/models/platformInfraCommit.ts index b5e90c524d..ab0c34f08f 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformInfraCommit.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformInfraCommit.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraCommit, PlatformInfraCommitWithRelations, PlatformInfraCommitSelect, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy, CreatePlatformInfraCommitInput, UpdatePlatformInfraCommitInput, PlatformInfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraCommit, + PlatformInfraCommitWithRelations, + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, + CreatePlatformInfraCommitInput, + UpdatePlatformInfraCommitInput, + PlatformInfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", 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 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + 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, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommits", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraCommit", "createPlatformInfraCommit", "platformInfraCommit", args.select, args.data, "CreatePlatformInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraCommit', + 'createPlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.data, + 'CreatePlatformInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "createPlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'createPlatformInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraCommit", "updatePlatformInfraCommit", "platformInfraCommit", args.select, args.where.id, args.data, "UpdatePlatformInfraCommitInput", "id", "platformInfraCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraCommit', + 'updatePlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraCommitInput', + 'id', + 'platformInfraCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "updatePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'updatePlatformInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraCommit", "deletePlatformInfraCommit", "platformInfraCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraCommit', + 'deletePlatformInfraCommit', + 'platformInfraCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "deletePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'deletePlatformInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts b/sdk/constructive-react/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts index 6c9bfc2b28..e0e0a2aeaa 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts @@ -3,56 +3,109 @@ * @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 { PlatformInfraGetAllTreeNodesRecord, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy, CreatePlatformInfraGetAllTreeNodesRecordInput, UpdatePlatformInfraGetAllTreeNodesRecordInput, PlatformInfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraGetAllTreeNodesRecord, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, + CreatePlatformInfraGetAllTreeNodesRecordInput, + UpdatePlatformInfraGetAllTreeNodesRecordInput, + PlatformInfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", 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 - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + 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, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodes", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +113,41 @@ export class PlatformInfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraGetAllTreeNodesRecord": data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null - }) + platformInfraGetAllTreeNodesRecord: data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraGetAllTreeNodesRecord: { - platformInfraGetAllTreeNodesRecord: InferSelectResult; + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraGetAllTreeNodesRecord", "createPlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodesRecord", args.select, args.data, "CreatePlatformInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'createPlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreatePlatformInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "createPlatformInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'createPlatformInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformInfraObject.ts b/sdk/constructive-react/src/compute/orm/models/platformInfraObject.ts index 2978ff1c18..512cb448c4 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformInfraObject.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformInfraObject.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraObject, PlatformInfraObjectWithRelations, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy, CreatePlatformInfraObjectInput, UpdatePlatformInfraObjectInput, PlatformInfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraObject, + PlatformInfraObjectWithRelations, + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, + CreatePlatformInfraObjectInput, + UpdatePlatformInfraObjectInput, + PlatformInfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraObject", "platformInfraObjects", 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 - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + 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, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObjects", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraObject", "platformInfraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class PlatformInfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraObject": data.platformInfraObjects?.nodes?.[0] ?? null - }) + platformInfraObject: data.platformInfraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("PlatformInfraObject", "platformInfraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'PlatformInfraObject', + 'platformInfraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraObject", "createPlatformInfraObject", "platformInfraObject", args.select, args.data, "CreatePlatformInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraObject', + 'createPlatformInfraObject', + 'platformInfraObject', + args.select, + args.data, + 'CreatePlatformInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "createPlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'createPlatformInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraObject", "updatePlatformInfraObject", "platformInfraObject", args.select, args.where.id, args.data, "UpdatePlatformInfraObjectInput", "id", "platformInfraObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraObject', + 'updatePlatformInfraObject', + 'platformInfraObject', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraObjectInput', + 'id', + 'platformInfraObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "updatePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'updatePlatformInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraObject", "deletePlatformInfraObject", "platformInfraObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraObject', + 'deletePlatformInfraObject', + 'platformInfraObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "deletePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'deletePlatformInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformInfraRef.ts b/sdk/constructive-react/src/compute/orm/models/platformInfraRef.ts index 198e5cd359..c485407d95 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformInfraRef.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformInfraRef.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraRef, PlatformInfraRefWithRelations, PlatformInfraRefSelect, PlatformInfraRefFilter, PlatformInfraRefOrderBy, CreatePlatformInfraRefInput, UpdatePlatformInfraRefInput, PlatformInfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraRef, + PlatformInfraRefWithRelations, + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, + CreatePlatformInfraRefInput, + UpdatePlatformInfraRefInput, + PlatformInfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", 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 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + 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, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRefs", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraRef", "createPlatformInfraRef", "platformInfraRef", args.select, args.data, "CreatePlatformInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraRef', + 'createPlatformInfraRef', + 'platformInfraRef', + args.select, + args.data, + 'CreatePlatformInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "createPlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'createPlatformInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraRef", "updatePlatformInfraRef", "platformInfraRef", args.select, args.where.id, args.data, "UpdatePlatformInfraRefInput", "id", "platformInfraRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraRef', + 'updatePlatformInfraRef', + 'platformInfraRef', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraRefInput', + 'id', + 'platformInfraRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "updatePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'updatePlatformInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraRef", "deletePlatformInfraRef", "platformInfraRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraRef', + 'deletePlatformInfraRef', + 'platformInfraRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "deletePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'deletePlatformInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformInfraStore.ts b/sdk/constructive-react/src/compute/orm/models/platformInfraStore.ts index 857230b173..493d42e53c 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformInfraStore.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformInfraStore.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraStore, PlatformInfraStoreWithRelations, PlatformInfraStoreSelect, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy, CreatePlatformInfraStoreInput, UpdatePlatformInfraStoreInput, PlatformInfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraStore, + PlatformInfraStoreWithRelations, + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, + CreatePlatformInfraStoreInput, + UpdatePlatformInfraStoreInput, + PlatformInfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", 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 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + 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, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStores", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraStore", "createPlatformInfraStore", "platformInfraStore", args.select, args.data, "CreatePlatformInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraStore', + 'createPlatformInfraStore', + 'platformInfraStore', + args.select, + args.data, + 'CreatePlatformInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "createPlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'createPlatformInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformInfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraStore", "updatePlatformInfraStore", "platformInfraStore", args.select, args.where.id, args.data, "UpdatePlatformInfraStoreInput", "id", "platformInfraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraStore', + 'updatePlatformInfraStore', + 'platformInfraStore', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraStoreInput', + 'id', + 'platformInfraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "updatePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'updatePlatformInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraStore", "deletePlatformInfraStore", "platformInfraStore", { - id: args.where.id - }, "DeletePlatformInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraStore', + 'deletePlatformInfraStore', + 'platformInfraStore', + { + id: args.where.id, + }, + 'DeletePlatformInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "deletePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'deletePlatformInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformNamespace.ts b/sdk/constructive-react/src/compute/orm/models/platformNamespace.ts index 061849f0df..c4dff94953 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformNamespace.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformNamespace.ts @@ -3,56 +3,96 @@ * @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 { PlatformNamespace, PlatformNamespaceWithRelations, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy, CreatePlatformNamespaceInput, UpdatePlatformNamespaceInput, PlatformNamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespace, + PlatformNamespaceWithRelations, + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, + CreatePlatformNamespaceInput, + UpdatePlatformNamespaceInput, + PlatformNamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", 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 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + 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, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespaces", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespace", "createPlatformNamespace", "platformNamespace", args.select, args.data, "CreatePlatformNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespace', + 'createPlatformNamespace', + 'platformNamespace', + args.select, + args.data, + 'CreatePlatformNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "createPlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'createPlatformNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformNamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespace", "updatePlatformNamespace", "platformNamespace", args.select, args.where.id, args.data, "UpdatePlatformNamespaceInput", "id", "platformNamespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespace', + 'updatePlatformNamespace', + 'platformNamespace', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceInput', + 'id', + 'platformNamespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "updatePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'updatePlatformNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespace", "deletePlatformNamespace", "platformNamespace", { - id: args.where.id - }, "DeletePlatformNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespace', + 'deletePlatformNamespace', + 'platformNamespace', + { + id: args.where.id, + }, + 'DeletePlatformNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "deletePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'deletePlatformNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformNamespaceEvent.ts b/sdk/constructive-react/src/compute/orm/models/platformNamespaceEvent.ts index 90242716e8..198afe79ae 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformNamespaceEvent.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformNamespaceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformNamespaceEvent, PlatformNamespaceEventWithRelations, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy, CreatePlatformNamespaceEventInput, UpdatePlatformNamespaceEventInput, PlatformNamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespaceEvent, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, + CreatePlatformNamespaceEventInput, + UpdatePlatformNamespaceEventInput, + PlatformNamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformNamespaceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", 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 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + 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, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvents", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespaceEvent", "createPlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.data, "CreatePlatformNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespaceEvent', + 'createPlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.data, + 'CreatePlatformNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "createPlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'createPlatformNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformNamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespaceEvent", "updatePlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.where.id, args.data, "UpdatePlatformNamespaceEventInput", "id", "platformNamespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespaceEvent', + 'updatePlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceEventInput', + 'id', + 'platformNamespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "updatePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'updatePlatformNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespaceEvent", "deletePlatformNamespaceEvent", "platformNamespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespaceEvent', + 'deletePlatformNamespaceEvent', + 'platformNamespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "deletePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'deletePlatformNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResource.ts b/sdk/constructive-react/src/compute/orm/models/platformResource.ts index 7919e4d8dd..00f03ea1dc 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResource.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResource.ts @@ -3,56 +3,96 @@ * @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 { PlatformResource, PlatformResourceWithRelations, PlatformResourceSelect, PlatformResourceFilter, PlatformResourceOrderBy, CreatePlatformResourceInput, UpdatePlatformResourceInput, PlatformResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResource, + PlatformResourceWithRelations, + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy, + CreatePlatformResourceInput, + UpdatePlatformResourceInput, + PlatformResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResource", "platformResources", 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 - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResource', + 'platformResources', + 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, + }, + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResources", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResource", "platformResources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResource', + 'platformResources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResource", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResource": data.platformResources?.nodes?.[0] ?? null - }) + platformResource: data.platformResources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResource", "platformResources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResource', + 'platformResources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResource", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResource": data.platformResources?.nodes?.[0] ?? null - }) + platformResource: data.platformResources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResource", "createPlatformResource", "platformResource", args.select, args.data, "CreatePlatformResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResource', + 'createPlatformResource', + 'platformResource', + args.select, + args.data, + 'CreatePlatformResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "createPlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'createPlatformResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResource", "updatePlatformResource", "platformResource", args.select, args.where.id, args.data, "UpdatePlatformResourceInput", "id", "platformResourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResource', + 'updatePlatformResource', + 'platformResource', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceInput', + 'id', + 'platformResourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "updatePlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'updatePlatformResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResource", "deletePlatformResource", "platformResource", { - id: args.where.id - }, "DeletePlatformResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResource', + 'deletePlatformResource', + 'platformResource', + { + id: args.where.id, + }, + 'DeletePlatformResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "deletePlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'deletePlatformResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourceDeclaredCapacity.ts b/sdk/constructive-react/src/compute/orm/models/platformResourceDeclaredCapacity.ts index 922c25d12e..66a88f859d 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourceDeclaredCapacity.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourceDeclaredCapacity.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceDeclaredCapacity, PlatformResourceDeclaredCapacityWithRelations, PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy, CreatePlatformResourceDeclaredCapacityInput, UpdatePlatformResourceDeclaredCapacityInput, PlatformResourceDeclaredCapacityPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceDeclaredCapacity, + PlatformResourceDeclaredCapacityWithRelations, + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy, + CreatePlatformResourceDeclaredCapacityInput, + UpdatePlatformResourceDeclaredCapacityInput, + PlatformResourceDeclaredCapacityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceDeclaredCapacityModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDeclaredCapacities: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacities", 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 - }, "PlatformResourceDeclaredCapacityFilter", "PlatformResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacities', + 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, + }, + 'PlatformResourceDeclaredCapacityFilter', + 'PlatformResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "platformResourceDeclaredCapacities", + operation: 'query', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'platformResourceDeclaredCapacities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDeclaredCapacity: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDeclaredCapacity: InferSelectResult< + PlatformResourceDeclaredCapacityWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacities", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceDeclaredCapacityFilter", "PlatformResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceDeclaredCapacityFilter', + 'PlatformResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "platformResourceDeclaredCapacity", + operation: 'query', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'platformResourceDeclaredCapacity', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourceDeclaredCapacityModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDeclaredCapacity": data.platformResourceDeclaredCapacities?.nodes?.[0] ?? null - }) + platformResourceDeclaredCapacity: + data.platformResourceDeclaredCapacities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourceDeclaredCapacityInput['platformResourceDeclaredCapacity'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceDeclaredCapacity: { - platformResourceDeclaredCapacity: InferSelectResult; + platformResourceDeclaredCapacity: InferSelectResult< + PlatformResourceDeclaredCapacityWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceDeclaredCapacity", "createPlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacity", args.select, args.data, "CreatePlatformResourceDeclaredCapacityInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceDeclaredCapacity', + 'createPlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacity', + args.select, + args.data, + 'CreatePlatformResourceDeclaredCapacityInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "createPlatformResourceDeclaredCapacity", + operation: 'mutation', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'createPlatformResourceDeclaredCapacity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourceDefinition.ts b/sdk/constructive-react/src/compute/orm/models/platformResourceDefinition.ts index ae9490e31f..a23e8bf5a1 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourceDefinition.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourceDefinition.ts @@ -3,56 +3,101 @@ * @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 { PlatformResourceDefinition, PlatformResourceDefinitionWithRelations, PlatformResourceDefinitionSelect, PlatformResourceDefinitionFilter, PlatformResourceDefinitionOrderBy, CreatePlatformResourceDefinitionInput, UpdatePlatformResourceDefinitionInput, PlatformResourceDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceDefinition, + PlatformResourceDefinitionWithRelations, + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy, + CreatePlatformResourceDefinitionInput, + UpdatePlatformResourceDefinitionInput, + PlatformResourceDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinitions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinitions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDefinition", "platformResourceDefinitions", 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 - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + 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, + }, + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinitions", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinition: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinition: InferSelectResult< + PlatformResourceDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceDefinition", "platformResourceDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinition", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinition', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDefinition": data.platformResourceDefinitions?.nodes?.[0] ?? null - }) + platformResourceDefinition: data.platformResourceDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinition: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinition: InferSelectResult< + PlatformResourceDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDefinition", "platformResourceDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinition", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinition', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDefinition": data.platformResourceDefinitions?.nodes?.[0] ?? null - }) + platformResourceDefinition: data.platformResourceDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceDefinition", "createPlatformResourceDefinition", "platformResourceDefinition", args.select, args.data, "CreatePlatformResourceDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceDefinition', + 'createPlatformResourceDefinition', + 'platformResourceDefinition', + args.select, + args.data, + 'CreatePlatformResourceDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "createPlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'createPlatformResourceDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceDefinition", "updatePlatformResourceDefinition", "platformResourceDefinition", args.select, args.where.id, args.data, "UpdatePlatformResourceDefinitionInput", "id", "platformResourceDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceDefinition', + 'updatePlatformResourceDefinition', + 'platformResourceDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceDefinitionInput', + 'id', + 'platformResourceDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "updatePlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'updatePlatformResourceDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceDefinition", "deletePlatformResourceDefinition", "platformResourceDefinition", { - id: args.where.id - }, "DeletePlatformResourceDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceDefinition', + 'deletePlatformResourceDefinition', + 'platformResourceDefinition', + { + id: args.where.id, + }, + 'DeletePlatformResourceDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "deletePlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'deletePlatformResourceDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourceEvent.ts b/sdk/constructive-react/src/compute/orm/models/platformResourceEvent.ts index 8a8f320796..77ae28e155 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourceEvent.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourceEvent, PlatformResourceEventWithRelations, PlatformResourceEventSelect, PlatformResourceEventFilter, PlatformResourceEventOrderBy, CreatePlatformResourceEventInput, UpdatePlatformResourceEventInput, PlatformResourceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceEvent, + PlatformResourceEventWithRelations, + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy, + CreatePlatformResourceEventInput, + UpdatePlatformResourceEventInput, + PlatformResourceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceEvent", "platformResourceEvents", 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 - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + 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, + }, + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvents", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceEvent", "platformResourceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvent", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceEvent": data.platformResourceEvents?.nodes?.[0] ?? null - }) + platformResourceEvent: data.platformResourceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceEvent", "platformResourceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvent", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceEvent": data.platformResourceEvents?.nodes?.[0] ?? null - }) + platformResourceEvent: data.platformResourceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceEvent", "createPlatformResourceEvent", "platformResourceEvent", args.select, args.data, "CreatePlatformResourceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceEvent', + 'createPlatformResourceEvent', + 'platformResourceEvent', + args.select, + args.data, + 'CreatePlatformResourceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "createPlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'createPlatformResourceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformResourceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceEvent", "updatePlatformResourceEvent", "platformResourceEvent", args.select, args.where.id, args.data, "UpdatePlatformResourceEventInput", "id", "platformResourceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceEvent', + 'updatePlatformResourceEvent', + 'platformResourceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceEventInput', + 'id', + 'platformResourceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "updatePlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'updatePlatformResourceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceEvent", "deletePlatformResourceEvent", "platformResourceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformResourceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceEvent', + 'deletePlatformResourceEvent', + 'platformResourceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformResourceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "deletePlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'deletePlatformResourceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourceInstallation.ts b/sdk/constructive-react/src/compute/orm/models/platformResourceInstallation.ts index 9c839409d9..6da38f597c 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourceInstallation.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourceInstallation.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceInstallation, PlatformResourceInstallationWithRelations, PlatformResourceInstallationSelect, PlatformResourceInstallationFilter, PlatformResourceInstallationOrderBy, CreatePlatformResourceInstallationInput, UpdatePlatformResourceInstallationInput, PlatformResourceInstallationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceInstallation, + PlatformResourceInstallationWithRelations, + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy, + CreatePlatformResourceInstallationInput, + UpdatePlatformResourceInstallationInput, + PlatformResourceInstallationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceInstallationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallations: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceInstallation", "platformResourceInstallations", 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 - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + 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, + }, + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallations", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallation: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceInstallation", "platformResourceInstallations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallation", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallation', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceInstallation": data.platformResourceInstallations?.nodes?.[0] ?? null - }) + platformResourceInstallation: data.platformResourceInstallations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallation: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceInstallation", "platformResourceInstallations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallation", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallation', document, variables, transform: (data: { @@ -93,74 +156,106 @@ export class PlatformResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceInstallation": data.platformResourceInstallations?.nodes?.[0] ?? null - }) + platformResourceInstallation: data.platformResourceInstallations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceInstallation", "createPlatformResourceInstallation", "platformResourceInstallation", args.select, args.data, "CreatePlatformResourceInstallationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceInstallation', + 'createPlatformResourceInstallation', + 'platformResourceInstallation', + args.select, + args.data, + 'CreatePlatformResourceInstallationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "createPlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'createPlatformResourceInstallation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceInstallationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceInstallation", "updatePlatformResourceInstallation", "platformResourceInstallation", args.select, args.where.id, args.data, "UpdatePlatformResourceInstallationInput", "id", "platformResourceInstallationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceInstallation', + 'updatePlatformResourceInstallation', + 'platformResourceInstallation', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceInstallationInput', + 'id', + 'platformResourceInstallationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "updatePlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'updatePlatformResourceInstallation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceInstallation", "deletePlatformResourceInstallation", "platformResourceInstallation", { - id: args.where.id - }, "DeletePlatformResourceInstallationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceInstallation', + 'deletePlatformResourceInstallation', + 'platformResourceInstallation', + { + id: args.where.id, + }, + 'DeletePlatformResourceInstallationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "deletePlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'deletePlatformResourceInstallation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourceStatusCheck.ts b/sdk/constructive-react/src/compute/orm/models/platformResourceStatusCheck.ts index 2acb231904..16f33db355 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourceStatusCheck.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourceStatusCheck.ts @@ -3,56 +3,105 @@ * @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 { PlatformResourceStatusCheck, PlatformResourceStatusCheckWithRelations, PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckFilter, PlatformResourceStatusCheckOrderBy, CreatePlatformResourceStatusCheckInput, UpdatePlatformResourceStatusCheckInput, PlatformResourceStatusCheckPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceStatusCheck, + PlatformResourceStatusCheckWithRelations, + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy, + CreatePlatformResourceStatusCheckInput, + UpdatePlatformResourceStatusCheckInput, + PlatformResourceStatusCheckPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceStatusCheckModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusChecks: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusChecks: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", 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 - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + 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, + }, + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusChecks", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusChecks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusCheck: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusCheck", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusCheck', document, variables, transform: (data: { @@ -60,32 +109,42 @@ export class PlatformResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceStatusCheck": data.platformResourceStatusChecks?.nodes?.[0] ?? null - }) + platformResourceStatusCheck: data.platformResourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusCheck: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusCheck", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusCheck', document, variables, transform: (data: { @@ -93,74 +152,106 @@ export class PlatformResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceStatusCheck": data.platformResourceStatusChecks?.nodes?.[0] ?? null - }) + platformResourceStatusCheck: data.platformResourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceStatusCheck", "createPlatformResourceStatusCheck", "platformResourceStatusCheck", args.select, args.data, "CreatePlatformResourceStatusCheckInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceStatusCheck', + 'createPlatformResourceStatusCheck', + 'platformResourceStatusCheck', + args.select, + args.data, + 'CreatePlatformResourceStatusCheckInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "createPlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'createPlatformResourceStatusCheck', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceStatusCheckPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceStatusCheck", "updatePlatformResourceStatusCheck", "platformResourceStatusCheck", args.select, args.where.id, args.data, "UpdatePlatformResourceStatusCheckInput", "id", "platformResourceStatusCheckPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceStatusCheck', + 'updatePlatformResourceStatusCheck', + 'platformResourceStatusCheck', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceStatusCheckInput', + 'id', + 'platformResourceStatusCheckPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "updatePlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'updatePlatformResourceStatusCheck', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceStatusCheck", "deletePlatformResourceStatusCheck", "platformResourceStatusCheck", { - id: args.where.id - }, "DeletePlatformResourceStatusCheckInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceStatusCheck', + 'deletePlatformResourceStatusCheck', + 'platformResourceStatusCheck', + { + id: args.where.id, + }, + 'DeletePlatformResourceStatusCheckInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "deletePlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'deletePlatformResourceStatusCheck', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourceUsageLog.ts b/sdk/constructive-react/src/compute/orm/models/platformResourceUsageLog.ts index 41dd01a24e..276c7f50d9 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourceUsageLog.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourceUsageLog.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourceUsageLog, PlatformResourceUsageLogWithRelations, PlatformResourceUsageLogSelect, PlatformResourceUsageLogFilter, PlatformResourceUsageLogOrderBy, CreatePlatformResourceUsageLogInput, UpdatePlatformResourceUsageLogInput, PlatformResourceUsageLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUsageLog, + PlatformResourceUsageLogWithRelations, + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy, + CreatePlatformResourceUsageLogInput, + UpdatePlatformResourceUsageLogInput, + PlatformResourceUsageLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUsageLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageLogs: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", 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 - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + 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, + }, + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLogs", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLog", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLog', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageLog": data.platformResourceUsageLogs?.nodes?.[0] ?? null - }) + platformResourceUsageLog: data.platformResourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLog", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLog', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageLog": data.platformResourceUsageLogs?.nodes?.[0] ?? null - }) + platformResourceUsageLog: data.platformResourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUsageLog", "createPlatformResourceUsageLog", "platformResourceUsageLog", args.select, args.data, "CreatePlatformResourceUsageLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUsageLog', + 'createPlatformResourceUsageLog', + 'platformResourceUsageLog', + args.select, + args.data, + 'CreatePlatformResourceUsageLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "createPlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'createPlatformResourceUsageLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + sampledAt: string; + }, + PlatformResourceUsageLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceUsageLog", "updatePlatformResourceUsageLog", "platformResourceUsageLog", args.select, args.where.id, args.data, "UpdatePlatformResourceUsageLogInput", "id", "platformResourceUsageLogPatch", connectionFieldsMap, { - sampledAt: args.where.sampledAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceUsageLog', + 'updatePlatformResourceUsageLog', + 'platformResourceUsageLog', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceUsageLogInput', + 'id', + 'platformResourceUsageLogPatch', + connectionFieldsMap, + { + sampledAt: args.where.sampledAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "updatePlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'updatePlatformResourceUsageLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - sampledAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + sampledAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceUsageLog", "deletePlatformResourceUsageLog", "platformResourceUsageLog", { - id: args.where.id, - sampledAt: args.where.sampledAt - }, "DeletePlatformResourceUsageLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceUsageLog', + 'deletePlatformResourceUsageLog', + 'platformResourceUsageLog', + { + id: args.where.id, + sampledAt: args.where.sampledAt, + }, + 'DeletePlatformResourceUsageLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "deletePlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'deletePlatformResourceUsageLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourceUsageSummary.ts b/sdk/constructive-react/src/compute/orm/models/platformResourceUsageSummary.ts index 27e92a00e7..3d6efa4823 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourceUsageSummary.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourceUsageSummary.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceUsageSummary, PlatformResourceUsageSummaryWithRelations, PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryFilter, PlatformResourceUsageSummaryOrderBy, CreatePlatformResourceUsageSummaryInput, UpdatePlatformResourceUsageSummaryInput, PlatformResourceUsageSummaryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUsageSummary, + PlatformResourceUsageSummaryWithRelations, + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy, + CreatePlatformResourceUsageSummaryInput, + UpdatePlatformResourceUsageSummaryInput, + PlatformResourceUsageSummaryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUsageSummaryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummaries: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummaries: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", 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 - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + 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, + }, + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummaries", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummaries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummary: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummary", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummary', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageSummary": data.platformResourceUsageSummaries?.nodes?.[0] ?? null - }) + platformResourceUsageSummary: data.platformResourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummary: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummary", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummary', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class PlatformResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageSummary": data.platformResourceUsageSummaries?.nodes?.[0] ?? null - }) + platformResourceUsageSummary: data.platformResourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUsageSummary", "createPlatformResourceUsageSummary", "platformResourceUsageSummary", args.select, args.data, "CreatePlatformResourceUsageSummaryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUsageSummary', + 'createPlatformResourceUsageSummary', + 'platformResourceUsageSummary', + args.select, + args.data, + 'CreatePlatformResourceUsageSummaryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "createPlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'createPlatformResourceUsageSummary', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + date: string; + }, + PlatformResourceUsageSummaryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceUsageSummary", "updatePlatformResourceUsageSummary", "platformResourceUsageSummary", args.select, args.where.id, args.data, "UpdatePlatformResourceUsageSummaryInput", "id", "platformResourceUsageSummaryPatch", connectionFieldsMap, { - date: args.where.date - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceUsageSummary', + 'updatePlatformResourceUsageSummary', + 'platformResourceUsageSummary', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceUsageSummaryInput', + 'id', + 'platformResourceUsageSummaryPatch', + connectionFieldsMap, + { + date: args.where.date, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "updatePlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'updatePlatformResourceUsageSummary', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - date: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + date: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceUsageSummary", "deletePlatformResourceUsageSummary", "platformResourceUsageSummary", { - id: args.where.id, - date: args.where.date - }, "DeletePlatformResourceUsageSummaryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceUsageSummary', + 'deletePlatformResourceUsageSummary', + 'platformResourceUsageSummary', + { + id: args.where.id, + date: args.where.date, + }, + 'DeletePlatformResourceUsageSummaryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "deletePlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'deletePlatformResourceUsageSummary', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourceUtilization.ts b/sdk/constructive-react/src/compute/orm/models/platformResourceUtilization.ts index e4d7fa813d..040d38000e 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourceUtilization.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourceUtilization.ts @@ -3,56 +3,105 @@ * @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 { PlatformResourceUtilization, PlatformResourceUtilizationWithRelations, PlatformResourceUtilizationSelect, PlatformResourceUtilizationFilter, PlatformResourceUtilizationOrderBy, CreatePlatformResourceUtilizationInput, UpdatePlatformResourceUtilizationInput, PlatformResourceUtilizationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUtilization, + PlatformResourceUtilizationWithRelations, + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy, + CreatePlatformResourceUtilizationInput, + UpdatePlatformResourceUtilizationInput, + PlatformResourceUtilizationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUtilizationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUtilizations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUtilizations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUtilization", "platformResourceUtilizations", 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 - }, "PlatformResourceUtilizationFilter", "PlatformResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUtilization', + 'platformResourceUtilizations', + 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, + }, + 'PlatformResourceUtilizationFilter', + 'PlatformResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUtilization", - fieldName: "platformResourceUtilizations", + operation: 'query', + operationName: 'PlatformResourceUtilization', + fieldName: 'platformResourceUtilizations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUtilization: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUtilization: InferSelectResult< + PlatformResourceUtilizationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUtilization", "platformResourceUtilizations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUtilizationFilter", "PlatformResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUtilization', + 'platformResourceUtilizations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUtilizationFilter', + 'PlatformResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUtilization", - fieldName: "platformResourceUtilization", + operation: 'query', + operationName: 'PlatformResourceUtilization', + fieldName: 'platformResourceUtilization', document, variables, transform: (data: { @@ -60,28 +109,35 @@ export class PlatformResourceUtilizationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUtilization": data.platformResourceUtilizations?.nodes?.[0] ?? null - }) + platformResourceUtilization: data.platformResourceUtilizations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUtilization: { platformResourceUtilization: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUtilization", "createPlatformResourceUtilization", "platformResourceUtilization", args.select, args.data, "CreatePlatformResourceUtilizationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUtilization', + 'createPlatformResourceUtilization', + 'platformResourceUtilization', + args.select, + args.data, + 'CreatePlatformResourceUtilizationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUtilization", - fieldName: "createPlatformResourceUtilization", + operation: 'mutation', + operationName: 'PlatformResourceUtilization', + fieldName: 'createPlatformResourceUtilization', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourcesHealth.ts b/sdk/constructive-react/src/compute/orm/models/platformResourcesHealth.ts index 5c57532e6c..0f0efa3e31 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourcesHealth.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourcesHealth.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourcesHealth, PlatformResourcesHealthWithRelations, PlatformResourcesHealthSelect, PlatformResourcesHealthFilter, PlatformResourcesHealthOrderBy, CreatePlatformResourcesHealthInput, UpdatePlatformResourcesHealthInput, PlatformResourcesHealthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesHealth, + PlatformResourcesHealthWithRelations, + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy, + CreatePlatformResourcesHealthInput, + UpdatePlatformResourcesHealthInput, + PlatformResourcesHealthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesHealthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesHealths: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesHealths: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesHealth", "platformResourcesHealths", 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 - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + 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, + }, + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealths", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesHealth", "platformResourcesHealths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealth", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealth', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesHealth": data.platformResourcesHealths?.nodes?.[0] ?? null - }) + platformResourcesHealth: data.platformResourcesHealths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesHealth", "platformResourcesHealths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealth", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealth', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PlatformResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesHealth": data.platformResourcesHealths?.nodes?.[0] ?? null - }) + platformResourcesHealth: data.platformResourcesHealths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesHealth: { platformResourcesHealth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesHealth", "createPlatformResourcesHealth", "platformResourcesHealth", args.select, args.data, "CreatePlatformResourcesHealthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesHealth', + 'createPlatformResourcesHealth', + 'platformResourcesHealth', + args.select, + args.data, + 'CreatePlatformResourcesHealthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesHealth", - fieldName: "createPlatformResourcesHealth", + operation: 'mutation', + operationName: 'PlatformResourcesHealth', + fieldName: 'createPlatformResourcesHealth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourcesRequirementsState.ts b/sdk/constructive-react/src/compute/orm/models/platformResourcesRequirementsState.ts index 634b4945d0..ab6152e426 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourcesRequirementsState.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourcesRequirementsState.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourcesRequirementsState, PlatformResourcesRequirementsStateWithRelations, PlatformResourcesRequirementsStateSelect, PlatformResourcesRequirementsStateFilter, PlatformResourcesRequirementsStateOrderBy, CreatePlatformResourcesRequirementsStateInput, UpdatePlatformResourcesRequirementsStateInput, PlatformResourcesRequirementsStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesRequirementsState, + PlatformResourcesRequirementsStateWithRelations, + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy, + CreatePlatformResourcesRequirementsStateInput, + UpdatePlatformResourcesRequirementsStateInput, + PlatformResourcesRequirementsStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesRequirementsStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesRequirementsStates: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesRequirementsState", "platformResourcesRequirementsStates", 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 - }, "PlatformResourcesRequirementsStateFilter", "PlatformResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesRequirementsState', + 'platformResourcesRequirementsStates', + 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, + }, + 'PlatformResourcesRequirementsStateFilter', + 'PlatformResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesRequirementsState", - fieldName: "platformResourcesRequirementsStates", + operation: 'query', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'platformResourcesRequirementsStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesRequirementsState: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesRequirementsState: InferSelectResult< + PlatformResourcesRequirementsStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesRequirementsState", "platformResourcesRequirementsStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesRequirementsStateFilter", "PlatformResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesRequirementsState', + 'platformResourcesRequirementsStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesRequirementsStateFilter', + 'PlatformResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesRequirementsState", - fieldName: "platformResourcesRequirementsState", + operation: 'query', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'platformResourcesRequirementsState', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourcesRequirementsStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesRequirementsState": data.platformResourcesRequirementsStates?.nodes?.[0] ?? null - }) + platformResourcesRequirementsState: + data.platformResourcesRequirementsStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourcesRequirementsStateInput['platformResourcesRequirementsState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesRequirementsState: { - platformResourcesRequirementsState: InferSelectResult; + platformResourcesRequirementsState: InferSelectResult< + PlatformResourcesRequirementsStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesRequirementsState", "createPlatformResourcesRequirementsState", "platformResourcesRequirementsState", args.select, args.data, "CreatePlatformResourcesRequirementsStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesRequirementsState', + 'createPlatformResourcesRequirementsState', + 'platformResourcesRequirementsState', + args.select, + args.data, + 'CreatePlatformResourcesRequirementsStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesRequirementsState", - fieldName: "createPlatformResourcesRequirementsState", + operation: 'mutation', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'createPlatformResourcesRequirementsState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformResourcesResolvedRequirement.ts b/sdk/constructive-react/src/compute/orm/models/platformResourcesResolvedRequirement.ts index 35ddaae650..d7d7bf4ed0 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformResourcesResolvedRequirement.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformResourcesResolvedRequirement.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourcesResolvedRequirement, PlatformResourcesResolvedRequirementWithRelations, PlatformResourcesResolvedRequirementSelect, PlatformResourcesResolvedRequirementFilter, PlatformResourcesResolvedRequirementOrderBy, CreatePlatformResourcesResolvedRequirementInput, UpdatePlatformResourcesResolvedRequirementInput, PlatformResourcesResolvedRequirementPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesResolvedRequirement, + PlatformResourcesResolvedRequirementWithRelations, + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy, + CreatePlatformResourcesResolvedRequirementInput, + UpdatePlatformResourcesResolvedRequirementInput, + PlatformResourcesResolvedRequirementPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesResolvedRequirementModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesResolvedRequirements: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirements", 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 - }, "PlatformResourcesResolvedRequirementFilter", "PlatformResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirements', + 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, + }, + 'PlatformResourcesResolvedRequirementFilter', + 'PlatformResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "platformResourcesResolvedRequirements", + operation: 'query', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'platformResourcesResolvedRequirements', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesResolvedRequirement: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesResolvedRequirement: InferSelectResult< + PlatformResourcesResolvedRequirementWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirements", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesResolvedRequirementFilter", "PlatformResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirements', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesResolvedRequirementFilter', + 'PlatformResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "platformResourcesResolvedRequirement", + operation: 'query', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'platformResourcesResolvedRequirement', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourcesResolvedRequirementModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesResolvedRequirement": data.platformResourcesResolvedRequirements?.nodes?.[0] ?? null - }) + platformResourcesResolvedRequirement: + data.platformResourcesResolvedRequirements?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourcesResolvedRequirementInput['platformResourcesResolvedRequirement'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesResolvedRequirement: { - platformResourcesResolvedRequirement: InferSelectResult; + platformResourcesResolvedRequirement: InferSelectResult< + PlatformResourcesResolvedRequirementWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesResolvedRequirement", "createPlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirement", args.select, args.data, "CreatePlatformResourcesResolvedRequirementInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesResolvedRequirement', + 'createPlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirement', + args.select, + args.data, + 'CreatePlatformResourcesResolvedRequirementInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "createPlatformResourcesResolvedRequirement", + operation: 'mutation', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'createPlatformResourcesResolvedRequirement', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformWebhookEndpoint.ts b/sdk/constructive-react/src/compute/orm/models/platformWebhookEndpoint.ts index 99cce4fbc4..63d0e119ff 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformWebhookEndpoint.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformWebhookEndpoint.ts @@ -3,56 +3,98 @@ * @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 { PlatformWebhookEndpoint, PlatformWebhookEndpointWithRelations, PlatformWebhookEndpointSelect, PlatformWebhookEndpointFilter, PlatformWebhookEndpointOrderBy, CreatePlatformWebhookEndpointInput, UpdatePlatformWebhookEndpointInput, PlatformWebhookEndpointPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformWebhookEndpoint, + PlatformWebhookEndpointWithRelations, + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy, + CreatePlatformWebhookEndpointInput, + UpdatePlatformWebhookEndpointInput, + PlatformWebhookEndpointPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformWebhookEndpointModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformWebhookEndpoints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformWebhookEndpoints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", 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 - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + 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, + }, + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoints", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoint", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformWebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEndpoint": data.platformWebhookEndpoints?.nodes?.[0] ?? null - }) + platformWebhookEndpoint: data.platformWebhookEndpoints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoint", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformWebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEndpoint": data.platformWebhookEndpoints?.nodes?.[0] ?? null - }) + platformWebhookEndpoint: data.platformWebhookEndpoints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformWebhookEndpoint", "createPlatformWebhookEndpoint", "platformWebhookEndpoint", args.select, args.data, "CreatePlatformWebhookEndpointInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformWebhookEndpoint', + 'createPlatformWebhookEndpoint', + 'platformWebhookEndpoint', + args.select, + args.data, + 'CreatePlatformWebhookEndpointInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "createPlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'createPlatformWebhookEndpoint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformWebhookEndpointPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformWebhookEndpoint", "updatePlatformWebhookEndpoint", "platformWebhookEndpoint", args.select, args.where.id, args.data, "UpdatePlatformWebhookEndpointInput", "id", "platformWebhookEndpointPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformWebhookEndpoint', + 'updatePlatformWebhookEndpoint', + 'platformWebhookEndpoint', + args.select, + args.where.id, + args.data, + 'UpdatePlatformWebhookEndpointInput', + 'id', + 'platformWebhookEndpointPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "updatePlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'updatePlatformWebhookEndpoint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformWebhookEndpoint", "deletePlatformWebhookEndpoint", "platformWebhookEndpoint", { - id: args.where.id - }, "DeletePlatformWebhookEndpointInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformWebhookEndpoint', + 'deletePlatformWebhookEndpoint', + 'platformWebhookEndpoint', + { + id: args.where.id, + }, + 'DeletePlatformWebhookEndpointInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "deletePlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'deletePlatformWebhookEndpoint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/platformWebhookEvent.ts b/sdk/constructive-react/src/compute/orm/models/platformWebhookEvent.ts index dc04e82a10..ee3318064c 100644 --- a/sdk/constructive-react/src/compute/orm/models/platformWebhookEvent.ts +++ b/sdk/constructive-react/src/compute/orm/models/platformWebhookEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformWebhookEvent, PlatformWebhookEventWithRelations, PlatformWebhookEventSelect, PlatformWebhookEventFilter, PlatformWebhookEventOrderBy, CreatePlatformWebhookEventInput, UpdatePlatformWebhookEventInput, PlatformWebhookEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformWebhookEvent, + PlatformWebhookEventWithRelations, + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy, + CreatePlatformWebhookEventInput, + UpdatePlatformWebhookEventInput, + PlatformWebhookEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformWebhookEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformWebhookEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformWebhookEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEvent", "platformWebhookEvents", 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 - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + 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, + }, + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvents", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformWebhookEvent", "platformWebhookEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvent", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformWebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEvent": data.platformWebhookEvents?.nodes?.[0] ?? null - }) + platformWebhookEvent: data.platformWebhookEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEvent", "platformWebhookEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvent", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvent', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformWebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEvent": data.platformWebhookEvents?.nodes?.[0] ?? null - }) + platformWebhookEvent: data.platformWebhookEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformWebhookEvent", "createPlatformWebhookEvent", "platformWebhookEvent", args.select, args.data, "CreatePlatformWebhookEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformWebhookEvent', + 'createPlatformWebhookEvent', + 'platformWebhookEvent', + args.select, + args.data, + 'CreatePlatformWebhookEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "createPlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'createPlatformWebhookEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformWebhookEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformWebhookEvent", "updatePlatformWebhookEvent", "platformWebhookEvent", args.select, args.where.id, args.data, "UpdatePlatformWebhookEventInput", "id", "platformWebhookEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformWebhookEvent', + 'updatePlatformWebhookEvent', + 'platformWebhookEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformWebhookEventInput', + 'id', + 'platformWebhookEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "updatePlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'updatePlatformWebhookEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformWebhookEvent", "deletePlatformWebhookEvent", "platformWebhookEvent", { - id: args.where.id - }, "DeletePlatformWebhookEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformWebhookEvent', + 'deletePlatformWebhookEvent', + 'platformWebhookEvent', + { + id: args.where.id, + }, + 'DeletePlatformWebhookEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "deletePlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'deletePlatformWebhookEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resource.ts b/sdk/constructive-react/src/compute/orm/models/resource.ts index 5897835c08..b4b60ad6f3 100644 --- a/sdk/constructive-react/src/compute/orm/models/resource.ts +++ b/sdk/constructive-react/src/compute/orm/models/resource.ts @@ -3,56 +3,96 @@ * @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 { Resource, ResourceWithRelations, ResourceSelect, ResourceFilter, ResourceOrderBy, CreateResourceInput, UpdateResourceInput, ResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Resource, + ResourceWithRelations, + ResourceSelect, + ResourceFilter, + ResourceOrderBy, + CreateResourceInput, + UpdateResourceInput, + ResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Resource", "resources", 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 - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Resource', + 'resources', + 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, + }, + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resources", + operation: 'query', + operationName: 'Resource', + fieldName: 'resources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Resource", "resources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Resource', + 'resources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resource", + operation: 'query', + operationName: 'Resource', + fieldName: 'resource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "resource": data.resources?.nodes?.[0] ?? null - }) + resource: data.resources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Resource", "resources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Resource', + 'resources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resource", + operation: 'query', + operationName: 'Resource', + fieldName: 'resource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "resource": data.resources?.nodes?.[0] ?? null - }) + resource: data.resources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Resource", "createResource", "resource", args.select, args.data, "CreateResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Resource', + 'createResource', + 'resource', + args.select, + args.data, + 'CreateResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "createResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'createResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Resource", "updateResource", "resource", args.select, args.where.id, args.data, "UpdateResourceInput", "id", "resourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Resource', + 'updateResource', + 'resource', + args.select, + args.where.id, + args.data, + 'UpdateResourceInput', + 'id', + 'resourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "updateResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'updateResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Resource", "deleteResource", "resource", { - id: args.where.id - }, "DeleteResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Resource', + 'deleteResource', + 'resource', + { + id: args.where.id, + }, + 'DeleteResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "deleteResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'deleteResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourceDeclaredCapacity.ts b/sdk/constructive-react/src/compute/orm/models/resourceDeclaredCapacity.ts index a41ff9e316..6340979a98 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourceDeclaredCapacity.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourceDeclaredCapacity.ts @@ -3,56 +3,98 @@ * @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 { ResourceDeclaredCapacity, ResourceDeclaredCapacityWithRelations, ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityFilter, ResourceDeclaredCapacityOrderBy, CreateResourceDeclaredCapacityInput, UpdateResourceDeclaredCapacityInput, ResourceDeclaredCapacityPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceDeclaredCapacity, + ResourceDeclaredCapacityWithRelations, + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy, + CreateResourceDeclaredCapacityInput, + UpdateResourceDeclaredCapacityInput, + ResourceDeclaredCapacityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceDeclaredCapacityModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceDeclaredCapacities: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDeclaredCapacity", "resourceDeclaredCapacities", 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 - }, "ResourceDeclaredCapacityFilter", "ResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceDeclaredCapacity', + 'resourceDeclaredCapacities', + 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, + }, + 'ResourceDeclaredCapacityFilter', + 'ResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDeclaredCapacity", - fieldName: "resourceDeclaredCapacities", + operation: 'query', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'resourceDeclaredCapacities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDeclaredCapacity: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceDeclaredCapacity", "resourceDeclaredCapacities", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceDeclaredCapacityFilter", "ResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceDeclaredCapacity', + 'resourceDeclaredCapacities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceDeclaredCapacityFilter', + 'ResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDeclaredCapacity", - fieldName: "resourceDeclaredCapacity", + operation: 'query', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'resourceDeclaredCapacity', document, variables, transform: (data: { @@ -60,28 +102,35 @@ export class ResourceDeclaredCapacityModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDeclaredCapacity": data.resourceDeclaredCapacities?.nodes?.[0] ?? null - }) + resourceDeclaredCapacity: data.resourceDeclaredCapacities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceDeclaredCapacity: { resourceDeclaredCapacity: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceDeclaredCapacity", "createResourceDeclaredCapacity", "resourceDeclaredCapacity", args.select, args.data, "CreateResourceDeclaredCapacityInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceDeclaredCapacity', + 'createResourceDeclaredCapacity', + 'resourceDeclaredCapacity', + args.select, + args.data, + 'CreateResourceDeclaredCapacityInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDeclaredCapacity", - fieldName: "createResourceDeclaredCapacity", + operation: 'mutation', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'createResourceDeclaredCapacity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourceDefinition.ts b/sdk/constructive-react/src/compute/orm/models/resourceDefinition.ts index 3602f40743..26be134a8b 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourceDefinition.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourceDefinition.ts @@ -3,56 +3,96 @@ * @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 { ResourceDefinition, ResourceDefinitionWithRelations, ResourceDefinitionSelect, ResourceDefinitionFilter, ResourceDefinitionOrderBy, CreateResourceDefinitionInput, UpdateResourceDefinitionInput, ResourceDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceDefinition, + ResourceDefinitionWithRelations, + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy, + CreateResourceDefinitionInput, + UpdateResourceDefinitionInput, + ResourceDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDefinition", "resourceDefinitions", 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 - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceDefinition', + 'resourceDefinitions', + 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, + }, + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinitions", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceDefinition", "resourceDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceDefinition', + 'resourceDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinition", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDefinition": data.resourceDefinitions?.nodes?.[0] ?? null - }) + resourceDefinition: data.resourceDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDefinition", "resourceDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceDefinition', + 'resourceDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinition", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDefinition": data.resourceDefinitions?.nodes?.[0] ?? null - }) + resourceDefinition: data.resourceDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceDefinition", "createResourceDefinition", "resourceDefinition", args.select, args.data, "CreateResourceDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceDefinition', + 'createResourceDefinition', + 'resourceDefinition', + args.select, + args.data, + 'CreateResourceDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "createResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'createResourceDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceDefinition", "updateResourceDefinition", "resourceDefinition", args.select, args.where.id, args.data, "UpdateResourceDefinitionInput", "id", "resourceDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceDefinition', + 'updateResourceDefinition', + 'resourceDefinition', + args.select, + args.where.id, + args.data, + 'UpdateResourceDefinitionInput', + 'id', + 'resourceDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "updateResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'updateResourceDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceDefinition", "deleteResourceDefinition", "resourceDefinition", { - id: args.where.id - }, "DeleteResourceDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceDefinition', + 'deleteResourceDefinition', + 'resourceDefinition', + { + id: args.where.id, + }, + 'DeleteResourceDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "deleteResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'deleteResourceDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourceEvent.ts b/sdk/constructive-react/src/compute/orm/models/resourceEvent.ts index f305a67427..9796098dc8 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourceEvent.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourceEvent.ts @@ -3,56 +3,96 @@ * @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 { ResourceEvent, ResourceEventWithRelations, ResourceEventSelect, ResourceEventFilter, ResourceEventOrderBy, CreateResourceEventInput, UpdateResourceEventInput, ResourceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceEvent, + ResourceEventWithRelations, + ResourceEventSelect, + ResourceEventFilter, + ResourceEventOrderBy, + CreateResourceEventInput, + UpdateResourceEventInput, + ResourceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceEvent", "resourceEvents", 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 - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceEvent', + 'resourceEvents', + 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, + }, + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvents", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceEvent", "resourceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceEvent', + 'resourceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvent", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceEvent": data.resourceEvents?.nodes?.[0] ?? null - }) + resourceEvent: data.resourceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceEvent", "resourceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceEvent', + 'resourceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvent", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class ResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceEvent": data.resourceEvents?.nodes?.[0] ?? null - }) + resourceEvent: data.resourceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceEvent", "createResourceEvent", "resourceEvent", args.select, args.data, "CreateResourceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceEvent', + 'createResourceEvent', + 'resourceEvent', + args.select, + args.data, + 'CreateResourceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "createResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'createResourceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + ResourceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceEvent", "updateResourceEvent", "resourceEvent", args.select, args.where.id, args.data, "UpdateResourceEventInput", "id", "resourceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceEvent', + 'updateResourceEvent', + 'resourceEvent', + args.select, + args.where.id, + args.data, + 'UpdateResourceEventInput', + 'id', + 'resourceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "updateResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'updateResourceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceEvent", "deleteResourceEvent", "resourceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteResourceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceEvent', + 'deleteResourceEvent', + 'resourceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteResourceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "deleteResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'deleteResourceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourceInstallation.ts b/sdk/constructive-react/src/compute/orm/models/resourceInstallation.ts index 105f1b9ce5..dcdd64c3fd 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourceInstallation.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourceInstallation.ts @@ -3,56 +3,98 @@ * @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 { ResourceInstallation, ResourceInstallationWithRelations, ResourceInstallationSelect, ResourceInstallationFilter, ResourceInstallationOrderBy, CreateResourceInstallationInput, UpdateResourceInstallationInput, ResourceInstallationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceInstallation, + ResourceInstallationWithRelations, + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy, + CreateResourceInstallationInput, + UpdateResourceInstallationInput, + ResourceInstallationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceInstallationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceInstallations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceInstallations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceInstallation", "resourceInstallations", 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 - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceInstallation', + 'resourceInstallations', + 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, + }, + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallations", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceInstallation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceInstallation", "resourceInstallations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceInstallation', + 'resourceInstallations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallation", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallation', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceInstallation": data.resourceInstallations?.nodes?.[0] ?? null - }) + resourceInstallation: data.resourceInstallations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceInstallation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceInstallation", "resourceInstallations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceInstallation', + 'resourceInstallations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallation", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallation', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceInstallation": data.resourceInstallations?.nodes?.[0] ?? null - }) + resourceInstallation: data.resourceInstallations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceInstallation", "createResourceInstallation", "resourceInstallation", args.select, args.data, "CreateResourceInstallationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceInstallation', + 'createResourceInstallation', + 'resourceInstallation', + args.select, + args.data, + 'CreateResourceInstallationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "createResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'createResourceInstallation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceInstallationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceInstallation", "updateResourceInstallation", "resourceInstallation", args.select, args.where.id, args.data, "UpdateResourceInstallationInput", "id", "resourceInstallationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceInstallation', + 'updateResourceInstallation', + 'resourceInstallation', + args.select, + args.where.id, + args.data, + 'UpdateResourceInstallationInput', + 'id', + 'resourceInstallationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "updateResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'updateResourceInstallation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceInstallation", "deleteResourceInstallation", "resourceInstallation", { - id: args.where.id - }, "DeleteResourceInstallationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceInstallation', + 'deleteResourceInstallation', + 'resourceInstallation', + { + id: args.where.id, + }, + 'DeleteResourceInstallationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "deleteResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'deleteResourceInstallation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourceStatusCheck.ts b/sdk/constructive-react/src/compute/orm/models/resourceStatusCheck.ts index 31433f3673..e7241931ee 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourceStatusCheck.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourceStatusCheck.ts @@ -3,56 +3,96 @@ * @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 { ResourceStatusCheck, ResourceStatusCheckWithRelations, ResourceStatusCheckSelect, ResourceStatusCheckFilter, ResourceStatusCheckOrderBy, CreateResourceStatusCheckInput, UpdateResourceStatusCheckInput, ResourceStatusCheckPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceStatusCheck, + ResourceStatusCheckWithRelations, + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy, + CreateResourceStatusCheckInput, + UpdateResourceStatusCheckInput, + ResourceStatusCheckPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceStatusCheckModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusChecks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceStatusCheck", "resourceStatusChecks", 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 - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + 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, + }, + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusChecks", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusChecks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusCheck: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceStatusCheck", "resourceStatusChecks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusCheck", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusCheck', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceStatusCheck": data.resourceStatusChecks?.nodes?.[0] ?? null - }) + resourceStatusCheck: data.resourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusCheck: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceStatusCheck", "resourceStatusChecks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusCheck", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusCheck', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceStatusCheck": data.resourceStatusChecks?.nodes?.[0] ?? null - }) + resourceStatusCheck: data.resourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceStatusCheck", "createResourceStatusCheck", "resourceStatusCheck", args.select, args.data, "CreateResourceStatusCheckInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceStatusCheck', + 'createResourceStatusCheck', + 'resourceStatusCheck', + args.select, + args.data, + 'CreateResourceStatusCheckInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "createResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'createResourceStatusCheck', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceStatusCheckPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceStatusCheck", "updateResourceStatusCheck", "resourceStatusCheck", args.select, args.where.id, args.data, "UpdateResourceStatusCheckInput", "id", "resourceStatusCheckPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceStatusCheck', + 'updateResourceStatusCheck', + 'resourceStatusCheck', + args.select, + args.where.id, + args.data, + 'UpdateResourceStatusCheckInput', + 'id', + 'resourceStatusCheckPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "updateResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'updateResourceStatusCheck', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceStatusCheck", "deleteResourceStatusCheck", "resourceStatusCheck", { - id: args.where.id - }, "DeleteResourceStatusCheckInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceStatusCheck', + 'deleteResourceStatusCheck', + 'resourceStatusCheck', + { + id: args.where.id, + }, + 'DeleteResourceStatusCheckInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "deleteResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'deleteResourceStatusCheck', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourceUsageLog.ts b/sdk/constructive-react/src/compute/orm/models/resourceUsageLog.ts index fe263b008f..d5f3f5c79a 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourceUsageLog.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourceUsageLog.ts @@ -3,56 +3,96 @@ * @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 { ResourceUsageLog, ResourceUsageLogWithRelations, ResourceUsageLogSelect, ResourceUsageLogFilter, ResourceUsageLogOrderBy, CreateResourceUsageLogInput, UpdateResourceUsageLogInput, ResourceUsageLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUsageLog, + ResourceUsageLogWithRelations, + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy, + CreateResourceUsageLogInput, + UpdateResourceUsageLogInput, + ResourceUsageLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUsageLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLogs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageLog", "resourceUsageLogs", 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 - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + 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, + }, + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLogs", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUsageLog", "resourceUsageLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLog", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLog', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageLog": data.resourceUsageLogs?.nodes?.[0] ?? null - }) + resourceUsageLog: data.resourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageLog", "resourceUsageLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLog", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLog', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class ResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageLog": data.resourceUsageLogs?.nodes?.[0] ?? null - }) + resourceUsageLog: data.resourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUsageLog", "createResourceUsageLog", "resourceUsageLog", args.select, args.data, "CreateResourceUsageLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUsageLog', + 'createResourceUsageLog', + 'resourceUsageLog', + args.select, + args.data, + 'CreateResourceUsageLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "createResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'createResourceUsageLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + sampledAt: string; + }, + ResourceUsageLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceUsageLog", "updateResourceUsageLog", "resourceUsageLog", args.select, args.where.id, args.data, "UpdateResourceUsageLogInput", "id", "resourceUsageLogPatch", connectionFieldsMap, { - sampledAt: args.where.sampledAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceUsageLog', + 'updateResourceUsageLog', + 'resourceUsageLog', + args.select, + args.where.id, + args.data, + 'UpdateResourceUsageLogInput', + 'id', + 'resourceUsageLogPatch', + connectionFieldsMap, + { + sampledAt: args.where.sampledAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "updateResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'updateResourceUsageLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - sampledAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + sampledAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceUsageLog", "deleteResourceUsageLog", "resourceUsageLog", { - id: args.where.id, - sampledAt: args.where.sampledAt - }, "DeleteResourceUsageLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceUsageLog', + 'deleteResourceUsageLog', + 'resourceUsageLog', + { + id: args.where.id, + sampledAt: args.where.sampledAt, + }, + 'DeleteResourceUsageLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "deleteResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'deleteResourceUsageLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourceUsageSummary.ts b/sdk/constructive-react/src/compute/orm/models/resourceUsageSummary.ts index c4155013d3..3024a18d37 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourceUsageSummary.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourceUsageSummary.ts @@ -3,56 +3,98 @@ * @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 { ResourceUsageSummary, ResourceUsageSummaryWithRelations, ResourceUsageSummarySelect, ResourceUsageSummaryFilter, ResourceUsageSummaryOrderBy, CreateResourceUsageSummaryInput, UpdateResourceUsageSummaryInput, ResourceUsageSummaryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUsageSummary, + ResourceUsageSummaryWithRelations, + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy, + CreateResourceUsageSummaryInput, + UpdateResourceUsageSummaryInput, + ResourceUsageSummaryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUsageSummaryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceUsageSummaries: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceUsageSummaries: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageSummary", "resourceUsageSummaries", 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 - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + 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, + }, + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummaries", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummaries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageSummary: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUsageSummary", "resourceUsageSummaries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummary", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummary', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageSummary": data.resourceUsageSummaries?.nodes?.[0] ?? null - }) + resourceUsageSummary: data.resourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageSummary: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageSummary", "resourceUsageSummaries", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummary", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummary', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class ResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageSummary": data.resourceUsageSummaries?.nodes?.[0] ?? null - }) + resourceUsageSummary: data.resourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUsageSummary", "createResourceUsageSummary", "resourceUsageSummary", args.select, args.data, "CreateResourceUsageSummaryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUsageSummary', + 'createResourceUsageSummary', + 'resourceUsageSummary', + args.select, + args.data, + 'CreateResourceUsageSummaryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "createResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'createResourceUsageSummary', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + date: string; + }, + ResourceUsageSummaryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceUsageSummary", "updateResourceUsageSummary", "resourceUsageSummary", args.select, args.where.id, args.data, "UpdateResourceUsageSummaryInput", "id", "resourceUsageSummaryPatch", connectionFieldsMap, { - date: args.where.date - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceUsageSummary', + 'updateResourceUsageSummary', + 'resourceUsageSummary', + args.select, + args.where.id, + args.data, + 'UpdateResourceUsageSummaryInput', + 'id', + 'resourceUsageSummaryPatch', + connectionFieldsMap, + { + date: args.where.date, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "updateResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'updateResourceUsageSummary', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - date: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + date: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceUsageSummary", "deleteResourceUsageSummary", "resourceUsageSummary", { - id: args.where.id, - date: args.where.date - }, "DeleteResourceUsageSummaryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceUsageSummary', + 'deleteResourceUsageSummary', + 'resourceUsageSummary', + { + id: args.where.id, + date: args.where.date, + }, + 'DeleteResourceUsageSummaryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "deleteResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'deleteResourceUsageSummary', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourceUtilization.ts b/sdk/constructive-react/src/compute/orm/models/resourceUtilization.ts index 9314102ed0..3620486000 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourceUtilization.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourceUtilization.ts @@ -3,56 +3,96 @@ * @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 { ResourceUtilization, ResourceUtilizationWithRelations, ResourceUtilizationSelect, ResourceUtilizationFilter, ResourceUtilizationOrderBy, CreateResourceUtilizationInput, UpdateResourceUtilizationInput, ResourceUtilizationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUtilization, + ResourceUtilizationWithRelations, + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy, + CreateResourceUtilizationInput, + UpdateResourceUtilizationInput, + ResourceUtilizationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUtilizationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUtilizations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUtilization", "resourceUtilizations", 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 - }, "ResourceUtilizationFilter", "ResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUtilization', + 'resourceUtilizations', + 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, + }, + 'ResourceUtilizationFilter', + 'ResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUtilization", - fieldName: "resourceUtilizations", + operation: 'query', + operationName: 'ResourceUtilization', + fieldName: 'resourceUtilizations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUtilization: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUtilization", "resourceUtilizations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUtilizationFilter", "ResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUtilization', + 'resourceUtilizations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUtilizationFilter', + 'ResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUtilization", - fieldName: "resourceUtilization", + operation: 'query', + operationName: 'ResourceUtilization', + fieldName: 'resourceUtilization', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class ResourceUtilizationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUtilization": data.resourceUtilizations?.nodes?.[0] ?? null - }) + resourceUtilization: data.resourceUtilizations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUtilization: { resourceUtilization: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUtilization", "createResourceUtilization", "resourceUtilization", args.select, args.data, "CreateResourceUtilizationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUtilization', + 'createResourceUtilization', + 'resourceUtilization', + args.select, + args.data, + 'CreateResourceUtilizationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUtilization", - fieldName: "createResourceUtilization", + operation: 'mutation', + operationName: 'ResourceUtilization', + fieldName: 'createResourceUtilization', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourcesHealth.ts b/sdk/constructive-react/src/compute/orm/models/resourcesHealth.ts index 5e4515d396..1ac97bab3d 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourcesHealth.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourcesHealth.ts @@ -3,56 +3,96 @@ * @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 { ResourcesHealth, ResourcesHealthWithRelations, ResourcesHealthSelect, ResourcesHealthFilter, ResourcesHealthOrderBy, CreateResourcesHealthInput, UpdateResourcesHealthInput, ResourcesHealthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesHealth, + ResourcesHealthWithRelations, + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy, + CreateResourcesHealthInput, + UpdateResourcesHealthInput, + ResourcesHealthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesHealthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealths: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesHealth", "resourcesHealths", 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 - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesHealth', + 'resourcesHealths', + 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, + }, + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealths", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesHealth", "resourcesHealths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesHealth', + 'resourcesHealths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealth", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealth', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesHealth": data.resourcesHealths?.nodes?.[0] ?? null - }) + resourcesHealth: data.resourcesHealths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesHealth", "resourcesHealths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourcesHealth', + 'resourcesHealths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealth", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealth', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class ResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesHealth": data.resourcesHealths?.nodes?.[0] ?? null - }) + resourcesHealth: data.resourcesHealths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesHealth: { resourcesHealth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesHealth", "createResourcesHealth", "resourcesHealth", args.select, args.data, "CreateResourcesHealthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesHealth', + 'createResourcesHealth', + 'resourcesHealth', + args.select, + args.data, + 'CreateResourcesHealthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesHealth", - fieldName: "createResourcesHealth", + operation: 'mutation', + operationName: 'ResourcesHealth', + fieldName: 'createResourcesHealth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourcesRequirementsState.ts b/sdk/constructive-react/src/compute/orm/models/resourcesRequirementsState.ts index f1a5f93c93..8ce68f6a31 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourcesRequirementsState.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourcesRequirementsState.ts @@ -3,56 +3,101 @@ * @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 { ResourcesRequirementsState, ResourcesRequirementsStateWithRelations, ResourcesRequirementsStateSelect, ResourcesRequirementsStateFilter, ResourcesRequirementsStateOrderBy, CreateResourcesRequirementsStateInput, UpdateResourcesRequirementsStateInput, ResourcesRequirementsStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesRequirementsState, + ResourcesRequirementsStateWithRelations, + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy, + CreateResourcesRequirementsStateInput, + UpdateResourcesRequirementsStateInput, + ResourcesRequirementsStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesRequirementsStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesRequirementsStates: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesRequirementsState", "resourcesRequirementsStates", 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 - }, "ResourcesRequirementsStateFilter", "ResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesRequirementsState', + 'resourcesRequirementsStates', + 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, + }, + 'ResourcesRequirementsStateFilter', + 'ResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesRequirementsState", - fieldName: "resourcesRequirementsStates", + operation: 'query', + operationName: 'ResourcesRequirementsState', + fieldName: 'resourcesRequirementsStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesRequirementsState: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesRequirementsState: InferSelectResult< + ResourcesRequirementsStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesRequirementsState", "resourcesRequirementsStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesRequirementsStateFilter", "ResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesRequirementsState', + 'resourcesRequirementsStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesRequirementsStateFilter', + 'ResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesRequirementsState", - fieldName: "resourcesRequirementsState", + operation: 'query', + operationName: 'ResourcesRequirementsState', + fieldName: 'resourcesRequirementsState', document, variables, transform: (data: { @@ -60,28 +105,35 @@ export class ResourcesRequirementsStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesRequirementsState": data.resourcesRequirementsStates?.nodes?.[0] ?? null - }) + resourcesRequirementsState: data.resourcesRequirementsStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesRequirementsState: { resourcesRequirementsState: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesRequirementsState", "createResourcesRequirementsState", "resourcesRequirementsState", args.select, args.data, "CreateResourcesRequirementsStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesRequirementsState', + 'createResourcesRequirementsState', + 'resourcesRequirementsState', + args.select, + args.data, + 'CreateResourcesRequirementsStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesRequirementsState", - fieldName: "createResourcesRequirementsState", + operation: 'mutation', + operationName: 'ResourcesRequirementsState', + fieldName: 'createResourcesRequirementsState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/resourcesResolvedRequirement.ts b/sdk/constructive-react/src/compute/orm/models/resourcesResolvedRequirement.ts index 4f46896bdc..40680dcfb3 100644 --- a/sdk/constructive-react/src/compute/orm/models/resourcesResolvedRequirement.ts +++ b/sdk/constructive-react/src/compute/orm/models/resourcesResolvedRequirement.ts @@ -3,56 +3,109 @@ * @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 { ResourcesResolvedRequirement, ResourcesResolvedRequirementWithRelations, ResourcesResolvedRequirementSelect, ResourcesResolvedRequirementFilter, ResourcesResolvedRequirementOrderBy, CreateResourcesResolvedRequirementInput, UpdateResourcesResolvedRequirementInput, ResourcesResolvedRequirementPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesResolvedRequirement, + ResourcesResolvedRequirementWithRelations, + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy, + CreateResourcesResolvedRequirementInput, + UpdateResourcesResolvedRequirementInput, + ResourcesResolvedRequirementPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesResolvedRequirementModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesResolvedRequirements: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesResolvedRequirement", "resourcesResolvedRequirements", 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 - }, "ResourcesResolvedRequirementFilter", "ResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesResolvedRequirement', + 'resourcesResolvedRequirements', + 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, + }, + 'ResourcesResolvedRequirementFilter', + 'ResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesResolvedRequirement", - fieldName: "resourcesResolvedRequirements", + operation: 'query', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'resourcesResolvedRequirements', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesResolvedRequirement: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesResolvedRequirement: InferSelectResult< + ResourcesResolvedRequirementWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesResolvedRequirement", "resourcesResolvedRequirements", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesResolvedRequirementFilter", "ResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesResolvedRequirement', + 'resourcesResolvedRequirements', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesResolvedRequirementFilter', + 'ResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesResolvedRequirement", - fieldName: "resourcesResolvedRequirement", + operation: 'query', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'resourcesResolvedRequirement', document, variables, transform: (data: { @@ -60,28 +113,35 @@ export class ResourcesResolvedRequirementModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesResolvedRequirement": data.resourcesResolvedRequirements?.nodes?.[0] ?? null - }) + resourcesResolvedRequirement: data.resourcesResolvedRequirements?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesResolvedRequirement: { resourcesResolvedRequirement: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesResolvedRequirement", "createResourcesResolvedRequirement", "resourcesResolvedRequirement", args.select, args.data, "CreateResourcesResolvedRequirementInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesResolvedRequirement', + 'createResourcesResolvedRequirement', + 'resourcesResolvedRequirement', + args.select, + args.data, + 'CreateResourcesResolvedRequirementInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesResolvedRequirement", - fieldName: "createResourcesResolvedRequirement", + operation: 'mutation', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'createResourcesResolvedRequirement', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/webhookEndpoint.ts b/sdk/constructive-react/src/compute/orm/models/webhookEndpoint.ts index 844febe287..a76f34249c 100644 --- a/sdk/constructive-react/src/compute/orm/models/webhookEndpoint.ts +++ b/sdk/constructive-react/src/compute/orm/models/webhookEndpoint.ts @@ -3,56 +3,96 @@ * @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 { WebhookEndpoint, WebhookEndpointWithRelations, WebhookEndpointSelect, WebhookEndpointFilter, WebhookEndpointOrderBy, CreateWebhookEndpointInput, UpdateWebhookEndpointInput, WebhookEndpointPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookEndpoint, + WebhookEndpointWithRelations, + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy, + CreateWebhookEndpointInput, + UpdateWebhookEndpointInput, + WebhookEndpointPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookEndpointModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEndpoint", "webhookEndpoints", 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 - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + 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, + }, + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoints", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookEndpoint", "webhookEndpoints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoint", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEndpoint": data.webhookEndpoints?.nodes?.[0] ?? null - }) + webhookEndpoint: data.webhookEndpoints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEndpoint", "webhookEndpoints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoint", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEndpoint": data.webhookEndpoints?.nodes?.[0] ?? null - }) + webhookEndpoint: data.webhookEndpoints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookEndpoint", "createWebhookEndpoint", "webhookEndpoint", args.select, args.data, "CreateWebhookEndpointInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookEndpoint', + 'createWebhookEndpoint', + 'webhookEndpoint', + args.select, + args.data, + 'CreateWebhookEndpointInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "createWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'createWebhookEndpoint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookEndpointPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookEndpoint", "updateWebhookEndpoint", "webhookEndpoint", args.select, args.where.id, args.data, "UpdateWebhookEndpointInput", "id", "webhookEndpointPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookEndpoint', + 'updateWebhookEndpoint', + 'webhookEndpoint', + args.select, + args.where.id, + args.data, + 'UpdateWebhookEndpointInput', + 'id', + 'webhookEndpointPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "updateWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'updateWebhookEndpoint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookEndpoint", "deleteWebhookEndpoint", "webhookEndpoint", { - id: args.where.id - }, "DeleteWebhookEndpointInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookEndpoint', + 'deleteWebhookEndpoint', + 'webhookEndpoint', + { + id: args.where.id, + }, + 'DeleteWebhookEndpointInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "deleteWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'deleteWebhookEndpoint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/models/webhookEvent.ts b/sdk/constructive-react/src/compute/orm/models/webhookEvent.ts index c4651cd89e..0a52d397e3 100644 --- a/sdk/constructive-react/src/compute/orm/models/webhookEvent.ts +++ b/sdk/constructive-react/src/compute/orm/models/webhookEvent.ts @@ -3,56 +3,96 @@ * @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 { WebhookEvent, WebhookEventWithRelations, WebhookEventSelect, WebhookEventFilter, WebhookEventOrderBy, CreateWebhookEventInput, UpdateWebhookEventInput, WebhookEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookEvent, + WebhookEventWithRelations, + WebhookEventSelect, + WebhookEventFilter, + WebhookEventOrderBy, + CreateWebhookEventInput, + UpdateWebhookEventInput, + WebhookEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEvent", "webhookEvents", 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 - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookEvent', + 'webhookEvents', + 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, + }, + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvents", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookEvent", "webhookEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookEvent', + 'webhookEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvent", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEvent": data.webhookEvents?.nodes?.[0] ?? null - }) + webhookEvent: data.webhookEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEvent", "webhookEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookEvent', + 'webhookEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvent", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEvent": data.webhookEvents?.nodes?.[0] ?? null - }) + webhookEvent: data.webhookEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookEvent", "createWebhookEvent", "webhookEvent", args.select, args.data, "CreateWebhookEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookEvent', + 'createWebhookEvent', + 'webhookEvent', + args.select, + args.data, + 'CreateWebhookEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "createWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'createWebhookEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookEvent", "updateWebhookEvent", "webhookEvent", args.select, args.where.id, args.data, "UpdateWebhookEventInput", "id", "webhookEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookEvent', + 'updateWebhookEvent', + 'webhookEvent', + args.select, + args.where.id, + args.data, + 'UpdateWebhookEventInput', + 'id', + 'webhookEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "updateWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'updateWebhookEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookEvent", "deleteWebhookEvent", "webhookEvent", { - id: args.where.id - }, "DeleteWebhookEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookEvent', + 'deleteWebhookEvent', + 'webhookEvent', + { + id: args.where.id, + }, + 'DeleteWebhookEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "deleteWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'deleteWebhookEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/mutation/index.ts b/sdk/constructive-react/src/compute/orm/mutation/index.ts index c65d39c17a..c5bc975047 100644 --- a/sdk/constructive-react/src/compute/orm/mutation/index.ts +++ b/sdk/constructive-react/src/compute/orm/mutation/index.ts @@ -3,11 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AddEdgeInput, AddEdgeAndSaveInput, AddNodeInput, AddNodeAndSaveInput, CopyGraphInput, ImportDefinitionsInput, ImportGraphJsonInput, InfraInitEmptyRepoInput, InfraInsertNodeAtPathInput, InfraSetDataAtPathInput, InitEmptyRepoInput, InsertNodeAtPathInput, PlatformInfraInitEmptyRepoInput, PlatformInfraInsertNodeAtPathInput, PlatformInfraSetDataAtPathInput, PlatformResourceInstallationsInstallInput, PlatformResourceInstallationsRollbackInput, PlatformResourceInstallationsUninstallInput, PlatformResourceInstallationsUpgradeInput, ProvisionBucketInput, ResourceInstallationsInstallInput, ResourceInstallationsRollbackInput, ResourceInstallationsUninstallInput, ResourceInstallationsUpgradeInput, SaveGraphInput, SetDataAtPathInput, StartExecutionInput, ValidateFunctionGraphInput, AddEdgePayload, AddEdgeAndSavePayload, AddNodePayload, AddNodeAndSavePayload, CopyGraphPayload, ImportDefinitionsPayload, ImportGraphJsonPayload, InfraInitEmptyRepoPayload, InfraInsertNodeAtPathPayload, InfraSetDataAtPathPayload, InitEmptyRepoPayload, InsertNodeAtPathPayload, PlatformInfraInitEmptyRepoPayload, PlatformInfraInsertNodeAtPathPayload, PlatformInfraSetDataAtPathPayload, PlatformResourceInstallationsInstallPayload, PlatformResourceInstallationsRollbackPayload, PlatformResourceInstallationsUninstallPayload, PlatformResourceInstallationsUpgradePayload, ProvisionBucketPayload, ResourceInstallationsInstallPayload, ResourceInstallationsRollbackPayload, ResourceInstallationsUninstallPayload, ResourceInstallationsUpgradePayload, SaveGraphPayload, SetDataAtPathPayload, StartExecutionPayload, ValidateFunctionGraphPayload, AddEdgePayloadSelect, AddEdgeAndSavePayloadSelect, AddNodePayloadSelect, AddNodeAndSavePayloadSelect, CopyGraphPayloadSelect, ImportDefinitionsPayloadSelect, ImportGraphJsonPayloadSelect, InfraInitEmptyRepoPayloadSelect, InfraInsertNodeAtPathPayloadSelect, InfraSetDataAtPathPayloadSelect, InitEmptyRepoPayloadSelect, InsertNodeAtPathPayloadSelect, PlatformInfraInitEmptyRepoPayloadSelect, PlatformInfraInsertNodeAtPathPayloadSelect, PlatformInfraSetDataAtPathPayloadSelect, PlatformResourceInstallationsInstallPayloadSelect, PlatformResourceInstallationsRollbackPayloadSelect, PlatformResourceInstallationsUninstallPayloadSelect, PlatformResourceInstallationsUpgradePayloadSelect, ProvisionBucketPayloadSelect, ResourceInstallationsInstallPayloadSelect, ResourceInstallationsRollbackPayloadSelect, ResourceInstallationsUninstallPayloadSelect, ResourceInstallationsUpgradePayloadSelect, SaveGraphPayloadSelect, SetDataAtPathPayloadSelect, StartExecutionPayloadSelect, ValidateFunctionGraphPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + AddEdgeInput, + AddEdgeAndSaveInput, + AddNodeInput, + AddNodeAndSaveInput, + CopyGraphInput, + ImportDefinitionsInput, + ImportGraphJsonInput, + InfraInitEmptyRepoInput, + InfraInsertNodeAtPathInput, + InfraSetDataAtPathInput, + InitEmptyRepoInput, + InsertNodeAtPathInput, + PlatformInfraInitEmptyRepoInput, + PlatformInfraInsertNodeAtPathInput, + PlatformInfraSetDataAtPathInput, + PlatformResourceInstallationsInstallInput, + PlatformResourceInstallationsRollbackInput, + PlatformResourceInstallationsUninstallInput, + PlatformResourceInstallationsUpgradeInput, + ProvisionBucketInput, + ResourceInstallationsInstallInput, + ResourceInstallationsRollbackInput, + ResourceInstallationsUninstallInput, + ResourceInstallationsUpgradeInput, + SaveGraphInput, + SetDataAtPathInput, + StartExecutionInput, + ValidateFunctionGraphInput, + AddEdgePayload, + AddEdgeAndSavePayload, + AddNodePayload, + AddNodeAndSavePayload, + CopyGraphPayload, + ImportDefinitionsPayload, + ImportGraphJsonPayload, + InfraInitEmptyRepoPayload, + InfraInsertNodeAtPathPayload, + InfraSetDataAtPathPayload, + InitEmptyRepoPayload, + InsertNodeAtPathPayload, + PlatformInfraInitEmptyRepoPayload, + PlatformInfraInsertNodeAtPathPayload, + PlatformInfraSetDataAtPathPayload, + PlatformResourceInstallationsInstallPayload, + PlatformResourceInstallationsRollbackPayload, + PlatformResourceInstallationsUninstallPayload, + PlatformResourceInstallationsUpgradePayload, + ProvisionBucketPayload, + ResourceInstallationsInstallPayload, + ResourceInstallationsRollbackPayload, + ResourceInstallationsUninstallPayload, + ResourceInstallationsUpgradePayload, + SaveGraphPayload, + SetDataAtPathPayload, + StartExecutionPayload, + ValidateFunctionGraphPayload, + AddEdgePayloadSelect, + AddEdgeAndSavePayloadSelect, + AddNodePayloadSelect, + AddNodeAndSavePayloadSelect, + CopyGraphPayloadSelect, + ImportDefinitionsPayloadSelect, + ImportGraphJsonPayloadSelect, + InfraInitEmptyRepoPayloadSelect, + InfraInsertNodeAtPathPayloadSelect, + InfraSetDataAtPathPayloadSelect, + InitEmptyRepoPayloadSelect, + InsertNodeAtPathPayloadSelect, + PlatformInfraInitEmptyRepoPayloadSelect, + PlatformInfraInsertNodeAtPathPayloadSelect, + PlatformInfraSetDataAtPathPayloadSelect, + PlatformResourceInstallationsInstallPayloadSelect, + PlatformResourceInstallationsRollbackPayloadSelect, + PlatformResourceInstallationsUninstallPayloadSelect, + PlatformResourceInstallationsUpgradePayloadSelect, + ProvisionBucketPayloadSelect, + ResourceInstallationsInstallPayloadSelect, + ResourceInstallationsRollbackPayloadSelect, + ResourceInstallationsUninstallPayloadSelect, + ResourceInstallationsUpgradePayloadSelect, + SaveGraphPayloadSelect, + SetDataAtPathPayloadSelect, + StartExecutionPayloadSelect, + ValidateFunctionGraphPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AddEdgeVariables { input: AddEdgeInput; } @@ -101,397 +186,852 @@ export interface ValidateFunctionGraphVariables { } export function createMutationOperations(client: OrmClient) { return { - addEdge: (args: AddEdgeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addEdge: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddEdge", - fieldName: "addEdge", - ...buildCustomDocument("mutation", "AddEdge", "addEdge", options.select, args, [{ - name: "input", - type: "AddEdgeInput!" - }], connectionFieldsMap, "AddEdgePayload") - }), - addEdgeAndSave: (args: AddEdgeAndSaveVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addEdgeAndSave: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddEdgeAndSave", - fieldName: "addEdgeAndSave", - ...buildCustomDocument("mutation", "AddEdgeAndSave", "addEdgeAndSave", options.select, args, [{ - name: "input", - type: "AddEdgeAndSaveInput!" - }], connectionFieldsMap, "AddEdgeAndSavePayload") - }), - addNode: (args: AddNodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addNode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddNode", - fieldName: "addNode", - ...buildCustomDocument("mutation", "AddNode", "addNode", options.select, args, [{ - name: "input", - type: "AddNodeInput!" - }], connectionFieldsMap, "AddNodePayload") - }), - addNodeAndSave: (args: AddNodeAndSaveVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addNodeAndSave: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddNodeAndSave", - fieldName: "addNodeAndSave", - ...buildCustomDocument("mutation", "AddNodeAndSave", "addNodeAndSave", options.select, args, [{ - name: "input", - type: "AddNodeAndSaveInput!" - }], connectionFieldsMap, "AddNodeAndSavePayload") - }), - copyGraph: (args: CopyGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - copyGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CopyGraph", - fieldName: "copyGraph", - ...buildCustomDocument("mutation", "CopyGraph", "copyGraph", options.select, args, [{ - name: "input", - type: "CopyGraphInput!" - }], connectionFieldsMap, "CopyGraphPayload") - }), - importDefinitions: (args: ImportDefinitionsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - importDefinitions: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ImportDefinitions", - fieldName: "importDefinitions", - ...buildCustomDocument("mutation", "ImportDefinitions", "importDefinitions", options.select, args, [{ - name: "input", - type: "ImportDefinitionsInput!" - }], connectionFieldsMap, "ImportDefinitionsPayload") - }), - 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") - }), - infraInitEmptyRepo: (args: InfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraInitEmptyRepo", - fieldName: "infraInitEmptyRepo", - ...buildCustomDocument("mutation", "InfraInitEmptyRepo", "infraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "InfraInitEmptyRepoInput!" - }], connectionFieldsMap, "InfraInitEmptyRepoPayload") - }), - infraInsertNodeAtPath: (args: InfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraInsertNodeAtPath", - fieldName: "infraInsertNodeAtPath", - ...buildCustomDocument("mutation", "InfraInsertNodeAtPath", "infraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "InfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "InfraInsertNodeAtPathPayload") - }), - infraSetDataAtPath: (args: InfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraSetDataAtPath", - fieldName: "infraSetDataAtPath", - ...buildCustomDocument("mutation", "InfraSetDataAtPath", "infraSetDataAtPath", options.select, args, [{ - name: "input", - type: "InfraSetDataAtPathInput!" - }], connectionFieldsMap, "InfraSetDataAtPathPayload") - }), - initEmptyRepo: (args: InitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - initEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InitEmptyRepo", - fieldName: "initEmptyRepo", - ...buildCustomDocument("mutation", "InitEmptyRepo", "initEmptyRepo", options.select, args, [{ - name: "input", - type: "InitEmptyRepoInput!" - }], connectionFieldsMap, "InitEmptyRepoPayload") - }), - insertNodeAtPath: (args: InsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - insertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InsertNodeAtPath", - fieldName: "insertNodeAtPath", - ...buildCustomDocument("mutation", "InsertNodeAtPath", "insertNodeAtPath", options.select, args, [{ - name: "input", - type: "InsertNodeAtPathInput!" - }], connectionFieldsMap, "InsertNodeAtPathPayload") - }), - platformInfraInitEmptyRepo: (args: PlatformInfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInitEmptyRepo", - fieldName: "platformInfraInitEmptyRepo", - ...buildCustomDocument("mutation", "PlatformInfraInitEmptyRepo", "platformInfraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "PlatformInfraInitEmptyRepoInput!" - }], connectionFieldsMap, "PlatformInfraInitEmptyRepoPayload") - }), - platformInfraInsertNodeAtPath: (args: PlatformInfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInsertNodeAtPath", - fieldName: "platformInfraInsertNodeAtPath", - ...buildCustomDocument("mutation", "PlatformInfraInsertNodeAtPath", "platformInfraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "PlatformInfraInsertNodeAtPathPayload") - }), - platformInfraSetDataAtPath: (args: PlatformInfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraSetDataAtPath", - fieldName: "platformInfraSetDataAtPath", - ...buildCustomDocument("mutation", "PlatformInfraSetDataAtPath", "platformInfraSetDataAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraSetDataAtPathInput!" - }], connectionFieldsMap, "PlatformInfraSetDataAtPathPayload") - }), - platformResourceInstallationsInstall: (args: PlatformResourceInstallationsInstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsInstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsInstall", - fieldName: "platformResourceInstallationsInstall", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsInstall", "platformResourceInstallationsInstall", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsInstallInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsInstallPayload") - }), - platformResourceInstallationsRollback: (args: PlatformResourceInstallationsRollbackVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsRollback: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsRollback", - fieldName: "platformResourceInstallationsRollback", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsRollback", "platformResourceInstallationsRollback", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsRollbackInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsRollbackPayload") - }), - platformResourceInstallationsUninstall: (args: PlatformResourceInstallationsUninstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsUninstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsUninstall", - fieldName: "platformResourceInstallationsUninstall", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsUninstall", "platformResourceInstallationsUninstall", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsUninstallInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsUninstallPayload") - }), - platformResourceInstallationsUpgrade: (args: PlatformResourceInstallationsUpgradeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsUpgrade: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsUpgrade", - fieldName: "platformResourceInstallationsUpgrade", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsUpgrade", "platformResourceInstallationsUpgrade", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsUpgradeInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsUpgradePayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - resourceInstallationsInstall: (args: ResourceInstallationsInstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsInstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsInstall", - fieldName: "resourceInstallationsInstall", - ...buildCustomDocument("mutation", "ResourceInstallationsInstall", "resourceInstallationsInstall", options.select, args, [{ - name: "input", - type: "ResourceInstallationsInstallInput!" - }], connectionFieldsMap, "ResourceInstallationsInstallPayload") - }), - resourceInstallationsRollback: (args: ResourceInstallationsRollbackVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsRollback: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsRollback", - fieldName: "resourceInstallationsRollback", - ...buildCustomDocument("mutation", "ResourceInstallationsRollback", "resourceInstallationsRollback", options.select, args, [{ - name: "input", - type: "ResourceInstallationsRollbackInput!" - }], connectionFieldsMap, "ResourceInstallationsRollbackPayload") - }), - resourceInstallationsUninstall: (args: ResourceInstallationsUninstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsUninstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsUninstall", - fieldName: "resourceInstallationsUninstall", - ...buildCustomDocument("mutation", "ResourceInstallationsUninstall", "resourceInstallationsUninstall", options.select, args, [{ - name: "input", - type: "ResourceInstallationsUninstallInput!" - }], connectionFieldsMap, "ResourceInstallationsUninstallPayload") - }), - resourceInstallationsUpgrade: (args: ResourceInstallationsUpgradeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsUpgrade: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsUpgrade", - fieldName: "resourceInstallationsUpgrade", - ...buildCustomDocument("mutation", "ResourceInstallationsUpgrade", "resourceInstallationsUpgrade", options.select, args, [{ - name: "input", - type: "ResourceInstallationsUpgradeInput!" - }], connectionFieldsMap, "ResourceInstallationsUpgradePayload") - }), - saveGraph: (args: SaveGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - saveGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SaveGraph", - fieldName: "saveGraph", - ...buildCustomDocument("mutation", "SaveGraph", "saveGraph", options.select, args, [{ - name: "input", - type: "SaveGraphInput!" - }], connectionFieldsMap, "SaveGraphPayload") - }), - setDataAtPath: (args: SetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetDataAtPath", - fieldName: "setDataAtPath", - ...buildCustomDocument("mutation", "SetDataAtPath", "setDataAtPath", options.select, args, [{ - name: "input", - type: "SetDataAtPathInput!" - }], connectionFieldsMap, "SetDataAtPathPayload") - }), - startExecution: (args: StartExecutionVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - startExecution: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "StartExecution", - fieldName: "startExecution", - ...buildCustomDocument("mutation", "StartExecution", "startExecution", options.select, args, [{ - name: "input", - type: "StartExecutionInput!" - }], connectionFieldsMap, "StartExecutionPayload") - }), - validateFunctionGraph: (args: ValidateFunctionGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - validateFunctionGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ValidateFunctionGraph", - fieldName: "validateFunctionGraph", - ...buildCustomDocument("mutation", "ValidateFunctionGraph", "validateFunctionGraph", options.select, args, [{ - name: "input", - type: "ValidateFunctionGraphInput!" - }], connectionFieldsMap, "ValidateFunctionGraphPayload") - }) + addEdge: ( + args: AddEdgeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdge: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdge', + fieldName: 'addEdge', + ...buildCustomDocument( + 'mutation', + 'AddEdge', + 'addEdge', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeInput!', + }, + ], + connectionFieldsMap, + 'AddEdgePayload' + ), + }), + addEdgeAndSave: ( + args: AddEdgeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdgeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdgeAndSave', + fieldName: 'addEdgeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddEdgeAndSave', + 'addEdgeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddEdgeAndSavePayload' + ), + }), + addNode: ( + args: AddNodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNode', + fieldName: 'addNode', + ...buildCustomDocument( + 'mutation', + 'AddNode', + 'addNode', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeInput!', + }, + ], + connectionFieldsMap, + 'AddNodePayload' + ), + }), + addNodeAndSave: ( + args: AddNodeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNodeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNodeAndSave', + fieldName: 'addNodeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddNodeAndSave', + 'addNodeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddNodeAndSavePayload' + ), + }), + copyGraph: ( + args: CopyGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyGraph', + fieldName: 'copyGraph', + ...buildCustomDocument( + 'mutation', + 'CopyGraph', + 'copyGraph', + options.select, + args, + [ + { + name: 'input', + type: 'CopyGraphInput!', + }, + ], + connectionFieldsMap, + 'CopyGraphPayload' + ), + }), + importDefinitions: ( + args: ImportDefinitionsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importDefinitions: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportDefinitions', + fieldName: 'importDefinitions', + ...buildCustomDocument( + 'mutation', + 'ImportDefinitions', + 'importDefinitions', + options.select, + args, + [ + { + name: 'input', + type: 'ImportDefinitionsInput!', + }, + ], + connectionFieldsMap, + 'ImportDefinitionsPayload' + ), + }), + 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' + ), + }), + infraInitEmptyRepo: ( + args: InfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraInitEmptyRepo', + fieldName: 'infraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InfraInitEmptyRepo', + 'infraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InfraInitEmptyRepoPayload' + ), + }), + infraInsertNodeAtPath: ( + args: InfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraInsertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraInsertNodeAtPath', + fieldName: 'infraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InfraInsertNodeAtPath', + 'infraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InfraInsertNodeAtPathPayload' + ), + }), + infraSetDataAtPath: ( + args: InfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraSetDataAtPath', + fieldName: 'infraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'InfraSetDataAtPath', + 'infraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'InfraSetDataAtPathPayload' + ), + }), + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + platformInfraInitEmptyRepo: ( + args: PlatformInfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInitEmptyRepo', + fieldName: 'platformInfraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInitEmptyRepo', + 'platformInfraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInitEmptyRepoPayload' + ), + }), + platformInfraInsertNodeAtPath: ( + args: PlatformInfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInsertNodeAtPath', + fieldName: 'platformInfraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInsertNodeAtPath', + 'platformInfraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInsertNodeAtPathPayload' + ), + }), + platformInfraSetDataAtPath: ( + args: PlatformInfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraSetDataAtPath', + fieldName: 'platformInfraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraSetDataAtPath', + 'platformInfraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraSetDataAtPathPayload' + ), + }), + platformResourceInstallationsInstall: < + S extends PlatformResourceInstallationsInstallPayloadSelect, + >( + args: PlatformResourceInstallationsInstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsInstall: InferSelectResult< + PlatformResourceInstallationsInstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsInstall', + fieldName: 'platformResourceInstallationsInstall', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsInstall', + 'platformResourceInstallationsInstall', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsInstallInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsInstallPayload' + ), + }), + platformResourceInstallationsRollback: < + S extends PlatformResourceInstallationsRollbackPayloadSelect, + >( + args: PlatformResourceInstallationsRollbackVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsRollback: InferSelectResult< + PlatformResourceInstallationsRollbackPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsRollback', + fieldName: 'platformResourceInstallationsRollback', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsRollback', + 'platformResourceInstallationsRollback', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsRollbackInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsRollbackPayload' + ), + }), + platformResourceInstallationsUninstall: < + S extends PlatformResourceInstallationsUninstallPayloadSelect, + >( + args: PlatformResourceInstallationsUninstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsUninstall: InferSelectResult< + PlatformResourceInstallationsUninstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsUninstall', + fieldName: 'platformResourceInstallationsUninstall', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsUninstall', + 'platformResourceInstallationsUninstall', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsUninstallInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsUninstallPayload' + ), + }), + platformResourceInstallationsUpgrade: < + S extends PlatformResourceInstallationsUpgradePayloadSelect, + >( + args: PlatformResourceInstallationsUpgradeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsUpgrade: InferSelectResult< + PlatformResourceInstallationsUpgradePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsUpgrade', + fieldName: 'platformResourceInstallationsUpgrade', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsUpgrade', + 'platformResourceInstallationsUpgrade', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsUpgradeInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsUpgradePayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + resourceInstallationsInstall: ( + args: ResourceInstallationsInstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsInstall: InferSelectResult< + ResourceInstallationsInstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsInstall', + fieldName: 'resourceInstallationsInstall', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsInstall', + 'resourceInstallationsInstall', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsInstallInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsInstallPayload' + ), + }), + resourceInstallationsRollback: ( + args: ResourceInstallationsRollbackVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsRollback: InferSelectResult< + ResourceInstallationsRollbackPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsRollback', + fieldName: 'resourceInstallationsRollback', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsRollback', + 'resourceInstallationsRollback', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsRollbackInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsRollbackPayload' + ), + }), + resourceInstallationsUninstall: ( + args: ResourceInstallationsUninstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsUninstall: InferSelectResult< + ResourceInstallationsUninstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsUninstall', + fieldName: 'resourceInstallationsUninstall', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsUninstall', + 'resourceInstallationsUninstall', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsUninstallInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsUninstallPayload' + ), + }), + resourceInstallationsUpgrade: ( + args: ResourceInstallationsUpgradeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsUpgrade: InferSelectResult< + ResourceInstallationsUpgradePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsUpgrade', + fieldName: 'resourceInstallationsUpgrade', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsUpgrade', + 'resourceInstallationsUpgrade', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsUpgradeInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsUpgradePayload' + ), + }), + saveGraph: ( + args: SaveGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + saveGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SaveGraph', + fieldName: 'saveGraph', + ...buildCustomDocument( + 'mutation', + 'SaveGraph', + 'saveGraph', + options.select, + args, + [ + { + name: 'input', + type: 'SaveGraphInput!', + }, + ], + connectionFieldsMap, + 'SaveGraphPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), + startExecution: ( + args: StartExecutionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + startExecution: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'StartExecution', + fieldName: 'startExecution', + ...buildCustomDocument( + 'mutation', + 'StartExecution', + 'startExecution', + options.select, + args, + [ + { + name: 'input', + type: 'StartExecutionInput!', + }, + ], + connectionFieldsMap, + 'StartExecutionPayload' + ), + }), + validateFunctionGraph: ( + args: ValidateFunctionGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + validateFunctionGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ValidateFunctionGraph', + fieldName: 'validateFunctionGraph', + ...buildCustomDocument( + 'mutation', + 'ValidateFunctionGraph', + 'validateFunctionGraph', + options.select, + args, + [ + { + name: 'input', + type: 'ValidateFunctionGraphInput!', + }, + ], + connectionFieldsMap, + 'ValidateFunctionGraphPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/query-builder.ts b/sdk/constructive-react/src/compute/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/compute/orm/query-builder.ts +++ b/sdk/constructive-react/src/compute/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/compute/orm/query/index.ts b/sdk/constructive-react/src/compute/orm/query/index.ts index c94a1d0491..505264ae62 100644 --- a/sdk/constructive-react/src/compute/orm/query/index.ts +++ b/sdk/constructive-react/src/compute/orm/query/index.ts @@ -3,28 +3,43 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; export interface ReadFunctionGraphVariables { graphId?: string; } export function createQueryOperations(client: OrmClient) { return { - readFunctionGraph: (args: ReadFunctionGraphVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - readFunctionGraph: unknown | null; - }>({ - client, - operation: "query", - operationName: "ReadFunctionGraph", - fieldName: "readFunctionGraph", - ...buildCustomDocument("query", "ReadFunctionGraph", "readFunctionGraph", options?.select, args, [{ - name: "graphId", - type: "UUID" - }], connectionFieldsMap, undefined) - }) + readFunctionGraph: ( + args: ReadFunctionGraphVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + readFunctionGraph: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ReadFunctionGraph', + fieldName: 'readFunctionGraph', + ...buildCustomDocument( + 'query', + 'ReadFunctionGraph', + 'readFunctionGraph', + options?.select, + args, + [ + { + name: 'graphId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/orm/realtime.ts b/sdk/constructive-react/src/compute/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/compute/orm/realtime.ts +++ b/sdk/constructive-react/src/compute/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/compute/orm/select-types.ts b/sdk/constructive-react/src/compute/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/compute/orm/select-types.ts +++ b/sdk/constructive-react/src/compute/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/compute/schema-types.ts b/sdk/constructive-react/src/compute/schema-types.ts index 6e988fab65..c5c293aa89 100644 --- a/sdk/constructive-react/src/compute/schema-types.ts +++ b/sdk/constructive-react/src/compute/schema-types.ts @@ -4,137 +4,2070 @@ * DO NOT EDIT - changes will be overwritten */ -import type { DbPreset, FunctionApiBinding, FunctionDefinition, FunctionDeployment, FunctionDeploymentEvent, FunctionExecutionLog, FunctionGraph, FunctionGraphCommit, FunctionGraphExecution, FunctionGraphExecutionNodeState, FunctionGraphExecutionOutput, FunctionGraphObject, FunctionGraphRef, FunctionGraphStore, FunctionInvocation, FunctionInvocationAttempt, GetAllTreeNodesRecord, InfraCommit, InfraGetAllTreeNodesRecord, InfraObject, InfraRef, InfraStore, IntegrationProvider, Namespace, NamespaceEvent, PlatformFunctionApiBinding, PlatformFunctionDefinition, PlatformFunctionDeployment, PlatformFunctionDeploymentEvent, PlatformFunctionExecutionLog, PlatformFunctionInvocation, PlatformFunctionInvocationAttempt, PlatformInfraCommit, PlatformInfraGetAllTreeNodesRecord, PlatformInfraObject, PlatformInfraRef, PlatformInfraStore, PlatformNamespace, PlatformNamespaceEvent, PlatformResource, PlatformResourceDeclaredCapacity, PlatformResourceDefinition, PlatformResourceEvent, PlatformResourceInstallation, PlatformResourceStatusCheck, PlatformResourceUsageLog, PlatformResourceUsageSummary, PlatformResourceUtilization, PlatformResourcesHealth, PlatformResourcesRequirementsState, PlatformResourcesResolvedRequirement, PlatformWebhookEndpoint, PlatformWebhookEvent, Resource, ResourceDeclaredCapacity, ResourceDefinition, ResourceEvent, ResourceInstallation, ResourceStatusCheck, ResourceUsageLog, ResourceUsageSummary, ResourceUtilization, ResourcesHealth, ResourcesRequirementsState, ResourcesResolvedRequirement, WebhookEndpoint, WebhookEvent, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + DbPreset, + FunctionApiBinding, + FunctionDefinition, + FunctionDeployment, + FunctionDeploymentEvent, + FunctionExecutionLog, + FunctionGraph, + FunctionGraphCommit, + FunctionGraphExecution, + FunctionGraphExecutionNodeState, + FunctionGraphExecutionOutput, + FunctionGraphObject, + FunctionGraphRef, + FunctionGraphStore, + FunctionInvocation, + FunctionInvocationAttempt, + GetAllTreeNodesRecord, + InfraCommit, + InfraGetAllTreeNodesRecord, + InfraObject, + InfraRef, + InfraStore, + IntegrationProvider, + Namespace, + NamespaceEvent, + PlatformFunctionApiBinding, + PlatformFunctionDefinition, + PlatformFunctionDeployment, + PlatformFunctionDeploymentEvent, + PlatformFunctionExecutionLog, + PlatformFunctionInvocation, + PlatformFunctionInvocationAttempt, + PlatformInfraCommit, + PlatformInfraGetAllTreeNodesRecord, + PlatformInfraObject, + PlatformInfraRef, + PlatformInfraStore, + PlatformNamespace, + PlatformNamespaceEvent, + PlatformResource, + PlatformResourceDeclaredCapacity, + PlatformResourceDefinition, + PlatformResourceEvent, + PlatformResourceInstallation, + PlatformResourceStatusCheck, + PlatformResourceUsageLog, + PlatformResourceUsageSummary, + PlatformResourceUtilization, + PlatformResourcesHealth, + PlatformResourcesRequirementsState, + PlatformResourcesResolvedRequirement, + PlatformWebhookEndpoint, + PlatformWebhookEvent, + Resource, + ResourceDeclaredCapacity, + ResourceDefinition, + ResourceEvent, + ResourceInstallation, + ResourceStatusCheck, + ResourceUsageLog, + ResourceUsageSummary, + ResourceUtilization, + ResourcesHealth, + ResourcesRequirementsState, + ResourcesResolvedRequirement, + WebhookEndpoint, + WebhookEvent, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; export type Base64EncodedBinary = unknown; export type ConstructiveInternalTypeImage = unknown; /** Methods to use when ordering `DbPreset`. */ -export type DbPresetOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MODULES_HASH_ASC" | "MODULES_HASH_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DbPresetOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MODULES_HASH_ASC' + | 'MODULES_HASH_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `FunctionApiBinding`. */ -export type FunctionApiBindingOrderBy = "ALIAS_ASC" | "ALIAS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type FunctionApiBindingOrderBy = + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `FunctionDefinition`. */ -export type FunctionDefinitionOrderBy = "ACCESS_CHANNELS_ASC" | "ACCESS_CHANNELS_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FN_CATEGORY_ASC" | "FN_CATEGORY_DESC" | "FUNCTION_COLUMNS_ASC" | "FUNCTION_COLUMNS_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "INPUTS_ASC" | "INPUTS_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "MAX_ATTEMPTS_ASC" | "MAX_ATTEMPTS_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MODULE_TABLE_ASC" | "MODULE_TABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUTPUTS_ASC" | "OUTPUTS_DESC" | "PAYLOAD_ARGS_ASC" | "PAYLOAD_ARGS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "PROPS_ASC" | "PROPS_DESC" | "PROTECTED_ASC" | "PROTECTED_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "QUEUE_NAME_ASC" | "QUEUE_NAME_DESC" | "REQUIRED_BUCKETS_ASC" | "REQUIRED_BUCKETS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_MODELS_ASC" | "REQUIRED_MODELS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RUNTIME_ASC" | "RUNTIME_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "TARGET_FUNCTION_ASC" | "TARGET_FUNCTION_DESC" | "TARGET_SCHEMA_ASC" | "TARGET_SCHEMA_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VOLATILE_ASC" | "VOLATILE_DESC"; +export type FunctionDefinitionOrderBy = + | 'ACCESS_CHANNELS_ASC' + | 'ACCESS_CHANNELS_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FN_CATEGORY_ASC' + | 'FN_CATEGORY_DESC' + | 'FUNCTION_COLUMNS_ASC' + | 'FUNCTION_COLUMNS_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MODULE_TABLE_ASC' + | 'MODULE_TABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PAYLOAD_ARGS_ASC' + | 'PAYLOAD_ARGS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'PROTECTED_ASC' + | 'PROTECTED_DESC' + | 'PUBLISHED_AT_ASC' + | 'PUBLISHED_AT_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'TARGET_FUNCTION_ASC' + | 'TARGET_FUNCTION_DESC' + | 'TARGET_SCHEMA_ASC' + | 'TARGET_SCHEMA_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC'; /** Methods to use when ordering `FunctionDeploymentEvent`. */ -export type FunctionDeploymentEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYMENT_ID_ASC" | "DEPLOYMENT_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type FunctionDeploymentEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `FunctionDeployment`. */ -export type FunctionDeploymentOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "HANDLER_NAME_ASC" | "HANDLER_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "IMAGE_VERSION_ASC" | "IMAGE_VERSION_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_AT_ASC" | "LAST_ERROR_AT_DESC" | "LAST_ERROR_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SERVICE_NAME_ASC" | "SERVICE_NAME_DESC" | "SERVICE_URL_ASC" | "SERVICE_URL_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type FunctionDeploymentOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'HANDLER_NAME_ASC' + | 'HANDLER_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'IMAGE_VERSION_ASC' + | 'IMAGE_VERSION_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `FunctionExecutionLog`. */ -export type FunctionExecutionLogOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LOG_LEVEL_ASC" | "LOG_LEVEL_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; +export type FunctionExecutionLogOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; /** Methods to use when ordering `FunctionGraphCommit`. */ -export type FunctionGraphCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; +export type FunctionGraphCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; /** Methods to use when ordering `FunctionGraphExecutionNodeState`. */ -export type FunctionGraphExecutionNodeStateOrderBy = "CALLBACK_INPUTS_ASC" | "CALLBACK_INPUTS_DESC" | "CALLBACK_META_ASC" | "CALLBACK_META_DESC" | "CALLBACK_TOKEN_HASH_ASC" | "CALLBACK_TOKEN_HASH_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ERROR_CODE_ASC" | "ERROR_CODE_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXECUTION_ID_ASC" | "EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODE_NAME_ASC" | "NODE_NAME_DESC" | "NODE_PATH_ASC" | "NODE_PATH_DESC" | "OUTPUT_ID_ASC" | "OUTPUT_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC"; +export type FunctionGraphExecutionNodeStateOrderBy = + | 'CALLBACK_INPUTS_ASC' + | 'CALLBACK_INPUTS_DESC' + | 'CALLBACK_META_ASC' + | 'CALLBACK_META_DESC' + | 'CALLBACK_TOKEN_HASH_ASC' + | 'CALLBACK_TOKEN_HASH_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXECUTION_ID_ASC' + | 'EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODE_NAME_ASC' + | 'NODE_NAME_DESC' + | 'NODE_PATH_ASC' + | 'NODE_PATH_DESC' + | 'OUTPUT_ID_ASC' + | 'OUTPUT_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; /** Methods to use when ordering `FunctionGraphExecution`. */ -export type FunctionGraphExecutionOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CURRENT_WAVE_ASC" | "CURRENT_WAVE_DESC" | "DEFINITIONS_COMMIT_ID_ASC" | "DEFINITIONS_COMMIT_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ERROR_CODE_ASC" | "ERROR_CODE_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXECUTION_PLAN_ASC" | "EXECUTION_PLAN_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ID_ASC" | "ID_DESC" | "INPUT_PAYLOAD_ASC" | "INPUT_PAYLOAD_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LAST_PROGRESS_AT_ASC" | "LAST_PROGRESS_AT_DESC" | "MAX_PENDING_JOBS_ASC" | "MAX_PENDING_JOBS_DESC" | "MAX_TICKS_ASC" | "MAX_TICKS_DESC" | "NATURAL" | "NODE_OUTPUTS_ASC" | "NODE_OUTPUTS_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "OUTPUT_NAMES_ASC" | "OUTPUT_NAMES_DESC" | "OUTPUT_NODE_ASC" | "OUTPUT_NODE_DESC" | "OUTPUT_PAYLOAD_ASC" | "OUTPUT_PAYLOAD_DESC" | "OUTPUT_PORT_ASC" | "OUTPUT_PORT_DESC" | "PARENT_EXECUTION_ID_ASC" | "PARENT_EXECUTION_ID_DESC" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PARENT_NODE_NAME_ASC" | "PARENT_NODE_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TICK_COUNT_ASC" | "TICK_COUNT_DESC" | "TIMEOUT_AT_ASC" | "TIMEOUT_AT_DESC"; +export type FunctionGraphExecutionOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CURRENT_WAVE_ASC' + | 'CURRENT_WAVE_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXECUTION_PLAN_ASC' + | 'EXECUTION_PLAN_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INPUT_PAYLOAD_ASC' + | 'INPUT_PAYLOAD_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LAST_PROGRESS_AT_ASC' + | 'LAST_PROGRESS_AT_DESC' + | 'MAX_PENDING_JOBS_ASC' + | 'MAX_PENDING_JOBS_DESC' + | 'MAX_TICKS_ASC' + | 'MAX_TICKS_DESC' + | 'NATURAL' + | 'NODE_OUTPUTS_ASC' + | 'NODE_OUTPUTS_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'OUTPUT_NAMES_ASC' + | 'OUTPUT_NAMES_DESC' + | 'OUTPUT_NODE_ASC' + | 'OUTPUT_NODE_DESC' + | 'OUTPUT_PAYLOAD_ASC' + | 'OUTPUT_PAYLOAD_DESC' + | 'OUTPUT_PORT_ASC' + | 'OUTPUT_PORT_DESC' + | 'PARENT_EXECUTION_ID_ASC' + | 'PARENT_EXECUTION_ID_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PARENT_NODE_NAME_ASC' + | 'PARENT_NODE_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TICK_COUNT_ASC' + | 'TICK_COUNT_DESC' + | 'TIMEOUT_AT_ASC' + | 'TIMEOUT_AT_DESC'; /** Methods to use when ordering `FunctionGraphExecutionOutput`. */ -export type FunctionGraphExecutionOutputOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; +export type FunctionGraphExecutionOutputOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; /** Methods to use when ordering `FunctionGraphObject`. */ -export type FunctionGraphObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; +export type FunctionGraphObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; /** Methods to use when ordering `FunctionGraph`. */ -export type FunctionGraphOrderBy = "CONTEXT_ASC" | "CONTEXT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DEFINITIONS_COMMIT_ID_ASC" | "DEFINITIONS_COMMIT_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_VALID_ASC" | "IS_VALID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALIDATION_ERRORS_ASC" | "VALIDATION_ERRORS_DESC"; +export type FunctionGraphOrderBy = + | 'CONTEXT_ASC' + | 'CONTEXT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VALID_ASC' + | 'IS_VALID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALIDATION_ERRORS_ASC' + | 'VALIDATION_ERRORS_DESC'; /** Methods to use when ordering `FunctionGraphRef`. */ -export type FunctionGraphRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; +export type FunctionGraphRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; /** Methods to use when ordering `FunctionGraphStore`. */ -export type FunctionGraphStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; +export type FunctionGraphStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; /** Methods to use when ordering `FunctionInvocationAttempt`. */ -export type FunctionInvocationAttemptOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ATTEMPT_ASC" | "ATTEMPT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ERROR_DETAIL_ASC" | "ERROR_DETAIL_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; +export type FunctionInvocationAttemptOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ATTEMPT_ASC' + | 'ATTEMPT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ERROR_DETAIL_ASC' + | 'ERROR_DETAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; /** Methods to use when ordering `FunctionInvocation`. */ -export type FunctionInvocationOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "API_BINDING_ID_ASC" | "API_BINDING_ID_DESC" | "CHANNEL_ASC" | "CHANNEL_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFINITION_SCOPE_ASC" | "DEFINITION_SCOPE_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "GRAPH_EXECUTION_ID_ASC" | "GRAPH_EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOB_ID_ASC" | "JOB_ID_DESC" | "NATURAL" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVENANCE_ASC" | "PROVENANCE_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; +export type FunctionInvocationOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'API_BINDING_ID_ASC' + | 'API_BINDING_ID_DESC' + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFINITION_SCOPE_ASC' + | 'DEFINITION_SCOPE_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'NATURAL' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVENANCE_ASC' + | 'PROVENANCE_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; /** Methods to use when ordering `InfraCommit`. */ -export type InfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; +export type InfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; /** Methods to use when ordering `InfraObject`. */ -export type InfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type InfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `InfraRef`. */ -export type InfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; +export type InfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; /** Methods to use when ordering `InfraStore`. */ -export type InfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type InfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `IntegrationProvider`. */ -export type IntegrationProviderOrderBy = "BRAND_ASC" | "BRAND_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "LOGO_ASC" | "LOGO_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type IntegrationProviderOrderBy = + | 'BRAND_ASC' + | 'BRAND_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LOGO_ASC' + | 'LOGO_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `NamespaceEvent`. */ -export type NamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type NamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `Namespace`. */ -export type NamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type NamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformFunctionApiBinding`. */ -export type PlatformFunctionApiBindingOrderBy = "ALIAS_ASC" | "ALIAS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type PlatformFunctionApiBindingOrderBy = + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `PlatformFunctionDefinition`. */ -export type PlatformFunctionDefinitionOrderBy = "ACCESS_CHANNELS_ASC" | "ACCESS_CHANNELS_DESC" | "BILLABLE_ASC" | "BILLABLE_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FN_CATEGORY_ASC" | "FN_CATEGORY_DESC" | "FUNCTION_COLUMNS_ASC" | "FUNCTION_COLUMNS_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "INPUTS_ASC" | "INPUTS_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "MAX_ATTEMPTS_ASC" | "MAX_ATTEMPTS_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MODULE_TABLE_ASC" | "MODULE_TABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUTPUTS_ASC" | "OUTPUTS_DESC" | "PAYLOAD_ARGS_ASC" | "PAYLOAD_ARGS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "PROPS_ASC" | "PROPS_DESC" | "PROTECTED_ASC" | "PROTECTED_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "QUEUE_NAME_ASC" | "QUEUE_NAME_DESC" | "REQUIRED_BUCKETS_ASC" | "REQUIRED_BUCKETS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_MODELS_ASC" | "REQUIRED_MODELS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RUNTIME_ASC" | "RUNTIME_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SYSTEM_ASC" | "SYSTEM_DESC" | "TARGET_FUNCTION_ASC" | "TARGET_FUNCTION_DESC" | "TARGET_SCHEMA_ASC" | "TARGET_SCHEMA_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VOLATILE_ASC" | "VOLATILE_DESC"; +export type PlatformFunctionDefinitionOrderBy = + | 'ACCESS_CHANNELS_ASC' + | 'ACCESS_CHANNELS_DESC' + | 'BILLABLE_ASC' + | 'BILLABLE_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FN_CATEGORY_ASC' + | 'FN_CATEGORY_DESC' + | 'FUNCTION_COLUMNS_ASC' + | 'FUNCTION_COLUMNS_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MODULE_TABLE_ASC' + | 'MODULE_TABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PAYLOAD_ARGS_ASC' + | 'PAYLOAD_ARGS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'PROTECTED_ASC' + | 'PROTECTED_DESC' + | 'PUBLISHED_AT_ASC' + | 'PUBLISHED_AT_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SYSTEM_ASC' + | 'SYSTEM_DESC' + | 'TARGET_FUNCTION_ASC' + | 'TARGET_FUNCTION_DESC' + | 'TARGET_SCHEMA_ASC' + | 'TARGET_SCHEMA_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC'; /** Methods to use when ordering `PlatformFunctionDeploymentEvent`. */ -export type PlatformFunctionDeploymentEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEPLOYMENT_ID_ASC" | "DEPLOYMENT_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type PlatformFunctionDeploymentEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `PlatformFunctionDeployment`. */ -export type PlatformFunctionDeploymentOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "HANDLER_NAME_ASC" | "HANDLER_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "IMAGE_VERSION_ASC" | "IMAGE_VERSION_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_AT_ASC" | "LAST_ERROR_AT_DESC" | "LAST_ERROR_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SERVICE_NAME_ASC" | "SERVICE_NAME_DESC" | "SERVICE_URL_ASC" | "SERVICE_URL_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformFunctionDeploymentOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'HANDLER_NAME_ASC' + | 'HANDLER_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'IMAGE_VERSION_ASC' + | 'IMAGE_VERSION_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformFunctionExecutionLog`. */ -export type PlatformFunctionExecutionLogOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LOG_LEVEL_ASC" | "LOG_LEVEL_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; +export type PlatformFunctionExecutionLogOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; /** Methods to use when ordering `PlatformFunctionInvocationAttempt`. */ -export type PlatformFunctionInvocationAttemptOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ATTEMPT_ASC" | "ATTEMPT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ERROR_DETAIL_ASC" | "ERROR_DETAIL_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; +export type PlatformFunctionInvocationAttemptOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ATTEMPT_ASC' + | 'ATTEMPT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ERROR_DETAIL_ASC' + | 'ERROR_DETAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; /** Methods to use when ordering `PlatformFunctionInvocation`. */ -export type PlatformFunctionInvocationOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "API_BINDING_ID_ASC" | "API_BINDING_ID_DESC" | "CHANNEL_ASC" | "CHANNEL_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_SCOPE_ASC" | "DEFINITION_SCOPE_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "GRAPH_EXECUTION_ID_ASC" | "GRAPH_EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOB_ID_ASC" | "JOB_ID_DESC" | "NATURAL" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVENANCE_ASC" | "PROVENANCE_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; +export type PlatformFunctionInvocationOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'API_BINDING_ID_ASC' + | 'API_BINDING_ID_DESC' + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_SCOPE_ASC' + | 'DEFINITION_SCOPE_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'NATURAL' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVENANCE_ASC' + | 'PROVENANCE_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; /** Methods to use when ordering `PlatformInfraCommit`. */ -export type PlatformInfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; +export type PlatformInfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; /** Methods to use when ordering `PlatformInfraObject`. */ -export type PlatformInfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; +export type PlatformInfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; /** Methods to use when ordering `PlatformInfraRef`. */ -export type PlatformInfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; +export type PlatformInfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; /** Methods to use when ordering `PlatformInfraStore`. */ -export type PlatformInfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; +export type PlatformInfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; /** Methods to use when ordering `PlatformNamespaceEvent`. */ -export type PlatformNamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type PlatformNamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `PlatformNamespace`. */ -export type PlatformNamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformNamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformResourceDeclaredCapacity`. */ -export type PlatformResourceDeclaredCapacityOrderBy = "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "IS_TRANSIENT_ASC" | "IS_TRANSIENT_DESC" | "KIND_ASC" | "KIND_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "POD_COUNT_MAX_ASC" | "POD_COUNT_MAX_DESC" | "POD_COUNT_MIN_ASC" | "POD_COUNT_MIN_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "SOURCE_ID_ASC" | "SOURCE_ID_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC"; +export type PlatformResourceDeclaredCapacityOrderBy = + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'IS_TRANSIENT_ASC' + | 'IS_TRANSIENT_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'POD_COUNT_MAX_ASC' + | 'POD_COUNT_MAX_DESC' + | 'POD_COUNT_MIN_ASC' + | 'POD_COUNT_MIN_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'SOURCE_ID_ASC' + | 'SOURCE_ID_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC'; /** Methods to use when ordering `PlatformResourceDefinition`. */ -export type PlatformResourceDefinitionOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DEFAULT_SPEC_ASC" | "DEFAULT_SPEC_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STEP_UP_MIN_AGE_ASC" | "STEP_UP_MIN_AGE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type PlatformResourceDefinitionOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DEFAULT_SPEC_ASC' + | 'DEFAULT_SPEC_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STEP_UP_MIN_AGE_ASC' + | 'STEP_UP_MIN_AGE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `PlatformResourceEvent`. */ -export type PlatformResourceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC"; +export type PlatformResourceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC'; /** Methods to use when ordering `PlatformResourceInstallation`. */ -export type PlatformResourceInstallationOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMS_ASC" | "PARAMS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type PlatformResourceInstallationOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMS_ASC' + | 'PARAMS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `PlatformResource`. */ -export type PlatformResourceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type PlatformResourceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `PlatformResourceStatusCheck`. */ -export type PlatformResourceStatusCheckOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUESTED_AT_ASC" | "REQUESTED_AT_DESC" | "REQUESTED_BY_ASC" | "REQUESTED_BY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STATUS_ASC" | "STATUS_DESC"; +export type PlatformResourceStatusCheckOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUESTED_AT_ASC' + | 'REQUESTED_AT_DESC' + | 'REQUESTED_BY_ASC' + | 'REQUESTED_BY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; /** Methods to use when ordering `PlatformResourceUsageLog`. */ -export type PlatformResourceUsageLogOrderBy = "CPU_MILLICORES_ASC" | "CPU_MILLICORES_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_SECONDS_ASC" | "INTERVAL_SECONDS_DESC" | "MEMORY_BYTES_ASC" | "MEMORY_BYTES_DESC" | "METRICS_ASC" | "METRICS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SAMPLED_AT_ASC" | "SAMPLED_AT_DESC" | "SOURCE_ASC" | "SOURCE_DESC"; +export type PlatformResourceUsageLogOrderBy = + | 'CPU_MILLICORES_ASC' + | 'CPU_MILLICORES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_SECONDS_ASC' + | 'INTERVAL_SECONDS_DESC' + | 'MEMORY_BYTES_ASC' + | 'MEMORY_BYTES_DESC' + | 'METRICS_ASC' + | 'METRICS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SAMPLED_AT_ASC' + | 'SAMPLED_AT_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC'; /** Methods to use when ordering `PlatformResourceUsageSummary`. */ -export type PlatformResourceUsageSummaryOrderBy = "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "ID_ASC" | "ID_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; +export type PlatformResourceUsageSummaryOrderBy = + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; /** Methods to use when ordering `PlatformResourceUtilization`. */ -export type PlatformResourceUtilizationOrderBy = "AVG_MEMORY_BYTES_ASC" | "AVG_MEMORY_BYTES_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_PEAK_UTILIZATION_ASC" | "CPU_PEAK_UTILIZATION_DESC" | "CPU_REQUEST_HEADROOM_MILLICORES_ASC" | "CPU_REQUEST_HEADROOM_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "KIND_ASC" | "KIND_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_PEAK_UTILIZATION_ASC" | "MEMORY_PEAK_UTILIZATION_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MEMORY_REQUEST_HEADROOM_BYTES_ASC" | "MEMORY_REQUEST_HEADROOM_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; +export type PlatformResourceUtilizationOrderBy = + | 'AVG_MEMORY_BYTES_ASC' + | 'AVG_MEMORY_BYTES_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_PEAK_UTILIZATION_ASC' + | 'CPU_PEAK_UTILIZATION_DESC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_ASC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_PEAK_UTILIZATION_ASC' + | 'MEMORY_PEAK_UTILIZATION_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_ASC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; /** Methods to use when ordering `PlatformResourcesHealth`. */ -export type PlatformResourcesHealthOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_DETAIL_ASC" | "STATUS_DETAIL_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type PlatformResourcesHealthOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_DETAIL_ASC' + | 'STATUS_DETAIL_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `PlatformResourcesRequirementsState`. */ -export type PlatformResourcesRequirementsStateOrderBy = "CONFIG_HASH_ASC" | "CONFIG_HASH_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NATURAL" | "REQUIREMENTS_HASH_ASC" | "REQUIREMENTS_HASH_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_HASH_ASC" | "SECRETS_HASH_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; +export type PlatformResourcesRequirementsStateOrderBy = + | 'CONFIG_HASH_ASC' + | 'CONFIG_HASH_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NATURAL' + | 'REQUIREMENTS_HASH_ASC' + | 'REQUIREMENTS_HASH_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_HASH_ASC' + | 'SECRETS_HASH_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; /** Methods to use when ordering `PlatformResourcesResolvedRequirement`. */ -export type PlatformResourcesResolvedRequirementOrderBy = "ATOM_ID_ASC" | "ATOM_ID_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRESENT_ASC" | "PRESENT_DESC" | "REQUIRED_ASC" | "REQUIRED_DESC" | "REQUIREMENT_KIND_ASC" | "REQUIREMENT_KIND_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; +export type PlatformResourcesResolvedRequirementOrderBy = + | 'ATOM_ID_ASC' + | 'ATOM_ID_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRESENT_ASC' + | 'PRESENT_DESC' + | 'REQUIRED_ASC' + | 'REQUIRED_DESC' + | 'REQUIREMENT_KIND_ASC' + | 'REQUIREMENT_KIND_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; /** Methods to use when ordering `PlatformWebhookEndpoint`. */ -export type PlatformWebhookEndpointOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "HOST_ASC" | "HOST_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "REPLAY_WINDOW_SECONDS_ASC" | "REPLAY_WINDOW_SECONDS_DESC" | "SIGNING_SECRET_NAME_ASC" | "SIGNING_SECRET_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type PlatformWebhookEndpointOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'HOST_ASC' + | 'HOST_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'REPLAY_WINDOW_SECONDS_ASC' + | 'REPLAY_WINDOW_SECONDS_DESC' + | 'SIGNING_SECRET_NAME_ASC' + | 'SIGNING_SECRET_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `PlatformWebhookEvent`. */ -export type PlatformWebhookEventOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENDPOINT_ID_ASC" | "ENDPOINT_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXTERNAL_EVENT_ID_ASC" | "EXTERNAL_EVENT_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVIDER_TIMESTAMP_ASC" | "PROVIDER_TIMESTAMP_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformWebhookEventOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENDPOINT_ID_ASC' + | 'ENDPOINT_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXTERNAL_EVENT_ID_ASC' + | 'EXTERNAL_EVENT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVIDER_TIMESTAMP_ASC' + | 'PROVIDER_TIMESTAMP_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `ResourceDeclaredCapacity`. */ -export type ResourceDeclaredCapacityOrderBy = "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "IS_TRANSIENT_ASC" | "IS_TRANSIENT_DESC" | "KIND_ASC" | "KIND_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "POD_COUNT_MAX_ASC" | "POD_COUNT_MAX_DESC" | "POD_COUNT_MIN_ASC" | "POD_COUNT_MIN_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "SOURCE_ID_ASC" | "SOURCE_ID_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC"; +export type ResourceDeclaredCapacityOrderBy = + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'IS_TRANSIENT_ASC' + | 'IS_TRANSIENT_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'POD_COUNT_MAX_ASC' + | 'POD_COUNT_MAX_DESC' + | 'POD_COUNT_MIN_ASC' + | 'POD_COUNT_MIN_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'SOURCE_ID_ASC' + | 'SOURCE_ID_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC'; /** Methods to use when ordering `ResourceDefinition`. */ -export type ResourceDefinitionOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_SPEC_ASC" | "DEFAULT_SPEC_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STEP_UP_MIN_AGE_ASC" | "STEP_UP_MIN_AGE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type ResourceDefinitionOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_SPEC_ASC' + | 'DEFAULT_SPEC_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STEP_UP_MIN_AGE_ASC' + | 'STEP_UP_MIN_AGE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `ResourceEvent`. */ -export type ResourceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC"; +export type ResourceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC'; /** Methods to use when ordering `ResourceInstallation`. */ -export type ResourceInstallationOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMS_ASC" | "PARAMS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type ResourceInstallationOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMS_ASC' + | 'PARAMS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `Resource`. */ -export type ResourceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type ResourceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `ResourceStatusCheck`. */ -export type ResourceStatusCheckOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUESTED_AT_ASC" | "REQUESTED_AT_DESC" | "REQUESTED_BY_ASC" | "REQUESTED_BY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STATUS_ASC" | "STATUS_DESC"; +export type ResourceStatusCheckOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUESTED_AT_ASC' + | 'REQUESTED_AT_DESC' + | 'REQUESTED_BY_ASC' + | 'REQUESTED_BY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; /** Methods to use when ordering `ResourceUsageLog`. */ -export type ResourceUsageLogOrderBy = "CPU_MILLICORES_ASC" | "CPU_MILLICORES_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_SECONDS_ASC" | "INTERVAL_SECONDS_DESC" | "MEMORY_BYTES_ASC" | "MEMORY_BYTES_DESC" | "METRICS_ASC" | "METRICS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SAMPLED_AT_ASC" | "SAMPLED_AT_DESC" | "SOURCE_ASC" | "SOURCE_DESC"; +export type ResourceUsageLogOrderBy = + | 'CPU_MILLICORES_ASC' + | 'CPU_MILLICORES_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_SECONDS_ASC' + | 'INTERVAL_SECONDS_DESC' + | 'MEMORY_BYTES_ASC' + | 'MEMORY_BYTES_DESC' + | 'METRICS_ASC' + | 'METRICS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SAMPLED_AT_ASC' + | 'SAMPLED_AT_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC'; /** Methods to use when ordering `ResourceUsageSummary`. */ -export type ResourceUsageSummaryOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "ID_ASC" | "ID_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; +export type ResourceUsageSummaryOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; /** Methods to use when ordering `ResourceUtilization`. */ -export type ResourceUtilizationOrderBy = "AVG_MEMORY_BYTES_ASC" | "AVG_MEMORY_BYTES_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_PEAK_UTILIZATION_ASC" | "CPU_PEAK_UTILIZATION_DESC" | "CPU_REQUEST_HEADROOM_MILLICORES_ASC" | "CPU_REQUEST_HEADROOM_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "KIND_ASC" | "KIND_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_PEAK_UTILIZATION_ASC" | "MEMORY_PEAK_UTILIZATION_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MEMORY_REQUEST_HEADROOM_BYTES_ASC" | "MEMORY_REQUEST_HEADROOM_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; +export type ResourceUtilizationOrderBy = + | 'AVG_MEMORY_BYTES_ASC' + | 'AVG_MEMORY_BYTES_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_PEAK_UTILIZATION_ASC' + | 'CPU_PEAK_UTILIZATION_DESC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_ASC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_PEAK_UTILIZATION_ASC' + | 'MEMORY_PEAK_UTILIZATION_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_ASC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; /** Methods to use when ordering `ResourcesHealth`. */ -export type ResourcesHealthOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_DETAIL_ASC" | "STATUS_DETAIL_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type ResourcesHealthOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_DETAIL_ASC' + | 'STATUS_DETAIL_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `ResourcesRequirementsState`. */ -export type ResourcesRequirementsStateOrderBy = "CONFIG_HASH_ASC" | "CONFIG_HASH_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NATURAL" | "REQUIREMENTS_HASH_ASC" | "REQUIREMENTS_HASH_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_HASH_ASC" | "SECRETS_HASH_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; +export type ResourcesRequirementsStateOrderBy = + | 'CONFIG_HASH_ASC' + | 'CONFIG_HASH_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NATURAL' + | 'REQUIREMENTS_HASH_ASC' + | 'REQUIREMENTS_HASH_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_HASH_ASC' + | 'SECRETS_HASH_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; /** Methods to use when ordering `ResourcesResolvedRequirement`. */ -export type ResourcesResolvedRequirementOrderBy = "ATOM_ID_ASC" | "ATOM_ID_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRESENT_ASC" | "PRESENT_DESC" | "REQUIRED_ASC" | "REQUIRED_DESC" | "REQUIREMENT_KIND_ASC" | "REQUIREMENT_KIND_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; +export type ResourcesResolvedRequirementOrderBy = + | 'ATOM_ID_ASC' + | 'ATOM_ID_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRESENT_ASC' + | 'PRESENT_DESC' + | 'REQUIRED_ASC' + | 'REQUIRED_DESC' + | 'REQUIREMENT_KIND_ASC' + | 'REQUIREMENT_KIND_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; /** Methods to use when ordering `WebhookEndpoint`. */ -export type WebhookEndpointOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "HOST_ASC" | "HOST_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "REPLAY_WINDOW_SECONDS_ASC" | "REPLAY_WINDOW_SECONDS_DESC" | "SIGNING_SECRET_NAME_ASC" | "SIGNING_SECRET_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; +export type WebhookEndpointOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'HOST_ASC' + | 'HOST_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'REPLAY_WINDOW_SECONDS_ASC' + | 'REPLAY_WINDOW_SECONDS_DESC' + | 'SIGNING_SECRET_NAME_ASC' + | 'SIGNING_SECRET_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; /** Methods to use when ordering `WebhookEvent`. */ -export type WebhookEventOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENDPOINT_ID_ASC" | "ENDPOINT_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXTERNAL_EVENT_ID_ASC" | "EXTERNAL_EVENT_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVIDER_TIMESTAMP_ASC" | "PROVIDER_TIMESTAMP_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type WebhookEventOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENDPOINT_ID_ASC' + | 'ENDPOINT_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXTERNAL_EVENT_ID_ASC' + | 'EXTERNAL_EVENT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVIDER_TIMESTAMP_ASC' + | 'PROVIDER_TIMESTAMP_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; export interface AddEdgeAndSaveInput { clientMutationId?: string; dstNode?: string; @@ -9035,4 +10968,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/compute/types.ts b/sdk/constructive-react/src/compute/types.ts index bc43fcd86a..e31d49acc5 100644 --- a/sdk/constructive-react/src/compute/types.ts +++ b/sdk/constructive-react/src/compute/types.ts @@ -1207,4 +1207,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/hooks/client.ts b/sdk/constructive-react/src/config/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/config/hooks/client.ts +++ b/sdk/constructive-react/src/config/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/config/hooks/index.ts b/sdk/constructive-react/src/config/hooks/index.ts index 34ca139614..14ac3b09eb 100644 --- a/sdk/constructive-react/src/config/hooks/index.ts +++ b/sdk/constructive-react/src/config/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: Config, PlatformConfig, PlatformInternalSecret, PlatformSecret, Secret - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/config/hooks/invalidation.ts b/sdk/constructive-react/src/config/hooks/invalidation.ts index 4db8e7ff31..86978c03fa 100644 --- a/sdk/constructive-react/src/config/hooks/invalidation.ts +++ b/sdk/constructive-react/src/config/hooks/invalidation.ts @@ -13,8 +13,14 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { configKeys, platformConfigKeys, platformInternalSecretKeys, platformSecretKeys, secretKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + configKeys, + platformConfigKeys, + platformInternalSecretKeys, + platformSecretKeys, + secretKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,61 +41,85 @@ import { configKeys, platformConfigKeys, platformInternalSecretKeys, platformSec * ``` */ export const invalidate = { - /** Invalidate config queries */config: { - /** Invalidate all config queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: configKeys.all - }), - /** Invalidate config list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: configKeys.lists() - }), - /** Invalidate a specific config */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: configKeys.detail(id) - }) + /** Invalidate config queries */ config: { + /** Invalidate all config queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: configKeys.all, + }), + /** Invalidate config list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: configKeys.lists(), + }), + /** Invalidate a specific config */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: configKeys.detail(id), + }), }, - /** Invalidate platformConfig queries */platformConfig: { - /** Invalidate all platformConfig queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformConfigKeys.all - }), - /** Invalidate platformConfig list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformConfigKeys.lists() - }), - /** Invalidate a specific platformConfig */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformConfigKeys.detail(id) - }) + /** Invalidate platformConfig queries */ platformConfig: { + /** Invalidate all platformConfig queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.all, + }), + /** Invalidate platformConfig list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.lists(), + }), + /** Invalidate a specific platformConfig */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.detail(id), + }), }, - /** Invalidate platformInternalSecret queries */platformInternalSecret: { - /** Invalidate all platformInternalSecret queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInternalSecretKeys.all - }), - /** Invalidate platformInternalSecret list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInternalSecretKeys.lists() - }), - /** Invalidate a specific platformInternalSecret */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInternalSecretKeys.detail(id) - }) + /** Invalidate platformInternalSecret queries */ platformInternalSecret: { + /** Invalidate all platformInternalSecret queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInternalSecretKeys.all, + }), + /** Invalidate platformInternalSecret list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInternalSecretKeys.lists(), + }), + /** Invalidate a specific platformInternalSecret */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInternalSecretKeys.detail(id), + }), }, - /** Invalidate platformSecret queries */platformSecret: { - /** Invalidate all platformSecret queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSecretKeys.all - }), - /** Invalidate platformSecret list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformSecretKeys.lists() - }), - /** Invalidate a specific platformSecret */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformSecretKeys.detail(id) - }) + /** Invalidate platformSecret queries */ platformSecret: { + /** Invalidate all platformSecret queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSecretKeys.all, + }), + /** Invalidate platformSecret list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformSecretKeys.lists(), + }), + /** Invalidate a specific platformSecret */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformSecretKeys.detail(id), + }), + }, + /** Invalidate secret queries */ secret: { + /** Invalidate all secret queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: secretKeys.all, + }), + /** Invalidate secret list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: secretKeys.lists(), + }), + /** Invalidate a specific secret */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: secretKeys.detail(id), + }), }, - /** Invalidate secret queries */secret: { - /** Invalidate all secret queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: secretKeys.all - }), - /** Invalidate secret list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: secretKeys.lists() - }), - /** Invalidate a specific secret */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: secretKeys.detail(id) - }) - } } as const; /** @@ -103,29 +133,38 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove config from cache */config: (queryClient: QueryClient, id: string | number) => { + /** Remove config from cache */ config: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: configKeys.detail(id) + queryKey: configKeys.detail(id), }); }, - /** Remove platformConfig from cache */platformConfig: (queryClient: QueryClient, id: string | number) => { + /** Remove platformConfig from cache */ platformConfig: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformConfigKeys.detail(id) + queryKey: platformConfigKeys.detail(id), }); }, - /** Remove platformInternalSecret from cache */platformInternalSecret: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInternalSecret from cache */ platformInternalSecret: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInternalSecretKeys.detail(id) + queryKey: platformInternalSecretKeys.detail(id), }); }, - /** Remove platformSecret from cache */platformSecret: (queryClient: QueryClient, id: string | number) => { + /** Remove platformSecret from cache */ platformSecret: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformSecretKeys.detail(id) + queryKey: platformSecretKeys.detail(id), }); }, - /** Remove secret from cache */secret: (queryClient: QueryClient, id: string | number) => { + /** Remove secret from cache */ secret: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: secretKeys.detail(id) + queryKey: secretKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/config/hooks/mutation-keys.ts b/sdk/constructive-react/src/config/hooks/mutation-keys.ts index 9ff5e0289e..77a9ae8747 100644 --- a/sdk/constructive-react/src/config/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/config/hooks/mutation-keys.ts @@ -19,34 +19,50 @@ // ============================================================================ export const configMutationKeys = { - /** All config mutation keys */all: ["mutation", "config"] as const, - /** Create config mutation key */create: () => ["mutation", "config", "create"] as const, - /** Update config mutation key */update: (id: string | number) => ["mutation", "config", "update", id] as const, - /** Delete config mutation key */delete: (id: string | number) => ["mutation", "config", "delete", id] as const + /** All config mutation keys */ all: ['mutation', 'config'] as const, + /** Create config mutation key */ create: () => ['mutation', 'config', 'create'] as const, + /** Update config mutation key */ update: (id: string | number) => + ['mutation', 'config', 'update', id] as const, + /** Delete config mutation key */ delete: (id: string | number) => + ['mutation', 'config', 'delete', id] as const, } as const; export const platformConfigMutationKeys = { - /** All platformConfig mutation keys */all: ["mutation", "platformconfig"] as const, - /** Create platformConfig mutation key */create: () => ["mutation", "platformconfig", "create"] as const, - /** Update platformConfig mutation key */update: (id: string | number) => ["mutation", "platformconfig", "update", id] as const, - /** Delete platformConfig mutation key */delete: (id: string | number) => ["mutation", "platformconfig", "delete", id] as const + /** All platformConfig mutation keys */ all: ['mutation', 'platformconfig'] as const, + /** Create platformConfig mutation key */ create: () => + ['mutation', 'platformconfig', 'create'] as const, + /** Update platformConfig mutation key */ update: (id: string | number) => + ['mutation', 'platformconfig', 'update', id] as const, + /** Delete platformConfig mutation key */ delete: (id: string | number) => + ['mutation', 'platformconfig', 'delete', id] as const, } as const; export const platformInternalSecretMutationKeys = { - /** All platformInternalSecret mutation keys */all: ["mutation", "platforminternalsecret"] as const, - /** Create platformInternalSecret mutation key */create: () => ["mutation", "platforminternalsecret", "create"] as const, - /** Update platformInternalSecret mutation key */update: (id: string | number) => ["mutation", "platforminternalsecret", "update", id] as const, - /** Delete platformInternalSecret mutation key */delete: (id: string | number) => ["mutation", "platforminternalsecret", "delete", id] as const + /** All platformInternalSecret mutation keys */ all: [ + 'mutation', + 'platforminternalsecret', + ] as const, + /** Create platformInternalSecret mutation key */ create: () => + ['mutation', 'platforminternalsecret', 'create'] as const, + /** Update platformInternalSecret mutation key */ update: (id: string | number) => + ['mutation', 'platforminternalsecret', 'update', id] as const, + /** Delete platformInternalSecret mutation key */ delete: (id: string | number) => + ['mutation', 'platforminternalsecret', 'delete', id] as const, } as const; export const platformSecretMutationKeys = { - /** All platformSecret mutation keys */all: ["mutation", "platformsecret"] as const, - /** Create platformSecret mutation key */create: () => ["mutation", "platformsecret", "create"] as const, - /** Update platformSecret mutation key */update: (id: string | number) => ["mutation", "platformsecret", "update", id] as const, - /** Delete platformSecret mutation key */delete: (id: string | number) => ["mutation", "platformsecret", "delete", id] as const + /** All platformSecret mutation keys */ all: ['mutation', 'platformsecret'] as const, + /** Create platformSecret mutation key */ create: () => + ['mutation', 'platformsecret', 'create'] as const, + /** Update platformSecret mutation key */ update: (id: string | number) => + ['mutation', 'platformsecret', 'update', id] as const, + /** Delete platformSecret mutation key */ delete: (id: string | number) => + ['mutation', 'platformsecret', 'delete', id] as const, } as const; export const secretMutationKeys = { - /** All secret mutation keys */all: ["mutation", "secret"] as const, - /** Create secret mutation key */create: () => ["mutation", "secret", "create"] as const, - /** Update secret mutation key */update: (id: string | number) => ["mutation", "secret", "update", id] as const, - /** Delete secret mutation key */delete: (id: string | number) => ["mutation", "secret", "delete", id] as const + /** All secret mutation keys */ all: ['mutation', 'secret'] as const, + /** Create secret mutation key */ create: () => ['mutation', 'secret', 'create'] as const, + /** Update secret mutation key */ update: (id: string | number) => + ['mutation', 'secret', 'update', id] as const, + /** Delete secret mutation key */ delete: (id: string | number) => + ['mutation', 'secret', 'delete', id] as const, } as const; // ============================================================================ @@ -54,19 +70,68 @@ export const secretMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for _secretsDel */_secretsDel: (identifier?: string) => identifier ? ["mutation", "_secretsDel", identifier] as const : ["mutation", "_secretsDel"] as const, - /** Mutation key for _secretsRemoveArray */_secretsRemoveArray: (identifier?: string) => identifier ? ["mutation", "_secretsRemoveArray", identifier] as const : ["mutation", "_secretsRemoveArray"] as const, - /** Mutation key for _secretsRotate */_secretsRotate: (identifier?: string) => identifier ? ["mutation", "_secretsRotate", identifier] as const : ["mutation", "_secretsRotate"] as const, - /** Mutation key for _secretsSet */_secretsSet: (identifier?: string) => identifier ? ["mutation", "_secretsSet", identifier] as const : ["mutation", "_secretsSet"] as const, - /** Mutation key for platformInternalSecretsDel */platformInternalSecretsDel: (identifier?: string) => identifier ? ["mutation", "platformInternalSecretsDel", identifier] as const : ["mutation", "platformInternalSecretsDel"] as const, - /** Mutation key for platformInternalSecretsRemoveArray */platformInternalSecretsRemoveArray: (identifier?: string) => identifier ? ["mutation", "platformInternalSecretsRemoveArray", identifier] as const : ["mutation", "platformInternalSecretsRemoveArray"] as const, - /** Mutation key for platformInternalSecretsRotate */platformInternalSecretsRotate: (identifier?: string) => identifier ? ["mutation", "platformInternalSecretsRotate", identifier] as const : ["mutation", "platformInternalSecretsRotate"] as const, - /** Mutation key for platformInternalSecretsSet */platformInternalSecretsSet: (identifier?: string) => identifier ? ["mutation", "platformInternalSecretsSet", identifier] as const : ["mutation", "platformInternalSecretsSet"] as const, - /** Mutation key for platformSecretsDel */platformSecretsDel: (identifier?: string) => identifier ? ["mutation", "platformSecretsDel", identifier] as const : ["mutation", "platformSecretsDel"] as const, - /** Mutation key for platformSecretsRemoveArray */platformSecretsRemoveArray: (identifier?: string) => identifier ? ["mutation", "platformSecretsRemoveArray", identifier] as const : ["mutation", "platformSecretsRemoveArray"] as const, - /** Mutation key for platformSecretsRotate */platformSecretsRotate: (identifier?: string) => identifier ? ["mutation", "platformSecretsRotate", identifier] as const : ["mutation", "platformSecretsRotate"] as const, - /** Mutation key for platformSecretsSet */platformSecretsSet: (identifier?: string) => identifier ? ["mutation", "platformSecretsSet", identifier] as const : ["mutation", "platformSecretsSet"] as const, - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const + /** Mutation key for _secretsDel */ _secretsDel: (identifier?: string) => + identifier + ? (['mutation', '_secretsDel', identifier] as const) + : (['mutation', '_secretsDel'] as const), + /** Mutation key for _secretsRemoveArray */ _secretsRemoveArray: (identifier?: string) => + identifier + ? (['mutation', '_secretsRemoveArray', identifier] as const) + : (['mutation', '_secretsRemoveArray'] as const), + /** Mutation key for _secretsRotate */ _secretsRotate: (identifier?: string) => + identifier + ? (['mutation', '_secretsRotate', identifier] as const) + : (['mutation', '_secretsRotate'] as const), + /** Mutation key for _secretsSet */ _secretsSet: (identifier?: string) => + identifier + ? (['mutation', '_secretsSet', identifier] as const) + : (['mutation', '_secretsSet'] as const), + /** Mutation key for platformInternalSecretsDel */ platformInternalSecretsDel: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInternalSecretsDel', identifier] as const) + : (['mutation', 'platformInternalSecretsDel'] as const), + /** Mutation key for platformInternalSecretsRemoveArray */ platformInternalSecretsRemoveArray: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInternalSecretsRemoveArray', identifier] as const) + : (['mutation', 'platformInternalSecretsRemoveArray'] as const), + /** Mutation key for platformInternalSecretsRotate */ platformInternalSecretsRotate: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInternalSecretsRotate', identifier] as const) + : (['mutation', 'platformInternalSecretsRotate'] as const), + /** Mutation key for platformInternalSecretsSet */ platformInternalSecretsSet: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInternalSecretsSet', identifier] as const) + : (['mutation', 'platformInternalSecretsSet'] as const), + /** Mutation key for platformSecretsDel */ platformSecretsDel: (identifier?: string) => + identifier + ? (['mutation', 'platformSecretsDel', identifier] as const) + : (['mutation', 'platformSecretsDel'] as const), + /** Mutation key for platformSecretsRemoveArray */ platformSecretsRemoveArray: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformSecretsRemoveArray', identifier] as const) + : (['mutation', 'platformSecretsRemoveArray'] as const), + /** Mutation key for platformSecretsRotate */ platformSecretsRotate: (identifier?: string) => + identifier + ? (['mutation', 'platformSecretsRotate', identifier] as const) + : (['mutation', 'platformSecretsRotate'] as const), + /** Mutation key for platformSecretsSet */ platformSecretsSet: (identifier?: string) => + identifier + ? (['mutation', 'platformSecretsSet', identifier] as const) + : (['mutation', 'platformSecretsSet'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), } as const; /** @@ -96,5 +161,5 @@ export const mutationKeys = { platformInternalSecret: platformInternalSecretMutationKeys, platformSecret: platformSecretMutationKeys, secret: secretMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/config/hooks/mutations/index.ts b/sdk/constructive-react/src/config/hooks/mutations/index.ts index 05d643d610..ef4a6219af 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/index.ts @@ -3,25 +3,25 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateConfigMutation"; -export * from "./useUpdateConfigMutation"; -export * from "./useDeleteConfigMutation"; -export * from "./useCreatePlatformConfigMutation"; -export * from "./useUpdatePlatformConfigMutation"; -export * from "./useDeletePlatformConfigMutation"; -export * from "./useCreatePlatformInternalSecretMutation"; -export * from "./useCreatePlatformSecretMutation"; -export * from "./useCreateSecretMutation"; -export * from "./use_secretsDelMutation"; -export * from "./use_secretsRemoveArrayMutation"; -export * from "./use_secretsRotateMutation"; -export * from "./use_secretsSetMutation"; -export * from "./usePlatformInternalSecretsDelMutation"; -export * from "./usePlatformInternalSecretsRemoveArrayMutation"; -export * from "./usePlatformInternalSecretsRotateMutation"; -export * from "./usePlatformInternalSecretsSetMutation"; -export * from "./usePlatformSecretsDelMutation"; -export * from "./usePlatformSecretsRemoveArrayMutation"; -export * from "./usePlatformSecretsRotateMutation"; -export * from "./usePlatformSecretsSetMutation"; -export * from "./useProvisionBucketMutation"; \ No newline at end of file +export * from './useCreateConfigMutation'; +export * from './useUpdateConfigMutation'; +export * from './useDeleteConfigMutation'; +export * from './useCreatePlatformConfigMutation'; +export * from './useUpdatePlatformConfigMutation'; +export * from './useDeletePlatformConfigMutation'; +export * from './useCreatePlatformInternalSecretMutation'; +export * from './useCreatePlatformSecretMutation'; +export * from './useCreateSecretMutation'; +export * from './use_secretsDelMutation'; +export * from './use_secretsRemoveArrayMutation'; +export * from './use_secretsRotateMutation'; +export * from './use_secretsSetMutation'; +export * from './usePlatformInternalSecretsDelMutation'; +export * from './usePlatformInternalSecretsRemoveArrayMutation'; +export * from './usePlatformInternalSecretsRotateMutation'; +export * from './usePlatformInternalSecretsSetMutation'; +export * from './usePlatformSecretsDelMutation'; +export * from './usePlatformSecretsRemoveArrayMutation'; +export * from './usePlatformSecretsRotateMutation'; +export * from './usePlatformSecretsSetMutation'; +export * from './useProvisionBucketMutation'; diff --git a/sdk/constructive-react/src/config/hooks/mutations/useCreateConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useCreateConfigMutation.ts index 239d2449cb..bade1d40ab 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useCreateConfigMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useCreateConfigMutation.ts @@ -4,62 +4,77 @@ * 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 { configKeys } from "../query-keys"; -import { configMutationKeys } from "../mutation-keys"; -import type { ConfigSelect, ConfigWithRelations, CreateConfigInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSelect, ConfigWithRelations, CreateConfigInput } from "../../orm/input-types"; +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 { configKeys } from '../query-keys'; +import { configMutationKeys } from '../mutation-keys'; +import type { ConfigSelect, ConfigWithRelations, CreateConfigInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ConfigSelect, ConfigWithRelations, CreateConfigInput } from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { mutate, isPending } = useCreateConfigMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateConfigMutation(params: { - selection: ({ - fields: S & ConfigSelect; - } & HookStrictSelect, ConfigSelect>); -} & Omit; - }; -}, Error, CreateConfigInput["config"]>, "mutationFn">): UseMutationResult<{ - createConfig: { - config: InferSelectResult; - }; -}, Error, CreateConfigInput["config"]>; -export function useCreateConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateConfigMutation( + params: { + selection: { + fields: S & ConfigSelect; + } & HookStrictSelect, ConfigSelect>; + } & Omit< + UseMutationOptions< + { + createConfig: { + config: InferSelectResult; + }; + }, + Error, + CreateConfigInput['config'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createConfig: { + config: InferSelectResult; + }; + }, + Error, + CreateConfigInput['config'] +>; +export function useCreateConfigMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: configMutationKeys.create(), - mutationFn: (data: CreateConfigInput["config"]) => getClient().config.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateConfigInput['config']) => + getClient() + .config.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: configKeys.lists() + queryKey: configKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigMutation.ts index e0e8f71876..73881dc6f0 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { platformConfigKeys } from "../query-keys"; -import { platformConfigMutationKeys } from "../mutation-keys"; -import type { PlatformConfigSelect, PlatformConfigWithRelations, CreatePlatformConfigInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformConfigSelect, PlatformConfigWithRelations, CreatePlatformConfigInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import { platformConfigMutationKeys } from '../mutation-keys'; +import type { + PlatformConfigSelect, + PlatformConfigWithRelations, + CreatePlatformConfigInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformConfigSelect, + PlatformConfigWithRelations, + CreatePlatformConfigInput, +} from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformConfigMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformConfigMutation(params: { - selection: ({ - fields: S & PlatformConfigSelect; - } & HookStrictSelect, PlatformConfigSelect>); -} & Omit; - }; -}, Error, CreatePlatformConfigInput["platformConfig"]>, "mutationFn">): UseMutationResult<{ - createPlatformConfig: { - platformConfig: InferSelectResult; - }; -}, Error, CreatePlatformConfigInput["platformConfig"]>; -export function useCreatePlatformConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformConfigMutation( + params: { + selection: { + fields: S & PlatformConfigSelect; + } & HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + CreatePlatformConfigInput['platformConfig'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + CreatePlatformConfigInput['platformConfig'] +>; +export function useCreatePlatformConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformConfigMutationKeys.create(), - mutationFn: (data: CreatePlatformConfigInput["platformConfig"]) => getClient().platformConfig.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformConfigInput['platformConfig']) => + getClient() + .platformConfig.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformConfigKeys.lists() + queryKey: platformConfigKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformInternalSecretMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformInternalSecretMutation.ts index f15b2b4529..d0230a9dba 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformInternalSecretMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformInternalSecretMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInternalSecretKeys } from "../query-keys"; -import { platformInternalSecretMutationKeys } from "../mutation-keys"; -import type { PlatformInternalSecretSelect, PlatformInternalSecretWithRelations, CreatePlatformInternalSecretInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInternalSecretSelect, PlatformInternalSecretWithRelations, CreatePlatformInternalSecretInput } from "../../orm/input-types"; +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 { platformInternalSecretKeys } from '../query-keys'; +import { platformInternalSecretMutationKeys } from '../mutation-keys'; +import type { + PlatformInternalSecretSelect, + PlatformInternalSecretWithRelations, + CreatePlatformInternalSecretInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInternalSecretSelect, + PlatformInternalSecretWithRelations, + CreatePlatformInternalSecretInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformInternalSecret - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInternalSecretMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInternalSecretMutation(params: { - selection: ({ - fields: S & PlatformInternalSecretSelect; - } & HookStrictSelect, PlatformInternalSecretSelect>); -} & Omit; - }; -}, Error, CreatePlatformInternalSecretInput["platformInternalSecret"]>, "mutationFn">): UseMutationResult<{ - createPlatformInternalSecret: { - platformInternalSecret: InferSelectResult; - }; -}, Error, CreatePlatformInternalSecretInput["platformInternalSecret"]>; -export function useCreatePlatformInternalSecretMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInternalSecretMutation( + params: { + selection: { + fields: S & PlatformInternalSecretSelect; + } & HookStrictSelect, PlatformInternalSecretSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInternalSecret: { + platformInternalSecret: InferSelectResult; + }; + }, + Error, + CreatePlatformInternalSecretInput['platformInternalSecret'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInternalSecret: { + platformInternalSecret: InferSelectResult; + }; + }, + Error, + CreatePlatformInternalSecretInput['platformInternalSecret'] +>; +export function useCreatePlatformInternalSecretMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInternalSecretMutationKeys.create(), - mutationFn: (data: CreatePlatformInternalSecretInput["platformInternalSecret"]) => getClient().platformInternalSecret.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInternalSecretInput['platformInternalSecret']) => + getClient() + .platformInternalSecret.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInternalSecretKeys.lists() + queryKey: platformInternalSecretKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformSecretMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformSecretMutation.ts index 232cc06537..16940cffcc 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformSecretMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformSecretMutation.ts @@ -4,62 +4,88 @@ * 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 { platformSecretKeys } from "../query-keys"; -import { platformSecretMutationKeys } from "../mutation-keys"; -import type { PlatformSecretSelect, PlatformSecretWithRelations, CreatePlatformSecretInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSecretSelect, PlatformSecretWithRelations, CreatePlatformSecretInput } from "../../orm/input-types"; +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 { platformSecretKeys } from '../query-keys'; +import { platformSecretMutationKeys } from '../mutation-keys'; +import type { + PlatformSecretSelect, + PlatformSecretWithRelations, + CreatePlatformSecretInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformSecretSelect, + PlatformSecretWithRelations, + CreatePlatformSecretInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformSecret - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformSecretMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformSecretMutation(params: { - selection: ({ - fields: S & PlatformSecretSelect; - } & HookStrictSelect, PlatformSecretSelect>); -} & Omit; - }; -}, Error, CreatePlatformSecretInput["platformSecret"]>, "mutationFn">): UseMutationResult<{ - createPlatformSecret: { - platformSecret: InferSelectResult; - }; -}, Error, CreatePlatformSecretInput["platformSecret"]>; -export function useCreatePlatformSecretMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformSecretMutation( + params: { + selection: { + fields: S & PlatformSecretSelect; + } & HookStrictSelect, PlatformSecretSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformSecret: { + platformSecret: InferSelectResult; + }; + }, + Error, + CreatePlatformSecretInput['platformSecret'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformSecret: { + platformSecret: InferSelectResult; + }; + }, + Error, + CreatePlatformSecretInput['platformSecret'] +>; +export function useCreatePlatformSecretMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformSecretMutationKeys.create(), - mutationFn: (data: CreatePlatformSecretInput["platformSecret"]) => getClient().platformSecret.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformSecretInput['platformSecret']) => + getClient() + .platformSecret.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformSecretKeys.lists() + queryKey: platformSecretKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useCreateSecretMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useCreateSecretMutation.ts index a60c1a417e..d80c9300fe 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useCreateSecretMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useCreateSecretMutation.ts @@ -4,62 +4,77 @@ * 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 { secretKeys } from "../query-keys"; -import { secretMutationKeys } from "../mutation-keys"; -import type { SecretSelect, SecretWithRelations, CreateSecretInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SecretSelect, SecretWithRelations, CreateSecretInput } from "../../orm/input-types"; +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 { secretKeys } from '../query-keys'; +import { secretMutationKeys } from '../mutation-keys'; +import type { SecretSelect, SecretWithRelations, CreateSecretInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SecretSelect, SecretWithRelations, CreateSecretInput } from '../../orm/input-types'; /** * Mutation hook for creating a Secret - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSecretMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSecretMutation(params: { - selection: ({ - fields: S & SecretSelect; - } & HookStrictSelect, SecretSelect>); -} & Omit; - }; -}, Error, CreateSecretInput["secret"]>, "mutationFn">): UseMutationResult<{ - createSecret: { - secret: InferSelectResult; - }; -}, Error, CreateSecretInput["secret"]>; -export function useCreateSecretMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSecretMutation( + params: { + selection: { + fields: S & SecretSelect; + } & HookStrictSelect, SecretSelect>; + } & Omit< + UseMutationOptions< + { + createSecret: { + secret: InferSelectResult; + }; + }, + Error, + CreateSecretInput['secret'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSecret: { + secret: InferSelectResult; + }; + }, + Error, + CreateSecretInput['secret'] +>; +export function useCreateSecretMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: secretMutationKeys.create(), - mutationFn: (data: CreateSecretInput["secret"]) => getClient().secret.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSecretInput['secret']) => + getClient() + .secret.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: secretKeys.lists() + queryKey: secretKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useDeleteConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useDeleteConfigMutation.ts index d7c6150203..6365d2d0b4 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useDeleteConfigMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useDeleteConfigMutation.ts @@ -4,77 +4,95 @@ * 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 { configKeys } from "../query-keys"; -import { configMutationKeys } from "../mutation-keys"; -import type { ConfigSelect, ConfigWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSelect, ConfigWithRelations } from "../../orm/input-types"; +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 { configKeys } from '../query-keys'; +import { configMutationKeys } from '../mutation-keys'; +import type { ConfigSelect, ConfigWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ConfigSelect, ConfigWithRelations } from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteConfigMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteConfigMutation(params: { - selection: ({ - fields: S & ConfigSelect; - } & HookStrictSelect, ConfigSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteConfig: { - config: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteConfigMutation( + params: { + selection: { + fields: S & ConfigSelect; + } & HookStrictSelect, ConfigSelect>; + } & Omit< + UseMutationOptions< + { + deleteConfig: { + config: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteConfig: { + config: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: configMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().config.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .config.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: configKeys.detail(variables.id) + queryKey: configKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: configKeys.lists() + queryKey: configKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigMutation.ts index 97ce8e6691..0fb926065f 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigMutation.ts @@ -4,77 +4,95 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { platformConfigKeys } from "../query-keys"; -import { platformConfigMutationKeys } from "../mutation-keys"; -import type { PlatformConfigSelect, PlatformConfigWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformConfigSelect, PlatformConfigWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import { platformConfigMutationKeys } from '../mutation-keys'; +import type { PlatformConfigSelect, PlatformConfigWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformConfigSelect, PlatformConfigWithRelations } from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformConfigMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformConfigMutation(params: { - selection: ({ - fields: S & PlatformConfigSelect; - } & HookStrictSelect, PlatformConfigSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformConfig: { - platformConfig: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformConfigMutation( + params: { + selection: { + fields: S & PlatformConfigSelect; + } & HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformConfigMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformConfig.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformConfig.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformConfigKeys.detail(variables.id) + queryKey: platformConfigKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformConfigKeys.lists() + queryKey: platformConfigKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsDelMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsDelMutation.ts index ff04ad3fe2..21806bd5b9 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsDelMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsDelMutation.ts @@ -4,39 +4,57 @@ * 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 { PlatformInternalSecretsDelVariables } from "../../orm/mutation"; -import type { PlatformInternalSecretsDelPayloadSelect, PlatformInternalSecretsDelPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInternalSecretsDelVariables } from "../../orm/mutation"; -export type { PlatformInternalSecretsDelPayloadSelect } from "../../orm/input-types"; -export function usePlatformInternalSecretsDelMutation(params: { - selection: ({ - fields: S & PlatformInternalSecretsDelPayloadSelect; - } & HookStrictSelect, PlatformInternalSecretsDelPayloadSelect>); -} & Omit | null; -}, Error, PlatformInternalSecretsDelVariables>, "mutationFn">): UseMutationResult<{ - platformInternalSecretsDel: InferSelectResult | null; -}, Error, PlatformInternalSecretsDelVariables> { +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 { PlatformInternalSecretsDelVariables } from '../../orm/mutation'; +import type { + PlatformInternalSecretsDelPayloadSelect, + PlatformInternalSecretsDelPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInternalSecretsDelVariables } from '../../orm/mutation'; +export type { PlatformInternalSecretsDelPayloadSelect } from '../../orm/input-types'; +export function usePlatformInternalSecretsDelMutation< + S extends PlatformInternalSecretsDelPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInternalSecretsDelPayloadSelect; + } & HookStrictSelect, PlatformInternalSecretsDelPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInternalSecretsDel: InferSelectResult | null; + }, + Error, + PlatformInternalSecretsDelVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInternalSecretsDel: InferSelectResult | null; + }, + Error, + PlatformInternalSecretsDelVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInternalSecretsDel(), - mutationFn: (variables: PlatformInternalSecretsDelVariables) => getClient().mutation.platformInternalSecretsDel(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInternalSecretsDelVariables) => + getClient() + .mutation.platformInternalSecretsDel(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsRemoveArrayMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsRemoveArrayMutation.ts index e878f0a324..d548fc5147 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsRemoveArrayMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsRemoveArrayMutation.ts @@ -4,39 +4,63 @@ * 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 { PlatformInternalSecretsRemoveArrayVariables } from "../../orm/mutation"; -import type { PlatformInternalSecretsRemoveArrayPayloadSelect, PlatformInternalSecretsRemoveArrayPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInternalSecretsRemoveArrayVariables } from "../../orm/mutation"; -export type { PlatformInternalSecretsRemoveArrayPayloadSelect } from "../../orm/input-types"; -export function usePlatformInternalSecretsRemoveArrayMutation(params: { - selection: ({ - fields: S & PlatformInternalSecretsRemoveArrayPayloadSelect; - } & HookStrictSelect, PlatformInternalSecretsRemoveArrayPayloadSelect>); -} & Omit | null; -}, Error, PlatformInternalSecretsRemoveArrayVariables>, "mutationFn">): UseMutationResult<{ - platformInternalSecretsRemoveArray: InferSelectResult | null; -}, Error, PlatformInternalSecretsRemoveArrayVariables> { +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 { PlatformInternalSecretsRemoveArrayVariables } from '../../orm/mutation'; +import type { + PlatformInternalSecretsRemoveArrayPayloadSelect, + PlatformInternalSecretsRemoveArrayPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInternalSecretsRemoveArrayVariables } from '../../orm/mutation'; +export type { PlatformInternalSecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export function usePlatformInternalSecretsRemoveArrayMutation< + S extends PlatformInternalSecretsRemoveArrayPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInternalSecretsRemoveArrayPayloadSelect; + } & HookStrictSelect, PlatformInternalSecretsRemoveArrayPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInternalSecretsRemoveArray: InferSelectResult< + PlatformInternalSecretsRemoveArrayPayload, + S + > | null; + }, + Error, + PlatformInternalSecretsRemoveArrayVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInternalSecretsRemoveArray: InferSelectResult< + PlatformInternalSecretsRemoveArrayPayload, + S + > | null; + }, + Error, + PlatformInternalSecretsRemoveArrayVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInternalSecretsRemoveArray(), - mutationFn: (variables: PlatformInternalSecretsRemoveArrayVariables) => getClient().mutation.platformInternalSecretsRemoveArray(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInternalSecretsRemoveArrayVariables) => + getClient() + .mutation.platformInternalSecretsRemoveArray(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsRotateMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsRotateMutation.ts index 3694217730..ffb7abebf8 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsRotateMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsRotateMutation.ts @@ -4,39 +4,63 @@ * 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 { PlatformInternalSecretsRotateVariables } from "../../orm/mutation"; -import type { PlatformInternalSecretsRotatePayloadSelect, PlatformInternalSecretsRotatePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInternalSecretsRotateVariables } from "../../orm/mutation"; -export type { PlatformInternalSecretsRotatePayloadSelect } from "../../orm/input-types"; -export function usePlatformInternalSecretsRotateMutation(params: { - selection: ({ - fields: S & PlatformInternalSecretsRotatePayloadSelect; - } & HookStrictSelect, PlatformInternalSecretsRotatePayloadSelect>); -} & Omit | null; -}, Error, PlatformInternalSecretsRotateVariables>, "mutationFn">): UseMutationResult<{ - platformInternalSecretsRotate: InferSelectResult | null; -}, Error, PlatformInternalSecretsRotateVariables> { +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 { PlatformInternalSecretsRotateVariables } from '../../orm/mutation'; +import type { + PlatformInternalSecretsRotatePayloadSelect, + PlatformInternalSecretsRotatePayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInternalSecretsRotateVariables } from '../../orm/mutation'; +export type { PlatformInternalSecretsRotatePayloadSelect } from '../../orm/input-types'; +export function usePlatformInternalSecretsRotateMutation< + S extends PlatformInternalSecretsRotatePayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInternalSecretsRotatePayloadSelect; + } & HookStrictSelect, PlatformInternalSecretsRotatePayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInternalSecretsRotate: InferSelectResult< + PlatformInternalSecretsRotatePayload, + S + > | null; + }, + Error, + PlatformInternalSecretsRotateVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInternalSecretsRotate: InferSelectResult< + PlatformInternalSecretsRotatePayload, + S + > | null; + }, + Error, + PlatformInternalSecretsRotateVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInternalSecretsRotate(), - mutationFn: (variables: PlatformInternalSecretsRotateVariables) => getClient().mutation.platformInternalSecretsRotate(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInternalSecretsRotateVariables) => + getClient() + .mutation.platformInternalSecretsRotate(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsSetMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsSetMutation.ts index df182ddebb..f6728c7b10 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsSetMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformInternalSecretsSetMutation.ts @@ -4,39 +4,57 @@ * 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 { PlatformInternalSecretsSetVariables } from "../../orm/mutation"; -import type { PlatformInternalSecretsSetPayloadSelect, PlatformInternalSecretsSetPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInternalSecretsSetVariables } from "../../orm/mutation"; -export type { PlatformInternalSecretsSetPayloadSelect } from "../../orm/input-types"; -export function usePlatformInternalSecretsSetMutation(params: { - selection: ({ - fields: S & PlatformInternalSecretsSetPayloadSelect; - } & HookStrictSelect, PlatformInternalSecretsSetPayloadSelect>); -} & Omit | null; -}, Error, PlatformInternalSecretsSetVariables>, "mutationFn">): UseMutationResult<{ - platformInternalSecretsSet: InferSelectResult | null; -}, Error, PlatformInternalSecretsSetVariables> { +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 { PlatformInternalSecretsSetVariables } from '../../orm/mutation'; +import type { + PlatformInternalSecretsSetPayloadSelect, + PlatformInternalSecretsSetPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInternalSecretsSetVariables } from '../../orm/mutation'; +export type { PlatformInternalSecretsSetPayloadSelect } from '../../orm/input-types'; +export function usePlatformInternalSecretsSetMutation< + S extends PlatformInternalSecretsSetPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInternalSecretsSetPayloadSelect; + } & HookStrictSelect, PlatformInternalSecretsSetPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInternalSecretsSet: InferSelectResult | null; + }, + Error, + PlatformInternalSecretsSetVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInternalSecretsSet: InferSelectResult | null; + }, + Error, + PlatformInternalSecretsSetVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInternalSecretsSet(), - mutationFn: (variables: PlatformInternalSecretsSetVariables) => getClient().mutation.platformInternalSecretsSet(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInternalSecretsSetVariables) => + getClient() + .mutation.platformInternalSecretsSet(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsDelMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsDelMutation.ts index a946e69cb8..d55783e12a 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsDelMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsDelMutation.ts @@ -4,39 +4,55 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { PlatformSecretsDelVariables } from "../../orm/mutation"; -import type { PlatformSecretsDelPayloadSelect, PlatformSecretsDelPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformSecretsDelVariables } from "../../orm/mutation"; -export type { PlatformSecretsDelPayloadSelect } from "../../orm/input-types"; -export function usePlatformSecretsDelMutation(params: { - selection: ({ - fields: S & PlatformSecretsDelPayloadSelect; - } & HookStrictSelect, PlatformSecretsDelPayloadSelect>); -} & Omit | null; -}, Error, PlatformSecretsDelVariables>, "mutationFn">): UseMutationResult<{ - platformSecretsDel: InferSelectResult | null; -}, Error, PlatformSecretsDelVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { PlatformSecretsDelVariables } from '../../orm/mutation'; +import type { + PlatformSecretsDelPayloadSelect, + PlatformSecretsDelPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformSecretsDelVariables } from '../../orm/mutation'; +export type { PlatformSecretsDelPayloadSelect } from '../../orm/input-types'; +export function usePlatformSecretsDelMutation( + params: { + selection: { + fields: S & PlatformSecretsDelPayloadSelect; + } & HookStrictSelect, PlatformSecretsDelPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformSecretsDel: InferSelectResult | null; + }, + Error, + PlatformSecretsDelVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformSecretsDel: InferSelectResult | null; + }, + Error, + PlatformSecretsDelVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformSecretsDel(), - mutationFn: (variables: PlatformSecretsDelVariables) => getClient().mutation.platformSecretsDel(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformSecretsDelVariables) => + getClient() + .mutation.platformSecretsDel(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRemoveArrayMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRemoveArrayMutation.ts index c1ce8ccb5a..91f695a7e3 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRemoveArrayMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRemoveArrayMutation.ts @@ -4,39 +4,57 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { PlatformSecretsRemoveArrayVariables } from "../../orm/mutation"; -import type { PlatformSecretsRemoveArrayPayloadSelect, PlatformSecretsRemoveArrayPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformSecretsRemoveArrayVariables } from "../../orm/mutation"; -export type { PlatformSecretsRemoveArrayPayloadSelect } from "../../orm/input-types"; -export function usePlatformSecretsRemoveArrayMutation(params: { - selection: ({ - fields: S & PlatformSecretsRemoveArrayPayloadSelect; - } & HookStrictSelect, PlatformSecretsRemoveArrayPayloadSelect>); -} & Omit | null; -}, Error, PlatformSecretsRemoveArrayVariables>, "mutationFn">): UseMutationResult<{ - platformSecretsRemoveArray: InferSelectResult | null; -}, Error, PlatformSecretsRemoveArrayVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { PlatformSecretsRemoveArrayVariables } from '../../orm/mutation'; +import type { + PlatformSecretsRemoveArrayPayloadSelect, + PlatformSecretsRemoveArrayPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformSecretsRemoveArrayVariables } from '../../orm/mutation'; +export type { PlatformSecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export function usePlatformSecretsRemoveArrayMutation< + S extends PlatformSecretsRemoveArrayPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformSecretsRemoveArrayPayloadSelect; + } & HookStrictSelect, PlatformSecretsRemoveArrayPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformSecretsRemoveArray: InferSelectResult | null; + }, + Error, + PlatformSecretsRemoveArrayVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformSecretsRemoveArray: InferSelectResult | null; + }, + Error, + PlatformSecretsRemoveArrayVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformSecretsRemoveArray(), - mutationFn: (variables: PlatformSecretsRemoveArrayVariables) => getClient().mutation.platformSecretsRemoveArray(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformSecretsRemoveArrayVariables) => + getClient() + .mutation.platformSecretsRemoveArray(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRotateMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRotateMutation.ts index 006149ef87..1f8a976e9e 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRotateMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRotateMutation.ts @@ -4,39 +4,55 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { PlatformSecretsRotateVariables } from "../../orm/mutation"; -import type { PlatformSecretsRotatePayloadSelect, PlatformSecretsRotatePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformSecretsRotateVariables } from "../../orm/mutation"; -export type { PlatformSecretsRotatePayloadSelect } from "../../orm/input-types"; -export function usePlatformSecretsRotateMutation(params: { - selection: ({ - fields: S & PlatformSecretsRotatePayloadSelect; - } & HookStrictSelect, PlatformSecretsRotatePayloadSelect>); -} & Omit | null; -}, Error, PlatformSecretsRotateVariables>, "mutationFn">): UseMutationResult<{ - platformSecretsRotate: InferSelectResult | null; -}, Error, PlatformSecretsRotateVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { PlatformSecretsRotateVariables } from '../../orm/mutation'; +import type { + PlatformSecretsRotatePayloadSelect, + PlatformSecretsRotatePayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformSecretsRotateVariables } from '../../orm/mutation'; +export type { PlatformSecretsRotatePayloadSelect } from '../../orm/input-types'; +export function usePlatformSecretsRotateMutation( + params: { + selection: { + fields: S & PlatformSecretsRotatePayloadSelect; + } & HookStrictSelect, PlatformSecretsRotatePayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformSecretsRotate: InferSelectResult | null; + }, + Error, + PlatformSecretsRotateVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformSecretsRotate: InferSelectResult | null; + }, + Error, + PlatformSecretsRotateVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformSecretsRotate(), - mutationFn: (variables: PlatformSecretsRotateVariables) => getClient().mutation.platformSecretsRotate(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformSecretsRotateVariables) => + getClient() + .mutation.platformSecretsRotate(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsSetMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsSetMutation.ts index f3cc5535b1..a1bb3d2ba9 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsSetMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsSetMutation.ts @@ -4,39 +4,55 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { PlatformSecretsSetVariables } from "../../orm/mutation"; -import type { PlatformSecretsSetPayloadSelect, PlatformSecretsSetPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformSecretsSetVariables } from "../../orm/mutation"; -export type { PlatformSecretsSetPayloadSelect } from "../../orm/input-types"; -export function usePlatformSecretsSetMutation(params: { - selection: ({ - fields: S & PlatformSecretsSetPayloadSelect; - } & HookStrictSelect, PlatformSecretsSetPayloadSelect>); -} & Omit | null; -}, Error, PlatformSecretsSetVariables>, "mutationFn">): UseMutationResult<{ - platformSecretsSet: InferSelectResult | null; -}, Error, PlatformSecretsSetVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { PlatformSecretsSetVariables } from '../../orm/mutation'; +import type { + PlatformSecretsSetPayloadSelect, + PlatformSecretsSetPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformSecretsSetVariables } from '../../orm/mutation'; +export type { PlatformSecretsSetPayloadSelect } from '../../orm/input-types'; +export function usePlatformSecretsSetMutation( + params: { + selection: { + fields: S & PlatformSecretsSetPayloadSelect; + } & HookStrictSelect, PlatformSecretsSetPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformSecretsSet: InferSelectResult | null; + }, + Error, + PlatformSecretsSetVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformSecretsSet: InferSelectResult | null; + }, + Error, + PlatformSecretsSetVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformSecretsSet(), - mutationFn: (variables: PlatformSecretsSetVariables) => getClient().mutation.platformSecretsSet(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformSecretsSetVariables) => + getClient() + .mutation.platformSecretsSet(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useUpdateConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useUpdateConfigMutation.ts index 00d7b4d3c6..7d24ccfedf 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useUpdateConfigMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useUpdateConfigMutation.ts @@ -4,83 +4,99 @@ * 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 { configKeys } from "../query-keys"; -import { configMutationKeys } from "../mutation-keys"; -import type { ConfigSelect, ConfigWithRelations, ConfigPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSelect, ConfigWithRelations, ConfigPatch } from "../../orm/input-types"; +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 { configKeys } from '../query-keys'; +import { configMutationKeys } from '../mutation-keys'; +import type { ConfigSelect, ConfigWithRelations, ConfigPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ConfigSelect, ConfigWithRelations, ConfigPatch } from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateConfigMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', configPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateConfigMutation(params: { - selection: ({ - fields: S & ConfigSelect; - } & HookStrictSelect, ConfigSelect>); -} & Omit; - }; -}, Error, { - id: string; - configPatch: ConfigPatch; -}>, "mutationFn">): UseMutationResult<{ - updateConfig: { - config: InferSelectResult; - }; -}, Error, { - id: string; - configPatch: ConfigPatch; -}>; -export function useUpdateConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateConfigMutation( + params: { + selection: { + fields: S & ConfigSelect; + } & HookStrictSelect, ConfigSelect>; + } & Omit< + UseMutationOptions< + { + updateConfig: { + config: InferSelectResult; + }; + }, + Error, + { + id: string; + configPatch: ConfigPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateConfig: { + config: InferSelectResult; + }; + }, + Error, + { + id: string; + configPatch: ConfigPatch; + } +>; +export function useUpdateConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + configPatch: ConfigPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: configMutationKeys.all, - mutationFn: ({ - id, - configPatch - }: { - id: string; - configPatch: ConfigPatch; - }) => getClient().config.update({ - where: { - id - }, - data: configPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, configPatch }: { id: string; configPatch: ConfigPatch }) => + getClient() + .config.update({ + where: { + id, + }, + data: configPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: configKeys.detail(variables.id) + queryKey: configKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: configKeys.lists() + queryKey: configKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigMutation.ts index 11ab0a7b27..c806bc40f3 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { platformConfigKeys } from "../query-keys"; -import { platformConfigMutationKeys } from "../mutation-keys"; -import type { PlatformConfigSelect, PlatformConfigWithRelations, PlatformConfigPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformConfigSelect, PlatformConfigWithRelations, PlatformConfigPatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import { platformConfigMutationKeys } from '../mutation-keys'; +import type { + PlatformConfigSelect, + PlatformConfigWithRelations, + PlatformConfigPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformConfigSelect, + PlatformConfigWithRelations, + PlatformConfigPatch, +} from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformConfigMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformConfigPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformConfigMutation(params: { - selection: ({ - fields: S & PlatformConfigSelect; - } & HookStrictSelect, PlatformConfigSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformConfigPatch: PlatformConfigPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformConfig: { - platformConfig: InferSelectResult; - }; -}, Error, { - id: string; - platformConfigPatch: PlatformConfigPatch; -}>; -export function useUpdatePlatformConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformConfigMutation( + params: { + selection: { + fields: S & PlatformConfigSelect; + } & HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + platformConfigPatch: PlatformConfigPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + platformConfigPatch: PlatformConfigPatch; + } +>; +export function useUpdatePlatformConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformConfigPatch: PlatformConfigPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformConfigMutationKeys.all, mutationFn: ({ id, - platformConfigPatch + platformConfigPatch, }: { id: string; platformConfigPatch: PlatformConfigPatch; - }) => getClient().platformConfig.update({ - where: { - id - }, - data: platformConfigPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformConfig.update({ + where: { + id, + }, + data: platformConfigPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformConfigKeys.detail(variables.id) + queryKey: platformConfigKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformConfigKeys.lists() + queryKey: platformConfigKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/use_secretsDelMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/use_secretsDelMutation.ts index 447d79ece0..d80b8120bb 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/use_secretsDelMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/use_secretsDelMutation.ts @@ -4,39 +4,52 @@ * 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 { _secretsDelVariables } from "../../orm/mutation"; -import type { _SecretsDelPayloadSelect, _SecretsDelPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { _secretsDelVariables } from "../../orm/mutation"; -export type { _SecretsDelPayloadSelect } from "../../orm/input-types"; -export function use_secretsDelMutation(params: { - selection: ({ - fields: S & _SecretsDelPayloadSelect; - } & HookStrictSelect, _SecretsDelPayloadSelect>); -} & Omit | null; -}, Error, _secretsDelVariables>, "mutationFn">): UseMutationResult<{ - _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; -}, Error, _secretsDelVariables> { +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 { _secretsDelVariables } from '../../orm/mutation'; +import type { _SecretsDelPayloadSelect, _SecretsDelPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { _secretsDelVariables } from '../../orm/mutation'; +export type { _SecretsDelPayloadSelect } from '../../orm/input-types'; +export function use_secretsDelMutation( + params: { + selection: { + fields: S & _SecretsDelPayloadSelect; + } & HookStrictSelect, _SecretsDelPayloadSelect>; + } & Omit< + UseMutationOptions< + { + _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; + }, + Error, + _secretsDelVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; + }, + Error, + _secretsDelVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys._secretsDel(), - mutationFn: (variables: _secretsDelVariables) => getClient().mutation._secretsDel(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: _secretsDelVariables) => + getClient() + .mutation._secretsDel(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/use_secretsRemoveArrayMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/use_secretsRemoveArrayMutation.ts index e428d1de11..7de1a07f39 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/use_secretsRemoveArrayMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/use_secretsRemoveArrayMutation.ts @@ -4,39 +4,55 @@ * 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 { _secretsRemoveArrayVariables } from "../../orm/mutation"; -import type { _SecretsRemoveArrayPayloadSelect, _SecretsRemoveArrayPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { _secretsRemoveArrayVariables } from "../../orm/mutation"; -export type { _SecretsRemoveArrayPayloadSelect } from "../../orm/input-types"; -export function use_secretsRemoveArrayMutation(params: { - selection: ({ - fields: S & _SecretsRemoveArrayPayloadSelect; - } & HookStrictSelect, _SecretsRemoveArrayPayloadSelect>); -} & Omit | null; -}, Error, _secretsRemoveArrayVariables>, "mutationFn">): UseMutationResult<{ - _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; -}, Error, _secretsRemoveArrayVariables> { +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 { _secretsRemoveArrayVariables } from '../../orm/mutation'; +import type { + _SecretsRemoveArrayPayloadSelect, + _SecretsRemoveArrayPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { _secretsRemoveArrayVariables } from '../../orm/mutation'; +export type { _SecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export function use_secretsRemoveArrayMutation( + params: { + selection: { + fields: S & _SecretsRemoveArrayPayloadSelect; + } & HookStrictSelect, _SecretsRemoveArrayPayloadSelect>; + } & Omit< + UseMutationOptions< + { + _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; + }, + Error, + _secretsRemoveArrayVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; + }, + Error, + _secretsRemoveArrayVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys._secretsRemoveArray(), - mutationFn: (variables: _secretsRemoveArrayVariables) => getClient().mutation._secretsRemoveArray(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: _secretsRemoveArrayVariables) => + getClient() + .mutation._secretsRemoveArray(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/use_secretsRotateMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/use_secretsRotateMutation.ts index d19c1be0df..67fb59df0f 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/use_secretsRotateMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/use_secretsRotateMutation.ts @@ -4,39 +4,52 @@ * 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 { _secretsRotateVariables } from "../../orm/mutation"; -import type { _SecretsRotatePayloadSelect, _SecretsRotatePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { _secretsRotateVariables } from "../../orm/mutation"; -export type { _SecretsRotatePayloadSelect } from "../../orm/input-types"; -export function use_secretsRotateMutation(params: { - selection: ({ - fields: S & _SecretsRotatePayloadSelect; - } & HookStrictSelect, _SecretsRotatePayloadSelect>); -} & Omit | null; -}, Error, _secretsRotateVariables>, "mutationFn">): UseMutationResult<{ - _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; -}, Error, _secretsRotateVariables> { +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 { _secretsRotateVariables } from '../../orm/mutation'; +import type { _SecretsRotatePayloadSelect, _SecretsRotatePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { _secretsRotateVariables } from '../../orm/mutation'; +export type { _SecretsRotatePayloadSelect } from '../../orm/input-types'; +export function use_secretsRotateMutation( + params: { + selection: { + fields: S & _SecretsRotatePayloadSelect; + } & HookStrictSelect, _SecretsRotatePayloadSelect>; + } & Omit< + UseMutationOptions< + { + _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; + }, + Error, + _secretsRotateVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; + }, + Error, + _secretsRotateVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys._secretsRotate(), - mutationFn: (variables: _secretsRotateVariables) => getClient().mutation._secretsRotate(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: _secretsRotateVariables) => + getClient() + .mutation._secretsRotate(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/mutations/use_secretsSetMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/use_secretsSetMutation.ts index 60532cc5b8..3264c1c49e 100644 --- a/sdk/constructive-react/src/config/hooks/mutations/use_secretsSetMutation.ts +++ b/sdk/constructive-react/src/config/hooks/mutations/use_secretsSetMutation.ts @@ -4,39 +4,52 @@ * 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 { _secretsSetVariables } from "../../orm/mutation"; -import type { _SecretsSetPayloadSelect, _SecretsSetPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { _secretsSetVariables } from "../../orm/mutation"; -export type { _SecretsSetPayloadSelect } from "../../orm/input-types"; -export function use_secretsSetMutation(params: { - selection: ({ - fields: S & _SecretsSetPayloadSelect; - } & HookStrictSelect, _SecretsSetPayloadSelect>); -} & Omit | null; -}, Error, _secretsSetVariables>, "mutationFn">): UseMutationResult<{ - _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; -}, Error, _secretsSetVariables> { +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 { _secretsSetVariables } from '../../orm/mutation'; +import type { _SecretsSetPayloadSelect, _SecretsSetPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { _secretsSetVariables } from '../../orm/mutation'; +export type { _SecretsSetPayloadSelect } from '../../orm/input-types'; +export function use_secretsSetMutation( + params: { + selection: { + fields: S & _SecretsSetPayloadSelect; + } & HookStrictSelect, _SecretsSetPayloadSelect>; + } & Omit< + UseMutationOptions< + { + _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; + }, + Error, + _secretsSetVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; + }, + Error, + _secretsSetVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys._secretsSet(), - mutationFn: (variables: _secretsSetVariables) => getClient().mutation._secretsSet(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: _secretsSetVariables) => + getClient() + .mutation._secretsSet(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/index.ts b/sdk/constructive-react/src/config/hooks/queries/index.ts index 1ea8277faf..99232c61b4 100644 --- a/sdk/constructive-react/src/config/hooks/queries/index.ts +++ b/sdk/constructive-react/src/config/hooks/queries/index.ts @@ -3,13 +3,13 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useConfigsQuery"; -export * from "./useConfigQuery"; -export * from "./usePlatformConfigsQuery"; -export * from "./usePlatformConfigQuery"; -export * from "./usePlatformInternalSecretsQuery"; -export * from "./usePlatformInternalSecretQuery"; -export * from "./usePlatformSecretsQuery"; -export * from "./usePlatformSecretQuery"; -export * from "./useSecretsQuery"; -export * from "./useSecretQuery"; \ No newline at end of file +export * from './useConfigsQuery'; +export * from './useConfigQuery'; +export * from './usePlatformConfigsQuery'; +export * from './usePlatformConfigQuery'; +export * from './usePlatformInternalSecretsQuery'; +export * from './usePlatformInternalSecretQuery'; +export * from './usePlatformSecretsQuery'; +export * from './usePlatformSecretQuery'; +export * from './useSecretsQuery'; +export * from './useSecretQuery'; diff --git a/sdk/constructive-react/src/config/hooks/queries/useConfigQuery.ts b/sdk/constructive-react/src/config/hooks/queries/useConfigQuery.ts index 785d0f72c4..36e86f4ea6 100644 --- a/sdk/constructive-react/src/config/hooks/queries/useConfigQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/useConfigQuery.ts @@ -4,20 +4,20 @@ * 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 { configKeys } from "../query-keys"; -import type { ConfigSelect, ConfigWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSelect, ConfigWithRelations } from "../../orm/input-types"; +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 { configKeys } from '../query-keys'; +import type { ConfigSelect, ConfigWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ConfigSelect, ConfigWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const configQueryKey = configKeys.detail; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { data, isLoading } = useConfigQuery({ @@ -26,38 +26,52 @@ export const configQueryKey = configKeys.detail; * }); * ``` */ -export function useConfigQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ConfigSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useConfigQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useConfigQuery< + S extends ConfigSelect, + TData = { + config: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ConfigSelect>; + } & Omit< + UseQueryOptions< + { + config: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useConfigQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: configKeys.detail(params.id), - queryFn: () => getClient().config.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .config.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```ts * const data = await fetchConfigQuery({ @@ -79,35 +93,46 @@ export async function fetchConfigQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().config.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .config.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```ts * await prefetchConfigQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchConfigQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ConfigSelect>; -}): Promise; -export async function prefetchConfigQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchConfigQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ConfigSelect>; + } +): Promise; +export async function prefetchConfigQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: configKeys.detail(params.id), - queryFn: () => getClient().config.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .config.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/useConfigsQuery.ts b/sdk/constructive-react/src/config/hooks/queries/useConfigsQuery.ts index bd9acf77c3..aea66a5b0f 100644 --- a/sdk/constructive-react/src/config/hooks/queries/useConfigsQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/useConfigsQuery.ts @@ -4,20 +4,35 @@ * 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 { configKeys } from "../query-keys"; -import type { ConfigSelect, ConfigWithRelations, ConfigFilter, ConfigOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSelect, ConfigWithRelations, ConfigFilter, ConfigOrderBy } from "../../orm/input-types"; +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 { configKeys } from '../query-keys'; +import type { + ConfigSelect, + ConfigWithRelations, + ConfigFilter, + ConfigOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ConfigSelect, + ConfigWithRelations, + ConfigFilter, + ConfigOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const configsQueryKey = configKeys.list; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { data, isLoading } = useConfigsQuery({ @@ -30,33 +45,45 @@ export const configsQueryKey = configKeys.list; * }); * ``` */ -export function useConfigsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ConfigSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useConfigsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useConfigsQuery< + S extends ConfigSelect, + TData = { + configs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ConfigSelect>; + } & Omit< + UseQueryOptions< + { + configs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useConfigsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: configKeys.list(args), queryFn: () => getClient().config.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```ts * const data = await fetchConfigsQuery({ @@ -70,7 +97,8 @@ export function useConfigsQuery(params: { export async function fetchConfigsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ConfigSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ConfigSelect>; }): Promise<{ configs: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchConfigsQuery(params: { } /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```ts * await prefetchConfigsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchConfigsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ConfigSelect>; -}): Promise; -export async function prefetchConfigsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchConfigsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ConfigSelect>; + } +): Promise; +export async function prefetchConfigsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: configKeys.list(args), - queryFn: () => getClient().config.findMany(args).unwrap() + queryFn: () => getClient().config.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigQuery.ts index 74a460bb98..15aaffbf7a 100644 --- a/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigQuery.ts @@ -4,20 +4,20 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { platformConfigKeys } from "../query-keys"; -import type { PlatformConfigSelect, PlatformConfigWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformConfigSelect, PlatformConfigWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import type { PlatformConfigSelect, PlatformConfigWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformConfigSelect, PlatformConfigWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformConfigQueryKey = platformConfigKeys.detail; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { data, isLoading } = usePlatformConfigQuery({ @@ -26,38 +26,52 @@ export const platformConfigQueryKey = platformConfigKeys.detail; * }); * ``` */ -export function usePlatformConfigQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformConfigSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformConfigQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformConfigQuery< + S extends PlatformConfigSelect, + TData = { + platformConfig: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseQueryOptions< + { + platformConfig: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformConfigQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformConfigKeys.detail(params.id), - queryFn: () => getClient().platformConfig.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```ts * const data = await fetchPlatformConfigQuery({ @@ -79,35 +93,46 @@ export async function fetchPlatformConfigQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformConfig.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```ts * await prefetchPlatformConfigQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformConfigQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformConfigSelect>; -}): Promise; -export async function prefetchPlatformConfigQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformConfigQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformConfigSelect>; + } +): Promise; +export async function prefetchPlatformConfigQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformConfigKeys.detail(params.id), - queryFn: () => getClient().platformConfig.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigsQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigsQuery.ts index 5a4e7ac70c..ab1110fe4e 100644 --- a/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigsQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigsQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { platformConfigKeys } from "../query-keys"; -import type { PlatformConfigSelect, PlatformConfigWithRelations, PlatformConfigFilter, PlatformConfigOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformConfigSelect, PlatformConfigWithRelations, PlatformConfigFilter, PlatformConfigOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import type { + PlatformConfigSelect, + PlatformConfigWithRelations, + PlatformConfigFilter, + PlatformConfigOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformConfigSelect, + PlatformConfigWithRelations, + PlatformConfigFilter, + PlatformConfigOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformConfigsQueryKey = platformConfigKeys.list; /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```tsx * const { data, isLoading } = usePlatformConfigsQuery({ @@ -30,33 +45,53 @@ export const platformConfigsQueryKey = platformConfigKeys.list; * }); * ``` */ -export function usePlatformConfigsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformConfigSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformConfigsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformConfigsQuery< + S extends PlatformConfigSelect, + TData = { + platformConfigs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseQueryOptions< + { + platformConfigs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformConfigsQuery( + params: { + selection: ListSelectionConfig< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformConfigKeys.list(args), queryFn: () => getClient().platformConfig.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```ts * const data = await fetchPlatformConfigsQuery({ @@ -70,35 +105,55 @@ export function usePlatformConfigsQuery(params: { export async function fetchPlatformConfigsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformConfigSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformConfigSelect>; }): Promise<{ platformConfigs: ConnectionResult>; }>; export async function fetchPlatformConfigsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >(params.selection); return getClient().platformConfig.findMany(args).unwrap(); } /** * Namespace-backed plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed - * + * * @example * ```ts * await prefetchPlatformConfigsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformConfigsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformConfigSelect>; -}): Promise; -export async function prefetchPlatformConfigsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformConfigsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformConfigSelect>; + } +): Promise; +export async function prefetchPlatformConfigsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformConfigKeys.list(args), - queryFn: () => getClient().platformConfig.findMany(args).unwrap() + queryFn: () => getClient().platformConfig.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformInternalSecretQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformInternalSecretQuery.ts index 420b85d830..baa6ca8639 100644 --- a/sdk/constructive-react/src/config/hooks/queries/usePlatformInternalSecretQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformInternalSecretQuery.ts @@ -4,20 +4,26 @@ * 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 { platformInternalSecretKeys } from "../query-keys"; -import type { PlatformInternalSecretSelect, PlatformInternalSecretWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInternalSecretSelect, PlatformInternalSecretWithRelations } from "../../orm/input-types"; +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 { platformInternalSecretKeys } from '../query-keys'; +import type { + PlatformInternalSecretSelect, + PlatformInternalSecretWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInternalSecretSelect, + PlatformInternalSecretWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInternalSecretQueryKey = platformInternalSecretKeys.detail; /** * Query hook for fetching a single PlatformInternalSecret - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInternalSecretQuery({ @@ -26,38 +32,52 @@ export const platformInternalSecretQueryKey = platformInternalSecretKeys.detail; * }); * ``` */ -export function usePlatformInternalSecretQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInternalSecretSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInternalSecretQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInternalSecretQuery< + S extends PlatformInternalSecretSelect, + TData = { + platformInternalSecret: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInternalSecretSelect>; + } & Omit< + UseQueryOptions< + { + platformInternalSecret: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInternalSecretQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInternalSecretKeys.detail(params.id), - queryFn: () => getClient().platformInternalSecret.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInternalSecret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single PlatformInternalSecret without React hooks - * + * * @example * ```ts * const data = await fetchPlatformInternalSecretQuery({ @@ -66,7 +86,9 @@ export function usePlatformInternalSecretQuery(params: { * }); * ``` */ -export async function fetchPlatformInternalSecretQuery(params: { +export async function fetchPlatformInternalSecretQuery< + S extends PlatformInternalSecretSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPlatformInternalSecretQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInternalSecret.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInternalSecret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single PlatformInternalSecret for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformInternalSecretQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInternalSecretQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInternalSecretSelect>; -}): Promise; -export async function prefetchPlatformInternalSecretQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInternalSecretQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInternalSecretSelect>; + } +): Promise; +export async function prefetchPlatformInternalSecretQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInternalSecretKeys.detail(params.id), - queryFn: () => getClient().platformInternalSecret.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInternalSecret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformInternalSecretsQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformInternalSecretsQuery.ts index 78ece4029a..aadb0a8e7f 100644 --- a/sdk/constructive-react/src/config/hooks/queries/usePlatformInternalSecretsQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformInternalSecretsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInternalSecretKeys } from "../query-keys"; -import type { PlatformInternalSecretSelect, PlatformInternalSecretWithRelations, PlatformInternalSecretFilter, PlatformInternalSecretOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInternalSecretSelect, PlatformInternalSecretWithRelations, PlatformInternalSecretFilter, PlatformInternalSecretOrderBy } from "../../orm/input-types"; +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 { platformInternalSecretKeys } from '../query-keys'; +import type { + PlatformInternalSecretSelect, + PlatformInternalSecretWithRelations, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInternalSecretSelect, + PlatformInternalSecretWithRelations, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInternalSecretsQueryKey = platformInternalSecretKeys.list; /** * Query hook for fetching PlatformInternalSecret list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInternalSecretsQuery({ @@ -30,33 +45,60 @@ export const platformInternalSecretsQueryKey = platformInternalSecretKeys.list; * }); * ``` */ -export function usePlatformInternalSecretsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInternalSecretSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInternalSecretsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInternalSecretsQuery< + S extends PlatformInternalSecretSelect, + TData = { + platformInternalSecrets: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInternalSecretSelect>; + } & Omit< + UseQueryOptions< + { + platformInternalSecrets: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInternalSecretsQuery( + params: { + selection: ListSelectionConfig< + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInternalSecretKeys.list(args), queryFn: () => getClient().platformInternalSecret.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformInternalSecret list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformInternalSecretsQuery({ @@ -67,38 +109,72 @@ export function usePlatformInternalSecretsQuery(params: { * }); * ``` */ -export async function fetchPlatformInternalSecretsQuery(params: { +export async function fetchPlatformInternalSecretsQuery< + S extends PlatformInternalSecretSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInternalSecretSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInternalSecretSelect>; }): Promise<{ - platformInternalSecrets: ConnectionResult>; + platformInternalSecrets: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformInternalSecretsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy + >(params.selection); return getClient().platformInternalSecret.findMany(args).unwrap(); } /** * Prefetch PlatformInternalSecret list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformInternalSecretsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInternalSecretsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInternalSecretSelect>; -}): Promise; -export async function prefetchPlatformInternalSecretsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInternalSecretsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInternalSecretSelect>; + } +): Promise; +export async function prefetchPlatformInternalSecretsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInternalSecretKeys.list(args), - queryFn: () => getClient().platformInternalSecret.findMany(args).unwrap() + queryFn: () => getClient().platformInternalSecret.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformSecretQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformSecretQuery.ts index 73722921d9..fc155b2d11 100644 --- a/sdk/constructive-react/src/config/hooks/queries/usePlatformSecretQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformSecretQuery.ts @@ -4,20 +4,20 @@ * 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 { platformSecretKeys } from "../query-keys"; -import type { PlatformSecretSelect, PlatformSecretWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSecretSelect, PlatformSecretWithRelations } from "../../orm/input-types"; +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 { platformSecretKeys } from '../query-keys'; +import type { PlatformSecretSelect, PlatformSecretWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformSecretSelect, PlatformSecretWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSecretQueryKey = platformSecretKeys.detail; /** * Query hook for fetching a single PlatformSecret - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSecretQuery({ @@ -26,38 +26,52 @@ export const platformSecretQueryKey = platformSecretKeys.detail; * }); * ``` */ -export function usePlatformSecretQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSecretSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSecretQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformSecretQuery< + S extends PlatformSecretSelect, + TData = { + platformSecret: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSecretSelect>; + } & Omit< + UseQueryOptions< + { + platformSecret: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSecretQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSecretKeys.detail(params.id), - queryFn: () => getClient().platformSecret.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformSecret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single PlatformSecret without React hooks - * + * * @example * ```ts * const data = await fetchPlatformSecretQuery({ @@ -79,35 +93,46 @@ export async function fetchPlatformSecretQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformSecret.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformSecret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single PlatformSecret for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformSecretQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformSecretQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformSecretSelect>; -}): Promise; -export async function prefetchPlatformSecretQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformSecretQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformSecretSelect>; + } +): Promise; +export async function prefetchPlatformSecretQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformSecretKeys.detail(params.id), - queryFn: () => getClient().platformSecret.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformSecret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformSecretsQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformSecretsQuery.ts index f181084ce6..5067651884 100644 --- a/sdk/constructive-react/src/config/hooks/queries/usePlatformSecretsQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformSecretsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformSecretKeys } from "../query-keys"; -import type { PlatformSecretSelect, PlatformSecretWithRelations, PlatformSecretFilter, PlatformSecretOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformSecretSelect, PlatformSecretWithRelations, PlatformSecretFilter, PlatformSecretOrderBy } from "../../orm/input-types"; +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 { platformSecretKeys } from '../query-keys'; +import type { + PlatformSecretSelect, + PlatformSecretWithRelations, + PlatformSecretFilter, + PlatformSecretOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformSecretSelect, + PlatformSecretWithRelations, + PlatformSecretFilter, + PlatformSecretOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformSecretsQueryKey = platformSecretKeys.list; /** * Query hook for fetching PlatformSecret list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformSecretsQuery({ @@ -30,33 +45,53 @@ export const platformSecretsQueryKey = platformSecretKeys.list; * }); * ``` */ -export function usePlatformSecretsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSecretSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformSecretsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformSecretsQuery< + S extends PlatformSecretSelect, + TData = { + platformSecrets: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSecretSelect>; + } & Omit< + UseQueryOptions< + { + platformSecrets: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformSecretsQuery( + params: { + selection: ListSelectionConfig< + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformSecretKeys.list(args), queryFn: () => getClient().platformSecret.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformSecret list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformSecretsQuery({ @@ -70,35 +105,55 @@ export function usePlatformSecretsQuery(params: { export async function fetchPlatformSecretsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSecretSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSecretSelect>; }): Promise<{ platformSecrets: ConnectionResult>; }>; export async function fetchPlatformSecretsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy + >(params.selection); return getClient().platformSecret.findMany(args).unwrap(); } /** * Prefetch PlatformSecret list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformSecretsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformSecretsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformSecretSelect>; -}): Promise; -export async function prefetchPlatformSecretsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformSecretsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformSecretSelect>; + } +): Promise; +export async function prefetchPlatformSecretsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformSecretKeys.list(args), - queryFn: () => getClient().platformSecret.findMany(args).unwrap() + queryFn: () => getClient().platformSecret.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/useSecretQuery.ts b/sdk/constructive-react/src/config/hooks/queries/useSecretQuery.ts index 2691975cd1..a0908d3dbd 100644 --- a/sdk/constructive-react/src/config/hooks/queries/useSecretQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/useSecretQuery.ts @@ -4,20 +4,20 @@ * 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 { secretKeys } from "../query-keys"; -import type { SecretSelect, SecretWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SecretSelect, SecretWithRelations } from "../../orm/input-types"; +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 { secretKeys } from '../query-keys'; +import type { SecretSelect, SecretWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SecretSelect, SecretWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const secretQueryKey = secretKeys.detail; /** * Query hook for fetching a single Secret - * + * * @example * ```tsx * const { data, isLoading } = useSecretQuery({ @@ -26,38 +26,52 @@ export const secretQueryKey = secretKeys.detail; * }); * ``` */ -export function useSecretQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SecretSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSecretQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSecretQuery< + S extends SecretSelect, + TData = { + secret: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SecretSelect>; + } & Omit< + UseQueryOptions< + { + secret: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSecretQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: secretKeys.detail(params.id), - queryFn: () => getClient().secret.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .secret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single Secret without React hooks - * + * * @example * ```ts * const data = await fetchSecretQuery({ @@ -79,35 +93,46 @@ export async function fetchSecretQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().secret.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .secret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single Secret for SSR or cache warming - * + * * @example * ```ts * await prefetchSecretQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSecretQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SecretSelect>; -}): Promise; -export async function prefetchSecretQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSecretQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SecretSelect>; + } +): Promise; +export async function prefetchSecretQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: secretKeys.detail(params.id), - queryFn: () => getClient().secret.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .secret.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/queries/useSecretsQuery.ts b/sdk/constructive-react/src/config/hooks/queries/useSecretsQuery.ts index 059492de54..07dc64027b 100644 --- a/sdk/constructive-react/src/config/hooks/queries/useSecretsQuery.ts +++ b/sdk/constructive-react/src/config/hooks/queries/useSecretsQuery.ts @@ -4,20 +4,35 @@ * 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 { secretKeys } from "../query-keys"; -import type { SecretSelect, SecretWithRelations, SecretFilter, SecretOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SecretSelect, SecretWithRelations, SecretFilter, SecretOrderBy } from "../../orm/input-types"; +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 { secretKeys } from '../query-keys'; +import type { + SecretSelect, + SecretWithRelations, + SecretFilter, + SecretOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SecretSelect, + SecretWithRelations, + SecretFilter, + SecretOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const secretsQueryKey = secretKeys.list; /** * Query hook for fetching Secret list - * + * * @example * ```tsx * const { data, isLoading } = useSecretsQuery({ @@ -30,33 +45,45 @@ export const secretsQueryKey = secretKeys.list; * }); * ``` */ -export function useSecretsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SecretSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSecretsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSecretsQuery< + S extends SecretSelect, + TData = { + secrets: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SecretSelect>; + } & Omit< + UseQueryOptions< + { + secrets: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSecretsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: secretKeys.list(args), queryFn: () => getClient().secret.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch Secret list without React hooks - * + * * @example * ```ts * const data = await fetchSecretsQuery({ @@ -70,7 +97,8 @@ export function useSecretsQuery(params: { export async function fetchSecretsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SecretSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SecretSelect>; }): Promise<{ secrets: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchSecretsQuery(params: { } /** * Prefetch Secret list for SSR or cache warming - * + * * @example * ```ts * await prefetchSecretsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSecretsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SecretSelect>; -}): Promise; -export async function prefetchSecretsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchSecretsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SecretSelect>; + } +): Promise; +export async function prefetchSecretsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: secretKeys.list(args), - queryFn: () => getClient().secret.findMany(args).unwrap() + queryFn: () => getClient().secret.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/config/hooks/query-keys.ts b/sdk/constructive-react/src/config/hooks/query-keys.ts index 21e98e63e6..6b1837d13a 100644 --- a/sdk/constructive-react/src/config/hooks/query-keys.ts +++ b/sdk/constructive-react/src/config/hooks/query-keys.ts @@ -20,39 +20,49 @@ // ============================================================================ export const configKeys = { - /** All config queries */all: ["config"] as const, - /** List query keys */lists: () => [...configKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...configKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...configKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...configKeys.details(), id] as const + /** All config queries */ all: ['config'] as const, + /** List query keys */ lists: () => [...configKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...configKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...configKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...configKeys.details(), id] as const, } as const; export const platformConfigKeys = { - /** All platformConfig queries */all: ["platformconfig"] as const, - /** List query keys */lists: () => [...platformConfigKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformConfigKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformConfigKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformConfigKeys.details(), id] as const + /** All platformConfig queries */ all: ['platformconfig'] as const, + /** List query keys */ lists: () => [...platformConfigKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformConfigKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformConfigKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformConfigKeys.details(), id] as const, } as const; export const platformInternalSecretKeys = { - /** All platformInternalSecret queries */all: ["platforminternalsecret"] as const, - /** List query keys */lists: () => [...platformInternalSecretKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInternalSecretKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInternalSecretKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInternalSecretKeys.details(), id] as const + /** All platformInternalSecret queries */ all: ['platforminternalsecret'] as const, + /** List query keys */ lists: () => [...platformInternalSecretKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInternalSecretKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInternalSecretKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInternalSecretKeys.details(), id] as const, } as const; export const platformSecretKeys = { - /** All platformSecret queries */all: ["platformsecret"] as const, - /** List query keys */lists: () => [...platformSecretKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformSecretKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformSecretKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformSecretKeys.details(), id] as const + /** All platformSecret queries */ all: ['platformsecret'] as const, + /** List query keys */ lists: () => [...platformSecretKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformSecretKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformSecretKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformSecretKeys.details(), id] as const, } as const; export const secretKeys = { - /** All secret queries */all: ["secret"] as const, - /** List query keys */lists: () => [...secretKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...secretKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...secretKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...secretKeys.details(), id] as const + /** All secret queries */ all: ['secret'] as const, + /** List query keys */ lists: () => [...secretKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...secretKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...secretKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...secretKeys.details(), id] as const, } as const; /** @@ -81,7 +91,7 @@ export const queryKeys = { platformConfig: platformConfigKeys, platformInternalSecret: platformInternalSecretKeys, platformSecret: platformSecretKeys, - secret: secretKeys + secret: secretKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/config/hooks/selection.ts b/sdk/constructive-react/src/config/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/config/hooks/selection.ts +++ b/sdk/constructive-react/src/config/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/config/index.ts b/sdk/constructive-react/src/config/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/config/index.ts +++ b/sdk/constructive-react/src/config/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/config/orm/client.ts b/sdk/constructive-react/src/config/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/config/orm/client.ts +++ b/sdk/constructive-react/src/config/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/config/orm/index.ts b/sdk/constructive-react/src/config/orm/index.ts index fc3b40f037..bf16135b3c 100644 --- a/sdk/constructive-react/src/config/orm/index.ts +++ b/sdk/constructive-react/src/config/orm/index.ts @@ -3,20 +3,20 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { ConfigModel } from "./models/config"; -import { PlatformConfigModel } from "./models/platformConfig"; -import { PlatformInternalSecretModel } from "./models/platformInternalSecret"; -import { PlatformSecretModel } from "./models/platformSecret"; -import { SecretModel } from "./models/secret"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { ConfigModel } from './models/config'; +import { PlatformConfigModel } from './models/platformConfig'; +import { PlatformInternalSecretModel } from './models/platformInternalSecret'; +import { PlatformSecretModel } from './models/platformSecret'; +import { SecretModel } from './models/secret'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -48,6 +48,6 @@ export function createClient(config: OrmClientConfig) { platformInternalSecret: new PlatformInternalSecretModel(client), platformSecret: new PlatformSecretModel(client), secret: new SecretModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/orm/input-types.ts b/sdk/constructive-react/src/config/orm/input-types.ts index 2a682fe678..110c75415d 100644 --- a/sdk/constructive-react/src/config/orm/input-types.ts +++ b/sdk/constructive-react/src/config/orm/input-types.ts @@ -339,7 +339,8 @@ export interface SecretRelations {} // ============ Entity Types With Relations ============ export type ConfigWithRelations = Config & ConfigRelations; export type PlatformConfigWithRelations = PlatformConfig & PlatformConfigRelations; -export type PlatformInternalSecretWithRelations = PlatformInternalSecret & PlatformInternalSecretRelations; +export type PlatformInternalSecretWithRelations = PlatformInternalSecret & + PlatformInternalSecretRelations; export type PlatformSecretWithRelations = PlatformSecret & PlatformSecretRelations; export type SecretWithRelations = Secret & SecretRelations; // ============ Entity Select Types ============ @@ -563,11 +564,132 @@ export interface SecretFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type ConfigOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALUE_ASC" | "VALUE_DESC"; -export type PlatformConfigOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALUE_ASC" | "VALUE_DESC"; -export type PlatformInternalSecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PROVIDER_ASC" | "PROVIDER_DESC" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PROVIDER_ASC" | "PROVIDER_DESC" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type ConfigOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC'; +export type PlatformConfigOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC'; +export type PlatformInternalSecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateConfigInput { clientMutationId?: string; @@ -1089,4 +1211,4 @@ export type PlatformConfigEdgeSelect = { node?: { select: PlatformConfigSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/config/orm/models/config.ts b/sdk/constructive-react/src/config/orm/models/config.ts index f7c80edfb1..cef2950915 100644 --- a/sdk/constructive-react/src/config/orm/models/config.ts +++ b/sdk/constructive-react/src/config/orm/models/config.ts @@ -3,56 +3,96 @@ * @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 { Config, ConfigWithRelations, ConfigSelect, ConfigFilter, ConfigOrderBy, CreateConfigInput, UpdateConfigInput, ConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Config, + ConfigWithRelations, + ConfigSelect, + ConfigFilter, + ConfigOrderBy, + CreateConfigInput, + UpdateConfigInput, + ConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ configs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Config", "configs", 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 - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Config', + 'configs', + 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, + }, + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "configs", + operation: 'query', + operationName: 'Config', + fieldName: 'configs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ config: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Config", "configs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Config', + 'configs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "config", + operation: 'query', + operationName: 'Config', + fieldName: 'config', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "config": data.configs?.nodes?.[0] ?? null - }) + config: data.configs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ config: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Config", "configs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Config', + 'configs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "config", + operation: 'query', + operationName: 'Config', + fieldName: 'config', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "config": data.configs?.nodes?.[0] ?? null - }) + config: data.configs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Config", "createConfig", "config", args.select, args.data, "CreateConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Config', + 'createConfig', + 'config', + args.select, + args.data, + 'CreateConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "createConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'createConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Config", "updateConfig", "config", args.select, args.where.id, args.data, "UpdateConfigInput", "id", "configPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Config', + 'updateConfig', + 'config', + args.select, + args.where.id, + args.data, + 'UpdateConfigInput', + 'id', + 'configPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "updateConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'updateConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Config", "deleteConfig", "config", { - id: args.where.id - }, "DeleteConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Config', + 'deleteConfig', + 'config', + { + id: args.where.id, + }, + 'DeleteConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "deleteConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'deleteConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/orm/models/index.ts b/sdk/constructive-react/src/config/orm/models/index.ts index 5bca8e3b99..0823cce0ad 100644 --- a/sdk/constructive-react/src/config/orm/models/index.ts +++ b/sdk/constructive-react/src/config/orm/models/index.ts @@ -3,8 +3,8 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { ConfigModel } from "./config"; -export { PlatformConfigModel } from "./platformConfig"; -export { PlatformInternalSecretModel } from "./platformInternalSecret"; -export { PlatformSecretModel } from "./platformSecret"; -export { SecretModel } from "./secret"; \ No newline at end of file +export { ConfigModel } from './config'; +export { PlatformConfigModel } from './platformConfig'; +export { PlatformInternalSecretModel } from './platformInternalSecret'; +export { PlatformSecretModel } from './platformSecret'; +export { SecretModel } from './secret'; diff --git a/sdk/constructive-react/src/config/orm/models/platformConfig.ts b/sdk/constructive-react/src/config/orm/models/platformConfig.ts index bf62b0821c..43634e7a80 100644 --- a/sdk/constructive-react/src/config/orm/models/platformConfig.ts +++ b/sdk/constructive-react/src/config/orm/models/platformConfig.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { PlatformConfig, PlatformConfigWithRelations, PlatformConfigSelect, PlatformConfigFilter, PlatformConfigOrderBy, CreatePlatformConfigInput, UpdatePlatformConfigInput, PlatformConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfig, + PlatformConfigWithRelations, + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy, + CreatePlatformConfigInput, + UpdatePlatformConfigInput, + PlatformConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfigs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformConfig", "platformConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfigs", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfigs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformConfig", "platformConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfig", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformConfig": data.platformConfigs?.nodes?.[0] ?? null - }) + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformConfig", "platformConfigs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfig", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformConfig": data.platformConfigs?.nodes?.[0] ?? null - }) + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformConfig", "createPlatformConfig", "platformConfig", args.select, args.data, "CreatePlatformConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformConfig', + 'createPlatformConfig', + 'platformConfig', + args.select, + args.data, + 'CreatePlatformConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "createPlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'createPlatformConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformConfig", "updatePlatformConfig", "platformConfig", args.select, args.where.id, args.data, "UpdatePlatformConfigInput", "id", "platformConfigPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfig', + 'updatePlatformConfig', + 'platformConfig', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigInput', + 'id', + 'platformConfigPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "updatePlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'updatePlatformConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformConfig", "deletePlatformConfig", "platformConfig", { - id: args.where.id - }, "DeletePlatformConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfig', + 'deletePlatformConfig', + 'platformConfig', + { + id: args.where.id, + }, + 'DeletePlatformConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "deletePlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'deletePlatformConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/orm/models/platformInternalSecret.ts b/sdk/constructive-react/src/config/orm/models/platformInternalSecret.ts index 1e09df35f4..35e0c7b538 100644 --- a/sdk/constructive-react/src/config/orm/models/platformInternalSecret.ts +++ b/sdk/constructive-react/src/config/orm/models/platformInternalSecret.ts @@ -3,56 +3,98 @@ * @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 { PlatformInternalSecret, PlatformInternalSecretWithRelations, PlatformInternalSecretSelect, PlatformInternalSecretFilter, PlatformInternalSecretOrderBy, CreatePlatformInternalSecretInput, UpdatePlatformInternalSecretInput, PlatformInternalSecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInternalSecret, + PlatformInternalSecretWithRelations, + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy, + CreatePlatformInternalSecretInput, + UpdatePlatformInternalSecretInput, + PlatformInternalSecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInternalSecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInternalSecrets: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInternalSecrets: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInternalSecret", "platformInternalSecrets", 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 - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + 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, + }, + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecrets", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInternalSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInternalSecret", "platformInternalSecrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecret", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecret', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformInternalSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInternalSecret": data.platformInternalSecrets?.nodes?.[0] ?? null - }) + platformInternalSecret: data.platformInternalSecrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInternalSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInternalSecret", "platformInternalSecrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecret", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecret', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PlatformInternalSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInternalSecret": data.platformInternalSecrets?.nodes?.[0] ?? null - }) + platformInternalSecret: data.platformInternalSecrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInternalSecret: { platformInternalSecret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInternalSecret", "createPlatformInternalSecret", "platformInternalSecret", args.select, args.data, "CreatePlatformInternalSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInternalSecret', + 'createPlatformInternalSecret', + 'platformInternalSecret', + args.select, + args.data, + 'CreatePlatformInternalSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInternalSecret", - fieldName: "createPlatformInternalSecret", + operation: 'mutation', + operationName: 'PlatformInternalSecret', + fieldName: 'createPlatformInternalSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/orm/models/platformSecret.ts b/sdk/constructive-react/src/config/orm/models/platformSecret.ts index 366da27bfe..03c0e23540 100644 --- a/sdk/constructive-react/src/config/orm/models/platformSecret.ts +++ b/sdk/constructive-react/src/config/orm/models/platformSecret.ts @@ -3,56 +3,96 @@ * @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 { PlatformSecret, PlatformSecretWithRelations, PlatformSecretSelect, PlatformSecretFilter, PlatformSecretOrderBy, CreatePlatformSecretInput, UpdatePlatformSecretInput, PlatformSecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSecret, + PlatformSecretWithRelations, + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy, + CreatePlatformSecretInput, + UpdatePlatformSecretInput, + PlatformSecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecrets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSecret", "platformSecrets", 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 - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSecret', + 'platformSecrets', + 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, + }, + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecrets", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSecret", "platformSecrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSecret', + 'platformSecrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecret", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecret', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSecret": data.platformSecrets?.nodes?.[0] ?? null - }) + platformSecret: data.platformSecrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSecret", "platformSecrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSecret', + 'platformSecrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecret", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecret', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class PlatformSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSecret": data.platformSecrets?.nodes?.[0] ?? null - }) + platformSecret: data.platformSecrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSecret: { platformSecret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSecret", "createPlatformSecret", "platformSecret", args.select, args.data, "CreatePlatformSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSecret', + 'createPlatformSecret', + 'platformSecret', + args.select, + args.data, + 'CreatePlatformSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSecret", - fieldName: "createPlatformSecret", + operation: 'mutation', + operationName: 'PlatformSecret', + fieldName: 'createPlatformSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/orm/models/secret.ts b/sdk/constructive-react/src/config/orm/models/secret.ts index af9f11b5ae..37571240d8 100644 --- a/sdk/constructive-react/src/config/orm/models/secret.ts +++ b/sdk/constructive-react/src/config/orm/models/secret.ts @@ -3,56 +3,96 @@ * @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 { Secret, SecretWithRelations, SecretSelect, SecretFilter, SecretOrderBy, CreateSecretInput, UpdateSecretInput, SecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Secret, + SecretWithRelations, + SecretSelect, + SecretFilter, + SecretOrderBy, + CreateSecretInput, + UpdateSecretInput, + SecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secrets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Secret", "secrets", 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 - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Secret', + 'secrets', + 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, + }, + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secrets", + operation: 'query', + operationName: 'Secret', + fieldName: 'secrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Secret", "secrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Secret', + 'secrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secret", + operation: 'query', + operationName: 'Secret', + fieldName: 'secret', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "secret": data.secrets?.nodes?.[0] ?? null - }) + secret: data.secrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ secret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Secret", "secrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Secret', + 'secrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secret", + operation: 'query', + operationName: 'Secret', + fieldName: 'secret', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class SecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "secret": data.secrets?.nodes?.[0] ?? null - }) + secret: data.secrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSecret: { secret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Secret", "createSecret", "secret", args.select, args.data, "CreateSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Secret', + 'createSecret', + 'secret', + args.select, + args.data, + 'CreateSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Secret", - fieldName: "createSecret", + operation: 'mutation', + operationName: 'Secret', + fieldName: 'createSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/orm/mutation/index.ts b/sdk/constructive-react/src/config/orm/mutation/index.ts index 8d24d8f7a0..13353608c7 100644 --- a/sdk/constructive-react/src/config/orm/mutation/index.ts +++ b/sdk/constructive-react/src/config/orm/mutation/index.ts @@ -3,11 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { _SecretsDelInput, _SecretsRemoveArrayInput, _SecretsRotateInput, _SecretsSetInput, PlatformInternalSecretsDelInput, PlatformInternalSecretsRemoveArrayInput, PlatformInternalSecretsRotateInput, PlatformInternalSecretsSetInput, PlatformSecretsDelInput, PlatformSecretsRemoveArrayInput, PlatformSecretsRotateInput, PlatformSecretsSetInput, ProvisionBucketInput, _SecretsDelPayload, _SecretsRemoveArrayPayload, _SecretsRotatePayload, _SecretsSetPayload, PlatformInternalSecretsDelPayload, PlatformInternalSecretsRemoveArrayPayload, PlatformInternalSecretsRotatePayload, PlatformInternalSecretsSetPayload, PlatformSecretsDelPayload, PlatformSecretsRemoveArrayPayload, PlatformSecretsRotatePayload, PlatformSecretsSetPayload, ProvisionBucketPayload, _SecretsDelPayloadSelect, _SecretsRemoveArrayPayloadSelect, _SecretsRotatePayloadSelect, _SecretsSetPayloadSelect, PlatformInternalSecretsDelPayloadSelect, PlatformInternalSecretsRemoveArrayPayloadSelect, PlatformInternalSecretsRotatePayloadSelect, PlatformInternalSecretsSetPayloadSelect, PlatformSecretsDelPayloadSelect, PlatformSecretsRemoveArrayPayloadSelect, PlatformSecretsRotatePayloadSelect, PlatformSecretsSetPayloadSelect, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + _SecretsDelInput, + _SecretsRemoveArrayInput, + _SecretsRotateInput, + _SecretsSetInput, + PlatformInternalSecretsDelInput, + PlatformInternalSecretsRemoveArrayInput, + PlatformInternalSecretsRotateInput, + PlatformInternalSecretsSetInput, + PlatformSecretsDelInput, + PlatformSecretsRemoveArrayInput, + PlatformSecretsRotateInput, + PlatformSecretsSetInput, + ProvisionBucketInput, + _SecretsDelPayload, + _SecretsRemoveArrayPayload, + _SecretsRotatePayload, + _SecretsSetPayload, + PlatformInternalSecretsDelPayload, + PlatformInternalSecretsRemoveArrayPayload, + PlatformInternalSecretsRotatePayload, + PlatformInternalSecretsSetPayload, + PlatformSecretsDelPayload, + PlatformSecretsRemoveArrayPayload, + PlatformSecretsRotatePayload, + PlatformSecretsSetPayload, + ProvisionBucketPayload, + _SecretsDelPayloadSelect, + _SecretsRemoveArrayPayloadSelect, + _SecretsRotatePayloadSelect, + _SecretsSetPayloadSelect, + PlatformInternalSecretsDelPayloadSelect, + PlatformInternalSecretsRemoveArrayPayloadSelect, + PlatformInternalSecretsRotatePayloadSelect, + PlatformInternalSecretsSetPayloadSelect, + PlatformSecretsDelPayloadSelect, + PlatformSecretsRemoveArrayPayloadSelect, + PlatformSecretsRotatePayloadSelect, + PlatformSecretsSetPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface _secretsDelVariables { input: _SecretsDelInput; } @@ -56,187 +96,388 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - _secretsDel: (args: _secretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsDel", - fieldName: "_secretsDel", - ...buildCustomDocument("mutation", "_secretsDel", "_secretsDel", options.select, args, [{ - name: "input", - type: "_SecretsDelInput!" - }], connectionFieldsMap, "_SecretsDelPayload") - }), - _secretsRemoveArray: (args: _secretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsRemoveArray", - fieldName: "_secretsRemoveArray", - ...buildCustomDocument("mutation", "_secretsRemoveArray", "_secretsRemoveArray", options.select, args, [{ - name: "input", - type: "_SecretsRemoveArrayInput!" - }], connectionFieldsMap, "_SecretsRemoveArrayPayload") - }), - _secretsRotate: (args: _secretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsRotate", - fieldName: "_secretsRotate", - ...buildCustomDocument("mutation", "_secretsRotate", "_secretsRotate", options.select, args, [{ - name: "input", - type: "_SecretsRotateInput!" - }], connectionFieldsMap, "_SecretsRotatePayload") - }), - _secretsSet: (args: _secretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsSet", - fieldName: "_secretsSet", - ...buildCustomDocument("mutation", "_secretsSet", "_secretsSet", options.select, args, [{ - name: "input", - type: "_SecretsSetInput!" - }], connectionFieldsMap, "_SecretsSetPayload") - }), - platformInternalSecretsDel: (args: PlatformInternalSecretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsDel: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsDel", - fieldName: "platformInternalSecretsDel", - ...buildCustomDocument("mutation", "PlatformInternalSecretsDel", "platformInternalSecretsDel", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsDelInput!" - }], connectionFieldsMap, "PlatformInternalSecretsDelPayload") - }), - platformInternalSecretsRemoveArray: (args: PlatformInternalSecretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsRemoveArray: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsRemoveArray", - fieldName: "platformInternalSecretsRemoveArray", - ...buildCustomDocument("mutation", "PlatformInternalSecretsRemoveArray", "platformInternalSecretsRemoveArray", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsRemoveArrayInput!" - }], connectionFieldsMap, "PlatformInternalSecretsRemoveArrayPayload") - }), - platformInternalSecretsRotate: (args: PlatformInternalSecretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsRotate: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsRotate", - fieldName: "platformInternalSecretsRotate", - ...buildCustomDocument("mutation", "PlatformInternalSecretsRotate", "platformInternalSecretsRotate", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsRotateInput!" - }], connectionFieldsMap, "PlatformInternalSecretsRotatePayload") - }), - platformInternalSecretsSet: (args: PlatformInternalSecretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsSet: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsSet", - fieldName: "platformInternalSecretsSet", - ...buildCustomDocument("mutation", "PlatformInternalSecretsSet", "platformInternalSecretsSet", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsSetInput!" - }], connectionFieldsMap, "PlatformInternalSecretsSetPayload") - }), - platformSecretsDel: (args: PlatformSecretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsDel: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsDel", - fieldName: "platformSecretsDel", - ...buildCustomDocument("mutation", "PlatformSecretsDel", "platformSecretsDel", options.select, args, [{ - name: "input", - type: "PlatformSecretsDelInput!" - }], connectionFieldsMap, "PlatformSecretsDelPayload") - }), - platformSecretsRemoveArray: (args: PlatformSecretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsRemoveArray: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsRemoveArray", - fieldName: "platformSecretsRemoveArray", - ...buildCustomDocument("mutation", "PlatformSecretsRemoveArray", "platformSecretsRemoveArray", options.select, args, [{ - name: "input", - type: "PlatformSecretsRemoveArrayInput!" - }], connectionFieldsMap, "PlatformSecretsRemoveArrayPayload") - }), - platformSecretsRotate: (args: PlatformSecretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsRotate: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsRotate", - fieldName: "platformSecretsRotate", - ...buildCustomDocument("mutation", "PlatformSecretsRotate", "platformSecretsRotate", options.select, args, [{ - name: "input", - type: "PlatformSecretsRotateInput!" - }], connectionFieldsMap, "PlatformSecretsRotatePayload") - }), - platformSecretsSet: (args: PlatformSecretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsSet: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsSet", - fieldName: "platformSecretsSet", - ...buildCustomDocument("mutation", "PlatformSecretsSet", "platformSecretsSet", options.select, args, [{ - name: "input", - type: "PlatformSecretsSetInput!" - }], connectionFieldsMap, "PlatformSecretsSetPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + _secretsDel: ( + args: _secretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsDel', + fieldName: '_secretsDel', + ...buildCustomDocument( + 'mutation', + '_secretsDel', + '_secretsDel', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsDelInput!', + }, + ], + connectionFieldsMap, + '_SecretsDelPayload' + ), + }), + _secretsRemoveArray: ( + args: _secretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsRemoveArray', + fieldName: '_secretsRemoveArray', + ...buildCustomDocument( + 'mutation', + '_secretsRemoveArray', + '_secretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + '_SecretsRemoveArrayPayload' + ), + }), + _secretsRotate: ( + args: _secretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsRotate', + fieldName: '_secretsRotate', + ...buildCustomDocument( + 'mutation', + '_secretsRotate', + '_secretsRotate', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsRotateInput!', + }, + ], + connectionFieldsMap, + '_SecretsRotatePayload' + ), + }), + _secretsSet: ( + args: _secretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsSet', + fieldName: '_secretsSet', + ...buildCustomDocument( + 'mutation', + '_secretsSet', + '_secretsSet', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsSetInput!', + }, + ], + connectionFieldsMap, + '_SecretsSetPayload' + ), + }), + platformInternalSecretsDel: ( + args: PlatformInternalSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsDel', + fieldName: 'platformInternalSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsDel', + 'platformInternalSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsDelPayload' + ), + }), + platformInternalSecretsRemoveArray: ( + args: PlatformInternalSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsRemoveArray: InferSelectResult< + PlatformInternalSecretsRemoveArrayPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsRemoveArray', + fieldName: 'platformInternalSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsRemoveArray', + 'platformInternalSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsRemoveArrayPayload' + ), + }), + platformInternalSecretsRotate: ( + args: PlatformInternalSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsRotate: InferSelectResult< + PlatformInternalSecretsRotatePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsRotate', + fieldName: 'platformInternalSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsRotate', + 'platformInternalSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsRotatePayload' + ), + }), + platformInternalSecretsSet: ( + args: PlatformInternalSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsSet', + fieldName: 'platformInternalSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsSet', + 'platformInternalSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsSetPayload' + ), + }), + platformSecretsDel: ( + args: PlatformSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsDel', + fieldName: 'platformSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsDel', + 'platformSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsDelPayload' + ), + }), + platformSecretsRemoveArray: ( + args: PlatformSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRemoveArray', + fieldName: 'platformSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRemoveArray', + 'platformSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRemoveArrayPayload' + ), + }), + platformSecretsRotate: ( + args: PlatformSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRotate', + fieldName: 'platformSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRotate', + 'platformSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRotatePayload' + ), + }), + platformSecretsSet: ( + args: PlatformSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsSet', + fieldName: 'platformSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsSet', + 'platformSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsSetPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/orm/query-builder.ts b/sdk/constructive-react/src/config/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/config/orm/query-builder.ts +++ b/sdk/constructive-react/src/config/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/config/orm/realtime.ts b/sdk/constructive-react/src/config/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/config/orm/realtime.ts +++ b/sdk/constructive-react/src/config/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/config/orm/select-types.ts b/sdk/constructive-react/src/config/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/config/orm/select-types.ts +++ b/sdk/constructive-react/src/config/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/config/schema-types.ts b/sdk/constructive-react/src/config/schema-types.ts index a670b8a06f..5fca79c52f 100644 --- a/sdk/constructive-react/src/config/schema-types.ts +++ b/sdk/constructive-react/src/config/schema-types.ts @@ -4,17 +4,161 @@ * DO NOT EDIT - changes will be overwritten */ -import type { Config, PlatformConfig, PlatformInternalSecret, PlatformSecret, Secret, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + Config, + PlatformConfig, + PlatformInternalSecret, + PlatformSecret, + Secret, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; /** Methods to use when ordering `Config`. */ -export type ConfigOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALUE_ASC" | "VALUE_DESC"; +export type ConfigOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC'; /** Methods to use when ordering `PlatformConfig`. */ -export type PlatformConfigOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALUE_ASC" | "VALUE_DESC"; +export type PlatformConfigOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC'; /** Methods to use when ordering `PlatformInternalSecret`. */ -export type PlatformInternalSecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformInternalSecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformSecret`. */ -export type PlatformSecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PROVIDER_ASC" | "PROVIDER_DESC" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformSecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Secret`. */ -export type SecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PROVIDER_ASC" | "PROVIDER_DESC" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type SecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** A filter to be used against `Config` object types. All fields are combined with a logical ‘and.’ */ export interface ConfigFilter { /** Checks for all expressions in this list. */ @@ -794,4 +938,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/config/types.ts b/sdk/constructive-react/src/config/types.ts index 1b44a5752b..4f21a5070e 100644 --- a/sdk/constructive-react/src/config/types.ts +++ b/sdk/constructive-react/src/config/types.ts @@ -292,4 +292,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/index.ts b/sdk/constructive-react/src/index.ts index 4f492497df..f64a72cd39 100644 --- a/sdk/constructive-react/src/index.ts +++ b/sdk/constructive-react/src/index.ts @@ -1,18 +1,18 @@ /** * @constructive-io/sdk - * + * * Auto-generated GraphQL types and ORM client. * Run `pnpm run generate` to populate this package from the schema files. - * + * * @generated by @constructive-io/graphql-codegen */ -export * as admin from "./admin"; -export * as agent from "./agent"; -export * as api from "./api"; -export * as auth from "./auth"; -export * as compute from "./compute"; -export * as config from "./config"; -export * as infra from "./infra"; -export * as modules from "./modules"; -export * as objects from "./objects"; -export * as usage from "./usage"; \ No newline at end of file +export * as admin from './admin'; +export * as agent from './agent'; +export * as api from './api'; +export * as auth from './auth'; +export * as compute from './compute'; +export * as config from './config'; +export * as infra from './infra'; +export * as modules from './modules'; +export * as objects from './objects'; +export * as usage from './usage'; diff --git a/sdk/constructive-react/src/infra/hooks/client.ts b/sdk/constructive-react/src/infra/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/infra/hooks/client.ts +++ b/sdk/constructive-react/src/infra/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/infra/hooks/index.ts b/sdk/constructive-react/src/infra/hooks/index.ts index aec3f739dc..5dbab6e356 100644 --- a/sdk/constructive-react/src/infra/hooks/index.ts +++ b/sdk/constructive-react/src/infra/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: DbPreset, Namespace, NamespaceEvent, PlatformInfraCommit, PlatformInfraGetAllTreeNodesRecord, PlatformInfraObject, PlatformInfraRef, PlatformInfraStore, PlatformNamespace, PlatformNamespaceEvent - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/infra/hooks/invalidation.ts b/sdk/constructive-react/src/infra/hooks/invalidation.ts index 50fb6152ca..7b49940760 100644 --- a/sdk/constructive-react/src/infra/hooks/invalidation.ts +++ b/sdk/constructive-react/src/infra/hooks/invalidation.ts @@ -13,8 +13,19 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { dbPresetKeys, namespaceKeys, namespaceEventKeys, platformInfraCommitKeys, platformInfraGetAllTreeNodesRecordKeys, platformInfraObjectKeys, platformInfraRefKeys, platformInfraStoreKeys, platformNamespaceKeys, platformNamespaceEventKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + dbPresetKeys, + namespaceKeys, + namespaceEventKeys, + platformInfraCommitKeys, + platformInfraGetAllTreeNodesRecordKeys, + platformInfraObjectKeys, + platformInfraRefKeys, + platformInfraStoreKeys, + platformNamespaceKeys, + platformNamespaceEventKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,116 +46,177 @@ import { dbPresetKeys, namespaceKeys, namespaceEventKeys, platformInfraCommitKey * ``` */ export const invalidate = { - /** Invalidate dbPreset queries */dbPreset: { - /** Invalidate all dbPreset queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPresetKeys.all - }), - /** Invalidate dbPreset list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPresetKeys.lists() - }), - /** Invalidate a specific dbPreset */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: dbPresetKeys.detail(id) - }) - }, - /** Invalidate namespace queries */namespace: { - /** Invalidate all namespace queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceKeys.all - }), - /** Invalidate namespace list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceKeys.lists() - }), - /** Invalidate a specific namespace */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: namespaceKeys.detail(id) - }) - }, - /** Invalidate namespaceEvent queries */namespaceEvent: { - /** Invalidate all namespaceEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.all - }), - /** Invalidate namespaceEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.lists() - }), - /** Invalidate a specific namespaceEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.detail(id) - }) - }, - /** Invalidate platformInfraCommit queries */platformInfraCommit: { - /** Invalidate all platformInfraCommit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.all - }), - /** Invalidate platformInfraCommit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.lists() - }), - /** Invalidate a specific platformInfraCommit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.detail(id) - }) - }, - /** Invalidate platformInfraGetAllTreeNodesRecord queries */platformInfraGetAllTreeNodesRecord: { - /** Invalidate all platformInfraGetAllTreeNodesRecord queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.all - }), - /** Invalidate platformInfraGetAllTreeNodesRecord list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.lists() - }), - /** Invalidate a specific platformInfraGetAllTreeNodesRecord */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.detail(id) - }) - }, - /** Invalidate platformInfraObject queries */platformInfraObject: { - /** Invalidate all platformInfraObject queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.all - }), - /** Invalidate platformInfraObject list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.lists() - }), - /** Invalidate a specific platformInfraObject */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.detail(id) - }) - }, - /** Invalidate platformInfraRef queries */platformInfraRef: { - /** Invalidate all platformInfraRef queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.all - }), - /** Invalidate platformInfraRef list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.lists() - }), - /** Invalidate a specific platformInfraRef */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.detail(id) - }) - }, - /** Invalidate platformInfraStore queries */platformInfraStore: { - /** Invalidate all platformInfraStore queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.all - }), - /** Invalidate platformInfraStore list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.lists() - }), - /** Invalidate a specific platformInfraStore */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.detail(id) - }) - }, - /** Invalidate platformNamespace queries */platformNamespace: { - /** Invalidate all platformNamespace queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.all - }), - /** Invalidate platformNamespace list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.lists() - }), - /** Invalidate a specific platformNamespace */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.detail(id) - }) - }, - /** Invalidate platformNamespaceEvent queries */platformNamespaceEvent: { - /** Invalidate all platformNamespaceEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.all - }), - /** Invalidate platformNamespaceEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.lists() - }), - /** Invalidate a specific platformNamespaceEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.detail(id) - }) - } + /** Invalidate dbPreset queries */ dbPreset: { + /** Invalidate all dbPreset queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPresetKeys.all, + }), + /** Invalidate dbPreset list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPresetKeys.lists(), + }), + /** Invalidate a specific dbPreset */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: dbPresetKeys.detail(id), + }), + }, + /** Invalidate namespace queries */ namespace: { + /** Invalidate all namespace queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceKeys.all, + }), + /** Invalidate namespace list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceKeys.lists(), + }), + /** Invalidate a specific namespace */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: namespaceKeys.detail(id), + }), + }, + /** Invalidate namespaceEvent queries */ namespaceEvent: { + /** Invalidate all namespaceEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceEventKeys.all, + }), + /** Invalidate namespaceEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceEventKeys.lists(), + }), + /** Invalidate a specific namespaceEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: namespaceEventKeys.detail(id), + }), + }, + /** Invalidate platformInfraCommit queries */ platformInfraCommit: { + /** Invalidate all platformInfraCommit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraCommitKeys.all, + }), + /** Invalidate platformInfraCommit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraCommitKeys.lists(), + }), + /** Invalidate a specific platformInfraCommit */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraCommitKeys.detail(id), + }), + }, + /** Invalidate platformInfraGetAllTreeNodesRecord queries */ platformInfraGetAllTreeNodesRecord: { + /** Invalidate all platformInfraGetAllTreeNodesRecord queries */ all: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraGetAllTreeNodesRecordKeys.all, + }), + /** Invalidate platformInfraGetAllTreeNodesRecord list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraGetAllTreeNodesRecordKeys.lists(), + }), + /** Invalidate a specific platformInfraGetAllTreeNodesRecord */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraGetAllTreeNodesRecordKeys.detail(id), + }), + }, + /** Invalidate platformInfraObject queries */ platformInfraObject: { + /** Invalidate all platformInfraObject queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraObjectKeys.all, + }), + /** Invalidate platformInfraObject list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraObjectKeys.lists(), + }), + /** Invalidate a specific platformInfraObject */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraObjectKeys.detail(id), + }), + }, + /** Invalidate platformInfraRef queries */ platformInfraRef: { + /** Invalidate all platformInfraRef queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraRefKeys.all, + }), + /** Invalidate platformInfraRef list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraRefKeys.lists(), + }), + /** Invalidate a specific platformInfraRef */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraRefKeys.detail(id), + }), + }, + /** Invalidate platformInfraStore queries */ platformInfraStore: { + /** Invalidate all platformInfraStore queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraStoreKeys.all, + }), + /** Invalidate platformInfraStore list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformInfraStoreKeys.lists(), + }), + /** Invalidate a specific platformInfraStore */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformInfraStoreKeys.detail(id), + }), + }, + /** Invalidate platformNamespace queries */ platformNamespace: { + /** Invalidate all platformNamespace queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceKeys.all, + }), + /** Invalidate platformNamespace list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceKeys.lists(), + }), + /** Invalidate a specific platformNamespace */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceKeys.detail(id), + }), + }, + /** Invalidate platformNamespaceEvent queries */ platformNamespaceEvent: { + /** Invalidate all platformNamespaceEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceEventKeys.all, + }), + /** Invalidate platformNamespaceEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceEventKeys.lists(), + }), + /** Invalidate a specific platformNamespaceEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformNamespaceEventKeys.detail(id), + }), + }, } as const; /** @@ -158,54 +230,78 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove dbPreset from cache */dbPreset: (queryClient: QueryClient, id: string | number) => { + /** Remove dbPreset from cache */ dbPreset: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: dbPresetKeys.detail(id) + queryKey: dbPresetKeys.detail(id), }); }, - /** Remove namespace from cache */namespace: (queryClient: QueryClient, id: string | number) => { + /** Remove namespace from cache */ namespace: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: namespaceKeys.detail(id) + queryKey: namespaceKeys.detail(id), }); }, - /** Remove namespaceEvent from cache */namespaceEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove namespaceEvent from cache */ namespaceEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: namespaceEventKeys.detail(id) + queryKey: namespaceEventKeys.detail(id), }); }, - /** Remove platformInfraCommit from cache */platformInfraCommit: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraCommit from cache */ platformInfraCommit: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraCommitKeys.detail(id) + queryKey: platformInfraCommitKeys.detail(id), }); }, - /** Remove platformInfraGetAllTreeNodesRecord from cache */platformInfraGetAllTreeNodesRecord: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraGetAllTreeNodesRecord from cache */ platformInfraGetAllTreeNodesRecord: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.detail(id) + queryKey: platformInfraGetAllTreeNodesRecordKeys.detail(id), }); }, - /** Remove platformInfraObject from cache */platformInfraObject: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraObject from cache */ platformInfraObject: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraObjectKeys.detail(id) + queryKey: platformInfraObjectKeys.detail(id), }); }, - /** Remove platformInfraRef from cache */platformInfraRef: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraRef from cache */ platformInfraRef: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraRefKeys.detail(id) + queryKey: platformInfraRefKeys.detail(id), }); }, - /** Remove platformInfraStore from cache */platformInfraStore: (queryClient: QueryClient, id: string | number) => { + /** Remove platformInfraStore from cache */ platformInfraStore: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformInfraStoreKeys.detail(id) + queryKey: platformInfraStoreKeys.detail(id), }); }, - /** Remove platformNamespace from cache */platformNamespace: (queryClient: QueryClient, id: string | number) => { + /** Remove platformNamespace from cache */ platformNamespace: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformNamespaceKeys.detail(id) + queryKey: platformNamespaceKeys.detail(id), }); }, - /** Remove platformNamespaceEvent from cache */platformNamespaceEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove platformNamespaceEvent from cache */ platformNamespaceEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: platformNamespaceEventKeys.detail(id) + queryKey: platformNamespaceEventKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/infra/hooks/mutation-keys.ts b/sdk/constructive-react/src/infra/hooks/mutation-keys.ts index 2f84f1ee0d..5f62de71e3 100644 --- a/sdk/constructive-react/src/infra/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/infra/hooks/mutation-keys.ts @@ -19,64 +19,98 @@ // ============================================================================ export const dbPresetMutationKeys = { - /** All dbPreset mutation keys */all: ["mutation", "dbpreset"] as const, - /** Create dbPreset mutation key */create: () => ["mutation", "dbpreset", "create"] as const, - /** Update dbPreset mutation key */update: (id: string | number) => ["mutation", "dbpreset", "update", id] as const, - /** Delete dbPreset mutation key */delete: (id: string | number) => ["mutation", "dbpreset", "delete", id] as const + /** All dbPreset mutation keys */ all: ['mutation', 'dbpreset'] as const, + /** Create dbPreset mutation key */ create: () => ['mutation', 'dbpreset', 'create'] as const, + /** Update dbPreset mutation key */ update: (id: string | number) => + ['mutation', 'dbpreset', 'update', id] as const, + /** Delete dbPreset mutation key */ delete: (id: string | number) => + ['mutation', 'dbpreset', 'delete', id] as const, } as const; export const namespaceMutationKeys = { - /** All namespace mutation keys */all: ["mutation", "namespace"] as const, - /** Create namespace mutation key */create: () => ["mutation", "namespace", "create"] as const, - /** Update namespace mutation key */update: (id: string | number) => ["mutation", "namespace", "update", id] as const, - /** Delete namespace mutation key */delete: (id: string | number) => ["mutation", "namespace", "delete", id] as const + /** All namespace mutation keys */ all: ['mutation', 'namespace'] as const, + /** Create namespace mutation key */ create: () => ['mutation', 'namespace', 'create'] as const, + /** Update namespace mutation key */ update: (id: string | number) => + ['mutation', 'namespace', 'update', id] as const, + /** Delete namespace mutation key */ delete: (id: string | number) => + ['mutation', 'namespace', 'delete', id] as const, } as const; export const namespaceEventMutationKeys = { - /** All namespaceEvent mutation keys */all: ["mutation", "namespaceevent"] as const, - /** Create namespaceEvent mutation key */create: () => ["mutation", "namespaceevent", "create"] as const, - /** Update namespaceEvent mutation key */update: (id: string | number) => ["mutation", "namespaceevent", "update", id] as const, - /** Delete namespaceEvent mutation key */delete: (id: string | number) => ["mutation", "namespaceevent", "delete", id] as const + /** All namespaceEvent mutation keys */ all: ['mutation', 'namespaceevent'] as const, + /** Create namespaceEvent mutation key */ create: () => + ['mutation', 'namespaceevent', 'create'] as const, + /** Update namespaceEvent mutation key */ update: (id: string | number) => + ['mutation', 'namespaceevent', 'update', id] as const, + /** Delete namespaceEvent mutation key */ delete: (id: string | number) => + ['mutation', 'namespaceevent', 'delete', id] as const, } as const; export const platformInfraCommitMutationKeys = { - /** All platformInfraCommit mutation keys */all: ["mutation", "platforminfracommit"] as const, - /** Create platformInfraCommit mutation key */create: () => ["mutation", "platforminfracommit", "create"] as const, - /** Update platformInfraCommit mutation key */update: (id: string | number) => ["mutation", "platforminfracommit", "update", id] as const, - /** Delete platformInfraCommit mutation key */delete: (id: string | number) => ["mutation", "platforminfracommit", "delete", id] as const + /** All platformInfraCommit mutation keys */ all: ['mutation', 'platforminfracommit'] as const, + /** Create platformInfraCommit mutation key */ create: () => + ['mutation', 'platforminfracommit', 'create'] as const, + /** Update platformInfraCommit mutation key */ update: (id: string | number) => + ['mutation', 'platforminfracommit', 'update', id] as const, + /** Delete platformInfraCommit mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfracommit', 'delete', id] as const, } as const; export const platformInfraGetAllTreeNodesRecordMutationKeys = { - /** All platformInfraGetAllTreeNodesRecord mutation keys */all: ["mutation", "platforminfragetalltreenodesrecord"] as const, - /** Create platformInfraGetAllTreeNodesRecord mutation key */create: () => ["mutation", "platforminfragetalltreenodesrecord", "create"] as const, - /** Update platformInfraGetAllTreeNodesRecord mutation key */update: (id: string | number) => ["mutation", "platforminfragetalltreenodesrecord", "update", id] as const, - /** Delete platformInfraGetAllTreeNodesRecord mutation key */delete: (id: string | number) => ["mutation", "platforminfragetalltreenodesrecord", "delete", id] as const + /** All platformInfraGetAllTreeNodesRecord mutation keys */ all: [ + 'mutation', + 'platforminfragetalltreenodesrecord', + ] as const, + /** Create platformInfraGetAllTreeNodesRecord mutation key */ create: () => + ['mutation', 'platforminfragetalltreenodesrecord', 'create'] as const, + /** Update platformInfraGetAllTreeNodesRecord mutation key */ update: (id: string | number) => + ['mutation', 'platforminfragetalltreenodesrecord', 'update', id] as const, + /** Delete platformInfraGetAllTreeNodesRecord mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfragetalltreenodesrecord', 'delete', id] as const, } as const; export const platformInfraObjectMutationKeys = { - /** All platformInfraObject mutation keys */all: ["mutation", "platforminfraobject"] as const, - /** Create platformInfraObject mutation key */create: () => ["mutation", "platforminfraobject", "create"] as const, - /** Update platformInfraObject mutation key */update: (id: string | number) => ["mutation", "platforminfraobject", "update", id] as const, - /** Delete platformInfraObject mutation key */delete: (id: string | number) => ["mutation", "platforminfraobject", "delete", id] as const + /** All platformInfraObject mutation keys */ all: ['mutation', 'platforminfraobject'] as const, + /** Create platformInfraObject mutation key */ create: () => + ['mutation', 'platforminfraobject', 'create'] as const, + /** Update platformInfraObject mutation key */ update: (id: string | number) => + ['mutation', 'platforminfraobject', 'update', id] as const, + /** Delete platformInfraObject mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfraobject', 'delete', id] as const, } as const; export const platformInfraRefMutationKeys = { - /** All platformInfraRef mutation keys */all: ["mutation", "platforminfraref"] as const, - /** Create platformInfraRef mutation key */create: () => ["mutation", "platforminfraref", "create"] as const, - /** Update platformInfraRef mutation key */update: (id: string | number) => ["mutation", "platforminfraref", "update", id] as const, - /** Delete platformInfraRef mutation key */delete: (id: string | number) => ["mutation", "platforminfraref", "delete", id] as const + /** All platformInfraRef mutation keys */ all: ['mutation', 'platforminfraref'] as const, + /** Create platformInfraRef mutation key */ create: () => + ['mutation', 'platforminfraref', 'create'] as const, + /** Update platformInfraRef mutation key */ update: (id: string | number) => + ['mutation', 'platforminfraref', 'update', id] as const, + /** Delete platformInfraRef mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfraref', 'delete', id] as const, } as const; export const platformInfraStoreMutationKeys = { - /** All platformInfraStore mutation keys */all: ["mutation", "platforminfrastore"] as const, - /** Create platformInfraStore mutation key */create: () => ["mutation", "platforminfrastore", "create"] as const, - /** Update platformInfraStore mutation key */update: (id: string | number) => ["mutation", "platforminfrastore", "update", id] as const, - /** Delete platformInfraStore mutation key */delete: (id: string | number) => ["mutation", "platforminfrastore", "delete", id] as const + /** All platformInfraStore mutation keys */ all: ['mutation', 'platforminfrastore'] as const, + /** Create platformInfraStore mutation key */ create: () => + ['mutation', 'platforminfrastore', 'create'] as const, + /** Update platformInfraStore mutation key */ update: (id: string | number) => + ['mutation', 'platforminfrastore', 'update', id] as const, + /** Delete platformInfraStore mutation key */ delete: (id: string | number) => + ['mutation', 'platforminfrastore', 'delete', id] as const, } as const; export const platformNamespaceMutationKeys = { - /** All platformNamespace mutation keys */all: ["mutation", "platformnamespace"] as const, - /** Create platformNamespace mutation key */create: () => ["mutation", "platformnamespace", "create"] as const, - /** Update platformNamespace mutation key */update: (id: string | number) => ["mutation", "platformnamespace", "update", id] as const, - /** Delete platformNamespace mutation key */delete: (id: string | number) => ["mutation", "platformnamespace", "delete", id] as const + /** All platformNamespace mutation keys */ all: ['mutation', 'platformnamespace'] as const, + /** Create platformNamespace mutation key */ create: () => + ['mutation', 'platformnamespace', 'create'] as const, + /** Update platformNamespace mutation key */ update: (id: string | number) => + ['mutation', 'platformnamespace', 'update', id] as const, + /** Delete platformNamespace mutation key */ delete: (id: string | number) => + ['mutation', 'platformnamespace', 'delete', id] as const, } as const; export const platformNamespaceEventMutationKeys = { - /** All platformNamespaceEvent mutation keys */all: ["mutation", "platformnamespaceevent"] as const, - /** Create platformNamespaceEvent mutation key */create: () => ["mutation", "platformnamespaceevent", "create"] as const, - /** Update platformNamespaceEvent mutation key */update: (id: string | number) => ["mutation", "platformnamespaceevent", "update", id] as const, - /** Delete platformNamespaceEvent mutation key */delete: (id: string | number) => ["mutation", "platformnamespaceevent", "delete", id] as const + /** All platformNamespaceEvent mutation keys */ all: [ + 'mutation', + 'platformnamespaceevent', + ] as const, + /** Create platformNamespaceEvent mutation key */ create: () => + ['mutation', 'platformnamespaceevent', 'create'] as const, + /** Update platformNamespaceEvent mutation key */ update: (id: string | number) => + ['mutation', 'platformnamespaceevent', 'update', id] as const, + /** Delete platformNamespaceEvent mutation key */ delete: (id: string | number) => + ['mutation', 'platformnamespaceevent', 'delete', id] as const, } as const; // ============================================================================ @@ -84,10 +118,28 @@ export const platformNamespaceEventMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for platformInfraInitEmptyRepo */platformInfraInitEmptyRepo: (identifier?: string) => identifier ? ["mutation", "platformInfraInitEmptyRepo", identifier] as const : ["mutation", "platformInfraInitEmptyRepo"] as const, - /** Mutation key for platformInfraInsertNodeAtPath */platformInfraInsertNodeAtPath: (identifier?: string) => identifier ? ["mutation", "platformInfraInsertNodeAtPath", identifier] as const : ["mutation", "platformInfraInsertNodeAtPath"] as const, - /** Mutation key for platformInfraSetDataAtPath */platformInfraSetDataAtPath: (identifier?: string) => identifier ? ["mutation", "platformInfraSetDataAtPath", identifier] as const : ["mutation", "platformInfraSetDataAtPath"] as const, - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const + /** Mutation key for platformInfraInitEmptyRepo */ platformInfraInitEmptyRepo: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInfraInitEmptyRepo', identifier] as const) + : (['mutation', 'platformInfraInitEmptyRepo'] as const), + /** Mutation key for platformInfraInsertNodeAtPath */ platformInfraInsertNodeAtPath: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInfraInsertNodeAtPath', identifier] as const) + : (['mutation', 'platformInfraInsertNodeAtPath'] as const), + /** Mutation key for platformInfraSetDataAtPath */ platformInfraSetDataAtPath: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformInfraSetDataAtPath', identifier] as const) + : (['mutation', 'platformInfraSetDataAtPath'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), } as const; /** @@ -122,5 +174,5 @@ export const mutationKeys = { platformInfraStore: platformInfraStoreMutationKeys, platformNamespace: platformNamespaceMutationKeys, platformNamespaceEvent: platformNamespaceEventMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/infra/hooks/mutations/index.ts b/sdk/constructive-react/src/infra/hooks/mutations/index.ts index f09f9a82e6..2b042b34a2 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/index.ts @@ -3,35 +3,35 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateDbPresetMutation"; -export * from "./useUpdateDbPresetMutation"; -export * from "./useDeleteDbPresetMutation"; -export * from "./useCreateNamespaceMutation"; -export * from "./useUpdateNamespaceMutation"; -export * from "./useDeleteNamespaceMutation"; -export * from "./useCreateNamespaceEventMutation"; -export * from "./useUpdateNamespaceEventMutation"; -export * from "./useDeleteNamespaceEventMutation"; -export * from "./useCreatePlatformInfraCommitMutation"; -export * from "./useUpdatePlatformInfraCommitMutation"; -export * from "./useDeletePlatformInfraCommitMutation"; -export * from "./useCreatePlatformInfraGetAllTreeNodesRecordMutation"; -export * from "./useCreatePlatformInfraObjectMutation"; -export * from "./useUpdatePlatformInfraObjectMutation"; -export * from "./useDeletePlatformInfraObjectMutation"; -export * from "./useCreatePlatformInfraRefMutation"; -export * from "./useUpdatePlatformInfraRefMutation"; -export * from "./useDeletePlatformInfraRefMutation"; -export * from "./useCreatePlatformInfraStoreMutation"; -export * from "./useUpdatePlatformInfraStoreMutation"; -export * from "./useDeletePlatformInfraStoreMutation"; -export * from "./useCreatePlatformNamespaceMutation"; -export * from "./useUpdatePlatformNamespaceMutation"; -export * from "./useDeletePlatformNamespaceMutation"; -export * from "./useCreatePlatformNamespaceEventMutation"; -export * from "./useUpdatePlatformNamespaceEventMutation"; -export * from "./useDeletePlatformNamespaceEventMutation"; -export * from "./usePlatformInfraInitEmptyRepoMutation"; -export * from "./usePlatformInfraInsertNodeAtPathMutation"; -export * from "./usePlatformInfraSetDataAtPathMutation"; -export * from "./useProvisionBucketMutation"; \ No newline at end of file +export * from './useCreateDbPresetMutation'; +export * from './useUpdateDbPresetMutation'; +export * from './useDeleteDbPresetMutation'; +export * from './useCreateNamespaceMutation'; +export * from './useUpdateNamespaceMutation'; +export * from './useDeleteNamespaceMutation'; +export * from './useCreateNamespaceEventMutation'; +export * from './useUpdateNamespaceEventMutation'; +export * from './useDeleteNamespaceEventMutation'; +export * from './useCreatePlatformInfraCommitMutation'; +export * from './useUpdatePlatformInfraCommitMutation'; +export * from './useDeletePlatformInfraCommitMutation'; +export * from './useCreatePlatformInfraGetAllTreeNodesRecordMutation'; +export * from './useCreatePlatformInfraObjectMutation'; +export * from './useUpdatePlatformInfraObjectMutation'; +export * from './useDeletePlatformInfraObjectMutation'; +export * from './useCreatePlatformInfraRefMutation'; +export * from './useUpdatePlatformInfraRefMutation'; +export * from './useDeletePlatformInfraRefMutation'; +export * from './useCreatePlatformInfraStoreMutation'; +export * from './useUpdatePlatformInfraStoreMutation'; +export * from './useDeletePlatformInfraStoreMutation'; +export * from './useCreatePlatformNamespaceMutation'; +export * from './useUpdatePlatformNamespaceMutation'; +export * from './useDeletePlatformNamespaceMutation'; +export * from './useCreatePlatformNamespaceEventMutation'; +export * from './useUpdatePlatformNamespaceEventMutation'; +export * from './useDeletePlatformNamespaceEventMutation'; +export * from './usePlatformInfraInitEmptyRepoMutation'; +export * from './usePlatformInfraInsertNodeAtPathMutation'; +export * from './usePlatformInfraSetDataAtPathMutation'; +export * from './useProvisionBucketMutation'; diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreateDbPresetMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreateDbPresetMutation.ts index 4025ea01cb..a415acccb6 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreateDbPresetMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreateDbPresetMutation.ts @@ -4,62 +4,85 @@ * 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 { dbPresetKeys } from "../query-keys"; -import { dbPresetMutationKeys } from "../mutation-keys"; -import type { DbPresetSelect, DbPresetWithRelations, CreateDbPresetInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations, CreateDbPresetInput } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import { dbPresetMutationKeys } from '../mutation-keys'; +import type { + DbPresetSelect, + DbPresetWithRelations, + CreateDbPresetInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DbPresetSelect, + DbPresetWithRelations, + CreateDbPresetInput, +} from '../../orm/input-types'; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDbPresetMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDbPresetMutation(params: { - selection: ({ - fields: S & DbPresetSelect; - } & HookStrictSelect, DbPresetSelect>); -} & Omit; - }; -}, Error, CreateDbPresetInput["dbPreset"]>, "mutationFn">): UseMutationResult<{ - createDbPreset: { - dbPreset: InferSelectResult; - }; -}, Error, CreateDbPresetInput["dbPreset"]>; -export function useCreateDbPresetMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDbPresetMutation( + params: { + selection: { + fields: S & DbPresetSelect; + } & HookStrictSelect, DbPresetSelect>; + } & Omit< + UseMutationOptions< + { + createDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + CreateDbPresetInput['dbPreset'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + CreateDbPresetInput['dbPreset'] +>; +export function useCreateDbPresetMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetMutationKeys.create(), - mutationFn: (data: CreateDbPresetInput["dbPreset"]) => getClient().dbPreset.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDbPresetInput['dbPreset']) => + getClient() + .dbPreset.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: dbPresetKeys.lists() + queryKey: dbPresetKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreateNamespaceEventMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreateNamespaceEventMutation.ts index 160b957517..18fc4fff8b 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreateNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreateNamespaceEventMutation.ts @@ -4,62 +4,88 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import { namespaceEventMutationKeys } from "../mutation-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations, CreateNamespaceEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations, CreateNamespaceEventInput } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import { namespaceEventMutationKeys } from '../mutation-keys'; +import type { + NamespaceEventSelect, + NamespaceEventWithRelations, + CreateNamespaceEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceEventSelect, + NamespaceEventWithRelations, + CreateNamespaceEventInput, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useCreateNamespaceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateNamespaceEventMutation(params: { - selection: ({ - fields: S & NamespaceEventSelect; - } & HookStrictSelect, NamespaceEventSelect>); -} & Omit; - }; -}, Error, CreateNamespaceEventInput["namespaceEvent"]>, "mutationFn">): UseMutationResult<{ - createNamespaceEvent: { - namespaceEvent: InferSelectResult; - }; -}, Error, CreateNamespaceEventInput["namespaceEvent"]>; -export function useCreateNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateNamespaceEventMutation( + params: { + selection: { + fields: S & NamespaceEventSelect; + } & HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + createNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + CreateNamespaceEventInput['namespaceEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + CreateNamespaceEventInput['namespaceEvent'] +>; +export function useCreateNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceEventMutationKeys.create(), - mutationFn: (data: CreateNamespaceEventInput["namespaceEvent"]) => getClient().namespaceEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateNamespaceEventInput['namespaceEvent']) => + getClient() + .namespaceEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.lists() + queryKey: namespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreateNamespaceMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreateNamespaceMutation.ts index b175a2b074..1bad42cc00 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreateNamespaceMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreateNamespaceMutation.ts @@ -4,62 +4,85 @@ * 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 { namespaceKeys } from "../query-keys"; -import { namespaceMutationKeys } from "../mutation-keys"; -import type { NamespaceSelect, NamespaceWithRelations, CreateNamespaceInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations, CreateNamespaceInput } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import { namespaceMutationKeys } from '../mutation-keys'; +import type { + NamespaceSelect, + NamespaceWithRelations, + CreateNamespaceInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceSelect, + NamespaceWithRelations, + CreateNamespaceInput, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useCreateNamespaceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateNamespaceMutation(params: { - selection: ({ - fields: S & NamespaceSelect; - } & HookStrictSelect, NamespaceSelect>); -} & Omit; - }; -}, Error, CreateNamespaceInput["namespace"]>, "mutationFn">): UseMutationResult<{ - createNamespace: { - namespace: InferSelectResult; - }; -}, Error, CreateNamespaceInput["namespace"]>; -export function useCreateNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateNamespaceMutation( + params: { + selection: { + fields: S & NamespaceSelect; + } & HookStrictSelect, NamespaceSelect>; + } & Omit< + UseMutationOptions< + { + createNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + CreateNamespaceInput['namespace'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + CreateNamespaceInput['namespace'] +>; +export function useCreateNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceMutationKeys.create(), - mutationFn: (data: CreateNamespaceInput["namespace"]) => getClient().namespace.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateNamespaceInput['namespace']) => + getClient() + .namespace.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: namespaceKeys.lists() + queryKey: namespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraCommitMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraCommitMutation.ts index 34dcf9dee1..eeacf3c389 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraCommitMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraCommitMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import { platformInfraCommitMutationKeys } from "../mutation-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, CreatePlatformInfraCommitInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, CreatePlatformInfraCommitInput } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import { platformInfraCommitMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + CreatePlatformInfraCommitInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + CreatePlatformInfraCommitInput, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraCommitMutation(params: { - selection: ({ - fields: S & PlatformInfraCommitSelect; - } & HookStrictSelect, PlatformInfraCommitSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraCommitInput["platformInfraCommit"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraCommit: { - platformInfraCommit: InferSelectResult; - }; -}, Error, CreatePlatformInfraCommitInput["platformInfraCommit"]>; -export function useCreatePlatformInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraCommitMutation( + params: { + selection: { + fields: S & PlatformInfraCommitSelect; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraCommitInput['platformInfraCommit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraCommitInput['platformInfraCommit'] +>; +export function useCreatePlatformInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraCommitMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraCommitInput["platformInfraCommit"]) => getClient().platformInfraCommit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInfraCommitInput['platformInfraCommit']) => + getClient() + .platformInfraCommit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.lists() + queryKey: platformInfraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraGetAllTreeNodesRecordMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraGetAllTreeNodesRecordMutation.ts index 2e7049829e..13b05cd0de 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraGetAllTreeNodesRecordMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraGetAllTreeNodesRecordMutation.ts @@ -4,62 +4,102 @@ * 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 { platformInfraGetAllTreeNodesRecordKeys } from "../query-keys"; -import { platformInfraGetAllTreeNodesRecordMutationKeys } from "../mutation-keys"; -import type { PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordWithRelations, CreatePlatformInfraGetAllTreeNodesRecordInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordWithRelations, CreatePlatformInfraGetAllTreeNodesRecordInput } from "../../orm/input-types"; +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 { platformInfraGetAllTreeNodesRecordKeys } from '../query-keys'; +import { platformInfraGetAllTreeNodesRecordMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordWithRelations, + CreatePlatformInfraGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordWithRelations, + CreatePlatformInfraGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlatformInfraGetAllTreeNodesRecord - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraGetAllTreeNodesRecordMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraGetAllTreeNodesRecordMutation(params: { - selection: ({ - fields: S & PlatformInfraGetAllTreeNodesRecordSelect; - } & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraGetAllTreeNodesRecordInput["platformInfraGetAllTreeNodesRecord"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraGetAllTreeNodesRecord: { - platformInfraGetAllTreeNodesRecord: InferSelectResult; - }; -}, Error, CreatePlatformInfraGetAllTreeNodesRecordInput["platformInfraGetAllTreeNodesRecord"]>; -export function useCreatePlatformInfraGetAllTreeNodesRecordMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraGetAllTreeNodesRecordMutation< + S extends PlatformInfraGetAllTreeNodesRecordSelect, +>( + params: { + selection: { + fields: S & PlatformInfraGetAllTreeNodesRecordSelect; + } & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraGetAllTreeNodesRecord: { + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; + }; + }, + Error, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraGetAllTreeNodesRecord: { + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; + }; + }, + Error, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] +>; +export function useCreatePlatformInfraGetAllTreeNodesRecordMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraGetAllTreeNodesRecordMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraGetAllTreeNodesRecordInput["platformInfraGetAllTreeNodesRecord"]) => getClient().platformInfraGetAllTreeNodesRecord.create({ - data, - select: args.select - }).unwrap(), + mutationFn: ( + data: CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + ) => + getClient() + .platformInfraGetAllTreeNodesRecord.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraGetAllTreeNodesRecordKeys.lists() + queryKey: platformInfraGetAllTreeNodesRecordKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraObjectMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraObjectMutation.ts index f1c6306a5b..94102a057a 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraObjectMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraObjectMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import { platformInfraObjectMutationKeys } from "../mutation-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, CreatePlatformInfraObjectInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, CreatePlatformInfraObjectInput } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import { platformInfraObjectMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + CreatePlatformInfraObjectInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + CreatePlatformInfraObjectInput, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraObjectMutation(params: { - selection: ({ - fields: S & PlatformInfraObjectSelect; - } & HookStrictSelect, PlatformInfraObjectSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraObjectInput["platformInfraObject"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraObject: { - platformInfraObject: InferSelectResult; - }; -}, Error, CreatePlatformInfraObjectInput["platformInfraObject"]>; -export function useCreatePlatformInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraObjectMutation( + params: { + selection: { + fields: S & PlatformInfraObjectSelect; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraObjectInput['platformInfraObject'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraObjectInput['platformInfraObject'] +>; +export function useCreatePlatformInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraObjectMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraObjectInput["platformInfraObject"]) => getClient().platformInfraObject.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInfraObjectInput['platformInfraObject']) => + getClient() + .platformInfraObject.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.lists() + queryKey: platformInfraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraRefMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraRefMutation.ts index f149ce5248..a022b59d37 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraRefMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraRefMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import { platformInfraRefMutationKeys } from "../mutation-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, CreatePlatformInfraRefInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, CreatePlatformInfraRefInput } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import { platformInfraRefMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + CreatePlatformInfraRefInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + CreatePlatformInfraRefInput, +} from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraRefMutation(params: { - selection: ({ - fields: S & PlatformInfraRefSelect; - } & HookStrictSelect, PlatformInfraRefSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraRefInput["platformInfraRef"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraRef: { - platformInfraRef: InferSelectResult; - }; -}, Error, CreatePlatformInfraRefInput["platformInfraRef"]>; -export function useCreatePlatformInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraRefMutation( + params: { + selection: { + fields: S & PlatformInfraRefSelect; + } & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraRefInput['platformInfraRef'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraRefInput['platformInfraRef'] +>; +export function useCreatePlatformInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraRefMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraRefInput["platformInfraRef"]) => getClient().platformInfraRef.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInfraRefInput['platformInfraRef']) => + getClient() + .platformInfraRef.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.lists() + queryKey: platformInfraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraStoreMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraStoreMutation.ts index 8083934684..8d493f0e58 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraStoreMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformInfraStoreMutation.ts @@ -4,62 +4,88 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import { platformInfraStoreMutationKeys } from "../mutation-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, CreatePlatformInfraStoreInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, CreatePlatformInfraStoreInput } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import { platformInfraStoreMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + CreatePlatformInfraStoreInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + CreatePlatformInfraStoreInput, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformInfraStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformInfraStoreMutation(params: { - selection: ({ - fields: S & PlatformInfraStoreSelect; - } & HookStrictSelect, PlatformInfraStoreSelect>); -} & Omit; - }; -}, Error, CreatePlatformInfraStoreInput["platformInfraStore"]>, "mutationFn">): UseMutationResult<{ - createPlatformInfraStore: { - platformInfraStore: InferSelectResult; - }; -}, Error, CreatePlatformInfraStoreInput["platformInfraStore"]>; -export function useCreatePlatformInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformInfraStoreMutation( + params: { + selection: { + fields: S & PlatformInfraStoreSelect; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraStoreInput['platformInfraStore'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + CreatePlatformInfraStoreInput['platformInfraStore'] +>; +export function useCreatePlatformInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraStoreMutationKeys.create(), - mutationFn: (data: CreatePlatformInfraStoreInput["platformInfraStore"]) => getClient().platformInfraStore.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformInfraStoreInput['platformInfraStore']) => + getClient() + .platformInfraStore.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.lists() + queryKey: platformInfraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformNamespaceEventMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformNamespaceEventMutation.ts index e058c44a93..28d55d5bfc 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformNamespaceEventMutation.ts @@ -4,62 +4,88 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import { platformNamespaceEventMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, CreatePlatformNamespaceEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, CreatePlatformNamespaceEventInput } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import { platformNamespaceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + CreatePlatformNamespaceEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + CreatePlatformNamespaceEventInput, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformNamespaceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformNamespaceEventMutation(params: { - selection: ({ - fields: S & PlatformNamespaceEventSelect; - } & HookStrictSelect, PlatformNamespaceEventSelect>); -} & Omit; - }; -}, Error, CreatePlatformNamespaceEventInput["platformNamespaceEvent"]>, "mutationFn">): UseMutationResult<{ - createPlatformNamespaceEvent: { - platformNamespaceEvent: InferSelectResult; - }; -}, Error, CreatePlatformNamespaceEventInput["platformNamespaceEvent"]>; -export function useCreatePlatformNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformNamespaceEventMutation( + params: { + selection: { + fields: S & PlatformNamespaceEventSelect; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformNamespaceEventInput['platformNamespaceEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + CreatePlatformNamespaceEventInput['platformNamespaceEvent'] +>; +export function useCreatePlatformNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceEventMutationKeys.create(), - mutationFn: (data: CreatePlatformNamespaceEventInput["platformNamespaceEvent"]) => getClient().platformNamespaceEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformNamespaceEventInput['platformNamespaceEvent']) => + getClient() + .platformNamespaceEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.lists() + queryKey: platformNamespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformNamespaceMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformNamespaceMutation.ts index 7fb26987b8..ffd9d34339 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformNamespaceMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useCreatePlatformNamespaceMutation.ts @@ -4,62 +4,88 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import { platformNamespaceMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, CreatePlatformNamespaceInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, CreatePlatformNamespaceInput } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import { platformNamespaceMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + CreatePlatformNamespaceInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + CreatePlatformNamespaceInput, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlatformNamespaceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlatformNamespaceMutation(params: { - selection: ({ - fields: S & PlatformNamespaceSelect; - } & HookStrictSelect, PlatformNamespaceSelect>); -} & Omit; - }; -}, Error, CreatePlatformNamespaceInput["platformNamespace"]>, "mutationFn">): UseMutationResult<{ - createPlatformNamespace: { - platformNamespace: InferSelectResult; - }; -}, Error, CreatePlatformNamespaceInput["platformNamespace"]>; -export function useCreatePlatformNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlatformNamespaceMutation( + params: { + selection: { + fields: S & PlatformNamespaceSelect; + } & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + CreatePlatformNamespaceInput['platformNamespace'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + CreatePlatformNamespaceInput['platformNamespace'] +>; +export function useCreatePlatformNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceMutationKeys.create(), - mutationFn: (data: CreatePlatformNamespaceInput["platformNamespace"]) => getClient().platformNamespace.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlatformNamespaceInput['platformNamespace']) => + getClient() + .platformNamespace.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.lists() + queryKey: platformNamespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeleteDbPresetMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeleteDbPresetMutation.ts index 9effbb9689..4408dd0b6f 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeleteDbPresetMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeleteDbPresetMutation.ts @@ -4,77 +4,95 @@ * 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 { dbPresetKeys } from "../query-keys"; -import { dbPresetMutationKeys } from "../mutation-keys"; -import type { DbPresetSelect, DbPresetWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import { dbPresetMutationKeys } from '../mutation-keys'; +import type { DbPresetSelect, DbPresetWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPresetSelect, DbPresetWithRelations } from '../../orm/input-types'; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDbPresetMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDbPresetMutation(params: { - selection: ({ - fields: S & DbPresetSelect; - } & HookStrictSelect, DbPresetSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDbPreset: { - dbPreset: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDbPresetMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDbPresetMutation( + params: { + selection: { + fields: S & DbPresetSelect; + } & HookStrictSelect, DbPresetSelect>; + } & Omit< + UseMutationOptions< + { + deleteDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDbPresetMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().dbPreset.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .dbPreset.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: dbPresetKeys.detail(variables.id) + queryKey: dbPresetKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPresetKeys.lists() + queryKey: dbPresetKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeleteNamespaceEventMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeleteNamespaceEventMutation.ts index 6c6f82a508..e48ce652c4 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeleteNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeleteNamespaceEventMutation.ts @@ -4,83 +4,99 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import { namespaceEventMutationKeys } from "../mutation-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import { namespaceEventMutationKeys } from '../mutation-keys'; +import type { NamespaceEventSelect, NamespaceEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceEventSelect, NamespaceEventWithRelations } from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteNamespaceEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteNamespaceEventMutation(params: { - selection: ({ - fields: S & NamespaceEventSelect; - } & HookStrictSelect, NamespaceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteNamespaceEvent: { - namespaceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteNamespaceEventMutation( + params: { + selection: { + fields: S & NamespaceEventSelect; + } & HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().namespaceEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .namespaceEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: namespaceEventKeys.detail(variables.id) + queryKey: namespaceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.lists() + queryKey: namespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeleteNamespaceMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeleteNamespaceMutation.ts index c5c1ba874a..1c6e408df6 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeleteNamespaceMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeleteNamespaceMutation.ts @@ -4,77 +4,95 @@ * 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 { namespaceKeys } from "../query-keys"; -import { namespaceMutationKeys } from "../mutation-keys"; -import type { NamespaceSelect, NamespaceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import { namespaceMutationKeys } from '../mutation-keys'; +import type { NamespaceSelect, NamespaceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceSelect, NamespaceWithRelations } from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteNamespaceMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteNamespaceMutation(params: { - selection: ({ - fields: S & NamespaceSelect; - } & HookStrictSelect, NamespaceSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteNamespace: { - namespace: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteNamespaceMutation( + params: { + selection: { + fields: S & NamespaceSelect; + } & HookStrictSelect, NamespaceSelect>; + } & Omit< + UseMutationOptions< + { + deleteNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().namespace.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .namespace.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: namespaceKeys.detail(variables.id) + queryKey: namespaceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceKeys.lists() + queryKey: namespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraCommitMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraCommitMutation.ts index bcc288fa83..6df9d8656c 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraCommitMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraCommitMutation.ts @@ -4,83 +4,105 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import { platformInfraCommitMutationKeys } from "../mutation-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import { platformInfraCommitMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformInfraCommitMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformInfraCommitMutation(params: { - selection: ({ - fields: S & PlatformInfraCommitSelect; - } & HookStrictSelect, PlatformInfraCommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformInfraCommit: { - platformInfraCommit: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeletePlatformInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformInfraCommitMutation( + params: { + selection: { + fields: S & PlatformInfraCommitSelect; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeletePlatformInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraCommitMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().platformInfraCommit.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .platformInfraCommit.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformInfraCommitKeys.detail(variables.id) + queryKey: platformInfraCommitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.lists() + queryKey: platformInfraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraObjectMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraObjectMutation.ts index d619cb36c9..6eca19dfc7 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraObjectMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraObjectMutation.ts @@ -4,83 +4,105 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import { platformInfraObjectMutationKeys } from "../mutation-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import { platformInfraObjectMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformInfraObjectMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformInfraObjectMutation(params: { - selection: ({ - fields: S & PlatformInfraObjectSelect; - } & HookStrictSelect, PlatformInfraObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformInfraObject: { - platformInfraObject: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeletePlatformInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformInfraObjectMutation( + params: { + selection: { + fields: S & PlatformInfraObjectSelect; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeletePlatformInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraObjectMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().platformInfraObject.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .platformInfraObject.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformInfraObjectKeys.detail(variables.id) + queryKey: platformInfraObjectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.lists() + queryKey: platformInfraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraRefMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraRefMutation.ts index b53e4151fc..7dbb34e61f 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraRefMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraRefMutation.ts @@ -4,83 +4,99 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import { platformInfraRefMutationKeys } from "../mutation-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import { platformInfraRefMutationKeys } from '../mutation-keys'; +import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformInfraRefMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformInfraRefMutation(params: { - selection: ({ - fields: S & PlatformInfraRefSelect; - } & HookStrictSelect, PlatformInfraRefSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformInfraRef: { - platformInfraRef: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; -}>; -export function useDeletePlatformInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformInfraRefMutation( + params: { + selection: { + fields: S & PlatformInfraRefSelect; + } & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + } +>; +export function useDeletePlatformInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraRefMutationKeys.all, - mutationFn: ({ - id, - scopeId - }: { - id: string; - scopeId: string; - }) => getClient().platformInfraRef.delete({ - where: { - id, - scopeId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, scopeId }: { id: string; scopeId: string }) => + getClient() + .platformInfraRef.delete({ + where: { + id, + scopeId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformInfraRefKeys.detail(variables.id) + queryKey: platformInfraRefKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.lists() + queryKey: platformInfraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraStoreMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraStoreMutation.ts index f855494f86..7fae6cd5f0 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraStoreMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformInfraStoreMutation.ts @@ -4,77 +4,101 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import { platformInfraStoreMutationKeys } from "../mutation-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import { platformInfraStoreMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformInfraStoreMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformInfraStoreMutation(params: { - selection: ({ - fields: S & PlatformInfraStoreSelect; - } & HookStrictSelect, PlatformInfraStoreSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformInfraStore: { - platformInfraStore: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformInfraStoreMutation( + params: { + selection: { + fields: S & PlatformInfraStoreSelect; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraStoreMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformInfraStore.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformInfraStore.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformInfraStoreKeys.detail(variables.id) + queryKey: platformInfraStoreKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.lists() + queryKey: platformInfraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformNamespaceEventMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformNamespaceEventMutation.ts index e2bea11fe0..c248e1eaa5 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformNamespaceEventMutation.ts @@ -4,83 +4,105 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import { platformNamespaceEventMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import { platformNamespaceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformNamespaceEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformNamespaceEventMutation(params: { - selection: ({ - fields: S & PlatformNamespaceEventSelect; - } & HookStrictSelect, PlatformNamespaceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformNamespaceEvent: { - platformNamespaceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeletePlatformNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformNamespaceEventMutation( + params: { + selection: { + fields: S & PlatformNamespaceEventSelect; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeletePlatformNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().platformNamespaceEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .platformNamespaceEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformNamespaceEventKeys.detail(variables.id) + queryKey: platformNamespaceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.lists() + queryKey: platformNamespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformNamespaceMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformNamespaceMutation.ts index 2e7fb1b8a4..86ca139c3b 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformNamespaceMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useDeletePlatformNamespaceMutation.ts @@ -4,77 +4,101 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import { platformNamespaceMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import { platformNamespaceMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlatformNamespaceMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlatformNamespaceMutation(params: { - selection: ({ - fields: S & PlatformNamespaceSelect; - } & HookStrictSelect, PlatformNamespaceSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlatformNamespace: { - platformNamespace: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlatformNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlatformNamespaceMutation( + params: { + selection: { + fields: S & PlatformNamespaceSelect; + } & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().platformNamespace.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .platformNamespace.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: platformNamespaceKeys.detail(variables.id) + queryKey: platformNamespaceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.lists() + queryKey: platformNamespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraInitEmptyRepoMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraInitEmptyRepoMutation.ts index b342c2f6d5..96a1c5190a 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraInitEmptyRepoMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraInitEmptyRepoMutation.ts @@ -4,39 +4,57 @@ * 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 { PlatformInfraInitEmptyRepoVariables } from "../../orm/mutation"; -import type { PlatformInfraInitEmptyRepoPayloadSelect, PlatformInfraInitEmptyRepoPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInfraInitEmptyRepoVariables } from "../../orm/mutation"; -export type { PlatformInfraInitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export function usePlatformInfraInitEmptyRepoMutation(params: { - selection: ({ - fields: S & PlatformInfraInitEmptyRepoPayloadSelect; - } & HookStrictSelect, PlatformInfraInitEmptyRepoPayloadSelect>); -} & Omit | null; -}, Error, PlatformInfraInitEmptyRepoVariables>, "mutationFn">): UseMutationResult<{ - platformInfraInitEmptyRepo: InferSelectResult | null; -}, Error, PlatformInfraInitEmptyRepoVariables> { +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 { PlatformInfraInitEmptyRepoVariables } from '../../orm/mutation'; +import type { + PlatformInfraInitEmptyRepoPayloadSelect, + PlatformInfraInitEmptyRepoPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInfraInitEmptyRepoVariables } from '../../orm/mutation'; +export type { PlatformInfraInitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export function usePlatformInfraInitEmptyRepoMutation< + S extends PlatformInfraInitEmptyRepoPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInfraInitEmptyRepoPayloadSelect; + } & HookStrictSelect, PlatformInfraInitEmptyRepoPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInfraInitEmptyRepo: InferSelectResult | null; + }, + Error, + PlatformInfraInitEmptyRepoVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInfraInitEmptyRepo: InferSelectResult | null; + }, + Error, + PlatformInfraInitEmptyRepoVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInfraInitEmptyRepo(), - mutationFn: (variables: PlatformInfraInitEmptyRepoVariables) => getClient().mutation.platformInfraInitEmptyRepo(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInfraInitEmptyRepoVariables) => + getClient() + .mutation.platformInfraInitEmptyRepo(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraInsertNodeAtPathMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraInsertNodeAtPathMutation.ts index 53e17ecc04..94f08d7d64 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraInsertNodeAtPathMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraInsertNodeAtPathMutation.ts @@ -4,39 +4,63 @@ * 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 { PlatformInfraInsertNodeAtPathVariables } from "../../orm/mutation"; -import type { PlatformInfraInsertNodeAtPathPayloadSelect, PlatformInfraInsertNodeAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInfraInsertNodeAtPathVariables } from "../../orm/mutation"; -export type { PlatformInfraInsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export function usePlatformInfraInsertNodeAtPathMutation(params: { - selection: ({ - fields: S & PlatformInfraInsertNodeAtPathPayloadSelect; - } & HookStrictSelect, PlatformInfraInsertNodeAtPathPayloadSelect>); -} & Omit | null; -}, Error, PlatformInfraInsertNodeAtPathVariables>, "mutationFn">): UseMutationResult<{ - platformInfraInsertNodeAtPath: InferSelectResult | null; -}, Error, PlatformInfraInsertNodeAtPathVariables> { +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 { PlatformInfraInsertNodeAtPathVariables } from '../../orm/mutation'; +import type { + PlatformInfraInsertNodeAtPathPayloadSelect, + PlatformInfraInsertNodeAtPathPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInfraInsertNodeAtPathVariables } from '../../orm/mutation'; +export type { PlatformInfraInsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export function usePlatformInfraInsertNodeAtPathMutation< + S extends PlatformInfraInsertNodeAtPathPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInfraInsertNodeAtPathPayloadSelect; + } & HookStrictSelect, PlatformInfraInsertNodeAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }, + Error, + PlatformInfraInsertNodeAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }, + Error, + PlatformInfraInsertNodeAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInfraInsertNodeAtPath(), - mutationFn: (variables: PlatformInfraInsertNodeAtPathVariables) => getClient().mutation.platformInfraInsertNodeAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInfraInsertNodeAtPathVariables) => + getClient() + .mutation.platformInfraInsertNodeAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraSetDataAtPathMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraSetDataAtPathMutation.ts index 9dd67f6614..4a32fdf323 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraSetDataAtPathMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/usePlatformInfraSetDataAtPathMutation.ts @@ -4,39 +4,57 @@ * 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 { PlatformInfraSetDataAtPathVariables } from "../../orm/mutation"; -import type { PlatformInfraSetDataAtPathPayloadSelect, PlatformInfraSetDataAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { PlatformInfraSetDataAtPathVariables } from "../../orm/mutation"; -export type { PlatformInfraSetDataAtPathPayloadSelect } from "../../orm/input-types"; -export function usePlatformInfraSetDataAtPathMutation(params: { - selection: ({ - fields: S & PlatformInfraSetDataAtPathPayloadSelect; - } & HookStrictSelect, PlatformInfraSetDataAtPathPayloadSelect>); -} & Omit | null; -}, Error, PlatformInfraSetDataAtPathVariables>, "mutationFn">): UseMutationResult<{ - platformInfraSetDataAtPath: InferSelectResult | null; -}, Error, PlatformInfraSetDataAtPathVariables> { +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 { PlatformInfraSetDataAtPathVariables } from '../../orm/mutation'; +import type { + PlatformInfraSetDataAtPathPayloadSelect, + PlatformInfraSetDataAtPathPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformInfraSetDataAtPathVariables } from '../../orm/mutation'; +export type { PlatformInfraSetDataAtPathPayloadSelect } from '../../orm/input-types'; +export function usePlatformInfraSetDataAtPathMutation< + S extends PlatformInfraSetDataAtPathPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformInfraSetDataAtPathPayloadSelect; + } & HookStrictSelect, PlatformInfraSetDataAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformInfraSetDataAtPath: InferSelectResult | null; + }, + Error, + PlatformInfraSetDataAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformInfraSetDataAtPath: InferSelectResult | null; + }, + Error, + PlatformInfraSetDataAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInfraSetDataAtPath(), - mutationFn: (variables: PlatformInfraSetDataAtPathVariables) => getClient().mutation.platformInfraSetDataAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: PlatformInfraSetDataAtPathVariables) => + getClient() + .mutation.platformInfraSetDataAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdateDbPresetMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdateDbPresetMutation.ts index 30128b8bcd..3b7a6edec2 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdateDbPresetMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdateDbPresetMutation.ts @@ -4,83 +4,99 @@ * 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 { dbPresetKeys } from "../query-keys"; -import { dbPresetMutationKeys } from "../mutation-keys"; -import type { DbPresetSelect, DbPresetWithRelations, DbPresetPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations, DbPresetPatch } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import { dbPresetMutationKeys } from '../mutation-keys'; +import type { DbPresetSelect, DbPresetWithRelations, DbPresetPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPresetSelect, DbPresetWithRelations, DbPresetPatch } from '../../orm/input-types'; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDbPresetMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', dbPresetPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDbPresetMutation(params: { - selection: ({ - fields: S & DbPresetSelect; - } & HookStrictSelect, DbPresetSelect>); -} & Omit; - }; -}, Error, { - id: string; - dbPresetPatch: DbPresetPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDbPreset: { - dbPreset: InferSelectResult; - }; -}, Error, { - id: string; - dbPresetPatch: DbPresetPatch; -}>; -export function useUpdateDbPresetMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDbPresetMutation( + params: { + selection: { + fields: S & DbPresetSelect; + } & HookStrictSelect, DbPresetSelect>; + } & Omit< + UseMutationOptions< + { + updateDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPresetPatch: DbPresetPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDbPreset: { + dbPreset: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPresetPatch: DbPresetPatch; + } +>; +export function useUpdateDbPresetMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + dbPresetPatch: DbPresetPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetMutationKeys.all, - mutationFn: ({ - id, - dbPresetPatch - }: { - id: string; - dbPresetPatch: DbPresetPatch; - }) => getClient().dbPreset.update({ - where: { - id - }, - data: dbPresetPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, dbPresetPatch }: { id: string; dbPresetPatch: DbPresetPatch }) => + getClient() + .dbPreset.update({ + where: { + id, + }, + data: dbPresetPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: dbPresetKeys.detail(variables.id) + queryKey: dbPresetKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPresetKeys.lists() + queryKey: dbPresetKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdateNamespaceEventMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdateNamespaceEventMutation.ts index e1fcf072cd..c37dff3a26 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdateNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdateNamespaceEventMutation.ts @@ -4,61 +4,88 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import { namespaceEventMutationKeys } from "../mutation-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations, NamespaceEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations, NamespaceEventPatch } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import { namespaceEventMutationKeys } from '../mutation-keys'; +import type { + NamespaceEventSelect, + NamespaceEventWithRelations, + NamespaceEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceEventSelect, + NamespaceEventWithRelations, + NamespaceEventPatch, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateNamespaceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', namespaceEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateNamespaceEventMutation(params: { - selection: ({ - fields: S & NamespaceEventSelect; - } & HookStrictSelect, NamespaceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - namespaceEventPatch: NamespaceEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updateNamespaceEvent: { - namespaceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - namespaceEventPatch: NamespaceEventPatch; -}>; -export function useUpdateNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateNamespaceEventMutation( + params: { + selection: { + fields: S & NamespaceEventSelect; + } & HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + updateNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + namespaceEventPatch: NamespaceEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateNamespaceEvent: { + namespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + namespaceEventPatch: NamespaceEventPatch; + } +>; +export function useUpdateNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + namespaceEventPatch: NamespaceEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateNamespaceEventMutation(params: { mutationFn: ({ id, createdAt, - namespaceEventPatch + namespaceEventPatch, }: { id: string; createdAt: string; namespaceEventPatch: NamespaceEventPatch; - }) => getClient().namespaceEvent.update({ - where: { - id, - createdAt - }, - data: namespaceEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .namespaceEvent.update({ + where: { + id, + createdAt, + }, + data: namespaceEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.detail(variables.id) + queryKey: namespaceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceEventKeys.lists() + queryKey: namespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdateNamespaceMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdateNamespaceMutation.ts index 2f3e6eef5c..564be0dc4d 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdateNamespaceMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdateNamespaceMutation.ts @@ -4,83 +4,107 @@ * 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 { namespaceKeys } from "../query-keys"; -import { namespaceMutationKeys } from "../mutation-keys"; -import type { NamespaceSelect, NamespaceWithRelations, NamespacePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations, NamespacePatch } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import { namespaceMutationKeys } from '../mutation-keys'; +import type { + NamespaceSelect, + NamespaceWithRelations, + NamespacePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceSelect, + NamespaceWithRelations, + NamespacePatch, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateNamespaceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', namespacePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateNamespaceMutation(params: { - selection: ({ - fields: S & NamespaceSelect; - } & HookStrictSelect, NamespaceSelect>); -} & Omit; - }; -}, Error, { - id: string; - namespacePatch: NamespacePatch; -}>, "mutationFn">): UseMutationResult<{ - updateNamespace: { - namespace: InferSelectResult; - }; -}, Error, { - id: string; - namespacePatch: NamespacePatch; -}>; -export function useUpdateNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateNamespaceMutation( + params: { + selection: { + fields: S & NamespaceSelect; + } & HookStrictSelect, NamespaceSelect>; + } & Omit< + UseMutationOptions< + { + updateNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + { + id: string; + namespacePatch: NamespacePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateNamespace: { + namespace: InferSelectResult; + }; + }, + Error, + { + id: string; + namespacePatch: NamespacePatch; + } +>; +export function useUpdateNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + namespacePatch: NamespacePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceMutationKeys.all, - mutationFn: ({ - id, - namespacePatch - }: { - id: string; - namespacePatch: NamespacePatch; - }) => getClient().namespace.update({ - where: { - id - }, - data: namespacePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, namespacePatch }: { id: string; namespacePatch: NamespacePatch }) => + getClient() + .namespace.update({ + where: { + id, + }, + data: namespacePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: namespaceKeys.detail(variables.id) + queryKey: namespaceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceKeys.lists() + queryKey: namespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraCommitMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraCommitMutation.ts index 10372f3529..352d9d725e 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraCommitMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraCommitMutation.ts @@ -4,61 +4,88 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import { platformInfraCommitMutationKeys } from "../mutation-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, PlatformInfraCommitPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, PlatformInfraCommitPatch } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import { platformInfraCommitMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + PlatformInfraCommitPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + PlatformInfraCommitPatch, +} from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformInfraCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformInfraCommitPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformInfraCommitMutation(params: { - selection: ({ - fields: S & PlatformInfraCommitSelect; - } & HookStrictSelect, PlatformInfraCommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraCommitPatch: PlatformInfraCommitPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformInfraCommit: { - platformInfraCommit: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraCommitPatch: PlatformInfraCommitPatch; -}>; -export function useUpdatePlatformInfraCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformInfraCommitMutation( + params: { + selection: { + fields: S & PlatformInfraCommitSelect; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraCommitPatch: PlatformInfraCommitPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformInfraCommit: { + platformInfraCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraCommitPatch: PlatformInfraCommitPatch; + } +>; +export function useUpdatePlatformInfraCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + platformInfraCommitPatch: PlatformInfraCommitPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformInfraCommitMutation(params: { mutationFn: ({ id, scopeId, - platformInfraCommitPatch + platformInfraCommitPatch, }: { id: string; scopeId: string; platformInfraCommitPatch: PlatformInfraCommitPatch; - }) => getClient().platformInfraCommit.update({ - where: { - id, - scopeId - }, - data: platformInfraCommitPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformInfraCommit.update({ + where: { + id, + scopeId, + }, + data: platformInfraCommitPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.detail(variables.id) + queryKey: platformInfraCommitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraCommitKeys.lists() + queryKey: platformInfraCommitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraObjectMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraObjectMutation.ts index 7e3a3952c0..95ba3993cf 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraObjectMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraObjectMutation.ts @@ -4,61 +4,88 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import { platformInfraObjectMutationKeys } from "../mutation-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, PlatformInfraObjectPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, PlatformInfraObjectPatch } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import { platformInfraObjectMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + PlatformInfraObjectPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + PlatformInfraObjectPatch, +} from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformInfraObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformInfraObjectPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformInfraObjectMutation(params: { - selection: ({ - fields: S & PlatformInfraObjectSelect; - } & HookStrictSelect, PlatformInfraObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraObjectPatch: PlatformInfraObjectPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformInfraObject: { - platformInfraObject: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraObjectPatch: PlatformInfraObjectPatch; -}>; -export function useUpdatePlatformInfraObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformInfraObjectMutation( + params: { + selection: { + fields: S & PlatformInfraObjectSelect; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraObjectPatch: PlatformInfraObjectPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformInfraObject: { + platformInfraObject: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraObjectPatch: PlatformInfraObjectPatch; + } +>; +export function useUpdatePlatformInfraObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + platformInfraObjectPatch: PlatformInfraObjectPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformInfraObjectMutation(params: { mutationFn: ({ id, scopeId, - platformInfraObjectPatch + platformInfraObjectPatch, }: { id: string; scopeId: string; platformInfraObjectPatch: PlatformInfraObjectPatch; - }) => getClient().platformInfraObject.update({ - where: { - id, - scopeId - }, - data: platformInfraObjectPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformInfraObject.update({ + where: { + id, + scopeId, + }, + data: platformInfraObjectPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.detail(variables.id) + queryKey: platformInfraObjectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraObjectKeys.lists() + queryKey: platformInfraObjectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraRefMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraRefMutation.ts index c1d8352105..081a40d0f4 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraRefMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraRefMutation.ts @@ -4,61 +4,88 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import { platformInfraRefMutationKeys } from "../mutation-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, PlatformInfraRefPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, PlatformInfraRefPatch } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import { platformInfraRefMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + PlatformInfraRefPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + PlatformInfraRefPatch, +} from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformInfraRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformInfraRefPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformInfraRefMutation(params: { - selection: ({ - fields: S & PlatformInfraRefSelect; - } & HookStrictSelect, PlatformInfraRefSelect>); -} & Omit; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraRefPatch: PlatformInfraRefPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformInfraRef: { - platformInfraRef: InferSelectResult; - }; -}, Error, { - id: string; - scopeId: string; - platformInfraRefPatch: PlatformInfraRefPatch; -}>; -export function useUpdatePlatformInfraRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformInfraRefMutation( + params: { + selection: { + fields: S & PlatformInfraRefSelect; + } & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraRefPatch: PlatformInfraRefPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformInfraRef: { + platformInfraRef: InferSelectResult; + }; + }, + Error, + { + id: string; + scopeId: string; + platformInfraRefPatch: PlatformInfraRefPatch; + } +>; +export function useUpdatePlatformInfraRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + scopeId: string; + platformInfraRefPatch: PlatformInfraRefPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformInfraRefMutation(params: { mutationFn: ({ id, scopeId, - platformInfraRefPatch + platformInfraRefPatch, }: { id: string; scopeId: string; platformInfraRefPatch: PlatformInfraRefPatch; - }) => getClient().platformInfraRef.update({ - where: { - id, - scopeId - }, - data: platformInfraRefPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformInfraRef.update({ + where: { + id, + scopeId, + }, + data: platformInfraRefPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.detail(variables.id) + queryKey: platformInfraRefKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraRefKeys.lists() + queryKey: platformInfraRefKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraStoreMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraStoreMutation.ts index cde6095f16..ada46aa80d 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraStoreMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformInfraStoreMutation.ts @@ -4,83 +4,113 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import { platformInfraStoreMutationKeys } from "../mutation-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, PlatformInfraStorePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, PlatformInfraStorePatch } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import { platformInfraStoreMutationKeys } from '../mutation-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + PlatformInfraStorePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + PlatformInfraStorePatch, +} from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformInfraStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformInfraStorePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformInfraStoreMutation(params: { - selection: ({ - fields: S & PlatformInfraStoreSelect; - } & HookStrictSelect, PlatformInfraStoreSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformInfraStorePatch: PlatformInfraStorePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformInfraStore: { - platformInfraStore: InferSelectResult; - }; -}, Error, { - id: string; - platformInfraStorePatch: PlatformInfraStorePatch; -}>; -export function useUpdatePlatformInfraStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformInfraStoreMutation( + params: { + selection: { + fields: S & PlatformInfraStoreSelect; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + platformInfraStorePatch: PlatformInfraStorePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformInfraStore: { + platformInfraStore: InferSelectResult; + }; + }, + Error, + { + id: string; + platformInfraStorePatch: PlatformInfraStorePatch; + } +>; +export function useUpdatePlatformInfraStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformInfraStorePatch: PlatformInfraStorePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformInfraStoreMutationKeys.all, mutationFn: ({ id, - platformInfraStorePatch + platformInfraStorePatch, }: { id: string; platformInfraStorePatch: PlatformInfraStorePatch; - }) => getClient().platformInfraStore.update({ - where: { - id - }, - data: platformInfraStorePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformInfraStore.update({ + where: { + id, + }, + data: platformInfraStorePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.detail(variables.id) + queryKey: platformInfraStoreKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformInfraStoreKeys.lists() + queryKey: platformInfraStoreKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformNamespaceEventMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformNamespaceEventMutation.ts index 85c7f4452d..9ca416fd9c 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformNamespaceEventMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformNamespaceEventMutation.ts @@ -4,61 +4,88 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import { platformNamespaceEventMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, PlatformNamespaceEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, PlatformNamespaceEventPatch } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import { platformNamespaceEventMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventPatch, +} from '../../orm/input-types'; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformNamespaceEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformNamespaceEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformNamespaceEventMutation(params: { - selection: ({ - fields: S & PlatformNamespaceEventSelect; - } & HookStrictSelect, PlatformNamespaceEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - platformNamespaceEventPatch: PlatformNamespaceEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformNamespaceEvent: { - platformNamespaceEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - platformNamespaceEventPatch: PlatformNamespaceEventPatch; -}>; -export function useUpdatePlatformNamespaceEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformNamespaceEventMutation( + params: { + selection: { + fields: S & PlatformNamespaceEventSelect; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformNamespaceEventPatch: PlatformNamespaceEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + platformNamespaceEventPatch: PlatformNamespaceEventPatch; + } +>; +export function useUpdatePlatformNamespaceEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + platformNamespaceEventPatch: PlatformNamespaceEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdatePlatformNamespaceEventMutation(params: { mutationFn: ({ id, createdAt, - platformNamespaceEventPatch + platformNamespaceEventPatch, }: { id: string; createdAt: string; platformNamespaceEventPatch: PlatformNamespaceEventPatch; - }) => getClient().platformNamespaceEvent.update({ - where: { - id, - createdAt - }, - data: platformNamespaceEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformNamespaceEvent.update({ + where: { + id, + createdAt, + }, + data: platformNamespaceEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.detail(variables.id) + queryKey: platformNamespaceEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformNamespaceEventKeys.lists() + queryKey: platformNamespaceEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformNamespaceMutation.ts b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformNamespaceMutation.ts index f09f6cd414..de626ae084 100644 --- a/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformNamespaceMutation.ts +++ b/sdk/constructive-react/src/infra/hooks/mutations/useUpdatePlatformNamespaceMutation.ts @@ -4,83 +4,113 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import { platformNamespaceMutationKeys } from "../mutation-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, PlatformNamespacePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, PlatformNamespacePatch } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import { platformNamespaceMutationKeys } from '../mutation-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + PlatformNamespacePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + PlatformNamespacePatch, +} from '../../orm/input-types'; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlatformNamespaceMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', platformNamespacePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlatformNamespaceMutation(params: { - selection: ({ - fields: S & PlatformNamespaceSelect; - } & HookStrictSelect, PlatformNamespaceSelect>); -} & Omit; - }; -}, Error, { - id: string; - platformNamespacePatch: PlatformNamespacePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlatformNamespace: { - platformNamespace: InferSelectResult; - }; -}, Error, { - id: string; - platformNamespacePatch: PlatformNamespacePatch; -}>; -export function useUpdatePlatformNamespaceMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlatformNamespaceMutation( + params: { + selection: { + fields: S & PlatformNamespaceSelect; + } & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + { + id: string; + platformNamespacePatch: PlatformNamespacePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }, + Error, + { + id: string; + platformNamespacePatch: PlatformNamespacePatch; + } +>; +export function useUpdatePlatformNamespaceMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformNamespacePatch: PlatformNamespacePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: platformNamespaceMutationKeys.all, mutationFn: ({ id, - platformNamespacePatch + platformNamespacePatch, }: { id: string; platformNamespacePatch: PlatformNamespacePatch; - }) => getClient().platformNamespace.update({ - where: { - id - }, - data: platformNamespacePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .platformNamespace.update({ + where: { + id, + }, + data: platformNamespacePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.detail(variables.id) + queryKey: platformNamespaceKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: platformNamespaceKeys.lists() + queryKey: platformNamespaceKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/index.ts b/sdk/constructive-react/src/infra/hooks/queries/index.ts index 56e7345e11..ea745c45ed 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/index.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/index.ts @@ -3,22 +3,22 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useDbPresetsQuery"; -export * from "./useDbPresetQuery"; -export * from "./useNamespacesQuery"; -export * from "./useNamespaceQuery"; -export * from "./useNamespaceEventsQuery"; -export * from "./useNamespaceEventQuery"; -export * from "./usePlatformInfraCommitsQuery"; -export * from "./usePlatformInfraCommitQuery"; -export * from "./usePlatformInfraGetAllTreeNodesQuery"; -export * from "./usePlatformInfraObjectsQuery"; -export * from "./usePlatformInfraObjectQuery"; -export * from "./usePlatformInfraRefsQuery"; -export * from "./usePlatformInfraRefQuery"; -export * from "./usePlatformInfraStoresQuery"; -export * from "./usePlatformInfraStoreQuery"; -export * from "./usePlatformNamespacesQuery"; -export * from "./usePlatformNamespaceQuery"; -export * from "./usePlatformNamespaceEventsQuery"; -export * from "./usePlatformNamespaceEventQuery"; \ No newline at end of file +export * from './useDbPresetsQuery'; +export * from './useDbPresetQuery'; +export * from './useNamespacesQuery'; +export * from './useNamespaceQuery'; +export * from './useNamespaceEventsQuery'; +export * from './useNamespaceEventQuery'; +export * from './usePlatformInfraCommitsQuery'; +export * from './usePlatformInfraCommitQuery'; +export * from './usePlatformInfraGetAllTreeNodesQuery'; +export * from './usePlatformInfraObjectsQuery'; +export * from './usePlatformInfraObjectQuery'; +export * from './usePlatformInfraRefsQuery'; +export * from './usePlatformInfraRefQuery'; +export * from './usePlatformInfraStoresQuery'; +export * from './usePlatformInfraStoreQuery'; +export * from './usePlatformNamespacesQuery'; +export * from './usePlatformNamespaceQuery'; +export * from './usePlatformNamespaceEventsQuery'; +export * from './usePlatformNamespaceEventQuery'; diff --git a/sdk/constructive-react/src/infra/hooks/queries/useDbPresetQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/useDbPresetQuery.ts index f4a5621477..73c6743a01 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/useDbPresetQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/useDbPresetQuery.ts @@ -4,20 +4,20 @@ * 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 { dbPresetKeys } from "../query-keys"; -import type { DbPresetSelect, DbPresetWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import type { DbPresetSelect, DbPresetWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPresetSelect, DbPresetWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPresetQueryKey = dbPresetKeys.detail; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { data, isLoading } = useDbPresetQuery({ @@ -26,38 +26,52 @@ export const dbPresetQueryKey = dbPresetKeys.detail; * }); * ``` */ -export function useDbPresetQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPresetSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPresetQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDbPresetQuery< + S extends DbPresetSelect, + TData = { + dbPreset: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPresetSelect>; + } & Omit< + UseQueryOptions< + { + dbPreset: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPresetQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPresetKeys.detail(params.id), - queryFn: () => getClient().dbPreset.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .dbPreset.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```ts * const data = await fetchDbPresetQuery({ @@ -79,35 +93,46 @@ export async function fetchDbPresetQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().dbPreset.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .dbPreset.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```ts * await prefetchDbPresetQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDbPresetQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPresetSelect>; -}): Promise; -export async function prefetchDbPresetQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDbPresetQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPresetSelect>; + } +): Promise; +export async function prefetchDbPresetQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: dbPresetKeys.detail(params.id), - queryFn: () => getClient().dbPreset.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .dbPreset.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/useDbPresetsQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/useDbPresetsQuery.ts index 17f3ecabf1..1aa1bdb140 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/useDbPresetsQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/useDbPresetsQuery.ts @@ -4,20 +4,35 @@ * 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 { dbPresetKeys } from "../query-keys"; -import type { DbPresetSelect, DbPresetWithRelations, DbPresetFilter, DbPresetOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetSelect, DbPresetWithRelations, DbPresetFilter, DbPresetOrderBy } from "../../orm/input-types"; +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 { dbPresetKeys } from '../query-keys'; +import type { + DbPresetSelect, + DbPresetWithRelations, + DbPresetFilter, + DbPresetOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DbPresetSelect, + DbPresetWithRelations, + DbPresetFilter, + DbPresetOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPresetsQueryKey = dbPresetKeys.list; /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```tsx * const { data, isLoading } = useDbPresetsQuery({ @@ -30,33 +45,47 @@ export const dbPresetsQueryKey = dbPresetKeys.list; * }); * ``` */ -export function useDbPresetsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPresetsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDbPresetsQuery< + S extends DbPresetSelect, + TData = { + dbPresets: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetSelect>; + } & Omit< + UseQueryOptions< + { + dbPresets: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPresetsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPresetKeys.list(args), queryFn: () => getClient().dbPreset.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```ts * const data = await fetchDbPresetsQuery({ @@ -70,35 +99,47 @@ export function useDbPresetsQuery(params: { export async function fetchDbPresetsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetSelect>; }): Promise<{ dbPresets: ConnectionResult>; }>; export async function fetchDbPresetsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().dbPreset.findMany(args).unwrap(); } /** * Database provisioning preset catalog — merkle-versioned head over the infra store - * + * * @example * ```ts * await prefetchDbPresetsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDbPresetsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetSelect>; -}): Promise; -export async function prefetchDbPresetsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDbPresetsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetSelect>; + } +): Promise; +export async function prefetchDbPresetsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: dbPresetKeys.list(args), - queryFn: () => getClient().dbPreset.findMany(args).unwrap() + queryFn: () => getClient().dbPreset.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/useNamespaceEventQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/useNamespaceEventQuery.ts index 044fe5c8b3..9206e4efee 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/useNamespaceEventQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/useNamespaceEventQuery.ts @@ -4,20 +4,20 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import type { NamespaceEventSelect, NamespaceEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceEventSelect, NamespaceEventWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespaceEventQueryKey = namespaceEventKeys.detail; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { data, isLoading } = useNamespaceEventQuery({ @@ -26,38 +26,52 @@ export const namespaceEventQueryKey = namespaceEventKeys.detail; * }); * ``` */ -export function useNamespaceEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespaceEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useNamespaceEventQuery< + S extends NamespaceEventSelect, + TData = { + namespaceEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseQueryOptions< + { + namespaceEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespaceEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceEventKeys.detail(params.id), - queryFn: () => getClient().namespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .namespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * const data = await fetchNamespaceEventQuery({ @@ -79,35 +93,46 @@ export async function fetchNamespaceEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().namespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .namespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * await prefetchNamespaceEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchNamespaceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceEventSelect>; -}): Promise; -export async function prefetchNamespaceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchNamespaceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceEventSelect>; + } +): Promise; +export async function prefetchNamespaceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: namespaceEventKeys.detail(params.id), - queryFn: () => getClient().namespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .namespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/useNamespaceEventsQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/useNamespaceEventsQuery.ts index c1f828314f..ba942976cf 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/useNamespaceEventsQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/useNamespaceEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { namespaceEventKeys } from "../query-keys"; -import type { NamespaceEventSelect, NamespaceEventWithRelations, NamespaceEventFilter, NamespaceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceEventSelect, NamespaceEventWithRelations, NamespaceEventFilter, NamespaceEventOrderBy } from "../../orm/input-types"; +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 { namespaceEventKeys } from '../query-keys'; +import type { + NamespaceEventSelect, + NamespaceEventWithRelations, + NamespaceEventFilter, + NamespaceEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + NamespaceEventSelect, + NamespaceEventWithRelations, + NamespaceEventFilter, + NamespaceEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespaceEventsQueryKey = namespaceEventKeys.list; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { data, isLoading } = useNamespaceEventsQuery({ @@ -30,33 +45,53 @@ export const namespaceEventsQueryKey = namespaceEventKeys.list; * }); * ``` */ -export function useNamespaceEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespaceEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useNamespaceEventsQuery< + S extends NamespaceEventSelect, + TData = { + namespaceEvents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceEventSelect>; + } & Omit< + UseQueryOptions< + { + namespaceEvents: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespaceEventsQuery( + params: { + selection: ListSelectionConfig< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceEventKeys.list(args), queryFn: () => getClient().namespaceEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * const data = await fetchNamespaceEventsQuery({ @@ -70,35 +105,55 @@ export function useNamespaceEventsQuery(params: { export async function fetchNamespaceEventsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceEventSelect>; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceEventSelect>; }): Promise<{ namespaceEvents: ConnectionResult>; }>; export async function fetchNamespaceEventsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >(params.selection); return getClient().namespaceEvent.findMany(args).unwrap(); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * await prefetchNamespaceEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchNamespaceEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceEventSelect>; -}): Promise; -export async function prefetchNamespaceEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchNamespaceEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceEventSelect>; + } +): Promise; +export async function prefetchNamespaceEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: namespaceEventKeys.list(args), - queryFn: () => getClient().namespaceEvent.findMany(args).unwrap() + queryFn: () => getClient().namespaceEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/useNamespaceQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/useNamespaceQuery.ts index 5a1f0dae7b..ffd1130133 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/useNamespaceQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/useNamespaceQuery.ts @@ -4,20 +4,20 @@ * 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 { namespaceKeys } from "../query-keys"; -import type { NamespaceSelect, NamespaceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import type { NamespaceSelect, NamespaceWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceSelect, NamespaceWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespaceQueryKey = namespaceKeys.detail; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { data, isLoading } = useNamespaceQuery({ @@ -26,38 +26,52 @@ export const namespaceQueryKey = namespaceKeys.detail; * }); * ``` */ -export function useNamespaceQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespaceQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useNamespaceQuery< + S extends NamespaceSelect, + TData = { + namespace: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceSelect>; + } & Omit< + UseQueryOptions< + { + namespace: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespaceQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceKeys.detail(params.id), - queryFn: () => getClient().namespace.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .namespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * const data = await fetchNamespaceQuery({ @@ -79,35 +93,46 @@ export async function fetchNamespaceQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().namespace.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .namespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * await prefetchNamespaceQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchNamespaceQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceSelect>; -}): Promise; -export async function prefetchNamespaceQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchNamespaceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceSelect>; + } +): Promise; +export async function prefetchNamespaceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: namespaceKeys.detail(params.id), - queryFn: () => getClient().namespace.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .namespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/useNamespacesQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/useNamespacesQuery.ts index eef6ff4100..291ce7dbd6 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/useNamespacesQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/useNamespacesQuery.ts @@ -4,20 +4,35 @@ * 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 { namespaceKeys } from "../query-keys"; -import type { NamespaceSelect, NamespaceWithRelations, NamespaceFilter, NamespaceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceSelect, NamespaceWithRelations, NamespaceFilter, NamespaceOrderBy } from "../../orm/input-types"; +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 { namespaceKeys } from '../query-keys'; +import type { + NamespaceSelect, + NamespaceWithRelations, + NamespaceFilter, + NamespaceOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + NamespaceSelect, + NamespaceWithRelations, + NamespaceFilter, + NamespaceOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespacesQueryKey = namespaceKeys.list; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { data, isLoading } = useNamespacesQuery({ @@ -30,33 +45,47 @@ export const namespacesQueryKey = namespaceKeys.list; * }); * ``` */ -export function useNamespacesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespacesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useNamespacesQuery< + S extends NamespaceSelect, + TData = { + namespaces: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceSelect>; + } & Omit< + UseQueryOptions< + { + namespaces: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespacesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceKeys.list(args), queryFn: () => getClient().namespace.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * const data = await fetchNamespacesQuery({ @@ -70,35 +99,47 @@ export function useNamespacesQuery(params: { export async function fetchNamespacesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceSelect>; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceSelect>; }): Promise<{ namespaces: ConnectionResult>; }>; export async function fetchNamespacesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().namespace.findMany(args).unwrap(); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * await prefetchNamespacesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchNamespacesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceSelect>; -}): Promise; -export async function prefetchNamespacesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchNamespacesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceSelect>; + } +): Promise; +export async function prefetchNamespacesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: namespaceKeys.list(args), - queryFn: () => getClient().namespace.findMany(args).unwrap() + queryFn: () => getClient().namespace.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraCommitQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraCommitQuery.ts index b158df5fac..bd0d25a147 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraCommitQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraCommitQuery.ts @@ -4,20 +4,26 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraCommitQueryKey = platformInfraCommitKeys.detail; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraCommitQuery({ @@ -26,38 +32,52 @@ export const platformInfraCommitQueryKey = platformInfraCommitKeys.detail; * }); * ``` */ -export function usePlatformInfraCommitQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraCommitSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraCommitQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInfraCommitQuery< + S extends PlatformInfraCommitSelect, + TData = { + platformInfraCommit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraCommit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraCommitQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraCommitKeys.detail(params.id), - queryFn: () => getClient().platformInfraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInfraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchPlatformInfraCommitQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformInfraCommitQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInfraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInfraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchPlatformInfraCommitQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInfraCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraCommitSelect>; -}): Promise; -export async function prefetchPlatformInfraCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInfraCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraCommitSelect>; + } +): Promise; +export async function prefetchPlatformInfraCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraCommitKeys.detail(params.id), - queryFn: () => getClient().platformInfraCommit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInfraCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraCommitsQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraCommitsQuery.ts index 0a943e49ba..bebab98fce 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraCommitsQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraCommitsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraCommitKeys } from "../query-keys"; -import type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraCommitSelect, PlatformInfraCommitWithRelations, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy } from "../../orm/input-types"; +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 { platformInfraCommitKeys } from '../query-keys'; +import type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraCommitSelect, + PlatformInfraCommitWithRelations, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraCommitsQueryKey = platformInfraCommitKeys.list; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraCommitsQuery({ @@ -30,33 +45,58 @@ export const platformInfraCommitsQueryKey = platformInfraCommitKeys.list; * }); * ``` */ -export function usePlatformInfraCommitsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraCommitSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraCommitsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraCommitsQuery< + S extends PlatformInfraCommitSelect, + TData = { + platformInfraCommits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraCommits: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraCommitsQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraCommitKeys.list(args), queryFn: () => getClient().platformInfraCommit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchPlatformInfraCommitsQuery({ @@ -70,35 +110,65 @@ export function usePlatformInfraCommitsQuery(params: { export async function fetchPlatformInfraCommitsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraCommitSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraCommitSelect>; }): Promise<{ platformInfraCommits: ConnectionResult>; }>; export async function fetchPlatformInfraCommitsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >(params.selection); return getClient().platformInfraCommit.findMany(args).unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchPlatformInfraCommitsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraCommitsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraCommitSelect>; -}): Promise; -export async function prefetchPlatformInfraCommitsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraCommitsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraCommitSelect>; + } +): Promise; +export async function prefetchPlatformInfraCommitsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraCommitKeys.list(args), - queryFn: () => getClient().platformInfraCommit.findMany(args).unwrap() + queryFn: () => getClient().platformInfraCommit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraGetAllTreeNodesQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraGetAllTreeNodesQuery.ts index c847912e69..558fe2f081 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraGetAllTreeNodesQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraGetAllTreeNodesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraGetAllTreeNodesRecordKeys } from "../query-keys"; -import type { PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; +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 { platformInfraGetAllTreeNodesRecordKeys } from '../query-keys'; +import type { + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraGetAllTreeNodesQueryKey = platformInfraGetAllTreeNodesRecordKeys.list; /** * Query hook for fetching PlatformInfraGetAllTreeNodesRecord list - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraGetAllTreeNodesQuery({ @@ -30,33 +45,64 @@ export const platformInfraGetAllTreeNodesQueryKey = platformInfraGetAllTreeNodes * }); * ``` */ -export function usePlatformInfraGetAllTreeNodesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraGetAllTreeNodesQuery< + S extends PlatformInfraGetAllTreeNodesRecordSelect, + TData = { + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraGetAllTreeNodesQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraGetAllTreeNodesRecordKeys.list(args), queryFn: () => getClient().platformInfraGetAllTreeNodesRecord.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlatformInfraGetAllTreeNodesRecord list without React hooks - * + * * @example * ```ts * const data = await fetchPlatformInfraGetAllTreeNodesQuery({ @@ -67,38 +113,82 @@ export function usePlatformInfraGetAllTreeNodesQuery(params: { * }); * ``` */ -export async function fetchPlatformInfraGetAllTreeNodesQuery(params: { +export async function fetchPlatformInfraGetAllTreeNodesQuery< + S extends PlatformInfraGetAllTreeNodesRecordSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; + } & Omit< + ListSelectionConfig< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; }): Promise<{ - platformInfraGetAllTreeNodes: ConnectionResult>; + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformInfraGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >(params.selection); return getClient().platformInfraGetAllTreeNodesRecord.findMany(args).unwrap(); } /** * Prefetch PlatformInfraGetAllTreeNodesRecord list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlatformInfraGetAllTreeNodesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; -}): Promise; -export async function prefetchPlatformInfraGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraGetAllTreeNodesQuery< + S extends PlatformInfraGetAllTreeNodesRecordSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >, + 'fields' + > & + HookStrictSelect, PlatformInfraGetAllTreeNodesRecordSelect>; + } +): Promise; +export async function prefetchPlatformInfraGetAllTreeNodesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraGetAllTreeNodesRecordKeys.list(args), - queryFn: () => getClient().platformInfraGetAllTreeNodesRecord.findMany(args).unwrap() + queryFn: () => getClient().platformInfraGetAllTreeNodesRecord.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraObjectQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraObjectQuery.ts index adfcfb1c63..f3e5bdd938 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraObjectQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraObjectQuery.ts @@ -4,20 +4,26 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraGetNodeAtPathQueryKey = platformInfraObjectKeys.detail; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraObjectQuery({ @@ -26,38 +32,52 @@ export const platformInfraGetNodeAtPathQueryKey = platformInfraObjectKeys.detail * }); * ``` */ -export function usePlatformInfraObjectQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraObjectSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraObjectQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInfraObjectQuery< + S extends PlatformInfraObjectSelect, + TData = { + platformInfraGetNodeAtPath: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraGetNodeAtPath: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraObjectQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraObjectKeys.detail(params.id), - queryFn: () => getClient().platformInfraObject.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInfraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchPlatformInfraObjectQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformInfraObjectQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInfraObject.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInfraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchPlatformInfraObjectQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInfraObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraObjectSelect>; -}): Promise; -export async function prefetchPlatformInfraObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInfraObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraObjectSelect>; + } +): Promise; +export async function prefetchPlatformInfraObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraObjectKeys.detail(params.id), - queryFn: () => getClient().platformInfraObject.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInfraObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraObjectsQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraObjectsQuery.ts index 9404057e6b..ea51820b7b 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraObjectsQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraObjectsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraObjectKeys } from "../query-keys"; -import type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraObjectSelect, PlatformInfraObjectWithRelations, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy } from "../../orm/input-types"; +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 { platformInfraObjectKeys } from '../query-keys'; +import type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraObjectSelect, + PlatformInfraObjectWithRelations, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraObjectsQueryKey = platformInfraObjectKeys.list; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraObjectsQuery({ @@ -30,33 +45,58 @@ export const platformInfraObjectsQueryKey = platformInfraObjectKeys.list; * }); * ``` */ -export function usePlatformInfraObjectsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraObjectSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraObjectsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraObjectsQuery< + S extends PlatformInfraObjectSelect, + TData = { + platformInfraObjects: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraObjects: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraObjectsQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraObjectKeys.list(args), queryFn: () => getClient().platformInfraObject.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchPlatformInfraObjectsQuery({ @@ -70,35 +110,65 @@ export function usePlatformInfraObjectsQuery(params: { export async function fetchPlatformInfraObjectsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraObjectSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraObjectSelect>; }): Promise<{ platformInfraObjects: ConnectionResult>; }>; export async function fetchPlatformInfraObjectsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >(params.selection); return getClient().platformInfraObject.findMany(args).unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchPlatformInfraObjectsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraObjectsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraObjectSelect>; -}): Promise; -export async function prefetchPlatformInfraObjectsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraObjectsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraObjectSelect>; + } +): Promise; +export async function prefetchPlatformInfraObjectsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraObjectKeys.list(args), - queryFn: () => getClient().platformInfraObject.findMany(args).unwrap() + queryFn: () => getClient().platformInfraObject.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraRefQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraRefQuery.ts index 3b4c58060b..4421bd3010 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraRefQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraRefQuery.ts @@ -4,20 +4,20 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraRefQueryKey = platformInfraRefKeys.detail; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraRefQuery({ @@ -26,38 +26,52 @@ export const platformInfraRefQueryKey = platformInfraRefKeys.detail; * }); * ``` */ -export function usePlatformInfraRefQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraRefSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraRefQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInfraRefQuery< + S extends PlatformInfraRefSelect, + TData = { + platformInfraRef: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraRef: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraRefQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraRefKeys.detail(params.id), - queryFn: () => getClient().platformInfraRef.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInfraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchPlatformInfraRefQuery({ @@ -79,35 +93,46 @@ export async function fetchPlatformInfraRefQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInfraRef.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInfraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchPlatformInfraRefQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInfraRefQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraRefSelect>; -}): Promise; -export async function prefetchPlatformInfraRefQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInfraRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraRefSelect>; + } +): Promise; +export async function prefetchPlatformInfraRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraRefKeys.detail(params.id), - queryFn: () => getClient().platformInfraRef.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInfraRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraRefsQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraRefsQuery.ts index 7277477566..00d161821b 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraRefsQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraRefsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraRefKeys } from "../query-keys"; -import type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, PlatformInfraRefFilter, PlatformInfraRefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraRefSelect, PlatformInfraRefWithRelations, PlatformInfraRefFilter, PlatformInfraRefOrderBy } from "../../orm/input-types"; +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 { platformInfraRefKeys } from '../query-keys'; +import type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraRefSelect, + PlatformInfraRefWithRelations, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraRefsQueryKey = platformInfraRefKeys.list; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraRefsQuery({ @@ -30,33 +45,53 @@ export const platformInfraRefsQueryKey = platformInfraRefKeys.list; * }); * ``` */ -export function usePlatformInfraRefsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraRefSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraRefsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraRefsQuery< + S extends PlatformInfraRefSelect, + TData = { + platformInfraRefs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformInfraRefSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraRefs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraRefsQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraRefKeys.list(args), queryFn: () => getClient().platformInfraRef.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchPlatformInfraRefsQuery({ @@ -70,35 +105,59 @@ export function usePlatformInfraRefsQuery(params: { export async function fetchPlatformInfraRefsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraRefSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformInfraRefSelect>; }): Promise<{ platformInfraRefs: ConnectionResult>; }>; export async function fetchPlatformInfraRefsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >(params.selection); return getClient().platformInfraRef.findMany(args).unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchPlatformInfraRefsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraRefsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraRefSelect>; -}): Promise; -export async function prefetchPlatformInfraRefsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraRefsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformInfraRefSelect>; + } +): Promise; +export async function prefetchPlatformInfraRefsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraRefKeys.list(args), - queryFn: () => getClient().platformInfraRef.findMany(args).unwrap() + queryFn: () => getClient().platformInfraRef.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraStoreQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraStoreQuery.ts index 4c98746c37..de3ae8a8ac 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraStoreQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraStoreQuery.ts @@ -4,20 +4,26 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraStoreQueryKey = platformInfraStoreKeys.detail; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraStoreQuery({ @@ -26,38 +32,52 @@ export const platformInfraStoreQueryKey = platformInfraStoreKeys.detail; * }); * ``` */ -export function usePlatformInfraStoreQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraStoreSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraStoreQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformInfraStoreQuery< + S extends PlatformInfraStoreSelect, + TData = { + platformInfraStore: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraStore: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraStoreQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraStoreKeys.detail(params.id), - queryFn: () => getClient().platformInfraStore.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformInfraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchPlatformInfraStoreQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformInfraStoreQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformInfraStore.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformInfraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchPlatformInfraStoreQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformInfraStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformInfraStoreSelect>; -}): Promise; -export async function prefetchPlatformInfraStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformInfraStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformInfraStoreSelect>; + } +): Promise; +export async function prefetchPlatformInfraStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraStoreKeys.detail(params.id), - queryFn: () => getClient().platformInfraStore.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformInfraStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraStoresQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraStoresQuery.ts index 9f0b76f788..8b7fb24bcf 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraStoresQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformInfraStoresQuery.ts @@ -4,20 +4,35 @@ * 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 { platformInfraStoreKeys } from "../query-keys"; -import type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformInfraStoreSelect, PlatformInfraStoreWithRelations, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy } from "../../orm/input-types"; +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 { platformInfraStoreKeys } from '../query-keys'; +import type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformInfraStoreSelect, + PlatformInfraStoreWithRelations, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformInfraStoresQueryKey = platformInfraStoreKeys.list; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = usePlatformInfraStoresQuery({ @@ -30,33 +45,58 @@ export const platformInfraStoresQueryKey = platformInfraStoreKeys.list; * }); * ``` */ -export function usePlatformInfraStoresQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraStoreSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformInfraStoresQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformInfraStoresQuery< + S extends PlatformInfraStoreSelect, + TData = { + platformInfraStores: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit< + UseQueryOptions< + { + platformInfraStores: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformInfraStoresQuery( + params: { + selection: ListSelectionConfig< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformInfraStoreKeys.list(args), queryFn: () => getClient().platformInfraStore.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchPlatformInfraStoresQuery({ @@ -70,35 +110,62 @@ export function usePlatformInfraStoresQuery(params: { export async function fetchPlatformInfraStoresQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraStoreSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformInfraStoreSelect>; }): Promise<{ platformInfraStores: ConnectionResult>; }>; export async function fetchPlatformInfraStoresQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >(params.selection); return getClient().platformInfraStore.findMany(args).unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchPlatformInfraStoresQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformInfraStoresQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformInfraStoreSelect>; -}): Promise; -export async function prefetchPlatformInfraStoresQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformInfraStoresQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformInfraStoreSelect>; + } +): Promise; +export async function prefetchPlatformInfraStoresQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformInfraStoreKeys.list(args), - queryFn: () => getClient().platformInfraStore.findMany(args).unwrap() + queryFn: () => getClient().platformInfraStore.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceEventQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceEventQuery.ts index ce016b7930..7801c80b9e 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceEventQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceEventQuery.ts @@ -4,20 +4,26 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformNamespaceEventQueryKey = platformNamespaceEventKeys.detail; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { data, isLoading } = usePlatformNamespaceEventQuery({ @@ -26,38 +32,52 @@ export const platformNamespaceEventQueryKey = platformNamespaceEventKeys.detail; * }); * ``` */ -export function usePlatformNamespaceEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformNamespaceEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformNamespaceEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformNamespaceEventQuery< + S extends PlatformNamespaceEventSelect, + TData = { + platformNamespaceEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseQueryOptions< + { + platformNamespaceEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformNamespaceEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformNamespaceEventKeys.detail(params.id), - queryFn: () => getClient().platformNamespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformNamespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * const data = await fetchPlatformNamespaceEventQuery({ @@ -66,7 +86,9 @@ export function usePlatformNamespaceEventQuery(params: { * }); * ``` */ -export async function fetchPlatformNamespaceEventQuery(params: { +export async function fetchPlatformNamespaceEventQuery< + S extends PlatformNamespaceEventSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchPlatformNamespaceEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformNamespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformNamespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * await prefetchPlatformNamespaceEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformNamespaceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformNamespaceEventSelect>; -}): Promise; -export async function prefetchPlatformNamespaceEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformNamespaceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformNamespaceEventSelect>; + } +): Promise; +export async function prefetchPlatformNamespaceEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformNamespaceEventKeys.detail(params.id), - queryFn: () => getClient().platformNamespaceEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformNamespaceEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceEventsQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceEventsQuery.ts index de7b7a36af..1d906fbe67 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceEventsQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { platformNamespaceEventKeys } from "../query-keys"; -import type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceEventSelect, PlatformNamespaceEventWithRelations, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy } from "../../orm/input-types"; +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 { platformNamespaceEventKeys } from '../query-keys'; +import type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformNamespaceEventSelect, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformNamespaceEventsQueryKey = platformNamespaceEventKeys.list; /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```tsx * const { data, isLoading } = usePlatformNamespaceEventsQuery({ @@ -30,33 +45,60 @@ export const platformNamespaceEventsQueryKey = platformNamespaceEventKeys.list; * }); * ``` */ -export function usePlatformNamespaceEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformNamespaceEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformNamespaceEventsQuery< + S extends PlatformNamespaceEventSelect, + TData = { + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + UseQueryOptions< + { + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformNamespaceEventsQuery( + params: { + selection: ListSelectionConfig< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformNamespaceEventKeys.list(args), queryFn: () => getClient().platformNamespaceEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * const data = await fetchPlatformNamespaceEventsQuery({ @@ -67,38 +109,72 @@ export function usePlatformNamespaceEventsQuery(params: { * }); * ``` */ -export async function fetchPlatformNamespaceEventsQuery(params: { +export async function fetchPlatformNamespaceEventsQuery< + S extends PlatformNamespaceEventSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceEventSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformNamespaceEventSelect>; }): Promise<{ - platformNamespaceEvents: ConnectionResult>; + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; }>; export async function fetchPlatformNamespaceEventsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >(params.selection); return getClient().platformNamespaceEvent.findMany(args).unwrap(); } /** * Namespace lifecycle events — audit log of creation, activation, deactivation, label changes - * + * * @example * ```ts * await prefetchPlatformNamespaceEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformNamespaceEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceEventSelect>; -}): Promise; -export async function prefetchPlatformNamespaceEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformNamespaceEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformNamespaceEventSelect>; + } +): Promise; +export async function prefetchPlatformNamespaceEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformNamespaceEventKeys.list(args), - queryFn: () => getClient().platformNamespaceEvent.findMany(args).unwrap() + queryFn: () => getClient().platformNamespaceEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceQuery.ts index f86d3cd316..962f42695f 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespaceQuery.ts @@ -4,20 +4,26 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformNamespaceQueryKey = platformNamespaceKeys.detail; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { data, isLoading } = usePlatformNamespaceQuery({ @@ -26,38 +32,52 @@ export const platformNamespaceQueryKey = platformNamespaceKeys.detail; * }); * ``` */ -export function usePlatformNamespaceQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformNamespaceSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformNamespaceQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlatformNamespaceQuery< + S extends PlatformNamespaceSelect, + TData = { + platformNamespace: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseQueryOptions< + { + platformNamespace: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformNamespaceQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformNamespaceKeys.detail(params.id), - queryFn: () => getClient().platformNamespace.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .platformNamespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * const data = await fetchPlatformNamespaceQuery({ @@ -79,35 +99,46 @@ export async function fetchPlatformNamespaceQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().platformNamespace.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .platformNamespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * await prefetchPlatformNamespaceQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlatformNamespaceQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlatformNamespaceSelect>; -}): Promise; -export async function prefetchPlatformNamespaceQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlatformNamespaceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformNamespaceSelect>; + } +): Promise; +export async function prefetchPlatformNamespaceQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: platformNamespaceKeys.detail(params.id), - queryFn: () => getClient().platformNamespace.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .platformNamespace.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespacesQuery.ts b/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespacesQuery.ts index d3c468650c..08c0cd485b 100644 --- a/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespacesQuery.ts +++ b/sdk/constructive-react/src/infra/hooks/queries/usePlatformNamespacesQuery.ts @@ -4,20 +4,35 @@ * 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 { platformNamespaceKeys } from "../query-keys"; -import type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, PlatformNamespaceFilter, PlatformNamespaceOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlatformNamespaceSelect, PlatformNamespaceWithRelations, PlatformNamespaceFilter, PlatformNamespaceOrderBy } from "../../orm/input-types"; +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 { platformNamespaceKeys } from '../query-keys'; +import type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformNamespaceSelect, + PlatformNamespaceWithRelations, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const platformNamespacesQueryKey = platformNamespaceKeys.list; /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```tsx * const { data, isLoading } = usePlatformNamespacesQuery({ @@ -30,33 +45,53 @@ export const platformNamespacesQueryKey = platformNamespaceKeys.list; * }); * ``` */ -export function usePlatformNamespacesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlatformNamespacesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlatformNamespacesQuery< + S extends PlatformNamespaceSelect, + TData = { + platformNamespaces: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformNamespaceSelect>; + } & Omit< + UseQueryOptions< + { + platformNamespaces: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformNamespacesQuery( + params: { + selection: ListSelectionConfig< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: platformNamespaceKeys.list(args), queryFn: () => getClient().platformNamespace.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * const data = await fetchPlatformNamespacesQuery({ @@ -70,35 +105,59 @@ export function usePlatformNamespacesQuery(params: { export async function fetchPlatformNamespacesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlatformNamespaceSelect>; }): Promise<{ platformNamespaces: ConnectionResult>; }>; export async function fetchPlatformNamespacesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >(params.selection); return getClient().platformNamespace.findMany(args).unwrap(); } /** * Logical namespace containers for grouping secrets, config, functions, and other resources - * + * * @example * ```ts * await prefetchPlatformNamespacesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlatformNamespacesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlatformNamespaceSelect>; -}): Promise; -export async function prefetchPlatformNamespacesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlatformNamespacesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformNamespaceSelect>; + } +): Promise; +export async function prefetchPlatformNamespacesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: platformNamespaceKeys.list(args), - queryFn: () => getClient().platformNamespace.findMany(args).unwrap() + queryFn: () => getClient().platformNamespace.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/infra/hooks/query-keys.ts b/sdk/constructive-react/src/infra/hooks/query-keys.ts index e2a14ba4de..74d7755bea 100644 --- a/sdk/constructive-react/src/infra/hooks/query-keys.ts +++ b/sdk/constructive-react/src/infra/hooks/query-keys.ts @@ -20,74 +20,98 @@ // ============================================================================ export const dbPresetKeys = { - /** All dbPreset queries */all: ["dbpreset"] as const, - /** List query keys */lists: () => [...dbPresetKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...dbPresetKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...dbPresetKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...dbPresetKeys.details(), id] as const + /** All dbPreset queries */ all: ['dbpreset'] as const, + /** List query keys */ lists: () => [...dbPresetKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...dbPresetKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...dbPresetKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...dbPresetKeys.details(), id] as const, } as const; export const namespaceKeys = { - /** All namespace queries */all: ["namespace"] as const, - /** List query keys */lists: () => [...namespaceKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...namespaceKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...namespaceKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...namespaceKeys.details(), id] as const + /** All namespace queries */ all: ['namespace'] as const, + /** List query keys */ lists: () => [...namespaceKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...namespaceKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...namespaceKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...namespaceKeys.details(), id] as const, } as const; export const namespaceEventKeys = { - /** All namespaceEvent queries */all: ["namespaceevent"] as const, - /** List query keys */lists: () => [...namespaceEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...namespaceEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...namespaceEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...namespaceEventKeys.details(), id] as const + /** All namespaceEvent queries */ all: ['namespaceevent'] as const, + /** List query keys */ lists: () => [...namespaceEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...namespaceEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...namespaceEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...namespaceEventKeys.details(), id] as const, } as const; export const platformInfraCommitKeys = { - /** All platformInfraCommit queries */all: ["platforminfracommit"] as const, - /** List query keys */lists: () => [...platformInfraCommitKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraCommitKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraCommitKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraCommitKeys.details(), id] as const + /** All platformInfraCommit queries */ all: ['platforminfracommit'] as const, + /** List query keys */ lists: () => [...platformInfraCommitKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraCommitKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInfraCommitKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraCommitKeys.details(), id] as const, } as const; export const platformInfraGetAllTreeNodesRecordKeys = { - /** All platformInfraGetAllTreeNodesRecord queries */all: ["platforminfragetalltreenodesrecord"] as const, - /** List query keys */lists: () => [...platformInfraGetAllTreeNodesRecordKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraGetAllTreeNodesRecordKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraGetAllTreeNodesRecordKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraGetAllTreeNodesRecordKeys.details(), id] as const + /** All platformInfraGetAllTreeNodesRecord queries */ all: [ + 'platforminfragetalltreenodesrecord', + ] as const, + /** List query keys */ lists: () => + [...platformInfraGetAllTreeNodesRecordKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraGetAllTreeNodesRecordKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...platformInfraGetAllTreeNodesRecordKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraGetAllTreeNodesRecordKeys.details(), id] as const, } as const; export const platformInfraObjectKeys = { - /** All platformInfraObject queries */all: ["platforminfraobject"] as const, - /** List query keys */lists: () => [...platformInfraObjectKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraObjectKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraObjectKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraObjectKeys.details(), id] as const + /** All platformInfraObject queries */ all: ['platforminfraobject'] as const, + /** List query keys */ lists: () => [...platformInfraObjectKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraObjectKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInfraObjectKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraObjectKeys.details(), id] as const, } as const; export const platformInfraRefKeys = { - /** All platformInfraRef queries */all: ["platforminfraref"] as const, - /** List query keys */lists: () => [...platformInfraRefKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraRefKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraRefKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraRefKeys.details(), id] as const + /** All platformInfraRef queries */ all: ['platforminfraref'] as const, + /** List query keys */ lists: () => [...platformInfraRefKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraRefKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInfraRefKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraRefKeys.details(), id] as const, } as const; export const platformInfraStoreKeys = { - /** All platformInfraStore queries */all: ["platforminfrastore"] as const, - /** List query keys */lists: () => [...platformInfraStoreKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformInfraStoreKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformInfraStoreKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformInfraStoreKeys.details(), id] as const + /** All platformInfraStore queries */ all: ['platforminfrastore'] as const, + /** List query keys */ lists: () => [...platformInfraStoreKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformInfraStoreKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformInfraStoreKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformInfraStoreKeys.details(), id] as const, } as const; export const platformNamespaceKeys = { - /** All platformNamespace queries */all: ["platformnamespace"] as const, - /** List query keys */lists: () => [...platformNamespaceKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformNamespaceKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformNamespaceKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformNamespaceKeys.details(), id] as const + /** All platformNamespace queries */ all: ['platformnamespace'] as const, + /** List query keys */ lists: () => [...platformNamespaceKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformNamespaceKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformNamespaceKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformNamespaceKeys.details(), id] as const, } as const; export const platformNamespaceEventKeys = { - /** All platformNamespaceEvent queries */all: ["platformnamespaceevent"] as const, - /** List query keys */lists: () => [...platformNamespaceEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...platformNamespaceEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...platformNamespaceEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...platformNamespaceEventKeys.details(), id] as const + /** All platformNamespaceEvent queries */ all: ['platformnamespaceevent'] as const, + /** List query keys */ lists: () => [...platformNamespaceEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformNamespaceEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformNamespaceEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformNamespaceEventKeys.details(), id] as const, } as const; /** @@ -121,7 +145,7 @@ export const queryKeys = { platformInfraRef: platformInfraRefKeys, platformInfraStore: platformInfraStoreKeys, platformNamespace: platformNamespaceKeys, - platformNamespaceEvent: platformNamespaceEventKeys + platformNamespaceEvent: platformNamespaceEventKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/infra/hooks/selection.ts b/sdk/constructive-react/src/infra/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/infra/hooks/selection.ts +++ b/sdk/constructive-react/src/infra/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/infra/index.ts b/sdk/constructive-react/src/infra/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/infra/index.ts +++ b/sdk/constructive-react/src/infra/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/infra/orm/client.ts b/sdk/constructive-react/src/infra/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/infra/orm/client.ts +++ b/sdk/constructive-react/src/infra/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/infra/orm/index.ts b/sdk/constructive-react/src/infra/orm/index.ts index e121317be7..c40f0234ec 100644 --- a/sdk/constructive-react/src/infra/orm/index.ts +++ b/sdk/constructive-react/src/infra/orm/index.ts @@ -3,25 +3,25 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { DbPresetModel } from "./models/dbPreset"; -import { NamespaceModel } from "./models/namespace"; -import { NamespaceEventModel } from "./models/namespaceEvent"; -import { PlatformInfraCommitModel } from "./models/platformInfraCommit"; -import { PlatformInfraGetAllTreeNodesRecordModel } from "./models/platformInfraGetAllTreeNodesRecord"; -import { PlatformInfraObjectModel } from "./models/platformInfraObject"; -import { PlatformInfraRefModel } from "./models/platformInfraRef"; -import { PlatformInfraStoreModel } from "./models/platformInfraStore"; -import { PlatformNamespaceModel } from "./models/platformNamespace"; -import { PlatformNamespaceEventModel } from "./models/platformNamespaceEvent"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { DbPresetModel } from './models/dbPreset'; +import { NamespaceModel } from './models/namespace'; +import { NamespaceEventModel } from './models/namespaceEvent'; +import { PlatformInfraCommitModel } from './models/platformInfraCommit'; +import { PlatformInfraGetAllTreeNodesRecordModel } from './models/platformInfraGetAllTreeNodesRecord'; +import { PlatformInfraObjectModel } from './models/platformInfraObject'; +import { PlatformInfraRefModel } from './models/platformInfraRef'; +import { PlatformInfraStoreModel } from './models/platformInfraStore'; +import { PlatformNamespaceModel } from './models/platformNamespace'; +import { PlatformNamespaceEventModel } from './models/platformNamespaceEvent'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -58,6 +58,6 @@ export function createClient(config: OrmClientConfig) { platformInfraStore: new PlatformInfraStoreModel(client), platformNamespace: new PlatformNamespaceModel(client), platformNamespaceEvent: new PlatformNamespaceEventModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/input-types.ts b/sdk/constructive-react/src/infra/orm/input-types.ts index 1ac2c6461a..23e81e113d 100644 --- a/sdk/constructive-react/src/infra/orm/input-types.ts +++ b/sdk/constructive-react/src/infra/orm/input-types.ts @@ -436,12 +436,14 @@ export type DbPresetWithRelations = DbPreset & DbPresetRelations; export type NamespaceWithRelations = Namespace & NamespaceRelations; export type NamespaceEventWithRelations = NamespaceEvent & NamespaceEventRelations; export type PlatformInfraCommitWithRelations = PlatformInfraCommit & PlatformInfraCommitRelations; -export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & PlatformInfraGetAllTreeNodesRecordRelations; +export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & + PlatformInfraGetAllTreeNodesRecordRelations; export type PlatformInfraObjectWithRelations = PlatformInfraObject & PlatformInfraObjectRelations; export type PlatformInfraRefWithRelations = PlatformInfraRef & PlatformInfraRefRelations; export type PlatformInfraStoreWithRelations = PlatformInfraStore & PlatformInfraStoreRelations; export type PlatformNamespaceWithRelations = PlatformNamespace & PlatformNamespaceRelations; -export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & PlatformNamespaceEventRelations; +export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & + PlatformNamespaceEventRelations; // ============ Entity Select Types ============ export type DbPresetSelect = { active?: boolean; @@ -774,16 +776,202 @@ export interface PlatformNamespaceEventFilter { or?: PlatformNamespaceEventFilter[]; } // ============ OrderBy Types ============ -export type DbPresetOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MODULES_HASH_ASC" | "MODULES_HASH_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformInfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type PlatformInfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type PlatformInfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformInfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type PlatformInfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformNamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformNamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type DbPresetOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MODULES_HASH_ASC' + | 'MODULES_HASH_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformInfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type PlatformInfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type PlatformInfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformInfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type PlatformInfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformNamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformNamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; // ============ CRUD Input Types ============ export interface CreateDbPresetInput { clientMutationId?: string; @@ -1826,4 +2014,4 @@ export type PlatformNamespaceEventEdgeSelect = { node?: { select: PlatformNamespaceEventSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/infra/orm/models/dbPreset.ts b/sdk/constructive-react/src/infra/orm/models/dbPreset.ts index 15b60268b5..a3e824a674 100644 --- a/sdk/constructive-react/src/infra/orm/models/dbPreset.ts +++ b/sdk/constructive-react/src/infra/orm/models/dbPreset.ts @@ -3,56 +3,96 @@ * @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 { DbPreset, DbPresetWithRelations, DbPresetSelect, DbPresetFilter, DbPresetOrderBy, CreateDbPresetInput, UpdateDbPresetInput, DbPresetPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPreset, + DbPresetWithRelations, + DbPresetSelect, + DbPresetFilter, + DbPresetOrderBy, + CreateDbPresetInput, + UpdateDbPresetInput, + DbPresetPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", 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 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + 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, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPresets", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPresets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPreset", "dbPresets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPreset", "createDbPreset", "dbPreset", args.select, args.data, "CreateDbPresetInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPreset', + 'createDbPreset', + 'dbPreset', + args.select, + args.data, + 'CreateDbPresetInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "createDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'createDbPreset', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPreset", "updateDbPreset", "dbPreset", args.select, args.where.id, args.data, "UpdateDbPresetInput", "id", "dbPresetPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPreset', + 'updateDbPreset', + 'dbPreset', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetInput', + 'id', + 'dbPresetPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "updateDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'updateDbPreset', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPreset", "deleteDbPreset", "dbPreset", { - id: args.where.id - }, "DeleteDbPresetInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPreset', + 'deleteDbPreset', + 'dbPreset', + { + id: args.where.id, + }, + 'DeleteDbPresetInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "deleteDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'deleteDbPreset', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/index.ts b/sdk/constructive-react/src/infra/orm/models/index.ts index 60d8e491d5..1e5132eecf 100644 --- a/sdk/constructive-react/src/infra/orm/models/index.ts +++ b/sdk/constructive-react/src/infra/orm/models/index.ts @@ -3,13 +3,13 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { DbPresetModel } from "./dbPreset"; -export { NamespaceModel } from "./namespace"; -export { NamespaceEventModel } from "./namespaceEvent"; -export { PlatformInfraCommitModel } from "./platformInfraCommit"; -export { PlatformInfraGetAllTreeNodesRecordModel } from "./platformInfraGetAllTreeNodesRecord"; -export { PlatformInfraObjectModel } from "./platformInfraObject"; -export { PlatformInfraRefModel } from "./platformInfraRef"; -export { PlatformInfraStoreModel } from "./platformInfraStore"; -export { PlatformNamespaceModel } from "./platformNamespace"; -export { PlatformNamespaceEventModel } from "./platformNamespaceEvent"; \ No newline at end of file +export { DbPresetModel } from './dbPreset'; +export { NamespaceModel } from './namespace'; +export { NamespaceEventModel } from './namespaceEvent'; +export { PlatformInfraCommitModel } from './platformInfraCommit'; +export { PlatformInfraGetAllTreeNodesRecordModel } from './platformInfraGetAllTreeNodesRecord'; +export { PlatformInfraObjectModel } from './platformInfraObject'; +export { PlatformInfraRefModel } from './platformInfraRef'; +export { PlatformInfraStoreModel } from './platformInfraStore'; +export { PlatformNamespaceModel } from './platformNamespace'; +export { PlatformNamespaceEventModel } from './platformNamespaceEvent'; diff --git a/sdk/constructive-react/src/infra/orm/models/namespace.ts b/sdk/constructive-react/src/infra/orm/models/namespace.ts index 8c2bf42876..4e300068cd 100644 --- a/sdk/constructive-react/src/infra/orm/models/namespace.ts +++ b/sdk/constructive-react/src/infra/orm/models/namespace.ts @@ -3,56 +3,96 @@ * @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 { Namespace, NamespaceWithRelations, NamespaceSelect, NamespaceFilter, NamespaceOrderBy, CreateNamespaceInput, UpdateNamespaceInput, NamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Namespace, + NamespaceWithRelations, + NamespaceSelect, + NamespaceFilter, + NamespaceOrderBy, + CreateNamespaceInput, + UpdateNamespaceInput, + NamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", 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 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + 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, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespaces", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Namespace", "namespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Namespace", "createNamespace", "namespace", args.select, args.data, "CreateNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Namespace', + 'createNamespace', + 'namespace', + args.select, + args.data, + 'CreateNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "createNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'createNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Namespace", "updateNamespace", "namespace", args.select, args.where.id, args.data, "UpdateNamespaceInput", "id", "namespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Namespace', + 'updateNamespace', + 'namespace', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceInput', + 'id', + 'namespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "updateNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'updateNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Namespace", "deleteNamespace", "namespace", { - id: args.where.id - }, "DeleteNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Namespace', + 'deleteNamespace', + 'namespace', + { + id: args.where.id, + }, + 'DeleteNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "deleteNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'deleteNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/namespaceEvent.ts b/sdk/constructive-react/src/infra/orm/models/namespaceEvent.ts index 5fab4853c7..494442c263 100644 --- a/sdk/constructive-react/src/infra/orm/models/namespaceEvent.ts +++ b/sdk/constructive-react/src/infra/orm/models/namespaceEvent.ts @@ -3,56 +3,96 @@ * @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 { NamespaceEvent, NamespaceEventWithRelations, NamespaceEventSelect, NamespaceEventFilter, NamespaceEventOrderBy, CreateNamespaceEventInput, UpdateNamespaceEventInput, NamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceEvent, + NamespaceEventWithRelations, + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy, + CreateNamespaceEventInput, + UpdateNamespaceEventInput, + NamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", 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 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + 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, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvents", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceEvent", "createNamespaceEvent", "namespaceEvent", args.select, args.data, "CreateNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceEvent', + 'createNamespaceEvent', + 'namespaceEvent', + args.select, + args.data, + 'CreateNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "createNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'createNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + NamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceEvent", "updateNamespaceEvent", "namespaceEvent", args.select, args.where.id, args.data, "UpdateNamespaceEventInput", "id", "namespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceEvent', + 'updateNamespaceEvent', + 'namespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceEventInput', + 'id', + 'namespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "updateNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'updateNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceEvent", "deleteNamespaceEvent", "namespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceEvent', + 'deleteNamespaceEvent', + 'namespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "deleteNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'deleteNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/platformInfraCommit.ts b/sdk/constructive-react/src/infra/orm/models/platformInfraCommit.ts index b5e90c524d..ab0c34f08f 100644 --- a/sdk/constructive-react/src/infra/orm/models/platformInfraCommit.ts +++ b/sdk/constructive-react/src/infra/orm/models/platformInfraCommit.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraCommit, PlatformInfraCommitWithRelations, PlatformInfraCommitSelect, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy, CreatePlatformInfraCommitInput, UpdatePlatformInfraCommitInput, PlatformInfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraCommit, + PlatformInfraCommitWithRelations, + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, + CreatePlatformInfraCommitInput, + UpdatePlatformInfraCommitInput, + PlatformInfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", 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 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + 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, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommits", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraCommit", "createPlatformInfraCommit", "platformInfraCommit", args.select, args.data, "CreatePlatformInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraCommit', + 'createPlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.data, + 'CreatePlatformInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "createPlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'createPlatformInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraCommit", "updatePlatformInfraCommit", "platformInfraCommit", args.select, args.where.id, args.data, "UpdatePlatformInfraCommitInput", "id", "platformInfraCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraCommit', + 'updatePlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraCommitInput', + 'id', + 'platformInfraCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "updatePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'updatePlatformInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraCommit", "deletePlatformInfraCommit", "platformInfraCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraCommit', + 'deletePlatformInfraCommit', + 'platformInfraCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "deletePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'deletePlatformInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts b/sdk/constructive-react/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts index 6c9bfc2b28..e0e0a2aeaa 100644 --- a/sdk/constructive-react/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-react/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts @@ -3,56 +3,109 @@ * @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 { PlatformInfraGetAllTreeNodesRecord, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy, CreatePlatformInfraGetAllTreeNodesRecordInput, UpdatePlatformInfraGetAllTreeNodesRecordInput, PlatformInfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraGetAllTreeNodesRecord, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, + CreatePlatformInfraGetAllTreeNodesRecordInput, + UpdatePlatformInfraGetAllTreeNodesRecordInput, + PlatformInfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", 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 - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + 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, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodes", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +113,41 @@ export class PlatformInfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraGetAllTreeNodesRecord": data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null - }) + platformInfraGetAllTreeNodesRecord: data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraGetAllTreeNodesRecord: { - platformInfraGetAllTreeNodesRecord: InferSelectResult; + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraGetAllTreeNodesRecord", "createPlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodesRecord", args.select, args.data, "CreatePlatformInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'createPlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreatePlatformInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "createPlatformInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'createPlatformInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/platformInfraObject.ts b/sdk/constructive-react/src/infra/orm/models/platformInfraObject.ts index 2978ff1c18..512cb448c4 100644 --- a/sdk/constructive-react/src/infra/orm/models/platformInfraObject.ts +++ b/sdk/constructive-react/src/infra/orm/models/platformInfraObject.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraObject, PlatformInfraObjectWithRelations, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy, CreatePlatformInfraObjectInput, UpdatePlatformInfraObjectInput, PlatformInfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraObject, + PlatformInfraObjectWithRelations, + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, + CreatePlatformInfraObjectInput, + UpdatePlatformInfraObjectInput, + PlatformInfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraObject", "platformInfraObjects", 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 - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + 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, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObjects", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraObject", "platformInfraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class PlatformInfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraObject": data.platformInfraObjects?.nodes?.[0] ?? null - }) + platformInfraObject: data.platformInfraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("PlatformInfraObject", "platformInfraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'PlatformInfraObject', + 'platformInfraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraObject", "createPlatformInfraObject", "platformInfraObject", args.select, args.data, "CreatePlatformInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraObject', + 'createPlatformInfraObject', + 'platformInfraObject', + args.select, + args.data, + 'CreatePlatformInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "createPlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'createPlatformInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraObject", "updatePlatformInfraObject", "platformInfraObject", args.select, args.where.id, args.data, "UpdatePlatformInfraObjectInput", "id", "platformInfraObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraObject', + 'updatePlatformInfraObject', + 'platformInfraObject', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraObjectInput', + 'id', + 'platformInfraObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "updatePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'updatePlatformInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraObject", "deletePlatformInfraObject", "platformInfraObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraObject', + 'deletePlatformInfraObject', + 'platformInfraObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "deletePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'deletePlatformInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/platformInfraRef.ts b/sdk/constructive-react/src/infra/orm/models/platformInfraRef.ts index 198e5cd359..c485407d95 100644 --- a/sdk/constructive-react/src/infra/orm/models/platformInfraRef.ts +++ b/sdk/constructive-react/src/infra/orm/models/platformInfraRef.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraRef, PlatformInfraRefWithRelations, PlatformInfraRefSelect, PlatformInfraRefFilter, PlatformInfraRefOrderBy, CreatePlatformInfraRefInput, UpdatePlatformInfraRefInput, PlatformInfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraRef, + PlatformInfraRefWithRelations, + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, + CreatePlatformInfraRefInput, + UpdatePlatformInfraRefInput, + PlatformInfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", 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 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + 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, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRefs", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraRef", "createPlatformInfraRef", "platformInfraRef", args.select, args.data, "CreatePlatformInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraRef', + 'createPlatformInfraRef', + 'platformInfraRef', + args.select, + args.data, + 'CreatePlatformInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "createPlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'createPlatformInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraRef", "updatePlatformInfraRef", "platformInfraRef", args.select, args.where.id, args.data, "UpdatePlatformInfraRefInput", "id", "platformInfraRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraRef', + 'updatePlatformInfraRef', + 'platformInfraRef', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraRefInput', + 'id', + 'platformInfraRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "updatePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'updatePlatformInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraRef", "deletePlatformInfraRef", "platformInfraRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraRef', + 'deletePlatformInfraRef', + 'platformInfraRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "deletePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'deletePlatformInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/platformInfraStore.ts b/sdk/constructive-react/src/infra/orm/models/platformInfraStore.ts index 857230b173..493d42e53c 100644 --- a/sdk/constructive-react/src/infra/orm/models/platformInfraStore.ts +++ b/sdk/constructive-react/src/infra/orm/models/platformInfraStore.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraStore, PlatformInfraStoreWithRelations, PlatformInfraStoreSelect, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy, CreatePlatformInfraStoreInput, UpdatePlatformInfraStoreInput, PlatformInfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraStore, + PlatformInfraStoreWithRelations, + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, + CreatePlatformInfraStoreInput, + UpdatePlatformInfraStoreInput, + PlatformInfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", 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 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + 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, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStores", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraStore", "createPlatformInfraStore", "platformInfraStore", args.select, args.data, "CreatePlatformInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraStore', + 'createPlatformInfraStore', + 'platformInfraStore', + args.select, + args.data, + 'CreatePlatformInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "createPlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'createPlatformInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformInfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraStore", "updatePlatformInfraStore", "platformInfraStore", args.select, args.where.id, args.data, "UpdatePlatformInfraStoreInput", "id", "platformInfraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraStore', + 'updatePlatformInfraStore', + 'platformInfraStore', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraStoreInput', + 'id', + 'platformInfraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "updatePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'updatePlatformInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraStore", "deletePlatformInfraStore", "platformInfraStore", { - id: args.where.id - }, "DeletePlatformInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraStore', + 'deletePlatformInfraStore', + 'platformInfraStore', + { + id: args.where.id, + }, + 'DeletePlatformInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "deletePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'deletePlatformInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/platformNamespace.ts b/sdk/constructive-react/src/infra/orm/models/platformNamespace.ts index 061849f0df..c4dff94953 100644 --- a/sdk/constructive-react/src/infra/orm/models/platformNamespace.ts +++ b/sdk/constructive-react/src/infra/orm/models/platformNamespace.ts @@ -3,56 +3,96 @@ * @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 { PlatformNamespace, PlatformNamespaceWithRelations, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy, CreatePlatformNamespaceInput, UpdatePlatformNamespaceInput, PlatformNamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespace, + PlatformNamespaceWithRelations, + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, + CreatePlatformNamespaceInput, + UpdatePlatformNamespaceInput, + PlatformNamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", 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 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + 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, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespaces", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespace", "createPlatformNamespace", "platformNamespace", args.select, args.data, "CreatePlatformNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespace', + 'createPlatformNamespace', + 'platformNamespace', + args.select, + args.data, + 'CreatePlatformNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "createPlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'createPlatformNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformNamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespace", "updatePlatformNamespace", "platformNamespace", args.select, args.where.id, args.data, "UpdatePlatformNamespaceInput", "id", "platformNamespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespace', + 'updatePlatformNamespace', + 'platformNamespace', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceInput', + 'id', + 'platformNamespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "updatePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'updatePlatformNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespace", "deletePlatformNamespace", "platformNamespace", { - id: args.where.id - }, "DeletePlatformNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespace', + 'deletePlatformNamespace', + 'platformNamespace', + { + id: args.where.id, + }, + 'DeletePlatformNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "deletePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'deletePlatformNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/models/platformNamespaceEvent.ts b/sdk/constructive-react/src/infra/orm/models/platformNamespaceEvent.ts index 90242716e8..198afe79ae 100644 --- a/sdk/constructive-react/src/infra/orm/models/platformNamespaceEvent.ts +++ b/sdk/constructive-react/src/infra/orm/models/platformNamespaceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformNamespaceEvent, PlatformNamespaceEventWithRelations, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy, CreatePlatformNamespaceEventInput, UpdatePlatformNamespaceEventInput, PlatformNamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespaceEvent, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, + CreatePlatformNamespaceEventInput, + UpdatePlatformNamespaceEventInput, + PlatformNamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformNamespaceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", 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 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + 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, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvents", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespaceEvent", "createPlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.data, "CreatePlatformNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespaceEvent', + 'createPlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.data, + 'CreatePlatformNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "createPlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'createPlatformNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformNamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespaceEvent", "updatePlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.where.id, args.data, "UpdatePlatformNamespaceEventInput", "id", "platformNamespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespaceEvent', + 'updatePlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceEventInput', + 'id', + 'platformNamespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "updatePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'updatePlatformNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespaceEvent", "deletePlatformNamespaceEvent", "platformNamespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespaceEvent', + 'deletePlatformNamespaceEvent', + 'platformNamespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "deletePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'deletePlatformNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/mutation/index.ts b/sdk/constructive-react/src/infra/orm/mutation/index.ts index 3414cf9046..f266633531 100644 --- a/sdk/constructive-react/src/infra/orm/mutation/index.ts +++ b/sdk/constructive-react/src/infra/orm/mutation/index.ts @@ -3,11 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { PlatformInfraInitEmptyRepoInput, PlatformInfraInsertNodeAtPathInput, PlatformInfraSetDataAtPathInput, ProvisionBucketInput, PlatformInfraInitEmptyRepoPayload, PlatformInfraInsertNodeAtPathPayload, PlatformInfraSetDataAtPathPayload, ProvisionBucketPayload, PlatformInfraInitEmptyRepoPayloadSelect, PlatformInfraInsertNodeAtPathPayloadSelect, PlatformInfraSetDataAtPathPayloadSelect, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + PlatformInfraInitEmptyRepoInput, + PlatformInfraInsertNodeAtPathInput, + PlatformInfraSetDataAtPathInput, + ProvisionBucketInput, + PlatformInfraInitEmptyRepoPayload, + PlatformInfraInsertNodeAtPathPayload, + PlatformInfraSetDataAtPathPayload, + ProvisionBucketPayload, + PlatformInfraInitEmptyRepoPayloadSelect, + PlatformInfraInsertNodeAtPathPayloadSelect, + PlatformInfraSetDataAtPathPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface PlatformInfraInitEmptyRepoVariables { input: PlatformInfraInitEmptyRepoInput; } @@ -29,61 +42,124 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - platformInfraInitEmptyRepo: (args: PlatformInfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInitEmptyRepo", - fieldName: "platformInfraInitEmptyRepo", - ...buildCustomDocument("mutation", "PlatformInfraInitEmptyRepo", "platformInfraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "PlatformInfraInitEmptyRepoInput!" - }], connectionFieldsMap, "PlatformInfraInitEmptyRepoPayload") - }), - platformInfraInsertNodeAtPath: (args: PlatformInfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInsertNodeAtPath", - fieldName: "platformInfraInsertNodeAtPath", - ...buildCustomDocument("mutation", "PlatformInfraInsertNodeAtPath", "platformInfraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "PlatformInfraInsertNodeAtPathPayload") - }), - platformInfraSetDataAtPath: (args: PlatformInfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraSetDataAtPath", - fieldName: "platformInfraSetDataAtPath", - ...buildCustomDocument("mutation", "PlatformInfraSetDataAtPath", "platformInfraSetDataAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraSetDataAtPathInput!" - }], connectionFieldsMap, "PlatformInfraSetDataAtPathPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + platformInfraInitEmptyRepo: ( + args: PlatformInfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInitEmptyRepo', + fieldName: 'platformInfraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInitEmptyRepo', + 'platformInfraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInitEmptyRepoPayload' + ), + }), + platformInfraInsertNodeAtPath: ( + args: PlatformInfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInsertNodeAtPath', + fieldName: 'platformInfraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInsertNodeAtPath', + 'platformInfraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInsertNodeAtPathPayload' + ), + }), + platformInfraSetDataAtPath: ( + args: PlatformInfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraSetDataAtPath', + fieldName: 'platformInfraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraSetDataAtPath', + 'platformInfraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraSetDataAtPathPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/orm/query-builder.ts b/sdk/constructive-react/src/infra/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/infra/orm/query-builder.ts +++ b/sdk/constructive-react/src/infra/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/infra/orm/realtime.ts b/sdk/constructive-react/src/infra/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/infra/orm/realtime.ts +++ b/sdk/constructive-react/src/infra/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/infra/orm/select-types.ts b/sdk/constructive-react/src/infra/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/infra/orm/select-types.ts +++ b/sdk/constructive-react/src/infra/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/infra/schema-types.ts b/sdk/constructive-react/src/infra/schema-types.ts index 76a36e19e4..5279e37498 100644 --- a/sdk/constructive-react/src/infra/schema-types.ts +++ b/sdk/constructive-react/src/infra/schema-types.ts @@ -4,25 +4,232 @@ * DO NOT EDIT - changes will be overwritten */ -import type { DbPreset, Namespace, NamespaceEvent, PlatformInfraCommit, PlatformInfraGetAllTreeNodesRecord, PlatformInfraObject, PlatformInfraRef, PlatformInfraStore, PlatformNamespace, PlatformNamespaceEvent, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + DbPreset, + Namespace, + NamespaceEvent, + PlatformInfraCommit, + PlatformInfraGetAllTreeNodesRecord, + PlatformInfraObject, + PlatformInfraRef, + PlatformInfraStore, + PlatformNamespace, + PlatformNamespaceEvent, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; /** Methods to use when ordering `DbPreset`. */ -export type DbPresetOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MODULES_HASH_ASC" | "MODULES_HASH_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DbPresetOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MODULES_HASH_ASC' + | 'MODULES_HASH_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `NamespaceEvent`. */ -export type NamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type NamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `Namespace`. */ -export type NamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type NamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `PlatformInfraCommit`. */ -export type PlatformInfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; +export type PlatformInfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; /** Methods to use when ordering `PlatformInfraObject`. */ -export type PlatformInfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; +export type PlatformInfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; /** Methods to use when ordering `PlatformInfraRef`. */ -export type PlatformInfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; +export type PlatformInfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; /** Methods to use when ordering `PlatformInfraStore`. */ -export type PlatformInfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; +export type PlatformInfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; /** Methods to use when ordering `PlatformNamespaceEvent`. */ -export type PlatformNamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type PlatformNamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `PlatformNamespace`. */ -export type PlatformNamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type PlatformNamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; export interface CreateDbPresetInput { clientMutationId?: string; /** The `DbPreset` to be created by this mutation. */ @@ -1366,4 +1573,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/infra/types.ts b/sdk/constructive-react/src/infra/types.ts index 58545fa926..9663f2af5d 100644 --- a/sdk/constructive-react/src/infra/types.ts +++ b/sdk/constructive-react/src/infra/types.ts @@ -324,4 +324,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/hooks/client.ts b/sdk/constructive-react/src/modules/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/modules/hooks/client.ts +++ b/sdk/constructive-react/src/modules/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/modules/hooks/index.ts b/sdk/constructive-react/src/modules/hooks/index.ts index 215dadbbdd..744baaf637 100644 --- a/sdk/constructive-react/src/modules/hooks/index.ts +++ b/sdk/constructive-react/src/modules/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: AgentModule, ApiSurfaceModule, AppModule, BillingModule, BillingProviderModule, Blueprint, BlueprintConstruction, BlueprintTemplate, CatalogModule, ComputeLogModule, ConfigSecretsUserModule, ConnectedAccountsModule, CryptoAddressesModule, CryptoAuthModule, DatabaseProvisionModule, DatabaseSettingsModule, DbPoolConfig, DbPool, DbPresetModule, DbUsageModule, DefaultIdsModule, DenormalizedTableField, DevicesModule, DomainModule, EmailsModule, EntityTypeProvision, EventsModule, FunctionDeploymentModule, FunctionInvocationModule, FunctionModule, GraphExecutionModule, GraphModule, HierarchyModule, HttpRouteModule, I18NModule, IdentityProvidersModule, InferenceLogModule, InfraConfigModule, InfraSecretsModule, IntegrationProvidersModule, InternalSecretsModule, InvitesModule, LimitsModule, MembershipTypesModule, MembershipsModule, MerkleStoreModule, NamespaceModule, NotificationsModule, PermissionsModule, PhoneNumbersModule, PlansModule, PrincipalAuthModule, ProfilesModule, RateLimitMetersModule, RateLimitsModule, RealtimeModule, RelationProvision, ResourceModule, RlsModule, RouteModule, SecureTableProvision, SessionSecretsModule, SessionsModule, SiteSurfaceModule, StorageLogModule, StorageModule, TransferLogModule, UserAuthModule, UserCredentialsModule, UserSettingsModule, UserStateModule, UsersModule, WebauthnAuthModule, WebauthnCredentialsModule, WebhookModule - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/modules/hooks/invalidation.ts b/sdk/constructive-react/src/modules/hooks/invalidation.ts index 5418042287..3a36e5c659 100644 --- a/sdk/constructive-react/src/modules/hooks/invalidation.ts +++ b/sdk/constructive-react/src/modules/hooks/invalidation.ts @@ -13,8 +13,84 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { agentModuleKeys, apiSurfaceModuleKeys, appModuleKeys, billingModuleKeys, billingProviderModuleKeys, blueprintKeys, blueprintConstructionKeys, blueprintTemplateKeys, catalogModuleKeys, computeLogModuleKeys, configSecretsUserModuleKeys, connectedAccountsModuleKeys, cryptoAddressesModuleKeys, cryptoAuthModuleKeys, databaseProvisionModuleKeys, databaseSettingsModuleKeys, dbPoolConfigKeys, dbPoolKeys, dbPresetModuleKeys, dbUsageModuleKeys, defaultIdsModuleKeys, denormalizedTableFieldKeys, devicesModuleKeys, domainModuleKeys, emailsModuleKeys, entityTypeProvisionKeys, eventsModuleKeys, functionDeploymentModuleKeys, functionInvocationModuleKeys, functionModuleKeys, graphExecutionModuleKeys, graphModuleKeys, hierarchyModuleKeys, httpRouteModuleKeys, i18NModuleKeys, identityProvidersModuleKeys, inferenceLogModuleKeys, infraConfigModuleKeys, infraSecretsModuleKeys, integrationProvidersModuleKeys, internalSecretsModuleKeys, invitesModuleKeys, limitsModuleKeys, membershipTypesModuleKeys, membershipsModuleKeys, merkleStoreModuleKeys, namespaceModuleKeys, notificationsModuleKeys, permissionsModuleKeys, phoneNumbersModuleKeys, plansModuleKeys, principalAuthModuleKeys, profilesModuleKeys, rateLimitMetersModuleKeys, rateLimitsModuleKeys, realtimeModuleKeys, relationProvisionKeys, resourceModuleKeys, rlsModuleKeys, routeModuleKeys, secureTableProvisionKeys, sessionSecretsModuleKeys, sessionsModuleKeys, siteSurfaceModuleKeys, storageLogModuleKeys, storageModuleKeys, transferLogModuleKeys, userAuthModuleKeys, userCredentialsModuleKeys, userSettingsModuleKeys, userStateModuleKeys, usersModuleKeys, webauthnAuthModuleKeys, webauthnCredentialsModuleKeys, webhookModuleKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + agentModuleKeys, + apiSurfaceModuleKeys, + appModuleKeys, + billingModuleKeys, + billingProviderModuleKeys, + blueprintKeys, + blueprintConstructionKeys, + blueprintTemplateKeys, + catalogModuleKeys, + computeLogModuleKeys, + configSecretsUserModuleKeys, + connectedAccountsModuleKeys, + cryptoAddressesModuleKeys, + cryptoAuthModuleKeys, + databaseProvisionModuleKeys, + databaseSettingsModuleKeys, + dbPoolConfigKeys, + dbPoolKeys, + dbPresetModuleKeys, + dbUsageModuleKeys, + defaultIdsModuleKeys, + denormalizedTableFieldKeys, + devicesModuleKeys, + domainModuleKeys, + emailsModuleKeys, + entityTypeProvisionKeys, + eventsModuleKeys, + functionDeploymentModuleKeys, + functionInvocationModuleKeys, + functionModuleKeys, + graphExecutionModuleKeys, + graphModuleKeys, + hierarchyModuleKeys, + httpRouteModuleKeys, + i18NModuleKeys, + identityProvidersModuleKeys, + inferenceLogModuleKeys, + infraConfigModuleKeys, + infraSecretsModuleKeys, + integrationProvidersModuleKeys, + internalSecretsModuleKeys, + invitesModuleKeys, + limitsModuleKeys, + membershipTypesModuleKeys, + membershipsModuleKeys, + merkleStoreModuleKeys, + namespaceModuleKeys, + notificationsModuleKeys, + permissionsModuleKeys, + phoneNumbersModuleKeys, + plansModuleKeys, + principalAuthModuleKeys, + profilesModuleKeys, + rateLimitMetersModuleKeys, + rateLimitsModuleKeys, + realtimeModuleKeys, + relationProvisionKeys, + resourceModuleKeys, + rlsModuleKeys, + routeModuleKeys, + secureTableProvisionKeys, + sessionSecretsModuleKeys, + sessionsModuleKeys, + siteSurfaceModuleKeys, + storageLogModuleKeys, + storageModuleKeys, + transferLogModuleKeys, + userAuthModuleKeys, + userCredentialsModuleKeys, + userSettingsModuleKeys, + userStateModuleKeys, + usersModuleKeys, + webauthnAuthModuleKeys, + webauthnCredentialsModuleKeys, + webhookModuleKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,831 +111,1278 @@ import { agentModuleKeys, apiSurfaceModuleKeys, appModuleKeys, billingModuleKeys * ``` */ export const invalidate = { - /** Invalidate agentModule queries */agentModule: { - /** Invalidate all agentModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentModuleKeys.all - }), - /** Invalidate agentModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: agentModuleKeys.lists() - }), - /** Invalidate a specific agentModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: agentModuleKeys.detail(id) - }) - }, - /** Invalidate apiSurfaceModule queries */apiSurfaceModule: { - /** Invalidate all apiSurfaceModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiSurfaceModuleKeys.all - }), - /** Invalidate apiSurfaceModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: apiSurfaceModuleKeys.lists() - }), - /** Invalidate a specific apiSurfaceModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: apiSurfaceModuleKeys.detail(id) - }) - }, - /** Invalidate appModule queries */appModule: { - /** Invalidate all appModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appModuleKeys.all - }), - /** Invalidate appModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appModuleKeys.lists() - }), - /** Invalidate a specific appModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appModuleKeys.detail(id) - }) - }, - /** Invalidate billingModule queries */billingModule: { - /** Invalidate all billingModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: billingModuleKeys.all - }), - /** Invalidate billingModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: billingModuleKeys.lists() - }), - /** Invalidate a specific billingModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: billingModuleKeys.detail(id) - }) - }, - /** Invalidate billingProviderModule queries */billingProviderModule: { - /** Invalidate all billingProviderModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: billingProviderModuleKeys.all - }), - /** Invalidate billingProviderModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: billingProviderModuleKeys.lists() - }), - /** Invalidate a specific billingProviderModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: billingProviderModuleKeys.detail(id) - }) - }, - /** Invalidate blueprint queries */blueprint: { - /** Invalidate all blueprint queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: blueprintKeys.all - }), - /** Invalidate blueprint list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: blueprintKeys.lists() - }), - /** Invalidate a specific blueprint */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: blueprintKeys.detail(id) - }) - }, - /** Invalidate blueprintConstruction queries */blueprintConstruction: { - /** Invalidate all blueprintConstruction queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: blueprintConstructionKeys.all - }), - /** Invalidate blueprintConstruction list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: blueprintConstructionKeys.lists() - }), - /** Invalidate a specific blueprintConstruction */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: blueprintConstructionKeys.detail(id) - }) - }, - /** Invalidate blueprintTemplate queries */blueprintTemplate: { - /** Invalidate all blueprintTemplate queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: blueprintTemplateKeys.all - }), - /** Invalidate blueprintTemplate list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: blueprintTemplateKeys.lists() - }), - /** Invalidate a specific blueprintTemplate */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: blueprintTemplateKeys.detail(id) - }) - }, - /** Invalidate catalogModule queries */catalogModule: { - /** Invalidate all catalogModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: catalogModuleKeys.all - }), - /** Invalidate catalogModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: catalogModuleKeys.lists() - }), - /** Invalidate a specific catalogModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: catalogModuleKeys.detail(id) - }) - }, - /** Invalidate computeLogModule queries */computeLogModule: { - /** Invalidate all computeLogModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: computeLogModuleKeys.all - }), - /** Invalidate computeLogModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: computeLogModuleKeys.lists() - }), - /** Invalidate a specific computeLogModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: computeLogModuleKeys.detail(id) - }) - }, - /** Invalidate configSecretsUserModule queries */configSecretsUserModule: { - /** Invalidate all configSecretsUserModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: configSecretsUserModuleKeys.all - }), - /** Invalidate configSecretsUserModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: configSecretsUserModuleKeys.lists() - }), - /** Invalidate a specific configSecretsUserModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: configSecretsUserModuleKeys.detail(id) - }) - }, - /** Invalidate connectedAccountsModule queries */connectedAccountsModule: { - /** Invalidate all connectedAccountsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: connectedAccountsModuleKeys.all - }), - /** Invalidate connectedAccountsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: connectedAccountsModuleKeys.lists() - }), - /** Invalidate a specific connectedAccountsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: connectedAccountsModuleKeys.detail(id) - }) - }, - /** Invalidate cryptoAddressesModule queries */cryptoAddressesModule: { - /** Invalidate all cryptoAddressesModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: cryptoAddressesModuleKeys.all - }), - /** Invalidate cryptoAddressesModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: cryptoAddressesModuleKeys.lists() - }), - /** Invalidate a specific cryptoAddressesModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: cryptoAddressesModuleKeys.detail(id) - }) - }, - /** Invalidate cryptoAuthModule queries */cryptoAuthModule: { - /** Invalidate all cryptoAuthModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: cryptoAuthModuleKeys.all - }), - /** Invalidate cryptoAuthModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: cryptoAuthModuleKeys.lists() - }), - /** Invalidate a specific cryptoAuthModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: cryptoAuthModuleKeys.detail(id) - }) - }, - /** Invalidate databaseProvisionModule queries */databaseProvisionModule: { - /** Invalidate all databaseProvisionModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.all - }), - /** Invalidate databaseProvisionModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.lists() - }), - /** Invalidate a specific databaseProvisionModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.detail(id) - }) - }, - /** Invalidate databaseSettingsModule queries */databaseSettingsModule: { - /** Invalidate all databaseSettingsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseSettingsModuleKeys.all - }), - /** Invalidate databaseSettingsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseSettingsModuleKeys.lists() - }), - /** Invalidate a specific databaseSettingsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: databaseSettingsModuleKeys.detail(id) - }) - }, - /** Invalidate dbPoolConfig queries */dbPoolConfig: { - /** Invalidate all dbPoolConfig queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPoolConfigKeys.all - }), - /** Invalidate dbPoolConfig list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPoolConfigKeys.lists() - }), - /** Invalidate a specific dbPoolConfig */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: dbPoolConfigKeys.detail(id) - }) - }, - /** Invalidate dbPool queries */dbPool: { - /** Invalidate all dbPool queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPoolKeys.all - }), - /** Invalidate dbPool list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPoolKeys.lists() - }), - /** Invalidate a specific dbPool */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: dbPoolKeys.detail(id) - }) - }, - /** Invalidate dbPresetModule queries */dbPresetModule: { - /** Invalidate all dbPresetModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPresetModuleKeys.all - }), - /** Invalidate dbPresetModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbPresetModuleKeys.lists() - }), - /** Invalidate a specific dbPresetModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: dbPresetModuleKeys.detail(id) - }) - }, - /** Invalidate dbUsageModule queries */dbUsageModule: { - /** Invalidate all dbUsageModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbUsageModuleKeys.all - }), - /** Invalidate dbUsageModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: dbUsageModuleKeys.lists() - }), - /** Invalidate a specific dbUsageModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: dbUsageModuleKeys.detail(id) - }) - }, - /** Invalidate defaultIdsModule queries */defaultIdsModule: { - /** Invalidate all defaultIdsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: defaultIdsModuleKeys.all - }), - /** Invalidate defaultIdsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: defaultIdsModuleKeys.lists() - }), - /** Invalidate a specific defaultIdsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: defaultIdsModuleKeys.detail(id) - }) - }, - /** Invalidate denormalizedTableField queries */denormalizedTableField: { - /** Invalidate all denormalizedTableField queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: denormalizedTableFieldKeys.all - }), - /** Invalidate denormalizedTableField list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: denormalizedTableFieldKeys.lists() - }), - /** Invalidate a specific denormalizedTableField */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: denormalizedTableFieldKeys.detail(id) - }) - }, - /** Invalidate devicesModule queries */devicesModule: { - /** Invalidate all devicesModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: devicesModuleKeys.all - }), - /** Invalidate devicesModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: devicesModuleKeys.lists() - }), - /** Invalidate a specific devicesModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: devicesModuleKeys.detail(id) - }) - }, - /** Invalidate domainModule queries */domainModule: { - /** Invalidate all domainModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: domainModuleKeys.all - }), - /** Invalidate domainModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: domainModuleKeys.lists() - }), - /** Invalidate a specific domainModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: domainModuleKeys.detail(id) - }) - }, - /** Invalidate emailsModule queries */emailsModule: { - /** Invalidate all emailsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: emailsModuleKeys.all - }), - /** Invalidate emailsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: emailsModuleKeys.lists() - }), - /** Invalidate a specific emailsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: emailsModuleKeys.detail(id) - }) - }, - /** Invalidate entityTypeProvision queries */entityTypeProvision: { - /** Invalidate all entityTypeProvision queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: entityTypeProvisionKeys.all - }), - /** Invalidate entityTypeProvision list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: entityTypeProvisionKeys.lists() - }), - /** Invalidate a specific entityTypeProvision */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: entityTypeProvisionKeys.detail(id) - }) - }, - /** Invalidate eventsModule queries */eventsModule: { - /** Invalidate all eventsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: eventsModuleKeys.all - }), - /** Invalidate eventsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: eventsModuleKeys.lists() - }), - /** Invalidate a specific eventsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: eventsModuleKeys.detail(id) - }) - }, - /** Invalidate functionDeploymentModule queries */functionDeploymentModule: { - /** Invalidate all functionDeploymentModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionDeploymentModuleKeys.all - }), - /** Invalidate functionDeploymentModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionDeploymentModuleKeys.lists() - }), - /** Invalidate a specific functionDeploymentModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionDeploymentModuleKeys.detail(id) - }) - }, - /** Invalidate functionInvocationModule queries */functionInvocationModule: { - /** Invalidate all functionInvocationModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionInvocationModuleKeys.all - }), - /** Invalidate functionInvocationModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionInvocationModuleKeys.lists() - }), - /** Invalidate a specific functionInvocationModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionInvocationModuleKeys.detail(id) - }) - }, - /** Invalidate functionModule queries */functionModule: { - /** Invalidate all functionModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionModuleKeys.all - }), - /** Invalidate functionModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionModuleKeys.lists() - }), - /** Invalidate a specific functionModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: functionModuleKeys.detail(id) - }) - }, - /** Invalidate graphExecutionModule queries */graphExecutionModule: { - /** Invalidate all graphExecutionModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: graphExecutionModuleKeys.all - }), - /** Invalidate graphExecutionModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: graphExecutionModuleKeys.lists() - }), - /** Invalidate a specific graphExecutionModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: graphExecutionModuleKeys.detail(id) - }) - }, - /** Invalidate graphModule queries */graphModule: { - /** Invalidate all graphModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: graphModuleKeys.all - }), - /** Invalidate graphModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: graphModuleKeys.lists() - }), - /** Invalidate a specific graphModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: graphModuleKeys.detail(id) - }) - }, - /** Invalidate hierarchyModule queries */hierarchyModule: { - /** Invalidate all hierarchyModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: hierarchyModuleKeys.all - }), - /** Invalidate hierarchyModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: hierarchyModuleKeys.lists() - }), - /** Invalidate a specific hierarchyModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: hierarchyModuleKeys.detail(id) - }) - }, - /** Invalidate httpRouteModule queries */httpRouteModule: { - /** Invalidate all httpRouteModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: httpRouteModuleKeys.all - }), - /** Invalidate httpRouteModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: httpRouteModuleKeys.lists() - }), - /** Invalidate a specific httpRouteModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: httpRouteModuleKeys.detail(id) - }) - }, - /** Invalidate i18NModule queries */i18NModule: { - /** Invalidate all i18NModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: i18NModuleKeys.all - }), - /** Invalidate i18NModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: i18NModuleKeys.lists() - }), - /** Invalidate a specific i18NModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: i18NModuleKeys.detail(id) - }) - }, - /** Invalidate identityProvidersModule queries */identityProvidersModule: { - /** Invalidate all identityProvidersModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: identityProvidersModuleKeys.all - }), - /** Invalidate identityProvidersModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: identityProvidersModuleKeys.lists() - }), - /** Invalidate a specific identityProvidersModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: identityProvidersModuleKeys.detail(id) - }) - }, - /** Invalidate inferenceLogModule queries */inferenceLogModule: { - /** Invalidate all inferenceLogModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: inferenceLogModuleKeys.all - }), - /** Invalidate inferenceLogModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: inferenceLogModuleKeys.lists() - }), - /** Invalidate a specific inferenceLogModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: inferenceLogModuleKeys.detail(id) - }) - }, - /** Invalidate infraConfigModule queries */infraConfigModule: { - /** Invalidate all infraConfigModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraConfigModuleKeys.all - }), - /** Invalidate infraConfigModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraConfigModuleKeys.lists() - }), - /** Invalidate a specific infraConfigModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: infraConfigModuleKeys.detail(id) - }) - }, - /** Invalidate infraSecretsModule queries */infraSecretsModule: { - /** Invalidate all infraSecretsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraSecretsModuleKeys.all - }), - /** Invalidate infraSecretsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: infraSecretsModuleKeys.lists() - }), - /** Invalidate a specific infraSecretsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: infraSecretsModuleKeys.detail(id) - }) - }, - /** Invalidate integrationProvidersModule queries */integrationProvidersModule: { - /** Invalidate all integrationProvidersModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: integrationProvidersModuleKeys.all - }), - /** Invalidate integrationProvidersModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: integrationProvidersModuleKeys.lists() - }), - /** Invalidate a specific integrationProvidersModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: integrationProvidersModuleKeys.detail(id) - }) - }, - /** Invalidate internalSecretsModule queries */internalSecretsModule: { - /** Invalidate all internalSecretsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: internalSecretsModuleKeys.all - }), - /** Invalidate internalSecretsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: internalSecretsModuleKeys.lists() - }), - /** Invalidate a specific internalSecretsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: internalSecretsModuleKeys.detail(id) - }) - }, - /** Invalidate invitesModule queries */invitesModule: { - /** Invalidate all invitesModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: invitesModuleKeys.all - }), - /** Invalidate invitesModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: invitesModuleKeys.lists() - }), - /** Invalidate a specific invitesModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: invitesModuleKeys.detail(id) - }) - }, - /** Invalidate limitsModule queries */limitsModule: { - /** Invalidate all limitsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: limitsModuleKeys.all - }), - /** Invalidate limitsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: limitsModuleKeys.lists() - }), - /** Invalidate a specific limitsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: limitsModuleKeys.detail(id) - }) - }, - /** Invalidate membershipTypesModule queries */membershipTypesModule: { - /** Invalidate all membershipTypesModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: membershipTypesModuleKeys.all - }), - /** Invalidate membershipTypesModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: membershipTypesModuleKeys.lists() - }), - /** Invalidate a specific membershipTypesModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: membershipTypesModuleKeys.detail(id) - }) - }, - /** Invalidate membershipsModule queries */membershipsModule: { - /** Invalidate all membershipsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: membershipsModuleKeys.all - }), - /** Invalidate membershipsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: membershipsModuleKeys.lists() - }), - /** Invalidate a specific membershipsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: membershipsModuleKeys.detail(id) - }) - }, - /** Invalidate merkleStoreModule queries */merkleStoreModule: { - /** Invalidate all merkleStoreModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.all - }), - /** Invalidate merkleStoreModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.lists() - }), - /** Invalidate a specific merkleStoreModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.detail(id) - }) - }, - /** Invalidate namespaceModule queries */namespaceModule: { - /** Invalidate all namespaceModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.all - }), - /** Invalidate namespaceModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.lists() - }), - /** Invalidate a specific namespaceModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.detail(id) - }) - }, - /** Invalidate notificationsModule queries */notificationsModule: { - /** Invalidate all notificationsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: notificationsModuleKeys.all - }), - /** Invalidate notificationsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: notificationsModuleKeys.lists() - }), - /** Invalidate a specific notificationsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: notificationsModuleKeys.detail(id) - }) - }, - /** Invalidate permissionsModule queries */permissionsModule: { - /** Invalidate all permissionsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: permissionsModuleKeys.all - }), - /** Invalidate permissionsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: permissionsModuleKeys.lists() - }), - /** Invalidate a specific permissionsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: permissionsModuleKeys.detail(id) - }) - }, - /** Invalidate phoneNumbersModule queries */phoneNumbersModule: { - /** Invalidate all phoneNumbersModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: phoneNumbersModuleKeys.all - }), - /** Invalidate phoneNumbersModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: phoneNumbersModuleKeys.lists() - }), - /** Invalidate a specific phoneNumbersModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: phoneNumbersModuleKeys.detail(id) - }) - }, - /** Invalidate plansModule queries */plansModule: { - /** Invalidate all plansModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: plansModuleKeys.all - }), - /** Invalidate plansModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: plansModuleKeys.lists() - }), - /** Invalidate a specific plansModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: plansModuleKeys.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 profilesModule queries */profilesModule: { - /** Invalidate all profilesModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: profilesModuleKeys.all - }), - /** Invalidate profilesModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: profilesModuleKeys.lists() - }), - /** Invalidate a specific profilesModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: profilesModuleKeys.detail(id) - }) - }, - /** Invalidate rateLimitMetersModule queries */rateLimitMetersModule: { - /** Invalidate all rateLimitMetersModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: rateLimitMetersModuleKeys.all - }), - /** Invalidate rateLimitMetersModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: rateLimitMetersModuleKeys.lists() - }), - /** Invalidate a specific rateLimitMetersModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: rateLimitMetersModuleKeys.detail(id) - }) - }, - /** Invalidate rateLimitsModule queries */rateLimitsModule: { - /** Invalidate all rateLimitsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: rateLimitsModuleKeys.all - }), - /** Invalidate rateLimitsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: rateLimitsModuleKeys.lists() - }), - /** Invalidate a specific rateLimitsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: rateLimitsModuleKeys.detail(id) - }) - }, - /** Invalidate realtimeModule queries */realtimeModule: { - /** Invalidate all realtimeModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: realtimeModuleKeys.all - }), - /** Invalidate realtimeModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: realtimeModuleKeys.lists() - }), - /** Invalidate a specific realtimeModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: realtimeModuleKeys.detail(id) - }) - }, - /** Invalidate relationProvision queries */relationProvision: { - /** Invalidate all relationProvision queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: relationProvisionKeys.all - }), - /** Invalidate relationProvision list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: relationProvisionKeys.lists() - }), - /** Invalidate a specific relationProvision */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: relationProvisionKeys.detail(id) - }) - }, - /** Invalidate resourceModule queries */resourceModule: { - /** Invalidate all resourceModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceModuleKeys.all - }), - /** Invalidate resourceModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: resourceModuleKeys.lists() - }), - /** Invalidate a specific resourceModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: resourceModuleKeys.detail(id) - }) - }, - /** Invalidate rlsModule queries */rlsModule: { - /** Invalidate all rlsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: rlsModuleKeys.all - }), - /** Invalidate rlsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: rlsModuleKeys.lists() - }), - /** Invalidate a specific rlsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: rlsModuleKeys.detail(id) - }) - }, - /** Invalidate routeModule queries */routeModule: { - /** Invalidate all routeModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: routeModuleKeys.all - }), - /** Invalidate routeModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: routeModuleKeys.lists() - }), - /** Invalidate a specific routeModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: routeModuleKeys.detail(id) - }) - }, - /** Invalidate secureTableProvision queries */secureTableProvision: { - /** Invalidate all secureTableProvision queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: secureTableProvisionKeys.all - }), - /** Invalidate secureTableProvision list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: secureTableProvisionKeys.lists() - }), - /** Invalidate a specific secureTableProvision */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: secureTableProvisionKeys.detail(id) - }) - }, - /** Invalidate sessionSecretsModule queries */sessionSecretsModule: { - /** Invalidate all sessionSecretsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: sessionSecretsModuleKeys.all - }), - /** Invalidate sessionSecretsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: sessionSecretsModuleKeys.lists() - }), - /** Invalidate a specific sessionSecretsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: sessionSecretsModuleKeys.detail(id) - }) - }, - /** Invalidate sessionsModule queries */sessionsModule: { - /** Invalidate all sessionsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: sessionsModuleKeys.all - }), - /** Invalidate sessionsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: sessionsModuleKeys.lists() - }), - /** Invalidate a specific sessionsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: sessionsModuleKeys.detail(id) - }) - }, - /** Invalidate siteSurfaceModule queries */siteSurfaceModule: { - /** Invalidate all siteSurfaceModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteSurfaceModuleKeys.all - }), - /** Invalidate siteSurfaceModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: siteSurfaceModuleKeys.lists() - }), - /** Invalidate a specific siteSurfaceModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: siteSurfaceModuleKeys.detail(id) - }) - }, - /** Invalidate storageLogModule queries */storageLogModule: { - /** Invalidate all storageLogModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: storageLogModuleKeys.all - }), - /** Invalidate storageLogModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: storageLogModuleKeys.lists() - }), - /** Invalidate a specific storageLogModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: storageLogModuleKeys.detail(id) - }) - }, - /** Invalidate storageModule queries */storageModule: { - /** Invalidate all storageModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: storageModuleKeys.all - }), - /** Invalidate storageModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: storageModuleKeys.lists() - }), - /** Invalidate a specific storageModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: storageModuleKeys.detail(id) - }) - }, - /** Invalidate transferLogModule queries */transferLogModule: { - /** Invalidate all transferLogModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: transferLogModuleKeys.all - }), - /** Invalidate transferLogModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: transferLogModuleKeys.lists() - }), - /** Invalidate a specific transferLogModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: transferLogModuleKeys.detail(id) - }) - }, - /** Invalidate userAuthModule queries */userAuthModule: { - /** Invalidate all userAuthModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userAuthModuleKeys.all - }), - /** Invalidate userAuthModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userAuthModuleKeys.lists() - }), - /** Invalidate a specific userAuthModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: userAuthModuleKeys.detail(id) - }) - }, - /** Invalidate userCredentialsModule queries */userCredentialsModule: { - /** Invalidate all userCredentialsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userCredentialsModuleKeys.all - }), - /** Invalidate userCredentialsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userCredentialsModuleKeys.lists() - }), - /** Invalidate a specific userCredentialsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: userCredentialsModuleKeys.detail(id) - }) - }, - /** Invalidate userSettingsModule queries */userSettingsModule: { - /** Invalidate all userSettingsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userSettingsModuleKeys.all - }), - /** Invalidate userSettingsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userSettingsModuleKeys.lists() - }), - /** Invalidate a specific userSettingsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: userSettingsModuleKeys.detail(id) - }) - }, - /** Invalidate userStateModule queries */userStateModule: { - /** Invalidate all userStateModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userStateModuleKeys.all - }), - /** Invalidate userStateModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: userStateModuleKeys.lists() - }), - /** Invalidate a specific userStateModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: userStateModuleKeys.detail(id) - }) - }, - /** Invalidate usersModule queries */usersModule: { - /** Invalidate all usersModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: usersModuleKeys.all - }), - /** Invalidate usersModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: usersModuleKeys.lists() - }), - /** Invalidate a specific usersModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: usersModuleKeys.detail(id) - }) - }, - /** Invalidate webauthnAuthModule queries */webauthnAuthModule: { - /** Invalidate all webauthnAuthModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webauthnAuthModuleKeys.all - }), - /** Invalidate webauthnAuthModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webauthnAuthModuleKeys.lists() - }), - /** Invalidate a specific webauthnAuthModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: webauthnAuthModuleKeys.detail(id) - }) - }, - /** Invalidate webauthnCredentialsModule queries */webauthnCredentialsModule: { - /** Invalidate all webauthnCredentialsModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webauthnCredentialsModuleKeys.all - }), - /** Invalidate webauthnCredentialsModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webauthnCredentialsModuleKeys.lists() - }), - /** Invalidate a specific webauthnCredentialsModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: webauthnCredentialsModuleKeys.detail(id) - }) - }, - /** Invalidate webhookModule queries */webhookModule: { - /** Invalidate all webhookModule queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webhookModuleKeys.all - }), - /** Invalidate webhookModule list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: webhookModuleKeys.lists() - }), - /** Invalidate a specific webhookModule */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: webhookModuleKeys.detail(id) - }) - } + /** Invalidate agentModule queries */ agentModule: { + /** Invalidate all agentModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentModuleKeys.all, + }), + /** Invalidate agentModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: agentModuleKeys.lists(), + }), + /** Invalidate a specific agentModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: agentModuleKeys.detail(id), + }), + }, + /** Invalidate apiSurfaceModule queries */ apiSurfaceModule: { + /** Invalidate all apiSurfaceModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiSurfaceModuleKeys.all, + }), + /** Invalidate apiSurfaceModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: apiSurfaceModuleKeys.lists(), + }), + /** Invalidate a specific apiSurfaceModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: apiSurfaceModuleKeys.detail(id), + }), + }, + /** Invalidate appModule queries */ appModule: { + /** Invalidate all appModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appModuleKeys.all, + }), + /** Invalidate appModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appModuleKeys.lists(), + }), + /** Invalidate a specific appModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appModuleKeys.detail(id), + }), + }, + /** Invalidate billingModule queries */ billingModule: { + /** Invalidate all billingModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: billingModuleKeys.all, + }), + /** Invalidate billingModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: billingModuleKeys.lists(), + }), + /** Invalidate a specific billingModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: billingModuleKeys.detail(id), + }), + }, + /** Invalidate billingProviderModule queries */ billingProviderModule: { + /** Invalidate all billingProviderModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: billingProviderModuleKeys.all, + }), + /** Invalidate billingProviderModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: billingProviderModuleKeys.lists(), + }), + /** Invalidate a specific billingProviderModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: billingProviderModuleKeys.detail(id), + }), + }, + /** Invalidate blueprint queries */ blueprint: { + /** Invalidate all blueprint queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: blueprintKeys.all, + }), + /** Invalidate blueprint list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: blueprintKeys.lists(), + }), + /** Invalidate a specific blueprint */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: blueprintKeys.detail(id), + }), + }, + /** Invalidate blueprintConstruction queries */ blueprintConstruction: { + /** Invalidate all blueprintConstruction queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: blueprintConstructionKeys.all, + }), + /** Invalidate blueprintConstruction list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: blueprintConstructionKeys.lists(), + }), + /** Invalidate a specific blueprintConstruction */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: blueprintConstructionKeys.detail(id), + }), + }, + /** Invalidate blueprintTemplate queries */ blueprintTemplate: { + /** Invalidate all blueprintTemplate queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: blueprintTemplateKeys.all, + }), + /** Invalidate blueprintTemplate list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: blueprintTemplateKeys.lists(), + }), + /** Invalidate a specific blueprintTemplate */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: blueprintTemplateKeys.detail(id), + }), + }, + /** Invalidate catalogModule queries */ catalogModule: { + /** Invalidate all catalogModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: catalogModuleKeys.all, + }), + /** Invalidate catalogModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: catalogModuleKeys.lists(), + }), + /** Invalidate a specific catalogModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: catalogModuleKeys.detail(id), + }), + }, + /** Invalidate computeLogModule queries */ computeLogModule: { + /** Invalidate all computeLogModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: computeLogModuleKeys.all, + }), + /** Invalidate computeLogModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: computeLogModuleKeys.lists(), + }), + /** Invalidate a specific computeLogModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: computeLogModuleKeys.detail(id), + }), + }, + /** Invalidate configSecretsUserModule queries */ configSecretsUserModule: { + /** Invalidate all configSecretsUserModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: configSecretsUserModuleKeys.all, + }), + /** Invalidate configSecretsUserModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: configSecretsUserModuleKeys.lists(), + }), + /** Invalidate a specific configSecretsUserModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: configSecretsUserModuleKeys.detail(id), + }), + }, + /** Invalidate connectedAccountsModule queries */ connectedAccountsModule: { + /** Invalidate all connectedAccountsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: connectedAccountsModuleKeys.all, + }), + /** Invalidate connectedAccountsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: connectedAccountsModuleKeys.lists(), + }), + /** Invalidate a specific connectedAccountsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: connectedAccountsModuleKeys.detail(id), + }), + }, + /** Invalidate cryptoAddressesModule queries */ cryptoAddressesModule: { + /** Invalidate all cryptoAddressesModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: cryptoAddressesModuleKeys.all, + }), + /** Invalidate cryptoAddressesModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: cryptoAddressesModuleKeys.lists(), + }), + /** Invalidate a specific cryptoAddressesModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: cryptoAddressesModuleKeys.detail(id), + }), + }, + /** Invalidate cryptoAuthModule queries */ cryptoAuthModule: { + /** Invalidate all cryptoAuthModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: cryptoAuthModuleKeys.all, + }), + /** Invalidate cryptoAuthModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: cryptoAuthModuleKeys.lists(), + }), + /** Invalidate a specific cryptoAuthModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: cryptoAuthModuleKeys.detail(id), + }), + }, + /** Invalidate databaseProvisionModule queries */ databaseProvisionModule: { + /** Invalidate all databaseProvisionModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseProvisionModuleKeys.all, + }), + /** Invalidate databaseProvisionModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseProvisionModuleKeys.lists(), + }), + /** Invalidate a specific databaseProvisionModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: databaseProvisionModuleKeys.detail(id), + }), + }, + /** Invalidate databaseSettingsModule queries */ databaseSettingsModule: { + /** Invalidate all databaseSettingsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseSettingsModuleKeys.all, + }), + /** Invalidate databaseSettingsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: databaseSettingsModuleKeys.lists(), + }), + /** Invalidate a specific databaseSettingsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: databaseSettingsModuleKeys.detail(id), + }), + }, + /** Invalidate dbPoolConfig queries */ dbPoolConfig: { + /** Invalidate all dbPoolConfig queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPoolConfigKeys.all, + }), + /** Invalidate dbPoolConfig list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPoolConfigKeys.lists(), + }), + /** Invalidate a specific dbPoolConfig */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: dbPoolConfigKeys.detail(id), + }), + }, + /** Invalidate dbPool queries */ dbPool: { + /** Invalidate all dbPool queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPoolKeys.all, + }), + /** Invalidate dbPool list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPoolKeys.lists(), + }), + /** Invalidate a specific dbPool */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: dbPoolKeys.detail(id), + }), + }, + /** Invalidate dbPresetModule queries */ dbPresetModule: { + /** Invalidate all dbPresetModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPresetModuleKeys.all, + }), + /** Invalidate dbPresetModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbPresetModuleKeys.lists(), + }), + /** Invalidate a specific dbPresetModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: dbPresetModuleKeys.detail(id), + }), + }, + /** Invalidate dbUsageModule queries */ dbUsageModule: { + /** Invalidate all dbUsageModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbUsageModuleKeys.all, + }), + /** Invalidate dbUsageModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: dbUsageModuleKeys.lists(), + }), + /** Invalidate a specific dbUsageModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: dbUsageModuleKeys.detail(id), + }), + }, + /** Invalidate defaultIdsModule queries */ defaultIdsModule: { + /** Invalidate all defaultIdsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: defaultIdsModuleKeys.all, + }), + /** Invalidate defaultIdsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: defaultIdsModuleKeys.lists(), + }), + /** Invalidate a specific defaultIdsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: defaultIdsModuleKeys.detail(id), + }), + }, + /** Invalidate denormalizedTableField queries */ denormalizedTableField: { + /** Invalidate all denormalizedTableField queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: denormalizedTableFieldKeys.all, + }), + /** Invalidate denormalizedTableField list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: denormalizedTableFieldKeys.lists(), + }), + /** Invalidate a specific denormalizedTableField */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: denormalizedTableFieldKeys.detail(id), + }), + }, + /** Invalidate devicesModule queries */ devicesModule: { + /** Invalidate all devicesModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.all, + }), + /** Invalidate devicesModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.lists(), + }), + /** Invalidate a specific devicesModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: devicesModuleKeys.detail(id), + }), + }, + /** Invalidate domainModule queries */ domainModule: { + /** Invalidate all domainModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: domainModuleKeys.all, + }), + /** Invalidate domainModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: domainModuleKeys.lists(), + }), + /** Invalidate a specific domainModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: domainModuleKeys.detail(id), + }), + }, + /** Invalidate emailsModule queries */ emailsModule: { + /** Invalidate all emailsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: emailsModuleKeys.all, + }), + /** Invalidate emailsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: emailsModuleKeys.lists(), + }), + /** Invalidate a specific emailsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: emailsModuleKeys.detail(id), + }), + }, + /** Invalidate entityTypeProvision queries */ entityTypeProvision: { + /** Invalidate all entityTypeProvision queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: entityTypeProvisionKeys.all, + }), + /** Invalidate entityTypeProvision list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: entityTypeProvisionKeys.lists(), + }), + /** Invalidate a specific entityTypeProvision */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: entityTypeProvisionKeys.detail(id), + }), + }, + /** Invalidate eventsModule queries */ eventsModule: { + /** Invalidate all eventsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: eventsModuleKeys.all, + }), + /** Invalidate eventsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: eventsModuleKeys.lists(), + }), + /** Invalidate a specific eventsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: eventsModuleKeys.detail(id), + }), + }, + /** Invalidate functionDeploymentModule queries */ functionDeploymentModule: { + /** Invalidate all functionDeploymentModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.all, + }), + /** Invalidate functionDeploymentModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.lists(), + }), + /** Invalidate a specific functionDeploymentModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.detail(id), + }), + }, + /** Invalidate functionInvocationModule queries */ functionInvocationModule: { + /** Invalidate all functionInvocationModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionInvocationModuleKeys.all, + }), + /** Invalidate functionInvocationModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionInvocationModuleKeys.lists(), + }), + /** Invalidate a specific functionInvocationModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionInvocationModuleKeys.detail(id), + }), + }, + /** Invalidate functionModule queries */ functionModule: { + /** Invalidate all functionModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionModuleKeys.all, + }), + /** Invalidate functionModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionModuleKeys.lists(), + }), + /** Invalidate a specific functionModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionModuleKeys.detail(id), + }), + }, + /** Invalidate graphExecutionModule queries */ graphExecutionModule: { + /** Invalidate all graphExecutionModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.all, + }), + /** Invalidate graphExecutionModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.lists(), + }), + /** Invalidate a specific graphExecutionModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.detail(id), + }), + }, + /** Invalidate graphModule queries */ graphModule: { + /** Invalidate all graphModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: graphModuleKeys.all, + }), + /** Invalidate graphModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: graphModuleKeys.lists(), + }), + /** Invalidate a specific graphModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: graphModuleKeys.detail(id), + }), + }, + /** Invalidate hierarchyModule queries */ hierarchyModule: { + /** Invalidate all hierarchyModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: hierarchyModuleKeys.all, + }), + /** Invalidate hierarchyModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: hierarchyModuleKeys.lists(), + }), + /** Invalidate a specific hierarchyModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: hierarchyModuleKeys.detail(id), + }), + }, + /** Invalidate httpRouteModule queries */ httpRouteModule: { + /** Invalidate all httpRouteModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: httpRouteModuleKeys.all, + }), + /** Invalidate httpRouteModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: httpRouteModuleKeys.lists(), + }), + /** Invalidate a specific httpRouteModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: httpRouteModuleKeys.detail(id), + }), + }, + /** Invalidate i18NModule queries */ i18NModule: { + /** Invalidate all i18NModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: i18NModuleKeys.all, + }), + /** Invalidate i18NModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: i18NModuleKeys.lists(), + }), + /** Invalidate a specific i18NModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: i18NModuleKeys.detail(id), + }), + }, + /** Invalidate identityProvidersModule queries */ identityProvidersModule: { + /** Invalidate all identityProvidersModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: identityProvidersModuleKeys.all, + }), + /** Invalidate identityProvidersModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: identityProvidersModuleKeys.lists(), + }), + /** Invalidate a specific identityProvidersModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: identityProvidersModuleKeys.detail(id), + }), + }, + /** Invalidate inferenceLogModule queries */ inferenceLogModule: { + /** Invalidate all inferenceLogModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: inferenceLogModuleKeys.all, + }), + /** Invalidate inferenceLogModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: inferenceLogModuleKeys.lists(), + }), + /** Invalidate a specific inferenceLogModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: inferenceLogModuleKeys.detail(id), + }), + }, + /** Invalidate infraConfigModule queries */ infraConfigModule: { + /** Invalidate all infraConfigModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraConfigModuleKeys.all, + }), + /** Invalidate infraConfigModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraConfigModuleKeys.lists(), + }), + /** Invalidate a specific infraConfigModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: infraConfigModuleKeys.detail(id), + }), + }, + /** Invalidate infraSecretsModule queries */ infraSecretsModule: { + /** Invalidate all infraSecretsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraSecretsModuleKeys.all, + }), + /** Invalidate infraSecretsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: infraSecretsModuleKeys.lists(), + }), + /** Invalidate a specific infraSecretsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: infraSecretsModuleKeys.detail(id), + }), + }, + /** Invalidate integrationProvidersModule queries */ integrationProvidersModule: { + /** Invalidate all integrationProvidersModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: integrationProvidersModuleKeys.all, + }), + /** Invalidate integrationProvidersModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: integrationProvidersModuleKeys.lists(), + }), + /** Invalidate a specific integrationProvidersModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: integrationProvidersModuleKeys.detail(id), + }), + }, + /** Invalidate internalSecretsModule queries */ internalSecretsModule: { + /** Invalidate all internalSecretsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: internalSecretsModuleKeys.all, + }), + /** Invalidate internalSecretsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: internalSecretsModuleKeys.lists(), + }), + /** Invalidate a specific internalSecretsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: internalSecretsModuleKeys.detail(id), + }), + }, + /** Invalidate invitesModule queries */ invitesModule: { + /** Invalidate all invitesModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: invitesModuleKeys.all, + }), + /** Invalidate invitesModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: invitesModuleKeys.lists(), + }), + /** Invalidate a specific invitesModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: invitesModuleKeys.detail(id), + }), + }, + /** Invalidate limitsModule queries */ limitsModule: { + /** Invalidate all limitsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: limitsModuleKeys.all, + }), + /** Invalidate limitsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: limitsModuleKeys.lists(), + }), + /** Invalidate a specific limitsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: limitsModuleKeys.detail(id), + }), + }, + /** Invalidate membershipTypesModule queries */ membershipTypesModule: { + /** Invalidate all membershipTypesModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: membershipTypesModuleKeys.all, + }), + /** Invalidate membershipTypesModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: membershipTypesModuleKeys.lists(), + }), + /** Invalidate a specific membershipTypesModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: membershipTypesModuleKeys.detail(id), + }), + }, + /** Invalidate membershipsModule queries */ membershipsModule: { + /** Invalidate all membershipsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: membershipsModuleKeys.all, + }), + /** Invalidate membershipsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: membershipsModuleKeys.lists(), + }), + /** Invalidate a specific membershipsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: membershipsModuleKeys.detail(id), + }), + }, + /** Invalidate merkleStoreModule queries */ merkleStoreModule: { + /** Invalidate all merkleStoreModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: merkleStoreModuleKeys.all, + }), + /** Invalidate merkleStoreModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: merkleStoreModuleKeys.lists(), + }), + /** Invalidate a specific merkleStoreModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: merkleStoreModuleKeys.detail(id), + }), + }, + /** Invalidate namespaceModule queries */ namespaceModule: { + /** Invalidate all namespaceModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceModuleKeys.all, + }), + /** Invalidate namespaceModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceModuleKeys.lists(), + }), + /** Invalidate a specific namespaceModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: namespaceModuleKeys.detail(id), + }), + }, + /** Invalidate notificationsModule queries */ notificationsModule: { + /** Invalidate all notificationsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: notificationsModuleKeys.all, + }), + /** Invalidate notificationsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: notificationsModuleKeys.lists(), + }), + /** Invalidate a specific notificationsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: notificationsModuleKeys.detail(id), + }), + }, + /** Invalidate permissionsModule queries */ permissionsModule: { + /** Invalidate all permissionsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: permissionsModuleKeys.all, + }), + /** Invalidate permissionsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: permissionsModuleKeys.lists(), + }), + /** Invalidate a specific permissionsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: permissionsModuleKeys.detail(id), + }), + }, + /** Invalidate phoneNumbersModule queries */ phoneNumbersModule: { + /** Invalidate all phoneNumbersModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: phoneNumbersModuleKeys.all, + }), + /** Invalidate phoneNumbersModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: phoneNumbersModuleKeys.lists(), + }), + /** Invalidate a specific phoneNumbersModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: phoneNumbersModuleKeys.detail(id), + }), + }, + /** Invalidate plansModule queries */ plansModule: { + /** Invalidate all plansModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: plansModuleKeys.all, + }), + /** Invalidate plansModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: plansModuleKeys.lists(), + }), + /** Invalidate a specific plansModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: plansModuleKeys.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 profilesModule queries */ profilesModule: { + /** Invalidate all profilesModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: profilesModuleKeys.all, + }), + /** Invalidate profilesModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: profilesModuleKeys.lists(), + }), + /** Invalidate a specific profilesModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: profilesModuleKeys.detail(id), + }), + }, + /** Invalidate rateLimitMetersModule queries */ rateLimitMetersModule: { + /** Invalidate all rateLimitMetersModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: rateLimitMetersModuleKeys.all, + }), + /** Invalidate rateLimitMetersModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: rateLimitMetersModuleKeys.lists(), + }), + /** Invalidate a specific rateLimitMetersModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: rateLimitMetersModuleKeys.detail(id), + }), + }, + /** Invalidate rateLimitsModule queries */ rateLimitsModule: { + /** Invalidate all rateLimitsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: rateLimitsModuleKeys.all, + }), + /** Invalidate rateLimitsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: rateLimitsModuleKeys.lists(), + }), + /** Invalidate a specific rateLimitsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: rateLimitsModuleKeys.detail(id), + }), + }, + /** Invalidate realtimeModule queries */ realtimeModule: { + /** Invalidate all realtimeModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: realtimeModuleKeys.all, + }), + /** Invalidate realtimeModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: realtimeModuleKeys.lists(), + }), + /** Invalidate a specific realtimeModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: realtimeModuleKeys.detail(id), + }), + }, + /** Invalidate relationProvision queries */ relationProvision: { + /** Invalidate all relationProvision queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: relationProvisionKeys.all, + }), + /** Invalidate relationProvision list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: relationProvisionKeys.lists(), + }), + /** Invalidate a specific relationProvision */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: relationProvisionKeys.detail(id), + }), + }, + /** Invalidate resourceModule queries */ resourceModule: { + /** Invalidate all resourceModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceModuleKeys.all, + }), + /** Invalidate resourceModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: resourceModuleKeys.lists(), + }), + /** Invalidate a specific resourceModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: resourceModuleKeys.detail(id), + }), + }, + /** Invalidate rlsModule queries */ rlsModule: { + /** Invalidate all rlsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: rlsModuleKeys.all, + }), + /** Invalidate rlsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: rlsModuleKeys.lists(), + }), + /** Invalidate a specific rlsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: rlsModuleKeys.detail(id), + }), + }, + /** Invalidate routeModule queries */ routeModule: { + /** Invalidate all routeModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: routeModuleKeys.all, + }), + /** Invalidate routeModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: routeModuleKeys.lists(), + }), + /** Invalidate a specific routeModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: routeModuleKeys.detail(id), + }), + }, + /** Invalidate secureTableProvision queries */ secureTableProvision: { + /** Invalidate all secureTableProvision queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: secureTableProvisionKeys.all, + }), + /** Invalidate secureTableProvision list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: secureTableProvisionKeys.lists(), + }), + /** Invalidate a specific secureTableProvision */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: secureTableProvisionKeys.detail(id), + }), + }, + /** Invalidate sessionSecretsModule queries */ sessionSecretsModule: { + /** Invalidate all sessionSecretsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: sessionSecretsModuleKeys.all, + }), + /** Invalidate sessionSecretsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: sessionSecretsModuleKeys.lists(), + }), + /** Invalidate a specific sessionSecretsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: sessionSecretsModuleKeys.detail(id), + }), + }, + /** Invalidate sessionsModule queries */ sessionsModule: { + /** Invalidate all sessionsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: sessionsModuleKeys.all, + }), + /** Invalidate sessionsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: sessionsModuleKeys.lists(), + }), + /** Invalidate a specific sessionsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: sessionsModuleKeys.detail(id), + }), + }, + /** Invalidate siteSurfaceModule queries */ siteSurfaceModule: { + /** Invalidate all siteSurfaceModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteSurfaceModuleKeys.all, + }), + /** Invalidate siteSurfaceModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: siteSurfaceModuleKeys.lists(), + }), + /** Invalidate a specific siteSurfaceModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: siteSurfaceModuleKeys.detail(id), + }), + }, + /** Invalidate storageLogModule queries */ storageLogModule: { + /** Invalidate all storageLogModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: storageLogModuleKeys.all, + }), + /** Invalidate storageLogModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: storageLogModuleKeys.lists(), + }), + /** Invalidate a specific storageLogModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: storageLogModuleKeys.detail(id), + }), + }, + /** Invalidate storageModule queries */ storageModule: { + /** Invalidate all storageModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: storageModuleKeys.all, + }), + /** Invalidate storageModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: storageModuleKeys.lists(), + }), + /** Invalidate a specific storageModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: storageModuleKeys.detail(id), + }), + }, + /** Invalidate transferLogModule queries */ transferLogModule: { + /** Invalidate all transferLogModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: transferLogModuleKeys.all, + }), + /** Invalidate transferLogModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: transferLogModuleKeys.lists(), + }), + /** Invalidate a specific transferLogModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: transferLogModuleKeys.detail(id), + }), + }, + /** Invalidate userAuthModule queries */ userAuthModule: { + /** Invalidate all userAuthModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userAuthModuleKeys.all, + }), + /** Invalidate userAuthModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userAuthModuleKeys.lists(), + }), + /** Invalidate a specific userAuthModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: userAuthModuleKeys.detail(id), + }), + }, + /** Invalidate userCredentialsModule queries */ userCredentialsModule: { + /** Invalidate all userCredentialsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userCredentialsModuleKeys.all, + }), + /** Invalidate userCredentialsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userCredentialsModuleKeys.lists(), + }), + /** Invalidate a specific userCredentialsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: userCredentialsModuleKeys.detail(id), + }), + }, + /** Invalidate userSettingsModule queries */ userSettingsModule: { + /** Invalidate all userSettingsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userSettingsModuleKeys.all, + }), + /** Invalidate userSettingsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userSettingsModuleKeys.lists(), + }), + /** Invalidate a specific userSettingsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: userSettingsModuleKeys.detail(id), + }), + }, + /** Invalidate userStateModule queries */ userStateModule: { + /** Invalidate all userStateModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userStateModuleKeys.all, + }), + /** Invalidate userStateModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: userStateModuleKeys.lists(), + }), + /** Invalidate a specific userStateModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: userStateModuleKeys.detail(id), + }), + }, + /** Invalidate usersModule queries */ usersModule: { + /** Invalidate all usersModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: usersModuleKeys.all, + }), + /** Invalidate usersModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: usersModuleKeys.lists(), + }), + /** Invalidate a specific usersModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: usersModuleKeys.detail(id), + }), + }, + /** Invalidate webauthnAuthModule queries */ webauthnAuthModule: { + /** Invalidate all webauthnAuthModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webauthnAuthModuleKeys.all, + }), + /** Invalidate webauthnAuthModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webauthnAuthModuleKeys.lists(), + }), + /** Invalidate a specific webauthnAuthModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: webauthnAuthModuleKeys.detail(id), + }), + }, + /** Invalidate webauthnCredentialsModule queries */ webauthnCredentialsModule: { + /** Invalidate all webauthnCredentialsModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webauthnCredentialsModuleKeys.all, + }), + /** Invalidate webauthnCredentialsModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webauthnCredentialsModuleKeys.lists(), + }), + /** Invalidate a specific webauthnCredentialsModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: webauthnCredentialsModuleKeys.detail(id), + }), + }, + /** Invalidate webhookModule queries */ webhookModule: { + /** Invalidate all webhookModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webhookModuleKeys.all, + }), + /** Invalidate webhookModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: webhookModuleKeys.lists(), + }), + /** Invalidate a specific webhookModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: webhookModuleKeys.detail(id), + }), + }, } as const; /** @@ -873,379 +1396,592 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove agentModule from cache */agentModule: (queryClient: QueryClient, id: string | number) => { + /** Remove agentModule from cache */ agentModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: agentModuleKeys.detail(id) + queryKey: agentModuleKeys.detail(id), }); }, - /** Remove apiSurfaceModule from cache */apiSurfaceModule: (queryClient: QueryClient, id: string | number) => { + /** Remove apiSurfaceModule from cache */ apiSurfaceModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: apiSurfaceModuleKeys.detail(id) + queryKey: apiSurfaceModuleKeys.detail(id), }); }, - /** Remove appModule from cache */appModule: (queryClient: QueryClient, id: string | number) => { + /** Remove appModule from cache */ appModule: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: appModuleKeys.detail(id) + queryKey: appModuleKeys.detail(id), }); }, - /** Remove billingModule from cache */billingModule: (queryClient: QueryClient, id: string | number) => { + /** Remove billingModule from cache */ billingModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: billingModuleKeys.detail(id) + queryKey: billingModuleKeys.detail(id), }); }, - /** Remove billingProviderModule from cache */billingProviderModule: (queryClient: QueryClient, id: string | number) => { + /** Remove billingProviderModule from cache */ billingProviderModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: billingProviderModuleKeys.detail(id) + queryKey: billingProviderModuleKeys.detail(id), }); }, - /** Remove blueprint from cache */blueprint: (queryClient: QueryClient, id: string | number) => { + /** Remove blueprint from cache */ blueprint: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: blueprintKeys.detail(id) + queryKey: blueprintKeys.detail(id), }); }, - /** Remove blueprintConstruction from cache */blueprintConstruction: (queryClient: QueryClient, id: string | number) => { + /** Remove blueprintConstruction from cache */ blueprintConstruction: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: blueprintConstructionKeys.detail(id) + queryKey: blueprintConstructionKeys.detail(id), }); }, - /** Remove blueprintTemplate from cache */blueprintTemplate: (queryClient: QueryClient, id: string | number) => { + /** Remove blueprintTemplate from cache */ blueprintTemplate: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: blueprintTemplateKeys.detail(id) + queryKey: blueprintTemplateKeys.detail(id), }); }, - /** Remove catalogModule from cache */catalogModule: (queryClient: QueryClient, id: string | number) => { + /** Remove catalogModule from cache */ catalogModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: catalogModuleKeys.detail(id) + queryKey: catalogModuleKeys.detail(id), }); }, - /** Remove computeLogModule from cache */computeLogModule: (queryClient: QueryClient, id: string | number) => { + /** Remove computeLogModule from cache */ computeLogModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: computeLogModuleKeys.detail(id) + queryKey: computeLogModuleKeys.detail(id), }); }, - /** Remove configSecretsUserModule from cache */configSecretsUserModule: (queryClient: QueryClient, id: string | number) => { + /** Remove configSecretsUserModule from cache */ configSecretsUserModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: configSecretsUserModuleKeys.detail(id) + queryKey: configSecretsUserModuleKeys.detail(id), }); }, - /** Remove connectedAccountsModule from cache */connectedAccountsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove connectedAccountsModule from cache */ connectedAccountsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: connectedAccountsModuleKeys.detail(id) + queryKey: connectedAccountsModuleKeys.detail(id), }); }, - /** Remove cryptoAddressesModule from cache */cryptoAddressesModule: (queryClient: QueryClient, id: string | number) => { + /** Remove cryptoAddressesModule from cache */ cryptoAddressesModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: cryptoAddressesModuleKeys.detail(id) + queryKey: cryptoAddressesModuleKeys.detail(id), }); }, - /** Remove cryptoAuthModule from cache */cryptoAuthModule: (queryClient: QueryClient, id: string | number) => { + /** Remove cryptoAuthModule from cache */ cryptoAuthModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: cryptoAuthModuleKeys.detail(id) + queryKey: cryptoAuthModuleKeys.detail(id), }); }, - /** Remove databaseProvisionModule from cache */databaseProvisionModule: (queryClient: QueryClient, id: string | number) => { + /** Remove databaseProvisionModule from cache */ databaseProvisionModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: databaseProvisionModuleKeys.detail(id) + queryKey: databaseProvisionModuleKeys.detail(id), }); }, - /** Remove databaseSettingsModule from cache */databaseSettingsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove databaseSettingsModule from cache */ databaseSettingsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: databaseSettingsModuleKeys.detail(id) + queryKey: databaseSettingsModuleKeys.detail(id), }); }, - /** Remove dbPoolConfig from cache */dbPoolConfig: (queryClient: QueryClient, id: string | number) => { + /** Remove dbPoolConfig from cache */ dbPoolConfig: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: dbPoolConfigKeys.detail(id) + queryKey: dbPoolConfigKeys.detail(id), }); }, - /** Remove dbPool from cache */dbPool: (queryClient: QueryClient, id: string | number) => { + /** Remove dbPool from cache */ dbPool: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: dbPoolKeys.detail(id) + queryKey: dbPoolKeys.detail(id), }); }, - /** Remove dbPresetModule from cache */dbPresetModule: (queryClient: QueryClient, id: string | number) => { + /** Remove dbPresetModule from cache */ dbPresetModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: dbPresetModuleKeys.detail(id) + queryKey: dbPresetModuleKeys.detail(id), }); }, - /** Remove dbUsageModule from cache */dbUsageModule: (queryClient: QueryClient, id: string | number) => { + /** Remove dbUsageModule from cache */ dbUsageModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: dbUsageModuleKeys.detail(id) + queryKey: dbUsageModuleKeys.detail(id), }); }, - /** Remove defaultIdsModule from cache */defaultIdsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove defaultIdsModule from cache */ defaultIdsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: defaultIdsModuleKeys.detail(id) + queryKey: defaultIdsModuleKeys.detail(id), }); }, - /** Remove denormalizedTableField from cache */denormalizedTableField: (queryClient: QueryClient, id: string | number) => { + /** Remove denormalizedTableField from cache */ denormalizedTableField: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: denormalizedTableFieldKeys.detail(id) + queryKey: denormalizedTableFieldKeys.detail(id), }); }, - /** Remove devicesModule from cache */devicesModule: (queryClient: QueryClient, id: string | number) => { + /** Remove devicesModule from cache */ devicesModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: devicesModuleKeys.detail(id) + queryKey: devicesModuleKeys.detail(id), }); }, - /** Remove domainModule from cache */domainModule: (queryClient: QueryClient, id: string | number) => { + /** Remove domainModule from cache */ domainModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: domainModuleKeys.detail(id) + queryKey: domainModuleKeys.detail(id), }); }, - /** Remove emailsModule from cache */emailsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove emailsModule from cache */ emailsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: emailsModuleKeys.detail(id) + queryKey: emailsModuleKeys.detail(id), }); }, - /** Remove entityTypeProvision from cache */entityTypeProvision: (queryClient: QueryClient, id: string | number) => { + /** Remove entityTypeProvision from cache */ entityTypeProvision: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: entityTypeProvisionKeys.detail(id) + queryKey: entityTypeProvisionKeys.detail(id), }); }, - /** Remove eventsModule from cache */eventsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove eventsModule from cache */ eventsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: eventsModuleKeys.detail(id) + queryKey: eventsModuleKeys.detail(id), }); }, - /** Remove functionDeploymentModule from cache */functionDeploymentModule: (queryClient: QueryClient, id: string | number) => { + /** Remove functionDeploymentModule from cache */ functionDeploymentModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionDeploymentModuleKeys.detail(id) + queryKey: functionDeploymentModuleKeys.detail(id), }); }, - /** Remove functionInvocationModule from cache */functionInvocationModule: (queryClient: QueryClient, id: string | number) => { + /** Remove functionInvocationModule from cache */ functionInvocationModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionInvocationModuleKeys.detail(id) + queryKey: functionInvocationModuleKeys.detail(id), }); }, - /** Remove functionModule from cache */functionModule: (queryClient: QueryClient, id: string | number) => { + /** Remove functionModule from cache */ functionModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: functionModuleKeys.detail(id) + queryKey: functionModuleKeys.detail(id), }); }, - /** Remove graphExecutionModule from cache */graphExecutionModule: (queryClient: QueryClient, id: string | number) => { + /** Remove graphExecutionModule from cache */ graphExecutionModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: graphExecutionModuleKeys.detail(id) + queryKey: graphExecutionModuleKeys.detail(id), }); }, - /** Remove graphModule from cache */graphModule: (queryClient: QueryClient, id: string | number) => { + /** Remove graphModule from cache */ graphModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: graphModuleKeys.detail(id) + queryKey: graphModuleKeys.detail(id), }); }, - /** Remove hierarchyModule from cache */hierarchyModule: (queryClient: QueryClient, id: string | number) => { + /** Remove hierarchyModule from cache */ hierarchyModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: hierarchyModuleKeys.detail(id) + queryKey: hierarchyModuleKeys.detail(id), }); }, - /** Remove httpRouteModule from cache */httpRouteModule: (queryClient: QueryClient, id: string | number) => { + /** Remove httpRouteModule from cache */ httpRouteModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: httpRouteModuleKeys.detail(id) + queryKey: httpRouteModuleKeys.detail(id), }); }, - /** Remove i18NModule from cache */i18NModule: (queryClient: QueryClient, id: string | number) => { + /** Remove i18NModule from cache */ i18NModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: i18NModuleKeys.detail(id) + queryKey: i18NModuleKeys.detail(id), }); }, - /** Remove identityProvidersModule from cache */identityProvidersModule: (queryClient: QueryClient, id: string | number) => { + /** Remove identityProvidersModule from cache */ identityProvidersModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: identityProvidersModuleKeys.detail(id) + queryKey: identityProvidersModuleKeys.detail(id), }); }, - /** Remove inferenceLogModule from cache */inferenceLogModule: (queryClient: QueryClient, id: string | number) => { + /** Remove inferenceLogModule from cache */ inferenceLogModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: inferenceLogModuleKeys.detail(id) + queryKey: inferenceLogModuleKeys.detail(id), }); }, - /** Remove infraConfigModule from cache */infraConfigModule: (queryClient: QueryClient, id: string | number) => { + /** Remove infraConfigModule from cache */ infraConfigModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: infraConfigModuleKeys.detail(id) + queryKey: infraConfigModuleKeys.detail(id), }); }, - /** Remove infraSecretsModule from cache */infraSecretsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove infraSecretsModule from cache */ infraSecretsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: infraSecretsModuleKeys.detail(id) + queryKey: infraSecretsModuleKeys.detail(id), }); }, - /** Remove integrationProvidersModule from cache */integrationProvidersModule: (queryClient: QueryClient, id: string | number) => { + /** Remove integrationProvidersModule from cache */ integrationProvidersModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: integrationProvidersModuleKeys.detail(id) + queryKey: integrationProvidersModuleKeys.detail(id), }); }, - /** Remove internalSecretsModule from cache */internalSecretsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove internalSecretsModule from cache */ internalSecretsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: internalSecretsModuleKeys.detail(id) + queryKey: internalSecretsModuleKeys.detail(id), }); }, - /** Remove invitesModule from cache */invitesModule: (queryClient: QueryClient, id: string | number) => { + /** Remove invitesModule from cache */ invitesModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: invitesModuleKeys.detail(id) + queryKey: invitesModuleKeys.detail(id), }); }, - /** Remove limitsModule from cache */limitsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove limitsModule from cache */ limitsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: limitsModuleKeys.detail(id) + queryKey: limitsModuleKeys.detail(id), }); }, - /** Remove membershipTypesModule from cache */membershipTypesModule: (queryClient: QueryClient, id: string | number) => { + /** Remove membershipTypesModule from cache */ membershipTypesModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: membershipTypesModuleKeys.detail(id) + queryKey: membershipTypesModuleKeys.detail(id), }); }, - /** Remove membershipsModule from cache */membershipsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove membershipsModule from cache */ membershipsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: membershipsModuleKeys.detail(id) + queryKey: membershipsModuleKeys.detail(id), }); }, - /** Remove merkleStoreModule from cache */merkleStoreModule: (queryClient: QueryClient, id: string | number) => { + /** Remove merkleStoreModule from cache */ merkleStoreModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: merkleStoreModuleKeys.detail(id) + queryKey: merkleStoreModuleKeys.detail(id), }); }, - /** Remove namespaceModule from cache */namespaceModule: (queryClient: QueryClient, id: string | number) => { + /** Remove namespaceModule from cache */ namespaceModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: namespaceModuleKeys.detail(id) + queryKey: namespaceModuleKeys.detail(id), }); }, - /** Remove notificationsModule from cache */notificationsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove notificationsModule from cache */ notificationsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: notificationsModuleKeys.detail(id) + queryKey: notificationsModuleKeys.detail(id), }); }, - /** Remove permissionsModule from cache */permissionsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove permissionsModule from cache */ permissionsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: permissionsModuleKeys.detail(id) + queryKey: permissionsModuleKeys.detail(id), }); }, - /** Remove phoneNumbersModule from cache */phoneNumbersModule: (queryClient: QueryClient, id: string | number) => { + /** Remove phoneNumbersModule from cache */ phoneNumbersModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: phoneNumbersModuleKeys.detail(id) + queryKey: phoneNumbersModuleKeys.detail(id), }); }, - /** Remove plansModule from cache */plansModule: (queryClient: QueryClient, id: string | number) => { + /** Remove plansModule from cache */ plansModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: plansModuleKeys.detail(id) + queryKey: plansModuleKeys.detail(id), }); }, - /** Remove principalAuthModule from cache */principalAuthModule: (queryClient: QueryClient, id: string | number) => { + /** Remove principalAuthModule from cache */ principalAuthModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: principalAuthModuleKeys.detail(id) + queryKey: principalAuthModuleKeys.detail(id), }); }, - /** Remove profilesModule from cache */profilesModule: (queryClient: QueryClient, id: string | number) => { + /** Remove profilesModule from cache */ profilesModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: profilesModuleKeys.detail(id) + queryKey: profilesModuleKeys.detail(id), }); }, - /** Remove rateLimitMetersModule from cache */rateLimitMetersModule: (queryClient: QueryClient, id: string | number) => { + /** Remove rateLimitMetersModule from cache */ rateLimitMetersModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: rateLimitMetersModuleKeys.detail(id) + queryKey: rateLimitMetersModuleKeys.detail(id), }); }, - /** Remove rateLimitsModule from cache */rateLimitsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove rateLimitsModule from cache */ rateLimitsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: rateLimitsModuleKeys.detail(id) + queryKey: rateLimitsModuleKeys.detail(id), }); }, - /** Remove realtimeModule from cache */realtimeModule: (queryClient: QueryClient, id: string | number) => { + /** Remove realtimeModule from cache */ realtimeModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: realtimeModuleKeys.detail(id) + queryKey: realtimeModuleKeys.detail(id), }); }, - /** Remove relationProvision from cache */relationProvision: (queryClient: QueryClient, id: string | number) => { + /** Remove relationProvision from cache */ relationProvision: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: relationProvisionKeys.detail(id) + queryKey: relationProvisionKeys.detail(id), }); }, - /** Remove resourceModule from cache */resourceModule: (queryClient: QueryClient, id: string | number) => { + /** Remove resourceModule from cache */ resourceModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: resourceModuleKeys.detail(id) + queryKey: resourceModuleKeys.detail(id), }); }, - /** Remove rlsModule from cache */rlsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove rlsModule from cache */ rlsModule: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: rlsModuleKeys.detail(id) + queryKey: rlsModuleKeys.detail(id), }); }, - /** Remove routeModule from cache */routeModule: (queryClient: QueryClient, id: string | number) => { + /** Remove routeModule from cache */ routeModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: routeModuleKeys.detail(id) + queryKey: routeModuleKeys.detail(id), }); }, - /** Remove secureTableProvision from cache */secureTableProvision: (queryClient: QueryClient, id: string | number) => { + /** Remove secureTableProvision from cache */ secureTableProvision: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: secureTableProvisionKeys.detail(id) + queryKey: secureTableProvisionKeys.detail(id), }); }, - /** Remove sessionSecretsModule from cache */sessionSecretsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove sessionSecretsModule from cache */ sessionSecretsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: sessionSecretsModuleKeys.detail(id) + queryKey: sessionSecretsModuleKeys.detail(id), }); }, - /** Remove sessionsModule from cache */sessionsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove sessionsModule from cache */ sessionsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: sessionsModuleKeys.detail(id) + queryKey: sessionsModuleKeys.detail(id), }); }, - /** Remove siteSurfaceModule from cache */siteSurfaceModule: (queryClient: QueryClient, id: string | number) => { + /** Remove siteSurfaceModule from cache */ siteSurfaceModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: siteSurfaceModuleKeys.detail(id) + queryKey: siteSurfaceModuleKeys.detail(id), }); }, - /** Remove storageLogModule from cache */storageLogModule: (queryClient: QueryClient, id: string | number) => { + /** Remove storageLogModule from cache */ storageLogModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: storageLogModuleKeys.detail(id) + queryKey: storageLogModuleKeys.detail(id), }); }, - /** Remove storageModule from cache */storageModule: (queryClient: QueryClient, id: string | number) => { + /** Remove storageModule from cache */ storageModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: storageModuleKeys.detail(id) + queryKey: storageModuleKeys.detail(id), }); }, - /** Remove transferLogModule from cache */transferLogModule: (queryClient: QueryClient, id: string | number) => { + /** Remove transferLogModule from cache */ transferLogModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: transferLogModuleKeys.detail(id) + queryKey: transferLogModuleKeys.detail(id), }); }, - /** Remove userAuthModule from cache */userAuthModule: (queryClient: QueryClient, id: string | number) => { + /** Remove userAuthModule from cache */ userAuthModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: userAuthModuleKeys.detail(id) + queryKey: userAuthModuleKeys.detail(id), }); }, - /** Remove userCredentialsModule from cache */userCredentialsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove userCredentialsModule from cache */ userCredentialsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: userCredentialsModuleKeys.detail(id) + queryKey: userCredentialsModuleKeys.detail(id), }); }, - /** Remove userSettingsModule from cache */userSettingsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove userSettingsModule from cache */ userSettingsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: userSettingsModuleKeys.detail(id) + queryKey: userSettingsModuleKeys.detail(id), }); }, - /** Remove userStateModule from cache */userStateModule: (queryClient: QueryClient, id: string | number) => { + /** Remove userStateModule from cache */ userStateModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: userStateModuleKeys.detail(id) + queryKey: userStateModuleKeys.detail(id), }); }, - /** Remove usersModule from cache */usersModule: (queryClient: QueryClient, id: string | number) => { + /** Remove usersModule from cache */ usersModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: usersModuleKeys.detail(id) + queryKey: usersModuleKeys.detail(id), }); }, - /** Remove webauthnAuthModule from cache */webauthnAuthModule: (queryClient: QueryClient, id: string | number) => { + /** Remove webauthnAuthModule from cache */ webauthnAuthModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: webauthnAuthModuleKeys.detail(id) + queryKey: webauthnAuthModuleKeys.detail(id), }); }, - /** Remove webauthnCredentialsModule from cache */webauthnCredentialsModule: (queryClient: QueryClient, id: string | number) => { + /** Remove webauthnCredentialsModule from cache */ webauthnCredentialsModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: webauthnCredentialsModuleKeys.detail(id) + queryKey: webauthnCredentialsModuleKeys.detail(id), }); }, - /** Remove webhookModule from cache */webhookModule: (queryClient: QueryClient, id: string | number) => { + /** Remove webhookModule from cache */ webhookModule: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: webhookModuleKeys.detail(id) + queryKey: webhookModuleKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/modules/hooks/mutation-keys.ts b/sdk/constructive-react/src/modules/hooks/mutation-keys.ts index 801b12670f..9a8ff7004d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/modules/hooks/mutation-keys.ts @@ -19,454 +19,725 @@ // ============================================================================ export const agentModuleMutationKeys = { - /** All agentModule mutation keys */all: ["mutation", "agentmodule"] as const, - /** Create agentModule mutation key */create: () => ["mutation", "agentmodule", "create"] as const, - /** Update agentModule mutation key */update: (id: string | number) => ["mutation", "agentmodule", "update", id] as const, - /** Delete agentModule mutation key */delete: (id: string | number) => ["mutation", "agentmodule", "delete", id] as const + /** All agentModule mutation keys */ all: ['mutation', 'agentmodule'] as const, + /** Create agentModule mutation key */ create: () => + ['mutation', 'agentmodule', 'create'] as const, + /** Update agentModule mutation key */ update: (id: string | number) => + ['mutation', 'agentmodule', 'update', id] as const, + /** Delete agentModule mutation key */ delete: (id: string | number) => + ['mutation', 'agentmodule', 'delete', id] as const, } as const; export const apiSurfaceModuleMutationKeys = { - /** All apiSurfaceModule mutation keys */all: ["mutation", "apisurfacemodule"] as const, - /** Create apiSurfaceModule mutation key */create: () => ["mutation", "apisurfacemodule", "create"] as const, - /** Update apiSurfaceModule mutation key */update: (id: string | number) => ["mutation", "apisurfacemodule", "update", id] as const, - /** Delete apiSurfaceModule mutation key */delete: (id: string | number) => ["mutation", "apisurfacemodule", "delete", id] as const + /** All apiSurfaceModule mutation keys */ all: ['mutation', 'apisurfacemodule'] as const, + /** Create apiSurfaceModule mutation key */ create: () => + ['mutation', 'apisurfacemodule', 'create'] as const, + /** Update apiSurfaceModule mutation key */ update: (id: string | number) => + ['mutation', 'apisurfacemodule', 'update', id] as const, + /** Delete apiSurfaceModule mutation key */ delete: (id: string | number) => + ['mutation', 'apisurfacemodule', 'delete', id] as const, } as const; export const appModuleMutationKeys = { - /** All appModule mutation keys */all: ["mutation", "appmodule"] as const, - /** Create appModule mutation key */create: () => ["mutation", "appmodule", "create"] as const, - /** Update appModule mutation key */update: (id: string | number) => ["mutation", "appmodule", "update", id] as const, - /** Delete appModule mutation key */delete: (id: string | number) => ["mutation", "appmodule", "delete", id] as const + /** All appModule mutation keys */ all: ['mutation', 'appmodule'] as const, + /** Create appModule mutation key */ create: () => ['mutation', 'appmodule', 'create'] as const, + /** Update appModule mutation key */ update: (id: string | number) => + ['mutation', 'appmodule', 'update', id] as const, + /** Delete appModule mutation key */ delete: (id: string | number) => + ['mutation', 'appmodule', 'delete', id] as const, } as const; export const billingModuleMutationKeys = { - /** All billingModule mutation keys */all: ["mutation", "billingmodule"] as const, - /** Create billingModule mutation key */create: () => ["mutation", "billingmodule", "create"] as const, - /** Update billingModule mutation key */update: (id: string | number) => ["mutation", "billingmodule", "update", id] as const, - /** Delete billingModule mutation key */delete: (id: string | number) => ["mutation", "billingmodule", "delete", id] as const + /** All billingModule mutation keys */ all: ['mutation', 'billingmodule'] as const, + /** Create billingModule mutation key */ create: () => + ['mutation', 'billingmodule', 'create'] as const, + /** Update billingModule mutation key */ update: (id: string | number) => + ['mutation', 'billingmodule', 'update', id] as const, + /** Delete billingModule mutation key */ delete: (id: string | number) => + ['mutation', 'billingmodule', 'delete', id] as const, } as const; export const billingProviderModuleMutationKeys = { - /** All billingProviderModule mutation keys */all: ["mutation", "billingprovidermodule"] as const, - /** Create billingProviderModule mutation key */create: () => ["mutation", "billingprovidermodule", "create"] as const, - /** Update billingProviderModule mutation key */update: (id: string | number) => ["mutation", "billingprovidermodule", "update", id] as const, - /** Delete billingProviderModule mutation key */delete: (id: string | number) => ["mutation", "billingprovidermodule", "delete", id] as const + /** All billingProviderModule mutation keys */ all: [ + 'mutation', + 'billingprovidermodule', + ] as const, + /** Create billingProviderModule mutation key */ create: () => + ['mutation', 'billingprovidermodule', 'create'] as const, + /** Update billingProviderModule mutation key */ update: (id: string | number) => + ['mutation', 'billingprovidermodule', 'update', id] as const, + /** Delete billingProviderModule mutation key */ delete: (id: string | number) => + ['mutation', 'billingprovidermodule', 'delete', id] as const, } as const; export const blueprintMutationKeys = { - /** All blueprint mutation keys */all: ["mutation", "blueprint"] as const, - /** Create blueprint mutation key */create: () => ["mutation", "blueprint", "create"] as const, - /** Update blueprint mutation key */update: (id: string | number) => ["mutation", "blueprint", "update", id] as const, - /** Delete blueprint mutation key */delete: (id: string | number) => ["mutation", "blueprint", "delete", id] as const + /** All blueprint mutation keys */ all: ['mutation', 'blueprint'] as const, + /** Create blueprint mutation key */ create: () => ['mutation', 'blueprint', 'create'] as const, + /** Update blueprint mutation key */ update: (id: string | number) => + ['mutation', 'blueprint', 'update', id] as const, + /** Delete blueprint mutation key */ delete: (id: string | number) => + ['mutation', 'blueprint', 'delete', id] as const, } as const; export const blueprintConstructionMutationKeys = { - /** All blueprintConstruction mutation keys */all: ["mutation", "blueprintconstruction"] as const, - /** Create blueprintConstruction mutation key */create: () => ["mutation", "blueprintconstruction", "create"] as const, - /** Update blueprintConstruction mutation key */update: (id: string | number) => ["mutation", "blueprintconstruction", "update", id] as const, - /** Delete blueprintConstruction mutation key */delete: (id: string | number) => ["mutation", "blueprintconstruction", "delete", id] as const + /** All blueprintConstruction mutation keys */ all: [ + 'mutation', + 'blueprintconstruction', + ] as const, + /** Create blueprintConstruction mutation key */ create: () => + ['mutation', 'blueprintconstruction', 'create'] as const, + /** Update blueprintConstruction mutation key */ update: (id: string | number) => + ['mutation', 'blueprintconstruction', 'update', id] as const, + /** Delete blueprintConstruction mutation key */ delete: (id: string | number) => + ['mutation', 'blueprintconstruction', 'delete', id] as const, } as const; export const blueprintTemplateMutationKeys = { - /** All blueprintTemplate mutation keys */all: ["mutation", "blueprinttemplate"] as const, - /** Create blueprintTemplate mutation key */create: () => ["mutation", "blueprinttemplate", "create"] as const, - /** Update blueprintTemplate mutation key */update: (id: string | number) => ["mutation", "blueprinttemplate", "update", id] as const, - /** Delete blueprintTemplate mutation key */delete: (id: string | number) => ["mutation", "blueprinttemplate", "delete", id] as const + /** All blueprintTemplate mutation keys */ all: ['mutation', 'blueprinttemplate'] as const, + /** Create blueprintTemplate mutation key */ create: () => + ['mutation', 'blueprinttemplate', 'create'] as const, + /** Update blueprintTemplate mutation key */ update: (id: string | number) => + ['mutation', 'blueprinttemplate', 'update', id] as const, + /** Delete blueprintTemplate mutation key */ delete: (id: string | number) => + ['mutation', 'blueprinttemplate', 'delete', id] as const, } as const; export const catalogModuleMutationKeys = { - /** All catalogModule mutation keys */all: ["mutation", "catalogmodule"] as const, - /** Create catalogModule mutation key */create: () => ["mutation", "catalogmodule", "create"] as const, - /** Update catalogModule mutation key */update: (id: string | number) => ["mutation", "catalogmodule", "update", id] as const, - /** Delete catalogModule mutation key */delete: (id: string | number) => ["mutation", "catalogmodule", "delete", id] as const + /** All catalogModule mutation keys */ all: ['mutation', 'catalogmodule'] as const, + /** Create catalogModule mutation key */ create: () => + ['mutation', 'catalogmodule', 'create'] as const, + /** Update catalogModule mutation key */ update: (id: string | number) => + ['mutation', 'catalogmodule', 'update', id] as const, + /** Delete catalogModule mutation key */ delete: (id: string | number) => + ['mutation', 'catalogmodule', 'delete', id] as const, } as const; export const computeLogModuleMutationKeys = { - /** All computeLogModule mutation keys */all: ["mutation", "computelogmodule"] as const, - /** Create computeLogModule mutation key */create: () => ["mutation", "computelogmodule", "create"] as const, - /** Update computeLogModule mutation key */update: (id: string | number) => ["mutation", "computelogmodule", "update", id] as const, - /** Delete computeLogModule mutation key */delete: (id: string | number) => ["mutation", "computelogmodule", "delete", id] as const + /** All computeLogModule mutation keys */ all: ['mutation', 'computelogmodule'] as const, + /** Create computeLogModule mutation key */ create: () => + ['mutation', 'computelogmodule', 'create'] as const, + /** Update computeLogModule mutation key */ update: (id: string | number) => + ['mutation', 'computelogmodule', 'update', id] as const, + /** Delete computeLogModule mutation key */ delete: (id: string | number) => + ['mutation', 'computelogmodule', 'delete', id] as const, } as const; export const configSecretsUserModuleMutationKeys = { - /** All configSecretsUserModule mutation keys */all: ["mutation", "configsecretsusermodule"] as const, - /** Create configSecretsUserModule mutation key */create: () => ["mutation", "configsecretsusermodule", "create"] as const, - /** Update configSecretsUserModule mutation key */update: (id: string | number) => ["mutation", "configsecretsusermodule", "update", id] as const, - /** Delete configSecretsUserModule mutation key */delete: (id: string | number) => ["mutation", "configsecretsusermodule", "delete", id] as const + /** All configSecretsUserModule mutation keys */ all: [ + 'mutation', + 'configsecretsusermodule', + ] as const, + /** Create configSecretsUserModule mutation key */ create: () => + ['mutation', 'configsecretsusermodule', 'create'] as const, + /** Update configSecretsUserModule mutation key */ update: (id: string | number) => + ['mutation', 'configsecretsusermodule', 'update', id] as const, + /** Delete configSecretsUserModule mutation key */ delete: (id: string | number) => + ['mutation', 'configsecretsusermodule', 'delete', id] as const, } as const; export const connectedAccountsModuleMutationKeys = { - /** All connectedAccountsModule mutation keys */all: ["mutation", "connectedaccountsmodule"] as const, - /** Create connectedAccountsModule mutation key */create: () => ["mutation", "connectedaccountsmodule", "create"] as const, - /** Update connectedAccountsModule mutation key */update: (id: string | number) => ["mutation", "connectedaccountsmodule", "update", id] as const, - /** Delete connectedAccountsModule mutation key */delete: (id: string | number) => ["mutation", "connectedaccountsmodule", "delete", id] as const + /** All connectedAccountsModule mutation keys */ all: [ + 'mutation', + 'connectedaccountsmodule', + ] as const, + /** Create connectedAccountsModule mutation key */ create: () => + ['mutation', 'connectedaccountsmodule', 'create'] as const, + /** Update connectedAccountsModule mutation key */ update: (id: string | number) => + ['mutation', 'connectedaccountsmodule', 'update', id] as const, + /** Delete connectedAccountsModule mutation key */ delete: (id: string | number) => + ['mutation', 'connectedaccountsmodule', 'delete', id] as const, } as const; export const cryptoAddressesModuleMutationKeys = { - /** All cryptoAddressesModule mutation keys */all: ["mutation", "cryptoaddressesmodule"] as const, - /** Create cryptoAddressesModule mutation key */create: () => ["mutation", "cryptoaddressesmodule", "create"] as const, - /** Update cryptoAddressesModule mutation key */update: (id: string | number) => ["mutation", "cryptoaddressesmodule", "update", id] as const, - /** Delete cryptoAddressesModule mutation key */delete: (id: string | number) => ["mutation", "cryptoaddressesmodule", "delete", id] as const + /** All cryptoAddressesModule mutation keys */ all: [ + 'mutation', + 'cryptoaddressesmodule', + ] as const, + /** Create cryptoAddressesModule mutation key */ create: () => + ['mutation', 'cryptoaddressesmodule', 'create'] as const, + /** Update cryptoAddressesModule mutation key */ update: (id: string | number) => + ['mutation', 'cryptoaddressesmodule', 'update', id] as const, + /** Delete cryptoAddressesModule mutation key */ delete: (id: string | number) => + ['mutation', 'cryptoaddressesmodule', 'delete', id] as const, } as const; export const cryptoAuthModuleMutationKeys = { - /** All cryptoAuthModule mutation keys */all: ["mutation", "cryptoauthmodule"] as const, - /** Create cryptoAuthModule mutation key */create: () => ["mutation", "cryptoauthmodule", "create"] as const, - /** Update cryptoAuthModule mutation key */update: (id: string | number) => ["mutation", "cryptoauthmodule", "update", id] as const, - /** Delete cryptoAuthModule mutation key */delete: (id: string | number) => ["mutation", "cryptoauthmodule", "delete", id] as const + /** All cryptoAuthModule mutation keys */ all: ['mutation', 'cryptoauthmodule'] as const, + /** Create cryptoAuthModule mutation key */ create: () => + ['mutation', 'cryptoauthmodule', 'create'] as const, + /** Update cryptoAuthModule mutation key */ update: (id: string | number) => + ['mutation', 'cryptoauthmodule', 'update', id] as const, + /** Delete cryptoAuthModule mutation key */ delete: (id: string | number) => + ['mutation', 'cryptoauthmodule', 'delete', id] as const, } as const; export const databaseProvisionModuleMutationKeys = { - /** All databaseProvisionModule mutation keys */all: ["mutation", "databaseprovisionmodule"] as const, - /** Create databaseProvisionModule mutation key */create: () => ["mutation", "databaseprovisionmodule", "create"] as const, - /** Update databaseProvisionModule mutation key */update: (id: string | number) => ["mutation", "databaseprovisionmodule", "update", id] as const, - /** Delete databaseProvisionModule mutation key */delete: (id: string | number) => ["mutation", "databaseprovisionmodule", "delete", id] as const + /** All databaseProvisionModule mutation keys */ all: [ + 'mutation', + 'databaseprovisionmodule', + ] as const, + /** Create databaseProvisionModule mutation key */ create: () => + ['mutation', 'databaseprovisionmodule', 'create'] as const, + /** Update databaseProvisionModule mutation key */ update: (id: string | number) => + ['mutation', 'databaseprovisionmodule', 'update', id] as const, + /** Delete databaseProvisionModule mutation key */ delete: (id: string | number) => + ['mutation', 'databaseprovisionmodule', 'delete', id] as const, } as const; export const databaseSettingsModuleMutationKeys = { - /** All databaseSettingsModule mutation keys */all: ["mutation", "databasesettingsmodule"] as const, - /** Create databaseSettingsModule mutation key */create: () => ["mutation", "databasesettingsmodule", "create"] as const, - /** Update databaseSettingsModule mutation key */update: (id: string | number) => ["mutation", "databasesettingsmodule", "update", id] as const, - /** Delete databaseSettingsModule mutation key */delete: (id: string | number) => ["mutation", "databasesettingsmodule", "delete", id] as const + /** All databaseSettingsModule mutation keys */ all: [ + 'mutation', + 'databasesettingsmodule', + ] as const, + /** Create databaseSettingsModule mutation key */ create: () => + ['mutation', 'databasesettingsmodule', 'create'] as const, + /** Update databaseSettingsModule mutation key */ update: (id: string | number) => + ['mutation', 'databasesettingsmodule', 'update', id] as const, + /** Delete databaseSettingsModule mutation key */ delete: (id: string | number) => + ['mutation', 'databasesettingsmodule', 'delete', id] as const, } as const; export const dbPoolConfigMutationKeys = { - /** All dbPoolConfig mutation keys */all: ["mutation", "dbpoolconfig"] as const, - /** Create dbPoolConfig mutation key */create: () => ["mutation", "dbpoolconfig", "create"] as const, - /** Update dbPoolConfig mutation key */update: (id: string | number) => ["mutation", "dbpoolconfig", "update", id] as const, - /** Delete dbPoolConfig mutation key */delete: (id: string | number) => ["mutation", "dbpoolconfig", "delete", id] as const + /** All dbPoolConfig mutation keys */ all: ['mutation', 'dbpoolconfig'] as const, + /** Create dbPoolConfig mutation key */ create: () => + ['mutation', 'dbpoolconfig', 'create'] as const, + /** Update dbPoolConfig mutation key */ update: (id: string | number) => + ['mutation', 'dbpoolconfig', 'update', id] as const, + /** Delete dbPoolConfig mutation key */ delete: (id: string | number) => + ['mutation', 'dbpoolconfig', 'delete', id] as const, } as const; export const dbPoolMutationKeys = { - /** All dbPool mutation keys */all: ["mutation", "dbpool"] as const, - /** Create dbPool mutation key */create: () => ["mutation", "dbpool", "create"] as const, - /** Update dbPool mutation key */update: (id: string | number) => ["mutation", "dbpool", "update", id] as const, - /** Delete dbPool mutation key */delete: (id: string | number) => ["mutation", "dbpool", "delete", id] as const + /** All dbPool mutation keys */ all: ['mutation', 'dbpool'] as const, + /** Create dbPool mutation key */ create: () => ['mutation', 'dbpool', 'create'] as const, + /** Update dbPool mutation key */ update: (id: string | number) => + ['mutation', 'dbpool', 'update', id] as const, + /** Delete dbPool mutation key */ delete: (id: string | number) => + ['mutation', 'dbpool', 'delete', id] as const, } as const; export const dbPresetModuleMutationKeys = { - /** All dbPresetModule mutation keys */all: ["mutation", "dbpresetmodule"] as const, - /** Create dbPresetModule mutation key */create: () => ["mutation", "dbpresetmodule", "create"] as const, - /** Update dbPresetModule mutation key */update: (id: string | number) => ["mutation", "dbpresetmodule", "update", id] as const, - /** Delete dbPresetModule mutation key */delete: (id: string | number) => ["mutation", "dbpresetmodule", "delete", id] as const + /** All dbPresetModule mutation keys */ all: ['mutation', 'dbpresetmodule'] as const, + /** Create dbPresetModule mutation key */ create: () => + ['mutation', 'dbpresetmodule', 'create'] as const, + /** Update dbPresetModule mutation key */ update: (id: string | number) => + ['mutation', 'dbpresetmodule', 'update', id] as const, + /** Delete dbPresetModule mutation key */ delete: (id: string | number) => + ['mutation', 'dbpresetmodule', 'delete', id] as const, } as const; export const dbUsageModuleMutationKeys = { - /** All dbUsageModule mutation keys */all: ["mutation", "dbusagemodule"] as const, - /** Create dbUsageModule mutation key */create: () => ["mutation", "dbusagemodule", "create"] as const, - /** Update dbUsageModule mutation key */update: (id: string | number) => ["mutation", "dbusagemodule", "update", id] as const, - /** Delete dbUsageModule mutation key */delete: (id: string | number) => ["mutation", "dbusagemodule", "delete", id] as const + /** All dbUsageModule mutation keys */ all: ['mutation', 'dbusagemodule'] as const, + /** Create dbUsageModule mutation key */ create: () => + ['mutation', 'dbusagemodule', 'create'] as const, + /** Update dbUsageModule mutation key */ update: (id: string | number) => + ['mutation', 'dbusagemodule', 'update', id] as const, + /** Delete dbUsageModule mutation key */ delete: (id: string | number) => + ['mutation', 'dbusagemodule', 'delete', id] as const, } as const; export const defaultIdsModuleMutationKeys = { - /** All defaultIdsModule mutation keys */all: ["mutation", "defaultidsmodule"] as const, - /** Create defaultIdsModule mutation key */create: () => ["mutation", "defaultidsmodule", "create"] as const, - /** Update defaultIdsModule mutation key */update: (id: string | number) => ["mutation", "defaultidsmodule", "update", id] as const, - /** Delete defaultIdsModule mutation key */delete: (id: string | number) => ["mutation", "defaultidsmodule", "delete", id] as const + /** All defaultIdsModule mutation keys */ all: ['mutation', 'defaultidsmodule'] as const, + /** Create defaultIdsModule mutation key */ create: () => + ['mutation', 'defaultidsmodule', 'create'] as const, + /** Update defaultIdsModule mutation key */ update: (id: string | number) => + ['mutation', 'defaultidsmodule', 'update', id] as const, + /** Delete defaultIdsModule mutation key */ delete: (id: string | number) => + ['mutation', 'defaultidsmodule', 'delete', id] as const, } as const; export const denormalizedTableFieldMutationKeys = { - /** All denormalizedTableField mutation keys */all: ["mutation", "denormalizedtablefield"] as const, - /** Create denormalizedTableField mutation key */create: () => ["mutation", "denormalizedtablefield", "create"] as const, - /** Update denormalizedTableField mutation key */update: (id: string | number) => ["mutation", "denormalizedtablefield", "update", id] as const, - /** Delete denormalizedTableField mutation key */delete: (id: string | number) => ["mutation", "denormalizedtablefield", "delete", id] as const + /** All denormalizedTableField mutation keys */ all: [ + 'mutation', + 'denormalizedtablefield', + ] as const, + /** Create denormalizedTableField mutation key */ create: () => + ['mutation', 'denormalizedtablefield', 'create'] as const, + /** Update denormalizedTableField mutation key */ update: (id: string | number) => + ['mutation', 'denormalizedtablefield', 'update', id] as const, + /** Delete denormalizedTableField mutation key */ delete: (id: string | number) => + ['mutation', 'denormalizedtablefield', 'delete', id] as const, } as const; export const devicesModuleMutationKeys = { - /** All devicesModule mutation keys */all: ["mutation", "devicesmodule"] as const, - /** Create devicesModule mutation key */create: () => ["mutation", "devicesmodule", "create"] as const, - /** Update devicesModule mutation key */update: (id: string | number) => ["mutation", "devicesmodule", "update", id] as const, - /** Delete devicesModule mutation key */delete: (id: string | number) => ["mutation", "devicesmodule", "delete", id] as const + /** All devicesModule mutation keys */ all: ['mutation', 'devicesmodule'] as const, + /** Create devicesModule mutation key */ create: () => + ['mutation', 'devicesmodule', 'create'] as const, + /** Update devicesModule mutation key */ update: (id: string | number) => + ['mutation', 'devicesmodule', 'update', id] as const, + /** Delete devicesModule mutation key */ delete: (id: string | number) => + ['mutation', 'devicesmodule', 'delete', id] as const, } as const; export const domainModuleMutationKeys = { - /** All domainModule mutation keys */all: ["mutation", "domainmodule"] as const, - /** Create domainModule mutation key */create: () => ["mutation", "domainmodule", "create"] as const, - /** Update domainModule mutation key */update: (id: string | number) => ["mutation", "domainmodule", "update", id] as const, - /** Delete domainModule mutation key */delete: (id: string | number) => ["mutation", "domainmodule", "delete", id] as const + /** All domainModule mutation keys */ all: ['mutation', 'domainmodule'] as const, + /** Create domainModule mutation key */ create: () => + ['mutation', 'domainmodule', 'create'] as const, + /** Update domainModule mutation key */ update: (id: string | number) => + ['mutation', 'domainmodule', 'update', id] as const, + /** Delete domainModule mutation key */ delete: (id: string | number) => + ['mutation', 'domainmodule', 'delete', id] as const, } as const; export const emailsModuleMutationKeys = { - /** All emailsModule mutation keys */all: ["mutation", "emailsmodule"] as const, - /** Create emailsModule mutation key */create: () => ["mutation", "emailsmodule", "create"] as const, - /** Update emailsModule mutation key */update: (id: string | number) => ["mutation", "emailsmodule", "update", id] as const, - /** Delete emailsModule mutation key */delete: (id: string | number) => ["mutation", "emailsmodule", "delete", id] as const + /** All emailsModule mutation keys */ all: ['mutation', 'emailsmodule'] as const, + /** Create emailsModule mutation key */ create: () => + ['mutation', 'emailsmodule', 'create'] as const, + /** Update emailsModule mutation key */ update: (id: string | number) => + ['mutation', 'emailsmodule', 'update', id] as const, + /** Delete emailsModule mutation key */ delete: (id: string | number) => + ['mutation', 'emailsmodule', 'delete', id] as const, } as const; export const entityTypeProvisionMutationKeys = { - /** All entityTypeProvision mutation keys */all: ["mutation", "entitytypeprovision"] as const, - /** Create entityTypeProvision mutation key */create: () => ["mutation", "entitytypeprovision", "create"] as const, - /** Update entityTypeProvision mutation key */update: (id: string | number) => ["mutation", "entitytypeprovision", "update", id] as const, - /** Delete entityTypeProvision mutation key */delete: (id: string | number) => ["mutation", "entitytypeprovision", "delete", id] as const + /** All entityTypeProvision mutation keys */ all: ['mutation', 'entitytypeprovision'] as const, + /** Create entityTypeProvision mutation key */ create: () => + ['mutation', 'entitytypeprovision', 'create'] as const, + /** Update entityTypeProvision mutation key */ update: (id: string | number) => + ['mutation', 'entitytypeprovision', 'update', id] as const, + /** Delete entityTypeProvision mutation key */ delete: (id: string | number) => + ['mutation', 'entitytypeprovision', 'delete', id] as const, } as const; export const eventsModuleMutationKeys = { - /** All eventsModule mutation keys */all: ["mutation", "eventsmodule"] as const, - /** Create eventsModule mutation key */create: () => ["mutation", "eventsmodule", "create"] as const, - /** Update eventsModule mutation key */update: (id: string | number) => ["mutation", "eventsmodule", "update", id] as const, - /** Delete eventsModule mutation key */delete: (id: string | number) => ["mutation", "eventsmodule", "delete", id] as const + /** All eventsModule mutation keys */ all: ['mutation', 'eventsmodule'] as const, + /** Create eventsModule mutation key */ create: () => + ['mutation', 'eventsmodule', 'create'] as const, + /** Update eventsModule mutation key */ update: (id: string | number) => + ['mutation', 'eventsmodule', 'update', id] as const, + /** Delete eventsModule mutation key */ delete: (id: string | number) => + ['mutation', 'eventsmodule', 'delete', id] as const, } as const; export const functionDeploymentModuleMutationKeys = { - /** All functionDeploymentModule mutation keys */all: ["mutation", "functiondeploymentmodule"] as const, - /** Create functionDeploymentModule mutation key */create: () => ["mutation", "functiondeploymentmodule", "create"] as const, - /** Update functionDeploymentModule mutation key */update: (id: string | number) => ["mutation", "functiondeploymentmodule", "update", id] as const, - /** Delete functionDeploymentModule mutation key */delete: (id: string | number) => ["mutation", "functiondeploymentmodule", "delete", id] as const + /** All functionDeploymentModule mutation keys */ all: [ + 'mutation', + 'functiondeploymentmodule', + ] as const, + /** Create functionDeploymentModule mutation key */ create: () => + ['mutation', 'functiondeploymentmodule', 'create'] as const, + /** Update functionDeploymentModule mutation key */ update: (id: string | number) => + ['mutation', 'functiondeploymentmodule', 'update', id] as const, + /** Delete functionDeploymentModule mutation key */ delete: (id: string | number) => + ['mutation', 'functiondeploymentmodule', 'delete', id] as const, } as const; export const functionInvocationModuleMutationKeys = { - /** All functionInvocationModule mutation keys */all: ["mutation", "functioninvocationmodule"] as const, - /** Create functionInvocationModule mutation key */create: () => ["mutation", "functioninvocationmodule", "create"] as const, - /** Update functionInvocationModule mutation key */update: (id: string | number) => ["mutation", "functioninvocationmodule", "update", id] as const, - /** Delete functionInvocationModule mutation key */delete: (id: string | number) => ["mutation", "functioninvocationmodule", "delete", id] as const + /** All functionInvocationModule mutation keys */ all: [ + 'mutation', + 'functioninvocationmodule', + ] as const, + /** Create functionInvocationModule mutation key */ create: () => + ['mutation', 'functioninvocationmodule', 'create'] as const, + /** Update functionInvocationModule mutation key */ update: (id: string | number) => + ['mutation', 'functioninvocationmodule', 'update', id] as const, + /** Delete functionInvocationModule mutation key */ delete: (id: string | number) => + ['mutation', 'functioninvocationmodule', 'delete', id] as const, } as const; export const functionModuleMutationKeys = { - /** All functionModule mutation keys */all: ["mutation", "functionmodule"] as const, - /** Create functionModule mutation key */create: () => ["mutation", "functionmodule", "create"] as const, - /** Update functionModule mutation key */update: (id: string | number) => ["mutation", "functionmodule", "update", id] as const, - /** Delete functionModule mutation key */delete: (id: string | number) => ["mutation", "functionmodule", "delete", id] as const + /** All functionModule mutation keys */ all: ['mutation', 'functionmodule'] as const, + /** Create functionModule mutation key */ create: () => + ['mutation', 'functionmodule', 'create'] as const, + /** Update functionModule mutation key */ update: (id: string | number) => + ['mutation', 'functionmodule', 'update', id] as const, + /** Delete functionModule mutation key */ delete: (id: string | number) => + ['mutation', 'functionmodule', 'delete', id] as const, } as const; export const graphExecutionModuleMutationKeys = { - /** All graphExecutionModule mutation keys */all: ["mutation", "graphexecutionmodule"] as const, - /** Create graphExecutionModule mutation key */create: () => ["mutation", "graphexecutionmodule", "create"] as const, - /** Update graphExecutionModule mutation key */update: (id: string | number) => ["mutation", "graphexecutionmodule", "update", id] as const, - /** Delete graphExecutionModule mutation key */delete: (id: string | number) => ["mutation", "graphexecutionmodule", "delete", id] as const + /** All graphExecutionModule mutation keys */ all: ['mutation', 'graphexecutionmodule'] as const, + /** Create graphExecutionModule mutation key */ create: () => + ['mutation', 'graphexecutionmodule', 'create'] as const, + /** Update graphExecutionModule mutation key */ update: (id: string | number) => + ['mutation', 'graphexecutionmodule', 'update', id] as const, + /** Delete graphExecutionModule mutation key */ delete: (id: string | number) => + ['mutation', 'graphexecutionmodule', 'delete', id] as const, } as const; export const 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 + /** 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 hierarchyModuleMutationKeys = { - /** All hierarchyModule mutation keys */all: ["mutation", "hierarchymodule"] as const, - /** Create hierarchyModule mutation key */create: () => ["mutation", "hierarchymodule", "create"] as const, - /** Update hierarchyModule mutation key */update: (id: string | number) => ["mutation", "hierarchymodule", "update", id] as const, - /** Delete hierarchyModule mutation key */delete: (id: string | number) => ["mutation", "hierarchymodule", "delete", id] as const + /** All hierarchyModule mutation keys */ all: ['mutation', 'hierarchymodule'] as const, + /** Create hierarchyModule mutation key */ create: () => + ['mutation', 'hierarchymodule', 'create'] as const, + /** Update hierarchyModule mutation key */ update: (id: string | number) => + ['mutation', 'hierarchymodule', 'update', id] as const, + /** Delete hierarchyModule mutation key */ delete: (id: string | number) => + ['mutation', 'hierarchymodule', 'delete', id] as const, } as const; export const httpRouteModuleMutationKeys = { - /** All httpRouteModule mutation keys */all: ["mutation", "httproutemodule"] as const, - /** Create httpRouteModule mutation key */create: () => ["mutation", "httproutemodule", "create"] as const, - /** Update httpRouteModule mutation key */update: (id: string | number) => ["mutation", "httproutemodule", "update", id] as const, - /** Delete httpRouteModule mutation key */delete: (id: string | number) => ["mutation", "httproutemodule", "delete", id] as const + /** All httpRouteModule mutation keys */ all: ['mutation', 'httproutemodule'] as const, + /** Create httpRouteModule mutation key */ create: () => + ['mutation', 'httproutemodule', 'create'] as const, + /** Update httpRouteModule mutation key */ update: (id: string | number) => + ['mutation', 'httproutemodule', 'update', id] as const, + /** Delete httpRouteModule mutation key */ delete: (id: string | number) => + ['mutation', 'httproutemodule', 'delete', id] as const, } as const; export const i18NModuleMutationKeys = { - /** All i18NModule mutation keys */all: ["mutation", "i18nmodule"] as const, - /** Create i18NModule mutation key */create: () => ["mutation", "i18nmodule", "create"] as const, - /** Update i18NModule mutation key */update: (id: string | number) => ["mutation", "i18nmodule", "update", id] as const, - /** Delete i18NModule mutation key */delete: (id: string | number) => ["mutation", "i18nmodule", "delete", id] as const + /** All i18NModule mutation keys */ all: ['mutation', 'i18nmodule'] as const, + /** Create i18NModule mutation key */ create: () => ['mutation', 'i18nmodule', 'create'] as const, + /** Update i18NModule mutation key */ update: (id: string | number) => + ['mutation', 'i18nmodule', 'update', id] as const, + /** Delete i18NModule mutation key */ delete: (id: string | number) => + ['mutation', 'i18nmodule', 'delete', id] as const, } as const; export const identityProvidersModuleMutationKeys = { - /** All identityProvidersModule mutation keys */all: ["mutation", "identityprovidersmodule"] as const, - /** Create identityProvidersModule mutation key */create: () => ["mutation", "identityprovidersmodule", "create"] as const, - /** Update identityProvidersModule mutation key */update: (id: string | number) => ["mutation", "identityprovidersmodule", "update", id] as const, - /** Delete identityProvidersModule mutation key */delete: (id: string | number) => ["mutation", "identityprovidersmodule", "delete", id] as const + /** All identityProvidersModule mutation keys */ all: [ + 'mutation', + 'identityprovidersmodule', + ] as const, + /** Create identityProvidersModule mutation key */ create: () => + ['mutation', 'identityprovidersmodule', 'create'] as const, + /** Update identityProvidersModule mutation key */ update: (id: string | number) => + ['mutation', 'identityprovidersmodule', 'update', id] as const, + /** Delete identityProvidersModule mutation key */ delete: (id: string | number) => + ['mutation', 'identityprovidersmodule', 'delete', id] as const, } as const; export const inferenceLogModuleMutationKeys = { - /** All inferenceLogModule mutation keys */all: ["mutation", "inferencelogmodule"] as const, - /** Create inferenceLogModule mutation key */create: () => ["mutation", "inferencelogmodule", "create"] as const, - /** Update inferenceLogModule mutation key */update: (id: string | number) => ["mutation", "inferencelogmodule", "update", id] as const, - /** Delete inferenceLogModule mutation key */delete: (id: string | number) => ["mutation", "inferencelogmodule", "delete", id] as const + /** All inferenceLogModule mutation keys */ all: ['mutation', 'inferencelogmodule'] as const, + /** Create inferenceLogModule mutation key */ create: () => + ['mutation', 'inferencelogmodule', 'create'] as const, + /** Update inferenceLogModule mutation key */ update: (id: string | number) => + ['mutation', 'inferencelogmodule', 'update', id] as const, + /** Delete inferenceLogModule mutation key */ delete: (id: string | number) => + ['mutation', 'inferencelogmodule', 'delete', id] as const, } as const; export const infraConfigModuleMutationKeys = { - /** All infraConfigModule mutation keys */all: ["mutation", "infraconfigmodule"] as const, - /** Create infraConfigModule mutation key */create: () => ["mutation", "infraconfigmodule", "create"] as const, - /** Update infraConfigModule mutation key */update: (id: string | number) => ["mutation", "infraconfigmodule", "update", id] as const, - /** Delete infraConfigModule mutation key */delete: (id: string | number) => ["mutation", "infraconfigmodule", "delete", id] as const + /** All infraConfigModule mutation keys */ all: ['mutation', 'infraconfigmodule'] as const, + /** Create infraConfigModule mutation key */ create: () => + ['mutation', 'infraconfigmodule', 'create'] as const, + /** Update infraConfigModule mutation key */ update: (id: string | number) => + ['mutation', 'infraconfigmodule', 'update', id] as const, + /** Delete infraConfigModule mutation key */ delete: (id: string | number) => + ['mutation', 'infraconfigmodule', 'delete', id] as const, } as const; export const infraSecretsModuleMutationKeys = { - /** All infraSecretsModule mutation keys */all: ["mutation", "infrasecretsmodule"] as const, - /** Create infraSecretsModule mutation key */create: () => ["mutation", "infrasecretsmodule", "create"] as const, - /** Update infraSecretsModule mutation key */update: (id: string | number) => ["mutation", "infrasecretsmodule", "update", id] as const, - /** Delete infraSecretsModule mutation key */delete: (id: string | number) => ["mutation", "infrasecretsmodule", "delete", id] as const + /** All infraSecretsModule mutation keys */ all: ['mutation', 'infrasecretsmodule'] as const, + /** Create infraSecretsModule mutation key */ create: () => + ['mutation', 'infrasecretsmodule', 'create'] as const, + /** Update infraSecretsModule mutation key */ update: (id: string | number) => + ['mutation', 'infrasecretsmodule', 'update', id] as const, + /** Delete infraSecretsModule mutation key */ delete: (id: string | number) => + ['mutation', 'infrasecretsmodule', 'delete', id] as const, } as const; export const integrationProvidersModuleMutationKeys = { - /** All integrationProvidersModule mutation keys */all: ["mutation", "integrationprovidersmodule"] as const, - /** Create integrationProvidersModule mutation key */create: () => ["mutation", "integrationprovidersmodule", "create"] as const, - /** Update integrationProvidersModule mutation key */update: (id: string | number) => ["mutation", "integrationprovidersmodule", "update", id] as const, - /** Delete integrationProvidersModule mutation key */delete: (id: string | number) => ["mutation", "integrationprovidersmodule", "delete", id] as const + /** All integrationProvidersModule mutation keys */ all: [ + 'mutation', + 'integrationprovidersmodule', + ] as const, + /** Create integrationProvidersModule mutation key */ create: () => + ['mutation', 'integrationprovidersmodule', 'create'] as const, + /** Update integrationProvidersModule mutation key */ update: (id: string | number) => + ['mutation', 'integrationprovidersmodule', 'update', id] as const, + /** Delete integrationProvidersModule mutation key */ delete: (id: string | number) => + ['mutation', 'integrationprovidersmodule', 'delete', id] as const, } as const; export const internalSecretsModuleMutationKeys = { - /** All internalSecretsModule mutation keys */all: ["mutation", "internalsecretsmodule"] as const, - /** Create internalSecretsModule mutation key */create: () => ["mutation", "internalsecretsmodule", "create"] as const, - /** Update internalSecretsModule mutation key */update: (id: string | number) => ["mutation", "internalsecretsmodule", "update", id] as const, - /** Delete internalSecretsModule mutation key */delete: (id: string | number) => ["mutation", "internalsecretsmodule", "delete", id] as const + /** All internalSecretsModule mutation keys */ all: [ + 'mutation', + 'internalsecretsmodule', + ] as const, + /** Create internalSecretsModule mutation key */ create: () => + ['mutation', 'internalsecretsmodule', 'create'] as const, + /** Update internalSecretsModule mutation key */ update: (id: string | number) => + ['mutation', 'internalsecretsmodule', 'update', id] as const, + /** Delete internalSecretsModule mutation key */ delete: (id: string | number) => + ['mutation', 'internalsecretsmodule', 'delete', id] as const, } as const; export const invitesModuleMutationKeys = { - /** All invitesModule mutation keys */all: ["mutation", "invitesmodule"] as const, - /** Create invitesModule mutation key */create: () => ["mutation", "invitesmodule", "create"] as const, - /** Update invitesModule mutation key */update: (id: string | number) => ["mutation", "invitesmodule", "update", id] as const, - /** Delete invitesModule mutation key */delete: (id: string | number) => ["mutation", "invitesmodule", "delete", id] as const + /** All invitesModule mutation keys */ all: ['mutation', 'invitesmodule'] as const, + /** Create invitesModule mutation key */ create: () => + ['mutation', 'invitesmodule', 'create'] as const, + /** Update invitesModule mutation key */ update: (id: string | number) => + ['mutation', 'invitesmodule', 'update', id] as const, + /** Delete invitesModule mutation key */ delete: (id: string | number) => + ['mutation', 'invitesmodule', 'delete', id] as const, } as const; export const limitsModuleMutationKeys = { - /** All limitsModule mutation keys */all: ["mutation", "limitsmodule"] as const, - /** Create limitsModule mutation key */create: () => ["mutation", "limitsmodule", "create"] as const, - /** Update limitsModule mutation key */update: (id: string | number) => ["mutation", "limitsmodule", "update", id] as const, - /** Delete limitsModule mutation key */delete: (id: string | number) => ["mutation", "limitsmodule", "delete", id] as const + /** All limitsModule mutation keys */ all: ['mutation', 'limitsmodule'] as const, + /** Create limitsModule mutation key */ create: () => + ['mutation', 'limitsmodule', 'create'] as const, + /** Update limitsModule mutation key */ update: (id: string | number) => + ['mutation', 'limitsmodule', 'update', id] as const, + /** Delete limitsModule mutation key */ delete: (id: string | number) => + ['mutation', 'limitsmodule', 'delete', id] as const, } as const; export const membershipTypesModuleMutationKeys = { - /** All membershipTypesModule mutation keys */all: ["mutation", "membershiptypesmodule"] as const, - /** Create membershipTypesModule mutation key */create: () => ["mutation", "membershiptypesmodule", "create"] as const, - /** Update membershipTypesModule mutation key */update: (id: string | number) => ["mutation", "membershiptypesmodule", "update", id] as const, - /** Delete membershipTypesModule mutation key */delete: (id: string | number) => ["mutation", "membershiptypesmodule", "delete", id] as const + /** All membershipTypesModule mutation keys */ all: [ + 'mutation', + 'membershiptypesmodule', + ] as const, + /** Create membershipTypesModule mutation key */ create: () => + ['mutation', 'membershiptypesmodule', 'create'] as const, + /** Update membershipTypesModule mutation key */ update: (id: string | number) => + ['mutation', 'membershiptypesmodule', 'update', id] as const, + /** Delete membershipTypesModule mutation key */ delete: (id: string | number) => + ['mutation', 'membershiptypesmodule', 'delete', id] as const, } as const; export const membershipsModuleMutationKeys = { - /** All membershipsModule mutation keys */all: ["mutation", "membershipsmodule"] as const, - /** Create membershipsModule mutation key */create: () => ["mutation", "membershipsmodule", "create"] as const, - /** Update membershipsModule mutation key */update: (id: string | number) => ["mutation", "membershipsmodule", "update", id] as const, - /** Delete membershipsModule mutation key */delete: (id: string | number) => ["mutation", "membershipsmodule", "delete", id] as const + /** All membershipsModule mutation keys */ all: ['mutation', 'membershipsmodule'] as const, + /** Create membershipsModule mutation key */ create: () => + ['mutation', 'membershipsmodule', 'create'] as const, + /** Update membershipsModule mutation key */ update: (id: string | number) => + ['mutation', 'membershipsmodule', 'update', id] as const, + /** Delete membershipsModule mutation key */ delete: (id: string | number) => + ['mutation', 'membershipsmodule', '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 + /** 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 namespaceModuleMutationKeys = { - /** All namespaceModule mutation keys */all: ["mutation", "namespacemodule"] as const, - /** Create namespaceModule mutation key */create: () => ["mutation", "namespacemodule", "create"] as const, - /** Update namespaceModule mutation key */update: (id: string | number) => ["mutation", "namespacemodule", "update", id] as const, - /** Delete namespaceModule mutation key */delete: (id: string | number) => ["mutation", "namespacemodule", "delete", id] as const + /** All namespaceModule mutation keys */ all: ['mutation', 'namespacemodule'] as const, + /** Create namespaceModule mutation key */ create: () => + ['mutation', 'namespacemodule', 'create'] as const, + /** Update namespaceModule mutation key */ update: (id: string | number) => + ['mutation', 'namespacemodule', 'update', id] as const, + /** Delete namespaceModule mutation key */ delete: (id: string | number) => + ['mutation', 'namespacemodule', 'delete', id] as const, } as const; export const notificationsModuleMutationKeys = { - /** All notificationsModule mutation keys */all: ["mutation", "notificationsmodule"] as const, - /** Create notificationsModule mutation key */create: () => ["mutation", "notificationsmodule", "create"] as const, - /** Update notificationsModule mutation key */update: (id: string | number) => ["mutation", "notificationsmodule", "update", id] as const, - /** Delete notificationsModule mutation key */delete: (id: string | number) => ["mutation", "notificationsmodule", "delete", id] as const + /** All notificationsModule mutation keys */ all: ['mutation', 'notificationsmodule'] as const, + /** Create notificationsModule mutation key */ create: () => + ['mutation', 'notificationsmodule', 'create'] as const, + /** Update notificationsModule mutation key */ update: (id: string | number) => + ['mutation', 'notificationsmodule', 'update', id] as const, + /** Delete notificationsModule mutation key */ delete: (id: string | number) => + ['mutation', 'notificationsmodule', 'delete', id] as const, } as const; export const permissionsModuleMutationKeys = { - /** All permissionsModule mutation keys */all: ["mutation", "permissionsmodule"] as const, - /** Create permissionsModule mutation key */create: () => ["mutation", "permissionsmodule", "create"] as const, - /** Update permissionsModule mutation key */update: (id: string | number) => ["mutation", "permissionsmodule", "update", id] as const, - /** Delete permissionsModule mutation key */delete: (id: string | number) => ["mutation", "permissionsmodule", "delete", id] as const + /** All permissionsModule mutation keys */ all: ['mutation', 'permissionsmodule'] as const, + /** Create permissionsModule mutation key */ create: () => + ['mutation', 'permissionsmodule', 'create'] as const, + /** Update permissionsModule mutation key */ update: (id: string | number) => + ['mutation', 'permissionsmodule', 'update', id] as const, + /** Delete permissionsModule mutation key */ delete: (id: string | number) => + ['mutation', 'permissionsmodule', 'delete', id] as const, } as const; export const phoneNumbersModuleMutationKeys = { - /** All phoneNumbersModule mutation keys */all: ["mutation", "phonenumbersmodule"] as const, - /** Create phoneNumbersModule mutation key */create: () => ["mutation", "phonenumbersmodule", "create"] as const, - /** Update phoneNumbersModule mutation key */update: (id: string | number) => ["mutation", "phonenumbersmodule", "update", id] as const, - /** Delete phoneNumbersModule mutation key */delete: (id: string | number) => ["mutation", "phonenumbersmodule", "delete", id] as const + /** All phoneNumbersModule mutation keys */ all: ['mutation', 'phonenumbersmodule'] as const, + /** Create phoneNumbersModule mutation key */ create: () => + ['mutation', 'phonenumbersmodule', 'create'] as const, + /** Update phoneNumbersModule mutation key */ update: (id: string | number) => + ['mutation', 'phonenumbersmodule', 'update', id] as const, + /** Delete phoneNumbersModule mutation key */ delete: (id: string | number) => + ['mutation', 'phonenumbersmodule', 'delete', id] as const, } as const; export const plansModuleMutationKeys = { - /** All plansModule mutation keys */all: ["mutation", "plansmodule"] as const, - /** Create plansModule mutation key */create: () => ["mutation", "plansmodule", "create"] as const, - /** Update plansModule mutation key */update: (id: string | number) => ["mutation", "plansmodule", "update", id] as const, - /** Delete plansModule mutation key */delete: (id: string | number) => ["mutation", "plansmodule", "delete", id] as const + /** All plansModule mutation keys */ all: ['mutation', 'plansmodule'] as const, + /** Create plansModule mutation key */ create: () => + ['mutation', 'plansmodule', 'create'] as const, + /** Update plansModule mutation key */ update: (id: string | number) => + ['mutation', 'plansmodule', 'update', id] as const, + /** Delete plansModule mutation key */ delete: (id: string | number) => + ['mutation', 'plansmodule', '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 + /** 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 profilesModuleMutationKeys = { - /** All profilesModule mutation keys */all: ["mutation", "profilesmodule"] as const, - /** Create profilesModule mutation key */create: () => ["mutation", "profilesmodule", "create"] as const, - /** Update profilesModule mutation key */update: (id: string | number) => ["mutation", "profilesmodule", "update", id] as const, - /** Delete profilesModule mutation key */delete: (id: string | number) => ["mutation", "profilesmodule", "delete", id] as const + /** All profilesModule mutation keys */ all: ['mutation', 'profilesmodule'] as const, + /** Create profilesModule mutation key */ create: () => + ['mutation', 'profilesmodule', 'create'] as const, + /** Update profilesModule mutation key */ update: (id: string | number) => + ['mutation', 'profilesmodule', 'update', id] as const, + /** Delete profilesModule mutation key */ delete: (id: string | number) => + ['mutation', 'profilesmodule', 'delete', id] as const, } as const; export const rateLimitMetersModuleMutationKeys = { - /** All rateLimitMetersModule mutation keys */all: ["mutation", "ratelimitmetersmodule"] as const, - /** Create rateLimitMetersModule mutation key */create: () => ["mutation", "ratelimitmetersmodule", "create"] as const, - /** Update rateLimitMetersModule mutation key */update: (id: string | number) => ["mutation", "ratelimitmetersmodule", "update", id] as const, - /** Delete rateLimitMetersModule mutation key */delete: (id: string | number) => ["mutation", "ratelimitmetersmodule", "delete", id] as const + /** All rateLimitMetersModule mutation keys */ all: [ + 'mutation', + 'ratelimitmetersmodule', + ] as const, + /** Create rateLimitMetersModule mutation key */ create: () => + ['mutation', 'ratelimitmetersmodule', 'create'] as const, + /** Update rateLimitMetersModule mutation key */ update: (id: string | number) => + ['mutation', 'ratelimitmetersmodule', 'update', id] as const, + /** Delete rateLimitMetersModule mutation key */ delete: (id: string | number) => + ['mutation', 'ratelimitmetersmodule', 'delete', id] as const, } as const; export const rateLimitsModuleMutationKeys = { - /** All rateLimitsModule mutation keys */all: ["mutation", "ratelimitsmodule"] as const, - /** Create rateLimitsModule mutation key */create: () => ["mutation", "ratelimitsmodule", "create"] as const, - /** Update rateLimitsModule mutation key */update: (id: string | number) => ["mutation", "ratelimitsmodule", "update", id] as const, - /** Delete rateLimitsModule mutation key */delete: (id: string | number) => ["mutation", "ratelimitsmodule", "delete", id] as const + /** All rateLimitsModule mutation keys */ all: ['mutation', 'ratelimitsmodule'] as const, + /** Create rateLimitsModule mutation key */ create: () => + ['mutation', 'ratelimitsmodule', 'create'] as const, + /** Update rateLimitsModule mutation key */ update: (id: string | number) => + ['mutation', 'ratelimitsmodule', 'update', id] as const, + /** Delete rateLimitsModule mutation key */ delete: (id: string | number) => + ['mutation', 'ratelimitsmodule', 'delete', id] as const, } as const; export const realtimeModuleMutationKeys = { - /** All realtimeModule mutation keys */all: ["mutation", "realtimemodule"] as const, - /** Create realtimeModule mutation key */create: () => ["mutation", "realtimemodule", "create"] as const, - /** Update realtimeModule mutation key */update: (id: string | number) => ["mutation", "realtimemodule", "update", id] as const, - /** Delete realtimeModule mutation key */delete: (id: string | number) => ["mutation", "realtimemodule", "delete", id] as const + /** All realtimeModule mutation keys */ all: ['mutation', 'realtimemodule'] as const, + /** Create realtimeModule mutation key */ create: () => + ['mutation', 'realtimemodule', 'create'] as const, + /** Update realtimeModule mutation key */ update: (id: string | number) => + ['mutation', 'realtimemodule', 'update', id] as const, + /** Delete realtimeModule mutation key */ delete: (id: string | number) => + ['mutation', 'realtimemodule', 'delete', id] as const, } as const; export const relationProvisionMutationKeys = { - /** All relationProvision mutation keys */all: ["mutation", "relationprovision"] as const, - /** Create relationProvision mutation key */create: () => ["mutation", "relationprovision", "create"] as const, - /** Update relationProvision mutation key */update: (id: string | number) => ["mutation", "relationprovision", "update", id] as const, - /** Delete relationProvision mutation key */delete: (id: string | number) => ["mutation", "relationprovision", "delete", id] as const + /** All relationProvision mutation keys */ all: ['mutation', 'relationprovision'] as const, + /** Create relationProvision mutation key */ create: () => + ['mutation', 'relationprovision', 'create'] as const, + /** Update relationProvision mutation key */ update: (id: string | number) => + ['mutation', 'relationprovision', 'update', id] as const, + /** Delete relationProvision mutation key */ delete: (id: string | number) => + ['mutation', 'relationprovision', 'delete', id] as const, } as const; export const resourceModuleMutationKeys = { - /** All resourceModule mutation keys */all: ["mutation", "resourcemodule"] as const, - /** Create resourceModule mutation key */create: () => ["mutation", "resourcemodule", "create"] as const, - /** Update resourceModule mutation key */update: (id: string | number) => ["mutation", "resourcemodule", "update", id] as const, - /** Delete resourceModule mutation key */delete: (id: string | number) => ["mutation", "resourcemodule", "delete", id] as const + /** All resourceModule mutation keys */ all: ['mutation', 'resourcemodule'] as const, + /** Create resourceModule mutation key */ create: () => + ['mutation', 'resourcemodule', 'create'] as const, + /** Update resourceModule mutation key */ update: (id: string | number) => + ['mutation', 'resourcemodule', 'update', id] as const, + /** Delete resourceModule mutation key */ delete: (id: string | number) => + ['mutation', 'resourcemodule', 'delete', id] as const, } as const; export const rlsModuleMutationKeys = { - /** All rlsModule mutation keys */all: ["mutation", "rlsmodule"] as const, - /** Create rlsModule mutation key */create: () => ["mutation", "rlsmodule", "create"] as const, - /** Update rlsModule mutation key */update: (id: string | number) => ["mutation", "rlsmodule", "update", id] as const, - /** Delete rlsModule mutation key */delete: (id: string | number) => ["mutation", "rlsmodule", "delete", id] as const + /** All rlsModule mutation keys */ all: ['mutation', 'rlsmodule'] as const, + /** Create rlsModule mutation key */ create: () => ['mutation', 'rlsmodule', 'create'] as const, + /** Update rlsModule mutation key */ update: (id: string | number) => + ['mutation', 'rlsmodule', 'update', id] as const, + /** Delete rlsModule mutation key */ delete: (id: string | number) => + ['mutation', 'rlsmodule', 'delete', id] as const, } as const; export const routeModuleMutationKeys = { - /** All routeModule mutation keys */all: ["mutation", "routemodule"] as const, - /** Create routeModule mutation key */create: () => ["mutation", "routemodule", "create"] as const, - /** Update routeModule mutation key */update: (id: string | number) => ["mutation", "routemodule", "update", id] as const, - /** Delete routeModule mutation key */delete: (id: string | number) => ["mutation", "routemodule", "delete", id] as const + /** All routeModule mutation keys */ all: ['mutation', 'routemodule'] as const, + /** Create routeModule mutation key */ create: () => + ['mutation', 'routemodule', 'create'] as const, + /** Update routeModule mutation key */ update: (id: string | number) => + ['mutation', 'routemodule', 'update', id] as const, + /** Delete routeModule mutation key */ delete: (id: string | number) => + ['mutation', 'routemodule', 'delete', id] as const, } as const; export const secureTableProvisionMutationKeys = { - /** All secureTableProvision mutation keys */all: ["mutation", "securetableprovision"] as const, - /** Create secureTableProvision mutation key */create: () => ["mutation", "securetableprovision", "create"] as const, - /** Update secureTableProvision mutation key */update: (id: string | number) => ["mutation", "securetableprovision", "update", id] as const, - /** Delete secureTableProvision mutation key */delete: (id: string | number) => ["mutation", "securetableprovision", "delete", id] as const + /** All secureTableProvision mutation keys */ all: ['mutation', 'securetableprovision'] as const, + /** Create secureTableProvision mutation key */ create: () => + ['mutation', 'securetableprovision', 'create'] as const, + /** Update secureTableProvision mutation key */ update: (id: string | number) => + ['mutation', 'securetableprovision', 'update', id] as const, + /** Delete secureTableProvision mutation key */ delete: (id: string | number) => + ['mutation', 'securetableprovision', 'delete', id] as const, } as const; export const sessionSecretsModuleMutationKeys = { - /** All sessionSecretsModule mutation keys */all: ["mutation", "sessionsecretsmodule"] as const, - /** Create sessionSecretsModule mutation key */create: () => ["mutation", "sessionsecretsmodule", "create"] as const, - /** Update sessionSecretsModule mutation key */update: (id: string | number) => ["mutation", "sessionsecretsmodule", "update", id] as const, - /** Delete sessionSecretsModule mutation key */delete: (id: string | number) => ["mutation", "sessionsecretsmodule", "delete", id] as const + /** All sessionSecretsModule mutation keys */ all: ['mutation', 'sessionsecretsmodule'] as const, + /** Create sessionSecretsModule mutation key */ create: () => + ['mutation', 'sessionsecretsmodule', 'create'] as const, + /** Update sessionSecretsModule mutation key */ update: (id: string | number) => + ['mutation', 'sessionsecretsmodule', 'update', id] as const, + /** Delete sessionSecretsModule mutation key */ delete: (id: string | number) => + ['mutation', 'sessionsecretsmodule', 'delete', id] as const, } as const; export const sessionsModuleMutationKeys = { - /** All sessionsModule mutation keys */all: ["mutation", "sessionsmodule"] as const, - /** Create sessionsModule mutation key */create: () => ["mutation", "sessionsmodule", "create"] as const, - /** Update sessionsModule mutation key */update: (id: string | number) => ["mutation", "sessionsmodule", "update", id] as const, - /** Delete sessionsModule mutation key */delete: (id: string | number) => ["mutation", "sessionsmodule", "delete", id] as const + /** All sessionsModule mutation keys */ all: ['mutation', 'sessionsmodule'] as const, + /** Create sessionsModule mutation key */ create: () => + ['mutation', 'sessionsmodule', 'create'] as const, + /** Update sessionsModule mutation key */ update: (id: string | number) => + ['mutation', 'sessionsmodule', 'update', id] as const, + /** Delete sessionsModule mutation key */ delete: (id: string | number) => + ['mutation', 'sessionsmodule', 'delete', id] as const, } as const; export const siteSurfaceModuleMutationKeys = { - /** All siteSurfaceModule mutation keys */all: ["mutation", "sitesurfacemodule"] as const, - /** Create siteSurfaceModule mutation key */create: () => ["mutation", "sitesurfacemodule", "create"] as const, - /** Update siteSurfaceModule mutation key */update: (id: string | number) => ["mutation", "sitesurfacemodule", "update", id] as const, - /** Delete siteSurfaceModule mutation key */delete: (id: string | number) => ["mutation", "sitesurfacemodule", "delete", id] as const + /** All siteSurfaceModule mutation keys */ all: ['mutation', 'sitesurfacemodule'] as const, + /** Create siteSurfaceModule mutation key */ create: () => + ['mutation', 'sitesurfacemodule', 'create'] as const, + /** Update siteSurfaceModule mutation key */ update: (id: string | number) => + ['mutation', 'sitesurfacemodule', 'update', id] as const, + /** Delete siteSurfaceModule mutation key */ delete: (id: string | number) => + ['mutation', 'sitesurfacemodule', 'delete', id] as const, } as const; export const storageLogModuleMutationKeys = { - /** All storageLogModule mutation keys */all: ["mutation", "storagelogmodule"] as const, - /** Create storageLogModule mutation key */create: () => ["mutation", "storagelogmodule", "create"] as const, - /** Update storageLogModule mutation key */update: (id: string | number) => ["mutation", "storagelogmodule", "update", id] as const, - /** Delete storageLogModule mutation key */delete: (id: string | number) => ["mutation", "storagelogmodule", "delete", id] as const + /** All storageLogModule mutation keys */ all: ['mutation', 'storagelogmodule'] as const, + /** Create storageLogModule mutation key */ create: () => + ['mutation', 'storagelogmodule', 'create'] as const, + /** Update storageLogModule mutation key */ update: (id: string | number) => + ['mutation', 'storagelogmodule', 'update', id] as const, + /** Delete storageLogModule mutation key */ delete: (id: string | number) => + ['mutation', 'storagelogmodule', 'delete', id] as const, } as const; export const storageModuleMutationKeys = { - /** All storageModule mutation keys */all: ["mutation", "storagemodule"] as const, - /** Create storageModule mutation key */create: () => ["mutation", "storagemodule", "create"] as const, - /** Update storageModule mutation key */update: (id: string | number) => ["mutation", "storagemodule", "update", id] as const, - /** Delete storageModule mutation key */delete: (id: string | number) => ["mutation", "storagemodule", "delete", id] as const + /** All storageModule mutation keys */ all: ['mutation', 'storagemodule'] as const, + /** Create storageModule mutation key */ create: () => + ['mutation', 'storagemodule', 'create'] as const, + /** Update storageModule mutation key */ update: (id: string | number) => + ['mutation', 'storagemodule', 'update', id] as const, + /** Delete storageModule mutation key */ delete: (id: string | number) => + ['mutation', 'storagemodule', 'delete', id] as const, } as const; export const transferLogModuleMutationKeys = { - /** All transferLogModule mutation keys */all: ["mutation", "transferlogmodule"] as const, - /** Create transferLogModule mutation key */create: () => ["mutation", "transferlogmodule", "create"] as const, - /** Update transferLogModule mutation key */update: (id: string | number) => ["mutation", "transferlogmodule", "update", id] as const, - /** Delete transferLogModule mutation key */delete: (id: string | number) => ["mutation", "transferlogmodule", "delete", id] as const + /** All transferLogModule mutation keys */ all: ['mutation', 'transferlogmodule'] as const, + /** Create transferLogModule mutation key */ create: () => + ['mutation', 'transferlogmodule', 'create'] as const, + /** Update transferLogModule mutation key */ update: (id: string | number) => + ['mutation', 'transferlogmodule', 'update', id] as const, + /** Delete transferLogModule mutation key */ delete: (id: string | number) => + ['mutation', 'transferlogmodule', 'delete', id] as const, } as const; export const userAuthModuleMutationKeys = { - /** All userAuthModule mutation keys */all: ["mutation", "userauthmodule"] as const, - /** Create userAuthModule mutation key */create: () => ["mutation", "userauthmodule", "create"] as const, - /** Update userAuthModule mutation key */update: (id: string | number) => ["mutation", "userauthmodule", "update", id] as const, - /** Delete userAuthModule mutation key */delete: (id: string | number) => ["mutation", "userauthmodule", "delete", id] as const + /** All userAuthModule mutation keys */ all: ['mutation', 'userauthmodule'] as const, + /** Create userAuthModule mutation key */ create: () => + ['mutation', 'userauthmodule', 'create'] as const, + /** Update userAuthModule mutation key */ update: (id: string | number) => + ['mutation', 'userauthmodule', 'update', id] as const, + /** Delete userAuthModule mutation key */ delete: (id: string | number) => + ['mutation', 'userauthmodule', 'delete', id] as const, } as const; export const userCredentialsModuleMutationKeys = { - /** All userCredentialsModule mutation keys */all: ["mutation", "usercredentialsmodule"] as const, - /** Create userCredentialsModule mutation key */create: () => ["mutation", "usercredentialsmodule", "create"] as const, - /** Update userCredentialsModule mutation key */update: (id: string | number) => ["mutation", "usercredentialsmodule", "update", id] as const, - /** Delete userCredentialsModule mutation key */delete: (id: string | number) => ["mutation", "usercredentialsmodule", "delete", id] as const + /** All userCredentialsModule mutation keys */ all: [ + 'mutation', + 'usercredentialsmodule', + ] as const, + /** Create userCredentialsModule mutation key */ create: () => + ['mutation', 'usercredentialsmodule', 'create'] as const, + /** Update userCredentialsModule mutation key */ update: (id: string | number) => + ['mutation', 'usercredentialsmodule', 'update', id] as const, + /** Delete userCredentialsModule mutation key */ delete: (id: string | number) => + ['mutation', 'usercredentialsmodule', 'delete', id] as const, } as const; export const userSettingsModuleMutationKeys = { - /** All userSettingsModule mutation keys */all: ["mutation", "usersettingsmodule"] as const, - /** Create userSettingsModule mutation key */create: () => ["mutation", "usersettingsmodule", "create"] as const, - /** Update userSettingsModule mutation key */update: (id: string | number) => ["mutation", "usersettingsmodule", "update", id] as const, - /** Delete userSettingsModule mutation key */delete: (id: string | number) => ["mutation", "usersettingsmodule", "delete", id] as const + /** All userSettingsModule mutation keys */ all: ['mutation', 'usersettingsmodule'] as const, + /** Create userSettingsModule mutation key */ create: () => + ['mutation', 'usersettingsmodule', 'create'] as const, + /** Update userSettingsModule mutation key */ update: (id: string | number) => + ['mutation', 'usersettingsmodule', 'update', id] as const, + /** Delete userSettingsModule mutation key */ delete: (id: string | number) => + ['mutation', 'usersettingsmodule', 'delete', id] as const, } as const; export const userStateModuleMutationKeys = { - /** All userStateModule mutation keys */all: ["mutation", "userstatemodule"] as const, - /** Create userStateModule mutation key */create: () => ["mutation", "userstatemodule", "create"] as const, - /** Update userStateModule mutation key */update: (id: string | number) => ["mutation", "userstatemodule", "update", id] as const, - /** Delete userStateModule mutation key */delete: (id: string | number) => ["mutation", "userstatemodule", "delete", id] as const + /** All userStateModule mutation keys */ all: ['mutation', 'userstatemodule'] as const, + /** Create userStateModule mutation key */ create: () => + ['mutation', 'userstatemodule', 'create'] as const, + /** Update userStateModule mutation key */ update: (id: string | number) => + ['mutation', 'userstatemodule', 'update', id] as const, + /** Delete userStateModule mutation key */ delete: (id: string | number) => + ['mutation', 'userstatemodule', 'delete', id] as const, } as const; export const usersModuleMutationKeys = { - /** All usersModule mutation keys */all: ["mutation", "usersmodule"] as const, - /** Create usersModule mutation key */create: () => ["mutation", "usersmodule", "create"] as const, - /** Update usersModule mutation key */update: (id: string | number) => ["mutation", "usersmodule", "update", id] as const, - /** Delete usersModule mutation key */delete: (id: string | number) => ["mutation", "usersmodule", "delete", id] as const + /** All usersModule mutation keys */ all: ['mutation', 'usersmodule'] as const, + /** Create usersModule mutation key */ create: () => + ['mutation', 'usersmodule', 'create'] as const, + /** Update usersModule mutation key */ update: (id: string | number) => + ['mutation', 'usersmodule', 'update', id] as const, + /** Delete usersModule mutation key */ delete: (id: string | number) => + ['mutation', 'usersmodule', 'delete', id] as const, } as const; export const webauthnAuthModuleMutationKeys = { - /** All webauthnAuthModule mutation keys */all: ["mutation", "webauthnauthmodule"] as const, - /** Create webauthnAuthModule mutation key */create: () => ["mutation", "webauthnauthmodule", "create"] as const, - /** Update webauthnAuthModule mutation key */update: (id: string | number) => ["mutation", "webauthnauthmodule", "update", id] as const, - /** Delete webauthnAuthModule mutation key */delete: (id: string | number) => ["mutation", "webauthnauthmodule", "delete", id] as const + /** All webauthnAuthModule mutation keys */ all: ['mutation', 'webauthnauthmodule'] as const, + /** Create webauthnAuthModule mutation key */ create: () => + ['mutation', 'webauthnauthmodule', 'create'] as const, + /** Update webauthnAuthModule mutation key */ update: (id: string | number) => + ['mutation', 'webauthnauthmodule', 'update', id] as const, + /** Delete webauthnAuthModule mutation key */ delete: (id: string | number) => + ['mutation', 'webauthnauthmodule', 'delete', id] as const, } as const; export const webauthnCredentialsModuleMutationKeys = { - /** All webauthnCredentialsModule mutation keys */all: ["mutation", "webauthncredentialsmodule"] as const, - /** Create webauthnCredentialsModule mutation key */create: () => ["mutation", "webauthncredentialsmodule", "create"] as const, - /** Update webauthnCredentialsModule mutation key */update: (id: string | number) => ["mutation", "webauthncredentialsmodule", "update", id] as const, - /** Delete webauthnCredentialsModule mutation key */delete: (id: string | number) => ["mutation", "webauthncredentialsmodule", "delete", id] as const + /** All webauthnCredentialsModule mutation keys */ all: [ + 'mutation', + 'webauthncredentialsmodule', + ] as const, + /** Create webauthnCredentialsModule mutation key */ create: () => + ['mutation', 'webauthncredentialsmodule', 'create'] as const, + /** Update webauthnCredentialsModule mutation key */ update: (id: string | number) => + ['mutation', 'webauthncredentialsmodule', 'update', id] as const, + /** Delete webauthnCredentialsModule mutation key */ delete: (id: string | number) => + ['mutation', 'webauthncredentialsmodule', 'delete', id] as const, } as const; export const webhookModuleMutationKeys = { - /** All webhookModule mutation keys */all: ["mutation", "webhookmodule"] as const, - /** Create webhookModule mutation key */create: () => ["mutation", "webhookmodule", "create"] as const, - /** Update webhookModule mutation key */update: (id: string | number) => ["mutation", "webhookmodule", "update", id] as const, - /** Delete webhookModule mutation key */delete: (id: string | number) => ["mutation", "webhookmodule", "delete", id] as const + /** All webhookModule mutation keys */ all: ['mutation', 'webhookmodule'] as const, + /** Create webhookModule mutation key */ create: () => + ['mutation', 'webhookmodule', 'create'] as const, + /** Update webhookModule mutation key */ update: (id: string | number) => + ['mutation', 'webhookmodule', 'update', id] as const, + /** Delete webhookModule mutation key */ delete: (id: string | number) => + ['mutation', 'webhookmodule', 'delete', id] as const, } as const; // ============================================================================ @@ -474,16 +745,52 @@ export const webhookModuleMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for constructBlueprint */constructBlueprint: (identifier?: string) => identifier ? ["mutation", "constructBlueprint", identifier] as const : ["mutation", "constructBlueprint"] as const, - /** Mutation key for copyTemplateToBlueprint */copyTemplateToBlueprint: (identifier?: string) => identifier ? ["mutation", "copyTemplateToBlueprint", identifier] as const : ["mutation", "copyTemplateToBlueprint"] as const, - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const, - /** Mutation key for provisionCheckConstraint */provisionCheckConstraint: (identifier?: string) => identifier ? ["mutation", "provisionCheckConstraint", identifier] as const : ["mutation", "provisionCheckConstraint"] as const, - /** Mutation key for provisionFullTextSearch */provisionFullTextSearch: (identifier?: string) => identifier ? ["mutation", "provisionFullTextSearch", identifier] as const : ["mutation", "provisionFullTextSearch"] as const, - /** Mutation key for provisionIndex */provisionIndex: (identifier?: string) => identifier ? ["mutation", "provisionIndex", identifier] as const : ["mutation", "provisionIndex"] as const, - /** Mutation key for provisionRelation */provisionRelation: (identifier?: string) => identifier ? ["mutation", "provisionRelation", identifier] as const : ["mutation", "provisionRelation"] as const, - /** Mutation key for provisionSpatialRelation */provisionSpatialRelation: (identifier?: string) => identifier ? ["mutation", "provisionSpatialRelation", identifier] as const : ["mutation", "provisionSpatialRelation"] as const, - /** Mutation key for provisionTable */provisionTable: (identifier?: string) => identifier ? ["mutation", "provisionTable", identifier] as const : ["mutation", "provisionTable"] as const, - /** Mutation key for provisionUniqueConstraint */provisionUniqueConstraint: (identifier?: string) => identifier ? ["mutation", "provisionUniqueConstraint", identifier] as const : ["mutation", "provisionUniqueConstraint"] as const + /** Mutation key for constructBlueprint */ constructBlueprint: (identifier?: string) => + identifier + ? (['mutation', 'constructBlueprint', identifier] as const) + : (['mutation', 'constructBlueprint'] as const), + /** Mutation key for copyTemplateToBlueprint */ copyTemplateToBlueprint: (identifier?: string) => + identifier + ? (['mutation', 'copyTemplateToBlueprint', identifier] as const) + : (['mutation', 'copyTemplateToBlueprint'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), + /** Mutation key for provisionCheckConstraint */ provisionCheckConstraint: ( + identifier?: string + ) => + identifier + ? (['mutation', 'provisionCheckConstraint', identifier] as const) + : (['mutation', 'provisionCheckConstraint'] as const), + /** Mutation key for provisionFullTextSearch */ provisionFullTextSearch: (identifier?: string) => + identifier + ? (['mutation', 'provisionFullTextSearch', identifier] as const) + : (['mutation', 'provisionFullTextSearch'] as const), + /** Mutation key for provisionIndex */ provisionIndex: (identifier?: string) => + identifier + ? (['mutation', 'provisionIndex', identifier] as const) + : (['mutation', 'provisionIndex'] as const), + /** Mutation key for provisionRelation */ provisionRelation: (identifier?: string) => + identifier + ? (['mutation', 'provisionRelation', identifier] as const) + : (['mutation', 'provisionRelation'] as const), + /** Mutation key for provisionSpatialRelation */ provisionSpatialRelation: ( + identifier?: string + ) => + identifier + ? (['mutation', 'provisionSpatialRelation', identifier] as const) + : (['mutation', 'provisionSpatialRelation'] as const), + /** Mutation key for provisionTable */ provisionTable: (identifier?: string) => + identifier + ? (['mutation', 'provisionTable', identifier] as const) + : (['mutation', 'provisionTable'] as const), + /** Mutation key for provisionUniqueConstraint */ provisionUniqueConstraint: ( + identifier?: string + ) => + identifier + ? (['mutation', 'provisionUniqueConstraint', identifier] as const) + : (['mutation', 'provisionUniqueConstraint'] as const), } as const; /** @@ -583,5 +890,5 @@ export const mutationKeys = { webauthnAuthModule: webauthnAuthModuleMutationKeys, webauthnCredentialsModule: webauthnCredentialsModuleMutationKeys, webhookModule: webhookModuleMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/modules/hooks/mutations/index.ts b/sdk/constructive-react/src/modules/hooks/mutations/index.ts index 75f1af70d8..3ef5f87862 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/index.ts @@ -3,238 +3,238 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateAgentModuleMutation"; -export * from "./useUpdateAgentModuleMutation"; -export * from "./useDeleteAgentModuleMutation"; -export * from "./useCreateApiSurfaceModuleMutation"; -export * from "./useUpdateApiSurfaceModuleMutation"; -export * from "./useDeleteApiSurfaceModuleMutation"; -export * from "./useCreateAppModuleMutation"; -export * from "./useUpdateAppModuleMutation"; -export * from "./useDeleteAppModuleMutation"; -export * from "./useCreateBillingModuleMutation"; -export * from "./useUpdateBillingModuleMutation"; -export * from "./useDeleteBillingModuleMutation"; -export * from "./useCreateBillingProviderModuleMutation"; -export * from "./useUpdateBillingProviderModuleMutation"; -export * from "./useDeleteBillingProviderModuleMutation"; -export * from "./useCreateBlueprintMutation"; -export * from "./useUpdateBlueprintMutation"; -export * from "./useDeleteBlueprintMutation"; -export * from "./useCreateBlueprintConstructionMutation"; -export * from "./useUpdateBlueprintConstructionMutation"; -export * from "./useDeleteBlueprintConstructionMutation"; -export * from "./useCreateBlueprintTemplateMutation"; -export * from "./useUpdateBlueprintTemplateMutation"; -export * from "./useDeleteBlueprintTemplateMutation"; -export * from "./useCreateCatalogModuleMutation"; -export * from "./useUpdateCatalogModuleMutation"; -export * from "./useDeleteCatalogModuleMutation"; -export * from "./useCreateComputeLogModuleMutation"; -export * from "./useUpdateComputeLogModuleMutation"; -export * from "./useDeleteComputeLogModuleMutation"; -export * from "./useCreateConfigSecretsUserModuleMutation"; -export * from "./useUpdateConfigSecretsUserModuleMutation"; -export * from "./useDeleteConfigSecretsUserModuleMutation"; -export * from "./useCreateConnectedAccountsModuleMutation"; -export * from "./useUpdateConnectedAccountsModuleMutation"; -export * from "./useDeleteConnectedAccountsModuleMutation"; -export * from "./useCreateCryptoAddressesModuleMutation"; -export * from "./useUpdateCryptoAddressesModuleMutation"; -export * from "./useDeleteCryptoAddressesModuleMutation"; -export * from "./useCreateCryptoAuthModuleMutation"; -export * from "./useUpdateCryptoAuthModuleMutation"; -export * from "./useDeleteCryptoAuthModuleMutation"; -export * from "./useCreateDatabaseProvisionModuleMutation"; -export * from "./useUpdateDatabaseProvisionModuleMutation"; -export * from "./useDeleteDatabaseProvisionModuleMutation"; -export * from "./useCreateDatabaseSettingsModuleMutation"; -export * from "./useUpdateDatabaseSettingsModuleMutation"; -export * from "./useDeleteDatabaseSettingsModuleMutation"; -export * from "./useCreateDbPoolConfigMutation"; -export * from "./useUpdateDbPoolConfigMutation"; -export * from "./useDeleteDbPoolConfigMutation"; -export * from "./useCreateDbPoolMutation"; -export * from "./useUpdateDbPoolMutation"; -export * from "./useDeleteDbPoolMutation"; -export * from "./useCreateDbPresetModuleMutation"; -export * from "./useUpdateDbPresetModuleMutation"; -export * from "./useDeleteDbPresetModuleMutation"; -export * from "./useCreateDbUsageModuleMutation"; -export * from "./useUpdateDbUsageModuleMutation"; -export * from "./useDeleteDbUsageModuleMutation"; -export * from "./useCreateDefaultIdsModuleMutation"; -export * from "./useUpdateDefaultIdsModuleMutation"; -export * from "./useDeleteDefaultIdsModuleMutation"; -export * from "./useCreateDenormalizedTableFieldMutation"; -export * from "./useUpdateDenormalizedTableFieldMutation"; -export * from "./useDeleteDenormalizedTableFieldMutation"; -export * from "./useCreateDevicesModuleMutation"; -export * from "./useUpdateDevicesModuleMutation"; -export * from "./useDeleteDevicesModuleMutation"; -export * from "./useCreateDomainModuleMutation"; -export * from "./useUpdateDomainModuleMutation"; -export * from "./useDeleteDomainModuleMutation"; -export * from "./useCreateEmailsModuleMutation"; -export * from "./useUpdateEmailsModuleMutation"; -export * from "./useDeleteEmailsModuleMutation"; -export * from "./useCreateEntityTypeProvisionMutation"; -export * from "./useUpdateEntityTypeProvisionMutation"; -export * from "./useDeleteEntityTypeProvisionMutation"; -export * from "./useCreateEventsModuleMutation"; -export * from "./useUpdateEventsModuleMutation"; -export * from "./useDeleteEventsModuleMutation"; -export * from "./useCreateFunctionDeploymentModuleMutation"; -export * from "./useUpdateFunctionDeploymentModuleMutation"; -export * from "./useDeleteFunctionDeploymentModuleMutation"; -export * from "./useCreateFunctionInvocationModuleMutation"; -export * from "./useUpdateFunctionInvocationModuleMutation"; -export * from "./useDeleteFunctionInvocationModuleMutation"; -export * from "./useCreateFunctionModuleMutation"; -export * from "./useUpdateFunctionModuleMutation"; -export * from "./useDeleteFunctionModuleMutation"; -export * from "./useCreateGraphExecutionModuleMutation"; -export * from "./useUpdateGraphExecutionModuleMutation"; -export * from "./useDeleteGraphExecutionModuleMutation"; -export * from "./useCreateGraphModuleMutation"; -export * from "./useUpdateGraphModuleMutation"; -export * from "./useDeleteGraphModuleMutation"; -export * from "./useCreateHierarchyModuleMutation"; -export * from "./useUpdateHierarchyModuleMutation"; -export * from "./useDeleteHierarchyModuleMutation"; -export * from "./useCreateHttpRouteModuleMutation"; -export * from "./useUpdateHttpRouteModuleMutation"; -export * from "./useDeleteHttpRouteModuleMutation"; -export * from "./useCreateI18NModuleMutation"; -export * from "./useUpdateI18NModuleMutation"; -export * from "./useDeleteI18NModuleMutation"; -export * from "./useCreateIdentityProvidersModuleMutation"; -export * from "./useUpdateIdentityProvidersModuleMutation"; -export * from "./useDeleteIdentityProvidersModuleMutation"; -export * from "./useCreateInferenceLogModuleMutation"; -export * from "./useUpdateInferenceLogModuleMutation"; -export * from "./useDeleteInferenceLogModuleMutation"; -export * from "./useCreateInfraConfigModuleMutation"; -export * from "./useUpdateInfraConfigModuleMutation"; -export * from "./useDeleteInfraConfigModuleMutation"; -export * from "./useCreateInfraSecretsModuleMutation"; -export * from "./useUpdateInfraSecretsModuleMutation"; -export * from "./useDeleteInfraSecretsModuleMutation"; -export * from "./useCreateIntegrationProvidersModuleMutation"; -export * from "./useUpdateIntegrationProvidersModuleMutation"; -export * from "./useDeleteIntegrationProvidersModuleMutation"; -export * from "./useCreateInternalSecretsModuleMutation"; -export * from "./useUpdateInternalSecretsModuleMutation"; -export * from "./useDeleteInternalSecretsModuleMutation"; -export * from "./useCreateInvitesModuleMutation"; -export * from "./useUpdateInvitesModuleMutation"; -export * from "./useDeleteInvitesModuleMutation"; -export * from "./useCreateLimitsModuleMutation"; -export * from "./useUpdateLimitsModuleMutation"; -export * from "./useDeleteLimitsModuleMutation"; -export * from "./useCreateMembershipTypesModuleMutation"; -export * from "./useUpdateMembershipTypesModuleMutation"; -export * from "./useDeleteMembershipTypesModuleMutation"; -export * from "./useCreateMembershipsModuleMutation"; -export * from "./useUpdateMembershipsModuleMutation"; -export * from "./useDeleteMembershipsModuleMutation"; -export * from "./useCreateMerkleStoreModuleMutation"; -export * from "./useUpdateMerkleStoreModuleMutation"; -export * from "./useDeleteMerkleStoreModuleMutation"; -export * from "./useCreateNamespaceModuleMutation"; -export * from "./useUpdateNamespaceModuleMutation"; -export * from "./useDeleteNamespaceModuleMutation"; -export * from "./useCreateNotificationsModuleMutation"; -export * from "./useUpdateNotificationsModuleMutation"; -export * from "./useDeleteNotificationsModuleMutation"; -export * from "./useCreatePermissionsModuleMutation"; -export * from "./useUpdatePermissionsModuleMutation"; -export * from "./useDeletePermissionsModuleMutation"; -export * from "./useCreatePhoneNumbersModuleMutation"; -export * from "./useUpdatePhoneNumbersModuleMutation"; -export * from "./useDeletePhoneNumbersModuleMutation"; -export * from "./useCreatePlansModuleMutation"; -export * from "./useUpdatePlansModuleMutation"; -export * from "./useDeletePlansModuleMutation"; -export * from "./useCreatePrincipalAuthModuleMutation"; -export * from "./useUpdatePrincipalAuthModuleMutation"; -export * from "./useDeletePrincipalAuthModuleMutation"; -export * from "./useCreateProfilesModuleMutation"; -export * from "./useUpdateProfilesModuleMutation"; -export * from "./useDeleteProfilesModuleMutation"; -export * from "./useCreateRateLimitMetersModuleMutation"; -export * from "./useUpdateRateLimitMetersModuleMutation"; -export * from "./useDeleteRateLimitMetersModuleMutation"; -export * from "./useCreateRateLimitsModuleMutation"; -export * from "./useUpdateRateLimitsModuleMutation"; -export * from "./useDeleteRateLimitsModuleMutation"; -export * from "./useCreateRealtimeModuleMutation"; -export * from "./useUpdateRealtimeModuleMutation"; -export * from "./useDeleteRealtimeModuleMutation"; -export * from "./useCreateRelationProvisionMutation"; -export * from "./useUpdateRelationProvisionMutation"; -export * from "./useDeleteRelationProvisionMutation"; -export * from "./useCreateResourceModuleMutation"; -export * from "./useUpdateResourceModuleMutation"; -export * from "./useDeleteResourceModuleMutation"; -export * from "./useCreateRlsModuleMutation"; -export * from "./useUpdateRlsModuleMutation"; -export * from "./useDeleteRlsModuleMutation"; -export * from "./useCreateRouteModuleMutation"; -export * from "./useUpdateRouteModuleMutation"; -export * from "./useDeleteRouteModuleMutation"; -export * from "./useCreateSecureTableProvisionMutation"; -export * from "./useUpdateSecureTableProvisionMutation"; -export * from "./useDeleteSecureTableProvisionMutation"; -export * from "./useCreateSessionSecretsModuleMutation"; -export * from "./useUpdateSessionSecretsModuleMutation"; -export * from "./useDeleteSessionSecretsModuleMutation"; -export * from "./useCreateSessionsModuleMutation"; -export * from "./useUpdateSessionsModuleMutation"; -export * from "./useDeleteSessionsModuleMutation"; -export * from "./useCreateSiteSurfaceModuleMutation"; -export * from "./useUpdateSiteSurfaceModuleMutation"; -export * from "./useDeleteSiteSurfaceModuleMutation"; -export * from "./useCreateStorageLogModuleMutation"; -export * from "./useUpdateStorageLogModuleMutation"; -export * from "./useDeleteStorageLogModuleMutation"; -export * from "./useCreateStorageModuleMutation"; -export * from "./useUpdateStorageModuleMutation"; -export * from "./useDeleteStorageModuleMutation"; -export * from "./useCreateTransferLogModuleMutation"; -export * from "./useUpdateTransferLogModuleMutation"; -export * from "./useDeleteTransferLogModuleMutation"; -export * from "./useCreateUserAuthModuleMutation"; -export * from "./useUpdateUserAuthModuleMutation"; -export * from "./useDeleteUserAuthModuleMutation"; -export * from "./useCreateUserCredentialsModuleMutation"; -export * from "./useUpdateUserCredentialsModuleMutation"; -export * from "./useDeleteUserCredentialsModuleMutation"; -export * from "./useCreateUserSettingsModuleMutation"; -export * from "./useUpdateUserSettingsModuleMutation"; -export * from "./useDeleteUserSettingsModuleMutation"; -export * from "./useCreateUserStateModuleMutation"; -export * from "./useUpdateUserStateModuleMutation"; -export * from "./useDeleteUserStateModuleMutation"; -export * from "./useCreateUsersModuleMutation"; -export * from "./useUpdateUsersModuleMutation"; -export * from "./useDeleteUsersModuleMutation"; -export * from "./useCreateWebauthnAuthModuleMutation"; -export * from "./useUpdateWebauthnAuthModuleMutation"; -export * from "./useDeleteWebauthnAuthModuleMutation"; -export * from "./useCreateWebauthnCredentialsModuleMutation"; -export * from "./useUpdateWebauthnCredentialsModuleMutation"; -export * from "./useDeleteWebauthnCredentialsModuleMutation"; -export * from "./useCreateWebhookModuleMutation"; -export * from "./useUpdateWebhookModuleMutation"; -export * from "./useDeleteWebhookModuleMutation"; -export * from "./useConstructBlueprintMutation"; -export * from "./useCopyTemplateToBlueprintMutation"; -export * from "./useProvisionBucketMutation"; -export * from "./useProvisionCheckConstraintMutation"; -export * from "./useProvisionFullTextSearchMutation"; -export * from "./useProvisionIndexMutation"; -export * from "./useProvisionRelationMutation"; -export * from "./useProvisionSpatialRelationMutation"; -export * from "./useProvisionTableMutation"; -export * from "./useProvisionUniqueConstraintMutation"; \ No newline at end of file +export * from './useCreateAgentModuleMutation'; +export * from './useUpdateAgentModuleMutation'; +export * from './useDeleteAgentModuleMutation'; +export * from './useCreateApiSurfaceModuleMutation'; +export * from './useUpdateApiSurfaceModuleMutation'; +export * from './useDeleteApiSurfaceModuleMutation'; +export * from './useCreateAppModuleMutation'; +export * from './useUpdateAppModuleMutation'; +export * from './useDeleteAppModuleMutation'; +export * from './useCreateBillingModuleMutation'; +export * from './useUpdateBillingModuleMutation'; +export * from './useDeleteBillingModuleMutation'; +export * from './useCreateBillingProviderModuleMutation'; +export * from './useUpdateBillingProviderModuleMutation'; +export * from './useDeleteBillingProviderModuleMutation'; +export * from './useCreateBlueprintMutation'; +export * from './useUpdateBlueprintMutation'; +export * from './useDeleteBlueprintMutation'; +export * from './useCreateBlueprintConstructionMutation'; +export * from './useUpdateBlueprintConstructionMutation'; +export * from './useDeleteBlueprintConstructionMutation'; +export * from './useCreateBlueprintTemplateMutation'; +export * from './useUpdateBlueprintTemplateMutation'; +export * from './useDeleteBlueprintTemplateMutation'; +export * from './useCreateCatalogModuleMutation'; +export * from './useUpdateCatalogModuleMutation'; +export * from './useDeleteCatalogModuleMutation'; +export * from './useCreateComputeLogModuleMutation'; +export * from './useUpdateComputeLogModuleMutation'; +export * from './useDeleteComputeLogModuleMutation'; +export * from './useCreateConfigSecretsUserModuleMutation'; +export * from './useUpdateConfigSecretsUserModuleMutation'; +export * from './useDeleteConfigSecretsUserModuleMutation'; +export * from './useCreateConnectedAccountsModuleMutation'; +export * from './useUpdateConnectedAccountsModuleMutation'; +export * from './useDeleteConnectedAccountsModuleMutation'; +export * from './useCreateCryptoAddressesModuleMutation'; +export * from './useUpdateCryptoAddressesModuleMutation'; +export * from './useDeleteCryptoAddressesModuleMutation'; +export * from './useCreateCryptoAuthModuleMutation'; +export * from './useUpdateCryptoAuthModuleMutation'; +export * from './useDeleteCryptoAuthModuleMutation'; +export * from './useCreateDatabaseProvisionModuleMutation'; +export * from './useUpdateDatabaseProvisionModuleMutation'; +export * from './useDeleteDatabaseProvisionModuleMutation'; +export * from './useCreateDatabaseSettingsModuleMutation'; +export * from './useUpdateDatabaseSettingsModuleMutation'; +export * from './useDeleteDatabaseSettingsModuleMutation'; +export * from './useCreateDbPoolConfigMutation'; +export * from './useUpdateDbPoolConfigMutation'; +export * from './useDeleteDbPoolConfigMutation'; +export * from './useCreateDbPoolMutation'; +export * from './useUpdateDbPoolMutation'; +export * from './useDeleteDbPoolMutation'; +export * from './useCreateDbPresetModuleMutation'; +export * from './useUpdateDbPresetModuleMutation'; +export * from './useDeleteDbPresetModuleMutation'; +export * from './useCreateDbUsageModuleMutation'; +export * from './useUpdateDbUsageModuleMutation'; +export * from './useDeleteDbUsageModuleMutation'; +export * from './useCreateDefaultIdsModuleMutation'; +export * from './useUpdateDefaultIdsModuleMutation'; +export * from './useDeleteDefaultIdsModuleMutation'; +export * from './useCreateDenormalizedTableFieldMutation'; +export * from './useUpdateDenormalizedTableFieldMutation'; +export * from './useDeleteDenormalizedTableFieldMutation'; +export * from './useCreateDevicesModuleMutation'; +export * from './useUpdateDevicesModuleMutation'; +export * from './useDeleteDevicesModuleMutation'; +export * from './useCreateDomainModuleMutation'; +export * from './useUpdateDomainModuleMutation'; +export * from './useDeleteDomainModuleMutation'; +export * from './useCreateEmailsModuleMutation'; +export * from './useUpdateEmailsModuleMutation'; +export * from './useDeleteEmailsModuleMutation'; +export * from './useCreateEntityTypeProvisionMutation'; +export * from './useUpdateEntityTypeProvisionMutation'; +export * from './useDeleteEntityTypeProvisionMutation'; +export * from './useCreateEventsModuleMutation'; +export * from './useUpdateEventsModuleMutation'; +export * from './useDeleteEventsModuleMutation'; +export * from './useCreateFunctionDeploymentModuleMutation'; +export * from './useUpdateFunctionDeploymentModuleMutation'; +export * from './useDeleteFunctionDeploymentModuleMutation'; +export * from './useCreateFunctionInvocationModuleMutation'; +export * from './useUpdateFunctionInvocationModuleMutation'; +export * from './useDeleteFunctionInvocationModuleMutation'; +export * from './useCreateFunctionModuleMutation'; +export * from './useUpdateFunctionModuleMutation'; +export * from './useDeleteFunctionModuleMutation'; +export * from './useCreateGraphExecutionModuleMutation'; +export * from './useUpdateGraphExecutionModuleMutation'; +export * from './useDeleteGraphExecutionModuleMutation'; +export * from './useCreateGraphModuleMutation'; +export * from './useUpdateGraphModuleMutation'; +export * from './useDeleteGraphModuleMutation'; +export * from './useCreateHierarchyModuleMutation'; +export * from './useUpdateHierarchyModuleMutation'; +export * from './useDeleteHierarchyModuleMutation'; +export * from './useCreateHttpRouteModuleMutation'; +export * from './useUpdateHttpRouteModuleMutation'; +export * from './useDeleteHttpRouteModuleMutation'; +export * from './useCreateI18NModuleMutation'; +export * from './useUpdateI18NModuleMutation'; +export * from './useDeleteI18NModuleMutation'; +export * from './useCreateIdentityProvidersModuleMutation'; +export * from './useUpdateIdentityProvidersModuleMutation'; +export * from './useDeleteIdentityProvidersModuleMutation'; +export * from './useCreateInferenceLogModuleMutation'; +export * from './useUpdateInferenceLogModuleMutation'; +export * from './useDeleteInferenceLogModuleMutation'; +export * from './useCreateInfraConfigModuleMutation'; +export * from './useUpdateInfraConfigModuleMutation'; +export * from './useDeleteInfraConfigModuleMutation'; +export * from './useCreateInfraSecretsModuleMutation'; +export * from './useUpdateInfraSecretsModuleMutation'; +export * from './useDeleteInfraSecretsModuleMutation'; +export * from './useCreateIntegrationProvidersModuleMutation'; +export * from './useUpdateIntegrationProvidersModuleMutation'; +export * from './useDeleteIntegrationProvidersModuleMutation'; +export * from './useCreateInternalSecretsModuleMutation'; +export * from './useUpdateInternalSecretsModuleMutation'; +export * from './useDeleteInternalSecretsModuleMutation'; +export * from './useCreateInvitesModuleMutation'; +export * from './useUpdateInvitesModuleMutation'; +export * from './useDeleteInvitesModuleMutation'; +export * from './useCreateLimitsModuleMutation'; +export * from './useUpdateLimitsModuleMutation'; +export * from './useDeleteLimitsModuleMutation'; +export * from './useCreateMembershipTypesModuleMutation'; +export * from './useUpdateMembershipTypesModuleMutation'; +export * from './useDeleteMembershipTypesModuleMutation'; +export * from './useCreateMembershipsModuleMutation'; +export * from './useUpdateMembershipsModuleMutation'; +export * from './useDeleteMembershipsModuleMutation'; +export * from './useCreateMerkleStoreModuleMutation'; +export * from './useUpdateMerkleStoreModuleMutation'; +export * from './useDeleteMerkleStoreModuleMutation'; +export * from './useCreateNamespaceModuleMutation'; +export * from './useUpdateNamespaceModuleMutation'; +export * from './useDeleteNamespaceModuleMutation'; +export * from './useCreateNotificationsModuleMutation'; +export * from './useUpdateNotificationsModuleMutation'; +export * from './useDeleteNotificationsModuleMutation'; +export * from './useCreatePermissionsModuleMutation'; +export * from './useUpdatePermissionsModuleMutation'; +export * from './useDeletePermissionsModuleMutation'; +export * from './useCreatePhoneNumbersModuleMutation'; +export * from './useUpdatePhoneNumbersModuleMutation'; +export * from './useDeletePhoneNumbersModuleMutation'; +export * from './useCreatePlansModuleMutation'; +export * from './useUpdatePlansModuleMutation'; +export * from './useDeletePlansModuleMutation'; +export * from './useCreatePrincipalAuthModuleMutation'; +export * from './useUpdatePrincipalAuthModuleMutation'; +export * from './useDeletePrincipalAuthModuleMutation'; +export * from './useCreateProfilesModuleMutation'; +export * from './useUpdateProfilesModuleMutation'; +export * from './useDeleteProfilesModuleMutation'; +export * from './useCreateRateLimitMetersModuleMutation'; +export * from './useUpdateRateLimitMetersModuleMutation'; +export * from './useDeleteRateLimitMetersModuleMutation'; +export * from './useCreateRateLimitsModuleMutation'; +export * from './useUpdateRateLimitsModuleMutation'; +export * from './useDeleteRateLimitsModuleMutation'; +export * from './useCreateRealtimeModuleMutation'; +export * from './useUpdateRealtimeModuleMutation'; +export * from './useDeleteRealtimeModuleMutation'; +export * from './useCreateRelationProvisionMutation'; +export * from './useUpdateRelationProvisionMutation'; +export * from './useDeleteRelationProvisionMutation'; +export * from './useCreateResourceModuleMutation'; +export * from './useUpdateResourceModuleMutation'; +export * from './useDeleteResourceModuleMutation'; +export * from './useCreateRlsModuleMutation'; +export * from './useUpdateRlsModuleMutation'; +export * from './useDeleteRlsModuleMutation'; +export * from './useCreateRouteModuleMutation'; +export * from './useUpdateRouteModuleMutation'; +export * from './useDeleteRouteModuleMutation'; +export * from './useCreateSecureTableProvisionMutation'; +export * from './useUpdateSecureTableProvisionMutation'; +export * from './useDeleteSecureTableProvisionMutation'; +export * from './useCreateSessionSecretsModuleMutation'; +export * from './useUpdateSessionSecretsModuleMutation'; +export * from './useDeleteSessionSecretsModuleMutation'; +export * from './useCreateSessionsModuleMutation'; +export * from './useUpdateSessionsModuleMutation'; +export * from './useDeleteSessionsModuleMutation'; +export * from './useCreateSiteSurfaceModuleMutation'; +export * from './useUpdateSiteSurfaceModuleMutation'; +export * from './useDeleteSiteSurfaceModuleMutation'; +export * from './useCreateStorageLogModuleMutation'; +export * from './useUpdateStorageLogModuleMutation'; +export * from './useDeleteStorageLogModuleMutation'; +export * from './useCreateStorageModuleMutation'; +export * from './useUpdateStorageModuleMutation'; +export * from './useDeleteStorageModuleMutation'; +export * from './useCreateTransferLogModuleMutation'; +export * from './useUpdateTransferLogModuleMutation'; +export * from './useDeleteTransferLogModuleMutation'; +export * from './useCreateUserAuthModuleMutation'; +export * from './useUpdateUserAuthModuleMutation'; +export * from './useDeleteUserAuthModuleMutation'; +export * from './useCreateUserCredentialsModuleMutation'; +export * from './useUpdateUserCredentialsModuleMutation'; +export * from './useDeleteUserCredentialsModuleMutation'; +export * from './useCreateUserSettingsModuleMutation'; +export * from './useUpdateUserSettingsModuleMutation'; +export * from './useDeleteUserSettingsModuleMutation'; +export * from './useCreateUserStateModuleMutation'; +export * from './useUpdateUserStateModuleMutation'; +export * from './useDeleteUserStateModuleMutation'; +export * from './useCreateUsersModuleMutation'; +export * from './useUpdateUsersModuleMutation'; +export * from './useDeleteUsersModuleMutation'; +export * from './useCreateWebauthnAuthModuleMutation'; +export * from './useUpdateWebauthnAuthModuleMutation'; +export * from './useDeleteWebauthnAuthModuleMutation'; +export * from './useCreateWebauthnCredentialsModuleMutation'; +export * from './useUpdateWebauthnCredentialsModuleMutation'; +export * from './useDeleteWebauthnCredentialsModuleMutation'; +export * from './useCreateWebhookModuleMutation'; +export * from './useUpdateWebhookModuleMutation'; +export * from './useDeleteWebhookModuleMutation'; +export * from './useConstructBlueprintMutation'; +export * from './useCopyTemplateToBlueprintMutation'; +export * from './useProvisionBucketMutation'; +export * from './useProvisionCheckConstraintMutation'; +export * from './useProvisionFullTextSearchMutation'; +export * from './useProvisionIndexMutation'; +export * from './useProvisionRelationMutation'; +export * from './useProvisionSpatialRelationMutation'; +export * from './useProvisionTableMutation'; +export * from './useProvisionUniqueConstraintMutation'; diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useConstructBlueprintMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useConstructBlueprintMutation.ts index 865f0bc8ca..78ecd89586 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useConstructBlueprintMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useConstructBlueprintMutation.ts @@ -4,39 +4,55 @@ * 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 { ConstructBlueprintVariables } from "../../orm/mutation"; -import type { ConstructBlueprintPayloadSelect, ConstructBlueprintPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ConstructBlueprintVariables } from "../../orm/mutation"; -export type { ConstructBlueprintPayloadSelect } from "../../orm/input-types"; -export function useConstructBlueprintMutation(params: { - selection: ({ - fields: S & ConstructBlueprintPayloadSelect; - } & HookStrictSelect, ConstructBlueprintPayloadSelect>); -} & Omit | null; -}, Error, ConstructBlueprintVariables>, "mutationFn">): UseMutationResult<{ - constructBlueprint: InferSelectResult | null; -}, Error, ConstructBlueprintVariables> { +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 { ConstructBlueprintVariables } from '../../orm/mutation'; +import type { + ConstructBlueprintPayloadSelect, + ConstructBlueprintPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ConstructBlueprintVariables } from '../../orm/mutation'; +export type { ConstructBlueprintPayloadSelect } from '../../orm/input-types'; +export function useConstructBlueprintMutation( + params: { + selection: { + fields: S & ConstructBlueprintPayloadSelect; + } & HookStrictSelect, ConstructBlueprintPayloadSelect>; + } & Omit< + UseMutationOptions< + { + constructBlueprint: InferSelectResult | null; + }, + Error, + ConstructBlueprintVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + constructBlueprint: InferSelectResult | null; + }, + Error, + ConstructBlueprintVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.constructBlueprint(), - mutationFn: (variables: ConstructBlueprintVariables) => getClient().mutation.constructBlueprint(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ConstructBlueprintVariables) => + getClient() + .mutation.constructBlueprint(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCopyTemplateToBlueprintMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCopyTemplateToBlueprintMutation.ts index 7a3cfeaf4c..e8e5eda1f7 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCopyTemplateToBlueprintMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCopyTemplateToBlueprintMutation.ts @@ -4,39 +4,55 @@ * 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 { CopyTemplateToBlueprintVariables } from "../../orm/mutation"; -import type { CopyTemplateToBlueprintPayloadSelect, CopyTemplateToBlueprintPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { CopyTemplateToBlueprintVariables } from "../../orm/mutation"; -export type { CopyTemplateToBlueprintPayloadSelect } from "../../orm/input-types"; -export function useCopyTemplateToBlueprintMutation(params: { - selection: ({ - fields: S & CopyTemplateToBlueprintPayloadSelect; - } & HookStrictSelect, CopyTemplateToBlueprintPayloadSelect>); -} & Omit | null; -}, Error, CopyTemplateToBlueprintVariables>, "mutationFn">): UseMutationResult<{ - copyTemplateToBlueprint: InferSelectResult | null; -}, Error, CopyTemplateToBlueprintVariables> { +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 { CopyTemplateToBlueprintVariables } from '../../orm/mutation'; +import type { + CopyTemplateToBlueprintPayloadSelect, + CopyTemplateToBlueprintPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { CopyTemplateToBlueprintVariables } from '../../orm/mutation'; +export type { CopyTemplateToBlueprintPayloadSelect } from '../../orm/input-types'; +export function useCopyTemplateToBlueprintMutation( + params: { + selection: { + fields: S & CopyTemplateToBlueprintPayloadSelect; + } & HookStrictSelect, CopyTemplateToBlueprintPayloadSelect>; + } & Omit< + UseMutationOptions< + { + copyTemplateToBlueprint: InferSelectResult | null; + }, + Error, + CopyTemplateToBlueprintVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + copyTemplateToBlueprint: InferSelectResult | null; + }, + Error, + CopyTemplateToBlueprintVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.copyTemplateToBlueprint(), - mutationFn: (variables: CopyTemplateToBlueprintVariables) => getClient().mutation.copyTemplateToBlueprint(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: CopyTemplateToBlueprintVariables) => + getClient() + .mutation.copyTemplateToBlueprint(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateAgentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateAgentModuleMutation.ts index 6ce5299d37..cb22a8d20a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateAgentModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateAgentModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { agentModuleKeys } from "../query-keys"; -import { agentModuleMutationKeys } from "../mutation-keys"; -import type { AgentModuleSelect, AgentModuleWithRelations, CreateAgentModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentModuleSelect, AgentModuleWithRelations, CreateAgentModuleInput } from "../../orm/input-types"; +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 { agentModuleKeys } from '../query-keys'; +import { agentModuleMutationKeys } from '../mutation-keys'; +import type { + AgentModuleSelect, + AgentModuleWithRelations, + CreateAgentModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentModuleSelect, + AgentModuleWithRelations, + CreateAgentModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a AgentModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAgentModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAgentModuleMutation(params: { - selection: ({ - fields: S & AgentModuleSelect; - } & HookStrictSelect, AgentModuleSelect>); -} & Omit; - }; -}, Error, CreateAgentModuleInput["agentModule"]>, "mutationFn">): UseMutationResult<{ - createAgentModule: { - agentModule: InferSelectResult; - }; -}, Error, CreateAgentModuleInput["agentModule"]>; -export function useCreateAgentModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAgentModuleMutation( + params: { + selection: { + fields: S & AgentModuleSelect; + } & HookStrictSelect, AgentModuleSelect>; + } & Omit< + UseMutationOptions< + { + createAgentModule: { + agentModule: InferSelectResult; + }; + }, + Error, + CreateAgentModuleInput['agentModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAgentModule: { + agentModule: InferSelectResult; + }; + }, + Error, + CreateAgentModuleInput['agentModule'] +>; +export function useCreateAgentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentModuleMutationKeys.create(), - mutationFn: (data: CreateAgentModuleInput["agentModule"]) => getClient().agentModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAgentModuleInput['agentModule']) => + getClient() + .agentModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: agentModuleKeys.lists() + queryKey: agentModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateApiSurfaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateApiSurfaceModuleMutation.ts index cb4f224166..2ab626bc21 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateApiSurfaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateApiSurfaceModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { apiSurfaceModuleKeys } from "../query-keys"; -import { apiSurfaceModuleMutationKeys } from "../mutation-keys"; -import type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations, CreateApiSurfaceModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations, CreateApiSurfaceModuleInput } from "../../orm/input-types"; +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 { apiSurfaceModuleKeys } from '../query-keys'; +import { apiSurfaceModuleMutationKeys } from '../mutation-keys'; +import type { + ApiSurfaceModuleSelect, + ApiSurfaceModuleWithRelations, + CreateApiSurfaceModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ApiSurfaceModuleSelect, + ApiSurfaceModuleWithRelations, + CreateApiSurfaceModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ApiSurfaceModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateApiSurfaceModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateApiSurfaceModuleMutation(params: { - selection: ({ - fields: S & ApiSurfaceModuleSelect; - } & HookStrictSelect, ApiSurfaceModuleSelect>); -} & Omit; - }; -}, Error, CreateApiSurfaceModuleInput["apiSurfaceModule"]>, "mutationFn">): UseMutationResult<{ - createApiSurfaceModule: { - apiSurfaceModule: InferSelectResult; - }; -}, Error, CreateApiSurfaceModuleInput["apiSurfaceModule"]>; -export function useCreateApiSurfaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateApiSurfaceModuleMutation( + params: { + selection: { + fields: S & ApiSurfaceModuleSelect; + } & HookStrictSelect, ApiSurfaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + createApiSurfaceModule: { + apiSurfaceModule: InferSelectResult; + }; + }, + Error, + CreateApiSurfaceModuleInput['apiSurfaceModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createApiSurfaceModule: { + apiSurfaceModule: InferSelectResult; + }; + }, + Error, + CreateApiSurfaceModuleInput['apiSurfaceModule'] +>; +export function useCreateApiSurfaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSurfaceModuleMutationKeys.create(), - mutationFn: (data: CreateApiSurfaceModuleInput["apiSurfaceModule"]) => getClient().apiSurfaceModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateApiSurfaceModuleInput['apiSurfaceModule']) => + getClient() + .apiSurfaceModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: apiSurfaceModuleKeys.lists() + queryKey: apiSurfaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateAppModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateAppModuleMutation.ts index 4099de44d5..90f8611d8a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateAppModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateAppModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { appModuleKeys } from "../query-keys"; -import { appModuleMutationKeys } from "../mutation-keys"; -import type { AppModuleSelect, AppModuleWithRelations, CreateAppModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppModuleSelect, AppModuleWithRelations, CreateAppModuleInput } from "../../orm/input-types"; +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 { appModuleKeys } from '../query-keys'; +import { appModuleMutationKeys } from '../mutation-keys'; +import type { + AppModuleSelect, + AppModuleWithRelations, + CreateAppModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppModuleSelect, + AppModuleWithRelations, + CreateAppModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a AppModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppModuleMutation(params: { - selection: ({ - fields: S & AppModuleSelect; - } & HookStrictSelect, AppModuleSelect>); -} & Omit; - }; -}, Error, CreateAppModuleInput["appModule"]>, "mutationFn">): UseMutationResult<{ - createAppModule: { - appModule: InferSelectResult; - }; -}, Error, CreateAppModuleInput["appModule"]>; -export function useCreateAppModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppModuleMutation( + params: { + selection: { + fields: S & AppModuleSelect; + } & HookStrictSelect, AppModuleSelect>; + } & Omit< + UseMutationOptions< + { + createAppModule: { + appModule: InferSelectResult; + }; + }, + Error, + CreateAppModuleInput['appModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppModule: { + appModule: InferSelectResult; + }; + }, + Error, + CreateAppModuleInput['appModule'] +>; +export function useCreateAppModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appModuleMutationKeys.create(), - mutationFn: (data: CreateAppModuleInput["appModule"]) => getClient().appModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppModuleInput['appModule']) => + getClient() + .appModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appModuleKeys.lists() + queryKey: appModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBillingModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBillingModuleMutation.ts index 4e89c42c00..1b8f496ff2 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBillingModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBillingModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { billingModuleKeys } from "../query-keys"; -import { billingModuleMutationKeys } from "../mutation-keys"; -import type { BillingModuleSelect, BillingModuleWithRelations, CreateBillingModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingModuleSelect, BillingModuleWithRelations, CreateBillingModuleInput } from "../../orm/input-types"; +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 { billingModuleKeys } from '../query-keys'; +import { billingModuleMutationKeys } from '../mutation-keys'; +import type { + BillingModuleSelect, + BillingModuleWithRelations, + CreateBillingModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BillingModuleSelect, + BillingModuleWithRelations, + CreateBillingModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a BillingModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateBillingModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateBillingModuleMutation(params: { - selection: ({ - fields: S & BillingModuleSelect; - } & HookStrictSelect, BillingModuleSelect>); -} & Omit; - }; -}, Error, CreateBillingModuleInput["billingModule"]>, "mutationFn">): UseMutationResult<{ - createBillingModule: { - billingModule: InferSelectResult; - }; -}, Error, CreateBillingModuleInput["billingModule"]>; -export function useCreateBillingModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateBillingModuleMutation( + params: { + selection: { + fields: S & BillingModuleSelect; + } & HookStrictSelect, BillingModuleSelect>; + } & Omit< + UseMutationOptions< + { + createBillingModule: { + billingModule: InferSelectResult; + }; + }, + Error, + CreateBillingModuleInput['billingModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createBillingModule: { + billingModule: InferSelectResult; + }; + }, + Error, + CreateBillingModuleInput['billingModule'] +>; +export function useCreateBillingModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: billingModuleMutationKeys.create(), - mutationFn: (data: CreateBillingModuleInput["billingModule"]) => getClient().billingModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateBillingModuleInput['billingModule']) => + getClient() + .billingModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: billingModuleKeys.lists() + queryKey: billingModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBillingProviderModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBillingProviderModuleMutation.ts index 1232cacf40..d90cc2464f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBillingProviderModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBillingProviderModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { billingProviderModuleKeys } from "../query-keys"; -import { billingProviderModuleMutationKeys } from "../mutation-keys"; -import type { BillingProviderModuleSelect, BillingProviderModuleWithRelations, CreateBillingProviderModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingProviderModuleSelect, BillingProviderModuleWithRelations, CreateBillingProviderModuleInput } from "../../orm/input-types"; +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 { billingProviderModuleKeys } from '../query-keys'; +import { billingProviderModuleMutationKeys } from '../mutation-keys'; +import type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, + CreateBillingProviderModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, + CreateBillingProviderModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a BillingProviderModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateBillingProviderModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateBillingProviderModuleMutation(params: { - selection: ({ - fields: S & BillingProviderModuleSelect; - } & HookStrictSelect, BillingProviderModuleSelect>); -} & Omit; - }; -}, Error, CreateBillingProviderModuleInput["billingProviderModule"]>, "mutationFn">): UseMutationResult<{ - createBillingProviderModule: { - billingProviderModule: InferSelectResult; - }; -}, Error, CreateBillingProviderModuleInput["billingProviderModule"]>; -export function useCreateBillingProviderModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateBillingProviderModuleMutation( + params: { + selection: { + fields: S & BillingProviderModuleSelect; + } & HookStrictSelect, BillingProviderModuleSelect>; + } & Omit< + UseMutationOptions< + { + createBillingProviderModule: { + billingProviderModule: InferSelectResult; + }; + }, + Error, + CreateBillingProviderModuleInput['billingProviderModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createBillingProviderModule: { + billingProviderModule: InferSelectResult; + }; + }, + Error, + CreateBillingProviderModuleInput['billingProviderModule'] +>; +export function useCreateBillingProviderModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: billingProviderModuleMutationKeys.create(), - mutationFn: (data: CreateBillingProviderModuleInput["billingProviderModule"]) => getClient().billingProviderModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateBillingProviderModuleInput['billingProviderModule']) => + getClient() + .billingProviderModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: billingProviderModuleKeys.lists() + queryKey: billingProviderModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintConstructionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintConstructionMutation.ts index c0934b36f4..db049e428e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintConstructionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintConstructionMutation.ts @@ -4,62 +4,88 @@ * 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 { blueprintConstructionKeys } from "../query-keys"; -import { blueprintConstructionMutationKeys } from "../mutation-keys"; -import type { BlueprintConstructionSelect, BlueprintConstructionWithRelations, CreateBlueprintConstructionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintConstructionSelect, BlueprintConstructionWithRelations, CreateBlueprintConstructionInput } from "../../orm/input-types"; +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 { blueprintConstructionKeys } from '../query-keys'; +import { blueprintConstructionMutationKeys } from '../mutation-keys'; +import type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, + CreateBlueprintConstructionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, + CreateBlueprintConstructionInput, +} from '../../orm/input-types'; /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateBlueprintConstructionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateBlueprintConstructionMutation(params: { - selection: ({ - fields: S & BlueprintConstructionSelect; - } & HookStrictSelect, BlueprintConstructionSelect>); -} & Omit; - }; -}, Error, CreateBlueprintConstructionInput["blueprintConstruction"]>, "mutationFn">): UseMutationResult<{ - createBlueprintConstruction: { - blueprintConstruction: InferSelectResult; - }; -}, Error, CreateBlueprintConstructionInput["blueprintConstruction"]>; -export function useCreateBlueprintConstructionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateBlueprintConstructionMutation( + params: { + selection: { + fields: S & BlueprintConstructionSelect; + } & HookStrictSelect, BlueprintConstructionSelect>; + } & Omit< + UseMutationOptions< + { + createBlueprintConstruction: { + blueprintConstruction: InferSelectResult; + }; + }, + Error, + CreateBlueprintConstructionInput['blueprintConstruction'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createBlueprintConstruction: { + blueprintConstruction: InferSelectResult; + }; + }, + Error, + CreateBlueprintConstructionInput['blueprintConstruction'] +>; +export function useCreateBlueprintConstructionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintConstructionMutationKeys.create(), - mutationFn: (data: CreateBlueprintConstructionInput["blueprintConstruction"]) => getClient().blueprintConstruction.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateBlueprintConstructionInput['blueprintConstruction']) => + getClient() + .blueprintConstruction.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: blueprintConstructionKeys.lists() + queryKey: blueprintConstructionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintMutation.ts index 30a77f4cd6..b4fc51cec7 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintMutation.ts @@ -4,62 +4,85 @@ * 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 { blueprintKeys } from "../query-keys"; -import { blueprintMutationKeys } from "../mutation-keys"; -import type { BlueprintSelect, BlueprintWithRelations, CreateBlueprintInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintSelect, BlueprintWithRelations, CreateBlueprintInput } from "../../orm/input-types"; +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 { blueprintKeys } from '../query-keys'; +import { blueprintMutationKeys } from '../mutation-keys'; +import type { + BlueprintSelect, + BlueprintWithRelations, + CreateBlueprintInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintSelect, + BlueprintWithRelations, + CreateBlueprintInput, +} from '../../orm/input-types'; /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateBlueprintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateBlueprintMutation(params: { - selection: ({ - fields: S & BlueprintSelect; - } & HookStrictSelect, BlueprintSelect>); -} & Omit; - }; -}, Error, CreateBlueprintInput["blueprint"]>, "mutationFn">): UseMutationResult<{ - createBlueprint: { - blueprint: InferSelectResult; - }; -}, Error, CreateBlueprintInput["blueprint"]>; -export function useCreateBlueprintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateBlueprintMutation( + params: { + selection: { + fields: S & BlueprintSelect; + } & HookStrictSelect, BlueprintSelect>; + } & Omit< + UseMutationOptions< + { + createBlueprint: { + blueprint: InferSelectResult; + }; + }, + Error, + CreateBlueprintInput['blueprint'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createBlueprint: { + blueprint: InferSelectResult; + }; + }, + Error, + CreateBlueprintInput['blueprint'] +>; +export function useCreateBlueprintMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintMutationKeys.create(), - mutationFn: (data: CreateBlueprintInput["blueprint"]) => getClient().blueprint.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateBlueprintInput['blueprint']) => + getClient() + .blueprint.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: blueprintKeys.lists() + queryKey: blueprintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintTemplateMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintTemplateMutation.ts index 2ebac04042..5c43a004be 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintTemplateMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateBlueprintTemplateMutation.ts @@ -4,62 +4,88 @@ * 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 { blueprintTemplateKeys } from "../query-keys"; -import { blueprintTemplateMutationKeys } from "../mutation-keys"; -import type { BlueprintTemplateSelect, BlueprintTemplateWithRelations, CreateBlueprintTemplateInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintTemplateSelect, BlueprintTemplateWithRelations, CreateBlueprintTemplateInput } from "../../orm/input-types"; +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 { blueprintTemplateKeys } from '../query-keys'; +import { blueprintTemplateMutationKeys } from '../mutation-keys'; +import type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, + CreateBlueprintTemplateInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, + CreateBlueprintTemplateInput, +} from '../../orm/input-types'; /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```tsx * const { mutate, isPending } = useCreateBlueprintTemplateMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateBlueprintTemplateMutation(params: { - selection: ({ - fields: S & BlueprintTemplateSelect; - } & HookStrictSelect, BlueprintTemplateSelect>); -} & Omit; - }; -}, Error, CreateBlueprintTemplateInput["blueprintTemplate"]>, "mutationFn">): UseMutationResult<{ - createBlueprintTemplate: { - blueprintTemplate: InferSelectResult; - }; -}, Error, CreateBlueprintTemplateInput["blueprintTemplate"]>; -export function useCreateBlueprintTemplateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateBlueprintTemplateMutation( + params: { + selection: { + fields: S & BlueprintTemplateSelect; + } & HookStrictSelect, BlueprintTemplateSelect>; + } & Omit< + UseMutationOptions< + { + createBlueprintTemplate: { + blueprintTemplate: InferSelectResult; + }; + }, + Error, + CreateBlueprintTemplateInput['blueprintTemplate'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createBlueprintTemplate: { + blueprintTemplate: InferSelectResult; + }; + }, + Error, + CreateBlueprintTemplateInput['blueprintTemplate'] +>; +export function useCreateBlueprintTemplateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintTemplateMutationKeys.create(), - mutationFn: (data: CreateBlueprintTemplateInput["blueprintTemplate"]) => getClient().blueprintTemplate.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateBlueprintTemplateInput['blueprintTemplate']) => + getClient() + .blueprintTemplate.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: blueprintTemplateKeys.lists() + queryKey: blueprintTemplateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateCatalogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateCatalogModuleMutation.ts index 0177b48fbe..d4c350fe1e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateCatalogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateCatalogModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { catalogModuleKeys } from "../query-keys"; -import { catalogModuleMutationKeys } from "../mutation-keys"; -import type { CatalogModuleSelect, CatalogModuleWithRelations, CreateCatalogModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CatalogModuleSelect, CatalogModuleWithRelations, CreateCatalogModuleInput } from "../../orm/input-types"; +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 { catalogModuleKeys } from '../query-keys'; +import { catalogModuleMutationKeys } from '../mutation-keys'; +import type { + CatalogModuleSelect, + CatalogModuleWithRelations, + CreateCatalogModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CatalogModuleSelect, + CatalogModuleWithRelations, + CreateCatalogModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a CatalogModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateCatalogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateCatalogModuleMutation(params: { - selection: ({ - fields: S & CatalogModuleSelect; - } & HookStrictSelect, CatalogModuleSelect>); -} & Omit; - }; -}, Error, CreateCatalogModuleInput["catalogModule"]>, "mutationFn">): UseMutationResult<{ - createCatalogModule: { - catalogModule: InferSelectResult; - }; -}, Error, CreateCatalogModuleInput["catalogModule"]>; -export function useCreateCatalogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateCatalogModuleMutation( + params: { + selection: { + fields: S & CatalogModuleSelect; + } & HookStrictSelect, CatalogModuleSelect>; + } & Omit< + UseMutationOptions< + { + createCatalogModule: { + catalogModule: InferSelectResult; + }; + }, + Error, + CreateCatalogModuleInput['catalogModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createCatalogModule: { + catalogModule: InferSelectResult; + }; + }, + Error, + CreateCatalogModuleInput['catalogModule'] +>; +export function useCreateCatalogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: catalogModuleMutationKeys.create(), - mutationFn: (data: CreateCatalogModuleInput["catalogModule"]) => getClient().catalogModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateCatalogModuleInput['catalogModule']) => + getClient() + .catalogModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: catalogModuleKeys.lists() + queryKey: catalogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateComputeLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateComputeLogModuleMutation.ts index 451b053eef..e22e941552 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateComputeLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateComputeLogModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { computeLogModuleKeys } from "../query-keys"; -import { computeLogModuleMutationKeys } from "../mutation-keys"; -import type { ComputeLogModuleSelect, ComputeLogModuleWithRelations, CreateComputeLogModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ComputeLogModuleSelect, ComputeLogModuleWithRelations, CreateComputeLogModuleInput } from "../../orm/input-types"; +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 { computeLogModuleKeys } from '../query-keys'; +import { computeLogModuleMutationKeys } from '../mutation-keys'; +import type { + ComputeLogModuleSelect, + ComputeLogModuleWithRelations, + CreateComputeLogModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ComputeLogModuleSelect, + ComputeLogModuleWithRelations, + CreateComputeLogModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ComputeLogModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateComputeLogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateComputeLogModuleMutation(params: { - selection: ({ - fields: S & ComputeLogModuleSelect; - } & HookStrictSelect, ComputeLogModuleSelect>); -} & Omit; - }; -}, Error, CreateComputeLogModuleInput["computeLogModule"]>, "mutationFn">): UseMutationResult<{ - createComputeLogModule: { - computeLogModule: InferSelectResult; - }; -}, Error, CreateComputeLogModuleInput["computeLogModule"]>; -export function useCreateComputeLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateComputeLogModuleMutation( + params: { + selection: { + fields: S & ComputeLogModuleSelect; + } & HookStrictSelect, ComputeLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + createComputeLogModule: { + computeLogModule: InferSelectResult; + }; + }, + Error, + CreateComputeLogModuleInput['computeLogModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createComputeLogModule: { + computeLogModule: InferSelectResult; + }; + }, + Error, + CreateComputeLogModuleInput['computeLogModule'] +>; +export function useCreateComputeLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: computeLogModuleMutationKeys.create(), - mutationFn: (data: CreateComputeLogModuleInput["computeLogModule"]) => getClient().computeLogModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateComputeLogModuleInput['computeLogModule']) => + getClient() + .computeLogModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: computeLogModuleKeys.lists() + queryKey: computeLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateConfigSecretsUserModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateConfigSecretsUserModuleMutation.ts index 07274b615f..e3765bf61b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateConfigSecretsUserModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateConfigSecretsUserModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { configSecretsUserModuleKeys } from "../query-keys"; -import { configSecretsUserModuleMutationKeys } from "../mutation-keys"; -import type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations, CreateConfigSecretsUserModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations, CreateConfigSecretsUserModuleInput } from "../../orm/input-types"; +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 { configSecretsUserModuleKeys } from '../query-keys'; +import { configSecretsUserModuleMutationKeys } from '../mutation-keys'; +import type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, + CreateConfigSecretsUserModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, + CreateConfigSecretsUserModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ConfigSecretsUserModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateConfigSecretsUserModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateConfigSecretsUserModuleMutation(params: { - selection: ({ - fields: S & ConfigSecretsUserModuleSelect; - } & HookStrictSelect, ConfigSecretsUserModuleSelect>); -} & Omit; - }; -}, Error, CreateConfigSecretsUserModuleInput["configSecretsUserModule"]>, "mutationFn">): UseMutationResult<{ - createConfigSecretsUserModule: { - configSecretsUserModule: InferSelectResult; - }; -}, Error, CreateConfigSecretsUserModuleInput["configSecretsUserModule"]>; -export function useCreateConfigSecretsUserModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateConfigSecretsUserModuleMutation( + params: { + selection: { + fields: S & ConfigSecretsUserModuleSelect; + } & HookStrictSelect, ConfigSecretsUserModuleSelect>; + } & Omit< + UseMutationOptions< + { + createConfigSecretsUserModule: { + configSecretsUserModule: InferSelectResult; + }; + }, + Error, + CreateConfigSecretsUserModuleInput['configSecretsUserModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createConfigSecretsUserModule: { + configSecretsUserModule: InferSelectResult; + }; + }, + Error, + CreateConfigSecretsUserModuleInput['configSecretsUserModule'] +>; +export function useCreateConfigSecretsUserModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: configSecretsUserModuleMutationKeys.create(), - mutationFn: (data: CreateConfigSecretsUserModuleInput["configSecretsUserModule"]) => getClient().configSecretsUserModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateConfigSecretsUserModuleInput['configSecretsUserModule']) => + getClient() + .configSecretsUserModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: configSecretsUserModuleKeys.lists() + queryKey: configSecretsUserModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateConnectedAccountsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateConnectedAccountsModuleMutation.ts index feaeed8596..d87d4cfc01 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateConnectedAccountsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateConnectedAccountsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { connectedAccountsModuleKeys } from "../query-keys"; -import { connectedAccountsModuleMutationKeys } from "../mutation-keys"; -import type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations, CreateConnectedAccountsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations, CreateConnectedAccountsModuleInput } from "../../orm/input-types"; +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 { connectedAccountsModuleKeys } from '../query-keys'; +import { connectedAccountsModuleMutationKeys } from '../mutation-keys'; +import type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, + CreateConnectedAccountsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, + CreateConnectedAccountsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ConnectedAccountsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateConnectedAccountsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateConnectedAccountsModuleMutation(params: { - selection: ({ - fields: S & ConnectedAccountsModuleSelect; - } & HookStrictSelect, ConnectedAccountsModuleSelect>); -} & Omit; - }; -}, Error, CreateConnectedAccountsModuleInput["connectedAccountsModule"]>, "mutationFn">): UseMutationResult<{ - createConnectedAccountsModule: { - connectedAccountsModule: InferSelectResult; - }; -}, Error, CreateConnectedAccountsModuleInput["connectedAccountsModule"]>; -export function useCreateConnectedAccountsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateConnectedAccountsModuleMutation( + params: { + selection: { + fields: S & ConnectedAccountsModuleSelect; + } & HookStrictSelect, ConnectedAccountsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createConnectedAccountsModule: { + connectedAccountsModule: InferSelectResult; + }; + }, + Error, + CreateConnectedAccountsModuleInput['connectedAccountsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createConnectedAccountsModule: { + connectedAccountsModule: InferSelectResult; + }; + }, + Error, + CreateConnectedAccountsModuleInput['connectedAccountsModule'] +>; +export function useCreateConnectedAccountsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: connectedAccountsModuleMutationKeys.create(), - mutationFn: (data: CreateConnectedAccountsModuleInput["connectedAccountsModule"]) => getClient().connectedAccountsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateConnectedAccountsModuleInput['connectedAccountsModule']) => + getClient() + .connectedAccountsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: connectedAccountsModuleKeys.lists() + queryKey: connectedAccountsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateCryptoAddressesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateCryptoAddressesModuleMutation.ts index c34950b0ec..f1a5c8c813 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateCryptoAddressesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateCryptoAddressesModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { cryptoAddressesModuleKeys } from "../query-keys"; -import { cryptoAddressesModuleMutationKeys } from "../mutation-keys"; -import type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations, CreateCryptoAddressesModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations, CreateCryptoAddressesModuleInput } from "../../orm/input-types"; +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 { cryptoAddressesModuleKeys } from '../query-keys'; +import { cryptoAddressesModuleMutationKeys } from '../mutation-keys'; +import type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, + CreateCryptoAddressesModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, + CreateCryptoAddressesModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a CryptoAddressesModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateCryptoAddressesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateCryptoAddressesModuleMutation(params: { - selection: ({ - fields: S & CryptoAddressesModuleSelect; - } & HookStrictSelect, CryptoAddressesModuleSelect>); -} & Omit; - }; -}, Error, CreateCryptoAddressesModuleInput["cryptoAddressesModule"]>, "mutationFn">): UseMutationResult<{ - createCryptoAddressesModule: { - cryptoAddressesModule: InferSelectResult; - }; -}, Error, CreateCryptoAddressesModuleInput["cryptoAddressesModule"]>; -export function useCreateCryptoAddressesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateCryptoAddressesModuleMutation( + params: { + selection: { + fields: S & CryptoAddressesModuleSelect; + } & HookStrictSelect, CryptoAddressesModuleSelect>; + } & Omit< + UseMutationOptions< + { + createCryptoAddressesModule: { + cryptoAddressesModule: InferSelectResult; + }; + }, + Error, + CreateCryptoAddressesModuleInput['cryptoAddressesModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createCryptoAddressesModule: { + cryptoAddressesModule: InferSelectResult; + }; + }, + Error, + CreateCryptoAddressesModuleInput['cryptoAddressesModule'] +>; +export function useCreateCryptoAddressesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAddressesModuleMutationKeys.create(), - mutationFn: (data: CreateCryptoAddressesModuleInput["cryptoAddressesModule"]) => getClient().cryptoAddressesModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateCryptoAddressesModuleInput['cryptoAddressesModule']) => + getClient() + .cryptoAddressesModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: cryptoAddressesModuleKeys.lists() + queryKey: cryptoAddressesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateCryptoAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateCryptoAuthModuleMutation.ts index 4e7abed0a2..0643272664 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateCryptoAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateCryptoAuthModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { cryptoAuthModuleKeys } from "../query-keys"; -import { cryptoAuthModuleMutationKeys } from "../mutation-keys"; -import type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations, CreateCryptoAuthModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations, CreateCryptoAuthModuleInput } from "../../orm/input-types"; +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 { cryptoAuthModuleKeys } from '../query-keys'; +import { cryptoAuthModuleMutationKeys } from '../mutation-keys'; +import type { + CryptoAuthModuleSelect, + CryptoAuthModuleWithRelations, + CreateCryptoAuthModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CryptoAuthModuleSelect, + CryptoAuthModuleWithRelations, + CreateCryptoAuthModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a CryptoAuthModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateCryptoAuthModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateCryptoAuthModuleMutation(params: { - selection: ({ - fields: S & CryptoAuthModuleSelect; - } & HookStrictSelect, CryptoAuthModuleSelect>); -} & Omit; - }; -}, Error, CreateCryptoAuthModuleInput["cryptoAuthModule"]>, "mutationFn">): UseMutationResult<{ - createCryptoAuthModule: { - cryptoAuthModule: InferSelectResult; - }; -}, Error, CreateCryptoAuthModuleInput["cryptoAuthModule"]>; -export function useCreateCryptoAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateCryptoAuthModuleMutation( + params: { + selection: { + fields: S & CryptoAuthModuleSelect; + } & HookStrictSelect, CryptoAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + createCryptoAuthModule: { + cryptoAuthModule: InferSelectResult; + }; + }, + Error, + CreateCryptoAuthModuleInput['cryptoAuthModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createCryptoAuthModule: { + cryptoAuthModule: InferSelectResult; + }; + }, + Error, + CreateCryptoAuthModuleInput['cryptoAuthModule'] +>; +export function useCreateCryptoAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAuthModuleMutationKeys.create(), - mutationFn: (data: CreateCryptoAuthModuleInput["cryptoAuthModule"]) => getClient().cryptoAuthModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateCryptoAuthModuleInput['cryptoAuthModule']) => + getClient() + .cryptoAuthModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: cryptoAuthModuleKeys.lists() + queryKey: cryptoAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDatabaseProvisionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDatabaseProvisionModuleMutation.ts index 8ee91d7755..97dd6672ac 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDatabaseProvisionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDatabaseProvisionModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { databaseProvisionModuleKeys } from "../query-keys"; -import { databaseProvisionModuleMutationKeys } from "../mutation-keys"; -import type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations, CreateDatabaseProvisionModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations, CreateDatabaseProvisionModuleInput } from "../../orm/input-types"; +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 { databaseProvisionModuleKeys } from '../query-keys'; +import { databaseProvisionModuleMutationKeys } from '../mutation-keys'; +import type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, + CreateDatabaseProvisionModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, + CreateDatabaseProvisionModuleInput, +} from '../../orm/input-types'; /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDatabaseProvisionModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDatabaseProvisionModuleMutation(params: { - selection: ({ - fields: S & DatabaseProvisionModuleSelect; - } & HookStrictSelect, DatabaseProvisionModuleSelect>); -} & Omit; - }; -}, Error, CreateDatabaseProvisionModuleInput["databaseProvisionModule"]>, "mutationFn">): UseMutationResult<{ - createDatabaseProvisionModule: { - databaseProvisionModule: InferSelectResult; - }; -}, Error, CreateDatabaseProvisionModuleInput["databaseProvisionModule"]>; -export function useCreateDatabaseProvisionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDatabaseProvisionModuleMutation( + params: { + selection: { + fields: S & DatabaseProvisionModuleSelect; + } & HookStrictSelect, DatabaseProvisionModuleSelect>; + } & Omit< + UseMutationOptions< + { + createDatabaseProvisionModule: { + databaseProvisionModule: InferSelectResult; + }; + }, + Error, + CreateDatabaseProvisionModuleInput['databaseProvisionModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDatabaseProvisionModule: { + databaseProvisionModule: InferSelectResult; + }; + }, + Error, + CreateDatabaseProvisionModuleInput['databaseProvisionModule'] +>; +export function useCreateDatabaseProvisionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseProvisionModuleMutationKeys.create(), - mutationFn: (data: CreateDatabaseProvisionModuleInput["databaseProvisionModule"]) => getClient().databaseProvisionModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDatabaseProvisionModuleInput['databaseProvisionModule']) => + getClient() + .databaseProvisionModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.lists() + queryKey: databaseProvisionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDatabaseSettingsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDatabaseSettingsModuleMutation.ts index 560799a9d5..0da02ced42 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDatabaseSettingsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDatabaseSettingsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { databaseSettingsModuleKeys } from "../query-keys"; -import { databaseSettingsModuleMutationKeys } from "../mutation-keys"; -import type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations, CreateDatabaseSettingsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations, CreateDatabaseSettingsModuleInput } from "../../orm/input-types"; +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 { databaseSettingsModuleKeys } from '../query-keys'; +import { databaseSettingsModuleMutationKeys } from '../mutation-keys'; +import type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, + CreateDatabaseSettingsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, + CreateDatabaseSettingsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DatabaseSettingsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDatabaseSettingsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDatabaseSettingsModuleMutation(params: { - selection: ({ - fields: S & DatabaseSettingsModuleSelect; - } & HookStrictSelect, DatabaseSettingsModuleSelect>); -} & Omit; - }; -}, Error, CreateDatabaseSettingsModuleInput["databaseSettingsModule"]>, "mutationFn">): UseMutationResult<{ - createDatabaseSettingsModule: { - databaseSettingsModule: InferSelectResult; - }; -}, Error, CreateDatabaseSettingsModuleInput["databaseSettingsModule"]>; -export function useCreateDatabaseSettingsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDatabaseSettingsModuleMutation( + params: { + selection: { + fields: S & DatabaseSettingsModuleSelect; + } & HookStrictSelect, DatabaseSettingsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createDatabaseSettingsModule: { + databaseSettingsModule: InferSelectResult; + }; + }, + Error, + CreateDatabaseSettingsModuleInput['databaseSettingsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDatabaseSettingsModule: { + databaseSettingsModule: InferSelectResult; + }; + }, + Error, + CreateDatabaseSettingsModuleInput['databaseSettingsModule'] +>; +export function useCreateDatabaseSettingsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseSettingsModuleMutationKeys.create(), - mutationFn: (data: CreateDatabaseSettingsModuleInput["databaseSettingsModule"]) => getClient().databaseSettingsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDatabaseSettingsModuleInput['databaseSettingsModule']) => + getClient() + .databaseSettingsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: databaseSettingsModuleKeys.lists() + queryKey: databaseSettingsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPoolConfigMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPoolConfigMutation.ts index 28665b870f..3d60f4fab7 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPoolConfigMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPoolConfigMutation.ts @@ -4,62 +4,85 @@ * 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 { dbPoolConfigKeys } from "../query-keys"; -import { dbPoolConfigMutationKeys } from "../mutation-keys"; -import type { DbPoolConfigSelect, DbPoolConfigWithRelations, CreateDbPoolConfigInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolConfigSelect, DbPoolConfigWithRelations, CreateDbPoolConfigInput } from "../../orm/input-types"; +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 { dbPoolConfigKeys } from '../query-keys'; +import { dbPoolConfigMutationKeys } from '../mutation-keys'; +import type { + DbPoolConfigSelect, + DbPoolConfigWithRelations, + CreateDbPoolConfigInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DbPoolConfigSelect, + DbPoolConfigWithRelations, + CreateDbPoolConfigInput, +} from '../../orm/input-types'; /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDbPoolConfigMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDbPoolConfigMutation(params: { - selection: ({ - fields: S & DbPoolConfigSelect; - } & HookStrictSelect, DbPoolConfigSelect>); -} & Omit; - }; -}, Error, CreateDbPoolConfigInput["dbPoolConfig"]>, "mutationFn">): UseMutationResult<{ - createDbPoolConfig: { - dbPoolConfig: InferSelectResult; - }; -}, Error, CreateDbPoolConfigInput["dbPoolConfig"]>; -export function useCreateDbPoolConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDbPoolConfigMutation( + params: { + selection: { + fields: S & DbPoolConfigSelect; + } & HookStrictSelect, DbPoolConfigSelect>; + } & Omit< + UseMutationOptions< + { + createDbPoolConfig: { + dbPoolConfig: InferSelectResult; + }; + }, + Error, + CreateDbPoolConfigInput['dbPoolConfig'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDbPoolConfig: { + dbPoolConfig: InferSelectResult; + }; + }, + Error, + CreateDbPoolConfigInput['dbPoolConfig'] +>; +export function useCreateDbPoolConfigMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPoolConfigMutationKeys.create(), - mutationFn: (data: CreateDbPoolConfigInput["dbPoolConfig"]) => getClient().dbPoolConfig.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDbPoolConfigInput['dbPoolConfig']) => + getClient() + .dbPoolConfig.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: dbPoolConfigKeys.lists() + queryKey: dbPoolConfigKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPoolMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPoolMutation.ts index 5a9a961528..553e66f914 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPoolMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPoolMutation.ts @@ -4,62 +4,77 @@ * 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 { dbPoolKeys } from "../query-keys"; -import { dbPoolMutationKeys } from "../mutation-keys"; -import type { DbPoolSelect, DbPoolWithRelations, CreateDbPoolInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolSelect, DbPoolWithRelations, CreateDbPoolInput } from "../../orm/input-types"; +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 { dbPoolKeys } from '../query-keys'; +import { dbPoolMutationKeys } from '../mutation-keys'; +import type { DbPoolSelect, DbPoolWithRelations, CreateDbPoolInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPoolSelect, DbPoolWithRelations, CreateDbPoolInput } from '../../orm/input-types'; /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDbPoolMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDbPoolMutation(params: { - selection: ({ - fields: S & DbPoolSelect; - } & HookStrictSelect, DbPoolSelect>); -} & Omit; - }; -}, Error, CreateDbPoolInput["dbPool"]>, "mutationFn">): UseMutationResult<{ - createDbPool: { - dbPool: InferSelectResult; - }; -}, Error, CreateDbPoolInput["dbPool"]>; -export function useCreateDbPoolMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDbPoolMutation( + params: { + selection: { + fields: S & DbPoolSelect; + } & HookStrictSelect, DbPoolSelect>; + } & Omit< + UseMutationOptions< + { + createDbPool: { + dbPool: InferSelectResult; + }; + }, + Error, + CreateDbPoolInput['dbPool'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDbPool: { + dbPool: InferSelectResult; + }; + }, + Error, + CreateDbPoolInput['dbPool'] +>; +export function useCreateDbPoolMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPoolMutationKeys.create(), - mutationFn: (data: CreateDbPoolInput["dbPool"]) => getClient().dbPool.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDbPoolInput['dbPool']) => + getClient() + .dbPool.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: dbPoolKeys.lists() + queryKey: dbPoolKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPresetModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPresetModuleMutation.ts index 51b0fdc2cc..e3022719b5 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPresetModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbPresetModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { dbPresetModuleKeys } from "../query-keys"; -import { dbPresetModuleMutationKeys } from "../mutation-keys"; -import type { DbPresetModuleSelect, DbPresetModuleWithRelations, CreateDbPresetModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetModuleSelect, DbPresetModuleWithRelations, CreateDbPresetModuleInput } from "../../orm/input-types"; +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 { dbPresetModuleKeys } from '../query-keys'; +import { dbPresetModuleMutationKeys } from '../mutation-keys'; +import type { + DbPresetModuleSelect, + DbPresetModuleWithRelations, + CreateDbPresetModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DbPresetModuleSelect, + DbPresetModuleWithRelations, + CreateDbPresetModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DbPresetModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDbPresetModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDbPresetModuleMutation(params: { - selection: ({ - fields: S & DbPresetModuleSelect; - } & HookStrictSelect, DbPresetModuleSelect>); -} & Omit; - }; -}, Error, CreateDbPresetModuleInput["dbPresetModule"]>, "mutationFn">): UseMutationResult<{ - createDbPresetModule: { - dbPresetModule: InferSelectResult; - }; -}, Error, CreateDbPresetModuleInput["dbPresetModule"]>; -export function useCreateDbPresetModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDbPresetModuleMutation( + params: { + selection: { + fields: S & DbPresetModuleSelect; + } & HookStrictSelect, DbPresetModuleSelect>; + } & Omit< + UseMutationOptions< + { + createDbPresetModule: { + dbPresetModule: InferSelectResult; + }; + }, + Error, + CreateDbPresetModuleInput['dbPresetModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDbPresetModule: { + dbPresetModule: InferSelectResult; + }; + }, + Error, + CreateDbPresetModuleInput['dbPresetModule'] +>; +export function useCreateDbPresetModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetModuleMutationKeys.create(), - mutationFn: (data: CreateDbPresetModuleInput["dbPresetModule"]) => getClient().dbPresetModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDbPresetModuleInput['dbPresetModule']) => + getClient() + .dbPresetModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: dbPresetModuleKeys.lists() + queryKey: dbPresetModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbUsageModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbUsageModuleMutation.ts index fe79c9ff6f..afc3b6775e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbUsageModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDbUsageModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { dbUsageModuleKeys } from "../query-keys"; -import { dbUsageModuleMutationKeys } from "../mutation-keys"; -import type { DbUsageModuleSelect, DbUsageModuleWithRelations, CreateDbUsageModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbUsageModuleSelect, DbUsageModuleWithRelations, CreateDbUsageModuleInput } from "../../orm/input-types"; +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 { dbUsageModuleKeys } from '../query-keys'; +import { dbUsageModuleMutationKeys } from '../mutation-keys'; +import type { + DbUsageModuleSelect, + DbUsageModuleWithRelations, + CreateDbUsageModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DbUsageModuleSelect, + DbUsageModuleWithRelations, + CreateDbUsageModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DbUsageModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDbUsageModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDbUsageModuleMutation(params: { - selection: ({ - fields: S & DbUsageModuleSelect; - } & HookStrictSelect, DbUsageModuleSelect>); -} & Omit; - }; -}, Error, CreateDbUsageModuleInput["dbUsageModule"]>, "mutationFn">): UseMutationResult<{ - createDbUsageModule: { - dbUsageModule: InferSelectResult; - }; -}, Error, CreateDbUsageModuleInput["dbUsageModule"]>; -export function useCreateDbUsageModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDbUsageModuleMutation( + params: { + selection: { + fields: S & DbUsageModuleSelect; + } & HookStrictSelect, DbUsageModuleSelect>; + } & Omit< + UseMutationOptions< + { + createDbUsageModule: { + dbUsageModule: InferSelectResult; + }; + }, + Error, + CreateDbUsageModuleInput['dbUsageModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDbUsageModule: { + dbUsageModule: InferSelectResult; + }; + }, + Error, + CreateDbUsageModuleInput['dbUsageModule'] +>; +export function useCreateDbUsageModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbUsageModuleMutationKeys.create(), - mutationFn: (data: CreateDbUsageModuleInput["dbUsageModule"]) => getClient().dbUsageModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDbUsageModuleInput['dbUsageModule']) => + getClient() + .dbUsageModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: dbUsageModuleKeys.lists() + queryKey: dbUsageModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDefaultIdsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDefaultIdsModuleMutation.ts index b77cae58af..58a7c61125 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDefaultIdsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDefaultIdsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { defaultIdsModuleKeys } from "../query-keys"; -import { defaultIdsModuleMutationKeys } from "../mutation-keys"; -import type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations, CreateDefaultIdsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations, CreateDefaultIdsModuleInput } from "../../orm/input-types"; +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 { defaultIdsModuleKeys } from '../query-keys'; +import { defaultIdsModuleMutationKeys } from '../mutation-keys'; +import type { + DefaultIdsModuleSelect, + DefaultIdsModuleWithRelations, + CreateDefaultIdsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DefaultIdsModuleSelect, + DefaultIdsModuleWithRelations, + CreateDefaultIdsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DefaultIdsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDefaultIdsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDefaultIdsModuleMutation(params: { - selection: ({ - fields: S & DefaultIdsModuleSelect; - } & HookStrictSelect, DefaultIdsModuleSelect>); -} & Omit; - }; -}, Error, CreateDefaultIdsModuleInput["defaultIdsModule"]>, "mutationFn">): UseMutationResult<{ - createDefaultIdsModule: { - defaultIdsModule: InferSelectResult; - }; -}, Error, CreateDefaultIdsModuleInput["defaultIdsModule"]>; -export function useCreateDefaultIdsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDefaultIdsModuleMutation( + params: { + selection: { + fields: S & DefaultIdsModuleSelect; + } & HookStrictSelect, DefaultIdsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createDefaultIdsModule: { + defaultIdsModule: InferSelectResult; + }; + }, + Error, + CreateDefaultIdsModuleInput['defaultIdsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDefaultIdsModule: { + defaultIdsModule: InferSelectResult; + }; + }, + Error, + CreateDefaultIdsModuleInput['defaultIdsModule'] +>; +export function useCreateDefaultIdsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: defaultIdsModuleMutationKeys.create(), - mutationFn: (data: CreateDefaultIdsModuleInput["defaultIdsModule"]) => getClient().defaultIdsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDefaultIdsModuleInput['defaultIdsModule']) => + getClient() + .defaultIdsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: defaultIdsModuleKeys.lists() + queryKey: defaultIdsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDenormalizedTableFieldMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDenormalizedTableFieldMutation.ts index 5f77f85d68..2d2d8334b2 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDenormalizedTableFieldMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDenormalizedTableFieldMutation.ts @@ -4,62 +4,88 @@ * 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 { denormalizedTableFieldKeys } from "../query-keys"; -import { denormalizedTableFieldMutationKeys } from "../mutation-keys"; -import type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations, CreateDenormalizedTableFieldInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations, CreateDenormalizedTableFieldInput } from "../../orm/input-types"; +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 { denormalizedTableFieldKeys } from '../query-keys'; +import { denormalizedTableFieldMutationKeys } from '../mutation-keys'; +import type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, + CreateDenormalizedTableFieldInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, + CreateDenormalizedTableFieldInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DenormalizedTableField - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDenormalizedTableFieldMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDenormalizedTableFieldMutation(params: { - selection: ({ - fields: S & DenormalizedTableFieldSelect; - } & HookStrictSelect, DenormalizedTableFieldSelect>); -} & Omit; - }; -}, Error, CreateDenormalizedTableFieldInput["denormalizedTableField"]>, "mutationFn">): UseMutationResult<{ - createDenormalizedTableField: { - denormalizedTableField: InferSelectResult; - }; -}, Error, CreateDenormalizedTableFieldInput["denormalizedTableField"]>; -export function useCreateDenormalizedTableFieldMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDenormalizedTableFieldMutation( + params: { + selection: { + fields: S & DenormalizedTableFieldSelect; + } & HookStrictSelect, DenormalizedTableFieldSelect>; + } & Omit< + UseMutationOptions< + { + createDenormalizedTableField: { + denormalizedTableField: InferSelectResult; + }; + }, + Error, + CreateDenormalizedTableFieldInput['denormalizedTableField'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDenormalizedTableField: { + denormalizedTableField: InferSelectResult; + }; + }, + Error, + CreateDenormalizedTableFieldInput['denormalizedTableField'] +>; +export function useCreateDenormalizedTableFieldMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: denormalizedTableFieldMutationKeys.create(), - mutationFn: (data: CreateDenormalizedTableFieldInput["denormalizedTableField"]) => getClient().denormalizedTableField.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDenormalizedTableFieldInput['denormalizedTableField']) => + getClient() + .denormalizedTableField.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: denormalizedTableFieldKeys.lists() + queryKey: denormalizedTableFieldKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDevicesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDevicesModuleMutation.ts index eef0bd14c0..b78a874930 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDevicesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDevicesModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { devicesModuleKeys } from "../query-keys"; -import { devicesModuleMutationKeys } from "../mutation-keys"; -import type { DevicesModuleSelect, DevicesModuleWithRelations, CreateDevicesModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DevicesModuleSelect, DevicesModuleWithRelations, CreateDevicesModuleInput } from "../../orm/input-types"; +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 { devicesModuleKeys } from '../query-keys'; +import { devicesModuleMutationKeys } from '../mutation-keys'; +import type { + DevicesModuleSelect, + DevicesModuleWithRelations, + CreateDevicesModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DevicesModuleSelect, + DevicesModuleWithRelations, + CreateDevicesModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DevicesModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDevicesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDevicesModuleMutation(params: { - selection: ({ - fields: S & DevicesModuleSelect; - } & HookStrictSelect, DevicesModuleSelect>); -} & Omit; - }; -}, Error, CreateDevicesModuleInput["devicesModule"]>, "mutationFn">): UseMutationResult<{ - createDevicesModule: { - devicesModule: InferSelectResult; - }; -}, Error, CreateDevicesModuleInput["devicesModule"]>; -export function useCreateDevicesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDevicesModuleMutation( + params: { + selection: { + fields: S & DevicesModuleSelect; + } & HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseMutationOptions< + { + createDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + CreateDevicesModuleInput['devicesModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + CreateDevicesModuleInput['devicesModule'] +>; +export function useCreateDevicesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: devicesModuleMutationKeys.create(), - mutationFn: (data: CreateDevicesModuleInput["devicesModule"]) => getClient().devicesModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDevicesModuleInput['devicesModule']) => + getClient() + .devicesModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: devicesModuleKeys.lists() + queryKey: devicesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDomainModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDomainModuleMutation.ts index 9e95f60d7e..374bd40ee0 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateDomainModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateDomainModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { domainModuleKeys } from "../query-keys"; -import { domainModuleMutationKeys } from "../mutation-keys"; -import type { DomainModuleSelect, DomainModuleWithRelations, CreateDomainModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainModuleSelect, DomainModuleWithRelations, CreateDomainModuleInput } from "../../orm/input-types"; +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 { domainModuleKeys } from '../query-keys'; +import { domainModuleMutationKeys } from '../mutation-keys'; +import type { + DomainModuleSelect, + DomainModuleWithRelations, + CreateDomainModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DomainModuleSelect, + DomainModuleWithRelations, + CreateDomainModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a DomainModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateDomainModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateDomainModuleMutation(params: { - selection: ({ - fields: S & DomainModuleSelect; - } & HookStrictSelect, DomainModuleSelect>); -} & Omit; - }; -}, Error, CreateDomainModuleInput["domainModule"]>, "mutationFn">): UseMutationResult<{ - createDomainModule: { - domainModule: InferSelectResult; - }; -}, Error, CreateDomainModuleInput["domainModule"]>; -export function useCreateDomainModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateDomainModuleMutation( + params: { + selection: { + fields: S & DomainModuleSelect; + } & HookStrictSelect, DomainModuleSelect>; + } & Omit< + UseMutationOptions< + { + createDomainModule: { + domainModule: InferSelectResult; + }; + }, + Error, + CreateDomainModuleInput['domainModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createDomainModule: { + domainModule: InferSelectResult; + }; + }, + Error, + CreateDomainModuleInput['domainModule'] +>; +export function useCreateDomainModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainModuleMutationKeys.create(), - mutationFn: (data: CreateDomainModuleInput["domainModule"]) => getClient().domainModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateDomainModuleInput['domainModule']) => + getClient() + .domainModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: domainModuleKeys.lists() + queryKey: domainModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateEmailsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateEmailsModuleMutation.ts index e805a8ce16..894488ce39 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateEmailsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateEmailsModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { emailsModuleKeys } from "../query-keys"; -import { emailsModuleMutationKeys } from "../mutation-keys"; -import type { EmailsModuleSelect, EmailsModuleWithRelations, CreateEmailsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailsModuleSelect, EmailsModuleWithRelations, CreateEmailsModuleInput } from "../../orm/input-types"; +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 { emailsModuleKeys } from '../query-keys'; +import { emailsModuleMutationKeys } from '../mutation-keys'; +import type { + EmailsModuleSelect, + EmailsModuleWithRelations, + CreateEmailsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EmailsModuleSelect, + EmailsModuleWithRelations, + CreateEmailsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a EmailsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateEmailsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateEmailsModuleMutation(params: { - selection: ({ - fields: S & EmailsModuleSelect; - } & HookStrictSelect, EmailsModuleSelect>); -} & Omit; - }; -}, Error, CreateEmailsModuleInput["emailsModule"]>, "mutationFn">): UseMutationResult<{ - createEmailsModule: { - emailsModule: InferSelectResult; - }; -}, Error, CreateEmailsModuleInput["emailsModule"]>; -export function useCreateEmailsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateEmailsModuleMutation( + params: { + selection: { + fields: S & EmailsModuleSelect; + } & HookStrictSelect, EmailsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createEmailsModule: { + emailsModule: InferSelectResult; + }; + }, + Error, + CreateEmailsModuleInput['emailsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createEmailsModule: { + emailsModule: InferSelectResult; + }; + }, + Error, + CreateEmailsModuleInput['emailsModule'] +>; +export function useCreateEmailsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: emailsModuleMutationKeys.create(), - mutationFn: (data: CreateEmailsModuleInput["emailsModule"]) => getClient().emailsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateEmailsModuleInput['emailsModule']) => + getClient() + .emailsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: emailsModuleKeys.lists() + queryKey: emailsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateEntityTypeProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateEntityTypeProvisionMutation.ts index 6763db292b..70139cea17 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateEntityTypeProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateEntityTypeProvisionMutation.ts @@ -11,16 +11,24 @@ * 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 { entityTypeProvisionKeys } from "../query-keys"; -import { entityTypeProvisionMutationKeys } from "../mutation-keys"; -import type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations, CreateEntityTypeProvisionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations, CreateEntityTypeProvisionInput } from "../../orm/input-types"; +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 { entityTypeProvisionKeys } from '../query-keys'; +import { entityTypeProvisionMutationKeys } from '../mutation-keys'; +import type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, + CreateEntityTypeProvisionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, + CreateEntityTypeProvisionInput, +} from '../../orm/input-types'; /** * Provisions a new membership entity type. Each INSERT creates an entity table, registers a membership type, and installs the required modules (permissions, memberships, limits) plus optional modules (profiles, levels, invites). @@ -40,40 +48,58 @@ export type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations, Creat * mutate({ name: 'New item' }); * ``` */ -export function useCreateEntityTypeProvisionMutation(params: { - selection: ({ - fields: S & EntityTypeProvisionSelect; - } & HookStrictSelect, EntityTypeProvisionSelect>); -} & Omit; - }; -}, Error, CreateEntityTypeProvisionInput["entityTypeProvision"]>, "mutationFn">): UseMutationResult<{ - createEntityTypeProvision: { - entityTypeProvision: InferSelectResult; - }; -}, Error, CreateEntityTypeProvisionInput["entityTypeProvision"]>; -export function useCreateEntityTypeProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateEntityTypeProvisionMutation( + params: { + selection: { + fields: S & EntityTypeProvisionSelect; + } & HookStrictSelect, EntityTypeProvisionSelect>; + } & Omit< + UseMutationOptions< + { + createEntityTypeProvision: { + entityTypeProvision: InferSelectResult; + }; + }, + Error, + CreateEntityTypeProvisionInput['entityTypeProvision'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createEntityTypeProvision: { + entityTypeProvision: InferSelectResult; + }; + }, + Error, + CreateEntityTypeProvisionInput['entityTypeProvision'] +>; +export function useCreateEntityTypeProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: entityTypeProvisionMutationKeys.create(), - mutationFn: (data: CreateEntityTypeProvisionInput["entityTypeProvision"]) => getClient().entityTypeProvision.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateEntityTypeProvisionInput['entityTypeProvision']) => + getClient() + .entityTypeProvision.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: entityTypeProvisionKeys.lists() + queryKey: entityTypeProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateEventsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateEventsModuleMutation.ts index 30fedc6229..2c4c3a669d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateEventsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateEventsModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { eventsModuleKeys } from "../query-keys"; -import { eventsModuleMutationKeys } from "../mutation-keys"; -import type { EventsModuleSelect, EventsModuleWithRelations, CreateEventsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EventsModuleSelect, EventsModuleWithRelations, CreateEventsModuleInput } from "../../orm/input-types"; +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 { eventsModuleKeys } from '../query-keys'; +import { eventsModuleMutationKeys } from '../mutation-keys'; +import type { + EventsModuleSelect, + EventsModuleWithRelations, + CreateEventsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EventsModuleSelect, + EventsModuleWithRelations, + CreateEventsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a EventsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateEventsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateEventsModuleMutation(params: { - selection: ({ - fields: S & EventsModuleSelect; - } & HookStrictSelect, EventsModuleSelect>); -} & Omit; - }; -}, Error, CreateEventsModuleInput["eventsModule"]>, "mutationFn">): UseMutationResult<{ - createEventsModule: { - eventsModule: InferSelectResult; - }; -}, Error, CreateEventsModuleInput["eventsModule"]>; -export function useCreateEventsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateEventsModuleMutation( + params: { + selection: { + fields: S & EventsModuleSelect; + } & HookStrictSelect, EventsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createEventsModule: { + eventsModule: InferSelectResult; + }; + }, + Error, + CreateEventsModuleInput['eventsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createEventsModule: { + eventsModule: InferSelectResult; + }; + }, + Error, + CreateEventsModuleInput['eventsModule'] +>; +export function useCreateEventsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: eventsModuleMutationKeys.create(), - mutationFn: (data: CreateEventsModuleInput["eventsModule"]) => getClient().eventsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateEventsModuleInput['eventsModule']) => + getClient() + .eventsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: eventsModuleKeys.lists() + queryKey: eventsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionDeploymentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionDeploymentModuleMutation.ts index a45d007031..eea1638be6 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionDeploymentModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionDeploymentModuleMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentModuleKeys } from "../query-keys"; -import { functionDeploymentModuleMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations, CreateFunctionDeploymentModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations, CreateFunctionDeploymentModuleInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import { functionDeploymentModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + CreateFunctionDeploymentModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + CreateFunctionDeploymentModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a FunctionDeploymentModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionDeploymentModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionDeploymentModuleMutation(params: { - selection: ({ - fields: S & FunctionDeploymentModuleSelect; - } & HookStrictSelect, FunctionDeploymentModuleSelect>); -} & Omit; - }; -}, Error, CreateFunctionDeploymentModuleInput["functionDeploymentModule"]>, "mutationFn">): UseMutationResult<{ - createFunctionDeploymentModule: { - functionDeploymentModule: InferSelectResult; - }; -}, Error, CreateFunctionDeploymentModuleInput["functionDeploymentModule"]>; -export function useCreateFunctionDeploymentModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionDeploymentModuleMutation( + params: { + selection: { + fields: S & FunctionDeploymentModuleSelect; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentModuleInput['functionDeploymentModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentModuleInput['functionDeploymentModule'] +>; +export function useCreateFunctionDeploymentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDeploymentModuleMutationKeys.create(), - mutationFn: (data: CreateFunctionDeploymentModuleInput["functionDeploymentModule"]) => getClient().functionDeploymentModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionDeploymentModuleInput['functionDeploymentModule']) => + getClient() + .functionDeploymentModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionDeploymentModuleKeys.lists() + queryKey: functionDeploymentModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionInvocationModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionInvocationModuleMutation.ts index 6f8a2487bb..87763873b9 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionInvocationModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionInvocationModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { functionInvocationModuleKeys } from "../query-keys"; -import { functionInvocationModuleMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations, CreateFunctionInvocationModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations, CreateFunctionInvocationModuleInput } from "../../orm/input-types"; +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 { functionInvocationModuleKeys } from '../query-keys'; +import { functionInvocationModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, + CreateFunctionInvocationModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, + CreateFunctionInvocationModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a FunctionInvocationModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionInvocationModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionInvocationModuleMutation(params: { - selection: ({ - fields: S & FunctionInvocationModuleSelect; - } & HookStrictSelect, FunctionInvocationModuleSelect>); -} & Omit; - }; -}, Error, CreateFunctionInvocationModuleInput["functionInvocationModule"]>, "mutationFn">): UseMutationResult<{ - createFunctionInvocationModule: { - functionInvocationModule: InferSelectResult; - }; -}, Error, CreateFunctionInvocationModuleInput["functionInvocationModule"]>; -export function useCreateFunctionInvocationModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionInvocationModuleMutation( + params: { + selection: { + fields: S & FunctionInvocationModuleSelect; + } & HookStrictSelect, FunctionInvocationModuleSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionInvocationModule: { + functionInvocationModule: InferSelectResult; + }; + }, + Error, + CreateFunctionInvocationModuleInput['functionInvocationModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionInvocationModule: { + functionInvocationModule: InferSelectResult; + }; + }, + Error, + CreateFunctionInvocationModuleInput['functionInvocationModule'] +>; +export function useCreateFunctionInvocationModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionInvocationModuleMutationKeys.create(), - mutationFn: (data: CreateFunctionInvocationModuleInput["functionInvocationModule"]) => getClient().functionInvocationModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionInvocationModuleInput['functionInvocationModule']) => + getClient() + .functionInvocationModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionInvocationModuleKeys.lists() + queryKey: functionInvocationModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionModuleMutation.ts index deb2d58c59..ce471a4e36 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { functionModuleKeys } from "../query-keys"; -import { functionModuleMutationKeys } from "../mutation-keys"; -import type { FunctionModuleSelect, FunctionModuleWithRelations, CreateFunctionModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionModuleSelect, FunctionModuleWithRelations, CreateFunctionModuleInput } from "../../orm/input-types"; +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 { functionModuleKeys } from '../query-keys'; +import { functionModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionModuleSelect, + FunctionModuleWithRelations, + CreateFunctionModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionModuleSelect, + FunctionModuleWithRelations, + CreateFunctionModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a FunctionModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateFunctionModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateFunctionModuleMutation(params: { - selection: ({ - fields: S & FunctionModuleSelect; - } & HookStrictSelect, FunctionModuleSelect>); -} & Omit; - }; -}, Error, CreateFunctionModuleInput["functionModule"]>, "mutationFn">): UseMutationResult<{ - createFunctionModule: { - functionModule: InferSelectResult; - }; -}, Error, CreateFunctionModuleInput["functionModule"]>; -export function useCreateFunctionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateFunctionModuleMutation( + params: { + selection: { + fields: S & FunctionModuleSelect; + } & HookStrictSelect, FunctionModuleSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionModule: { + functionModule: InferSelectResult; + }; + }, + Error, + CreateFunctionModuleInput['functionModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionModule: { + functionModule: InferSelectResult; + }; + }, + Error, + CreateFunctionModuleInput['functionModule'] +>; +export function useCreateFunctionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionModuleMutationKeys.create(), - mutationFn: (data: CreateFunctionModuleInput["functionModule"]) => getClient().functionModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateFunctionModuleInput['functionModule']) => + getClient() + .functionModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: functionModuleKeys.lists() + queryKey: functionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphExecutionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphExecutionModuleMutation.ts index a1372ecf27..ef08145d0d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphExecutionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphExecutionModuleMutation.ts @@ -4,62 +4,88 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { graphExecutionModuleKeys } from "../query-keys"; -import { graphExecutionModuleMutationKeys } from "../mutation-keys"; -import type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations, CreateGraphExecutionModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations, CreateGraphExecutionModuleInput } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import { graphExecutionModuleMutationKeys } from '../mutation-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + CreateGraphExecutionModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + CreateGraphExecutionModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a GraphExecutionModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateGraphExecutionModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateGraphExecutionModuleMutation(params: { - selection: ({ - fields: S & GraphExecutionModuleSelect; - } & HookStrictSelect, GraphExecutionModuleSelect>); -} & Omit; - }; -}, Error, CreateGraphExecutionModuleInput["graphExecutionModule"]>, "mutationFn">): UseMutationResult<{ - createGraphExecutionModule: { - graphExecutionModule: InferSelectResult; - }; -}, Error, CreateGraphExecutionModuleInput["graphExecutionModule"]>; -export function useCreateGraphExecutionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateGraphExecutionModuleMutation( + params: { + selection: { + fields: S & GraphExecutionModuleSelect; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseMutationOptions< + { + createGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + CreateGraphExecutionModuleInput['graphExecutionModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + CreateGraphExecutionModuleInput['graphExecutionModule'] +>; +export function useCreateGraphExecutionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: graphExecutionModuleMutationKeys.create(), - mutationFn: (data: CreateGraphExecutionModuleInput["graphExecutionModule"]) => getClient().graphExecutionModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateGraphExecutionModuleInput['graphExecutionModule']) => + getClient() + .graphExecutionModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: graphExecutionModuleKeys.lists() + queryKey: graphExecutionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphModuleMutation.ts index 7167f3b4d7..efcd30facd 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { graphModuleKeys } from "../query-keys"; -import { graphModuleMutationKeys } from "../mutation-keys"; -import type { GraphModuleSelect, GraphModuleWithRelations, CreateGraphModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphModuleSelect, GraphModuleWithRelations, CreateGraphModuleInput } from "../../orm/input-types"; +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 { graphModuleKeys } from '../query-keys'; +import { graphModuleMutationKeys } from '../mutation-keys'; +import type { + GraphModuleSelect, + GraphModuleWithRelations, + CreateGraphModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphModuleSelect, + GraphModuleWithRelations, + CreateGraphModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a GraphModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateGraphModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateGraphModuleMutation(params: { - selection: ({ - fields: S & GraphModuleSelect; - } & HookStrictSelect, GraphModuleSelect>); -} & Omit; - }; -}, Error, CreateGraphModuleInput["graphModule"]>, "mutationFn">): UseMutationResult<{ - createGraphModule: { - graphModule: InferSelectResult; - }; -}, Error, CreateGraphModuleInput["graphModule"]>; -export function useCreateGraphModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateGraphModuleMutation( + params: { + selection: { + fields: S & GraphModuleSelect; + } & HookStrictSelect, GraphModuleSelect>; + } & Omit< + UseMutationOptions< + { + createGraphModule: { + graphModule: InferSelectResult; + }; + }, + Error, + CreateGraphModuleInput['graphModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createGraphModule: { + graphModule: InferSelectResult; + }; + }, + Error, + CreateGraphModuleInput['graphModule'] +>; +export function useCreateGraphModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: graphModuleMutationKeys.create(), - mutationFn: (data: CreateGraphModuleInput["graphModule"]) => getClient().graphModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateGraphModuleInput['graphModule']) => + getClient() + .graphModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: graphModuleKeys.lists() + queryKey: graphModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateHierarchyModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateHierarchyModuleMutation.ts index e7453cd514..0ddc11ad74 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateHierarchyModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateHierarchyModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { hierarchyModuleKeys } from "../query-keys"; -import { hierarchyModuleMutationKeys } from "../mutation-keys"; -import type { HierarchyModuleSelect, HierarchyModuleWithRelations, CreateHierarchyModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HierarchyModuleSelect, HierarchyModuleWithRelations, CreateHierarchyModuleInput } from "../../orm/input-types"; +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 { hierarchyModuleKeys } from '../query-keys'; +import { hierarchyModuleMutationKeys } from '../mutation-keys'; +import type { + HierarchyModuleSelect, + HierarchyModuleWithRelations, + CreateHierarchyModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + HierarchyModuleSelect, + HierarchyModuleWithRelations, + CreateHierarchyModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a HierarchyModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateHierarchyModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateHierarchyModuleMutation(params: { - selection: ({ - fields: S & HierarchyModuleSelect; - } & HookStrictSelect, HierarchyModuleSelect>); -} & Omit; - }; -}, Error, CreateHierarchyModuleInput["hierarchyModule"]>, "mutationFn">): UseMutationResult<{ - createHierarchyModule: { - hierarchyModule: InferSelectResult; - }; -}, Error, CreateHierarchyModuleInput["hierarchyModule"]>; -export function useCreateHierarchyModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateHierarchyModuleMutation( + params: { + selection: { + fields: S & HierarchyModuleSelect; + } & HookStrictSelect, HierarchyModuleSelect>; + } & Omit< + UseMutationOptions< + { + createHierarchyModule: { + hierarchyModule: InferSelectResult; + }; + }, + Error, + CreateHierarchyModuleInput['hierarchyModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createHierarchyModule: { + hierarchyModule: InferSelectResult; + }; + }, + Error, + CreateHierarchyModuleInput['hierarchyModule'] +>; +export function useCreateHierarchyModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: hierarchyModuleMutationKeys.create(), - mutationFn: (data: CreateHierarchyModuleInput["hierarchyModule"]) => getClient().hierarchyModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateHierarchyModuleInput['hierarchyModule']) => + getClient() + .hierarchyModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: hierarchyModuleKeys.lists() + queryKey: hierarchyModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateHttpRouteModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateHttpRouteModuleMutation.ts index 52444bdec9..b0676e060b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateHttpRouteModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateHttpRouteModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { httpRouteModuleKeys } from "../query-keys"; -import { httpRouteModuleMutationKeys } from "../mutation-keys"; -import type { HttpRouteModuleSelect, HttpRouteModuleWithRelations, CreateHttpRouteModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteModuleSelect, HttpRouteModuleWithRelations, CreateHttpRouteModuleInput } from "../../orm/input-types"; +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 { httpRouteModuleKeys } from '../query-keys'; +import { httpRouteModuleMutationKeys } from '../mutation-keys'; +import type { + HttpRouteModuleSelect, + HttpRouteModuleWithRelations, + CreateHttpRouteModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + HttpRouteModuleSelect, + HttpRouteModuleWithRelations, + CreateHttpRouteModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a HttpRouteModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateHttpRouteModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateHttpRouteModuleMutation(params: { - selection: ({ - fields: S & HttpRouteModuleSelect; - } & HookStrictSelect, HttpRouteModuleSelect>); -} & Omit; - }; -}, Error, CreateHttpRouteModuleInput["httpRouteModule"]>, "mutationFn">): UseMutationResult<{ - createHttpRouteModule: { - httpRouteModule: InferSelectResult; - }; -}, Error, CreateHttpRouteModuleInput["httpRouteModule"]>; -export function useCreateHttpRouteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateHttpRouteModuleMutation( + params: { + selection: { + fields: S & HttpRouteModuleSelect; + } & HookStrictSelect, HttpRouteModuleSelect>; + } & Omit< + UseMutationOptions< + { + createHttpRouteModule: { + httpRouteModule: InferSelectResult; + }; + }, + Error, + CreateHttpRouteModuleInput['httpRouteModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createHttpRouteModule: { + httpRouteModule: InferSelectResult; + }; + }, + Error, + CreateHttpRouteModuleInput['httpRouteModule'] +>; +export function useCreateHttpRouteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: httpRouteModuleMutationKeys.create(), - mutationFn: (data: CreateHttpRouteModuleInput["httpRouteModule"]) => getClient().httpRouteModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateHttpRouteModuleInput['httpRouteModule']) => + getClient() + .httpRouteModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: httpRouteModuleKeys.lists() + queryKey: httpRouteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateI18NModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateI18NModuleMutation.ts index cbbc441848..2e3cf26dcc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateI18NModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateI18NModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { i18NModuleKeys } from "../query-keys"; -import { i18NModuleMutationKeys } from "../mutation-keys"; -import type { I18NModuleSelect, I18NModuleWithRelations, CreateI18NModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { I18NModuleSelect, I18NModuleWithRelations, CreateI18NModuleInput } from "../../orm/input-types"; +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 { i18NModuleKeys } from '../query-keys'; +import { i18NModuleMutationKeys } from '../mutation-keys'; +import type { + I18NModuleSelect, + I18NModuleWithRelations, + CreateI18NModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + I18NModuleSelect, + I18NModuleWithRelations, + CreateI18NModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a I18NModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateI18NModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateI18NModuleMutation(params: { - selection: ({ - fields: S & I18NModuleSelect; - } & HookStrictSelect, I18NModuleSelect>); -} & Omit; - }; -}, Error, CreateI18NModuleInput["i18NModule"]>, "mutationFn">): UseMutationResult<{ - createI18NModule: { - i18NModule: InferSelectResult; - }; -}, Error, CreateI18NModuleInput["i18NModule"]>; -export function useCreateI18NModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateI18NModuleMutation( + params: { + selection: { + fields: S & I18NModuleSelect; + } & HookStrictSelect, I18NModuleSelect>; + } & Omit< + UseMutationOptions< + { + createI18NModule: { + i18NModule: InferSelectResult; + }; + }, + Error, + CreateI18NModuleInput['i18NModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createI18NModule: { + i18NModule: InferSelectResult; + }; + }, + Error, + CreateI18NModuleInput['i18NModule'] +>; +export function useCreateI18NModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: i18NModuleMutationKeys.create(), - mutationFn: (data: CreateI18NModuleInput["i18NModule"]) => getClient().i18NModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateI18NModuleInput['i18NModule']) => + getClient() + .i18NModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: i18NModuleKeys.lists() + queryKey: i18NModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateIdentityProvidersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateIdentityProvidersModuleMutation.ts index b29677c159..365561f37d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateIdentityProvidersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateIdentityProvidersModuleMutation.ts @@ -12,16 +12,24 @@ * 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 { identityProvidersModuleKeys } from "../query-keys"; -import { identityProvidersModuleMutationKeys } from "../mutation-keys"; -import type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations, CreateIdentityProvidersModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations, CreateIdentityProvidersModuleInput } from "../../orm/input-types"; +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 { identityProvidersModuleKeys } from '../query-keys'; +import { identityProvidersModuleMutationKeys } from '../mutation-keys'; +import type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, + CreateIdentityProvidersModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, + CreateIdentityProvidersModuleInput, +} from '../../orm/input-types'; /** * Entity-aware config row for the identity_providers_module, which provisions a per-database identity_providers table holding OAuth2 / OIDC (and future SAML) provider definitions. @@ -42,40 +50,58 @@ export type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelation * mutate({ name: 'New item' }); * ``` */ -export function useCreateIdentityProvidersModuleMutation(params: { - selection: ({ - fields: S & IdentityProvidersModuleSelect; - } & HookStrictSelect, IdentityProvidersModuleSelect>); -} & Omit; - }; -}, Error, CreateIdentityProvidersModuleInput["identityProvidersModule"]>, "mutationFn">): UseMutationResult<{ - createIdentityProvidersModule: { - identityProvidersModule: InferSelectResult; - }; -}, Error, CreateIdentityProvidersModuleInput["identityProvidersModule"]>; -export function useCreateIdentityProvidersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateIdentityProvidersModuleMutation( + params: { + selection: { + fields: S & IdentityProvidersModuleSelect; + } & HookStrictSelect, IdentityProvidersModuleSelect>; + } & Omit< + UseMutationOptions< + { + createIdentityProvidersModule: { + identityProvidersModule: InferSelectResult; + }; + }, + Error, + CreateIdentityProvidersModuleInput['identityProvidersModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createIdentityProvidersModule: { + identityProvidersModule: InferSelectResult; + }; + }, + Error, + CreateIdentityProvidersModuleInput['identityProvidersModule'] +>; +export function useCreateIdentityProvidersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: identityProvidersModuleMutationKeys.create(), - mutationFn: (data: CreateIdentityProvidersModuleInput["identityProvidersModule"]) => getClient().identityProvidersModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateIdentityProvidersModuleInput['identityProvidersModule']) => + getClient() + .identityProvidersModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: identityProvidersModuleKeys.lists() + queryKey: identityProvidersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInferenceLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInferenceLogModuleMutation.ts index ed506979e5..9e6544177a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInferenceLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInferenceLogModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { inferenceLogModuleKeys } from "../query-keys"; -import { inferenceLogModuleMutationKeys } from "../mutation-keys"; -import type { InferenceLogModuleSelect, InferenceLogModuleWithRelations, CreateInferenceLogModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InferenceLogModuleSelect, InferenceLogModuleWithRelations, CreateInferenceLogModuleInput } from "../../orm/input-types"; +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 { inferenceLogModuleKeys } from '../query-keys'; +import { inferenceLogModuleMutationKeys } from '../mutation-keys'; +import type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, + CreateInferenceLogModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, + CreateInferenceLogModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a InferenceLogModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInferenceLogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInferenceLogModuleMutation(params: { - selection: ({ - fields: S & InferenceLogModuleSelect; - } & HookStrictSelect, InferenceLogModuleSelect>); -} & Omit; - }; -}, Error, CreateInferenceLogModuleInput["inferenceLogModule"]>, "mutationFn">): UseMutationResult<{ - createInferenceLogModule: { - inferenceLogModule: InferSelectResult; - }; -}, Error, CreateInferenceLogModuleInput["inferenceLogModule"]>; -export function useCreateInferenceLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInferenceLogModuleMutation( + params: { + selection: { + fields: S & InferenceLogModuleSelect; + } & HookStrictSelect, InferenceLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + createInferenceLogModule: { + inferenceLogModule: InferSelectResult; + }; + }, + Error, + CreateInferenceLogModuleInput['inferenceLogModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInferenceLogModule: { + inferenceLogModule: InferSelectResult; + }; + }, + Error, + CreateInferenceLogModuleInput['inferenceLogModule'] +>; +export function useCreateInferenceLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: inferenceLogModuleMutationKeys.create(), - mutationFn: (data: CreateInferenceLogModuleInput["inferenceLogModule"]) => getClient().inferenceLogModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInferenceLogModuleInput['inferenceLogModule']) => + getClient() + .inferenceLogModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: inferenceLogModuleKeys.lists() + queryKey: inferenceLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInfraConfigModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInfraConfigModuleMutation.ts index 8c9c8cdf8d..599e49fa5a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInfraConfigModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInfraConfigModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { infraConfigModuleKeys } from "../query-keys"; -import { infraConfigModuleMutationKeys } from "../mutation-keys"; -import type { InfraConfigModuleSelect, InfraConfigModuleWithRelations, CreateInfraConfigModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraConfigModuleSelect, InfraConfigModuleWithRelations, CreateInfraConfigModuleInput } from "../../orm/input-types"; +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 { infraConfigModuleKeys } from '../query-keys'; +import { infraConfigModuleMutationKeys } from '../mutation-keys'; +import type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, + CreateInfraConfigModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, + CreateInfraConfigModuleInput, +} from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInfraConfigModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInfraConfigModuleMutation(params: { - selection: ({ - fields: S & InfraConfigModuleSelect; - } & HookStrictSelect, InfraConfigModuleSelect>); -} & Omit; - }; -}, Error, CreateInfraConfigModuleInput["infraConfigModule"]>, "mutationFn">): UseMutationResult<{ - createInfraConfigModule: { - infraConfigModule: InferSelectResult; - }; -}, Error, CreateInfraConfigModuleInput["infraConfigModule"]>; -export function useCreateInfraConfigModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInfraConfigModuleMutation( + params: { + selection: { + fields: S & InfraConfigModuleSelect; + } & HookStrictSelect, InfraConfigModuleSelect>; + } & Omit< + UseMutationOptions< + { + createInfraConfigModule: { + infraConfigModule: InferSelectResult; + }; + }, + Error, + CreateInfraConfigModuleInput['infraConfigModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInfraConfigModule: { + infraConfigModule: InferSelectResult; + }; + }, + Error, + CreateInfraConfigModuleInput['infraConfigModule'] +>; +export function useCreateInfraConfigModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraConfigModuleMutationKeys.create(), - mutationFn: (data: CreateInfraConfigModuleInput["infraConfigModule"]) => getClient().infraConfigModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInfraConfigModuleInput['infraConfigModule']) => + getClient() + .infraConfigModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: infraConfigModuleKeys.lists() + queryKey: infraConfigModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInfraSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInfraSecretsModuleMutation.ts index 60bbde42cd..78094865d2 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInfraSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInfraSecretsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { infraSecretsModuleKeys } from "../query-keys"; -import { infraSecretsModuleMutationKeys } from "../mutation-keys"; -import type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations, CreateInfraSecretsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations, CreateInfraSecretsModuleInput } from "../../orm/input-types"; +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 { infraSecretsModuleKeys } from '../query-keys'; +import { infraSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, + CreateInfraSecretsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, + CreateInfraSecretsModuleInput, +} from '../../orm/input-types'; /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInfraSecretsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInfraSecretsModuleMutation(params: { - selection: ({ - fields: S & InfraSecretsModuleSelect; - } & HookStrictSelect, InfraSecretsModuleSelect>); -} & Omit; - }; -}, Error, CreateInfraSecretsModuleInput["infraSecretsModule"]>, "mutationFn">): UseMutationResult<{ - createInfraSecretsModule: { - infraSecretsModule: InferSelectResult; - }; -}, Error, CreateInfraSecretsModuleInput["infraSecretsModule"]>; -export function useCreateInfraSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInfraSecretsModuleMutation( + params: { + selection: { + fields: S & InfraSecretsModuleSelect; + } & HookStrictSelect, InfraSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createInfraSecretsModule: { + infraSecretsModule: InferSelectResult; + }; + }, + Error, + CreateInfraSecretsModuleInput['infraSecretsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInfraSecretsModule: { + infraSecretsModule: InferSelectResult; + }; + }, + Error, + CreateInfraSecretsModuleInput['infraSecretsModule'] +>; +export function useCreateInfraSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraSecretsModuleMutationKeys.create(), - mutationFn: (data: CreateInfraSecretsModuleInput["infraSecretsModule"]) => getClient().infraSecretsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInfraSecretsModuleInput['infraSecretsModule']) => + getClient() + .infraSecretsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: infraSecretsModuleKeys.lists() + queryKey: infraSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateIntegrationProvidersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateIntegrationProvidersModuleMutation.ts index a0c4441117..0e52290899 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateIntegrationProvidersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateIntegrationProvidersModuleMutation.ts @@ -8,16 +8,24 @@ * 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 { integrationProvidersModuleKeys } from "../query-keys"; -import { integrationProvidersModuleMutationKeys } from "../mutation-keys"; -import type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations, CreateIntegrationProvidersModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations, CreateIntegrationProvidersModuleInput } from "../../orm/input-types"; +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 { integrationProvidersModuleKeys } from '../query-keys'; +import { integrationProvidersModuleMutationKeys } from '../mutation-keys'; +import type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, + CreateIntegrationProvidersModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, + CreateIntegrationProvidersModuleInput, +} from '../../orm/input-types'; /** * Config row for the integration_providers_module, which provisions a per-database integration_providers table holding branded, reusable service definitions. @@ -34,40 +42,64 @@ export type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRe * mutate({ name: 'New item' }); * ``` */ -export function useCreateIntegrationProvidersModuleMutation(params: { - selection: ({ - fields: S & IntegrationProvidersModuleSelect; - } & HookStrictSelect, IntegrationProvidersModuleSelect>); -} & Omit; - }; -}, Error, CreateIntegrationProvidersModuleInput["integrationProvidersModule"]>, "mutationFn">): UseMutationResult<{ - createIntegrationProvidersModule: { - integrationProvidersModule: InferSelectResult; - }; -}, Error, CreateIntegrationProvidersModuleInput["integrationProvidersModule"]>; -export function useCreateIntegrationProvidersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateIntegrationProvidersModuleMutation< + S extends IntegrationProvidersModuleSelect, +>( + params: { + selection: { + fields: S & IntegrationProvidersModuleSelect; + } & HookStrictSelect, IntegrationProvidersModuleSelect>; + } & Omit< + UseMutationOptions< + { + createIntegrationProvidersModule: { + integrationProvidersModule: InferSelectResult; + }; + }, + Error, + CreateIntegrationProvidersModuleInput['integrationProvidersModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createIntegrationProvidersModule: { + integrationProvidersModule: InferSelectResult; + }; + }, + Error, + CreateIntegrationProvidersModuleInput['integrationProvidersModule'] +>; +export function useCreateIntegrationProvidersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateIntegrationProvidersModuleInput['integrationProvidersModule'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: integrationProvidersModuleMutationKeys.create(), - mutationFn: (data: CreateIntegrationProvidersModuleInput["integrationProvidersModule"]) => getClient().integrationProvidersModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateIntegrationProvidersModuleInput['integrationProvidersModule']) => + getClient() + .integrationProvidersModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: integrationProvidersModuleKeys.lists() + queryKey: integrationProvidersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInternalSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInternalSecretsModuleMutation.ts index 45a8042021..26b1d00ef6 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInternalSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInternalSecretsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { internalSecretsModuleKeys } from "../query-keys"; -import { internalSecretsModuleMutationKeys } from "../mutation-keys"; -import type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations, CreateInternalSecretsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations, CreateInternalSecretsModuleInput } from "../../orm/input-types"; +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 { internalSecretsModuleKeys } from '../query-keys'; +import { internalSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, + CreateInternalSecretsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, + CreateInternalSecretsModuleInput, +} from '../../orm/input-types'; /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInternalSecretsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInternalSecretsModuleMutation(params: { - selection: ({ - fields: S & InternalSecretsModuleSelect; - } & HookStrictSelect, InternalSecretsModuleSelect>); -} & Omit; - }; -}, Error, CreateInternalSecretsModuleInput["internalSecretsModule"]>, "mutationFn">): UseMutationResult<{ - createInternalSecretsModule: { - internalSecretsModule: InferSelectResult; - }; -}, Error, CreateInternalSecretsModuleInput["internalSecretsModule"]>; -export function useCreateInternalSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInternalSecretsModuleMutation( + params: { + selection: { + fields: S & InternalSecretsModuleSelect; + } & HookStrictSelect, InternalSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createInternalSecretsModule: { + internalSecretsModule: InferSelectResult; + }; + }, + Error, + CreateInternalSecretsModuleInput['internalSecretsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInternalSecretsModule: { + internalSecretsModule: InferSelectResult; + }; + }, + Error, + CreateInternalSecretsModuleInput['internalSecretsModule'] +>; +export function useCreateInternalSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: internalSecretsModuleMutationKeys.create(), - mutationFn: (data: CreateInternalSecretsModuleInput["internalSecretsModule"]) => getClient().internalSecretsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInternalSecretsModuleInput['internalSecretsModule']) => + getClient() + .internalSecretsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: internalSecretsModuleKeys.lists() + queryKey: internalSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInvitesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInvitesModuleMutation.ts index 25a83ae4fa..6d740e5e35 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateInvitesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateInvitesModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { invitesModuleKeys } from "../query-keys"; -import { invitesModuleMutationKeys } from "../mutation-keys"; -import type { InvitesModuleSelect, InvitesModuleWithRelations, CreateInvitesModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InvitesModuleSelect, InvitesModuleWithRelations, CreateInvitesModuleInput } from "../../orm/input-types"; +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 { invitesModuleKeys } from '../query-keys'; +import { invitesModuleMutationKeys } from '../mutation-keys'; +import type { + InvitesModuleSelect, + InvitesModuleWithRelations, + CreateInvitesModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InvitesModuleSelect, + InvitesModuleWithRelations, + CreateInvitesModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a InvitesModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateInvitesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateInvitesModuleMutation(params: { - selection: ({ - fields: S & InvitesModuleSelect; - } & HookStrictSelect, InvitesModuleSelect>); -} & Omit; - }; -}, Error, CreateInvitesModuleInput["invitesModule"]>, "mutationFn">): UseMutationResult<{ - createInvitesModule: { - invitesModule: InferSelectResult; - }; -}, Error, CreateInvitesModuleInput["invitesModule"]>; -export function useCreateInvitesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateInvitesModuleMutation( + params: { + selection: { + fields: S & InvitesModuleSelect; + } & HookStrictSelect, InvitesModuleSelect>; + } & Omit< + UseMutationOptions< + { + createInvitesModule: { + invitesModule: InferSelectResult; + }; + }, + Error, + CreateInvitesModuleInput['invitesModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createInvitesModule: { + invitesModule: InferSelectResult; + }; + }, + Error, + CreateInvitesModuleInput['invitesModule'] +>; +export function useCreateInvitesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: invitesModuleMutationKeys.create(), - mutationFn: (data: CreateInvitesModuleInput["invitesModule"]) => getClient().invitesModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateInvitesModuleInput['invitesModule']) => + getClient() + .invitesModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: invitesModuleKeys.lists() + queryKey: invitesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateLimitsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateLimitsModuleMutation.ts index 896e1f3b86..c7c2579d2e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateLimitsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateLimitsModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { limitsModuleKeys } from "../query-keys"; -import { limitsModuleMutationKeys } from "../mutation-keys"; -import type { LimitsModuleSelect, LimitsModuleWithRelations, CreateLimitsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { LimitsModuleSelect, LimitsModuleWithRelations, CreateLimitsModuleInput } from "../../orm/input-types"; +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 { limitsModuleKeys } from '../query-keys'; +import { limitsModuleMutationKeys } from '../mutation-keys'; +import type { + LimitsModuleSelect, + LimitsModuleWithRelations, + CreateLimitsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + LimitsModuleSelect, + LimitsModuleWithRelations, + CreateLimitsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a LimitsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateLimitsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateLimitsModuleMutation(params: { - selection: ({ - fields: S & LimitsModuleSelect; - } & HookStrictSelect, LimitsModuleSelect>); -} & Omit; - }; -}, Error, CreateLimitsModuleInput["limitsModule"]>, "mutationFn">): UseMutationResult<{ - createLimitsModule: { - limitsModule: InferSelectResult; - }; -}, Error, CreateLimitsModuleInput["limitsModule"]>; -export function useCreateLimitsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateLimitsModuleMutation( + params: { + selection: { + fields: S & LimitsModuleSelect; + } & HookStrictSelect, LimitsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createLimitsModule: { + limitsModule: InferSelectResult; + }; + }, + Error, + CreateLimitsModuleInput['limitsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createLimitsModule: { + limitsModule: InferSelectResult; + }; + }, + Error, + CreateLimitsModuleInput['limitsModule'] +>; +export function useCreateLimitsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: limitsModuleMutationKeys.create(), - mutationFn: (data: CreateLimitsModuleInput["limitsModule"]) => getClient().limitsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateLimitsModuleInput['limitsModule']) => + getClient() + .limitsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: limitsModuleKeys.lists() + queryKey: limitsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateMembershipTypesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateMembershipTypesModuleMutation.ts index 31b8f86cef..f2455629ca 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateMembershipTypesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateMembershipTypesModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { membershipTypesModuleKeys } from "../query-keys"; -import { membershipTypesModuleMutationKeys } from "../mutation-keys"; -import type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations, CreateMembershipTypesModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations, CreateMembershipTypesModuleInput } from "../../orm/input-types"; +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 { membershipTypesModuleKeys } from '../query-keys'; +import { membershipTypesModuleMutationKeys } from '../mutation-keys'; +import type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, + CreateMembershipTypesModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, + CreateMembershipTypesModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a MembershipTypesModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateMembershipTypesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateMembershipTypesModuleMutation(params: { - selection: ({ - fields: S & MembershipTypesModuleSelect; - } & HookStrictSelect, MembershipTypesModuleSelect>); -} & Omit; - }; -}, Error, CreateMembershipTypesModuleInput["membershipTypesModule"]>, "mutationFn">): UseMutationResult<{ - createMembershipTypesModule: { - membershipTypesModule: InferSelectResult; - }; -}, Error, CreateMembershipTypesModuleInput["membershipTypesModule"]>; -export function useCreateMembershipTypesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateMembershipTypesModuleMutation( + params: { + selection: { + fields: S & MembershipTypesModuleSelect; + } & HookStrictSelect, MembershipTypesModuleSelect>; + } & Omit< + UseMutationOptions< + { + createMembershipTypesModule: { + membershipTypesModule: InferSelectResult; + }; + }, + Error, + CreateMembershipTypesModuleInput['membershipTypesModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createMembershipTypesModule: { + membershipTypesModule: InferSelectResult; + }; + }, + Error, + CreateMembershipTypesModuleInput['membershipTypesModule'] +>; +export function useCreateMembershipTypesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipTypesModuleMutationKeys.create(), - mutationFn: (data: CreateMembershipTypesModuleInput["membershipTypesModule"]) => getClient().membershipTypesModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateMembershipTypesModuleInput['membershipTypesModule']) => + getClient() + .membershipTypesModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: membershipTypesModuleKeys.lists() + queryKey: membershipTypesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateMembershipsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateMembershipsModuleMutation.ts index 464bb8d7f0..4d9fe8861b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateMembershipsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateMembershipsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { membershipsModuleKeys } from "../query-keys"; -import { membershipsModuleMutationKeys } from "../mutation-keys"; -import type { MembershipsModuleSelect, MembershipsModuleWithRelations, CreateMembershipsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipsModuleSelect, MembershipsModuleWithRelations, CreateMembershipsModuleInput } from "../../orm/input-types"; +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 { membershipsModuleKeys } from '../query-keys'; +import { membershipsModuleMutationKeys } from '../mutation-keys'; +import type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, + CreateMembershipsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, + CreateMembershipsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a MembershipsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateMembershipsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateMembershipsModuleMutation(params: { - selection: ({ - fields: S & MembershipsModuleSelect; - } & HookStrictSelect, MembershipsModuleSelect>); -} & Omit; - }; -}, Error, CreateMembershipsModuleInput["membershipsModule"]>, "mutationFn">): UseMutationResult<{ - createMembershipsModule: { - membershipsModule: InferSelectResult; - }; -}, Error, CreateMembershipsModuleInput["membershipsModule"]>; -export function useCreateMembershipsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateMembershipsModuleMutation( + params: { + selection: { + fields: S & MembershipsModuleSelect; + } & HookStrictSelect, MembershipsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createMembershipsModule: { + membershipsModule: InferSelectResult; + }; + }, + Error, + CreateMembershipsModuleInput['membershipsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createMembershipsModule: { + membershipsModule: InferSelectResult; + }; + }, + Error, + CreateMembershipsModuleInput['membershipsModule'] +>; +export function useCreateMembershipsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipsModuleMutationKeys.create(), - mutationFn: (data: CreateMembershipsModuleInput["membershipsModule"]) => getClient().membershipsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateMembershipsModuleInput['membershipsModule']) => + getClient() + .membershipsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: membershipsModuleKeys.lists() + queryKey: membershipsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateMerkleStoreModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateMerkleStoreModuleMutation.ts index ed7c5e74b9..dfb765dd28 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateMerkleStoreModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateMerkleStoreModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { merkleStoreModuleKeys } from "../query-keys"; -import { merkleStoreModuleMutationKeys } from "../mutation-keys"; -import type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations, CreateMerkleStoreModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations, CreateMerkleStoreModuleInput } from "../../orm/input-types"; +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 { merkleStoreModuleKeys } from '../query-keys'; +import { merkleStoreModuleMutationKeys } from '../mutation-keys'; +import type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, + CreateMerkleStoreModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, + CreateMerkleStoreModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a MerkleStoreModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateMerkleStoreModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateMerkleStoreModuleMutation(params: { - selection: ({ - fields: S & MerkleStoreModuleSelect; - } & HookStrictSelect, MerkleStoreModuleSelect>); -} & Omit; - }; -}, Error, CreateMerkleStoreModuleInput["merkleStoreModule"]>, "mutationFn">): UseMutationResult<{ - createMerkleStoreModule: { - merkleStoreModule: InferSelectResult; - }; -}, Error, CreateMerkleStoreModuleInput["merkleStoreModule"]>; -export function useCreateMerkleStoreModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateMerkleStoreModuleMutation( + params: { + selection: { + fields: S & MerkleStoreModuleSelect; + } & HookStrictSelect, MerkleStoreModuleSelect>; + } & Omit< + UseMutationOptions< + { + createMerkleStoreModule: { + merkleStoreModule: InferSelectResult; + }; + }, + Error, + CreateMerkleStoreModuleInput['merkleStoreModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createMerkleStoreModule: { + merkleStoreModule: InferSelectResult; + }; + }, + Error, + CreateMerkleStoreModuleInput['merkleStoreModule'] +>; +export function useCreateMerkleStoreModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: merkleStoreModuleMutationKeys.create(), - mutationFn: (data: CreateMerkleStoreModuleInput["merkleStoreModule"]) => getClient().merkleStoreModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateMerkleStoreModuleInput['merkleStoreModule']) => + getClient() + .merkleStoreModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.lists() + queryKey: merkleStoreModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateNamespaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateNamespaceModuleMutation.ts index ee09f8c310..784019e6eb 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateNamespaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateNamespaceModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { namespaceModuleKeys } from "../query-keys"; -import { namespaceModuleMutationKeys } from "../mutation-keys"; -import type { NamespaceModuleSelect, NamespaceModuleWithRelations, CreateNamespaceModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceModuleSelect, NamespaceModuleWithRelations, CreateNamespaceModuleInput } from "../../orm/input-types"; +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 { namespaceModuleKeys } from '../query-keys'; +import { namespaceModuleMutationKeys } from '../mutation-keys'; +import type { + NamespaceModuleSelect, + NamespaceModuleWithRelations, + CreateNamespaceModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceModuleSelect, + NamespaceModuleWithRelations, + CreateNamespaceModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a NamespaceModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateNamespaceModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateNamespaceModuleMutation(params: { - selection: ({ - fields: S & NamespaceModuleSelect; - } & HookStrictSelect, NamespaceModuleSelect>); -} & Omit; - }; -}, Error, CreateNamespaceModuleInput["namespaceModule"]>, "mutationFn">): UseMutationResult<{ - createNamespaceModule: { - namespaceModule: InferSelectResult; - }; -}, Error, CreateNamespaceModuleInput["namespaceModule"]>; -export function useCreateNamespaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateNamespaceModuleMutation( + params: { + selection: { + fields: S & NamespaceModuleSelect; + } & HookStrictSelect, NamespaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + createNamespaceModule: { + namespaceModule: InferSelectResult; + }; + }, + Error, + CreateNamespaceModuleInput['namespaceModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createNamespaceModule: { + namespaceModule: InferSelectResult; + }; + }, + Error, + CreateNamespaceModuleInput['namespaceModule'] +>; +export function useCreateNamespaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceModuleMutationKeys.create(), - mutationFn: (data: CreateNamespaceModuleInput["namespaceModule"]) => getClient().namespaceModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateNamespaceModuleInput['namespaceModule']) => + getClient() + .namespaceModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.lists() + queryKey: namespaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateNotificationsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateNotificationsModuleMutation.ts index e6ee14c6b1..ee01e5700f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateNotificationsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateNotificationsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { notificationsModuleKeys } from "../query-keys"; -import { notificationsModuleMutationKeys } from "../mutation-keys"; -import type { NotificationsModuleSelect, NotificationsModuleWithRelations, CreateNotificationsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NotificationsModuleSelect, NotificationsModuleWithRelations, CreateNotificationsModuleInput } from "../../orm/input-types"; +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 { notificationsModuleKeys } from '../query-keys'; +import { notificationsModuleMutationKeys } from '../mutation-keys'; +import type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, + CreateNotificationsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, + CreateNotificationsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a NotificationsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateNotificationsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateNotificationsModuleMutation(params: { - selection: ({ - fields: S & NotificationsModuleSelect; - } & HookStrictSelect, NotificationsModuleSelect>); -} & Omit; - }; -}, Error, CreateNotificationsModuleInput["notificationsModule"]>, "mutationFn">): UseMutationResult<{ - createNotificationsModule: { - notificationsModule: InferSelectResult; - }; -}, Error, CreateNotificationsModuleInput["notificationsModule"]>; -export function useCreateNotificationsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateNotificationsModuleMutation( + params: { + selection: { + fields: S & NotificationsModuleSelect; + } & HookStrictSelect, NotificationsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createNotificationsModule: { + notificationsModule: InferSelectResult; + }; + }, + Error, + CreateNotificationsModuleInput['notificationsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createNotificationsModule: { + notificationsModule: InferSelectResult; + }; + }, + Error, + CreateNotificationsModuleInput['notificationsModule'] +>; +export function useCreateNotificationsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: notificationsModuleMutationKeys.create(), - mutationFn: (data: CreateNotificationsModuleInput["notificationsModule"]) => getClient().notificationsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateNotificationsModuleInput['notificationsModule']) => + getClient() + .notificationsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: notificationsModuleKeys.lists() + queryKey: notificationsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePermissionsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePermissionsModuleMutation.ts index 3e324b7167..38c0b3b9ba 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePermissionsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePermissionsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { permissionsModuleKeys } from "../query-keys"; -import { permissionsModuleMutationKeys } from "../mutation-keys"; -import type { PermissionsModuleSelect, PermissionsModuleWithRelations, CreatePermissionsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PermissionsModuleSelect, PermissionsModuleWithRelations, CreatePermissionsModuleInput } from "../../orm/input-types"; +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 { permissionsModuleKeys } from '../query-keys'; +import { permissionsModuleMutationKeys } from '../mutation-keys'; +import type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, + CreatePermissionsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, + CreatePermissionsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PermissionsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePermissionsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePermissionsModuleMutation(params: { - selection: ({ - fields: S & PermissionsModuleSelect; - } & HookStrictSelect, PermissionsModuleSelect>); -} & Omit; - }; -}, Error, CreatePermissionsModuleInput["permissionsModule"]>, "mutationFn">): UseMutationResult<{ - createPermissionsModule: { - permissionsModule: InferSelectResult; - }; -}, Error, CreatePermissionsModuleInput["permissionsModule"]>; -export function useCreatePermissionsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePermissionsModuleMutation( + params: { + selection: { + fields: S & PermissionsModuleSelect; + } & HookStrictSelect, PermissionsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createPermissionsModule: { + permissionsModule: InferSelectResult; + }; + }, + Error, + CreatePermissionsModuleInput['permissionsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPermissionsModule: { + permissionsModule: InferSelectResult; + }; + }, + Error, + CreatePermissionsModuleInput['permissionsModule'] +>; +export function useCreatePermissionsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: permissionsModuleMutationKeys.create(), - mutationFn: (data: CreatePermissionsModuleInput["permissionsModule"]) => getClient().permissionsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePermissionsModuleInput['permissionsModule']) => + getClient() + .permissionsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: permissionsModuleKeys.lists() + queryKey: permissionsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePhoneNumbersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePhoneNumbersModuleMutation.ts index 4c4c5f8ce8..7239a26492 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePhoneNumbersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePhoneNumbersModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { phoneNumbersModuleKeys } from "../query-keys"; -import { phoneNumbersModuleMutationKeys } from "../mutation-keys"; -import type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations, CreatePhoneNumbersModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations, CreatePhoneNumbersModuleInput } from "../../orm/input-types"; +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 { phoneNumbersModuleKeys } from '../query-keys'; +import { phoneNumbersModuleMutationKeys } from '../mutation-keys'; +import type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, + CreatePhoneNumbersModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, + CreatePhoneNumbersModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PhoneNumbersModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePhoneNumbersModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePhoneNumbersModuleMutation(params: { - selection: ({ - fields: S & PhoneNumbersModuleSelect; - } & HookStrictSelect, PhoneNumbersModuleSelect>); -} & Omit; - }; -}, Error, CreatePhoneNumbersModuleInput["phoneNumbersModule"]>, "mutationFn">): UseMutationResult<{ - createPhoneNumbersModule: { - phoneNumbersModule: InferSelectResult; - }; -}, Error, CreatePhoneNumbersModuleInput["phoneNumbersModule"]>; -export function useCreatePhoneNumbersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePhoneNumbersModuleMutation( + params: { + selection: { + fields: S & PhoneNumbersModuleSelect; + } & HookStrictSelect, PhoneNumbersModuleSelect>; + } & Omit< + UseMutationOptions< + { + createPhoneNumbersModule: { + phoneNumbersModule: InferSelectResult; + }; + }, + Error, + CreatePhoneNumbersModuleInput['phoneNumbersModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPhoneNumbersModule: { + phoneNumbersModule: InferSelectResult; + }; + }, + Error, + CreatePhoneNumbersModuleInput['phoneNumbersModule'] +>; +export function useCreatePhoneNumbersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: phoneNumbersModuleMutationKeys.create(), - mutationFn: (data: CreatePhoneNumbersModuleInput["phoneNumbersModule"]) => getClient().phoneNumbersModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePhoneNumbersModuleInput['phoneNumbersModule']) => + getClient() + .phoneNumbersModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: phoneNumbersModuleKeys.lists() + queryKey: phoneNumbersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePlansModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePlansModuleMutation.ts index 2e8ab83732..d109b989b4 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePlansModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePlansModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { plansModuleKeys } from "../query-keys"; -import { plansModuleMutationKeys } from "../mutation-keys"; -import type { PlansModuleSelect, PlansModuleWithRelations, CreatePlansModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlansModuleSelect, PlansModuleWithRelations, CreatePlansModuleInput } from "../../orm/input-types"; +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 { plansModuleKeys } from '../query-keys'; +import { plansModuleMutationKeys } from '../mutation-keys'; +import type { + PlansModuleSelect, + PlansModuleWithRelations, + CreatePlansModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlansModuleSelect, + PlansModuleWithRelations, + CreatePlansModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a PlansModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreatePlansModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreatePlansModuleMutation(params: { - selection: ({ - fields: S & PlansModuleSelect; - } & HookStrictSelect, PlansModuleSelect>); -} & Omit; - }; -}, Error, CreatePlansModuleInput["plansModule"]>, "mutationFn">): UseMutationResult<{ - createPlansModule: { - plansModule: InferSelectResult; - }; -}, Error, CreatePlansModuleInput["plansModule"]>; -export function useCreatePlansModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreatePlansModuleMutation( + params: { + selection: { + fields: S & PlansModuleSelect; + } & HookStrictSelect, PlansModuleSelect>; + } & Omit< + UseMutationOptions< + { + createPlansModule: { + plansModule: InferSelectResult; + }; + }, + Error, + CreatePlansModuleInput['plansModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlansModule: { + plansModule: InferSelectResult; + }; + }, + Error, + CreatePlansModuleInput['plansModule'] +>; +export function useCreatePlansModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: plansModuleMutationKeys.create(), - mutationFn: (data: CreatePlansModuleInput["plansModule"]) => getClient().plansModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreatePlansModuleInput['plansModule']) => + getClient() + .plansModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: plansModuleKeys.lists() + queryKey: plansModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.ts index 3a4e104b85..1734cac615 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.ts @@ -4,62 +4,88 @@ * 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"; +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; - }; -}, Error, CreatePrincipalAuthModuleInput["principalAuthModule"]>, "mutationFn">): UseMutationResult<{ - createPrincipalAuthModule: { - principalAuthModule: InferSelectResult; - }; -}, Error, CreatePrincipalAuthModuleInput["principalAuthModule"]>; -export function useCreatePrincipalAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + 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(), + mutationFn: (data: CreatePrincipalAuthModuleInput['principalAuthModule']) => + getClient() + .principalAuthModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: principalAuthModuleKeys.lists() + queryKey: principalAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateProfilesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateProfilesModuleMutation.ts index 01f97d9b6c..538d27637d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateProfilesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateProfilesModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { profilesModuleKeys } from "../query-keys"; -import { profilesModuleMutationKeys } from "../mutation-keys"; -import type { ProfilesModuleSelect, ProfilesModuleWithRelations, CreateProfilesModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ProfilesModuleSelect, ProfilesModuleWithRelations, CreateProfilesModuleInput } from "../../orm/input-types"; +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 { profilesModuleKeys } from '../query-keys'; +import { profilesModuleMutationKeys } from '../mutation-keys'; +import type { + ProfilesModuleSelect, + ProfilesModuleWithRelations, + CreateProfilesModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ProfilesModuleSelect, + ProfilesModuleWithRelations, + CreateProfilesModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ProfilesModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateProfilesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateProfilesModuleMutation(params: { - selection: ({ - fields: S & ProfilesModuleSelect; - } & HookStrictSelect, ProfilesModuleSelect>); -} & Omit; - }; -}, Error, CreateProfilesModuleInput["profilesModule"]>, "mutationFn">): UseMutationResult<{ - createProfilesModule: { - profilesModule: InferSelectResult; - }; -}, Error, CreateProfilesModuleInput["profilesModule"]>; -export function useCreateProfilesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateProfilesModuleMutation( + params: { + selection: { + fields: S & ProfilesModuleSelect; + } & HookStrictSelect, ProfilesModuleSelect>; + } & Omit< + UseMutationOptions< + { + createProfilesModule: { + profilesModule: InferSelectResult; + }; + }, + Error, + CreateProfilesModuleInput['profilesModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createProfilesModule: { + profilesModule: InferSelectResult; + }; + }, + Error, + CreateProfilesModuleInput['profilesModule'] +>; +export function useCreateProfilesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: profilesModuleMutationKeys.create(), - mutationFn: (data: CreateProfilesModuleInput["profilesModule"]) => getClient().profilesModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateProfilesModuleInput['profilesModule']) => + getClient() + .profilesModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: profilesModuleKeys.lists() + queryKey: profilesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRateLimitMetersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRateLimitMetersModuleMutation.ts index 13763cf1ea..04d5ed0dbd 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRateLimitMetersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRateLimitMetersModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { rateLimitMetersModuleKeys } from "../query-keys"; -import { rateLimitMetersModuleMutationKeys } from "../mutation-keys"; -import type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations, CreateRateLimitMetersModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations, CreateRateLimitMetersModuleInput } from "../../orm/input-types"; +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 { rateLimitMetersModuleKeys } from '../query-keys'; +import { rateLimitMetersModuleMutationKeys } from '../mutation-keys'; +import type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, + CreateRateLimitMetersModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, + CreateRateLimitMetersModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a RateLimitMetersModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRateLimitMetersModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRateLimitMetersModuleMutation(params: { - selection: ({ - fields: S & RateLimitMetersModuleSelect; - } & HookStrictSelect, RateLimitMetersModuleSelect>); -} & Omit; - }; -}, Error, CreateRateLimitMetersModuleInput["rateLimitMetersModule"]>, "mutationFn">): UseMutationResult<{ - createRateLimitMetersModule: { - rateLimitMetersModule: InferSelectResult; - }; -}, Error, CreateRateLimitMetersModuleInput["rateLimitMetersModule"]>; -export function useCreateRateLimitMetersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRateLimitMetersModuleMutation( + params: { + selection: { + fields: S & RateLimitMetersModuleSelect; + } & HookStrictSelect, RateLimitMetersModuleSelect>; + } & Omit< + UseMutationOptions< + { + createRateLimitMetersModule: { + rateLimitMetersModule: InferSelectResult; + }; + }, + Error, + CreateRateLimitMetersModuleInput['rateLimitMetersModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRateLimitMetersModule: { + rateLimitMetersModule: InferSelectResult; + }; + }, + Error, + CreateRateLimitMetersModuleInput['rateLimitMetersModule'] +>; +export function useCreateRateLimitMetersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rateLimitMetersModuleMutationKeys.create(), - mutationFn: (data: CreateRateLimitMetersModuleInput["rateLimitMetersModule"]) => getClient().rateLimitMetersModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRateLimitMetersModuleInput['rateLimitMetersModule']) => + getClient() + .rateLimitMetersModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: rateLimitMetersModuleKeys.lists() + queryKey: rateLimitMetersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRateLimitsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRateLimitsModuleMutation.ts index e9991c521c..fd7595ce7f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRateLimitsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRateLimitsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { rateLimitsModuleKeys } from "../query-keys"; -import { rateLimitsModuleMutationKeys } from "../mutation-keys"; -import type { RateLimitsModuleSelect, RateLimitsModuleWithRelations, CreateRateLimitsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitsModuleSelect, RateLimitsModuleWithRelations, CreateRateLimitsModuleInput } from "../../orm/input-types"; +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 { rateLimitsModuleKeys } from '../query-keys'; +import { rateLimitsModuleMutationKeys } from '../mutation-keys'; +import type { + RateLimitsModuleSelect, + RateLimitsModuleWithRelations, + CreateRateLimitsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RateLimitsModuleSelect, + RateLimitsModuleWithRelations, + CreateRateLimitsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a RateLimitsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRateLimitsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRateLimitsModuleMutation(params: { - selection: ({ - fields: S & RateLimitsModuleSelect; - } & HookStrictSelect, RateLimitsModuleSelect>); -} & Omit; - }; -}, Error, CreateRateLimitsModuleInput["rateLimitsModule"]>, "mutationFn">): UseMutationResult<{ - createRateLimitsModule: { - rateLimitsModule: InferSelectResult; - }; -}, Error, CreateRateLimitsModuleInput["rateLimitsModule"]>; -export function useCreateRateLimitsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRateLimitsModuleMutation( + params: { + selection: { + fields: S & RateLimitsModuleSelect; + } & HookStrictSelect, RateLimitsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createRateLimitsModule: { + rateLimitsModule: InferSelectResult; + }; + }, + Error, + CreateRateLimitsModuleInput['rateLimitsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRateLimitsModule: { + rateLimitsModule: InferSelectResult; + }; + }, + Error, + CreateRateLimitsModuleInput['rateLimitsModule'] +>; +export function useCreateRateLimitsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rateLimitsModuleMutationKeys.create(), - mutationFn: (data: CreateRateLimitsModuleInput["rateLimitsModule"]) => getClient().rateLimitsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRateLimitsModuleInput['rateLimitsModule']) => + getClient() + .rateLimitsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: rateLimitsModuleKeys.lists() + queryKey: rateLimitsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRealtimeModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRealtimeModuleMutation.ts index 611efc72b0..bdbe764421 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRealtimeModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRealtimeModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { realtimeModuleKeys } from "../query-keys"; -import { realtimeModuleMutationKeys } from "../mutation-keys"; -import type { RealtimeModuleSelect, RealtimeModuleWithRelations, CreateRealtimeModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RealtimeModuleSelect, RealtimeModuleWithRelations, CreateRealtimeModuleInput } from "../../orm/input-types"; +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 { realtimeModuleKeys } from '../query-keys'; +import { realtimeModuleMutationKeys } from '../mutation-keys'; +import type { + RealtimeModuleSelect, + RealtimeModuleWithRelations, + CreateRealtimeModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RealtimeModuleSelect, + RealtimeModuleWithRelations, + CreateRealtimeModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a RealtimeModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRealtimeModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRealtimeModuleMutation(params: { - selection: ({ - fields: S & RealtimeModuleSelect; - } & HookStrictSelect, RealtimeModuleSelect>); -} & Omit; - }; -}, Error, CreateRealtimeModuleInput["realtimeModule"]>, "mutationFn">): UseMutationResult<{ - createRealtimeModule: { - realtimeModule: InferSelectResult; - }; -}, Error, CreateRealtimeModuleInput["realtimeModule"]>; -export function useCreateRealtimeModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRealtimeModuleMutation( + params: { + selection: { + fields: S & RealtimeModuleSelect; + } & HookStrictSelect, RealtimeModuleSelect>; + } & Omit< + UseMutationOptions< + { + createRealtimeModule: { + realtimeModule: InferSelectResult; + }; + }, + Error, + CreateRealtimeModuleInput['realtimeModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRealtimeModule: { + realtimeModule: InferSelectResult; + }; + }, + Error, + CreateRealtimeModuleInput['realtimeModule'] +>; +export function useCreateRealtimeModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: realtimeModuleMutationKeys.create(), - mutationFn: (data: CreateRealtimeModuleInput["realtimeModule"]) => getClient().realtimeModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRealtimeModuleInput['realtimeModule']) => + getClient() + .realtimeModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: realtimeModuleKeys.lists() + queryKey: realtimeModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRelationProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRelationProvisionMutation.ts index ba1ca6c494..aa5d1e92b2 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRelationProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRelationProvisionMutation.ts @@ -11,16 +11,24 @@ * 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 { relationProvisionKeys } from "../query-keys"; -import { relationProvisionMutationKeys } from "../mutation-keys"; -import type { RelationProvisionSelect, RelationProvisionWithRelations, CreateRelationProvisionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RelationProvisionSelect, RelationProvisionWithRelations, CreateRelationProvisionInput } from "../../orm/input-types"; +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 { relationProvisionKeys } from '../query-keys'; +import { relationProvisionMutationKeys } from '../mutation-keys'; +import type { + RelationProvisionSelect, + RelationProvisionWithRelations, + CreateRelationProvisionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RelationProvisionSelect, + RelationProvisionWithRelations, + CreateRelationProvisionInput, +} from '../../orm/input-types'; /** * Provisions relational structure between tables. Supports four relation types: - RelationBelongsTo: adds a FK field on the source table referencing the target table (child perspective: "tasks belongs to projects" -> tasks.project_id). @@ -40,40 +48,58 @@ export type { RelationProvisionSelect, RelationProvisionWithRelations, CreateRel * mutate({ name: 'New item' }); * ``` */ -export function useCreateRelationProvisionMutation(params: { - selection: ({ - fields: S & RelationProvisionSelect; - } & HookStrictSelect, RelationProvisionSelect>); -} & Omit; - }; -}, Error, CreateRelationProvisionInput["relationProvision"]>, "mutationFn">): UseMutationResult<{ - createRelationProvision: { - relationProvision: InferSelectResult; - }; -}, Error, CreateRelationProvisionInput["relationProvision"]>; -export function useCreateRelationProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRelationProvisionMutation( + params: { + selection: { + fields: S & RelationProvisionSelect; + } & HookStrictSelect, RelationProvisionSelect>; + } & Omit< + UseMutationOptions< + { + createRelationProvision: { + relationProvision: InferSelectResult; + }; + }, + Error, + CreateRelationProvisionInput['relationProvision'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRelationProvision: { + relationProvision: InferSelectResult; + }; + }, + Error, + CreateRelationProvisionInput['relationProvision'] +>; +export function useCreateRelationProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: relationProvisionMutationKeys.create(), - mutationFn: (data: CreateRelationProvisionInput["relationProvision"]) => getClient().relationProvision.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRelationProvisionInput['relationProvision']) => + getClient() + .relationProvision.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: relationProvisionKeys.lists() + queryKey: relationProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateResourceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateResourceModuleMutation.ts index 9adc69d509..1be676eb4c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateResourceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateResourceModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { resourceModuleKeys } from "../query-keys"; -import { resourceModuleMutationKeys } from "../mutation-keys"; -import type { ResourceModuleSelect, ResourceModuleWithRelations, CreateResourceModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceModuleSelect, ResourceModuleWithRelations, CreateResourceModuleInput } from "../../orm/input-types"; +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 { resourceModuleKeys } from '../query-keys'; +import { resourceModuleMutationKeys } from '../mutation-keys'; +import type { + ResourceModuleSelect, + ResourceModuleWithRelations, + CreateResourceModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceModuleSelect, + ResourceModuleWithRelations, + CreateResourceModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a ResourceModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateResourceModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateResourceModuleMutation(params: { - selection: ({ - fields: S & ResourceModuleSelect; - } & HookStrictSelect, ResourceModuleSelect>); -} & Omit; - }; -}, Error, CreateResourceModuleInput["resourceModule"]>, "mutationFn">): UseMutationResult<{ - createResourceModule: { - resourceModule: InferSelectResult; - }; -}, Error, CreateResourceModuleInput["resourceModule"]>; -export function useCreateResourceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateResourceModuleMutation( + params: { + selection: { + fields: S & ResourceModuleSelect; + } & HookStrictSelect, ResourceModuleSelect>; + } & Omit< + UseMutationOptions< + { + createResourceModule: { + resourceModule: InferSelectResult; + }; + }, + Error, + CreateResourceModuleInput['resourceModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createResourceModule: { + resourceModule: InferSelectResult; + }; + }, + Error, + CreateResourceModuleInput['resourceModule'] +>; +export function useCreateResourceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceModuleMutationKeys.create(), - mutationFn: (data: CreateResourceModuleInput["resourceModule"]) => getClient().resourceModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateResourceModuleInput['resourceModule']) => + getClient() + .resourceModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: resourceModuleKeys.lists() + queryKey: resourceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRlsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRlsModuleMutation.ts index ff096b55d1..741bf4139c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRlsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRlsModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { rlsModuleKeys } from "../query-keys"; -import { rlsModuleMutationKeys } from "../mutation-keys"; -import type { RlsModuleSelect, RlsModuleWithRelations, CreateRlsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsModuleSelect, RlsModuleWithRelations, CreateRlsModuleInput } from "../../orm/input-types"; +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 { rlsModuleKeys } from '../query-keys'; +import { rlsModuleMutationKeys } from '../mutation-keys'; +import type { + RlsModuleSelect, + RlsModuleWithRelations, + CreateRlsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RlsModuleSelect, + RlsModuleWithRelations, + CreateRlsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a RlsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRlsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRlsModuleMutation(params: { - selection: ({ - fields: S & RlsModuleSelect; - } & HookStrictSelect, RlsModuleSelect>); -} & Omit; - }; -}, Error, CreateRlsModuleInput["rlsModule"]>, "mutationFn">): UseMutationResult<{ - createRlsModule: { - rlsModule: InferSelectResult; - }; -}, Error, CreateRlsModuleInput["rlsModule"]>; -export function useCreateRlsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRlsModuleMutation( + params: { + selection: { + fields: S & RlsModuleSelect; + } & HookStrictSelect, RlsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createRlsModule: { + rlsModule: InferSelectResult; + }; + }, + Error, + CreateRlsModuleInput['rlsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRlsModule: { + rlsModule: InferSelectResult; + }; + }, + Error, + CreateRlsModuleInput['rlsModule'] +>; +export function useCreateRlsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rlsModuleMutationKeys.create(), - mutationFn: (data: CreateRlsModuleInput["rlsModule"]) => getClient().rlsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRlsModuleInput['rlsModule']) => + getClient() + .rlsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: rlsModuleKeys.lists() + queryKey: rlsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRouteModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRouteModuleMutation.ts index 07aa21e051..9be35da4c6 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateRouteModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateRouteModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { routeModuleKeys } from "../query-keys"; -import { routeModuleMutationKeys } from "../mutation-keys"; -import type { RouteModuleSelect, RouteModuleWithRelations, CreateRouteModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteModuleSelect, RouteModuleWithRelations, CreateRouteModuleInput } from "../../orm/input-types"; +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 { routeModuleKeys } from '../query-keys'; +import { routeModuleMutationKeys } from '../mutation-keys'; +import type { + RouteModuleSelect, + RouteModuleWithRelations, + CreateRouteModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RouteModuleSelect, + RouteModuleWithRelations, + CreateRouteModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a RouteModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRouteModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRouteModuleMutation(params: { - selection: ({ - fields: S & RouteModuleSelect; - } & HookStrictSelect, RouteModuleSelect>); -} & Omit; - }; -}, Error, CreateRouteModuleInput["routeModule"]>, "mutationFn">): UseMutationResult<{ - createRouteModule: { - routeModule: InferSelectResult; - }; -}, Error, CreateRouteModuleInput["routeModule"]>; -export function useCreateRouteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRouteModuleMutation( + params: { + selection: { + fields: S & RouteModuleSelect; + } & HookStrictSelect, RouteModuleSelect>; + } & Omit< + UseMutationOptions< + { + createRouteModule: { + routeModule: InferSelectResult; + }; + }, + Error, + CreateRouteModuleInput['routeModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRouteModule: { + routeModule: InferSelectResult; + }; + }, + Error, + CreateRouteModuleInput['routeModule'] +>; +export function useCreateRouteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeModuleMutationKeys.create(), - mutationFn: (data: CreateRouteModuleInput["routeModule"]) => getClient().routeModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRouteModuleInput['routeModule']) => + getClient() + .routeModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: routeModuleKeys.lists() + queryKey: routeModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateSecureTableProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateSecureTableProvisionMutation.ts index 12d90be3c6..843ca5fef4 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateSecureTableProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateSecureTableProvisionMutation.ts @@ -4,62 +4,88 @@ * 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 { secureTableProvisionKeys } from "../query-keys"; -import { secureTableProvisionMutationKeys } from "../mutation-keys"; -import type { SecureTableProvisionSelect, SecureTableProvisionWithRelations, CreateSecureTableProvisionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SecureTableProvisionSelect, SecureTableProvisionWithRelations, CreateSecureTableProvisionInput } from "../../orm/input-types"; +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 { secureTableProvisionKeys } from '../query-keys'; +import { secureTableProvisionMutationKeys } from '../mutation-keys'; +import type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, + CreateSecureTableProvisionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, + CreateSecureTableProvisionInput, +} from '../../orm/input-types'; /** * 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. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSecureTableProvisionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSecureTableProvisionMutation(params: { - selection: ({ - fields: S & SecureTableProvisionSelect; - } & HookStrictSelect, SecureTableProvisionSelect>); -} & Omit; - }; -}, Error, CreateSecureTableProvisionInput["secureTableProvision"]>, "mutationFn">): UseMutationResult<{ - createSecureTableProvision: { - secureTableProvision: InferSelectResult; - }; -}, Error, CreateSecureTableProvisionInput["secureTableProvision"]>; -export function useCreateSecureTableProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSecureTableProvisionMutation( + params: { + selection: { + fields: S & SecureTableProvisionSelect; + } & HookStrictSelect, SecureTableProvisionSelect>; + } & Omit< + UseMutationOptions< + { + createSecureTableProvision: { + secureTableProvision: InferSelectResult; + }; + }, + Error, + CreateSecureTableProvisionInput['secureTableProvision'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSecureTableProvision: { + secureTableProvision: InferSelectResult; + }; + }, + Error, + CreateSecureTableProvisionInput['secureTableProvision'] +>; +export function useCreateSecureTableProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: secureTableProvisionMutationKeys.create(), - mutationFn: (data: CreateSecureTableProvisionInput["secureTableProvision"]) => getClient().secureTableProvision.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSecureTableProvisionInput['secureTableProvision']) => + getClient() + .secureTableProvision.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: secureTableProvisionKeys.lists() + queryKey: secureTableProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateSessionSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateSessionSecretsModuleMutation.ts index 0354071013..d4447ff4b9 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateSessionSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateSessionSecretsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { sessionSecretsModuleKeys } from "../query-keys"; -import { sessionSecretsModuleMutationKeys } from "../mutation-keys"; -import type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations, CreateSessionSecretsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations, CreateSessionSecretsModuleInput } from "../../orm/input-types"; +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 { sessionSecretsModuleKeys } from '../query-keys'; +import { sessionSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, + CreateSessionSecretsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, + CreateSessionSecretsModuleInput, +} from '../../orm/input-types'; /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSessionSecretsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSessionSecretsModuleMutation(params: { - selection: ({ - fields: S & SessionSecretsModuleSelect; - } & HookStrictSelect, SessionSecretsModuleSelect>); -} & Omit; - }; -}, Error, CreateSessionSecretsModuleInput["sessionSecretsModule"]>, "mutationFn">): UseMutationResult<{ - createSessionSecretsModule: { - sessionSecretsModule: InferSelectResult; - }; -}, Error, CreateSessionSecretsModuleInput["sessionSecretsModule"]>; -export function useCreateSessionSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSessionSecretsModuleMutation( + params: { + selection: { + fields: S & SessionSecretsModuleSelect; + } & HookStrictSelect, SessionSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createSessionSecretsModule: { + sessionSecretsModule: InferSelectResult; + }; + }, + Error, + CreateSessionSecretsModuleInput['sessionSecretsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSessionSecretsModule: { + sessionSecretsModule: InferSelectResult; + }; + }, + Error, + CreateSessionSecretsModuleInput['sessionSecretsModule'] +>; +export function useCreateSessionSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: sessionSecretsModuleMutationKeys.create(), - mutationFn: (data: CreateSessionSecretsModuleInput["sessionSecretsModule"]) => getClient().sessionSecretsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSessionSecretsModuleInput['sessionSecretsModule']) => + getClient() + .sessionSecretsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: sessionSecretsModuleKeys.lists() + queryKey: sessionSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateSessionsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateSessionsModuleMutation.ts index 5f84ab7e11..6fd5bda752 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateSessionsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateSessionsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { sessionsModuleKeys } from "../query-keys"; -import { sessionsModuleMutationKeys } from "../mutation-keys"; -import type { SessionsModuleSelect, SessionsModuleWithRelations, CreateSessionsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionsModuleSelect, SessionsModuleWithRelations, CreateSessionsModuleInput } from "../../orm/input-types"; +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 { sessionsModuleKeys } from '../query-keys'; +import { sessionsModuleMutationKeys } from '../mutation-keys'; +import type { + SessionsModuleSelect, + SessionsModuleWithRelations, + CreateSessionsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SessionsModuleSelect, + SessionsModuleWithRelations, + CreateSessionsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a SessionsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSessionsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSessionsModuleMutation(params: { - selection: ({ - fields: S & SessionsModuleSelect; - } & HookStrictSelect, SessionsModuleSelect>); -} & Omit; - }; -}, Error, CreateSessionsModuleInput["sessionsModule"]>, "mutationFn">): UseMutationResult<{ - createSessionsModule: { - sessionsModule: InferSelectResult; - }; -}, Error, CreateSessionsModuleInput["sessionsModule"]>; -export function useCreateSessionsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSessionsModuleMutation( + params: { + selection: { + fields: S & SessionsModuleSelect; + } & HookStrictSelect, SessionsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createSessionsModule: { + sessionsModule: InferSelectResult; + }; + }, + Error, + CreateSessionsModuleInput['sessionsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSessionsModule: { + sessionsModule: InferSelectResult; + }; + }, + Error, + CreateSessionsModuleInput['sessionsModule'] +>; +export function useCreateSessionsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: sessionsModuleMutationKeys.create(), - mutationFn: (data: CreateSessionsModuleInput["sessionsModule"]) => getClient().sessionsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSessionsModuleInput['sessionsModule']) => + getClient() + .sessionsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: sessionsModuleKeys.lists() + queryKey: sessionsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateSiteSurfaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateSiteSurfaceModuleMutation.ts index 956e1b0a93..970ed5a3e6 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateSiteSurfaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateSiteSurfaceModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { siteSurfaceModuleKeys } from "../query-keys"; -import { siteSurfaceModuleMutationKeys } from "../mutation-keys"; -import type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations, CreateSiteSurfaceModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations, CreateSiteSurfaceModuleInput } from "../../orm/input-types"; +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 { siteSurfaceModuleKeys } from '../query-keys'; +import { siteSurfaceModuleMutationKeys } from '../mutation-keys'; +import type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, + CreateSiteSurfaceModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, + CreateSiteSurfaceModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a SiteSurfaceModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateSiteSurfaceModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateSiteSurfaceModuleMutation(params: { - selection: ({ - fields: S & SiteSurfaceModuleSelect; - } & HookStrictSelect, SiteSurfaceModuleSelect>); -} & Omit; - }; -}, Error, CreateSiteSurfaceModuleInput["siteSurfaceModule"]>, "mutationFn">): UseMutationResult<{ - createSiteSurfaceModule: { - siteSurfaceModule: InferSelectResult; - }; -}, Error, CreateSiteSurfaceModuleInput["siteSurfaceModule"]>; -export function useCreateSiteSurfaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateSiteSurfaceModuleMutation( + params: { + selection: { + fields: S & SiteSurfaceModuleSelect; + } & HookStrictSelect, SiteSurfaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + createSiteSurfaceModule: { + siteSurfaceModule: InferSelectResult; + }; + }, + Error, + CreateSiteSurfaceModuleInput['siteSurfaceModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSiteSurfaceModule: { + siteSurfaceModule: InferSelectResult; + }; + }, + Error, + CreateSiteSurfaceModuleInput['siteSurfaceModule'] +>; +export function useCreateSiteSurfaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteSurfaceModuleMutationKeys.create(), - mutationFn: (data: CreateSiteSurfaceModuleInput["siteSurfaceModule"]) => getClient().siteSurfaceModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateSiteSurfaceModuleInput['siteSurfaceModule']) => + getClient() + .siteSurfaceModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: siteSurfaceModuleKeys.lists() + queryKey: siteSurfaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateStorageLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateStorageLogModuleMutation.ts index dc57f1d7df..e0b1aeb598 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateStorageLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateStorageLogModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { storageLogModuleKeys } from "../query-keys"; -import { storageLogModuleMutationKeys } from "../mutation-keys"; -import type { StorageLogModuleSelect, StorageLogModuleWithRelations, CreateStorageLogModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageLogModuleSelect, StorageLogModuleWithRelations, CreateStorageLogModuleInput } from "../../orm/input-types"; +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 { storageLogModuleKeys } from '../query-keys'; +import { storageLogModuleMutationKeys } from '../mutation-keys'; +import type { + StorageLogModuleSelect, + StorageLogModuleWithRelations, + CreateStorageLogModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + StorageLogModuleSelect, + StorageLogModuleWithRelations, + CreateStorageLogModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a StorageLogModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateStorageLogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateStorageLogModuleMutation(params: { - selection: ({ - fields: S & StorageLogModuleSelect; - } & HookStrictSelect, StorageLogModuleSelect>); -} & Omit; - }; -}, Error, CreateStorageLogModuleInput["storageLogModule"]>, "mutationFn">): UseMutationResult<{ - createStorageLogModule: { - storageLogModule: InferSelectResult; - }; -}, Error, CreateStorageLogModuleInput["storageLogModule"]>; -export function useCreateStorageLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateStorageLogModuleMutation( + params: { + selection: { + fields: S & StorageLogModuleSelect; + } & HookStrictSelect, StorageLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + createStorageLogModule: { + storageLogModule: InferSelectResult; + }; + }, + Error, + CreateStorageLogModuleInput['storageLogModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createStorageLogModule: { + storageLogModule: InferSelectResult; + }; + }, + Error, + CreateStorageLogModuleInput['storageLogModule'] +>; +export function useCreateStorageLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storageLogModuleMutationKeys.create(), - mutationFn: (data: CreateStorageLogModuleInput["storageLogModule"]) => getClient().storageLogModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateStorageLogModuleInput['storageLogModule']) => + getClient() + .storageLogModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: storageLogModuleKeys.lists() + queryKey: storageLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateStorageModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateStorageModuleMutation.ts index cb3c503f3d..3c9dd33945 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateStorageModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateStorageModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { storageModuleKeys } from "../query-keys"; -import { storageModuleMutationKeys } from "../mutation-keys"; -import type { StorageModuleSelect, StorageModuleWithRelations, CreateStorageModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageModuleSelect, StorageModuleWithRelations, CreateStorageModuleInput } from "../../orm/input-types"; +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 { storageModuleKeys } from '../query-keys'; +import { storageModuleMutationKeys } from '../mutation-keys'; +import type { + StorageModuleSelect, + StorageModuleWithRelations, + CreateStorageModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + StorageModuleSelect, + StorageModuleWithRelations, + CreateStorageModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a StorageModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateStorageModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateStorageModuleMutation(params: { - selection: ({ - fields: S & StorageModuleSelect; - } & HookStrictSelect, StorageModuleSelect>); -} & Omit; - }; -}, Error, CreateStorageModuleInput["storageModule"]>, "mutationFn">): UseMutationResult<{ - createStorageModule: { - storageModule: InferSelectResult; - }; -}, Error, CreateStorageModuleInput["storageModule"]>; -export function useCreateStorageModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateStorageModuleMutation( + params: { + selection: { + fields: S & StorageModuleSelect; + } & HookStrictSelect, StorageModuleSelect>; + } & Omit< + UseMutationOptions< + { + createStorageModule: { + storageModule: InferSelectResult; + }; + }, + Error, + CreateStorageModuleInput['storageModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createStorageModule: { + storageModule: InferSelectResult; + }; + }, + Error, + CreateStorageModuleInput['storageModule'] +>; +export function useCreateStorageModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storageModuleMutationKeys.create(), - mutationFn: (data: CreateStorageModuleInput["storageModule"]) => getClient().storageModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateStorageModuleInput['storageModule']) => + getClient() + .storageModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: storageModuleKeys.lists() + queryKey: storageModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateTransferLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateTransferLogModuleMutation.ts index 1ad44ce0ad..b4fbccfdbb 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateTransferLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateTransferLogModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { transferLogModuleKeys } from "../query-keys"; -import { transferLogModuleMutationKeys } from "../mutation-keys"; -import type { TransferLogModuleSelect, TransferLogModuleWithRelations, CreateTransferLogModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TransferLogModuleSelect, TransferLogModuleWithRelations, CreateTransferLogModuleInput } from "../../orm/input-types"; +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 { transferLogModuleKeys } from '../query-keys'; +import { transferLogModuleMutationKeys } from '../mutation-keys'; +import type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, + CreateTransferLogModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, + CreateTransferLogModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a TransferLogModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateTransferLogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateTransferLogModuleMutation(params: { - selection: ({ - fields: S & TransferLogModuleSelect; - } & HookStrictSelect, TransferLogModuleSelect>); -} & Omit; - }; -}, Error, CreateTransferLogModuleInput["transferLogModule"]>, "mutationFn">): UseMutationResult<{ - createTransferLogModule: { - transferLogModule: InferSelectResult; - }; -}, Error, CreateTransferLogModuleInput["transferLogModule"]>; -export function useCreateTransferLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateTransferLogModuleMutation( + params: { + selection: { + fields: S & TransferLogModuleSelect; + } & HookStrictSelect, TransferLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + createTransferLogModule: { + transferLogModule: InferSelectResult; + }; + }, + Error, + CreateTransferLogModuleInput['transferLogModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createTransferLogModule: { + transferLogModule: InferSelectResult; + }; + }, + Error, + CreateTransferLogModuleInput['transferLogModule'] +>; +export function useCreateTransferLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: transferLogModuleMutationKeys.create(), - mutationFn: (data: CreateTransferLogModuleInput["transferLogModule"]) => getClient().transferLogModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateTransferLogModuleInput['transferLogModule']) => + getClient() + .transferLogModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: transferLogModuleKeys.lists() + queryKey: transferLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserAuthModuleMutation.ts index 300436e7a7..edc15ead9e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserAuthModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { userAuthModuleKeys } from "../query-keys"; -import { userAuthModuleMutationKeys } from "../mutation-keys"; -import type { UserAuthModuleSelect, UserAuthModuleWithRelations, CreateUserAuthModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserAuthModuleSelect, UserAuthModuleWithRelations, CreateUserAuthModuleInput } from "../../orm/input-types"; +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 { userAuthModuleKeys } from '../query-keys'; +import { userAuthModuleMutationKeys } from '../mutation-keys'; +import type { + UserAuthModuleSelect, + UserAuthModuleWithRelations, + CreateUserAuthModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserAuthModuleSelect, + UserAuthModuleWithRelations, + CreateUserAuthModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a UserAuthModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateUserAuthModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateUserAuthModuleMutation(params: { - selection: ({ - fields: S & UserAuthModuleSelect; - } & HookStrictSelect, UserAuthModuleSelect>); -} & Omit; - }; -}, Error, CreateUserAuthModuleInput["userAuthModule"]>, "mutationFn">): UseMutationResult<{ - createUserAuthModule: { - userAuthModule: InferSelectResult; - }; -}, Error, CreateUserAuthModuleInput["userAuthModule"]>; -export function useCreateUserAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateUserAuthModuleMutation( + params: { + selection: { + fields: S & UserAuthModuleSelect; + } & HookStrictSelect, UserAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + createUserAuthModule: { + userAuthModule: InferSelectResult; + }; + }, + Error, + CreateUserAuthModuleInput['userAuthModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createUserAuthModule: { + userAuthModule: InferSelectResult; + }; + }, + Error, + CreateUserAuthModuleInput['userAuthModule'] +>; +export function useCreateUserAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userAuthModuleMutationKeys.create(), - mutationFn: (data: CreateUserAuthModuleInput["userAuthModule"]) => getClient().userAuthModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateUserAuthModuleInput['userAuthModule']) => + getClient() + .userAuthModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: userAuthModuleKeys.lists() + queryKey: userAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserCredentialsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserCredentialsModuleMutation.ts index bb12e2b955..0211ebe168 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserCredentialsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserCredentialsModuleMutation.ts @@ -6,16 +6,24 @@ * 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 { userCredentialsModuleKeys } from "../query-keys"; -import { userCredentialsModuleMutationKeys } from "../mutation-keys"; -import type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations, CreateUserCredentialsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations, CreateUserCredentialsModuleInput } from "../../orm/input-types"; +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 { userCredentialsModuleKeys } from '../query-keys'; +import { userCredentialsModuleMutationKeys } from '../mutation-keys'; +import type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, + CreateUserCredentialsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, + CreateUserCredentialsModuleInput, +} from '../../orm/input-types'; /** * Per-user bcrypt credential store (password hashes, API key hashes). Always user-scoped with AuthzDirectOwner RLS. Consumed by user_auth_module, @@ -30,40 +38,58 @@ export type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations, C * mutate({ name: 'New item' }); * ``` */ -export function useCreateUserCredentialsModuleMutation(params: { - selection: ({ - fields: S & UserCredentialsModuleSelect; - } & HookStrictSelect, UserCredentialsModuleSelect>); -} & Omit; - }; -}, Error, CreateUserCredentialsModuleInput["userCredentialsModule"]>, "mutationFn">): UseMutationResult<{ - createUserCredentialsModule: { - userCredentialsModule: InferSelectResult; - }; -}, Error, CreateUserCredentialsModuleInput["userCredentialsModule"]>; -export function useCreateUserCredentialsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateUserCredentialsModuleMutation( + params: { + selection: { + fields: S & UserCredentialsModuleSelect; + } & HookStrictSelect, UserCredentialsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createUserCredentialsModule: { + userCredentialsModule: InferSelectResult; + }; + }, + Error, + CreateUserCredentialsModuleInput['userCredentialsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createUserCredentialsModule: { + userCredentialsModule: InferSelectResult; + }; + }, + Error, + CreateUserCredentialsModuleInput['userCredentialsModule'] +>; +export function useCreateUserCredentialsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userCredentialsModuleMutationKeys.create(), - mutationFn: (data: CreateUserCredentialsModuleInput["userCredentialsModule"]) => getClient().userCredentialsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateUserCredentialsModuleInput['userCredentialsModule']) => + getClient() + .userCredentialsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: userCredentialsModuleKeys.lists() + queryKey: userCredentialsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserSettingsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserSettingsModuleMutation.ts index 9974dbd6fa..c22cdb20a2 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserSettingsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserSettingsModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { userSettingsModuleKeys } from "../query-keys"; -import { userSettingsModuleMutationKeys } from "../mutation-keys"; -import type { UserSettingsModuleSelect, UserSettingsModuleWithRelations, CreateUserSettingsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSettingsModuleSelect, UserSettingsModuleWithRelations, CreateUserSettingsModuleInput } from "../../orm/input-types"; +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 { userSettingsModuleKeys } from '../query-keys'; +import { userSettingsModuleMutationKeys } from '../mutation-keys'; +import type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, + CreateUserSettingsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, + CreateUserSettingsModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a UserSettingsModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateUserSettingsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateUserSettingsModuleMutation(params: { - selection: ({ - fields: S & UserSettingsModuleSelect; - } & HookStrictSelect, UserSettingsModuleSelect>); -} & Omit; - }; -}, Error, CreateUserSettingsModuleInput["userSettingsModule"]>, "mutationFn">): UseMutationResult<{ - createUserSettingsModule: { - userSettingsModule: InferSelectResult; - }; -}, Error, CreateUserSettingsModuleInput["userSettingsModule"]>; -export function useCreateUserSettingsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateUserSettingsModuleMutation( + params: { + selection: { + fields: S & UserSettingsModuleSelect; + } & HookStrictSelect, UserSettingsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createUserSettingsModule: { + userSettingsModule: InferSelectResult; + }; + }, + Error, + CreateUserSettingsModuleInput['userSettingsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createUserSettingsModule: { + userSettingsModule: InferSelectResult; + }; + }, + Error, + CreateUserSettingsModuleInput['userSettingsModule'] +>; +export function useCreateUserSettingsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userSettingsModuleMutationKeys.create(), - mutationFn: (data: CreateUserSettingsModuleInput["userSettingsModule"]) => getClient().userSettingsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateUserSettingsModuleInput['userSettingsModule']) => + getClient() + .userSettingsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: userSettingsModuleKeys.lists() + queryKey: userSettingsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserStateModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserStateModuleMutation.ts index 57b4d0081a..96e01061b5 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserStateModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUserStateModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { userStateModuleKeys } from "../query-keys"; -import { userStateModuleMutationKeys } from "../mutation-keys"; -import type { UserStateModuleSelect, UserStateModuleWithRelations, CreateUserStateModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserStateModuleSelect, UserStateModuleWithRelations, CreateUserStateModuleInput } from "../../orm/input-types"; +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 { userStateModuleKeys } from '../query-keys'; +import { userStateModuleMutationKeys } from '../mutation-keys'; +import type { + UserStateModuleSelect, + UserStateModuleWithRelations, + CreateUserStateModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserStateModuleSelect, + UserStateModuleWithRelations, + CreateUserStateModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a UserStateModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateUserStateModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateUserStateModuleMutation(params: { - selection: ({ - fields: S & UserStateModuleSelect; - } & HookStrictSelect, UserStateModuleSelect>); -} & Omit; - }; -}, Error, CreateUserStateModuleInput["userStateModule"]>, "mutationFn">): UseMutationResult<{ - createUserStateModule: { - userStateModule: InferSelectResult; - }; -}, Error, CreateUserStateModuleInput["userStateModule"]>; -export function useCreateUserStateModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateUserStateModuleMutation( + params: { + selection: { + fields: S & UserStateModuleSelect; + } & HookStrictSelect, UserStateModuleSelect>; + } & Omit< + UseMutationOptions< + { + createUserStateModule: { + userStateModule: InferSelectResult; + }; + }, + Error, + CreateUserStateModuleInput['userStateModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createUserStateModule: { + userStateModule: InferSelectResult; + }; + }, + Error, + CreateUserStateModuleInput['userStateModule'] +>; +export function useCreateUserStateModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userStateModuleMutationKeys.create(), - mutationFn: (data: CreateUserStateModuleInput["userStateModule"]) => getClient().userStateModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateUserStateModuleInput['userStateModule']) => + getClient() + .userStateModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: userStateModuleKeys.lists() + queryKey: userStateModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUsersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUsersModuleMutation.ts index a471b40874..bc8efbc995 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateUsersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateUsersModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { usersModuleKeys } from "../query-keys"; -import { usersModuleMutationKeys } from "../mutation-keys"; -import type { UsersModuleSelect, UsersModuleWithRelations, CreateUsersModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UsersModuleSelect, UsersModuleWithRelations, CreateUsersModuleInput } from "../../orm/input-types"; +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 { usersModuleKeys } from '../query-keys'; +import { usersModuleMutationKeys } from '../mutation-keys'; +import type { + UsersModuleSelect, + UsersModuleWithRelations, + CreateUsersModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UsersModuleSelect, + UsersModuleWithRelations, + CreateUsersModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a UsersModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateUsersModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateUsersModuleMutation(params: { - selection: ({ - fields: S & UsersModuleSelect; - } & HookStrictSelect, UsersModuleSelect>); -} & Omit; - }; -}, Error, CreateUsersModuleInput["usersModule"]>, "mutationFn">): UseMutationResult<{ - createUsersModule: { - usersModule: InferSelectResult; - }; -}, Error, CreateUsersModuleInput["usersModule"]>; -export function useCreateUsersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateUsersModuleMutation( + params: { + selection: { + fields: S & UsersModuleSelect; + } & HookStrictSelect, UsersModuleSelect>; + } & Omit< + UseMutationOptions< + { + createUsersModule: { + usersModule: InferSelectResult; + }; + }, + Error, + CreateUsersModuleInput['usersModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createUsersModule: { + usersModule: InferSelectResult; + }; + }, + Error, + CreateUsersModuleInput['usersModule'] +>; +export function useCreateUsersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: usersModuleMutationKeys.create(), - mutationFn: (data: CreateUsersModuleInput["usersModule"]) => getClient().usersModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateUsersModuleInput['usersModule']) => + getClient() + .usersModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: usersModuleKeys.lists() + queryKey: usersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebauthnAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebauthnAuthModuleMutation.ts index f213641b1a..12c4ac3be1 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebauthnAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebauthnAuthModuleMutation.ts @@ -4,62 +4,88 @@ * 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 { webauthnAuthModuleKeys } from "../query-keys"; -import { webauthnAuthModuleMutationKeys } from "../mutation-keys"; -import type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations, CreateWebauthnAuthModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations, CreateWebauthnAuthModuleInput } from "../../orm/input-types"; +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 { webauthnAuthModuleKeys } from '../query-keys'; +import { webauthnAuthModuleMutationKeys } from '../mutation-keys'; +import type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, + CreateWebauthnAuthModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, + CreateWebauthnAuthModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a WebauthnAuthModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateWebauthnAuthModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateWebauthnAuthModuleMutation(params: { - selection: ({ - fields: S & WebauthnAuthModuleSelect; - } & HookStrictSelect, WebauthnAuthModuleSelect>); -} & Omit; - }; -}, Error, CreateWebauthnAuthModuleInput["webauthnAuthModule"]>, "mutationFn">): UseMutationResult<{ - createWebauthnAuthModule: { - webauthnAuthModule: InferSelectResult; - }; -}, Error, CreateWebauthnAuthModuleInput["webauthnAuthModule"]>; -export function useCreateWebauthnAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateWebauthnAuthModuleMutation( + params: { + selection: { + fields: S & WebauthnAuthModuleSelect; + } & HookStrictSelect, WebauthnAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + createWebauthnAuthModule: { + webauthnAuthModule: InferSelectResult; + }; + }, + Error, + CreateWebauthnAuthModuleInput['webauthnAuthModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createWebauthnAuthModule: { + webauthnAuthModule: InferSelectResult; + }; + }, + Error, + CreateWebauthnAuthModuleInput['webauthnAuthModule'] +>; +export function useCreateWebauthnAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnAuthModuleMutationKeys.create(), - mutationFn: (data: CreateWebauthnAuthModuleInput["webauthnAuthModule"]) => getClient().webauthnAuthModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateWebauthnAuthModuleInput['webauthnAuthModule']) => + getClient() + .webauthnAuthModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: webauthnAuthModuleKeys.lists() + queryKey: webauthnAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebauthnCredentialsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebauthnCredentialsModuleMutation.ts index 43cb502ca1..fc52669adc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebauthnCredentialsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebauthnCredentialsModuleMutation.ts @@ -4,62 +4,94 @@ * 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 { webauthnCredentialsModuleKeys } from "../query-keys"; -import { webauthnCredentialsModuleMutationKeys } from "../mutation-keys"; -import type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations, CreateWebauthnCredentialsModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations, CreateWebauthnCredentialsModuleInput } from "../../orm/input-types"; +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 { webauthnCredentialsModuleKeys } from '../query-keys'; +import { webauthnCredentialsModuleMutationKeys } from '../mutation-keys'; +import type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, + CreateWebauthnCredentialsModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, + CreateWebauthnCredentialsModuleInput, +} from '../../orm/input-types'; /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateWebauthnCredentialsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateWebauthnCredentialsModuleMutation(params: { - selection: ({ - fields: S & WebauthnCredentialsModuleSelect; - } & HookStrictSelect, WebauthnCredentialsModuleSelect>); -} & Omit; - }; -}, Error, CreateWebauthnCredentialsModuleInput["webauthnCredentialsModule"]>, "mutationFn">): UseMutationResult<{ - createWebauthnCredentialsModule: { - webauthnCredentialsModule: InferSelectResult; - }; -}, Error, CreateWebauthnCredentialsModuleInput["webauthnCredentialsModule"]>; -export function useCreateWebauthnCredentialsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateWebauthnCredentialsModuleMutation< + S extends WebauthnCredentialsModuleSelect, +>( + params: { + selection: { + fields: S & WebauthnCredentialsModuleSelect; + } & HookStrictSelect, WebauthnCredentialsModuleSelect>; + } & Omit< + UseMutationOptions< + { + createWebauthnCredentialsModule: { + webauthnCredentialsModule: InferSelectResult; + }; + }, + Error, + CreateWebauthnCredentialsModuleInput['webauthnCredentialsModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createWebauthnCredentialsModule: { + webauthnCredentialsModule: InferSelectResult; + }; + }, + Error, + CreateWebauthnCredentialsModuleInput['webauthnCredentialsModule'] +>; +export function useCreateWebauthnCredentialsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateWebauthnCredentialsModuleInput['webauthnCredentialsModule'] + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnCredentialsModuleMutationKeys.create(), - mutationFn: (data: CreateWebauthnCredentialsModuleInput["webauthnCredentialsModule"]) => getClient().webauthnCredentialsModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateWebauthnCredentialsModuleInput['webauthnCredentialsModule']) => + getClient() + .webauthnCredentialsModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: webauthnCredentialsModuleKeys.lists() + queryKey: webauthnCredentialsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebhookModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebhookModuleMutation.ts index 9accd1b2f8..569f3e3651 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebhookModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateWebhookModuleMutation.ts @@ -4,62 +4,85 @@ * 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 { webhookModuleKeys } from "../query-keys"; -import { webhookModuleMutationKeys } from "../mutation-keys"; -import type { WebhookModuleSelect, WebhookModuleWithRelations, CreateWebhookModuleInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookModuleSelect, WebhookModuleWithRelations, CreateWebhookModuleInput } from "../../orm/input-types"; +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 { webhookModuleKeys } from '../query-keys'; +import { webhookModuleMutationKeys } from '../mutation-keys'; +import type { + WebhookModuleSelect, + WebhookModuleWithRelations, + CreateWebhookModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebhookModuleSelect, + WebhookModuleWithRelations, + CreateWebhookModuleInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a WebhookModule - * + * * @example * ```tsx * const { mutate, isPending } = useCreateWebhookModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateWebhookModuleMutation(params: { - selection: ({ - fields: S & WebhookModuleSelect; - } & HookStrictSelect, WebhookModuleSelect>); -} & Omit; - }; -}, Error, CreateWebhookModuleInput["webhookModule"]>, "mutationFn">): UseMutationResult<{ - createWebhookModule: { - webhookModule: InferSelectResult; - }; -}, Error, CreateWebhookModuleInput["webhookModule"]>; -export function useCreateWebhookModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateWebhookModuleMutation( + params: { + selection: { + fields: S & WebhookModuleSelect; + } & HookStrictSelect, WebhookModuleSelect>; + } & Omit< + UseMutationOptions< + { + createWebhookModule: { + webhookModule: InferSelectResult; + }; + }, + Error, + CreateWebhookModuleInput['webhookModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createWebhookModule: { + webhookModule: InferSelectResult; + }; + }, + Error, + CreateWebhookModuleInput['webhookModule'] +>; +export function useCreateWebhookModuleMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookModuleMutationKeys.create(), - mutationFn: (data: CreateWebhookModuleInput["webhookModule"]) => getClient().webhookModule.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateWebhookModuleInput['webhookModule']) => + getClient() + .webhookModule.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: webhookModuleKeys.lists() + queryKey: webhookModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteAgentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteAgentModuleMutation.ts index 7fb8757406..69ced6563d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteAgentModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteAgentModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { agentModuleKeys } from "../query-keys"; -import { agentModuleMutationKeys } from "../mutation-keys"; -import type { AgentModuleSelect, AgentModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentModuleSelect, AgentModuleWithRelations } from "../../orm/input-types"; +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 { agentModuleKeys } from '../query-keys'; +import { agentModuleMutationKeys } from '../mutation-keys'; +import type { AgentModuleSelect, AgentModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentModuleSelect, AgentModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a AgentModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAgentModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAgentModuleMutation(params: { - selection: ({ - fields: S & AgentModuleSelect; - } & HookStrictSelect, AgentModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAgentModule: { - agentModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAgentModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAgentModuleMutation( + params: { + selection: { + fields: S & AgentModuleSelect; + } & HookStrictSelect, AgentModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteAgentModule: { + agentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAgentModule: { + agentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAgentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().agentModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .agentModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: agentModuleKeys.detail(variables.id) + queryKey: agentModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentModuleKeys.lists() + queryKey: agentModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteApiSurfaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteApiSurfaceModuleMutation.ts index d0195a0b62..b0c2fa559a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteApiSurfaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteApiSurfaceModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { apiSurfaceModuleKeys } from "../query-keys"; -import { apiSurfaceModuleMutationKeys } from "../mutation-keys"; -import type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations } from "../../orm/input-types"; +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 { apiSurfaceModuleKeys } from '../query-keys'; +import { apiSurfaceModuleMutationKeys } from '../mutation-keys'; +import type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a ApiSurfaceModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteApiSurfaceModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteApiSurfaceModuleMutation(params: { - selection: ({ - fields: S & ApiSurfaceModuleSelect; - } & HookStrictSelect, ApiSurfaceModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteApiSurfaceModule: { - apiSurfaceModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteApiSurfaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteApiSurfaceModuleMutation( + params: { + selection: { + fields: S & ApiSurfaceModuleSelect; + } & HookStrictSelect, ApiSurfaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteApiSurfaceModule: { + apiSurfaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteApiSurfaceModule: { + apiSurfaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteApiSurfaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSurfaceModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().apiSurfaceModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .apiSurfaceModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: apiSurfaceModuleKeys.detail(variables.id) + queryKey: apiSurfaceModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiSurfaceModuleKeys.lists() + queryKey: apiSurfaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteAppModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteAppModuleMutation.ts index 9d86820782..b05a9740cc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteAppModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteAppModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { appModuleKeys } from "../query-keys"; -import { appModuleMutationKeys } from "../mutation-keys"; -import type { AppModuleSelect, AppModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppModuleSelect, AppModuleWithRelations } from "../../orm/input-types"; +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 { appModuleKeys } from '../query-keys'; +import { appModuleMutationKeys } from '../mutation-keys'; +import type { AppModuleSelect, AppModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppModuleSelect, AppModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a AppModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppModuleMutation(params: { - selection: ({ - fields: S & AppModuleSelect; - } & HookStrictSelect, AppModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppModule: { - appModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppModuleMutation( + params: { + selection: { + fields: S & AppModuleSelect; + } & HookStrictSelect, AppModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppModule: { + appModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppModule: { + appModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appModuleKeys.detail(variables.id) + queryKey: appModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appModuleKeys.lists() + queryKey: appModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBillingModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBillingModuleMutation.ts index 215241df6d..bf31120cb9 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBillingModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBillingModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { billingModuleKeys } from "../query-keys"; -import { billingModuleMutationKeys } from "../mutation-keys"; -import type { BillingModuleSelect, BillingModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingModuleSelect, BillingModuleWithRelations } from "../../orm/input-types"; +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 { billingModuleKeys } from '../query-keys'; +import { billingModuleMutationKeys } from '../mutation-keys'; +import type { BillingModuleSelect, BillingModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { BillingModuleSelect, BillingModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a BillingModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteBillingModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteBillingModuleMutation(params: { - selection: ({ - fields: S & BillingModuleSelect; - } & HookStrictSelect, BillingModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteBillingModule: { - billingModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteBillingModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteBillingModuleMutation( + params: { + selection: { + fields: S & BillingModuleSelect; + } & HookStrictSelect, BillingModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteBillingModule: { + billingModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteBillingModule: { + billingModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteBillingModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: billingModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().billingModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .billingModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: billingModuleKeys.detail(variables.id) + queryKey: billingModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: billingModuleKeys.lists() + queryKey: billingModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBillingProviderModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBillingProviderModuleMutation.ts index 89b087d173..cea2b526bc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBillingProviderModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBillingProviderModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { billingProviderModuleKeys } from "../query-keys"; -import { billingProviderModuleMutationKeys } from "../mutation-keys"; -import type { BillingProviderModuleSelect, BillingProviderModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingProviderModuleSelect, BillingProviderModuleWithRelations } from "../../orm/input-types"; +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 { billingProviderModuleKeys } from '../query-keys'; +import { billingProviderModuleMutationKeys } from '../mutation-keys'; +import type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a BillingProviderModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteBillingProviderModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteBillingProviderModuleMutation(params: { - selection: ({ - fields: S & BillingProviderModuleSelect; - } & HookStrictSelect, BillingProviderModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteBillingProviderModule: { - billingProviderModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteBillingProviderModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteBillingProviderModuleMutation( + params: { + selection: { + fields: S & BillingProviderModuleSelect; + } & HookStrictSelect, BillingProviderModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteBillingProviderModule: { + billingProviderModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteBillingProviderModule: { + billingProviderModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteBillingProviderModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: billingProviderModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().billingProviderModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .billingProviderModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: billingProviderModuleKeys.detail(variables.id) + queryKey: billingProviderModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: billingProviderModuleKeys.lists() + queryKey: billingProviderModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintConstructionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintConstructionMutation.ts index d56181cb7d..81277a7558 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintConstructionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintConstructionMutation.ts @@ -4,77 +4,101 @@ * 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 { blueprintConstructionKeys } from "../query-keys"; -import { blueprintConstructionMutationKeys } from "../mutation-keys"; -import type { BlueprintConstructionSelect, BlueprintConstructionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintConstructionSelect, BlueprintConstructionWithRelations } from "../../orm/input-types"; +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 { blueprintConstructionKeys } from '../query-keys'; +import { blueprintConstructionMutationKeys } from '../mutation-keys'; +import type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, +} from '../../orm/input-types'; /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteBlueprintConstructionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteBlueprintConstructionMutation(params: { - selection: ({ - fields: S & BlueprintConstructionSelect; - } & HookStrictSelect, BlueprintConstructionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteBlueprintConstruction: { - blueprintConstruction: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteBlueprintConstructionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteBlueprintConstructionMutation( + params: { + selection: { + fields: S & BlueprintConstructionSelect; + } & HookStrictSelect, BlueprintConstructionSelect>; + } & Omit< + UseMutationOptions< + { + deleteBlueprintConstruction: { + blueprintConstruction: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteBlueprintConstruction: { + blueprintConstruction: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteBlueprintConstructionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintConstructionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().blueprintConstruction.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .blueprintConstruction.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: blueprintConstructionKeys.detail(variables.id) + queryKey: blueprintConstructionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: blueprintConstructionKeys.lists() + queryKey: blueprintConstructionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintMutation.ts index b35d3c7e75..658ecbe928 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintMutation.ts @@ -4,77 +4,95 @@ * 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 { blueprintKeys } from "../query-keys"; -import { blueprintMutationKeys } from "../mutation-keys"; -import type { BlueprintSelect, BlueprintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintSelect, BlueprintWithRelations } from "../../orm/input-types"; +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 { blueprintKeys } from '../query-keys'; +import { blueprintMutationKeys } from '../mutation-keys'; +import type { BlueprintSelect, BlueprintWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { BlueprintSelect, BlueprintWithRelations } from '../../orm/input-types'; /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteBlueprintMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteBlueprintMutation(params: { - selection: ({ - fields: S & BlueprintSelect; - } & HookStrictSelect, BlueprintSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteBlueprint: { - blueprint: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteBlueprintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteBlueprintMutation( + params: { + selection: { + fields: S & BlueprintSelect; + } & HookStrictSelect, BlueprintSelect>; + } & Omit< + UseMutationOptions< + { + deleteBlueprint: { + blueprint: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteBlueprint: { + blueprint: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteBlueprintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().blueprint.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .blueprint.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: blueprintKeys.detail(variables.id) + queryKey: blueprintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: blueprintKeys.lists() + queryKey: blueprintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintTemplateMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintTemplateMutation.ts index 04ebc72681..e67f9712f9 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintTemplateMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteBlueprintTemplateMutation.ts @@ -4,77 +4,101 @@ * 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 { blueprintTemplateKeys } from "../query-keys"; -import { blueprintTemplateMutationKeys } from "../mutation-keys"; -import type { BlueprintTemplateSelect, BlueprintTemplateWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintTemplateSelect, BlueprintTemplateWithRelations } from "../../orm/input-types"; +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 { blueprintTemplateKeys } from '../query-keys'; +import { blueprintTemplateMutationKeys } from '../mutation-keys'; +import type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, +} from '../../orm/input-types'; /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteBlueprintTemplateMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteBlueprintTemplateMutation(params: { - selection: ({ - fields: S & BlueprintTemplateSelect; - } & HookStrictSelect, BlueprintTemplateSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteBlueprintTemplate: { - blueprintTemplate: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteBlueprintTemplateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteBlueprintTemplateMutation( + params: { + selection: { + fields: S & BlueprintTemplateSelect; + } & HookStrictSelect, BlueprintTemplateSelect>; + } & Omit< + UseMutationOptions< + { + deleteBlueprintTemplate: { + blueprintTemplate: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteBlueprintTemplate: { + blueprintTemplate: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteBlueprintTemplateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintTemplateMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().blueprintTemplate.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .blueprintTemplate.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: blueprintTemplateKeys.detail(variables.id) + queryKey: blueprintTemplateKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: blueprintTemplateKeys.lists() + queryKey: blueprintTemplateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCatalogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCatalogModuleMutation.ts index aee181946d..a36f0a01e8 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCatalogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCatalogModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { catalogModuleKeys } from "../query-keys"; -import { catalogModuleMutationKeys } from "../mutation-keys"; -import type { CatalogModuleSelect, CatalogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CatalogModuleSelect, CatalogModuleWithRelations } from "../../orm/input-types"; +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 { catalogModuleKeys } from '../query-keys'; +import { catalogModuleMutationKeys } from '../mutation-keys'; +import type { CatalogModuleSelect, CatalogModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CatalogModuleSelect, CatalogModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a CatalogModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteCatalogModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteCatalogModuleMutation(params: { - selection: ({ - fields: S & CatalogModuleSelect; - } & HookStrictSelect, CatalogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteCatalogModule: { - catalogModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteCatalogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteCatalogModuleMutation( + params: { + selection: { + fields: S & CatalogModuleSelect; + } & HookStrictSelect, CatalogModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteCatalogModule: { + catalogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteCatalogModule: { + catalogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteCatalogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: catalogModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().catalogModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .catalogModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: catalogModuleKeys.detail(variables.id) + queryKey: catalogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: catalogModuleKeys.lists() + queryKey: catalogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteComputeLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteComputeLogModuleMutation.ts index 3f30129e51..c859c75ca5 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteComputeLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteComputeLogModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { computeLogModuleKeys } from "../query-keys"; -import { computeLogModuleMutationKeys } from "../mutation-keys"; -import type { ComputeLogModuleSelect, ComputeLogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ComputeLogModuleSelect, ComputeLogModuleWithRelations } from "../../orm/input-types"; +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 { computeLogModuleKeys } from '../query-keys'; +import { computeLogModuleMutationKeys } from '../mutation-keys'; +import type { ComputeLogModuleSelect, ComputeLogModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ComputeLogModuleSelect, ComputeLogModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a ComputeLogModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteComputeLogModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteComputeLogModuleMutation(params: { - selection: ({ - fields: S & ComputeLogModuleSelect; - } & HookStrictSelect, ComputeLogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteComputeLogModule: { - computeLogModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteComputeLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteComputeLogModuleMutation( + params: { + selection: { + fields: S & ComputeLogModuleSelect; + } & HookStrictSelect, ComputeLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteComputeLogModule: { + computeLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteComputeLogModule: { + computeLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteComputeLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: computeLogModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().computeLogModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .computeLogModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: computeLogModuleKeys.detail(variables.id) + queryKey: computeLogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: computeLogModuleKeys.lists() + queryKey: computeLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteConfigSecretsUserModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteConfigSecretsUserModuleMutation.ts index a81f9cf3c4..ffd64e8cfc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteConfigSecretsUserModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteConfigSecretsUserModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { configSecretsUserModuleKeys } from "../query-keys"; -import { configSecretsUserModuleMutationKeys } from "../mutation-keys"; -import type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations } from "../../orm/input-types"; +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 { configSecretsUserModuleKeys } from '../query-keys'; +import { configSecretsUserModuleMutationKeys } from '../mutation-keys'; +import type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a ConfigSecretsUserModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteConfigSecretsUserModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteConfigSecretsUserModuleMutation(params: { - selection: ({ - fields: S & ConfigSecretsUserModuleSelect; - } & HookStrictSelect, ConfigSecretsUserModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteConfigSecretsUserModule: { - configSecretsUserModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteConfigSecretsUserModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteConfigSecretsUserModuleMutation( + params: { + selection: { + fields: S & ConfigSecretsUserModuleSelect; + } & HookStrictSelect, ConfigSecretsUserModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteConfigSecretsUserModule: { + configSecretsUserModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteConfigSecretsUserModule: { + configSecretsUserModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteConfigSecretsUserModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: configSecretsUserModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().configSecretsUserModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .configSecretsUserModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: configSecretsUserModuleKeys.detail(variables.id) + queryKey: configSecretsUserModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: configSecretsUserModuleKeys.lists() + queryKey: configSecretsUserModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteConnectedAccountsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteConnectedAccountsModuleMutation.ts index 786592b466..8935b4ea04 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteConnectedAccountsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteConnectedAccountsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { connectedAccountsModuleKeys } from "../query-keys"; -import { connectedAccountsModuleMutationKeys } from "../mutation-keys"; -import type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations } from "../../orm/input-types"; +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 { connectedAccountsModuleKeys } from '../query-keys'; +import { connectedAccountsModuleMutationKeys } from '../mutation-keys'; +import type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a ConnectedAccountsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteConnectedAccountsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteConnectedAccountsModuleMutation(params: { - selection: ({ - fields: S & ConnectedAccountsModuleSelect; - } & HookStrictSelect, ConnectedAccountsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteConnectedAccountsModule: { - connectedAccountsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteConnectedAccountsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteConnectedAccountsModuleMutation( + params: { + selection: { + fields: S & ConnectedAccountsModuleSelect; + } & HookStrictSelect, ConnectedAccountsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteConnectedAccountsModule: { + connectedAccountsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteConnectedAccountsModule: { + connectedAccountsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteConnectedAccountsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: connectedAccountsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().connectedAccountsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .connectedAccountsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: connectedAccountsModuleKeys.detail(variables.id) + queryKey: connectedAccountsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: connectedAccountsModuleKeys.lists() + queryKey: connectedAccountsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCryptoAddressesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCryptoAddressesModuleMutation.ts index bb67506401..b08e20b4f5 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCryptoAddressesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCryptoAddressesModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { cryptoAddressesModuleKeys } from "../query-keys"; -import { cryptoAddressesModuleMutationKeys } from "../mutation-keys"; -import type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations } from "../../orm/input-types"; +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 { cryptoAddressesModuleKeys } from '../query-keys'; +import { cryptoAddressesModuleMutationKeys } from '../mutation-keys'; +import type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a CryptoAddressesModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteCryptoAddressesModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteCryptoAddressesModuleMutation(params: { - selection: ({ - fields: S & CryptoAddressesModuleSelect; - } & HookStrictSelect, CryptoAddressesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteCryptoAddressesModule: { - cryptoAddressesModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteCryptoAddressesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteCryptoAddressesModuleMutation( + params: { + selection: { + fields: S & CryptoAddressesModuleSelect; + } & HookStrictSelect, CryptoAddressesModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteCryptoAddressesModule: { + cryptoAddressesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteCryptoAddressesModule: { + cryptoAddressesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteCryptoAddressesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAddressesModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().cryptoAddressesModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .cryptoAddressesModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: cryptoAddressesModuleKeys.detail(variables.id) + queryKey: cryptoAddressesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: cryptoAddressesModuleKeys.lists() + queryKey: cryptoAddressesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCryptoAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCryptoAuthModuleMutation.ts index fccd0dfc94..2fc10c2fa7 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCryptoAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteCryptoAuthModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { cryptoAuthModuleKeys } from "../query-keys"; -import { cryptoAuthModuleMutationKeys } from "../mutation-keys"; -import type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations } from "../../orm/input-types"; +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 { cryptoAuthModuleKeys } from '../query-keys'; +import { cryptoAuthModuleMutationKeys } from '../mutation-keys'; +import type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a CryptoAuthModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteCryptoAuthModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteCryptoAuthModuleMutation(params: { - selection: ({ - fields: S & CryptoAuthModuleSelect; - } & HookStrictSelect, CryptoAuthModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteCryptoAuthModule: { - cryptoAuthModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteCryptoAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteCryptoAuthModuleMutation( + params: { + selection: { + fields: S & CryptoAuthModuleSelect; + } & HookStrictSelect, CryptoAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteCryptoAuthModule: { + cryptoAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteCryptoAuthModule: { + cryptoAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteCryptoAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAuthModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().cryptoAuthModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .cryptoAuthModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: cryptoAuthModuleKeys.detail(variables.id) + queryKey: cryptoAuthModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: cryptoAuthModuleKeys.lists() + queryKey: cryptoAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDatabaseProvisionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDatabaseProvisionModuleMutation.ts index 3508a18617..c368e63e7a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDatabaseProvisionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDatabaseProvisionModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { databaseProvisionModuleKeys } from "../query-keys"; -import { databaseProvisionModuleMutationKeys } from "../mutation-keys"; -import type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations } from "../../orm/input-types"; +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 { databaseProvisionModuleKeys } from '../query-keys'; +import { databaseProvisionModuleMutationKeys } from '../mutation-keys'; +import type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, +} from '../../orm/input-types'; /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDatabaseProvisionModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDatabaseProvisionModuleMutation(params: { - selection: ({ - fields: S & DatabaseProvisionModuleSelect; - } & HookStrictSelect, DatabaseProvisionModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDatabaseProvisionModule: { - databaseProvisionModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDatabaseProvisionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDatabaseProvisionModuleMutation( + params: { + selection: { + fields: S & DatabaseProvisionModuleSelect; + } & HookStrictSelect, DatabaseProvisionModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteDatabaseProvisionModule: { + databaseProvisionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDatabaseProvisionModule: { + databaseProvisionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDatabaseProvisionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseProvisionModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().databaseProvisionModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .databaseProvisionModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: databaseProvisionModuleKeys.detail(variables.id) + queryKey: databaseProvisionModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.lists() + queryKey: databaseProvisionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDatabaseSettingsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDatabaseSettingsModuleMutation.ts index eb2aab98de..70a5af45f5 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDatabaseSettingsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDatabaseSettingsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { databaseSettingsModuleKeys } from "../query-keys"; -import { databaseSettingsModuleMutationKeys } from "../mutation-keys"; -import type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations } from "../../orm/input-types"; +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 { databaseSettingsModuleKeys } from '../query-keys'; +import { databaseSettingsModuleMutationKeys } from '../mutation-keys'; +import type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a DatabaseSettingsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDatabaseSettingsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDatabaseSettingsModuleMutation(params: { - selection: ({ - fields: S & DatabaseSettingsModuleSelect; - } & HookStrictSelect, DatabaseSettingsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDatabaseSettingsModule: { - databaseSettingsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDatabaseSettingsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDatabaseSettingsModuleMutation( + params: { + selection: { + fields: S & DatabaseSettingsModuleSelect; + } & HookStrictSelect, DatabaseSettingsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteDatabaseSettingsModule: { + databaseSettingsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDatabaseSettingsModule: { + databaseSettingsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDatabaseSettingsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseSettingsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().databaseSettingsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .databaseSettingsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: databaseSettingsModuleKeys.detail(variables.id) + queryKey: databaseSettingsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseSettingsModuleKeys.lists() + queryKey: databaseSettingsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPoolConfigMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPoolConfigMutation.ts index 2082ad9441..c203f5c093 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPoolConfigMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPoolConfigMutation.ts @@ -4,77 +4,95 @@ * 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 { dbPoolConfigKeys } from "../query-keys"; -import { dbPoolConfigMutationKeys } from "../mutation-keys"; -import type { DbPoolConfigSelect, DbPoolConfigWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolConfigSelect, DbPoolConfigWithRelations } from "../../orm/input-types"; +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 { dbPoolConfigKeys } from '../query-keys'; +import { dbPoolConfigMutationKeys } from '../mutation-keys'; +import type { DbPoolConfigSelect, DbPoolConfigWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPoolConfigSelect, DbPoolConfigWithRelations } from '../../orm/input-types'; /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDbPoolConfigMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDbPoolConfigMutation(params: { - selection: ({ - fields: S & DbPoolConfigSelect; - } & HookStrictSelect, DbPoolConfigSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDbPoolConfig: { - dbPoolConfig: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDbPoolConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDbPoolConfigMutation( + params: { + selection: { + fields: S & DbPoolConfigSelect; + } & HookStrictSelect, DbPoolConfigSelect>; + } & Omit< + UseMutationOptions< + { + deleteDbPoolConfig: { + dbPoolConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDbPoolConfig: { + dbPoolConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDbPoolConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPoolConfigMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().dbPoolConfig.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .dbPoolConfig.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: dbPoolConfigKeys.detail(variables.id) + queryKey: dbPoolConfigKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPoolConfigKeys.lists() + queryKey: dbPoolConfigKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPoolMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPoolMutation.ts index 810acf1b16..249970e2fe 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPoolMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPoolMutation.ts @@ -4,77 +4,95 @@ * 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 { dbPoolKeys } from "../query-keys"; -import { dbPoolMutationKeys } from "../mutation-keys"; -import type { DbPoolSelect, DbPoolWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolSelect, DbPoolWithRelations } from "../../orm/input-types"; +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 { dbPoolKeys } from '../query-keys'; +import { dbPoolMutationKeys } from '../mutation-keys'; +import type { DbPoolSelect, DbPoolWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPoolSelect, DbPoolWithRelations } from '../../orm/input-types'; /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDbPoolMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDbPoolMutation(params: { - selection: ({ - fields: S & DbPoolSelect; - } & HookStrictSelect, DbPoolSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDbPool: { - dbPool: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDbPoolMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDbPoolMutation( + params: { + selection: { + fields: S & DbPoolSelect; + } & HookStrictSelect, DbPoolSelect>; + } & Omit< + UseMutationOptions< + { + deleteDbPool: { + dbPool: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDbPool: { + dbPool: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDbPoolMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPoolMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().dbPool.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .dbPool.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: dbPoolKeys.detail(variables.id) + queryKey: dbPoolKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPoolKeys.lists() + queryKey: dbPoolKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPresetModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPresetModuleMutation.ts index 7f4e42ff2b..2e892a77a1 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPresetModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbPresetModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { dbPresetModuleKeys } from "../query-keys"; -import { dbPresetModuleMutationKeys } from "../mutation-keys"; -import type { DbPresetModuleSelect, DbPresetModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetModuleSelect, DbPresetModuleWithRelations } from "../../orm/input-types"; +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 { dbPresetModuleKeys } from '../query-keys'; +import { dbPresetModuleMutationKeys } from '../mutation-keys'; +import type { DbPresetModuleSelect, DbPresetModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPresetModuleSelect, DbPresetModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a DbPresetModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDbPresetModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDbPresetModuleMutation(params: { - selection: ({ - fields: S & DbPresetModuleSelect; - } & HookStrictSelect, DbPresetModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDbPresetModule: { - dbPresetModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDbPresetModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDbPresetModuleMutation( + params: { + selection: { + fields: S & DbPresetModuleSelect; + } & HookStrictSelect, DbPresetModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteDbPresetModule: { + dbPresetModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDbPresetModule: { + dbPresetModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDbPresetModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().dbPresetModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .dbPresetModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: dbPresetModuleKeys.detail(variables.id) + queryKey: dbPresetModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPresetModuleKeys.lists() + queryKey: dbPresetModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbUsageModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbUsageModuleMutation.ts index 3ce5225e9d..ba7e389321 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbUsageModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDbUsageModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { dbUsageModuleKeys } from "../query-keys"; -import { dbUsageModuleMutationKeys } from "../mutation-keys"; -import type { DbUsageModuleSelect, DbUsageModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbUsageModuleSelect, DbUsageModuleWithRelations } from "../../orm/input-types"; +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 { dbUsageModuleKeys } from '../query-keys'; +import { dbUsageModuleMutationKeys } from '../mutation-keys'; +import type { DbUsageModuleSelect, DbUsageModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbUsageModuleSelect, DbUsageModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a DbUsageModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDbUsageModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDbUsageModuleMutation(params: { - selection: ({ - fields: S & DbUsageModuleSelect; - } & HookStrictSelect, DbUsageModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDbUsageModule: { - dbUsageModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDbUsageModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDbUsageModuleMutation( + params: { + selection: { + fields: S & DbUsageModuleSelect; + } & HookStrictSelect, DbUsageModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteDbUsageModule: { + dbUsageModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDbUsageModule: { + dbUsageModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDbUsageModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbUsageModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().dbUsageModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .dbUsageModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: dbUsageModuleKeys.detail(variables.id) + queryKey: dbUsageModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbUsageModuleKeys.lists() + queryKey: dbUsageModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDefaultIdsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDefaultIdsModuleMutation.ts index 36fd41d390..4eb6f0c89a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDefaultIdsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDefaultIdsModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { defaultIdsModuleKeys } from "../query-keys"; -import { defaultIdsModuleMutationKeys } from "../mutation-keys"; -import type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations } from "../../orm/input-types"; +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 { defaultIdsModuleKeys } from '../query-keys'; +import { defaultIdsModuleMutationKeys } from '../mutation-keys'; +import type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a DefaultIdsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDefaultIdsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDefaultIdsModuleMutation(params: { - selection: ({ - fields: S & DefaultIdsModuleSelect; - } & HookStrictSelect, DefaultIdsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDefaultIdsModule: { - defaultIdsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDefaultIdsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDefaultIdsModuleMutation( + params: { + selection: { + fields: S & DefaultIdsModuleSelect; + } & HookStrictSelect, DefaultIdsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteDefaultIdsModule: { + defaultIdsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDefaultIdsModule: { + defaultIdsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDefaultIdsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: defaultIdsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().defaultIdsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .defaultIdsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: defaultIdsModuleKeys.detail(variables.id) + queryKey: defaultIdsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: defaultIdsModuleKeys.lists() + queryKey: defaultIdsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDenormalizedTableFieldMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDenormalizedTableFieldMutation.ts index 8cc83eb3f9..1f8dd4bd99 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDenormalizedTableFieldMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDenormalizedTableFieldMutation.ts @@ -4,77 +4,101 @@ * 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 { denormalizedTableFieldKeys } from "../query-keys"; -import { denormalizedTableFieldMutationKeys } from "../mutation-keys"; -import type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations } from "../../orm/input-types"; +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 { denormalizedTableFieldKeys } from '../query-keys'; +import { denormalizedTableFieldMutationKeys } from '../mutation-keys'; +import type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a DenormalizedTableField with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDenormalizedTableFieldMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDenormalizedTableFieldMutation(params: { - selection: ({ - fields: S & DenormalizedTableFieldSelect; - } & HookStrictSelect, DenormalizedTableFieldSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDenormalizedTableField: { - denormalizedTableField: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDenormalizedTableFieldMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDenormalizedTableFieldMutation( + params: { + selection: { + fields: S & DenormalizedTableFieldSelect; + } & HookStrictSelect, DenormalizedTableFieldSelect>; + } & Omit< + UseMutationOptions< + { + deleteDenormalizedTableField: { + denormalizedTableField: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDenormalizedTableField: { + denormalizedTableField: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDenormalizedTableFieldMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: denormalizedTableFieldMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().denormalizedTableField.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .denormalizedTableField.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: denormalizedTableFieldKeys.detail(variables.id) + queryKey: denormalizedTableFieldKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: denormalizedTableFieldKeys.lists() + queryKey: denormalizedTableFieldKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDevicesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDevicesModuleMutation.ts index 405c4fc23f..873b82119f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDevicesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDevicesModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { devicesModuleKeys } from "../query-keys"; -import { devicesModuleMutationKeys } from "../mutation-keys"; -import type { DevicesModuleSelect, DevicesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DevicesModuleSelect, DevicesModuleWithRelations } from "../../orm/input-types"; +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 { devicesModuleKeys } from '../query-keys'; +import { devicesModuleMutationKeys } from '../mutation-keys'; +import type { DevicesModuleSelect, DevicesModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DevicesModuleSelect, DevicesModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a DevicesModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDevicesModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDevicesModuleMutation(params: { - selection: ({ - fields: S & DevicesModuleSelect; - } & HookStrictSelect, DevicesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDevicesModule: { - devicesModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDevicesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDevicesModuleMutation( + params: { + selection: { + fields: S & DevicesModuleSelect; + } & HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDevicesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: devicesModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().devicesModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .devicesModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: devicesModuleKeys.detail(variables.id) + queryKey: devicesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: devicesModuleKeys.lists() + queryKey: devicesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDomainModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDomainModuleMutation.ts index 2cfad9d682..913cb1d104 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDomainModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteDomainModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { domainModuleKeys } from "../query-keys"; -import { domainModuleMutationKeys } from "../mutation-keys"; -import type { DomainModuleSelect, DomainModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainModuleSelect, DomainModuleWithRelations } from "../../orm/input-types"; +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 { domainModuleKeys } from '../query-keys'; +import { domainModuleMutationKeys } from '../mutation-keys'; +import type { DomainModuleSelect, DomainModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DomainModuleSelect, DomainModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a DomainModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteDomainModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteDomainModuleMutation(params: { - selection: ({ - fields: S & DomainModuleSelect; - } & HookStrictSelect, DomainModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteDomainModule: { - domainModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteDomainModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteDomainModuleMutation( + params: { + selection: { + fields: S & DomainModuleSelect; + } & HookStrictSelect, DomainModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteDomainModule: { + domainModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteDomainModule: { + domainModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteDomainModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().domainModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .domainModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: domainModuleKeys.detail(variables.id) + queryKey: domainModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: domainModuleKeys.lists() + queryKey: domainModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEmailsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEmailsModuleMutation.ts index 4041252163..a8e0c47ca1 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEmailsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEmailsModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { emailsModuleKeys } from "../query-keys"; -import { emailsModuleMutationKeys } from "../mutation-keys"; -import type { EmailsModuleSelect, EmailsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailsModuleSelect, EmailsModuleWithRelations } from "../../orm/input-types"; +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 { emailsModuleKeys } from '../query-keys'; +import { emailsModuleMutationKeys } from '../mutation-keys'; +import type { EmailsModuleSelect, EmailsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EmailsModuleSelect, EmailsModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a EmailsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteEmailsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteEmailsModuleMutation(params: { - selection: ({ - fields: S & EmailsModuleSelect; - } & HookStrictSelect, EmailsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteEmailsModule: { - emailsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteEmailsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteEmailsModuleMutation( + params: { + selection: { + fields: S & EmailsModuleSelect; + } & HookStrictSelect, EmailsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteEmailsModule: { + emailsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteEmailsModule: { + emailsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteEmailsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: emailsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().emailsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .emailsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: emailsModuleKeys.detail(variables.id) + queryKey: emailsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: emailsModuleKeys.lists() + queryKey: emailsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEntityTypeProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEntityTypeProvisionMutation.ts index 9cf5fe70ba..0029e7138c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEntityTypeProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEntityTypeProvisionMutation.ts @@ -11,16 +11,22 @@ * 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 { entityTypeProvisionKeys } from "../query-keys"; -import { entityTypeProvisionMutationKeys } from "../mutation-keys"; -import type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations } from "../../orm/input-types"; +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 { entityTypeProvisionKeys } from '../query-keys'; +import { entityTypeProvisionMutationKeys } from '../mutation-keys'; +import type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, +} from '../../orm/input-types'; /** * Provisions a new membership entity type. Each INSERT creates an entity table, registers a membership type, and installs the required modules (permissions, memberships, limits) plus optional modules (profiles, levels, invites). @@ -40,55 +46,73 @@ export type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations } from * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteEntityTypeProvisionMutation(params: { - selection: ({ - fields: S & EntityTypeProvisionSelect; - } & HookStrictSelect, EntityTypeProvisionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteEntityTypeProvision: { - entityTypeProvision: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteEntityTypeProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteEntityTypeProvisionMutation( + params: { + selection: { + fields: S & EntityTypeProvisionSelect; + } & HookStrictSelect, EntityTypeProvisionSelect>; + } & Omit< + UseMutationOptions< + { + deleteEntityTypeProvision: { + entityTypeProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteEntityTypeProvision: { + entityTypeProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteEntityTypeProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: entityTypeProvisionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().entityTypeProvision.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .entityTypeProvision.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: entityTypeProvisionKeys.detail(variables.id) + queryKey: entityTypeProvisionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: entityTypeProvisionKeys.lists() + queryKey: entityTypeProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEventsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEventsModuleMutation.ts index c83b8d28bb..b37a1ffb22 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEventsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteEventsModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { eventsModuleKeys } from "../query-keys"; -import { eventsModuleMutationKeys } from "../mutation-keys"; -import type { EventsModuleSelect, EventsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EventsModuleSelect, EventsModuleWithRelations } from "../../orm/input-types"; +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 { eventsModuleKeys } from '../query-keys'; +import { eventsModuleMutationKeys } from '../mutation-keys'; +import type { EventsModuleSelect, EventsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EventsModuleSelect, EventsModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a EventsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteEventsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteEventsModuleMutation(params: { - selection: ({ - fields: S & EventsModuleSelect; - } & HookStrictSelect, EventsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteEventsModule: { - eventsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteEventsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteEventsModuleMutation( + params: { + selection: { + fields: S & EventsModuleSelect; + } & HookStrictSelect, EventsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteEventsModule: { + eventsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteEventsModule: { + eventsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteEventsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: eventsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().eventsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .eventsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: eventsModuleKeys.detail(variables.id) + queryKey: eventsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: eventsModuleKeys.lists() + queryKey: eventsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionDeploymentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionDeploymentModuleMutation.ts index a5e098edec..89989bf383 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionDeploymentModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionDeploymentModuleMutation.ts @@ -4,77 +4,101 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentModuleKeys } from "../query-keys"; -import { functionDeploymentModuleMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import { functionDeploymentModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a FunctionDeploymentModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionDeploymentModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionDeploymentModuleMutation(params: { - selection: ({ - fields: S & FunctionDeploymentModuleSelect; - } & HookStrictSelect, FunctionDeploymentModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionDeploymentModule: { - functionDeploymentModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionDeploymentModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionDeploymentModuleMutation( + params: { + selection: { + fields: S & FunctionDeploymentModuleSelect; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionDeploymentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDeploymentModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().functionDeploymentModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .functionDeploymentModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionDeploymentModuleKeys.detail(variables.id) + queryKey: functionDeploymentModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionDeploymentModuleKeys.lists() + queryKey: functionDeploymentModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionInvocationModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionInvocationModuleMutation.ts index 1032b48108..f5a00ef7ec 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionInvocationModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionInvocationModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { functionInvocationModuleKeys } from "../query-keys"; -import { functionInvocationModuleMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations } from "../../orm/input-types"; +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 { functionInvocationModuleKeys } from '../query-keys'; +import { functionInvocationModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a FunctionInvocationModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionInvocationModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionInvocationModuleMutation(params: { - selection: ({ - fields: S & FunctionInvocationModuleSelect; - } & HookStrictSelect, FunctionInvocationModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionInvocationModule: { - functionInvocationModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionInvocationModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionInvocationModuleMutation( + params: { + selection: { + fields: S & FunctionInvocationModuleSelect; + } & HookStrictSelect, FunctionInvocationModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionInvocationModule: { + functionInvocationModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionInvocationModule: { + functionInvocationModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionInvocationModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionInvocationModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().functionInvocationModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .functionInvocationModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionInvocationModuleKeys.detail(variables.id) + queryKey: functionInvocationModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionInvocationModuleKeys.lists() + queryKey: functionInvocationModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionModuleMutation.ts index e7df91ba45..1f496670c9 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { functionModuleKeys } from "../query-keys"; -import { functionModuleMutationKeys } from "../mutation-keys"; -import type { FunctionModuleSelect, FunctionModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionModuleSelect, FunctionModuleWithRelations } from "../../orm/input-types"; +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 { functionModuleKeys } from '../query-keys'; +import { functionModuleMutationKeys } from '../mutation-keys'; +import type { FunctionModuleSelect, FunctionModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionModuleSelect, FunctionModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a FunctionModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteFunctionModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteFunctionModuleMutation(params: { - selection: ({ - fields: S & FunctionModuleSelect; - } & HookStrictSelect, FunctionModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteFunctionModule: { - functionModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteFunctionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteFunctionModuleMutation( + params: { + selection: { + fields: S & FunctionModuleSelect; + } & HookStrictSelect, FunctionModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionModule: { + functionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionModule: { + functionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().functionModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .functionModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: functionModuleKeys.detail(variables.id) + queryKey: functionModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionModuleKeys.lists() + queryKey: functionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphExecutionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphExecutionModuleMutation.ts index 1c7334cd43..f88e719ad7 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphExecutionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphExecutionModuleMutation.ts @@ -4,77 +4,101 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { graphExecutionModuleKeys } from "../query-keys"; -import { graphExecutionModuleMutationKeys } from "../mutation-keys"; -import type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import { graphExecutionModuleMutationKeys } from '../mutation-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a GraphExecutionModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteGraphExecutionModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteGraphExecutionModuleMutation(params: { - selection: ({ - fields: S & GraphExecutionModuleSelect; - } & HookStrictSelect, GraphExecutionModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteGraphExecutionModule: { - graphExecutionModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteGraphExecutionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteGraphExecutionModuleMutation( + params: { + selection: { + fields: S & GraphExecutionModuleSelect; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteGraphExecutionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: graphExecutionModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().graphExecutionModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .graphExecutionModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: graphExecutionModuleKeys.detail(variables.id) + queryKey: graphExecutionModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: graphExecutionModuleKeys.lists() + queryKey: graphExecutionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphModuleMutation.ts index 18756c1812..84e3c76ffa 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { graphModuleKeys } from "../query-keys"; -import { graphModuleMutationKeys } from "../mutation-keys"; -import type { GraphModuleSelect, GraphModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphModuleSelect, GraphModuleWithRelations } from "../../orm/input-types"; +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 { graphModuleKeys } from '../query-keys'; +import { graphModuleMutationKeys } from '../mutation-keys'; +import type { GraphModuleSelect, GraphModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { GraphModuleSelect, GraphModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a GraphModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteGraphModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteGraphModuleMutation(params: { - selection: ({ - fields: S & GraphModuleSelect; - } & HookStrictSelect, GraphModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteGraphModule: { - graphModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteGraphModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteGraphModuleMutation( + params: { + selection: { + fields: S & GraphModuleSelect; + } & HookStrictSelect, GraphModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteGraphModule: { + graphModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteGraphModule: { + graphModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteGraphModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: graphModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().graphModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .graphModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: graphModuleKeys.detail(variables.id) + queryKey: graphModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: graphModuleKeys.lists() + queryKey: graphModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteHierarchyModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteHierarchyModuleMutation.ts index 31e71210a1..d798936eba 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteHierarchyModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteHierarchyModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { hierarchyModuleKeys } from "../query-keys"; -import { hierarchyModuleMutationKeys } from "../mutation-keys"; -import type { HierarchyModuleSelect, HierarchyModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HierarchyModuleSelect, HierarchyModuleWithRelations } from "../../orm/input-types"; +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 { hierarchyModuleKeys } from '../query-keys'; +import { hierarchyModuleMutationKeys } from '../mutation-keys'; +import type { HierarchyModuleSelect, HierarchyModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { HierarchyModuleSelect, HierarchyModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a HierarchyModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteHierarchyModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteHierarchyModuleMutation(params: { - selection: ({ - fields: S & HierarchyModuleSelect; - } & HookStrictSelect, HierarchyModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteHierarchyModule: { - hierarchyModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteHierarchyModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteHierarchyModuleMutation( + params: { + selection: { + fields: S & HierarchyModuleSelect; + } & HookStrictSelect, HierarchyModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteHierarchyModule: { + hierarchyModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteHierarchyModule: { + hierarchyModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteHierarchyModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: hierarchyModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().hierarchyModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .hierarchyModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: hierarchyModuleKeys.detail(variables.id) + queryKey: hierarchyModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: hierarchyModuleKeys.lists() + queryKey: hierarchyModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteHttpRouteModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteHttpRouteModuleMutation.ts index 9e6365ba4f..6e421ae58d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteHttpRouteModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteHttpRouteModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { httpRouteModuleKeys } from "../query-keys"; -import { httpRouteModuleMutationKeys } from "../mutation-keys"; -import type { HttpRouteModuleSelect, HttpRouteModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteModuleSelect, HttpRouteModuleWithRelations } from "../../orm/input-types"; +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 { httpRouteModuleKeys } from '../query-keys'; +import { httpRouteModuleMutationKeys } from '../mutation-keys'; +import type { HttpRouteModuleSelect, HttpRouteModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { HttpRouteModuleSelect, HttpRouteModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a HttpRouteModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteHttpRouteModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteHttpRouteModuleMutation(params: { - selection: ({ - fields: S & HttpRouteModuleSelect; - } & HookStrictSelect, HttpRouteModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteHttpRouteModule: { - httpRouteModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteHttpRouteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteHttpRouteModuleMutation( + params: { + selection: { + fields: S & HttpRouteModuleSelect; + } & HookStrictSelect, HttpRouteModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteHttpRouteModule: { + httpRouteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteHttpRouteModule: { + httpRouteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteHttpRouteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: httpRouteModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().httpRouteModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .httpRouteModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: httpRouteModuleKeys.detail(variables.id) + queryKey: httpRouteModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: httpRouteModuleKeys.lists() + queryKey: httpRouteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteI18NModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteI18NModuleMutation.ts index 91b1a10cfd..e6b7fb6682 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteI18NModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteI18NModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { i18NModuleKeys } from "../query-keys"; -import { i18NModuleMutationKeys } from "../mutation-keys"; -import type { I18NModuleSelect, I18NModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { I18NModuleSelect, I18NModuleWithRelations } from "../../orm/input-types"; +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 { i18NModuleKeys } from '../query-keys'; +import { i18NModuleMutationKeys } from '../mutation-keys'; +import type { I18NModuleSelect, I18NModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { I18NModuleSelect, I18NModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a I18NModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteI18NModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteI18NModuleMutation(params: { - selection: ({ - fields: S & I18NModuleSelect; - } & HookStrictSelect, I18NModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteI18NModule: { - i18NModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteI18NModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteI18NModuleMutation( + params: { + selection: { + fields: S & I18NModuleSelect; + } & HookStrictSelect, I18NModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteI18NModule: { + i18NModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteI18NModule: { + i18NModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteI18NModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: i18NModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().i18NModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .i18NModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: i18NModuleKeys.detail(variables.id) + queryKey: i18NModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: i18NModuleKeys.lists() + queryKey: i18NModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteIdentityProvidersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteIdentityProvidersModuleMutation.ts index 62c6edb003..9cef005fa0 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteIdentityProvidersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteIdentityProvidersModuleMutation.ts @@ -12,16 +12,22 @@ * 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 { identityProvidersModuleKeys } from "../query-keys"; -import { identityProvidersModuleMutationKeys } from "../mutation-keys"; -import type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations } from "../../orm/input-types"; +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 { identityProvidersModuleKeys } from '../query-keys'; +import { identityProvidersModuleMutationKeys } from '../mutation-keys'; +import type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, +} from '../../orm/input-types'; /** * Entity-aware config row for the identity_providers_module, which provisions a per-database identity_providers table holding OAuth2 / OIDC (and future SAML) provider definitions. @@ -42,55 +48,73 @@ export type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelation * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteIdentityProvidersModuleMutation(params: { - selection: ({ - fields: S & IdentityProvidersModuleSelect; - } & HookStrictSelect, IdentityProvidersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteIdentityProvidersModule: { - identityProvidersModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteIdentityProvidersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteIdentityProvidersModuleMutation( + params: { + selection: { + fields: S & IdentityProvidersModuleSelect; + } & HookStrictSelect, IdentityProvidersModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteIdentityProvidersModule: { + identityProvidersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteIdentityProvidersModule: { + identityProvidersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteIdentityProvidersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: identityProvidersModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().identityProvidersModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .identityProvidersModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: identityProvidersModuleKeys.detail(variables.id) + queryKey: identityProvidersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: identityProvidersModuleKeys.lists() + queryKey: identityProvidersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInferenceLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInferenceLogModuleMutation.ts index 1cc13bb9fa..0fbddb70fc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInferenceLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInferenceLogModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { inferenceLogModuleKeys } from "../query-keys"; -import { inferenceLogModuleMutationKeys } from "../mutation-keys"; -import type { InferenceLogModuleSelect, InferenceLogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InferenceLogModuleSelect, InferenceLogModuleWithRelations } from "../../orm/input-types"; +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 { inferenceLogModuleKeys } from '../query-keys'; +import { inferenceLogModuleMutationKeys } from '../mutation-keys'; +import type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a InferenceLogModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInferenceLogModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInferenceLogModuleMutation(params: { - selection: ({ - fields: S & InferenceLogModuleSelect; - } & HookStrictSelect, InferenceLogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInferenceLogModule: { - inferenceLogModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteInferenceLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInferenceLogModuleMutation( + params: { + selection: { + fields: S & InferenceLogModuleSelect; + } & HookStrictSelect, InferenceLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteInferenceLogModule: { + inferenceLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInferenceLogModule: { + inferenceLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteInferenceLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: inferenceLogModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().inferenceLogModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .inferenceLogModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: inferenceLogModuleKeys.detail(variables.id) + queryKey: inferenceLogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: inferenceLogModuleKeys.lists() + queryKey: inferenceLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInfraConfigModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInfraConfigModuleMutation.ts index 47f3b408ef..84b10b0c1a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInfraConfigModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInfraConfigModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { infraConfigModuleKeys } from "../query-keys"; -import { infraConfigModuleMutationKeys } from "../mutation-keys"; -import type { InfraConfigModuleSelect, InfraConfigModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraConfigModuleSelect, InfraConfigModuleWithRelations } from "../../orm/input-types"; +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 { infraConfigModuleKeys } from '../query-keys'; +import { infraConfigModuleMutationKeys } from '../mutation-keys'; +import type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, +} from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInfraConfigModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInfraConfigModuleMutation(params: { - selection: ({ - fields: S & InfraConfigModuleSelect; - } & HookStrictSelect, InfraConfigModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInfraConfigModule: { - infraConfigModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteInfraConfigModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInfraConfigModuleMutation( + params: { + selection: { + fields: S & InfraConfigModuleSelect; + } & HookStrictSelect, InfraConfigModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteInfraConfigModule: { + infraConfigModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInfraConfigModule: { + infraConfigModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteInfraConfigModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraConfigModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().infraConfigModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .infraConfigModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: infraConfigModuleKeys.detail(variables.id) + queryKey: infraConfigModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraConfigModuleKeys.lists() + queryKey: infraConfigModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInfraSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInfraSecretsModuleMutation.ts index 8b88a83f9c..29a131b45d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInfraSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInfraSecretsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { infraSecretsModuleKeys } from "../query-keys"; -import { infraSecretsModuleMutationKeys } from "../mutation-keys"; -import type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations } from "../../orm/input-types"; +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 { infraSecretsModuleKeys } from '../query-keys'; +import { infraSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, +} from '../../orm/input-types'; /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInfraSecretsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInfraSecretsModuleMutation(params: { - selection: ({ - fields: S & InfraSecretsModuleSelect; - } & HookStrictSelect, InfraSecretsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInfraSecretsModule: { - infraSecretsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteInfraSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInfraSecretsModuleMutation( + params: { + selection: { + fields: S & InfraSecretsModuleSelect; + } & HookStrictSelect, InfraSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteInfraSecretsModule: { + infraSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInfraSecretsModule: { + infraSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteInfraSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraSecretsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().infraSecretsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .infraSecretsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: infraSecretsModuleKeys.detail(variables.id) + queryKey: infraSecretsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraSecretsModuleKeys.lists() + queryKey: infraSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteIntegrationProvidersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteIntegrationProvidersModuleMutation.ts index ac457ea92b..eeb6077d89 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteIntegrationProvidersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteIntegrationProvidersModuleMutation.ts @@ -8,16 +8,22 @@ * 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 { integrationProvidersModuleKeys } from "../query-keys"; -import { integrationProvidersModuleMutationKeys } from "../mutation-keys"; -import type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations } from "../../orm/input-types"; +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 { integrationProvidersModuleKeys } from '../query-keys'; +import { integrationProvidersModuleMutationKeys } from '../mutation-keys'; +import type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, +} from '../../orm/input-types'; /** * Config row for the integration_providers_module, which provisions a per-database integration_providers table holding branded, reusable service definitions. @@ -34,55 +40,75 @@ export type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRe * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteIntegrationProvidersModuleMutation(params: { - selection: ({ - fields: S & IntegrationProvidersModuleSelect; - } & HookStrictSelect, IntegrationProvidersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteIntegrationProvidersModule: { - integrationProvidersModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteIntegrationProvidersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteIntegrationProvidersModuleMutation< + S extends IntegrationProvidersModuleSelect, +>( + params: { + selection: { + fields: S & IntegrationProvidersModuleSelect; + } & HookStrictSelect, IntegrationProvidersModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteIntegrationProvidersModule: { + integrationProvidersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteIntegrationProvidersModule: { + integrationProvidersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteIntegrationProvidersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: integrationProvidersModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().integrationProvidersModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .integrationProvidersModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: integrationProvidersModuleKeys.detail(variables.id) + queryKey: integrationProvidersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: integrationProvidersModuleKeys.lists() + queryKey: integrationProvidersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInternalSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInternalSecretsModuleMutation.ts index 9cf80bc235..e462c09c77 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInternalSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInternalSecretsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { internalSecretsModuleKeys } from "../query-keys"; -import { internalSecretsModuleMutationKeys } from "../mutation-keys"; -import type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations } from "../../orm/input-types"; +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 { internalSecretsModuleKeys } from '../query-keys'; +import { internalSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, +} from '../../orm/input-types'; /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInternalSecretsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInternalSecretsModuleMutation(params: { - selection: ({ - fields: S & InternalSecretsModuleSelect; - } & HookStrictSelect, InternalSecretsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInternalSecretsModule: { - internalSecretsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteInternalSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInternalSecretsModuleMutation( + params: { + selection: { + fields: S & InternalSecretsModuleSelect; + } & HookStrictSelect, InternalSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteInternalSecretsModule: { + internalSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInternalSecretsModule: { + internalSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteInternalSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: internalSecretsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().internalSecretsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .internalSecretsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: internalSecretsModuleKeys.detail(variables.id) + queryKey: internalSecretsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: internalSecretsModuleKeys.lists() + queryKey: internalSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInvitesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInvitesModuleMutation.ts index 46bee86082..42fa1699e3 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInvitesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteInvitesModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { invitesModuleKeys } from "../query-keys"; -import { invitesModuleMutationKeys } from "../mutation-keys"; -import type { InvitesModuleSelect, InvitesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InvitesModuleSelect, InvitesModuleWithRelations } from "../../orm/input-types"; +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 { invitesModuleKeys } from '../query-keys'; +import { invitesModuleMutationKeys } from '../mutation-keys'; +import type { InvitesModuleSelect, InvitesModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InvitesModuleSelect, InvitesModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a InvitesModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteInvitesModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteInvitesModuleMutation(params: { - selection: ({ - fields: S & InvitesModuleSelect; - } & HookStrictSelect, InvitesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteInvitesModule: { - invitesModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteInvitesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteInvitesModuleMutation( + params: { + selection: { + fields: S & InvitesModuleSelect; + } & HookStrictSelect, InvitesModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteInvitesModule: { + invitesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteInvitesModule: { + invitesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteInvitesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: invitesModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().invitesModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .invitesModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: invitesModuleKeys.detail(variables.id) + queryKey: invitesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: invitesModuleKeys.lists() + queryKey: invitesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteLimitsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteLimitsModuleMutation.ts index c017e369fd..a2eddb73bc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteLimitsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteLimitsModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { limitsModuleKeys } from "../query-keys"; -import { limitsModuleMutationKeys } from "../mutation-keys"; -import type { LimitsModuleSelect, LimitsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { LimitsModuleSelect, LimitsModuleWithRelations } from "../../orm/input-types"; +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 { limitsModuleKeys } from '../query-keys'; +import { limitsModuleMutationKeys } from '../mutation-keys'; +import type { LimitsModuleSelect, LimitsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { LimitsModuleSelect, LimitsModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a LimitsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteLimitsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteLimitsModuleMutation(params: { - selection: ({ - fields: S & LimitsModuleSelect; - } & HookStrictSelect, LimitsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteLimitsModule: { - limitsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteLimitsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteLimitsModuleMutation( + params: { + selection: { + fields: S & LimitsModuleSelect; + } & HookStrictSelect, LimitsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteLimitsModule: { + limitsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteLimitsModule: { + limitsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteLimitsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: limitsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().limitsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .limitsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: limitsModuleKeys.detail(variables.id) + queryKey: limitsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: limitsModuleKeys.lists() + queryKey: limitsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMembershipTypesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMembershipTypesModuleMutation.ts index 3f3815be0d..0b9ba6ef32 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMembershipTypesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMembershipTypesModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { membershipTypesModuleKeys } from "../query-keys"; -import { membershipTypesModuleMutationKeys } from "../mutation-keys"; -import type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations } from "../../orm/input-types"; +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 { membershipTypesModuleKeys } from '../query-keys'; +import { membershipTypesModuleMutationKeys } from '../mutation-keys'; +import type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a MembershipTypesModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteMembershipTypesModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteMembershipTypesModuleMutation(params: { - selection: ({ - fields: S & MembershipTypesModuleSelect; - } & HookStrictSelect, MembershipTypesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteMembershipTypesModule: { - membershipTypesModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteMembershipTypesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteMembershipTypesModuleMutation( + params: { + selection: { + fields: S & MembershipTypesModuleSelect; + } & HookStrictSelect, MembershipTypesModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteMembershipTypesModule: { + membershipTypesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteMembershipTypesModule: { + membershipTypesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteMembershipTypesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipTypesModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().membershipTypesModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .membershipTypesModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: membershipTypesModuleKeys.detail(variables.id) + queryKey: membershipTypesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: membershipTypesModuleKeys.lists() + queryKey: membershipTypesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMembershipsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMembershipsModuleMutation.ts index f863e5c4f6..cbba5195bc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMembershipsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMembershipsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { membershipsModuleKeys } from "../query-keys"; -import { membershipsModuleMutationKeys } from "../mutation-keys"; -import type { MembershipsModuleSelect, MembershipsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipsModuleSelect, MembershipsModuleWithRelations } from "../../orm/input-types"; +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 { membershipsModuleKeys } from '../query-keys'; +import { membershipsModuleMutationKeys } from '../mutation-keys'; +import type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a MembershipsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteMembershipsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteMembershipsModuleMutation(params: { - selection: ({ - fields: S & MembershipsModuleSelect; - } & HookStrictSelect, MembershipsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteMembershipsModule: { - membershipsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteMembershipsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteMembershipsModuleMutation( + params: { + selection: { + fields: S & MembershipsModuleSelect; + } & HookStrictSelect, MembershipsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteMembershipsModule: { + membershipsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteMembershipsModule: { + membershipsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteMembershipsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().membershipsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .membershipsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: membershipsModuleKeys.detail(variables.id) + queryKey: membershipsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: membershipsModuleKeys.lists() + queryKey: membershipsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMerkleStoreModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMerkleStoreModuleMutation.ts index 3eb40dbac6..e1ddd60a16 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMerkleStoreModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteMerkleStoreModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { merkleStoreModuleKeys } from "../query-keys"; -import { merkleStoreModuleMutationKeys } from "../mutation-keys"; -import type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations } from "../../orm/input-types"; +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 { merkleStoreModuleKeys } from '../query-keys'; +import { merkleStoreModuleMutationKeys } from '../mutation-keys'; +import type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a MerkleStoreModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteMerkleStoreModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteMerkleStoreModuleMutation(params: { - selection: ({ - fields: S & MerkleStoreModuleSelect; - } & HookStrictSelect, MerkleStoreModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteMerkleStoreModule: { - merkleStoreModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteMerkleStoreModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteMerkleStoreModuleMutation( + params: { + selection: { + fields: S & MerkleStoreModuleSelect; + } & HookStrictSelect, MerkleStoreModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteMerkleStoreModule: { + merkleStoreModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteMerkleStoreModule: { + merkleStoreModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteMerkleStoreModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: merkleStoreModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().merkleStoreModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .merkleStoreModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: merkleStoreModuleKeys.detail(variables.id) + queryKey: merkleStoreModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.lists() + queryKey: merkleStoreModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteNamespaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteNamespaceModuleMutation.ts index f1cd791ad6..11e4d62d59 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteNamespaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteNamespaceModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { namespaceModuleKeys } from "../query-keys"; -import { namespaceModuleMutationKeys } from "../mutation-keys"; -import type { NamespaceModuleSelect, NamespaceModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceModuleSelect, NamespaceModuleWithRelations } from "../../orm/input-types"; +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 { namespaceModuleKeys } from '../query-keys'; +import { namespaceModuleMutationKeys } from '../mutation-keys'; +import type { NamespaceModuleSelect, NamespaceModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceModuleSelect, NamespaceModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a NamespaceModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteNamespaceModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteNamespaceModuleMutation(params: { - selection: ({ - fields: S & NamespaceModuleSelect; - } & HookStrictSelect, NamespaceModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteNamespaceModule: { - namespaceModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteNamespaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteNamespaceModuleMutation( + params: { + selection: { + fields: S & NamespaceModuleSelect; + } & HookStrictSelect, NamespaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteNamespaceModule: { + namespaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteNamespaceModule: { + namespaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteNamespaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().namespaceModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .namespaceModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: namespaceModuleKeys.detail(variables.id) + queryKey: namespaceModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.lists() + queryKey: namespaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteNotificationsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteNotificationsModuleMutation.ts index 8e15c27a57..5f99fc0e8c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteNotificationsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteNotificationsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { notificationsModuleKeys } from "../query-keys"; -import { notificationsModuleMutationKeys } from "../mutation-keys"; -import type { NotificationsModuleSelect, NotificationsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NotificationsModuleSelect, NotificationsModuleWithRelations } from "../../orm/input-types"; +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 { notificationsModuleKeys } from '../query-keys'; +import { notificationsModuleMutationKeys } from '../mutation-keys'; +import type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a NotificationsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteNotificationsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteNotificationsModuleMutation(params: { - selection: ({ - fields: S & NotificationsModuleSelect; - } & HookStrictSelect, NotificationsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteNotificationsModule: { - notificationsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteNotificationsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteNotificationsModuleMutation( + params: { + selection: { + fields: S & NotificationsModuleSelect; + } & HookStrictSelect, NotificationsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteNotificationsModule: { + notificationsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteNotificationsModule: { + notificationsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteNotificationsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: notificationsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().notificationsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .notificationsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: notificationsModuleKeys.detail(variables.id) + queryKey: notificationsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: notificationsModuleKeys.lists() + queryKey: notificationsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePermissionsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePermissionsModuleMutation.ts index fe9c600e36..bcd6060e21 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePermissionsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePermissionsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { permissionsModuleKeys } from "../query-keys"; -import { permissionsModuleMutationKeys } from "../mutation-keys"; -import type { PermissionsModuleSelect, PermissionsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PermissionsModuleSelect, PermissionsModuleWithRelations } from "../../orm/input-types"; +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 { permissionsModuleKeys } from '../query-keys'; +import { permissionsModuleMutationKeys } from '../mutation-keys'; +import type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a PermissionsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePermissionsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePermissionsModuleMutation(params: { - selection: ({ - fields: S & PermissionsModuleSelect; - } & HookStrictSelect, PermissionsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePermissionsModule: { - permissionsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePermissionsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePermissionsModuleMutation( + params: { + selection: { + fields: S & PermissionsModuleSelect; + } & HookStrictSelect, PermissionsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deletePermissionsModule: { + permissionsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePermissionsModule: { + permissionsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePermissionsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: permissionsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().permissionsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .permissionsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: permissionsModuleKeys.detail(variables.id) + queryKey: permissionsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: permissionsModuleKeys.lists() + queryKey: permissionsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePhoneNumbersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePhoneNumbersModuleMutation.ts index 37a7aeefed..5234c30405 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePhoneNumbersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePhoneNumbersModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { phoneNumbersModuleKeys } from "../query-keys"; -import { phoneNumbersModuleMutationKeys } from "../mutation-keys"; -import type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations } from "../../orm/input-types"; +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 { phoneNumbersModuleKeys } from '../query-keys'; +import { phoneNumbersModuleMutationKeys } from '../mutation-keys'; +import type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a PhoneNumbersModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePhoneNumbersModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePhoneNumbersModuleMutation(params: { - selection: ({ - fields: S & PhoneNumbersModuleSelect; - } & HookStrictSelect, PhoneNumbersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePhoneNumbersModule: { - phoneNumbersModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePhoneNumbersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePhoneNumbersModuleMutation( + params: { + selection: { + fields: S & PhoneNumbersModuleSelect; + } & HookStrictSelect, PhoneNumbersModuleSelect>; + } & Omit< + UseMutationOptions< + { + deletePhoneNumbersModule: { + phoneNumbersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePhoneNumbersModule: { + phoneNumbersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePhoneNumbersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: phoneNumbersModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().phoneNumbersModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .phoneNumbersModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: phoneNumbersModuleKeys.detail(variables.id) + queryKey: phoneNumbersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: phoneNumbersModuleKeys.lists() + queryKey: phoneNumbersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePlansModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePlansModuleMutation.ts index 0906f0dee6..880e7d1cf3 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePlansModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePlansModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { plansModuleKeys } from "../query-keys"; -import { plansModuleMutationKeys } from "../mutation-keys"; -import type { PlansModuleSelect, PlansModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlansModuleSelect, PlansModuleWithRelations } from "../../orm/input-types"; +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 { plansModuleKeys } from '../query-keys'; +import { plansModuleMutationKeys } from '../mutation-keys'; +import type { PlansModuleSelect, PlansModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlansModuleSelect, PlansModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a PlansModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeletePlansModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeletePlansModuleMutation(params: { - selection: ({ - fields: S & PlansModuleSelect; - } & HookStrictSelect, PlansModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePlansModule: { - plansModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePlansModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeletePlansModuleMutation( + params: { + selection: { + fields: S & PlansModuleSelect; + } & HookStrictSelect, PlansModuleSelect>; + } & Omit< + UseMutationOptions< + { + deletePlansModule: { + plansModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlansModule: { + plansModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlansModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: plansModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().plansModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .plansModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: plansModuleKeys.detail(variables.id) + queryKey: plansModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: plansModuleKeys.lists() + queryKey: plansModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.ts index d1b45f83f4..b0d095c2a0 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.ts @@ -4,77 +4,101 @@ * 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"; +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; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deletePrincipalAuthModule: { - principalAuthModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeletePrincipalAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + 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(), + mutationFn: ({ id }: { id: string }) => + getClient() + .principalAuthModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: principalAuthModuleKeys.detail(variables.id) + queryKey: principalAuthModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: principalAuthModuleKeys.lists() + queryKey: principalAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteProfilesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteProfilesModuleMutation.ts index 8b736cbb15..26b66b9b6c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteProfilesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteProfilesModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { profilesModuleKeys } from "../query-keys"; -import { profilesModuleMutationKeys } from "../mutation-keys"; -import type { ProfilesModuleSelect, ProfilesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ProfilesModuleSelect, ProfilesModuleWithRelations } from "../../orm/input-types"; +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 { profilesModuleKeys } from '../query-keys'; +import { profilesModuleMutationKeys } from '../mutation-keys'; +import type { ProfilesModuleSelect, ProfilesModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ProfilesModuleSelect, ProfilesModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a ProfilesModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteProfilesModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteProfilesModuleMutation(params: { - selection: ({ - fields: S & ProfilesModuleSelect; - } & HookStrictSelect, ProfilesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteProfilesModule: { - profilesModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteProfilesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteProfilesModuleMutation( + params: { + selection: { + fields: S & ProfilesModuleSelect; + } & HookStrictSelect, ProfilesModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteProfilesModule: { + profilesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteProfilesModule: { + profilesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteProfilesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: profilesModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().profilesModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .profilesModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: profilesModuleKeys.detail(variables.id) + queryKey: profilesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: profilesModuleKeys.lists() + queryKey: profilesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRateLimitMetersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRateLimitMetersModuleMutation.ts index ef9d4f0683..01362043c8 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRateLimitMetersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRateLimitMetersModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { rateLimitMetersModuleKeys } from "../query-keys"; -import { rateLimitMetersModuleMutationKeys } from "../mutation-keys"; -import type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations } from "../../orm/input-types"; +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 { rateLimitMetersModuleKeys } from '../query-keys'; +import { rateLimitMetersModuleMutationKeys } from '../mutation-keys'; +import type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a RateLimitMetersModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRateLimitMetersModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRateLimitMetersModuleMutation(params: { - selection: ({ - fields: S & RateLimitMetersModuleSelect; - } & HookStrictSelect, RateLimitMetersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRateLimitMetersModule: { - rateLimitMetersModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRateLimitMetersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRateLimitMetersModuleMutation( + params: { + selection: { + fields: S & RateLimitMetersModuleSelect; + } & HookStrictSelect, RateLimitMetersModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteRateLimitMetersModule: { + rateLimitMetersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRateLimitMetersModule: { + rateLimitMetersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRateLimitMetersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rateLimitMetersModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().rateLimitMetersModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .rateLimitMetersModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: rateLimitMetersModuleKeys.detail(variables.id) + queryKey: rateLimitMetersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: rateLimitMetersModuleKeys.lists() + queryKey: rateLimitMetersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRateLimitsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRateLimitsModuleMutation.ts index 50feb7e74d..89212d2a38 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRateLimitsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRateLimitsModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { rateLimitsModuleKeys } from "../query-keys"; -import { rateLimitsModuleMutationKeys } from "../mutation-keys"; -import type { RateLimitsModuleSelect, RateLimitsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitsModuleSelect, RateLimitsModuleWithRelations } from "../../orm/input-types"; +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 { rateLimitsModuleKeys } from '../query-keys'; +import { rateLimitsModuleMutationKeys } from '../mutation-keys'; +import type { RateLimitsModuleSelect, RateLimitsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RateLimitsModuleSelect, RateLimitsModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a RateLimitsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRateLimitsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRateLimitsModuleMutation(params: { - selection: ({ - fields: S & RateLimitsModuleSelect; - } & HookStrictSelect, RateLimitsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRateLimitsModule: { - rateLimitsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRateLimitsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRateLimitsModuleMutation( + params: { + selection: { + fields: S & RateLimitsModuleSelect; + } & HookStrictSelect, RateLimitsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteRateLimitsModule: { + rateLimitsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRateLimitsModule: { + rateLimitsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRateLimitsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rateLimitsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().rateLimitsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .rateLimitsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: rateLimitsModuleKeys.detail(variables.id) + queryKey: rateLimitsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: rateLimitsModuleKeys.lists() + queryKey: rateLimitsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRealtimeModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRealtimeModuleMutation.ts index 7ca8fc254b..3ab737670a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRealtimeModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRealtimeModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { realtimeModuleKeys } from "../query-keys"; -import { realtimeModuleMutationKeys } from "../mutation-keys"; -import type { RealtimeModuleSelect, RealtimeModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RealtimeModuleSelect, RealtimeModuleWithRelations } from "../../orm/input-types"; +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 { realtimeModuleKeys } from '../query-keys'; +import { realtimeModuleMutationKeys } from '../mutation-keys'; +import type { RealtimeModuleSelect, RealtimeModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RealtimeModuleSelect, RealtimeModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a RealtimeModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRealtimeModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRealtimeModuleMutation(params: { - selection: ({ - fields: S & RealtimeModuleSelect; - } & HookStrictSelect, RealtimeModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRealtimeModule: { - realtimeModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRealtimeModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRealtimeModuleMutation( + params: { + selection: { + fields: S & RealtimeModuleSelect; + } & HookStrictSelect, RealtimeModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteRealtimeModule: { + realtimeModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRealtimeModule: { + realtimeModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRealtimeModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: realtimeModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().realtimeModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .realtimeModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: realtimeModuleKeys.detail(variables.id) + queryKey: realtimeModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: realtimeModuleKeys.lists() + queryKey: realtimeModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRelationProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRelationProvisionMutation.ts index a714f41be7..d13cdb5e35 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRelationProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRelationProvisionMutation.ts @@ -11,16 +11,22 @@ * 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 { relationProvisionKeys } from "../query-keys"; -import { relationProvisionMutationKeys } from "../mutation-keys"; -import type { RelationProvisionSelect, RelationProvisionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RelationProvisionSelect, RelationProvisionWithRelations } from "../../orm/input-types"; +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 { relationProvisionKeys } from '../query-keys'; +import { relationProvisionMutationKeys } from '../mutation-keys'; +import type { + RelationProvisionSelect, + RelationProvisionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RelationProvisionSelect, + RelationProvisionWithRelations, +} from '../../orm/input-types'; /** * Provisions relational structure between tables. Supports four relation types: - RelationBelongsTo: adds a FK field on the source table referencing the target table (child perspective: "tasks belongs to projects" -> tasks.project_id). @@ -40,55 +46,73 @@ export type { RelationProvisionSelect, RelationProvisionWithRelations } from ".. * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRelationProvisionMutation(params: { - selection: ({ - fields: S & RelationProvisionSelect; - } & HookStrictSelect, RelationProvisionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRelationProvision: { - relationProvision: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRelationProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRelationProvisionMutation( + params: { + selection: { + fields: S & RelationProvisionSelect; + } & HookStrictSelect, RelationProvisionSelect>; + } & Omit< + UseMutationOptions< + { + deleteRelationProvision: { + relationProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRelationProvision: { + relationProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRelationProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: relationProvisionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().relationProvision.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .relationProvision.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: relationProvisionKeys.detail(variables.id) + queryKey: relationProvisionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: relationProvisionKeys.lists() + queryKey: relationProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteResourceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteResourceModuleMutation.ts index afc4bceb97..4381c04520 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteResourceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteResourceModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { resourceModuleKeys } from "../query-keys"; -import { resourceModuleMutationKeys } from "../mutation-keys"; -import type { ResourceModuleSelect, ResourceModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceModuleSelect, ResourceModuleWithRelations } from "../../orm/input-types"; +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 { resourceModuleKeys } from '../query-keys'; +import { resourceModuleMutationKeys } from '../mutation-keys'; +import type { ResourceModuleSelect, ResourceModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceModuleSelect, ResourceModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a ResourceModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteResourceModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteResourceModuleMutation(params: { - selection: ({ - fields: S & ResourceModuleSelect; - } & HookStrictSelect, ResourceModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteResourceModule: { - resourceModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteResourceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteResourceModuleMutation( + params: { + selection: { + fields: S & ResourceModuleSelect; + } & HookStrictSelect, ResourceModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteResourceModule: { + resourceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteResourceModule: { + resourceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteResourceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().resourceModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .resourceModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: resourceModuleKeys.detail(variables.id) + queryKey: resourceModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceModuleKeys.lists() + queryKey: resourceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRlsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRlsModuleMutation.ts index f150aa83b3..ffd1df1f8d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRlsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRlsModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { rlsModuleKeys } from "../query-keys"; -import { rlsModuleMutationKeys } from "../mutation-keys"; -import type { RlsModuleSelect, RlsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsModuleSelect, RlsModuleWithRelations } from "../../orm/input-types"; +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 { rlsModuleKeys } from '../query-keys'; +import { rlsModuleMutationKeys } from '../mutation-keys'; +import type { RlsModuleSelect, RlsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RlsModuleSelect, RlsModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a RlsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRlsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRlsModuleMutation(params: { - selection: ({ - fields: S & RlsModuleSelect; - } & HookStrictSelect, RlsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRlsModule: { - rlsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRlsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRlsModuleMutation( + params: { + selection: { + fields: S & RlsModuleSelect; + } & HookStrictSelect, RlsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteRlsModule: { + rlsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRlsModule: { + rlsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRlsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rlsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().rlsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .rlsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: rlsModuleKeys.detail(variables.id) + queryKey: rlsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: rlsModuleKeys.lists() + queryKey: rlsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRouteModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRouteModuleMutation.ts index 3c0255e319..faa5faa447 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRouteModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteRouteModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { routeModuleKeys } from "../query-keys"; -import { routeModuleMutationKeys } from "../mutation-keys"; -import type { RouteModuleSelect, RouteModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteModuleSelect, RouteModuleWithRelations } from "../../orm/input-types"; +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 { routeModuleKeys } from '../query-keys'; +import { routeModuleMutationKeys } from '../mutation-keys'; +import type { RouteModuleSelect, RouteModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RouteModuleSelect, RouteModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a RouteModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRouteModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRouteModuleMutation(params: { - selection: ({ - fields: S & RouteModuleSelect; - } & HookStrictSelect, RouteModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRouteModule: { - routeModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteRouteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRouteModuleMutation( + params: { + selection: { + fields: S & RouteModuleSelect; + } & HookStrictSelect, RouteModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteRouteModule: { + routeModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRouteModule: { + routeModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteRouteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().routeModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .routeModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: routeModuleKeys.detail(variables.id) + queryKey: routeModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: routeModuleKeys.lists() + queryKey: routeModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSecureTableProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSecureTableProvisionMutation.ts index 745e346e05..7ad6fcd649 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSecureTableProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSecureTableProvisionMutation.ts @@ -4,77 +4,101 @@ * 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 { secureTableProvisionKeys } from "../query-keys"; -import { secureTableProvisionMutationKeys } from "../mutation-keys"; -import type { SecureTableProvisionSelect, SecureTableProvisionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SecureTableProvisionSelect, SecureTableProvisionWithRelations } from "../../orm/input-types"; +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 { secureTableProvisionKeys } from '../query-keys'; +import { secureTableProvisionMutationKeys } from '../mutation-keys'; +import type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, +} from '../../orm/input-types'; /** * 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. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSecureTableProvisionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSecureTableProvisionMutation(params: { - selection: ({ - fields: S & SecureTableProvisionSelect; - } & HookStrictSelect, SecureTableProvisionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSecureTableProvision: { - secureTableProvision: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSecureTableProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSecureTableProvisionMutation( + params: { + selection: { + fields: S & SecureTableProvisionSelect; + } & HookStrictSelect, SecureTableProvisionSelect>; + } & Omit< + UseMutationOptions< + { + deleteSecureTableProvision: { + secureTableProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSecureTableProvision: { + secureTableProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSecureTableProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: secureTableProvisionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().secureTableProvision.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .secureTableProvision.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: secureTableProvisionKeys.detail(variables.id) + queryKey: secureTableProvisionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: secureTableProvisionKeys.lists() + queryKey: secureTableProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSessionSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSessionSecretsModuleMutation.ts index b8fbbb15af..e1595239d4 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSessionSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSessionSecretsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { sessionSecretsModuleKeys } from "../query-keys"; -import { sessionSecretsModuleMutationKeys } from "../mutation-keys"; -import type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations } from "../../orm/input-types"; +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 { sessionSecretsModuleKeys } from '../query-keys'; +import { sessionSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, +} from '../../orm/input-types'; /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSessionSecretsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSessionSecretsModuleMutation(params: { - selection: ({ - fields: S & SessionSecretsModuleSelect; - } & HookStrictSelect, SessionSecretsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSessionSecretsModule: { - sessionSecretsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSessionSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSessionSecretsModuleMutation( + params: { + selection: { + fields: S & SessionSecretsModuleSelect; + } & HookStrictSelect, SessionSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteSessionSecretsModule: { + sessionSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSessionSecretsModule: { + sessionSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSessionSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: sessionSecretsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().sessionSecretsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .sessionSecretsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: sessionSecretsModuleKeys.detail(variables.id) + queryKey: sessionSecretsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: sessionSecretsModuleKeys.lists() + queryKey: sessionSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSessionsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSessionsModuleMutation.ts index f309598fcb..2253307329 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSessionsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSessionsModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { sessionsModuleKeys } from "../query-keys"; -import { sessionsModuleMutationKeys } from "../mutation-keys"; -import type { SessionsModuleSelect, SessionsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionsModuleSelect, SessionsModuleWithRelations } from "../../orm/input-types"; +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 { sessionsModuleKeys } from '../query-keys'; +import { sessionsModuleMutationKeys } from '../mutation-keys'; +import type { SessionsModuleSelect, SessionsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SessionsModuleSelect, SessionsModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a SessionsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSessionsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSessionsModuleMutation(params: { - selection: ({ - fields: S & SessionsModuleSelect; - } & HookStrictSelect, SessionsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSessionsModule: { - sessionsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSessionsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSessionsModuleMutation( + params: { + selection: { + fields: S & SessionsModuleSelect; + } & HookStrictSelect, SessionsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteSessionsModule: { + sessionsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSessionsModule: { + sessionsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSessionsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: sessionsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().sessionsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .sessionsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: sessionsModuleKeys.detail(variables.id) + queryKey: sessionsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: sessionsModuleKeys.lists() + queryKey: sessionsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSiteSurfaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSiteSurfaceModuleMutation.ts index 7b1509e98d..b0efea4d23 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSiteSurfaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteSiteSurfaceModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { siteSurfaceModuleKeys } from "../query-keys"; -import { siteSurfaceModuleMutationKeys } from "../mutation-keys"; -import type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations } from "../../orm/input-types"; +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 { siteSurfaceModuleKeys } from '../query-keys'; +import { siteSurfaceModuleMutationKeys } from '../mutation-keys'; +import type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a SiteSurfaceModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteSiteSurfaceModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteSiteSurfaceModuleMutation(params: { - selection: ({ - fields: S & SiteSurfaceModuleSelect; - } & HookStrictSelect, SiteSurfaceModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteSiteSurfaceModule: { - siteSurfaceModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteSiteSurfaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteSiteSurfaceModuleMutation( + params: { + selection: { + fields: S & SiteSurfaceModuleSelect; + } & HookStrictSelect, SiteSurfaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteSiteSurfaceModule: { + siteSurfaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSiteSurfaceModule: { + siteSurfaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSiteSurfaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteSurfaceModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().siteSurfaceModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .siteSurfaceModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: siteSurfaceModuleKeys.detail(variables.id) + queryKey: siteSurfaceModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteSurfaceModuleKeys.lists() + queryKey: siteSurfaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteStorageLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteStorageLogModuleMutation.ts index 4cb0c86849..08082e98e3 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteStorageLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteStorageLogModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { storageLogModuleKeys } from "../query-keys"; -import { storageLogModuleMutationKeys } from "../mutation-keys"; -import type { StorageLogModuleSelect, StorageLogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageLogModuleSelect, StorageLogModuleWithRelations } from "../../orm/input-types"; +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 { storageLogModuleKeys } from '../query-keys'; +import { storageLogModuleMutationKeys } from '../mutation-keys'; +import type { StorageLogModuleSelect, StorageLogModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { StorageLogModuleSelect, StorageLogModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a StorageLogModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteStorageLogModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteStorageLogModuleMutation(params: { - selection: ({ - fields: S & StorageLogModuleSelect; - } & HookStrictSelect, StorageLogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteStorageLogModule: { - storageLogModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteStorageLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteStorageLogModuleMutation( + params: { + selection: { + fields: S & StorageLogModuleSelect; + } & HookStrictSelect, StorageLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteStorageLogModule: { + storageLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteStorageLogModule: { + storageLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteStorageLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storageLogModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().storageLogModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .storageLogModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: storageLogModuleKeys.detail(variables.id) + queryKey: storageLogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: storageLogModuleKeys.lists() + queryKey: storageLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteStorageModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteStorageModuleMutation.ts index ea555408e0..279c3fb54f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteStorageModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteStorageModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { storageModuleKeys } from "../query-keys"; -import { storageModuleMutationKeys } from "../mutation-keys"; -import type { StorageModuleSelect, StorageModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageModuleSelect, StorageModuleWithRelations } from "../../orm/input-types"; +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 { storageModuleKeys } from '../query-keys'; +import { storageModuleMutationKeys } from '../mutation-keys'; +import type { StorageModuleSelect, StorageModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { StorageModuleSelect, StorageModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a StorageModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteStorageModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteStorageModuleMutation(params: { - selection: ({ - fields: S & StorageModuleSelect; - } & HookStrictSelect, StorageModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteStorageModule: { - storageModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteStorageModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteStorageModuleMutation( + params: { + selection: { + fields: S & StorageModuleSelect; + } & HookStrictSelect, StorageModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteStorageModule: { + storageModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteStorageModule: { + storageModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteStorageModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storageModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().storageModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .storageModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: storageModuleKeys.detail(variables.id) + queryKey: storageModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: storageModuleKeys.lists() + queryKey: storageModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteTransferLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteTransferLogModuleMutation.ts index 0a6eac1d3f..58f900acf8 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteTransferLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteTransferLogModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { transferLogModuleKeys } from "../query-keys"; -import { transferLogModuleMutationKeys } from "../mutation-keys"; -import type { TransferLogModuleSelect, TransferLogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TransferLogModuleSelect, TransferLogModuleWithRelations } from "../../orm/input-types"; +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 { transferLogModuleKeys } from '../query-keys'; +import { transferLogModuleMutationKeys } from '../mutation-keys'; +import type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a TransferLogModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteTransferLogModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteTransferLogModuleMutation(params: { - selection: ({ - fields: S & TransferLogModuleSelect; - } & HookStrictSelect, TransferLogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteTransferLogModule: { - transferLogModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteTransferLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteTransferLogModuleMutation( + params: { + selection: { + fields: S & TransferLogModuleSelect; + } & HookStrictSelect, TransferLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteTransferLogModule: { + transferLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteTransferLogModule: { + transferLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteTransferLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: transferLogModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().transferLogModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .transferLogModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: transferLogModuleKeys.detail(variables.id) + queryKey: transferLogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: transferLogModuleKeys.lists() + queryKey: transferLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserAuthModuleMutation.ts index cdfd1fe1e2..d36ff17762 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserAuthModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { userAuthModuleKeys } from "../query-keys"; -import { userAuthModuleMutationKeys } from "../mutation-keys"; -import type { UserAuthModuleSelect, UserAuthModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserAuthModuleSelect, UserAuthModuleWithRelations } from "../../orm/input-types"; +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 { userAuthModuleKeys } from '../query-keys'; +import { userAuthModuleMutationKeys } from '../mutation-keys'; +import type { UserAuthModuleSelect, UserAuthModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserAuthModuleSelect, UserAuthModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a UserAuthModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteUserAuthModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteUserAuthModuleMutation(params: { - selection: ({ - fields: S & UserAuthModuleSelect; - } & HookStrictSelect, UserAuthModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteUserAuthModule: { - userAuthModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteUserAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteUserAuthModuleMutation( + params: { + selection: { + fields: S & UserAuthModuleSelect; + } & HookStrictSelect, UserAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteUserAuthModule: { + userAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteUserAuthModule: { + userAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteUserAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userAuthModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().userAuthModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .userAuthModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: userAuthModuleKeys.detail(variables.id) + queryKey: userAuthModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userAuthModuleKeys.lists() + queryKey: userAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserCredentialsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserCredentialsModuleMutation.ts index a9d2f13be8..0f3504a5b9 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserCredentialsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserCredentialsModuleMutation.ts @@ -6,16 +6,22 @@ * 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 { userCredentialsModuleKeys } from "../query-keys"; -import { userCredentialsModuleMutationKeys } from "../mutation-keys"; -import type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations } from "../../orm/input-types"; +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 { userCredentialsModuleKeys } from '../query-keys'; +import { userCredentialsModuleMutationKeys } from '../mutation-keys'; +import type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, +} from '../../orm/input-types'; /** * Per-user bcrypt credential store (password hashes, API key hashes). Always user-scoped with AuthzDirectOwner RLS. Consumed by user_auth_module, @@ -30,55 +36,73 @@ export type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations } * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteUserCredentialsModuleMutation(params: { - selection: ({ - fields: S & UserCredentialsModuleSelect; - } & HookStrictSelect, UserCredentialsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteUserCredentialsModule: { - userCredentialsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteUserCredentialsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteUserCredentialsModuleMutation( + params: { + selection: { + fields: S & UserCredentialsModuleSelect; + } & HookStrictSelect, UserCredentialsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteUserCredentialsModule: { + userCredentialsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteUserCredentialsModule: { + userCredentialsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteUserCredentialsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userCredentialsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().userCredentialsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .userCredentialsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: userCredentialsModuleKeys.detail(variables.id) + queryKey: userCredentialsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userCredentialsModuleKeys.lists() + queryKey: userCredentialsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserSettingsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserSettingsModuleMutation.ts index 242869c62f..4d48555515 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserSettingsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserSettingsModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { userSettingsModuleKeys } from "../query-keys"; -import { userSettingsModuleMutationKeys } from "../mutation-keys"; -import type { UserSettingsModuleSelect, UserSettingsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSettingsModuleSelect, UserSettingsModuleWithRelations } from "../../orm/input-types"; +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 { userSettingsModuleKeys } from '../query-keys'; +import { userSettingsModuleMutationKeys } from '../mutation-keys'; +import type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a UserSettingsModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteUserSettingsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteUserSettingsModuleMutation(params: { - selection: ({ - fields: S & UserSettingsModuleSelect; - } & HookStrictSelect, UserSettingsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteUserSettingsModule: { - userSettingsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteUserSettingsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteUserSettingsModuleMutation( + params: { + selection: { + fields: S & UserSettingsModuleSelect; + } & HookStrictSelect, UserSettingsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteUserSettingsModule: { + userSettingsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteUserSettingsModule: { + userSettingsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteUserSettingsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userSettingsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().userSettingsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .userSettingsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: userSettingsModuleKeys.detail(variables.id) + queryKey: userSettingsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userSettingsModuleKeys.lists() + queryKey: userSettingsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserStateModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserStateModuleMutation.ts index f102c4f9ab..726f61c924 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserStateModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUserStateModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { userStateModuleKeys } from "../query-keys"; -import { userStateModuleMutationKeys } from "../mutation-keys"; -import type { UserStateModuleSelect, UserStateModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserStateModuleSelect, UserStateModuleWithRelations } from "../../orm/input-types"; +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 { userStateModuleKeys } from '../query-keys'; +import { userStateModuleMutationKeys } from '../mutation-keys'; +import type { UserStateModuleSelect, UserStateModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserStateModuleSelect, UserStateModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a UserStateModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteUserStateModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteUserStateModuleMutation(params: { - selection: ({ - fields: S & UserStateModuleSelect; - } & HookStrictSelect, UserStateModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteUserStateModule: { - userStateModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteUserStateModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteUserStateModuleMutation( + params: { + selection: { + fields: S & UserStateModuleSelect; + } & HookStrictSelect, UserStateModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteUserStateModule: { + userStateModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteUserStateModule: { + userStateModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteUserStateModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userStateModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().userStateModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .userStateModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: userStateModuleKeys.detail(variables.id) + queryKey: userStateModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userStateModuleKeys.lists() + queryKey: userStateModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUsersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUsersModuleMutation.ts index 93f77e1a96..163eb549ad 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUsersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteUsersModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { usersModuleKeys } from "../query-keys"; -import { usersModuleMutationKeys } from "../mutation-keys"; -import type { UsersModuleSelect, UsersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UsersModuleSelect, UsersModuleWithRelations } from "../../orm/input-types"; +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 { usersModuleKeys } from '../query-keys'; +import { usersModuleMutationKeys } from '../mutation-keys'; +import type { UsersModuleSelect, UsersModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UsersModuleSelect, UsersModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a UsersModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteUsersModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteUsersModuleMutation(params: { - selection: ({ - fields: S & UsersModuleSelect; - } & HookStrictSelect, UsersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteUsersModule: { - usersModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteUsersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteUsersModuleMutation( + params: { + selection: { + fields: S & UsersModuleSelect; + } & HookStrictSelect, UsersModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteUsersModule: { + usersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteUsersModule: { + usersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteUsersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: usersModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().usersModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .usersModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: usersModuleKeys.detail(variables.id) + queryKey: usersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: usersModuleKeys.lists() + queryKey: usersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebauthnAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebauthnAuthModuleMutation.ts index 144569c0f4..fe725ad15b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebauthnAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebauthnAuthModuleMutation.ts @@ -4,77 +4,101 @@ * 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 { webauthnAuthModuleKeys } from "../query-keys"; -import { webauthnAuthModuleMutationKeys } from "../mutation-keys"; -import type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations } from "../../orm/input-types"; +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 { webauthnAuthModuleKeys } from '../query-keys'; +import { webauthnAuthModuleMutationKeys } from '../mutation-keys'; +import type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, +} from '../../orm/input-types'; /** * Mutation hook for deleting a WebauthnAuthModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteWebauthnAuthModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteWebauthnAuthModuleMutation(params: { - selection: ({ - fields: S & WebauthnAuthModuleSelect; - } & HookStrictSelect, WebauthnAuthModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteWebauthnAuthModule: { - webauthnAuthModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteWebauthnAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteWebauthnAuthModuleMutation( + params: { + selection: { + fields: S & WebauthnAuthModuleSelect; + } & HookStrictSelect, WebauthnAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteWebauthnAuthModule: { + webauthnAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteWebauthnAuthModule: { + webauthnAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteWebauthnAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnAuthModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().webauthnAuthModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .webauthnAuthModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: webauthnAuthModuleKeys.detail(variables.id) + queryKey: webauthnAuthModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webauthnAuthModuleKeys.lists() + queryKey: webauthnAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebauthnCredentialsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebauthnCredentialsModuleMutation.ts index f6d12ede0f..b4bbc6e375 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebauthnCredentialsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebauthnCredentialsModuleMutation.ts @@ -4,77 +4,103 @@ * 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 { webauthnCredentialsModuleKeys } from "../query-keys"; -import { webauthnCredentialsModuleMutationKeys } from "../mutation-keys"; -import type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations } from "../../orm/input-types"; +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 { webauthnCredentialsModuleKeys } from '../query-keys'; +import { webauthnCredentialsModuleMutationKeys } from '../mutation-keys'; +import type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, +} from '../../orm/input-types'; /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteWebauthnCredentialsModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteWebauthnCredentialsModuleMutation(params: { - selection: ({ - fields: S & WebauthnCredentialsModuleSelect; - } & HookStrictSelect, WebauthnCredentialsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteWebauthnCredentialsModule: { - webauthnCredentialsModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteWebauthnCredentialsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteWebauthnCredentialsModuleMutation< + S extends WebauthnCredentialsModuleSelect, +>( + params: { + selection: { + fields: S & WebauthnCredentialsModuleSelect; + } & HookStrictSelect, WebauthnCredentialsModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteWebauthnCredentialsModule: { + webauthnCredentialsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteWebauthnCredentialsModule: { + webauthnCredentialsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteWebauthnCredentialsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnCredentialsModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().webauthnCredentialsModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .webauthnCredentialsModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: webauthnCredentialsModuleKeys.detail(variables.id) + queryKey: webauthnCredentialsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webauthnCredentialsModuleKeys.lists() + queryKey: webauthnCredentialsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebhookModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebhookModuleMutation.ts index b6673af313..11df1b3acd 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebhookModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteWebhookModuleMutation.ts @@ -4,77 +4,95 @@ * 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 { webhookModuleKeys } from "../query-keys"; -import { webhookModuleMutationKeys } from "../mutation-keys"; -import type { WebhookModuleSelect, WebhookModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookModuleSelect, WebhookModuleWithRelations } from "../../orm/input-types"; +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 { webhookModuleKeys } from '../query-keys'; +import { webhookModuleMutationKeys } from '../mutation-keys'; +import type { WebhookModuleSelect, WebhookModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { WebhookModuleSelect, WebhookModuleWithRelations } from '../../orm/input-types'; /** * Mutation hook for deleting a WebhookModule with typed selection - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteWebhookModuleMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteWebhookModuleMutation(params: { - selection: ({ - fields: S & WebhookModuleSelect; - } & HookStrictSelect, WebhookModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteWebhookModule: { - webhookModule: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteWebhookModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteWebhookModuleMutation( + params: { + selection: { + fields: S & WebhookModuleSelect; + } & HookStrictSelect, WebhookModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteWebhookModule: { + webhookModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteWebhookModule: { + webhookModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteWebhookModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookModuleMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().webhookModule.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .webhookModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: webhookModuleKeys.detail(variables.id) + queryKey: webhookModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webhookModuleKeys.lists() + queryKey: webhookModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionCheckConstraintMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionCheckConstraintMutation.ts index 87feedd020..2e18ad6276 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionCheckConstraintMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionCheckConstraintMutation.ts @@ -4,39 +4,57 @@ * 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 { ProvisionCheckConstraintVariables } from "../../orm/mutation"; -import type { ProvisionCheckConstraintPayloadSelect, ProvisionCheckConstraintPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionCheckConstraintVariables } from "../../orm/mutation"; -export type { ProvisionCheckConstraintPayloadSelect } from "../../orm/input-types"; -export function useProvisionCheckConstraintMutation(params: { - selection: ({ - fields: S & ProvisionCheckConstraintPayloadSelect; - } & HookStrictSelect, ProvisionCheckConstraintPayloadSelect>); -} & Omit | null; -}, Error, ProvisionCheckConstraintVariables>, "mutationFn">): UseMutationResult<{ - provisionCheckConstraint: InferSelectResult | null; -}, Error, ProvisionCheckConstraintVariables> { +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 { ProvisionCheckConstraintVariables } from '../../orm/mutation'; +import type { + ProvisionCheckConstraintPayloadSelect, + ProvisionCheckConstraintPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionCheckConstraintVariables } from '../../orm/mutation'; +export type { ProvisionCheckConstraintPayloadSelect } from '../../orm/input-types'; +export function useProvisionCheckConstraintMutation< + S extends ProvisionCheckConstraintPayloadSelect, +>( + params: { + selection: { + fields: S & ProvisionCheckConstraintPayloadSelect; + } & HookStrictSelect, ProvisionCheckConstraintPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionCheckConstraint: InferSelectResult | null; + }, + Error, + ProvisionCheckConstraintVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionCheckConstraint: InferSelectResult | null; + }, + Error, + ProvisionCheckConstraintVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionCheckConstraint(), - mutationFn: (variables: ProvisionCheckConstraintVariables) => getClient().mutation.provisionCheckConstraint(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionCheckConstraintVariables) => + getClient() + .mutation.provisionCheckConstraint(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionFullTextSearchMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionFullTextSearchMutation.ts index a18ce0306c..62ee82bcb1 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionFullTextSearchMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionFullTextSearchMutation.ts @@ -4,39 +4,55 @@ * 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 { ProvisionFullTextSearchVariables } from "../../orm/mutation"; -import type { ProvisionFullTextSearchPayloadSelect, ProvisionFullTextSearchPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionFullTextSearchVariables } from "../../orm/mutation"; -export type { ProvisionFullTextSearchPayloadSelect } from "../../orm/input-types"; -export function useProvisionFullTextSearchMutation(params: { - selection: ({ - fields: S & ProvisionFullTextSearchPayloadSelect; - } & HookStrictSelect, ProvisionFullTextSearchPayloadSelect>); -} & Omit | null; -}, Error, ProvisionFullTextSearchVariables>, "mutationFn">): UseMutationResult<{ - provisionFullTextSearch: InferSelectResult | null; -}, Error, ProvisionFullTextSearchVariables> { +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 { ProvisionFullTextSearchVariables } from '../../orm/mutation'; +import type { + ProvisionFullTextSearchPayloadSelect, + ProvisionFullTextSearchPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionFullTextSearchVariables } from '../../orm/mutation'; +export type { ProvisionFullTextSearchPayloadSelect } from '../../orm/input-types'; +export function useProvisionFullTextSearchMutation( + params: { + selection: { + fields: S & ProvisionFullTextSearchPayloadSelect; + } & HookStrictSelect, ProvisionFullTextSearchPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionFullTextSearch: InferSelectResult | null; + }, + Error, + ProvisionFullTextSearchVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionFullTextSearch: InferSelectResult | null; + }, + Error, + ProvisionFullTextSearchVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionFullTextSearch(), - mutationFn: (variables: ProvisionFullTextSearchVariables) => getClient().mutation.provisionFullTextSearch(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionFullTextSearchVariables) => + getClient() + .mutation.provisionFullTextSearch(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionIndexMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionIndexMutation.ts index 7d93151628..c195e16439 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionIndexMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionIndexMutation.ts @@ -4,39 +4,52 @@ * 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 { ProvisionIndexVariables } from "../../orm/mutation"; -import type { ProvisionIndexPayloadSelect, ProvisionIndexPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionIndexVariables } from "../../orm/mutation"; -export type { ProvisionIndexPayloadSelect } from "../../orm/input-types"; -export function useProvisionIndexMutation(params: { - selection: ({ - fields: S & ProvisionIndexPayloadSelect; - } & HookStrictSelect, ProvisionIndexPayloadSelect>); -} & Omit | null; -}, Error, ProvisionIndexVariables>, "mutationFn">): UseMutationResult<{ - provisionIndex: InferSelectResult | null; -}, Error, ProvisionIndexVariables> { +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 { ProvisionIndexVariables } from '../../orm/mutation'; +import type { ProvisionIndexPayloadSelect, ProvisionIndexPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionIndexVariables } from '../../orm/mutation'; +export type { ProvisionIndexPayloadSelect } from '../../orm/input-types'; +export function useProvisionIndexMutation( + params: { + selection: { + fields: S & ProvisionIndexPayloadSelect; + } & HookStrictSelect, ProvisionIndexPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionIndex: InferSelectResult | null; + }, + Error, + ProvisionIndexVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionIndex: InferSelectResult | null; + }, + Error, + ProvisionIndexVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionIndex(), - mutationFn: (variables: ProvisionIndexVariables) => getClient().mutation.provisionIndex(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionIndexVariables) => + getClient() + .mutation.provisionIndex(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionRelationMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionRelationMutation.ts index bf64213184..bb8032dba0 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionRelationMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionRelationMutation.ts @@ -4,39 +4,55 @@ * 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 { ProvisionRelationVariables } from "../../orm/mutation"; -import type { ProvisionRelationPayloadSelect, ProvisionRelationPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionRelationVariables } from "../../orm/mutation"; -export type { ProvisionRelationPayloadSelect } from "../../orm/input-types"; -export function useProvisionRelationMutation(params: { - selection: ({ - fields: S & ProvisionRelationPayloadSelect; - } & HookStrictSelect, ProvisionRelationPayloadSelect>); -} & Omit | null; -}, Error, ProvisionRelationVariables>, "mutationFn">): UseMutationResult<{ - provisionRelation: InferSelectResult | null; -}, Error, ProvisionRelationVariables> { +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 { ProvisionRelationVariables } from '../../orm/mutation'; +import type { + ProvisionRelationPayloadSelect, + ProvisionRelationPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionRelationVariables } from '../../orm/mutation'; +export type { ProvisionRelationPayloadSelect } from '../../orm/input-types'; +export function useProvisionRelationMutation( + params: { + selection: { + fields: S & ProvisionRelationPayloadSelect; + } & HookStrictSelect, ProvisionRelationPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionRelation: InferSelectResult | null; + }, + Error, + ProvisionRelationVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionRelation: InferSelectResult | null; + }, + Error, + ProvisionRelationVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionRelation(), - mutationFn: (variables: ProvisionRelationVariables) => getClient().mutation.provisionRelation(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionRelationVariables) => + getClient() + .mutation.provisionRelation(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionSpatialRelationMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionSpatialRelationMutation.ts index e061dd0bcb..5d09d35fdb 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionSpatialRelationMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionSpatialRelationMutation.ts @@ -4,39 +4,57 @@ * 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 { ProvisionSpatialRelationVariables } from "../../orm/mutation"; -import type { ProvisionSpatialRelationPayloadSelect, ProvisionSpatialRelationPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionSpatialRelationVariables } from "../../orm/mutation"; -export type { ProvisionSpatialRelationPayloadSelect } from "../../orm/input-types"; -export function useProvisionSpatialRelationMutation(params: { - selection: ({ - fields: S & ProvisionSpatialRelationPayloadSelect; - } & HookStrictSelect, ProvisionSpatialRelationPayloadSelect>); -} & Omit | null; -}, Error, ProvisionSpatialRelationVariables>, "mutationFn">): UseMutationResult<{ - provisionSpatialRelation: InferSelectResult | null; -}, Error, ProvisionSpatialRelationVariables> { +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 { ProvisionSpatialRelationVariables } from '../../orm/mutation'; +import type { + ProvisionSpatialRelationPayloadSelect, + ProvisionSpatialRelationPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionSpatialRelationVariables } from '../../orm/mutation'; +export type { ProvisionSpatialRelationPayloadSelect } from '../../orm/input-types'; +export function useProvisionSpatialRelationMutation< + S extends ProvisionSpatialRelationPayloadSelect, +>( + params: { + selection: { + fields: S & ProvisionSpatialRelationPayloadSelect; + } & HookStrictSelect, ProvisionSpatialRelationPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionSpatialRelation: InferSelectResult | null; + }, + Error, + ProvisionSpatialRelationVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionSpatialRelation: InferSelectResult | null; + }, + Error, + ProvisionSpatialRelationVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionSpatialRelation(), - mutationFn: (variables: ProvisionSpatialRelationVariables) => getClient().mutation.provisionSpatialRelation(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionSpatialRelationVariables) => + getClient() + .mutation.provisionSpatialRelation(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionTableMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionTableMutation.ts index 7a349dda2b..91f39cd892 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionTableMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionTableMutation.ts @@ -4,39 +4,52 @@ * 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 { ProvisionTableVariables } from "../../orm/mutation"; -import type { ProvisionTablePayloadSelect, ProvisionTablePayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionTableVariables } from "../../orm/mutation"; -export type { ProvisionTablePayloadSelect } from "../../orm/input-types"; -export function useProvisionTableMutation(params: { - selection: ({ - fields: S & ProvisionTablePayloadSelect; - } & HookStrictSelect, ProvisionTablePayloadSelect>); -} & Omit | null; -}, Error, ProvisionTableVariables>, "mutationFn">): UseMutationResult<{ - provisionTable: InferSelectResult | null; -}, Error, ProvisionTableVariables> { +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 { ProvisionTableVariables } from '../../orm/mutation'; +import type { ProvisionTablePayloadSelect, ProvisionTablePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionTableVariables } from '../../orm/mutation'; +export type { ProvisionTablePayloadSelect } from '../../orm/input-types'; +export function useProvisionTableMutation( + params: { + selection: { + fields: S & ProvisionTablePayloadSelect; + } & HookStrictSelect, ProvisionTablePayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionTable: InferSelectResult | null; + }, + Error, + ProvisionTableVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionTable: InferSelectResult | null; + }, + Error, + ProvisionTableVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionTable(), - mutationFn: (variables: ProvisionTableVariables) => getClient().mutation.provisionTable(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionTableVariables) => + getClient() + .mutation.provisionTable(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionUniqueConstraintMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionUniqueConstraintMutation.ts index 766b4ea1e3..7af850b840 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useProvisionUniqueConstraintMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useProvisionUniqueConstraintMutation.ts @@ -4,39 +4,57 @@ * 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 { ProvisionUniqueConstraintVariables } from "../../orm/mutation"; -import type { ProvisionUniqueConstraintPayloadSelect, ProvisionUniqueConstraintPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionUniqueConstraintVariables } from "../../orm/mutation"; -export type { ProvisionUniqueConstraintPayloadSelect } from "../../orm/input-types"; -export function useProvisionUniqueConstraintMutation(params: { - selection: ({ - fields: S & ProvisionUniqueConstraintPayloadSelect; - } & HookStrictSelect, ProvisionUniqueConstraintPayloadSelect>); -} & Omit | null; -}, Error, ProvisionUniqueConstraintVariables>, "mutationFn">): UseMutationResult<{ - provisionUniqueConstraint: InferSelectResult | null; -}, Error, ProvisionUniqueConstraintVariables> { +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 { ProvisionUniqueConstraintVariables } from '../../orm/mutation'; +import type { + ProvisionUniqueConstraintPayloadSelect, + ProvisionUniqueConstraintPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionUniqueConstraintVariables } from '../../orm/mutation'; +export type { ProvisionUniqueConstraintPayloadSelect } from '../../orm/input-types'; +export function useProvisionUniqueConstraintMutation< + S extends ProvisionUniqueConstraintPayloadSelect, +>( + params: { + selection: { + fields: S & ProvisionUniqueConstraintPayloadSelect; + } & HookStrictSelect, ProvisionUniqueConstraintPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionUniqueConstraint: InferSelectResult | null; + }, + Error, + ProvisionUniqueConstraintVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionUniqueConstraint: InferSelectResult | null; + }, + Error, + ProvisionUniqueConstraintVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionUniqueConstraint(), - mutationFn: (variables: ProvisionUniqueConstraintVariables) => getClient().mutation.provisionUniqueConstraint(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionUniqueConstraintVariables) => + getClient() + .mutation.provisionUniqueConstraint(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateAgentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateAgentModuleMutation.ts index b49c8cb3a3..7552b8fbde 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateAgentModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateAgentModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { agentModuleKeys } from "../query-keys"; -import { agentModuleMutationKeys } from "../mutation-keys"; -import type { AgentModuleSelect, AgentModuleWithRelations, AgentModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentModuleSelect, AgentModuleWithRelations, AgentModulePatch } from "../../orm/input-types"; +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 { agentModuleKeys } from '../query-keys'; +import { agentModuleMutationKeys } from '../mutation-keys'; +import type { + AgentModuleSelect, + AgentModuleWithRelations, + AgentModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AgentModuleSelect, + AgentModuleWithRelations, + AgentModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a AgentModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAgentModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', agentModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAgentModuleMutation(params: { - selection: ({ - fields: S & AgentModuleSelect; - } & HookStrictSelect, AgentModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - agentModulePatch: AgentModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateAgentModule: { - agentModule: InferSelectResult; - }; -}, Error, { - id: string; - agentModulePatch: AgentModulePatch; -}>; -export function useUpdateAgentModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAgentModuleMutation( + params: { + selection: { + fields: S & AgentModuleSelect; + } & HookStrictSelect, AgentModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateAgentModule: { + agentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + agentModulePatch: AgentModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAgentModule: { + agentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + agentModulePatch: AgentModulePatch; + } +>; +export function useUpdateAgentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + agentModulePatch: AgentModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: agentModuleMutationKeys.all, - mutationFn: ({ - id, - agentModulePatch - }: { - id: string; - agentModulePatch: AgentModulePatch; - }) => getClient().agentModule.update({ - where: { - id - }, - data: agentModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, agentModulePatch }: { id: string; agentModulePatch: AgentModulePatch }) => + getClient() + .agentModule.update({ + where: { + id, + }, + data: agentModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: agentModuleKeys.detail(variables.id) + queryKey: agentModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: agentModuleKeys.lists() + queryKey: agentModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateApiSurfaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateApiSurfaceModuleMutation.ts index e5b66d635d..e31598616b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateApiSurfaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateApiSurfaceModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { apiSurfaceModuleKeys } from "../query-keys"; -import { apiSurfaceModuleMutationKeys } from "../mutation-keys"; -import type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations, ApiSurfaceModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations, ApiSurfaceModulePatch } from "../../orm/input-types"; +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 { apiSurfaceModuleKeys } from '../query-keys'; +import { apiSurfaceModuleMutationKeys } from '../mutation-keys'; +import type { + ApiSurfaceModuleSelect, + ApiSurfaceModuleWithRelations, + ApiSurfaceModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ApiSurfaceModuleSelect, + ApiSurfaceModuleWithRelations, + ApiSurfaceModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ApiSurfaceModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateApiSurfaceModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', apiSurfaceModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateApiSurfaceModuleMutation(params: { - selection: ({ - fields: S & ApiSurfaceModuleSelect; - } & HookStrictSelect, ApiSurfaceModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - apiSurfaceModulePatch: ApiSurfaceModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateApiSurfaceModule: { - apiSurfaceModule: InferSelectResult; - }; -}, Error, { - id: string; - apiSurfaceModulePatch: ApiSurfaceModulePatch; -}>; -export function useUpdateApiSurfaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateApiSurfaceModuleMutation( + params: { + selection: { + fields: S & ApiSurfaceModuleSelect; + } & HookStrictSelect, ApiSurfaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateApiSurfaceModule: { + apiSurfaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + apiSurfaceModulePatch: ApiSurfaceModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateApiSurfaceModule: { + apiSurfaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + apiSurfaceModulePatch: ApiSurfaceModulePatch; + } +>; +export function useUpdateApiSurfaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + apiSurfaceModulePatch: ApiSurfaceModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: apiSurfaceModuleMutationKeys.all, mutationFn: ({ id, - apiSurfaceModulePatch + apiSurfaceModulePatch, }: { id: string; apiSurfaceModulePatch: ApiSurfaceModulePatch; - }) => getClient().apiSurfaceModule.update({ - where: { - id - }, - data: apiSurfaceModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .apiSurfaceModule.update({ + where: { + id, + }, + data: apiSurfaceModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: apiSurfaceModuleKeys.detail(variables.id) + queryKey: apiSurfaceModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: apiSurfaceModuleKeys.lists() + queryKey: apiSurfaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateAppModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateAppModuleMutation.ts index 2064264502..28ee09acff 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateAppModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateAppModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { appModuleKeys } from "../query-keys"; -import { appModuleMutationKeys } from "../mutation-keys"; -import type { AppModuleSelect, AppModuleWithRelations, AppModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppModuleSelect, AppModuleWithRelations, AppModulePatch } from "../../orm/input-types"; +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 { appModuleKeys } from '../query-keys'; +import { appModuleMutationKeys } from '../mutation-keys'; +import type { + AppModuleSelect, + AppModuleWithRelations, + AppModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppModuleSelect, + AppModuleWithRelations, + AppModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a AppModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppModuleMutation(params: { - selection: ({ - fields: S & AppModuleSelect; - } & HookStrictSelect, AppModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - appModulePatch: AppModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppModule: { - appModule: InferSelectResult; - }; -}, Error, { - id: string; - appModulePatch: AppModulePatch; -}>; -export function useUpdateAppModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppModuleMutation( + params: { + selection: { + fields: S & AppModuleSelect; + } & HookStrictSelect, AppModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateAppModule: { + appModule: InferSelectResult; + }; + }, + Error, + { + id: string; + appModulePatch: AppModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppModule: { + appModule: InferSelectResult; + }; + }, + Error, + { + id: string; + appModulePatch: AppModulePatch; + } +>; +export function useUpdateAppModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appModulePatch: AppModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appModuleMutationKeys.all, - mutationFn: ({ - id, - appModulePatch - }: { - id: string; - appModulePatch: AppModulePatch; - }) => getClient().appModule.update({ - where: { - id - }, - data: appModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, appModulePatch }: { id: string; appModulePatch: AppModulePatch }) => + getClient() + .appModule.update({ + where: { + id, + }, + data: appModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appModuleKeys.detail(variables.id) + queryKey: appModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appModuleKeys.lists() + queryKey: appModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBillingModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBillingModuleMutation.ts index 6f11662d57..def9a7e31e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBillingModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBillingModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { billingModuleKeys } from "../query-keys"; -import { billingModuleMutationKeys } from "../mutation-keys"; -import type { BillingModuleSelect, BillingModuleWithRelations, BillingModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingModuleSelect, BillingModuleWithRelations, BillingModulePatch } from "../../orm/input-types"; +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 { billingModuleKeys } from '../query-keys'; +import { billingModuleMutationKeys } from '../mutation-keys'; +import type { + BillingModuleSelect, + BillingModuleWithRelations, + BillingModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BillingModuleSelect, + BillingModuleWithRelations, + BillingModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a BillingModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateBillingModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', billingModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateBillingModuleMutation(params: { - selection: ({ - fields: S & BillingModuleSelect; - } & HookStrictSelect, BillingModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - billingModulePatch: BillingModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateBillingModule: { - billingModule: InferSelectResult; - }; -}, Error, { - id: string; - billingModulePatch: BillingModulePatch; -}>; -export function useUpdateBillingModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateBillingModuleMutation( + params: { + selection: { + fields: S & BillingModuleSelect; + } & HookStrictSelect, BillingModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateBillingModule: { + billingModule: InferSelectResult; + }; + }, + Error, + { + id: string; + billingModulePatch: BillingModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateBillingModule: { + billingModule: InferSelectResult; + }; + }, + Error, + { + id: string; + billingModulePatch: BillingModulePatch; + } +>; +export function useUpdateBillingModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + billingModulePatch: BillingModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: billingModuleMutationKeys.all, mutationFn: ({ id, - billingModulePatch + billingModulePatch, }: { id: string; billingModulePatch: BillingModulePatch; - }) => getClient().billingModule.update({ - where: { - id - }, - data: billingModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .billingModule.update({ + where: { + id, + }, + data: billingModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: billingModuleKeys.detail(variables.id) + queryKey: billingModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: billingModuleKeys.lists() + queryKey: billingModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBillingProviderModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBillingProviderModuleMutation.ts index a4f8a4cb77..bd0a18815a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBillingProviderModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBillingProviderModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { billingProviderModuleKeys } from "../query-keys"; -import { billingProviderModuleMutationKeys } from "../mutation-keys"; -import type { BillingProviderModuleSelect, BillingProviderModuleWithRelations, BillingProviderModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingProviderModuleSelect, BillingProviderModuleWithRelations, BillingProviderModulePatch } from "../../orm/input-types"; +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 { billingProviderModuleKeys } from '../query-keys'; +import { billingProviderModuleMutationKeys } from '../mutation-keys'; +import type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, + BillingProviderModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, + BillingProviderModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a BillingProviderModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateBillingProviderModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', billingProviderModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateBillingProviderModuleMutation(params: { - selection: ({ - fields: S & BillingProviderModuleSelect; - } & HookStrictSelect, BillingProviderModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - billingProviderModulePatch: BillingProviderModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateBillingProviderModule: { - billingProviderModule: InferSelectResult; - }; -}, Error, { - id: string; - billingProviderModulePatch: BillingProviderModulePatch; -}>; -export function useUpdateBillingProviderModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateBillingProviderModuleMutation( + params: { + selection: { + fields: S & BillingProviderModuleSelect; + } & HookStrictSelect, BillingProviderModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateBillingProviderModule: { + billingProviderModule: InferSelectResult; + }; + }, + Error, + { + id: string; + billingProviderModulePatch: BillingProviderModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateBillingProviderModule: { + billingProviderModule: InferSelectResult; + }; + }, + Error, + { + id: string; + billingProviderModulePatch: BillingProviderModulePatch; + } +>; +export function useUpdateBillingProviderModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + billingProviderModulePatch: BillingProviderModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: billingProviderModuleMutationKeys.all, mutationFn: ({ id, - billingProviderModulePatch + billingProviderModulePatch, }: { id: string; billingProviderModulePatch: BillingProviderModulePatch; - }) => getClient().billingProviderModule.update({ - where: { - id - }, - data: billingProviderModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .billingProviderModule.update({ + where: { + id, + }, + data: billingProviderModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: billingProviderModuleKeys.detail(variables.id) + queryKey: billingProviderModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: billingProviderModuleKeys.lists() + queryKey: billingProviderModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintConstructionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintConstructionMutation.ts index 4c6150b782..b773322a19 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintConstructionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintConstructionMutation.ts @@ -4,83 +4,113 @@ * 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 { blueprintConstructionKeys } from "../query-keys"; -import { blueprintConstructionMutationKeys } from "../mutation-keys"; -import type { BlueprintConstructionSelect, BlueprintConstructionWithRelations, BlueprintConstructionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintConstructionSelect, BlueprintConstructionWithRelations, BlueprintConstructionPatch } from "../../orm/input-types"; +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 { blueprintConstructionKeys } from '../query-keys'; +import { blueprintConstructionMutationKeys } from '../mutation-keys'; +import type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, + BlueprintConstructionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, + BlueprintConstructionPatch, +} from '../../orm/input-types'; /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateBlueprintConstructionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', blueprintConstructionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateBlueprintConstructionMutation(params: { - selection: ({ - fields: S & BlueprintConstructionSelect; - } & HookStrictSelect, BlueprintConstructionSelect>); -} & Omit; - }; -}, Error, { - id: string; - blueprintConstructionPatch: BlueprintConstructionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateBlueprintConstruction: { - blueprintConstruction: InferSelectResult; - }; -}, Error, { - id: string; - blueprintConstructionPatch: BlueprintConstructionPatch; -}>; -export function useUpdateBlueprintConstructionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateBlueprintConstructionMutation( + params: { + selection: { + fields: S & BlueprintConstructionSelect; + } & HookStrictSelect, BlueprintConstructionSelect>; + } & Omit< + UseMutationOptions< + { + updateBlueprintConstruction: { + blueprintConstruction: InferSelectResult; + }; + }, + Error, + { + id: string; + blueprintConstructionPatch: BlueprintConstructionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateBlueprintConstruction: { + blueprintConstruction: InferSelectResult; + }; + }, + Error, + { + id: string; + blueprintConstructionPatch: BlueprintConstructionPatch; + } +>; +export function useUpdateBlueprintConstructionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + blueprintConstructionPatch: BlueprintConstructionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintConstructionMutationKeys.all, mutationFn: ({ id, - blueprintConstructionPatch + blueprintConstructionPatch, }: { id: string; blueprintConstructionPatch: BlueprintConstructionPatch; - }) => getClient().blueprintConstruction.update({ - where: { - id - }, - data: blueprintConstructionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .blueprintConstruction.update({ + where: { + id, + }, + data: blueprintConstructionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: blueprintConstructionKeys.detail(variables.id) + queryKey: blueprintConstructionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: blueprintConstructionKeys.lists() + queryKey: blueprintConstructionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintMutation.ts index 4750c0b80d..25684518d1 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintMutation.ts @@ -4,83 +4,107 @@ * 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 { blueprintKeys } from "../query-keys"; -import { blueprintMutationKeys } from "../mutation-keys"; -import type { BlueprintSelect, BlueprintWithRelations, BlueprintPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintSelect, BlueprintWithRelations, BlueprintPatch } from "../../orm/input-types"; +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 { blueprintKeys } from '../query-keys'; +import { blueprintMutationKeys } from '../mutation-keys'; +import type { + BlueprintSelect, + BlueprintWithRelations, + BlueprintPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintSelect, + BlueprintWithRelations, + BlueprintPatch, +} from '../../orm/input-types'; /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateBlueprintMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', blueprintPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateBlueprintMutation(params: { - selection: ({ - fields: S & BlueprintSelect; - } & HookStrictSelect, BlueprintSelect>); -} & Omit; - }; -}, Error, { - id: string; - blueprintPatch: BlueprintPatch; -}>, "mutationFn">): UseMutationResult<{ - updateBlueprint: { - blueprint: InferSelectResult; - }; -}, Error, { - id: string; - blueprintPatch: BlueprintPatch; -}>; -export function useUpdateBlueprintMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateBlueprintMutation( + params: { + selection: { + fields: S & BlueprintSelect; + } & HookStrictSelect, BlueprintSelect>; + } & Omit< + UseMutationOptions< + { + updateBlueprint: { + blueprint: InferSelectResult; + }; + }, + Error, + { + id: string; + blueprintPatch: BlueprintPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateBlueprint: { + blueprint: InferSelectResult; + }; + }, + Error, + { + id: string; + blueprintPatch: BlueprintPatch; + } +>; +export function useUpdateBlueprintMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + blueprintPatch: BlueprintPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintMutationKeys.all, - mutationFn: ({ - id, - blueprintPatch - }: { - id: string; - blueprintPatch: BlueprintPatch; - }) => getClient().blueprint.update({ - where: { - id - }, - data: blueprintPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, blueprintPatch }: { id: string; blueprintPatch: BlueprintPatch }) => + getClient() + .blueprint.update({ + where: { + id, + }, + data: blueprintPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: blueprintKeys.detail(variables.id) + queryKey: blueprintKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: blueprintKeys.lists() + queryKey: blueprintKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintTemplateMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintTemplateMutation.ts index d714644732..324321d9a3 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintTemplateMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateBlueprintTemplateMutation.ts @@ -4,83 +4,113 @@ * 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 { blueprintTemplateKeys } from "../query-keys"; -import { blueprintTemplateMutationKeys } from "../mutation-keys"; -import type { BlueprintTemplateSelect, BlueprintTemplateWithRelations, BlueprintTemplatePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintTemplateSelect, BlueprintTemplateWithRelations, BlueprintTemplatePatch } from "../../orm/input-types"; +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 { blueprintTemplateKeys } from '../query-keys'; +import { blueprintTemplateMutationKeys } from '../mutation-keys'; +import type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, + BlueprintTemplatePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, + BlueprintTemplatePatch, +} from '../../orm/input-types'; /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateBlueprintTemplateMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', blueprintTemplatePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateBlueprintTemplateMutation(params: { - selection: ({ - fields: S & BlueprintTemplateSelect; - } & HookStrictSelect, BlueprintTemplateSelect>); -} & Omit; - }; -}, Error, { - id: string; - blueprintTemplatePatch: BlueprintTemplatePatch; -}>, "mutationFn">): UseMutationResult<{ - updateBlueprintTemplate: { - blueprintTemplate: InferSelectResult; - }; -}, Error, { - id: string; - blueprintTemplatePatch: BlueprintTemplatePatch; -}>; -export function useUpdateBlueprintTemplateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateBlueprintTemplateMutation( + params: { + selection: { + fields: S & BlueprintTemplateSelect; + } & HookStrictSelect, BlueprintTemplateSelect>; + } & Omit< + UseMutationOptions< + { + updateBlueprintTemplate: { + blueprintTemplate: InferSelectResult; + }; + }, + Error, + { + id: string; + blueprintTemplatePatch: BlueprintTemplatePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateBlueprintTemplate: { + blueprintTemplate: InferSelectResult; + }; + }, + Error, + { + id: string; + blueprintTemplatePatch: BlueprintTemplatePatch; + } +>; +export function useUpdateBlueprintTemplateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + blueprintTemplatePatch: BlueprintTemplatePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: blueprintTemplateMutationKeys.all, mutationFn: ({ id, - blueprintTemplatePatch + blueprintTemplatePatch, }: { id: string; blueprintTemplatePatch: BlueprintTemplatePatch; - }) => getClient().blueprintTemplate.update({ - where: { - id - }, - data: blueprintTemplatePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .blueprintTemplate.update({ + where: { + id, + }, + data: blueprintTemplatePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: blueprintTemplateKeys.detail(variables.id) + queryKey: blueprintTemplateKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: blueprintTemplateKeys.lists() + queryKey: blueprintTemplateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCatalogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCatalogModuleMutation.ts index e2f5124664..0d6f90652e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCatalogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCatalogModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { catalogModuleKeys } from "../query-keys"; -import { catalogModuleMutationKeys } from "../mutation-keys"; -import type { CatalogModuleSelect, CatalogModuleWithRelations, CatalogModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CatalogModuleSelect, CatalogModuleWithRelations, CatalogModulePatch } from "../../orm/input-types"; +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 { catalogModuleKeys } from '../query-keys'; +import { catalogModuleMutationKeys } from '../mutation-keys'; +import type { + CatalogModuleSelect, + CatalogModuleWithRelations, + CatalogModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CatalogModuleSelect, + CatalogModuleWithRelations, + CatalogModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a CatalogModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateCatalogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', catalogModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateCatalogModuleMutation(params: { - selection: ({ - fields: S & CatalogModuleSelect; - } & HookStrictSelect, CatalogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - catalogModulePatch: CatalogModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateCatalogModule: { - catalogModule: InferSelectResult; - }; -}, Error, { - id: string; - catalogModulePatch: CatalogModulePatch; -}>; -export function useUpdateCatalogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateCatalogModuleMutation( + params: { + selection: { + fields: S & CatalogModuleSelect; + } & HookStrictSelect, CatalogModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateCatalogModule: { + catalogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + catalogModulePatch: CatalogModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateCatalogModule: { + catalogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + catalogModulePatch: CatalogModulePatch; + } +>; +export function useUpdateCatalogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + catalogModulePatch: CatalogModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: catalogModuleMutationKeys.all, mutationFn: ({ id, - catalogModulePatch + catalogModulePatch, }: { id: string; catalogModulePatch: CatalogModulePatch; - }) => getClient().catalogModule.update({ - where: { - id - }, - data: catalogModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .catalogModule.update({ + where: { + id, + }, + data: catalogModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: catalogModuleKeys.detail(variables.id) + queryKey: catalogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: catalogModuleKeys.lists() + queryKey: catalogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateComputeLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateComputeLogModuleMutation.ts index d0b2688222..76dd3c4c8d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateComputeLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateComputeLogModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { computeLogModuleKeys } from "../query-keys"; -import { computeLogModuleMutationKeys } from "../mutation-keys"; -import type { ComputeLogModuleSelect, ComputeLogModuleWithRelations, ComputeLogModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ComputeLogModuleSelect, ComputeLogModuleWithRelations, ComputeLogModulePatch } from "../../orm/input-types"; +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 { computeLogModuleKeys } from '../query-keys'; +import { computeLogModuleMutationKeys } from '../mutation-keys'; +import type { + ComputeLogModuleSelect, + ComputeLogModuleWithRelations, + ComputeLogModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ComputeLogModuleSelect, + ComputeLogModuleWithRelations, + ComputeLogModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ComputeLogModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateComputeLogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', computeLogModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateComputeLogModuleMutation(params: { - selection: ({ - fields: S & ComputeLogModuleSelect; - } & HookStrictSelect, ComputeLogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - computeLogModulePatch: ComputeLogModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateComputeLogModule: { - computeLogModule: InferSelectResult; - }; -}, Error, { - id: string; - computeLogModulePatch: ComputeLogModulePatch; -}>; -export function useUpdateComputeLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateComputeLogModuleMutation( + params: { + selection: { + fields: S & ComputeLogModuleSelect; + } & HookStrictSelect, ComputeLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateComputeLogModule: { + computeLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + computeLogModulePatch: ComputeLogModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateComputeLogModule: { + computeLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + computeLogModulePatch: ComputeLogModulePatch; + } +>; +export function useUpdateComputeLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + computeLogModulePatch: ComputeLogModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: computeLogModuleMutationKeys.all, mutationFn: ({ id, - computeLogModulePatch + computeLogModulePatch, }: { id: string; computeLogModulePatch: ComputeLogModulePatch; - }) => getClient().computeLogModule.update({ - where: { - id - }, - data: computeLogModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .computeLogModule.update({ + where: { + id, + }, + data: computeLogModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: computeLogModuleKeys.detail(variables.id) + queryKey: computeLogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: computeLogModuleKeys.lists() + queryKey: computeLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateConfigSecretsUserModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateConfigSecretsUserModuleMutation.ts index 67c12a54ce..ab9482f3fe 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateConfigSecretsUserModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateConfigSecretsUserModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { configSecretsUserModuleKeys } from "../query-keys"; -import { configSecretsUserModuleMutationKeys } from "../mutation-keys"; -import type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations, ConfigSecretsUserModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations, ConfigSecretsUserModulePatch } from "../../orm/input-types"; +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 { configSecretsUserModuleKeys } from '../query-keys'; +import { configSecretsUserModuleMutationKeys } from '../mutation-keys'; +import type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, + ConfigSecretsUserModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, + ConfigSecretsUserModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ConfigSecretsUserModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateConfigSecretsUserModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', configSecretsUserModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateConfigSecretsUserModuleMutation(params: { - selection: ({ - fields: S & ConfigSecretsUserModuleSelect; - } & HookStrictSelect, ConfigSecretsUserModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - configSecretsUserModulePatch: ConfigSecretsUserModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateConfigSecretsUserModule: { - configSecretsUserModule: InferSelectResult; - }; -}, Error, { - id: string; - configSecretsUserModulePatch: ConfigSecretsUserModulePatch; -}>; -export function useUpdateConfigSecretsUserModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateConfigSecretsUserModuleMutation( + params: { + selection: { + fields: S & ConfigSecretsUserModuleSelect; + } & HookStrictSelect, ConfigSecretsUserModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateConfigSecretsUserModule: { + configSecretsUserModule: InferSelectResult; + }; + }, + Error, + { + id: string; + configSecretsUserModulePatch: ConfigSecretsUserModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateConfigSecretsUserModule: { + configSecretsUserModule: InferSelectResult; + }; + }, + Error, + { + id: string; + configSecretsUserModulePatch: ConfigSecretsUserModulePatch; + } +>; +export function useUpdateConfigSecretsUserModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + configSecretsUserModulePatch: ConfigSecretsUserModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: configSecretsUserModuleMutationKeys.all, mutationFn: ({ id, - configSecretsUserModulePatch + configSecretsUserModulePatch, }: { id: string; configSecretsUserModulePatch: ConfigSecretsUserModulePatch; - }) => getClient().configSecretsUserModule.update({ - where: { - id - }, - data: configSecretsUserModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .configSecretsUserModule.update({ + where: { + id, + }, + data: configSecretsUserModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: configSecretsUserModuleKeys.detail(variables.id) + queryKey: configSecretsUserModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: configSecretsUserModuleKeys.lists() + queryKey: configSecretsUserModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateConnectedAccountsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateConnectedAccountsModuleMutation.ts index 9b2a28118a..91acecbb40 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateConnectedAccountsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateConnectedAccountsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { connectedAccountsModuleKeys } from "../query-keys"; -import { connectedAccountsModuleMutationKeys } from "../mutation-keys"; -import type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations, ConnectedAccountsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations, ConnectedAccountsModulePatch } from "../../orm/input-types"; +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 { connectedAccountsModuleKeys } from '../query-keys'; +import { connectedAccountsModuleMutationKeys } from '../mutation-keys'; +import type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, + ConnectedAccountsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, + ConnectedAccountsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ConnectedAccountsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateConnectedAccountsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', connectedAccountsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateConnectedAccountsModuleMutation(params: { - selection: ({ - fields: S & ConnectedAccountsModuleSelect; - } & HookStrictSelect, ConnectedAccountsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - connectedAccountsModulePatch: ConnectedAccountsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateConnectedAccountsModule: { - connectedAccountsModule: InferSelectResult; - }; -}, Error, { - id: string; - connectedAccountsModulePatch: ConnectedAccountsModulePatch; -}>; -export function useUpdateConnectedAccountsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateConnectedAccountsModuleMutation( + params: { + selection: { + fields: S & ConnectedAccountsModuleSelect; + } & HookStrictSelect, ConnectedAccountsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateConnectedAccountsModule: { + connectedAccountsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + connectedAccountsModulePatch: ConnectedAccountsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateConnectedAccountsModule: { + connectedAccountsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + connectedAccountsModulePatch: ConnectedAccountsModulePatch; + } +>; +export function useUpdateConnectedAccountsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + connectedAccountsModulePatch: ConnectedAccountsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: connectedAccountsModuleMutationKeys.all, mutationFn: ({ id, - connectedAccountsModulePatch + connectedAccountsModulePatch, }: { id: string; connectedAccountsModulePatch: ConnectedAccountsModulePatch; - }) => getClient().connectedAccountsModule.update({ - where: { - id - }, - data: connectedAccountsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .connectedAccountsModule.update({ + where: { + id, + }, + data: connectedAccountsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: connectedAccountsModuleKeys.detail(variables.id) + queryKey: connectedAccountsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: connectedAccountsModuleKeys.lists() + queryKey: connectedAccountsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCryptoAddressesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCryptoAddressesModuleMutation.ts index db1baa4ef5..192f5cf501 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCryptoAddressesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCryptoAddressesModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { cryptoAddressesModuleKeys } from "../query-keys"; -import { cryptoAddressesModuleMutationKeys } from "../mutation-keys"; -import type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations, CryptoAddressesModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations, CryptoAddressesModulePatch } from "../../orm/input-types"; +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 { cryptoAddressesModuleKeys } from '../query-keys'; +import { cryptoAddressesModuleMutationKeys } from '../mutation-keys'; +import type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, + CryptoAddressesModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, + CryptoAddressesModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a CryptoAddressesModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateCryptoAddressesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', cryptoAddressesModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateCryptoAddressesModuleMutation(params: { - selection: ({ - fields: S & CryptoAddressesModuleSelect; - } & HookStrictSelect, CryptoAddressesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - cryptoAddressesModulePatch: CryptoAddressesModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateCryptoAddressesModule: { - cryptoAddressesModule: InferSelectResult; - }; -}, Error, { - id: string; - cryptoAddressesModulePatch: CryptoAddressesModulePatch; -}>; -export function useUpdateCryptoAddressesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateCryptoAddressesModuleMutation( + params: { + selection: { + fields: S & CryptoAddressesModuleSelect; + } & HookStrictSelect, CryptoAddressesModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateCryptoAddressesModule: { + cryptoAddressesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + cryptoAddressesModulePatch: CryptoAddressesModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateCryptoAddressesModule: { + cryptoAddressesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + cryptoAddressesModulePatch: CryptoAddressesModulePatch; + } +>; +export function useUpdateCryptoAddressesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + cryptoAddressesModulePatch: CryptoAddressesModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAddressesModuleMutationKeys.all, mutationFn: ({ id, - cryptoAddressesModulePatch + cryptoAddressesModulePatch, }: { id: string; cryptoAddressesModulePatch: CryptoAddressesModulePatch; - }) => getClient().cryptoAddressesModule.update({ - where: { - id - }, - data: cryptoAddressesModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .cryptoAddressesModule.update({ + where: { + id, + }, + data: cryptoAddressesModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: cryptoAddressesModuleKeys.detail(variables.id) + queryKey: cryptoAddressesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: cryptoAddressesModuleKeys.lists() + queryKey: cryptoAddressesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCryptoAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCryptoAuthModuleMutation.ts index 25a24238e4..bc53c2a60b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCryptoAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateCryptoAuthModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { cryptoAuthModuleKeys } from "../query-keys"; -import { cryptoAuthModuleMutationKeys } from "../mutation-keys"; -import type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations, CryptoAuthModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations, CryptoAuthModulePatch } from "../../orm/input-types"; +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 { cryptoAuthModuleKeys } from '../query-keys'; +import { cryptoAuthModuleMutationKeys } from '../mutation-keys'; +import type { + CryptoAuthModuleSelect, + CryptoAuthModuleWithRelations, + CryptoAuthModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CryptoAuthModuleSelect, + CryptoAuthModuleWithRelations, + CryptoAuthModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a CryptoAuthModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateCryptoAuthModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', cryptoAuthModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateCryptoAuthModuleMutation(params: { - selection: ({ - fields: S & CryptoAuthModuleSelect; - } & HookStrictSelect, CryptoAuthModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - cryptoAuthModulePatch: CryptoAuthModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateCryptoAuthModule: { - cryptoAuthModule: InferSelectResult; - }; -}, Error, { - id: string; - cryptoAuthModulePatch: CryptoAuthModulePatch; -}>; -export function useUpdateCryptoAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateCryptoAuthModuleMutation( + params: { + selection: { + fields: S & CryptoAuthModuleSelect; + } & HookStrictSelect, CryptoAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateCryptoAuthModule: { + cryptoAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + cryptoAuthModulePatch: CryptoAuthModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateCryptoAuthModule: { + cryptoAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + cryptoAuthModulePatch: CryptoAuthModulePatch; + } +>; +export function useUpdateCryptoAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + cryptoAuthModulePatch: CryptoAuthModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: cryptoAuthModuleMutationKeys.all, mutationFn: ({ id, - cryptoAuthModulePatch + cryptoAuthModulePatch, }: { id: string; cryptoAuthModulePatch: CryptoAuthModulePatch; - }) => getClient().cryptoAuthModule.update({ - where: { - id - }, - data: cryptoAuthModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .cryptoAuthModule.update({ + where: { + id, + }, + data: cryptoAuthModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: cryptoAuthModuleKeys.detail(variables.id) + queryKey: cryptoAuthModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: cryptoAuthModuleKeys.lists() + queryKey: cryptoAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDatabaseProvisionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDatabaseProvisionModuleMutation.ts index f986acf36f..f673af003a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDatabaseProvisionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDatabaseProvisionModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { databaseProvisionModuleKeys } from "../query-keys"; -import { databaseProvisionModuleMutationKeys } from "../mutation-keys"; -import type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations, DatabaseProvisionModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations, DatabaseProvisionModulePatch } from "../../orm/input-types"; +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 { databaseProvisionModuleKeys } from '../query-keys'; +import { databaseProvisionModuleMutationKeys } from '../mutation-keys'; +import type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, + DatabaseProvisionModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, + DatabaseProvisionModulePatch, +} from '../../orm/input-types'; /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDatabaseProvisionModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', databaseProvisionModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDatabaseProvisionModuleMutation(params: { - selection: ({ - fields: S & DatabaseProvisionModuleSelect; - } & HookStrictSelect, DatabaseProvisionModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseProvisionModulePatch: DatabaseProvisionModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDatabaseProvisionModule: { - databaseProvisionModule: InferSelectResult; - }; -}, Error, { - id: string; - databaseProvisionModulePatch: DatabaseProvisionModulePatch; -}>; -export function useUpdateDatabaseProvisionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDatabaseProvisionModuleMutation( + params: { + selection: { + fields: S & DatabaseProvisionModuleSelect; + } & HookStrictSelect, DatabaseProvisionModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateDatabaseProvisionModule: { + databaseProvisionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseProvisionModulePatch: DatabaseProvisionModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDatabaseProvisionModule: { + databaseProvisionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseProvisionModulePatch: DatabaseProvisionModulePatch; + } +>; +export function useUpdateDatabaseProvisionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseProvisionModulePatch: DatabaseProvisionModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseProvisionModuleMutationKeys.all, mutationFn: ({ id, - databaseProvisionModulePatch + databaseProvisionModulePatch, }: { id: string; databaseProvisionModulePatch: DatabaseProvisionModulePatch; - }) => getClient().databaseProvisionModule.update({ - where: { - id - }, - data: databaseProvisionModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .databaseProvisionModule.update({ + where: { + id, + }, + data: databaseProvisionModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.detail(variables.id) + queryKey: databaseProvisionModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.lists() + queryKey: databaseProvisionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDatabaseSettingsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDatabaseSettingsModuleMutation.ts index a9deda547a..8fd254f1e7 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDatabaseSettingsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDatabaseSettingsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { databaseSettingsModuleKeys } from "../query-keys"; -import { databaseSettingsModuleMutationKeys } from "../mutation-keys"; -import type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations, DatabaseSettingsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations, DatabaseSettingsModulePatch } from "../../orm/input-types"; +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 { databaseSettingsModuleKeys } from '../query-keys'; +import { databaseSettingsModuleMutationKeys } from '../mutation-keys'; +import type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, + DatabaseSettingsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, + DatabaseSettingsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DatabaseSettingsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDatabaseSettingsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', databaseSettingsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDatabaseSettingsModuleMutation(params: { - selection: ({ - fields: S & DatabaseSettingsModuleSelect; - } & HookStrictSelect, DatabaseSettingsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseSettingsModulePatch: DatabaseSettingsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDatabaseSettingsModule: { - databaseSettingsModule: InferSelectResult; - }; -}, Error, { - id: string; - databaseSettingsModulePatch: DatabaseSettingsModulePatch; -}>; -export function useUpdateDatabaseSettingsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDatabaseSettingsModuleMutation( + params: { + selection: { + fields: S & DatabaseSettingsModuleSelect; + } & HookStrictSelect, DatabaseSettingsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateDatabaseSettingsModule: { + databaseSettingsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseSettingsModulePatch: DatabaseSettingsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDatabaseSettingsModule: { + databaseSettingsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseSettingsModulePatch: DatabaseSettingsModulePatch; + } +>; +export function useUpdateDatabaseSettingsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseSettingsModulePatch: DatabaseSettingsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: databaseSettingsModuleMutationKeys.all, mutationFn: ({ id, - databaseSettingsModulePatch + databaseSettingsModulePatch, }: { id: string; databaseSettingsModulePatch: DatabaseSettingsModulePatch; - }) => getClient().databaseSettingsModule.update({ - where: { - id - }, - data: databaseSettingsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .databaseSettingsModule.update({ + where: { + id, + }, + data: databaseSettingsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: databaseSettingsModuleKeys.detail(variables.id) + queryKey: databaseSettingsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: databaseSettingsModuleKeys.lists() + queryKey: databaseSettingsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPoolConfigMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPoolConfigMutation.ts index 62cc431a37..6b010b3b82 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPoolConfigMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPoolConfigMutation.ts @@ -4,83 +4,107 @@ * 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 { dbPoolConfigKeys } from "../query-keys"; -import { dbPoolConfigMutationKeys } from "../mutation-keys"; -import type { DbPoolConfigSelect, DbPoolConfigWithRelations, DbPoolConfigPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolConfigSelect, DbPoolConfigWithRelations, DbPoolConfigPatch } from "../../orm/input-types"; +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 { dbPoolConfigKeys } from '../query-keys'; +import { dbPoolConfigMutationKeys } from '../mutation-keys'; +import type { + DbPoolConfigSelect, + DbPoolConfigWithRelations, + DbPoolConfigPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DbPoolConfigSelect, + DbPoolConfigWithRelations, + DbPoolConfigPatch, +} from '../../orm/input-types'; /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDbPoolConfigMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', dbPoolConfigPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDbPoolConfigMutation(params: { - selection: ({ - fields: S & DbPoolConfigSelect; - } & HookStrictSelect, DbPoolConfigSelect>); -} & Omit; - }; -}, Error, { - id: string; - dbPoolConfigPatch: DbPoolConfigPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDbPoolConfig: { - dbPoolConfig: InferSelectResult; - }; -}, Error, { - id: string; - dbPoolConfigPatch: DbPoolConfigPatch; -}>; -export function useUpdateDbPoolConfigMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDbPoolConfigMutation( + params: { + selection: { + fields: S & DbPoolConfigSelect; + } & HookStrictSelect, DbPoolConfigSelect>; + } & Omit< + UseMutationOptions< + { + updateDbPoolConfig: { + dbPoolConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPoolConfigPatch: DbPoolConfigPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDbPoolConfig: { + dbPoolConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPoolConfigPatch: DbPoolConfigPatch; + } +>; +export function useUpdateDbPoolConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + dbPoolConfigPatch: DbPoolConfigPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPoolConfigMutationKeys.all, - mutationFn: ({ - id, - dbPoolConfigPatch - }: { - id: string; - dbPoolConfigPatch: DbPoolConfigPatch; - }) => getClient().dbPoolConfig.update({ - where: { - id - }, - data: dbPoolConfigPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, dbPoolConfigPatch }: { id: string; dbPoolConfigPatch: DbPoolConfigPatch }) => + getClient() + .dbPoolConfig.update({ + where: { + id, + }, + data: dbPoolConfigPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: dbPoolConfigKeys.detail(variables.id) + queryKey: dbPoolConfigKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPoolConfigKeys.lists() + queryKey: dbPoolConfigKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPoolMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPoolMutation.ts index 229daac6e7..353b7b8ec2 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPoolMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPoolMutation.ts @@ -4,83 +4,99 @@ * 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 { dbPoolKeys } from "../query-keys"; -import { dbPoolMutationKeys } from "../mutation-keys"; -import type { DbPoolSelect, DbPoolWithRelations, DbPoolPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolSelect, DbPoolWithRelations, DbPoolPatch } from "../../orm/input-types"; +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 { dbPoolKeys } from '../query-keys'; +import { dbPoolMutationKeys } from '../mutation-keys'; +import type { DbPoolSelect, DbPoolWithRelations, DbPoolPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPoolSelect, DbPoolWithRelations, DbPoolPatch } from '../../orm/input-types'; /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDbPoolMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', dbPoolPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDbPoolMutation(params: { - selection: ({ - fields: S & DbPoolSelect; - } & HookStrictSelect, DbPoolSelect>); -} & Omit; - }; -}, Error, { - id: string; - dbPoolPatch: DbPoolPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDbPool: { - dbPool: InferSelectResult; - }; -}, Error, { - id: string; - dbPoolPatch: DbPoolPatch; -}>; -export function useUpdateDbPoolMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDbPoolMutation( + params: { + selection: { + fields: S & DbPoolSelect; + } & HookStrictSelect, DbPoolSelect>; + } & Omit< + UseMutationOptions< + { + updateDbPool: { + dbPool: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPoolPatch: DbPoolPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDbPool: { + dbPool: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPoolPatch: DbPoolPatch; + } +>; +export function useUpdateDbPoolMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + dbPoolPatch: DbPoolPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPoolMutationKeys.all, - mutationFn: ({ - id, - dbPoolPatch - }: { - id: string; - dbPoolPatch: DbPoolPatch; - }) => getClient().dbPool.update({ - where: { - id - }, - data: dbPoolPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, dbPoolPatch }: { id: string; dbPoolPatch: DbPoolPatch }) => + getClient() + .dbPool.update({ + where: { + id, + }, + data: dbPoolPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: dbPoolKeys.detail(variables.id) + queryKey: dbPoolKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPoolKeys.lists() + queryKey: dbPoolKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPresetModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPresetModuleMutation.ts index 932a054d48..9c3c246a47 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPresetModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbPresetModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { dbPresetModuleKeys } from "../query-keys"; -import { dbPresetModuleMutationKeys } from "../mutation-keys"; -import type { DbPresetModuleSelect, DbPresetModuleWithRelations, DbPresetModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetModuleSelect, DbPresetModuleWithRelations, DbPresetModulePatch } from "../../orm/input-types"; +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 { dbPresetModuleKeys } from '../query-keys'; +import { dbPresetModuleMutationKeys } from '../mutation-keys'; +import type { + DbPresetModuleSelect, + DbPresetModuleWithRelations, + DbPresetModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DbPresetModuleSelect, + DbPresetModuleWithRelations, + DbPresetModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DbPresetModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDbPresetModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', dbPresetModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDbPresetModuleMutation(params: { - selection: ({ - fields: S & DbPresetModuleSelect; - } & HookStrictSelect, DbPresetModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - dbPresetModulePatch: DbPresetModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDbPresetModule: { - dbPresetModule: InferSelectResult; - }; -}, Error, { - id: string; - dbPresetModulePatch: DbPresetModulePatch; -}>; -export function useUpdateDbPresetModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDbPresetModuleMutation( + params: { + selection: { + fields: S & DbPresetModuleSelect; + } & HookStrictSelect, DbPresetModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateDbPresetModule: { + dbPresetModule: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPresetModulePatch: DbPresetModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDbPresetModule: { + dbPresetModule: InferSelectResult; + }; + }, + Error, + { + id: string; + dbPresetModulePatch: DbPresetModulePatch; + } +>; +export function useUpdateDbPresetModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + dbPresetModulePatch: DbPresetModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbPresetModuleMutationKeys.all, mutationFn: ({ id, - dbPresetModulePatch + dbPresetModulePatch, }: { id: string; dbPresetModulePatch: DbPresetModulePatch; - }) => getClient().dbPresetModule.update({ - where: { - id - }, - data: dbPresetModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .dbPresetModule.update({ + where: { + id, + }, + data: dbPresetModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: dbPresetModuleKeys.detail(variables.id) + queryKey: dbPresetModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbPresetModuleKeys.lists() + queryKey: dbPresetModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbUsageModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbUsageModuleMutation.ts index 06f227c647..b725657cf7 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbUsageModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDbUsageModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { dbUsageModuleKeys } from "../query-keys"; -import { dbUsageModuleMutationKeys } from "../mutation-keys"; -import type { DbUsageModuleSelect, DbUsageModuleWithRelations, DbUsageModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbUsageModuleSelect, DbUsageModuleWithRelations, DbUsageModulePatch } from "../../orm/input-types"; +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 { dbUsageModuleKeys } from '../query-keys'; +import { dbUsageModuleMutationKeys } from '../mutation-keys'; +import type { + DbUsageModuleSelect, + DbUsageModuleWithRelations, + DbUsageModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DbUsageModuleSelect, + DbUsageModuleWithRelations, + DbUsageModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DbUsageModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDbUsageModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', dbUsageModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDbUsageModuleMutation(params: { - selection: ({ - fields: S & DbUsageModuleSelect; - } & HookStrictSelect, DbUsageModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - dbUsageModulePatch: DbUsageModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDbUsageModule: { - dbUsageModule: InferSelectResult; - }; -}, Error, { - id: string; - dbUsageModulePatch: DbUsageModulePatch; -}>; -export function useUpdateDbUsageModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDbUsageModuleMutation( + params: { + selection: { + fields: S & DbUsageModuleSelect; + } & HookStrictSelect, DbUsageModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateDbUsageModule: { + dbUsageModule: InferSelectResult; + }; + }, + Error, + { + id: string; + dbUsageModulePatch: DbUsageModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDbUsageModule: { + dbUsageModule: InferSelectResult; + }; + }, + Error, + { + id: string; + dbUsageModulePatch: DbUsageModulePatch; + } +>; +export function useUpdateDbUsageModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + dbUsageModulePatch: DbUsageModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: dbUsageModuleMutationKeys.all, mutationFn: ({ id, - dbUsageModulePatch + dbUsageModulePatch, }: { id: string; dbUsageModulePatch: DbUsageModulePatch; - }) => getClient().dbUsageModule.update({ - where: { - id - }, - data: dbUsageModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .dbUsageModule.update({ + where: { + id, + }, + data: dbUsageModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: dbUsageModuleKeys.detail(variables.id) + queryKey: dbUsageModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: dbUsageModuleKeys.lists() + queryKey: dbUsageModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDefaultIdsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDefaultIdsModuleMutation.ts index 066cc42296..26bd6ff0e9 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDefaultIdsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDefaultIdsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { defaultIdsModuleKeys } from "../query-keys"; -import { defaultIdsModuleMutationKeys } from "../mutation-keys"; -import type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations, DefaultIdsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations, DefaultIdsModulePatch } from "../../orm/input-types"; +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 { defaultIdsModuleKeys } from '../query-keys'; +import { defaultIdsModuleMutationKeys } from '../mutation-keys'; +import type { + DefaultIdsModuleSelect, + DefaultIdsModuleWithRelations, + DefaultIdsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DefaultIdsModuleSelect, + DefaultIdsModuleWithRelations, + DefaultIdsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DefaultIdsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDefaultIdsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', defaultIdsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDefaultIdsModuleMutation(params: { - selection: ({ - fields: S & DefaultIdsModuleSelect; - } & HookStrictSelect, DefaultIdsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - defaultIdsModulePatch: DefaultIdsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDefaultIdsModule: { - defaultIdsModule: InferSelectResult; - }; -}, Error, { - id: string; - defaultIdsModulePatch: DefaultIdsModulePatch; -}>; -export function useUpdateDefaultIdsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDefaultIdsModuleMutation( + params: { + selection: { + fields: S & DefaultIdsModuleSelect; + } & HookStrictSelect, DefaultIdsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateDefaultIdsModule: { + defaultIdsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + defaultIdsModulePatch: DefaultIdsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDefaultIdsModule: { + defaultIdsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + defaultIdsModulePatch: DefaultIdsModulePatch; + } +>; +export function useUpdateDefaultIdsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + defaultIdsModulePatch: DefaultIdsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: defaultIdsModuleMutationKeys.all, mutationFn: ({ id, - defaultIdsModulePatch + defaultIdsModulePatch, }: { id: string; defaultIdsModulePatch: DefaultIdsModulePatch; - }) => getClient().defaultIdsModule.update({ - where: { - id - }, - data: defaultIdsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .defaultIdsModule.update({ + where: { + id, + }, + data: defaultIdsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: defaultIdsModuleKeys.detail(variables.id) + queryKey: defaultIdsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: defaultIdsModuleKeys.lists() + queryKey: defaultIdsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDenormalizedTableFieldMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDenormalizedTableFieldMutation.ts index 1399923a3a..61e4a7bd85 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDenormalizedTableFieldMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDenormalizedTableFieldMutation.ts @@ -4,83 +4,113 @@ * 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 { denormalizedTableFieldKeys } from "../query-keys"; -import { denormalizedTableFieldMutationKeys } from "../mutation-keys"; -import type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations, DenormalizedTableFieldPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations, DenormalizedTableFieldPatch } from "../../orm/input-types"; +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 { denormalizedTableFieldKeys } from '../query-keys'; +import { denormalizedTableFieldMutationKeys } from '../mutation-keys'; +import type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, + DenormalizedTableFieldPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, + DenormalizedTableFieldPatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DenormalizedTableField - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDenormalizedTableFieldMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', denormalizedTableFieldPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDenormalizedTableFieldMutation(params: { - selection: ({ - fields: S & DenormalizedTableFieldSelect; - } & HookStrictSelect, DenormalizedTableFieldSelect>); -} & Omit; - }; -}, Error, { - id: string; - denormalizedTableFieldPatch: DenormalizedTableFieldPatch; -}>, "mutationFn">): UseMutationResult<{ - updateDenormalizedTableField: { - denormalizedTableField: InferSelectResult; - }; -}, Error, { - id: string; - denormalizedTableFieldPatch: DenormalizedTableFieldPatch; -}>; -export function useUpdateDenormalizedTableFieldMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDenormalizedTableFieldMutation( + params: { + selection: { + fields: S & DenormalizedTableFieldSelect; + } & HookStrictSelect, DenormalizedTableFieldSelect>; + } & Omit< + UseMutationOptions< + { + updateDenormalizedTableField: { + denormalizedTableField: InferSelectResult; + }; + }, + Error, + { + id: string; + denormalizedTableFieldPatch: DenormalizedTableFieldPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDenormalizedTableField: { + denormalizedTableField: InferSelectResult; + }; + }, + Error, + { + id: string; + denormalizedTableFieldPatch: DenormalizedTableFieldPatch; + } +>; +export function useUpdateDenormalizedTableFieldMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + denormalizedTableFieldPatch: DenormalizedTableFieldPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: denormalizedTableFieldMutationKeys.all, mutationFn: ({ id, - denormalizedTableFieldPatch + denormalizedTableFieldPatch, }: { id: string; denormalizedTableFieldPatch: DenormalizedTableFieldPatch; - }) => getClient().denormalizedTableField.update({ - where: { - id - }, - data: denormalizedTableFieldPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .denormalizedTableField.update({ + where: { + id, + }, + data: denormalizedTableFieldPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: denormalizedTableFieldKeys.detail(variables.id) + queryKey: denormalizedTableFieldKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: denormalizedTableFieldKeys.lists() + queryKey: denormalizedTableFieldKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDevicesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDevicesModuleMutation.ts index 3916492bd2..adf2443607 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDevicesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDevicesModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { devicesModuleKeys } from "../query-keys"; -import { devicesModuleMutationKeys } from "../mutation-keys"; -import type { DevicesModuleSelect, DevicesModuleWithRelations, DevicesModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DevicesModuleSelect, DevicesModuleWithRelations, DevicesModulePatch } from "../../orm/input-types"; +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 { devicesModuleKeys } from '../query-keys'; +import { devicesModuleMutationKeys } from '../mutation-keys'; +import type { + DevicesModuleSelect, + DevicesModuleWithRelations, + DevicesModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DevicesModuleSelect, + DevicesModuleWithRelations, + DevicesModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DevicesModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDevicesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', devicesModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDevicesModuleMutation(params: { - selection: ({ - fields: S & DevicesModuleSelect; - } & HookStrictSelect, DevicesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - devicesModulePatch: DevicesModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDevicesModule: { - devicesModule: InferSelectResult; - }; -}, Error, { - id: string; - devicesModulePatch: DevicesModulePatch; -}>; -export function useUpdateDevicesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDevicesModuleMutation( + params: { + selection: { + fields: S & DevicesModuleSelect; + } & HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + devicesModulePatch: DevicesModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDevicesModule: { + devicesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + devicesModulePatch: DevicesModulePatch; + } +>; +export function useUpdateDevicesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + devicesModulePatch: DevicesModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: devicesModuleMutationKeys.all, mutationFn: ({ id, - devicesModulePatch + devicesModulePatch, }: { id: string; devicesModulePatch: DevicesModulePatch; - }) => getClient().devicesModule.update({ - where: { - id - }, - data: devicesModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .devicesModule.update({ + where: { + id, + }, + data: devicesModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: devicesModuleKeys.detail(variables.id) + queryKey: devicesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: devicesModuleKeys.lists() + queryKey: devicesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDomainModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDomainModuleMutation.ts index d444f2b5d8..4b80589978 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDomainModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateDomainModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { domainModuleKeys } from "../query-keys"; -import { domainModuleMutationKeys } from "../mutation-keys"; -import type { DomainModuleSelect, DomainModuleWithRelations, DomainModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainModuleSelect, DomainModuleWithRelations, DomainModulePatch } from "../../orm/input-types"; +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 { domainModuleKeys } from '../query-keys'; +import { domainModuleMutationKeys } from '../mutation-keys'; +import type { + DomainModuleSelect, + DomainModuleWithRelations, + DomainModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DomainModuleSelect, + DomainModuleWithRelations, + DomainModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a DomainModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateDomainModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', domainModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateDomainModuleMutation(params: { - selection: ({ - fields: S & DomainModuleSelect; - } & HookStrictSelect, DomainModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - domainModulePatch: DomainModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateDomainModule: { - domainModule: InferSelectResult; - }; -}, Error, { - id: string; - domainModulePatch: DomainModulePatch; -}>; -export function useUpdateDomainModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateDomainModuleMutation( + params: { + selection: { + fields: S & DomainModuleSelect; + } & HookStrictSelect, DomainModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateDomainModule: { + domainModule: InferSelectResult; + }; + }, + Error, + { + id: string; + domainModulePatch: DomainModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateDomainModule: { + domainModule: InferSelectResult; + }; + }, + Error, + { + id: string; + domainModulePatch: DomainModulePatch; + } +>; +export function useUpdateDomainModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + domainModulePatch: DomainModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: domainModuleMutationKeys.all, - mutationFn: ({ - id, - domainModulePatch - }: { - id: string; - domainModulePatch: DomainModulePatch; - }) => getClient().domainModule.update({ - where: { - id - }, - data: domainModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, domainModulePatch }: { id: string; domainModulePatch: DomainModulePatch }) => + getClient() + .domainModule.update({ + where: { + id, + }, + data: domainModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: domainModuleKeys.detail(variables.id) + queryKey: domainModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: domainModuleKeys.lists() + queryKey: domainModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEmailsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEmailsModuleMutation.ts index c75f899a94..bb2f31170c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEmailsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEmailsModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { emailsModuleKeys } from "../query-keys"; -import { emailsModuleMutationKeys } from "../mutation-keys"; -import type { EmailsModuleSelect, EmailsModuleWithRelations, EmailsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailsModuleSelect, EmailsModuleWithRelations, EmailsModulePatch } from "../../orm/input-types"; +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 { emailsModuleKeys } from '../query-keys'; +import { emailsModuleMutationKeys } from '../mutation-keys'; +import type { + EmailsModuleSelect, + EmailsModuleWithRelations, + EmailsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EmailsModuleSelect, + EmailsModuleWithRelations, + EmailsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a EmailsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateEmailsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', emailsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateEmailsModuleMutation(params: { - selection: ({ - fields: S & EmailsModuleSelect; - } & HookStrictSelect, EmailsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - emailsModulePatch: EmailsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateEmailsModule: { - emailsModule: InferSelectResult; - }; -}, Error, { - id: string; - emailsModulePatch: EmailsModulePatch; -}>; -export function useUpdateEmailsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateEmailsModuleMutation( + params: { + selection: { + fields: S & EmailsModuleSelect; + } & HookStrictSelect, EmailsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateEmailsModule: { + emailsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + emailsModulePatch: EmailsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateEmailsModule: { + emailsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + emailsModulePatch: EmailsModulePatch; + } +>; +export function useUpdateEmailsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + emailsModulePatch: EmailsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: emailsModuleMutationKeys.all, - mutationFn: ({ - id, - emailsModulePatch - }: { - id: string; - emailsModulePatch: EmailsModulePatch; - }) => getClient().emailsModule.update({ - where: { - id - }, - data: emailsModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, emailsModulePatch }: { id: string; emailsModulePatch: EmailsModulePatch }) => + getClient() + .emailsModule.update({ + where: { + id, + }, + data: emailsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: emailsModuleKeys.detail(variables.id) + queryKey: emailsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: emailsModuleKeys.lists() + queryKey: emailsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEntityTypeProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEntityTypeProvisionMutation.ts index 9d9b78f651..a95af50c3c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEntityTypeProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEntityTypeProvisionMutation.ts @@ -11,16 +11,24 @@ * 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 { entityTypeProvisionKeys } from "../query-keys"; -import { entityTypeProvisionMutationKeys } from "../mutation-keys"; -import type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations, EntityTypeProvisionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations, EntityTypeProvisionPatch } from "../../orm/input-types"; +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 { entityTypeProvisionKeys } from '../query-keys'; +import { entityTypeProvisionMutationKeys } from '../mutation-keys'; +import type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, + EntityTypeProvisionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, + EntityTypeProvisionPatch, +} from '../../orm/input-types'; /** * Provisions a new membership entity type. Each INSERT creates an entity table, registers a membership type, and installs the required modules (permissions, memberships, limits) plus optional modules (profiles, levels, invites). @@ -40,61 +48,83 @@ export type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations, Entit * mutate({ id: 'value-here', entityTypeProvisionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateEntityTypeProvisionMutation(params: { - selection: ({ - fields: S & EntityTypeProvisionSelect; - } & HookStrictSelect, EntityTypeProvisionSelect>); -} & Omit; - }; -}, Error, { - id: string; - entityTypeProvisionPatch: EntityTypeProvisionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateEntityTypeProvision: { - entityTypeProvision: InferSelectResult; - }; -}, Error, { - id: string; - entityTypeProvisionPatch: EntityTypeProvisionPatch; -}>; -export function useUpdateEntityTypeProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateEntityTypeProvisionMutation( + params: { + selection: { + fields: S & EntityTypeProvisionSelect; + } & HookStrictSelect, EntityTypeProvisionSelect>; + } & Omit< + UseMutationOptions< + { + updateEntityTypeProvision: { + entityTypeProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + entityTypeProvisionPatch: EntityTypeProvisionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateEntityTypeProvision: { + entityTypeProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + entityTypeProvisionPatch: EntityTypeProvisionPatch; + } +>; +export function useUpdateEntityTypeProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + entityTypeProvisionPatch: EntityTypeProvisionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: entityTypeProvisionMutationKeys.all, mutationFn: ({ id, - entityTypeProvisionPatch + entityTypeProvisionPatch, }: { id: string; entityTypeProvisionPatch: EntityTypeProvisionPatch; - }) => getClient().entityTypeProvision.update({ - where: { - id - }, - data: entityTypeProvisionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .entityTypeProvision.update({ + where: { + id, + }, + data: entityTypeProvisionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: entityTypeProvisionKeys.detail(variables.id) + queryKey: entityTypeProvisionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: entityTypeProvisionKeys.lists() + queryKey: entityTypeProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEventsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEventsModuleMutation.ts index fcc98d7136..f83022b0ff 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEventsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateEventsModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { eventsModuleKeys } from "../query-keys"; -import { eventsModuleMutationKeys } from "../mutation-keys"; -import type { EventsModuleSelect, EventsModuleWithRelations, EventsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EventsModuleSelect, EventsModuleWithRelations, EventsModulePatch } from "../../orm/input-types"; +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 { eventsModuleKeys } from '../query-keys'; +import { eventsModuleMutationKeys } from '../mutation-keys'; +import type { + EventsModuleSelect, + EventsModuleWithRelations, + EventsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EventsModuleSelect, + EventsModuleWithRelations, + EventsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a EventsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateEventsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', eventsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateEventsModuleMutation(params: { - selection: ({ - fields: S & EventsModuleSelect; - } & HookStrictSelect, EventsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - eventsModulePatch: EventsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateEventsModule: { - eventsModule: InferSelectResult; - }; -}, Error, { - id: string; - eventsModulePatch: EventsModulePatch; -}>; -export function useUpdateEventsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateEventsModuleMutation( + params: { + selection: { + fields: S & EventsModuleSelect; + } & HookStrictSelect, EventsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateEventsModule: { + eventsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + eventsModulePatch: EventsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateEventsModule: { + eventsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + eventsModulePatch: EventsModulePatch; + } +>; +export function useUpdateEventsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + eventsModulePatch: EventsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: eventsModuleMutationKeys.all, - mutationFn: ({ - id, - eventsModulePatch - }: { - id: string; - eventsModulePatch: EventsModulePatch; - }) => getClient().eventsModule.update({ - where: { - id - }, - data: eventsModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, eventsModulePatch }: { id: string; eventsModulePatch: EventsModulePatch }) => + getClient() + .eventsModule.update({ + where: { + id, + }, + data: eventsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: eventsModuleKeys.detail(variables.id) + queryKey: eventsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: eventsModuleKeys.lists() + queryKey: eventsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionDeploymentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionDeploymentModuleMutation.ts index f500758b22..41e3fe9870 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionDeploymentModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionDeploymentModuleMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentModuleKeys } from "../query-keys"; -import { functionDeploymentModuleMutationKeys } from "../mutation-keys"; -import type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations, FunctionDeploymentModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations, FunctionDeploymentModulePatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import { functionDeploymentModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a FunctionDeploymentModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionDeploymentModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionDeploymentModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionDeploymentModuleMutation(params: { - selection: ({ - fields: S & FunctionDeploymentModuleSelect; - } & HookStrictSelect, FunctionDeploymentModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionDeploymentModulePatch: FunctionDeploymentModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionDeploymentModule: { - functionDeploymentModule: InferSelectResult; - }; -}, Error, { - id: string; - functionDeploymentModulePatch: FunctionDeploymentModulePatch; -}>; -export function useUpdateFunctionDeploymentModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionDeploymentModuleMutation( + params: { + selection: { + fields: S & FunctionDeploymentModuleSelect; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; + } +>; +export function useUpdateFunctionDeploymentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionDeploymentModuleMutationKeys.all, mutationFn: ({ id, - functionDeploymentModulePatch + functionDeploymentModulePatch, }: { id: string; functionDeploymentModulePatch: FunctionDeploymentModulePatch; - }) => getClient().functionDeploymentModule.update({ - where: { - id - }, - data: functionDeploymentModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionDeploymentModule.update({ + where: { + id, + }, + data: functionDeploymentModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionDeploymentModuleKeys.detail(variables.id) + queryKey: functionDeploymentModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionDeploymentModuleKeys.lists() + queryKey: functionDeploymentModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionInvocationModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionInvocationModuleMutation.ts index aee9debc98..96c39f4b97 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionInvocationModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionInvocationModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { functionInvocationModuleKeys } from "../query-keys"; -import { functionInvocationModuleMutationKeys } from "../mutation-keys"; -import type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations, FunctionInvocationModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations, FunctionInvocationModulePatch } from "../../orm/input-types"; +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 { functionInvocationModuleKeys } from '../query-keys'; +import { functionInvocationModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, + FunctionInvocationModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, + FunctionInvocationModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a FunctionInvocationModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionInvocationModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionInvocationModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionInvocationModuleMutation(params: { - selection: ({ - fields: S & FunctionInvocationModuleSelect; - } & HookStrictSelect, FunctionInvocationModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionInvocationModulePatch: FunctionInvocationModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionInvocationModule: { - functionInvocationModule: InferSelectResult; - }; -}, Error, { - id: string; - functionInvocationModulePatch: FunctionInvocationModulePatch; -}>; -export function useUpdateFunctionInvocationModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionInvocationModuleMutation( + params: { + selection: { + fields: S & FunctionInvocationModuleSelect; + } & HookStrictSelect, FunctionInvocationModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionInvocationModule: { + functionInvocationModule: InferSelectResult; + }; + }, + Error, + { + id: string; + functionInvocationModulePatch: FunctionInvocationModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionInvocationModule: { + functionInvocationModule: InferSelectResult; + }; + }, + Error, + { + id: string; + functionInvocationModulePatch: FunctionInvocationModulePatch; + } +>; +export function useUpdateFunctionInvocationModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionInvocationModulePatch: FunctionInvocationModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionInvocationModuleMutationKeys.all, mutationFn: ({ id, - functionInvocationModulePatch + functionInvocationModulePatch, }: { id: string; functionInvocationModulePatch: FunctionInvocationModulePatch; - }) => getClient().functionInvocationModule.update({ - where: { - id - }, - data: functionInvocationModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionInvocationModule.update({ + where: { + id, + }, + data: functionInvocationModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionInvocationModuleKeys.detail(variables.id) + queryKey: functionInvocationModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionInvocationModuleKeys.lists() + queryKey: functionInvocationModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionModuleMutation.ts index d6864c893c..5a8958623a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { functionModuleKeys } from "../query-keys"; -import { functionModuleMutationKeys } from "../mutation-keys"; -import type { FunctionModuleSelect, FunctionModuleWithRelations, FunctionModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionModuleSelect, FunctionModuleWithRelations, FunctionModulePatch } from "../../orm/input-types"; +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 { functionModuleKeys } from '../query-keys'; +import { functionModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionModuleSelect, + FunctionModuleWithRelations, + FunctionModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionModuleSelect, + FunctionModuleWithRelations, + FunctionModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a FunctionModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateFunctionModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', functionModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateFunctionModuleMutation(params: { - selection: ({ - fields: S & FunctionModuleSelect; - } & HookStrictSelect, FunctionModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - functionModulePatch: FunctionModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateFunctionModule: { - functionModule: InferSelectResult; - }; -}, Error, { - id: string; - functionModulePatch: FunctionModulePatch; -}>; -export function useUpdateFunctionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateFunctionModuleMutation( + params: { + selection: { + fields: S & FunctionModuleSelect; + } & HookStrictSelect, FunctionModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionModule: { + functionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + functionModulePatch: FunctionModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionModule: { + functionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + functionModulePatch: FunctionModulePatch; + } +>; +export function useUpdateFunctionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionModulePatch: FunctionModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: functionModuleMutationKeys.all, mutationFn: ({ id, - functionModulePatch + functionModulePatch, }: { id: string; functionModulePatch: FunctionModulePatch; - }) => getClient().functionModule.update({ - where: { - id - }, - data: functionModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .functionModule.update({ + where: { + id, + }, + data: functionModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: functionModuleKeys.detail(variables.id) + queryKey: functionModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: functionModuleKeys.lists() + queryKey: functionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphExecutionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphExecutionModuleMutation.ts index b02983ece5..e5a5c20a4a 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphExecutionModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphExecutionModuleMutation.ts @@ -4,83 +4,113 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { graphExecutionModuleKeys } from "../query-keys"; -import { graphExecutionModuleMutationKeys } from "../mutation-keys"; -import type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations, GraphExecutionModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations, GraphExecutionModulePatch } from "../../orm/input-types"; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import { graphExecutionModuleMutationKeys } from '../mutation-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + GraphExecutionModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + GraphExecutionModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a GraphExecutionModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateGraphExecutionModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', graphExecutionModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateGraphExecutionModuleMutation(params: { - selection: ({ - fields: S & GraphExecutionModuleSelect; - } & HookStrictSelect, GraphExecutionModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - graphExecutionModulePatch: GraphExecutionModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateGraphExecutionModule: { - graphExecutionModule: InferSelectResult; - }; -}, Error, { - id: string; - graphExecutionModulePatch: GraphExecutionModulePatch; -}>; -export function useUpdateGraphExecutionModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateGraphExecutionModuleMutation( + params: { + selection: { + fields: S & GraphExecutionModuleSelect; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + graphExecutionModulePatch: GraphExecutionModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + graphExecutionModulePatch: GraphExecutionModulePatch; + } +>; +export function useUpdateGraphExecutionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + graphExecutionModulePatch: GraphExecutionModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: graphExecutionModuleMutationKeys.all, mutationFn: ({ id, - graphExecutionModulePatch + graphExecutionModulePatch, }: { id: string; graphExecutionModulePatch: GraphExecutionModulePatch; - }) => getClient().graphExecutionModule.update({ - where: { - id - }, - data: graphExecutionModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .graphExecutionModule.update({ + where: { + id, + }, + data: graphExecutionModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: graphExecutionModuleKeys.detail(variables.id) + queryKey: graphExecutionModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: graphExecutionModuleKeys.lists() + queryKey: graphExecutionModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphModuleMutation.ts index 6cfed067a8..27738e0d1b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { graphModuleKeys } from "../query-keys"; -import { graphModuleMutationKeys } from "../mutation-keys"; -import type { GraphModuleSelect, GraphModuleWithRelations, GraphModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphModuleSelect, GraphModuleWithRelations, GraphModulePatch } from "../../orm/input-types"; +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 { graphModuleKeys } from '../query-keys'; +import { graphModuleMutationKeys } from '../mutation-keys'; +import type { + GraphModuleSelect, + GraphModuleWithRelations, + GraphModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphModuleSelect, + GraphModuleWithRelations, + GraphModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a GraphModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateGraphModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', graphModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateGraphModuleMutation(params: { - selection: ({ - fields: S & GraphModuleSelect; - } & HookStrictSelect, GraphModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - graphModulePatch: GraphModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateGraphModule: { - graphModule: InferSelectResult; - }; -}, Error, { - id: string; - graphModulePatch: GraphModulePatch; -}>; -export function useUpdateGraphModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateGraphModuleMutation( + params: { + selection: { + fields: S & GraphModuleSelect; + } & HookStrictSelect, GraphModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateGraphModule: { + graphModule: InferSelectResult; + }; + }, + Error, + { + id: string; + graphModulePatch: GraphModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateGraphModule: { + graphModule: InferSelectResult; + }; + }, + Error, + { + id: string; + graphModulePatch: GraphModulePatch; + } +>; +export function useUpdateGraphModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + graphModulePatch: GraphModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: graphModuleMutationKeys.all, - mutationFn: ({ - id, - graphModulePatch - }: { - id: string; - graphModulePatch: GraphModulePatch; - }) => getClient().graphModule.update({ - where: { - id - }, - data: graphModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, graphModulePatch }: { id: string; graphModulePatch: GraphModulePatch }) => + getClient() + .graphModule.update({ + where: { + id, + }, + data: graphModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: graphModuleKeys.detail(variables.id) + queryKey: graphModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: graphModuleKeys.lists() + queryKey: graphModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateHierarchyModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateHierarchyModuleMutation.ts index a8bfcb1606..86c709e4c8 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateHierarchyModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateHierarchyModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { hierarchyModuleKeys } from "../query-keys"; -import { hierarchyModuleMutationKeys } from "../mutation-keys"; -import type { HierarchyModuleSelect, HierarchyModuleWithRelations, HierarchyModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HierarchyModuleSelect, HierarchyModuleWithRelations, HierarchyModulePatch } from "../../orm/input-types"; +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 { hierarchyModuleKeys } from '../query-keys'; +import { hierarchyModuleMutationKeys } from '../mutation-keys'; +import type { + HierarchyModuleSelect, + HierarchyModuleWithRelations, + HierarchyModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + HierarchyModuleSelect, + HierarchyModuleWithRelations, + HierarchyModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a HierarchyModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateHierarchyModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', hierarchyModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateHierarchyModuleMutation(params: { - selection: ({ - fields: S & HierarchyModuleSelect; - } & HookStrictSelect, HierarchyModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - hierarchyModulePatch: HierarchyModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateHierarchyModule: { - hierarchyModule: InferSelectResult; - }; -}, Error, { - id: string; - hierarchyModulePatch: HierarchyModulePatch; -}>; -export function useUpdateHierarchyModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateHierarchyModuleMutation( + params: { + selection: { + fields: S & HierarchyModuleSelect; + } & HookStrictSelect, HierarchyModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateHierarchyModule: { + hierarchyModule: InferSelectResult; + }; + }, + Error, + { + id: string; + hierarchyModulePatch: HierarchyModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateHierarchyModule: { + hierarchyModule: InferSelectResult; + }; + }, + Error, + { + id: string; + hierarchyModulePatch: HierarchyModulePatch; + } +>; +export function useUpdateHierarchyModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + hierarchyModulePatch: HierarchyModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: hierarchyModuleMutationKeys.all, mutationFn: ({ id, - hierarchyModulePatch + hierarchyModulePatch, }: { id: string; hierarchyModulePatch: HierarchyModulePatch; - }) => getClient().hierarchyModule.update({ - where: { - id - }, - data: hierarchyModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .hierarchyModule.update({ + where: { + id, + }, + data: hierarchyModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: hierarchyModuleKeys.detail(variables.id) + queryKey: hierarchyModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: hierarchyModuleKeys.lists() + queryKey: hierarchyModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateHttpRouteModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateHttpRouteModuleMutation.ts index 24d09811e0..814205cf39 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateHttpRouteModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateHttpRouteModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { httpRouteModuleKeys } from "../query-keys"; -import { httpRouteModuleMutationKeys } from "../mutation-keys"; -import type { HttpRouteModuleSelect, HttpRouteModuleWithRelations, HttpRouteModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteModuleSelect, HttpRouteModuleWithRelations, HttpRouteModulePatch } from "../../orm/input-types"; +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 { httpRouteModuleKeys } from '../query-keys'; +import { httpRouteModuleMutationKeys } from '../mutation-keys'; +import type { + HttpRouteModuleSelect, + HttpRouteModuleWithRelations, + HttpRouteModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + HttpRouteModuleSelect, + HttpRouteModuleWithRelations, + HttpRouteModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a HttpRouteModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateHttpRouteModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', httpRouteModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateHttpRouteModuleMutation(params: { - selection: ({ - fields: S & HttpRouteModuleSelect; - } & HookStrictSelect, HttpRouteModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - httpRouteModulePatch: HttpRouteModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateHttpRouteModule: { - httpRouteModule: InferSelectResult; - }; -}, Error, { - id: string; - httpRouteModulePatch: HttpRouteModulePatch; -}>; -export function useUpdateHttpRouteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateHttpRouteModuleMutation( + params: { + selection: { + fields: S & HttpRouteModuleSelect; + } & HookStrictSelect, HttpRouteModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateHttpRouteModule: { + httpRouteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + httpRouteModulePatch: HttpRouteModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateHttpRouteModule: { + httpRouteModule: InferSelectResult; + }; + }, + Error, + { + id: string; + httpRouteModulePatch: HttpRouteModulePatch; + } +>; +export function useUpdateHttpRouteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + httpRouteModulePatch: HttpRouteModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: httpRouteModuleMutationKeys.all, mutationFn: ({ id, - httpRouteModulePatch + httpRouteModulePatch, }: { id: string; httpRouteModulePatch: HttpRouteModulePatch; - }) => getClient().httpRouteModule.update({ - where: { - id - }, - data: httpRouteModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .httpRouteModule.update({ + where: { + id, + }, + data: httpRouteModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: httpRouteModuleKeys.detail(variables.id) + queryKey: httpRouteModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: httpRouteModuleKeys.lists() + queryKey: httpRouteModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateI18NModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateI18NModuleMutation.ts index 988e794855..2b54188cad 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateI18NModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateI18NModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { i18NModuleKeys } from "../query-keys"; -import { i18NModuleMutationKeys } from "../mutation-keys"; -import type { I18NModuleSelect, I18NModuleWithRelations, I18NModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { I18NModuleSelect, I18NModuleWithRelations, I18NModulePatch } from "../../orm/input-types"; +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 { i18NModuleKeys } from '../query-keys'; +import { i18NModuleMutationKeys } from '../mutation-keys'; +import type { + I18NModuleSelect, + I18NModuleWithRelations, + I18NModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + I18NModuleSelect, + I18NModuleWithRelations, + I18NModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a I18NModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateI18NModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', i18NModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateI18NModuleMutation(params: { - selection: ({ - fields: S & I18NModuleSelect; - } & HookStrictSelect, I18NModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - i18NModulePatch: I18NModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateI18NModule: { - i18NModule: InferSelectResult; - }; -}, Error, { - id: string; - i18NModulePatch: I18NModulePatch; -}>; -export function useUpdateI18NModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateI18NModuleMutation( + params: { + selection: { + fields: S & I18NModuleSelect; + } & HookStrictSelect, I18NModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateI18NModule: { + i18NModule: InferSelectResult; + }; + }, + Error, + { + id: string; + i18NModulePatch: I18NModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateI18NModule: { + i18NModule: InferSelectResult; + }; + }, + Error, + { + id: string; + i18NModulePatch: I18NModulePatch; + } +>; +export function useUpdateI18NModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + i18NModulePatch: I18NModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: i18NModuleMutationKeys.all, - mutationFn: ({ - id, - i18NModulePatch - }: { - id: string; - i18NModulePatch: I18NModulePatch; - }) => getClient().i18NModule.update({ - where: { - id - }, - data: i18NModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, i18NModulePatch }: { id: string; i18NModulePatch: I18NModulePatch }) => + getClient() + .i18NModule.update({ + where: { + id, + }, + data: i18NModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: i18NModuleKeys.detail(variables.id) + queryKey: i18NModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: i18NModuleKeys.lists() + queryKey: i18NModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateIdentityProvidersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateIdentityProvidersModuleMutation.ts index b7e0e80b0e..c54e63db69 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateIdentityProvidersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateIdentityProvidersModuleMutation.ts @@ -12,16 +12,24 @@ * 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 { identityProvidersModuleKeys } from "../query-keys"; -import { identityProvidersModuleMutationKeys } from "../mutation-keys"; -import type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations, IdentityProvidersModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations, IdentityProvidersModulePatch } from "../../orm/input-types"; +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 { identityProvidersModuleKeys } from '../query-keys'; +import { identityProvidersModuleMutationKeys } from '../mutation-keys'; +import type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, + IdentityProvidersModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, + IdentityProvidersModulePatch, +} from '../../orm/input-types'; /** * Entity-aware config row for the identity_providers_module, which provisions a per-database identity_providers table holding OAuth2 / OIDC (and future SAML) provider definitions. @@ -42,61 +50,83 @@ export type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelation * mutate({ id: 'value-here', identityProvidersModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateIdentityProvidersModuleMutation(params: { - selection: ({ - fields: S & IdentityProvidersModuleSelect; - } & HookStrictSelect, IdentityProvidersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - identityProvidersModulePatch: IdentityProvidersModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateIdentityProvidersModule: { - identityProvidersModule: InferSelectResult; - }; -}, Error, { - id: string; - identityProvidersModulePatch: IdentityProvidersModulePatch; -}>; -export function useUpdateIdentityProvidersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateIdentityProvidersModuleMutation( + params: { + selection: { + fields: S & IdentityProvidersModuleSelect; + } & HookStrictSelect, IdentityProvidersModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateIdentityProvidersModule: { + identityProvidersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + identityProvidersModulePatch: IdentityProvidersModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateIdentityProvidersModule: { + identityProvidersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + identityProvidersModulePatch: IdentityProvidersModulePatch; + } +>; +export function useUpdateIdentityProvidersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + identityProvidersModulePatch: IdentityProvidersModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: identityProvidersModuleMutationKeys.all, mutationFn: ({ id, - identityProvidersModulePatch + identityProvidersModulePatch, }: { id: string; identityProvidersModulePatch: IdentityProvidersModulePatch; - }) => getClient().identityProvidersModule.update({ - where: { - id - }, - data: identityProvidersModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .identityProvidersModule.update({ + where: { + id, + }, + data: identityProvidersModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: identityProvidersModuleKeys.detail(variables.id) + queryKey: identityProvidersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: identityProvidersModuleKeys.lists() + queryKey: identityProvidersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInferenceLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInferenceLogModuleMutation.ts index a0722836e1..29d5bb0b3e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInferenceLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInferenceLogModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { inferenceLogModuleKeys } from "../query-keys"; -import { inferenceLogModuleMutationKeys } from "../mutation-keys"; -import type { InferenceLogModuleSelect, InferenceLogModuleWithRelations, InferenceLogModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InferenceLogModuleSelect, InferenceLogModuleWithRelations, InferenceLogModulePatch } from "../../orm/input-types"; +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 { inferenceLogModuleKeys } from '../query-keys'; +import { inferenceLogModuleMutationKeys } from '../mutation-keys'; +import type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, + InferenceLogModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, + InferenceLogModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a InferenceLogModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInferenceLogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', inferenceLogModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInferenceLogModuleMutation(params: { - selection: ({ - fields: S & InferenceLogModuleSelect; - } & HookStrictSelect, InferenceLogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - inferenceLogModulePatch: InferenceLogModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateInferenceLogModule: { - inferenceLogModule: InferSelectResult; - }; -}, Error, { - id: string; - inferenceLogModulePatch: InferenceLogModulePatch; -}>; -export function useUpdateInferenceLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInferenceLogModuleMutation( + params: { + selection: { + fields: S & InferenceLogModuleSelect; + } & HookStrictSelect, InferenceLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateInferenceLogModule: { + inferenceLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + inferenceLogModulePatch: InferenceLogModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInferenceLogModule: { + inferenceLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + inferenceLogModulePatch: InferenceLogModulePatch; + } +>; +export function useUpdateInferenceLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + inferenceLogModulePatch: InferenceLogModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: inferenceLogModuleMutationKeys.all, mutationFn: ({ id, - inferenceLogModulePatch + inferenceLogModulePatch, }: { id: string; inferenceLogModulePatch: InferenceLogModulePatch; - }) => getClient().inferenceLogModule.update({ - where: { - id - }, - data: inferenceLogModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .inferenceLogModule.update({ + where: { + id, + }, + data: inferenceLogModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: inferenceLogModuleKeys.detail(variables.id) + queryKey: inferenceLogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: inferenceLogModuleKeys.lists() + queryKey: inferenceLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInfraConfigModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInfraConfigModuleMutation.ts index 7876a6a475..833944cbbc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInfraConfigModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInfraConfigModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { infraConfigModuleKeys } from "../query-keys"; -import { infraConfigModuleMutationKeys } from "../mutation-keys"; -import type { InfraConfigModuleSelect, InfraConfigModuleWithRelations, InfraConfigModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraConfigModuleSelect, InfraConfigModuleWithRelations, InfraConfigModulePatch } from "../../orm/input-types"; +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 { infraConfigModuleKeys } from '../query-keys'; +import { infraConfigModuleMutationKeys } from '../mutation-keys'; +import type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, + InfraConfigModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, + InfraConfigModulePatch, +} from '../../orm/input-types'; /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInfraConfigModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', infraConfigModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInfraConfigModuleMutation(params: { - selection: ({ - fields: S & InfraConfigModuleSelect; - } & HookStrictSelect, InfraConfigModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - infraConfigModulePatch: InfraConfigModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateInfraConfigModule: { - infraConfigModule: InferSelectResult; - }; -}, Error, { - id: string; - infraConfigModulePatch: InfraConfigModulePatch; -}>; -export function useUpdateInfraConfigModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInfraConfigModuleMutation( + params: { + selection: { + fields: S & InfraConfigModuleSelect; + } & HookStrictSelect, InfraConfigModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateInfraConfigModule: { + infraConfigModule: InferSelectResult; + }; + }, + Error, + { + id: string; + infraConfigModulePatch: InfraConfigModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInfraConfigModule: { + infraConfigModule: InferSelectResult; + }; + }, + Error, + { + id: string; + infraConfigModulePatch: InfraConfigModulePatch; + } +>; +export function useUpdateInfraConfigModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + infraConfigModulePatch: InfraConfigModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraConfigModuleMutationKeys.all, mutationFn: ({ id, - infraConfigModulePatch + infraConfigModulePatch, }: { id: string; infraConfigModulePatch: InfraConfigModulePatch; - }) => getClient().infraConfigModule.update({ - where: { - id - }, - data: infraConfigModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .infraConfigModule.update({ + where: { + id, + }, + data: infraConfigModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: infraConfigModuleKeys.detail(variables.id) + queryKey: infraConfigModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraConfigModuleKeys.lists() + queryKey: infraConfigModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInfraSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInfraSecretsModuleMutation.ts index d1fbfcb603..2c627f8d9e 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInfraSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInfraSecretsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { infraSecretsModuleKeys } from "../query-keys"; -import { infraSecretsModuleMutationKeys } from "../mutation-keys"; -import type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations, InfraSecretsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations, InfraSecretsModulePatch } from "../../orm/input-types"; +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 { infraSecretsModuleKeys } from '../query-keys'; +import { infraSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, + InfraSecretsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, + InfraSecretsModulePatch, +} from '../../orm/input-types'; /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInfraSecretsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', infraSecretsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInfraSecretsModuleMutation(params: { - selection: ({ - fields: S & InfraSecretsModuleSelect; - } & HookStrictSelect, InfraSecretsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - infraSecretsModulePatch: InfraSecretsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateInfraSecretsModule: { - infraSecretsModule: InferSelectResult; - }; -}, Error, { - id: string; - infraSecretsModulePatch: InfraSecretsModulePatch; -}>; -export function useUpdateInfraSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInfraSecretsModuleMutation( + params: { + selection: { + fields: S & InfraSecretsModuleSelect; + } & HookStrictSelect, InfraSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateInfraSecretsModule: { + infraSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + infraSecretsModulePatch: InfraSecretsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInfraSecretsModule: { + infraSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + infraSecretsModulePatch: InfraSecretsModulePatch; + } +>; +export function useUpdateInfraSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + infraSecretsModulePatch: InfraSecretsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: infraSecretsModuleMutationKeys.all, mutationFn: ({ id, - infraSecretsModulePatch + infraSecretsModulePatch, }: { id: string; infraSecretsModulePatch: InfraSecretsModulePatch; - }) => getClient().infraSecretsModule.update({ - where: { - id - }, - data: infraSecretsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .infraSecretsModule.update({ + where: { + id, + }, + data: infraSecretsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: infraSecretsModuleKeys.detail(variables.id) + queryKey: infraSecretsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: infraSecretsModuleKeys.lists() + queryKey: infraSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateIntegrationProvidersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateIntegrationProvidersModuleMutation.ts index 1763ef02b4..85da47663f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateIntegrationProvidersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateIntegrationProvidersModuleMutation.ts @@ -8,16 +8,24 @@ * 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 { integrationProvidersModuleKeys } from "../query-keys"; -import { integrationProvidersModuleMutationKeys } from "../mutation-keys"; -import type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations, IntegrationProvidersModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations, IntegrationProvidersModulePatch } from "../../orm/input-types"; +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 { integrationProvidersModuleKeys } from '../query-keys'; +import { integrationProvidersModuleMutationKeys } from '../mutation-keys'; +import type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, + IntegrationProvidersModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, + IntegrationProvidersModulePatch, +} from '../../orm/input-types'; /** * Config row for the integration_providers_module, which provisions a per-database integration_providers table holding branded, reusable service definitions. @@ -34,61 +42,85 @@ export type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRe * mutate({ id: 'value-here', integrationProvidersModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateIntegrationProvidersModuleMutation(params: { - selection: ({ - fields: S & IntegrationProvidersModuleSelect; - } & HookStrictSelect, IntegrationProvidersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - integrationProvidersModulePatch: IntegrationProvidersModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateIntegrationProvidersModule: { - integrationProvidersModule: InferSelectResult; - }; -}, Error, { - id: string; - integrationProvidersModulePatch: IntegrationProvidersModulePatch; -}>; -export function useUpdateIntegrationProvidersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateIntegrationProvidersModuleMutation< + S extends IntegrationProvidersModuleSelect, +>( + params: { + selection: { + fields: S & IntegrationProvidersModuleSelect; + } & HookStrictSelect, IntegrationProvidersModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateIntegrationProvidersModule: { + integrationProvidersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + integrationProvidersModulePatch: IntegrationProvidersModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateIntegrationProvidersModule: { + integrationProvidersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + integrationProvidersModulePatch: IntegrationProvidersModulePatch; + } +>; +export function useUpdateIntegrationProvidersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + integrationProvidersModulePatch: IntegrationProvidersModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: integrationProvidersModuleMutationKeys.all, mutationFn: ({ id, - integrationProvidersModulePatch + integrationProvidersModulePatch, }: { id: string; integrationProvidersModulePatch: IntegrationProvidersModulePatch; - }) => getClient().integrationProvidersModule.update({ - where: { - id - }, - data: integrationProvidersModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .integrationProvidersModule.update({ + where: { + id, + }, + data: integrationProvidersModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: integrationProvidersModuleKeys.detail(variables.id) + queryKey: integrationProvidersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: integrationProvidersModuleKeys.lists() + queryKey: integrationProvidersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInternalSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInternalSecretsModuleMutation.ts index a6dd4c7620..eac708d682 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInternalSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInternalSecretsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { internalSecretsModuleKeys } from "../query-keys"; -import { internalSecretsModuleMutationKeys } from "../mutation-keys"; -import type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations, InternalSecretsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations, InternalSecretsModulePatch } from "../../orm/input-types"; +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 { internalSecretsModuleKeys } from '../query-keys'; +import { internalSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, + InternalSecretsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, + InternalSecretsModulePatch, +} from '../../orm/input-types'; /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInternalSecretsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', internalSecretsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInternalSecretsModuleMutation(params: { - selection: ({ - fields: S & InternalSecretsModuleSelect; - } & HookStrictSelect, InternalSecretsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - internalSecretsModulePatch: InternalSecretsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateInternalSecretsModule: { - internalSecretsModule: InferSelectResult; - }; -}, Error, { - id: string; - internalSecretsModulePatch: InternalSecretsModulePatch; -}>; -export function useUpdateInternalSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInternalSecretsModuleMutation( + params: { + selection: { + fields: S & InternalSecretsModuleSelect; + } & HookStrictSelect, InternalSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateInternalSecretsModule: { + internalSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + internalSecretsModulePatch: InternalSecretsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInternalSecretsModule: { + internalSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + internalSecretsModulePatch: InternalSecretsModulePatch; + } +>; +export function useUpdateInternalSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + internalSecretsModulePatch: InternalSecretsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: internalSecretsModuleMutationKeys.all, mutationFn: ({ id, - internalSecretsModulePatch + internalSecretsModulePatch, }: { id: string; internalSecretsModulePatch: InternalSecretsModulePatch; - }) => getClient().internalSecretsModule.update({ - where: { - id - }, - data: internalSecretsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .internalSecretsModule.update({ + where: { + id, + }, + data: internalSecretsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: internalSecretsModuleKeys.detail(variables.id) + queryKey: internalSecretsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: internalSecretsModuleKeys.lists() + queryKey: internalSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInvitesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInvitesModuleMutation.ts index db01c2b4f6..93ac288176 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInvitesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateInvitesModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { invitesModuleKeys } from "../query-keys"; -import { invitesModuleMutationKeys } from "../mutation-keys"; -import type { InvitesModuleSelect, InvitesModuleWithRelations, InvitesModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InvitesModuleSelect, InvitesModuleWithRelations, InvitesModulePatch } from "../../orm/input-types"; +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 { invitesModuleKeys } from '../query-keys'; +import { invitesModuleMutationKeys } from '../mutation-keys'; +import type { + InvitesModuleSelect, + InvitesModuleWithRelations, + InvitesModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InvitesModuleSelect, + InvitesModuleWithRelations, + InvitesModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a InvitesModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateInvitesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', invitesModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateInvitesModuleMutation(params: { - selection: ({ - fields: S & InvitesModuleSelect; - } & HookStrictSelect, InvitesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - invitesModulePatch: InvitesModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateInvitesModule: { - invitesModule: InferSelectResult; - }; -}, Error, { - id: string; - invitesModulePatch: InvitesModulePatch; -}>; -export function useUpdateInvitesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateInvitesModuleMutation( + params: { + selection: { + fields: S & InvitesModuleSelect; + } & HookStrictSelect, InvitesModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateInvitesModule: { + invitesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + invitesModulePatch: InvitesModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateInvitesModule: { + invitesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + invitesModulePatch: InvitesModulePatch; + } +>; +export function useUpdateInvitesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + invitesModulePatch: InvitesModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: invitesModuleMutationKeys.all, mutationFn: ({ id, - invitesModulePatch + invitesModulePatch, }: { id: string; invitesModulePatch: InvitesModulePatch; - }) => getClient().invitesModule.update({ - where: { - id - }, - data: invitesModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .invitesModule.update({ + where: { + id, + }, + data: invitesModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: invitesModuleKeys.detail(variables.id) + queryKey: invitesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: invitesModuleKeys.lists() + queryKey: invitesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateLimitsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateLimitsModuleMutation.ts index 78fb0a0b35..99d8a86813 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateLimitsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateLimitsModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { limitsModuleKeys } from "../query-keys"; -import { limitsModuleMutationKeys } from "../mutation-keys"; -import type { LimitsModuleSelect, LimitsModuleWithRelations, LimitsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { LimitsModuleSelect, LimitsModuleWithRelations, LimitsModulePatch } from "../../orm/input-types"; +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 { limitsModuleKeys } from '../query-keys'; +import { limitsModuleMutationKeys } from '../mutation-keys'; +import type { + LimitsModuleSelect, + LimitsModuleWithRelations, + LimitsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + LimitsModuleSelect, + LimitsModuleWithRelations, + LimitsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a LimitsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateLimitsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', limitsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateLimitsModuleMutation(params: { - selection: ({ - fields: S & LimitsModuleSelect; - } & HookStrictSelect, LimitsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - limitsModulePatch: LimitsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateLimitsModule: { - limitsModule: InferSelectResult; - }; -}, Error, { - id: string; - limitsModulePatch: LimitsModulePatch; -}>; -export function useUpdateLimitsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateLimitsModuleMutation( + params: { + selection: { + fields: S & LimitsModuleSelect; + } & HookStrictSelect, LimitsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateLimitsModule: { + limitsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + limitsModulePatch: LimitsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateLimitsModule: { + limitsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + limitsModulePatch: LimitsModulePatch; + } +>; +export function useUpdateLimitsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + limitsModulePatch: LimitsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: limitsModuleMutationKeys.all, - mutationFn: ({ - id, - limitsModulePatch - }: { - id: string; - limitsModulePatch: LimitsModulePatch; - }) => getClient().limitsModule.update({ - where: { - id - }, - data: limitsModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, limitsModulePatch }: { id: string; limitsModulePatch: LimitsModulePatch }) => + getClient() + .limitsModule.update({ + where: { + id, + }, + data: limitsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: limitsModuleKeys.detail(variables.id) + queryKey: limitsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: limitsModuleKeys.lists() + queryKey: limitsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMembershipTypesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMembershipTypesModuleMutation.ts index b42d0057cd..57c080be1b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMembershipTypesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMembershipTypesModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { membershipTypesModuleKeys } from "../query-keys"; -import { membershipTypesModuleMutationKeys } from "../mutation-keys"; -import type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations, MembershipTypesModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations, MembershipTypesModulePatch } from "../../orm/input-types"; +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 { membershipTypesModuleKeys } from '../query-keys'; +import { membershipTypesModuleMutationKeys } from '../mutation-keys'; +import type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, + MembershipTypesModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, + MembershipTypesModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a MembershipTypesModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateMembershipTypesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', membershipTypesModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateMembershipTypesModuleMutation(params: { - selection: ({ - fields: S & MembershipTypesModuleSelect; - } & HookStrictSelect, MembershipTypesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - membershipTypesModulePatch: MembershipTypesModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateMembershipTypesModule: { - membershipTypesModule: InferSelectResult; - }; -}, Error, { - id: string; - membershipTypesModulePatch: MembershipTypesModulePatch; -}>; -export function useUpdateMembershipTypesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateMembershipTypesModuleMutation( + params: { + selection: { + fields: S & MembershipTypesModuleSelect; + } & HookStrictSelect, MembershipTypesModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateMembershipTypesModule: { + membershipTypesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + membershipTypesModulePatch: MembershipTypesModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateMembershipTypesModule: { + membershipTypesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + membershipTypesModulePatch: MembershipTypesModulePatch; + } +>; +export function useUpdateMembershipTypesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + membershipTypesModulePatch: MembershipTypesModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipTypesModuleMutationKeys.all, mutationFn: ({ id, - membershipTypesModulePatch + membershipTypesModulePatch, }: { id: string; membershipTypesModulePatch: MembershipTypesModulePatch; - }) => getClient().membershipTypesModule.update({ - where: { - id - }, - data: membershipTypesModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .membershipTypesModule.update({ + where: { + id, + }, + data: membershipTypesModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: membershipTypesModuleKeys.detail(variables.id) + queryKey: membershipTypesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: membershipTypesModuleKeys.lists() + queryKey: membershipTypesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMembershipsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMembershipsModuleMutation.ts index 68b02dfbde..5571846e84 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMembershipsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMembershipsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { membershipsModuleKeys } from "../query-keys"; -import { membershipsModuleMutationKeys } from "../mutation-keys"; -import type { MembershipsModuleSelect, MembershipsModuleWithRelations, MembershipsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipsModuleSelect, MembershipsModuleWithRelations, MembershipsModulePatch } from "../../orm/input-types"; +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 { membershipsModuleKeys } from '../query-keys'; +import { membershipsModuleMutationKeys } from '../mutation-keys'; +import type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, + MembershipsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, + MembershipsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a MembershipsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateMembershipsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', membershipsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateMembershipsModuleMutation(params: { - selection: ({ - fields: S & MembershipsModuleSelect; - } & HookStrictSelect, MembershipsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - membershipsModulePatch: MembershipsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateMembershipsModule: { - membershipsModule: InferSelectResult; - }; -}, Error, { - id: string; - membershipsModulePatch: MembershipsModulePatch; -}>; -export function useUpdateMembershipsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateMembershipsModuleMutation( + params: { + selection: { + fields: S & MembershipsModuleSelect; + } & HookStrictSelect, MembershipsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateMembershipsModule: { + membershipsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + membershipsModulePatch: MembershipsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateMembershipsModule: { + membershipsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + membershipsModulePatch: MembershipsModulePatch; + } +>; +export function useUpdateMembershipsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + membershipsModulePatch: MembershipsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: membershipsModuleMutationKeys.all, mutationFn: ({ id, - membershipsModulePatch + membershipsModulePatch, }: { id: string; membershipsModulePatch: MembershipsModulePatch; - }) => getClient().membershipsModule.update({ - where: { - id - }, - data: membershipsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .membershipsModule.update({ + where: { + id, + }, + data: membershipsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: membershipsModuleKeys.detail(variables.id) + queryKey: membershipsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: membershipsModuleKeys.lists() + queryKey: membershipsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMerkleStoreModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMerkleStoreModuleMutation.ts index e14c2d0a0e..4f079920a6 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMerkleStoreModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateMerkleStoreModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { merkleStoreModuleKeys } from "../query-keys"; -import { merkleStoreModuleMutationKeys } from "../mutation-keys"; -import type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations, MerkleStoreModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations, MerkleStoreModulePatch } from "../../orm/input-types"; +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 { merkleStoreModuleKeys } from '../query-keys'; +import { merkleStoreModuleMutationKeys } from '../mutation-keys'; +import type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, + MerkleStoreModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, + MerkleStoreModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a MerkleStoreModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateMerkleStoreModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', merkleStoreModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateMerkleStoreModuleMutation(params: { - selection: ({ - fields: S & MerkleStoreModuleSelect; - } & HookStrictSelect, MerkleStoreModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - merkleStoreModulePatch: MerkleStoreModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateMerkleStoreModule: { - merkleStoreModule: InferSelectResult; - }; -}, Error, { - id: string; - merkleStoreModulePatch: MerkleStoreModulePatch; -}>; -export function useUpdateMerkleStoreModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateMerkleStoreModuleMutation( + params: { + selection: { + fields: S & MerkleStoreModuleSelect; + } & HookStrictSelect, MerkleStoreModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateMerkleStoreModule: { + merkleStoreModule: InferSelectResult; + }; + }, + Error, + { + id: string; + merkleStoreModulePatch: MerkleStoreModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateMerkleStoreModule: { + merkleStoreModule: InferSelectResult; + }; + }, + Error, + { + id: string; + merkleStoreModulePatch: MerkleStoreModulePatch; + } +>; +export function useUpdateMerkleStoreModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + merkleStoreModulePatch: MerkleStoreModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: merkleStoreModuleMutationKeys.all, mutationFn: ({ id, - merkleStoreModulePatch + merkleStoreModulePatch, }: { id: string; merkleStoreModulePatch: MerkleStoreModulePatch; - }) => getClient().merkleStoreModule.update({ - where: { - id - }, - data: merkleStoreModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .merkleStoreModule.update({ + where: { + id, + }, + data: merkleStoreModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.detail(variables.id) + queryKey: merkleStoreModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.lists() + queryKey: merkleStoreModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateNamespaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateNamespaceModuleMutation.ts index 325d861484..38f0932999 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateNamespaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateNamespaceModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { namespaceModuleKeys } from "../query-keys"; -import { namespaceModuleMutationKeys } from "../mutation-keys"; -import type { NamespaceModuleSelect, NamespaceModuleWithRelations, NamespaceModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceModuleSelect, NamespaceModuleWithRelations, NamespaceModulePatch } from "../../orm/input-types"; +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 { namespaceModuleKeys } from '../query-keys'; +import { namespaceModuleMutationKeys } from '../mutation-keys'; +import type { + NamespaceModuleSelect, + NamespaceModuleWithRelations, + NamespaceModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NamespaceModuleSelect, + NamespaceModuleWithRelations, + NamespaceModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a NamespaceModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateNamespaceModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', namespaceModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateNamespaceModuleMutation(params: { - selection: ({ - fields: S & NamespaceModuleSelect; - } & HookStrictSelect, NamespaceModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - namespaceModulePatch: NamespaceModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateNamespaceModule: { - namespaceModule: InferSelectResult; - }; -}, Error, { - id: string; - namespaceModulePatch: NamespaceModulePatch; -}>; -export function useUpdateNamespaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateNamespaceModuleMutation( + params: { + selection: { + fields: S & NamespaceModuleSelect; + } & HookStrictSelect, NamespaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateNamespaceModule: { + namespaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + namespaceModulePatch: NamespaceModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateNamespaceModule: { + namespaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + namespaceModulePatch: NamespaceModulePatch; + } +>; +export function useUpdateNamespaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + namespaceModulePatch: NamespaceModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: namespaceModuleMutationKeys.all, mutationFn: ({ id, - namespaceModulePatch + namespaceModulePatch, }: { id: string; namespaceModulePatch: NamespaceModulePatch; - }) => getClient().namespaceModule.update({ - where: { - id - }, - data: namespaceModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .namespaceModule.update({ + where: { + id, + }, + data: namespaceModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.detail(variables.id) + queryKey: namespaceModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.lists() + queryKey: namespaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateNotificationsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateNotificationsModuleMutation.ts index 010c4f9df2..b6815448c8 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateNotificationsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateNotificationsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { notificationsModuleKeys } from "../query-keys"; -import { notificationsModuleMutationKeys } from "../mutation-keys"; -import type { NotificationsModuleSelect, NotificationsModuleWithRelations, NotificationsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NotificationsModuleSelect, NotificationsModuleWithRelations, NotificationsModulePatch } from "../../orm/input-types"; +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 { notificationsModuleKeys } from '../query-keys'; +import { notificationsModuleMutationKeys } from '../mutation-keys'; +import type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, + NotificationsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, + NotificationsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a NotificationsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateNotificationsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', notificationsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateNotificationsModuleMutation(params: { - selection: ({ - fields: S & NotificationsModuleSelect; - } & HookStrictSelect, NotificationsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - notificationsModulePatch: NotificationsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateNotificationsModule: { - notificationsModule: InferSelectResult; - }; -}, Error, { - id: string; - notificationsModulePatch: NotificationsModulePatch; -}>; -export function useUpdateNotificationsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateNotificationsModuleMutation( + params: { + selection: { + fields: S & NotificationsModuleSelect; + } & HookStrictSelect, NotificationsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateNotificationsModule: { + notificationsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + notificationsModulePatch: NotificationsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateNotificationsModule: { + notificationsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + notificationsModulePatch: NotificationsModulePatch; + } +>; +export function useUpdateNotificationsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + notificationsModulePatch: NotificationsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: notificationsModuleMutationKeys.all, mutationFn: ({ id, - notificationsModulePatch + notificationsModulePatch, }: { id: string; notificationsModulePatch: NotificationsModulePatch; - }) => getClient().notificationsModule.update({ - where: { - id - }, - data: notificationsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .notificationsModule.update({ + where: { + id, + }, + data: notificationsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: notificationsModuleKeys.detail(variables.id) + queryKey: notificationsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: notificationsModuleKeys.lists() + queryKey: notificationsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePermissionsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePermissionsModuleMutation.ts index ff53d10471..de206e8b71 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePermissionsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePermissionsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { permissionsModuleKeys } from "../query-keys"; -import { permissionsModuleMutationKeys } from "../mutation-keys"; -import type { PermissionsModuleSelect, PermissionsModuleWithRelations, PermissionsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PermissionsModuleSelect, PermissionsModuleWithRelations, PermissionsModulePatch } from "../../orm/input-types"; +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 { permissionsModuleKeys } from '../query-keys'; +import { permissionsModuleMutationKeys } from '../mutation-keys'; +import type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, + PermissionsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, + PermissionsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a PermissionsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePermissionsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', permissionsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePermissionsModuleMutation(params: { - selection: ({ - fields: S & PermissionsModuleSelect; - } & HookStrictSelect, PermissionsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - permissionsModulePatch: PermissionsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePermissionsModule: { - permissionsModule: InferSelectResult; - }; -}, Error, { - id: string; - permissionsModulePatch: PermissionsModulePatch; -}>; -export function useUpdatePermissionsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePermissionsModuleMutation( + params: { + selection: { + fields: S & PermissionsModuleSelect; + } & HookStrictSelect, PermissionsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updatePermissionsModule: { + permissionsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + permissionsModulePatch: PermissionsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePermissionsModule: { + permissionsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + permissionsModulePatch: PermissionsModulePatch; + } +>; +export function useUpdatePermissionsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + permissionsModulePatch: PermissionsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: permissionsModuleMutationKeys.all, mutationFn: ({ id, - permissionsModulePatch + permissionsModulePatch, }: { id: string; permissionsModulePatch: PermissionsModulePatch; - }) => getClient().permissionsModule.update({ - where: { - id - }, - data: permissionsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .permissionsModule.update({ + where: { + id, + }, + data: permissionsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: permissionsModuleKeys.detail(variables.id) + queryKey: permissionsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: permissionsModuleKeys.lists() + queryKey: permissionsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePhoneNumbersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePhoneNumbersModuleMutation.ts index 1e3d23d45c..c1250ba4fc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePhoneNumbersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePhoneNumbersModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { phoneNumbersModuleKeys } from "../query-keys"; -import { phoneNumbersModuleMutationKeys } from "../mutation-keys"; -import type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations, PhoneNumbersModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations, PhoneNumbersModulePatch } from "../../orm/input-types"; +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 { phoneNumbersModuleKeys } from '../query-keys'; +import { phoneNumbersModuleMutationKeys } from '../mutation-keys'; +import type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, + PhoneNumbersModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, + PhoneNumbersModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a PhoneNumbersModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePhoneNumbersModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', phoneNumbersModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePhoneNumbersModuleMutation(params: { - selection: ({ - fields: S & PhoneNumbersModuleSelect; - } & HookStrictSelect, PhoneNumbersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - phoneNumbersModulePatch: PhoneNumbersModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePhoneNumbersModule: { - phoneNumbersModule: InferSelectResult; - }; -}, Error, { - id: string; - phoneNumbersModulePatch: PhoneNumbersModulePatch; -}>; -export function useUpdatePhoneNumbersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePhoneNumbersModuleMutation( + params: { + selection: { + fields: S & PhoneNumbersModuleSelect; + } & HookStrictSelect, PhoneNumbersModuleSelect>; + } & Omit< + UseMutationOptions< + { + updatePhoneNumbersModule: { + phoneNumbersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + phoneNumbersModulePatch: PhoneNumbersModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePhoneNumbersModule: { + phoneNumbersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + phoneNumbersModulePatch: PhoneNumbersModulePatch; + } +>; +export function useUpdatePhoneNumbersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + phoneNumbersModulePatch: PhoneNumbersModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: phoneNumbersModuleMutationKeys.all, mutationFn: ({ id, - phoneNumbersModulePatch + phoneNumbersModulePatch, }: { id: string; phoneNumbersModulePatch: PhoneNumbersModulePatch; - }) => getClient().phoneNumbersModule.update({ - where: { - id - }, - data: phoneNumbersModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .phoneNumbersModule.update({ + where: { + id, + }, + data: phoneNumbersModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: phoneNumbersModuleKeys.detail(variables.id) + queryKey: phoneNumbersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: phoneNumbersModuleKeys.lists() + queryKey: phoneNumbersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePlansModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePlansModuleMutation.ts index 203fc4c7fa..1d6f585d8b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePlansModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePlansModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { plansModuleKeys } from "../query-keys"; -import { plansModuleMutationKeys } from "../mutation-keys"; -import type { PlansModuleSelect, PlansModuleWithRelations, PlansModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlansModuleSelect, PlansModuleWithRelations, PlansModulePatch } from "../../orm/input-types"; +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 { plansModuleKeys } from '../query-keys'; +import { plansModuleMutationKeys } from '../mutation-keys'; +import type { + PlansModuleSelect, + PlansModuleWithRelations, + PlansModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlansModuleSelect, + PlansModuleWithRelations, + PlansModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a PlansModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdatePlansModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', plansModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdatePlansModuleMutation(params: { - selection: ({ - fields: S & PlansModuleSelect; - } & HookStrictSelect, PlansModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - plansModulePatch: PlansModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePlansModule: { - plansModule: InferSelectResult; - }; -}, Error, { - id: string; - plansModulePatch: PlansModulePatch; -}>; -export function useUpdatePlansModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdatePlansModuleMutation( + params: { + selection: { + fields: S & PlansModuleSelect; + } & HookStrictSelect, PlansModuleSelect>; + } & Omit< + UseMutationOptions< + { + updatePlansModule: { + plansModule: InferSelectResult; + }; + }, + Error, + { + id: string; + plansModulePatch: PlansModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlansModule: { + plansModule: InferSelectResult; + }; + }, + Error, + { + id: string; + plansModulePatch: PlansModulePatch; + } +>; +export function useUpdatePlansModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + plansModulePatch: PlansModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: plansModuleMutationKeys.all, - mutationFn: ({ - id, - plansModulePatch - }: { - id: string; - plansModulePatch: PlansModulePatch; - }) => getClient().plansModule.update({ - where: { - id - }, - data: plansModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, plansModulePatch }: { id: string; plansModulePatch: PlansModulePatch }) => + getClient() + .plansModule.update({ + where: { + id, + }, + data: plansModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: plansModuleKeys.detail(variables.id) + queryKey: plansModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: plansModuleKeys.lists() + queryKey: plansModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.ts index f4a9ef646f..025bbf0a2d 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.ts @@ -4,83 +4,113 @@ * 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"; +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; - }; -}, Error, { - id: string; - principalAuthModulePatch: PrincipalAuthModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updatePrincipalAuthModule: { - principalAuthModule: InferSelectResult; - }; -}, Error, { - id: string; - principalAuthModulePatch: PrincipalAuthModulePatch; -}>; -export function useUpdatePrincipalAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +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 ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: principalAuthModuleMutationKeys.all, mutationFn: ({ id, - principalAuthModulePatch + principalAuthModulePatch, }: { id: string; principalAuthModulePatch: PrincipalAuthModulePatch; - }) => getClient().principalAuthModule.update({ - where: { - id - }, - data: principalAuthModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .principalAuthModule.update({ + where: { + id, + }, + data: principalAuthModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: principalAuthModuleKeys.detail(variables.id) + queryKey: principalAuthModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: principalAuthModuleKeys.lists() + queryKey: principalAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateProfilesModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateProfilesModuleMutation.ts index 021f379dca..dfe82354f3 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateProfilesModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateProfilesModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { profilesModuleKeys } from "../query-keys"; -import { profilesModuleMutationKeys } from "../mutation-keys"; -import type { ProfilesModuleSelect, ProfilesModuleWithRelations, ProfilesModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ProfilesModuleSelect, ProfilesModuleWithRelations, ProfilesModulePatch } from "../../orm/input-types"; +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 { profilesModuleKeys } from '../query-keys'; +import { profilesModuleMutationKeys } from '../mutation-keys'; +import type { + ProfilesModuleSelect, + ProfilesModuleWithRelations, + ProfilesModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ProfilesModuleSelect, + ProfilesModuleWithRelations, + ProfilesModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ProfilesModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateProfilesModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', profilesModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateProfilesModuleMutation(params: { - selection: ({ - fields: S & ProfilesModuleSelect; - } & HookStrictSelect, ProfilesModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - profilesModulePatch: ProfilesModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateProfilesModule: { - profilesModule: InferSelectResult; - }; -}, Error, { - id: string; - profilesModulePatch: ProfilesModulePatch; -}>; -export function useUpdateProfilesModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateProfilesModuleMutation( + params: { + selection: { + fields: S & ProfilesModuleSelect; + } & HookStrictSelect, ProfilesModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateProfilesModule: { + profilesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + profilesModulePatch: ProfilesModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateProfilesModule: { + profilesModule: InferSelectResult; + }; + }, + Error, + { + id: string; + profilesModulePatch: ProfilesModulePatch; + } +>; +export function useUpdateProfilesModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + profilesModulePatch: ProfilesModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: profilesModuleMutationKeys.all, mutationFn: ({ id, - profilesModulePatch + profilesModulePatch, }: { id: string; profilesModulePatch: ProfilesModulePatch; - }) => getClient().profilesModule.update({ - where: { - id - }, - data: profilesModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .profilesModule.update({ + where: { + id, + }, + data: profilesModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: profilesModuleKeys.detail(variables.id) + queryKey: profilesModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: profilesModuleKeys.lists() + queryKey: profilesModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRateLimitMetersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRateLimitMetersModuleMutation.ts index 9ce300bb6b..e124d2834c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRateLimitMetersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRateLimitMetersModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { rateLimitMetersModuleKeys } from "../query-keys"; -import { rateLimitMetersModuleMutationKeys } from "../mutation-keys"; -import type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations, RateLimitMetersModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations, RateLimitMetersModulePatch } from "../../orm/input-types"; +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 { rateLimitMetersModuleKeys } from '../query-keys'; +import { rateLimitMetersModuleMutationKeys } from '../mutation-keys'; +import type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, + RateLimitMetersModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, + RateLimitMetersModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a RateLimitMetersModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRateLimitMetersModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', rateLimitMetersModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRateLimitMetersModuleMutation(params: { - selection: ({ - fields: S & RateLimitMetersModuleSelect; - } & HookStrictSelect, RateLimitMetersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - rateLimitMetersModulePatch: RateLimitMetersModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateRateLimitMetersModule: { - rateLimitMetersModule: InferSelectResult; - }; -}, Error, { - id: string; - rateLimitMetersModulePatch: RateLimitMetersModulePatch; -}>; -export function useUpdateRateLimitMetersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRateLimitMetersModuleMutation( + params: { + selection: { + fields: S & RateLimitMetersModuleSelect; + } & HookStrictSelect, RateLimitMetersModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateRateLimitMetersModule: { + rateLimitMetersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + rateLimitMetersModulePatch: RateLimitMetersModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRateLimitMetersModule: { + rateLimitMetersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + rateLimitMetersModulePatch: RateLimitMetersModulePatch; + } +>; +export function useUpdateRateLimitMetersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + rateLimitMetersModulePatch: RateLimitMetersModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rateLimitMetersModuleMutationKeys.all, mutationFn: ({ id, - rateLimitMetersModulePatch + rateLimitMetersModulePatch, }: { id: string; rateLimitMetersModulePatch: RateLimitMetersModulePatch; - }) => getClient().rateLimitMetersModule.update({ - where: { - id - }, - data: rateLimitMetersModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .rateLimitMetersModule.update({ + where: { + id, + }, + data: rateLimitMetersModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: rateLimitMetersModuleKeys.detail(variables.id) + queryKey: rateLimitMetersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: rateLimitMetersModuleKeys.lists() + queryKey: rateLimitMetersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRateLimitsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRateLimitsModuleMutation.ts index 14cf859b85..df9a6eae64 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRateLimitsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRateLimitsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { rateLimitsModuleKeys } from "../query-keys"; -import { rateLimitsModuleMutationKeys } from "../mutation-keys"; -import type { RateLimitsModuleSelect, RateLimitsModuleWithRelations, RateLimitsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitsModuleSelect, RateLimitsModuleWithRelations, RateLimitsModulePatch } from "../../orm/input-types"; +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 { rateLimitsModuleKeys } from '../query-keys'; +import { rateLimitsModuleMutationKeys } from '../mutation-keys'; +import type { + RateLimitsModuleSelect, + RateLimitsModuleWithRelations, + RateLimitsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RateLimitsModuleSelect, + RateLimitsModuleWithRelations, + RateLimitsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a RateLimitsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRateLimitsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', rateLimitsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRateLimitsModuleMutation(params: { - selection: ({ - fields: S & RateLimitsModuleSelect; - } & HookStrictSelect, RateLimitsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - rateLimitsModulePatch: RateLimitsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateRateLimitsModule: { - rateLimitsModule: InferSelectResult; - }; -}, Error, { - id: string; - rateLimitsModulePatch: RateLimitsModulePatch; -}>; -export function useUpdateRateLimitsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRateLimitsModuleMutation( + params: { + selection: { + fields: S & RateLimitsModuleSelect; + } & HookStrictSelect, RateLimitsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateRateLimitsModule: { + rateLimitsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + rateLimitsModulePatch: RateLimitsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRateLimitsModule: { + rateLimitsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + rateLimitsModulePatch: RateLimitsModulePatch; + } +>; +export function useUpdateRateLimitsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + rateLimitsModulePatch: RateLimitsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rateLimitsModuleMutationKeys.all, mutationFn: ({ id, - rateLimitsModulePatch + rateLimitsModulePatch, }: { id: string; rateLimitsModulePatch: RateLimitsModulePatch; - }) => getClient().rateLimitsModule.update({ - where: { - id - }, - data: rateLimitsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .rateLimitsModule.update({ + where: { + id, + }, + data: rateLimitsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: rateLimitsModuleKeys.detail(variables.id) + queryKey: rateLimitsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: rateLimitsModuleKeys.lists() + queryKey: rateLimitsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRealtimeModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRealtimeModuleMutation.ts index 8ed379d49b..39254e9e85 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRealtimeModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRealtimeModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { realtimeModuleKeys } from "../query-keys"; -import { realtimeModuleMutationKeys } from "../mutation-keys"; -import type { RealtimeModuleSelect, RealtimeModuleWithRelations, RealtimeModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RealtimeModuleSelect, RealtimeModuleWithRelations, RealtimeModulePatch } from "../../orm/input-types"; +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 { realtimeModuleKeys } from '../query-keys'; +import { realtimeModuleMutationKeys } from '../mutation-keys'; +import type { + RealtimeModuleSelect, + RealtimeModuleWithRelations, + RealtimeModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RealtimeModuleSelect, + RealtimeModuleWithRelations, + RealtimeModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a RealtimeModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRealtimeModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', realtimeModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRealtimeModuleMutation(params: { - selection: ({ - fields: S & RealtimeModuleSelect; - } & HookStrictSelect, RealtimeModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - realtimeModulePatch: RealtimeModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateRealtimeModule: { - realtimeModule: InferSelectResult; - }; -}, Error, { - id: string; - realtimeModulePatch: RealtimeModulePatch; -}>; -export function useUpdateRealtimeModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRealtimeModuleMutation( + params: { + selection: { + fields: S & RealtimeModuleSelect; + } & HookStrictSelect, RealtimeModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateRealtimeModule: { + realtimeModule: InferSelectResult; + }; + }, + Error, + { + id: string; + realtimeModulePatch: RealtimeModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRealtimeModule: { + realtimeModule: InferSelectResult; + }; + }, + Error, + { + id: string; + realtimeModulePatch: RealtimeModulePatch; + } +>; +export function useUpdateRealtimeModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + realtimeModulePatch: RealtimeModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: realtimeModuleMutationKeys.all, mutationFn: ({ id, - realtimeModulePatch + realtimeModulePatch, }: { id: string; realtimeModulePatch: RealtimeModulePatch; - }) => getClient().realtimeModule.update({ - where: { - id - }, - data: realtimeModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .realtimeModule.update({ + where: { + id, + }, + data: realtimeModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: realtimeModuleKeys.detail(variables.id) + queryKey: realtimeModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: realtimeModuleKeys.lists() + queryKey: realtimeModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRelationProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRelationProvisionMutation.ts index 8f06d93f78..d74fa64df4 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRelationProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRelationProvisionMutation.ts @@ -11,16 +11,24 @@ * 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 { relationProvisionKeys } from "../query-keys"; -import { relationProvisionMutationKeys } from "../mutation-keys"; -import type { RelationProvisionSelect, RelationProvisionWithRelations, RelationProvisionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RelationProvisionSelect, RelationProvisionWithRelations, RelationProvisionPatch } from "../../orm/input-types"; +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 { relationProvisionKeys } from '../query-keys'; +import { relationProvisionMutationKeys } from '../mutation-keys'; +import type { + RelationProvisionSelect, + RelationProvisionWithRelations, + RelationProvisionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RelationProvisionSelect, + RelationProvisionWithRelations, + RelationProvisionPatch, +} from '../../orm/input-types'; /** * Provisions relational structure between tables. Supports four relation types: - RelationBelongsTo: adds a FK field on the source table referencing the target table (child perspective: "tasks belongs to projects" -> tasks.project_id). @@ -40,61 +48,83 @@ export type { RelationProvisionSelect, RelationProvisionWithRelations, RelationP * mutate({ id: 'value-here', relationProvisionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRelationProvisionMutation(params: { - selection: ({ - fields: S & RelationProvisionSelect; - } & HookStrictSelect, RelationProvisionSelect>); -} & Omit; - }; -}, Error, { - id: string; - relationProvisionPatch: RelationProvisionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateRelationProvision: { - relationProvision: InferSelectResult; - }; -}, Error, { - id: string; - relationProvisionPatch: RelationProvisionPatch; -}>; -export function useUpdateRelationProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRelationProvisionMutation( + params: { + selection: { + fields: S & RelationProvisionSelect; + } & HookStrictSelect, RelationProvisionSelect>; + } & Omit< + UseMutationOptions< + { + updateRelationProvision: { + relationProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + relationProvisionPatch: RelationProvisionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRelationProvision: { + relationProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + relationProvisionPatch: RelationProvisionPatch; + } +>; +export function useUpdateRelationProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + relationProvisionPatch: RelationProvisionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: relationProvisionMutationKeys.all, mutationFn: ({ id, - relationProvisionPatch + relationProvisionPatch, }: { id: string; relationProvisionPatch: RelationProvisionPatch; - }) => getClient().relationProvision.update({ - where: { - id - }, - data: relationProvisionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .relationProvision.update({ + where: { + id, + }, + data: relationProvisionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: relationProvisionKeys.detail(variables.id) + queryKey: relationProvisionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: relationProvisionKeys.lists() + queryKey: relationProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateResourceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateResourceModuleMutation.ts index b7e500a7ad..5cca4c4452 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateResourceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateResourceModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { resourceModuleKeys } from "../query-keys"; -import { resourceModuleMutationKeys } from "../mutation-keys"; -import type { ResourceModuleSelect, ResourceModuleWithRelations, ResourceModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceModuleSelect, ResourceModuleWithRelations, ResourceModulePatch } from "../../orm/input-types"; +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 { resourceModuleKeys } from '../query-keys'; +import { resourceModuleMutationKeys } from '../mutation-keys'; +import type { + ResourceModuleSelect, + ResourceModuleWithRelations, + ResourceModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ResourceModuleSelect, + ResourceModuleWithRelations, + ResourceModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a ResourceModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateResourceModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', resourceModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateResourceModuleMutation(params: { - selection: ({ - fields: S & ResourceModuleSelect; - } & HookStrictSelect, ResourceModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - resourceModulePatch: ResourceModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateResourceModule: { - resourceModule: InferSelectResult; - }; -}, Error, { - id: string; - resourceModulePatch: ResourceModulePatch; -}>; -export function useUpdateResourceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateResourceModuleMutation( + params: { + selection: { + fields: S & ResourceModuleSelect; + } & HookStrictSelect, ResourceModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateResourceModule: { + resourceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + resourceModulePatch: ResourceModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateResourceModule: { + resourceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + resourceModulePatch: ResourceModulePatch; + } +>; +export function useUpdateResourceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + resourceModulePatch: ResourceModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: resourceModuleMutationKeys.all, mutationFn: ({ id, - resourceModulePatch + resourceModulePatch, }: { id: string; resourceModulePatch: ResourceModulePatch; - }) => getClient().resourceModule.update({ - where: { - id - }, - data: resourceModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .resourceModule.update({ + where: { + id, + }, + data: resourceModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: resourceModuleKeys.detail(variables.id) + queryKey: resourceModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: resourceModuleKeys.lists() + queryKey: resourceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRlsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRlsModuleMutation.ts index 6d95e0a006..27ec3409cc 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRlsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRlsModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { rlsModuleKeys } from "../query-keys"; -import { rlsModuleMutationKeys } from "../mutation-keys"; -import type { RlsModuleSelect, RlsModuleWithRelations, RlsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsModuleSelect, RlsModuleWithRelations, RlsModulePatch } from "../../orm/input-types"; +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 { rlsModuleKeys } from '../query-keys'; +import { rlsModuleMutationKeys } from '../mutation-keys'; +import type { + RlsModuleSelect, + RlsModuleWithRelations, + RlsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RlsModuleSelect, + RlsModuleWithRelations, + RlsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a RlsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRlsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', rlsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRlsModuleMutation(params: { - selection: ({ - fields: S & RlsModuleSelect; - } & HookStrictSelect, RlsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - rlsModulePatch: RlsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateRlsModule: { - rlsModule: InferSelectResult; - }; -}, Error, { - id: string; - rlsModulePatch: RlsModulePatch; -}>; -export function useUpdateRlsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRlsModuleMutation( + params: { + selection: { + fields: S & RlsModuleSelect; + } & HookStrictSelect, RlsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateRlsModule: { + rlsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + rlsModulePatch: RlsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRlsModule: { + rlsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + rlsModulePatch: RlsModulePatch; + } +>; +export function useUpdateRlsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + rlsModulePatch: RlsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: rlsModuleMutationKeys.all, - mutationFn: ({ - id, - rlsModulePatch - }: { - id: string; - rlsModulePatch: RlsModulePatch; - }) => getClient().rlsModule.update({ - where: { - id - }, - data: rlsModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, rlsModulePatch }: { id: string; rlsModulePatch: RlsModulePatch }) => + getClient() + .rlsModule.update({ + where: { + id, + }, + data: rlsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: rlsModuleKeys.detail(variables.id) + queryKey: rlsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: rlsModuleKeys.lists() + queryKey: rlsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRouteModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRouteModuleMutation.ts index 463656e514..5ccf5b0b51 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRouteModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateRouteModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { routeModuleKeys } from "../query-keys"; -import { routeModuleMutationKeys } from "../mutation-keys"; -import type { RouteModuleSelect, RouteModuleWithRelations, RouteModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteModuleSelect, RouteModuleWithRelations, RouteModulePatch } from "../../orm/input-types"; +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 { routeModuleKeys } from '../query-keys'; +import { routeModuleMutationKeys } from '../mutation-keys'; +import type { + RouteModuleSelect, + RouteModuleWithRelations, + RouteModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RouteModuleSelect, + RouteModuleWithRelations, + RouteModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a RouteModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRouteModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', routeModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRouteModuleMutation(params: { - selection: ({ - fields: S & RouteModuleSelect; - } & HookStrictSelect, RouteModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - routeModulePatch: RouteModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateRouteModule: { - routeModule: InferSelectResult; - }; -}, Error, { - id: string; - routeModulePatch: RouteModulePatch; -}>; -export function useUpdateRouteModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRouteModuleMutation( + params: { + selection: { + fields: S & RouteModuleSelect; + } & HookStrictSelect, RouteModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateRouteModule: { + routeModule: InferSelectResult; + }; + }, + Error, + { + id: string; + routeModulePatch: RouteModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRouteModule: { + routeModule: InferSelectResult; + }; + }, + Error, + { + id: string; + routeModulePatch: RouteModulePatch; + } +>; +export function useUpdateRouteModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + routeModulePatch: RouteModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: routeModuleMutationKeys.all, - mutationFn: ({ - id, - routeModulePatch - }: { - id: string; - routeModulePatch: RouteModulePatch; - }) => getClient().routeModule.update({ - where: { - id - }, - data: routeModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, routeModulePatch }: { id: string; routeModulePatch: RouteModulePatch }) => + getClient() + .routeModule.update({ + where: { + id, + }, + data: routeModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: routeModuleKeys.detail(variables.id) + queryKey: routeModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: routeModuleKeys.lists() + queryKey: routeModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSecureTableProvisionMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSecureTableProvisionMutation.ts index cc0137b44b..859fb5ab0f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSecureTableProvisionMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSecureTableProvisionMutation.ts @@ -4,83 +4,113 @@ * 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 { secureTableProvisionKeys } from "../query-keys"; -import { secureTableProvisionMutationKeys } from "../mutation-keys"; -import type { SecureTableProvisionSelect, SecureTableProvisionWithRelations, SecureTableProvisionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SecureTableProvisionSelect, SecureTableProvisionWithRelations, SecureTableProvisionPatch } from "../../orm/input-types"; +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 { secureTableProvisionKeys } from '../query-keys'; +import { secureTableProvisionMutationKeys } from '../mutation-keys'; +import type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, + SecureTableProvisionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, + SecureTableProvisionPatch, +} from '../../orm/input-types'; /** * 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. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSecureTableProvisionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', secureTableProvisionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSecureTableProvisionMutation(params: { - selection: ({ - fields: S & SecureTableProvisionSelect; - } & HookStrictSelect, SecureTableProvisionSelect>); -} & Omit; - }; -}, Error, { - id: string; - secureTableProvisionPatch: SecureTableProvisionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateSecureTableProvision: { - secureTableProvision: InferSelectResult; - }; -}, Error, { - id: string; - secureTableProvisionPatch: SecureTableProvisionPatch; -}>; -export function useUpdateSecureTableProvisionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSecureTableProvisionMutation( + params: { + selection: { + fields: S & SecureTableProvisionSelect; + } & HookStrictSelect, SecureTableProvisionSelect>; + } & Omit< + UseMutationOptions< + { + updateSecureTableProvision: { + secureTableProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + secureTableProvisionPatch: SecureTableProvisionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSecureTableProvision: { + secureTableProvision: InferSelectResult; + }; + }, + Error, + { + id: string; + secureTableProvisionPatch: SecureTableProvisionPatch; + } +>; +export function useUpdateSecureTableProvisionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + secureTableProvisionPatch: SecureTableProvisionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: secureTableProvisionMutationKeys.all, mutationFn: ({ id, - secureTableProvisionPatch + secureTableProvisionPatch, }: { id: string; secureTableProvisionPatch: SecureTableProvisionPatch; - }) => getClient().secureTableProvision.update({ - where: { - id - }, - data: secureTableProvisionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .secureTableProvision.update({ + where: { + id, + }, + data: secureTableProvisionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: secureTableProvisionKeys.detail(variables.id) + queryKey: secureTableProvisionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: secureTableProvisionKeys.lists() + queryKey: secureTableProvisionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSessionSecretsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSessionSecretsModuleMutation.ts index 084900171d..e2ca0ad670 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSessionSecretsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSessionSecretsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { sessionSecretsModuleKeys } from "../query-keys"; -import { sessionSecretsModuleMutationKeys } from "../mutation-keys"; -import type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations, SessionSecretsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations, SessionSecretsModulePatch } from "../../orm/input-types"; +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 { sessionSecretsModuleKeys } from '../query-keys'; +import { sessionSecretsModuleMutationKeys } from '../mutation-keys'; +import type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, + SessionSecretsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, + SessionSecretsModulePatch, +} from '../../orm/input-types'; /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSessionSecretsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', sessionSecretsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSessionSecretsModuleMutation(params: { - selection: ({ - fields: S & SessionSecretsModuleSelect; - } & HookStrictSelect, SessionSecretsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - sessionSecretsModulePatch: SessionSecretsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateSessionSecretsModule: { - sessionSecretsModule: InferSelectResult; - }; -}, Error, { - id: string; - sessionSecretsModulePatch: SessionSecretsModulePatch; -}>; -export function useUpdateSessionSecretsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSessionSecretsModuleMutation( + params: { + selection: { + fields: S & SessionSecretsModuleSelect; + } & HookStrictSelect, SessionSecretsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateSessionSecretsModule: { + sessionSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + sessionSecretsModulePatch: SessionSecretsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSessionSecretsModule: { + sessionSecretsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + sessionSecretsModulePatch: SessionSecretsModulePatch; + } +>; +export function useUpdateSessionSecretsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + sessionSecretsModulePatch: SessionSecretsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: sessionSecretsModuleMutationKeys.all, mutationFn: ({ id, - sessionSecretsModulePatch + sessionSecretsModulePatch, }: { id: string; sessionSecretsModulePatch: SessionSecretsModulePatch; - }) => getClient().sessionSecretsModule.update({ - where: { - id - }, - data: sessionSecretsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .sessionSecretsModule.update({ + where: { + id, + }, + data: sessionSecretsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: sessionSecretsModuleKeys.detail(variables.id) + queryKey: sessionSecretsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: sessionSecretsModuleKeys.lists() + queryKey: sessionSecretsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSessionsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSessionsModuleMutation.ts index 823791a5bf..d5aebc9f18 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSessionsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSessionsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { sessionsModuleKeys } from "../query-keys"; -import { sessionsModuleMutationKeys } from "../mutation-keys"; -import type { SessionsModuleSelect, SessionsModuleWithRelations, SessionsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionsModuleSelect, SessionsModuleWithRelations, SessionsModulePatch } from "../../orm/input-types"; +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 { sessionsModuleKeys } from '../query-keys'; +import { sessionsModuleMutationKeys } from '../mutation-keys'; +import type { + SessionsModuleSelect, + SessionsModuleWithRelations, + SessionsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SessionsModuleSelect, + SessionsModuleWithRelations, + SessionsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a SessionsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSessionsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', sessionsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSessionsModuleMutation(params: { - selection: ({ - fields: S & SessionsModuleSelect; - } & HookStrictSelect, SessionsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - sessionsModulePatch: SessionsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateSessionsModule: { - sessionsModule: InferSelectResult; - }; -}, Error, { - id: string; - sessionsModulePatch: SessionsModulePatch; -}>; -export function useUpdateSessionsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSessionsModuleMutation( + params: { + selection: { + fields: S & SessionsModuleSelect; + } & HookStrictSelect, SessionsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateSessionsModule: { + sessionsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + sessionsModulePatch: SessionsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSessionsModule: { + sessionsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + sessionsModulePatch: SessionsModulePatch; + } +>; +export function useUpdateSessionsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + sessionsModulePatch: SessionsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: sessionsModuleMutationKeys.all, mutationFn: ({ id, - sessionsModulePatch + sessionsModulePatch, }: { id: string; sessionsModulePatch: SessionsModulePatch; - }) => getClient().sessionsModule.update({ - where: { - id - }, - data: sessionsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .sessionsModule.update({ + where: { + id, + }, + data: sessionsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: sessionsModuleKeys.detail(variables.id) + queryKey: sessionsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: sessionsModuleKeys.lists() + queryKey: sessionsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSiteSurfaceModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSiteSurfaceModuleMutation.ts index e51e93d15b..2379cf4468 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSiteSurfaceModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateSiteSurfaceModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { siteSurfaceModuleKeys } from "../query-keys"; -import { siteSurfaceModuleMutationKeys } from "../mutation-keys"; -import type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations, SiteSurfaceModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations, SiteSurfaceModulePatch } from "../../orm/input-types"; +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 { siteSurfaceModuleKeys } from '../query-keys'; +import { siteSurfaceModuleMutationKeys } from '../mutation-keys'; +import type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, + SiteSurfaceModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, + SiteSurfaceModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a SiteSurfaceModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateSiteSurfaceModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', siteSurfaceModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateSiteSurfaceModuleMutation(params: { - selection: ({ - fields: S & SiteSurfaceModuleSelect; - } & HookStrictSelect, SiteSurfaceModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - siteSurfaceModulePatch: SiteSurfaceModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateSiteSurfaceModule: { - siteSurfaceModule: InferSelectResult; - }; -}, Error, { - id: string; - siteSurfaceModulePatch: SiteSurfaceModulePatch; -}>; -export function useUpdateSiteSurfaceModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateSiteSurfaceModuleMutation( + params: { + selection: { + fields: S & SiteSurfaceModuleSelect; + } & HookStrictSelect, SiteSurfaceModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateSiteSurfaceModule: { + siteSurfaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + siteSurfaceModulePatch: SiteSurfaceModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSiteSurfaceModule: { + siteSurfaceModule: InferSelectResult; + }; + }, + Error, + { + id: string; + siteSurfaceModulePatch: SiteSurfaceModulePatch; + } +>; +export function useUpdateSiteSurfaceModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + siteSurfaceModulePatch: SiteSurfaceModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: siteSurfaceModuleMutationKeys.all, mutationFn: ({ id, - siteSurfaceModulePatch + siteSurfaceModulePatch, }: { id: string; siteSurfaceModulePatch: SiteSurfaceModulePatch; - }) => getClient().siteSurfaceModule.update({ - where: { - id - }, - data: siteSurfaceModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .siteSurfaceModule.update({ + where: { + id, + }, + data: siteSurfaceModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: siteSurfaceModuleKeys.detail(variables.id) + queryKey: siteSurfaceModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: siteSurfaceModuleKeys.lists() + queryKey: siteSurfaceModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateStorageLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateStorageLogModuleMutation.ts index 2fb8aac552..6819bcf8ea 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateStorageLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateStorageLogModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { storageLogModuleKeys } from "../query-keys"; -import { storageLogModuleMutationKeys } from "../mutation-keys"; -import type { StorageLogModuleSelect, StorageLogModuleWithRelations, StorageLogModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageLogModuleSelect, StorageLogModuleWithRelations, StorageLogModulePatch } from "../../orm/input-types"; +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 { storageLogModuleKeys } from '../query-keys'; +import { storageLogModuleMutationKeys } from '../mutation-keys'; +import type { + StorageLogModuleSelect, + StorageLogModuleWithRelations, + StorageLogModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + StorageLogModuleSelect, + StorageLogModuleWithRelations, + StorageLogModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a StorageLogModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateStorageLogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', storageLogModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateStorageLogModuleMutation(params: { - selection: ({ - fields: S & StorageLogModuleSelect; - } & HookStrictSelect, StorageLogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - storageLogModulePatch: StorageLogModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateStorageLogModule: { - storageLogModule: InferSelectResult; - }; -}, Error, { - id: string; - storageLogModulePatch: StorageLogModulePatch; -}>; -export function useUpdateStorageLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateStorageLogModuleMutation( + params: { + selection: { + fields: S & StorageLogModuleSelect; + } & HookStrictSelect, StorageLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateStorageLogModule: { + storageLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + storageLogModulePatch: StorageLogModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateStorageLogModule: { + storageLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + storageLogModulePatch: StorageLogModulePatch; + } +>; +export function useUpdateStorageLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + storageLogModulePatch: StorageLogModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storageLogModuleMutationKeys.all, mutationFn: ({ id, - storageLogModulePatch + storageLogModulePatch, }: { id: string; storageLogModulePatch: StorageLogModulePatch; - }) => getClient().storageLogModule.update({ - where: { - id - }, - data: storageLogModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .storageLogModule.update({ + where: { + id, + }, + data: storageLogModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: storageLogModuleKeys.detail(variables.id) + queryKey: storageLogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: storageLogModuleKeys.lists() + queryKey: storageLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateStorageModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateStorageModuleMutation.ts index a8d1255d52..047572928c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateStorageModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateStorageModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { storageModuleKeys } from "../query-keys"; -import { storageModuleMutationKeys } from "../mutation-keys"; -import type { StorageModuleSelect, StorageModuleWithRelations, StorageModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageModuleSelect, StorageModuleWithRelations, StorageModulePatch } from "../../orm/input-types"; +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 { storageModuleKeys } from '../query-keys'; +import { storageModuleMutationKeys } from '../mutation-keys'; +import type { + StorageModuleSelect, + StorageModuleWithRelations, + StorageModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + StorageModuleSelect, + StorageModuleWithRelations, + StorageModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a StorageModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateStorageModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', storageModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateStorageModuleMutation(params: { - selection: ({ - fields: S & StorageModuleSelect; - } & HookStrictSelect, StorageModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - storageModulePatch: StorageModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateStorageModule: { - storageModule: InferSelectResult; - }; -}, Error, { - id: string; - storageModulePatch: StorageModulePatch; -}>; -export function useUpdateStorageModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateStorageModuleMutation( + params: { + selection: { + fields: S & StorageModuleSelect; + } & HookStrictSelect, StorageModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateStorageModule: { + storageModule: InferSelectResult; + }; + }, + Error, + { + id: string; + storageModulePatch: StorageModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateStorageModule: { + storageModule: InferSelectResult; + }; + }, + Error, + { + id: string; + storageModulePatch: StorageModulePatch; + } +>; +export function useUpdateStorageModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + storageModulePatch: StorageModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storageModuleMutationKeys.all, mutationFn: ({ id, - storageModulePatch + storageModulePatch, }: { id: string; storageModulePatch: StorageModulePatch; - }) => getClient().storageModule.update({ - where: { - id - }, - data: storageModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .storageModule.update({ + where: { + id, + }, + data: storageModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: storageModuleKeys.detail(variables.id) + queryKey: storageModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: storageModuleKeys.lists() + queryKey: storageModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateTransferLogModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateTransferLogModuleMutation.ts index f1193ab01b..6c58951e47 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateTransferLogModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateTransferLogModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { transferLogModuleKeys } from "../query-keys"; -import { transferLogModuleMutationKeys } from "../mutation-keys"; -import type { TransferLogModuleSelect, TransferLogModuleWithRelations, TransferLogModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TransferLogModuleSelect, TransferLogModuleWithRelations, TransferLogModulePatch } from "../../orm/input-types"; +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 { transferLogModuleKeys } from '../query-keys'; +import { transferLogModuleMutationKeys } from '../mutation-keys'; +import type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, + TransferLogModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, + TransferLogModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a TransferLogModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateTransferLogModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', transferLogModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateTransferLogModuleMutation(params: { - selection: ({ - fields: S & TransferLogModuleSelect; - } & HookStrictSelect, TransferLogModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - transferLogModulePatch: TransferLogModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateTransferLogModule: { - transferLogModule: InferSelectResult; - }; -}, Error, { - id: string; - transferLogModulePatch: TransferLogModulePatch; -}>; -export function useUpdateTransferLogModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateTransferLogModuleMutation( + params: { + selection: { + fields: S & TransferLogModuleSelect; + } & HookStrictSelect, TransferLogModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateTransferLogModule: { + transferLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + transferLogModulePatch: TransferLogModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateTransferLogModule: { + transferLogModule: InferSelectResult; + }; + }, + Error, + { + id: string; + transferLogModulePatch: TransferLogModulePatch; + } +>; +export function useUpdateTransferLogModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + transferLogModulePatch: TransferLogModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: transferLogModuleMutationKeys.all, mutationFn: ({ id, - transferLogModulePatch + transferLogModulePatch, }: { id: string; transferLogModulePatch: TransferLogModulePatch; - }) => getClient().transferLogModule.update({ - where: { - id - }, - data: transferLogModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .transferLogModule.update({ + where: { + id, + }, + data: transferLogModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: transferLogModuleKeys.detail(variables.id) + queryKey: transferLogModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: transferLogModuleKeys.lists() + queryKey: transferLogModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserAuthModuleMutation.ts index 7b00740814..c07887316b 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserAuthModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { userAuthModuleKeys } from "../query-keys"; -import { userAuthModuleMutationKeys } from "../mutation-keys"; -import type { UserAuthModuleSelect, UserAuthModuleWithRelations, UserAuthModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserAuthModuleSelect, UserAuthModuleWithRelations, UserAuthModulePatch } from "../../orm/input-types"; +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 { userAuthModuleKeys } from '../query-keys'; +import { userAuthModuleMutationKeys } from '../mutation-keys'; +import type { + UserAuthModuleSelect, + UserAuthModuleWithRelations, + UserAuthModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserAuthModuleSelect, + UserAuthModuleWithRelations, + UserAuthModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a UserAuthModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateUserAuthModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', userAuthModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateUserAuthModuleMutation(params: { - selection: ({ - fields: S & UserAuthModuleSelect; - } & HookStrictSelect, UserAuthModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - userAuthModulePatch: UserAuthModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateUserAuthModule: { - userAuthModule: InferSelectResult; - }; -}, Error, { - id: string; - userAuthModulePatch: UserAuthModulePatch; -}>; -export function useUpdateUserAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateUserAuthModuleMutation( + params: { + selection: { + fields: S & UserAuthModuleSelect; + } & HookStrictSelect, UserAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateUserAuthModule: { + userAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + userAuthModulePatch: UserAuthModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateUserAuthModule: { + userAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + userAuthModulePatch: UserAuthModulePatch; + } +>; +export function useUpdateUserAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + userAuthModulePatch: UserAuthModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userAuthModuleMutationKeys.all, mutationFn: ({ id, - userAuthModulePatch + userAuthModulePatch, }: { id: string; userAuthModulePatch: UserAuthModulePatch; - }) => getClient().userAuthModule.update({ - where: { - id - }, - data: userAuthModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .userAuthModule.update({ + where: { + id, + }, + data: userAuthModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: userAuthModuleKeys.detail(variables.id) + queryKey: userAuthModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userAuthModuleKeys.lists() + queryKey: userAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserCredentialsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserCredentialsModuleMutation.ts index d246d07959..33a2efb1e8 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserCredentialsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserCredentialsModuleMutation.ts @@ -6,16 +6,24 @@ * 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 { userCredentialsModuleKeys } from "../query-keys"; -import { userCredentialsModuleMutationKeys } from "../mutation-keys"; -import type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations, UserCredentialsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations, UserCredentialsModulePatch } from "../../orm/input-types"; +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 { userCredentialsModuleKeys } from '../query-keys'; +import { userCredentialsModuleMutationKeys } from '../mutation-keys'; +import type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, + UserCredentialsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, + UserCredentialsModulePatch, +} from '../../orm/input-types'; /** * Per-user bcrypt credential store (password hashes, API key hashes). Always user-scoped with AuthzDirectOwner RLS. Consumed by user_auth_module, @@ -30,61 +38,83 @@ export type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations, U * mutate({ id: 'value-here', userCredentialsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateUserCredentialsModuleMutation(params: { - selection: ({ - fields: S & UserCredentialsModuleSelect; - } & HookStrictSelect, UserCredentialsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - userCredentialsModulePatch: UserCredentialsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateUserCredentialsModule: { - userCredentialsModule: InferSelectResult; - }; -}, Error, { - id: string; - userCredentialsModulePatch: UserCredentialsModulePatch; -}>; -export function useUpdateUserCredentialsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateUserCredentialsModuleMutation( + params: { + selection: { + fields: S & UserCredentialsModuleSelect; + } & HookStrictSelect, UserCredentialsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateUserCredentialsModule: { + userCredentialsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + userCredentialsModulePatch: UserCredentialsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateUserCredentialsModule: { + userCredentialsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + userCredentialsModulePatch: UserCredentialsModulePatch; + } +>; +export function useUpdateUserCredentialsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + userCredentialsModulePatch: UserCredentialsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userCredentialsModuleMutationKeys.all, mutationFn: ({ id, - userCredentialsModulePatch + userCredentialsModulePatch, }: { id: string; userCredentialsModulePatch: UserCredentialsModulePatch; - }) => getClient().userCredentialsModule.update({ - where: { - id - }, - data: userCredentialsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .userCredentialsModule.update({ + where: { + id, + }, + data: userCredentialsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: userCredentialsModuleKeys.detail(variables.id) + queryKey: userCredentialsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userCredentialsModuleKeys.lists() + queryKey: userCredentialsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserSettingsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserSettingsModuleMutation.ts index ad4ee6d0b2..46d95c655f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserSettingsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserSettingsModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { userSettingsModuleKeys } from "../query-keys"; -import { userSettingsModuleMutationKeys } from "../mutation-keys"; -import type { UserSettingsModuleSelect, UserSettingsModuleWithRelations, UserSettingsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSettingsModuleSelect, UserSettingsModuleWithRelations, UserSettingsModulePatch } from "../../orm/input-types"; +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 { userSettingsModuleKeys } from '../query-keys'; +import { userSettingsModuleMutationKeys } from '../mutation-keys'; +import type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, + UserSettingsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, + UserSettingsModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a UserSettingsModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateUserSettingsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', userSettingsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateUserSettingsModuleMutation(params: { - selection: ({ - fields: S & UserSettingsModuleSelect; - } & HookStrictSelect, UserSettingsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - userSettingsModulePatch: UserSettingsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateUserSettingsModule: { - userSettingsModule: InferSelectResult; - }; -}, Error, { - id: string; - userSettingsModulePatch: UserSettingsModulePatch; -}>; -export function useUpdateUserSettingsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateUserSettingsModuleMutation( + params: { + selection: { + fields: S & UserSettingsModuleSelect; + } & HookStrictSelect, UserSettingsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateUserSettingsModule: { + userSettingsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + userSettingsModulePatch: UserSettingsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateUserSettingsModule: { + userSettingsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + userSettingsModulePatch: UserSettingsModulePatch; + } +>; +export function useUpdateUserSettingsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + userSettingsModulePatch: UserSettingsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userSettingsModuleMutationKeys.all, mutationFn: ({ id, - userSettingsModulePatch + userSettingsModulePatch, }: { id: string; userSettingsModulePatch: UserSettingsModulePatch; - }) => getClient().userSettingsModule.update({ - where: { - id - }, - data: userSettingsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .userSettingsModule.update({ + where: { + id, + }, + data: userSettingsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: userSettingsModuleKeys.detail(variables.id) + queryKey: userSettingsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userSettingsModuleKeys.lists() + queryKey: userSettingsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserStateModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserStateModuleMutation.ts index 77924e4993..a7760dfcae 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserStateModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUserStateModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { userStateModuleKeys } from "../query-keys"; -import { userStateModuleMutationKeys } from "../mutation-keys"; -import type { UserStateModuleSelect, UserStateModuleWithRelations, UserStateModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserStateModuleSelect, UserStateModuleWithRelations, UserStateModulePatch } from "../../orm/input-types"; +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 { userStateModuleKeys } from '../query-keys'; +import { userStateModuleMutationKeys } from '../mutation-keys'; +import type { + UserStateModuleSelect, + UserStateModuleWithRelations, + UserStateModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserStateModuleSelect, + UserStateModuleWithRelations, + UserStateModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a UserStateModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateUserStateModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', userStateModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateUserStateModuleMutation(params: { - selection: ({ - fields: S & UserStateModuleSelect; - } & HookStrictSelect, UserStateModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - userStateModulePatch: UserStateModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateUserStateModule: { - userStateModule: InferSelectResult; - }; -}, Error, { - id: string; - userStateModulePatch: UserStateModulePatch; -}>; -export function useUpdateUserStateModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateUserStateModuleMutation( + params: { + selection: { + fields: S & UserStateModuleSelect; + } & HookStrictSelect, UserStateModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateUserStateModule: { + userStateModule: InferSelectResult; + }; + }, + Error, + { + id: string; + userStateModulePatch: UserStateModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateUserStateModule: { + userStateModule: InferSelectResult; + }; + }, + Error, + { + id: string; + userStateModulePatch: UserStateModulePatch; + } +>; +export function useUpdateUserStateModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + userStateModulePatch: UserStateModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: userStateModuleMutationKeys.all, mutationFn: ({ id, - userStateModulePatch + userStateModulePatch, }: { id: string; userStateModulePatch: UserStateModulePatch; - }) => getClient().userStateModule.update({ - where: { - id - }, - data: userStateModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .userStateModule.update({ + where: { + id, + }, + data: userStateModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: userStateModuleKeys.detail(variables.id) + queryKey: userStateModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: userStateModuleKeys.lists() + queryKey: userStateModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUsersModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUsersModuleMutation.ts index 96a9282248..b3ce4f6bd7 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUsersModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateUsersModuleMutation.ts @@ -4,83 +4,107 @@ * 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 { usersModuleKeys } from "../query-keys"; -import { usersModuleMutationKeys } from "../mutation-keys"; -import type { UsersModuleSelect, UsersModuleWithRelations, UsersModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UsersModuleSelect, UsersModuleWithRelations, UsersModulePatch } from "../../orm/input-types"; +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 { usersModuleKeys } from '../query-keys'; +import { usersModuleMutationKeys } from '../mutation-keys'; +import type { + UsersModuleSelect, + UsersModuleWithRelations, + UsersModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UsersModuleSelect, + UsersModuleWithRelations, + UsersModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a UsersModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateUsersModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', usersModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateUsersModuleMutation(params: { - selection: ({ - fields: S & UsersModuleSelect; - } & HookStrictSelect, UsersModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - usersModulePatch: UsersModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateUsersModule: { - usersModule: InferSelectResult; - }; -}, Error, { - id: string; - usersModulePatch: UsersModulePatch; -}>; -export function useUpdateUsersModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateUsersModuleMutation( + params: { + selection: { + fields: S & UsersModuleSelect; + } & HookStrictSelect, UsersModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateUsersModule: { + usersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + usersModulePatch: UsersModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateUsersModule: { + usersModule: InferSelectResult; + }; + }, + Error, + { + id: string; + usersModulePatch: UsersModulePatch; + } +>; +export function useUpdateUsersModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + usersModulePatch: UsersModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: usersModuleMutationKeys.all, - mutationFn: ({ - id, - usersModulePatch - }: { - id: string; - usersModulePatch: UsersModulePatch; - }) => getClient().usersModule.update({ - where: { - id - }, - data: usersModulePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, usersModulePatch }: { id: string; usersModulePatch: UsersModulePatch }) => + getClient() + .usersModule.update({ + where: { + id, + }, + data: usersModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: usersModuleKeys.detail(variables.id) + queryKey: usersModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: usersModuleKeys.lists() + queryKey: usersModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebauthnAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebauthnAuthModuleMutation.ts index 00947a6063..6ed741384c 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebauthnAuthModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebauthnAuthModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { webauthnAuthModuleKeys } from "../query-keys"; -import { webauthnAuthModuleMutationKeys } from "../mutation-keys"; -import type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations, WebauthnAuthModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations, WebauthnAuthModulePatch } from "../../orm/input-types"; +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 { webauthnAuthModuleKeys } from '../query-keys'; +import { webauthnAuthModuleMutationKeys } from '../mutation-keys'; +import type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, + WebauthnAuthModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, + WebauthnAuthModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a WebauthnAuthModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateWebauthnAuthModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', webauthnAuthModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateWebauthnAuthModuleMutation(params: { - selection: ({ - fields: S & WebauthnAuthModuleSelect; - } & HookStrictSelect, WebauthnAuthModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - webauthnAuthModulePatch: WebauthnAuthModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateWebauthnAuthModule: { - webauthnAuthModule: InferSelectResult; - }; -}, Error, { - id: string; - webauthnAuthModulePatch: WebauthnAuthModulePatch; -}>; -export function useUpdateWebauthnAuthModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateWebauthnAuthModuleMutation( + params: { + selection: { + fields: S & WebauthnAuthModuleSelect; + } & HookStrictSelect, WebauthnAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateWebauthnAuthModule: { + webauthnAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + webauthnAuthModulePatch: WebauthnAuthModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateWebauthnAuthModule: { + webauthnAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + webauthnAuthModulePatch: WebauthnAuthModulePatch; + } +>; +export function useUpdateWebauthnAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + webauthnAuthModulePatch: WebauthnAuthModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnAuthModuleMutationKeys.all, mutationFn: ({ id, - webauthnAuthModulePatch + webauthnAuthModulePatch, }: { id: string; webauthnAuthModulePatch: WebauthnAuthModulePatch; - }) => getClient().webauthnAuthModule.update({ - where: { - id - }, - data: webauthnAuthModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .webauthnAuthModule.update({ + where: { + id, + }, + data: webauthnAuthModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: webauthnAuthModuleKeys.detail(variables.id) + queryKey: webauthnAuthModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webauthnAuthModuleKeys.lists() + queryKey: webauthnAuthModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebauthnCredentialsModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebauthnCredentialsModuleMutation.ts index d6421673f4..945ac8a195 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebauthnCredentialsModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebauthnCredentialsModuleMutation.ts @@ -4,83 +4,115 @@ * 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 { webauthnCredentialsModuleKeys } from "../query-keys"; -import { webauthnCredentialsModuleMutationKeys } from "../mutation-keys"; -import type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations, WebauthnCredentialsModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations, WebauthnCredentialsModulePatch } from "../../orm/input-types"; +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 { webauthnCredentialsModuleKeys } from '../query-keys'; +import { webauthnCredentialsModuleMutationKeys } from '../mutation-keys'; +import type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, + WebauthnCredentialsModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, + WebauthnCredentialsModulePatch, +} from '../../orm/input-types'; /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateWebauthnCredentialsModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', webauthnCredentialsModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateWebauthnCredentialsModuleMutation(params: { - selection: ({ - fields: S & WebauthnCredentialsModuleSelect; - } & HookStrictSelect, WebauthnCredentialsModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - webauthnCredentialsModulePatch: WebauthnCredentialsModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateWebauthnCredentialsModule: { - webauthnCredentialsModule: InferSelectResult; - }; -}, Error, { - id: string; - webauthnCredentialsModulePatch: WebauthnCredentialsModulePatch; -}>; -export function useUpdateWebauthnCredentialsModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateWebauthnCredentialsModuleMutation< + S extends WebauthnCredentialsModuleSelect, +>( + params: { + selection: { + fields: S & WebauthnCredentialsModuleSelect; + } & HookStrictSelect, WebauthnCredentialsModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateWebauthnCredentialsModule: { + webauthnCredentialsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + webauthnCredentialsModulePatch: WebauthnCredentialsModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateWebauthnCredentialsModule: { + webauthnCredentialsModule: InferSelectResult; + }; + }, + Error, + { + id: string; + webauthnCredentialsModulePatch: WebauthnCredentialsModulePatch; + } +>; +export function useUpdateWebauthnCredentialsModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + webauthnCredentialsModulePatch: WebauthnCredentialsModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webauthnCredentialsModuleMutationKeys.all, mutationFn: ({ id, - webauthnCredentialsModulePatch + webauthnCredentialsModulePatch, }: { id: string; webauthnCredentialsModulePatch: WebauthnCredentialsModulePatch; - }) => getClient().webauthnCredentialsModule.update({ - where: { - id - }, - data: webauthnCredentialsModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .webauthnCredentialsModule.update({ + where: { + id, + }, + data: webauthnCredentialsModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: webauthnCredentialsModuleKeys.detail(variables.id) + queryKey: webauthnCredentialsModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webauthnCredentialsModuleKeys.lists() + queryKey: webauthnCredentialsModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebhookModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebhookModuleMutation.ts index fe3d9bf523..fd011d22ad 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebhookModuleMutation.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateWebhookModuleMutation.ts @@ -4,83 +4,113 @@ * 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 { webhookModuleKeys } from "../query-keys"; -import { webhookModuleMutationKeys } from "../mutation-keys"; -import type { WebhookModuleSelect, WebhookModuleWithRelations, WebhookModulePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookModuleSelect, WebhookModuleWithRelations, WebhookModulePatch } from "../../orm/input-types"; +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 { webhookModuleKeys } from '../query-keys'; +import { webhookModuleMutationKeys } from '../mutation-keys'; +import type { + WebhookModuleSelect, + WebhookModuleWithRelations, + WebhookModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebhookModuleSelect, + WebhookModuleWithRelations, + WebhookModulePatch, +} from '../../orm/input-types'; /** * Mutation hook for updating a WebhookModule - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateWebhookModuleMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', webhookModulePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateWebhookModuleMutation(params: { - selection: ({ - fields: S & WebhookModuleSelect; - } & HookStrictSelect, WebhookModuleSelect>); -} & Omit; - }; -}, Error, { - id: string; - webhookModulePatch: WebhookModulePatch; -}>, "mutationFn">): UseMutationResult<{ - updateWebhookModule: { - webhookModule: InferSelectResult; - }; -}, Error, { - id: string; - webhookModulePatch: WebhookModulePatch; -}>; -export function useUpdateWebhookModuleMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateWebhookModuleMutation( + params: { + selection: { + fields: S & WebhookModuleSelect; + } & HookStrictSelect, WebhookModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateWebhookModule: { + webhookModule: InferSelectResult; + }; + }, + Error, + { + id: string; + webhookModulePatch: WebhookModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateWebhookModule: { + webhookModule: InferSelectResult; + }; + }, + Error, + { + id: string; + webhookModulePatch: WebhookModulePatch; + } +>; +export function useUpdateWebhookModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + webhookModulePatch: WebhookModulePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: webhookModuleMutationKeys.all, mutationFn: ({ id, - webhookModulePatch + webhookModulePatch, }: { id: string; webhookModulePatch: WebhookModulePatch; - }) => getClient().webhookModule.update({ - where: { - id - }, - data: webhookModulePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .webhookModule.update({ + where: { + id, + }, + data: webhookModulePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: webhookModuleKeys.detail(variables.id) + queryKey: webhookModuleKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: webhookModuleKeys.lists() + queryKey: webhookModuleKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/index.ts b/sdk/constructive-react/src/modules/hooks/queries/index.ts index 5a0b833f79..d3a33f6fa7 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/index.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/index.ts @@ -3,155 +3,155 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useAgentModulesQuery"; -export * from "./useAgentModuleQuery"; -export * from "./useApiSurfaceModulesQuery"; -export * from "./useApiSurfaceModuleQuery"; -export * from "./useAppModulesQuery"; -export * from "./useAppModuleQuery"; -export * from "./useBillingModulesQuery"; -export * from "./useBillingModuleQuery"; -export * from "./useBillingProviderModulesQuery"; -export * from "./useBillingProviderModuleQuery"; -export * from "./useBlueprintsQuery"; -export * from "./useBlueprintQuery"; -export * from "./useBlueprintConstructionsQuery"; -export * from "./useBlueprintConstructionQuery"; -export * from "./useBlueprintTemplatesQuery"; -export * from "./useBlueprintTemplateQuery"; -export * from "./useCatalogModulesQuery"; -export * from "./useCatalogModuleQuery"; -export * from "./useComputeLogModulesQuery"; -export * from "./useComputeLogModuleQuery"; -export * from "./useConfigSecretsUserModulesQuery"; -export * from "./useConfigSecretsUserModuleQuery"; -export * from "./useConnectedAccountsModulesQuery"; -export * from "./useConnectedAccountsModuleQuery"; -export * from "./useCryptoAddressesModulesQuery"; -export * from "./useCryptoAddressesModuleQuery"; -export * from "./useCryptoAuthModulesQuery"; -export * from "./useCryptoAuthModuleQuery"; -export * from "./useDatabaseProvisionModulesQuery"; -export * from "./useDatabaseProvisionModuleQuery"; -export * from "./useDatabaseSettingsModulesQuery"; -export * from "./useDatabaseSettingsModuleQuery"; -export * from "./useDbPoolConfigsQuery"; -export * from "./useDbPoolConfigQuery"; -export * from "./useDbPoolsQuery"; -export * from "./useDbPoolQuery"; -export * from "./useDbPresetModulesQuery"; -export * from "./useDbPresetModuleQuery"; -export * from "./useDbUsageModulesQuery"; -export * from "./useDbUsageModuleQuery"; -export * from "./useDefaultIdsModulesQuery"; -export * from "./useDefaultIdsModuleQuery"; -export * from "./useDenormalizedTableFieldsQuery"; -export * from "./useDenormalizedTableFieldQuery"; -export * from "./useDevicesModulesQuery"; -export * from "./useDevicesModuleQuery"; -export * from "./useDomainModulesQuery"; -export * from "./useDomainModuleQuery"; -export * from "./useEmailsModulesQuery"; -export * from "./useEmailsModuleQuery"; -export * from "./useEntityTypeProvisionsQuery"; -export * from "./useEntityTypeProvisionQuery"; -export * from "./useEventsModulesQuery"; -export * from "./useEventsModuleQuery"; -export * from "./useFunctionDeploymentModulesQuery"; -export * from "./useFunctionDeploymentModuleQuery"; -export * from "./useFunctionInvocationModulesQuery"; -export * from "./useFunctionInvocationModuleQuery"; -export * from "./useFunctionModulesQuery"; -export * from "./useFunctionModuleQuery"; -export * from "./useGraphExecutionModulesQuery"; -export * from "./useGraphExecutionModuleQuery"; -export * from "./useGraphModulesQuery"; -export * from "./useGraphModuleQuery"; -export * from "./useHierarchyModulesQuery"; -export * from "./useHierarchyModuleQuery"; -export * from "./useHttpRouteModulesQuery"; -export * from "./useHttpRouteModuleQuery"; -export * from "./useI18nModulesQuery"; -export * from "./useI18NModuleQuery"; -export * from "./useIdentityProvidersModulesQuery"; -export * from "./useIdentityProvidersModuleQuery"; -export * from "./useInferenceLogModulesQuery"; -export * from "./useInferenceLogModuleQuery"; -export * from "./useInfraConfigModulesQuery"; -export * from "./useInfraConfigModuleQuery"; -export * from "./useInfraSecretsModulesQuery"; -export * from "./useInfraSecretsModuleQuery"; -export * from "./useIntegrationProvidersModulesQuery"; -export * from "./useIntegrationProvidersModuleQuery"; -export * from "./useInternalSecretsModulesQuery"; -export * from "./useInternalSecretsModuleQuery"; -export * from "./useInvitesModulesQuery"; -export * from "./useInvitesModuleQuery"; -export * from "./useLimitsModulesQuery"; -export * from "./useLimitsModuleQuery"; -export * from "./useMembershipTypesModulesQuery"; -export * from "./useMembershipTypesModuleQuery"; -export * from "./useMembershipsModulesQuery"; -export * from "./useMembershipsModuleQuery"; -export * from "./useMerkleStoreModulesQuery"; -export * from "./useMerkleStoreModuleQuery"; -export * from "./useNamespaceModulesQuery"; -export * from "./useNamespaceModuleQuery"; -export * from "./useNotificationsModulesQuery"; -export * from "./useNotificationsModuleQuery"; -export * from "./usePermissionsModulesQuery"; -export * from "./usePermissionsModuleQuery"; -export * from "./usePhoneNumbersModulesQuery"; -export * from "./usePhoneNumbersModuleQuery"; -export * from "./usePlansModulesQuery"; -export * from "./usePlansModuleQuery"; -export * from "./usePrincipalAuthModulesQuery"; -export * from "./usePrincipalAuthModuleQuery"; -export * from "./useProfilesModulesQuery"; -export * from "./useProfilesModuleQuery"; -export * from "./useRateLimitMetersModulesQuery"; -export * from "./useRateLimitMetersModuleQuery"; -export * from "./useRateLimitsModulesQuery"; -export * from "./useRateLimitsModuleQuery"; -export * from "./useRealtimeModulesQuery"; -export * from "./useRealtimeModuleQuery"; -export * from "./useRelationProvisionsQuery"; -export * from "./useRelationProvisionQuery"; -export * from "./useResourceModulesQuery"; -export * from "./useResourceModuleQuery"; -export * from "./useRlsModulesQuery"; -export * from "./useRlsModuleQuery"; -export * from "./useRouteModulesQuery"; -export * from "./useRouteModuleQuery"; -export * from "./useSecureTableProvisionsQuery"; -export * from "./useSecureTableProvisionQuery"; -export * from "./useSessionSecretsModulesQuery"; -export * from "./useSessionSecretsModuleQuery"; -export * from "./useSessionsModulesQuery"; -export * from "./useSessionsModuleQuery"; -export * from "./useSiteSurfaceModulesQuery"; -export * from "./useSiteSurfaceModuleQuery"; -export * from "./useStorageLogModulesQuery"; -export * from "./useStorageLogModuleQuery"; -export * from "./useStorageModulesQuery"; -export * from "./useStorageModuleQuery"; -export * from "./useTransferLogModulesQuery"; -export * from "./useTransferLogModuleQuery"; -export * from "./useUserAuthModulesQuery"; -export * from "./useUserAuthModuleQuery"; -export * from "./useUserCredentialsModulesQuery"; -export * from "./useUserCredentialsModuleQuery"; -export * from "./useUserSettingsModulesQuery"; -export * from "./useUserSettingsModuleQuery"; -export * from "./useUserStateModulesQuery"; -export * from "./useUserStateModuleQuery"; -export * from "./useUsersModulesQuery"; -export * from "./useUsersModuleQuery"; -export * from "./useWebauthnAuthModulesQuery"; -export * from "./useWebauthnAuthModuleQuery"; -export * from "./useWebauthnCredentialsModulesQuery"; -export * from "./useWebauthnCredentialsModuleQuery"; -export * from "./useWebhookModulesQuery"; -export * from "./useWebhookModuleQuery"; -export * from "./useResolveBlueprintFieldQuery"; -export * from "./useResolveBlueprintTableQuery"; \ No newline at end of file +export * from './useAgentModulesQuery'; +export * from './useAgentModuleQuery'; +export * from './useApiSurfaceModulesQuery'; +export * from './useApiSurfaceModuleQuery'; +export * from './useAppModulesQuery'; +export * from './useAppModuleQuery'; +export * from './useBillingModulesQuery'; +export * from './useBillingModuleQuery'; +export * from './useBillingProviderModulesQuery'; +export * from './useBillingProviderModuleQuery'; +export * from './useBlueprintsQuery'; +export * from './useBlueprintQuery'; +export * from './useBlueprintConstructionsQuery'; +export * from './useBlueprintConstructionQuery'; +export * from './useBlueprintTemplatesQuery'; +export * from './useBlueprintTemplateQuery'; +export * from './useCatalogModulesQuery'; +export * from './useCatalogModuleQuery'; +export * from './useComputeLogModulesQuery'; +export * from './useComputeLogModuleQuery'; +export * from './useConfigSecretsUserModulesQuery'; +export * from './useConfigSecretsUserModuleQuery'; +export * from './useConnectedAccountsModulesQuery'; +export * from './useConnectedAccountsModuleQuery'; +export * from './useCryptoAddressesModulesQuery'; +export * from './useCryptoAddressesModuleQuery'; +export * from './useCryptoAuthModulesQuery'; +export * from './useCryptoAuthModuleQuery'; +export * from './useDatabaseProvisionModulesQuery'; +export * from './useDatabaseProvisionModuleQuery'; +export * from './useDatabaseSettingsModulesQuery'; +export * from './useDatabaseSettingsModuleQuery'; +export * from './useDbPoolConfigsQuery'; +export * from './useDbPoolConfigQuery'; +export * from './useDbPoolsQuery'; +export * from './useDbPoolQuery'; +export * from './useDbPresetModulesQuery'; +export * from './useDbPresetModuleQuery'; +export * from './useDbUsageModulesQuery'; +export * from './useDbUsageModuleQuery'; +export * from './useDefaultIdsModulesQuery'; +export * from './useDefaultIdsModuleQuery'; +export * from './useDenormalizedTableFieldsQuery'; +export * from './useDenormalizedTableFieldQuery'; +export * from './useDevicesModulesQuery'; +export * from './useDevicesModuleQuery'; +export * from './useDomainModulesQuery'; +export * from './useDomainModuleQuery'; +export * from './useEmailsModulesQuery'; +export * from './useEmailsModuleQuery'; +export * from './useEntityTypeProvisionsQuery'; +export * from './useEntityTypeProvisionQuery'; +export * from './useEventsModulesQuery'; +export * from './useEventsModuleQuery'; +export * from './useFunctionDeploymentModulesQuery'; +export * from './useFunctionDeploymentModuleQuery'; +export * from './useFunctionInvocationModulesQuery'; +export * from './useFunctionInvocationModuleQuery'; +export * from './useFunctionModulesQuery'; +export * from './useFunctionModuleQuery'; +export * from './useGraphExecutionModulesQuery'; +export * from './useGraphExecutionModuleQuery'; +export * from './useGraphModulesQuery'; +export * from './useGraphModuleQuery'; +export * from './useHierarchyModulesQuery'; +export * from './useHierarchyModuleQuery'; +export * from './useHttpRouteModulesQuery'; +export * from './useHttpRouteModuleQuery'; +export * from './useI18nModulesQuery'; +export * from './useI18NModuleQuery'; +export * from './useIdentityProvidersModulesQuery'; +export * from './useIdentityProvidersModuleQuery'; +export * from './useInferenceLogModulesQuery'; +export * from './useInferenceLogModuleQuery'; +export * from './useInfraConfigModulesQuery'; +export * from './useInfraConfigModuleQuery'; +export * from './useInfraSecretsModulesQuery'; +export * from './useInfraSecretsModuleQuery'; +export * from './useIntegrationProvidersModulesQuery'; +export * from './useIntegrationProvidersModuleQuery'; +export * from './useInternalSecretsModulesQuery'; +export * from './useInternalSecretsModuleQuery'; +export * from './useInvitesModulesQuery'; +export * from './useInvitesModuleQuery'; +export * from './useLimitsModulesQuery'; +export * from './useLimitsModuleQuery'; +export * from './useMembershipTypesModulesQuery'; +export * from './useMembershipTypesModuleQuery'; +export * from './useMembershipsModulesQuery'; +export * from './useMembershipsModuleQuery'; +export * from './useMerkleStoreModulesQuery'; +export * from './useMerkleStoreModuleQuery'; +export * from './useNamespaceModulesQuery'; +export * from './useNamespaceModuleQuery'; +export * from './useNotificationsModulesQuery'; +export * from './useNotificationsModuleQuery'; +export * from './usePermissionsModulesQuery'; +export * from './usePermissionsModuleQuery'; +export * from './usePhoneNumbersModulesQuery'; +export * from './usePhoneNumbersModuleQuery'; +export * from './usePlansModulesQuery'; +export * from './usePlansModuleQuery'; +export * from './usePrincipalAuthModulesQuery'; +export * from './usePrincipalAuthModuleQuery'; +export * from './useProfilesModulesQuery'; +export * from './useProfilesModuleQuery'; +export * from './useRateLimitMetersModulesQuery'; +export * from './useRateLimitMetersModuleQuery'; +export * from './useRateLimitsModulesQuery'; +export * from './useRateLimitsModuleQuery'; +export * from './useRealtimeModulesQuery'; +export * from './useRealtimeModuleQuery'; +export * from './useRelationProvisionsQuery'; +export * from './useRelationProvisionQuery'; +export * from './useResourceModulesQuery'; +export * from './useResourceModuleQuery'; +export * from './useRlsModulesQuery'; +export * from './useRlsModuleQuery'; +export * from './useRouteModulesQuery'; +export * from './useRouteModuleQuery'; +export * from './useSecureTableProvisionsQuery'; +export * from './useSecureTableProvisionQuery'; +export * from './useSessionSecretsModulesQuery'; +export * from './useSessionSecretsModuleQuery'; +export * from './useSessionsModulesQuery'; +export * from './useSessionsModuleQuery'; +export * from './useSiteSurfaceModulesQuery'; +export * from './useSiteSurfaceModuleQuery'; +export * from './useStorageLogModulesQuery'; +export * from './useStorageLogModuleQuery'; +export * from './useStorageModulesQuery'; +export * from './useStorageModuleQuery'; +export * from './useTransferLogModulesQuery'; +export * from './useTransferLogModuleQuery'; +export * from './useUserAuthModulesQuery'; +export * from './useUserAuthModuleQuery'; +export * from './useUserCredentialsModulesQuery'; +export * from './useUserCredentialsModuleQuery'; +export * from './useUserSettingsModulesQuery'; +export * from './useUserSettingsModuleQuery'; +export * from './useUserStateModulesQuery'; +export * from './useUserStateModuleQuery'; +export * from './useUsersModulesQuery'; +export * from './useUsersModuleQuery'; +export * from './useWebauthnAuthModulesQuery'; +export * from './useWebauthnAuthModuleQuery'; +export * from './useWebauthnCredentialsModulesQuery'; +export * from './useWebauthnCredentialsModuleQuery'; +export * from './useWebhookModulesQuery'; +export * from './useWebhookModuleQuery'; +export * from './useResolveBlueprintFieldQuery'; +export * from './useResolveBlueprintTableQuery'; diff --git a/sdk/constructive-react/src/modules/hooks/queries/useAgentModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useAgentModuleQuery.ts index d57dd066aa..5834799de0 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useAgentModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useAgentModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { agentModuleKeys } from "../query-keys"; -import type { AgentModuleSelect, AgentModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentModuleSelect, AgentModuleWithRelations } from "../../orm/input-types"; +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 { agentModuleKeys } from '../query-keys'; +import type { AgentModuleSelect, AgentModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AgentModuleSelect, AgentModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentModuleQueryKey = agentModuleKeys.detail; /** * Query hook for fetching a single AgentModule - * + * * @example * ```tsx * const { data, isLoading } = useAgentModuleQuery({ @@ -26,38 +26,52 @@ export const agentModuleQueryKey = agentModuleKeys.detail; * }); * ``` */ -export function useAgentModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAgentModuleQuery< + S extends AgentModuleSelect, + TData = { + agentModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentModuleSelect>; + } & Omit< + UseQueryOptions< + { + agentModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentModuleKeys.detail(params.id), - queryFn: () => getClient().agentModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .agentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single AgentModule without React hooks - * + * * @example * ```ts * const data = await fetchAgentModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchAgentModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().agentModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .agentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single AgentModule for SSR or cache warming - * + * * @example * ```ts * await prefetchAgentModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAgentModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AgentModuleSelect>; -}): Promise; -export async function prefetchAgentModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAgentModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AgentModuleSelect>; + } +): Promise; +export async function prefetchAgentModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: agentModuleKeys.detail(params.id), - queryFn: () => getClient().agentModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .agentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useAgentModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useAgentModulesQuery.ts index 301c26fc93..1f57c98711 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useAgentModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useAgentModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { agentModuleKeys } from "../query-keys"; -import type { AgentModuleSelect, AgentModuleWithRelations, AgentModuleFilter, AgentModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AgentModuleSelect, AgentModuleWithRelations, AgentModuleFilter, AgentModuleOrderBy } from "../../orm/input-types"; +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 { agentModuleKeys } from '../query-keys'; +import type { + AgentModuleSelect, + AgentModuleWithRelations, + AgentModuleFilter, + AgentModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AgentModuleSelect, + AgentModuleWithRelations, + AgentModuleFilter, + AgentModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const agentModulesQueryKey = agentModuleKeys.list; /** * Query hook for fetching AgentModule list - * + * * @example * ```tsx * const { data, isLoading } = useAgentModulesQuery({ @@ -30,33 +45,47 @@ export const agentModulesQueryKey = agentModuleKeys.list; * }); * ``` */ -export function useAgentModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAgentModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAgentModulesQuery< + S extends AgentModuleSelect, + TData = { + agentModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentModuleSelect>; + } & Omit< + UseQueryOptions< + { + agentModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAgentModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: agentModuleKeys.list(args), queryFn: () => getClient().agentModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch AgentModule list without React hooks - * + * * @example * ```ts * const data = await fetchAgentModulesQuery({ @@ -70,35 +99,47 @@ export function useAgentModulesQuery(params: { export async function fetchAgentModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AgentModuleSelect>; }): Promise<{ agentModules: ConnectionResult>; }>; export async function fetchAgentModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().agentModule.findMany(args).unwrap(); } /** * Prefetch AgentModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchAgentModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAgentModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AgentModuleSelect>; -}): Promise; -export async function prefetchAgentModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAgentModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AgentModuleSelect>; + } +): Promise; +export async function prefetchAgentModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: agentModuleKeys.list(args), - queryFn: () => getClient().agentModule.findMany(args).unwrap() + queryFn: () => getClient().agentModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useApiSurfaceModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useApiSurfaceModuleQuery.ts index 5cdcd9e9b6..873a8e3a43 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useApiSurfaceModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useApiSurfaceModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { apiSurfaceModuleKeys } from "../query-keys"; -import type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations } from "../../orm/input-types"; +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 { apiSurfaceModuleKeys } from '../query-keys'; +import type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiSurfaceModuleQueryKey = apiSurfaceModuleKeys.detail; /** * Query hook for fetching a single ApiSurfaceModule - * + * * @example * ```tsx * const { data, isLoading } = useApiSurfaceModuleQuery({ @@ -26,38 +26,52 @@ export const apiSurfaceModuleQueryKey = apiSurfaceModuleKeys.detail; * }); * ``` */ -export function useApiSurfaceModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiSurfaceModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiSurfaceModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useApiSurfaceModuleQuery< + S extends ApiSurfaceModuleSelect, + TData = { + apiSurfaceModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiSurfaceModuleSelect>; + } & Omit< + UseQueryOptions< + { + apiSurfaceModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiSurfaceModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiSurfaceModuleKeys.detail(params.id), - queryFn: () => getClient().apiSurfaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .apiSurfaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ApiSurfaceModule without React hooks - * + * * @example * ```ts * const data = await fetchApiSurfaceModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchApiSurfaceModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().apiSurfaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .apiSurfaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ApiSurfaceModule for SSR or cache warming - * + * * @example * ```ts * await prefetchApiSurfaceModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchApiSurfaceModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ApiSurfaceModuleSelect>; -}): Promise; -export async function prefetchApiSurfaceModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchApiSurfaceModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ApiSurfaceModuleSelect>; + } +): Promise; +export async function prefetchApiSurfaceModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: apiSurfaceModuleKeys.detail(params.id), - queryFn: () => getClient().apiSurfaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .apiSurfaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useApiSurfaceModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useApiSurfaceModulesQuery.ts index 647d7b41ef..5b21fbdbea 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useApiSurfaceModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useApiSurfaceModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { apiSurfaceModuleKeys } from "../query-keys"; -import type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations, ApiSurfaceModuleFilter, ApiSurfaceModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ApiSurfaceModuleSelect, ApiSurfaceModuleWithRelations, ApiSurfaceModuleFilter, ApiSurfaceModuleOrderBy } from "../../orm/input-types"; +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 { apiSurfaceModuleKeys } from '../query-keys'; +import type { + ApiSurfaceModuleSelect, + ApiSurfaceModuleWithRelations, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ApiSurfaceModuleSelect, + ApiSurfaceModuleWithRelations, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const apiSurfaceModulesQueryKey = apiSurfaceModuleKeys.list; /** * Query hook for fetching ApiSurfaceModule list - * + * * @example * ```tsx * const { data, isLoading } = useApiSurfaceModulesQuery({ @@ -30,33 +45,53 @@ export const apiSurfaceModulesQueryKey = apiSurfaceModuleKeys.list; * }); * ``` */ -export function useApiSurfaceModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSurfaceModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useApiSurfaceModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useApiSurfaceModulesQuery< + S extends ApiSurfaceModuleSelect, + TData = { + apiSurfaceModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiSurfaceModuleSelect>; + } & Omit< + UseQueryOptions< + { + apiSurfaceModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useApiSurfaceModulesQuery( + params: { + selection: ListSelectionConfig< + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: apiSurfaceModuleKeys.list(args), queryFn: () => getClient().apiSurfaceModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ApiSurfaceModule list without React hooks - * + * * @example * ```ts * const data = await fetchApiSurfaceModulesQuery({ @@ -70,35 +105,59 @@ export function useApiSurfaceModulesQuery(params: { export async function fetchApiSurfaceModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSurfaceModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ApiSurfaceModuleSelect>; }): Promise<{ apiSurfaceModules: ConnectionResult>; }>; export async function fetchApiSurfaceModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy + >(params.selection); return getClient().apiSurfaceModule.findMany(args).unwrap(); } /** * Prefetch ApiSurfaceModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchApiSurfaceModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchApiSurfaceModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ApiSurfaceModuleSelect>; -}): Promise; -export async function prefetchApiSurfaceModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchApiSurfaceModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ApiSurfaceModuleSelect>; + } +): Promise; +export async function prefetchApiSurfaceModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: apiSurfaceModuleKeys.list(args), - queryFn: () => getClient().apiSurfaceModule.findMany(args).unwrap() + queryFn: () => getClient().apiSurfaceModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useAppModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useAppModuleQuery.ts index 5a36a41d85..fddea27e31 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useAppModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useAppModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { appModuleKeys } from "../query-keys"; -import type { AppModuleSelect, AppModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppModuleSelect, AppModuleWithRelations } from "../../orm/input-types"; +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 { appModuleKeys } from '../query-keys'; +import type { AppModuleSelect, AppModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppModuleSelect, AppModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appModuleQueryKey = appModuleKeys.detail; /** * Query hook for fetching a single AppModule - * + * * @example * ```tsx * const { data, isLoading } = useAppModuleQuery({ @@ -26,38 +26,52 @@ export const appModuleQueryKey = appModuleKeys.detail; * }); * ``` */ -export function useAppModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppModuleQuery< + S extends AppModuleSelect, + TData = { + appModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppModuleSelect>; + } & Omit< + UseQueryOptions< + { + appModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appModuleKeys.detail(params.id), - queryFn: () => getClient().appModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single AppModule without React hooks - * + * * @example * ```ts * const data = await fetchAppModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchAppModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single AppModule for SSR or cache warming - * + * * @example * ```ts * await prefetchAppModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppModuleSelect>; -}): Promise; -export async function prefetchAppModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppModuleSelect>; + } +): Promise; +export async function prefetchAppModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appModuleKeys.detail(params.id), - queryFn: () => getClient().appModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useAppModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useAppModulesQuery.ts index 3d04b22daa..b4958750a1 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useAppModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useAppModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { appModuleKeys } from "../query-keys"; -import type { AppModuleSelect, AppModuleWithRelations, AppModuleFilter, AppModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppModuleSelect, AppModuleWithRelations, AppModuleFilter, AppModuleOrderBy } from "../../orm/input-types"; +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 { appModuleKeys } from '../query-keys'; +import type { + AppModuleSelect, + AppModuleWithRelations, + AppModuleFilter, + AppModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppModuleSelect, + AppModuleWithRelations, + AppModuleFilter, + AppModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appModulesQueryKey = appModuleKeys.list; /** * Query hook for fetching AppModule list - * + * * @example * ```tsx * const { data, isLoading } = useAppModulesQuery({ @@ -30,33 +45,47 @@ export const appModulesQueryKey = appModuleKeys.list; * }); * ``` */ -export function useAppModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppModulesQuery< + S extends AppModuleSelect, + TData = { + appModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppModuleSelect>; + } & Omit< + UseQueryOptions< + { + appModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appModuleKeys.list(args), queryFn: () => getClient().appModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch AppModule list without React hooks - * + * * @example * ```ts * const data = await fetchAppModulesQuery({ @@ -70,35 +99,47 @@ export function useAppModulesQuery(params: { export async function fetchAppModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppModuleSelect>; }): Promise<{ appModules: ConnectionResult>; }>; export async function fetchAppModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().appModule.findMany(args).unwrap(); } /** * Prefetch AppModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchAppModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppModuleSelect>; -}): Promise; -export async function prefetchAppModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppModuleSelect>; + } +): Promise; +export async function prefetchAppModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: appModuleKeys.list(args), - queryFn: () => getClient().appModule.findMany(args).unwrap() + queryFn: () => getClient().appModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBillingModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBillingModuleQuery.ts index b956d66d93..5a8d1b1569 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBillingModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBillingModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { billingModuleKeys } from "../query-keys"; -import type { BillingModuleSelect, BillingModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingModuleSelect, BillingModuleWithRelations } from "../../orm/input-types"; +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 { billingModuleKeys } from '../query-keys'; +import type { BillingModuleSelect, BillingModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { BillingModuleSelect, BillingModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const billingModuleQueryKey = billingModuleKeys.detail; /** * Query hook for fetching a single BillingModule - * + * * @example * ```tsx * const { data, isLoading } = useBillingModuleQuery({ @@ -26,38 +26,52 @@ export const billingModuleQueryKey = billingModuleKeys.detail; * }); * ``` */ -export function useBillingModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BillingModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBillingModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useBillingModuleQuery< + S extends BillingModuleSelect, + TData = { + billingModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BillingModuleSelect>; + } & Omit< + UseQueryOptions< + { + billingModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBillingModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: billingModuleKeys.detail(params.id), - queryFn: () => getClient().billingModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .billingModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single BillingModule without React hooks - * + * * @example * ```ts * const data = await fetchBillingModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchBillingModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().billingModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .billingModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single BillingModule for SSR or cache warming - * + * * @example * ```ts * await prefetchBillingModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchBillingModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BillingModuleSelect>; -}): Promise; -export async function prefetchBillingModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchBillingModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BillingModuleSelect>; + } +): Promise; +export async function prefetchBillingModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: billingModuleKeys.detail(params.id), - queryFn: () => getClient().billingModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .billingModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBillingModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBillingModulesQuery.ts index cf4a8f024e..15f0707abf 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBillingModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBillingModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { billingModuleKeys } from "../query-keys"; -import type { BillingModuleSelect, BillingModuleWithRelations, BillingModuleFilter, BillingModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingModuleSelect, BillingModuleWithRelations, BillingModuleFilter, BillingModuleOrderBy } from "../../orm/input-types"; +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 { billingModuleKeys } from '../query-keys'; +import type { + BillingModuleSelect, + BillingModuleWithRelations, + BillingModuleFilter, + BillingModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + BillingModuleSelect, + BillingModuleWithRelations, + BillingModuleFilter, + BillingModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const billingModulesQueryKey = billingModuleKeys.list; /** * Query hook for fetching BillingModule list - * + * * @example * ```tsx * const { data, isLoading } = useBillingModulesQuery({ @@ -30,33 +45,49 @@ export const billingModulesQueryKey = billingModuleKeys.list; * }); * ``` */ -export function useBillingModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BillingModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBillingModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useBillingModulesQuery< + S extends BillingModuleSelect, + TData = { + billingModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, BillingModuleSelect>; + } & Omit< + UseQueryOptions< + { + billingModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBillingModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + BillingModuleSelect, + BillingModuleFilter, + BillingModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: billingModuleKeys.list(args), queryFn: () => getClient().billingModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch BillingModule list without React hooks - * + * * @example * ```ts * const data = await fetchBillingModulesQuery({ @@ -70,35 +101,51 @@ export function useBillingModulesQuery(params: { export async function fetchBillingModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, BillingModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, BillingModuleSelect>; }): Promise<{ billingModules: ConnectionResult>; }>; export async function fetchBillingModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + BillingModuleSelect, + BillingModuleFilter, + BillingModuleOrderBy + >(params.selection); return getClient().billingModule.findMany(args).unwrap(); } /** * Prefetch BillingModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchBillingModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchBillingModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BillingModuleSelect>; -}): Promise; -export async function prefetchBillingModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchBillingModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, BillingModuleSelect>; + } +): Promise; +export async function prefetchBillingModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + BillingModuleSelect, + BillingModuleFilter, + BillingModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: billingModuleKeys.list(args), - queryFn: () => getClient().billingModule.findMany(args).unwrap() + queryFn: () => getClient().billingModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBillingProviderModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBillingProviderModuleQuery.ts index 711e1d518c..e62f55c0da 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBillingProviderModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBillingProviderModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { billingProviderModuleKeys } from "../query-keys"; -import type { BillingProviderModuleSelect, BillingProviderModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingProviderModuleSelect, BillingProviderModuleWithRelations } from "../../orm/input-types"; +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 { billingProviderModuleKeys } from '../query-keys'; +import type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const billingProviderModuleQueryKey = billingProviderModuleKeys.detail; /** * Query hook for fetching a single BillingProviderModule - * + * * @example * ```tsx * const { data, isLoading } = useBillingProviderModuleQuery({ @@ -26,38 +32,52 @@ export const billingProviderModuleQueryKey = billingProviderModuleKeys.detail; * }); * ``` */ -export function useBillingProviderModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BillingProviderModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBillingProviderModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useBillingProviderModuleQuery< + S extends BillingProviderModuleSelect, + TData = { + billingProviderModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BillingProviderModuleSelect>; + } & Omit< + UseQueryOptions< + { + billingProviderModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBillingProviderModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: billingProviderModuleKeys.detail(params.id), - queryFn: () => getClient().billingProviderModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .billingProviderModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single BillingProviderModule without React hooks - * + * * @example * ```ts * const data = await fetchBillingProviderModuleQuery({ @@ -66,7 +86,9 @@ export function useBillingProviderModuleQuery(params: { * }); * ``` */ -export async function fetchBillingProviderModuleQuery(params: { +export async function fetchBillingProviderModuleQuery< + S extends BillingProviderModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchBillingProviderModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().billingProviderModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .billingProviderModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single BillingProviderModule for SSR or cache warming - * + * * @example * ```ts * await prefetchBillingProviderModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchBillingProviderModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BillingProviderModuleSelect>; -}): Promise; -export async function prefetchBillingProviderModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchBillingProviderModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BillingProviderModuleSelect>; + } +): Promise; +export async function prefetchBillingProviderModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: billingProviderModuleKeys.detail(params.id), - queryFn: () => getClient().billingProviderModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .billingProviderModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBillingProviderModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBillingProviderModulesQuery.ts index 1c74e1e0f7..318d990ff9 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBillingProviderModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBillingProviderModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { billingProviderModuleKeys } from "../query-keys"; -import type { BillingProviderModuleSelect, BillingProviderModuleWithRelations, BillingProviderModuleFilter, BillingProviderModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { BillingProviderModuleSelect, BillingProviderModuleWithRelations, BillingProviderModuleFilter, BillingProviderModuleOrderBy } from "../../orm/input-types"; +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 { billingProviderModuleKeys } from '../query-keys'; +import type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + BillingProviderModuleSelect, + BillingProviderModuleWithRelations, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const billingProviderModulesQueryKey = billingProviderModuleKeys.list; /** * Query hook for fetching BillingProviderModule list - * + * * @example * ```tsx * const { data, isLoading } = useBillingProviderModulesQuery({ @@ -30,33 +45,60 @@ export const billingProviderModulesQueryKey = billingProviderModuleKeys.list; * }); * ``` */ -export function useBillingProviderModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BillingProviderModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBillingProviderModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useBillingProviderModulesQuery< + S extends BillingProviderModuleSelect, + TData = { + billingProviderModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, BillingProviderModuleSelect>; + } & Omit< + UseQueryOptions< + { + billingProviderModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBillingProviderModulesQuery( + params: { + selection: ListSelectionConfig< + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: billingProviderModuleKeys.list(args), queryFn: () => getClient().billingProviderModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch BillingProviderModule list without React hooks - * + * * @example * ```ts * const data = await fetchBillingProviderModulesQuery({ @@ -67,38 +109,72 @@ export function useBillingProviderModulesQuery(params: { * }); * ``` */ -export async function fetchBillingProviderModulesQuery(params: { +export async function fetchBillingProviderModulesQuery< + S extends BillingProviderModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, BillingProviderModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, BillingProviderModuleSelect>; }): Promise<{ - billingProviderModules: ConnectionResult>; + billingProviderModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchBillingProviderModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy + >(params.selection); return getClient().billingProviderModule.findMany(args).unwrap(); } /** * Prefetch BillingProviderModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchBillingProviderModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchBillingProviderModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BillingProviderModuleSelect>; -}): Promise; -export async function prefetchBillingProviderModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchBillingProviderModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, BillingProviderModuleSelect>; + } +): Promise; +export async function prefetchBillingProviderModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: billingProviderModuleKeys.list(args), - queryFn: () => getClient().billingProviderModule.findMany(args).unwrap() + queryFn: () => getClient().billingProviderModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintConstructionQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintConstructionQuery.ts index 1effc22272..b4c286d3db 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintConstructionQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintConstructionQuery.ts @@ -4,20 +4,26 @@ * 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 { blueprintConstructionKeys } from "../query-keys"; -import type { BlueprintConstructionSelect, BlueprintConstructionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintConstructionSelect, BlueprintConstructionWithRelations } from "../../orm/input-types"; +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 { blueprintConstructionKeys } from '../query-keys'; +import type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const blueprintConstructionQueryKey = blueprintConstructionKeys.detail; /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```tsx * const { data, isLoading } = useBlueprintConstructionQuery({ @@ -26,38 +32,52 @@ export const blueprintConstructionQueryKey = blueprintConstructionKeys.detail; * }); * ``` */ -export function useBlueprintConstructionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BlueprintConstructionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBlueprintConstructionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useBlueprintConstructionQuery< + S extends BlueprintConstructionSelect, + TData = { + blueprintConstruction: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BlueprintConstructionSelect>; + } & Omit< + UseQueryOptions< + { + blueprintConstruction: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBlueprintConstructionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: blueprintConstructionKeys.detail(params.id), - queryFn: () => getClient().blueprintConstruction.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .blueprintConstruction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```ts * const data = await fetchBlueprintConstructionQuery({ @@ -66,7 +86,9 @@ export function useBlueprintConstructionQuery(params: { * }); * ``` */ -export async function fetchBlueprintConstructionQuery(params: { +export async function fetchBlueprintConstructionQuery< + S extends BlueprintConstructionSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchBlueprintConstructionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().blueprintConstruction.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .blueprintConstruction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```ts * await prefetchBlueprintConstructionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchBlueprintConstructionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BlueprintConstructionSelect>; -}): Promise; -export async function prefetchBlueprintConstructionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchBlueprintConstructionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BlueprintConstructionSelect>; + } +): Promise; +export async function prefetchBlueprintConstructionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: blueprintConstructionKeys.detail(params.id), - queryFn: () => getClient().blueprintConstruction.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .blueprintConstruction.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintConstructionsQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintConstructionsQuery.ts index 35700315e9..b8f5b8371e 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintConstructionsQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintConstructionsQuery.ts @@ -4,20 +4,35 @@ * 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 { blueprintConstructionKeys } from "../query-keys"; -import type { BlueprintConstructionSelect, BlueprintConstructionWithRelations, BlueprintConstructionFilter, BlueprintConstructionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintConstructionSelect, BlueprintConstructionWithRelations, BlueprintConstructionFilter, BlueprintConstructionOrderBy } from "../../orm/input-types"; +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 { blueprintConstructionKeys } from '../query-keys'; +import type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + BlueprintConstructionSelect, + BlueprintConstructionWithRelations, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const blueprintConstructionsQueryKey = blueprintConstructionKeys.list; /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```tsx * const { data, isLoading } = useBlueprintConstructionsQuery({ @@ -30,33 +45,60 @@ export const blueprintConstructionsQueryKey = blueprintConstructionKeys.list; * }); * ``` */ -export function useBlueprintConstructionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintConstructionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBlueprintConstructionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useBlueprintConstructionsQuery< + S extends BlueprintConstructionSelect, + TData = { + blueprintConstructions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, BlueprintConstructionSelect>; + } & Omit< + UseQueryOptions< + { + blueprintConstructions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBlueprintConstructionsQuery( + params: { + selection: ListSelectionConfig< + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: blueprintConstructionKeys.list(args), queryFn: () => getClient().blueprintConstruction.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```ts * const data = await fetchBlueprintConstructionsQuery({ @@ -67,38 +109,72 @@ export function useBlueprintConstructionsQuery(params: { * }); * ``` */ -export async function fetchBlueprintConstructionsQuery(params: { +export async function fetchBlueprintConstructionsQuery< + S extends BlueprintConstructionSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintConstructionSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, BlueprintConstructionSelect>; }): Promise<{ - blueprintConstructions: ConnectionResult>; + blueprintConstructions: ConnectionResult< + InferSelectResult + >; }>; export async function fetchBlueprintConstructionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy + >(params.selection); return getClient().blueprintConstruction.findMany(args).unwrap(); } /** * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts. - * + * * @example * ```ts * await prefetchBlueprintConstructionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchBlueprintConstructionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintConstructionSelect>; -}): Promise; -export async function prefetchBlueprintConstructionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchBlueprintConstructionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, BlueprintConstructionSelect>; + } +): Promise; +export async function prefetchBlueprintConstructionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: blueprintConstructionKeys.list(args), - queryFn: () => getClient().blueprintConstruction.findMany(args).unwrap() + queryFn: () => getClient().blueprintConstruction.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintQuery.ts index c558f3c48a..31f820d617 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintQuery.ts @@ -4,20 +4,20 @@ * 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 { blueprintKeys } from "../query-keys"; -import type { BlueprintSelect, BlueprintWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintSelect, BlueprintWithRelations } from "../../orm/input-types"; +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 { blueprintKeys } from '../query-keys'; +import type { BlueprintSelect, BlueprintWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { BlueprintSelect, BlueprintWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const blueprintQueryKey = blueprintKeys.detail; /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```tsx * const { data, isLoading } = useBlueprintQuery({ @@ -26,38 +26,52 @@ export const blueprintQueryKey = blueprintKeys.detail; * }); * ``` */ -export function useBlueprintQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BlueprintSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBlueprintQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useBlueprintQuery< + S extends BlueprintSelect, + TData = { + blueprint: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BlueprintSelect>; + } & Omit< + UseQueryOptions< + { + blueprint: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBlueprintQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: blueprintKeys.detail(params.id), - queryFn: () => getClient().blueprint.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .blueprint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```ts * const data = await fetchBlueprintQuery({ @@ -79,35 +93,46 @@ export async function fetchBlueprintQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().blueprint.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .blueprint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```ts * await prefetchBlueprintQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchBlueprintQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BlueprintSelect>; -}): Promise; -export async function prefetchBlueprintQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchBlueprintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BlueprintSelect>; + } +): Promise; +export async function prefetchBlueprintQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: blueprintKeys.detail(params.id), - queryFn: () => getClient().blueprint.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .blueprint.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintTemplateQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintTemplateQuery.ts index d982198ce0..e4e88528de 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintTemplateQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintTemplateQuery.ts @@ -4,20 +4,26 @@ * 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 { blueprintTemplateKeys } from "../query-keys"; -import type { BlueprintTemplateSelect, BlueprintTemplateWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintTemplateSelect, BlueprintTemplateWithRelations } from "../../orm/input-types"; +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 { blueprintTemplateKeys } from '../query-keys'; +import type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const blueprintTemplateQueryKey = blueprintTemplateKeys.detail; /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```tsx * const { data, isLoading } = useBlueprintTemplateQuery({ @@ -26,38 +32,52 @@ export const blueprintTemplateQueryKey = blueprintTemplateKeys.detail; * }); * ``` */ -export function useBlueprintTemplateQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BlueprintTemplateSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBlueprintTemplateQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useBlueprintTemplateQuery< + S extends BlueprintTemplateSelect, + TData = { + blueprintTemplate: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BlueprintTemplateSelect>; + } & Omit< + UseQueryOptions< + { + blueprintTemplate: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBlueprintTemplateQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: blueprintTemplateKeys.detail(params.id), - queryFn: () => getClient().blueprintTemplate.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .blueprintTemplate.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```ts * const data = await fetchBlueprintTemplateQuery({ @@ -79,35 +99,46 @@ export async function fetchBlueprintTemplateQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().blueprintTemplate.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .blueprintTemplate.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```ts * await prefetchBlueprintTemplateQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchBlueprintTemplateQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, BlueprintTemplateSelect>; -}): Promise; -export async function prefetchBlueprintTemplateQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchBlueprintTemplateQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, BlueprintTemplateSelect>; + } +): Promise; +export async function prefetchBlueprintTemplateQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: blueprintTemplateKeys.detail(params.id), - queryFn: () => getClient().blueprintTemplate.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .blueprintTemplate.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintTemplatesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintTemplatesQuery.ts index 628d94853a..49d0c9e4e3 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintTemplatesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintTemplatesQuery.ts @@ -4,20 +4,35 @@ * 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 { blueprintTemplateKeys } from "../query-keys"; -import type { BlueprintTemplateSelect, BlueprintTemplateWithRelations, BlueprintTemplateFilter, BlueprintTemplateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintTemplateSelect, BlueprintTemplateWithRelations, BlueprintTemplateFilter, BlueprintTemplateOrderBy } from "../../orm/input-types"; +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 { blueprintTemplateKeys } from '../query-keys'; +import type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + BlueprintTemplateSelect, + BlueprintTemplateWithRelations, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const blueprintTemplatesQueryKey = blueprintTemplateKeys.list; /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```tsx * const { data, isLoading } = useBlueprintTemplatesQuery({ @@ -30,33 +45,53 @@ export const blueprintTemplatesQueryKey = blueprintTemplateKeys.list; * }); * ``` */ -export function useBlueprintTemplatesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintTemplateSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBlueprintTemplatesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useBlueprintTemplatesQuery< + S extends BlueprintTemplateSelect, + TData = { + blueprintTemplates: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, BlueprintTemplateSelect>; + } & Omit< + UseQueryOptions< + { + blueprintTemplates: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBlueprintTemplatesQuery( + params: { + selection: ListSelectionConfig< + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: blueprintTemplateKeys.list(args), queryFn: () => getClient().blueprintTemplate.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```ts * const data = await fetchBlueprintTemplatesQuery({ @@ -70,35 +105,59 @@ export function useBlueprintTemplatesQuery(params: { export async function fetchBlueprintTemplatesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintTemplateSelect>; + } & Omit, 'fields'> & + HookStrictSelect, BlueprintTemplateSelect>; }): Promise<{ blueprintTemplates: ConnectionResult>; }>; export async function fetchBlueprintTemplatesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy + >(params.selection); return getClient().blueprintTemplate.findMany(args).unwrap(); } /** * A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible). - * + * * @example * ```ts * await prefetchBlueprintTemplatesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchBlueprintTemplatesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintTemplateSelect>; -}): Promise; -export async function prefetchBlueprintTemplatesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchBlueprintTemplatesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, BlueprintTemplateSelect>; + } +): Promise; +export async function prefetchBlueprintTemplatesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: blueprintTemplateKeys.list(args), - queryFn: () => getClient().blueprintTemplate.findMany(args).unwrap() + queryFn: () => getClient().blueprintTemplate.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintsQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintsQuery.ts index 64d6dcd007..530efaefa1 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useBlueprintsQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useBlueprintsQuery.ts @@ -4,20 +4,35 @@ * 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 { blueprintKeys } from "../query-keys"; -import type { BlueprintSelect, BlueprintWithRelations, BlueprintFilter, BlueprintOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { BlueprintSelect, BlueprintWithRelations, BlueprintFilter, BlueprintOrderBy } from "../../orm/input-types"; +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 { blueprintKeys } from '../query-keys'; +import type { + BlueprintSelect, + BlueprintWithRelations, + BlueprintFilter, + BlueprintOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + BlueprintSelect, + BlueprintWithRelations, + BlueprintFilter, + BlueprintOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const blueprintsQueryKey = blueprintKeys.list; /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```tsx * const { data, isLoading } = useBlueprintsQuery({ @@ -30,33 +45,47 @@ export const blueprintsQueryKey = blueprintKeys.list; * }); * ``` */ -export function useBlueprintsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useBlueprintsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useBlueprintsQuery< + S extends BlueprintSelect, + TData = { + blueprints: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, BlueprintSelect>; + } & Omit< + UseQueryOptions< + { + blueprints: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useBlueprintsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: blueprintKeys.list(args), queryFn: () => getClient().blueprint.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```ts * const data = await fetchBlueprintsQuery({ @@ -70,35 +99,47 @@ export function useBlueprintsQuery(params: { export async function fetchBlueprintsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintSelect>; + } & Omit, 'fields'> & + HookStrictSelect, BlueprintSelect>; }): Promise<{ blueprints: ConnectionResult>; }>; export async function fetchBlueprintsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().blueprint.findMany(args).unwrap(); } /** * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build. - * + * * @example * ```ts * await prefetchBlueprintsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchBlueprintsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, BlueprintSelect>; -}): Promise; -export async function prefetchBlueprintsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchBlueprintsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, BlueprintSelect>; + } +): Promise; +export async function prefetchBlueprintsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: blueprintKeys.list(args), - queryFn: () => getClient().blueprint.findMany(args).unwrap() + queryFn: () => getClient().blueprint.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useCatalogModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useCatalogModuleQuery.ts index 768703a36f..ce42b450bf 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useCatalogModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useCatalogModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { catalogModuleKeys } from "../query-keys"; -import type { CatalogModuleSelect, CatalogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CatalogModuleSelect, CatalogModuleWithRelations } from "../../orm/input-types"; +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 { catalogModuleKeys } from '../query-keys'; +import type { CatalogModuleSelect, CatalogModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CatalogModuleSelect, CatalogModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const catalogModuleQueryKey = catalogModuleKeys.detail; /** * Query hook for fetching a single CatalogModule - * + * * @example * ```tsx * const { data, isLoading } = useCatalogModuleQuery({ @@ -26,38 +26,52 @@ export const catalogModuleQueryKey = catalogModuleKeys.detail; * }); * ``` */ -export function useCatalogModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CatalogModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCatalogModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCatalogModuleQuery< + S extends CatalogModuleSelect, + TData = { + catalogModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CatalogModuleSelect>; + } & Omit< + UseQueryOptions< + { + catalogModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCatalogModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: catalogModuleKeys.detail(params.id), - queryFn: () => getClient().catalogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .catalogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single CatalogModule without React hooks - * + * * @example * ```ts * const data = await fetchCatalogModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchCatalogModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().catalogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .catalogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single CatalogModule for SSR or cache warming - * + * * @example * ```ts * await prefetchCatalogModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCatalogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CatalogModuleSelect>; -}): Promise; -export async function prefetchCatalogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchCatalogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CatalogModuleSelect>; + } +): Promise; +export async function prefetchCatalogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: catalogModuleKeys.detail(params.id), - queryFn: () => getClient().catalogModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .catalogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useCatalogModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useCatalogModulesQuery.ts index 9b16b848f0..6e84f24c00 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useCatalogModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useCatalogModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { catalogModuleKeys } from "../query-keys"; -import type { CatalogModuleSelect, CatalogModuleWithRelations, CatalogModuleFilter, CatalogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { CatalogModuleSelect, CatalogModuleWithRelations, CatalogModuleFilter, CatalogModuleOrderBy } from "../../orm/input-types"; +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 { catalogModuleKeys } from '../query-keys'; +import type { + CatalogModuleSelect, + CatalogModuleWithRelations, + CatalogModuleFilter, + CatalogModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + CatalogModuleSelect, + CatalogModuleWithRelations, + CatalogModuleFilter, + CatalogModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const catalogModulesQueryKey = catalogModuleKeys.list; /** * Query hook for fetching CatalogModule list - * + * * @example * ```tsx * const { data, isLoading } = useCatalogModulesQuery({ @@ -30,33 +45,49 @@ export const catalogModulesQueryKey = catalogModuleKeys.list; * }); * ``` */ -export function useCatalogModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CatalogModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCatalogModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useCatalogModulesQuery< + S extends CatalogModuleSelect, + TData = { + catalogModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CatalogModuleSelect>; + } & Omit< + UseQueryOptions< + { + catalogModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCatalogModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + CatalogModuleSelect, + CatalogModuleFilter, + CatalogModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: catalogModuleKeys.list(args), queryFn: () => getClient().catalogModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch CatalogModule list without React hooks - * + * * @example * ```ts * const data = await fetchCatalogModulesQuery({ @@ -70,35 +101,51 @@ export function useCatalogModulesQuery(params: { export async function fetchCatalogModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, CatalogModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, CatalogModuleSelect>; }): Promise<{ catalogModules: ConnectionResult>; }>; export async function fetchCatalogModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + CatalogModuleSelect, + CatalogModuleFilter, + CatalogModuleOrderBy + >(params.selection); return getClient().catalogModule.findMany(args).unwrap(); } /** * Prefetch CatalogModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchCatalogModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchCatalogModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CatalogModuleSelect>; -}): Promise; -export async function prefetchCatalogModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchCatalogModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CatalogModuleSelect>; + } +): Promise; +export async function prefetchCatalogModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + CatalogModuleSelect, + CatalogModuleFilter, + CatalogModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: catalogModuleKeys.list(args), - queryFn: () => getClient().catalogModule.findMany(args).unwrap() + queryFn: () => getClient().catalogModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useComputeLogModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useComputeLogModuleQuery.ts index a19b5f7f41..402d8bcbe9 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useComputeLogModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useComputeLogModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { computeLogModuleKeys } from "../query-keys"; -import type { ComputeLogModuleSelect, ComputeLogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ComputeLogModuleSelect, ComputeLogModuleWithRelations } from "../../orm/input-types"; +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 { computeLogModuleKeys } from '../query-keys'; +import type { ComputeLogModuleSelect, ComputeLogModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ComputeLogModuleSelect, ComputeLogModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const computeLogModuleQueryKey = computeLogModuleKeys.detail; /** * Query hook for fetching a single ComputeLogModule - * + * * @example * ```tsx * const { data, isLoading } = useComputeLogModuleQuery({ @@ -26,38 +26,52 @@ export const computeLogModuleQueryKey = computeLogModuleKeys.detail; * }); * ``` */ -export function useComputeLogModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ComputeLogModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useComputeLogModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useComputeLogModuleQuery< + S extends ComputeLogModuleSelect, + TData = { + computeLogModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ComputeLogModuleSelect>; + } & Omit< + UseQueryOptions< + { + computeLogModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useComputeLogModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: computeLogModuleKeys.detail(params.id), - queryFn: () => getClient().computeLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .computeLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ComputeLogModule without React hooks - * + * * @example * ```ts * const data = await fetchComputeLogModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchComputeLogModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().computeLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .computeLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ComputeLogModule for SSR or cache warming - * + * * @example * ```ts * await prefetchComputeLogModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchComputeLogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ComputeLogModuleSelect>; -}): Promise; -export async function prefetchComputeLogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchComputeLogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ComputeLogModuleSelect>; + } +): Promise; +export async function prefetchComputeLogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: computeLogModuleKeys.detail(params.id), - queryFn: () => getClient().computeLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .computeLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useComputeLogModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useComputeLogModulesQuery.ts index e449e66b14..64d7e3e6c2 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useComputeLogModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useComputeLogModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { computeLogModuleKeys } from "../query-keys"; -import type { ComputeLogModuleSelect, ComputeLogModuleWithRelations, ComputeLogModuleFilter, ComputeLogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ComputeLogModuleSelect, ComputeLogModuleWithRelations, ComputeLogModuleFilter, ComputeLogModuleOrderBy } from "../../orm/input-types"; +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 { computeLogModuleKeys } from '../query-keys'; +import type { + ComputeLogModuleSelect, + ComputeLogModuleWithRelations, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ComputeLogModuleSelect, + ComputeLogModuleWithRelations, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const computeLogModulesQueryKey = computeLogModuleKeys.list; /** * Query hook for fetching ComputeLogModule list - * + * * @example * ```tsx * const { data, isLoading } = useComputeLogModulesQuery({ @@ -30,33 +45,53 @@ export const computeLogModulesQueryKey = computeLogModuleKeys.list; * }); * ``` */ -export function useComputeLogModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ComputeLogModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useComputeLogModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useComputeLogModulesQuery< + S extends ComputeLogModuleSelect, + TData = { + computeLogModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ComputeLogModuleSelect>; + } & Omit< + UseQueryOptions< + { + computeLogModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useComputeLogModulesQuery( + params: { + selection: ListSelectionConfig< + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: computeLogModuleKeys.list(args), queryFn: () => getClient().computeLogModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ComputeLogModule list without React hooks - * + * * @example * ```ts * const data = await fetchComputeLogModulesQuery({ @@ -70,35 +105,59 @@ export function useComputeLogModulesQuery(params: { export async function fetchComputeLogModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ComputeLogModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ComputeLogModuleSelect>; }): Promise<{ computeLogModules: ConnectionResult>; }>; export async function fetchComputeLogModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy + >(params.selection); return getClient().computeLogModule.findMany(args).unwrap(); } /** * Prefetch ComputeLogModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchComputeLogModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchComputeLogModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ComputeLogModuleSelect>; -}): Promise; -export async function prefetchComputeLogModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchComputeLogModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ComputeLogModuleSelect>; + } +): Promise; +export async function prefetchComputeLogModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: computeLogModuleKeys.list(args), - queryFn: () => getClient().computeLogModule.findMany(args).unwrap() + queryFn: () => getClient().computeLogModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useConfigSecretsUserModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useConfigSecretsUserModuleQuery.ts index a30b719f2e..0417e18743 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useConfigSecretsUserModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useConfigSecretsUserModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { configSecretsUserModuleKeys } from "../query-keys"; -import type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations } from "../../orm/input-types"; +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 { configSecretsUserModuleKeys } from '../query-keys'; +import type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const configSecretsUserModuleQueryKey = configSecretsUserModuleKeys.detail; /** * Query hook for fetching a single ConfigSecretsUserModule - * + * * @example * ```tsx * const { data, isLoading } = useConfigSecretsUserModuleQuery({ @@ -26,38 +32,52 @@ export const configSecretsUserModuleQueryKey = configSecretsUserModuleKeys.detai * }); * ``` */ -export function useConfigSecretsUserModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ConfigSecretsUserModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useConfigSecretsUserModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useConfigSecretsUserModuleQuery< + S extends ConfigSecretsUserModuleSelect, + TData = { + configSecretsUserModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ConfigSecretsUserModuleSelect>; + } & Omit< + UseQueryOptions< + { + configSecretsUserModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useConfigSecretsUserModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: configSecretsUserModuleKeys.detail(params.id), - queryFn: () => getClient().configSecretsUserModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .configSecretsUserModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ConfigSecretsUserModule without React hooks - * + * * @example * ```ts * const data = await fetchConfigSecretsUserModuleQuery({ @@ -66,7 +86,9 @@ export function useConfigSecretsUserModuleQuery(params: { * }); * ``` */ -export async function fetchConfigSecretsUserModuleQuery(params: { +export async function fetchConfigSecretsUserModuleQuery< + S extends ConfigSecretsUserModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchConfigSecretsUserModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().configSecretsUserModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .configSecretsUserModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ConfigSecretsUserModule for SSR or cache warming - * + * * @example * ```ts * await prefetchConfigSecretsUserModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchConfigSecretsUserModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ConfigSecretsUserModuleSelect>; -}): Promise; -export async function prefetchConfigSecretsUserModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchConfigSecretsUserModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ConfigSecretsUserModuleSelect>; + } +): Promise; +export async function prefetchConfigSecretsUserModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: configSecretsUserModuleKeys.detail(params.id), - queryFn: () => getClient().configSecretsUserModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .configSecretsUserModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useConfigSecretsUserModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useConfigSecretsUserModulesQuery.ts index 5f906a5dd3..7a13019670 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useConfigSecretsUserModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useConfigSecretsUserModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { configSecretsUserModuleKeys } from "../query-keys"; -import type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations, ConfigSecretsUserModuleFilter, ConfigSecretsUserModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleWithRelations, ConfigSecretsUserModuleFilter, ConfigSecretsUserModuleOrderBy } from "../../orm/input-types"; +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 { configSecretsUserModuleKeys } from '../query-keys'; +import type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleWithRelations, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const configSecretsUserModulesQueryKey = configSecretsUserModuleKeys.list; /** * Query hook for fetching ConfigSecretsUserModule list - * + * * @example * ```tsx * const { data, isLoading } = useConfigSecretsUserModulesQuery({ @@ -30,33 +45,60 @@ export const configSecretsUserModulesQueryKey = configSecretsUserModuleKeys.list * }); * ``` */ -export function useConfigSecretsUserModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ConfigSecretsUserModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useConfigSecretsUserModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useConfigSecretsUserModulesQuery< + S extends ConfigSecretsUserModuleSelect, + TData = { + configSecretsUserModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ConfigSecretsUserModuleSelect>; + } & Omit< + UseQueryOptions< + { + configSecretsUserModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useConfigSecretsUserModulesQuery( + params: { + selection: ListSelectionConfig< + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: configSecretsUserModuleKeys.list(args), queryFn: () => getClient().configSecretsUserModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ConfigSecretsUserModule list without React hooks - * + * * @example * ```ts * const data = await fetchConfigSecretsUserModulesQuery({ @@ -67,38 +109,74 @@ export function useConfigSecretsUserModulesQuery(params: { * }); * ``` */ -export async function fetchConfigSecretsUserModulesQuery(params: { +export async function fetchConfigSecretsUserModulesQuery< + S extends ConfigSecretsUserModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ConfigSecretsUserModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ConfigSecretsUserModuleSelect>; }): Promise<{ - configSecretsUserModules: ConnectionResult>; + configSecretsUserModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchConfigSecretsUserModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy + >(params.selection); return getClient().configSecretsUserModule.findMany(args).unwrap(); } /** * Prefetch ConfigSecretsUserModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchConfigSecretsUserModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchConfigSecretsUserModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ConfigSecretsUserModuleSelect>; -}): Promise; -export async function prefetchConfigSecretsUserModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchConfigSecretsUserModulesQuery< + S extends ConfigSecretsUserModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ConfigSecretsUserModuleSelect>; + } +): Promise; +export async function prefetchConfigSecretsUserModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: configSecretsUserModuleKeys.list(args), - queryFn: () => getClient().configSecretsUserModule.findMany(args).unwrap() + queryFn: () => getClient().configSecretsUserModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useConnectedAccountsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useConnectedAccountsModuleQuery.ts index 18a6655af8..fc4763332f 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useConnectedAccountsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useConnectedAccountsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { connectedAccountsModuleKeys } from "../query-keys"; -import type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations } from "../../orm/input-types"; +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 { connectedAccountsModuleKeys } from '../query-keys'; +import type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const connectedAccountsModuleQueryKey = connectedAccountsModuleKeys.detail; /** * Query hook for fetching a single ConnectedAccountsModule - * + * * @example * ```tsx * const { data, isLoading } = useConnectedAccountsModuleQuery({ @@ -26,38 +32,52 @@ export const connectedAccountsModuleQueryKey = connectedAccountsModuleKeys.detai * }); * ``` */ -export function useConnectedAccountsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ConnectedAccountsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useConnectedAccountsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useConnectedAccountsModuleQuery< + S extends ConnectedAccountsModuleSelect, + TData = { + connectedAccountsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ConnectedAccountsModuleSelect>; + } & Omit< + UseQueryOptions< + { + connectedAccountsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useConnectedAccountsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: connectedAccountsModuleKeys.detail(params.id), - queryFn: () => getClient().connectedAccountsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .connectedAccountsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ConnectedAccountsModule without React hooks - * + * * @example * ```ts * const data = await fetchConnectedAccountsModuleQuery({ @@ -66,7 +86,9 @@ export function useConnectedAccountsModuleQuery(params: { * }); * ``` */ -export async function fetchConnectedAccountsModuleQuery(params: { +export async function fetchConnectedAccountsModuleQuery< + S extends ConnectedAccountsModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchConnectedAccountsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().connectedAccountsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .connectedAccountsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ConnectedAccountsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchConnectedAccountsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchConnectedAccountsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ConnectedAccountsModuleSelect>; -}): Promise; -export async function prefetchConnectedAccountsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchConnectedAccountsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ConnectedAccountsModuleSelect>; + } +): Promise; +export async function prefetchConnectedAccountsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: connectedAccountsModuleKeys.detail(params.id), - queryFn: () => getClient().connectedAccountsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .connectedAccountsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useConnectedAccountsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useConnectedAccountsModulesQuery.ts index e239d6c2ab..61289bfb33 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useConnectedAccountsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useConnectedAccountsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { connectedAccountsModuleKeys } from "../query-keys"; -import type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations, ConnectedAccountsModuleFilter, ConnectedAccountsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ConnectedAccountsModuleSelect, ConnectedAccountsModuleWithRelations, ConnectedAccountsModuleFilter, ConnectedAccountsModuleOrderBy } from "../../orm/input-types"; +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 { connectedAccountsModuleKeys } from '../query-keys'; +import type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleWithRelations, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const connectedAccountsModulesQueryKey = connectedAccountsModuleKeys.list; /** * Query hook for fetching ConnectedAccountsModule list - * + * * @example * ```tsx * const { data, isLoading } = useConnectedAccountsModulesQuery({ @@ -30,33 +45,60 @@ export const connectedAccountsModulesQueryKey = connectedAccountsModuleKeys.list * }); * ``` */ -export function useConnectedAccountsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ConnectedAccountsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useConnectedAccountsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useConnectedAccountsModulesQuery< + S extends ConnectedAccountsModuleSelect, + TData = { + connectedAccountsModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ConnectedAccountsModuleSelect>; + } & Omit< + UseQueryOptions< + { + connectedAccountsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useConnectedAccountsModulesQuery( + params: { + selection: ListSelectionConfig< + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: connectedAccountsModuleKeys.list(args), queryFn: () => getClient().connectedAccountsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ConnectedAccountsModule list without React hooks - * + * * @example * ```ts * const data = await fetchConnectedAccountsModulesQuery({ @@ -67,38 +109,74 @@ export function useConnectedAccountsModulesQuery(params: { * }); * ``` */ -export async function fetchConnectedAccountsModulesQuery(params: { +export async function fetchConnectedAccountsModulesQuery< + S extends ConnectedAccountsModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ConnectedAccountsModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ConnectedAccountsModuleSelect>; }): Promise<{ - connectedAccountsModules: ConnectionResult>; + connectedAccountsModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchConnectedAccountsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy + >(params.selection); return getClient().connectedAccountsModule.findMany(args).unwrap(); } /** * Prefetch ConnectedAccountsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchConnectedAccountsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchConnectedAccountsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ConnectedAccountsModuleSelect>; -}): Promise; -export async function prefetchConnectedAccountsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchConnectedAccountsModulesQuery< + S extends ConnectedAccountsModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, ConnectedAccountsModuleSelect>; + } +): Promise; +export async function prefetchConnectedAccountsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: connectedAccountsModuleKeys.list(args), - queryFn: () => getClient().connectedAccountsModule.findMany(args).unwrap() + queryFn: () => getClient().connectedAccountsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useCryptoAddressesModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useCryptoAddressesModuleQuery.ts index 88fbed3c6d..da6c9e19ae 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useCryptoAddressesModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useCryptoAddressesModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { cryptoAddressesModuleKeys } from "../query-keys"; -import type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations } from "../../orm/input-types"; +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 { cryptoAddressesModuleKeys } from '../query-keys'; +import type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const cryptoAddressesModuleQueryKey = cryptoAddressesModuleKeys.detail; /** * Query hook for fetching a single CryptoAddressesModule - * + * * @example * ```tsx * const { data, isLoading } = useCryptoAddressesModuleQuery({ @@ -26,38 +32,52 @@ export const cryptoAddressesModuleQueryKey = cryptoAddressesModuleKeys.detail; * }); * ``` */ -export function useCryptoAddressesModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CryptoAddressesModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCryptoAddressesModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCryptoAddressesModuleQuery< + S extends CryptoAddressesModuleSelect, + TData = { + cryptoAddressesModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CryptoAddressesModuleSelect>; + } & Omit< + UseQueryOptions< + { + cryptoAddressesModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCryptoAddressesModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: cryptoAddressesModuleKeys.detail(params.id), - queryFn: () => getClient().cryptoAddressesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .cryptoAddressesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single CryptoAddressesModule without React hooks - * + * * @example * ```ts * const data = await fetchCryptoAddressesModuleQuery({ @@ -66,7 +86,9 @@ export function useCryptoAddressesModuleQuery(params: { * }); * ``` */ -export async function fetchCryptoAddressesModuleQuery(params: { +export async function fetchCryptoAddressesModuleQuery< + S extends CryptoAddressesModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchCryptoAddressesModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().cryptoAddressesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .cryptoAddressesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single CryptoAddressesModule for SSR or cache warming - * + * * @example * ```ts * await prefetchCryptoAddressesModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCryptoAddressesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CryptoAddressesModuleSelect>; -}): Promise; -export async function prefetchCryptoAddressesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchCryptoAddressesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CryptoAddressesModuleSelect>; + } +): Promise; +export async function prefetchCryptoAddressesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: cryptoAddressesModuleKeys.detail(params.id), - queryFn: () => getClient().cryptoAddressesModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .cryptoAddressesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useCryptoAddressesModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useCryptoAddressesModulesQuery.ts index 4f4c26b583..7ecdd864e5 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useCryptoAddressesModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useCryptoAddressesModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { cryptoAddressesModuleKeys } from "../query-keys"; -import type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations, CryptoAddressesModuleFilter, CryptoAddressesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAddressesModuleSelect, CryptoAddressesModuleWithRelations, CryptoAddressesModuleFilter, CryptoAddressesModuleOrderBy } from "../../orm/input-types"; +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 { cryptoAddressesModuleKeys } from '../query-keys'; +import type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + CryptoAddressesModuleSelect, + CryptoAddressesModuleWithRelations, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const cryptoAddressesModulesQueryKey = cryptoAddressesModuleKeys.list; /** * Query hook for fetching CryptoAddressesModule list - * + * * @example * ```tsx * const { data, isLoading } = useCryptoAddressesModulesQuery({ @@ -30,33 +45,60 @@ export const cryptoAddressesModulesQueryKey = cryptoAddressesModuleKeys.list; * }); * ``` */ -export function useCryptoAddressesModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAddressesModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCryptoAddressesModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useCryptoAddressesModulesQuery< + S extends CryptoAddressesModuleSelect, + TData = { + cryptoAddressesModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, CryptoAddressesModuleSelect>; + } & Omit< + UseQueryOptions< + { + cryptoAddressesModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCryptoAddressesModulesQuery( + params: { + selection: ListSelectionConfig< + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: cryptoAddressesModuleKeys.list(args), queryFn: () => getClient().cryptoAddressesModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch CryptoAddressesModule list without React hooks - * + * * @example * ```ts * const data = await fetchCryptoAddressesModulesQuery({ @@ -67,38 +109,72 @@ export function useCryptoAddressesModulesQuery(params: { * }); * ``` */ -export async function fetchCryptoAddressesModulesQuery(params: { +export async function fetchCryptoAddressesModulesQuery< + S extends CryptoAddressesModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAddressesModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, CryptoAddressesModuleSelect>; }): Promise<{ - cryptoAddressesModules: ConnectionResult>; + cryptoAddressesModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchCryptoAddressesModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy + >(params.selection); return getClient().cryptoAddressesModule.findMany(args).unwrap(); } /** * Prefetch CryptoAddressesModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchCryptoAddressesModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchCryptoAddressesModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAddressesModuleSelect>; -}): Promise; -export async function prefetchCryptoAddressesModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchCryptoAddressesModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, CryptoAddressesModuleSelect>; + } +): Promise; +export async function prefetchCryptoAddressesModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: cryptoAddressesModuleKeys.list(args), - queryFn: () => getClient().cryptoAddressesModule.findMany(args).unwrap() + queryFn: () => getClient().cryptoAddressesModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useCryptoAuthModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useCryptoAuthModuleQuery.ts index 9d5b3d234d..b9f349d2e5 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useCryptoAuthModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useCryptoAuthModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { cryptoAuthModuleKeys } from "../query-keys"; -import type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations } from "../../orm/input-types"; +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 { cryptoAuthModuleKeys } from '../query-keys'; +import type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const cryptoAuthModuleQueryKey = cryptoAuthModuleKeys.detail; /** * Query hook for fetching a single CryptoAuthModule - * + * * @example * ```tsx * const { data, isLoading } = useCryptoAuthModuleQuery({ @@ -26,38 +26,52 @@ export const cryptoAuthModuleQueryKey = cryptoAuthModuleKeys.detail; * }); * ``` */ -export function useCryptoAuthModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CryptoAuthModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCryptoAuthModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCryptoAuthModuleQuery< + S extends CryptoAuthModuleSelect, + TData = { + cryptoAuthModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CryptoAuthModuleSelect>; + } & Omit< + UseQueryOptions< + { + cryptoAuthModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCryptoAuthModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: cryptoAuthModuleKeys.detail(params.id), - queryFn: () => getClient().cryptoAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .cryptoAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single CryptoAuthModule without React hooks - * + * * @example * ```ts * const data = await fetchCryptoAuthModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchCryptoAuthModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().cryptoAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .cryptoAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single CryptoAuthModule for SSR or cache warming - * + * * @example * ```ts * await prefetchCryptoAuthModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCryptoAuthModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CryptoAuthModuleSelect>; -}): Promise; -export async function prefetchCryptoAuthModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchCryptoAuthModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CryptoAuthModuleSelect>; + } +): Promise; +export async function prefetchCryptoAuthModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: cryptoAuthModuleKeys.detail(params.id), - queryFn: () => getClient().cryptoAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .cryptoAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useCryptoAuthModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useCryptoAuthModulesQuery.ts index 7a3edea5a2..72f8f5da80 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useCryptoAuthModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useCryptoAuthModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { cryptoAuthModuleKeys } from "../query-keys"; -import type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations, CryptoAuthModuleFilter, CryptoAuthModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { CryptoAuthModuleSelect, CryptoAuthModuleWithRelations, CryptoAuthModuleFilter, CryptoAuthModuleOrderBy } from "../../orm/input-types"; +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 { cryptoAuthModuleKeys } from '../query-keys'; +import type { + CryptoAuthModuleSelect, + CryptoAuthModuleWithRelations, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + CryptoAuthModuleSelect, + CryptoAuthModuleWithRelations, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const cryptoAuthModulesQueryKey = cryptoAuthModuleKeys.list; /** * Query hook for fetching CryptoAuthModule list - * + * * @example * ```tsx * const { data, isLoading } = useCryptoAuthModulesQuery({ @@ -30,33 +45,53 @@ export const cryptoAuthModulesQueryKey = cryptoAuthModuleKeys.list; * }); * ``` */ -export function useCryptoAuthModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAuthModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCryptoAuthModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useCryptoAuthModulesQuery< + S extends CryptoAuthModuleSelect, + TData = { + cryptoAuthModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CryptoAuthModuleSelect>; + } & Omit< + UseQueryOptions< + { + cryptoAuthModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCryptoAuthModulesQuery( + params: { + selection: ListSelectionConfig< + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: cryptoAuthModuleKeys.list(args), queryFn: () => getClient().cryptoAuthModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch CryptoAuthModule list without React hooks - * + * * @example * ```ts * const data = await fetchCryptoAuthModulesQuery({ @@ -70,35 +105,59 @@ export function useCryptoAuthModulesQuery(params: { export async function fetchCryptoAuthModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAuthModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, CryptoAuthModuleSelect>; }): Promise<{ cryptoAuthModules: ConnectionResult>; }>; export async function fetchCryptoAuthModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy + >(params.selection); return getClient().cryptoAuthModule.findMany(args).unwrap(); } /** * Prefetch CryptoAuthModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchCryptoAuthModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchCryptoAuthModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CryptoAuthModuleSelect>; -}): Promise; -export async function prefetchCryptoAuthModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchCryptoAuthModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CryptoAuthModuleSelect>; + } +): Promise; +export async function prefetchCryptoAuthModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: cryptoAuthModuleKeys.list(args), - queryFn: () => getClient().cryptoAuthModule.findMany(args).unwrap() + queryFn: () => getClient().cryptoAuthModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDatabaseProvisionModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDatabaseProvisionModuleQuery.ts index eec0c0580b..24a9d16a88 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDatabaseProvisionModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDatabaseProvisionModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { databaseProvisionModuleKeys } from "../query-keys"; -import type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations } from "../../orm/input-types"; +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 { databaseProvisionModuleKeys } from '../query-keys'; +import type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseProvisionModuleQueryKey = databaseProvisionModuleKeys.detail; /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseProvisionModuleQuery({ @@ -26,38 +32,52 @@ export const databaseProvisionModuleQueryKey = databaseProvisionModuleKeys.detai * }); * ``` */ -export function useDatabaseProvisionModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseProvisionModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseProvisionModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDatabaseProvisionModuleQuery< + S extends DatabaseProvisionModuleSelect, + TData = { + databaseProvisionModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseProvisionModuleSelect>; + } & Omit< + UseQueryOptions< + { + databaseProvisionModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseProvisionModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseProvisionModuleKeys.detail(params.id), - queryFn: () => getClient().databaseProvisionModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .databaseProvisionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```ts * const data = await fetchDatabaseProvisionModuleQuery({ @@ -66,7 +86,9 @@ export function useDatabaseProvisionModuleQuery(params: { * }); * ``` */ -export async function fetchDatabaseProvisionModuleQuery(params: { +export async function fetchDatabaseProvisionModuleQuery< + S extends DatabaseProvisionModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchDatabaseProvisionModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().databaseProvisionModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .databaseProvisionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```ts * await prefetchDatabaseProvisionModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDatabaseProvisionModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseProvisionModuleSelect>; -}): Promise; -export async function prefetchDatabaseProvisionModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDatabaseProvisionModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseProvisionModuleSelect>; + } +): Promise; +export async function prefetchDatabaseProvisionModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: databaseProvisionModuleKeys.detail(params.id), - queryFn: () => getClient().databaseProvisionModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .databaseProvisionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDatabaseProvisionModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDatabaseProvisionModulesQuery.ts index 380cb63026..b3c666a18c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDatabaseProvisionModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDatabaseProvisionModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { databaseProvisionModuleKeys } from "../query-keys"; -import type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations, DatabaseProvisionModuleFilter, DatabaseProvisionModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseProvisionModuleSelect, DatabaseProvisionModuleWithRelations, DatabaseProvisionModuleFilter, DatabaseProvisionModuleOrderBy } from "../../orm/input-types"; +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 { databaseProvisionModuleKeys } from '../query-keys'; +import type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleWithRelations, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseProvisionModulesQueryKey = databaseProvisionModuleKeys.list; /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseProvisionModulesQuery({ @@ -30,33 +45,60 @@ export const databaseProvisionModulesQueryKey = databaseProvisionModuleKeys.list * }); * ``` */ -export function useDatabaseProvisionModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseProvisionModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseProvisionModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDatabaseProvisionModulesQuery< + S extends DatabaseProvisionModuleSelect, + TData = { + databaseProvisionModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DatabaseProvisionModuleSelect>; + } & Omit< + UseQueryOptions< + { + databaseProvisionModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseProvisionModulesQuery( + params: { + selection: ListSelectionConfig< + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseProvisionModuleKeys.list(args), queryFn: () => getClient().databaseProvisionModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```ts * const data = await fetchDatabaseProvisionModulesQuery({ @@ -67,38 +109,74 @@ export function useDatabaseProvisionModulesQuery(params: { * }); * ``` */ -export async function fetchDatabaseProvisionModulesQuery(params: { +export async function fetchDatabaseProvisionModulesQuery< + S extends DatabaseProvisionModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseProvisionModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DatabaseProvisionModuleSelect>; }): Promise<{ - databaseProvisionModules: ConnectionResult>; + databaseProvisionModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchDatabaseProvisionModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy + >(params.selection); return getClient().databaseProvisionModule.findMany(args).unwrap(); } /** * Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. - * + * * @example * ```ts * await prefetchDatabaseProvisionModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDatabaseProvisionModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseProvisionModuleSelect>; -}): Promise; -export async function prefetchDatabaseProvisionModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDatabaseProvisionModulesQuery< + S extends DatabaseProvisionModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DatabaseProvisionModuleSelect>; + } +): Promise; +export async function prefetchDatabaseProvisionModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: databaseProvisionModuleKeys.list(args), - queryFn: () => getClient().databaseProvisionModule.findMany(args).unwrap() + queryFn: () => getClient().databaseProvisionModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDatabaseSettingsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDatabaseSettingsModuleQuery.ts index 87e3daad92..fd70bdd5cc 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDatabaseSettingsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDatabaseSettingsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { databaseSettingsModuleKeys } from "../query-keys"; -import type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations } from "../../orm/input-types"; +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 { databaseSettingsModuleKeys } from '../query-keys'; +import type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseSettingsModuleQueryKey = databaseSettingsModuleKeys.detail; /** * Query hook for fetching a single DatabaseSettingsModule - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseSettingsModuleQuery({ @@ -26,38 +32,52 @@ export const databaseSettingsModuleQueryKey = databaseSettingsModuleKeys.detail; * }); * ``` */ -export function useDatabaseSettingsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseSettingsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseSettingsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDatabaseSettingsModuleQuery< + S extends DatabaseSettingsModuleSelect, + TData = { + databaseSettingsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseSettingsModuleSelect>; + } & Omit< + UseQueryOptions< + { + databaseSettingsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseSettingsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseSettingsModuleKeys.detail(params.id), - queryFn: () => getClient().databaseSettingsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .databaseSettingsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DatabaseSettingsModule without React hooks - * + * * @example * ```ts * const data = await fetchDatabaseSettingsModuleQuery({ @@ -66,7 +86,9 @@ export function useDatabaseSettingsModuleQuery(params: { * }); * ``` */ -export async function fetchDatabaseSettingsModuleQuery(params: { +export async function fetchDatabaseSettingsModuleQuery< + S extends DatabaseSettingsModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchDatabaseSettingsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().databaseSettingsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .databaseSettingsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DatabaseSettingsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchDatabaseSettingsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDatabaseSettingsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DatabaseSettingsModuleSelect>; -}): Promise; -export async function prefetchDatabaseSettingsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDatabaseSettingsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DatabaseSettingsModuleSelect>; + } +): Promise; +export async function prefetchDatabaseSettingsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: databaseSettingsModuleKeys.detail(params.id), - queryFn: () => getClient().databaseSettingsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .databaseSettingsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDatabaseSettingsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDatabaseSettingsModulesQuery.ts index 7f31bdf4c3..498ab0b24c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDatabaseSettingsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDatabaseSettingsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { databaseSettingsModuleKeys } from "../query-keys"; -import type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations, DatabaseSettingsModuleFilter, DatabaseSettingsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DatabaseSettingsModuleSelect, DatabaseSettingsModuleWithRelations, DatabaseSettingsModuleFilter, DatabaseSettingsModuleOrderBy } from "../../orm/input-types"; +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 { databaseSettingsModuleKeys } from '../query-keys'; +import type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleWithRelations, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const databaseSettingsModulesQueryKey = databaseSettingsModuleKeys.list; /** * Query hook for fetching DatabaseSettingsModule list - * + * * @example * ```tsx * const { data, isLoading } = useDatabaseSettingsModulesQuery({ @@ -30,33 +45,60 @@ export const databaseSettingsModulesQueryKey = databaseSettingsModuleKeys.list; * }); * ``` */ -export function useDatabaseSettingsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSettingsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDatabaseSettingsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDatabaseSettingsModulesQuery< + S extends DatabaseSettingsModuleSelect, + TData = { + databaseSettingsModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DatabaseSettingsModuleSelect>; + } & Omit< + UseQueryOptions< + { + databaseSettingsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDatabaseSettingsModulesQuery( + params: { + selection: ListSelectionConfig< + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: databaseSettingsModuleKeys.list(args), queryFn: () => getClient().databaseSettingsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DatabaseSettingsModule list without React hooks - * + * * @example * ```ts * const data = await fetchDatabaseSettingsModulesQuery({ @@ -67,38 +109,72 @@ export function useDatabaseSettingsModulesQuery(params: { * }); * ``` */ -export async function fetchDatabaseSettingsModulesQuery(params: { +export async function fetchDatabaseSettingsModulesQuery< + S extends DatabaseSettingsModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSettingsModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DatabaseSettingsModuleSelect>; }): Promise<{ - databaseSettingsModules: ConnectionResult>; + databaseSettingsModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchDatabaseSettingsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy + >(params.selection); return getClient().databaseSettingsModule.findMany(args).unwrap(); } /** * Prefetch DatabaseSettingsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchDatabaseSettingsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDatabaseSettingsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DatabaseSettingsModuleSelect>; -}): Promise; -export async function prefetchDatabaseSettingsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDatabaseSettingsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DatabaseSettingsModuleSelect>; + } +): Promise; +export async function prefetchDatabaseSettingsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: databaseSettingsModuleKeys.list(args), - queryFn: () => getClient().databaseSettingsModule.findMany(args).unwrap() + queryFn: () => getClient().databaseSettingsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDbPoolConfigQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDbPoolConfigQuery.ts index 21e48920b4..e99864fbe9 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDbPoolConfigQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDbPoolConfigQuery.ts @@ -4,20 +4,20 @@ * 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 { dbPoolConfigKeys } from "../query-keys"; -import type { DbPoolConfigSelect, DbPoolConfigWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolConfigSelect, DbPoolConfigWithRelations } from "../../orm/input-types"; +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 { dbPoolConfigKeys } from '../query-keys'; +import type { DbPoolConfigSelect, DbPoolConfigWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPoolConfigSelect, DbPoolConfigWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPoolConfigQueryKey = dbPoolConfigKeys.detail; /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```tsx * const { data, isLoading } = useDbPoolConfigQuery({ @@ -26,38 +26,52 @@ export const dbPoolConfigQueryKey = dbPoolConfigKeys.detail; * }); * ``` */ -export function useDbPoolConfigQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPoolConfigSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPoolConfigQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDbPoolConfigQuery< + S extends DbPoolConfigSelect, + TData = { + dbPoolConfig: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPoolConfigSelect>; + } & Omit< + UseQueryOptions< + { + dbPoolConfig: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPoolConfigQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPoolConfigKeys.detail(params.id), - queryFn: () => getClient().dbPoolConfig.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .dbPoolConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```ts * const data = await fetchDbPoolConfigQuery({ @@ -79,35 +93,46 @@ export async function fetchDbPoolConfigQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().dbPoolConfig.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .dbPoolConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```ts * await prefetchDbPoolConfigQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDbPoolConfigQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPoolConfigSelect>; -}): Promise; -export async function prefetchDbPoolConfigQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDbPoolConfigQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPoolConfigSelect>; + } +): Promise; +export async function prefetchDbPoolConfigQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: dbPoolConfigKeys.detail(params.id), - queryFn: () => getClient().dbPoolConfig.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .dbPoolConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDbPoolConfigsQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDbPoolConfigsQuery.ts index e9251dfb5a..1c41ee72cb 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDbPoolConfigsQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDbPoolConfigsQuery.ts @@ -4,20 +4,35 @@ * 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 { dbPoolConfigKeys } from "../query-keys"; -import type { DbPoolConfigSelect, DbPoolConfigWithRelations, DbPoolConfigFilter, DbPoolConfigOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolConfigSelect, DbPoolConfigWithRelations, DbPoolConfigFilter, DbPoolConfigOrderBy } from "../../orm/input-types"; +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 { dbPoolConfigKeys } from '../query-keys'; +import type { + DbPoolConfigSelect, + DbPoolConfigWithRelations, + DbPoolConfigFilter, + DbPoolConfigOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DbPoolConfigSelect, + DbPoolConfigWithRelations, + DbPoolConfigFilter, + DbPoolConfigOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPoolConfigsQueryKey = dbPoolConfigKeys.list; /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```tsx * const { data, isLoading } = useDbPoolConfigsQuery({ @@ -30,33 +45,47 @@ export const dbPoolConfigsQueryKey = dbPoolConfigKeys.list; * }); * ``` */ -export function useDbPoolConfigsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPoolConfigSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPoolConfigsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDbPoolConfigsQuery< + S extends DbPoolConfigSelect, + TData = { + dbPoolConfigs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPoolConfigSelect>; + } & Omit< + UseQueryOptions< + { + dbPoolConfigs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPoolConfigsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPoolConfigKeys.list(args), queryFn: () => getClient().dbPoolConfig.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```ts * const data = await fetchDbPoolConfigsQuery({ @@ -70,35 +99,47 @@ export function useDbPoolConfigsQuery(params: { export async function fetchDbPoolConfigsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPoolConfigSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DbPoolConfigSelect>; }): Promise<{ dbPoolConfigs: ConnectionResult>; }>; export async function fetchDbPoolConfigsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().dbPoolConfig.findMany(args).unwrap(); } /** * Per-preset configuration for the warm database pool: sizing, TTL, and the platform service org that owns unclaimed warm databases. - * + * * @example * ```ts * await prefetchDbPoolConfigsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDbPoolConfigsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPoolConfigSelect>; -}): Promise; -export async function prefetchDbPoolConfigsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDbPoolConfigsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPoolConfigSelect>; + } +): Promise; +export async function prefetchDbPoolConfigsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: dbPoolConfigKeys.list(args), - queryFn: () => getClient().dbPoolConfig.findMany(args).unwrap() + queryFn: () => getClient().dbPoolConfig.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDbPoolQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDbPoolQuery.ts index 3efd3ba5ba..d3b1e563fb 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDbPoolQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDbPoolQuery.ts @@ -4,20 +4,20 @@ * 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 { dbPoolKeys } from "../query-keys"; -import type { DbPoolSelect, DbPoolWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolSelect, DbPoolWithRelations } from "../../orm/input-types"; +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 { dbPoolKeys } from '../query-keys'; +import type { DbPoolSelect, DbPoolWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPoolSelect, DbPoolWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPoolQueryKey = dbPoolKeys.detail; /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```tsx * const { data, isLoading } = useDbPoolQuery({ @@ -26,38 +26,52 @@ export const dbPoolQueryKey = dbPoolKeys.detail; * }); * ``` */ -export function useDbPoolQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPoolSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPoolQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDbPoolQuery< + S extends DbPoolSelect, + TData = { + dbPool: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPoolSelect>; + } & Omit< + UseQueryOptions< + { + dbPool: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPoolQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPoolKeys.detail(params.id), - queryFn: () => getClient().dbPool.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .dbPool.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```ts * const data = await fetchDbPoolQuery({ @@ -79,35 +93,46 @@ export async function fetchDbPoolQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().dbPool.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .dbPool.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```ts * await prefetchDbPoolQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDbPoolQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPoolSelect>; -}): Promise; -export async function prefetchDbPoolQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDbPoolQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPoolSelect>; + } +): Promise; +export async function prefetchDbPoolQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: dbPoolKeys.detail(params.id), - queryFn: () => getClient().dbPool.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .dbPool.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDbPoolsQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDbPoolsQuery.ts index a504839c2c..2a7cffcb05 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDbPoolsQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDbPoolsQuery.ts @@ -4,20 +4,35 @@ * 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 { dbPoolKeys } from "../query-keys"; -import type { DbPoolSelect, DbPoolWithRelations, DbPoolFilter, DbPoolOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPoolSelect, DbPoolWithRelations, DbPoolFilter, DbPoolOrderBy } from "../../orm/input-types"; +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 { dbPoolKeys } from '../query-keys'; +import type { + DbPoolSelect, + DbPoolWithRelations, + DbPoolFilter, + DbPoolOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DbPoolSelect, + DbPoolWithRelations, + DbPoolFilter, + DbPoolOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPoolsQueryKey = dbPoolKeys.list; /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```tsx * const { data, isLoading } = useDbPoolsQuery({ @@ -30,33 +45,45 @@ export const dbPoolsQueryKey = dbPoolKeys.list; * }); * ``` */ -export function useDbPoolsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPoolSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPoolsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDbPoolsQuery< + S extends DbPoolSelect, + TData = { + dbPools: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPoolSelect>; + } & Omit< + UseQueryOptions< + { + dbPools: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPoolsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPoolKeys.list(args), queryFn: () => getClient().dbPool.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```ts * const data = await fetchDbPoolsQuery({ @@ -70,7 +97,8 @@ export function useDbPoolsQuery(params: { export async function fetchDbPoolsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPoolSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DbPoolSelect>; }): Promise<{ dbPools: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchDbPoolsQuery(params: { } /** * Warm database pool entries. Rows are inserted as warming (which enqueues a db_pool:warm_database job), become ready once provisioned, and are handed to users via metaschema_private.db_pool_claim (invoked by metaschema_public.request_database). - * + * * @example * ```ts * await prefetchDbPoolsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDbPoolsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPoolSelect>; -}): Promise; -export async function prefetchDbPoolsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchDbPoolsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPoolSelect>; + } +): Promise; +export async function prefetchDbPoolsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: dbPoolKeys.list(args), - queryFn: () => getClient().dbPool.findMany(args).unwrap() + queryFn: () => getClient().dbPool.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDbPresetModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDbPresetModuleQuery.ts index a1c35b7d8d..59540ebc0a 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDbPresetModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDbPresetModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { dbPresetModuleKeys } from "../query-keys"; -import type { DbPresetModuleSelect, DbPresetModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetModuleSelect, DbPresetModuleWithRelations } from "../../orm/input-types"; +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 { dbPresetModuleKeys } from '../query-keys'; +import type { DbPresetModuleSelect, DbPresetModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbPresetModuleSelect, DbPresetModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPresetModuleQueryKey = dbPresetModuleKeys.detail; /** * Query hook for fetching a single DbPresetModule - * + * * @example * ```tsx * const { data, isLoading } = useDbPresetModuleQuery({ @@ -26,38 +26,52 @@ export const dbPresetModuleQueryKey = dbPresetModuleKeys.detail; * }); * ``` */ -export function useDbPresetModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPresetModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPresetModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDbPresetModuleQuery< + S extends DbPresetModuleSelect, + TData = { + dbPresetModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPresetModuleSelect>; + } & Omit< + UseQueryOptions< + { + dbPresetModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPresetModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPresetModuleKeys.detail(params.id), - queryFn: () => getClient().dbPresetModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .dbPresetModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DbPresetModule without React hooks - * + * * @example * ```ts * const data = await fetchDbPresetModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchDbPresetModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().dbPresetModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .dbPresetModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DbPresetModule for SSR or cache warming - * + * * @example * ```ts * await prefetchDbPresetModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDbPresetModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbPresetModuleSelect>; -}): Promise; -export async function prefetchDbPresetModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDbPresetModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbPresetModuleSelect>; + } +): Promise; +export async function prefetchDbPresetModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: dbPresetModuleKeys.detail(params.id), - queryFn: () => getClient().dbPresetModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .dbPresetModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDbPresetModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDbPresetModulesQuery.ts index 973431209a..c1d0f89c95 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDbPresetModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDbPresetModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { dbPresetModuleKeys } from "../query-keys"; -import type { DbPresetModuleSelect, DbPresetModuleWithRelations, DbPresetModuleFilter, DbPresetModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbPresetModuleSelect, DbPresetModuleWithRelations, DbPresetModuleFilter, DbPresetModuleOrderBy } from "../../orm/input-types"; +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 { dbPresetModuleKeys } from '../query-keys'; +import type { + DbPresetModuleSelect, + DbPresetModuleWithRelations, + DbPresetModuleFilter, + DbPresetModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DbPresetModuleSelect, + DbPresetModuleWithRelations, + DbPresetModuleFilter, + DbPresetModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbPresetModulesQueryKey = dbPresetModuleKeys.list; /** * Query hook for fetching DbPresetModule list - * + * * @example * ```tsx * const { data, isLoading } = useDbPresetModulesQuery({ @@ -30,33 +45,53 @@ export const dbPresetModulesQueryKey = dbPresetModuleKeys.list; * }); * ``` */ -export function useDbPresetModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbPresetModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDbPresetModulesQuery< + S extends DbPresetModuleSelect, + TData = { + dbPresetModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetModuleSelect>; + } & Omit< + UseQueryOptions< + { + dbPresetModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbPresetModulesQuery( + params: { + selection: ListSelectionConfig< + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbPresetModuleKeys.list(args), queryFn: () => getClient().dbPresetModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DbPresetModule list without React hooks - * + * * @example * ```ts * const data = await fetchDbPresetModulesQuery({ @@ -70,35 +105,55 @@ export function useDbPresetModulesQuery(params: { export async function fetchDbPresetModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetModuleSelect>; }): Promise<{ dbPresetModules: ConnectionResult>; }>; export async function fetchDbPresetModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy + >(params.selection); return getClient().dbPresetModule.findMany(args).unwrap(); } /** * Prefetch DbPresetModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchDbPresetModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDbPresetModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbPresetModuleSelect>; -}): Promise; -export async function prefetchDbPresetModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDbPresetModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbPresetModuleSelect>; + } +): Promise; +export async function prefetchDbPresetModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: dbPresetModuleKeys.list(args), - queryFn: () => getClient().dbPresetModule.findMany(args).unwrap() + queryFn: () => getClient().dbPresetModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDbUsageModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDbUsageModuleQuery.ts index 52266d8796..74607e73c9 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDbUsageModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDbUsageModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { dbUsageModuleKeys } from "../query-keys"; -import type { DbUsageModuleSelect, DbUsageModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbUsageModuleSelect, DbUsageModuleWithRelations } from "../../orm/input-types"; +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 { dbUsageModuleKeys } from '../query-keys'; +import type { DbUsageModuleSelect, DbUsageModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DbUsageModuleSelect, DbUsageModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbUsageModuleQueryKey = dbUsageModuleKeys.detail; /** * Query hook for fetching a single DbUsageModule - * + * * @example * ```tsx * const { data, isLoading } = useDbUsageModuleQuery({ @@ -26,38 +26,52 @@ export const dbUsageModuleQueryKey = dbUsageModuleKeys.detail; * }); * ``` */ -export function useDbUsageModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbUsageModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbUsageModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDbUsageModuleQuery< + S extends DbUsageModuleSelect, + TData = { + dbUsageModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbUsageModuleSelect>; + } & Omit< + UseQueryOptions< + { + dbUsageModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbUsageModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbUsageModuleKeys.detail(params.id), - queryFn: () => getClient().dbUsageModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .dbUsageModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DbUsageModule without React hooks - * + * * @example * ```ts * const data = await fetchDbUsageModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchDbUsageModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().dbUsageModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .dbUsageModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DbUsageModule for SSR or cache warming - * + * * @example * ```ts * await prefetchDbUsageModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDbUsageModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DbUsageModuleSelect>; -}): Promise; -export async function prefetchDbUsageModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDbUsageModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DbUsageModuleSelect>; + } +): Promise; +export async function prefetchDbUsageModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: dbUsageModuleKeys.detail(params.id), - queryFn: () => getClient().dbUsageModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .dbUsageModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDbUsageModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDbUsageModulesQuery.ts index d191f3f047..b2087477f5 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDbUsageModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDbUsageModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { dbUsageModuleKeys } from "../query-keys"; -import type { DbUsageModuleSelect, DbUsageModuleWithRelations, DbUsageModuleFilter, DbUsageModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DbUsageModuleSelect, DbUsageModuleWithRelations, DbUsageModuleFilter, DbUsageModuleOrderBy } from "../../orm/input-types"; +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 { dbUsageModuleKeys } from '../query-keys'; +import type { + DbUsageModuleSelect, + DbUsageModuleWithRelations, + DbUsageModuleFilter, + DbUsageModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DbUsageModuleSelect, + DbUsageModuleWithRelations, + DbUsageModuleFilter, + DbUsageModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const dbUsageModulesQueryKey = dbUsageModuleKeys.list; /** * Query hook for fetching DbUsageModule list - * + * * @example * ```tsx * const { data, isLoading } = useDbUsageModulesQuery({ @@ -30,33 +45,49 @@ export const dbUsageModulesQueryKey = dbUsageModuleKeys.list; * }); * ``` */ -export function useDbUsageModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbUsageModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDbUsageModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDbUsageModulesQuery< + S extends DbUsageModuleSelect, + TData = { + dbUsageModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbUsageModuleSelect>; + } & Omit< + UseQueryOptions< + { + dbUsageModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDbUsageModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DbUsageModuleSelect, + DbUsageModuleFilter, + DbUsageModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: dbUsageModuleKeys.list(args), queryFn: () => getClient().dbUsageModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DbUsageModule list without React hooks - * + * * @example * ```ts * const data = await fetchDbUsageModulesQuery({ @@ -70,35 +101,51 @@ export function useDbUsageModulesQuery(params: { export async function fetchDbUsageModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DbUsageModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DbUsageModuleSelect>; }): Promise<{ dbUsageModules: ConnectionResult>; }>; export async function fetchDbUsageModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DbUsageModuleSelect, + DbUsageModuleFilter, + DbUsageModuleOrderBy + >(params.selection); return getClient().dbUsageModule.findMany(args).unwrap(); } /** * Prefetch DbUsageModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchDbUsageModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDbUsageModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DbUsageModuleSelect>; -}): Promise; -export async function prefetchDbUsageModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDbUsageModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DbUsageModuleSelect>; + } +): Promise; +export async function prefetchDbUsageModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + DbUsageModuleSelect, + DbUsageModuleFilter, + DbUsageModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: dbUsageModuleKeys.list(args), - queryFn: () => getClient().dbUsageModule.findMany(args).unwrap() + queryFn: () => getClient().dbUsageModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDefaultIdsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDefaultIdsModuleQuery.ts index dd95491e97..bb3a92af73 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDefaultIdsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDefaultIdsModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { defaultIdsModuleKeys } from "../query-keys"; -import type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations } from "../../orm/input-types"; +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 { defaultIdsModuleKeys } from '../query-keys'; +import type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const defaultIdsModuleQueryKey = defaultIdsModuleKeys.detail; /** * Query hook for fetching a single DefaultIdsModule - * + * * @example * ```tsx * const { data, isLoading } = useDefaultIdsModuleQuery({ @@ -26,38 +26,52 @@ export const defaultIdsModuleQueryKey = defaultIdsModuleKeys.detail; * }); * ``` */ -export function useDefaultIdsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DefaultIdsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDefaultIdsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDefaultIdsModuleQuery< + S extends DefaultIdsModuleSelect, + TData = { + defaultIdsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DefaultIdsModuleSelect>; + } & Omit< + UseQueryOptions< + { + defaultIdsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDefaultIdsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: defaultIdsModuleKeys.detail(params.id), - queryFn: () => getClient().defaultIdsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .defaultIdsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DefaultIdsModule without React hooks - * + * * @example * ```ts * const data = await fetchDefaultIdsModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchDefaultIdsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().defaultIdsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .defaultIdsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DefaultIdsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchDefaultIdsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDefaultIdsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DefaultIdsModuleSelect>; -}): Promise; -export async function prefetchDefaultIdsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDefaultIdsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DefaultIdsModuleSelect>; + } +): Promise; +export async function prefetchDefaultIdsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: defaultIdsModuleKeys.detail(params.id), - queryFn: () => getClient().defaultIdsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .defaultIdsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDefaultIdsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDefaultIdsModulesQuery.ts index 1861c1772c..f6c5a25982 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDefaultIdsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDefaultIdsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { defaultIdsModuleKeys } from "../query-keys"; -import type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations, DefaultIdsModuleFilter, DefaultIdsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DefaultIdsModuleSelect, DefaultIdsModuleWithRelations, DefaultIdsModuleFilter, DefaultIdsModuleOrderBy } from "../../orm/input-types"; +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 { defaultIdsModuleKeys } from '../query-keys'; +import type { + DefaultIdsModuleSelect, + DefaultIdsModuleWithRelations, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DefaultIdsModuleSelect, + DefaultIdsModuleWithRelations, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const defaultIdsModulesQueryKey = defaultIdsModuleKeys.list; /** * Query hook for fetching DefaultIdsModule list - * + * * @example * ```tsx * const { data, isLoading } = useDefaultIdsModulesQuery({ @@ -30,33 +45,53 @@ export const defaultIdsModulesQueryKey = defaultIdsModuleKeys.list; * }); * ``` */ -export function useDefaultIdsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DefaultIdsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDefaultIdsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDefaultIdsModulesQuery< + S extends DefaultIdsModuleSelect, + TData = { + defaultIdsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DefaultIdsModuleSelect>; + } & Omit< + UseQueryOptions< + { + defaultIdsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDefaultIdsModulesQuery( + params: { + selection: ListSelectionConfig< + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: defaultIdsModuleKeys.list(args), queryFn: () => getClient().defaultIdsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DefaultIdsModule list without React hooks - * + * * @example * ```ts * const data = await fetchDefaultIdsModulesQuery({ @@ -70,35 +105,59 @@ export function useDefaultIdsModulesQuery(params: { export async function fetchDefaultIdsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DefaultIdsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DefaultIdsModuleSelect>; }): Promise<{ defaultIdsModules: ConnectionResult>; }>; export async function fetchDefaultIdsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy + >(params.selection); return getClient().defaultIdsModule.findMany(args).unwrap(); } /** * Prefetch DefaultIdsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchDefaultIdsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDefaultIdsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DefaultIdsModuleSelect>; -}): Promise; -export async function prefetchDefaultIdsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDefaultIdsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DefaultIdsModuleSelect>; + } +): Promise; +export async function prefetchDefaultIdsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: defaultIdsModuleKeys.list(args), - queryFn: () => getClient().defaultIdsModule.findMany(args).unwrap() + queryFn: () => getClient().defaultIdsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDenormalizedTableFieldQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDenormalizedTableFieldQuery.ts index a76caa2fa6..5ce724eff8 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDenormalizedTableFieldQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDenormalizedTableFieldQuery.ts @@ -4,20 +4,26 @@ * 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 { denormalizedTableFieldKeys } from "../query-keys"; -import type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations } from "../../orm/input-types"; +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 { denormalizedTableFieldKeys } from '../query-keys'; +import type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const denormalizedTableFieldQueryKey = denormalizedTableFieldKeys.detail; /** * Query hook for fetching a single DenormalizedTableField - * + * * @example * ```tsx * const { data, isLoading } = useDenormalizedTableFieldQuery({ @@ -26,38 +32,52 @@ export const denormalizedTableFieldQueryKey = denormalizedTableFieldKeys.detail; * }); * ``` */ -export function useDenormalizedTableFieldQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DenormalizedTableFieldSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDenormalizedTableFieldQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDenormalizedTableFieldQuery< + S extends DenormalizedTableFieldSelect, + TData = { + denormalizedTableField: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DenormalizedTableFieldSelect>; + } & Omit< + UseQueryOptions< + { + denormalizedTableField: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDenormalizedTableFieldQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: denormalizedTableFieldKeys.detail(params.id), - queryFn: () => getClient().denormalizedTableField.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .denormalizedTableField.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DenormalizedTableField without React hooks - * + * * @example * ```ts * const data = await fetchDenormalizedTableFieldQuery({ @@ -66,7 +86,9 @@ export function useDenormalizedTableFieldQuery(params: { * }); * ``` */ -export async function fetchDenormalizedTableFieldQuery(params: { +export async function fetchDenormalizedTableFieldQuery< + S extends DenormalizedTableFieldSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchDenormalizedTableFieldQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().denormalizedTableField.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .denormalizedTableField.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DenormalizedTableField for SSR or cache warming - * + * * @example * ```ts * await prefetchDenormalizedTableFieldQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDenormalizedTableFieldQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DenormalizedTableFieldSelect>; -}): Promise; -export async function prefetchDenormalizedTableFieldQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDenormalizedTableFieldQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DenormalizedTableFieldSelect>; + } +): Promise; +export async function prefetchDenormalizedTableFieldQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: denormalizedTableFieldKeys.detail(params.id), - queryFn: () => getClient().denormalizedTableField.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .denormalizedTableField.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDenormalizedTableFieldsQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDenormalizedTableFieldsQuery.ts index 01ec2312fa..d83bc94873 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDenormalizedTableFieldsQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDenormalizedTableFieldsQuery.ts @@ -4,20 +4,35 @@ * 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 { denormalizedTableFieldKeys } from "../query-keys"; -import type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations, DenormalizedTableFieldFilter, DenormalizedTableFieldOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DenormalizedTableFieldSelect, DenormalizedTableFieldWithRelations, DenormalizedTableFieldFilter, DenormalizedTableFieldOrderBy } from "../../orm/input-types"; +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 { denormalizedTableFieldKeys } from '../query-keys'; +import type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DenormalizedTableFieldSelect, + DenormalizedTableFieldWithRelations, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const denormalizedTableFieldsQueryKey = denormalizedTableFieldKeys.list; /** * Query hook for fetching DenormalizedTableField list - * + * * @example * ```tsx * const { data, isLoading } = useDenormalizedTableFieldsQuery({ @@ -30,33 +45,60 @@ export const denormalizedTableFieldsQueryKey = denormalizedTableFieldKeys.list; * }); * ``` */ -export function useDenormalizedTableFieldsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DenormalizedTableFieldSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDenormalizedTableFieldsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDenormalizedTableFieldsQuery< + S extends DenormalizedTableFieldSelect, + TData = { + denormalizedTableFields: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DenormalizedTableFieldSelect>; + } & Omit< + UseQueryOptions< + { + denormalizedTableFields: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDenormalizedTableFieldsQuery( + params: { + selection: ListSelectionConfig< + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: denormalizedTableFieldKeys.list(args), queryFn: () => getClient().denormalizedTableField.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DenormalizedTableField list without React hooks - * + * * @example * ```ts * const data = await fetchDenormalizedTableFieldsQuery({ @@ -67,38 +109,72 @@ export function useDenormalizedTableFieldsQuery(params: { * }); * ``` */ -export async function fetchDenormalizedTableFieldsQuery(params: { +export async function fetchDenormalizedTableFieldsQuery< + S extends DenormalizedTableFieldSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DenormalizedTableFieldSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DenormalizedTableFieldSelect>; }): Promise<{ - denormalizedTableFields: ConnectionResult>; + denormalizedTableFields: ConnectionResult< + InferSelectResult + >; }>; export async function fetchDenormalizedTableFieldsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy + >(params.selection); return getClient().denormalizedTableField.findMany(args).unwrap(); } /** * Prefetch DenormalizedTableField list for SSR or cache warming - * + * * @example * ```ts * await prefetchDenormalizedTableFieldsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDenormalizedTableFieldsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DenormalizedTableFieldSelect>; -}): Promise; -export async function prefetchDenormalizedTableFieldsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDenormalizedTableFieldsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, DenormalizedTableFieldSelect>; + } +): Promise; +export async function prefetchDenormalizedTableFieldsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: denormalizedTableFieldKeys.list(args), - queryFn: () => getClient().denormalizedTableField.findMany(args).unwrap() + queryFn: () => getClient().denormalizedTableField.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDevicesModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDevicesModuleQuery.ts index aeb903d028..985152afe6 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDevicesModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDevicesModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { devicesModuleKeys } from "../query-keys"; -import type { DevicesModuleSelect, DevicesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DevicesModuleSelect, DevicesModuleWithRelations } from "../../orm/input-types"; +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 { devicesModuleKeys } from '../query-keys'; +import type { DevicesModuleSelect, DevicesModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DevicesModuleSelect, DevicesModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const devicesModuleQueryKey = devicesModuleKeys.detail; /** * Query hook for fetching a single DevicesModule - * + * * @example * ```tsx * const { data, isLoading } = useDevicesModuleQuery({ @@ -26,38 +26,52 @@ export const devicesModuleQueryKey = devicesModuleKeys.detail; * }); * ``` */ -export function useDevicesModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DevicesModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDevicesModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDevicesModuleQuery< + S extends DevicesModuleSelect, + TData = { + devicesModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseQueryOptions< + { + devicesModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDevicesModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: devicesModuleKeys.detail(params.id), - queryFn: () => getClient().devicesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .devicesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DevicesModule without React hooks - * + * * @example * ```ts * const data = await fetchDevicesModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchDevicesModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().devicesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .devicesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DevicesModule for SSR or cache warming - * + * * @example * ```ts * await prefetchDevicesModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDevicesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DevicesModuleSelect>; -}): Promise; -export async function prefetchDevicesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDevicesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DevicesModuleSelect>; + } +): Promise; +export async function prefetchDevicesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: devicesModuleKeys.detail(params.id), - queryFn: () => getClient().devicesModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .devicesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDevicesModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDevicesModulesQuery.ts index df8ded2730..91ea254fae 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDevicesModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDevicesModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { devicesModuleKeys } from "../query-keys"; -import type { DevicesModuleSelect, DevicesModuleWithRelations, DevicesModuleFilter, DevicesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DevicesModuleSelect, DevicesModuleWithRelations, DevicesModuleFilter, DevicesModuleOrderBy } from "../../orm/input-types"; +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 { devicesModuleKeys } from '../query-keys'; +import type { + DevicesModuleSelect, + DevicesModuleWithRelations, + DevicesModuleFilter, + DevicesModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DevicesModuleSelect, + DevicesModuleWithRelations, + DevicesModuleFilter, + DevicesModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const devicesModulesQueryKey = devicesModuleKeys.list; /** * Query hook for fetching DevicesModule list - * + * * @example * ```tsx * const { data, isLoading } = useDevicesModulesQuery({ @@ -30,33 +45,49 @@ export const devicesModulesQueryKey = devicesModuleKeys.list; * }); * ``` */ -export function useDevicesModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DevicesModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDevicesModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDevicesModulesQuery< + S extends DevicesModuleSelect, + TData = { + devicesModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DevicesModuleSelect>; + } & Omit< + UseQueryOptions< + { + devicesModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDevicesModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: devicesModuleKeys.list(args), queryFn: () => getClient().devicesModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DevicesModule list without React hooks - * + * * @example * ```ts * const data = await fetchDevicesModulesQuery({ @@ -70,35 +101,51 @@ export function useDevicesModulesQuery(params: { export async function fetchDevicesModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DevicesModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DevicesModuleSelect>; }): Promise<{ devicesModules: ConnectionResult>; }>; export async function fetchDevicesModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy + >(params.selection); return getClient().devicesModule.findMany(args).unwrap(); } /** * Prefetch DevicesModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchDevicesModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDevicesModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DevicesModuleSelect>; -}): Promise; -export async function prefetchDevicesModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDevicesModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DevicesModuleSelect>; + } +): Promise; +export async function prefetchDevicesModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: devicesModuleKeys.list(args), - queryFn: () => getClient().devicesModule.findMany(args).unwrap() + queryFn: () => getClient().devicesModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDomainModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDomainModuleQuery.ts index cdcc4ee6bb..b7b2de840e 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDomainModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDomainModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { domainModuleKeys } from "../query-keys"; -import type { DomainModuleSelect, DomainModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainModuleSelect, DomainModuleWithRelations } from "../../orm/input-types"; +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 { domainModuleKeys } from '../query-keys'; +import type { DomainModuleSelect, DomainModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { DomainModuleSelect, DomainModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const domainModuleQueryKey = domainModuleKeys.detail; /** * Query hook for fetching a single DomainModule - * + * * @example * ```tsx * const { data, isLoading } = useDomainModuleQuery({ @@ -26,38 +26,52 @@ export const domainModuleQueryKey = domainModuleKeys.detail; * }); * ``` */ -export function useDomainModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DomainModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDomainModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useDomainModuleQuery< + S extends DomainModuleSelect, + TData = { + domainModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DomainModuleSelect>; + } & Omit< + UseQueryOptions< + { + domainModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDomainModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: domainModuleKeys.detail(params.id), - queryFn: () => getClient().domainModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .domainModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single DomainModule without React hooks - * + * * @example * ```ts * const data = await fetchDomainModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchDomainModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().domainModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .domainModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single DomainModule for SSR or cache warming - * + * * @example * ```ts * await prefetchDomainModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchDomainModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, DomainModuleSelect>; -}): Promise; -export async function prefetchDomainModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchDomainModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, DomainModuleSelect>; + } +): Promise; +export async function prefetchDomainModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: domainModuleKeys.detail(params.id), - queryFn: () => getClient().domainModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .domainModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useDomainModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useDomainModulesQuery.ts index 9c8a4b9ee9..93df08003a 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useDomainModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useDomainModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { domainModuleKeys } from "../query-keys"; -import type { DomainModuleSelect, DomainModuleWithRelations, DomainModuleFilter, DomainModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { DomainModuleSelect, DomainModuleWithRelations, DomainModuleFilter, DomainModuleOrderBy } from "../../orm/input-types"; +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 { domainModuleKeys } from '../query-keys'; +import type { + DomainModuleSelect, + DomainModuleWithRelations, + DomainModuleFilter, + DomainModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + DomainModuleSelect, + DomainModuleWithRelations, + DomainModuleFilter, + DomainModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const domainModulesQueryKey = domainModuleKeys.list; /** * Query hook for fetching DomainModule list - * + * * @example * ```tsx * const { data, isLoading } = useDomainModulesQuery({ @@ -30,33 +45,47 @@ export const domainModulesQueryKey = domainModuleKeys.list; * }); * ``` */ -export function useDomainModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useDomainModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useDomainModulesQuery< + S extends DomainModuleSelect, + TData = { + domainModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DomainModuleSelect>; + } & Omit< + UseQueryOptions< + { + domainModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useDomainModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: domainModuleKeys.list(args), queryFn: () => getClient().domainModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch DomainModule list without React hooks - * + * * @example * ```ts * const data = await fetchDomainModulesQuery({ @@ -70,35 +99,47 @@ export function useDomainModulesQuery(params: { export async function fetchDomainModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, DomainModuleSelect>; }): Promise<{ domainModules: ConnectionResult>; }>; export async function fetchDomainModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().domainModule.findMany(args).unwrap(); } /** * Prefetch DomainModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchDomainModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchDomainModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, DomainModuleSelect>; -}): Promise; -export async function prefetchDomainModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchDomainModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, DomainModuleSelect>; + } +): Promise; +export async function prefetchDomainModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: domainModuleKeys.list(args), - queryFn: () => getClient().domainModule.findMany(args).unwrap() + queryFn: () => getClient().domainModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useEmailsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useEmailsModuleQuery.ts index ab2903703e..0364c76dcc 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useEmailsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useEmailsModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { emailsModuleKeys } from "../query-keys"; -import type { EmailsModuleSelect, EmailsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailsModuleSelect, EmailsModuleWithRelations } from "../../orm/input-types"; +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 { emailsModuleKeys } from '../query-keys'; +import type { EmailsModuleSelect, EmailsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EmailsModuleSelect, EmailsModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const emailsModuleQueryKey = emailsModuleKeys.detail; /** * Query hook for fetching a single EmailsModule - * + * * @example * ```tsx * const { data, isLoading } = useEmailsModuleQuery({ @@ -26,38 +26,52 @@ export const emailsModuleQueryKey = emailsModuleKeys.detail; * }); * ``` */ -export function useEmailsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EmailsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEmailsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useEmailsModuleQuery< + S extends EmailsModuleSelect, + TData = { + emailsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EmailsModuleSelect>; + } & Omit< + UseQueryOptions< + { + emailsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEmailsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: emailsModuleKeys.detail(params.id), - queryFn: () => getClient().emailsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .emailsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single EmailsModule without React hooks - * + * * @example * ```ts * const data = await fetchEmailsModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchEmailsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().emailsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .emailsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single EmailsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchEmailsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchEmailsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EmailsModuleSelect>; -}): Promise; -export async function prefetchEmailsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchEmailsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EmailsModuleSelect>; + } +): Promise; +export async function prefetchEmailsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: emailsModuleKeys.detail(params.id), - queryFn: () => getClient().emailsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .emailsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useEmailsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useEmailsModulesQuery.ts index d47183e3bf..d14bbb8d6e 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useEmailsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useEmailsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { emailsModuleKeys } from "../query-keys"; -import type { EmailsModuleSelect, EmailsModuleWithRelations, EmailsModuleFilter, EmailsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { EmailsModuleSelect, EmailsModuleWithRelations, EmailsModuleFilter, EmailsModuleOrderBy } from "../../orm/input-types"; +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 { emailsModuleKeys } from '../query-keys'; +import type { + EmailsModuleSelect, + EmailsModuleWithRelations, + EmailsModuleFilter, + EmailsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + EmailsModuleSelect, + EmailsModuleWithRelations, + EmailsModuleFilter, + EmailsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const emailsModulesQueryKey = emailsModuleKeys.list; /** * Query hook for fetching EmailsModule list - * + * * @example * ```tsx * const { data, isLoading } = useEmailsModulesQuery({ @@ -30,33 +45,47 @@ export const emailsModulesQueryKey = emailsModuleKeys.list; * }); * ``` */ -export function useEmailsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EmailsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEmailsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useEmailsModulesQuery< + S extends EmailsModuleSelect, + TData = { + emailsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EmailsModuleSelect>; + } & Omit< + UseQueryOptions< + { + emailsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEmailsModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: emailsModuleKeys.list(args), queryFn: () => getClient().emailsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch EmailsModule list without React hooks - * + * * @example * ```ts * const data = await fetchEmailsModulesQuery({ @@ -70,35 +99,47 @@ export function useEmailsModulesQuery(params: { export async function fetchEmailsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, EmailsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, EmailsModuleSelect>; }): Promise<{ emailsModules: ConnectionResult>; }>; export async function fetchEmailsModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().emailsModule.findMany(args).unwrap(); } /** * Prefetch EmailsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchEmailsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchEmailsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EmailsModuleSelect>; -}): Promise; -export async function prefetchEmailsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchEmailsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EmailsModuleSelect>; + } +): Promise; +export async function prefetchEmailsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: emailsModuleKeys.list(args), - queryFn: () => getClient().emailsModule.findMany(args).unwrap() + queryFn: () => getClient().emailsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useEntityTypeProvisionQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useEntityTypeProvisionQuery.ts index 39591b62a7..5021910e27 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useEntityTypeProvisionQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useEntityTypeProvisionQuery.ts @@ -11,15 +11,21 @@ * 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 { entityTypeProvisionKeys } from "../query-keys"; -import type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations } from "../../orm/input-types"; +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 { entityTypeProvisionKeys } from '../query-keys'; +import type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const entityTypeProvisionQueryKey = entityTypeProvisionKeys.detail; /** @@ -40,33 +46,47 @@ export const entityTypeProvisionQueryKey = entityTypeProvisionKeys.detail; * }); * ``` */ -export function useEntityTypeProvisionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EntityTypeProvisionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEntityTypeProvisionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useEntityTypeProvisionQuery< + S extends EntityTypeProvisionSelect, + TData = { + entityTypeProvision: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EntityTypeProvisionSelect>; + } & Omit< + UseQueryOptions< + { + entityTypeProvision: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEntityTypeProvisionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: entityTypeProvisionKeys.detail(params.id), - queryFn: () => getClient().entityTypeProvision.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .entityTypeProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** @@ -100,10 +120,12 @@ export async function fetchEntityTypeProvisionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().entityTypeProvision.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .entityTypeProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Provisions a new membership entity type. Each INSERT creates an entity table, registers a membership type, @@ -120,22 +142,31 @@ export async function fetchEntityTypeProvisionQuery(params: { * await prefetchEntityTypeProvisionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchEntityTypeProvisionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EntityTypeProvisionSelect>; -}): Promise; -export async function prefetchEntityTypeProvisionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchEntityTypeProvisionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EntityTypeProvisionSelect>; + } +): Promise; +export async function prefetchEntityTypeProvisionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: entityTypeProvisionKeys.detail(params.id), - queryFn: () => getClient().entityTypeProvision.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .entityTypeProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useEntityTypeProvisionsQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useEntityTypeProvisionsQuery.ts index 2abaf6886f..4c1c2fbba1 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useEntityTypeProvisionsQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useEntityTypeProvisionsQuery.ts @@ -11,15 +11,30 @@ * 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 { entityTypeProvisionKeys } from "../query-keys"; -import type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations, EntityTypeProvisionFilter, EntityTypeProvisionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { EntityTypeProvisionSelect, EntityTypeProvisionWithRelations, EntityTypeProvisionFilter, EntityTypeProvisionOrderBy } from "../../orm/input-types"; +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 { entityTypeProvisionKeys } from '../query-keys'; +import type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + EntityTypeProvisionSelect, + EntityTypeProvisionWithRelations, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const entityTypeProvisionsQueryKey = entityTypeProvisionKeys.list; /** @@ -44,28 +59,53 @@ export const entityTypeProvisionsQueryKey = entityTypeProvisionKeys.list; * }); * ``` */ -export function useEntityTypeProvisionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EntityTypeProvisionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEntityTypeProvisionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useEntityTypeProvisionsQuery< + S extends EntityTypeProvisionSelect, + TData = { + entityTypeProvisions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, EntityTypeProvisionSelect>; + } & Omit< + UseQueryOptions< + { + entityTypeProvisions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEntityTypeProvisionsQuery( + params: { + selection: ListSelectionConfig< + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: entityTypeProvisionKeys.list(args), queryFn: () => getClient().entityTypeProvision.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** @@ -91,14 +131,26 @@ export function useEntityTypeProvisionsQuery(params: { export async function fetchEntityTypeProvisionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, EntityTypeProvisionSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, EntityTypeProvisionSelect>; }): Promise<{ entityTypeProvisions: ConnectionResult>; }>; export async function fetchEntityTypeProvisionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy + >(params.selection); return getClient().entityTypeProvision.findMany(args).unwrap(); } /** @@ -116,17 +168,35 @@ export async function fetchEntityTypeProvisionsQuery(params: { * await prefetchEntityTypeProvisionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchEntityTypeProvisionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EntityTypeProvisionSelect>; -}): Promise; -export async function prefetchEntityTypeProvisionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchEntityTypeProvisionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, EntityTypeProvisionSelect>; + } +): Promise; +export async function prefetchEntityTypeProvisionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: entityTypeProvisionKeys.list(args), - queryFn: () => getClient().entityTypeProvision.findMany(args).unwrap() + queryFn: () => getClient().entityTypeProvision.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useEventsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useEventsModuleQuery.ts index dc20a551d1..0e1c769688 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useEventsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useEventsModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { eventsModuleKeys } from "../query-keys"; -import type { EventsModuleSelect, EventsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { EventsModuleSelect, EventsModuleWithRelations } from "../../orm/input-types"; +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 { eventsModuleKeys } from '../query-keys'; +import type { EventsModuleSelect, EventsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { EventsModuleSelect, EventsModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const eventsModuleQueryKey = eventsModuleKeys.detail; /** * Query hook for fetching a single EventsModule - * + * * @example * ```tsx * const { data, isLoading } = useEventsModuleQuery({ @@ -26,38 +26,52 @@ export const eventsModuleQueryKey = eventsModuleKeys.detail; * }); * ``` */ -export function useEventsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EventsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEventsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useEventsModuleQuery< + S extends EventsModuleSelect, + TData = { + eventsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EventsModuleSelect>; + } & Omit< + UseQueryOptions< + { + eventsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEventsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: eventsModuleKeys.detail(params.id), - queryFn: () => getClient().eventsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .eventsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single EventsModule without React hooks - * + * * @example * ```ts * const data = await fetchEventsModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchEventsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().eventsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .eventsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single EventsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchEventsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchEventsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, EventsModuleSelect>; -}): Promise; -export async function prefetchEventsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchEventsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, EventsModuleSelect>; + } +): Promise; +export async function prefetchEventsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: eventsModuleKeys.detail(params.id), - queryFn: () => getClient().eventsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .eventsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useEventsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useEventsModulesQuery.ts index 7a11ca7313..1d6ad46a40 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useEventsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useEventsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { eventsModuleKeys } from "../query-keys"; -import type { EventsModuleSelect, EventsModuleWithRelations, EventsModuleFilter, EventsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { EventsModuleSelect, EventsModuleWithRelations, EventsModuleFilter, EventsModuleOrderBy } from "../../orm/input-types"; +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 { eventsModuleKeys } from '../query-keys'; +import type { + EventsModuleSelect, + EventsModuleWithRelations, + EventsModuleFilter, + EventsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + EventsModuleSelect, + EventsModuleWithRelations, + EventsModuleFilter, + EventsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const eventsModulesQueryKey = eventsModuleKeys.list; /** * Query hook for fetching EventsModule list - * + * * @example * ```tsx * const { data, isLoading } = useEventsModulesQuery({ @@ -30,33 +45,47 @@ export const eventsModulesQueryKey = eventsModuleKeys.list; * }); * ``` */ -export function useEventsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EventsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useEventsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useEventsModulesQuery< + S extends EventsModuleSelect, + TData = { + eventsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EventsModuleSelect>; + } & Omit< + UseQueryOptions< + { + eventsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useEventsModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: eventsModuleKeys.list(args), queryFn: () => getClient().eventsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch EventsModule list without React hooks - * + * * @example * ```ts * const data = await fetchEventsModulesQuery({ @@ -70,35 +99,47 @@ export function useEventsModulesQuery(params: { export async function fetchEventsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, EventsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, EventsModuleSelect>; }): Promise<{ eventsModules: ConnectionResult>; }>; export async function fetchEventsModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().eventsModule.findMany(args).unwrap(); } /** * Prefetch EventsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchEventsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchEventsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, EventsModuleSelect>; -}): Promise; -export async function prefetchEventsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchEventsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, EventsModuleSelect>; + } +): Promise; +export async function prefetchEventsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: eventsModuleKeys.list(args), - queryFn: () => getClient().eventsModule.findMany(args).unwrap() + queryFn: () => getClient().eventsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModuleQuery.ts index 065daa2e7c..886b76ee94 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModuleQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { functionDeploymentModuleKeys } from "../query-keys"; -import type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionDeploymentModuleQueryKey = functionDeploymentModuleKeys.detail; /** * Query hook for fetching a single FunctionDeploymentModule - * + * * @example * ```tsx * const { data, isLoading } = useFunctionDeploymentModuleQuery({ @@ -26,38 +32,55 @@ export const functionDeploymentModuleQueryKey = functionDeploymentModuleKeys.det * }); * ``` */ -export function useFunctionDeploymentModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionDeploymentModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionDeploymentModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionDeploymentModuleQuery< + S extends FunctionDeploymentModuleSelect, + TData = { + functionDeploymentModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseQueryOptions< + { + functionDeploymentModule: InferSelectResult< + FunctionDeploymentModuleWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionDeploymentModuleKeys.detail(params.id), - queryFn: () => getClient().functionDeploymentModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionDeploymentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single FunctionDeploymentModule without React hooks - * + * * @example * ```ts * const data = await fetchFunctionDeploymentModuleQuery({ @@ -66,7 +89,9 @@ export function useFunctionDeploymentModuleQuery(params: { * }); * ``` */ -export async function fetchFunctionDeploymentModuleQuery(params: { +export async function fetchFunctionDeploymentModuleQuery< + S extends FunctionDeploymentModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +104,48 @@ export async function fetchFunctionDeploymentModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionDeploymentModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionDeploymentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single FunctionDeploymentModule for SSR or cache warming - * + * * @example * ```ts * await prefetchFunctionDeploymentModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionDeploymentModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionDeploymentModuleSelect>; -}): Promise; -export async function prefetchFunctionDeploymentModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionDeploymentModuleQuery< + S extends FunctionDeploymentModuleSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionDeploymentModuleKeys.detail(params.id), - queryFn: () => getClient().functionDeploymentModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionDeploymentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModulesQuery.ts index ad09ca6c04..742a7f6966 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModulesQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { functionDeploymentModuleKeys } from "../query-keys"; -import type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations, FunctionDeploymentModuleFilter, FunctionDeploymentModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionDeploymentModuleSelect, FunctionDeploymentModuleWithRelations, FunctionDeploymentModuleFilter, FunctionDeploymentModuleOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionDeploymentModulesQueryKey = functionDeploymentModuleKeys.list; /** * Query hook for fetching FunctionDeploymentModule list - * + * * @example * ```tsx * const { data, isLoading } = useFunctionDeploymentModulesQuery({ @@ -30,33 +45,60 @@ export const functionDeploymentModulesQueryKey = functionDeploymentModuleKeys.li * }); * ``` */ -export function useFunctionDeploymentModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionDeploymentModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionDeploymentModulesQuery< + S extends FunctionDeploymentModuleSelect, + TData = { + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseQueryOptions< + { + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentModulesQuery( + params: { + selection: ListSelectionConfig< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionDeploymentModuleKeys.list(args), queryFn: () => getClient().functionDeploymentModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch FunctionDeploymentModule list without React hooks - * + * * @example * ```ts * const data = await fetchFunctionDeploymentModulesQuery({ @@ -67,38 +109,74 @@ export function useFunctionDeploymentModulesQuery(params: { * }); * ``` */ -export async function fetchFunctionDeploymentModulesQuery(params: { +export async function fetchFunctionDeploymentModulesQuery< + S extends FunctionDeploymentModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentModuleSelect>; }): Promise<{ - functionDeploymentModules: ConnectionResult>; + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchFunctionDeploymentModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >(params.selection); return getClient().functionDeploymentModule.findMany(args).unwrap(); } /** * Prefetch FunctionDeploymentModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchFunctionDeploymentModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionDeploymentModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionDeploymentModuleSelect>; -}): Promise; -export async function prefetchFunctionDeploymentModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionDeploymentModulesQuery< + S extends FunctionDeploymentModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentModuleSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionDeploymentModuleKeys.list(args), - queryFn: () => getClient().functionDeploymentModule.findMany(args).unwrap() + queryFn: () => getClient().functionDeploymentModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useFunctionInvocationModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useFunctionInvocationModuleQuery.ts index 196698694f..2a62514f4d 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useFunctionInvocationModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useFunctionInvocationModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { functionInvocationModuleKeys } from "../query-keys"; -import type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations } from "../../orm/input-types"; +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 { functionInvocationModuleKeys } from '../query-keys'; +import type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionInvocationModuleQueryKey = functionInvocationModuleKeys.detail; /** * Query hook for fetching a single FunctionInvocationModule - * + * * @example * ```tsx * const { data, isLoading } = useFunctionInvocationModuleQuery({ @@ -26,38 +32,55 @@ export const functionInvocationModuleQueryKey = functionInvocationModuleKeys.det * }); * ``` */ -export function useFunctionInvocationModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionInvocationModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionInvocationModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionInvocationModuleQuery< + S extends FunctionInvocationModuleSelect, + TData = { + functionInvocationModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationModuleSelect>; + } & Omit< + UseQueryOptions< + { + functionInvocationModule: InferSelectResult< + FunctionInvocationModuleWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionInvocationModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionInvocationModuleKeys.detail(params.id), - queryFn: () => getClient().functionInvocationModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionInvocationModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single FunctionInvocationModule without React hooks - * + * * @example * ```ts * const data = await fetchFunctionInvocationModuleQuery({ @@ -66,7 +89,9 @@ export function useFunctionInvocationModuleQuery(params: { * }); * ``` */ -export async function fetchFunctionInvocationModuleQuery(params: { +export async function fetchFunctionInvocationModuleQuery< + S extends FunctionInvocationModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +104,48 @@ export async function fetchFunctionInvocationModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionInvocationModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionInvocationModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single FunctionInvocationModule for SSR or cache warming - * + * * @example * ```ts * await prefetchFunctionInvocationModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionInvocationModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionInvocationModuleSelect>; -}): Promise; -export async function prefetchFunctionInvocationModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionInvocationModuleQuery< + S extends FunctionInvocationModuleSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationModuleSelect>; + } +): Promise; +export async function prefetchFunctionInvocationModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionInvocationModuleKeys.detail(params.id), - queryFn: () => getClient().functionInvocationModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionInvocationModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useFunctionInvocationModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useFunctionInvocationModulesQuery.ts index df6f126067..b68571abce 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useFunctionInvocationModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useFunctionInvocationModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { functionInvocationModuleKeys } from "../query-keys"; -import type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations, FunctionInvocationModuleFilter, FunctionInvocationModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionInvocationModuleSelect, FunctionInvocationModuleWithRelations, FunctionInvocationModuleFilter, FunctionInvocationModuleOrderBy } from "../../orm/input-types"; +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 { functionInvocationModuleKeys } from '../query-keys'; +import type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionInvocationModuleSelect, + FunctionInvocationModuleWithRelations, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionInvocationModulesQueryKey = functionInvocationModuleKeys.list; /** * Query hook for fetching FunctionInvocationModule list - * + * * @example * ```tsx * const { data, isLoading } = useFunctionInvocationModulesQuery({ @@ -30,33 +45,60 @@ export const functionInvocationModulesQueryKey = functionInvocationModuleKeys.li * }); * ``` */ -export function useFunctionInvocationModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionInvocationModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionInvocationModulesQuery< + S extends FunctionInvocationModuleSelect, + TData = { + functionInvocationModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationModuleSelect>; + } & Omit< + UseQueryOptions< + { + functionInvocationModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionInvocationModulesQuery( + params: { + selection: ListSelectionConfig< + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionInvocationModuleKeys.list(args), queryFn: () => getClient().functionInvocationModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch FunctionInvocationModule list without React hooks - * + * * @example * ```ts * const data = await fetchFunctionInvocationModulesQuery({ @@ -67,38 +109,74 @@ export function useFunctionInvocationModulesQuery(params: { * }); * ``` */ -export async function fetchFunctionInvocationModulesQuery(params: { +export async function fetchFunctionInvocationModulesQuery< + S extends FunctionInvocationModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationModuleSelect>; }): Promise<{ - functionInvocationModules: ConnectionResult>; + functionInvocationModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchFunctionInvocationModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy + >(params.selection); return getClient().functionInvocationModule.findMany(args).unwrap(); } /** * Prefetch FunctionInvocationModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchFunctionInvocationModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionInvocationModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionInvocationModuleSelect>; -}): Promise; -export async function prefetchFunctionInvocationModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionInvocationModulesQuery< + S extends FunctionInvocationModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationModuleSelect>; + } +): Promise; +export async function prefetchFunctionInvocationModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionInvocationModuleKeys.list(args), - queryFn: () => getClient().functionInvocationModule.findMany(args).unwrap() + queryFn: () => getClient().functionInvocationModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useFunctionModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useFunctionModuleQuery.ts index dbb7b43a60..eb23fca61f 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useFunctionModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useFunctionModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { functionModuleKeys } from "../query-keys"; -import type { FunctionModuleSelect, FunctionModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionModuleSelect, FunctionModuleWithRelations } from "../../orm/input-types"; +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 { functionModuleKeys } from '../query-keys'; +import type { FunctionModuleSelect, FunctionModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionModuleSelect, FunctionModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionModuleQueryKey = functionModuleKeys.detail; /** * Query hook for fetching a single FunctionModule - * + * * @example * ```tsx * const { data, isLoading } = useFunctionModuleQuery({ @@ -26,38 +26,52 @@ export const functionModuleQueryKey = functionModuleKeys.detail; * }); * ``` */ -export function useFunctionModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useFunctionModuleQuery< + S extends FunctionModuleSelect, + TData = { + functionModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionModuleSelect>; + } & Omit< + UseQueryOptions< + { + functionModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionModuleKeys.detail(params.id), - queryFn: () => getClient().functionModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .functionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single FunctionModule without React hooks - * + * * @example * ```ts * const data = await fetchFunctionModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchFunctionModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().functionModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .functionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single FunctionModule for SSR or cache warming - * + * * @example * ```ts * await prefetchFunctionModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchFunctionModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, FunctionModuleSelect>; -}): Promise; -export async function prefetchFunctionModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchFunctionModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionModuleSelect>; + } +): Promise; +export async function prefetchFunctionModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: functionModuleKeys.detail(params.id), - queryFn: () => getClient().functionModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .functionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useFunctionModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useFunctionModulesQuery.ts index 7bde7d5e75..cf59b2a31e 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useFunctionModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useFunctionModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { functionModuleKeys } from "../query-keys"; -import type { FunctionModuleSelect, FunctionModuleWithRelations, FunctionModuleFilter, FunctionModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { FunctionModuleSelect, FunctionModuleWithRelations, FunctionModuleFilter, FunctionModuleOrderBy } from "../../orm/input-types"; +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 { functionModuleKeys } from '../query-keys'; +import type { + FunctionModuleSelect, + FunctionModuleWithRelations, + FunctionModuleFilter, + FunctionModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionModuleSelect, + FunctionModuleWithRelations, + FunctionModuleFilter, + FunctionModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionModulesQueryKey = functionModuleKeys.list; /** * Query hook for fetching FunctionModule list - * + * * @example * ```tsx * const { data, isLoading } = useFunctionModulesQuery({ @@ -30,33 +45,53 @@ export const functionModulesQueryKey = functionModuleKeys.list; * }); * ``` */ -export function useFunctionModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useFunctionModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useFunctionModulesQuery< + S extends FunctionModuleSelect, + TData = { + functionModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionModuleSelect>; + } & Omit< + UseQueryOptions< + { + functionModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionModulesQuery( + params: { + selection: ListSelectionConfig< + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionModuleKeys.list(args), queryFn: () => getClient().functionModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch FunctionModule list without React hooks - * + * * @example * ```ts * const data = await fetchFunctionModulesQuery({ @@ -70,35 +105,55 @@ export function useFunctionModulesQuery(params: { export async function fetchFunctionModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, FunctionModuleSelect>; }): Promise<{ functionModules: ConnectionResult>; }>; export async function fetchFunctionModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy + >(params.selection); return getClient().functionModule.findMany(args).unwrap(); } /** * Prefetch FunctionModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchFunctionModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchFunctionModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, FunctionModuleSelect>; -}): Promise; -export async function prefetchFunctionModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchFunctionModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionModuleSelect>; + } +): Promise; +export async function prefetchFunctionModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: functionModuleKeys.list(args), - queryFn: () => getClient().functionModule.findMany(args).unwrap() + queryFn: () => getClient().functionModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModuleQuery.ts index 4950fca793..8bf3b48ff1 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModuleQuery.ts @@ -4,20 +4,26 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { graphExecutionModuleKeys } from "../query-keys"; -import type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const graphExecutionModuleQueryKey = graphExecutionModuleKeys.detail; /** * Query hook for fetching a single GraphExecutionModule - * + * * @example * ```tsx * const { data, isLoading } = useGraphExecutionModuleQuery({ @@ -26,38 +32,52 @@ export const graphExecutionModuleQueryKey = graphExecutionModuleKeys.detail; * }); * ``` */ -export function useGraphExecutionModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, GraphExecutionModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useGraphExecutionModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useGraphExecutionModuleQuery< + S extends GraphExecutionModuleSelect, + TData = { + graphExecutionModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseQueryOptions< + { + graphExecutionModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGraphExecutionModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: graphExecutionModuleKeys.detail(params.id), - queryFn: () => getClient().graphExecutionModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .graphExecutionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single GraphExecutionModule without React hooks - * + * * @example * ```ts * const data = await fetchGraphExecutionModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchGraphExecutionModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().graphExecutionModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .graphExecutionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single GraphExecutionModule for SSR or cache warming - * + * * @example * ```ts * await prefetchGraphExecutionModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchGraphExecutionModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, GraphExecutionModuleSelect>; -}): Promise; -export async function prefetchGraphExecutionModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchGraphExecutionModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } +): Promise; +export async function prefetchGraphExecutionModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: graphExecutionModuleKeys.detail(params.id), - queryFn: () => getClient().graphExecutionModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .graphExecutionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModulesQuery.ts index a7eb6c266a..a78a2242ff 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModulesQuery.ts @@ -4,20 +4,35 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildListSelectionArgs } from "../selection"; -import type { ListSelectionConfig } from "../selection"; -import { graphExecutionModuleKeys } from "../query-keys"; -import type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations, GraphExecutionModuleFilter, GraphExecutionModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphExecutionModuleSelect, GraphExecutionModuleWithRelations, GraphExecutionModuleFilter, GraphExecutionModuleOrderBy } from "../../orm/input-types"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const graphExecutionModulesQueryKey = graphExecutionModuleKeys.list; /** * Query hook for fetching GraphExecutionModule list - * + * * @example * ```tsx * const { data, isLoading } = useGraphExecutionModulesQuery({ @@ -30,33 +45,60 @@ export const graphExecutionModulesQueryKey = graphExecutionModuleKeys.list; * }); * ``` */ -export function useGraphExecutionModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, GraphExecutionModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useGraphExecutionModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useGraphExecutionModulesQuery< + S extends GraphExecutionModuleSelect, + TData = { + graphExecutionModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseQueryOptions< + { + graphExecutionModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGraphExecutionModulesQuery( + params: { + selection: ListSelectionConfig< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: graphExecutionModuleKeys.list(args), queryFn: () => getClient().graphExecutionModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch GraphExecutionModule list without React hooks - * + * * @example * ```ts * const data = await fetchGraphExecutionModulesQuery({ @@ -67,38 +109,70 @@ export function useGraphExecutionModulesQuery(params: { * }); * ``` */ -export async function fetchGraphExecutionModulesQuery(params: { +export async function fetchGraphExecutionModulesQuery< + S extends GraphExecutionModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GraphExecutionModuleSelect>; }): Promise<{ graphExecutionModules: ConnectionResult>; }>; export async function fetchGraphExecutionModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >(params.selection); return getClient().graphExecutionModule.findMany(args).unwrap(); } /** * Prefetch GraphExecutionModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchGraphExecutionModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchGraphExecutionModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, GraphExecutionModuleSelect>; -}): Promise; -export async function prefetchGraphExecutionModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchGraphExecutionModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GraphExecutionModuleSelect>; + } +): Promise; +export async function prefetchGraphExecutionModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: graphExecutionModuleKeys.list(args), - queryFn: () => getClient().graphExecutionModule.findMany(args).unwrap() + queryFn: () => getClient().graphExecutionModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useGraphModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useGraphModuleQuery.ts index 8091d8d7be..c1b1586ea9 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useGraphModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useGraphModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { graphModuleKeys } from "../query-keys"; -import type { GraphModuleSelect, GraphModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphModuleSelect, GraphModuleWithRelations } from "../../orm/input-types"; +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 { graphModuleKeys } from '../query-keys'; +import type { GraphModuleSelect, GraphModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { GraphModuleSelect, GraphModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const graphModuleQueryKey = graphModuleKeys.detail; /** * Query hook for fetching a single GraphModule - * + * * @example * ```tsx * const { data, isLoading } = useGraphModuleQuery({ @@ -26,38 +26,52 @@ export const graphModuleQueryKey = graphModuleKeys.detail; * }); * ``` */ -export function useGraphModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, GraphModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useGraphModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useGraphModuleQuery< + S extends GraphModuleSelect, + TData = { + graphModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, GraphModuleSelect>; + } & Omit< + UseQueryOptions< + { + graphModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGraphModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: graphModuleKeys.detail(params.id), - queryFn: () => getClient().graphModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .graphModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single GraphModule without React hooks - * + * * @example * ```ts * const data = await fetchGraphModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchGraphModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().graphModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .graphModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single GraphModule for SSR or cache warming - * + * * @example * ```ts * await prefetchGraphModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchGraphModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, GraphModuleSelect>; -}): Promise; -export async function prefetchGraphModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchGraphModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, GraphModuleSelect>; + } +): Promise; +export async function prefetchGraphModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: graphModuleKeys.detail(params.id), - queryFn: () => getClient().graphModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .graphModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useGraphModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useGraphModulesQuery.ts index 15beecda74..696bd6167f 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useGraphModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useGraphModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { graphModuleKeys } from "../query-keys"; -import type { GraphModuleSelect, GraphModuleWithRelations, GraphModuleFilter, GraphModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { GraphModuleSelect, GraphModuleWithRelations, GraphModuleFilter, GraphModuleOrderBy } from "../../orm/input-types"; +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 { graphModuleKeys } from '../query-keys'; +import type { + GraphModuleSelect, + GraphModuleWithRelations, + GraphModuleFilter, + GraphModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + GraphModuleSelect, + GraphModuleWithRelations, + GraphModuleFilter, + GraphModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const graphModulesQueryKey = graphModuleKeys.list; /** * Query hook for fetching GraphModule list - * + * * @example * ```tsx * const { data, isLoading } = useGraphModulesQuery({ @@ -30,33 +45,47 @@ export const graphModulesQueryKey = graphModuleKeys.list; * }); * ``` */ -export function useGraphModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, GraphModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useGraphModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useGraphModulesQuery< + S extends GraphModuleSelect, + TData = { + graphModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, GraphModuleSelect>; + } & Omit< + UseQueryOptions< + { + graphModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGraphModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: graphModuleKeys.list(args), queryFn: () => getClient().graphModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch GraphModule list without React hooks - * + * * @example * ```ts * const data = await fetchGraphModulesQuery({ @@ -70,35 +99,47 @@ export function useGraphModulesQuery(params: { export async function fetchGraphModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, GraphModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, GraphModuleSelect>; }): Promise<{ graphModules: ConnectionResult>; }>; export async function fetchGraphModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().graphModule.findMany(args).unwrap(); } /** * Prefetch GraphModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchGraphModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchGraphModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, GraphModuleSelect>; -}): Promise; -export async function prefetchGraphModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchGraphModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, GraphModuleSelect>; + } +): Promise; +export async function prefetchGraphModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: graphModuleKeys.list(args), - queryFn: () => getClient().graphModule.findMany(args).unwrap() + queryFn: () => getClient().graphModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useHierarchyModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useHierarchyModuleQuery.ts index 8be787a603..40a523ade1 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useHierarchyModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useHierarchyModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { hierarchyModuleKeys } from "../query-keys"; -import type { HierarchyModuleSelect, HierarchyModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HierarchyModuleSelect, HierarchyModuleWithRelations } from "../../orm/input-types"; +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 { hierarchyModuleKeys } from '../query-keys'; +import type { HierarchyModuleSelect, HierarchyModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { HierarchyModuleSelect, HierarchyModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const hierarchyModuleQueryKey = hierarchyModuleKeys.detail; /** * Query hook for fetching a single HierarchyModule - * + * * @example * ```tsx * const { data, isLoading } = useHierarchyModuleQuery({ @@ -26,38 +26,52 @@ export const hierarchyModuleQueryKey = hierarchyModuleKeys.detail; * }); * ``` */ -export function useHierarchyModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, HierarchyModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useHierarchyModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useHierarchyModuleQuery< + S extends HierarchyModuleSelect, + TData = { + hierarchyModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, HierarchyModuleSelect>; + } & Omit< + UseQueryOptions< + { + hierarchyModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useHierarchyModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: hierarchyModuleKeys.detail(params.id), - queryFn: () => getClient().hierarchyModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .hierarchyModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single HierarchyModule without React hooks - * + * * @example * ```ts * const data = await fetchHierarchyModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchHierarchyModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().hierarchyModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .hierarchyModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single HierarchyModule for SSR or cache warming - * + * * @example * ```ts * await prefetchHierarchyModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchHierarchyModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, HierarchyModuleSelect>; -}): Promise; -export async function prefetchHierarchyModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchHierarchyModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, HierarchyModuleSelect>; + } +): Promise; +export async function prefetchHierarchyModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: hierarchyModuleKeys.detail(params.id), - queryFn: () => getClient().hierarchyModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .hierarchyModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useHierarchyModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useHierarchyModulesQuery.ts index bc3dab474d..48939bd78c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useHierarchyModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useHierarchyModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { hierarchyModuleKeys } from "../query-keys"; -import type { HierarchyModuleSelect, HierarchyModuleWithRelations, HierarchyModuleFilter, HierarchyModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { HierarchyModuleSelect, HierarchyModuleWithRelations, HierarchyModuleFilter, HierarchyModuleOrderBy } from "../../orm/input-types"; +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 { hierarchyModuleKeys } from '../query-keys'; +import type { + HierarchyModuleSelect, + HierarchyModuleWithRelations, + HierarchyModuleFilter, + HierarchyModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + HierarchyModuleSelect, + HierarchyModuleWithRelations, + HierarchyModuleFilter, + HierarchyModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const hierarchyModulesQueryKey = hierarchyModuleKeys.list; /** * Query hook for fetching HierarchyModule list - * + * * @example * ```tsx * const { data, isLoading } = useHierarchyModulesQuery({ @@ -30,33 +45,53 @@ export const hierarchyModulesQueryKey = hierarchyModuleKeys.list; * }); * ``` */ -export function useHierarchyModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, HierarchyModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useHierarchyModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useHierarchyModulesQuery< + S extends HierarchyModuleSelect, + TData = { + hierarchyModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, HierarchyModuleSelect>; + } & Omit< + UseQueryOptions< + { + hierarchyModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useHierarchyModulesQuery( + params: { + selection: ListSelectionConfig< + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: hierarchyModuleKeys.list(args), queryFn: () => getClient().hierarchyModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch HierarchyModule list without React hooks - * + * * @example * ```ts * const data = await fetchHierarchyModulesQuery({ @@ -70,35 +105,59 @@ export function useHierarchyModulesQuery(params: { export async function fetchHierarchyModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, HierarchyModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, HierarchyModuleSelect>; }): Promise<{ hierarchyModules: ConnectionResult>; }>; export async function fetchHierarchyModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy + >(params.selection); return getClient().hierarchyModule.findMany(args).unwrap(); } /** * Prefetch HierarchyModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchHierarchyModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchHierarchyModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, HierarchyModuleSelect>; -}): Promise; -export async function prefetchHierarchyModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchHierarchyModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, HierarchyModuleSelect>; + } +): Promise; +export async function prefetchHierarchyModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: hierarchyModuleKeys.list(args), - queryFn: () => getClient().hierarchyModule.findMany(args).unwrap() + queryFn: () => getClient().hierarchyModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useHttpRouteModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useHttpRouteModuleQuery.ts index f34480c1a4..d4efc2e335 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useHttpRouteModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useHttpRouteModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { httpRouteModuleKeys } from "../query-keys"; -import type { HttpRouteModuleSelect, HttpRouteModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteModuleSelect, HttpRouteModuleWithRelations } from "../../orm/input-types"; +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 { httpRouteModuleKeys } from '../query-keys'; +import type { HttpRouteModuleSelect, HttpRouteModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { HttpRouteModuleSelect, HttpRouteModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const httpRouteModuleQueryKey = httpRouteModuleKeys.detail; /** * Query hook for fetching a single HttpRouteModule - * + * * @example * ```tsx * const { data, isLoading } = useHttpRouteModuleQuery({ @@ -26,38 +26,52 @@ export const httpRouteModuleQueryKey = httpRouteModuleKeys.detail; * }); * ``` */ -export function useHttpRouteModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, HttpRouteModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useHttpRouteModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useHttpRouteModuleQuery< + S extends HttpRouteModuleSelect, + TData = { + httpRouteModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, HttpRouteModuleSelect>; + } & Omit< + UseQueryOptions< + { + httpRouteModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useHttpRouteModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: httpRouteModuleKeys.detail(params.id), - queryFn: () => getClient().httpRouteModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .httpRouteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single HttpRouteModule without React hooks - * + * * @example * ```ts * const data = await fetchHttpRouteModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchHttpRouteModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().httpRouteModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .httpRouteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single HttpRouteModule for SSR or cache warming - * + * * @example * ```ts * await prefetchHttpRouteModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchHttpRouteModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, HttpRouteModuleSelect>; -}): Promise; -export async function prefetchHttpRouteModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchHttpRouteModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, HttpRouteModuleSelect>; + } +): Promise; +export async function prefetchHttpRouteModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: httpRouteModuleKeys.detail(params.id), - queryFn: () => getClient().httpRouteModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .httpRouteModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useHttpRouteModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useHttpRouteModulesQuery.ts index b48ca3ef9c..62ba55efa7 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useHttpRouteModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useHttpRouteModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { httpRouteModuleKeys } from "../query-keys"; -import type { HttpRouteModuleSelect, HttpRouteModuleWithRelations, HttpRouteModuleFilter, HttpRouteModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { HttpRouteModuleSelect, HttpRouteModuleWithRelations, HttpRouteModuleFilter, HttpRouteModuleOrderBy } from "../../orm/input-types"; +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 { httpRouteModuleKeys } from '../query-keys'; +import type { + HttpRouteModuleSelect, + HttpRouteModuleWithRelations, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + HttpRouteModuleSelect, + HttpRouteModuleWithRelations, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const httpRouteModulesQueryKey = httpRouteModuleKeys.list; /** * Query hook for fetching HttpRouteModule list - * + * * @example * ```tsx * const { data, isLoading } = useHttpRouteModulesQuery({ @@ -30,33 +45,53 @@ export const httpRouteModulesQueryKey = httpRouteModuleKeys.list; * }); * ``` */ -export function useHttpRouteModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, HttpRouteModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useHttpRouteModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useHttpRouteModulesQuery< + S extends HttpRouteModuleSelect, + TData = { + httpRouteModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, HttpRouteModuleSelect>; + } & Omit< + UseQueryOptions< + { + httpRouteModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useHttpRouteModulesQuery( + params: { + selection: ListSelectionConfig< + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: httpRouteModuleKeys.list(args), queryFn: () => getClient().httpRouteModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch HttpRouteModule list without React hooks - * + * * @example * ```ts * const data = await fetchHttpRouteModulesQuery({ @@ -70,35 +105,59 @@ export function useHttpRouteModulesQuery(params: { export async function fetchHttpRouteModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, HttpRouteModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, HttpRouteModuleSelect>; }): Promise<{ httpRouteModules: ConnectionResult>; }>; export async function fetchHttpRouteModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy + >(params.selection); return getClient().httpRouteModule.findMany(args).unwrap(); } /** * Prefetch HttpRouteModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchHttpRouteModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchHttpRouteModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, HttpRouteModuleSelect>; -}): Promise; -export async function prefetchHttpRouteModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchHttpRouteModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, HttpRouteModuleSelect>; + } +): Promise; +export async function prefetchHttpRouteModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: httpRouteModuleKeys.list(args), - queryFn: () => getClient().httpRouteModule.findMany(args).unwrap() + queryFn: () => getClient().httpRouteModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useI18NModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useI18NModuleQuery.ts index 7dccc17f0e..6a10a0a801 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useI18NModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useI18NModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { i18NModuleKeys } from "../query-keys"; -import type { I18NModuleSelect, I18NModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { I18NModuleSelect, I18NModuleWithRelations } from "../../orm/input-types"; +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 { i18NModuleKeys } from '../query-keys'; +import type { I18NModuleSelect, I18NModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { I18NModuleSelect, I18NModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const i18NModuleQueryKey = i18NModuleKeys.detail; /** * Query hook for fetching a single I18NModule - * + * * @example * ```tsx * const { data, isLoading } = useI18NModuleQuery({ @@ -26,38 +26,52 @@ export const i18NModuleQueryKey = i18NModuleKeys.detail; * }); * ``` */ -export function useI18NModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, I18NModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useI18NModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useI18NModuleQuery< + S extends I18NModuleSelect, + TData = { + i18NModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, I18NModuleSelect>; + } & Omit< + UseQueryOptions< + { + i18NModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useI18NModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: i18NModuleKeys.detail(params.id), - queryFn: () => getClient().i18NModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .i18NModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single I18NModule without React hooks - * + * * @example * ```ts * const data = await fetchI18NModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchI18NModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().i18NModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .i18NModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single I18NModule for SSR or cache warming - * + * * @example * ```ts * await prefetchI18NModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchI18NModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, I18NModuleSelect>; -}): Promise; -export async function prefetchI18NModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchI18NModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, I18NModuleSelect>; + } +): Promise; +export async function prefetchI18NModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: i18NModuleKeys.detail(params.id), - queryFn: () => getClient().i18NModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .i18NModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useI18nModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useI18nModulesQuery.ts index 4daf22b833..4dc65e8ab4 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useI18nModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useI18nModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { i18NModuleKeys } from "../query-keys"; -import type { I18NModuleSelect, I18NModuleWithRelations, I18NModuleFilter, I18NModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { I18NModuleSelect, I18NModuleWithRelations, I18NModuleFilter, I18NModuleOrderBy } from "../../orm/input-types"; +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 { i18NModuleKeys } from '../query-keys'; +import type { + I18NModuleSelect, + I18NModuleWithRelations, + I18NModuleFilter, + I18NModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + I18NModuleSelect, + I18NModuleWithRelations, + I18NModuleFilter, + I18NModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const i18nModulesQueryKey = i18NModuleKeys.list; /** * Query hook for fetching I18NModule list - * + * * @example * ```tsx * const { data, isLoading } = useI18nModulesQuery({ @@ -30,33 +45,47 @@ export const i18nModulesQueryKey = i18NModuleKeys.list; * }); * ``` */ -export function useI18nModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, I18NModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useI18nModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useI18nModulesQuery< + S extends I18NModuleSelect, + TData = { + i18nModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, I18NModuleSelect>; + } & Omit< + UseQueryOptions< + { + i18nModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useI18nModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: i18NModuleKeys.list(args), queryFn: () => getClient().i18NModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch I18NModule list without React hooks - * + * * @example * ```ts * const data = await fetchI18nModulesQuery({ @@ -70,35 +99,47 @@ export function useI18nModulesQuery(params: { export async function fetchI18nModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, I18NModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, I18NModuleSelect>; }): Promise<{ i18nModules: ConnectionResult>; }>; export async function fetchI18nModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().i18NModule.findMany(args).unwrap(); } /** * Prefetch I18NModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchI18nModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchI18nModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, I18NModuleSelect>; -}): Promise; -export async function prefetchI18nModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchI18nModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, I18NModuleSelect>; + } +): Promise; +export async function prefetchI18nModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: i18NModuleKeys.list(args), - queryFn: () => getClient().i18NModule.findMany(args).unwrap() + queryFn: () => getClient().i18NModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useIdentityProvidersModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useIdentityProvidersModuleQuery.ts index 208ca210ee..637315cbe4 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useIdentityProvidersModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useIdentityProvidersModuleQuery.ts @@ -12,15 +12,21 @@ * 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 { identityProvidersModuleKeys } from "../query-keys"; -import type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations } from "../../orm/input-types"; +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 { identityProvidersModuleKeys } from '../query-keys'; +import type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const identityProvidersModuleQueryKey = identityProvidersModuleKeys.detail; /** @@ -42,33 +48,47 @@ export const identityProvidersModuleQueryKey = identityProvidersModuleKeys.detai * }); * ``` */ -export function useIdentityProvidersModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, IdentityProvidersModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIdentityProvidersModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useIdentityProvidersModuleQuery< + S extends IdentityProvidersModuleSelect, + TData = { + identityProvidersModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, IdentityProvidersModuleSelect>; + } & Omit< + UseQueryOptions< + { + identityProvidersModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIdentityProvidersModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: identityProvidersModuleKeys.detail(params.id), - queryFn: () => getClient().identityProvidersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .identityProvidersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** @@ -90,7 +110,9 @@ export function useIdentityProvidersModuleQuery(params: { * }); * ``` */ -export async function fetchIdentityProvidersModuleQuery(params: { +export async function fetchIdentityProvidersModuleQuery< + S extends IdentityProvidersModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -103,10 +125,12 @@ export async function fetchIdentityProvidersModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().identityProvidersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .identityProvidersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Entity-aware config row for the identity_providers_module, which provisions a per-database @@ -124,22 +148,31 @@ export async function fetchIdentityProvidersModuleQuery(params: { * await prefetchIdentityProvidersModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchIdentityProvidersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, IdentityProvidersModuleSelect>; -}): Promise; -export async function prefetchIdentityProvidersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchIdentityProvidersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, IdentityProvidersModuleSelect>; + } +): Promise; +export async function prefetchIdentityProvidersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: identityProvidersModuleKeys.detail(params.id), - queryFn: () => getClient().identityProvidersModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .identityProvidersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useIdentityProvidersModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useIdentityProvidersModulesQuery.ts index 2e79a5fd9d..f29b82921f 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useIdentityProvidersModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useIdentityProvidersModulesQuery.ts @@ -12,15 +12,30 @@ * 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 { identityProvidersModuleKeys } from "../query-keys"; -import type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations, IdentityProvidersModuleFilter, IdentityProvidersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { IdentityProvidersModuleSelect, IdentityProvidersModuleWithRelations, IdentityProvidersModuleFilter, IdentityProvidersModuleOrderBy } from "../../orm/input-types"; +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 { identityProvidersModuleKeys } from '../query-keys'; +import type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + IdentityProvidersModuleSelect, + IdentityProvidersModuleWithRelations, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const identityProvidersModulesQueryKey = identityProvidersModuleKeys.list; /** @@ -46,28 +61,55 @@ export const identityProvidersModulesQueryKey = identityProvidersModuleKeys.list * }); * ``` */ -export function useIdentityProvidersModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IdentityProvidersModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIdentityProvidersModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useIdentityProvidersModulesQuery< + S extends IdentityProvidersModuleSelect, + TData = { + identityProvidersModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IdentityProvidersModuleSelect>; + } & Omit< + UseQueryOptions< + { + identityProvidersModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIdentityProvidersModulesQuery( + params: { + selection: ListSelectionConfig< + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: identityProvidersModuleKeys.list(args), queryFn: () => getClient().identityProvidersModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** @@ -91,17 +133,33 @@ export function useIdentityProvidersModulesQuery(params: { * }); * ``` */ -export async function fetchIdentityProvidersModulesQuery(params: { +export async function fetchIdentityProvidersModulesQuery< + S extends IdentityProvidersModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, IdentityProvidersModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IdentityProvidersModuleSelect>; }): Promise<{ - identityProvidersModules: ConnectionResult>; + identityProvidersModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchIdentityProvidersModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy + >(params.selection); return getClient().identityProvidersModule.findMany(args).unwrap(); } /** @@ -120,17 +178,37 @@ export async function fetchIdentityProvidersModulesQuery(params: { * await prefetchIdentityProvidersModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchIdentityProvidersModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IdentityProvidersModuleSelect>; -}): Promise; -export async function prefetchIdentityProvidersModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchIdentityProvidersModulesQuery< + S extends IdentityProvidersModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IdentityProvidersModuleSelect>; + } +): Promise; +export async function prefetchIdentityProvidersModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: identityProvidersModuleKeys.list(args), - queryFn: () => getClient().identityProvidersModule.findMany(args).unwrap() + queryFn: () => getClient().identityProvidersModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInferenceLogModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInferenceLogModuleQuery.ts index d21290a811..8d2448db21 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInferenceLogModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInferenceLogModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { inferenceLogModuleKeys } from "../query-keys"; -import type { InferenceLogModuleSelect, InferenceLogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InferenceLogModuleSelect, InferenceLogModuleWithRelations } from "../../orm/input-types"; +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 { inferenceLogModuleKeys } from '../query-keys'; +import type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const inferenceLogModuleQueryKey = inferenceLogModuleKeys.detail; /** * Query hook for fetching a single InferenceLogModule - * + * * @example * ```tsx * const { data, isLoading } = useInferenceLogModuleQuery({ @@ -26,38 +32,52 @@ export const inferenceLogModuleQueryKey = inferenceLogModuleKeys.detail; * }); * ``` */ -export function useInferenceLogModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InferenceLogModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInferenceLogModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInferenceLogModuleQuery< + S extends InferenceLogModuleSelect, + TData = { + inferenceLogModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InferenceLogModuleSelect>; + } & Omit< + UseQueryOptions< + { + inferenceLogModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInferenceLogModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: inferenceLogModuleKeys.detail(params.id), - queryFn: () => getClient().inferenceLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .inferenceLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single InferenceLogModule without React hooks - * + * * @example * ```ts * const data = await fetchInferenceLogModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchInferenceLogModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().inferenceLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .inferenceLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single InferenceLogModule for SSR or cache warming - * + * * @example * ```ts * await prefetchInferenceLogModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInferenceLogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InferenceLogModuleSelect>; -}): Promise; -export async function prefetchInferenceLogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInferenceLogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InferenceLogModuleSelect>; + } +): Promise; +export async function prefetchInferenceLogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: inferenceLogModuleKeys.detail(params.id), - queryFn: () => getClient().inferenceLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .inferenceLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInferenceLogModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInferenceLogModulesQuery.ts index 7780ee833f..e47aaae8b5 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInferenceLogModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInferenceLogModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { inferenceLogModuleKeys } from "../query-keys"; -import type { InferenceLogModuleSelect, InferenceLogModuleWithRelations, InferenceLogModuleFilter, InferenceLogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InferenceLogModuleSelect, InferenceLogModuleWithRelations, InferenceLogModuleFilter, InferenceLogModuleOrderBy } from "../../orm/input-types"; +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 { inferenceLogModuleKeys } from '../query-keys'; +import type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InferenceLogModuleSelect, + InferenceLogModuleWithRelations, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const inferenceLogModulesQueryKey = inferenceLogModuleKeys.list; /** * Query hook for fetching InferenceLogModule list - * + * * @example * ```tsx * const { data, isLoading } = useInferenceLogModulesQuery({ @@ -30,33 +45,58 @@ export const inferenceLogModulesQueryKey = inferenceLogModuleKeys.list; * }); * ``` */ -export function useInferenceLogModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InferenceLogModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInferenceLogModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInferenceLogModulesQuery< + S extends InferenceLogModuleSelect, + TData = { + inferenceLogModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InferenceLogModuleSelect>; + } & Omit< + UseQueryOptions< + { + inferenceLogModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInferenceLogModulesQuery( + params: { + selection: ListSelectionConfig< + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: inferenceLogModuleKeys.list(args), queryFn: () => getClient().inferenceLogModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch InferenceLogModule list without React hooks - * + * * @example * ```ts * const data = await fetchInferenceLogModulesQuery({ @@ -70,35 +110,62 @@ export function useInferenceLogModulesQuery(params: { export async function fetchInferenceLogModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InferenceLogModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, InferenceLogModuleSelect>; }): Promise<{ inferenceLogModules: ConnectionResult>; }>; export async function fetchInferenceLogModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy + >(params.selection); return getClient().inferenceLogModule.findMany(args).unwrap(); } /** * Prefetch InferenceLogModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchInferenceLogModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInferenceLogModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InferenceLogModuleSelect>; -}): Promise; -export async function prefetchInferenceLogModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInferenceLogModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InferenceLogModuleSelect>; + } +): Promise; +export async function prefetchInferenceLogModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: inferenceLogModuleKeys.list(args), - queryFn: () => getClient().inferenceLogModule.findMany(args).unwrap() + queryFn: () => getClient().inferenceLogModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInfraConfigModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInfraConfigModuleQuery.ts index 1e1b72c471..08363c23db 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInfraConfigModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInfraConfigModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { infraConfigModuleKeys } from "../query-keys"; -import type { InfraConfigModuleSelect, InfraConfigModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraConfigModuleSelect, InfraConfigModuleWithRelations } from "../../orm/input-types"; +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 { infraConfigModuleKeys } from '../query-keys'; +import type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraConfigModuleQueryKey = infraConfigModuleKeys.detail; /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```tsx * const { data, isLoading } = useInfraConfigModuleQuery({ @@ -26,38 +32,52 @@ export const infraConfigModuleQueryKey = infraConfigModuleKeys.detail; * }); * ``` */ -export function useInfraConfigModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraConfigModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraConfigModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInfraConfigModuleQuery< + S extends InfraConfigModuleSelect, + TData = { + infraConfigModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraConfigModuleSelect>; + } & Omit< + UseQueryOptions< + { + infraConfigModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraConfigModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraConfigModuleKeys.detail(params.id), - queryFn: () => getClient().infraConfigModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .infraConfigModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```ts * const data = await fetchInfraConfigModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchInfraConfigModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().infraConfigModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .infraConfigModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```ts * await prefetchInfraConfigModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInfraConfigModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraConfigModuleSelect>; -}): Promise; -export async function prefetchInfraConfigModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInfraConfigModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraConfigModuleSelect>; + } +): Promise; +export async function prefetchInfraConfigModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: infraConfigModuleKeys.detail(params.id), - queryFn: () => getClient().infraConfigModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .infraConfigModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInfraConfigModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInfraConfigModulesQuery.ts index e4981cdf52..57d03ea10b 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInfraConfigModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInfraConfigModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { infraConfigModuleKeys } from "../query-keys"; -import type { InfraConfigModuleSelect, InfraConfigModuleWithRelations, InfraConfigModuleFilter, InfraConfigModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraConfigModuleSelect, InfraConfigModuleWithRelations, InfraConfigModuleFilter, InfraConfigModuleOrderBy } from "../../orm/input-types"; +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 { infraConfigModuleKeys } from '../query-keys'; +import type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InfraConfigModuleSelect, + InfraConfigModuleWithRelations, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraConfigModulesQueryKey = infraConfigModuleKeys.list; /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```tsx * const { data, isLoading } = useInfraConfigModulesQuery({ @@ -30,33 +45,53 @@ export const infraConfigModulesQueryKey = infraConfigModuleKeys.list; * }); * ``` */ -export function useInfraConfigModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraConfigModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraConfigModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInfraConfigModulesQuery< + S extends InfraConfigModuleSelect, + TData = { + infraConfigModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraConfigModuleSelect>; + } & Omit< + UseQueryOptions< + { + infraConfigModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraConfigModulesQuery( + params: { + selection: ListSelectionConfig< + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraConfigModuleKeys.list(args), queryFn: () => getClient().infraConfigModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```ts * const data = await fetchInfraConfigModulesQuery({ @@ -70,35 +105,59 @@ export function useInfraConfigModulesQuery(params: { export async function fetchInfraConfigModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraConfigModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, InfraConfigModuleSelect>; }): Promise<{ infraConfigModules: ConnectionResult>; }>; export async function fetchInfraConfigModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy + >(params.selection); return getClient().infraConfigModule.findMany(args).unwrap(); } /** * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization. - * + * * @example * ```ts * await prefetchInfraConfigModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInfraConfigModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraConfigModuleSelect>; -}): Promise; -export async function prefetchInfraConfigModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInfraConfigModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InfraConfigModuleSelect>; + } +): Promise; +export async function prefetchInfraConfigModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: infraConfigModuleKeys.list(args), - queryFn: () => getClient().infraConfigModule.findMany(args).unwrap() + queryFn: () => getClient().infraConfigModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInfraSecretsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInfraSecretsModuleQuery.ts index 9d279c4ca7..e14b3e8e4c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInfraSecretsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInfraSecretsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { infraSecretsModuleKeys } from "../query-keys"; -import type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations } from "../../orm/input-types"; +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 { infraSecretsModuleKeys } from '../query-keys'; +import type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraSecretsModuleQueryKey = infraSecretsModuleKeys.detail; /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```tsx * const { data, isLoading } = useInfraSecretsModuleQuery({ @@ -26,38 +32,52 @@ export const infraSecretsModuleQueryKey = infraSecretsModuleKeys.detail; * }); * ``` */ -export function useInfraSecretsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraSecretsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraSecretsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInfraSecretsModuleQuery< + S extends InfraSecretsModuleSelect, + TData = { + infraSecretsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraSecretsModuleSelect>; + } & Omit< + UseQueryOptions< + { + infraSecretsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraSecretsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraSecretsModuleKeys.detail(params.id), - queryFn: () => getClient().infraSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .infraSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```ts * const data = await fetchInfraSecretsModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchInfraSecretsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().infraSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .infraSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```ts * await prefetchInfraSecretsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInfraSecretsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InfraSecretsModuleSelect>; -}): Promise; -export async function prefetchInfraSecretsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInfraSecretsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InfraSecretsModuleSelect>; + } +): Promise; +export async function prefetchInfraSecretsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: infraSecretsModuleKeys.detail(params.id), - queryFn: () => getClient().infraSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .infraSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInfraSecretsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInfraSecretsModulesQuery.ts index 53133ce334..988892085a 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInfraSecretsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInfraSecretsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { infraSecretsModuleKeys } from "../query-keys"; -import type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations, InfraSecretsModuleFilter, InfraSecretsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InfraSecretsModuleSelect, InfraSecretsModuleWithRelations, InfraSecretsModuleFilter, InfraSecretsModuleOrderBy } from "../../orm/input-types"; +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 { infraSecretsModuleKeys } from '../query-keys'; +import type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InfraSecretsModuleSelect, + InfraSecretsModuleWithRelations, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const infraSecretsModulesQueryKey = infraSecretsModuleKeys.list; /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```tsx * const { data, isLoading } = useInfraSecretsModulesQuery({ @@ -30,33 +45,58 @@ export const infraSecretsModulesQueryKey = infraSecretsModuleKeys.list; * }); * ``` */ -export function useInfraSecretsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraSecretsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInfraSecretsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInfraSecretsModulesQuery< + S extends InfraSecretsModuleSelect, + TData = { + infraSecretsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InfraSecretsModuleSelect>; + } & Omit< + UseQueryOptions< + { + infraSecretsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInfraSecretsModulesQuery( + params: { + selection: ListSelectionConfig< + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: infraSecretsModuleKeys.list(args), queryFn: () => getClient().infraSecretsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```ts * const data = await fetchInfraSecretsModulesQuery({ @@ -70,35 +110,62 @@ export function useInfraSecretsModulesQuery(params: { export async function fetchInfraSecretsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraSecretsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, InfraSecretsModuleSelect>; }): Promise<{ infraSecretsModules: ConnectionResult>; }>; export async function fetchInfraSecretsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy + >(params.selection); return getClient().infraSecretsModule.findMany(args).unwrap(); } /** * Namespace-backed PGP-encrypted key-value secrets module. Requires namespace_module and emits namespace:sync_secrets job triggers for K8s Secret synchronization. - * + * * @example * ```ts * await prefetchInfraSecretsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInfraSecretsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InfraSecretsModuleSelect>; -}): Promise; -export async function prefetchInfraSecretsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInfraSecretsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InfraSecretsModuleSelect>; + } +): Promise; +export async function prefetchInfraSecretsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: infraSecretsModuleKeys.list(args), - queryFn: () => getClient().infraSecretsModule.findMany(args).unwrap() + queryFn: () => getClient().infraSecretsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useIntegrationProvidersModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useIntegrationProvidersModuleQuery.ts index 672e04ab11..efd014db31 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useIntegrationProvidersModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useIntegrationProvidersModuleQuery.ts @@ -8,15 +8,21 @@ * 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 { integrationProvidersModuleKeys } from "../query-keys"; -import type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations } from "../../orm/input-types"; +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 { integrationProvidersModuleKeys } from '../query-keys'; +import type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const integrationProvidersModuleQueryKey = integrationProvidersModuleKeys.detail; /** @@ -34,33 +40,53 @@ export const integrationProvidersModuleQueryKey = integrationProvidersModuleKeys * }); * ``` */ -export function useIntegrationProvidersModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, IntegrationProvidersModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIntegrationProvidersModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useIntegrationProvidersModuleQuery< + S extends IntegrationProvidersModuleSelect, + TData = { + integrationProvidersModule: InferSelectResult< + IntegrationProvidersModuleWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, IntegrationProvidersModuleSelect>; + } & Omit< + UseQueryOptions< + { + integrationProvidersModule: InferSelectResult< + IntegrationProvidersModuleWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIntegrationProvidersModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: integrationProvidersModuleKeys.detail(params.id), - queryFn: () => getClient().integrationProvidersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .integrationProvidersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** @@ -78,7 +104,9 @@ export function useIntegrationProvidersModuleQuery(params: { * }); * ``` */ -export async function fetchIntegrationProvidersModuleQuery(params: { +export async function fetchIntegrationProvidersModuleQuery< + S extends IntegrationProvidersModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -91,10 +119,12 @@ export async function fetchIntegrationProvidersModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().integrationProvidersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .integrationProvidersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Config row for the integration_providers_module, which provisions a per-database @@ -108,22 +138,33 @@ export async function fetchIntegrationProvidersModuleQuery(params: { * await prefetchIntegrationProvidersModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchIntegrationProvidersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, IntegrationProvidersModuleSelect>; -}): Promise; -export async function prefetchIntegrationProvidersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchIntegrationProvidersModuleQuery< + S extends IntegrationProvidersModuleSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, IntegrationProvidersModuleSelect>; + } +): Promise; +export async function prefetchIntegrationProvidersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: integrationProvidersModuleKeys.detail(params.id), - queryFn: () => getClient().integrationProvidersModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .integrationProvidersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useIntegrationProvidersModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useIntegrationProvidersModulesQuery.ts index 7f28aeaee4..a9fc1e1186 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useIntegrationProvidersModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useIntegrationProvidersModulesQuery.ts @@ -8,15 +8,30 @@ * 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 { integrationProvidersModuleKeys } from "../query-keys"; -import type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations, IntegrationProvidersModuleFilter, IntegrationProvidersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { IntegrationProvidersModuleSelect, IntegrationProvidersModuleWithRelations, IntegrationProvidersModuleFilter, IntegrationProvidersModuleOrderBy } from "../../orm/input-types"; +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 { integrationProvidersModuleKeys } from '../query-keys'; +import type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleWithRelations, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const integrationProvidersModulesQueryKey = integrationProvidersModuleKeys.list; /** @@ -38,28 +53,55 @@ export const integrationProvidersModulesQueryKey = integrationProvidersModuleKey * }); * ``` */ -export function useIntegrationProvidersModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IntegrationProvidersModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useIntegrationProvidersModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useIntegrationProvidersModulesQuery< + S extends IntegrationProvidersModuleSelect, + TData = { + integrationProvidersModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IntegrationProvidersModuleSelect>; + } & Omit< + UseQueryOptions< + { + integrationProvidersModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useIntegrationProvidersModulesQuery( + params: { + selection: ListSelectionConfig< + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: integrationProvidersModuleKeys.list(args), queryFn: () => getClient().integrationProvidersModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** @@ -79,17 +121,33 @@ export function useIntegrationProvidersModulesQuery(params: { * }); * ``` */ -export async function fetchIntegrationProvidersModulesQuery(params: { +export async function fetchIntegrationProvidersModulesQuery< + S extends IntegrationProvidersModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, IntegrationProvidersModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IntegrationProvidersModuleSelect>; }): Promise<{ - integrationProvidersModules: ConnectionResult>; + integrationProvidersModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchIntegrationProvidersModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy + >(params.selection); return getClient().integrationProvidersModule.findMany(args).unwrap(); } /** @@ -104,17 +162,37 @@ export async function fetchIntegrationProvidersModulesQuery(params: { * await prefetchIntegrationProvidersModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchIntegrationProvidersModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, IntegrationProvidersModuleSelect>; -}): Promise; -export async function prefetchIntegrationProvidersModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchIntegrationProvidersModulesQuery< + S extends IntegrationProvidersModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, IntegrationProvidersModuleSelect>; + } +): Promise; +export async function prefetchIntegrationProvidersModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: integrationProvidersModuleKeys.list(args), - queryFn: () => getClient().integrationProvidersModule.findMany(args).unwrap() + queryFn: () => getClient().integrationProvidersModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInternalSecretsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInternalSecretsModuleQuery.ts index ad50274f05..2d0500a5fd 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInternalSecretsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInternalSecretsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { internalSecretsModuleKeys } from "../query-keys"; -import type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations } from "../../orm/input-types"; +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 { internalSecretsModuleKeys } from '../query-keys'; +import type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const internalSecretsModuleQueryKey = internalSecretsModuleKeys.detail; /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```tsx * const { data, isLoading } = useInternalSecretsModuleQuery({ @@ -26,38 +32,52 @@ export const internalSecretsModuleQueryKey = internalSecretsModuleKeys.detail; * }); * ``` */ -export function useInternalSecretsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InternalSecretsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInternalSecretsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInternalSecretsModuleQuery< + S extends InternalSecretsModuleSelect, + TData = { + internalSecretsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InternalSecretsModuleSelect>; + } & Omit< + UseQueryOptions< + { + internalSecretsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInternalSecretsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: internalSecretsModuleKeys.detail(params.id), - queryFn: () => getClient().internalSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .internalSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```ts * const data = await fetchInternalSecretsModuleQuery({ @@ -66,7 +86,9 @@ export function useInternalSecretsModuleQuery(params: { * }); * ``` */ -export async function fetchInternalSecretsModuleQuery(params: { +export async function fetchInternalSecretsModuleQuery< + S extends InternalSecretsModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchInternalSecretsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().internalSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .internalSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```ts * await prefetchInternalSecretsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInternalSecretsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InternalSecretsModuleSelect>; -}): Promise; -export async function prefetchInternalSecretsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInternalSecretsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InternalSecretsModuleSelect>; + } +): Promise; +export async function prefetchInternalSecretsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: internalSecretsModuleKeys.detail(params.id), - queryFn: () => getClient().internalSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .internalSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInternalSecretsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInternalSecretsModulesQuery.ts index 1a3302a158..d1d6ec46c3 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInternalSecretsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInternalSecretsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { internalSecretsModuleKeys } from "../query-keys"; -import type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations, InternalSecretsModuleFilter, InternalSecretsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InternalSecretsModuleSelect, InternalSecretsModuleWithRelations, InternalSecretsModuleFilter, InternalSecretsModuleOrderBy } from "../../orm/input-types"; +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 { internalSecretsModuleKeys } from '../query-keys'; +import type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InternalSecretsModuleSelect, + InternalSecretsModuleWithRelations, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const internalSecretsModulesQueryKey = internalSecretsModuleKeys.list; /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```tsx * const { data, isLoading } = useInternalSecretsModulesQuery({ @@ -30,33 +45,60 @@ export const internalSecretsModulesQueryKey = internalSecretsModuleKeys.list; * }); * ``` */ -export function useInternalSecretsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InternalSecretsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInternalSecretsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInternalSecretsModulesQuery< + S extends InternalSecretsModuleSelect, + TData = { + internalSecretsModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InternalSecretsModuleSelect>; + } & Omit< + UseQueryOptions< + { + internalSecretsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInternalSecretsModulesQuery( + params: { + selection: ListSelectionConfig< + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: internalSecretsModuleKeys.list(args), queryFn: () => getClient().internalSecretsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```ts * const data = await fetchInternalSecretsModulesQuery({ @@ -67,38 +109,72 @@ export function useInternalSecretsModulesQuery(params: { * }); * ``` */ -export async function fetchInternalSecretsModulesQuery(params: { +export async function fetchInternalSecretsModulesQuery< + S extends InternalSecretsModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InternalSecretsModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InternalSecretsModuleSelect>; }): Promise<{ - internalSecretsModules: ConnectionResult>; + internalSecretsModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchInternalSecretsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy + >(params.selection); return getClient().internalSecretsModule.findMany(args).unwrap(); } /** * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage. - * + * * @example * ```ts * await prefetchInternalSecretsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInternalSecretsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InternalSecretsModuleSelect>; -}): Promise; -export async function prefetchInternalSecretsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInternalSecretsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, InternalSecretsModuleSelect>; + } +): Promise; +export async function prefetchInternalSecretsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: internalSecretsModuleKeys.list(args), - queryFn: () => getClient().internalSecretsModule.findMany(args).unwrap() + queryFn: () => getClient().internalSecretsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInvitesModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInvitesModuleQuery.ts index e2e86dd3c6..4018ec2829 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInvitesModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInvitesModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { invitesModuleKeys } from "../query-keys"; -import type { InvitesModuleSelect, InvitesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { InvitesModuleSelect, InvitesModuleWithRelations } from "../../orm/input-types"; +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 { invitesModuleKeys } from '../query-keys'; +import type { InvitesModuleSelect, InvitesModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { InvitesModuleSelect, InvitesModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const invitesModuleQueryKey = invitesModuleKeys.detail; /** * Query hook for fetching a single InvitesModule - * + * * @example * ```tsx * const { data, isLoading } = useInvitesModuleQuery({ @@ -26,38 +26,52 @@ export const invitesModuleQueryKey = invitesModuleKeys.detail; * }); * ``` */ -export function useInvitesModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InvitesModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInvitesModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useInvitesModuleQuery< + S extends InvitesModuleSelect, + TData = { + invitesModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InvitesModuleSelect>; + } & Omit< + UseQueryOptions< + { + invitesModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInvitesModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: invitesModuleKeys.detail(params.id), - queryFn: () => getClient().invitesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .invitesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single InvitesModule without React hooks - * + * * @example * ```ts * const data = await fetchInvitesModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchInvitesModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().invitesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .invitesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single InvitesModule for SSR or cache warming - * + * * @example * ```ts * await prefetchInvitesModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchInvitesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, InvitesModuleSelect>; -}): Promise; -export async function prefetchInvitesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchInvitesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, InvitesModuleSelect>; + } +): Promise; +export async function prefetchInvitesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: invitesModuleKeys.detail(params.id), - queryFn: () => getClient().invitesModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .invitesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useInvitesModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useInvitesModulesQuery.ts index 201ee9d302..ea3a6077fc 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useInvitesModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useInvitesModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { invitesModuleKeys } from "../query-keys"; -import type { InvitesModuleSelect, InvitesModuleWithRelations, InvitesModuleFilter, InvitesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { InvitesModuleSelect, InvitesModuleWithRelations, InvitesModuleFilter, InvitesModuleOrderBy } from "../../orm/input-types"; +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 { invitesModuleKeys } from '../query-keys'; +import type { + InvitesModuleSelect, + InvitesModuleWithRelations, + InvitesModuleFilter, + InvitesModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + InvitesModuleSelect, + InvitesModuleWithRelations, + InvitesModuleFilter, + InvitesModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const invitesModulesQueryKey = invitesModuleKeys.list; /** * Query hook for fetching InvitesModule list - * + * * @example * ```tsx * const { data, isLoading } = useInvitesModulesQuery({ @@ -30,33 +45,49 @@ export const invitesModulesQueryKey = invitesModuleKeys.list; * }); * ``` */ -export function useInvitesModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InvitesModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useInvitesModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useInvitesModulesQuery< + S extends InvitesModuleSelect, + TData = { + invitesModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InvitesModuleSelect>; + } & Omit< + UseQueryOptions< + { + invitesModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useInvitesModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + InvitesModuleSelect, + InvitesModuleFilter, + InvitesModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: invitesModuleKeys.list(args), queryFn: () => getClient().invitesModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch InvitesModule list without React hooks - * + * * @example * ```ts * const data = await fetchInvitesModulesQuery({ @@ -70,35 +101,51 @@ export function useInvitesModulesQuery(params: { export async function fetchInvitesModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, InvitesModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, InvitesModuleSelect>; }): Promise<{ invitesModules: ConnectionResult>; }>; export async function fetchInvitesModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + InvitesModuleSelect, + InvitesModuleFilter, + InvitesModuleOrderBy + >(params.selection); return getClient().invitesModule.findMany(args).unwrap(); } /** * Prefetch InvitesModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchInvitesModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchInvitesModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, InvitesModuleSelect>; -}): Promise; -export async function prefetchInvitesModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchInvitesModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, InvitesModuleSelect>; + } +): Promise; +export async function prefetchInvitesModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + InvitesModuleSelect, + InvitesModuleFilter, + InvitesModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: invitesModuleKeys.list(args), - queryFn: () => getClient().invitesModule.findMany(args).unwrap() + queryFn: () => getClient().invitesModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useLimitsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useLimitsModuleQuery.ts index d02252fd4e..deae8ef367 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useLimitsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useLimitsModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { limitsModuleKeys } from "../query-keys"; -import type { LimitsModuleSelect, LimitsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { LimitsModuleSelect, LimitsModuleWithRelations } from "../../orm/input-types"; +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 { limitsModuleKeys } from '../query-keys'; +import type { LimitsModuleSelect, LimitsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { LimitsModuleSelect, LimitsModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const limitsModuleQueryKey = limitsModuleKeys.detail; /** * Query hook for fetching a single LimitsModule - * + * * @example * ```tsx * const { data, isLoading } = useLimitsModuleQuery({ @@ -26,38 +26,52 @@ export const limitsModuleQueryKey = limitsModuleKeys.detail; * }); * ``` */ -export function useLimitsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, LimitsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useLimitsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useLimitsModuleQuery< + S extends LimitsModuleSelect, + TData = { + limitsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, LimitsModuleSelect>; + } & Omit< + UseQueryOptions< + { + limitsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useLimitsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: limitsModuleKeys.detail(params.id), - queryFn: () => getClient().limitsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .limitsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single LimitsModule without React hooks - * + * * @example * ```ts * const data = await fetchLimitsModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchLimitsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().limitsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .limitsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single LimitsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchLimitsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchLimitsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, LimitsModuleSelect>; -}): Promise; -export async function prefetchLimitsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchLimitsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, LimitsModuleSelect>; + } +): Promise; +export async function prefetchLimitsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: limitsModuleKeys.detail(params.id), - queryFn: () => getClient().limitsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .limitsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useLimitsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useLimitsModulesQuery.ts index 5cec03e028..fa325da6f0 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useLimitsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useLimitsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { limitsModuleKeys } from "../query-keys"; -import type { LimitsModuleSelect, LimitsModuleWithRelations, LimitsModuleFilter, LimitsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { LimitsModuleSelect, LimitsModuleWithRelations, LimitsModuleFilter, LimitsModuleOrderBy } from "../../orm/input-types"; +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 { limitsModuleKeys } from '../query-keys'; +import type { + LimitsModuleSelect, + LimitsModuleWithRelations, + LimitsModuleFilter, + LimitsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + LimitsModuleSelect, + LimitsModuleWithRelations, + LimitsModuleFilter, + LimitsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const limitsModulesQueryKey = limitsModuleKeys.list; /** * Query hook for fetching LimitsModule list - * + * * @example * ```tsx * const { data, isLoading } = useLimitsModulesQuery({ @@ -30,33 +45,47 @@ export const limitsModulesQueryKey = limitsModuleKeys.list; * }); * ``` */ -export function useLimitsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, LimitsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useLimitsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useLimitsModulesQuery< + S extends LimitsModuleSelect, + TData = { + limitsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, LimitsModuleSelect>; + } & Omit< + UseQueryOptions< + { + limitsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useLimitsModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: limitsModuleKeys.list(args), queryFn: () => getClient().limitsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch LimitsModule list without React hooks - * + * * @example * ```ts * const data = await fetchLimitsModulesQuery({ @@ -70,35 +99,47 @@ export function useLimitsModulesQuery(params: { export async function fetchLimitsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, LimitsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, LimitsModuleSelect>; }): Promise<{ limitsModules: ConnectionResult>; }>; export async function fetchLimitsModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().limitsModule.findMany(args).unwrap(); } /** * Prefetch LimitsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchLimitsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchLimitsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, LimitsModuleSelect>; -}): Promise; -export async function prefetchLimitsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchLimitsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, LimitsModuleSelect>; + } +): Promise; +export async function prefetchLimitsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: limitsModuleKeys.list(args), - queryFn: () => getClient().limitsModule.findMany(args).unwrap() + queryFn: () => getClient().limitsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useMembershipTypesModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useMembershipTypesModuleQuery.ts index 51ad8f9306..58e4846a82 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useMembershipTypesModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useMembershipTypesModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { membershipTypesModuleKeys } from "../query-keys"; -import type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations } from "../../orm/input-types"; +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 { membershipTypesModuleKeys } from '../query-keys'; +import type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const membershipTypesModuleQueryKey = membershipTypesModuleKeys.detail; /** * Query hook for fetching a single MembershipTypesModule - * + * * @example * ```tsx * const { data, isLoading } = useMembershipTypesModuleQuery({ @@ -26,38 +32,52 @@ export const membershipTypesModuleQueryKey = membershipTypesModuleKeys.detail; * }); * ``` */ -export function useMembershipTypesModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, MembershipTypesModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useMembershipTypesModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useMembershipTypesModuleQuery< + S extends MembershipTypesModuleSelect, + TData = { + membershipTypesModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, MembershipTypesModuleSelect>; + } & Omit< + UseQueryOptions< + { + membershipTypesModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useMembershipTypesModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: membershipTypesModuleKeys.detail(params.id), - queryFn: () => getClient().membershipTypesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .membershipTypesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single MembershipTypesModule without React hooks - * + * * @example * ```ts * const data = await fetchMembershipTypesModuleQuery({ @@ -66,7 +86,9 @@ export function useMembershipTypesModuleQuery(params: { * }); * ``` */ -export async function fetchMembershipTypesModuleQuery(params: { +export async function fetchMembershipTypesModuleQuery< + S extends MembershipTypesModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchMembershipTypesModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().membershipTypesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .membershipTypesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single MembershipTypesModule for SSR or cache warming - * + * * @example * ```ts * await prefetchMembershipTypesModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchMembershipTypesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, MembershipTypesModuleSelect>; -}): Promise; -export async function prefetchMembershipTypesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchMembershipTypesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, MembershipTypesModuleSelect>; + } +): Promise; +export async function prefetchMembershipTypesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: membershipTypesModuleKeys.detail(params.id), - queryFn: () => getClient().membershipTypesModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .membershipTypesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useMembershipTypesModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useMembershipTypesModulesQuery.ts index b78ce7fc35..ed17a6b5de 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useMembershipTypesModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useMembershipTypesModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { membershipTypesModuleKeys } from "../query-keys"; -import type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations, MembershipTypesModuleFilter, MembershipTypesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipTypesModuleSelect, MembershipTypesModuleWithRelations, MembershipTypesModuleFilter, MembershipTypesModuleOrderBy } from "../../orm/input-types"; +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 { membershipTypesModuleKeys } from '../query-keys'; +import type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + MembershipTypesModuleSelect, + MembershipTypesModuleWithRelations, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const membershipTypesModulesQueryKey = membershipTypesModuleKeys.list; /** * Query hook for fetching MembershipTypesModule list - * + * * @example * ```tsx * const { data, isLoading } = useMembershipTypesModulesQuery({ @@ -30,33 +45,60 @@ export const membershipTypesModulesQueryKey = membershipTypesModuleKeys.list; * }); * ``` */ -export function useMembershipTypesModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipTypesModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useMembershipTypesModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useMembershipTypesModulesQuery< + S extends MembershipTypesModuleSelect, + TData = { + membershipTypesModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, MembershipTypesModuleSelect>; + } & Omit< + UseQueryOptions< + { + membershipTypesModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useMembershipTypesModulesQuery( + params: { + selection: ListSelectionConfig< + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: membershipTypesModuleKeys.list(args), queryFn: () => getClient().membershipTypesModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch MembershipTypesModule list without React hooks - * + * * @example * ```ts * const data = await fetchMembershipTypesModulesQuery({ @@ -67,38 +109,72 @@ export function useMembershipTypesModulesQuery(params: { * }); * ``` */ -export async function fetchMembershipTypesModulesQuery(params: { +export async function fetchMembershipTypesModulesQuery< + S extends MembershipTypesModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipTypesModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, MembershipTypesModuleSelect>; }): Promise<{ - membershipTypesModules: ConnectionResult>; + membershipTypesModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchMembershipTypesModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy + >(params.selection); return getClient().membershipTypesModule.findMany(args).unwrap(); } /** * Prefetch MembershipTypesModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchMembershipTypesModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchMembershipTypesModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipTypesModuleSelect>; -}): Promise; -export async function prefetchMembershipTypesModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchMembershipTypesModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, MembershipTypesModuleSelect>; + } +): Promise; +export async function prefetchMembershipTypesModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: membershipTypesModuleKeys.list(args), - queryFn: () => getClient().membershipTypesModule.findMany(args).unwrap() + queryFn: () => getClient().membershipTypesModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useMembershipsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useMembershipsModuleQuery.ts index d635cacf4a..8dbaa28296 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useMembershipsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useMembershipsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { membershipsModuleKeys } from "../query-keys"; -import type { MembershipsModuleSelect, MembershipsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipsModuleSelect, MembershipsModuleWithRelations } from "../../orm/input-types"; +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 { membershipsModuleKeys } from '../query-keys'; +import type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const membershipsModuleQueryKey = membershipsModuleKeys.detail; /** * Query hook for fetching a single MembershipsModule - * + * * @example * ```tsx * const { data, isLoading } = useMembershipsModuleQuery({ @@ -26,38 +32,52 @@ export const membershipsModuleQueryKey = membershipsModuleKeys.detail; * }); * ``` */ -export function useMembershipsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, MembershipsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useMembershipsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useMembershipsModuleQuery< + S extends MembershipsModuleSelect, + TData = { + membershipsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, MembershipsModuleSelect>; + } & Omit< + UseQueryOptions< + { + membershipsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useMembershipsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: membershipsModuleKeys.detail(params.id), - queryFn: () => getClient().membershipsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .membershipsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single MembershipsModule without React hooks - * + * * @example * ```ts * const data = await fetchMembershipsModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchMembershipsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().membershipsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .membershipsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single MembershipsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchMembershipsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchMembershipsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, MembershipsModuleSelect>; -}): Promise; -export async function prefetchMembershipsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchMembershipsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, MembershipsModuleSelect>; + } +): Promise; +export async function prefetchMembershipsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: membershipsModuleKeys.detail(params.id), - queryFn: () => getClient().membershipsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .membershipsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useMembershipsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useMembershipsModulesQuery.ts index 15d781df0d..13e9830a55 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useMembershipsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useMembershipsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { membershipsModuleKeys } from "../query-keys"; -import type { MembershipsModuleSelect, MembershipsModuleWithRelations, MembershipsModuleFilter, MembershipsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { MembershipsModuleSelect, MembershipsModuleWithRelations, MembershipsModuleFilter, MembershipsModuleOrderBy } from "../../orm/input-types"; +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 { membershipsModuleKeys } from '../query-keys'; +import type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, + MembershipsModuleFilter, + MembershipsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + MembershipsModuleSelect, + MembershipsModuleWithRelations, + MembershipsModuleFilter, + MembershipsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const membershipsModulesQueryKey = membershipsModuleKeys.list; /** * Query hook for fetching MembershipsModule list - * + * * @example * ```tsx * const { data, isLoading } = useMembershipsModulesQuery({ @@ -30,33 +45,53 @@ export const membershipsModulesQueryKey = membershipsModuleKeys.list; * }); * ``` */ -export function useMembershipsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useMembershipsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useMembershipsModulesQuery< + S extends MembershipsModuleSelect, + TData = { + membershipsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, MembershipsModuleSelect>; + } & Omit< + UseQueryOptions< + { + membershipsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useMembershipsModulesQuery( + params: { + selection: ListSelectionConfig< + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: membershipsModuleKeys.list(args), queryFn: () => getClient().membershipsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch MembershipsModule list without React hooks - * + * * @example * ```ts * const data = await fetchMembershipsModulesQuery({ @@ -70,35 +105,59 @@ export function useMembershipsModulesQuery(params: { export async function fetchMembershipsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, MembershipsModuleSelect>; }): Promise<{ membershipsModules: ConnectionResult>; }>; export async function fetchMembershipsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy + >(params.selection); return getClient().membershipsModule.findMany(args).unwrap(); } /** * Prefetch MembershipsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchMembershipsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchMembershipsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, MembershipsModuleSelect>; -}): Promise; -export async function prefetchMembershipsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchMembershipsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, MembershipsModuleSelect>; + } +): Promise; +export async function prefetchMembershipsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: membershipsModuleKeys.list(args), - queryFn: () => getClient().membershipsModule.findMany(args).unwrap() + queryFn: () => getClient().membershipsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useMerkleStoreModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useMerkleStoreModuleQuery.ts index 95e56009bf..b6dfd230c0 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useMerkleStoreModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useMerkleStoreModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { merkleStoreModuleKeys } from "../query-keys"; -import type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations } from "../../orm/input-types"; +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 { merkleStoreModuleKeys } from '../query-keys'; +import type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const merkleStoreModuleQueryKey = merkleStoreModuleKeys.detail; /** * Query hook for fetching a single MerkleStoreModule - * + * * @example * ```tsx * const { data, isLoading } = useMerkleStoreModuleQuery({ @@ -26,38 +32,52 @@ export const merkleStoreModuleQueryKey = merkleStoreModuleKeys.detail; * }); * ``` */ -export function useMerkleStoreModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, MerkleStoreModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useMerkleStoreModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useMerkleStoreModuleQuery< + S extends MerkleStoreModuleSelect, + TData = { + merkleStoreModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, MerkleStoreModuleSelect>; + } & Omit< + UseQueryOptions< + { + merkleStoreModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useMerkleStoreModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: merkleStoreModuleKeys.detail(params.id), - queryFn: () => getClient().merkleStoreModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .merkleStoreModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single MerkleStoreModule without React hooks - * + * * @example * ```ts * const data = await fetchMerkleStoreModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchMerkleStoreModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().merkleStoreModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .merkleStoreModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single MerkleStoreModule for SSR or cache warming - * + * * @example * ```ts * await prefetchMerkleStoreModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchMerkleStoreModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, MerkleStoreModuleSelect>; -}): Promise; -export async function prefetchMerkleStoreModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchMerkleStoreModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, MerkleStoreModuleSelect>; + } +): Promise; +export async function prefetchMerkleStoreModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: merkleStoreModuleKeys.detail(params.id), - queryFn: () => getClient().merkleStoreModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .merkleStoreModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useMerkleStoreModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useMerkleStoreModulesQuery.ts index 5e2b1c5efe..65f4246203 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useMerkleStoreModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useMerkleStoreModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { merkleStoreModuleKeys } from "../query-keys"; -import type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations, MerkleStoreModuleFilter, MerkleStoreModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { MerkleStoreModuleSelect, MerkleStoreModuleWithRelations, MerkleStoreModuleFilter, MerkleStoreModuleOrderBy } from "../../orm/input-types"; +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 { merkleStoreModuleKeys } from '../query-keys'; +import type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + MerkleStoreModuleSelect, + MerkleStoreModuleWithRelations, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const merkleStoreModulesQueryKey = merkleStoreModuleKeys.list; /** * Query hook for fetching MerkleStoreModule list - * + * * @example * ```tsx * const { data, isLoading } = useMerkleStoreModulesQuery({ @@ -30,33 +45,53 @@ export const merkleStoreModulesQueryKey = merkleStoreModuleKeys.list; * }); * ``` */ -export function useMerkleStoreModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, MerkleStoreModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useMerkleStoreModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useMerkleStoreModulesQuery< + S extends MerkleStoreModuleSelect, + TData = { + merkleStoreModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, MerkleStoreModuleSelect>; + } & Omit< + UseQueryOptions< + { + merkleStoreModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useMerkleStoreModulesQuery( + params: { + selection: ListSelectionConfig< + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: merkleStoreModuleKeys.list(args), queryFn: () => getClient().merkleStoreModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch MerkleStoreModule list without React hooks - * + * * @example * ```ts * const data = await fetchMerkleStoreModulesQuery({ @@ -70,35 +105,59 @@ export function useMerkleStoreModulesQuery(params: { export async function fetchMerkleStoreModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, MerkleStoreModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, MerkleStoreModuleSelect>; }): Promise<{ merkleStoreModules: ConnectionResult>; }>; export async function fetchMerkleStoreModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy + >(params.selection); return getClient().merkleStoreModule.findMany(args).unwrap(); } /** * Prefetch MerkleStoreModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchMerkleStoreModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchMerkleStoreModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, MerkleStoreModuleSelect>; -}): Promise; -export async function prefetchMerkleStoreModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchMerkleStoreModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, MerkleStoreModuleSelect>; + } +): Promise; +export async function prefetchMerkleStoreModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: merkleStoreModuleKeys.list(args), - queryFn: () => getClient().merkleStoreModule.findMany(args).unwrap() + queryFn: () => getClient().merkleStoreModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useNamespaceModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useNamespaceModuleQuery.ts index 8266422bcf..7b612c72a5 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useNamespaceModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useNamespaceModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { namespaceModuleKeys } from "../query-keys"; -import type { NamespaceModuleSelect, NamespaceModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceModuleSelect, NamespaceModuleWithRelations } from "../../orm/input-types"; +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 { namespaceModuleKeys } from '../query-keys'; +import type { NamespaceModuleSelect, NamespaceModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { NamespaceModuleSelect, NamespaceModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespaceModuleQueryKey = namespaceModuleKeys.detail; /** * Query hook for fetching a single NamespaceModule - * + * * @example * ```tsx * const { data, isLoading } = useNamespaceModuleQuery({ @@ -26,38 +26,52 @@ export const namespaceModuleQueryKey = namespaceModuleKeys.detail; * }); * ``` */ -export function useNamespaceModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespaceModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useNamespaceModuleQuery< + S extends NamespaceModuleSelect, + TData = { + namespaceModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceModuleSelect>; + } & Omit< + UseQueryOptions< + { + namespaceModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespaceModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceModuleKeys.detail(params.id), - queryFn: () => getClient().namespaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .namespaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single NamespaceModule without React hooks - * + * * @example * ```ts * const data = await fetchNamespaceModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchNamespaceModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().namespaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .namespaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single NamespaceModule for SSR or cache warming - * + * * @example * ```ts * await prefetchNamespaceModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchNamespaceModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NamespaceModuleSelect>; -}): Promise; -export async function prefetchNamespaceModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchNamespaceModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NamespaceModuleSelect>; + } +): Promise; +export async function prefetchNamespaceModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: namespaceModuleKeys.detail(params.id), - queryFn: () => getClient().namespaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .namespaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useNamespaceModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useNamespaceModulesQuery.ts index 882af03d67..595ca1c588 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useNamespaceModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useNamespaceModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { namespaceModuleKeys } from "../query-keys"; -import type { NamespaceModuleSelect, NamespaceModuleWithRelations, NamespaceModuleFilter, NamespaceModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { NamespaceModuleSelect, NamespaceModuleWithRelations, NamespaceModuleFilter, NamespaceModuleOrderBy } from "../../orm/input-types"; +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 { namespaceModuleKeys } from '../query-keys'; +import type { + NamespaceModuleSelect, + NamespaceModuleWithRelations, + NamespaceModuleFilter, + NamespaceModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + NamespaceModuleSelect, + NamespaceModuleWithRelations, + NamespaceModuleFilter, + NamespaceModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const namespaceModulesQueryKey = namespaceModuleKeys.list; /** * Query hook for fetching NamespaceModule list - * + * * @example * ```tsx * const { data, isLoading } = useNamespaceModulesQuery({ @@ -30,33 +45,53 @@ export const namespaceModulesQueryKey = namespaceModuleKeys.list; * }); * ``` */ -export function useNamespaceModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNamespaceModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useNamespaceModulesQuery< + S extends NamespaceModuleSelect, + TData = { + namespaceModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceModuleSelect>; + } & Omit< + UseQueryOptions< + { + namespaceModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNamespaceModulesQuery( + params: { + selection: ListSelectionConfig< + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: namespaceModuleKeys.list(args), queryFn: () => getClient().namespaceModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch NamespaceModule list without React hooks - * + * * @example * ```ts * const data = await fetchNamespaceModulesQuery({ @@ -70,35 +105,59 @@ export function useNamespaceModulesQuery(params: { export async function fetchNamespaceModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceModuleSelect>; }): Promise<{ namespaceModules: ConnectionResult>; }>; export async function fetchNamespaceModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy + >(params.selection); return getClient().namespaceModule.findMany(args).unwrap(); } /** * Prefetch NamespaceModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchNamespaceModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchNamespaceModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NamespaceModuleSelect>; -}): Promise; -export async function prefetchNamespaceModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchNamespaceModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, NamespaceModuleSelect>; + } +): Promise; +export async function prefetchNamespaceModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: namespaceModuleKeys.list(args), - queryFn: () => getClient().namespaceModule.findMany(args).unwrap() + queryFn: () => getClient().namespaceModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useNotificationsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useNotificationsModuleQuery.ts index d6252d53cb..c43c6203a6 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useNotificationsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useNotificationsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { notificationsModuleKeys } from "../query-keys"; -import type { NotificationsModuleSelect, NotificationsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { NotificationsModuleSelect, NotificationsModuleWithRelations } from "../../orm/input-types"; +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 { notificationsModuleKeys } from '../query-keys'; +import type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const notificationsModuleQueryKey = notificationsModuleKeys.detail; /** * Query hook for fetching a single NotificationsModule - * + * * @example * ```tsx * const { data, isLoading } = useNotificationsModuleQuery({ @@ -26,38 +32,52 @@ export const notificationsModuleQueryKey = notificationsModuleKeys.detail; * }); * ``` */ -export function useNotificationsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NotificationsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNotificationsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useNotificationsModuleQuery< + S extends NotificationsModuleSelect, + TData = { + notificationsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NotificationsModuleSelect>; + } & Omit< + UseQueryOptions< + { + notificationsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNotificationsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: notificationsModuleKeys.detail(params.id), - queryFn: () => getClient().notificationsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .notificationsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single NotificationsModule without React hooks - * + * * @example * ```ts * const data = await fetchNotificationsModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchNotificationsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().notificationsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .notificationsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single NotificationsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchNotificationsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchNotificationsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, NotificationsModuleSelect>; -}): Promise; -export async function prefetchNotificationsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchNotificationsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, NotificationsModuleSelect>; + } +): Promise; +export async function prefetchNotificationsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: notificationsModuleKeys.detail(params.id), - queryFn: () => getClient().notificationsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .notificationsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useNotificationsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useNotificationsModulesQuery.ts index 18f67c6f0f..c33e482ee7 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useNotificationsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useNotificationsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { notificationsModuleKeys } from "../query-keys"; -import type { NotificationsModuleSelect, NotificationsModuleWithRelations, NotificationsModuleFilter, NotificationsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { NotificationsModuleSelect, NotificationsModuleWithRelations, NotificationsModuleFilter, NotificationsModuleOrderBy } from "../../orm/input-types"; +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 { notificationsModuleKeys } from '../query-keys'; +import type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, + NotificationsModuleFilter, + NotificationsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + NotificationsModuleSelect, + NotificationsModuleWithRelations, + NotificationsModuleFilter, + NotificationsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const notificationsModulesQueryKey = notificationsModuleKeys.list; /** * Query hook for fetching NotificationsModule list - * + * * @example * ```tsx * const { data, isLoading } = useNotificationsModulesQuery({ @@ -30,33 +45,58 @@ export const notificationsModulesQueryKey = notificationsModuleKeys.list; * }); * ``` */ -export function useNotificationsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NotificationsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useNotificationsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useNotificationsModulesQuery< + S extends NotificationsModuleSelect, + TData = { + notificationsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, NotificationsModuleSelect>; + } & Omit< + UseQueryOptions< + { + notificationsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useNotificationsModulesQuery( + params: { + selection: ListSelectionConfig< + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: notificationsModuleKeys.list(args), queryFn: () => getClient().notificationsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch NotificationsModule list without React hooks - * + * * @example * ```ts * const data = await fetchNotificationsModulesQuery({ @@ -70,35 +110,65 @@ export function useNotificationsModulesQuery(params: { export async function fetchNotificationsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, NotificationsModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, NotificationsModuleSelect>; }): Promise<{ notificationsModules: ConnectionResult>; }>; export async function fetchNotificationsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy + >(params.selection); return getClient().notificationsModule.findMany(args).unwrap(); } /** * Prefetch NotificationsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchNotificationsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchNotificationsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, NotificationsModuleSelect>; -}): Promise; -export async function prefetchNotificationsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchNotificationsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, NotificationsModuleSelect>; + } +): Promise; +export async function prefetchNotificationsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: notificationsModuleKeys.list(args), - queryFn: () => getClient().notificationsModule.findMany(args).unwrap() + queryFn: () => getClient().notificationsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePermissionsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePermissionsModuleQuery.ts index b229bca69b..5c5a951399 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/usePermissionsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/usePermissionsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { permissionsModuleKeys } from "../query-keys"; -import type { PermissionsModuleSelect, PermissionsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PermissionsModuleSelect, PermissionsModuleWithRelations } from "../../orm/input-types"; +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 { permissionsModuleKeys } from '../query-keys'; +import type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const permissionsModuleQueryKey = permissionsModuleKeys.detail; /** * Query hook for fetching a single PermissionsModule - * + * * @example * ```tsx * const { data, isLoading } = usePermissionsModuleQuery({ @@ -26,38 +32,52 @@ export const permissionsModuleQueryKey = permissionsModuleKeys.detail; * }); * ``` */ -export function usePermissionsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PermissionsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePermissionsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePermissionsModuleQuery< + S extends PermissionsModuleSelect, + TData = { + permissionsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PermissionsModuleSelect>; + } & Omit< + UseQueryOptions< + { + permissionsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePermissionsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: permissionsModuleKeys.detail(params.id), - queryFn: () => getClient().permissionsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .permissionsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single PermissionsModule without React hooks - * + * * @example * ```ts * const data = await fetchPermissionsModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchPermissionsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().permissionsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .permissionsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single PermissionsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchPermissionsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPermissionsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PermissionsModuleSelect>; -}): Promise; -export async function prefetchPermissionsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPermissionsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PermissionsModuleSelect>; + } +): Promise; +export async function prefetchPermissionsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: permissionsModuleKeys.detail(params.id), - queryFn: () => getClient().permissionsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .permissionsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePermissionsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePermissionsModulesQuery.ts index eed08f69cb..ccfc68c12b 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/usePermissionsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/usePermissionsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { permissionsModuleKeys } from "../query-keys"; -import type { PermissionsModuleSelect, PermissionsModuleWithRelations, PermissionsModuleFilter, PermissionsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PermissionsModuleSelect, PermissionsModuleWithRelations, PermissionsModuleFilter, PermissionsModuleOrderBy } from "../../orm/input-types"; +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 { permissionsModuleKeys } from '../query-keys'; +import type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, + PermissionsModuleFilter, + PermissionsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PermissionsModuleSelect, + PermissionsModuleWithRelations, + PermissionsModuleFilter, + PermissionsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const permissionsModulesQueryKey = permissionsModuleKeys.list; /** * Query hook for fetching PermissionsModule list - * + * * @example * ```tsx * const { data, isLoading } = usePermissionsModulesQuery({ @@ -30,33 +45,53 @@ export const permissionsModulesQueryKey = permissionsModuleKeys.list; * }); * ``` */ -export function usePermissionsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PermissionsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePermissionsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePermissionsModulesQuery< + S extends PermissionsModuleSelect, + TData = { + permissionsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PermissionsModuleSelect>; + } & Omit< + UseQueryOptions< + { + permissionsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePermissionsModulesQuery( + params: { + selection: ListSelectionConfig< + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: permissionsModuleKeys.list(args), queryFn: () => getClient().permissionsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PermissionsModule list without React hooks - * + * * @example * ```ts * const data = await fetchPermissionsModulesQuery({ @@ -70,35 +105,59 @@ export function usePermissionsModulesQuery(params: { export async function fetchPermissionsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PermissionsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PermissionsModuleSelect>; }): Promise<{ permissionsModules: ConnectionResult>; }>; export async function fetchPermissionsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy + >(params.selection); return getClient().permissionsModule.findMany(args).unwrap(); } /** * Prefetch PermissionsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchPermissionsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPermissionsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PermissionsModuleSelect>; -}): Promise; -export async function prefetchPermissionsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPermissionsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PermissionsModuleSelect>; + } +): Promise; +export async function prefetchPermissionsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: permissionsModuleKeys.list(args), - queryFn: () => getClient().permissionsModule.findMany(args).unwrap() + queryFn: () => getClient().permissionsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePhoneNumbersModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePhoneNumbersModuleQuery.ts index 96bbeb66a3..302e6ede9f 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/usePhoneNumbersModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/usePhoneNumbersModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { phoneNumbersModuleKeys } from "../query-keys"; -import type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations } from "../../orm/input-types"; +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 { phoneNumbersModuleKeys } from '../query-keys'; +import type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const phoneNumbersModuleQueryKey = phoneNumbersModuleKeys.detail; /** * Query hook for fetching a single PhoneNumbersModule - * + * * @example * ```tsx * const { data, isLoading } = usePhoneNumbersModuleQuery({ @@ -26,38 +32,52 @@ export const phoneNumbersModuleQueryKey = phoneNumbersModuleKeys.detail; * }); * ``` */ -export function usePhoneNumbersModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PhoneNumbersModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePhoneNumbersModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePhoneNumbersModuleQuery< + S extends PhoneNumbersModuleSelect, + TData = { + phoneNumbersModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PhoneNumbersModuleSelect>; + } & Omit< + UseQueryOptions< + { + phoneNumbersModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePhoneNumbersModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: phoneNumbersModuleKeys.detail(params.id), - queryFn: () => getClient().phoneNumbersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .phoneNumbersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single PhoneNumbersModule without React hooks - * + * * @example * ```ts * const data = await fetchPhoneNumbersModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchPhoneNumbersModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().phoneNumbersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .phoneNumbersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single PhoneNumbersModule for SSR or cache warming - * + * * @example * ```ts * await prefetchPhoneNumbersModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPhoneNumbersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PhoneNumbersModuleSelect>; -}): Promise; -export async function prefetchPhoneNumbersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPhoneNumbersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PhoneNumbersModuleSelect>; + } +): Promise; +export async function prefetchPhoneNumbersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: phoneNumbersModuleKeys.detail(params.id), - queryFn: () => getClient().phoneNumbersModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .phoneNumbersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePhoneNumbersModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePhoneNumbersModulesQuery.ts index bceb6aa9ed..76977ab6bb 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/usePhoneNumbersModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/usePhoneNumbersModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { phoneNumbersModuleKeys } from "../query-keys"; -import type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations, PhoneNumbersModuleFilter, PhoneNumbersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PhoneNumbersModuleSelect, PhoneNumbersModuleWithRelations, PhoneNumbersModuleFilter, PhoneNumbersModuleOrderBy } from "../../orm/input-types"; +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 { phoneNumbersModuleKeys } from '../query-keys'; +import type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PhoneNumbersModuleSelect, + PhoneNumbersModuleWithRelations, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const phoneNumbersModulesQueryKey = phoneNumbersModuleKeys.list; /** * Query hook for fetching PhoneNumbersModule list - * + * * @example * ```tsx * const { data, isLoading } = usePhoneNumbersModulesQuery({ @@ -30,33 +45,58 @@ export const phoneNumbersModulesQueryKey = phoneNumbersModuleKeys.list; * }); * ``` */ -export function usePhoneNumbersModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PhoneNumbersModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePhoneNumbersModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePhoneNumbersModulesQuery< + S extends PhoneNumbersModuleSelect, + TData = { + phoneNumbersModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PhoneNumbersModuleSelect>; + } & Omit< + UseQueryOptions< + { + phoneNumbersModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePhoneNumbersModulesQuery( + params: { + selection: ListSelectionConfig< + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: phoneNumbersModuleKeys.list(args), queryFn: () => getClient().phoneNumbersModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PhoneNumbersModule list without React hooks - * + * * @example * ```ts * const data = await fetchPhoneNumbersModulesQuery({ @@ -70,35 +110,62 @@ export function usePhoneNumbersModulesQuery(params: { export async function fetchPhoneNumbersModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PhoneNumbersModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PhoneNumbersModuleSelect>; }): Promise<{ phoneNumbersModules: ConnectionResult>; }>; export async function fetchPhoneNumbersModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy + >(params.selection); return getClient().phoneNumbersModule.findMany(args).unwrap(); } /** * Prefetch PhoneNumbersModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchPhoneNumbersModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPhoneNumbersModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PhoneNumbersModuleSelect>; -}): Promise; -export async function prefetchPhoneNumbersModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPhoneNumbersModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PhoneNumbersModuleSelect>; + } +): Promise; +export async function prefetchPhoneNumbersModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: phoneNumbersModuleKeys.list(args), - queryFn: () => getClient().phoneNumbersModule.findMany(args).unwrap() + queryFn: () => getClient().phoneNumbersModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePlansModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePlansModuleQuery.ts index 24abe0e214..72ca725d60 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/usePlansModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/usePlansModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { plansModuleKeys } from "../query-keys"; -import type { PlansModuleSelect, PlansModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlansModuleSelect, PlansModuleWithRelations } from "../../orm/input-types"; +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 { plansModuleKeys } from '../query-keys'; +import type { PlansModuleSelect, PlansModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlansModuleSelect, PlansModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const plansModuleQueryKey = plansModuleKeys.detail; /** * Query hook for fetching a single PlansModule - * + * * @example * ```tsx * const { data, isLoading } = usePlansModuleQuery({ @@ -26,38 +26,52 @@ export const plansModuleQueryKey = plansModuleKeys.detail; * }); * ``` */ -export function usePlansModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlansModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlansModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function usePlansModuleQuery< + S extends PlansModuleSelect, + TData = { + plansModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlansModuleSelect>; + } & Omit< + UseQueryOptions< + { + plansModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlansModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: plansModuleKeys.detail(params.id), - queryFn: () => getClient().plansModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .plansModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single PlansModule without React hooks - * + * * @example * ```ts * const data = await fetchPlansModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchPlansModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().plansModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .plansModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single PlansModule for SSR or cache warming - * + * * @example * ```ts * await prefetchPlansModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchPlansModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PlansModuleSelect>; -}): Promise; -export async function prefetchPlansModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchPlansModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlansModuleSelect>; + } +): Promise; +export async function prefetchPlansModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: plansModuleKeys.detail(params.id), - queryFn: () => getClient().plansModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .plansModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePlansModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePlansModulesQuery.ts index 103e694b7a..ac940aedff 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/usePlansModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/usePlansModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { plansModuleKeys } from "../query-keys"; -import type { PlansModuleSelect, PlansModuleWithRelations, PlansModuleFilter, PlansModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { PlansModuleSelect, PlansModuleWithRelations, PlansModuleFilter, PlansModuleOrderBy } from "../../orm/input-types"; +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 { plansModuleKeys } from '../query-keys'; +import type { + PlansModuleSelect, + PlansModuleWithRelations, + PlansModuleFilter, + PlansModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlansModuleSelect, + PlansModuleWithRelations, + PlansModuleFilter, + PlansModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const plansModulesQueryKey = plansModuleKeys.list; /** * Query hook for fetching PlansModule list - * + * * @example * ```tsx * const { data, isLoading } = usePlansModulesQuery({ @@ -30,33 +45,47 @@ export const plansModulesQueryKey = plansModuleKeys.list; * }); * ``` */ -export function usePlansModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlansModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePlansModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function usePlansModulesQuery< + S extends PlansModuleSelect, + TData = { + plansModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlansModuleSelect>; + } & Omit< + UseQueryOptions< + { + plansModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlansModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: plansModuleKeys.list(args), queryFn: () => getClient().plansModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch PlansModule list without React hooks - * + * * @example * ```ts * const data = await fetchPlansModulesQuery({ @@ -70,35 +99,47 @@ export function usePlansModulesQuery(params: { export async function fetchPlansModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PlansModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, PlansModuleSelect>; }): Promise<{ plansModules: ConnectionResult>; }>; export async function fetchPlansModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().plansModule.findMany(args).unwrap(); } /** * Prefetch PlansModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchPlansModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchPlansModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PlansModuleSelect>; -}): Promise; -export async function prefetchPlansModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchPlansModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlansModuleSelect>; + } +): Promise; +export async function prefetchPlansModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: plansModuleKeys.list(args), - queryFn: () => getClient().plansModule.findMany(args).unwrap() + queryFn: () => getClient().plansModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModuleQuery.ts index 7a980b5205..d91f4a3ad2 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModuleQuery.ts @@ -4,20 +4,26 @@ * 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"; +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({ @@ -26,38 +32,52 @@ export const principalAuthModuleQueryKey = principalAuthModuleKeys.detail; * }); * ``` */ -export function usePrincipalAuthModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, PrincipalAuthModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrincipalAuthModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +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 ?? {}; + 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 + 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({ @@ -79,35 +99,46 @@ export async function fetchPrincipalAuthModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().principalAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + 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 { +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() + 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 index 728b82984b..bacae75203 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModulesQuery.ts @@ -4,20 +4,35 @@ * 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"; +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({ @@ -30,33 +45,58 @@ export const principalAuthModulesQueryKey = principalAuthModuleKeys.list; * }); * ``` */ -export function usePrincipalAuthModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, PrincipalAuthModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function usePrincipalAuthModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +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 + ...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({ @@ -70,35 +110,65 @@ export function usePrincipalAuthModulesQuery(params: { export async function fetchPrincipalAuthModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, PrincipalAuthModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrincipalAuthModuleSelect>; }): Promise<{ principalAuthModules: ConnectionResult>; }>; export async function fetchPrincipalAuthModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + 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, "fields"> & HookStrictSelect, PrincipalAuthModuleSelect>; -}): Promise; -export async function prefetchPrincipalAuthModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +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() + queryFn: () => getClient().principalAuthModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useProfilesModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useProfilesModuleQuery.ts index 1aa09d7cc3..84ca4805a0 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useProfilesModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useProfilesModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { profilesModuleKeys } from "../query-keys"; -import type { ProfilesModuleSelect, ProfilesModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ProfilesModuleSelect, ProfilesModuleWithRelations } from "../../orm/input-types"; +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 { profilesModuleKeys } from '../query-keys'; +import type { ProfilesModuleSelect, ProfilesModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ProfilesModuleSelect, ProfilesModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const profilesModuleQueryKey = profilesModuleKeys.detail; /** * Query hook for fetching a single ProfilesModule - * + * * @example * ```tsx * const { data, isLoading } = useProfilesModuleQuery({ @@ -26,38 +26,52 @@ export const profilesModuleQueryKey = profilesModuleKeys.detail; * }); * ``` */ -export function useProfilesModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ProfilesModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useProfilesModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useProfilesModuleQuery< + S extends ProfilesModuleSelect, + TData = { + profilesModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ProfilesModuleSelect>; + } & Omit< + UseQueryOptions< + { + profilesModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useProfilesModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: profilesModuleKeys.detail(params.id), - queryFn: () => getClient().profilesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .profilesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ProfilesModule without React hooks - * + * * @example * ```ts * const data = await fetchProfilesModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchProfilesModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().profilesModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .profilesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ProfilesModule for SSR or cache warming - * + * * @example * ```ts * await prefetchProfilesModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchProfilesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ProfilesModuleSelect>; -}): Promise; -export async function prefetchProfilesModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchProfilesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ProfilesModuleSelect>; + } +): Promise; +export async function prefetchProfilesModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: profilesModuleKeys.detail(params.id), - queryFn: () => getClient().profilesModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .profilesModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useProfilesModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useProfilesModulesQuery.ts index 7aad63052c..2d008ec0c7 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useProfilesModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useProfilesModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { profilesModuleKeys } from "../query-keys"; -import type { ProfilesModuleSelect, ProfilesModuleWithRelations, ProfilesModuleFilter, ProfilesModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ProfilesModuleSelect, ProfilesModuleWithRelations, ProfilesModuleFilter, ProfilesModuleOrderBy } from "../../orm/input-types"; +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 { profilesModuleKeys } from '../query-keys'; +import type { + ProfilesModuleSelect, + ProfilesModuleWithRelations, + ProfilesModuleFilter, + ProfilesModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ProfilesModuleSelect, + ProfilesModuleWithRelations, + ProfilesModuleFilter, + ProfilesModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const profilesModulesQueryKey = profilesModuleKeys.list; /** * Query hook for fetching ProfilesModule list - * + * * @example * ```tsx * const { data, isLoading } = useProfilesModulesQuery({ @@ -30,33 +45,53 @@ export const profilesModulesQueryKey = profilesModuleKeys.list; * }); * ``` */ -export function useProfilesModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ProfilesModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useProfilesModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useProfilesModulesQuery< + S extends ProfilesModuleSelect, + TData = { + profilesModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ProfilesModuleSelect>; + } & Omit< + UseQueryOptions< + { + profilesModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useProfilesModulesQuery( + params: { + selection: ListSelectionConfig< + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: profilesModuleKeys.list(args), queryFn: () => getClient().profilesModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ProfilesModule list without React hooks - * + * * @example * ```ts * const data = await fetchProfilesModulesQuery({ @@ -70,35 +105,55 @@ export function useProfilesModulesQuery(params: { export async function fetchProfilesModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ProfilesModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ProfilesModuleSelect>; }): Promise<{ profilesModules: ConnectionResult>; }>; export async function fetchProfilesModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy + >(params.selection); return getClient().profilesModule.findMany(args).unwrap(); } /** * Prefetch ProfilesModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchProfilesModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchProfilesModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ProfilesModuleSelect>; -}): Promise; -export async function prefetchProfilesModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchProfilesModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ProfilesModuleSelect>; + } +): Promise; +export async function prefetchProfilesModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: profilesModuleKeys.list(args), - queryFn: () => getClient().profilesModule.findMany(args).unwrap() + queryFn: () => getClient().profilesModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRateLimitMetersModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRateLimitMetersModuleQuery.ts index 0b3b2ffd38..8d0227109c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRateLimitMetersModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRateLimitMetersModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { rateLimitMetersModuleKeys } from "../query-keys"; -import type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations } from "../../orm/input-types"; +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 { rateLimitMetersModuleKeys } from '../query-keys'; +import type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const rateLimitMetersModuleQueryKey = rateLimitMetersModuleKeys.detail; /** * Query hook for fetching a single RateLimitMetersModule - * + * * @example * ```tsx * const { data, isLoading } = useRateLimitMetersModuleQuery({ @@ -26,38 +32,52 @@ export const rateLimitMetersModuleQueryKey = rateLimitMetersModuleKeys.detail; * }); * ``` */ -export function useRateLimitMetersModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RateLimitMetersModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRateLimitMetersModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRateLimitMetersModuleQuery< + S extends RateLimitMetersModuleSelect, + TData = { + rateLimitMetersModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RateLimitMetersModuleSelect>; + } & Omit< + UseQueryOptions< + { + rateLimitMetersModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRateLimitMetersModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: rateLimitMetersModuleKeys.detail(params.id), - queryFn: () => getClient().rateLimitMetersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .rateLimitMetersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single RateLimitMetersModule without React hooks - * + * * @example * ```ts * const data = await fetchRateLimitMetersModuleQuery({ @@ -66,7 +86,9 @@ export function useRateLimitMetersModuleQuery(params: { * }); * ``` */ -export async function fetchRateLimitMetersModuleQuery(params: { +export async function fetchRateLimitMetersModuleQuery< + S extends RateLimitMetersModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchRateLimitMetersModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().rateLimitMetersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .rateLimitMetersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single RateLimitMetersModule for SSR or cache warming - * + * * @example * ```ts * await prefetchRateLimitMetersModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRateLimitMetersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RateLimitMetersModuleSelect>; -}): Promise; -export async function prefetchRateLimitMetersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRateLimitMetersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RateLimitMetersModuleSelect>; + } +): Promise; +export async function prefetchRateLimitMetersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: rateLimitMetersModuleKeys.detail(params.id), - queryFn: () => getClient().rateLimitMetersModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .rateLimitMetersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRateLimitMetersModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRateLimitMetersModulesQuery.ts index bbb5845bc9..d1a7af040e 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRateLimitMetersModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRateLimitMetersModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { rateLimitMetersModuleKeys } from "../query-keys"; -import type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations, RateLimitMetersModuleFilter, RateLimitMetersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitMetersModuleSelect, RateLimitMetersModuleWithRelations, RateLimitMetersModuleFilter, RateLimitMetersModuleOrderBy } from "../../orm/input-types"; +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 { rateLimitMetersModuleKeys } from '../query-keys'; +import type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RateLimitMetersModuleSelect, + RateLimitMetersModuleWithRelations, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const rateLimitMetersModulesQueryKey = rateLimitMetersModuleKeys.list; /** * Query hook for fetching RateLimitMetersModule list - * + * * @example * ```tsx * const { data, isLoading } = useRateLimitMetersModulesQuery({ @@ -30,33 +45,60 @@ export const rateLimitMetersModulesQueryKey = rateLimitMetersModuleKeys.list; * }); * ``` */ -export function useRateLimitMetersModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RateLimitMetersModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRateLimitMetersModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRateLimitMetersModulesQuery< + S extends RateLimitMetersModuleSelect, + TData = { + rateLimitMetersModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, RateLimitMetersModuleSelect>; + } & Omit< + UseQueryOptions< + { + rateLimitMetersModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRateLimitMetersModulesQuery( + params: { + selection: ListSelectionConfig< + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: rateLimitMetersModuleKeys.list(args), queryFn: () => getClient().rateLimitMetersModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch RateLimitMetersModule list without React hooks - * + * * @example * ```ts * const data = await fetchRateLimitMetersModulesQuery({ @@ -67,38 +109,72 @@ export function useRateLimitMetersModulesQuery(params: { * }); * ``` */ -export async function fetchRateLimitMetersModulesQuery(params: { +export async function fetchRateLimitMetersModulesQuery< + S extends RateLimitMetersModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RateLimitMetersModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, RateLimitMetersModuleSelect>; }): Promise<{ - rateLimitMetersModules: ConnectionResult>; + rateLimitMetersModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchRateLimitMetersModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy + >(params.selection); return getClient().rateLimitMetersModule.findMany(args).unwrap(); } /** * Prefetch RateLimitMetersModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchRateLimitMetersModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRateLimitMetersModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RateLimitMetersModuleSelect>; -}): Promise; -export async function prefetchRateLimitMetersModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRateLimitMetersModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, RateLimitMetersModuleSelect>; + } +): Promise; +export async function prefetchRateLimitMetersModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: rateLimitMetersModuleKeys.list(args), - queryFn: () => getClient().rateLimitMetersModule.findMany(args).unwrap() + queryFn: () => getClient().rateLimitMetersModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRateLimitsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRateLimitsModuleQuery.ts index e7a01daaf6..90ebc34583 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRateLimitsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRateLimitsModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { rateLimitsModuleKeys } from "../query-keys"; -import type { RateLimitsModuleSelect, RateLimitsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitsModuleSelect, RateLimitsModuleWithRelations } from "../../orm/input-types"; +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 { rateLimitsModuleKeys } from '../query-keys'; +import type { RateLimitsModuleSelect, RateLimitsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RateLimitsModuleSelect, RateLimitsModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const rateLimitsModuleQueryKey = rateLimitsModuleKeys.detail; /** * Query hook for fetching a single RateLimitsModule - * + * * @example * ```tsx * const { data, isLoading } = useRateLimitsModuleQuery({ @@ -26,38 +26,52 @@ export const rateLimitsModuleQueryKey = rateLimitsModuleKeys.detail; * }); * ``` */ -export function useRateLimitsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RateLimitsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRateLimitsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRateLimitsModuleQuery< + S extends RateLimitsModuleSelect, + TData = { + rateLimitsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RateLimitsModuleSelect>; + } & Omit< + UseQueryOptions< + { + rateLimitsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRateLimitsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: rateLimitsModuleKeys.detail(params.id), - queryFn: () => getClient().rateLimitsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .rateLimitsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single RateLimitsModule without React hooks - * + * * @example * ```ts * const data = await fetchRateLimitsModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchRateLimitsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().rateLimitsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .rateLimitsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single RateLimitsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchRateLimitsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRateLimitsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RateLimitsModuleSelect>; -}): Promise; -export async function prefetchRateLimitsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRateLimitsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RateLimitsModuleSelect>; + } +): Promise; +export async function prefetchRateLimitsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: rateLimitsModuleKeys.detail(params.id), - queryFn: () => getClient().rateLimitsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .rateLimitsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRateLimitsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRateLimitsModulesQuery.ts index adb7f28eb1..5e6814ed3c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRateLimitsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRateLimitsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { rateLimitsModuleKeys } from "../query-keys"; -import type { RateLimitsModuleSelect, RateLimitsModuleWithRelations, RateLimitsModuleFilter, RateLimitsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RateLimitsModuleSelect, RateLimitsModuleWithRelations, RateLimitsModuleFilter, RateLimitsModuleOrderBy } from "../../orm/input-types"; +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 { rateLimitsModuleKeys } from '../query-keys'; +import type { + RateLimitsModuleSelect, + RateLimitsModuleWithRelations, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RateLimitsModuleSelect, + RateLimitsModuleWithRelations, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const rateLimitsModulesQueryKey = rateLimitsModuleKeys.list; /** * Query hook for fetching RateLimitsModule list - * + * * @example * ```tsx * const { data, isLoading } = useRateLimitsModulesQuery({ @@ -30,33 +45,53 @@ export const rateLimitsModulesQueryKey = rateLimitsModuleKeys.list; * }); * ``` */ -export function useRateLimitsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RateLimitsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRateLimitsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRateLimitsModulesQuery< + S extends RateLimitsModuleSelect, + TData = { + rateLimitsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RateLimitsModuleSelect>; + } & Omit< + UseQueryOptions< + { + rateLimitsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRateLimitsModulesQuery( + params: { + selection: ListSelectionConfig< + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: rateLimitsModuleKeys.list(args), queryFn: () => getClient().rateLimitsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch RateLimitsModule list without React hooks - * + * * @example * ```ts * const data = await fetchRateLimitsModulesQuery({ @@ -70,35 +105,59 @@ export function useRateLimitsModulesQuery(params: { export async function fetchRateLimitsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RateLimitsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RateLimitsModuleSelect>; }): Promise<{ rateLimitsModules: ConnectionResult>; }>; export async function fetchRateLimitsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy + >(params.selection); return getClient().rateLimitsModule.findMany(args).unwrap(); } /** * Prefetch RateLimitsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchRateLimitsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRateLimitsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RateLimitsModuleSelect>; -}): Promise; -export async function prefetchRateLimitsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRateLimitsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RateLimitsModuleSelect>; + } +): Promise; +export async function prefetchRateLimitsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: rateLimitsModuleKeys.list(args), - queryFn: () => getClient().rateLimitsModule.findMany(args).unwrap() + queryFn: () => getClient().rateLimitsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRealtimeModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRealtimeModuleQuery.ts index 08a172e8b7..153a24dbbb 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRealtimeModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRealtimeModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { realtimeModuleKeys } from "../query-keys"; -import type { RealtimeModuleSelect, RealtimeModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RealtimeModuleSelect, RealtimeModuleWithRelations } from "../../orm/input-types"; +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 { realtimeModuleKeys } from '../query-keys'; +import type { RealtimeModuleSelect, RealtimeModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RealtimeModuleSelect, RealtimeModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const realtimeModuleQueryKey = realtimeModuleKeys.detail; /** * Query hook for fetching a single RealtimeModule - * + * * @example * ```tsx * const { data, isLoading } = useRealtimeModuleQuery({ @@ -26,38 +26,52 @@ export const realtimeModuleQueryKey = realtimeModuleKeys.detail; * }); * ``` */ -export function useRealtimeModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RealtimeModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRealtimeModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRealtimeModuleQuery< + S extends RealtimeModuleSelect, + TData = { + realtimeModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RealtimeModuleSelect>; + } & Omit< + UseQueryOptions< + { + realtimeModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRealtimeModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: realtimeModuleKeys.detail(params.id), - queryFn: () => getClient().realtimeModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .realtimeModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single RealtimeModule without React hooks - * + * * @example * ```ts * const data = await fetchRealtimeModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchRealtimeModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().realtimeModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .realtimeModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single RealtimeModule for SSR or cache warming - * + * * @example * ```ts * await prefetchRealtimeModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRealtimeModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RealtimeModuleSelect>; -}): Promise; -export async function prefetchRealtimeModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRealtimeModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RealtimeModuleSelect>; + } +): Promise; +export async function prefetchRealtimeModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: realtimeModuleKeys.detail(params.id), - queryFn: () => getClient().realtimeModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .realtimeModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRealtimeModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRealtimeModulesQuery.ts index 550085bee7..6619bc9054 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRealtimeModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRealtimeModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { realtimeModuleKeys } from "../query-keys"; -import type { RealtimeModuleSelect, RealtimeModuleWithRelations, RealtimeModuleFilter, RealtimeModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RealtimeModuleSelect, RealtimeModuleWithRelations, RealtimeModuleFilter, RealtimeModuleOrderBy } from "../../orm/input-types"; +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 { realtimeModuleKeys } from '../query-keys'; +import type { + RealtimeModuleSelect, + RealtimeModuleWithRelations, + RealtimeModuleFilter, + RealtimeModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RealtimeModuleSelect, + RealtimeModuleWithRelations, + RealtimeModuleFilter, + RealtimeModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const realtimeModulesQueryKey = realtimeModuleKeys.list; /** * Query hook for fetching RealtimeModule list - * + * * @example * ```tsx * const { data, isLoading } = useRealtimeModulesQuery({ @@ -30,33 +45,53 @@ export const realtimeModulesQueryKey = realtimeModuleKeys.list; * }); * ``` */ -export function useRealtimeModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RealtimeModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRealtimeModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRealtimeModulesQuery< + S extends RealtimeModuleSelect, + TData = { + realtimeModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RealtimeModuleSelect>; + } & Omit< + UseQueryOptions< + { + realtimeModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRealtimeModulesQuery( + params: { + selection: ListSelectionConfig< + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: realtimeModuleKeys.list(args), queryFn: () => getClient().realtimeModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch RealtimeModule list without React hooks - * + * * @example * ```ts * const data = await fetchRealtimeModulesQuery({ @@ -70,35 +105,55 @@ export function useRealtimeModulesQuery(params: { export async function fetchRealtimeModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RealtimeModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RealtimeModuleSelect>; }): Promise<{ realtimeModules: ConnectionResult>; }>; export async function fetchRealtimeModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy + >(params.selection); return getClient().realtimeModule.findMany(args).unwrap(); } /** * Prefetch RealtimeModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchRealtimeModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRealtimeModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RealtimeModuleSelect>; -}): Promise; -export async function prefetchRealtimeModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRealtimeModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RealtimeModuleSelect>; + } +): Promise; +export async function prefetchRealtimeModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: realtimeModuleKeys.list(args), - queryFn: () => getClient().realtimeModule.findMany(args).unwrap() + queryFn: () => getClient().realtimeModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRelationProvisionQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRelationProvisionQuery.ts index d908f0c198..c0c060af92 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRelationProvisionQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRelationProvisionQuery.ts @@ -11,15 +11,21 @@ * 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 { relationProvisionKeys } from "../query-keys"; -import type { RelationProvisionSelect, RelationProvisionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RelationProvisionSelect, RelationProvisionWithRelations } from "../../orm/input-types"; +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 { relationProvisionKeys } from '../query-keys'; +import type { + RelationProvisionSelect, + RelationProvisionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + RelationProvisionSelect, + RelationProvisionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const relationProvisionQueryKey = relationProvisionKeys.detail; /** @@ -40,33 +46,47 @@ export const relationProvisionQueryKey = relationProvisionKeys.detail; * }); * ``` */ -export function useRelationProvisionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RelationProvisionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRelationProvisionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRelationProvisionQuery< + S extends RelationProvisionSelect, + TData = { + relationProvision: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RelationProvisionSelect>; + } & Omit< + UseQueryOptions< + { + relationProvision: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRelationProvisionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: relationProvisionKeys.detail(params.id), - queryFn: () => getClient().relationProvision.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .relationProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** @@ -100,10 +120,12 @@ export async function fetchRelationProvisionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().relationProvision.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .relationProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Provisions relational structure between tables. Supports four relation types: @@ -120,22 +142,31 @@ export async function fetchRelationProvisionQuery(params: { * await prefetchRelationProvisionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRelationProvisionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RelationProvisionSelect>; -}): Promise; -export async function prefetchRelationProvisionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRelationProvisionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RelationProvisionSelect>; + } +): Promise; +export async function prefetchRelationProvisionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: relationProvisionKeys.detail(params.id), - queryFn: () => getClient().relationProvision.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .relationProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRelationProvisionsQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRelationProvisionsQuery.ts index c6e509de47..74da85397b 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRelationProvisionsQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRelationProvisionsQuery.ts @@ -11,15 +11,30 @@ * 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 { relationProvisionKeys } from "../query-keys"; -import type { RelationProvisionSelect, RelationProvisionWithRelations, RelationProvisionFilter, RelationProvisionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RelationProvisionSelect, RelationProvisionWithRelations, RelationProvisionFilter, RelationProvisionOrderBy } from "../../orm/input-types"; +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 { relationProvisionKeys } from '../query-keys'; +import type { + RelationProvisionSelect, + RelationProvisionWithRelations, + RelationProvisionFilter, + RelationProvisionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RelationProvisionSelect, + RelationProvisionWithRelations, + RelationProvisionFilter, + RelationProvisionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const relationProvisionsQueryKey = relationProvisionKeys.list; /** @@ -44,28 +59,48 @@ export const relationProvisionsQueryKey = relationProvisionKeys.list; * }); * ``` */ -export function useRelationProvisionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RelationProvisionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRelationProvisionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRelationProvisionsQuery< + S extends RelationProvisionSelect, + TData = { + relationProvisions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RelationProvisionSelect>; + } & Omit< + UseQueryOptions< + { + relationProvisions: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRelationProvisionsQuery( + params: { + selection: ListSelectionConfig< + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: relationProvisionKeys.list(args), queryFn: () => getClient().relationProvision.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** @@ -91,14 +126,23 @@ export function useRelationProvisionsQuery(params: { export async function fetchRelationProvisionsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RelationProvisionSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RelationProvisionSelect>; }): Promise<{ relationProvisions: ConnectionResult>; }>; export async function fetchRelationProvisionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy + >(params.selection); return getClient().relationProvision.findMany(args).unwrap(); } /** @@ -116,17 +160,32 @@ export async function fetchRelationProvisionsQuery(params: { * await prefetchRelationProvisionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRelationProvisionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RelationProvisionSelect>; -}): Promise; -export async function prefetchRelationProvisionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRelationProvisionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RelationProvisionSelect>; + } +): Promise; +export async function prefetchRelationProvisionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: relationProvisionKeys.list(args), - queryFn: () => getClient().relationProvision.findMany(args).unwrap() + queryFn: () => getClient().relationProvision.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useResolveBlueprintFieldQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useResolveBlueprintFieldQuery.ts index 92d77d3602..3584b7d36a 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useResolveBlueprintFieldQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useResolveBlueprintFieldQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { ResolveBlueprintFieldVariables } from "../../orm/query"; -export type { ResolveBlueprintFieldVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { ResolveBlueprintFieldVariables } from '../../orm/query'; +export type { ResolveBlueprintFieldVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const resolveBlueprintFieldQueryKey = customQueryKeys.resolveBlueprintField; /** * 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. - * + * * @example * ```tsx * const { data, isLoading } = useResolveBlueprintFieldQuery({ variables: { databaseId, fieldName, tableId } }); - * + * * if (data?.resolveBlueprintField) { * console.log(data.resolveBlueprintField); * } * ``` */ -export function useResolveBlueprintFieldQuery(params?: { - variables?: ResolveBlueprintFieldVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useResolveBlueprintFieldQuery(params?: { - variables?: ResolveBlueprintFieldVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useResolveBlueprintFieldQuery< + TData = { + resolveBlueprintField: string | null; + }, +>( + params?: { + variables?: ResolveBlueprintFieldVariables; + } & Omit< + UseQueryOptions< + { + resolveBlueprintField: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResolveBlueprintFieldQuery< + TData = { + resolveBlueprintField: string | null; + }, +>( + params?: { + variables?: ResolveBlueprintFieldVariables; + } & Omit< + UseQueryOptions< + { + resolveBlueprintField: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: resolveBlueprintFieldQueryKey(variables), queryFn: () => getClient().query.resolveBlueprintField(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch resolveBlueprintField without React hooks - * + * * @example * ```ts * const data = await fetchResolveBlueprintFieldQuery({ variables: { databaseId, fieldName, tableId } }); @@ -68,18 +87,21 @@ export async function fetchResolveBlueprintFieldQuery(params?: { } /** * Prefetch resolveBlueprintField for SSR or cache warming - * + * * @example * ```ts * await prefetchResolveBlueprintFieldQuery(queryClient, { variables: { databaseId, fieldName, tableId } }); * ``` */ -export async function prefetchResolveBlueprintFieldQuery(queryClient: QueryClient, params?: { - variables?: ResolveBlueprintFieldVariables; -}): Promise { +export async function prefetchResolveBlueprintFieldQuery( + queryClient: QueryClient, + params?: { + variables?: ResolveBlueprintFieldVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: resolveBlueprintFieldQueryKey(variables), - queryFn: () => getClient().query.resolveBlueprintField(variables).unwrap() + queryFn: () => getClient().query.resolveBlueprintField(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useResolveBlueprintTableQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useResolveBlueprintTableQuery.ts index f9ba2cd217..906033d06c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useResolveBlueprintTableQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useResolveBlueprintTableQuery.ts @@ -4,57 +4,76 @@ * DO NOT EDIT - changes will be overwritten */ -import { useQuery } from "@tanstack/react-query"; -import type { UseQueryOptions, UseQueryResult, QueryClient } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customQueryKeys } from "../query-keys"; -import type { ResolveBlueprintTableVariables } from "../../orm/query"; -export type { ResolveBlueprintTableVariables } from "../../orm/query"; +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { ResolveBlueprintTableVariables } from '../../orm/query'; +export type { ResolveBlueprintTableVariables } from '../../orm/query'; /** Query key factory - re-exported from query-keys.ts */ export const resolveBlueprintTableQueryKey = customQueryKeys.resolveBlueprintTable; /** * 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. - * + * * @example * ```tsx * const { data, isLoading } = useResolveBlueprintTableQuery({ variables: { databaseId, defaultSchemaId, schemaName, tableMap, tableName } }); - * + * * if (data?.resolveBlueprintTable) { * console.log(data.resolveBlueprintTable); * } * ``` */ -export function useResolveBlueprintTableQuery(params?: { - variables?: ResolveBlueprintTableVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult; -export function useResolveBlueprintTableQuery(params?: { - variables?: ResolveBlueprintTableVariables; -} & Omit, "queryKey" | "queryFn">): UseQueryResult { +export function useResolveBlueprintTableQuery< + TData = { + resolveBlueprintTable: string | null; + }, +>( + params?: { + variables?: ResolveBlueprintTableVariables; + } & Omit< + UseQueryOptions< + { + resolveBlueprintTable: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResolveBlueprintTableQuery< + TData = { + resolveBlueprintTable: string | null; + }, +>( + params?: { + variables?: ResolveBlueprintTableVariables; + } & Omit< + UseQueryOptions< + { + resolveBlueprintTable: string | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { const variables = params?.variables ?? {}; - const { - variables: _variables, - ...queryOptions - } = params ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; void _variables; return useQuery({ queryKey: resolveBlueprintTableQueryKey(variables), queryFn: () => getClient().query.resolveBlueprintTable(variables).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch resolveBlueprintTable without React hooks - * + * * @example * ```ts * const data = await fetchResolveBlueprintTableQuery({ variables: { databaseId, defaultSchemaId, schemaName, tableMap, tableName } }); @@ -68,18 +87,21 @@ export async function fetchResolveBlueprintTableQuery(params?: { } /** * Prefetch resolveBlueprintTable for SSR or cache warming - * + * * @example * ```ts * await prefetchResolveBlueprintTableQuery(queryClient, { variables: { databaseId, defaultSchemaId, schemaName, tableMap, tableName } }); * ``` */ -export async function prefetchResolveBlueprintTableQuery(queryClient: QueryClient, params?: { - variables?: ResolveBlueprintTableVariables; -}): Promise { +export async function prefetchResolveBlueprintTableQuery( + queryClient: QueryClient, + params?: { + variables?: ResolveBlueprintTableVariables; + } +): Promise { const variables = params?.variables ?? {}; await queryClient.prefetchQuery({ queryKey: resolveBlueprintTableQueryKey(variables), - queryFn: () => getClient().query.resolveBlueprintTable(variables).unwrap() + queryFn: () => getClient().query.resolveBlueprintTable(variables).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useResourceModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useResourceModuleQuery.ts index 592eaf2b6c..92a01be019 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useResourceModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useResourceModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { resourceModuleKeys } from "../query-keys"; -import type { ResourceModuleSelect, ResourceModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceModuleSelect, ResourceModuleWithRelations } from "../../orm/input-types"; +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 { resourceModuleKeys } from '../query-keys'; +import type { ResourceModuleSelect, ResourceModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ResourceModuleSelect, ResourceModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceModuleQueryKey = resourceModuleKeys.detail; /** * Query hook for fetching a single ResourceModule - * + * * @example * ```tsx * const { data, isLoading } = useResourceModuleQuery({ @@ -26,38 +26,52 @@ export const resourceModuleQueryKey = resourceModuleKeys.detail; * }); * ``` */ -export function useResourceModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useResourceModuleQuery< + S extends ResourceModuleSelect, + TData = { + resourceModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceModuleSelect>; + } & Omit< + UseQueryOptions< + { + resourceModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceModuleKeys.detail(params.id), - queryFn: () => getClient().resourceModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .resourceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single ResourceModule without React hooks - * + * * @example * ```ts * const data = await fetchResourceModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchResourceModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().resourceModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .resourceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single ResourceModule for SSR or cache warming - * + * * @example * ```ts * await prefetchResourceModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchResourceModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ResourceModuleSelect>; -}): Promise; -export async function prefetchResourceModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchResourceModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ResourceModuleSelect>; + } +): Promise; +export async function prefetchResourceModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: resourceModuleKeys.detail(params.id), - queryFn: () => getClient().resourceModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .resourceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useResourceModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useResourceModulesQuery.ts index 2f0722f51f..c9728398e1 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useResourceModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useResourceModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { resourceModuleKeys } from "../query-keys"; -import type { ResourceModuleSelect, ResourceModuleWithRelations, ResourceModuleFilter, ResourceModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ResourceModuleSelect, ResourceModuleWithRelations, ResourceModuleFilter, ResourceModuleOrderBy } from "../../orm/input-types"; +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 { resourceModuleKeys } from '../query-keys'; +import type { + ResourceModuleSelect, + ResourceModuleWithRelations, + ResourceModuleFilter, + ResourceModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ResourceModuleSelect, + ResourceModuleWithRelations, + ResourceModuleFilter, + ResourceModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const resourceModulesQueryKey = resourceModuleKeys.list; /** * Query hook for fetching ResourceModule list - * + * * @example * ```tsx * const { data, isLoading } = useResourceModulesQuery({ @@ -30,33 +45,53 @@ export const resourceModulesQueryKey = resourceModuleKeys.list; * }); * ``` */ -export function useResourceModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useResourceModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useResourceModulesQuery< + S extends ResourceModuleSelect, + TData = { + resourceModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourceModuleSelect>; + } & Omit< + UseQueryOptions< + { + resourceModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useResourceModulesQuery( + params: { + selection: ListSelectionConfig< + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: resourceModuleKeys.list(args), queryFn: () => getClient().resourceModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch ResourceModule list without React hooks - * + * * @example * ```ts * const data = await fetchResourceModulesQuery({ @@ -70,35 +105,55 @@ export function useResourceModulesQuery(params: { export async function fetchResourceModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ResourceModuleSelect>; }): Promise<{ resourceModules: ConnectionResult>; }>; export async function fetchResourceModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy + >(params.selection); return getClient().resourceModule.findMany(args).unwrap(); } /** * Prefetch ResourceModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchResourceModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchResourceModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ResourceModuleSelect>; -}): Promise; -export async function prefetchResourceModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchResourceModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ResourceModuleSelect>; + } +): Promise; +export async function prefetchResourceModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: resourceModuleKeys.list(args), - queryFn: () => getClient().resourceModule.findMany(args).unwrap() + queryFn: () => getClient().resourceModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRlsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRlsModuleQuery.ts index 96e4af3e48..8ea9892d58 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRlsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRlsModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { rlsModuleKeys } from "../query-keys"; -import type { RlsModuleSelect, RlsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsModuleSelect, RlsModuleWithRelations } from "../../orm/input-types"; +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 { rlsModuleKeys } from '../query-keys'; +import type { RlsModuleSelect, RlsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RlsModuleSelect, RlsModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const rlsModuleQueryKey = rlsModuleKeys.detail; /** * Query hook for fetching a single RlsModule - * + * * @example * ```tsx * const { data, isLoading } = useRlsModuleQuery({ @@ -26,38 +26,52 @@ export const rlsModuleQueryKey = rlsModuleKeys.detail; * }); * ``` */ -export function useRlsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RlsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRlsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRlsModuleQuery< + S extends RlsModuleSelect, + TData = { + rlsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RlsModuleSelect>; + } & Omit< + UseQueryOptions< + { + rlsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRlsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: rlsModuleKeys.detail(params.id), - queryFn: () => getClient().rlsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .rlsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single RlsModule without React hooks - * + * * @example * ```ts * const data = await fetchRlsModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchRlsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().rlsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .rlsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single RlsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchRlsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRlsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RlsModuleSelect>; -}): Promise; -export async function prefetchRlsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRlsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RlsModuleSelect>; + } +): Promise; +export async function prefetchRlsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: rlsModuleKeys.detail(params.id), - queryFn: () => getClient().rlsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .rlsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRlsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRlsModulesQuery.ts index 759bfc0fd2..7fb53b5bd8 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRlsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRlsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { rlsModuleKeys } from "../query-keys"; -import type { RlsModuleSelect, RlsModuleWithRelations, RlsModuleFilter, RlsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RlsModuleSelect, RlsModuleWithRelations, RlsModuleFilter, RlsModuleOrderBy } from "../../orm/input-types"; +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 { rlsModuleKeys } from '../query-keys'; +import type { + RlsModuleSelect, + RlsModuleWithRelations, + RlsModuleFilter, + RlsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RlsModuleSelect, + RlsModuleWithRelations, + RlsModuleFilter, + RlsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const rlsModulesQueryKey = rlsModuleKeys.list; /** * Query hook for fetching RlsModule list - * + * * @example * ```tsx * const { data, isLoading } = useRlsModulesQuery({ @@ -30,33 +45,47 @@ export const rlsModulesQueryKey = rlsModuleKeys.list; * }); * ``` */ -export function useRlsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RlsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRlsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRlsModulesQuery< + S extends RlsModuleSelect, + TData = { + rlsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RlsModuleSelect>; + } & Omit< + UseQueryOptions< + { + rlsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRlsModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: rlsModuleKeys.list(args), queryFn: () => getClient().rlsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch RlsModule list without React hooks - * + * * @example * ```ts * const data = await fetchRlsModulesQuery({ @@ -70,35 +99,47 @@ export function useRlsModulesQuery(params: { export async function fetchRlsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RlsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RlsModuleSelect>; }): Promise<{ rlsModules: ConnectionResult>; }>; export async function fetchRlsModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().rlsModule.findMany(args).unwrap(); } /** * Prefetch RlsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchRlsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRlsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RlsModuleSelect>; -}): Promise; -export async function prefetchRlsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRlsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RlsModuleSelect>; + } +): Promise; +export async function prefetchRlsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: rlsModuleKeys.list(args), - queryFn: () => getClient().rlsModule.findMany(args).unwrap() + queryFn: () => getClient().rlsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRouteModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRouteModuleQuery.ts index 60406dfecd..c8786c2316 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRouteModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRouteModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { routeModuleKeys } from "../query-keys"; -import type { RouteModuleSelect, RouteModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteModuleSelect, RouteModuleWithRelations } from "../../orm/input-types"; +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 { routeModuleKeys } from '../query-keys'; +import type { RouteModuleSelect, RouteModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RouteModuleSelect, RouteModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const routeModuleQueryKey = routeModuleKeys.detail; /** * Query hook for fetching a single RouteModule - * + * * @example * ```tsx * const { data, isLoading } = useRouteModuleQuery({ @@ -26,38 +26,52 @@ export const routeModuleQueryKey = routeModuleKeys.detail; * }); * ``` */ -export function useRouteModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RouteModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRouteModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRouteModuleQuery< + S extends RouteModuleSelect, + TData = { + routeModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RouteModuleSelect>; + } & Omit< + UseQueryOptions< + { + routeModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRouteModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: routeModuleKeys.detail(params.id), - queryFn: () => getClient().routeModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .routeModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single RouteModule without React hooks - * + * * @example * ```ts * const data = await fetchRouteModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchRouteModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().routeModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .routeModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single RouteModule for SSR or cache warming - * + * * @example * ```ts * await prefetchRouteModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRouteModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RouteModuleSelect>; -}): Promise; -export async function prefetchRouteModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRouteModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RouteModuleSelect>; + } +): Promise; +export async function prefetchRouteModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: routeModuleKeys.detail(params.id), - queryFn: () => getClient().routeModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .routeModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useRouteModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useRouteModulesQuery.ts index 5d3bd4b45c..fe5304810c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useRouteModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useRouteModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { routeModuleKeys } from "../query-keys"; -import type { RouteModuleSelect, RouteModuleWithRelations, RouteModuleFilter, RouteModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RouteModuleSelect, RouteModuleWithRelations, RouteModuleFilter, RouteModuleOrderBy } from "../../orm/input-types"; +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 { routeModuleKeys } from '../query-keys'; +import type { + RouteModuleSelect, + RouteModuleWithRelations, + RouteModuleFilter, + RouteModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + RouteModuleSelect, + RouteModuleWithRelations, + RouteModuleFilter, + RouteModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const routeModulesQueryKey = routeModuleKeys.list; /** * Query hook for fetching RouteModule list - * + * * @example * ```tsx * const { data, isLoading } = useRouteModulesQuery({ @@ -30,33 +45,47 @@ export const routeModulesQueryKey = routeModuleKeys.list; * }); * ``` */ -export function useRouteModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRouteModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useRouteModulesQuery< + S extends RouteModuleSelect, + TData = { + routeModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RouteModuleSelect>; + } & Omit< + UseQueryOptions< + { + routeModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRouteModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: routeModuleKeys.list(args), queryFn: () => getClient().routeModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch RouteModule list without React hooks - * + * * @example * ```ts * const data = await fetchRouteModulesQuery({ @@ -70,35 +99,47 @@ export function useRouteModulesQuery(params: { export async function fetchRouteModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RouteModuleSelect>; }): Promise<{ routeModules: ConnectionResult>; }>; export async function fetchRouteModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().routeModule.findMany(args).unwrap(); } /** * Prefetch RouteModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchRouteModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRouteModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RouteModuleSelect>; -}): Promise; -export async function prefetchRouteModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchRouteModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RouteModuleSelect>; + } +): Promise; +export async function prefetchRouteModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: routeModuleKeys.list(args), - queryFn: () => getClient().routeModule.findMany(args).unwrap() + queryFn: () => getClient().routeModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useSecureTableProvisionQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useSecureTableProvisionQuery.ts index e66d44f64b..53e81e59e2 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useSecureTableProvisionQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useSecureTableProvisionQuery.ts @@ -4,20 +4,26 @@ * 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 { secureTableProvisionKeys } from "../query-keys"; -import type { SecureTableProvisionSelect, SecureTableProvisionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SecureTableProvisionSelect, SecureTableProvisionWithRelations } from "../../orm/input-types"; +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 { secureTableProvisionKeys } from '../query-keys'; +import type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const secureTableProvisionQueryKey = secureTableProvisionKeys.detail; /** * 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. - * + * * @example * ```tsx * const { data, isLoading } = useSecureTableProvisionQuery({ @@ -26,38 +32,52 @@ export const secureTableProvisionQueryKey = secureTableProvisionKeys.detail; * }); * ``` */ -export function useSecureTableProvisionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SecureTableProvisionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSecureTableProvisionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSecureTableProvisionQuery< + S extends SecureTableProvisionSelect, + TData = { + secureTableProvision: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SecureTableProvisionSelect>; + } & Omit< + UseQueryOptions< + { + secureTableProvision: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSecureTableProvisionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: secureTableProvisionKeys.detail(params.id), - queryFn: () => getClient().secureTableProvision.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .secureTableProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * 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. - * + * * @example * ```ts * const data = await fetchSecureTableProvisionQuery({ @@ -79,35 +99,46 @@ export async function fetchSecureTableProvisionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().secureTableProvision.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .secureTableProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * 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. - * + * * @example * ```ts * await prefetchSecureTableProvisionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSecureTableProvisionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SecureTableProvisionSelect>; -}): Promise; -export async function prefetchSecureTableProvisionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSecureTableProvisionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SecureTableProvisionSelect>; + } +): Promise; +export async function prefetchSecureTableProvisionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: secureTableProvisionKeys.detail(params.id), - queryFn: () => getClient().secureTableProvision.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .secureTableProvision.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useSecureTableProvisionsQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useSecureTableProvisionsQuery.ts index 10ca569417..8b1d026dd0 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useSecureTableProvisionsQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useSecureTableProvisionsQuery.ts @@ -4,20 +4,35 @@ * 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 { secureTableProvisionKeys } from "../query-keys"; -import type { SecureTableProvisionSelect, SecureTableProvisionWithRelations, SecureTableProvisionFilter, SecureTableProvisionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SecureTableProvisionSelect, SecureTableProvisionWithRelations, SecureTableProvisionFilter, SecureTableProvisionOrderBy } from "../../orm/input-types"; +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 { secureTableProvisionKeys } from '../query-keys'; +import type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SecureTableProvisionSelect, + SecureTableProvisionWithRelations, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const secureTableProvisionsQueryKey = secureTableProvisionKeys.list; /** * 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. - * + * * @example * ```tsx * const { data, isLoading } = useSecureTableProvisionsQuery({ @@ -30,33 +45,60 @@ export const secureTableProvisionsQueryKey = secureTableProvisionKeys.list; * }); * ``` */ -export function useSecureTableProvisionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SecureTableProvisionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSecureTableProvisionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSecureTableProvisionsQuery< + S extends SecureTableProvisionSelect, + TData = { + secureTableProvisions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, SecureTableProvisionSelect>; + } & Omit< + UseQueryOptions< + { + secureTableProvisions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSecureTableProvisionsQuery( + params: { + selection: ListSelectionConfig< + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: secureTableProvisionKeys.list(args), queryFn: () => getClient().secureTableProvision.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * 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. - * + * * @example * ```ts * const data = await fetchSecureTableProvisionsQuery({ @@ -67,38 +109,70 @@ export function useSecureTableProvisionsQuery(params: { * }); * ``` */ -export async function fetchSecureTableProvisionsQuery(params: { +export async function fetchSecureTableProvisionsQuery< + S extends SecureTableProvisionSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SecureTableProvisionSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, SecureTableProvisionSelect>; }): Promise<{ secureTableProvisions: ConnectionResult>; }>; export async function fetchSecureTableProvisionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy + >(params.selection); return getClient().secureTableProvision.findMany(args).unwrap(); } /** * 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. - * + * * @example * ```ts * await prefetchSecureTableProvisionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSecureTableProvisionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SecureTableProvisionSelect>; -}): Promise; -export async function prefetchSecureTableProvisionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSecureTableProvisionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, SecureTableProvisionSelect>; + } +): Promise; +export async function prefetchSecureTableProvisionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: secureTableProvisionKeys.list(args), - queryFn: () => getClient().secureTableProvision.findMany(args).unwrap() + queryFn: () => getClient().secureTableProvision.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useSessionSecretsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useSessionSecretsModuleQuery.ts index cf4ac11a4c..76ffb4f90a 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useSessionSecretsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useSessionSecretsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { sessionSecretsModuleKeys } from "../query-keys"; -import type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations } from "../../orm/input-types"; +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 { sessionSecretsModuleKeys } from '../query-keys'; +import type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const sessionSecretsModuleQueryKey = sessionSecretsModuleKeys.detail; /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```tsx * const { data, isLoading } = useSessionSecretsModuleQuery({ @@ -26,38 +32,52 @@ export const sessionSecretsModuleQueryKey = sessionSecretsModuleKeys.detail; * }); * ``` */ -export function useSessionSecretsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SessionSecretsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSessionSecretsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSessionSecretsModuleQuery< + S extends SessionSecretsModuleSelect, + TData = { + sessionSecretsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SessionSecretsModuleSelect>; + } & Omit< + UseQueryOptions< + { + sessionSecretsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSessionSecretsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: sessionSecretsModuleKeys.detail(params.id), - queryFn: () => getClient().sessionSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .sessionSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```ts * const data = await fetchSessionSecretsModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchSessionSecretsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().sessionSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .sessionSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```ts * await prefetchSessionSecretsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSessionSecretsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SessionSecretsModuleSelect>; -}): Promise; -export async function prefetchSessionSecretsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSessionSecretsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SessionSecretsModuleSelect>; + } +): Promise; +export async function prefetchSessionSecretsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: sessionSecretsModuleKeys.detail(params.id), - queryFn: () => getClient().sessionSecretsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .sessionSecretsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useSessionSecretsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useSessionSecretsModulesQuery.ts index 1b129cfa5a..be3f973f41 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useSessionSecretsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useSessionSecretsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { sessionSecretsModuleKeys } from "../query-keys"; -import type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations, SessionSecretsModuleFilter, SessionSecretsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionSecretsModuleSelect, SessionSecretsModuleWithRelations, SessionSecretsModuleFilter, SessionSecretsModuleOrderBy } from "../../orm/input-types"; +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 { sessionSecretsModuleKeys } from '../query-keys'; +import type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SessionSecretsModuleSelect, + SessionSecretsModuleWithRelations, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const sessionSecretsModulesQueryKey = sessionSecretsModuleKeys.list; /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```tsx * const { data, isLoading } = useSessionSecretsModulesQuery({ @@ -30,33 +45,60 @@ export const sessionSecretsModulesQueryKey = sessionSecretsModuleKeys.list; * }); * ``` */ -export function useSessionSecretsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SessionSecretsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSessionSecretsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSessionSecretsModulesQuery< + S extends SessionSecretsModuleSelect, + TData = { + sessionSecretsModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, SessionSecretsModuleSelect>; + } & Omit< + UseQueryOptions< + { + sessionSecretsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSessionSecretsModulesQuery( + params: { + selection: ListSelectionConfig< + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: sessionSecretsModuleKeys.list(args), queryFn: () => getClient().sessionSecretsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```ts * const data = await fetchSessionSecretsModulesQuery({ @@ -67,38 +109,70 @@ export function useSessionSecretsModulesQuery(params: { * }); * ``` */ -export async function fetchSessionSecretsModulesQuery(params: { +export async function fetchSessionSecretsModulesQuery< + S extends SessionSecretsModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SessionSecretsModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, SessionSecretsModuleSelect>; }): Promise<{ sessionSecretsModules: ConnectionResult>; }>; export async function fetchSessionSecretsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy + >(params.selection); return getClient().sessionSecretsModule.findMany(args).unwrap(); } /** * Config row for the session_secrets_module, which provisions a DB-private, session-scoped ephemeral key-value store for challenges, nonces, and one-time tokens that must never be readable by end users. - * + * * @example * ```ts * await prefetchSessionSecretsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSessionSecretsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SessionSecretsModuleSelect>; -}): Promise; -export async function prefetchSessionSecretsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSessionSecretsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, SessionSecretsModuleSelect>; + } +): Promise; +export async function prefetchSessionSecretsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: sessionSecretsModuleKeys.list(args), - queryFn: () => getClient().sessionSecretsModule.findMany(args).unwrap() + queryFn: () => getClient().sessionSecretsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useSessionsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useSessionsModuleQuery.ts index ba11f2bf29..90c32a14f6 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useSessionsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useSessionsModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { sessionsModuleKeys } from "../query-keys"; -import type { SessionsModuleSelect, SessionsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionsModuleSelect, SessionsModuleWithRelations } from "../../orm/input-types"; +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 { sessionsModuleKeys } from '../query-keys'; +import type { SessionsModuleSelect, SessionsModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SessionsModuleSelect, SessionsModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const sessionsModuleQueryKey = sessionsModuleKeys.detail; /** * Query hook for fetching a single SessionsModule - * + * * @example * ```tsx * const { data, isLoading } = useSessionsModuleQuery({ @@ -26,38 +26,52 @@ export const sessionsModuleQueryKey = sessionsModuleKeys.detail; * }); * ``` */ -export function useSessionsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SessionsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSessionsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSessionsModuleQuery< + S extends SessionsModuleSelect, + TData = { + sessionsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SessionsModuleSelect>; + } & Omit< + UseQueryOptions< + { + sessionsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSessionsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: sessionsModuleKeys.detail(params.id), - queryFn: () => getClient().sessionsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .sessionsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single SessionsModule without React hooks - * + * * @example * ```ts * const data = await fetchSessionsModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchSessionsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().sessionsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .sessionsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single SessionsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchSessionsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSessionsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SessionsModuleSelect>; -}): Promise; -export async function prefetchSessionsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSessionsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SessionsModuleSelect>; + } +): Promise; +export async function prefetchSessionsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: sessionsModuleKeys.detail(params.id), - queryFn: () => getClient().sessionsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .sessionsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useSessionsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useSessionsModulesQuery.ts index 1728ea8591..ec1ee6c40e 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useSessionsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useSessionsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { sessionsModuleKeys } from "../query-keys"; -import type { SessionsModuleSelect, SessionsModuleWithRelations, SessionsModuleFilter, SessionsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SessionsModuleSelect, SessionsModuleWithRelations, SessionsModuleFilter, SessionsModuleOrderBy } from "../../orm/input-types"; +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 { sessionsModuleKeys } from '../query-keys'; +import type { + SessionsModuleSelect, + SessionsModuleWithRelations, + SessionsModuleFilter, + SessionsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SessionsModuleSelect, + SessionsModuleWithRelations, + SessionsModuleFilter, + SessionsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const sessionsModulesQueryKey = sessionsModuleKeys.list; /** * Query hook for fetching SessionsModule list - * + * * @example * ```tsx * const { data, isLoading } = useSessionsModulesQuery({ @@ -30,33 +45,53 @@ export const sessionsModulesQueryKey = sessionsModuleKeys.list; * }); * ``` */ -export function useSessionsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SessionsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSessionsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSessionsModulesQuery< + S extends SessionsModuleSelect, + TData = { + sessionsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SessionsModuleSelect>; + } & Omit< + UseQueryOptions< + { + sessionsModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSessionsModulesQuery( + params: { + selection: ListSelectionConfig< + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: sessionsModuleKeys.list(args), queryFn: () => getClient().sessionsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch SessionsModule list without React hooks - * + * * @example * ```ts * const data = await fetchSessionsModulesQuery({ @@ -70,35 +105,55 @@ export function useSessionsModulesQuery(params: { export async function fetchSessionsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SessionsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SessionsModuleSelect>; }): Promise<{ sessionsModules: ConnectionResult>; }>; export async function fetchSessionsModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy + >(params.selection); return getClient().sessionsModule.findMany(args).unwrap(); } /** * Prefetch SessionsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchSessionsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSessionsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SessionsModuleSelect>; -}): Promise; -export async function prefetchSessionsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSessionsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SessionsModuleSelect>; + } +): Promise; +export async function prefetchSessionsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: sessionsModuleKeys.list(args), - queryFn: () => getClient().sessionsModule.findMany(args).unwrap() + queryFn: () => getClient().sessionsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useSiteSurfaceModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useSiteSurfaceModuleQuery.ts index 5e39ed18c8..002ae85c63 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useSiteSurfaceModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useSiteSurfaceModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { siteSurfaceModuleKeys } from "../query-keys"; -import type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations } from "../../orm/input-types"; +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 { siteSurfaceModuleKeys } from '../query-keys'; +import type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteSurfaceModuleQueryKey = siteSurfaceModuleKeys.detail; /** * Query hook for fetching a single SiteSurfaceModule - * + * * @example * ```tsx * const { data, isLoading } = useSiteSurfaceModuleQuery({ @@ -26,38 +32,52 @@ export const siteSurfaceModuleQueryKey = siteSurfaceModuleKeys.detail; * }); * ``` */ -export function useSiteSurfaceModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteSurfaceModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteSurfaceModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useSiteSurfaceModuleQuery< + S extends SiteSurfaceModuleSelect, + TData = { + siteSurfaceModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteSurfaceModuleSelect>; + } & Omit< + UseQueryOptions< + { + siteSurfaceModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteSurfaceModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteSurfaceModuleKeys.detail(params.id), - queryFn: () => getClient().siteSurfaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .siteSurfaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single SiteSurfaceModule without React hooks - * + * * @example * ```ts * const data = await fetchSiteSurfaceModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchSiteSurfaceModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().siteSurfaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .siteSurfaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single SiteSurfaceModule for SSR or cache warming - * + * * @example * ```ts * await prefetchSiteSurfaceModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchSiteSurfaceModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, SiteSurfaceModuleSelect>; -}): Promise; -export async function prefetchSiteSurfaceModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchSiteSurfaceModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SiteSurfaceModuleSelect>; + } +): Promise; +export async function prefetchSiteSurfaceModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: siteSurfaceModuleKeys.detail(params.id), - queryFn: () => getClient().siteSurfaceModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .siteSurfaceModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useSiteSurfaceModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useSiteSurfaceModulesQuery.ts index d61dc3e53a..e87fd031bd 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useSiteSurfaceModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useSiteSurfaceModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { siteSurfaceModuleKeys } from "../query-keys"; -import type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations, SiteSurfaceModuleFilter, SiteSurfaceModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { SiteSurfaceModuleSelect, SiteSurfaceModuleWithRelations, SiteSurfaceModuleFilter, SiteSurfaceModuleOrderBy } from "../../orm/input-types"; +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 { siteSurfaceModuleKeys } from '../query-keys'; +import type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SiteSurfaceModuleSelect, + SiteSurfaceModuleWithRelations, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const siteSurfaceModulesQueryKey = siteSurfaceModuleKeys.list; /** * Query hook for fetching SiteSurfaceModule list - * + * * @example * ```tsx * const { data, isLoading } = useSiteSurfaceModulesQuery({ @@ -30,33 +45,53 @@ export const siteSurfaceModulesQueryKey = siteSurfaceModuleKeys.list; * }); * ``` */ -export function useSiteSurfaceModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteSurfaceModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useSiteSurfaceModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useSiteSurfaceModulesQuery< + S extends SiteSurfaceModuleSelect, + TData = { + siteSurfaceModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteSurfaceModuleSelect>; + } & Omit< + UseQueryOptions< + { + siteSurfaceModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSiteSurfaceModulesQuery( + params: { + selection: ListSelectionConfig< + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: siteSurfaceModuleKeys.list(args), queryFn: () => getClient().siteSurfaceModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch SiteSurfaceModule list without React hooks - * + * * @example * ```ts * const data = await fetchSiteSurfaceModulesQuery({ @@ -70,35 +105,59 @@ export function useSiteSurfaceModulesQuery(params: { export async function fetchSiteSurfaceModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteSurfaceModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, SiteSurfaceModuleSelect>; }): Promise<{ siteSurfaceModules: ConnectionResult>; }>; export async function fetchSiteSurfaceModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy + >(params.selection); return getClient().siteSurfaceModule.findMany(args).unwrap(); } /** * Prefetch SiteSurfaceModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchSiteSurfaceModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchSiteSurfaceModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, SiteSurfaceModuleSelect>; -}): Promise; -export async function prefetchSiteSurfaceModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchSiteSurfaceModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SiteSurfaceModuleSelect>; + } +): Promise; +export async function prefetchSiteSurfaceModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: siteSurfaceModuleKeys.list(args), - queryFn: () => getClient().siteSurfaceModule.findMany(args).unwrap() + queryFn: () => getClient().siteSurfaceModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useStorageLogModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useStorageLogModuleQuery.ts index 6e6ab24e2a..39f5c5b691 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useStorageLogModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useStorageLogModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { storageLogModuleKeys } from "../query-keys"; -import type { StorageLogModuleSelect, StorageLogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageLogModuleSelect, StorageLogModuleWithRelations } from "../../orm/input-types"; +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 { storageLogModuleKeys } from '../query-keys'; +import type { StorageLogModuleSelect, StorageLogModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { StorageLogModuleSelect, StorageLogModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const storageLogModuleQueryKey = storageLogModuleKeys.detail; /** * Query hook for fetching a single StorageLogModule - * + * * @example * ```tsx * const { data, isLoading } = useStorageLogModuleQuery({ @@ -26,38 +26,52 @@ export const storageLogModuleQueryKey = storageLogModuleKeys.detail; * }); * ``` */ -export function useStorageLogModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, StorageLogModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useStorageLogModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useStorageLogModuleQuery< + S extends StorageLogModuleSelect, + TData = { + storageLogModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, StorageLogModuleSelect>; + } & Omit< + UseQueryOptions< + { + storageLogModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useStorageLogModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: storageLogModuleKeys.detail(params.id), - queryFn: () => getClient().storageLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .storageLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single StorageLogModule without React hooks - * + * * @example * ```ts * const data = await fetchStorageLogModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchStorageLogModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().storageLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .storageLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single StorageLogModule for SSR or cache warming - * + * * @example * ```ts * await prefetchStorageLogModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchStorageLogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, StorageLogModuleSelect>; -}): Promise; -export async function prefetchStorageLogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchStorageLogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, StorageLogModuleSelect>; + } +): Promise; +export async function prefetchStorageLogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: storageLogModuleKeys.detail(params.id), - queryFn: () => getClient().storageLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .storageLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useStorageLogModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useStorageLogModulesQuery.ts index 57a7c6178a..9a7da22023 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useStorageLogModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useStorageLogModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { storageLogModuleKeys } from "../query-keys"; -import type { StorageLogModuleSelect, StorageLogModuleWithRelations, StorageLogModuleFilter, StorageLogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageLogModuleSelect, StorageLogModuleWithRelations, StorageLogModuleFilter, StorageLogModuleOrderBy } from "../../orm/input-types"; +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 { storageLogModuleKeys } from '../query-keys'; +import type { + StorageLogModuleSelect, + StorageLogModuleWithRelations, + StorageLogModuleFilter, + StorageLogModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + StorageLogModuleSelect, + StorageLogModuleWithRelations, + StorageLogModuleFilter, + StorageLogModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const storageLogModulesQueryKey = storageLogModuleKeys.list; /** * Query hook for fetching StorageLogModule list - * + * * @example * ```tsx * const { data, isLoading } = useStorageLogModulesQuery({ @@ -30,33 +45,53 @@ export const storageLogModulesQueryKey = storageLogModuleKeys.list; * }); * ``` */ -export function useStorageLogModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, StorageLogModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useStorageLogModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useStorageLogModulesQuery< + S extends StorageLogModuleSelect, + TData = { + storageLogModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, StorageLogModuleSelect>; + } & Omit< + UseQueryOptions< + { + storageLogModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useStorageLogModulesQuery( + params: { + selection: ListSelectionConfig< + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: storageLogModuleKeys.list(args), queryFn: () => getClient().storageLogModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch StorageLogModule list without React hooks - * + * * @example * ```ts * const data = await fetchStorageLogModulesQuery({ @@ -70,35 +105,59 @@ export function useStorageLogModulesQuery(params: { export async function fetchStorageLogModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, StorageLogModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, StorageLogModuleSelect>; }): Promise<{ storageLogModules: ConnectionResult>; }>; export async function fetchStorageLogModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy + >(params.selection); return getClient().storageLogModule.findMany(args).unwrap(); } /** * Prefetch StorageLogModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchStorageLogModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchStorageLogModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, StorageLogModuleSelect>; -}): Promise; -export async function prefetchStorageLogModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchStorageLogModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, StorageLogModuleSelect>; + } +): Promise; +export async function prefetchStorageLogModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: storageLogModuleKeys.list(args), - queryFn: () => getClient().storageLogModule.findMany(args).unwrap() + queryFn: () => getClient().storageLogModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useStorageModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useStorageModuleQuery.ts index 3e2877105d..15929937b0 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useStorageModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useStorageModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { storageModuleKeys } from "../query-keys"; -import type { StorageModuleSelect, StorageModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageModuleSelect, StorageModuleWithRelations } from "../../orm/input-types"; +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 { storageModuleKeys } from '../query-keys'; +import type { StorageModuleSelect, StorageModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { StorageModuleSelect, StorageModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const storageModuleQueryKey = storageModuleKeys.detail; /** * Query hook for fetching a single StorageModule - * + * * @example * ```tsx * const { data, isLoading } = useStorageModuleQuery({ @@ -26,38 +26,52 @@ export const storageModuleQueryKey = storageModuleKeys.detail; * }); * ``` */ -export function useStorageModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, StorageModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useStorageModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useStorageModuleQuery< + S extends StorageModuleSelect, + TData = { + storageModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, StorageModuleSelect>; + } & Omit< + UseQueryOptions< + { + storageModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useStorageModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: storageModuleKeys.detail(params.id), - queryFn: () => getClient().storageModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .storageModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single StorageModule without React hooks - * + * * @example * ```ts * const data = await fetchStorageModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchStorageModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().storageModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .storageModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single StorageModule for SSR or cache warming - * + * * @example * ```ts * await prefetchStorageModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchStorageModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, StorageModuleSelect>; -}): Promise; -export async function prefetchStorageModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchStorageModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, StorageModuleSelect>; + } +): Promise; +export async function prefetchStorageModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: storageModuleKeys.detail(params.id), - queryFn: () => getClient().storageModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .storageModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useStorageModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useStorageModulesQuery.ts index 5a16d37027..d370ca24f1 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useStorageModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useStorageModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { storageModuleKeys } from "../query-keys"; -import type { StorageModuleSelect, StorageModuleWithRelations, StorageModuleFilter, StorageModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { StorageModuleSelect, StorageModuleWithRelations, StorageModuleFilter, StorageModuleOrderBy } from "../../orm/input-types"; +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 { storageModuleKeys } from '../query-keys'; +import type { + StorageModuleSelect, + StorageModuleWithRelations, + StorageModuleFilter, + StorageModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + StorageModuleSelect, + StorageModuleWithRelations, + StorageModuleFilter, + StorageModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const storageModulesQueryKey = storageModuleKeys.list; /** * Query hook for fetching StorageModule list - * + * * @example * ```tsx * const { data, isLoading } = useStorageModulesQuery({ @@ -30,33 +45,49 @@ export const storageModulesQueryKey = storageModuleKeys.list; * }); * ``` */ -export function useStorageModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, StorageModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useStorageModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useStorageModulesQuery< + S extends StorageModuleSelect, + TData = { + storageModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, StorageModuleSelect>; + } & Omit< + UseQueryOptions< + { + storageModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useStorageModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + StorageModuleSelect, + StorageModuleFilter, + StorageModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: storageModuleKeys.list(args), queryFn: () => getClient().storageModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch StorageModule list without React hooks - * + * * @example * ```ts * const data = await fetchStorageModulesQuery({ @@ -70,35 +101,51 @@ export function useStorageModulesQuery(params: { export async function fetchStorageModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, StorageModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, StorageModuleSelect>; }): Promise<{ storageModules: ConnectionResult>; }>; export async function fetchStorageModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + StorageModuleSelect, + StorageModuleFilter, + StorageModuleOrderBy + >(params.selection); return getClient().storageModule.findMany(args).unwrap(); } /** * Prefetch StorageModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchStorageModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchStorageModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, StorageModuleSelect>; -}): Promise; -export async function prefetchStorageModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchStorageModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, StorageModuleSelect>; + } +): Promise; +export async function prefetchStorageModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + StorageModuleSelect, + StorageModuleFilter, + StorageModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: storageModuleKeys.list(args), - queryFn: () => getClient().storageModule.findMany(args).unwrap() + queryFn: () => getClient().storageModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useTransferLogModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useTransferLogModuleQuery.ts index 0f6e65023c..d462fe819f 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useTransferLogModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useTransferLogModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { transferLogModuleKeys } from "../query-keys"; -import type { TransferLogModuleSelect, TransferLogModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { TransferLogModuleSelect, TransferLogModuleWithRelations } from "../../orm/input-types"; +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 { transferLogModuleKeys } from '../query-keys'; +import type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const transferLogModuleQueryKey = transferLogModuleKeys.detail; /** * Query hook for fetching a single TransferLogModule - * + * * @example * ```tsx * const { data, isLoading } = useTransferLogModuleQuery({ @@ -26,38 +32,52 @@ export const transferLogModuleQueryKey = transferLogModuleKeys.detail; * }); * ``` */ -export function useTransferLogModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TransferLogModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTransferLogModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useTransferLogModuleQuery< + S extends TransferLogModuleSelect, + TData = { + transferLogModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TransferLogModuleSelect>; + } & Omit< + UseQueryOptions< + { + transferLogModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTransferLogModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: transferLogModuleKeys.detail(params.id), - queryFn: () => getClient().transferLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .transferLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single TransferLogModule without React hooks - * + * * @example * ```ts * const data = await fetchTransferLogModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchTransferLogModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().transferLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .transferLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single TransferLogModule for SSR or cache warming - * + * * @example * ```ts * await prefetchTransferLogModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchTransferLogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, TransferLogModuleSelect>; -}): Promise; -export async function prefetchTransferLogModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchTransferLogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, TransferLogModuleSelect>; + } +): Promise; +export async function prefetchTransferLogModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: transferLogModuleKeys.detail(params.id), - queryFn: () => getClient().transferLogModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .transferLogModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useTransferLogModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useTransferLogModulesQuery.ts index dd321fe2b3..7b2fab1bc5 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useTransferLogModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useTransferLogModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { transferLogModuleKeys } from "../query-keys"; -import type { TransferLogModuleSelect, TransferLogModuleWithRelations, TransferLogModuleFilter, TransferLogModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { TransferLogModuleSelect, TransferLogModuleWithRelations, TransferLogModuleFilter, TransferLogModuleOrderBy } from "../../orm/input-types"; +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 { transferLogModuleKeys } from '../query-keys'; +import type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, + TransferLogModuleFilter, + TransferLogModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + TransferLogModuleSelect, + TransferLogModuleWithRelations, + TransferLogModuleFilter, + TransferLogModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const transferLogModulesQueryKey = transferLogModuleKeys.list; /** * Query hook for fetching TransferLogModule list - * + * * @example * ```tsx * const { data, isLoading } = useTransferLogModulesQuery({ @@ -30,33 +45,53 @@ export const transferLogModulesQueryKey = transferLogModuleKeys.list; * }); * ``` */ -export function useTransferLogModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TransferLogModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useTransferLogModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useTransferLogModulesQuery< + S extends TransferLogModuleSelect, + TData = { + transferLogModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TransferLogModuleSelect>; + } & Omit< + UseQueryOptions< + { + transferLogModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useTransferLogModulesQuery( + params: { + selection: ListSelectionConfig< + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: transferLogModuleKeys.list(args), queryFn: () => getClient().transferLogModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch TransferLogModule list without React hooks - * + * * @example * ```ts * const data = await fetchTransferLogModulesQuery({ @@ -70,35 +105,59 @@ export function useTransferLogModulesQuery(params: { export async function fetchTransferLogModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, TransferLogModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, TransferLogModuleSelect>; }): Promise<{ transferLogModules: ConnectionResult>; }>; export async function fetchTransferLogModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy + >(params.selection); return getClient().transferLogModule.findMany(args).unwrap(); } /** * Prefetch TransferLogModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchTransferLogModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchTransferLogModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, TransferLogModuleSelect>; -}): Promise; -export async function prefetchTransferLogModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchTransferLogModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, TransferLogModuleSelect>; + } +): Promise; +export async function prefetchTransferLogModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: transferLogModuleKeys.list(args), - queryFn: () => getClient().transferLogModule.findMany(args).unwrap() + queryFn: () => getClient().transferLogModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUserAuthModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUserAuthModuleQuery.ts index 282e213c89..008ca09340 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUserAuthModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUserAuthModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { userAuthModuleKeys } from "../query-keys"; -import type { UserAuthModuleSelect, UserAuthModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserAuthModuleSelect, UserAuthModuleWithRelations } from "../../orm/input-types"; +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 { userAuthModuleKeys } from '../query-keys'; +import type { UserAuthModuleSelect, UserAuthModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserAuthModuleSelect, UserAuthModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userAuthModuleQueryKey = userAuthModuleKeys.detail; /** * Query hook for fetching a single UserAuthModule - * + * * @example * ```tsx * const { data, isLoading } = useUserAuthModuleQuery({ @@ -26,38 +26,52 @@ export const userAuthModuleQueryKey = userAuthModuleKeys.detail; * }); * ``` */ -export function useUserAuthModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserAuthModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserAuthModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUserAuthModuleQuery< + S extends UserAuthModuleSelect, + TData = { + userAuthModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserAuthModuleSelect>; + } & Omit< + UseQueryOptions< + { + userAuthModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserAuthModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userAuthModuleKeys.detail(params.id), - queryFn: () => getClient().userAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .userAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single UserAuthModule without React hooks - * + * * @example * ```ts * const data = await fetchUserAuthModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchUserAuthModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().userAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .userAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single UserAuthModule for SSR or cache warming - * + * * @example * ```ts * await prefetchUserAuthModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchUserAuthModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserAuthModuleSelect>; -}): Promise; -export async function prefetchUserAuthModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchUserAuthModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserAuthModuleSelect>; + } +): Promise; +export async function prefetchUserAuthModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: userAuthModuleKeys.detail(params.id), - queryFn: () => getClient().userAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .userAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUserAuthModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUserAuthModulesQuery.ts index a94e0f83cb..f223af0120 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUserAuthModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUserAuthModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { userAuthModuleKeys } from "../query-keys"; -import type { UserAuthModuleSelect, UserAuthModuleWithRelations, UserAuthModuleFilter, UserAuthModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserAuthModuleSelect, UserAuthModuleWithRelations, UserAuthModuleFilter, UserAuthModuleOrderBy } from "../../orm/input-types"; +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 { userAuthModuleKeys } from '../query-keys'; +import type { + UserAuthModuleSelect, + UserAuthModuleWithRelations, + UserAuthModuleFilter, + UserAuthModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + UserAuthModuleSelect, + UserAuthModuleWithRelations, + UserAuthModuleFilter, + UserAuthModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userAuthModulesQueryKey = userAuthModuleKeys.list; /** * Query hook for fetching UserAuthModule list - * + * * @example * ```tsx * const { data, isLoading } = useUserAuthModulesQuery({ @@ -30,33 +45,53 @@ export const userAuthModulesQueryKey = userAuthModuleKeys.list; * }); * ``` */ -export function useUserAuthModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserAuthModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserAuthModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useUserAuthModulesQuery< + S extends UserAuthModuleSelect, + TData = { + userAuthModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UserAuthModuleSelect>; + } & Omit< + UseQueryOptions< + { + userAuthModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserAuthModulesQuery( + params: { + selection: ListSelectionConfig< + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userAuthModuleKeys.list(args), queryFn: () => getClient().userAuthModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch UserAuthModule list without React hooks - * + * * @example * ```ts * const data = await fetchUserAuthModulesQuery({ @@ -70,35 +105,55 @@ export function useUserAuthModulesQuery(params: { export async function fetchUserAuthModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, UserAuthModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, UserAuthModuleSelect>; }): Promise<{ userAuthModules: ConnectionResult>; }>; export async function fetchUserAuthModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy + >(params.selection); return getClient().userAuthModule.findMany(args).unwrap(); } /** * Prefetch UserAuthModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchUserAuthModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchUserAuthModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserAuthModuleSelect>; -}): Promise; -export async function prefetchUserAuthModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchUserAuthModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UserAuthModuleSelect>; + } +): Promise; +export async function prefetchUserAuthModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: userAuthModuleKeys.list(args), - queryFn: () => getClient().userAuthModule.findMany(args).unwrap() + queryFn: () => getClient().userAuthModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUserCredentialsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUserCredentialsModuleQuery.ts index a09f9781aa..cedf41fe2d 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUserCredentialsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUserCredentialsModuleQuery.ts @@ -6,15 +6,21 @@ * 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 { userCredentialsModuleKeys } from "../query-keys"; -import type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations } from "../../orm/input-types"; +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 { userCredentialsModuleKeys } from '../query-keys'; +import type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userCredentialsModuleQueryKey = userCredentialsModuleKeys.detail; /** @@ -30,33 +36,47 @@ export const userCredentialsModuleQueryKey = userCredentialsModuleKeys.detail; * }); * ``` */ -export function useUserCredentialsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserCredentialsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserCredentialsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUserCredentialsModuleQuery< + S extends UserCredentialsModuleSelect, + TData = { + userCredentialsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserCredentialsModuleSelect>; + } & Omit< + UseQueryOptions< + { + userCredentialsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserCredentialsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userCredentialsModuleKeys.detail(params.id), - queryFn: () => getClient().userCredentialsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .userCredentialsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** @@ -72,7 +92,9 @@ export function useUserCredentialsModuleQuery(params: { * }); * ``` */ -export async function fetchUserCredentialsModuleQuery(params: { +export async function fetchUserCredentialsModuleQuery< + S extends UserCredentialsModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -85,10 +107,12 @@ export async function fetchUserCredentialsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().userCredentialsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .userCredentialsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-user bcrypt credential store (password hashes, API key hashes). @@ -100,22 +124,31 @@ export async function fetchUserCredentialsModuleQuery(params: { * await prefetchUserCredentialsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchUserCredentialsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserCredentialsModuleSelect>; -}): Promise; -export async function prefetchUserCredentialsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchUserCredentialsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserCredentialsModuleSelect>; + } +): Promise; +export async function prefetchUserCredentialsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: userCredentialsModuleKeys.detail(params.id), - queryFn: () => getClient().userCredentialsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .userCredentialsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUserCredentialsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUserCredentialsModulesQuery.ts index 407fefb38f..f6a589c954 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUserCredentialsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUserCredentialsModulesQuery.ts @@ -6,15 +6,30 @@ * 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 { userCredentialsModuleKeys } from "../query-keys"; -import type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations, UserCredentialsModuleFilter, UserCredentialsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserCredentialsModuleSelect, UserCredentialsModuleWithRelations, UserCredentialsModuleFilter, UserCredentialsModuleOrderBy } from "../../orm/input-types"; +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 { userCredentialsModuleKeys } from '../query-keys'; +import type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + UserCredentialsModuleSelect, + UserCredentialsModuleWithRelations, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userCredentialsModulesQueryKey = userCredentialsModuleKeys.list; /** @@ -34,28 +49,55 @@ export const userCredentialsModulesQueryKey = userCredentialsModuleKeys.list; * }); * ``` */ -export function useUserCredentialsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserCredentialsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserCredentialsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useUserCredentialsModulesQuery< + S extends UserCredentialsModuleSelect, + TData = { + userCredentialsModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, UserCredentialsModuleSelect>; + } & Omit< + UseQueryOptions< + { + userCredentialsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserCredentialsModulesQuery( + params: { + selection: ListSelectionConfig< + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userCredentialsModuleKeys.list(args), queryFn: () => getClient().userCredentialsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** @@ -73,17 +115,33 @@ export function useUserCredentialsModulesQuery(params: { * }); * ``` */ -export async function fetchUserCredentialsModulesQuery(params: { +export async function fetchUserCredentialsModulesQuery< + S extends UserCredentialsModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, UserCredentialsModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, UserCredentialsModuleSelect>; }): Promise<{ - userCredentialsModules: ConnectionResult>; + userCredentialsModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchUserCredentialsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy + >(params.selection); return getClient().userCredentialsModule.findMany(args).unwrap(); } /** @@ -96,17 +154,35 @@ export async function fetchUserCredentialsModulesQuery(params: { * await prefetchUserCredentialsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchUserCredentialsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserCredentialsModuleSelect>; -}): Promise; -export async function prefetchUserCredentialsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchUserCredentialsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, UserCredentialsModuleSelect>; + } +): Promise; +export async function prefetchUserCredentialsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: userCredentialsModuleKeys.list(args), - queryFn: () => getClient().userCredentialsModule.findMany(args).unwrap() + queryFn: () => getClient().userCredentialsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUserSettingsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUserSettingsModuleQuery.ts index 06e629da36..eff36dfe6a 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUserSettingsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUserSettingsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { userSettingsModuleKeys } from "../query-keys"; -import type { UserSettingsModuleSelect, UserSettingsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSettingsModuleSelect, UserSettingsModuleWithRelations } from "../../orm/input-types"; +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 { userSettingsModuleKeys } from '../query-keys'; +import type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userSettingsModuleQueryKey = userSettingsModuleKeys.detail; /** * Query hook for fetching a single UserSettingsModule - * + * * @example * ```tsx * const { data, isLoading } = useUserSettingsModuleQuery({ @@ -26,38 +32,52 @@ export const userSettingsModuleQueryKey = userSettingsModuleKeys.detail; * }); * ``` */ -export function useUserSettingsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserSettingsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserSettingsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUserSettingsModuleQuery< + S extends UserSettingsModuleSelect, + TData = { + userSettingsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserSettingsModuleSelect>; + } & Omit< + UseQueryOptions< + { + userSettingsModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserSettingsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userSettingsModuleKeys.detail(params.id), - queryFn: () => getClient().userSettingsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .userSettingsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single UserSettingsModule without React hooks - * + * * @example * ```ts * const data = await fetchUserSettingsModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchUserSettingsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().userSettingsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .userSettingsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single UserSettingsModule for SSR or cache warming - * + * * @example * ```ts * await prefetchUserSettingsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchUserSettingsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserSettingsModuleSelect>; -}): Promise; -export async function prefetchUserSettingsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchUserSettingsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserSettingsModuleSelect>; + } +): Promise; +export async function prefetchUserSettingsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: userSettingsModuleKeys.detail(params.id), - queryFn: () => getClient().userSettingsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .userSettingsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUserSettingsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUserSettingsModulesQuery.ts index e8ad2d7147..a4c636851c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUserSettingsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUserSettingsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { userSettingsModuleKeys } from "../query-keys"; -import type { UserSettingsModuleSelect, UserSettingsModuleWithRelations, UserSettingsModuleFilter, UserSettingsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserSettingsModuleSelect, UserSettingsModuleWithRelations, UserSettingsModuleFilter, UserSettingsModuleOrderBy } from "../../orm/input-types"; +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 { userSettingsModuleKeys } from '../query-keys'; +import type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + UserSettingsModuleSelect, + UserSettingsModuleWithRelations, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userSettingsModulesQueryKey = userSettingsModuleKeys.list; /** * Query hook for fetching UserSettingsModule list - * + * * @example * ```tsx * const { data, isLoading } = useUserSettingsModulesQuery({ @@ -30,33 +45,58 @@ export const userSettingsModulesQueryKey = userSettingsModuleKeys.list; * }); * ``` */ -export function useUserSettingsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserSettingsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserSettingsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useUserSettingsModulesQuery< + S extends UserSettingsModuleSelect, + TData = { + userSettingsModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, UserSettingsModuleSelect>; + } & Omit< + UseQueryOptions< + { + userSettingsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserSettingsModulesQuery( + params: { + selection: ListSelectionConfig< + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userSettingsModuleKeys.list(args), queryFn: () => getClient().userSettingsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch UserSettingsModule list without React hooks - * + * * @example * ```ts * const data = await fetchUserSettingsModulesQuery({ @@ -70,35 +110,62 @@ export function useUserSettingsModulesQuery(params: { export async function fetchUserSettingsModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, UserSettingsModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, UserSettingsModuleSelect>; }): Promise<{ userSettingsModules: ConnectionResult>; }>; export async function fetchUserSettingsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy + >(params.selection); return getClient().userSettingsModule.findMany(args).unwrap(); } /** * Prefetch UserSettingsModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchUserSettingsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchUserSettingsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserSettingsModuleSelect>; -}): Promise; -export async function prefetchUserSettingsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchUserSettingsModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, UserSettingsModuleSelect>; + } +): Promise; +export async function prefetchUserSettingsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: userSettingsModuleKeys.list(args), - queryFn: () => getClient().userSettingsModule.findMany(args).unwrap() + queryFn: () => getClient().userSettingsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUserStateModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUserStateModuleQuery.ts index b5a43c4229..cdd215e9b2 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUserStateModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUserStateModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { userStateModuleKeys } from "../query-keys"; -import type { UserStateModuleSelect, UserStateModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserStateModuleSelect, UserStateModuleWithRelations } from "../../orm/input-types"; +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 { userStateModuleKeys } from '../query-keys'; +import type { UserStateModuleSelect, UserStateModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UserStateModuleSelect, UserStateModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userStateModuleQueryKey = userStateModuleKeys.detail; /** * Query hook for fetching a single UserStateModule - * + * * @example * ```tsx * const { data, isLoading } = useUserStateModuleQuery({ @@ -26,38 +26,52 @@ export const userStateModuleQueryKey = userStateModuleKeys.detail; * }); * ``` */ -export function useUserStateModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserStateModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserStateModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUserStateModuleQuery< + S extends UserStateModuleSelect, + TData = { + userStateModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserStateModuleSelect>; + } & Omit< + UseQueryOptions< + { + userStateModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserStateModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userStateModuleKeys.detail(params.id), - queryFn: () => getClient().userStateModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .userStateModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single UserStateModule without React hooks - * + * * @example * ```ts * const data = await fetchUserStateModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchUserStateModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().userStateModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .userStateModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single UserStateModule for SSR or cache warming - * + * * @example * ```ts * await prefetchUserStateModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchUserStateModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UserStateModuleSelect>; -}): Promise; -export async function prefetchUserStateModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchUserStateModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UserStateModuleSelect>; + } +): Promise; +export async function prefetchUserStateModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: userStateModuleKeys.detail(params.id), - queryFn: () => getClient().userStateModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .userStateModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUserStateModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUserStateModulesQuery.ts index 81d7b01c96..0883dec84e 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUserStateModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUserStateModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { userStateModuleKeys } from "../query-keys"; -import type { UserStateModuleSelect, UserStateModuleWithRelations, UserStateModuleFilter, UserStateModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { UserStateModuleSelect, UserStateModuleWithRelations, UserStateModuleFilter, UserStateModuleOrderBy } from "../../orm/input-types"; +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 { userStateModuleKeys } from '../query-keys'; +import type { + UserStateModuleSelect, + UserStateModuleWithRelations, + UserStateModuleFilter, + UserStateModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + UserStateModuleSelect, + UserStateModuleWithRelations, + UserStateModuleFilter, + UserStateModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const userStateModulesQueryKey = userStateModuleKeys.list; /** * Query hook for fetching UserStateModule list - * + * * @example * ```tsx * const { data, isLoading } = useUserStateModulesQuery({ @@ -30,33 +45,53 @@ export const userStateModulesQueryKey = userStateModuleKeys.list; * }); * ``` */ -export function useUserStateModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserStateModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUserStateModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useUserStateModulesQuery< + S extends UserStateModuleSelect, + TData = { + userStateModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UserStateModuleSelect>; + } & Omit< + UseQueryOptions< + { + userStateModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUserStateModulesQuery( + params: { + selection: ListSelectionConfig< + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: userStateModuleKeys.list(args), queryFn: () => getClient().userStateModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch UserStateModule list without React hooks - * + * * @example * ```ts * const data = await fetchUserStateModulesQuery({ @@ -70,35 +105,59 @@ export function useUserStateModulesQuery(params: { export async function fetchUserStateModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, UserStateModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, UserStateModuleSelect>; }): Promise<{ userStateModules: ConnectionResult>; }>; export async function fetchUserStateModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy + >(params.selection); return getClient().userStateModule.findMany(args).unwrap(); } /** * Prefetch UserStateModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchUserStateModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchUserStateModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UserStateModuleSelect>; -}): Promise; -export async function prefetchUserStateModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchUserStateModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UserStateModuleSelect>; + } +): Promise; +export async function prefetchUserStateModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: userStateModuleKeys.list(args), - queryFn: () => getClient().userStateModule.findMany(args).unwrap() + queryFn: () => getClient().userStateModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUsersModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUsersModuleQuery.ts index 9f18977ab3..528470c434 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUsersModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUsersModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { usersModuleKeys } from "../query-keys"; -import type { UsersModuleSelect, UsersModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { UsersModuleSelect, UsersModuleWithRelations } from "../../orm/input-types"; +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 { usersModuleKeys } from '../query-keys'; +import type { UsersModuleSelect, UsersModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { UsersModuleSelect, UsersModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const usersModuleQueryKey = usersModuleKeys.detail; /** * Query hook for fetching a single UsersModule - * + * * @example * ```tsx * const { data, isLoading } = useUsersModuleQuery({ @@ -26,38 +26,52 @@ export const usersModuleQueryKey = usersModuleKeys.detail; * }); * ``` */ -export function useUsersModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UsersModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUsersModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useUsersModuleQuery< + S extends UsersModuleSelect, + TData = { + usersModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UsersModuleSelect>; + } & Omit< + UseQueryOptions< + { + usersModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUsersModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: usersModuleKeys.detail(params.id), - queryFn: () => getClient().usersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .usersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single UsersModule without React hooks - * + * * @example * ```ts * const data = await fetchUsersModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchUsersModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().usersModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .usersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single UsersModule for SSR or cache warming - * + * * @example * ```ts * await prefetchUsersModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchUsersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, UsersModuleSelect>; -}): Promise; -export async function prefetchUsersModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchUsersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, UsersModuleSelect>; + } +): Promise; +export async function prefetchUsersModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: usersModuleKeys.detail(params.id), - queryFn: () => getClient().usersModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .usersModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useUsersModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useUsersModulesQuery.ts index 7a8a3dbdb9..a19074b3c6 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useUsersModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useUsersModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { usersModuleKeys } from "../query-keys"; -import type { UsersModuleSelect, UsersModuleWithRelations, UsersModuleFilter, UsersModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { UsersModuleSelect, UsersModuleWithRelations, UsersModuleFilter, UsersModuleOrderBy } from "../../orm/input-types"; +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 { usersModuleKeys } from '../query-keys'; +import type { + UsersModuleSelect, + UsersModuleWithRelations, + UsersModuleFilter, + UsersModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + UsersModuleSelect, + UsersModuleWithRelations, + UsersModuleFilter, + UsersModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const usersModulesQueryKey = usersModuleKeys.list; /** * Query hook for fetching UsersModule list - * + * * @example * ```tsx * const { data, isLoading } = useUsersModulesQuery({ @@ -30,33 +45,47 @@ export const usersModulesQueryKey = usersModuleKeys.list; * }); * ``` */ -export function useUsersModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UsersModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useUsersModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useUsersModulesQuery< + S extends UsersModuleSelect, + TData = { + usersModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UsersModuleSelect>; + } & Omit< + UseQueryOptions< + { + usersModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useUsersModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: usersModuleKeys.list(args), queryFn: () => getClient().usersModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch UsersModule list without React hooks - * + * * @example * ```ts * const data = await fetchUsersModulesQuery({ @@ -70,35 +99,47 @@ export function useUsersModulesQuery(params: { export async function fetchUsersModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, UsersModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, UsersModuleSelect>; }): Promise<{ usersModules: ConnectionResult>; }>; export async function fetchUsersModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().usersModule.findMany(args).unwrap(); } /** * Prefetch UsersModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchUsersModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchUsersModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, UsersModuleSelect>; -}): Promise; -export async function prefetchUsersModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchUsersModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, UsersModuleSelect>; + } +): Promise; +export async function prefetchUsersModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: usersModuleKeys.list(args), - queryFn: () => getClient().usersModule.findMany(args).unwrap() + queryFn: () => getClient().usersModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useWebauthnAuthModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useWebauthnAuthModuleQuery.ts index 1e3f9ae971..b69188439a 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useWebauthnAuthModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useWebauthnAuthModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { webauthnAuthModuleKeys } from "../query-keys"; -import type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations } from "../../orm/input-types"; +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 { webauthnAuthModuleKeys } from '../query-keys'; +import type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webauthnAuthModuleQueryKey = webauthnAuthModuleKeys.detail; /** * Query hook for fetching a single WebauthnAuthModule - * + * * @example * ```tsx * const { data, isLoading } = useWebauthnAuthModuleQuery({ @@ -26,38 +32,52 @@ export const webauthnAuthModuleQueryKey = webauthnAuthModuleKeys.detail; * }); * ``` */ -export function useWebauthnAuthModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebauthnAuthModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebauthnAuthModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useWebauthnAuthModuleQuery< + S extends WebauthnAuthModuleSelect, + TData = { + webauthnAuthModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebauthnAuthModuleSelect>; + } & Omit< + UseQueryOptions< + { + webauthnAuthModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebauthnAuthModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webauthnAuthModuleKeys.detail(params.id), - queryFn: () => getClient().webauthnAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .webauthnAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single WebauthnAuthModule without React hooks - * + * * @example * ```ts * const data = await fetchWebauthnAuthModuleQuery({ @@ -79,35 +99,46 @@ export async function fetchWebauthnAuthModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().webauthnAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .webauthnAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single WebauthnAuthModule for SSR or cache warming - * + * * @example * ```ts * await prefetchWebauthnAuthModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchWebauthnAuthModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebauthnAuthModuleSelect>; -}): Promise; -export async function prefetchWebauthnAuthModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchWebauthnAuthModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebauthnAuthModuleSelect>; + } +): Promise; +export async function prefetchWebauthnAuthModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: webauthnAuthModuleKeys.detail(params.id), - queryFn: () => getClient().webauthnAuthModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .webauthnAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useWebauthnAuthModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useWebauthnAuthModulesQuery.ts index 2d719c4699..d678bf6776 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useWebauthnAuthModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useWebauthnAuthModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { webauthnAuthModuleKeys } from "../query-keys"; -import type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations, WebauthnAuthModuleFilter, WebauthnAuthModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnAuthModuleSelect, WebauthnAuthModuleWithRelations, WebauthnAuthModuleFilter, WebauthnAuthModuleOrderBy } from "../../orm/input-types"; +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 { webauthnAuthModuleKeys } from '../query-keys'; +import type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + WebauthnAuthModuleSelect, + WebauthnAuthModuleWithRelations, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webauthnAuthModulesQueryKey = webauthnAuthModuleKeys.list; /** * Query hook for fetching WebauthnAuthModule list - * + * * @example * ```tsx * const { data, isLoading } = useWebauthnAuthModulesQuery({ @@ -30,33 +45,58 @@ export const webauthnAuthModulesQueryKey = webauthnAuthModuleKeys.list; * }); * ``` */ -export function useWebauthnAuthModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnAuthModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebauthnAuthModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useWebauthnAuthModulesQuery< + S extends WebauthnAuthModuleSelect, + TData = { + webauthnAuthModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, WebauthnAuthModuleSelect>; + } & Omit< + UseQueryOptions< + { + webauthnAuthModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebauthnAuthModulesQuery( + params: { + selection: ListSelectionConfig< + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webauthnAuthModuleKeys.list(args), queryFn: () => getClient().webauthnAuthModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch WebauthnAuthModule list without React hooks - * + * * @example * ```ts * const data = await fetchWebauthnAuthModulesQuery({ @@ -70,35 +110,62 @@ export function useWebauthnAuthModulesQuery(params: { export async function fetchWebauthnAuthModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnAuthModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, WebauthnAuthModuleSelect>; }): Promise<{ webauthnAuthModules: ConnectionResult>; }>; export async function fetchWebauthnAuthModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy + >(params.selection); return getClient().webauthnAuthModule.findMany(args).unwrap(); } /** * Prefetch WebauthnAuthModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchWebauthnAuthModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchWebauthnAuthModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnAuthModuleSelect>; -}): Promise; -export async function prefetchWebauthnAuthModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchWebauthnAuthModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, WebauthnAuthModuleSelect>; + } +): Promise; +export async function prefetchWebauthnAuthModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: webauthnAuthModuleKeys.list(args), - queryFn: () => getClient().webauthnAuthModule.findMany(args).unwrap() + queryFn: () => getClient().webauthnAuthModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useWebauthnCredentialsModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useWebauthnCredentialsModuleQuery.ts index 2ae2b2f93b..f2dd3c1773 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useWebauthnCredentialsModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useWebauthnCredentialsModuleQuery.ts @@ -4,20 +4,26 @@ * 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 { webauthnCredentialsModuleKeys } from "../query-keys"; -import type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations } from "../../orm/input-types"; +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 { webauthnCredentialsModuleKeys } from '../query-keys'; +import type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webauthnCredentialsModuleQueryKey = webauthnCredentialsModuleKeys.detail; /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```tsx * const { data, isLoading } = useWebauthnCredentialsModuleQuery({ @@ -26,38 +32,55 @@ export const webauthnCredentialsModuleQueryKey = webauthnCredentialsModuleKeys.d * }); * ``` */ -export function useWebauthnCredentialsModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebauthnCredentialsModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebauthnCredentialsModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useWebauthnCredentialsModuleQuery< + S extends WebauthnCredentialsModuleSelect, + TData = { + webauthnCredentialsModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebauthnCredentialsModuleSelect>; + } & Omit< + UseQueryOptions< + { + webauthnCredentialsModule: InferSelectResult< + WebauthnCredentialsModuleWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebauthnCredentialsModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webauthnCredentialsModuleKeys.detail(params.id), - queryFn: () => getClient().webauthnCredentialsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .webauthnCredentialsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```ts * const data = await fetchWebauthnCredentialsModuleQuery({ @@ -66,7 +89,9 @@ export function useWebauthnCredentialsModuleQuery(params: { * }); * ``` */ -export async function fetchWebauthnCredentialsModuleQuery(params: { +export async function fetchWebauthnCredentialsModuleQuery< + S extends WebauthnCredentialsModuleSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +104,48 @@ export async function fetchWebauthnCredentialsModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().webauthnCredentialsModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .webauthnCredentialsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```ts * await prefetchWebauthnCredentialsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchWebauthnCredentialsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebauthnCredentialsModuleSelect>; -}): Promise; -export async function prefetchWebauthnCredentialsModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchWebauthnCredentialsModuleQuery< + S extends WebauthnCredentialsModuleSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebauthnCredentialsModuleSelect>; + } +): Promise; +export async function prefetchWebauthnCredentialsModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: webauthnCredentialsModuleKeys.detail(params.id), - queryFn: () => getClient().webauthnCredentialsModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .webauthnCredentialsModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useWebauthnCredentialsModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useWebauthnCredentialsModulesQuery.ts index e7b834934f..e4aab3b32e 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useWebauthnCredentialsModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useWebauthnCredentialsModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { webauthnCredentialsModuleKeys } from "../query-keys"; -import type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations, WebauthnCredentialsModuleFilter, WebauthnCredentialsModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleWithRelations, WebauthnCredentialsModuleFilter, WebauthnCredentialsModuleOrderBy } from "../../orm/input-types"; +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 { webauthnCredentialsModuleKeys } from '../query-keys'; +import type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleWithRelations, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webauthnCredentialsModulesQueryKey = webauthnCredentialsModuleKeys.list; /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```tsx * const { data, isLoading } = useWebauthnCredentialsModulesQuery({ @@ -30,33 +45,60 @@ export const webauthnCredentialsModulesQueryKey = webauthnCredentialsModuleKeys. * }); * ``` */ -export function useWebauthnCredentialsModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnCredentialsModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebauthnCredentialsModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useWebauthnCredentialsModulesQuery< + S extends WebauthnCredentialsModuleSelect, + TData = { + webauthnCredentialsModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, WebauthnCredentialsModuleSelect>; + } & Omit< + UseQueryOptions< + { + webauthnCredentialsModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebauthnCredentialsModulesQuery( + params: { + selection: ListSelectionConfig< + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webauthnCredentialsModuleKeys.list(args), queryFn: () => getClient().webauthnCredentialsModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```ts * const data = await fetchWebauthnCredentialsModulesQuery({ @@ -67,38 +109,74 @@ export function useWebauthnCredentialsModulesQuery(params: { * }); * ``` */ -export async function fetchWebauthnCredentialsModulesQuery(params: { +export async function fetchWebauthnCredentialsModulesQuery< + S extends WebauthnCredentialsModuleSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnCredentialsModuleSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, WebauthnCredentialsModuleSelect>; }): Promise<{ - webauthnCredentialsModules: ConnectionResult>; + webauthnCredentialsModules: ConnectionResult< + InferSelectResult + >; }>; export async function fetchWebauthnCredentialsModulesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy + >(params.selection); return getClient().webauthnCredentialsModule.findMany(args).unwrap(); } /** * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state. - * + * * @example * ```ts * await prefetchWebauthnCredentialsModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchWebauthnCredentialsModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebauthnCredentialsModuleSelect>; -}): Promise; -export async function prefetchWebauthnCredentialsModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchWebauthnCredentialsModulesQuery< + S extends WebauthnCredentialsModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, WebauthnCredentialsModuleSelect>; + } +): Promise; +export async function prefetchWebauthnCredentialsModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: webauthnCredentialsModuleKeys.list(args), - queryFn: () => getClient().webauthnCredentialsModule.findMany(args).unwrap() + queryFn: () => getClient().webauthnCredentialsModule.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useWebhookModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useWebhookModuleQuery.ts index 57166e6bec..6ac33a934d 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useWebhookModuleQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useWebhookModuleQuery.ts @@ -4,20 +4,20 @@ * 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 { webhookModuleKeys } from "../query-keys"; -import type { WebhookModuleSelect, WebhookModuleWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookModuleSelect, WebhookModuleWithRelations } from "../../orm/input-types"; +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 { webhookModuleKeys } from '../query-keys'; +import type { WebhookModuleSelect, WebhookModuleWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { WebhookModuleSelect, WebhookModuleWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webhookModuleQueryKey = webhookModuleKeys.detail; /** * Query hook for fetching a single WebhookModule - * + * * @example * ```tsx * const { data, isLoading } = useWebhookModuleQuery({ @@ -26,38 +26,52 @@ export const webhookModuleQueryKey = webhookModuleKeys.detail; * }); * ``` */ -export function useWebhookModuleQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebhookModuleSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebhookModuleQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useWebhookModuleQuery< + S extends WebhookModuleSelect, + TData = { + webhookModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebhookModuleSelect>; + } & Omit< + UseQueryOptions< + { + webhookModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebhookModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webhookModuleKeys.detail(params.id), - queryFn: () => getClient().webhookModule.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .webhookModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Fetch a single WebhookModule without React hooks - * + * * @example * ```ts * const data = await fetchWebhookModuleQuery({ @@ -79,35 +93,46 @@ export async function fetchWebhookModuleQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().webhookModule.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .webhookModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Prefetch a single WebhookModule for SSR or cache warming - * + * * @example * ```ts * await prefetchWebhookModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchWebhookModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, WebhookModuleSelect>; -}): Promise; -export async function prefetchWebhookModuleQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchWebhookModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, WebhookModuleSelect>; + } +): Promise; +export async function prefetchWebhookModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: webhookModuleKeys.detail(params.id), - queryFn: () => getClient().webhookModule.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .webhookModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/modules/hooks/queries/useWebhookModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useWebhookModulesQuery.ts index b0f82c5117..e07c8c502c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/useWebhookModulesQuery.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/useWebhookModulesQuery.ts @@ -4,20 +4,35 @@ * 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 { webhookModuleKeys } from "../query-keys"; -import type { WebhookModuleSelect, WebhookModuleWithRelations, WebhookModuleFilter, WebhookModuleOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { WebhookModuleSelect, WebhookModuleWithRelations, WebhookModuleFilter, WebhookModuleOrderBy } from "../../orm/input-types"; +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 { webhookModuleKeys } from '../query-keys'; +import type { + WebhookModuleSelect, + WebhookModuleWithRelations, + WebhookModuleFilter, + WebhookModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + WebhookModuleSelect, + WebhookModuleWithRelations, + WebhookModuleFilter, + WebhookModuleOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const webhookModulesQueryKey = webhookModuleKeys.list; /** * Query hook for fetching WebhookModule list - * + * * @example * ```tsx * const { data, isLoading } = useWebhookModulesQuery({ @@ -30,33 +45,49 @@ export const webhookModulesQueryKey = webhookModuleKeys.list; * }); * ``` */ -export function useWebhookModulesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookModuleSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useWebhookModulesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useWebhookModulesQuery< + S extends WebhookModuleSelect, + TData = { + webhookModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, WebhookModuleSelect>; + } & Omit< + UseQueryOptions< + { + webhookModules: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useWebhookModulesQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + WebhookModuleSelect, + WebhookModuleFilter, + WebhookModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: webhookModuleKeys.list(args), queryFn: () => getClient().webhookModule.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch WebhookModule list without React hooks - * + * * @example * ```ts * const data = await fetchWebhookModulesQuery({ @@ -70,35 +101,51 @@ export function useWebhookModulesQuery(params: { export async function fetchWebhookModulesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookModuleSelect>; + } & Omit, 'fields'> & + HookStrictSelect, WebhookModuleSelect>; }): Promise<{ webhookModules: ConnectionResult>; }>; export async function fetchWebhookModulesQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + WebhookModuleSelect, + WebhookModuleFilter, + WebhookModuleOrderBy + >(params.selection); return getClient().webhookModule.findMany(args).unwrap(); } /** * Prefetch WebhookModule list for SSR or cache warming - * + * * @example * ```ts * await prefetchWebhookModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchWebhookModulesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, WebhookModuleSelect>; -}): Promise; -export async function prefetchWebhookModulesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchWebhookModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, WebhookModuleSelect>; + } +): Promise; +export async function prefetchWebhookModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + WebhookModuleSelect, + WebhookModuleFilter, + WebhookModuleOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: webhookModuleKeys.list(args), - queryFn: () => getClient().webhookModule.findMany(args).unwrap() + queryFn: () => getClient().webhookModule.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 1c0b7d1043..c345092197 100644 --- a/sdk/constructive-react/src/modules/hooks/query-keys.ts +++ b/sdk/constructive-react/src/modules/hooks/query-keys.ts @@ -20,529 +20,680 @@ // ============================================================================ export const agentModuleKeys = { - /** All agentModule queries */all: ["agentmodule"] as const, - /** List query keys */lists: () => [...agentModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...agentModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...agentModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...agentModuleKeys.details(), id] as const + /** All agentModule queries */ all: ['agentmodule'] as const, + /** List query keys */ lists: () => [...agentModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...agentModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...agentModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...agentModuleKeys.details(), id] as const, } as const; export const apiSurfaceModuleKeys = { - /** All apiSurfaceModule queries */all: ["apisurfacemodule"] as const, - /** List query keys */lists: () => [...apiSurfaceModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...apiSurfaceModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...apiSurfaceModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...apiSurfaceModuleKeys.details(), id] as const + /** All apiSurfaceModule queries */ all: ['apisurfacemodule'] as const, + /** List query keys */ lists: () => [...apiSurfaceModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...apiSurfaceModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...apiSurfaceModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...apiSurfaceModuleKeys.details(), id] as const, } as const; export const appModuleKeys = { - /** All appModule queries */all: ["appmodule"] as const, - /** List query keys */lists: () => [...appModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appModuleKeys.details(), id] as const + /** All appModule queries */ all: ['appmodule'] as const, + /** List query keys */ lists: () => [...appModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appModuleKeys.details(), id] as const, } as const; export const billingModuleKeys = { - /** All billingModule queries */all: ["billingmodule"] as const, - /** List query keys */lists: () => [...billingModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...billingModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...billingModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...billingModuleKeys.details(), id] as const + /** All billingModule queries */ all: ['billingmodule'] as const, + /** List query keys */ lists: () => [...billingModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...billingModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...billingModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...billingModuleKeys.details(), id] as const, } as const; export const billingProviderModuleKeys = { - /** All billingProviderModule queries */all: ["billingprovidermodule"] as const, - /** List query keys */lists: () => [...billingProviderModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...billingProviderModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...billingProviderModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...billingProviderModuleKeys.details(), id] as const + /** All billingProviderModule queries */ all: ['billingprovidermodule'] as const, + /** List query keys */ lists: () => [...billingProviderModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...billingProviderModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...billingProviderModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...billingProviderModuleKeys.details(), id] as const, } as const; export const blueprintKeys = { - /** All blueprint queries */all: ["blueprint"] as const, - /** List query keys */lists: () => [...blueprintKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...blueprintKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...blueprintKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...blueprintKeys.details(), id] as const + /** All blueprint queries */ all: ['blueprint'] as const, + /** List query keys */ lists: () => [...blueprintKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...blueprintKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...blueprintKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...blueprintKeys.details(), id] as const, } as const; export const blueprintConstructionKeys = { - /** All blueprintConstruction queries */all: ["blueprintconstruction"] as const, - /** List query keys */lists: () => [...blueprintConstructionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...blueprintConstructionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...blueprintConstructionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...blueprintConstructionKeys.details(), id] as const + /** All blueprintConstruction queries */ all: ['blueprintconstruction'] as const, + /** List query keys */ lists: () => [...blueprintConstructionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...blueprintConstructionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...blueprintConstructionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...blueprintConstructionKeys.details(), id] as const, } as const; export const blueprintTemplateKeys = { - /** All blueprintTemplate queries */all: ["blueprinttemplate"] as const, - /** List query keys */lists: () => [...blueprintTemplateKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...blueprintTemplateKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...blueprintTemplateKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...blueprintTemplateKeys.details(), id] as const + /** All blueprintTemplate queries */ all: ['blueprinttemplate'] as const, + /** List query keys */ lists: () => [...blueprintTemplateKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...blueprintTemplateKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...blueprintTemplateKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...blueprintTemplateKeys.details(), id] as const, } as const; export const catalogModuleKeys = { - /** All catalogModule queries */all: ["catalogmodule"] as const, - /** List query keys */lists: () => [...catalogModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...catalogModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...catalogModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...catalogModuleKeys.details(), id] as const + /** All catalogModule queries */ all: ['catalogmodule'] as const, + /** List query keys */ lists: () => [...catalogModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...catalogModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...catalogModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...catalogModuleKeys.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, - /** List query key with variables */list: (variables?: object) => [...computeLogModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...computeLogModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...computeLogModuleKeys.details(), id] as const + /** All computeLogModule queries */ all: ['computelogmodule'] as const, + /** List query keys */ lists: () => [...computeLogModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...computeLogModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...computeLogModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...computeLogModuleKeys.details(), id] as const, } as const; export const configSecretsUserModuleKeys = { - /** All configSecretsUserModule queries */all: ["configsecretsusermodule"] as const, - /** List query keys */lists: () => [...configSecretsUserModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...configSecretsUserModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...configSecretsUserModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...configSecretsUserModuleKeys.details(), id] as const + /** All configSecretsUserModule queries */ all: ['configsecretsusermodule'] as const, + /** List query keys */ lists: () => [...configSecretsUserModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...configSecretsUserModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...configSecretsUserModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...configSecretsUserModuleKeys.details(), id] as const, } as const; export const connectedAccountsModuleKeys = { - /** All connectedAccountsModule queries */all: ["connectedaccountsmodule"] as const, - /** List query keys */lists: () => [...connectedAccountsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...connectedAccountsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...connectedAccountsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...connectedAccountsModuleKeys.details(), id] as const + /** All connectedAccountsModule queries */ all: ['connectedaccountsmodule'] as const, + /** List query keys */ lists: () => [...connectedAccountsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...connectedAccountsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...connectedAccountsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...connectedAccountsModuleKeys.details(), id] as const, } as const; export const cryptoAddressesModuleKeys = { - /** All cryptoAddressesModule queries */all: ["cryptoaddressesmodule"] as const, - /** List query keys */lists: () => [...cryptoAddressesModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...cryptoAddressesModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...cryptoAddressesModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...cryptoAddressesModuleKeys.details(), id] as const + /** All cryptoAddressesModule queries */ all: ['cryptoaddressesmodule'] as const, + /** List query keys */ lists: () => [...cryptoAddressesModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...cryptoAddressesModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...cryptoAddressesModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...cryptoAddressesModuleKeys.details(), id] as const, } as const; export const cryptoAuthModuleKeys = { - /** All cryptoAuthModule queries */all: ["cryptoauthmodule"] as const, - /** List query keys */lists: () => [...cryptoAuthModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...cryptoAuthModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...cryptoAuthModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...cryptoAuthModuleKeys.details(), id] as const + /** All cryptoAuthModule queries */ all: ['cryptoauthmodule'] as const, + /** List query keys */ lists: () => [...cryptoAuthModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...cryptoAuthModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...cryptoAuthModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...cryptoAuthModuleKeys.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, - /** List query key with variables */list: (variables?: object) => [...databaseProvisionModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...databaseProvisionModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...databaseProvisionModuleKeys.details(), id] as const + /** All databaseProvisionModule queries */ all: ['databaseprovisionmodule'] as const, + /** List query keys */ lists: () => [...databaseProvisionModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...databaseProvisionModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...databaseProvisionModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...databaseProvisionModuleKeys.details(), id] as const, } as const; export const databaseSettingsModuleKeys = { - /** All databaseSettingsModule queries */all: ["databasesettingsmodule"] as const, - /** List query keys */lists: () => [...databaseSettingsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...databaseSettingsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...databaseSettingsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...databaseSettingsModuleKeys.details(), id] as const + /** All databaseSettingsModule queries */ all: ['databasesettingsmodule'] as const, + /** List query keys */ lists: () => [...databaseSettingsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...databaseSettingsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...databaseSettingsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...databaseSettingsModuleKeys.details(), id] as const, } as const; export const dbPoolConfigKeys = { - /** All dbPoolConfig queries */all: ["dbpoolconfig"] as const, - /** List query keys */lists: () => [...dbPoolConfigKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...dbPoolConfigKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...dbPoolConfigKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...dbPoolConfigKeys.details(), id] as const + /** All dbPoolConfig queries */ all: ['dbpoolconfig'] as const, + /** List query keys */ lists: () => [...dbPoolConfigKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...dbPoolConfigKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...dbPoolConfigKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...dbPoolConfigKeys.details(), id] as const, } as const; export const dbPoolKeys = { - /** All dbPool queries */all: ["dbpool"] as const, - /** List query keys */lists: () => [...dbPoolKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...dbPoolKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...dbPoolKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...dbPoolKeys.details(), id] as const + /** All dbPool queries */ all: ['dbpool'] as const, + /** List query keys */ lists: () => [...dbPoolKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...dbPoolKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...dbPoolKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...dbPoolKeys.details(), id] as const, } as const; export const dbPresetModuleKeys = { - /** All dbPresetModule queries */all: ["dbpresetmodule"] as const, - /** List query keys */lists: () => [...dbPresetModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...dbPresetModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...dbPresetModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...dbPresetModuleKeys.details(), id] as const + /** All dbPresetModule queries */ all: ['dbpresetmodule'] as const, + /** List query keys */ lists: () => [...dbPresetModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...dbPresetModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...dbPresetModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...dbPresetModuleKeys.details(), id] as const, } as const; export const dbUsageModuleKeys = { - /** All dbUsageModule queries */all: ["dbusagemodule"] as const, - /** List query keys */lists: () => [...dbUsageModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...dbUsageModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...dbUsageModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...dbUsageModuleKeys.details(), id] as const + /** All dbUsageModule queries */ all: ['dbusagemodule'] as const, + /** List query keys */ lists: () => [...dbUsageModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...dbUsageModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...dbUsageModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...dbUsageModuleKeys.details(), id] as const, } as const; export const defaultIdsModuleKeys = { - /** All defaultIdsModule queries */all: ["defaultidsmodule"] as const, - /** List query keys */lists: () => [...defaultIdsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...defaultIdsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...defaultIdsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...defaultIdsModuleKeys.details(), id] as const + /** All defaultIdsModule queries */ all: ['defaultidsmodule'] as const, + /** List query keys */ lists: () => [...defaultIdsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...defaultIdsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...defaultIdsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...defaultIdsModuleKeys.details(), id] as const, } as const; export const denormalizedTableFieldKeys = { - /** All denormalizedTableField queries */all: ["denormalizedtablefield"] as const, - /** List query keys */lists: () => [...denormalizedTableFieldKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...denormalizedTableFieldKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...denormalizedTableFieldKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...denormalizedTableFieldKeys.details(), id] as const + /** All denormalizedTableField queries */ all: ['denormalizedtablefield'] as const, + /** List query keys */ lists: () => [...denormalizedTableFieldKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...denormalizedTableFieldKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...denormalizedTableFieldKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...denormalizedTableFieldKeys.details(), id] as const, } as const; export const devicesModuleKeys = { - /** All devicesModule queries */all: ["devicesmodule"] as const, - /** List query keys */lists: () => [...devicesModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...devicesModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...devicesModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...devicesModuleKeys.details(), id] as const + /** All devicesModule queries */ all: ['devicesmodule'] as const, + /** List query keys */ lists: () => [...devicesModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...devicesModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...devicesModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...devicesModuleKeys.details(), id] as const, } as const; export const domainModuleKeys = { - /** All domainModule queries */all: ["domainmodule"] as const, - /** List query keys */lists: () => [...domainModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...domainModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...domainModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...domainModuleKeys.details(), id] as const + /** All domainModule queries */ all: ['domainmodule'] as const, + /** List query keys */ lists: () => [...domainModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...domainModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...domainModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...domainModuleKeys.details(), id] as const, } as const; export const emailsModuleKeys = { - /** All emailsModule queries */all: ["emailsmodule"] as const, - /** List query keys */lists: () => [...emailsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...emailsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...emailsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...emailsModuleKeys.details(), id] as const + /** All emailsModule queries */ all: ['emailsmodule'] as const, + /** List query keys */ lists: () => [...emailsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...emailsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...emailsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...emailsModuleKeys.details(), id] as const, } as const; export const entityTypeProvisionKeys = { - /** All entityTypeProvision queries */all: ["entitytypeprovision"] as const, - /** List query keys */lists: () => [...entityTypeProvisionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...entityTypeProvisionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...entityTypeProvisionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...entityTypeProvisionKeys.details(), id] as const + /** All entityTypeProvision queries */ all: ['entitytypeprovision'] as const, + /** List query keys */ lists: () => [...entityTypeProvisionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...entityTypeProvisionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...entityTypeProvisionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...entityTypeProvisionKeys.details(), id] as const, } as const; export const eventsModuleKeys = { - /** All eventsModule queries */all: ["eventsmodule"] as const, - /** List query keys */lists: () => [...eventsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...eventsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...eventsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...eventsModuleKeys.details(), id] as const + /** All eventsModule queries */ all: ['eventsmodule'] as const, + /** List query keys */ lists: () => [...eventsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...eventsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...eventsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...eventsModuleKeys.details(), id] as const, } as const; export const functionDeploymentModuleKeys = { - /** All functionDeploymentModule queries */all: ["functiondeploymentmodule"] as const, - /** List query keys */lists: () => [...functionDeploymentModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionDeploymentModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionDeploymentModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionDeploymentModuleKeys.details(), id] as const + /** All functionDeploymentModule queries */ all: ['functiondeploymentmodule'] as const, + /** List query keys */ lists: () => [...functionDeploymentModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionDeploymentModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionDeploymentModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionDeploymentModuleKeys.details(), id] as const, } as const; export const functionInvocationModuleKeys = { - /** All functionInvocationModule queries */all: ["functioninvocationmodule"] as const, - /** List query keys */lists: () => [...functionInvocationModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionInvocationModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionInvocationModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionInvocationModuleKeys.details(), id] as const + /** All functionInvocationModule queries */ all: ['functioninvocationmodule'] as const, + /** List query keys */ lists: () => [...functionInvocationModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionInvocationModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionInvocationModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionInvocationModuleKeys.details(), id] as const, } as const; export const functionModuleKeys = { - /** All functionModule queries */all: ["functionmodule"] as const, - /** List query keys */lists: () => [...functionModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...functionModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...functionModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...functionModuleKeys.details(), id] as const + /** All functionModule queries */ all: ['functionmodule'] as const, + /** List query keys */ lists: () => [...functionModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionModuleKeys.details(), id] as const, } as const; export const graphExecutionModuleKeys = { - /** All graphExecutionModule queries */all: ["graphexecutionmodule"] as const, - /** List query keys */lists: () => [...graphExecutionModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...graphExecutionModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...graphExecutionModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...graphExecutionModuleKeys.details(), id] as const + /** All graphExecutionModule queries */ all: ['graphexecutionmodule'] as const, + /** List query keys */ lists: () => [...graphExecutionModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...graphExecutionModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...graphExecutionModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...graphExecutionModuleKeys.details(), id] as const, } as const; export const 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 + /** 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 hierarchyModuleKeys = { - /** All hierarchyModule queries */all: ["hierarchymodule"] as const, - /** List query keys */lists: () => [...hierarchyModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...hierarchyModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...hierarchyModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...hierarchyModuleKeys.details(), id] as const + /** All hierarchyModule queries */ all: ['hierarchymodule'] as const, + /** List query keys */ lists: () => [...hierarchyModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...hierarchyModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...hierarchyModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...hierarchyModuleKeys.details(), id] as const, } as const; export const httpRouteModuleKeys = { - /** All httpRouteModule queries */all: ["httproutemodule"] as const, - /** List query keys */lists: () => [...httpRouteModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...httpRouteModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...httpRouteModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...httpRouteModuleKeys.details(), id] as const + /** All httpRouteModule queries */ all: ['httproutemodule'] as const, + /** List query keys */ lists: () => [...httpRouteModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...httpRouteModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...httpRouteModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...httpRouteModuleKeys.details(), id] as const, } as const; export const i18NModuleKeys = { - /** All i18NModule queries */all: ["i18nmodule"] as const, - /** List query keys */lists: () => [...i18NModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...i18NModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...i18NModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...i18NModuleKeys.details(), id] as const + /** All i18NModule queries */ all: ['i18nmodule'] as const, + /** List query keys */ lists: () => [...i18NModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...i18NModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...i18NModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...i18NModuleKeys.details(), id] as const, } as const; export const identityProvidersModuleKeys = { - /** All identityProvidersModule queries */all: ["identityprovidersmodule"] as const, - /** List query keys */lists: () => [...identityProvidersModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...identityProvidersModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...identityProvidersModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...identityProvidersModuleKeys.details(), id] as const + /** All identityProvidersModule queries */ all: ['identityprovidersmodule'] as const, + /** List query keys */ lists: () => [...identityProvidersModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...identityProvidersModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...identityProvidersModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...identityProvidersModuleKeys.details(), id] as const, } as const; export const inferenceLogModuleKeys = { - /** All inferenceLogModule queries */all: ["inferencelogmodule"] as const, - /** List query keys */lists: () => [...inferenceLogModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...inferenceLogModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...inferenceLogModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...inferenceLogModuleKeys.details(), id] as const + /** All inferenceLogModule queries */ all: ['inferencelogmodule'] as const, + /** List query keys */ lists: () => [...inferenceLogModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...inferenceLogModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...inferenceLogModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...inferenceLogModuleKeys.details(), id] as const, } as const; export const infraConfigModuleKeys = { - /** All infraConfigModule queries */all: ["infraconfigmodule"] as const, - /** List query keys */lists: () => [...infraConfigModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...infraConfigModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...infraConfigModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...infraConfigModuleKeys.details(), id] as const + /** All infraConfigModule queries */ all: ['infraconfigmodule'] as const, + /** List query keys */ lists: () => [...infraConfigModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...infraConfigModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...infraConfigModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...infraConfigModuleKeys.details(), id] as const, } as const; export const infraSecretsModuleKeys = { - /** All infraSecretsModule queries */all: ["infrasecretsmodule"] as const, - /** List query keys */lists: () => [...infraSecretsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...infraSecretsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...infraSecretsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...infraSecretsModuleKeys.details(), id] as const + /** All infraSecretsModule queries */ all: ['infrasecretsmodule'] as const, + /** List query keys */ lists: () => [...infraSecretsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...infraSecretsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...infraSecretsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...infraSecretsModuleKeys.details(), id] as const, } as const; export const integrationProvidersModuleKeys = { - /** All integrationProvidersModule queries */all: ["integrationprovidersmodule"] as const, - /** List query keys */lists: () => [...integrationProvidersModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...integrationProvidersModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...integrationProvidersModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...integrationProvidersModuleKeys.details(), id] as const + /** All integrationProvidersModule queries */ all: ['integrationprovidersmodule'] as const, + /** List query keys */ lists: () => [...integrationProvidersModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...integrationProvidersModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...integrationProvidersModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...integrationProvidersModuleKeys.details(), id] as const, } as const; export const internalSecretsModuleKeys = { - /** All internalSecretsModule queries */all: ["internalsecretsmodule"] as const, - /** List query keys */lists: () => [...internalSecretsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...internalSecretsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...internalSecretsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...internalSecretsModuleKeys.details(), id] as const + /** All internalSecretsModule queries */ all: ['internalsecretsmodule'] as const, + /** List query keys */ lists: () => [...internalSecretsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...internalSecretsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...internalSecretsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...internalSecretsModuleKeys.details(), id] as const, } as const; export const invitesModuleKeys = { - /** All invitesModule queries */all: ["invitesmodule"] as const, - /** List query keys */lists: () => [...invitesModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...invitesModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...invitesModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...invitesModuleKeys.details(), id] as const + /** All invitesModule queries */ all: ['invitesmodule'] as const, + /** List query keys */ lists: () => [...invitesModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...invitesModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...invitesModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...invitesModuleKeys.details(), id] as const, } as const; export const limitsModuleKeys = { - /** All limitsModule queries */all: ["limitsmodule"] as const, - /** List query keys */lists: () => [...limitsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...limitsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...limitsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...limitsModuleKeys.details(), id] as const + /** All limitsModule queries */ all: ['limitsmodule'] as const, + /** List query keys */ lists: () => [...limitsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...limitsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...limitsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...limitsModuleKeys.details(), id] as const, } as const; export const membershipTypesModuleKeys = { - /** All membershipTypesModule queries */all: ["membershiptypesmodule"] as const, - /** List query keys */lists: () => [...membershipTypesModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...membershipTypesModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...membershipTypesModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...membershipTypesModuleKeys.details(), id] as const + /** All membershipTypesModule queries */ all: ['membershiptypesmodule'] as const, + /** List query keys */ lists: () => [...membershipTypesModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...membershipTypesModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...membershipTypesModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...membershipTypesModuleKeys.details(), id] as const, } as const; export const membershipsModuleKeys = { - /** All membershipsModule queries */all: ["membershipsmodule"] as const, - /** List query keys */lists: () => [...membershipsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...membershipsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...membershipsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...membershipsModuleKeys.details(), id] as const + /** All membershipsModule queries */ all: ['membershipsmodule'] as const, + /** List query keys */ lists: () => [...membershipsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...membershipsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...membershipsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...membershipsModuleKeys.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 + /** 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 namespaceModuleKeys = { - /** All namespaceModule queries */all: ["namespacemodule"] as const, - /** List query keys */lists: () => [...namespaceModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...namespaceModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...namespaceModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...namespaceModuleKeys.details(), id] as const + /** All namespaceModule queries */ all: ['namespacemodule'] as const, + /** List query keys */ lists: () => [...namespaceModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...namespaceModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...namespaceModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...namespaceModuleKeys.details(), id] as const, } as const; export const notificationsModuleKeys = { - /** All notificationsModule queries */all: ["notificationsmodule"] as const, - /** List query keys */lists: () => [...notificationsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...notificationsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...notificationsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...notificationsModuleKeys.details(), id] as const + /** All notificationsModule queries */ all: ['notificationsmodule'] as const, + /** List query keys */ lists: () => [...notificationsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...notificationsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...notificationsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...notificationsModuleKeys.details(), id] as const, } as const; export const permissionsModuleKeys = { - /** All permissionsModule queries */all: ["permissionsmodule"] as const, - /** List query keys */lists: () => [...permissionsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...permissionsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...permissionsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...permissionsModuleKeys.details(), id] as const + /** All permissionsModule queries */ all: ['permissionsmodule'] as const, + /** List query keys */ lists: () => [...permissionsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...permissionsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...permissionsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...permissionsModuleKeys.details(), id] as const, } as const; export const phoneNumbersModuleKeys = { - /** All phoneNumbersModule queries */all: ["phonenumbersmodule"] as const, - /** List query keys */lists: () => [...phoneNumbersModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...phoneNumbersModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...phoneNumbersModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...phoneNumbersModuleKeys.details(), id] as const + /** All phoneNumbersModule queries */ all: ['phonenumbersmodule'] as const, + /** List query keys */ lists: () => [...phoneNumbersModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...phoneNumbersModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...phoneNumbersModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...phoneNumbersModuleKeys.details(), id] as const, } as const; export const plansModuleKeys = { - /** All plansModule queries */all: ["plansmodule"] as const, - /** List query keys */lists: () => [...plansModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...plansModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...plansModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...plansModuleKeys.details(), id] as const + /** All plansModule queries */ all: ['plansmodule'] as const, + /** List query keys */ lists: () => [...plansModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...plansModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...plansModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...plansModuleKeys.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 + /** 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 profilesModuleKeys = { - /** All profilesModule queries */all: ["profilesmodule"] as const, - /** List query keys */lists: () => [...profilesModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...profilesModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...profilesModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...profilesModuleKeys.details(), id] as const + /** All profilesModule queries */ all: ['profilesmodule'] as const, + /** List query keys */ lists: () => [...profilesModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...profilesModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...profilesModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...profilesModuleKeys.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, - /** List query key with variables */list: (variables?: object) => [...rateLimitMetersModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...rateLimitMetersModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...rateLimitMetersModuleKeys.details(), id] as const + /** All rateLimitMetersModule queries */ all: ['ratelimitmetersmodule'] as const, + /** List query keys */ lists: () => [...rateLimitMetersModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...rateLimitMetersModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...rateLimitMetersModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...rateLimitMetersModuleKeys.details(), id] as const, } as const; export const rateLimitsModuleKeys = { - /** All rateLimitsModule queries */all: ["ratelimitsmodule"] as const, - /** List query keys */lists: () => [...rateLimitsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...rateLimitsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...rateLimitsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...rateLimitsModuleKeys.details(), id] as const + /** All rateLimitsModule queries */ all: ['ratelimitsmodule'] as const, + /** List query keys */ lists: () => [...rateLimitsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...rateLimitsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...rateLimitsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...rateLimitsModuleKeys.details(), id] as const, } as const; export const realtimeModuleKeys = { - /** All realtimeModule queries */all: ["realtimemodule"] as const, - /** List query keys */lists: () => [...realtimeModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...realtimeModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...realtimeModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...realtimeModuleKeys.details(), id] as const + /** All realtimeModule queries */ all: ['realtimemodule'] as const, + /** List query keys */ lists: () => [...realtimeModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...realtimeModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...realtimeModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...realtimeModuleKeys.details(), id] as const, } as const; export const relationProvisionKeys = { - /** All relationProvision queries */all: ["relationprovision"] as const, - /** List query keys */lists: () => [...relationProvisionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...relationProvisionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...relationProvisionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...relationProvisionKeys.details(), id] as const + /** All relationProvision queries */ all: ['relationprovision'] as const, + /** List query keys */ lists: () => [...relationProvisionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...relationProvisionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...relationProvisionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...relationProvisionKeys.details(), id] as const, } as const; export const resourceModuleKeys = { - /** All resourceModule queries */all: ["resourcemodule"] as const, - /** List query keys */lists: () => [...resourceModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...resourceModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...resourceModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...resourceModuleKeys.details(), id] as const + /** All resourceModule queries */ all: ['resourcemodule'] as const, + /** List query keys */ lists: () => [...resourceModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...resourceModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...resourceModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...resourceModuleKeys.details(), id] as const, } as const; export const rlsModuleKeys = { - /** All rlsModule queries */all: ["rlsmodule"] as const, - /** List query keys */lists: () => [...rlsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...rlsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...rlsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...rlsModuleKeys.details(), id] as const + /** All rlsModule queries */ all: ['rlsmodule'] as const, + /** List query keys */ lists: () => [...rlsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...rlsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...rlsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...rlsModuleKeys.details(), id] as const, } as const; export const routeModuleKeys = { - /** All routeModule queries */all: ["routemodule"] as const, - /** List query keys */lists: () => [...routeModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...routeModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...routeModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...routeModuleKeys.details(), id] as const + /** All routeModule queries */ all: ['routemodule'] as const, + /** List query keys */ lists: () => [...routeModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...routeModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...routeModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...routeModuleKeys.details(), id] as const, } as const; export const secureTableProvisionKeys = { - /** All secureTableProvision queries */all: ["securetableprovision"] as const, - /** List query keys */lists: () => [...secureTableProvisionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...secureTableProvisionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...secureTableProvisionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...secureTableProvisionKeys.details(), id] as const + /** All secureTableProvision queries */ all: ['securetableprovision'] as const, + /** List query keys */ lists: () => [...secureTableProvisionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...secureTableProvisionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...secureTableProvisionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...secureTableProvisionKeys.details(), id] as const, } as const; export const sessionSecretsModuleKeys = { - /** All sessionSecretsModule queries */all: ["sessionsecretsmodule"] as const, - /** List query keys */lists: () => [...sessionSecretsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...sessionSecretsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...sessionSecretsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...sessionSecretsModuleKeys.details(), id] as const + /** All sessionSecretsModule queries */ all: ['sessionsecretsmodule'] as const, + /** List query keys */ lists: () => [...sessionSecretsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...sessionSecretsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...sessionSecretsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...sessionSecretsModuleKeys.details(), id] as const, } as const; export const sessionsModuleKeys = { - /** All sessionsModule queries */all: ["sessionsmodule"] as const, - /** List query keys */lists: () => [...sessionsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...sessionsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...sessionsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...sessionsModuleKeys.details(), id] as const + /** All sessionsModule queries */ all: ['sessionsmodule'] as const, + /** List query keys */ lists: () => [...sessionsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...sessionsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...sessionsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...sessionsModuleKeys.details(), id] as const, } as const; export const siteSurfaceModuleKeys = { - /** All siteSurfaceModule queries */all: ["sitesurfacemodule"] as const, - /** List query keys */lists: () => [...siteSurfaceModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...siteSurfaceModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...siteSurfaceModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...siteSurfaceModuleKeys.details(), id] as const + /** All siteSurfaceModule queries */ all: ['sitesurfacemodule'] as const, + /** List query keys */ lists: () => [...siteSurfaceModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...siteSurfaceModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...siteSurfaceModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...siteSurfaceModuleKeys.details(), id] as const, } as const; export const storageLogModuleKeys = { - /** All storageLogModule queries */all: ["storagelogmodule"] as const, - /** List query keys */lists: () => [...storageLogModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...storageLogModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...storageLogModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...storageLogModuleKeys.details(), id] as const + /** All storageLogModule queries */ all: ['storagelogmodule'] as const, + /** List query keys */ lists: () => [...storageLogModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...storageLogModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...storageLogModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...storageLogModuleKeys.details(), id] as const, } as const; export const storageModuleKeys = { - /** All storageModule queries */all: ["storagemodule"] as const, - /** List query keys */lists: () => [...storageModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...storageModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...storageModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...storageModuleKeys.details(), id] as const + /** All storageModule queries */ all: ['storagemodule'] as const, + /** List query keys */ lists: () => [...storageModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...storageModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...storageModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...storageModuleKeys.details(), id] as const, } as const; export const transferLogModuleKeys = { - /** All transferLogModule queries */all: ["transferlogmodule"] as const, - /** List query keys */lists: () => [...transferLogModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...transferLogModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...transferLogModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...transferLogModuleKeys.details(), id] as const + /** All transferLogModule queries */ all: ['transferlogmodule'] as const, + /** List query keys */ lists: () => [...transferLogModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...transferLogModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...transferLogModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...transferLogModuleKeys.details(), id] as const, } as const; export const userAuthModuleKeys = { - /** All userAuthModule queries */all: ["userauthmodule"] as const, - /** List query keys */lists: () => [...userAuthModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...userAuthModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...userAuthModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...userAuthModuleKeys.details(), id] as const + /** All userAuthModule queries */ all: ['userauthmodule'] as const, + /** List query keys */ lists: () => [...userAuthModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...userAuthModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...userAuthModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...userAuthModuleKeys.details(), id] as const, } as const; export const userCredentialsModuleKeys = { - /** All userCredentialsModule queries */all: ["usercredentialsmodule"] as const, - /** List query keys */lists: () => [...userCredentialsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...userCredentialsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...userCredentialsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...userCredentialsModuleKeys.details(), id] as const + /** All userCredentialsModule queries */ all: ['usercredentialsmodule'] as const, + /** List query keys */ lists: () => [...userCredentialsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...userCredentialsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...userCredentialsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...userCredentialsModuleKeys.details(), id] as const, } as const; export const userSettingsModuleKeys = { - /** All userSettingsModule queries */all: ["usersettingsmodule"] as const, - /** List query keys */lists: () => [...userSettingsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...userSettingsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...userSettingsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...userSettingsModuleKeys.details(), id] as const + /** All userSettingsModule queries */ all: ['usersettingsmodule'] as const, + /** List query keys */ lists: () => [...userSettingsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...userSettingsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...userSettingsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...userSettingsModuleKeys.details(), id] as const, } as const; export const userStateModuleKeys = { - /** All userStateModule queries */all: ["userstatemodule"] as const, - /** List query keys */lists: () => [...userStateModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...userStateModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...userStateModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...userStateModuleKeys.details(), id] as const + /** All userStateModule queries */ all: ['userstatemodule'] as const, + /** List query keys */ lists: () => [...userStateModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...userStateModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...userStateModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...userStateModuleKeys.details(), id] as const, } as const; export const usersModuleKeys = { - /** All usersModule queries */all: ["usersmodule"] as const, - /** List query keys */lists: () => [...usersModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...usersModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...usersModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...usersModuleKeys.details(), id] as const + /** All usersModule queries */ all: ['usersmodule'] as const, + /** List query keys */ lists: () => [...usersModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...usersModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...usersModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...usersModuleKeys.details(), id] as const, } as const; export const webauthnAuthModuleKeys = { - /** All webauthnAuthModule queries */all: ["webauthnauthmodule"] as const, - /** List query keys */lists: () => [...webauthnAuthModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...webauthnAuthModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...webauthnAuthModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...webauthnAuthModuleKeys.details(), id] as const + /** All webauthnAuthModule queries */ all: ['webauthnauthmodule'] as const, + /** List query keys */ lists: () => [...webauthnAuthModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...webauthnAuthModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...webauthnAuthModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...webauthnAuthModuleKeys.details(), id] as const, } as const; export const webauthnCredentialsModuleKeys = { - /** All webauthnCredentialsModule queries */all: ["webauthncredentialsmodule"] as const, - /** List query keys */lists: () => [...webauthnCredentialsModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...webauthnCredentialsModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...webauthnCredentialsModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...webauthnCredentialsModuleKeys.details(), id] as const + /** All webauthnCredentialsModule queries */ all: ['webauthncredentialsmodule'] as const, + /** List query keys */ lists: () => [...webauthnCredentialsModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...webauthnCredentialsModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...webauthnCredentialsModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...webauthnCredentialsModuleKeys.details(), id] as const, } as const; export const webhookModuleKeys = { - /** All webhookModule queries */all: ["webhookmodule"] as const, - /** List query keys */lists: () => [...webhookModuleKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...webhookModuleKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...webhookModuleKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...webhookModuleKeys.details(), id] as const + /** All webhookModule queries */ all: ['webhookmodule'] as const, + /** List query keys */ lists: () => [...webhookModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...webhookModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...webhookModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...webhookModuleKeys.details(), id] as const, } as const; // ============================================================================ @@ -550,8 +701,10 @@ export const webhookModuleKeys = { // ============================================================================ export const customQueryKeys = { - /** Query key for resolveBlueprintField */resolveBlueprintField: (variables?: object) => ["resolveBlueprintField", variables] as const, - /** Query key for resolveBlueprintTable */resolveBlueprintTable: (variables?: object) => ["resolveBlueprintTable", variables] as const + /** Query key for resolveBlueprintField */ resolveBlueprintField: (variables?: object) => + ['resolveBlueprintField', variables] as const, + /** Query key for resolveBlueprintTable */ resolveBlueprintTable: (variables?: object) => + ['resolveBlueprintTable', variables] as const, } as const; /** @@ -651,7 +804,7 @@ export const queryKeys = { webauthnAuthModule: webauthnAuthModuleKeys, webauthnCredentialsModule: webauthnCredentialsModuleKeys, webhookModule: webhookModuleKeys, - custom: customQueryKeys + custom: customQueryKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/modules/hooks/selection.ts b/sdk/constructive-react/src/modules/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/modules/hooks/selection.ts +++ b/sdk/constructive-react/src/modules/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/modules/index.ts b/sdk/constructive-react/src/modules/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/modules/index.ts +++ b/sdk/constructive-react/src/modules/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/modules/orm/client.ts b/sdk/constructive-react/src/modules/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/modules/orm/client.ts +++ b/sdk/constructive-react/src/modules/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/modules/orm/index.ts b/sdk/constructive-react/src/modules/orm/index.ts index e1606d62ad..f50345da8b 100644 --- a/sdk/constructive-react/src/modules/orm/index.ts +++ b/sdk/constructive-react/src/modules/orm/index.ts @@ -3,92 +3,92 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AgentModuleModel } from "./models/agentModule"; -import { ApiSurfaceModuleModel } from "./models/apiSurfaceModule"; -import { AppModuleModel } from "./models/appModule"; -import { BillingModuleModel } from "./models/billingModule"; -import { BillingProviderModuleModel } from "./models/billingProviderModule"; -import { BlueprintModel } from "./models/blueprint"; -import { BlueprintConstructionModel } from "./models/blueprintConstruction"; -import { BlueprintTemplateModel } from "./models/blueprintTemplate"; -import { CatalogModuleModel } from "./models/catalogModule"; -import { ComputeLogModuleModel } from "./models/computeLogModule"; -import { ConfigSecretsUserModuleModel } from "./models/configSecretsUserModule"; -import { ConnectedAccountsModuleModel } from "./models/connectedAccountsModule"; -import { CryptoAddressesModuleModel } from "./models/cryptoAddressesModule"; -import { CryptoAuthModuleModel } from "./models/cryptoAuthModule"; -import { DatabaseProvisionModuleModel } from "./models/databaseProvisionModule"; -import { DatabaseSettingsModuleModel } from "./models/databaseSettingsModule"; -import { DbPoolConfigModel } from "./models/dbPoolConfig"; -import { DbPoolModel } from "./models/dbPool"; -import { DbPresetModuleModel } from "./models/dbPresetModule"; -import { DbUsageModuleModel } from "./models/dbUsageModule"; -import { DefaultIdsModuleModel } from "./models/defaultIdsModule"; -import { DenormalizedTableFieldModel } from "./models/denormalizedTableField"; -import { DevicesModuleModel } from "./models/devicesModule"; -import { DomainModuleModel } from "./models/domainModule"; -import { EmailsModuleModel } from "./models/emailsModule"; -import { EntityTypeProvisionModel } from "./models/entityTypeProvision"; -import { EventsModuleModel } from "./models/eventsModule"; -import { FunctionDeploymentModuleModel } from "./models/functionDeploymentModule"; -import { FunctionInvocationModuleModel } from "./models/functionInvocationModule"; -import { FunctionModuleModel } from "./models/functionModule"; -import { GraphExecutionModuleModel } from "./models/graphExecutionModule"; -import { GraphModuleModel } from "./models/graphModule"; -import { HierarchyModuleModel } from "./models/hierarchyModule"; -import { HttpRouteModuleModel } from "./models/httpRouteModule"; -import { I18NModuleModel } from "./models/i18NModule"; -import { IdentityProvidersModuleModel } from "./models/identityProvidersModule"; -import { InferenceLogModuleModel } from "./models/inferenceLogModule"; -import { InfraConfigModuleModel } from "./models/infraConfigModule"; -import { InfraSecretsModuleModel } from "./models/infraSecretsModule"; -import { IntegrationProvidersModuleModel } from "./models/integrationProvidersModule"; -import { InternalSecretsModuleModel } from "./models/internalSecretsModule"; -import { InvitesModuleModel } from "./models/invitesModule"; -import { LimitsModuleModel } from "./models/limitsModule"; -import { MembershipTypesModuleModel } from "./models/membershipTypesModule"; -import { MembershipsModuleModel } from "./models/membershipsModule"; -import { MerkleStoreModuleModel } from "./models/merkleStoreModule"; -import { NamespaceModuleModel } from "./models/namespaceModule"; -import { NotificationsModuleModel } from "./models/notificationsModule"; -import { PermissionsModuleModel } from "./models/permissionsModule"; -import { PhoneNumbersModuleModel } from "./models/phoneNumbersModule"; -import { PlansModuleModel } from "./models/plansModule"; -import { PrincipalAuthModuleModel } from "./models/principalAuthModule"; -import { ProfilesModuleModel } from "./models/profilesModule"; -import { RateLimitMetersModuleModel } from "./models/rateLimitMetersModule"; -import { RateLimitsModuleModel } from "./models/rateLimitsModule"; -import { RealtimeModuleModel } from "./models/realtimeModule"; -import { RelationProvisionModel } from "./models/relationProvision"; -import { ResourceModuleModel } from "./models/resourceModule"; -import { RlsModuleModel } from "./models/rlsModule"; -import { RouteModuleModel } from "./models/routeModule"; -import { SecureTableProvisionModel } from "./models/secureTableProvision"; -import { SessionSecretsModuleModel } from "./models/sessionSecretsModule"; -import { SessionsModuleModel } from "./models/sessionsModule"; -import { SiteSurfaceModuleModel } from "./models/siteSurfaceModule"; -import { StorageLogModuleModel } from "./models/storageLogModule"; -import { StorageModuleModel } from "./models/storageModule"; -import { TransferLogModuleModel } from "./models/transferLogModule"; -import { UserAuthModuleModel } from "./models/userAuthModule"; -import { UserCredentialsModuleModel } from "./models/userCredentialsModule"; -import { UserSettingsModuleModel } from "./models/userSettingsModule"; -import { UserStateModuleModel } from "./models/userStateModule"; -import { UsersModuleModel } from "./models/usersModule"; -import { WebauthnAuthModuleModel } from "./models/webauthnAuthModule"; -import { WebauthnCredentialsModuleModel } from "./models/webauthnCredentialsModule"; -import { WebhookModuleModel } from "./models/webhookModule"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AgentModuleModel } from './models/agentModule'; +import { ApiSurfaceModuleModel } from './models/apiSurfaceModule'; +import { AppModuleModel } from './models/appModule'; +import { BillingModuleModel } from './models/billingModule'; +import { BillingProviderModuleModel } from './models/billingProviderModule'; +import { BlueprintModel } from './models/blueprint'; +import { BlueprintConstructionModel } from './models/blueprintConstruction'; +import { BlueprintTemplateModel } from './models/blueprintTemplate'; +import { CatalogModuleModel } from './models/catalogModule'; +import { ComputeLogModuleModel } from './models/computeLogModule'; +import { ConfigSecretsUserModuleModel } from './models/configSecretsUserModule'; +import { ConnectedAccountsModuleModel } from './models/connectedAccountsModule'; +import { CryptoAddressesModuleModel } from './models/cryptoAddressesModule'; +import { CryptoAuthModuleModel } from './models/cryptoAuthModule'; +import { DatabaseProvisionModuleModel } from './models/databaseProvisionModule'; +import { DatabaseSettingsModuleModel } from './models/databaseSettingsModule'; +import { DbPoolConfigModel } from './models/dbPoolConfig'; +import { DbPoolModel } from './models/dbPool'; +import { DbPresetModuleModel } from './models/dbPresetModule'; +import { DbUsageModuleModel } from './models/dbUsageModule'; +import { DefaultIdsModuleModel } from './models/defaultIdsModule'; +import { DenormalizedTableFieldModel } from './models/denormalizedTableField'; +import { DevicesModuleModel } from './models/devicesModule'; +import { DomainModuleModel } from './models/domainModule'; +import { EmailsModuleModel } from './models/emailsModule'; +import { EntityTypeProvisionModel } from './models/entityTypeProvision'; +import { EventsModuleModel } from './models/eventsModule'; +import { FunctionDeploymentModuleModel } from './models/functionDeploymentModule'; +import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; +import { FunctionModuleModel } from './models/functionModule'; +import { GraphExecutionModuleModel } from './models/graphExecutionModule'; +import { GraphModuleModel } from './models/graphModule'; +import { HierarchyModuleModel } from './models/hierarchyModule'; +import { HttpRouteModuleModel } from './models/httpRouteModule'; +import { I18NModuleModel } from './models/i18NModule'; +import { IdentityProvidersModuleModel } from './models/identityProvidersModule'; +import { InferenceLogModuleModel } from './models/inferenceLogModule'; +import { InfraConfigModuleModel } from './models/infraConfigModule'; +import { InfraSecretsModuleModel } from './models/infraSecretsModule'; +import { IntegrationProvidersModuleModel } from './models/integrationProvidersModule'; +import { InternalSecretsModuleModel } from './models/internalSecretsModule'; +import { InvitesModuleModel } from './models/invitesModule'; +import { LimitsModuleModel } from './models/limitsModule'; +import { MembershipTypesModuleModel } from './models/membershipTypesModule'; +import { MembershipsModuleModel } from './models/membershipsModule'; +import { MerkleStoreModuleModel } from './models/merkleStoreModule'; +import { NamespaceModuleModel } from './models/namespaceModule'; +import { NotificationsModuleModel } from './models/notificationsModule'; +import { PermissionsModuleModel } from './models/permissionsModule'; +import { PhoneNumbersModuleModel } from './models/phoneNumbersModule'; +import { PlansModuleModel } from './models/plansModule'; +import { PrincipalAuthModuleModel } from './models/principalAuthModule'; +import { ProfilesModuleModel } from './models/profilesModule'; +import { RateLimitMetersModuleModel } from './models/rateLimitMetersModule'; +import { RateLimitsModuleModel } from './models/rateLimitsModule'; +import { RealtimeModuleModel } from './models/realtimeModule'; +import { RelationProvisionModel } from './models/relationProvision'; +import { ResourceModuleModel } from './models/resourceModule'; +import { RlsModuleModel } from './models/rlsModule'; +import { RouteModuleModel } from './models/routeModule'; +import { SecureTableProvisionModel } from './models/secureTableProvision'; +import { SessionSecretsModuleModel } from './models/sessionSecretsModule'; +import { SessionsModuleModel } from './models/sessionsModule'; +import { SiteSurfaceModuleModel } from './models/siteSurfaceModule'; +import { StorageLogModuleModel } from './models/storageLogModule'; +import { StorageModuleModel } from './models/storageModule'; +import { TransferLogModuleModel } from './models/transferLogModule'; +import { UserAuthModuleModel } from './models/userAuthModule'; +import { UserCredentialsModuleModel } from './models/userCredentialsModule'; +import { UserSettingsModuleModel } from './models/userSettingsModule'; +import { UserStateModuleModel } from './models/userStateModule'; +import { UsersModuleModel } from './models/usersModule'; +import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; +import { WebauthnCredentialsModuleModel } from './models/webauthnCredentialsModule'; +import { WebhookModuleModel } from './models/webhookModule'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -191,6 +191,6 @@ export function createClient(config: OrmClientConfig) { webauthnCredentialsModule: new WebauthnCredentialsModuleModel(client), webhookModule: new WebhookModuleModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/input-types.ts b/sdk/constructive-react/src/modules/orm/input-types.ts index 14905979ef..c5c73d471c 100644 --- a/sdk/constructive-react/src/modules/orm/input-types.ts +++ b/sdk/constructive-react/src/modules/orm/input-types.ts @@ -2353,46 +2353,61 @@ export type AgentModuleWithRelations = AgentModule & AgentModuleRelations; export type ApiSurfaceModuleWithRelations = ApiSurfaceModule & ApiSurfaceModuleRelations; export type AppModuleWithRelations = AppModule & AppModuleRelations; export type BillingModuleWithRelations = BillingModule & BillingModuleRelations; -export type BillingProviderModuleWithRelations = BillingProviderModule & BillingProviderModuleRelations; +export type BillingProviderModuleWithRelations = BillingProviderModule & + BillingProviderModuleRelations; export type BlueprintWithRelations = Blueprint & BlueprintRelations; -export type BlueprintConstructionWithRelations = BlueprintConstruction & BlueprintConstructionRelations; +export type BlueprintConstructionWithRelations = BlueprintConstruction & + BlueprintConstructionRelations; export type BlueprintTemplateWithRelations = BlueprintTemplate & BlueprintTemplateRelations; export type CatalogModuleWithRelations = CatalogModule & CatalogModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; -export type ConfigSecretsUserModuleWithRelations = ConfigSecretsUserModule & ConfigSecretsUserModuleRelations; -export type ConnectedAccountsModuleWithRelations = ConnectedAccountsModule & ConnectedAccountsModuleRelations; -export type CryptoAddressesModuleWithRelations = CryptoAddressesModule & CryptoAddressesModuleRelations; +export type ConfigSecretsUserModuleWithRelations = ConfigSecretsUserModule & + ConfigSecretsUserModuleRelations; +export type ConnectedAccountsModuleWithRelations = ConnectedAccountsModule & + ConnectedAccountsModuleRelations; +export type CryptoAddressesModuleWithRelations = CryptoAddressesModule & + CryptoAddressesModuleRelations; export type CryptoAuthModuleWithRelations = CryptoAuthModule & CryptoAuthModuleRelations; -export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & DatabaseProvisionModuleRelations; -export type DatabaseSettingsModuleWithRelations = DatabaseSettingsModule & DatabaseSettingsModuleRelations; +export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & + DatabaseProvisionModuleRelations; +export type DatabaseSettingsModuleWithRelations = DatabaseSettingsModule & + DatabaseSettingsModuleRelations; export type DbPoolConfigWithRelations = DbPoolConfig & DbPoolConfigRelations; export type DbPoolWithRelations = DbPool & DbPoolRelations; export type DbPresetModuleWithRelations = DbPresetModule & DbPresetModuleRelations; export type DbUsageModuleWithRelations = DbUsageModule & DbUsageModuleRelations; export type DefaultIdsModuleWithRelations = DefaultIdsModule & DefaultIdsModuleRelations; -export type DenormalizedTableFieldWithRelations = DenormalizedTableField & DenormalizedTableFieldRelations; +export type DenormalizedTableFieldWithRelations = DenormalizedTableField & + DenormalizedTableFieldRelations; export type DevicesModuleWithRelations = DevicesModule & DevicesModuleRelations; export type DomainModuleWithRelations = DomainModule & DomainModuleRelations; export type EmailsModuleWithRelations = EmailsModule & EmailsModuleRelations; export type EntityTypeProvisionWithRelations = EntityTypeProvision & EntityTypeProvisionRelations; export type EventsModuleWithRelations = EventsModule & EventsModuleRelations; -export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & FunctionDeploymentModuleRelations; -export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; +export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & + FunctionDeploymentModuleRelations; +export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & + FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; -export type GraphExecutionModuleWithRelations = GraphExecutionModule & GraphExecutionModuleRelations; +export type GraphExecutionModuleWithRelations = GraphExecutionModule & + GraphExecutionModuleRelations; export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; export type HierarchyModuleWithRelations = HierarchyModule & HierarchyModuleRelations; export type HttpRouteModuleWithRelations = HttpRouteModule & HttpRouteModuleRelations; export type I18NModuleWithRelations = I18NModule & I18NModuleRelations; -export type IdentityProvidersModuleWithRelations = IdentityProvidersModule & IdentityProvidersModuleRelations; +export type IdentityProvidersModuleWithRelations = IdentityProvidersModule & + IdentityProvidersModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; export type InfraConfigModuleWithRelations = InfraConfigModule & InfraConfigModuleRelations; export type InfraSecretsModuleWithRelations = InfraSecretsModule & InfraSecretsModuleRelations; -export type IntegrationProvidersModuleWithRelations = IntegrationProvidersModule & IntegrationProvidersModuleRelations; -export type InternalSecretsModuleWithRelations = InternalSecretsModule & InternalSecretsModuleRelations; +export type IntegrationProvidersModuleWithRelations = IntegrationProvidersModule & + IntegrationProvidersModuleRelations; +export type InternalSecretsModuleWithRelations = InternalSecretsModule & + InternalSecretsModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; export type LimitsModuleWithRelations = LimitsModule & LimitsModuleRelations; -export type MembershipTypesModuleWithRelations = MembershipTypesModule & MembershipTypesModuleRelations; +export type MembershipTypesModuleWithRelations = MembershipTypesModule & + MembershipTypesModuleRelations; export type MembershipsModuleWithRelations = MembershipsModule & MembershipsModuleRelations; export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; @@ -2402,27 +2417,32 @@ export type PhoneNumbersModuleWithRelations = PhoneNumbersModule & PhoneNumbersM export type PlansModuleWithRelations = PlansModule & PlansModuleRelations; export type PrincipalAuthModuleWithRelations = PrincipalAuthModule & PrincipalAuthModuleRelations; export type ProfilesModuleWithRelations = ProfilesModule & ProfilesModuleRelations; -export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & RateLimitMetersModuleRelations; +export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & + RateLimitMetersModuleRelations; export type RateLimitsModuleWithRelations = RateLimitsModule & RateLimitsModuleRelations; export type RealtimeModuleWithRelations = RealtimeModule & RealtimeModuleRelations; export type RelationProvisionWithRelations = RelationProvision & RelationProvisionRelations; export type ResourceModuleWithRelations = ResourceModule & ResourceModuleRelations; export type RlsModuleWithRelations = RlsModule & RlsModuleRelations; export type RouteModuleWithRelations = RouteModule & RouteModuleRelations; -export type SecureTableProvisionWithRelations = SecureTableProvision & SecureTableProvisionRelations; -export type SessionSecretsModuleWithRelations = SessionSecretsModule & SessionSecretsModuleRelations; +export type SecureTableProvisionWithRelations = SecureTableProvision & + SecureTableProvisionRelations; +export type SessionSecretsModuleWithRelations = SessionSecretsModule & + SessionSecretsModuleRelations; export type SessionsModuleWithRelations = SessionsModule & SessionsModuleRelations; export type SiteSurfaceModuleWithRelations = SiteSurfaceModule & SiteSurfaceModuleRelations; export type StorageLogModuleWithRelations = StorageLogModule & StorageLogModuleRelations; export type StorageModuleWithRelations = StorageModule & StorageModuleRelations; export type TransferLogModuleWithRelations = TransferLogModule & TransferLogModuleRelations; export type UserAuthModuleWithRelations = UserAuthModule & UserAuthModuleRelations; -export type UserCredentialsModuleWithRelations = UserCredentialsModule & UserCredentialsModuleRelations; +export type UserCredentialsModuleWithRelations = UserCredentialsModule & + UserCredentialsModuleRelations; export type UserSettingsModuleWithRelations = UserSettingsModule & UserSettingsModuleRelations; export type UserStateModuleWithRelations = UserStateModule & UserStateModuleRelations; export type UsersModuleWithRelations = UsersModule & UsersModuleRelations; export type WebauthnAuthModuleWithRelations = WebauthnAuthModule & WebauthnAuthModuleRelations; -export type WebauthnCredentialsModuleWithRelations = WebauthnCredentialsModule & WebauthnCredentialsModuleRelations; +export type WebauthnCredentialsModuleWithRelations = WebauthnCredentialsModule & + WebauthnCredentialsModuleRelations; export type WebhookModuleWithRelations = WebhookModule & WebhookModuleRelations; // ============ Entity Select Types ============ export type AgentModuleSelect = { @@ -7544,81 +7564,3082 @@ export interface WebhookModuleFilter { webhookEventsTableName?: StringFilter; } // ============ OrderBy Types ============ -export type AgentModuleOrderBy = "AGENT_TABLE_ID_ASC" | "AGENT_TABLE_ID_DESC" | "AGENT_TABLE_NAME_ASC" | "AGENT_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HAS_AGENTS_ASC" | "HAS_AGENTS_DESC" | "HAS_PLANS_ASC" | "HAS_PLANS_DESC" | "HAS_RESOURCES_ASC" | "HAS_RESOURCES_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_TABLE_ID_ASC" | "MESSAGE_TABLE_ID_DESC" | "MESSAGE_TABLE_NAME_ASC" | "MESSAGE_TABLE_NAME_DESC" | "NATURAL" | "PERSONA_TABLE_ID_ASC" | "PERSONA_TABLE_ID_DESC" | "PERSONA_TABLE_NAME_ASC" | "PERSONA_TABLE_NAME_DESC" | "PLAN_TABLE_ID_ASC" | "PLAN_TABLE_ID_DESC" | "PLAN_TABLE_NAME_ASC" | "PLAN_TABLE_NAME_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROMPTS_TABLE_ID_ASC" | "PROMPTS_TABLE_ID_DESC" | "PROMPTS_TABLE_NAME_ASC" | "PROMPTS_TABLE_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RESOURCE_TABLE_ID_ASC" | "RESOURCE_TABLE_ID_DESC" | "RESOURCE_TABLE_NAME_ASC" | "RESOURCE_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SHARED_ASC" | "SHARED_DESC" | "TASK_TABLE_ID_ASC" | "TASK_TABLE_ID_DESC" | "TASK_TABLE_NAME_ASC" | "TASK_TABLE_NAME_DESC" | "THREAD_TABLE_ID_ASC" | "THREAD_TABLE_ID_DESC" | "THREAD_TABLE_NAME_ASC" | "THREAD_TABLE_NAME_DESC"; -export type ApiSurfaceModuleOrderBy = "APIS_TABLE_ID_ASC" | "APIS_TABLE_ID_DESC" | "APIS_TABLE_NAME_ASC" | "APIS_TABLE_NAME_DESC" | "API_MODULES_TABLE_ID_ASC" | "API_MODULES_TABLE_ID_DESC" | "API_MODULES_TABLE_NAME_ASC" | "API_MODULES_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "API_SCHEMAS_TABLE_ID_ASC" | "API_SCHEMAS_TABLE_ID_DESC" | "API_SCHEMAS_TABLE_NAME_ASC" | "API_SCHEMAS_TABLE_NAME_DESC" | "API_SETTINGS_TABLE_ID_ASC" | "API_SETTINGS_TABLE_ID_DESC" | "API_SETTINGS_TABLE_NAME_ASC" | "API_SETTINGS_TABLE_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "CORS_SETTINGS_TABLE_ID_ASC" | "CORS_SETTINGS_TABLE_ID_DESC" | "CORS_SETTINGS_TABLE_NAME_ASC" | "CORS_SETTINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type AppModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "APPS_TABLE_ID_ASC" | "APPS_TABLE_ID_DESC" | "APPS_TABLE_NAME_ASC" | "APPS_TABLE_NAME_DESC" | "APP_COMPONENTS_TABLE_ID_ASC" | "APP_COMPONENTS_TABLE_ID_DESC" | "APP_COMPONENTS_TABLE_NAME_ASC" | "APP_COMPONENTS_TABLE_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type BillingModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BALANCES_TABLE_ID_ASC" | "BALANCES_TABLE_ID_DESC" | "BALANCES_TABLE_NAME_ASC" | "BALANCES_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ID_ASC" | "ID_DESC" | "LEDGER_TABLE_ID_ASC" | "LEDGER_TABLE_ID_DESC" | "LEDGER_TABLE_NAME_ASC" | "LEDGER_TABLE_NAME_DESC" | "METERS_TABLE_ID_ASC" | "METERS_TABLE_ID_DESC" | "METERS_TABLE_NAME_ASC" | "METERS_TABLE_NAME_DESC" | "METER_CREDITS_TABLE_ID_ASC" | "METER_CREDITS_TABLE_ID_DESC" | "METER_CREDITS_TABLE_NAME_ASC" | "METER_CREDITS_TABLE_NAME_DESC" | "METER_DEFAULTS_TABLE_ID_ASC" | "METER_DEFAULTS_TABLE_ID_DESC" | "METER_DEFAULTS_TABLE_NAME_ASC" | "METER_DEFAULTS_TABLE_NAME_DESC" | "METER_SOURCES_TABLE_ID_ASC" | "METER_SOURCES_TABLE_ID_DESC" | "METER_SOURCES_TABLE_NAME_ASC" | "METER_SOURCES_TABLE_NAME_DESC" | "NATURAL" | "PLAN_SUBSCRIPTIONS_TABLE_ID_ASC" | "PLAN_SUBSCRIPTIONS_TABLE_ID_DESC" | "PLAN_SUBSCRIPTIONS_TABLE_NAME_ASC" | "PLAN_SUBSCRIPTIONS_TABLE_NAME_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RECORD_USAGE_FUNCTION_ASC" | "RECORD_USAGE_FUNCTION_DESC" | "ROLLUP_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_ASC" | "SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_DESC"; -export type BillingProviderModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BILLING_CUSTOMERS_TABLE_ID_ASC" | "BILLING_CUSTOMERS_TABLE_ID_DESC" | "BILLING_CUSTOMERS_TABLE_NAME_ASC" | "BILLING_CUSTOMERS_TABLE_NAME_DESC" | "BILLING_PRICES_TABLE_ID_ASC" | "BILLING_PRICES_TABLE_ID_DESC" | "BILLING_PRICES_TABLE_NAME_ASC" | "BILLING_PRICES_TABLE_NAME_DESC" | "BILLING_PRODUCTS_TABLE_ID_ASC" | "BILLING_PRODUCTS_TABLE_ID_DESC" | "BILLING_PRODUCTS_TABLE_NAME_ASC" | "BILLING_PRODUCTS_TABLE_NAME_DESC" | "BILLING_SUBSCRIPTIONS_TABLE_ID_ASC" | "BILLING_SUBSCRIPTIONS_TABLE_ID_DESC" | "BILLING_SUBSCRIPTIONS_TABLE_NAME_ASC" | "BILLING_SUBSCRIPTIONS_TABLE_NAME_DESC" | "BILLING_WEBHOOK_EVENTS_TABLE_ID_ASC" | "BILLING_WEBHOOK_EVENTS_TABLE_ID_DESC" | "BILLING_WEBHOOK_EVENTS_TABLE_NAME_ASC" | "BILLING_WEBHOOK_EVENTS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRICES_TABLE_ID_ASC" | "PRICES_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PROCESS_BILLING_EVENT_FUNCTION_ASC" | "PROCESS_BILLING_EVENT_FUNCTION_DESC" | "PRODUCTS_TABLE_ID_ASC" | "PRODUCTS_TABLE_ID_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SUBSCRIPTIONS_TABLE_ID_ASC" | "SUBSCRIPTIONS_TABLE_ID_DESC"; -export type BlueprintOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DEFINITION_HASH_ASC" | "DEFINITION_HASH_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_HASHES_ASC" | "TABLE_HASHES_DESC" | "TEMPLATE_ID_ASC" | "TEMPLATE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type BlueprintConstructionOrderBy = "BLUEPRINT_ID_ASC" | "BLUEPRINT_ID_DESC" | "CONSTRUCTED_AT_ASC" | "CONSTRUCTED_AT_DESC" | "CONSTRUCTED_DEFINITION_ASC" | "CONSTRUCTED_DEFINITION_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_DETAILS_ASC" | "ERROR_DETAILS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TABLE_MAP_ASC" | "TABLE_MAP_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type BlueprintTemplateOrderBy = "CATEGORIES_ASC" | "CATEGORIES_DESC" | "COMPLEXITY_ASC" | "COMPLEXITY_DESC" | "COPY_COUNT_ASC" | "COPY_COUNT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DEFINITION_HASH_ASC" | "DEFINITION_HASH_DESC" | "DEFINITION_SCHEMA_VERSION_ASC" | "DEFINITION_SCHEMA_VERSION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "FORKED_FROM_ID_ASC" | "FORKED_FROM_ID_DESC" | "FORK_COUNT_ASC" | "FORK_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "TABLE_HASHES_ASC" | "TABLE_HASHES_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERSION_ASC" | "VERSION_DESC" | "VISIBILITY_ASC" | "VISIBILITY_DESC"; -export type CatalogModuleOrderBy = "APIS_TABLE_ID_ASC" | "APIS_TABLE_ID_DESC" | "APIS_TABLE_NAME_ASC" | "APIS_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "APPS_TABLE_ID_ASC" | "APPS_TABLE_ID_DESC" | "APPS_TABLE_NAME_ASC" | "APPS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAINS_TABLE_ID_ASC" | "DOMAINS_TABLE_ID_DESC" | "DOMAINS_TABLE_NAME_ASC" | "DOMAINS_TABLE_NAME_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTIONS_TABLE_ID_ASC" | "FUNCTIONS_TABLE_ID_DESC" | "FUNCTIONS_TABLE_NAME_ASC" | "FUNCTIONS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACES_TABLE_ID_ASC" | "NAMESPACES_TABLE_ID_DESC" | "NAMESPACES_TABLE_NAME_ASC" | "NAMESPACES_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOURCES_TABLE_ID_ASC" | "RESOURCES_TABLE_ID_DESC" | "RESOURCES_TABLE_NAME_ASC" | "RESOURCES_TABLE_NAME_DESC" | "RESOURCE_DEFINITIONS_TABLE_ID_ASC" | "RESOURCE_DEFINITIONS_TABLE_ID_DESC" | "RESOURCE_DEFINITIONS_TABLE_NAME_ASC" | "RESOURCE_DEFINITIONS_TABLE_NAME_DESC" | "RESOURCE_INSTALLATIONS_TABLE_ID_ASC" | "RESOURCE_INSTALLATIONS_TABLE_ID_DESC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_ASC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SITES_TABLE_ID_ASC" | "SITES_TABLE_ID_DESC" | "SITES_TABLE_NAME_ASC" | "SITES_TABLE_NAME_DESC"; -export type ComputeLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "COMPUTE_LOG_TABLE_ID_ASC" | "COMPUTE_LOG_TABLE_ID_DESC" | "COMPUTE_LOG_TABLE_NAME_ASC" | "COMPUTE_LOG_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type ConfigSecretsUserModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type ConnectedAccountsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type CryptoAddressesModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type CryptoAuthModuleOrderBy = "ADDRESSES_TABLE_ID_ASC" | "ADDRESSES_TABLE_ID_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SIGN_IN_RECORD_FAILURE_ASC" | "SIGN_IN_RECORD_FAILURE_DESC" | "SIGN_IN_REQUEST_CHALLENGE_ASC" | "SIGN_IN_REQUEST_CHALLENGE_DESC" | "SIGN_IN_WITH_CHALLENGE_ASC" | "SIGN_IN_WITH_CHALLENGE_DESC" | "SIGN_UP_WITH_KEY_ASC" | "SIGN_UP_WITH_KEY_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC" | "USER_FIELD_ASC" | "USER_FIELD_DESC"; -export type DatabaseProvisionModuleOrderBy = "ASYNC_ASC" | "ASYNC_DESC" | "BOOTSTRAP_ERROR_ASC" | "BOOTSTRAP_ERROR_DESC" | "BOOTSTRAP_STATUS_ASC" | "BOOTSTRAP_STATUS_DESC" | "BOOTSTRAP_USER_ASC" | "BOOTSTRAP_USER_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATABASE_NAME_ASC" | "DATABASE_NAME_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "FULFILLED_AT_ASC" | "FULFILLED_AT_DESC" | "ID_ASC" | "ID_DESC" | "MODULES_ASC" | "MODULES_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_DATABASE_ID_ASC" | "SOURCE_DATABASE_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SUBDOMAIN_ASC" | "SUBDOMAIN_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseSettingsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATABASE_SETTINGS_TABLE_ID_ASC" | "DATABASE_SETTINGS_TABLE_ID_DESC" | "DATABASE_SETTINGS_TABLE_NAME_ASC" | "DATABASE_SETTINGS_TABLE_NAME_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBKEY_SETTINGS_TABLE_ID_ASC" | "PUBKEY_SETTINGS_TABLE_ID_DESC" | "PUBKEY_SETTINGS_TABLE_NAME_ASC" | "PUBKEY_SETTINGS_TABLE_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RLS_SETTINGS_TABLE_ID_ASC" | "RLS_SETTINGS_TABLE_ID_DESC" | "RLS_SETTINGS_TABLE_NAME_ASC" | "RLS_SETTINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "WEBAUTHN_SETTINGS_TABLE_ID_ASC" | "WEBAUTHN_SETTINGS_TABLE_ID_DESC" | "WEBAUTHN_SETTINGS_TABLE_NAME_ASC" | "WEBAUTHN_SETTINGS_TABLE_NAME_DESC"; -export type DbPoolConfigOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ENABLED_ASC" | "ENABLED_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "MIN_ASC" | "MIN_DESC" | "NATURAL" | "POOL_OWNER_ID_ASC" | "POOL_OWNER_ID_DESC" | "PRESET_SLUG_ASC" | "PRESET_SLUG_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WARM_TTL_ASC" | "WARM_TTL_DESC"; -export type DbPoolOrderBy = "BOOTSTRAP_ERROR_ASC" | "BOOTSTRAP_ERROR_DESC" | "BOOTSTRAP_STATUS_ASC" | "BOOTSTRAP_STATUS_DESC" | "CLAIMED_AT_ASC" | "CLAIMED_AT_DESC" | "CLAIMED_BY_ASC" | "CLAIMED_BY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRESET_COMMIT_ID_ASC" | "PRESET_COMMIT_ID_DESC" | "PRESET_SLUG_ASC" | "PRESET_SLUG_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DbPresetModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DB_PRESETS_TABLE_ID_ASC" | "DB_PRESETS_TABLE_ID_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_ID_ASC" | "PUBLIC_SCHEMA_ID_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORE_NAME_ASC" | "STORE_NAME_DESC"; -export type DbUsageModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "COLLECT_DB_QUERY_STATS_FUNCTION_ASC" | "COLLECT_DB_QUERY_STATS_FUNCTION_DESC" | "COLLECT_DB_TABLE_STATS_FUNCTION_ASC" | "COLLECT_DB_TABLE_STATS_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "QUERY_STATS_LOG_TABLE_ID_ASC" | "QUERY_STATS_LOG_TABLE_ID_DESC" | "QUERY_STATS_LOG_TABLE_NAME_ASC" | "QUERY_STATS_LOG_TABLE_NAME_DESC" | "QUERY_STATS_SUMMARY_TABLE_ID_ASC" | "QUERY_STATS_SUMMARY_TABLE_ID_DESC" | "QUERY_STATS_SUMMARY_TABLE_NAME_ASC" | "QUERY_STATS_SUMMARY_TABLE_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_DESC" | "ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_STATS_LOG_TABLE_ID_ASC" | "TABLE_STATS_LOG_TABLE_ID_DESC" | "TABLE_STATS_LOG_TABLE_NAME_ASC" | "TABLE_STATS_LOG_TABLE_NAME_DESC" | "TABLE_STATS_SUMMARY_TABLE_ID_ASC" | "TABLE_STATS_SUMMARY_TABLE_ID_DESC" | "TABLE_STATS_SUMMARY_TABLE_NAME_ASC" | "TABLE_STATS_SUMMARY_TABLE_NAME_DESC"; -export type DefaultIdsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type DenormalizedTableFieldOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "FUNC_NAME_ASC" | "FUNC_NAME_DESC" | "FUNC_ORDER_ASC" | "FUNC_ORDER_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_ID_ASC" | "REF_FIELD_ID_DESC" | "REF_IDS_ASC" | "REF_IDS_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SET_IDS_ASC" | "SET_IDS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATE_DEFAULTS_ASC" | "UPDATE_DEFAULTS_DESC" | "USE_UPDATES_ASC" | "USE_UPDATES_DESC"; -export type DevicesModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEVICE_SETTINGS_TABLE_ID_ASC" | "DEVICE_SETTINGS_TABLE_ID_DESC" | "DEVICE_SETTINGS_TABLE_NAME_ASC" | "DEVICE_SETTINGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "USER_DEVICES_TABLE_ID_ASC" | "USER_DEVICES_TABLE_ID_DESC" | "USER_DEVICES_TABLE_NAME_ASC" | "USER_DEVICES_TABLE_NAME_DESC"; -export type DomainModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAINS_TABLE_ID_ASC" | "DOMAINS_TABLE_ID_DESC" | "DOMAINS_TABLE_NAME_ASC" | "DOMAINS_TABLE_NAME_DESC" | "DOMAIN_EVENTS_TABLE_ID_ASC" | "DOMAIN_EVENTS_TABLE_ID_DESC" | "DOMAIN_EVENTS_TABLE_NAME_ASC" | "DOMAIN_EVENTS_TABLE_NAME_DESC" | "DOMAIN_VERIFICATIONS_TABLE_ID_ASC" | "DOMAIN_VERIFICATIONS_TABLE_ID_DESC" | "DOMAIN_VERIFICATIONS_TABLE_NAME_ASC" | "DOMAIN_VERIFICATIONS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAINS_TABLE_ID_ASC" | "MANAGED_DOMAINS_TABLE_ID_DESC" | "MANAGED_DOMAINS_TABLE_NAME_ASC" | "MANAGED_DOMAINS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type EmailsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type EntityTypeProvisionOrderBy = "AGENTS_ASC" | "AGENTS_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FUNCTIONS_ASC" | "FUNCTIONS_DESC" | "GRAPHS_ASC" | "GRAPHS_DESC" | "HAS_INVITES_ASC" | "HAS_INVITES_DESC" | "HAS_INVITE_ACHIEVEMENTS_ASC" | "HAS_INVITE_ACHIEVEMENTS_DESC" | "HAS_LEVELS_ASC" | "HAS_LEVELS_DESC" | "HAS_LIMITS_ASC" | "HAS_LIMITS_DESC" | "HAS_PROFILES_ASC" | "HAS_PROFILES_DESC" | "ID_ASC" | "ID_DESC" | "IS_VISIBLE_ASC" | "IS_VISIBLE_DESC" | "NAMESPACES_ASC" | "NAMESPACES_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUT_AGENT_MODULE_ID_ASC" | "OUT_AGENT_MODULE_ID_DESC" | "OUT_BUCKETS_TABLE_ID_ASC" | "OUT_BUCKETS_TABLE_ID_DESC" | "OUT_DEFINITIONS_TABLE_ID_ASC" | "OUT_DEFINITIONS_TABLE_ID_DESC" | "OUT_ENTITY_TABLE_ID_ASC" | "OUT_ENTITY_TABLE_ID_DESC" | "OUT_ENTITY_TABLE_NAME_ASC" | "OUT_ENTITY_TABLE_NAME_DESC" | "OUT_EXECUTION_LOGS_TABLE_ID_ASC" | "OUT_EXECUTION_LOGS_TABLE_ID_DESC" | "OUT_FILES_TABLE_ID_ASC" | "OUT_FILES_TABLE_ID_DESC" | "OUT_FUNCTION_MODULE_ID_ASC" | "OUT_FUNCTION_MODULE_ID_DESC" | "OUT_GRAPHS_TABLE_ID_ASC" | "OUT_GRAPHS_TABLE_ID_DESC" | "OUT_GRAPH_MODULE_ID_ASC" | "OUT_GRAPH_MODULE_ID_DESC" | "OUT_INSTALLED_MODULES_ASC" | "OUT_INSTALLED_MODULES_DESC" | "OUT_INVITES_MODULE_ID_ASC" | "OUT_INVITES_MODULE_ID_DESC" | "OUT_INVOCATIONS_TABLE_ID_ASC" | "OUT_INVOCATIONS_TABLE_ID_DESC" | "OUT_MEMBERSHIP_TYPE_ASC" | "OUT_MEMBERSHIP_TYPE_DESC" | "OUT_NAMESPACES_TABLE_ID_ASC" | "OUT_NAMESPACES_TABLE_ID_DESC" | "OUT_NAMESPACE_EVENTS_TABLE_ID_ASC" | "OUT_NAMESPACE_EVENTS_TABLE_ID_DESC" | "OUT_NAMESPACE_MODULE_ID_ASC" | "OUT_NAMESPACE_MODULE_ID_DESC" | "OUT_PATH_SHARES_TABLE_ID_ASC" | "OUT_PATH_SHARES_TABLE_ID_DESC" | "OUT_STORAGE_MODULE_ID_ASC" | "OUT_STORAGE_MODULE_ID_DESC" | "PARENT_ENTITY_ASC" | "PARENT_ENTITY_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SKIP_ENTITY_POLICIES_ASC" | "SKIP_ENTITY_POLICIES_DESC" | "STORAGE_ASC" | "STORAGE_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "TABLE_PROVISION_ASC" | "TABLE_PROVISION_DESC"; -export type EventsModuleOrderBy = "ACHIEVEMENT_REWARDS_TABLE_ID_ASC" | "ACHIEVEMENT_REWARDS_TABLE_ID_DESC" | "ACHIEVEMENT_REWARDS_TABLE_NAME_ASC" | "ACHIEVEMENT_REWARDS_TABLE_NAME_DESC" | "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EVENTS_TABLE_ID_ASC" | "EVENTS_TABLE_ID_DESC" | "EVENTS_TABLE_NAME_ASC" | "EVENTS_TABLE_NAME_DESC" | "EVENT_AGGREGATES_TABLE_ID_ASC" | "EVENT_AGGREGATES_TABLE_ID_DESC" | "EVENT_AGGREGATES_TABLE_NAME_ASC" | "EVENT_AGGREGATES_TABLE_NAME_DESC" | "EVENT_TYPES_TABLE_ID_ASC" | "EVENT_TYPES_TABLE_ID_DESC" | "EVENT_TYPES_TABLE_NAME_ASC" | "EVENT_TYPES_TABLE_NAME_DESC" | "GRANT_ACHIEVEMENT_ASC" | "GRANT_ACHIEVEMENT_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "LEVELS_TABLE_ID_ASC" | "LEVELS_TABLE_ID_DESC" | "LEVELS_TABLE_NAME_ASC" | "LEVELS_TABLE_NAME_DESC" | "LEVEL_ACHIEVED_ASC" | "LEVEL_ACHIEVED_DESC" | "LEVEL_GRANTS_TABLE_ID_ASC" | "LEVEL_GRANTS_TABLE_ID_DESC" | "LEVEL_GRANTS_TABLE_NAME_ASC" | "LEVEL_GRANTS_TABLE_NAME_DESC" | "LEVEL_REQUIREMENTS_TABLE_ID_ASC" | "LEVEL_REQUIREMENTS_TABLE_ID_DESC" | "LEVEL_REQUIREMENTS_TABLE_NAME_ASC" | "LEVEL_REQUIREMENTS_TABLE_NAME_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RECORD_EVENT_ASC" | "RECORD_EVENT_DESC" | "REMOVE_EVENT_ASC" | "REMOVE_EVENT_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STEPS_REQUIRED_ASC" | "STEPS_REQUIRED_DESC" | "TG_ACHIEVEMENT_REWARD_ASC" | "TG_ACHIEVEMENT_REWARD_DESC" | "TG_CHECK_ACHIEVEMENTS_ASC" | "TG_CHECK_ACHIEVEMENTS_DESC" | "TG_EVENT_ASC" | "TG_EVENT_BOOL_ASC" | "TG_EVENT_BOOL_DESC" | "TG_EVENT_DESC" | "TG_EVENT_TOGGLE_ASC" | "TG_EVENT_TOGGLE_BOOL_ASC" | "TG_EVENT_TOGGLE_BOOL_DESC" | "TG_EVENT_TOGGLE_DESC" | "TG_UPDATE_AGGREGATES_ASC" | "TG_UPDATE_AGGREGATES_DESC" | "UPSERT_AGGREGATE_ASC" | "UPSERT_AGGREGATE_DESC"; -export type FunctionDeploymentModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DEPLOYMENTS_TABLE_ID_ASC" | "DEPLOYMENTS_TABLE_ID_DESC" | "DEPLOYMENTS_TABLE_NAME_ASC" | "DEPLOYMENTS_TABLE_NAME_DESC" | "DEPLOYMENT_EVENTS_TABLE_ID_ASC" | "DEPLOYMENT_EVENTS_TABLE_ID_DESC" | "DEPLOYMENT_EVENTS_TABLE_NAME_ASC" | "DEPLOYMENT_EVENTS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type FunctionInvocationModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "ATTEMPTS_TABLE_ID_ASC" | "ATTEMPTS_TABLE_ID_DESC" | "ATTEMPTS_TABLE_NAME_ASC" | "ATTEMPTS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EXECUTION_LOGS_TABLE_ID_ASC" | "EXECUTION_LOGS_TABLE_ID_DESC" | "EXECUTION_LOGS_TABLE_NAME_ASC" | "EXECUTION_LOGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATIONS_TABLE_ID_ASC" | "INVOCATIONS_TABLE_ID_DESC" | "INVOCATIONS_TABLE_NAME_ASC" | "INVOCATIONS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type FunctionModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BINDINGS_TABLE_ID_ASC" | "BINDINGS_TABLE_ID_DESC" | "BINDINGS_TABLE_NAME_ASC" | "BINDINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DEFINITIONS_TABLE_ID_ASC" | "DEFINITIONS_TABLE_ID_DESC" | "DEFINITIONS_TABLE_NAME_ASC" | "DEFINITIONS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HAS_CRON_ASC" | "HAS_CRON_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEDULES_TABLE_ID_ASC" | "SCHEDULES_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type GraphExecutionModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EXECUTIONS_TABLE_ID_ASC" | "EXECUTIONS_TABLE_ID_DESC" | "EXECUTIONS_TABLE_NAME_ASC" | "EXECUTIONS_TABLE_NAME_DESC" | "GRAPH_MODULE_ID_ASC" | "GRAPH_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODE_STATES_TABLE_ID_ASC" | "NODE_STATES_TABLE_ID_DESC" | "NODE_STATES_TABLE_NAME_ASC" | "NODE_STATES_TABLE_NAME_DESC" | "OUTPUTS_TABLE_ID_ASC" | "OUTPUTS_TABLE_ID_DESC" | "OUTPUTS_TABLE_NAME_ASC" | "OUTPUTS_TABLE_NAME_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type GraphModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GRAPHS_TABLE_ID_ASC" | "GRAPHS_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_ID_ASC" | "PUBLIC_SCHEMA_ID_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type HierarchyModuleOrderBy = "CHART_EDGES_TABLE_ID_ASC" | "CHART_EDGES_TABLE_ID_DESC" | "CHART_EDGES_TABLE_NAME_ASC" | "CHART_EDGES_TABLE_NAME_DESC" | "CHART_EDGE_GRANTS_TABLE_ID_ASC" | "CHART_EDGE_GRANTS_TABLE_ID_DESC" | "CHART_EDGE_GRANTS_TABLE_NAME_ASC" | "CHART_EDGE_GRANTS_TABLE_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GET_MANAGERS_FUNCTION_ASC" | "GET_MANAGERS_FUNCTION_DESC" | "GET_SUBORDINATES_FUNCTION_ASC" | "GET_SUBORDINATES_FUNCTION_DESC" | "HIERARCHY_SPRT_TABLE_ID_ASC" | "HIERARCHY_SPRT_TABLE_ID_DESC" | "HIERARCHY_SPRT_TABLE_NAME_ASC" | "HIERARCHY_SPRT_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_MANAGER_OF_FUNCTION_ASC" | "IS_MANAGER_OF_FUNCTION_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "REBUILD_HIERARCHY_FUNCTION_ASC" | "REBUILD_HIERARCHY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SPRT_TABLE_NAME_ASC" | "SPRT_TABLE_NAME_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type HttpRouteModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "HTTP_ROUTES_TABLE_ID_ASC" | "HTTP_ROUTES_TABLE_ID_DESC" | "HTTP_ROUTES_TABLE_NAME_ASC" | "HTTP_ROUTES_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVER_FUNCTION_NAME_ASC" | "RESOLVER_FUNCTION_NAME_DESC" | "RESOURCE_MODULE_ID_ASC" | "RESOURCE_MODULE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORAGE_MODULE_ID_ASC" | "STORAGE_MODULE_ID_DESC"; -export type I18NModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SETTINGS_TABLE_ID_ASC" | "SETTINGS_TABLE_ID_DESC"; -export type IdentityProvidersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type InferenceLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INFERENCE_LOG_TABLE_ID_ASC" | "INFERENCE_LOG_TABLE_ID_DESC" | "INFERENCE_LOG_TABLE_NAME_ASC" | "INFERENCE_LOG_TABLE_NAME_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type InfraConfigModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CONFIG_TABLE_ID_ASC" | "CONFIG_TABLE_ID_DESC" | "CONFIG_TABLE_NAME_ASC" | "CONFIG_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type InfraSecretsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SECRETS_TABLE_NAME_ASC" | "SECRETS_TABLE_NAME_DESC"; -export type IntegrationProvidersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type InternalSecretsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERNAL_SECRETS_TABLE_ID_ASC" | "INTERNAL_SECRETS_TABLE_ID_DESC" | "INTERNAL_SECRETS_TABLE_NAME_ASC" | "INTERNAL_SECRETS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type InvitesModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CLAIMED_INVITES_TABLE_ID_ASC" | "CLAIMED_INVITES_TABLE_ID_DESC" | "CLAIMED_INVITES_TABLE_NAME_ASC" | "CLAIMED_INVITES_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EMAILS_TABLE_ID_ASC" | "EMAILS_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVITES_TABLE_ID_ASC" | "INVITES_TABLE_ID_DESC" | "INVITES_TABLE_NAME_ASC" | "INVITES_TABLE_NAME_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SUBMIT_INVITE_CODE_FUNCTION_ASC" | "SUBMIT_INVITE_CODE_FUNCTION_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type LimitsModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "AGGREGATE_TABLE_ID_ASC" | "AGGREGATE_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "CAP_CHECK_TRIGGER_ASC" | "CAP_CHECK_TRIGGER_DESC" | "CREDIT_CODES_TABLE_ID_ASC" | "CREDIT_CODES_TABLE_ID_DESC" | "CREDIT_CODE_ITEMS_TABLE_ID_ASC" | "CREDIT_CODE_ITEMS_TABLE_ID_DESC" | "CREDIT_REDEMPTIONS_TABLE_ID_ASC" | "CREDIT_REDEMPTIONS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_TABLE_ID_ASC" | "DEFAULT_TABLE_ID_DESC" | "DEFAULT_TABLE_NAME_ASC" | "DEFAULT_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EVENTS_TABLE_ID_ASC" | "EVENTS_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_ASC" | "LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_DESC" | "LIMIT_CAPS_DEFAULTS_TABLE_ID_ASC" | "LIMIT_CAPS_DEFAULTS_TABLE_ID_DESC" | "LIMIT_CAPS_TABLE_ID_ASC" | "LIMIT_CAPS_TABLE_ID_DESC" | "LIMIT_CHECK_FUNCTION_ASC" | "LIMIT_CHECK_FUNCTION_DESC" | "LIMIT_CHECK_SOFT_FUNCTION_ASC" | "LIMIT_CHECK_SOFT_FUNCTION_DESC" | "LIMIT_CREDITS_TABLE_ID_ASC" | "LIMIT_CREDITS_TABLE_ID_DESC" | "LIMIT_DECREMENT_FUNCTION_ASC" | "LIMIT_DECREMENT_FUNCTION_DESC" | "LIMIT_DECREMENT_TRIGGER_ASC" | "LIMIT_DECREMENT_TRIGGER_DESC" | "LIMIT_INCREMENT_FUNCTION_ASC" | "LIMIT_INCREMENT_FUNCTION_DESC" | "LIMIT_INCREMENT_TRIGGER_ASC" | "LIMIT_INCREMENT_TRIGGER_DESC" | "LIMIT_UPDATE_TRIGGER_ASC" | "LIMIT_UPDATE_TRIGGER_DESC" | "LIMIT_WARNINGS_TABLE_ID_ASC" | "LIMIT_WARNINGS_TABLE_ID_DESC" | "LIMIT_WARNING_STATE_TABLE_ID_ASC" | "LIMIT_WARNING_STATE_TABLE_ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVE_CAP_FUNCTION_ASC" | "RESOLVE_CAP_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type MembershipTypesModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type MembershipsModuleOrderBy = "ACTOR_MASK_CHECK_ASC" | "ACTOR_MASK_CHECK_DESC" | "ACTOR_PERM_CHECK_ASC" | "ACTOR_PERM_CHECK_DESC" | "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "ADMIN_GRANTS_TABLE_ID_ASC" | "ADMIN_GRANTS_TABLE_ID_DESC" | "ADMIN_GRANTS_TABLE_NAME_ASC" | "ADMIN_GRANTS_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_LIMITS_TABLE_ID_ASC" | "DEFAULT_LIMITS_TABLE_ID_DESC" | "DEFAULT_PERMISSIONS_TABLE_ID_ASC" | "DEFAULT_PERMISSIONS_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_IDS_BY_MASK_ASC" | "ENTITY_IDS_BY_MASK_DESC" | "ENTITY_IDS_BY_PERM_ASC" | "ENTITY_IDS_BY_PERM_DESC" | "ENTITY_IDS_FUNCTION_ASC" | "ENTITY_IDS_FUNCTION_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ENTITY_TABLE_OWNER_ID_ASC" | "ENTITY_TABLE_OWNER_ID_DESC" | "GET_ORG_FN_ASC" | "GET_ORG_FN_DESC" | "GRANTS_TABLE_ID_ASC" | "GRANTS_TABLE_ID_DESC" | "GRANTS_TABLE_NAME_ASC" | "GRANTS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "LIMITS_TABLE_ID_ASC" | "LIMITS_TABLE_ID_DESC" | "MEMBERSHIPS_TABLE_ID_ASC" | "MEMBERSHIPS_TABLE_ID_DESC" | "MEMBERSHIPS_TABLE_NAME_ASC" | "MEMBERSHIPS_TABLE_NAME_DESC" | "MEMBERSHIP_DEFAULTS_TABLE_ID_ASC" | "MEMBERSHIP_DEFAULTS_TABLE_ID_DESC" | "MEMBERSHIP_DEFAULTS_TABLE_NAME_ASC" | "MEMBERSHIP_DEFAULTS_TABLE_NAME_DESC" | "MEMBERSHIP_SETTINGS_TABLE_ID_ASC" | "MEMBERSHIP_SETTINGS_TABLE_ID_DESC" | "MEMBERSHIP_SETTINGS_TABLE_NAME_ASC" | "MEMBERSHIP_SETTINGS_TABLE_NAME_DESC" | "MEMBERS_TABLE_ID_ASC" | "MEMBERS_TABLE_ID_DESC" | "MEMBERS_TABLE_NAME_ASC" | "MEMBERS_TABLE_NAME_DESC" | "MEMBER_PROFILES_TABLE_ID_ASC" | "MEMBER_PROFILES_TABLE_ID_DESC" | "NATURAL" | "OWNER_GRANTS_TABLE_ID_ASC" | "OWNER_GRANTS_TABLE_ID_DESC" | "OWNER_GRANTS_TABLE_NAME_ASC" | "OWNER_GRANTS_TABLE_NAME_DESC" | "PERMISSIONS_TABLE_ID_ASC" | "PERMISSIONS_TABLE_ID_DESC" | "PERMISSION_DEFAULT_GRANTS_TABLE_ID_ASC" | "PERMISSION_DEFAULT_GRANTS_TABLE_ID_DESC" | "PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_ASC" | "PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SPRT_TABLE_ID_ASC" | "SPRT_TABLE_ID_DESC"; -export type MerkleStoreModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "COMMIT_TABLE_ID_ASC" | "COMMIT_TABLE_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "FUNCTION_PREFIX_ASC" | "FUNCTION_PREFIX_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OBJECT_TABLE_ID_ASC" | "OBJECT_TABLE_ID_DESC" | "PERMISSION_KEY_ASC" | "PERMISSION_KEY_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORE_TABLE_ID_ASC" | "STORE_TABLE_ID_DESC"; -export type NamespaceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACES_TABLE_ID_ASC" | "NAMESPACES_TABLE_ID_DESC" | "NAMESPACES_TABLE_NAME_ASC" | "NAMESPACES_TABLE_NAME_DESC" | "NAMESPACE_EVENTS_TABLE_ID_ASC" | "NAMESPACE_EVENTS_TABLE_ID_DESC" | "NAMESPACE_EVENTS_TABLE_NAME_ASC" | "NAMESPACE_EVENTS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type NotificationsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHANNELS_TABLE_ID_ASC" | "CHANNELS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DELIVERY_LOG_TABLE_ID_ASC" | "DELIVERY_LOG_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "HAS_CHANNELS_ASC" | "HAS_CHANNELS_DESC" | "HAS_DIGEST_METADATA_ASC" | "HAS_DIGEST_METADATA_DESC" | "HAS_PREFERENCES_ASC" | "HAS_PREFERENCES_DESC" | "HAS_SETTINGS_EXTENSION_ASC" | "HAS_SETTINGS_EXTENSION_DESC" | "HAS_SUBSCRIPTIONS_ASC" | "HAS_SUBSCRIPTIONS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NOTIFICATIONS_TABLE_ID_ASC" | "NOTIFICATIONS_TABLE_ID_DESC" | "ORGANIZATION_SETTINGS_TABLE_ID_ASC" | "ORGANIZATION_SETTINGS_TABLE_ID_DESC" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PREFERENCES_TABLE_ID_ASC" | "PREFERENCES_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "READ_STATE_TABLE_ID_ASC" | "READ_STATE_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SUPPRESSIONS_TABLE_ID_ASC" | "SUPPRESSIONS_TABLE_ID_DESC" | "USER_SETTINGS_TABLE_ID_ASC" | "USER_SETTINGS_TABLE_ID_DESC"; -export type PermissionsModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "BITLEN_ASC" | "BITLEN_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_TABLE_ID_ASC" | "DEFAULT_TABLE_ID_DESC" | "DEFAULT_TABLE_NAME_ASC" | "DEFAULT_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GET_BY_MASK_ASC" | "GET_BY_MASK_DESC" | "GET_MASK_ASC" | "GET_MASK_BY_NAME_ASC" | "GET_MASK_BY_NAME_DESC" | "GET_MASK_DESC" | "GET_PADDED_MASK_ASC" | "GET_PADDED_MASK_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type PhoneNumbersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type PlansModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "APPLY_BILLING_PLAN_FUNCTION_ASC" | "APPLY_BILLING_PLAN_FUNCTION_DESC" | "APPLY_PLAN_AGGREGATE_FUNCTION_ASC" | "APPLY_PLAN_AGGREGATE_FUNCTION_DESC" | "APPLY_PLAN_CAPS_FUNCTION_ASC" | "APPLY_PLAN_CAPS_FUNCTION_DESC" | "APPLY_PLAN_FUNCTION_ASC" | "APPLY_PLAN_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PLANS_TABLE_ID_ASC" | "PLANS_TABLE_ID_DESC" | "PLANS_TABLE_NAME_ASC" | "PLANS_TABLE_NAME_DESC" | "PLAN_CAPS_TABLE_ID_ASC" | "PLAN_CAPS_TABLE_ID_DESC" | "PLAN_LIMITS_TABLE_ID_ASC" | "PLAN_LIMITS_TABLE_ID_DESC" | "PLAN_LIMITS_TABLE_NAME_ASC" | "PLAN_LIMITS_TABLE_NAME_DESC" | "PLAN_METER_LIMITS_TABLE_ID_ASC" | "PLAN_METER_LIMITS_TABLE_ID_DESC" | "PLAN_OVERRIDES_TABLE_ID_ASC" | "PLAN_OVERRIDES_TABLE_ID_DESC" | "PLAN_PRICING_TABLE_ID_ASC" | "PLAN_PRICING_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type PrincipalAuthModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUDITS_TABLE_ID_ASC" | "AUDITS_TABLE_ID_DESC" | "CREATE_ORG_API_KEY_FUNCTION_ASC" | "CREATE_ORG_API_KEY_FUNCTION_DESC" | "CREATE_ORG_PRINCIPAL_FUNCTION_ASC" | "CREATE_ORG_PRINCIPAL_FUNCTION_DESC" | "CREATE_PRINCIPAL_FUNCTION_ASC" | "CREATE_PRINCIPAL_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ORG_PRINCIPAL_FUNCTION_ASC" | "DELETE_ORG_PRINCIPAL_FUNCTION_DESC" | "DELETE_PRINCIPAL_FUNCTION_ASC" | "DELETE_PRINCIPAL_FUNCTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPALS_TABLE_ID_ASC" | "PRINCIPALS_TABLE_ID_DESC" | "PRINCIPALS_TABLE_NAME_ASC" | "PRINCIPALS_TABLE_NAME_DESC" | "PRINCIPAL_ENTITIES_TABLE_ID_ASC" | "PRINCIPAL_ENTITIES_TABLE_ID_DESC" | "PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC" | "PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC" | "REVOKE_ORG_API_KEY_FUNCTION_ASC" | "REVOKE_ORG_API_KEY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type ProfilesModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MEMBERSHIPS_TABLE_ID_ASC" | "MEMBERSHIPS_TABLE_ID_DESC" | "NATURAL" | "PERMISSIONS_TABLE_ID_ASC" | "PERMISSIONS_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROFILE_DEFINITION_GRANTS_TABLE_ID_ASC" | "PROFILE_DEFINITION_GRANTS_TABLE_ID_DESC" | "PROFILE_DEFINITION_GRANTS_TABLE_NAME_ASC" | "PROFILE_DEFINITION_GRANTS_TABLE_NAME_DESC" | "PROFILE_GRANTS_TABLE_ID_ASC" | "PROFILE_GRANTS_TABLE_ID_DESC" | "PROFILE_GRANTS_TABLE_NAME_ASC" | "PROFILE_GRANTS_TABLE_NAME_DESC" | "PROFILE_PERMISSIONS_TABLE_ID_ASC" | "PROFILE_PERMISSIONS_TABLE_ID_DESC" | "PROFILE_PERMISSIONS_TABLE_NAME_ASC" | "PROFILE_PERMISSIONS_TABLE_NAME_DESC" | "PROFILE_TEMPLATES_TABLE_ID_ASC" | "PROFILE_TEMPLATES_TABLE_ID_DESC" | "PROFILE_TEMPLATES_TABLE_NAME_ASC" | "PROFILE_TEMPLATES_TABLE_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type RateLimitMetersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHECK_RATE_LIMIT_FUNCTION_ASC" | "CHECK_RATE_LIMIT_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RATE_LIMIT_OVERRIDES_TABLE_ID_ASC" | "RATE_LIMIT_OVERRIDES_TABLE_ID_DESC" | "RATE_LIMIT_OVERRIDES_TABLE_NAME_ASC" | "RATE_LIMIT_OVERRIDES_TABLE_NAME_DESC" | "RATE_LIMIT_STATE_TABLE_ID_ASC" | "RATE_LIMIT_STATE_TABLE_ID_DESC" | "RATE_LIMIT_STATE_TABLE_NAME_ASC" | "RATE_LIMIT_STATE_TABLE_NAME_DESC" | "RATE_WINDOW_LIMITS_TABLE_ID_ASC" | "RATE_WINDOW_LIMITS_TABLE_ID_DESC" | "RATE_WINDOW_LIMITS_TABLE_NAME_ASC" | "RATE_WINDOW_LIMITS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type RateLimitsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IP_RATE_LIMITS_TABLE_ID_ASC" | "IP_RATE_LIMITS_TABLE_ID_DESC" | "IP_RATE_LIMITS_TABLE_NAME_ASC" | "IP_RATE_LIMITS_TABLE_NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RATE_LIMITS_TABLE_ID_ASC" | "RATE_LIMITS_TABLE_ID_DESC" | "RATE_LIMITS_TABLE_NAME_ASC" | "RATE_LIMITS_TABLE_NAME_DESC" | "RATE_LIMIT_SETTINGS_TABLE_ID_ASC" | "RATE_LIMIT_SETTINGS_TABLE_ID_DESC" | "RATE_LIMIT_SETTINGS_TABLE_NAME_ASC" | "RATE_LIMIT_SETTINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type RealtimeModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHANGE_LOG_TABLE_ID_ASC" | "CHANGE_LOG_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "LISTENER_NODE_TABLE_ID_ASC" | "LISTENER_NODE_TABLE_ID_DESC" | "NATURAL" | "NOTIFY_CHANNEL_ASC" | "NOTIFY_CHANNEL_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "RETENTION_HOURS_ASC" | "RETENTION_HOURS_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SOURCE_REGISTRY_TABLE_ID_ASC" | "SOURCE_REGISTRY_TABLE_ID_DESC" | "SUBSCRIPTIONS_SCHEMA_ID_ASC" | "SUBSCRIPTIONS_SCHEMA_ID_DESC"; -export type RelationProvisionOrderBy = "API_REQUIRED_ASC" | "API_REQUIRED_DESC" | "CREATE_INDEX_ASC" | "CREATE_INDEX_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACTION_ASC" | "DELETE_ACTION_DESC" | "EXPOSE_IN_API_ASC" | "EXPOSE_IN_API_DESC" | "FIELD_NAME_ASC" | "FIELD_NAME_DESC" | "GRANTS_ASC" | "GRANTS_DESC" | "ID_ASC" | "ID_DESC" | "IS_REQUIRED_ASC" | "IS_REQUIRED_DESC" | "JUNCTION_SCHEMA_ID_ASC" | "JUNCTION_SCHEMA_ID_DESC" | "JUNCTION_TABLE_ID_ASC" | "JUNCTION_TABLE_ID_DESC" | "JUNCTION_TABLE_NAME_ASC" | "JUNCTION_TABLE_NAME_DESC" | "NATURAL" | "NODES_ASC" | "NODES_DESC" | "OUT_FIELD_ID_ASC" | "OUT_FIELD_ID_DESC" | "OUT_JUNCTION_TABLE_ID_ASC" | "OUT_JUNCTION_TABLE_ID_DESC" | "OUT_SOURCE_FIELD_ID_ASC" | "OUT_SOURCE_FIELD_ID_DESC" | "OUT_TARGET_FIELD_ID_ASC" | "OUT_TARGET_FIELD_ID_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RELATION_TYPE_ASC" | "RELATION_TYPE_DESC" | "SOURCE_FIELD_NAME_ASC" | "SOURCE_FIELD_NAME_DESC" | "SOURCE_TABLE_ID_ASC" | "SOURCE_TABLE_ID_DESC" | "TARGET_FIELD_NAME_ASC" | "TARGET_FIELD_NAME_DESC" | "TARGET_TABLE_ID_ASC" | "TARGET_TABLE_ID_DESC" | "USE_COMPOSITE_KEY_ASC" | "USE_COMPOSITE_KEY_DESC"; -export type ResourceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_STORE_NAME_ASC" | "INSTALLATION_STORE_NAME_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "REQUIREMENTS_STATE_VIEW_NAME_ASC" | "REQUIREMENTS_STATE_VIEW_NAME_DESC" | "RESOLVED_REQUIREMENTS_VIEW_NAME_ASC" | "RESOLVED_REQUIREMENTS_VIEW_NAME_DESC" | "RESOURCES_TABLE_ID_ASC" | "RESOURCES_TABLE_ID_DESC" | "RESOURCES_TABLE_NAME_ASC" | "RESOURCES_TABLE_NAME_DESC" | "RESOURCE_BILLING_ROLLUP_FUNCTION_ASC" | "RESOURCE_BILLING_ROLLUP_FUNCTION_DESC" | "RESOURCE_DEFINITIONS_TABLE_ID_ASC" | "RESOURCE_DEFINITIONS_TABLE_ID_DESC" | "RESOURCE_DEFINITIONS_TABLE_NAME_ASC" | "RESOURCE_DEFINITIONS_TABLE_NAME_DESC" | "RESOURCE_EVENTS_TABLE_ID_ASC" | "RESOURCE_EVENTS_TABLE_ID_DESC" | "RESOURCE_EVENTS_TABLE_NAME_ASC" | "RESOURCE_EVENTS_TABLE_NAME_DESC" | "RESOURCE_INSTALLATIONS_TABLE_ID_ASC" | "RESOURCE_INSTALLATIONS_TABLE_ID_DESC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_ASC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_DESC" | "RESOURCE_STATUS_CHECKS_TABLE_ID_ASC" | "RESOURCE_STATUS_CHECKS_TABLE_ID_DESC" | "RESOURCE_STATUS_CHECKS_TABLE_NAME_ASC" | "RESOURCE_STATUS_CHECKS_TABLE_NAME_DESC" | "RESOURCE_USAGE_LOG_TABLE_ID_ASC" | "RESOURCE_USAGE_LOG_TABLE_ID_DESC" | "RESOURCE_USAGE_LOG_TABLE_NAME_ASC" | "RESOURCE_USAGE_LOG_TABLE_NAME_DESC" | "RESOURCE_USAGE_SUMMARY_TABLE_ID_ASC" | "RESOURCE_USAGE_SUMMARY_TABLE_ID_DESC" | "RESOURCE_USAGE_SUMMARY_TABLE_NAME_ASC" | "RESOURCE_USAGE_SUMMARY_TABLE_NAME_DESC" | "ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type RlsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUTHENTICATE_ASC" | "AUTHENTICATE_DESC" | "AUTHENTICATE_STRICT_ASC" | "AUTHENTICATE_STRICT_DESC" | "CURRENT_ROLE_ASC" | "CURRENT_ROLE_DESC" | "CURRENT_ROLE_ID_ASC" | "CURRENT_ROLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type RouteModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAIN_MODULE_ID_ASC" | "DOMAIN_MODULE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HOSTNAME_BINDINGS_TABLE_ID_ASC" | "HOSTNAME_BINDINGS_TABLE_ID_DESC" | "HOSTNAME_BINDINGS_TABLE_NAME_ASC" | "HOSTNAME_BINDINGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVER_FUNCTION_NAME_ASC" | "RESOLVER_FUNCTION_NAME_DESC" | "ROUTES_TABLE_ID_ASC" | "ROUTES_TABLE_ID_DESC" | "ROUTES_TABLE_NAME_ASC" | "ROUTES_TABLE_NAME_DESC" | "ROUTE_BINDINGS_TABLE_ID_ASC" | "ROUTE_BINDINGS_TABLE_ID_DESC" | "ROUTE_BINDINGS_TABLE_NAME_ASC" | "ROUTE_BINDINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type SecureTableProvisionOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELDS_ASC" | "FIELDS_DESC" | "GRANTS_ASC" | "GRANTS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODES_ASC" | "NODES_DESC" | "OUT_FIELDS_ASC" | "OUT_FIELDS_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "USE_RLS_ASC" | "USE_RLS_DESC"; -export type SessionSecretsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type SessionsModuleOrderBy = "AUTH_SETTINGS_TABLE_ID_ASC" | "AUTH_SETTINGS_TABLE_ID_DESC" | "AUTH_SETTINGS_TABLE_NAME_ASC" | "AUTH_SETTINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_DEFAULT_EXPIRATION_ASC" | "SESSIONS_DEFAULT_EXPIRATION_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSIONS_TABLE_NAME_ASC" | "SESSIONS_TABLE_NAME_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_NAME_ASC" | "SESSION_CREDENTIALS_TABLE_NAME_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type SiteSurfaceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SITES_TABLE_ID_ASC" | "SITES_TABLE_ID_DESC" | "SITES_TABLE_NAME_ASC" | "SITES_TABLE_NAME_DESC" | "SITE_METADATA_TABLE_ID_ASC" | "SITE_METADATA_TABLE_ID_DESC" | "SITE_METADATA_TABLE_NAME_ASC" | "SITE_METADATA_TABLE_NAME_DESC" | "SITE_MODULES_TABLE_ID_ASC" | "SITE_MODULES_TABLE_ID_DESC" | "SITE_MODULES_TABLE_NAME_ASC" | "SITE_MODULES_TABLE_NAME_DESC" | "SITE_THEMES_TABLE_ID_ASC" | "SITE_THEMES_TABLE_ID_DESC" | "SITE_THEMES_TABLE_NAME_ASC" | "SITE_THEMES_TABLE_NAME_DESC"; -export type StorageLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORAGE_LOG_TABLE_ID_ASC" | "STORAGE_LOG_TABLE_ID_DESC" | "STORAGE_LOG_TABLE_NAME_ASC" | "STORAGE_LOG_TABLE_NAME_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type StorageModuleOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "BUCKETS_TABLE_ID_ASC" | "BUCKETS_TABLE_ID_DESC" | "BUCKETS_TABLE_NAME_ASC" | "BUCKETS_TABLE_NAME_DESC" | "CACHE_TTL_SECONDS_ASC" | "CACHE_TTL_SECONDS_DESC" | "CONFIRM_UPLOAD_DELAY_ASC" | "CONFIRM_UPLOAD_DELAY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_MAX_FILE_SIZE_ASC" | "DEFAULT_MAX_FILE_SIZE_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOWNLOAD_URL_EXPIRY_SECONDS_ASC" | "DOWNLOAD_URL_EXPIRY_SECONDS_DESC" | "ENDPOINT_ASC" | "ENDPOINT_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FILES_TABLE_ID_ASC" | "FILES_TABLE_ID_DESC" | "FILES_TABLE_NAME_ASC" | "FILES_TABLE_NAME_DESC" | "FILE_EVENTS_TABLE_ID_ASC" | "FILE_EVENTS_TABLE_ID_DESC" | "HAS_AUDIT_LOG_ASC" | "HAS_AUDIT_LOG_DESC" | "HAS_CONFIRM_UPLOAD_ASC" | "HAS_CONFIRM_UPLOAD_DESC" | "HAS_CONTENT_HASH_ASC" | "HAS_CONTENT_HASH_DESC" | "HAS_CUSTOM_KEYS_ASC" | "HAS_CUSTOM_KEYS_DESC" | "HAS_PATH_SHARES_ASC" | "HAS_PATH_SHARES_DESC" | "HAS_VERSIONING_ASC" | "HAS_VERSIONING_DESC" | "ID_ASC" | "ID_DESC" | "MAX_BULK_FILES_ASC" | "MAX_BULK_FILES_DESC" | "MAX_BULK_TOTAL_SIZE_ASC" | "MAX_BULK_TOTAL_SIZE_DESC" | "MAX_FILENAME_LENGTH_ASC" | "MAX_FILENAME_LENGTH_DESC" | "NATURAL" | "PATH_SHARES_TABLE_ID_ASC" | "PATH_SHARES_TABLE_ID_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "PUBLIC_URL_PREFIX_ASC" | "PUBLIC_URL_PREFIX_DESC" | "RESTRICT_READS_ASC" | "RESTRICT_READS_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "UPLOAD_URL_EXPIRY_SECONDS_ASC" | "UPLOAD_URL_EXPIRY_SECONDS_DESC"; -export type TransferLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TRANSFER_LOG_TABLE_ID_ASC" | "TRANSFER_LOG_TABLE_ID_DESC" | "TRANSFER_LOG_TABLE_NAME_ASC" | "TRANSFER_LOG_TABLE_NAME_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type UserAuthModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUDITS_TABLE_ID_ASC" | "AUDITS_TABLE_ID_DESC" | "AUDITS_TABLE_NAME_ASC" | "AUDITS_TABLE_NAME_DESC" | "CHECK_PASSWORD_FUNCTION_ASC" | "CHECK_PASSWORD_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACCOUNT_FUNCTION_ASC" | "DELETE_ACCOUNT_FUNCTION_DESC" | "EMAILS_TABLE_ID_ASC" | "EMAILS_TABLE_ID_DESC" | "ENCRYPTED_TABLE_ID_ASC" | "ENCRYPTED_TABLE_ID_DESC" | "EXTEND_TOKEN_EXPIRES_ASC" | "EXTEND_TOKEN_EXPIRES_DESC" | "FORGOT_PASSWORD_FUNCTION_ASC" | "FORGOT_PASSWORD_FUNCTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_ASC" | "REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_DESC" | "RESET_PASSWORD_FUNCTION_ASC" | "RESET_PASSWORD_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_ASC" | "SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_DESC" | "SEND_VERIFICATION_EMAIL_FUNCTION_ASC" | "SEND_VERIFICATION_EMAIL_FUNCTION_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SET_PASSWORD_FUNCTION_ASC" | "SET_PASSWORD_FUNCTION_DESC" | "SIGN_IN_CROSS_ORIGIN_FUNCTION_ASC" | "SIGN_IN_CROSS_ORIGIN_FUNCTION_DESC" | "SIGN_IN_FUNCTION_ASC" | "SIGN_IN_FUNCTION_DESC" | "SIGN_OUT_FUNCTION_ASC" | "SIGN_OUT_FUNCTION_DESC" | "SIGN_UP_FUNCTION_ASC" | "SIGN_UP_FUNCTION_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC" | "VERIFY_EMAIL_FUNCTION_ASC" | "VERIFY_EMAIL_FUNCTION_DESC" | "VERIFY_PASSWORD_FUNCTION_ASC" | "VERIFY_PASSWORD_FUNCTION_DESC"; -export type UserCredentialsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UserSettingsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UserStateModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UsersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "TYPE_TABLE_ID_ASC" | "TYPE_TABLE_ID_DESC" | "TYPE_TABLE_NAME_ASC" | "TYPE_TABLE_NAME_DESC"; -export type WebauthnAuthModuleOrderBy = "ATTESTATION_TYPE_ASC" | "ATTESTATION_TYPE_DESC" | "AUTH_SETTINGS_TABLE_ID_ASC" | "AUTH_SETTINGS_TABLE_ID_DESC" | "CHALLENGE_EXPIRY_ASC" | "CHALLENGE_EXPIRY_DESC" | "CREDENTIALS_TABLE_ID_ASC" | "CREDENTIALS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORIGIN_ALLOWLIST_ASC" | "ORIGIN_ALLOWLIST_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRE_USER_VERIFICATION_ASC" | "REQUIRE_USER_VERIFICATION_DESC" | "RESIDENT_KEY_ASC" | "RESIDENT_KEY_DESC" | "RP_ID_ASC" | "RP_ID_DESC" | "RP_NAME_ASC" | "RP_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_SECRETS_TABLE_ID_ASC" | "SESSION_SECRETS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type WebauthnCredentialsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type WebhookModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_INVOCATION_MODULE_ID_ASC" | "FUNCTION_INVOCATION_MODULE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INFRA_SECRETS_MODULE_ID_ASC" | "INFRA_SECRETS_MODULE_ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "WEBHOOK_ENDPOINTS_TABLE_ID_ASC" | "WEBHOOK_ENDPOINTS_TABLE_ID_DESC" | "WEBHOOK_ENDPOINTS_TABLE_NAME_ASC" | "WEBHOOK_ENDPOINTS_TABLE_NAME_DESC" | "WEBHOOK_EVENTS_TABLE_ID_ASC" | "WEBHOOK_EVENTS_TABLE_ID_DESC" | "WEBHOOK_EVENTS_TABLE_NAME_ASC" | "WEBHOOK_EVENTS_TABLE_NAME_DESC"; +export type AgentModuleOrderBy = + | 'AGENT_TABLE_ID_ASC' + | 'AGENT_TABLE_ID_DESC' + | 'AGENT_TABLE_NAME_ASC' + | 'AGENT_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HAS_AGENTS_ASC' + | 'HAS_AGENTS_DESC' + | 'HAS_PLANS_ASC' + | 'HAS_PLANS_DESC' + | 'HAS_RESOURCES_ASC' + | 'HAS_RESOURCES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_TABLE_ID_ASC' + | 'MESSAGE_TABLE_ID_DESC' + | 'MESSAGE_TABLE_NAME_ASC' + | 'MESSAGE_TABLE_NAME_DESC' + | 'NATURAL' + | 'PERSONA_TABLE_ID_ASC' + | 'PERSONA_TABLE_ID_DESC' + | 'PERSONA_TABLE_NAME_ASC' + | 'PERSONA_TABLE_NAME_DESC' + | 'PLAN_TABLE_ID_ASC' + | 'PLAN_TABLE_ID_DESC' + | 'PLAN_TABLE_NAME_ASC' + | 'PLAN_TABLE_NAME_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROMPTS_TABLE_ID_ASC' + | 'PROMPTS_TABLE_ID_DESC' + | 'PROMPTS_TABLE_NAME_ASC' + | 'PROMPTS_TABLE_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RESOURCE_TABLE_ID_ASC' + | 'RESOURCE_TABLE_ID_DESC' + | 'RESOURCE_TABLE_NAME_ASC' + | 'RESOURCE_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SHARED_ASC' + | 'SHARED_DESC' + | 'TASK_TABLE_ID_ASC' + | 'TASK_TABLE_ID_DESC' + | 'TASK_TABLE_NAME_ASC' + | 'TASK_TABLE_NAME_DESC' + | 'THREAD_TABLE_ID_ASC' + | 'THREAD_TABLE_ID_DESC' + | 'THREAD_TABLE_NAME_ASC' + | 'THREAD_TABLE_NAME_DESC'; +export type ApiSurfaceModuleOrderBy = + | 'APIS_TABLE_ID_ASC' + | 'APIS_TABLE_ID_DESC' + | 'APIS_TABLE_NAME_ASC' + | 'APIS_TABLE_NAME_DESC' + | 'API_MODULES_TABLE_ID_ASC' + | 'API_MODULES_TABLE_ID_DESC' + | 'API_MODULES_TABLE_NAME_ASC' + | 'API_MODULES_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'API_SCHEMAS_TABLE_ID_ASC' + | 'API_SCHEMAS_TABLE_ID_DESC' + | 'API_SCHEMAS_TABLE_NAME_ASC' + | 'API_SCHEMAS_TABLE_NAME_DESC' + | 'API_SETTINGS_TABLE_ID_ASC' + | 'API_SETTINGS_TABLE_ID_DESC' + | 'API_SETTINGS_TABLE_NAME_ASC' + | 'API_SETTINGS_TABLE_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'CORS_SETTINGS_TABLE_ID_ASC' + | 'CORS_SETTINGS_TABLE_ID_DESC' + | 'CORS_SETTINGS_TABLE_NAME_ASC' + | 'CORS_SETTINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type AppModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPS_TABLE_ID_ASC' + | 'APPS_TABLE_ID_DESC' + | 'APPS_TABLE_NAME_ASC' + | 'APPS_TABLE_NAME_DESC' + | 'APP_COMPONENTS_TABLE_ID_ASC' + | 'APP_COMPONENTS_TABLE_ID_DESC' + | 'APP_COMPONENTS_TABLE_NAME_ASC' + | 'APP_COMPONENTS_TABLE_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type BillingModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BALANCES_TABLE_ID_ASC' + | 'BALANCES_TABLE_ID_DESC' + | 'BALANCES_TABLE_NAME_ASC' + | 'BALANCES_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LEDGER_TABLE_ID_ASC' + | 'LEDGER_TABLE_ID_DESC' + | 'LEDGER_TABLE_NAME_ASC' + | 'LEDGER_TABLE_NAME_DESC' + | 'METERS_TABLE_ID_ASC' + | 'METERS_TABLE_ID_DESC' + | 'METERS_TABLE_NAME_ASC' + | 'METERS_TABLE_NAME_DESC' + | 'METER_CREDITS_TABLE_ID_ASC' + | 'METER_CREDITS_TABLE_ID_DESC' + | 'METER_CREDITS_TABLE_NAME_ASC' + | 'METER_CREDITS_TABLE_NAME_DESC' + | 'METER_DEFAULTS_TABLE_ID_ASC' + | 'METER_DEFAULTS_TABLE_ID_DESC' + | 'METER_DEFAULTS_TABLE_NAME_ASC' + | 'METER_DEFAULTS_TABLE_NAME_DESC' + | 'METER_SOURCES_TABLE_ID_ASC' + | 'METER_SOURCES_TABLE_ID_DESC' + | 'METER_SOURCES_TABLE_NAME_ASC' + | 'METER_SOURCES_TABLE_NAME_DESC' + | 'NATURAL' + | 'PLAN_SUBSCRIPTIONS_TABLE_ID_ASC' + | 'PLAN_SUBSCRIPTIONS_TABLE_ID_DESC' + | 'PLAN_SUBSCRIPTIONS_TABLE_NAME_ASC' + | 'PLAN_SUBSCRIPTIONS_TABLE_NAME_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RECORD_USAGE_FUNCTION_ASC' + | 'RECORD_USAGE_FUNCTION_DESC' + | 'ROLLUP_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_ASC' + | 'SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_DESC'; +export type BillingProviderModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BILLING_CUSTOMERS_TABLE_ID_ASC' + | 'BILLING_CUSTOMERS_TABLE_ID_DESC' + | 'BILLING_CUSTOMERS_TABLE_NAME_ASC' + | 'BILLING_CUSTOMERS_TABLE_NAME_DESC' + | 'BILLING_PRICES_TABLE_ID_ASC' + | 'BILLING_PRICES_TABLE_ID_DESC' + | 'BILLING_PRICES_TABLE_NAME_ASC' + | 'BILLING_PRICES_TABLE_NAME_DESC' + | 'BILLING_PRODUCTS_TABLE_ID_ASC' + | 'BILLING_PRODUCTS_TABLE_ID_DESC' + | 'BILLING_PRODUCTS_TABLE_NAME_ASC' + | 'BILLING_PRODUCTS_TABLE_NAME_DESC' + | 'BILLING_SUBSCRIPTIONS_TABLE_ID_ASC' + | 'BILLING_SUBSCRIPTIONS_TABLE_ID_DESC' + | 'BILLING_SUBSCRIPTIONS_TABLE_NAME_ASC' + | 'BILLING_SUBSCRIPTIONS_TABLE_NAME_DESC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_ID_ASC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_ID_DESC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_NAME_ASC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRICES_TABLE_ID_ASC' + | 'PRICES_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PROCESS_BILLING_EVENT_FUNCTION_ASC' + | 'PROCESS_BILLING_EVENT_FUNCTION_DESC' + | 'PRODUCTS_TABLE_ID_ASC' + | 'PRODUCTS_TABLE_ID_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SUBSCRIPTIONS_TABLE_ID_ASC' + | 'SUBSCRIPTIONS_TABLE_ID_DESC'; +export type BlueprintOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DEFINITION_HASH_ASC' + | 'DEFINITION_HASH_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_HASHES_ASC' + | 'TABLE_HASHES_DESC' + | 'TEMPLATE_ID_ASC' + | 'TEMPLATE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type BlueprintConstructionOrderBy = + | 'BLUEPRINT_ID_ASC' + | 'BLUEPRINT_ID_DESC' + | 'CONSTRUCTED_AT_ASC' + | 'CONSTRUCTED_AT_DESC' + | 'CONSTRUCTED_DEFINITION_ASC' + | 'CONSTRUCTED_DEFINITION_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_DETAILS_ASC' + | 'ERROR_DETAILS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TABLE_MAP_ASC' + | 'TABLE_MAP_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type BlueprintTemplateOrderBy = + | 'CATEGORIES_ASC' + | 'CATEGORIES_DESC' + | 'COMPLEXITY_ASC' + | 'COMPLEXITY_DESC' + | 'COPY_COUNT_ASC' + | 'COPY_COUNT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DEFINITION_HASH_ASC' + | 'DEFINITION_HASH_DESC' + | 'DEFINITION_SCHEMA_VERSION_ASC' + | 'DEFINITION_SCHEMA_VERSION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'FORKED_FROM_ID_ASC' + | 'FORKED_FROM_ID_DESC' + | 'FORK_COUNT_ASC' + | 'FORK_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'TABLE_HASHES_ASC' + | 'TABLE_HASHES_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERSION_ASC' + | 'VERSION_DESC' + | 'VISIBILITY_ASC' + | 'VISIBILITY_DESC'; +export type CatalogModuleOrderBy = + | 'APIS_TABLE_ID_ASC' + | 'APIS_TABLE_ID_DESC' + | 'APIS_TABLE_NAME_ASC' + | 'APIS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPS_TABLE_ID_ASC' + | 'APPS_TABLE_ID_DESC' + | 'APPS_TABLE_NAME_ASC' + | 'APPS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAINS_TABLE_ID_ASC' + | 'DOMAINS_TABLE_ID_DESC' + | 'DOMAINS_TABLE_NAME_ASC' + | 'DOMAINS_TABLE_NAME_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTIONS_TABLE_ID_ASC' + | 'FUNCTIONS_TABLE_ID_DESC' + | 'FUNCTIONS_TABLE_NAME_ASC' + | 'FUNCTIONS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOURCES_TABLE_ID_ASC' + | 'RESOURCES_TABLE_ID_DESC' + | 'RESOURCES_TABLE_NAME_ASC' + | 'RESOURCES_TABLE_NAME_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SITES_TABLE_ID_ASC' + | 'SITES_TABLE_ID_DESC' + | 'SITES_TABLE_NAME_ASC' + | 'SITES_TABLE_NAME_DESC'; +export type ComputeLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COMPUTE_LOG_TABLE_ID_ASC' + | 'COMPUTE_LOG_TABLE_ID_DESC' + | 'COMPUTE_LOG_TABLE_NAME_ASC' + | 'COMPUTE_LOG_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type ConfigSecretsUserModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type ConnectedAccountsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type CryptoAddressesModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type CryptoAuthModuleOrderBy = + | 'ADDRESSES_TABLE_ID_ASC' + | 'ADDRESSES_TABLE_ID_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SIGN_IN_RECORD_FAILURE_ASC' + | 'SIGN_IN_RECORD_FAILURE_DESC' + | 'SIGN_IN_REQUEST_CHALLENGE_ASC' + | 'SIGN_IN_REQUEST_CHALLENGE_DESC' + | 'SIGN_IN_WITH_CHALLENGE_ASC' + | 'SIGN_IN_WITH_CHALLENGE_DESC' + | 'SIGN_UP_WITH_KEY_ASC' + | 'SIGN_UP_WITH_KEY_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'USER_FIELD_ASC' + | 'USER_FIELD_DESC'; +export type DatabaseProvisionModuleOrderBy = + | 'ASYNC_ASC' + | 'ASYNC_DESC' + | 'BOOTSTRAP_ERROR_ASC' + | 'BOOTSTRAP_ERROR_DESC' + | 'BOOTSTRAP_STATUS_ASC' + | 'BOOTSTRAP_STATUS_DESC' + | 'BOOTSTRAP_USER_ASC' + | 'BOOTSTRAP_USER_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATABASE_NAME_ASC' + | 'DATABASE_NAME_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'FULFILLED_AT_ASC' + | 'FULFILLED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MODULES_ASC' + | 'MODULES_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_DATABASE_ID_ASC' + | 'SOURCE_DATABASE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SUBDOMAIN_ASC' + | 'SUBDOMAIN_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseSettingsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATABASE_SETTINGS_TABLE_ID_ASC' + | 'DATABASE_SETTINGS_TABLE_ID_DESC' + | 'DATABASE_SETTINGS_TABLE_NAME_ASC' + | 'DATABASE_SETTINGS_TABLE_NAME_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBKEY_SETTINGS_TABLE_ID_ASC' + | 'PUBKEY_SETTINGS_TABLE_ID_DESC' + | 'PUBKEY_SETTINGS_TABLE_NAME_ASC' + | 'PUBKEY_SETTINGS_TABLE_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RLS_SETTINGS_TABLE_ID_ASC' + | 'RLS_SETTINGS_TABLE_ID_DESC' + | 'RLS_SETTINGS_TABLE_NAME_ASC' + | 'RLS_SETTINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'WEBAUTHN_SETTINGS_TABLE_ID_ASC' + | 'WEBAUTHN_SETTINGS_TABLE_ID_DESC' + | 'WEBAUTHN_SETTINGS_TABLE_NAME_ASC' + | 'WEBAUTHN_SETTINGS_TABLE_NAME_DESC'; +export type DbPoolConfigOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ENABLED_ASC' + | 'ENABLED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'MIN_ASC' + | 'MIN_DESC' + | 'NATURAL' + | 'POOL_OWNER_ID_ASC' + | 'POOL_OWNER_ID_DESC' + | 'PRESET_SLUG_ASC' + | 'PRESET_SLUG_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WARM_TTL_ASC' + | 'WARM_TTL_DESC'; +export type DbPoolOrderBy = + | 'BOOTSTRAP_ERROR_ASC' + | 'BOOTSTRAP_ERROR_DESC' + | 'BOOTSTRAP_STATUS_ASC' + | 'BOOTSTRAP_STATUS_DESC' + | 'CLAIMED_AT_ASC' + | 'CLAIMED_AT_DESC' + | 'CLAIMED_BY_ASC' + | 'CLAIMED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRESET_COMMIT_ID_ASC' + | 'PRESET_COMMIT_ID_DESC' + | 'PRESET_SLUG_ASC' + | 'PRESET_SLUG_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DbPresetModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DB_PRESETS_TABLE_ID_ASC' + | 'DB_PRESETS_TABLE_ID_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_ID_ASC' + | 'PUBLIC_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORE_NAME_ASC' + | 'STORE_NAME_DESC'; +export type DbUsageModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COLLECT_DB_QUERY_STATS_FUNCTION_ASC' + | 'COLLECT_DB_QUERY_STATS_FUNCTION_DESC' + | 'COLLECT_DB_TABLE_STATS_FUNCTION_ASC' + | 'COLLECT_DB_TABLE_STATS_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'QUERY_STATS_LOG_TABLE_ID_ASC' + | 'QUERY_STATS_LOG_TABLE_ID_DESC' + | 'QUERY_STATS_LOG_TABLE_NAME_ASC' + | 'QUERY_STATS_LOG_TABLE_NAME_DESC' + | 'QUERY_STATS_SUMMARY_TABLE_ID_ASC' + | 'QUERY_STATS_SUMMARY_TABLE_ID_DESC' + | 'QUERY_STATS_SUMMARY_TABLE_NAME_ASC' + | 'QUERY_STATS_SUMMARY_TABLE_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_DESC' + | 'ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_STATS_LOG_TABLE_ID_ASC' + | 'TABLE_STATS_LOG_TABLE_ID_DESC' + | 'TABLE_STATS_LOG_TABLE_NAME_ASC' + | 'TABLE_STATS_LOG_TABLE_NAME_DESC' + | 'TABLE_STATS_SUMMARY_TABLE_ID_ASC' + | 'TABLE_STATS_SUMMARY_TABLE_ID_DESC' + | 'TABLE_STATS_SUMMARY_TABLE_NAME_ASC' + | 'TABLE_STATS_SUMMARY_TABLE_NAME_DESC'; +export type DefaultIdsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type DenormalizedTableFieldOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'FUNC_NAME_ASC' + | 'FUNC_NAME_DESC' + | 'FUNC_ORDER_ASC' + | 'FUNC_ORDER_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_ID_ASC' + | 'REF_FIELD_ID_DESC' + | 'REF_IDS_ASC' + | 'REF_IDS_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SET_IDS_ASC' + | 'SET_IDS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATE_DEFAULTS_ASC' + | 'UPDATE_DEFAULTS_DESC' + | 'USE_UPDATES_ASC' + | 'USE_UPDATES_DESC'; +export type DevicesModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_ID_ASC' + | 'DEVICE_SETTINGS_TABLE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_NAME_ASC' + | 'DEVICE_SETTINGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'USER_DEVICES_TABLE_ID_ASC' + | 'USER_DEVICES_TABLE_ID_DESC' + | 'USER_DEVICES_TABLE_NAME_ASC' + | 'USER_DEVICES_TABLE_NAME_DESC'; +export type DomainModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAINS_TABLE_ID_ASC' + | 'DOMAINS_TABLE_ID_DESC' + | 'DOMAINS_TABLE_NAME_ASC' + | 'DOMAINS_TABLE_NAME_DESC' + | 'DOMAIN_EVENTS_TABLE_ID_ASC' + | 'DOMAIN_EVENTS_TABLE_ID_DESC' + | 'DOMAIN_EVENTS_TABLE_NAME_ASC' + | 'DOMAIN_EVENTS_TABLE_NAME_DESC' + | 'DOMAIN_VERIFICATIONS_TABLE_ID_ASC' + | 'DOMAIN_VERIFICATIONS_TABLE_ID_DESC' + | 'DOMAIN_VERIFICATIONS_TABLE_NAME_ASC' + | 'DOMAIN_VERIFICATIONS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAINS_TABLE_ID_ASC' + | 'MANAGED_DOMAINS_TABLE_ID_DESC' + | 'MANAGED_DOMAINS_TABLE_NAME_ASC' + | 'MANAGED_DOMAINS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type EmailsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type EntityTypeProvisionOrderBy = + | 'AGENTS_ASC' + | 'AGENTS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FUNCTIONS_ASC' + | 'FUNCTIONS_DESC' + | 'GRAPHS_ASC' + | 'GRAPHS_DESC' + | 'HAS_INVITES_ASC' + | 'HAS_INVITES_DESC' + | 'HAS_INVITE_ACHIEVEMENTS_ASC' + | 'HAS_INVITE_ACHIEVEMENTS_DESC' + | 'HAS_LEVELS_ASC' + | 'HAS_LEVELS_DESC' + | 'HAS_LIMITS_ASC' + | 'HAS_LIMITS_DESC' + | 'HAS_PROFILES_ASC' + | 'HAS_PROFILES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VISIBLE_ASC' + | 'IS_VISIBLE_DESC' + | 'NAMESPACES_ASC' + | 'NAMESPACES_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUT_AGENT_MODULE_ID_ASC' + | 'OUT_AGENT_MODULE_ID_DESC' + | 'OUT_BUCKETS_TABLE_ID_ASC' + | 'OUT_BUCKETS_TABLE_ID_DESC' + | 'OUT_DEFINITIONS_TABLE_ID_ASC' + | 'OUT_DEFINITIONS_TABLE_ID_DESC' + | 'OUT_ENTITY_TABLE_ID_ASC' + | 'OUT_ENTITY_TABLE_ID_DESC' + | 'OUT_ENTITY_TABLE_NAME_ASC' + | 'OUT_ENTITY_TABLE_NAME_DESC' + | 'OUT_EXECUTION_LOGS_TABLE_ID_ASC' + | 'OUT_EXECUTION_LOGS_TABLE_ID_DESC' + | 'OUT_FILES_TABLE_ID_ASC' + | 'OUT_FILES_TABLE_ID_DESC' + | 'OUT_FUNCTION_MODULE_ID_ASC' + | 'OUT_FUNCTION_MODULE_ID_DESC' + | 'OUT_GRAPHS_TABLE_ID_ASC' + | 'OUT_GRAPHS_TABLE_ID_DESC' + | 'OUT_GRAPH_MODULE_ID_ASC' + | 'OUT_GRAPH_MODULE_ID_DESC' + | 'OUT_INSTALLED_MODULES_ASC' + | 'OUT_INSTALLED_MODULES_DESC' + | 'OUT_INVITES_MODULE_ID_ASC' + | 'OUT_INVITES_MODULE_ID_DESC' + | 'OUT_INVOCATIONS_TABLE_ID_ASC' + | 'OUT_INVOCATIONS_TABLE_ID_DESC' + | 'OUT_MEMBERSHIP_TYPE_ASC' + | 'OUT_MEMBERSHIP_TYPE_DESC' + | 'OUT_NAMESPACES_TABLE_ID_ASC' + | 'OUT_NAMESPACES_TABLE_ID_DESC' + | 'OUT_NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'OUT_NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'OUT_NAMESPACE_MODULE_ID_ASC' + | 'OUT_NAMESPACE_MODULE_ID_DESC' + | 'OUT_PATH_SHARES_TABLE_ID_ASC' + | 'OUT_PATH_SHARES_TABLE_ID_DESC' + | 'OUT_STORAGE_MODULE_ID_ASC' + | 'OUT_STORAGE_MODULE_ID_DESC' + | 'PARENT_ENTITY_ASC' + | 'PARENT_ENTITY_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SKIP_ENTITY_POLICIES_ASC' + | 'SKIP_ENTITY_POLICIES_DESC' + | 'STORAGE_ASC' + | 'STORAGE_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'TABLE_PROVISION_ASC' + | 'TABLE_PROVISION_DESC'; +export type EventsModuleOrderBy = + | 'ACHIEVEMENT_REWARDS_TABLE_ID_ASC' + | 'ACHIEVEMENT_REWARDS_TABLE_ID_DESC' + | 'ACHIEVEMENT_REWARDS_TABLE_NAME_ASC' + | 'ACHIEVEMENT_REWARDS_TABLE_NAME_DESC' + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EVENTS_TABLE_ID_ASC' + | 'EVENTS_TABLE_ID_DESC' + | 'EVENTS_TABLE_NAME_ASC' + | 'EVENTS_TABLE_NAME_DESC' + | 'EVENT_AGGREGATES_TABLE_ID_ASC' + | 'EVENT_AGGREGATES_TABLE_ID_DESC' + | 'EVENT_AGGREGATES_TABLE_NAME_ASC' + | 'EVENT_AGGREGATES_TABLE_NAME_DESC' + | 'EVENT_TYPES_TABLE_ID_ASC' + | 'EVENT_TYPES_TABLE_ID_DESC' + | 'EVENT_TYPES_TABLE_NAME_ASC' + | 'EVENT_TYPES_TABLE_NAME_DESC' + | 'GRANT_ACHIEVEMENT_ASC' + | 'GRANT_ACHIEVEMENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'LEVELS_TABLE_ID_ASC' + | 'LEVELS_TABLE_ID_DESC' + | 'LEVELS_TABLE_NAME_ASC' + | 'LEVELS_TABLE_NAME_DESC' + | 'LEVEL_ACHIEVED_ASC' + | 'LEVEL_ACHIEVED_DESC' + | 'LEVEL_GRANTS_TABLE_ID_ASC' + | 'LEVEL_GRANTS_TABLE_ID_DESC' + | 'LEVEL_GRANTS_TABLE_NAME_ASC' + | 'LEVEL_GRANTS_TABLE_NAME_DESC' + | 'LEVEL_REQUIREMENTS_TABLE_ID_ASC' + | 'LEVEL_REQUIREMENTS_TABLE_ID_DESC' + | 'LEVEL_REQUIREMENTS_TABLE_NAME_ASC' + | 'LEVEL_REQUIREMENTS_TABLE_NAME_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RECORD_EVENT_ASC' + | 'RECORD_EVENT_DESC' + | 'REMOVE_EVENT_ASC' + | 'REMOVE_EVENT_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STEPS_REQUIRED_ASC' + | 'STEPS_REQUIRED_DESC' + | 'TG_ACHIEVEMENT_REWARD_ASC' + | 'TG_ACHIEVEMENT_REWARD_DESC' + | 'TG_CHECK_ACHIEVEMENTS_ASC' + | 'TG_CHECK_ACHIEVEMENTS_DESC' + | 'TG_EVENT_ASC' + | 'TG_EVENT_BOOL_ASC' + | 'TG_EVENT_BOOL_DESC' + | 'TG_EVENT_DESC' + | 'TG_EVENT_TOGGLE_ASC' + | 'TG_EVENT_TOGGLE_BOOL_ASC' + | 'TG_EVENT_TOGGLE_BOOL_DESC' + | 'TG_EVENT_TOGGLE_DESC' + | 'TG_UPDATE_AGGREGATES_ASC' + | 'TG_UPDATE_AGGREGATES_DESC' + | 'UPSERT_AGGREGATE_ASC' + | 'UPSERT_AGGREGATE_DESC'; +export type FunctionDeploymentModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DEPLOYMENTS_TABLE_ID_ASC' + | 'DEPLOYMENTS_TABLE_ID_DESC' + | 'DEPLOYMENTS_TABLE_NAME_ASC' + | 'DEPLOYMENTS_TABLE_NAME_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type FunctionInvocationModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'ATTEMPTS_TABLE_ID_ASC' + | 'ATTEMPTS_TABLE_ID_DESC' + | 'ATTEMPTS_TABLE_NAME_ASC' + | 'ATTEMPTS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EXECUTION_LOGS_TABLE_ID_ASC' + | 'EXECUTION_LOGS_TABLE_ID_DESC' + | 'EXECUTION_LOGS_TABLE_NAME_ASC' + | 'EXECUTION_LOGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATIONS_TABLE_ID_ASC' + | 'INVOCATIONS_TABLE_ID_DESC' + | 'INVOCATIONS_TABLE_NAME_ASC' + | 'INVOCATIONS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type FunctionModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BINDINGS_TABLE_ID_ASC' + | 'BINDINGS_TABLE_ID_DESC' + | 'BINDINGS_TABLE_NAME_ASC' + | 'BINDINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DEFINITIONS_TABLE_ID_ASC' + | 'DEFINITIONS_TABLE_ID_DESC' + | 'DEFINITIONS_TABLE_NAME_ASC' + | 'DEFINITIONS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HAS_CRON_ASC' + | 'HAS_CRON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEDULES_TABLE_ID_ASC' + | 'SCHEDULES_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type GraphExecutionModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_ID_ASC' + | 'EXECUTIONS_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_NAME_ASC' + | 'EXECUTIONS_TABLE_NAME_DESC' + | 'GRAPH_MODULE_ID_ASC' + | 'GRAPH_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODE_STATES_TABLE_ID_ASC' + | 'NODE_STATES_TABLE_ID_DESC' + | 'NODE_STATES_TABLE_NAME_ASC' + | 'NODE_STATES_TABLE_NAME_DESC' + | 'OUTPUTS_TABLE_ID_ASC' + | 'OUTPUTS_TABLE_ID_DESC' + | 'OUTPUTS_TABLE_NAME_ASC' + | 'OUTPUTS_TABLE_NAME_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type GraphModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GRAPHS_TABLE_ID_ASC' + | 'GRAPHS_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_ID_ASC' + | 'PUBLIC_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type HierarchyModuleOrderBy = + | 'CHART_EDGES_TABLE_ID_ASC' + | 'CHART_EDGES_TABLE_ID_DESC' + | 'CHART_EDGES_TABLE_NAME_ASC' + | 'CHART_EDGES_TABLE_NAME_DESC' + | 'CHART_EDGE_GRANTS_TABLE_ID_ASC' + | 'CHART_EDGE_GRANTS_TABLE_ID_DESC' + | 'CHART_EDGE_GRANTS_TABLE_NAME_ASC' + | 'CHART_EDGE_GRANTS_TABLE_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GET_MANAGERS_FUNCTION_ASC' + | 'GET_MANAGERS_FUNCTION_DESC' + | 'GET_SUBORDINATES_FUNCTION_ASC' + | 'GET_SUBORDINATES_FUNCTION_DESC' + | 'HIERARCHY_SPRT_TABLE_ID_ASC' + | 'HIERARCHY_SPRT_TABLE_ID_DESC' + | 'HIERARCHY_SPRT_TABLE_NAME_ASC' + | 'HIERARCHY_SPRT_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_MANAGER_OF_FUNCTION_ASC' + | 'IS_MANAGER_OF_FUNCTION_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'REBUILD_HIERARCHY_FUNCTION_ASC' + | 'REBUILD_HIERARCHY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SPRT_TABLE_NAME_ASC' + | 'SPRT_TABLE_NAME_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type HttpRouteModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'HTTP_ROUTES_TABLE_ID_ASC' + | 'HTTP_ROUTES_TABLE_ID_DESC' + | 'HTTP_ROUTES_TABLE_NAME_ASC' + | 'HTTP_ROUTES_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVER_FUNCTION_NAME_ASC' + | 'RESOLVER_FUNCTION_NAME_DESC' + | 'RESOURCE_MODULE_ID_ASC' + | 'RESOURCE_MODULE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORAGE_MODULE_ID_ASC' + | 'STORAGE_MODULE_ID_DESC'; +export type I18NModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SETTINGS_TABLE_ID_ASC' + | 'SETTINGS_TABLE_ID_DESC'; +export type IdentityProvidersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type InferenceLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INFERENCE_LOG_TABLE_ID_ASC' + | 'INFERENCE_LOG_TABLE_ID_DESC' + | 'INFERENCE_LOG_TABLE_NAME_ASC' + | 'INFERENCE_LOG_TABLE_NAME_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type InfraConfigModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CONFIG_TABLE_ID_ASC' + | 'CONFIG_TABLE_ID_DESC' + | 'CONFIG_TABLE_NAME_ASC' + | 'CONFIG_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type InfraSecretsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SECRETS_TABLE_NAME_ASC' + | 'SECRETS_TABLE_NAME_DESC'; +export type IntegrationProvidersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type InternalSecretsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERNAL_SECRETS_TABLE_ID_ASC' + | 'INTERNAL_SECRETS_TABLE_ID_DESC' + | 'INTERNAL_SECRETS_TABLE_NAME_ASC' + | 'INTERNAL_SECRETS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type InvitesModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CLAIMED_INVITES_TABLE_ID_ASC' + | 'CLAIMED_INVITES_TABLE_ID_DESC' + | 'CLAIMED_INVITES_TABLE_NAME_ASC' + | 'CLAIMED_INVITES_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EMAILS_TABLE_ID_ASC' + | 'EMAILS_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITES_TABLE_ID_ASC' + | 'INVITES_TABLE_ID_DESC' + | 'INVITES_TABLE_NAME_ASC' + | 'INVITES_TABLE_NAME_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SUBMIT_INVITE_CODE_FUNCTION_ASC' + | 'SUBMIT_INVITE_CODE_FUNCTION_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type LimitsModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'AGGREGATE_TABLE_ID_ASC' + | 'AGGREGATE_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CAP_CHECK_TRIGGER_ASC' + | 'CAP_CHECK_TRIGGER_DESC' + | 'CREDIT_CODES_TABLE_ID_ASC' + | 'CREDIT_CODES_TABLE_ID_DESC' + | 'CREDIT_CODE_ITEMS_TABLE_ID_ASC' + | 'CREDIT_CODE_ITEMS_TABLE_ID_DESC' + | 'CREDIT_REDEMPTIONS_TABLE_ID_ASC' + | 'CREDIT_REDEMPTIONS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_TABLE_ID_ASC' + | 'DEFAULT_TABLE_ID_DESC' + | 'DEFAULT_TABLE_NAME_ASC' + | 'DEFAULT_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EVENTS_TABLE_ID_ASC' + | 'EVENTS_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_ASC' + | 'LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_DESC' + | 'LIMIT_CAPS_DEFAULTS_TABLE_ID_ASC' + | 'LIMIT_CAPS_DEFAULTS_TABLE_ID_DESC' + | 'LIMIT_CAPS_TABLE_ID_ASC' + | 'LIMIT_CAPS_TABLE_ID_DESC' + | 'LIMIT_CHECK_FUNCTION_ASC' + | 'LIMIT_CHECK_FUNCTION_DESC' + | 'LIMIT_CHECK_SOFT_FUNCTION_ASC' + | 'LIMIT_CHECK_SOFT_FUNCTION_DESC' + | 'LIMIT_CREDITS_TABLE_ID_ASC' + | 'LIMIT_CREDITS_TABLE_ID_DESC' + | 'LIMIT_DECREMENT_FUNCTION_ASC' + | 'LIMIT_DECREMENT_FUNCTION_DESC' + | 'LIMIT_DECREMENT_TRIGGER_ASC' + | 'LIMIT_DECREMENT_TRIGGER_DESC' + | 'LIMIT_INCREMENT_FUNCTION_ASC' + | 'LIMIT_INCREMENT_FUNCTION_DESC' + | 'LIMIT_INCREMENT_TRIGGER_ASC' + | 'LIMIT_INCREMENT_TRIGGER_DESC' + | 'LIMIT_UPDATE_TRIGGER_ASC' + | 'LIMIT_UPDATE_TRIGGER_DESC' + | 'LIMIT_WARNINGS_TABLE_ID_ASC' + | 'LIMIT_WARNINGS_TABLE_ID_DESC' + | 'LIMIT_WARNING_STATE_TABLE_ID_ASC' + | 'LIMIT_WARNING_STATE_TABLE_ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVE_CAP_FUNCTION_ASC' + | 'RESOLVE_CAP_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type MembershipTypesModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type MembershipsModuleOrderBy = + | 'ACTOR_MASK_CHECK_ASC' + | 'ACTOR_MASK_CHECK_DESC' + | 'ACTOR_PERM_CHECK_ASC' + | 'ACTOR_PERM_CHECK_DESC' + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'ADMIN_GRANTS_TABLE_ID_ASC' + | 'ADMIN_GRANTS_TABLE_ID_DESC' + | 'ADMIN_GRANTS_TABLE_NAME_ASC' + | 'ADMIN_GRANTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_LIMITS_TABLE_ID_ASC' + | 'DEFAULT_LIMITS_TABLE_ID_DESC' + | 'DEFAULT_PERMISSIONS_TABLE_ID_ASC' + | 'DEFAULT_PERMISSIONS_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_IDS_BY_MASK_ASC' + | 'ENTITY_IDS_BY_MASK_DESC' + | 'ENTITY_IDS_BY_PERM_ASC' + | 'ENTITY_IDS_BY_PERM_DESC' + | 'ENTITY_IDS_FUNCTION_ASC' + | 'ENTITY_IDS_FUNCTION_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ENTITY_TABLE_OWNER_ID_ASC' + | 'ENTITY_TABLE_OWNER_ID_DESC' + | 'GET_ORG_FN_ASC' + | 'GET_ORG_FN_DESC' + | 'GRANTS_TABLE_ID_ASC' + | 'GRANTS_TABLE_ID_DESC' + | 'GRANTS_TABLE_NAME_ASC' + | 'GRANTS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LIMITS_TABLE_ID_ASC' + | 'LIMITS_TABLE_ID_DESC' + | 'MEMBERSHIPS_TABLE_ID_ASC' + | 'MEMBERSHIPS_TABLE_ID_DESC' + | 'MEMBERSHIPS_TABLE_NAME_ASC' + | 'MEMBERSHIPS_TABLE_NAME_DESC' + | 'MEMBERSHIP_DEFAULTS_TABLE_ID_ASC' + | 'MEMBERSHIP_DEFAULTS_TABLE_ID_DESC' + | 'MEMBERSHIP_DEFAULTS_TABLE_NAME_ASC' + | 'MEMBERSHIP_DEFAULTS_TABLE_NAME_DESC' + | 'MEMBERSHIP_SETTINGS_TABLE_ID_ASC' + | 'MEMBERSHIP_SETTINGS_TABLE_ID_DESC' + | 'MEMBERSHIP_SETTINGS_TABLE_NAME_ASC' + | 'MEMBERSHIP_SETTINGS_TABLE_NAME_DESC' + | 'MEMBERS_TABLE_ID_ASC' + | 'MEMBERS_TABLE_ID_DESC' + | 'MEMBERS_TABLE_NAME_ASC' + | 'MEMBERS_TABLE_NAME_DESC' + | 'MEMBER_PROFILES_TABLE_ID_ASC' + | 'MEMBER_PROFILES_TABLE_ID_DESC' + | 'NATURAL' + | 'OWNER_GRANTS_TABLE_ID_ASC' + | 'OWNER_GRANTS_TABLE_ID_DESC' + | 'OWNER_GRANTS_TABLE_NAME_ASC' + | 'OWNER_GRANTS_TABLE_NAME_DESC' + | 'PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSIONS_TABLE_ID_DESC' + | 'PERMISSION_DEFAULT_GRANTS_TABLE_ID_ASC' + | 'PERMISSION_DEFAULT_GRANTS_TABLE_ID_DESC' + | 'PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SPRT_TABLE_ID_ASC' + | 'SPRT_TABLE_ID_DESC'; +export type MerkleStoreModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COMMIT_TABLE_ID_ASC' + | 'COMMIT_TABLE_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'FUNCTION_PREFIX_ASC' + | 'FUNCTION_PREFIX_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OBJECT_TABLE_ID_ASC' + | 'OBJECT_TABLE_ID_DESC' + | 'PERMISSION_KEY_ASC' + | 'PERMISSION_KEY_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORE_TABLE_ID_ASC' + | 'STORE_TABLE_ID_DESC'; +export type NamespaceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' + | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type NotificationsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHANNELS_TABLE_ID_ASC' + | 'CHANNELS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DELIVERY_LOG_TABLE_ID_ASC' + | 'DELIVERY_LOG_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'HAS_CHANNELS_ASC' + | 'HAS_CHANNELS_DESC' + | 'HAS_DIGEST_METADATA_ASC' + | 'HAS_DIGEST_METADATA_DESC' + | 'HAS_PREFERENCES_ASC' + | 'HAS_PREFERENCES_DESC' + | 'HAS_SETTINGS_EXTENSION_ASC' + | 'HAS_SETTINGS_EXTENSION_DESC' + | 'HAS_SUBSCRIPTIONS_ASC' + | 'HAS_SUBSCRIPTIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NOTIFICATIONS_TABLE_ID_ASC' + | 'NOTIFICATIONS_TABLE_ID_DESC' + | 'ORGANIZATION_SETTINGS_TABLE_ID_ASC' + | 'ORGANIZATION_SETTINGS_TABLE_ID_DESC' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PREFERENCES_TABLE_ID_ASC' + | 'PREFERENCES_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'READ_STATE_TABLE_ID_ASC' + | 'READ_STATE_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SUPPRESSIONS_TABLE_ID_ASC' + | 'SUPPRESSIONS_TABLE_ID_DESC' + | 'USER_SETTINGS_TABLE_ID_ASC' + | 'USER_SETTINGS_TABLE_ID_DESC'; +export type PermissionsModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BITLEN_ASC' + | 'BITLEN_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_TABLE_ID_ASC' + | 'DEFAULT_TABLE_ID_DESC' + | 'DEFAULT_TABLE_NAME_ASC' + | 'DEFAULT_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GET_BY_MASK_ASC' + | 'GET_BY_MASK_DESC' + | 'GET_MASK_ASC' + | 'GET_MASK_BY_NAME_ASC' + | 'GET_MASK_BY_NAME_DESC' + | 'GET_MASK_DESC' + | 'GET_PADDED_MASK_ASC' + | 'GET_PADDED_MASK_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type PhoneNumbersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type PlansModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPLY_BILLING_PLAN_FUNCTION_ASC' + | 'APPLY_BILLING_PLAN_FUNCTION_DESC' + | 'APPLY_PLAN_AGGREGATE_FUNCTION_ASC' + | 'APPLY_PLAN_AGGREGATE_FUNCTION_DESC' + | 'APPLY_PLAN_CAPS_FUNCTION_ASC' + | 'APPLY_PLAN_CAPS_FUNCTION_DESC' + | 'APPLY_PLAN_FUNCTION_ASC' + | 'APPLY_PLAN_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PLANS_TABLE_ID_ASC' + | 'PLANS_TABLE_ID_DESC' + | 'PLANS_TABLE_NAME_ASC' + | 'PLANS_TABLE_NAME_DESC' + | 'PLAN_CAPS_TABLE_ID_ASC' + | 'PLAN_CAPS_TABLE_ID_DESC' + | 'PLAN_LIMITS_TABLE_ID_ASC' + | 'PLAN_LIMITS_TABLE_ID_DESC' + | 'PLAN_LIMITS_TABLE_NAME_ASC' + | 'PLAN_LIMITS_TABLE_NAME_DESC' + | 'PLAN_METER_LIMITS_TABLE_ID_ASC' + | 'PLAN_METER_LIMITS_TABLE_ID_DESC' + | 'PLAN_OVERRIDES_TABLE_ID_ASC' + | 'PLAN_OVERRIDES_TABLE_ID_DESC' + | 'PLAN_PRICING_TABLE_ID_ASC' + | 'PLAN_PRICING_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type PrincipalAuthModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'CREATE_ORG_API_KEY_FUNCTION_ASC' + | 'CREATE_ORG_API_KEY_FUNCTION_DESC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_PRINCIPAL_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_PRINCIPAL_FUNCTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPALS_TABLE_ID_ASC' + | 'PRINCIPALS_TABLE_ID_DESC' + | 'PRINCIPALS_TABLE_NAME_ASC' + | 'PRINCIPALS_TABLE_NAME_DESC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_ASC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_DESC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC' + | 'REVOKE_ORG_API_KEY_FUNCTION_ASC' + | 'REVOKE_ORG_API_KEY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type ProfilesModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MEMBERSHIPS_TABLE_ID_ASC' + | 'MEMBERSHIPS_TABLE_ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSIONS_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_ID_ASC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_ID_DESC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_NAME_ASC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_NAME_DESC' + | 'PROFILE_GRANTS_TABLE_ID_ASC' + | 'PROFILE_GRANTS_TABLE_ID_DESC' + | 'PROFILE_GRANTS_TABLE_NAME_ASC' + | 'PROFILE_GRANTS_TABLE_NAME_DESC' + | 'PROFILE_PERMISSIONS_TABLE_ID_ASC' + | 'PROFILE_PERMISSIONS_TABLE_ID_DESC' + | 'PROFILE_PERMISSIONS_TABLE_NAME_ASC' + | 'PROFILE_PERMISSIONS_TABLE_NAME_DESC' + | 'PROFILE_TEMPLATES_TABLE_ID_ASC' + | 'PROFILE_TEMPLATES_TABLE_ID_DESC' + | 'PROFILE_TEMPLATES_TABLE_NAME_ASC' + | 'PROFILE_TEMPLATES_TABLE_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type RateLimitMetersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHECK_RATE_LIMIT_FUNCTION_ASC' + | 'CHECK_RATE_LIMIT_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RATE_LIMIT_OVERRIDES_TABLE_ID_ASC' + | 'RATE_LIMIT_OVERRIDES_TABLE_ID_DESC' + | 'RATE_LIMIT_OVERRIDES_TABLE_NAME_ASC' + | 'RATE_LIMIT_OVERRIDES_TABLE_NAME_DESC' + | 'RATE_LIMIT_STATE_TABLE_ID_ASC' + | 'RATE_LIMIT_STATE_TABLE_ID_DESC' + | 'RATE_LIMIT_STATE_TABLE_NAME_ASC' + | 'RATE_LIMIT_STATE_TABLE_NAME_DESC' + | 'RATE_WINDOW_LIMITS_TABLE_ID_ASC' + | 'RATE_WINDOW_LIMITS_TABLE_ID_DESC' + | 'RATE_WINDOW_LIMITS_TABLE_NAME_ASC' + | 'RATE_WINDOW_LIMITS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type RateLimitsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IP_RATE_LIMITS_TABLE_ID_ASC' + | 'IP_RATE_LIMITS_TABLE_ID_DESC' + | 'IP_RATE_LIMITS_TABLE_NAME_ASC' + | 'IP_RATE_LIMITS_TABLE_NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RATE_LIMITS_TABLE_ID_ASC' + | 'RATE_LIMITS_TABLE_ID_DESC' + | 'RATE_LIMITS_TABLE_NAME_ASC' + | 'RATE_LIMITS_TABLE_NAME_DESC' + | 'RATE_LIMIT_SETTINGS_TABLE_ID_ASC' + | 'RATE_LIMIT_SETTINGS_TABLE_ID_DESC' + | 'RATE_LIMIT_SETTINGS_TABLE_NAME_ASC' + | 'RATE_LIMIT_SETTINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type RealtimeModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHANGE_LOG_TABLE_ID_ASC' + | 'CHANGE_LOG_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'LISTENER_NODE_TABLE_ID_ASC' + | 'LISTENER_NODE_TABLE_ID_DESC' + | 'NATURAL' + | 'NOTIFY_CHANNEL_ASC' + | 'NOTIFY_CHANNEL_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'RETENTION_HOURS_ASC' + | 'RETENTION_HOURS_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SOURCE_REGISTRY_TABLE_ID_ASC' + | 'SOURCE_REGISTRY_TABLE_ID_DESC' + | 'SUBSCRIPTIONS_SCHEMA_ID_ASC' + | 'SUBSCRIPTIONS_SCHEMA_ID_DESC'; +export type RelationProvisionOrderBy = + | 'API_REQUIRED_ASC' + | 'API_REQUIRED_DESC' + | 'CREATE_INDEX_ASC' + | 'CREATE_INDEX_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACTION_ASC' + | 'DELETE_ACTION_DESC' + | 'EXPOSE_IN_API_ASC' + | 'EXPOSE_IN_API_DESC' + | 'FIELD_NAME_ASC' + | 'FIELD_NAME_DESC' + | 'GRANTS_ASC' + | 'GRANTS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_REQUIRED_ASC' + | 'IS_REQUIRED_DESC' + | 'JUNCTION_SCHEMA_ID_ASC' + | 'JUNCTION_SCHEMA_ID_DESC' + | 'JUNCTION_TABLE_ID_ASC' + | 'JUNCTION_TABLE_ID_DESC' + | 'JUNCTION_TABLE_NAME_ASC' + | 'JUNCTION_TABLE_NAME_DESC' + | 'NATURAL' + | 'NODES_ASC' + | 'NODES_DESC' + | 'OUT_FIELD_ID_ASC' + | 'OUT_FIELD_ID_DESC' + | 'OUT_JUNCTION_TABLE_ID_ASC' + | 'OUT_JUNCTION_TABLE_ID_DESC' + | 'OUT_SOURCE_FIELD_ID_ASC' + | 'OUT_SOURCE_FIELD_ID_DESC' + | 'OUT_TARGET_FIELD_ID_ASC' + | 'OUT_TARGET_FIELD_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RELATION_TYPE_ASC' + | 'RELATION_TYPE_DESC' + | 'SOURCE_FIELD_NAME_ASC' + | 'SOURCE_FIELD_NAME_DESC' + | 'SOURCE_TABLE_ID_ASC' + | 'SOURCE_TABLE_ID_DESC' + | 'TARGET_FIELD_NAME_ASC' + | 'TARGET_FIELD_NAME_DESC' + | 'TARGET_TABLE_ID_ASC' + | 'TARGET_TABLE_ID_DESC' + | 'USE_COMPOSITE_KEY_ASC' + | 'USE_COMPOSITE_KEY_DESC'; +export type ResourceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_STORE_NAME_ASC' + | 'INSTALLATION_STORE_NAME_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'REQUIREMENTS_STATE_VIEW_NAME_ASC' + | 'REQUIREMENTS_STATE_VIEW_NAME_DESC' + | 'RESOLVED_REQUIREMENTS_VIEW_NAME_ASC' + | 'RESOLVED_REQUIREMENTS_VIEW_NAME_DESC' + | 'RESOURCES_TABLE_ID_ASC' + | 'RESOURCES_TABLE_ID_DESC' + | 'RESOURCES_TABLE_NAME_ASC' + | 'RESOURCES_TABLE_NAME_DESC' + | 'RESOURCE_BILLING_ROLLUP_FUNCTION_ASC' + | 'RESOURCE_BILLING_ROLLUP_FUNCTION_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_DESC' + | 'RESOURCE_EVENTS_TABLE_ID_ASC' + | 'RESOURCE_EVENTS_TABLE_ID_DESC' + | 'RESOURCE_EVENTS_TABLE_NAME_ASC' + | 'RESOURCE_EVENTS_TABLE_NAME_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_DESC' + | 'RESOURCE_STATUS_CHECKS_TABLE_ID_ASC' + | 'RESOURCE_STATUS_CHECKS_TABLE_ID_DESC' + | 'RESOURCE_STATUS_CHECKS_TABLE_NAME_ASC' + | 'RESOURCE_STATUS_CHECKS_TABLE_NAME_DESC' + | 'RESOURCE_USAGE_LOG_TABLE_ID_ASC' + | 'RESOURCE_USAGE_LOG_TABLE_ID_DESC' + | 'RESOURCE_USAGE_LOG_TABLE_NAME_ASC' + | 'RESOURCE_USAGE_LOG_TABLE_NAME_DESC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_ID_ASC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_ID_DESC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_NAME_ASC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_NAME_DESC' + | 'ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type RlsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUTHENTICATE_ASC' + | 'AUTHENTICATE_DESC' + | 'AUTHENTICATE_STRICT_ASC' + | 'AUTHENTICATE_STRICT_DESC' + | 'CURRENT_ROLE_ASC' + | 'CURRENT_ROLE_DESC' + | 'CURRENT_ROLE_ID_ASC' + | 'CURRENT_ROLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type RouteModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAIN_MODULE_ID_ASC' + | 'DOMAIN_MODULE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HOSTNAME_BINDINGS_TABLE_ID_ASC' + | 'HOSTNAME_BINDINGS_TABLE_ID_DESC' + | 'HOSTNAME_BINDINGS_TABLE_NAME_ASC' + | 'HOSTNAME_BINDINGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVER_FUNCTION_NAME_ASC' + | 'RESOLVER_FUNCTION_NAME_DESC' + | 'ROUTES_TABLE_ID_ASC' + | 'ROUTES_TABLE_ID_DESC' + | 'ROUTES_TABLE_NAME_ASC' + | 'ROUTES_TABLE_NAME_DESC' + | 'ROUTE_BINDINGS_TABLE_ID_ASC' + | 'ROUTE_BINDINGS_TABLE_ID_DESC' + | 'ROUTE_BINDINGS_TABLE_NAME_ASC' + | 'ROUTE_BINDINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type SecureTableProvisionOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELDS_ASC' + | 'FIELDS_DESC' + | 'GRANTS_ASC' + | 'GRANTS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODES_ASC' + | 'NODES_DESC' + | 'OUT_FIELDS_ASC' + | 'OUT_FIELDS_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'USE_RLS_ASC' + | 'USE_RLS_DESC'; +export type SessionSecretsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type SessionsModuleOrderBy = + | 'AUTH_SETTINGS_TABLE_ID_ASC' + | 'AUTH_SETTINGS_TABLE_ID_DESC' + | 'AUTH_SETTINGS_TABLE_NAME_ASC' + | 'AUTH_SETTINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_DEFAULT_EXPIRATION_ASC' + | 'SESSIONS_DEFAULT_EXPIRATION_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_NAME_ASC' + | 'SESSIONS_TABLE_NAME_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_NAME_ASC' + | 'SESSION_CREDENTIALS_TABLE_NAME_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type SiteSurfaceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SITES_TABLE_ID_ASC' + | 'SITES_TABLE_ID_DESC' + | 'SITES_TABLE_NAME_ASC' + | 'SITES_TABLE_NAME_DESC' + | 'SITE_METADATA_TABLE_ID_ASC' + | 'SITE_METADATA_TABLE_ID_DESC' + | 'SITE_METADATA_TABLE_NAME_ASC' + | 'SITE_METADATA_TABLE_NAME_DESC' + | 'SITE_MODULES_TABLE_ID_ASC' + | 'SITE_MODULES_TABLE_ID_DESC' + | 'SITE_MODULES_TABLE_NAME_ASC' + | 'SITE_MODULES_TABLE_NAME_DESC' + | 'SITE_THEMES_TABLE_ID_ASC' + | 'SITE_THEMES_TABLE_ID_DESC' + | 'SITE_THEMES_TABLE_NAME_ASC' + | 'SITE_THEMES_TABLE_NAME_DESC'; +export type StorageLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORAGE_LOG_TABLE_ID_ASC' + | 'STORAGE_LOG_TABLE_ID_DESC' + | 'STORAGE_LOG_TABLE_NAME_ASC' + | 'STORAGE_LOG_TABLE_NAME_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type StorageModuleOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BUCKETS_TABLE_ID_ASC' + | 'BUCKETS_TABLE_ID_DESC' + | 'BUCKETS_TABLE_NAME_ASC' + | 'BUCKETS_TABLE_NAME_DESC' + | 'CACHE_TTL_SECONDS_ASC' + | 'CACHE_TTL_SECONDS_DESC' + | 'CONFIRM_UPLOAD_DELAY_ASC' + | 'CONFIRM_UPLOAD_DELAY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_MAX_FILE_SIZE_ASC' + | 'DEFAULT_MAX_FILE_SIZE_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOWNLOAD_URL_EXPIRY_SECONDS_ASC' + | 'DOWNLOAD_URL_EXPIRY_SECONDS_DESC' + | 'ENDPOINT_ASC' + | 'ENDPOINT_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FILES_TABLE_ID_ASC' + | 'FILES_TABLE_ID_DESC' + | 'FILES_TABLE_NAME_ASC' + | 'FILES_TABLE_NAME_DESC' + | 'FILE_EVENTS_TABLE_ID_ASC' + | 'FILE_EVENTS_TABLE_ID_DESC' + | 'HAS_AUDIT_LOG_ASC' + | 'HAS_AUDIT_LOG_DESC' + | 'HAS_CONFIRM_UPLOAD_ASC' + | 'HAS_CONFIRM_UPLOAD_DESC' + | 'HAS_CONTENT_HASH_ASC' + | 'HAS_CONTENT_HASH_DESC' + | 'HAS_CUSTOM_KEYS_ASC' + | 'HAS_CUSTOM_KEYS_DESC' + | 'HAS_PATH_SHARES_ASC' + | 'HAS_PATH_SHARES_DESC' + | 'HAS_VERSIONING_ASC' + | 'HAS_VERSIONING_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_BULK_FILES_ASC' + | 'MAX_BULK_FILES_DESC' + | 'MAX_BULK_TOTAL_SIZE_ASC' + | 'MAX_BULK_TOTAL_SIZE_DESC' + | 'MAX_FILENAME_LENGTH_ASC' + | 'MAX_FILENAME_LENGTH_DESC' + | 'NATURAL' + | 'PATH_SHARES_TABLE_ID_ASC' + | 'PATH_SHARES_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PUBLIC_URL_PREFIX_ASC' + | 'PUBLIC_URL_PREFIX_DESC' + | 'RESTRICT_READS_ASC' + | 'RESTRICT_READS_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'UPLOAD_URL_EXPIRY_SECONDS_ASC' + | 'UPLOAD_URL_EXPIRY_SECONDS_DESC'; +export type TransferLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TRANSFER_LOG_TABLE_ID_ASC' + | 'TRANSFER_LOG_TABLE_ID_DESC' + | 'TRANSFER_LOG_TABLE_NAME_ASC' + | 'TRANSFER_LOG_TABLE_NAME_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type UserAuthModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'AUDITS_TABLE_NAME_ASC' + | 'AUDITS_TABLE_NAME_DESC' + | 'CHECK_PASSWORD_FUNCTION_ASC' + | 'CHECK_PASSWORD_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACCOUNT_FUNCTION_ASC' + | 'DELETE_ACCOUNT_FUNCTION_DESC' + | 'EMAILS_TABLE_ID_ASC' + | 'EMAILS_TABLE_ID_DESC' + | 'ENCRYPTED_TABLE_ID_ASC' + | 'ENCRYPTED_TABLE_ID_DESC' + | 'EXTEND_TOKEN_EXPIRES_ASC' + | 'EXTEND_TOKEN_EXPIRES_DESC' + | 'FORGOT_PASSWORD_FUNCTION_ASC' + | 'FORGOT_PASSWORD_FUNCTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_ASC' + | 'REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_DESC' + | 'RESET_PASSWORD_FUNCTION_ASC' + | 'RESET_PASSWORD_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_ASC' + | 'SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_DESC' + | 'SEND_VERIFICATION_EMAIL_FUNCTION_ASC' + | 'SEND_VERIFICATION_EMAIL_FUNCTION_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SET_PASSWORD_FUNCTION_ASC' + | 'SET_PASSWORD_FUNCTION_DESC' + | 'SIGN_IN_CROSS_ORIGIN_FUNCTION_ASC' + | 'SIGN_IN_CROSS_ORIGIN_FUNCTION_DESC' + | 'SIGN_IN_FUNCTION_ASC' + | 'SIGN_IN_FUNCTION_DESC' + | 'SIGN_OUT_FUNCTION_ASC' + | 'SIGN_OUT_FUNCTION_DESC' + | 'SIGN_UP_FUNCTION_ASC' + | 'SIGN_UP_FUNCTION_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'VERIFY_EMAIL_FUNCTION_ASC' + | 'VERIFY_EMAIL_FUNCTION_DESC' + | 'VERIFY_PASSWORD_FUNCTION_ASC' + | 'VERIFY_PASSWORD_FUNCTION_DESC'; +export type UserCredentialsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UserSettingsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UserStateModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UsersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'TYPE_TABLE_ID_ASC' + | 'TYPE_TABLE_ID_DESC' + | 'TYPE_TABLE_NAME_ASC' + | 'TYPE_TABLE_NAME_DESC'; +export type WebauthnAuthModuleOrderBy = + | 'ATTESTATION_TYPE_ASC' + | 'ATTESTATION_TYPE_DESC' + | 'AUTH_SETTINGS_TABLE_ID_ASC' + | 'AUTH_SETTINGS_TABLE_ID_DESC' + | 'CHALLENGE_EXPIRY_ASC' + | 'CHALLENGE_EXPIRY_DESC' + | 'CREDENTIALS_TABLE_ID_ASC' + | 'CREDENTIALS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORIGIN_ALLOWLIST_ASC' + | 'ORIGIN_ALLOWLIST_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRE_USER_VERIFICATION_ASC' + | 'REQUIRE_USER_VERIFICATION_DESC' + | 'RESIDENT_KEY_ASC' + | 'RESIDENT_KEY_DESC' + | 'RP_ID_ASC' + | 'RP_ID_DESC' + | 'RP_NAME_ASC' + | 'RP_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_SECRETS_TABLE_ID_ASC' + | 'SESSION_SECRETS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type WebauthnCredentialsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type WebhookModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_INVOCATION_MODULE_ID_ASC' + | 'FUNCTION_INVOCATION_MODULE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INFRA_SECRETS_MODULE_ID_ASC' + | 'INFRA_SECRETS_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'WEBHOOK_ENDPOINTS_TABLE_ID_ASC' + | 'WEBHOOK_ENDPOINTS_TABLE_ID_DESC' + | 'WEBHOOK_ENDPOINTS_TABLE_NAME_ASC' + | 'WEBHOOK_ENDPOINTS_TABLE_NAME_DESC' + | 'WEBHOOK_EVENTS_TABLE_ID_ASC' + | 'WEBHOOK_EVENTS_TABLE_ID_DESC' + | 'WEBHOOK_EVENTS_TABLE_NAME_ASC' + | 'WEBHOOK_EVENTS_TABLE_NAME_DESC'; // ============ CRUD Input Types ============ export interface CreateAgentModuleInput { clientMutationId?: string; @@ -11414,17 +14435,17 @@ export interface DeleteWebhookModuleInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Blueprint": { - "blueprintConstructions": "BlueprintConstruction" + Blueprint: { + blueprintConstructions: 'BlueprintConstruction', }, - "BlueprintTemplate": { - "blueprintTemplatesByForkedFromId": "BlueprintTemplate", - "blueprintsByTemplateId": "Blueprint" + BlueprintTemplate: { + blueprintTemplatesByForkedFromId: 'BlueprintTemplate', + blueprintsByTemplateId: 'Blueprint', + }, + MerkleStoreModule: { + dbPresetModules: 'DbPresetModule', + graphModules: 'GraphModule', }, - "MerkleStoreModule": { - "dbPresetModules": "DbPresetModule", - "graphModules": "GraphModule" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ConstructBlueprintInput { @@ -18549,4 +21570,4 @@ export type WebhookModuleEdgeSelect = { node?: { select: WebhookModuleSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/modules/orm/models/agentModule.ts b/sdk/constructive-react/src/modules/orm/models/agentModule.ts index 27f6100e9a..ec52583704 100644 --- a/sdk/constructive-react/src/modules/orm/models/agentModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/agentModule.ts @@ -3,56 +3,96 @@ * @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 { AgentModule, AgentModuleWithRelations, AgentModuleSelect, AgentModuleFilter, AgentModuleOrderBy, CreateAgentModuleInput, UpdateAgentModuleInput, AgentModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentModule, + AgentModuleWithRelations, + AgentModuleSelect, + AgentModuleFilter, + AgentModuleOrderBy, + CreateAgentModuleInput, + UpdateAgentModuleInput, + AgentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentModule", "agentModules", 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 - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentModule', + 'agentModules', + 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, + }, + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModules", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentModule", "agentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentModule', + 'agentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModule", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentModule": data.agentModules?.nodes?.[0] ?? null - }) + agentModule: data.agentModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentModule", "agentModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentModule', + 'agentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModule", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentModule": data.agentModules?.nodes?.[0] ?? null - }) + agentModule: data.agentModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentModule", "createAgentModule", "agentModule", args.select, args.data, "CreateAgentModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentModule', + 'createAgentModule', + 'agentModule', + args.select, + args.data, + 'CreateAgentModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "createAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'createAgentModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentModule", "updateAgentModule", "agentModule", args.select, args.where.id, args.data, "UpdateAgentModuleInput", "id", "agentModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentModule', + 'updateAgentModule', + 'agentModule', + args.select, + args.where.id, + args.data, + 'UpdateAgentModuleInput', + 'id', + 'agentModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "updateAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'updateAgentModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentModule", "deleteAgentModule", "agentModule", { - id: args.where.id - }, "DeleteAgentModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentModule', + 'deleteAgentModule', + 'agentModule', + { + id: args.where.id, + }, + 'DeleteAgentModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "deleteAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'deleteAgentModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/apiSurfaceModule.ts b/sdk/constructive-react/src/modules/orm/models/apiSurfaceModule.ts index 449acbf127..12cb1d83e3 100644 --- a/sdk/constructive-react/src/modules/orm/models/apiSurfaceModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/apiSurfaceModule.ts @@ -3,56 +3,96 @@ * @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 { ApiSurfaceModule, ApiSurfaceModuleWithRelations, ApiSurfaceModuleSelect, ApiSurfaceModuleFilter, ApiSurfaceModuleOrderBy, CreateApiSurfaceModuleInput, UpdateApiSurfaceModuleInput, ApiSurfaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSurfaceModule, + ApiSurfaceModuleWithRelations, + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy, + CreateApiSurfaceModuleInput, + UpdateApiSurfaceModuleInput, + ApiSurfaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSurfaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSurfaceModule", "apiSurfaceModules", 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 - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + 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, + }, + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModules", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSurfaceModule", "apiSurfaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModule", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSurfaceModule": data.apiSurfaceModules?.nodes?.[0] ?? null - }) + apiSurfaceModule: data.apiSurfaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSurfaceModule", "apiSurfaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModule", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSurfaceModule": data.apiSurfaceModules?.nodes?.[0] ?? null - }) + apiSurfaceModule: data.apiSurfaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSurfaceModule", "createApiSurfaceModule", "apiSurfaceModule", args.select, args.data, "CreateApiSurfaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSurfaceModule', + 'createApiSurfaceModule', + 'apiSurfaceModule', + args.select, + args.data, + 'CreateApiSurfaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "createApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'createApiSurfaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSurfaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSurfaceModule", "updateApiSurfaceModule", "apiSurfaceModule", args.select, args.where.id, args.data, "UpdateApiSurfaceModuleInput", "id", "apiSurfaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSurfaceModule', + 'updateApiSurfaceModule', + 'apiSurfaceModule', + args.select, + args.where.id, + args.data, + 'UpdateApiSurfaceModuleInput', + 'id', + 'apiSurfaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "updateApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'updateApiSurfaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSurfaceModule", "deleteApiSurfaceModule", "apiSurfaceModule", { - id: args.where.id - }, "DeleteApiSurfaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSurfaceModule', + 'deleteApiSurfaceModule', + 'apiSurfaceModule', + { + id: args.where.id, + }, + 'DeleteApiSurfaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "deleteApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'deleteApiSurfaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/appModule.ts b/sdk/constructive-react/src/modules/orm/models/appModule.ts index 4a23e0239d..78c5786d0e 100644 --- a/sdk/constructive-react/src/modules/orm/models/appModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/appModule.ts @@ -3,56 +3,96 @@ * @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 { AppModule, AppModuleWithRelations, AppModuleSelect, AppModuleFilter, AppModuleOrderBy, CreateAppModuleInput, UpdateAppModuleInput, AppModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppModule, + AppModuleWithRelations, + AppModuleSelect, + AppModuleFilter, + AppModuleOrderBy, + CreateAppModuleInput, + UpdateAppModuleInput, + AppModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppModule", "appModules", 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 - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppModule', + 'appModules', + 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, + }, + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModules", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppModule", "appModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppModule', + 'appModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModule", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "appModule": data.appModules?.nodes?.[0] ?? null - }) + appModule: data.appModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppModule", "appModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppModule', + 'appModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModule", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "appModule": data.appModules?.nodes?.[0] ?? null - }) + appModule: data.appModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppModule", "createAppModule", "appModule", args.select, args.data, "CreateAppModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppModule', + 'createAppModule', + 'appModule', + args.select, + args.data, + 'CreateAppModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "createAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'createAppModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppModule", "updateAppModule", "appModule", args.select, args.where.id, args.data, "UpdateAppModuleInput", "id", "appModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppModule', + 'updateAppModule', + 'appModule', + args.select, + args.where.id, + args.data, + 'UpdateAppModuleInput', + 'id', + 'appModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "updateAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'updateAppModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppModule", "deleteAppModule", "appModule", { - id: args.where.id - }, "DeleteAppModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppModule', + 'deleteAppModule', + 'appModule', + { + id: args.where.id, + }, + 'DeleteAppModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "deleteAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'deleteAppModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/billingModule.ts b/sdk/constructive-react/src/modules/orm/models/billingModule.ts index cc721490cc..432eb970f3 100644 --- a/sdk/constructive-react/src/modules/orm/models/billingModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/billingModule.ts @@ -3,56 +3,96 @@ * @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 { BillingModule, BillingModuleWithRelations, BillingModuleSelect, BillingModuleFilter, BillingModuleOrderBy, CreateBillingModuleInput, UpdateBillingModuleInput, BillingModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BillingModule, + BillingModuleWithRelations, + BillingModuleSelect, + BillingModuleFilter, + BillingModuleOrderBy, + CreateBillingModuleInput, + UpdateBillingModuleInput, + BillingModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BillingModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("BillingModule", "billingModules", 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 - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BillingModule', + 'billingModules', + 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, + }, + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModules", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BillingModule", "billingModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BillingModule', + 'billingModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModule", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BillingModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingModule": data.billingModules?.nodes?.[0] ?? null - }) + billingModule: data.billingModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BillingModule", "billingModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BillingModule', + 'billingModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModule", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BillingModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingModule": data.billingModules?.nodes?.[0] ?? null - }) + billingModule: data.billingModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BillingModule", "createBillingModule", "billingModule", args.select, args.data, "CreateBillingModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BillingModule', + 'createBillingModule', + 'billingModule', + args.select, + args.data, + 'CreateBillingModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "createBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'createBillingModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BillingModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BillingModule", "updateBillingModule", "billingModule", args.select, args.where.id, args.data, "UpdateBillingModuleInput", "id", "billingModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BillingModule', + 'updateBillingModule', + 'billingModule', + args.select, + args.where.id, + args.data, + 'UpdateBillingModuleInput', + 'id', + 'billingModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "updateBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'updateBillingModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BillingModule", "deleteBillingModule", "billingModule", { - id: args.where.id - }, "DeleteBillingModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BillingModule', + 'deleteBillingModule', + 'billingModule', + { + id: args.where.id, + }, + 'DeleteBillingModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "deleteBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'deleteBillingModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/billingProviderModule.ts b/sdk/constructive-react/src/modules/orm/models/billingProviderModule.ts index a6c5d8c34c..16a8a68460 100644 --- a/sdk/constructive-react/src/modules/orm/models/billingProviderModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/billingProviderModule.ts @@ -3,56 +3,98 @@ * @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 { BillingProviderModule, BillingProviderModuleWithRelations, BillingProviderModuleSelect, BillingProviderModuleFilter, BillingProviderModuleOrderBy, CreateBillingProviderModuleInput, UpdateBillingProviderModuleInput, BillingProviderModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BillingProviderModule, + BillingProviderModuleWithRelations, + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy, + CreateBillingProviderModuleInput, + UpdateBillingProviderModuleInput, + BillingProviderModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BillingProviderModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - billingProviderModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + billingProviderModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("BillingProviderModule", "billingProviderModules", 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 - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BillingProviderModule', + 'billingProviderModules', + 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, + }, + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModules", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingProviderModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BillingProviderModule", "billingProviderModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BillingProviderModule', + 'billingProviderModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModule", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class BillingProviderModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingProviderModule": data.billingProviderModules?.nodes?.[0] ?? null - }) + billingProviderModule: data.billingProviderModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ billingProviderModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BillingProviderModule", "billingProviderModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BillingProviderModule', + 'billingProviderModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModule", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class BillingProviderModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingProviderModule": data.billingProviderModules?.nodes?.[0] ?? null - }) + billingProviderModule: data.billingProviderModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BillingProviderModule", "createBillingProviderModule", "billingProviderModule", args.select, args.data, "CreateBillingProviderModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BillingProviderModule', + 'createBillingProviderModule', + 'billingProviderModule', + args.select, + args.data, + 'CreateBillingProviderModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "createBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'createBillingProviderModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BillingProviderModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BillingProviderModule", "updateBillingProviderModule", "billingProviderModule", args.select, args.where.id, args.data, "UpdateBillingProviderModuleInput", "id", "billingProviderModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BillingProviderModule', + 'updateBillingProviderModule', + 'billingProviderModule', + args.select, + args.where.id, + args.data, + 'UpdateBillingProviderModuleInput', + 'id', + 'billingProviderModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "updateBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'updateBillingProviderModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BillingProviderModule", "deleteBillingProviderModule", "billingProviderModule", { - id: args.where.id - }, "DeleteBillingProviderModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BillingProviderModule', + 'deleteBillingProviderModule', + 'billingProviderModule', + { + id: args.where.id, + }, + 'DeleteBillingProviderModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "deleteBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'deleteBillingProviderModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/blueprint.ts b/sdk/constructive-react/src/modules/orm/models/blueprint.ts index 10b60d528d..48e4dc3d89 100644 --- a/sdk/constructive-react/src/modules/orm/models/blueprint.ts +++ b/sdk/constructive-react/src/modules/orm/models/blueprint.ts @@ -3,56 +3,96 @@ * @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 { Blueprint, BlueprintWithRelations, BlueprintSelect, BlueprintFilter, BlueprintOrderBy, CreateBlueprintInput, UpdateBlueprintInput, BlueprintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Blueprint, + BlueprintWithRelations, + BlueprintSelect, + BlueprintFilter, + BlueprintOrderBy, + CreateBlueprintInput, + UpdateBlueprintInput, + BlueprintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Blueprint", "blueprints", 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 - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Blueprint', + 'blueprints', + 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, + }, + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprints", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Blueprint", "blueprints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Blueprint', + 'blueprints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprint", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BlueprintModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprint": data.blueprints?.nodes?.[0] ?? null - }) + blueprint: data.blueprints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Blueprint", "blueprints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Blueprint', + 'blueprints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprint", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BlueprintModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprint": data.blueprints?.nodes?.[0] ?? null - }) + blueprint: data.blueprints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Blueprint", "createBlueprint", "blueprint", args.select, args.data, "CreateBlueprintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Blueprint', + 'createBlueprint', + 'blueprint', + args.select, + args.data, + 'CreateBlueprintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "createBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'createBlueprint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Blueprint", "updateBlueprint", "blueprint", args.select, args.where.id, args.data, "UpdateBlueprintInput", "id", "blueprintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Blueprint', + 'updateBlueprint', + 'blueprint', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintInput', + 'id', + 'blueprintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "updateBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'updateBlueprint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Blueprint", "deleteBlueprint", "blueprint", { - id: args.where.id - }, "DeleteBlueprintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Blueprint', + 'deleteBlueprint', + 'blueprint', + { + id: args.where.id, + }, + 'DeleteBlueprintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "deleteBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'deleteBlueprint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/blueprintConstruction.ts b/sdk/constructive-react/src/modules/orm/models/blueprintConstruction.ts index 3584463b31..ee6a157760 100644 --- a/sdk/constructive-react/src/modules/orm/models/blueprintConstruction.ts +++ b/sdk/constructive-react/src/modules/orm/models/blueprintConstruction.ts @@ -3,56 +3,98 @@ * @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 { BlueprintConstruction, BlueprintConstructionWithRelations, BlueprintConstructionSelect, BlueprintConstructionFilter, BlueprintConstructionOrderBy, CreateBlueprintConstructionInput, UpdateBlueprintConstructionInput, BlueprintConstructionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BlueprintConstruction, + BlueprintConstructionWithRelations, + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy, + CreateBlueprintConstructionInput, + UpdateBlueprintConstructionInput, + BlueprintConstructionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintConstructionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - blueprintConstructions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + blueprintConstructions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintConstruction", "blueprintConstructions", 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 - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + 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, + }, + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstructions", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstructions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintConstruction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BlueprintConstruction", "blueprintConstructions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstruction", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstruction', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class BlueprintConstructionModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintConstruction": data.blueprintConstructions?.nodes?.[0] ?? null - }) + blueprintConstruction: data.blueprintConstructions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintConstruction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintConstruction", "blueprintConstructions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstruction", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstruction', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class BlueprintConstructionModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintConstruction": data.blueprintConstructions?.nodes?.[0] ?? null - }) + blueprintConstruction: data.blueprintConstructions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BlueprintConstruction", "createBlueprintConstruction", "blueprintConstruction", args.select, args.data, "CreateBlueprintConstructionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BlueprintConstruction', + 'createBlueprintConstruction', + 'blueprintConstruction', + args.select, + args.data, + 'CreateBlueprintConstructionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "createBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'createBlueprintConstruction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintConstructionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BlueprintConstruction", "updateBlueprintConstruction", "blueprintConstruction", args.select, args.where.id, args.data, "UpdateBlueprintConstructionInput", "id", "blueprintConstructionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BlueprintConstruction', + 'updateBlueprintConstruction', + 'blueprintConstruction', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintConstructionInput', + 'id', + 'blueprintConstructionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "updateBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'updateBlueprintConstruction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BlueprintConstruction", "deleteBlueprintConstruction", "blueprintConstruction", { - id: args.where.id - }, "DeleteBlueprintConstructionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BlueprintConstruction', + 'deleteBlueprintConstruction', + 'blueprintConstruction', + { + id: args.where.id, + }, + 'DeleteBlueprintConstructionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "deleteBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'deleteBlueprintConstruction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/blueprintTemplate.ts b/sdk/constructive-react/src/modules/orm/models/blueprintTemplate.ts index 92dce7b1c4..486ef1c8e2 100644 --- a/sdk/constructive-react/src/modules/orm/models/blueprintTemplate.ts +++ b/sdk/constructive-react/src/modules/orm/models/blueprintTemplate.ts @@ -3,56 +3,96 @@ * @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 { BlueprintTemplate, BlueprintTemplateWithRelations, BlueprintTemplateSelect, BlueprintTemplateFilter, BlueprintTemplateOrderBy, CreateBlueprintTemplateInput, UpdateBlueprintTemplateInput, BlueprintTemplatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BlueprintTemplate, + BlueprintTemplateWithRelations, + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy, + CreateBlueprintTemplateInput, + UpdateBlueprintTemplateInput, + BlueprintTemplatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintTemplateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplates: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintTemplate", "blueprintTemplates", 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 - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + 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, + }, + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplates", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BlueprintTemplate", "blueprintTemplates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplate", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplate', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BlueprintTemplateModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintTemplate": data.blueprintTemplates?.nodes?.[0] ?? null - }) + blueprintTemplate: data.blueprintTemplates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintTemplate", "blueprintTemplates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplate", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplate', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BlueprintTemplateModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintTemplate": data.blueprintTemplates?.nodes?.[0] ?? null - }) + blueprintTemplate: data.blueprintTemplates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BlueprintTemplate", "createBlueprintTemplate", "blueprintTemplate", args.select, args.data, "CreateBlueprintTemplateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BlueprintTemplate', + 'createBlueprintTemplate', + 'blueprintTemplate', + args.select, + args.data, + 'CreateBlueprintTemplateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "createBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'createBlueprintTemplate', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintTemplatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BlueprintTemplate", "updateBlueprintTemplate", "blueprintTemplate", args.select, args.where.id, args.data, "UpdateBlueprintTemplateInput", "id", "blueprintTemplatePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BlueprintTemplate', + 'updateBlueprintTemplate', + 'blueprintTemplate', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintTemplateInput', + 'id', + 'blueprintTemplatePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "updateBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'updateBlueprintTemplate', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BlueprintTemplate", "deleteBlueprintTemplate", "blueprintTemplate", { - id: args.where.id - }, "DeleteBlueprintTemplateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BlueprintTemplate', + 'deleteBlueprintTemplate', + 'blueprintTemplate', + { + id: args.where.id, + }, + 'DeleteBlueprintTemplateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "deleteBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'deleteBlueprintTemplate', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/catalogModule.ts b/sdk/constructive-react/src/modules/orm/models/catalogModule.ts index 731c29804e..f03b06347e 100644 --- a/sdk/constructive-react/src/modules/orm/models/catalogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/catalogModule.ts @@ -3,56 +3,96 @@ * @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 { CatalogModule, CatalogModuleWithRelations, CatalogModuleSelect, CatalogModuleFilter, CatalogModuleOrderBy, CreateCatalogModuleInput, UpdateCatalogModuleInput, CatalogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CatalogModule, + CatalogModuleWithRelations, + CatalogModuleSelect, + CatalogModuleFilter, + CatalogModuleOrderBy, + CreateCatalogModuleInput, + UpdateCatalogModuleInput, + CatalogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CatalogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CatalogModule", "catalogModules", 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 - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CatalogModule', + 'catalogModules', + 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, + }, + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModules", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CatalogModule", "catalogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CatalogModule', + 'catalogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModule", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CatalogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "catalogModule": data.catalogModules?.nodes?.[0] ?? null - }) + catalogModule: data.catalogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CatalogModule", "catalogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CatalogModule', + 'catalogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModule", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CatalogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "catalogModule": data.catalogModules?.nodes?.[0] ?? null - }) + catalogModule: data.catalogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CatalogModule", "createCatalogModule", "catalogModule", args.select, args.data, "CreateCatalogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CatalogModule', + 'createCatalogModule', + 'catalogModule', + args.select, + args.data, + 'CreateCatalogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "createCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'createCatalogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CatalogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CatalogModule", "updateCatalogModule", "catalogModule", args.select, args.where.id, args.data, "UpdateCatalogModuleInput", "id", "catalogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CatalogModule', + 'updateCatalogModule', + 'catalogModule', + args.select, + args.where.id, + args.data, + 'UpdateCatalogModuleInput', + 'id', + 'catalogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "updateCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'updateCatalogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CatalogModule", "deleteCatalogModule", "catalogModule", { - id: args.where.id - }, "DeleteCatalogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CatalogModule', + 'deleteCatalogModule', + 'catalogModule', + { + id: args.where.id, + }, + 'DeleteCatalogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "deleteCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'deleteCatalogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/computeLogModule.ts b/sdk/constructive-react/src/modules/orm/models/computeLogModule.ts index 042debf2b4..3451b45608 100644 --- a/sdk/constructive-react/src/modules/orm/models/computeLogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/computeLogModule.ts @@ -3,56 +3,96 @@ * @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 { ComputeLogModule, ComputeLogModuleWithRelations, ComputeLogModuleSelect, ComputeLogModuleFilter, ComputeLogModuleOrderBy, CreateComputeLogModuleInput, UpdateComputeLogModuleInput, ComputeLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ComputeLogModule, + ComputeLogModuleWithRelations, + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy, + CreateComputeLogModuleInput, + UpdateComputeLogModuleInput, + ComputeLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ComputeLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ComputeLogModule", "computeLogModules", 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 - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ComputeLogModule', + 'computeLogModules', + 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, + }, + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModules", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ComputeLogModule", "computeLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ComputeLogModule', + 'computeLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModule", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ComputeLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "computeLogModule": data.computeLogModules?.nodes?.[0] ?? null - }) + computeLogModule: data.computeLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ComputeLogModule", "computeLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ComputeLogModule', + 'computeLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModule", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ComputeLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "computeLogModule": data.computeLogModules?.nodes?.[0] ?? null - }) + computeLogModule: data.computeLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ComputeLogModule", "createComputeLogModule", "computeLogModule", args.select, args.data, "CreateComputeLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ComputeLogModule', + 'createComputeLogModule', + 'computeLogModule', + args.select, + args.data, + 'CreateComputeLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "createComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'createComputeLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ComputeLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ComputeLogModule", "updateComputeLogModule", "computeLogModule", args.select, args.where.id, args.data, "UpdateComputeLogModuleInput", "id", "computeLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ComputeLogModule', + 'updateComputeLogModule', + 'computeLogModule', + args.select, + args.where.id, + args.data, + 'UpdateComputeLogModuleInput', + 'id', + 'computeLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "updateComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'updateComputeLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ComputeLogModule", "deleteComputeLogModule", "computeLogModule", { - id: args.where.id - }, "DeleteComputeLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ComputeLogModule', + 'deleteComputeLogModule', + 'computeLogModule', + { + id: args.where.id, + }, + 'DeleteComputeLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "deleteComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'deleteComputeLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/configSecretsUserModule.ts b/sdk/constructive-react/src/modules/orm/models/configSecretsUserModule.ts index a910033dff..bd97e5bf01 100644 --- a/sdk/constructive-react/src/modules/orm/models/configSecretsUserModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/configSecretsUserModule.ts @@ -3,56 +3,98 @@ * @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 { ConfigSecretsUserModule, ConfigSecretsUserModuleWithRelations, ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleFilter, ConfigSecretsUserModuleOrderBy, CreateConfigSecretsUserModuleInput, UpdateConfigSecretsUserModuleInput, ConfigSecretsUserModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ConfigSecretsUserModule, + ConfigSecretsUserModuleWithRelations, + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy, + CreateConfigSecretsUserModuleInput, + UpdateConfigSecretsUserModuleInput, + ConfigSecretsUserModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConfigSecretsUserModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - configSecretsUserModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + configSecretsUserModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ConfigSecretsUserModule", "configSecretsUserModules", 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 - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + 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, + }, + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModules", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ configSecretsUserModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ConfigSecretsUserModule", "configSecretsUserModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModule", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ConfigSecretsUserModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "configSecretsUserModule": data.configSecretsUserModules?.nodes?.[0] ?? null - }) + configSecretsUserModule: data.configSecretsUserModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ configSecretsUserModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ConfigSecretsUserModule", "configSecretsUserModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModule", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ConfigSecretsUserModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "configSecretsUserModule": data.configSecretsUserModules?.nodes?.[0] ?? null - }) + configSecretsUserModule: data.configSecretsUserModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ConfigSecretsUserModule", "createConfigSecretsUserModule", "configSecretsUserModule", args.select, args.data, "CreateConfigSecretsUserModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ConfigSecretsUserModule', + 'createConfigSecretsUserModule', + 'configSecretsUserModule', + args.select, + args.data, + 'CreateConfigSecretsUserModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "createConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'createConfigSecretsUserModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConfigSecretsUserModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ConfigSecretsUserModule", "updateConfigSecretsUserModule", "configSecretsUserModule", args.select, args.where.id, args.data, "UpdateConfigSecretsUserModuleInput", "id", "configSecretsUserModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ConfigSecretsUserModule', + 'updateConfigSecretsUserModule', + 'configSecretsUserModule', + args.select, + args.where.id, + args.data, + 'UpdateConfigSecretsUserModuleInput', + 'id', + 'configSecretsUserModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "updateConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'updateConfigSecretsUserModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ConfigSecretsUserModule", "deleteConfigSecretsUserModule", "configSecretsUserModule", { - id: args.where.id - }, "DeleteConfigSecretsUserModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ConfigSecretsUserModule', + 'deleteConfigSecretsUserModule', + 'configSecretsUserModule', + { + id: args.where.id, + }, + 'DeleteConfigSecretsUserModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "deleteConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'deleteConfigSecretsUserModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/connectedAccountsModule.ts b/sdk/constructive-react/src/modules/orm/models/connectedAccountsModule.ts index 7b725c2754..64b1dc5c4c 100644 --- a/sdk/constructive-react/src/modules/orm/models/connectedAccountsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/connectedAccountsModule.ts @@ -3,56 +3,98 @@ * @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 { ConnectedAccountsModule, ConnectedAccountsModuleWithRelations, ConnectedAccountsModuleSelect, ConnectedAccountsModuleFilter, ConnectedAccountsModuleOrderBy, CreateConnectedAccountsModuleInput, UpdateConnectedAccountsModuleInput, ConnectedAccountsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ConnectedAccountsModule, + ConnectedAccountsModuleWithRelations, + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy, + CreateConnectedAccountsModuleInput, + UpdateConnectedAccountsModuleInput, + ConnectedAccountsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConnectedAccountsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - connectedAccountsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + connectedAccountsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ConnectedAccountsModule", "connectedAccountsModules", 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 - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + 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, + }, + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModules", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ connectedAccountsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ConnectedAccountsModule", "connectedAccountsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModule", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ConnectedAccountsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "connectedAccountsModule": data.connectedAccountsModules?.nodes?.[0] ?? null - }) + connectedAccountsModule: data.connectedAccountsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ connectedAccountsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ConnectedAccountsModule", "connectedAccountsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModule", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ConnectedAccountsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "connectedAccountsModule": data.connectedAccountsModules?.nodes?.[0] ?? null - }) + connectedAccountsModule: data.connectedAccountsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ConnectedAccountsModule", "createConnectedAccountsModule", "connectedAccountsModule", args.select, args.data, "CreateConnectedAccountsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ConnectedAccountsModule', + 'createConnectedAccountsModule', + 'connectedAccountsModule', + args.select, + args.data, + 'CreateConnectedAccountsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "createConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'createConnectedAccountsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConnectedAccountsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ConnectedAccountsModule", "updateConnectedAccountsModule", "connectedAccountsModule", args.select, args.where.id, args.data, "UpdateConnectedAccountsModuleInput", "id", "connectedAccountsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ConnectedAccountsModule', + 'updateConnectedAccountsModule', + 'connectedAccountsModule', + args.select, + args.where.id, + args.data, + 'UpdateConnectedAccountsModuleInput', + 'id', + 'connectedAccountsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "updateConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'updateConnectedAccountsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ConnectedAccountsModule", "deleteConnectedAccountsModule", "connectedAccountsModule", { - id: args.where.id - }, "DeleteConnectedAccountsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ConnectedAccountsModule', + 'deleteConnectedAccountsModule', + 'connectedAccountsModule', + { + id: args.where.id, + }, + 'DeleteConnectedAccountsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "deleteConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'deleteConnectedAccountsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/cryptoAddressesModule.ts b/sdk/constructive-react/src/modules/orm/models/cryptoAddressesModule.ts index 28b923a35e..c7797726bf 100644 --- a/sdk/constructive-react/src/modules/orm/models/cryptoAddressesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/cryptoAddressesModule.ts @@ -3,56 +3,98 @@ * @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 { CryptoAddressesModule, CryptoAddressesModuleWithRelations, CryptoAddressesModuleSelect, CryptoAddressesModuleFilter, CryptoAddressesModuleOrderBy, CreateCryptoAddressesModuleInput, UpdateCryptoAddressesModuleInput, CryptoAddressesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAddressesModule, + CryptoAddressesModuleWithRelations, + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy, + CreateCryptoAddressesModuleInput, + UpdateCryptoAddressesModuleInput, + CryptoAddressesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAddressesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - cryptoAddressesModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + cryptoAddressesModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddressesModule", "cryptoAddressesModules", 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 - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + 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, + }, + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModules", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddressesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAddressesModule", "cryptoAddressesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModule", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class CryptoAddressesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddressesModule": data.cryptoAddressesModules?.nodes?.[0] ?? null - }) + cryptoAddressesModule: data.cryptoAddressesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddressesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddressesModule", "cryptoAddressesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModule", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class CryptoAddressesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddressesModule": data.cryptoAddressesModules?.nodes?.[0] ?? null - }) + cryptoAddressesModule: data.cryptoAddressesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAddressesModule", "createCryptoAddressesModule", "cryptoAddressesModule", args.select, args.data, "CreateCryptoAddressesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAddressesModule', + 'createCryptoAddressesModule', + 'cryptoAddressesModule', + args.select, + args.data, + 'CreateCryptoAddressesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "createCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'createCryptoAddressesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAddressesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAddressesModule", "updateCryptoAddressesModule", "cryptoAddressesModule", args.select, args.where.id, args.data, "UpdateCryptoAddressesModuleInput", "id", "cryptoAddressesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAddressesModule', + 'updateCryptoAddressesModule', + 'cryptoAddressesModule', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAddressesModuleInput', + 'id', + 'cryptoAddressesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "updateCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'updateCryptoAddressesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAddressesModule", "deleteCryptoAddressesModule", "cryptoAddressesModule", { - id: args.where.id - }, "DeleteCryptoAddressesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAddressesModule', + 'deleteCryptoAddressesModule', + 'cryptoAddressesModule', + { + id: args.where.id, + }, + 'DeleteCryptoAddressesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "deleteCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'deleteCryptoAddressesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/cryptoAuthModule.ts b/sdk/constructive-react/src/modules/orm/models/cryptoAuthModule.ts index b2bf531ab9..d975e75267 100644 --- a/sdk/constructive-react/src/modules/orm/models/cryptoAuthModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/cryptoAuthModule.ts @@ -3,56 +3,96 @@ * @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 { CryptoAuthModule, CryptoAuthModuleWithRelations, CryptoAuthModuleSelect, CryptoAuthModuleFilter, CryptoAuthModuleOrderBy, CreateCryptoAuthModuleInput, UpdateCryptoAuthModuleInput, CryptoAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAuthModule, + CryptoAuthModuleWithRelations, + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy, + CreateCryptoAuthModuleInput, + UpdateCryptoAuthModuleInput, + CryptoAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAuthModule", "cryptoAuthModules", 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 - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + 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, + }, + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModules", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAuthModule", "cryptoAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModule", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CryptoAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAuthModule": data.cryptoAuthModules?.nodes?.[0] ?? null - }) + cryptoAuthModule: data.cryptoAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAuthModule", "cryptoAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModule", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CryptoAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAuthModule": data.cryptoAuthModules?.nodes?.[0] ?? null - }) + cryptoAuthModule: data.cryptoAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAuthModule", "createCryptoAuthModule", "cryptoAuthModule", args.select, args.data, "CreateCryptoAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAuthModule', + 'createCryptoAuthModule', + 'cryptoAuthModule', + args.select, + args.data, + 'CreateCryptoAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "createCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'createCryptoAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAuthModule", "updateCryptoAuthModule", "cryptoAuthModule", args.select, args.where.id, args.data, "UpdateCryptoAuthModuleInput", "id", "cryptoAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAuthModule', + 'updateCryptoAuthModule', + 'cryptoAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAuthModuleInput', + 'id', + 'cryptoAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "updateCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'updateCryptoAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAuthModule", "deleteCryptoAuthModule", "cryptoAuthModule", { - id: args.where.id - }, "DeleteCryptoAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAuthModule', + 'deleteCryptoAuthModule', + 'cryptoAuthModule', + { + id: args.where.id, + }, + 'DeleteCryptoAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "deleteCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'deleteCryptoAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/databaseProvisionModule.ts b/sdk/constructive-react/src/modules/orm/models/databaseProvisionModule.ts index dbfd38d4f7..1d9457eed6 100644 --- a/sdk/constructive-react/src/modules/orm/models/databaseProvisionModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/databaseProvisionModule.ts @@ -3,56 +3,98 @@ * @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 { DatabaseProvisionModule, DatabaseProvisionModuleWithRelations, DatabaseProvisionModuleSelect, DatabaseProvisionModuleFilter, DatabaseProvisionModuleOrderBy, CreateDatabaseProvisionModuleInput, UpdateDatabaseProvisionModuleInput, DatabaseProvisionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseProvisionModule, + DatabaseProvisionModuleWithRelations, + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy, + CreateDatabaseProvisionModuleInput, + UpdateDatabaseProvisionModuleInput, + DatabaseProvisionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseProvisionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - databaseProvisionModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + databaseProvisionModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseProvisionModule", "databaseProvisionModules", 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 - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + 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, + }, + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModules", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseProvisionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseProvisionModule", "databaseProvisionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModule", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DatabaseProvisionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseProvisionModule": data.databaseProvisionModules?.nodes?.[0] ?? null - }) + databaseProvisionModule: data.databaseProvisionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseProvisionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseProvisionModule", "databaseProvisionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModule", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DatabaseProvisionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseProvisionModule": data.databaseProvisionModules?.nodes?.[0] ?? null - }) + databaseProvisionModule: data.databaseProvisionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseProvisionModule", "createDatabaseProvisionModule", "databaseProvisionModule", args.select, args.data, "CreateDatabaseProvisionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseProvisionModule', + 'createDatabaseProvisionModule', + 'databaseProvisionModule', + args.select, + args.data, + 'CreateDatabaseProvisionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "createDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'createDatabaseProvisionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseProvisionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseProvisionModule", "updateDatabaseProvisionModule", "databaseProvisionModule", args.select, args.where.id, args.data, "UpdateDatabaseProvisionModuleInput", "id", "databaseProvisionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseProvisionModule', + 'updateDatabaseProvisionModule', + 'databaseProvisionModule', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseProvisionModuleInput', + 'id', + 'databaseProvisionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "updateDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'updateDatabaseProvisionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseProvisionModule", "deleteDatabaseProvisionModule", "databaseProvisionModule", { - id: args.where.id - }, "DeleteDatabaseProvisionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseProvisionModule', + 'deleteDatabaseProvisionModule', + 'databaseProvisionModule', + { + id: args.where.id, + }, + 'DeleteDatabaseProvisionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "deleteDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'deleteDatabaseProvisionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/databaseSettingsModule.ts b/sdk/constructive-react/src/modules/orm/models/databaseSettingsModule.ts index 477e77aa01..14e7f06eae 100644 --- a/sdk/constructive-react/src/modules/orm/models/databaseSettingsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/databaseSettingsModule.ts @@ -3,56 +3,98 @@ * @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 { DatabaseSettingsModule, DatabaseSettingsModuleWithRelations, DatabaseSettingsModuleSelect, DatabaseSettingsModuleFilter, DatabaseSettingsModuleOrderBy, CreateDatabaseSettingsModuleInput, UpdateDatabaseSettingsModuleInput, DatabaseSettingsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseSettingsModule, + DatabaseSettingsModuleWithRelations, + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy, + CreateDatabaseSettingsModuleInput, + UpdateDatabaseSettingsModuleInput, + DatabaseSettingsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseSettingsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - databaseSettingsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + databaseSettingsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSettingsModule", "databaseSettingsModules", 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 - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + 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, + }, + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModules", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseSettingsModule", "databaseSettingsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModule", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DatabaseSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSettingsModule": data.databaseSettingsModules?.nodes?.[0] ?? null - }) + databaseSettingsModule: data.databaseSettingsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSettingsModule", "databaseSettingsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModule", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DatabaseSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSettingsModule": data.databaseSettingsModules?.nodes?.[0] ?? null - }) + databaseSettingsModule: data.databaseSettingsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseSettingsModule", "createDatabaseSettingsModule", "databaseSettingsModule", args.select, args.data, "CreateDatabaseSettingsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseSettingsModule', + 'createDatabaseSettingsModule', + 'databaseSettingsModule', + args.select, + args.data, + 'CreateDatabaseSettingsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "createDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'createDatabaseSettingsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseSettingsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseSettingsModule", "updateDatabaseSettingsModule", "databaseSettingsModule", args.select, args.where.id, args.data, "UpdateDatabaseSettingsModuleInput", "id", "databaseSettingsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseSettingsModule', + 'updateDatabaseSettingsModule', + 'databaseSettingsModule', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseSettingsModuleInput', + 'id', + 'databaseSettingsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "updateDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'updateDatabaseSettingsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseSettingsModule", "deleteDatabaseSettingsModule", "databaseSettingsModule", { - id: args.where.id - }, "DeleteDatabaseSettingsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseSettingsModule', + 'deleteDatabaseSettingsModule', + 'databaseSettingsModule', + { + id: args.where.id, + }, + 'DeleteDatabaseSettingsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "deleteDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'deleteDatabaseSettingsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/dbPool.ts b/sdk/constructive-react/src/modules/orm/models/dbPool.ts index 07b4f67e30..32e26fe980 100644 --- a/sdk/constructive-react/src/modules/orm/models/dbPool.ts +++ b/sdk/constructive-react/src/modules/orm/models/dbPool.ts @@ -3,56 +3,96 @@ * @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 { DbPool, DbPoolWithRelations, DbPoolSelect, DbPoolFilter, DbPoolOrderBy, CreateDbPoolInput, UpdateDbPoolInput, DbPoolPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPool, + DbPoolWithRelations, + DbPoolSelect, + DbPoolFilter, + DbPoolOrderBy, + CreateDbPoolInput, + UpdateDbPoolInput, + DbPoolPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPoolModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPools: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPool", "dbPools", 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 - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPool', + 'dbPools', + 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, + }, + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPools", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPools', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPool: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPool", "dbPools", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPool', + 'dbPools', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPool", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPool', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPoolModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPool": data.dbPools?.nodes?.[0] ?? null - }) + dbPool: data.dbPools?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPool: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPool", "dbPools", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPool', + 'dbPools', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPool", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPool', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPoolModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPool": data.dbPools?.nodes?.[0] ?? null - }) + dbPool: data.dbPools?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPool", "createDbPool", "dbPool", args.select, args.data, "CreateDbPoolInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPool', + 'createDbPool', + 'dbPool', + args.select, + args.data, + 'CreateDbPoolInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "createDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'createDbPool', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPoolPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPool", "updateDbPool", "dbPool", args.select, args.where.id, args.data, "UpdateDbPoolInput", "id", "dbPoolPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPool', + 'updateDbPool', + 'dbPool', + args.select, + args.where.id, + args.data, + 'UpdateDbPoolInput', + 'id', + 'dbPoolPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "updateDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'updateDbPool', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPool", "deleteDbPool", "dbPool", { - id: args.where.id - }, "DeleteDbPoolInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPool', + 'deleteDbPool', + 'dbPool', + { + id: args.where.id, + }, + 'DeleteDbPoolInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "deleteDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'deleteDbPool', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/dbPoolConfig.ts b/sdk/constructive-react/src/modules/orm/models/dbPoolConfig.ts index 37a3c62ff5..df67dbab50 100644 --- a/sdk/constructive-react/src/modules/orm/models/dbPoolConfig.ts +++ b/sdk/constructive-react/src/modules/orm/models/dbPoolConfig.ts @@ -3,56 +3,96 @@ * @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 { DbPoolConfig, DbPoolConfigWithRelations, DbPoolConfigSelect, DbPoolConfigFilter, DbPoolConfigOrderBy, CreateDbPoolConfigInput, UpdateDbPoolConfigInput, DbPoolConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPoolConfig, + DbPoolConfigWithRelations, + DbPoolConfigSelect, + DbPoolConfigFilter, + DbPoolConfigOrderBy, + CreateDbPoolConfigInput, + UpdateDbPoolConfigInput, + DbPoolConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPoolConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfigs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPoolConfig", "dbPoolConfigs", 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 - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + 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, + }, + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfigs", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfigs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPoolConfig", "dbPoolConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfig", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfig', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPoolConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPoolConfig": data.dbPoolConfigs?.nodes?.[0] ?? null - }) + dbPoolConfig: data.dbPoolConfigs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPoolConfig", "dbPoolConfigs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfig", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfig', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPoolConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPoolConfig": data.dbPoolConfigs?.nodes?.[0] ?? null - }) + dbPoolConfig: data.dbPoolConfigs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPoolConfig", "createDbPoolConfig", "dbPoolConfig", args.select, args.data, "CreateDbPoolConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPoolConfig', + 'createDbPoolConfig', + 'dbPoolConfig', + args.select, + args.data, + 'CreateDbPoolConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "createDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'createDbPoolConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPoolConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPoolConfig", "updateDbPoolConfig", "dbPoolConfig", args.select, args.where.id, args.data, "UpdateDbPoolConfigInput", "id", "dbPoolConfigPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPoolConfig', + 'updateDbPoolConfig', + 'dbPoolConfig', + args.select, + args.where.id, + args.data, + 'UpdateDbPoolConfigInput', + 'id', + 'dbPoolConfigPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "updateDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'updateDbPoolConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPoolConfig", "deleteDbPoolConfig", "dbPoolConfig", { - id: args.where.id - }, "DeleteDbPoolConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPoolConfig', + 'deleteDbPoolConfig', + 'dbPoolConfig', + { + id: args.where.id, + }, + 'DeleteDbPoolConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "deleteDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'deleteDbPoolConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/dbPresetModule.ts b/sdk/constructive-react/src/modules/orm/models/dbPresetModule.ts index 1a2d12ef9c..e787354cf8 100644 --- a/sdk/constructive-react/src/modules/orm/models/dbPresetModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/dbPresetModule.ts @@ -3,56 +3,96 @@ * @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 { DbPresetModule, DbPresetModuleWithRelations, DbPresetModuleSelect, DbPresetModuleFilter, DbPresetModuleOrderBy, CreateDbPresetModuleInput, UpdateDbPresetModuleInput, DbPresetModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPresetModule, + DbPresetModuleWithRelations, + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy, + CreateDbPresetModuleInput, + UpdateDbPresetModuleInput, + DbPresetModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPresetModule", "dbPresetModules", 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 - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPresetModule', + 'dbPresetModules', + 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, + }, + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModules", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPresetModule", "dbPresetModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPresetModule', + 'dbPresetModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModule", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPresetModule": data.dbPresetModules?.nodes?.[0] ?? null - }) + dbPresetModule: data.dbPresetModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPresetModule", "dbPresetModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPresetModule', + 'dbPresetModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModule", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPresetModule": data.dbPresetModules?.nodes?.[0] ?? null - }) + dbPresetModule: data.dbPresetModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPresetModule", "createDbPresetModule", "dbPresetModule", args.select, args.data, "CreateDbPresetModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPresetModule', + 'createDbPresetModule', + 'dbPresetModule', + args.select, + args.data, + 'CreateDbPresetModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "createDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'createDbPresetModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPresetModule", "updateDbPresetModule", "dbPresetModule", args.select, args.where.id, args.data, "UpdateDbPresetModuleInput", "id", "dbPresetModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPresetModule', + 'updateDbPresetModule', + 'dbPresetModule', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetModuleInput', + 'id', + 'dbPresetModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "updateDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'updateDbPresetModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPresetModule", "deleteDbPresetModule", "dbPresetModule", { - id: args.where.id - }, "DeleteDbPresetModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPresetModule', + 'deleteDbPresetModule', + 'dbPresetModule', + { + id: args.where.id, + }, + 'DeleteDbPresetModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "deleteDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'deleteDbPresetModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/dbUsageModule.ts b/sdk/constructive-react/src/modules/orm/models/dbUsageModule.ts index 70423a1d03..45fc6b2a64 100644 --- a/sdk/constructive-react/src/modules/orm/models/dbUsageModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/dbUsageModule.ts @@ -3,56 +3,96 @@ * @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 { DbUsageModule, DbUsageModuleWithRelations, DbUsageModuleSelect, DbUsageModuleFilter, DbUsageModuleOrderBy, CreateDbUsageModuleInput, UpdateDbUsageModuleInput, DbUsageModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbUsageModule, + DbUsageModuleWithRelations, + DbUsageModuleSelect, + DbUsageModuleFilter, + DbUsageModuleOrderBy, + CreateDbUsageModuleInput, + UpdateDbUsageModuleInput, + DbUsageModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbUsageModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbUsageModule", "dbUsageModules", 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 - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbUsageModule', + 'dbUsageModules', + 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, + }, + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModules", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbUsageModule", "dbUsageModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbUsageModule', + 'dbUsageModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModule", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbUsageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbUsageModule": data.dbUsageModules?.nodes?.[0] ?? null - }) + dbUsageModule: data.dbUsageModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbUsageModule", "dbUsageModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbUsageModule', + 'dbUsageModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModule", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbUsageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbUsageModule": data.dbUsageModules?.nodes?.[0] ?? null - }) + dbUsageModule: data.dbUsageModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbUsageModule", "createDbUsageModule", "dbUsageModule", args.select, args.data, "CreateDbUsageModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbUsageModule', + 'createDbUsageModule', + 'dbUsageModule', + args.select, + args.data, + 'CreateDbUsageModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "createDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'createDbUsageModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbUsageModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbUsageModule", "updateDbUsageModule", "dbUsageModule", args.select, args.where.id, args.data, "UpdateDbUsageModuleInput", "id", "dbUsageModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbUsageModule', + 'updateDbUsageModule', + 'dbUsageModule', + args.select, + args.where.id, + args.data, + 'UpdateDbUsageModuleInput', + 'id', + 'dbUsageModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "updateDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'updateDbUsageModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbUsageModule", "deleteDbUsageModule", "dbUsageModule", { - id: args.where.id - }, "DeleteDbUsageModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbUsageModule', + 'deleteDbUsageModule', + 'dbUsageModule', + { + id: args.where.id, + }, + 'DeleteDbUsageModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "deleteDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'deleteDbUsageModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/defaultIdsModule.ts b/sdk/constructive-react/src/modules/orm/models/defaultIdsModule.ts index 92143e9800..957d0061e4 100644 --- a/sdk/constructive-react/src/modules/orm/models/defaultIdsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/defaultIdsModule.ts @@ -3,56 +3,96 @@ * @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 { DefaultIdsModule, DefaultIdsModuleWithRelations, DefaultIdsModuleSelect, DefaultIdsModuleFilter, DefaultIdsModuleOrderBy, CreateDefaultIdsModuleInput, UpdateDefaultIdsModuleInput, DefaultIdsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DefaultIdsModule, + DefaultIdsModuleWithRelations, + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy, + CreateDefaultIdsModuleInput, + UpdateDefaultIdsModuleInput, + DefaultIdsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DefaultIdsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultIdsModule", "defaultIdsModules", 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 - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + 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, + }, + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModules", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DefaultIdsModule", "defaultIdsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModule", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DefaultIdsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultIdsModule": data.defaultIdsModules?.nodes?.[0] ?? null - }) + defaultIdsModule: data.defaultIdsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultIdsModule", "defaultIdsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModule", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DefaultIdsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultIdsModule": data.defaultIdsModules?.nodes?.[0] ?? null - }) + defaultIdsModule: data.defaultIdsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DefaultIdsModule", "createDefaultIdsModule", "defaultIdsModule", args.select, args.data, "CreateDefaultIdsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DefaultIdsModule', + 'createDefaultIdsModule', + 'defaultIdsModule', + args.select, + args.data, + 'CreateDefaultIdsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "createDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'createDefaultIdsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DefaultIdsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DefaultIdsModule", "updateDefaultIdsModule", "defaultIdsModule", args.select, args.where.id, args.data, "UpdateDefaultIdsModuleInput", "id", "defaultIdsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DefaultIdsModule', + 'updateDefaultIdsModule', + 'defaultIdsModule', + args.select, + args.where.id, + args.data, + 'UpdateDefaultIdsModuleInput', + 'id', + 'defaultIdsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "updateDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'updateDefaultIdsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DefaultIdsModule", "deleteDefaultIdsModule", "defaultIdsModule", { - id: args.where.id - }, "DeleteDefaultIdsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DefaultIdsModule', + 'deleteDefaultIdsModule', + 'defaultIdsModule', + { + id: args.where.id, + }, + 'DeleteDefaultIdsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "deleteDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'deleteDefaultIdsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/denormalizedTableField.ts b/sdk/constructive-react/src/modules/orm/models/denormalizedTableField.ts index 2f529dcb80..bdc83099a2 100644 --- a/sdk/constructive-react/src/modules/orm/models/denormalizedTableField.ts +++ b/sdk/constructive-react/src/modules/orm/models/denormalizedTableField.ts @@ -3,56 +3,98 @@ * @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 { DenormalizedTableField, DenormalizedTableFieldWithRelations, DenormalizedTableFieldSelect, DenormalizedTableFieldFilter, DenormalizedTableFieldOrderBy, CreateDenormalizedTableFieldInput, UpdateDenormalizedTableFieldInput, DenormalizedTableFieldPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DenormalizedTableField, + DenormalizedTableFieldWithRelations, + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy, + CreateDenormalizedTableFieldInput, + UpdateDenormalizedTableFieldInput, + DenormalizedTableFieldPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DenormalizedTableFieldModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - denormalizedTableFields: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + denormalizedTableFields: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DenormalizedTableField", "denormalizedTableFields", 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 - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + 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, + }, + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableFields", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableFields', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ denormalizedTableField: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DenormalizedTableField", "denormalizedTableFields", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableField", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableField', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DenormalizedTableFieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "denormalizedTableField": data.denormalizedTableFields?.nodes?.[0] ?? null - }) + denormalizedTableField: data.denormalizedTableFields?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ denormalizedTableField: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DenormalizedTableField", "denormalizedTableFields", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableField", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableField', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DenormalizedTableFieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "denormalizedTableField": data.denormalizedTableFields?.nodes?.[0] ?? null - }) + denormalizedTableField: data.denormalizedTableFields?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DenormalizedTableField", "createDenormalizedTableField", "denormalizedTableField", args.select, args.data, "CreateDenormalizedTableFieldInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DenormalizedTableField', + 'createDenormalizedTableField', + 'denormalizedTableField', + args.select, + args.data, + 'CreateDenormalizedTableFieldInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "createDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'createDenormalizedTableField', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DenormalizedTableFieldPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DenormalizedTableField", "updateDenormalizedTableField", "denormalizedTableField", args.select, args.where.id, args.data, "UpdateDenormalizedTableFieldInput", "id", "denormalizedTableFieldPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DenormalizedTableField', + 'updateDenormalizedTableField', + 'denormalizedTableField', + args.select, + args.where.id, + args.data, + 'UpdateDenormalizedTableFieldInput', + 'id', + 'denormalizedTableFieldPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "updateDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'updateDenormalizedTableField', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DenormalizedTableField", "deleteDenormalizedTableField", "denormalizedTableField", { - id: args.where.id - }, "DeleteDenormalizedTableFieldInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DenormalizedTableField', + 'deleteDenormalizedTableField', + 'denormalizedTableField', + { + id: args.where.id, + }, + 'DeleteDenormalizedTableFieldInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "deleteDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'deleteDenormalizedTableField', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/devicesModule.ts b/sdk/constructive-react/src/modules/orm/models/devicesModule.ts index 532e5e6598..8dc6cf5282 100644 --- a/sdk/constructive-react/src/modules/orm/models/devicesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/devicesModule.ts @@ -3,56 +3,96 @@ * @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 { DevicesModule, DevicesModuleWithRelations, DevicesModuleSelect, DevicesModuleFilter, DevicesModuleOrderBy, CreateDevicesModuleInput, UpdateDevicesModuleInput, DevicesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DevicesModule, + DevicesModuleWithRelations, + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy, + CreateDevicesModuleInput, + UpdateDevicesModuleInput, + DevicesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DevicesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DevicesModule", "devicesModules", 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 - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + 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, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModules", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DevicesModule", "devicesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModule", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DevicesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "devicesModule": data.devicesModules?.nodes?.[0] ?? null - }) + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DevicesModule", "devicesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModule", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DevicesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "devicesModule": data.devicesModules?.nodes?.[0] ?? null - }) + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DevicesModule", "createDevicesModule", "devicesModule", args.select, args.data, "CreateDevicesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DevicesModule', + 'createDevicesModule', + 'devicesModule', + args.select, + args.data, + 'CreateDevicesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "createDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'createDevicesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DevicesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DevicesModule", "updateDevicesModule", "devicesModule", args.select, args.where.id, args.data, "UpdateDevicesModuleInput", "id", "devicesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DevicesModule', + 'updateDevicesModule', + 'devicesModule', + args.select, + args.where.id, + args.data, + 'UpdateDevicesModuleInput', + 'id', + 'devicesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "updateDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'updateDevicesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DevicesModule", "deleteDevicesModule", "devicesModule", { - id: args.where.id - }, "DeleteDevicesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DevicesModule', + 'deleteDevicesModule', + 'devicesModule', + { + id: args.where.id, + }, + 'DeleteDevicesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "deleteDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'deleteDevicesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/domainModule.ts b/sdk/constructive-react/src/modules/orm/models/domainModule.ts index a8f1588a9c..fd1f536225 100644 --- a/sdk/constructive-react/src/modules/orm/models/domainModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/domainModule.ts @@ -3,56 +3,96 @@ * @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 { DomainModule, DomainModuleWithRelations, DomainModuleSelect, DomainModuleFilter, DomainModuleOrderBy, CreateDomainModuleInput, UpdateDomainModuleInput, DomainModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainModule, + DomainModuleWithRelations, + DomainModuleSelect, + DomainModuleFilter, + DomainModuleOrderBy, + CreateDomainModuleInput, + UpdateDomainModuleInput, + DomainModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainModule", "domainModules", 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 - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainModule', + 'domainModules', + 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, + }, + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModules", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainModule", "domainModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainModule', + 'domainModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModule", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainModule": data.domainModules?.nodes?.[0] ?? null - }) + domainModule: data.domainModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainModule", "domainModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainModule', + 'domainModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModule", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainModule": data.domainModules?.nodes?.[0] ?? null - }) + domainModule: data.domainModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainModule", "createDomainModule", "domainModule", args.select, args.data, "CreateDomainModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainModule', + 'createDomainModule', + 'domainModule', + args.select, + args.data, + 'CreateDomainModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "createDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'createDomainModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainModule", "updateDomainModule", "domainModule", args.select, args.where.id, args.data, "UpdateDomainModuleInput", "id", "domainModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainModule', + 'updateDomainModule', + 'domainModule', + args.select, + args.where.id, + args.data, + 'UpdateDomainModuleInput', + 'id', + 'domainModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "updateDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'updateDomainModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainModule", "deleteDomainModule", "domainModule", { - id: args.where.id - }, "DeleteDomainModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainModule', + 'deleteDomainModule', + 'domainModule', + { + id: args.where.id, + }, + 'DeleteDomainModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "deleteDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'deleteDomainModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/emailsModule.ts b/sdk/constructive-react/src/modules/orm/models/emailsModule.ts index 5b13919a98..f3a2297a8a 100644 --- a/sdk/constructive-react/src/modules/orm/models/emailsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/emailsModule.ts @@ -3,56 +3,96 @@ * @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 { EmailsModule, EmailsModuleWithRelations, EmailsModuleSelect, EmailsModuleFilter, EmailsModuleOrderBy, CreateEmailsModuleInput, UpdateEmailsModuleInput, EmailsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EmailsModule, + EmailsModuleWithRelations, + EmailsModuleSelect, + EmailsModuleFilter, + EmailsModuleOrderBy, + CreateEmailsModuleInput, + UpdateEmailsModuleInput, + EmailsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmailsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EmailsModule", "emailsModules", 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 - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EmailsModule', + 'emailsModules', + 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, + }, + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModules", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EmailsModule", "emailsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EmailsModule', + 'emailsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModule", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmailsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "emailsModule": data.emailsModules?.nodes?.[0] ?? null - }) + emailsModule: data.emailsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EmailsModule", "emailsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EmailsModule', + 'emailsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModule", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmailsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "emailsModule": data.emailsModules?.nodes?.[0] ?? null - }) + emailsModule: data.emailsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EmailsModule", "createEmailsModule", "emailsModule", args.select, args.data, "CreateEmailsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EmailsModule', + 'createEmailsModule', + 'emailsModule', + args.select, + args.data, + 'CreateEmailsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "createEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'createEmailsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmailsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EmailsModule", "updateEmailsModule", "emailsModule", args.select, args.where.id, args.data, "UpdateEmailsModuleInput", "id", "emailsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EmailsModule', + 'updateEmailsModule', + 'emailsModule', + args.select, + args.where.id, + args.data, + 'UpdateEmailsModuleInput', + 'id', + 'emailsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "updateEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'updateEmailsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EmailsModule", "deleteEmailsModule", "emailsModule", { - id: args.where.id - }, "DeleteEmailsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EmailsModule', + 'deleteEmailsModule', + 'emailsModule', + { + id: args.where.id, + }, + 'DeleteEmailsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "deleteEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'deleteEmailsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/entityTypeProvision.ts b/sdk/constructive-react/src/modules/orm/models/entityTypeProvision.ts index 5d95a2d830..c8e87d8f9c 100644 --- a/sdk/constructive-react/src/modules/orm/models/entityTypeProvision.ts +++ b/sdk/constructive-react/src/modules/orm/models/entityTypeProvision.ts @@ -3,56 +3,96 @@ * @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 { EntityTypeProvision, EntityTypeProvisionWithRelations, EntityTypeProvisionSelect, EntityTypeProvisionFilter, EntityTypeProvisionOrderBy, CreateEntityTypeProvisionInput, UpdateEntityTypeProvisionInput, EntityTypeProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EntityTypeProvision, + EntityTypeProvisionWithRelations, + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy, + CreateEntityTypeProvisionInput, + UpdateEntityTypeProvisionInput, + EntityTypeProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EntityTypeProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvisions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EntityTypeProvision", "entityTypeProvisions", 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 - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + 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, + }, + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvisions", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EntityTypeProvision", "entityTypeProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvision", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvision', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EntityTypeProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "entityTypeProvision": data.entityTypeProvisions?.nodes?.[0] ?? null - }) + entityTypeProvision: data.entityTypeProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EntityTypeProvision", "entityTypeProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvision", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvision', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EntityTypeProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "entityTypeProvision": data.entityTypeProvisions?.nodes?.[0] ?? null - }) + entityTypeProvision: data.entityTypeProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EntityTypeProvision", "createEntityTypeProvision", "entityTypeProvision", args.select, args.data, "CreateEntityTypeProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EntityTypeProvision', + 'createEntityTypeProvision', + 'entityTypeProvision', + args.select, + args.data, + 'CreateEntityTypeProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "createEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'createEntityTypeProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EntityTypeProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EntityTypeProvision", "updateEntityTypeProvision", "entityTypeProvision", args.select, args.where.id, args.data, "UpdateEntityTypeProvisionInput", "id", "entityTypeProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EntityTypeProvision', + 'updateEntityTypeProvision', + 'entityTypeProvision', + args.select, + args.where.id, + args.data, + 'UpdateEntityTypeProvisionInput', + 'id', + 'entityTypeProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "updateEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'updateEntityTypeProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EntityTypeProvision", "deleteEntityTypeProvision", "entityTypeProvision", { - id: args.where.id - }, "DeleteEntityTypeProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EntityTypeProvision', + 'deleteEntityTypeProvision', + 'entityTypeProvision', + { + id: args.where.id, + }, + 'DeleteEntityTypeProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "deleteEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'deleteEntityTypeProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/eventsModule.ts b/sdk/constructive-react/src/modules/orm/models/eventsModule.ts index a60011d618..0f07d39979 100644 --- a/sdk/constructive-react/src/modules/orm/models/eventsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/eventsModule.ts @@ -3,56 +3,96 @@ * @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 { EventsModule, EventsModuleWithRelations, EventsModuleSelect, EventsModuleFilter, EventsModuleOrderBy, CreateEventsModuleInput, UpdateEventsModuleInput, EventsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EventsModule, + EventsModuleWithRelations, + EventsModuleSelect, + EventsModuleFilter, + EventsModuleOrderBy, + CreateEventsModuleInput, + UpdateEventsModuleInput, + EventsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EventsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EventsModule", "eventsModules", 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 - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EventsModule', + 'eventsModules', + 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, + }, + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModules", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EventsModule", "eventsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EventsModule', + 'eventsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModule", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EventsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "eventsModule": data.eventsModules?.nodes?.[0] ?? null - }) + eventsModule: data.eventsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EventsModule", "eventsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EventsModule', + 'eventsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModule", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EventsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "eventsModule": data.eventsModules?.nodes?.[0] ?? null - }) + eventsModule: data.eventsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EventsModule", "createEventsModule", "eventsModule", args.select, args.data, "CreateEventsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EventsModule', + 'createEventsModule', + 'eventsModule', + args.select, + args.data, + 'CreateEventsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "createEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'createEventsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EventsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EventsModule", "updateEventsModule", "eventsModule", args.select, args.where.id, args.data, "UpdateEventsModuleInput", "id", "eventsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EventsModule', + 'updateEventsModule', + 'eventsModule', + args.select, + args.where.id, + args.data, + 'UpdateEventsModuleInput', + 'id', + 'eventsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "updateEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'updateEventsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EventsModule", "deleteEventsModule", "eventsModule", { - id: args.where.id - }, "DeleteEventsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EventsModule', + 'deleteEventsModule', + 'eventsModule', + { + id: args.where.id, + }, + 'DeleteEventsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "deleteEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'deleteEventsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/functionDeploymentModule.ts b/sdk/constructive-react/src/modules/orm/models/functionDeploymentModule.ts index c3cec9d613..afe50267f8 100644 --- a/sdk/constructive-react/src/modules/orm/models/functionDeploymentModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/functionDeploymentModule.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeploymentModule, FunctionDeploymentModuleWithRelations, FunctionDeploymentModuleSelect, FunctionDeploymentModuleFilter, FunctionDeploymentModuleOrderBy, CreateFunctionDeploymentModuleInput, UpdateFunctionDeploymentModuleInput, FunctionDeploymentModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentModule, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, + CreateFunctionDeploymentModuleInput, + UpdateFunctionDeploymentModuleInput, + FunctionDeploymentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionDeploymentModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModules", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModule", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionDeploymentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentModule": data.functionDeploymentModules?.nodes?.[0] ?? null - }) + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModule", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class FunctionDeploymentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentModule": data.functionDeploymentModules?.nodes?.[0] ?? null - }) + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeploymentModule", "createFunctionDeploymentModule", "functionDeploymentModule", args.select, args.data, "CreateFunctionDeploymentModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentModule', + 'createFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.data, + 'CreateFunctionDeploymentModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "createFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'createFunctionDeploymentModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeploymentModule", "updateFunctionDeploymentModule", "functionDeploymentModule", args.select, args.where.id, args.data, "UpdateFunctionDeploymentModuleInput", "id", "functionDeploymentModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentModule', + 'updateFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentModuleInput', + 'id', + 'functionDeploymentModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "updateFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'updateFunctionDeploymentModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeploymentModule", "deleteFunctionDeploymentModule", "functionDeploymentModule", { - id: args.where.id - }, "DeleteFunctionDeploymentModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentModule', + 'deleteFunctionDeploymentModule', + 'functionDeploymentModule', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "deleteFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'deleteFunctionDeploymentModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/functionInvocationModule.ts b/sdk/constructive-react/src/modules/orm/models/functionInvocationModule.ts index 45fc3f9127..ba40e892ea 100644 --- a/sdk/constructive-react/src/modules/orm/models/functionInvocationModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/functionInvocationModule.ts @@ -3,56 +3,98 @@ * @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 { FunctionInvocationModule, FunctionInvocationModuleWithRelations, FunctionInvocationModuleSelect, FunctionInvocationModuleFilter, FunctionInvocationModuleOrderBy, CreateFunctionInvocationModuleInput, UpdateFunctionInvocationModuleInput, FunctionInvocationModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionInvocationModule, + FunctionInvocationModuleWithRelations, + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy, + CreateFunctionInvocationModuleInput, + UpdateFunctionInvocationModuleInput, + FunctionInvocationModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionInvocationModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocationModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationModule", "functionInvocationModules", 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 - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + 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, + }, + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModules", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocationModule", "functionInvocationModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModule", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionInvocationModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationModule": data.functionInvocationModules?.nodes?.[0] ?? null - }) + functionInvocationModule: data.functionInvocationModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationModule", "functionInvocationModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModule", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class FunctionInvocationModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationModule": data.functionInvocationModules?.nodes?.[0] ?? null - }) + functionInvocationModule: data.functionInvocationModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocationModule", "createFunctionInvocationModule", "functionInvocationModule", args.select, args.data, "CreateFunctionInvocationModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocationModule', + 'createFunctionInvocationModule', + 'functionInvocationModule', + args.select, + args.data, + 'CreateFunctionInvocationModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "createFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'createFunctionInvocationModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionInvocationModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocationModule", "updateFunctionInvocationModule", "functionInvocationModule", args.select, args.where.id, args.data, "UpdateFunctionInvocationModuleInput", "id", "functionInvocationModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocationModule', + 'updateFunctionInvocationModule', + 'functionInvocationModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationModuleInput', + 'id', + 'functionInvocationModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "updateFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'updateFunctionInvocationModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocationModule", "deleteFunctionInvocationModule", "functionInvocationModule", { - id: args.where.id - }, "DeleteFunctionInvocationModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocationModule', + 'deleteFunctionInvocationModule', + 'functionInvocationModule', + { + id: args.where.id, + }, + 'DeleteFunctionInvocationModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "deleteFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'deleteFunctionInvocationModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/functionModule.ts b/sdk/constructive-react/src/modules/orm/models/functionModule.ts index af5039e9a4..7e127377dd 100644 --- a/sdk/constructive-react/src/modules/orm/models/functionModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/functionModule.ts @@ -3,56 +3,96 @@ * @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 { FunctionModule, FunctionModuleWithRelations, FunctionModuleSelect, FunctionModuleFilter, FunctionModuleOrderBy, CreateFunctionModuleInput, UpdateFunctionModuleInput, FunctionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionModule, + FunctionModuleWithRelations, + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy, + CreateFunctionModuleInput, + UpdateFunctionModuleInput, + FunctionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionModule", "functionModules", 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 - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionModule', + 'functionModules', + 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, + }, + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModules", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionModule", "functionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionModule', + 'functionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModule", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionModule": data.functionModules?.nodes?.[0] ?? null - }) + functionModule: data.functionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionModule", "functionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionModule', + 'functionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModule", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionModule": data.functionModules?.nodes?.[0] ?? null - }) + functionModule: data.functionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionModule", "createFunctionModule", "functionModule", args.select, args.data, "CreateFunctionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionModule', + 'createFunctionModule', + 'functionModule', + args.select, + args.data, + 'CreateFunctionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "createFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'createFunctionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionModule", "updateFunctionModule", "functionModule", args.select, args.where.id, args.data, "UpdateFunctionModuleInput", "id", "functionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionModule', + 'updateFunctionModule', + 'functionModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionModuleInput', + 'id', + 'functionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "updateFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'updateFunctionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionModule", "deleteFunctionModule", "functionModule", { - id: args.where.id - }, "DeleteFunctionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionModule', + 'deleteFunctionModule', + 'functionModule', + { + id: args.where.id, + }, + 'DeleteFunctionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "deleteFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'deleteFunctionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/graphExecutionModule.ts b/sdk/constructive-react/src/modules/orm/models/graphExecutionModule.ts index 9f71b75b40..9f1866c036 100644 --- a/sdk/constructive-react/src/modules/orm/models/graphExecutionModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/graphExecutionModule.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { GraphExecutionModule, GraphExecutionModuleWithRelations, GraphExecutionModuleSelect, GraphExecutionModuleFilter, GraphExecutionModuleOrderBy, CreateGraphExecutionModuleInput, UpdateGraphExecutionModuleInput, GraphExecutionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GraphExecutionModule, + GraphExecutionModuleWithRelations, + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, + CreateGraphExecutionModuleInput, + UpdateGraphExecutionModuleInput, + GraphExecutionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GraphExecutionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - graphExecutionModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModules", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphExecutionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModule", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class GraphExecutionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphExecutionModule": data.graphExecutionModules?.nodes?.[0] ?? null - }) + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ graphExecutionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModule", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class GraphExecutionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphExecutionModule": data.graphExecutionModules?.nodes?.[0] ?? null - }) + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GraphExecutionModule", "createGraphExecutionModule", "graphExecutionModule", args.select, args.data, "CreateGraphExecutionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GraphExecutionModule', + 'createGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.data, + 'CreateGraphExecutionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "createGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'createGraphExecutionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphExecutionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("GraphExecutionModule", "updateGraphExecutionModule", "graphExecutionModule", args.select, args.where.id, args.data, "UpdateGraphExecutionModuleInput", "id", "graphExecutionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'GraphExecutionModule', + 'updateGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphExecutionModuleInput', + 'id', + 'graphExecutionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "updateGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'updateGraphExecutionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("GraphExecutionModule", "deleteGraphExecutionModule", "graphExecutionModule", { - id: args.where.id - }, "DeleteGraphExecutionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'GraphExecutionModule', + 'deleteGraphExecutionModule', + 'graphExecutionModule', + { + id: args.where.id, + }, + 'DeleteGraphExecutionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "deleteGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'deleteGraphExecutionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/graphModule.ts b/sdk/constructive-react/src/modules/orm/models/graphModule.ts index a7fa776384..f337b77ed9 100644 --- a/sdk/constructive-react/src/modules/orm/models/graphModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/graphModule.ts @@ -3,56 +3,96 @@ * @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 { GraphModule, GraphModuleWithRelations, GraphModuleSelect, GraphModuleFilter, GraphModuleOrderBy, CreateGraphModuleInput, UpdateGraphModuleInput, GraphModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GraphModule, + GraphModuleWithRelations, + GraphModuleSelect, + GraphModuleFilter, + GraphModuleOrderBy, + CreateGraphModuleInput, + UpdateGraphModuleInput, + GraphModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GraphModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GraphModule", "graphModules", 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 - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GraphModule', + 'graphModules', + 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, + }, + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModules", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GraphModule", "graphModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GraphModule', + 'graphModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModule", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class GraphModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphModule": data.graphModules?.nodes?.[0] ?? null - }) + graphModule: data.graphModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("GraphModule", "graphModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'GraphModule', + 'graphModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModule", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class GraphModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphModule": data.graphModules?.nodes?.[0] ?? null - }) + graphModule: data.graphModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GraphModule", "createGraphModule", "graphModule", args.select, args.data, "CreateGraphModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GraphModule', + 'createGraphModule', + 'graphModule', + args.select, + args.data, + 'CreateGraphModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "createGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'createGraphModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("GraphModule", "updateGraphModule", "graphModule", args.select, args.where.id, args.data, "UpdateGraphModuleInput", "id", "graphModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'GraphModule', + 'updateGraphModule', + 'graphModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphModuleInput', + 'id', + 'graphModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "updateGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'updateGraphModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("GraphModule", "deleteGraphModule", "graphModule", { - id: args.where.id - }, "DeleteGraphModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'GraphModule', + 'deleteGraphModule', + 'graphModule', + { + id: args.where.id, + }, + 'DeleteGraphModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "deleteGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'deleteGraphModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/hierarchyModule.ts b/sdk/constructive-react/src/modules/orm/models/hierarchyModule.ts index 30eca6fb9e..16e9170d2b 100644 --- a/sdk/constructive-react/src/modules/orm/models/hierarchyModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/hierarchyModule.ts @@ -3,56 +3,96 @@ * @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 { HierarchyModule, HierarchyModuleWithRelations, HierarchyModuleSelect, HierarchyModuleFilter, HierarchyModuleOrderBy, CreateHierarchyModuleInput, UpdateHierarchyModuleInput, HierarchyModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HierarchyModule, + HierarchyModuleWithRelations, + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy, + CreateHierarchyModuleInput, + UpdateHierarchyModuleInput, + HierarchyModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HierarchyModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HierarchyModule", "hierarchyModules", 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 - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HierarchyModule', + 'hierarchyModules', + 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, + }, + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModules", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HierarchyModule", "hierarchyModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HierarchyModule', + 'hierarchyModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModule", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HierarchyModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "hierarchyModule": data.hierarchyModules?.nodes?.[0] ?? null - }) + hierarchyModule: data.hierarchyModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HierarchyModule", "hierarchyModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HierarchyModule', + 'hierarchyModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModule", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HierarchyModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "hierarchyModule": data.hierarchyModules?.nodes?.[0] ?? null - }) + hierarchyModule: data.hierarchyModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HierarchyModule", "createHierarchyModule", "hierarchyModule", args.select, args.data, "CreateHierarchyModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HierarchyModule', + 'createHierarchyModule', + 'hierarchyModule', + args.select, + args.data, + 'CreateHierarchyModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "createHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'createHierarchyModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HierarchyModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HierarchyModule", "updateHierarchyModule", "hierarchyModule", args.select, args.where.id, args.data, "UpdateHierarchyModuleInput", "id", "hierarchyModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HierarchyModule', + 'updateHierarchyModule', + 'hierarchyModule', + args.select, + args.where.id, + args.data, + 'UpdateHierarchyModuleInput', + 'id', + 'hierarchyModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "updateHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'updateHierarchyModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HierarchyModule", "deleteHierarchyModule", "hierarchyModule", { - id: args.where.id - }, "DeleteHierarchyModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HierarchyModule', + 'deleteHierarchyModule', + 'hierarchyModule', + { + id: args.where.id, + }, + 'DeleteHierarchyModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "deleteHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'deleteHierarchyModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/httpRouteModule.ts b/sdk/constructive-react/src/modules/orm/models/httpRouteModule.ts index c44abc24a3..babf4d3085 100644 --- a/sdk/constructive-react/src/modules/orm/models/httpRouteModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/httpRouteModule.ts @@ -3,56 +3,96 @@ * @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 { HttpRouteModule, HttpRouteModuleWithRelations, HttpRouteModuleSelect, HttpRouteModuleFilter, HttpRouteModuleOrderBy, CreateHttpRouteModuleInput, UpdateHttpRouteModuleInput, HttpRouteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HttpRouteModule, + HttpRouteModuleWithRelations, + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy, + CreateHttpRouteModuleInput, + UpdateHttpRouteModuleInput, + HttpRouteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HttpRouteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRouteModule", "httpRouteModules", 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 - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HttpRouteModule', + 'httpRouteModules', + 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, + }, + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModules", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HttpRouteModule", "httpRouteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HttpRouteModule', + 'httpRouteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModule", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HttpRouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRouteModule": data.httpRouteModules?.nodes?.[0] ?? null - }) + httpRouteModule: data.httpRouteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRouteModule", "httpRouteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HttpRouteModule', + 'httpRouteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModule", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HttpRouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRouteModule": data.httpRouteModules?.nodes?.[0] ?? null - }) + httpRouteModule: data.httpRouteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HttpRouteModule", "createHttpRouteModule", "httpRouteModule", args.select, args.data, "CreateHttpRouteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HttpRouteModule', + 'createHttpRouteModule', + 'httpRouteModule', + args.select, + args.data, + 'CreateHttpRouteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "createHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'createHttpRouteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HttpRouteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HttpRouteModule", "updateHttpRouteModule", "httpRouteModule", args.select, args.where.id, args.data, "UpdateHttpRouteModuleInput", "id", "httpRouteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HttpRouteModule', + 'updateHttpRouteModule', + 'httpRouteModule', + args.select, + args.where.id, + args.data, + 'UpdateHttpRouteModuleInput', + 'id', + 'httpRouteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "updateHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'updateHttpRouteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HttpRouteModule", "deleteHttpRouteModule", "httpRouteModule", { - id: args.where.id - }, "DeleteHttpRouteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HttpRouteModule', + 'deleteHttpRouteModule', + 'httpRouteModule', + { + id: args.where.id, + }, + 'DeleteHttpRouteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "deleteHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'deleteHttpRouteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/i18NModule.ts b/sdk/constructive-react/src/modules/orm/models/i18NModule.ts index c49e6d670b..014ecefd15 100644 --- a/sdk/constructive-react/src/modules/orm/models/i18NModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/i18NModule.ts @@ -3,56 +3,96 @@ * @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 { I18NModule, I18NModuleWithRelations, I18NModuleSelect, I18NModuleFilter, I18NModuleOrderBy, CreateI18NModuleInput, UpdateI18NModuleInput, I18NModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + I18NModule, + I18NModuleWithRelations, + I18NModuleSelect, + I18NModuleFilter, + I18NModuleOrderBy, + CreateI18NModuleInput, + UpdateI18NModuleInput, + I18NModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class I18NModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ i18nModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("I18NModule", "i18nModules", 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 - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'I18NModule', + 'i18nModules', + 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, + }, + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18nModules", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18nModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ i18NModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("I18NModule", "i18nModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'I18NModule', + 'i18nModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18NModule", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18NModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class I18NModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "i18NModule": data.i18nModules?.nodes?.[0] ?? null - }) + i18NModule: data.i18nModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ i18NModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("I18NModule", "i18nModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'I18NModule', + 'i18nModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18NModule", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18NModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class I18NModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "i18NModule": data.i18nModules?.nodes?.[0] ?? null - }) + i18NModule: data.i18nModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("I18NModule", "createI18NModule", "i18NModule", args.select, args.data, "CreateI18NModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'I18NModule', + 'createI18NModule', + 'i18NModule', + args.select, + args.data, + 'CreateI18NModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "createI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'createI18NModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + I18NModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("I18NModule", "updateI18NModule", "i18NModule", args.select, args.where.id, args.data, "UpdateI18NModuleInput", "id", "i18NModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'I18NModule', + 'updateI18NModule', + 'i18NModule', + args.select, + args.where.id, + args.data, + 'UpdateI18NModuleInput', + 'id', + 'i18NModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "updateI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'updateI18NModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("I18NModule", "deleteI18NModule", "i18NModule", { - id: args.where.id - }, "DeleteI18NModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'I18NModule', + 'deleteI18NModule', + 'i18NModule', + { + id: args.where.id, + }, + 'DeleteI18NModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "deleteI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'deleteI18NModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/identityProvidersModule.ts b/sdk/constructive-react/src/modules/orm/models/identityProvidersModule.ts index 35b05c8128..bc564b56d1 100644 --- a/sdk/constructive-react/src/modules/orm/models/identityProvidersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/identityProvidersModule.ts @@ -3,56 +3,98 @@ * @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 { IdentityProvidersModule, IdentityProvidersModuleWithRelations, IdentityProvidersModuleSelect, IdentityProvidersModuleFilter, IdentityProvidersModuleOrderBy, CreateIdentityProvidersModuleInput, UpdateIdentityProvidersModuleInput, IdentityProvidersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IdentityProvidersModule, + IdentityProvidersModuleWithRelations, + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy, + CreateIdentityProvidersModuleInput, + UpdateIdentityProvidersModuleInput, + IdentityProvidersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IdentityProvidersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - identityProvidersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + identityProvidersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvidersModule", "identityProvidersModules", 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 - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + 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, + }, + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModules", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvidersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IdentityProvidersModule", "identityProvidersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModule", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class IdentityProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvidersModule": data.identityProvidersModules?.nodes?.[0] ?? null - }) + identityProvidersModule: data.identityProvidersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvidersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvidersModule", "identityProvidersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModule", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class IdentityProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvidersModule": data.identityProvidersModules?.nodes?.[0] ?? null - }) + identityProvidersModule: data.identityProvidersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IdentityProvidersModule", "createIdentityProvidersModule", "identityProvidersModule", args.select, args.data, "CreateIdentityProvidersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IdentityProvidersModule', + 'createIdentityProvidersModule', + 'identityProvidersModule', + args.select, + args.data, + 'CreateIdentityProvidersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "createIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'createIdentityProvidersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IdentityProvidersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IdentityProvidersModule", "updateIdentityProvidersModule", "identityProvidersModule", args.select, args.where.id, args.data, "UpdateIdentityProvidersModuleInput", "id", "identityProvidersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IdentityProvidersModule', + 'updateIdentityProvidersModule', + 'identityProvidersModule', + args.select, + args.where.id, + args.data, + 'UpdateIdentityProvidersModuleInput', + 'id', + 'identityProvidersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "updateIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'updateIdentityProvidersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IdentityProvidersModule", "deleteIdentityProvidersModule", "identityProvidersModule", { - id: args.where.id - }, "DeleteIdentityProvidersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IdentityProvidersModule', + 'deleteIdentityProvidersModule', + 'identityProvidersModule', + { + id: args.where.id, + }, + 'DeleteIdentityProvidersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "deleteIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'deleteIdentityProvidersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/index.ts b/sdk/constructive-react/src/modules/orm/models/index.ts index b2fe8faa92..3aa2d03318 100644 --- a/sdk/constructive-react/src/modules/orm/models/index.ts +++ b/sdk/constructive-react/src/modules/orm/models/index.ts @@ -3,78 +3,78 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AgentModuleModel } from "./agentModule"; -export { ApiSurfaceModuleModel } from "./apiSurfaceModule"; -export { AppModuleModel } from "./appModule"; -export { BillingModuleModel } from "./billingModule"; -export { BillingProviderModuleModel } from "./billingProviderModule"; -export { BlueprintModel } from "./blueprint"; -export { BlueprintConstructionModel } from "./blueprintConstruction"; -export { BlueprintTemplateModel } from "./blueprintTemplate"; -export { CatalogModuleModel } from "./catalogModule"; -export { ComputeLogModuleModel } from "./computeLogModule"; -export { ConfigSecretsUserModuleModel } from "./configSecretsUserModule"; -export { ConnectedAccountsModuleModel } from "./connectedAccountsModule"; -export { CryptoAddressesModuleModel } from "./cryptoAddressesModule"; -export { CryptoAuthModuleModel } from "./cryptoAuthModule"; -export { DatabaseProvisionModuleModel } from "./databaseProvisionModule"; -export { DatabaseSettingsModuleModel } from "./databaseSettingsModule"; -export { DbPoolConfigModel } from "./dbPoolConfig"; -export { DbPoolModel } from "./dbPool"; -export { DbPresetModuleModel } from "./dbPresetModule"; -export { DbUsageModuleModel } from "./dbUsageModule"; -export { DefaultIdsModuleModel } from "./defaultIdsModule"; -export { DenormalizedTableFieldModel } from "./denormalizedTableField"; -export { DevicesModuleModel } from "./devicesModule"; -export { DomainModuleModel } from "./domainModule"; -export { EmailsModuleModel } from "./emailsModule"; -export { EntityTypeProvisionModel } from "./entityTypeProvision"; -export { EventsModuleModel } from "./eventsModule"; -export { FunctionDeploymentModuleModel } from "./functionDeploymentModule"; -export { FunctionInvocationModuleModel } from "./functionInvocationModule"; -export { FunctionModuleModel } from "./functionModule"; -export { GraphExecutionModuleModel } from "./graphExecutionModule"; -export { GraphModuleModel } from "./graphModule"; -export { HierarchyModuleModel } from "./hierarchyModule"; -export { HttpRouteModuleModel } from "./httpRouteModule"; -export { I18NModuleModel } from "./i18NModule"; -export { IdentityProvidersModuleModel } from "./identityProvidersModule"; -export { InferenceLogModuleModel } from "./inferenceLogModule"; -export { InfraConfigModuleModel } from "./infraConfigModule"; -export { InfraSecretsModuleModel } from "./infraSecretsModule"; -export { IntegrationProvidersModuleModel } from "./integrationProvidersModule"; -export { InternalSecretsModuleModel } from "./internalSecretsModule"; -export { InvitesModuleModel } from "./invitesModule"; -export { LimitsModuleModel } from "./limitsModule"; -export { MembershipTypesModuleModel } from "./membershipTypesModule"; -export { MembershipsModuleModel } from "./membershipsModule"; -export { MerkleStoreModuleModel } from "./merkleStoreModule"; -export { NamespaceModuleModel } from "./namespaceModule"; -export { NotificationsModuleModel } from "./notificationsModule"; -export { PermissionsModuleModel } from "./permissionsModule"; -export { PhoneNumbersModuleModel } from "./phoneNumbersModule"; -export { PlansModuleModel } from "./plansModule"; -export { PrincipalAuthModuleModel } from "./principalAuthModule"; -export { ProfilesModuleModel } from "./profilesModule"; -export { RateLimitMetersModuleModel } from "./rateLimitMetersModule"; -export { RateLimitsModuleModel } from "./rateLimitsModule"; -export { RealtimeModuleModel } from "./realtimeModule"; -export { RelationProvisionModel } from "./relationProvision"; -export { ResourceModuleModel } from "./resourceModule"; -export { RlsModuleModel } from "./rlsModule"; -export { RouteModuleModel } from "./routeModule"; -export { SecureTableProvisionModel } from "./secureTableProvision"; -export { SessionSecretsModuleModel } from "./sessionSecretsModule"; -export { SessionsModuleModel } from "./sessionsModule"; -export { SiteSurfaceModuleModel } from "./siteSurfaceModule"; -export { StorageLogModuleModel } from "./storageLogModule"; -export { StorageModuleModel } from "./storageModule"; -export { TransferLogModuleModel } from "./transferLogModule"; -export { UserAuthModuleModel } from "./userAuthModule"; -export { UserCredentialsModuleModel } from "./userCredentialsModule"; -export { UserSettingsModuleModel } from "./userSettingsModule"; -export { UserStateModuleModel } from "./userStateModule"; -export { UsersModuleModel } from "./usersModule"; -export { WebauthnAuthModuleModel } from "./webauthnAuthModule"; -export { WebauthnCredentialsModuleModel } from "./webauthnCredentialsModule"; -export { WebhookModuleModel } from "./webhookModule"; \ No newline at end of file +export { AgentModuleModel } from './agentModule'; +export { ApiSurfaceModuleModel } from './apiSurfaceModule'; +export { AppModuleModel } from './appModule'; +export { BillingModuleModel } from './billingModule'; +export { BillingProviderModuleModel } from './billingProviderModule'; +export { BlueprintModel } from './blueprint'; +export { BlueprintConstructionModel } from './blueprintConstruction'; +export { BlueprintTemplateModel } from './blueprintTemplate'; +export { CatalogModuleModel } from './catalogModule'; +export { ComputeLogModuleModel } from './computeLogModule'; +export { ConfigSecretsUserModuleModel } from './configSecretsUserModule'; +export { ConnectedAccountsModuleModel } from './connectedAccountsModule'; +export { CryptoAddressesModuleModel } from './cryptoAddressesModule'; +export { CryptoAuthModuleModel } from './cryptoAuthModule'; +export { DatabaseProvisionModuleModel } from './databaseProvisionModule'; +export { DatabaseSettingsModuleModel } from './databaseSettingsModule'; +export { DbPoolConfigModel } from './dbPoolConfig'; +export { DbPoolModel } from './dbPool'; +export { DbPresetModuleModel } from './dbPresetModule'; +export { DbUsageModuleModel } from './dbUsageModule'; +export { DefaultIdsModuleModel } from './defaultIdsModule'; +export { DenormalizedTableFieldModel } from './denormalizedTableField'; +export { DevicesModuleModel } from './devicesModule'; +export { DomainModuleModel } from './domainModule'; +export { EmailsModuleModel } from './emailsModule'; +export { EntityTypeProvisionModel } from './entityTypeProvision'; +export { EventsModuleModel } from './eventsModule'; +export { FunctionDeploymentModuleModel } from './functionDeploymentModule'; +export { FunctionInvocationModuleModel } from './functionInvocationModule'; +export { FunctionModuleModel } from './functionModule'; +export { GraphExecutionModuleModel } from './graphExecutionModule'; +export { GraphModuleModel } from './graphModule'; +export { HierarchyModuleModel } from './hierarchyModule'; +export { HttpRouteModuleModel } from './httpRouteModule'; +export { I18NModuleModel } from './i18NModule'; +export { IdentityProvidersModuleModel } from './identityProvidersModule'; +export { InferenceLogModuleModel } from './inferenceLogModule'; +export { InfraConfigModuleModel } from './infraConfigModule'; +export { InfraSecretsModuleModel } from './infraSecretsModule'; +export { IntegrationProvidersModuleModel } from './integrationProvidersModule'; +export { InternalSecretsModuleModel } from './internalSecretsModule'; +export { InvitesModuleModel } from './invitesModule'; +export { LimitsModuleModel } from './limitsModule'; +export { MembershipTypesModuleModel } from './membershipTypesModule'; +export { MembershipsModuleModel } from './membershipsModule'; +export { MerkleStoreModuleModel } from './merkleStoreModule'; +export { NamespaceModuleModel } from './namespaceModule'; +export { NotificationsModuleModel } from './notificationsModule'; +export { PermissionsModuleModel } from './permissionsModule'; +export { PhoneNumbersModuleModel } from './phoneNumbersModule'; +export { PlansModuleModel } from './plansModule'; +export { PrincipalAuthModuleModel } from './principalAuthModule'; +export { ProfilesModuleModel } from './profilesModule'; +export { RateLimitMetersModuleModel } from './rateLimitMetersModule'; +export { RateLimitsModuleModel } from './rateLimitsModule'; +export { RealtimeModuleModel } from './realtimeModule'; +export { RelationProvisionModel } from './relationProvision'; +export { ResourceModuleModel } from './resourceModule'; +export { RlsModuleModel } from './rlsModule'; +export { RouteModuleModel } from './routeModule'; +export { SecureTableProvisionModel } from './secureTableProvision'; +export { SessionSecretsModuleModel } from './sessionSecretsModule'; +export { SessionsModuleModel } from './sessionsModule'; +export { SiteSurfaceModuleModel } from './siteSurfaceModule'; +export { StorageLogModuleModel } from './storageLogModule'; +export { StorageModuleModel } from './storageModule'; +export { TransferLogModuleModel } from './transferLogModule'; +export { UserAuthModuleModel } from './userAuthModule'; +export { UserCredentialsModuleModel } from './userCredentialsModule'; +export { UserSettingsModuleModel } from './userSettingsModule'; +export { UserStateModuleModel } from './userStateModule'; +export { UsersModuleModel } from './usersModule'; +export { WebauthnAuthModuleModel } from './webauthnAuthModule'; +export { WebauthnCredentialsModuleModel } from './webauthnCredentialsModule'; +export { WebhookModuleModel } from './webhookModule'; diff --git a/sdk/constructive-react/src/modules/orm/models/inferenceLogModule.ts b/sdk/constructive-react/src/modules/orm/models/inferenceLogModule.ts index ea4160dd85..f4c0f77d3b 100644 --- a/sdk/constructive-react/src/modules/orm/models/inferenceLogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/inferenceLogModule.ts @@ -3,56 +3,96 @@ * @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 { InferenceLogModule, InferenceLogModuleWithRelations, InferenceLogModuleSelect, InferenceLogModuleFilter, InferenceLogModuleOrderBy, CreateInferenceLogModuleInput, UpdateInferenceLogModuleInput, InferenceLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InferenceLogModule, + InferenceLogModuleWithRelations, + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy, + CreateInferenceLogModuleInput, + UpdateInferenceLogModuleInput, + InferenceLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InferenceLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InferenceLogModule", "inferenceLogModules", 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 - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InferenceLogModule', + 'inferenceLogModules', + 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, + }, + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModules", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InferenceLogModule", "inferenceLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InferenceLogModule', + 'inferenceLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModule", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InferenceLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "inferenceLogModule": data.inferenceLogModules?.nodes?.[0] ?? null - }) + inferenceLogModule: data.inferenceLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InferenceLogModule", "inferenceLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InferenceLogModule', + 'inferenceLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModule", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InferenceLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "inferenceLogModule": data.inferenceLogModules?.nodes?.[0] ?? null - }) + inferenceLogModule: data.inferenceLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InferenceLogModule", "createInferenceLogModule", "inferenceLogModule", args.select, args.data, "CreateInferenceLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InferenceLogModule', + 'createInferenceLogModule', + 'inferenceLogModule', + args.select, + args.data, + 'CreateInferenceLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "createInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'createInferenceLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InferenceLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InferenceLogModule", "updateInferenceLogModule", "inferenceLogModule", args.select, args.where.id, args.data, "UpdateInferenceLogModuleInput", "id", "inferenceLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InferenceLogModule', + 'updateInferenceLogModule', + 'inferenceLogModule', + args.select, + args.where.id, + args.data, + 'UpdateInferenceLogModuleInput', + 'id', + 'inferenceLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "updateInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'updateInferenceLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InferenceLogModule", "deleteInferenceLogModule", "inferenceLogModule", { - id: args.where.id - }, "DeleteInferenceLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InferenceLogModule', + 'deleteInferenceLogModule', + 'inferenceLogModule', + { + id: args.where.id, + }, + 'DeleteInferenceLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "deleteInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'deleteInferenceLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/infraConfigModule.ts b/sdk/constructive-react/src/modules/orm/models/infraConfigModule.ts index ace75e0620..12a793b04f 100644 --- a/sdk/constructive-react/src/modules/orm/models/infraConfigModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/infraConfigModule.ts @@ -3,56 +3,96 @@ * @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 { InfraConfigModule, InfraConfigModuleWithRelations, InfraConfigModuleSelect, InfraConfigModuleFilter, InfraConfigModuleOrderBy, CreateInfraConfigModuleInput, UpdateInfraConfigModuleInput, InfraConfigModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraConfigModule, + InfraConfigModuleWithRelations, + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy, + CreateInfraConfigModuleInput, + UpdateInfraConfigModuleInput, + InfraConfigModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraConfigModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraConfigModule", "infraConfigModules", 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 - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraConfigModule', + 'infraConfigModules', + 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, + }, + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModules", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraConfigModule", "infraConfigModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraConfigModule', + 'infraConfigModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModule", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraConfigModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraConfigModule": data.infraConfigModules?.nodes?.[0] ?? null - }) + infraConfigModule: data.infraConfigModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraConfigModule", "infraConfigModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraConfigModule', + 'infraConfigModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModule", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraConfigModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraConfigModule": data.infraConfigModules?.nodes?.[0] ?? null - }) + infraConfigModule: data.infraConfigModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraConfigModule", "createInfraConfigModule", "infraConfigModule", args.select, args.data, "CreateInfraConfigModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraConfigModule', + 'createInfraConfigModule', + 'infraConfigModule', + args.select, + args.data, + 'CreateInfraConfigModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "createInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'createInfraConfigModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraConfigModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraConfigModule", "updateInfraConfigModule", "infraConfigModule", args.select, args.where.id, args.data, "UpdateInfraConfigModuleInput", "id", "infraConfigModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraConfigModule', + 'updateInfraConfigModule', + 'infraConfigModule', + args.select, + args.where.id, + args.data, + 'UpdateInfraConfigModuleInput', + 'id', + 'infraConfigModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "updateInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'updateInfraConfigModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraConfigModule", "deleteInfraConfigModule", "infraConfigModule", { - id: args.where.id - }, "DeleteInfraConfigModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraConfigModule', + 'deleteInfraConfigModule', + 'infraConfigModule', + { + id: args.where.id, + }, + 'DeleteInfraConfigModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "deleteInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'deleteInfraConfigModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/infraSecretsModule.ts b/sdk/constructive-react/src/modules/orm/models/infraSecretsModule.ts index d1089bf89d..165b4f2d59 100644 --- a/sdk/constructive-react/src/modules/orm/models/infraSecretsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/infraSecretsModule.ts @@ -3,56 +3,96 @@ * @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 { InfraSecretsModule, InfraSecretsModuleWithRelations, InfraSecretsModuleSelect, InfraSecretsModuleFilter, InfraSecretsModuleOrderBy, CreateInfraSecretsModuleInput, UpdateInfraSecretsModuleInput, InfraSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraSecretsModule, + InfraSecretsModuleWithRelations, + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy, + CreateInfraSecretsModuleInput, + UpdateInfraSecretsModuleInput, + InfraSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraSecretsModule", "infraSecretsModules", 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 - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + 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, + }, + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModules", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraSecretsModule", "infraSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModule", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraSecretsModule": data.infraSecretsModules?.nodes?.[0] ?? null - }) + infraSecretsModule: data.infraSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraSecretsModule", "infraSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModule", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraSecretsModule": data.infraSecretsModules?.nodes?.[0] ?? null - }) + infraSecretsModule: data.infraSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraSecretsModule", "createInfraSecretsModule", "infraSecretsModule", args.select, args.data, "CreateInfraSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraSecretsModule', + 'createInfraSecretsModule', + 'infraSecretsModule', + args.select, + args.data, + 'CreateInfraSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "createInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'createInfraSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraSecretsModule", "updateInfraSecretsModule", "infraSecretsModule", args.select, args.where.id, args.data, "UpdateInfraSecretsModuleInput", "id", "infraSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraSecretsModule', + 'updateInfraSecretsModule', + 'infraSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateInfraSecretsModuleInput', + 'id', + 'infraSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "updateInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'updateInfraSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraSecretsModule", "deleteInfraSecretsModule", "infraSecretsModule", { - id: args.where.id - }, "DeleteInfraSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraSecretsModule', + 'deleteInfraSecretsModule', + 'infraSecretsModule', + { + id: args.where.id, + }, + 'DeleteInfraSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "deleteInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'deleteInfraSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/integrationProvidersModule.ts b/sdk/constructive-react/src/modules/orm/models/integrationProvidersModule.ts index 23d033a40a..63c765faee 100644 --- a/sdk/constructive-react/src/modules/orm/models/integrationProvidersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/integrationProvidersModule.ts @@ -3,56 +3,101 @@ * @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 { IntegrationProvidersModule, IntegrationProvidersModuleWithRelations, IntegrationProvidersModuleSelect, IntegrationProvidersModuleFilter, IntegrationProvidersModuleOrderBy, CreateIntegrationProvidersModuleInput, UpdateIntegrationProvidersModuleInput, IntegrationProvidersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IntegrationProvidersModule, + IntegrationProvidersModuleWithRelations, + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy, + CreateIntegrationProvidersModuleInput, + UpdateIntegrationProvidersModuleInput, + IntegrationProvidersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IntegrationProvidersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvidersModule", "integrationProvidersModules", 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 - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + 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, + }, + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModules", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModule: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModule: InferSelectResult< + IntegrationProvidersModuleWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IntegrationProvidersModule", "integrationProvidersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModule", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModule', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class IntegrationProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvidersModule": data.integrationProvidersModules?.nodes?.[0] ?? null - }) + integrationProvidersModule: data.integrationProvidersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModule: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModule: InferSelectResult< + IntegrationProvidersModuleWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvidersModule", "integrationProvidersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModule", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModule', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class IntegrationProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvidersModule": data.integrationProvidersModules?.nodes?.[0] ?? null - }) + integrationProvidersModule: data.integrationProvidersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IntegrationProvidersModule", "createIntegrationProvidersModule", "integrationProvidersModule", args.select, args.data, "CreateIntegrationProvidersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IntegrationProvidersModule', + 'createIntegrationProvidersModule', + 'integrationProvidersModule', + args.select, + args.data, + 'CreateIntegrationProvidersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "createIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'createIntegrationProvidersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IntegrationProvidersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IntegrationProvidersModule", "updateIntegrationProvidersModule", "integrationProvidersModule", args.select, args.where.id, args.data, "UpdateIntegrationProvidersModuleInput", "id", "integrationProvidersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IntegrationProvidersModule', + 'updateIntegrationProvidersModule', + 'integrationProvidersModule', + args.select, + args.where.id, + args.data, + 'UpdateIntegrationProvidersModuleInput', + 'id', + 'integrationProvidersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "updateIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'updateIntegrationProvidersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IntegrationProvidersModule", "deleteIntegrationProvidersModule", "integrationProvidersModule", { - id: args.where.id - }, "DeleteIntegrationProvidersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IntegrationProvidersModule', + 'deleteIntegrationProvidersModule', + 'integrationProvidersModule', + { + id: args.where.id, + }, + 'DeleteIntegrationProvidersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "deleteIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'deleteIntegrationProvidersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/internalSecretsModule.ts b/sdk/constructive-react/src/modules/orm/models/internalSecretsModule.ts index 649ce5bbd9..cfffbed8d5 100644 --- a/sdk/constructive-react/src/modules/orm/models/internalSecretsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/internalSecretsModule.ts @@ -3,56 +3,98 @@ * @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 { InternalSecretsModule, InternalSecretsModuleWithRelations, InternalSecretsModuleSelect, InternalSecretsModuleFilter, InternalSecretsModuleOrderBy, CreateInternalSecretsModuleInput, UpdateInternalSecretsModuleInput, InternalSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InternalSecretsModule, + InternalSecretsModuleWithRelations, + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy, + CreateInternalSecretsModuleInput, + UpdateInternalSecretsModuleInput, + InternalSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InternalSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - internalSecretsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + internalSecretsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("InternalSecretsModule", "internalSecretsModules", 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 - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + 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, + }, + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModules", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ internalSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InternalSecretsModule", "internalSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModule", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class InternalSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "internalSecretsModule": data.internalSecretsModules?.nodes?.[0] ?? null - }) + internalSecretsModule: data.internalSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ internalSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InternalSecretsModule", "internalSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModule", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class InternalSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "internalSecretsModule": data.internalSecretsModules?.nodes?.[0] ?? null - }) + internalSecretsModule: data.internalSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InternalSecretsModule", "createInternalSecretsModule", "internalSecretsModule", args.select, args.data, "CreateInternalSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InternalSecretsModule', + 'createInternalSecretsModule', + 'internalSecretsModule', + args.select, + args.data, + 'CreateInternalSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "createInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'createInternalSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InternalSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InternalSecretsModule", "updateInternalSecretsModule", "internalSecretsModule", args.select, args.where.id, args.data, "UpdateInternalSecretsModuleInput", "id", "internalSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InternalSecretsModule', + 'updateInternalSecretsModule', + 'internalSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateInternalSecretsModuleInput', + 'id', + 'internalSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "updateInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'updateInternalSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InternalSecretsModule", "deleteInternalSecretsModule", "internalSecretsModule", { - id: args.where.id - }, "DeleteInternalSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InternalSecretsModule', + 'deleteInternalSecretsModule', + 'internalSecretsModule', + { + id: args.where.id, + }, + 'DeleteInternalSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "deleteInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'deleteInternalSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/invitesModule.ts b/sdk/constructive-react/src/modules/orm/models/invitesModule.ts index b740ff9252..b244078720 100644 --- a/sdk/constructive-react/src/modules/orm/models/invitesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/invitesModule.ts @@ -3,56 +3,96 @@ * @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 { InvitesModule, InvitesModuleWithRelations, InvitesModuleSelect, InvitesModuleFilter, InvitesModuleOrderBy, CreateInvitesModuleInput, UpdateInvitesModuleInput, InvitesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InvitesModule, + InvitesModuleWithRelations, + InvitesModuleSelect, + InvitesModuleFilter, + InvitesModuleOrderBy, + CreateInvitesModuleInput, + UpdateInvitesModuleInput, + InvitesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InvitesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InvitesModule", "invitesModules", 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 - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InvitesModule', + 'invitesModules', + 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, + }, + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModules", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InvitesModule", "invitesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InvitesModule', + 'invitesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModule", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InvitesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "invitesModule": data.invitesModules?.nodes?.[0] ?? null - }) + invitesModule: data.invitesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InvitesModule", "invitesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InvitesModule', + 'invitesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModule", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InvitesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "invitesModule": data.invitesModules?.nodes?.[0] ?? null - }) + invitesModule: data.invitesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InvitesModule", "createInvitesModule", "invitesModule", args.select, args.data, "CreateInvitesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InvitesModule', + 'createInvitesModule', + 'invitesModule', + args.select, + args.data, + 'CreateInvitesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "createInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'createInvitesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InvitesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InvitesModule", "updateInvitesModule", "invitesModule", args.select, args.where.id, args.data, "UpdateInvitesModuleInput", "id", "invitesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InvitesModule', + 'updateInvitesModule', + 'invitesModule', + args.select, + args.where.id, + args.data, + 'UpdateInvitesModuleInput', + 'id', + 'invitesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "updateInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'updateInvitesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InvitesModule", "deleteInvitesModule", "invitesModule", { - id: args.where.id - }, "DeleteInvitesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InvitesModule', + 'deleteInvitesModule', + 'invitesModule', + { + id: args.where.id, + }, + 'DeleteInvitesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "deleteInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'deleteInvitesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/limitsModule.ts b/sdk/constructive-react/src/modules/orm/models/limitsModule.ts index 4e868d7c8f..50d0d76ba5 100644 --- a/sdk/constructive-react/src/modules/orm/models/limitsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/limitsModule.ts @@ -3,56 +3,96 @@ * @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 { LimitsModule, LimitsModuleWithRelations, LimitsModuleSelect, LimitsModuleFilter, LimitsModuleOrderBy, CreateLimitsModuleInput, UpdateLimitsModuleInput, LimitsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + LimitsModule, + LimitsModuleWithRelations, + LimitsModuleSelect, + LimitsModuleFilter, + LimitsModuleOrderBy, + CreateLimitsModuleInput, + UpdateLimitsModuleInput, + LimitsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class LimitsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("LimitsModule", "limitsModules", 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 - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'LimitsModule', + 'limitsModules', + 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, + }, + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModules", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("LimitsModule", "limitsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'LimitsModule', + 'limitsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModule", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class LimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "limitsModule": data.limitsModules?.nodes?.[0] ?? null - }) + limitsModule: data.limitsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("LimitsModule", "limitsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'LimitsModule', + 'limitsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModule", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class LimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "limitsModule": data.limitsModules?.nodes?.[0] ?? null - }) + limitsModule: data.limitsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("LimitsModule", "createLimitsModule", "limitsModule", args.select, args.data, "CreateLimitsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'LimitsModule', + 'createLimitsModule', + 'limitsModule', + args.select, + args.data, + 'CreateLimitsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "createLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'createLimitsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + LimitsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("LimitsModule", "updateLimitsModule", "limitsModule", args.select, args.where.id, args.data, "UpdateLimitsModuleInput", "id", "limitsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'LimitsModule', + 'updateLimitsModule', + 'limitsModule', + args.select, + args.where.id, + args.data, + 'UpdateLimitsModuleInput', + 'id', + 'limitsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "updateLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'updateLimitsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("LimitsModule", "deleteLimitsModule", "limitsModule", { - id: args.where.id - }, "DeleteLimitsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'LimitsModule', + 'deleteLimitsModule', + 'limitsModule', + { + id: args.where.id, + }, + 'DeleteLimitsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "deleteLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'deleteLimitsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/membershipTypesModule.ts b/sdk/constructive-react/src/modules/orm/models/membershipTypesModule.ts index 87f83a4f04..9eeb67961f 100644 --- a/sdk/constructive-react/src/modules/orm/models/membershipTypesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/membershipTypesModule.ts @@ -3,56 +3,98 @@ * @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 { MembershipTypesModule, MembershipTypesModuleWithRelations, MembershipTypesModuleSelect, MembershipTypesModuleFilter, MembershipTypesModuleOrderBy, CreateMembershipTypesModuleInput, UpdateMembershipTypesModuleInput, MembershipTypesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipTypesModule, + MembershipTypesModuleWithRelations, + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy, + CreateMembershipTypesModuleInput, + UpdateMembershipTypesModuleInput, + MembershipTypesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipTypesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - membershipTypesModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + membershipTypesModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipTypesModule", "membershipTypesModules", 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 - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + 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, + }, + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModules", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipTypesModule", "membershipTypesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModule", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class MembershipTypesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipTypesModule": data.membershipTypesModules?.nodes?.[0] ?? null - }) + membershipTypesModule: data.membershipTypesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipTypesModule", "membershipTypesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModule", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class MembershipTypesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipTypesModule": data.membershipTypesModules?.nodes?.[0] ?? null - }) + membershipTypesModule: data.membershipTypesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipTypesModule", "createMembershipTypesModule", "membershipTypesModule", args.select, args.data, "CreateMembershipTypesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipTypesModule', + 'createMembershipTypesModule', + 'membershipTypesModule', + args.select, + args.data, + 'CreateMembershipTypesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "createMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'createMembershipTypesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MembershipTypesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipTypesModule", "updateMembershipTypesModule", "membershipTypesModule", args.select, args.where.id, args.data, "UpdateMembershipTypesModuleInput", "id", "membershipTypesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipTypesModule', + 'updateMembershipTypesModule', + 'membershipTypesModule', + args.select, + args.where.id, + args.data, + 'UpdateMembershipTypesModuleInput', + 'id', + 'membershipTypesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "updateMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'updateMembershipTypesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipTypesModule", "deleteMembershipTypesModule", "membershipTypesModule", { - id: args.where.id - }, "DeleteMembershipTypesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipTypesModule', + 'deleteMembershipTypesModule', + 'membershipTypesModule', + { + id: args.where.id, + }, + 'DeleteMembershipTypesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "deleteMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'deleteMembershipTypesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/membershipsModule.ts b/sdk/constructive-react/src/modules/orm/models/membershipsModule.ts index ce4375291b..66b41bce21 100644 --- a/sdk/constructive-react/src/modules/orm/models/membershipsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/membershipsModule.ts @@ -3,56 +3,96 @@ * @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 { MembershipsModule, MembershipsModuleWithRelations, MembershipsModuleSelect, MembershipsModuleFilter, MembershipsModuleOrderBy, CreateMembershipsModuleInput, UpdateMembershipsModuleInput, MembershipsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipsModule, + MembershipsModuleWithRelations, + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy, + CreateMembershipsModuleInput, + UpdateMembershipsModuleInput, + MembershipsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipsModule", "membershipsModules", 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 - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipsModule', + 'membershipsModules', + 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, + }, + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModules", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipsModule", "membershipsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipsModule', + 'membershipsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModule", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MembershipsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipsModule": data.membershipsModules?.nodes?.[0] ?? null - }) + membershipsModule: data.membershipsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipsModule", "membershipsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipsModule', + 'membershipsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModule", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MembershipsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipsModule": data.membershipsModules?.nodes?.[0] ?? null - }) + membershipsModule: data.membershipsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipsModule", "createMembershipsModule", "membershipsModule", args.select, args.data, "CreateMembershipsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipsModule', + 'createMembershipsModule', + 'membershipsModule', + args.select, + args.data, + 'CreateMembershipsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "createMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'createMembershipsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MembershipsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipsModule", "updateMembershipsModule", "membershipsModule", args.select, args.where.id, args.data, "UpdateMembershipsModuleInput", "id", "membershipsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipsModule', + 'updateMembershipsModule', + 'membershipsModule', + args.select, + args.where.id, + args.data, + 'UpdateMembershipsModuleInput', + 'id', + 'membershipsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "updateMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'updateMembershipsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipsModule", "deleteMembershipsModule", "membershipsModule", { - id: args.where.id - }, "DeleteMembershipsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipsModule', + 'deleteMembershipsModule', + 'membershipsModule', + { + id: args.where.id, + }, + 'DeleteMembershipsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "deleteMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'deleteMembershipsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/merkleStoreModule.ts b/sdk/constructive-react/src/modules/orm/models/merkleStoreModule.ts index 3a6aa3c7c8..d3bb9d0c67 100644 --- a/sdk/constructive-react/src/modules/orm/models/merkleStoreModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/merkleStoreModule.ts @@ -3,56 +3,96 @@ * @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 { MerkleStoreModule, MerkleStoreModuleWithRelations, MerkleStoreModuleSelect, MerkleStoreModuleFilter, MerkleStoreModuleOrderBy, CreateMerkleStoreModuleInput, UpdateMerkleStoreModuleInput, MerkleStoreModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MerkleStoreModule, + MerkleStoreModuleWithRelations, + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy, + CreateMerkleStoreModuleInput, + UpdateMerkleStoreModuleInput, + MerkleStoreModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MerkleStoreModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MerkleStoreModule", "merkleStoreModules", 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 - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + 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, + }, + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModules", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MerkleStoreModule", "merkleStoreModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModule", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MerkleStoreModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "merkleStoreModule": data.merkleStoreModules?.nodes?.[0] ?? null - }) + merkleStoreModule: data.merkleStoreModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MerkleStoreModule", "merkleStoreModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModule", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MerkleStoreModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "merkleStoreModule": data.merkleStoreModules?.nodes?.[0] ?? null - }) + merkleStoreModule: data.merkleStoreModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MerkleStoreModule", "createMerkleStoreModule", "merkleStoreModule", args.select, args.data, "CreateMerkleStoreModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MerkleStoreModule', + 'createMerkleStoreModule', + 'merkleStoreModule', + args.select, + args.data, + 'CreateMerkleStoreModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "createMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'createMerkleStoreModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MerkleStoreModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MerkleStoreModule", "updateMerkleStoreModule", "merkleStoreModule", args.select, args.where.id, args.data, "UpdateMerkleStoreModuleInput", "id", "merkleStoreModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MerkleStoreModule', + 'updateMerkleStoreModule', + 'merkleStoreModule', + args.select, + args.where.id, + args.data, + 'UpdateMerkleStoreModuleInput', + 'id', + 'merkleStoreModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "updateMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'updateMerkleStoreModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MerkleStoreModule", "deleteMerkleStoreModule", "merkleStoreModule", { - id: args.where.id - }, "DeleteMerkleStoreModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MerkleStoreModule', + 'deleteMerkleStoreModule', + 'merkleStoreModule', + { + id: args.where.id, + }, + 'DeleteMerkleStoreModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "deleteMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'deleteMerkleStoreModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/namespaceModule.ts b/sdk/constructive-react/src/modules/orm/models/namespaceModule.ts index 582b808922..bd5c681504 100644 --- a/sdk/constructive-react/src/modules/orm/models/namespaceModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/namespaceModule.ts @@ -3,56 +3,96 @@ * @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 { NamespaceModule, NamespaceModuleWithRelations, NamespaceModuleSelect, NamespaceModuleFilter, NamespaceModuleOrderBy, CreateNamespaceModuleInput, UpdateNamespaceModuleInput, NamespaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceModule, + NamespaceModuleWithRelations, + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy, + CreateNamespaceModuleInput, + UpdateNamespaceModuleInput, + NamespaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceModule", "namespaceModules", 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 - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceModule', + 'namespaceModules', + 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, + }, + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModules", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceModule", "namespaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceModule', + 'namespaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModule", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceModule": data.namespaceModules?.nodes?.[0] ?? null - }) + namespaceModule: data.namespaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceModule", "namespaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceModule', + 'namespaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModule", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceModule": data.namespaceModules?.nodes?.[0] ?? null - }) + namespaceModule: data.namespaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceModule", "createNamespaceModule", "namespaceModule", args.select, args.data, "CreateNamespaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceModule', + 'createNamespaceModule', + 'namespaceModule', + args.select, + args.data, + 'CreateNamespaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "createNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'createNamespaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceModule", "updateNamespaceModule", "namespaceModule", args.select, args.where.id, args.data, "UpdateNamespaceModuleInput", "id", "namespaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceModule', + 'updateNamespaceModule', + 'namespaceModule', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceModuleInput', + 'id', + 'namespaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "updateNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'updateNamespaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceModule", "deleteNamespaceModule", "namespaceModule", { - id: args.where.id - }, "DeleteNamespaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceModule', + 'deleteNamespaceModule', + 'namespaceModule', + { + id: args.where.id, + }, + 'DeleteNamespaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "deleteNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'deleteNamespaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/notificationsModule.ts b/sdk/constructive-react/src/modules/orm/models/notificationsModule.ts index 2957519a06..a629d81108 100644 --- a/sdk/constructive-react/src/modules/orm/models/notificationsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/notificationsModule.ts @@ -3,56 +3,96 @@ * @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 { NotificationsModule, NotificationsModuleWithRelations, NotificationsModuleSelect, NotificationsModuleFilter, NotificationsModuleOrderBy, CreateNotificationsModuleInput, UpdateNotificationsModuleInput, NotificationsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NotificationsModule, + NotificationsModuleWithRelations, + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy, + CreateNotificationsModuleInput, + UpdateNotificationsModuleInput, + NotificationsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NotificationsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NotificationsModule", "notificationsModules", 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 - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NotificationsModule', + 'notificationsModules', + 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, + }, + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModules", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NotificationsModule", "notificationsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NotificationsModule', + 'notificationsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModule", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NotificationsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "notificationsModule": data.notificationsModules?.nodes?.[0] ?? null - }) + notificationsModule: data.notificationsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NotificationsModule", "notificationsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NotificationsModule', + 'notificationsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModule", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NotificationsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "notificationsModule": data.notificationsModules?.nodes?.[0] ?? null - }) + notificationsModule: data.notificationsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NotificationsModule", "createNotificationsModule", "notificationsModule", args.select, args.data, "CreateNotificationsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NotificationsModule', + 'createNotificationsModule', + 'notificationsModule', + args.select, + args.data, + 'CreateNotificationsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "createNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'createNotificationsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NotificationsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NotificationsModule", "updateNotificationsModule", "notificationsModule", args.select, args.where.id, args.data, "UpdateNotificationsModuleInput", "id", "notificationsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NotificationsModule', + 'updateNotificationsModule', + 'notificationsModule', + args.select, + args.where.id, + args.data, + 'UpdateNotificationsModuleInput', + 'id', + 'notificationsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "updateNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'updateNotificationsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NotificationsModule", "deleteNotificationsModule", "notificationsModule", { - id: args.where.id - }, "DeleteNotificationsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NotificationsModule', + 'deleteNotificationsModule', + 'notificationsModule', + { + id: args.where.id, + }, + 'DeleteNotificationsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "deleteNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'deleteNotificationsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/permissionsModule.ts b/sdk/constructive-react/src/modules/orm/models/permissionsModule.ts index 1b7e756241..2a330457b5 100644 --- a/sdk/constructive-react/src/modules/orm/models/permissionsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/permissionsModule.ts @@ -3,56 +3,96 @@ * @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 { PermissionsModule, PermissionsModuleWithRelations, PermissionsModuleSelect, PermissionsModuleFilter, PermissionsModuleOrderBy, CreatePermissionsModuleInput, UpdatePermissionsModuleInput, PermissionsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PermissionsModule, + PermissionsModuleWithRelations, + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy, + CreatePermissionsModuleInput, + UpdatePermissionsModuleInput, + PermissionsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PermissionsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PermissionsModule", "permissionsModules", 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 - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PermissionsModule', + 'permissionsModules', + 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, + }, + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModules", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PermissionsModule", "permissionsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PermissionsModule', + 'permissionsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModule", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PermissionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "permissionsModule": data.permissionsModules?.nodes?.[0] ?? null - }) + permissionsModule: data.permissionsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PermissionsModule", "permissionsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PermissionsModule', + 'permissionsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModule", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PermissionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "permissionsModule": data.permissionsModules?.nodes?.[0] ?? null - }) + permissionsModule: data.permissionsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PermissionsModule", "createPermissionsModule", "permissionsModule", args.select, args.data, "CreatePermissionsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PermissionsModule', + 'createPermissionsModule', + 'permissionsModule', + args.select, + args.data, + 'CreatePermissionsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "createPermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'createPermissionsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PermissionsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PermissionsModule", "updatePermissionsModule", "permissionsModule", args.select, args.where.id, args.data, "UpdatePermissionsModuleInput", "id", "permissionsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PermissionsModule', + 'updatePermissionsModule', + 'permissionsModule', + args.select, + args.where.id, + args.data, + 'UpdatePermissionsModuleInput', + 'id', + 'permissionsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "updatePermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'updatePermissionsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PermissionsModule", "deletePermissionsModule", "permissionsModule", { - id: args.where.id - }, "DeletePermissionsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PermissionsModule', + 'deletePermissionsModule', + 'permissionsModule', + { + id: args.where.id, + }, + 'DeletePermissionsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "deletePermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'deletePermissionsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/phoneNumbersModule.ts b/sdk/constructive-react/src/modules/orm/models/phoneNumbersModule.ts index ee3e5afa0f..42cbdfc98f 100644 --- a/sdk/constructive-react/src/modules/orm/models/phoneNumbersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/phoneNumbersModule.ts @@ -3,56 +3,96 @@ * @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 { PhoneNumbersModule, PhoneNumbersModuleWithRelations, PhoneNumbersModuleSelect, PhoneNumbersModuleFilter, PhoneNumbersModuleOrderBy, CreatePhoneNumbersModuleInput, UpdatePhoneNumbersModuleInput, PhoneNumbersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PhoneNumbersModule, + PhoneNumbersModuleWithRelations, + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy, + CreatePhoneNumbersModuleInput, + UpdatePhoneNumbersModuleInput, + PhoneNumbersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PhoneNumbersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumbersModule", "phoneNumbersModules", 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 - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + 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, + }, + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModules", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PhoneNumbersModule", "phoneNumbersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModule", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PhoneNumbersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumbersModule": data.phoneNumbersModules?.nodes?.[0] ?? null - }) + phoneNumbersModule: data.phoneNumbersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumbersModule", "phoneNumbersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModule", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PhoneNumbersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumbersModule": data.phoneNumbersModules?.nodes?.[0] ?? null - }) + phoneNumbersModule: data.phoneNumbersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PhoneNumbersModule", "createPhoneNumbersModule", "phoneNumbersModule", args.select, args.data, "CreatePhoneNumbersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PhoneNumbersModule', + 'createPhoneNumbersModule', + 'phoneNumbersModule', + args.select, + args.data, + 'CreatePhoneNumbersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "createPhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'createPhoneNumbersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PhoneNumbersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PhoneNumbersModule", "updatePhoneNumbersModule", "phoneNumbersModule", args.select, args.where.id, args.data, "UpdatePhoneNumbersModuleInput", "id", "phoneNumbersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PhoneNumbersModule', + 'updatePhoneNumbersModule', + 'phoneNumbersModule', + args.select, + args.where.id, + args.data, + 'UpdatePhoneNumbersModuleInput', + 'id', + 'phoneNumbersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "updatePhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'updatePhoneNumbersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PhoneNumbersModule", "deletePhoneNumbersModule", "phoneNumbersModule", { - id: args.where.id - }, "DeletePhoneNumbersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PhoneNumbersModule', + 'deletePhoneNumbersModule', + 'phoneNumbersModule', + { + id: args.where.id, + }, + 'DeletePhoneNumbersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "deletePhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'deletePhoneNumbersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/plansModule.ts b/sdk/constructive-react/src/modules/orm/models/plansModule.ts index aef90eafc2..545fbdd7cb 100644 --- a/sdk/constructive-react/src/modules/orm/models/plansModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/plansModule.ts @@ -3,56 +3,96 @@ * @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 { PlansModule, PlansModuleWithRelations, PlansModuleSelect, PlansModuleFilter, PlansModuleOrderBy, CreatePlansModuleInput, UpdatePlansModuleInput, PlansModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlansModule, + PlansModuleWithRelations, + PlansModuleSelect, + PlansModuleFilter, + PlansModuleOrderBy, + CreatePlansModuleInput, + UpdatePlansModuleInput, + PlansModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlansModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlansModule", "plansModules", 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 - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlansModule', + 'plansModules', + 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, + }, + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModules", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlansModule", "plansModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlansModule', + 'plansModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModule", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlansModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "plansModule": data.plansModules?.nodes?.[0] ?? null - }) + plansModule: data.plansModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlansModule", "plansModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlansModule', + 'plansModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModule", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlansModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "plansModule": data.plansModules?.nodes?.[0] ?? null - }) + plansModule: data.plansModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlansModule", "createPlansModule", "plansModule", args.select, args.data, "CreatePlansModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlansModule', + 'createPlansModule', + 'plansModule', + args.select, + args.data, + 'CreatePlansModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "createPlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'createPlansModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlansModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlansModule", "updatePlansModule", "plansModule", args.select, args.where.id, args.data, "UpdatePlansModuleInput", "id", "plansModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlansModule', + 'updatePlansModule', + 'plansModule', + args.select, + args.where.id, + args.data, + 'UpdatePlansModuleInput', + 'id', + 'plansModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "updatePlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'updatePlansModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlansModule", "deletePlansModule", "plansModule", { - id: args.where.id - }, "DeletePlansModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlansModule', + 'deletePlansModule', + 'plansModule', + { + id: args.where.id, + }, + 'DeletePlansModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "deletePlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'deletePlansModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/principalAuthModule.ts b/sdk/constructive-react/src/modules/orm/models/principalAuthModule.ts index fcf622bb0f..c0e9d913d3 100644 --- a/sdk/constructive-react/src/modules/orm/models/principalAuthModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/principalAuthModule.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalAuthModule": data.principalAuthModules?.nodes?.[0] ?? null - }) + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalAuthModule", "principalAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalAuthModuleFilter", "PrincipalAuthModuleOrderBy", connectionFieldsMap); + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalAuthModule", - fieldName: "principalAuthModule", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PrincipalAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalAuthModule": data.principalAuthModules?.nodes?.[0] ?? null - }) + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalAuthModule: { principalAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalAuthModule", "createPrincipalAuthModule", "principalAuthModule", args.select, args.data, "CreatePrincipalAuthModuleInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'createPrincipalAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'updatePrincipalAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'deletePrincipalAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/profilesModule.ts b/sdk/constructive-react/src/modules/orm/models/profilesModule.ts index 1fc4cff3fb..15d5a94e79 100644 --- a/sdk/constructive-react/src/modules/orm/models/profilesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/profilesModule.ts @@ -3,56 +3,96 @@ * @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 { ProfilesModule, ProfilesModuleWithRelations, ProfilesModuleSelect, ProfilesModuleFilter, ProfilesModuleOrderBy, CreateProfilesModuleInput, UpdateProfilesModuleInput, ProfilesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ProfilesModule, + ProfilesModuleWithRelations, + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy, + CreateProfilesModuleInput, + UpdateProfilesModuleInput, + ProfilesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ProfilesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ProfilesModule", "profilesModules", 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 - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ProfilesModule', + 'profilesModules', + 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, + }, + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModules", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ProfilesModule", "profilesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ProfilesModule', + 'profilesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModule", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ProfilesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "profilesModule": data.profilesModules?.nodes?.[0] ?? null - }) + profilesModule: data.profilesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ProfilesModule", "profilesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ProfilesModule', + 'profilesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModule", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ProfilesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "profilesModule": data.profilesModules?.nodes?.[0] ?? null - }) + profilesModule: data.profilesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ProfilesModule", "createProfilesModule", "profilesModule", args.select, args.data, "CreateProfilesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ProfilesModule', + 'createProfilesModule', + 'profilesModule', + args.select, + args.data, + 'CreateProfilesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "createProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'createProfilesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ProfilesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ProfilesModule", "updateProfilesModule", "profilesModule", args.select, args.where.id, args.data, "UpdateProfilesModuleInput", "id", "profilesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ProfilesModule', + 'updateProfilesModule', + 'profilesModule', + args.select, + args.where.id, + args.data, + 'UpdateProfilesModuleInput', + 'id', + 'profilesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "updateProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'updateProfilesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ProfilesModule", "deleteProfilesModule", "profilesModule", { - id: args.where.id - }, "DeleteProfilesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ProfilesModule', + 'deleteProfilesModule', + 'profilesModule', + { + id: args.where.id, + }, + 'DeleteProfilesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "deleteProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'deleteProfilesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/rateLimitMetersModule.ts b/sdk/constructive-react/src/modules/orm/models/rateLimitMetersModule.ts index cfa9903246..1205e581d8 100644 --- a/sdk/constructive-react/src/modules/orm/models/rateLimitMetersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/rateLimitMetersModule.ts @@ -3,56 +3,98 @@ * @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 { RateLimitMetersModule, RateLimitMetersModuleWithRelations, RateLimitMetersModuleSelect, RateLimitMetersModuleFilter, RateLimitMetersModuleOrderBy, CreateRateLimitMetersModuleInput, UpdateRateLimitMetersModuleInput, RateLimitMetersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RateLimitMetersModule, + RateLimitMetersModuleWithRelations, + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy, + CreateRateLimitMetersModuleInput, + UpdateRateLimitMetersModuleInput, + RateLimitMetersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RateLimitMetersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - rateLimitMetersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + rateLimitMetersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitMetersModule", "rateLimitMetersModules", 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 - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + 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, + }, + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModules", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitMetersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RateLimitMetersModule", "rateLimitMetersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModule", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class RateLimitMetersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitMetersModule": data.rateLimitMetersModules?.nodes?.[0] ?? null - }) + rateLimitMetersModule: data.rateLimitMetersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitMetersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitMetersModule", "rateLimitMetersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModule", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class RateLimitMetersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitMetersModule": data.rateLimitMetersModules?.nodes?.[0] ?? null - }) + rateLimitMetersModule: data.rateLimitMetersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RateLimitMetersModule", "createRateLimitMetersModule", "rateLimitMetersModule", args.select, args.data, "CreateRateLimitMetersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RateLimitMetersModule', + 'createRateLimitMetersModule', + 'rateLimitMetersModule', + args.select, + args.data, + 'CreateRateLimitMetersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "createRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'createRateLimitMetersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RateLimitMetersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RateLimitMetersModule", "updateRateLimitMetersModule", "rateLimitMetersModule", args.select, args.where.id, args.data, "UpdateRateLimitMetersModuleInput", "id", "rateLimitMetersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RateLimitMetersModule', + 'updateRateLimitMetersModule', + 'rateLimitMetersModule', + args.select, + args.where.id, + args.data, + 'UpdateRateLimitMetersModuleInput', + 'id', + 'rateLimitMetersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "updateRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'updateRateLimitMetersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RateLimitMetersModule", "deleteRateLimitMetersModule", "rateLimitMetersModule", { - id: args.where.id - }, "DeleteRateLimitMetersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RateLimitMetersModule', + 'deleteRateLimitMetersModule', + 'rateLimitMetersModule', + { + id: args.where.id, + }, + 'DeleteRateLimitMetersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "deleteRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'deleteRateLimitMetersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/rateLimitsModule.ts b/sdk/constructive-react/src/modules/orm/models/rateLimitsModule.ts index 854856d9e4..dbf9501696 100644 --- a/sdk/constructive-react/src/modules/orm/models/rateLimitsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/rateLimitsModule.ts @@ -3,56 +3,96 @@ * @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 { RateLimitsModule, RateLimitsModuleWithRelations, RateLimitsModuleSelect, RateLimitsModuleFilter, RateLimitsModuleOrderBy, CreateRateLimitsModuleInput, UpdateRateLimitsModuleInput, RateLimitsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RateLimitsModule, + RateLimitsModuleWithRelations, + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy, + CreateRateLimitsModuleInput, + UpdateRateLimitsModuleInput, + RateLimitsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RateLimitsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitsModule", "rateLimitsModules", 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 - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RateLimitsModule', + 'rateLimitsModules', + 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, + }, + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModules", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RateLimitsModule", "rateLimitsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RateLimitsModule', + 'rateLimitsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModule", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RateLimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitsModule": data.rateLimitsModules?.nodes?.[0] ?? null - }) + rateLimitsModule: data.rateLimitsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitsModule", "rateLimitsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RateLimitsModule', + 'rateLimitsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModule", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RateLimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitsModule": data.rateLimitsModules?.nodes?.[0] ?? null - }) + rateLimitsModule: data.rateLimitsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RateLimitsModule", "createRateLimitsModule", "rateLimitsModule", args.select, args.data, "CreateRateLimitsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RateLimitsModule', + 'createRateLimitsModule', + 'rateLimitsModule', + args.select, + args.data, + 'CreateRateLimitsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "createRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'createRateLimitsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RateLimitsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RateLimitsModule", "updateRateLimitsModule", "rateLimitsModule", args.select, args.where.id, args.data, "UpdateRateLimitsModuleInput", "id", "rateLimitsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RateLimitsModule', + 'updateRateLimitsModule', + 'rateLimitsModule', + args.select, + args.where.id, + args.data, + 'UpdateRateLimitsModuleInput', + 'id', + 'rateLimitsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "updateRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'updateRateLimitsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RateLimitsModule", "deleteRateLimitsModule", "rateLimitsModule", { - id: args.where.id - }, "DeleteRateLimitsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RateLimitsModule', + 'deleteRateLimitsModule', + 'rateLimitsModule', + { + id: args.where.id, + }, + 'DeleteRateLimitsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "deleteRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'deleteRateLimitsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/realtimeModule.ts b/sdk/constructive-react/src/modules/orm/models/realtimeModule.ts index a7be0753e0..2cb1075457 100644 --- a/sdk/constructive-react/src/modules/orm/models/realtimeModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/realtimeModule.ts @@ -3,56 +3,96 @@ * @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 { RealtimeModule, RealtimeModuleWithRelations, RealtimeModuleSelect, RealtimeModuleFilter, RealtimeModuleOrderBy, CreateRealtimeModuleInput, UpdateRealtimeModuleInput, RealtimeModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RealtimeModule, + RealtimeModuleWithRelations, + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy, + CreateRealtimeModuleInput, + UpdateRealtimeModuleInput, + RealtimeModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RealtimeModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RealtimeModule", "realtimeModules", 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 - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RealtimeModule', + 'realtimeModules', + 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, + }, + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModules", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RealtimeModule", "realtimeModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RealtimeModule', + 'realtimeModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModule", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RealtimeModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "realtimeModule": data.realtimeModules?.nodes?.[0] ?? null - }) + realtimeModule: data.realtimeModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RealtimeModule", "realtimeModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RealtimeModule', + 'realtimeModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModule", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RealtimeModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "realtimeModule": data.realtimeModules?.nodes?.[0] ?? null - }) + realtimeModule: data.realtimeModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RealtimeModule", "createRealtimeModule", "realtimeModule", args.select, args.data, "CreateRealtimeModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RealtimeModule', + 'createRealtimeModule', + 'realtimeModule', + args.select, + args.data, + 'CreateRealtimeModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "createRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'createRealtimeModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RealtimeModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RealtimeModule", "updateRealtimeModule", "realtimeModule", args.select, args.where.id, args.data, "UpdateRealtimeModuleInput", "id", "realtimeModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RealtimeModule', + 'updateRealtimeModule', + 'realtimeModule', + args.select, + args.where.id, + args.data, + 'UpdateRealtimeModuleInput', + 'id', + 'realtimeModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "updateRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'updateRealtimeModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RealtimeModule", "deleteRealtimeModule", "realtimeModule", { - id: args.where.id - }, "DeleteRealtimeModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RealtimeModule', + 'deleteRealtimeModule', + 'realtimeModule', + { + id: args.where.id, + }, + 'DeleteRealtimeModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "deleteRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'deleteRealtimeModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/relationProvision.ts b/sdk/constructive-react/src/modules/orm/models/relationProvision.ts index 267d8855f3..c8bc481ca9 100644 --- a/sdk/constructive-react/src/modules/orm/models/relationProvision.ts +++ b/sdk/constructive-react/src/modules/orm/models/relationProvision.ts @@ -3,56 +3,96 @@ * @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 { RelationProvision, RelationProvisionWithRelations, RelationProvisionSelect, RelationProvisionFilter, RelationProvisionOrderBy, CreateRelationProvisionInput, UpdateRelationProvisionInput, RelationProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RelationProvision, + RelationProvisionWithRelations, + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy, + CreateRelationProvisionInput, + UpdateRelationProvisionInput, + RelationProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RelationProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvisions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RelationProvision", "relationProvisions", 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 - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RelationProvision', + 'relationProvisions', + 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, + }, + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvisions", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RelationProvision", "relationProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RelationProvision', + 'relationProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvision", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvision', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RelationProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "relationProvision": data.relationProvisions?.nodes?.[0] ?? null - }) + relationProvision: data.relationProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RelationProvision", "relationProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RelationProvision', + 'relationProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvision", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvision', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RelationProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "relationProvision": data.relationProvisions?.nodes?.[0] ?? null - }) + relationProvision: data.relationProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RelationProvision", "createRelationProvision", "relationProvision", args.select, args.data, "CreateRelationProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RelationProvision', + 'createRelationProvision', + 'relationProvision', + args.select, + args.data, + 'CreateRelationProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "createRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'createRelationProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RelationProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RelationProvision", "updateRelationProvision", "relationProvision", args.select, args.where.id, args.data, "UpdateRelationProvisionInput", "id", "relationProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RelationProvision', + 'updateRelationProvision', + 'relationProvision', + args.select, + args.where.id, + args.data, + 'UpdateRelationProvisionInput', + 'id', + 'relationProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "updateRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'updateRelationProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RelationProvision", "deleteRelationProvision", "relationProvision", { - id: args.where.id - }, "DeleteRelationProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RelationProvision', + 'deleteRelationProvision', + 'relationProvision', + { + id: args.where.id, + }, + 'DeleteRelationProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "deleteRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'deleteRelationProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/resourceModule.ts b/sdk/constructive-react/src/modules/orm/models/resourceModule.ts index 9f1e49821a..8fef54a24a 100644 --- a/sdk/constructive-react/src/modules/orm/models/resourceModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/resourceModule.ts @@ -3,56 +3,96 @@ * @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 { ResourceModule, ResourceModuleWithRelations, ResourceModuleSelect, ResourceModuleFilter, ResourceModuleOrderBy, CreateResourceModuleInput, UpdateResourceModuleInput, ResourceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceModule, + ResourceModuleWithRelations, + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy, + CreateResourceModuleInput, + UpdateResourceModuleInput, + ResourceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceModule", "resourceModules", 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 - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceModule', + 'resourceModules', + 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, + }, + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModules", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceModule", "resourceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceModule', + 'resourceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModule", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceModule": data.resourceModules?.nodes?.[0] ?? null - }) + resourceModule: data.resourceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceModule", "resourceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceModule', + 'resourceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModule", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceModule": data.resourceModules?.nodes?.[0] ?? null - }) + resourceModule: data.resourceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceModule", "createResourceModule", "resourceModule", args.select, args.data, "CreateResourceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceModule', + 'createResourceModule', + 'resourceModule', + args.select, + args.data, + 'CreateResourceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "createResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'createResourceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceModule", "updateResourceModule", "resourceModule", args.select, args.where.id, args.data, "UpdateResourceModuleInput", "id", "resourceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceModule', + 'updateResourceModule', + 'resourceModule', + args.select, + args.where.id, + args.data, + 'UpdateResourceModuleInput', + 'id', + 'resourceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "updateResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'updateResourceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceModule", "deleteResourceModule", "resourceModule", { - id: args.where.id - }, "DeleteResourceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceModule', + 'deleteResourceModule', + 'resourceModule', + { + id: args.where.id, + }, + 'DeleteResourceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "deleteResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'deleteResourceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/rlsModule.ts b/sdk/constructive-react/src/modules/orm/models/rlsModule.ts index 5d167b4465..6a1c7cae75 100644 --- a/sdk/constructive-react/src/modules/orm/models/rlsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/rlsModule.ts @@ -3,56 +3,96 @@ * @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 { RlsModule, RlsModuleWithRelations, RlsModuleSelect, RlsModuleFilter, RlsModuleOrderBy, CreateRlsModuleInput, UpdateRlsModuleInput, RlsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RlsModule, + RlsModuleWithRelations, + RlsModuleSelect, + RlsModuleFilter, + RlsModuleOrderBy, + CreateRlsModuleInput, + UpdateRlsModuleInput, + RlsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RlsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RlsModule", "rlsModules", 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 - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RlsModule', + 'rlsModules', + 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, + }, + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModules", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RlsModule", "rlsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RlsModule', + 'rlsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModule", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RlsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsModule": data.rlsModules?.nodes?.[0] ?? null - }) + rlsModule: data.rlsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RlsModule", "rlsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RlsModule', + 'rlsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModule", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RlsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsModule": data.rlsModules?.nodes?.[0] ?? null - }) + rlsModule: data.rlsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RlsModule", "createRlsModule", "rlsModule", args.select, args.data, "CreateRlsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RlsModule', + 'createRlsModule', + 'rlsModule', + args.select, + args.data, + 'CreateRlsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "createRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'createRlsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RlsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RlsModule", "updateRlsModule", "rlsModule", args.select, args.where.id, args.data, "UpdateRlsModuleInput", "id", "rlsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RlsModule', + 'updateRlsModule', + 'rlsModule', + args.select, + args.where.id, + args.data, + 'UpdateRlsModuleInput', + 'id', + 'rlsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "updateRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'updateRlsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RlsModule", "deleteRlsModule", "rlsModule", { - id: args.where.id - }, "DeleteRlsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RlsModule', + 'deleteRlsModule', + 'rlsModule', + { + id: args.where.id, + }, + 'DeleteRlsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "deleteRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'deleteRlsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/routeModule.ts b/sdk/constructive-react/src/modules/orm/models/routeModule.ts index d663444fdb..d57b13ceac 100644 --- a/sdk/constructive-react/src/modules/orm/models/routeModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/routeModule.ts @@ -3,56 +3,96 @@ * @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 { RouteModule, RouteModuleWithRelations, RouteModuleSelect, RouteModuleFilter, RouteModuleOrderBy, CreateRouteModuleInput, UpdateRouteModuleInput, RouteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RouteModule, + RouteModuleWithRelations, + RouteModuleSelect, + RouteModuleFilter, + RouteModuleOrderBy, + CreateRouteModuleInput, + UpdateRouteModuleInput, + RouteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RouteModule", "routeModules", 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 - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RouteModule', + 'routeModules', + 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, + }, + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModules", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RouteModule", "routeModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RouteModule', + 'routeModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModule", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeModule": data.routeModules?.nodes?.[0] ?? null - }) + routeModule: data.routeModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RouteModule", "routeModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RouteModule', + 'routeModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModule", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeModule": data.routeModules?.nodes?.[0] ?? null - }) + routeModule: data.routeModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RouteModule", "createRouteModule", "routeModule", args.select, args.data, "CreateRouteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RouteModule', + 'createRouteModule', + 'routeModule', + args.select, + args.data, + 'CreateRouteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "createRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'createRouteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RouteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RouteModule", "updateRouteModule", "routeModule", args.select, args.where.id, args.data, "UpdateRouteModuleInput", "id", "routeModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RouteModule', + 'updateRouteModule', + 'routeModule', + args.select, + args.where.id, + args.data, + 'UpdateRouteModuleInput', + 'id', + 'routeModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "updateRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'updateRouteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RouteModule", "deleteRouteModule", "routeModule", { - id: args.where.id - }, "DeleteRouteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RouteModule', + 'deleteRouteModule', + 'routeModule', + { + id: args.where.id, + }, + 'DeleteRouteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "deleteRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'deleteRouteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/secureTableProvision.ts b/sdk/constructive-react/src/modules/orm/models/secureTableProvision.ts index d96900112a..88e10489d0 100644 --- a/sdk/constructive-react/src/modules/orm/models/secureTableProvision.ts +++ b/sdk/constructive-react/src/modules/orm/models/secureTableProvision.ts @@ -3,56 +3,98 @@ * @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 { SecureTableProvision, SecureTableProvisionWithRelations, SecureTableProvisionSelect, SecureTableProvisionFilter, SecureTableProvisionOrderBy, CreateSecureTableProvisionInput, UpdateSecureTableProvisionInput, SecureTableProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SecureTableProvision, + SecureTableProvisionWithRelations, + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy, + CreateSecureTableProvisionInput, + UpdateSecureTableProvisionInput, + SecureTableProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SecureTableProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - secureTableProvisions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secureTableProvisions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("SecureTableProvision", "secureTableProvisions", 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 - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SecureTableProvision', + 'secureTableProvisions', + 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, + }, + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvisions", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secureTableProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SecureTableProvision", "secureTableProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SecureTableProvision', + 'secureTableProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvision", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvision', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class SecureTableProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "secureTableProvision": data.secureTableProvisions?.nodes?.[0] ?? null - }) + secureTableProvision: data.secureTableProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ secureTableProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SecureTableProvision", "secureTableProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SecureTableProvision', + 'secureTableProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvision", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvision', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class SecureTableProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "secureTableProvision": data.secureTableProvisions?.nodes?.[0] ?? null - }) + secureTableProvision: data.secureTableProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SecureTableProvision", "createSecureTableProvision", "secureTableProvision", args.select, args.data, "CreateSecureTableProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SecureTableProvision', + 'createSecureTableProvision', + 'secureTableProvision', + args.select, + args.data, + 'CreateSecureTableProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "createSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'createSecureTableProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SecureTableProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SecureTableProvision", "updateSecureTableProvision", "secureTableProvision", args.select, args.where.id, args.data, "UpdateSecureTableProvisionInput", "id", "secureTableProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SecureTableProvision', + 'updateSecureTableProvision', + 'secureTableProvision', + args.select, + args.where.id, + args.data, + 'UpdateSecureTableProvisionInput', + 'id', + 'secureTableProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "updateSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'updateSecureTableProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SecureTableProvision", "deleteSecureTableProvision", "secureTableProvision", { - id: args.where.id - }, "DeleteSecureTableProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SecureTableProvision', + 'deleteSecureTableProvision', + 'secureTableProvision', + { + id: args.where.id, + }, + 'DeleteSecureTableProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "deleteSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'deleteSecureTableProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/sessionSecretsModule.ts b/sdk/constructive-react/src/modules/orm/models/sessionSecretsModule.ts index af5fbcd6f4..9460af6349 100644 --- a/sdk/constructive-react/src/modules/orm/models/sessionSecretsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/sessionSecretsModule.ts @@ -3,56 +3,98 @@ * @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 { SessionSecretsModule, SessionSecretsModuleWithRelations, SessionSecretsModuleSelect, SessionSecretsModuleFilter, SessionSecretsModuleOrderBy, CreateSessionSecretsModuleInput, UpdateSessionSecretsModuleInput, SessionSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SessionSecretsModule, + SessionSecretsModuleWithRelations, + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy, + CreateSessionSecretsModuleInput, + UpdateSessionSecretsModuleInput, + SessionSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SessionSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - sessionSecretsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + sessionSecretsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("SessionSecretsModule", "sessionSecretsModules", 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 - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + 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, + }, + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModules", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SessionSecretsModule", "sessionSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModule", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class SessionSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionSecretsModule": data.sessionSecretsModules?.nodes?.[0] ?? null - }) + sessionSecretsModule: data.sessionSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SessionSecretsModule", "sessionSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModule", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class SessionSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionSecretsModule": data.sessionSecretsModules?.nodes?.[0] ?? null - }) + sessionSecretsModule: data.sessionSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SessionSecretsModule", "createSessionSecretsModule", "sessionSecretsModule", args.select, args.data, "CreateSessionSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SessionSecretsModule', + 'createSessionSecretsModule', + 'sessionSecretsModule', + args.select, + args.data, + 'CreateSessionSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "createSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'createSessionSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SessionSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SessionSecretsModule", "updateSessionSecretsModule", "sessionSecretsModule", args.select, args.where.id, args.data, "UpdateSessionSecretsModuleInput", "id", "sessionSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SessionSecretsModule', + 'updateSessionSecretsModule', + 'sessionSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateSessionSecretsModuleInput', + 'id', + 'sessionSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "updateSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'updateSessionSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SessionSecretsModule", "deleteSessionSecretsModule", "sessionSecretsModule", { - id: args.where.id - }, "DeleteSessionSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SessionSecretsModule', + 'deleteSessionSecretsModule', + 'sessionSecretsModule', + { + id: args.where.id, + }, + 'DeleteSessionSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "deleteSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'deleteSessionSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/sessionsModule.ts b/sdk/constructive-react/src/modules/orm/models/sessionsModule.ts index 1b90af533a..324773df9f 100644 --- a/sdk/constructive-react/src/modules/orm/models/sessionsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/sessionsModule.ts @@ -3,56 +3,96 @@ * @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 { SessionsModule, SessionsModuleWithRelations, SessionsModuleSelect, SessionsModuleFilter, SessionsModuleOrderBy, CreateSessionsModuleInput, UpdateSessionsModuleInput, SessionsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SessionsModule, + SessionsModuleWithRelations, + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy, + CreateSessionsModuleInput, + UpdateSessionsModuleInput, + SessionsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SessionsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SessionsModule", "sessionsModules", 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 - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SessionsModule', + 'sessionsModules', + 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, + }, + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModules", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SessionsModule", "sessionsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SessionsModule', + 'sessionsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModule", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SessionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionsModule": data.sessionsModules?.nodes?.[0] ?? null - }) + sessionsModule: data.sessionsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SessionsModule", "sessionsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SessionsModule', + 'sessionsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModule", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SessionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionsModule": data.sessionsModules?.nodes?.[0] ?? null - }) + sessionsModule: data.sessionsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SessionsModule", "createSessionsModule", "sessionsModule", args.select, args.data, "CreateSessionsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SessionsModule', + 'createSessionsModule', + 'sessionsModule', + args.select, + args.data, + 'CreateSessionsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "createSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'createSessionsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SessionsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SessionsModule", "updateSessionsModule", "sessionsModule", args.select, args.where.id, args.data, "UpdateSessionsModuleInput", "id", "sessionsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SessionsModule', + 'updateSessionsModule', + 'sessionsModule', + args.select, + args.where.id, + args.data, + 'UpdateSessionsModuleInput', + 'id', + 'sessionsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "updateSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'updateSessionsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SessionsModule", "deleteSessionsModule", "sessionsModule", { - id: args.where.id - }, "DeleteSessionsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SessionsModule', + 'deleteSessionsModule', + 'sessionsModule', + { + id: args.where.id, + }, + 'DeleteSessionsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "deleteSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'deleteSessionsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/siteSurfaceModule.ts b/sdk/constructive-react/src/modules/orm/models/siteSurfaceModule.ts index 032b2d2cd5..891f21403a 100644 --- a/sdk/constructive-react/src/modules/orm/models/siteSurfaceModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/siteSurfaceModule.ts @@ -3,56 +3,96 @@ * @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 { SiteSurfaceModule, SiteSurfaceModuleWithRelations, SiteSurfaceModuleSelect, SiteSurfaceModuleFilter, SiteSurfaceModuleOrderBy, CreateSiteSurfaceModuleInput, UpdateSiteSurfaceModuleInput, SiteSurfaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteSurfaceModule, + SiteSurfaceModuleWithRelations, + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy, + CreateSiteSurfaceModuleInput, + UpdateSiteSurfaceModuleInput, + SiteSurfaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteSurfaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteSurfaceModule", "siteSurfaceModules", 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 - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + 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, + }, + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModules", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteSurfaceModule", "siteSurfaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModule", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteSurfaceModule": data.siteSurfaceModules?.nodes?.[0] ?? null - }) + siteSurfaceModule: data.siteSurfaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteSurfaceModule", "siteSurfaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModule", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteSurfaceModule": data.siteSurfaceModules?.nodes?.[0] ?? null - }) + siteSurfaceModule: data.siteSurfaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteSurfaceModule", "createSiteSurfaceModule", "siteSurfaceModule", args.select, args.data, "CreateSiteSurfaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteSurfaceModule', + 'createSiteSurfaceModule', + 'siteSurfaceModule', + args.select, + args.data, + 'CreateSiteSurfaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "createSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'createSiteSurfaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteSurfaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteSurfaceModule", "updateSiteSurfaceModule", "siteSurfaceModule", args.select, args.where.id, args.data, "UpdateSiteSurfaceModuleInput", "id", "siteSurfaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteSurfaceModule', + 'updateSiteSurfaceModule', + 'siteSurfaceModule', + args.select, + args.where.id, + args.data, + 'UpdateSiteSurfaceModuleInput', + 'id', + 'siteSurfaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "updateSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'updateSiteSurfaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteSurfaceModule", "deleteSiteSurfaceModule", "siteSurfaceModule", { - id: args.where.id - }, "DeleteSiteSurfaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteSurfaceModule', + 'deleteSiteSurfaceModule', + 'siteSurfaceModule', + { + id: args.where.id, + }, + 'DeleteSiteSurfaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "deleteSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'deleteSiteSurfaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/storageLogModule.ts b/sdk/constructive-react/src/modules/orm/models/storageLogModule.ts index e94ce03e99..a53edf15d1 100644 --- a/sdk/constructive-react/src/modules/orm/models/storageLogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/storageLogModule.ts @@ -3,56 +3,96 @@ * @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 { StorageLogModule, StorageLogModuleWithRelations, StorageLogModuleSelect, StorageLogModuleFilter, StorageLogModuleOrderBy, CreateStorageLogModuleInput, UpdateStorageLogModuleInput, StorageLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + StorageLogModule, + StorageLogModuleWithRelations, + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy, + CreateStorageLogModuleInput, + UpdateStorageLogModuleInput, + StorageLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StorageLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("StorageLogModule", "storageLogModules", 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 - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'StorageLogModule', + 'storageLogModules', + 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, + }, + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModules", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("StorageLogModule", "storageLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'StorageLogModule', + 'storageLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModule", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StorageLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageLogModule": data.storageLogModules?.nodes?.[0] ?? null - }) + storageLogModule: data.storageLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("StorageLogModule", "storageLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'StorageLogModule', + 'storageLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModule", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StorageLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageLogModule": data.storageLogModules?.nodes?.[0] ?? null - }) + storageLogModule: data.storageLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("StorageLogModule", "createStorageLogModule", "storageLogModule", args.select, args.data, "CreateStorageLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'StorageLogModule', + 'createStorageLogModule', + 'storageLogModule', + args.select, + args.data, + 'CreateStorageLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "createStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'createStorageLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorageLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("StorageLogModule", "updateStorageLogModule", "storageLogModule", args.select, args.where.id, args.data, "UpdateStorageLogModuleInput", "id", "storageLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'StorageLogModule', + 'updateStorageLogModule', + 'storageLogModule', + args.select, + args.where.id, + args.data, + 'UpdateStorageLogModuleInput', + 'id', + 'storageLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "updateStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'updateStorageLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("StorageLogModule", "deleteStorageLogModule", "storageLogModule", { - id: args.where.id - }, "DeleteStorageLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'StorageLogModule', + 'deleteStorageLogModule', + 'storageLogModule', + { + id: args.where.id, + }, + 'DeleteStorageLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "deleteStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'deleteStorageLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/storageModule.ts b/sdk/constructive-react/src/modules/orm/models/storageModule.ts index 05877e81a0..f69dd6e624 100644 --- a/sdk/constructive-react/src/modules/orm/models/storageModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/storageModule.ts @@ -3,56 +3,96 @@ * @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 { StorageModule, StorageModuleWithRelations, StorageModuleSelect, StorageModuleFilter, StorageModuleOrderBy, CreateStorageModuleInput, UpdateStorageModuleInput, StorageModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + StorageModule, + StorageModuleWithRelations, + StorageModuleSelect, + StorageModuleFilter, + StorageModuleOrderBy, + CreateStorageModuleInput, + UpdateStorageModuleInput, + StorageModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StorageModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("StorageModule", "storageModules", 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 - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'StorageModule', + 'storageModules', + 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, + }, + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModules", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("StorageModule", "storageModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'StorageModule', + 'storageModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModule", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StorageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageModule": data.storageModules?.nodes?.[0] ?? null - }) + storageModule: data.storageModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("StorageModule", "storageModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'StorageModule', + 'storageModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModule", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StorageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageModule": data.storageModules?.nodes?.[0] ?? null - }) + storageModule: data.storageModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("StorageModule", "createStorageModule", "storageModule", args.select, args.data, "CreateStorageModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'StorageModule', + 'createStorageModule', + 'storageModule', + args.select, + args.data, + 'CreateStorageModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "createStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'createStorageModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorageModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("StorageModule", "updateStorageModule", "storageModule", args.select, args.where.id, args.data, "UpdateStorageModuleInput", "id", "storageModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'StorageModule', + 'updateStorageModule', + 'storageModule', + args.select, + args.where.id, + args.data, + 'UpdateStorageModuleInput', + 'id', + 'storageModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "updateStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'updateStorageModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("StorageModule", "deleteStorageModule", "storageModule", { - id: args.where.id - }, "DeleteStorageModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'StorageModule', + 'deleteStorageModule', + 'storageModule', + { + id: args.where.id, + }, + 'DeleteStorageModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "deleteStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'deleteStorageModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/transferLogModule.ts b/sdk/constructive-react/src/modules/orm/models/transferLogModule.ts index 6c929a1b6b..cab2bec096 100644 --- a/sdk/constructive-react/src/modules/orm/models/transferLogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/transferLogModule.ts @@ -3,56 +3,96 @@ * @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 { TransferLogModule, TransferLogModuleWithRelations, TransferLogModuleSelect, TransferLogModuleFilter, TransferLogModuleOrderBy, CreateTransferLogModuleInput, UpdateTransferLogModuleInput, TransferLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TransferLogModule, + TransferLogModuleWithRelations, + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy, + CreateTransferLogModuleInput, + UpdateTransferLogModuleInput, + TransferLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TransferLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TransferLogModule", "transferLogModules", 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 - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TransferLogModule', + 'transferLogModules', + 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, + }, + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModules", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TransferLogModule", "transferLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TransferLogModule', + 'transferLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModule", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TransferLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "transferLogModule": data.transferLogModules?.nodes?.[0] ?? null - }) + transferLogModule: data.transferLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TransferLogModule", "transferLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TransferLogModule', + 'transferLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModule", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TransferLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "transferLogModule": data.transferLogModules?.nodes?.[0] ?? null - }) + transferLogModule: data.transferLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TransferLogModule", "createTransferLogModule", "transferLogModule", args.select, args.data, "CreateTransferLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TransferLogModule', + 'createTransferLogModule', + 'transferLogModule', + args.select, + args.data, + 'CreateTransferLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "createTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'createTransferLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TransferLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TransferLogModule", "updateTransferLogModule", "transferLogModule", args.select, args.where.id, args.data, "UpdateTransferLogModuleInput", "id", "transferLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TransferLogModule', + 'updateTransferLogModule', + 'transferLogModule', + args.select, + args.where.id, + args.data, + 'UpdateTransferLogModuleInput', + 'id', + 'transferLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "updateTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'updateTransferLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TransferLogModule", "deleteTransferLogModule", "transferLogModule", { - id: args.where.id - }, "DeleteTransferLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TransferLogModule', + 'deleteTransferLogModule', + 'transferLogModule', + { + id: args.where.id, + }, + 'DeleteTransferLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "deleteTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'deleteTransferLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/userAuthModule.ts b/sdk/constructive-react/src/modules/orm/models/userAuthModule.ts index edc18d6631..341885e14c 100644 --- a/sdk/constructive-react/src/modules/orm/models/userAuthModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/userAuthModule.ts @@ -3,56 +3,96 @@ * @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 { UserAuthModule, UserAuthModuleWithRelations, UserAuthModuleSelect, UserAuthModuleFilter, UserAuthModuleOrderBy, CreateUserAuthModuleInput, UpdateUserAuthModuleInput, UserAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserAuthModule, + UserAuthModuleWithRelations, + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy, + CreateUserAuthModuleInput, + UpdateUserAuthModuleInput, + UserAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserAuthModule", "userAuthModules", 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 - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserAuthModule', + 'userAuthModules', + 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, + }, + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModules", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserAuthModule", "userAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserAuthModule', + 'userAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModule", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userAuthModule": data.userAuthModules?.nodes?.[0] ?? null - }) + userAuthModule: data.userAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserAuthModule", "userAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserAuthModule', + 'userAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModule", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userAuthModule": data.userAuthModules?.nodes?.[0] ?? null - }) + userAuthModule: data.userAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserAuthModule", "createUserAuthModule", "userAuthModule", args.select, args.data, "CreateUserAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserAuthModule', + 'createUserAuthModule', + 'userAuthModule', + args.select, + args.data, + 'CreateUserAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "createUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'createUserAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserAuthModule", "updateUserAuthModule", "userAuthModule", args.select, args.where.id, args.data, "UpdateUserAuthModuleInput", "id", "userAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserAuthModule', + 'updateUserAuthModule', + 'userAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateUserAuthModuleInput', + 'id', + 'userAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "updateUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'updateUserAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserAuthModule", "deleteUserAuthModule", "userAuthModule", { - id: args.where.id - }, "DeleteUserAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserAuthModule', + 'deleteUserAuthModule', + 'userAuthModule', + { + id: args.where.id, + }, + 'DeleteUserAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "deleteUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'deleteUserAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/userCredentialsModule.ts b/sdk/constructive-react/src/modules/orm/models/userCredentialsModule.ts index 64bd269be4..9e9bc0b2aa 100644 --- a/sdk/constructive-react/src/modules/orm/models/userCredentialsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/userCredentialsModule.ts @@ -3,56 +3,98 @@ * @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 { UserCredentialsModule, UserCredentialsModuleWithRelations, UserCredentialsModuleSelect, UserCredentialsModuleFilter, UserCredentialsModuleOrderBy, CreateUserCredentialsModuleInput, UpdateUserCredentialsModuleInput, UserCredentialsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserCredentialsModule, + UserCredentialsModuleWithRelations, + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy, + CreateUserCredentialsModuleInput, + UpdateUserCredentialsModuleInput, + UserCredentialsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserCredentialsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - userCredentialsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + userCredentialsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("UserCredentialsModule", "userCredentialsModules", 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 - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + 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, + }, + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModules", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserCredentialsModule", "userCredentialsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModule", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class UserCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userCredentialsModule": data.userCredentialsModules?.nodes?.[0] ?? null - }) + userCredentialsModule: data.userCredentialsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserCredentialsModule", "userCredentialsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModule", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class UserCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userCredentialsModule": data.userCredentialsModules?.nodes?.[0] ?? null - }) + userCredentialsModule: data.userCredentialsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserCredentialsModule", "createUserCredentialsModule", "userCredentialsModule", args.select, args.data, "CreateUserCredentialsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserCredentialsModule', + 'createUserCredentialsModule', + 'userCredentialsModule', + args.select, + args.data, + 'CreateUserCredentialsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "createUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'createUserCredentialsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserCredentialsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserCredentialsModule", "updateUserCredentialsModule", "userCredentialsModule", args.select, args.where.id, args.data, "UpdateUserCredentialsModuleInput", "id", "userCredentialsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserCredentialsModule', + 'updateUserCredentialsModule', + 'userCredentialsModule', + args.select, + args.where.id, + args.data, + 'UpdateUserCredentialsModuleInput', + 'id', + 'userCredentialsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "updateUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'updateUserCredentialsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserCredentialsModule", "deleteUserCredentialsModule", "userCredentialsModule", { - id: args.where.id - }, "DeleteUserCredentialsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserCredentialsModule', + 'deleteUserCredentialsModule', + 'userCredentialsModule', + { + id: args.where.id, + }, + 'DeleteUserCredentialsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "deleteUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'deleteUserCredentialsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/userSettingsModule.ts b/sdk/constructive-react/src/modules/orm/models/userSettingsModule.ts index 4452bc7186..252d0cc8bf 100644 --- a/sdk/constructive-react/src/modules/orm/models/userSettingsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/userSettingsModule.ts @@ -3,56 +3,96 @@ * @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 { UserSettingsModule, UserSettingsModuleWithRelations, UserSettingsModuleSelect, UserSettingsModuleFilter, UserSettingsModuleOrderBy, CreateUserSettingsModuleInput, UpdateUserSettingsModuleInput, UserSettingsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserSettingsModule, + UserSettingsModuleWithRelations, + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy, + CreateUserSettingsModuleInput, + UpdateUserSettingsModuleInput, + UserSettingsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserSettingsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserSettingsModule", "userSettingsModules", 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 - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserSettingsModule', + 'userSettingsModules', + 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, + }, + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModules", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserSettingsModule", "userSettingsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserSettingsModule', + 'userSettingsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModule", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userSettingsModule": data.userSettingsModules?.nodes?.[0] ?? null - }) + userSettingsModule: data.userSettingsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserSettingsModule", "userSettingsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserSettingsModule', + 'userSettingsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModule", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userSettingsModule": data.userSettingsModules?.nodes?.[0] ?? null - }) + userSettingsModule: data.userSettingsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserSettingsModule", "createUserSettingsModule", "userSettingsModule", args.select, args.data, "CreateUserSettingsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserSettingsModule', + 'createUserSettingsModule', + 'userSettingsModule', + args.select, + args.data, + 'CreateUserSettingsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "createUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'createUserSettingsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserSettingsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserSettingsModule", "updateUserSettingsModule", "userSettingsModule", args.select, args.where.id, args.data, "UpdateUserSettingsModuleInput", "id", "userSettingsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserSettingsModule', + 'updateUserSettingsModule', + 'userSettingsModule', + args.select, + args.where.id, + args.data, + 'UpdateUserSettingsModuleInput', + 'id', + 'userSettingsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "updateUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'updateUserSettingsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserSettingsModule", "deleteUserSettingsModule", "userSettingsModule", { - id: args.where.id - }, "DeleteUserSettingsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserSettingsModule', + 'deleteUserSettingsModule', + 'userSettingsModule', + { + id: args.where.id, + }, + 'DeleteUserSettingsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "deleteUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'deleteUserSettingsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/userStateModule.ts b/sdk/constructive-react/src/modules/orm/models/userStateModule.ts index 14649c4d10..86999c74ae 100644 --- a/sdk/constructive-react/src/modules/orm/models/userStateModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/userStateModule.ts @@ -3,56 +3,96 @@ * @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 { UserStateModule, UserStateModuleWithRelations, UserStateModuleSelect, UserStateModuleFilter, UserStateModuleOrderBy, CreateUserStateModuleInput, UpdateUserStateModuleInput, UserStateModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserStateModule, + UserStateModuleWithRelations, + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy, + CreateUserStateModuleInput, + UpdateUserStateModuleInput, + UserStateModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserStateModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserStateModule", "userStateModules", 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 - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserStateModule', + 'userStateModules', + 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, + }, + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModules", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserStateModule", "userStateModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserStateModule', + 'userStateModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModule", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserStateModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userStateModule": data.userStateModules?.nodes?.[0] ?? null - }) + userStateModule: data.userStateModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserStateModule", "userStateModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserStateModule', + 'userStateModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModule", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserStateModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userStateModule": data.userStateModules?.nodes?.[0] ?? null - }) + userStateModule: data.userStateModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserStateModule", "createUserStateModule", "userStateModule", args.select, args.data, "CreateUserStateModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserStateModule', + 'createUserStateModule', + 'userStateModule', + args.select, + args.data, + 'CreateUserStateModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "createUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'createUserStateModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserStateModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserStateModule", "updateUserStateModule", "userStateModule", args.select, args.where.id, args.data, "UpdateUserStateModuleInput", "id", "userStateModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserStateModule', + 'updateUserStateModule', + 'userStateModule', + args.select, + args.where.id, + args.data, + 'UpdateUserStateModuleInput', + 'id', + 'userStateModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "updateUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'updateUserStateModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserStateModule", "deleteUserStateModule", "userStateModule", { - id: args.where.id - }, "DeleteUserStateModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserStateModule', + 'deleteUserStateModule', + 'userStateModule', + { + id: args.where.id, + }, + 'DeleteUserStateModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "deleteUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'deleteUserStateModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/usersModule.ts b/sdk/constructive-react/src/modules/orm/models/usersModule.ts index 487116399e..950038fcf0 100644 --- a/sdk/constructive-react/src/modules/orm/models/usersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/usersModule.ts @@ -3,56 +3,96 @@ * @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 { UsersModule, UsersModuleWithRelations, UsersModuleSelect, UsersModuleFilter, UsersModuleOrderBy, CreateUsersModuleInput, UpdateUsersModuleInput, UsersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UsersModule, + UsersModuleWithRelations, + UsersModuleSelect, + UsersModuleFilter, + UsersModuleOrderBy, + CreateUsersModuleInput, + UpdateUsersModuleInput, + UsersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UsersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UsersModule", "usersModules", 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 - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UsersModule', + 'usersModules', + 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, + }, + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModules", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UsersModule", "usersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UsersModule', + 'usersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModule", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UsersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "usersModule": data.usersModules?.nodes?.[0] ?? null - }) + usersModule: data.usersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UsersModule", "usersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UsersModule', + 'usersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModule", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UsersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "usersModule": data.usersModules?.nodes?.[0] ?? null - }) + usersModule: data.usersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UsersModule", "createUsersModule", "usersModule", args.select, args.data, "CreateUsersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UsersModule', + 'createUsersModule', + 'usersModule', + args.select, + args.data, + 'CreateUsersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "createUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'createUsersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UsersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UsersModule", "updateUsersModule", "usersModule", args.select, args.where.id, args.data, "UpdateUsersModuleInput", "id", "usersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UsersModule', + 'updateUsersModule', + 'usersModule', + args.select, + args.where.id, + args.data, + 'UpdateUsersModuleInput', + 'id', + 'usersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "updateUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'updateUsersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UsersModule", "deleteUsersModule", "usersModule", { - id: args.where.id - }, "DeleteUsersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UsersModule', + 'deleteUsersModule', + 'usersModule', + { + id: args.where.id, + }, + 'DeleteUsersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "deleteUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'deleteUsersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/webauthnAuthModule.ts b/sdk/constructive-react/src/modules/orm/models/webauthnAuthModule.ts index 8859f120d7..e8cdb4eb61 100644 --- a/sdk/constructive-react/src/modules/orm/models/webauthnAuthModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/webauthnAuthModule.ts @@ -3,56 +3,96 @@ * @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 { WebauthnAuthModule, WebauthnAuthModuleWithRelations, WebauthnAuthModuleSelect, WebauthnAuthModuleFilter, WebauthnAuthModuleOrderBy, CreateWebauthnAuthModuleInput, UpdateWebauthnAuthModuleInput, WebauthnAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnAuthModule, + WebauthnAuthModuleWithRelations, + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy, + CreateWebauthnAuthModuleInput, + UpdateWebauthnAuthModuleInput, + WebauthnAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnAuthModule", "webauthnAuthModules", 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 - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + 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, + }, + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModules", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnAuthModule", "webauthnAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModule", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnAuthModule": data.webauthnAuthModules?.nodes?.[0] ?? null - }) + webauthnAuthModule: data.webauthnAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnAuthModule", "webauthnAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModule", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnAuthModule": data.webauthnAuthModules?.nodes?.[0] ?? null - }) + webauthnAuthModule: data.webauthnAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnAuthModule", "createWebauthnAuthModule", "webauthnAuthModule", args.select, args.data, "CreateWebauthnAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnAuthModule', + 'createWebauthnAuthModule', + 'webauthnAuthModule', + args.select, + args.data, + 'CreateWebauthnAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "createWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'createWebauthnAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnAuthModule", "updateWebauthnAuthModule", "webauthnAuthModule", args.select, args.where.id, args.data, "UpdateWebauthnAuthModuleInput", "id", "webauthnAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnAuthModule', + 'updateWebauthnAuthModule', + 'webauthnAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnAuthModuleInput', + 'id', + 'webauthnAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "updateWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'updateWebauthnAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnAuthModule", "deleteWebauthnAuthModule", "webauthnAuthModule", { - id: args.where.id - }, "DeleteWebauthnAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnAuthModule', + 'deleteWebauthnAuthModule', + 'webauthnAuthModule', + { + id: args.where.id, + }, + 'DeleteWebauthnAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "deleteWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'deleteWebauthnAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/webauthnCredentialsModule.ts b/sdk/constructive-react/src/modules/orm/models/webauthnCredentialsModule.ts index 8c2a060a9e..fd73e47620 100644 --- a/sdk/constructive-react/src/modules/orm/models/webauthnCredentialsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/webauthnCredentialsModule.ts @@ -3,56 +3,98 @@ * @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 { WebauthnCredentialsModule, WebauthnCredentialsModuleWithRelations, WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleFilter, WebauthnCredentialsModuleOrderBy, CreateWebauthnCredentialsModuleInput, UpdateWebauthnCredentialsModuleInput, WebauthnCredentialsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnCredentialsModule, + WebauthnCredentialsModuleWithRelations, + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy, + CreateWebauthnCredentialsModuleInput, + UpdateWebauthnCredentialsModuleInput, + WebauthnCredentialsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnCredentialsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - webauthnCredentialsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + webauthnCredentialsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", 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 - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + 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, + }, + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModules", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModule", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class WebauthnCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredentialsModule": data.webauthnCredentialsModules?.nodes?.[0] ?? null - }) + webauthnCredentialsModule: data.webauthnCredentialsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModule", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class WebauthnCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredentialsModule": data.webauthnCredentialsModules?.nodes?.[0] ?? null - }) + webauthnCredentialsModule: data.webauthnCredentialsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnCredentialsModule", "createWebauthnCredentialsModule", "webauthnCredentialsModule", args.select, args.data, "CreateWebauthnCredentialsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnCredentialsModule', + 'createWebauthnCredentialsModule', + 'webauthnCredentialsModule', + args.select, + args.data, + 'CreateWebauthnCredentialsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "createWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'createWebauthnCredentialsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnCredentialsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnCredentialsModule", "updateWebauthnCredentialsModule", "webauthnCredentialsModule", args.select, args.where.id, args.data, "UpdateWebauthnCredentialsModuleInput", "id", "webauthnCredentialsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnCredentialsModule', + 'updateWebauthnCredentialsModule', + 'webauthnCredentialsModule', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnCredentialsModuleInput', + 'id', + 'webauthnCredentialsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "updateWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'updateWebauthnCredentialsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnCredentialsModule", "deleteWebauthnCredentialsModule", "webauthnCredentialsModule", { - id: args.where.id - }, "DeleteWebauthnCredentialsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnCredentialsModule', + 'deleteWebauthnCredentialsModule', + 'webauthnCredentialsModule', + { + id: args.where.id, + }, + 'DeleteWebauthnCredentialsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "deleteWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'deleteWebauthnCredentialsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/models/webhookModule.ts b/sdk/constructive-react/src/modules/orm/models/webhookModule.ts index 027621c87a..d792bcf865 100644 --- a/sdk/constructive-react/src/modules/orm/models/webhookModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/webhookModule.ts @@ -3,56 +3,96 @@ * @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 { WebhookModule, WebhookModuleWithRelations, WebhookModuleSelect, WebhookModuleFilter, WebhookModuleOrderBy, CreateWebhookModuleInput, UpdateWebhookModuleInput, WebhookModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookModule, + WebhookModuleWithRelations, + WebhookModuleSelect, + WebhookModuleFilter, + WebhookModuleOrderBy, + CreateWebhookModuleInput, + UpdateWebhookModuleInput, + WebhookModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookModule", "webhookModules", 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 - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookModule', + 'webhookModules', + 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, + }, + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModules", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookModule", "webhookModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookModule', + 'webhookModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModule", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookModule": data.webhookModules?.nodes?.[0] ?? null - }) + webhookModule: data.webhookModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookModule", "webhookModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookModule', + 'webhookModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModule", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookModule": data.webhookModules?.nodes?.[0] ?? null - }) + webhookModule: data.webhookModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookModule", "createWebhookModule", "webhookModule", args.select, args.data, "CreateWebhookModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookModule', + 'createWebhookModule', + 'webhookModule', + args.select, + args.data, + 'CreateWebhookModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "createWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'createWebhookModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookModule", "updateWebhookModule", "webhookModule", args.select, args.where.id, args.data, "UpdateWebhookModuleInput", "id", "webhookModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookModule', + 'updateWebhookModule', + 'webhookModule', + args.select, + args.where.id, + args.data, + 'UpdateWebhookModuleInput', + 'id', + 'webhookModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "updateWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'updateWebhookModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookModule", "deleteWebhookModule", "webhookModule", { - id: args.where.id - }, "DeleteWebhookModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookModule', + 'deleteWebhookModule', + 'webhookModule', + { + id: args.where.id, + }, + 'DeleteWebhookModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "deleteWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'deleteWebhookModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/mutation/index.ts b/sdk/constructive-react/src/modules/orm/mutation/index.ts index 9720edba22..60041efadb 100644 --- a/sdk/constructive-react/src/modules/orm/mutation/index.ts +++ b/sdk/constructive-react/src/modules/orm/mutation/index.ts @@ -3,11 +3,42 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ConstructBlueprintInput, CopyTemplateToBlueprintInput, ProvisionBucketInput, ProvisionCheckConstraintInput, ProvisionFullTextSearchInput, ProvisionIndexInput, ProvisionRelationInput, ProvisionSpatialRelationInput, ProvisionTableInput, ProvisionUniqueConstraintInput, ConstructBlueprintPayload, CopyTemplateToBlueprintPayload, ProvisionBucketPayload, ProvisionCheckConstraintPayload, ProvisionFullTextSearchPayload, ProvisionIndexPayload, ProvisionRelationPayload, ProvisionSpatialRelationPayload, ProvisionTablePayload, ProvisionUniqueConstraintPayload, ConstructBlueprintPayloadSelect, CopyTemplateToBlueprintPayloadSelect, ProvisionBucketPayloadSelect, ProvisionCheckConstraintPayloadSelect, ProvisionFullTextSearchPayloadSelect, ProvisionIndexPayloadSelect, ProvisionRelationPayloadSelect, ProvisionSpatialRelationPayloadSelect, ProvisionTablePayloadSelect, ProvisionUniqueConstraintPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ConstructBlueprintInput, + CopyTemplateToBlueprintInput, + ProvisionBucketInput, + ProvisionCheckConstraintInput, + ProvisionFullTextSearchInput, + ProvisionIndexInput, + ProvisionRelationInput, + ProvisionSpatialRelationInput, + ProvisionTableInput, + ProvisionUniqueConstraintInput, + ConstructBlueprintPayload, + CopyTemplateToBlueprintPayload, + ProvisionBucketPayload, + ProvisionCheckConstraintPayload, + ProvisionFullTextSearchPayload, + ProvisionIndexPayload, + ProvisionRelationPayload, + ProvisionSpatialRelationPayload, + ProvisionTablePayload, + ProvisionUniqueConstraintPayload, + ConstructBlueprintPayloadSelect, + CopyTemplateToBlueprintPayloadSelect, + ProvisionBucketPayloadSelect, + ProvisionCheckConstraintPayloadSelect, + ProvisionFullTextSearchPayloadSelect, + ProvisionIndexPayloadSelect, + ProvisionRelationPayloadSelect, + ProvisionSpatialRelationPayloadSelect, + ProvisionTablePayloadSelect, + ProvisionUniqueConstraintPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for constructBlueprint * 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 — 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[] — 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. @@ -83,145 +114,295 @@ export interface ProvisionUniqueConstraintVariables { } export function createMutationOperations(client: OrmClient) { return { - constructBlueprint: (args: ConstructBlueprintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - constructBlueprint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ConstructBlueprint", - fieldName: "constructBlueprint", - ...buildCustomDocument("mutation", "ConstructBlueprint", "constructBlueprint", options.select, args, [{ - name: "input", - type: "ConstructBlueprintInput!" - }], connectionFieldsMap, "ConstructBlueprintPayload") - }), - copyTemplateToBlueprint: (args: CopyTemplateToBlueprintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - copyTemplateToBlueprint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CopyTemplateToBlueprint", - fieldName: "copyTemplateToBlueprint", - ...buildCustomDocument("mutation", "CopyTemplateToBlueprint", "copyTemplateToBlueprint", options.select, args, [{ - name: "input", - type: "CopyTemplateToBlueprintInput!" - }], connectionFieldsMap, "CopyTemplateToBlueprintPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - provisionCheckConstraint: (args: ProvisionCheckConstraintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionCheckConstraint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionCheckConstraint", - fieldName: "provisionCheckConstraint", - ...buildCustomDocument("mutation", "ProvisionCheckConstraint", "provisionCheckConstraint", options.select, args, [{ - name: "input", - type: "ProvisionCheckConstraintInput!" - }], connectionFieldsMap, "ProvisionCheckConstraintPayload") - }), - provisionFullTextSearch: (args: ProvisionFullTextSearchVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionFullTextSearch: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionFullTextSearch", - fieldName: "provisionFullTextSearch", - ...buildCustomDocument("mutation", "ProvisionFullTextSearch", "provisionFullTextSearch", options.select, args, [{ - name: "input", - type: "ProvisionFullTextSearchInput!" - }], connectionFieldsMap, "ProvisionFullTextSearchPayload") - }), - provisionIndex: (args: ProvisionIndexVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionIndex: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionIndex", - fieldName: "provisionIndex", - ...buildCustomDocument("mutation", "ProvisionIndex", "provisionIndex", options.select, args, [{ - name: "input", - type: "ProvisionIndexInput!" - }], connectionFieldsMap, "ProvisionIndexPayload") - }), - provisionRelation: (args: ProvisionRelationVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionRelation: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionRelation", - fieldName: "provisionRelation", - ...buildCustomDocument("mutation", "ProvisionRelation", "provisionRelation", options.select, args, [{ - name: "input", - type: "ProvisionRelationInput!" - }], connectionFieldsMap, "ProvisionRelationPayload") - }), - provisionSpatialRelation: (args: ProvisionSpatialRelationVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionSpatialRelation: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionSpatialRelation", - fieldName: "provisionSpatialRelation", - ...buildCustomDocument("mutation", "ProvisionSpatialRelation", "provisionSpatialRelation", options.select, args, [{ - name: "input", - type: "ProvisionSpatialRelationInput!" - }], connectionFieldsMap, "ProvisionSpatialRelationPayload") - }), - provisionTable: (args: ProvisionTableVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionTable: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionTable", - fieldName: "provisionTable", - ...buildCustomDocument("mutation", "ProvisionTable", "provisionTable", options.select, args, [{ - name: "input", - type: "ProvisionTableInput!" - }], connectionFieldsMap, "ProvisionTablePayload") - }), - provisionUniqueConstraint: (args: ProvisionUniqueConstraintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionUniqueConstraint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionUniqueConstraint", - fieldName: "provisionUniqueConstraint", - ...buildCustomDocument("mutation", "ProvisionUniqueConstraint", "provisionUniqueConstraint", options.select, args, [{ - name: "input", - type: "ProvisionUniqueConstraintInput!" - }], connectionFieldsMap, "ProvisionUniqueConstraintPayload") - }) + constructBlueprint: ( + args: ConstructBlueprintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + constructBlueprint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ConstructBlueprint', + fieldName: 'constructBlueprint', + ...buildCustomDocument( + 'mutation', + 'ConstructBlueprint', + 'constructBlueprint', + options.select, + args, + [ + { + name: 'input', + type: 'ConstructBlueprintInput!', + }, + ], + connectionFieldsMap, + 'ConstructBlueprintPayload' + ), + }), + copyTemplateToBlueprint: ( + args: CopyTemplateToBlueprintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyTemplateToBlueprint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyTemplateToBlueprint', + fieldName: 'copyTemplateToBlueprint', + ...buildCustomDocument( + 'mutation', + 'CopyTemplateToBlueprint', + 'copyTemplateToBlueprint', + options.select, + args, + [ + { + name: 'input', + type: 'CopyTemplateToBlueprintInput!', + }, + ], + connectionFieldsMap, + 'CopyTemplateToBlueprintPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + provisionCheckConstraint: ( + args: ProvisionCheckConstraintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionCheckConstraint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionCheckConstraint', + fieldName: 'provisionCheckConstraint', + ...buildCustomDocument( + 'mutation', + 'ProvisionCheckConstraint', + 'provisionCheckConstraint', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionCheckConstraintInput!', + }, + ], + connectionFieldsMap, + 'ProvisionCheckConstraintPayload' + ), + }), + provisionFullTextSearch: ( + args: ProvisionFullTextSearchVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionFullTextSearch: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionFullTextSearch', + fieldName: 'provisionFullTextSearch', + ...buildCustomDocument( + 'mutation', + 'ProvisionFullTextSearch', + 'provisionFullTextSearch', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionFullTextSearchInput!', + }, + ], + connectionFieldsMap, + 'ProvisionFullTextSearchPayload' + ), + }), + provisionIndex: ( + args: ProvisionIndexVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionIndex: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionIndex', + fieldName: 'provisionIndex', + ...buildCustomDocument( + 'mutation', + 'ProvisionIndex', + 'provisionIndex', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionIndexInput!', + }, + ], + connectionFieldsMap, + 'ProvisionIndexPayload' + ), + }), + provisionRelation: ( + args: ProvisionRelationVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionRelation: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionRelation', + fieldName: 'provisionRelation', + ...buildCustomDocument( + 'mutation', + 'ProvisionRelation', + 'provisionRelation', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionRelationInput!', + }, + ], + connectionFieldsMap, + 'ProvisionRelationPayload' + ), + }), + provisionSpatialRelation: ( + args: ProvisionSpatialRelationVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionSpatialRelation: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionSpatialRelation', + fieldName: 'provisionSpatialRelation', + ...buildCustomDocument( + 'mutation', + 'ProvisionSpatialRelation', + 'provisionSpatialRelation', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionSpatialRelationInput!', + }, + ], + connectionFieldsMap, + 'ProvisionSpatialRelationPayload' + ), + }), + provisionTable: ( + args: ProvisionTableVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionTable: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionTable', + fieldName: 'provisionTable', + ...buildCustomDocument( + 'mutation', + 'ProvisionTable', + 'provisionTable', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionTableInput!', + }, + ], + connectionFieldsMap, + 'ProvisionTablePayload' + ), + }), + provisionUniqueConstraint: ( + args: ProvisionUniqueConstraintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionUniqueConstraint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionUniqueConstraint', + fieldName: 'provisionUniqueConstraint', + ...buildCustomDocument( + 'mutation', + 'ProvisionUniqueConstraint', + 'provisionUniqueConstraint', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionUniqueConstraintInput!', + }, + ], + connectionFieldsMap, + 'ProvisionUniqueConstraintPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/query-builder.ts b/sdk/constructive-react/src/modules/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/modules/orm/query-builder.ts +++ b/sdk/constructive-react/src/modules/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/modules/orm/query/index.ts b/sdk/constructive-react/src/modules/orm/query/index.ts index 6bb6ccfe36..70496d57ba 100644 --- a/sdk/constructive-react/src/modules/orm/query/index.ts +++ b/sdk/constructive-react/src/modules/orm/query/index.ts @@ -3,10 +3,10 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for resolveBlueprintField * 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. @@ -29,51 +29,87 @@ export interface ResolveBlueprintTableVariables { } export function createQueryOperations(client: OrmClient) { return { - resolveBlueprintField: (args: ResolveBlueprintFieldVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - resolveBlueprintField: string | null; - }>({ - client, - operation: "query", - operationName: "ResolveBlueprintField", - fieldName: "resolveBlueprintField", - ...buildCustomDocument("query", "ResolveBlueprintField", "resolveBlueprintField", options?.select, args, [{ - name: "databaseId", - type: "UUID" - }, { - name: "fieldName", - type: "String" - }, { - name: "tableId", - type: "UUID" - }], connectionFieldsMap, undefined) - }), - resolveBlueprintTable: (args: ResolveBlueprintTableVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - resolveBlueprintTable: string | null; - }>({ - client, - operation: "query", - operationName: "ResolveBlueprintTable", - fieldName: "resolveBlueprintTable", - ...buildCustomDocument("query", "ResolveBlueprintTable", "resolveBlueprintTable", options?.select, args, [{ - name: "databaseId", - type: "UUID" - }, { - name: "defaultSchemaId", - type: "UUID" - }, { - name: "schemaName", - type: "String" - }, { - name: "tableMap", - type: "JSON" - }, { - name: "tableName", - type: "String" - }], connectionFieldsMap, undefined) - }) + resolveBlueprintField: ( + args: ResolveBlueprintFieldVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + resolveBlueprintField: string | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveBlueprintField', + fieldName: 'resolveBlueprintField', + ...buildCustomDocument( + 'query', + 'ResolveBlueprintField', + 'resolveBlueprintField', + options?.select, + args, + [ + { + name: 'databaseId', + type: 'UUID', + }, + { + name: 'fieldName', + type: 'String', + }, + { + name: 'tableId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + resolveBlueprintTable: ( + args: ResolveBlueprintTableVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + resolveBlueprintTable: string | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveBlueprintTable', + fieldName: 'resolveBlueprintTable', + ...buildCustomDocument( + 'query', + 'ResolveBlueprintTable', + 'resolveBlueprintTable', + options?.select, + args, + [ + { + name: 'databaseId', + type: 'UUID', + }, + { + name: 'defaultSchemaId', + type: 'UUID', + }, + { + name: 'schemaName', + type: 'String', + }, + { + name: 'tableMap', + type: 'JSON', + }, + { + name: 'tableName', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/orm/realtime.ts b/sdk/constructive-react/src/modules/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/modules/orm/realtime.ts +++ b/sdk/constructive-react/src/modules/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/modules/orm/select-types.ts b/sdk/constructive-react/src/modules/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/modules/orm/select-types.ts +++ b/sdk/constructive-react/src/modules/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/modules/schema-types.ts b/sdk/constructive-react/src/modules/schema-types.ts index 120782db93..95a13dc42c 100644 --- a/sdk/constructive-react/src/modules/schema-types.ts +++ b/sdk/constructive-react/src/modules/schema-types.ts @@ -4,157 +4,3251 @@ * DO NOT EDIT - changes will be overwritten */ -import type { AgentModule, ApiSurfaceModule, AppModule, BillingModule, BillingProviderModule, Blueprint, BlueprintConstruction, BlueprintTemplate, CatalogModule, ComputeLogModule, ConfigSecretsUserModule, ConnectedAccountsModule, CryptoAddressesModule, CryptoAuthModule, DatabaseProvisionModule, DatabaseSettingsModule, DbPool, DbPoolConfig, DbPresetModule, DbUsageModule, DefaultIdsModule, DenormalizedTableField, DevicesModule, DomainModule, EmailsModule, EntityTypeProvision, EventsModule, FunctionDeploymentModule, FunctionInvocationModule, FunctionModule, GraphExecutionModule, GraphModule, HierarchyModule, HttpRouteModule, I18NModule, IdentityProvidersModule, InferenceLogModule, InfraConfigModule, InfraSecretsModule, IntegrationProvidersModule, InternalSecretsModule, InvitesModule, LimitsModule, MembershipTypesModule, MembershipsModule, MerkleStoreModule, NamespaceModule, NotificationsModule, PermissionsModule, PhoneNumbersModule, PlansModule, PrincipalAuthModule, ProfilesModule, RateLimitMetersModule, RateLimitsModule, RealtimeModule, RelationProvision, ResourceModule, RlsModule, RouteModule, SecureTableProvision, SessionSecretsModule, SessionsModule, SiteSurfaceModule, StorageLogModule, StorageModule, TransferLogModule, UserAuthModule, UserCredentialsModule, UserSettingsModule, UserStateModule, UsersModule, WebauthnAuthModule, WebauthnCredentialsModule, WebhookModule, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + AgentModule, + ApiSurfaceModule, + AppModule, + BillingModule, + BillingProviderModule, + Blueprint, + BlueprintConstruction, + BlueprintTemplate, + CatalogModule, + ComputeLogModule, + ConfigSecretsUserModule, + ConnectedAccountsModule, + CryptoAddressesModule, + CryptoAuthModule, + DatabaseProvisionModule, + DatabaseSettingsModule, + DbPool, + DbPoolConfig, + DbPresetModule, + DbUsageModule, + DefaultIdsModule, + DenormalizedTableField, + DevicesModule, + DomainModule, + EmailsModule, + EntityTypeProvision, + EventsModule, + FunctionDeploymentModule, + FunctionInvocationModule, + FunctionModule, + GraphExecutionModule, + GraphModule, + HierarchyModule, + HttpRouteModule, + I18NModule, + IdentityProvidersModule, + InferenceLogModule, + InfraConfigModule, + InfraSecretsModule, + IntegrationProvidersModule, + InternalSecretsModule, + InvitesModule, + LimitsModule, + MembershipTypesModule, + MembershipsModule, + MerkleStoreModule, + NamespaceModule, + NotificationsModule, + PermissionsModule, + PhoneNumbersModule, + PlansModule, + PrincipalAuthModule, + ProfilesModule, + RateLimitMetersModule, + RateLimitsModule, + RealtimeModule, + RelationProvision, + ResourceModule, + RlsModule, + RouteModule, + SecureTableProvision, + SessionSecretsModule, + SessionsModule, + SiteSurfaceModule, + StorageLogModule, + StorageModule, + TransferLogModule, + UserAuthModule, + UserCredentialsModule, + UserSettingsModule, + UserStateModule, + UsersModule, + WebauthnAuthModule, + WebauthnCredentialsModule, + WebhookModule, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; /** Methods to use when ordering `AgentModule`. */ -export type AgentModuleOrderBy = "AGENT_TABLE_ID_ASC" | "AGENT_TABLE_ID_DESC" | "AGENT_TABLE_NAME_ASC" | "AGENT_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HAS_AGENTS_ASC" | "HAS_AGENTS_DESC" | "HAS_PLANS_ASC" | "HAS_PLANS_DESC" | "HAS_RESOURCES_ASC" | "HAS_RESOURCES_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_TABLE_ID_ASC" | "MESSAGE_TABLE_ID_DESC" | "MESSAGE_TABLE_NAME_ASC" | "MESSAGE_TABLE_NAME_DESC" | "NATURAL" | "PERSONA_TABLE_ID_ASC" | "PERSONA_TABLE_ID_DESC" | "PERSONA_TABLE_NAME_ASC" | "PERSONA_TABLE_NAME_DESC" | "PLAN_TABLE_ID_ASC" | "PLAN_TABLE_ID_DESC" | "PLAN_TABLE_NAME_ASC" | "PLAN_TABLE_NAME_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROMPTS_TABLE_ID_ASC" | "PROMPTS_TABLE_ID_DESC" | "PROMPTS_TABLE_NAME_ASC" | "PROMPTS_TABLE_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RESOURCE_TABLE_ID_ASC" | "RESOURCE_TABLE_ID_DESC" | "RESOURCE_TABLE_NAME_ASC" | "RESOURCE_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SHARED_ASC" | "SHARED_DESC" | "TASK_TABLE_ID_ASC" | "TASK_TABLE_ID_DESC" | "TASK_TABLE_NAME_ASC" | "TASK_TABLE_NAME_DESC" | "THREAD_TABLE_ID_ASC" | "THREAD_TABLE_ID_DESC" | "THREAD_TABLE_NAME_ASC" | "THREAD_TABLE_NAME_DESC"; +export type AgentModuleOrderBy = + | 'AGENT_TABLE_ID_ASC' + | 'AGENT_TABLE_ID_DESC' + | 'AGENT_TABLE_NAME_ASC' + | 'AGENT_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HAS_AGENTS_ASC' + | 'HAS_AGENTS_DESC' + | 'HAS_PLANS_ASC' + | 'HAS_PLANS_DESC' + | 'HAS_RESOURCES_ASC' + | 'HAS_RESOURCES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_TABLE_ID_ASC' + | 'MESSAGE_TABLE_ID_DESC' + | 'MESSAGE_TABLE_NAME_ASC' + | 'MESSAGE_TABLE_NAME_DESC' + | 'NATURAL' + | 'PERSONA_TABLE_ID_ASC' + | 'PERSONA_TABLE_ID_DESC' + | 'PERSONA_TABLE_NAME_ASC' + | 'PERSONA_TABLE_NAME_DESC' + | 'PLAN_TABLE_ID_ASC' + | 'PLAN_TABLE_ID_DESC' + | 'PLAN_TABLE_NAME_ASC' + | 'PLAN_TABLE_NAME_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROMPTS_TABLE_ID_ASC' + | 'PROMPTS_TABLE_ID_DESC' + | 'PROMPTS_TABLE_NAME_ASC' + | 'PROMPTS_TABLE_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RESOURCE_TABLE_ID_ASC' + | 'RESOURCE_TABLE_ID_DESC' + | 'RESOURCE_TABLE_NAME_ASC' + | 'RESOURCE_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SHARED_ASC' + | 'SHARED_DESC' + | 'TASK_TABLE_ID_ASC' + | 'TASK_TABLE_ID_DESC' + | 'TASK_TABLE_NAME_ASC' + | 'TASK_TABLE_NAME_DESC' + | 'THREAD_TABLE_ID_ASC' + | 'THREAD_TABLE_ID_DESC' + | 'THREAD_TABLE_NAME_ASC' + | 'THREAD_TABLE_NAME_DESC'; /** Methods to use when ordering `ApiSurfaceModule`. */ -export type ApiSurfaceModuleOrderBy = "APIS_TABLE_ID_ASC" | "APIS_TABLE_ID_DESC" | "APIS_TABLE_NAME_ASC" | "APIS_TABLE_NAME_DESC" | "API_MODULES_TABLE_ID_ASC" | "API_MODULES_TABLE_ID_DESC" | "API_MODULES_TABLE_NAME_ASC" | "API_MODULES_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "API_SCHEMAS_TABLE_ID_ASC" | "API_SCHEMAS_TABLE_ID_DESC" | "API_SCHEMAS_TABLE_NAME_ASC" | "API_SCHEMAS_TABLE_NAME_DESC" | "API_SETTINGS_TABLE_ID_ASC" | "API_SETTINGS_TABLE_ID_DESC" | "API_SETTINGS_TABLE_NAME_ASC" | "API_SETTINGS_TABLE_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "CORS_SETTINGS_TABLE_ID_ASC" | "CORS_SETTINGS_TABLE_ID_DESC" | "CORS_SETTINGS_TABLE_NAME_ASC" | "CORS_SETTINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type ApiSurfaceModuleOrderBy = + | 'APIS_TABLE_ID_ASC' + | 'APIS_TABLE_ID_DESC' + | 'APIS_TABLE_NAME_ASC' + | 'APIS_TABLE_NAME_DESC' + | 'API_MODULES_TABLE_ID_ASC' + | 'API_MODULES_TABLE_ID_DESC' + | 'API_MODULES_TABLE_NAME_ASC' + | 'API_MODULES_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'API_SCHEMAS_TABLE_ID_ASC' + | 'API_SCHEMAS_TABLE_ID_DESC' + | 'API_SCHEMAS_TABLE_NAME_ASC' + | 'API_SCHEMAS_TABLE_NAME_DESC' + | 'API_SETTINGS_TABLE_ID_ASC' + | 'API_SETTINGS_TABLE_ID_DESC' + | 'API_SETTINGS_TABLE_NAME_ASC' + | 'API_SETTINGS_TABLE_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'CORS_SETTINGS_TABLE_ID_ASC' + | 'CORS_SETTINGS_TABLE_ID_DESC' + | 'CORS_SETTINGS_TABLE_NAME_ASC' + | 'CORS_SETTINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `AppModule`. */ -export type AppModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "APPS_TABLE_ID_ASC" | "APPS_TABLE_ID_DESC" | "APPS_TABLE_NAME_ASC" | "APPS_TABLE_NAME_DESC" | "APP_COMPONENTS_TABLE_ID_ASC" | "APP_COMPONENTS_TABLE_ID_DESC" | "APP_COMPONENTS_TABLE_NAME_ASC" | "APP_COMPONENTS_TABLE_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type AppModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPS_TABLE_ID_ASC' + | 'APPS_TABLE_ID_DESC' + | 'APPS_TABLE_NAME_ASC' + | 'APPS_TABLE_NAME_DESC' + | 'APP_COMPONENTS_TABLE_ID_ASC' + | 'APP_COMPONENTS_TABLE_ID_DESC' + | 'APP_COMPONENTS_TABLE_NAME_ASC' + | 'APP_COMPONENTS_TABLE_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `BillingModule`. */ -export type BillingModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BALANCES_TABLE_ID_ASC" | "BALANCES_TABLE_ID_DESC" | "BALANCES_TABLE_NAME_ASC" | "BALANCES_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ID_ASC" | "ID_DESC" | "LEDGER_TABLE_ID_ASC" | "LEDGER_TABLE_ID_DESC" | "LEDGER_TABLE_NAME_ASC" | "LEDGER_TABLE_NAME_DESC" | "METERS_TABLE_ID_ASC" | "METERS_TABLE_ID_DESC" | "METERS_TABLE_NAME_ASC" | "METERS_TABLE_NAME_DESC" | "METER_CREDITS_TABLE_ID_ASC" | "METER_CREDITS_TABLE_ID_DESC" | "METER_CREDITS_TABLE_NAME_ASC" | "METER_CREDITS_TABLE_NAME_DESC" | "METER_DEFAULTS_TABLE_ID_ASC" | "METER_DEFAULTS_TABLE_ID_DESC" | "METER_DEFAULTS_TABLE_NAME_ASC" | "METER_DEFAULTS_TABLE_NAME_DESC" | "METER_SOURCES_TABLE_ID_ASC" | "METER_SOURCES_TABLE_ID_DESC" | "METER_SOURCES_TABLE_NAME_ASC" | "METER_SOURCES_TABLE_NAME_DESC" | "NATURAL" | "PLAN_SUBSCRIPTIONS_TABLE_ID_ASC" | "PLAN_SUBSCRIPTIONS_TABLE_ID_DESC" | "PLAN_SUBSCRIPTIONS_TABLE_NAME_ASC" | "PLAN_SUBSCRIPTIONS_TABLE_NAME_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RECORD_USAGE_FUNCTION_ASC" | "RECORD_USAGE_FUNCTION_DESC" | "ROLLUP_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_ASC" | "SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_DESC"; +export type BillingModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BALANCES_TABLE_ID_ASC' + | 'BALANCES_TABLE_ID_DESC' + | 'BALANCES_TABLE_NAME_ASC' + | 'BALANCES_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LEDGER_TABLE_ID_ASC' + | 'LEDGER_TABLE_ID_DESC' + | 'LEDGER_TABLE_NAME_ASC' + | 'LEDGER_TABLE_NAME_DESC' + | 'METERS_TABLE_ID_ASC' + | 'METERS_TABLE_ID_DESC' + | 'METERS_TABLE_NAME_ASC' + | 'METERS_TABLE_NAME_DESC' + | 'METER_CREDITS_TABLE_ID_ASC' + | 'METER_CREDITS_TABLE_ID_DESC' + | 'METER_CREDITS_TABLE_NAME_ASC' + | 'METER_CREDITS_TABLE_NAME_DESC' + | 'METER_DEFAULTS_TABLE_ID_ASC' + | 'METER_DEFAULTS_TABLE_ID_DESC' + | 'METER_DEFAULTS_TABLE_NAME_ASC' + | 'METER_DEFAULTS_TABLE_NAME_DESC' + | 'METER_SOURCES_TABLE_ID_ASC' + | 'METER_SOURCES_TABLE_ID_DESC' + | 'METER_SOURCES_TABLE_NAME_ASC' + | 'METER_SOURCES_TABLE_NAME_DESC' + | 'NATURAL' + | 'PLAN_SUBSCRIPTIONS_TABLE_ID_ASC' + | 'PLAN_SUBSCRIPTIONS_TABLE_ID_DESC' + | 'PLAN_SUBSCRIPTIONS_TABLE_NAME_ASC' + | 'PLAN_SUBSCRIPTIONS_TABLE_NAME_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RECORD_USAGE_FUNCTION_ASC' + | 'RECORD_USAGE_FUNCTION_DESC' + | 'ROLLUP_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_ASC' + | 'SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_DESC'; /** Methods to use when ordering `BillingProviderModule`. */ -export type BillingProviderModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BILLING_CUSTOMERS_TABLE_ID_ASC" | "BILLING_CUSTOMERS_TABLE_ID_DESC" | "BILLING_CUSTOMERS_TABLE_NAME_ASC" | "BILLING_CUSTOMERS_TABLE_NAME_DESC" | "BILLING_PRICES_TABLE_ID_ASC" | "BILLING_PRICES_TABLE_ID_DESC" | "BILLING_PRICES_TABLE_NAME_ASC" | "BILLING_PRICES_TABLE_NAME_DESC" | "BILLING_PRODUCTS_TABLE_ID_ASC" | "BILLING_PRODUCTS_TABLE_ID_DESC" | "BILLING_PRODUCTS_TABLE_NAME_ASC" | "BILLING_PRODUCTS_TABLE_NAME_DESC" | "BILLING_SUBSCRIPTIONS_TABLE_ID_ASC" | "BILLING_SUBSCRIPTIONS_TABLE_ID_DESC" | "BILLING_SUBSCRIPTIONS_TABLE_NAME_ASC" | "BILLING_SUBSCRIPTIONS_TABLE_NAME_DESC" | "BILLING_WEBHOOK_EVENTS_TABLE_ID_ASC" | "BILLING_WEBHOOK_EVENTS_TABLE_ID_DESC" | "BILLING_WEBHOOK_EVENTS_TABLE_NAME_ASC" | "BILLING_WEBHOOK_EVENTS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRICES_TABLE_ID_ASC" | "PRICES_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PROCESS_BILLING_EVENT_FUNCTION_ASC" | "PROCESS_BILLING_EVENT_FUNCTION_DESC" | "PRODUCTS_TABLE_ID_ASC" | "PRODUCTS_TABLE_ID_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SUBSCRIPTIONS_TABLE_ID_ASC" | "SUBSCRIPTIONS_TABLE_ID_DESC"; +export type BillingProviderModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BILLING_CUSTOMERS_TABLE_ID_ASC' + | 'BILLING_CUSTOMERS_TABLE_ID_DESC' + | 'BILLING_CUSTOMERS_TABLE_NAME_ASC' + | 'BILLING_CUSTOMERS_TABLE_NAME_DESC' + | 'BILLING_PRICES_TABLE_ID_ASC' + | 'BILLING_PRICES_TABLE_ID_DESC' + | 'BILLING_PRICES_TABLE_NAME_ASC' + | 'BILLING_PRICES_TABLE_NAME_DESC' + | 'BILLING_PRODUCTS_TABLE_ID_ASC' + | 'BILLING_PRODUCTS_TABLE_ID_DESC' + | 'BILLING_PRODUCTS_TABLE_NAME_ASC' + | 'BILLING_PRODUCTS_TABLE_NAME_DESC' + | 'BILLING_SUBSCRIPTIONS_TABLE_ID_ASC' + | 'BILLING_SUBSCRIPTIONS_TABLE_ID_DESC' + | 'BILLING_SUBSCRIPTIONS_TABLE_NAME_ASC' + | 'BILLING_SUBSCRIPTIONS_TABLE_NAME_DESC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_ID_ASC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_ID_DESC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_NAME_ASC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRICES_TABLE_ID_ASC' + | 'PRICES_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PROCESS_BILLING_EVENT_FUNCTION_ASC' + | 'PROCESS_BILLING_EVENT_FUNCTION_DESC' + | 'PRODUCTS_TABLE_ID_ASC' + | 'PRODUCTS_TABLE_ID_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SUBSCRIPTIONS_TABLE_ID_ASC' + | 'SUBSCRIPTIONS_TABLE_ID_DESC'; /** Methods to use when ordering `BlueprintConstruction`. */ -export type BlueprintConstructionOrderBy = "BLUEPRINT_ID_ASC" | "BLUEPRINT_ID_DESC" | "CONSTRUCTED_AT_ASC" | "CONSTRUCTED_AT_DESC" | "CONSTRUCTED_DEFINITION_ASC" | "CONSTRUCTED_DEFINITION_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_DETAILS_ASC" | "ERROR_DETAILS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TABLE_MAP_ASC" | "TABLE_MAP_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type BlueprintConstructionOrderBy = + | 'BLUEPRINT_ID_ASC' + | 'BLUEPRINT_ID_DESC' + | 'CONSTRUCTED_AT_ASC' + | 'CONSTRUCTED_AT_DESC' + | 'CONSTRUCTED_DEFINITION_ASC' + | 'CONSTRUCTED_DEFINITION_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_DETAILS_ASC' + | 'ERROR_DETAILS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TABLE_MAP_ASC' + | 'TABLE_MAP_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `Blueprint`. */ -export type BlueprintOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DEFINITION_HASH_ASC" | "DEFINITION_HASH_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_HASHES_ASC" | "TABLE_HASHES_DESC" | "TEMPLATE_ID_ASC" | "TEMPLATE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type BlueprintOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DEFINITION_HASH_ASC' + | 'DEFINITION_HASH_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_HASHES_ASC' + | 'TABLE_HASHES_DESC' + | 'TEMPLATE_ID_ASC' + | 'TEMPLATE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `BlueprintTemplate`. */ -export type BlueprintTemplateOrderBy = "CATEGORIES_ASC" | "CATEGORIES_DESC" | "COMPLEXITY_ASC" | "COMPLEXITY_DESC" | "COPY_COUNT_ASC" | "COPY_COUNT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DEFINITION_HASH_ASC" | "DEFINITION_HASH_DESC" | "DEFINITION_SCHEMA_VERSION_ASC" | "DEFINITION_SCHEMA_VERSION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "FORKED_FROM_ID_ASC" | "FORKED_FROM_ID_DESC" | "FORK_COUNT_ASC" | "FORK_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "TABLE_HASHES_ASC" | "TABLE_HASHES_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERSION_ASC" | "VERSION_DESC" | "VISIBILITY_ASC" | "VISIBILITY_DESC"; +export type BlueprintTemplateOrderBy = + | 'CATEGORIES_ASC' + | 'CATEGORIES_DESC' + | 'COMPLEXITY_ASC' + | 'COMPLEXITY_DESC' + | 'COPY_COUNT_ASC' + | 'COPY_COUNT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DEFINITION_HASH_ASC' + | 'DEFINITION_HASH_DESC' + | 'DEFINITION_SCHEMA_VERSION_ASC' + | 'DEFINITION_SCHEMA_VERSION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'FORKED_FROM_ID_ASC' + | 'FORKED_FROM_ID_DESC' + | 'FORK_COUNT_ASC' + | 'FORK_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'TABLE_HASHES_ASC' + | 'TABLE_HASHES_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERSION_ASC' + | 'VERSION_DESC' + | 'VISIBILITY_ASC' + | 'VISIBILITY_DESC'; /** Methods to use when ordering `CatalogModule`. */ -export type CatalogModuleOrderBy = "APIS_TABLE_ID_ASC" | "APIS_TABLE_ID_DESC" | "APIS_TABLE_NAME_ASC" | "APIS_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "APPS_TABLE_ID_ASC" | "APPS_TABLE_ID_DESC" | "APPS_TABLE_NAME_ASC" | "APPS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAINS_TABLE_ID_ASC" | "DOMAINS_TABLE_ID_DESC" | "DOMAINS_TABLE_NAME_ASC" | "DOMAINS_TABLE_NAME_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTIONS_TABLE_ID_ASC" | "FUNCTIONS_TABLE_ID_DESC" | "FUNCTIONS_TABLE_NAME_ASC" | "FUNCTIONS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACES_TABLE_ID_ASC" | "NAMESPACES_TABLE_ID_DESC" | "NAMESPACES_TABLE_NAME_ASC" | "NAMESPACES_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOURCES_TABLE_ID_ASC" | "RESOURCES_TABLE_ID_DESC" | "RESOURCES_TABLE_NAME_ASC" | "RESOURCES_TABLE_NAME_DESC" | "RESOURCE_DEFINITIONS_TABLE_ID_ASC" | "RESOURCE_DEFINITIONS_TABLE_ID_DESC" | "RESOURCE_DEFINITIONS_TABLE_NAME_ASC" | "RESOURCE_DEFINITIONS_TABLE_NAME_DESC" | "RESOURCE_INSTALLATIONS_TABLE_ID_ASC" | "RESOURCE_INSTALLATIONS_TABLE_ID_DESC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_ASC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SITES_TABLE_ID_ASC" | "SITES_TABLE_ID_DESC" | "SITES_TABLE_NAME_ASC" | "SITES_TABLE_NAME_DESC"; +export type CatalogModuleOrderBy = + | 'APIS_TABLE_ID_ASC' + | 'APIS_TABLE_ID_DESC' + | 'APIS_TABLE_NAME_ASC' + | 'APIS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPS_TABLE_ID_ASC' + | 'APPS_TABLE_ID_DESC' + | 'APPS_TABLE_NAME_ASC' + | 'APPS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAINS_TABLE_ID_ASC' + | 'DOMAINS_TABLE_ID_DESC' + | 'DOMAINS_TABLE_NAME_ASC' + | 'DOMAINS_TABLE_NAME_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTIONS_TABLE_ID_ASC' + | 'FUNCTIONS_TABLE_ID_DESC' + | 'FUNCTIONS_TABLE_NAME_ASC' + | 'FUNCTIONS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOURCES_TABLE_ID_ASC' + | 'RESOURCES_TABLE_ID_DESC' + | 'RESOURCES_TABLE_NAME_ASC' + | 'RESOURCES_TABLE_NAME_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SITES_TABLE_ID_ASC' + | 'SITES_TABLE_ID_DESC' + | 'SITES_TABLE_NAME_ASC' + | 'SITES_TABLE_NAME_DESC'; /** Methods to use when ordering `ComputeLogModule`. */ -export type ComputeLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "COMPUTE_LOG_TABLE_ID_ASC" | "COMPUTE_LOG_TABLE_ID_DESC" | "COMPUTE_LOG_TABLE_NAME_ASC" | "COMPUTE_LOG_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; +export type ComputeLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COMPUTE_LOG_TABLE_ID_ASC' + | 'COMPUTE_LOG_TABLE_ID_DESC' + | 'COMPUTE_LOG_TABLE_NAME_ASC' + | 'COMPUTE_LOG_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; /** Methods to use when ordering `ConfigSecretsUserModule`. */ -export type ConfigSecretsUserModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type ConfigSecretsUserModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `ConnectedAccountsModule`. */ -export type ConnectedAccountsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type ConnectedAccountsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `CryptoAddressesModule`. */ -export type CryptoAddressesModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type CryptoAddressesModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `CryptoAuthModule`. */ -export type CryptoAuthModuleOrderBy = "ADDRESSES_TABLE_ID_ASC" | "ADDRESSES_TABLE_ID_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SIGN_IN_RECORD_FAILURE_ASC" | "SIGN_IN_RECORD_FAILURE_DESC" | "SIGN_IN_REQUEST_CHALLENGE_ASC" | "SIGN_IN_REQUEST_CHALLENGE_DESC" | "SIGN_IN_WITH_CHALLENGE_ASC" | "SIGN_IN_WITH_CHALLENGE_DESC" | "SIGN_UP_WITH_KEY_ASC" | "SIGN_UP_WITH_KEY_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC" | "USER_FIELD_ASC" | "USER_FIELD_DESC"; +export type CryptoAuthModuleOrderBy = + | 'ADDRESSES_TABLE_ID_ASC' + | 'ADDRESSES_TABLE_ID_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SIGN_IN_RECORD_FAILURE_ASC' + | 'SIGN_IN_RECORD_FAILURE_DESC' + | 'SIGN_IN_REQUEST_CHALLENGE_ASC' + | 'SIGN_IN_REQUEST_CHALLENGE_DESC' + | 'SIGN_IN_WITH_CHALLENGE_ASC' + | 'SIGN_IN_WITH_CHALLENGE_DESC' + | 'SIGN_UP_WITH_KEY_ASC' + | 'SIGN_UP_WITH_KEY_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'USER_FIELD_ASC' + | 'USER_FIELD_DESC'; /** Methods to use when ordering `DatabaseProvisionModule`. */ -export type DatabaseProvisionModuleOrderBy = "ASYNC_ASC" | "ASYNC_DESC" | "BOOTSTRAP_ERROR_ASC" | "BOOTSTRAP_ERROR_DESC" | "BOOTSTRAP_STATUS_ASC" | "BOOTSTRAP_STATUS_DESC" | "BOOTSTRAP_USER_ASC" | "BOOTSTRAP_USER_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATABASE_NAME_ASC" | "DATABASE_NAME_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "FULFILLED_AT_ASC" | "FULFILLED_AT_DESC" | "ID_ASC" | "ID_DESC" | "MODULES_ASC" | "MODULES_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_DATABASE_ID_ASC" | "SOURCE_DATABASE_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SUBDOMAIN_ASC" | "SUBDOMAIN_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DatabaseProvisionModuleOrderBy = + | 'ASYNC_ASC' + | 'ASYNC_DESC' + | 'BOOTSTRAP_ERROR_ASC' + | 'BOOTSTRAP_ERROR_DESC' + | 'BOOTSTRAP_STATUS_ASC' + | 'BOOTSTRAP_STATUS_DESC' + | 'BOOTSTRAP_USER_ASC' + | 'BOOTSTRAP_USER_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATABASE_NAME_ASC' + | 'DATABASE_NAME_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'FULFILLED_AT_ASC' + | 'FULFILLED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MODULES_ASC' + | 'MODULES_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_DATABASE_ID_ASC' + | 'SOURCE_DATABASE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SUBDOMAIN_ASC' + | 'SUBDOMAIN_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `DatabaseSettingsModule`. */ -export type DatabaseSettingsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATABASE_SETTINGS_TABLE_ID_ASC" | "DATABASE_SETTINGS_TABLE_ID_DESC" | "DATABASE_SETTINGS_TABLE_NAME_ASC" | "DATABASE_SETTINGS_TABLE_NAME_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBKEY_SETTINGS_TABLE_ID_ASC" | "PUBKEY_SETTINGS_TABLE_ID_DESC" | "PUBKEY_SETTINGS_TABLE_NAME_ASC" | "PUBKEY_SETTINGS_TABLE_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RLS_SETTINGS_TABLE_ID_ASC" | "RLS_SETTINGS_TABLE_ID_DESC" | "RLS_SETTINGS_TABLE_NAME_ASC" | "RLS_SETTINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "WEBAUTHN_SETTINGS_TABLE_ID_ASC" | "WEBAUTHN_SETTINGS_TABLE_ID_DESC" | "WEBAUTHN_SETTINGS_TABLE_NAME_ASC" | "WEBAUTHN_SETTINGS_TABLE_NAME_DESC"; +export type DatabaseSettingsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATABASE_SETTINGS_TABLE_ID_ASC' + | 'DATABASE_SETTINGS_TABLE_ID_DESC' + | 'DATABASE_SETTINGS_TABLE_NAME_ASC' + | 'DATABASE_SETTINGS_TABLE_NAME_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBKEY_SETTINGS_TABLE_ID_ASC' + | 'PUBKEY_SETTINGS_TABLE_ID_DESC' + | 'PUBKEY_SETTINGS_TABLE_NAME_ASC' + | 'PUBKEY_SETTINGS_TABLE_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RLS_SETTINGS_TABLE_ID_ASC' + | 'RLS_SETTINGS_TABLE_ID_DESC' + | 'RLS_SETTINGS_TABLE_NAME_ASC' + | 'RLS_SETTINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'WEBAUTHN_SETTINGS_TABLE_ID_ASC' + | 'WEBAUTHN_SETTINGS_TABLE_ID_DESC' + | 'WEBAUTHN_SETTINGS_TABLE_NAME_ASC' + | 'WEBAUTHN_SETTINGS_TABLE_NAME_DESC'; /** Methods to use when ordering `DbPoolConfig`. */ -export type DbPoolConfigOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ENABLED_ASC" | "ENABLED_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "MIN_ASC" | "MIN_DESC" | "NATURAL" | "POOL_OWNER_ID_ASC" | "POOL_OWNER_ID_DESC" | "PRESET_SLUG_ASC" | "PRESET_SLUG_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WARM_TTL_ASC" | "WARM_TTL_DESC"; +export type DbPoolConfigOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ENABLED_ASC' + | 'ENABLED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'MIN_ASC' + | 'MIN_DESC' + | 'NATURAL' + | 'POOL_OWNER_ID_ASC' + | 'POOL_OWNER_ID_DESC' + | 'PRESET_SLUG_ASC' + | 'PRESET_SLUG_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WARM_TTL_ASC' + | 'WARM_TTL_DESC'; /** Methods to use when ordering `DbPool`. */ -export type DbPoolOrderBy = "BOOTSTRAP_ERROR_ASC" | "BOOTSTRAP_ERROR_DESC" | "BOOTSTRAP_STATUS_ASC" | "BOOTSTRAP_STATUS_DESC" | "CLAIMED_AT_ASC" | "CLAIMED_AT_DESC" | "CLAIMED_BY_ASC" | "CLAIMED_BY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRESET_COMMIT_ID_ASC" | "PRESET_COMMIT_ID_DESC" | "PRESET_SLUG_ASC" | "PRESET_SLUG_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DbPoolOrderBy = + | 'BOOTSTRAP_ERROR_ASC' + | 'BOOTSTRAP_ERROR_DESC' + | 'BOOTSTRAP_STATUS_ASC' + | 'BOOTSTRAP_STATUS_DESC' + | 'CLAIMED_AT_ASC' + | 'CLAIMED_AT_DESC' + | 'CLAIMED_BY_ASC' + | 'CLAIMED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRESET_COMMIT_ID_ASC' + | 'PRESET_COMMIT_ID_DESC' + | 'PRESET_SLUG_ASC' + | 'PRESET_SLUG_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `DbPresetModule`. */ -export type DbPresetModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DB_PRESETS_TABLE_ID_ASC" | "DB_PRESETS_TABLE_ID_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_ID_ASC" | "PUBLIC_SCHEMA_ID_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORE_NAME_ASC" | "STORE_NAME_DESC"; +export type DbPresetModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DB_PRESETS_TABLE_ID_ASC' + | 'DB_PRESETS_TABLE_ID_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_ID_ASC' + | 'PUBLIC_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORE_NAME_ASC' + | 'STORE_NAME_DESC'; /** Methods to use when ordering `DbUsageModule`. */ -export type DbUsageModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "COLLECT_DB_QUERY_STATS_FUNCTION_ASC" | "COLLECT_DB_QUERY_STATS_FUNCTION_DESC" | "COLLECT_DB_TABLE_STATS_FUNCTION_ASC" | "COLLECT_DB_TABLE_STATS_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "QUERY_STATS_LOG_TABLE_ID_ASC" | "QUERY_STATS_LOG_TABLE_ID_DESC" | "QUERY_STATS_LOG_TABLE_NAME_ASC" | "QUERY_STATS_LOG_TABLE_NAME_DESC" | "QUERY_STATS_SUMMARY_TABLE_ID_ASC" | "QUERY_STATS_SUMMARY_TABLE_ID_DESC" | "QUERY_STATS_SUMMARY_TABLE_NAME_ASC" | "QUERY_STATS_SUMMARY_TABLE_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_DESC" | "ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_STATS_LOG_TABLE_ID_ASC" | "TABLE_STATS_LOG_TABLE_ID_DESC" | "TABLE_STATS_LOG_TABLE_NAME_ASC" | "TABLE_STATS_LOG_TABLE_NAME_DESC" | "TABLE_STATS_SUMMARY_TABLE_ID_ASC" | "TABLE_STATS_SUMMARY_TABLE_ID_DESC" | "TABLE_STATS_SUMMARY_TABLE_NAME_ASC" | "TABLE_STATS_SUMMARY_TABLE_NAME_DESC"; +export type DbUsageModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COLLECT_DB_QUERY_STATS_FUNCTION_ASC' + | 'COLLECT_DB_QUERY_STATS_FUNCTION_DESC' + | 'COLLECT_DB_TABLE_STATS_FUNCTION_ASC' + | 'COLLECT_DB_TABLE_STATS_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'QUERY_STATS_LOG_TABLE_ID_ASC' + | 'QUERY_STATS_LOG_TABLE_ID_DESC' + | 'QUERY_STATS_LOG_TABLE_NAME_ASC' + | 'QUERY_STATS_LOG_TABLE_NAME_DESC' + | 'QUERY_STATS_SUMMARY_TABLE_ID_ASC' + | 'QUERY_STATS_SUMMARY_TABLE_ID_DESC' + | 'QUERY_STATS_SUMMARY_TABLE_NAME_ASC' + | 'QUERY_STATS_SUMMARY_TABLE_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_DESC' + | 'ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_STATS_LOG_TABLE_ID_ASC' + | 'TABLE_STATS_LOG_TABLE_ID_DESC' + | 'TABLE_STATS_LOG_TABLE_NAME_ASC' + | 'TABLE_STATS_LOG_TABLE_NAME_DESC' + | 'TABLE_STATS_SUMMARY_TABLE_ID_ASC' + | 'TABLE_STATS_SUMMARY_TABLE_ID_DESC' + | 'TABLE_STATS_SUMMARY_TABLE_NAME_ASC' + | 'TABLE_STATS_SUMMARY_TABLE_NAME_DESC'; /** Methods to use when ordering `DefaultIdsModule`. */ -export type DefaultIdsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type DefaultIdsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `DenormalizedTableField`. */ -export type DenormalizedTableFieldOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "FUNC_NAME_ASC" | "FUNC_NAME_DESC" | "FUNC_ORDER_ASC" | "FUNC_ORDER_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_ID_ASC" | "REF_FIELD_ID_DESC" | "REF_IDS_ASC" | "REF_IDS_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SET_IDS_ASC" | "SET_IDS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATE_DEFAULTS_ASC" | "UPDATE_DEFAULTS_DESC" | "USE_UPDATES_ASC" | "USE_UPDATES_DESC"; +export type DenormalizedTableFieldOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'FUNC_NAME_ASC' + | 'FUNC_NAME_DESC' + | 'FUNC_ORDER_ASC' + | 'FUNC_ORDER_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_ID_ASC' + | 'REF_FIELD_ID_DESC' + | 'REF_IDS_ASC' + | 'REF_IDS_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SET_IDS_ASC' + | 'SET_IDS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATE_DEFAULTS_ASC' + | 'UPDATE_DEFAULTS_DESC' + | 'USE_UPDATES_ASC' + | 'USE_UPDATES_DESC'; /** Methods to use when ordering `DevicesModule`. */ -export type DevicesModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEVICE_SETTINGS_TABLE_ID_ASC" | "DEVICE_SETTINGS_TABLE_ID_DESC" | "DEVICE_SETTINGS_TABLE_NAME_ASC" | "DEVICE_SETTINGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "USER_DEVICES_TABLE_ID_ASC" | "USER_DEVICES_TABLE_ID_DESC" | "USER_DEVICES_TABLE_NAME_ASC" | "USER_DEVICES_TABLE_NAME_DESC"; +export type DevicesModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_ID_ASC' + | 'DEVICE_SETTINGS_TABLE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_NAME_ASC' + | 'DEVICE_SETTINGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'USER_DEVICES_TABLE_ID_ASC' + | 'USER_DEVICES_TABLE_ID_DESC' + | 'USER_DEVICES_TABLE_NAME_ASC' + | 'USER_DEVICES_TABLE_NAME_DESC'; /** Methods to use when ordering `DomainModule`. */ -export type DomainModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAINS_TABLE_ID_ASC" | "DOMAINS_TABLE_ID_DESC" | "DOMAINS_TABLE_NAME_ASC" | "DOMAINS_TABLE_NAME_DESC" | "DOMAIN_EVENTS_TABLE_ID_ASC" | "DOMAIN_EVENTS_TABLE_ID_DESC" | "DOMAIN_EVENTS_TABLE_NAME_ASC" | "DOMAIN_EVENTS_TABLE_NAME_DESC" | "DOMAIN_VERIFICATIONS_TABLE_ID_ASC" | "DOMAIN_VERIFICATIONS_TABLE_ID_DESC" | "DOMAIN_VERIFICATIONS_TABLE_NAME_ASC" | "DOMAIN_VERIFICATIONS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAINS_TABLE_ID_ASC" | "MANAGED_DOMAINS_TABLE_ID_DESC" | "MANAGED_DOMAINS_TABLE_NAME_ASC" | "MANAGED_DOMAINS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type DomainModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAINS_TABLE_ID_ASC' + | 'DOMAINS_TABLE_ID_DESC' + | 'DOMAINS_TABLE_NAME_ASC' + | 'DOMAINS_TABLE_NAME_DESC' + | 'DOMAIN_EVENTS_TABLE_ID_ASC' + | 'DOMAIN_EVENTS_TABLE_ID_DESC' + | 'DOMAIN_EVENTS_TABLE_NAME_ASC' + | 'DOMAIN_EVENTS_TABLE_NAME_DESC' + | 'DOMAIN_VERIFICATIONS_TABLE_ID_ASC' + | 'DOMAIN_VERIFICATIONS_TABLE_ID_DESC' + | 'DOMAIN_VERIFICATIONS_TABLE_NAME_ASC' + | 'DOMAIN_VERIFICATIONS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAINS_TABLE_ID_ASC' + | 'MANAGED_DOMAINS_TABLE_ID_DESC' + | 'MANAGED_DOMAINS_TABLE_NAME_ASC' + | 'MANAGED_DOMAINS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `EmailsModule`. */ -export type EmailsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type EmailsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `EntityTypeProvision`. */ -export type EntityTypeProvisionOrderBy = "AGENTS_ASC" | "AGENTS_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FUNCTIONS_ASC" | "FUNCTIONS_DESC" | "GRAPHS_ASC" | "GRAPHS_DESC" | "HAS_INVITES_ASC" | "HAS_INVITES_DESC" | "HAS_INVITE_ACHIEVEMENTS_ASC" | "HAS_INVITE_ACHIEVEMENTS_DESC" | "HAS_LEVELS_ASC" | "HAS_LEVELS_DESC" | "HAS_LIMITS_ASC" | "HAS_LIMITS_DESC" | "HAS_PROFILES_ASC" | "HAS_PROFILES_DESC" | "ID_ASC" | "ID_DESC" | "IS_VISIBLE_ASC" | "IS_VISIBLE_DESC" | "NAMESPACES_ASC" | "NAMESPACES_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUT_AGENT_MODULE_ID_ASC" | "OUT_AGENT_MODULE_ID_DESC" | "OUT_BUCKETS_TABLE_ID_ASC" | "OUT_BUCKETS_TABLE_ID_DESC" | "OUT_DEFINITIONS_TABLE_ID_ASC" | "OUT_DEFINITIONS_TABLE_ID_DESC" | "OUT_ENTITY_TABLE_ID_ASC" | "OUT_ENTITY_TABLE_ID_DESC" | "OUT_ENTITY_TABLE_NAME_ASC" | "OUT_ENTITY_TABLE_NAME_DESC" | "OUT_EXECUTION_LOGS_TABLE_ID_ASC" | "OUT_EXECUTION_LOGS_TABLE_ID_DESC" | "OUT_FILES_TABLE_ID_ASC" | "OUT_FILES_TABLE_ID_DESC" | "OUT_FUNCTION_MODULE_ID_ASC" | "OUT_FUNCTION_MODULE_ID_DESC" | "OUT_GRAPHS_TABLE_ID_ASC" | "OUT_GRAPHS_TABLE_ID_DESC" | "OUT_GRAPH_MODULE_ID_ASC" | "OUT_GRAPH_MODULE_ID_DESC" | "OUT_INSTALLED_MODULES_ASC" | "OUT_INSTALLED_MODULES_DESC" | "OUT_INVITES_MODULE_ID_ASC" | "OUT_INVITES_MODULE_ID_DESC" | "OUT_INVOCATIONS_TABLE_ID_ASC" | "OUT_INVOCATIONS_TABLE_ID_DESC" | "OUT_MEMBERSHIP_TYPE_ASC" | "OUT_MEMBERSHIP_TYPE_DESC" | "OUT_NAMESPACES_TABLE_ID_ASC" | "OUT_NAMESPACES_TABLE_ID_DESC" | "OUT_NAMESPACE_EVENTS_TABLE_ID_ASC" | "OUT_NAMESPACE_EVENTS_TABLE_ID_DESC" | "OUT_NAMESPACE_MODULE_ID_ASC" | "OUT_NAMESPACE_MODULE_ID_DESC" | "OUT_PATH_SHARES_TABLE_ID_ASC" | "OUT_PATH_SHARES_TABLE_ID_DESC" | "OUT_STORAGE_MODULE_ID_ASC" | "OUT_STORAGE_MODULE_ID_DESC" | "PARENT_ENTITY_ASC" | "PARENT_ENTITY_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SKIP_ENTITY_POLICIES_ASC" | "SKIP_ENTITY_POLICIES_DESC" | "STORAGE_ASC" | "STORAGE_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "TABLE_PROVISION_ASC" | "TABLE_PROVISION_DESC"; +export type EntityTypeProvisionOrderBy = + | 'AGENTS_ASC' + | 'AGENTS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FUNCTIONS_ASC' + | 'FUNCTIONS_DESC' + | 'GRAPHS_ASC' + | 'GRAPHS_DESC' + | 'HAS_INVITES_ASC' + | 'HAS_INVITES_DESC' + | 'HAS_INVITE_ACHIEVEMENTS_ASC' + | 'HAS_INVITE_ACHIEVEMENTS_DESC' + | 'HAS_LEVELS_ASC' + | 'HAS_LEVELS_DESC' + | 'HAS_LIMITS_ASC' + | 'HAS_LIMITS_DESC' + | 'HAS_PROFILES_ASC' + | 'HAS_PROFILES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VISIBLE_ASC' + | 'IS_VISIBLE_DESC' + | 'NAMESPACES_ASC' + | 'NAMESPACES_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUT_AGENT_MODULE_ID_ASC' + | 'OUT_AGENT_MODULE_ID_DESC' + | 'OUT_BUCKETS_TABLE_ID_ASC' + | 'OUT_BUCKETS_TABLE_ID_DESC' + | 'OUT_DEFINITIONS_TABLE_ID_ASC' + | 'OUT_DEFINITIONS_TABLE_ID_DESC' + | 'OUT_ENTITY_TABLE_ID_ASC' + | 'OUT_ENTITY_TABLE_ID_DESC' + | 'OUT_ENTITY_TABLE_NAME_ASC' + | 'OUT_ENTITY_TABLE_NAME_DESC' + | 'OUT_EXECUTION_LOGS_TABLE_ID_ASC' + | 'OUT_EXECUTION_LOGS_TABLE_ID_DESC' + | 'OUT_FILES_TABLE_ID_ASC' + | 'OUT_FILES_TABLE_ID_DESC' + | 'OUT_FUNCTION_MODULE_ID_ASC' + | 'OUT_FUNCTION_MODULE_ID_DESC' + | 'OUT_GRAPHS_TABLE_ID_ASC' + | 'OUT_GRAPHS_TABLE_ID_DESC' + | 'OUT_GRAPH_MODULE_ID_ASC' + | 'OUT_GRAPH_MODULE_ID_DESC' + | 'OUT_INSTALLED_MODULES_ASC' + | 'OUT_INSTALLED_MODULES_DESC' + | 'OUT_INVITES_MODULE_ID_ASC' + | 'OUT_INVITES_MODULE_ID_DESC' + | 'OUT_INVOCATIONS_TABLE_ID_ASC' + | 'OUT_INVOCATIONS_TABLE_ID_DESC' + | 'OUT_MEMBERSHIP_TYPE_ASC' + | 'OUT_MEMBERSHIP_TYPE_DESC' + | 'OUT_NAMESPACES_TABLE_ID_ASC' + | 'OUT_NAMESPACES_TABLE_ID_DESC' + | 'OUT_NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'OUT_NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'OUT_NAMESPACE_MODULE_ID_ASC' + | 'OUT_NAMESPACE_MODULE_ID_DESC' + | 'OUT_PATH_SHARES_TABLE_ID_ASC' + | 'OUT_PATH_SHARES_TABLE_ID_DESC' + | 'OUT_STORAGE_MODULE_ID_ASC' + | 'OUT_STORAGE_MODULE_ID_DESC' + | 'PARENT_ENTITY_ASC' + | 'PARENT_ENTITY_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SKIP_ENTITY_POLICIES_ASC' + | 'SKIP_ENTITY_POLICIES_DESC' + | 'STORAGE_ASC' + | 'STORAGE_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'TABLE_PROVISION_ASC' + | 'TABLE_PROVISION_DESC'; /** Methods to use when ordering `EventsModule`. */ -export type EventsModuleOrderBy = "ACHIEVEMENT_REWARDS_TABLE_ID_ASC" | "ACHIEVEMENT_REWARDS_TABLE_ID_DESC" | "ACHIEVEMENT_REWARDS_TABLE_NAME_ASC" | "ACHIEVEMENT_REWARDS_TABLE_NAME_DESC" | "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EVENTS_TABLE_ID_ASC" | "EVENTS_TABLE_ID_DESC" | "EVENTS_TABLE_NAME_ASC" | "EVENTS_TABLE_NAME_DESC" | "EVENT_AGGREGATES_TABLE_ID_ASC" | "EVENT_AGGREGATES_TABLE_ID_DESC" | "EVENT_AGGREGATES_TABLE_NAME_ASC" | "EVENT_AGGREGATES_TABLE_NAME_DESC" | "EVENT_TYPES_TABLE_ID_ASC" | "EVENT_TYPES_TABLE_ID_DESC" | "EVENT_TYPES_TABLE_NAME_ASC" | "EVENT_TYPES_TABLE_NAME_DESC" | "GRANT_ACHIEVEMENT_ASC" | "GRANT_ACHIEVEMENT_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "LEVELS_TABLE_ID_ASC" | "LEVELS_TABLE_ID_DESC" | "LEVELS_TABLE_NAME_ASC" | "LEVELS_TABLE_NAME_DESC" | "LEVEL_ACHIEVED_ASC" | "LEVEL_ACHIEVED_DESC" | "LEVEL_GRANTS_TABLE_ID_ASC" | "LEVEL_GRANTS_TABLE_ID_DESC" | "LEVEL_GRANTS_TABLE_NAME_ASC" | "LEVEL_GRANTS_TABLE_NAME_DESC" | "LEVEL_REQUIREMENTS_TABLE_ID_ASC" | "LEVEL_REQUIREMENTS_TABLE_ID_DESC" | "LEVEL_REQUIREMENTS_TABLE_NAME_ASC" | "LEVEL_REQUIREMENTS_TABLE_NAME_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RECORD_EVENT_ASC" | "RECORD_EVENT_DESC" | "REMOVE_EVENT_ASC" | "REMOVE_EVENT_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STEPS_REQUIRED_ASC" | "STEPS_REQUIRED_DESC" | "TG_ACHIEVEMENT_REWARD_ASC" | "TG_ACHIEVEMENT_REWARD_DESC" | "TG_CHECK_ACHIEVEMENTS_ASC" | "TG_CHECK_ACHIEVEMENTS_DESC" | "TG_EVENT_ASC" | "TG_EVENT_BOOL_ASC" | "TG_EVENT_BOOL_DESC" | "TG_EVENT_DESC" | "TG_EVENT_TOGGLE_ASC" | "TG_EVENT_TOGGLE_BOOL_ASC" | "TG_EVENT_TOGGLE_BOOL_DESC" | "TG_EVENT_TOGGLE_DESC" | "TG_UPDATE_AGGREGATES_ASC" | "TG_UPDATE_AGGREGATES_DESC" | "UPSERT_AGGREGATE_ASC" | "UPSERT_AGGREGATE_DESC"; +export type EventsModuleOrderBy = + | 'ACHIEVEMENT_REWARDS_TABLE_ID_ASC' + | 'ACHIEVEMENT_REWARDS_TABLE_ID_DESC' + | 'ACHIEVEMENT_REWARDS_TABLE_NAME_ASC' + | 'ACHIEVEMENT_REWARDS_TABLE_NAME_DESC' + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EVENTS_TABLE_ID_ASC' + | 'EVENTS_TABLE_ID_DESC' + | 'EVENTS_TABLE_NAME_ASC' + | 'EVENTS_TABLE_NAME_DESC' + | 'EVENT_AGGREGATES_TABLE_ID_ASC' + | 'EVENT_AGGREGATES_TABLE_ID_DESC' + | 'EVENT_AGGREGATES_TABLE_NAME_ASC' + | 'EVENT_AGGREGATES_TABLE_NAME_DESC' + | 'EVENT_TYPES_TABLE_ID_ASC' + | 'EVENT_TYPES_TABLE_ID_DESC' + | 'EVENT_TYPES_TABLE_NAME_ASC' + | 'EVENT_TYPES_TABLE_NAME_DESC' + | 'GRANT_ACHIEVEMENT_ASC' + | 'GRANT_ACHIEVEMENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'LEVELS_TABLE_ID_ASC' + | 'LEVELS_TABLE_ID_DESC' + | 'LEVELS_TABLE_NAME_ASC' + | 'LEVELS_TABLE_NAME_DESC' + | 'LEVEL_ACHIEVED_ASC' + | 'LEVEL_ACHIEVED_DESC' + | 'LEVEL_GRANTS_TABLE_ID_ASC' + | 'LEVEL_GRANTS_TABLE_ID_DESC' + | 'LEVEL_GRANTS_TABLE_NAME_ASC' + | 'LEVEL_GRANTS_TABLE_NAME_DESC' + | 'LEVEL_REQUIREMENTS_TABLE_ID_ASC' + | 'LEVEL_REQUIREMENTS_TABLE_ID_DESC' + | 'LEVEL_REQUIREMENTS_TABLE_NAME_ASC' + | 'LEVEL_REQUIREMENTS_TABLE_NAME_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RECORD_EVENT_ASC' + | 'RECORD_EVENT_DESC' + | 'REMOVE_EVENT_ASC' + | 'REMOVE_EVENT_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STEPS_REQUIRED_ASC' + | 'STEPS_REQUIRED_DESC' + | 'TG_ACHIEVEMENT_REWARD_ASC' + | 'TG_ACHIEVEMENT_REWARD_DESC' + | 'TG_CHECK_ACHIEVEMENTS_ASC' + | 'TG_CHECK_ACHIEVEMENTS_DESC' + | 'TG_EVENT_ASC' + | 'TG_EVENT_BOOL_ASC' + | 'TG_EVENT_BOOL_DESC' + | 'TG_EVENT_DESC' + | 'TG_EVENT_TOGGLE_ASC' + | 'TG_EVENT_TOGGLE_BOOL_ASC' + | 'TG_EVENT_TOGGLE_BOOL_DESC' + | 'TG_EVENT_TOGGLE_DESC' + | 'TG_UPDATE_AGGREGATES_ASC' + | 'TG_UPDATE_AGGREGATES_DESC' + | 'UPSERT_AGGREGATE_ASC' + | 'UPSERT_AGGREGATE_DESC'; /** Methods to use when ordering `FunctionDeploymentModule`. */ -export type FunctionDeploymentModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DEPLOYMENTS_TABLE_ID_ASC" | "DEPLOYMENTS_TABLE_ID_DESC" | "DEPLOYMENTS_TABLE_NAME_ASC" | "DEPLOYMENTS_TABLE_NAME_DESC" | "DEPLOYMENT_EVENTS_TABLE_ID_ASC" | "DEPLOYMENT_EVENTS_TABLE_ID_DESC" | "DEPLOYMENT_EVENTS_TABLE_NAME_ASC" | "DEPLOYMENT_EVENTS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type FunctionDeploymentModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DEPLOYMENTS_TABLE_ID_ASC' + | 'DEPLOYMENTS_TABLE_ID_DESC' + | 'DEPLOYMENTS_TABLE_NAME_ASC' + | 'DEPLOYMENTS_TABLE_NAME_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `FunctionInvocationModule`. */ -export type FunctionInvocationModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "ATTEMPTS_TABLE_ID_ASC" | "ATTEMPTS_TABLE_ID_DESC" | "ATTEMPTS_TABLE_NAME_ASC" | "ATTEMPTS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EXECUTION_LOGS_TABLE_ID_ASC" | "EXECUTION_LOGS_TABLE_ID_DESC" | "EXECUTION_LOGS_TABLE_NAME_ASC" | "EXECUTION_LOGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATIONS_TABLE_ID_ASC" | "INVOCATIONS_TABLE_ID_DESC" | "INVOCATIONS_TABLE_NAME_ASC" | "INVOCATIONS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type FunctionInvocationModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'ATTEMPTS_TABLE_ID_ASC' + | 'ATTEMPTS_TABLE_ID_DESC' + | 'ATTEMPTS_TABLE_NAME_ASC' + | 'ATTEMPTS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EXECUTION_LOGS_TABLE_ID_ASC' + | 'EXECUTION_LOGS_TABLE_ID_DESC' + | 'EXECUTION_LOGS_TABLE_NAME_ASC' + | 'EXECUTION_LOGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATIONS_TABLE_ID_ASC' + | 'INVOCATIONS_TABLE_ID_DESC' + | 'INVOCATIONS_TABLE_NAME_ASC' + | 'INVOCATIONS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `FunctionModule`. */ -export type FunctionModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BINDINGS_TABLE_ID_ASC" | "BINDINGS_TABLE_ID_DESC" | "BINDINGS_TABLE_NAME_ASC" | "BINDINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DEFINITIONS_TABLE_ID_ASC" | "DEFINITIONS_TABLE_ID_DESC" | "DEFINITIONS_TABLE_NAME_ASC" | "DEFINITIONS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HAS_CRON_ASC" | "HAS_CRON_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEDULES_TABLE_ID_ASC" | "SCHEDULES_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type FunctionModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BINDINGS_TABLE_ID_ASC' + | 'BINDINGS_TABLE_ID_DESC' + | 'BINDINGS_TABLE_NAME_ASC' + | 'BINDINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DEFINITIONS_TABLE_ID_ASC' + | 'DEFINITIONS_TABLE_ID_DESC' + | 'DEFINITIONS_TABLE_NAME_ASC' + | 'DEFINITIONS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HAS_CRON_ASC' + | 'HAS_CRON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEDULES_TABLE_ID_ASC' + | 'SCHEDULES_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `GraphExecutionModule`. */ -export type GraphExecutionModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EXECUTIONS_TABLE_ID_ASC" | "EXECUTIONS_TABLE_ID_DESC" | "EXECUTIONS_TABLE_NAME_ASC" | "EXECUTIONS_TABLE_NAME_DESC" | "GRAPH_MODULE_ID_ASC" | "GRAPH_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODE_STATES_TABLE_ID_ASC" | "NODE_STATES_TABLE_ID_DESC" | "NODE_STATES_TABLE_NAME_ASC" | "NODE_STATES_TABLE_NAME_DESC" | "OUTPUTS_TABLE_ID_ASC" | "OUTPUTS_TABLE_ID_DESC" | "OUTPUTS_TABLE_NAME_ASC" | "OUTPUTS_TABLE_NAME_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type GraphExecutionModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_ID_ASC' + | 'EXECUTIONS_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_NAME_ASC' + | 'EXECUTIONS_TABLE_NAME_DESC' + | 'GRAPH_MODULE_ID_ASC' + | 'GRAPH_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODE_STATES_TABLE_ID_ASC' + | 'NODE_STATES_TABLE_ID_DESC' + | 'NODE_STATES_TABLE_NAME_ASC' + | 'NODE_STATES_TABLE_NAME_DESC' + | 'OUTPUTS_TABLE_ID_ASC' + | 'OUTPUTS_TABLE_ID_DESC' + | 'OUTPUTS_TABLE_NAME_ASC' + | 'OUTPUTS_TABLE_NAME_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `GraphModule`. */ -export type GraphModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GRAPHS_TABLE_ID_ASC" | "GRAPHS_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_ID_ASC" | "PUBLIC_SCHEMA_ID_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type GraphModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GRAPHS_TABLE_ID_ASC' + | 'GRAPHS_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_ID_ASC' + | 'PUBLIC_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `HierarchyModule`. */ -export type HierarchyModuleOrderBy = "CHART_EDGES_TABLE_ID_ASC" | "CHART_EDGES_TABLE_ID_DESC" | "CHART_EDGES_TABLE_NAME_ASC" | "CHART_EDGES_TABLE_NAME_DESC" | "CHART_EDGE_GRANTS_TABLE_ID_ASC" | "CHART_EDGE_GRANTS_TABLE_ID_DESC" | "CHART_EDGE_GRANTS_TABLE_NAME_ASC" | "CHART_EDGE_GRANTS_TABLE_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GET_MANAGERS_FUNCTION_ASC" | "GET_MANAGERS_FUNCTION_DESC" | "GET_SUBORDINATES_FUNCTION_ASC" | "GET_SUBORDINATES_FUNCTION_DESC" | "HIERARCHY_SPRT_TABLE_ID_ASC" | "HIERARCHY_SPRT_TABLE_ID_DESC" | "HIERARCHY_SPRT_TABLE_NAME_ASC" | "HIERARCHY_SPRT_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_MANAGER_OF_FUNCTION_ASC" | "IS_MANAGER_OF_FUNCTION_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "REBUILD_HIERARCHY_FUNCTION_ASC" | "REBUILD_HIERARCHY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SPRT_TABLE_NAME_ASC" | "SPRT_TABLE_NAME_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; +export type HierarchyModuleOrderBy = + | 'CHART_EDGES_TABLE_ID_ASC' + | 'CHART_EDGES_TABLE_ID_DESC' + | 'CHART_EDGES_TABLE_NAME_ASC' + | 'CHART_EDGES_TABLE_NAME_DESC' + | 'CHART_EDGE_GRANTS_TABLE_ID_ASC' + | 'CHART_EDGE_GRANTS_TABLE_ID_DESC' + | 'CHART_EDGE_GRANTS_TABLE_NAME_ASC' + | 'CHART_EDGE_GRANTS_TABLE_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GET_MANAGERS_FUNCTION_ASC' + | 'GET_MANAGERS_FUNCTION_DESC' + | 'GET_SUBORDINATES_FUNCTION_ASC' + | 'GET_SUBORDINATES_FUNCTION_DESC' + | 'HIERARCHY_SPRT_TABLE_ID_ASC' + | 'HIERARCHY_SPRT_TABLE_ID_DESC' + | 'HIERARCHY_SPRT_TABLE_NAME_ASC' + | 'HIERARCHY_SPRT_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_MANAGER_OF_FUNCTION_ASC' + | 'IS_MANAGER_OF_FUNCTION_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'REBUILD_HIERARCHY_FUNCTION_ASC' + | 'REBUILD_HIERARCHY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SPRT_TABLE_NAME_ASC' + | 'SPRT_TABLE_NAME_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; /** Methods to use when ordering `HttpRouteModule`. */ -export type HttpRouteModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "HTTP_ROUTES_TABLE_ID_ASC" | "HTTP_ROUTES_TABLE_ID_DESC" | "HTTP_ROUTES_TABLE_NAME_ASC" | "HTTP_ROUTES_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVER_FUNCTION_NAME_ASC" | "RESOLVER_FUNCTION_NAME_DESC" | "RESOURCE_MODULE_ID_ASC" | "RESOURCE_MODULE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORAGE_MODULE_ID_ASC" | "STORAGE_MODULE_ID_DESC"; +export type HttpRouteModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'HTTP_ROUTES_TABLE_ID_ASC' + | 'HTTP_ROUTES_TABLE_ID_DESC' + | 'HTTP_ROUTES_TABLE_NAME_ASC' + | 'HTTP_ROUTES_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVER_FUNCTION_NAME_ASC' + | 'RESOLVER_FUNCTION_NAME_DESC' + | 'RESOURCE_MODULE_ID_ASC' + | 'RESOURCE_MODULE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORAGE_MODULE_ID_ASC' + | 'STORAGE_MODULE_ID_DESC'; /** Methods to use when ordering `I18NModule`. */ -export type I18NModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SETTINGS_TABLE_ID_ASC" | "SETTINGS_TABLE_ID_DESC"; +export type I18NModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SETTINGS_TABLE_ID_ASC' + | 'SETTINGS_TABLE_ID_DESC'; /** Methods to use when ordering `IdentityProvidersModule`. */ -export type IdentityProvidersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type IdentityProvidersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `InferenceLogModule`. */ -export type InferenceLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INFERENCE_LOG_TABLE_ID_ASC" | "INFERENCE_LOG_TABLE_ID_DESC" | "INFERENCE_LOG_TABLE_NAME_ASC" | "INFERENCE_LOG_TABLE_NAME_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; +export type InferenceLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INFERENCE_LOG_TABLE_ID_ASC' + | 'INFERENCE_LOG_TABLE_ID_DESC' + | 'INFERENCE_LOG_TABLE_NAME_ASC' + | 'INFERENCE_LOG_TABLE_NAME_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; /** Methods to use when ordering `InfraConfigModule`. */ -export type InfraConfigModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CONFIG_TABLE_ID_ASC" | "CONFIG_TABLE_ID_DESC" | "CONFIG_TABLE_NAME_ASC" | "CONFIG_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type InfraConfigModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CONFIG_TABLE_ID_ASC' + | 'CONFIG_TABLE_ID_DESC' + | 'CONFIG_TABLE_NAME_ASC' + | 'CONFIG_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `InfraSecretsModule`. */ -export type InfraSecretsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SECRETS_TABLE_NAME_ASC" | "SECRETS_TABLE_NAME_DESC"; +export type InfraSecretsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SECRETS_TABLE_NAME_ASC' + | 'SECRETS_TABLE_NAME_DESC'; /** Methods to use when ordering `IntegrationProvidersModule`. */ -export type IntegrationProvidersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type IntegrationProvidersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `InternalSecretsModule`. */ -export type InternalSecretsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERNAL_SECRETS_TABLE_ID_ASC" | "INTERNAL_SECRETS_TABLE_ID_DESC" | "INTERNAL_SECRETS_TABLE_NAME_ASC" | "INTERNAL_SECRETS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type InternalSecretsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERNAL_SECRETS_TABLE_ID_ASC' + | 'INTERNAL_SECRETS_TABLE_ID_DESC' + | 'INTERNAL_SECRETS_TABLE_NAME_ASC' + | 'INTERNAL_SECRETS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `InvitesModule`. */ -export type InvitesModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CLAIMED_INVITES_TABLE_ID_ASC" | "CLAIMED_INVITES_TABLE_ID_DESC" | "CLAIMED_INVITES_TABLE_NAME_ASC" | "CLAIMED_INVITES_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EMAILS_TABLE_ID_ASC" | "EMAILS_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVITES_TABLE_ID_ASC" | "INVITES_TABLE_ID_DESC" | "INVITES_TABLE_NAME_ASC" | "INVITES_TABLE_NAME_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SUBMIT_INVITE_CODE_FUNCTION_ASC" | "SUBMIT_INVITE_CODE_FUNCTION_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; +export type InvitesModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CLAIMED_INVITES_TABLE_ID_ASC' + | 'CLAIMED_INVITES_TABLE_ID_DESC' + | 'CLAIMED_INVITES_TABLE_NAME_ASC' + | 'CLAIMED_INVITES_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EMAILS_TABLE_ID_ASC' + | 'EMAILS_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITES_TABLE_ID_ASC' + | 'INVITES_TABLE_ID_DESC' + | 'INVITES_TABLE_NAME_ASC' + | 'INVITES_TABLE_NAME_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SUBMIT_INVITE_CODE_FUNCTION_ASC' + | 'SUBMIT_INVITE_CODE_FUNCTION_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; /** Methods to use when ordering `LimitsModule`. */ -export type LimitsModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "AGGREGATE_TABLE_ID_ASC" | "AGGREGATE_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "CAP_CHECK_TRIGGER_ASC" | "CAP_CHECK_TRIGGER_DESC" | "CREDIT_CODES_TABLE_ID_ASC" | "CREDIT_CODES_TABLE_ID_DESC" | "CREDIT_CODE_ITEMS_TABLE_ID_ASC" | "CREDIT_CODE_ITEMS_TABLE_ID_DESC" | "CREDIT_REDEMPTIONS_TABLE_ID_ASC" | "CREDIT_REDEMPTIONS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_TABLE_ID_ASC" | "DEFAULT_TABLE_ID_DESC" | "DEFAULT_TABLE_NAME_ASC" | "DEFAULT_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EVENTS_TABLE_ID_ASC" | "EVENTS_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_ASC" | "LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_DESC" | "LIMIT_CAPS_DEFAULTS_TABLE_ID_ASC" | "LIMIT_CAPS_DEFAULTS_TABLE_ID_DESC" | "LIMIT_CAPS_TABLE_ID_ASC" | "LIMIT_CAPS_TABLE_ID_DESC" | "LIMIT_CHECK_FUNCTION_ASC" | "LIMIT_CHECK_FUNCTION_DESC" | "LIMIT_CHECK_SOFT_FUNCTION_ASC" | "LIMIT_CHECK_SOFT_FUNCTION_DESC" | "LIMIT_CREDITS_TABLE_ID_ASC" | "LIMIT_CREDITS_TABLE_ID_DESC" | "LIMIT_DECREMENT_FUNCTION_ASC" | "LIMIT_DECREMENT_FUNCTION_DESC" | "LIMIT_DECREMENT_TRIGGER_ASC" | "LIMIT_DECREMENT_TRIGGER_DESC" | "LIMIT_INCREMENT_FUNCTION_ASC" | "LIMIT_INCREMENT_FUNCTION_DESC" | "LIMIT_INCREMENT_TRIGGER_ASC" | "LIMIT_INCREMENT_TRIGGER_DESC" | "LIMIT_UPDATE_TRIGGER_ASC" | "LIMIT_UPDATE_TRIGGER_DESC" | "LIMIT_WARNINGS_TABLE_ID_ASC" | "LIMIT_WARNINGS_TABLE_ID_DESC" | "LIMIT_WARNING_STATE_TABLE_ID_ASC" | "LIMIT_WARNING_STATE_TABLE_ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVE_CAP_FUNCTION_ASC" | "RESOLVE_CAP_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type LimitsModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'AGGREGATE_TABLE_ID_ASC' + | 'AGGREGATE_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CAP_CHECK_TRIGGER_ASC' + | 'CAP_CHECK_TRIGGER_DESC' + | 'CREDIT_CODES_TABLE_ID_ASC' + | 'CREDIT_CODES_TABLE_ID_DESC' + | 'CREDIT_CODE_ITEMS_TABLE_ID_ASC' + | 'CREDIT_CODE_ITEMS_TABLE_ID_DESC' + | 'CREDIT_REDEMPTIONS_TABLE_ID_ASC' + | 'CREDIT_REDEMPTIONS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_TABLE_ID_ASC' + | 'DEFAULT_TABLE_ID_DESC' + | 'DEFAULT_TABLE_NAME_ASC' + | 'DEFAULT_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EVENTS_TABLE_ID_ASC' + | 'EVENTS_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_ASC' + | 'LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_DESC' + | 'LIMIT_CAPS_DEFAULTS_TABLE_ID_ASC' + | 'LIMIT_CAPS_DEFAULTS_TABLE_ID_DESC' + | 'LIMIT_CAPS_TABLE_ID_ASC' + | 'LIMIT_CAPS_TABLE_ID_DESC' + | 'LIMIT_CHECK_FUNCTION_ASC' + | 'LIMIT_CHECK_FUNCTION_DESC' + | 'LIMIT_CHECK_SOFT_FUNCTION_ASC' + | 'LIMIT_CHECK_SOFT_FUNCTION_DESC' + | 'LIMIT_CREDITS_TABLE_ID_ASC' + | 'LIMIT_CREDITS_TABLE_ID_DESC' + | 'LIMIT_DECREMENT_FUNCTION_ASC' + | 'LIMIT_DECREMENT_FUNCTION_DESC' + | 'LIMIT_DECREMENT_TRIGGER_ASC' + | 'LIMIT_DECREMENT_TRIGGER_DESC' + | 'LIMIT_INCREMENT_FUNCTION_ASC' + | 'LIMIT_INCREMENT_FUNCTION_DESC' + | 'LIMIT_INCREMENT_TRIGGER_ASC' + | 'LIMIT_INCREMENT_TRIGGER_DESC' + | 'LIMIT_UPDATE_TRIGGER_ASC' + | 'LIMIT_UPDATE_TRIGGER_DESC' + | 'LIMIT_WARNINGS_TABLE_ID_ASC' + | 'LIMIT_WARNINGS_TABLE_ID_DESC' + | 'LIMIT_WARNING_STATE_TABLE_ID_ASC' + | 'LIMIT_WARNING_STATE_TABLE_ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVE_CAP_FUNCTION_ASC' + | 'RESOLVE_CAP_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `MembershipTypesModule`. */ -export type MembershipTypesModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type MembershipTypesModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `MembershipsModule`. */ -export type MembershipsModuleOrderBy = "ACTOR_MASK_CHECK_ASC" | "ACTOR_MASK_CHECK_DESC" | "ACTOR_PERM_CHECK_ASC" | "ACTOR_PERM_CHECK_DESC" | "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "ADMIN_GRANTS_TABLE_ID_ASC" | "ADMIN_GRANTS_TABLE_ID_DESC" | "ADMIN_GRANTS_TABLE_NAME_ASC" | "ADMIN_GRANTS_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_LIMITS_TABLE_ID_ASC" | "DEFAULT_LIMITS_TABLE_ID_DESC" | "DEFAULT_PERMISSIONS_TABLE_ID_ASC" | "DEFAULT_PERMISSIONS_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_IDS_BY_MASK_ASC" | "ENTITY_IDS_BY_MASK_DESC" | "ENTITY_IDS_BY_PERM_ASC" | "ENTITY_IDS_BY_PERM_DESC" | "ENTITY_IDS_FUNCTION_ASC" | "ENTITY_IDS_FUNCTION_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ENTITY_TABLE_OWNER_ID_ASC" | "ENTITY_TABLE_OWNER_ID_DESC" | "GET_ORG_FN_ASC" | "GET_ORG_FN_DESC" | "GRANTS_TABLE_ID_ASC" | "GRANTS_TABLE_ID_DESC" | "GRANTS_TABLE_NAME_ASC" | "GRANTS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "LIMITS_TABLE_ID_ASC" | "LIMITS_TABLE_ID_DESC" | "MEMBERSHIPS_TABLE_ID_ASC" | "MEMBERSHIPS_TABLE_ID_DESC" | "MEMBERSHIPS_TABLE_NAME_ASC" | "MEMBERSHIPS_TABLE_NAME_DESC" | "MEMBERSHIP_DEFAULTS_TABLE_ID_ASC" | "MEMBERSHIP_DEFAULTS_TABLE_ID_DESC" | "MEMBERSHIP_DEFAULTS_TABLE_NAME_ASC" | "MEMBERSHIP_DEFAULTS_TABLE_NAME_DESC" | "MEMBERSHIP_SETTINGS_TABLE_ID_ASC" | "MEMBERSHIP_SETTINGS_TABLE_ID_DESC" | "MEMBERSHIP_SETTINGS_TABLE_NAME_ASC" | "MEMBERSHIP_SETTINGS_TABLE_NAME_DESC" | "MEMBERS_TABLE_ID_ASC" | "MEMBERS_TABLE_ID_DESC" | "MEMBERS_TABLE_NAME_ASC" | "MEMBERS_TABLE_NAME_DESC" | "MEMBER_PROFILES_TABLE_ID_ASC" | "MEMBER_PROFILES_TABLE_ID_DESC" | "NATURAL" | "OWNER_GRANTS_TABLE_ID_ASC" | "OWNER_GRANTS_TABLE_ID_DESC" | "OWNER_GRANTS_TABLE_NAME_ASC" | "OWNER_GRANTS_TABLE_NAME_DESC" | "PERMISSIONS_TABLE_ID_ASC" | "PERMISSIONS_TABLE_ID_DESC" | "PERMISSION_DEFAULT_GRANTS_TABLE_ID_ASC" | "PERMISSION_DEFAULT_GRANTS_TABLE_ID_DESC" | "PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_ASC" | "PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SPRT_TABLE_ID_ASC" | "SPRT_TABLE_ID_DESC"; +export type MembershipsModuleOrderBy = + | 'ACTOR_MASK_CHECK_ASC' + | 'ACTOR_MASK_CHECK_DESC' + | 'ACTOR_PERM_CHECK_ASC' + | 'ACTOR_PERM_CHECK_DESC' + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'ADMIN_GRANTS_TABLE_ID_ASC' + | 'ADMIN_GRANTS_TABLE_ID_DESC' + | 'ADMIN_GRANTS_TABLE_NAME_ASC' + | 'ADMIN_GRANTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_LIMITS_TABLE_ID_ASC' + | 'DEFAULT_LIMITS_TABLE_ID_DESC' + | 'DEFAULT_PERMISSIONS_TABLE_ID_ASC' + | 'DEFAULT_PERMISSIONS_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_IDS_BY_MASK_ASC' + | 'ENTITY_IDS_BY_MASK_DESC' + | 'ENTITY_IDS_BY_PERM_ASC' + | 'ENTITY_IDS_BY_PERM_DESC' + | 'ENTITY_IDS_FUNCTION_ASC' + | 'ENTITY_IDS_FUNCTION_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ENTITY_TABLE_OWNER_ID_ASC' + | 'ENTITY_TABLE_OWNER_ID_DESC' + | 'GET_ORG_FN_ASC' + | 'GET_ORG_FN_DESC' + | 'GRANTS_TABLE_ID_ASC' + | 'GRANTS_TABLE_ID_DESC' + | 'GRANTS_TABLE_NAME_ASC' + | 'GRANTS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LIMITS_TABLE_ID_ASC' + | 'LIMITS_TABLE_ID_DESC' + | 'MEMBERSHIPS_TABLE_ID_ASC' + | 'MEMBERSHIPS_TABLE_ID_DESC' + | 'MEMBERSHIPS_TABLE_NAME_ASC' + | 'MEMBERSHIPS_TABLE_NAME_DESC' + | 'MEMBERSHIP_DEFAULTS_TABLE_ID_ASC' + | 'MEMBERSHIP_DEFAULTS_TABLE_ID_DESC' + | 'MEMBERSHIP_DEFAULTS_TABLE_NAME_ASC' + | 'MEMBERSHIP_DEFAULTS_TABLE_NAME_DESC' + | 'MEMBERSHIP_SETTINGS_TABLE_ID_ASC' + | 'MEMBERSHIP_SETTINGS_TABLE_ID_DESC' + | 'MEMBERSHIP_SETTINGS_TABLE_NAME_ASC' + | 'MEMBERSHIP_SETTINGS_TABLE_NAME_DESC' + | 'MEMBERS_TABLE_ID_ASC' + | 'MEMBERS_TABLE_ID_DESC' + | 'MEMBERS_TABLE_NAME_ASC' + | 'MEMBERS_TABLE_NAME_DESC' + | 'MEMBER_PROFILES_TABLE_ID_ASC' + | 'MEMBER_PROFILES_TABLE_ID_DESC' + | 'NATURAL' + | 'OWNER_GRANTS_TABLE_ID_ASC' + | 'OWNER_GRANTS_TABLE_ID_DESC' + | 'OWNER_GRANTS_TABLE_NAME_ASC' + | 'OWNER_GRANTS_TABLE_NAME_DESC' + | 'PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSIONS_TABLE_ID_DESC' + | 'PERMISSION_DEFAULT_GRANTS_TABLE_ID_ASC' + | 'PERMISSION_DEFAULT_GRANTS_TABLE_ID_DESC' + | 'PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SPRT_TABLE_ID_ASC' + | 'SPRT_TABLE_ID_DESC'; /** Methods to use when ordering `MerkleStoreModule`. */ -export type MerkleStoreModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "COMMIT_TABLE_ID_ASC" | "COMMIT_TABLE_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "FUNCTION_PREFIX_ASC" | "FUNCTION_PREFIX_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OBJECT_TABLE_ID_ASC" | "OBJECT_TABLE_ID_DESC" | "PERMISSION_KEY_ASC" | "PERMISSION_KEY_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORE_TABLE_ID_ASC" | "STORE_TABLE_ID_DESC"; +export type MerkleStoreModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COMMIT_TABLE_ID_ASC' + | 'COMMIT_TABLE_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'FUNCTION_PREFIX_ASC' + | 'FUNCTION_PREFIX_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OBJECT_TABLE_ID_ASC' + | 'OBJECT_TABLE_ID_DESC' + | 'PERMISSION_KEY_ASC' + | 'PERMISSION_KEY_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORE_TABLE_ID_ASC' + | 'STORE_TABLE_ID_DESC'; /** Methods to use when ordering `NamespaceModule`. */ -export type NamespaceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACES_TABLE_ID_ASC" | "NAMESPACES_TABLE_ID_DESC" | "NAMESPACES_TABLE_NAME_ASC" | "NAMESPACES_TABLE_NAME_DESC" | "NAMESPACE_EVENTS_TABLE_ID_ASC" | "NAMESPACE_EVENTS_TABLE_ID_DESC" | "NAMESPACE_EVENTS_TABLE_NAME_ASC" | "NAMESPACE_EVENTS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type NamespaceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' + | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `NotificationsModule`. */ -export type NotificationsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHANNELS_TABLE_ID_ASC" | "CHANNELS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DELIVERY_LOG_TABLE_ID_ASC" | "DELIVERY_LOG_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "HAS_CHANNELS_ASC" | "HAS_CHANNELS_DESC" | "HAS_DIGEST_METADATA_ASC" | "HAS_DIGEST_METADATA_DESC" | "HAS_PREFERENCES_ASC" | "HAS_PREFERENCES_DESC" | "HAS_SETTINGS_EXTENSION_ASC" | "HAS_SETTINGS_EXTENSION_DESC" | "HAS_SUBSCRIPTIONS_ASC" | "HAS_SUBSCRIPTIONS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NOTIFICATIONS_TABLE_ID_ASC" | "NOTIFICATIONS_TABLE_ID_DESC" | "ORGANIZATION_SETTINGS_TABLE_ID_ASC" | "ORGANIZATION_SETTINGS_TABLE_ID_DESC" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PREFERENCES_TABLE_ID_ASC" | "PREFERENCES_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "READ_STATE_TABLE_ID_ASC" | "READ_STATE_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SUPPRESSIONS_TABLE_ID_ASC" | "SUPPRESSIONS_TABLE_ID_DESC" | "USER_SETTINGS_TABLE_ID_ASC" | "USER_SETTINGS_TABLE_ID_DESC"; +export type NotificationsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHANNELS_TABLE_ID_ASC' + | 'CHANNELS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DELIVERY_LOG_TABLE_ID_ASC' + | 'DELIVERY_LOG_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'HAS_CHANNELS_ASC' + | 'HAS_CHANNELS_DESC' + | 'HAS_DIGEST_METADATA_ASC' + | 'HAS_DIGEST_METADATA_DESC' + | 'HAS_PREFERENCES_ASC' + | 'HAS_PREFERENCES_DESC' + | 'HAS_SETTINGS_EXTENSION_ASC' + | 'HAS_SETTINGS_EXTENSION_DESC' + | 'HAS_SUBSCRIPTIONS_ASC' + | 'HAS_SUBSCRIPTIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NOTIFICATIONS_TABLE_ID_ASC' + | 'NOTIFICATIONS_TABLE_ID_DESC' + | 'ORGANIZATION_SETTINGS_TABLE_ID_ASC' + | 'ORGANIZATION_SETTINGS_TABLE_ID_DESC' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PREFERENCES_TABLE_ID_ASC' + | 'PREFERENCES_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'READ_STATE_TABLE_ID_ASC' + | 'READ_STATE_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SUPPRESSIONS_TABLE_ID_ASC' + | 'SUPPRESSIONS_TABLE_ID_DESC' + | 'USER_SETTINGS_TABLE_ID_ASC' + | 'USER_SETTINGS_TABLE_ID_DESC'; /** Methods to use when ordering `PermissionsModule`. */ -export type PermissionsModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "BITLEN_ASC" | "BITLEN_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_TABLE_ID_ASC" | "DEFAULT_TABLE_ID_DESC" | "DEFAULT_TABLE_NAME_ASC" | "DEFAULT_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GET_BY_MASK_ASC" | "GET_BY_MASK_DESC" | "GET_MASK_ASC" | "GET_MASK_BY_NAME_ASC" | "GET_MASK_BY_NAME_DESC" | "GET_MASK_DESC" | "GET_PADDED_MASK_ASC" | "GET_PADDED_MASK_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type PermissionsModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BITLEN_ASC' + | 'BITLEN_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_TABLE_ID_ASC' + | 'DEFAULT_TABLE_ID_DESC' + | 'DEFAULT_TABLE_NAME_ASC' + | 'DEFAULT_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GET_BY_MASK_ASC' + | 'GET_BY_MASK_DESC' + | 'GET_MASK_ASC' + | 'GET_MASK_BY_NAME_ASC' + | 'GET_MASK_BY_NAME_DESC' + | 'GET_MASK_DESC' + | 'GET_PADDED_MASK_ASC' + | 'GET_PADDED_MASK_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `PhoneNumbersModule`. */ -export type PhoneNumbersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type PhoneNumbersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `PlansModule`. */ -export type PlansModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "APPLY_BILLING_PLAN_FUNCTION_ASC" | "APPLY_BILLING_PLAN_FUNCTION_DESC" | "APPLY_PLAN_AGGREGATE_FUNCTION_ASC" | "APPLY_PLAN_AGGREGATE_FUNCTION_DESC" | "APPLY_PLAN_CAPS_FUNCTION_ASC" | "APPLY_PLAN_CAPS_FUNCTION_DESC" | "APPLY_PLAN_FUNCTION_ASC" | "APPLY_PLAN_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PLANS_TABLE_ID_ASC" | "PLANS_TABLE_ID_DESC" | "PLANS_TABLE_NAME_ASC" | "PLANS_TABLE_NAME_DESC" | "PLAN_CAPS_TABLE_ID_ASC" | "PLAN_CAPS_TABLE_ID_DESC" | "PLAN_LIMITS_TABLE_ID_ASC" | "PLAN_LIMITS_TABLE_ID_DESC" | "PLAN_LIMITS_TABLE_NAME_ASC" | "PLAN_LIMITS_TABLE_NAME_DESC" | "PLAN_METER_LIMITS_TABLE_ID_ASC" | "PLAN_METER_LIMITS_TABLE_ID_DESC" | "PLAN_OVERRIDES_TABLE_ID_ASC" | "PLAN_OVERRIDES_TABLE_ID_DESC" | "PLAN_PRICING_TABLE_ID_ASC" | "PLAN_PRICING_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; +export type PlansModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPLY_BILLING_PLAN_FUNCTION_ASC' + | 'APPLY_BILLING_PLAN_FUNCTION_DESC' + | 'APPLY_PLAN_AGGREGATE_FUNCTION_ASC' + | 'APPLY_PLAN_AGGREGATE_FUNCTION_DESC' + | 'APPLY_PLAN_CAPS_FUNCTION_ASC' + | 'APPLY_PLAN_CAPS_FUNCTION_DESC' + | 'APPLY_PLAN_FUNCTION_ASC' + | 'APPLY_PLAN_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PLANS_TABLE_ID_ASC' + | 'PLANS_TABLE_ID_DESC' + | 'PLANS_TABLE_NAME_ASC' + | 'PLANS_TABLE_NAME_DESC' + | 'PLAN_CAPS_TABLE_ID_ASC' + | 'PLAN_CAPS_TABLE_ID_DESC' + | 'PLAN_LIMITS_TABLE_ID_ASC' + | 'PLAN_LIMITS_TABLE_ID_DESC' + | 'PLAN_LIMITS_TABLE_NAME_ASC' + | 'PLAN_LIMITS_TABLE_NAME_DESC' + | 'PLAN_METER_LIMITS_TABLE_ID_ASC' + | 'PLAN_METER_LIMITS_TABLE_ID_DESC' + | 'PLAN_OVERRIDES_TABLE_ID_ASC' + | 'PLAN_OVERRIDES_TABLE_ID_DESC' + | 'PLAN_PRICING_TABLE_ID_ASC' + | 'PLAN_PRICING_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; /** Methods to use when ordering `PrincipalAuthModule`. */ -export type PrincipalAuthModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUDITS_TABLE_ID_ASC" | "AUDITS_TABLE_ID_DESC" | "CREATE_ORG_API_KEY_FUNCTION_ASC" | "CREATE_ORG_API_KEY_FUNCTION_DESC" | "CREATE_ORG_PRINCIPAL_FUNCTION_ASC" | "CREATE_ORG_PRINCIPAL_FUNCTION_DESC" | "CREATE_PRINCIPAL_FUNCTION_ASC" | "CREATE_PRINCIPAL_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ORG_PRINCIPAL_FUNCTION_ASC" | "DELETE_ORG_PRINCIPAL_FUNCTION_DESC" | "DELETE_PRINCIPAL_FUNCTION_ASC" | "DELETE_PRINCIPAL_FUNCTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPALS_TABLE_ID_ASC" | "PRINCIPALS_TABLE_ID_DESC" | "PRINCIPALS_TABLE_NAME_ASC" | "PRINCIPALS_TABLE_NAME_DESC" | "PRINCIPAL_ENTITIES_TABLE_ID_ASC" | "PRINCIPAL_ENTITIES_TABLE_ID_DESC" | "PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC" | "PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC" | "REVOKE_ORG_API_KEY_FUNCTION_ASC" | "REVOKE_ORG_API_KEY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; +export type PrincipalAuthModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'CREATE_ORG_API_KEY_FUNCTION_ASC' + | 'CREATE_ORG_API_KEY_FUNCTION_DESC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_PRINCIPAL_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_PRINCIPAL_FUNCTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPALS_TABLE_ID_ASC' + | 'PRINCIPALS_TABLE_ID_DESC' + | 'PRINCIPALS_TABLE_NAME_ASC' + | 'PRINCIPALS_TABLE_NAME_DESC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_ASC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_DESC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC' + | 'REVOKE_ORG_API_KEY_FUNCTION_ASC' + | 'REVOKE_ORG_API_KEY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; /** Methods to use when ordering `ProfilesModule`. */ -export type ProfilesModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MEMBERSHIPS_TABLE_ID_ASC" | "MEMBERSHIPS_TABLE_ID_DESC" | "NATURAL" | "PERMISSIONS_TABLE_ID_ASC" | "PERMISSIONS_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROFILE_DEFINITION_GRANTS_TABLE_ID_ASC" | "PROFILE_DEFINITION_GRANTS_TABLE_ID_DESC" | "PROFILE_DEFINITION_GRANTS_TABLE_NAME_ASC" | "PROFILE_DEFINITION_GRANTS_TABLE_NAME_DESC" | "PROFILE_GRANTS_TABLE_ID_ASC" | "PROFILE_GRANTS_TABLE_ID_DESC" | "PROFILE_GRANTS_TABLE_NAME_ASC" | "PROFILE_GRANTS_TABLE_NAME_DESC" | "PROFILE_PERMISSIONS_TABLE_ID_ASC" | "PROFILE_PERMISSIONS_TABLE_ID_DESC" | "PROFILE_PERMISSIONS_TABLE_NAME_ASC" | "PROFILE_PERMISSIONS_TABLE_NAME_DESC" | "PROFILE_TEMPLATES_TABLE_ID_ASC" | "PROFILE_TEMPLATES_TABLE_ID_DESC" | "PROFILE_TEMPLATES_TABLE_NAME_ASC" | "PROFILE_TEMPLATES_TABLE_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type ProfilesModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MEMBERSHIPS_TABLE_ID_ASC' + | 'MEMBERSHIPS_TABLE_ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSIONS_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_ID_ASC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_ID_DESC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_NAME_ASC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_NAME_DESC' + | 'PROFILE_GRANTS_TABLE_ID_ASC' + | 'PROFILE_GRANTS_TABLE_ID_DESC' + | 'PROFILE_GRANTS_TABLE_NAME_ASC' + | 'PROFILE_GRANTS_TABLE_NAME_DESC' + | 'PROFILE_PERMISSIONS_TABLE_ID_ASC' + | 'PROFILE_PERMISSIONS_TABLE_ID_DESC' + | 'PROFILE_PERMISSIONS_TABLE_NAME_ASC' + | 'PROFILE_PERMISSIONS_TABLE_NAME_DESC' + | 'PROFILE_TEMPLATES_TABLE_ID_ASC' + | 'PROFILE_TEMPLATES_TABLE_ID_DESC' + | 'PROFILE_TEMPLATES_TABLE_NAME_ASC' + | 'PROFILE_TEMPLATES_TABLE_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `RateLimitMetersModule`. */ -export type RateLimitMetersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHECK_RATE_LIMIT_FUNCTION_ASC" | "CHECK_RATE_LIMIT_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RATE_LIMIT_OVERRIDES_TABLE_ID_ASC" | "RATE_LIMIT_OVERRIDES_TABLE_ID_DESC" | "RATE_LIMIT_OVERRIDES_TABLE_NAME_ASC" | "RATE_LIMIT_OVERRIDES_TABLE_NAME_DESC" | "RATE_LIMIT_STATE_TABLE_ID_ASC" | "RATE_LIMIT_STATE_TABLE_ID_DESC" | "RATE_LIMIT_STATE_TABLE_NAME_ASC" | "RATE_LIMIT_STATE_TABLE_NAME_DESC" | "RATE_WINDOW_LIMITS_TABLE_ID_ASC" | "RATE_WINDOW_LIMITS_TABLE_ID_DESC" | "RATE_WINDOW_LIMITS_TABLE_NAME_ASC" | "RATE_WINDOW_LIMITS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; +export type RateLimitMetersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHECK_RATE_LIMIT_FUNCTION_ASC' + | 'CHECK_RATE_LIMIT_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RATE_LIMIT_OVERRIDES_TABLE_ID_ASC' + | 'RATE_LIMIT_OVERRIDES_TABLE_ID_DESC' + | 'RATE_LIMIT_OVERRIDES_TABLE_NAME_ASC' + | 'RATE_LIMIT_OVERRIDES_TABLE_NAME_DESC' + | 'RATE_LIMIT_STATE_TABLE_ID_ASC' + | 'RATE_LIMIT_STATE_TABLE_ID_DESC' + | 'RATE_LIMIT_STATE_TABLE_NAME_ASC' + | 'RATE_LIMIT_STATE_TABLE_NAME_DESC' + | 'RATE_WINDOW_LIMITS_TABLE_ID_ASC' + | 'RATE_WINDOW_LIMITS_TABLE_ID_DESC' + | 'RATE_WINDOW_LIMITS_TABLE_NAME_ASC' + | 'RATE_WINDOW_LIMITS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; /** Methods to use when ordering `RateLimitsModule`. */ -export type RateLimitsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IP_RATE_LIMITS_TABLE_ID_ASC" | "IP_RATE_LIMITS_TABLE_ID_DESC" | "IP_RATE_LIMITS_TABLE_NAME_ASC" | "IP_RATE_LIMITS_TABLE_NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RATE_LIMITS_TABLE_ID_ASC" | "RATE_LIMITS_TABLE_ID_DESC" | "RATE_LIMITS_TABLE_NAME_ASC" | "RATE_LIMITS_TABLE_NAME_DESC" | "RATE_LIMIT_SETTINGS_TABLE_ID_ASC" | "RATE_LIMIT_SETTINGS_TABLE_ID_DESC" | "RATE_LIMIT_SETTINGS_TABLE_NAME_ASC" | "RATE_LIMIT_SETTINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; +export type RateLimitsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IP_RATE_LIMITS_TABLE_ID_ASC' + | 'IP_RATE_LIMITS_TABLE_ID_DESC' + | 'IP_RATE_LIMITS_TABLE_NAME_ASC' + | 'IP_RATE_LIMITS_TABLE_NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RATE_LIMITS_TABLE_ID_ASC' + | 'RATE_LIMITS_TABLE_ID_DESC' + | 'RATE_LIMITS_TABLE_NAME_ASC' + | 'RATE_LIMITS_TABLE_NAME_DESC' + | 'RATE_LIMIT_SETTINGS_TABLE_ID_ASC' + | 'RATE_LIMIT_SETTINGS_TABLE_ID_DESC' + | 'RATE_LIMIT_SETTINGS_TABLE_NAME_ASC' + | 'RATE_LIMIT_SETTINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; /** Methods to use when ordering `RealtimeModule`. */ -export type RealtimeModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHANGE_LOG_TABLE_ID_ASC" | "CHANGE_LOG_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "LISTENER_NODE_TABLE_ID_ASC" | "LISTENER_NODE_TABLE_ID_DESC" | "NATURAL" | "NOTIFY_CHANNEL_ASC" | "NOTIFY_CHANNEL_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "RETENTION_HOURS_ASC" | "RETENTION_HOURS_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SOURCE_REGISTRY_TABLE_ID_ASC" | "SOURCE_REGISTRY_TABLE_ID_DESC" | "SUBSCRIPTIONS_SCHEMA_ID_ASC" | "SUBSCRIPTIONS_SCHEMA_ID_DESC"; +export type RealtimeModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHANGE_LOG_TABLE_ID_ASC' + | 'CHANGE_LOG_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'LISTENER_NODE_TABLE_ID_ASC' + | 'LISTENER_NODE_TABLE_ID_DESC' + | 'NATURAL' + | 'NOTIFY_CHANNEL_ASC' + | 'NOTIFY_CHANNEL_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'RETENTION_HOURS_ASC' + | 'RETENTION_HOURS_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SOURCE_REGISTRY_TABLE_ID_ASC' + | 'SOURCE_REGISTRY_TABLE_ID_DESC' + | 'SUBSCRIPTIONS_SCHEMA_ID_ASC' + | 'SUBSCRIPTIONS_SCHEMA_ID_DESC'; /** Methods to use when ordering `RelationProvision`. */ -export type RelationProvisionOrderBy = "API_REQUIRED_ASC" | "API_REQUIRED_DESC" | "CREATE_INDEX_ASC" | "CREATE_INDEX_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACTION_ASC" | "DELETE_ACTION_DESC" | "EXPOSE_IN_API_ASC" | "EXPOSE_IN_API_DESC" | "FIELD_NAME_ASC" | "FIELD_NAME_DESC" | "GRANTS_ASC" | "GRANTS_DESC" | "ID_ASC" | "ID_DESC" | "IS_REQUIRED_ASC" | "IS_REQUIRED_DESC" | "JUNCTION_SCHEMA_ID_ASC" | "JUNCTION_SCHEMA_ID_DESC" | "JUNCTION_TABLE_ID_ASC" | "JUNCTION_TABLE_ID_DESC" | "JUNCTION_TABLE_NAME_ASC" | "JUNCTION_TABLE_NAME_DESC" | "NATURAL" | "NODES_ASC" | "NODES_DESC" | "OUT_FIELD_ID_ASC" | "OUT_FIELD_ID_DESC" | "OUT_JUNCTION_TABLE_ID_ASC" | "OUT_JUNCTION_TABLE_ID_DESC" | "OUT_SOURCE_FIELD_ID_ASC" | "OUT_SOURCE_FIELD_ID_DESC" | "OUT_TARGET_FIELD_ID_ASC" | "OUT_TARGET_FIELD_ID_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RELATION_TYPE_ASC" | "RELATION_TYPE_DESC" | "SOURCE_FIELD_NAME_ASC" | "SOURCE_FIELD_NAME_DESC" | "SOURCE_TABLE_ID_ASC" | "SOURCE_TABLE_ID_DESC" | "TARGET_FIELD_NAME_ASC" | "TARGET_FIELD_NAME_DESC" | "TARGET_TABLE_ID_ASC" | "TARGET_TABLE_ID_DESC" | "USE_COMPOSITE_KEY_ASC" | "USE_COMPOSITE_KEY_DESC"; +export type RelationProvisionOrderBy = + | 'API_REQUIRED_ASC' + | 'API_REQUIRED_DESC' + | 'CREATE_INDEX_ASC' + | 'CREATE_INDEX_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACTION_ASC' + | 'DELETE_ACTION_DESC' + | 'EXPOSE_IN_API_ASC' + | 'EXPOSE_IN_API_DESC' + | 'FIELD_NAME_ASC' + | 'FIELD_NAME_DESC' + | 'GRANTS_ASC' + | 'GRANTS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_REQUIRED_ASC' + | 'IS_REQUIRED_DESC' + | 'JUNCTION_SCHEMA_ID_ASC' + | 'JUNCTION_SCHEMA_ID_DESC' + | 'JUNCTION_TABLE_ID_ASC' + | 'JUNCTION_TABLE_ID_DESC' + | 'JUNCTION_TABLE_NAME_ASC' + | 'JUNCTION_TABLE_NAME_DESC' + | 'NATURAL' + | 'NODES_ASC' + | 'NODES_DESC' + | 'OUT_FIELD_ID_ASC' + | 'OUT_FIELD_ID_DESC' + | 'OUT_JUNCTION_TABLE_ID_ASC' + | 'OUT_JUNCTION_TABLE_ID_DESC' + | 'OUT_SOURCE_FIELD_ID_ASC' + | 'OUT_SOURCE_FIELD_ID_DESC' + | 'OUT_TARGET_FIELD_ID_ASC' + | 'OUT_TARGET_FIELD_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RELATION_TYPE_ASC' + | 'RELATION_TYPE_DESC' + | 'SOURCE_FIELD_NAME_ASC' + | 'SOURCE_FIELD_NAME_DESC' + | 'SOURCE_TABLE_ID_ASC' + | 'SOURCE_TABLE_ID_DESC' + | 'TARGET_FIELD_NAME_ASC' + | 'TARGET_FIELD_NAME_DESC' + | 'TARGET_TABLE_ID_ASC' + | 'TARGET_TABLE_ID_DESC' + | 'USE_COMPOSITE_KEY_ASC' + | 'USE_COMPOSITE_KEY_DESC'; /** Methods to use when ordering `ResourceModule`. */ -export type ResourceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_STORE_NAME_ASC" | "INSTALLATION_STORE_NAME_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "REQUIREMENTS_STATE_VIEW_NAME_ASC" | "REQUIREMENTS_STATE_VIEW_NAME_DESC" | "RESOLVED_REQUIREMENTS_VIEW_NAME_ASC" | "RESOLVED_REQUIREMENTS_VIEW_NAME_DESC" | "RESOURCES_TABLE_ID_ASC" | "RESOURCES_TABLE_ID_DESC" | "RESOURCES_TABLE_NAME_ASC" | "RESOURCES_TABLE_NAME_DESC" | "RESOURCE_BILLING_ROLLUP_FUNCTION_ASC" | "RESOURCE_BILLING_ROLLUP_FUNCTION_DESC" | "RESOURCE_DEFINITIONS_TABLE_ID_ASC" | "RESOURCE_DEFINITIONS_TABLE_ID_DESC" | "RESOURCE_DEFINITIONS_TABLE_NAME_ASC" | "RESOURCE_DEFINITIONS_TABLE_NAME_DESC" | "RESOURCE_EVENTS_TABLE_ID_ASC" | "RESOURCE_EVENTS_TABLE_ID_DESC" | "RESOURCE_EVENTS_TABLE_NAME_ASC" | "RESOURCE_EVENTS_TABLE_NAME_DESC" | "RESOURCE_INSTALLATIONS_TABLE_ID_ASC" | "RESOURCE_INSTALLATIONS_TABLE_ID_DESC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_ASC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_DESC" | "RESOURCE_STATUS_CHECKS_TABLE_ID_ASC" | "RESOURCE_STATUS_CHECKS_TABLE_ID_DESC" | "RESOURCE_STATUS_CHECKS_TABLE_NAME_ASC" | "RESOURCE_STATUS_CHECKS_TABLE_NAME_DESC" | "RESOURCE_USAGE_LOG_TABLE_ID_ASC" | "RESOURCE_USAGE_LOG_TABLE_ID_DESC" | "RESOURCE_USAGE_LOG_TABLE_NAME_ASC" | "RESOURCE_USAGE_LOG_TABLE_NAME_DESC" | "RESOURCE_USAGE_SUMMARY_TABLE_ID_ASC" | "RESOURCE_USAGE_SUMMARY_TABLE_ID_DESC" | "RESOURCE_USAGE_SUMMARY_TABLE_NAME_ASC" | "RESOURCE_USAGE_SUMMARY_TABLE_NAME_DESC" | "ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type ResourceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_STORE_NAME_ASC' + | 'INSTALLATION_STORE_NAME_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'REQUIREMENTS_STATE_VIEW_NAME_ASC' + | 'REQUIREMENTS_STATE_VIEW_NAME_DESC' + | 'RESOLVED_REQUIREMENTS_VIEW_NAME_ASC' + | 'RESOLVED_REQUIREMENTS_VIEW_NAME_DESC' + | 'RESOURCES_TABLE_ID_ASC' + | 'RESOURCES_TABLE_ID_DESC' + | 'RESOURCES_TABLE_NAME_ASC' + | 'RESOURCES_TABLE_NAME_DESC' + | 'RESOURCE_BILLING_ROLLUP_FUNCTION_ASC' + | 'RESOURCE_BILLING_ROLLUP_FUNCTION_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_DESC' + | 'RESOURCE_EVENTS_TABLE_ID_ASC' + | 'RESOURCE_EVENTS_TABLE_ID_DESC' + | 'RESOURCE_EVENTS_TABLE_NAME_ASC' + | 'RESOURCE_EVENTS_TABLE_NAME_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_DESC' + | 'RESOURCE_STATUS_CHECKS_TABLE_ID_ASC' + | 'RESOURCE_STATUS_CHECKS_TABLE_ID_DESC' + | 'RESOURCE_STATUS_CHECKS_TABLE_NAME_ASC' + | 'RESOURCE_STATUS_CHECKS_TABLE_NAME_DESC' + | 'RESOURCE_USAGE_LOG_TABLE_ID_ASC' + | 'RESOURCE_USAGE_LOG_TABLE_ID_DESC' + | 'RESOURCE_USAGE_LOG_TABLE_NAME_ASC' + | 'RESOURCE_USAGE_LOG_TABLE_NAME_DESC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_ID_ASC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_ID_DESC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_NAME_ASC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_NAME_DESC' + | 'ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `RlsModule`. */ -export type RlsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUTHENTICATE_ASC" | "AUTHENTICATE_DESC" | "AUTHENTICATE_STRICT_ASC" | "AUTHENTICATE_STRICT_DESC" | "CURRENT_ROLE_ASC" | "CURRENT_ROLE_DESC" | "CURRENT_ROLE_ID_ASC" | "CURRENT_ROLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; +export type RlsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUTHENTICATE_ASC' + | 'AUTHENTICATE_DESC' + | 'AUTHENTICATE_STRICT_ASC' + | 'AUTHENTICATE_STRICT_DESC' + | 'CURRENT_ROLE_ASC' + | 'CURRENT_ROLE_DESC' + | 'CURRENT_ROLE_ID_ASC' + | 'CURRENT_ROLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; /** Methods to use when ordering `RouteModule`. */ -export type RouteModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAIN_MODULE_ID_ASC" | "DOMAIN_MODULE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HOSTNAME_BINDINGS_TABLE_ID_ASC" | "HOSTNAME_BINDINGS_TABLE_ID_DESC" | "HOSTNAME_BINDINGS_TABLE_NAME_ASC" | "HOSTNAME_BINDINGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVER_FUNCTION_NAME_ASC" | "RESOLVER_FUNCTION_NAME_DESC" | "ROUTES_TABLE_ID_ASC" | "ROUTES_TABLE_ID_DESC" | "ROUTES_TABLE_NAME_ASC" | "ROUTES_TABLE_NAME_DESC" | "ROUTE_BINDINGS_TABLE_ID_ASC" | "ROUTE_BINDINGS_TABLE_ID_DESC" | "ROUTE_BINDINGS_TABLE_NAME_ASC" | "ROUTE_BINDINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; +export type RouteModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAIN_MODULE_ID_ASC' + | 'DOMAIN_MODULE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HOSTNAME_BINDINGS_TABLE_ID_ASC' + | 'HOSTNAME_BINDINGS_TABLE_ID_DESC' + | 'HOSTNAME_BINDINGS_TABLE_NAME_ASC' + | 'HOSTNAME_BINDINGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVER_FUNCTION_NAME_ASC' + | 'RESOLVER_FUNCTION_NAME_DESC' + | 'ROUTES_TABLE_ID_ASC' + | 'ROUTES_TABLE_ID_DESC' + | 'ROUTES_TABLE_NAME_ASC' + | 'ROUTES_TABLE_NAME_DESC' + | 'ROUTE_BINDINGS_TABLE_ID_ASC' + | 'ROUTE_BINDINGS_TABLE_ID_DESC' + | 'ROUTE_BINDINGS_TABLE_NAME_ASC' + | 'ROUTE_BINDINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; /** Methods to use when ordering `SecureTableProvision`. */ -export type SecureTableProvisionOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELDS_ASC" | "FIELDS_DESC" | "GRANTS_ASC" | "GRANTS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODES_ASC" | "NODES_DESC" | "OUT_FIELDS_ASC" | "OUT_FIELDS_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "USE_RLS_ASC" | "USE_RLS_DESC"; +export type SecureTableProvisionOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELDS_ASC' + | 'FIELDS_DESC' + | 'GRANTS_ASC' + | 'GRANTS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODES_ASC' + | 'NODES_DESC' + | 'OUT_FIELDS_ASC' + | 'OUT_FIELDS_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'USE_RLS_ASC' + | 'USE_RLS_DESC'; /** Methods to use when ordering `SessionSecretsModule`. */ -export type SessionSecretsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type SessionSecretsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `SessionsModule`. */ -export type SessionsModuleOrderBy = "AUTH_SETTINGS_TABLE_ID_ASC" | "AUTH_SETTINGS_TABLE_ID_DESC" | "AUTH_SETTINGS_TABLE_NAME_ASC" | "AUTH_SETTINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_DEFAULT_EXPIRATION_ASC" | "SESSIONS_DEFAULT_EXPIRATION_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSIONS_TABLE_NAME_ASC" | "SESSIONS_TABLE_NAME_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_NAME_ASC" | "SESSION_CREDENTIALS_TABLE_NAME_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; +export type SessionsModuleOrderBy = + | 'AUTH_SETTINGS_TABLE_ID_ASC' + | 'AUTH_SETTINGS_TABLE_ID_DESC' + | 'AUTH_SETTINGS_TABLE_NAME_ASC' + | 'AUTH_SETTINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_DEFAULT_EXPIRATION_ASC' + | 'SESSIONS_DEFAULT_EXPIRATION_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_NAME_ASC' + | 'SESSIONS_TABLE_NAME_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_NAME_ASC' + | 'SESSION_CREDENTIALS_TABLE_NAME_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; /** Methods to use when ordering `SiteSurfaceModule`. */ -export type SiteSurfaceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SITES_TABLE_ID_ASC" | "SITES_TABLE_ID_DESC" | "SITES_TABLE_NAME_ASC" | "SITES_TABLE_NAME_DESC" | "SITE_METADATA_TABLE_ID_ASC" | "SITE_METADATA_TABLE_ID_DESC" | "SITE_METADATA_TABLE_NAME_ASC" | "SITE_METADATA_TABLE_NAME_DESC" | "SITE_MODULES_TABLE_ID_ASC" | "SITE_MODULES_TABLE_ID_DESC" | "SITE_MODULES_TABLE_NAME_ASC" | "SITE_MODULES_TABLE_NAME_DESC" | "SITE_THEMES_TABLE_ID_ASC" | "SITE_THEMES_TABLE_ID_DESC" | "SITE_THEMES_TABLE_NAME_ASC" | "SITE_THEMES_TABLE_NAME_DESC"; +export type SiteSurfaceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SITES_TABLE_ID_ASC' + | 'SITES_TABLE_ID_DESC' + | 'SITES_TABLE_NAME_ASC' + | 'SITES_TABLE_NAME_DESC' + | 'SITE_METADATA_TABLE_ID_ASC' + | 'SITE_METADATA_TABLE_ID_DESC' + | 'SITE_METADATA_TABLE_NAME_ASC' + | 'SITE_METADATA_TABLE_NAME_DESC' + | 'SITE_MODULES_TABLE_ID_ASC' + | 'SITE_MODULES_TABLE_ID_DESC' + | 'SITE_MODULES_TABLE_NAME_ASC' + | 'SITE_MODULES_TABLE_NAME_DESC' + | 'SITE_THEMES_TABLE_ID_ASC' + | 'SITE_THEMES_TABLE_ID_DESC' + | 'SITE_THEMES_TABLE_NAME_ASC' + | 'SITE_THEMES_TABLE_NAME_DESC'; /** Methods to use when ordering `StorageLogModule`. */ -export type StorageLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORAGE_LOG_TABLE_ID_ASC" | "STORAGE_LOG_TABLE_ID_DESC" | "STORAGE_LOG_TABLE_NAME_ASC" | "STORAGE_LOG_TABLE_NAME_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; +export type StorageLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORAGE_LOG_TABLE_ID_ASC' + | 'STORAGE_LOG_TABLE_ID_DESC' + | 'STORAGE_LOG_TABLE_NAME_ASC' + | 'STORAGE_LOG_TABLE_NAME_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; /** Methods to use when ordering `StorageModule`. */ -export type StorageModuleOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "BUCKETS_TABLE_ID_ASC" | "BUCKETS_TABLE_ID_DESC" | "BUCKETS_TABLE_NAME_ASC" | "BUCKETS_TABLE_NAME_DESC" | "CACHE_TTL_SECONDS_ASC" | "CACHE_TTL_SECONDS_DESC" | "CONFIRM_UPLOAD_DELAY_ASC" | "CONFIRM_UPLOAD_DELAY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_MAX_FILE_SIZE_ASC" | "DEFAULT_MAX_FILE_SIZE_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOWNLOAD_URL_EXPIRY_SECONDS_ASC" | "DOWNLOAD_URL_EXPIRY_SECONDS_DESC" | "ENDPOINT_ASC" | "ENDPOINT_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FILES_TABLE_ID_ASC" | "FILES_TABLE_ID_DESC" | "FILES_TABLE_NAME_ASC" | "FILES_TABLE_NAME_DESC" | "FILE_EVENTS_TABLE_ID_ASC" | "FILE_EVENTS_TABLE_ID_DESC" | "HAS_AUDIT_LOG_ASC" | "HAS_AUDIT_LOG_DESC" | "HAS_CONFIRM_UPLOAD_ASC" | "HAS_CONFIRM_UPLOAD_DESC" | "HAS_CONTENT_HASH_ASC" | "HAS_CONTENT_HASH_DESC" | "HAS_CUSTOM_KEYS_ASC" | "HAS_CUSTOM_KEYS_DESC" | "HAS_PATH_SHARES_ASC" | "HAS_PATH_SHARES_DESC" | "HAS_VERSIONING_ASC" | "HAS_VERSIONING_DESC" | "ID_ASC" | "ID_DESC" | "MAX_BULK_FILES_ASC" | "MAX_BULK_FILES_DESC" | "MAX_BULK_TOTAL_SIZE_ASC" | "MAX_BULK_TOTAL_SIZE_DESC" | "MAX_FILENAME_LENGTH_ASC" | "MAX_FILENAME_LENGTH_DESC" | "NATURAL" | "PATH_SHARES_TABLE_ID_ASC" | "PATH_SHARES_TABLE_ID_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "PUBLIC_URL_PREFIX_ASC" | "PUBLIC_URL_PREFIX_DESC" | "RESTRICT_READS_ASC" | "RESTRICT_READS_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "UPLOAD_URL_EXPIRY_SECONDS_ASC" | "UPLOAD_URL_EXPIRY_SECONDS_DESC"; +export type StorageModuleOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BUCKETS_TABLE_ID_ASC' + | 'BUCKETS_TABLE_ID_DESC' + | 'BUCKETS_TABLE_NAME_ASC' + | 'BUCKETS_TABLE_NAME_DESC' + | 'CACHE_TTL_SECONDS_ASC' + | 'CACHE_TTL_SECONDS_DESC' + | 'CONFIRM_UPLOAD_DELAY_ASC' + | 'CONFIRM_UPLOAD_DELAY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_MAX_FILE_SIZE_ASC' + | 'DEFAULT_MAX_FILE_SIZE_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOWNLOAD_URL_EXPIRY_SECONDS_ASC' + | 'DOWNLOAD_URL_EXPIRY_SECONDS_DESC' + | 'ENDPOINT_ASC' + | 'ENDPOINT_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FILES_TABLE_ID_ASC' + | 'FILES_TABLE_ID_DESC' + | 'FILES_TABLE_NAME_ASC' + | 'FILES_TABLE_NAME_DESC' + | 'FILE_EVENTS_TABLE_ID_ASC' + | 'FILE_EVENTS_TABLE_ID_DESC' + | 'HAS_AUDIT_LOG_ASC' + | 'HAS_AUDIT_LOG_DESC' + | 'HAS_CONFIRM_UPLOAD_ASC' + | 'HAS_CONFIRM_UPLOAD_DESC' + | 'HAS_CONTENT_HASH_ASC' + | 'HAS_CONTENT_HASH_DESC' + | 'HAS_CUSTOM_KEYS_ASC' + | 'HAS_CUSTOM_KEYS_DESC' + | 'HAS_PATH_SHARES_ASC' + | 'HAS_PATH_SHARES_DESC' + | 'HAS_VERSIONING_ASC' + | 'HAS_VERSIONING_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_BULK_FILES_ASC' + | 'MAX_BULK_FILES_DESC' + | 'MAX_BULK_TOTAL_SIZE_ASC' + | 'MAX_BULK_TOTAL_SIZE_DESC' + | 'MAX_FILENAME_LENGTH_ASC' + | 'MAX_FILENAME_LENGTH_DESC' + | 'NATURAL' + | 'PATH_SHARES_TABLE_ID_ASC' + | 'PATH_SHARES_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PUBLIC_URL_PREFIX_ASC' + | 'PUBLIC_URL_PREFIX_DESC' + | 'RESTRICT_READS_ASC' + | 'RESTRICT_READS_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'UPLOAD_URL_EXPIRY_SECONDS_ASC' + | 'UPLOAD_URL_EXPIRY_SECONDS_DESC'; /** Methods to use when ordering `TransferLogModule`. */ -export type TransferLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TRANSFER_LOG_TABLE_ID_ASC" | "TRANSFER_LOG_TABLE_ID_DESC" | "TRANSFER_LOG_TABLE_NAME_ASC" | "TRANSFER_LOG_TABLE_NAME_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; +export type TransferLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TRANSFER_LOG_TABLE_ID_ASC' + | 'TRANSFER_LOG_TABLE_ID_DESC' + | 'TRANSFER_LOG_TABLE_NAME_ASC' + | 'TRANSFER_LOG_TABLE_NAME_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; /** Methods to use when ordering `UserAuthModule`. */ -export type UserAuthModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUDITS_TABLE_ID_ASC" | "AUDITS_TABLE_ID_DESC" | "AUDITS_TABLE_NAME_ASC" | "AUDITS_TABLE_NAME_DESC" | "CHECK_PASSWORD_FUNCTION_ASC" | "CHECK_PASSWORD_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACCOUNT_FUNCTION_ASC" | "DELETE_ACCOUNT_FUNCTION_DESC" | "EMAILS_TABLE_ID_ASC" | "EMAILS_TABLE_ID_DESC" | "ENCRYPTED_TABLE_ID_ASC" | "ENCRYPTED_TABLE_ID_DESC" | "EXTEND_TOKEN_EXPIRES_ASC" | "EXTEND_TOKEN_EXPIRES_DESC" | "FORGOT_PASSWORD_FUNCTION_ASC" | "FORGOT_PASSWORD_FUNCTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_ASC" | "REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_DESC" | "RESET_PASSWORD_FUNCTION_ASC" | "RESET_PASSWORD_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_ASC" | "SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_DESC" | "SEND_VERIFICATION_EMAIL_FUNCTION_ASC" | "SEND_VERIFICATION_EMAIL_FUNCTION_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SET_PASSWORD_FUNCTION_ASC" | "SET_PASSWORD_FUNCTION_DESC" | "SIGN_IN_CROSS_ORIGIN_FUNCTION_ASC" | "SIGN_IN_CROSS_ORIGIN_FUNCTION_DESC" | "SIGN_IN_FUNCTION_ASC" | "SIGN_IN_FUNCTION_DESC" | "SIGN_OUT_FUNCTION_ASC" | "SIGN_OUT_FUNCTION_DESC" | "SIGN_UP_FUNCTION_ASC" | "SIGN_UP_FUNCTION_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC" | "VERIFY_EMAIL_FUNCTION_ASC" | "VERIFY_EMAIL_FUNCTION_DESC" | "VERIFY_PASSWORD_FUNCTION_ASC" | "VERIFY_PASSWORD_FUNCTION_DESC"; +export type UserAuthModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'AUDITS_TABLE_NAME_ASC' + | 'AUDITS_TABLE_NAME_DESC' + | 'CHECK_PASSWORD_FUNCTION_ASC' + | 'CHECK_PASSWORD_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACCOUNT_FUNCTION_ASC' + | 'DELETE_ACCOUNT_FUNCTION_DESC' + | 'EMAILS_TABLE_ID_ASC' + | 'EMAILS_TABLE_ID_DESC' + | 'ENCRYPTED_TABLE_ID_ASC' + | 'ENCRYPTED_TABLE_ID_DESC' + | 'EXTEND_TOKEN_EXPIRES_ASC' + | 'EXTEND_TOKEN_EXPIRES_DESC' + | 'FORGOT_PASSWORD_FUNCTION_ASC' + | 'FORGOT_PASSWORD_FUNCTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_ASC' + | 'REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_DESC' + | 'RESET_PASSWORD_FUNCTION_ASC' + | 'RESET_PASSWORD_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_ASC' + | 'SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_DESC' + | 'SEND_VERIFICATION_EMAIL_FUNCTION_ASC' + | 'SEND_VERIFICATION_EMAIL_FUNCTION_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SET_PASSWORD_FUNCTION_ASC' + | 'SET_PASSWORD_FUNCTION_DESC' + | 'SIGN_IN_CROSS_ORIGIN_FUNCTION_ASC' + | 'SIGN_IN_CROSS_ORIGIN_FUNCTION_DESC' + | 'SIGN_IN_FUNCTION_ASC' + | 'SIGN_IN_FUNCTION_DESC' + | 'SIGN_OUT_FUNCTION_ASC' + | 'SIGN_OUT_FUNCTION_DESC' + | 'SIGN_UP_FUNCTION_ASC' + | 'SIGN_UP_FUNCTION_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'VERIFY_EMAIL_FUNCTION_ASC' + | 'VERIFY_EMAIL_FUNCTION_DESC' + | 'VERIFY_PASSWORD_FUNCTION_ASC' + | 'VERIFY_PASSWORD_FUNCTION_DESC'; /** Methods to use when ordering `UserCredentialsModule`. */ -export type UserCredentialsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type UserCredentialsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `UserSettingsModule`. */ -export type UserSettingsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type UserSettingsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `UserStateModule`. */ -export type UserStateModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type UserStateModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `UsersModule`. */ -export type UsersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "TYPE_TABLE_ID_ASC" | "TYPE_TABLE_ID_DESC" | "TYPE_TABLE_NAME_ASC" | "TYPE_TABLE_NAME_DESC"; +export type UsersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'TYPE_TABLE_ID_ASC' + | 'TYPE_TABLE_ID_DESC' + | 'TYPE_TABLE_NAME_ASC' + | 'TYPE_TABLE_NAME_DESC'; /** Methods to use when ordering `WebauthnAuthModule`. */ -export type WebauthnAuthModuleOrderBy = "ATTESTATION_TYPE_ASC" | "ATTESTATION_TYPE_DESC" | "AUTH_SETTINGS_TABLE_ID_ASC" | "AUTH_SETTINGS_TABLE_ID_DESC" | "CHALLENGE_EXPIRY_ASC" | "CHALLENGE_EXPIRY_DESC" | "CREDENTIALS_TABLE_ID_ASC" | "CREDENTIALS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORIGIN_ALLOWLIST_ASC" | "ORIGIN_ALLOWLIST_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRE_USER_VERIFICATION_ASC" | "REQUIRE_USER_VERIFICATION_DESC" | "RESIDENT_KEY_ASC" | "RESIDENT_KEY_DESC" | "RP_ID_ASC" | "RP_ID_DESC" | "RP_NAME_ASC" | "RP_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_SECRETS_TABLE_ID_ASC" | "SESSION_SECRETS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; +export type WebauthnAuthModuleOrderBy = + | 'ATTESTATION_TYPE_ASC' + | 'ATTESTATION_TYPE_DESC' + | 'AUTH_SETTINGS_TABLE_ID_ASC' + | 'AUTH_SETTINGS_TABLE_ID_DESC' + | 'CHALLENGE_EXPIRY_ASC' + | 'CHALLENGE_EXPIRY_DESC' + | 'CREDENTIALS_TABLE_ID_ASC' + | 'CREDENTIALS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORIGIN_ALLOWLIST_ASC' + | 'ORIGIN_ALLOWLIST_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRE_USER_VERIFICATION_ASC' + | 'REQUIRE_USER_VERIFICATION_DESC' + | 'RESIDENT_KEY_ASC' + | 'RESIDENT_KEY_DESC' + | 'RP_ID_ASC' + | 'RP_ID_DESC' + | 'RP_NAME_ASC' + | 'RP_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_SECRETS_TABLE_ID_ASC' + | 'SESSION_SECRETS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; /** Methods to use when ordering `WebauthnCredentialsModule`. */ -export type WebauthnCredentialsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; +export type WebauthnCredentialsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; /** Methods to use when ordering `WebhookModule`. */ -export type WebhookModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_INVOCATION_MODULE_ID_ASC" | "FUNCTION_INVOCATION_MODULE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INFRA_SECRETS_MODULE_ID_ASC" | "INFRA_SECRETS_MODULE_ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "WEBHOOK_ENDPOINTS_TABLE_ID_ASC" | "WEBHOOK_ENDPOINTS_TABLE_ID_DESC" | "WEBHOOK_ENDPOINTS_TABLE_NAME_ASC" | "WEBHOOK_ENDPOINTS_TABLE_NAME_DESC" | "WEBHOOK_EVENTS_TABLE_ID_ASC" | "WEBHOOK_EVENTS_TABLE_ID_DESC" | "WEBHOOK_EVENTS_TABLE_NAME_ASC" | "WEBHOOK_EVENTS_TABLE_NAME_DESC"; +export type WebhookModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_INVOCATION_MODULE_ID_ASC' + | 'FUNCTION_INVOCATION_MODULE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INFRA_SECRETS_MODULE_ID_ASC' + | 'INFRA_SECRETS_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'WEBHOOK_ENDPOINTS_TABLE_ID_ASC' + | 'WEBHOOK_ENDPOINTS_TABLE_ID_DESC' + | 'WEBHOOK_ENDPOINTS_TABLE_NAME_ASC' + | 'WEBHOOK_ENDPOINTS_TABLE_NAME_DESC' + | 'WEBHOOK_EVENTS_TABLE_ID_ASC' + | 'WEBHOOK_EVENTS_TABLE_ID_DESC' + | 'WEBHOOK_EVENTS_TABLE_NAME_ASC' + | 'WEBHOOK_EVENTS_TABLE_NAME_DESC'; /** A filter to be used against `AgentModule` object types. All fields are combined with a logical ‘and.’ */ export interface AgentModuleFilter { /** Filter by the object’s `agentTableId` field. */ @@ -11709,4 +14803,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/modules/types.ts b/sdk/constructive-react/src/modules/types.ts index 5d36f42ee1..66a1f78ad0 100644 --- a/sdk/constructive-react/src/modules/types.ts +++ b/sdk/constructive-react/src/modules/types.ts @@ -1764,4 +1764,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/hooks/client.ts b/sdk/constructive-react/src/objects/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/objects/hooks/client.ts +++ b/sdk/constructive-react/src/objects/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/objects/hooks/index.ts b/sdk/constructive-react/src/objects/hooks/index.ts index d31d853b24..386dde7522 100644 --- a/sdk/constructive-react/src/objects/hooks/index.ts +++ b/sdk/constructive-react/src/objects/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: Commit, GetAllTreeNodesRecord, Object, Ref, Store - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/objects/hooks/invalidation.ts b/sdk/constructive-react/src/objects/hooks/invalidation.ts index c97311b2f2..83a874d56d 100644 --- a/sdk/constructive-react/src/objects/hooks/invalidation.ts +++ b/sdk/constructive-react/src/objects/hooks/invalidation.ts @@ -13,8 +13,14 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { commitKeys, getAllTreeNodesRecordKeys, objectKeys, refKeys, storeKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + commitKeys, + getAllTreeNodesRecordKeys, + objectKeys, + refKeys, + storeKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,61 +41,79 @@ import { commitKeys, getAllTreeNodesRecordKeys, objectKeys, refKeys, storeKeys } * ``` */ export const invalidate = { - /** Invalidate commit queries */commit: { - /** Invalidate all commit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: commitKeys.all - }), - /** Invalidate commit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: commitKeys.lists() - }), - /** Invalidate a specific commit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: commitKeys.detail(id) - }) + /** Invalidate commit queries */ commit: { + /** Invalidate all commit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: commitKeys.all, + }), + /** Invalidate commit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: commitKeys.lists(), + }), + /** Invalidate a specific commit */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: commitKeys.detail(id), + }), }, - /** Invalidate getAllTreeNodesRecord queries */getAllTreeNodesRecord: { - /** Invalidate all getAllTreeNodesRecord queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: getAllTreeNodesRecordKeys.all - }), - /** Invalidate getAllTreeNodesRecord list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: getAllTreeNodesRecordKeys.lists() - }), - /** Invalidate a specific getAllTreeNodesRecord */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: getAllTreeNodesRecordKeys.detail(id) - }) + /** Invalidate getAllTreeNodesRecord queries */ getAllTreeNodesRecord: { + /** Invalidate all getAllTreeNodesRecord queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: getAllTreeNodesRecordKeys.all, + }), + /** Invalidate getAllTreeNodesRecord list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: getAllTreeNodesRecordKeys.lists(), + }), + /** Invalidate a specific getAllTreeNodesRecord */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: getAllTreeNodesRecordKeys.detail(id), + }), }, - /** Invalidate object queries */object: { - /** Invalidate all object queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: objectKeys.all - }), - /** Invalidate object list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: objectKeys.lists() - }), - /** Invalidate a specific object */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: objectKeys.detail(id) - }) + /** Invalidate object queries */ object: { + /** Invalidate all object queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: objectKeys.all, + }), + /** Invalidate object list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: objectKeys.lists(), + }), + /** Invalidate a specific object */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: objectKeys.detail(id), + }), }, - /** Invalidate ref queries */ref: { - /** Invalidate all ref queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: refKeys.all - }), - /** Invalidate ref list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: refKeys.lists() - }), - /** Invalidate a specific ref */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: refKeys.detail(id) - }) + /** Invalidate ref queries */ ref: { + /** Invalidate all ref queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: refKeys.all, + }), + /** Invalidate ref list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: refKeys.lists(), + }), + /** Invalidate a specific ref */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: refKeys.detail(id), + }), + }, + /** Invalidate store queries */ store: { + /** Invalidate all store queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: storeKeys.all, + }), + /** Invalidate store list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: storeKeys.lists(), + }), + /** Invalidate a specific store */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: storeKeys.detail(id), + }), }, - /** Invalidate store queries */store: { - /** Invalidate all store queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: storeKeys.all - }), - /** Invalidate store list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: storeKeys.lists() - }), - /** Invalidate a specific store */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: storeKeys.detail(id) - }) - } } as const; /** @@ -103,29 +127,32 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove commit from cache */commit: (queryClient: QueryClient, id: string | number) => { + /** Remove commit from cache */ commit: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: commitKeys.detail(id) + queryKey: commitKeys.detail(id), }); }, - /** Remove getAllTreeNodesRecord from cache */getAllTreeNodesRecord: (queryClient: QueryClient, id: string | number) => { + /** Remove getAllTreeNodesRecord from cache */ getAllTreeNodesRecord: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: getAllTreeNodesRecordKeys.detail(id) + queryKey: getAllTreeNodesRecordKeys.detail(id), }); }, - /** Remove object from cache */object: (queryClient: QueryClient, id: string | number) => { + /** Remove object from cache */ object: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: objectKeys.detail(id) + queryKey: objectKeys.detail(id), }); }, - /** Remove ref from cache */ref: (queryClient: QueryClient, id: string | number) => { + /** Remove ref from cache */ ref: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: refKeys.detail(id) + queryKey: refKeys.detail(id), }); }, - /** Remove store from cache */store: (queryClient: QueryClient, id: string | number) => { + /** Remove store from cache */ store: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: storeKeys.detail(id) + queryKey: storeKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/objects/hooks/mutation-keys.ts b/sdk/constructive-react/src/objects/hooks/mutation-keys.ts index 31fd94f02a..5d6f35ef0d 100644 --- a/sdk/constructive-react/src/objects/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/objects/hooks/mutation-keys.ts @@ -19,34 +19,48 @@ // ============================================================================ export const commitMutationKeys = { - /** All commit mutation keys */all: ["mutation", "commit"] as const, - /** Create commit mutation key */create: () => ["mutation", "commit", "create"] as const, - /** Update commit mutation key */update: (id: string | number) => ["mutation", "commit", "update", id] as const, - /** Delete commit mutation key */delete: (id: string | number) => ["mutation", "commit", "delete", id] as const + /** All commit mutation keys */ all: ['mutation', 'commit'] as const, + /** Create commit mutation key */ create: () => ['mutation', 'commit', 'create'] as const, + /** Update commit mutation key */ update: (id: string | number) => + ['mutation', 'commit', 'update', id] as const, + /** Delete commit mutation key */ delete: (id: string | number) => + ['mutation', 'commit', 'delete', id] as const, } as const; export const getAllTreeNodesRecordMutationKeys = { - /** All getAllTreeNodesRecord mutation keys */all: ["mutation", "getalltreenodesrecord"] as const, - /** Create getAllTreeNodesRecord mutation key */create: () => ["mutation", "getalltreenodesrecord", "create"] as const, - /** Update getAllTreeNodesRecord mutation key */update: (id: string | number) => ["mutation", "getalltreenodesrecord", "update", id] as const, - /** Delete getAllTreeNodesRecord mutation key */delete: (id: string | number) => ["mutation", "getalltreenodesrecord", "delete", id] as const + /** All getAllTreeNodesRecord mutation keys */ all: [ + 'mutation', + 'getalltreenodesrecord', + ] as const, + /** Create getAllTreeNodesRecord mutation key */ create: () => + ['mutation', 'getalltreenodesrecord', 'create'] as const, + /** Update getAllTreeNodesRecord mutation key */ update: (id: string | number) => + ['mutation', 'getalltreenodesrecord', 'update', id] as const, + /** Delete getAllTreeNodesRecord mutation key */ delete: (id: string | number) => + ['mutation', 'getalltreenodesrecord', 'delete', id] as const, } as const; export const objectMutationKeys = { - /** All object mutation keys */all: ["mutation", "object"] as const, - /** Create object mutation key */create: () => ["mutation", "object", "create"] as const, - /** Update object mutation key */update: (id: string | number) => ["mutation", "object", "update", id] as const, - /** Delete object mutation key */delete: (id: string | number) => ["mutation", "object", "delete", id] as const + /** All object mutation keys */ all: ['mutation', 'object'] as const, + /** Create object mutation key */ create: () => ['mutation', 'object', 'create'] as const, + /** Update object mutation key */ update: (id: string | number) => + ['mutation', 'object', 'update', id] as const, + /** Delete object mutation key */ delete: (id: string | number) => + ['mutation', 'object', 'delete', id] as const, } as const; export const refMutationKeys = { - /** All ref mutation keys */all: ["mutation", "ref"] as const, - /** Create ref mutation key */create: () => ["mutation", "ref", "create"] as const, - /** Update ref mutation key */update: (id: string | number) => ["mutation", "ref", "update", id] as const, - /** Delete ref mutation key */delete: (id: string | number) => ["mutation", "ref", "delete", id] as const + /** All ref mutation keys */ all: ['mutation', 'ref'] as const, + /** Create ref mutation key */ create: () => ['mutation', 'ref', 'create'] as const, + /** Update ref mutation key */ update: (id: string | number) => + ['mutation', 'ref', 'update', id] as const, + /** Delete ref mutation key */ delete: (id: string | number) => + ['mutation', 'ref', 'delete', id] as const, } as const; export const storeMutationKeys = { - /** All store mutation keys */all: ["mutation", "store"] as const, - /** Create store mutation key */create: () => ["mutation", "store", "create"] as const, - /** Update store mutation key */update: (id: string | number) => ["mutation", "store", "update", id] as const, - /** Delete store mutation key */delete: (id: string | number) => ["mutation", "store", "delete", id] as const + /** All store mutation keys */ all: ['mutation', 'store'] as const, + /** Create store mutation key */ create: () => ['mutation', 'store', 'create'] as const, + /** Update store mutation key */ update: (id: string | number) => + ['mutation', 'store', 'update', id] as const, + /** Delete store mutation key */ delete: (id: string | number) => + ['mutation', 'store', 'delete', id] as const, } as const; // ============================================================================ @@ -54,10 +68,22 @@ export const storeMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for initEmptyRepo */initEmptyRepo: (identifier?: string) => identifier ? ["mutation", "initEmptyRepo", identifier] as const : ["mutation", "initEmptyRepo"] as const, - /** Mutation key for insertNodeAtPath */insertNodeAtPath: (identifier?: string) => identifier ? ["mutation", "insertNodeAtPath", identifier] as const : ["mutation", "insertNodeAtPath"] as const, - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const, - /** Mutation key for setDataAtPath */setDataAtPath: (identifier?: string) => identifier ? ["mutation", "setDataAtPath", identifier] as const : ["mutation", "setDataAtPath"] as const + /** Mutation key for initEmptyRepo */ initEmptyRepo: (identifier?: string) => + identifier + ? (['mutation', 'initEmptyRepo', identifier] as const) + : (['mutation', 'initEmptyRepo'] as const), + /** Mutation key for insertNodeAtPath */ insertNodeAtPath: (identifier?: string) => + identifier + ? (['mutation', 'insertNodeAtPath', identifier] as const) + : (['mutation', 'insertNodeAtPath'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), + /** Mutation key for setDataAtPath */ setDataAtPath: (identifier?: string) => + identifier + ? (['mutation', 'setDataAtPath', identifier] as const) + : (['mutation', 'setDataAtPath'] as const), } as const; /** @@ -87,5 +113,5 @@ export const mutationKeys = { object: objectMutationKeys, ref: refMutationKeys, store: storeMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/objects/hooks/mutations/index.ts b/sdk/constructive-react/src/objects/hooks/mutations/index.ts index 42faa1cc2d..b1f8e735fc 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/index.ts @@ -3,20 +3,20 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateCommitMutation"; -export * from "./useUpdateCommitMutation"; -export * from "./useDeleteCommitMutation"; -export * from "./useCreateGetAllTreeNodesRecordMutation"; -export * from "./useCreateObjectMutation"; -export * from "./useUpdateObjectMutation"; -export * from "./useDeleteObjectMutation"; -export * from "./useCreateRefMutation"; -export * from "./useUpdateRefMutation"; -export * from "./useDeleteRefMutation"; -export * from "./useCreateStoreMutation"; -export * from "./useUpdateStoreMutation"; -export * from "./useDeleteStoreMutation"; -export * from "./useInitEmptyRepoMutation"; -export * from "./useInsertNodeAtPathMutation"; -export * from "./useProvisionBucketMutation"; -export * from "./useSetDataAtPathMutation"; \ No newline at end of file +export * from './useCreateCommitMutation'; +export * from './useUpdateCommitMutation'; +export * from './useDeleteCommitMutation'; +export * from './useCreateGetAllTreeNodesRecordMutation'; +export * from './useCreateObjectMutation'; +export * from './useUpdateObjectMutation'; +export * from './useDeleteObjectMutation'; +export * from './useCreateRefMutation'; +export * from './useUpdateRefMutation'; +export * from './useDeleteRefMutation'; +export * from './useCreateStoreMutation'; +export * from './useUpdateStoreMutation'; +export * from './useDeleteStoreMutation'; +export * from './useInitEmptyRepoMutation'; +export * from './useInsertNodeAtPathMutation'; +export * from './useProvisionBucketMutation'; +export * from './useSetDataAtPathMutation'; diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useCreateCommitMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useCreateCommitMutation.ts index c1c72217ef..c35be05129 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useCreateCommitMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useCreateCommitMutation.ts @@ -4,62 +4,77 @@ * 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 { commitKeys } from "../query-keys"; -import { commitMutationKeys } from "../mutation-keys"; -import type { CommitSelect, CommitWithRelations, CreateCommitInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CommitSelect, CommitWithRelations, CreateCommitInput } from "../../orm/input-types"; +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 { commitKeys } from '../query-keys'; +import { commitMutationKeys } from '../mutation-keys'; +import type { CommitSelect, CommitWithRelations, CreateCommitInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CommitSelect, CommitWithRelations, CreateCommitInput } from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useCreateCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateCommitMutation(params: { - selection: ({ - fields: S & CommitSelect; - } & HookStrictSelect, CommitSelect>); -} & Omit; - }; -}, Error, CreateCommitInput["commit"]>, "mutationFn">): UseMutationResult<{ - createCommit: { - commit: InferSelectResult; - }; -}, Error, CreateCommitInput["commit"]>; -export function useCreateCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateCommitMutation( + params: { + selection: { + fields: S & CommitSelect; + } & HookStrictSelect, CommitSelect>; + } & Omit< + UseMutationOptions< + { + createCommit: { + commit: InferSelectResult; + }; + }, + Error, + CreateCommitInput['commit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createCommit: { + commit: InferSelectResult; + }; + }, + Error, + CreateCommitInput['commit'] +>; +export function useCreateCommitMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: commitMutationKeys.create(), - mutationFn: (data: CreateCommitInput["commit"]) => getClient().commit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateCommitInput['commit']) => + getClient() + .commit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: commitKeys.lists() + queryKey: commitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useCreateGetAllTreeNodesRecordMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useCreateGetAllTreeNodesRecordMutation.ts index 9350f7f00c..5a0447b6b9 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useCreateGetAllTreeNodesRecordMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useCreateGetAllTreeNodesRecordMutation.ts @@ -4,62 +4,88 @@ * 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 { getAllTreeNodesRecordKeys } from "../query-keys"; -import { getAllTreeNodesRecordMutationKeys } from "../mutation-keys"; -import type { GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordWithRelations, CreateGetAllTreeNodesRecordInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordWithRelations, CreateGetAllTreeNodesRecordInput } from "../../orm/input-types"; +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 { getAllTreeNodesRecordKeys } from '../query-keys'; +import { getAllTreeNodesRecordMutationKeys } from '../mutation-keys'; +import type { + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordWithRelations, + CreateGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordWithRelations, + CreateGetAllTreeNodesRecordInput, +} from '../../orm/input-types'; /** * Mutation hook for creating a GetAllTreeNodesRecord - * + * * @example * ```tsx * const { mutate, isPending } = useCreateGetAllTreeNodesRecordMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateGetAllTreeNodesRecordMutation(params: { - selection: ({ - fields: S & GetAllTreeNodesRecordSelect; - } & HookStrictSelect, GetAllTreeNodesRecordSelect>); -} & Omit; - }; -}, Error, CreateGetAllTreeNodesRecordInput["getAllTreeNodesRecord"]>, "mutationFn">): UseMutationResult<{ - createGetAllTreeNodesRecord: { - getAllTreeNodesRecord: InferSelectResult; - }; -}, Error, CreateGetAllTreeNodesRecordInput["getAllTreeNodesRecord"]>; -export function useCreateGetAllTreeNodesRecordMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateGetAllTreeNodesRecordMutation( + params: { + selection: { + fields: S & GetAllTreeNodesRecordSelect; + } & HookStrictSelect, GetAllTreeNodesRecordSelect>; + } & Omit< + UseMutationOptions< + { + createGetAllTreeNodesRecord: { + getAllTreeNodesRecord: InferSelectResult; + }; + }, + Error, + CreateGetAllTreeNodesRecordInput['getAllTreeNodesRecord'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createGetAllTreeNodesRecord: { + getAllTreeNodesRecord: InferSelectResult; + }; + }, + Error, + CreateGetAllTreeNodesRecordInput['getAllTreeNodesRecord'] +>; +export function useCreateGetAllTreeNodesRecordMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: getAllTreeNodesRecordMutationKeys.create(), - mutationFn: (data: CreateGetAllTreeNodesRecordInput["getAllTreeNodesRecord"]) => getClient().getAllTreeNodesRecord.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateGetAllTreeNodesRecordInput['getAllTreeNodesRecord']) => + getClient() + .getAllTreeNodesRecord.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: getAllTreeNodesRecordKeys.lists() + queryKey: getAllTreeNodesRecordKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useCreateObjectMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useCreateObjectMutation.ts index de7b01f55b..ad92e1f7c6 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useCreateObjectMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useCreateObjectMutation.ts @@ -4,62 +4,77 @@ * 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 { objectKeys } from "../query-keys"; -import { objectMutationKeys } from "../mutation-keys"; -import type { ObjectSelect, ObjectWithRelations, CreateObjectInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ObjectSelect, ObjectWithRelations, CreateObjectInput } from "../../orm/input-types"; +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 { objectKeys } from '../query-keys'; +import { objectMutationKeys } from '../mutation-keys'; +import type { ObjectSelect, ObjectWithRelations, CreateObjectInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ObjectSelect, ObjectWithRelations, CreateObjectInput } from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useCreateObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateObjectMutation(params: { - selection: ({ - fields: S & ObjectSelect; - } & HookStrictSelect, ObjectSelect>); -} & Omit; - }; -}, Error, CreateObjectInput["object"]>, "mutationFn">): UseMutationResult<{ - createObject: { - object: InferSelectResult; - }; -}, Error, CreateObjectInput["object"]>; -export function useCreateObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateObjectMutation( + params: { + selection: { + fields: S & ObjectSelect; + } & HookStrictSelect, ObjectSelect>; + } & Omit< + UseMutationOptions< + { + createObject: { + object: InferSelectResult; + }; + }, + Error, + CreateObjectInput['object'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createObject: { + object: InferSelectResult; + }; + }, + Error, + CreateObjectInput['object'] +>; +export function useCreateObjectMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: objectMutationKeys.create(), - mutationFn: (data: CreateObjectInput["object"]) => getClient().object.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateObjectInput['object']) => + getClient() + .object.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: objectKeys.lists() + queryKey: objectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useCreateRefMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useCreateRefMutation.ts index ffc0e01c5b..93cda72e86 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useCreateRefMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useCreateRefMutation.ts @@ -4,62 +4,77 @@ * 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 { refKeys } from "../query-keys"; -import { refMutationKeys } from "../mutation-keys"; -import type { RefSelect, RefWithRelations, CreateRefInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RefSelect, RefWithRelations, CreateRefInput } from "../../orm/input-types"; +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 { refKeys } from '../query-keys'; +import { refMutationKeys } from '../mutation-keys'; +import type { RefSelect, RefWithRelations, CreateRefInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RefSelect, RefWithRelations, CreateRefInput } from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useCreateRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateRefMutation(params: { - selection: ({ - fields: S & RefSelect; - } & HookStrictSelect, RefSelect>); -} & Omit; - }; -}, Error, CreateRefInput["ref"]>, "mutationFn">): UseMutationResult<{ - createRef: { - ref: InferSelectResult; - }; -}, Error, CreateRefInput["ref"]>; -export function useCreateRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateRefMutation( + params: { + selection: { + fields: S & RefSelect; + } & HookStrictSelect, RefSelect>; + } & Omit< + UseMutationOptions< + { + createRef: { + ref: InferSelectResult; + }; + }, + Error, + CreateRefInput['ref'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createRef: { + ref: InferSelectResult; + }; + }, + Error, + CreateRefInput['ref'] +>; +export function useCreateRefMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: refMutationKeys.create(), - mutationFn: (data: CreateRefInput["ref"]) => getClient().ref.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateRefInput['ref']) => + getClient() + .ref.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: refKeys.lists() + queryKey: refKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useCreateStoreMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useCreateStoreMutation.ts index 870995b6f2..6f37fd67d0 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useCreateStoreMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useCreateStoreMutation.ts @@ -4,62 +4,77 @@ * 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 { storeKeys } from "../query-keys"; -import { storeMutationKeys } from "../mutation-keys"; -import type { StoreSelect, StoreWithRelations, CreateStoreInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StoreSelect, StoreWithRelations, CreateStoreInput } from "../../orm/input-types"; +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 { storeKeys } from '../query-keys'; +import { storeMutationKeys } from '../mutation-keys'; +import type { StoreSelect, StoreWithRelations, CreateStoreInput } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { StoreSelect, StoreWithRelations, CreateStoreInput } from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateStoreMutation(params: { - selection: ({ - fields: S & StoreSelect; - } & HookStrictSelect, StoreSelect>); -} & Omit; - }; -}, Error, CreateStoreInput["store"]>, "mutationFn">): UseMutationResult<{ - createStore: { - store: InferSelectResult; - }; -}, Error, CreateStoreInput["store"]>; -export function useCreateStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateStoreMutation( + params: { + selection: { + fields: S & StoreSelect; + } & HookStrictSelect, StoreSelect>; + } & Omit< + UseMutationOptions< + { + createStore: { + store: InferSelectResult; + }; + }, + Error, + CreateStoreInput['store'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createStore: { + store: InferSelectResult; + }; + }, + Error, + CreateStoreInput['store'] +>; +export function useCreateStoreMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storeMutationKeys.create(), - mutationFn: (data: CreateStoreInput["store"]) => getClient().store.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateStoreInput['store']) => + getClient() + .store.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: storeKeys.lists() + queryKey: storeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteCommitMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteCommitMutation.ts index 066007a2ae..4b3a5ed454 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteCommitMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteCommitMutation.ts @@ -4,83 +4,99 @@ * 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 { commitKeys } from "../query-keys"; -import { commitMutationKeys } from "../mutation-keys"; -import type { CommitSelect, CommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CommitSelect, CommitWithRelations } from "../../orm/input-types"; +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 { commitKeys } from '../query-keys'; +import { commitMutationKeys } from '../mutation-keys'; +import type { CommitSelect, CommitWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CommitSelect, CommitWithRelations } from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteCommitMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteCommitMutation(params: { - selection: ({ - fields: S & CommitSelect; - } & HookStrictSelect, CommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteCommit: { - commit: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; -}>; -export function useDeleteCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteCommitMutation( + params: { + selection: { + fields: S & CommitSelect; + } & HookStrictSelect, CommitSelect>; + } & Omit< + UseMutationOptions< + { + deleteCommit: { + commit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteCommit: { + commit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: commitMutationKeys.all, - mutationFn: ({ - id, - databaseId - }: { - id: string; - databaseId: string; - }) => getClient().commit.delete({ - where: { - id, - databaseId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .commit.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: commitKeys.detail(variables.id) + queryKey: commitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: commitKeys.lists() + queryKey: commitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteObjectMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteObjectMutation.ts index d58f366df3..773c2456e1 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteObjectMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteObjectMutation.ts @@ -4,83 +4,99 @@ * 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 { objectKeys } from "../query-keys"; -import { objectMutationKeys } from "../mutation-keys"; -import type { ObjectSelect, ObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ObjectSelect, ObjectWithRelations } from "../../orm/input-types"; +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 { objectKeys } from '../query-keys'; +import { objectMutationKeys } from '../mutation-keys'; +import type { ObjectSelect, ObjectWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ObjectSelect, ObjectWithRelations } from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteObjectMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteObjectMutation(params: { - selection: ({ - fields: S & ObjectSelect; - } & HookStrictSelect, ObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteObject: { - object: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; -}>; -export function useDeleteObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteObjectMutation( + params: { + selection: { + fields: S & ObjectSelect; + } & HookStrictSelect, ObjectSelect>; + } & Omit< + UseMutationOptions< + { + deleteObject: { + object: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteObject: { + object: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: objectMutationKeys.all, - mutationFn: ({ - id, - databaseId - }: { - id: string; - databaseId: string; - }) => getClient().object.delete({ - where: { - id, - databaseId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .object.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: objectKeys.detail(variables.id) + queryKey: objectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: objectKeys.lists() + queryKey: objectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteRefMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteRefMutation.ts index 4d6a71e0ab..32cfb9b2ec 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteRefMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteRefMutation.ts @@ -4,83 +4,99 @@ * 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 { refKeys } from "../query-keys"; -import { refMutationKeys } from "../mutation-keys"; -import type { RefSelect, RefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RefSelect, RefWithRelations } from "../../orm/input-types"; +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 { refKeys } from '../query-keys'; +import { refMutationKeys } from '../mutation-keys'; +import type { RefSelect, RefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RefSelect, RefWithRelations } from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteRefMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteRefMutation(params: { - selection: ({ - fields: S & RefSelect; - } & HookStrictSelect, RefSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; -}>, "mutationFn">): UseMutationResult<{ - deleteRef: { - ref: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; -}>; -export function useDeleteRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteRefMutation( + params: { + selection: { + fields: S & RefSelect; + } & HookStrictSelect, RefSelect>; + } & Omit< + UseMutationOptions< + { + deleteRef: { + ref: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteRef: { + ref: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: refMutationKeys.all, - mutationFn: ({ - id, - databaseId - }: { - id: string; - databaseId: string; - }) => getClient().ref.delete({ - where: { - id, - databaseId - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .ref.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: refKeys.detail(variables.id) + queryKey: refKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: refKeys.lists() + queryKey: refKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteStoreMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteStoreMutation.ts index 47e5db8883..b3f8aa9126 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteStoreMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteStoreMutation.ts @@ -4,77 +4,95 @@ * 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 { storeKeys } from "../query-keys"; -import { storeMutationKeys } from "../mutation-keys"; -import type { StoreSelect, StoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StoreSelect, StoreWithRelations } from "../../orm/input-types"; +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 { storeKeys } from '../query-keys'; +import { storeMutationKeys } from '../mutation-keys'; +import type { StoreSelect, StoreWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { StoreSelect, StoreWithRelations } from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteStoreMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteStoreMutation(params: { - selection: ({ - fields: S & StoreSelect; - } & HookStrictSelect, StoreSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteStore: { - store: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteStoreMutation( + params: { + selection: { + fields: S & StoreSelect; + } & HookStrictSelect, StoreSelect>; + } & Omit< + UseMutationOptions< + { + deleteStore: { + store: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteStore: { + store: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storeMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().store.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .store.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: storeKeys.detail(variables.id) + queryKey: storeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: storeKeys.lists() + queryKey: storeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useInitEmptyRepoMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useInitEmptyRepoMutation.ts index eaebea4a83..f82dc9e02c 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useInitEmptyRepoMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useInitEmptyRepoMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { InitEmptyRepoVariables } from "../../orm/mutation"; -import type { InitEmptyRepoPayloadSelect, InitEmptyRepoPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { InitEmptyRepoVariables } from "../../orm/mutation"; -export type { InitEmptyRepoPayloadSelect } from "../../orm/input-types"; -export function useInitEmptyRepoMutation(params: { - selection: ({ - fields: S & InitEmptyRepoPayloadSelect; - } & HookStrictSelect, InitEmptyRepoPayloadSelect>); -} & Omit | null; -}, Error, InitEmptyRepoVariables>, "mutationFn">): UseMutationResult<{ - initEmptyRepo: InferSelectResult | null; -}, Error, InitEmptyRepoVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { InitEmptyRepoVariables } from '../../orm/mutation'; +import type { InitEmptyRepoPayloadSelect, InitEmptyRepoPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InitEmptyRepoVariables } from '../../orm/mutation'; +export type { InitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export function useInitEmptyRepoMutation( + params: { + selection: { + fields: S & InitEmptyRepoPayloadSelect; + } & HookStrictSelect, InitEmptyRepoPayloadSelect>; + } & Omit< + UseMutationOptions< + { + initEmptyRepo: InferSelectResult | null; + }, + Error, + InitEmptyRepoVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + initEmptyRepo: InferSelectResult | null; + }, + Error, + InitEmptyRepoVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.initEmptyRepo(), - mutationFn: (variables: InitEmptyRepoVariables) => getClient().mutation.initEmptyRepo(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: InitEmptyRepoVariables) => + getClient() + .mutation.initEmptyRepo(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useInsertNodeAtPathMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useInsertNodeAtPathMutation.ts index c7b39646ad..9da7a1bd56 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useInsertNodeAtPathMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useInsertNodeAtPathMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { InsertNodeAtPathVariables } from "../../orm/mutation"; -import type { InsertNodeAtPathPayloadSelect, InsertNodeAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { InsertNodeAtPathVariables } from "../../orm/mutation"; -export type { InsertNodeAtPathPayloadSelect } from "../../orm/input-types"; -export function useInsertNodeAtPathMutation(params: { - selection: ({ - fields: S & InsertNodeAtPathPayloadSelect; - } & HookStrictSelect, InsertNodeAtPathPayloadSelect>); -} & Omit | null; -}, Error, InsertNodeAtPathVariables>, "mutationFn">): UseMutationResult<{ - insertNodeAtPath: InferSelectResult | null; -}, Error, InsertNodeAtPathVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { InsertNodeAtPathVariables } from '../../orm/mutation'; +import type { InsertNodeAtPathPayloadSelect, InsertNodeAtPathPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InsertNodeAtPathVariables } from '../../orm/mutation'; +export type { InsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export function useInsertNodeAtPathMutation( + params: { + selection: { + fields: S & InsertNodeAtPathPayloadSelect; + } & HookStrictSelect, InsertNodeAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + insertNodeAtPath: InferSelectResult | null; + }, + Error, + InsertNodeAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + insertNodeAtPath: InferSelectResult | null; + }, + Error, + InsertNodeAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.insertNodeAtPath(), - mutationFn: (variables: InsertNodeAtPathVariables) => getClient().mutation.insertNodeAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: InsertNodeAtPathVariables) => + getClient() + .mutation.insertNodeAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useSetDataAtPathMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useSetDataAtPathMutation.ts index 059f3d68a3..63f39667a0 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useSetDataAtPathMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useSetDataAtPathMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { SetDataAtPathVariables } from "../../orm/mutation"; -import type { SetDataAtPathPayloadSelect, SetDataAtPathPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SetDataAtPathVariables } from "../../orm/mutation"; -export type { SetDataAtPathPayloadSelect } from "../../orm/input-types"; -export function useSetDataAtPathMutation(params: { - selection: ({ - fields: S & SetDataAtPathPayloadSelect; - } & HookStrictSelect, SetDataAtPathPayloadSelect>); -} & Omit | null; -}, Error, SetDataAtPathVariables>, "mutationFn">): UseMutationResult<{ - setDataAtPath: InferSelectResult | null; -}, Error, SetDataAtPathVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { SetDataAtPathVariables } from '../../orm/mutation'; +import type { SetDataAtPathPayloadSelect, SetDataAtPathPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SetDataAtPathVariables } from '../../orm/mutation'; +export type { SetDataAtPathPayloadSelect } from '../../orm/input-types'; +export function useSetDataAtPathMutation( + params: { + selection: { + fields: S & SetDataAtPathPayloadSelect; + } & HookStrictSelect, SetDataAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + setDataAtPath: InferSelectResult | null; + }, + Error, + SetDataAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + setDataAtPath: InferSelectResult | null; + }, + Error, + SetDataAtPathVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.setDataAtPath(), - mutationFn: (variables: SetDataAtPathVariables) => getClient().mutation.setDataAtPath(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SetDataAtPathVariables) => + getClient() + .mutation.setDataAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateCommitMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateCommitMutation.ts index 714a4ed7a3..b431e603f2 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateCommitMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateCommitMutation.ts @@ -4,61 +4,80 @@ * 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 { commitKeys } from "../query-keys"; -import { commitMutationKeys } from "../mutation-keys"; -import type { CommitSelect, CommitWithRelations, CommitPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CommitSelect, CommitWithRelations, CommitPatch } from "../../orm/input-types"; +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 { commitKeys } from '../query-keys'; +import { commitMutationKeys } from '../mutation-keys'; +import type { CommitSelect, CommitWithRelations, CommitPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CommitSelect, CommitWithRelations, CommitPatch } from '../../orm/input-types'; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateCommitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', commitPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateCommitMutation(params: { - selection: ({ - fields: S & CommitSelect; - } & HookStrictSelect, CommitSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; - commitPatch: CommitPatch; -}>, "mutationFn">): UseMutationResult<{ - updateCommit: { - commit: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; - commitPatch: CommitPatch; -}>; -export function useUpdateCommitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateCommitMutation( + params: { + selection: { + fields: S & CommitSelect; + } & HookStrictSelect, CommitSelect>; + } & Omit< + UseMutationOptions< + { + updateCommit: { + commit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + commitPatch: CommitPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateCommit: { + commit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + commitPatch: CommitPatch; + } +>; +export function useUpdateCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + commitPatch: CommitPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +85,30 @@ export function useUpdateCommitMutation(params: { mutationFn: ({ id, databaseId, - commitPatch + commitPatch, }: { id: string; databaseId: string; commitPatch: CommitPatch; - }) => getClient().commit.update({ - where: { - id, - databaseId - }, - data: commitPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .commit.update({ + where: { + id, + databaseId, + }, + data: commitPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: commitKeys.detail(variables.id) + queryKey: commitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: commitKeys.lists() + queryKey: commitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateObjectMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateObjectMutation.ts index a081921df2..1fcacaaf2c 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateObjectMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateObjectMutation.ts @@ -4,61 +4,80 @@ * 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 { objectKeys } from "../query-keys"; -import { objectMutationKeys } from "../mutation-keys"; -import type { ObjectSelect, ObjectWithRelations, ObjectPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ObjectSelect, ObjectWithRelations, ObjectPatch } from "../../orm/input-types"; +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 { objectKeys } from '../query-keys'; +import { objectMutationKeys } from '../mutation-keys'; +import type { ObjectSelect, ObjectWithRelations, ObjectPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ObjectSelect, ObjectWithRelations, ObjectPatch } from '../../orm/input-types'; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateObjectMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', objectPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateObjectMutation(params: { - selection: ({ - fields: S & ObjectSelect; - } & HookStrictSelect, ObjectSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; - objectPatch: ObjectPatch; -}>, "mutationFn">): UseMutationResult<{ - updateObject: { - object: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; - objectPatch: ObjectPatch; -}>; -export function useUpdateObjectMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateObjectMutation( + params: { + selection: { + fields: S & ObjectSelect; + } & HookStrictSelect, ObjectSelect>; + } & Omit< + UseMutationOptions< + { + updateObject: { + object: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + objectPatch: ObjectPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateObject: { + object: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + objectPatch: ObjectPatch; + } +>; +export function useUpdateObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + objectPatch: ObjectPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +85,30 @@ export function useUpdateObjectMutation(params: { mutationFn: ({ id, databaseId, - objectPatch + objectPatch, }: { id: string; databaseId: string; objectPatch: ObjectPatch; - }) => getClient().object.update({ - where: { - id, - databaseId - }, - data: objectPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .object.update({ + where: { + id, + databaseId, + }, + data: objectPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: objectKeys.detail(variables.id) + queryKey: objectKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: objectKeys.lists() + queryKey: objectKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateRefMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateRefMutation.ts index a1e2906865..6246f15310 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateRefMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateRefMutation.ts @@ -4,61 +4,80 @@ * 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 { refKeys } from "../query-keys"; -import { refMutationKeys } from "../mutation-keys"; -import type { RefSelect, RefWithRelations, RefPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RefSelect, RefWithRelations, RefPatch } from "../../orm/input-types"; +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 { refKeys } from '../query-keys'; +import { refMutationKeys } from '../mutation-keys'; +import type { RefSelect, RefWithRelations, RefPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RefSelect, RefWithRelations, RefPatch } from '../../orm/input-types'; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateRefMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', refPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateRefMutation(params: { - selection: ({ - fields: S & RefSelect; - } & HookStrictSelect, RefSelect>); -} & Omit; - }; -}, Error, { - id: string; - databaseId: string; - refPatch: RefPatch; -}>, "mutationFn">): UseMutationResult<{ - updateRef: { - ref: InferSelectResult; - }; -}, Error, { - id: string; - databaseId: string; - refPatch: RefPatch; -}>; -export function useUpdateRefMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateRefMutation( + params: { + selection: { + fields: S & RefSelect; + } & HookStrictSelect, RefSelect>; + } & Omit< + UseMutationOptions< + { + updateRef: { + ref: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + refPatch: RefPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateRef: { + ref: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + refPatch: RefPatch; + } +>; +export function useUpdateRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + refPatch: RefPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +85,30 @@ export function useUpdateRefMutation(params: { mutationFn: ({ id, databaseId, - refPatch + refPatch, }: { id: string; databaseId: string; refPatch: RefPatch; - }) => getClient().ref.update({ - where: { - id, - databaseId - }, - data: refPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .ref.update({ + where: { + id, + databaseId, + }, + data: refPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: refKeys.detail(variables.id) + queryKey: refKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: refKeys.lists() + queryKey: refKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateStoreMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateStoreMutation.ts index ee92157836..79e5989ec9 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateStoreMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateStoreMutation.ts @@ -4,83 +4,99 @@ * 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 { storeKeys } from "../query-keys"; -import { storeMutationKeys } from "../mutation-keys"; -import type { StoreSelect, StoreWithRelations, StorePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StoreSelect, StoreWithRelations, StorePatch } from "../../orm/input-types"; +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 { storeKeys } from '../query-keys'; +import { storeMutationKeys } from '../mutation-keys'; +import type { StoreSelect, StoreWithRelations, StorePatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { StoreSelect, StoreWithRelations, StorePatch } from '../../orm/input-types'; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateStoreMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', storePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateStoreMutation(params: { - selection: ({ - fields: S & StoreSelect; - } & HookStrictSelect, StoreSelect>); -} & Omit; - }; -}, Error, { - id: string; - storePatch: StorePatch; -}>, "mutationFn">): UseMutationResult<{ - updateStore: { - store: InferSelectResult; - }; -}, Error, { - id: string; - storePatch: StorePatch; -}>; -export function useUpdateStoreMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateStoreMutation( + params: { + selection: { + fields: S & StoreSelect; + } & HookStrictSelect, StoreSelect>; + } & Omit< + UseMutationOptions< + { + updateStore: { + store: InferSelectResult; + }; + }, + Error, + { + id: string; + storePatch: StorePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateStore: { + store: InferSelectResult; + }; + }, + Error, + { + id: string; + storePatch: StorePatch; + } +>; +export function useUpdateStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + storePatch: StorePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: storeMutationKeys.all, - mutationFn: ({ - id, - storePatch - }: { - id: string; - storePatch: StorePatch; - }) => getClient().store.update({ - where: { - id - }, - data: storePatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, storePatch }: { id: string; storePatch: StorePatch }) => + getClient() + .store.update({ + where: { + id, + }, + data: storePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: storeKeys.detail(variables.id) + queryKey: storeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: storeKeys.lists() + queryKey: storeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/index.ts b/sdk/constructive-react/src/objects/hooks/queries/index.ts index 50d9031354..d536af738d 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/index.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/index.ts @@ -3,12 +3,12 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCommitsQuery"; -export * from "./useCommitQuery"; -export * from "./useGetAllTreeNodesQuery"; -export * from "./useObjectsQuery"; -export * from "./useObjectQuery"; -export * from "./useRefsQuery"; -export * from "./useRefQuery"; -export * from "./useStoresQuery"; -export * from "./useStoreQuery"; \ No newline at end of file +export * from './useCommitsQuery'; +export * from './useCommitQuery'; +export * from './useGetAllTreeNodesQuery'; +export * from './useObjectsQuery'; +export * from './useObjectQuery'; +export * from './useRefsQuery'; +export * from './useRefQuery'; +export * from './useStoresQuery'; +export * from './useStoreQuery'; diff --git a/sdk/constructive-react/src/objects/hooks/queries/useCommitQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useCommitQuery.ts index f7819bb22b..cc1f20df4d 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useCommitQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useCommitQuery.ts @@ -4,20 +4,20 @@ * 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 { commitKeys } from "../query-keys"; -import type { CommitSelect, CommitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { CommitSelect, CommitWithRelations } from "../../orm/input-types"; +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 { commitKeys } from '../query-keys'; +import type { CommitSelect, CommitWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { CommitSelect, CommitWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const commitQueryKey = commitKeys.detail; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = useCommitQuery({ @@ -26,38 +26,52 @@ export const commitQueryKey = commitKeys.detail; * }); * ``` */ -export function useCommitQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CommitSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCommitQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCommitQuery< + S extends CommitSelect, + TData = { + commit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CommitSelect>; + } & Omit< + UseQueryOptions< + { + commit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCommitQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: commitKeys.detail(params.id), - queryFn: () => getClient().commit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .commit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchCommitQuery({ @@ -79,35 +93,46 @@ export async function fetchCommitQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().commit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .commit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchCommitQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, CommitSelect>; -}): Promise; -export async function prefetchCommitQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, CommitSelect>; + } +): Promise; +export async function prefetchCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: commitKeys.detail(params.id), - queryFn: () => getClient().commit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .commit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/useCommitsQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useCommitsQuery.ts index 2c7c2f667f..55ce979e2c 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useCommitsQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useCommitsQuery.ts @@ -4,20 +4,35 @@ * 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 { commitKeys } from "../query-keys"; -import type { CommitSelect, CommitWithRelations, CommitFilter, CommitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { CommitSelect, CommitWithRelations, CommitFilter, CommitOrderBy } from "../../orm/input-types"; +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 { commitKeys } from '../query-keys'; +import type { + CommitSelect, + CommitWithRelations, + CommitFilter, + CommitOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + CommitSelect, + CommitWithRelations, + CommitFilter, + CommitOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const commitsQueryKey = commitKeys.list; /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```tsx * const { data, isLoading } = useCommitsQuery({ @@ -30,33 +45,45 @@ export const commitsQueryKey = commitKeys.list; * }); * ``` */ -export function useCommitsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CommitSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useCommitsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useCommitsQuery< + S extends CommitSelect, + TData = { + commits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CommitSelect>; + } & Omit< + UseQueryOptions< + { + commits: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useCommitsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: commitKeys.list(args), queryFn: () => getClient().commit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * const data = await fetchCommitsQuery({ @@ -70,7 +97,8 @@ export function useCommitsQuery(params: { export async function fetchCommitsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, CommitSelect>; + } & Omit, 'fields'> & + HookStrictSelect, CommitSelect>; }): Promise<{ commits: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchCommitsQuery(params: { } /** * Commit history — each commit snapshots a tree root for a store - * + * * @example * ```ts * await prefetchCommitsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchCommitsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, CommitSelect>; -}): Promise; -export async function prefetchCommitsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchCommitsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, CommitSelect>; + } +): Promise; +export async function prefetchCommitsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: commitKeys.list(args), - queryFn: () => getClient().commit.findMany(args).unwrap() + queryFn: () => getClient().commit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/useGetAllTreeNodesQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useGetAllTreeNodesQuery.ts index a2467bbcce..cd2cf0083d 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useGetAllTreeNodesQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useGetAllTreeNodesQuery.ts @@ -4,20 +4,35 @@ * 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 { getAllTreeNodesRecordKeys } from "../query-keys"; -import type { GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy } from "../../orm/input-types"; +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 { getAllTreeNodesRecordKeys } from '../query-keys'; +import type { + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const getAllTreeNodesQueryKey = getAllTreeNodesRecordKeys.list; /** * Query hook for fetching GetAllTreeNodesRecord list - * + * * @example * ```tsx * const { data, isLoading } = useGetAllTreeNodesQuery({ @@ -30,33 +45,56 @@ export const getAllTreeNodesQueryKey = getAllTreeNodesRecordKeys.list; * }); * ``` */ -export function useGetAllTreeNodesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, GetAllTreeNodesRecordSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useGetAllTreeNodesQuery< + S extends GetAllTreeNodesRecordSelect, + TData = { + getAllTreeNodes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GetAllTreeNodesRecordSelect>; + } & Omit< + UseQueryOptions< + { + getAllTreeNodes: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGetAllTreeNodesQuery( + params: { + selection: ListSelectionConfig< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: getAllTreeNodesRecordKeys.list(args), queryFn: () => getClient().getAllTreeNodesRecord.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Fetch GetAllTreeNodesRecord list without React hooks - * + * * @example * ```ts * const data = await fetchGetAllTreeNodesQuery({ @@ -70,35 +108,65 @@ export function useGetAllTreeNodesQuery(params: { export async function fetchGetAllTreeNodesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, GetAllTreeNodesRecordSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GetAllTreeNodesRecordSelect>; }): Promise<{ getAllTreeNodes: ConnectionResult>; }>; export async function fetchGetAllTreeNodesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >(params.selection); return getClient().getAllTreeNodesRecord.findMany(args).unwrap(); } /** * Prefetch GetAllTreeNodesRecord list for SSR or cache warming - * + * * @example * ```ts * await prefetchGetAllTreeNodesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, GetAllTreeNodesRecordSelect>; -}): Promise; -export async function prefetchGetAllTreeNodesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchGetAllTreeNodesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GetAllTreeNodesRecordSelect>; + } +): Promise; +export async function prefetchGetAllTreeNodesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: getAllTreeNodesRecordKeys.list(args), - queryFn: () => getClient().getAllTreeNodesRecord.findMany(args).unwrap() + queryFn: () => getClient().getAllTreeNodesRecord.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/useObjectQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useObjectQuery.ts index 6547c77fc5..e396c58320 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useObjectQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useObjectQuery.ts @@ -4,20 +4,20 @@ * 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 { objectKeys } from "../query-keys"; -import type { ObjectSelect, ObjectWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { ObjectSelect, ObjectWithRelations } from "../../orm/input-types"; +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 { objectKeys } from '../query-keys'; +import type { ObjectSelect, ObjectWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { ObjectSelect, ObjectWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const getNodeAtPathQueryKey = objectKeys.detail; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = useObjectQuery({ @@ -26,38 +26,52 @@ export const getNodeAtPathQueryKey = objectKeys.detail; * }); * ``` */ -export function useObjectQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ObjectSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useObjectQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useObjectQuery< + S extends ObjectSelect, + TData = { + getNodeAtPath: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ObjectSelect>; + } & Omit< + UseQueryOptions< + { + getNodeAtPath: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useObjectQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: objectKeys.detail(params.id), - queryFn: () => getClient().object.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .object.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchObjectQuery({ @@ -79,35 +93,46 @@ export async function fetchObjectQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().object.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .object.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchObjectQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, ObjectSelect>; -}): Promise; -export async function prefetchObjectQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, ObjectSelect>; + } +): Promise; +export async function prefetchObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: objectKeys.detail(params.id), - queryFn: () => getClient().object.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .object.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/useObjectsQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useObjectsQuery.ts index 7efcf7c3af..64d260b538 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useObjectsQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useObjectsQuery.ts @@ -4,20 +4,35 @@ * 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 { objectKeys } from "../query-keys"; -import type { ObjectSelect, ObjectWithRelations, ObjectFilter, ObjectOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { ObjectSelect, ObjectWithRelations, ObjectFilter, ObjectOrderBy } from "../../orm/input-types"; +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 { objectKeys } from '../query-keys'; +import type { + ObjectSelect, + ObjectWithRelations, + ObjectFilter, + ObjectOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + ObjectSelect, + ObjectWithRelations, + ObjectFilter, + ObjectOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const objectsQueryKey = objectKeys.list; /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```tsx * const { data, isLoading } = useObjectsQuery({ @@ -30,33 +45,45 @@ export const objectsQueryKey = objectKeys.list; * }); * ``` */ -export function useObjectsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ObjectSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useObjectsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useObjectsQuery< + S extends ObjectSelect, + TData = { + objects: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ObjectSelect>; + } & Omit< + UseQueryOptions< + { + objects: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useObjectsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: objectKeys.list(args), queryFn: () => getClient().object.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * const data = await fetchObjectsQuery({ @@ -70,7 +97,8 @@ export function useObjectsQuery(params: { export async function fetchObjectsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, ObjectSelect>; + } & Omit, 'fields'> & + HookStrictSelect, ObjectSelect>; }): Promise<{ objects: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchObjectsQuery(params: { } /** * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children - * + * * @example * ```ts * await prefetchObjectsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchObjectsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, ObjectSelect>; -}): Promise; -export async function prefetchObjectsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchObjectsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, ObjectSelect>; + } +): Promise; +export async function prefetchObjectsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: objectKeys.list(args), - queryFn: () => getClient().object.findMany(args).unwrap() + queryFn: () => getClient().object.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/useRefQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useRefQuery.ts index d5d0245469..6ec9182b55 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useRefQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useRefQuery.ts @@ -4,20 +4,20 @@ * 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 { refKeys } from "../query-keys"; -import type { RefSelect, RefWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { RefSelect, RefWithRelations } from "../../orm/input-types"; +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 { refKeys } from '../query-keys'; +import type { RefSelect, RefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { RefSelect, RefWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const refQueryKey = refKeys.detail; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = useRefQuery({ @@ -26,38 +26,52 @@ export const refQueryKey = refKeys.detail; * }); * ``` */ -export function useRefQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RefSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRefQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRefQuery< + S extends RefSelect, + TData = { + ref: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RefSelect>; + } & Omit< + UseQueryOptions< + { + ref: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRefQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: refKeys.detail(params.id), - queryFn: () => getClient().ref.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .ref.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchRefQuery({ @@ -79,35 +93,46 @@ export async function fetchRefQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().ref.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .ref.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchRefQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchRefQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, RefSelect>; -}): Promise; -export async function prefetchRefQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, RefSelect>; + } +): Promise; +export async function prefetchRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: refKeys.detail(params.id), - queryFn: () => getClient().ref.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .ref.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/useRefsQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useRefsQuery.ts index 14e17b9e46..b0aff9df3c 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useRefsQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useRefsQuery.ts @@ -4,20 +4,25 @@ * 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 { refKeys } from "../query-keys"; -import type { RefSelect, RefWithRelations, RefFilter, RefOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { RefSelect, RefWithRelations, RefFilter, RefOrderBy } from "../../orm/input-types"; +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 { refKeys } from '../query-keys'; +import type { RefSelect, RefWithRelations, RefFilter, RefOrderBy } from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { RefSelect, RefWithRelations, RefFilter, RefOrderBy } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const refsQueryKey = refKeys.list; /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```tsx * const { data, isLoading } = useRefsQuery({ @@ -30,33 +35,45 @@ export const refsQueryKey = refKeys.list; * }); * ``` */ -export function useRefsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RefSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useRefsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useRefsQuery< + S extends RefSelect, + TData = { + refs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RefSelect>; + } & Omit< + UseQueryOptions< + { + refs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useRefsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: refKeys.list(args), queryFn: () => getClient().ref.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * const data = await fetchRefsQuery({ @@ -70,7 +87,8 @@ export function useRefsQuery(params: { export async function fetchRefsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, RefSelect>; + } & Omit, 'fields'> & + HookStrictSelect, RefSelect>; }): Promise<{ refs: ConnectionResult>; }>; @@ -82,23 +100,30 @@ export async function fetchRefsQuery(params: { } /** * Branch heads — mutable pointers into the commit chain - * + * * @example * ```ts * await prefetchRefsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchRefsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, RefSelect>; -}): Promise; -export async function prefetchRefsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchRefsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, RefSelect>; + } +): Promise; +export async function prefetchRefsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: refKeys.list(args), - queryFn: () => getClient().ref.findMany(args).unwrap() + queryFn: () => getClient().ref.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/useStoreQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useStoreQuery.ts index 3d33e5e6ac..5a0e159c01 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useStoreQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useStoreQuery.ts @@ -4,20 +4,20 @@ * 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 { storeKeys } from "../query-keys"; -import type { StoreSelect, StoreWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { StoreSelect, StoreWithRelations } from "../../orm/input-types"; +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 { storeKeys } from '../query-keys'; +import type { StoreSelect, StoreWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { StoreSelect, StoreWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const storeQueryKey = storeKeys.detail; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = useStoreQuery({ @@ -26,38 +26,52 @@ export const storeQueryKey = storeKeys.detail; * }); * ``` */ -export function useStoreQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, StoreSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useStoreQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useStoreQuery< + S extends StoreSelect, + TData = { + store: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, StoreSelect>; + } & Omit< + UseQueryOptions< + { + store: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useStoreQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: storeKeys.detail(params.id), - queryFn: () => getClient().store.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .store.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchStoreQuery({ @@ -79,35 +93,46 @@ export async function fetchStoreQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().store.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .store.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchStoreQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, StoreSelect>; -}): Promise; -export async function prefetchStoreQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, StoreSelect>; + } +): Promise; +export async function prefetchStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: storeKeys.detail(params.id), - queryFn: () => getClient().store.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .store.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/queries/useStoresQuery.ts b/sdk/constructive-react/src/objects/hooks/queries/useStoresQuery.ts index c803dd2627..579205fe4a 100644 --- a/sdk/constructive-react/src/objects/hooks/queries/useStoresQuery.ts +++ b/sdk/constructive-react/src/objects/hooks/queries/useStoresQuery.ts @@ -4,20 +4,35 @@ * 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 { storeKeys } from "../query-keys"; -import type { StoreSelect, StoreWithRelations, StoreFilter, StoreOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { StoreSelect, StoreWithRelations, StoreFilter, StoreOrderBy } from "../../orm/input-types"; +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 { storeKeys } from '../query-keys'; +import type { + StoreSelect, + StoreWithRelations, + StoreFilter, + StoreOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + StoreSelect, + StoreWithRelations, + StoreFilter, + StoreOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const storesQueryKey = storeKeys.list; /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```tsx * const { data, isLoading } = useStoresQuery({ @@ -30,33 +45,45 @@ export const storesQueryKey = storeKeys.list; * }); * ``` */ -export function useStoresQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, StoreSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useStoresQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useStoresQuery< + S extends StoreSelect, + TData = { + stores: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, StoreSelect>; + } & Omit< + UseQueryOptions< + { + stores: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useStoresQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: storeKeys.list(args), queryFn: () => getClient().store.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * const data = await fetchStoresQuery({ @@ -70,7 +97,8 @@ export function useStoresQuery(params: { export async function fetchStoresQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, StoreSelect>; + } & Omit, 'fields'> & + HookStrictSelect, StoreSelect>; }): Promise<{ stores: ConnectionResult>; }>; @@ -82,23 +110,30 @@ export async function fetchStoresQuery(params: { } /** * Named stores — one per version-controlled tree (e.g. one graph, one definition set) - * + * * @example * ```ts * await prefetchStoresQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchStoresQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, StoreSelect>; -}): Promise; -export async function prefetchStoresQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { +export async function prefetchStoresQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, StoreSelect>; + } +): Promise; +export async function prefetchStoresQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { const args = buildListSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: storeKeys.list(args), - queryFn: () => getClient().store.findMany(args).unwrap() + queryFn: () => getClient().store.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/objects/hooks/query-keys.ts b/sdk/constructive-react/src/objects/hooks/query-keys.ts index f0425f2483..1d6f73f2e1 100644 --- a/sdk/constructive-react/src/objects/hooks/query-keys.ts +++ b/sdk/constructive-react/src/objects/hooks/query-keys.ts @@ -20,39 +20,49 @@ // ============================================================================ export const commitKeys = { - /** All commit queries */all: ["commit"] as const, - /** List query keys */lists: () => [...commitKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...commitKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...commitKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...commitKeys.details(), id] as const + /** All commit queries */ all: ['commit'] as const, + /** List query keys */ lists: () => [...commitKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...commitKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...commitKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...commitKeys.details(), id] as const, } as const; export const getAllTreeNodesRecordKeys = { - /** All getAllTreeNodesRecord queries */all: ["getalltreenodesrecord"] as const, - /** List query keys */lists: () => [...getAllTreeNodesRecordKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...getAllTreeNodesRecordKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...getAllTreeNodesRecordKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...getAllTreeNodesRecordKeys.details(), id] as const + /** All getAllTreeNodesRecord queries */ all: ['getalltreenodesrecord'] as const, + /** List query keys */ lists: () => [...getAllTreeNodesRecordKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...getAllTreeNodesRecordKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...getAllTreeNodesRecordKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...getAllTreeNodesRecordKeys.details(), id] as const, } as const; export const objectKeys = { - /** All object queries */all: ["object"] as const, - /** List query keys */lists: () => [...objectKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...objectKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...objectKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...objectKeys.details(), id] as const + /** All object queries */ all: ['object'] as const, + /** List query keys */ lists: () => [...objectKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...objectKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...objectKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...objectKeys.details(), id] as const, } as const; export const refKeys = { - /** All ref queries */all: ["ref"] as const, - /** List query keys */lists: () => [...refKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...refKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...refKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...refKeys.details(), id] as const + /** All ref queries */ all: ['ref'] as const, + /** List query keys */ lists: () => [...refKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...refKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...refKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...refKeys.details(), id] as const, } as const; export const storeKeys = { - /** All store queries */all: ["store"] as const, - /** List query keys */lists: () => [...storeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...storeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...storeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...storeKeys.details(), id] as const + /** All store queries */ all: ['store'] as const, + /** List query keys */ lists: () => [...storeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...storeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...storeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...storeKeys.details(), id] as const, } as const; /** @@ -81,7 +91,7 @@ export const queryKeys = { getAllTreeNodesRecord: getAllTreeNodesRecordKeys, object: objectKeys, ref: refKeys, - store: storeKeys + store: storeKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/objects/hooks/selection.ts b/sdk/constructive-react/src/objects/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/objects/hooks/selection.ts +++ b/sdk/constructive-react/src/objects/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/objects/index.ts b/sdk/constructive-react/src/objects/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/objects/index.ts +++ b/sdk/constructive-react/src/objects/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/objects/orm/client.ts b/sdk/constructive-react/src/objects/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/objects/orm/client.ts +++ b/sdk/constructive-react/src/objects/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/objects/orm/index.ts b/sdk/constructive-react/src/objects/orm/index.ts index a38f67c89e..9d2f3fb51c 100644 --- a/sdk/constructive-react/src/objects/orm/index.ts +++ b/sdk/constructive-react/src/objects/orm/index.ts @@ -3,20 +3,20 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { CommitModel } from "./models/commit"; -import { GetAllTreeNodesRecordModel } from "./models/getAllTreeNodesRecord"; -import { ObjectModel } from "./models/object"; -import { RefModel } from "./models/ref"; -import { StoreModel } from "./models/store"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { CommitModel } from './models/commit'; +import { GetAllTreeNodesRecordModel } from './models/getAllTreeNodesRecord'; +import { ObjectModel } from './models/object'; +import { RefModel } from './models/ref'; +import { StoreModel } from './models/store'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -48,6 +48,6 @@ export function createClient(config: OrmClientConfig) { object: new ObjectModel(client), ref: new RefModel(client), store: new StoreModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/orm/input-types.ts b/sdk/constructive-react/src/objects/orm/input-types.ts index eca4c2f021..bab07456e0 100644 --- a/sdk/constructive-react/src/objects/orm/input-types.ts +++ b/sdk/constructive-react/src/objects/orm/input-types.ts @@ -317,7 +317,8 @@ export interface RefRelations {} export interface StoreRelations {} // ============ Entity Types With Relations ============ export type CommitWithRelations = Commit & CommitRelations; -export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & GetAllTreeNodesRecordRelations; +export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & + GetAllTreeNodesRecordRelations; export type ObjectWithRelations = Object & ObjectRelations; export type RefWithRelations = Ref & RefRelations; export type StoreWithRelations = Store & StoreRelations; @@ -450,11 +451,80 @@ export interface StoreFilter { or?: StoreFilter[]; } // ============ OrderBy Types ============ -export type CommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type GetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type ObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type RefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type StoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type CommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type GetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type ObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type RefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type StoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; // ============ CRUD Input Types ============ export interface CreateCommitInput { clientMutationId?: string; @@ -945,4 +1015,4 @@ export type StoreEdgeSelect = { node?: { select: StoreSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/objects/orm/models/commit.ts b/sdk/constructive-react/src/objects/orm/models/commit.ts index 271de62194..9f20aeeefc 100644 --- a/sdk/constructive-react/src/objects/orm/models/commit.ts +++ b/sdk/constructive-react/src/objects/orm/models/commit.ts @@ -3,56 +3,96 @@ * @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 { Commit, CommitWithRelations, CommitSelect, CommitFilter, CommitOrderBy, CreateCommitInput, UpdateCommitInput, CommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Commit, + CommitWithRelations, + CommitSelect, + CommitFilter, + CommitOrderBy, + CreateCommitInput, + UpdateCommitInput, + CommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ commits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Commit", "commits", 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 - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Commit', + 'commits', + 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, + }, + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commits", + operation: 'query', + operationName: 'Commit', + fieldName: 'commits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ commit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Commit", "commits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Commit', + 'commits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commit", + operation: 'query', + operationName: 'Commit', + fieldName: 'commit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "commit": data.commits?.nodes?.[0] ?? null - }) + commit: data.commits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ commit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Commit", "commits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Commit', + 'commits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commit", + operation: 'query', + operationName: 'Commit', + fieldName: 'commit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class CommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "commit": data.commits?.nodes?.[0] ?? null - }) + commit: data.commits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Commit", "createCommit", "commit", args.select, args.data, "CreateCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Commit', + 'createCommit', + 'commit', + args.select, + args.data, + 'CreateCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "createCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'createCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + CommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Commit", "updateCommit", "commit", args.select, args.where.id, args.data, "UpdateCommitInput", "id", "commitPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Commit', + 'updateCommit', + 'commit', + args.select, + args.where.id, + args.data, + 'UpdateCommitInput', + 'id', + 'commitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "updateCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'updateCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Commit", "deleteCommit", "commit", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Commit', + 'deleteCommit', + 'commit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "deleteCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'deleteCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/orm/models/getAllTreeNodesRecord.ts b/sdk/constructive-react/src/objects/orm/models/getAllTreeNodesRecord.ts index bb9b696c09..00f51d01f7 100644 --- a/sdk/constructive-react/src/objects/orm/models/getAllTreeNodesRecord.ts +++ b/sdk/constructive-react/src/objects/orm/models/getAllTreeNodesRecord.ts @@ -3,56 +3,96 @@ * @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 { GetAllTreeNodesRecord, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy, CreateGetAllTreeNodesRecordInput, UpdateGetAllTreeNodesRecordInput, GetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GetAllTreeNodesRecord, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, + CreateGetAllTreeNodesRecordInput, + UpdateGetAllTreeNodesRecordInput, + GetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GetAllTreeNodesRecord", "getAllTreeNodes", 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 - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + 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, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodes", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodesRecord: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GetAllTreeNodesRecord", "getAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodesRecord", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class GetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "getAllTreeNodesRecord": data.getAllTreeNodes?.nodes?.[0] ?? null - }) + getAllTreeNodesRecord: data.getAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGetAllTreeNodesRecord: { getAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GetAllTreeNodesRecord", "createGetAllTreeNodesRecord", "getAllTreeNodesRecord", args.select, args.data, "CreateGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GetAllTreeNodesRecord', + 'createGetAllTreeNodesRecord', + 'getAllTreeNodesRecord', + args.select, + args.data, + 'CreateGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GetAllTreeNodesRecord", - fieldName: "createGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'createGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/orm/models/index.ts b/sdk/constructive-react/src/objects/orm/models/index.ts index bc21284ac0..4480ea666b 100644 --- a/sdk/constructive-react/src/objects/orm/models/index.ts +++ b/sdk/constructive-react/src/objects/orm/models/index.ts @@ -3,8 +3,8 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { CommitModel } from "./commit"; -export { GetAllTreeNodesRecordModel } from "./getAllTreeNodesRecord"; -export { ObjectModel } from "./object"; -export { RefModel } from "./ref"; -export { StoreModel } from "./store"; \ No newline at end of file +export { CommitModel } from './commit'; +export { GetAllTreeNodesRecordModel } from './getAllTreeNodesRecord'; +export { ObjectModel } from './object'; +export { RefModel } from './ref'; +export { StoreModel } from './store'; diff --git a/sdk/constructive-react/src/objects/orm/models/object.ts b/sdk/constructive-react/src/objects/orm/models/object.ts index b7d1d22830..9470d460f6 100644 --- a/sdk/constructive-react/src/objects/orm/models/object.ts +++ b/sdk/constructive-react/src/objects/orm/models/object.ts @@ -3,56 +3,96 @@ * @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 { Object, ObjectWithRelations, ObjectSelect, ObjectFilter, ObjectOrderBy, CreateObjectInput, UpdateObjectInput, ObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Object, + ObjectWithRelations, + ObjectSelect, + ObjectFilter, + ObjectOrderBy, + CreateObjectInput, + UpdateObjectInput, + ObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ objects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Object", "objects", 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 - }, "ObjectFilter", "ObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Object', + 'objects', + 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, + }, + 'ObjectFilter', + 'ObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "objects", + operation: 'query', + operationName: 'Object', + fieldName: 'objects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ object: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Object", "objects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ObjectFilter", "ObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Object', + 'objects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ObjectFilter', + 'ObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "object", + operation: 'query', + operationName: 'Object', + fieldName: 'object', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class ObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "object": data.objects?.nodes?.[0] ?? null - }) + object: data.objects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ object: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("Object", "getNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'Object', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "object", + operation: 'query', + operationName: 'Object', + fieldName: 'object', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Object", "createObject", "object", args.select, args.data, "CreateObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Object', + 'createObject', + 'object', + args.select, + args.data, + 'CreateObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "createObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'createObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + ObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Object", "updateObject", "object", args.select, args.where.id, args.data, "UpdateObjectInput", "id", "objectPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Object', + 'updateObject', + 'object', + args.select, + args.where.id, + args.data, + 'UpdateObjectInput', + 'id', + 'objectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "updateObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'updateObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Object", "deleteObject", "object", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Object', + 'deleteObject', + 'object', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "deleteObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'deleteObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/orm/models/ref.ts b/sdk/constructive-react/src/objects/orm/models/ref.ts index 7d19ae58d2..d29b2308a0 100644 --- a/sdk/constructive-react/src/objects/orm/models/ref.ts +++ b/sdk/constructive-react/src/objects/orm/models/ref.ts @@ -3,56 +3,96 @@ * @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 { Ref, RefWithRelations, RefSelect, RefFilter, RefOrderBy, CreateRefInput, UpdateRefInput, RefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Ref, + RefWithRelations, + RefSelect, + RefFilter, + RefOrderBy, + CreateRefInput, + UpdateRefInput, + RefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ refs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Ref", "refs", 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 - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Ref', + 'refs', + 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, + }, + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "refs", + operation: 'query', + operationName: 'Ref', + fieldName: 'refs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ ref: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Ref", "refs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Ref', + 'refs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "ref", + operation: 'query', + operationName: 'Ref', + fieldName: 'ref', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RefModel { nodes?: InferSelectResult[]; }; }) => ({ - "ref": data.refs?.nodes?.[0] ?? null - }) + ref: data.refs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ ref: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Ref", "refs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Ref', + 'refs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "ref", + operation: 'query', + operationName: 'Ref', + fieldName: 'ref', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class RefModel { nodes?: InferSelectResult[]; }; }) => ({ - "ref": data.refs?.nodes?.[0] ?? null - }) + ref: data.refs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Ref", "createRef", "ref", args.select, args.data, "CreateRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Ref', + 'createRef', + 'ref', + args.select, + args.data, + 'CreateRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "createRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'createRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + RefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Ref", "updateRef", "ref", args.select, args.where.id, args.data, "UpdateRefInput", "id", "refPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Ref', + 'updateRef', + 'ref', + args.select, + args.where.id, + args.data, + 'UpdateRefInput', + 'id', + 'refPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "updateRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'updateRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Ref", "deleteRef", "ref", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Ref', + 'deleteRef', + 'ref', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "deleteRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'deleteRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/orm/models/store.ts b/sdk/constructive-react/src/objects/orm/models/store.ts index ed5d14a22e..3e81e5f9ca 100644 --- a/sdk/constructive-react/src/objects/orm/models/store.ts +++ b/sdk/constructive-react/src/objects/orm/models/store.ts @@ -3,56 +3,96 @@ * @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 { Store, StoreWithRelations, StoreSelect, StoreFilter, StoreOrderBy, CreateStoreInput, UpdateStoreInput, StorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Store, + StoreWithRelations, + StoreSelect, + StoreFilter, + StoreOrderBy, + CreateStoreInput, + UpdateStoreInput, + StorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ stores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Store", "stores", 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 - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Store', + 'stores', + 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, + }, + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "stores", + operation: 'query', + operationName: 'Store', + fieldName: 'stores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ store: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Store", "stores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Store', + 'stores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "store", + operation: 'query', + operationName: 'Store', + fieldName: 'store', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "store": data.stores?.nodes?.[0] ?? null - }) + store: data.stores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ store: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Store", "stores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Store', + 'stores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "store", + operation: 'query', + operationName: 'Store', + fieldName: 'store', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "store": data.stores?.nodes?.[0] ?? null - }) + store: data.stores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Store", "createStore", "store", args.select, args.data, "CreateStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Store', + 'createStore', + 'store', + args.select, + args.data, + 'CreateStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "createStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'createStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Store", "updateStore", "store", args.select, args.where.id, args.data, "UpdateStoreInput", "id", "storePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Store', + 'updateStore', + 'store', + args.select, + args.where.id, + args.data, + 'UpdateStoreInput', + 'id', + 'storePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "updateStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'updateStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Store", "deleteStore", "store", { - id: args.where.id - }, "DeleteStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Store', + 'deleteStore', + 'store', + { + id: args.where.id, + }, + 'DeleteStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "deleteStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'deleteStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/orm/mutation/index.ts b/sdk/constructive-react/src/objects/orm/mutation/index.ts index 13f2ac7c1e..a0c21cb2bd 100644 --- a/sdk/constructive-react/src/objects/orm/mutation/index.ts +++ b/sdk/constructive-react/src/objects/orm/mutation/index.ts @@ -3,11 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { InitEmptyRepoInput, InsertNodeAtPathInput, ProvisionBucketInput, SetDataAtPathInput, InitEmptyRepoPayload, InsertNodeAtPathPayload, ProvisionBucketPayload, SetDataAtPathPayload, InitEmptyRepoPayloadSelect, InsertNodeAtPathPayloadSelect, ProvisionBucketPayloadSelect, SetDataAtPathPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + InitEmptyRepoInput, + InsertNodeAtPathInput, + ProvisionBucketInput, + SetDataAtPathInput, + InitEmptyRepoPayload, + InsertNodeAtPathPayload, + ProvisionBucketPayload, + SetDataAtPathPayload, + InitEmptyRepoPayloadSelect, + InsertNodeAtPathPayloadSelect, + ProvisionBucketPayloadSelect, + SetDataAtPathPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface InitEmptyRepoVariables { input: InitEmptyRepoInput; } @@ -29,61 +42,121 @@ export interface SetDataAtPathVariables { } export function createMutationOperations(client: OrmClient) { return { - initEmptyRepo: (args: InitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - initEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InitEmptyRepo", - fieldName: "initEmptyRepo", - ...buildCustomDocument("mutation", "InitEmptyRepo", "initEmptyRepo", options.select, args, [{ - name: "input", - type: "InitEmptyRepoInput!" - }], connectionFieldsMap, "InitEmptyRepoPayload") - }), - insertNodeAtPath: (args: InsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - insertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InsertNodeAtPath", - fieldName: "insertNodeAtPath", - ...buildCustomDocument("mutation", "InsertNodeAtPath", "insertNodeAtPath", options.select, args, [{ - name: "input", - type: "InsertNodeAtPathInput!" - }], connectionFieldsMap, "InsertNodeAtPathPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - setDataAtPath: (args: SetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetDataAtPath", - fieldName: "setDataAtPath", - ...buildCustomDocument("mutation", "SetDataAtPath", "setDataAtPath", options.select, args, [{ - name: "input", - type: "SetDataAtPathInput!" - }], connectionFieldsMap, "SetDataAtPathPayload") - }) + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/orm/query-builder.ts b/sdk/constructive-react/src/objects/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/objects/orm/query-builder.ts +++ b/sdk/constructive-react/src/objects/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/objects/orm/realtime.ts b/sdk/constructive-react/src/objects/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/objects/orm/realtime.ts +++ b/sdk/constructive-react/src/objects/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/objects/orm/select-types.ts b/sdk/constructive-react/src/objects/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/objects/orm/select-types.ts +++ b/sdk/constructive-react/src/objects/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/objects/schema-types.ts b/sdk/constructive-react/src/objects/schema-types.ts index a42d33a84a..8937edba12 100644 --- a/sdk/constructive-react/src/objects/schema-types.ts +++ b/sdk/constructive-react/src/objects/schema-types.ts @@ -4,15 +4,100 @@ * DO NOT EDIT - changes will be overwritten */ -import type { Commit, GetAllTreeNodesRecord, Object, Ref, Store, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + Commit, + GetAllTreeNodesRecord, + Object, + Ref, + Store, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; /** Methods to use when ordering `Commit`. */ -export type CommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; +export type CommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; /** Methods to use when ordering `Object`. */ -export type ObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type ObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `Ref`. */ -export type RefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; +export type RefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; /** Methods to use when ordering `Store`. */ -export type StoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type StoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** A filter to be used against `Commit` object types. All fields are combined with a logical ‘and.’ */ export interface CommitFilter { /** Checks for all expressions in this list. */ @@ -743,4 +828,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/objects/types.ts b/sdk/constructive-react/src/objects/types.ts index 5931dbdf6b..9b5f1764e8 100644 --- a/sdk/constructive-react/src/objects/types.ts +++ b/sdk/constructive-react/src/objects/types.ts @@ -263,4 +263,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/hooks/client.ts b/sdk/constructive-react/src/usage/hooks/client.ts index e68cdd5e01..47b9aa63f4 100644 --- a/sdk/constructive-react/src/usage/hooks/client.ts +++ b/sdk/constructive-react/src/usage/hooks/client.ts @@ -36,9 +36,7 @@ export function configure(config: OrmClientConfig): void { */ export function getClient(): OrmClientInstance { if (!client) { - throw new Error( - 'ORM client not configured. Call configure() before using hooks.', - ); + throw new Error('ORM client not configured. Call configure() before using hooks.'); } return client; } diff --git a/sdk/constructive-react/src/usage/hooks/index.ts b/sdk/constructive-react/src/usage/hooks/index.ts index 5f73b93be9..aa601adfa6 100644 --- a/sdk/constructive-react/src/usage/hooks/index.ts +++ b/sdk/constructive-react/src/usage/hooks/index.ts @@ -1,25 +1,25 @@ /** * GraphQL SDK * @generated by @constructive-io/graphql-codegen - * + * * Tables: AppLimitCap, AppLimitCapsDefault, AppLimit, AppLimitCreditCode, AppLimitCreditCodeItem, AppLimitCredit, AppLimitCreditRedemption, AppLimitDefault, AppLimitEvent, AppLimitWarning, OrgLimitAggregate, OrgLimitCap, OrgLimitCapsDefault, OrgLimit, OrgLimitCredit, OrgLimitDefault, OrgLimitEvent, OrgLimitWarning - * + * * Usage: - * + * * 1. Configure the client: * ```ts * import { configure } from './generated'; - * + * * configure({ * endpoint: 'https://api.example.com/graphql', * headers: { Authorization: 'Bearer ' }, * }); * ``` - * + * * 2. Use the hooks: * ```tsx * import { useCarsQuery, useCreateCarMutation } from './generated'; - * + * * function MyComponent() { * const { data, isLoading } = useCarsQuery({ * selection: { fields: { id: true }, first: 10 }, @@ -31,9 +31,9 @@ * } * ``` */ -export * from "./client"; -export * from "./query-keys"; -export * from "./mutation-keys"; -export * from "./invalidation"; -export * from "./queries"; -export * from "./mutations"; \ No newline at end of file +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/usage/hooks/invalidation.ts b/sdk/constructive-react/src/usage/hooks/invalidation.ts index 401d4e24ce..937299cf0f 100644 --- a/sdk/constructive-react/src/usage/hooks/invalidation.ts +++ b/sdk/constructive-react/src/usage/hooks/invalidation.ts @@ -13,8 +13,27 @@ // - Remove helpers for delete operations // ============================================================================ -import type { QueryClient } from "@tanstack/react-query"; -import { appLimitCapKeys, appLimitCapsDefaultKeys, appLimitKeys, appLimitCreditCodeKeys, appLimitCreditCodeItemKeys, appLimitCreditKeys, appLimitCreditRedemptionKeys, appLimitDefaultKeys, appLimitEventKeys, appLimitWarningKeys, orgLimitAggregateKeys, orgLimitCapKeys, orgLimitCapsDefaultKeys, orgLimitKeys, orgLimitCreditKeys, orgLimitDefaultKeys, orgLimitEventKeys, orgLimitWarningKeys } from "./query-keys"; +import type { QueryClient } from '@tanstack/react-query'; +import { + appLimitCapKeys, + appLimitCapsDefaultKeys, + appLimitKeys, + appLimitCreditCodeKeys, + appLimitCreditCodeItemKeys, + appLimitCreditKeys, + appLimitCreditRedemptionKeys, + appLimitDefaultKeys, + appLimitEventKeys, + appLimitWarningKeys, + orgLimitAggregateKeys, + orgLimitCapKeys, + orgLimitCapsDefaultKeys, + orgLimitKeys, + orgLimitCreditKeys, + orgLimitDefaultKeys, + orgLimitEventKeys, + orgLimitWarningKeys, +} from './query-keys'; /** // ============================================================================ // Invalidation Helpers @@ -35,204 +54,306 @@ import { appLimitCapKeys, appLimitCapsDefaultKeys, appLimitKeys, appLimitCreditC * ``` */ export const invalidate = { - /** Invalidate appLimitCap queries */appLimitCap: { - /** Invalidate all appLimitCap queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCapKeys.all - }), - /** Invalidate appLimitCap list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCapKeys.lists() - }), - /** Invalidate a specific appLimitCap */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitCapKeys.detail(id) - }) - }, - /** Invalidate appLimitCapsDefault queries */appLimitCapsDefault: { - /** Invalidate all appLimitCapsDefault queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCapsDefaultKeys.all - }), - /** Invalidate appLimitCapsDefault list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCapsDefaultKeys.lists() - }), - /** Invalidate a specific appLimitCapsDefault */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitCapsDefaultKeys.detail(id) - }) - }, - /** Invalidate appLimit queries */appLimit: { - /** Invalidate all appLimit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitKeys.all - }), - /** Invalidate appLimit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitKeys.lists() - }), - /** Invalidate a specific appLimit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitKeys.detail(id) - }) - }, - /** Invalidate appLimitCreditCode queries */appLimitCreditCode: { - /** Invalidate all appLimitCreditCode queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeKeys.all - }), - /** Invalidate appLimitCreditCode list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeKeys.lists() - }), - /** Invalidate a specific appLimitCreditCode */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeKeys.detail(id) - }) - }, - /** Invalidate appLimitCreditCodeItem queries */appLimitCreditCodeItem: { - /** Invalidate all appLimitCreditCodeItem queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeItemKeys.all - }), - /** Invalidate appLimitCreditCodeItem list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeItemKeys.lists() - }), - /** Invalidate a specific appLimitCreditCodeItem */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeItemKeys.detail(id) - }) - }, - /** Invalidate appLimitCredit queries */appLimitCredit: { - /** Invalidate all appLimitCredit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCreditKeys.all - }), - /** Invalidate appLimitCredit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCreditKeys.lists() - }), - /** Invalidate a specific appLimitCredit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitCreditKeys.detail(id) - }) - }, - /** Invalidate appLimitCreditRedemption queries */appLimitCreditRedemption: { - /** Invalidate all appLimitCreditRedemption queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCreditRedemptionKeys.all - }), - /** Invalidate appLimitCreditRedemption list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitCreditRedemptionKeys.lists() - }), - /** Invalidate a specific appLimitCreditRedemption */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitCreditRedemptionKeys.detail(id) - }) - }, - /** Invalidate appLimitDefault queries */appLimitDefault: { - /** Invalidate all appLimitDefault queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitDefaultKeys.all - }), - /** Invalidate appLimitDefault list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitDefaultKeys.lists() - }), - /** Invalidate a specific appLimitDefault */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitDefaultKeys.detail(id) - }) - }, - /** Invalidate appLimitEvent queries */appLimitEvent: { - /** Invalidate all appLimitEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitEventKeys.all - }), - /** Invalidate appLimitEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitEventKeys.lists() - }), - /** Invalidate a specific appLimitEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitEventKeys.detail(id) - }) - }, - /** Invalidate appLimitWarning queries */appLimitWarning: { - /** Invalidate all appLimitWarning queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitWarningKeys.all - }), - /** Invalidate appLimitWarning list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: appLimitWarningKeys.lists() - }), - /** Invalidate a specific appLimitWarning */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: appLimitWarningKeys.detail(id) - }) - }, - /** Invalidate orgLimitAggregate queries */orgLimitAggregate: { - /** Invalidate all orgLimitAggregate queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitAggregateKeys.all - }), - /** Invalidate orgLimitAggregate list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitAggregateKeys.lists() - }), - /** Invalidate a specific orgLimitAggregate */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgLimitAggregateKeys.detail(id) - }) - }, - /** Invalidate orgLimitCap queries */orgLimitCap: { - /** Invalidate all orgLimitCap queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitCapKeys.all - }), - /** Invalidate orgLimitCap list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitCapKeys.lists() - }), - /** Invalidate a specific orgLimitCap */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgLimitCapKeys.detail(id) - }) - }, - /** Invalidate orgLimitCapsDefault queries */orgLimitCapsDefault: { - /** Invalidate all orgLimitCapsDefault queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitCapsDefaultKeys.all - }), - /** Invalidate orgLimitCapsDefault list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitCapsDefaultKeys.lists() - }), - /** Invalidate a specific orgLimitCapsDefault */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgLimitCapsDefaultKeys.detail(id) - }) - }, - /** Invalidate orgLimit queries */orgLimit: { - /** Invalidate all orgLimit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitKeys.all - }), - /** Invalidate orgLimit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitKeys.lists() - }), - /** Invalidate a specific orgLimit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgLimitKeys.detail(id) - }) - }, - /** Invalidate orgLimitCredit queries */orgLimitCredit: { - /** Invalidate all orgLimitCredit queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitCreditKeys.all - }), - /** Invalidate orgLimitCredit list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitCreditKeys.lists() - }), - /** Invalidate a specific orgLimitCredit */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgLimitCreditKeys.detail(id) - }) - }, - /** Invalidate orgLimitDefault queries */orgLimitDefault: { - /** Invalidate all orgLimitDefault queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitDefaultKeys.all - }), - /** Invalidate orgLimitDefault list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitDefaultKeys.lists() - }), - /** Invalidate a specific orgLimitDefault */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgLimitDefaultKeys.detail(id) - }) - }, - /** Invalidate orgLimitEvent queries */orgLimitEvent: { - /** Invalidate all orgLimitEvent queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitEventKeys.all - }), - /** Invalidate orgLimitEvent list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitEventKeys.lists() - }), - /** Invalidate a specific orgLimitEvent */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgLimitEventKeys.detail(id) - }) - }, - /** Invalidate orgLimitWarning queries */orgLimitWarning: { - /** Invalidate all orgLimitWarning queries */all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitWarningKeys.all - }), - /** Invalidate orgLimitWarning list queries */lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: orgLimitWarningKeys.lists() - }), - /** Invalidate a specific orgLimitWarning */detail: (queryClient: QueryClient, id: string | number) => queryClient.invalidateQueries({ - queryKey: orgLimitWarningKeys.detail(id) - }) - } + /** Invalidate appLimitCap queries */ appLimitCap: { + /** Invalidate all appLimitCap queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCapKeys.all, + }), + /** Invalidate appLimitCap list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCapKeys.lists(), + }), + /** Invalidate a specific appLimitCap */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitCapKeys.detail(id), + }), + }, + /** Invalidate appLimitCapsDefault queries */ appLimitCapsDefault: { + /** Invalidate all appLimitCapsDefault queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCapsDefaultKeys.all, + }), + /** Invalidate appLimitCapsDefault list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCapsDefaultKeys.lists(), + }), + /** Invalidate a specific appLimitCapsDefault */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitCapsDefaultKeys.detail(id), + }), + }, + /** Invalidate appLimit queries */ appLimit: { + /** Invalidate all appLimit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitKeys.all, + }), + /** Invalidate appLimit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitKeys.lists(), + }), + /** Invalidate a specific appLimit */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: appLimitKeys.detail(id), + }), + }, + /** Invalidate appLimitCreditCode queries */ appLimitCreditCode: { + /** Invalidate all appLimitCreditCode queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditCodeKeys.all, + }), + /** Invalidate appLimitCreditCode list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditCodeKeys.lists(), + }), + /** Invalidate a specific appLimitCreditCode */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditCodeKeys.detail(id), + }), + }, + /** Invalidate appLimitCreditCodeItem queries */ appLimitCreditCodeItem: { + /** Invalidate all appLimitCreditCodeItem queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditCodeItemKeys.all, + }), + /** Invalidate appLimitCreditCodeItem list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditCodeItemKeys.lists(), + }), + /** Invalidate a specific appLimitCreditCodeItem */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditCodeItemKeys.detail(id), + }), + }, + /** Invalidate appLimitCredit queries */ appLimitCredit: { + /** Invalidate all appLimitCredit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditKeys.all, + }), + /** Invalidate appLimitCredit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditKeys.lists(), + }), + /** Invalidate a specific appLimitCredit */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditKeys.detail(id), + }), + }, + /** Invalidate appLimitCreditRedemption queries */ appLimitCreditRedemption: { + /** Invalidate all appLimitCreditRedemption queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditRedemptionKeys.all, + }), + /** Invalidate appLimitCreditRedemption list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditRedemptionKeys.lists(), + }), + /** Invalidate a specific appLimitCreditRedemption */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitCreditRedemptionKeys.detail(id), + }), + }, + /** Invalidate appLimitDefault queries */ appLimitDefault: { + /** Invalidate all appLimitDefault queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitDefaultKeys.all, + }), + /** Invalidate appLimitDefault list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitDefaultKeys.lists(), + }), + /** Invalidate a specific appLimitDefault */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitDefaultKeys.detail(id), + }), + }, + /** Invalidate appLimitEvent queries */ appLimitEvent: { + /** Invalidate all appLimitEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitEventKeys.all, + }), + /** Invalidate appLimitEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitEventKeys.lists(), + }), + /** Invalidate a specific appLimitEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitEventKeys.detail(id), + }), + }, + /** Invalidate appLimitWarning queries */ appLimitWarning: { + /** Invalidate all appLimitWarning queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitWarningKeys.all, + }), + /** Invalidate appLimitWarning list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: appLimitWarningKeys.lists(), + }), + /** Invalidate a specific appLimitWarning */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: appLimitWarningKeys.detail(id), + }), + }, + /** Invalidate orgLimitAggregate queries */ orgLimitAggregate: { + /** Invalidate all orgLimitAggregate queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitAggregateKeys.all, + }), + /** Invalidate orgLimitAggregate list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitAggregateKeys.lists(), + }), + /** Invalidate a specific orgLimitAggregate */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgLimitAggregateKeys.detail(id), + }), + }, + /** Invalidate orgLimitCap queries */ orgLimitCap: { + /** Invalidate all orgLimitCap queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitCapKeys.all, + }), + /** Invalidate orgLimitCap list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitCapKeys.lists(), + }), + /** Invalidate a specific orgLimitCap */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgLimitCapKeys.detail(id), + }), + }, + /** Invalidate orgLimitCapsDefault queries */ orgLimitCapsDefault: { + /** Invalidate all orgLimitCapsDefault queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitCapsDefaultKeys.all, + }), + /** Invalidate orgLimitCapsDefault list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitCapsDefaultKeys.lists(), + }), + /** Invalidate a specific orgLimitCapsDefault */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgLimitCapsDefaultKeys.detail(id), + }), + }, + /** Invalidate orgLimit queries */ orgLimit: { + /** Invalidate all orgLimit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitKeys.all, + }), + /** Invalidate orgLimit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitKeys.lists(), + }), + /** Invalidate a specific orgLimit */ detail: (queryClient: QueryClient, id: string | number) => + queryClient.invalidateQueries({ + queryKey: orgLimitKeys.detail(id), + }), + }, + /** Invalidate orgLimitCredit queries */ orgLimitCredit: { + /** Invalidate all orgLimitCredit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitCreditKeys.all, + }), + /** Invalidate orgLimitCredit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitCreditKeys.lists(), + }), + /** Invalidate a specific orgLimitCredit */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgLimitCreditKeys.detail(id), + }), + }, + /** Invalidate orgLimitDefault queries */ orgLimitDefault: { + /** Invalidate all orgLimitDefault queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitDefaultKeys.all, + }), + /** Invalidate orgLimitDefault list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitDefaultKeys.lists(), + }), + /** Invalidate a specific orgLimitDefault */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgLimitDefaultKeys.detail(id), + }), + }, + /** Invalidate orgLimitEvent queries */ orgLimitEvent: { + /** Invalidate all orgLimitEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitEventKeys.all, + }), + /** Invalidate orgLimitEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitEventKeys.lists(), + }), + /** Invalidate a specific orgLimitEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgLimitEventKeys.detail(id), + }), + }, + /** Invalidate orgLimitWarning queries */ orgLimitWarning: { + /** Invalidate all orgLimitWarning queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitWarningKeys.all, + }), + /** Invalidate orgLimitWarning list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgLimitWarningKeys.lists(), + }), + /** Invalidate a specific orgLimitWarning */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgLimitWarningKeys.detail(id), + }), + }, } as const; /** @@ -246,94 +367,142 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { - /** Remove appLimitCap from cache */appLimitCap: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitCap from cache */ appLimitCap: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitCapKeys.detail(id) + queryKey: appLimitCapKeys.detail(id), }); }, - /** Remove appLimitCapsDefault from cache */appLimitCapsDefault: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitCapsDefault from cache */ appLimitCapsDefault: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitCapsDefaultKeys.detail(id) + queryKey: appLimitCapsDefaultKeys.detail(id), }); }, - /** Remove appLimit from cache */appLimit: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimit from cache */ appLimit: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: appLimitKeys.detail(id) + queryKey: appLimitKeys.detail(id), }); }, - /** Remove appLimitCreditCode from cache */appLimitCreditCode: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitCreditCode from cache */ appLimitCreditCode: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitCreditCodeKeys.detail(id) + queryKey: appLimitCreditCodeKeys.detail(id), }); }, - /** Remove appLimitCreditCodeItem from cache */appLimitCreditCodeItem: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitCreditCodeItem from cache */ appLimitCreditCodeItem: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitCreditCodeItemKeys.detail(id) + queryKey: appLimitCreditCodeItemKeys.detail(id), }); }, - /** Remove appLimitCredit from cache */appLimitCredit: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitCredit from cache */ appLimitCredit: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitCreditKeys.detail(id) + queryKey: appLimitCreditKeys.detail(id), }); }, - /** Remove appLimitCreditRedemption from cache */appLimitCreditRedemption: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitCreditRedemption from cache */ appLimitCreditRedemption: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitCreditRedemptionKeys.detail(id) + queryKey: appLimitCreditRedemptionKeys.detail(id), }); }, - /** Remove appLimitDefault from cache */appLimitDefault: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitDefault from cache */ appLimitDefault: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitDefaultKeys.detail(id) + queryKey: appLimitDefaultKeys.detail(id), }); }, - /** Remove appLimitEvent from cache */appLimitEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitEvent from cache */ appLimitEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitEventKeys.detail(id) + queryKey: appLimitEventKeys.detail(id), }); }, - /** Remove appLimitWarning from cache */appLimitWarning: (queryClient: QueryClient, id: string | number) => { + /** Remove appLimitWarning from cache */ appLimitWarning: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: appLimitWarningKeys.detail(id) + queryKey: appLimitWarningKeys.detail(id), }); }, - /** Remove orgLimitAggregate from cache */orgLimitAggregate: (queryClient: QueryClient, id: string | number) => { + /** Remove orgLimitAggregate from cache */ orgLimitAggregate: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgLimitAggregateKeys.detail(id) + queryKey: orgLimitAggregateKeys.detail(id), }); }, - /** Remove orgLimitCap from cache */orgLimitCap: (queryClient: QueryClient, id: string | number) => { + /** Remove orgLimitCap from cache */ orgLimitCap: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgLimitCapKeys.detail(id) + queryKey: orgLimitCapKeys.detail(id), }); }, - /** Remove orgLimitCapsDefault from cache */orgLimitCapsDefault: (queryClient: QueryClient, id: string | number) => { + /** Remove orgLimitCapsDefault from cache */ orgLimitCapsDefault: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgLimitCapsDefaultKeys.detail(id) + queryKey: orgLimitCapsDefaultKeys.detail(id), }); }, - /** Remove orgLimit from cache */orgLimit: (queryClient: QueryClient, id: string | number) => { + /** Remove orgLimit from cache */ orgLimit: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ - queryKey: orgLimitKeys.detail(id) + queryKey: orgLimitKeys.detail(id), }); }, - /** Remove orgLimitCredit from cache */orgLimitCredit: (queryClient: QueryClient, id: string | number) => { + /** Remove orgLimitCredit from cache */ orgLimitCredit: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgLimitCreditKeys.detail(id) + queryKey: orgLimitCreditKeys.detail(id), }); }, - /** Remove orgLimitDefault from cache */orgLimitDefault: (queryClient: QueryClient, id: string | number) => { + /** Remove orgLimitDefault from cache */ orgLimitDefault: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgLimitDefaultKeys.detail(id) + queryKey: orgLimitDefaultKeys.detail(id), }); }, - /** Remove orgLimitEvent from cache */orgLimitEvent: (queryClient: QueryClient, id: string | number) => { + /** Remove orgLimitEvent from cache */ orgLimitEvent: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgLimitEventKeys.detail(id) + queryKey: orgLimitEventKeys.detail(id), }); }, - /** Remove orgLimitWarning from cache */orgLimitWarning: (queryClient: QueryClient, id: string | number) => { + /** Remove orgLimitWarning from cache */ orgLimitWarning: ( + queryClient: QueryClient, + id: string | number + ) => { queryClient.removeQueries({ - queryKey: orgLimitWarningKeys.detail(id) + queryKey: orgLimitWarningKeys.detail(id), }); - } + }, } as const; diff --git a/sdk/constructive-react/src/usage/hooks/mutation-keys.ts b/sdk/constructive-react/src/usage/hooks/mutation-keys.ts index ca59de8924..0e0bf6621b 100644 --- a/sdk/constructive-react/src/usage/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/usage/hooks/mutation-keys.ts @@ -19,112 +19,170 @@ // ============================================================================ export const appLimitCapMutationKeys = { - /** All appLimitCap mutation keys */all: ["mutation", "applimitcap"] as const, - /** Create appLimitCap mutation key */create: () => ["mutation", "applimitcap", "create"] as const, - /** Update appLimitCap mutation key */update: (id: string | number) => ["mutation", "applimitcap", "update", id] as const, - /** Delete appLimitCap mutation key */delete: (id: string | number) => ["mutation", "applimitcap", "delete", id] as const + /** All appLimitCap mutation keys */ all: ['mutation', 'applimitcap'] as const, + /** Create appLimitCap mutation key */ create: () => + ['mutation', 'applimitcap', 'create'] as const, + /** Update appLimitCap mutation key */ update: (id: string | number) => + ['mutation', 'applimitcap', 'update', id] as const, + /** Delete appLimitCap mutation key */ delete: (id: string | number) => + ['mutation', 'applimitcap', 'delete', id] as const, } as const; export const appLimitCapsDefaultMutationKeys = { - /** All appLimitCapsDefault mutation keys */all: ["mutation", "applimitcapsdefault"] as const, - /** Create appLimitCapsDefault mutation key */create: () => ["mutation", "applimitcapsdefault", "create"] as const, - /** Update appLimitCapsDefault mutation key */update: (id: string | number) => ["mutation", "applimitcapsdefault", "update", id] as const, - /** Delete appLimitCapsDefault mutation key */delete: (id: string | number) => ["mutation", "applimitcapsdefault", "delete", id] as const + /** All appLimitCapsDefault mutation keys */ all: ['mutation', 'applimitcapsdefault'] as const, + /** Create appLimitCapsDefault mutation key */ create: () => + ['mutation', 'applimitcapsdefault', 'create'] as const, + /** Update appLimitCapsDefault mutation key */ update: (id: string | number) => + ['mutation', 'applimitcapsdefault', 'update', id] as const, + /** Delete appLimitCapsDefault mutation key */ delete: (id: string | number) => + ['mutation', 'applimitcapsdefault', 'delete', id] as const, } as const; export const appLimitMutationKeys = { - /** All appLimit mutation keys */all: ["mutation", "applimit"] as const, - /** Create appLimit mutation key */create: () => ["mutation", "applimit", "create"] as const, - /** Update appLimit mutation key */update: (id: string | number) => ["mutation", "applimit", "update", id] as const, - /** Delete appLimit mutation key */delete: (id: string | number) => ["mutation", "applimit", "delete", id] as const + /** All appLimit mutation keys */ all: ['mutation', 'applimit'] as const, + /** Create appLimit mutation key */ create: () => ['mutation', 'applimit', 'create'] as const, + /** Update appLimit mutation key */ update: (id: string | number) => + ['mutation', 'applimit', 'update', id] as const, + /** Delete appLimit mutation key */ delete: (id: string | number) => + ['mutation', 'applimit', 'delete', id] as const, } as const; export const appLimitCreditCodeMutationKeys = { - /** All appLimitCreditCode mutation keys */all: ["mutation", "applimitcreditcode"] as const, - /** Create appLimitCreditCode mutation key */create: () => ["mutation", "applimitcreditcode", "create"] as const, - /** Update appLimitCreditCode mutation key */update: (id: string | number) => ["mutation", "applimitcreditcode", "update", id] as const, - /** Delete appLimitCreditCode mutation key */delete: (id: string | number) => ["mutation", "applimitcreditcode", "delete", id] as const + /** All appLimitCreditCode mutation keys */ all: ['mutation', 'applimitcreditcode'] as const, + /** Create appLimitCreditCode mutation key */ create: () => + ['mutation', 'applimitcreditcode', 'create'] as const, + /** Update appLimitCreditCode mutation key */ update: (id: string | number) => + ['mutation', 'applimitcreditcode', 'update', id] as const, + /** Delete appLimitCreditCode mutation key */ delete: (id: string | number) => + ['mutation', 'applimitcreditcode', 'delete', id] as const, } as const; export const appLimitCreditCodeItemMutationKeys = { - /** All appLimitCreditCodeItem mutation keys */all: ["mutation", "applimitcreditcodeitem"] as const, - /** Create appLimitCreditCodeItem mutation key */create: () => ["mutation", "applimitcreditcodeitem", "create"] as const, - /** Update appLimitCreditCodeItem mutation key */update: (id: string | number) => ["mutation", "applimitcreditcodeitem", "update", id] as const, - /** Delete appLimitCreditCodeItem mutation key */delete: (id: string | number) => ["mutation", "applimitcreditcodeitem", "delete", id] as const + /** All appLimitCreditCodeItem mutation keys */ all: [ + 'mutation', + 'applimitcreditcodeitem', + ] as const, + /** Create appLimitCreditCodeItem mutation key */ create: () => + ['mutation', 'applimitcreditcodeitem', 'create'] as const, + /** Update appLimitCreditCodeItem mutation key */ update: (id: string | number) => + ['mutation', 'applimitcreditcodeitem', 'update', id] as const, + /** Delete appLimitCreditCodeItem mutation key */ delete: (id: string | number) => + ['mutation', 'applimitcreditcodeitem', 'delete', id] as const, } as const; export const appLimitCreditMutationKeys = { - /** All appLimitCredit mutation keys */all: ["mutation", "applimitcredit"] as const, - /** Create appLimitCredit mutation key */create: () => ["mutation", "applimitcredit", "create"] as const, - /** Update appLimitCredit mutation key */update: (id: string | number) => ["mutation", "applimitcredit", "update", id] as const, - /** Delete appLimitCredit mutation key */delete: (id: string | number) => ["mutation", "applimitcredit", "delete", id] as const + /** All appLimitCredit mutation keys */ all: ['mutation', 'applimitcredit'] as const, + /** Create appLimitCredit mutation key */ create: () => + ['mutation', 'applimitcredit', 'create'] as const, + /** Update appLimitCredit mutation key */ update: (id: string | number) => + ['mutation', 'applimitcredit', 'update', id] as const, + /** Delete appLimitCredit mutation key */ delete: (id: string | number) => + ['mutation', 'applimitcredit', 'delete', id] as const, } as const; export const appLimitCreditRedemptionMutationKeys = { - /** All appLimitCreditRedemption mutation keys */all: ["mutation", "applimitcreditredemption"] as const, - /** Create appLimitCreditRedemption mutation key */create: () => ["mutation", "applimitcreditredemption", "create"] as const, - /** Update appLimitCreditRedemption mutation key */update: (id: string | number) => ["mutation", "applimitcreditredemption", "update", id] as const, - /** Delete appLimitCreditRedemption mutation key */delete: (id: string | number) => ["mutation", "applimitcreditredemption", "delete", id] as const + /** All appLimitCreditRedemption mutation keys */ all: [ + 'mutation', + 'applimitcreditredemption', + ] as const, + /** Create appLimitCreditRedemption mutation key */ create: () => + ['mutation', 'applimitcreditredemption', 'create'] as const, + /** Update appLimitCreditRedemption mutation key */ update: (id: string | number) => + ['mutation', 'applimitcreditredemption', 'update', id] as const, + /** Delete appLimitCreditRedemption mutation key */ delete: (id: string | number) => + ['mutation', 'applimitcreditredemption', 'delete', id] as const, } as const; export const appLimitDefaultMutationKeys = { - /** All appLimitDefault mutation keys */all: ["mutation", "applimitdefault"] as const, - /** Create appLimitDefault mutation key */create: () => ["mutation", "applimitdefault", "create"] as const, - /** Update appLimitDefault mutation key */update: (id: string | number) => ["mutation", "applimitdefault", "update", id] as const, - /** Delete appLimitDefault mutation key */delete: (id: string | number) => ["mutation", "applimitdefault", "delete", id] as const + /** All appLimitDefault mutation keys */ all: ['mutation', 'applimitdefault'] as const, + /** Create appLimitDefault mutation key */ create: () => + ['mutation', 'applimitdefault', 'create'] as const, + /** Update appLimitDefault mutation key */ update: (id: string | number) => + ['mutation', 'applimitdefault', 'update', id] as const, + /** Delete appLimitDefault mutation key */ delete: (id: string | number) => + ['mutation', 'applimitdefault', 'delete', id] as const, } as const; export const appLimitEventMutationKeys = { - /** All appLimitEvent mutation keys */all: ["mutation", "applimitevent"] as const, - /** Create appLimitEvent mutation key */create: () => ["mutation", "applimitevent", "create"] as const, - /** Update appLimitEvent mutation key */update: (id: string | number) => ["mutation", "applimitevent", "update", id] as const, - /** Delete appLimitEvent mutation key */delete: (id: string | number) => ["mutation", "applimitevent", "delete", id] as const + /** All appLimitEvent mutation keys */ all: ['mutation', 'applimitevent'] as const, + /** Create appLimitEvent mutation key */ create: () => + ['mutation', 'applimitevent', 'create'] as const, + /** Update appLimitEvent mutation key */ update: (id: string | number) => + ['mutation', 'applimitevent', 'update', id] as const, + /** Delete appLimitEvent mutation key */ delete: (id: string | number) => + ['mutation', 'applimitevent', 'delete', id] as const, } as const; export const appLimitWarningMutationKeys = { - /** All appLimitWarning mutation keys */all: ["mutation", "applimitwarning"] as const, - /** Create appLimitWarning mutation key */create: () => ["mutation", "applimitwarning", "create"] as const, - /** Update appLimitWarning mutation key */update: (id: string | number) => ["mutation", "applimitwarning", "update", id] as const, - /** Delete appLimitWarning mutation key */delete: (id: string | number) => ["mutation", "applimitwarning", "delete", id] as const + /** All appLimitWarning mutation keys */ all: ['mutation', 'applimitwarning'] as const, + /** Create appLimitWarning mutation key */ create: () => + ['mutation', 'applimitwarning', 'create'] as const, + /** Update appLimitWarning mutation key */ update: (id: string | number) => + ['mutation', 'applimitwarning', 'update', id] as const, + /** Delete appLimitWarning mutation key */ delete: (id: string | number) => + ['mutation', 'applimitwarning', 'delete', id] as const, } as const; export const orgLimitAggregateMutationKeys = { - /** All orgLimitAggregate mutation keys */all: ["mutation", "orglimitaggregate"] as const, - /** Create orgLimitAggregate mutation key */create: () => ["mutation", "orglimitaggregate", "create"] as const, - /** Update orgLimitAggregate mutation key */update: (id: string | number) => ["mutation", "orglimitaggregate", "update", id] as const, - /** Delete orgLimitAggregate mutation key */delete: (id: string | number) => ["mutation", "orglimitaggregate", "delete", id] as const + /** All orgLimitAggregate mutation keys */ all: ['mutation', 'orglimitaggregate'] as const, + /** Create orgLimitAggregate mutation key */ create: () => + ['mutation', 'orglimitaggregate', 'create'] as const, + /** Update orgLimitAggregate mutation key */ update: (id: string | number) => + ['mutation', 'orglimitaggregate', 'update', id] as const, + /** Delete orgLimitAggregate mutation key */ delete: (id: string | number) => + ['mutation', 'orglimitaggregate', 'delete', id] as const, } as const; export const orgLimitCapMutationKeys = { - /** All orgLimitCap mutation keys */all: ["mutation", "orglimitcap"] as const, - /** Create orgLimitCap mutation key */create: () => ["mutation", "orglimitcap", "create"] as const, - /** Update orgLimitCap mutation key */update: (id: string | number) => ["mutation", "orglimitcap", "update", id] as const, - /** Delete orgLimitCap mutation key */delete: (id: string | number) => ["mutation", "orglimitcap", "delete", id] as const + /** All orgLimitCap mutation keys */ all: ['mutation', 'orglimitcap'] as const, + /** Create orgLimitCap mutation key */ create: () => + ['mutation', 'orglimitcap', 'create'] as const, + /** Update orgLimitCap mutation key */ update: (id: string | number) => + ['mutation', 'orglimitcap', 'update', id] as const, + /** Delete orgLimitCap mutation key */ delete: (id: string | number) => + ['mutation', 'orglimitcap', 'delete', id] as const, } as const; export const orgLimitCapsDefaultMutationKeys = { - /** All orgLimitCapsDefault mutation keys */all: ["mutation", "orglimitcapsdefault"] as const, - /** Create orgLimitCapsDefault mutation key */create: () => ["mutation", "orglimitcapsdefault", "create"] as const, - /** Update orgLimitCapsDefault mutation key */update: (id: string | number) => ["mutation", "orglimitcapsdefault", "update", id] as const, - /** Delete orgLimitCapsDefault mutation key */delete: (id: string | number) => ["mutation", "orglimitcapsdefault", "delete", id] as const + /** All orgLimitCapsDefault mutation keys */ all: ['mutation', 'orglimitcapsdefault'] as const, + /** Create orgLimitCapsDefault mutation key */ create: () => + ['mutation', 'orglimitcapsdefault', 'create'] as const, + /** Update orgLimitCapsDefault mutation key */ update: (id: string | number) => + ['mutation', 'orglimitcapsdefault', 'update', id] as const, + /** Delete orgLimitCapsDefault mutation key */ delete: (id: string | number) => + ['mutation', 'orglimitcapsdefault', 'delete', id] as const, } as const; export const orgLimitMutationKeys = { - /** All orgLimit mutation keys */all: ["mutation", "orglimit"] as const, - /** Create orgLimit mutation key */create: () => ["mutation", "orglimit", "create"] as const, - /** Update orgLimit mutation key */update: (id: string | number) => ["mutation", "orglimit", "update", id] as const, - /** Delete orgLimit mutation key */delete: (id: string | number) => ["mutation", "orglimit", "delete", id] as const + /** All orgLimit mutation keys */ all: ['mutation', 'orglimit'] as const, + /** Create orgLimit mutation key */ create: () => ['mutation', 'orglimit', 'create'] as const, + /** Update orgLimit mutation key */ update: (id: string | number) => + ['mutation', 'orglimit', 'update', id] as const, + /** Delete orgLimit mutation key */ delete: (id: string | number) => + ['mutation', 'orglimit', 'delete', id] as const, } as const; export const orgLimitCreditMutationKeys = { - /** All orgLimitCredit mutation keys */all: ["mutation", "orglimitcredit"] as const, - /** Create orgLimitCredit mutation key */create: () => ["mutation", "orglimitcredit", "create"] as const, - /** Update orgLimitCredit mutation key */update: (id: string | number) => ["mutation", "orglimitcredit", "update", id] as const, - /** Delete orgLimitCredit mutation key */delete: (id: string | number) => ["mutation", "orglimitcredit", "delete", id] as const + /** All orgLimitCredit mutation keys */ all: ['mutation', 'orglimitcredit'] as const, + /** Create orgLimitCredit mutation key */ create: () => + ['mutation', 'orglimitcredit', 'create'] as const, + /** Update orgLimitCredit mutation key */ update: (id: string | number) => + ['mutation', 'orglimitcredit', 'update', id] as const, + /** Delete orgLimitCredit mutation key */ delete: (id: string | number) => + ['mutation', 'orglimitcredit', 'delete', id] as const, } as const; export const orgLimitDefaultMutationKeys = { - /** All orgLimitDefault mutation keys */all: ["mutation", "orglimitdefault"] as const, - /** Create orgLimitDefault mutation key */create: () => ["mutation", "orglimitdefault", "create"] as const, - /** Update orgLimitDefault mutation key */update: (id: string | number) => ["mutation", "orglimitdefault", "update", id] as const, - /** Delete orgLimitDefault mutation key */delete: (id: string | number) => ["mutation", "orglimitdefault", "delete", id] as const + /** All orgLimitDefault mutation keys */ all: ['mutation', 'orglimitdefault'] as const, + /** Create orgLimitDefault mutation key */ create: () => + ['mutation', 'orglimitdefault', 'create'] as const, + /** Update orgLimitDefault mutation key */ update: (id: string | number) => + ['mutation', 'orglimitdefault', 'update', id] as const, + /** Delete orgLimitDefault mutation key */ delete: (id: string | number) => + ['mutation', 'orglimitdefault', 'delete', id] as const, } as const; export const orgLimitEventMutationKeys = { - /** All orgLimitEvent mutation keys */all: ["mutation", "orglimitevent"] as const, - /** Create orgLimitEvent mutation key */create: () => ["mutation", "orglimitevent", "create"] as const, - /** Update orgLimitEvent mutation key */update: (id: string | number) => ["mutation", "orglimitevent", "update", id] as const, - /** Delete orgLimitEvent mutation key */delete: (id: string | number) => ["mutation", "orglimitevent", "delete", id] as const + /** All orgLimitEvent mutation keys */ all: ['mutation', 'orglimitevent'] as const, + /** Create orgLimitEvent mutation key */ create: () => + ['mutation', 'orglimitevent', 'create'] as const, + /** Update orgLimitEvent mutation key */ update: (id: string | number) => + ['mutation', 'orglimitevent', 'update', id] as const, + /** Delete orgLimitEvent mutation key */ delete: (id: string | number) => + ['mutation', 'orglimitevent', 'delete', id] as const, } as const; export const orgLimitWarningMutationKeys = { - /** All orgLimitWarning mutation keys */all: ["mutation", "orglimitwarning"] as const, - /** Create orgLimitWarning mutation key */create: () => ["mutation", "orglimitwarning", "create"] as const, - /** Update orgLimitWarning mutation key */update: (id: string | number) => ["mutation", "orglimitwarning", "update", id] as const, - /** Delete orgLimitWarning mutation key */delete: (id: string | number) => ["mutation", "orglimitwarning", "delete", id] as const + /** All orgLimitWarning mutation keys */ all: ['mutation', 'orglimitwarning'] as const, + /** Create orgLimitWarning mutation key */ create: () => + ['mutation', 'orglimitwarning', 'create'] as const, + /** Update orgLimitWarning mutation key */ update: (id: string | number) => + ['mutation', 'orglimitwarning', 'update', id] as const, + /** Delete orgLimitWarning mutation key */ delete: (id: string | number) => + ['mutation', 'orglimitwarning', 'delete', id] as const, } as const; // ============================================================================ @@ -132,11 +190,30 @@ export const orgLimitWarningMutationKeys = { // ============================================================================ export const customMutationKeys = { - /** Mutation key for provisionBucket */provisionBucket: (identifier?: string) => identifier ? ["mutation", "provisionBucket", identifier] as const : ["mutation", "provisionBucket"] as const, - /** Mutation key for seedAppLimitCapsDefaults */seedAppLimitCapsDefaults: (identifier?: string) => identifier ? ["mutation", "seedAppLimitCapsDefaults", identifier] as const : ["mutation", "seedAppLimitCapsDefaults"] as const, - /** Mutation key for seedAppLimitDefaults */seedAppLimitDefaults: (identifier?: string) => identifier ? ["mutation", "seedAppLimitDefaults", identifier] as const : ["mutation", "seedAppLimitDefaults"] as const, - /** Mutation key for seedOrgLimitCapsDefaults */seedOrgLimitCapsDefaults: (identifier?: string) => identifier ? ["mutation", "seedOrgLimitCapsDefaults", identifier] as const : ["mutation", "seedOrgLimitCapsDefaults"] as const, - /** Mutation key for seedOrgLimitDefaults */seedOrgLimitDefaults: (identifier?: string) => identifier ? ["mutation", "seedOrgLimitDefaults", identifier] as const : ["mutation", "seedOrgLimitDefaults"] as const + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), + /** Mutation key for seedAppLimitCapsDefaults */ seedAppLimitCapsDefaults: ( + identifier?: string + ) => + identifier + ? (['mutation', 'seedAppLimitCapsDefaults', identifier] as const) + : (['mutation', 'seedAppLimitCapsDefaults'] as const), + /** Mutation key for seedAppLimitDefaults */ seedAppLimitDefaults: (identifier?: string) => + identifier + ? (['mutation', 'seedAppLimitDefaults', identifier] as const) + : (['mutation', 'seedAppLimitDefaults'] as const), + /** Mutation key for seedOrgLimitCapsDefaults */ seedOrgLimitCapsDefaults: ( + identifier?: string + ) => + identifier + ? (['mutation', 'seedOrgLimitCapsDefaults', identifier] as const) + : (['mutation', 'seedOrgLimitCapsDefaults'] as const), + /** Mutation key for seedOrgLimitDefaults */ seedOrgLimitDefaults: (identifier?: string) => + identifier + ? (['mutation', 'seedOrgLimitDefaults', identifier] as const) + : (['mutation', 'seedOrgLimitDefaults'] as const), } as const; /** @@ -179,5 +256,5 @@ export const mutationKeys = { orgLimitDefault: orgLimitDefaultMutationKeys, orgLimitEvent: orgLimitEventMutationKeys, orgLimitWarning: orgLimitWarningMutationKeys, - custom: customMutationKeys + custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/usage/hooks/mutations/index.ts b/sdk/constructive-react/src/usage/hooks/mutations/index.ts index e3766830f6..4c5fa142b4 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/index.ts @@ -3,62 +3,62 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useCreateAppLimitCapMutation"; -export * from "./useUpdateAppLimitCapMutation"; -export * from "./useDeleteAppLimitCapMutation"; -export * from "./useCreateAppLimitCapsDefaultMutation"; -export * from "./useUpdateAppLimitCapsDefaultMutation"; -export * from "./useDeleteAppLimitCapsDefaultMutation"; -export * from "./useCreateAppLimitMutation"; -export * from "./useUpdateAppLimitMutation"; -export * from "./useDeleteAppLimitMutation"; -export * from "./useCreateAppLimitCreditCodeMutation"; -export * from "./useUpdateAppLimitCreditCodeMutation"; -export * from "./useDeleteAppLimitCreditCodeMutation"; -export * from "./useCreateAppLimitCreditCodeItemMutation"; -export * from "./useUpdateAppLimitCreditCodeItemMutation"; -export * from "./useDeleteAppLimitCreditCodeItemMutation"; -export * from "./useCreateAppLimitCreditMutation"; -export * from "./useUpdateAppLimitCreditMutation"; -export * from "./useDeleteAppLimitCreditMutation"; -export * from "./useCreateAppLimitCreditRedemptionMutation"; -export * from "./useUpdateAppLimitCreditRedemptionMutation"; -export * from "./useDeleteAppLimitCreditRedemptionMutation"; -export * from "./useCreateAppLimitDefaultMutation"; -export * from "./useUpdateAppLimitDefaultMutation"; -export * from "./useDeleteAppLimitDefaultMutation"; -export * from "./useCreateAppLimitEventMutation"; -export * from "./useUpdateAppLimitEventMutation"; -export * from "./useDeleteAppLimitEventMutation"; -export * from "./useCreateAppLimitWarningMutation"; -export * from "./useUpdateAppLimitWarningMutation"; -export * from "./useDeleteAppLimitWarningMutation"; -export * from "./useCreateOrgLimitAggregateMutation"; -export * from "./useUpdateOrgLimitAggregateMutation"; -export * from "./useDeleteOrgLimitAggregateMutation"; -export * from "./useCreateOrgLimitCapMutation"; -export * from "./useUpdateOrgLimitCapMutation"; -export * from "./useDeleteOrgLimitCapMutation"; -export * from "./useCreateOrgLimitCapsDefaultMutation"; -export * from "./useUpdateOrgLimitCapsDefaultMutation"; -export * from "./useDeleteOrgLimitCapsDefaultMutation"; -export * from "./useCreateOrgLimitMutation"; -export * from "./useUpdateOrgLimitMutation"; -export * from "./useDeleteOrgLimitMutation"; -export * from "./useCreateOrgLimitCreditMutation"; -export * from "./useUpdateOrgLimitCreditMutation"; -export * from "./useDeleteOrgLimitCreditMutation"; -export * from "./useCreateOrgLimitDefaultMutation"; -export * from "./useUpdateOrgLimitDefaultMutation"; -export * from "./useDeleteOrgLimitDefaultMutation"; -export * from "./useCreateOrgLimitEventMutation"; -export * from "./useUpdateOrgLimitEventMutation"; -export * from "./useDeleteOrgLimitEventMutation"; -export * from "./useCreateOrgLimitWarningMutation"; -export * from "./useUpdateOrgLimitWarningMutation"; -export * from "./useDeleteOrgLimitWarningMutation"; -export * from "./useProvisionBucketMutation"; -export * from "./useSeedAppLimitCapsDefaultsMutation"; -export * from "./useSeedAppLimitDefaultsMutation"; -export * from "./useSeedOrgLimitCapsDefaultsMutation"; -export * from "./useSeedOrgLimitDefaultsMutation"; \ No newline at end of file +export * from './useCreateAppLimitCapMutation'; +export * from './useUpdateAppLimitCapMutation'; +export * from './useDeleteAppLimitCapMutation'; +export * from './useCreateAppLimitCapsDefaultMutation'; +export * from './useUpdateAppLimitCapsDefaultMutation'; +export * from './useDeleteAppLimitCapsDefaultMutation'; +export * from './useCreateAppLimitMutation'; +export * from './useUpdateAppLimitMutation'; +export * from './useDeleteAppLimitMutation'; +export * from './useCreateAppLimitCreditCodeMutation'; +export * from './useUpdateAppLimitCreditCodeMutation'; +export * from './useDeleteAppLimitCreditCodeMutation'; +export * from './useCreateAppLimitCreditCodeItemMutation'; +export * from './useUpdateAppLimitCreditCodeItemMutation'; +export * from './useDeleteAppLimitCreditCodeItemMutation'; +export * from './useCreateAppLimitCreditMutation'; +export * from './useUpdateAppLimitCreditMutation'; +export * from './useDeleteAppLimitCreditMutation'; +export * from './useCreateAppLimitCreditRedemptionMutation'; +export * from './useUpdateAppLimitCreditRedemptionMutation'; +export * from './useDeleteAppLimitCreditRedemptionMutation'; +export * from './useCreateAppLimitDefaultMutation'; +export * from './useUpdateAppLimitDefaultMutation'; +export * from './useDeleteAppLimitDefaultMutation'; +export * from './useCreateAppLimitEventMutation'; +export * from './useUpdateAppLimitEventMutation'; +export * from './useDeleteAppLimitEventMutation'; +export * from './useCreateAppLimitWarningMutation'; +export * from './useUpdateAppLimitWarningMutation'; +export * from './useDeleteAppLimitWarningMutation'; +export * from './useCreateOrgLimitAggregateMutation'; +export * from './useUpdateOrgLimitAggregateMutation'; +export * from './useDeleteOrgLimitAggregateMutation'; +export * from './useCreateOrgLimitCapMutation'; +export * from './useUpdateOrgLimitCapMutation'; +export * from './useDeleteOrgLimitCapMutation'; +export * from './useCreateOrgLimitCapsDefaultMutation'; +export * from './useUpdateOrgLimitCapsDefaultMutation'; +export * from './useDeleteOrgLimitCapsDefaultMutation'; +export * from './useCreateOrgLimitMutation'; +export * from './useUpdateOrgLimitMutation'; +export * from './useDeleteOrgLimitMutation'; +export * from './useCreateOrgLimitCreditMutation'; +export * from './useUpdateOrgLimitCreditMutation'; +export * from './useDeleteOrgLimitCreditMutation'; +export * from './useCreateOrgLimitDefaultMutation'; +export * from './useUpdateOrgLimitDefaultMutation'; +export * from './useDeleteOrgLimitDefaultMutation'; +export * from './useCreateOrgLimitEventMutation'; +export * from './useUpdateOrgLimitEventMutation'; +export * from './useDeleteOrgLimitEventMutation'; +export * from './useCreateOrgLimitWarningMutation'; +export * from './useUpdateOrgLimitWarningMutation'; +export * from './useDeleteOrgLimitWarningMutation'; +export * from './useProvisionBucketMutation'; +export * from './useSeedAppLimitCapsDefaultsMutation'; +export * from './useSeedAppLimitDefaultsMutation'; +export * from './useSeedOrgLimitCapsDefaultsMutation'; +export * from './useSeedOrgLimitDefaultsMutation'; diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCapMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCapMutation.ts index 73b799fe96..057ed1bda8 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCapMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCapMutation.ts @@ -4,62 +4,85 @@ * 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 { appLimitCapKeys } from "../query-keys"; -import { appLimitCapMutationKeys } from "../mutation-keys"; -import type { AppLimitCapSelect, AppLimitCapWithRelations, CreateAppLimitCapInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapSelect, AppLimitCapWithRelations, CreateAppLimitCapInput } from "../../orm/input-types"; +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 { appLimitCapKeys } from '../query-keys'; +import { appLimitCapMutationKeys } from '../mutation-keys'; +import type { + AppLimitCapSelect, + AppLimitCapWithRelations, + CreateAppLimitCapInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCapSelect, + AppLimitCapWithRelations, + CreateAppLimitCapInput, +} from '../../orm/input-types'; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitCapMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitCapMutation(params: { - selection: ({ - fields: S & AppLimitCapSelect; - } & HookStrictSelect, AppLimitCapSelect>); -} & Omit; - }; -}, Error, CreateAppLimitCapInput["appLimitCap"]>, "mutationFn">): UseMutationResult<{ - createAppLimitCap: { - appLimitCap: InferSelectResult; - }; -}, Error, CreateAppLimitCapInput["appLimitCap"]>; -export function useCreateAppLimitCapMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitCapMutation( + params: { + selection: { + fields: S & AppLimitCapSelect; + } & HookStrictSelect, AppLimitCapSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitCap: { + appLimitCap: InferSelectResult; + }; + }, + Error, + CreateAppLimitCapInput['appLimitCap'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitCap: { + appLimitCap: InferSelectResult; + }; + }, + Error, + CreateAppLimitCapInput['appLimitCap'] +>; +export function useCreateAppLimitCapMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCapMutationKeys.create(), - mutationFn: (data: CreateAppLimitCapInput["appLimitCap"]) => getClient().appLimitCap.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitCapInput['appLimitCap']) => + getClient() + .appLimitCap.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitCapKeys.lists() + queryKey: appLimitCapKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCapsDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCapsDefaultMutation.ts index f4c1a6b1a9..deb3d56ba4 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCapsDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCapsDefaultMutation.ts @@ -4,62 +4,88 @@ * 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 { appLimitCapsDefaultKeys } from "../query-keys"; -import { appLimitCapsDefaultMutationKeys } from "../mutation-keys"; -import type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations, CreateAppLimitCapsDefaultInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations, CreateAppLimitCapsDefaultInput } from "../../orm/input-types"; +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 { appLimitCapsDefaultKeys } from '../query-keys'; +import { appLimitCapsDefaultMutationKeys } from '../mutation-keys'; +import type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, + CreateAppLimitCapsDefaultInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, + CreateAppLimitCapsDefaultInput, +} from '../../orm/input-types'; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitCapsDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitCapsDefaultMutation(params: { - selection: ({ - fields: S & AppLimitCapsDefaultSelect; - } & HookStrictSelect, AppLimitCapsDefaultSelect>); -} & Omit; - }; -}, Error, CreateAppLimitCapsDefaultInput["appLimitCapsDefault"]>, "mutationFn">): UseMutationResult<{ - createAppLimitCapsDefault: { - appLimitCapsDefault: InferSelectResult; - }; -}, Error, CreateAppLimitCapsDefaultInput["appLimitCapsDefault"]>; -export function useCreateAppLimitCapsDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitCapsDefaultMutation( + params: { + selection: { + fields: S & AppLimitCapsDefaultSelect; + } & HookStrictSelect, AppLimitCapsDefaultSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitCapsDefault: { + appLimitCapsDefault: InferSelectResult; + }; + }, + Error, + CreateAppLimitCapsDefaultInput['appLimitCapsDefault'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitCapsDefault: { + appLimitCapsDefault: InferSelectResult; + }; + }, + Error, + CreateAppLimitCapsDefaultInput['appLimitCapsDefault'] +>; +export function useCreateAppLimitCapsDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCapsDefaultMutationKeys.create(), - mutationFn: (data: CreateAppLimitCapsDefaultInput["appLimitCapsDefault"]) => getClient().appLimitCapsDefault.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitCapsDefaultInput['appLimitCapsDefault']) => + getClient() + .appLimitCapsDefault.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitCapsDefaultKeys.lists() + queryKey: appLimitCapsDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditCodeItemMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditCodeItemMutation.ts index 9b03b688ac..5babc7b229 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditCodeItemMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditCodeItemMutation.ts @@ -4,62 +4,88 @@ * 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 { appLimitCreditCodeItemKeys } from "../query-keys"; -import { appLimitCreditCodeItemMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations, CreateAppLimitCreditCodeItemInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations, CreateAppLimitCreditCodeItemInput } from "../../orm/input-types"; +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 { appLimitCreditCodeItemKeys } from '../query-keys'; +import { appLimitCreditCodeItemMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, + CreateAppLimitCreditCodeItemInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, + CreateAppLimitCreditCodeItemInput, +} from '../../orm/input-types'; /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitCreditCodeItemMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitCreditCodeItemMutation(params: { - selection: ({ - fields: S & AppLimitCreditCodeItemSelect; - } & HookStrictSelect, AppLimitCreditCodeItemSelect>); -} & Omit; - }; -}, Error, CreateAppLimitCreditCodeItemInput["appLimitCreditCodeItem"]>, "mutationFn">): UseMutationResult<{ - createAppLimitCreditCodeItem: { - appLimitCreditCodeItem: InferSelectResult; - }; -}, Error, CreateAppLimitCreditCodeItemInput["appLimitCreditCodeItem"]>; -export function useCreateAppLimitCreditCodeItemMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitCreditCodeItemMutation( + params: { + selection: { + fields: S & AppLimitCreditCodeItemSelect; + } & HookStrictSelect, AppLimitCreditCodeItemSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitCreditCodeItem: { + appLimitCreditCodeItem: InferSelectResult; + }; + }, + Error, + CreateAppLimitCreditCodeItemInput['appLimitCreditCodeItem'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitCreditCodeItem: { + appLimitCreditCodeItem: InferSelectResult; + }; + }, + Error, + CreateAppLimitCreditCodeItemInput['appLimitCreditCodeItem'] +>; +export function useCreateAppLimitCreditCodeItemMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditCodeItemMutationKeys.create(), - mutationFn: (data: CreateAppLimitCreditCodeItemInput["appLimitCreditCodeItem"]) => getClient().appLimitCreditCodeItem.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitCreditCodeItemInput['appLimitCreditCodeItem']) => + getClient() + .appLimitCreditCodeItem.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeItemKeys.lists() + queryKey: appLimitCreditCodeItemKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditCodeMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditCodeMutation.ts index 94a73d080a..0fd950f9a0 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditCodeMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditCodeMutation.ts @@ -4,62 +4,88 @@ * 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 { appLimitCreditCodeKeys } from "../query-keys"; -import { appLimitCreditCodeMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations, CreateAppLimitCreditCodeInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations, CreateAppLimitCreditCodeInput } from "../../orm/input-types"; +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 { appLimitCreditCodeKeys } from '../query-keys'; +import { appLimitCreditCodeMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, + CreateAppLimitCreditCodeInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, + CreateAppLimitCreditCodeInput, +} from '../../orm/input-types'; /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitCreditCodeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitCreditCodeMutation(params: { - selection: ({ - fields: S & AppLimitCreditCodeSelect; - } & HookStrictSelect, AppLimitCreditCodeSelect>); -} & Omit; - }; -}, Error, CreateAppLimitCreditCodeInput["appLimitCreditCode"]>, "mutationFn">): UseMutationResult<{ - createAppLimitCreditCode: { - appLimitCreditCode: InferSelectResult; - }; -}, Error, CreateAppLimitCreditCodeInput["appLimitCreditCode"]>; -export function useCreateAppLimitCreditCodeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitCreditCodeMutation( + params: { + selection: { + fields: S & AppLimitCreditCodeSelect; + } & HookStrictSelect, AppLimitCreditCodeSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitCreditCode: { + appLimitCreditCode: InferSelectResult; + }; + }, + Error, + CreateAppLimitCreditCodeInput['appLimitCreditCode'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitCreditCode: { + appLimitCreditCode: InferSelectResult; + }; + }, + Error, + CreateAppLimitCreditCodeInput['appLimitCreditCode'] +>; +export function useCreateAppLimitCreditCodeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditCodeMutationKeys.create(), - mutationFn: (data: CreateAppLimitCreditCodeInput["appLimitCreditCode"]) => getClient().appLimitCreditCode.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitCreditCodeInput['appLimitCreditCode']) => + getClient() + .appLimitCreditCode.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeKeys.lists() + queryKey: appLimitCreditCodeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditMutation.ts index f75a65f582..0b731bf137 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditMutation.ts @@ -4,62 +4,88 @@ * 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 { appLimitCreditKeys } from "../query-keys"; -import { appLimitCreditMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditSelect, AppLimitCreditWithRelations, CreateAppLimitCreditInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditSelect, AppLimitCreditWithRelations, CreateAppLimitCreditInput } from "../../orm/input-types"; +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 { appLimitCreditKeys } from '../query-keys'; +import { appLimitCreditMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditSelect, + AppLimitCreditWithRelations, + CreateAppLimitCreditInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditSelect, + AppLimitCreditWithRelations, + CreateAppLimitCreditInput, +} from '../../orm/input-types'; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitCreditMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitCreditMutation(params: { - selection: ({ - fields: S & AppLimitCreditSelect; - } & HookStrictSelect, AppLimitCreditSelect>); -} & Omit; - }; -}, Error, CreateAppLimitCreditInput["appLimitCredit"]>, "mutationFn">): UseMutationResult<{ - createAppLimitCredit: { - appLimitCredit: InferSelectResult; - }; -}, Error, CreateAppLimitCreditInput["appLimitCredit"]>; -export function useCreateAppLimitCreditMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitCreditMutation( + params: { + selection: { + fields: S & AppLimitCreditSelect; + } & HookStrictSelect, AppLimitCreditSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitCredit: { + appLimitCredit: InferSelectResult; + }; + }, + Error, + CreateAppLimitCreditInput['appLimitCredit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitCredit: { + appLimitCredit: InferSelectResult; + }; + }, + Error, + CreateAppLimitCreditInput['appLimitCredit'] +>; +export function useCreateAppLimitCreditMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditMutationKeys.create(), - mutationFn: (data: CreateAppLimitCreditInput["appLimitCredit"]) => getClient().appLimitCredit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitCreditInput['appLimitCredit']) => + getClient() + .appLimitCredit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitCreditKeys.lists() + queryKey: appLimitCreditKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditRedemptionMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditRedemptionMutation.ts index e60bb2f2b8..b745e34f44 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditRedemptionMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitCreditRedemptionMutation.ts @@ -4,62 +4,88 @@ * 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 { appLimitCreditRedemptionKeys } from "../query-keys"; -import { appLimitCreditRedemptionMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations, CreateAppLimitCreditRedemptionInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations, CreateAppLimitCreditRedemptionInput } from "../../orm/input-types"; +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 { appLimitCreditRedemptionKeys } from '../query-keys'; +import { appLimitCreditRedemptionMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, + CreateAppLimitCreditRedemptionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, + CreateAppLimitCreditRedemptionInput, +} from '../../orm/input-types'; /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitCreditRedemptionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitCreditRedemptionMutation(params: { - selection: ({ - fields: S & AppLimitCreditRedemptionSelect; - } & HookStrictSelect, AppLimitCreditRedemptionSelect>); -} & Omit; - }; -}, Error, CreateAppLimitCreditRedemptionInput["appLimitCreditRedemption"]>, "mutationFn">): UseMutationResult<{ - createAppLimitCreditRedemption: { - appLimitCreditRedemption: InferSelectResult; - }; -}, Error, CreateAppLimitCreditRedemptionInput["appLimitCreditRedemption"]>; -export function useCreateAppLimitCreditRedemptionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitCreditRedemptionMutation( + params: { + selection: { + fields: S & AppLimitCreditRedemptionSelect; + } & HookStrictSelect, AppLimitCreditRedemptionSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitCreditRedemption: { + appLimitCreditRedemption: InferSelectResult; + }; + }, + Error, + CreateAppLimitCreditRedemptionInput['appLimitCreditRedemption'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitCreditRedemption: { + appLimitCreditRedemption: InferSelectResult; + }; + }, + Error, + CreateAppLimitCreditRedemptionInput['appLimitCreditRedemption'] +>; +export function useCreateAppLimitCreditRedemptionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditRedemptionMutationKeys.create(), - mutationFn: (data: CreateAppLimitCreditRedemptionInput["appLimitCreditRedemption"]) => getClient().appLimitCreditRedemption.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitCreditRedemptionInput['appLimitCreditRedemption']) => + getClient() + .appLimitCreditRedemption.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitCreditRedemptionKeys.lists() + queryKey: appLimitCreditRedemptionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitDefaultMutation.ts index 9767ca6a84..5e39d5c933 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitDefaultMutation.ts @@ -4,62 +4,88 @@ * 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 { appLimitDefaultKeys } from "../query-keys"; -import { appLimitDefaultMutationKeys } from "../mutation-keys"; -import type { AppLimitDefaultSelect, AppLimitDefaultWithRelations, CreateAppLimitDefaultInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitDefaultSelect, AppLimitDefaultWithRelations, CreateAppLimitDefaultInput } from "../../orm/input-types"; +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 { appLimitDefaultKeys } from '../query-keys'; +import { appLimitDefaultMutationKeys } from '../mutation-keys'; +import type { + AppLimitDefaultSelect, + AppLimitDefaultWithRelations, + CreateAppLimitDefaultInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitDefaultSelect, + AppLimitDefaultWithRelations, + CreateAppLimitDefaultInput, +} from '../../orm/input-types'; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitDefaultMutation(params: { - selection: ({ - fields: S & AppLimitDefaultSelect; - } & HookStrictSelect, AppLimitDefaultSelect>); -} & Omit; - }; -}, Error, CreateAppLimitDefaultInput["appLimitDefault"]>, "mutationFn">): UseMutationResult<{ - createAppLimitDefault: { - appLimitDefault: InferSelectResult; - }; -}, Error, CreateAppLimitDefaultInput["appLimitDefault"]>; -export function useCreateAppLimitDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitDefaultMutation( + params: { + selection: { + fields: S & AppLimitDefaultSelect; + } & HookStrictSelect, AppLimitDefaultSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitDefault: { + appLimitDefault: InferSelectResult; + }; + }, + Error, + CreateAppLimitDefaultInput['appLimitDefault'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitDefault: { + appLimitDefault: InferSelectResult; + }; + }, + Error, + CreateAppLimitDefaultInput['appLimitDefault'] +>; +export function useCreateAppLimitDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitDefaultMutationKeys.create(), - mutationFn: (data: CreateAppLimitDefaultInput["appLimitDefault"]) => getClient().appLimitDefault.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitDefaultInput['appLimitDefault']) => + getClient() + .appLimitDefault.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitDefaultKeys.lists() + queryKey: appLimitDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitEventMutation.ts index 55c5086555..b34aef46fa 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitEventMutation.ts @@ -4,62 +4,85 @@ * 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 { appLimitEventKeys } from "../query-keys"; -import { appLimitEventMutationKeys } from "../mutation-keys"; -import type { AppLimitEventSelect, AppLimitEventWithRelations, CreateAppLimitEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitEventSelect, AppLimitEventWithRelations, CreateAppLimitEventInput } from "../../orm/input-types"; +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 { appLimitEventKeys } from '../query-keys'; +import { appLimitEventMutationKeys } from '../mutation-keys'; +import type { + AppLimitEventSelect, + AppLimitEventWithRelations, + CreateAppLimitEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitEventSelect, + AppLimitEventWithRelations, + CreateAppLimitEventInput, +} from '../../orm/input-types'; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitEventMutation(params: { - selection: ({ - fields: S & AppLimitEventSelect; - } & HookStrictSelect, AppLimitEventSelect>); -} & Omit; - }; -}, Error, CreateAppLimitEventInput["appLimitEvent"]>, "mutationFn">): UseMutationResult<{ - createAppLimitEvent: { - appLimitEvent: InferSelectResult; - }; -}, Error, CreateAppLimitEventInput["appLimitEvent"]>; -export function useCreateAppLimitEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitEventMutation( + params: { + selection: { + fields: S & AppLimitEventSelect; + } & HookStrictSelect, AppLimitEventSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitEvent: { + appLimitEvent: InferSelectResult; + }; + }, + Error, + CreateAppLimitEventInput['appLimitEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitEvent: { + appLimitEvent: InferSelectResult; + }; + }, + Error, + CreateAppLimitEventInput['appLimitEvent'] +>; +export function useCreateAppLimitEventMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitEventMutationKeys.create(), - mutationFn: (data: CreateAppLimitEventInput["appLimitEvent"]) => getClient().appLimitEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitEventInput['appLimitEvent']) => + getClient() + .appLimitEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitEventKeys.lists() + queryKey: appLimitEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitMutation.ts index 866e3a5d87..4831101f29 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitMutation.ts @@ -4,62 +4,85 @@ * 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 { appLimitKeys } from "../query-keys"; -import { appLimitMutationKeys } from "../mutation-keys"; -import type { AppLimitSelect, AppLimitWithRelations, CreateAppLimitInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitSelect, AppLimitWithRelations, CreateAppLimitInput } from "../../orm/input-types"; +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 { appLimitKeys } from '../query-keys'; +import { appLimitMutationKeys } from '../mutation-keys'; +import type { + AppLimitSelect, + AppLimitWithRelations, + CreateAppLimitInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitSelect, + AppLimitWithRelations, + CreateAppLimitInput, +} from '../../orm/input-types'; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitMutation(params: { - selection: ({ - fields: S & AppLimitSelect; - } & HookStrictSelect, AppLimitSelect>); -} & Omit; - }; -}, Error, CreateAppLimitInput["appLimit"]>, "mutationFn">): UseMutationResult<{ - createAppLimit: { - appLimit: InferSelectResult; - }; -}, Error, CreateAppLimitInput["appLimit"]>; -export function useCreateAppLimitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitMutation( + params: { + selection: { + fields: S & AppLimitSelect; + } & HookStrictSelect, AppLimitSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimit: { + appLimit: InferSelectResult; + }; + }, + Error, + CreateAppLimitInput['appLimit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimit: { + appLimit: InferSelectResult; + }; + }, + Error, + CreateAppLimitInput['appLimit'] +>; +export function useCreateAppLimitMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitMutationKeys.create(), - mutationFn: (data: CreateAppLimitInput["appLimit"]) => getClient().appLimit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitInput['appLimit']) => + getClient() + .appLimit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitKeys.lists() + queryKey: appLimitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitWarningMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitWarningMutation.ts index c7bd4d049f..69d99a63f7 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitWarningMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateAppLimitWarningMutation.ts @@ -4,62 +4,88 @@ * 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 { appLimitWarningKeys } from "../query-keys"; -import { appLimitWarningMutationKeys } from "../mutation-keys"; -import type { AppLimitWarningSelect, AppLimitWarningWithRelations, CreateAppLimitWarningInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitWarningSelect, AppLimitWarningWithRelations, CreateAppLimitWarningInput } from "../../orm/input-types"; +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 { appLimitWarningKeys } from '../query-keys'; +import { appLimitWarningMutationKeys } from '../mutation-keys'; +import type { + AppLimitWarningSelect, + AppLimitWarningWithRelations, + CreateAppLimitWarningInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitWarningSelect, + AppLimitWarningWithRelations, + CreateAppLimitWarningInput, +} from '../../orm/input-types'; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateAppLimitWarningMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateAppLimitWarningMutation(params: { - selection: ({ - fields: S & AppLimitWarningSelect; - } & HookStrictSelect, AppLimitWarningSelect>); -} & Omit; - }; -}, Error, CreateAppLimitWarningInput["appLimitWarning"]>, "mutationFn">): UseMutationResult<{ - createAppLimitWarning: { - appLimitWarning: InferSelectResult; - }; -}, Error, CreateAppLimitWarningInput["appLimitWarning"]>; -export function useCreateAppLimitWarningMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateAppLimitWarningMutation( + params: { + selection: { + fields: S & AppLimitWarningSelect; + } & HookStrictSelect, AppLimitWarningSelect>; + } & Omit< + UseMutationOptions< + { + createAppLimitWarning: { + appLimitWarning: InferSelectResult; + }; + }, + Error, + CreateAppLimitWarningInput['appLimitWarning'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createAppLimitWarning: { + appLimitWarning: InferSelectResult; + }; + }, + Error, + CreateAppLimitWarningInput['appLimitWarning'] +>; +export function useCreateAppLimitWarningMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitWarningMutationKeys.create(), - mutationFn: (data: CreateAppLimitWarningInput["appLimitWarning"]) => getClient().appLimitWarning.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateAppLimitWarningInput['appLimitWarning']) => + getClient() + .appLimitWarning.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: appLimitWarningKeys.lists() + queryKey: appLimitWarningKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitAggregateMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitAggregateMutation.ts index 1a127e3dc5..c3f671b70a 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitAggregateMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitAggregateMutation.ts @@ -4,62 +4,88 @@ * 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 { orgLimitAggregateKeys } from "../query-keys"; -import { orgLimitAggregateMutationKeys } from "../mutation-keys"; -import type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations, CreateOrgLimitAggregateInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations, CreateOrgLimitAggregateInput } from "../../orm/input-types"; +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 { orgLimitAggregateKeys } from '../query-keys'; +import { orgLimitAggregateMutationKeys } from '../mutation-keys'; +import type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, + CreateOrgLimitAggregateInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, + CreateOrgLimitAggregateInput, +} from '../../orm/input-types'; /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgLimitAggregateMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgLimitAggregateMutation(params: { - selection: ({ - fields: S & OrgLimitAggregateSelect; - } & HookStrictSelect, OrgLimitAggregateSelect>); -} & Omit; - }; -}, Error, CreateOrgLimitAggregateInput["orgLimitAggregate"]>, "mutationFn">): UseMutationResult<{ - createOrgLimitAggregate: { - orgLimitAggregate: InferSelectResult; - }; -}, Error, CreateOrgLimitAggregateInput["orgLimitAggregate"]>; -export function useCreateOrgLimitAggregateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgLimitAggregateMutation( + params: { + selection: { + fields: S & OrgLimitAggregateSelect; + } & HookStrictSelect, OrgLimitAggregateSelect>; + } & Omit< + UseMutationOptions< + { + createOrgLimitAggregate: { + orgLimitAggregate: InferSelectResult; + }; + }, + Error, + CreateOrgLimitAggregateInput['orgLimitAggregate'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgLimitAggregate: { + orgLimitAggregate: InferSelectResult; + }; + }, + Error, + CreateOrgLimitAggregateInput['orgLimitAggregate'] +>; +export function useCreateOrgLimitAggregateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitAggregateMutationKeys.create(), - mutationFn: (data: CreateOrgLimitAggregateInput["orgLimitAggregate"]) => getClient().orgLimitAggregate.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgLimitAggregateInput['orgLimitAggregate']) => + getClient() + .orgLimitAggregate.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgLimitAggregateKeys.lists() + queryKey: orgLimitAggregateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCapMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCapMutation.ts index e2e7129eff..b9379cd911 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCapMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCapMutation.ts @@ -4,62 +4,85 @@ * 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 { orgLimitCapKeys } from "../query-keys"; -import { orgLimitCapMutationKeys } from "../mutation-keys"; -import type { OrgLimitCapSelect, OrgLimitCapWithRelations, CreateOrgLimitCapInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapSelect, OrgLimitCapWithRelations, CreateOrgLimitCapInput } from "../../orm/input-types"; +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 { orgLimitCapKeys } from '../query-keys'; +import { orgLimitCapMutationKeys } from '../mutation-keys'; +import type { + OrgLimitCapSelect, + OrgLimitCapWithRelations, + CreateOrgLimitCapInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitCapSelect, + OrgLimitCapWithRelations, + CreateOrgLimitCapInput, +} from '../../orm/input-types'; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgLimitCapMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgLimitCapMutation(params: { - selection: ({ - fields: S & OrgLimitCapSelect; - } & HookStrictSelect, OrgLimitCapSelect>); -} & Omit; - }; -}, Error, CreateOrgLimitCapInput["orgLimitCap"]>, "mutationFn">): UseMutationResult<{ - createOrgLimitCap: { - orgLimitCap: InferSelectResult; - }; -}, Error, CreateOrgLimitCapInput["orgLimitCap"]>; -export function useCreateOrgLimitCapMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgLimitCapMutation( + params: { + selection: { + fields: S & OrgLimitCapSelect; + } & HookStrictSelect, OrgLimitCapSelect>; + } & Omit< + UseMutationOptions< + { + createOrgLimitCap: { + orgLimitCap: InferSelectResult; + }; + }, + Error, + CreateOrgLimitCapInput['orgLimitCap'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgLimitCap: { + orgLimitCap: InferSelectResult; + }; + }, + Error, + CreateOrgLimitCapInput['orgLimitCap'] +>; +export function useCreateOrgLimitCapMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCapMutationKeys.create(), - mutationFn: (data: CreateOrgLimitCapInput["orgLimitCap"]) => getClient().orgLimitCap.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgLimitCapInput['orgLimitCap']) => + getClient() + .orgLimitCap.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgLimitCapKeys.lists() + queryKey: orgLimitCapKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCapsDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCapsDefaultMutation.ts index 7a6a9e2a07..02eadbe20f 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCapsDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCapsDefaultMutation.ts @@ -4,62 +4,88 @@ * 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 { orgLimitCapsDefaultKeys } from "../query-keys"; -import { orgLimitCapsDefaultMutationKeys } from "../mutation-keys"; -import type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations, CreateOrgLimitCapsDefaultInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations, CreateOrgLimitCapsDefaultInput } from "../../orm/input-types"; +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 { orgLimitCapsDefaultKeys } from '../query-keys'; +import { orgLimitCapsDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, + CreateOrgLimitCapsDefaultInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, + CreateOrgLimitCapsDefaultInput, +} from '../../orm/input-types'; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgLimitCapsDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgLimitCapsDefaultMutation(params: { - selection: ({ - fields: S & OrgLimitCapsDefaultSelect; - } & HookStrictSelect, OrgLimitCapsDefaultSelect>); -} & Omit; - }; -}, Error, CreateOrgLimitCapsDefaultInput["orgLimitCapsDefault"]>, "mutationFn">): UseMutationResult<{ - createOrgLimitCapsDefault: { - orgLimitCapsDefault: InferSelectResult; - }; -}, Error, CreateOrgLimitCapsDefaultInput["orgLimitCapsDefault"]>; -export function useCreateOrgLimitCapsDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgLimitCapsDefaultMutation( + params: { + selection: { + fields: S & OrgLimitCapsDefaultSelect; + } & HookStrictSelect, OrgLimitCapsDefaultSelect>; + } & Omit< + UseMutationOptions< + { + createOrgLimitCapsDefault: { + orgLimitCapsDefault: InferSelectResult; + }; + }, + Error, + CreateOrgLimitCapsDefaultInput['orgLimitCapsDefault'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgLimitCapsDefault: { + orgLimitCapsDefault: InferSelectResult; + }; + }, + Error, + CreateOrgLimitCapsDefaultInput['orgLimitCapsDefault'] +>; +export function useCreateOrgLimitCapsDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCapsDefaultMutationKeys.create(), - mutationFn: (data: CreateOrgLimitCapsDefaultInput["orgLimitCapsDefault"]) => getClient().orgLimitCapsDefault.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgLimitCapsDefaultInput['orgLimitCapsDefault']) => + getClient() + .orgLimitCapsDefault.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgLimitCapsDefaultKeys.lists() + queryKey: orgLimitCapsDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCreditMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCreditMutation.ts index 49c581e5ed..fc986c1249 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCreditMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitCreditMutation.ts @@ -4,62 +4,88 @@ * 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 { orgLimitCreditKeys } from "../query-keys"; -import { orgLimitCreditMutationKeys } from "../mutation-keys"; -import type { OrgLimitCreditSelect, OrgLimitCreditWithRelations, CreateOrgLimitCreditInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCreditSelect, OrgLimitCreditWithRelations, CreateOrgLimitCreditInput } from "../../orm/input-types"; +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 { orgLimitCreditKeys } from '../query-keys'; +import { orgLimitCreditMutationKeys } from '../mutation-keys'; +import type { + OrgLimitCreditSelect, + OrgLimitCreditWithRelations, + CreateOrgLimitCreditInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitCreditSelect, + OrgLimitCreditWithRelations, + CreateOrgLimitCreditInput, +} from '../../orm/input-types'; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgLimitCreditMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgLimitCreditMutation(params: { - selection: ({ - fields: S & OrgLimitCreditSelect; - } & HookStrictSelect, OrgLimitCreditSelect>); -} & Omit; - }; -}, Error, CreateOrgLimitCreditInput["orgLimitCredit"]>, "mutationFn">): UseMutationResult<{ - createOrgLimitCredit: { - orgLimitCredit: InferSelectResult; - }; -}, Error, CreateOrgLimitCreditInput["orgLimitCredit"]>; -export function useCreateOrgLimitCreditMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgLimitCreditMutation( + params: { + selection: { + fields: S & OrgLimitCreditSelect; + } & HookStrictSelect, OrgLimitCreditSelect>; + } & Omit< + UseMutationOptions< + { + createOrgLimitCredit: { + orgLimitCredit: InferSelectResult; + }; + }, + Error, + CreateOrgLimitCreditInput['orgLimitCredit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgLimitCredit: { + orgLimitCredit: InferSelectResult; + }; + }, + Error, + CreateOrgLimitCreditInput['orgLimitCredit'] +>; +export function useCreateOrgLimitCreditMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCreditMutationKeys.create(), - mutationFn: (data: CreateOrgLimitCreditInput["orgLimitCredit"]) => getClient().orgLimitCredit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgLimitCreditInput['orgLimitCredit']) => + getClient() + .orgLimitCredit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgLimitCreditKeys.lists() + queryKey: orgLimitCreditKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitDefaultMutation.ts index 7d86c0d0bf..42e50f62dd 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitDefaultMutation.ts @@ -4,62 +4,88 @@ * 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 { orgLimitDefaultKeys } from "../query-keys"; -import { orgLimitDefaultMutationKeys } from "../mutation-keys"; -import type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations, CreateOrgLimitDefaultInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations, CreateOrgLimitDefaultInput } from "../../orm/input-types"; +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 { orgLimitDefaultKeys } from '../query-keys'; +import { orgLimitDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgLimitDefaultSelect, + OrgLimitDefaultWithRelations, + CreateOrgLimitDefaultInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitDefaultSelect, + OrgLimitDefaultWithRelations, + CreateOrgLimitDefaultInput, +} from '../../orm/input-types'; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgLimitDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgLimitDefaultMutation(params: { - selection: ({ - fields: S & OrgLimitDefaultSelect; - } & HookStrictSelect, OrgLimitDefaultSelect>); -} & Omit; - }; -}, Error, CreateOrgLimitDefaultInput["orgLimitDefault"]>, "mutationFn">): UseMutationResult<{ - createOrgLimitDefault: { - orgLimitDefault: InferSelectResult; - }; -}, Error, CreateOrgLimitDefaultInput["orgLimitDefault"]>; -export function useCreateOrgLimitDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgLimitDefaultMutation( + params: { + selection: { + fields: S & OrgLimitDefaultSelect; + } & HookStrictSelect, OrgLimitDefaultSelect>; + } & Omit< + UseMutationOptions< + { + createOrgLimitDefault: { + orgLimitDefault: InferSelectResult; + }; + }, + Error, + CreateOrgLimitDefaultInput['orgLimitDefault'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgLimitDefault: { + orgLimitDefault: InferSelectResult; + }; + }, + Error, + CreateOrgLimitDefaultInput['orgLimitDefault'] +>; +export function useCreateOrgLimitDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitDefaultMutationKeys.create(), - mutationFn: (data: CreateOrgLimitDefaultInput["orgLimitDefault"]) => getClient().orgLimitDefault.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgLimitDefaultInput['orgLimitDefault']) => + getClient() + .orgLimitDefault.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgLimitDefaultKeys.lists() + queryKey: orgLimitDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitEventMutation.ts index 55becdce39..48f74d4a9e 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitEventMutation.ts @@ -4,62 +4,85 @@ * 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 { orgLimitEventKeys } from "../query-keys"; -import { orgLimitEventMutationKeys } from "../mutation-keys"; -import type { OrgLimitEventSelect, OrgLimitEventWithRelations, CreateOrgLimitEventInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitEventSelect, OrgLimitEventWithRelations, CreateOrgLimitEventInput } from "../../orm/input-types"; +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 { orgLimitEventKeys } from '../query-keys'; +import { orgLimitEventMutationKeys } from '../mutation-keys'; +import type { + OrgLimitEventSelect, + OrgLimitEventWithRelations, + CreateOrgLimitEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitEventSelect, + OrgLimitEventWithRelations, + CreateOrgLimitEventInput, +} from '../../orm/input-types'; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgLimitEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgLimitEventMutation(params: { - selection: ({ - fields: S & OrgLimitEventSelect; - } & HookStrictSelect, OrgLimitEventSelect>); -} & Omit; - }; -}, Error, CreateOrgLimitEventInput["orgLimitEvent"]>, "mutationFn">): UseMutationResult<{ - createOrgLimitEvent: { - orgLimitEvent: InferSelectResult; - }; -}, Error, CreateOrgLimitEventInput["orgLimitEvent"]>; -export function useCreateOrgLimitEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgLimitEventMutation( + params: { + selection: { + fields: S & OrgLimitEventSelect; + } & HookStrictSelect, OrgLimitEventSelect>; + } & Omit< + UseMutationOptions< + { + createOrgLimitEvent: { + orgLimitEvent: InferSelectResult; + }; + }, + Error, + CreateOrgLimitEventInput['orgLimitEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgLimitEvent: { + orgLimitEvent: InferSelectResult; + }; + }, + Error, + CreateOrgLimitEventInput['orgLimitEvent'] +>; +export function useCreateOrgLimitEventMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitEventMutationKeys.create(), - mutationFn: (data: CreateOrgLimitEventInput["orgLimitEvent"]) => getClient().orgLimitEvent.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgLimitEventInput['orgLimitEvent']) => + getClient() + .orgLimitEvent.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgLimitEventKeys.lists() + queryKey: orgLimitEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitMutation.ts index 30150d4a47..d284edca95 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitMutation.ts @@ -4,62 +4,85 @@ * 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 { orgLimitKeys } from "../query-keys"; -import { orgLimitMutationKeys } from "../mutation-keys"; -import type { OrgLimitSelect, OrgLimitWithRelations, CreateOrgLimitInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitSelect, OrgLimitWithRelations, CreateOrgLimitInput } from "../../orm/input-types"; +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 { orgLimitKeys } from '../query-keys'; +import { orgLimitMutationKeys } from '../mutation-keys'; +import type { + OrgLimitSelect, + OrgLimitWithRelations, + CreateOrgLimitInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitSelect, + OrgLimitWithRelations, + CreateOrgLimitInput, +} from '../../orm/input-types'; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgLimitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgLimitMutation(params: { - selection: ({ - fields: S & OrgLimitSelect; - } & HookStrictSelect, OrgLimitSelect>); -} & Omit; - }; -}, Error, CreateOrgLimitInput["orgLimit"]>, "mutationFn">): UseMutationResult<{ - createOrgLimit: { - orgLimit: InferSelectResult; - }; -}, Error, CreateOrgLimitInput["orgLimit"]>; -export function useCreateOrgLimitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgLimitMutation( + params: { + selection: { + fields: S & OrgLimitSelect; + } & HookStrictSelect, OrgLimitSelect>; + } & Omit< + UseMutationOptions< + { + createOrgLimit: { + orgLimit: InferSelectResult; + }; + }, + Error, + CreateOrgLimitInput['orgLimit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgLimit: { + orgLimit: InferSelectResult; + }; + }, + Error, + CreateOrgLimitInput['orgLimit'] +>; +export function useCreateOrgLimitMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitMutationKeys.create(), - mutationFn: (data: CreateOrgLimitInput["orgLimit"]) => getClient().orgLimit.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgLimitInput['orgLimit']) => + getClient() + .orgLimit.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgLimitKeys.lists() + queryKey: orgLimitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitWarningMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitWarningMutation.ts index 413e6f44d1..6ea71590d6 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitWarningMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useCreateOrgLimitWarningMutation.ts @@ -4,62 +4,88 @@ * 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 { orgLimitWarningKeys } from "../query-keys"; -import { orgLimitWarningMutationKeys } from "../mutation-keys"; -import type { OrgLimitWarningSelect, OrgLimitWarningWithRelations, CreateOrgLimitWarningInput } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitWarningSelect, OrgLimitWarningWithRelations, CreateOrgLimitWarningInput } from "../../orm/input-types"; +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 { orgLimitWarningKeys } from '../query-keys'; +import { orgLimitWarningMutationKeys } from '../mutation-keys'; +import type { + OrgLimitWarningSelect, + OrgLimitWarningWithRelations, + CreateOrgLimitWarningInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitWarningSelect, + OrgLimitWarningWithRelations, + CreateOrgLimitWarningInput, +} from '../../orm/input-types'; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { mutate, isPending } = useCreateOrgLimitWarningMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ name: 'New item' }); * ``` */ -export function useCreateOrgLimitWarningMutation(params: { - selection: ({ - fields: S & OrgLimitWarningSelect; - } & HookStrictSelect, OrgLimitWarningSelect>); -} & Omit; - }; -}, Error, CreateOrgLimitWarningInput["orgLimitWarning"]>, "mutationFn">): UseMutationResult<{ - createOrgLimitWarning: { - orgLimitWarning: InferSelectResult; - }; -}, Error, CreateOrgLimitWarningInput["orgLimitWarning"]>; -export function useCreateOrgLimitWarningMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useCreateOrgLimitWarningMutation( + params: { + selection: { + fields: S & OrgLimitWarningSelect; + } & HookStrictSelect, OrgLimitWarningSelect>; + } & Omit< + UseMutationOptions< + { + createOrgLimitWarning: { + orgLimitWarning: InferSelectResult; + }; + }, + Error, + CreateOrgLimitWarningInput['orgLimitWarning'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgLimitWarning: { + orgLimitWarning: InferSelectResult; + }; + }, + Error, + CreateOrgLimitWarningInput['orgLimitWarning'] +>; +export function useCreateOrgLimitWarningMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitWarningMutationKeys.create(), - mutationFn: (data: CreateOrgLimitWarningInput["orgLimitWarning"]) => getClient().orgLimitWarning.create({ - data, - select: args.select - }).unwrap(), + mutationFn: (data: CreateOrgLimitWarningInput['orgLimitWarning']) => + getClient() + .orgLimitWarning.create({ + data, + select: args.select, + }) + .unwrap(), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: orgLimitWarningKeys.lists() + queryKey: orgLimitWarningKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCapMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCapMutation.ts index 961460523f..0e569e8eab 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCapMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCapMutation.ts @@ -4,77 +4,95 @@ * 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 { appLimitCapKeys } from "../query-keys"; -import { appLimitCapMutationKeys } from "../mutation-keys"; -import type { AppLimitCapSelect, AppLimitCapWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapSelect, AppLimitCapWithRelations } from "../../orm/input-types"; +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 { appLimitCapKeys } from '../query-keys'; +import { appLimitCapMutationKeys } from '../mutation-keys'; +import type { AppLimitCapSelect, AppLimitCapWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitCapSelect, AppLimitCapWithRelations } from '../../orm/input-types'; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitCapMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitCapMutation(params: { - selection: ({ - fields: S & AppLimitCapSelect; - } & HookStrictSelect, AppLimitCapSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitCap: { - appLimitCap: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitCapMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitCapMutation( + params: { + selection: { + fields: S & AppLimitCapSelect; + } & HookStrictSelect, AppLimitCapSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitCap: { + appLimitCap: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitCap: { + appLimitCap: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitCapMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCapMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimitCap.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimitCap.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitCapKeys.detail(variables.id) + queryKey: appLimitCapKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCapKeys.lists() + queryKey: appLimitCapKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCapsDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCapsDefaultMutation.ts index 03a66200c9..ce11fa0780 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCapsDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCapsDefaultMutation.ts @@ -4,77 +4,101 @@ * 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 { appLimitCapsDefaultKeys } from "../query-keys"; -import { appLimitCapsDefaultMutationKeys } from "../mutation-keys"; -import type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations } from "../../orm/input-types"; +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 { appLimitCapsDefaultKeys } from '../query-keys'; +import { appLimitCapsDefaultMutationKeys } from '../mutation-keys'; +import type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, +} from '../../orm/input-types'; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitCapsDefaultMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitCapsDefaultMutation(params: { - selection: ({ - fields: S & AppLimitCapsDefaultSelect; - } & HookStrictSelect, AppLimitCapsDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitCapsDefault: { - appLimitCapsDefault: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitCapsDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitCapsDefaultMutation( + params: { + selection: { + fields: S & AppLimitCapsDefaultSelect; + } & HookStrictSelect, AppLimitCapsDefaultSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitCapsDefault: { + appLimitCapsDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitCapsDefault: { + appLimitCapsDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitCapsDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCapsDefaultMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimitCapsDefault.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimitCapsDefault.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitCapsDefaultKeys.detail(variables.id) + queryKey: appLimitCapsDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCapsDefaultKeys.lists() + queryKey: appLimitCapsDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditCodeItemMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditCodeItemMutation.ts index 5abe03fd0e..22f5ce1ad1 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditCodeItemMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditCodeItemMutation.ts @@ -4,77 +4,101 @@ * 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 { appLimitCreditCodeItemKeys } from "../query-keys"; -import { appLimitCreditCodeItemMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations } from "../../orm/input-types"; +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 { appLimitCreditCodeItemKeys } from '../query-keys'; +import { appLimitCreditCodeItemMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, +} from '../../orm/input-types'; /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitCreditCodeItemMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitCreditCodeItemMutation(params: { - selection: ({ - fields: S & AppLimitCreditCodeItemSelect; - } & HookStrictSelect, AppLimitCreditCodeItemSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitCreditCodeItem: { - appLimitCreditCodeItem: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitCreditCodeItemMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitCreditCodeItemMutation( + params: { + selection: { + fields: S & AppLimitCreditCodeItemSelect; + } & HookStrictSelect, AppLimitCreditCodeItemSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitCreditCodeItem: { + appLimitCreditCodeItem: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitCreditCodeItem: { + appLimitCreditCodeItem: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitCreditCodeItemMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditCodeItemMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimitCreditCodeItem.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimitCreditCodeItem.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitCreditCodeItemKeys.detail(variables.id) + queryKey: appLimitCreditCodeItemKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeItemKeys.lists() + queryKey: appLimitCreditCodeItemKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditCodeMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditCodeMutation.ts index bd908393e0..0d9e7d8351 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditCodeMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditCodeMutation.ts @@ -4,77 +4,101 @@ * 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 { appLimitCreditCodeKeys } from "../query-keys"; -import { appLimitCreditCodeMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations } from "../../orm/input-types"; +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 { appLimitCreditCodeKeys } from '../query-keys'; +import { appLimitCreditCodeMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, +} from '../../orm/input-types'; /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitCreditCodeMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitCreditCodeMutation(params: { - selection: ({ - fields: S & AppLimitCreditCodeSelect; - } & HookStrictSelect, AppLimitCreditCodeSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitCreditCode: { - appLimitCreditCode: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitCreditCodeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitCreditCodeMutation( + params: { + selection: { + fields: S & AppLimitCreditCodeSelect; + } & HookStrictSelect, AppLimitCreditCodeSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitCreditCode: { + appLimitCreditCode: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitCreditCode: { + appLimitCreditCode: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitCreditCodeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditCodeMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimitCreditCode.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimitCreditCode.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitCreditCodeKeys.detail(variables.id) + queryKey: appLimitCreditCodeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeKeys.lists() + queryKey: appLimitCreditCodeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditMutation.ts index 06ab19f6db..49998d5fc1 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditMutation.ts @@ -4,77 +4,95 @@ * 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 { appLimitCreditKeys } from "../query-keys"; -import { appLimitCreditMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditSelect, AppLimitCreditWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditSelect, AppLimitCreditWithRelations } from "../../orm/input-types"; +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 { appLimitCreditKeys } from '../query-keys'; +import { appLimitCreditMutationKeys } from '../mutation-keys'; +import type { AppLimitCreditSelect, AppLimitCreditWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitCreditSelect, AppLimitCreditWithRelations } from '../../orm/input-types'; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitCreditMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitCreditMutation(params: { - selection: ({ - fields: S & AppLimitCreditSelect; - } & HookStrictSelect, AppLimitCreditSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitCredit: { - appLimitCredit: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitCreditMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitCreditMutation( + params: { + selection: { + fields: S & AppLimitCreditSelect; + } & HookStrictSelect, AppLimitCreditSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitCredit: { + appLimitCredit: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitCredit: { + appLimitCredit: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitCreditMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimitCredit.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimitCredit.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitCreditKeys.detail(variables.id) + queryKey: appLimitCreditKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCreditKeys.lists() + queryKey: appLimitCreditKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditRedemptionMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditRedemptionMutation.ts index 44ac39330c..98cb4c2e0f 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditRedemptionMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitCreditRedemptionMutation.ts @@ -4,77 +4,101 @@ * 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 { appLimitCreditRedemptionKeys } from "../query-keys"; -import { appLimitCreditRedemptionMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations } from "../../orm/input-types"; +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 { appLimitCreditRedemptionKeys } from '../query-keys'; +import { appLimitCreditRedemptionMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, +} from '../../orm/input-types'; /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitCreditRedemptionMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitCreditRedemptionMutation(params: { - selection: ({ - fields: S & AppLimitCreditRedemptionSelect; - } & HookStrictSelect, AppLimitCreditRedemptionSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitCreditRedemption: { - appLimitCreditRedemption: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitCreditRedemptionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitCreditRedemptionMutation( + params: { + selection: { + fields: S & AppLimitCreditRedemptionSelect; + } & HookStrictSelect, AppLimitCreditRedemptionSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitCreditRedemption: { + appLimitCreditRedemption: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitCreditRedemption: { + appLimitCreditRedemption: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitCreditRedemptionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditRedemptionMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimitCreditRedemption.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimitCreditRedemption.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitCreditRedemptionKeys.detail(variables.id) + queryKey: appLimitCreditRedemptionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCreditRedemptionKeys.lists() + queryKey: appLimitCreditRedemptionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitDefaultMutation.ts index fe4a860f32..d248f2be24 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitDefaultMutation.ts @@ -4,77 +4,95 @@ * 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 { appLimitDefaultKeys } from "../query-keys"; -import { appLimitDefaultMutationKeys } from "../mutation-keys"; -import type { AppLimitDefaultSelect, AppLimitDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitDefaultSelect, AppLimitDefaultWithRelations } from "../../orm/input-types"; +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 { appLimitDefaultKeys } from '../query-keys'; +import { appLimitDefaultMutationKeys } from '../mutation-keys'; +import type { AppLimitDefaultSelect, AppLimitDefaultWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitDefaultSelect, AppLimitDefaultWithRelations } from '../../orm/input-types'; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitDefaultMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitDefaultMutation(params: { - selection: ({ - fields: S & AppLimitDefaultSelect; - } & HookStrictSelect, AppLimitDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitDefault: { - appLimitDefault: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitDefaultMutation( + params: { + selection: { + fields: S & AppLimitDefaultSelect; + } & HookStrictSelect, AppLimitDefaultSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitDefault: { + appLimitDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitDefault: { + appLimitDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitDefaultMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimitDefault.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimitDefault.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitDefaultKeys.detail(variables.id) + queryKey: appLimitDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitDefaultKeys.lists() + queryKey: appLimitDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitEventMutation.ts index 68ab8e1629..ef8b20c631 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitEventMutation.ts @@ -4,83 +4,99 @@ * 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 { appLimitEventKeys } from "../query-keys"; -import { appLimitEventMutationKeys } from "../mutation-keys"; -import type { AppLimitEventSelect, AppLimitEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitEventSelect, AppLimitEventWithRelations } from "../../orm/input-types"; +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 { appLimitEventKeys } from '../query-keys'; +import { appLimitEventMutationKeys } from '../mutation-keys'; +import type { AppLimitEventSelect, AppLimitEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitEventSelect, AppLimitEventWithRelations } from '../../orm/input-types'; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitEventMutation(params: { - selection: ({ - fields: S & AppLimitEventSelect; - } & HookStrictSelect, AppLimitEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitEvent: { - appLimitEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteAppLimitEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitEventMutation( + params: { + selection: { + fields: S & AppLimitEventSelect; + } & HookStrictSelect, AppLimitEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitEvent: { + appLimitEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitEvent: { + appLimitEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteAppLimitEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().appLimitEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .appLimitEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitEventKeys.detail(variables.id) + queryKey: appLimitEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitEventKeys.lists() + queryKey: appLimitEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitMutation.ts index c4f4dbb519..42ca8b532f 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitMutation.ts @@ -4,77 +4,95 @@ * 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 { appLimitKeys } from "../query-keys"; -import { appLimitMutationKeys } from "../mutation-keys"; -import type { AppLimitSelect, AppLimitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitSelect, AppLimitWithRelations } from "../../orm/input-types"; +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 { appLimitKeys } from '../query-keys'; +import { appLimitMutationKeys } from '../mutation-keys'; +import type { AppLimitSelect, AppLimitWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitSelect, AppLimitWithRelations } from '../../orm/input-types'; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitMutation(params: { - selection: ({ - fields: S & AppLimitSelect; - } & HookStrictSelect, AppLimitSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimit: { - appLimit: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitMutation( + params: { + selection: { + fields: S & AppLimitSelect; + } & HookStrictSelect, AppLimitSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimit: { + appLimit: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimit: { + appLimit: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimit.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimit.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitKeys.detail(variables.id) + queryKey: appLimitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitKeys.lists() + queryKey: appLimitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitWarningMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitWarningMutation.ts index 98ce98e23a..d3339d24bf 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitWarningMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitWarningMutation.ts @@ -4,77 +4,95 @@ * 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 { appLimitWarningKeys } from "../query-keys"; -import { appLimitWarningMutationKeys } from "../mutation-keys"; -import type { AppLimitWarningSelect, AppLimitWarningWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitWarningSelect, AppLimitWarningWithRelations } from "../../orm/input-types"; +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 { appLimitWarningKeys } from '../query-keys'; +import { appLimitWarningMutationKeys } from '../mutation-keys'; +import type { AppLimitWarningSelect, AppLimitWarningWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitWarningSelect, AppLimitWarningWithRelations } from '../../orm/input-types'; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteAppLimitWarningMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteAppLimitWarningMutation(params: { - selection: ({ - fields: S & AppLimitWarningSelect; - } & HookStrictSelect, AppLimitWarningSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteAppLimitWarning: { - appLimitWarning: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteAppLimitWarningMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteAppLimitWarningMutation( + params: { + selection: { + fields: S & AppLimitWarningSelect; + } & HookStrictSelect, AppLimitWarningSelect>; + } & Omit< + UseMutationOptions< + { + deleteAppLimitWarning: { + appLimitWarning: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteAppLimitWarning: { + appLimitWarning: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteAppLimitWarningMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitWarningMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().appLimitWarning.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .appLimitWarning.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: appLimitWarningKeys.detail(variables.id) + queryKey: appLimitWarningKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitWarningKeys.lists() + queryKey: appLimitWarningKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitAggregateMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitAggregateMutation.ts index 7d55a7dede..a946d49dec 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitAggregateMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitAggregateMutation.ts @@ -4,77 +4,101 @@ * 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 { orgLimitAggregateKeys } from "../query-keys"; -import { orgLimitAggregateMutationKeys } from "../mutation-keys"; -import type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations } from "../../orm/input-types"; +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 { orgLimitAggregateKeys } from '../query-keys'; +import { orgLimitAggregateMutationKeys } from '../mutation-keys'; +import type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, +} from '../../orm/input-types'; /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgLimitAggregateMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgLimitAggregateMutation(params: { - selection: ({ - fields: S & OrgLimitAggregateSelect; - } & HookStrictSelect, OrgLimitAggregateSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgLimitAggregate: { - orgLimitAggregate: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgLimitAggregateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgLimitAggregateMutation( + params: { + selection: { + fields: S & OrgLimitAggregateSelect; + } & HookStrictSelect, OrgLimitAggregateSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgLimitAggregate: { + orgLimitAggregate: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgLimitAggregate: { + orgLimitAggregate: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgLimitAggregateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitAggregateMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgLimitAggregate.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgLimitAggregate.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgLimitAggregateKeys.detail(variables.id) + queryKey: orgLimitAggregateKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitAggregateKeys.lists() + queryKey: orgLimitAggregateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCapMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCapMutation.ts index 6ffe461f28..83d7ac5981 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCapMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCapMutation.ts @@ -4,77 +4,95 @@ * 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 { orgLimitCapKeys } from "../query-keys"; -import { orgLimitCapMutationKeys } from "../mutation-keys"; -import type { OrgLimitCapSelect, OrgLimitCapWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapSelect, OrgLimitCapWithRelations } from "../../orm/input-types"; +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 { orgLimitCapKeys } from '../query-keys'; +import { orgLimitCapMutationKeys } from '../mutation-keys'; +import type { OrgLimitCapSelect, OrgLimitCapWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitCapSelect, OrgLimitCapWithRelations } from '../../orm/input-types'; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgLimitCapMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgLimitCapMutation(params: { - selection: ({ - fields: S & OrgLimitCapSelect; - } & HookStrictSelect, OrgLimitCapSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgLimitCap: { - orgLimitCap: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgLimitCapMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgLimitCapMutation( + params: { + selection: { + fields: S & OrgLimitCapSelect; + } & HookStrictSelect, OrgLimitCapSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgLimitCap: { + orgLimitCap: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgLimitCap: { + orgLimitCap: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgLimitCapMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCapMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgLimitCap.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgLimitCap.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgLimitCapKeys.detail(variables.id) + queryKey: orgLimitCapKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitCapKeys.lists() + queryKey: orgLimitCapKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCapsDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCapsDefaultMutation.ts index 3d5a5226c5..f1d705fc26 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCapsDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCapsDefaultMutation.ts @@ -4,77 +4,101 @@ * 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 { orgLimitCapsDefaultKeys } from "../query-keys"; -import { orgLimitCapsDefaultMutationKeys } from "../mutation-keys"; -import type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations } from "../../orm/input-types"; +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 { orgLimitCapsDefaultKeys } from '../query-keys'; +import { orgLimitCapsDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, +} from '../../orm/input-types'; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgLimitCapsDefaultMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgLimitCapsDefaultMutation(params: { - selection: ({ - fields: S & OrgLimitCapsDefaultSelect; - } & HookStrictSelect, OrgLimitCapsDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgLimitCapsDefault: { - orgLimitCapsDefault: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgLimitCapsDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgLimitCapsDefaultMutation( + params: { + selection: { + fields: S & OrgLimitCapsDefaultSelect; + } & HookStrictSelect, OrgLimitCapsDefaultSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgLimitCapsDefault: { + orgLimitCapsDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgLimitCapsDefault: { + orgLimitCapsDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgLimitCapsDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCapsDefaultMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgLimitCapsDefault.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgLimitCapsDefault.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgLimitCapsDefaultKeys.detail(variables.id) + queryKey: orgLimitCapsDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitCapsDefaultKeys.lists() + queryKey: orgLimitCapsDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCreditMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCreditMutation.ts index f2bc36eb8a..339bba9bd1 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCreditMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitCreditMutation.ts @@ -4,77 +4,95 @@ * 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 { orgLimitCreditKeys } from "../query-keys"; -import { orgLimitCreditMutationKeys } from "../mutation-keys"; -import type { OrgLimitCreditSelect, OrgLimitCreditWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCreditSelect, OrgLimitCreditWithRelations } from "../../orm/input-types"; +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 { orgLimitCreditKeys } from '../query-keys'; +import { orgLimitCreditMutationKeys } from '../mutation-keys'; +import type { OrgLimitCreditSelect, OrgLimitCreditWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitCreditSelect, OrgLimitCreditWithRelations } from '../../orm/input-types'; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgLimitCreditMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgLimitCreditMutation(params: { - selection: ({ - fields: S & OrgLimitCreditSelect; - } & HookStrictSelect, OrgLimitCreditSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgLimitCredit: { - orgLimitCredit: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgLimitCreditMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgLimitCreditMutation( + params: { + selection: { + fields: S & OrgLimitCreditSelect; + } & HookStrictSelect, OrgLimitCreditSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgLimitCredit: { + orgLimitCredit: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgLimitCredit: { + orgLimitCredit: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgLimitCreditMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCreditMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgLimitCredit.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgLimitCredit.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgLimitCreditKeys.detail(variables.id) + queryKey: orgLimitCreditKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitCreditKeys.lists() + queryKey: orgLimitCreditKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitDefaultMutation.ts index aafedd78fb..b7614b66f3 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitDefaultMutation.ts @@ -4,77 +4,95 @@ * 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 { orgLimitDefaultKeys } from "../query-keys"; -import { orgLimitDefaultMutationKeys } from "../mutation-keys"; -import type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations } from "../../orm/input-types"; +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 { orgLimitDefaultKeys } from '../query-keys'; +import { orgLimitDefaultMutationKeys } from '../mutation-keys'; +import type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations } from '../../orm/input-types'; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgLimitDefaultMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgLimitDefaultMutation(params: { - selection: ({ - fields: S & OrgLimitDefaultSelect; - } & HookStrictSelect, OrgLimitDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgLimitDefault: { - orgLimitDefault: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgLimitDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgLimitDefaultMutation( + params: { + selection: { + fields: S & OrgLimitDefaultSelect; + } & HookStrictSelect, OrgLimitDefaultSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgLimitDefault: { + orgLimitDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgLimitDefault: { + orgLimitDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgLimitDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitDefaultMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgLimitDefault.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgLimitDefault.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgLimitDefaultKeys.detail(variables.id) + queryKey: orgLimitDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitDefaultKeys.lists() + queryKey: orgLimitDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitEventMutation.ts index 687b3262d8..1ef998e5e2 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitEventMutation.ts @@ -4,83 +4,99 @@ * 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 { orgLimitEventKeys } from "../query-keys"; -import { orgLimitEventMutationKeys } from "../mutation-keys"; -import type { OrgLimitEventSelect, OrgLimitEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitEventSelect, OrgLimitEventWithRelations } from "../../orm/input-types"; +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 { orgLimitEventKeys } from '../query-keys'; +import { orgLimitEventMutationKeys } from '../mutation-keys'; +import type { OrgLimitEventSelect, OrgLimitEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitEventSelect, OrgLimitEventWithRelations } from '../../orm/input-types'; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgLimitEventMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgLimitEventMutation(params: { - selection: ({ - fields: S & OrgLimitEventSelect; - } & HookStrictSelect, OrgLimitEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgLimitEvent: { - orgLimitEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; -}>; -export function useDeleteOrgLimitEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgLimitEventMutation( + params: { + selection: { + fields: S & OrgLimitEventSelect; + } & HookStrictSelect, OrgLimitEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgLimitEvent: { + orgLimitEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgLimitEvent: { + orgLimitEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteOrgLimitEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitEventMutationKeys.all, - mutationFn: ({ - id, - createdAt - }: { - id: string; - createdAt: string; - }) => getClient().orgLimitEvent.delete({ - where: { - id, - createdAt - }, - select: args.select - }).unwrap(), + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .orgLimitEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgLimitEventKeys.detail(variables.id) + queryKey: orgLimitEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitEventKeys.lists() + queryKey: orgLimitEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitMutation.ts index 2b0d47f395..340ecce1fc 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitMutation.ts @@ -4,77 +4,95 @@ * 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 { orgLimitKeys } from "../query-keys"; -import { orgLimitMutationKeys } from "../mutation-keys"; -import type { OrgLimitSelect, OrgLimitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitSelect, OrgLimitWithRelations } from "../../orm/input-types"; +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 { orgLimitKeys } from '../query-keys'; +import { orgLimitMutationKeys } from '../mutation-keys'; +import type { OrgLimitSelect, OrgLimitWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitSelect, OrgLimitWithRelations } from '../../orm/input-types'; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgLimitMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgLimitMutation(params: { - selection: ({ - fields: S & OrgLimitSelect; - } & HookStrictSelect, OrgLimitSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgLimit: { - orgLimit: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgLimitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgLimitMutation( + params: { + selection: { + fields: S & OrgLimitSelect; + } & HookStrictSelect, OrgLimitSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgLimit: { + orgLimit: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgLimit: { + orgLimit: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgLimitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgLimit.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgLimit.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgLimitKeys.detail(variables.id) + queryKey: orgLimitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitKeys.lists() + queryKey: orgLimitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitWarningMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitWarningMutation.ts index d44e4c6283..e0f7517a00 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitWarningMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitWarningMutation.ts @@ -4,77 +4,95 @@ * 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 { orgLimitWarningKeys } from "../query-keys"; -import { orgLimitWarningMutationKeys } from "../mutation-keys"; -import type { OrgLimitWarningSelect, OrgLimitWarningWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitWarningSelect, OrgLimitWarningWithRelations } from "../../orm/input-types"; +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 { orgLimitWarningKeys } from '../query-keys'; +import { orgLimitWarningMutationKeys } from '../mutation-keys'; +import type { OrgLimitWarningSelect, OrgLimitWarningWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitWarningSelect, OrgLimitWarningWithRelations } from '../../orm/input-types'; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { mutate, isPending } = useDeleteOrgLimitWarningMutation({ * selection: { fields: { id: true } }, * }); - * + * * mutate({ id: 'value-to-delete' }); * ``` */ -export function useDeleteOrgLimitWarningMutation(params: { - selection: ({ - fields: S & OrgLimitWarningSelect; - } & HookStrictSelect, OrgLimitWarningSelect>); -} & Omit; - }; -}, Error, { - id: string; -}>, "mutationFn">): UseMutationResult<{ - deleteOrgLimitWarning: { - orgLimitWarning: InferSelectResult; - }; -}, Error, { - id: string; -}>; -export function useDeleteOrgLimitWarningMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useDeleteOrgLimitWarningMutation( + params: { + selection: { + fields: S & OrgLimitWarningSelect; + } & HookStrictSelect, OrgLimitWarningSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgLimitWarning: { + orgLimitWarning: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgLimitWarning: { + orgLimitWarning: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteOrgLimitWarningMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitWarningMutationKeys.all, - mutationFn: ({ - id - }: { - id: string; - }) => getClient().orgLimitWarning.delete({ - where: { - id - }, - select: args.select - }).unwrap(), + mutationFn: ({ id }: { id: string }) => + getClient() + .orgLimitWarning.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.removeQueries({ - queryKey: orgLimitWarningKeys.detail(variables.id) + queryKey: orgLimitWarningKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitWarningKeys.lists() + queryKey: orgLimitWarningKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useProvisionBucketMutation.ts index 8c686cb940..2613680e69 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useProvisionBucketMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useProvisionBucketMutation.ts @@ -4,39 +4,52 @@ * DO NOT EDIT - changes will be overwritten */ -import { useMutation } from "@tanstack/react-query"; -import type { UseMutationOptions, UseMutationResult } from "@tanstack/react-query"; -import { getClient } from "../client"; -import { buildSelectionArgs } from "../selection"; -import type { SelectionConfig } from "../selection"; -import { customMutationKeys } from "../mutation-keys"; -import type { ProvisionBucketVariables } from "../../orm/mutation"; -import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { ProvisionBucketVariables } from "../../orm/mutation"; -export type { ProvisionBucketPayloadSelect } from "../../orm/input-types"; -export function useProvisionBucketMutation(params: { - selection: ({ - fields: S & ProvisionBucketPayloadSelect; - } & HookStrictSelect, ProvisionBucketPayloadSelect>); -} & Omit | null; -}, Error, ProvisionBucketVariables>, "mutationFn">): UseMutationResult<{ - provisionBucket: InferSelectResult | null; -}, Error, ProvisionBucketVariables> { +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.provisionBucket(), - mutationFn: (variables: ProvisionBucketVariables) => getClient().mutation.provisionBucket(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useSeedAppLimitCapsDefaultsMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useSeedAppLimitCapsDefaultsMutation.ts index c34bf096dc..8f9efce4e0 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useSeedAppLimitCapsDefaultsMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useSeedAppLimitCapsDefaultsMutation.ts @@ -4,39 +4,57 @@ * 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 { SeedAppLimitCapsDefaultsVariables } from "../../orm/mutation"; -import type { SeedAppLimitCapsDefaultsPayloadSelect, SeedAppLimitCapsDefaultsPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SeedAppLimitCapsDefaultsVariables } from "../../orm/mutation"; -export type { SeedAppLimitCapsDefaultsPayloadSelect } from "../../orm/input-types"; -export function useSeedAppLimitCapsDefaultsMutation(params: { - selection: ({ - fields: S & SeedAppLimitCapsDefaultsPayloadSelect; - } & HookStrictSelect, SeedAppLimitCapsDefaultsPayloadSelect>); -} & Omit | null; -}, Error, SeedAppLimitCapsDefaultsVariables>, "mutationFn">): UseMutationResult<{ - seedAppLimitCapsDefaults: InferSelectResult | null; -}, Error, SeedAppLimitCapsDefaultsVariables> { +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 { SeedAppLimitCapsDefaultsVariables } from '../../orm/mutation'; +import type { + SeedAppLimitCapsDefaultsPayloadSelect, + SeedAppLimitCapsDefaultsPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SeedAppLimitCapsDefaultsVariables } from '../../orm/mutation'; +export type { SeedAppLimitCapsDefaultsPayloadSelect } from '../../orm/input-types'; +export function useSeedAppLimitCapsDefaultsMutation< + S extends SeedAppLimitCapsDefaultsPayloadSelect, +>( + params: { + selection: { + fields: S & SeedAppLimitCapsDefaultsPayloadSelect; + } & HookStrictSelect, SeedAppLimitCapsDefaultsPayloadSelect>; + } & Omit< + UseMutationOptions< + { + seedAppLimitCapsDefaults: InferSelectResult | null; + }, + Error, + SeedAppLimitCapsDefaultsVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + seedAppLimitCapsDefaults: InferSelectResult | null; + }, + Error, + SeedAppLimitCapsDefaultsVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.seedAppLimitCapsDefaults(), - mutationFn: (variables: SeedAppLimitCapsDefaultsVariables) => getClient().mutation.seedAppLimitCapsDefaults(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SeedAppLimitCapsDefaultsVariables) => + getClient() + .mutation.seedAppLimitCapsDefaults(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useSeedAppLimitDefaultsMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useSeedAppLimitDefaultsMutation.ts index a63186268f..cd19a46885 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useSeedAppLimitDefaultsMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useSeedAppLimitDefaultsMutation.ts @@ -4,39 +4,55 @@ * 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 { SeedAppLimitDefaultsVariables } from "../../orm/mutation"; -import type { SeedAppLimitDefaultsPayloadSelect, SeedAppLimitDefaultsPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SeedAppLimitDefaultsVariables } from "../../orm/mutation"; -export type { SeedAppLimitDefaultsPayloadSelect } from "../../orm/input-types"; -export function useSeedAppLimitDefaultsMutation(params: { - selection: ({ - fields: S & SeedAppLimitDefaultsPayloadSelect; - } & HookStrictSelect, SeedAppLimitDefaultsPayloadSelect>); -} & Omit | null; -}, Error, SeedAppLimitDefaultsVariables>, "mutationFn">): UseMutationResult<{ - seedAppLimitDefaults: InferSelectResult | null; -}, Error, SeedAppLimitDefaultsVariables> { +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 { SeedAppLimitDefaultsVariables } from '../../orm/mutation'; +import type { + SeedAppLimitDefaultsPayloadSelect, + SeedAppLimitDefaultsPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SeedAppLimitDefaultsVariables } from '../../orm/mutation'; +export type { SeedAppLimitDefaultsPayloadSelect } from '../../orm/input-types'; +export function useSeedAppLimitDefaultsMutation( + params: { + selection: { + fields: S & SeedAppLimitDefaultsPayloadSelect; + } & HookStrictSelect, SeedAppLimitDefaultsPayloadSelect>; + } & Omit< + UseMutationOptions< + { + seedAppLimitDefaults: InferSelectResult | null; + }, + Error, + SeedAppLimitDefaultsVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + seedAppLimitDefaults: InferSelectResult | null; + }, + Error, + SeedAppLimitDefaultsVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.seedAppLimitDefaults(), - mutationFn: (variables: SeedAppLimitDefaultsVariables) => getClient().mutation.seedAppLimitDefaults(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SeedAppLimitDefaultsVariables) => + getClient() + .mutation.seedAppLimitDefaults(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useSeedOrgLimitCapsDefaultsMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useSeedOrgLimitCapsDefaultsMutation.ts index aa2b5dd49a..708376b59a 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useSeedOrgLimitCapsDefaultsMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useSeedOrgLimitCapsDefaultsMutation.ts @@ -4,39 +4,57 @@ * 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 { SeedOrgLimitCapsDefaultsVariables } from "../../orm/mutation"; -import type { SeedOrgLimitCapsDefaultsPayloadSelect, SeedOrgLimitCapsDefaultsPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SeedOrgLimitCapsDefaultsVariables } from "../../orm/mutation"; -export type { SeedOrgLimitCapsDefaultsPayloadSelect } from "../../orm/input-types"; -export function useSeedOrgLimitCapsDefaultsMutation(params: { - selection: ({ - fields: S & SeedOrgLimitCapsDefaultsPayloadSelect; - } & HookStrictSelect, SeedOrgLimitCapsDefaultsPayloadSelect>); -} & Omit | null; -}, Error, SeedOrgLimitCapsDefaultsVariables>, "mutationFn">): UseMutationResult<{ - seedOrgLimitCapsDefaults: InferSelectResult | null; -}, Error, SeedOrgLimitCapsDefaultsVariables> { +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 { SeedOrgLimitCapsDefaultsVariables } from '../../orm/mutation'; +import type { + SeedOrgLimitCapsDefaultsPayloadSelect, + SeedOrgLimitCapsDefaultsPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SeedOrgLimitCapsDefaultsVariables } from '../../orm/mutation'; +export type { SeedOrgLimitCapsDefaultsPayloadSelect } from '../../orm/input-types'; +export function useSeedOrgLimitCapsDefaultsMutation< + S extends SeedOrgLimitCapsDefaultsPayloadSelect, +>( + params: { + selection: { + fields: S & SeedOrgLimitCapsDefaultsPayloadSelect; + } & HookStrictSelect, SeedOrgLimitCapsDefaultsPayloadSelect>; + } & Omit< + UseMutationOptions< + { + seedOrgLimitCapsDefaults: InferSelectResult | null; + }, + Error, + SeedOrgLimitCapsDefaultsVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + seedOrgLimitCapsDefaults: InferSelectResult | null; + }, + Error, + SeedOrgLimitCapsDefaultsVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.seedOrgLimitCapsDefaults(), - mutationFn: (variables: SeedOrgLimitCapsDefaultsVariables) => getClient().mutation.seedOrgLimitCapsDefaults(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SeedOrgLimitCapsDefaultsVariables) => + getClient() + .mutation.seedOrgLimitCapsDefaults(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useSeedOrgLimitDefaultsMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useSeedOrgLimitDefaultsMutation.ts index 82fcf5bc0a..ca4003a6cb 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useSeedOrgLimitDefaultsMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useSeedOrgLimitDefaultsMutation.ts @@ -4,39 +4,55 @@ * 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 { SeedOrgLimitDefaultsVariables } from "../../orm/mutation"; -import type { SeedOrgLimitDefaultsPayloadSelect, SeedOrgLimitDefaultsPayload } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect, StrictSelect } from "../../orm/select-types"; -export type { SeedOrgLimitDefaultsVariables } from "../../orm/mutation"; -export type { SeedOrgLimitDefaultsPayloadSelect } from "../../orm/input-types"; -export function useSeedOrgLimitDefaultsMutation(params: { - selection: ({ - fields: S & SeedOrgLimitDefaultsPayloadSelect; - } & HookStrictSelect, SeedOrgLimitDefaultsPayloadSelect>); -} & Omit | null; -}, Error, SeedOrgLimitDefaultsVariables>, "mutationFn">): UseMutationResult<{ - seedOrgLimitDefaults: InferSelectResult | null; -}, Error, SeedOrgLimitDefaultsVariables> { +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 { SeedOrgLimitDefaultsVariables } from '../../orm/mutation'; +import type { + SeedOrgLimitDefaultsPayloadSelect, + SeedOrgLimitDefaultsPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SeedOrgLimitDefaultsVariables } from '../../orm/mutation'; +export type { SeedOrgLimitDefaultsPayloadSelect } from '../../orm/input-types'; +export function useSeedOrgLimitDefaultsMutation( + params: { + selection: { + fields: S & SeedOrgLimitDefaultsPayloadSelect; + } & HookStrictSelect, SeedOrgLimitDefaultsPayloadSelect>; + } & Omit< + UseMutationOptions< + { + seedOrgLimitDefaults: InferSelectResult | null; + }, + Error, + SeedOrgLimitDefaultsVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + seedOrgLimitDefaults: InferSelectResult | null; + }, + Error, + SeedOrgLimitDefaultsVariables +> { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.seedOrgLimitDefaults(), - mutationFn: (variables: SeedOrgLimitDefaultsVariables) => getClient().mutation.seedOrgLimitDefaults(variables, { - select: args.select - } as { - select: S; - } & StrictSelect).unwrap(), - ...mutationOptions + mutationFn: (variables: SeedOrgLimitDefaultsVariables) => + getClient() + .mutation.seedOrgLimitDefaults(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCapMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCapMutation.ts index 240267b2e8..965a602809 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCapMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCapMutation.ts @@ -4,83 +4,107 @@ * 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 { appLimitCapKeys } from "../query-keys"; -import { appLimitCapMutationKeys } from "../mutation-keys"; -import type { AppLimitCapSelect, AppLimitCapWithRelations, AppLimitCapPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapSelect, AppLimitCapWithRelations, AppLimitCapPatch } from "../../orm/input-types"; +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 { appLimitCapKeys } from '../query-keys'; +import { appLimitCapMutationKeys } from '../mutation-keys'; +import type { + AppLimitCapSelect, + AppLimitCapWithRelations, + AppLimitCapPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCapSelect, + AppLimitCapWithRelations, + AppLimitCapPatch, +} from '../../orm/input-types'; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitCapMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitCapPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitCapMutation(params: { - selection: ({ - fields: S & AppLimitCapSelect; - } & HookStrictSelect, AppLimitCapSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitCapPatch: AppLimitCapPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitCap: { - appLimitCap: InferSelectResult; - }; -}, Error, { - id: string; - appLimitCapPatch: AppLimitCapPatch; -}>; -export function useUpdateAppLimitCapMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitCapMutation( + params: { + selection: { + fields: S & AppLimitCapSelect; + } & HookStrictSelect, AppLimitCapSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitCap: { + appLimitCap: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCapPatch: AppLimitCapPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitCap: { + appLimitCap: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCapPatch: AppLimitCapPatch; + } +>; +export function useUpdateAppLimitCapMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitCapPatch: AppLimitCapPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCapMutationKeys.all, - mutationFn: ({ - id, - appLimitCapPatch - }: { - id: string; - appLimitCapPatch: AppLimitCapPatch; - }) => getClient().appLimitCap.update({ - where: { - id - }, - data: appLimitCapPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, appLimitCapPatch }: { id: string; appLimitCapPatch: AppLimitCapPatch }) => + getClient() + .appLimitCap.update({ + where: { + id, + }, + data: appLimitCapPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitCapKeys.detail(variables.id) + queryKey: appLimitCapKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCapKeys.lists() + queryKey: appLimitCapKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCapsDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCapsDefaultMutation.ts index da9bd074b8..f881cbfa93 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCapsDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCapsDefaultMutation.ts @@ -4,83 +4,113 @@ * 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 { appLimitCapsDefaultKeys } from "../query-keys"; -import { appLimitCapsDefaultMutationKeys } from "../mutation-keys"; -import type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations, AppLimitCapsDefaultPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations, AppLimitCapsDefaultPatch } from "../../orm/input-types"; +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 { appLimitCapsDefaultKeys } from '../query-keys'; +import { appLimitCapsDefaultMutationKeys } from '../mutation-keys'; +import type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, + AppLimitCapsDefaultPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, + AppLimitCapsDefaultPatch, +} from '../../orm/input-types'; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitCapsDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitCapsDefaultPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitCapsDefaultMutation(params: { - selection: ({ - fields: S & AppLimitCapsDefaultSelect; - } & HookStrictSelect, AppLimitCapsDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitCapsDefaultPatch: AppLimitCapsDefaultPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitCapsDefault: { - appLimitCapsDefault: InferSelectResult; - }; -}, Error, { - id: string; - appLimitCapsDefaultPatch: AppLimitCapsDefaultPatch; -}>; -export function useUpdateAppLimitCapsDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitCapsDefaultMutation( + params: { + selection: { + fields: S & AppLimitCapsDefaultSelect; + } & HookStrictSelect, AppLimitCapsDefaultSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitCapsDefault: { + appLimitCapsDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCapsDefaultPatch: AppLimitCapsDefaultPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitCapsDefault: { + appLimitCapsDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCapsDefaultPatch: AppLimitCapsDefaultPatch; + } +>; +export function useUpdateAppLimitCapsDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitCapsDefaultPatch: AppLimitCapsDefaultPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCapsDefaultMutationKeys.all, mutationFn: ({ id, - appLimitCapsDefaultPatch + appLimitCapsDefaultPatch, }: { id: string; appLimitCapsDefaultPatch: AppLimitCapsDefaultPatch; - }) => getClient().appLimitCapsDefault.update({ - where: { - id - }, - data: appLimitCapsDefaultPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appLimitCapsDefault.update({ + where: { + id, + }, + data: appLimitCapsDefaultPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitCapsDefaultKeys.detail(variables.id) + queryKey: appLimitCapsDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCapsDefaultKeys.lists() + queryKey: appLimitCapsDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditCodeItemMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditCodeItemMutation.ts index 559329220c..fc06f90591 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditCodeItemMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditCodeItemMutation.ts @@ -4,83 +4,113 @@ * 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 { appLimitCreditCodeItemKeys } from "../query-keys"; -import { appLimitCreditCodeItemMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations, AppLimitCreditCodeItemPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations, AppLimitCreditCodeItemPatch } from "../../orm/input-types"; +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 { appLimitCreditCodeItemKeys } from '../query-keys'; +import { appLimitCreditCodeItemMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, + AppLimitCreditCodeItemPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, + AppLimitCreditCodeItemPatch, +} from '../../orm/input-types'; /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitCreditCodeItemMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitCreditCodeItemPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitCreditCodeItemMutation(params: { - selection: ({ - fields: S & AppLimitCreditCodeItemSelect; - } & HookStrictSelect, AppLimitCreditCodeItemSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitCreditCodeItemPatch: AppLimitCreditCodeItemPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitCreditCodeItem: { - appLimitCreditCodeItem: InferSelectResult; - }; -}, Error, { - id: string; - appLimitCreditCodeItemPatch: AppLimitCreditCodeItemPatch; -}>; -export function useUpdateAppLimitCreditCodeItemMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitCreditCodeItemMutation( + params: { + selection: { + fields: S & AppLimitCreditCodeItemSelect; + } & HookStrictSelect, AppLimitCreditCodeItemSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitCreditCodeItem: { + appLimitCreditCodeItem: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCreditCodeItemPatch: AppLimitCreditCodeItemPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitCreditCodeItem: { + appLimitCreditCodeItem: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCreditCodeItemPatch: AppLimitCreditCodeItemPatch; + } +>; +export function useUpdateAppLimitCreditCodeItemMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitCreditCodeItemPatch: AppLimitCreditCodeItemPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditCodeItemMutationKeys.all, mutationFn: ({ id, - appLimitCreditCodeItemPatch + appLimitCreditCodeItemPatch, }: { id: string; appLimitCreditCodeItemPatch: AppLimitCreditCodeItemPatch; - }) => getClient().appLimitCreditCodeItem.update({ - where: { - id - }, - data: appLimitCreditCodeItemPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appLimitCreditCodeItem.update({ + where: { + id, + }, + data: appLimitCreditCodeItemPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeItemKeys.detail(variables.id) + queryKey: appLimitCreditCodeItemKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeItemKeys.lists() + queryKey: appLimitCreditCodeItemKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditCodeMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditCodeMutation.ts index 734e923e3a..2fcf15adf6 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditCodeMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditCodeMutation.ts @@ -4,83 +4,113 @@ * 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 { appLimitCreditCodeKeys } from "../query-keys"; -import { appLimitCreditCodeMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations, AppLimitCreditCodePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations, AppLimitCreditCodePatch } from "../../orm/input-types"; +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 { appLimitCreditCodeKeys } from '../query-keys'; +import { appLimitCreditCodeMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, + AppLimitCreditCodePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, + AppLimitCreditCodePatch, +} from '../../orm/input-types'; /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitCreditCodeMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitCreditCodePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitCreditCodeMutation(params: { - selection: ({ - fields: S & AppLimitCreditCodeSelect; - } & HookStrictSelect, AppLimitCreditCodeSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitCreditCodePatch: AppLimitCreditCodePatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitCreditCode: { - appLimitCreditCode: InferSelectResult; - }; -}, Error, { - id: string; - appLimitCreditCodePatch: AppLimitCreditCodePatch; -}>; -export function useUpdateAppLimitCreditCodeMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitCreditCodeMutation( + params: { + selection: { + fields: S & AppLimitCreditCodeSelect; + } & HookStrictSelect, AppLimitCreditCodeSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitCreditCode: { + appLimitCreditCode: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCreditCodePatch: AppLimitCreditCodePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitCreditCode: { + appLimitCreditCode: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCreditCodePatch: AppLimitCreditCodePatch; + } +>; +export function useUpdateAppLimitCreditCodeMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitCreditCodePatch: AppLimitCreditCodePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditCodeMutationKeys.all, mutationFn: ({ id, - appLimitCreditCodePatch + appLimitCreditCodePatch, }: { id: string; appLimitCreditCodePatch: AppLimitCreditCodePatch; - }) => getClient().appLimitCreditCode.update({ - where: { - id - }, - data: appLimitCreditCodePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appLimitCreditCode.update({ + where: { + id, + }, + data: appLimitCreditCodePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeKeys.detail(variables.id) + queryKey: appLimitCreditCodeKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCreditCodeKeys.lists() + queryKey: appLimitCreditCodeKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditMutation.ts index 4cebddba9d..4283aef632 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditMutation.ts @@ -4,83 +4,113 @@ * 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 { appLimitCreditKeys } from "../query-keys"; -import { appLimitCreditMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditSelect, AppLimitCreditWithRelations, AppLimitCreditPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditSelect, AppLimitCreditWithRelations, AppLimitCreditPatch } from "../../orm/input-types"; +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 { appLimitCreditKeys } from '../query-keys'; +import { appLimitCreditMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditSelect, + AppLimitCreditWithRelations, + AppLimitCreditPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditSelect, + AppLimitCreditWithRelations, + AppLimitCreditPatch, +} from '../../orm/input-types'; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitCreditMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitCreditPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitCreditMutation(params: { - selection: ({ - fields: S & AppLimitCreditSelect; - } & HookStrictSelect, AppLimitCreditSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitCreditPatch: AppLimitCreditPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitCredit: { - appLimitCredit: InferSelectResult; - }; -}, Error, { - id: string; - appLimitCreditPatch: AppLimitCreditPatch; -}>; -export function useUpdateAppLimitCreditMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitCreditMutation( + params: { + selection: { + fields: S & AppLimitCreditSelect; + } & HookStrictSelect, AppLimitCreditSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitCredit: { + appLimitCredit: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCreditPatch: AppLimitCreditPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitCredit: { + appLimitCredit: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCreditPatch: AppLimitCreditPatch; + } +>; +export function useUpdateAppLimitCreditMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitCreditPatch: AppLimitCreditPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditMutationKeys.all, mutationFn: ({ id, - appLimitCreditPatch + appLimitCreditPatch, }: { id: string; appLimitCreditPatch: AppLimitCreditPatch; - }) => getClient().appLimitCredit.update({ - where: { - id - }, - data: appLimitCreditPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appLimitCredit.update({ + where: { + id, + }, + data: appLimitCreditPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitCreditKeys.detail(variables.id) + queryKey: appLimitCreditKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCreditKeys.lists() + queryKey: appLimitCreditKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditRedemptionMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditRedemptionMutation.ts index d6bcdb57ec..d1181e58af 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditRedemptionMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitCreditRedemptionMutation.ts @@ -4,83 +4,113 @@ * 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 { appLimitCreditRedemptionKeys } from "../query-keys"; -import { appLimitCreditRedemptionMutationKeys } from "../mutation-keys"; -import type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations, AppLimitCreditRedemptionPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations, AppLimitCreditRedemptionPatch } from "../../orm/input-types"; +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 { appLimitCreditRedemptionKeys } from '../query-keys'; +import { appLimitCreditRedemptionMutationKeys } from '../mutation-keys'; +import type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, + AppLimitCreditRedemptionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, + AppLimitCreditRedemptionPatch, +} from '../../orm/input-types'; /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitCreditRedemptionMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitCreditRedemptionPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitCreditRedemptionMutation(params: { - selection: ({ - fields: S & AppLimitCreditRedemptionSelect; - } & HookStrictSelect, AppLimitCreditRedemptionSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitCreditRedemptionPatch: AppLimitCreditRedemptionPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitCreditRedemption: { - appLimitCreditRedemption: InferSelectResult; - }; -}, Error, { - id: string; - appLimitCreditRedemptionPatch: AppLimitCreditRedemptionPatch; -}>; -export function useUpdateAppLimitCreditRedemptionMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitCreditRedemptionMutation( + params: { + selection: { + fields: S & AppLimitCreditRedemptionSelect; + } & HookStrictSelect, AppLimitCreditRedemptionSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitCreditRedemption: { + appLimitCreditRedemption: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCreditRedemptionPatch: AppLimitCreditRedemptionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitCreditRedemption: { + appLimitCreditRedemption: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitCreditRedemptionPatch: AppLimitCreditRedemptionPatch; + } +>; +export function useUpdateAppLimitCreditRedemptionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitCreditRedemptionPatch: AppLimitCreditRedemptionPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitCreditRedemptionMutationKeys.all, mutationFn: ({ id, - appLimitCreditRedemptionPatch + appLimitCreditRedemptionPatch, }: { id: string; appLimitCreditRedemptionPatch: AppLimitCreditRedemptionPatch; - }) => getClient().appLimitCreditRedemption.update({ - where: { - id - }, - data: appLimitCreditRedemptionPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appLimitCreditRedemption.update({ + where: { + id, + }, + data: appLimitCreditRedemptionPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitCreditRedemptionKeys.detail(variables.id) + queryKey: appLimitCreditRedemptionKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitCreditRedemptionKeys.lists() + queryKey: appLimitCreditRedemptionKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitDefaultMutation.ts index f5f4efdd8a..d5402ef936 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitDefaultMutation.ts @@ -4,83 +4,113 @@ * 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 { appLimitDefaultKeys } from "../query-keys"; -import { appLimitDefaultMutationKeys } from "../mutation-keys"; -import type { AppLimitDefaultSelect, AppLimitDefaultWithRelations, AppLimitDefaultPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitDefaultSelect, AppLimitDefaultWithRelations, AppLimitDefaultPatch } from "../../orm/input-types"; +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 { appLimitDefaultKeys } from '../query-keys'; +import { appLimitDefaultMutationKeys } from '../mutation-keys'; +import type { + AppLimitDefaultSelect, + AppLimitDefaultWithRelations, + AppLimitDefaultPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitDefaultSelect, + AppLimitDefaultWithRelations, + AppLimitDefaultPatch, +} from '../../orm/input-types'; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitDefaultPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitDefaultMutation(params: { - selection: ({ - fields: S & AppLimitDefaultSelect; - } & HookStrictSelect, AppLimitDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitDefaultPatch: AppLimitDefaultPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitDefault: { - appLimitDefault: InferSelectResult; - }; -}, Error, { - id: string; - appLimitDefaultPatch: AppLimitDefaultPatch; -}>; -export function useUpdateAppLimitDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitDefaultMutation( + params: { + selection: { + fields: S & AppLimitDefaultSelect; + } & HookStrictSelect, AppLimitDefaultSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitDefault: { + appLimitDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitDefaultPatch: AppLimitDefaultPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitDefault: { + appLimitDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitDefaultPatch: AppLimitDefaultPatch; + } +>; +export function useUpdateAppLimitDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitDefaultPatch: AppLimitDefaultPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitDefaultMutationKeys.all, mutationFn: ({ id, - appLimitDefaultPatch + appLimitDefaultPatch, }: { id: string; appLimitDefaultPatch: AppLimitDefaultPatch; - }) => getClient().appLimitDefault.update({ - where: { - id - }, - data: appLimitDefaultPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appLimitDefault.update({ + where: { + id, + }, + data: appLimitDefaultPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitDefaultKeys.detail(variables.id) + queryKey: appLimitDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitDefaultKeys.lists() + queryKey: appLimitDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitEventMutation.ts index 0b5c96b7fc..b352e9e1c7 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitEventMutation.ts @@ -4,61 +4,88 @@ * 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 { appLimitEventKeys } from "../query-keys"; -import { appLimitEventMutationKeys } from "../mutation-keys"; -import type { AppLimitEventSelect, AppLimitEventWithRelations, AppLimitEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitEventSelect, AppLimitEventWithRelations, AppLimitEventPatch } from "../../orm/input-types"; +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 { appLimitEventKeys } from '../query-keys'; +import { appLimitEventMutationKeys } from '../mutation-keys'; +import type { + AppLimitEventSelect, + AppLimitEventWithRelations, + AppLimitEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitEventSelect, + AppLimitEventWithRelations, + AppLimitEventPatch, +} from '../../orm/input-types'; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitEventMutation(params: { - selection: ({ - fields: S & AppLimitEventSelect; - } & HookStrictSelect, AppLimitEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - appLimitEventPatch: AppLimitEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitEvent: { - appLimitEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - appLimitEventPatch: AppLimitEventPatch; -}>; -export function useUpdateAppLimitEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitEventMutation( + params: { + selection: { + fields: S & AppLimitEventSelect; + } & HookStrictSelect, AppLimitEventSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitEvent: { + appLimitEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + appLimitEventPatch: AppLimitEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitEvent: { + appLimitEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + appLimitEventPatch: AppLimitEventPatch; + } +>; +export function useUpdateAppLimitEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + appLimitEventPatch: AppLimitEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateAppLimitEventMutation(params: { mutationFn: ({ id, createdAt, - appLimitEventPatch + appLimitEventPatch, }: { id: string; createdAt: string; appLimitEventPatch: AppLimitEventPatch; - }) => getClient().appLimitEvent.update({ - where: { - id, - createdAt - }, - data: appLimitEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appLimitEvent.update({ + where: { + id, + createdAt, + }, + data: appLimitEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitEventKeys.detail(variables.id) + queryKey: appLimitEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitEventKeys.lists() + queryKey: appLimitEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitMutation.ts index feb26dc751..5f606dc733 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitMutation.ts @@ -4,83 +4,99 @@ * 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 { appLimitKeys } from "../query-keys"; -import { appLimitMutationKeys } from "../mutation-keys"; -import type { AppLimitSelect, AppLimitWithRelations, AppLimitPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitSelect, AppLimitWithRelations, AppLimitPatch } from "../../orm/input-types"; +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 { appLimitKeys } from '../query-keys'; +import { appLimitMutationKeys } from '../mutation-keys'; +import type { AppLimitSelect, AppLimitWithRelations, AppLimitPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitSelect, AppLimitWithRelations, AppLimitPatch } from '../../orm/input-types'; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitMutation(params: { - selection: ({ - fields: S & AppLimitSelect; - } & HookStrictSelect, AppLimitSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitPatch: AppLimitPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimit: { - appLimit: InferSelectResult; - }; -}, Error, { - id: string; - appLimitPatch: AppLimitPatch; -}>; -export function useUpdateAppLimitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitMutation( + params: { + selection: { + fields: S & AppLimitSelect; + } & HookStrictSelect, AppLimitSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimit: { + appLimit: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitPatch: AppLimitPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimit: { + appLimit: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitPatch: AppLimitPatch; + } +>; +export function useUpdateAppLimitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitPatch: AppLimitPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitMutationKeys.all, - mutationFn: ({ - id, - appLimitPatch - }: { - id: string; - appLimitPatch: AppLimitPatch; - }) => getClient().appLimit.update({ - where: { - id - }, - data: appLimitPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, appLimitPatch }: { id: string; appLimitPatch: AppLimitPatch }) => + getClient() + .appLimit.update({ + where: { + id, + }, + data: appLimitPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitKeys.detail(variables.id) + queryKey: appLimitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitKeys.lists() + queryKey: appLimitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitWarningMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitWarningMutation.ts index 8783a21d4d..da3993cd0e 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitWarningMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitWarningMutation.ts @@ -4,83 +4,113 @@ * 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 { appLimitWarningKeys } from "../query-keys"; -import { appLimitWarningMutationKeys } from "../mutation-keys"; -import type { AppLimitWarningSelect, AppLimitWarningWithRelations, AppLimitWarningPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitWarningSelect, AppLimitWarningWithRelations, AppLimitWarningPatch } from "../../orm/input-types"; +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 { appLimitWarningKeys } from '../query-keys'; +import { appLimitWarningMutationKeys } from '../mutation-keys'; +import type { + AppLimitWarningSelect, + AppLimitWarningWithRelations, + AppLimitWarningPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitWarningSelect, + AppLimitWarningWithRelations, + AppLimitWarningPatch, +} from '../../orm/input-types'; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateAppLimitWarningMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', appLimitWarningPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateAppLimitWarningMutation(params: { - selection: ({ - fields: S & AppLimitWarningSelect; - } & HookStrictSelect, AppLimitWarningSelect>); -} & Omit; - }; -}, Error, { - id: string; - appLimitWarningPatch: AppLimitWarningPatch; -}>, "mutationFn">): UseMutationResult<{ - updateAppLimitWarning: { - appLimitWarning: InferSelectResult; - }; -}, Error, { - id: string; - appLimitWarningPatch: AppLimitWarningPatch; -}>; -export function useUpdateAppLimitWarningMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateAppLimitWarningMutation( + params: { + selection: { + fields: S & AppLimitWarningSelect; + } & HookStrictSelect, AppLimitWarningSelect>; + } & Omit< + UseMutationOptions< + { + updateAppLimitWarning: { + appLimitWarning: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitWarningPatch: AppLimitWarningPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateAppLimitWarning: { + appLimitWarning: InferSelectResult; + }; + }, + Error, + { + id: string; + appLimitWarningPatch: AppLimitWarningPatch; + } +>; +export function useUpdateAppLimitWarningMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + appLimitWarningPatch: AppLimitWarningPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitWarningMutationKeys.all, mutationFn: ({ id, - appLimitWarningPatch + appLimitWarningPatch, }: { id: string; appLimitWarningPatch: AppLimitWarningPatch; - }) => getClient().appLimitWarning.update({ - where: { - id - }, - data: appLimitWarningPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .appLimitWarning.update({ + where: { + id, + }, + data: appLimitWarningPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: appLimitWarningKeys.detail(variables.id) + queryKey: appLimitWarningKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: appLimitWarningKeys.lists() + queryKey: appLimitWarningKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitAggregateMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitAggregateMutation.ts index 39f0ea6258..1c24df7ca9 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitAggregateMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitAggregateMutation.ts @@ -4,83 +4,113 @@ * 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 { orgLimitAggregateKeys } from "../query-keys"; -import { orgLimitAggregateMutationKeys } from "../mutation-keys"; -import type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations, OrgLimitAggregatePatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations, OrgLimitAggregatePatch } from "../../orm/input-types"; +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 { orgLimitAggregateKeys } from '../query-keys'; +import { orgLimitAggregateMutationKeys } from '../mutation-keys'; +import type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, + OrgLimitAggregatePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, + OrgLimitAggregatePatch, +} from '../../orm/input-types'; /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgLimitAggregateMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgLimitAggregatePatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgLimitAggregateMutation(params: { - selection: ({ - fields: S & OrgLimitAggregateSelect; - } & HookStrictSelect, OrgLimitAggregateSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgLimitAggregatePatch: OrgLimitAggregatePatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgLimitAggregate: { - orgLimitAggregate: InferSelectResult; - }; -}, Error, { - id: string; - orgLimitAggregatePatch: OrgLimitAggregatePatch; -}>; -export function useUpdateOrgLimitAggregateMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgLimitAggregateMutation( + params: { + selection: { + fields: S & OrgLimitAggregateSelect; + } & HookStrictSelect, OrgLimitAggregateSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgLimitAggregate: { + orgLimitAggregate: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitAggregatePatch: OrgLimitAggregatePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgLimitAggregate: { + orgLimitAggregate: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitAggregatePatch: OrgLimitAggregatePatch; + } +>; +export function useUpdateOrgLimitAggregateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgLimitAggregatePatch: OrgLimitAggregatePatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitAggregateMutationKeys.all, mutationFn: ({ id, - orgLimitAggregatePatch + orgLimitAggregatePatch, }: { id: string; orgLimitAggregatePatch: OrgLimitAggregatePatch; - }) => getClient().orgLimitAggregate.update({ - where: { - id - }, - data: orgLimitAggregatePatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgLimitAggregate.update({ + where: { + id, + }, + data: orgLimitAggregatePatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgLimitAggregateKeys.detail(variables.id) + queryKey: orgLimitAggregateKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitAggregateKeys.lists() + queryKey: orgLimitAggregateKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCapMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCapMutation.ts index f370f703b8..042098c778 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCapMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCapMutation.ts @@ -4,83 +4,107 @@ * 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 { orgLimitCapKeys } from "../query-keys"; -import { orgLimitCapMutationKeys } from "../mutation-keys"; -import type { OrgLimitCapSelect, OrgLimitCapWithRelations, OrgLimitCapPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapSelect, OrgLimitCapWithRelations, OrgLimitCapPatch } from "../../orm/input-types"; +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 { orgLimitCapKeys } from '../query-keys'; +import { orgLimitCapMutationKeys } from '../mutation-keys'; +import type { + OrgLimitCapSelect, + OrgLimitCapWithRelations, + OrgLimitCapPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitCapSelect, + OrgLimitCapWithRelations, + OrgLimitCapPatch, +} from '../../orm/input-types'; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgLimitCapMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgLimitCapPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgLimitCapMutation(params: { - selection: ({ - fields: S & OrgLimitCapSelect; - } & HookStrictSelect, OrgLimitCapSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgLimitCapPatch: OrgLimitCapPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgLimitCap: { - orgLimitCap: InferSelectResult; - }; -}, Error, { - id: string; - orgLimitCapPatch: OrgLimitCapPatch; -}>; -export function useUpdateOrgLimitCapMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgLimitCapMutation( + params: { + selection: { + fields: S & OrgLimitCapSelect; + } & HookStrictSelect, OrgLimitCapSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgLimitCap: { + orgLimitCap: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitCapPatch: OrgLimitCapPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgLimitCap: { + orgLimitCap: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitCapPatch: OrgLimitCapPatch; + } +>; +export function useUpdateOrgLimitCapMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgLimitCapPatch: OrgLimitCapPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCapMutationKeys.all, - mutationFn: ({ - id, - orgLimitCapPatch - }: { - id: string; - orgLimitCapPatch: OrgLimitCapPatch; - }) => getClient().orgLimitCap.update({ - where: { - id - }, - data: orgLimitCapPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, orgLimitCapPatch }: { id: string; orgLimitCapPatch: OrgLimitCapPatch }) => + getClient() + .orgLimitCap.update({ + where: { + id, + }, + data: orgLimitCapPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgLimitCapKeys.detail(variables.id) + queryKey: orgLimitCapKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitCapKeys.lists() + queryKey: orgLimitCapKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCapsDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCapsDefaultMutation.ts index cb1f1176ba..9d7b74e933 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCapsDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCapsDefaultMutation.ts @@ -4,83 +4,113 @@ * 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 { orgLimitCapsDefaultKeys } from "../query-keys"; -import { orgLimitCapsDefaultMutationKeys } from "../mutation-keys"; -import type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations, OrgLimitCapsDefaultPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations, OrgLimitCapsDefaultPatch } from "../../orm/input-types"; +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 { orgLimitCapsDefaultKeys } from '../query-keys'; +import { orgLimitCapsDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, + OrgLimitCapsDefaultPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, + OrgLimitCapsDefaultPatch, +} from '../../orm/input-types'; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgLimitCapsDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgLimitCapsDefaultPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgLimitCapsDefaultMutation(params: { - selection: ({ - fields: S & OrgLimitCapsDefaultSelect; - } & HookStrictSelect, OrgLimitCapsDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgLimitCapsDefaultPatch: OrgLimitCapsDefaultPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgLimitCapsDefault: { - orgLimitCapsDefault: InferSelectResult; - }; -}, Error, { - id: string; - orgLimitCapsDefaultPatch: OrgLimitCapsDefaultPatch; -}>; -export function useUpdateOrgLimitCapsDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgLimitCapsDefaultMutation( + params: { + selection: { + fields: S & OrgLimitCapsDefaultSelect; + } & HookStrictSelect, OrgLimitCapsDefaultSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgLimitCapsDefault: { + orgLimitCapsDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitCapsDefaultPatch: OrgLimitCapsDefaultPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgLimitCapsDefault: { + orgLimitCapsDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitCapsDefaultPatch: OrgLimitCapsDefaultPatch; + } +>; +export function useUpdateOrgLimitCapsDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgLimitCapsDefaultPatch: OrgLimitCapsDefaultPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCapsDefaultMutationKeys.all, mutationFn: ({ id, - orgLimitCapsDefaultPatch + orgLimitCapsDefaultPatch, }: { id: string; orgLimitCapsDefaultPatch: OrgLimitCapsDefaultPatch; - }) => getClient().orgLimitCapsDefault.update({ - where: { - id - }, - data: orgLimitCapsDefaultPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgLimitCapsDefault.update({ + where: { + id, + }, + data: orgLimitCapsDefaultPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgLimitCapsDefaultKeys.detail(variables.id) + queryKey: orgLimitCapsDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitCapsDefaultKeys.lists() + queryKey: orgLimitCapsDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCreditMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCreditMutation.ts index f819206cce..deb27f48da 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCreditMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitCreditMutation.ts @@ -4,83 +4,113 @@ * 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 { orgLimitCreditKeys } from "../query-keys"; -import { orgLimitCreditMutationKeys } from "../mutation-keys"; -import type { OrgLimitCreditSelect, OrgLimitCreditWithRelations, OrgLimitCreditPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCreditSelect, OrgLimitCreditWithRelations, OrgLimitCreditPatch } from "../../orm/input-types"; +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 { orgLimitCreditKeys } from '../query-keys'; +import { orgLimitCreditMutationKeys } from '../mutation-keys'; +import type { + OrgLimitCreditSelect, + OrgLimitCreditWithRelations, + OrgLimitCreditPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitCreditSelect, + OrgLimitCreditWithRelations, + OrgLimitCreditPatch, +} from '../../orm/input-types'; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgLimitCreditMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgLimitCreditPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgLimitCreditMutation(params: { - selection: ({ - fields: S & OrgLimitCreditSelect; - } & HookStrictSelect, OrgLimitCreditSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgLimitCreditPatch: OrgLimitCreditPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgLimitCredit: { - orgLimitCredit: InferSelectResult; - }; -}, Error, { - id: string; - orgLimitCreditPatch: OrgLimitCreditPatch; -}>; -export function useUpdateOrgLimitCreditMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgLimitCreditMutation( + params: { + selection: { + fields: S & OrgLimitCreditSelect; + } & HookStrictSelect, OrgLimitCreditSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgLimitCredit: { + orgLimitCredit: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitCreditPatch: OrgLimitCreditPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgLimitCredit: { + orgLimitCredit: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitCreditPatch: OrgLimitCreditPatch; + } +>; +export function useUpdateOrgLimitCreditMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgLimitCreditPatch: OrgLimitCreditPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitCreditMutationKeys.all, mutationFn: ({ id, - orgLimitCreditPatch + orgLimitCreditPatch, }: { id: string; orgLimitCreditPatch: OrgLimitCreditPatch; - }) => getClient().orgLimitCredit.update({ - where: { - id - }, - data: orgLimitCreditPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgLimitCredit.update({ + where: { + id, + }, + data: orgLimitCreditPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgLimitCreditKeys.detail(variables.id) + queryKey: orgLimitCreditKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitCreditKeys.lists() + queryKey: orgLimitCreditKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitDefaultMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitDefaultMutation.ts index 49529edaba..c80fc084e0 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitDefaultMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitDefaultMutation.ts @@ -4,83 +4,113 @@ * 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 { orgLimitDefaultKeys } from "../query-keys"; -import { orgLimitDefaultMutationKeys } from "../mutation-keys"; -import type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations, OrgLimitDefaultPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations, OrgLimitDefaultPatch } from "../../orm/input-types"; +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 { orgLimitDefaultKeys } from '../query-keys'; +import { orgLimitDefaultMutationKeys } from '../mutation-keys'; +import type { + OrgLimitDefaultSelect, + OrgLimitDefaultWithRelations, + OrgLimitDefaultPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitDefaultSelect, + OrgLimitDefaultWithRelations, + OrgLimitDefaultPatch, +} from '../../orm/input-types'; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgLimitDefaultMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgLimitDefaultPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgLimitDefaultMutation(params: { - selection: ({ - fields: S & OrgLimitDefaultSelect; - } & HookStrictSelect, OrgLimitDefaultSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgLimitDefaultPatch: OrgLimitDefaultPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgLimitDefault: { - orgLimitDefault: InferSelectResult; - }; -}, Error, { - id: string; - orgLimitDefaultPatch: OrgLimitDefaultPatch; -}>; -export function useUpdateOrgLimitDefaultMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgLimitDefaultMutation( + params: { + selection: { + fields: S & OrgLimitDefaultSelect; + } & HookStrictSelect, OrgLimitDefaultSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgLimitDefault: { + orgLimitDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitDefaultPatch: OrgLimitDefaultPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgLimitDefault: { + orgLimitDefault: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitDefaultPatch: OrgLimitDefaultPatch; + } +>; +export function useUpdateOrgLimitDefaultMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgLimitDefaultPatch: OrgLimitDefaultPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitDefaultMutationKeys.all, mutationFn: ({ id, - orgLimitDefaultPatch + orgLimitDefaultPatch, }: { id: string; orgLimitDefaultPatch: OrgLimitDefaultPatch; - }) => getClient().orgLimitDefault.update({ - where: { - id - }, - data: orgLimitDefaultPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgLimitDefault.update({ + where: { + id, + }, + data: orgLimitDefaultPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgLimitDefaultKeys.detail(variables.id) + queryKey: orgLimitDefaultKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitDefaultKeys.lists() + queryKey: orgLimitDefaultKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitEventMutation.ts index a2f2e1b89d..449b2bd66d 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitEventMutation.ts @@ -4,61 +4,88 @@ * 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 { orgLimitEventKeys } from "../query-keys"; -import { orgLimitEventMutationKeys } from "../mutation-keys"; -import type { OrgLimitEventSelect, OrgLimitEventWithRelations, OrgLimitEventPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitEventSelect, OrgLimitEventWithRelations, OrgLimitEventPatch } from "../../orm/input-types"; +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 { orgLimitEventKeys } from '../query-keys'; +import { orgLimitEventMutationKeys } from '../mutation-keys'; +import type { + OrgLimitEventSelect, + OrgLimitEventWithRelations, + OrgLimitEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitEventSelect, + OrgLimitEventWithRelations, + OrgLimitEventPatch, +} from '../../orm/input-types'; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgLimitEventMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgLimitEventPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgLimitEventMutation(params: { - selection: ({ - fields: S & OrgLimitEventSelect; - } & HookStrictSelect, OrgLimitEventSelect>); -} & Omit; - }; -}, Error, { - id: string; - createdAt: string; - orgLimitEventPatch: OrgLimitEventPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgLimitEvent: { - orgLimitEvent: InferSelectResult; - }; -}, Error, { - id: string; - createdAt: string; - orgLimitEventPatch: OrgLimitEventPatch; -}>; -export function useUpdateOrgLimitEventMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgLimitEventMutation( + params: { + selection: { + fields: S & OrgLimitEventSelect; + } & HookStrictSelect, OrgLimitEventSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgLimitEvent: { + orgLimitEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + orgLimitEventPatch: OrgLimitEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgLimitEvent: { + orgLimitEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + orgLimitEventPatch: OrgLimitEventPatch; + } +>; +export function useUpdateOrgLimitEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + orgLimitEventPatch: OrgLimitEventPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ @@ -66,27 +93,30 @@ export function useUpdateOrgLimitEventMutation(params: { mutationFn: ({ id, createdAt, - orgLimitEventPatch + orgLimitEventPatch, }: { id: string; createdAt: string; orgLimitEventPatch: OrgLimitEventPatch; - }) => getClient().orgLimitEvent.update({ - where: { - id, - createdAt - }, - data: orgLimitEventPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgLimitEvent.update({ + where: { + id, + createdAt, + }, + data: orgLimitEventPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgLimitEventKeys.detail(variables.id) + queryKey: orgLimitEventKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitEventKeys.lists() + queryKey: orgLimitEventKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitMutation.ts index 013ade0f52..b911eef595 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitMutation.ts @@ -4,83 +4,99 @@ * 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 { orgLimitKeys } from "../query-keys"; -import { orgLimitMutationKeys } from "../mutation-keys"; -import type { OrgLimitSelect, OrgLimitWithRelations, OrgLimitPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitSelect, OrgLimitWithRelations, OrgLimitPatch } from "../../orm/input-types"; +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 { orgLimitKeys } from '../query-keys'; +import { orgLimitMutationKeys } from '../mutation-keys'; +import type { OrgLimitSelect, OrgLimitWithRelations, OrgLimitPatch } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitSelect, OrgLimitWithRelations, OrgLimitPatch } from '../../orm/input-types'; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgLimitMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgLimitPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgLimitMutation(params: { - selection: ({ - fields: S & OrgLimitSelect; - } & HookStrictSelect, OrgLimitSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgLimitPatch: OrgLimitPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgLimit: { - orgLimit: InferSelectResult; - }; -}, Error, { - id: string; - orgLimitPatch: OrgLimitPatch; -}>; -export function useUpdateOrgLimitMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgLimitMutation( + params: { + selection: { + fields: S & OrgLimitSelect; + } & HookStrictSelect, OrgLimitSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgLimit: { + orgLimit: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitPatch: OrgLimitPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgLimit: { + orgLimit: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitPatch: OrgLimitPatch; + } +>; +export function useUpdateOrgLimitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgLimitPatch: OrgLimitPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitMutationKeys.all, - mutationFn: ({ - id, - orgLimitPatch - }: { - id: string; - orgLimitPatch: OrgLimitPatch; - }) => getClient().orgLimit.update({ - where: { - id - }, - data: orgLimitPatch, - select: args.select - }).unwrap(), + mutationFn: ({ id, orgLimitPatch }: { id: string; orgLimitPatch: OrgLimitPatch }) => + getClient() + .orgLimit.update({ + where: { + id, + }, + data: orgLimitPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgLimitKeys.detail(variables.id) + queryKey: orgLimitKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitKeys.lists() + queryKey: orgLimitKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitWarningMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitWarningMutation.ts index 560f7ed002..7141728e46 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitWarningMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitWarningMutation.ts @@ -4,83 +4,113 @@ * 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 { orgLimitWarningKeys } from "../query-keys"; -import { orgLimitWarningMutationKeys } from "../mutation-keys"; -import type { OrgLimitWarningSelect, OrgLimitWarningWithRelations, OrgLimitWarningPatch } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitWarningSelect, OrgLimitWarningWithRelations, OrgLimitWarningPatch } from "../../orm/input-types"; +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 { orgLimitWarningKeys } from '../query-keys'; +import { orgLimitWarningMutationKeys } from '../mutation-keys'; +import type { + OrgLimitWarningSelect, + OrgLimitWarningWithRelations, + OrgLimitWarningPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitWarningSelect, + OrgLimitWarningWithRelations, + OrgLimitWarningPatch, +} from '../../orm/input-types'; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { mutate, isPending } = useUpdateOrgLimitWarningMutation({ * selection: { fields: { id: true, name: true } }, * }); - * + * * mutate({ id: 'value-here', orgLimitWarningPatch: { name: 'Updated' } }); * ``` */ -export function useUpdateOrgLimitWarningMutation(params: { - selection: ({ - fields: S & OrgLimitWarningSelect; - } & HookStrictSelect, OrgLimitWarningSelect>); -} & Omit; - }; -}, Error, { - id: string; - orgLimitWarningPatch: OrgLimitWarningPatch; -}>, "mutationFn">): UseMutationResult<{ - updateOrgLimitWarning: { - orgLimitWarning: InferSelectResult; - }; -}, Error, { - id: string; - orgLimitWarningPatch: OrgLimitWarningPatch; -}>; -export function useUpdateOrgLimitWarningMutation(params: { - selection: SelectionConfig; -} & Omit, "mutationFn">) { +export function useUpdateOrgLimitWarningMutation( + params: { + selection: { + fields: S & OrgLimitWarningSelect; + } & HookStrictSelect, OrgLimitWarningSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgLimitWarning: { + orgLimitWarning: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitWarningPatch: OrgLimitWarningPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgLimitWarning: { + orgLimitWarning: InferSelectResult; + }; + }, + Error, + { + id: string; + orgLimitWarningPatch: OrgLimitWarningPatch; + } +>; +export function useUpdateOrgLimitWarningMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + orgLimitWarningPatch: OrgLimitWarningPatch; + } + >, + 'mutationFn' + > +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...mutationOptions - } = params ?? {}; + const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitWarningMutationKeys.all, mutationFn: ({ id, - orgLimitWarningPatch + orgLimitWarningPatch, }: { id: string; orgLimitWarningPatch: OrgLimitWarningPatch; - }) => getClient().orgLimitWarning.update({ - where: { - id - }, - data: orgLimitWarningPatch, - select: args.select - }).unwrap(), + }) => + getClient() + .orgLimitWarning.update({ + where: { + id, + }, + data: orgLimitWarningPatch, + select: args.select, + }) + .unwrap(), onSuccess: (_, variables) => { queryClient.invalidateQueries({ - queryKey: orgLimitWarningKeys.detail(variables.id) + queryKey: orgLimitWarningKeys.detail(variables.id), }); queryClient.invalidateQueries({ - queryKey: orgLimitWarningKeys.lists() + queryKey: orgLimitWarningKeys.lists(), }); }, - ...mutationOptions + ...mutationOptions, }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/index.ts b/sdk/constructive-react/src/usage/hooks/queries/index.ts index ffd131b444..a5a28bcfc0 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/index.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/index.ts @@ -3,39 +3,39 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export * from "./useAppLimitCapsQuery"; -export * from "./useAppLimitCapQuery"; -export * from "./useAppLimitCapsDefaultsQuery"; -export * from "./useAppLimitCapsDefaultQuery"; -export * from "./useAppLimitsQuery"; -export * from "./useAppLimitQuery"; -export * from "./useAppLimitCreditCodesQuery"; -export * from "./useAppLimitCreditCodeQuery"; -export * from "./useAppLimitCreditCodeItemsQuery"; -export * from "./useAppLimitCreditCodeItemQuery"; -export * from "./useAppLimitCreditsQuery"; -export * from "./useAppLimitCreditQuery"; -export * from "./useAppLimitCreditRedemptionsQuery"; -export * from "./useAppLimitCreditRedemptionQuery"; -export * from "./useAppLimitDefaultsQuery"; -export * from "./useAppLimitDefaultQuery"; -export * from "./useAppLimitEventsQuery"; -export * from "./useAppLimitEventQuery"; -export * from "./useAppLimitWarningsQuery"; -export * from "./useAppLimitWarningQuery"; -export * from "./useOrgLimitAggregatesQuery"; -export * from "./useOrgLimitAggregateQuery"; -export * from "./useOrgLimitCapsQuery"; -export * from "./useOrgLimitCapQuery"; -export * from "./useOrgLimitCapsDefaultsQuery"; -export * from "./useOrgLimitCapsDefaultQuery"; -export * from "./useOrgLimitsQuery"; -export * from "./useOrgLimitQuery"; -export * from "./useOrgLimitCreditsQuery"; -export * from "./useOrgLimitCreditQuery"; -export * from "./useOrgLimitDefaultsQuery"; -export * from "./useOrgLimitDefaultQuery"; -export * from "./useOrgLimitEventsQuery"; -export * from "./useOrgLimitEventQuery"; -export * from "./useOrgLimitWarningsQuery"; -export * from "./useOrgLimitWarningQuery"; \ No newline at end of file +export * from './useAppLimitCapsQuery'; +export * from './useAppLimitCapQuery'; +export * from './useAppLimitCapsDefaultsQuery'; +export * from './useAppLimitCapsDefaultQuery'; +export * from './useAppLimitsQuery'; +export * from './useAppLimitQuery'; +export * from './useAppLimitCreditCodesQuery'; +export * from './useAppLimitCreditCodeQuery'; +export * from './useAppLimitCreditCodeItemsQuery'; +export * from './useAppLimitCreditCodeItemQuery'; +export * from './useAppLimitCreditsQuery'; +export * from './useAppLimitCreditQuery'; +export * from './useAppLimitCreditRedemptionsQuery'; +export * from './useAppLimitCreditRedemptionQuery'; +export * from './useAppLimitDefaultsQuery'; +export * from './useAppLimitDefaultQuery'; +export * from './useAppLimitEventsQuery'; +export * from './useAppLimitEventQuery'; +export * from './useAppLimitWarningsQuery'; +export * from './useAppLimitWarningQuery'; +export * from './useOrgLimitAggregatesQuery'; +export * from './useOrgLimitAggregateQuery'; +export * from './useOrgLimitCapsQuery'; +export * from './useOrgLimitCapQuery'; +export * from './useOrgLimitCapsDefaultsQuery'; +export * from './useOrgLimitCapsDefaultQuery'; +export * from './useOrgLimitsQuery'; +export * from './useOrgLimitQuery'; +export * from './useOrgLimitCreditsQuery'; +export * from './useOrgLimitCreditQuery'; +export * from './useOrgLimitDefaultsQuery'; +export * from './useOrgLimitDefaultQuery'; +export * from './useOrgLimitEventsQuery'; +export * from './useOrgLimitEventQuery'; +export * from './useOrgLimitWarningsQuery'; +export * from './useOrgLimitWarningQuery'; diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapQuery.ts index 6f23773811..1a20f527e7 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapQuery.ts @@ -4,20 +4,20 @@ * 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 { appLimitCapKeys } from "../query-keys"; -import type { AppLimitCapSelect, AppLimitCapWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapSelect, AppLimitCapWithRelations } from "../../orm/input-types"; +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 { appLimitCapKeys } from '../query-keys'; +import type { AppLimitCapSelect, AppLimitCapWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitCapSelect, AppLimitCapWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCapQueryKey = appLimitCapKeys.detail; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCapQuery({ @@ -26,38 +26,52 @@ export const appLimitCapQueryKey = appLimitCapKeys.detail; * }); * ``` */ -export function useAppLimitCapQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCapSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCapQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitCapQuery< + S extends AppLimitCapSelect, + TData = { + appLimitCap: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCapSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCap: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCapQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCapKeys.detail(params.id), - queryFn: () => getClient().appLimitCap.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitCap.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```ts * const data = await fetchAppLimitCapQuery({ @@ -79,35 +93,46 @@ export async function fetchAppLimitCapQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitCap.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitCap.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```ts * await prefetchAppLimitCapQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitCapQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCapSelect>; -}): Promise; -export async function prefetchAppLimitCapQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitCapQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCapSelect>; + } +): Promise; +export async function prefetchAppLimitCapQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCapKeys.detail(params.id), - queryFn: () => getClient().appLimitCap.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitCap.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsDefaultQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsDefaultQuery.ts index 6ed8428f21..9a35f8cfd2 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsDefaultQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsDefaultQuery.ts @@ -4,20 +4,26 @@ * 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 { appLimitCapsDefaultKeys } from "../query-keys"; -import type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations } from "../../orm/input-types"; +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 { appLimitCapsDefaultKeys } from '../query-keys'; +import type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCapsDefaultQueryKey = appLimitCapsDefaultKeys.detail; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCapsDefaultQuery({ @@ -26,38 +32,52 @@ export const appLimitCapsDefaultQueryKey = appLimitCapsDefaultKeys.detail; * }); * ``` */ -export function useAppLimitCapsDefaultQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCapsDefaultSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCapsDefaultQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitCapsDefaultQuery< + S extends AppLimitCapsDefaultSelect, + TData = { + appLimitCapsDefault: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCapsDefaultSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCapsDefault: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCapsDefaultQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCapsDefaultKeys.detail(params.id), - queryFn: () => getClient().appLimitCapsDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitCapsDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```ts * const data = await fetchAppLimitCapsDefaultQuery({ @@ -79,35 +99,46 @@ export async function fetchAppLimitCapsDefaultQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitCapsDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitCapsDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```ts * await prefetchAppLimitCapsDefaultQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitCapsDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCapsDefaultSelect>; -}): Promise; -export async function prefetchAppLimitCapsDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitCapsDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCapsDefaultSelect>; + } +): Promise; +export async function prefetchAppLimitCapsDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCapsDefaultKeys.detail(params.id), - queryFn: () => getClient().appLimitCapsDefault.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitCapsDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsDefaultsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsDefaultsQuery.ts index 42c2c901ea..9b50cb5744 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsDefaultsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsDefaultsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitCapsDefaultKeys } from "../query-keys"; -import type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations, AppLimitCapsDefaultFilter, AppLimitCapsDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapsDefaultSelect, AppLimitCapsDefaultWithRelations, AppLimitCapsDefaultFilter, AppLimitCapsDefaultOrderBy } from "../../orm/input-types"; +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 { appLimitCapsDefaultKeys } from '../query-keys'; +import type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultWithRelations, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCapsDefaultsQueryKey = appLimitCapsDefaultKeys.list; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCapsDefaultsQuery({ @@ -30,33 +45,58 @@ export const appLimitCapsDefaultsQueryKey = appLimitCapsDefaultKeys.list; * }); * ``` */ -export function useAppLimitCapsDefaultsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCapsDefaultSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCapsDefaultsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitCapsDefaultsQuery< + S extends AppLimitCapsDefaultSelect, + TData = { + appLimitCapsDefaults: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCapsDefaultSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCapsDefaults: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCapsDefaultsQuery( + params: { + selection: ListSelectionConfig< + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCapsDefaultKeys.list(args), queryFn: () => getClient().appLimitCapsDefault.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```ts * const data = await fetchAppLimitCapsDefaultsQuery({ @@ -70,35 +110,65 @@ export function useAppLimitCapsDefaultsQuery(params: { export async function fetchAppLimitCapsDefaultsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCapsDefaultSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCapsDefaultSelect>; }): Promise<{ appLimitCapsDefaults: ConnectionResult>; }>; export async function fetchAppLimitCapsDefaultsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy + >(params.selection); return getClient().appLimitCapsDefault.findMany(args).unwrap(); } /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```ts * await prefetchAppLimitCapsDefaultsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitCapsDefaultsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCapsDefaultSelect>; -}): Promise; -export async function prefetchAppLimitCapsDefaultsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitCapsDefaultsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCapsDefaultSelect>; + } +): Promise; +export async function prefetchAppLimitCapsDefaultsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCapsDefaultKeys.list(args), - queryFn: () => getClient().appLimitCapsDefault.findMany(args).unwrap() + queryFn: () => getClient().appLimitCapsDefault.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsQuery.ts index f7a43d0de2..527d7116c7 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCapsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitCapKeys } from "../query-keys"; -import type { AppLimitCapSelect, AppLimitCapWithRelations, AppLimitCapFilter, AppLimitCapOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCapSelect, AppLimitCapWithRelations, AppLimitCapFilter, AppLimitCapOrderBy } from "../../orm/input-types"; +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 { appLimitCapKeys } from '../query-keys'; +import type { + AppLimitCapSelect, + AppLimitCapWithRelations, + AppLimitCapFilter, + AppLimitCapOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitCapSelect, + AppLimitCapWithRelations, + AppLimitCapFilter, + AppLimitCapOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCapsQueryKey = appLimitCapKeys.list; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCapsQuery({ @@ -30,33 +45,47 @@ export const appLimitCapsQueryKey = appLimitCapKeys.list; * }); * ``` */ -export function useAppLimitCapsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCapSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCapsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitCapsQuery< + S extends AppLimitCapSelect, + TData = { + appLimitCaps: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitCapSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCaps: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCapsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCapKeys.list(args), queryFn: () => getClient().appLimitCap.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```ts * const data = await fetchAppLimitCapsQuery({ @@ -70,35 +99,47 @@ export function useAppLimitCapsQuery(params: { export async function fetchAppLimitCapsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCapSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitCapSelect>; }): Promise<{ appLimitCaps: ConnectionResult>; }>; export async function fetchAppLimitCapsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().appLimitCap.findMany(args).unwrap(); } /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```ts * await prefetchAppLimitCapsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitCapsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCapSelect>; -}): Promise; -export async function prefetchAppLimitCapsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitCapsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitCapSelect>; + } +): Promise; +export async function prefetchAppLimitCapsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: appLimitCapKeys.list(args), - queryFn: () => getClient().appLimitCap.findMany(args).unwrap() + queryFn: () => getClient().appLimitCap.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeItemQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeItemQuery.ts index 844b403754..b8ba3b889b 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeItemQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeItemQuery.ts @@ -4,20 +4,26 @@ * 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 { appLimitCreditCodeItemKeys } from "../query-keys"; -import type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations } from "../../orm/input-types"; +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 { appLimitCreditCodeItemKeys } from '../query-keys'; +import type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCreditCodeItemQueryKey = appLimitCreditCodeItemKeys.detail; /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCreditCodeItemQuery({ @@ -26,38 +32,52 @@ export const appLimitCreditCodeItemQueryKey = appLimitCreditCodeItemKeys.detail; * }); * ``` */ -export function useAppLimitCreditCodeItemQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCreditCodeItemSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCreditCodeItemQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitCreditCodeItemQuery< + S extends AppLimitCreditCodeItemSelect, + TData = { + appLimitCreditCodeItem: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCreditCodeItemSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCreditCodeItem: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCreditCodeItemQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCreditCodeItemKeys.detail(params.id), - queryFn: () => getClient().appLimitCreditCodeItem.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitCreditCodeItem.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```ts * const data = await fetchAppLimitCreditCodeItemQuery({ @@ -66,7 +86,9 @@ export function useAppLimitCreditCodeItemQuery(params: { * }); * ``` */ -export async function fetchAppLimitCreditCodeItemQuery(params: { +export async function fetchAppLimitCreditCodeItemQuery< + S extends AppLimitCreditCodeItemSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +101,46 @@ export async function fetchAppLimitCreditCodeItemQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitCreditCodeItem.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitCreditCodeItem.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```ts * await prefetchAppLimitCreditCodeItemQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitCreditCodeItemQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCreditCodeItemSelect>; -}): Promise; -export async function prefetchAppLimitCreditCodeItemQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitCreditCodeItemQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCreditCodeItemSelect>; + } +): Promise; +export async function prefetchAppLimitCreditCodeItemQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCreditCodeItemKeys.detail(params.id), - queryFn: () => getClient().appLimitCreditCodeItem.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitCreditCodeItem.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeItemsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeItemsQuery.ts index 50eeec71ca..8e026ce03b 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeItemsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeItemsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitCreditCodeItemKeys } from "../query-keys"; -import type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations, AppLimitCreditCodeItemFilter, AppLimitCreditCodeItemOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemWithRelations, AppLimitCreditCodeItemFilter, AppLimitCreditCodeItemOrderBy } from "../../orm/input-types"; +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 { appLimitCreditCodeItemKeys } from '../query-keys'; +import type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemWithRelations, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCreditCodeItemsQueryKey = appLimitCreditCodeItemKeys.list; /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCreditCodeItemsQuery({ @@ -30,33 +45,60 @@ export const appLimitCreditCodeItemsQueryKey = appLimitCreditCodeItemKeys.list; * }); * ``` */ -export function useAppLimitCreditCodeItemsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditCodeItemSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCreditCodeItemsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitCreditCodeItemsQuery< + S extends AppLimitCreditCodeItemSelect, + TData = { + appLimitCreditCodeItems: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCreditCodeItemSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCreditCodeItems: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCreditCodeItemsQuery( + params: { + selection: ListSelectionConfig< + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCreditCodeItemKeys.list(args), queryFn: () => getClient().appLimitCreditCodeItem.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```ts * const data = await fetchAppLimitCreditCodeItemsQuery({ @@ -67,38 +109,72 @@ export function useAppLimitCreditCodeItemsQuery(params: { * }); * ``` */ -export async function fetchAppLimitCreditCodeItemsQuery(params: { +export async function fetchAppLimitCreditCodeItemsQuery< + S extends AppLimitCreditCodeItemSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditCodeItemSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCreditCodeItemSelect>; }): Promise<{ - appLimitCreditCodeItems: ConnectionResult>; + appLimitCreditCodeItems: ConnectionResult< + InferSelectResult + >; }>; export async function fetchAppLimitCreditCodeItemsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy + >(params.selection); return getClient().appLimitCreditCodeItem.findMany(args).unwrap(); } /** * Items within a credit code — each row grants credits for a specific limit definition - * + * * @example * ```ts * await prefetchAppLimitCreditCodeItemsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitCreditCodeItemsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditCodeItemSelect>; -}): Promise; -export async function prefetchAppLimitCreditCodeItemsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitCreditCodeItemsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCreditCodeItemSelect>; + } +): Promise; +export async function prefetchAppLimitCreditCodeItemsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCreditCodeItemKeys.list(args), - queryFn: () => getClient().appLimitCreditCodeItem.findMany(args).unwrap() + queryFn: () => getClient().appLimitCreditCodeItem.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeQuery.ts index d744e7828b..dcf2a2b52b 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodeQuery.ts @@ -4,20 +4,26 @@ * 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 { appLimitCreditCodeKeys } from "../query-keys"; -import type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations } from "../../orm/input-types"; +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 { appLimitCreditCodeKeys } from '../query-keys'; +import type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCreditCodeQueryKey = appLimitCreditCodeKeys.detail; /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCreditCodeQuery({ @@ -26,38 +32,52 @@ export const appLimitCreditCodeQueryKey = appLimitCreditCodeKeys.detail; * }); * ``` */ -export function useAppLimitCreditCodeQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCreditCodeSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCreditCodeQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitCreditCodeQuery< + S extends AppLimitCreditCodeSelect, + TData = { + appLimitCreditCode: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCreditCodeSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCreditCode: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCreditCodeQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCreditCodeKeys.detail(params.id), - queryFn: () => getClient().appLimitCreditCode.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitCreditCode.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```ts * const data = await fetchAppLimitCreditCodeQuery({ @@ -79,35 +99,46 @@ export async function fetchAppLimitCreditCodeQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitCreditCode.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitCreditCode.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```ts * await prefetchAppLimitCreditCodeQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitCreditCodeQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCreditCodeSelect>; -}): Promise; -export async function prefetchAppLimitCreditCodeQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitCreditCodeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCreditCodeSelect>; + } +): Promise; +export async function prefetchAppLimitCreditCodeQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCreditCodeKeys.detail(params.id), - queryFn: () => getClient().appLimitCreditCode.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitCreditCode.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodesQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodesQuery.ts index 8fffa6b723..c69d74cd1a 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodesQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditCodesQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitCreditCodeKeys } from "../query-keys"; -import type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations, AppLimitCreditCodeFilter, AppLimitCreditCodeOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditCodeSelect, AppLimitCreditCodeWithRelations, AppLimitCreditCodeFilter, AppLimitCreditCodeOrderBy } from "../../orm/input-types"; +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 { appLimitCreditCodeKeys } from '../query-keys'; +import type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitCreditCodeSelect, + AppLimitCreditCodeWithRelations, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCreditCodesQueryKey = appLimitCreditCodeKeys.list; /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCreditCodesQuery({ @@ -30,33 +45,58 @@ export const appLimitCreditCodesQueryKey = appLimitCreditCodeKeys.list; * }); * ``` */ -export function useAppLimitCreditCodesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditCodeSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCreditCodesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitCreditCodesQuery< + S extends AppLimitCreditCodeSelect, + TData = { + appLimitCreditCodes: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCreditCodeSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCreditCodes: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCreditCodesQuery( + params: { + selection: ListSelectionConfig< + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCreditCodeKeys.list(args), queryFn: () => getClient().appLimitCreditCode.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```ts * const data = await fetchAppLimitCreditCodesQuery({ @@ -70,35 +110,62 @@ export function useAppLimitCreditCodesQuery(params: { export async function fetchAppLimitCreditCodesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditCodeSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitCreditCodeSelect>; }): Promise<{ appLimitCreditCodes: ConnectionResult>; }>; export async function fetchAppLimitCreditCodesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy + >(params.selection); return getClient().appLimitCreditCode.findMany(args).unwrap(); } /** * Redeemable credit codes managed by admins with the add_credits permission - * + * * @example * ```ts * await prefetchAppLimitCreditCodesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitCreditCodesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditCodeSelect>; -}): Promise; -export async function prefetchAppLimitCreditCodesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitCreditCodesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCreditCodeSelect>; + } +): Promise; +export async function prefetchAppLimitCreditCodesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCreditCodeKeys.list(args), - queryFn: () => getClient().appLimitCreditCode.findMany(args).unwrap() + queryFn: () => getClient().appLimitCreditCode.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditQuery.ts index 5e41238040..2189326669 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditQuery.ts @@ -4,20 +4,20 @@ * 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 { appLimitCreditKeys } from "../query-keys"; -import type { AppLimitCreditSelect, AppLimitCreditWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditSelect, AppLimitCreditWithRelations } from "../../orm/input-types"; +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 { appLimitCreditKeys } from '../query-keys'; +import type { AppLimitCreditSelect, AppLimitCreditWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitCreditSelect, AppLimitCreditWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCreditQueryKey = appLimitCreditKeys.detail; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCreditQuery({ @@ -26,38 +26,52 @@ export const appLimitCreditQueryKey = appLimitCreditKeys.detail; * }); * ``` */ -export function useAppLimitCreditQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCreditSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCreditQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitCreditQuery< + S extends AppLimitCreditSelect, + TData = { + appLimitCredit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCreditSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCredit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCreditQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCreditKeys.detail(params.id), - queryFn: () => getClient().appLimitCredit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitCredit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```ts * const data = await fetchAppLimitCreditQuery({ @@ -79,35 +93,46 @@ export async function fetchAppLimitCreditQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitCredit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitCredit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```ts * await prefetchAppLimitCreditQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitCreditQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCreditSelect>; -}): Promise; -export async function prefetchAppLimitCreditQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitCreditQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCreditSelect>; + } +): Promise; +export async function prefetchAppLimitCreditQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCreditKeys.detail(params.id), - queryFn: () => getClient().appLimitCredit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitCredit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditRedemptionQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditRedemptionQuery.ts index f04090acda..dbf6fa43db 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditRedemptionQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditRedemptionQuery.ts @@ -4,20 +4,26 @@ * 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 { appLimitCreditRedemptionKeys } from "../query-keys"; -import type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations } from "../../orm/input-types"; +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 { appLimitCreditRedemptionKeys } from '../query-keys'; +import type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCreditRedemptionQueryKey = appLimitCreditRedemptionKeys.detail; /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCreditRedemptionQuery({ @@ -26,38 +32,55 @@ export const appLimitCreditRedemptionQueryKey = appLimitCreditRedemptionKeys.det * }); * ``` */ -export function useAppLimitCreditRedemptionQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCreditRedemptionSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCreditRedemptionQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitCreditRedemptionQuery< + S extends AppLimitCreditRedemptionSelect, + TData = { + appLimitCreditRedemption: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCreditRedemptionSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCreditRedemption: InferSelectResult< + AppLimitCreditRedemptionWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCreditRedemptionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCreditRedemptionKeys.detail(params.id), - queryFn: () => getClient().appLimitCreditRedemption.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitCreditRedemption.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```ts * const data = await fetchAppLimitCreditRedemptionQuery({ @@ -66,7 +89,9 @@ export function useAppLimitCreditRedemptionQuery(params: { * }); * ``` */ -export async function fetchAppLimitCreditRedemptionQuery(params: { +export async function fetchAppLimitCreditRedemptionQuery< + S extends AppLimitCreditRedemptionSelect, +>(params: { id: string; selection: { fields: S; @@ -79,35 +104,48 @@ export async function fetchAppLimitCreditRedemptionQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitCreditRedemption.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitCreditRedemption.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```ts * await prefetchAppLimitCreditRedemptionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitCreditRedemptionQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitCreditRedemptionSelect>; -}): Promise; -export async function prefetchAppLimitCreditRedemptionQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitCreditRedemptionQuery< + S extends AppLimitCreditRedemptionSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitCreditRedemptionSelect>; + } +): Promise; +export async function prefetchAppLimitCreditRedemptionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCreditRedemptionKeys.detail(params.id), - queryFn: () => getClient().appLimitCreditRedemption.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitCreditRedemption.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditRedemptionsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditRedemptionsQuery.ts index d7c99a4ef9..099a5d24bf 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditRedemptionsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditRedemptionsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitCreditRedemptionKeys } from "../query-keys"; -import type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations, AppLimitCreditRedemptionFilter, AppLimitCreditRedemptionOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionWithRelations, AppLimitCreditRedemptionFilter, AppLimitCreditRedemptionOrderBy } from "../../orm/input-types"; +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 { appLimitCreditRedemptionKeys } from '../query-keys'; +import type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionWithRelations, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCreditRedemptionsQueryKey = appLimitCreditRedemptionKeys.list; /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCreditRedemptionsQuery({ @@ -30,33 +45,60 @@ export const appLimitCreditRedemptionsQueryKey = appLimitCreditRedemptionKeys.li * }); * ``` */ -export function useAppLimitCreditRedemptionsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditRedemptionSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCreditRedemptionsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitCreditRedemptionsQuery< + S extends AppLimitCreditRedemptionSelect, + TData = { + appLimitCreditRedemptions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCreditRedemptionSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCreditRedemptions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCreditRedemptionsQuery( + params: { + selection: ListSelectionConfig< + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCreditRedemptionKeys.list(args), queryFn: () => getClient().appLimitCreditRedemption.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```ts * const data = await fetchAppLimitCreditRedemptionsQuery({ @@ -67,38 +109,74 @@ export function useAppLimitCreditRedemptionsQuery(params: { * }); * ``` */ -export async function fetchAppLimitCreditRedemptionsQuery(params: { +export async function fetchAppLimitCreditRedemptionsQuery< + S extends AppLimitCreditRedemptionSelect, +>(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditRedemptionSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCreditRedemptionSelect>; }): Promise<{ - appLimitCreditRedemptions: ConnectionResult>; + appLimitCreditRedemptions: ConnectionResult< + InferSelectResult + >; }>; export async function fetchAppLimitCreditRedemptionsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy + >(params.selection); return getClient().appLimitCreditRedemption.findMany(args).unwrap(); } /** * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits - * + * * @example * ```ts * await prefetchAppLimitCreditRedemptionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitCreditRedemptionsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditRedemptionSelect>; -}): Promise; -export async function prefetchAppLimitCreditRedemptionsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitCreditRedemptionsQuery< + S extends AppLimitCreditRedemptionSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, AppLimitCreditRedemptionSelect>; + } +): Promise; +export async function prefetchAppLimitCreditRedemptionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCreditRedemptionKeys.list(args), - queryFn: () => getClient().appLimitCreditRedemption.findMany(args).unwrap() + queryFn: () => getClient().appLimitCreditRedemption.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditsQuery.ts index 42bd9a4ed9..30d99ddbe1 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitCreditsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitCreditKeys } from "../query-keys"; -import type { AppLimitCreditSelect, AppLimitCreditWithRelations, AppLimitCreditFilter, AppLimitCreditOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitCreditSelect, AppLimitCreditWithRelations, AppLimitCreditFilter, AppLimitCreditOrderBy } from "../../orm/input-types"; +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 { appLimitCreditKeys } from '../query-keys'; +import type { + AppLimitCreditSelect, + AppLimitCreditWithRelations, + AppLimitCreditFilter, + AppLimitCreditOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitCreditSelect, + AppLimitCreditWithRelations, + AppLimitCreditFilter, + AppLimitCreditOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitCreditsQueryKey = appLimitCreditKeys.list; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitCreditsQuery({ @@ -30,33 +45,53 @@ export const appLimitCreditsQueryKey = appLimitCreditKeys.list; * }); * ``` */ -export function useAppLimitCreditsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitCreditsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitCreditsQuery< + S extends AppLimitCreditSelect, + TData = { + appLimitCredits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitCreditSelect>; + } & Omit< + UseQueryOptions< + { + appLimitCredits: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitCreditsQuery( + params: { + selection: ListSelectionConfig< + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitCreditKeys.list(args), queryFn: () => getClient().appLimitCredit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```ts * const data = await fetchAppLimitCreditsQuery({ @@ -70,35 +105,55 @@ export function useAppLimitCreditsQuery(params: { export async function fetchAppLimitCreditsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitCreditSelect>; }): Promise<{ appLimitCredits: ConnectionResult>; }>; export async function fetchAppLimitCreditsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy + >(params.selection); return getClient().appLimitCredit.findMany(args).unwrap(); } /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```ts * await prefetchAppLimitCreditsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitCreditsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitCreditSelect>; -}): Promise; -export async function prefetchAppLimitCreditsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitCreditsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitCreditSelect>; + } +): Promise; +export async function prefetchAppLimitCreditsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitCreditKeys.list(args), - queryFn: () => getClient().appLimitCredit.findMany(args).unwrap() + queryFn: () => getClient().appLimitCredit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitDefaultQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitDefaultQuery.ts index c0aa4ae6c0..4f47866385 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitDefaultQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitDefaultQuery.ts @@ -4,20 +4,20 @@ * 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 { appLimitDefaultKeys } from "../query-keys"; -import type { AppLimitDefaultSelect, AppLimitDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitDefaultSelect, AppLimitDefaultWithRelations } from "../../orm/input-types"; +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 { appLimitDefaultKeys } from '../query-keys'; +import type { AppLimitDefaultSelect, AppLimitDefaultWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitDefaultSelect, AppLimitDefaultWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitDefaultQueryKey = appLimitDefaultKeys.detail; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitDefaultQuery({ @@ -26,38 +26,52 @@ export const appLimitDefaultQueryKey = appLimitDefaultKeys.detail; * }); * ``` */ -export function useAppLimitDefaultQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitDefaultSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitDefaultQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitDefaultQuery< + S extends AppLimitDefaultSelect, + TData = { + appLimitDefault: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitDefaultSelect>; + } & Omit< + UseQueryOptions< + { + appLimitDefault: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitDefaultQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitDefaultKeys.detail(params.id), - queryFn: () => getClient().appLimitDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```ts * const data = await fetchAppLimitDefaultQuery({ @@ -79,35 +93,46 @@ export async function fetchAppLimitDefaultQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```ts * await prefetchAppLimitDefaultQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitDefaultSelect>; -}): Promise; -export async function prefetchAppLimitDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitDefaultSelect>; + } +): Promise; +export async function prefetchAppLimitDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitDefaultKeys.detail(params.id), - queryFn: () => getClient().appLimitDefault.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitDefaultsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitDefaultsQuery.ts index b1c25dc64f..25eb721824 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitDefaultsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitDefaultsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitDefaultKeys } from "../query-keys"; -import type { AppLimitDefaultSelect, AppLimitDefaultWithRelations, AppLimitDefaultFilter, AppLimitDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitDefaultSelect, AppLimitDefaultWithRelations, AppLimitDefaultFilter, AppLimitDefaultOrderBy } from "../../orm/input-types"; +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 { appLimitDefaultKeys } from '../query-keys'; +import type { + AppLimitDefaultSelect, + AppLimitDefaultWithRelations, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitDefaultSelect, + AppLimitDefaultWithRelations, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitDefaultsQueryKey = appLimitDefaultKeys.list; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitDefaultsQuery({ @@ -30,33 +45,53 @@ export const appLimitDefaultsQueryKey = appLimitDefaultKeys.list; * }); * ``` */ -export function useAppLimitDefaultsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitDefaultSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitDefaultsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitDefaultsQuery< + S extends AppLimitDefaultSelect, + TData = { + appLimitDefaults: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitDefaultSelect>; + } & Omit< + UseQueryOptions< + { + appLimitDefaults: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitDefaultsQuery( + params: { + selection: ListSelectionConfig< + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitDefaultKeys.list(args), queryFn: () => getClient().appLimitDefault.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```ts * const data = await fetchAppLimitDefaultsQuery({ @@ -70,35 +105,59 @@ export function useAppLimitDefaultsQuery(params: { export async function fetchAppLimitDefaultsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitDefaultSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitDefaultSelect>; }): Promise<{ appLimitDefaults: ConnectionResult>; }>; export async function fetchAppLimitDefaultsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy + >(params.selection); return getClient().appLimitDefault.findMany(args).unwrap(); } /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```ts * await prefetchAppLimitDefaultsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitDefaultsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitDefaultSelect>; -}): Promise; -export async function prefetchAppLimitDefaultsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitDefaultsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitDefaultSelect>; + } +): Promise; +export async function prefetchAppLimitDefaultsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitDefaultKeys.list(args), - queryFn: () => getClient().appLimitDefault.findMany(args).unwrap() + queryFn: () => getClient().appLimitDefault.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitEventQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitEventQuery.ts index 8036d1f05f..3303e3895d 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitEventQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitEventQuery.ts @@ -4,20 +4,20 @@ * 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 { appLimitEventKeys } from "../query-keys"; -import type { AppLimitEventSelect, AppLimitEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitEventSelect, AppLimitEventWithRelations } from "../../orm/input-types"; +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 { appLimitEventKeys } from '../query-keys'; +import type { AppLimitEventSelect, AppLimitEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitEventSelect, AppLimitEventWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitEventQueryKey = appLimitEventKeys.detail; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitEventQuery({ @@ -26,38 +26,52 @@ export const appLimitEventQueryKey = appLimitEventKeys.detail; * }); * ``` */ -export function useAppLimitEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitEventQuery< + S extends AppLimitEventSelect, + TData = { + appLimitEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitEventSelect>; + } & Omit< + UseQueryOptions< + { + appLimitEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitEventKeys.detail(params.id), - queryFn: () => getClient().appLimitEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```ts * const data = await fetchAppLimitEventQuery({ @@ -79,35 +93,46 @@ export async function fetchAppLimitEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```ts * await prefetchAppLimitEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitEventSelect>; -}): Promise; -export async function prefetchAppLimitEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitEventSelect>; + } +): Promise; +export async function prefetchAppLimitEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitEventKeys.detail(params.id), - queryFn: () => getClient().appLimitEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitEventsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitEventsQuery.ts index 370005b9f5..034cba89c7 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitEventsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitEventKeys } from "../query-keys"; -import type { AppLimitEventSelect, AppLimitEventWithRelations, AppLimitEventFilter, AppLimitEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitEventSelect, AppLimitEventWithRelations, AppLimitEventFilter, AppLimitEventOrderBy } from "../../orm/input-types"; +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 { appLimitEventKeys } from '../query-keys'; +import type { + AppLimitEventSelect, + AppLimitEventWithRelations, + AppLimitEventFilter, + AppLimitEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitEventSelect, + AppLimitEventWithRelations, + AppLimitEventFilter, + AppLimitEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitEventsQueryKey = appLimitEventKeys.list; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitEventsQuery({ @@ -30,33 +45,49 @@ export const appLimitEventsQueryKey = appLimitEventKeys.list; * }); * ``` */ -export function useAppLimitEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitEventsQuery< + S extends AppLimitEventSelect, + TData = { + appLimitEvents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitEventSelect>; + } & Omit< + UseQueryOptions< + { + appLimitEvents: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitEventsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppLimitEventSelect, + AppLimitEventFilter, + AppLimitEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitEventKeys.list(args), queryFn: () => getClient().appLimitEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```ts * const data = await fetchAppLimitEventsQuery({ @@ -70,35 +101,51 @@ export function useAppLimitEventsQuery(params: { export async function fetchAppLimitEventsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitEventSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitEventSelect>; }): Promise<{ appLimitEvents: ConnectionResult>; }>; export async function fetchAppLimitEventsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppLimitEventSelect, + AppLimitEventFilter, + AppLimitEventOrderBy + >(params.selection); return getClient().appLimitEvent.findMany(args).unwrap(); } /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```ts * await prefetchAppLimitEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitEventSelect>; -}): Promise; -export async function prefetchAppLimitEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitEventSelect>; + } +): Promise; +export async function prefetchAppLimitEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + AppLimitEventSelect, + AppLimitEventFilter, + AppLimitEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitEventKeys.list(args), - queryFn: () => getClient().appLimitEvent.findMany(args).unwrap() + queryFn: () => getClient().appLimitEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitQuery.ts index 73208926cc..178e4553a3 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitQuery.ts @@ -4,20 +4,20 @@ * 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 { appLimitKeys } from "../query-keys"; -import type { AppLimitSelect, AppLimitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitSelect, AppLimitWithRelations } from "../../orm/input-types"; +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 { appLimitKeys } from '../query-keys'; +import type { AppLimitSelect, AppLimitWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitSelect, AppLimitWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitQueryKey = appLimitKeys.detail; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitQuery({ @@ -26,38 +26,52 @@ export const appLimitQueryKey = appLimitKeys.detail; * }); * ``` */ -export function useAppLimitQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitQuery< + S extends AppLimitSelect, + TData = { + appLimit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitSelect>; + } & Omit< + UseQueryOptions< + { + appLimit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitKeys.detail(params.id), - queryFn: () => getClient().appLimit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```ts * const data = await fetchAppLimitQuery({ @@ -79,35 +93,46 @@ export async function fetchAppLimitQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```ts * await prefetchAppLimitQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitSelect>; -}): Promise; -export async function prefetchAppLimitQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitSelect>; + } +): Promise; +export async function prefetchAppLimitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitKeys.detail(params.id), - queryFn: () => getClient().appLimit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitWarningQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitWarningQuery.ts index 675a629053..9fb73272ae 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitWarningQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitWarningQuery.ts @@ -4,20 +4,20 @@ * 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 { appLimitWarningKeys } from "../query-keys"; -import type { AppLimitWarningSelect, AppLimitWarningWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitWarningSelect, AppLimitWarningWithRelations } from "../../orm/input-types"; +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 { appLimitWarningKeys } from '../query-keys'; +import type { AppLimitWarningSelect, AppLimitWarningWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { AppLimitWarningSelect, AppLimitWarningWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitWarningQueryKey = appLimitWarningKeys.detail; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitWarningQuery({ @@ -26,38 +26,52 @@ export const appLimitWarningQueryKey = appLimitWarningKeys.detail; * }); * ``` */ -export function useAppLimitWarningQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitWarningSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitWarningQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useAppLimitWarningQuery< + S extends AppLimitWarningSelect, + TData = { + appLimitWarning: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitWarningSelect>; + } & Omit< + UseQueryOptions< + { + appLimitWarning: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitWarningQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitWarningKeys.detail(params.id), - queryFn: () => getClient().appLimitWarning.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .appLimitWarning.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```ts * const data = await fetchAppLimitWarningQuery({ @@ -79,35 +93,46 @@ export async function fetchAppLimitWarningQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().appLimitWarning.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .appLimitWarning.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```ts * await prefetchAppLimitWarningQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchAppLimitWarningQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, AppLimitWarningSelect>; -}): Promise; -export async function prefetchAppLimitWarningQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchAppLimitWarningQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, AppLimitWarningSelect>; + } +): Promise; +export async function prefetchAppLimitWarningQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitWarningKeys.detail(params.id), - queryFn: () => getClient().appLimitWarning.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .appLimitWarning.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitWarningsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitWarningsQuery.ts index 4fc01b8821..37c264c247 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitWarningsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitWarningsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitWarningKeys } from "../query-keys"; -import type { AppLimitWarningSelect, AppLimitWarningWithRelations, AppLimitWarningFilter, AppLimitWarningOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitWarningSelect, AppLimitWarningWithRelations, AppLimitWarningFilter, AppLimitWarningOrderBy } from "../../orm/input-types"; +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 { appLimitWarningKeys } from '../query-keys'; +import type { + AppLimitWarningSelect, + AppLimitWarningWithRelations, + AppLimitWarningFilter, + AppLimitWarningOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitWarningSelect, + AppLimitWarningWithRelations, + AppLimitWarningFilter, + AppLimitWarningOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitWarningsQueryKey = appLimitWarningKeys.list; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitWarningsQuery({ @@ -30,33 +45,53 @@ export const appLimitWarningsQueryKey = appLimitWarningKeys.list; * }); * ``` */ -export function useAppLimitWarningsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitWarningSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitWarningsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitWarningsQuery< + S extends AppLimitWarningSelect, + TData = { + appLimitWarnings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitWarningSelect>; + } & Omit< + UseQueryOptions< + { + appLimitWarnings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitWarningsQuery( + params: { + selection: ListSelectionConfig< + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitWarningKeys.list(args), queryFn: () => getClient().appLimitWarning.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```ts * const data = await fetchAppLimitWarningsQuery({ @@ -70,35 +105,59 @@ export function useAppLimitWarningsQuery(params: { export async function fetchAppLimitWarningsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitWarningSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitWarningSelect>; }): Promise<{ appLimitWarnings: ConnectionResult>; }>; export async function fetchAppLimitWarningsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy + >(params.selection); return getClient().appLimitWarning.findMany(args).unwrap(); } /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```ts * await prefetchAppLimitWarningsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitWarningsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitWarningSelect>; -}): Promise; -export async function prefetchAppLimitWarningsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitWarningsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitWarningSelect>; + } +): Promise; +export async function prefetchAppLimitWarningsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: appLimitWarningKeys.list(args), - queryFn: () => getClient().appLimitWarning.findMany(args).unwrap() + queryFn: () => getClient().appLimitWarning.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitsQuery.ts index a6fcb7c6db..fc868ff906 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useAppLimitsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useAppLimitsQuery.ts @@ -4,20 +4,35 @@ * 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 { appLimitKeys } from "../query-keys"; -import type { AppLimitSelect, AppLimitWithRelations, AppLimitFilter, AppLimitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { AppLimitSelect, AppLimitWithRelations, AppLimitFilter, AppLimitOrderBy } from "../../orm/input-types"; +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 { appLimitKeys } from '../query-keys'; +import type { + AppLimitSelect, + AppLimitWithRelations, + AppLimitFilter, + AppLimitOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + AppLimitSelect, + AppLimitWithRelations, + AppLimitFilter, + AppLimitOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const appLimitsQueryKey = appLimitKeys.list; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { data, isLoading } = useAppLimitsQuery({ @@ -30,33 +45,47 @@ export const appLimitsQueryKey = appLimitKeys.list; * }); * ``` */ -export function useAppLimitsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useAppLimitsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useAppLimitsQuery< + S extends AppLimitSelect, + TData = { + appLimits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitSelect>; + } & Omit< + UseQueryOptions< + { + appLimits: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useAppLimitsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: appLimitKeys.list(args), queryFn: () => getClient().appLimit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```ts * const data = await fetchAppLimitsQuery({ @@ -70,35 +99,47 @@ export function useAppLimitsQuery(params: { export async function fetchAppLimitsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitSelect>; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitSelect>; }): Promise<{ appLimits: ConnectionResult>; }>; export async function fetchAppLimitsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().appLimit.findMany(args).unwrap(); } /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```ts * await prefetchAppLimitsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchAppLimitsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, AppLimitSelect>; -}): Promise; -export async function prefetchAppLimitsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchAppLimitsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, AppLimitSelect>; + } +): Promise; +export async function prefetchAppLimitsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: appLimitKeys.list(args), - queryFn: () => getClient().appLimit.findMany(args).unwrap() + queryFn: () => getClient().appLimit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitAggregateQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitAggregateQuery.ts index 30e3acc89c..efe5a4a53a 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitAggregateQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitAggregateQuery.ts @@ -4,20 +4,26 @@ * 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 { orgLimitAggregateKeys } from "../query-keys"; -import type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations } from "../../orm/input-types"; +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 { orgLimitAggregateKeys } from '../query-keys'; +import type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitAggregateQueryKey = orgLimitAggregateKeys.detail; /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitAggregateQuery({ @@ -26,38 +32,52 @@ export const orgLimitAggregateQueryKey = orgLimitAggregateKeys.detail; * }); * ``` */ -export function useOrgLimitAggregateQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitAggregateSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitAggregateQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgLimitAggregateQuery< + S extends OrgLimitAggregateSelect, + TData = { + orgLimitAggregate: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitAggregateSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitAggregate: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitAggregateQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitAggregateKeys.detail(params.id), - queryFn: () => getClient().orgLimitAggregate.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgLimitAggregate.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```ts * const data = await fetchOrgLimitAggregateQuery({ @@ -79,35 +99,46 @@ export async function fetchOrgLimitAggregateQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgLimitAggregate.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgLimitAggregate.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```ts * await prefetchOrgLimitAggregateQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgLimitAggregateQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitAggregateSelect>; -}): Promise; -export async function prefetchOrgLimitAggregateQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgLimitAggregateQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitAggregateSelect>; + } +): Promise; +export async function prefetchOrgLimitAggregateQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitAggregateKeys.detail(params.id), - queryFn: () => getClient().orgLimitAggregate.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgLimitAggregate.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitAggregatesQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitAggregatesQuery.ts index 3fa465dca5..9f0caf3f39 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitAggregatesQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitAggregatesQuery.ts @@ -4,20 +4,35 @@ * 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 { orgLimitAggregateKeys } from "../query-keys"; -import type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations, OrgLimitAggregateFilter, OrgLimitAggregateOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitAggregateSelect, OrgLimitAggregateWithRelations, OrgLimitAggregateFilter, OrgLimitAggregateOrderBy } from "../../orm/input-types"; +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 { orgLimitAggregateKeys } from '../query-keys'; +import type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgLimitAggregateSelect, + OrgLimitAggregateWithRelations, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitAggregatesQueryKey = orgLimitAggregateKeys.list; /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitAggregatesQuery({ @@ -30,33 +45,53 @@ export const orgLimitAggregatesQueryKey = orgLimitAggregateKeys.list; * }); * ``` */ -export function useOrgLimitAggregatesQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitAggregateSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitAggregatesQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgLimitAggregatesQuery< + S extends OrgLimitAggregateSelect, + TData = { + orgLimitAggregates: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitAggregateSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitAggregates: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitAggregatesQuery( + params: { + selection: ListSelectionConfig< + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitAggregateKeys.list(args), queryFn: () => getClient().orgLimitAggregate.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```ts * const data = await fetchOrgLimitAggregatesQuery({ @@ -70,35 +105,59 @@ export function useOrgLimitAggregatesQuery(params: { export async function fetchOrgLimitAggregatesQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitAggregateSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitAggregateSelect>; }): Promise<{ orgLimitAggregates: ConnectionResult>; }>; export async function fetchOrgLimitAggregatesQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy + >(params.selection); return getClient().orgLimitAggregate.findMany(args).unwrap(); } /** * Tracks aggregate entity-level usage counts (org-wide caps, no per-user breakdown) - * + * * @example * ```ts * await prefetchOrgLimitAggregatesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgLimitAggregatesQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitAggregateSelect>; -}): Promise; -export async function prefetchOrgLimitAggregatesQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgLimitAggregatesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitAggregateSelect>; + } +): Promise; +export async function prefetchOrgLimitAggregatesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitAggregateKeys.list(args), - queryFn: () => getClient().orgLimitAggregate.findMany(args).unwrap() + queryFn: () => getClient().orgLimitAggregate.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapQuery.ts index 2642935f4d..222f8b38e9 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapQuery.ts @@ -4,20 +4,20 @@ * 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 { orgLimitCapKeys } from "../query-keys"; -import type { OrgLimitCapSelect, OrgLimitCapWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapSelect, OrgLimitCapWithRelations } from "../../orm/input-types"; +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 { orgLimitCapKeys } from '../query-keys'; +import type { OrgLimitCapSelect, OrgLimitCapWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitCapSelect, OrgLimitCapWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitCapQueryKey = orgLimitCapKeys.detail; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitCapQuery({ @@ -26,38 +26,52 @@ export const orgLimitCapQueryKey = orgLimitCapKeys.detail; * }); * ``` */ -export function useOrgLimitCapQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitCapSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitCapQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgLimitCapQuery< + S extends OrgLimitCapSelect, + TData = { + orgLimitCap: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitCapSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitCap: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitCapQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitCapKeys.detail(params.id), - queryFn: () => getClient().orgLimitCap.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgLimitCap.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```ts * const data = await fetchOrgLimitCapQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgLimitCapQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgLimitCap.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgLimitCap.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```ts * await prefetchOrgLimitCapQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgLimitCapQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitCapSelect>; -}): Promise; -export async function prefetchOrgLimitCapQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgLimitCapQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitCapSelect>; + } +): Promise; +export async function prefetchOrgLimitCapQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitCapKeys.detail(params.id), - queryFn: () => getClient().orgLimitCap.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgLimitCap.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsDefaultQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsDefaultQuery.ts index f0a8a2510a..a74df9a29f 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsDefaultQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsDefaultQuery.ts @@ -4,20 +4,26 @@ * 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 { orgLimitCapsDefaultKeys } from "../query-keys"; -import type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations } from "../../orm/input-types"; +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 { orgLimitCapsDefaultKeys } from '../query-keys'; +import type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitCapsDefaultQueryKey = orgLimitCapsDefaultKeys.detail; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitCapsDefaultQuery({ @@ -26,38 +32,52 @@ export const orgLimitCapsDefaultQueryKey = orgLimitCapsDefaultKeys.detail; * }); * ``` */ -export function useOrgLimitCapsDefaultQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitCapsDefaultSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitCapsDefaultQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgLimitCapsDefaultQuery< + S extends OrgLimitCapsDefaultSelect, + TData = { + orgLimitCapsDefault: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitCapsDefaultSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitCapsDefault: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitCapsDefaultQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitCapsDefaultKeys.detail(params.id), - queryFn: () => getClient().orgLimitCapsDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgLimitCapsDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```ts * const data = await fetchOrgLimitCapsDefaultQuery({ @@ -79,35 +99,46 @@ export async function fetchOrgLimitCapsDefaultQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgLimitCapsDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgLimitCapsDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```ts * await prefetchOrgLimitCapsDefaultQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgLimitCapsDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitCapsDefaultSelect>; -}): Promise; -export async function prefetchOrgLimitCapsDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgLimitCapsDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitCapsDefaultSelect>; + } +): Promise; +export async function prefetchOrgLimitCapsDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitCapsDefaultKeys.detail(params.id), - queryFn: () => getClient().orgLimitCapsDefault.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgLimitCapsDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsDefaultsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsDefaultsQuery.ts index ff7476c18f..2d94c1883e 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsDefaultsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsDefaultsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgLimitCapsDefaultKeys } from "../query-keys"; -import type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations, OrgLimitCapsDefaultFilter, OrgLimitCapsDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultWithRelations, OrgLimitCapsDefaultFilter, OrgLimitCapsDefaultOrderBy } from "../../orm/input-types"; +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 { orgLimitCapsDefaultKeys } from '../query-keys'; +import type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultWithRelations, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitCapsDefaultsQueryKey = orgLimitCapsDefaultKeys.list; /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitCapsDefaultsQuery({ @@ -30,33 +45,58 @@ export const orgLimitCapsDefaultsQueryKey = orgLimitCapsDefaultKeys.list; * }); * ``` */ -export function useOrgLimitCapsDefaultsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCapsDefaultSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitCapsDefaultsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgLimitCapsDefaultsQuery< + S extends OrgLimitCapsDefaultSelect, + TData = { + orgLimitCapsDefaults: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgLimitCapsDefaultSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitCapsDefaults: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitCapsDefaultsQuery( + params: { + selection: ListSelectionConfig< + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitCapsDefaultKeys.list(args), queryFn: () => getClient().orgLimitCapsDefault.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```ts * const data = await fetchOrgLimitCapsDefaultsQuery({ @@ -70,35 +110,65 @@ export function useOrgLimitCapsDefaultsQuery(params: { export async function fetchOrgLimitCapsDefaultsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCapsDefaultSelect>; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgLimitCapsDefaultSelect>; }): Promise<{ orgLimitCapsDefaults: ConnectionResult>; }>; export async function fetchOrgLimitCapsDefaultsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy + >(params.selection); return getClient().orgLimitCapsDefault.findMany(args).unwrap(); } /** * Default cap values for static configuration limits (max file size, feature flags, etc.). Not metered — just read by consumers. - * + * * @example * ```ts * await prefetchOrgLimitCapsDefaultsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgLimitCapsDefaultsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCapsDefaultSelect>; -}): Promise; -export async function prefetchOrgLimitCapsDefaultsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgLimitCapsDefaultsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgLimitCapsDefaultSelect>; + } +): Promise; +export async function prefetchOrgLimitCapsDefaultsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitCapsDefaultKeys.list(args), - queryFn: () => getClient().orgLimitCapsDefault.findMany(args).unwrap() + queryFn: () => getClient().orgLimitCapsDefault.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsQuery.ts index f60a806710..66139a68cd 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCapsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgLimitCapKeys } from "../query-keys"; -import type { OrgLimitCapSelect, OrgLimitCapWithRelations, OrgLimitCapFilter, OrgLimitCapOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCapSelect, OrgLimitCapWithRelations, OrgLimitCapFilter, OrgLimitCapOrderBy } from "../../orm/input-types"; +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 { orgLimitCapKeys } from '../query-keys'; +import type { + OrgLimitCapSelect, + OrgLimitCapWithRelations, + OrgLimitCapFilter, + OrgLimitCapOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgLimitCapSelect, + OrgLimitCapWithRelations, + OrgLimitCapFilter, + OrgLimitCapOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitCapsQueryKey = orgLimitCapKeys.list; /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitCapsQuery({ @@ -30,33 +45,47 @@ export const orgLimitCapsQueryKey = orgLimitCapKeys.list; * }); * ``` */ -export function useOrgLimitCapsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCapSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitCapsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgLimitCapsQuery< + S extends OrgLimitCapSelect, + TData = { + orgLimitCaps: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitCapSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitCaps: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitCapsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitCapKeys.list(args), queryFn: () => getClient().orgLimitCap.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```ts * const data = await fetchOrgLimitCapsQuery({ @@ -70,35 +99,47 @@ export function useOrgLimitCapsQuery(params: { export async function fetchOrgLimitCapsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCapSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitCapSelect>; }): Promise<{ orgLimitCaps: ConnectionResult>; }>; export async function fetchOrgLimitCapsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().orgLimitCap.findMany(args).unwrap(); } /** * Per-entity cap overrides. Allows specific orgs/entities to have different cap values than the scope default. - * + * * @example * ```ts * await prefetchOrgLimitCapsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgLimitCapsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCapSelect>; -}): Promise; -export async function prefetchOrgLimitCapsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgLimitCapsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitCapSelect>; + } +): Promise; +export async function prefetchOrgLimitCapsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: orgLimitCapKeys.list(args), - queryFn: () => getClient().orgLimitCap.findMany(args).unwrap() + queryFn: () => getClient().orgLimitCap.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCreditQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCreditQuery.ts index 637b6220fc..a9e4e43241 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCreditQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCreditQuery.ts @@ -4,20 +4,20 @@ * 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 { orgLimitCreditKeys } from "../query-keys"; -import type { OrgLimitCreditSelect, OrgLimitCreditWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCreditSelect, OrgLimitCreditWithRelations } from "../../orm/input-types"; +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 { orgLimitCreditKeys } from '../query-keys'; +import type { OrgLimitCreditSelect, OrgLimitCreditWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitCreditSelect, OrgLimitCreditWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitCreditQueryKey = orgLimitCreditKeys.detail; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitCreditQuery({ @@ -26,38 +26,52 @@ export const orgLimitCreditQueryKey = orgLimitCreditKeys.detail; * }); * ``` */ -export function useOrgLimitCreditQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitCreditSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitCreditQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgLimitCreditQuery< + S extends OrgLimitCreditSelect, + TData = { + orgLimitCredit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitCreditSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitCredit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitCreditQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitCreditKeys.detail(params.id), - queryFn: () => getClient().orgLimitCredit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgLimitCredit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```ts * const data = await fetchOrgLimitCreditQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgLimitCreditQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgLimitCredit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgLimitCredit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```ts * await prefetchOrgLimitCreditQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgLimitCreditQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitCreditSelect>; -}): Promise; -export async function prefetchOrgLimitCreditQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgLimitCreditQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitCreditSelect>; + } +): Promise; +export async function prefetchOrgLimitCreditQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitCreditKeys.detail(params.id), - queryFn: () => getClient().orgLimitCredit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgLimitCredit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCreditsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCreditsQuery.ts index 8a2105d46a..7f8786ae36 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCreditsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitCreditsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgLimitCreditKeys } from "../query-keys"; -import type { OrgLimitCreditSelect, OrgLimitCreditWithRelations, OrgLimitCreditFilter, OrgLimitCreditOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitCreditSelect, OrgLimitCreditWithRelations, OrgLimitCreditFilter, OrgLimitCreditOrderBy } from "../../orm/input-types"; +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 { orgLimitCreditKeys } from '../query-keys'; +import type { + OrgLimitCreditSelect, + OrgLimitCreditWithRelations, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgLimitCreditSelect, + OrgLimitCreditWithRelations, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitCreditsQueryKey = orgLimitCreditKeys.list; /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitCreditsQuery({ @@ -30,33 +45,53 @@ export const orgLimitCreditsQueryKey = orgLimitCreditKeys.list; * }); * ``` */ -export function useOrgLimitCreditsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCreditSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitCreditsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgLimitCreditsQuery< + S extends OrgLimitCreditSelect, + TData = { + orgLimitCredits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitCreditSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitCredits: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitCreditsQuery( + params: { + selection: ListSelectionConfig< + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitCreditKeys.list(args), queryFn: () => getClient().orgLimitCredit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```ts * const data = await fetchOrgLimitCreditsQuery({ @@ -70,35 +105,55 @@ export function useOrgLimitCreditsQuery(params: { export async function fetchOrgLimitCreditsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCreditSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitCreditSelect>; }): Promise<{ orgLimitCredits: ConnectionResult>; }>; export async function fetchOrgLimitCreditsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy + >(params.selection); return getClient().orgLimitCredit.findMany(args).unwrap(); } /** * Append-only ledger of credit grants that automatically update limit ceilings - * + * * @example * ```ts * await prefetchOrgLimitCreditsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgLimitCreditsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitCreditSelect>; -}): Promise; -export async function prefetchOrgLimitCreditsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgLimitCreditsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitCreditSelect>; + } +): Promise; +export async function prefetchOrgLimitCreditsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitCreditKeys.list(args), - queryFn: () => getClient().orgLimitCredit.findMany(args).unwrap() + queryFn: () => getClient().orgLimitCredit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitDefaultQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitDefaultQuery.ts index 3beac6ea0f..4e9bd85850 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitDefaultQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitDefaultQuery.ts @@ -4,20 +4,20 @@ * 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 { orgLimitDefaultKeys } from "../query-keys"; -import type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations } from "../../orm/input-types"; +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 { orgLimitDefaultKeys } from '../query-keys'; +import type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitDefaultQueryKey = orgLimitDefaultKeys.detail; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitDefaultQuery({ @@ -26,38 +26,52 @@ export const orgLimitDefaultQueryKey = orgLimitDefaultKeys.detail; * }); * ``` */ -export function useOrgLimitDefaultQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitDefaultSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitDefaultQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgLimitDefaultQuery< + S extends OrgLimitDefaultSelect, + TData = { + orgLimitDefault: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitDefaultSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitDefault: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitDefaultQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitDefaultKeys.detail(params.id), - queryFn: () => getClient().orgLimitDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgLimitDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```ts * const data = await fetchOrgLimitDefaultQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgLimitDefaultQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgLimitDefault.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgLimitDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```ts * await prefetchOrgLimitDefaultQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgLimitDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitDefaultSelect>; -}): Promise; -export async function prefetchOrgLimitDefaultQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgLimitDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitDefaultSelect>; + } +): Promise; +export async function prefetchOrgLimitDefaultQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitDefaultKeys.detail(params.id), - queryFn: () => getClient().orgLimitDefault.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgLimitDefault.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitDefaultsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitDefaultsQuery.ts index dae98218d8..5a7b07bbfc 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitDefaultsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitDefaultsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgLimitDefaultKeys } from "../query-keys"; -import type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations, OrgLimitDefaultFilter, OrgLimitDefaultOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitDefaultSelect, OrgLimitDefaultWithRelations, OrgLimitDefaultFilter, OrgLimitDefaultOrderBy } from "../../orm/input-types"; +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 { orgLimitDefaultKeys } from '../query-keys'; +import type { + OrgLimitDefaultSelect, + OrgLimitDefaultWithRelations, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgLimitDefaultSelect, + OrgLimitDefaultWithRelations, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitDefaultsQueryKey = orgLimitDefaultKeys.list; /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitDefaultsQuery({ @@ -30,33 +45,53 @@ export const orgLimitDefaultsQueryKey = orgLimitDefaultKeys.list; * }); * ``` */ -export function useOrgLimitDefaultsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitDefaultSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitDefaultsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgLimitDefaultsQuery< + S extends OrgLimitDefaultSelect, + TData = { + orgLimitDefaults: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitDefaultSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitDefaults: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitDefaultsQuery( + params: { + selection: ListSelectionConfig< + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitDefaultKeys.list(args), queryFn: () => getClient().orgLimitDefault.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```ts * const data = await fetchOrgLimitDefaultsQuery({ @@ -70,35 +105,59 @@ export function useOrgLimitDefaultsQuery(params: { export async function fetchOrgLimitDefaultsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitDefaultSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitDefaultSelect>; }): Promise<{ orgLimitDefaults: ConnectionResult>; }>; export async function fetchOrgLimitDefaultsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy + >(params.selection); return getClient().orgLimitDefault.findMany(args).unwrap(); } /** * Default maximum values for each named limit, applied when no per-actor override exists - * + * * @example * ```ts * await prefetchOrgLimitDefaultsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgLimitDefaultsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitDefaultSelect>; -}): Promise; -export async function prefetchOrgLimitDefaultsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgLimitDefaultsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitDefaultSelect>; + } +): Promise; +export async function prefetchOrgLimitDefaultsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitDefaultKeys.list(args), - queryFn: () => getClient().orgLimitDefault.findMany(args).unwrap() + queryFn: () => getClient().orgLimitDefault.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitEventQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitEventQuery.ts index 03c3cc9efc..1f471a60a7 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitEventQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitEventQuery.ts @@ -4,20 +4,20 @@ * 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 { orgLimitEventKeys } from "../query-keys"; -import type { OrgLimitEventSelect, OrgLimitEventWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitEventSelect, OrgLimitEventWithRelations } from "../../orm/input-types"; +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 { orgLimitEventKeys } from '../query-keys'; +import type { OrgLimitEventSelect, OrgLimitEventWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitEventSelect, OrgLimitEventWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitEventQueryKey = orgLimitEventKeys.detail; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitEventQuery({ @@ -26,38 +26,52 @@ export const orgLimitEventQueryKey = orgLimitEventKeys.detail; * }); * ``` */ -export function useOrgLimitEventQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitEventSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitEventQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgLimitEventQuery< + S extends OrgLimitEventSelect, + TData = { + orgLimitEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitEventSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitEventKeys.detail(params.id), - queryFn: () => getClient().orgLimitEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgLimitEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```ts * const data = await fetchOrgLimitEventQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgLimitEventQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgLimitEvent.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgLimitEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```ts * await prefetchOrgLimitEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgLimitEventQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitEventSelect>; -}): Promise; -export async function prefetchOrgLimitEventQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgLimitEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitEventSelect>; + } +): Promise; +export async function prefetchOrgLimitEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitEventKeys.detail(params.id), - queryFn: () => getClient().orgLimitEvent.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgLimitEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitEventsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitEventsQuery.ts index 00c7abc8eb..66ba8768ce 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitEventsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitEventsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgLimitEventKeys } from "../query-keys"; -import type { OrgLimitEventSelect, OrgLimitEventWithRelations, OrgLimitEventFilter, OrgLimitEventOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitEventSelect, OrgLimitEventWithRelations, OrgLimitEventFilter, OrgLimitEventOrderBy } from "../../orm/input-types"; +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 { orgLimitEventKeys } from '../query-keys'; +import type { + OrgLimitEventSelect, + OrgLimitEventWithRelations, + OrgLimitEventFilter, + OrgLimitEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgLimitEventSelect, + OrgLimitEventWithRelations, + OrgLimitEventFilter, + OrgLimitEventOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitEventsQueryKey = orgLimitEventKeys.list; /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitEventsQuery({ @@ -30,33 +45,49 @@ export const orgLimitEventsQueryKey = orgLimitEventKeys.list; * }); * ``` */ -export function useOrgLimitEventsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitEventSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitEventsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgLimitEventsQuery< + S extends OrgLimitEventSelect, + TData = { + orgLimitEvents: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitEventSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitEvents: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitEventsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgLimitEventSelect, + OrgLimitEventFilter, + OrgLimitEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitEventKeys.list(args), queryFn: () => getClient().orgLimitEvent.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```ts * const data = await fetchOrgLimitEventsQuery({ @@ -70,35 +101,51 @@ export function useOrgLimitEventsQuery(params: { export async function fetchOrgLimitEventsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitEventSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitEventSelect>; }): Promise<{ orgLimitEvents: ConnectionResult>; }>; export async function fetchOrgLimitEventsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgLimitEventSelect, + OrgLimitEventFilter, + OrgLimitEventOrderBy + >(params.selection); return getClient().orgLimitEvent.findMany(args).unwrap(); } /** * Append-only log of limit events for historical reporting and audit - * + * * @example * ```ts * await prefetchOrgLimitEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgLimitEventsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitEventSelect>; -}): Promise; -export async function prefetchOrgLimitEventsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgLimitEventsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitEventSelect>; + } +): Promise; +export async function prefetchOrgLimitEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + OrgLimitEventSelect, + OrgLimitEventFilter, + OrgLimitEventOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitEventKeys.list(args), - queryFn: () => getClient().orgLimitEvent.findMany(args).unwrap() + queryFn: () => getClient().orgLimitEvent.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitQuery.ts index 3b8cef4904..6c03f817ff 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitQuery.ts @@ -4,20 +4,20 @@ * 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 { orgLimitKeys } from "../query-keys"; -import type { OrgLimitSelect, OrgLimitWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitSelect, OrgLimitWithRelations } from "../../orm/input-types"; +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 { orgLimitKeys } from '../query-keys'; +import type { OrgLimitSelect, OrgLimitWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitSelect, OrgLimitWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitQueryKey = orgLimitKeys.detail; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitQuery({ @@ -26,38 +26,52 @@ export const orgLimitQueryKey = orgLimitKeys.detail; * }); * ``` */ -export function useOrgLimitQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgLimitQuery< + S extends OrgLimitSelect, + TData = { + orgLimit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitSelect>; + } & Omit< + UseQueryOptions< + { + orgLimit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitKeys.detail(params.id), - queryFn: () => getClient().orgLimit.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgLimit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```ts * const data = await fetchOrgLimitQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgLimitQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgLimit.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgLimit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```ts * await prefetchOrgLimitQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgLimitQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitSelect>; -}): Promise; -export async function prefetchOrgLimitQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgLimitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitSelect>; + } +): Promise; +export async function prefetchOrgLimitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitKeys.detail(params.id), - queryFn: () => getClient().orgLimit.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgLimit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitWarningQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitWarningQuery.ts index ef02f1f7cf..621ab6b29d 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitWarningQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitWarningQuery.ts @@ -4,20 +4,20 @@ * 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 { orgLimitWarningKeys } from "../query-keys"; -import type { OrgLimitWarningSelect, OrgLimitWarningWithRelations } from "../../orm/input-types"; -import type { InferSelectResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitWarningSelect, OrgLimitWarningWithRelations } from "../../orm/input-types"; +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 { orgLimitWarningKeys } from '../query-keys'; +import type { OrgLimitWarningSelect, OrgLimitWarningWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgLimitWarningSelect, OrgLimitWarningWithRelations } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitWarningQueryKey = orgLimitWarningKeys.detail; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitWarningQuery({ @@ -26,38 +26,52 @@ export const orgLimitWarningQueryKey = orgLimitWarningKeys.detail; * }); * ``` */ -export function useOrgLimitWarningQuery | null; -}>(params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitWarningSelect>; -} & Omit | null; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitWarningQuery(params: { - id: string; - selection: SelectionConfig; -} & Omit, "queryKey" | "queryFn">) { +export function useOrgLimitWarningQuery< + S extends OrgLimitWarningSelect, + TData = { + orgLimitWarning: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitWarningSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitWarning: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitWarningQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { const args = buildSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitWarningKeys.detail(params.id), - queryFn: () => getClient().orgLimitWarning.findOne({ - id: params.id, - select: args.select - }).unwrap(), - ...queryOptions + queryFn: () => + getClient() + .orgLimitWarning.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, }); } /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```ts * const data = await fetchOrgLimitWarningQuery({ @@ -79,35 +93,46 @@ export async function fetchOrgLimitWarningQuery(params: { selection: SelectionConfig; }): Promise { const args = buildSelectionArgs(params.selection); - return getClient().orgLimitWarning.findOne({ - id: params.id, - select: args.select - }).unwrap(); + return getClient() + .orgLimitWarning.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); } /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```ts * await prefetchOrgLimitWarningQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); * ``` */ -export async function prefetchOrgLimitWarningQuery(queryClient: QueryClient, params: { - id: string; - selection: { - fields: S; - } & HookStrictSelect, OrgLimitWarningSelect>; -}): Promise; -export async function prefetchOrgLimitWarningQuery(queryClient: QueryClient, params: { - id: string; - selection: SelectionConfig; -}): Promise { +export async function prefetchOrgLimitWarningQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgLimitWarningSelect>; + } +): Promise; +export async function prefetchOrgLimitWarningQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { const args = buildSelectionArgs(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitWarningKeys.detail(params.id), - queryFn: () => getClient().orgLimitWarning.findOne({ - id: params.id, - select: args.select - }).unwrap() + queryFn: () => + getClient() + .orgLimitWarning.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitWarningsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitWarningsQuery.ts index 519f7b1bc5..14a9efa801 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitWarningsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitWarningsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgLimitWarningKeys } from "../query-keys"; -import type { OrgLimitWarningSelect, OrgLimitWarningWithRelations, OrgLimitWarningFilter, OrgLimitWarningOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitWarningSelect, OrgLimitWarningWithRelations, OrgLimitWarningFilter, OrgLimitWarningOrderBy } from "../../orm/input-types"; +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 { orgLimitWarningKeys } from '../query-keys'; +import type { + OrgLimitWarningSelect, + OrgLimitWarningWithRelations, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgLimitWarningSelect, + OrgLimitWarningWithRelations, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitWarningsQueryKey = orgLimitWarningKeys.list; /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitWarningsQuery({ @@ -30,33 +45,53 @@ export const orgLimitWarningsQueryKey = orgLimitWarningKeys.list; * }); * ``` */ -export function useOrgLimitWarningsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitWarningSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitWarningsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgLimitWarningsQuery< + S extends OrgLimitWarningSelect, + TData = { + orgLimitWarnings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitWarningSelect>; + } & Omit< + UseQueryOptions< + { + orgLimitWarnings: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitWarningsQuery( + params: { + selection: ListSelectionConfig< + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitWarningKeys.list(args), queryFn: () => getClient().orgLimitWarning.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```ts * const data = await fetchOrgLimitWarningsQuery({ @@ -70,35 +105,59 @@ export function useOrgLimitWarningsQuery(params: { export async function fetchOrgLimitWarningsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitWarningSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitWarningSelect>; }): Promise<{ orgLimitWarnings: ConnectionResult>; }>; export async function fetchOrgLimitWarningsQuery(params: { - selection: ListSelectionConfig; + selection: ListSelectionConfig< + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy + >; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs< + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy + >(params.selection); return getClient().orgLimitWarning.findMany(args).unwrap(); } /** * Warning configuration for soft limits. Each row defines a warning threshold and the job task to enqueue when usage approaches it. - * + * * @example * ```ts * await prefetchOrgLimitWarningsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgLimitWarningsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitWarningSelect>; -}): Promise; -export async function prefetchOrgLimitWarningsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgLimitWarningsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitWarningSelect>; + } +): Promise; +export async function prefetchOrgLimitWarningsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy + >(params.selection); await queryClient.prefetchQuery({ queryKey: orgLimitWarningKeys.list(args), - queryFn: () => getClient().orgLimitWarning.findMany(args).unwrap() + queryFn: () => getClient().orgLimitWarning.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitsQuery.ts b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitsQuery.ts index 2733c1f2fd..320ccf6240 100644 --- a/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitsQuery.ts +++ b/sdk/constructive-react/src/usage/hooks/queries/useOrgLimitsQuery.ts @@ -4,20 +4,35 @@ * 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 { orgLimitKeys } from "../query-keys"; -import type { OrgLimitSelect, OrgLimitWithRelations, OrgLimitFilter, OrgLimitOrderBy } from "../../orm/input-types"; -import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect } from "../../orm/select-types"; -export type { OrgLimitSelect, OrgLimitWithRelations, OrgLimitFilter, OrgLimitOrderBy } from "../../orm/input-types"; +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 { orgLimitKeys } from '../query-keys'; +import type { + OrgLimitSelect, + OrgLimitWithRelations, + OrgLimitFilter, + OrgLimitOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgLimitSelect, + OrgLimitWithRelations, + OrgLimitFilter, + OrgLimitOrderBy, +} from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const orgLimitsQueryKey = orgLimitKeys.list; /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```tsx * const { data, isLoading } = useOrgLimitsQuery({ @@ -30,33 +45,47 @@ export const orgLimitsQueryKey = orgLimitKeys.list; * }); * ``` */ -export function useOrgLimitsQuery>; -}>(params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitSelect>; -} & Omit>; -}, Error, TData>, "queryKey" | "queryFn">): UseQueryResult; -export function useOrgLimitsQuery(params: { - selection: ListSelectionConfig; -} & Omit, "queryKey" | "queryFn">) { - const args = buildListSelectionArgs(params.selection); - const { - selection: _selection, - ...queryOptions - } = params ?? {}; +export function useOrgLimitsQuery< + S extends OrgLimitSelect, + TData = { + orgLimits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitSelect>; + } & Omit< + UseQueryOptions< + { + orgLimits: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgLimitsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: orgLimitKeys.list(args), queryFn: () => getClient().orgLimit.findMany(args).unwrap(), - ...queryOptions + ...queryOptions, }); } /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```ts * const data = await fetchOrgLimitsQuery({ @@ -70,35 +99,47 @@ export function useOrgLimitsQuery(params: { export async function fetchOrgLimitsQuery(params: { selection: { fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitSelect>; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitSelect>; }): Promise<{ orgLimits: ConnectionResult>; }>; export async function fetchOrgLimitsQuery(params: { selection: ListSelectionConfig; }) { - const args = buildListSelectionArgs(params.selection); + const args = buildListSelectionArgs( + params.selection + ); return getClient().orgLimit.findMany(args).unwrap(); } /** * Tracks per-actor usage counts against configurable maximum limits - * + * * @example * ```ts * await prefetchOrgLimitsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ -export async function prefetchOrgLimitsQuery(queryClient: QueryClient, params: { - selection: { - fields: S; - } & Omit, "fields"> & HookStrictSelect, OrgLimitSelect>; -}): Promise; -export async function prefetchOrgLimitsQuery(queryClient: QueryClient, params: { - selection: ListSelectionConfig; -}): Promise { - const args = buildListSelectionArgs(params.selection); +export async function prefetchOrgLimitsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgLimitSelect>; + } +): Promise; +export async function prefetchOrgLimitsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); await queryClient.prefetchQuery({ queryKey: orgLimitKeys.list(args), - queryFn: () => getClient().orgLimit.findMany(args).unwrap() + queryFn: () => getClient().orgLimit.findMany(args).unwrap(), }); } diff --git a/sdk/constructive-react/src/usage/hooks/query-keys.ts b/sdk/constructive-react/src/usage/hooks/query-keys.ts index 0a8b780fc6..3f330e7f19 100644 --- a/sdk/constructive-react/src/usage/hooks/query-keys.ts +++ b/sdk/constructive-react/src/usage/hooks/query-keys.ts @@ -20,130 +20,166 @@ // ============================================================================ export const appLimitCapKeys = { - /** All appLimitCap queries */all: ["applimitcap"] as const, - /** List query keys */lists: () => [...appLimitCapKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitCapKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitCapKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitCapKeys.details(), id] as const + /** All appLimitCap queries */ all: ['applimitcap'] as const, + /** List query keys */ lists: () => [...appLimitCapKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitCapKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitCapKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitCapKeys.details(), id] as const, } as const; export const appLimitCapsDefaultKeys = { - /** All appLimitCapsDefault queries */all: ["applimitcapsdefault"] as const, - /** List query keys */lists: () => [...appLimitCapsDefaultKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitCapsDefaultKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitCapsDefaultKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitCapsDefaultKeys.details(), id] as const + /** All appLimitCapsDefault queries */ all: ['applimitcapsdefault'] as const, + /** List query keys */ lists: () => [...appLimitCapsDefaultKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitCapsDefaultKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitCapsDefaultKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitCapsDefaultKeys.details(), id] as const, } as const; export const appLimitKeys = { - /** All appLimit queries */all: ["applimit"] as const, - /** List query keys */lists: () => [...appLimitKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitKeys.details(), id] as const + /** All appLimit queries */ all: ['applimit'] as const, + /** List query keys */ lists: () => [...appLimitKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitKeys.details(), id] as const, } as const; export const appLimitCreditCodeKeys = { - /** All appLimitCreditCode queries */all: ["applimitcreditcode"] as const, - /** List query keys */lists: () => [...appLimitCreditCodeKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitCreditCodeKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitCreditCodeKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitCreditCodeKeys.details(), id] as const + /** All appLimitCreditCode queries */ all: ['applimitcreditcode'] as const, + /** List query keys */ lists: () => [...appLimitCreditCodeKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitCreditCodeKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitCreditCodeKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitCreditCodeKeys.details(), id] as const, } as const; export const appLimitCreditCodeItemKeys = { - /** All appLimitCreditCodeItem queries */all: ["applimitcreditcodeitem"] as const, - /** List query keys */lists: () => [...appLimitCreditCodeItemKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitCreditCodeItemKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitCreditCodeItemKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitCreditCodeItemKeys.details(), id] as const + /** All appLimitCreditCodeItem queries */ all: ['applimitcreditcodeitem'] as const, + /** List query keys */ lists: () => [...appLimitCreditCodeItemKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitCreditCodeItemKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitCreditCodeItemKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitCreditCodeItemKeys.details(), id] as const, } as const; export const appLimitCreditKeys = { - /** All appLimitCredit queries */all: ["applimitcredit"] as const, - /** List query keys */lists: () => [...appLimitCreditKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitCreditKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitCreditKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitCreditKeys.details(), id] as const + /** All appLimitCredit queries */ all: ['applimitcredit'] as const, + /** List query keys */ lists: () => [...appLimitCreditKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitCreditKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitCreditKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitCreditKeys.details(), id] as const, } as const; export const appLimitCreditRedemptionKeys = { - /** All appLimitCreditRedemption queries */all: ["applimitcreditredemption"] as const, - /** List query keys */lists: () => [...appLimitCreditRedemptionKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitCreditRedemptionKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitCreditRedemptionKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitCreditRedemptionKeys.details(), id] as const + /** All appLimitCreditRedemption queries */ all: ['applimitcreditredemption'] as const, + /** List query keys */ lists: () => [...appLimitCreditRedemptionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitCreditRedemptionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitCreditRedemptionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitCreditRedemptionKeys.details(), id] as const, } as const; export const appLimitDefaultKeys = { - /** All appLimitDefault queries */all: ["applimitdefault"] as const, - /** List query keys */lists: () => [...appLimitDefaultKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitDefaultKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitDefaultKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitDefaultKeys.details(), id] as const + /** All appLimitDefault queries */ all: ['applimitdefault'] as const, + /** List query keys */ lists: () => [...appLimitDefaultKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitDefaultKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitDefaultKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitDefaultKeys.details(), id] as const, } as const; export const appLimitEventKeys = { - /** All appLimitEvent queries */all: ["applimitevent"] as const, - /** List query keys */lists: () => [...appLimitEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitEventKeys.details(), id] as const + /** All appLimitEvent queries */ all: ['applimitevent'] as const, + /** List query keys */ lists: () => [...appLimitEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitEventKeys.details(), id] as const, } as const; export const appLimitWarningKeys = { - /** All appLimitWarning queries */all: ["applimitwarning"] as const, - /** List query keys */lists: () => [...appLimitWarningKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...appLimitWarningKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...appLimitWarningKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...appLimitWarningKeys.details(), id] as const + /** All appLimitWarning queries */ all: ['applimitwarning'] as const, + /** List query keys */ lists: () => [...appLimitWarningKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...appLimitWarningKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...appLimitWarningKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...appLimitWarningKeys.details(), id] as const, } as const; export const orgLimitAggregateKeys = { - /** All orgLimitAggregate queries */all: ["orglimitaggregate"] as const, - /** List query keys */lists: () => [...orgLimitAggregateKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgLimitAggregateKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgLimitAggregateKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgLimitAggregateKeys.details(), id] as const + /** All orgLimitAggregate queries */ all: ['orglimitaggregate'] as const, + /** List query keys */ lists: () => [...orgLimitAggregateKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgLimitAggregateKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgLimitAggregateKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgLimitAggregateKeys.details(), id] as const, } as const; export const orgLimitCapKeys = { - /** All orgLimitCap queries */all: ["orglimitcap"] as const, - /** List query keys */lists: () => [...orgLimitCapKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgLimitCapKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgLimitCapKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgLimitCapKeys.details(), id] as const + /** All orgLimitCap queries */ all: ['orglimitcap'] as const, + /** List query keys */ lists: () => [...orgLimitCapKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgLimitCapKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgLimitCapKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgLimitCapKeys.details(), id] as const, } as const; export const orgLimitCapsDefaultKeys = { - /** All orgLimitCapsDefault queries */all: ["orglimitcapsdefault"] as const, - /** List query keys */lists: () => [...orgLimitCapsDefaultKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgLimitCapsDefaultKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgLimitCapsDefaultKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgLimitCapsDefaultKeys.details(), id] as const + /** All orgLimitCapsDefault queries */ all: ['orglimitcapsdefault'] as const, + /** List query keys */ lists: () => [...orgLimitCapsDefaultKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgLimitCapsDefaultKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgLimitCapsDefaultKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgLimitCapsDefaultKeys.details(), id] as const, } as const; export const orgLimitKeys = { - /** All orgLimit queries */all: ["orglimit"] as const, - /** List query keys */lists: () => [...orgLimitKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgLimitKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgLimitKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgLimitKeys.details(), id] as const + /** All orgLimit queries */ all: ['orglimit'] as const, + /** List query keys */ lists: () => [...orgLimitKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgLimitKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgLimitKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgLimitKeys.details(), id] as const, } as const; export const orgLimitCreditKeys = { - /** All orgLimitCredit queries */all: ["orglimitcredit"] as const, - /** List query keys */lists: () => [...orgLimitCreditKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgLimitCreditKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgLimitCreditKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgLimitCreditKeys.details(), id] as const + /** All orgLimitCredit queries */ all: ['orglimitcredit'] as const, + /** List query keys */ lists: () => [...orgLimitCreditKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgLimitCreditKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgLimitCreditKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgLimitCreditKeys.details(), id] as const, } as const; export const orgLimitDefaultKeys = { - /** All orgLimitDefault queries */all: ["orglimitdefault"] as const, - /** List query keys */lists: () => [...orgLimitDefaultKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgLimitDefaultKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgLimitDefaultKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgLimitDefaultKeys.details(), id] as const + /** All orgLimitDefault queries */ all: ['orglimitdefault'] as const, + /** List query keys */ lists: () => [...orgLimitDefaultKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgLimitDefaultKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgLimitDefaultKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgLimitDefaultKeys.details(), id] as const, } as const; export const orgLimitEventKeys = { - /** All orgLimitEvent queries */all: ["orglimitevent"] as const, - /** List query keys */lists: () => [...orgLimitEventKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgLimitEventKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgLimitEventKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgLimitEventKeys.details(), id] as const + /** All orgLimitEvent queries */ all: ['orglimitevent'] as const, + /** List query keys */ lists: () => [...orgLimitEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgLimitEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgLimitEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgLimitEventKeys.details(), id] as const, } as const; export const orgLimitWarningKeys = { - /** All orgLimitWarning queries */all: ["orglimitwarning"] as const, - /** List query keys */lists: () => [...orgLimitWarningKeys.all, "list"] as const, - /** List query key with variables */list: (variables?: object) => [...orgLimitWarningKeys.lists(), variables] as const, - /** Detail query keys */details: () => [...orgLimitWarningKeys.all, "detail"] as const, - /** Detail query key for specific item */detail: (id: string | number) => [...orgLimitWarningKeys.details(), id] as const + /** All orgLimitWarning queries */ all: ['orglimitwarning'] as const, + /** List query keys */ lists: () => [...orgLimitWarningKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgLimitWarningKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgLimitWarningKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgLimitWarningKeys.details(), id] as const, } as const; /** @@ -185,7 +221,7 @@ export const queryKeys = { orgLimitCredit: orgLimitCreditKeys, orgLimitDefault: orgLimitDefaultKeys, orgLimitEvent: orgLimitEventKeys, - orgLimitWarning: orgLimitWarningKeys + orgLimitWarning: orgLimitWarningKeys, } as const; /** Type representing all available query key scopes */ export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/usage/hooks/selection.ts b/sdk/constructive-react/src/usage/hooks/selection.ts index 1798f498d4..2952aab647 100644 --- a/sdk/constructive-react/src/usage/hooks/selection.ts +++ b/sdk/constructive-react/src/usage/hooks/selection.ts @@ -7,11 +7,7 @@ export interface SelectionConfig { fields: TFields; } -export interface ListSelectionConfig< - TFields, - TWhere, - TOrderBy, -> extends SelectionConfig { +export interface ListSelectionConfig extends SelectionConfig { where?: TWhere; orderBy?: TOrderBy[]; first?: number; @@ -22,24 +18,24 @@ export interface ListSelectionConfig< } function ensureSelectionFields( - selection: SelectionConfig | undefined, + selection: SelectionConfig | undefined ): asserts selection is SelectionConfig { if (!selection || typeof selection !== 'object' || !('fields' in selection)) { throw new Error( - 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }', + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' ); } } -export function buildSelectionArgs( - selection: SelectionConfig, -): { select: TFields } { +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { ensureSelectionFields(selection); return { select: selection.fields }; } export function buildListSelectionArgs( - selection: ListSelectionConfig, + selection: ListSelectionConfig ): { select: TFields; where?: TWhere; diff --git a/sdk/constructive-react/src/usage/index.ts b/sdk/constructive-react/src/usage/index.ts index 431c10d859..2b8402539a 100644 --- a/sdk/constructive-react/src/usage/index.ts +++ b/sdk/constructive-react/src/usage/index.ts @@ -2,6 +2,6 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./types"; -export * from "./hooks"; -export * from "./orm"; \ No newline at end of file +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/usage/orm/client.ts b/sdk/constructive-react/src/usage/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-react/src/usage/orm/client.ts +++ b/sdk/constructive-react/src/usage/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-react/src/usage/orm/index.ts b/sdk/constructive-react/src/usage/orm/index.ts index 2937809ca5..7d48027d3b 100644 --- a/sdk/constructive-react/src/usage/orm/index.ts +++ b/sdk/constructive-react/src/usage/orm/index.ts @@ -3,33 +3,33 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AppLimitCapModel } from "./models/appLimitCap"; -import { AppLimitCapsDefaultModel } from "./models/appLimitCapsDefault"; -import { AppLimitModel } from "./models/appLimit"; -import { AppLimitCreditCodeModel } from "./models/appLimitCreditCode"; -import { AppLimitCreditCodeItemModel } from "./models/appLimitCreditCodeItem"; -import { AppLimitCreditModel } from "./models/appLimitCredit"; -import { AppLimitCreditRedemptionModel } from "./models/appLimitCreditRedemption"; -import { AppLimitDefaultModel } from "./models/appLimitDefault"; -import { AppLimitEventModel } from "./models/appLimitEvent"; -import { AppLimitWarningModel } from "./models/appLimitWarning"; -import { OrgLimitAggregateModel } from "./models/orgLimitAggregate"; -import { OrgLimitCapModel } from "./models/orgLimitCap"; -import { OrgLimitCapsDefaultModel } from "./models/orgLimitCapsDefault"; -import { OrgLimitModel } from "./models/orgLimit"; -import { OrgLimitCreditModel } from "./models/orgLimitCredit"; -import { OrgLimitDefaultModel } from "./models/orgLimitDefault"; -import { OrgLimitEventModel } from "./models/orgLimitEvent"; -import { OrgLimitWarningModel } from "./models/orgLimitWarning"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AppLimitCapModel } from './models/appLimitCap'; +import { AppLimitCapsDefaultModel } from './models/appLimitCapsDefault'; +import { AppLimitModel } from './models/appLimit'; +import { AppLimitCreditCodeModel } from './models/appLimitCreditCode'; +import { AppLimitCreditCodeItemModel } from './models/appLimitCreditCodeItem'; +import { AppLimitCreditModel } from './models/appLimitCredit'; +import { AppLimitCreditRedemptionModel } from './models/appLimitCreditRedemption'; +import { AppLimitDefaultModel } from './models/appLimitDefault'; +import { AppLimitEventModel } from './models/appLimitEvent'; +import { AppLimitWarningModel } from './models/appLimitWarning'; +import { OrgLimitAggregateModel } from './models/orgLimitAggregate'; +import { OrgLimitCapModel } from './models/orgLimitCap'; +import { OrgLimitCapsDefaultModel } from './models/orgLimitCapsDefault'; +import { OrgLimitModel } from './models/orgLimit'; +import { OrgLimitCreditModel } from './models/orgLimitCredit'; +import { OrgLimitDefaultModel } from './models/orgLimitDefault'; +import { OrgLimitEventModel } from './models/orgLimitEvent'; +import { OrgLimitWarningModel } from './models/orgLimitWarning'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -74,6 +74,6 @@ export function createClient(config: OrmClientConfig) { orgLimitDefault: new OrgLimitDefaultModel(client), orgLimitEvent: new OrgLimitEventModel(client), orgLimitWarning: new OrgLimitWarningModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/input-types.ts b/sdk/constructive-react/src/usage/orm/input-types.ts index c462da530b..f8df1c43d8 100644 --- a/sdk/constructive-react/src/usage/orm/input-types.ts +++ b/sdk/constructive-react/src/usage/orm/input-types.ts @@ -579,9 +579,11 @@ export type AppLimitCapWithRelations = AppLimitCap & AppLimitCapRelations; export type AppLimitCapsDefaultWithRelations = AppLimitCapsDefault & AppLimitCapsDefaultRelations; export type AppLimitWithRelations = AppLimit & AppLimitRelations; export type AppLimitCreditCodeWithRelations = AppLimitCreditCode & AppLimitCreditCodeRelations; -export type AppLimitCreditCodeItemWithRelations = AppLimitCreditCodeItem & AppLimitCreditCodeItemRelations; +export type AppLimitCreditCodeItemWithRelations = AppLimitCreditCodeItem & + AppLimitCreditCodeItemRelations; export type AppLimitCreditWithRelations = AppLimitCredit & AppLimitCreditRelations; -export type AppLimitCreditRedemptionWithRelations = AppLimitCreditRedemption & AppLimitCreditRedemptionRelations; +export type AppLimitCreditRedemptionWithRelations = AppLimitCreditRedemption & + AppLimitCreditRedemptionRelations; export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRelations; export type AppLimitEventWithRelations = AppLimitEvent & AppLimitEventRelations; export type AppLimitWarningWithRelations = AppLimitWarning & AppLimitWarningRelations; @@ -1241,24 +1243,338 @@ export interface OrgLimitWarningFilter { warningType?: StringFilter; } // ============ OrderBy Types ============ -export type AppLimitCapOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCapsDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type AppLimitCreditCodeOrderBy = "CODE_ASC" | "CODE_DESC" | "CURRENT_REDEMPTIONS_ASC" | "CURRENT_REDEMPTIONS_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "MAX_REDEMPTIONS_ASC" | "MAX_REDEMPTIONS_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCreditCodeItemOrderBy = "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_CODE_ID_ASC" | "CREDIT_CODE_ID_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCreditOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type AppLimitCreditRedemptionOrderBy = "CREDIT_CODE_ID_ASC" | "CREDIT_CODE_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC"; -export type AppLimitEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DELTA_ASC" | "DELTA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_AT_EVENT_ASC" | "MAX_AT_EVENT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_AFTER_ASC" | "NUM_AFTER_DESC" | "NUM_BEFORE_ASC" | "NUM_BEFORE_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type AppLimitWarningOrderBy = "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "THRESHOLD_VALUE_ASC" | "THRESHOLD_VALUE_DESC" | "WARNING_TYPE_ASC" | "WARNING_TYPE_DESC"; -export type OrgLimitAggregateOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "RESERVED_ASC" | "RESERVED_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type OrgLimitCapOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgLimitCapsDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgLimitOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type OrgLimitCreditOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type OrgLimitDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC"; -export type OrgLimitEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DELTA_ASC" | "DELTA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_AT_EVENT_ASC" | "MAX_AT_EVENT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_AFTER_ASC" | "NUM_AFTER_DESC" | "NUM_BEFORE_ASC" | "NUM_BEFORE_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type OrgLimitWarningOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "THRESHOLD_VALUE_ASC" | "THRESHOLD_VALUE_DESC" | "WARNING_TYPE_ASC" | "WARNING_TYPE_DESC"; +export type AppLimitCapOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCapsDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type AppLimitCreditCodeOrderBy = + | 'CODE_ASC' + | 'CODE_DESC' + | 'CURRENT_REDEMPTIONS_ASC' + | 'CURRENT_REDEMPTIONS_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_REDEMPTIONS_ASC' + | 'MAX_REDEMPTIONS_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCreditCodeItemOrderBy = + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_CODE_ID_ASC' + | 'CREDIT_CODE_ID_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCreditOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type AppLimitCreditRedemptionOrderBy = + | 'CREDIT_CODE_ID_ASC' + | 'CREDIT_CODE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC'; +export type AppLimitEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DELTA_ASC' + | 'DELTA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_AT_EVENT_ASC' + | 'MAX_AT_EVENT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_AFTER_ASC' + | 'NUM_AFTER_DESC' + | 'NUM_BEFORE_ASC' + | 'NUM_BEFORE_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type AppLimitWarningOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'THRESHOLD_VALUE_ASC' + | 'THRESHOLD_VALUE_DESC' + | 'WARNING_TYPE_ASC' + | 'WARNING_TYPE_DESC'; +export type OrgLimitAggregateOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'RESERVED_ASC' + | 'RESERVED_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type OrgLimitCapOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgLimitCapsDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgLimitOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type OrgLimitCreditOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type OrgLimitDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC'; +export type OrgLimitEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DELTA_ASC' + | 'DELTA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_AT_EVENT_ASC' + | 'MAX_AT_EVENT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_AFTER_ASC' + | 'NUM_AFTER_DESC' + | 'NUM_BEFORE_ASC' + | 'NUM_BEFORE_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type OrgLimitWarningOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'THRESHOLD_VALUE_ASC' + | 'THRESHOLD_VALUE_DESC' + | 'WARNING_TYPE_ASC' + | 'WARNING_TYPE_DESC'; // ============ CRUD Input Types ============ export interface CreateAppLimitCapInput { clientMutationId?: string; @@ -1770,17 +2086,17 @@ export interface DeleteOrgLimitWarningInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "AppLimitCreditCode": { - "appLimitCreditCodeItemsByCreditCodeId": "AppLimitCreditCodeItem", - "appLimitCreditRedemptionsByCreditCodeId": "AppLimitCreditRedemption" + AppLimitCreditCode: { + appLimitCreditCodeItemsByCreditCodeId: 'AppLimitCreditCodeItem', + appLimitCreditRedemptionsByCreditCodeId: 'AppLimitCreditRedemption', }, - "AppLimitDefault": { - "appLimitCreditCodeItemsByDefaultLimitId": "AppLimitCreditCodeItem", - "appLimitCreditsByDefaultLimitId": "AppLimitCredit" + AppLimitDefault: { + appLimitCreditCodeItemsByDefaultLimitId: 'AppLimitCreditCodeItem', + appLimitCreditsByDefaultLimitId: 'AppLimitCredit', + }, + OrgLimitDefault: { + orgLimitCreditsByDefaultLimitId: 'OrgLimitCredit', }, - "OrgLimitDefault": { - "orgLimitCreditsByDefaultLimitId": "OrgLimitCredit" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -3618,4 +3934,4 @@ export type OrgLimitWarningEdgeSelect = { node?: { select: OrgLimitWarningSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-react/src/usage/orm/models/appLimit.ts b/sdk/constructive-react/src/usage/orm/models/appLimit.ts index 3e7c702c15..e1903aae36 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimit.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimit.ts @@ -3,56 +3,96 @@ * @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 { AppLimit, AppLimitWithRelations, AppLimitSelect, AppLimitFilter, AppLimitOrderBy, CreateAppLimitInput, UpdateAppLimitInput, AppLimitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimit, + AppLimitWithRelations, + AppLimitSelect, + AppLimitFilter, + AppLimitOrderBy, + CreateAppLimitInput, + UpdateAppLimitInput, + AppLimitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimit", "appLimits", 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 - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimit', + 'appLimits', + 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, + }, + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimits", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimit", "appLimits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimit', + 'appLimits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimit", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimit": data.appLimits?.nodes?.[0] ?? null - }) + appLimit: data.appLimits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimit", "appLimits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimit', + 'appLimits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimit", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimit": data.appLimits?.nodes?.[0] ?? null - }) + appLimit: data.appLimits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimit", "createAppLimit", "appLimit", args.select, args.data, "CreateAppLimitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimit', + 'createAppLimit', + 'appLimit', + args.select, + args.data, + 'CreateAppLimitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "createAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'createAppLimit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimit", "updateAppLimit", "appLimit", args.select, args.where.id, args.data, "UpdateAppLimitInput", "id", "appLimitPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimit', + 'updateAppLimit', + 'appLimit', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitInput', + 'id', + 'appLimitPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "updateAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'updateAppLimit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimit", "deleteAppLimit", "appLimit", { - id: args.where.id - }, "DeleteAppLimitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimit', + 'deleteAppLimit', + 'appLimit', + { + id: args.where.id, + }, + 'DeleteAppLimitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "deleteAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'deleteAppLimit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCap.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCap.ts index 883def6208..9f93b87628 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCap.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCap.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCap, AppLimitCapWithRelations, AppLimitCapSelect, AppLimitCapFilter, AppLimitCapOrderBy, CreateAppLimitCapInput, UpdateAppLimitCapInput, AppLimitCapPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCap, + AppLimitCapWithRelations, + AppLimitCapSelect, + AppLimitCapFilter, + AppLimitCapOrderBy, + CreateAppLimitCapInput, + UpdateAppLimitCapInput, + AppLimitCapPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCapModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCaps: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCap", "appLimitCaps", 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 - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCap', + 'appLimitCaps', + 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, + }, + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCaps", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCaps', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCap", "appLimitCaps", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCap', + 'appLimitCaps', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCap", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCap', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCap": data.appLimitCaps?.nodes?.[0] ?? null - }) + appLimitCap: data.appLimitCaps?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCap", "appLimitCaps", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCap', + 'appLimitCaps', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCap", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCap', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCap": data.appLimitCaps?.nodes?.[0] ?? null - }) + appLimitCap: data.appLimitCaps?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCap", "createAppLimitCap", "appLimitCap", args.select, args.data, "CreateAppLimitCapInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCap', + 'createAppLimitCap', + 'appLimitCap', + args.select, + args.data, + 'CreateAppLimitCapInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "createAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'createAppLimitCap', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCapPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCap", "updateAppLimitCap", "appLimitCap", args.select, args.where.id, args.data, "UpdateAppLimitCapInput", "id", "appLimitCapPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCap', + 'updateAppLimitCap', + 'appLimitCap', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCapInput', + 'id', + 'appLimitCapPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "updateAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'updateAppLimitCap', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCap", "deleteAppLimitCap", "appLimitCap", { - id: args.where.id - }, "DeleteAppLimitCapInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCap', + 'deleteAppLimitCap', + 'appLimitCap', + { + id: args.where.id, + }, + 'DeleteAppLimitCapInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "deleteAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'deleteAppLimitCap', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCapsDefault.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCapsDefault.ts index 6e64cd49f5..3b0ac8a23b 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCapsDefault.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCapsDefault.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCapsDefault, AppLimitCapsDefaultWithRelations, AppLimitCapsDefaultSelect, AppLimitCapsDefaultFilter, AppLimitCapsDefaultOrderBy, CreateAppLimitCapsDefaultInput, UpdateAppLimitCapsDefaultInput, AppLimitCapsDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCapsDefault, + AppLimitCapsDefaultWithRelations, + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy, + CreateAppLimitCapsDefaultInput, + UpdateAppLimitCapsDefaultInput, + AppLimitCapsDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCapsDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCapsDefault", "appLimitCapsDefaults", 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 - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + 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, + }, + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefaults", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCapsDefault", "appLimitCapsDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefault", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCapsDefault": data.appLimitCapsDefaults?.nodes?.[0] ?? null - }) + appLimitCapsDefault: data.appLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCapsDefault", "appLimitCapsDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefault", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCapsDefault": data.appLimitCapsDefaults?.nodes?.[0] ?? null - }) + appLimitCapsDefault: data.appLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCapsDefault", "createAppLimitCapsDefault", "appLimitCapsDefault", args.select, args.data, "CreateAppLimitCapsDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCapsDefault', + 'createAppLimitCapsDefault', + 'appLimitCapsDefault', + args.select, + args.data, + 'CreateAppLimitCapsDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "createAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'createAppLimitCapsDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCapsDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCapsDefault", "updateAppLimitCapsDefault", "appLimitCapsDefault", args.select, args.where.id, args.data, "UpdateAppLimitCapsDefaultInput", "id", "appLimitCapsDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCapsDefault', + 'updateAppLimitCapsDefault', + 'appLimitCapsDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCapsDefaultInput', + 'id', + 'appLimitCapsDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "updateAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'updateAppLimitCapsDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCapsDefault", "deleteAppLimitCapsDefault", "appLimitCapsDefault", { - id: args.where.id - }, "DeleteAppLimitCapsDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCapsDefault', + 'deleteAppLimitCapsDefault', + 'appLimitCapsDefault', + { + id: args.where.id, + }, + 'DeleteAppLimitCapsDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "deleteAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'deleteAppLimitCapsDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCredit.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCredit.ts index b78f6d159a..7f66c4eb09 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCredit.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCredit.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCredit, AppLimitCreditWithRelations, AppLimitCreditSelect, AppLimitCreditFilter, AppLimitCreditOrderBy, CreateAppLimitCreditInput, UpdateAppLimitCreditInput, AppLimitCreditPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCredit, + AppLimitCreditWithRelations, + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy, + CreateAppLimitCreditInput, + UpdateAppLimitCreditInput, + AppLimitCreditPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCredit", "appLimitCredits", 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 - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCredit', + 'appLimitCredits', + 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, + }, + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredits", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCredit", "appLimitCredits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCredit', + 'appLimitCredits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredit", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCredit": data.appLimitCredits?.nodes?.[0] ?? null - }) + appLimitCredit: data.appLimitCredits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCredit", "appLimitCredits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCredit', + 'appLimitCredits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredit", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCredit": data.appLimitCredits?.nodes?.[0] ?? null - }) + appLimitCredit: data.appLimitCredits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCredit", "createAppLimitCredit", "appLimitCredit", args.select, args.data, "CreateAppLimitCreditInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCredit', + 'createAppLimitCredit', + 'appLimitCredit', + args.select, + args.data, + 'CreateAppLimitCreditInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "createAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'createAppLimitCredit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCredit", "updateAppLimitCredit", "appLimitCredit", args.select, args.where.id, args.data, "UpdateAppLimitCreditInput", "id", "appLimitCreditPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCredit', + 'updateAppLimitCredit', + 'appLimitCredit', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditInput', + 'id', + 'appLimitCreditPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "updateAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'updateAppLimitCredit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCredit", "deleteAppLimitCredit", "appLimitCredit", { - id: args.where.id - }, "DeleteAppLimitCreditInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCredit', + 'deleteAppLimitCredit', + 'appLimitCredit', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "deleteAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'deleteAppLimitCredit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCreditCode.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCreditCode.ts index db2a6b0b29..a449fef840 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCreditCode.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCreditCode.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCreditCode, AppLimitCreditCodeWithRelations, AppLimitCreditCodeSelect, AppLimitCreditCodeFilter, AppLimitCreditCodeOrderBy, CreateAppLimitCreditCodeInput, UpdateAppLimitCreditCodeInput, AppLimitCreditCodePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditCode, + AppLimitCreditCodeWithRelations, + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy, + CreateAppLimitCreditCodeInput, + UpdateAppLimitCreditCodeInput, + AppLimitCreditCodePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditCodeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCode", "appLimitCreditCodes", 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 - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + 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, + }, + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCodes", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCode: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditCode", "appLimitCreditCodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCode", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCode', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCreditCodeModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCode": data.appLimitCreditCodes?.nodes?.[0] ?? null - }) + appLimitCreditCode: data.appLimitCreditCodes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCode: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCode", "appLimitCreditCodes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCode", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCode', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCreditCodeModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCode": data.appLimitCreditCodes?.nodes?.[0] ?? null - }) + appLimitCreditCode: data.appLimitCreditCodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditCode", "createAppLimitCreditCode", "appLimitCreditCode", args.select, args.data, "CreateAppLimitCreditCodeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditCode', + 'createAppLimitCreditCode', + 'appLimitCreditCode', + args.select, + args.data, + 'CreateAppLimitCreditCodeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "createAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'createAppLimitCreditCode', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditCodePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditCode", "updateAppLimitCreditCode", "appLimitCreditCode", args.select, args.where.id, args.data, "UpdateAppLimitCreditCodeInput", "id", "appLimitCreditCodePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditCode', + 'updateAppLimitCreditCode', + 'appLimitCreditCode', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditCodeInput', + 'id', + 'appLimitCreditCodePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "updateAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'updateAppLimitCreditCode', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditCode", "deleteAppLimitCreditCode", "appLimitCreditCode", { - id: args.where.id - }, "DeleteAppLimitCreditCodeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditCode', + 'deleteAppLimitCreditCode', + 'appLimitCreditCode', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditCodeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "deleteAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'deleteAppLimitCreditCode', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCreditCodeItem.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCreditCodeItem.ts index ccf3875343..5f37d3fbe0 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCreditCodeItem.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCreditCodeItem.ts @@ -3,56 +3,98 @@ * @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 { AppLimitCreditCodeItem, AppLimitCreditCodeItemWithRelations, AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemFilter, AppLimitCreditCodeItemOrderBy, CreateAppLimitCreditCodeItemInput, UpdateAppLimitCreditCodeItemInput, AppLimitCreditCodeItemPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditCodeItem, + AppLimitCreditCodeItemWithRelations, + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy, + CreateAppLimitCreditCodeItemInput, + UpdateAppLimitCreditCodeItemInput, + AppLimitCreditCodeItemPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditCodeItemModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appLimitCreditCodeItems: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appLimitCreditCodeItems: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", 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 - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + 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, + }, + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItems", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItems', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodeItem: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItem", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItem', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppLimitCreditCodeItemModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCodeItem": data.appLimitCreditCodeItems?.nodes?.[0] ?? null - }) + appLimitCreditCodeItem: data.appLimitCreditCodeItems?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodeItem: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItem", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItem', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppLimitCreditCodeItemModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCodeItem": data.appLimitCreditCodeItems?.nodes?.[0] ?? null - }) + appLimitCreditCodeItem: data.appLimitCreditCodeItems?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditCodeItem", "createAppLimitCreditCodeItem", "appLimitCreditCodeItem", args.select, args.data, "CreateAppLimitCreditCodeItemInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditCodeItem', + 'createAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + args.select, + args.data, + 'CreateAppLimitCreditCodeItemInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "createAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'createAppLimitCreditCodeItem', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditCodeItemPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditCodeItem", "updateAppLimitCreditCodeItem", "appLimitCreditCodeItem", args.select, args.where.id, args.data, "UpdateAppLimitCreditCodeItemInput", "id", "appLimitCreditCodeItemPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditCodeItem', + 'updateAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditCodeItemInput', + 'id', + 'appLimitCreditCodeItemPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "updateAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'updateAppLimitCreditCodeItem', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditCodeItem", "deleteAppLimitCreditCodeItem", "appLimitCreditCodeItem", { - id: args.where.id - }, "DeleteAppLimitCreditCodeItemInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditCodeItem', + 'deleteAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditCodeItemInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "deleteAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'deleteAppLimitCreditCodeItem', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCreditRedemption.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCreditRedemption.ts index 754ba79962..582960bd9f 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCreditRedemption.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCreditRedemption.ts @@ -3,56 +3,98 @@ * @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 { AppLimitCreditRedemption, AppLimitCreditRedemptionWithRelations, AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionFilter, AppLimitCreditRedemptionOrderBy, CreateAppLimitCreditRedemptionInput, UpdateAppLimitCreditRedemptionInput, AppLimitCreditRedemptionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditRedemption, + AppLimitCreditRedemptionWithRelations, + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy, + CreateAppLimitCreditRedemptionInput, + UpdateAppLimitCreditRedemptionInput, + AppLimitCreditRedemptionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditRedemptionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appLimitCreditRedemptions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appLimitCreditRedemptions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", 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 - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + 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, + }, + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemptions", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemptions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditRedemption: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemption", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemption', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppLimitCreditRedemptionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditRedemption": data.appLimitCreditRedemptions?.nodes?.[0] ?? null - }) + appLimitCreditRedemption: data.appLimitCreditRedemptions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditRedemption: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemption", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemption', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppLimitCreditRedemptionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditRedemption": data.appLimitCreditRedemptions?.nodes?.[0] ?? null - }) + appLimitCreditRedemption: data.appLimitCreditRedemptions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditRedemption", "createAppLimitCreditRedemption", "appLimitCreditRedemption", args.select, args.data, "CreateAppLimitCreditRedemptionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditRedemption', + 'createAppLimitCreditRedemption', + 'appLimitCreditRedemption', + args.select, + args.data, + 'CreateAppLimitCreditRedemptionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "createAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'createAppLimitCreditRedemption', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditRedemptionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditRedemption", "updateAppLimitCreditRedemption", "appLimitCreditRedemption", args.select, args.where.id, args.data, "UpdateAppLimitCreditRedemptionInput", "id", "appLimitCreditRedemptionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditRedemption', + 'updateAppLimitCreditRedemption', + 'appLimitCreditRedemption', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditRedemptionInput', + 'id', + 'appLimitCreditRedemptionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "updateAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'updateAppLimitCreditRedemption', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditRedemption", "deleteAppLimitCreditRedemption", "appLimitCreditRedemption", { - id: args.where.id - }, "DeleteAppLimitCreditRedemptionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditRedemption', + 'deleteAppLimitCreditRedemption', + 'appLimitCreditRedemption', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditRedemptionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "deleteAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'deleteAppLimitCreditRedemption', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitDefault.ts b/sdk/constructive-react/src/usage/orm/models/appLimitDefault.ts index 6a45e01c7f..f0eb49d31f 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitDefault.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitDefault.ts @@ -3,56 +3,96 @@ * @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 { AppLimitDefault, AppLimitDefaultWithRelations, AppLimitDefaultSelect, AppLimitDefaultFilter, AppLimitDefaultOrderBy, CreateAppLimitDefaultInput, UpdateAppLimitDefaultInput, AppLimitDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitDefault, + AppLimitDefaultWithRelations, + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy, + CreateAppLimitDefaultInput, + UpdateAppLimitDefaultInput, + AppLimitDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitDefault", "appLimitDefaults", 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 - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitDefault', + 'appLimitDefaults', + 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, + }, + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefaults", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitDefault", "appLimitDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitDefault', + 'appLimitDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefault", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitDefault": data.appLimitDefaults?.nodes?.[0] ?? null - }) + appLimitDefault: data.appLimitDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitDefault", "appLimitDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitDefault', + 'appLimitDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefault", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitDefault": data.appLimitDefaults?.nodes?.[0] ?? null - }) + appLimitDefault: data.appLimitDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitDefault", "createAppLimitDefault", "appLimitDefault", args.select, args.data, "CreateAppLimitDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitDefault', + 'createAppLimitDefault', + 'appLimitDefault', + args.select, + args.data, + 'CreateAppLimitDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "createAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'createAppLimitDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitDefault", "updateAppLimitDefault", "appLimitDefault", args.select, args.where.id, args.data, "UpdateAppLimitDefaultInput", "id", "appLimitDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitDefault', + 'updateAppLimitDefault', + 'appLimitDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitDefaultInput', + 'id', + 'appLimitDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "updateAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'updateAppLimitDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitDefault", "deleteAppLimitDefault", "appLimitDefault", { - id: args.where.id - }, "DeleteAppLimitDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitDefault', + 'deleteAppLimitDefault', + 'appLimitDefault', + { + id: args.where.id, + }, + 'DeleteAppLimitDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "deleteAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'deleteAppLimitDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitEvent.ts b/sdk/constructive-react/src/usage/orm/models/appLimitEvent.ts index 9a54edcef3..17fd7e8866 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitEvent.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitEvent.ts @@ -3,56 +3,96 @@ * @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 { AppLimitEvent, AppLimitEventWithRelations, AppLimitEventSelect, AppLimitEventFilter, AppLimitEventOrderBy, CreateAppLimitEventInput, UpdateAppLimitEventInput, AppLimitEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitEvent, + AppLimitEventWithRelations, + AppLimitEventSelect, + AppLimitEventFilter, + AppLimitEventOrderBy, + CreateAppLimitEventInput, + UpdateAppLimitEventInput, + AppLimitEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitEvent", "appLimitEvents", 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 - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitEvent', + 'appLimitEvents', + 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, + }, + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvents", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitEvent", "appLimitEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitEvent', + 'appLimitEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvent", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitEvent": data.appLimitEvents?.nodes?.[0] ?? null - }) + appLimitEvent: data.appLimitEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitEvent", "appLimitEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitEvent', + 'appLimitEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvent", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class AppLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitEvent": data.appLimitEvents?.nodes?.[0] ?? null - }) + appLimitEvent: data.appLimitEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitEvent", "createAppLimitEvent", "appLimitEvent", args.select, args.data, "CreateAppLimitEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitEvent', + 'createAppLimitEvent', + 'appLimitEvent', + args.select, + args.data, + 'CreateAppLimitEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "createAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'createAppLimitEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + AppLimitEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitEvent", "updateAppLimitEvent", "appLimitEvent", args.select, args.where.id, args.data, "UpdateAppLimitEventInput", "id", "appLimitEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitEvent', + 'updateAppLimitEvent', + 'appLimitEvent', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitEventInput', + 'id', + 'appLimitEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "updateAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'updateAppLimitEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitEvent", "deleteAppLimitEvent", "appLimitEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteAppLimitEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitEvent', + 'deleteAppLimitEvent', + 'appLimitEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteAppLimitEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "deleteAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'deleteAppLimitEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitWarning.ts b/sdk/constructive-react/src/usage/orm/models/appLimitWarning.ts index c7e959263a..4d31d5490a 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitWarning.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitWarning.ts @@ -3,56 +3,96 @@ * @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 { AppLimitWarning, AppLimitWarningWithRelations, AppLimitWarningSelect, AppLimitWarningFilter, AppLimitWarningOrderBy, CreateAppLimitWarningInput, UpdateAppLimitWarningInput, AppLimitWarningPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitWarning, + AppLimitWarningWithRelations, + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy, + CreateAppLimitWarningInput, + UpdateAppLimitWarningInput, + AppLimitWarningPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitWarningModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarnings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitWarning", "appLimitWarnings", 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 - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitWarning', + 'appLimitWarnings', + 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, + }, + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarnings", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarnings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitWarning", "appLimitWarnings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitWarning', + 'appLimitWarnings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarning", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarning', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitWarning": data.appLimitWarnings?.nodes?.[0] ?? null - }) + appLimitWarning: data.appLimitWarnings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitWarning", "appLimitWarnings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitWarning', + 'appLimitWarnings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarning", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarning', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitWarning": data.appLimitWarnings?.nodes?.[0] ?? null - }) + appLimitWarning: data.appLimitWarnings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitWarning", "createAppLimitWarning", "appLimitWarning", args.select, args.data, "CreateAppLimitWarningInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitWarning', + 'createAppLimitWarning', + 'appLimitWarning', + args.select, + args.data, + 'CreateAppLimitWarningInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "createAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'createAppLimitWarning', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitWarningPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitWarning", "updateAppLimitWarning", "appLimitWarning", args.select, args.where.id, args.data, "UpdateAppLimitWarningInput", "id", "appLimitWarningPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitWarning', + 'updateAppLimitWarning', + 'appLimitWarning', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitWarningInput', + 'id', + 'appLimitWarningPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "updateAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'updateAppLimitWarning', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitWarning", "deleteAppLimitWarning", "appLimitWarning", { - id: args.where.id - }, "DeleteAppLimitWarningInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitWarning', + 'deleteAppLimitWarning', + 'appLimitWarning', + { + id: args.where.id, + }, + 'DeleteAppLimitWarningInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "deleteAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'deleteAppLimitWarning', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/index.ts b/sdk/constructive-react/src/usage/orm/models/index.ts index 33c8f9a18e..049cfdab13 100644 --- a/sdk/constructive-react/src/usage/orm/models/index.ts +++ b/sdk/constructive-react/src/usage/orm/models/index.ts @@ -3,21 +3,21 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AppLimitCapModel } from "./appLimitCap"; -export { AppLimitCapsDefaultModel } from "./appLimitCapsDefault"; -export { AppLimitModel } from "./appLimit"; -export { AppLimitCreditCodeModel } from "./appLimitCreditCode"; -export { AppLimitCreditCodeItemModel } from "./appLimitCreditCodeItem"; -export { AppLimitCreditModel } from "./appLimitCredit"; -export { AppLimitCreditRedemptionModel } from "./appLimitCreditRedemption"; -export { AppLimitDefaultModel } from "./appLimitDefault"; -export { AppLimitEventModel } from "./appLimitEvent"; -export { AppLimitWarningModel } from "./appLimitWarning"; -export { OrgLimitAggregateModel } from "./orgLimitAggregate"; -export { OrgLimitCapModel } from "./orgLimitCap"; -export { OrgLimitCapsDefaultModel } from "./orgLimitCapsDefault"; -export { OrgLimitModel } from "./orgLimit"; -export { OrgLimitCreditModel } from "./orgLimitCredit"; -export { OrgLimitDefaultModel } from "./orgLimitDefault"; -export { OrgLimitEventModel } from "./orgLimitEvent"; -export { OrgLimitWarningModel } from "./orgLimitWarning"; \ No newline at end of file +export { AppLimitCapModel } from './appLimitCap'; +export { AppLimitCapsDefaultModel } from './appLimitCapsDefault'; +export { AppLimitModel } from './appLimit'; +export { AppLimitCreditCodeModel } from './appLimitCreditCode'; +export { AppLimitCreditCodeItemModel } from './appLimitCreditCodeItem'; +export { AppLimitCreditModel } from './appLimitCredit'; +export { AppLimitCreditRedemptionModel } from './appLimitCreditRedemption'; +export { AppLimitDefaultModel } from './appLimitDefault'; +export { AppLimitEventModel } from './appLimitEvent'; +export { AppLimitWarningModel } from './appLimitWarning'; +export { OrgLimitAggregateModel } from './orgLimitAggregate'; +export { OrgLimitCapModel } from './orgLimitCap'; +export { OrgLimitCapsDefaultModel } from './orgLimitCapsDefault'; +export { OrgLimitModel } from './orgLimit'; +export { OrgLimitCreditModel } from './orgLimitCredit'; +export { OrgLimitDefaultModel } from './orgLimitDefault'; +export { OrgLimitEventModel } from './orgLimitEvent'; +export { OrgLimitWarningModel } from './orgLimitWarning'; diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimit.ts b/sdk/constructive-react/src/usage/orm/models/orgLimit.ts index 246f61238f..188531420f 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimit.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimit.ts @@ -3,56 +3,96 @@ * @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 { OrgLimit, OrgLimitWithRelations, OrgLimitSelect, OrgLimitFilter, OrgLimitOrderBy, CreateOrgLimitInput, UpdateOrgLimitInput, OrgLimitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimit, + OrgLimitWithRelations, + OrgLimitSelect, + OrgLimitFilter, + OrgLimitOrderBy, + CreateOrgLimitInput, + UpdateOrgLimitInput, + OrgLimitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimit", "orgLimits", 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 - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimit', + 'orgLimits', + 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, + }, + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimits", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimit", "orgLimits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimit', + 'orgLimits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimit", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimit": data.orgLimits?.nodes?.[0] ?? null - }) + orgLimit: data.orgLimits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimit", "orgLimits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimit', + 'orgLimits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimit", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimit": data.orgLimits?.nodes?.[0] ?? null - }) + orgLimit: data.orgLimits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimit", "createOrgLimit", "orgLimit", args.select, args.data, "CreateOrgLimitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimit', + 'createOrgLimit', + 'orgLimit', + args.select, + args.data, + 'CreateOrgLimitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "createOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'createOrgLimit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimit", "updateOrgLimit", "orgLimit", args.select, args.where.id, args.data, "UpdateOrgLimitInput", "id", "orgLimitPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimit', + 'updateOrgLimit', + 'orgLimit', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitInput', + 'id', + 'orgLimitPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "updateOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'updateOrgLimit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimit", "deleteOrgLimit", "orgLimit", { - id: args.where.id - }, "DeleteOrgLimitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimit', + 'deleteOrgLimit', + 'orgLimit', + { + id: args.where.id, + }, + 'DeleteOrgLimitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "deleteOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'deleteOrgLimit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitAggregate.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitAggregate.ts index cccd405709..43f24e6d05 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitAggregate.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitAggregate.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitAggregate, OrgLimitAggregateWithRelations, OrgLimitAggregateSelect, OrgLimitAggregateFilter, OrgLimitAggregateOrderBy, CreateOrgLimitAggregateInput, UpdateOrgLimitAggregateInput, OrgLimitAggregatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitAggregate, + OrgLimitAggregateWithRelations, + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy, + CreateOrgLimitAggregateInput, + UpdateOrgLimitAggregateInput, + OrgLimitAggregatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitAggregateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregates: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitAggregate", "orgLimitAggregates", 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 - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + 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, + }, + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregates", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitAggregate", "orgLimitAggregates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregate", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregate', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitAggregateModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitAggregate": data.orgLimitAggregates?.nodes?.[0] ?? null - }) + orgLimitAggregate: data.orgLimitAggregates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitAggregate", "orgLimitAggregates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregate", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregate', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitAggregateModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitAggregate": data.orgLimitAggregates?.nodes?.[0] ?? null - }) + orgLimitAggregate: data.orgLimitAggregates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitAggregate", "createOrgLimitAggregate", "orgLimitAggregate", args.select, args.data, "CreateOrgLimitAggregateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitAggregate', + 'createOrgLimitAggregate', + 'orgLimitAggregate', + args.select, + args.data, + 'CreateOrgLimitAggregateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "createOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'createOrgLimitAggregate', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitAggregatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitAggregate", "updateOrgLimitAggregate", "orgLimitAggregate", args.select, args.where.id, args.data, "UpdateOrgLimitAggregateInput", "id", "orgLimitAggregatePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitAggregate', + 'updateOrgLimitAggregate', + 'orgLimitAggregate', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitAggregateInput', + 'id', + 'orgLimitAggregatePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "updateOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'updateOrgLimitAggregate', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitAggregate", "deleteOrgLimitAggregate", "orgLimitAggregate", { - id: args.where.id - }, "DeleteOrgLimitAggregateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitAggregate', + 'deleteOrgLimitAggregate', + 'orgLimitAggregate', + { + id: args.where.id, + }, + 'DeleteOrgLimitAggregateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "deleteOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'deleteOrgLimitAggregate', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitCap.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitCap.ts index 932ee5f41c..0877ea93fd 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitCap.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitCap.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCap, OrgLimitCapWithRelations, OrgLimitCapSelect, OrgLimitCapFilter, OrgLimitCapOrderBy, CreateOrgLimitCapInput, UpdateOrgLimitCapInput, OrgLimitCapPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCap, + OrgLimitCapWithRelations, + OrgLimitCapSelect, + OrgLimitCapFilter, + OrgLimitCapOrderBy, + CreateOrgLimitCapInput, + UpdateOrgLimitCapInput, + OrgLimitCapPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCapModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCaps: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCap", "orgLimitCaps", 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 - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCap', + 'orgLimitCaps', + 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, + }, + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCaps", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCaps', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCap", "orgLimitCaps", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCap', + 'orgLimitCaps', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCap", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCap', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCap": data.orgLimitCaps?.nodes?.[0] ?? null - }) + orgLimitCap: data.orgLimitCaps?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCap", "orgLimitCaps", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCap', + 'orgLimitCaps', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCap", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCap', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCap": data.orgLimitCaps?.nodes?.[0] ?? null - }) + orgLimitCap: data.orgLimitCaps?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCap", "createOrgLimitCap", "orgLimitCap", args.select, args.data, "CreateOrgLimitCapInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCap', + 'createOrgLimitCap', + 'orgLimitCap', + args.select, + args.data, + 'CreateOrgLimitCapInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "createOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'createOrgLimitCap', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCapPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCap", "updateOrgLimitCap", "orgLimitCap", args.select, args.where.id, args.data, "UpdateOrgLimitCapInput", "id", "orgLimitCapPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCap', + 'updateOrgLimitCap', + 'orgLimitCap', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCapInput', + 'id', + 'orgLimitCapPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "updateOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'updateOrgLimitCap', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCap", "deleteOrgLimitCap", "orgLimitCap", { - id: args.where.id - }, "DeleteOrgLimitCapInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCap', + 'deleteOrgLimitCap', + 'orgLimitCap', + { + id: args.where.id, + }, + 'DeleteOrgLimitCapInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "deleteOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'deleteOrgLimitCap', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitCapsDefault.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitCapsDefault.ts index 333bc342a2..de62c801b7 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitCapsDefault.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitCapsDefault.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCapsDefault, OrgLimitCapsDefaultWithRelations, OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultFilter, OrgLimitCapsDefaultOrderBy, CreateOrgLimitCapsDefaultInput, UpdateOrgLimitCapsDefaultInput, OrgLimitCapsDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCapsDefault, + OrgLimitCapsDefaultWithRelations, + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy, + CreateOrgLimitCapsDefaultInput, + UpdateOrgLimitCapsDefaultInput, + OrgLimitCapsDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCapsDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", 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 - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + 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, + }, + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefaults", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefault", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCapsDefault": data.orgLimitCapsDefaults?.nodes?.[0] ?? null - }) + orgLimitCapsDefault: data.orgLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefault", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCapsDefault": data.orgLimitCapsDefaults?.nodes?.[0] ?? null - }) + orgLimitCapsDefault: data.orgLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCapsDefault", "createOrgLimitCapsDefault", "orgLimitCapsDefault", args.select, args.data, "CreateOrgLimitCapsDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCapsDefault', + 'createOrgLimitCapsDefault', + 'orgLimitCapsDefault', + args.select, + args.data, + 'CreateOrgLimitCapsDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "createOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'createOrgLimitCapsDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCapsDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCapsDefault", "updateOrgLimitCapsDefault", "orgLimitCapsDefault", args.select, args.where.id, args.data, "UpdateOrgLimitCapsDefaultInput", "id", "orgLimitCapsDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCapsDefault', + 'updateOrgLimitCapsDefault', + 'orgLimitCapsDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCapsDefaultInput', + 'id', + 'orgLimitCapsDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "updateOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'updateOrgLimitCapsDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCapsDefault", "deleteOrgLimitCapsDefault", "orgLimitCapsDefault", { - id: args.where.id - }, "DeleteOrgLimitCapsDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCapsDefault', + 'deleteOrgLimitCapsDefault', + 'orgLimitCapsDefault', + { + id: args.where.id, + }, + 'DeleteOrgLimitCapsDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "deleteOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'deleteOrgLimitCapsDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitCredit.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitCredit.ts index 0ef684e92b..497dd5d807 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitCredit.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitCredit.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCredit, OrgLimitCreditWithRelations, OrgLimitCreditSelect, OrgLimitCreditFilter, OrgLimitCreditOrderBy, CreateOrgLimitCreditInput, UpdateOrgLimitCreditInput, OrgLimitCreditPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCredit, + OrgLimitCreditWithRelations, + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy, + CreateOrgLimitCreditInput, + UpdateOrgLimitCreditInput, + OrgLimitCreditPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCreditModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCredit", "orgLimitCredits", 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 - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + 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, + }, + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredits", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCredit", "orgLimitCredits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredit", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCredit": data.orgLimitCredits?.nodes?.[0] ?? null - }) + orgLimitCredit: data.orgLimitCredits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCredit", "orgLimitCredits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredit", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCredit": data.orgLimitCredits?.nodes?.[0] ?? null - }) + orgLimitCredit: data.orgLimitCredits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCredit", "createOrgLimitCredit", "orgLimitCredit", args.select, args.data, "CreateOrgLimitCreditInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCredit', + 'createOrgLimitCredit', + 'orgLimitCredit', + args.select, + args.data, + 'CreateOrgLimitCreditInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "createOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'createOrgLimitCredit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCreditPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCredit", "updateOrgLimitCredit", "orgLimitCredit", args.select, args.where.id, args.data, "UpdateOrgLimitCreditInput", "id", "orgLimitCreditPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCredit', + 'updateOrgLimitCredit', + 'orgLimitCredit', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCreditInput', + 'id', + 'orgLimitCreditPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "updateOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'updateOrgLimitCredit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCredit", "deleteOrgLimitCredit", "orgLimitCredit", { - id: args.where.id - }, "DeleteOrgLimitCreditInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCredit', + 'deleteOrgLimitCredit', + 'orgLimitCredit', + { + id: args.where.id, + }, + 'DeleteOrgLimitCreditInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "deleteOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'deleteOrgLimitCredit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitDefault.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitDefault.ts index 3b1dfb8b6d..3c91177b9c 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitDefault.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitDefault.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitDefault, OrgLimitDefaultWithRelations, OrgLimitDefaultSelect, OrgLimitDefaultFilter, OrgLimitDefaultOrderBy, CreateOrgLimitDefaultInput, UpdateOrgLimitDefaultInput, OrgLimitDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitDefault, + OrgLimitDefaultWithRelations, + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy, + CreateOrgLimitDefaultInput, + UpdateOrgLimitDefaultInput, + OrgLimitDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitDefault", "orgLimitDefaults", 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 - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + 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, + }, + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefaults", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitDefault", "orgLimitDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefault", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitDefault": data.orgLimitDefaults?.nodes?.[0] ?? null - }) + orgLimitDefault: data.orgLimitDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitDefault", "orgLimitDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefault", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitDefault": data.orgLimitDefaults?.nodes?.[0] ?? null - }) + orgLimitDefault: data.orgLimitDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitDefault", "createOrgLimitDefault", "orgLimitDefault", args.select, args.data, "CreateOrgLimitDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitDefault', + 'createOrgLimitDefault', + 'orgLimitDefault', + args.select, + args.data, + 'CreateOrgLimitDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "createOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'createOrgLimitDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitDefault", "updateOrgLimitDefault", "orgLimitDefault", args.select, args.where.id, args.data, "UpdateOrgLimitDefaultInput", "id", "orgLimitDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitDefault', + 'updateOrgLimitDefault', + 'orgLimitDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitDefaultInput', + 'id', + 'orgLimitDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "updateOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'updateOrgLimitDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitDefault", "deleteOrgLimitDefault", "orgLimitDefault", { - id: args.where.id - }, "DeleteOrgLimitDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitDefault', + 'deleteOrgLimitDefault', + 'orgLimitDefault', + { + id: args.where.id, + }, + 'DeleteOrgLimitDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "deleteOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'deleteOrgLimitDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitEvent.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitEvent.ts index 957e209173..419737757d 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitEvent.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitEvent.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitEvent, OrgLimitEventWithRelations, OrgLimitEventSelect, OrgLimitEventFilter, OrgLimitEventOrderBy, CreateOrgLimitEventInput, UpdateOrgLimitEventInput, OrgLimitEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitEvent, + OrgLimitEventWithRelations, + OrgLimitEventSelect, + OrgLimitEventFilter, + OrgLimitEventOrderBy, + CreateOrgLimitEventInput, + UpdateOrgLimitEventInput, + OrgLimitEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitEvent", "orgLimitEvents", 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 - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + 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, + }, + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvents", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitEvent", "orgLimitEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvent", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitEvent": data.orgLimitEvents?.nodes?.[0] ?? null - }) + orgLimitEvent: data.orgLimitEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitEvent", "orgLimitEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvent", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class OrgLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitEvent": data.orgLimitEvents?.nodes?.[0] ?? null - }) + orgLimitEvent: data.orgLimitEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitEvent", "createOrgLimitEvent", "orgLimitEvent", args.select, args.data, "CreateOrgLimitEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitEvent', + 'createOrgLimitEvent', + 'orgLimitEvent', + args.select, + args.data, + 'CreateOrgLimitEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "createOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'createOrgLimitEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgLimitEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitEvent", "updateOrgLimitEvent", "orgLimitEvent", args.select, args.where.id, args.data, "UpdateOrgLimitEventInput", "id", "orgLimitEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitEvent', + 'updateOrgLimitEvent', + 'orgLimitEvent', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitEventInput', + 'id', + 'orgLimitEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "updateOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'updateOrgLimitEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitEvent", "deleteOrgLimitEvent", "orgLimitEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteOrgLimitEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitEvent', + 'deleteOrgLimitEvent', + 'orgLimitEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgLimitEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "deleteOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'deleteOrgLimitEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitWarning.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitWarning.ts index c87ba9cf50..67d887241a 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitWarning.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitWarning.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitWarning, OrgLimitWarningWithRelations, OrgLimitWarningSelect, OrgLimitWarningFilter, OrgLimitWarningOrderBy, CreateOrgLimitWarningInput, UpdateOrgLimitWarningInput, OrgLimitWarningPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitWarning, + OrgLimitWarningWithRelations, + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy, + CreateOrgLimitWarningInput, + UpdateOrgLimitWarningInput, + OrgLimitWarningPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitWarningModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarnings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitWarning", "orgLimitWarnings", 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 - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + 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, + }, + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarnings", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarnings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitWarning", "orgLimitWarnings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarning", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarning', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitWarning": data.orgLimitWarnings?.nodes?.[0] ?? null - }) + orgLimitWarning: data.orgLimitWarnings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitWarning", "orgLimitWarnings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarning", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarning', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitWarning": data.orgLimitWarnings?.nodes?.[0] ?? null - }) + orgLimitWarning: data.orgLimitWarnings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitWarning", "createOrgLimitWarning", "orgLimitWarning", args.select, args.data, "CreateOrgLimitWarningInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitWarning', + 'createOrgLimitWarning', + 'orgLimitWarning', + args.select, + args.data, + 'CreateOrgLimitWarningInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "createOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'createOrgLimitWarning', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitWarningPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitWarning", "updateOrgLimitWarning", "orgLimitWarning", args.select, args.where.id, args.data, "UpdateOrgLimitWarningInput", "id", "orgLimitWarningPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitWarning', + 'updateOrgLimitWarning', + 'orgLimitWarning', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitWarningInput', + 'id', + 'orgLimitWarningPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "updateOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'updateOrgLimitWarning', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitWarning", "deleteOrgLimitWarning", "orgLimitWarning", { - id: args.where.id - }, "DeleteOrgLimitWarningInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitWarning', + 'deleteOrgLimitWarning', + 'orgLimitWarning', + { + id: args.where.id, + }, + 'DeleteOrgLimitWarningInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "deleteOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'deleteOrgLimitWarning', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/mutation/index.ts b/sdk/constructive-react/src/usage/orm/mutation/index.ts index 9c8a2c2e94..176d63791b 100644 --- a/sdk/constructive-react/src/usage/orm/mutation/index.ts +++ b/sdk/constructive-react/src/usage/orm/mutation/index.ts @@ -3,11 +3,27 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, SeedAppLimitCapsDefaultsInput, SeedAppLimitDefaultsInput, SeedOrgLimitCapsDefaultsInput, SeedOrgLimitDefaultsInput, ProvisionBucketPayload, SeedAppLimitCapsDefaultsPayload, SeedAppLimitDefaultsPayload, SeedOrgLimitCapsDefaultsPayload, SeedOrgLimitDefaultsPayload, ProvisionBucketPayloadSelect, SeedAppLimitCapsDefaultsPayloadSelect, SeedAppLimitDefaultsPayloadSelect, SeedOrgLimitCapsDefaultsPayloadSelect, SeedOrgLimitDefaultsPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + SeedAppLimitCapsDefaultsInput, + SeedAppLimitDefaultsInput, + SeedOrgLimitCapsDefaultsInput, + SeedOrgLimitDefaultsInput, + ProvisionBucketPayload, + SeedAppLimitCapsDefaultsPayload, + SeedAppLimitDefaultsPayload, + SeedOrgLimitCapsDefaultsPayload, + SeedOrgLimitDefaultsPayload, + ProvisionBucketPayloadSelect, + SeedAppLimitCapsDefaultsPayloadSelect, + SeedAppLimitDefaultsPayloadSelect, + SeedOrgLimitCapsDefaultsPayloadSelect, + SeedOrgLimitDefaultsPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -32,75 +48,150 @@ export interface SeedOrgLimitDefaultsVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - seedAppLimitCapsDefaults: (args: SeedAppLimitCapsDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedAppLimitCapsDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedAppLimitCapsDefaults", - fieldName: "seedAppLimitCapsDefaults", - ...buildCustomDocument("mutation", "SeedAppLimitCapsDefaults", "seedAppLimitCapsDefaults", options.select, args, [{ - name: "input", - type: "SeedAppLimitCapsDefaultsInput!" - }], connectionFieldsMap, "SeedAppLimitCapsDefaultsPayload") - }), - seedAppLimitDefaults: (args: SeedAppLimitDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedAppLimitDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedAppLimitDefaults", - fieldName: "seedAppLimitDefaults", - ...buildCustomDocument("mutation", "SeedAppLimitDefaults", "seedAppLimitDefaults", options.select, args, [{ - name: "input", - type: "SeedAppLimitDefaultsInput!" - }], connectionFieldsMap, "SeedAppLimitDefaultsPayload") - }), - seedOrgLimitCapsDefaults: (args: SeedOrgLimitCapsDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedOrgLimitCapsDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedOrgLimitCapsDefaults", - fieldName: "seedOrgLimitCapsDefaults", - ...buildCustomDocument("mutation", "SeedOrgLimitCapsDefaults", "seedOrgLimitCapsDefaults", options.select, args, [{ - name: "input", - type: "SeedOrgLimitCapsDefaultsInput!" - }], connectionFieldsMap, "SeedOrgLimitCapsDefaultsPayload") - }), - seedOrgLimitDefaults: (args: SeedOrgLimitDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedOrgLimitDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedOrgLimitDefaults", - fieldName: "seedOrgLimitDefaults", - ...buildCustomDocument("mutation", "SeedOrgLimitDefaults", "seedOrgLimitDefaults", options.select, args, [{ - name: "input", - type: "SeedOrgLimitDefaultsInput!" - }], connectionFieldsMap, "SeedOrgLimitDefaultsPayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + seedAppLimitCapsDefaults: ( + args: SeedAppLimitCapsDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedAppLimitCapsDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedAppLimitCapsDefaults', + fieldName: 'seedAppLimitCapsDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedAppLimitCapsDefaults', + 'seedAppLimitCapsDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedAppLimitCapsDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedAppLimitCapsDefaultsPayload' + ), + }), + seedAppLimitDefaults: ( + args: SeedAppLimitDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedAppLimitDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedAppLimitDefaults', + fieldName: 'seedAppLimitDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedAppLimitDefaults', + 'seedAppLimitDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedAppLimitDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedAppLimitDefaultsPayload' + ), + }), + seedOrgLimitCapsDefaults: ( + args: SeedOrgLimitCapsDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedOrgLimitCapsDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedOrgLimitCapsDefaults', + fieldName: 'seedOrgLimitCapsDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedOrgLimitCapsDefaults', + 'seedOrgLimitCapsDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedOrgLimitCapsDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedOrgLimitCapsDefaultsPayload' + ), + }), + seedOrgLimitDefaults: ( + args: SeedOrgLimitDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedOrgLimitDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedOrgLimitDefaults', + fieldName: 'seedOrgLimitDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedOrgLimitDefaults', + 'seedOrgLimitDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedOrgLimitDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedOrgLimitDefaultsPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/orm/query-builder.ts b/sdk/constructive-react/src/usage/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-react/src/usage/orm/query-builder.ts +++ b/sdk/constructive-react/src/usage/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-react/src/usage/orm/realtime.ts b/sdk/constructive-react/src/usage/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-react/src/usage/orm/realtime.ts +++ b/sdk/constructive-react/src/usage/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-react/src/usage/orm/select-types.ts b/sdk/constructive-react/src/usage/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-react/src/usage/orm/select-types.ts +++ b/sdk/constructive-react/src/usage/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-react/src/usage/schema-types.ts b/sdk/constructive-react/src/usage/schema-types.ts index 04c0976554..98b3c3c9f4 100644 --- a/sdk/constructive-react/src/usage/schema-types.ts +++ b/sdk/constructive-react/src/usage/schema-types.ts @@ -4,43 +4,393 @@ * DO NOT EDIT - changes will be overwritten */ -import type { AppLimit, AppLimitCap, AppLimitCapsDefault, AppLimitCredit, AppLimitCreditCode, AppLimitCreditCodeItem, AppLimitCreditRedemption, AppLimitDefault, AppLimitEvent, AppLimitWarning, OrgLimit, OrgLimitAggregate, OrgLimitCap, OrgLimitCapsDefault, OrgLimitCredit, OrgLimitDefault, OrgLimitEvent, OrgLimitWarning, BigFloatFilter, BigIntFilter, BitStringFilter, BooleanFilter, DateFilter, DatetimeFilter, FloatFilter, FullTextFilter, IntFilter, IntListFilter, InternetAddressFilter, JSONFilter, StringFilter, StringListFilter, UUIDFilter, UUIDListFilter, VectorFilter } from "./types"; +import type { + AppLimit, + AppLimitCap, + AppLimitCapsDefault, + AppLimitCredit, + AppLimitCreditCode, + AppLimitCreditCodeItem, + AppLimitCreditRedemption, + AppLimitDefault, + AppLimitEvent, + AppLimitWarning, + OrgLimit, + OrgLimitAggregate, + OrgLimitCap, + OrgLimitCapsDefault, + OrgLimitCredit, + OrgLimitDefault, + OrgLimitEvent, + OrgLimitWarning, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; /** Methods to use when ordering `AppLimitCap`. */ -export type AppLimitCapOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type AppLimitCapOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `AppLimitCapsDefault`. */ -export type AppLimitCapsDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type AppLimitCapsDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `AppLimitCreditCodeItem`. */ -export type AppLimitCreditCodeItemOrderBy = "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_CODE_ID_ASC" | "CREDIT_CODE_ID_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type AppLimitCreditCodeItemOrderBy = + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_CODE_ID_ASC' + | 'CREDIT_CODE_ID_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `AppLimitCreditCode`. */ -export type AppLimitCreditCodeOrderBy = "CODE_ASC" | "CODE_DESC" | "CURRENT_REDEMPTIONS_ASC" | "CURRENT_REDEMPTIONS_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "MAX_REDEMPTIONS_ASC" | "MAX_REDEMPTIONS_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type AppLimitCreditCodeOrderBy = + | 'CODE_ASC' + | 'CODE_DESC' + | 'CURRENT_REDEMPTIONS_ASC' + | 'CURRENT_REDEMPTIONS_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_REDEMPTIONS_ASC' + | 'MAX_REDEMPTIONS_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `AppLimitCredit`. */ -export type AppLimitCreditOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; +export type AppLimitCreditOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; /** Methods to use when ordering `AppLimitCreditRedemption`. */ -export type AppLimitCreditRedemptionOrderBy = "CREDIT_CODE_ID_ASC" | "CREDIT_CODE_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type AppLimitCreditRedemptionOrderBy = + | 'CREDIT_CODE_ID_ASC' + | 'CREDIT_CODE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `AppLimitDefault`. */ -export type AppLimitDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC"; +export type AppLimitDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC'; /** Methods to use when ordering `AppLimitEvent`. */ -export type AppLimitEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DELTA_ASC" | "DELTA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_AT_EVENT_ASC" | "MAX_AT_EVENT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_AFTER_ASC" | "NUM_AFTER_DESC" | "NUM_BEFORE_ASC" | "NUM_BEFORE_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; +export type AppLimitEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DELTA_ASC' + | 'DELTA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_AT_EVENT_ASC' + | 'MAX_AT_EVENT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_AFTER_ASC' + | 'NUM_AFTER_DESC' + | 'NUM_BEFORE_ASC' + | 'NUM_BEFORE_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; /** Methods to use when ordering `AppLimit`. */ -export type AppLimitOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; +export type AppLimitOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; /** Methods to use when ordering `AppLimitWarning`. */ -export type AppLimitWarningOrderBy = "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "THRESHOLD_VALUE_ASC" | "THRESHOLD_VALUE_DESC" | "WARNING_TYPE_ASC" | "WARNING_TYPE_DESC"; +export type AppLimitWarningOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'THRESHOLD_VALUE_ASC' + | 'THRESHOLD_VALUE_DESC' + | 'WARNING_TYPE_ASC' + | 'WARNING_TYPE_DESC'; /** Methods to use when ordering `OrgLimitAggregate`. */ -export type OrgLimitAggregateOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "RESERVED_ASC" | "RESERVED_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; +export type OrgLimitAggregateOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'RESERVED_ASC' + | 'RESERVED_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; /** Methods to use when ordering `OrgLimitCap`. */ -export type OrgLimitCapOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type OrgLimitCapOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `OrgLimitCapsDefault`. */ -export type OrgLimitCapsDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type OrgLimitCapsDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; /** Methods to use when ordering `OrgLimitCredit`. */ -export type OrgLimitCreditOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; +export type OrgLimitCreditOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; /** Methods to use when ordering `OrgLimitDefault`. */ -export type OrgLimitDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC"; +export type OrgLimitDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC'; /** Methods to use when ordering `OrgLimitEvent`. */ -export type OrgLimitEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DELTA_ASC" | "DELTA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_AT_EVENT_ASC" | "MAX_AT_EVENT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_AFTER_ASC" | "NUM_AFTER_DESC" | "NUM_BEFORE_ASC" | "NUM_BEFORE_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; +export type OrgLimitEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DELTA_ASC' + | 'DELTA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_AT_EVENT_ASC' + | 'MAX_AT_EVENT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_AFTER_ASC' + | 'NUM_AFTER_DESC' + | 'NUM_BEFORE_ASC' + | 'NUM_BEFORE_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; /** Methods to use when ordering `OrgLimit`. */ -export type OrgLimitOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; +export type OrgLimitOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; /** Methods to use when ordering `OrgLimitWarning`. */ -export type OrgLimitWarningOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "THRESHOLD_VALUE_ASC" | "THRESHOLD_VALUE_DESC" | "WARNING_TYPE_ASC" | "WARNING_TYPE_DESC"; +export type OrgLimitWarningOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'THRESHOLD_VALUE_ASC' + | 'THRESHOLD_VALUE_DESC' + | 'WARNING_TYPE_ASC' + | 'WARNING_TYPE_DESC'; /** A filter to be used against `AppLimitCap` object types. All fields are combined with a logical ‘and.’ */ export interface AppLimitCapFilter { /** Checks for all expressions in this list. */ @@ -2311,4 +2661,4 @@ export interface MetaScalarEncoding { kind: string; /** For 'geojson': spatial reference id, else null. */ srid?: number | null; -} \ No newline at end of file +} diff --git a/sdk/constructive-react/src/usage/types.ts b/sdk/constructive-react/src/usage/types.ts index fc8c363b8f..122c65e73d 100644 --- a/sdk/constructive-react/src/usage/types.ts +++ b/sdk/constructive-react/src/usage/types.ts @@ -392,4 +392,4 @@ export interface UUIDListFilter { anyLessThanOrEqualTo?: string; anyGreaterThan?: string; anyGreaterThanOrEqualTo?: string; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/index.ts b/sdk/constructive-sdk/src/admin/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/admin/index.ts +++ b/sdk/constructive-sdk/src/admin/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/admin/orm/client.ts b/sdk/constructive-sdk/src/admin/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/admin/orm/client.ts +++ b/sdk/constructive-sdk/src/admin/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/admin/orm/index.ts b/sdk/constructive-sdk/src/admin/orm/index.ts index 80f72b6711..05c2d70038 100644 --- a/sdk/constructive-sdk/src/admin/orm/index.ts +++ b/sdk/constructive-sdk/src/admin/orm/index.ts @@ -3,43 +3,43 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AppAdminGrantModel } from "./models/appAdminGrant"; -import { AppClaimedInviteModel } from "./models/appClaimedInvite"; -import { AppGrantModel } from "./models/appGrant"; -import { AppInviteModel } from "./models/appInvite"; -import { AppMembershipModel } from "./models/appMembership"; -import { AppMembershipDefaultModel } from "./models/appMembershipDefault"; -import { AppOwnerGrantModel } from "./models/appOwnerGrant"; -import { AppPermissionModel } from "./models/appPermission"; -import { AppPermissionDefaultModel } from "./models/appPermissionDefault"; -import { AppPermissionDefaultGrantModel } from "./models/appPermissionDefaultGrant"; -import { AppPermissionDefaultPermissionModel } from "./models/appPermissionDefaultPermission"; -import { MembershipTypeModel } from "./models/membershipType"; -import { OrgAdminGrantModel } from "./models/orgAdminGrant"; -import { OrgClaimedInviteModel } from "./models/orgClaimedInvite"; -import { OrgGrantModel } from "./models/orgGrant"; -import { OrgInviteModel } from "./models/orgInvite"; -import { OrgMemberModel } from "./models/orgMember"; -import { OrgMemberProfileModel } from "./models/orgMemberProfile"; -import { OrgMembershipModel } from "./models/orgMembership"; -import { OrgMembershipDefaultModel } from "./models/orgMembershipDefault"; -import { OrgMembershipSettingModel } from "./models/orgMembershipSetting"; -import { OrgOwnerGrantModel } from "./models/orgOwnerGrant"; -import { OrgPermissionModel } from "./models/orgPermission"; -import { OrgPermissionDefaultModel } from "./models/orgPermissionDefault"; -import { OrgPermissionDefaultGrantModel } from "./models/orgPermissionDefaultGrant"; -import { OrgPermissionDefaultPermissionModel } from "./models/orgPermissionDefaultPermission"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AppAdminGrantModel } from './models/appAdminGrant'; +import { AppClaimedInviteModel } from './models/appClaimedInvite'; +import { AppGrantModel } from './models/appGrant'; +import { AppInviteModel } from './models/appInvite'; +import { AppMembershipModel } from './models/appMembership'; +import { AppMembershipDefaultModel } from './models/appMembershipDefault'; +import { AppOwnerGrantModel } from './models/appOwnerGrant'; +import { AppPermissionModel } from './models/appPermission'; +import { AppPermissionDefaultModel } from './models/appPermissionDefault'; +import { AppPermissionDefaultGrantModel } from './models/appPermissionDefaultGrant'; +import { AppPermissionDefaultPermissionModel } from './models/appPermissionDefaultPermission'; +import { MembershipTypeModel } from './models/membershipType'; +import { OrgAdminGrantModel } from './models/orgAdminGrant'; +import { OrgClaimedInviteModel } from './models/orgClaimedInvite'; +import { OrgGrantModel } from './models/orgGrant'; +import { OrgInviteModel } from './models/orgInvite'; +import { OrgMemberModel } from './models/orgMember'; +import { OrgMemberProfileModel } from './models/orgMemberProfile'; +import { OrgMembershipModel } from './models/orgMembership'; +import { OrgMembershipDefaultModel } from './models/orgMembershipDefault'; +import { OrgMembershipSettingModel } from './models/orgMembershipSetting'; +import { OrgOwnerGrantModel } from './models/orgOwnerGrant'; +import { OrgPermissionModel } from './models/orgPermission'; +import { OrgPermissionDefaultModel } from './models/orgPermissionDefault'; +import { OrgPermissionDefaultGrantModel } from './models/orgPermissionDefaultGrant'; +import { OrgPermissionDefaultPermissionModel } from './models/orgPermissionDefaultPermission'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -93,6 +93,6 @@ export function createClient(config: OrmClientConfig) { orgPermissionDefaultGrant: new OrgPermissionDefaultGrantModel(client), orgPermissionDefaultPermission: new OrgPermissionDefaultPermissionModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/input-types.ts b/sdk/constructive-sdk/src/admin/orm/input-types.ts index 55d15ac97d..b6b48b9b04 100644 --- a/sdk/constructive-sdk/src/admin/orm/input-types.ts +++ b/sdk/constructive-sdk/src/admin/orm/input-types.ts @@ -702,12 +702,16 @@ export type AppClaimedInviteWithRelations = AppClaimedInvite & AppClaimedInviteR export type AppGrantWithRelations = AppGrant & AppGrantRelations; export type AppInviteWithRelations = AppInvite & AppInviteRelations; export type AppMembershipWithRelations = AppMembership & AppMembershipRelations; -export type AppMembershipDefaultWithRelations = AppMembershipDefault & AppMembershipDefaultRelations; +export type AppMembershipDefaultWithRelations = AppMembershipDefault & + AppMembershipDefaultRelations; export type AppOwnerGrantWithRelations = AppOwnerGrant & AppOwnerGrantRelations; export type AppPermissionWithRelations = AppPermission & AppPermissionRelations; -export type AppPermissionDefaultWithRelations = AppPermissionDefault & AppPermissionDefaultRelations; -export type AppPermissionDefaultGrantWithRelations = AppPermissionDefaultGrant & AppPermissionDefaultGrantRelations; -export type AppPermissionDefaultPermissionWithRelations = AppPermissionDefaultPermission & AppPermissionDefaultPermissionRelations; +export type AppPermissionDefaultWithRelations = AppPermissionDefault & + AppPermissionDefaultRelations; +export type AppPermissionDefaultGrantWithRelations = AppPermissionDefaultGrant & + AppPermissionDefaultGrantRelations; +export type AppPermissionDefaultPermissionWithRelations = AppPermissionDefaultPermission & + AppPermissionDefaultPermissionRelations; export type MembershipTypeWithRelations = MembershipType & MembershipTypeRelations; export type OrgAdminGrantWithRelations = OrgAdminGrant & OrgAdminGrantRelations; export type OrgClaimedInviteWithRelations = OrgClaimedInvite & OrgClaimedInviteRelations; @@ -716,13 +720,18 @@ export type OrgInviteWithRelations = OrgInvite & OrgInviteRelations; export type OrgMemberWithRelations = OrgMember & OrgMemberRelations; export type OrgMemberProfileWithRelations = OrgMemberProfile & OrgMemberProfileRelations; export type OrgMembershipWithRelations = OrgMembership & OrgMembershipRelations; -export type OrgMembershipDefaultWithRelations = OrgMembershipDefault & OrgMembershipDefaultRelations; -export type OrgMembershipSettingWithRelations = OrgMembershipSetting & OrgMembershipSettingRelations; +export type OrgMembershipDefaultWithRelations = OrgMembershipDefault & + OrgMembershipDefaultRelations; +export type OrgMembershipSettingWithRelations = OrgMembershipSetting & + OrgMembershipSettingRelations; export type OrgOwnerGrantWithRelations = OrgOwnerGrant & OrgOwnerGrantRelations; export type OrgPermissionWithRelations = OrgPermission & OrgPermissionRelations; -export type OrgPermissionDefaultWithRelations = OrgPermissionDefault & OrgPermissionDefaultRelations; -export type OrgPermissionDefaultGrantWithRelations = OrgPermissionDefaultGrant & OrgPermissionDefaultGrantRelations; -export type OrgPermissionDefaultPermissionWithRelations = OrgPermissionDefaultPermission & OrgPermissionDefaultPermissionRelations; +export type OrgPermissionDefaultWithRelations = OrgPermissionDefault & + OrgPermissionDefaultRelations; +export type OrgPermissionDefaultGrantWithRelations = OrgPermissionDefaultGrant & + OrgPermissionDefaultGrantRelations; +export type OrgPermissionDefaultPermissionWithRelations = OrgPermissionDefaultPermission & + OrgPermissionDefaultPermissionRelations; // ============ Entity Select Types ============ export type AppAdminGrantSelect = { actorId?: boolean; @@ -1668,32 +1677,524 @@ export interface OrgPermissionDefaultPermissionFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type AppAdminGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppClaimedInviteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppInviteOrderBy = "CHANNEL_ASC" | "CHANNEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_COUNT_ASC" | "INVITE_COUNT_DESC" | "INVITE_LIMIT_ASC" | "INVITE_LIMIT_DESC" | "INVITE_TOKEN_ASC" | "INVITE_TOKEN_DESC" | "INVITE_VALID_ASC" | "INVITE_VALID_DESC" | "MULTIPLE_ASC" | "MULTIPLE_DESC" | "NATURAL" | "PHONE_ASC" | "PHONE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppMembershipOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "GRANTED_ASC" | "GRANTED_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_BANNED_ASC" | "IS_BANNED_DESC" | "IS_DISABLED_ASC" | "IS_DISABLED_DESC" | "IS_OWNER_ASC" | "IS_OWNER_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AppMembershipDefaultOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ID_ASC" | "ID_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AppOwnerGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppPermissionOrderBy = "BITNUM_ASC" | "BITNUM_DESC" | "BITSTR_ASC" | "BITSTR_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppPermissionDefaultOrderBy = "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppPermissionDefaultGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AppPermissionDefaultPermissionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type MembershipTypeOrderBy = "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "HAS_USERS_TABLE_ENTRY_ASC" | "HAS_USERS_TABLE_ENTRY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARENT_MEMBERSHIP_TYPE_ASC" | "PARENT_MEMBERSHIP_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type OrgAdminGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgClaimedInviteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgInviteOrderBy = "CHANNEL_ASC" | "CHANNEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_COUNT_ASC" | "INVITE_COUNT_DESC" | "INVITE_LIMIT_ASC" | "INVITE_LIMIT_DESC" | "INVITE_TOKEN_ASC" | "INVITE_TOKEN_DESC" | "INVITE_VALID_ASC" | "INVITE_VALID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "MULTIPLE_ASC" | "MULTIPLE_DESC" | "NATURAL" | "PHONE_ASC" | "PHONE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "RECEIVER_ID_ASC" | "RECEIVER_ID_DESC" | "SENDER_ID_ASC" | "SENDER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgMemberOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgMemberProfileOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "BIO_ASC" | "BIO_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MEMBERSHIP_ID_ASC" | "MEMBERSHIP_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_PICTURE_ASC" | "PROFILE_PICTURE_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgMembershipOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTED_ASC" | "GRANTED_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ADMIN_ASC" | "IS_ADMIN_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "IS_BANNED_ASC" | "IS_BANNED_DESC" | "IS_DISABLED_ASC" | "IS_DISABLED_DESC" | "IS_EXTERNAL_ASC" | "IS_EXTERNAL_DESC" | "IS_OWNER_ASC" | "IS_OWNER_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_ID_ASC" | "PROFILE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgMembershipDefaultOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_APPROVED_ASC" | "IS_APPROVED_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgMembershipSettingOrderBy = "ALLOW_EXTERNAL_MEMBERS_ASC" | "ALLOW_EXTERNAL_MEMBERS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "CREATE_CHILD_CASCADE_ADMINS_ASC" | "CREATE_CHILD_CASCADE_ADMINS_DESC" | "CREATE_CHILD_CASCADE_MEMBERS_ASC" | "CREATE_CHILD_CASCADE_MEMBERS_DESC" | "CREATE_CHILD_CASCADE_OWNERS_ASC" | "CREATE_CHILD_CASCADE_OWNERS_DESC" | "DELETE_MEMBER_CASCADE_CHILDREN_ASC" | "DELETE_MEMBER_CASCADE_CHILDREN_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVITE_PROFILE_ASSIGNMENT_MODE_ASC" | "INVITE_PROFILE_ASSIGNMENT_MODE_DESC" | "LIMIT_ALLOCATION_MODE_ASC" | "LIMIT_ALLOCATION_MODE_DESC" | "NATURAL" | "POPULATE_MEMBER_EMAIL_ASC" | "POPULATE_MEMBER_EMAIL_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type OrgOwnerGrantOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgPermissionOrderBy = "BITNUM_ASC" | "BITNUM_DESC" | "BITSTR_ASC" | "BITSTR_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgPermissionDefaultOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSIONS_ASC" | "PERMISSIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgPermissionDefaultGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "GRANTOR_ID_ASC" | "GRANTOR_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type OrgPermissionDefaultPermissionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PERMISSION_ID_ASC" | "PERMISSION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AppAdminGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppClaimedInviteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppInviteOrderBy = + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_COUNT_ASC' + | 'INVITE_COUNT_DESC' + | 'INVITE_LIMIT_ASC' + | 'INVITE_LIMIT_DESC' + | 'INVITE_TOKEN_ASC' + | 'INVITE_TOKEN_DESC' + | 'INVITE_VALID_ASC' + | 'INVITE_VALID_DESC' + | 'MULTIPLE_ASC' + | 'MULTIPLE_DESC' + | 'NATURAL' + | 'PHONE_ASC' + | 'PHONE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppMembershipOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'GRANTED_ASC' + | 'GRANTED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_BANNED_ASC' + | 'IS_BANNED_DESC' + | 'IS_DISABLED_ASC' + | 'IS_DISABLED_DESC' + | 'IS_OWNER_ASC' + | 'IS_OWNER_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AppMembershipDefaultOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AppOwnerGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppPermissionOrderBy = + | 'BITNUM_ASC' + | 'BITNUM_DESC' + | 'BITSTR_ASC' + | 'BITSTR_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppPermissionDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppPermissionDefaultGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AppPermissionDefaultPermissionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type MembershipTypeOrderBy = + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'HAS_USERS_TABLE_ENTRY_ASC' + | 'HAS_USERS_TABLE_ENTRY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARENT_MEMBERSHIP_TYPE_ASC' + | 'PARENT_MEMBERSHIP_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type OrgAdminGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgClaimedInviteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgInviteOrderBy = + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_COUNT_ASC' + | 'INVITE_COUNT_DESC' + | 'INVITE_LIMIT_ASC' + | 'INVITE_LIMIT_DESC' + | 'INVITE_TOKEN_ASC' + | 'INVITE_TOKEN_DESC' + | 'INVITE_VALID_ASC' + | 'INVITE_VALID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'MULTIPLE_ASC' + | 'MULTIPLE_DESC' + | 'NATURAL' + | 'PHONE_ASC' + | 'PHONE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'RECEIVER_ID_ASC' + | 'RECEIVER_ID_DESC' + | 'SENDER_ID_ASC' + | 'SENDER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgMemberOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgMemberProfileOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'BIO_ASC' + | 'BIO_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MEMBERSHIP_ID_ASC' + | 'MEMBERSHIP_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_PICTURE_ASC' + | 'PROFILE_PICTURE_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgMembershipOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTED_ASC' + | 'GRANTED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'IS_BANNED_ASC' + | 'IS_BANNED_DESC' + | 'IS_DISABLED_ASC' + | 'IS_DISABLED_DESC' + | 'IS_EXTERNAL_ASC' + | 'IS_EXTERNAL_DESC' + | 'IS_OWNER_ASC' + | 'IS_OWNER_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_ID_ASC' + | 'PROFILE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgMembershipDefaultOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_APPROVED_ASC' + | 'IS_APPROVED_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgMembershipSettingOrderBy = + | 'ALLOW_EXTERNAL_MEMBERS_ASC' + | 'ALLOW_EXTERNAL_MEMBERS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'CREATE_CHILD_CASCADE_ADMINS_ASC' + | 'CREATE_CHILD_CASCADE_ADMINS_DESC' + | 'CREATE_CHILD_CASCADE_MEMBERS_ASC' + | 'CREATE_CHILD_CASCADE_MEMBERS_DESC' + | 'CREATE_CHILD_CASCADE_OWNERS_ASC' + | 'CREATE_CHILD_CASCADE_OWNERS_DESC' + | 'DELETE_MEMBER_CASCADE_CHILDREN_ASC' + | 'DELETE_MEMBER_CASCADE_CHILDREN_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITE_PROFILE_ASSIGNMENT_MODE_ASC' + | 'INVITE_PROFILE_ASSIGNMENT_MODE_DESC' + | 'LIMIT_ALLOCATION_MODE_ASC' + | 'LIMIT_ALLOCATION_MODE_DESC' + | 'NATURAL' + | 'POPULATE_MEMBER_EMAIL_ASC' + | 'POPULATE_MEMBER_EMAIL_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type OrgOwnerGrantOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgPermissionOrderBy = + | 'BITNUM_ASC' + | 'BITNUM_DESC' + | 'BITSTR_ASC' + | 'BITSTR_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgPermissionDefaultOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_ASC' + | 'PERMISSIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgPermissionDefaultGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'GRANTOR_ID_ASC' + | 'GRANTOR_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgPermissionDefaultPermissionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PERMISSION_ID_ASC' + | 'PERMISSION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateAppAdminGrantInput { clientMutationId?: string; @@ -2396,13 +2897,13 @@ export interface DeleteOrgPermissionDefaultPermissionInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "AppPermission": { - "appPermissionDefaultGrantsByPermissionId": "AppPermissionDefaultGrant" + AppPermission: { + appPermissionDefaultGrantsByPermissionId: 'AppPermissionDefaultGrant', + }, + OrgPermission: { + orgPermissionDefaultGrantsByPermissionId: 'OrgPermissionDefaultGrant', + orgPermissionDefaultPermissionsByPermissionId: 'OrgPermissionDefaultPermission', }, - "OrgPermission": { - "orgPermissionDefaultGrantsByPermissionId": "OrgPermissionDefaultGrant", - "orgPermissionDefaultPermissionsByPermissionId": "OrgPermissionDefaultPermission" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -4885,4 +5386,4 @@ export type OrgPermissionDefaultPermissionEdgeSelect = { node?: { select: OrgPermissionDefaultPermissionSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/admin/orm/models/appAdminGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/appAdminGrant.ts index 0c7dffaf81..cc7a22623e 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appAdminGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appAdminGrant.ts @@ -3,56 +3,96 @@ * @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 { AppAdminGrant, AppAdminGrantWithRelations, AppAdminGrantSelect, AppAdminGrantFilter, AppAdminGrantOrderBy, CreateAppAdminGrantInput, UpdateAppAdminGrantInput, AppAdminGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppAdminGrant, + AppAdminGrantWithRelations, + AppAdminGrantSelect, + AppAdminGrantFilter, + AppAdminGrantOrderBy, + CreateAppAdminGrantInput, + UpdateAppAdminGrantInput, + AppAdminGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppAdminGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppAdminGrant", "appAdminGrants", 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 - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppAdminGrant', + 'appAdminGrants', + 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, + }, + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrants", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppAdminGrant", "appAdminGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppAdminGrant', + 'appAdminGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrant", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appAdminGrant": data.appAdminGrants?.nodes?.[0] ?? null - }) + appAdminGrant: data.appAdminGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppAdminGrant", "appAdminGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppAdminGrant', + 'appAdminGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppAdminGrantFilter", "AppAdminGrantOrderBy", connectionFieldsMap); + 'AppAdminGrantFilter', + 'AppAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppAdminGrant", - fieldName: "appAdminGrant", + operation: 'query', + operationName: 'AppAdminGrant', + fieldName: 'appAdminGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appAdminGrant": data.appAdminGrants?.nodes?.[0] ?? null - }) + appAdminGrant: data.appAdminGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppAdminGrant", "createAppAdminGrant", "appAdminGrant", args.select, args.data, "CreateAppAdminGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppAdminGrant', + 'createAppAdminGrant', + 'appAdminGrant', + args.select, + args.data, + 'CreateAppAdminGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "createAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'createAppAdminGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppAdminGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppAdminGrant", "updateAppAdminGrant", "appAdminGrant", args.select, args.where.id, args.data, "UpdateAppAdminGrantInput", "id", "appAdminGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppAdminGrant', + 'updateAppAdminGrant', + 'appAdminGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppAdminGrantInput', + 'id', + 'appAdminGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "updateAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'updateAppAdminGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppAdminGrant: { appAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppAdminGrant", "deleteAppAdminGrant", "appAdminGrant", { - id: args.where.id - }, "DeleteAppAdminGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppAdminGrant', + 'deleteAppAdminGrant', + 'appAdminGrant', + { + id: args.where.id, + }, + 'DeleteAppAdminGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppAdminGrant", - fieldName: "deleteAppAdminGrant", + operation: 'mutation', + operationName: 'AppAdminGrant', + fieldName: 'deleteAppAdminGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appClaimedInvite.ts b/sdk/constructive-sdk/src/admin/orm/models/appClaimedInvite.ts index 66e752f4b1..598f1b15af 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appClaimedInvite.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appClaimedInvite.ts @@ -3,56 +3,96 @@ * @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 { AppClaimedInvite, AppClaimedInviteWithRelations, AppClaimedInviteSelect, AppClaimedInviteFilter, AppClaimedInviteOrderBy, CreateAppClaimedInviteInput, UpdateAppClaimedInviteInput, AppClaimedInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppClaimedInvite, + AppClaimedInviteWithRelations, + AppClaimedInviteSelect, + AppClaimedInviteFilter, + AppClaimedInviteOrderBy, + CreateAppClaimedInviteInput, + UpdateAppClaimedInviteInput, + AppClaimedInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppClaimedInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppClaimedInvite", "appClaimedInvites", 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 - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + 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, + }, + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvites", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppClaimedInvite", "appClaimedInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvite", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appClaimedInvite": data.appClaimedInvites?.nodes?.[0] ?? null - }) + appClaimedInvite: data.appClaimedInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppClaimedInvite", "appClaimedInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppClaimedInvite', + 'appClaimedInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppClaimedInviteFilter", "AppClaimedInviteOrderBy", connectionFieldsMap); + 'AppClaimedInviteFilter', + 'AppClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppClaimedInvite", - fieldName: "appClaimedInvite", + operation: 'query', + operationName: 'AppClaimedInvite', + fieldName: 'appClaimedInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appClaimedInvite": data.appClaimedInvites?.nodes?.[0] ?? null - }) + appClaimedInvite: data.appClaimedInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppClaimedInvite", "createAppClaimedInvite", "appClaimedInvite", args.select, args.data, "CreateAppClaimedInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppClaimedInvite', + 'createAppClaimedInvite', + 'appClaimedInvite', + args.select, + args.data, + 'CreateAppClaimedInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "createAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'createAppClaimedInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppClaimedInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppClaimedInvite", "updateAppClaimedInvite", "appClaimedInvite", args.select, args.where.id, args.data, "UpdateAppClaimedInviteInput", "id", "appClaimedInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppClaimedInvite', + 'updateAppClaimedInvite', + 'appClaimedInvite', + args.select, + args.where.id, + args.data, + 'UpdateAppClaimedInviteInput', + 'id', + 'appClaimedInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "updateAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'updateAppClaimedInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppClaimedInvite: { appClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppClaimedInvite", "deleteAppClaimedInvite", "appClaimedInvite", { - id: args.where.id - }, "DeleteAppClaimedInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppClaimedInvite', + 'deleteAppClaimedInvite', + 'appClaimedInvite', + { + id: args.where.id, + }, + 'DeleteAppClaimedInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppClaimedInvite", - fieldName: "deleteAppClaimedInvite", + operation: 'mutation', + operationName: 'AppClaimedInvite', + fieldName: 'deleteAppClaimedInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/appGrant.ts index 13823f924b..d773ff6de1 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appGrant.ts @@ -3,56 +3,96 @@ * @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 { AppGrant, AppGrantWithRelations, AppGrantSelect, AppGrantFilter, AppGrantOrderBy, CreateAppGrantInput, UpdateAppGrantInput, AppGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppGrant, + AppGrantWithRelations, + AppGrantSelect, + AppGrantFilter, + AppGrantOrderBy, + CreateAppGrantInput, + UpdateAppGrantInput, + AppGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppGrant", "appGrants", 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 - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppGrant', + 'appGrants', + 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, + }, + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrants", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppGrant", "appGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppGrant', + 'appGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrant", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appGrant": data.appGrants?.nodes?.[0] ?? null - }) + appGrant: data.appGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppGrant", "appGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppGrant', + 'appGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppGrantFilter", "AppGrantOrderBy", connectionFieldsMap); + 'AppGrantFilter', + 'AppGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppGrant", - fieldName: "appGrant", + operation: 'query', + operationName: 'AppGrant', + fieldName: 'appGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appGrant": data.appGrants?.nodes?.[0] ?? null - }) + appGrant: data.appGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppGrant", "createAppGrant", "appGrant", args.select, args.data, "CreateAppGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppGrant', + 'createAppGrant', + 'appGrant', + args.select, + args.data, + 'CreateAppGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "createAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'createAppGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppGrant", "updateAppGrant", "appGrant", args.select, args.where.id, args.data, "UpdateAppGrantInput", "id", "appGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppGrant', + 'updateAppGrant', + 'appGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppGrantInput', + 'id', + 'appGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "updateAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'updateAppGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppGrant: { appGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppGrant", "deleteAppGrant", "appGrant", { - id: args.where.id - }, "DeleteAppGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppGrant', + 'deleteAppGrant', + 'appGrant', + { + id: args.where.id, + }, + 'DeleteAppGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppGrant", - fieldName: "deleteAppGrant", + operation: 'mutation', + operationName: 'AppGrant', + fieldName: 'deleteAppGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appInvite.ts b/sdk/constructive-sdk/src/admin/orm/models/appInvite.ts index 7320a2028b..3350bba65b 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appInvite.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appInvite.ts @@ -3,56 +3,96 @@ * @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 { AppInvite, AppInviteWithRelations, AppInviteSelect, AppInviteFilter, AppInviteOrderBy, CreateAppInviteInput, UpdateAppInviteInput, AppInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppInvite, + AppInviteWithRelations, + AppInviteSelect, + AppInviteFilter, + AppInviteOrderBy, + CreateAppInviteInput, + UpdateAppInviteInput, + AppInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppInvite", "appInvites", 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 - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppInvite', + 'appInvites', + 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, + }, + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvites", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppInvite", "appInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppInvite', + 'appInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvite", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appInvite": data.appInvites?.nodes?.[0] ?? null - }) + appInvite: data.appInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppInvite", "appInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppInvite', + 'appInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppInviteFilter", "AppInviteOrderBy", connectionFieldsMap); + 'AppInviteFilter', + 'AppInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppInvite", - fieldName: "appInvite", + operation: 'query', + operationName: 'AppInvite', + fieldName: 'appInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "appInvite": data.appInvites?.nodes?.[0] ?? null - }) + appInvite: data.appInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppInvite", "createAppInvite", "appInvite", args.select, args.data, "CreateAppInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppInvite', + 'createAppInvite', + 'appInvite', + args.select, + args.data, + 'CreateAppInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "createAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'createAppInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppInvite", "updateAppInvite", "appInvite", args.select, args.where.id, args.data, "UpdateAppInviteInput", "id", "appInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppInvite', + 'updateAppInvite', + 'appInvite', + args.select, + args.where.id, + args.data, + 'UpdateAppInviteInput', + 'id', + 'appInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "updateAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'updateAppInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppInvite: { appInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppInvite", "deleteAppInvite", "appInvite", { - id: args.where.id - }, "DeleteAppInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppInvite', + 'deleteAppInvite', + 'appInvite', + { + id: args.where.id, + }, + 'DeleteAppInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppInvite", - fieldName: "deleteAppInvite", + operation: 'mutation', + operationName: 'AppInvite', + fieldName: 'deleteAppInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appMembership.ts b/sdk/constructive-sdk/src/admin/orm/models/appMembership.ts index 6732a31125..1faa691016 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appMembership.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appMembership.ts @@ -3,56 +3,96 @@ * @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 { AppMembership, AppMembershipWithRelations, AppMembershipSelect, AppMembershipFilter, AppMembershipOrderBy, CreateAppMembershipInput, UpdateAppMembershipInput, AppMembershipPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppMembership, + AppMembershipWithRelations, + AppMembershipSelect, + AppMembershipFilter, + AppMembershipOrderBy, + CreateAppMembershipInput, + UpdateAppMembershipInput, + AppMembershipPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppMembershipModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMemberships: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembership", "appMemberships", 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 - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppMembership', + 'appMemberships', + 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, + }, + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMemberships", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMemberships', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppMembership", "appMemberships", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppMembership', + 'appMemberships', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMembership", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMembership', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembership": data.appMemberships?.nodes?.[0] ?? null - }) + appMembership: data.appMemberships?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembership", "appMemberships", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppMembership', + 'appMemberships', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppMembershipFilter", "AppMembershipOrderBy", connectionFieldsMap); + 'AppMembershipFilter', + 'AppMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembership", - fieldName: "appMembership", + operation: 'query', + operationName: 'AppMembership', + fieldName: 'appMembership', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembership": data.appMemberships?.nodes?.[0] ?? null - }) + appMembership: data.appMemberships?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppMembership", "createAppMembership", "appMembership", args.select, args.data, "CreateAppMembershipInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppMembership', + 'createAppMembership', + 'appMembership', + args.select, + args.data, + 'CreateAppMembershipInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "createAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'createAppMembership', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppMembershipPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppMembership", "updateAppMembership", "appMembership", args.select, args.where.id, args.data, "UpdateAppMembershipInput", "id", "appMembershipPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppMembership', + 'updateAppMembership', + 'appMembership', + args.select, + args.where.id, + args.data, + 'UpdateAppMembershipInput', + 'id', + 'appMembershipPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "updateAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'updateAppMembership', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppMembership: { appMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppMembership", "deleteAppMembership", "appMembership", { - id: args.where.id - }, "DeleteAppMembershipInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppMembership', + 'deleteAppMembership', + 'appMembership', + { + id: args.where.id, + }, + 'DeleteAppMembershipInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembership", - fieldName: "deleteAppMembership", + operation: 'mutation', + operationName: 'AppMembership', + fieldName: 'deleteAppMembership', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appMembershipDefault.ts b/sdk/constructive-sdk/src/admin/orm/models/appMembershipDefault.ts index bfd6c3ee6e..efc0ab28ee 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appMembershipDefault.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appMembershipDefault.ts @@ -3,56 +3,98 @@ * @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 { AppMembershipDefault, AppMembershipDefaultWithRelations, AppMembershipDefaultSelect, AppMembershipDefaultFilter, AppMembershipDefaultOrderBy, CreateAppMembershipDefaultInput, UpdateAppMembershipDefaultInput, AppMembershipDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppMembershipDefault, + AppMembershipDefaultWithRelations, + AppMembershipDefaultSelect, + AppMembershipDefaultFilter, + AppMembershipDefaultOrderBy, + CreateAppMembershipDefaultInput, + UpdateAppMembershipDefaultInput, + AppMembershipDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppMembershipDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appMembershipDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appMembershipDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembershipDefault", "appMembershipDefaults", 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 - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + 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, + }, + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefaults", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppMembershipDefault", "appMembershipDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefault", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembershipDefault": data.appMembershipDefaults?.nodes?.[0] ?? null - }) + appMembershipDefault: data.appMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppMembershipDefault", "appMembershipDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppMembershipDefault', + 'appMembershipDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppMembershipDefaultFilter", "AppMembershipDefaultOrderBy", connectionFieldsMap); + 'AppMembershipDefaultFilter', + 'AppMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppMembershipDefault", - fieldName: "appMembershipDefault", + operation: 'query', + operationName: 'AppMembershipDefault', + fieldName: 'appMembershipDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appMembershipDefault": data.appMembershipDefaults?.nodes?.[0] ?? null - }) + appMembershipDefault: data.appMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppMembershipDefault", "createAppMembershipDefault", "appMembershipDefault", args.select, args.data, "CreateAppMembershipDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppMembershipDefault', + 'createAppMembershipDefault', + 'appMembershipDefault', + args.select, + args.data, + 'CreateAppMembershipDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "createAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'createAppMembershipDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppMembershipDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppMembershipDefault", "updateAppMembershipDefault", "appMembershipDefault", args.select, args.where.id, args.data, "UpdateAppMembershipDefaultInput", "id", "appMembershipDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppMembershipDefault', + 'updateAppMembershipDefault', + 'appMembershipDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppMembershipDefaultInput', + 'id', + 'appMembershipDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "updateAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'updateAppMembershipDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppMembershipDefault: { appMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppMembershipDefault", "deleteAppMembershipDefault", "appMembershipDefault", { - id: args.where.id - }, "DeleteAppMembershipDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppMembershipDefault', + 'deleteAppMembershipDefault', + 'appMembershipDefault', + { + id: args.where.id, + }, + 'DeleteAppMembershipDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppMembershipDefault", - fieldName: "deleteAppMembershipDefault", + operation: 'mutation', + operationName: 'AppMembershipDefault', + fieldName: 'deleteAppMembershipDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appOwnerGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/appOwnerGrant.ts index 8709dd4496..28f7d92d12 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appOwnerGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appOwnerGrant.ts @@ -3,56 +3,96 @@ * @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 { AppOwnerGrant, AppOwnerGrantWithRelations, AppOwnerGrantSelect, AppOwnerGrantFilter, AppOwnerGrantOrderBy, CreateAppOwnerGrantInput, UpdateAppOwnerGrantInput, AppOwnerGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppOwnerGrant, + AppOwnerGrantWithRelations, + AppOwnerGrantSelect, + AppOwnerGrantFilter, + AppOwnerGrantOrderBy, + CreateAppOwnerGrantInput, + UpdateAppOwnerGrantInput, + AppOwnerGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppOwnerGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppOwnerGrant", "appOwnerGrants", 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 - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + 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, + }, + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrants", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppOwnerGrant", "appOwnerGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrant", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appOwnerGrant": data.appOwnerGrants?.nodes?.[0] ?? null - }) + appOwnerGrant: data.appOwnerGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppOwnerGrant", "appOwnerGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppOwnerGrant', + 'appOwnerGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppOwnerGrantFilter", "AppOwnerGrantOrderBy", connectionFieldsMap); + 'AppOwnerGrantFilter', + 'AppOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppOwnerGrant", - fieldName: "appOwnerGrant", + operation: 'query', + operationName: 'AppOwnerGrant', + fieldName: 'appOwnerGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appOwnerGrant": data.appOwnerGrants?.nodes?.[0] ?? null - }) + appOwnerGrant: data.appOwnerGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppOwnerGrant", "createAppOwnerGrant", "appOwnerGrant", args.select, args.data, "CreateAppOwnerGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppOwnerGrant', + 'createAppOwnerGrant', + 'appOwnerGrant', + args.select, + args.data, + 'CreateAppOwnerGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "createAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'createAppOwnerGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppOwnerGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppOwnerGrant", "updateAppOwnerGrant", "appOwnerGrant", args.select, args.where.id, args.data, "UpdateAppOwnerGrantInput", "id", "appOwnerGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppOwnerGrant', + 'updateAppOwnerGrant', + 'appOwnerGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppOwnerGrantInput', + 'id', + 'appOwnerGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "updateAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'updateAppOwnerGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppOwnerGrant: { appOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppOwnerGrant", "deleteAppOwnerGrant", "appOwnerGrant", { - id: args.where.id - }, "DeleteAppOwnerGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppOwnerGrant', + 'deleteAppOwnerGrant', + 'appOwnerGrant', + { + id: args.where.id, + }, + 'DeleteAppOwnerGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppOwnerGrant", - fieldName: "deleteAppOwnerGrant", + operation: 'mutation', + operationName: 'AppOwnerGrant', + fieldName: 'deleteAppOwnerGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appPermission.ts b/sdk/constructive-sdk/src/admin/orm/models/appPermission.ts index ebfaf30147..efa4812398 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appPermission.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appPermission.ts @@ -3,56 +3,96 @@ * @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 { AppPermission, AppPermissionWithRelations, AppPermissionSelect, AppPermissionFilter, AppPermissionOrderBy, CreateAppPermissionInput, UpdateAppPermissionInput, AppPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermission, + AppPermissionWithRelations, + AppPermissionSelect, + AppPermissionFilter, + AppPermissionOrderBy, + CreateAppPermissionInput, + UpdateAppPermissionInput, + AppPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermission", "appPermissions", 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 - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermission', + 'appPermissions', + 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, + }, + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermissions", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermission", "appPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermission', + 'appPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermission", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermission', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermission": data.appPermissions?.nodes?.[0] ?? null - }) + appPermission: data.appPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermission", "appPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermission', + 'appPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionFilter", "AppPermissionOrderBy", connectionFieldsMap); + 'AppPermissionFilter', + 'AppPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermission", - fieldName: "appPermission", + operation: 'query', + operationName: 'AppPermission', + fieldName: 'appPermission', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermission": data.appPermissions?.nodes?.[0] ?? null - }) + appPermission: data.appPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermission", "createAppPermission", "appPermission", args.select, args.data, "CreateAppPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermission', + 'createAppPermission', + 'appPermission', + args.select, + args.data, + 'CreateAppPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "createAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'createAppPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermission", "updateAppPermission", "appPermission", args.select, args.where.id, args.data, "UpdateAppPermissionInput", "id", "appPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermission', + 'updateAppPermission', + 'appPermission', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionInput', + 'id', + 'appPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "updateAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'updateAppPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermission: { appPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermission", "deleteAppPermission", "appPermission", { - id: args.where.id - }, "DeleteAppPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermission', + 'deleteAppPermission', + 'appPermission', + { + id: args.where.id, + }, + 'DeleteAppPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermission", - fieldName: "deleteAppPermission", + operation: 'mutation', + operationName: 'AppPermission', + fieldName: 'deleteAppPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefault.ts b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefault.ts index 682c13a467..c967364f31 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefault.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefault.ts @@ -3,56 +3,98 @@ * @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 { AppPermissionDefault, AppPermissionDefaultWithRelations, AppPermissionDefaultSelect, AppPermissionDefaultFilter, AppPermissionDefaultOrderBy, CreateAppPermissionDefaultInput, UpdateAppPermissionDefaultInput, AppPermissionDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefault, + AppPermissionDefaultWithRelations, + AppPermissionDefaultSelect, + AppPermissionDefaultFilter, + AppPermissionDefaultOrderBy, + CreateAppPermissionDefaultInput, + UpdateAppPermissionDefaultInput, + AppPermissionDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefault", "appPermissionDefaults", 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 - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + 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, + }, + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefaults", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefault", "appPermissionDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefault", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefault": data.appPermissionDefaults?.nodes?.[0] ?? null - }) + appPermissionDefault: data.appPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefault", "appPermissionDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefault', + 'appPermissionDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultFilter", "AppPermissionDefaultOrderBy", connectionFieldsMap); + 'AppPermissionDefaultFilter', + 'AppPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefault", - fieldName: "appPermissionDefault", + operation: 'query', + operationName: 'AppPermissionDefault', + fieldName: 'appPermissionDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefault": data.appPermissionDefaults?.nodes?.[0] ?? null - }) + appPermissionDefault: data.appPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefault", "createAppPermissionDefault", "appPermissionDefault", args.select, args.data, "CreateAppPermissionDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefault', + 'createAppPermissionDefault', + 'appPermissionDefault', + args.select, + args.data, + 'CreateAppPermissionDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "createAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'createAppPermissionDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefault", "updateAppPermissionDefault", "appPermissionDefault", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultInput", "id", "appPermissionDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefault', + 'updateAppPermissionDefault', + 'appPermissionDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultInput', + 'id', + 'appPermissionDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "updateAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'updateAppPermissionDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefault: { appPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefault", "deleteAppPermissionDefault", "appPermissionDefault", { - id: args.where.id - }, "DeleteAppPermissionDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefault', + 'deleteAppPermissionDefault', + 'appPermissionDefault', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefault", - fieldName: "deleteAppPermissionDefault", + operation: 'mutation', + operationName: 'AppPermissionDefault', + fieldName: 'deleteAppPermissionDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultGrant.ts index a04d3770ba..b6a3b10748 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultGrant.ts @@ -3,56 +3,98 @@ * @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 { AppPermissionDefaultGrant, AppPermissionDefaultGrantWithRelations, AppPermissionDefaultGrantSelect, AppPermissionDefaultGrantFilter, AppPermissionDefaultGrantOrderBy, CreateAppPermissionDefaultGrantInput, UpdateAppPermissionDefaultGrantInput, AppPermissionDefaultGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefaultGrant, + AppPermissionDefaultGrantWithRelations, + AppPermissionDefaultGrantSelect, + AppPermissionDefaultGrantFilter, + AppPermissionDefaultGrantOrderBy, + CreateAppPermissionDefaultGrantInput, + UpdateAppPermissionDefaultGrantInput, + AppPermissionDefaultGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultGrants: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", 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 - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + 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, + }, + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrants", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrant", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrant', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultGrant": data.appPermissionDefaultGrants?.nodes?.[0] ?? null - }) + appPermissionDefaultGrant: data.appPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultGrant", "appPermissionDefaultGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultGrant', + 'appPermissionDefaultGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultGrantFilter", "AppPermissionDefaultGrantOrderBy", connectionFieldsMap); + 'AppPermissionDefaultGrantFilter', + 'AppPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultGrant", - fieldName: "appPermissionDefaultGrant", + operation: 'query', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'appPermissionDefaultGrant', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultGrant": data.appPermissionDefaultGrants?.nodes?.[0] ?? null - }) + appPermissionDefaultGrant: data.appPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefaultGrant", "createAppPermissionDefaultGrant", "appPermissionDefaultGrant", args.select, args.data, "CreateAppPermissionDefaultGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefaultGrant', + 'createAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + args.select, + args.data, + 'CreateAppPermissionDefaultGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "createAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'createAppPermissionDefaultGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefaultGrant", "updateAppPermissionDefaultGrant", "appPermissionDefaultGrant", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultGrantInput", "id", "appPermissionDefaultGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefaultGrant', + 'updateAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultGrantInput', + 'id', + 'appPermissionDefaultGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "updateAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'updateAppPermissionDefaultGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefaultGrant: { appPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefaultGrant", "deleteAppPermissionDefaultGrant", "appPermissionDefaultGrant", { - id: args.where.id - }, "DeleteAppPermissionDefaultGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefaultGrant', + 'deleteAppPermissionDefaultGrant', + 'appPermissionDefaultGrant', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultGrant", - fieldName: "deleteAppPermissionDefaultGrant", + operation: 'mutation', + operationName: 'AppPermissionDefaultGrant', + fieldName: 'deleteAppPermissionDefaultGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultPermission.ts b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultPermission.ts index 15217af996..6e47d9eeec 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultPermission.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultPermission.ts @@ -3,56 +3,109 @@ * @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 { AppPermissionDefaultPermission, AppPermissionDefaultPermissionWithRelations, AppPermissionDefaultPermissionSelect, AppPermissionDefaultPermissionFilter, AppPermissionDefaultPermissionOrderBy, CreateAppPermissionDefaultPermissionInput, UpdateAppPermissionDefaultPermissionInput, AppPermissionDefaultPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppPermissionDefaultPermission, + AppPermissionDefaultPermissionWithRelations, + AppPermissionDefaultPermissionSelect, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy, + CreateAppPermissionDefaultPermissionInput, + UpdateAppPermissionDefaultPermissionInput, + AppPermissionDefaultPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppPermissionDefaultPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermissions: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", 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 - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + 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, + }, + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermissions", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermission: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + AppPermissionDefaultPermissionFilter, + AppPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermission", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermission', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class AppPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultPermission": data.appPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + appPermissionDefaultPermission: data.appPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - appPermissionDefaultPermission: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppPermissionDefaultPermission", "appPermissionDefaultPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppPermissionDefaultPermission', + 'appPermissionDefaultPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppPermissionDefaultPermissionFilter", "AppPermissionDefaultPermissionOrderBy", connectionFieldsMap); + 'AppPermissionDefaultPermissionFilter', + 'AppPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppPermissionDefaultPermission", - fieldName: "appPermissionDefaultPermission", + operation: 'query', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'appPermissionDefaultPermission', document, variables, transform: (data: { @@ -93,74 +156,118 @@ export class AppPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appPermissionDefaultPermission": data.appPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + appPermissionDefaultPermission: data.appPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateAppPermissionDefaultPermissionInput['appPermissionDefaultPermission'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("AppPermissionDefaultPermission", "createAppPermissionDefaultPermission", "appPermissionDefaultPermission", args.select, args.data, "CreateAppPermissionDefaultPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppPermissionDefaultPermission', + 'createAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + args.select, + args.data, + 'CreateAppPermissionDefaultPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "createAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'createAppPermissionDefaultPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppPermissionDefaultPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppPermissionDefaultPermission", "updateAppPermissionDefaultPermission", "appPermissionDefaultPermission", args.select, args.where.id, args.data, "UpdateAppPermissionDefaultPermissionInput", "id", "appPermissionDefaultPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppPermissionDefaultPermission', + 'updateAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + args.select, + args.where.id, + args.data, + 'UpdateAppPermissionDefaultPermissionInput', + 'id', + 'appPermissionDefaultPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "updateAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'updateAppPermissionDefaultPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppPermissionDefaultPermission: { - appPermissionDefaultPermission: InferSelectResult; + appPermissionDefaultPermission: InferSelectResult< + AppPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppPermissionDefaultPermission", "deleteAppPermissionDefaultPermission", "appPermissionDefaultPermission", { - id: args.where.id - }, "DeleteAppPermissionDefaultPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppPermissionDefaultPermission', + 'deleteAppPermissionDefaultPermission', + 'appPermissionDefaultPermission', + { + id: args.where.id, + }, + 'DeleteAppPermissionDefaultPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppPermissionDefaultPermission", - fieldName: "deleteAppPermissionDefaultPermission", + operation: 'mutation', + operationName: 'AppPermissionDefaultPermission', + fieldName: 'deleteAppPermissionDefaultPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/index.ts b/sdk/constructive-sdk/src/admin/orm/models/index.ts index ba6cc4f424..0cac178e48 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/index.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/index.ts @@ -3,29 +3,29 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AppAdminGrantModel } from "./appAdminGrant"; -export { AppClaimedInviteModel } from "./appClaimedInvite"; -export { AppGrantModel } from "./appGrant"; -export { AppInviteModel } from "./appInvite"; -export { AppMembershipModel } from "./appMembership"; -export { AppMembershipDefaultModel } from "./appMembershipDefault"; -export { AppOwnerGrantModel } from "./appOwnerGrant"; -export { AppPermissionModel } from "./appPermission"; -export { AppPermissionDefaultModel } from "./appPermissionDefault"; -export { AppPermissionDefaultGrantModel } from "./appPermissionDefaultGrant"; -export { AppPermissionDefaultPermissionModel } from "./appPermissionDefaultPermission"; -export { MembershipTypeModel } from "./membershipType"; -export { OrgAdminGrantModel } from "./orgAdminGrant"; -export { OrgClaimedInviteModel } from "./orgClaimedInvite"; -export { OrgGrantModel } from "./orgGrant"; -export { OrgInviteModel } from "./orgInvite"; -export { OrgMemberModel } from "./orgMember"; -export { OrgMemberProfileModel } from "./orgMemberProfile"; -export { OrgMembershipModel } from "./orgMembership"; -export { OrgMembershipDefaultModel } from "./orgMembershipDefault"; -export { OrgMembershipSettingModel } from "./orgMembershipSetting"; -export { OrgOwnerGrantModel } from "./orgOwnerGrant"; -export { OrgPermissionModel } from "./orgPermission"; -export { OrgPermissionDefaultModel } from "./orgPermissionDefault"; -export { OrgPermissionDefaultGrantModel } from "./orgPermissionDefaultGrant"; -export { OrgPermissionDefaultPermissionModel } from "./orgPermissionDefaultPermission"; \ No newline at end of file +export { AppAdminGrantModel } from './appAdminGrant'; +export { AppClaimedInviteModel } from './appClaimedInvite'; +export { AppGrantModel } from './appGrant'; +export { AppInviteModel } from './appInvite'; +export { AppMembershipModel } from './appMembership'; +export { AppMembershipDefaultModel } from './appMembershipDefault'; +export { AppOwnerGrantModel } from './appOwnerGrant'; +export { AppPermissionModel } from './appPermission'; +export { AppPermissionDefaultModel } from './appPermissionDefault'; +export { AppPermissionDefaultGrantModel } from './appPermissionDefaultGrant'; +export { AppPermissionDefaultPermissionModel } from './appPermissionDefaultPermission'; +export { MembershipTypeModel } from './membershipType'; +export { OrgAdminGrantModel } from './orgAdminGrant'; +export { OrgClaimedInviteModel } from './orgClaimedInvite'; +export { OrgGrantModel } from './orgGrant'; +export { OrgInviteModel } from './orgInvite'; +export { OrgMemberModel } from './orgMember'; +export { OrgMemberProfileModel } from './orgMemberProfile'; +export { OrgMembershipModel } from './orgMembership'; +export { OrgMembershipDefaultModel } from './orgMembershipDefault'; +export { OrgMembershipSettingModel } from './orgMembershipSetting'; +export { OrgOwnerGrantModel } from './orgOwnerGrant'; +export { OrgPermissionModel } from './orgPermission'; +export { OrgPermissionDefaultModel } from './orgPermissionDefault'; +export { OrgPermissionDefaultGrantModel } from './orgPermissionDefaultGrant'; +export { OrgPermissionDefaultPermissionModel } from './orgPermissionDefaultPermission'; diff --git a/sdk/constructive-sdk/src/admin/orm/models/membershipType.ts b/sdk/constructive-sdk/src/admin/orm/models/membershipType.ts index e99dd207df..1ab7c15781 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/membershipType.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/membershipType.ts @@ -3,56 +3,96 @@ * @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 { MembershipType, MembershipTypeWithRelations, MembershipTypeSelect, MembershipTypeFilter, MembershipTypeOrderBy, CreateMembershipTypeInput, UpdateMembershipTypeInput, MembershipTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipType, + MembershipTypeWithRelations, + MembershipTypeSelect, + MembershipTypeFilter, + MembershipTypeOrderBy, + CreateMembershipTypeInput, + UpdateMembershipTypeInput, + MembershipTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipType", "membershipTypes", 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 - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipType', + 'membershipTypes', + 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, + }, + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipTypes", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipType", "membershipTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipType', + 'membershipTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipType", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MembershipTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipType": data.membershipTypes?.nodes?.[0] ?? null - }) + membershipType: data.membershipTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipType", "membershipTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipType', + 'membershipTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipTypeFilter", "MembershipTypeOrderBy", connectionFieldsMap); + 'MembershipTypeFilter', + 'MembershipTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipType", - fieldName: "membershipType", + operation: 'query', + operationName: 'MembershipType', + fieldName: 'membershipType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MembershipTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipType": data.membershipTypes?.nodes?.[0] ?? null - }) + membershipType: data.membershipTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipType", "createMembershipType", "membershipType", args.select, args.data, "CreateMembershipTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipType', + 'createMembershipType', + 'membershipType', + args.select, + args.data, + 'CreateMembershipTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "createMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'createMembershipType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: number; + }, + MembershipTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipType", "updateMembershipType", "membershipType", args.select, args.where.id, args.data, "UpdateMembershipTypeInput", "id", "membershipTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipType', + 'updateMembershipType', + 'membershipType', + args.select, + args.where.id, + args.data, + 'UpdateMembershipTypeInput', + 'id', + 'membershipTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "updateMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'updateMembershipType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: number; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: number; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipType: { membershipType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipType", "deleteMembershipType", "membershipType", { - id: args.where.id - }, "DeleteMembershipTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipType', + 'deleteMembershipType', + 'membershipType', + { + id: args.where.id, + }, + 'DeleteMembershipTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipType", - fieldName: "deleteMembershipType", + operation: 'mutation', + operationName: 'MembershipType', + fieldName: 'deleteMembershipType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgAdminGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgAdminGrant.ts index 2bd28d708d..9ef902aaa8 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgAdminGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgAdminGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgAdminGrant, OrgAdminGrantWithRelations, OrgAdminGrantSelect, OrgAdminGrantFilter, OrgAdminGrantOrderBy, CreateOrgAdminGrantInput, UpdateOrgAdminGrantInput, OrgAdminGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgAdminGrant, + OrgAdminGrantWithRelations, + OrgAdminGrantSelect, + OrgAdminGrantFilter, + OrgAdminGrantOrderBy, + CreateOrgAdminGrantInput, + UpdateOrgAdminGrantInput, + OrgAdminGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgAdminGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgAdminGrant", "orgAdminGrants", 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 - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + 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, + }, + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrants", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgAdminGrant", "orgAdminGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrant", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgAdminGrant": data.orgAdminGrants?.nodes?.[0] ?? null - }) + orgAdminGrant: data.orgAdminGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgAdminGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgAdminGrant", "orgAdminGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgAdminGrant', + 'orgAdminGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgAdminGrantFilter", "OrgAdminGrantOrderBy", connectionFieldsMap); + 'OrgAdminGrantFilter', + 'OrgAdminGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgAdminGrant", - fieldName: "orgAdminGrant", + operation: 'query', + operationName: 'OrgAdminGrant', + fieldName: 'orgAdminGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgAdminGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgAdminGrant": data.orgAdminGrants?.nodes?.[0] ?? null - }) + orgAdminGrant: data.orgAdminGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgAdminGrant", "createOrgAdminGrant", "orgAdminGrant", args.select, args.data, "CreateOrgAdminGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgAdminGrant', + 'createOrgAdminGrant', + 'orgAdminGrant', + args.select, + args.data, + 'CreateOrgAdminGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "createOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'createOrgAdminGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgAdminGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgAdminGrant", "updateOrgAdminGrant", "orgAdminGrant", args.select, args.where.id, args.data, "UpdateOrgAdminGrantInput", "id", "orgAdminGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgAdminGrant', + 'updateOrgAdminGrant', + 'orgAdminGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgAdminGrantInput', + 'id', + 'orgAdminGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "updateOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'updateOrgAdminGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgAdminGrant: { orgAdminGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgAdminGrant", "deleteOrgAdminGrant", "orgAdminGrant", { - id: args.where.id - }, "DeleteOrgAdminGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgAdminGrant', + 'deleteOrgAdminGrant', + 'orgAdminGrant', + { + id: args.where.id, + }, + 'DeleteOrgAdminGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgAdminGrant", - fieldName: "deleteOrgAdminGrant", + operation: 'mutation', + operationName: 'OrgAdminGrant', + fieldName: 'deleteOrgAdminGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgClaimedInvite.ts b/sdk/constructive-sdk/src/admin/orm/models/orgClaimedInvite.ts index 3e5e549cb0..82b31bb474 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgClaimedInvite.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgClaimedInvite.ts @@ -3,56 +3,96 @@ * @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 { OrgClaimedInvite, OrgClaimedInviteWithRelations, OrgClaimedInviteSelect, OrgClaimedInviteFilter, OrgClaimedInviteOrderBy, CreateOrgClaimedInviteInput, UpdateOrgClaimedInviteInput, OrgClaimedInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgClaimedInvite, + OrgClaimedInviteWithRelations, + OrgClaimedInviteSelect, + OrgClaimedInviteFilter, + OrgClaimedInviteOrderBy, + CreateOrgClaimedInviteInput, + UpdateOrgClaimedInviteInput, + OrgClaimedInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgClaimedInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgClaimedInvite", "orgClaimedInvites", 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 - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + 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, + }, + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvites", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgClaimedInvite", "orgClaimedInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvite", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgClaimedInvite": data.orgClaimedInvites?.nodes?.[0] ?? null - }) + orgClaimedInvite: data.orgClaimedInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgClaimedInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgClaimedInvite", "orgClaimedInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgClaimedInvite', + 'orgClaimedInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgClaimedInviteFilter", "OrgClaimedInviteOrderBy", connectionFieldsMap); + 'OrgClaimedInviteFilter', + 'OrgClaimedInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgClaimedInvite", - fieldName: "orgClaimedInvite", + operation: 'query', + operationName: 'OrgClaimedInvite', + fieldName: 'orgClaimedInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgClaimedInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgClaimedInvite": data.orgClaimedInvites?.nodes?.[0] ?? null - }) + orgClaimedInvite: data.orgClaimedInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgClaimedInvite", "createOrgClaimedInvite", "orgClaimedInvite", args.select, args.data, "CreateOrgClaimedInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgClaimedInvite', + 'createOrgClaimedInvite', + 'orgClaimedInvite', + args.select, + args.data, + 'CreateOrgClaimedInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "createOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'createOrgClaimedInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgClaimedInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgClaimedInvite", "updateOrgClaimedInvite", "orgClaimedInvite", args.select, args.where.id, args.data, "UpdateOrgClaimedInviteInput", "id", "orgClaimedInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgClaimedInvite', + 'updateOrgClaimedInvite', + 'orgClaimedInvite', + args.select, + args.where.id, + args.data, + 'UpdateOrgClaimedInviteInput', + 'id', + 'orgClaimedInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "updateOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'updateOrgClaimedInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgClaimedInvite: { orgClaimedInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgClaimedInvite", "deleteOrgClaimedInvite", "orgClaimedInvite", { - id: args.where.id - }, "DeleteOrgClaimedInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgClaimedInvite', + 'deleteOrgClaimedInvite', + 'orgClaimedInvite', + { + id: args.where.id, + }, + 'DeleteOrgClaimedInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgClaimedInvite", - fieldName: "deleteOrgClaimedInvite", + operation: 'mutation', + operationName: 'OrgClaimedInvite', + fieldName: 'deleteOrgClaimedInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgGrant.ts index 8d61a4f545..467c6b11b9 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgGrant, OrgGrantWithRelations, OrgGrantSelect, OrgGrantFilter, OrgGrantOrderBy, CreateOrgGrantInput, UpdateOrgGrantInput, OrgGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgGrant, + OrgGrantWithRelations, + OrgGrantSelect, + OrgGrantFilter, + OrgGrantOrderBy, + CreateOrgGrantInput, + UpdateOrgGrantInput, + OrgGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgGrant", "orgGrants", 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 - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgGrant', + 'orgGrants', + 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, + }, + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrants", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgGrant", "orgGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgGrant', + 'orgGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrant", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgGrant": data.orgGrants?.nodes?.[0] ?? null - }) + orgGrant: data.orgGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgGrant", "orgGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgGrant', + 'orgGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgGrantFilter", "OrgGrantOrderBy", connectionFieldsMap); + 'OrgGrantFilter', + 'OrgGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgGrant", - fieldName: "orgGrant", + operation: 'query', + operationName: 'OrgGrant', + fieldName: 'orgGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgGrant": data.orgGrants?.nodes?.[0] ?? null - }) + orgGrant: data.orgGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgGrant", "createOrgGrant", "orgGrant", args.select, args.data, "CreateOrgGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgGrant', + 'createOrgGrant', + 'orgGrant', + args.select, + args.data, + 'CreateOrgGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "createOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'createOrgGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgGrant", "updateOrgGrant", "orgGrant", args.select, args.where.id, args.data, "UpdateOrgGrantInput", "id", "orgGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgGrant', + 'updateOrgGrant', + 'orgGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgGrantInput', + 'id', + 'orgGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "updateOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'updateOrgGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgGrant: { orgGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgGrant", "deleteOrgGrant", "orgGrant", { - id: args.where.id - }, "DeleteOrgGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgGrant', + 'deleteOrgGrant', + 'orgGrant', + { + id: args.where.id, + }, + 'DeleteOrgGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgGrant", - fieldName: "deleteOrgGrant", + operation: 'mutation', + operationName: 'OrgGrant', + fieldName: 'deleteOrgGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgInvite.ts b/sdk/constructive-sdk/src/admin/orm/models/orgInvite.ts index 120f096740..50cc5eb9e6 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgInvite.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgInvite.ts @@ -3,56 +3,96 @@ * @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 { OrgInvite, OrgInviteWithRelations, OrgInviteSelect, OrgInviteFilter, OrgInviteOrderBy, CreateOrgInviteInput, UpdateOrgInviteInput, OrgInvitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgInvite, + OrgInviteWithRelations, + OrgInviteSelect, + OrgInviteFilter, + OrgInviteOrderBy, + CreateOrgInviteInput, + UpdateOrgInviteInput, + OrgInvitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgInviteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgInvite", "orgInvites", 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 - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgInvite', + 'orgInvites', + 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, + }, + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvites", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgInvite", "orgInvites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgInvite', + 'orgInvites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvite", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgInvite": data.orgInvites?.nodes?.[0] ?? null - }) + orgInvite: data.orgInvites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgInvite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgInvite", "orgInvites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgInvite', + 'orgInvites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgInviteFilter", "OrgInviteOrderBy", connectionFieldsMap); + 'OrgInviteFilter', + 'OrgInviteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgInvite", - fieldName: "orgInvite", + operation: 'query', + operationName: 'OrgInvite', + fieldName: 'orgInvite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgInviteModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgInvite": data.orgInvites?.nodes?.[0] ?? null - }) + orgInvite: data.orgInvites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgInvite", "createOrgInvite", "orgInvite", args.select, args.data, "CreateOrgInviteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgInvite', + 'createOrgInvite', + 'orgInvite', + args.select, + args.data, + 'CreateOrgInviteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "createOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'createOrgInvite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgInvitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgInvite", "updateOrgInvite", "orgInvite", args.select, args.where.id, args.data, "UpdateOrgInviteInput", "id", "orgInvitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgInvite', + 'updateOrgInvite', + 'orgInvite', + args.select, + args.where.id, + args.data, + 'UpdateOrgInviteInput', + 'id', + 'orgInvitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "updateOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'updateOrgInvite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgInvite: { orgInvite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgInvite", "deleteOrgInvite", "orgInvite", { - id: args.where.id - }, "DeleteOrgInviteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgInvite', + 'deleteOrgInvite', + 'orgInvite', + { + id: args.where.id, + }, + 'DeleteOrgInviteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgInvite", - fieldName: "deleteOrgInvite", + operation: 'mutation', + operationName: 'OrgInvite', + fieldName: 'deleteOrgInvite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMember.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMember.ts index 76ffb8c694..bf7ac25fe9 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMember.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMember.ts @@ -3,56 +3,96 @@ * @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 { OrgMember, OrgMemberWithRelations, OrgMemberSelect, OrgMemberFilter, OrgMemberOrderBy, CreateOrgMemberInput, UpdateOrgMemberInput, OrgMemberPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMember, + OrgMemberWithRelations, + OrgMemberSelect, + OrgMemberFilter, + OrgMemberOrderBy, + CreateOrgMemberInput, + UpdateOrgMemberInput, + OrgMemberPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMemberModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMember", "orgMembers", 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 - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMember', + 'orgMembers', + 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, + }, + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMembers", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMembers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMember: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMember", "orgMembers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMember', + 'orgMembers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMember", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMember', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMemberModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMember": data.orgMembers?.nodes?.[0] ?? null - }) + orgMember: data.orgMembers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMember: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMember", "orgMembers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMember', + 'orgMembers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMemberFilter", "OrgMemberOrderBy", connectionFieldsMap); + 'OrgMemberFilter', + 'OrgMemberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMember", - fieldName: "orgMember", + operation: 'query', + operationName: 'OrgMember', + fieldName: 'orgMember', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMemberModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMember": data.orgMembers?.nodes?.[0] ?? null - }) + orgMember: data.orgMembers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMember", "createOrgMember", "orgMember", args.select, args.data, "CreateOrgMemberInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMember', + 'createOrgMember', + 'orgMember', + args.select, + args.data, + 'CreateOrgMemberInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "createOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'createOrgMember', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMemberPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMember", "updateOrgMember", "orgMember", args.select, args.where.id, args.data, "UpdateOrgMemberInput", "id", "orgMemberPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMember', + 'updateOrgMember', + 'orgMember', + args.select, + args.where.id, + args.data, + 'UpdateOrgMemberInput', + 'id', + 'orgMemberPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "updateOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'updateOrgMember', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMember: { orgMember: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMember", "deleteOrgMember", "orgMember", { - id: args.where.id - }, "DeleteOrgMemberInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMember', + 'deleteOrgMember', + 'orgMember', + { + id: args.where.id, + }, + 'DeleteOrgMemberInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMember", - fieldName: "deleteOrgMember", + operation: 'mutation', + operationName: 'OrgMember', + fieldName: 'deleteOrgMember', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMemberProfile.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMemberProfile.ts index 4f0671ad74..9cecf8839b 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMemberProfile.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMemberProfile.ts @@ -3,56 +3,96 @@ * @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 { OrgMemberProfile, OrgMemberProfileWithRelations, OrgMemberProfileSelect, OrgMemberProfileFilter, OrgMemberProfileOrderBy, CreateOrgMemberProfileInput, UpdateOrgMemberProfileInput, OrgMemberProfilePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMemberProfile, + OrgMemberProfileWithRelations, + OrgMemberProfileSelect, + OrgMemberProfileFilter, + OrgMemberProfileOrderBy, + CreateOrgMemberProfileInput, + UpdateOrgMemberProfileInput, + OrgMemberProfilePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMemberProfileModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfiles: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMemberProfile", "orgMemberProfiles", 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 - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + 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, + }, + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfiles", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfiles', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfile: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMemberProfile", "orgMemberProfiles", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfile", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfile', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMemberProfileModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMemberProfile": data.orgMemberProfiles?.nodes?.[0] ?? null - }) + orgMemberProfile: data.orgMemberProfiles?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberProfile: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMemberProfile", "orgMemberProfiles", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMemberProfile', + 'orgMemberProfiles', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMemberProfileFilter", "OrgMemberProfileOrderBy", connectionFieldsMap); + 'OrgMemberProfileFilter', + 'OrgMemberProfileOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMemberProfile", - fieldName: "orgMemberProfile", + operation: 'query', + operationName: 'OrgMemberProfile', + fieldName: 'orgMemberProfile', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMemberProfileModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMemberProfile": data.orgMemberProfiles?.nodes?.[0] ?? null - }) + orgMemberProfile: data.orgMemberProfiles?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMemberProfile", "createOrgMemberProfile", "orgMemberProfile", args.select, args.data, "CreateOrgMemberProfileInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMemberProfile', + 'createOrgMemberProfile', + 'orgMemberProfile', + args.select, + args.data, + 'CreateOrgMemberProfileInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "createOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'createOrgMemberProfile', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMemberProfilePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMemberProfile", "updateOrgMemberProfile", "orgMemberProfile", args.select, args.where.id, args.data, "UpdateOrgMemberProfileInput", "id", "orgMemberProfilePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMemberProfile', + 'updateOrgMemberProfile', + 'orgMemberProfile', + args.select, + args.where.id, + args.data, + 'UpdateOrgMemberProfileInput', + 'id', + 'orgMemberProfilePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "updateOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'updateOrgMemberProfile', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMemberProfile: { orgMemberProfile: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMemberProfile", "deleteOrgMemberProfile", "orgMemberProfile", { - id: args.where.id - }, "DeleteOrgMemberProfileInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMemberProfile', + 'deleteOrgMemberProfile', + 'orgMemberProfile', + { + id: args.where.id, + }, + 'DeleteOrgMemberProfileInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMemberProfile", - fieldName: "deleteOrgMemberProfile", + operation: 'mutation', + operationName: 'OrgMemberProfile', + fieldName: 'deleteOrgMemberProfile', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMembership.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMembership.ts index 316b21c75c..06ee032ca8 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMembership.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMembership.ts @@ -3,56 +3,96 @@ * @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 { OrgMembership, OrgMembershipWithRelations, OrgMembershipSelect, OrgMembershipFilter, OrgMembershipOrderBy, CreateOrgMembershipInput, UpdateOrgMembershipInput, OrgMembershipPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembership, + OrgMembershipWithRelations, + OrgMembershipSelect, + OrgMembershipFilter, + OrgMembershipOrderBy, + CreateOrgMembershipInput, + UpdateOrgMembershipInput, + OrgMembershipPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMemberships: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembership", "orgMemberships", 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 - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembership', + 'orgMemberships', + 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, + }, + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMemberships", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMemberships', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembership", "orgMemberships", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembership', + 'orgMemberships', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMembership", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMembership', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembership": data.orgMemberships?.nodes?.[0] ?? null - }) + orgMembership: data.orgMemberships?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembership: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembership", "orgMemberships", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembership', + 'orgMemberships', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipFilter", "OrgMembershipOrderBy", connectionFieldsMap); + 'OrgMembershipFilter', + 'OrgMembershipOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembership", - fieldName: "orgMembership", + operation: 'query', + operationName: 'OrgMembership', + fieldName: 'orgMembership', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgMembershipModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembership": data.orgMemberships?.nodes?.[0] ?? null - }) + orgMembership: data.orgMemberships?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembership", "createOrgMembership", "orgMembership", args.select, args.data, "CreateOrgMembershipInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembership', + 'createOrgMembership', + 'orgMembership', + args.select, + args.data, + 'CreateOrgMembershipInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "createOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'createOrgMembership', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembership", "updateOrgMembership", "orgMembership", args.select, args.where.id, args.data, "UpdateOrgMembershipInput", "id", "orgMembershipPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembership', + 'updateOrgMembership', + 'orgMembership', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipInput', + 'id', + 'orgMembershipPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "updateOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'updateOrgMembership', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembership: { orgMembership: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembership", "deleteOrgMembership", "orgMembership", { - id: args.where.id - }, "DeleteOrgMembershipInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembership', + 'deleteOrgMembership', + 'orgMembership', + { + id: args.where.id, + }, + 'DeleteOrgMembershipInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembership", - fieldName: "deleteOrgMembership", + operation: 'mutation', + operationName: 'OrgMembership', + fieldName: 'deleteOrgMembership', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMembershipDefault.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMembershipDefault.ts index 25472918b1..525619dfca 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMembershipDefault.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMembershipDefault.ts @@ -3,56 +3,98 @@ * @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 { OrgMembershipDefault, OrgMembershipDefaultWithRelations, OrgMembershipDefaultSelect, OrgMembershipDefaultFilter, OrgMembershipDefaultOrderBy, CreateOrgMembershipDefaultInput, UpdateOrgMembershipDefaultInput, OrgMembershipDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembershipDefault, + OrgMembershipDefaultWithRelations, + OrgMembershipDefaultSelect, + OrgMembershipDefaultFilter, + OrgMembershipDefaultOrderBy, + CreateOrgMembershipDefaultInput, + UpdateOrgMembershipDefaultInput, + OrgMembershipDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgMembershipDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgMembershipDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipDefault", "orgMembershipDefaults", 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 - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + 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, + }, + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefaults", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembershipDefault", "orgMembershipDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefault", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipDefault": data.orgMembershipDefaults?.nodes?.[0] ?? null - }) + orgMembershipDefault: data.orgMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipDefault", "orgMembershipDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembershipDefault', + 'orgMembershipDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipDefaultFilter", "OrgMembershipDefaultOrderBy", connectionFieldsMap); + 'OrgMembershipDefaultFilter', + 'OrgMembershipDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipDefault", - fieldName: "orgMembershipDefault", + operation: 'query', + operationName: 'OrgMembershipDefault', + fieldName: 'orgMembershipDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgMembershipDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipDefault": data.orgMembershipDefaults?.nodes?.[0] ?? null - }) + orgMembershipDefault: data.orgMembershipDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembershipDefault", "createOrgMembershipDefault", "orgMembershipDefault", args.select, args.data, "CreateOrgMembershipDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembershipDefault', + 'createOrgMembershipDefault', + 'orgMembershipDefault', + args.select, + args.data, + 'CreateOrgMembershipDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "createOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'createOrgMembershipDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembershipDefault", "updateOrgMembershipDefault", "orgMembershipDefault", args.select, args.where.id, args.data, "UpdateOrgMembershipDefaultInput", "id", "orgMembershipDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembershipDefault', + 'updateOrgMembershipDefault', + 'orgMembershipDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipDefaultInput', + 'id', + 'orgMembershipDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "updateOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'updateOrgMembershipDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembershipDefault: { orgMembershipDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembershipDefault", "deleteOrgMembershipDefault", "orgMembershipDefault", { - id: args.where.id - }, "DeleteOrgMembershipDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembershipDefault', + 'deleteOrgMembershipDefault', + 'orgMembershipDefault', + { + id: args.where.id, + }, + 'DeleteOrgMembershipDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipDefault", - fieldName: "deleteOrgMembershipDefault", + operation: 'mutation', + operationName: 'OrgMembershipDefault', + fieldName: 'deleteOrgMembershipDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMembershipSetting.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMembershipSetting.ts index 3297c80b04..de551183d2 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMembershipSetting.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMembershipSetting.ts @@ -3,56 +3,98 @@ * @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 { OrgMembershipSetting, OrgMembershipSettingWithRelations, OrgMembershipSettingSelect, OrgMembershipSettingFilter, OrgMembershipSettingOrderBy, CreateOrgMembershipSettingInput, UpdateOrgMembershipSettingInput, OrgMembershipSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgMembershipSetting, + OrgMembershipSettingWithRelations, + OrgMembershipSettingSelect, + OrgMembershipSettingFilter, + OrgMembershipSettingOrderBy, + CreateOrgMembershipSettingInput, + UpdateOrgMembershipSettingInput, + OrgMembershipSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgMembershipSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgMembershipSettings: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgMembershipSettings: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipSetting", "orgMembershipSettings", 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 - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + 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, + }, + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSettings", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgMembershipSetting", "orgMembershipSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSetting", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSetting', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgMembershipSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipSetting": data.orgMembershipSettings?.nodes?.[0] ?? null - }) + orgMembershipSetting: data.orgMembershipSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgMembershipSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgMembershipSetting", "orgMembershipSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgMembershipSetting', + 'orgMembershipSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgMembershipSettingFilter", "OrgMembershipSettingOrderBy", connectionFieldsMap); + 'OrgMembershipSettingFilter', + 'OrgMembershipSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgMembershipSetting", - fieldName: "orgMembershipSetting", + operation: 'query', + operationName: 'OrgMembershipSetting', + fieldName: 'orgMembershipSetting', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgMembershipSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgMembershipSetting": data.orgMembershipSettings?.nodes?.[0] ?? null - }) + orgMembershipSetting: data.orgMembershipSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgMembershipSetting", "createOrgMembershipSetting", "orgMembershipSetting", args.select, args.data, "CreateOrgMembershipSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgMembershipSetting', + 'createOrgMembershipSetting', + 'orgMembershipSetting', + args.select, + args.data, + 'CreateOrgMembershipSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "createOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'createOrgMembershipSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgMembershipSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgMembershipSetting", "updateOrgMembershipSetting", "orgMembershipSetting", args.select, args.where.id, args.data, "UpdateOrgMembershipSettingInput", "id", "orgMembershipSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgMembershipSetting', + 'updateOrgMembershipSetting', + 'orgMembershipSetting', + args.select, + args.where.id, + args.data, + 'UpdateOrgMembershipSettingInput', + 'id', + 'orgMembershipSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "updateOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'updateOrgMembershipSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgMembershipSetting: { orgMembershipSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgMembershipSetting", "deleteOrgMembershipSetting", "orgMembershipSetting", { - id: args.where.id - }, "DeleteOrgMembershipSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgMembershipSetting', + 'deleteOrgMembershipSetting', + 'orgMembershipSetting', + { + id: args.where.id, + }, + 'DeleteOrgMembershipSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgMembershipSetting", - fieldName: "deleteOrgMembershipSetting", + operation: 'mutation', + operationName: 'OrgMembershipSetting', + fieldName: 'deleteOrgMembershipSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgOwnerGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgOwnerGrant.ts index 163b918057..d99550bd73 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgOwnerGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgOwnerGrant.ts @@ -3,56 +3,96 @@ * @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 { OrgOwnerGrant, OrgOwnerGrantWithRelations, OrgOwnerGrantSelect, OrgOwnerGrantFilter, OrgOwnerGrantOrderBy, CreateOrgOwnerGrantInput, UpdateOrgOwnerGrantInput, OrgOwnerGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgOwnerGrant, + OrgOwnerGrantWithRelations, + OrgOwnerGrantSelect, + OrgOwnerGrantFilter, + OrgOwnerGrantOrderBy, + CreateOrgOwnerGrantInput, + UpdateOrgOwnerGrantInput, + OrgOwnerGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgOwnerGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgOwnerGrant", "orgOwnerGrants", 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 - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + 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, + }, + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrants", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgOwnerGrant", "orgOwnerGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrant", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgOwnerGrant": data.orgOwnerGrants?.nodes?.[0] ?? null - }) + orgOwnerGrant: data.orgOwnerGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgOwnerGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgOwnerGrant", "orgOwnerGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgOwnerGrant', + 'orgOwnerGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgOwnerGrantFilter", "OrgOwnerGrantOrderBy", connectionFieldsMap); + 'OrgOwnerGrantFilter', + 'OrgOwnerGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgOwnerGrant", - fieldName: "orgOwnerGrant", + operation: 'query', + operationName: 'OrgOwnerGrant', + fieldName: 'orgOwnerGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgOwnerGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgOwnerGrant": data.orgOwnerGrants?.nodes?.[0] ?? null - }) + orgOwnerGrant: data.orgOwnerGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgOwnerGrant", "createOrgOwnerGrant", "orgOwnerGrant", args.select, args.data, "CreateOrgOwnerGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgOwnerGrant', + 'createOrgOwnerGrant', + 'orgOwnerGrant', + args.select, + args.data, + 'CreateOrgOwnerGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "createOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'createOrgOwnerGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgOwnerGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgOwnerGrant", "updateOrgOwnerGrant", "orgOwnerGrant", args.select, args.where.id, args.data, "UpdateOrgOwnerGrantInput", "id", "orgOwnerGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgOwnerGrant', + 'updateOrgOwnerGrant', + 'orgOwnerGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgOwnerGrantInput', + 'id', + 'orgOwnerGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "updateOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'updateOrgOwnerGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgOwnerGrant: { orgOwnerGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgOwnerGrant", "deleteOrgOwnerGrant", "orgOwnerGrant", { - id: args.where.id - }, "DeleteOrgOwnerGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgOwnerGrant', + 'deleteOrgOwnerGrant', + 'orgOwnerGrant', + { + id: args.where.id, + }, + 'DeleteOrgOwnerGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgOwnerGrant", - fieldName: "deleteOrgOwnerGrant", + operation: 'mutation', + operationName: 'OrgOwnerGrant', + fieldName: 'deleteOrgOwnerGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgPermission.ts b/sdk/constructive-sdk/src/admin/orm/models/orgPermission.ts index 76834b6851..e3aded7147 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgPermission.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgPermission.ts @@ -3,56 +3,96 @@ * @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 { OrgPermission, OrgPermissionWithRelations, OrgPermissionSelect, OrgPermissionFilter, OrgPermissionOrderBy, CreateOrgPermissionInput, UpdateOrgPermissionInput, OrgPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermission, + OrgPermissionWithRelations, + OrgPermissionSelect, + OrgPermissionFilter, + OrgPermissionOrderBy, + CreateOrgPermissionInput, + UpdateOrgPermissionInput, + OrgPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermission", "orgPermissions", 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 - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermission', + 'orgPermissions', + 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, + }, + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermissions", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermission", "orgPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermission', + 'orgPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermission", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermission', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermission": data.orgPermissions?.nodes?.[0] ?? null - }) + orgPermission: data.orgPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermission: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermission", "orgPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermission', + 'orgPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionFilter", "OrgPermissionOrderBy", connectionFieldsMap); + 'OrgPermissionFilter', + 'OrgPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermission", - fieldName: "orgPermission", + operation: 'query', + operationName: 'OrgPermission', + fieldName: 'orgPermission', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermission": data.orgPermissions?.nodes?.[0] ?? null - }) + orgPermission: data.orgPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermission", "createOrgPermission", "orgPermission", args.select, args.data, "CreateOrgPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermission', + 'createOrgPermission', + 'orgPermission', + args.select, + args.data, + 'CreateOrgPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "createOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'createOrgPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermission", "updateOrgPermission", "orgPermission", args.select, args.where.id, args.data, "UpdateOrgPermissionInput", "id", "orgPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermission', + 'updateOrgPermission', + 'orgPermission', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionInput', + 'id', + 'orgPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "updateOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'updateOrgPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermission: { orgPermission: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermission", "deleteOrgPermission", "orgPermission", { - id: args.where.id - }, "DeleteOrgPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermission', + 'deleteOrgPermission', + 'orgPermission', + { + id: args.where.id, + }, + 'DeleteOrgPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermission", - fieldName: "deleteOrgPermission", + operation: 'mutation', + operationName: 'OrgPermission', + fieldName: 'deleteOrgPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefault.ts b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefault.ts index b9fd8d9a5f..20ed957d15 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefault.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefault.ts @@ -3,56 +3,98 @@ * @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 { OrgPermissionDefault, OrgPermissionDefaultWithRelations, OrgPermissionDefaultSelect, OrgPermissionDefaultFilter, OrgPermissionDefaultOrderBy, CreateOrgPermissionDefaultInput, UpdateOrgPermissionDefaultInput, OrgPermissionDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefault, + OrgPermissionDefaultWithRelations, + OrgPermissionDefaultSelect, + OrgPermissionDefaultFilter, + OrgPermissionDefaultOrderBy, + CreateOrgPermissionDefaultInput, + UpdateOrgPermissionDefaultInput, + OrgPermissionDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaults: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaults: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefault", "orgPermissionDefaults", 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 - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + 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, + }, + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefaults", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefault", "orgPermissionDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefault", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefault', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefault": data.orgPermissionDefaults?.nodes?.[0] ?? null - }) + orgPermissionDefault: data.orgPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefault", "orgPermissionDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefault', + 'orgPermissionDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultFilter", "OrgPermissionDefaultOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultFilter', + 'OrgPermissionDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefault", - fieldName: "orgPermissionDefault", + operation: 'query', + operationName: 'OrgPermissionDefault', + fieldName: 'orgPermissionDefault', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgPermissionDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefault": data.orgPermissionDefaults?.nodes?.[0] ?? null - }) + orgPermissionDefault: data.orgPermissionDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefault", "createOrgPermissionDefault", "orgPermissionDefault", args.select, args.data, "CreateOrgPermissionDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefault', + 'createOrgPermissionDefault', + 'orgPermissionDefault', + args.select, + args.data, + 'CreateOrgPermissionDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "createOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'createOrgPermissionDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefault", "updateOrgPermissionDefault", "orgPermissionDefault", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultInput", "id", "orgPermissionDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefault', + 'updateOrgPermissionDefault', + 'orgPermissionDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultInput', + 'id', + 'orgPermissionDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "updateOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'updateOrgPermissionDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefault: { orgPermissionDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefault", "deleteOrgPermissionDefault", "orgPermissionDefault", { - id: args.where.id - }, "DeleteOrgPermissionDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefault', + 'deleteOrgPermissionDefault', + 'orgPermissionDefault', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefault", - fieldName: "deleteOrgPermissionDefault", + operation: 'mutation', + operationName: 'OrgPermissionDefault', + fieldName: 'deleteOrgPermissionDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultGrant.ts index 0a3f198007..07d5976acb 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultGrant.ts @@ -3,56 +3,98 @@ * @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 { OrgPermissionDefaultGrant, OrgPermissionDefaultGrantWithRelations, OrgPermissionDefaultGrantSelect, OrgPermissionDefaultGrantFilter, OrgPermissionDefaultGrantOrderBy, CreateOrgPermissionDefaultGrantInput, UpdateOrgPermissionDefaultGrantInput, OrgPermissionDefaultGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefaultGrant, + OrgPermissionDefaultGrantWithRelations, + OrgPermissionDefaultGrantSelect, + OrgPermissionDefaultGrantFilter, + OrgPermissionDefaultGrantOrderBy, + CreateOrgPermissionDefaultGrantInput, + UpdateOrgPermissionDefaultGrantInput, + OrgPermissionDefaultGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultGrants: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultGrants: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", 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 - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + 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, + }, + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrants", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrant", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrant', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class OrgPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultGrant": data.orgPermissionDefaultGrants?.nodes?.[0] ?? null - }) + orgPermissionDefaultGrant: data.orgPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgPermissionDefaultGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultGrant", "orgPermissionDefaultGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultGrant', + 'orgPermissionDefaultGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultGrantFilter", "OrgPermissionDefaultGrantOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultGrantFilter', + 'OrgPermissionDefaultGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultGrant", - fieldName: "orgPermissionDefaultGrant", + operation: 'query', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'orgPermissionDefaultGrant', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class OrgPermissionDefaultGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultGrant": data.orgPermissionDefaultGrants?.nodes?.[0] ?? null - }) + orgPermissionDefaultGrant: data.orgPermissionDefaultGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefaultGrant", "createOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", args.select, args.data, "CreateOrgPermissionDefaultGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefaultGrant', + 'createOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + args.select, + args.data, + 'CreateOrgPermissionDefaultGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "createOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'createOrgPermissionDefaultGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefaultGrant", "updateOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultGrantInput", "id", "orgPermissionDefaultGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefaultGrant', + 'updateOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultGrantInput', + 'id', + 'orgPermissionDefaultGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "updateOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'updateOrgPermissionDefaultGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefaultGrant: { orgPermissionDefaultGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefaultGrant", "deleteOrgPermissionDefaultGrant", "orgPermissionDefaultGrant", { - id: args.where.id - }, "DeleteOrgPermissionDefaultGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefaultGrant', + 'deleteOrgPermissionDefaultGrant', + 'orgPermissionDefaultGrant', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultGrant", - fieldName: "deleteOrgPermissionDefaultGrant", + operation: 'mutation', + operationName: 'OrgPermissionDefaultGrant', + fieldName: 'deleteOrgPermissionDefaultGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultPermission.ts b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultPermission.ts index 66e7df7fd0..3339ceaeca 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultPermission.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultPermission.ts @@ -3,56 +3,109 @@ * @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 { OrgPermissionDefaultPermission, OrgPermissionDefaultPermissionWithRelations, OrgPermissionDefaultPermissionSelect, OrgPermissionDefaultPermissionFilter, OrgPermissionDefaultPermissionOrderBy, CreateOrgPermissionDefaultPermissionInput, UpdateOrgPermissionDefaultPermissionInput, OrgPermissionDefaultPermissionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgPermissionDefaultPermission, + OrgPermissionDefaultPermissionWithRelations, + OrgPermissionDefaultPermissionSelect, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy, + CreateOrgPermissionDefaultPermissionInput, + UpdateOrgPermissionDefaultPermissionInput, + OrgPermissionDefaultPermissionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgPermissionDefaultPermissionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermissions: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermissions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", 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 - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + 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, + }, + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermissions", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermissions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermission: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + OrgPermissionDefaultPermissionFilter, + OrgPermissionDefaultPermissionOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermission", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermission', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class OrgPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultPermission": data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + orgPermissionDefaultPermission: data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - orgPermissionDefaultPermission: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgPermissionDefaultPermission", "orgPermissionDefaultPermissions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgPermissionDefaultPermission', + 'orgPermissionDefaultPermissions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgPermissionDefaultPermissionFilter", "OrgPermissionDefaultPermissionOrderBy", connectionFieldsMap); + 'OrgPermissionDefaultPermissionFilter', + 'OrgPermissionDefaultPermissionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgPermissionDefaultPermission", - fieldName: "orgPermissionDefaultPermission", + operation: 'query', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'orgPermissionDefaultPermission', document, variables, transform: (data: { @@ -93,74 +156,118 @@ export class OrgPermissionDefaultPermissionModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgPermissionDefaultPermission": data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null - }) + orgPermissionDefaultPermission: data.orgPermissionDefaultPermissions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateOrgPermissionDefaultPermissionInput['orgPermissionDefaultPermission'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgPermissionDefaultPermission", "createOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", args.select, args.data, "CreateOrgPermissionDefaultPermissionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgPermissionDefaultPermission', + 'createOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + args.select, + args.data, + 'CreateOrgPermissionDefaultPermissionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "createOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'createOrgPermissionDefaultPermission', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgPermissionDefaultPermissionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgPermissionDefaultPermission", "updateOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", args.select, args.where.id, args.data, "UpdateOrgPermissionDefaultPermissionInput", "id", "orgPermissionDefaultPermissionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgPermissionDefaultPermission', + 'updateOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + args.select, + args.where.id, + args.data, + 'UpdateOrgPermissionDefaultPermissionInput', + 'id', + 'orgPermissionDefaultPermissionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "updateOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'updateOrgPermissionDefaultPermission', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgPermissionDefaultPermission: { - orgPermissionDefaultPermission: InferSelectResult; + orgPermissionDefaultPermission: InferSelectResult< + OrgPermissionDefaultPermissionWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgPermissionDefaultPermission", "deleteOrgPermissionDefaultPermission", "orgPermissionDefaultPermission", { - id: args.where.id - }, "DeleteOrgPermissionDefaultPermissionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgPermissionDefaultPermission', + 'deleteOrgPermissionDefaultPermission', + 'orgPermissionDefaultPermission', + { + id: args.where.id, + }, + 'DeleteOrgPermissionDefaultPermissionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgPermissionDefaultPermission", - fieldName: "deleteOrgPermissionDefaultPermission", + operation: 'mutation', + operationName: 'OrgPermissionDefaultPermission', + fieldName: 'deleteOrgPermissionDefaultPermission', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/mutation/index.ts b/sdk/constructive-sdk/src/admin/orm/mutation/index.ts index 822d64e2f2..0e8e613d2e 100644 --- a/sdk/constructive-sdk/src/admin/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/admin/orm/mutation/index.ts @@ -3,11 +3,21 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, SubmitAppInviteCodeInput, SubmitOrgInviteCodeInput, ProvisionBucketPayload, SubmitAppInviteCodePayload, SubmitOrgInviteCodePayload, ProvisionBucketPayloadSelect, SubmitAppInviteCodePayloadSelect, SubmitOrgInviteCodePayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + SubmitAppInviteCodeInput, + SubmitOrgInviteCodeInput, + ProvisionBucketPayload, + SubmitAppInviteCodePayload, + SubmitOrgInviteCodePayload, + ProvisionBucketPayloadSelect, + SubmitAppInviteCodePayloadSelect, + SubmitOrgInviteCodePayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -26,47 +36,92 @@ export interface SubmitOrgInviteCodeVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - submitAppInviteCode: (args: SubmitAppInviteCodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - submitAppInviteCode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SubmitAppInviteCode", - fieldName: "submitAppInviteCode", - ...buildCustomDocument("mutation", "SubmitAppInviteCode", "submitAppInviteCode", options.select, args, [{ - name: "input", - type: "SubmitAppInviteCodeInput!" - }], connectionFieldsMap, "SubmitAppInviteCodePayload") - }), - submitOrgInviteCode: (args: SubmitOrgInviteCodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - submitOrgInviteCode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SubmitOrgInviteCode", - fieldName: "submitOrgInviteCode", - ...buildCustomDocument("mutation", "SubmitOrgInviteCode", "submitOrgInviteCode", options.select, args, [{ - name: "input", - type: "SubmitOrgInviteCodeInput!" - }], connectionFieldsMap, "SubmitOrgInviteCodePayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + submitAppInviteCode: ( + args: SubmitAppInviteCodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + submitAppInviteCode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SubmitAppInviteCode', + fieldName: 'submitAppInviteCode', + ...buildCustomDocument( + 'mutation', + 'SubmitAppInviteCode', + 'submitAppInviteCode', + options.select, + args, + [ + { + name: 'input', + type: 'SubmitAppInviteCodeInput!', + }, + ], + connectionFieldsMap, + 'SubmitAppInviteCodePayload' + ), + }), + submitOrgInviteCode: ( + args: SubmitOrgInviteCodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + submitOrgInviteCode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SubmitOrgInviteCode', + fieldName: 'submitOrgInviteCode', + ...buildCustomDocument( + 'mutation', + 'SubmitOrgInviteCode', + 'submitOrgInviteCode', + options.select, + args, + [ + { + name: 'input', + type: 'SubmitOrgInviteCodeInput!', + }, + ], + connectionFieldsMap, + 'SubmitOrgInviteCodePayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/query-builder.ts b/sdk/constructive-sdk/src/admin/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/admin/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/admin/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/admin/orm/query/index.ts b/sdk/constructive-sdk/src/admin/orm/query/index.ts index 08db07b7be..da811891ce 100644 --- a/sdk/constructive-sdk/src/admin/orm/query/index.ts +++ b/sdk/constructive-sdk/src/admin/orm/query/index.ts @@ -3,11 +3,11 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AppPermissionConnection, OrgPermissionConnection } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { AppPermissionConnection, OrgPermissionConnection } from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AppPermissionsGetByMaskVariables { /** Read all values in the set after (below) this cursor. */ after?: string; @@ -52,135 +52,261 @@ export interface OrgPermissionsGetPaddedMaskVariables { } export function createQueryOperations(client: OrmClient) { return { - appPermissionsGetByMask: (args: AppPermissionsGetByMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetByMask: AppPermissionConnection | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetByMask", - fieldName: "appPermissionsGetByMask", - ...buildCustomDocument("query", "AppPermissionsGetByMask", "appPermissionsGetByMask", options?.select, args, [{ - name: "after", - type: "Cursor" - }, { - name: "first", - type: "Int" - }, { - name: "mask", - type: "BitString" - }, { - name: "offset", - type: "Int" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetMask: (args: AppPermissionsGetMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetMask: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetMask", - fieldName: "appPermissionsGetMask", - ...buildCustomDocument("query", "AppPermissionsGetMask", "appPermissionsGetMask", options?.select, args, [{ - name: "ids", - type: "[UUID]" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetMaskByNames: (args: AppPermissionsGetMaskByNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetMaskByNames: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetMaskByNames", - fieldName: "appPermissionsGetMaskByNames", - ...buildCustomDocument("query", "AppPermissionsGetMaskByNames", "appPermissionsGetMaskByNames", options?.select, args, [{ - name: "names", - type: "[String]" - }], connectionFieldsMap, undefined) - }), - appPermissionsGetPaddedMask: (args: AppPermissionsGetPaddedMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - appPermissionsGetPaddedMask: string | null; - }>({ - client, - operation: "query", - operationName: "AppPermissionsGetPaddedMask", - fieldName: "appPermissionsGetPaddedMask", - ...buildCustomDocument("query", "AppPermissionsGetPaddedMask", "appPermissionsGetPaddedMask", options?.select, args, [{ - name: "mask", - type: "BitString" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetByMask: (args: OrgPermissionsGetByMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetByMask: OrgPermissionConnection | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetByMask", - fieldName: "orgPermissionsGetByMask", - ...buildCustomDocument("query", "OrgPermissionsGetByMask", "orgPermissionsGetByMask", options?.select, args, [{ - name: "after", - type: "Cursor" - }, { - name: "first", - type: "Int" - }, { - name: "mask", - type: "BitString" - }, { - name: "offset", - type: "Int" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetMask: (args: OrgPermissionsGetMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetMask: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetMask", - fieldName: "orgPermissionsGetMask", - ...buildCustomDocument("query", "OrgPermissionsGetMask", "orgPermissionsGetMask", options?.select, args, [{ - name: "ids", - type: "[UUID]" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetMaskByNames: (args: OrgPermissionsGetMaskByNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetMaskByNames: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetMaskByNames", - fieldName: "orgPermissionsGetMaskByNames", - ...buildCustomDocument("query", "OrgPermissionsGetMaskByNames", "orgPermissionsGetMaskByNames", options?.select, args, [{ - name: "names", - type: "[String]" - }], connectionFieldsMap, undefined) - }), - orgPermissionsGetPaddedMask: (args: OrgPermissionsGetPaddedMaskVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - orgPermissionsGetPaddedMask: string | null; - }>({ - client, - operation: "query", - operationName: "OrgPermissionsGetPaddedMask", - fieldName: "orgPermissionsGetPaddedMask", - ...buildCustomDocument("query", "OrgPermissionsGetPaddedMask", "orgPermissionsGetPaddedMask", options?.select, args, [{ - name: "mask", - type: "BitString" - }], connectionFieldsMap, undefined) - }) + appPermissionsGetByMask: ( + args: AppPermissionsGetByMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetByMask: AppPermissionConnection | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetByMask', + fieldName: 'appPermissionsGetByMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetByMask', + 'appPermissionsGetByMask', + options?.select, + args, + [ + { + name: 'after', + type: 'Cursor', + }, + { + name: 'first', + type: 'Int', + }, + { + name: 'mask', + type: 'BitString', + }, + { + name: 'offset', + type: 'Int', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetMask: ( + args: AppPermissionsGetMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetMask', + fieldName: 'appPermissionsGetMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetMask', + 'appPermissionsGetMask', + options?.select, + args, + [ + { + name: 'ids', + type: '[UUID]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetMaskByNames: ( + args: AppPermissionsGetMaskByNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetMaskByNames: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetMaskByNames', + fieldName: 'appPermissionsGetMaskByNames', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetMaskByNames', + 'appPermissionsGetMaskByNames', + options?.select, + args, + [ + { + name: 'names', + type: '[String]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + appPermissionsGetPaddedMask: ( + args: AppPermissionsGetPaddedMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + appPermissionsGetPaddedMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'AppPermissionsGetPaddedMask', + fieldName: 'appPermissionsGetPaddedMask', + ...buildCustomDocument( + 'query', + 'AppPermissionsGetPaddedMask', + 'appPermissionsGetPaddedMask', + options?.select, + args, + [ + { + name: 'mask', + type: 'BitString', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetByMask: ( + args: OrgPermissionsGetByMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetByMask: OrgPermissionConnection | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetByMask', + fieldName: 'orgPermissionsGetByMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetByMask', + 'orgPermissionsGetByMask', + options?.select, + args, + [ + { + name: 'after', + type: 'Cursor', + }, + { + name: 'first', + type: 'Int', + }, + { + name: 'mask', + type: 'BitString', + }, + { + name: 'offset', + type: 'Int', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetMask: ( + args: OrgPermissionsGetMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetMask', + fieldName: 'orgPermissionsGetMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetMask', + 'orgPermissionsGetMask', + options?.select, + args, + [ + { + name: 'ids', + type: '[UUID]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetMaskByNames: ( + args: OrgPermissionsGetMaskByNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetMaskByNames: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetMaskByNames', + fieldName: 'orgPermissionsGetMaskByNames', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetMaskByNames', + 'orgPermissionsGetMaskByNames', + options?.select, + args, + [ + { + name: 'names', + type: '[String]', + }, + ], + connectionFieldsMap, + undefined + ), + }), + orgPermissionsGetPaddedMask: ( + args: OrgPermissionsGetPaddedMaskVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + orgPermissionsGetPaddedMask: string | null; + }>({ + client, + operation: 'query', + operationName: 'OrgPermissionsGetPaddedMask', + fieldName: 'orgPermissionsGetPaddedMask', + ...buildCustomDocument( + 'query', + 'OrgPermissionsGetPaddedMask', + 'orgPermissionsGetPaddedMask', + options?.select, + args, + [ + { + name: 'mask', + type: 'BitString', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/admin/orm/realtime.ts b/sdk/constructive-sdk/src/admin/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/admin/orm/realtime.ts +++ b/sdk/constructive-sdk/src/admin/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/admin/orm/select-types.ts b/sdk/constructive-sdk/src/admin/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/admin/orm/select-types.ts +++ b/sdk/constructive-sdk/src/admin/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/agent/index.ts b/sdk/constructive-sdk/src/agent/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/agent/index.ts +++ b/sdk/constructive-sdk/src/agent/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/agent/orm/client.ts b/sdk/constructive-sdk/src/agent/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/agent/orm/client.ts +++ b/sdk/constructive-sdk/src/agent/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/agent/orm/index.ts b/sdk/constructive-sdk/src/agent/orm/index.ts index be2f54cdb8..5ca8fcc3eb 100644 --- a/sdk/constructive-sdk/src/agent/orm/index.ts +++ b/sdk/constructive-sdk/src/agent/orm/index.ts @@ -3,24 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AgentModel } from "./models/agent"; -import { AgentMessageModel } from "./models/agentMessage"; -import { AgentPersonaModel } from "./models/agentPersona"; -import { AgentPlanModel } from "./models/agentPlan"; -import { AgentPromptModel } from "./models/agentPrompt"; -import { AgentResourceChunkModel } from "./models/agentResourceChunk"; -import { AgentResourceModel } from "./models/agentResource"; -import { AgentTaskModel } from "./models/agentTask"; -import { AgentThreadModel } from "./models/agentThread"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AgentModel } from './models/agent'; +import { AgentMessageModel } from './models/agentMessage'; +import { AgentPersonaModel } from './models/agentPersona'; +import { AgentPlanModel } from './models/agentPlan'; +import { AgentPromptModel } from './models/agentPrompt'; +import { AgentResourceChunkModel } from './models/agentResourceChunk'; +import { AgentResourceModel } from './models/agentResource'; +import { AgentTaskModel } from './models/agentTask'; +import { AgentThreadModel } from './models/agentThread'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -56,6 +56,6 @@ export function createClient(config: OrmClientConfig) { agentResource: new AgentResourceModel(client), agentTask: new AgentTaskModel(client), agentThread: new AgentThreadModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/input-types.ts b/sdk/constructive-sdk/src/agent/orm/input-types.ts index c716bf9a92..3b5bf5f2b5 100644 --- a/sdk/constructive-sdk/src/agent/orm/input-types.ts +++ b/sdk/constructive-sdk/src/agent/orm/input-types.ts @@ -1151,15 +1151,288 @@ export interface AgentThreadFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type AgentOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_EPHEMERAL_ASC" | "IS_EPHEMERAL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PARENT_ID_ASC" | "PARENT_ID_DESC" | "PERSONA_ID_ASC" | "PERSONA_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentMessageOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AGENT_ID_ASC" | "AGENT_ID_DESC" | "AUTHOR_ROLE_ASC" | "AUTHOR_ROLE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MODEL_ASC" | "MODEL_DESC" | "NATURAL" | "PARTS_ASC" | "PARTS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "THREAD_ID_ASC" | "THREAD_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentPersonaOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentPlanOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "THREAD_ID_ASC" | "THREAD_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentPromptOrderBy = "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_DEFAULT_ASC" | "IS_DEFAULT_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentResourceChunkOrderBy = "AGENT_RESOURCE_ID_ASC" | "AGENT_RESOURCE_ID_DESC" | "BODY_ASC" | "BODY_DESC" | "CHUNK_INDEX_ASC" | "CHUNK_INDEX_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EMBEDDING_ASC" | "EMBEDDING_DESC" | "EMBEDDING_VECTOR_DISTANCE_ASC" | "EMBEDDING_VECTOR_DISTANCE_DESC" | "ID_ASC" | "ID_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentResourceOrderBy = "ARCHIVED_AT_ASC" | "ARCHIVED_AT_DESC" | "BODY_ASC" | "BODY_DESC" | "BODY_TRGM_SIMILARITY_ASC" | "BODY_TRGM_SIMILARITY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DESCRIPTION_TRGM_SIMILARITY_ASC" | "DESCRIPTION_TRGM_SIMILARITY_DESC" | "EMBEDDING_ASC" | "EMBEDDING_DESC" | "EMBEDDING_UPDATED_AT_ASC" | "EMBEDDING_UPDATED_AT_DESC" | "EMBEDDING_VECTOR_DISTANCE_ASC" | "EMBEDDING_VECTOR_DISTANCE_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_ARCHIVED_ASC" | "IS_ARCHIVED_DESC" | "KEYWORDS_ASC" | "KEYWORDS_DESC" | "KIND_ASC" | "KIND_DESC" | "KIND_TRGM_SIMILARITY_ASC" | "KIND_TRGM_SIMILARITY_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_ASC" | "SEARCH_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "SEARCH_TSV_RANK_ASC" | "SEARCH_TSV_RANK_DESC" | "SLUG_ASC" | "SLUG_DESC" | "TITLE_ASC" | "TITLE_DESC" | "TITLE_TRGM_SIMILARITY_ASC" | "TITLE_TRGM_SIMILARITY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type AgentTaskOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "APPROVAL_FEEDBACK_ASC" | "APPROVAL_FEEDBACK_DESC" | "APPROVAL_STATUS_ASC" | "APPROVAL_STATUS_DESC" | "APPROVED_AT_ASC" | "APPROVED_AT_DESC" | "APPROVED_BY_ASC" | "APPROVED_BY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORDER_INDEX_ASC" | "ORDER_INDEX_DESC" | "PLAN_ID_ASC" | "PLAN_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRES_APPROVAL_ASC" | "REQUIRES_APPROVAL_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AgentThreadOrderBy = "AGENT_ID_ASC" | "AGENT_ID_DESC" | "ARCHIVED_AT_ASC" | "ARCHIVED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ARCHIVED_ASC" | "IS_ARCHIVED_DESC" | "MODEL_ASC" | "MODEL_DESC" | "MODE_ASC" | "MODE_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PARENT_THREAD_ID_ASC" | "PARENT_THREAD_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROMPT_TEMPLATE_ID_ASC" | "PROMPT_TEMPLATE_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SYSTEM_PROMPT_ASC" | "SYSTEM_PROMPT_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type AgentOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_EPHEMERAL_ASC' + | 'IS_EPHEMERAL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PARENT_ID_ASC' + | 'PARENT_ID_DESC' + | 'PERSONA_ID_ASC' + | 'PERSONA_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentMessageOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AGENT_ID_ASC' + | 'AGENT_ID_DESC' + | 'AUTHOR_ROLE_ASC' + | 'AUTHOR_ROLE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MODEL_ASC' + | 'MODEL_DESC' + | 'NATURAL' + | 'PARTS_ASC' + | 'PARTS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'THREAD_ID_ASC' + | 'THREAD_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentPersonaOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentPlanOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'THREAD_ID_ASC' + | 'THREAD_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentPromptOrderBy = + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_DEFAULT_ASC' + | 'IS_DEFAULT_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentResourceChunkOrderBy = + | 'AGENT_RESOURCE_ID_ASC' + | 'AGENT_RESOURCE_ID_DESC' + | 'BODY_ASC' + | 'BODY_DESC' + | 'CHUNK_INDEX_ASC' + | 'CHUNK_INDEX_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EMBEDDING_ASC' + | 'EMBEDDING_DESC' + | 'EMBEDDING_VECTOR_DISTANCE_ASC' + | 'EMBEDDING_VECTOR_DISTANCE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentResourceOrderBy = + | 'ARCHIVED_AT_ASC' + | 'ARCHIVED_AT_DESC' + | 'BODY_ASC' + | 'BODY_DESC' + | 'BODY_TRGM_SIMILARITY_ASC' + | 'BODY_TRGM_SIMILARITY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DESCRIPTION_TRGM_SIMILARITY_ASC' + | 'DESCRIPTION_TRGM_SIMILARITY_DESC' + | 'EMBEDDING_ASC' + | 'EMBEDDING_DESC' + | 'EMBEDDING_UPDATED_AT_ASC' + | 'EMBEDDING_UPDATED_AT_DESC' + | 'EMBEDDING_VECTOR_DISTANCE_ASC' + | 'EMBEDDING_VECTOR_DISTANCE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_ARCHIVED_ASC' + | 'IS_ARCHIVED_DESC' + | 'KEYWORDS_ASC' + | 'KEYWORDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'KIND_TRGM_SIMILARITY_ASC' + | 'KIND_TRGM_SIMILARITY_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_ASC' + | 'SEARCH_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'SEARCH_TSV_RANK_ASC' + | 'SEARCH_TSV_RANK_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'TITLE_TRGM_SIMILARITY_ASC' + | 'TITLE_TRGM_SIMILARITY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type AgentTaskOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'APPROVAL_FEEDBACK_ASC' + | 'APPROVAL_FEEDBACK_DESC' + | 'APPROVAL_STATUS_ASC' + | 'APPROVAL_STATUS_DESC' + | 'APPROVED_AT_ASC' + | 'APPROVED_AT_DESC' + | 'APPROVED_BY_ASC' + | 'APPROVED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORDER_INDEX_ASC' + | 'ORDER_INDEX_DESC' + | 'PLAN_ID_ASC' + | 'PLAN_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRES_APPROVAL_ASC' + | 'REQUIRES_APPROVAL_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AgentThreadOrderBy = + | 'AGENT_ID_ASC' + | 'AGENT_ID_DESC' + | 'ARCHIVED_AT_ASC' + | 'ARCHIVED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ARCHIVED_ASC' + | 'IS_ARCHIVED_DESC' + | 'MODEL_ASC' + | 'MODEL_DESC' + | 'MODE_ASC' + | 'MODE_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PARENT_THREAD_ID_ASC' + | 'PARENT_THREAD_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROMPT_TEMPLATE_ID_ASC' + | 'PROMPT_TEMPLATE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SYSTEM_PROMPT_ASC' + | 'SYSTEM_PROMPT_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateAgentInput { clientMutationId?: string; @@ -1483,28 +1756,28 @@ export interface DeleteAgentThreadInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Agent": { - "agentMessages": "AgentMessage", - "agentThreads": "AgentThread", - "childAgents": "Agent" + Agent: { + agentMessages: 'AgentMessage', + agentThreads: 'AgentThread', + childAgents: 'Agent', }, - "AgentPersona": { - "agentsByPersonaId": "Agent" + AgentPersona: { + agentsByPersonaId: 'Agent', }, - "AgentPlan": { - "agentTasksByPlanId": "AgentTask" + AgentPlan: { + agentTasksByPlanId: 'AgentTask', }, - "AgentPrompt": { - "agentThreadsByPromptTemplateId": "AgentThread" + AgentPrompt: { + agentThreadsByPromptTemplateId: 'AgentThread', }, - "AgentResource": { - "agentResourceChunks": "AgentResourceChunk" + AgentResource: { + agentResourceChunks: 'AgentResourceChunk', + }, + AgentThread: { + agentMessagesByThreadId: 'AgentMessage', + agentPlansByThreadId: 'AgentPlan', + agentThreadsByParentThreadId: 'AgentThread', }, - "AgentThread": { - "agentMessagesByThreadId": "AgentMessage", - "agentPlansByThreadId": "AgentPlan", - "agentThreadsByParentThreadId": "AgentThread" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -2121,7 +2394,7 @@ export interface AgentTaskFilter { updatedAt?: DatetimeFilter; } /** Similarity metric for vector search */ -export type VectorMetric = "COSINE" | "IP" | "L2"; +export type VectorMetric = 'COSINE' | 'IP' | 'L2'; /** A filter to be used against `AgentResourceChunk` object types. All fields are combined with a logical ‘and.’ */ export interface AgentResourceChunkFilter { /** Filter by the object’s `agentResource` relation. */ @@ -3151,4 +3424,4 @@ export type AgentThreadEdgeSelect = { node?: { select: AgentThreadSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/agent/orm/models/agent.ts b/sdk/constructive-sdk/src/agent/orm/models/agent.ts index bf8233944a..72f4b04da0 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agent.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agent.ts @@ -3,56 +3,96 @@ * @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 { Agent, AgentWithRelations, AgentSelect, AgentFilter, AgentOrderBy, CreateAgentInput, UpdateAgentInput, AgentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Agent, + AgentWithRelations, + AgentSelect, + AgentFilter, + AgentOrderBy, + CreateAgentInput, + UpdateAgentInput, + AgentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Agent", "agents", 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 - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Agent', + 'agents', + 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, + }, + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agents", + operation: 'query', + operationName: 'Agent', + fieldName: 'agents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Agent", "agents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Agent', + 'agents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agent", + operation: 'query', + operationName: 'Agent', + fieldName: 'agent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentModel { nodes?: InferSelectResult[]; }; }) => ({ - "agent": data.agents?.nodes?.[0] ?? null - }) + agent: data.agents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Agent", "agents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Agent', + 'agents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentFilter", "AgentOrderBy", connectionFieldsMap); + 'AgentFilter', + 'AgentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Agent", - fieldName: "agent", + operation: 'query', + operationName: 'Agent', + fieldName: 'agent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentModel { nodes?: InferSelectResult[]; }; }) => ({ - "agent": data.agents?.nodes?.[0] ?? null - }) + agent: data.agents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Agent", "createAgent", "agent", args.select, args.data, "CreateAgentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Agent', + 'createAgent', + 'agent', + args.select, + args.data, + 'CreateAgentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "createAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'createAgent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Agent", "updateAgent", "agent", args.select, args.where.id, args.data, "UpdateAgentInput", "id", "agentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Agent', + 'updateAgent', + 'agent', + args.select, + args.where.id, + args.data, + 'UpdateAgentInput', + 'id', + 'agentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "updateAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'updateAgent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgent: { agent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Agent", "deleteAgent", "agent", { - id: args.where.id - }, "DeleteAgentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Agent', + 'deleteAgent', + 'agent', + { + id: args.where.id, + }, + 'DeleteAgentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Agent", - fieldName: "deleteAgent", + operation: 'mutation', + operationName: 'Agent', + fieldName: 'deleteAgent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentMessage.ts b/sdk/constructive-sdk/src/agent/orm/models/agentMessage.ts index 68995cfcec..ffa3a09734 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentMessage.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentMessage.ts @@ -3,56 +3,96 @@ * @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 { AgentMessage, AgentMessageWithRelations, AgentMessageSelect, AgentMessageFilter, AgentMessageOrderBy, CreateAgentMessageInput, UpdateAgentMessageInput, AgentMessagePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentMessage, + AgentMessageWithRelations, + AgentMessageSelect, + AgentMessageFilter, + AgentMessageOrderBy, + CreateAgentMessageInput, + UpdateAgentMessageInput, + AgentMessagePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentMessageModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessages: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentMessage", "agentMessages", 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 - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentMessage', + 'agentMessages', + 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, + }, + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessages", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessages', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessage: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentMessage", "agentMessages", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentMessage', + 'agentMessages', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessage", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessage', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentMessageModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentMessage": data.agentMessages?.nodes?.[0] ?? null - }) + agentMessage: data.agentMessages?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentMessage: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentMessage", "agentMessages", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentMessage', + 'agentMessages', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentMessageFilter", "AgentMessageOrderBy", connectionFieldsMap); + 'AgentMessageFilter', + 'AgentMessageOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentMessage", - fieldName: "agentMessage", + operation: 'query', + operationName: 'AgentMessage', + fieldName: 'agentMessage', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentMessageModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentMessage": data.agentMessages?.nodes?.[0] ?? null - }) + agentMessage: data.agentMessages?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentMessage", "createAgentMessage", "agentMessage", args.select, args.data, "CreateAgentMessageInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentMessage', + 'createAgentMessage', + 'agentMessage', + args.select, + args.data, + 'CreateAgentMessageInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "createAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'createAgentMessage', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentMessagePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentMessage", "updateAgentMessage", "agentMessage", args.select, args.where.id, args.data, "UpdateAgentMessageInput", "id", "agentMessagePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentMessage', + 'updateAgentMessage', + 'agentMessage', + args.select, + args.where.id, + args.data, + 'UpdateAgentMessageInput', + 'id', + 'agentMessagePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "updateAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'updateAgentMessage', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentMessage: { agentMessage: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentMessage", "deleteAgentMessage", "agentMessage", { - id: args.where.id - }, "DeleteAgentMessageInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentMessage', + 'deleteAgentMessage', + 'agentMessage', + { + id: args.where.id, + }, + 'DeleteAgentMessageInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentMessage", - fieldName: "deleteAgentMessage", + operation: 'mutation', + operationName: 'AgentMessage', + fieldName: 'deleteAgentMessage', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentPersona.ts b/sdk/constructive-sdk/src/agent/orm/models/agentPersona.ts index 4d25d25806..1391dbde2c 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentPersona.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentPersona.ts @@ -3,56 +3,96 @@ * @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 { AgentPersona, AgentPersonaWithRelations, AgentPersonaSelect, AgentPersonaFilter, AgentPersonaOrderBy, CreateAgentPersonaInput, UpdateAgentPersonaInput, AgentPersonaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPersona, + AgentPersonaWithRelations, + AgentPersonaSelect, + AgentPersonaFilter, + AgentPersonaOrderBy, + CreateAgentPersonaInput, + UpdateAgentPersonaInput, + AgentPersonaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPersonaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersonas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPersona", "agentPersonas", 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 - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPersona', + 'agentPersonas', + 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, + }, + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersonas", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersonas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersona: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPersona", "agentPersonas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPersona', + 'agentPersonas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersona", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersona', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPersonaModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPersona": data.agentPersonas?.nodes?.[0] ?? null - }) + agentPersona: data.agentPersonas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPersona: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPersona", "agentPersonas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPersona', + 'agentPersonas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPersonaFilter", "AgentPersonaOrderBy", connectionFieldsMap); + 'AgentPersonaFilter', + 'AgentPersonaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPersona", - fieldName: "agentPersona", + operation: 'query', + operationName: 'AgentPersona', + fieldName: 'agentPersona', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPersonaModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPersona": data.agentPersonas?.nodes?.[0] ?? null - }) + agentPersona: data.agentPersonas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPersona", "createAgentPersona", "agentPersona", args.select, args.data, "CreateAgentPersonaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPersona', + 'createAgentPersona', + 'agentPersona', + args.select, + args.data, + 'CreateAgentPersonaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "createAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'createAgentPersona', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPersonaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPersona", "updateAgentPersona", "agentPersona", args.select, args.where.id, args.data, "UpdateAgentPersonaInput", "id", "agentPersonaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPersona', + 'updateAgentPersona', + 'agentPersona', + args.select, + args.where.id, + args.data, + 'UpdateAgentPersonaInput', + 'id', + 'agentPersonaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "updateAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'updateAgentPersona', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPersona: { agentPersona: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPersona", "deleteAgentPersona", "agentPersona", { - id: args.where.id - }, "DeleteAgentPersonaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPersona', + 'deleteAgentPersona', + 'agentPersona', + { + id: args.where.id, + }, + 'DeleteAgentPersonaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPersona", - fieldName: "deleteAgentPersona", + operation: 'mutation', + operationName: 'AgentPersona', + fieldName: 'deleteAgentPersona', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentPlan.ts b/sdk/constructive-sdk/src/agent/orm/models/agentPlan.ts index 7c2939a364..9829718fee 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentPlan.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentPlan.ts @@ -3,56 +3,96 @@ * @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 { AgentPlan, AgentPlanWithRelations, AgentPlanSelect, AgentPlanFilter, AgentPlanOrderBy, CreateAgentPlanInput, UpdateAgentPlanInput, AgentPlanPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPlan, + AgentPlanWithRelations, + AgentPlanSelect, + AgentPlanFilter, + AgentPlanOrderBy, + CreateAgentPlanInput, + UpdateAgentPlanInput, + AgentPlanPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPlanModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlans: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPlan", "agentPlans", 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 - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPlan', + 'agentPlans', + 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, + }, + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlans", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlans', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlan: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPlan", "agentPlans", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPlan', + 'agentPlans', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlan", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlan', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPlanModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPlan": data.agentPlans?.nodes?.[0] ?? null - }) + agentPlan: data.agentPlans?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPlan: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPlan", "agentPlans", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPlan', + 'agentPlans', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPlanFilter", "AgentPlanOrderBy", connectionFieldsMap); + 'AgentPlanFilter', + 'AgentPlanOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPlan", - fieldName: "agentPlan", + operation: 'query', + operationName: 'AgentPlan', + fieldName: 'agentPlan', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPlanModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPlan": data.agentPlans?.nodes?.[0] ?? null - }) + agentPlan: data.agentPlans?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPlan", "createAgentPlan", "agentPlan", args.select, args.data, "CreateAgentPlanInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPlan', + 'createAgentPlan', + 'agentPlan', + args.select, + args.data, + 'CreateAgentPlanInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "createAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'createAgentPlan', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPlanPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPlan", "updateAgentPlan", "agentPlan", args.select, args.where.id, args.data, "UpdateAgentPlanInput", "id", "agentPlanPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPlan', + 'updateAgentPlan', + 'agentPlan', + args.select, + args.where.id, + args.data, + 'UpdateAgentPlanInput', + 'id', + 'agentPlanPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "updateAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'updateAgentPlan', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPlan: { agentPlan: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPlan", "deleteAgentPlan", "agentPlan", { - id: args.where.id - }, "DeleteAgentPlanInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPlan', + 'deleteAgentPlan', + 'agentPlan', + { + id: args.where.id, + }, + 'DeleteAgentPlanInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPlan", - fieldName: "deleteAgentPlan", + operation: 'mutation', + operationName: 'AgentPlan', + fieldName: 'deleteAgentPlan', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentPrompt.ts b/sdk/constructive-sdk/src/agent/orm/models/agentPrompt.ts index 7d63959a91..e301bf6c99 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentPrompt.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentPrompt.ts @@ -3,56 +3,96 @@ * @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 { AgentPrompt, AgentPromptWithRelations, AgentPromptSelect, AgentPromptFilter, AgentPromptOrderBy, CreateAgentPromptInput, UpdateAgentPromptInput, AgentPromptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentPrompt, + AgentPromptWithRelations, + AgentPromptSelect, + AgentPromptFilter, + AgentPromptOrderBy, + CreateAgentPromptInput, + UpdateAgentPromptInput, + AgentPromptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentPromptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompts: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPrompt", "agentPrompts", 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 - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentPrompt', + 'agentPrompts', + 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, + }, + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompts", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentPrompt", "agentPrompts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentPrompt', + 'agentPrompts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompt", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompt', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentPromptModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPrompt": data.agentPrompts?.nodes?.[0] ?? null - }) + agentPrompt: data.agentPrompts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentPrompt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentPrompt", "agentPrompts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentPrompt', + 'agentPrompts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentPromptFilter", "AgentPromptOrderBy", connectionFieldsMap); + 'AgentPromptFilter', + 'AgentPromptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentPrompt", - fieldName: "agentPrompt", + operation: 'query', + operationName: 'AgentPrompt', + fieldName: 'agentPrompt', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentPromptModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentPrompt": data.agentPrompts?.nodes?.[0] ?? null - }) + agentPrompt: data.agentPrompts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentPrompt", "createAgentPrompt", "agentPrompt", args.select, args.data, "CreateAgentPromptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentPrompt', + 'createAgentPrompt', + 'agentPrompt', + args.select, + args.data, + 'CreateAgentPromptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "createAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'createAgentPrompt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentPromptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentPrompt", "updateAgentPrompt", "agentPrompt", args.select, args.where.id, args.data, "UpdateAgentPromptInput", "id", "agentPromptPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentPrompt', + 'updateAgentPrompt', + 'agentPrompt', + args.select, + args.where.id, + args.data, + 'UpdateAgentPromptInput', + 'id', + 'agentPromptPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "updateAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'updateAgentPrompt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentPrompt: { agentPrompt: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentPrompt", "deleteAgentPrompt", "agentPrompt", { - id: args.where.id - }, "DeleteAgentPromptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentPrompt', + 'deleteAgentPrompt', + 'agentPrompt', + { + id: args.where.id, + }, + 'DeleteAgentPromptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentPrompt", - fieldName: "deleteAgentPrompt", + operation: 'mutation', + operationName: 'AgentPrompt', + fieldName: 'deleteAgentPrompt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentResource.ts b/sdk/constructive-sdk/src/agent/orm/models/agentResource.ts index 3dc0e3ad1e..7628b03b3c 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentResource.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentResource.ts @@ -3,56 +3,96 @@ * @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 { AgentResource, AgentResourceWithRelations, AgentResourceSelect, AgentResourceFilter, AgentResourceOrderBy, CreateAgentResourceInput, UpdateAgentResourceInput, AgentResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentResource, + AgentResourceWithRelations, + AgentResourceSelect, + AgentResourceFilter, + AgentResourceOrderBy, + CreateAgentResourceInput, + UpdateAgentResourceInput, + AgentResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResource", "agentResources", 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 - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentResource', + 'agentResources', + 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, + }, + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResources", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentResource", "agentResources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentResource', + 'agentResources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResource", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResource": data.agentResources?.nodes?.[0] ?? null - }) + agentResource: data.agentResources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResource", "agentResources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentResource', + 'agentResources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentResourceFilter", "AgentResourceOrderBy", connectionFieldsMap); + 'AgentResourceFilter', + 'AgentResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResource", - fieldName: "agentResource", + operation: 'query', + operationName: 'AgentResource', + fieldName: 'agentResource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResource": data.agentResources?.nodes?.[0] ?? null - }) + agentResource: data.agentResources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentResource", "createAgentResource", "agentResource", args.select, args.data, "CreateAgentResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentResource', + 'createAgentResource', + 'agentResource', + args.select, + args.data, + 'CreateAgentResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "createAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'createAgentResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentResource", "updateAgentResource", "agentResource", args.select, args.where.id, args.data, "UpdateAgentResourceInput", "id", "agentResourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentResource', + 'updateAgentResource', + 'agentResource', + args.select, + args.where.id, + args.data, + 'UpdateAgentResourceInput', + 'id', + 'agentResourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "updateAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'updateAgentResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentResource: { agentResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentResource", "deleteAgentResource", "agentResource", { - id: args.where.id - }, "DeleteAgentResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentResource', + 'deleteAgentResource', + 'agentResource', + { + id: args.where.id, + }, + 'DeleteAgentResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResource", - fieldName: "deleteAgentResource", + operation: 'mutation', + operationName: 'AgentResource', + fieldName: 'deleteAgentResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentResourceChunk.ts b/sdk/constructive-sdk/src/agent/orm/models/agentResourceChunk.ts index 49158ba880..fd5edf82ac 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentResourceChunk.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentResourceChunk.ts @@ -3,56 +3,96 @@ * @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 { AgentResourceChunk, AgentResourceChunkWithRelations, AgentResourceChunkSelect, AgentResourceChunkFilter, AgentResourceChunkOrderBy, CreateAgentResourceChunkInput, UpdateAgentResourceChunkInput, AgentResourceChunkPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentResourceChunk, + AgentResourceChunkWithRelations, + AgentResourceChunkSelect, + AgentResourceChunkFilter, + AgentResourceChunkOrderBy, + CreateAgentResourceChunkInput, + UpdateAgentResourceChunkInput, + AgentResourceChunkPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentResourceChunkModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResourceChunk", "agentResourceChunks", 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 - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + 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, + }, + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunks", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentResourceChunk", "agentResourceChunks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunk", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunk', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentResourceChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResourceChunk": data.agentResourceChunks?.nodes?.[0] ?? null - }) + agentResourceChunk: data.agentResourceChunks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentResourceChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentResourceChunk", "agentResourceChunks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentResourceChunk', + 'agentResourceChunks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentResourceChunkFilter", "AgentResourceChunkOrderBy", connectionFieldsMap); + 'AgentResourceChunkFilter', + 'AgentResourceChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentResourceChunk", - fieldName: "agentResourceChunk", + operation: 'query', + operationName: 'AgentResourceChunk', + fieldName: 'agentResourceChunk', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentResourceChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentResourceChunk": data.agentResourceChunks?.nodes?.[0] ?? null - }) + agentResourceChunk: data.agentResourceChunks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentResourceChunk", "createAgentResourceChunk", "agentResourceChunk", args.select, args.data, "CreateAgentResourceChunkInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentResourceChunk', + 'createAgentResourceChunk', + 'agentResourceChunk', + args.select, + args.data, + 'CreateAgentResourceChunkInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "createAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'createAgentResourceChunk', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentResourceChunkPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentResourceChunk", "updateAgentResourceChunk", "agentResourceChunk", args.select, args.where.id, args.data, "UpdateAgentResourceChunkInput", "id", "agentResourceChunkPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentResourceChunk', + 'updateAgentResourceChunk', + 'agentResourceChunk', + args.select, + args.where.id, + args.data, + 'UpdateAgentResourceChunkInput', + 'id', + 'agentResourceChunkPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "updateAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'updateAgentResourceChunk', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentResourceChunk: { agentResourceChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentResourceChunk", "deleteAgentResourceChunk", "agentResourceChunk", { - id: args.where.id - }, "DeleteAgentResourceChunkInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentResourceChunk', + 'deleteAgentResourceChunk', + 'agentResourceChunk', + { + id: args.where.id, + }, + 'DeleteAgentResourceChunkInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentResourceChunk", - fieldName: "deleteAgentResourceChunk", + operation: 'mutation', + operationName: 'AgentResourceChunk', + fieldName: 'deleteAgentResourceChunk', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentTask.ts b/sdk/constructive-sdk/src/agent/orm/models/agentTask.ts index 6eabf7f118..a4b3a1e367 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentTask.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentTask.ts @@ -3,56 +3,96 @@ * @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 { AgentTask, AgentTaskWithRelations, AgentTaskSelect, AgentTaskFilter, AgentTaskOrderBy, CreateAgentTaskInput, UpdateAgentTaskInput, AgentTaskPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentTask, + AgentTaskWithRelations, + AgentTaskSelect, + AgentTaskFilter, + AgentTaskOrderBy, + CreateAgentTaskInput, + UpdateAgentTaskInput, + AgentTaskPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentTaskModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTasks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentTask", "agentTasks", 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 - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentTask', + 'agentTasks', + 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, + }, + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTasks", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTasks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTask: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentTask", "agentTasks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentTask', + 'agentTasks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTask", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTask', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentTaskModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentTask": data.agentTasks?.nodes?.[0] ?? null - }) + agentTask: data.agentTasks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentTask: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentTask", "agentTasks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentTask', + 'agentTasks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentTaskFilter", "AgentTaskOrderBy", connectionFieldsMap); + 'AgentTaskFilter', + 'AgentTaskOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentTask", - fieldName: "agentTask", + operation: 'query', + operationName: 'AgentTask', + fieldName: 'agentTask', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentTaskModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentTask": data.agentTasks?.nodes?.[0] ?? null - }) + agentTask: data.agentTasks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentTask", "createAgentTask", "agentTask", args.select, args.data, "CreateAgentTaskInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentTask', + 'createAgentTask', + 'agentTask', + args.select, + args.data, + 'CreateAgentTaskInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "createAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'createAgentTask', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentTaskPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentTask", "updateAgentTask", "agentTask", args.select, args.where.id, args.data, "UpdateAgentTaskInput", "id", "agentTaskPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentTask', + 'updateAgentTask', + 'agentTask', + args.select, + args.where.id, + args.data, + 'UpdateAgentTaskInput', + 'id', + 'agentTaskPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "updateAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'updateAgentTask', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentTask: { agentTask: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentTask", "deleteAgentTask", "agentTask", { - id: args.where.id - }, "DeleteAgentTaskInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentTask', + 'deleteAgentTask', + 'agentTask', + { + id: args.where.id, + }, + 'DeleteAgentTaskInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentTask", - fieldName: "deleteAgentTask", + operation: 'mutation', + operationName: 'AgentTask', + fieldName: 'deleteAgentTask', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentThread.ts b/sdk/constructive-sdk/src/agent/orm/models/agentThread.ts index 6f1a410252..1ae2eb5a67 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentThread.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentThread.ts @@ -3,56 +3,96 @@ * @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 { AgentThread, AgentThreadWithRelations, AgentThreadSelect, AgentThreadFilter, AgentThreadOrderBy, CreateAgentThreadInput, UpdateAgentThreadInput, AgentThreadPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentThread, + AgentThreadWithRelations, + AgentThreadSelect, + AgentThreadFilter, + AgentThreadOrderBy, + CreateAgentThreadInput, + UpdateAgentThreadInput, + AgentThreadPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentThreadModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThreads: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentThread", "agentThreads", 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 - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentThread', + 'agentThreads', + 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, + }, + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThreads", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThreads', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThread: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentThread", "agentThreads", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentThread', + 'agentThreads', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThread", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThread', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentThreadModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentThread": data.agentThreads?.nodes?.[0] ?? null - }) + agentThread: data.agentThreads?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentThread: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentThread", "agentThreads", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentThread', + 'agentThreads', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentThreadFilter", "AgentThreadOrderBy", connectionFieldsMap); + 'AgentThreadFilter', + 'AgentThreadOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentThread", - fieldName: "agentThread", + operation: 'query', + operationName: 'AgentThread', + fieldName: 'agentThread', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentThreadModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentThread": data.agentThreads?.nodes?.[0] ?? null - }) + agentThread: data.agentThreads?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentThread", "createAgentThread", "agentThread", args.select, args.data, "CreateAgentThreadInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentThread', + 'createAgentThread', + 'agentThread', + args.select, + args.data, + 'CreateAgentThreadInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "createAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'createAgentThread', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentThreadPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentThread", "updateAgentThread", "agentThread", args.select, args.where.id, args.data, "UpdateAgentThreadInput", "id", "agentThreadPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentThread', + 'updateAgentThread', + 'agentThread', + args.select, + args.where.id, + args.data, + 'UpdateAgentThreadInput', + 'id', + 'agentThreadPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "updateAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'updateAgentThread', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentThread: { agentThread: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentThread", "deleteAgentThread", "agentThread", { - id: args.where.id - }, "DeleteAgentThreadInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentThread', + 'deleteAgentThread', + 'agentThread', + { + id: args.where.id, + }, + 'DeleteAgentThreadInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentThread", - fieldName: "deleteAgentThread", + operation: 'mutation', + operationName: 'AgentThread', + fieldName: 'deleteAgentThread', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/models/index.ts b/sdk/constructive-sdk/src/agent/orm/models/index.ts index b0397fe3ec..4d02471c8a 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/index.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/index.ts @@ -3,12 +3,12 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AgentModel } from "./agent"; -export { AgentMessageModel } from "./agentMessage"; -export { AgentPersonaModel } from "./agentPersona"; -export { AgentPlanModel } from "./agentPlan"; -export { AgentPromptModel } from "./agentPrompt"; -export { AgentResourceChunkModel } from "./agentResourceChunk"; -export { AgentResourceModel } from "./agentResource"; -export { AgentTaskModel } from "./agentTask"; -export { AgentThreadModel } from "./agentThread"; \ No newline at end of file +export { AgentModel } from './agent'; +export { AgentMessageModel } from './agentMessage'; +export { AgentPersonaModel } from './agentPersona'; +export { AgentPlanModel } from './agentPlan'; +export { AgentPromptModel } from './agentPrompt'; +export { AgentResourceChunkModel } from './agentResourceChunk'; +export { AgentResourceModel } from './agentResource'; +export { AgentTaskModel } from './agentTask'; +export { AgentThreadModel } from './agentThread'; diff --git a/sdk/constructive-sdk/src/agent/orm/mutation/index.ts b/sdk/constructive-sdk/src/agent/orm/mutation/index.ts index 1e981b094d..989afbcbd6 100644 --- a/sdk/constructive-sdk/src/agent/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/agent/orm/mutation/index.ts @@ -3,11 +3,15 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, ProvisionBucketPayload, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + ProvisionBucketPayload, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -20,19 +24,34 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/agent/orm/query-builder.ts b/sdk/constructive-sdk/src/agent/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/agent/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/agent/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/agent/orm/realtime.ts b/sdk/constructive-sdk/src/agent/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/agent/orm/realtime.ts +++ b/sdk/constructive-sdk/src/agent/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/agent/orm/select-types.ts b/sdk/constructive-sdk/src/agent/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/agent/orm/select-types.ts +++ b/sdk/constructive-sdk/src/agent/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/api/index.ts b/sdk/constructive-sdk/src/api/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/api/index.ts +++ b/sdk/constructive-sdk/src/api/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/api/orm/client.ts b/sdk/constructive-sdk/src/api/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/api/orm/client.ts +++ b/sdk/constructive-sdk/src/api/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/api/orm/index.ts b/sdk/constructive-sdk/src/api/orm/index.ts index f2e5d03590..daef0c9123 100644 --- a/sdk/constructive-sdk/src/api/orm/index.ts +++ b/sdk/constructive-sdk/src/api/orm/index.ts @@ -3,82 +3,82 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { ApiModel } from "./models/api"; -import { ApiModuleModel } from "./models/apiModule"; -import { ApiSchemaModel } from "./models/apiSchema"; -import { ApiSettingModel } from "./models/apiSetting"; -import { AstMigrationModel } from "./models/astMigration"; -import { CheckConstraintModel } from "./models/checkConstraint"; -import { CompositeTypeModel } from "./models/compositeType"; -import { CorsSettingModel } from "./models/corsSetting"; -import { DatabaseModel } from "./models/database"; -import { DatabaseSettingModel } from "./models/databaseSetting"; -import { DatabaseTransferModel } from "./models/databaseTransfer"; -import { DefaultPrivilegeModel } from "./models/defaultPrivilege"; -import { DomainModel } from "./models/domain"; -import { DomainEventModel } from "./models/domainEvent"; -import { DomainVerificationModel } from "./models/domainVerification"; -import { EmbeddingChunkModel } from "./models/embeddingChunk"; -import { EnumModel } from "./models/enum"; -import { ExclusionConstraintModel } from "./models/exclusionConstraint"; -import { FieldModel } from "./models/field"; -import { ForeignKeyConstraintModel } from "./models/foreignKeyConstraint"; -import { FullTextSearchModel } from "./models/fullTextSearch"; -import { FunctionModel } from "./models/function"; -import { HostnameBindingModel } from "./models/hostnameBinding"; -import { HttpRouteModel } from "./models/httpRoute"; -import { IndexModel } from "./models/index"; -import { ManagedDomainModel } from "./models/managedDomain"; -import { NodeTypeRegistryModel } from "./models/nodeTypeRegistry"; -import { PartitionModel } from "./models/partition"; -import { PlatformApiModel } from "./models/platformApi"; -import { PlatformApiModuleModel } from "./models/platformApiModule"; -import { PlatformApiSchemaModel } from "./models/platformApiSchema"; -import { PlatformApiSettingModel } from "./models/platformApiSetting"; -import { PlatformCorsSettingModel } from "./models/platformCorsSetting"; -import { PlatformDomainModel } from "./models/platformDomain"; -import { PlatformDomainEventModel } from "./models/platformDomainEvent"; -import { PlatformDomainVerificationModel } from "./models/platformDomainVerification"; -import { PlatformManagedDomainModel } from "./models/platformManagedDomain"; -import { PlatformSiteModel } from "./models/platformSite"; -import { PlatformSiteMetadatumModel } from "./models/platformSiteMetadatum"; -import { PlatformSiteModuleModel } from "./models/platformSiteModule"; -import { PlatformSiteThemeModel } from "./models/platformSiteTheme"; -import { PolicyModel } from "./models/policy"; -import { PrimaryKeyConstraintModel } from "./models/primaryKeyConstraint"; -import { PubkeySettingModel } from "./models/pubkeySetting"; -import { RlsSettingModel } from "./models/rlsSetting"; -import { RouteBindingModel } from "./models/routeBinding"; -import { RouteModel } from "./models/route"; -import { SchemaModel } from "./models/schema"; -import { SchemaGrantModel } from "./models/schemaGrant"; -import { SiteModel } from "./models/site"; -import { SiteMetadatumModel } from "./models/siteMetadatum"; -import { SiteModuleModel } from "./models/siteModule"; -import { SiteThemeModel } from "./models/siteTheme"; -import { SpatialRelationModel } from "./models/spatialRelation"; -import { SqlActionModel } from "./models/sqlAction"; -import { TableModel } from "./models/table"; -import { TableGrantModel } from "./models/tableGrant"; -import { TriggerModel } from "./models/trigger"; -import { TriggerFunctionModel } from "./models/triggerFunction"; -import { UniqueConstraintModel } from "./models/uniqueConstraint"; -import { ViewModel } from "./models/view"; -import { ViewGrantModel } from "./models/viewGrant"; -import { ViewRuleModel } from "./models/viewRule"; -import { ViewTableModel } from "./models/viewTable"; -import { WebauthnSettingModel } from "./models/webauthnSetting"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { ApiModel } from './models/api'; +import { ApiModuleModel } from './models/apiModule'; +import { ApiSchemaModel } from './models/apiSchema'; +import { ApiSettingModel } from './models/apiSetting'; +import { AstMigrationModel } from './models/astMigration'; +import { CheckConstraintModel } from './models/checkConstraint'; +import { CompositeTypeModel } from './models/compositeType'; +import { CorsSettingModel } from './models/corsSetting'; +import { DatabaseModel } from './models/database'; +import { DatabaseSettingModel } from './models/databaseSetting'; +import { DatabaseTransferModel } from './models/databaseTransfer'; +import { DefaultPrivilegeModel } from './models/defaultPrivilege'; +import { DomainModel } from './models/domain'; +import { DomainEventModel } from './models/domainEvent'; +import { DomainVerificationModel } from './models/domainVerification'; +import { EmbeddingChunkModel } from './models/embeddingChunk'; +import { EnumModel } from './models/enum'; +import { ExclusionConstraintModel } from './models/exclusionConstraint'; +import { FieldModel } from './models/field'; +import { ForeignKeyConstraintModel } from './models/foreignKeyConstraint'; +import { FullTextSearchModel } from './models/fullTextSearch'; +import { FunctionModel } from './models/function'; +import { HostnameBindingModel } from './models/hostnameBinding'; +import { HttpRouteModel } from './models/httpRoute'; +import { IndexModel } from './models/index'; +import { ManagedDomainModel } from './models/managedDomain'; +import { NodeTypeRegistryModel } from './models/nodeTypeRegistry'; +import { PartitionModel } from './models/partition'; +import { PlatformApiModel } from './models/platformApi'; +import { PlatformApiModuleModel } from './models/platformApiModule'; +import { PlatformApiSchemaModel } from './models/platformApiSchema'; +import { PlatformApiSettingModel } from './models/platformApiSetting'; +import { PlatformCorsSettingModel } from './models/platformCorsSetting'; +import { PlatformDomainModel } from './models/platformDomain'; +import { PlatformDomainEventModel } from './models/platformDomainEvent'; +import { PlatformDomainVerificationModel } from './models/platformDomainVerification'; +import { PlatformManagedDomainModel } from './models/platformManagedDomain'; +import { PlatformSiteModel } from './models/platformSite'; +import { PlatformSiteMetadatumModel } from './models/platformSiteMetadatum'; +import { PlatformSiteModuleModel } from './models/platformSiteModule'; +import { PlatformSiteThemeModel } from './models/platformSiteTheme'; +import { PolicyModel } from './models/policy'; +import { PrimaryKeyConstraintModel } from './models/primaryKeyConstraint'; +import { PubkeySettingModel } from './models/pubkeySetting'; +import { RlsSettingModel } from './models/rlsSetting'; +import { RouteBindingModel } from './models/routeBinding'; +import { RouteModel } from './models/route'; +import { SchemaModel } from './models/schema'; +import { SchemaGrantModel } from './models/schemaGrant'; +import { SiteModel } from './models/site'; +import { SiteMetadatumModel } from './models/siteMetadatum'; +import { SiteModuleModel } from './models/siteModule'; +import { SiteThemeModel } from './models/siteTheme'; +import { SpatialRelationModel } from './models/spatialRelation'; +import { SqlActionModel } from './models/sqlAction'; +import { TableModel } from './models/table'; +import { TableGrantModel } from './models/tableGrant'; +import { TriggerModel } from './models/trigger'; +import { TriggerFunctionModel } from './models/triggerFunction'; +import { UniqueConstraintModel } from './models/uniqueConstraint'; +import { ViewModel } from './models/view'; +import { ViewGrantModel } from './models/viewGrant'; +import { ViewRuleModel } from './models/viewRule'; +import { ViewTableModel } from './models/viewTable'; +import { WebauthnSettingModel } from './models/webauthnSetting'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -171,6 +171,6 @@ export function createClient(config: OrmClientConfig) { viewTable: new ViewTableModel(client), webauthnSetting: new WebauthnSettingModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/input-types.ts b/sdk/constructive-sdk/src/api/orm/input-types.ts index 5e778de550..4396202b0a 100644 --- a/sdk/constructive-sdk/src/api/orm/input-types.ts +++ b/sdk/constructive-sdk/src/api/orm/input-types.ts @@ -231,8 +231,8 @@ export interface UUIDListFilter { anyGreaterThanOrEqualTo?: string; } // ============ Enum Types ============ -export type ApiExposureLevel = "EXPOSABLE" | "INTERNAL_ONLY" | "NEVER_EXPOSE"; -export type ObjectCategory = "APP" | "AUTH" | "CORE" | "MEMBERSHIPS" | "MODULE" | "PERMISSIONS"; +export type ApiExposureLevel = 'EXPOSABLE' | 'INTERNAL_ONLY' | 'NEVER_EXPOSE'; +export type ObjectCategory = 'APP' | 'AUTH' | 'CORE' | 'MEMBERSHIPS' | 'MODULE' | 'PERMISSIONS'; // ============ Custom Scalar Types ============ export type ConstructiveInternalTypeImage = unknown; /** API surfaces exposed by this scope; publication makes a surface bindable from other scopes */ @@ -1757,7 +1757,8 @@ export type EmbeddingChunkWithRelations = EmbeddingChunk & EmbeddingChunkRelatio export type EnumWithRelations = Enum & EnumRelations; export type ExclusionConstraintWithRelations = ExclusionConstraint & ExclusionConstraintRelations; export type FieldWithRelations = Field & FieldRelations; -export type ForeignKeyConstraintWithRelations = ForeignKeyConstraint & ForeignKeyConstraintRelations; +export type ForeignKeyConstraintWithRelations = ForeignKeyConstraint & + ForeignKeyConstraintRelations; export type FullTextSearchWithRelations = FullTextSearch & FullTextSearchRelations; export type FunctionWithRelations = Function & FunctionRelations; export type HostnameBindingWithRelations = HostnameBinding & HostnameBindingRelations; @@ -1773,14 +1774,18 @@ export type PlatformApiSettingWithRelations = PlatformApiSetting & PlatformApiSe export type PlatformCorsSettingWithRelations = PlatformCorsSetting & PlatformCorsSettingRelations; export type PlatformDomainWithRelations = PlatformDomain & PlatformDomainRelations; export type PlatformDomainEventWithRelations = PlatformDomainEvent & PlatformDomainEventRelations; -export type PlatformDomainVerificationWithRelations = PlatformDomainVerification & PlatformDomainVerificationRelations; -export type PlatformManagedDomainWithRelations = PlatformManagedDomain & PlatformManagedDomainRelations; +export type PlatformDomainVerificationWithRelations = PlatformDomainVerification & + PlatformDomainVerificationRelations; +export type PlatformManagedDomainWithRelations = PlatformManagedDomain & + PlatformManagedDomainRelations; export type PlatformSiteWithRelations = PlatformSite & PlatformSiteRelations; -export type PlatformSiteMetadatumWithRelations = PlatformSiteMetadatum & PlatformSiteMetadatumRelations; +export type PlatformSiteMetadatumWithRelations = PlatformSiteMetadatum & + PlatformSiteMetadatumRelations; export type PlatformSiteModuleWithRelations = PlatformSiteModule & PlatformSiteModuleRelations; export type PlatformSiteThemeWithRelations = PlatformSiteTheme & PlatformSiteThemeRelations; export type PolicyWithRelations = Policy & PolicyRelations; -export type PrimaryKeyConstraintWithRelations = PrimaryKeyConstraint & PrimaryKeyConstraintRelations; +export type PrimaryKeyConstraintWithRelations = PrimaryKeyConstraint & + PrimaryKeyConstraintRelations; export type PubkeySettingWithRelations = PubkeySetting & PubkeySettingRelations; export type RlsSettingWithRelations = RlsSetting & RlsSettingRelations; export type RouteBindingWithRelations = RouteBinding & RouteBindingRelations; @@ -6122,71 +6127,1742 @@ export interface WebauthnSettingFilter { userFieldId?: UUIDFilter; } // ============ OrderBy Types ============ -export type ApiOrderBy = "ANON_ROLE_ASC" | "ANON_ROLE_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DBNAME_ASC" | "DBNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_NAME_ASC" | "ROLE_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiModuleOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiSchemaOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ApiSettingOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type AstMigrationOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYS_ASC" | "DEPLOYS_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REQUIRES_ASC" | "REQUIRES_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; -export type CheckConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EXPR_ASC" | "EXPR_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type CompositeTypeOrderBy = "ATTRIBUTES_ASC" | "ATTRIBUTES_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC"; -export type CorsSettingOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PLATFORM_ASC" | "PLATFORM_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_HASH_ASC" | "SCHEMA_HASH_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseSettingOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseTransferOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "INITIATED_BY_ASC" | "INITIATED_BY_DESC" | "NATURAL" | "NOTES_ASC" | "NOTES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_APPROVED_ASC" | "SOURCE_APPROVED_AT_ASC" | "SOURCE_APPROVED_AT_DESC" | "SOURCE_APPROVED_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TARGET_APPROVED_ASC" | "TARGET_APPROVED_AT_ASC" | "TARGET_APPROVED_AT_DESC" | "TARGET_APPROVED_DESC" | "TARGET_OWNER_ID_ASC" | "TARGET_OWNER_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DefaultPrivilegeOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "OBJECT_TYPE_ASC" | "OBJECT_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type DomainOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type DomainEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "DOMAIN_VERIFICATION_ID_ASC" | "DOMAIN_VERIFICATION_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DomainVerificationOrderBy = "ATTEMPTS_ASC" | "ATTEMPTS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LAST_CHECKED_AT_ASC" | "LAST_CHECKED_AT_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECORD_NAME_ASC" | "RECORD_NAME_DESC" | "RECORD_TYPE_ASC" | "RECORD_TYPE_DESC" | "RECORD_VALUE_ASC" | "RECORD_VALUE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type EmbeddingChunkOrderBy = "CHUNKING_TASK_NAME_ASC" | "CHUNKING_TASK_NAME_DESC" | "CHUNKS_TABLE_ID_ASC" | "CHUNKS_TABLE_ID_DESC" | "CHUNKS_TABLE_NAME_ASC" | "CHUNKS_TABLE_NAME_DESC" | "CHUNK_OVERLAP_ASC" | "CHUNK_OVERLAP_DESC" | "CHUNK_SIZE_ASC" | "CHUNK_SIZE_DESC" | "CHUNK_STRATEGY_ASC" | "CHUNK_STRATEGY_DESC" | "CONTENT_FIELD_NAME_ASC" | "CONTENT_FIELD_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DIMENSIONS_ASC" | "DIMENSIONS_DESC" | "EMBEDDING_FIELD_ID_ASC" | "EMBEDDING_FIELD_ID_DESC" | "EMBEDDING_MODEL_ASC" | "EMBEDDING_MODEL_DESC" | "EMBEDDING_PROVIDER_ASC" | "EMBEDDING_PROVIDER_DESC" | "ENQUEUE_CHUNKING_JOB_ASC" | "ENQUEUE_CHUNKING_JOB_DESC" | "ID_ASC" | "ID_DESC" | "METADATA_FIELDS_ASC" | "METADATA_FIELDS_DESC" | "METRIC_ASC" | "METRIC_DESC" | "NATURAL" | "PARENT_FK_FIELD_ID_ASC" | "PARENT_FK_FIELD_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SEARCH_INDEXES_ASC" | "SEARCH_INDEXES_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type EnumOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC" | "VALUES_ASC" | "VALUES_DESC"; -export type ExclusionConstraintOrderBy = "ACCESS_METHOD_ASC" | "ACCESS_METHOD_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ELEMENT_EXPR_ASC" | "ELEMENT_EXPR_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPERATORS_ASC" | "OPERATORS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WHERE_CLAUSE_ASC" | "WHERE_CLAUSE_DESC"; -export type FieldOrderBy = "API_REQUIRED_ASC" | "API_REQUIRED_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CHK_ASC" | "CHK_DESC" | "CHK_EXPR_ASC" | "CHK_EXPR_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_VALUE_ASC" | "DEFAULT_VALUE_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_ORDER_ASC" | "FIELD_ORDER_DESC" | "GENERATION_EXPRESSION_ASC" | "GENERATION_EXPRESSION_DESC" | "GENERATION_TYPE_ASC" | "GENERATION_TYPE_DESC" | "IDENTITY_GENERATION_ASC" | "IDENTITY_GENERATION_DESC" | "IDENTITY_OPTIONS_ASC" | "IDENTITY_OPTIONS_DESC" | "ID_ASC" | "ID_DESC" | "IS_REQUIRED_ASC" | "IS_REQUIRED_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MAX_ASC" | "MAX_DESC" | "MIN_ASC" | "MIN_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REGEXP_ASC" | "REGEXP_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ForeignKeyConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACTION_ASC" | "DELETE_ACTION_DESC" | "DELETE_SET_FIELD_IDS_ASC" | "DELETE_SET_FIELD_IDS_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_IDS_ASC" | "REF_FIELD_IDS_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATE_ACTION_ASC" | "UPDATE_ACTION_DESC" | "WITH_PERIOD_ASC" | "WITH_PERIOD_DESC"; -export type FullTextSearchOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "ID_ASC" | "ID_DESC" | "LANGS_ASC" | "LANGS_DESC" | "LANG_COLUMN_ASC" | "LANG_COLUMN_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WEIGHTS_ASC" | "WEIGHTS_DESC"; -export type FunctionOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type HostnameBindingOrderBy = "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC"; -export type HttpRouteOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_ID_ASC" | "TARGET_ID_DESC" | "TARGET_KIND_ASC" | "TARGET_KIND_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type IndexOrderBy = "ACCESS_METHOD_ASC" | "ACCESS_METHOD_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INCLUDE_FIELD_IDS_ASC" | "INCLUDE_FIELD_IDS_DESC" | "INDEX_PARAMS_ASC" | "INDEX_PARAMS_DESC" | "IS_UNIQUE_ASC" | "IS_UNIQUE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "OP_CLASSES_ASC" | "OP_CLASSES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WHERE_CLAUSE_ASC" | "WHERE_CLAUSE_DESC"; -export type ManagedDomainOrderBy = "ALLOW_PUBLIC_USAGE_ASC" | "ALLOW_PUBLIC_USAGE_DESC" | "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CERT_STATUS_ASC" | "CERT_STATUS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type NodeTypeRegistryOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMETER_SCHEMA_ASC" | "PARAMETER_SCHEMA_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "TAGS_ASC" | "TAGS_DESC"; -export type PartitionOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "IS_PARENTED_ASC" | "IS_PARENTED_DESC" | "NAMING_PATTERN_ASC" | "NAMING_PATTERN_DESC" | "NATURAL" | "PARTITION_KEY_ID_ASC" | "PARTITION_KEY_ID_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "RETENTION_KEEP_TABLE_ASC" | "RETENTION_KEEP_TABLE_DESC" | "STRATEGY_ASC" | "STRATEGY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiOrderBy = "ANON_ROLE_ASC" | "ANON_ROLE_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DBNAME_ASC" | "DBNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_NAME_ASC" | "ROLE_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiModuleOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiSchemaOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformApiSettingOrderBy = "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENABLE_AGGREGATES_ASC" | "ENABLE_AGGREGATES_DESC" | "ENABLE_BULK_ASC" | "ENABLE_BULK_DESC" | "ENABLE_CONNECTION_FILTER_ASC" | "ENABLE_CONNECTION_FILTER_DESC" | "ENABLE_DIRECT_UPLOADS_ASC" | "ENABLE_DIRECT_UPLOADS_DESC" | "ENABLE_I18N_ASC" | "ENABLE_I18N_DESC" | "ENABLE_LLM_ASC" | "ENABLE_LLM_DESC" | "ENABLE_LTREE_ASC" | "ENABLE_LTREE_DESC" | "ENABLE_MANY_TO_MANY_ASC" | "ENABLE_MANY_TO_MANY_DESC" | "ENABLE_POSTGIS_ASC" | "ENABLE_POSTGIS_DESC" | "ENABLE_PRESIGNED_UPLOADS_ASC" | "ENABLE_PRESIGNED_UPLOADS_DESC" | "ENABLE_REALTIME_ASC" | "ENABLE_REALTIME_DESC" | "ENABLE_SEARCH_ASC" | "ENABLE_SEARCH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformCorsSettingOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformDomainOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HOSTNAME_ASC" | "HOSTNAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "MANAGED_ASC" | "MANAGED_DESC" | "NATURAL" | "PARENT_HOSTNAME_ASC" | "PARENT_HOSTNAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_SECRET_NAME_ASC" | "TLS_SECRET_NAME_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformDomainEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "DOMAIN_VERIFICATION_ID_ASC" | "DOMAIN_VERIFICATION_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformDomainVerificationOrderBy = "ATTEMPTS_ASC" | "ATTEMPTS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LAST_CHECKED_AT_ASC" | "LAST_CHECKED_AT_DESC" | "MANAGED_DOMAIN_ID_ASC" | "MANAGED_DOMAIN_ID_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RECORD_NAME_ASC" | "RECORD_NAME_DESC" | "RECORD_TYPE_ASC" | "RECORD_TYPE_DESC" | "RECORD_VALUE_ASC" | "RECORD_VALUE_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformManagedDomainOrderBy = "ALLOW_PUBLIC_USAGE_ASC" | "ALLOW_PUBLIC_USAGE_DESC" | "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CERT_STATUS_ASC" | "CERT_STATUS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ID_ASC" | "ID_DESC" | "IS_WILDCARD_ASC" | "IS_WILDCARD_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TLS_READY_AT_ASC" | "TLS_READY_AT_DESC" | "TLS_STATUS_ASC" | "TLS_STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERIFICATION_STATUS_ASC" | "VERIFICATION_STATUS_DESC" | "VERIFIED_AT_ASC" | "VERIFIED_AT_DESC"; -export type PlatformSiteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteMetadatumOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OG_IMAGE_ASC" | "OG_IMAGE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteModuleOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSiteThemeOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "THEME_ASC" | "THEME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PolicyOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "DISABLED_ASC" | "DISABLED_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PERMISSIVE_ASC" | "PERMISSIVE_DESC" | "POLICY_TYPE_ASC" | "POLICY_TYPE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITH_CHECK_ASC" | "WITH_CHECK_DESC"; -export type PrimaryKeyConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITHOUT_OVERLAPS_ASC" | "WITHOUT_OVERLAPS_DESC"; -export type PubkeySettingOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC" | "SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC" | "SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC" | "SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC" | "SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC" | "SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC" | "SIGN_UP_WITH_KEY_FUNCTION_ID_ASC" | "SIGN_UP_WITH_KEY_FUNCTION_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_FIELD_ASC" | "USER_FIELD_DESC"; -export type RlsSettingOrderBy = "AUTHENTICATE_FUNCTION_ID_ASC" | "AUTHENTICATE_FUNCTION_ID_DESC" | "AUTHENTICATE_SCHEMA_ID_ASC" | "AUTHENTICATE_SCHEMA_ID_DESC" | "AUTHENTICATE_STRICT_FUNCTION_ID_ASC" | "AUTHENTICATE_STRICT_FUNCTION_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CURRENT_IP_ADDRESS_FUNCTION_ID_ASC" | "CURRENT_IP_ADDRESS_FUNCTION_ID_DESC" | "CURRENT_ROLE_FUNCTION_ID_ASC" | "CURRENT_ROLE_FUNCTION_ID_DESC" | "CURRENT_ROLE_ID_FUNCTION_ID_ASC" | "CURRENT_ROLE_ID_FUNCTION_ID_DESC" | "CURRENT_USER_AGENT_FUNCTION_ID_ASC" | "CURRENT_USER_AGENT_FUNCTION_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "ROLE_SCHEMA_ID_ASC" | "ROLE_SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type RouteBindingOrderBy = "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_API_ID_ASC" | "TARGET_API_ID_DESC" | "TARGET_FUNCTION_ID_ASC" | "TARGET_FUNCTION_ID_DESC" | "TARGET_SITE_ID_ASC" | "TARGET_SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type RouteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DOMAIN_ID_ASC" | "DOMAIN_ID_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "METHOD_ASC" | "METHOD_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "TARGET_API_ID_ASC" | "TARGET_API_ID_DESC" | "TARGET_FUNCTION_ID_ASC" | "TARGET_FUNCTION_ID_DESC" | "TARGET_SITE_ID_ASC" | "TARGET_SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SchemaOrderBy = "API_EXPOSURE_ASC" | "API_EXPOSURE_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLIC_ASC" | "IS_PUBLIC_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_NAME_ASC" | "SCHEMA_NAME_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SchemaGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteOrderBy = "CONFIG_ASC" | "CONFIG_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteMetadatumOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OG_IMAGE_ASC" | "OG_IMAGE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "TITLE_ASC" | "TITLE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteModuleOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SiteThemeOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SITE_ID_ASC" | "SITE_ID_DESC" | "THEME_ASC" | "THEME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SpatialRelationOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OPERATOR_ASC" | "OPERATOR_DESC" | "PARAM_NAME_ASC" | "PARAM_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_ID_ASC" | "REF_FIELD_ID_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SqlActionOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "DEPS_ASC" | "DEPS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; -export type TableOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INHERITS_ID_ASC" | "INHERITS_ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARTITIONED_ASC" | "PARTITIONED_DESC" | "PARTITION_KEY_NAMES_ASC" | "PARTITION_KEY_NAMES_DESC" | "PARTITION_KEY_TYPES_ASC" | "PARTITION_KEY_TYPES_DESC" | "PARTITION_STRATEGY_ASC" | "PARTITION_STRATEGY_DESC" | "PEOPLESTAMPS_ASC" | "PEOPLESTAMPS_DESC" | "PLURAL_NAME_ASC" | "PLURAL_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SINGULAR_NAME_ASC" | "SINGULAR_NAME_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "STEP_UP_ASC" | "STEP_UP_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TIMESTAMPS_ASC" | "TIMESTAMPS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USE_RLS_ASC" | "USE_RLS_DESC"; -export type TableGrantOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type TriggerOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_ASC" | "EVENT_DESC" | "FUNCTION_NAME_ASC" | "FUNCTION_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type TriggerFunctionOrderBy = "CODE_ASC" | "CODE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type UniqueConstraintOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FIELD_IDS_ASC" | "FIELD_IDS_DESC" | "ID_ASC" | "ID_DESC" | "INITIALLY_DEFERRED_ASC" | "INITIALLY_DEFERRED_DESC" | "IS_DEFERRABLE_ASC" | "IS_DEFERRABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WITHOUT_OVERLAPS_ASC" | "WITHOUT_OVERLAPS_DESC"; -export type ViewOrderBy = "CATEGORY_ASC" | "CATEGORY_DESC" | "CHECK_OPTION_ASC" | "CHECK_OPTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "FILTER_DATA_ASC" | "FILTER_DATA_DESC" | "FILTER_TYPE_ASC" | "FILTER_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECURITY_BARRIER_ASC" | "SECURITY_BARRIER_DESC" | "SECURITY_INVOKER_ASC" | "SECURITY_INVOKER_DESC" | "SMART_TAGS_ASC" | "SMART_TAGS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TAGS_ASC" | "TAGS_DESC" | "VIEW_TYPE_ASC" | "VIEW_TYPE_DESC"; -export type ViewGrantOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "GRANTEE_NAME_ASC" | "GRANTEE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_GRANT_ASC" | "IS_GRANT_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVILEGE_ASC" | "PRIVILEGE_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC" | "WITH_GRANT_OPTION_ASC" | "WITH_GRANT_OPTION_DESC"; -export type ViewRuleOrderBy = "ACTION_ASC" | "ACTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_ASC" | "EVENT_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC"; -export type ViewTableOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOIN_ORDER_ASC" | "JOIN_ORDER_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "VIEW_ID_ASC" | "VIEW_ID_DESC"; -export type WebauthnSettingOrderBy = "ATTESTATION_TYPE_ASC" | "ATTESTATION_TYPE_DESC" | "CHALLENGE_EXPIRY_SECONDS_ASC" | "CHALLENGE_EXPIRY_SECONDS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREDENTIALS_SCHEMA_ID_ASC" | "CREDENTIALS_SCHEMA_ID_DESC" | "CREDENTIALS_TABLE_ID_ASC" | "CREDENTIALS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORIGIN_ALLOWLIST_ASC" | "ORIGIN_ALLOWLIST_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRE_USER_VERIFICATION_ASC" | "REQUIRE_USER_VERIFICATION_DESC" | "RESIDENT_KEY_ASC" | "RESIDENT_KEY_DESC" | "RP_ID_ASC" | "RP_ID_DESC" | "RP_NAME_ASC" | "RP_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_SCHEMA_ID_ASC" | "SESSIONS_SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_SECRETS_SCHEMA_ID_ASC" | "SESSION_SECRETS_SCHEMA_ID_DESC" | "SESSION_SECRETS_TABLE_ID_ASC" | "SESSION_SECRETS_TABLE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_FIELD_ID_ASC" | "USER_FIELD_ID_DESC"; +export type ApiOrderBy = + | 'ANON_ROLE_ASC' + | 'ANON_ROLE_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DBNAME_ASC' + | 'DBNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_NAME_ASC' + | 'ROLE_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiModuleOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiSchemaOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ApiSettingOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type AstMigrationOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYS_ASC' + | 'DEPLOYS_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REQUIRES_ASC' + | 'REQUIRES_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; +export type CheckConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EXPR_ASC' + | 'EXPR_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type CompositeTypeOrderBy = + | 'ATTRIBUTES_ASC' + | 'ATTRIBUTES_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC'; +export type CorsSettingOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PLATFORM_ASC' + | 'PLATFORM_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_HASH_ASC' + | 'SCHEMA_HASH_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseSettingOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseTransferOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIATED_BY_ASC' + | 'INITIATED_BY_DESC' + | 'NATURAL' + | 'NOTES_ASC' + | 'NOTES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_APPROVED_ASC' + | 'SOURCE_APPROVED_AT_ASC' + | 'SOURCE_APPROVED_AT_DESC' + | 'SOURCE_APPROVED_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TARGET_APPROVED_ASC' + | 'TARGET_APPROVED_AT_ASC' + | 'TARGET_APPROVED_AT_DESC' + | 'TARGET_APPROVED_DESC' + | 'TARGET_OWNER_ID_ASC' + | 'TARGET_OWNER_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DefaultPrivilegeOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'OBJECT_TYPE_ASC' + | 'OBJECT_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type DomainOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type DomainEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'DOMAIN_VERIFICATION_ID_ASC' + | 'DOMAIN_VERIFICATION_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DomainVerificationOrderBy = + | 'ATTEMPTS_ASC' + | 'ATTEMPTS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_CHECKED_AT_ASC' + | 'LAST_CHECKED_AT_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECORD_NAME_ASC' + | 'RECORD_NAME_DESC' + | 'RECORD_TYPE_ASC' + | 'RECORD_TYPE_DESC' + | 'RECORD_VALUE_ASC' + | 'RECORD_VALUE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type EmbeddingChunkOrderBy = + | 'CHUNKING_TASK_NAME_ASC' + | 'CHUNKING_TASK_NAME_DESC' + | 'CHUNKS_TABLE_ID_ASC' + | 'CHUNKS_TABLE_ID_DESC' + | 'CHUNKS_TABLE_NAME_ASC' + | 'CHUNKS_TABLE_NAME_DESC' + | 'CHUNK_OVERLAP_ASC' + | 'CHUNK_OVERLAP_DESC' + | 'CHUNK_SIZE_ASC' + | 'CHUNK_SIZE_DESC' + | 'CHUNK_STRATEGY_ASC' + | 'CHUNK_STRATEGY_DESC' + | 'CONTENT_FIELD_NAME_ASC' + | 'CONTENT_FIELD_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DIMENSIONS_ASC' + | 'DIMENSIONS_DESC' + | 'EMBEDDING_FIELD_ID_ASC' + | 'EMBEDDING_FIELD_ID_DESC' + | 'EMBEDDING_MODEL_ASC' + | 'EMBEDDING_MODEL_DESC' + | 'EMBEDDING_PROVIDER_ASC' + | 'EMBEDDING_PROVIDER_DESC' + | 'ENQUEUE_CHUNKING_JOB_ASC' + | 'ENQUEUE_CHUNKING_JOB_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'METADATA_FIELDS_ASC' + | 'METADATA_FIELDS_DESC' + | 'METRIC_ASC' + | 'METRIC_DESC' + | 'NATURAL' + | 'PARENT_FK_FIELD_ID_ASC' + | 'PARENT_FK_FIELD_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SEARCH_INDEXES_ASC' + | 'SEARCH_INDEXES_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type EnumOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'VALUES_ASC' + | 'VALUES_DESC'; +export type ExclusionConstraintOrderBy = + | 'ACCESS_METHOD_ASC' + | 'ACCESS_METHOD_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ELEMENT_EXPR_ASC' + | 'ELEMENT_EXPR_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPERATORS_ASC' + | 'OPERATORS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WHERE_CLAUSE_ASC' + | 'WHERE_CLAUSE_DESC'; +export type FieldOrderBy = + | 'API_REQUIRED_ASC' + | 'API_REQUIRED_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CHK_ASC' + | 'CHK_DESC' + | 'CHK_EXPR_ASC' + | 'CHK_EXPR_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_VALUE_ASC' + | 'DEFAULT_VALUE_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_ORDER_ASC' + | 'FIELD_ORDER_DESC' + | 'GENERATION_EXPRESSION_ASC' + | 'GENERATION_EXPRESSION_DESC' + | 'GENERATION_TYPE_ASC' + | 'GENERATION_TYPE_DESC' + | 'IDENTITY_GENERATION_ASC' + | 'IDENTITY_GENERATION_DESC' + | 'IDENTITY_OPTIONS_ASC' + | 'IDENTITY_OPTIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_REQUIRED_ASC' + | 'IS_REQUIRED_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'MIN_ASC' + | 'MIN_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REGEXP_ASC' + | 'REGEXP_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ForeignKeyConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACTION_ASC' + | 'DELETE_ACTION_DESC' + | 'DELETE_SET_FIELD_IDS_ASC' + | 'DELETE_SET_FIELD_IDS_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_IDS_ASC' + | 'REF_FIELD_IDS_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATE_ACTION_ASC' + | 'UPDATE_ACTION_DESC' + | 'WITH_PERIOD_ASC' + | 'WITH_PERIOD_DESC'; +export type FullTextSearchOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LANGS_ASC' + | 'LANGS_DESC' + | 'LANG_COLUMN_ASC' + | 'LANG_COLUMN_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WEIGHTS_ASC' + | 'WEIGHTS_DESC'; +export type FunctionOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type HostnameBindingOrderBy = + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC'; +export type HttpRouteOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_ID_ASC' + | 'TARGET_ID_DESC' + | 'TARGET_KIND_ASC' + | 'TARGET_KIND_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type IndexOrderBy = + | 'ACCESS_METHOD_ASC' + | 'ACCESS_METHOD_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INCLUDE_FIELD_IDS_ASC' + | 'INCLUDE_FIELD_IDS_DESC' + | 'INDEX_PARAMS_ASC' + | 'INDEX_PARAMS_DESC' + | 'IS_UNIQUE_ASC' + | 'IS_UNIQUE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'OP_CLASSES_ASC' + | 'OP_CLASSES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WHERE_CLAUSE_ASC' + | 'WHERE_CLAUSE_DESC'; +export type ManagedDomainOrderBy = + | 'ALLOW_PUBLIC_USAGE_ASC' + | 'ALLOW_PUBLIC_USAGE_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CERT_STATUS_ASC' + | 'CERT_STATUS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type NodeTypeRegistryOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMETER_SCHEMA_ASC' + | 'PARAMETER_SCHEMA_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC'; +export type PartitionOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'IS_PARENTED_ASC' + | 'IS_PARENTED_DESC' + | 'NAMING_PATTERN_ASC' + | 'NAMING_PATTERN_DESC' + | 'NATURAL' + | 'PARTITION_KEY_ID_ASC' + | 'PARTITION_KEY_ID_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'RETENTION_KEEP_TABLE_ASC' + | 'RETENTION_KEEP_TABLE_DESC' + | 'STRATEGY_ASC' + | 'STRATEGY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiOrderBy = + | 'ANON_ROLE_ASC' + | 'ANON_ROLE_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DBNAME_ASC' + | 'DBNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_NAME_ASC' + | 'ROLE_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiModuleOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiSchemaOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformApiSettingOrderBy = + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENABLE_AGGREGATES_ASC' + | 'ENABLE_AGGREGATES_DESC' + | 'ENABLE_BULK_ASC' + | 'ENABLE_BULK_DESC' + | 'ENABLE_CONNECTION_FILTER_ASC' + | 'ENABLE_CONNECTION_FILTER_DESC' + | 'ENABLE_DIRECT_UPLOADS_ASC' + | 'ENABLE_DIRECT_UPLOADS_DESC' + | 'ENABLE_I18N_ASC' + | 'ENABLE_I18N_DESC' + | 'ENABLE_LLM_ASC' + | 'ENABLE_LLM_DESC' + | 'ENABLE_LTREE_ASC' + | 'ENABLE_LTREE_DESC' + | 'ENABLE_MANY_TO_MANY_ASC' + | 'ENABLE_MANY_TO_MANY_DESC' + | 'ENABLE_POSTGIS_ASC' + | 'ENABLE_POSTGIS_DESC' + | 'ENABLE_PRESIGNED_UPLOADS_ASC' + | 'ENABLE_PRESIGNED_UPLOADS_DESC' + | 'ENABLE_REALTIME_ASC' + | 'ENABLE_REALTIME_DESC' + | 'ENABLE_SEARCH_ASC' + | 'ENABLE_SEARCH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformCorsSettingOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformDomainOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HOSTNAME_ASC' + | 'HOSTNAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'MANAGED_ASC' + | 'MANAGED_DESC' + | 'NATURAL' + | 'PARENT_HOSTNAME_ASC' + | 'PARENT_HOSTNAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_SECRET_NAME_ASC' + | 'TLS_SECRET_NAME_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformDomainEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'DOMAIN_VERIFICATION_ID_ASC' + | 'DOMAIN_VERIFICATION_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformDomainVerificationOrderBy = + | 'ATTEMPTS_ASC' + | 'ATTEMPTS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_CHECKED_AT_ASC' + | 'LAST_CHECKED_AT_DESC' + | 'MANAGED_DOMAIN_ID_ASC' + | 'MANAGED_DOMAIN_ID_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RECORD_NAME_ASC' + | 'RECORD_NAME_DESC' + | 'RECORD_TYPE_ASC' + | 'RECORD_TYPE_DESC' + | 'RECORD_VALUE_ASC' + | 'RECORD_VALUE_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformManagedDomainOrderBy = + | 'ALLOW_PUBLIC_USAGE_ASC' + | 'ALLOW_PUBLIC_USAGE_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CERT_STATUS_ASC' + | 'CERT_STATUS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_WILDCARD_ASC' + | 'IS_WILDCARD_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TLS_READY_AT_ASC' + | 'TLS_READY_AT_DESC' + | 'TLS_STATUS_ASC' + | 'TLS_STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERIFICATION_STATUS_ASC' + | 'VERIFICATION_STATUS_DESC' + | 'VERIFIED_AT_ASC' + | 'VERIFIED_AT_DESC'; +export type PlatformSiteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteMetadatumOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OG_IMAGE_ASC' + | 'OG_IMAGE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteModuleOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSiteThemeOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'THEME_ASC' + | 'THEME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PolicyOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'DISABLED_ASC' + | 'DISABLED_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PERMISSIVE_ASC' + | 'PERMISSIVE_DESC' + | 'POLICY_TYPE_ASC' + | 'POLICY_TYPE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITH_CHECK_ASC' + | 'WITH_CHECK_DESC'; +export type PrimaryKeyConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITHOUT_OVERLAPS_ASC' + | 'WITHOUT_OVERLAPS_DESC'; +export type PubkeySettingOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC' + | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC' + | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC' + | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC' + | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC' + | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC' + | 'SIGN_UP_WITH_KEY_FUNCTION_ID_ASC' + | 'SIGN_UP_WITH_KEY_FUNCTION_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_FIELD_ASC' + | 'USER_FIELD_DESC'; +export type RlsSettingOrderBy = + | 'AUTHENTICATE_FUNCTION_ID_ASC' + | 'AUTHENTICATE_FUNCTION_ID_DESC' + | 'AUTHENTICATE_SCHEMA_ID_ASC' + | 'AUTHENTICATE_SCHEMA_ID_DESC' + | 'AUTHENTICATE_STRICT_FUNCTION_ID_ASC' + | 'AUTHENTICATE_STRICT_FUNCTION_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CURRENT_IP_ADDRESS_FUNCTION_ID_ASC' + | 'CURRENT_IP_ADDRESS_FUNCTION_ID_DESC' + | 'CURRENT_ROLE_FUNCTION_ID_ASC' + | 'CURRENT_ROLE_FUNCTION_ID_DESC' + | 'CURRENT_ROLE_ID_FUNCTION_ID_ASC' + | 'CURRENT_ROLE_ID_FUNCTION_ID_DESC' + | 'CURRENT_USER_AGENT_FUNCTION_ID_ASC' + | 'CURRENT_USER_AGENT_FUNCTION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ROLE_SCHEMA_ID_ASC' + | 'ROLE_SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type RouteBindingOrderBy = + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_API_ID_ASC' + | 'TARGET_API_ID_DESC' + | 'TARGET_FUNCTION_ID_ASC' + | 'TARGET_FUNCTION_ID_DESC' + | 'TARGET_SITE_ID_ASC' + | 'TARGET_SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type RouteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DOMAIN_ID_ASC' + | 'DOMAIN_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'METHOD_ASC' + | 'METHOD_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'TARGET_API_ID_ASC' + | 'TARGET_API_ID_DESC' + | 'TARGET_FUNCTION_ID_ASC' + | 'TARGET_FUNCTION_ID_DESC' + | 'TARGET_SITE_ID_ASC' + | 'TARGET_SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SchemaOrderBy = + | 'API_EXPOSURE_ASC' + | 'API_EXPOSURE_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLIC_ASC' + | 'IS_PUBLIC_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_NAME_ASC' + | 'SCHEMA_NAME_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SchemaGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteOrderBy = + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteMetadatumOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OG_IMAGE_ASC' + | 'OG_IMAGE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'TITLE_ASC' + | 'TITLE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteModuleOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SiteThemeOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SITE_ID_ASC' + | 'SITE_ID_DESC' + | 'THEME_ASC' + | 'THEME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SpatialRelationOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OPERATOR_ASC' + | 'OPERATOR_DESC' + | 'PARAM_NAME_ASC' + | 'PARAM_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_ID_ASC' + | 'REF_FIELD_ID_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SqlActionOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'DEPS_ASC' + | 'DEPS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; +export type TableOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INHERITS_ID_ASC' + | 'INHERITS_ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARTITIONED_ASC' + | 'PARTITIONED_DESC' + | 'PARTITION_KEY_NAMES_ASC' + | 'PARTITION_KEY_NAMES_DESC' + | 'PARTITION_KEY_TYPES_ASC' + | 'PARTITION_KEY_TYPES_DESC' + | 'PARTITION_STRATEGY_ASC' + | 'PARTITION_STRATEGY_DESC' + | 'PEOPLESTAMPS_ASC' + | 'PEOPLESTAMPS_DESC' + | 'PLURAL_NAME_ASC' + | 'PLURAL_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SINGULAR_NAME_ASC' + | 'SINGULAR_NAME_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'STEP_UP_ASC' + | 'STEP_UP_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TIMESTAMPS_ASC' + | 'TIMESTAMPS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USE_RLS_ASC' + | 'USE_RLS_DESC'; +export type TableGrantOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type TriggerOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'FUNCTION_NAME_ASC' + | 'FUNCTION_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type TriggerFunctionOrderBy = + | 'CODE_ASC' + | 'CODE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type UniqueConstraintOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FIELD_IDS_ASC' + | 'FIELD_IDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INITIALLY_DEFERRED_ASC' + | 'INITIALLY_DEFERRED_DESC' + | 'IS_DEFERRABLE_ASC' + | 'IS_DEFERRABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WITHOUT_OVERLAPS_ASC' + | 'WITHOUT_OVERLAPS_DESC'; +export type ViewOrderBy = + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CHECK_OPTION_ASC' + | 'CHECK_OPTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'FILTER_DATA_ASC' + | 'FILTER_DATA_DESC' + | 'FILTER_TYPE_ASC' + | 'FILTER_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECURITY_BARRIER_ASC' + | 'SECURITY_BARRIER_DESC' + | 'SECURITY_INVOKER_ASC' + | 'SECURITY_INVOKER_DESC' + | 'SMART_TAGS_ASC' + | 'SMART_TAGS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'VIEW_TYPE_ASC' + | 'VIEW_TYPE_DESC'; +export type ViewGrantOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'GRANTEE_NAME_ASC' + | 'GRANTEE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_GRANT_ASC' + | 'IS_GRANT_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVILEGE_ASC' + | 'PRIVILEGE_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC' + | 'WITH_GRANT_OPTION_ASC' + | 'WITH_GRANT_OPTION_DESC'; +export type ViewRuleOrderBy = + | 'ACTION_ASC' + | 'ACTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC'; +export type ViewTableOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOIN_ORDER_ASC' + | 'JOIN_ORDER_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'VIEW_ID_ASC' + | 'VIEW_ID_DESC'; +export type WebauthnSettingOrderBy = + | 'ATTESTATION_TYPE_ASC' + | 'ATTESTATION_TYPE_DESC' + | 'CHALLENGE_EXPIRY_SECONDS_ASC' + | 'CHALLENGE_EXPIRY_SECONDS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREDENTIALS_SCHEMA_ID_ASC' + | 'CREDENTIALS_SCHEMA_ID_DESC' + | 'CREDENTIALS_TABLE_ID_ASC' + | 'CREDENTIALS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORIGIN_ALLOWLIST_ASC' + | 'ORIGIN_ALLOWLIST_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRE_USER_VERIFICATION_ASC' + | 'REQUIRE_USER_VERIFICATION_DESC' + | 'RESIDENT_KEY_ASC' + | 'RESIDENT_KEY_DESC' + | 'RP_ID_ASC' + | 'RP_ID_DESC' + | 'RP_NAME_ASC' + | 'RP_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_SCHEMA_ID_ASC' + | 'SESSIONS_SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_SECRETS_SCHEMA_ID_ASC' + | 'SESSION_SECRETS_SCHEMA_ID_DESC' + | 'SESSION_SECRETS_TABLE_ID_ASC' + | 'SESSION_SECRETS_TABLE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_FIELD_ID_ASC' + | 'USER_FIELD_ID_DESC'; // ============ CRUD Input Types ============ export interface CreateApiInput { clientMutationId?: string; @@ -8368,111 +10044,111 @@ export interface DeleteWebauthnSettingInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Api": { - "apiModules": "ApiModule", - "apiSchemas": "ApiSchema", - "corsSettings": "CorsSetting" + Api: { + apiModules: 'ApiModule', + apiSchemas: 'ApiSchema', + corsSettings: 'CorsSetting', }, - "Database": { - "checkConstraints": "CheckConstraint", - "compositeTypes": "CompositeType", - "databaseTransfers": "DatabaseTransfer", - "defaultPrivileges": "DefaultPrivilege", - "embeddingChunks": "EmbeddingChunk", - "enums": "Enum", - "exclusionConstraints": "ExclusionConstraint", - "fields": "Field", - "foreignKeyConstraints": "ForeignKeyConstraint", - "fullTextSearches": "FullTextSearch", - "functions": "Function", - "indices": "Index", - "partitions": "Partition", - "policies": "Policy", - "primaryKeyConstraints": "PrimaryKeyConstraint", - "schemaGrants": "SchemaGrant", - "schemas": "Schema", - "spatialRelations": "SpatialRelation", - "tableGrants": "TableGrant", - "tables": "Table", - "triggerFunctions": "TriggerFunction", - "triggers": "Trigger", - "uniqueConstraints": "UniqueConstraint", - "viewGrants": "ViewGrant", - "viewRules": "ViewRule", - "viewTables": "ViewTable", - "views": "View" + Database: { + checkConstraints: 'CheckConstraint', + compositeTypes: 'CompositeType', + databaseTransfers: 'DatabaseTransfer', + defaultPrivileges: 'DefaultPrivilege', + embeddingChunks: 'EmbeddingChunk', + enums: 'Enum', + exclusionConstraints: 'ExclusionConstraint', + fields: 'Field', + foreignKeyConstraints: 'ForeignKeyConstraint', + fullTextSearches: 'FullTextSearch', + functions: 'Function', + indices: 'Index', + partitions: 'Partition', + policies: 'Policy', + primaryKeyConstraints: 'PrimaryKeyConstraint', + schemaGrants: 'SchemaGrant', + schemas: 'Schema', + spatialRelations: 'SpatialRelation', + tableGrants: 'TableGrant', + tables: 'Table', + triggerFunctions: 'TriggerFunction', + triggers: 'Trigger', + uniqueConstraints: 'UniqueConstraint', + viewGrants: 'ViewGrant', + viewRules: 'ViewRule', + viewTables: 'ViewTable', + views: 'View', }, - "Domain": { - "domainEvents": "DomainEvent", - "domainVerifications": "DomainVerification", - "httpRoutes": "HttpRoute", - "routes": "Route" + Domain: { + domainEvents: 'DomainEvent', + domainVerifications: 'DomainVerification', + httpRoutes: 'HttpRoute', + routes: 'Route', }, - "Field": { - "spatialRelations": "SpatialRelation", - "spatialRelationsByRefFieldId": "SpatialRelation" + Field: { + spatialRelations: 'SpatialRelation', + spatialRelationsByRefFieldId: 'SpatialRelation', }, - "ManagedDomain": { - "domainEvents": "DomainEvent", - "domainVerifications": "DomainVerification" + ManagedDomain: { + domainEvents: 'DomainEvent', + domainVerifications: 'DomainVerification', }, - "PlatformApi": { - "platformApiModulesByApiId": "PlatformApiModule", - "platformApiSchemasByApiId": "PlatformApiSchema" + PlatformApi: { + platformApiModulesByApiId: 'PlatformApiModule', + platformApiSchemasByApiId: 'PlatformApiSchema', }, - "PlatformDomain": { - "platformDomainEventsByDomainId": "PlatformDomainEvent", - "platformDomainVerificationsByDomainId": "PlatformDomainVerification" + PlatformDomain: { + platformDomainEventsByDomainId: 'PlatformDomainEvent', + platformDomainVerificationsByDomainId: 'PlatformDomainVerification', }, - "PlatformManagedDomain": { - "platformDomainEventsByManagedDomainId": "PlatformDomainEvent", - "platformDomainVerificationsByManagedDomainId": "PlatformDomainVerification" + PlatformManagedDomain: { + platformDomainEventsByManagedDomainId: 'PlatformDomainEvent', + platformDomainVerificationsByManagedDomainId: 'PlatformDomainVerification', }, - "PlatformSite": { - "platformSiteMetadataBySiteId": "PlatformSiteMetadatum", - "platformSiteModulesBySiteId": "PlatformSiteModule", - "platformSiteThemesBySiteId": "PlatformSiteTheme" + PlatformSite: { + platformSiteMetadataBySiteId: 'PlatformSiteMetadatum', + platformSiteModulesBySiteId: 'PlatformSiteModule', + platformSiteThemesBySiteId: 'PlatformSiteTheme', }, - "Schema": { - "apiSchemas": "ApiSchema", - "compositeTypes": "CompositeType", - "defaultPrivileges": "DefaultPrivilege", - "enums": "Enum", - "functions": "Function", - "platformApiSchemas": "PlatformApiSchema", - "schemaGrants": "SchemaGrant", - "tables": "Table", - "views": "View" + Schema: { + apiSchemas: 'ApiSchema', + compositeTypes: 'CompositeType', + defaultPrivileges: 'DefaultPrivilege', + enums: 'Enum', + functions: 'Function', + platformApiSchemas: 'PlatformApiSchema', + schemaGrants: 'SchemaGrant', + tables: 'Table', + views: 'View', }, - "Site": { - "siteMetadata": "SiteMetadatum", - "siteModules": "SiteModule", - "siteThemes": "SiteTheme" + Site: { + siteMetadata: 'SiteMetadatum', + siteModules: 'SiteModule', + siteThemes: 'SiteTheme', }, - "Table": { - "checkConstraints": "CheckConstraint", - "embeddingChunks": "EmbeddingChunk", - "embeddingChunksByChunksTableId": "EmbeddingChunk", - "exclusionConstraints": "ExclusionConstraint", - "fields": "Field", - "foreignKeyConstraints": "ForeignKeyConstraint", - "fullTextSearches": "FullTextSearch", - "indices": "Index", - "policies": "Policy", - "primaryKeyConstraints": "PrimaryKeyConstraint", - "spatialRelations": "SpatialRelation", - "spatialRelationsByRefTableId": "SpatialRelation", - "tableGrants": "TableGrant", - "triggers": "Trigger", - "uniqueConstraints": "UniqueConstraint", - "viewTables": "ViewTable", - "views": "View" + Table: { + checkConstraints: 'CheckConstraint', + embeddingChunks: 'EmbeddingChunk', + embeddingChunksByChunksTableId: 'EmbeddingChunk', + exclusionConstraints: 'ExclusionConstraint', + fields: 'Field', + foreignKeyConstraints: 'ForeignKeyConstraint', + fullTextSearches: 'FullTextSearch', + indices: 'Index', + policies: 'Policy', + primaryKeyConstraints: 'PrimaryKeyConstraint', + spatialRelations: 'SpatialRelation', + spatialRelationsByRefTableId: 'SpatialRelation', + tableGrants: 'TableGrant', + triggers: 'Trigger', + uniqueConstraints: 'UniqueConstraint', + viewTables: 'ViewTable', + views: 'View', + }, + View: { + viewGrants: 'ViewGrant', + viewRules: 'ViewRule', + viewTables: 'ViewTable', }, - "View": { - "viewGrants": "ViewGrant", - "viewRules": "ViewRule", - "viewTables": "ViewTable" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface AcceptDatabaseTransferInput { @@ -16831,4 +18507,4 @@ export type WebauthnSettingEdgeSelect = { node?: { select: WebauthnSettingSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/api/orm/models/api.ts b/sdk/constructive-sdk/src/api/orm/models/api.ts index 6a90777ca7..4d60695731 100644 --- a/sdk/constructive-sdk/src/api/orm/models/api.ts +++ b/sdk/constructive-sdk/src/api/orm/models/api.ts @@ -3,56 +3,96 @@ * @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 { Api, ApiWithRelations, ApiSelect, ApiFilter, ApiOrderBy, CreateApiInput, UpdateApiInput, ApiPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Api, + ApiWithRelations, + ApiSelect, + ApiFilter, + ApiOrderBy, + CreateApiInput, + UpdateApiInput, + ApiPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apis: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Api", "apis", 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 - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Api', + 'apis', + 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, + }, + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "apis", + operation: 'query', + operationName: 'Api', + fieldName: 'apis', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ api: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Api", "apis", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Api', + 'apis', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "api", + operation: 'query', + operationName: 'Api', + fieldName: 'api', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "api": data.apis?.nodes?.[0] ?? null - }) + api: data.apis?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ api: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Api", "apis", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Api', + 'apis', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiFilter", "ApiOrderBy", connectionFieldsMap); + 'ApiFilter', + 'ApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Api", - fieldName: "api", + operation: 'query', + operationName: 'Api', + fieldName: 'api', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "api": data.apis?.nodes?.[0] ?? null - }) + api: data.apis?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Api", "createApi", "api", args.select, args.data, "CreateApiInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Api', + 'createApi', + 'api', + args.select, + args.data, + 'CreateApiInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "createApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'createApi', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Api", "updateApi", "api", args.select, args.where.id, args.data, "UpdateApiInput", "id", "apiPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Api', + 'updateApi', + 'api', + args.select, + args.where.id, + args.data, + 'UpdateApiInput', + 'id', + 'apiPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "updateApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'updateApi', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApi: { api: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Api", "deleteApi", "api", { - id: args.where.id - }, "DeleteApiInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Api', + 'deleteApi', + 'api', + { + id: args.where.id, + }, + 'DeleteApiInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Api", - fieldName: "deleteApi", + operation: 'mutation', + operationName: 'Api', + fieldName: 'deleteApi', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/apiModule.ts b/sdk/constructive-sdk/src/api/orm/models/apiModule.ts index ac4485467d..dd9bb29f76 100644 --- a/sdk/constructive-sdk/src/api/orm/models/apiModule.ts +++ b/sdk/constructive-sdk/src/api/orm/models/apiModule.ts @@ -3,56 +3,96 @@ * @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 { ApiModule, ApiModuleWithRelations, ApiModuleSelect, ApiModuleFilter, ApiModuleOrderBy, CreateApiModuleInput, UpdateApiModuleInput, ApiModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiModule, + ApiModuleWithRelations, + ApiModuleSelect, + ApiModuleFilter, + ApiModuleOrderBy, + CreateApiModuleInput, + UpdateApiModuleInput, + ApiModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiModule", "apiModules", 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 - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiModule', + 'apiModules', + 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, + }, + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModules", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiModule", "apiModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiModule', + 'apiModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModule", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiModule": data.apiModules?.nodes?.[0] ?? null - }) + apiModule: data.apiModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiModule", "apiModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiModule', + 'apiModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiModuleFilter", "ApiModuleOrderBy", connectionFieldsMap); + 'ApiModuleFilter', + 'ApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiModule", - fieldName: "apiModule", + operation: 'query', + operationName: 'ApiModule', + fieldName: 'apiModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiModule": data.apiModules?.nodes?.[0] ?? null - }) + apiModule: data.apiModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiModule", "createApiModule", "apiModule", args.select, args.data, "CreateApiModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiModule', + 'createApiModule', + 'apiModule', + args.select, + args.data, + 'CreateApiModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "createApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'createApiModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiModule", "updateApiModule", "apiModule", args.select, args.where.id, args.data, "UpdateApiModuleInput", "id", "apiModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiModule', + 'updateApiModule', + 'apiModule', + args.select, + args.where.id, + args.data, + 'UpdateApiModuleInput', + 'id', + 'apiModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "updateApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'updateApiModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiModule: { apiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiModule", "deleteApiModule", "apiModule", { - id: args.where.id - }, "DeleteApiModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiModule', + 'deleteApiModule', + 'apiModule', + { + id: args.where.id, + }, + 'DeleteApiModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiModule", - fieldName: "deleteApiModule", + operation: 'mutation', + operationName: 'ApiModule', + fieldName: 'deleteApiModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/apiSchema.ts b/sdk/constructive-sdk/src/api/orm/models/apiSchema.ts index 2545e4014a..2179728a2b 100644 --- a/sdk/constructive-sdk/src/api/orm/models/apiSchema.ts +++ b/sdk/constructive-sdk/src/api/orm/models/apiSchema.ts @@ -3,56 +3,96 @@ * @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 { ApiSchema, ApiSchemaWithRelations, ApiSchemaSelect, ApiSchemaFilter, ApiSchemaOrderBy, CreateApiSchemaInput, UpdateApiSchemaInput, ApiSchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSchema, + ApiSchemaWithRelations, + ApiSchemaSelect, + ApiSchemaFilter, + ApiSchemaOrderBy, + CreateApiSchemaInput, + UpdateApiSchemaInput, + ApiSchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSchema", "apiSchemas", 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 - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSchema', + 'apiSchemas', + 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, + }, + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchemas", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSchema", "apiSchemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSchema', + 'apiSchemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchema", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSchema": data.apiSchemas?.nodes?.[0] ?? null - }) + apiSchema: data.apiSchemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSchema", "apiSchemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSchema', + 'apiSchemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSchemaFilter", "ApiSchemaOrderBy", connectionFieldsMap); + 'ApiSchemaFilter', + 'ApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSchema", - fieldName: "apiSchema", + operation: 'query', + operationName: 'ApiSchema', + fieldName: 'apiSchema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSchema": data.apiSchemas?.nodes?.[0] ?? null - }) + apiSchema: data.apiSchemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSchema", "createApiSchema", "apiSchema", args.select, args.data, "CreateApiSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSchema', + 'createApiSchema', + 'apiSchema', + args.select, + args.data, + 'CreateApiSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "createApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'createApiSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSchema", "updateApiSchema", "apiSchema", args.select, args.where.id, args.data, "UpdateApiSchemaInput", "id", "apiSchemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSchema', + 'updateApiSchema', + 'apiSchema', + args.select, + args.where.id, + args.data, + 'UpdateApiSchemaInput', + 'id', + 'apiSchemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "updateApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'updateApiSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSchema: { apiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSchema", "deleteApiSchema", "apiSchema", { - id: args.where.id - }, "DeleteApiSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSchema', + 'deleteApiSchema', + 'apiSchema', + { + id: args.where.id, + }, + 'DeleteApiSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSchema", - fieldName: "deleteApiSchema", + operation: 'mutation', + operationName: 'ApiSchema', + fieldName: 'deleteApiSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/apiSetting.ts b/sdk/constructive-sdk/src/api/orm/models/apiSetting.ts index b2ba66ae85..01f1b5b74e 100644 --- a/sdk/constructive-sdk/src/api/orm/models/apiSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/apiSetting.ts @@ -3,56 +3,96 @@ * @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 { ApiSetting, ApiSettingWithRelations, ApiSettingSelect, ApiSettingFilter, ApiSettingOrderBy, CreateApiSettingInput, UpdateApiSettingInput, ApiSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSetting, + ApiSettingWithRelations, + ApiSettingSelect, + ApiSettingFilter, + ApiSettingOrderBy, + CreateApiSettingInput, + UpdateApiSettingInput, + ApiSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSetting", "apiSettings", 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 - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSetting', + 'apiSettings', + 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, + }, + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSettings", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSetting", "apiSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSetting', + 'apiSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSetting", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSetting": data.apiSettings?.nodes?.[0] ?? null - }) + apiSetting: data.apiSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSetting", "apiSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSetting', + 'apiSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSettingFilter", "ApiSettingOrderBy", connectionFieldsMap); + 'ApiSettingFilter', + 'ApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSetting", - fieldName: "apiSetting", + operation: 'query', + operationName: 'ApiSetting', + fieldName: 'apiSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSetting": data.apiSettings?.nodes?.[0] ?? null - }) + apiSetting: data.apiSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSetting", "createApiSetting", "apiSetting", args.select, args.data, "CreateApiSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSetting', + 'createApiSetting', + 'apiSetting', + args.select, + args.data, + 'CreateApiSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "createApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'createApiSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSetting", "updateApiSetting", "apiSetting", args.select, args.where.id, args.data, "UpdateApiSettingInput", "id", "apiSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSetting', + 'updateApiSetting', + 'apiSetting', + args.select, + args.where.id, + args.data, + 'UpdateApiSettingInput', + 'id', + 'apiSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "updateApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'updateApiSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSetting: { apiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSetting", "deleteApiSetting", "apiSetting", { - id: args.where.id - }, "DeleteApiSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSetting', + 'deleteApiSetting', + 'apiSetting', + { + id: args.where.id, + }, + 'DeleteApiSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSetting", - fieldName: "deleteApiSetting", + operation: 'mutation', + operationName: 'ApiSetting', + fieldName: 'deleteApiSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/astMigration.ts b/sdk/constructive-sdk/src/api/orm/models/astMigration.ts index b6f4db557f..bfcc5f455a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/astMigration.ts +++ b/sdk/constructive-sdk/src/api/orm/models/astMigration.ts @@ -3,56 +3,96 @@ * @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 { AstMigration, AstMigrationWithRelations, AstMigrationSelect, AstMigrationFilter, AstMigrationOrderBy, CreateAstMigrationInput, UpdateAstMigrationInput, AstMigrationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AstMigration, + AstMigrationWithRelations, + AstMigrationSelect, + AstMigrationFilter, + AstMigrationOrderBy, + CreateAstMigrationInput, + UpdateAstMigrationInput, + AstMigrationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AstMigrationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigrations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AstMigration", "astMigrations", 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 - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AstMigration', + 'astMigrations', + 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, + }, + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigrations", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigrations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigration: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AstMigration", "astMigrations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AstMigration', + 'astMigrations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigration", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigration', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AstMigrationModel { nodes?: InferSelectResult[]; }; }) => ({ - "astMigration": data.astMigrations?.nodes?.[0] ?? null - }) + astMigration: data.astMigrations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigration: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AstMigration", "astMigrations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AstMigration', + 'astMigrations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigration", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigration', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class AstMigrationModel { nodes?: InferSelectResult[]; }; }) => ({ - "astMigration": data.astMigrations?.nodes?.[0] ?? null - }) + astMigration: data.astMigrations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAstMigration: { astMigration: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AstMigration", "createAstMigration", "astMigration", args.select, args.data, "CreateAstMigrationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AstMigration', + 'createAstMigration', + 'astMigration', + args.select, + args.data, + 'CreateAstMigrationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AstMigration", - fieldName: "createAstMigration", + operation: 'mutation', + operationName: 'AstMigration', + fieldName: 'createAstMigration', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/checkConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/checkConstraint.ts index 2683f316fc..7f6054e6a4 100644 --- a/sdk/constructive-sdk/src/api/orm/models/checkConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/checkConstraint.ts @@ -3,56 +3,96 @@ * @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 { CheckConstraint, CheckConstraintWithRelations, CheckConstraintSelect, CheckConstraintFilter, CheckConstraintOrderBy, CreateCheckConstraintInput, UpdateCheckConstraintInput, CheckConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CheckConstraint, + CheckConstraintWithRelations, + CheckConstraintSelect, + CheckConstraintFilter, + CheckConstraintOrderBy, + CreateCheckConstraintInput, + UpdateCheckConstraintInput, + CheckConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CheckConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CheckConstraint", "checkConstraints", 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 - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CheckConstraint', + 'checkConstraints', + 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, + }, + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraints", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CheckConstraint", "checkConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CheckConstraint', + 'checkConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraint", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CheckConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "checkConstraint": data.checkConstraints?.nodes?.[0] ?? null - }) + checkConstraint: data.checkConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ checkConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CheckConstraint", "checkConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CheckConstraint', + 'checkConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CheckConstraintFilter", "CheckConstraintOrderBy", connectionFieldsMap); + 'CheckConstraintFilter', + 'CheckConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CheckConstraint", - fieldName: "checkConstraint", + operation: 'query', + operationName: 'CheckConstraint', + fieldName: 'checkConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CheckConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "checkConstraint": data.checkConstraints?.nodes?.[0] ?? null - }) + checkConstraint: data.checkConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CheckConstraint", "createCheckConstraint", "checkConstraint", args.select, args.data, "CreateCheckConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CheckConstraint', + 'createCheckConstraint', + 'checkConstraint', + args.select, + args.data, + 'CreateCheckConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "createCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'createCheckConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CheckConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CheckConstraint", "updateCheckConstraint", "checkConstraint", args.select, args.where.id, args.data, "UpdateCheckConstraintInput", "id", "checkConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CheckConstraint', + 'updateCheckConstraint', + 'checkConstraint', + args.select, + args.where.id, + args.data, + 'UpdateCheckConstraintInput', + 'id', + 'checkConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "updateCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'updateCheckConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCheckConstraint: { checkConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CheckConstraint", "deleteCheckConstraint", "checkConstraint", { - id: args.where.id - }, "DeleteCheckConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CheckConstraint', + 'deleteCheckConstraint', + 'checkConstraint', + { + id: args.where.id, + }, + 'DeleteCheckConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CheckConstraint", - fieldName: "deleteCheckConstraint", + operation: 'mutation', + operationName: 'CheckConstraint', + fieldName: 'deleteCheckConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/compositeType.ts b/sdk/constructive-sdk/src/api/orm/models/compositeType.ts index b9da115bea..72f4ab3adf 100644 --- a/sdk/constructive-sdk/src/api/orm/models/compositeType.ts +++ b/sdk/constructive-sdk/src/api/orm/models/compositeType.ts @@ -3,56 +3,96 @@ * @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 { CompositeType, CompositeTypeWithRelations, CompositeTypeSelect, CompositeTypeFilter, CompositeTypeOrderBy, CreateCompositeTypeInput, UpdateCompositeTypeInput, CompositeTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CompositeType, + CompositeTypeWithRelations, + CompositeTypeSelect, + CompositeTypeFilter, + CompositeTypeOrderBy, + CreateCompositeTypeInput, + UpdateCompositeTypeInput, + CompositeTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CompositeTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CompositeType", "compositeTypes", 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 - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CompositeType', + 'compositeTypes', + 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, + }, + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeTypes", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CompositeType", "compositeTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CompositeType', + 'compositeTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeType", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CompositeTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "compositeType": data.compositeTypes?.nodes?.[0] ?? null - }) + compositeType: data.compositeTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ compositeType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CompositeType", "compositeTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CompositeType', + 'compositeTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CompositeTypeFilter", "CompositeTypeOrderBy", connectionFieldsMap); + 'CompositeTypeFilter', + 'CompositeTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CompositeType", - fieldName: "compositeType", + operation: 'query', + operationName: 'CompositeType', + fieldName: 'compositeType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CompositeTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "compositeType": data.compositeTypes?.nodes?.[0] ?? null - }) + compositeType: data.compositeTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CompositeType", "createCompositeType", "compositeType", args.select, args.data, "CreateCompositeTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CompositeType', + 'createCompositeType', + 'compositeType', + args.select, + args.data, + 'CreateCompositeTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "createCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'createCompositeType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CompositeTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CompositeType", "updateCompositeType", "compositeType", args.select, args.where.id, args.data, "UpdateCompositeTypeInput", "id", "compositeTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CompositeType', + 'updateCompositeType', + 'compositeType', + args.select, + args.where.id, + args.data, + 'UpdateCompositeTypeInput', + 'id', + 'compositeTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "updateCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'updateCompositeType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCompositeType: { compositeType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CompositeType", "deleteCompositeType", "compositeType", { - id: args.where.id - }, "DeleteCompositeTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CompositeType', + 'deleteCompositeType', + 'compositeType', + { + id: args.where.id, + }, + 'DeleteCompositeTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CompositeType", - fieldName: "deleteCompositeType", + operation: 'mutation', + operationName: 'CompositeType', + fieldName: 'deleteCompositeType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/corsSetting.ts b/sdk/constructive-sdk/src/api/orm/models/corsSetting.ts index 27feb0bf5a..2e37465f00 100644 --- a/sdk/constructive-sdk/src/api/orm/models/corsSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/corsSetting.ts @@ -3,56 +3,96 @@ * @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 { CorsSetting, CorsSettingWithRelations, CorsSettingSelect, CorsSettingFilter, CorsSettingOrderBy, CreateCorsSettingInput, UpdateCorsSettingInput, CorsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CorsSetting, + CorsSettingWithRelations, + CorsSettingSelect, + CorsSettingFilter, + CorsSettingOrderBy, + CreateCorsSettingInput, + UpdateCorsSettingInput, + CorsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CorsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CorsSetting", "corsSettings", 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 - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CorsSetting', + 'corsSettings', + 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, + }, + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSettings", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CorsSetting", "corsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CorsSetting', + 'corsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSetting", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "corsSetting": data.corsSettings?.nodes?.[0] ?? null - }) + corsSetting: data.corsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ corsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CorsSetting", "corsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CorsSetting', + 'corsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CorsSettingFilter", "CorsSettingOrderBy", connectionFieldsMap); + 'CorsSettingFilter', + 'CorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CorsSetting", - fieldName: "corsSetting", + operation: 'query', + operationName: 'CorsSetting', + fieldName: 'corsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "corsSetting": data.corsSettings?.nodes?.[0] ?? null - }) + corsSetting: data.corsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CorsSetting", "createCorsSetting", "corsSetting", args.select, args.data, "CreateCorsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CorsSetting', + 'createCorsSetting', + 'corsSetting', + args.select, + args.data, + 'CreateCorsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "createCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'createCorsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CorsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CorsSetting", "updateCorsSetting", "corsSetting", args.select, args.where.id, args.data, "UpdateCorsSettingInput", "id", "corsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CorsSetting', + 'updateCorsSetting', + 'corsSetting', + args.select, + args.where.id, + args.data, + 'UpdateCorsSettingInput', + 'id', + 'corsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "updateCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'updateCorsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCorsSetting: { corsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CorsSetting", "deleteCorsSetting", "corsSetting", { - id: args.where.id - }, "DeleteCorsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CorsSetting', + 'deleteCorsSetting', + 'corsSetting', + { + id: args.where.id, + }, + 'DeleteCorsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CorsSetting", - fieldName: "deleteCorsSetting", + operation: 'mutation', + operationName: 'CorsSetting', + fieldName: 'deleteCorsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/database.ts b/sdk/constructive-sdk/src/api/orm/models/database.ts index 4ce0f8c1b5..41c99ba120 100644 --- a/sdk/constructive-sdk/src/api/orm/models/database.ts +++ b/sdk/constructive-sdk/src/api/orm/models/database.ts @@ -3,56 +3,96 @@ * @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 { Database, DatabaseWithRelations, DatabaseSelect, DatabaseFilter, DatabaseOrderBy, CreateDatabaseInput, UpdateDatabaseInput, DatabasePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Database, + DatabaseWithRelations, + DatabaseSelect, + DatabaseFilter, + DatabaseOrderBy, + CreateDatabaseInput, + UpdateDatabaseInput, + DatabasePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databases: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Database", "databases", 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 - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Database', + 'databases', + 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, + }, + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "databases", + operation: 'query', + operationName: 'Database', + fieldName: 'databases', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ database: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Database", "databases", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Database', + 'databases', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "database", + operation: 'query', + operationName: 'Database', + fieldName: 'database', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseModel { nodes?: InferSelectResult[]; }; }) => ({ - "database": data.databases?.nodes?.[0] ?? null - }) + database: data.databases?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ database: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Database", "databases", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Database', + 'databases', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseFilter", "DatabaseOrderBy", connectionFieldsMap); + 'DatabaseFilter', + 'DatabaseOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Database", - fieldName: "database", + operation: 'query', + operationName: 'Database', + fieldName: 'database', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseModel { nodes?: InferSelectResult[]; }; }) => ({ - "database": data.databases?.nodes?.[0] ?? null - }) + database: data.databases?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Database", "createDatabase", "database", args.select, args.data, "CreateDatabaseInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Database', + 'createDatabase', + 'database', + args.select, + args.data, + 'CreateDatabaseInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "createDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'createDatabase', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabasePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Database", "updateDatabase", "database", args.select, args.where.id, args.data, "UpdateDatabaseInput", "id", "databasePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Database', + 'updateDatabase', + 'database', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseInput', + 'id', + 'databasePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "updateDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'updateDatabase', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabase: { database: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Database", "deleteDatabase", "database", { - id: args.where.id - }, "DeleteDatabaseInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Database', + 'deleteDatabase', + 'database', + { + id: args.where.id, + }, + 'DeleteDatabaseInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Database", - fieldName: "deleteDatabase", + operation: 'mutation', + operationName: 'Database', + fieldName: 'deleteDatabase', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/databaseSetting.ts b/sdk/constructive-sdk/src/api/orm/models/databaseSetting.ts index 8060f8c85d..6743fdbdc2 100644 --- a/sdk/constructive-sdk/src/api/orm/models/databaseSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/databaseSetting.ts @@ -3,56 +3,96 @@ * @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 { DatabaseSetting, DatabaseSettingWithRelations, DatabaseSettingSelect, DatabaseSettingFilter, DatabaseSettingOrderBy, CreateDatabaseSettingInput, UpdateDatabaseSettingInput, DatabaseSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseSetting, + DatabaseSettingWithRelations, + DatabaseSettingSelect, + DatabaseSettingFilter, + DatabaseSettingOrderBy, + CreateDatabaseSettingInput, + UpdateDatabaseSettingInput, + DatabaseSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSetting", "databaseSettings", 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 - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseSetting', + 'databaseSettings', + 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, + }, + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSettings", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseSetting", "databaseSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseSetting', + 'databaseSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSetting", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSetting": data.databaseSettings?.nodes?.[0] ?? null - }) + databaseSetting: data.databaseSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSetting", "databaseSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseSetting', + 'databaseSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseSettingFilter", "DatabaseSettingOrderBy", connectionFieldsMap); + 'DatabaseSettingFilter', + 'DatabaseSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSetting", - fieldName: "databaseSetting", + operation: 'query', + operationName: 'DatabaseSetting', + fieldName: 'databaseSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSetting": data.databaseSettings?.nodes?.[0] ?? null - }) + databaseSetting: data.databaseSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseSetting", "createDatabaseSetting", "databaseSetting", args.select, args.data, "CreateDatabaseSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseSetting', + 'createDatabaseSetting', + 'databaseSetting', + args.select, + args.data, + 'CreateDatabaseSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "createDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'createDatabaseSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseSetting", "updateDatabaseSetting", "databaseSetting", args.select, args.where.id, args.data, "UpdateDatabaseSettingInput", "id", "databaseSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseSetting', + 'updateDatabaseSetting', + 'databaseSetting', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseSettingInput', + 'id', + 'databaseSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "updateDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'updateDatabaseSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseSetting: { databaseSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseSetting", "deleteDatabaseSetting", "databaseSetting", { - id: args.where.id - }, "DeleteDatabaseSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseSetting', + 'deleteDatabaseSetting', + 'databaseSetting', + { + id: args.where.id, + }, + 'DeleteDatabaseSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSetting", - fieldName: "deleteDatabaseSetting", + operation: 'mutation', + operationName: 'DatabaseSetting', + fieldName: 'deleteDatabaseSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/databaseTransfer.ts b/sdk/constructive-sdk/src/api/orm/models/databaseTransfer.ts index 76caea1f6d..9260ed2fb7 100644 --- a/sdk/constructive-sdk/src/api/orm/models/databaseTransfer.ts +++ b/sdk/constructive-sdk/src/api/orm/models/databaseTransfer.ts @@ -3,56 +3,96 @@ * @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 { DatabaseTransfer, DatabaseTransferWithRelations, DatabaseTransferSelect, DatabaseTransferFilter, DatabaseTransferOrderBy, CreateDatabaseTransferInput, UpdateDatabaseTransferInput, DatabaseTransferPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseTransfer, + DatabaseTransferWithRelations, + DatabaseTransferSelect, + DatabaseTransferFilter, + DatabaseTransferOrderBy, + CreateDatabaseTransferInput, + UpdateDatabaseTransferInput, + DatabaseTransferPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseTransferModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseTransfer", "databaseTransfers", 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 - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseTransfer', + 'databaseTransfers', + 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, + }, + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfers", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfer: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseTransfer", "databaseTransfers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseTransfer', + 'databaseTransfers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfer", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfer', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DatabaseTransferModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseTransfer": data.databaseTransfers?.nodes?.[0] ?? null - }) + databaseTransfer: data.databaseTransfers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseTransfer: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseTransfer", "databaseTransfers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseTransfer', + 'databaseTransfers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseTransferFilter", "DatabaseTransferOrderBy", connectionFieldsMap); + 'DatabaseTransferFilter', + 'DatabaseTransferOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseTransfer", - fieldName: "databaseTransfer", + operation: 'query', + operationName: 'DatabaseTransfer', + fieldName: 'databaseTransfer', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DatabaseTransferModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseTransfer": data.databaseTransfers?.nodes?.[0] ?? null - }) + databaseTransfer: data.databaseTransfers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseTransfer", "createDatabaseTransfer", "databaseTransfer", args.select, args.data, "CreateDatabaseTransferInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseTransfer', + 'createDatabaseTransfer', + 'databaseTransfer', + args.select, + args.data, + 'CreateDatabaseTransferInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "createDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'createDatabaseTransfer', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseTransferPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseTransfer", "updateDatabaseTransfer", "databaseTransfer", args.select, args.where.id, args.data, "UpdateDatabaseTransferInput", "id", "databaseTransferPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseTransfer', + 'updateDatabaseTransfer', + 'databaseTransfer', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseTransferInput', + 'id', + 'databaseTransferPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "updateDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'updateDatabaseTransfer', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseTransfer: { databaseTransfer: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseTransfer", "deleteDatabaseTransfer", "databaseTransfer", { - id: args.where.id - }, "DeleteDatabaseTransferInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseTransfer', + 'deleteDatabaseTransfer', + 'databaseTransfer', + { + id: args.where.id, + }, + 'DeleteDatabaseTransferInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseTransfer", - fieldName: "deleteDatabaseTransfer", + operation: 'mutation', + operationName: 'DatabaseTransfer', + fieldName: 'deleteDatabaseTransfer', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/defaultPrivilege.ts b/sdk/constructive-sdk/src/api/orm/models/defaultPrivilege.ts index dc42720521..8d964bf6a4 100644 --- a/sdk/constructive-sdk/src/api/orm/models/defaultPrivilege.ts +++ b/sdk/constructive-sdk/src/api/orm/models/defaultPrivilege.ts @@ -3,56 +3,96 @@ * @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 { DefaultPrivilege, DefaultPrivilegeWithRelations, DefaultPrivilegeSelect, DefaultPrivilegeFilter, DefaultPrivilegeOrderBy, CreateDefaultPrivilegeInput, UpdateDefaultPrivilegeInput, DefaultPrivilegePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DefaultPrivilege, + DefaultPrivilegeWithRelations, + DefaultPrivilegeSelect, + DefaultPrivilegeFilter, + DefaultPrivilegeOrderBy, + CreateDefaultPrivilegeInput, + UpdateDefaultPrivilegeInput, + DefaultPrivilegePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DefaultPrivilegeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivileges: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultPrivilege", "defaultPrivileges", 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 - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + 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, + }, + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivileges", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivileges', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivilege: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DefaultPrivilege", "defaultPrivileges", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivilege", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivilege', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DefaultPrivilegeModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultPrivilege": data.defaultPrivileges?.nodes?.[0] ?? null - }) + defaultPrivilege: data.defaultPrivileges?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultPrivilege: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultPrivilege", "defaultPrivileges", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DefaultPrivilege', + 'defaultPrivileges', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DefaultPrivilegeFilter", "DefaultPrivilegeOrderBy", connectionFieldsMap); + 'DefaultPrivilegeFilter', + 'DefaultPrivilegeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultPrivilege", - fieldName: "defaultPrivilege", + operation: 'query', + operationName: 'DefaultPrivilege', + fieldName: 'defaultPrivilege', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DefaultPrivilegeModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultPrivilege": data.defaultPrivileges?.nodes?.[0] ?? null - }) + defaultPrivilege: data.defaultPrivileges?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DefaultPrivilege", "createDefaultPrivilege", "defaultPrivilege", args.select, args.data, "CreateDefaultPrivilegeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DefaultPrivilege', + 'createDefaultPrivilege', + 'defaultPrivilege', + args.select, + args.data, + 'CreateDefaultPrivilegeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "createDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'createDefaultPrivilege', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DefaultPrivilegePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DefaultPrivilege", "updateDefaultPrivilege", "defaultPrivilege", args.select, args.where.id, args.data, "UpdateDefaultPrivilegeInput", "id", "defaultPrivilegePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DefaultPrivilege', + 'updateDefaultPrivilege', + 'defaultPrivilege', + args.select, + args.where.id, + args.data, + 'UpdateDefaultPrivilegeInput', + 'id', + 'defaultPrivilegePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "updateDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'updateDefaultPrivilege', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDefaultPrivilege: { defaultPrivilege: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DefaultPrivilege", "deleteDefaultPrivilege", "defaultPrivilege", { - id: args.where.id - }, "DeleteDefaultPrivilegeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DefaultPrivilege', + 'deleteDefaultPrivilege', + 'defaultPrivilege', + { + id: args.where.id, + }, + 'DeleteDefaultPrivilegeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultPrivilege", - fieldName: "deleteDefaultPrivilege", + operation: 'mutation', + operationName: 'DefaultPrivilege', + fieldName: 'deleteDefaultPrivilege', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/domain.ts b/sdk/constructive-sdk/src/api/orm/models/domain.ts index 1576b5451f..d5d807ae4c 100644 --- a/sdk/constructive-sdk/src/api/orm/models/domain.ts +++ b/sdk/constructive-sdk/src/api/orm/models/domain.ts @@ -3,56 +3,96 @@ * @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 { Domain, DomainWithRelations, DomainSelect, DomainFilter, DomainOrderBy, CreateDomainInput, UpdateDomainInput, DomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Domain, + DomainWithRelations, + DomainSelect, + DomainFilter, + DomainOrderBy, + CreateDomainInput, + UpdateDomainInput, + DomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Domain", "domains", 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 - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Domain', + 'domains', + 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, + }, + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domains", + operation: 'query', + operationName: 'Domain', + fieldName: 'domains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Domain", "domains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Domain', + 'domains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domain", + operation: 'query', + operationName: 'Domain', + fieldName: 'domain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "domain": data.domains?.nodes?.[0] ?? null - }) + domain: data.domains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Domain", "domains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Domain', + 'domains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainFilter", "DomainOrderBy", connectionFieldsMap); + 'DomainFilter', + 'DomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Domain", - fieldName: "domain", + operation: 'query', + operationName: 'Domain', + fieldName: 'domain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "domain": data.domains?.nodes?.[0] ?? null - }) + domain: data.domains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Domain", "createDomain", "domain", args.select, args.data, "CreateDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Domain', + 'createDomain', + 'domain', + args.select, + args.data, + 'CreateDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "createDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'createDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Domain", "updateDomain", "domain", args.select, args.where.id, args.data, "UpdateDomainInput", "id", "domainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Domain', + 'updateDomain', + 'domain', + args.select, + args.where.id, + args.data, + 'UpdateDomainInput', + 'id', + 'domainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "updateDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'updateDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomain: { domain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Domain", "deleteDomain", "domain", { - id: args.where.id - }, "DeleteDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Domain', + 'deleteDomain', + 'domain', + { + id: args.where.id, + }, + 'DeleteDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Domain", - fieldName: "deleteDomain", + operation: 'mutation', + operationName: 'Domain', + fieldName: 'deleteDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/domainEvent.ts b/sdk/constructive-sdk/src/api/orm/models/domainEvent.ts index a490c9c31f..7177a72702 100644 --- a/sdk/constructive-sdk/src/api/orm/models/domainEvent.ts +++ b/sdk/constructive-sdk/src/api/orm/models/domainEvent.ts @@ -3,56 +3,96 @@ * @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 { DomainEvent, DomainEventWithRelations, DomainEventSelect, DomainEventFilter, DomainEventOrderBy, CreateDomainEventInput, UpdateDomainEventInput, DomainEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainEvent, + DomainEventWithRelations, + DomainEventSelect, + DomainEventFilter, + DomainEventOrderBy, + CreateDomainEventInput, + UpdateDomainEventInput, + DomainEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainEvent", "domainEvents", 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 - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainEvent', + 'domainEvents', + 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, + }, + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvents", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainEvent", "domainEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainEvent', + 'domainEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvent", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainEvent": data.domainEvents?.nodes?.[0] ?? null - }) + domainEvent: data.domainEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainEvent", "domainEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainEvent', + 'domainEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainEventFilter", "DomainEventOrderBy", connectionFieldsMap); + 'DomainEventFilter', + 'DomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainEvent", - fieldName: "domainEvent", + operation: 'query', + operationName: 'DomainEvent', + fieldName: 'domainEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainEvent": data.domainEvents?.nodes?.[0] ?? null - }) + domainEvent: data.domainEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainEvent", "createDomainEvent", "domainEvent", args.select, args.data, "CreateDomainEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainEvent', + 'createDomainEvent', + 'domainEvent', + args.select, + args.data, + 'CreateDomainEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "createDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'createDomainEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainEvent", "updateDomainEvent", "domainEvent", args.select, args.where.id, args.data, "UpdateDomainEventInput", "id", "domainEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainEvent', + 'updateDomainEvent', + 'domainEvent', + args.select, + args.where.id, + args.data, + 'UpdateDomainEventInput', + 'id', + 'domainEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "updateDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'updateDomainEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainEvent: { domainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainEvent", "deleteDomainEvent", "domainEvent", { - id: args.where.id - }, "DeleteDomainEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainEvent', + 'deleteDomainEvent', + 'domainEvent', + { + id: args.where.id, + }, + 'DeleteDomainEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainEvent", - fieldName: "deleteDomainEvent", + operation: 'mutation', + operationName: 'DomainEvent', + fieldName: 'deleteDomainEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/domainVerification.ts b/sdk/constructive-sdk/src/api/orm/models/domainVerification.ts index 60c8c2572f..b004e0b4da 100644 --- a/sdk/constructive-sdk/src/api/orm/models/domainVerification.ts +++ b/sdk/constructive-sdk/src/api/orm/models/domainVerification.ts @@ -3,56 +3,96 @@ * @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 { DomainVerification, DomainVerificationWithRelations, DomainVerificationSelect, DomainVerificationFilter, DomainVerificationOrderBy, CreateDomainVerificationInput, UpdateDomainVerificationInput, DomainVerificationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainVerification, + DomainVerificationWithRelations, + DomainVerificationSelect, + DomainVerificationFilter, + DomainVerificationOrderBy, + CreateDomainVerificationInput, + UpdateDomainVerificationInput, + DomainVerificationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainVerificationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerifications: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainVerification", "domainVerifications", 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 - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainVerification', + 'domainVerifications', + 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, + }, + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerifications", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerifications', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerification: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainVerification", "domainVerifications", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainVerification', + 'domainVerifications', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerification", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerification', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainVerification": data.domainVerifications?.nodes?.[0] ?? null - }) + domainVerification: data.domainVerifications?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainVerification: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainVerification", "domainVerifications", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainVerification', + 'domainVerifications', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainVerificationFilter", "DomainVerificationOrderBy", connectionFieldsMap); + 'DomainVerificationFilter', + 'DomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainVerification", - fieldName: "domainVerification", + operation: 'query', + operationName: 'DomainVerification', + fieldName: 'domainVerification', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainVerification": data.domainVerifications?.nodes?.[0] ?? null - }) + domainVerification: data.domainVerifications?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainVerification", "createDomainVerification", "domainVerification", args.select, args.data, "CreateDomainVerificationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainVerification', + 'createDomainVerification', + 'domainVerification', + args.select, + args.data, + 'CreateDomainVerificationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "createDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'createDomainVerification', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainVerificationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainVerification", "updateDomainVerification", "domainVerification", args.select, args.where.id, args.data, "UpdateDomainVerificationInput", "id", "domainVerificationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainVerification', + 'updateDomainVerification', + 'domainVerification', + args.select, + args.where.id, + args.data, + 'UpdateDomainVerificationInput', + 'id', + 'domainVerificationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "updateDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'updateDomainVerification', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainVerification: { domainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainVerification", "deleteDomainVerification", "domainVerification", { - id: args.where.id - }, "DeleteDomainVerificationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainVerification', + 'deleteDomainVerification', + 'domainVerification', + { + id: args.where.id, + }, + 'DeleteDomainVerificationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainVerification", - fieldName: "deleteDomainVerification", + operation: 'mutation', + operationName: 'DomainVerification', + fieldName: 'deleteDomainVerification', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/embeddingChunk.ts b/sdk/constructive-sdk/src/api/orm/models/embeddingChunk.ts index 5b0eae38d8..90af6f51a9 100644 --- a/sdk/constructive-sdk/src/api/orm/models/embeddingChunk.ts +++ b/sdk/constructive-sdk/src/api/orm/models/embeddingChunk.ts @@ -3,56 +3,96 @@ * @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 { EmbeddingChunk, EmbeddingChunkWithRelations, EmbeddingChunkSelect, EmbeddingChunkFilter, EmbeddingChunkOrderBy, CreateEmbeddingChunkInput, UpdateEmbeddingChunkInput, EmbeddingChunkPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EmbeddingChunk, + EmbeddingChunkWithRelations, + EmbeddingChunkSelect, + EmbeddingChunkFilter, + EmbeddingChunkOrderBy, + CreateEmbeddingChunkInput, + UpdateEmbeddingChunkInput, + EmbeddingChunkPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmbeddingChunkModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EmbeddingChunk", "embeddingChunks", 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 - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EmbeddingChunk', + 'embeddingChunks', + 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, + }, + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunks", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EmbeddingChunk", "embeddingChunks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EmbeddingChunk', + 'embeddingChunks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunk", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunk', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmbeddingChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "embeddingChunk": data.embeddingChunks?.nodes?.[0] ?? null - }) + embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ embeddingChunk: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EmbeddingChunk", "embeddingChunks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EmbeddingChunk', + 'embeddingChunks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmbeddingChunkFilter", "EmbeddingChunkOrderBy", connectionFieldsMap); + 'EmbeddingChunkFilter', + 'EmbeddingChunkOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmbeddingChunk", - fieldName: "embeddingChunk", + operation: 'query', + operationName: 'EmbeddingChunk', + fieldName: 'embeddingChunk', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmbeddingChunkModel { nodes?: InferSelectResult[]; }; }) => ({ - "embeddingChunk": data.embeddingChunks?.nodes?.[0] ?? null - }) + embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EmbeddingChunk", "createEmbeddingChunk", "embeddingChunk", args.select, args.data, "CreateEmbeddingChunkInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EmbeddingChunk', + 'createEmbeddingChunk', + 'embeddingChunk', + args.select, + args.data, + 'CreateEmbeddingChunkInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "createEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'createEmbeddingChunk', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmbeddingChunkPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EmbeddingChunk", "updateEmbeddingChunk", "embeddingChunk", args.select, args.where.id, args.data, "UpdateEmbeddingChunkInput", "id", "embeddingChunkPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EmbeddingChunk', + 'updateEmbeddingChunk', + 'embeddingChunk', + args.select, + args.where.id, + args.data, + 'UpdateEmbeddingChunkInput', + 'id', + 'embeddingChunkPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "updateEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'updateEmbeddingChunk', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EmbeddingChunk", "deleteEmbeddingChunk", "embeddingChunk", { - id: args.where.id - }, "DeleteEmbeddingChunkInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EmbeddingChunk', + 'deleteEmbeddingChunk', + 'embeddingChunk', + { + id: args.where.id, + }, + 'DeleteEmbeddingChunkInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmbeddingChunk", - fieldName: "deleteEmbeddingChunk", + operation: 'mutation', + operationName: 'EmbeddingChunk', + fieldName: 'deleteEmbeddingChunk', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/enum.ts b/sdk/constructive-sdk/src/api/orm/models/enum.ts index a8face956a..b5f965ea6f 100644 --- a/sdk/constructive-sdk/src/api/orm/models/enum.ts +++ b/sdk/constructive-sdk/src/api/orm/models/enum.ts @@ -3,56 +3,96 @@ * @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 { Enum, EnumWithRelations, EnumSelect, EnumFilter, EnumOrderBy, CreateEnumInput, UpdateEnumInput, EnumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Enum, + EnumWithRelations, + EnumSelect, + EnumFilter, + EnumOrderBy, + CreateEnumInput, + UpdateEnumInput, + EnumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EnumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ enums: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Enum", "enums", 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 - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Enum', + 'enums', + 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, + }, + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enums", + operation: 'query', + operationName: 'Enum', + fieldName: 'enums', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ enum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Enum", "enums", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Enum', + 'enums', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enum", + operation: 'query', + operationName: 'Enum', + fieldName: 'enum', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EnumModel { nodes?: InferSelectResult[]; }; }) => ({ - "enum": data.enums?.nodes?.[0] ?? null - }) + enum: data.enums?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ enum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Enum", "enums", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Enum', + 'enums', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EnumFilter", "EnumOrderBy", connectionFieldsMap); + 'EnumFilter', + 'EnumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Enum", - fieldName: "enum", + operation: 'query', + operationName: 'Enum', + fieldName: 'enum', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EnumModel { nodes?: InferSelectResult[]; }; }) => ({ - "enum": data.enums?.nodes?.[0] ?? null - }) + enum: data.enums?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Enum", "createEnum", "enum", args.select, args.data, "CreateEnumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Enum', + 'createEnum', + 'enum', + args.select, + args.data, + 'CreateEnumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "createEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'createEnum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EnumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Enum", "updateEnum", "enum", args.select, args.where.id, args.data, "UpdateEnumInput", "id", "enumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Enum', + 'updateEnum', + 'enum', + args.select, + args.where.id, + args.data, + 'UpdateEnumInput', + 'id', + 'enumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "updateEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'updateEnum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEnum: { enum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Enum", "deleteEnum", "enum", { - id: args.where.id - }, "DeleteEnumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Enum', + 'deleteEnum', + 'enum', + { + id: args.where.id, + }, + 'DeleteEnumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Enum", - fieldName: "deleteEnum", + operation: 'mutation', + operationName: 'Enum', + fieldName: 'deleteEnum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/exclusionConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/exclusionConstraint.ts index a0d6320772..6cc388e197 100644 --- a/sdk/constructive-sdk/src/api/orm/models/exclusionConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/exclusionConstraint.ts @@ -3,56 +3,96 @@ * @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 { ExclusionConstraint, ExclusionConstraintWithRelations, ExclusionConstraintSelect, ExclusionConstraintFilter, ExclusionConstraintOrderBy, CreateExclusionConstraintInput, UpdateExclusionConstraintInput, ExclusionConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ExclusionConstraint, + ExclusionConstraintWithRelations, + ExclusionConstraintSelect, + ExclusionConstraintFilter, + ExclusionConstraintOrderBy, + CreateExclusionConstraintInput, + UpdateExclusionConstraintInput, + ExclusionConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ExclusionConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ExclusionConstraint", "exclusionConstraints", 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 - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + 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, + }, + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraints", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ExclusionConstraint", "exclusionConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraint", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ExclusionConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "exclusionConstraint": data.exclusionConstraints?.nodes?.[0] ?? null - }) + exclusionConstraint: data.exclusionConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ exclusionConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ExclusionConstraint", "exclusionConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ExclusionConstraint', + 'exclusionConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ExclusionConstraintFilter", "ExclusionConstraintOrderBy", connectionFieldsMap); + 'ExclusionConstraintFilter', + 'ExclusionConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ExclusionConstraint", - fieldName: "exclusionConstraint", + operation: 'query', + operationName: 'ExclusionConstraint', + fieldName: 'exclusionConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ExclusionConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "exclusionConstraint": data.exclusionConstraints?.nodes?.[0] ?? null - }) + exclusionConstraint: data.exclusionConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ExclusionConstraint", "createExclusionConstraint", "exclusionConstraint", args.select, args.data, "CreateExclusionConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ExclusionConstraint', + 'createExclusionConstraint', + 'exclusionConstraint', + args.select, + args.data, + 'CreateExclusionConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "createExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'createExclusionConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ExclusionConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ExclusionConstraint", "updateExclusionConstraint", "exclusionConstraint", args.select, args.where.id, args.data, "UpdateExclusionConstraintInput", "id", "exclusionConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ExclusionConstraint', + 'updateExclusionConstraint', + 'exclusionConstraint', + args.select, + args.where.id, + args.data, + 'UpdateExclusionConstraintInput', + 'id', + 'exclusionConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "updateExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'updateExclusionConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteExclusionConstraint: { exclusionConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ExclusionConstraint", "deleteExclusionConstraint", "exclusionConstraint", { - id: args.where.id - }, "DeleteExclusionConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ExclusionConstraint', + 'deleteExclusionConstraint', + 'exclusionConstraint', + { + id: args.where.id, + }, + 'DeleteExclusionConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ExclusionConstraint", - fieldName: "deleteExclusionConstraint", + operation: 'mutation', + operationName: 'ExclusionConstraint', + fieldName: 'deleteExclusionConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/field.ts b/sdk/constructive-sdk/src/api/orm/models/field.ts index 28d34da746..baa1994dbd 100644 --- a/sdk/constructive-sdk/src/api/orm/models/field.ts +++ b/sdk/constructive-sdk/src/api/orm/models/field.ts @@ -3,56 +3,96 @@ * @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 { Field, FieldWithRelations, FieldSelect, FieldFilter, FieldOrderBy, CreateFieldInput, UpdateFieldInput, FieldPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Field, + FieldWithRelations, + FieldSelect, + FieldFilter, + FieldOrderBy, + CreateFieldInput, + UpdateFieldInput, + FieldPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FieldModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fields: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Field", "fields", 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 - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Field', + 'fields', + 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, + }, + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "fields", + operation: 'query', + operationName: 'Field', + fieldName: 'fields', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ field: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Field", "fields", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Field', + 'fields', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "field", + operation: 'query', + operationName: 'Field', + fieldName: 'field', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "field": data.fields?.nodes?.[0] ?? null - }) + field: data.fields?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ field: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Field", "fields", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Field', + 'fields', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FieldFilter", "FieldOrderBy", connectionFieldsMap); + 'FieldFilter', + 'FieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Field", - fieldName: "field", + operation: 'query', + operationName: 'Field', + fieldName: 'field', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "field": data.fields?.nodes?.[0] ?? null - }) + field: data.fields?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Field", "createField", "field", args.select, args.data, "CreateFieldInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Field', + 'createField', + 'field', + args.select, + args.data, + 'CreateFieldInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "createField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'createField', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FieldPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Field", "updateField", "field", args.select, args.where.id, args.data, "UpdateFieldInput", "id", "fieldPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Field', + 'updateField', + 'field', + args.select, + args.where.id, + args.data, + 'UpdateFieldInput', + 'id', + 'fieldPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "updateField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'updateField', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteField: { field: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Field", "deleteField", "field", { - id: args.where.id - }, "DeleteFieldInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Field', + 'deleteField', + 'field', + { + id: args.where.id, + }, + 'DeleteFieldInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Field", - fieldName: "deleteField", + operation: 'mutation', + operationName: 'Field', + fieldName: 'deleteField', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/foreignKeyConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/foreignKeyConstraint.ts index 9d86ea7aa5..498b987bd0 100644 --- a/sdk/constructive-sdk/src/api/orm/models/foreignKeyConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/foreignKeyConstraint.ts @@ -3,56 +3,98 @@ * @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 { ForeignKeyConstraint, ForeignKeyConstraintWithRelations, ForeignKeyConstraintSelect, ForeignKeyConstraintFilter, ForeignKeyConstraintOrderBy, CreateForeignKeyConstraintInput, UpdateForeignKeyConstraintInput, ForeignKeyConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ForeignKeyConstraint, + ForeignKeyConstraintWithRelations, + ForeignKeyConstraintSelect, + ForeignKeyConstraintFilter, + ForeignKeyConstraintOrderBy, + CreateForeignKeyConstraintInput, + UpdateForeignKeyConstraintInput, + ForeignKeyConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ForeignKeyConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - foreignKeyConstraints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + foreignKeyConstraints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ForeignKeyConstraint", "foreignKeyConstraints", 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 - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + 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, + }, + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraints", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ foreignKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ForeignKeyConstraint", "foreignKeyConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraint", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ForeignKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "foreignKeyConstraint": data.foreignKeyConstraints?.nodes?.[0] ?? null - }) + foreignKeyConstraint: data.foreignKeyConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ foreignKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ForeignKeyConstraint", "foreignKeyConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ForeignKeyConstraint', + 'foreignKeyConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ForeignKeyConstraintFilter", "ForeignKeyConstraintOrderBy", connectionFieldsMap); + 'ForeignKeyConstraintFilter', + 'ForeignKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ForeignKeyConstraint", - fieldName: "foreignKeyConstraint", + operation: 'query', + operationName: 'ForeignKeyConstraint', + fieldName: 'foreignKeyConstraint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ForeignKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "foreignKeyConstraint": data.foreignKeyConstraints?.nodes?.[0] ?? null - }) + foreignKeyConstraint: data.foreignKeyConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ForeignKeyConstraint", "createForeignKeyConstraint", "foreignKeyConstraint", args.select, args.data, "CreateForeignKeyConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ForeignKeyConstraint', + 'createForeignKeyConstraint', + 'foreignKeyConstraint', + args.select, + args.data, + 'CreateForeignKeyConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "createForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'createForeignKeyConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ForeignKeyConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ForeignKeyConstraint", "updateForeignKeyConstraint", "foreignKeyConstraint", args.select, args.where.id, args.data, "UpdateForeignKeyConstraintInput", "id", "foreignKeyConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ForeignKeyConstraint', + 'updateForeignKeyConstraint', + 'foreignKeyConstraint', + args.select, + args.where.id, + args.data, + 'UpdateForeignKeyConstraintInput', + 'id', + 'foreignKeyConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "updateForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'updateForeignKeyConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteForeignKeyConstraint: { foreignKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ForeignKeyConstraint", "deleteForeignKeyConstraint", "foreignKeyConstraint", { - id: args.where.id - }, "DeleteForeignKeyConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ForeignKeyConstraint', + 'deleteForeignKeyConstraint', + 'foreignKeyConstraint', + { + id: args.where.id, + }, + 'DeleteForeignKeyConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ForeignKeyConstraint", - fieldName: "deleteForeignKeyConstraint", + operation: 'mutation', + operationName: 'ForeignKeyConstraint', + fieldName: 'deleteForeignKeyConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/fullTextSearch.ts b/sdk/constructive-sdk/src/api/orm/models/fullTextSearch.ts index 25db3c0ee1..1fc50cde73 100644 --- a/sdk/constructive-sdk/src/api/orm/models/fullTextSearch.ts +++ b/sdk/constructive-sdk/src/api/orm/models/fullTextSearch.ts @@ -3,56 +3,96 @@ * @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 { FullTextSearch, FullTextSearchWithRelations, FullTextSearchSelect, FullTextSearchFilter, FullTextSearchOrderBy, CreateFullTextSearchInput, UpdateFullTextSearchInput, FullTextSearchPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FullTextSearch, + FullTextSearchWithRelations, + FullTextSearchSelect, + FullTextSearchFilter, + FullTextSearchOrderBy, + CreateFullTextSearchInput, + UpdateFullTextSearchInput, + FullTextSearchPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FullTextSearchModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearches: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FullTextSearch", "fullTextSearches", 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 - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FullTextSearch', + 'fullTextSearches', + 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, + }, + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearches", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearches', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearch: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FullTextSearch", "fullTextSearches", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FullTextSearch', + 'fullTextSearches', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearch", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearch', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FullTextSearchModel { nodes?: InferSelectResult[]; }; }) => ({ - "fullTextSearch": data.fullTextSearches?.nodes?.[0] ?? null - }) + fullTextSearch: data.fullTextSearches?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ fullTextSearch: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FullTextSearch", "fullTextSearches", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FullTextSearch', + 'fullTextSearches', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FullTextSearchFilter", "FullTextSearchOrderBy", connectionFieldsMap); + 'FullTextSearchFilter', + 'FullTextSearchOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FullTextSearch", - fieldName: "fullTextSearch", + operation: 'query', + operationName: 'FullTextSearch', + fieldName: 'fullTextSearch', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FullTextSearchModel { nodes?: InferSelectResult[]; }; }) => ({ - "fullTextSearch": data.fullTextSearches?.nodes?.[0] ?? null - }) + fullTextSearch: data.fullTextSearches?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FullTextSearch", "createFullTextSearch", "fullTextSearch", args.select, args.data, "CreateFullTextSearchInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FullTextSearch', + 'createFullTextSearch', + 'fullTextSearch', + args.select, + args.data, + 'CreateFullTextSearchInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "createFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'createFullTextSearch', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FullTextSearchPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FullTextSearch", "updateFullTextSearch", "fullTextSearch", args.select, args.where.id, args.data, "UpdateFullTextSearchInput", "id", "fullTextSearchPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FullTextSearch', + 'updateFullTextSearch', + 'fullTextSearch', + args.select, + args.where.id, + args.data, + 'UpdateFullTextSearchInput', + 'id', + 'fullTextSearchPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "updateFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'updateFullTextSearch', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFullTextSearch: { fullTextSearch: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FullTextSearch", "deleteFullTextSearch", "fullTextSearch", { - id: args.where.id - }, "DeleteFullTextSearchInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FullTextSearch', + 'deleteFullTextSearch', + 'fullTextSearch', + { + id: args.where.id, + }, + 'DeleteFullTextSearchInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FullTextSearch", - fieldName: "deleteFullTextSearch", + operation: 'mutation', + operationName: 'FullTextSearch', + fieldName: 'deleteFullTextSearch', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/function.ts b/sdk/constructive-sdk/src/api/orm/models/function.ts index 03d957378d..fc8fba9b21 100644 --- a/sdk/constructive-sdk/src/api/orm/models/function.ts +++ b/sdk/constructive-sdk/src/api/orm/models/function.ts @@ -3,56 +3,96 @@ * @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 { Function, FunctionWithRelations, FunctionSelect, FunctionFilter, FunctionOrderBy, CreateFunctionInput, UpdateFunctionInput, FunctionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Function, + FunctionWithRelations, + FunctionSelect, + FunctionFilter, + FunctionOrderBy, + CreateFunctionInput, + UpdateFunctionInput, + FunctionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Function", "functions", 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 - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Function', + 'functions', + 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, + }, + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "functions", + operation: 'query', + operationName: 'Function', + fieldName: 'functions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ function: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Function", "functions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Function', + 'functions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "function", + operation: 'query', + operationName: 'Function', + fieldName: 'function', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "function": data.functions?.nodes?.[0] ?? null - }) + function: data.functions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ function: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Function", "functions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Function', + 'functions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionFilter", "FunctionOrderBy", connectionFieldsMap); + 'FunctionFilter', + 'FunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Function", - fieldName: "function", + operation: 'query', + operationName: 'Function', + fieldName: 'function', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "function": data.functions?.nodes?.[0] ?? null - }) + function: data.functions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Function", "createFunction", "function", args.select, args.data, "CreateFunctionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Function', + 'createFunction', + 'function', + args.select, + args.data, + 'CreateFunctionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "createFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'createFunction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Function", "updateFunction", "function", args.select, args.where.id, args.data, "UpdateFunctionInput", "id", "functionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Function', + 'updateFunction', + 'function', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInput', + 'id', + 'functionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "updateFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'updateFunction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunction: { function: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Function", "deleteFunction", "function", { - id: args.where.id - }, "DeleteFunctionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Function', + 'deleteFunction', + 'function', + { + id: args.where.id, + }, + 'DeleteFunctionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Function", - fieldName: "deleteFunction", + operation: 'mutation', + operationName: 'Function', + fieldName: 'deleteFunction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/hostnameBinding.ts b/sdk/constructive-sdk/src/api/orm/models/hostnameBinding.ts index 3e42c2f357..f720f177ad 100644 --- a/sdk/constructive-sdk/src/api/orm/models/hostnameBinding.ts +++ b/sdk/constructive-sdk/src/api/orm/models/hostnameBinding.ts @@ -3,56 +3,96 @@ * @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 { HostnameBinding, HostnameBindingWithRelations, HostnameBindingSelect, HostnameBindingFilter, HostnameBindingOrderBy, CreateHostnameBindingInput, UpdateHostnameBindingInput, HostnameBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HostnameBinding, + HostnameBindingWithRelations, + HostnameBindingSelect, + HostnameBindingFilter, + HostnameBindingOrderBy, + CreateHostnameBindingInput, + UpdateHostnameBindingInput, + HostnameBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HostnameBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HostnameBinding", "hostnameBindings", 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 - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HostnameBinding', + 'hostnameBindings', + 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, + }, + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBindings", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HostnameBinding", "hostnameBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HostnameBinding', + 'hostnameBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBinding", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HostnameBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "hostnameBinding": data.hostnameBindings?.nodes?.[0] ?? null - }) + hostnameBinding: data.hostnameBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ hostnameBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HostnameBinding", "hostnameBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HostnameBinding', + 'hostnameBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HostnameBindingFilter", "HostnameBindingOrderBy", connectionFieldsMap); + 'HostnameBindingFilter', + 'HostnameBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HostnameBinding", - fieldName: "hostnameBinding", + operation: 'query', + operationName: 'HostnameBinding', + fieldName: 'hostnameBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HostnameBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "hostnameBinding": data.hostnameBindings?.nodes?.[0] ?? null - }) + hostnameBinding: data.hostnameBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HostnameBinding", "createHostnameBinding", "hostnameBinding", args.select, args.data, "CreateHostnameBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HostnameBinding', + 'createHostnameBinding', + 'hostnameBinding', + args.select, + args.data, + 'CreateHostnameBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "createHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'createHostnameBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HostnameBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HostnameBinding", "updateHostnameBinding", "hostnameBinding", args.select, args.where.id, args.data, "UpdateHostnameBindingInput", "id", "hostnameBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HostnameBinding', + 'updateHostnameBinding', + 'hostnameBinding', + args.select, + args.where.id, + args.data, + 'UpdateHostnameBindingInput', + 'id', + 'hostnameBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "updateHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'updateHostnameBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHostnameBinding: { hostnameBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HostnameBinding", "deleteHostnameBinding", "hostnameBinding", { - id: args.where.id - }, "DeleteHostnameBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HostnameBinding', + 'deleteHostnameBinding', + 'hostnameBinding', + { + id: args.where.id, + }, + 'DeleteHostnameBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HostnameBinding", - fieldName: "deleteHostnameBinding", + operation: 'mutation', + operationName: 'HostnameBinding', + fieldName: 'deleteHostnameBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/httpRoute.ts b/sdk/constructive-sdk/src/api/orm/models/httpRoute.ts index 3264e720b6..0af2bf2fac 100644 --- a/sdk/constructive-sdk/src/api/orm/models/httpRoute.ts +++ b/sdk/constructive-sdk/src/api/orm/models/httpRoute.ts @@ -3,56 +3,96 @@ * @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 { HttpRoute, HttpRouteWithRelations, HttpRouteSelect, HttpRouteFilter, HttpRouteOrderBy, CreateHttpRouteInput, UpdateHttpRouteInput, HttpRoutePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HttpRoute, + HttpRouteWithRelations, + HttpRouteSelect, + HttpRouteFilter, + HttpRouteOrderBy, + CreateHttpRouteInput, + UpdateHttpRouteInput, + HttpRoutePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HttpRouteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoutes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRoute", "httpRoutes", 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 - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HttpRoute', + 'httpRoutes', + 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, + }, + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoutes", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoutes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoute: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HttpRoute", "httpRoutes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HttpRoute', + 'httpRoutes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoute", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoute', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HttpRouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRoute": data.httpRoutes?.nodes?.[0] ?? null - }) + httpRoute: data.httpRoutes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRoute: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRoute", "httpRoutes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HttpRoute', + 'httpRoutes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HttpRouteFilter", "HttpRouteOrderBy", connectionFieldsMap); + 'HttpRouteFilter', + 'HttpRouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRoute", - fieldName: "httpRoute", + operation: 'query', + operationName: 'HttpRoute', + fieldName: 'httpRoute', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HttpRouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRoute": data.httpRoutes?.nodes?.[0] ?? null - }) + httpRoute: data.httpRoutes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HttpRoute", "createHttpRoute", "httpRoute", args.select, args.data, "CreateHttpRouteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HttpRoute', + 'createHttpRoute', + 'httpRoute', + args.select, + args.data, + 'CreateHttpRouteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "createHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'createHttpRoute', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HttpRoutePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HttpRoute", "updateHttpRoute", "httpRoute", args.select, args.where.id, args.data, "UpdateHttpRouteInput", "id", "httpRoutePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HttpRoute', + 'updateHttpRoute', + 'httpRoute', + args.select, + args.where.id, + args.data, + 'UpdateHttpRouteInput', + 'id', + 'httpRoutePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "updateHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'updateHttpRoute', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHttpRoute: { httpRoute: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HttpRoute", "deleteHttpRoute", "httpRoute", { - id: args.where.id - }, "DeleteHttpRouteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HttpRoute', + 'deleteHttpRoute', + 'httpRoute', + { + id: args.where.id, + }, + 'DeleteHttpRouteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRoute", - fieldName: "deleteHttpRoute", + operation: 'mutation', + operationName: 'HttpRoute', + fieldName: 'deleteHttpRoute', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/index.ts b/sdk/constructive-sdk/src/api/orm/models/index.ts index ec8f8de6a3..a9bb5c2667 100644 --- a/sdk/constructive-sdk/src/api/orm/models/index.ts +++ b/sdk/constructive-sdk/src/api/orm/models/index.ts @@ -3,68 +3,68 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { ApiModel } from "./api"; -export { ApiModuleModel } from "./apiModule"; -export { ApiSchemaModel } from "./apiSchema"; -export { ApiSettingModel } from "./apiSetting"; -export { AstMigrationModel } from "./astMigration"; -export { CheckConstraintModel } from "./checkConstraint"; -export { CompositeTypeModel } from "./compositeType"; -export { CorsSettingModel } from "./corsSetting"; -export { DatabaseModel } from "./database"; -export { DatabaseSettingModel } from "./databaseSetting"; -export { DatabaseTransferModel } from "./databaseTransfer"; -export { DefaultPrivilegeModel } from "./defaultPrivilege"; -export { DomainModel } from "./domain"; -export { DomainEventModel } from "./domainEvent"; -export { DomainVerificationModel } from "./domainVerification"; -export { EmbeddingChunkModel } from "./embeddingChunk"; -export { EnumModel } from "./enum"; -export { ExclusionConstraintModel } from "./exclusionConstraint"; -export { FieldModel } from "./field"; -export { ForeignKeyConstraintModel } from "./foreignKeyConstraint"; -export { FullTextSearchModel } from "./fullTextSearch"; -export { FunctionModel } from "./function"; -export { HostnameBindingModel } from "./hostnameBinding"; -export { HttpRouteModel } from "./httpRoute"; -export { IndexModel } from "./indexModel"; -export { ManagedDomainModel } from "./managedDomain"; -export { NodeTypeRegistryModel } from "./nodeTypeRegistry"; -export { PartitionModel } from "./partition"; -export { PlatformApiModel } from "./platformApi"; -export { PlatformApiModuleModel } from "./platformApiModule"; -export { PlatformApiSchemaModel } from "./platformApiSchema"; -export { PlatformApiSettingModel } from "./platformApiSetting"; -export { PlatformCorsSettingModel } from "./platformCorsSetting"; -export { PlatformDomainModel } from "./platformDomain"; -export { PlatformDomainEventModel } from "./platformDomainEvent"; -export { PlatformDomainVerificationModel } from "./platformDomainVerification"; -export { PlatformManagedDomainModel } from "./platformManagedDomain"; -export { PlatformSiteModel } from "./platformSite"; -export { PlatformSiteMetadatumModel } from "./platformSiteMetadatum"; -export { PlatformSiteModuleModel } from "./platformSiteModule"; -export { PlatformSiteThemeModel } from "./platformSiteTheme"; -export { PolicyModel } from "./policy"; -export { PrimaryKeyConstraintModel } from "./primaryKeyConstraint"; -export { PubkeySettingModel } from "./pubkeySetting"; -export { RlsSettingModel } from "./rlsSetting"; -export { RouteBindingModel } from "./routeBinding"; -export { RouteModel } from "./route"; -export { SchemaModel } from "./schema"; -export { SchemaGrantModel } from "./schemaGrant"; -export { SiteModel } from "./site"; -export { SiteMetadatumModel } from "./siteMetadatum"; -export { SiteModuleModel } from "./siteModule"; -export { SiteThemeModel } from "./siteTheme"; -export { SpatialRelationModel } from "./spatialRelation"; -export { SqlActionModel } from "./sqlAction"; -export { TableModel } from "./table"; -export { TableGrantModel } from "./tableGrant"; -export { TriggerModel } from "./trigger"; -export { TriggerFunctionModel } from "./triggerFunction"; -export { UniqueConstraintModel } from "./uniqueConstraint"; -export { ViewModel } from "./view"; -export { ViewGrantModel } from "./viewGrant"; -export { ViewRuleModel } from "./viewRule"; -export { ViewTableModel } from "./viewTable"; -export { WebauthnSettingModel } from "./webauthnSetting"; \ No newline at end of file +export { ApiModel } from './api'; +export { ApiModuleModel } from './apiModule'; +export { ApiSchemaModel } from './apiSchema'; +export { ApiSettingModel } from './apiSetting'; +export { AstMigrationModel } from './astMigration'; +export { CheckConstraintModel } from './checkConstraint'; +export { CompositeTypeModel } from './compositeType'; +export { CorsSettingModel } from './corsSetting'; +export { DatabaseModel } from './database'; +export { DatabaseSettingModel } from './databaseSetting'; +export { DatabaseTransferModel } from './databaseTransfer'; +export { DefaultPrivilegeModel } from './defaultPrivilege'; +export { DomainModel } from './domain'; +export { DomainEventModel } from './domainEvent'; +export { DomainVerificationModel } from './domainVerification'; +export { EmbeddingChunkModel } from './embeddingChunk'; +export { EnumModel } from './enum'; +export { ExclusionConstraintModel } from './exclusionConstraint'; +export { FieldModel } from './field'; +export { ForeignKeyConstraintModel } from './foreignKeyConstraint'; +export { FullTextSearchModel } from './fullTextSearch'; +export { FunctionModel } from './function'; +export { HostnameBindingModel } from './hostnameBinding'; +export { HttpRouteModel } from './httpRoute'; +export { IndexModel } from './indexModel'; +export { ManagedDomainModel } from './managedDomain'; +export { NodeTypeRegistryModel } from './nodeTypeRegistry'; +export { PartitionModel } from './partition'; +export { PlatformApiModel } from './platformApi'; +export { PlatformApiModuleModel } from './platformApiModule'; +export { PlatformApiSchemaModel } from './platformApiSchema'; +export { PlatformApiSettingModel } from './platformApiSetting'; +export { PlatformCorsSettingModel } from './platformCorsSetting'; +export { PlatformDomainModel } from './platformDomain'; +export { PlatformDomainEventModel } from './platformDomainEvent'; +export { PlatformDomainVerificationModel } from './platformDomainVerification'; +export { PlatformManagedDomainModel } from './platformManagedDomain'; +export { PlatformSiteModel } from './platformSite'; +export { PlatformSiteMetadatumModel } from './platformSiteMetadatum'; +export { PlatformSiteModuleModel } from './platformSiteModule'; +export { PlatformSiteThemeModel } from './platformSiteTheme'; +export { PolicyModel } from './policy'; +export { PrimaryKeyConstraintModel } from './primaryKeyConstraint'; +export { PubkeySettingModel } from './pubkeySetting'; +export { RlsSettingModel } from './rlsSetting'; +export { RouteBindingModel } from './routeBinding'; +export { RouteModel } from './route'; +export { SchemaModel } from './schema'; +export { SchemaGrantModel } from './schemaGrant'; +export { SiteModel } from './site'; +export { SiteMetadatumModel } from './siteMetadatum'; +export { SiteModuleModel } from './siteModule'; +export { SiteThemeModel } from './siteTheme'; +export { SpatialRelationModel } from './spatialRelation'; +export { SqlActionModel } from './sqlAction'; +export { TableModel } from './table'; +export { TableGrantModel } from './tableGrant'; +export { TriggerModel } from './trigger'; +export { TriggerFunctionModel } from './triggerFunction'; +export { UniqueConstraintModel } from './uniqueConstraint'; +export { ViewModel } from './view'; +export { ViewGrantModel } from './viewGrant'; +export { ViewRuleModel } from './viewRule'; +export { ViewTableModel } from './viewTable'; +export { WebauthnSettingModel } from './webauthnSetting'; diff --git a/sdk/constructive-sdk/src/api/orm/models/indexModel.ts b/sdk/constructive-sdk/src/api/orm/models/indexModel.ts index 38ebd55b62..919849c835 100644 --- a/sdk/constructive-sdk/src/api/orm/models/indexModel.ts +++ b/sdk/constructive-sdk/src/api/orm/models/indexModel.ts @@ -3,56 +3,96 @@ * @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 { Index, IndexWithRelations, IndexSelect, IndexFilter, IndexOrderBy, CreateIndexInput, UpdateIndexInput, IndexPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Index, + IndexWithRelations, + IndexSelect, + IndexFilter, + IndexOrderBy, + CreateIndexInput, + UpdateIndexInput, + IndexPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IndexModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ indices: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Index", "indices", 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 - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Index', + 'indices', + 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, + }, + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "indices", + operation: 'query', + operationName: 'Index', + fieldName: 'indices', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ index: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Index", "indices", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Index', + 'indices', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "index", + operation: 'query', + operationName: 'Index', + fieldName: 'index', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class IndexModel { nodes?: InferSelectResult[]; }; }) => ({ - "index": data.indices?.nodes?.[0] ?? null - }) + index: data.indices?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ index: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Index", "indices", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Index', + 'indices', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IndexFilter", "IndexOrderBy", connectionFieldsMap); + 'IndexFilter', + 'IndexOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Index", - fieldName: "index", + operation: 'query', + operationName: 'Index', + fieldName: 'index', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class IndexModel { nodes?: InferSelectResult[]; }; }) => ({ - "index": data.indices?.nodes?.[0] ?? null - }) + index: data.indices?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Index", "createIndex", "index", args.select, args.data, "CreateIndexInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Index', + 'createIndex', + 'index', + args.select, + args.data, + 'CreateIndexInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "createIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'createIndex', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IndexPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Index", "updateIndex", "index", args.select, args.where.id, args.data, "UpdateIndexInput", "id", "indexPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Index', + 'updateIndex', + 'index', + args.select, + args.where.id, + args.data, + 'UpdateIndexInput', + 'id', + 'indexPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "updateIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'updateIndex', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIndex: { index: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Index", "deleteIndex", "index", { - id: args.where.id - }, "DeleteIndexInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Index', + 'deleteIndex', + 'index', + { + id: args.where.id, + }, + 'DeleteIndexInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Index", - fieldName: "deleteIndex", + operation: 'mutation', + operationName: 'Index', + fieldName: 'deleteIndex', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/managedDomain.ts b/sdk/constructive-sdk/src/api/orm/models/managedDomain.ts index 780919d989..8b93f6e1ac 100644 --- a/sdk/constructive-sdk/src/api/orm/models/managedDomain.ts +++ b/sdk/constructive-sdk/src/api/orm/models/managedDomain.ts @@ -3,56 +3,96 @@ * @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 { ManagedDomain, ManagedDomainWithRelations, ManagedDomainSelect, ManagedDomainFilter, ManagedDomainOrderBy, CreateManagedDomainInput, UpdateManagedDomainInput, ManagedDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ManagedDomain, + ManagedDomainWithRelations, + ManagedDomainSelect, + ManagedDomainFilter, + ManagedDomainOrderBy, + CreateManagedDomainInput, + UpdateManagedDomainInput, + ManagedDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ManagedDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ManagedDomain", "managedDomains", 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 - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ManagedDomain', + 'managedDomains', + 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, + }, + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomains", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ManagedDomain", "managedDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ManagedDomain', + 'managedDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomain", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "managedDomain": data.managedDomains?.nodes?.[0] ?? null - }) + managedDomain: data.managedDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ managedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ManagedDomain", "managedDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ManagedDomain', + 'managedDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ManagedDomainFilter", "ManagedDomainOrderBy", connectionFieldsMap); + 'ManagedDomainFilter', + 'ManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ManagedDomain", - fieldName: "managedDomain", + operation: 'query', + operationName: 'ManagedDomain', + fieldName: 'managedDomain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "managedDomain": data.managedDomains?.nodes?.[0] ?? null - }) + managedDomain: data.managedDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ManagedDomain", "createManagedDomain", "managedDomain", args.select, args.data, "CreateManagedDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ManagedDomain', + 'createManagedDomain', + 'managedDomain', + args.select, + args.data, + 'CreateManagedDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "createManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'createManagedDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ManagedDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ManagedDomain", "updateManagedDomain", "managedDomain", args.select, args.where.id, args.data, "UpdateManagedDomainInput", "id", "managedDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ManagedDomain', + 'updateManagedDomain', + 'managedDomain', + args.select, + args.where.id, + args.data, + 'UpdateManagedDomainInput', + 'id', + 'managedDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "updateManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'updateManagedDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteManagedDomain: { managedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ManagedDomain", "deleteManagedDomain", "managedDomain", { - id: args.where.id - }, "DeleteManagedDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ManagedDomain', + 'deleteManagedDomain', + 'managedDomain', + { + id: args.where.id, + }, + 'DeleteManagedDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ManagedDomain", - fieldName: "deleteManagedDomain", + operation: 'mutation', + operationName: 'ManagedDomain', + fieldName: 'deleteManagedDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/nodeTypeRegistry.ts b/sdk/constructive-sdk/src/api/orm/models/nodeTypeRegistry.ts index 0124074e7a..ab4670e925 100644 --- a/sdk/constructive-sdk/src/api/orm/models/nodeTypeRegistry.ts +++ b/sdk/constructive-sdk/src/api/orm/models/nodeTypeRegistry.ts @@ -3,56 +3,96 @@ * @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 { NodeTypeRegistry, NodeTypeRegistryWithRelations, NodeTypeRegistrySelect, NodeTypeRegistryFilter, NodeTypeRegistryOrderBy, CreateNodeTypeRegistryInput, UpdateNodeTypeRegistryInput, NodeTypeRegistryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NodeTypeRegistry, + NodeTypeRegistryWithRelations, + NodeTypeRegistrySelect, + NodeTypeRegistryFilter, + NodeTypeRegistryOrderBy, + CreateNodeTypeRegistryInput, + UpdateNodeTypeRegistryInput, + NodeTypeRegistryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NodeTypeRegistryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistries: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NodeTypeRegistry", "nodeTypeRegistries", 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 - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + 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, + }, + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistries", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistry: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NodeTypeRegistry", "nodeTypeRegistries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistry", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistry', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NodeTypeRegistryModel { nodes?: InferSelectResult[]; }; }) => ({ - "nodeTypeRegistry": data.nodeTypeRegistries?.nodes?.[0] ?? null - }) + nodeTypeRegistry: data.nodeTypeRegistries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - name: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + name: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ nodeTypeRegistry: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NodeTypeRegistry", "nodeTypeRegistries", args.select, { - where: { - name: { - equalTo: args.name - } + const { document, variables } = buildFindManyDocument( + 'NodeTypeRegistry', + 'nodeTypeRegistries', + args.select, + { + where: { + name: { + equalTo: args.name, + }, + }, + first: 1, }, - first: 1 - }, "NodeTypeRegistryFilter", "NodeTypeRegistryOrderBy", connectionFieldsMap); + 'NodeTypeRegistryFilter', + 'NodeTypeRegistryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NodeTypeRegistry", - fieldName: "nodeTypeRegistry", + operation: 'query', + operationName: 'NodeTypeRegistry', + fieldName: 'nodeTypeRegistry', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NodeTypeRegistryModel { nodes?: InferSelectResult[]; }; }) => ({ - "nodeTypeRegistry": data.nodeTypeRegistries?.nodes?.[0] ?? null - }) + nodeTypeRegistry: data.nodeTypeRegistries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NodeTypeRegistry", "createNodeTypeRegistry", "nodeTypeRegistry", args.select, args.data, "CreateNodeTypeRegistryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NodeTypeRegistry', + 'createNodeTypeRegistry', + 'nodeTypeRegistry', + args.select, + args.data, + 'CreateNodeTypeRegistryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "createNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'createNodeTypeRegistry', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + name: string; + }, + NodeTypeRegistryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NodeTypeRegistry", "updateNodeTypeRegistry", "nodeTypeRegistry", args.select, args.where.name, args.data, "UpdateNodeTypeRegistryInput", "name", "nodeTypeRegistryPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NodeTypeRegistry', + 'updateNodeTypeRegistry', + 'nodeTypeRegistry', + args.select, + args.where.name, + args.data, + 'UpdateNodeTypeRegistryInput', + 'name', + 'nodeTypeRegistryPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "updateNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'updateNodeTypeRegistry', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - name: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + name: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNodeTypeRegistry: { nodeTypeRegistry: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NodeTypeRegistry", "deleteNodeTypeRegistry", "nodeTypeRegistry", { - name: args.where.name - }, "DeleteNodeTypeRegistryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NodeTypeRegistry', + 'deleteNodeTypeRegistry', + 'nodeTypeRegistry', + { + name: args.where.name, + }, + 'DeleteNodeTypeRegistryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NodeTypeRegistry", - fieldName: "deleteNodeTypeRegistry", + operation: 'mutation', + operationName: 'NodeTypeRegistry', + fieldName: 'deleteNodeTypeRegistry', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/partition.ts b/sdk/constructive-sdk/src/api/orm/models/partition.ts index f6b45122d8..1f848f6419 100644 --- a/sdk/constructive-sdk/src/api/orm/models/partition.ts +++ b/sdk/constructive-sdk/src/api/orm/models/partition.ts @@ -3,56 +3,96 @@ * @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 { Partition, PartitionWithRelations, PartitionSelect, PartitionFilter, PartitionOrderBy, CreatePartitionInput, UpdatePartitionInput, PartitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Partition, + PartitionWithRelations, + PartitionSelect, + PartitionFilter, + PartitionOrderBy, + CreatePartitionInput, + UpdatePartitionInput, + PartitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PartitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ partitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Partition", "partitions", 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 - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Partition', + 'partitions', + 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, + }, + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partitions", + operation: 'query', + operationName: 'Partition', + fieldName: 'partitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ partition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Partition", "partitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Partition', + 'partitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partition", + operation: 'query', + operationName: 'Partition', + fieldName: 'partition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PartitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "partition": data.partitions?.nodes?.[0] ?? null - }) + partition: data.partitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ partition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Partition", "partitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Partition', + 'partitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PartitionFilter", "PartitionOrderBy", connectionFieldsMap); + 'PartitionFilter', + 'PartitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Partition", - fieldName: "partition", + operation: 'query', + operationName: 'Partition', + fieldName: 'partition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PartitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "partition": data.partitions?.nodes?.[0] ?? null - }) + partition: data.partitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Partition", "createPartition", "partition", args.select, args.data, "CreatePartitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Partition', + 'createPartition', + 'partition', + args.select, + args.data, + 'CreatePartitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "createPartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'createPartition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PartitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Partition", "updatePartition", "partition", args.select, args.where.id, args.data, "UpdatePartitionInput", "id", "partitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Partition', + 'updatePartition', + 'partition', + args.select, + args.where.id, + args.data, + 'UpdatePartitionInput', + 'id', + 'partitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "updatePartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'updatePartition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePartition: { partition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Partition", "deletePartition", "partition", { - id: args.where.id - }, "DeletePartitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Partition', + 'deletePartition', + 'partition', + { + id: args.where.id, + }, + 'DeletePartitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Partition", - fieldName: "deletePartition", + operation: 'mutation', + operationName: 'Partition', + fieldName: 'deletePartition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformApi.ts b/sdk/constructive-sdk/src/api/orm/models/platformApi.ts index e51486fdec..3eee59e6c8 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformApi.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformApi.ts @@ -3,56 +3,96 @@ * @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 { PlatformApi, PlatformApiWithRelations, PlatformApiSelect, PlatformApiFilter, PlatformApiOrderBy, CreatePlatformApiInput, UpdatePlatformApiInput, PlatformApiPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApi, + PlatformApiWithRelations, + PlatformApiSelect, + PlatformApiFilter, + PlatformApiOrderBy, + CreatePlatformApiInput, + UpdatePlatformApiInput, + PlatformApiPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApis: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApi", "platformApis", 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 - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApi', + 'platformApis', + 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, + }, + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApis", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApis', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApi: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApi", "platformApis", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApi', + 'platformApis', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApi", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApi', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApi": data.platformApis?.nodes?.[0] ?? null - }) + platformApi: data.platformApis?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApi: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApi", "platformApis", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApi', + 'platformApis', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiFilter", "PlatformApiOrderBy", connectionFieldsMap); + 'PlatformApiFilter', + 'PlatformApiOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApi", - fieldName: "platformApi", + operation: 'query', + operationName: 'PlatformApi', + fieldName: 'platformApi', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApi": data.platformApis?.nodes?.[0] ?? null - }) + platformApi: data.platformApis?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApi", "createPlatformApi", "platformApi", args.select, args.data, "CreatePlatformApiInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApi', + 'createPlatformApi', + 'platformApi', + args.select, + args.data, + 'CreatePlatformApiInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "createPlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'createPlatformApi', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApi", "updatePlatformApi", "platformApi", args.select, args.where.id, args.data, "UpdatePlatformApiInput", "id", "platformApiPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApi', + 'updatePlatformApi', + 'platformApi', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiInput', + 'id', + 'platformApiPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "updatePlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'updatePlatformApi', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApi: { platformApi: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApi", "deletePlatformApi", "platformApi", { - id: args.where.id - }, "DeletePlatformApiInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApi', + 'deletePlatformApi', + 'platformApi', + { + id: args.where.id, + }, + 'DeletePlatformApiInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApi", - fieldName: "deletePlatformApi", + operation: 'mutation', + operationName: 'PlatformApi', + fieldName: 'deletePlatformApi', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformApiModule.ts b/sdk/constructive-sdk/src/api/orm/models/platformApiModule.ts index d4c89a7118..fe0fe89c45 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformApiModule.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformApiModule.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiModule, PlatformApiModuleWithRelations, PlatformApiModuleSelect, PlatformApiModuleFilter, PlatformApiModuleOrderBy, CreatePlatformApiModuleInput, UpdatePlatformApiModuleInput, PlatformApiModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiModule, + PlatformApiModuleWithRelations, + PlatformApiModuleSelect, + PlatformApiModuleFilter, + PlatformApiModuleOrderBy, + CreatePlatformApiModuleInput, + UpdatePlatformApiModuleInput, + PlatformApiModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiModule", "platformApiModules", 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 - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiModule', + 'platformApiModules', + 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, + }, + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModules", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiModule", "platformApiModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiModule', + 'platformApiModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModule", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiModule": data.platformApiModules?.nodes?.[0] ?? null - }) + platformApiModule: data.platformApiModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiModule", "platformApiModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiModule', + 'platformApiModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiModuleFilter", "PlatformApiModuleOrderBy", connectionFieldsMap); + 'PlatformApiModuleFilter', + 'PlatformApiModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiModule", - fieldName: "platformApiModule", + operation: 'query', + operationName: 'PlatformApiModule', + fieldName: 'platformApiModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiModule": data.platformApiModules?.nodes?.[0] ?? null - }) + platformApiModule: data.platformApiModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiModule", "createPlatformApiModule", "platformApiModule", args.select, args.data, "CreatePlatformApiModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiModule', + 'createPlatformApiModule', + 'platformApiModule', + args.select, + args.data, + 'CreatePlatformApiModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "createPlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'createPlatformApiModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiModule", "updatePlatformApiModule", "platformApiModule", args.select, args.where.id, args.data, "UpdatePlatformApiModuleInput", "id", "platformApiModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiModule', + 'updatePlatformApiModule', + 'platformApiModule', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiModuleInput', + 'id', + 'platformApiModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "updatePlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'updatePlatformApiModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiModule: { platformApiModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiModule", "deletePlatformApiModule", "platformApiModule", { - id: args.where.id - }, "DeletePlatformApiModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiModule', + 'deletePlatformApiModule', + 'platformApiModule', + { + id: args.where.id, + }, + 'DeletePlatformApiModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiModule", - fieldName: "deletePlatformApiModule", + operation: 'mutation', + operationName: 'PlatformApiModule', + fieldName: 'deletePlatformApiModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformApiSchema.ts b/sdk/constructive-sdk/src/api/orm/models/platformApiSchema.ts index 8dee7b12ed..45d57c9570 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformApiSchema.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformApiSchema.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiSchema, PlatformApiSchemaWithRelations, PlatformApiSchemaSelect, PlatformApiSchemaFilter, PlatformApiSchemaOrderBy, CreatePlatformApiSchemaInput, UpdatePlatformApiSchemaInput, PlatformApiSchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiSchema, + PlatformApiSchemaWithRelations, + PlatformApiSchemaSelect, + PlatformApiSchemaFilter, + PlatformApiSchemaOrderBy, + CreatePlatformApiSchemaInput, + UpdatePlatformApiSchemaInput, + PlatformApiSchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiSchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSchema", "platformApiSchemas", 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 - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + 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, + }, + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchemas", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiSchema", "platformApiSchemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchema", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSchema": data.platformApiSchemas?.nodes?.[0] ?? null - }) + platformApiSchema: data.platformApiSchemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSchema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSchema", "platformApiSchemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiSchema', + 'platformApiSchemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiSchemaFilter", "PlatformApiSchemaOrderBy", connectionFieldsMap); + 'PlatformApiSchemaFilter', + 'PlatformApiSchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSchema", - fieldName: "platformApiSchema", + operation: 'query', + operationName: 'PlatformApiSchema', + fieldName: 'platformApiSchema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiSchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSchema": data.platformApiSchemas?.nodes?.[0] ?? null - }) + platformApiSchema: data.platformApiSchemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiSchema", "createPlatformApiSchema", "platformApiSchema", args.select, args.data, "CreatePlatformApiSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiSchema', + 'createPlatformApiSchema', + 'platformApiSchema', + args.select, + args.data, + 'CreatePlatformApiSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "createPlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'createPlatformApiSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiSchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiSchema", "updatePlatformApiSchema", "platformApiSchema", args.select, args.where.id, args.data, "UpdatePlatformApiSchemaInput", "id", "platformApiSchemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiSchema', + 'updatePlatformApiSchema', + 'platformApiSchema', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiSchemaInput', + 'id', + 'platformApiSchemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "updatePlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'updatePlatformApiSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiSchema: { platformApiSchema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiSchema", "deletePlatformApiSchema", "platformApiSchema", { - id: args.where.id - }, "DeletePlatformApiSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiSchema', + 'deletePlatformApiSchema', + 'platformApiSchema', + { + id: args.where.id, + }, + 'DeletePlatformApiSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSchema", - fieldName: "deletePlatformApiSchema", + operation: 'mutation', + operationName: 'PlatformApiSchema', + fieldName: 'deletePlatformApiSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformApiSetting.ts b/sdk/constructive-sdk/src/api/orm/models/platformApiSetting.ts index 7326b52ed3..c84fedd66b 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformApiSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformApiSetting.ts @@ -3,56 +3,96 @@ * @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 { PlatformApiSetting, PlatformApiSettingWithRelations, PlatformApiSettingSelect, PlatformApiSettingFilter, PlatformApiSettingOrderBy, CreatePlatformApiSettingInput, UpdatePlatformApiSettingInput, PlatformApiSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformApiSetting, + PlatformApiSettingWithRelations, + PlatformApiSettingSelect, + PlatformApiSettingFilter, + PlatformApiSettingOrderBy, + CreatePlatformApiSettingInput, + UpdatePlatformApiSettingInput, + PlatformApiSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformApiSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSetting", "platformApiSettings", 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 - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformApiSetting', + 'platformApiSettings', + 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, + }, + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSettings", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformApiSetting", "platformApiSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformApiSetting', + 'platformApiSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSetting", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSetting": data.platformApiSettings?.nodes?.[0] ?? null - }) + platformApiSetting: data.platformApiSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformApiSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformApiSetting", "platformApiSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformApiSetting', + 'platformApiSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformApiSettingFilter", "PlatformApiSettingOrderBy", connectionFieldsMap); + 'PlatformApiSettingFilter', + 'PlatformApiSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformApiSetting", - fieldName: "platformApiSetting", + operation: 'query', + operationName: 'PlatformApiSetting', + fieldName: 'platformApiSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformApiSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformApiSetting": data.platformApiSettings?.nodes?.[0] ?? null - }) + platformApiSetting: data.platformApiSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformApiSetting", "createPlatformApiSetting", "platformApiSetting", args.select, args.data, "CreatePlatformApiSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformApiSetting', + 'createPlatformApiSetting', + 'platformApiSetting', + args.select, + args.data, + 'CreatePlatformApiSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "createPlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'createPlatformApiSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformApiSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformApiSetting", "updatePlatformApiSetting", "platformApiSetting", args.select, args.where.id, args.data, "UpdatePlatformApiSettingInput", "id", "platformApiSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformApiSetting', + 'updatePlatformApiSetting', + 'platformApiSetting', + args.select, + args.where.id, + args.data, + 'UpdatePlatformApiSettingInput', + 'id', + 'platformApiSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "updatePlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'updatePlatformApiSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformApiSetting: { platformApiSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformApiSetting", "deletePlatformApiSetting", "platformApiSetting", { - id: args.where.id - }, "DeletePlatformApiSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformApiSetting', + 'deletePlatformApiSetting', + 'platformApiSetting', + { + id: args.where.id, + }, + 'DeletePlatformApiSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformApiSetting", - fieldName: "deletePlatformApiSetting", + operation: 'mutation', + operationName: 'PlatformApiSetting', + fieldName: 'deletePlatformApiSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformCorsSetting.ts b/sdk/constructive-sdk/src/api/orm/models/platformCorsSetting.ts index 5d692ac827..02f5ce48f3 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformCorsSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformCorsSetting.ts @@ -3,56 +3,96 @@ * @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 { PlatformCorsSetting, PlatformCorsSettingWithRelations, PlatformCorsSettingSelect, PlatformCorsSettingFilter, PlatformCorsSettingOrderBy, CreatePlatformCorsSettingInput, UpdatePlatformCorsSettingInput, PlatformCorsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformCorsSetting, + PlatformCorsSettingWithRelations, + PlatformCorsSettingSelect, + PlatformCorsSettingFilter, + PlatformCorsSettingOrderBy, + CreatePlatformCorsSettingInput, + UpdatePlatformCorsSettingInput, + PlatformCorsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformCorsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformCorsSetting", "platformCorsSettings", 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 - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + 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, + }, + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSettings", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformCorsSetting", "platformCorsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSetting", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformCorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformCorsSetting": data.platformCorsSettings?.nodes?.[0] ?? null - }) + platformCorsSetting: data.platformCorsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformCorsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformCorsSetting", "platformCorsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformCorsSetting', + 'platformCorsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformCorsSettingFilter", "PlatformCorsSettingOrderBy", connectionFieldsMap); + 'PlatformCorsSettingFilter', + 'PlatformCorsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformCorsSetting", - fieldName: "platformCorsSetting", + operation: 'query', + operationName: 'PlatformCorsSetting', + fieldName: 'platformCorsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformCorsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformCorsSetting": data.platformCorsSettings?.nodes?.[0] ?? null - }) + platformCorsSetting: data.platformCorsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformCorsSetting", "createPlatformCorsSetting", "platformCorsSetting", args.select, args.data, "CreatePlatformCorsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformCorsSetting', + 'createPlatformCorsSetting', + 'platformCorsSetting', + args.select, + args.data, + 'CreatePlatformCorsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "createPlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'createPlatformCorsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformCorsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformCorsSetting", "updatePlatformCorsSetting", "platformCorsSetting", args.select, args.where.id, args.data, "UpdatePlatformCorsSettingInput", "id", "platformCorsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformCorsSetting', + 'updatePlatformCorsSetting', + 'platformCorsSetting', + args.select, + args.where.id, + args.data, + 'UpdatePlatformCorsSettingInput', + 'id', + 'platformCorsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "updatePlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'updatePlatformCorsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformCorsSetting: { platformCorsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformCorsSetting", "deletePlatformCorsSetting", "platformCorsSetting", { - id: args.where.id - }, "DeletePlatformCorsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformCorsSetting', + 'deletePlatformCorsSetting', + 'platformCorsSetting', + { + id: args.where.id, + }, + 'DeletePlatformCorsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformCorsSetting", - fieldName: "deletePlatformCorsSetting", + operation: 'mutation', + operationName: 'PlatformCorsSetting', + fieldName: 'deletePlatformCorsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformDomain.ts b/sdk/constructive-sdk/src/api/orm/models/platformDomain.ts index e1c4721eee..a87fc3495a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformDomain.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformDomain.ts @@ -3,56 +3,96 @@ * @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 { PlatformDomain, PlatformDomainWithRelations, PlatformDomainSelect, PlatformDomainFilter, PlatformDomainOrderBy, CreatePlatformDomainInput, UpdatePlatformDomainInput, PlatformDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomain, + PlatformDomainWithRelations, + PlatformDomainSelect, + PlatformDomainFilter, + PlatformDomainOrderBy, + CreatePlatformDomainInput, + UpdatePlatformDomainInput, + PlatformDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomains: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomain", "platformDomains", 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 - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomain', + 'platformDomains', + 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, + }, + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomains", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomain", "platformDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomain', + 'platformDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomain", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomain', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomain": data.platformDomains?.nodes?.[0] ?? null - }) + platformDomain: data.platformDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomain", "platformDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomain', + 'platformDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainFilter", "PlatformDomainOrderBy", connectionFieldsMap); + 'PlatformDomainFilter', + 'PlatformDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomain", - fieldName: "platformDomain", + operation: 'query', + operationName: 'PlatformDomain', + fieldName: 'platformDomain', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomain": data.platformDomains?.nodes?.[0] ?? null - }) + platformDomain: data.platformDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomain", "createPlatformDomain", "platformDomain", args.select, args.data, "CreatePlatformDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomain', + 'createPlatformDomain', + 'platformDomain', + args.select, + args.data, + 'CreatePlatformDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "createPlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'createPlatformDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomain", "updatePlatformDomain", "platformDomain", args.select, args.where.id, args.data, "UpdatePlatformDomainInput", "id", "platformDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomain', + 'updatePlatformDomain', + 'platformDomain', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainInput', + 'id', + 'platformDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "updatePlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'updatePlatformDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomain: { platformDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomain", "deletePlatformDomain", "platformDomain", { - id: args.where.id - }, "DeletePlatformDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomain', + 'deletePlatformDomain', + 'platformDomain', + { + id: args.where.id, + }, + 'DeletePlatformDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomain", - fieldName: "deletePlatformDomain", + operation: 'mutation', + operationName: 'PlatformDomain', + fieldName: 'deletePlatformDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformDomainEvent.ts b/sdk/constructive-sdk/src/api/orm/models/platformDomainEvent.ts index cf74bef292..0626ef3a7a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformDomainEvent.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformDomainEvent.ts @@ -3,56 +3,96 @@ * @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 { PlatformDomainEvent, PlatformDomainEventWithRelations, PlatformDomainEventSelect, PlatformDomainEventFilter, PlatformDomainEventOrderBy, CreatePlatformDomainEventInput, UpdatePlatformDomainEventInput, PlatformDomainEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomainEvent, + PlatformDomainEventWithRelations, + PlatformDomainEventSelect, + PlatformDomainEventFilter, + PlatformDomainEventOrderBy, + CreatePlatformDomainEventInput, + UpdatePlatformDomainEventInput, + PlatformDomainEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainEvent", "platformDomainEvents", 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 - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + 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, + }, + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvents", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomainEvent", "platformDomainEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvent", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformDomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainEvent": data.platformDomainEvents?.nodes?.[0] ?? null - }) + platformDomainEvent: data.platformDomainEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformDomainEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainEvent", "platformDomainEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomainEvent', + 'platformDomainEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainEventFilter", "PlatformDomainEventOrderBy", connectionFieldsMap); + 'PlatformDomainEventFilter', + 'PlatformDomainEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainEvent", - fieldName: "platformDomainEvent", + operation: 'query', + operationName: 'PlatformDomainEvent', + fieldName: 'platformDomainEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformDomainEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainEvent": data.platformDomainEvents?.nodes?.[0] ?? null - }) + platformDomainEvent: data.platformDomainEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomainEvent", "createPlatformDomainEvent", "platformDomainEvent", args.select, args.data, "CreatePlatformDomainEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomainEvent', + 'createPlatformDomainEvent', + 'platformDomainEvent', + args.select, + args.data, + 'CreatePlatformDomainEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "createPlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'createPlatformDomainEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomainEvent", "updatePlatformDomainEvent", "platformDomainEvent", args.select, args.where.id, args.data, "UpdatePlatformDomainEventInput", "id", "platformDomainEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomainEvent', + 'updatePlatformDomainEvent', + 'platformDomainEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainEventInput', + 'id', + 'platformDomainEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "updatePlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'updatePlatformDomainEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomainEvent: { platformDomainEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomainEvent", "deletePlatformDomainEvent", "platformDomainEvent", { - id: args.where.id - }, "DeletePlatformDomainEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomainEvent', + 'deletePlatformDomainEvent', + 'platformDomainEvent', + { + id: args.where.id, + }, + 'DeletePlatformDomainEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainEvent", - fieldName: "deletePlatformDomainEvent", + operation: 'mutation', + operationName: 'PlatformDomainEvent', + fieldName: 'deletePlatformDomainEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformDomainVerification.ts b/sdk/constructive-sdk/src/api/orm/models/platformDomainVerification.ts index c6066ed06f..92b3873048 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformDomainVerification.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformDomainVerification.ts @@ -3,56 +3,101 @@ * @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 { PlatformDomainVerification, PlatformDomainVerificationWithRelations, PlatformDomainVerificationSelect, PlatformDomainVerificationFilter, PlatformDomainVerificationOrderBy, CreatePlatformDomainVerificationInput, UpdatePlatformDomainVerificationInput, PlatformDomainVerificationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformDomainVerification, + PlatformDomainVerificationWithRelations, + PlatformDomainVerificationSelect, + PlatformDomainVerificationFilter, + PlatformDomainVerificationOrderBy, + CreatePlatformDomainVerificationInput, + UpdatePlatformDomainVerificationInput, + PlatformDomainVerificationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformDomainVerificationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerifications: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerifications: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainVerification", "platformDomainVerifications", 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 - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + 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, + }, + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerifications", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerifications', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerification: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerification: InferSelectResult< + PlatformDomainVerificationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformDomainVerification", "platformDomainVerifications", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerification", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerification', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformDomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainVerification": data.platformDomainVerifications?.nodes?.[0] ?? null - }) + platformDomainVerification: data.platformDomainVerifications?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformDomainVerification: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformDomainVerification: InferSelectResult< + PlatformDomainVerificationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformDomainVerification", "platformDomainVerifications", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformDomainVerification', + 'platformDomainVerifications', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformDomainVerificationFilter", "PlatformDomainVerificationOrderBy", connectionFieldsMap); + 'PlatformDomainVerificationFilter', + 'PlatformDomainVerificationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformDomainVerification", - fieldName: "platformDomainVerification", + operation: 'query', + operationName: 'PlatformDomainVerification', + fieldName: 'platformDomainVerification', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformDomainVerificationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformDomainVerification": data.platformDomainVerifications?.nodes?.[0] ?? null - }) + platformDomainVerification: data.platformDomainVerifications?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformDomainVerification", "createPlatformDomainVerification", "platformDomainVerification", args.select, args.data, "CreatePlatformDomainVerificationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformDomainVerification', + 'createPlatformDomainVerification', + 'platformDomainVerification', + args.select, + args.data, + 'CreatePlatformDomainVerificationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "createPlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'createPlatformDomainVerification', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformDomainVerificationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformDomainVerification", "updatePlatformDomainVerification", "platformDomainVerification", args.select, args.where.id, args.data, "UpdatePlatformDomainVerificationInput", "id", "platformDomainVerificationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformDomainVerification', + 'updatePlatformDomainVerification', + 'platformDomainVerification', + args.select, + args.where.id, + args.data, + 'UpdatePlatformDomainVerificationInput', + 'id', + 'platformDomainVerificationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "updatePlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'updatePlatformDomainVerification', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformDomainVerification: { platformDomainVerification: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformDomainVerification", "deletePlatformDomainVerification", "platformDomainVerification", { - id: args.where.id - }, "DeletePlatformDomainVerificationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformDomainVerification', + 'deletePlatformDomainVerification', + 'platformDomainVerification', + { + id: args.where.id, + }, + 'DeletePlatformDomainVerificationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformDomainVerification", - fieldName: "deletePlatformDomainVerification", + operation: 'mutation', + operationName: 'PlatformDomainVerification', + fieldName: 'deletePlatformDomainVerification', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformManagedDomain.ts b/sdk/constructive-sdk/src/api/orm/models/platformManagedDomain.ts index 28aa514693..3c1cc45243 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformManagedDomain.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformManagedDomain.ts @@ -3,56 +3,98 @@ * @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 { PlatformManagedDomain, PlatformManagedDomainWithRelations, PlatformManagedDomainSelect, PlatformManagedDomainFilter, PlatformManagedDomainOrderBy, CreatePlatformManagedDomainInput, UpdatePlatformManagedDomainInput, PlatformManagedDomainPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformManagedDomain, + PlatformManagedDomainWithRelations, + PlatformManagedDomainSelect, + PlatformManagedDomainFilter, + PlatformManagedDomainOrderBy, + CreatePlatformManagedDomainInput, + UpdatePlatformManagedDomainInput, + PlatformManagedDomainPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformManagedDomainModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformManagedDomains: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformManagedDomains: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformManagedDomain", "platformManagedDomains", 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 - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + 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, + }, + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomains", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomains', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformManagedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformManagedDomain", "platformManagedDomains", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomain", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomain', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformManagedDomain": data.platformManagedDomains?.nodes?.[0] ?? null - }) + platformManagedDomain: data.platformManagedDomains?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformManagedDomain: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformManagedDomain", "platformManagedDomains", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformManagedDomain', + 'platformManagedDomains', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformManagedDomainFilter", "PlatformManagedDomainOrderBy", connectionFieldsMap); + 'PlatformManagedDomainFilter', + 'PlatformManagedDomainOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformManagedDomain", - fieldName: "platformManagedDomain", + operation: 'query', + operationName: 'PlatformManagedDomain', + fieldName: 'platformManagedDomain', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformManagedDomainModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformManagedDomain": data.platformManagedDomains?.nodes?.[0] ?? null - }) + platformManagedDomain: data.platformManagedDomains?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformManagedDomain", "createPlatformManagedDomain", "platformManagedDomain", args.select, args.data, "CreatePlatformManagedDomainInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformManagedDomain', + 'createPlatformManagedDomain', + 'platformManagedDomain', + args.select, + args.data, + 'CreatePlatformManagedDomainInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "createPlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'createPlatformManagedDomain', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformManagedDomainPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformManagedDomain", "updatePlatformManagedDomain", "platformManagedDomain", args.select, args.where.id, args.data, "UpdatePlatformManagedDomainInput", "id", "platformManagedDomainPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformManagedDomain', + 'updatePlatformManagedDomain', + 'platformManagedDomain', + args.select, + args.where.id, + args.data, + 'UpdatePlatformManagedDomainInput', + 'id', + 'platformManagedDomainPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "updatePlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'updatePlatformManagedDomain', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformManagedDomain: { platformManagedDomain: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformManagedDomain", "deletePlatformManagedDomain", "platformManagedDomain", { - id: args.where.id - }, "DeletePlatformManagedDomainInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformManagedDomain', + 'deletePlatformManagedDomain', + 'platformManagedDomain', + { + id: args.where.id, + }, + 'DeletePlatformManagedDomainInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformManagedDomain", - fieldName: "deletePlatformManagedDomain", + operation: 'mutation', + operationName: 'PlatformManagedDomain', + fieldName: 'deletePlatformManagedDomain', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformSite.ts b/sdk/constructive-sdk/src/api/orm/models/platformSite.ts index 7deeb9578e..4ac8c5a064 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformSite.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformSite.ts @@ -3,56 +3,96 @@ * @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 { PlatformSite, PlatformSiteWithRelations, PlatformSiteSelect, PlatformSiteFilter, PlatformSiteOrderBy, CreatePlatformSiteInput, UpdatePlatformSiteInput, PlatformSitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSite, + PlatformSiteWithRelations, + PlatformSiteSelect, + PlatformSiteFilter, + PlatformSiteOrderBy, + CreatePlatformSiteInput, + UpdatePlatformSiteInput, + PlatformSitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSite", "platformSites", 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 - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSite', + 'platformSites', + 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, + }, + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSites", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSite", "platformSites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSite', + 'platformSites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSite", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSite', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSite": data.platformSites?.nodes?.[0] ?? null - }) + platformSite: data.platformSites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSite: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSite", "platformSites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSite', + 'platformSites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteFilter", "PlatformSiteOrderBy", connectionFieldsMap); + 'PlatformSiteFilter', + 'PlatformSiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSite", - fieldName: "platformSite", + operation: 'query', + operationName: 'PlatformSite', + fieldName: 'platformSite', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSite": data.platformSites?.nodes?.[0] ?? null - }) + platformSite: data.platformSites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSite", "createPlatformSite", "platformSite", args.select, args.data, "CreatePlatformSiteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSite', + 'createPlatformSite', + 'platformSite', + args.select, + args.data, + 'CreatePlatformSiteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "createPlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'createPlatformSite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSite", "updatePlatformSite", "platformSite", args.select, args.where.id, args.data, "UpdatePlatformSiteInput", "id", "platformSitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSite', + 'updatePlatformSite', + 'platformSite', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteInput', + 'id', + 'platformSitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "updatePlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'updatePlatformSite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSite: { platformSite: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSite", "deletePlatformSite", "platformSite", { - id: args.where.id - }, "DeletePlatformSiteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSite', + 'deletePlatformSite', + 'platformSite', + { + id: args.where.id, + }, + 'DeletePlatformSiteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSite", - fieldName: "deletePlatformSite", + operation: 'mutation', + operationName: 'PlatformSite', + fieldName: 'deletePlatformSite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformSiteMetadatum.ts b/sdk/constructive-sdk/src/api/orm/models/platformSiteMetadatum.ts index 181e7e7b02..8ca55b3e2d 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformSiteMetadatum.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformSiteMetadatum.ts @@ -3,56 +3,98 @@ * @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 { PlatformSiteMetadatum, PlatformSiteMetadatumWithRelations, PlatformSiteMetadatumSelect, PlatformSiteMetadatumFilter, PlatformSiteMetadatumOrderBy, CreatePlatformSiteMetadatumInput, UpdatePlatformSiteMetadatumInput, PlatformSiteMetadatumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteMetadatum, + PlatformSiteMetadatumWithRelations, + PlatformSiteMetadatumSelect, + PlatformSiteMetadatumFilter, + PlatformSiteMetadatumOrderBy, + CreatePlatformSiteMetadatumInput, + UpdatePlatformSiteMetadatumInput, + PlatformSiteMetadatumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteMetadatumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformSiteMetadata: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformSiteMetadata: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteMetadatum", "platformSiteMetadata", 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 - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + 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, + }, + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadata", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadata', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteMetadatum", "platformSiteMetadata", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadatum", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadatum', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformSiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteMetadatum": data.platformSiteMetadata?.nodes?.[0] ?? null - }) + platformSiteMetadatum: data.platformSiteMetadata?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteMetadatum", "platformSiteMetadata", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteMetadatum', + 'platformSiteMetadata', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteMetadatumFilter", "PlatformSiteMetadatumOrderBy", connectionFieldsMap); + 'PlatformSiteMetadatumFilter', + 'PlatformSiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteMetadatum", - fieldName: "platformSiteMetadatum", + operation: 'query', + operationName: 'PlatformSiteMetadatum', + fieldName: 'platformSiteMetadatum', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformSiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteMetadatum": data.platformSiteMetadata?.nodes?.[0] ?? null - }) + platformSiteMetadatum: data.platformSiteMetadata?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteMetadatum", "createPlatformSiteMetadatum", "platformSiteMetadatum", args.select, args.data, "CreatePlatformSiteMetadatumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteMetadatum', + 'createPlatformSiteMetadatum', + 'platformSiteMetadatum', + args.select, + args.data, + 'CreatePlatformSiteMetadatumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "createPlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'createPlatformSiteMetadatum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteMetadatumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteMetadatum", "updatePlatformSiteMetadatum", "platformSiteMetadatum", args.select, args.where.id, args.data, "UpdatePlatformSiteMetadatumInput", "id", "platformSiteMetadatumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteMetadatum', + 'updatePlatformSiteMetadatum', + 'platformSiteMetadatum', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteMetadatumInput', + 'id', + 'platformSiteMetadatumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "updatePlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'updatePlatformSiteMetadatum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteMetadatum: { platformSiteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteMetadatum", "deletePlatformSiteMetadatum", "platformSiteMetadatum", { - id: args.where.id - }, "DeletePlatformSiteMetadatumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteMetadatum', + 'deletePlatformSiteMetadatum', + 'platformSiteMetadatum', + { + id: args.where.id, + }, + 'DeletePlatformSiteMetadatumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteMetadatum", - fieldName: "deletePlatformSiteMetadatum", + operation: 'mutation', + operationName: 'PlatformSiteMetadatum', + fieldName: 'deletePlatformSiteMetadatum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformSiteModule.ts b/sdk/constructive-sdk/src/api/orm/models/platformSiteModule.ts index 0476688298..e01bb42a05 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformSiteModule.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformSiteModule.ts @@ -3,56 +3,96 @@ * @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 { PlatformSiteModule, PlatformSiteModuleWithRelations, PlatformSiteModuleSelect, PlatformSiteModuleFilter, PlatformSiteModuleOrderBy, CreatePlatformSiteModuleInput, UpdatePlatformSiteModuleInput, PlatformSiteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteModule, + PlatformSiteModuleWithRelations, + PlatformSiteModuleSelect, + PlatformSiteModuleFilter, + PlatformSiteModuleOrderBy, + CreatePlatformSiteModuleInput, + UpdatePlatformSiteModuleInput, + PlatformSiteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteModule", "platformSiteModules", 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 - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteModule', + 'platformSiteModules', + 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, + }, + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModules", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteModule", "platformSiteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteModule', + 'platformSiteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModule", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteModule": data.platformSiteModules?.nodes?.[0] ?? null - }) + platformSiteModule: data.platformSiteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteModule", "platformSiteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteModule', + 'platformSiteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteModuleFilter", "PlatformSiteModuleOrderBy", connectionFieldsMap); + 'PlatformSiteModuleFilter', + 'PlatformSiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteModule", - fieldName: "platformSiteModule", + operation: 'query', + operationName: 'PlatformSiteModule', + fieldName: 'platformSiteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteModule": data.platformSiteModules?.nodes?.[0] ?? null - }) + platformSiteModule: data.platformSiteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteModule", "createPlatformSiteModule", "platformSiteModule", args.select, args.data, "CreatePlatformSiteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteModule', + 'createPlatformSiteModule', + 'platformSiteModule', + args.select, + args.data, + 'CreatePlatformSiteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "createPlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'createPlatformSiteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteModule", "updatePlatformSiteModule", "platformSiteModule", args.select, args.where.id, args.data, "UpdatePlatformSiteModuleInput", "id", "platformSiteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteModule', + 'updatePlatformSiteModule', + 'platformSiteModule', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteModuleInput', + 'id', + 'platformSiteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "updatePlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'updatePlatformSiteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteModule: { platformSiteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteModule", "deletePlatformSiteModule", "platformSiteModule", { - id: args.where.id - }, "DeletePlatformSiteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteModule', + 'deletePlatformSiteModule', + 'platformSiteModule', + { + id: args.where.id, + }, + 'DeletePlatformSiteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteModule", - fieldName: "deletePlatformSiteModule", + operation: 'mutation', + operationName: 'PlatformSiteModule', + fieldName: 'deletePlatformSiteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/platformSiteTheme.ts b/sdk/constructive-sdk/src/api/orm/models/platformSiteTheme.ts index bc002ebb11..585071722f 100644 --- a/sdk/constructive-sdk/src/api/orm/models/platformSiteTheme.ts +++ b/sdk/constructive-sdk/src/api/orm/models/platformSiteTheme.ts @@ -3,56 +3,96 @@ * @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 { PlatformSiteTheme, PlatformSiteThemeWithRelations, PlatformSiteThemeSelect, PlatformSiteThemeFilter, PlatformSiteThemeOrderBy, CreatePlatformSiteThemeInput, UpdatePlatformSiteThemeInput, PlatformSiteThemePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSiteTheme, + PlatformSiteThemeWithRelations, + PlatformSiteThemeSelect, + PlatformSiteThemeFilter, + PlatformSiteThemeOrderBy, + CreatePlatformSiteThemeInput, + UpdatePlatformSiteThemeInput, + PlatformSiteThemePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSiteThemeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteThemes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteTheme", "platformSiteThemes", 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 - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + 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, + }, + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteThemes", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteThemes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSiteTheme", "platformSiteThemes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteTheme", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteTheme', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteTheme": data.platformSiteThemes?.nodes?.[0] ?? null - }) + platformSiteTheme: data.platformSiteThemes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSiteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSiteTheme", "platformSiteThemes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSiteTheme', + 'platformSiteThemes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSiteThemeFilter", "PlatformSiteThemeOrderBy", connectionFieldsMap); + 'PlatformSiteThemeFilter', + 'PlatformSiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSiteTheme", - fieldName: "platformSiteTheme", + operation: 'query', + operationName: 'PlatformSiteTheme', + fieldName: 'platformSiteTheme', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformSiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSiteTheme": data.platformSiteThemes?.nodes?.[0] ?? null - }) + platformSiteTheme: data.platformSiteThemes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSiteTheme", "createPlatformSiteTheme", "platformSiteTheme", args.select, args.data, "CreatePlatformSiteThemeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSiteTheme', + 'createPlatformSiteTheme', + 'platformSiteTheme', + args.select, + args.data, + 'CreatePlatformSiteThemeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "createPlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'createPlatformSiteTheme', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformSiteThemePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformSiteTheme", "updatePlatformSiteTheme", "platformSiteTheme", args.select, args.where.id, args.data, "UpdatePlatformSiteThemeInput", "id", "platformSiteThemePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformSiteTheme', + 'updatePlatformSiteTheme', + 'platformSiteTheme', + args.select, + args.where.id, + args.data, + 'UpdatePlatformSiteThemeInput', + 'id', + 'platformSiteThemePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "updatePlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'updatePlatformSiteTheme', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformSiteTheme: { platformSiteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformSiteTheme", "deletePlatformSiteTheme", "platformSiteTheme", { - id: args.where.id - }, "DeletePlatformSiteThemeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformSiteTheme', + 'deletePlatformSiteTheme', + 'platformSiteTheme', + { + id: args.where.id, + }, + 'DeletePlatformSiteThemeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSiteTheme", - fieldName: "deletePlatformSiteTheme", + operation: 'mutation', + operationName: 'PlatformSiteTheme', + fieldName: 'deletePlatformSiteTheme', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/policy.ts b/sdk/constructive-sdk/src/api/orm/models/policy.ts index fd0c410789..0b50aa86d3 100644 --- a/sdk/constructive-sdk/src/api/orm/models/policy.ts +++ b/sdk/constructive-sdk/src/api/orm/models/policy.ts @@ -3,56 +3,96 @@ * @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 { Policy, PolicyWithRelations, PolicySelect, PolicyFilter, PolicyOrderBy, CreatePolicyInput, UpdatePolicyInput, PolicyPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Policy, + PolicyWithRelations, + PolicySelect, + PolicyFilter, + PolicyOrderBy, + CreatePolicyInput, + UpdatePolicyInput, + PolicyPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PolicyModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ policies: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Policy", "policies", 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 - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Policy', + 'policies', + 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, + }, + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policies", + operation: 'query', + operationName: 'Policy', + fieldName: 'policies', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ policy: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Policy", "policies", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Policy', + 'policies', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policy", + operation: 'query', + operationName: 'Policy', + fieldName: 'policy', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PolicyModel { nodes?: InferSelectResult[]; }; }) => ({ - "policy": data.policies?.nodes?.[0] ?? null - }) + policy: data.policies?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ policy: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Policy", "policies", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Policy', + 'policies', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PolicyFilter", "PolicyOrderBy", connectionFieldsMap); + 'PolicyFilter', + 'PolicyOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Policy", - fieldName: "policy", + operation: 'query', + operationName: 'Policy', + fieldName: 'policy', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PolicyModel { nodes?: InferSelectResult[]; }; }) => ({ - "policy": data.policies?.nodes?.[0] ?? null - }) + policy: data.policies?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Policy", "createPolicy", "policy", args.select, args.data, "CreatePolicyInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Policy', + 'createPolicy', + 'policy', + args.select, + args.data, + 'CreatePolicyInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "createPolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'createPolicy', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PolicyPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Policy", "updatePolicy", "policy", args.select, args.where.id, args.data, "UpdatePolicyInput", "id", "policyPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Policy', + 'updatePolicy', + 'policy', + args.select, + args.where.id, + args.data, + 'UpdatePolicyInput', + 'id', + 'policyPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "updatePolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'updatePolicy', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePolicy: { policy: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Policy", "deletePolicy", "policy", { - id: args.where.id - }, "DeletePolicyInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Policy', + 'deletePolicy', + 'policy', + { + id: args.where.id, + }, + 'DeletePolicyInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Policy", - fieldName: "deletePolicy", + operation: 'mutation', + operationName: 'Policy', + fieldName: 'deletePolicy', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/primaryKeyConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/primaryKeyConstraint.ts index a1015e4a8d..65f2946d86 100644 --- a/sdk/constructive-sdk/src/api/orm/models/primaryKeyConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/primaryKeyConstraint.ts @@ -3,56 +3,98 @@ * @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 { PrimaryKeyConstraint, PrimaryKeyConstraintWithRelations, PrimaryKeyConstraintSelect, PrimaryKeyConstraintFilter, PrimaryKeyConstraintOrderBy, CreatePrimaryKeyConstraintInput, UpdatePrimaryKeyConstraintInput, PrimaryKeyConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PrimaryKeyConstraint, + PrimaryKeyConstraintWithRelations, + PrimaryKeyConstraintSelect, + PrimaryKeyConstraintFilter, + PrimaryKeyConstraintOrderBy, + CreatePrimaryKeyConstraintInput, + UpdatePrimaryKeyConstraintInput, + PrimaryKeyConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PrimaryKeyConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - primaryKeyConstraints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + primaryKeyConstraints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PrimaryKeyConstraint", "primaryKeyConstraints", 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 - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + 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, + }, + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraints", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ primaryKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PrimaryKeyConstraint", "primaryKeyConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraint", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PrimaryKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "primaryKeyConstraint": data.primaryKeyConstraints?.nodes?.[0] ?? null - }) + primaryKeyConstraint: data.primaryKeyConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ primaryKeyConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrimaryKeyConstraint", "primaryKeyConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrimaryKeyConstraint', + 'primaryKeyConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrimaryKeyConstraintFilter", "PrimaryKeyConstraintOrderBy", connectionFieldsMap); + 'PrimaryKeyConstraintFilter', + 'PrimaryKeyConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrimaryKeyConstraint", - fieldName: "primaryKeyConstraint", + operation: 'query', + operationName: 'PrimaryKeyConstraint', + fieldName: 'primaryKeyConstraint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PrimaryKeyConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "primaryKeyConstraint": data.primaryKeyConstraints?.nodes?.[0] ?? null - }) + primaryKeyConstraint: data.primaryKeyConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrimaryKeyConstraint", "createPrimaryKeyConstraint", "primaryKeyConstraint", args.select, args.data, "CreatePrimaryKeyConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PrimaryKeyConstraint', + 'createPrimaryKeyConstraint', + 'primaryKeyConstraint', + args.select, + args.data, + 'CreatePrimaryKeyConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "createPrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'createPrimaryKeyConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrimaryKeyConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PrimaryKeyConstraint", "updatePrimaryKeyConstraint", "primaryKeyConstraint", args.select, args.where.id, args.data, "UpdatePrimaryKeyConstraintInput", "id", "primaryKeyConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PrimaryKeyConstraint', + 'updatePrimaryKeyConstraint', + 'primaryKeyConstraint', + args.select, + args.where.id, + args.data, + 'UpdatePrimaryKeyConstraintInput', + 'id', + 'primaryKeyConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "updatePrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'updatePrimaryKeyConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePrimaryKeyConstraint: { primaryKeyConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PrimaryKeyConstraint", "deletePrimaryKeyConstraint", "primaryKeyConstraint", { - id: args.where.id - }, "DeletePrimaryKeyConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PrimaryKeyConstraint', + 'deletePrimaryKeyConstraint', + 'primaryKeyConstraint', + { + id: args.where.id, + }, + 'DeletePrimaryKeyConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PrimaryKeyConstraint", - fieldName: "deletePrimaryKeyConstraint", + operation: 'mutation', + operationName: 'PrimaryKeyConstraint', + fieldName: 'deletePrimaryKeyConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/pubkeySetting.ts b/sdk/constructive-sdk/src/api/orm/models/pubkeySetting.ts index 0108538df3..e44627cac6 100644 --- a/sdk/constructive-sdk/src/api/orm/models/pubkeySetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/pubkeySetting.ts @@ -3,56 +3,96 @@ * @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 { PubkeySetting, PubkeySettingWithRelations, PubkeySettingSelect, PubkeySettingFilter, PubkeySettingOrderBy, CreatePubkeySettingInput, UpdatePubkeySettingInput, PubkeySettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PubkeySetting, + PubkeySettingWithRelations, + PubkeySettingSelect, + PubkeySettingFilter, + PubkeySettingOrderBy, + CreatePubkeySettingInput, + UpdatePubkeySettingInput, + PubkeySettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PubkeySettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PubkeySetting", "pubkeySettings", 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 - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PubkeySetting', + 'pubkeySettings', + 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, + }, + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySettings", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PubkeySetting", "pubkeySettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PubkeySetting', + 'pubkeySettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySetting", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PubkeySettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "pubkeySetting": data.pubkeySettings?.nodes?.[0] ?? null - }) + pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ pubkeySetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PubkeySetting", "pubkeySettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PubkeySetting', + 'pubkeySettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PubkeySettingFilter", "PubkeySettingOrderBy", connectionFieldsMap); + 'PubkeySettingFilter', + 'PubkeySettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PubkeySetting", - fieldName: "pubkeySetting", + operation: 'query', + operationName: 'PubkeySetting', + fieldName: 'pubkeySetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PubkeySettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "pubkeySetting": data.pubkeySettings?.nodes?.[0] ?? null - }) + pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PubkeySetting", "createPubkeySetting", "pubkeySetting", args.select, args.data, "CreatePubkeySettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PubkeySetting', + 'createPubkeySetting', + 'pubkeySetting', + args.select, + args.data, + 'CreatePubkeySettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "createPubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'createPubkeySetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PubkeySettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PubkeySetting", "updatePubkeySetting", "pubkeySetting", args.select, args.where.id, args.data, "UpdatePubkeySettingInput", "id", "pubkeySettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PubkeySetting', + 'updatePubkeySetting', + 'pubkeySetting', + args.select, + args.where.id, + args.data, + 'UpdatePubkeySettingInput', + 'id', + 'pubkeySettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "updatePubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'updatePubkeySetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePubkeySetting: { pubkeySetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PubkeySetting", "deletePubkeySetting", "pubkeySetting", { - id: args.where.id - }, "DeletePubkeySettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PubkeySetting', + 'deletePubkeySetting', + 'pubkeySetting', + { + id: args.where.id, + }, + 'DeletePubkeySettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PubkeySetting", - fieldName: "deletePubkeySetting", + operation: 'mutation', + operationName: 'PubkeySetting', + fieldName: 'deletePubkeySetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/rlsSetting.ts b/sdk/constructive-sdk/src/api/orm/models/rlsSetting.ts index 235ffd888c..f371074a3a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/rlsSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/rlsSetting.ts @@ -3,56 +3,96 @@ * @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 { RlsSetting, RlsSettingWithRelations, RlsSettingSelect, RlsSettingFilter, RlsSettingOrderBy, CreateRlsSettingInput, UpdateRlsSettingInput, RlsSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RlsSetting, + RlsSettingWithRelations, + RlsSettingSelect, + RlsSettingFilter, + RlsSettingOrderBy, + CreateRlsSettingInput, + UpdateRlsSettingInput, + RlsSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RlsSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RlsSetting", "rlsSettings", 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 - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RlsSetting', + 'rlsSettings', + 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, + }, + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSettings", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RlsSetting", "rlsSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RlsSetting', + 'rlsSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSetting", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RlsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsSetting": data.rlsSettings?.nodes?.[0] ?? null - }) + rlsSetting: data.rlsSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RlsSetting", "rlsSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RlsSetting', + 'rlsSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RlsSettingFilter", "RlsSettingOrderBy", connectionFieldsMap); + 'RlsSettingFilter', + 'RlsSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsSetting", - fieldName: "rlsSetting", + operation: 'query', + operationName: 'RlsSetting', + fieldName: 'rlsSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RlsSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsSetting": data.rlsSettings?.nodes?.[0] ?? null - }) + rlsSetting: data.rlsSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RlsSetting", "createRlsSetting", "rlsSetting", args.select, args.data, "CreateRlsSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RlsSetting', + 'createRlsSetting', + 'rlsSetting', + args.select, + args.data, + 'CreateRlsSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "createRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'createRlsSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RlsSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RlsSetting", "updateRlsSetting", "rlsSetting", args.select, args.where.id, args.data, "UpdateRlsSettingInput", "id", "rlsSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RlsSetting', + 'updateRlsSetting', + 'rlsSetting', + args.select, + args.where.id, + args.data, + 'UpdateRlsSettingInput', + 'id', + 'rlsSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "updateRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'updateRlsSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRlsSetting: { rlsSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RlsSetting", "deleteRlsSetting", "rlsSetting", { - id: args.where.id - }, "DeleteRlsSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RlsSetting', + 'deleteRlsSetting', + 'rlsSetting', + { + id: args.where.id, + }, + 'DeleteRlsSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsSetting", - fieldName: "deleteRlsSetting", + operation: 'mutation', + operationName: 'RlsSetting', + fieldName: 'deleteRlsSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/route.ts b/sdk/constructive-sdk/src/api/orm/models/route.ts index 1377ead14a..0fbf96934f 100644 --- a/sdk/constructive-sdk/src/api/orm/models/route.ts +++ b/sdk/constructive-sdk/src/api/orm/models/route.ts @@ -3,56 +3,96 @@ * @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 { Route, RouteWithRelations, RouteSelect, RouteFilter, RouteOrderBy, CreateRouteInput, UpdateRouteInput, RoutePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Route, + RouteWithRelations, + RouteSelect, + RouteFilter, + RouteOrderBy, + CreateRouteInput, + UpdateRouteInput, + RoutePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Route", "routes", 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 - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Route', + 'routes', + 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, + }, + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "routes", + operation: 'query', + operationName: 'Route', + fieldName: 'routes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ route: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Route", "routes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Route', + 'routes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "route", + operation: 'query', + operationName: 'Route', + fieldName: 'route', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "route": data.routes?.nodes?.[0] ?? null - }) + route: data.routes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ route: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Route", "routes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Route', + 'routes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteFilter", "RouteOrderBy", connectionFieldsMap); + 'RouteFilter', + 'RouteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Route", - fieldName: "route", + operation: 'query', + operationName: 'Route', + fieldName: 'route', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteModel { nodes?: InferSelectResult[]; }; }) => ({ - "route": data.routes?.nodes?.[0] ?? null - }) + route: data.routes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Route", "createRoute", "route", args.select, args.data, "CreateRouteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Route', + 'createRoute', + 'route', + args.select, + args.data, + 'CreateRouteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "createRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'createRoute', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RoutePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Route", "updateRoute", "route", args.select, args.where.id, args.data, "UpdateRouteInput", "id", "routePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Route', + 'updateRoute', + 'route', + args.select, + args.where.id, + args.data, + 'UpdateRouteInput', + 'id', + 'routePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "updateRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'updateRoute', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRoute: { route: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Route", "deleteRoute", "route", { - id: args.where.id - }, "DeleteRouteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Route', + 'deleteRoute', + 'route', + { + id: args.where.id, + }, + 'DeleteRouteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Route", - fieldName: "deleteRoute", + operation: 'mutation', + operationName: 'Route', + fieldName: 'deleteRoute', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/routeBinding.ts b/sdk/constructive-sdk/src/api/orm/models/routeBinding.ts index 42c87f01af..3389ee7e37 100644 --- a/sdk/constructive-sdk/src/api/orm/models/routeBinding.ts +++ b/sdk/constructive-sdk/src/api/orm/models/routeBinding.ts @@ -3,56 +3,96 @@ * @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 { RouteBinding, RouteBindingWithRelations, RouteBindingSelect, RouteBindingFilter, RouteBindingOrderBy, CreateRouteBindingInput, UpdateRouteBindingInput, RouteBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RouteBinding, + RouteBindingWithRelations, + RouteBindingSelect, + RouteBindingFilter, + RouteBindingOrderBy, + CreateRouteBindingInput, + UpdateRouteBindingInput, + RouteBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RouteBinding", "routeBindings", 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 - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RouteBinding', + 'routeBindings', + 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, + }, + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBindings", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RouteBinding", "routeBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RouteBinding', + 'routeBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBinding", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeBinding": data.routeBindings?.nodes?.[0] ?? null - }) + routeBinding: data.routeBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ routeBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RouteBinding", "routeBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RouteBinding', + 'routeBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteBindingFilter", "RouteBindingOrderBy", connectionFieldsMap); + 'RouteBindingFilter', + 'RouteBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteBinding", - fieldName: "routeBinding", + operation: 'query', + operationName: 'RouteBinding', + fieldName: 'routeBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeBinding": data.routeBindings?.nodes?.[0] ?? null - }) + routeBinding: data.routeBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RouteBinding", "createRouteBinding", "routeBinding", args.select, args.data, "CreateRouteBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RouteBinding', + 'createRouteBinding', + 'routeBinding', + args.select, + args.data, + 'CreateRouteBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "createRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'createRouteBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RouteBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RouteBinding", "updateRouteBinding", "routeBinding", args.select, args.where.id, args.data, "UpdateRouteBindingInput", "id", "routeBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RouteBinding', + 'updateRouteBinding', + 'routeBinding', + args.select, + args.where.id, + args.data, + 'UpdateRouteBindingInput', + 'id', + 'routeBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "updateRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'updateRouteBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRouteBinding: { routeBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RouteBinding", "deleteRouteBinding", "routeBinding", { - id: args.where.id - }, "DeleteRouteBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RouteBinding', + 'deleteRouteBinding', + 'routeBinding', + { + id: args.where.id, + }, + 'DeleteRouteBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteBinding", - fieldName: "deleteRouteBinding", + operation: 'mutation', + operationName: 'RouteBinding', + fieldName: 'deleteRouteBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/schema.ts b/sdk/constructive-sdk/src/api/orm/models/schema.ts index f8ae9d0a19..d9d34cae1a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/schema.ts +++ b/sdk/constructive-sdk/src/api/orm/models/schema.ts @@ -3,56 +3,96 @@ * @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 { Schema, SchemaWithRelations, SchemaSelect, SchemaFilter, SchemaOrderBy, CreateSchemaInput, UpdateSchemaInput, SchemaPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Schema, + SchemaWithRelations, + SchemaSelect, + SchemaFilter, + SchemaOrderBy, + CreateSchemaInput, + UpdateSchemaInput, + SchemaPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SchemaModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemas: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Schema", "schemas", 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 - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Schema', + 'schemas', + 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, + }, + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schemas", + operation: 'query', + operationName: 'Schema', + fieldName: 'schemas', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Schema", "schemas", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Schema', + 'schemas', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schema", + operation: 'query', + operationName: 'Schema', + fieldName: 'schema', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "schema": data.schemas?.nodes?.[0] ?? null - }) + schema: data.schemas?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ schema: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Schema", "schemas", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Schema', + 'schemas', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SchemaFilter", "SchemaOrderBy", connectionFieldsMap); + 'SchemaFilter', + 'SchemaOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Schema", - fieldName: "schema", + operation: 'query', + operationName: 'Schema', + fieldName: 'schema', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SchemaModel { nodes?: InferSelectResult[]; }; }) => ({ - "schema": data.schemas?.nodes?.[0] ?? null - }) + schema: data.schemas?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Schema", "createSchema", "schema", args.select, args.data, "CreateSchemaInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Schema', + 'createSchema', + 'schema', + args.select, + args.data, + 'CreateSchemaInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "createSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'createSchema', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SchemaPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Schema", "updateSchema", "schema", args.select, args.where.id, args.data, "UpdateSchemaInput", "id", "schemaPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Schema', + 'updateSchema', + 'schema', + args.select, + args.where.id, + args.data, + 'UpdateSchemaInput', + 'id', + 'schemaPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "updateSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'updateSchema', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSchema: { schema: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Schema", "deleteSchema", "schema", { - id: args.where.id - }, "DeleteSchemaInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Schema', + 'deleteSchema', + 'schema', + { + id: args.where.id, + }, + 'DeleteSchemaInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Schema", - fieldName: "deleteSchema", + operation: 'mutation', + operationName: 'Schema', + fieldName: 'deleteSchema', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/schemaGrant.ts b/sdk/constructive-sdk/src/api/orm/models/schemaGrant.ts index 5c4171b93b..553345a2b3 100644 --- a/sdk/constructive-sdk/src/api/orm/models/schemaGrant.ts +++ b/sdk/constructive-sdk/src/api/orm/models/schemaGrant.ts @@ -3,56 +3,96 @@ * @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 { SchemaGrant, SchemaGrantWithRelations, SchemaGrantSelect, SchemaGrantFilter, SchemaGrantOrderBy, CreateSchemaGrantInput, UpdateSchemaGrantInput, SchemaGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SchemaGrant, + SchemaGrantWithRelations, + SchemaGrantSelect, + SchemaGrantFilter, + SchemaGrantOrderBy, + CreateSchemaGrantInput, + UpdateSchemaGrantInput, + SchemaGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SchemaGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SchemaGrant", "schemaGrants", 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 - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SchemaGrant', + 'schemaGrants', + 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, + }, + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrants", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SchemaGrant", "schemaGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SchemaGrant', + 'schemaGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrant", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SchemaGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "schemaGrant": data.schemaGrants?.nodes?.[0] ?? null - }) + schemaGrant: data.schemaGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ schemaGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SchemaGrant", "schemaGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SchemaGrant', + 'schemaGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SchemaGrantFilter", "SchemaGrantOrderBy", connectionFieldsMap); + 'SchemaGrantFilter', + 'SchemaGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SchemaGrant", - fieldName: "schemaGrant", + operation: 'query', + operationName: 'SchemaGrant', + fieldName: 'schemaGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SchemaGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "schemaGrant": data.schemaGrants?.nodes?.[0] ?? null - }) + schemaGrant: data.schemaGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SchemaGrant", "createSchemaGrant", "schemaGrant", args.select, args.data, "CreateSchemaGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SchemaGrant', + 'createSchemaGrant', + 'schemaGrant', + args.select, + args.data, + 'CreateSchemaGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "createSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'createSchemaGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SchemaGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SchemaGrant", "updateSchemaGrant", "schemaGrant", args.select, args.where.id, args.data, "UpdateSchemaGrantInput", "id", "schemaGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SchemaGrant', + 'updateSchemaGrant', + 'schemaGrant', + args.select, + args.where.id, + args.data, + 'UpdateSchemaGrantInput', + 'id', + 'schemaGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "updateSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'updateSchemaGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSchemaGrant: { schemaGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SchemaGrant", "deleteSchemaGrant", "schemaGrant", { - id: args.where.id - }, "DeleteSchemaGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SchemaGrant', + 'deleteSchemaGrant', + 'schemaGrant', + { + id: args.where.id, + }, + 'DeleteSchemaGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SchemaGrant", - fieldName: "deleteSchemaGrant", + operation: 'mutation', + operationName: 'SchemaGrant', + fieldName: 'deleteSchemaGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/site.ts b/sdk/constructive-sdk/src/api/orm/models/site.ts index 40992146a5..30c5c8f81a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/site.ts +++ b/sdk/constructive-sdk/src/api/orm/models/site.ts @@ -3,56 +3,96 @@ * @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 { Site, SiteWithRelations, SiteSelect, SiteFilter, SiteOrderBy, CreateSiteInput, UpdateSiteInput, SitePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Site, + SiteWithRelations, + SiteSelect, + SiteFilter, + SiteOrderBy, + CreateSiteInput, + UpdateSiteInput, + SitePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sites: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Site", "sites", 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 - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Site', + 'sites', + 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, + }, + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "sites", + operation: 'query', + operationName: 'Site', + fieldName: 'sites', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ site: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Site", "sites", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Site', + 'sites', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "site", + operation: 'query', + operationName: 'Site', + fieldName: 'site', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "site": data.sites?.nodes?.[0] ?? null - }) + site: data.sites?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ site: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Site", "sites", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Site', + 'sites', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteFilter", "SiteOrderBy", connectionFieldsMap); + 'SiteFilter', + 'SiteOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Site", - fieldName: "site", + operation: 'query', + operationName: 'Site', + fieldName: 'site', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteModel { nodes?: InferSelectResult[]; }; }) => ({ - "site": data.sites?.nodes?.[0] ?? null - }) + site: data.sites?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Site", "createSite", "site", args.select, args.data, "CreateSiteInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Site', + 'createSite', + 'site', + args.select, + args.data, + 'CreateSiteInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "createSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'createSite', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SitePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Site", "updateSite", "site", args.select, args.where.id, args.data, "UpdateSiteInput", "id", "sitePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Site', + 'updateSite', + 'site', + args.select, + args.where.id, + args.data, + 'UpdateSiteInput', + 'id', + 'sitePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "updateSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'updateSite', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSite: { site: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Site", "deleteSite", "site", { - id: args.where.id - }, "DeleteSiteInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Site', + 'deleteSite', + 'site', + { + id: args.where.id, + }, + 'DeleteSiteInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Site", - fieldName: "deleteSite", + operation: 'mutation', + operationName: 'Site', + fieldName: 'deleteSite', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/siteMetadatum.ts b/sdk/constructive-sdk/src/api/orm/models/siteMetadatum.ts index c5119c2a96..1e8bc08f33 100644 --- a/sdk/constructive-sdk/src/api/orm/models/siteMetadatum.ts +++ b/sdk/constructive-sdk/src/api/orm/models/siteMetadatum.ts @@ -3,56 +3,96 @@ * @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 { SiteMetadatum, SiteMetadatumWithRelations, SiteMetadatumSelect, SiteMetadatumFilter, SiteMetadatumOrderBy, CreateSiteMetadatumInput, UpdateSiteMetadatumInput, SiteMetadatumPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteMetadatum, + SiteMetadatumWithRelations, + SiteMetadatumSelect, + SiteMetadatumFilter, + SiteMetadatumOrderBy, + CreateSiteMetadatumInput, + UpdateSiteMetadatumInput, + SiteMetadatumPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteMetadatumModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadata: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteMetadatum", "siteMetadata", 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 - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteMetadatum', + 'siteMetadata', + 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, + }, + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadata", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadata', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteMetadatum", "siteMetadata", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteMetadatum', + 'siteMetadata', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadatum", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadatum', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteMetadatum": data.siteMetadata?.nodes?.[0] ?? null - }) + siteMetadatum: data.siteMetadata?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteMetadatum: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteMetadatum", "siteMetadata", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteMetadatum', + 'siteMetadata', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteMetadatumFilter", "SiteMetadatumOrderBy", connectionFieldsMap); + 'SiteMetadatumFilter', + 'SiteMetadatumOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteMetadatum", - fieldName: "siteMetadatum", + operation: 'query', + operationName: 'SiteMetadatum', + fieldName: 'siteMetadatum', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteMetadatumModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteMetadatum": data.siteMetadata?.nodes?.[0] ?? null - }) + siteMetadatum: data.siteMetadata?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteMetadatum", "createSiteMetadatum", "siteMetadatum", args.select, args.data, "CreateSiteMetadatumInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteMetadatum', + 'createSiteMetadatum', + 'siteMetadatum', + args.select, + args.data, + 'CreateSiteMetadatumInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "createSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'createSiteMetadatum', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteMetadatumPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteMetadatum", "updateSiteMetadatum", "siteMetadatum", args.select, args.where.id, args.data, "UpdateSiteMetadatumInput", "id", "siteMetadatumPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteMetadatum', + 'updateSiteMetadatum', + 'siteMetadatum', + args.select, + args.where.id, + args.data, + 'UpdateSiteMetadatumInput', + 'id', + 'siteMetadatumPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "updateSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'updateSiteMetadatum', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteMetadatum: { siteMetadatum: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteMetadatum", "deleteSiteMetadatum", "siteMetadatum", { - id: args.where.id - }, "DeleteSiteMetadatumInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteMetadatum', + 'deleteSiteMetadatum', + 'siteMetadatum', + { + id: args.where.id, + }, + 'DeleteSiteMetadatumInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteMetadatum", - fieldName: "deleteSiteMetadatum", + operation: 'mutation', + operationName: 'SiteMetadatum', + fieldName: 'deleteSiteMetadatum', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/siteModule.ts b/sdk/constructive-sdk/src/api/orm/models/siteModule.ts index 0cbd99db46..fe7f43bf62 100644 --- a/sdk/constructive-sdk/src/api/orm/models/siteModule.ts +++ b/sdk/constructive-sdk/src/api/orm/models/siteModule.ts @@ -3,56 +3,96 @@ * @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 { SiteModule, SiteModuleWithRelations, SiteModuleSelect, SiteModuleFilter, SiteModuleOrderBy, CreateSiteModuleInput, UpdateSiteModuleInput, SiteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteModule, + SiteModuleWithRelations, + SiteModuleSelect, + SiteModuleFilter, + SiteModuleOrderBy, + CreateSiteModuleInput, + UpdateSiteModuleInput, + SiteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteModule", "siteModules", 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 - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteModule', + 'siteModules', + 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, + }, + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModules", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteModule", "siteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteModule', + 'siteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModule", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteModule": data.siteModules?.nodes?.[0] ?? null - }) + siteModule: data.siteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteModule", "siteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteModule', + 'siteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteModuleFilter", "SiteModuleOrderBy", connectionFieldsMap); + 'SiteModuleFilter', + 'SiteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteModule", - fieldName: "siteModule", + operation: 'query', + operationName: 'SiteModule', + fieldName: 'siteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteModule": data.siteModules?.nodes?.[0] ?? null - }) + siteModule: data.siteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteModule", "createSiteModule", "siteModule", args.select, args.data, "CreateSiteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteModule', + 'createSiteModule', + 'siteModule', + args.select, + args.data, + 'CreateSiteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "createSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'createSiteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteModule", "updateSiteModule", "siteModule", args.select, args.where.id, args.data, "UpdateSiteModuleInput", "id", "siteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteModule', + 'updateSiteModule', + 'siteModule', + args.select, + args.where.id, + args.data, + 'UpdateSiteModuleInput', + 'id', + 'siteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "updateSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'updateSiteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteModule: { siteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteModule", "deleteSiteModule", "siteModule", { - id: args.where.id - }, "DeleteSiteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteModule', + 'deleteSiteModule', + 'siteModule', + { + id: args.where.id, + }, + 'DeleteSiteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteModule", - fieldName: "deleteSiteModule", + operation: 'mutation', + operationName: 'SiteModule', + fieldName: 'deleteSiteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/siteTheme.ts b/sdk/constructive-sdk/src/api/orm/models/siteTheme.ts index 9244052766..51551f60db 100644 --- a/sdk/constructive-sdk/src/api/orm/models/siteTheme.ts +++ b/sdk/constructive-sdk/src/api/orm/models/siteTheme.ts @@ -3,56 +3,96 @@ * @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 { SiteTheme, SiteThemeWithRelations, SiteThemeSelect, SiteThemeFilter, SiteThemeOrderBy, CreateSiteThemeInput, UpdateSiteThemeInput, SiteThemePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteTheme, + SiteThemeWithRelations, + SiteThemeSelect, + SiteThemeFilter, + SiteThemeOrderBy, + CreateSiteThemeInput, + UpdateSiteThemeInput, + SiteThemePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteThemeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteThemes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteTheme", "siteThemes", 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 - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteTheme', + 'siteThemes', + 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, + }, + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteThemes", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteThemes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteTheme", "siteThemes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteTheme', + 'siteThemes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteTheme", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteTheme', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteTheme": data.siteThemes?.nodes?.[0] ?? null - }) + siteTheme: data.siteThemes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteTheme: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteTheme", "siteThemes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteTheme', + 'siteThemes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteThemeFilter", "SiteThemeOrderBy", connectionFieldsMap); + 'SiteThemeFilter', + 'SiteThemeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteTheme", - fieldName: "siteTheme", + operation: 'query', + operationName: 'SiteTheme', + fieldName: 'siteTheme', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteThemeModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteTheme": data.siteThemes?.nodes?.[0] ?? null - }) + siteTheme: data.siteThemes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteTheme", "createSiteTheme", "siteTheme", args.select, args.data, "CreateSiteThemeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteTheme', + 'createSiteTheme', + 'siteTheme', + args.select, + args.data, + 'CreateSiteThemeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "createSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'createSiteTheme', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteThemePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteTheme", "updateSiteTheme", "siteTheme", args.select, args.where.id, args.data, "UpdateSiteThemeInput", "id", "siteThemePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteTheme', + 'updateSiteTheme', + 'siteTheme', + args.select, + args.where.id, + args.data, + 'UpdateSiteThemeInput', + 'id', + 'siteThemePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "updateSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'updateSiteTheme', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteTheme: { siteTheme: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteTheme", "deleteSiteTheme", "siteTheme", { - id: args.where.id - }, "DeleteSiteThemeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteTheme', + 'deleteSiteTheme', + 'siteTheme', + { + id: args.where.id, + }, + 'DeleteSiteThemeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteTheme", - fieldName: "deleteSiteTheme", + operation: 'mutation', + operationName: 'SiteTheme', + fieldName: 'deleteSiteTheme', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/spatialRelation.ts b/sdk/constructive-sdk/src/api/orm/models/spatialRelation.ts index 6ef5ccab36..31de43c115 100644 --- a/sdk/constructive-sdk/src/api/orm/models/spatialRelation.ts +++ b/sdk/constructive-sdk/src/api/orm/models/spatialRelation.ts @@ -3,56 +3,96 @@ * @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 { SpatialRelation, SpatialRelationWithRelations, SpatialRelationSelect, SpatialRelationFilter, SpatialRelationOrderBy, CreateSpatialRelationInput, UpdateSpatialRelationInput, SpatialRelationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SpatialRelation, + SpatialRelationWithRelations, + SpatialRelationSelect, + SpatialRelationFilter, + SpatialRelationOrderBy, + CreateSpatialRelationInput, + UpdateSpatialRelationInput, + SpatialRelationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SpatialRelationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SpatialRelation", "spatialRelations", 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 - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SpatialRelation', + 'spatialRelations', + 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, + }, + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelations", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SpatialRelation", "spatialRelations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SpatialRelation', + 'spatialRelations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelation", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelation', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SpatialRelationModel { nodes?: InferSelectResult[]; }; }) => ({ - "spatialRelation": data.spatialRelations?.nodes?.[0] ?? null - }) + spatialRelation: data.spatialRelations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ spatialRelation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SpatialRelation", "spatialRelations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SpatialRelation', + 'spatialRelations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SpatialRelationFilter", "SpatialRelationOrderBy", connectionFieldsMap); + 'SpatialRelationFilter', + 'SpatialRelationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SpatialRelation", - fieldName: "spatialRelation", + operation: 'query', + operationName: 'SpatialRelation', + fieldName: 'spatialRelation', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SpatialRelationModel { nodes?: InferSelectResult[]; }; }) => ({ - "spatialRelation": data.spatialRelations?.nodes?.[0] ?? null - }) + spatialRelation: data.spatialRelations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SpatialRelation", "createSpatialRelation", "spatialRelation", args.select, args.data, "CreateSpatialRelationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SpatialRelation', + 'createSpatialRelation', + 'spatialRelation', + args.select, + args.data, + 'CreateSpatialRelationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "createSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'createSpatialRelation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SpatialRelationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SpatialRelation", "updateSpatialRelation", "spatialRelation", args.select, args.where.id, args.data, "UpdateSpatialRelationInput", "id", "spatialRelationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SpatialRelation', + 'updateSpatialRelation', + 'spatialRelation', + args.select, + args.where.id, + args.data, + 'UpdateSpatialRelationInput', + 'id', + 'spatialRelationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "updateSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'updateSpatialRelation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSpatialRelation: { spatialRelation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SpatialRelation", "deleteSpatialRelation", "spatialRelation", { - id: args.where.id - }, "DeleteSpatialRelationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SpatialRelation', + 'deleteSpatialRelation', + 'spatialRelation', + { + id: args.where.id, + }, + 'DeleteSpatialRelationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SpatialRelation", - fieldName: "deleteSpatialRelation", + operation: 'mutation', + operationName: 'SpatialRelation', + fieldName: 'deleteSpatialRelation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/sqlAction.ts b/sdk/constructive-sdk/src/api/orm/models/sqlAction.ts index 8099171baf..74b4418688 100644 --- a/sdk/constructive-sdk/src/api/orm/models/sqlAction.ts +++ b/sdk/constructive-sdk/src/api/orm/models/sqlAction.ts @@ -3,56 +3,96 @@ * @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 { SqlAction, SqlActionWithRelations, SqlActionSelect, SqlActionFilter, SqlActionOrderBy, CreateSqlActionInput, UpdateSqlActionInput, SqlActionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SqlAction, + SqlActionWithRelations, + SqlActionSelect, + SqlActionFilter, + SqlActionOrderBy, + CreateSqlActionInput, + UpdateSqlActionInput, + SqlActionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SqlActionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlActions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SqlAction", "sqlActions", 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 - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SqlAction', + 'sqlActions', + 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, + }, + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlActions", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlActions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlAction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SqlAction", "sqlActions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SqlAction', + 'sqlActions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlAction", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlAction', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SqlActionModel { nodes?: InferSelectResult[]; }; }) => ({ - "sqlAction": data.sqlActions?.nodes?.[0] ?? null - }) + sqlAction: data.sqlActions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlAction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SqlAction", "sqlActions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SqlAction', + 'sqlActions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlAction", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlAction', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class SqlActionModel { nodes?: InferSelectResult[]; }; }) => ({ - "sqlAction": data.sqlActions?.nodes?.[0] ?? null - }) + sqlAction: data.sqlActions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSqlAction: { sqlAction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SqlAction", "createSqlAction", "sqlAction", args.select, args.data, "CreateSqlActionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SqlAction', + 'createSqlAction', + 'sqlAction', + args.select, + args.data, + 'CreateSqlActionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SqlAction", - fieldName: "createSqlAction", + operation: 'mutation', + operationName: 'SqlAction', + fieldName: 'createSqlAction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/table.ts b/sdk/constructive-sdk/src/api/orm/models/table.ts index 5cb18d7cb1..1f8df77e80 100644 --- a/sdk/constructive-sdk/src/api/orm/models/table.ts +++ b/sdk/constructive-sdk/src/api/orm/models/table.ts @@ -3,56 +3,96 @@ * @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 { Table, TableWithRelations, TableSelect, TableFilter, TableOrderBy, CreateTableInput, UpdateTableInput, TablePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Table, + TableWithRelations, + TableSelect, + TableFilter, + TableOrderBy, + CreateTableInput, + UpdateTableInput, + TablePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TableModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tables: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Table", "tables", 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 - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Table', + 'tables', + 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, + }, + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "tables", + operation: 'query', + operationName: 'Table', + fieldName: 'tables', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ table: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Table", "tables", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Table', + 'tables', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "table", + operation: 'query', + operationName: 'Table', + fieldName: 'table', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TableModel { nodes?: InferSelectResult[]; }; }) => ({ - "table": data.tables?.nodes?.[0] ?? null - }) + table: data.tables?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ table: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Table", "tables", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Table', + 'tables', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TableFilter", "TableOrderBy", connectionFieldsMap); + 'TableFilter', + 'TableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Table", - fieldName: "table", + operation: 'query', + operationName: 'Table', + fieldName: 'table', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TableModel { nodes?: InferSelectResult[]; }; }) => ({ - "table": data.tables?.nodes?.[0] ?? null - }) + table: data.tables?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Table", "createTable", "table", args.select, args.data, "CreateTableInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Table', + 'createTable', + 'table', + args.select, + args.data, + 'CreateTableInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "createTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'createTable', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TablePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Table", "updateTable", "table", args.select, args.where.id, args.data, "UpdateTableInput", "id", "tablePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Table', + 'updateTable', + 'table', + args.select, + args.where.id, + args.data, + 'UpdateTableInput', + 'id', + 'tablePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "updateTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'updateTable', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTable: { table: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Table", "deleteTable", "table", { - id: args.where.id - }, "DeleteTableInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Table', + 'deleteTable', + 'table', + { + id: args.where.id, + }, + 'DeleteTableInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Table", - fieldName: "deleteTable", + operation: 'mutation', + operationName: 'Table', + fieldName: 'deleteTable', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/tableGrant.ts b/sdk/constructive-sdk/src/api/orm/models/tableGrant.ts index 6e028cfbf7..b49372245a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/tableGrant.ts +++ b/sdk/constructive-sdk/src/api/orm/models/tableGrant.ts @@ -3,56 +3,96 @@ * @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 { TableGrant, TableGrantWithRelations, TableGrantSelect, TableGrantFilter, TableGrantOrderBy, CreateTableGrantInput, UpdateTableGrantInput, TableGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TableGrant, + TableGrantWithRelations, + TableGrantSelect, + TableGrantFilter, + TableGrantOrderBy, + CreateTableGrantInput, + UpdateTableGrantInput, + TableGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TableGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TableGrant", "tableGrants", 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 - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TableGrant', + 'tableGrants', + 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, + }, + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrants", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TableGrant", "tableGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TableGrant', + 'tableGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrant", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TableGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "tableGrant": data.tableGrants?.nodes?.[0] ?? null - }) + tableGrant: data.tableGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ tableGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TableGrant", "tableGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TableGrant', + 'tableGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TableGrantFilter", "TableGrantOrderBy", connectionFieldsMap); + 'TableGrantFilter', + 'TableGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TableGrant", - fieldName: "tableGrant", + operation: 'query', + operationName: 'TableGrant', + fieldName: 'tableGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TableGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "tableGrant": data.tableGrants?.nodes?.[0] ?? null - }) + tableGrant: data.tableGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TableGrant", "createTableGrant", "tableGrant", args.select, args.data, "CreateTableGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TableGrant', + 'createTableGrant', + 'tableGrant', + args.select, + args.data, + 'CreateTableGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "createTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'createTableGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TableGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TableGrant", "updateTableGrant", "tableGrant", args.select, args.where.id, args.data, "UpdateTableGrantInput", "id", "tableGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TableGrant', + 'updateTableGrant', + 'tableGrant', + args.select, + args.where.id, + args.data, + 'UpdateTableGrantInput', + 'id', + 'tableGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "updateTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'updateTableGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTableGrant: { tableGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TableGrant", "deleteTableGrant", "tableGrant", { - id: args.where.id - }, "DeleteTableGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TableGrant', + 'deleteTableGrant', + 'tableGrant', + { + id: args.where.id, + }, + 'DeleteTableGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TableGrant", - fieldName: "deleteTableGrant", + operation: 'mutation', + operationName: 'TableGrant', + fieldName: 'deleteTableGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/trigger.ts b/sdk/constructive-sdk/src/api/orm/models/trigger.ts index bacb29512c..47169bc484 100644 --- a/sdk/constructive-sdk/src/api/orm/models/trigger.ts +++ b/sdk/constructive-sdk/src/api/orm/models/trigger.ts @@ -3,56 +3,96 @@ * @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 { Trigger, TriggerWithRelations, TriggerSelect, TriggerFilter, TriggerOrderBy, CreateTriggerInput, UpdateTriggerInput, TriggerPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Trigger, + TriggerWithRelations, + TriggerSelect, + TriggerFilter, + TriggerOrderBy, + CreateTriggerInput, + UpdateTriggerInput, + TriggerPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TriggerModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Trigger", "triggers", 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 - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Trigger', + 'triggers', + 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, + }, + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "triggers", + operation: 'query', + operationName: 'Trigger', + fieldName: 'triggers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ trigger: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Trigger", "triggers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Trigger', + 'triggers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "trigger", + operation: 'query', + operationName: 'Trigger', + fieldName: 'trigger', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TriggerModel { nodes?: InferSelectResult[]; }; }) => ({ - "trigger": data.triggers?.nodes?.[0] ?? null - }) + trigger: data.triggers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ trigger: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Trigger", "triggers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Trigger', + 'triggers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TriggerFilter", "TriggerOrderBy", connectionFieldsMap); + 'TriggerFilter', + 'TriggerOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Trigger", - fieldName: "trigger", + operation: 'query', + operationName: 'Trigger', + fieldName: 'trigger', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TriggerModel { nodes?: InferSelectResult[]; }; }) => ({ - "trigger": data.triggers?.nodes?.[0] ?? null - }) + trigger: data.triggers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Trigger", "createTrigger", "trigger", args.select, args.data, "CreateTriggerInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Trigger', + 'createTrigger', + 'trigger', + args.select, + args.data, + 'CreateTriggerInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "createTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'createTrigger', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TriggerPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Trigger", "updateTrigger", "trigger", args.select, args.where.id, args.data, "UpdateTriggerInput", "id", "triggerPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Trigger', + 'updateTrigger', + 'trigger', + args.select, + args.where.id, + args.data, + 'UpdateTriggerInput', + 'id', + 'triggerPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "updateTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'updateTrigger', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTrigger: { trigger: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Trigger", "deleteTrigger", "trigger", { - id: args.where.id - }, "DeleteTriggerInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Trigger', + 'deleteTrigger', + 'trigger', + { + id: args.where.id, + }, + 'DeleteTriggerInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Trigger", - fieldName: "deleteTrigger", + operation: 'mutation', + operationName: 'Trigger', + fieldName: 'deleteTrigger', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/triggerFunction.ts b/sdk/constructive-sdk/src/api/orm/models/triggerFunction.ts index 27384220c3..40d2ee283e 100644 --- a/sdk/constructive-sdk/src/api/orm/models/triggerFunction.ts +++ b/sdk/constructive-sdk/src/api/orm/models/triggerFunction.ts @@ -3,56 +3,96 @@ * @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 { TriggerFunction, TriggerFunctionWithRelations, TriggerFunctionSelect, TriggerFunctionFilter, TriggerFunctionOrderBy, CreateTriggerFunctionInput, UpdateTriggerFunctionInput, TriggerFunctionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TriggerFunction, + TriggerFunctionWithRelations, + TriggerFunctionSelect, + TriggerFunctionFilter, + TriggerFunctionOrderBy, + CreateTriggerFunctionInput, + UpdateTriggerFunctionInput, + TriggerFunctionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TriggerFunctionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunctions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TriggerFunction", "triggerFunctions", 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 - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TriggerFunction', + 'triggerFunctions', + 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, + }, + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunctions", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunctions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TriggerFunction", "triggerFunctions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TriggerFunction', + 'triggerFunctions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunction", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunction', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TriggerFunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "triggerFunction": data.triggerFunctions?.nodes?.[0] ?? null - }) + triggerFunction: data.triggerFunctions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ triggerFunction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TriggerFunction", "triggerFunctions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TriggerFunction', + 'triggerFunctions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TriggerFunctionFilter", "TriggerFunctionOrderBy", connectionFieldsMap); + 'TriggerFunctionFilter', + 'TriggerFunctionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TriggerFunction", - fieldName: "triggerFunction", + operation: 'query', + operationName: 'TriggerFunction', + fieldName: 'triggerFunction', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TriggerFunctionModel { nodes?: InferSelectResult[]; }; }) => ({ - "triggerFunction": data.triggerFunctions?.nodes?.[0] ?? null - }) + triggerFunction: data.triggerFunctions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TriggerFunction", "createTriggerFunction", "triggerFunction", args.select, args.data, "CreateTriggerFunctionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TriggerFunction', + 'createTriggerFunction', + 'triggerFunction', + args.select, + args.data, + 'CreateTriggerFunctionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "createTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'createTriggerFunction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TriggerFunctionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TriggerFunction", "updateTriggerFunction", "triggerFunction", args.select, args.where.id, args.data, "UpdateTriggerFunctionInput", "id", "triggerFunctionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TriggerFunction', + 'updateTriggerFunction', + 'triggerFunction', + args.select, + args.where.id, + args.data, + 'UpdateTriggerFunctionInput', + 'id', + 'triggerFunctionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "updateTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'updateTriggerFunction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTriggerFunction: { triggerFunction: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TriggerFunction", "deleteTriggerFunction", "triggerFunction", { - id: args.where.id - }, "DeleteTriggerFunctionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TriggerFunction', + 'deleteTriggerFunction', + 'triggerFunction', + { + id: args.where.id, + }, + 'DeleteTriggerFunctionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TriggerFunction", - fieldName: "deleteTriggerFunction", + operation: 'mutation', + operationName: 'TriggerFunction', + fieldName: 'deleteTriggerFunction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/uniqueConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/uniqueConstraint.ts index 2664f51152..0880a23e50 100644 --- a/sdk/constructive-sdk/src/api/orm/models/uniqueConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/uniqueConstraint.ts @@ -3,56 +3,96 @@ * @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 { UniqueConstraint, UniqueConstraintWithRelations, UniqueConstraintSelect, UniqueConstraintFilter, UniqueConstraintOrderBy, CreateUniqueConstraintInput, UpdateUniqueConstraintInput, UniqueConstraintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UniqueConstraint, + UniqueConstraintWithRelations, + UniqueConstraintSelect, + UniqueConstraintFilter, + UniqueConstraintOrderBy, + CreateUniqueConstraintInput, + UpdateUniqueConstraintInput, + UniqueConstraintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UniqueConstraintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UniqueConstraint", "uniqueConstraints", 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 - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UniqueConstraint', + 'uniqueConstraints', + 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, + }, + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraints", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UniqueConstraint", "uniqueConstraints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UniqueConstraint', + 'uniqueConstraints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraint", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UniqueConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "uniqueConstraint": data.uniqueConstraints?.nodes?.[0] ?? null - }) + uniqueConstraint: data.uniqueConstraints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ uniqueConstraint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UniqueConstraint", "uniqueConstraints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UniqueConstraint', + 'uniqueConstraints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UniqueConstraintFilter", "UniqueConstraintOrderBy", connectionFieldsMap); + 'UniqueConstraintFilter', + 'UniqueConstraintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UniqueConstraint", - fieldName: "uniqueConstraint", + operation: 'query', + operationName: 'UniqueConstraint', + fieldName: 'uniqueConstraint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UniqueConstraintModel { nodes?: InferSelectResult[]; }; }) => ({ - "uniqueConstraint": data.uniqueConstraints?.nodes?.[0] ?? null - }) + uniqueConstraint: data.uniqueConstraints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UniqueConstraint", "createUniqueConstraint", "uniqueConstraint", args.select, args.data, "CreateUniqueConstraintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UniqueConstraint', + 'createUniqueConstraint', + 'uniqueConstraint', + args.select, + args.data, + 'CreateUniqueConstraintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "createUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'createUniqueConstraint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UniqueConstraintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UniqueConstraint", "updateUniqueConstraint", "uniqueConstraint", args.select, args.where.id, args.data, "UpdateUniqueConstraintInput", "id", "uniqueConstraintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UniqueConstraint', + 'updateUniqueConstraint', + 'uniqueConstraint', + args.select, + args.where.id, + args.data, + 'UpdateUniqueConstraintInput', + 'id', + 'uniqueConstraintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "updateUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'updateUniqueConstraint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUniqueConstraint: { uniqueConstraint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UniqueConstraint", "deleteUniqueConstraint", "uniqueConstraint", { - id: args.where.id - }, "DeleteUniqueConstraintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UniqueConstraint', + 'deleteUniqueConstraint', + 'uniqueConstraint', + { + id: args.where.id, + }, + 'DeleteUniqueConstraintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UniqueConstraint", - fieldName: "deleteUniqueConstraint", + operation: 'mutation', + operationName: 'UniqueConstraint', + fieldName: 'deleteUniqueConstraint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/view.ts b/sdk/constructive-sdk/src/api/orm/models/view.ts index aad1e83070..04afa60a84 100644 --- a/sdk/constructive-sdk/src/api/orm/models/view.ts +++ b/sdk/constructive-sdk/src/api/orm/models/view.ts @@ -3,56 +3,96 @@ * @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 { View, ViewWithRelations, ViewSelect, ViewFilter, ViewOrderBy, CreateViewInput, UpdateViewInput, ViewPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + View, + ViewWithRelations, + ViewSelect, + ViewFilter, + ViewOrderBy, + CreateViewInput, + UpdateViewInput, + ViewPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ views: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("View", "views", 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 - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'View', + 'views', + 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, + }, + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "views", + operation: 'query', + operationName: 'View', + fieldName: 'views', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ view: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("View", "views", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'View', + 'views', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "view", + operation: 'query', + operationName: 'View', + fieldName: 'view', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewModel { nodes?: InferSelectResult[]; }; }) => ({ - "view": data.views?.nodes?.[0] ?? null - }) + view: data.views?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ view: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("View", "views", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'View', + 'views', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewFilter", "ViewOrderBy", connectionFieldsMap); + 'ViewFilter', + 'ViewOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "View", - fieldName: "view", + operation: 'query', + operationName: 'View', + fieldName: 'view', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewModel { nodes?: InferSelectResult[]; }; }) => ({ - "view": data.views?.nodes?.[0] ?? null - }) + view: data.views?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("View", "createView", "view", args.select, args.data, "CreateViewInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'View', + 'createView', + 'view', + args.select, + args.data, + 'CreateViewInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "createView", + operation: 'mutation', + operationName: 'View', + fieldName: 'createView', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("View", "updateView", "view", args.select, args.where.id, args.data, "UpdateViewInput", "id", "viewPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'View', + 'updateView', + 'view', + args.select, + args.where.id, + args.data, + 'UpdateViewInput', + 'id', + 'viewPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "updateView", + operation: 'mutation', + operationName: 'View', + fieldName: 'updateView', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteView: { view: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("View", "deleteView", "view", { - id: args.where.id - }, "DeleteViewInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'View', + 'deleteView', + 'view', + { + id: args.where.id, + }, + 'DeleteViewInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "View", - fieldName: "deleteView", + operation: 'mutation', + operationName: 'View', + fieldName: 'deleteView', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/viewGrant.ts b/sdk/constructive-sdk/src/api/orm/models/viewGrant.ts index ee6c58946a..7f9b69a42c 100644 --- a/sdk/constructive-sdk/src/api/orm/models/viewGrant.ts +++ b/sdk/constructive-sdk/src/api/orm/models/viewGrant.ts @@ -3,56 +3,96 @@ * @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 { ViewGrant, ViewGrantWithRelations, ViewGrantSelect, ViewGrantFilter, ViewGrantOrderBy, CreateViewGrantInput, UpdateViewGrantInput, ViewGrantPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewGrant, + ViewGrantWithRelations, + ViewGrantSelect, + ViewGrantFilter, + ViewGrantOrderBy, + CreateViewGrantInput, + UpdateViewGrantInput, + ViewGrantPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewGrantModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrants: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewGrant", "viewGrants", 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 - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewGrant', + 'viewGrants', + 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, + }, + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrants", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrants', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewGrant", "viewGrants", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewGrant', + 'viewGrants', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrant", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrant', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewGrant": data.viewGrants?.nodes?.[0] ?? null - }) + viewGrant: data.viewGrants?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewGrant: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewGrant", "viewGrants", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewGrant', + 'viewGrants', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewGrantFilter", "ViewGrantOrderBy", connectionFieldsMap); + 'ViewGrantFilter', + 'ViewGrantOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewGrant", - fieldName: "viewGrant", + operation: 'query', + operationName: 'ViewGrant', + fieldName: 'viewGrant', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewGrantModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewGrant": data.viewGrants?.nodes?.[0] ?? null - }) + viewGrant: data.viewGrants?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewGrant", "createViewGrant", "viewGrant", args.select, args.data, "CreateViewGrantInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewGrant', + 'createViewGrant', + 'viewGrant', + args.select, + args.data, + 'CreateViewGrantInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "createViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'createViewGrant', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewGrantPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewGrant", "updateViewGrant", "viewGrant", args.select, args.where.id, args.data, "UpdateViewGrantInput", "id", "viewGrantPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewGrant', + 'updateViewGrant', + 'viewGrant', + args.select, + args.where.id, + args.data, + 'UpdateViewGrantInput', + 'id', + 'viewGrantPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "updateViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'updateViewGrant', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewGrant: { viewGrant: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewGrant", "deleteViewGrant", "viewGrant", { - id: args.where.id - }, "DeleteViewGrantInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewGrant', + 'deleteViewGrant', + 'viewGrant', + { + id: args.where.id, + }, + 'DeleteViewGrantInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewGrant", - fieldName: "deleteViewGrant", + operation: 'mutation', + operationName: 'ViewGrant', + fieldName: 'deleteViewGrant', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/viewRule.ts b/sdk/constructive-sdk/src/api/orm/models/viewRule.ts index 9d23a13997..df3eadd57c 100644 --- a/sdk/constructive-sdk/src/api/orm/models/viewRule.ts +++ b/sdk/constructive-sdk/src/api/orm/models/viewRule.ts @@ -3,56 +3,96 @@ * @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 { ViewRule, ViewRuleWithRelations, ViewRuleSelect, ViewRuleFilter, ViewRuleOrderBy, CreateViewRuleInput, UpdateViewRuleInput, ViewRulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewRule, + ViewRuleWithRelations, + ViewRuleSelect, + ViewRuleFilter, + ViewRuleOrderBy, + CreateViewRuleInput, + UpdateViewRuleInput, + ViewRulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewRuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewRule", "viewRules", 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 - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewRule', + 'viewRules', + 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, + }, + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRules", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewRule", "viewRules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewRule', + 'viewRules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRule", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewRuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewRule": data.viewRules?.nodes?.[0] ?? null - }) + viewRule: data.viewRules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewRule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewRule", "viewRules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewRule', + 'viewRules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewRuleFilter", "ViewRuleOrderBy", connectionFieldsMap); + 'ViewRuleFilter', + 'ViewRuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewRule", - fieldName: "viewRule", + operation: 'query', + operationName: 'ViewRule', + fieldName: 'viewRule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewRuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewRule": data.viewRules?.nodes?.[0] ?? null - }) + viewRule: data.viewRules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewRule", "createViewRule", "viewRule", args.select, args.data, "CreateViewRuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewRule', + 'createViewRule', + 'viewRule', + args.select, + args.data, + 'CreateViewRuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "createViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'createViewRule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewRulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewRule", "updateViewRule", "viewRule", args.select, args.where.id, args.data, "UpdateViewRuleInput", "id", "viewRulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewRule', + 'updateViewRule', + 'viewRule', + args.select, + args.where.id, + args.data, + 'UpdateViewRuleInput', + 'id', + 'viewRulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "updateViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'updateViewRule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewRule: { viewRule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewRule", "deleteViewRule", "viewRule", { - id: args.where.id - }, "DeleteViewRuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewRule', + 'deleteViewRule', + 'viewRule', + { + id: args.where.id, + }, + 'DeleteViewRuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewRule", - fieldName: "deleteViewRule", + operation: 'mutation', + operationName: 'ViewRule', + fieldName: 'deleteViewRule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/viewTable.ts b/sdk/constructive-sdk/src/api/orm/models/viewTable.ts index f28432a5cc..44308019a0 100644 --- a/sdk/constructive-sdk/src/api/orm/models/viewTable.ts +++ b/sdk/constructive-sdk/src/api/orm/models/viewTable.ts @@ -3,56 +3,96 @@ * @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 { ViewTable, ViewTableWithRelations, ViewTableSelect, ViewTableFilter, ViewTableOrderBy, CreateViewTableInput, UpdateViewTableInput, ViewTablePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ViewTable, + ViewTableWithRelations, + ViewTableSelect, + ViewTableFilter, + ViewTableOrderBy, + CreateViewTableInput, + UpdateViewTableInput, + ViewTablePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ViewTableModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTables: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ViewTable", "viewTables", 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 - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ViewTable', + 'viewTables', + 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, + }, + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTables", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTables', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTable: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ViewTable", "viewTables", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ViewTable', + 'viewTables', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTable", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTable', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ViewTableModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewTable": data.viewTables?.nodes?.[0] ?? null - }) + viewTable: data.viewTables?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ viewTable: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ViewTable", "viewTables", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ViewTable', + 'viewTables', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ViewTableFilter", "ViewTableOrderBy", connectionFieldsMap); + 'ViewTableFilter', + 'ViewTableOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ViewTable", - fieldName: "viewTable", + operation: 'query', + operationName: 'ViewTable', + fieldName: 'viewTable', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ViewTableModel { nodes?: InferSelectResult[]; }; }) => ({ - "viewTable": data.viewTables?.nodes?.[0] ?? null - }) + viewTable: data.viewTables?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ViewTable", "createViewTable", "viewTable", args.select, args.data, "CreateViewTableInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ViewTable', + 'createViewTable', + 'viewTable', + args.select, + args.data, + 'CreateViewTableInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "createViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'createViewTable', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ViewTablePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ViewTable", "updateViewTable", "viewTable", args.select, args.where.id, args.data, "UpdateViewTableInput", "id", "viewTablePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ViewTable', + 'updateViewTable', + 'viewTable', + args.select, + args.where.id, + args.data, + 'UpdateViewTableInput', + 'id', + 'viewTablePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "updateViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'updateViewTable', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteViewTable: { viewTable: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ViewTable", "deleteViewTable", "viewTable", { - id: args.where.id - }, "DeleteViewTableInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ViewTable', + 'deleteViewTable', + 'viewTable', + { + id: args.where.id, + }, + 'DeleteViewTableInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ViewTable", - fieldName: "deleteViewTable", + operation: 'mutation', + operationName: 'ViewTable', + fieldName: 'deleteViewTable', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/models/webauthnSetting.ts b/sdk/constructive-sdk/src/api/orm/models/webauthnSetting.ts index 8150003ac5..515c0dbcaa 100644 --- a/sdk/constructive-sdk/src/api/orm/models/webauthnSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/webauthnSetting.ts @@ -3,56 +3,96 @@ * @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 { WebauthnSetting, WebauthnSettingWithRelations, WebauthnSettingSelect, WebauthnSettingFilter, WebauthnSettingOrderBy, CreateWebauthnSettingInput, UpdateWebauthnSettingInput, WebauthnSettingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnSetting, + WebauthnSettingWithRelations, + WebauthnSettingSelect, + WebauthnSettingFilter, + WebauthnSettingOrderBy, + CreateWebauthnSettingInput, + UpdateWebauthnSettingInput, + WebauthnSettingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnSettingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSettings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnSetting", "webauthnSettings", 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 - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnSetting', + 'webauthnSettings', + 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, + }, + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSettings", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSettings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnSetting", "webauthnSettings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnSetting', + 'webauthnSettings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSetting", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSetting', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnSetting": data.webauthnSettings?.nodes?.[0] ?? null - }) + webauthnSetting: data.webauthnSettings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnSetting: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnSetting", "webauthnSettings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnSetting', + 'webauthnSettings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnSettingFilter", "WebauthnSettingOrderBy", connectionFieldsMap); + 'WebauthnSettingFilter', + 'WebauthnSettingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnSetting", - fieldName: "webauthnSetting", + operation: 'query', + operationName: 'WebauthnSetting', + fieldName: 'webauthnSetting', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnSettingModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnSetting": data.webauthnSettings?.nodes?.[0] ?? null - }) + webauthnSetting: data.webauthnSettings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnSetting", "createWebauthnSetting", "webauthnSetting", args.select, args.data, "CreateWebauthnSettingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnSetting', + 'createWebauthnSetting', + 'webauthnSetting', + args.select, + args.data, + 'CreateWebauthnSettingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "createWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'createWebauthnSetting', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnSettingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnSetting", "updateWebauthnSetting", "webauthnSetting", args.select, args.where.id, args.data, "UpdateWebauthnSettingInput", "id", "webauthnSettingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnSetting', + 'updateWebauthnSetting', + 'webauthnSetting', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnSettingInput', + 'id', + 'webauthnSettingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "updateWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'updateWebauthnSetting', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnSetting: { webauthnSetting: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnSetting", "deleteWebauthnSetting", "webauthnSetting", { - id: args.where.id - }, "DeleteWebauthnSettingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnSetting', + 'deleteWebauthnSetting', + 'webauthnSetting', + { + id: args.where.id, + }, + 'DeleteWebauthnSettingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnSetting", - fieldName: "deleteWebauthnSetting", + operation: 'mutation', + operationName: 'WebauthnSetting', + fieldName: 'deleteWebauthnSetting', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/mutation/index.ts b/sdk/constructive-sdk/src/api/orm/mutation/index.ts index ad9dcc2e30..0192a395b1 100644 --- a/sdk/constructive-sdk/src/api/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/api/orm/mutation/index.ts @@ -3,11 +3,33 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AcceptDatabaseTransferInput, ApplyRlsInput, CancelDatabaseTransferInput, ProvisionBucketInput, RejectDatabaseTransferInput, RequestDatabaseInput, SetFieldOrderInput, AcceptDatabaseTransferPayload, ApplyRlsPayload, CancelDatabaseTransferPayload, ProvisionBucketPayload, RejectDatabaseTransferPayload, RequestDatabasePayload, SetFieldOrderPayload, AcceptDatabaseTransferPayloadSelect, ApplyRlsPayloadSelect, CancelDatabaseTransferPayloadSelect, ProvisionBucketPayloadSelect, RejectDatabaseTransferPayloadSelect, RequestDatabasePayloadSelect, SetFieldOrderPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + AcceptDatabaseTransferInput, + ApplyRlsInput, + CancelDatabaseTransferInput, + ProvisionBucketInput, + RejectDatabaseTransferInput, + RequestDatabaseInput, + SetFieldOrderInput, + AcceptDatabaseTransferPayload, + ApplyRlsPayload, + CancelDatabaseTransferPayload, + ProvisionBucketPayload, + RejectDatabaseTransferPayload, + RequestDatabasePayload, + SetFieldOrderPayload, + AcceptDatabaseTransferPayloadSelect, + ApplyRlsPayloadSelect, + CancelDatabaseTransferPayloadSelect, + ProvisionBucketPayloadSelect, + RejectDatabaseTransferPayloadSelect, + RequestDatabasePayloadSelect, + SetFieldOrderPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AcceptDatabaseTransferVariables { input: AcceptDatabaseTransferInput; } @@ -48,103 +70,208 @@ export interface SetFieldOrderVariables { } export function createMutationOperations(client: OrmClient) { return { - acceptDatabaseTransfer: (args: AcceptDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - acceptDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AcceptDatabaseTransfer", - fieldName: "acceptDatabaseTransfer", - ...buildCustomDocument("mutation", "AcceptDatabaseTransfer", "acceptDatabaseTransfer", options.select, args, [{ - name: "input", - type: "AcceptDatabaseTransferInput!" - }], connectionFieldsMap, "AcceptDatabaseTransferPayload") - }), - applyRls: (args: ApplyRlsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - applyRls: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ApplyRls", - fieldName: "applyRls", - ...buildCustomDocument("mutation", "ApplyRls", "applyRls", options.select, args, [{ - name: "input", - type: "ApplyRlsInput!" - }], connectionFieldsMap, "ApplyRlsPayload") - }), - cancelDatabaseTransfer: (args: CancelDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - cancelDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CancelDatabaseTransfer", - fieldName: "cancelDatabaseTransfer", - ...buildCustomDocument("mutation", "CancelDatabaseTransfer", "cancelDatabaseTransfer", options.select, args, [{ - name: "input", - type: "CancelDatabaseTransferInput!" - }], connectionFieldsMap, "CancelDatabaseTransferPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - rejectDatabaseTransfer: (args: RejectDatabaseTransferVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - rejectDatabaseTransfer: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RejectDatabaseTransfer", - fieldName: "rejectDatabaseTransfer", - ...buildCustomDocument("mutation", "RejectDatabaseTransfer", "rejectDatabaseTransfer", options.select, args, [{ - name: "input", - type: "RejectDatabaseTransferInput!" - }], connectionFieldsMap, "RejectDatabaseTransferPayload") - }), - requestDatabase: (args: RequestDatabaseVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - requestDatabase: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RequestDatabase", - fieldName: "requestDatabase", - ...buildCustomDocument("mutation", "RequestDatabase", "requestDatabase", options.select, args, [{ - name: "input", - type: "RequestDatabaseInput!" - }], connectionFieldsMap, "RequestDatabasePayload") - }), - setFieldOrder: (args: SetFieldOrderVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setFieldOrder: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetFieldOrder", - fieldName: "setFieldOrder", - ...buildCustomDocument("mutation", "SetFieldOrder", "setFieldOrder", options.select, args, [{ - name: "input", - type: "SetFieldOrderInput!" - }], connectionFieldsMap, "SetFieldOrderPayload") - }) + acceptDatabaseTransfer: ( + args: AcceptDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + acceptDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AcceptDatabaseTransfer', + fieldName: 'acceptDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'AcceptDatabaseTransfer', + 'acceptDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'AcceptDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'AcceptDatabaseTransferPayload' + ), + }), + applyRls: ( + args: ApplyRlsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + applyRls: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ApplyRls', + fieldName: 'applyRls', + ...buildCustomDocument( + 'mutation', + 'ApplyRls', + 'applyRls', + options.select, + args, + [ + { + name: 'input', + type: 'ApplyRlsInput!', + }, + ], + connectionFieldsMap, + 'ApplyRlsPayload' + ), + }), + cancelDatabaseTransfer: ( + args: CancelDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + cancelDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CancelDatabaseTransfer', + fieldName: 'cancelDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'CancelDatabaseTransfer', + 'cancelDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'CancelDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'CancelDatabaseTransferPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + rejectDatabaseTransfer: ( + args: RejectDatabaseTransferVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + rejectDatabaseTransfer: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RejectDatabaseTransfer', + fieldName: 'rejectDatabaseTransfer', + ...buildCustomDocument( + 'mutation', + 'RejectDatabaseTransfer', + 'rejectDatabaseTransfer', + options.select, + args, + [ + { + name: 'input', + type: 'RejectDatabaseTransferInput!', + }, + ], + connectionFieldsMap, + 'RejectDatabaseTransferPayload' + ), + }), + requestDatabase: ( + args: RequestDatabaseVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + requestDatabase: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RequestDatabase', + fieldName: 'requestDatabase', + ...buildCustomDocument( + 'mutation', + 'RequestDatabase', + 'requestDatabase', + options.select, + args, + [ + { + name: 'input', + type: 'RequestDatabaseInput!', + }, + ], + connectionFieldsMap, + 'RequestDatabasePayload' + ), + }), + setFieldOrder: ( + args: SetFieldOrderVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setFieldOrder: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetFieldOrder', + fieldName: 'setFieldOrder', + ...buildCustomDocument( + 'mutation', + 'SetFieldOrder', + 'setFieldOrder', + options.select, + args, + [ + { + name: 'input', + type: 'SetFieldOrderInput!', + }, + ], + connectionFieldsMap, + 'SetFieldOrderPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/query-builder.ts b/sdk/constructive-sdk/src/api/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/api/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/api/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/api/orm/query/index.ts b/sdk/constructive-sdk/src/api/orm/query/index.ts index a8fb40e9c4..4136dc4b39 100644 --- a/sdk/constructive-sdk/src/api/orm/query/index.ts +++ b/sdk/constructive-sdk/src/api/orm/query/index.ts @@ -3,11 +3,16 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ResolveHttpRouteRecord, ResolveRouteRecord, ResolveHttpRouteRecordSelect, ResolveRouteRecordSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ResolveHttpRouteRecord, + ResolveRouteRecord, + ResolveHttpRouteRecordSelect, + ResolveRouteRecordSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface ApiSchemaNamesVariables { targetApiId?: string; } @@ -27,76 +32,141 @@ export interface ResolveRouteVariables { } export function createQueryOperations(client: OrmClient) { return { - apiSchemaNames: (args: ApiSchemaNamesVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - apiSchemaNames: unknown | null; - }>({ - client, - operation: "query", - operationName: "ApiSchemaNames", - fieldName: "apiSchemaNames", - ...buildCustomDocument("query", "ApiSchemaNames", "apiSchemaNames", options?.select, args, [{ - name: "targetApiId", - type: "UUID" - }], connectionFieldsMap, undefined) - }), - applyRegistryDefaults: (args: ApplyRegistryDefaultsVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - applyRegistryDefaults: unknown | null; - }>({ - client, - operation: "query", - operationName: "ApplyRegistryDefaults", - fieldName: "applyRegistryDefaults", - ...buildCustomDocument("query", "ApplyRegistryDefaults", "applyRegistryDefaults", options?.select, args, [{ - name: "data", - type: "JSON" - }, { - name: "nodeType", - type: "String" - }], connectionFieldsMap, undefined) - }), - resolveHttpRoute: (args: ResolveHttpRouteVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resolveHttpRoute: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "ResolveHttpRoute", - fieldName: "resolveHttpRoute", - ...buildCustomDocument("query", "ResolveHttpRoute", "resolveHttpRoute", options.select, args, [{ - name: "requestHost", - type: "String" - }, { - name: "requestMethod", - type: "String" - }, { - name: "requestPath", - type: "String" - }], connectionFieldsMap, "ResolveHttpRouteRecord") - }), - resolveRoute: (args: ResolveRouteVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resolveRoute: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "ResolveRoute", - fieldName: "resolveRoute", - ...buildCustomDocument("query", "ResolveRoute", "resolveRoute", options.select, args, [{ - name: "requestHost", - type: "String" - }, { - name: "requestMethod", - type: "String" - }, { - name: "requestPath", - type: "String" - }], connectionFieldsMap, "ResolveRouteRecord") - }) + apiSchemaNames: ( + args: ApiSchemaNamesVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + apiSchemaNames: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ApiSchemaNames', + fieldName: 'apiSchemaNames', + ...buildCustomDocument( + 'query', + 'ApiSchemaNames', + 'apiSchemaNames', + options?.select, + args, + [ + { + name: 'targetApiId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + applyRegistryDefaults: ( + args: ApplyRegistryDefaultsVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + applyRegistryDefaults: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ApplyRegistryDefaults', + fieldName: 'applyRegistryDefaults', + ...buildCustomDocument( + 'query', + 'ApplyRegistryDefaults', + 'applyRegistryDefaults', + options?.select, + args, + [ + { + name: 'data', + type: 'JSON', + }, + { + name: 'nodeType', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), + resolveHttpRoute: ( + args: ResolveHttpRouteVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resolveHttpRoute: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveHttpRoute', + fieldName: 'resolveHttpRoute', + ...buildCustomDocument( + 'query', + 'ResolveHttpRoute', + 'resolveHttpRoute', + options.select, + args, + [ + { + name: 'requestHost', + type: 'String', + }, + { + name: 'requestMethod', + type: 'String', + }, + { + name: 'requestPath', + type: 'String', + }, + ], + connectionFieldsMap, + 'ResolveHttpRouteRecord' + ), + }), + resolveRoute: ( + args: ResolveRouteVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resolveRoute: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveRoute', + fieldName: 'resolveRoute', + ...buildCustomDocument( + 'query', + 'ResolveRoute', + 'resolveRoute', + options.select, + args, + [ + { + name: 'requestHost', + type: 'String', + }, + { + name: 'requestMethod', + type: 'String', + }, + { + name: 'requestPath', + type: 'String', + }, + ], + connectionFieldsMap, + 'ResolveRouteRecord' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/api/orm/realtime.ts b/sdk/constructive-sdk/src/api/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/api/orm/realtime.ts +++ b/sdk/constructive-sdk/src/api/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/api/orm/select-types.ts b/sdk/constructive-sdk/src/api/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/api/orm/select-types.ts +++ b/sdk/constructive-sdk/src/api/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/auth/index.ts b/sdk/constructive-sdk/src/auth/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/auth/index.ts +++ b/sdk/constructive-sdk/src/auth/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/auth/orm/client.ts b/sdk/constructive-sdk/src/auth/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/auth/orm/client.ts +++ b/sdk/constructive-sdk/src/auth/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/auth/orm/index.ts b/sdk/constructive-sdk/src/auth/orm/index.ts index 7c5cb52e86..b677b5b306 100644 --- a/sdk/constructive-sdk/src/auth/orm/index.ts +++ b/sdk/constructive-sdk/src/auth/orm/index.ts @@ -3,30 +3,30 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AuditLogAuthModel } from "./models/auditLogAuth"; -import { CryptoAddressModel } from "./models/cryptoAddress"; -import { EmailModel } from "./models/email"; -import { IdentityProviderModel } from "./models/identityProvider"; -import { OrgApiKeyListModel } from "./models/orgApiKeyList"; -import { PhoneNumberModel } from "./models/phoneNumber"; -import { PrincipalModel } from "./models/principal"; -import { PrincipalEntityModel } from "./models/principalEntity"; -import { PrincipalScopeOverrideModel } from "./models/principalScopeOverride"; -import { RoleTypeModel } from "./models/roleType"; -import { UserConnectedAccountModel } from "./models/userConnectedAccount"; -import { UserModel } from "./models/user"; -import { WebauthnCredentialModel } from "./models/webauthnCredential"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AuditLogAuthModel } from './models/auditLogAuth'; +import { CryptoAddressModel } from './models/cryptoAddress'; +import { EmailModel } from './models/email'; +import { IdentityProviderModel } from './models/identityProvider'; +import { OrgApiKeyListModel } from './models/orgApiKeyList'; +import { PhoneNumberModel } from './models/phoneNumber'; +import { PrincipalModel } from './models/principal'; +import { PrincipalEntityModel } from './models/principalEntity'; +import { PrincipalScopeOverrideModel } from './models/principalScopeOverride'; +import { RoleTypeModel } from './models/roleType'; +import { UserConnectedAccountModel } from './models/userConnectedAccount'; +import { UserModel } from './models/user'; +import { WebauthnCredentialModel } from './models/webauthnCredential'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -67,6 +67,6 @@ export function createClient(config: OrmClientConfig) { user: new UserModel(client), webauthnCredential: new WebauthnCredentialModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/input-types.ts b/sdk/constructive-sdk/src/auth/orm/input-types.ts index e6132cfc3d..56374f8968 100644 --- a/sdk/constructive-sdk/src/auth/orm/input-types.ts +++ b/sdk/constructive-sdk/src/auth/orm/input-types.ts @@ -495,9 +495,11 @@ export type OrgApiKeyListWithRelations = OrgApiKeyList & OrgApiKeyListRelations; export type PhoneNumberWithRelations = PhoneNumber & PhoneNumberRelations; export type PrincipalWithRelations = Principal & PrincipalRelations; export type PrincipalEntityWithRelations = PrincipalEntity & PrincipalEntityRelations; -export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & PrincipalScopeOverrideRelations; +export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & + PrincipalScopeOverrideRelations; export type RoleTypeWithRelations = RoleType & RoleTypeRelations; -export type UserConnectedAccountWithRelations = UserConnectedAccount & UserConnectedAccountRelations; +export type UserConnectedAccountWithRelations = UserConnectedAccount & + UserConnectedAccountRelations; export type UserWithRelations = User & UserRelations; export type WebauthnCredentialWithRelations = WebauthnCredential & WebauthnCredentialRelations; // ============ Entity Select Types ============ @@ -1145,19 +1147,268 @@ export interface WebauthnCredentialFilter { webauthnUserId?: StringFilter; } // ============ OrderBy Types ============ -export type AuditLogAuthOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_ASC" | "EVENT_DESC" | "ID_ASC" | "ID_DESC" | "IP_ADDRESS_ASC" | "IP_ADDRESS_DESC" | "NATURAL" | "ORIGIN_ASC" | "ORIGIN_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "USER_AGENT_ASC" | "USER_AGENT_DESC"; -export type CryptoAddressOrderBy = "ADDRESS_ASC" | "ADDRESS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type EmailOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EMAIL_ASC" | "EMAIL_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type IdentityProviderOrderBy = "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "ENABLED_ASC" | "ENABLED_DESC" | "KIND_ASC" | "KIND_DESC" | "NATURAL" | "SLUG_ASC" | "SLUG_DESC"; -export type OrgApiKeyListOrderBy = "ACCESS_LEVEL_ASC" | "ACCESS_LEVEL_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "KEY_ID_ASC" | "KEY_ID_DESC" | "LAST_USED_AT_ASC" | "LAST_USED_AT_DESC" | "MFA_LEVEL_ASC" | "MFA_LEVEL_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "ORG_ID_ASC" | "ORG_ID_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "REVOKED_AT_ASC" | "REVOKED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PhoneNumberOrderBy = "CC_ASC" | "CC_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_PRIMARY_ASC" | "IS_PRIMARY_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUMBER_ASC" | "NUMBER_DESC" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PrincipalOrderBy = "BYPASS_STEP_UP_ASC" | "BYPASS_STEP_UP_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USER_ID_ASC" | "USER_ID_DESC" | "USE_ADMIN_OWNER_ASC" | "USE_ADMIN_OWNER_DESC"; -export type PrincipalEntityOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PrincipalScopeOverrideOrderBy = "ALLOWED_MASK_ASC" | "ALLOWED_MASK_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_READ_ONLY_ASC" | "IS_READ_ONLY_DESC" | "MEMBERSHIP_TYPE_ASC" | "MEMBERSHIP_TYPE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USE_ADMIN_OWNER_ASC" | "USE_ADMIN_OWNER_DESC"; -export type RoleTypeOrderBy = "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type UserConnectedAccountOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DETAILS_ASC" | "DETAILS_DESC" | "IDENTIFIER_ASC" | "IDENTIFIER_DESC" | "ID_ASC" | "ID_DESC" | "IS_VERIFIED_ASC" | "IS_VERIFIED_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "SERVICE_ASC" | "SERVICE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type UserOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "DISPLAY_NAME_TRGM_SIMILARITY_ASC" | "DISPLAY_NAME_TRGM_SIMILARITY_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROFILE_PICTURE_ASC" | "PROFILE_PICTURE_DESC" | "SEARCH_SCORE_ASC" | "SEARCH_SCORE_DESC" | "SEARCH_TSV_ASC" | "SEARCH_TSV_DESC" | "SEARCH_TSV_RANK_ASC" | "SEARCH_TSV_RANK_DESC" | "TYPE_ASC" | "TYPE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "USERNAME_ASC" | "USERNAME_DESC"; -export type WebauthnCredentialOrderBy = "BACKUP_ELIGIBLE_ASC" | "BACKUP_ELIGIBLE_DESC" | "BACKUP_STATE_ASC" | "BACKUP_STATE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREDENTIAL_DEVICE_TYPE_ASC" | "CREDENTIAL_DEVICE_TYPE_DESC" | "CREDENTIAL_ID_ASC" | "CREDENTIAL_ID_DESC" | "ID_ASC" | "ID_DESC" | "LAST_USED_AT_ASC" | "LAST_USED_AT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PUBLIC_KEY_ASC" | "PUBLIC_KEY_DESC" | "SIGN_COUNT_ASC" | "SIGN_COUNT_DESC" | "TRANSPORTS_ASC" | "TRANSPORTS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WEBAUTHN_USER_ID_ASC" | "WEBAUTHN_USER_ID_DESC"; +export type AuditLogAuthOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_ASC' + | 'EVENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IP_ADDRESS_ASC' + | 'IP_ADDRESS_DESC' + | 'NATURAL' + | 'ORIGIN_ASC' + | 'ORIGIN_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'USER_AGENT_ASC' + | 'USER_AGENT_DESC'; +export type CryptoAddressOrderBy = + | 'ADDRESS_ASC' + | 'ADDRESS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type EmailOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EMAIL_ASC' + | 'EMAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type IdentityProviderOrderBy = + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'ENABLED_ASC' + | 'ENABLED_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'NATURAL' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type OrgApiKeyListOrderBy = + | 'ACCESS_LEVEL_ASC' + | 'ACCESS_LEVEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KEY_ID_ASC' + | 'KEY_ID_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'MFA_LEVEL_ASC' + | 'MFA_LEVEL_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'ORG_ID_ASC' + | 'ORG_ID_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'REVOKED_AT_ASC' + | 'REVOKED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PhoneNumberOrderBy = + | 'CC_ASC' + | 'CC_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_PRIMARY_ASC' + | 'IS_PRIMARY_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUMBER_ASC' + | 'NUMBER_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PrincipalOrderBy = + | 'BYPASS_STEP_UP_ASC' + | 'BYPASS_STEP_UP_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USER_ID_ASC' + | 'USER_ID_DESC' + | 'USE_ADMIN_OWNER_ASC' + | 'USE_ADMIN_OWNER_DESC'; +export type PrincipalEntityOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PrincipalScopeOverrideOrderBy = + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'MEMBERSHIP_TYPE_ASC' + | 'MEMBERSHIP_TYPE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USE_ADMIN_OWNER_ASC' + | 'USE_ADMIN_OWNER_DESC'; +export type RoleTypeOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type UserConnectedAccountOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DETAILS_ASC' + | 'DETAILS_DESC' + | 'IDENTIFIER_ASC' + | 'IDENTIFIER_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VERIFIED_ASC' + | 'IS_VERIFIED_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'SERVICE_ASC' + | 'SERVICE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type UserOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'DISPLAY_NAME_TRGM_SIMILARITY_ASC' + | 'DISPLAY_NAME_TRGM_SIMILARITY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROFILE_PICTURE_ASC' + | 'PROFILE_PICTURE_DESC' + | 'SEARCH_SCORE_ASC' + | 'SEARCH_SCORE_DESC' + | 'SEARCH_TSV_ASC' + | 'SEARCH_TSV_DESC' + | 'SEARCH_TSV_RANK_ASC' + | 'SEARCH_TSV_RANK_DESC' + | 'TYPE_ASC' + | 'TYPE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'USERNAME_ASC' + | 'USERNAME_DESC'; +export type WebauthnCredentialOrderBy = + | 'BACKUP_ELIGIBLE_ASC' + | 'BACKUP_ELIGIBLE_DESC' + | 'BACKUP_STATE_ASC' + | 'BACKUP_STATE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREDENTIAL_DEVICE_TYPE_ASC' + | 'CREDENTIAL_DEVICE_TYPE_DESC' + | 'CREDENTIAL_ID_ASC' + | 'CREDENTIAL_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PUBLIC_KEY_ASC' + | 'PUBLIC_KEY_DESC' + | 'SIGN_COUNT_ASC' + | 'SIGN_COUNT_DESC' + | 'TRANSPORTS_ASC' + | 'TRANSPORTS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WEBAUTHN_USER_ID_ASC' + | 'WEBAUTHN_USER_ID_DESC'; // ============ CRUD Input Types ============ export interface CreateAuditLogAuthInput { clientMutationId?: string; @@ -1512,24 +1763,24 @@ export interface DeleteWebauthnCredentialInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Principal": { - "principalEntities": "PrincipalEntity", - "principalScopeOverrides": "PrincipalScopeOverride" + Principal: { + principalEntities: 'PrincipalEntity', + principalScopeOverrides: 'PrincipalScopeOverride', }, - "RoleType": { - "usersByType": "User" + RoleType: { + usersByType: 'User', + }, + User: { + auditLogAuthsByActorId: 'AuditLogAuth', + ownedCryptoAddresses: 'CryptoAddress', + ownedEmails: 'Email', + ownedPhoneNumbers: 'PhoneNumber', + ownedPrincipalEntities: 'PrincipalEntity', + ownedPrincipals: 'Principal', + ownedWebauthnCredentials: 'WebauthnCredential', + principalEntitiesByEntityId: 'PrincipalEntity', + principals: 'Principal', }, - "User": { - "auditLogAuthsByActorId": "AuditLogAuth", - "ownedCryptoAddresses": "CryptoAddress", - "ownedEmails": "Email", - "ownedPhoneNumbers": "PhoneNumber", - "ownedPrincipalEntities": "PrincipalEntity", - "ownedPrincipals": "Principal", - "ownedWebauthnCredentials": "WebauthnCredential", - "principalEntitiesByEntityId": "PrincipalEntity", - "principals": "Principal" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface CheckPasswordInput { @@ -3705,4 +3956,4 @@ export type WebauthnCredentialEdgeSelect = { node?: { select: WebauthnCredentialSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/auth/orm/models/auditLogAuth.ts b/sdk/constructive-sdk/src/auth/orm/models/auditLogAuth.ts index 250bad2507..d0eee8faf1 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/auditLogAuth.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/auditLogAuth.ts @@ -3,56 +3,96 @@ * @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 { AuditLogAuth, AuditLogAuthWithRelations, AuditLogAuthSelect, AuditLogAuthFilter, AuditLogAuthOrderBy, CreateAuditLogAuthInput, UpdateAuditLogAuthInput, AuditLogAuthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AuditLogAuth, + AuditLogAuthWithRelations, + AuditLogAuthSelect, + AuditLogAuthFilter, + AuditLogAuthOrderBy, + CreateAuditLogAuthInput, + UpdateAuditLogAuthInput, + AuditLogAuthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AuditLogAuthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuths: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AuditLogAuth", "auditLogAuths", 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 - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AuditLogAuth', + 'auditLogAuths', + 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, + }, + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuths", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AuditLogAuth", "auditLogAuths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AuditLogAuth', + 'auditLogAuths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuth", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuth', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AuditLogAuthModel { nodes?: InferSelectResult[]; }; }) => ({ - "auditLogAuth": data.auditLogAuths?.nodes?.[0] ?? null - }) + auditLogAuth: data.auditLogAuths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ auditLogAuth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AuditLogAuth", "auditLogAuths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AuditLogAuth', + 'auditLogAuths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AuditLogAuthFilter", "AuditLogAuthOrderBy", connectionFieldsMap); + 'AuditLogAuthFilter', + 'AuditLogAuthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AuditLogAuth", - fieldName: "auditLogAuth", + operation: 'query', + operationName: 'AuditLogAuth', + fieldName: 'auditLogAuth', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class AuditLogAuthModel { nodes?: InferSelectResult[]; }; }) => ({ - "auditLogAuth": data.auditLogAuths?.nodes?.[0] ?? null - }) + auditLogAuth: data.auditLogAuths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AuditLogAuth", "createAuditLogAuth", "auditLogAuth", args.select, args.data, "CreateAuditLogAuthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AuditLogAuth', + 'createAuditLogAuth', + 'auditLogAuth', + args.select, + args.data, + 'CreateAuditLogAuthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "createAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'createAuditLogAuth', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + AuditLogAuthPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AuditLogAuth", "updateAuditLogAuth", "auditLogAuth", args.select, args.where.id, args.data, "UpdateAuditLogAuthInput", "id", "auditLogAuthPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'AuditLogAuth', + 'updateAuditLogAuth', + 'auditLogAuth', + args.select, + args.where.id, + args.data, + 'UpdateAuditLogAuthInput', + 'id', + 'auditLogAuthPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "updateAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'updateAuditLogAuth', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAuditLogAuth: { auditLogAuth: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AuditLogAuth", "deleteAuditLogAuth", "auditLogAuth", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteAuditLogAuthInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AuditLogAuth', + 'deleteAuditLogAuth', + 'auditLogAuth', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteAuditLogAuthInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AuditLogAuth", - fieldName: "deleteAuditLogAuth", + operation: 'mutation', + operationName: 'AuditLogAuth', + fieldName: 'deleteAuditLogAuth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/cryptoAddress.ts b/sdk/constructive-sdk/src/auth/orm/models/cryptoAddress.ts index dbf942ec7b..5dc26c76df 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/cryptoAddress.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/cryptoAddress.ts @@ -3,56 +3,96 @@ * @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 { CryptoAddress, CryptoAddressWithRelations, CryptoAddressSelect, CryptoAddressFilter, CryptoAddressOrderBy, CreateCryptoAddressInput, UpdateCryptoAddressInput, CryptoAddressPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAddress, + CryptoAddressWithRelations, + CryptoAddressSelect, + CryptoAddressFilter, + CryptoAddressOrderBy, + CreateCryptoAddressInput, + UpdateCryptoAddressInput, + CryptoAddressPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAddressModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddresses: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddress", "cryptoAddresses", 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 - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAddress', + 'cryptoAddresses', + 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, + }, + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddresses", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddresses', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddress: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAddress", "cryptoAddresses", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAddress', + 'cryptoAddresses', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddress", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddress', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CryptoAddressModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddress": data.cryptoAddresses?.nodes?.[0] ?? null - }) + cryptoAddress: data.cryptoAddresses?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddress: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddress", "cryptoAddresses", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAddress', + 'cryptoAddresses', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAddressFilter", "CryptoAddressOrderBy", connectionFieldsMap); + 'CryptoAddressFilter', + 'CryptoAddressOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddress", - fieldName: "cryptoAddress", + operation: 'query', + operationName: 'CryptoAddress', + fieldName: 'cryptoAddress', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CryptoAddressModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddress": data.cryptoAddresses?.nodes?.[0] ?? null - }) + cryptoAddress: data.cryptoAddresses?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAddress", "createCryptoAddress", "cryptoAddress", args.select, args.data, "CreateCryptoAddressInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAddress', + 'createCryptoAddress', + 'cryptoAddress', + args.select, + args.data, + 'CreateCryptoAddressInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "createCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'createCryptoAddress', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAddressPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAddress", "updateCryptoAddress", "cryptoAddress", args.select, args.where.id, args.data, "UpdateCryptoAddressInput", "id", "cryptoAddressPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAddress', + 'updateCryptoAddress', + 'cryptoAddress', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAddressInput', + 'id', + 'cryptoAddressPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "updateCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'updateCryptoAddress', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAddress: { cryptoAddress: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAddress", "deleteCryptoAddress", "cryptoAddress", { - id: args.where.id - }, "DeleteCryptoAddressInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAddress', + 'deleteCryptoAddress', + 'cryptoAddress', + { + id: args.where.id, + }, + 'DeleteCryptoAddressInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddress", - fieldName: "deleteCryptoAddress", + operation: 'mutation', + operationName: 'CryptoAddress', + fieldName: 'deleteCryptoAddress', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/email.ts b/sdk/constructive-sdk/src/auth/orm/models/email.ts index d3bf3812f5..eb60ea671f 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/email.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/email.ts @@ -3,56 +3,96 @@ * @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 { Email, EmailWithRelations, EmailSelect, EmailFilter, EmailOrderBy, CreateEmailInput, UpdateEmailInput, EmailPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Email, + EmailWithRelations, + EmailSelect, + EmailFilter, + EmailOrderBy, + CreateEmailInput, + UpdateEmailInput, + EmailPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmailModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emails: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Email", "emails", 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 - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Email', + 'emails', + 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, + }, + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "emails", + operation: 'query', + operationName: 'Email', + fieldName: 'emails', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ email: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Email", "emails", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Email', + 'emails', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "email", + operation: 'query', + operationName: 'Email', + fieldName: 'email', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmailModel { nodes?: InferSelectResult[]; }; }) => ({ - "email": data.emails?.nodes?.[0] ?? null - }) + email: data.emails?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ email: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Email", "emails", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Email', + 'emails', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmailFilter", "EmailOrderBy", connectionFieldsMap); + 'EmailFilter', + 'EmailOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Email", - fieldName: "email", + operation: 'query', + operationName: 'Email', + fieldName: 'email', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmailModel { nodes?: InferSelectResult[]; }; }) => ({ - "email": data.emails?.nodes?.[0] ?? null - }) + email: data.emails?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Email", "createEmail", "email", args.select, args.data, "CreateEmailInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Email', + 'createEmail', + 'email', + args.select, + args.data, + 'CreateEmailInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "createEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'createEmail', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmailPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Email", "updateEmail", "email", args.select, args.where.id, args.data, "UpdateEmailInput", "id", "emailPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Email', + 'updateEmail', + 'email', + args.select, + args.where.id, + args.data, + 'UpdateEmailInput', + 'id', + 'emailPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "updateEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'updateEmail', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmail: { email: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Email", "deleteEmail", "email", { - id: args.where.id - }, "DeleteEmailInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Email', + 'deleteEmail', + 'email', + { + id: args.where.id, + }, + 'DeleteEmailInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Email", - fieldName: "deleteEmail", + operation: 'mutation', + operationName: 'Email', + fieldName: 'deleteEmail', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/identityProvider.ts b/sdk/constructive-sdk/src/auth/orm/models/identityProvider.ts index f339ccf4d3..cdc672145c 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/identityProvider.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/identityProvider.ts @@ -3,56 +3,96 @@ * @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 { IdentityProvider, IdentityProviderWithRelations, IdentityProviderSelect, IdentityProviderFilter, IdentityProviderOrderBy, CreateIdentityProviderInput, UpdateIdentityProviderInput, IdentityProviderPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IdentityProvider, + IdentityProviderWithRelations, + IdentityProviderSelect, + IdentityProviderFilter, + IdentityProviderOrderBy, + CreateIdentityProviderInput, + UpdateIdentityProviderInput, + IdentityProviderPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IdentityProviderModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProviders: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvider", "identityProviders", 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 - }, "IdentityProviderFilter", "IdentityProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IdentityProvider', + 'identityProviders', + 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, + }, + 'IdentityProviderFilter', + 'IdentityProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvider", - fieldName: "identityProviders", + operation: 'query', + operationName: 'IdentityProvider', + fieldName: 'identityProviders', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IdentityProvider", "identityProviders", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IdentityProviderFilter", "IdentityProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IdentityProvider', + 'identityProviders', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IdentityProviderFilter', + 'IdentityProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvider", - fieldName: "identityProvider", + operation: 'query', + operationName: 'IdentityProvider', + fieldName: 'identityProvider', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class IdentityProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvider": data.identityProviders?.nodes?.[0] ?? null - }) + identityProvider: data.identityProviders?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIdentityProvider: { identityProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IdentityProvider", "createIdentityProvider", "identityProvider", args.select, args.data, "CreateIdentityProviderInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IdentityProvider', + 'createIdentityProvider', + 'identityProvider', + args.select, + args.data, + 'CreateIdentityProviderInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvider", - fieldName: "createIdentityProvider", + operation: 'mutation', + operationName: 'IdentityProvider', + fieldName: 'createIdentityProvider', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/index.ts b/sdk/constructive-sdk/src/auth/orm/models/index.ts index 114133e294..16f584ff03 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/index.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/index.ts @@ -3,16 +3,16 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AuditLogAuthModel } from "./auditLogAuth"; -export { CryptoAddressModel } from "./cryptoAddress"; -export { EmailModel } from "./email"; -export { IdentityProviderModel } from "./identityProvider"; -export { OrgApiKeyListModel } from "./orgApiKeyList"; -export { PhoneNumberModel } from "./phoneNumber"; -export { PrincipalModel } from "./principal"; -export { PrincipalEntityModel } from "./principalEntity"; -export { PrincipalScopeOverrideModel } from "./principalScopeOverride"; -export { RoleTypeModel } from "./roleType"; -export { UserConnectedAccountModel } from "./userConnectedAccount"; -export { UserModel } from "./user"; -export { WebauthnCredentialModel } from "./webauthnCredential"; \ No newline at end of file +export { AuditLogAuthModel } from './auditLogAuth'; +export { CryptoAddressModel } from './cryptoAddress'; +export { EmailModel } from './email'; +export { IdentityProviderModel } from './identityProvider'; +export { OrgApiKeyListModel } from './orgApiKeyList'; +export { PhoneNumberModel } from './phoneNumber'; +export { PrincipalModel } from './principal'; +export { PrincipalEntityModel } from './principalEntity'; +export { PrincipalScopeOverrideModel } from './principalScopeOverride'; +export { RoleTypeModel } from './roleType'; +export { UserConnectedAccountModel } from './userConnectedAccount'; +export { UserModel } from './user'; +export { WebauthnCredentialModel } from './webauthnCredential'; diff --git a/sdk/constructive-sdk/src/auth/orm/models/orgApiKeyList.ts b/sdk/constructive-sdk/src/auth/orm/models/orgApiKeyList.ts index 8c834057b7..fe7120ee8a 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/orgApiKeyList.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/orgApiKeyList.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyLists', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgApiKeyListModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgApiKeyList": data.orgApiKeyLists?.nodes?.[0] ?? null - }) + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgApiKeyList: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgApiKeyList", "orgApiKeyLists", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgApiKeyListFilter", "OrgApiKeyListOrderBy", connectionFieldsMap); + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgApiKeyList", - fieldName: "orgApiKeyList", + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class OrgApiKeyListModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgApiKeyList": data.orgApiKeyLists?.nodes?.[0] ?? null - }) + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgApiKeyList: { orgApiKeyList: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgApiKeyList", "createOrgApiKeyList", "orgApiKeyList", args.select, args.data, "CreateOrgApiKeyListInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'OrgApiKeyList', + fieldName: 'createOrgApiKeyList', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/phoneNumber.ts b/sdk/constructive-sdk/src/auth/orm/models/phoneNumber.ts index 113fbf78bb..f005f23c34 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/phoneNumber.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/phoneNumber.ts @@ -3,56 +3,96 @@ * @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 { PhoneNumber, PhoneNumberWithRelations, PhoneNumberSelect, PhoneNumberFilter, PhoneNumberOrderBy, CreatePhoneNumberInput, UpdatePhoneNumberInput, PhoneNumberPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PhoneNumber, + PhoneNumberWithRelations, + PhoneNumberSelect, + PhoneNumberFilter, + PhoneNumberOrderBy, + CreatePhoneNumberInput, + UpdatePhoneNumberInput, + PhoneNumberPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PhoneNumberModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbers: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumber", "phoneNumbers", 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 - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PhoneNumber', + 'phoneNumbers', + 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, + }, + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumbers", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumbers', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumber: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PhoneNumber", "phoneNumbers", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PhoneNumber', + 'phoneNumbers', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumber", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumber', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PhoneNumberModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumber": data.phoneNumbers?.nodes?.[0] ?? null - }) + phoneNumber: data.phoneNumbers?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumber: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumber", "phoneNumbers", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PhoneNumber', + 'phoneNumbers', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PhoneNumberFilter", "PhoneNumberOrderBy", connectionFieldsMap); + 'PhoneNumberFilter', + 'PhoneNumberOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumber", - fieldName: "phoneNumber", + operation: 'query', + operationName: 'PhoneNumber', + fieldName: 'phoneNumber', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PhoneNumberModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumber": data.phoneNumbers?.nodes?.[0] ?? null - }) + phoneNumber: data.phoneNumbers?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PhoneNumber", "createPhoneNumber", "phoneNumber", args.select, args.data, "CreatePhoneNumberInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PhoneNumber', + 'createPhoneNumber', + 'phoneNumber', + args.select, + args.data, + 'CreatePhoneNumberInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "createPhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'createPhoneNumber', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PhoneNumberPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PhoneNumber", "updatePhoneNumber", "phoneNumber", args.select, args.where.id, args.data, "UpdatePhoneNumberInput", "id", "phoneNumberPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PhoneNumber', + 'updatePhoneNumber', + 'phoneNumber', + args.select, + args.where.id, + args.data, + 'UpdatePhoneNumberInput', + 'id', + 'phoneNumberPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "updatePhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'updatePhoneNumber', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePhoneNumber: { phoneNumber: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PhoneNumber", "deletePhoneNumber", "phoneNumber", { - id: args.where.id - }, "DeletePhoneNumberInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PhoneNumber', + 'deletePhoneNumber', + 'phoneNumber', + { + id: args.where.id, + }, + 'DeletePhoneNumberInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumber", - fieldName: "deletePhoneNumber", + operation: 'mutation', + operationName: 'PhoneNumber', + fieldName: 'deletePhoneNumber', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/principal.ts b/sdk/constructive-sdk/src/auth/orm/models/principal.ts index 74f25735af..05e5aa400c 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/principal.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/principal.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'Principal', + fieldName: 'principals', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalModel { nodes?: InferSelectResult[]; }; }) => ({ - "principal": data.principals?.nodes?.[0] ?? null - }) + principal: data.principals?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - principalId: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + principalId: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principal: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Principal", "principals", args.select, { - where: { - principalId: { - equalTo: args.principalId - } + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + args.select, + { + where: { + principalId: { + equalTo: args.principalId, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalFilter", "PrincipalOrderBy", connectionFieldsMap); + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Principal", - fieldName: "principal", + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class PrincipalModel { nodes?: InferSelectResult[]; }; }) => ({ - "principal": data.principals?.nodes?.[0] ?? null - }) + principal: data.principals?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipal: { principal: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Principal", "createPrincipal", "principal", args.select, args.data, "CreatePrincipalInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'Principal', + fieldName: 'createPrincipal', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/principalEntity.ts b/sdk/constructive-sdk/src/auth/orm/models/principalEntity.ts index bb89e7c1ac..0c265501f5 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/principalEntity.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/principalEntity.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalEntityModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalEntity": data.principalEntities?.nodes?.[0] ?? null - }) + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalEntity: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalEntity", "principalEntities", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalEntityFilter", "PrincipalEntityOrderBy", connectionFieldsMap); + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalEntity", - fieldName: "principalEntity", + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PrincipalEntityModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalEntity": data.principalEntities?.nodes?.[0] ?? null - }) + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalEntity: { principalEntity: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalEntity", "createPrincipalEntity", "principalEntity", args.select, args.data, "CreatePrincipalEntityInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'createPrincipalEntity', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'updatePrincipalEntity', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'deletePrincipalEntity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/principalScopeOverride.ts b/sdk/constructive-sdk/src/auth/orm/models/principalScopeOverride.ts index 44fc657725..3d3e7bedd3 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/principalScopeOverride.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/principalScopeOverride.ts @@ -3,56 +3,98 @@ * @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"; +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>; + 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); + 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", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverrides', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PrincipalScopeOverrideModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalScopeOverride": data.principalScopeOverrides?.nodes?.[0] ?? null - }) + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalScopeOverride: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalScopeOverride", "principalScopeOverrides", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalScopeOverrideFilter", "PrincipalScopeOverrideOrderBy", connectionFieldsMap); + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalScopeOverride", - fieldName: "principalScopeOverride", + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PrincipalScopeOverrideModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalScopeOverride": data.principalScopeOverrides?.nodes?.[0] ?? null - }) + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalScopeOverride: { principalScopeOverride: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalScopeOverride", "createPrincipalScopeOverride", "principalScopeOverride", args.select, args.data, "CreatePrincipalScopeOverrideInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalScopeOverride', + fieldName: 'createPrincipalScopeOverride', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/roleType.ts b/sdk/constructive-sdk/src/auth/orm/models/roleType.ts index 9ad06fd49a..e8df4924bd 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/roleType.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/roleType.ts @@ -3,56 +3,96 @@ * @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 { RoleType, RoleTypeWithRelations, RoleTypeSelect, RoleTypeFilter, RoleTypeOrderBy, CreateRoleTypeInput, UpdateRoleTypeInput, RoleTypePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RoleType, + RoleTypeWithRelations, + RoleTypeSelect, + RoleTypeFilter, + RoleTypeOrderBy, + CreateRoleTypeInput, + UpdateRoleTypeInput, + RoleTypePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RoleTypeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ roleTypes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RoleType", "roleTypes", 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 - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RoleType', + 'roleTypes', + 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, + }, + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleTypes", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleTypes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ roleType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RoleType", "roleTypes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RoleType', + 'roleTypes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleType", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleType', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RoleTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "roleType": data.roleTypes?.nodes?.[0] ?? null - }) + roleType: data.roleTypes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ roleType: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RoleType", "roleTypes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RoleType', + 'roleTypes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RoleTypeFilter", "RoleTypeOrderBy", connectionFieldsMap); + 'RoleTypeFilter', + 'RoleTypeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RoleType", - fieldName: "roleType", + operation: 'query', + operationName: 'RoleType', + fieldName: 'roleType', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RoleTypeModel { nodes?: InferSelectResult[]; }; }) => ({ - "roleType": data.roleTypes?.nodes?.[0] ?? null - }) + roleType: data.roleTypes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RoleType", "createRoleType", "roleType", args.select, args.data, "CreateRoleTypeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RoleType', + 'createRoleType', + 'roleType', + args.select, + args.data, + 'CreateRoleTypeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "createRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'createRoleType', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: number; + }, + RoleTypePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RoleType", "updateRoleType", "roleType", args.select, args.where.id, args.data, "UpdateRoleTypeInput", "id", "roleTypePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RoleType', + 'updateRoleType', + 'roleType', + args.select, + args.where.id, + args.data, + 'UpdateRoleTypeInput', + 'id', + 'roleTypePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "updateRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'updateRoleType', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: number; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: number; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRoleType: { roleType: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RoleType", "deleteRoleType", "roleType", { - id: args.where.id - }, "DeleteRoleTypeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RoleType', + 'deleteRoleType', + 'roleType', + { + id: args.where.id, + }, + 'DeleteRoleTypeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RoleType", - fieldName: "deleteRoleType", + operation: 'mutation', + operationName: 'RoleType', + fieldName: 'deleteRoleType', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/user.ts b/sdk/constructive-sdk/src/auth/orm/models/user.ts index e1ba665fee..a35147a5ac 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/user.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/user.ts @@ -3,56 +3,96 @@ * @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 { User, UserWithRelations, UserSelect, UserFilter, UserOrderBy, CreateUserInput, UpdateUserInput, UserPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + User, + UserWithRelations, + UserSelect, + UserFilter, + UserOrderBy, + CreateUserInput, + UpdateUserInput, + UserPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ users: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("User", "users", 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 - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'User', + 'users', + 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, + }, + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "users", + operation: 'query', + operationName: 'User', + fieldName: 'users', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ user: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("User", "users", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'User', + 'users', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "user", + operation: 'query', + operationName: 'User', + fieldName: 'user', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserModel { nodes?: InferSelectResult[]; }; }) => ({ - "user": data.users?.nodes?.[0] ?? null - }) + user: data.users?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ user: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("User", "users", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'User', + 'users', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserFilter", "UserOrderBy", connectionFieldsMap); + 'UserFilter', + 'UserOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "User", - fieldName: "user", + operation: 'query', + operationName: 'User', + fieldName: 'user', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserModel { nodes?: InferSelectResult[]; }; }) => ({ - "user": data.users?.nodes?.[0] ?? null - }) + user: data.users?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("User", "createUser", "user", args.select, args.data, "CreateUserInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'User', + 'createUser', + 'user', + args.select, + args.data, + 'CreateUserInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "createUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'createUser', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("User", "updateUser", "user", args.select, args.where.id, args.data, "UpdateUserInput", "id", "userPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'User', + 'updateUser', + 'user', + args.select, + args.where.id, + args.data, + 'UpdateUserInput', + 'id', + 'userPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "updateUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'updateUser', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUser: { user: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("User", "deleteUser", "user", { - id: args.where.id - }, "DeleteUserInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'User', + 'deleteUser', + 'user', + { + id: args.where.id, + }, + 'DeleteUserInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "User", - fieldName: "deleteUser", + operation: 'mutation', + operationName: 'User', + fieldName: 'deleteUser', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/userConnectedAccount.ts b/sdk/constructive-sdk/src/auth/orm/models/userConnectedAccount.ts index a9666543ab..a2344afdf4 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/userConnectedAccount.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/userConnectedAccount.ts @@ -3,56 +3,98 @@ * @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 { UserConnectedAccount, UserConnectedAccountWithRelations, UserConnectedAccountSelect, UserConnectedAccountFilter, UserConnectedAccountOrderBy, CreateUserConnectedAccountInput, UpdateUserConnectedAccountInput, UserConnectedAccountPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserConnectedAccount, + UserConnectedAccountWithRelations, + UserConnectedAccountSelect, + UserConnectedAccountFilter, + UserConnectedAccountOrderBy, + CreateUserConnectedAccountInput, + UpdateUserConnectedAccountInput, + UserConnectedAccountPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserConnectedAccountModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - userConnectedAccounts: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + userConnectedAccounts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("UserConnectedAccount", "userConnectedAccounts", 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 - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + 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, + }, + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccounts", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccounts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userConnectedAccount: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserConnectedAccount", "userConnectedAccounts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccount", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccount', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class UserConnectedAccountModel { nodes?: InferSelectResult[]; }; }) => ({ - "userConnectedAccount": data.userConnectedAccounts?.nodes?.[0] ?? null - }) + userConnectedAccount: data.userConnectedAccounts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userConnectedAccount: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserConnectedAccount", "userConnectedAccounts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserConnectedAccount', + 'userConnectedAccounts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserConnectedAccountFilter", "UserConnectedAccountOrderBy", connectionFieldsMap); + 'UserConnectedAccountFilter', + 'UserConnectedAccountOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserConnectedAccount", - fieldName: "userConnectedAccount", + operation: 'query', + operationName: 'UserConnectedAccount', + fieldName: 'userConnectedAccount', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class UserConnectedAccountModel { nodes?: InferSelectResult[]; }; }) => ({ - "userConnectedAccount": data.userConnectedAccounts?.nodes?.[0] ?? null - }) + userConnectedAccount: data.userConnectedAccounts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserConnectedAccount: { userConnectedAccount: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserConnectedAccount", "createUserConnectedAccount", "userConnectedAccount", args.select, args.data, "CreateUserConnectedAccountInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserConnectedAccount', + 'createUserConnectedAccount', + 'userConnectedAccount', + args.select, + args.data, + 'CreateUserConnectedAccountInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserConnectedAccount", - fieldName: "createUserConnectedAccount", + operation: 'mutation', + operationName: 'UserConnectedAccount', + fieldName: 'createUserConnectedAccount', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/webauthnCredential.ts b/sdk/constructive-sdk/src/auth/orm/models/webauthnCredential.ts index 9760690ceb..bc31ef6a16 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/webauthnCredential.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/webauthnCredential.ts @@ -3,56 +3,96 @@ * @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 { WebauthnCredential, WebauthnCredentialWithRelations, WebauthnCredentialSelect, WebauthnCredentialFilter, WebauthnCredentialOrderBy, CreateWebauthnCredentialInput, UpdateWebauthnCredentialInput, WebauthnCredentialPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnCredential, + WebauthnCredentialWithRelations, + WebauthnCredentialSelect, + WebauthnCredentialFilter, + WebauthnCredentialOrderBy, + CreateWebauthnCredentialInput, + UpdateWebauthnCredentialInput, + WebauthnCredentialPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnCredentialModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentials: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredential", "webauthnCredentials", 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 - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnCredential', + 'webauthnCredentials', + 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, + }, + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredentials", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredentials', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredential: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnCredential", "webauthnCredentials", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnCredential', + 'webauthnCredentials', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredential", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredential', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnCredentialModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredential": data.webauthnCredentials?.nodes?.[0] ?? null - }) + webauthnCredential: data.webauthnCredentials?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredential: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredential", "webauthnCredentials", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnCredential', + 'webauthnCredentials', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnCredentialFilter", "WebauthnCredentialOrderBy", connectionFieldsMap); + 'WebauthnCredentialFilter', + 'WebauthnCredentialOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredential", - fieldName: "webauthnCredential", + operation: 'query', + operationName: 'WebauthnCredential', + fieldName: 'webauthnCredential', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnCredentialModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredential": data.webauthnCredentials?.nodes?.[0] ?? null - }) + webauthnCredential: data.webauthnCredentials?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnCredential", "createWebauthnCredential", "webauthnCredential", args.select, args.data, "CreateWebauthnCredentialInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnCredential', + 'createWebauthnCredential', + 'webauthnCredential', + args.select, + args.data, + 'CreateWebauthnCredentialInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "createWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'createWebauthnCredential', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnCredentialPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnCredential", "updateWebauthnCredential", "webauthnCredential", args.select, args.where.id, args.data, "UpdateWebauthnCredentialInput", "id", "webauthnCredentialPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnCredential', + 'updateWebauthnCredential', + 'webauthnCredential', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnCredentialInput', + 'id', + 'webauthnCredentialPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "updateWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'updateWebauthnCredential', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnCredential: { webauthnCredential: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnCredential", "deleteWebauthnCredential", "webauthnCredential", { - id: args.where.id - }, "DeleteWebauthnCredentialInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnCredential', + 'deleteWebauthnCredential', + 'webauthnCredential', + { + id: args.where.id, + }, + 'DeleteWebauthnCredentialInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredential", - fieldName: "deleteWebauthnCredential", + operation: 'mutation', + operationName: 'WebauthnCredential', + fieldName: 'deleteWebauthnCredential', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/mutation/index.ts b/sdk/constructive-sdk/src/auth/orm/mutation/index.ts index fcdc27d130..ae0973c7fb 100644 --- a/sdk/constructive-sdk/src/auth/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/auth/orm/mutation/index.ts @@ -3,11 +3,102 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { CheckPasswordInput, ConfirmDeleteAccountInput, CreateApiKeyInput, CreateOrgApiKeyInput, CreateOrgPrincipalInput, DeleteOrgPrincipalInput, DeletePrincipalInput, DisconnectAccountInput, ExtendTokenExpiresInput, ForgotPasswordInput, LinkIdentityInput, ProvisionBucketInput, ProvisionNewUserInput, RequestCrossOriginTokenInput, ResetPasswordInput, RevokeApiKeyInput, RevokeOrgApiKeyInput, RevokeSessionInput, SendAccountDeletionEmailInput, SendVerificationEmailInput, SetPasswordInput, SignInInput, SignInCrossOriginInput, SignInSmsOtpInput, SignOutInput, SignUpInput, SignUpSmsInput, VerifyEmailInput, VerifyPasswordInput, VerifyTotpInput, CheckPasswordPayload, ConfirmDeleteAccountPayload, CreateApiKeyPayload, CreateOrgApiKeyPayload, CreateOrgPrincipalPayload, DeleteOrgPrincipalPayload, DeletePrincipalPayload, DisconnectAccountPayload, ExtendTokenExpiresPayload, ForgotPasswordPayload, LinkIdentityPayload, ProvisionBucketPayload, ProvisionNewUserPayload, RequestCrossOriginTokenPayload, ResetPasswordPayload, RevokeApiKeyPayload, RevokeOrgApiKeyPayload, RevokeSessionPayload, SendAccountDeletionEmailPayload, SendVerificationEmailPayload, SetPasswordPayload, SignInPayload, SignInCrossOriginPayload, SignInSmsOtpPayload, SignOutPayload, SignUpPayload, SignUpSmsPayload, VerifyEmailPayload, VerifyPasswordPayload, VerifyTotpPayload, CheckPasswordPayloadSelect, ConfirmDeleteAccountPayloadSelect, CreateApiKeyPayloadSelect, CreateOrgApiKeyPayloadSelect, CreateOrgPrincipalPayloadSelect, DeleteOrgPrincipalPayloadSelect, DeletePrincipalPayloadSelect, DisconnectAccountPayloadSelect, ExtendTokenExpiresPayloadSelect, ForgotPasswordPayloadSelect, LinkIdentityPayloadSelect, ProvisionBucketPayloadSelect, ProvisionNewUserPayloadSelect, RequestCrossOriginTokenPayloadSelect, ResetPasswordPayloadSelect, RevokeApiKeyPayloadSelect, RevokeOrgApiKeyPayloadSelect, RevokeSessionPayloadSelect, SendAccountDeletionEmailPayloadSelect, SendVerificationEmailPayloadSelect, SetPasswordPayloadSelect, SignInPayloadSelect, SignInCrossOriginPayloadSelect, SignInSmsOtpPayloadSelect, SignOutPayloadSelect, SignUpPayloadSelect, SignUpSmsPayloadSelect, VerifyEmailPayloadSelect, VerifyPasswordPayloadSelect, VerifyTotpPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + CheckPasswordInput, + ConfirmDeleteAccountInput, + CreateApiKeyInput, + CreateOrgApiKeyInput, + CreateOrgPrincipalInput, + DeleteOrgPrincipalInput, + DeletePrincipalInput, + DisconnectAccountInput, + ExtendTokenExpiresInput, + ForgotPasswordInput, + LinkIdentityInput, + ProvisionBucketInput, + ProvisionNewUserInput, + RequestCrossOriginTokenInput, + ResetPasswordInput, + RevokeApiKeyInput, + RevokeOrgApiKeyInput, + RevokeSessionInput, + SendAccountDeletionEmailInput, + SendVerificationEmailInput, + SetPasswordInput, + SignInInput, + SignInCrossOriginInput, + SignInSmsOtpInput, + SignOutInput, + SignUpInput, + SignUpSmsInput, + VerifyEmailInput, + VerifyPasswordInput, + VerifyTotpInput, + CheckPasswordPayload, + ConfirmDeleteAccountPayload, + CreateApiKeyPayload, + CreateOrgApiKeyPayload, + CreateOrgPrincipalPayload, + DeleteOrgPrincipalPayload, + DeletePrincipalPayload, + DisconnectAccountPayload, + ExtendTokenExpiresPayload, + ForgotPasswordPayload, + LinkIdentityPayload, + ProvisionBucketPayload, + ProvisionNewUserPayload, + RequestCrossOriginTokenPayload, + ResetPasswordPayload, + RevokeApiKeyPayload, + RevokeOrgApiKeyPayload, + RevokeSessionPayload, + SendAccountDeletionEmailPayload, + SendVerificationEmailPayload, + SetPasswordPayload, + SignInPayload, + SignInCrossOriginPayload, + SignInSmsOtpPayload, + SignOutPayload, + SignUpPayload, + SignUpSmsPayload, + VerifyEmailPayload, + VerifyPasswordPayload, + VerifyTotpPayload, + CheckPasswordPayloadSelect, + ConfirmDeleteAccountPayloadSelect, + CreateApiKeyPayloadSelect, + CreateOrgApiKeyPayloadSelect, + CreateOrgPrincipalPayloadSelect, + DeleteOrgPrincipalPayloadSelect, + DeletePrincipalPayloadSelect, + DisconnectAccountPayloadSelect, + ExtendTokenExpiresPayloadSelect, + ForgotPasswordPayloadSelect, + LinkIdentityPayloadSelect, + ProvisionBucketPayloadSelect, + ProvisionNewUserPayloadSelect, + RequestCrossOriginTokenPayloadSelect, + ResetPasswordPayloadSelect, + RevokeApiKeyPayloadSelect, + RevokeOrgApiKeyPayloadSelect, + RevokeSessionPayloadSelect, + SendAccountDeletionEmailPayloadSelect, + SendVerificationEmailPayloadSelect, + SetPasswordPayloadSelect, + SignInPayloadSelect, + SignInCrossOriginPayloadSelect, + SignInSmsOtpPayloadSelect, + SignOutPayloadSelect, + SignUpPayloadSelect, + SignUpSmsPayloadSelect, + VerifyEmailPayloadSelect, + VerifyPasswordPayloadSelect, + VerifyTotpPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface CheckPasswordVariables { input: CheckPasswordInput; } @@ -107,425 +198,875 @@ export interface VerifyTotpVariables { } export function createMutationOperations(client: OrmClient) { return { - checkPassword: (args: CheckPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - checkPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CheckPassword", - fieldName: "checkPassword", - ...buildCustomDocument("mutation", "CheckPassword", "checkPassword", options.select, args, [{ - name: "input", - type: "CheckPasswordInput!" - }], connectionFieldsMap, "CheckPasswordPayload") - }), - confirmDeleteAccount: (args: ConfirmDeleteAccountVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - confirmDeleteAccount: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ConfirmDeleteAccount", - fieldName: "confirmDeleteAccount", - ...buildCustomDocument("mutation", "ConfirmDeleteAccount", "confirmDeleteAccount", options.select, args, [{ - name: "input", - type: "ConfirmDeleteAccountInput!" - }], connectionFieldsMap, "ConfirmDeleteAccountPayload") - }), - createApiKey: (args: CreateApiKeyVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - createApiKey: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CreateApiKey", - fieldName: "createApiKey", - ...buildCustomDocument("mutation", "CreateApiKey", "createApiKey", options.select, args, [{ - name: "input", - type: "CreateApiKeyInput!" - }], connectionFieldsMap, "CreateApiKeyPayload") - }), - 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") - }), - 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") - }), - 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") - }), - deletePrincipal: (args: DeletePrincipalVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - deletePrincipal: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "DeletePrincipal", - fieldName: "deletePrincipal", - ...buildCustomDocument("mutation", "DeletePrincipal", "deletePrincipal", options.select, args, [{ - name: "input", - type: "DeletePrincipalInput!" - }], connectionFieldsMap, "DeletePrincipalPayload") - }), - disconnectAccount: (args: DisconnectAccountVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - disconnectAccount: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "DisconnectAccount", - fieldName: "disconnectAccount", - ...buildCustomDocument("mutation", "DisconnectAccount", "disconnectAccount", options.select, args, [{ - name: "input", - type: "DisconnectAccountInput!" - }], connectionFieldsMap, "DisconnectAccountPayload") - }), - extendTokenExpires: (args: ExtendTokenExpiresVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - extendTokenExpires: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ExtendTokenExpires", - fieldName: "extendTokenExpires", - ...buildCustomDocument("mutation", "ExtendTokenExpires", "extendTokenExpires", options.select, args, [{ - name: "input", - type: "ExtendTokenExpiresInput!" - }], connectionFieldsMap, "ExtendTokenExpiresPayload") - }), - forgotPassword: (args: ForgotPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - forgotPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ForgotPassword", - fieldName: "forgotPassword", - ...buildCustomDocument("mutation", "ForgotPassword", "forgotPassword", options.select, args, [{ - name: "input", - type: "ForgotPasswordInput!" - }], connectionFieldsMap, "ForgotPasswordPayload") - }), - linkIdentity: (args: LinkIdentityVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - linkIdentity: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "LinkIdentity", - fieldName: "linkIdentity", - ...buildCustomDocument("mutation", "LinkIdentity", "linkIdentity", options.select, args, [{ - name: "input", - type: "LinkIdentityInput!" - }], connectionFieldsMap, "LinkIdentityPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - provisionNewUser: (args: ProvisionNewUserVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionNewUser: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionNewUser", - fieldName: "provisionNewUser", - ...buildCustomDocument("mutation", "ProvisionNewUser", "provisionNewUser", options.select, args, [{ - name: "input", - type: "ProvisionNewUserInput!" - }], connectionFieldsMap, "ProvisionNewUserPayload") - }), - requestCrossOriginToken: (args: RequestCrossOriginTokenVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - requestCrossOriginToken: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RequestCrossOriginToken", - fieldName: "requestCrossOriginToken", - ...buildCustomDocument("mutation", "RequestCrossOriginToken", "requestCrossOriginToken", options.select, args, [{ - name: "input", - type: "RequestCrossOriginTokenInput!" - }], connectionFieldsMap, "RequestCrossOriginTokenPayload") - }), - resetPassword: (args: ResetPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resetPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResetPassword", - fieldName: "resetPassword", - ...buildCustomDocument("mutation", "ResetPassword", "resetPassword", options.select, args, [{ - name: "input", - type: "ResetPasswordInput!" - }], connectionFieldsMap, "ResetPasswordPayload") - }), - revokeApiKey: (args: RevokeApiKeyVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - revokeApiKey: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RevokeApiKey", - fieldName: "revokeApiKey", - ...buildCustomDocument("mutation", "RevokeApiKey", "revokeApiKey", options.select, args, [{ - name: "input", - type: "RevokeApiKeyInput!" - }], connectionFieldsMap, "RevokeApiKeyPayload") - }), - 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") - }), - revokeSession: (args: RevokeSessionVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - revokeSession: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "RevokeSession", - fieldName: "revokeSession", - ...buildCustomDocument("mutation", "RevokeSession", "revokeSession", options.select, args, [{ - name: "input", - type: "RevokeSessionInput!" - }], connectionFieldsMap, "RevokeSessionPayload") - }), - sendAccountDeletionEmail: (args: SendAccountDeletionEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - sendAccountDeletionEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SendAccountDeletionEmail", - fieldName: "sendAccountDeletionEmail", - ...buildCustomDocument("mutation", "SendAccountDeletionEmail", "sendAccountDeletionEmail", options.select, args, [{ - name: "input", - type: "SendAccountDeletionEmailInput!" - }], connectionFieldsMap, "SendAccountDeletionEmailPayload") - }), - sendVerificationEmail: (args: SendVerificationEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - sendVerificationEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SendVerificationEmail", - fieldName: "sendVerificationEmail", - ...buildCustomDocument("mutation", "SendVerificationEmail", "sendVerificationEmail", options.select, args, [{ - name: "input", - type: "SendVerificationEmailInput!" - }], connectionFieldsMap, "SendVerificationEmailPayload") - }), - setPassword: (args: SetPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetPassword", - fieldName: "setPassword", - ...buildCustomDocument("mutation", "SetPassword", "setPassword", options.select, args, [{ - name: "input", - type: "SetPasswordInput!" - }], connectionFieldsMap, "SetPasswordPayload") - }), - signIn: (args: SignInVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signIn: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignIn", - fieldName: "signIn", - ...buildCustomDocument("mutation", "SignIn", "signIn", options.select, args, [{ - name: "input", - type: "SignInInput!" - }], connectionFieldsMap, "SignInPayload") - }), - signInCrossOrigin: (args: SignInCrossOriginVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signInCrossOrigin: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignInCrossOrigin", - fieldName: "signInCrossOrigin", - ...buildCustomDocument("mutation", "SignInCrossOrigin", "signInCrossOrigin", options.select, args, [{ - name: "input", - type: "SignInCrossOriginInput!" - }], connectionFieldsMap, "SignInCrossOriginPayload") - }), - signInSmsOtp: (args: SignInSmsOtpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signInSmsOtp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignInSmsOtp", - fieldName: "signInSmsOtp", - ...buildCustomDocument("mutation", "SignInSmsOtp", "signInSmsOtp", options.select, args, [{ - name: "input", - type: "SignInSmsOtpInput!" - }], connectionFieldsMap, "SignInSmsOtpPayload") - }), - signOut: (args: SignOutVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signOut: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignOut", - fieldName: "signOut", - ...buildCustomDocument("mutation", "SignOut", "signOut", options.select, args, [{ - name: "input", - type: "SignOutInput!" - }], connectionFieldsMap, "SignOutPayload") - }), - signUp: (args: SignUpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signUp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignUp", - fieldName: "signUp", - ...buildCustomDocument("mutation", "SignUp", "signUp", options.select, args, [{ - name: "input", - type: "SignUpInput!" - }], connectionFieldsMap, "SignUpPayload") - }), - signUpSms: (args: SignUpSmsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - signUpSms: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SignUpSms", - fieldName: "signUpSms", - ...buildCustomDocument("mutation", "SignUpSms", "signUpSms", options.select, args, [{ - name: "input", - type: "SignUpSmsInput!" - }], connectionFieldsMap, "SignUpSmsPayload") - }), - verifyEmail: (args: VerifyEmailVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyEmail: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyEmail", - fieldName: "verifyEmail", - ...buildCustomDocument("mutation", "VerifyEmail", "verifyEmail", options.select, args, [{ - name: "input", - type: "VerifyEmailInput!" - }], connectionFieldsMap, "VerifyEmailPayload") - }), - verifyPassword: (args: VerifyPasswordVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyPassword: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyPassword", - fieldName: "verifyPassword", - ...buildCustomDocument("mutation", "VerifyPassword", "verifyPassword", options.select, args, [{ - name: "input", - type: "VerifyPasswordInput!" - }], connectionFieldsMap, "VerifyPasswordPayload") - }), - verifyTotp: (args: VerifyTotpVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - verifyTotp: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "VerifyTotp", - fieldName: "verifyTotp", - ...buildCustomDocument("mutation", "VerifyTotp", "verifyTotp", options.select, args, [{ - name: "input", - type: "VerifyTotpInput!" - }], connectionFieldsMap, "VerifyTotpPayload") - }) + checkPassword: ( + args: CheckPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + checkPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CheckPassword', + fieldName: 'checkPassword', + ...buildCustomDocument( + 'mutation', + 'CheckPassword', + 'checkPassword', + options.select, + args, + [ + { + name: 'input', + type: 'CheckPasswordInput!', + }, + ], + connectionFieldsMap, + 'CheckPasswordPayload' + ), + }), + confirmDeleteAccount: ( + args: ConfirmDeleteAccountVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + confirmDeleteAccount: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ConfirmDeleteAccount', + fieldName: 'confirmDeleteAccount', + ...buildCustomDocument( + 'mutation', + 'ConfirmDeleteAccount', + 'confirmDeleteAccount', + options.select, + args, + [ + { + name: 'input', + type: 'ConfirmDeleteAccountInput!', + }, + ], + connectionFieldsMap, + 'ConfirmDeleteAccountPayload' + ), + }), + createApiKey: ( + args: CreateApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateApiKey', + fieldName: 'createApiKey', + ...buildCustomDocument( + 'mutation', + 'CreateApiKey', + 'createApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'CreateApiKeyInput!', + }, + ], + connectionFieldsMap, + 'CreateApiKeyPayload' + ), + }), + 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' + ), + }), + 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' + ), + }), + 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' + ), + }), + deletePrincipal: ( + args: DeletePrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + deletePrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DeletePrincipal', + fieldName: 'deletePrincipal', + ...buildCustomDocument( + 'mutation', + 'DeletePrincipal', + 'deletePrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'DeletePrincipalInput!', + }, + ], + connectionFieldsMap, + 'DeletePrincipalPayload' + ), + }), + disconnectAccount: ( + args: DisconnectAccountVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + disconnectAccount: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DisconnectAccount', + fieldName: 'disconnectAccount', + ...buildCustomDocument( + 'mutation', + 'DisconnectAccount', + 'disconnectAccount', + options.select, + args, + [ + { + name: 'input', + type: 'DisconnectAccountInput!', + }, + ], + connectionFieldsMap, + 'DisconnectAccountPayload' + ), + }), + extendTokenExpires: ( + args: ExtendTokenExpiresVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + extendTokenExpires: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ExtendTokenExpires', + fieldName: 'extendTokenExpires', + ...buildCustomDocument( + 'mutation', + 'ExtendTokenExpires', + 'extendTokenExpires', + options.select, + args, + [ + { + name: 'input', + type: 'ExtendTokenExpiresInput!', + }, + ], + connectionFieldsMap, + 'ExtendTokenExpiresPayload' + ), + }), + forgotPassword: ( + args: ForgotPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + forgotPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ForgotPassword', + fieldName: 'forgotPassword', + ...buildCustomDocument( + 'mutation', + 'ForgotPassword', + 'forgotPassword', + options.select, + args, + [ + { + name: 'input', + type: 'ForgotPasswordInput!', + }, + ], + connectionFieldsMap, + 'ForgotPasswordPayload' + ), + }), + linkIdentity: ( + args: LinkIdentityVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + linkIdentity: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'LinkIdentity', + fieldName: 'linkIdentity', + ...buildCustomDocument( + 'mutation', + 'LinkIdentity', + 'linkIdentity', + options.select, + args, + [ + { + name: 'input', + type: 'LinkIdentityInput!', + }, + ], + connectionFieldsMap, + 'LinkIdentityPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + provisionNewUser: ( + args: ProvisionNewUserVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionNewUser: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionNewUser', + fieldName: 'provisionNewUser', + ...buildCustomDocument( + 'mutation', + 'ProvisionNewUser', + 'provisionNewUser', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionNewUserInput!', + }, + ], + connectionFieldsMap, + 'ProvisionNewUserPayload' + ), + }), + requestCrossOriginToken: ( + args: RequestCrossOriginTokenVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + requestCrossOriginToken: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RequestCrossOriginToken', + fieldName: 'requestCrossOriginToken', + ...buildCustomDocument( + 'mutation', + 'RequestCrossOriginToken', + 'requestCrossOriginToken', + options.select, + args, + [ + { + name: 'input', + type: 'RequestCrossOriginTokenInput!', + }, + ], + connectionFieldsMap, + 'RequestCrossOriginTokenPayload' + ), + }), + resetPassword: ( + args: ResetPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resetPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResetPassword', + fieldName: 'resetPassword', + ...buildCustomDocument( + 'mutation', + 'ResetPassword', + 'resetPassword', + options.select, + args, + [ + { + name: 'input', + type: 'ResetPasswordInput!', + }, + ], + connectionFieldsMap, + 'ResetPasswordPayload' + ), + }), + revokeApiKey: ( + args: RevokeApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeApiKey', + fieldName: 'revokeApiKey', + ...buildCustomDocument( + 'mutation', + 'RevokeApiKey', + 'revokeApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeApiKeyInput!', + }, + ], + connectionFieldsMap, + 'RevokeApiKeyPayload' + ), + }), + 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' + ), + }), + revokeSession: ( + args: RevokeSessionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeSession: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeSession', + fieldName: 'revokeSession', + ...buildCustomDocument( + 'mutation', + 'RevokeSession', + 'revokeSession', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeSessionInput!', + }, + ], + connectionFieldsMap, + 'RevokeSessionPayload' + ), + }), + sendAccountDeletionEmail: ( + args: SendAccountDeletionEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + sendAccountDeletionEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SendAccountDeletionEmail', + fieldName: 'sendAccountDeletionEmail', + ...buildCustomDocument( + 'mutation', + 'SendAccountDeletionEmail', + 'sendAccountDeletionEmail', + options.select, + args, + [ + { + name: 'input', + type: 'SendAccountDeletionEmailInput!', + }, + ], + connectionFieldsMap, + 'SendAccountDeletionEmailPayload' + ), + }), + sendVerificationEmail: ( + args: SendVerificationEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + sendVerificationEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SendVerificationEmail', + fieldName: 'sendVerificationEmail', + ...buildCustomDocument( + 'mutation', + 'SendVerificationEmail', + 'sendVerificationEmail', + options.select, + args, + [ + { + name: 'input', + type: 'SendVerificationEmailInput!', + }, + ], + connectionFieldsMap, + 'SendVerificationEmailPayload' + ), + }), + setPassword: ( + args: SetPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetPassword', + fieldName: 'setPassword', + ...buildCustomDocument( + 'mutation', + 'SetPassword', + 'setPassword', + options.select, + args, + [ + { + name: 'input', + type: 'SetPasswordInput!', + }, + ], + connectionFieldsMap, + 'SetPasswordPayload' + ), + }), + signIn: ( + args: SignInVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signIn: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignIn', + fieldName: 'signIn', + ...buildCustomDocument( + 'mutation', + 'SignIn', + 'signIn', + options.select, + args, + [ + { + name: 'input', + type: 'SignInInput!', + }, + ], + connectionFieldsMap, + 'SignInPayload' + ), + }), + signInCrossOrigin: ( + args: SignInCrossOriginVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signInCrossOrigin: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignInCrossOrigin', + fieldName: 'signInCrossOrigin', + ...buildCustomDocument( + 'mutation', + 'SignInCrossOrigin', + 'signInCrossOrigin', + options.select, + args, + [ + { + name: 'input', + type: 'SignInCrossOriginInput!', + }, + ], + connectionFieldsMap, + 'SignInCrossOriginPayload' + ), + }), + signInSmsOtp: ( + args: SignInSmsOtpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signInSmsOtp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignInSmsOtp', + fieldName: 'signInSmsOtp', + ...buildCustomDocument( + 'mutation', + 'SignInSmsOtp', + 'signInSmsOtp', + options.select, + args, + [ + { + name: 'input', + type: 'SignInSmsOtpInput!', + }, + ], + connectionFieldsMap, + 'SignInSmsOtpPayload' + ), + }), + signOut: ( + args: SignOutVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signOut: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignOut', + fieldName: 'signOut', + ...buildCustomDocument( + 'mutation', + 'SignOut', + 'signOut', + options.select, + args, + [ + { + name: 'input', + type: 'SignOutInput!', + }, + ], + connectionFieldsMap, + 'SignOutPayload' + ), + }), + signUp: ( + args: SignUpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signUp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignUp', + fieldName: 'signUp', + ...buildCustomDocument( + 'mutation', + 'SignUp', + 'signUp', + options.select, + args, + [ + { + name: 'input', + type: 'SignUpInput!', + }, + ], + connectionFieldsMap, + 'SignUpPayload' + ), + }), + signUpSms: ( + args: SignUpSmsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + signUpSms: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SignUpSms', + fieldName: 'signUpSms', + ...buildCustomDocument( + 'mutation', + 'SignUpSms', + 'signUpSms', + options.select, + args, + [ + { + name: 'input', + type: 'SignUpSmsInput!', + }, + ], + connectionFieldsMap, + 'SignUpSmsPayload' + ), + }), + verifyEmail: ( + args: VerifyEmailVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyEmail: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyEmail', + fieldName: 'verifyEmail', + ...buildCustomDocument( + 'mutation', + 'VerifyEmail', + 'verifyEmail', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyEmailInput!', + }, + ], + connectionFieldsMap, + 'VerifyEmailPayload' + ), + }), + verifyPassword: ( + args: VerifyPasswordVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyPassword: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyPassword', + fieldName: 'verifyPassword', + ...buildCustomDocument( + 'mutation', + 'VerifyPassword', + 'verifyPassword', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyPasswordInput!', + }, + ], + connectionFieldsMap, + 'VerifyPasswordPayload' + ), + }), + verifyTotp: ( + args: VerifyTotpVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + verifyTotp: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'VerifyTotp', + fieldName: 'verifyTotp', + ...buildCustomDocument( + 'mutation', + 'VerifyTotp', + 'verifyTotp', + options.select, + args, + [ + { + name: 'input', + type: 'VerifyTotpInput!', + }, + ], + connectionFieldsMap, + 'VerifyTotpPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/query-builder.ts b/sdk/constructive-sdk/src/auth/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/auth/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/auth/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/auth/orm/query/index.ts b/sdk/constructive-sdk/src/auth/orm/query/index.ts index 5a555d9687..d13999f7b4 100644 --- a/sdk/constructive-sdk/src/auth/orm/query/index.ts +++ b/sdk/constructive-sdk/src/auth/orm/query/index.ts @@ -3,73 +3,124 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { User, UserSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { User, UserSelect } from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface RequireStepUpVariables { stepUpType?: string; } export function createQueryOperations(client: OrmClient) { return { - currentIpAddress: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentIpAddress: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentIpAddress", - fieldName: "currentIpAddress", - ...buildCustomDocument("query", "CurrentIpAddress", "currentIpAddress", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - currentUser: (options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - currentUser: InferSelectResult | null; - }>({ - client, - operation: "query", - operationName: "CurrentUser", - fieldName: "currentUser", - ...buildCustomDocument("query", "CurrentUser", "currentUser", options.select, undefined, [], connectionFieldsMap, "User") - }), - currentUserAgent: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentUserAgent: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentUserAgent", - fieldName: "currentUserAgent", - ...buildCustomDocument("query", "CurrentUserAgent", "currentUserAgent", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - currentUserId: (options?: { - select?: Record; - }) => new QueryBuilder<{ - currentUserId: string | null; - }>({ - client, - operation: "query", - operationName: "CurrentUserId", - fieldName: "currentUserId", - ...buildCustomDocument("query", "CurrentUserId", "currentUserId", options?.select, undefined, [], connectionFieldsMap, undefined) - }), - requireStepUp: (args: RequireStepUpVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - requireStepUp: boolean | null; - }>({ - client, - operation: "query", - operationName: "RequireStepUp", - fieldName: "requireStepUp", - ...buildCustomDocument("query", "RequireStepUp", "requireStepUp", options?.select, args, [{ - name: "stepUpType", - type: "String" - }], connectionFieldsMap, undefined) - }) + currentIpAddress: (options?: { select?: Record }) => + new QueryBuilder<{ + currentIpAddress: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentIpAddress', + fieldName: 'currentIpAddress', + ...buildCustomDocument( + 'query', + 'CurrentIpAddress', + 'currentIpAddress', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + currentUser: ( + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + currentUser: InferSelectResult | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUser', + fieldName: 'currentUser', + ...buildCustomDocument( + 'query', + 'CurrentUser', + 'currentUser', + options.select, + undefined, + [], + connectionFieldsMap, + 'User' + ), + }), + currentUserAgent: (options?: { select?: Record }) => + new QueryBuilder<{ + currentUserAgent: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUserAgent', + fieldName: 'currentUserAgent', + ...buildCustomDocument( + 'query', + 'CurrentUserAgent', + 'currentUserAgent', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + currentUserId: (options?: { select?: Record }) => + new QueryBuilder<{ + currentUserId: string | null; + }>({ + client, + operation: 'query', + operationName: 'CurrentUserId', + fieldName: 'currentUserId', + ...buildCustomDocument( + 'query', + 'CurrentUserId', + 'currentUserId', + options?.select, + undefined, + [], + connectionFieldsMap, + undefined + ), + }), + requireStepUp: ( + args: RequireStepUpVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + requireStepUp: boolean | null; + }>({ + client, + operation: 'query', + operationName: 'RequireStepUp', + fieldName: 'requireStepUp', + ...buildCustomDocument( + 'query', + 'RequireStepUp', + 'requireStepUp', + options?.select, + args, + [ + { + name: 'stepUpType', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/auth/orm/realtime.ts b/sdk/constructive-sdk/src/auth/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/auth/orm/realtime.ts +++ b/sdk/constructive-sdk/src/auth/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/auth/orm/select-types.ts b/sdk/constructive-sdk/src/auth/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/auth/orm/select-types.ts +++ b/sdk/constructive-sdk/src/auth/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/compute/index.ts b/sdk/constructive-sdk/src/compute/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/compute/index.ts +++ b/sdk/constructive-sdk/src/compute/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/compute/orm/client.ts b/sdk/constructive-sdk/src/compute/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/compute/orm/client.ts +++ b/sdk/constructive-sdk/src/compute/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/compute/orm/index.ts b/sdk/constructive-sdk/src/compute/orm/index.ts index 097bc38eea..933b08ed35 100644 --- a/sdk/constructive-sdk/src/compute/orm/index.ts +++ b/sdk/constructive-sdk/src/compute/orm/index.ts @@ -3,84 +3,84 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { DbPresetModel } from "./models/dbPreset"; -import { FunctionApiBindingModel } from "./models/functionApiBinding"; -import { FunctionDefinitionModel } from "./models/functionDefinition"; -import { FunctionDeploymentModel } from "./models/functionDeployment"; -import { FunctionDeploymentEventModel } from "./models/functionDeploymentEvent"; -import { FunctionExecutionLogModel } from "./models/functionExecutionLog"; -import { FunctionGraphCommitModel } from "./models/functionGraphCommit"; -import { FunctionGraphModel } from "./models/functionGraph"; -import { FunctionGraphExecutionModel } from "./models/functionGraphExecution"; -import { FunctionGraphExecutionNodeStateModel } from "./models/functionGraphExecutionNodeState"; -import { FunctionGraphExecutionOutputModel } from "./models/functionGraphExecutionOutput"; -import { FunctionGraphObjectModel } from "./models/functionGraphObject"; -import { FunctionGraphRefModel } from "./models/functionGraphRef"; -import { FunctionGraphStoreModel } from "./models/functionGraphStore"; -import { FunctionInvocationAttemptModel } from "./models/functionInvocationAttempt"; -import { FunctionInvocationModel } from "./models/functionInvocation"; -import { GetAllTreeNodesRecordModel } from "./models/getAllTreeNodesRecord"; -import { InfraCommitModel } from "./models/infraCommit"; -import { InfraGetAllTreeNodesRecordModel } from "./models/infraGetAllTreeNodesRecord"; -import { InfraObjectModel } from "./models/infraObject"; -import { InfraRefModel } from "./models/infraRef"; -import { InfraStoreModel } from "./models/infraStore"; -import { IntegrationProviderModel } from "./models/integrationProvider"; -import { NamespaceModel } from "./models/namespace"; -import { NamespaceEventModel } from "./models/namespaceEvent"; -import { PlatformFunctionApiBindingModel } from "./models/platformFunctionApiBinding"; -import { PlatformFunctionDefinitionModel } from "./models/platformFunctionDefinition"; -import { PlatformFunctionDeploymentModel } from "./models/platformFunctionDeployment"; -import { PlatformFunctionDeploymentEventModel } from "./models/platformFunctionDeploymentEvent"; -import { PlatformFunctionExecutionLogModel } from "./models/platformFunctionExecutionLog"; -import { PlatformFunctionInvocationAttemptModel } from "./models/platformFunctionInvocationAttempt"; -import { PlatformFunctionInvocationModel } from "./models/platformFunctionInvocation"; -import { PlatformInfraCommitModel } from "./models/platformInfraCommit"; -import { PlatformInfraGetAllTreeNodesRecordModel } from "./models/platformInfraGetAllTreeNodesRecord"; -import { PlatformInfraObjectModel } from "./models/platformInfraObject"; -import { PlatformInfraRefModel } from "./models/platformInfraRef"; -import { PlatformInfraStoreModel } from "./models/platformInfraStore"; -import { PlatformNamespaceModel } from "./models/platformNamespace"; -import { PlatformNamespaceEventModel } from "./models/platformNamespaceEvent"; -import { PlatformResourceModel } from "./models/platformResource"; -import { PlatformResourceDeclaredCapacityModel } from "./models/platformResourceDeclaredCapacity"; -import { PlatformResourceDefinitionModel } from "./models/platformResourceDefinition"; -import { PlatformResourceEventModel } from "./models/platformResourceEvent"; -import { PlatformResourceInstallationModel } from "./models/platformResourceInstallation"; -import { PlatformResourceStatusCheckModel } from "./models/platformResourceStatusCheck"; -import { PlatformResourceUsageLogModel } from "./models/platformResourceUsageLog"; -import { PlatformResourceUsageSummaryModel } from "./models/platformResourceUsageSummary"; -import { PlatformResourceUtilizationModel } from "./models/platformResourceUtilization"; -import { PlatformResourcesHealthModel } from "./models/platformResourcesHealth"; -import { PlatformResourcesRequirementsStateModel } from "./models/platformResourcesRequirementsState"; -import { PlatformResourcesResolvedRequirementModel } from "./models/platformResourcesResolvedRequirement"; -import { PlatformWebhookEndpointModel } from "./models/platformWebhookEndpoint"; -import { PlatformWebhookEventModel } from "./models/platformWebhookEvent"; -import { ResourceModel } from "./models/resource"; -import { ResourceDeclaredCapacityModel } from "./models/resourceDeclaredCapacity"; -import { ResourceDefinitionModel } from "./models/resourceDefinition"; -import { ResourceEventModel } from "./models/resourceEvent"; -import { ResourceInstallationModel } from "./models/resourceInstallation"; -import { ResourceStatusCheckModel } from "./models/resourceStatusCheck"; -import { ResourceUsageLogModel } from "./models/resourceUsageLog"; -import { ResourceUsageSummaryModel } from "./models/resourceUsageSummary"; -import { ResourceUtilizationModel } from "./models/resourceUtilization"; -import { ResourcesHealthModel } from "./models/resourcesHealth"; -import { ResourcesRequirementsStateModel } from "./models/resourcesRequirementsState"; -import { ResourcesResolvedRequirementModel } from "./models/resourcesResolvedRequirement"; -import { WebhookEndpointModel } from "./models/webhookEndpoint"; -import { WebhookEventModel } from "./models/webhookEvent"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { DbPresetModel } from './models/dbPreset'; +import { FunctionApiBindingModel } from './models/functionApiBinding'; +import { FunctionDefinitionModel } from './models/functionDefinition'; +import { FunctionDeploymentModel } from './models/functionDeployment'; +import { FunctionDeploymentEventModel } from './models/functionDeploymentEvent'; +import { FunctionExecutionLogModel } from './models/functionExecutionLog'; +import { FunctionGraphCommitModel } from './models/functionGraphCommit'; +import { FunctionGraphModel } from './models/functionGraph'; +import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; +import { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; +import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecutionOutput'; +import { FunctionGraphObjectModel } from './models/functionGraphObject'; +import { FunctionGraphRefModel } from './models/functionGraphRef'; +import { FunctionGraphStoreModel } from './models/functionGraphStore'; +import { FunctionInvocationAttemptModel } from './models/functionInvocationAttempt'; +import { FunctionInvocationModel } from './models/functionInvocation'; +import { GetAllTreeNodesRecordModel } from './models/getAllTreeNodesRecord'; +import { InfraCommitModel } from './models/infraCommit'; +import { InfraGetAllTreeNodesRecordModel } from './models/infraGetAllTreeNodesRecord'; +import { InfraObjectModel } from './models/infraObject'; +import { InfraRefModel } from './models/infraRef'; +import { InfraStoreModel } from './models/infraStore'; +import { IntegrationProviderModel } from './models/integrationProvider'; +import { NamespaceModel } from './models/namespace'; +import { NamespaceEventModel } from './models/namespaceEvent'; +import { PlatformFunctionApiBindingModel } from './models/platformFunctionApiBinding'; +import { PlatformFunctionDefinitionModel } from './models/platformFunctionDefinition'; +import { PlatformFunctionDeploymentModel } from './models/platformFunctionDeployment'; +import { PlatformFunctionDeploymentEventModel } from './models/platformFunctionDeploymentEvent'; +import { PlatformFunctionExecutionLogModel } from './models/platformFunctionExecutionLog'; +import { PlatformFunctionInvocationAttemptModel } from './models/platformFunctionInvocationAttempt'; +import { PlatformFunctionInvocationModel } from './models/platformFunctionInvocation'; +import { PlatformInfraCommitModel } from './models/platformInfraCommit'; +import { PlatformInfraGetAllTreeNodesRecordModel } from './models/platformInfraGetAllTreeNodesRecord'; +import { PlatformInfraObjectModel } from './models/platformInfraObject'; +import { PlatformInfraRefModel } from './models/platformInfraRef'; +import { PlatformInfraStoreModel } from './models/platformInfraStore'; +import { PlatformNamespaceModel } from './models/platformNamespace'; +import { PlatformNamespaceEventModel } from './models/platformNamespaceEvent'; +import { PlatformResourceModel } from './models/platformResource'; +import { PlatformResourceDeclaredCapacityModel } from './models/platformResourceDeclaredCapacity'; +import { PlatformResourceDefinitionModel } from './models/platformResourceDefinition'; +import { PlatformResourceEventModel } from './models/platformResourceEvent'; +import { PlatformResourceInstallationModel } from './models/platformResourceInstallation'; +import { PlatformResourceStatusCheckModel } from './models/platformResourceStatusCheck'; +import { PlatformResourceUsageLogModel } from './models/platformResourceUsageLog'; +import { PlatformResourceUsageSummaryModel } from './models/platformResourceUsageSummary'; +import { PlatformResourceUtilizationModel } from './models/platformResourceUtilization'; +import { PlatformResourcesHealthModel } from './models/platformResourcesHealth'; +import { PlatformResourcesRequirementsStateModel } from './models/platformResourcesRequirementsState'; +import { PlatformResourcesResolvedRequirementModel } from './models/platformResourcesResolvedRequirement'; +import { PlatformWebhookEndpointModel } from './models/platformWebhookEndpoint'; +import { PlatformWebhookEventModel } from './models/platformWebhookEvent'; +import { ResourceModel } from './models/resource'; +import { ResourceDeclaredCapacityModel } from './models/resourceDeclaredCapacity'; +import { ResourceDefinitionModel } from './models/resourceDefinition'; +import { ResourceEventModel } from './models/resourceEvent'; +import { ResourceInstallationModel } from './models/resourceInstallation'; +import { ResourceStatusCheckModel } from './models/resourceStatusCheck'; +import { ResourceUsageLogModel } from './models/resourceUsageLog'; +import { ResourceUsageSummaryModel } from './models/resourceUsageSummary'; +import { ResourceUtilizationModel } from './models/resourceUtilization'; +import { ResourcesHealthModel } from './models/resourcesHealth'; +import { ResourcesRequirementsStateModel } from './models/resourcesRequirementsState'; +import { ResourcesResolvedRequirementModel } from './models/resourcesResolvedRequirement'; +import { WebhookEndpointModel } from './models/webhookEndpoint'; +import { WebhookEventModel } from './models/webhookEvent'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -175,6 +175,6 @@ export function createClient(config: OrmClientConfig) { webhookEndpoint: new WebhookEndpointModel(client), webhookEvent: new WebhookEventModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/input-types.ts b/sdk/constructive-sdk/src/compute/orm/input-types.ts index 24e4a3d10c..6ff0184126 100644 --- a/sdk/constructive-sdk/src/compute/orm/input-types.ts +++ b/sdk/constructive-sdk/src/compute/orm/input-types.ts @@ -2038,67 +2038,102 @@ export type DbPresetWithRelations = DbPreset & DbPresetRelations; export type FunctionApiBindingWithRelations = FunctionApiBinding & FunctionApiBindingRelations; export type FunctionDefinitionWithRelations = FunctionDefinition & FunctionDefinitionRelations; export type FunctionDeploymentWithRelations = FunctionDeployment & FunctionDeploymentRelations; -export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & FunctionDeploymentEventRelations; -export type FunctionExecutionLogWithRelations = FunctionExecutionLog & FunctionExecutionLogRelations; +export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & + FunctionDeploymentEventRelations; +export type FunctionExecutionLogWithRelations = FunctionExecutionLog & + FunctionExecutionLogRelations; export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGraphCommitRelations; export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; -export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & FunctionGraphExecutionRelations; -export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & FunctionGraphExecutionNodeStateRelations; -export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & FunctionGraphExecutionOutputRelations; +export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & + FunctionGraphExecutionRelations; +export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & + FunctionGraphExecutionNodeStateRelations; +export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & + FunctionGraphExecutionOutputRelations; export type FunctionGraphObjectWithRelations = FunctionGraphObject & FunctionGraphObjectRelations; export type FunctionGraphRefWithRelations = FunctionGraphRef & FunctionGraphRefRelations; export type FunctionGraphStoreWithRelations = FunctionGraphStore & FunctionGraphStoreRelations; -export type FunctionInvocationAttemptWithRelations = FunctionInvocationAttempt & FunctionInvocationAttemptRelations; +export type FunctionInvocationAttemptWithRelations = FunctionInvocationAttempt & + FunctionInvocationAttemptRelations; export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; -export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & GetAllTreeNodesRecordRelations; +export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & + GetAllTreeNodesRecordRelations; export type InfraCommitWithRelations = InfraCommit & InfraCommitRelations; -export type InfraGetAllTreeNodesRecordWithRelations = InfraGetAllTreeNodesRecord & InfraGetAllTreeNodesRecordRelations; +export type InfraGetAllTreeNodesRecordWithRelations = InfraGetAllTreeNodesRecord & + InfraGetAllTreeNodesRecordRelations; export type InfraObjectWithRelations = InfraObject & InfraObjectRelations; export type InfraRefWithRelations = InfraRef & InfraRefRelations; export type InfraStoreWithRelations = InfraStore & InfraStoreRelations; export type IntegrationProviderWithRelations = IntegrationProvider & IntegrationProviderRelations; export type NamespaceWithRelations = Namespace & NamespaceRelations; export type NamespaceEventWithRelations = NamespaceEvent & NamespaceEventRelations; -export type PlatformFunctionApiBindingWithRelations = PlatformFunctionApiBinding & PlatformFunctionApiBindingRelations; -export type PlatformFunctionDefinitionWithRelations = PlatformFunctionDefinition & PlatformFunctionDefinitionRelations; -export type PlatformFunctionDeploymentWithRelations = PlatformFunctionDeployment & PlatformFunctionDeploymentRelations; -export type PlatformFunctionDeploymentEventWithRelations = PlatformFunctionDeploymentEvent & PlatformFunctionDeploymentEventRelations; -export type PlatformFunctionExecutionLogWithRelations = PlatformFunctionExecutionLog & PlatformFunctionExecutionLogRelations; -export type PlatformFunctionInvocationAttemptWithRelations = PlatformFunctionInvocationAttempt & PlatformFunctionInvocationAttemptRelations; -export type PlatformFunctionInvocationWithRelations = PlatformFunctionInvocation & PlatformFunctionInvocationRelations; +export type PlatformFunctionApiBindingWithRelations = PlatformFunctionApiBinding & + PlatformFunctionApiBindingRelations; +export type PlatformFunctionDefinitionWithRelations = PlatformFunctionDefinition & + PlatformFunctionDefinitionRelations; +export type PlatformFunctionDeploymentWithRelations = PlatformFunctionDeployment & + PlatformFunctionDeploymentRelations; +export type PlatformFunctionDeploymentEventWithRelations = PlatformFunctionDeploymentEvent & + PlatformFunctionDeploymentEventRelations; +export type PlatformFunctionExecutionLogWithRelations = PlatformFunctionExecutionLog & + PlatformFunctionExecutionLogRelations; +export type PlatformFunctionInvocationAttemptWithRelations = PlatformFunctionInvocationAttempt & + PlatformFunctionInvocationAttemptRelations; +export type PlatformFunctionInvocationWithRelations = PlatformFunctionInvocation & + PlatformFunctionInvocationRelations; export type PlatformInfraCommitWithRelations = PlatformInfraCommit & PlatformInfraCommitRelations; -export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & PlatformInfraGetAllTreeNodesRecordRelations; +export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & + PlatformInfraGetAllTreeNodesRecordRelations; export type PlatformInfraObjectWithRelations = PlatformInfraObject & PlatformInfraObjectRelations; export type PlatformInfraRefWithRelations = PlatformInfraRef & PlatformInfraRefRelations; export type PlatformInfraStoreWithRelations = PlatformInfraStore & PlatformInfraStoreRelations; export type PlatformNamespaceWithRelations = PlatformNamespace & PlatformNamespaceRelations; -export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & PlatformNamespaceEventRelations; +export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & + PlatformNamespaceEventRelations; export type PlatformResourceWithRelations = PlatformResource & PlatformResourceRelations; -export type PlatformResourceDeclaredCapacityWithRelations = PlatformResourceDeclaredCapacity & PlatformResourceDeclaredCapacityRelations; -export type PlatformResourceDefinitionWithRelations = PlatformResourceDefinition & PlatformResourceDefinitionRelations; -export type PlatformResourceEventWithRelations = PlatformResourceEvent & PlatformResourceEventRelations; -export type PlatformResourceInstallationWithRelations = PlatformResourceInstallation & PlatformResourceInstallationRelations; -export type PlatformResourceStatusCheckWithRelations = PlatformResourceStatusCheck & PlatformResourceStatusCheckRelations; -export type PlatformResourceUsageLogWithRelations = PlatformResourceUsageLog & PlatformResourceUsageLogRelations; -export type PlatformResourceUsageSummaryWithRelations = PlatformResourceUsageSummary & PlatformResourceUsageSummaryRelations; -export type PlatformResourceUtilizationWithRelations = PlatformResourceUtilization & PlatformResourceUtilizationRelations; -export type PlatformResourcesHealthWithRelations = PlatformResourcesHealth & PlatformResourcesHealthRelations; -export type PlatformResourcesRequirementsStateWithRelations = PlatformResourcesRequirementsState & PlatformResourcesRequirementsStateRelations; -export type PlatformResourcesResolvedRequirementWithRelations = PlatformResourcesResolvedRequirement & PlatformResourcesResolvedRequirementRelations; -export type PlatformWebhookEndpointWithRelations = PlatformWebhookEndpoint & PlatformWebhookEndpointRelations; -export type PlatformWebhookEventWithRelations = PlatformWebhookEvent & PlatformWebhookEventRelations; +export type PlatformResourceDeclaredCapacityWithRelations = PlatformResourceDeclaredCapacity & + PlatformResourceDeclaredCapacityRelations; +export type PlatformResourceDefinitionWithRelations = PlatformResourceDefinition & + PlatformResourceDefinitionRelations; +export type PlatformResourceEventWithRelations = PlatformResourceEvent & + PlatformResourceEventRelations; +export type PlatformResourceInstallationWithRelations = PlatformResourceInstallation & + PlatformResourceInstallationRelations; +export type PlatformResourceStatusCheckWithRelations = PlatformResourceStatusCheck & + PlatformResourceStatusCheckRelations; +export type PlatformResourceUsageLogWithRelations = PlatformResourceUsageLog & + PlatformResourceUsageLogRelations; +export type PlatformResourceUsageSummaryWithRelations = PlatformResourceUsageSummary & + PlatformResourceUsageSummaryRelations; +export type PlatformResourceUtilizationWithRelations = PlatformResourceUtilization & + PlatformResourceUtilizationRelations; +export type PlatformResourcesHealthWithRelations = PlatformResourcesHealth & + PlatformResourcesHealthRelations; +export type PlatformResourcesRequirementsStateWithRelations = PlatformResourcesRequirementsState & + PlatformResourcesRequirementsStateRelations; +export type PlatformResourcesResolvedRequirementWithRelations = + PlatformResourcesResolvedRequirement & PlatformResourcesResolvedRequirementRelations; +export type PlatformWebhookEndpointWithRelations = PlatformWebhookEndpoint & + PlatformWebhookEndpointRelations; +export type PlatformWebhookEventWithRelations = PlatformWebhookEvent & + PlatformWebhookEventRelations; export type ResourceWithRelations = Resource & ResourceRelations; -export type ResourceDeclaredCapacityWithRelations = ResourceDeclaredCapacity & ResourceDeclaredCapacityRelations; +export type ResourceDeclaredCapacityWithRelations = ResourceDeclaredCapacity & + ResourceDeclaredCapacityRelations; export type ResourceDefinitionWithRelations = ResourceDefinition & ResourceDefinitionRelations; export type ResourceEventWithRelations = ResourceEvent & ResourceEventRelations; -export type ResourceInstallationWithRelations = ResourceInstallation & ResourceInstallationRelations; +export type ResourceInstallationWithRelations = ResourceInstallation & + ResourceInstallationRelations; export type ResourceStatusCheckWithRelations = ResourceStatusCheck & ResourceStatusCheckRelations; export type ResourceUsageLogWithRelations = ResourceUsageLog & ResourceUsageLogRelations; -export type ResourceUsageSummaryWithRelations = ResourceUsageSummary & ResourceUsageSummaryRelations; +export type ResourceUsageSummaryWithRelations = ResourceUsageSummary & + ResourceUsageSummaryRelations; export type ResourceUtilizationWithRelations = ResourceUtilization & ResourceUtilizationRelations; export type ResourcesHealthWithRelations = ResourcesHealth & ResourcesHealthRelations; -export type ResourcesRequirementsStateWithRelations = ResourcesRequirementsState & ResourcesRequirementsStateRelations; -export type ResourcesResolvedRequirementWithRelations = ResourcesResolvedRequirement & ResourcesResolvedRequirementRelations; +export type ResourcesRequirementsStateWithRelations = ResourcesRequirementsState & + ResourcesRequirementsStateRelations; +export type ResourcesResolvedRequirementWithRelations = ResourcesResolvedRequirement & + ResourcesResolvedRequirementRelations; export type WebhookEndpointWithRelations = WebhookEndpoint & WebhookEndpointRelations; export type WebhookEventWithRelations = WebhookEvent & WebhookEventRelations; // ============ Entity Select Types ============ @@ -5659,73 +5694,1942 @@ export interface WebhookEventFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type DbPresetOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MODULES_HASH_ASC" | "MODULES_HASH_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type FunctionApiBindingOrderBy = "ALIAS_ASC" | "ALIAS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type FunctionDefinitionOrderBy = "ACCESS_CHANNELS_ASC" | "ACCESS_CHANNELS_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FN_CATEGORY_ASC" | "FN_CATEGORY_DESC" | "FUNCTION_COLUMNS_ASC" | "FUNCTION_COLUMNS_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "INPUTS_ASC" | "INPUTS_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "MAX_ATTEMPTS_ASC" | "MAX_ATTEMPTS_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MODULE_TABLE_ASC" | "MODULE_TABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUTPUTS_ASC" | "OUTPUTS_DESC" | "PAYLOAD_ARGS_ASC" | "PAYLOAD_ARGS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "PROPS_ASC" | "PROPS_DESC" | "PROTECTED_ASC" | "PROTECTED_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "QUEUE_NAME_ASC" | "QUEUE_NAME_DESC" | "REQUIRED_BUCKETS_ASC" | "REQUIRED_BUCKETS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_MODELS_ASC" | "REQUIRED_MODELS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RUNTIME_ASC" | "RUNTIME_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "TARGET_FUNCTION_ASC" | "TARGET_FUNCTION_DESC" | "TARGET_SCHEMA_ASC" | "TARGET_SCHEMA_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VOLATILE_ASC" | "VOLATILE_DESC"; -export type FunctionDeploymentOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "HANDLER_NAME_ASC" | "HANDLER_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "IMAGE_VERSION_ASC" | "IMAGE_VERSION_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_AT_ASC" | "LAST_ERROR_AT_DESC" | "LAST_ERROR_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SERVICE_NAME_ASC" | "SERVICE_NAME_DESC" | "SERVICE_URL_ASC" | "SERVICE_URL_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type FunctionDeploymentEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYMENT_ID_ASC" | "DEPLOYMENT_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type FunctionExecutionLogOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LOG_LEVEL_ASC" | "LOG_LEVEL_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type FunctionGraphCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type FunctionGraphOrderBy = "CONTEXT_ASC" | "CONTEXT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DEFINITIONS_COMMIT_ID_ASC" | "DEFINITIONS_COMMIT_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_VALID_ASC" | "IS_VALID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALIDATION_ERRORS_ASC" | "VALIDATION_ERRORS_DESC"; -export type FunctionGraphExecutionOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CURRENT_WAVE_ASC" | "CURRENT_WAVE_DESC" | "DEFINITIONS_COMMIT_ID_ASC" | "DEFINITIONS_COMMIT_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ERROR_CODE_ASC" | "ERROR_CODE_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXECUTION_PLAN_ASC" | "EXECUTION_PLAN_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ID_ASC" | "ID_DESC" | "INPUT_PAYLOAD_ASC" | "INPUT_PAYLOAD_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LAST_PROGRESS_AT_ASC" | "LAST_PROGRESS_AT_DESC" | "MAX_PENDING_JOBS_ASC" | "MAX_PENDING_JOBS_DESC" | "MAX_TICKS_ASC" | "MAX_TICKS_DESC" | "NATURAL" | "NODE_OUTPUTS_ASC" | "NODE_OUTPUTS_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "OUTPUT_NAMES_ASC" | "OUTPUT_NAMES_DESC" | "OUTPUT_NODE_ASC" | "OUTPUT_NODE_DESC" | "OUTPUT_PAYLOAD_ASC" | "OUTPUT_PAYLOAD_DESC" | "OUTPUT_PORT_ASC" | "OUTPUT_PORT_DESC" | "PARENT_EXECUTION_ID_ASC" | "PARENT_EXECUTION_ID_DESC" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PARENT_NODE_NAME_ASC" | "PARENT_NODE_NAME_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPAL_ID_ASC" | "PRINCIPAL_ID_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TICK_COUNT_ASC" | "TICK_COUNT_DESC" | "TIMEOUT_AT_ASC" | "TIMEOUT_AT_DESC"; -export type FunctionGraphExecutionNodeStateOrderBy = "CALLBACK_INPUTS_ASC" | "CALLBACK_INPUTS_DESC" | "CALLBACK_META_ASC" | "CALLBACK_META_DESC" | "CALLBACK_TOKEN_HASH_ASC" | "CALLBACK_TOKEN_HASH_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ERROR_CODE_ASC" | "ERROR_CODE_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXECUTION_ID_ASC" | "EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODE_NAME_ASC" | "NODE_NAME_DESC" | "NODE_PATH_ASC" | "NODE_PATH_DESC" | "OUTPUT_ID_ASC" | "OUTPUT_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type FunctionGraphExecutionOutputOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionGraphObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionGraphRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type FunctionGraphStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type FunctionInvocationAttemptOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ATTEMPT_ASC" | "ATTEMPT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ERROR_DETAIL_ASC" | "ERROR_DETAIL_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type FunctionInvocationOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "API_BINDING_ID_ASC" | "API_BINDING_ID_DESC" | "CHANNEL_ASC" | "CHANNEL_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFINITION_SCOPE_ASC" | "DEFINITION_SCOPE_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "GRAPH_EXECUTION_ID_ASC" | "GRAPH_EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOB_ID_ASC" | "JOB_ID_DESC" | "NATURAL" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVENANCE_ASC" | "PROVENANCE_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type GetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type InfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type InfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type InfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type InfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type InfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type IntegrationProviderOrderBy = "BRAND_ASC" | "BRAND_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "LOGO_ASC" | "LOGO_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionApiBindingOrderBy = "ALIAS_ASC" | "ALIAS_DESC" | "API_ID_ASC" | "API_ID_DESC" | "CONFIG_ASC" | "CONFIG_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionDefinitionOrderBy = "ACCESS_CHANNELS_ASC" | "ACCESS_CHANNELS_DESC" | "BILLABLE_ASC" | "BILLABLE_DESC" | "CATEGORY_ASC" | "CATEGORY_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FN_CATEGORY_ASC" | "FN_CATEGORY_DESC" | "FUNCTION_COLUMNS_ASC" | "FUNCTION_COLUMNS_DESC" | "GRAPH_ID_ASC" | "GRAPH_ID_DESC" | "ICON_ASC" | "ICON_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "INPUTS_ASC" | "INPUTS_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "IS_PUBLISHED_ASC" | "IS_PUBLISHED_DESC" | "MAX_ATTEMPTS_ASC" | "MAX_ATTEMPTS_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MODULE_TABLE_ASC" | "MODULE_TABLE_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUTPUTS_ASC" | "OUTPUTS_DESC" | "PAYLOAD_ARGS_ASC" | "PAYLOAD_ARGS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIORITY_ASC" | "PRIORITY_DESC" | "PROPS_ASC" | "PROPS_DESC" | "PROTECTED_ASC" | "PROTECTED_DESC" | "PUBLISHED_AT_ASC" | "PUBLISHED_AT_DESC" | "QUEUE_NAME_ASC" | "QUEUE_NAME_DESC" | "REQUIRED_BUCKETS_ASC" | "REQUIRED_BUCKETS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_MODELS_ASC" | "REQUIRED_MODELS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RUNTIME_ASC" | "RUNTIME_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SYSTEM_ASC" | "SYSTEM_DESC" | "TARGET_FUNCTION_ASC" | "TARGET_FUNCTION_DESC" | "TARGET_SCHEMA_ASC" | "TARGET_SCHEMA_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VOLATILE_ASC" | "VOLATILE_DESC"; -export type PlatformFunctionDeploymentOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CONCURRENCY_ASC" | "CONCURRENCY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "HANDLER_NAME_ASC" | "HANDLER_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IMAGE_ASC" | "IMAGE_DESC" | "IMAGE_VERSION_ASC" | "IMAGE_VERSION_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_AT_ASC" | "LAST_ERROR_AT_DESC" | "LAST_ERROR_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SCALE_MAX_ASC" | "SCALE_MAX_DESC" | "SCALE_MIN_ASC" | "SCALE_MIN_DESC" | "SERVICE_NAME_ASC" | "SERVICE_NAME_DESC" | "SERVICE_URL_ASC" | "SERVICE_URL_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TIMEOUT_SECONDS_ASC" | "TIMEOUT_SECONDS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformFunctionDeploymentEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEPLOYMENT_ID_ASC" | "DEPLOYMENT_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformFunctionExecutionLogOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "LOG_LEVEL_ASC" | "LOG_LEVEL_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformFunctionInvocationAttemptOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ATTEMPT_ASC" | "ATTEMPT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "ERROR_DETAIL_ASC" | "ERROR_DETAIL_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "SUCCESS_ASC" | "SUCCESS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformFunctionInvocationOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "API_BINDING_ID_ASC" | "API_BINDING_ID_DESC" | "CHANNEL_ASC" | "CHANNEL_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_SCOPE_ASC" | "DEFINITION_SCOPE_DESC" | "DURATION_MS_ASC" | "DURATION_MS_DESC" | "ERROR_ASC" | "ERROR_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "GRAPH_EXECUTION_ID_ASC" | "GRAPH_EXECUTION_ID_DESC" | "ID_ASC" | "ID_DESC" | "JOB_ID_ASC" | "JOB_ID_DESC" | "NATURAL" | "PARENT_INVOCATION_ID_ASC" | "PARENT_INVOCATION_ID_DESC" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVENANCE_ASC" | "PROVENANCE_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STARTED_AT_ASC" | "STARTED_AT_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC"; -export type PlatformInfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type PlatformInfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type PlatformInfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformInfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type PlatformInfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformNamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformNamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformResourceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceDeclaredCapacityOrderBy = "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "IS_TRANSIENT_ASC" | "IS_TRANSIENT_DESC" | "KIND_ASC" | "KIND_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "POD_COUNT_MAX_ASC" | "POD_COUNT_MAX_DESC" | "POD_COUNT_MIN_ASC" | "POD_COUNT_MIN_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "SOURCE_ID_ASC" | "SOURCE_ID_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC"; -export type PlatformResourceDefinitionOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DEFAULT_SPEC_ASC" | "DEFAULT_SPEC_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STEP_UP_MIN_AGE_ASC" | "STEP_UP_MIN_AGE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC"; -export type PlatformResourceInstallationOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMS_ASC" | "PARAMS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourceStatusCheckOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUESTED_AT_ASC" | "REQUESTED_AT_DESC" | "REQUESTED_BY_ASC" | "REQUESTED_BY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type PlatformResourceUsageLogOrderBy = "CPU_MILLICORES_ASC" | "CPU_MILLICORES_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_SECONDS_ASC" | "INTERVAL_SECONDS_DESC" | "MEMORY_BYTES_ASC" | "MEMORY_BYTES_DESC" | "METRICS_ASC" | "METRICS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SAMPLED_AT_ASC" | "SAMPLED_AT_DESC" | "SOURCE_ASC" | "SOURCE_DESC"; -export type PlatformResourceUsageSummaryOrderBy = "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "ID_ASC" | "ID_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type PlatformResourceUtilizationOrderBy = "AVG_MEMORY_BYTES_ASC" | "AVG_MEMORY_BYTES_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_PEAK_UTILIZATION_ASC" | "CPU_PEAK_UTILIZATION_DESC" | "CPU_REQUEST_HEADROOM_MILLICORES_ASC" | "CPU_REQUEST_HEADROOM_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "KIND_ASC" | "KIND_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_PEAK_UTILIZATION_ASC" | "MEMORY_PEAK_UTILIZATION_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MEMORY_REQUEST_HEADROOM_BYTES_ASC" | "MEMORY_REQUEST_HEADROOM_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type PlatformResourcesHealthOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_DETAIL_ASC" | "STATUS_DETAIL_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformResourcesRequirementsStateOrderBy = "CONFIG_HASH_ASC" | "CONFIG_HASH_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NATURAL" | "REQUIREMENTS_HASH_ASC" | "REQUIREMENTS_HASH_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_HASH_ASC" | "SECRETS_HASH_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type PlatformResourcesResolvedRequirementOrderBy = "ATOM_ID_ASC" | "ATOM_ID_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRESENT_ASC" | "PRESENT_DESC" | "REQUIRED_ASC" | "REQUIRED_DESC" | "REQUIREMENT_KIND_ASC" | "REQUIREMENT_KIND_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type PlatformWebhookEndpointOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "HOST_ASC" | "HOST_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "REPLAY_WINDOW_SECONDS_ASC" | "REPLAY_WINDOW_SECONDS_DESC" | "SIGNING_SECRET_NAME_ASC" | "SIGNING_SECRET_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type PlatformWebhookEventOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "ENDPOINT_ID_ASC" | "ENDPOINT_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXTERNAL_EVENT_ID_ASC" | "EXTERNAL_EVENT_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVIDER_TIMESTAMP_ASC" | "PROVIDER_TIMESTAMP_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type ResourceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceDeclaredCapacityOrderBy = "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "IS_TRANSIENT_ASC" | "IS_TRANSIENT_DESC" | "KIND_ASC" | "KIND_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "POD_COUNT_MAX_ASC" | "POD_COUNT_MAX_DESC" | "POD_COUNT_MIN_ASC" | "POD_COUNT_MIN_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "SOURCE_ID_ASC" | "SOURCE_ID_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC"; -export type ResourceDefinitionOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_SPEC_ASC" | "DEFAULT_SPEC_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STEP_UP_MIN_AGE_ASC" | "STEP_UP_MIN_AGE_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC"; -export type ResourceInstallationOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PARAMS_ASC" | "PARAMS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REVISION_ASC" | "REVISION_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourceStatusCheckOrderBy = "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUESTED_AT_ASC" | "REQUESTED_AT_DESC" | "REQUESTED_BY_ASC" | "REQUESTED_BY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RESULT_ASC" | "RESULT_DESC" | "STATUS_ASC" | "STATUS_DESC"; -export type ResourceUsageLogOrderBy = "CPU_MILLICORES_ASC" | "CPU_MILLICORES_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_SECONDS_ASC" | "INTERVAL_SECONDS_DESC" | "MEMORY_BYTES_ASC" | "MEMORY_BYTES_DESC" | "METRICS_ASC" | "METRICS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SAMPLED_AT_ASC" | "SAMPLED_AT_DESC" | "SOURCE_ASC" | "SOURCE_DESC"; -export type ResourceUsageSummaryOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "ID_ASC" | "ID_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type ResourceUtilizationOrderBy = "AVG_MEMORY_BYTES_ASC" | "AVG_MEMORY_BYTES_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_PEAK_UTILIZATION_ASC" | "CPU_PEAK_UTILIZATION_DESC" | "CPU_REQUEST_HEADROOM_MILLICORES_ASC" | "CPU_REQUEST_HEADROOM_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "DATE_ASC" | "DATE_DESC" | "GB_SECONDS_ASC" | "GB_SECONDS_DESC" | "KIND_ASC" | "KIND_DESC" | "MAX_CPU_MILLICORES_ASC" | "MAX_CPU_MILLICORES_DESC" | "MAX_MEMORY_BYTES_ASC" | "MAX_MEMORY_BYTES_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_PEAK_UTILIZATION_ASC" | "MEMORY_PEAK_UTILIZATION_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "MEMORY_REQUEST_HEADROOM_BYTES_ASC" | "MEMORY_REQUEST_HEADROOM_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "RUNTIME_SECONDS_ASC" | "RUNTIME_SECONDS_DESC" | "SAMPLE_COUNT_ASC" | "SAMPLE_COUNT_DESC"; -export type ResourcesHealthOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CPU_LIMIT_MILLICORES_ASC" | "CPU_LIMIT_MILLICORES_DESC" | "CPU_REQUEST_MILLICORES_ASC" | "CPU_REQUEST_MILLICORES_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_COUNT_ASC" | "ERROR_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_ID_ASC" | "INSTALLATION_ID_DESC" | "INTEGRATIONS_ASC" | "INTEGRATIONS_DESC" | "KIND_ASC" | "KIND_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "LAST_HEARTBEAT_AT_ASC" | "LAST_HEARTBEAT_AT_DESC" | "MEMORY_LIMIT_BYTES_ASC" | "MEMORY_LIMIT_BYTES_DESC" | "MEMORY_REQUEST_BYTES_ASC" | "MEMORY_REQUEST_BYTES_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "REPLICAS_ASC" | "REPLICAS_DESC" | "REQUIRED_CONFIGS_ASC" | "REQUIRED_CONFIGS_DESC" | "REQUIRED_SECRETS_ASC" | "REQUIRED_SECRETS_DESC" | "RESOURCE_DEFINITION_ID_ASC" | "RESOURCE_DEFINITION_ID_DESC" | "SLUG_ASC" | "SLUG_DESC" | "SPEC_ASC" | "SPEC_DESC" | "STATUS_ASC" | "STATUS_DESC" | "STATUS_DETAIL_ASC" | "STATUS_DETAIL_DESC" | "STATUS_OBSERVED_ASC" | "STATUS_OBSERVED_DESC" | "STORAGE_CLASS_ASC" | "STORAGE_CLASS_DESC" | "STORAGE_SIZE_BYTES_ASC" | "STORAGE_SIZE_BYTES_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type ResourcesRequirementsStateOrderBy = "CONFIG_HASH_ASC" | "CONFIG_HASH_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NATURAL" | "REQUIREMENTS_HASH_ASC" | "REQUIREMENTS_HASH_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_HASH_ASC" | "SECRETS_HASH_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type ResourcesResolvedRequirementOrderBy = "ATOM_ID_ASC" | "ATOM_ID_DESC" | "CONFIG_OBJECT_NAME_ASC" | "CONFIG_OBJECT_NAME_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRESENT_ASC" | "PRESENT_DESC" | "REQUIRED_ASC" | "REQUIRED_DESC" | "REQUIREMENT_KIND_ASC" | "REQUIREMENT_KIND_DESC" | "RESOURCE_ID_ASC" | "RESOURCE_ID_DESC" | "SECRETS_OBJECT_NAME_ASC" | "SECRETS_OBJECT_NAME_DESC" | "SLUG_ASC" | "SLUG_DESC"; -export type WebhookEndpointOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "CREATED_BY_ASC" | "CREATED_BY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FUNCTION_DEFINITION_ID_ASC" | "FUNCTION_DEFINITION_ID_DESC" | "HOST_ASC" | "HOST_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PATH_ASC" | "PATH_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "REPLAY_WINDOW_SECONDS_ASC" | "REPLAY_WINDOW_SECONDS_DESC" | "SIGNING_SECRET_NAME_ASC" | "SIGNING_SECRET_NAME_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "UPDATED_BY_ASC" | "UPDATED_BY_DESC"; -export type WebhookEventOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENDPOINT_ID_ASC" | "ENDPOINT_ID_DESC" | "ERROR_ASC" | "ERROR_DESC" | "EXTERNAL_EVENT_ID_ASC" | "EXTERNAL_EVENT_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATION_CREATED_AT_ASC" | "INVOCATION_CREATED_AT_DESC" | "INVOCATION_ID_ASC" | "INVOCATION_ID_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVIDER_TIMESTAMP_ASC" | "PROVIDER_TIMESTAMP_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type DbPresetOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MODULES_HASH_ASC' + | 'MODULES_HASH_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type FunctionApiBindingOrderBy = + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type FunctionDefinitionOrderBy = + | 'ACCESS_CHANNELS_ASC' + | 'ACCESS_CHANNELS_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FN_CATEGORY_ASC' + | 'FN_CATEGORY_DESC' + | 'FUNCTION_COLUMNS_ASC' + | 'FUNCTION_COLUMNS_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MODULE_TABLE_ASC' + | 'MODULE_TABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PAYLOAD_ARGS_ASC' + | 'PAYLOAD_ARGS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'PROTECTED_ASC' + | 'PROTECTED_DESC' + | 'PUBLISHED_AT_ASC' + | 'PUBLISHED_AT_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'TARGET_FUNCTION_ASC' + | 'TARGET_FUNCTION_DESC' + | 'TARGET_SCHEMA_ASC' + | 'TARGET_SCHEMA_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC'; +export type FunctionDeploymentOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'HANDLER_NAME_ASC' + | 'HANDLER_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'IMAGE_VERSION_ASC' + | 'IMAGE_VERSION_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type FunctionDeploymentEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type FunctionExecutionLogOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type FunctionGraphCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type FunctionGraphOrderBy = + | 'CONTEXT_ASC' + | 'CONTEXT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VALID_ASC' + | 'IS_VALID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALIDATION_ERRORS_ASC' + | 'VALIDATION_ERRORS_DESC'; +export type FunctionGraphExecutionOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CURRENT_WAVE_ASC' + | 'CURRENT_WAVE_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXECUTION_PLAN_ASC' + | 'EXECUTION_PLAN_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INPUT_PAYLOAD_ASC' + | 'INPUT_PAYLOAD_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LAST_PROGRESS_AT_ASC' + | 'LAST_PROGRESS_AT_DESC' + | 'MAX_PENDING_JOBS_ASC' + | 'MAX_PENDING_JOBS_DESC' + | 'MAX_TICKS_ASC' + | 'MAX_TICKS_DESC' + | 'NATURAL' + | 'NODE_OUTPUTS_ASC' + | 'NODE_OUTPUTS_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'OUTPUT_NAMES_ASC' + | 'OUTPUT_NAMES_DESC' + | 'OUTPUT_NODE_ASC' + | 'OUTPUT_NODE_DESC' + | 'OUTPUT_PAYLOAD_ASC' + | 'OUTPUT_PAYLOAD_DESC' + | 'OUTPUT_PORT_ASC' + | 'OUTPUT_PORT_DESC' + | 'PARENT_EXECUTION_ID_ASC' + | 'PARENT_EXECUTION_ID_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PARENT_NODE_NAME_ASC' + | 'PARENT_NODE_NAME_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TICK_COUNT_ASC' + | 'TICK_COUNT_DESC' + | 'TIMEOUT_AT_ASC' + | 'TIMEOUT_AT_DESC'; +export type FunctionGraphExecutionNodeStateOrderBy = + | 'CALLBACK_INPUTS_ASC' + | 'CALLBACK_INPUTS_DESC' + | 'CALLBACK_META_ASC' + | 'CALLBACK_META_DESC' + | 'CALLBACK_TOKEN_HASH_ASC' + | 'CALLBACK_TOKEN_HASH_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXECUTION_ID_ASC' + | 'EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODE_NAME_ASC' + | 'NODE_NAME_DESC' + | 'NODE_PATH_ASC' + | 'NODE_PATH_DESC' + | 'OUTPUT_ID_ASC' + | 'OUTPUT_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type FunctionGraphExecutionOutputOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionGraphObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionGraphRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type FunctionGraphStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type FunctionInvocationAttemptOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ATTEMPT_ASC' + | 'ATTEMPT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ERROR_DETAIL_ASC' + | 'ERROR_DETAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type FunctionInvocationOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'API_BINDING_ID_ASC' + | 'API_BINDING_ID_DESC' + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFINITION_SCOPE_ASC' + | 'DEFINITION_SCOPE_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'NATURAL' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVENANCE_ASC' + | 'PROVENANCE_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type GetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type InfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type InfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type InfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type InfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type InfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type IntegrationProviderOrderBy = + | 'BRAND_ASC' + | 'BRAND_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LOGO_ASC' + | 'LOGO_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionApiBindingOrderBy = + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionDefinitionOrderBy = + | 'ACCESS_CHANNELS_ASC' + | 'ACCESS_CHANNELS_DESC' + | 'BILLABLE_ASC' + | 'BILLABLE_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FN_CATEGORY_ASC' + | 'FN_CATEGORY_DESC' + | 'FUNCTION_COLUMNS_ASC' + | 'FUNCTION_COLUMNS_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'IS_PUBLISHED_ASC' + | 'IS_PUBLISHED_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MODULE_TABLE_ASC' + | 'MODULE_TABLE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PAYLOAD_ARGS_ASC' + | 'PAYLOAD_ARGS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'PROTECTED_ASC' + | 'PROTECTED_DESC' + | 'PUBLISHED_AT_ASC' + | 'PUBLISHED_AT_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SYSTEM_ASC' + | 'SYSTEM_DESC' + | 'TARGET_FUNCTION_ASC' + | 'TARGET_FUNCTION_DESC' + | 'TARGET_SCHEMA_ASC' + | 'TARGET_SCHEMA_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC'; +export type PlatformFunctionDeploymentOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'HANDLER_NAME_ASC' + | 'HANDLER_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'IMAGE_VERSION_ASC' + | 'IMAGE_VERSION_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformFunctionDeploymentEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformFunctionExecutionLogOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformFunctionInvocationAttemptOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ATTEMPT_ASC' + | 'ATTEMPT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'ERROR_DETAIL_ASC' + | 'ERROR_DETAIL_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'SUCCESS_ASC' + | 'SUCCESS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformFunctionInvocationOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'API_BINDING_ID_ASC' + | 'API_BINDING_ID_DESC' + | 'CHANNEL_ASC' + | 'CHANNEL_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_SCOPE_ASC' + | 'DEFINITION_SCOPE_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'NATURAL' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVENANCE_ASC' + | 'PROVENANCE_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC'; +export type PlatformInfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type PlatformInfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type PlatformInfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformInfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type PlatformInfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformNamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformNamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformResourceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceDeclaredCapacityOrderBy = + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'IS_TRANSIENT_ASC' + | 'IS_TRANSIENT_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'POD_COUNT_MAX_ASC' + | 'POD_COUNT_MAX_DESC' + | 'POD_COUNT_MIN_ASC' + | 'POD_COUNT_MIN_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'SOURCE_ID_ASC' + | 'SOURCE_ID_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC'; +export type PlatformResourceDefinitionOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DEFAULT_SPEC_ASC' + | 'DEFAULT_SPEC_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STEP_UP_MIN_AGE_ASC' + | 'STEP_UP_MIN_AGE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC'; +export type PlatformResourceInstallationOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMS_ASC' + | 'PARAMS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourceStatusCheckOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUESTED_AT_ASC' + | 'REQUESTED_AT_DESC' + | 'REQUESTED_BY_ASC' + | 'REQUESTED_BY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type PlatformResourceUsageLogOrderBy = + | 'CPU_MILLICORES_ASC' + | 'CPU_MILLICORES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_SECONDS_ASC' + | 'INTERVAL_SECONDS_DESC' + | 'MEMORY_BYTES_ASC' + | 'MEMORY_BYTES_DESC' + | 'METRICS_ASC' + | 'METRICS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SAMPLED_AT_ASC' + | 'SAMPLED_AT_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC'; +export type PlatformResourceUsageSummaryOrderBy = + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type PlatformResourceUtilizationOrderBy = + | 'AVG_MEMORY_BYTES_ASC' + | 'AVG_MEMORY_BYTES_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_PEAK_UTILIZATION_ASC' + | 'CPU_PEAK_UTILIZATION_DESC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_ASC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_PEAK_UTILIZATION_ASC' + | 'MEMORY_PEAK_UTILIZATION_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_ASC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type PlatformResourcesHealthOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_DETAIL_ASC' + | 'STATUS_DETAIL_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformResourcesRequirementsStateOrderBy = + | 'CONFIG_HASH_ASC' + | 'CONFIG_HASH_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NATURAL' + | 'REQUIREMENTS_HASH_ASC' + | 'REQUIREMENTS_HASH_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_HASH_ASC' + | 'SECRETS_HASH_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type PlatformResourcesResolvedRequirementOrderBy = + | 'ATOM_ID_ASC' + | 'ATOM_ID_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRESENT_ASC' + | 'PRESENT_DESC' + | 'REQUIRED_ASC' + | 'REQUIRED_DESC' + | 'REQUIREMENT_KIND_ASC' + | 'REQUIREMENT_KIND_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type PlatformWebhookEndpointOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'HOST_ASC' + | 'HOST_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'REPLAY_WINDOW_SECONDS_ASC' + | 'REPLAY_WINDOW_SECONDS_DESC' + | 'SIGNING_SECRET_NAME_ASC' + | 'SIGNING_SECRET_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type PlatformWebhookEventOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ENDPOINT_ID_ASC' + | 'ENDPOINT_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXTERNAL_EVENT_ID_ASC' + | 'EXTERNAL_EVENT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVIDER_TIMESTAMP_ASC' + | 'PROVIDER_TIMESTAMP_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type ResourceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceDeclaredCapacityOrderBy = + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'IS_TRANSIENT_ASC' + | 'IS_TRANSIENT_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'POD_COUNT_MAX_ASC' + | 'POD_COUNT_MAX_DESC' + | 'POD_COUNT_MIN_ASC' + | 'POD_COUNT_MIN_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'SOURCE_ID_ASC' + | 'SOURCE_ID_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC'; +export type ResourceDefinitionOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_SPEC_ASC' + | 'DEFAULT_SPEC_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STEP_UP_MIN_AGE_ASC' + | 'STEP_UP_MIN_AGE_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC'; +export type ResourceInstallationOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PARAMS_ASC' + | 'PARAMS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourceStatusCheckOrderBy = + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUESTED_AT_ASC' + | 'REQUESTED_AT_DESC' + | 'REQUESTED_BY_ASC' + | 'REQUESTED_BY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC'; +export type ResourceUsageLogOrderBy = + | 'CPU_MILLICORES_ASC' + | 'CPU_MILLICORES_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_SECONDS_ASC' + | 'INTERVAL_SECONDS_DESC' + | 'MEMORY_BYTES_ASC' + | 'MEMORY_BYTES_DESC' + | 'METRICS_ASC' + | 'METRICS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SAMPLED_AT_ASC' + | 'SAMPLED_AT_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC'; +export type ResourceUsageSummaryOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type ResourceUtilizationOrderBy = + | 'AVG_MEMORY_BYTES_ASC' + | 'AVG_MEMORY_BYTES_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_PEAK_UTILIZATION_ASC' + | 'CPU_PEAK_UTILIZATION_DESC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_ASC' + | 'CPU_REQUEST_HEADROOM_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'GB_SECONDS_ASC' + | 'GB_SECONDS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'MAX_CPU_MILLICORES_ASC' + | 'MAX_CPU_MILLICORES_DESC' + | 'MAX_MEMORY_BYTES_ASC' + | 'MAX_MEMORY_BYTES_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_PEAK_UTILIZATION_ASC' + | 'MEMORY_PEAK_UTILIZATION_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_ASC' + | 'MEMORY_REQUEST_HEADROOM_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'RUNTIME_SECONDS_ASC' + | 'RUNTIME_SECONDS_DESC' + | 'SAMPLE_COUNT_ASC' + | 'SAMPLE_COUNT_DESC'; +export type ResourcesHealthOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CPU_LIMIT_MILLICORES_ASC' + | 'CPU_LIMIT_MILLICORES_DESC' + | 'CPU_REQUEST_MILLICORES_ASC' + | 'CPU_REQUEST_MILLICORES_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_ID_ASC' + | 'INSTALLATION_ID_DESC' + | 'INTEGRATIONS_ASC' + | 'INTEGRATIONS_DESC' + | 'KIND_ASC' + | 'KIND_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_HEARTBEAT_AT_ASC' + | 'LAST_HEARTBEAT_AT_DESC' + | 'MEMORY_LIMIT_BYTES_ASC' + | 'MEMORY_LIMIT_BYTES_DESC' + | 'MEMORY_REQUEST_BYTES_ASC' + | 'MEMORY_REQUEST_BYTES_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'REPLICAS_ASC' + | 'REPLICAS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'RESOURCE_DEFINITION_ID_ASC' + | 'RESOURCE_DEFINITION_ID_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'SPEC_ASC' + | 'SPEC_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STATUS_DETAIL_ASC' + | 'STATUS_DETAIL_DESC' + | 'STATUS_OBSERVED_ASC' + | 'STATUS_OBSERVED_DESC' + | 'STORAGE_CLASS_ASC' + | 'STORAGE_CLASS_DESC' + | 'STORAGE_SIZE_BYTES_ASC' + | 'STORAGE_SIZE_BYTES_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type ResourcesRequirementsStateOrderBy = + | 'CONFIG_HASH_ASC' + | 'CONFIG_HASH_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NATURAL' + | 'REQUIREMENTS_HASH_ASC' + | 'REQUIREMENTS_HASH_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_HASH_ASC' + | 'SECRETS_HASH_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type ResourcesResolvedRequirementOrderBy = + | 'ATOM_ID_ASC' + | 'ATOM_ID_DESC' + | 'CONFIG_OBJECT_NAME_ASC' + | 'CONFIG_OBJECT_NAME_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRESENT_ASC' + | 'PRESENT_DESC' + | 'REQUIRED_ASC' + | 'REQUIRED_DESC' + | 'REQUIREMENT_KIND_ASC' + | 'REQUIREMENT_KIND_DESC' + | 'RESOURCE_ID_ASC' + | 'RESOURCE_ID_DESC' + | 'SECRETS_OBJECT_NAME_ASC' + | 'SECRETS_OBJECT_NAME_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC'; +export type WebhookEndpointOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'HOST_ASC' + | 'HOST_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'REPLAY_WINDOW_SECONDS_ASC' + | 'REPLAY_WINDOW_SECONDS_DESC' + | 'SIGNING_SECRET_NAME_ASC' + | 'SIGNING_SECRET_NAME_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'UPDATED_BY_ASC' + | 'UPDATED_BY_DESC'; +export type WebhookEventOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENDPOINT_ID_ASC' + | 'ENDPOINT_ID_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'EXTERNAL_EVENT_ID_ASC' + | 'EXTERNAL_EVENT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_CREATED_AT_ASC' + | 'INVOCATION_CREATED_AT_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVIDER_TIMESTAMP_ASC' + | 'PROVIDER_TIMESTAMP_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateDbPresetInput { clientMutationId?: string; @@ -8206,62 +10110,62 @@ export interface DeleteWebhookEventInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "FunctionApiBinding": { - "functionInvocationsByApiBindingId": "FunctionInvocation" + FunctionApiBinding: { + functionInvocationsByApiBindingId: 'FunctionInvocation', }, - "FunctionDefinition": { - "functionApiBindings": "FunctionApiBinding", - "webhookEndpoints": "WebhookEndpoint" + FunctionDefinition: { + functionApiBindings: 'FunctionApiBinding', + webhookEndpoints: 'WebhookEndpoint', }, - "FunctionGraph": { - "functionGraphExecutionsByGraphId": "FunctionGraphExecution", - "platformFunctionDefinitionsByGraphId": "PlatformFunctionDefinition" + FunctionGraph: { + functionGraphExecutionsByGraphId: 'FunctionGraphExecution', + platformFunctionDefinitionsByGraphId: 'PlatformFunctionDefinition', }, - "Namespace": { - "functionDeployments": "FunctionDeployment", - "resourceDefinitions": "ResourceDefinition", - "resourceInstallations": "ResourceInstallation", - "resources": "Resource", - "webhookEndpoints": "WebhookEndpoint" + Namespace: { + functionDeployments: 'FunctionDeployment', + resourceDefinitions: 'ResourceDefinition', + resourceInstallations: 'ResourceInstallation', + resources: 'Resource', + webhookEndpoints: 'WebhookEndpoint', }, - "PlatformFunctionApiBinding": { - "platformFunctionInvocationsByApiBindingId": "PlatformFunctionInvocation" + PlatformFunctionApiBinding: { + platformFunctionInvocationsByApiBindingId: 'PlatformFunctionInvocation', }, - "PlatformFunctionDefinition": { - "platformFunctionApiBindingsByFunctionDefinitionId": "PlatformFunctionApiBinding", - "platformWebhookEndpointsByFunctionDefinitionId": "PlatformWebhookEndpoint" + PlatformFunctionDefinition: { + platformFunctionApiBindingsByFunctionDefinitionId: 'PlatformFunctionApiBinding', + platformWebhookEndpointsByFunctionDefinitionId: 'PlatformWebhookEndpoint', }, - "PlatformNamespace": { - "platformFunctionDeploymentsByNamespaceId": "PlatformFunctionDeployment", - "platformResourceDefinitionsByNamespaceId": "PlatformResourceDefinition", - "platformResourceInstallationsByNamespaceId": "PlatformResourceInstallation", - "platformResourcesByNamespaceId": "PlatformResource", - "platformWebhookEndpointsByNamespaceId": "PlatformWebhookEndpoint" + PlatformNamespace: { + platformFunctionDeploymentsByNamespaceId: 'PlatformFunctionDeployment', + platformResourceDefinitionsByNamespaceId: 'PlatformResourceDefinition', + platformResourceInstallationsByNamespaceId: 'PlatformResourceInstallation', + platformResourcesByNamespaceId: 'PlatformResource', + platformWebhookEndpointsByNamespaceId: 'PlatformWebhookEndpoint', }, - "PlatformResource": { - "platformResourceStatusChecksByResourceId": "PlatformResourceStatusCheck" + PlatformResource: { + platformResourceStatusChecksByResourceId: 'PlatformResourceStatusCheck', }, - "PlatformResourceDefinition": { - "platformResourcesByResourceDefinitionId": "PlatformResource" + PlatformResourceDefinition: { + platformResourcesByResourceDefinitionId: 'PlatformResource', }, - "PlatformResourceInstallation": { - "platformResourcesByInstallationId": "PlatformResource" + PlatformResourceInstallation: { + platformResourcesByInstallationId: 'PlatformResource', }, - "PlatformWebhookEndpoint": { - "platformWebhookEventsByEndpointId": "PlatformWebhookEvent" + PlatformWebhookEndpoint: { + platformWebhookEventsByEndpointId: 'PlatformWebhookEvent', }, - "Resource": { - "resourceStatusChecks": "ResourceStatusCheck" + Resource: { + resourceStatusChecks: 'ResourceStatusCheck', }, - "ResourceDefinition": { - "resources": "Resource" + ResourceDefinition: { + resources: 'Resource', }, - "ResourceInstallation": { - "resourcesByInstallationId": "Resource" + ResourceInstallation: { + resourcesByInstallationId: 'Resource', + }, + WebhookEndpoint: { + webhookEventsByEndpointId: 'WebhookEvent', }, - "WebhookEndpoint": { - "webhookEventsByEndpointId": "WebhookEvent" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface AddEdgeInput { @@ -14975,4 +16879,4 @@ export type WebhookEventEdgeSelect = { node?: { select: WebhookEventSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/compute/orm/models/dbPreset.ts b/sdk/constructive-sdk/src/compute/orm/models/dbPreset.ts index 15b60268b5..a3e824a674 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/dbPreset.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/dbPreset.ts @@ -3,56 +3,96 @@ * @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 { DbPreset, DbPresetWithRelations, DbPresetSelect, DbPresetFilter, DbPresetOrderBy, CreateDbPresetInput, UpdateDbPresetInput, DbPresetPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPreset, + DbPresetWithRelations, + DbPresetSelect, + DbPresetFilter, + DbPresetOrderBy, + CreateDbPresetInput, + UpdateDbPresetInput, + DbPresetPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", 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 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + 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, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPresets", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPresets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPreset", "dbPresets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPreset", "createDbPreset", "dbPreset", args.select, args.data, "CreateDbPresetInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPreset', + 'createDbPreset', + 'dbPreset', + args.select, + args.data, + 'CreateDbPresetInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "createDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'createDbPreset', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPreset", "updateDbPreset", "dbPreset", args.select, args.where.id, args.data, "UpdateDbPresetInput", "id", "dbPresetPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPreset', + 'updateDbPreset', + 'dbPreset', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetInput', + 'id', + 'dbPresetPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "updateDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'updateDbPreset', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPreset", "deleteDbPreset", "dbPreset", { - id: args.where.id - }, "DeleteDbPresetInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPreset', + 'deleteDbPreset', + 'dbPreset', + { + id: args.where.id, + }, + 'DeleteDbPresetInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "deleteDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'deleteDbPreset', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionApiBinding.ts b/sdk/constructive-sdk/src/compute/orm/models/functionApiBinding.ts index 209cd4b4d5..a98f9d2a06 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionApiBinding.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionApiBinding.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionApiBinding, FunctionApiBindingWithRelations, FunctionApiBindingSelect, FunctionApiBindingFilter, FunctionApiBindingOrderBy, CreateFunctionApiBindingInput, UpdateFunctionApiBindingInput, FunctionApiBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionApiBinding, + FunctionApiBindingWithRelations, + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, + CreateFunctionApiBindingInput, + UpdateFunctionApiBindingInput, + FunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionApiBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBindings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBindings", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBinding", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionApiBinding": data.functionApiBindings?.nodes?.[0] ?? null - }) + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionApiBinding: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionApiBinding", "functionApiBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionApiBindingFilter", "FunctionApiBindingOrderBy", connectionFieldsMap); + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionApiBinding", - fieldName: "functionApiBinding", + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionApiBinding": data.functionApiBindings?.nodes?.[0] ?? null - }) + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionApiBinding", "createFunctionApiBinding", "functionApiBinding", args.select, args.data, "CreateFunctionApiBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionApiBinding', + 'createFunctionApiBinding', + 'functionApiBinding', + args.select, + args.data, + 'CreateFunctionApiBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "createFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'createFunctionApiBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionApiBinding", "updateFunctionApiBinding", "functionApiBinding", args.select, args.where.id, args.data, "UpdateFunctionApiBindingInput", "id", "functionApiBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionApiBinding', + 'updateFunctionApiBinding', + 'functionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdateFunctionApiBindingInput', + 'id', + 'functionApiBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "updateFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'updateFunctionApiBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionApiBinding: { functionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionApiBinding", "deleteFunctionApiBinding", "functionApiBinding", { - id: args.where.id - }, "DeleteFunctionApiBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionApiBinding', + 'deleteFunctionApiBinding', + 'functionApiBinding', + { + id: args.where.id, + }, + 'DeleteFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionApiBinding", - fieldName: "deleteFunctionApiBinding", + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'deleteFunctionApiBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionDefinition.ts b/sdk/constructive-sdk/src/compute/orm/models/functionDefinition.ts index 4ca2f5b29f..be6cb3ac27 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionDefinition.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionDefinition.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDefinition, FunctionDefinitionWithRelations, FunctionDefinitionSelect, FunctionDefinitionFilter, FunctionDefinitionOrderBy, CreateFunctionDefinitionInput, UpdateFunctionDefinitionInput, FunctionDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDefinition, + FunctionDefinitionWithRelations, + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, + CreateFunctionDefinitionInput, + UpdateFunctionDefinitionInput, + FunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinitions", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinition", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDefinition": data.functionDefinitions?.nodes?.[0] ?? null - }) + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDefinition", "functionDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDefinitionFilter", "FunctionDefinitionOrderBy", connectionFieldsMap); + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDefinition", - fieldName: "functionDefinition", + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDefinition": data.functionDefinitions?.nodes?.[0] ?? null - }) + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDefinition", "createFunctionDefinition", "functionDefinition", args.select, args.data, "CreateFunctionDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDefinition', + 'createFunctionDefinition', + 'functionDefinition', + args.select, + args.data, + 'CreateFunctionDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "createFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'createFunctionDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDefinition", "updateFunctionDefinition", "functionDefinition", args.select, args.where.id, args.data, "UpdateFunctionDefinitionInput", "id", "functionDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDefinition', + 'updateFunctionDefinition', + 'functionDefinition', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDefinitionInput', + 'id', + 'functionDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "updateFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'updateFunctionDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDefinition: { functionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDefinition", "deleteFunctionDefinition", "functionDefinition", { - id: args.where.id - }, "DeleteFunctionDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDefinition', + 'deleteFunctionDefinition', + 'functionDefinition', + { + id: args.where.id, + }, + 'DeleteFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDefinition", - fieldName: "deleteFunctionDefinition", + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'deleteFunctionDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionDeployment.ts b/sdk/constructive-sdk/src/compute/orm/models/functionDeployment.ts index 7470fc406f..d54820ebba 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionDeployment.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionDeployment.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeployment, FunctionDeploymentWithRelations, FunctionDeploymentSelect, FunctionDeploymentFilter, FunctionDeploymentOrderBy, CreateFunctionDeploymentInput, UpdateFunctionDeploymentInput, FunctionDeploymentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeployment, + FunctionDeploymentWithRelations, + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, + CreateFunctionDeploymentInput, + UpdateFunctionDeploymentInput, + FunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployments: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeployment", "functionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployments", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployments', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployment: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeployment", "functionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployment", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeployment": data.functionDeployments?.nodes?.[0] ?? null - }) + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeployment: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeployment", "functionDeployments", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentFilter", "FunctionDeploymentOrderBy", connectionFieldsMap); + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeployment", - fieldName: "functionDeployment", + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeployment": data.functionDeployments?.nodes?.[0] ?? null - }) + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeployment", "createFunctionDeployment", "functionDeployment", args.select, args.data, "CreateFunctionDeploymentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeployment', + 'createFunctionDeployment', + 'functionDeployment', + args.select, + args.data, + 'CreateFunctionDeploymentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "createFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'createFunctionDeployment', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeployment", "updateFunctionDeployment", "functionDeployment", args.select, args.where.id, args.data, "UpdateFunctionDeploymentInput", "id", "functionDeploymentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeployment', + 'updateFunctionDeployment', + 'functionDeployment', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentInput', + 'id', + 'functionDeploymentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "updateFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'updateFunctionDeployment', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeployment: { functionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeployment", "deleteFunctionDeployment", "functionDeployment", { - id: args.where.id - }, "DeleteFunctionDeploymentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeployment', + 'deleteFunctionDeployment', + 'functionDeployment', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeployment", - fieldName: "deleteFunctionDeployment", + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'deleteFunctionDeployment', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionDeploymentEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/functionDeploymentEvent.ts index 1f61187c84..6b95be6471 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionDeploymentEvent.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionDeploymentEvent.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeploymentEvent, FunctionDeploymentEventWithRelations, FunctionDeploymentEventSelect, FunctionDeploymentEventFilter, FunctionDeploymentEventOrderBy, CreateFunctionDeploymentEventInput, UpdateFunctionDeploymentEventInput, FunctionDeploymentEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentEvent, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, + CreateFunctionDeploymentEventInput, + UpdateFunctionDeploymentEventInput, + FunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionDeploymentEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvents", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvent", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentEvent": data.functionDeploymentEvents?.nodes?.[0] ?? null - }) + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentEvent", "functionDeploymentEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentEventFilter", "FunctionDeploymentEventOrderBy", connectionFieldsMap); + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentEvent", - fieldName: "functionDeploymentEvent", + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentEvent": data.functionDeploymentEvents?.nodes?.[0] ?? null - }) + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeploymentEvent", "createFunctionDeploymentEvent", "functionDeploymentEvent", args.select, args.data, "CreateFunctionDeploymentEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentEvent', + 'createFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.data, + 'CreateFunctionDeploymentEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "createFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'createFunctionDeploymentEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeploymentEvent", "updateFunctionDeploymentEvent", "functionDeploymentEvent", args.select, args.where.id, args.data, "UpdateFunctionDeploymentEventInput", "id", "functionDeploymentEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentEvent', + 'updateFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentEventInput', + 'id', + 'functionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "updateFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'updateFunctionDeploymentEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeploymentEvent: { functionDeploymentEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeploymentEvent", "deleteFunctionDeploymentEvent", "functionDeploymentEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionDeploymentEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentEvent', + 'deleteFunctionDeploymentEvent', + 'functionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentEvent", - fieldName: "deleteFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'deleteFunctionDeploymentEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionExecutionLog.ts b/sdk/constructive-sdk/src/compute/orm/models/functionExecutionLog.ts index f1249a036a..a581eeab83 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionExecutionLog.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionExecutionLog.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionExecutionLog, FunctionExecutionLogWithRelations, FunctionExecutionLogSelect, FunctionExecutionLogFilter, FunctionExecutionLogOrderBy, CreateFunctionExecutionLogInput, UpdateFunctionExecutionLogInput, FunctionExecutionLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionExecutionLog, + FunctionExecutionLogWithRelations, + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, + CreateFunctionExecutionLogInput, + UpdateFunctionExecutionLogInput, + FunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionExecutionLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionExecutionLogs: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLogs", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionExecutionLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLog", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionExecutionLog": data.functionExecutionLogs?.nodes?.[0] ?? null - }) + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionExecutionLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionExecutionLog", "functionExecutionLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionExecutionLogFilter", "FunctionExecutionLogOrderBy", connectionFieldsMap); + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionExecutionLog", - fieldName: "functionExecutionLog", + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionExecutionLog": data.functionExecutionLogs?.nodes?.[0] ?? null - }) + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionExecutionLog", "createFunctionExecutionLog", "functionExecutionLog", args.select, args.data, "CreateFunctionExecutionLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionExecutionLog', + 'createFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.data, + 'CreateFunctionExecutionLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "createFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'createFunctionExecutionLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionExecutionLog", "updateFunctionExecutionLog", "functionExecutionLog", args.select, args.where.id, args.data, "UpdateFunctionExecutionLogInput", "id", "functionExecutionLogPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionExecutionLog', + 'updateFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateFunctionExecutionLogInput', + 'id', + 'functionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "updateFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'updateFunctionExecutionLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionExecutionLog: { functionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionExecutionLog", "deleteFunctionExecutionLog", "functionExecutionLog", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionExecutionLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionExecutionLog', + 'deleteFunctionExecutionLog', + 'functionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionExecutionLog", - fieldName: "deleteFunctionExecutionLog", + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'deleteFunctionExecutionLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraph.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraph.ts index b06366eed7..8355e31658 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionGraph.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraph.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraph, FunctionGraphWithRelations, FunctionGraphSelect, FunctionGraphFilter, FunctionGraphOrderBy, CreateFunctionGraphInput, UpdateFunctionGraphInput, FunctionGraphPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraph, + FunctionGraphWithRelations, + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy, + CreateFunctionGraphInput, + UpdateFunctionGraphInput, + FunctionGraphPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraph", "functionGraphs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraphs", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraphs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraph: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraph", "functionGraphs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraph", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraph": data.functionGraphs?.nodes?.[0] ?? null - }) + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraph: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraph", "functionGraphs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphFilter", "FunctionGraphOrderBy", connectionFieldsMap); + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraph", - fieldName: "functionGraph", + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionGraphModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraph": data.functionGraphs?.nodes?.[0] ?? null - }) + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraph", "createFunctionGraph", "functionGraph", args.select, args.data, "CreateFunctionGraphInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraph', + 'createFunctionGraph', + 'functionGraph', + args.select, + args.data, + 'CreateFunctionGraphInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "createFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'createFunctionGraph', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraph", "updateFunctionGraph", "functionGraph", args.select, args.where.id, args.data, "UpdateFunctionGraphInput", "id", "functionGraphPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraph', + 'updateFunctionGraph', + 'functionGraph', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphInput', + 'id', + 'functionGraphPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "updateFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'updateFunctionGraph', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraph: { functionGraph: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraph", "deleteFunctionGraph", "functionGraph", { - id: args.where.id - }, "DeleteFunctionGraphInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraph', + 'deleteFunctionGraph', + 'functionGraph', + { + id: args.where.id, + }, + 'DeleteFunctionGraphInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraph", - fieldName: "deleteFunctionGraph", + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'deleteFunctionGraph', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphCommit.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphCommit.ts index fc4f86a006..cd7d7dad08 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionGraphCommit.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphCommit.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphCommit, FunctionGraphCommitWithRelations, FunctionGraphCommitSelect, FunctionGraphCommitFilter, FunctionGraphCommitOrderBy, CreateFunctionGraphCommitInput, UpdateFunctionGraphCommitInput, FunctionGraphCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphCommit, + FunctionGraphCommitWithRelations, + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, + CreateFunctionGraphCommitInput, + UpdateFunctionGraphCommitInput, + FunctionGraphCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommits", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommit", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphCommit": data.functionGraphCommits?.nodes?.[0] ?? null - }) + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphCommit", "functionGraphCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphCommitFilter", "FunctionGraphCommitOrderBy", connectionFieldsMap); + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphCommit", - fieldName: "functionGraphCommit", + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionGraphCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphCommit": data.functionGraphCommits?.nodes?.[0] ?? null - }) + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphCommit", "createFunctionGraphCommit", "functionGraphCommit", args.select, args.data, "CreateFunctionGraphCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphCommit', + 'createFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.data, + 'CreateFunctionGraphCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "createFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'createFunctionGraphCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphCommit", "updateFunctionGraphCommit", "functionGraphCommit", args.select, args.where.id, args.data, "UpdateFunctionGraphCommitInput", "id", "functionGraphCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphCommit', + 'updateFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphCommitInput', + 'id', + 'functionGraphCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "updateFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'updateFunctionGraphCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphCommit: { functionGraphCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphCommit", "deleteFunctionGraphCommit", "functionGraphCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphCommit', + 'deleteFunctionGraphCommit', + 'functionGraphCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphCommit", - fieldName: "deleteFunctionGraphCommit", + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'deleteFunctionGraphCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecution.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecution.ts index 19bf0d3f80..36ba0d39b8 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecution.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecution.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecution, FunctionGraphExecutionWithRelations, FunctionGraphExecutionSelect, FunctionGraphExecutionFilter, FunctionGraphExecutionOrderBy, CreateFunctionGraphExecutionInput, UpdateFunctionGraphExecutionInput, FunctionGraphExecutionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecution, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, + CreateFunctionGraphExecutionInput, + UpdateFunctionGraphExecutionInput, + FunctionGraphExecutionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecutions", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecutions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphExecution: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecution", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionGraphExecutionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecution": data.functionGraphExecutions?.nodes?.[0] ?? null - }) + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphExecution: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecution", "functionGraphExecutions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionFilter", "FunctionGraphExecutionOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecution", - fieldName: "functionGraphExecution", + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionGraphExecutionModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecution": data.functionGraphExecutions?.nodes?.[0] ?? null - }) + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecution", "createFunctionGraphExecution", "functionGraphExecution", args.select, args.data, "CreateFunctionGraphExecutionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecution', + 'createFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.data, + 'CreateFunctionGraphExecutionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "createFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'createFunctionGraphExecution', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + startedAt: string; + }, + FunctionGraphExecutionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecution", "updateFunctionGraphExecution", "functionGraphExecution", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionInput", "id", "functionGraphExecutionPatch", connectionFieldsMap, { - startedAt: args.where.startedAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecution', + 'updateFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionInput', + 'id', + 'functionGraphExecutionPatch', + connectionFieldsMap, + { + startedAt: args.where.startedAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "updateFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'updateFunctionGraphExecution', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - startedAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + startedAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecution", "deleteFunctionGraphExecution", "functionGraphExecution", { - id: args.where.id, - startedAt: args.where.startedAt - }, "DeleteFunctionGraphExecutionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecution', + 'deleteFunctionGraphExecution', + 'functionGraphExecution', + { + id: args.where.id, + startedAt: args.where.startedAt, + }, + 'DeleteFunctionGraphExecutionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecution", - fieldName: "deleteFunctionGraphExecution", + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'deleteFunctionGraphExecution', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionNodeState.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionNodeState.ts index 8640ca634a..734317c006 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionNodeState.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionNodeState.ts @@ -3,56 +3,109 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecutionNodeState, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy, CreateFunctionGraphExecutionNodeStateInput, UpdateFunctionGraphExecutionNodeStateInput, FunctionGraphExecutionNodeStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionNodeState, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, + CreateFunctionGraphExecutionNodeStateInput, + UpdateFunctionGraphExecutionNodeStateInput, + FunctionGraphExecutionNodeStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionNodeStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeStates: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeStates", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeState: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeState", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class FunctionGraphExecutionNodeStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionNodeState": data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null - }) + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionNodeState: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionNodeState", "functionGraphExecutionNodeStates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionNodeStateFilter", "FunctionGraphExecutionNodeStateOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "functionGraphExecutionNodeState", + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', document, variables, transform: (data: { @@ -93,79 +156,123 @@ export class FunctionGraphExecutionNodeStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionNodeState": data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null - }) + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecutionNodeState", "createFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", args.select, args.data, "CreateFunctionGraphExecutionNodeStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionNodeState', + 'createFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.data, + 'CreateFunctionGraphExecutionNodeStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "createFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'createFunctionGraphExecutionNodeState', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionNodeStatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecutionNodeState", "updateFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionNodeStateInput", "id", "functionGraphExecutionNodeStatePatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionNodeState', + 'updateFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionNodeStateInput', + 'id', + 'functionGraphExecutionNodeStatePatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "updateFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'updateFunctionGraphExecutionNodeState', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecutionNodeState: { - functionGraphExecutionNodeState: InferSelectResult; + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecutionNodeState", "deleteFunctionGraphExecutionNodeState", "functionGraphExecutionNodeState", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionGraphExecutionNodeStateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionNodeState', + 'deleteFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionNodeStateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionNodeState", - fieldName: "deleteFunctionGraphExecutionNodeState", + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'deleteFunctionGraphExecutionNodeState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionOutput.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionOutput.ts index f2353e75de..c9a5085e5e 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionOutput.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionOutput.ts @@ -3,56 +3,109 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphExecutionOutput, FunctionGraphExecutionOutputWithRelations, FunctionGraphExecutionOutputSelect, FunctionGraphExecutionOutputFilter, FunctionGraphExecutionOutputOrderBy, CreateFunctionGraphExecutionOutputInput, UpdateFunctionGraphExecutionOutputInput, FunctionGraphExecutionOutputPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionOutput, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, + CreateFunctionGraphExecutionOutputInput, + UpdateFunctionGraphExecutionOutputInput, + FunctionGraphExecutionOutputPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionOutputModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutputs: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutputs", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutputs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutput: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutput", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class FunctionGraphExecutionOutputModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionOutput": data.functionGraphExecutionOutputs?.nodes?.[0] ?? null - }) + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - functionGraphExecutionOutput: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphExecutionOutput", "functionGraphExecutionOutputs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphExecutionOutputFilter", "FunctionGraphExecutionOutputOrderBy", connectionFieldsMap); + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphExecutionOutput", - fieldName: "functionGraphExecutionOutput", + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class FunctionGraphExecutionOutputModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphExecutionOutput": data.functionGraphExecutionOutputs?.nodes?.[0] ?? null - }) + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphExecutionOutput", "createFunctionGraphExecutionOutput", "functionGraphExecutionOutput", args.select, args.data, "CreateFunctionGraphExecutionOutputInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionOutput', + 'createFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.data, + 'CreateFunctionGraphExecutionOutputInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "createFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'createFunctionGraphExecutionOutput', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionOutputPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphExecutionOutput", "updateFunctionGraphExecutionOutput", "functionGraphExecutionOutput", args.select, args.where.id, args.data, "UpdateFunctionGraphExecutionOutputInput", "id", "functionGraphExecutionOutputPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionOutput', + 'updateFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionOutputInput', + 'id', + 'functionGraphExecutionOutputPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "updateFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'updateFunctionGraphExecutionOutput', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphExecutionOutput: { functionGraphExecutionOutput: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphExecutionOutput", "deleteFunctionGraphExecutionOutput", "functionGraphExecutionOutput", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionGraphExecutionOutputInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionOutput', + 'deleteFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionOutputInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphExecutionOutput", - fieldName: "deleteFunctionGraphExecutionOutput", + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'deleteFunctionGraphExecutionOutput', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphObject.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphObject.ts index fecd1e433b..d1f358a726 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionGraphObject.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphObject.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphObject, FunctionGraphObjectWithRelations, FunctionGraphObjectSelect, FunctionGraphObjectFilter, FunctionGraphObjectOrderBy, CreateFunctionGraphObjectInput, UpdateFunctionGraphObjectInput, FunctionGraphObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphObject, + FunctionGraphObjectWithRelations, + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, + CreateFunctionGraphObjectInput, + UpdateFunctionGraphObjectInput, + FunctionGraphObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphObject", "functionGraphObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphObjectFilter", "FunctionGraphObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObjects", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphObject", "functionGraphObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphObjectFilter", "FunctionGraphObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObject", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class FunctionGraphObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphObject": data.functionGraphObjects?.nodes?.[0] ?? null - }) + functionGraphObject: data.functionGraphObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("FunctionGraphObject", "getNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'FunctionGraphObject', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphObject", - fieldName: "functionGraphObject", + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphObject", "createFunctionGraphObject", "functionGraphObject", args.select, args.data, "CreateFunctionGraphObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphObject', + 'createFunctionGraphObject', + 'functionGraphObject', + args.select, + args.data, + 'CreateFunctionGraphObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "createFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'createFunctionGraphObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphObject", "updateFunctionGraphObject", "functionGraphObject", args.select, args.where.id, args.data, "UpdateFunctionGraphObjectInput", "id", "functionGraphObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphObject', + 'updateFunctionGraphObject', + 'functionGraphObject', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphObjectInput', + 'id', + 'functionGraphObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "updateFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'updateFunctionGraphObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphObject: { functionGraphObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphObject", "deleteFunctionGraphObject", "functionGraphObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphObject', + 'deleteFunctionGraphObject', + 'functionGraphObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphObject", - fieldName: "deleteFunctionGraphObject", + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'deleteFunctionGraphObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphRef.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphRef.ts index 31993a8a93..c4ee3889eb 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionGraphRef.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphRef.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphRef, FunctionGraphRefWithRelations, FunctionGraphRefSelect, FunctionGraphRefFilter, FunctionGraphRefOrderBy, CreateFunctionGraphRefInput, UpdateFunctionGraphRefInput, FunctionGraphRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphRef, + FunctionGraphRefWithRelations, + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, + CreateFunctionGraphRefInput, + UpdateFunctionGraphRefInput, + FunctionGraphRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRefs", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRef", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphRef": data.functionGraphRefs?.nodes?.[0] ?? null - }) + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphRef", "functionGraphRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphRefFilter", "FunctionGraphRefOrderBy", connectionFieldsMap); + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphRef", - fieldName: "functionGraphRef", + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionGraphRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphRef": data.functionGraphRefs?.nodes?.[0] ?? null - }) + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphRef", "createFunctionGraphRef", "functionGraphRef", args.select, args.data, "CreateFunctionGraphRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphRef', + 'createFunctionGraphRef', + 'functionGraphRef', + args.select, + args.data, + 'CreateFunctionGraphRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "createFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'createFunctionGraphRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + FunctionGraphRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphRef", "updateFunctionGraphRef", "functionGraphRef", args.select, args.where.id, args.data, "UpdateFunctionGraphRefInput", "id", "functionGraphRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphRef', + 'updateFunctionGraphRef', + 'functionGraphRef', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphRefInput', + 'id', + 'functionGraphRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "updateFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'updateFunctionGraphRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphRef: { functionGraphRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphRef", "deleteFunctionGraphRef", "functionGraphRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeleteFunctionGraphRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphRef', + 'deleteFunctionGraphRef', + 'functionGraphRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeleteFunctionGraphRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphRef", - fieldName: "deleteFunctionGraphRef", + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'deleteFunctionGraphRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphStore.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphStore.ts index c4d13ac9ee..6d1f384449 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionGraphStore.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphStore.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionGraphStore, FunctionGraphStoreWithRelations, FunctionGraphStoreSelect, FunctionGraphStoreFilter, FunctionGraphStoreOrderBy, CreateFunctionGraphStoreInput, UpdateFunctionGraphStoreInput, FunctionGraphStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphStore, + FunctionGraphStoreWithRelations, + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, + CreateFunctionGraphStoreInput, + UpdateFunctionGraphStoreInput, + FunctionGraphStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionGraphStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStores", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStore", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionGraphStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphStore": data.functionGraphStores?.nodes?.[0] ?? null - }) + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionGraphStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionGraphStore", "functionGraphStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionGraphStoreFilter", "FunctionGraphStoreOrderBy", connectionFieldsMap); + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionGraphStore", - fieldName: "functionGraphStore", + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionGraphStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionGraphStore": data.functionGraphStores?.nodes?.[0] ?? null - }) + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionGraphStore", "createFunctionGraphStore", "functionGraphStore", args.select, args.data, "CreateFunctionGraphStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionGraphStore', + 'createFunctionGraphStore', + 'functionGraphStore', + args.select, + args.data, + 'CreateFunctionGraphStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "createFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'createFunctionGraphStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionGraphStore", "updateFunctionGraphStore", "functionGraphStore", args.select, args.where.id, args.data, "UpdateFunctionGraphStoreInput", "id", "functionGraphStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphStore', + 'updateFunctionGraphStore', + 'functionGraphStore', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphStoreInput', + 'id', + 'functionGraphStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "updateFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'updateFunctionGraphStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionGraphStore: { functionGraphStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionGraphStore", "deleteFunctionGraphStore", "functionGraphStore", { - id: args.where.id - }, "DeleteFunctionGraphStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphStore', + 'deleteFunctionGraphStore', + 'functionGraphStore', + { + id: args.where.id, + }, + 'DeleteFunctionGraphStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionGraphStore", - fieldName: "deleteFunctionGraphStore", + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'deleteFunctionGraphStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionInvocation.ts b/sdk/constructive-sdk/src/compute/orm/models/functionInvocation.ts index e9bd71267a..3589bf5a1d 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionInvocation.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionInvocation.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionInvocation, FunctionInvocationWithRelations, FunctionInvocationSelect, FunctionInvocationFilter, FunctionInvocationOrderBy, CreateFunctionInvocationInput, UpdateFunctionInvocationInput, FunctionInvocationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionInvocation, + FunctionInvocationWithRelations, + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy, + CreateFunctionInvocationInput, + UpdateFunctionInvocationInput, + FunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocation", "functionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocations", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocation", "functionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocation", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocation": data.functionInvocations?.nodes?.[0] ?? null - }) + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocation", "functionInvocations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationFilter", "FunctionInvocationOrderBy", connectionFieldsMap); + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocation", - fieldName: "functionInvocation", + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class FunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocation": data.functionInvocations?.nodes?.[0] ?? null - }) + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocation", "createFunctionInvocation", "functionInvocation", args.select, args.data, "CreateFunctionInvocationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocation', + 'createFunctionInvocation', + 'functionInvocation', + args.select, + args.data, + 'CreateFunctionInvocationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "createFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'createFunctionInvocation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocation", "updateFunctionInvocation", "functionInvocation", args.select, args.where.id, args.data, "UpdateFunctionInvocationInput", "id", "functionInvocationPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocation', + 'updateFunctionInvocation', + 'functionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationInput', + 'id', + 'functionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "updateFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'updateFunctionInvocation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocation: { functionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocation", "deleteFunctionInvocation", "functionInvocation", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionInvocationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocation', + 'deleteFunctionInvocation', + 'functionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocation", - fieldName: "deleteFunctionInvocation", + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'deleteFunctionInvocation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionInvocationAttempt.ts b/sdk/constructive-sdk/src/compute/orm/models/functionInvocationAttempt.ts index 3f660a869e..710ddec0b8 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/functionInvocationAttempt.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/functionInvocationAttempt.ts @@ -3,56 +3,98 @@ * @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 { FunctionInvocationAttempt, FunctionInvocationAttemptWithRelations, FunctionInvocationAttemptSelect, FunctionInvocationAttemptFilter, FunctionInvocationAttemptOrderBy, CreateFunctionInvocationAttemptInput, UpdateFunctionInvocationAttemptInput, FunctionInvocationAttemptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionInvocationAttempt, + FunctionInvocationAttemptWithRelations, + FunctionInvocationAttemptSelect, + FunctionInvocationAttemptFilter, + FunctionInvocationAttemptOrderBy, + CreateFunctionInvocationAttemptInput, + UpdateFunctionInvocationAttemptInput, + FunctionInvocationAttemptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationAttemptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionInvocationAttempts: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocationAttempts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationAttempt", "functionInvocationAttempts", 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 - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + 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, + }, + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempts", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationAttempt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocationAttempt", "functionInvocationAttempts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempt", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempt', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationAttempt": data.functionInvocationAttempts?.nodes?.[0] ?? null - }) + functionInvocationAttempt: data.functionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationAttempt: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationAttempt", "functionInvocationAttempts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationAttempt', + 'functionInvocationAttempts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationAttemptFilter", "FunctionInvocationAttemptOrderBy", connectionFieldsMap); + 'FunctionInvocationAttemptFilter', + 'FunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationAttempt", - fieldName: "functionInvocationAttempt", + operation: 'query', + operationName: 'FunctionInvocationAttempt', + fieldName: 'functionInvocationAttempt', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class FunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationAttempt": data.functionInvocationAttempts?.nodes?.[0] ?? null - }) + functionInvocationAttempt: data.functionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocationAttempt", "createFunctionInvocationAttempt", "functionInvocationAttempt", args.select, args.data, "CreateFunctionInvocationAttemptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocationAttempt', + 'createFunctionInvocationAttempt', + 'functionInvocationAttempt', + args.select, + args.data, + 'CreateFunctionInvocationAttemptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "createFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'createFunctionInvocationAttempt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationAttemptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocationAttempt", "updateFunctionInvocationAttempt", "functionInvocationAttempt", args.select, args.where.id, args.data, "UpdateFunctionInvocationAttemptInput", "id", "functionInvocationAttemptPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocationAttempt', + 'updateFunctionInvocationAttempt', + 'functionInvocationAttempt', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationAttemptInput', + 'id', + 'functionInvocationAttemptPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "updateFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'updateFunctionInvocationAttempt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocationAttempt: { functionInvocationAttempt: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocationAttempt", "deleteFunctionInvocationAttempt", "functionInvocationAttempt", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteFunctionInvocationAttemptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocationAttempt', + 'deleteFunctionInvocationAttempt', + 'functionInvocationAttempt', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationAttemptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationAttempt", - fieldName: "deleteFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'FunctionInvocationAttempt', + fieldName: 'deleteFunctionInvocationAttempt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/getAllTreeNodesRecord.ts b/sdk/constructive-sdk/src/compute/orm/models/getAllTreeNodesRecord.ts index bb9b696c09..00f51d01f7 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/getAllTreeNodesRecord.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/getAllTreeNodesRecord.ts @@ -3,56 +3,96 @@ * @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 { GetAllTreeNodesRecord, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy, CreateGetAllTreeNodesRecordInput, UpdateGetAllTreeNodesRecordInput, GetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GetAllTreeNodesRecord, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, + CreateGetAllTreeNodesRecordInput, + UpdateGetAllTreeNodesRecordInput, + GetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GetAllTreeNodesRecord", "getAllTreeNodes", 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 - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + 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, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodes", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodesRecord: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GetAllTreeNodesRecord", "getAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodesRecord", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class GetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "getAllTreeNodesRecord": data.getAllTreeNodes?.nodes?.[0] ?? null - }) + getAllTreeNodesRecord: data.getAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGetAllTreeNodesRecord: { getAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GetAllTreeNodesRecord", "createGetAllTreeNodesRecord", "getAllTreeNodesRecord", args.select, args.data, "CreateGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GetAllTreeNodesRecord', + 'createGetAllTreeNodesRecord', + 'getAllTreeNodesRecord', + args.select, + args.data, + 'CreateGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GetAllTreeNodesRecord", - fieldName: "createGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'createGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/index.ts b/sdk/constructive-sdk/src/compute/orm/models/index.ts index 90c96202f6..c06f5f3db6 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/index.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/index.ts @@ -3,70 +3,70 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { DbPresetModel } from "./dbPreset"; -export { FunctionApiBindingModel } from "./functionApiBinding"; -export { FunctionDefinitionModel } from "./functionDefinition"; -export { FunctionDeploymentModel } from "./functionDeployment"; -export { FunctionDeploymentEventModel } from "./functionDeploymentEvent"; -export { FunctionExecutionLogModel } from "./functionExecutionLog"; -export { FunctionGraphCommitModel } from "./functionGraphCommit"; -export { FunctionGraphModel } from "./functionGraph"; -export { FunctionGraphExecutionModel } from "./functionGraphExecution"; -export { FunctionGraphExecutionNodeStateModel } from "./functionGraphExecutionNodeState"; -export { FunctionGraphExecutionOutputModel } from "./functionGraphExecutionOutput"; -export { FunctionGraphObjectModel } from "./functionGraphObject"; -export { FunctionGraphRefModel } from "./functionGraphRef"; -export { FunctionGraphStoreModel } from "./functionGraphStore"; -export { FunctionInvocationAttemptModel } from "./functionInvocationAttempt"; -export { FunctionInvocationModel } from "./functionInvocation"; -export { GetAllTreeNodesRecordModel } from "./getAllTreeNodesRecord"; -export { InfraCommitModel } from "./infraCommit"; -export { InfraGetAllTreeNodesRecordModel } from "./infraGetAllTreeNodesRecord"; -export { InfraObjectModel } from "./infraObject"; -export { InfraRefModel } from "./infraRef"; -export { InfraStoreModel } from "./infraStore"; -export { IntegrationProviderModel } from "./integrationProvider"; -export { NamespaceModel } from "./namespace"; -export { NamespaceEventModel } from "./namespaceEvent"; -export { PlatformFunctionApiBindingModel } from "./platformFunctionApiBinding"; -export { PlatformFunctionDefinitionModel } from "./platformFunctionDefinition"; -export { PlatformFunctionDeploymentModel } from "./platformFunctionDeployment"; -export { PlatformFunctionDeploymentEventModel } from "./platformFunctionDeploymentEvent"; -export { PlatformFunctionExecutionLogModel } from "./platformFunctionExecutionLog"; -export { PlatformFunctionInvocationAttemptModel } from "./platformFunctionInvocationAttempt"; -export { PlatformFunctionInvocationModel } from "./platformFunctionInvocation"; -export { PlatformInfraCommitModel } from "./platformInfraCommit"; -export { PlatformInfraGetAllTreeNodesRecordModel } from "./platformInfraGetAllTreeNodesRecord"; -export { PlatformInfraObjectModel } from "./platformInfraObject"; -export { PlatformInfraRefModel } from "./platformInfraRef"; -export { PlatformInfraStoreModel } from "./platformInfraStore"; -export { PlatformNamespaceModel } from "./platformNamespace"; -export { PlatformNamespaceEventModel } from "./platformNamespaceEvent"; -export { PlatformResourceModel } from "./platformResource"; -export { PlatformResourceDeclaredCapacityModel } from "./platformResourceDeclaredCapacity"; -export { PlatformResourceDefinitionModel } from "./platformResourceDefinition"; -export { PlatformResourceEventModel } from "./platformResourceEvent"; -export { PlatformResourceInstallationModel } from "./platformResourceInstallation"; -export { PlatformResourceStatusCheckModel } from "./platformResourceStatusCheck"; -export { PlatformResourceUsageLogModel } from "./platformResourceUsageLog"; -export { PlatformResourceUsageSummaryModel } from "./platformResourceUsageSummary"; -export { PlatformResourceUtilizationModel } from "./platformResourceUtilization"; -export { PlatformResourcesHealthModel } from "./platformResourcesHealth"; -export { PlatformResourcesRequirementsStateModel } from "./platformResourcesRequirementsState"; -export { PlatformResourcesResolvedRequirementModel } from "./platformResourcesResolvedRequirement"; -export { PlatformWebhookEndpointModel } from "./platformWebhookEndpoint"; -export { PlatformWebhookEventModel } from "./platformWebhookEvent"; -export { ResourceModel } from "./resource"; -export { ResourceDeclaredCapacityModel } from "./resourceDeclaredCapacity"; -export { ResourceDefinitionModel } from "./resourceDefinition"; -export { ResourceEventModel } from "./resourceEvent"; -export { ResourceInstallationModel } from "./resourceInstallation"; -export { ResourceStatusCheckModel } from "./resourceStatusCheck"; -export { ResourceUsageLogModel } from "./resourceUsageLog"; -export { ResourceUsageSummaryModel } from "./resourceUsageSummary"; -export { ResourceUtilizationModel } from "./resourceUtilization"; -export { ResourcesHealthModel } from "./resourcesHealth"; -export { ResourcesRequirementsStateModel } from "./resourcesRequirementsState"; -export { ResourcesResolvedRequirementModel } from "./resourcesResolvedRequirement"; -export { WebhookEndpointModel } from "./webhookEndpoint"; -export { WebhookEventModel } from "./webhookEvent"; \ No newline at end of file +export { DbPresetModel } from './dbPreset'; +export { FunctionApiBindingModel } from './functionApiBinding'; +export { FunctionDefinitionModel } from './functionDefinition'; +export { FunctionDeploymentModel } from './functionDeployment'; +export { FunctionDeploymentEventModel } from './functionDeploymentEvent'; +export { FunctionExecutionLogModel } from './functionExecutionLog'; +export { FunctionGraphCommitModel } from './functionGraphCommit'; +export { FunctionGraphModel } from './functionGraph'; +export { FunctionGraphExecutionModel } from './functionGraphExecution'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; +export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutput'; +export { FunctionGraphObjectModel } from './functionGraphObject'; +export { FunctionGraphRefModel } from './functionGraphRef'; +export { FunctionGraphStoreModel } from './functionGraphStore'; +export { FunctionInvocationAttemptModel } from './functionInvocationAttempt'; +export { FunctionInvocationModel } from './functionInvocation'; +export { GetAllTreeNodesRecordModel } from './getAllTreeNodesRecord'; +export { InfraCommitModel } from './infraCommit'; +export { InfraGetAllTreeNodesRecordModel } from './infraGetAllTreeNodesRecord'; +export { InfraObjectModel } from './infraObject'; +export { InfraRefModel } from './infraRef'; +export { InfraStoreModel } from './infraStore'; +export { IntegrationProviderModel } from './integrationProvider'; +export { NamespaceModel } from './namespace'; +export { NamespaceEventModel } from './namespaceEvent'; +export { PlatformFunctionApiBindingModel } from './platformFunctionApiBinding'; +export { PlatformFunctionDefinitionModel } from './platformFunctionDefinition'; +export { PlatformFunctionDeploymentModel } from './platformFunctionDeployment'; +export { PlatformFunctionDeploymentEventModel } from './platformFunctionDeploymentEvent'; +export { PlatformFunctionExecutionLogModel } from './platformFunctionExecutionLog'; +export { PlatformFunctionInvocationAttemptModel } from './platformFunctionInvocationAttempt'; +export { PlatformFunctionInvocationModel } from './platformFunctionInvocation'; +export { PlatformInfraCommitModel } from './platformInfraCommit'; +export { PlatformInfraGetAllTreeNodesRecordModel } from './platformInfraGetAllTreeNodesRecord'; +export { PlatformInfraObjectModel } from './platformInfraObject'; +export { PlatformInfraRefModel } from './platformInfraRef'; +export { PlatformInfraStoreModel } from './platformInfraStore'; +export { PlatformNamespaceModel } from './platformNamespace'; +export { PlatformNamespaceEventModel } from './platformNamespaceEvent'; +export { PlatformResourceModel } from './platformResource'; +export { PlatformResourceDeclaredCapacityModel } from './platformResourceDeclaredCapacity'; +export { PlatformResourceDefinitionModel } from './platformResourceDefinition'; +export { PlatformResourceEventModel } from './platformResourceEvent'; +export { PlatformResourceInstallationModel } from './platformResourceInstallation'; +export { PlatformResourceStatusCheckModel } from './platformResourceStatusCheck'; +export { PlatformResourceUsageLogModel } from './platformResourceUsageLog'; +export { PlatformResourceUsageSummaryModel } from './platformResourceUsageSummary'; +export { PlatformResourceUtilizationModel } from './platformResourceUtilization'; +export { PlatformResourcesHealthModel } from './platformResourcesHealth'; +export { PlatformResourcesRequirementsStateModel } from './platformResourcesRequirementsState'; +export { PlatformResourcesResolvedRequirementModel } from './platformResourcesResolvedRequirement'; +export { PlatformWebhookEndpointModel } from './platformWebhookEndpoint'; +export { PlatformWebhookEventModel } from './platformWebhookEvent'; +export { ResourceModel } from './resource'; +export { ResourceDeclaredCapacityModel } from './resourceDeclaredCapacity'; +export { ResourceDefinitionModel } from './resourceDefinition'; +export { ResourceEventModel } from './resourceEvent'; +export { ResourceInstallationModel } from './resourceInstallation'; +export { ResourceStatusCheckModel } from './resourceStatusCheck'; +export { ResourceUsageLogModel } from './resourceUsageLog'; +export { ResourceUsageSummaryModel } from './resourceUsageSummary'; +export { ResourceUtilizationModel } from './resourceUtilization'; +export { ResourcesHealthModel } from './resourcesHealth'; +export { ResourcesRequirementsStateModel } from './resourcesRequirementsState'; +export { ResourcesResolvedRequirementModel } from './resourcesResolvedRequirement'; +export { WebhookEndpointModel } from './webhookEndpoint'; +export { WebhookEventModel } from './webhookEvent'; diff --git a/sdk/constructive-sdk/src/compute/orm/models/infraCommit.ts b/sdk/constructive-sdk/src/compute/orm/models/infraCommit.ts index 657f82c32c..379750f7f9 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/infraCommit.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/infraCommit.ts @@ -3,56 +3,96 @@ * @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 { InfraCommit, InfraCommitWithRelations, InfraCommitSelect, InfraCommitFilter, InfraCommitOrderBy, CreateInfraCommitInput, UpdateInfraCommitInput, InfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraCommit, + InfraCommitWithRelations, + InfraCommitSelect, + InfraCommitFilter, + InfraCommitOrderBy, + CreateInfraCommitInput, + UpdateInfraCommitInput, + InfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraCommit", "infraCommits", 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 - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraCommit', + 'infraCommits', + 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, + }, + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommits", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraCommit", "infraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraCommit', + 'infraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommit", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraCommit": data.infraCommits?.nodes?.[0] ?? null - }) + infraCommit: data.infraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraCommit", "infraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraCommit', + 'infraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraCommitFilter", "InfraCommitOrderBy", connectionFieldsMap); + 'InfraCommitFilter', + 'InfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraCommit", - fieldName: "infraCommit", + operation: 'query', + operationName: 'InfraCommit', + fieldName: 'infraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class InfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraCommit": data.infraCommits?.nodes?.[0] ?? null - }) + infraCommit: data.infraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraCommit", "createInfraCommit", "infraCommit", args.select, args.data, "CreateInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraCommit', + 'createInfraCommit', + 'infraCommit', + args.select, + args.data, + 'CreateInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "createInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'createInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraCommit", "updateInfraCommit", "infraCommit", args.select, args.where.id, args.data, "UpdateInfraCommitInput", "id", "infraCommitPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraCommit', + 'updateInfraCommit', + 'infraCommit', + args.select, + args.where.id, + args.data, + 'UpdateInfraCommitInput', + 'id', + 'infraCommitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "updateInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'updateInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraCommit: { infraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraCommit", "deleteInfraCommit", "infraCommit", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraCommit', + 'deleteInfraCommit', + 'infraCommit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraCommit", - fieldName: "deleteInfraCommit", + operation: 'mutation', + operationName: 'InfraCommit', + fieldName: 'deleteInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/infraGetAllTreeNodesRecord.ts b/sdk/constructive-sdk/src/compute/orm/models/infraGetAllTreeNodesRecord.ts index 8df5146d17..7f2e31d467 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/infraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/infraGetAllTreeNodesRecord.ts @@ -3,56 +3,101 @@ * @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 { InfraGetAllTreeNodesRecord, InfraGetAllTreeNodesRecordWithRelations, InfraGetAllTreeNodesRecordSelect, InfraGetAllTreeNodesRecordFilter, InfraGetAllTreeNodesRecordsOrderBy, CreateInfraGetAllTreeNodesRecordInput, UpdateInfraGetAllTreeNodesRecordInput, InfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraGetAllTreeNodesRecord, + InfraGetAllTreeNodesRecordWithRelations, + InfraGetAllTreeNodesRecordSelect, + InfraGetAllTreeNodesRecordFilter, + InfraGetAllTreeNodesRecordsOrderBy, + CreateInfraGetAllTreeNodesRecordInput, + UpdateInfraGetAllTreeNodesRecordInput, + InfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - infraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + infraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("InfraGetAllTreeNodesRecord", "infraGetAllTreeNodes", 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 - }, "InfraGetAllTreeNodesRecordFilter", "InfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodes', + 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, + }, + 'InfraGetAllTreeNodesRecordFilter', + 'InfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "infraGetAllTreeNodes", + operation: 'query', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'infraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - infraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + infraGetAllTreeNodesRecord: InferSelectResult< + InfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraGetAllTreeNodesRecord", "infraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraGetAllTreeNodesRecordFilter", "InfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraGetAllTreeNodesRecordFilter', + 'InfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "infraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'infraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +105,35 @@ export class InfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraGetAllTreeNodesRecord": data.infraGetAllTreeNodes?.nodes?.[0] ?? null - }) + infraGetAllTreeNodesRecord: data.infraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraGetAllTreeNodesRecord: { infraGetAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraGetAllTreeNodesRecord", "createInfraGetAllTreeNodesRecord", "infraGetAllTreeNodesRecord", args.select, args.data, "CreateInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraGetAllTreeNodesRecord', + 'createInfraGetAllTreeNodesRecord', + 'infraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreateInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraGetAllTreeNodesRecord", - fieldName: "createInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'InfraGetAllTreeNodesRecord', + fieldName: 'createInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/infraObject.ts b/sdk/constructive-sdk/src/compute/orm/models/infraObject.ts index c6a0b8eb4e..ef01fc62a4 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/infraObject.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/infraObject.ts @@ -3,56 +3,96 @@ * @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 { InfraObject, InfraObjectWithRelations, InfraObjectSelect, InfraObjectFilter, InfraObjectOrderBy, CreateInfraObjectInput, UpdateInfraObjectInput, InfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraObject, + InfraObjectWithRelations, + InfraObjectSelect, + InfraObjectFilter, + InfraObjectOrderBy, + CreateInfraObjectInput, + UpdateInfraObjectInput, + InfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraObject", "infraObjects", 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 - }, "InfraObjectFilter", "InfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraObject', + 'infraObjects', + 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, + }, + 'InfraObjectFilter', + 'InfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObjects", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraObject", "infraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraObjectFilter", "InfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraObject', + 'infraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraObjectFilter', + 'InfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObject", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class InfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraObject": data.infraObjects?.nodes?.[0] ?? null - }) + infraObject: data.infraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("InfraObject", "infraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'InfraObject', + 'infraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraObject", - fieldName: "infraObject", + operation: 'query', + operationName: 'InfraObject', + fieldName: 'infraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraObject", "createInfraObject", "infraObject", args.select, args.data, "CreateInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraObject', + 'createInfraObject', + 'infraObject', + args.select, + args.data, + 'CreateInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "createInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'createInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraObject", "updateInfraObject", "infraObject", args.select, args.where.id, args.data, "UpdateInfraObjectInput", "id", "infraObjectPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraObject', + 'updateInfraObject', + 'infraObject', + args.select, + args.where.id, + args.data, + 'UpdateInfraObjectInput', + 'id', + 'infraObjectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "updateInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'updateInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraObject: { infraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraObject", "deleteInfraObject", "infraObject", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraObject', + 'deleteInfraObject', + 'infraObject', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraObject", - fieldName: "deleteInfraObject", + operation: 'mutation', + operationName: 'InfraObject', + fieldName: 'deleteInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/infraRef.ts b/sdk/constructive-sdk/src/compute/orm/models/infraRef.ts index 57fdd343e9..bcc1a9d568 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/infraRef.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/infraRef.ts @@ -3,56 +3,96 @@ * @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 { InfraRef, InfraRefWithRelations, InfraRefSelect, InfraRefFilter, InfraRefOrderBy, CreateInfraRefInput, UpdateInfraRefInput, InfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraRef, + InfraRefWithRelations, + InfraRefSelect, + InfraRefFilter, + InfraRefOrderBy, + CreateInfraRefInput, + UpdateInfraRefInput, + InfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraRef", "infraRefs", 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 - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraRef', + 'infraRefs', + 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, + }, + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRefs", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraRef", "infraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraRef', + 'infraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRef", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraRef": data.infraRefs?.nodes?.[0] ?? null - }) + infraRef: data.infraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraRef", "infraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraRef', + 'infraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraRefFilter", "InfraRefOrderBy", connectionFieldsMap); + 'InfraRefFilter', + 'InfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraRef", - fieldName: "infraRef", + operation: 'query', + operationName: 'InfraRef', + fieldName: 'infraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class InfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraRef": data.infraRefs?.nodes?.[0] ?? null - }) + infraRef: data.infraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraRef", "createInfraRef", "infraRef", args.select, args.data, "CreateInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraRef', + 'createInfraRef', + 'infraRef', + args.select, + args.data, + 'CreateInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "createInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'createInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + InfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraRef", "updateInfraRef", "infraRef", args.select, args.where.id, args.data, "UpdateInfraRefInput", "id", "infraRefPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'InfraRef', + 'updateInfraRef', + 'infraRef', + args.select, + args.where.id, + args.data, + 'UpdateInfraRefInput', + 'id', + 'infraRefPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "updateInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'updateInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraRef: { infraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraRef", "deleteInfraRef", "infraRef", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraRef', + 'deleteInfraRef', + 'infraRef', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraRef", - fieldName: "deleteInfraRef", + operation: 'mutation', + operationName: 'InfraRef', + fieldName: 'deleteInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/infraStore.ts b/sdk/constructive-sdk/src/compute/orm/models/infraStore.ts index 3d2d19bdcc..a0ed0dbe7b 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/infraStore.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/infraStore.ts @@ -3,56 +3,96 @@ * @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 { InfraStore, InfraStoreWithRelations, InfraStoreSelect, InfraStoreFilter, InfraStoreOrderBy, CreateInfraStoreInput, UpdateInfraStoreInput, InfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraStore, + InfraStoreWithRelations, + InfraStoreSelect, + InfraStoreFilter, + InfraStoreOrderBy, + CreateInfraStoreInput, + UpdateInfraStoreInput, + InfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraStore", "infraStores", 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 - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraStore', + 'infraStores', + 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, + }, + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStores", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraStore", "infraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraStore', + 'infraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStore", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraStore": data.infraStores?.nodes?.[0] ?? null - }) + infraStore: data.infraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraStore", "infraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraStore', + 'infraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraStoreFilter", "InfraStoreOrderBy", connectionFieldsMap); + 'InfraStoreFilter', + 'InfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraStore", - fieldName: "infraStore", + operation: 'query', + operationName: 'InfraStore', + fieldName: 'infraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraStore": data.infraStores?.nodes?.[0] ?? null - }) + infraStore: data.infraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraStore", "createInfraStore", "infraStore", args.select, args.data, "CreateInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraStore', + 'createInfraStore', + 'infraStore', + args.select, + args.data, + 'CreateInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "createInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'createInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraStore", "updateInfraStore", "infraStore", args.select, args.where.id, args.data, "UpdateInfraStoreInput", "id", "infraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraStore', + 'updateInfraStore', + 'infraStore', + args.select, + args.where.id, + args.data, + 'UpdateInfraStoreInput', + 'id', + 'infraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "updateInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'updateInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraStore: { infraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraStore", "deleteInfraStore", "infraStore", { - id: args.where.id - }, "DeleteInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraStore', + 'deleteInfraStore', + 'infraStore', + { + id: args.where.id, + }, + 'DeleteInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraStore", - fieldName: "deleteInfraStore", + operation: 'mutation', + operationName: 'InfraStore', + fieldName: 'deleteInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/integrationProvider.ts b/sdk/constructive-sdk/src/compute/orm/models/integrationProvider.ts index bd4fa0c4d6..c79ad9375c 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/integrationProvider.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/integrationProvider.ts @@ -3,56 +3,96 @@ * @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 { IntegrationProvider, IntegrationProviderWithRelations, IntegrationProviderSelect, IntegrationProviderFilter, IntegrationProviderOrderBy, CreateIntegrationProviderInput, UpdateIntegrationProviderInput, IntegrationProviderPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IntegrationProvider, + IntegrationProviderWithRelations, + IntegrationProviderSelect, + IntegrationProviderFilter, + IntegrationProviderOrderBy, + CreateIntegrationProviderInput, + UpdateIntegrationProviderInput, + IntegrationProviderPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IntegrationProviderModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProviders: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvider", "integrationProviders", 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 - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IntegrationProvider', + 'integrationProviders', + 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, + }, + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProviders", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProviders', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IntegrationProvider", "integrationProviders", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IntegrationProvider', + 'integrationProviders', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProvider", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProvider', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class IntegrationProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvider": data.integrationProviders?.nodes?.[0] ?? null - }) + integrationProvider: data.integrationProviders?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ integrationProvider: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvider", "integrationProviders", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IntegrationProvider', + 'integrationProviders', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IntegrationProviderFilter", "IntegrationProviderOrderBy", connectionFieldsMap); + 'IntegrationProviderFilter', + 'IntegrationProviderOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvider", - fieldName: "integrationProvider", + operation: 'query', + operationName: 'IntegrationProvider', + fieldName: 'integrationProvider', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class IntegrationProviderModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvider": data.integrationProviders?.nodes?.[0] ?? null - }) + integrationProvider: data.integrationProviders?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IntegrationProvider", "createIntegrationProvider", "integrationProvider", args.select, args.data, "CreateIntegrationProviderInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IntegrationProvider', + 'createIntegrationProvider', + 'integrationProvider', + args.select, + args.data, + 'CreateIntegrationProviderInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "createIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'createIntegrationProvider', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IntegrationProviderPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IntegrationProvider", "updateIntegrationProvider", "integrationProvider", args.select, args.where.id, args.data, "UpdateIntegrationProviderInput", "id", "integrationProviderPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IntegrationProvider', + 'updateIntegrationProvider', + 'integrationProvider', + args.select, + args.where.id, + args.data, + 'UpdateIntegrationProviderInput', + 'id', + 'integrationProviderPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "updateIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'updateIntegrationProvider', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIntegrationProvider: { integrationProvider: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IntegrationProvider", "deleteIntegrationProvider", "integrationProvider", { - id: args.where.id - }, "DeleteIntegrationProviderInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IntegrationProvider', + 'deleteIntegrationProvider', + 'integrationProvider', + { + id: args.where.id, + }, + 'DeleteIntegrationProviderInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvider", - fieldName: "deleteIntegrationProvider", + operation: 'mutation', + operationName: 'IntegrationProvider', + fieldName: 'deleteIntegrationProvider', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/namespace.ts b/sdk/constructive-sdk/src/compute/orm/models/namespace.ts index 8c2bf42876..4e300068cd 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/namespace.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/namespace.ts @@ -3,56 +3,96 @@ * @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 { Namespace, NamespaceWithRelations, NamespaceSelect, NamespaceFilter, NamespaceOrderBy, CreateNamespaceInput, UpdateNamespaceInput, NamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Namespace, + NamespaceWithRelations, + NamespaceSelect, + NamespaceFilter, + NamespaceOrderBy, + CreateNamespaceInput, + UpdateNamespaceInput, + NamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", 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 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + 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, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespaces", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Namespace", "namespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Namespace", "createNamespace", "namespace", args.select, args.data, "CreateNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Namespace', + 'createNamespace', + 'namespace', + args.select, + args.data, + 'CreateNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "createNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'createNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Namespace", "updateNamespace", "namespace", args.select, args.where.id, args.data, "UpdateNamespaceInput", "id", "namespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Namespace', + 'updateNamespace', + 'namespace', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceInput', + 'id', + 'namespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "updateNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'updateNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Namespace", "deleteNamespace", "namespace", { - id: args.where.id - }, "DeleteNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Namespace', + 'deleteNamespace', + 'namespace', + { + id: args.where.id, + }, + 'DeleteNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "deleteNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'deleteNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/namespaceEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/namespaceEvent.ts index 5fab4853c7..494442c263 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/namespaceEvent.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/namespaceEvent.ts @@ -3,56 +3,96 @@ * @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 { NamespaceEvent, NamespaceEventWithRelations, NamespaceEventSelect, NamespaceEventFilter, NamespaceEventOrderBy, CreateNamespaceEventInput, UpdateNamespaceEventInput, NamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceEvent, + NamespaceEventWithRelations, + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy, + CreateNamespaceEventInput, + UpdateNamespaceEventInput, + NamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", 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 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + 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, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvents", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceEvent", "createNamespaceEvent", "namespaceEvent", args.select, args.data, "CreateNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceEvent', + 'createNamespaceEvent', + 'namespaceEvent', + args.select, + args.data, + 'CreateNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "createNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'createNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + NamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceEvent", "updateNamespaceEvent", "namespaceEvent", args.select, args.where.id, args.data, "UpdateNamespaceEventInput", "id", "namespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceEvent', + 'updateNamespaceEvent', + 'namespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceEventInput', + 'id', + 'namespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "updateNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'updateNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceEvent", "deleteNamespaceEvent", "namespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceEvent', + 'deleteNamespaceEvent', + 'namespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "deleteNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'deleteNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionApiBinding.ts b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionApiBinding.ts index 6f3cffb12b..c74d4423e8 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionApiBinding.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionApiBinding.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionApiBinding, PlatformFunctionApiBindingWithRelations, PlatformFunctionApiBindingSelect, PlatformFunctionApiBindingFilter, PlatformFunctionApiBindingOrderBy, CreatePlatformFunctionApiBindingInput, UpdatePlatformFunctionApiBindingInput, PlatformFunctionApiBindingPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionApiBinding, + PlatformFunctionApiBindingWithRelations, + PlatformFunctionApiBindingSelect, + PlatformFunctionApiBindingFilter, + PlatformFunctionApiBindingOrderBy, + CreatePlatformFunctionApiBindingInput, + UpdatePlatformFunctionApiBindingInput, + PlatformFunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionApiBindingModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBindings: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBindings: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", 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 - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + 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, + }, + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBindings", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBindings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBinding: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBinding: InferSelectResult< + PlatformFunctionApiBindingWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBinding", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBinding', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionApiBinding": data.platformFunctionApiBindings?.nodes?.[0] ?? null - }) + platformFunctionApiBinding: data.platformFunctionApiBindings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionApiBinding: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionApiBinding: InferSelectResult< + PlatformFunctionApiBindingWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionApiBinding", "platformFunctionApiBindings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionApiBinding', + 'platformFunctionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionApiBindingFilter", "PlatformFunctionApiBindingOrderBy", connectionFieldsMap); + 'PlatformFunctionApiBindingFilter', + 'PlatformFunctionApiBindingOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionApiBinding", - fieldName: "platformFunctionApiBinding", + operation: 'query', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'platformFunctionApiBinding', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionApiBindingModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionApiBinding": data.platformFunctionApiBindings?.nodes?.[0] ?? null - }) + platformFunctionApiBinding: data.platformFunctionApiBindings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionApiBinding", "createPlatformFunctionApiBinding", "platformFunctionApiBinding", args.select, args.data, "CreatePlatformFunctionApiBindingInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionApiBinding', + 'createPlatformFunctionApiBinding', + 'platformFunctionApiBinding', + args.select, + args.data, + 'CreatePlatformFunctionApiBindingInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "createPlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'createPlatformFunctionApiBinding', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionApiBinding", "updatePlatformFunctionApiBinding", "platformFunctionApiBinding", args.select, args.where.id, args.data, "UpdatePlatformFunctionApiBindingInput", "id", "platformFunctionApiBindingPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionApiBinding', + 'updatePlatformFunctionApiBinding', + 'platformFunctionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionApiBindingInput', + 'id', + 'platformFunctionApiBindingPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "updatePlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'updatePlatformFunctionApiBinding', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionApiBinding: { platformFunctionApiBinding: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionApiBinding", "deletePlatformFunctionApiBinding", "platformFunctionApiBinding", { - id: args.where.id - }, "DeletePlatformFunctionApiBindingInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionApiBinding', + 'deletePlatformFunctionApiBinding', + 'platformFunctionApiBinding', + { + id: args.where.id, + }, + 'DeletePlatformFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionApiBinding", - fieldName: "deletePlatformFunctionApiBinding", + operation: 'mutation', + operationName: 'PlatformFunctionApiBinding', + fieldName: 'deletePlatformFunctionApiBinding', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDefinition.ts b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDefinition.ts index 43593c7d71..7422743780 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDefinition.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDefinition.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionDefinition, PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionFilter, PlatformFunctionDefinitionOrderBy, CreatePlatformFunctionDefinitionInput, UpdatePlatformFunctionDefinitionInput, PlatformFunctionDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDefinition, + PlatformFunctionDefinitionWithRelations, + PlatformFunctionDefinitionSelect, + PlatformFunctionDefinitionFilter, + PlatformFunctionDefinitionOrderBy, + CreatePlatformFunctionDefinitionInput, + UpdatePlatformFunctionDefinitionInput, + PlatformFunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinitions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinitions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", 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 - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + 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, + }, + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinitions", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinition: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinition: InferSelectResult< + PlatformFunctionDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinition", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinition', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDefinition": data.platformFunctionDefinitions?.nodes?.[0] ?? null - }) + platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDefinition: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDefinition: InferSelectResult< + PlatformFunctionDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDefinition", "platformFunctionDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDefinition', + 'platformFunctionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDefinitionFilter", "PlatformFunctionDefinitionOrderBy", connectionFieldsMap); + 'PlatformFunctionDefinitionFilter', + 'PlatformFunctionDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDefinition", - fieldName: "platformFunctionDefinition", + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinition', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDefinition": data.platformFunctionDefinitions?.nodes?.[0] ?? null - }) + platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDefinition", "createPlatformFunctionDefinition", "platformFunctionDefinition", args.select, args.data, "CreatePlatformFunctionDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDefinition', + 'createPlatformFunctionDefinition', + 'platformFunctionDefinition', + args.select, + args.data, + 'CreatePlatformFunctionDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "createPlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'createPlatformFunctionDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDefinition", "updatePlatformFunctionDefinition", "platformFunctionDefinition", args.select, args.where.id, args.data, "UpdatePlatformFunctionDefinitionInput", "id", "platformFunctionDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDefinition', + 'updatePlatformFunctionDefinition', + 'platformFunctionDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDefinitionInput', + 'id', + 'platformFunctionDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "updatePlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'updatePlatformFunctionDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDefinition", "deletePlatformFunctionDefinition", "platformFunctionDefinition", { - id: args.where.id - }, "DeletePlatformFunctionDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDefinition', + 'deletePlatformFunctionDefinition', + 'platformFunctionDefinition', + { + id: args.where.id, + }, + 'DeletePlatformFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDefinition", - fieldName: "deletePlatformFunctionDefinition", + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'deletePlatformFunctionDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDeployment.ts b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDeployment.ts index d525b179ba..6331c14b14 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDeployment.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDeployment.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionDeployment, PlatformFunctionDeploymentWithRelations, PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentFilter, PlatformFunctionDeploymentOrderBy, CreatePlatformFunctionDeploymentInput, UpdatePlatformFunctionDeploymentInput, PlatformFunctionDeploymentPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDeployment, + PlatformFunctionDeploymentWithRelations, + PlatformFunctionDeploymentSelect, + PlatformFunctionDeploymentFilter, + PlatformFunctionDeploymentOrderBy, + CreatePlatformFunctionDeploymentInput, + UpdatePlatformFunctionDeploymentInput, + PlatformFunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDeploymentModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployments: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployments: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeployment", "platformFunctionDeployments", 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 - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + 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, + }, + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployments", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployments', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployment: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployment: InferSelectResult< + PlatformFunctionDeploymentWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDeployment", "platformFunctionDeployments", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployment", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployment', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeployment": data.platformFunctionDeployments?.nodes?.[0] ?? null - }) + platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeployment: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeployment: InferSelectResult< + PlatformFunctionDeploymentWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeployment", "platformFunctionDeployments", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeployment', + 'platformFunctionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDeploymentFilter", "PlatformFunctionDeploymentOrderBy", connectionFieldsMap); + 'PlatformFunctionDeploymentFilter', + 'PlatformFunctionDeploymentOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeployment", - fieldName: "platformFunctionDeployment", + operation: 'query', + operationName: 'PlatformFunctionDeployment', + fieldName: 'platformFunctionDeployment', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformFunctionDeploymentModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeployment": data.platformFunctionDeployments?.nodes?.[0] ?? null - }) + platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDeployment", "createPlatformFunctionDeployment", "platformFunctionDeployment", args.select, args.data, "CreatePlatformFunctionDeploymentInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDeployment', + 'createPlatformFunctionDeployment', + 'platformFunctionDeployment', + args.select, + args.data, + 'CreatePlatformFunctionDeploymentInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "createPlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'createPlatformFunctionDeployment', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformFunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDeployment", "updatePlatformFunctionDeployment", "platformFunctionDeployment", args.select, args.where.id, args.data, "UpdatePlatformFunctionDeploymentInput", "id", "platformFunctionDeploymentPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDeployment', + 'updatePlatformFunctionDeployment', + 'platformFunctionDeployment', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDeploymentInput', + 'id', + 'platformFunctionDeploymentPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "updatePlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'updatePlatformFunctionDeployment', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDeployment", "deletePlatformFunctionDeployment", "platformFunctionDeployment", { - id: args.where.id - }, "DeletePlatformFunctionDeploymentInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDeployment', + 'deletePlatformFunctionDeployment', + 'platformFunctionDeployment', + { + id: args.where.id, + }, + 'DeletePlatformFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeployment", - fieldName: "deletePlatformFunctionDeployment", + operation: 'mutation', + operationName: 'PlatformFunctionDeployment', + fieldName: 'deletePlatformFunctionDeployment', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDeploymentEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDeploymentEvent.ts index b0e61986d3..9e28f1c2c4 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDeploymentEvent.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionDeploymentEvent.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionDeploymentEvent, PlatformFunctionDeploymentEventWithRelations, PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy, CreatePlatformFunctionDeploymentEventInput, UpdatePlatformFunctionDeploymentEventInput, PlatformFunctionDeploymentEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionDeploymentEvent, + PlatformFunctionDeploymentEventWithRelations, + PlatformFunctionDeploymentEventSelect, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy, + CreatePlatformFunctionDeploymentEventInput, + UpdatePlatformFunctionDeploymentEventInput, + PlatformFunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDeploymentEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvents: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", 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 - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + 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, + }, + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvents", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvent: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionDeploymentEventFilter, + PlatformFunctionDeploymentEventOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvent", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvent', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformFunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeploymentEvent": data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null - }) + platformFunctionDeploymentEvent: data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionDeploymentEvent: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionDeploymentEventFilter", "PlatformFunctionDeploymentEventOrderBy", connectionFieldsMap); + 'PlatformFunctionDeploymentEventFilter', + 'PlatformFunctionDeploymentEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "platformFunctionDeploymentEvent", + operation: 'query', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'platformFunctionDeploymentEvent', document, variables, transform: (data: { @@ -93,79 +156,123 @@ export class PlatformFunctionDeploymentEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionDeploymentEvent": data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null - }) + platformFunctionDeploymentEvent: data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionDeploymentEvent", "createPlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", args.select, args.data, "CreatePlatformFunctionDeploymentEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionDeploymentEvent', + 'createPlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + args.select, + args.data, + 'CreatePlatformFunctionDeploymentEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "createPlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'createPlatformFunctionDeploymentEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionDeploymentEvent", "updatePlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", args.select, args.where.id, args.data, "UpdatePlatformFunctionDeploymentEventInput", "id", "platformFunctionDeploymentEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionDeploymentEvent', + 'updatePlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionDeploymentEventInput', + 'id', + 'platformFunctionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "updatePlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'updatePlatformFunctionDeploymentEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionDeploymentEvent: { - platformFunctionDeploymentEvent: InferSelectResult; + platformFunctionDeploymentEvent: InferSelectResult< + PlatformFunctionDeploymentEventWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionDeploymentEvent", "deletePlatformFunctionDeploymentEvent", "platformFunctionDeploymentEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionDeploymentEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionDeploymentEvent', + 'deletePlatformFunctionDeploymentEvent', + 'platformFunctionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionDeploymentEvent", - fieldName: "deletePlatformFunctionDeploymentEvent", + operation: 'mutation', + operationName: 'PlatformFunctionDeploymentEvent', + fieldName: 'deletePlatformFunctionDeploymentEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionExecutionLog.ts b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionExecutionLog.ts index c2b531e089..1fe6df0cf8 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionExecutionLog.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionExecutionLog.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionExecutionLog, PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy, CreatePlatformFunctionExecutionLogInput, UpdatePlatformFunctionExecutionLogInput, PlatformFunctionExecutionLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionExecutionLog, + PlatformFunctionExecutionLogWithRelations, + PlatformFunctionExecutionLogSelect, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy, + CreatePlatformFunctionExecutionLogInput, + UpdatePlatformFunctionExecutionLogInput, + PlatformFunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionExecutionLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLogs: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", 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 - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + 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, + }, + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLogs", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLog: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionExecutionLogFilter, + PlatformFunctionExecutionLogOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLog", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLog', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformFunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionExecutionLog": data.platformFunctionExecutionLogs?.nodes?.[0] ?? null - }) + platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionExecutionLog: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionExecutionLog: InferSelectResult< + PlatformFunctionExecutionLogWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionExecutionLog", "platformFunctionExecutionLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionExecutionLog', + 'platformFunctionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionExecutionLogFilter", "PlatformFunctionExecutionLogOrderBy", connectionFieldsMap); + 'PlatformFunctionExecutionLogFilter', + 'PlatformFunctionExecutionLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionExecutionLog", - fieldName: "platformFunctionExecutionLog", + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLog', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class PlatformFunctionExecutionLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionExecutionLog": data.platformFunctionExecutionLogs?.nodes?.[0] ?? null - }) + platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionExecutionLog", "createPlatformFunctionExecutionLog", "platformFunctionExecutionLog", args.select, args.data, "CreatePlatformFunctionExecutionLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionExecutionLog', + 'createPlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + args.select, + args.data, + 'CreatePlatformFunctionExecutionLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "createPlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'createPlatformFunctionExecutionLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionExecutionLog", "updatePlatformFunctionExecutionLog", "platformFunctionExecutionLog", args.select, args.where.id, args.data, "UpdatePlatformFunctionExecutionLogInput", "id", "platformFunctionExecutionLogPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionExecutionLog', + 'updatePlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionExecutionLogInput', + 'id', + 'platformFunctionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "updatePlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'updatePlatformFunctionExecutionLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionExecutionLog", "deletePlatformFunctionExecutionLog", "platformFunctionExecutionLog", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionExecutionLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionExecutionLog', + 'deletePlatformFunctionExecutionLog', + 'platformFunctionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionExecutionLog", - fieldName: "deletePlatformFunctionExecutionLog", + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'deletePlatformFunctionExecutionLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionInvocation.ts b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionInvocation.ts index 79e7507dc9..f52ba9df33 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionInvocation.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionInvocation.ts @@ -3,56 +3,101 @@ * @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 { PlatformFunctionInvocation, PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationSelect, PlatformFunctionInvocationFilter, PlatformFunctionInvocationOrderBy, CreatePlatformFunctionInvocationInput, UpdatePlatformFunctionInvocationInput, PlatformFunctionInvocationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionInvocation, + PlatformFunctionInvocationWithRelations, + PlatformFunctionInvocationSelect, + PlatformFunctionInvocationFilter, + PlatformFunctionInvocationOrderBy, + CreatePlatformFunctionInvocationInput, + UpdatePlatformFunctionInvocationInput, + PlatformFunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionInvocationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocation", "platformFunctionInvocations", 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 - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + 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, + }, + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocations", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocation: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocation: InferSelectResult< + PlatformFunctionInvocationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionInvocation", "platformFunctionInvocations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocation", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocation', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformFunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocation": data.platformFunctionInvocations?.nodes?.[0] ?? null - }) + platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocation: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocation: InferSelectResult< + PlatformFunctionInvocationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocation", "platformFunctionInvocations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocation', + 'platformFunctionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionInvocationFilter", "PlatformFunctionInvocationOrderBy", connectionFieldsMap); + 'PlatformFunctionInvocationFilter', + 'PlatformFunctionInvocationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocation", - fieldName: "platformFunctionInvocation", + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocation', document, variables, transform: (data: { @@ -93,79 +148,111 @@ export class PlatformFunctionInvocationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocation": data.platformFunctionInvocations?.nodes?.[0] ?? null - }) + platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionInvocation", "createPlatformFunctionInvocation", "platformFunctionInvocation", args.select, args.data, "CreatePlatformFunctionInvocationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionInvocation', + 'createPlatformFunctionInvocation', + 'platformFunctionInvocation', + args.select, + args.data, + 'CreatePlatformFunctionInvocationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "createPlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'createPlatformFunctionInvocation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionInvocation", "updatePlatformFunctionInvocation", "platformFunctionInvocation", args.select, args.where.id, args.data, "UpdatePlatformFunctionInvocationInput", "id", "platformFunctionInvocationPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionInvocation', + 'updatePlatformFunctionInvocation', + 'platformFunctionInvocation', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionInvocationInput', + 'id', + 'platformFunctionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "updatePlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'updatePlatformFunctionInvocation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionInvocation", "deletePlatformFunctionInvocation", "platformFunctionInvocation", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionInvocationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionInvocation', + 'deletePlatformFunctionInvocation', + 'platformFunctionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionInvocationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocation", - fieldName: "deletePlatformFunctionInvocation", + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'deletePlatformFunctionInvocation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionInvocationAttempt.ts b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionInvocationAttempt.ts index 80c28fc7c6..a1db7bbe0a 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformFunctionInvocationAttempt.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformFunctionInvocationAttempt.ts @@ -3,56 +3,109 @@ * @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 { PlatformFunctionInvocationAttempt, PlatformFunctionInvocationAttemptWithRelations, PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy, CreatePlatformFunctionInvocationAttemptInput, UpdatePlatformFunctionInvocationAttemptInput, PlatformFunctionInvocationAttemptPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformFunctionInvocationAttempt, + PlatformFunctionInvocationAttemptWithRelations, + PlatformFunctionInvocationAttemptSelect, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy, + CreatePlatformFunctionInvocationAttemptInput, + UpdatePlatformFunctionInvocationAttemptInput, + PlatformFunctionInvocationAttemptPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionInvocationAttemptModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempts: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempts: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", 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 - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + 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, + }, + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempts", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempts', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempt: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformFunctionInvocationAttemptFilter, + PlatformFunctionInvocationAttemptOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempt", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempt', document, variables, transform: (data: { @@ -60,32 +113,43 @@ export class PlatformFunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocationAttempt": data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null - }) + platformFunctionInvocationAttempt: + data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformFunctionInvocationAttempt: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempts", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempts', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformFunctionInvocationAttemptFilter", "PlatformFunctionInvocationAttemptOrderBy", connectionFieldsMap); + 'PlatformFunctionInvocationAttemptFilter', + 'PlatformFunctionInvocationAttemptOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "platformFunctionInvocationAttempt", + operation: 'query', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'platformFunctionInvocationAttempt', document, variables, transform: (data: { @@ -93,79 +157,124 @@ export class PlatformFunctionInvocationAttemptModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformFunctionInvocationAttempt": data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null - }) + platformFunctionInvocationAttempt: + data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformFunctionInvocationAttempt", "createPlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", args.select, args.data, "CreatePlatformFunctionInvocationAttemptInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformFunctionInvocationAttempt', + 'createPlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + args.select, + args.data, + 'CreatePlatformFunctionInvocationAttemptInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "createPlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'createPlatformFunctionInvocationAttempt', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformFunctionInvocationAttemptPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformFunctionInvocationAttempt", "updatePlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", args.select, args.where.id, args.data, "UpdatePlatformFunctionInvocationAttemptInput", "id", "platformFunctionInvocationAttemptPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformFunctionInvocationAttempt', + 'updatePlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + args.select, + args.where.id, + args.data, + 'UpdatePlatformFunctionInvocationAttemptInput', + 'id', + 'platformFunctionInvocationAttemptPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "updatePlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'updatePlatformFunctionInvocationAttempt', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformFunctionInvocationAttempt: { - platformFunctionInvocationAttempt: InferSelectResult; + platformFunctionInvocationAttempt: InferSelectResult< + PlatformFunctionInvocationAttemptWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformFunctionInvocationAttempt", "deletePlatformFunctionInvocationAttempt", "platformFunctionInvocationAttempt", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformFunctionInvocationAttemptInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformFunctionInvocationAttempt', + 'deletePlatformFunctionInvocationAttempt', + 'platformFunctionInvocationAttempt', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformFunctionInvocationAttemptInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformFunctionInvocationAttempt", - fieldName: "deletePlatformFunctionInvocationAttempt", + operation: 'mutation', + operationName: 'PlatformFunctionInvocationAttempt', + fieldName: 'deletePlatformFunctionInvocationAttempt', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformInfraCommit.ts b/sdk/constructive-sdk/src/compute/orm/models/platformInfraCommit.ts index b5e90c524d..ab0c34f08f 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformInfraCommit.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformInfraCommit.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraCommit, PlatformInfraCommitWithRelations, PlatformInfraCommitSelect, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy, CreatePlatformInfraCommitInput, UpdatePlatformInfraCommitInput, PlatformInfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraCommit, + PlatformInfraCommitWithRelations, + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, + CreatePlatformInfraCommitInput, + UpdatePlatformInfraCommitInput, + PlatformInfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", 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 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + 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, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommits", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraCommit", "createPlatformInfraCommit", "platformInfraCommit", args.select, args.data, "CreatePlatformInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraCommit', + 'createPlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.data, + 'CreatePlatformInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "createPlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'createPlatformInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraCommit", "updatePlatformInfraCommit", "platformInfraCommit", args.select, args.where.id, args.data, "UpdatePlatformInfraCommitInput", "id", "platformInfraCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraCommit', + 'updatePlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraCommitInput', + 'id', + 'platformInfraCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "updatePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'updatePlatformInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraCommit", "deletePlatformInfraCommit", "platformInfraCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraCommit', + 'deletePlatformInfraCommit', + 'platformInfraCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "deletePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'deletePlatformInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts b/sdk/constructive-sdk/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts index 6c9bfc2b28..e0e0a2aeaa 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformInfraGetAllTreeNodesRecord.ts @@ -3,56 +3,109 @@ * @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 { PlatformInfraGetAllTreeNodesRecord, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy, CreatePlatformInfraGetAllTreeNodesRecordInput, UpdatePlatformInfraGetAllTreeNodesRecordInput, PlatformInfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraGetAllTreeNodesRecord, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, + CreatePlatformInfraGetAllTreeNodesRecordInput, + UpdatePlatformInfraGetAllTreeNodesRecordInput, + PlatformInfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", 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 - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + 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, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodes", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +113,41 @@ export class PlatformInfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraGetAllTreeNodesRecord": data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null - }) + platformInfraGetAllTreeNodesRecord: data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraGetAllTreeNodesRecord: { - platformInfraGetAllTreeNodesRecord: InferSelectResult; + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraGetAllTreeNodesRecord", "createPlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodesRecord", args.select, args.data, "CreatePlatformInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'createPlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreatePlatformInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "createPlatformInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'createPlatformInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformInfraObject.ts b/sdk/constructive-sdk/src/compute/orm/models/platformInfraObject.ts index 2978ff1c18..512cb448c4 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformInfraObject.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformInfraObject.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraObject, PlatformInfraObjectWithRelations, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy, CreatePlatformInfraObjectInput, UpdatePlatformInfraObjectInput, PlatformInfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraObject, + PlatformInfraObjectWithRelations, + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, + CreatePlatformInfraObjectInput, + UpdatePlatformInfraObjectInput, + PlatformInfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraObject", "platformInfraObjects", 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 - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + 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, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObjects", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraObject", "platformInfraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class PlatformInfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraObject": data.platformInfraObjects?.nodes?.[0] ?? null - }) + platformInfraObject: data.platformInfraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("PlatformInfraObject", "platformInfraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'PlatformInfraObject', + 'platformInfraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraObject", "createPlatformInfraObject", "platformInfraObject", args.select, args.data, "CreatePlatformInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraObject', + 'createPlatformInfraObject', + 'platformInfraObject', + args.select, + args.data, + 'CreatePlatformInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "createPlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'createPlatformInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraObject", "updatePlatformInfraObject", "platformInfraObject", args.select, args.where.id, args.data, "UpdatePlatformInfraObjectInput", "id", "platformInfraObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraObject', + 'updatePlatformInfraObject', + 'platformInfraObject', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraObjectInput', + 'id', + 'platformInfraObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "updatePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'updatePlatformInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraObject", "deletePlatformInfraObject", "platformInfraObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraObject', + 'deletePlatformInfraObject', + 'platformInfraObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "deletePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'deletePlatformInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformInfraRef.ts b/sdk/constructive-sdk/src/compute/orm/models/platformInfraRef.ts index 198e5cd359..c485407d95 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformInfraRef.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformInfraRef.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraRef, PlatformInfraRefWithRelations, PlatformInfraRefSelect, PlatformInfraRefFilter, PlatformInfraRefOrderBy, CreatePlatformInfraRefInput, UpdatePlatformInfraRefInput, PlatformInfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraRef, + PlatformInfraRefWithRelations, + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, + CreatePlatformInfraRefInput, + UpdatePlatformInfraRefInput, + PlatformInfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", 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 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + 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, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRefs", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraRef", "createPlatformInfraRef", "platformInfraRef", args.select, args.data, "CreatePlatformInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraRef', + 'createPlatformInfraRef', + 'platformInfraRef', + args.select, + args.data, + 'CreatePlatformInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "createPlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'createPlatformInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraRef", "updatePlatformInfraRef", "platformInfraRef", args.select, args.where.id, args.data, "UpdatePlatformInfraRefInput", "id", "platformInfraRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraRef', + 'updatePlatformInfraRef', + 'platformInfraRef', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraRefInput', + 'id', + 'platformInfraRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "updatePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'updatePlatformInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraRef", "deletePlatformInfraRef", "platformInfraRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraRef', + 'deletePlatformInfraRef', + 'platformInfraRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "deletePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'deletePlatformInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformInfraStore.ts b/sdk/constructive-sdk/src/compute/orm/models/platformInfraStore.ts index 857230b173..493d42e53c 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformInfraStore.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformInfraStore.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraStore, PlatformInfraStoreWithRelations, PlatformInfraStoreSelect, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy, CreatePlatformInfraStoreInput, UpdatePlatformInfraStoreInput, PlatformInfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraStore, + PlatformInfraStoreWithRelations, + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, + CreatePlatformInfraStoreInput, + UpdatePlatformInfraStoreInput, + PlatformInfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", 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 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + 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, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStores", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraStore", "createPlatformInfraStore", "platformInfraStore", args.select, args.data, "CreatePlatformInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraStore', + 'createPlatformInfraStore', + 'platformInfraStore', + args.select, + args.data, + 'CreatePlatformInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "createPlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'createPlatformInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformInfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraStore", "updatePlatformInfraStore", "platformInfraStore", args.select, args.where.id, args.data, "UpdatePlatformInfraStoreInput", "id", "platformInfraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraStore', + 'updatePlatformInfraStore', + 'platformInfraStore', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraStoreInput', + 'id', + 'platformInfraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "updatePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'updatePlatformInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraStore", "deletePlatformInfraStore", "platformInfraStore", { - id: args.where.id - }, "DeletePlatformInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraStore', + 'deletePlatformInfraStore', + 'platformInfraStore', + { + id: args.where.id, + }, + 'DeletePlatformInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "deletePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'deletePlatformInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformNamespace.ts b/sdk/constructive-sdk/src/compute/orm/models/platformNamespace.ts index 061849f0df..c4dff94953 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformNamespace.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformNamespace.ts @@ -3,56 +3,96 @@ * @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 { PlatformNamespace, PlatformNamespaceWithRelations, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy, CreatePlatformNamespaceInput, UpdatePlatformNamespaceInput, PlatformNamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespace, + PlatformNamespaceWithRelations, + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, + CreatePlatformNamespaceInput, + UpdatePlatformNamespaceInput, + PlatformNamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", 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 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + 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, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespaces", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespace", "createPlatformNamespace", "platformNamespace", args.select, args.data, "CreatePlatformNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespace', + 'createPlatformNamespace', + 'platformNamespace', + args.select, + args.data, + 'CreatePlatformNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "createPlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'createPlatformNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformNamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespace", "updatePlatformNamespace", "platformNamespace", args.select, args.where.id, args.data, "UpdatePlatformNamespaceInput", "id", "platformNamespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespace', + 'updatePlatformNamespace', + 'platformNamespace', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceInput', + 'id', + 'platformNamespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "updatePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'updatePlatformNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespace", "deletePlatformNamespace", "platformNamespace", { - id: args.where.id - }, "DeletePlatformNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespace', + 'deletePlatformNamespace', + 'platformNamespace', + { + id: args.where.id, + }, + 'DeletePlatformNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "deletePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'deletePlatformNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformNamespaceEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/platformNamespaceEvent.ts index 90242716e8..198afe79ae 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformNamespaceEvent.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformNamespaceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformNamespaceEvent, PlatformNamespaceEventWithRelations, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy, CreatePlatformNamespaceEventInput, UpdatePlatformNamespaceEventInput, PlatformNamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespaceEvent, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, + CreatePlatformNamespaceEventInput, + UpdatePlatformNamespaceEventInput, + PlatformNamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformNamespaceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", 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 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + 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, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvents", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespaceEvent", "createPlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.data, "CreatePlatformNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespaceEvent', + 'createPlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.data, + 'CreatePlatformNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "createPlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'createPlatformNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformNamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespaceEvent", "updatePlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.where.id, args.data, "UpdatePlatformNamespaceEventInput", "id", "platformNamespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespaceEvent', + 'updatePlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceEventInput', + 'id', + 'platformNamespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "updatePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'updatePlatformNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespaceEvent", "deletePlatformNamespaceEvent", "platformNamespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespaceEvent', + 'deletePlatformNamespaceEvent', + 'platformNamespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "deletePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'deletePlatformNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResource.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResource.ts index 7919e4d8dd..00f03ea1dc 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResource.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResource.ts @@ -3,56 +3,96 @@ * @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 { PlatformResource, PlatformResourceWithRelations, PlatformResourceSelect, PlatformResourceFilter, PlatformResourceOrderBy, CreatePlatformResourceInput, UpdatePlatformResourceInput, PlatformResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResource, + PlatformResourceWithRelations, + PlatformResourceSelect, + PlatformResourceFilter, + PlatformResourceOrderBy, + CreatePlatformResourceInput, + UpdatePlatformResourceInput, + PlatformResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResource", "platformResources", 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 - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResource', + 'platformResources', + 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, + }, + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResources", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResource", "platformResources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResource', + 'platformResources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResource", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResource": data.platformResources?.nodes?.[0] ?? null - }) + platformResource: data.platformResources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResource", "platformResources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResource', + 'platformResources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceFilter", "PlatformResourceOrderBy", connectionFieldsMap); + 'PlatformResourceFilter', + 'PlatformResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResource", - fieldName: "platformResource", + operation: 'query', + operationName: 'PlatformResource', + fieldName: 'platformResource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResource": data.platformResources?.nodes?.[0] ?? null - }) + platformResource: data.platformResources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResource", "createPlatformResource", "platformResource", args.select, args.data, "CreatePlatformResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResource', + 'createPlatformResource', + 'platformResource', + args.select, + args.data, + 'CreatePlatformResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "createPlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'createPlatformResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResource", "updatePlatformResource", "platformResource", args.select, args.where.id, args.data, "UpdatePlatformResourceInput", "id", "platformResourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResource', + 'updatePlatformResource', + 'platformResource', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceInput', + 'id', + 'platformResourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "updatePlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'updatePlatformResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResource: { platformResource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResource", "deletePlatformResource", "platformResource", { - id: args.where.id - }, "DeletePlatformResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResource', + 'deletePlatformResource', + 'platformResource', + { + id: args.where.id, + }, + 'DeletePlatformResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResource", - fieldName: "deletePlatformResource", + operation: 'mutation', + operationName: 'PlatformResource', + fieldName: 'deletePlatformResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourceDeclaredCapacity.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourceDeclaredCapacity.ts index 922c25d12e..66a88f859d 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourceDeclaredCapacity.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourceDeclaredCapacity.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceDeclaredCapacity, PlatformResourceDeclaredCapacityWithRelations, PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy, CreatePlatformResourceDeclaredCapacityInput, UpdatePlatformResourceDeclaredCapacityInput, PlatformResourceDeclaredCapacityPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceDeclaredCapacity, + PlatformResourceDeclaredCapacityWithRelations, + PlatformResourceDeclaredCapacitySelect, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy, + CreatePlatformResourceDeclaredCapacityInput, + UpdatePlatformResourceDeclaredCapacityInput, + PlatformResourceDeclaredCapacityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceDeclaredCapacityModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDeclaredCapacities: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacities", 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 - }, "PlatformResourceDeclaredCapacityFilter", "PlatformResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacities', + 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, + }, + 'PlatformResourceDeclaredCapacityFilter', + 'PlatformResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "platformResourceDeclaredCapacities", + operation: 'query', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'platformResourceDeclaredCapacities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDeclaredCapacity: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceDeclaredCapacityFilter, + PlatformResourceDeclaredCapacityOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDeclaredCapacity: InferSelectResult< + PlatformResourceDeclaredCapacityWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacities", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceDeclaredCapacityFilter", "PlatformResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceDeclaredCapacityFilter', + 'PlatformResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "platformResourceDeclaredCapacity", + operation: 'query', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'platformResourceDeclaredCapacity', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourceDeclaredCapacityModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDeclaredCapacity": data.platformResourceDeclaredCapacities?.nodes?.[0] ?? null - }) + platformResourceDeclaredCapacity: + data.platformResourceDeclaredCapacities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourceDeclaredCapacityInput['platformResourceDeclaredCapacity'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceDeclaredCapacity: { - platformResourceDeclaredCapacity: InferSelectResult; + platformResourceDeclaredCapacity: InferSelectResult< + PlatformResourceDeclaredCapacityWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceDeclaredCapacity", "createPlatformResourceDeclaredCapacity", "platformResourceDeclaredCapacity", args.select, args.data, "CreatePlatformResourceDeclaredCapacityInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceDeclaredCapacity', + 'createPlatformResourceDeclaredCapacity', + 'platformResourceDeclaredCapacity', + args.select, + args.data, + 'CreatePlatformResourceDeclaredCapacityInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDeclaredCapacity", - fieldName: "createPlatformResourceDeclaredCapacity", + operation: 'mutation', + operationName: 'PlatformResourceDeclaredCapacity', + fieldName: 'createPlatformResourceDeclaredCapacity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourceDefinition.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourceDefinition.ts index ae9490e31f..a23e8bf5a1 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourceDefinition.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourceDefinition.ts @@ -3,56 +3,101 @@ * @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 { PlatformResourceDefinition, PlatformResourceDefinitionWithRelations, PlatformResourceDefinitionSelect, PlatformResourceDefinitionFilter, PlatformResourceDefinitionOrderBy, CreatePlatformResourceDefinitionInput, UpdatePlatformResourceDefinitionInput, PlatformResourceDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceDefinition, + PlatformResourceDefinitionWithRelations, + PlatformResourceDefinitionSelect, + PlatformResourceDefinitionFilter, + PlatformResourceDefinitionOrderBy, + CreatePlatformResourceDefinitionInput, + UpdatePlatformResourceDefinitionInput, + PlatformResourceDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinitions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinitions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDefinition", "platformResourceDefinitions", 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 - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + 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, + }, + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinitions", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinition: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinition: InferSelectResult< + PlatformResourceDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceDefinition", "platformResourceDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinition", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinition', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class PlatformResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDefinition": data.platformResourceDefinitions?.nodes?.[0] ?? null - }) + platformResourceDefinition: data.platformResourceDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceDefinition: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceDefinition: InferSelectResult< + PlatformResourceDefinitionWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceDefinition", "platformResourceDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceDefinition', + 'platformResourceDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceDefinitionFilter", "PlatformResourceDefinitionOrderBy", connectionFieldsMap); + 'PlatformResourceDefinitionFilter', + 'PlatformResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceDefinition", - fieldName: "platformResourceDefinition", + operation: 'query', + operationName: 'PlatformResourceDefinition', + fieldName: 'platformResourceDefinition', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class PlatformResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceDefinition": data.platformResourceDefinitions?.nodes?.[0] ?? null - }) + platformResourceDefinition: data.platformResourceDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceDefinition", "createPlatformResourceDefinition", "platformResourceDefinition", args.select, args.data, "CreatePlatformResourceDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceDefinition', + 'createPlatformResourceDefinition', + 'platformResourceDefinition', + args.select, + args.data, + 'CreatePlatformResourceDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "createPlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'createPlatformResourceDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceDefinition", "updatePlatformResourceDefinition", "platformResourceDefinition", args.select, args.where.id, args.data, "UpdatePlatformResourceDefinitionInput", "id", "platformResourceDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceDefinition', + 'updatePlatformResourceDefinition', + 'platformResourceDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceDefinitionInput', + 'id', + 'platformResourceDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "updatePlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'updatePlatformResourceDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceDefinition: { platformResourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceDefinition", "deletePlatformResourceDefinition", "platformResourceDefinition", { - id: args.where.id - }, "DeletePlatformResourceDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceDefinition', + 'deletePlatformResourceDefinition', + 'platformResourceDefinition', + { + id: args.where.id, + }, + 'DeletePlatformResourceDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceDefinition", - fieldName: "deletePlatformResourceDefinition", + operation: 'mutation', + operationName: 'PlatformResourceDefinition', + fieldName: 'deletePlatformResourceDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourceEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourceEvent.ts index 8a8f320796..77ae28e155 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourceEvent.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourceEvent, PlatformResourceEventWithRelations, PlatformResourceEventSelect, PlatformResourceEventFilter, PlatformResourceEventOrderBy, CreatePlatformResourceEventInput, UpdatePlatformResourceEventInput, PlatformResourceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceEvent, + PlatformResourceEventWithRelations, + PlatformResourceEventSelect, + PlatformResourceEventFilter, + PlatformResourceEventOrderBy, + CreatePlatformResourceEventInput, + UpdatePlatformResourceEventInput, + PlatformResourceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceEvent", "platformResourceEvents", 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 - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + 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, + }, + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvents", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceEvent", "platformResourceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvent", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceEvent": data.platformResourceEvents?.nodes?.[0] ?? null - }) + platformResourceEvent: data.platformResourceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceEvent", "platformResourceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceEvent', + 'platformResourceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceEventFilter", "PlatformResourceEventOrderBy", connectionFieldsMap); + 'PlatformResourceEventFilter', + 'PlatformResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceEvent", - fieldName: "platformResourceEvent", + operation: 'query', + operationName: 'PlatformResourceEvent', + fieldName: 'platformResourceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceEvent": data.platformResourceEvents?.nodes?.[0] ?? null - }) + platformResourceEvent: data.platformResourceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceEvent", "createPlatformResourceEvent", "platformResourceEvent", args.select, args.data, "CreatePlatformResourceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceEvent', + 'createPlatformResourceEvent', + 'platformResourceEvent', + args.select, + args.data, + 'CreatePlatformResourceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "createPlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'createPlatformResourceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformResourceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceEvent", "updatePlatformResourceEvent", "platformResourceEvent", args.select, args.where.id, args.data, "UpdatePlatformResourceEventInput", "id", "platformResourceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceEvent', + 'updatePlatformResourceEvent', + 'platformResourceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceEventInput', + 'id', + 'platformResourceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "updatePlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'updatePlatformResourceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceEvent: { platformResourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceEvent", "deletePlatformResourceEvent", "platformResourceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformResourceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceEvent', + 'deletePlatformResourceEvent', + 'platformResourceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformResourceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceEvent", - fieldName: "deletePlatformResourceEvent", + operation: 'mutation', + operationName: 'PlatformResourceEvent', + fieldName: 'deletePlatformResourceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourceInstallation.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourceInstallation.ts index 9c839409d9..6da38f597c 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourceInstallation.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourceInstallation.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceInstallation, PlatformResourceInstallationWithRelations, PlatformResourceInstallationSelect, PlatformResourceInstallationFilter, PlatformResourceInstallationOrderBy, CreatePlatformResourceInstallationInput, UpdatePlatformResourceInstallationInput, PlatformResourceInstallationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceInstallation, + PlatformResourceInstallationWithRelations, + PlatformResourceInstallationSelect, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy, + CreatePlatformResourceInstallationInput, + UpdatePlatformResourceInstallationInput, + PlatformResourceInstallationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceInstallationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallations: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceInstallation", "platformResourceInstallations", 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 - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + 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, + }, + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallations", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallation: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceInstallationFilter, + PlatformResourceInstallationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceInstallation", "platformResourceInstallations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallation", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallation', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceInstallation": data.platformResourceInstallations?.nodes?.[0] ?? null - }) + platformResourceInstallation: data.platformResourceInstallations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceInstallation: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceInstallation: InferSelectResult< + PlatformResourceInstallationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceInstallation", "platformResourceInstallations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceInstallation', + 'platformResourceInstallations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceInstallationFilter", "PlatformResourceInstallationOrderBy", connectionFieldsMap); + 'PlatformResourceInstallationFilter', + 'PlatformResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceInstallation", - fieldName: "platformResourceInstallation", + operation: 'query', + operationName: 'PlatformResourceInstallation', + fieldName: 'platformResourceInstallation', document, variables, transform: (data: { @@ -93,74 +156,106 @@ export class PlatformResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceInstallation": data.platformResourceInstallations?.nodes?.[0] ?? null - }) + platformResourceInstallation: data.platformResourceInstallations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceInstallation", "createPlatformResourceInstallation", "platformResourceInstallation", args.select, args.data, "CreatePlatformResourceInstallationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceInstallation', + 'createPlatformResourceInstallation', + 'platformResourceInstallation', + args.select, + args.data, + 'CreatePlatformResourceInstallationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "createPlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'createPlatformResourceInstallation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceInstallationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceInstallation", "updatePlatformResourceInstallation", "platformResourceInstallation", args.select, args.where.id, args.data, "UpdatePlatformResourceInstallationInput", "id", "platformResourceInstallationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceInstallation', + 'updatePlatformResourceInstallation', + 'platformResourceInstallation', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceInstallationInput', + 'id', + 'platformResourceInstallationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "updatePlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'updatePlatformResourceInstallation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceInstallation: { platformResourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceInstallation", "deletePlatformResourceInstallation", "platformResourceInstallation", { - id: args.where.id - }, "DeletePlatformResourceInstallationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceInstallation', + 'deletePlatformResourceInstallation', + 'platformResourceInstallation', + { + id: args.where.id, + }, + 'DeletePlatformResourceInstallationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceInstallation", - fieldName: "deletePlatformResourceInstallation", + operation: 'mutation', + operationName: 'PlatformResourceInstallation', + fieldName: 'deletePlatformResourceInstallation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourceStatusCheck.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourceStatusCheck.ts index 2acb231904..16f33db355 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourceStatusCheck.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourceStatusCheck.ts @@ -3,56 +3,105 @@ * @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 { PlatformResourceStatusCheck, PlatformResourceStatusCheckWithRelations, PlatformResourceStatusCheckSelect, PlatformResourceStatusCheckFilter, PlatformResourceStatusCheckOrderBy, CreatePlatformResourceStatusCheckInput, UpdatePlatformResourceStatusCheckInput, PlatformResourceStatusCheckPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceStatusCheck, + PlatformResourceStatusCheckWithRelations, + PlatformResourceStatusCheckSelect, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy, + CreatePlatformResourceStatusCheckInput, + UpdatePlatformResourceStatusCheckInput, + PlatformResourceStatusCheckPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceStatusCheckModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusChecks: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusChecks: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", 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 - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + 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, + }, + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusChecks", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusChecks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusCheck: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceStatusCheckFilter, + PlatformResourceStatusCheckOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusCheck", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusCheck', document, variables, transform: (data: { @@ -60,32 +109,42 @@ export class PlatformResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceStatusCheck": data.platformResourceStatusChecks?.nodes?.[0] ?? null - }) + platformResourceStatusCheck: data.platformResourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceStatusCheck: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceStatusCheck: InferSelectResult< + PlatformResourceStatusCheckWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceStatusCheck", "platformResourceStatusChecks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceStatusCheck', + 'platformResourceStatusChecks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceStatusCheckFilter", "PlatformResourceStatusCheckOrderBy", connectionFieldsMap); + 'PlatformResourceStatusCheckFilter', + 'PlatformResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceStatusCheck", - fieldName: "platformResourceStatusCheck", + operation: 'query', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'platformResourceStatusCheck', document, variables, transform: (data: { @@ -93,74 +152,106 @@ export class PlatformResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceStatusCheck": data.platformResourceStatusChecks?.nodes?.[0] ?? null - }) + platformResourceStatusCheck: data.platformResourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceStatusCheck", "createPlatformResourceStatusCheck", "platformResourceStatusCheck", args.select, args.data, "CreatePlatformResourceStatusCheckInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceStatusCheck', + 'createPlatformResourceStatusCheck', + 'platformResourceStatusCheck', + args.select, + args.data, + 'CreatePlatformResourceStatusCheckInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "createPlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'createPlatformResourceStatusCheck', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformResourceStatusCheckPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceStatusCheck", "updatePlatformResourceStatusCheck", "platformResourceStatusCheck", args.select, args.where.id, args.data, "UpdatePlatformResourceStatusCheckInput", "id", "platformResourceStatusCheckPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceStatusCheck', + 'updatePlatformResourceStatusCheck', + 'platformResourceStatusCheck', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceStatusCheckInput', + 'id', + 'platformResourceStatusCheckPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "updatePlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'updatePlatformResourceStatusCheck', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceStatusCheck: { platformResourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceStatusCheck", "deletePlatformResourceStatusCheck", "platformResourceStatusCheck", { - id: args.where.id - }, "DeletePlatformResourceStatusCheckInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceStatusCheck', + 'deletePlatformResourceStatusCheck', + 'platformResourceStatusCheck', + { + id: args.where.id, + }, + 'DeletePlatformResourceStatusCheckInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceStatusCheck", - fieldName: "deletePlatformResourceStatusCheck", + operation: 'mutation', + operationName: 'PlatformResourceStatusCheck', + fieldName: 'deletePlatformResourceStatusCheck', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourceUsageLog.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourceUsageLog.ts index 41dd01a24e..276c7f50d9 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourceUsageLog.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourceUsageLog.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourceUsageLog, PlatformResourceUsageLogWithRelations, PlatformResourceUsageLogSelect, PlatformResourceUsageLogFilter, PlatformResourceUsageLogOrderBy, CreatePlatformResourceUsageLogInput, UpdatePlatformResourceUsageLogInput, PlatformResourceUsageLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUsageLog, + PlatformResourceUsageLogWithRelations, + PlatformResourceUsageLogSelect, + PlatformResourceUsageLogFilter, + PlatformResourceUsageLogOrderBy, + CreatePlatformResourceUsageLogInput, + UpdatePlatformResourceUsageLogInput, + PlatformResourceUsageLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUsageLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageLogs: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageLogs: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", 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 - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + 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, + }, + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLogs", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLog", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLog', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageLog": data.platformResourceUsageLogs?.nodes?.[0] ?? null - }) + platformResourceUsageLog: data.platformResourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageLog", "platformResourceUsageLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageLog', + 'platformResourceUsageLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceUsageLogFilter", "PlatformResourceUsageLogOrderBy", connectionFieldsMap); + 'PlatformResourceUsageLogFilter', + 'PlatformResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageLog", - fieldName: "platformResourceUsageLog", + operation: 'query', + operationName: 'PlatformResourceUsageLog', + fieldName: 'platformResourceUsageLog', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageLog": data.platformResourceUsageLogs?.nodes?.[0] ?? null - }) + platformResourceUsageLog: data.platformResourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUsageLog", "createPlatformResourceUsageLog", "platformResourceUsageLog", args.select, args.data, "CreatePlatformResourceUsageLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUsageLog', + 'createPlatformResourceUsageLog', + 'platformResourceUsageLog', + args.select, + args.data, + 'CreatePlatformResourceUsageLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "createPlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'createPlatformResourceUsageLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + sampledAt: string; + }, + PlatformResourceUsageLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceUsageLog", "updatePlatformResourceUsageLog", "platformResourceUsageLog", args.select, args.where.id, args.data, "UpdatePlatformResourceUsageLogInput", "id", "platformResourceUsageLogPatch", connectionFieldsMap, { - sampledAt: args.where.sampledAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceUsageLog', + 'updatePlatformResourceUsageLog', + 'platformResourceUsageLog', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceUsageLogInput', + 'id', + 'platformResourceUsageLogPatch', + connectionFieldsMap, + { + sampledAt: args.where.sampledAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "updatePlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'updatePlatformResourceUsageLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - sampledAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + sampledAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceUsageLog: { platformResourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceUsageLog", "deletePlatformResourceUsageLog", "platformResourceUsageLog", { - id: args.where.id, - sampledAt: args.where.sampledAt - }, "DeletePlatformResourceUsageLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceUsageLog', + 'deletePlatformResourceUsageLog', + 'platformResourceUsageLog', + { + id: args.where.id, + sampledAt: args.where.sampledAt, + }, + 'DeletePlatformResourceUsageLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageLog", - fieldName: "deletePlatformResourceUsageLog", + operation: 'mutation', + operationName: 'PlatformResourceUsageLog', + fieldName: 'deletePlatformResourceUsageLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourceUsageSummary.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourceUsageSummary.ts index 27e92a00e7..3d6efa4823 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourceUsageSummary.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourceUsageSummary.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourceUsageSummary, PlatformResourceUsageSummaryWithRelations, PlatformResourceUsageSummarySelect, PlatformResourceUsageSummaryFilter, PlatformResourceUsageSummaryOrderBy, CreatePlatformResourceUsageSummaryInput, UpdatePlatformResourceUsageSummaryInput, PlatformResourceUsageSummaryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUsageSummary, + PlatformResourceUsageSummaryWithRelations, + PlatformResourceUsageSummarySelect, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy, + CreatePlatformResourceUsageSummaryInput, + UpdatePlatformResourceUsageSummaryInput, + PlatformResourceUsageSummaryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUsageSummaryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummaries: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummaries: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", 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 - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + 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, + }, + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummaries", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummaries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummary: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceUsageSummaryFilter, + PlatformResourceUsageSummaryOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummary", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummary', document, variables, transform: (data: { @@ -60,32 +113,42 @@ export class PlatformResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageSummary": data.platformResourceUsageSummaries?.nodes?.[0] ?? null - }) + platformResourceUsageSummary: data.platformResourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUsageSummary: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUsageSummary: InferSelectResult< + PlatformResourceUsageSummaryWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUsageSummary", "platformResourceUsageSummaries", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUsageSummary', + 'platformResourceUsageSummaries', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourceUsageSummaryFilter", "PlatformResourceUsageSummaryOrderBy", connectionFieldsMap); + 'PlatformResourceUsageSummaryFilter', + 'PlatformResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUsageSummary", - fieldName: "platformResourceUsageSummary", + operation: 'query', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'platformResourceUsageSummary', document, variables, transform: (data: { @@ -93,79 +156,111 @@ export class PlatformResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUsageSummary": data.platformResourceUsageSummaries?.nodes?.[0] ?? null - }) + platformResourceUsageSummary: data.platformResourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUsageSummary", "createPlatformResourceUsageSummary", "platformResourceUsageSummary", args.select, args.data, "CreatePlatformResourceUsageSummaryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUsageSummary', + 'createPlatformResourceUsageSummary', + 'platformResourceUsageSummary', + args.select, + args.data, + 'CreatePlatformResourceUsageSummaryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "createPlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'createPlatformResourceUsageSummary', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + date: string; + }, + PlatformResourceUsageSummaryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformResourceUsageSummary", "updatePlatformResourceUsageSummary", "platformResourceUsageSummary", args.select, args.where.id, args.data, "UpdatePlatformResourceUsageSummaryInput", "id", "platformResourceUsageSummaryPatch", connectionFieldsMap, { - date: args.where.date - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformResourceUsageSummary', + 'updatePlatformResourceUsageSummary', + 'platformResourceUsageSummary', + args.select, + args.where.id, + args.data, + 'UpdatePlatformResourceUsageSummaryInput', + 'id', + 'platformResourceUsageSummaryPatch', + connectionFieldsMap, + { + date: args.where.date, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "updatePlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'updatePlatformResourceUsageSummary', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - date: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + date: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformResourceUsageSummary: { platformResourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformResourceUsageSummary", "deletePlatformResourceUsageSummary", "platformResourceUsageSummary", { - id: args.where.id, - date: args.where.date - }, "DeletePlatformResourceUsageSummaryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformResourceUsageSummary', + 'deletePlatformResourceUsageSummary', + 'platformResourceUsageSummary', + { + id: args.where.id, + date: args.where.date, + }, + 'DeletePlatformResourceUsageSummaryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUsageSummary", - fieldName: "deletePlatformResourceUsageSummary", + operation: 'mutation', + operationName: 'PlatformResourceUsageSummary', + fieldName: 'deletePlatformResourceUsageSummary', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourceUtilization.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourceUtilization.ts index e4d7fa813d..040d38000e 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourceUtilization.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourceUtilization.ts @@ -3,56 +3,105 @@ * @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 { PlatformResourceUtilization, PlatformResourceUtilizationWithRelations, PlatformResourceUtilizationSelect, PlatformResourceUtilizationFilter, PlatformResourceUtilizationOrderBy, CreatePlatformResourceUtilizationInput, UpdatePlatformResourceUtilizationInput, PlatformResourceUtilizationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourceUtilization, + PlatformResourceUtilizationWithRelations, + PlatformResourceUtilizationSelect, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy, + CreatePlatformResourceUtilizationInput, + UpdatePlatformResourceUtilizationInput, + PlatformResourceUtilizationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourceUtilizationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUtilizations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUtilizations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourceUtilization", "platformResourceUtilizations", 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 - }, "PlatformResourceUtilizationFilter", "PlatformResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourceUtilization', + 'platformResourceUtilizations', + 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, + }, + 'PlatformResourceUtilizationFilter', + 'PlatformResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUtilization", - fieldName: "platformResourceUtilizations", + operation: 'query', + operationName: 'PlatformResourceUtilization', + fieldName: 'platformResourceUtilizations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourceUtilization: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourceUtilizationFilter, + PlatformResourceUtilizationOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourceUtilization: InferSelectResult< + PlatformResourceUtilizationWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourceUtilization", "platformResourceUtilizations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourceUtilizationFilter", "PlatformResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourceUtilization', + 'platformResourceUtilizations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourceUtilizationFilter', + 'PlatformResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourceUtilization", - fieldName: "platformResourceUtilization", + operation: 'query', + operationName: 'PlatformResourceUtilization', + fieldName: 'platformResourceUtilization', document, variables, transform: (data: { @@ -60,28 +109,35 @@ export class PlatformResourceUtilizationModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourceUtilization": data.platformResourceUtilizations?.nodes?.[0] ?? null - }) + platformResourceUtilization: data.platformResourceUtilizations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourceUtilization: { platformResourceUtilization: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourceUtilization", "createPlatformResourceUtilization", "platformResourceUtilization", args.select, args.data, "CreatePlatformResourceUtilizationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourceUtilization', + 'createPlatformResourceUtilization', + 'platformResourceUtilization', + args.select, + args.data, + 'CreatePlatformResourceUtilizationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourceUtilization", - fieldName: "createPlatformResourceUtilization", + operation: 'mutation', + operationName: 'PlatformResourceUtilization', + fieldName: 'createPlatformResourceUtilization', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourcesHealth.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourcesHealth.ts index 5c57532e6c..0f0efa3e31 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourcesHealth.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourcesHealth.ts @@ -3,56 +3,98 @@ * @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 { PlatformResourcesHealth, PlatformResourcesHealthWithRelations, PlatformResourcesHealthSelect, PlatformResourcesHealthFilter, PlatformResourcesHealthOrderBy, CreatePlatformResourcesHealthInput, UpdatePlatformResourcesHealthInput, PlatformResourcesHealthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesHealth, + PlatformResourcesHealthWithRelations, + PlatformResourcesHealthSelect, + PlatformResourcesHealthFilter, + PlatformResourcesHealthOrderBy, + CreatePlatformResourcesHealthInput, + UpdatePlatformResourcesHealthInput, + PlatformResourcesHealthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesHealthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesHealths: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesHealths: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesHealth", "platformResourcesHealths", 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 - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + 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, + }, + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealths", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesHealth", "platformResourcesHealths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealth", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealth', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesHealth": data.platformResourcesHealths?.nodes?.[0] ?? null - }) + platformResourcesHealth: data.platformResourcesHealths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformResourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesHealth", "platformResourcesHealths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesHealth', + 'platformResourcesHealths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformResourcesHealthFilter", "PlatformResourcesHealthOrderBy", connectionFieldsMap); + 'PlatformResourcesHealthFilter', + 'PlatformResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesHealth", - fieldName: "platformResourcesHealth", + operation: 'query', + operationName: 'PlatformResourcesHealth', + fieldName: 'platformResourcesHealth', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PlatformResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesHealth": data.platformResourcesHealths?.nodes?.[0] ?? null - }) + platformResourcesHealth: data.platformResourcesHealths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesHealth: { platformResourcesHealth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesHealth", "createPlatformResourcesHealth", "platformResourcesHealth", args.select, args.data, "CreatePlatformResourcesHealthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesHealth', + 'createPlatformResourcesHealth', + 'platformResourcesHealth', + args.select, + args.data, + 'CreatePlatformResourcesHealthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesHealth", - fieldName: "createPlatformResourcesHealth", + operation: 'mutation', + operationName: 'PlatformResourcesHealth', + fieldName: 'createPlatformResourcesHealth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourcesRequirementsState.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourcesRequirementsState.ts index 634b4945d0..ab6152e426 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourcesRequirementsState.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourcesRequirementsState.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourcesRequirementsState, PlatformResourcesRequirementsStateWithRelations, PlatformResourcesRequirementsStateSelect, PlatformResourcesRequirementsStateFilter, PlatformResourcesRequirementsStateOrderBy, CreatePlatformResourcesRequirementsStateInput, UpdatePlatformResourcesRequirementsStateInput, PlatformResourcesRequirementsStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesRequirementsState, + PlatformResourcesRequirementsStateWithRelations, + PlatformResourcesRequirementsStateSelect, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy, + CreatePlatformResourcesRequirementsStateInput, + UpdatePlatformResourcesRequirementsStateInput, + PlatformResourcesRequirementsStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesRequirementsStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesRequirementsStates: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesRequirementsState", "platformResourcesRequirementsStates", 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 - }, "PlatformResourcesRequirementsStateFilter", "PlatformResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesRequirementsState', + 'platformResourcesRequirementsStates', + 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, + }, + 'PlatformResourcesRequirementsStateFilter', + 'PlatformResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesRequirementsState", - fieldName: "platformResourcesRequirementsStates", + operation: 'query', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'platformResourcesRequirementsStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesRequirementsState: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourcesRequirementsStateFilter, + PlatformResourcesRequirementsStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesRequirementsState: InferSelectResult< + PlatformResourcesRequirementsStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesRequirementsState", "platformResourcesRequirementsStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesRequirementsStateFilter", "PlatformResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesRequirementsState', + 'platformResourcesRequirementsStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesRequirementsStateFilter', + 'PlatformResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesRequirementsState", - fieldName: "platformResourcesRequirementsState", + operation: 'query', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'platformResourcesRequirementsState', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourcesRequirementsStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesRequirementsState": data.platformResourcesRequirementsStates?.nodes?.[0] ?? null - }) + platformResourcesRequirementsState: + data.platformResourcesRequirementsStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourcesRequirementsStateInput['platformResourcesRequirementsState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesRequirementsState: { - platformResourcesRequirementsState: InferSelectResult; + platformResourcesRequirementsState: InferSelectResult< + PlatformResourcesRequirementsStateWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesRequirementsState", "createPlatformResourcesRequirementsState", "platformResourcesRequirementsState", args.select, args.data, "CreatePlatformResourcesRequirementsStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesRequirementsState', + 'createPlatformResourcesRequirementsState', + 'platformResourcesRequirementsState', + args.select, + args.data, + 'CreatePlatformResourcesRequirementsStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesRequirementsState", - fieldName: "createPlatformResourcesRequirementsState", + operation: 'mutation', + operationName: 'PlatformResourcesRequirementsState', + fieldName: 'createPlatformResourcesRequirementsState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformResourcesResolvedRequirement.ts b/sdk/constructive-sdk/src/compute/orm/models/platformResourcesResolvedRequirement.ts index 35ddaae650..d7d7bf4ed0 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformResourcesResolvedRequirement.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformResourcesResolvedRequirement.ts @@ -3,56 +3,109 @@ * @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 { PlatformResourcesResolvedRequirement, PlatformResourcesResolvedRequirementWithRelations, PlatformResourcesResolvedRequirementSelect, PlatformResourcesResolvedRequirementFilter, PlatformResourcesResolvedRequirementOrderBy, CreatePlatformResourcesResolvedRequirementInput, UpdatePlatformResourcesResolvedRequirementInput, PlatformResourcesResolvedRequirementPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformResourcesResolvedRequirement, + PlatformResourcesResolvedRequirementWithRelations, + PlatformResourcesResolvedRequirementSelect, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy, + CreatePlatformResourcesResolvedRequirementInput, + UpdatePlatformResourcesResolvedRequirementInput, + PlatformResourcesResolvedRequirementPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformResourcesResolvedRequirementModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesResolvedRequirements: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirements", 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 - }, "PlatformResourcesResolvedRequirementFilter", "PlatformResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirements', + 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, + }, + 'PlatformResourcesResolvedRequirementFilter', + 'PlatformResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "platformResourcesResolvedRequirements", + operation: 'query', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'platformResourcesResolvedRequirements', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformResourcesResolvedRequirement: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformResourcesResolvedRequirementFilter, + PlatformResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformResourcesResolvedRequirement: InferSelectResult< + PlatformResourcesResolvedRequirementWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirements", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformResourcesResolvedRequirementFilter", "PlatformResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirements', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformResourcesResolvedRequirementFilter', + 'PlatformResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "platformResourcesResolvedRequirement", + operation: 'query', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'platformResourcesResolvedRequirement', document, variables, transform: (data: { @@ -60,28 +113,42 @@ export class PlatformResourcesResolvedRequirementModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformResourcesResolvedRequirement": data.platformResourcesResolvedRequirements?.nodes?.[0] ?? null - }) + platformResourcesResolvedRequirement: + data.platformResourcesResolvedRequirements?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformResourcesResolvedRequirementInput['platformResourcesResolvedRequirement'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformResourcesResolvedRequirement: { - platformResourcesResolvedRequirement: InferSelectResult; + platformResourcesResolvedRequirement: InferSelectResult< + PlatformResourcesResolvedRequirementWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformResourcesResolvedRequirement", "createPlatformResourcesResolvedRequirement", "platformResourcesResolvedRequirement", args.select, args.data, "CreatePlatformResourcesResolvedRequirementInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformResourcesResolvedRequirement', + 'createPlatformResourcesResolvedRequirement', + 'platformResourcesResolvedRequirement', + args.select, + args.data, + 'CreatePlatformResourcesResolvedRequirementInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformResourcesResolvedRequirement", - fieldName: "createPlatformResourcesResolvedRequirement", + operation: 'mutation', + operationName: 'PlatformResourcesResolvedRequirement', + fieldName: 'createPlatformResourcesResolvedRequirement', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformWebhookEndpoint.ts b/sdk/constructive-sdk/src/compute/orm/models/platformWebhookEndpoint.ts index 99cce4fbc4..63d0e119ff 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformWebhookEndpoint.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformWebhookEndpoint.ts @@ -3,56 +3,98 @@ * @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 { PlatformWebhookEndpoint, PlatformWebhookEndpointWithRelations, PlatformWebhookEndpointSelect, PlatformWebhookEndpointFilter, PlatformWebhookEndpointOrderBy, CreatePlatformWebhookEndpointInput, UpdatePlatformWebhookEndpointInput, PlatformWebhookEndpointPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformWebhookEndpoint, + PlatformWebhookEndpointWithRelations, + PlatformWebhookEndpointSelect, + PlatformWebhookEndpointFilter, + PlatformWebhookEndpointOrderBy, + CreatePlatformWebhookEndpointInput, + UpdatePlatformWebhookEndpointInput, + PlatformWebhookEndpointPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformWebhookEndpointModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformWebhookEndpoints: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformWebhookEndpoints: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", 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 - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + 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, + }, + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoints", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoint", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoint', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformWebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEndpoint": data.platformWebhookEndpoints?.nodes?.[0] ?? null - }) + platformWebhookEndpoint: data.platformWebhookEndpoints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEndpoint", "platformWebhookEndpoints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEndpoint', + 'platformWebhookEndpoints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformWebhookEndpointFilter", "PlatformWebhookEndpointOrderBy", connectionFieldsMap); + 'PlatformWebhookEndpointFilter', + 'PlatformWebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEndpoint", - fieldName: "platformWebhookEndpoint", + operation: 'query', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'platformWebhookEndpoint', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformWebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEndpoint": data.platformWebhookEndpoints?.nodes?.[0] ?? null - }) + platformWebhookEndpoint: data.platformWebhookEndpoints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformWebhookEndpoint", "createPlatformWebhookEndpoint", "platformWebhookEndpoint", args.select, args.data, "CreatePlatformWebhookEndpointInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformWebhookEndpoint', + 'createPlatformWebhookEndpoint', + 'platformWebhookEndpoint', + args.select, + args.data, + 'CreatePlatformWebhookEndpointInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "createPlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'createPlatformWebhookEndpoint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformWebhookEndpointPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformWebhookEndpoint", "updatePlatformWebhookEndpoint", "platformWebhookEndpoint", args.select, args.where.id, args.data, "UpdatePlatformWebhookEndpointInput", "id", "platformWebhookEndpointPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformWebhookEndpoint', + 'updatePlatformWebhookEndpoint', + 'platformWebhookEndpoint', + args.select, + args.where.id, + args.data, + 'UpdatePlatformWebhookEndpointInput', + 'id', + 'platformWebhookEndpointPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "updatePlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'updatePlatformWebhookEndpoint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformWebhookEndpoint: { platformWebhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformWebhookEndpoint", "deletePlatformWebhookEndpoint", "platformWebhookEndpoint", { - id: args.where.id - }, "DeletePlatformWebhookEndpointInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformWebhookEndpoint', + 'deletePlatformWebhookEndpoint', + 'platformWebhookEndpoint', + { + id: args.where.id, + }, + 'DeletePlatformWebhookEndpointInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEndpoint", - fieldName: "deletePlatformWebhookEndpoint", + operation: 'mutation', + operationName: 'PlatformWebhookEndpoint', + fieldName: 'deletePlatformWebhookEndpoint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/platformWebhookEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/platformWebhookEvent.ts index dc04e82a10..ee3318064c 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/platformWebhookEvent.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/platformWebhookEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformWebhookEvent, PlatformWebhookEventWithRelations, PlatformWebhookEventSelect, PlatformWebhookEventFilter, PlatformWebhookEventOrderBy, CreatePlatformWebhookEventInput, UpdatePlatformWebhookEventInput, PlatformWebhookEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformWebhookEvent, + PlatformWebhookEventWithRelations, + PlatformWebhookEventSelect, + PlatformWebhookEventFilter, + PlatformWebhookEventOrderBy, + CreatePlatformWebhookEventInput, + UpdatePlatformWebhookEventInput, + PlatformWebhookEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformWebhookEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformWebhookEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformWebhookEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEvent", "platformWebhookEvents", 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 - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + 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, + }, + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvents", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformWebhookEvent", "platformWebhookEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvent", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformWebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEvent": data.platformWebhookEvents?.nodes?.[0] ?? null - }) + platformWebhookEvent: data.platformWebhookEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformWebhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformWebhookEvent", "platformWebhookEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformWebhookEvent', + 'platformWebhookEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformWebhookEventFilter", "PlatformWebhookEventOrderBy", connectionFieldsMap); + 'PlatformWebhookEventFilter', + 'PlatformWebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformWebhookEvent", - fieldName: "platformWebhookEvent", + operation: 'query', + operationName: 'PlatformWebhookEvent', + fieldName: 'platformWebhookEvent', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class PlatformWebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformWebhookEvent": data.platformWebhookEvents?.nodes?.[0] ?? null - }) + platformWebhookEvent: data.platformWebhookEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformWebhookEvent", "createPlatformWebhookEvent", "platformWebhookEvent", args.select, args.data, "CreatePlatformWebhookEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformWebhookEvent', + 'createPlatformWebhookEvent', + 'platformWebhookEvent', + args.select, + args.data, + 'CreatePlatformWebhookEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "createPlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'createPlatformWebhookEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformWebhookEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformWebhookEvent", "updatePlatformWebhookEvent", "platformWebhookEvent", args.select, args.where.id, args.data, "UpdatePlatformWebhookEventInput", "id", "platformWebhookEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformWebhookEvent', + 'updatePlatformWebhookEvent', + 'platformWebhookEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformWebhookEventInput', + 'id', + 'platformWebhookEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "updatePlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'updatePlatformWebhookEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformWebhookEvent: { platformWebhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformWebhookEvent", "deletePlatformWebhookEvent", "platformWebhookEvent", { - id: args.where.id - }, "DeletePlatformWebhookEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformWebhookEvent', + 'deletePlatformWebhookEvent', + 'platformWebhookEvent', + { + id: args.where.id, + }, + 'DeletePlatformWebhookEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformWebhookEvent", - fieldName: "deletePlatformWebhookEvent", + operation: 'mutation', + operationName: 'PlatformWebhookEvent', + fieldName: 'deletePlatformWebhookEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resource.ts b/sdk/constructive-sdk/src/compute/orm/models/resource.ts index 5897835c08..b4b60ad6f3 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resource.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resource.ts @@ -3,56 +3,96 @@ * @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 { Resource, ResourceWithRelations, ResourceSelect, ResourceFilter, ResourceOrderBy, CreateResourceInput, UpdateResourceInput, ResourcePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Resource, + ResourceWithRelations, + ResourceSelect, + ResourceFilter, + ResourceOrderBy, + CreateResourceInput, + UpdateResourceInput, + ResourcePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resources: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Resource", "resources", 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 - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Resource', + 'resources', + 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, + }, + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resources", + operation: 'query', + operationName: 'Resource', + fieldName: 'resources', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Resource", "resources", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Resource', + 'resources', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resource", + operation: 'query', + operationName: 'Resource', + fieldName: 'resource', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "resource": data.resources?.nodes?.[0] ?? null - }) + resource: data.resources?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resource: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Resource", "resources", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Resource', + 'resources', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceFilter", "ResourceOrderBy", connectionFieldsMap); + 'ResourceFilter', + 'ResourceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Resource", - fieldName: "resource", + operation: 'query', + operationName: 'Resource', + fieldName: 'resource', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceModel { nodes?: InferSelectResult[]; }; }) => ({ - "resource": data.resources?.nodes?.[0] ?? null - }) + resource: data.resources?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Resource", "createResource", "resource", args.select, args.data, "CreateResourceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Resource', + 'createResource', + 'resource', + args.select, + args.data, + 'CreateResourceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "createResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'createResource', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourcePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Resource", "updateResource", "resource", args.select, args.where.id, args.data, "UpdateResourceInput", "id", "resourcePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Resource', + 'updateResource', + 'resource', + args.select, + args.where.id, + args.data, + 'UpdateResourceInput', + 'id', + 'resourcePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "updateResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'updateResource', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResource: { resource: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Resource", "deleteResource", "resource", { - id: args.where.id - }, "DeleteResourceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Resource', + 'deleteResource', + 'resource', + { + id: args.where.id, + }, + 'DeleteResourceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Resource", - fieldName: "deleteResource", + operation: 'mutation', + operationName: 'Resource', + fieldName: 'deleteResource', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourceDeclaredCapacity.ts b/sdk/constructive-sdk/src/compute/orm/models/resourceDeclaredCapacity.ts index a41ff9e316..6340979a98 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourceDeclaredCapacity.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourceDeclaredCapacity.ts @@ -3,56 +3,98 @@ * @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 { ResourceDeclaredCapacity, ResourceDeclaredCapacityWithRelations, ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityFilter, ResourceDeclaredCapacityOrderBy, CreateResourceDeclaredCapacityInput, UpdateResourceDeclaredCapacityInput, ResourceDeclaredCapacityPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceDeclaredCapacity, + ResourceDeclaredCapacityWithRelations, + ResourceDeclaredCapacitySelect, + ResourceDeclaredCapacityFilter, + ResourceDeclaredCapacityOrderBy, + CreateResourceDeclaredCapacityInput, + UpdateResourceDeclaredCapacityInput, + ResourceDeclaredCapacityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceDeclaredCapacityModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceDeclaredCapacities: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceDeclaredCapacities: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDeclaredCapacity", "resourceDeclaredCapacities", 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 - }, "ResourceDeclaredCapacityFilter", "ResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceDeclaredCapacity', + 'resourceDeclaredCapacities', + 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, + }, + 'ResourceDeclaredCapacityFilter', + 'ResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDeclaredCapacity", - fieldName: "resourceDeclaredCapacities", + operation: 'query', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'resourceDeclaredCapacities', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDeclaredCapacity: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceDeclaredCapacity", "resourceDeclaredCapacities", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceDeclaredCapacityFilter", "ResourceDeclaredCapacityOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceDeclaredCapacity', + 'resourceDeclaredCapacities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceDeclaredCapacityFilter', + 'ResourceDeclaredCapacityOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDeclaredCapacity", - fieldName: "resourceDeclaredCapacity", + operation: 'query', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'resourceDeclaredCapacity', document, variables, transform: (data: { @@ -60,28 +102,35 @@ export class ResourceDeclaredCapacityModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDeclaredCapacity": data.resourceDeclaredCapacities?.nodes?.[0] ?? null - }) + resourceDeclaredCapacity: data.resourceDeclaredCapacities?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceDeclaredCapacity: { resourceDeclaredCapacity: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceDeclaredCapacity", "createResourceDeclaredCapacity", "resourceDeclaredCapacity", args.select, args.data, "CreateResourceDeclaredCapacityInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceDeclaredCapacity', + 'createResourceDeclaredCapacity', + 'resourceDeclaredCapacity', + args.select, + args.data, + 'CreateResourceDeclaredCapacityInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDeclaredCapacity", - fieldName: "createResourceDeclaredCapacity", + operation: 'mutation', + operationName: 'ResourceDeclaredCapacity', + fieldName: 'createResourceDeclaredCapacity', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourceDefinition.ts b/sdk/constructive-sdk/src/compute/orm/models/resourceDefinition.ts index 3602f40743..26be134a8b 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourceDefinition.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourceDefinition.ts @@ -3,56 +3,96 @@ * @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 { ResourceDefinition, ResourceDefinitionWithRelations, ResourceDefinitionSelect, ResourceDefinitionFilter, ResourceDefinitionOrderBy, CreateResourceDefinitionInput, UpdateResourceDefinitionInput, ResourceDefinitionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceDefinition, + ResourceDefinitionWithRelations, + ResourceDefinitionSelect, + ResourceDefinitionFilter, + ResourceDefinitionOrderBy, + CreateResourceDefinitionInput, + UpdateResourceDefinitionInput, + ResourceDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceDefinitionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinitions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDefinition", "resourceDefinitions", 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 - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceDefinition', + 'resourceDefinitions', + 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, + }, + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinitions", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinitions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceDefinition", "resourceDefinitions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceDefinition', + 'resourceDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinition", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinition', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDefinition": data.resourceDefinitions?.nodes?.[0] ?? null - }) + resourceDefinition: data.resourceDefinitions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceDefinition: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceDefinition", "resourceDefinitions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceDefinition', + 'resourceDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceDefinitionFilter", "ResourceDefinitionOrderBy", connectionFieldsMap); + 'ResourceDefinitionFilter', + 'ResourceDefinitionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceDefinition", - fieldName: "resourceDefinition", + operation: 'query', + operationName: 'ResourceDefinition', + fieldName: 'resourceDefinition', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceDefinitionModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceDefinition": data.resourceDefinitions?.nodes?.[0] ?? null - }) + resourceDefinition: data.resourceDefinitions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceDefinition", "createResourceDefinition", "resourceDefinition", args.select, args.data, "CreateResourceDefinitionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceDefinition', + 'createResourceDefinition', + 'resourceDefinition', + args.select, + args.data, + 'CreateResourceDefinitionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "createResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'createResourceDefinition', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceDefinition", "updateResourceDefinition", "resourceDefinition", args.select, args.where.id, args.data, "UpdateResourceDefinitionInput", "id", "resourceDefinitionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceDefinition', + 'updateResourceDefinition', + 'resourceDefinition', + args.select, + args.where.id, + args.data, + 'UpdateResourceDefinitionInput', + 'id', + 'resourceDefinitionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "updateResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'updateResourceDefinition', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceDefinition: { resourceDefinition: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceDefinition", "deleteResourceDefinition", "resourceDefinition", { - id: args.where.id - }, "DeleteResourceDefinitionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceDefinition', + 'deleteResourceDefinition', + 'resourceDefinition', + { + id: args.where.id, + }, + 'DeleteResourceDefinitionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceDefinition", - fieldName: "deleteResourceDefinition", + operation: 'mutation', + operationName: 'ResourceDefinition', + fieldName: 'deleteResourceDefinition', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourceEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/resourceEvent.ts index f305a67427..9796098dc8 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourceEvent.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourceEvent.ts @@ -3,56 +3,96 @@ * @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 { ResourceEvent, ResourceEventWithRelations, ResourceEventSelect, ResourceEventFilter, ResourceEventOrderBy, CreateResourceEventInput, UpdateResourceEventInput, ResourceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceEvent, + ResourceEventWithRelations, + ResourceEventSelect, + ResourceEventFilter, + ResourceEventOrderBy, + CreateResourceEventInput, + UpdateResourceEventInput, + ResourceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceEvent", "resourceEvents", 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 - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceEvent', + 'resourceEvents', + 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, + }, + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvents", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceEvent", "resourceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceEvent', + 'resourceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvent", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceEvent": data.resourceEvents?.nodes?.[0] ?? null - }) + resourceEvent: data.resourceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceEvent", "resourceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceEvent', + 'resourceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceEventFilter", "ResourceEventOrderBy", connectionFieldsMap); + 'ResourceEventFilter', + 'ResourceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceEvent", - fieldName: "resourceEvent", + operation: 'query', + operationName: 'ResourceEvent', + fieldName: 'resourceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class ResourceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceEvent": data.resourceEvents?.nodes?.[0] ?? null - }) + resourceEvent: data.resourceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceEvent", "createResourceEvent", "resourceEvent", args.select, args.data, "CreateResourceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceEvent', + 'createResourceEvent', + 'resourceEvent', + args.select, + args.data, + 'CreateResourceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "createResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'createResourceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + ResourceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceEvent", "updateResourceEvent", "resourceEvent", args.select, args.where.id, args.data, "UpdateResourceEventInput", "id", "resourceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceEvent', + 'updateResourceEvent', + 'resourceEvent', + args.select, + args.where.id, + args.data, + 'UpdateResourceEventInput', + 'id', + 'resourceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "updateResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'updateResourceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceEvent: { resourceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceEvent", "deleteResourceEvent", "resourceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteResourceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceEvent', + 'deleteResourceEvent', + 'resourceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteResourceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceEvent", - fieldName: "deleteResourceEvent", + operation: 'mutation', + operationName: 'ResourceEvent', + fieldName: 'deleteResourceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourceInstallation.ts b/sdk/constructive-sdk/src/compute/orm/models/resourceInstallation.ts index 105f1b9ce5..dcdd64c3fd 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourceInstallation.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourceInstallation.ts @@ -3,56 +3,98 @@ * @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 { ResourceInstallation, ResourceInstallationWithRelations, ResourceInstallationSelect, ResourceInstallationFilter, ResourceInstallationOrderBy, CreateResourceInstallationInput, UpdateResourceInstallationInput, ResourceInstallationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceInstallation, + ResourceInstallationWithRelations, + ResourceInstallationSelect, + ResourceInstallationFilter, + ResourceInstallationOrderBy, + CreateResourceInstallationInput, + UpdateResourceInstallationInput, + ResourceInstallationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceInstallationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceInstallations: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceInstallations: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceInstallation", "resourceInstallations", 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 - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceInstallation', + 'resourceInstallations', + 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, + }, + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallations", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceInstallation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceInstallation", "resourceInstallations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceInstallation', + 'resourceInstallations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallation", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallation', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceInstallation": data.resourceInstallations?.nodes?.[0] ?? null - }) + resourceInstallation: data.resourceInstallations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceInstallation: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceInstallation", "resourceInstallations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceInstallation', + 'resourceInstallations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceInstallationFilter", "ResourceInstallationOrderBy", connectionFieldsMap); + 'ResourceInstallationFilter', + 'ResourceInstallationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceInstallation", - fieldName: "resourceInstallation", + operation: 'query', + operationName: 'ResourceInstallation', + fieldName: 'resourceInstallation', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ResourceInstallationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceInstallation": data.resourceInstallations?.nodes?.[0] ?? null - }) + resourceInstallation: data.resourceInstallations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceInstallation", "createResourceInstallation", "resourceInstallation", args.select, args.data, "CreateResourceInstallationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceInstallation', + 'createResourceInstallation', + 'resourceInstallation', + args.select, + args.data, + 'CreateResourceInstallationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "createResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'createResourceInstallation', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceInstallationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceInstallation", "updateResourceInstallation", "resourceInstallation", args.select, args.where.id, args.data, "UpdateResourceInstallationInput", "id", "resourceInstallationPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceInstallation', + 'updateResourceInstallation', + 'resourceInstallation', + args.select, + args.where.id, + args.data, + 'UpdateResourceInstallationInput', + 'id', + 'resourceInstallationPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "updateResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'updateResourceInstallation', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceInstallation: { resourceInstallation: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceInstallation", "deleteResourceInstallation", "resourceInstallation", { - id: args.where.id - }, "DeleteResourceInstallationInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceInstallation', + 'deleteResourceInstallation', + 'resourceInstallation', + { + id: args.where.id, + }, + 'DeleteResourceInstallationInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceInstallation", - fieldName: "deleteResourceInstallation", + operation: 'mutation', + operationName: 'ResourceInstallation', + fieldName: 'deleteResourceInstallation', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourceStatusCheck.ts b/sdk/constructive-sdk/src/compute/orm/models/resourceStatusCheck.ts index 31433f3673..e7241931ee 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourceStatusCheck.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourceStatusCheck.ts @@ -3,56 +3,96 @@ * @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 { ResourceStatusCheck, ResourceStatusCheckWithRelations, ResourceStatusCheckSelect, ResourceStatusCheckFilter, ResourceStatusCheckOrderBy, CreateResourceStatusCheckInput, UpdateResourceStatusCheckInput, ResourceStatusCheckPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceStatusCheck, + ResourceStatusCheckWithRelations, + ResourceStatusCheckSelect, + ResourceStatusCheckFilter, + ResourceStatusCheckOrderBy, + CreateResourceStatusCheckInput, + UpdateResourceStatusCheckInput, + ResourceStatusCheckPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceStatusCheckModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusChecks: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceStatusCheck", "resourceStatusChecks", 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 - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + 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, + }, + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusChecks", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusChecks', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusCheck: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceStatusCheck", "resourceStatusChecks", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusCheck", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusCheck', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceStatusCheck": data.resourceStatusChecks?.nodes?.[0] ?? null - }) + resourceStatusCheck: data.resourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceStatusCheck: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceStatusCheck", "resourceStatusChecks", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceStatusCheck', + 'resourceStatusChecks', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceStatusCheckFilter", "ResourceStatusCheckOrderBy", connectionFieldsMap); + 'ResourceStatusCheckFilter', + 'ResourceStatusCheckOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceStatusCheck", - fieldName: "resourceStatusCheck", + operation: 'query', + operationName: 'ResourceStatusCheck', + fieldName: 'resourceStatusCheck', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceStatusCheckModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceStatusCheck": data.resourceStatusChecks?.nodes?.[0] ?? null - }) + resourceStatusCheck: data.resourceStatusChecks?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceStatusCheck", "createResourceStatusCheck", "resourceStatusCheck", args.select, args.data, "CreateResourceStatusCheckInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceStatusCheck', + 'createResourceStatusCheck', + 'resourceStatusCheck', + args.select, + args.data, + 'CreateResourceStatusCheckInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "createResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'createResourceStatusCheck', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceStatusCheckPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceStatusCheck", "updateResourceStatusCheck", "resourceStatusCheck", args.select, args.where.id, args.data, "UpdateResourceStatusCheckInput", "id", "resourceStatusCheckPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceStatusCheck', + 'updateResourceStatusCheck', + 'resourceStatusCheck', + args.select, + args.where.id, + args.data, + 'UpdateResourceStatusCheckInput', + 'id', + 'resourceStatusCheckPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "updateResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'updateResourceStatusCheck', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceStatusCheck: { resourceStatusCheck: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceStatusCheck", "deleteResourceStatusCheck", "resourceStatusCheck", { - id: args.where.id - }, "DeleteResourceStatusCheckInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceStatusCheck', + 'deleteResourceStatusCheck', + 'resourceStatusCheck', + { + id: args.where.id, + }, + 'DeleteResourceStatusCheckInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceStatusCheck", - fieldName: "deleteResourceStatusCheck", + operation: 'mutation', + operationName: 'ResourceStatusCheck', + fieldName: 'deleteResourceStatusCheck', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourceUsageLog.ts b/sdk/constructive-sdk/src/compute/orm/models/resourceUsageLog.ts index fe263b008f..d5f3f5c79a 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourceUsageLog.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourceUsageLog.ts @@ -3,56 +3,96 @@ * @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 { ResourceUsageLog, ResourceUsageLogWithRelations, ResourceUsageLogSelect, ResourceUsageLogFilter, ResourceUsageLogOrderBy, CreateResourceUsageLogInput, UpdateResourceUsageLogInput, ResourceUsageLogPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUsageLog, + ResourceUsageLogWithRelations, + ResourceUsageLogSelect, + ResourceUsageLogFilter, + ResourceUsageLogOrderBy, + CreateResourceUsageLogInput, + UpdateResourceUsageLogInput, + ResourceUsageLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUsageLogModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLogs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageLog", "resourceUsageLogs", 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 - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + 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, + }, + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLogs", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLogs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUsageLog", "resourceUsageLogs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLog", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLog', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageLog": data.resourceUsageLogs?.nodes?.[0] ?? null - }) + resourceUsageLog: data.resourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageLog: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageLog", "resourceUsageLogs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceUsageLog', + 'resourceUsageLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceUsageLogFilter", "ResourceUsageLogOrderBy", connectionFieldsMap); + 'ResourceUsageLogFilter', + 'ResourceUsageLogOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageLog", - fieldName: "resourceUsageLog", + operation: 'query', + operationName: 'ResourceUsageLog', + fieldName: 'resourceUsageLog', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class ResourceUsageLogModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageLog": data.resourceUsageLogs?.nodes?.[0] ?? null - }) + resourceUsageLog: data.resourceUsageLogs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUsageLog", "createResourceUsageLog", "resourceUsageLog", args.select, args.data, "CreateResourceUsageLogInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUsageLog', + 'createResourceUsageLog', + 'resourceUsageLog', + args.select, + args.data, + 'CreateResourceUsageLogInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "createResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'createResourceUsageLog', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + sampledAt: string; + }, + ResourceUsageLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceUsageLog", "updateResourceUsageLog", "resourceUsageLog", args.select, args.where.id, args.data, "UpdateResourceUsageLogInput", "id", "resourceUsageLogPatch", connectionFieldsMap, { - sampledAt: args.where.sampledAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceUsageLog', + 'updateResourceUsageLog', + 'resourceUsageLog', + args.select, + args.where.id, + args.data, + 'UpdateResourceUsageLogInput', + 'id', + 'resourceUsageLogPatch', + connectionFieldsMap, + { + sampledAt: args.where.sampledAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "updateResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'updateResourceUsageLog', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - sampledAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + sampledAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceUsageLog: { resourceUsageLog: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceUsageLog", "deleteResourceUsageLog", "resourceUsageLog", { - id: args.where.id, - sampledAt: args.where.sampledAt - }, "DeleteResourceUsageLogInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceUsageLog', + 'deleteResourceUsageLog', + 'resourceUsageLog', + { + id: args.where.id, + sampledAt: args.where.sampledAt, + }, + 'DeleteResourceUsageLogInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageLog", - fieldName: "deleteResourceUsageLog", + operation: 'mutation', + operationName: 'ResourceUsageLog', + fieldName: 'deleteResourceUsageLog', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourceUsageSummary.ts b/sdk/constructive-sdk/src/compute/orm/models/resourceUsageSummary.ts index c4155013d3..3024a18d37 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourceUsageSummary.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourceUsageSummary.ts @@ -3,56 +3,98 @@ * @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 { ResourceUsageSummary, ResourceUsageSummaryWithRelations, ResourceUsageSummarySelect, ResourceUsageSummaryFilter, ResourceUsageSummaryOrderBy, CreateResourceUsageSummaryInput, UpdateResourceUsageSummaryInput, ResourceUsageSummaryPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUsageSummary, + ResourceUsageSummaryWithRelations, + ResourceUsageSummarySelect, + ResourceUsageSummaryFilter, + ResourceUsageSummaryOrderBy, + CreateResourceUsageSummaryInput, + UpdateResourceUsageSummaryInput, + ResourceUsageSummaryPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUsageSummaryModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourceUsageSummaries: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourceUsageSummaries: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageSummary", "resourceUsageSummaries", 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 - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + 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, + }, + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummaries", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummaries', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageSummary: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUsageSummary", "resourceUsageSummaries", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummary", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummary', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageSummary": data.resourceUsageSummaries?.nodes?.[0] ?? null - }) + resourceUsageSummary: data.resourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUsageSummary: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUsageSummary", "resourceUsageSummaries", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceUsageSummary', + 'resourceUsageSummaries', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceUsageSummaryFilter", "ResourceUsageSummaryOrderBy", connectionFieldsMap); + 'ResourceUsageSummaryFilter', + 'ResourceUsageSummaryOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUsageSummary", - fieldName: "resourceUsageSummary", + operation: 'query', + operationName: 'ResourceUsageSummary', + fieldName: 'resourceUsageSummary', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class ResourceUsageSummaryModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUsageSummary": data.resourceUsageSummaries?.nodes?.[0] ?? null - }) + resourceUsageSummary: data.resourceUsageSummaries?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUsageSummary", "createResourceUsageSummary", "resourceUsageSummary", args.select, args.data, "CreateResourceUsageSummaryInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUsageSummary', + 'createResourceUsageSummary', + 'resourceUsageSummary', + args.select, + args.data, + 'CreateResourceUsageSummaryInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "createResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'createResourceUsageSummary', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + date: string; + }, + ResourceUsageSummaryPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceUsageSummary", "updateResourceUsageSummary", "resourceUsageSummary", args.select, args.where.id, args.data, "UpdateResourceUsageSummaryInput", "id", "resourceUsageSummaryPatch", connectionFieldsMap, { - date: args.where.date - }); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceUsageSummary', + 'updateResourceUsageSummary', + 'resourceUsageSummary', + args.select, + args.where.id, + args.data, + 'UpdateResourceUsageSummaryInput', + 'id', + 'resourceUsageSummaryPatch', + connectionFieldsMap, + { + date: args.where.date, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "updateResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'updateResourceUsageSummary', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - date: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + date: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceUsageSummary: { resourceUsageSummary: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceUsageSummary", "deleteResourceUsageSummary", "resourceUsageSummary", { - id: args.where.id, - date: args.where.date - }, "DeleteResourceUsageSummaryInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceUsageSummary', + 'deleteResourceUsageSummary', + 'resourceUsageSummary', + { + id: args.where.id, + date: args.where.date, + }, + 'DeleteResourceUsageSummaryInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUsageSummary", - fieldName: "deleteResourceUsageSummary", + operation: 'mutation', + operationName: 'ResourceUsageSummary', + fieldName: 'deleteResourceUsageSummary', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourceUtilization.ts b/sdk/constructive-sdk/src/compute/orm/models/resourceUtilization.ts index 9314102ed0..3620486000 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourceUtilization.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourceUtilization.ts @@ -3,56 +3,96 @@ * @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 { ResourceUtilization, ResourceUtilizationWithRelations, ResourceUtilizationSelect, ResourceUtilizationFilter, ResourceUtilizationOrderBy, CreateResourceUtilizationInput, UpdateResourceUtilizationInput, ResourceUtilizationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceUtilization, + ResourceUtilizationWithRelations, + ResourceUtilizationSelect, + ResourceUtilizationFilter, + ResourceUtilizationOrderBy, + CreateResourceUtilizationInput, + UpdateResourceUtilizationInput, + ResourceUtilizationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceUtilizationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUtilizations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceUtilization", "resourceUtilizations", 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 - }, "ResourceUtilizationFilter", "ResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceUtilization', + 'resourceUtilizations', + 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, + }, + 'ResourceUtilizationFilter', + 'ResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUtilization", - fieldName: "resourceUtilizations", + operation: 'query', + operationName: 'ResourceUtilization', + fieldName: 'resourceUtilizations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceUtilization: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceUtilization", "resourceUtilizations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceUtilizationFilter", "ResourceUtilizationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceUtilization', + 'resourceUtilizations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceUtilizationFilter', + 'ResourceUtilizationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceUtilization", - fieldName: "resourceUtilization", + operation: 'query', + operationName: 'ResourceUtilization', + fieldName: 'resourceUtilization', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class ResourceUtilizationModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceUtilization": data.resourceUtilizations?.nodes?.[0] ?? null - }) + resourceUtilization: data.resourceUtilizations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceUtilization: { resourceUtilization: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceUtilization", "createResourceUtilization", "resourceUtilization", args.select, args.data, "CreateResourceUtilizationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceUtilization', + 'createResourceUtilization', + 'resourceUtilization', + args.select, + args.data, + 'CreateResourceUtilizationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceUtilization", - fieldName: "createResourceUtilization", + operation: 'mutation', + operationName: 'ResourceUtilization', + fieldName: 'createResourceUtilization', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourcesHealth.ts b/sdk/constructive-sdk/src/compute/orm/models/resourcesHealth.ts index 5e4515d396..1ac97bab3d 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourcesHealth.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourcesHealth.ts @@ -3,56 +3,96 @@ * @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 { ResourcesHealth, ResourcesHealthWithRelations, ResourcesHealthSelect, ResourcesHealthFilter, ResourcesHealthOrderBy, CreateResourcesHealthInput, UpdateResourcesHealthInput, ResourcesHealthPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesHealth, + ResourcesHealthWithRelations, + ResourcesHealthSelect, + ResourcesHealthFilter, + ResourcesHealthOrderBy, + CreateResourcesHealthInput, + UpdateResourcesHealthInput, + ResourcesHealthPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesHealthModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealths: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesHealth", "resourcesHealths", 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 - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesHealth', + 'resourcesHealths', + 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, + }, + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealths", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealths', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesHealth", "resourcesHealths", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesHealth', + 'resourcesHealths', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealth", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealth', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesHealth": data.resourcesHealths?.nodes?.[0] ?? null - }) + resourcesHealth: data.resourcesHealths?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourcesHealth: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesHealth", "resourcesHealths", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourcesHealth', + 'resourcesHealths', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourcesHealthFilter", "ResourcesHealthOrderBy", connectionFieldsMap); + 'ResourcesHealthFilter', + 'ResourcesHealthOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesHealth", - fieldName: "resourcesHealth", + operation: 'query', + operationName: 'ResourcesHealth', + fieldName: 'resourcesHealth', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class ResourcesHealthModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesHealth": data.resourcesHealths?.nodes?.[0] ?? null - }) + resourcesHealth: data.resourcesHealths?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesHealth: { resourcesHealth: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesHealth", "createResourcesHealth", "resourcesHealth", args.select, args.data, "CreateResourcesHealthInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesHealth', + 'createResourcesHealth', + 'resourcesHealth', + args.select, + args.data, + 'CreateResourcesHealthInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesHealth", - fieldName: "createResourcesHealth", + operation: 'mutation', + operationName: 'ResourcesHealth', + fieldName: 'createResourcesHealth', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourcesRequirementsState.ts b/sdk/constructive-sdk/src/compute/orm/models/resourcesRequirementsState.ts index f1a5f93c93..8ce68f6a31 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourcesRequirementsState.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourcesRequirementsState.ts @@ -3,56 +3,101 @@ * @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 { ResourcesRequirementsState, ResourcesRequirementsStateWithRelations, ResourcesRequirementsStateSelect, ResourcesRequirementsStateFilter, ResourcesRequirementsStateOrderBy, CreateResourcesRequirementsStateInput, UpdateResourcesRequirementsStateInput, ResourcesRequirementsStatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesRequirementsState, + ResourcesRequirementsStateWithRelations, + ResourcesRequirementsStateSelect, + ResourcesRequirementsStateFilter, + ResourcesRequirementsStateOrderBy, + CreateResourcesRequirementsStateInput, + UpdateResourcesRequirementsStateInput, + ResourcesRequirementsStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesRequirementsStateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesRequirementsStates: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesRequirementsStates: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesRequirementsState", "resourcesRequirementsStates", 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 - }, "ResourcesRequirementsStateFilter", "ResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesRequirementsState', + 'resourcesRequirementsStates', + 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, + }, + 'ResourcesRequirementsStateFilter', + 'ResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesRequirementsState", - fieldName: "resourcesRequirementsStates", + operation: 'query', + operationName: 'ResourcesRequirementsState', + fieldName: 'resourcesRequirementsStates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesRequirementsState: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesRequirementsState: InferSelectResult< + ResourcesRequirementsStateWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesRequirementsState", "resourcesRequirementsStates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesRequirementsStateFilter", "ResourcesRequirementsStateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesRequirementsState', + 'resourcesRequirementsStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesRequirementsStateFilter', + 'ResourcesRequirementsStateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesRequirementsState", - fieldName: "resourcesRequirementsState", + operation: 'query', + operationName: 'ResourcesRequirementsState', + fieldName: 'resourcesRequirementsState', document, variables, transform: (data: { @@ -60,28 +105,35 @@ export class ResourcesRequirementsStateModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesRequirementsState": data.resourcesRequirementsStates?.nodes?.[0] ?? null - }) + resourcesRequirementsState: data.resourcesRequirementsStates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesRequirementsState: { resourcesRequirementsState: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesRequirementsState", "createResourcesRequirementsState", "resourcesRequirementsState", args.select, args.data, "CreateResourcesRequirementsStateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesRequirementsState', + 'createResourcesRequirementsState', + 'resourcesRequirementsState', + args.select, + args.data, + 'CreateResourcesRequirementsStateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesRequirementsState", - fieldName: "createResourcesRequirementsState", + operation: 'mutation', + operationName: 'ResourcesRequirementsState', + fieldName: 'createResourcesRequirementsState', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/resourcesResolvedRequirement.ts b/sdk/constructive-sdk/src/compute/orm/models/resourcesResolvedRequirement.ts index 4f46896bdc..40680dcfb3 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/resourcesResolvedRequirement.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/resourcesResolvedRequirement.ts @@ -3,56 +3,109 @@ * @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 { ResourcesResolvedRequirement, ResourcesResolvedRequirementWithRelations, ResourcesResolvedRequirementSelect, ResourcesResolvedRequirementFilter, ResourcesResolvedRequirementOrderBy, CreateResourcesResolvedRequirementInput, UpdateResourcesResolvedRequirementInput, ResourcesResolvedRequirementPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourcesResolvedRequirement, + ResourcesResolvedRequirementWithRelations, + ResourcesResolvedRequirementSelect, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy, + CreateResourcesResolvedRequirementInput, + UpdateResourcesResolvedRequirementInput, + ResourcesResolvedRequirementPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourcesResolvedRequirementModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesResolvedRequirements: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesResolvedRequirements: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ResourcesResolvedRequirement", "resourcesResolvedRequirements", 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 - }, "ResourcesResolvedRequirementFilter", "ResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourcesResolvedRequirement', + 'resourcesResolvedRequirements', + 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, + }, + 'ResourcesResolvedRequirementFilter', + 'ResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesResolvedRequirement", - fieldName: "resourcesResolvedRequirements", + operation: 'query', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'resourcesResolvedRequirements', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - resourcesResolvedRequirement: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + ResourcesResolvedRequirementFilter, + ResourcesResolvedRequirementOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + resourcesResolvedRequirement: InferSelectResult< + ResourcesResolvedRequirementWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourcesResolvedRequirement", "resourcesResolvedRequirements", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourcesResolvedRequirementFilter", "ResourcesResolvedRequirementOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourcesResolvedRequirement', + 'resourcesResolvedRequirements', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourcesResolvedRequirementFilter', + 'ResourcesResolvedRequirementOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourcesResolvedRequirement", - fieldName: "resourcesResolvedRequirement", + operation: 'query', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'resourcesResolvedRequirement', document, variables, transform: (data: { @@ -60,28 +113,35 @@ export class ResourcesResolvedRequirementModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourcesResolvedRequirement": data.resourcesResolvedRequirements?.nodes?.[0] ?? null - }) + resourcesResolvedRequirement: data.resourcesResolvedRequirements?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourcesResolvedRequirement: { resourcesResolvedRequirement: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourcesResolvedRequirement", "createResourcesResolvedRequirement", "resourcesResolvedRequirement", args.select, args.data, "CreateResourcesResolvedRequirementInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourcesResolvedRequirement', + 'createResourcesResolvedRequirement', + 'resourcesResolvedRequirement', + args.select, + args.data, + 'CreateResourcesResolvedRequirementInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourcesResolvedRequirement", - fieldName: "createResourcesResolvedRequirement", + operation: 'mutation', + operationName: 'ResourcesResolvedRequirement', + fieldName: 'createResourcesResolvedRequirement', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/webhookEndpoint.ts b/sdk/constructive-sdk/src/compute/orm/models/webhookEndpoint.ts index 844febe287..a76f34249c 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/webhookEndpoint.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/webhookEndpoint.ts @@ -3,56 +3,96 @@ * @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 { WebhookEndpoint, WebhookEndpointWithRelations, WebhookEndpointSelect, WebhookEndpointFilter, WebhookEndpointOrderBy, CreateWebhookEndpointInput, UpdateWebhookEndpointInput, WebhookEndpointPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookEndpoint, + WebhookEndpointWithRelations, + WebhookEndpointSelect, + WebhookEndpointFilter, + WebhookEndpointOrderBy, + CreateWebhookEndpointInput, + UpdateWebhookEndpointInput, + WebhookEndpointPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookEndpointModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEndpoint", "webhookEndpoints", 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 - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + 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, + }, + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoints", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookEndpoint", "webhookEndpoints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoint", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEndpoint": data.webhookEndpoints?.nodes?.[0] ?? null - }) + webhookEndpoint: data.webhookEndpoints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEndpoint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEndpoint", "webhookEndpoints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookEndpoint', + 'webhookEndpoints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookEndpointFilter", "WebhookEndpointOrderBy", connectionFieldsMap); + 'WebhookEndpointFilter', + 'WebhookEndpointOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEndpoint", - fieldName: "webhookEndpoint", + operation: 'query', + operationName: 'WebhookEndpoint', + fieldName: 'webhookEndpoint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookEndpointModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEndpoint": data.webhookEndpoints?.nodes?.[0] ?? null - }) + webhookEndpoint: data.webhookEndpoints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookEndpoint", "createWebhookEndpoint", "webhookEndpoint", args.select, args.data, "CreateWebhookEndpointInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookEndpoint', + 'createWebhookEndpoint', + 'webhookEndpoint', + args.select, + args.data, + 'CreateWebhookEndpointInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "createWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'createWebhookEndpoint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookEndpointPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookEndpoint", "updateWebhookEndpoint", "webhookEndpoint", args.select, args.where.id, args.data, "UpdateWebhookEndpointInput", "id", "webhookEndpointPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookEndpoint', + 'updateWebhookEndpoint', + 'webhookEndpoint', + args.select, + args.where.id, + args.data, + 'UpdateWebhookEndpointInput', + 'id', + 'webhookEndpointPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "updateWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'updateWebhookEndpoint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookEndpoint: { webhookEndpoint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookEndpoint", "deleteWebhookEndpoint", "webhookEndpoint", { - id: args.where.id - }, "DeleteWebhookEndpointInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookEndpoint', + 'deleteWebhookEndpoint', + 'webhookEndpoint', + { + id: args.where.id, + }, + 'DeleteWebhookEndpointInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEndpoint", - fieldName: "deleteWebhookEndpoint", + operation: 'mutation', + operationName: 'WebhookEndpoint', + fieldName: 'deleteWebhookEndpoint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/webhookEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/webhookEvent.ts index c4651cd89e..0a52d397e3 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/webhookEvent.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/webhookEvent.ts @@ -3,56 +3,96 @@ * @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 { WebhookEvent, WebhookEventWithRelations, WebhookEventSelect, WebhookEventFilter, WebhookEventOrderBy, CreateWebhookEventInput, UpdateWebhookEventInput, WebhookEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookEvent, + WebhookEventWithRelations, + WebhookEventSelect, + WebhookEventFilter, + WebhookEventOrderBy, + CreateWebhookEventInput, + UpdateWebhookEventInput, + WebhookEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEvent", "webhookEvents", 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 - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookEvent', + 'webhookEvents', + 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, + }, + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvents", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookEvent", "webhookEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookEvent', + 'webhookEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvent", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEvent": data.webhookEvents?.nodes?.[0] ?? null - }) + webhookEvent: data.webhookEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookEvent", "webhookEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookEvent', + 'webhookEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookEventFilter", "WebhookEventOrderBy", connectionFieldsMap); + 'WebhookEventFilter', + 'WebhookEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookEvent", - fieldName: "webhookEvent", + operation: 'query', + operationName: 'WebhookEvent', + fieldName: 'webhookEvent', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookEvent": data.webhookEvents?.nodes?.[0] ?? null - }) + webhookEvent: data.webhookEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookEvent", "createWebhookEvent", "webhookEvent", args.select, args.data, "CreateWebhookEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookEvent', + 'createWebhookEvent', + 'webhookEvent', + args.select, + args.data, + 'CreateWebhookEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "createWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'createWebhookEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookEvent", "updateWebhookEvent", "webhookEvent", args.select, args.where.id, args.data, "UpdateWebhookEventInput", "id", "webhookEventPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookEvent', + 'updateWebhookEvent', + 'webhookEvent', + args.select, + args.where.id, + args.data, + 'UpdateWebhookEventInput', + 'id', + 'webhookEventPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "updateWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'updateWebhookEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookEvent: { webhookEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookEvent", "deleteWebhookEvent", "webhookEvent", { - id: args.where.id - }, "DeleteWebhookEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookEvent', + 'deleteWebhookEvent', + 'webhookEvent', + { + id: args.where.id, + }, + 'DeleteWebhookEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookEvent", - fieldName: "deleteWebhookEvent", + operation: 'mutation', + operationName: 'WebhookEvent', + fieldName: 'deleteWebhookEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/mutation/index.ts b/sdk/constructive-sdk/src/compute/orm/mutation/index.ts index c65d39c17a..c5bc975047 100644 --- a/sdk/constructive-sdk/src/compute/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/compute/orm/mutation/index.ts @@ -3,11 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { AddEdgeInput, AddEdgeAndSaveInput, AddNodeInput, AddNodeAndSaveInput, CopyGraphInput, ImportDefinitionsInput, ImportGraphJsonInput, InfraInitEmptyRepoInput, InfraInsertNodeAtPathInput, InfraSetDataAtPathInput, InitEmptyRepoInput, InsertNodeAtPathInput, PlatformInfraInitEmptyRepoInput, PlatformInfraInsertNodeAtPathInput, PlatformInfraSetDataAtPathInput, PlatformResourceInstallationsInstallInput, PlatformResourceInstallationsRollbackInput, PlatformResourceInstallationsUninstallInput, PlatformResourceInstallationsUpgradeInput, ProvisionBucketInput, ResourceInstallationsInstallInput, ResourceInstallationsRollbackInput, ResourceInstallationsUninstallInput, ResourceInstallationsUpgradeInput, SaveGraphInput, SetDataAtPathInput, StartExecutionInput, ValidateFunctionGraphInput, AddEdgePayload, AddEdgeAndSavePayload, AddNodePayload, AddNodeAndSavePayload, CopyGraphPayload, ImportDefinitionsPayload, ImportGraphJsonPayload, InfraInitEmptyRepoPayload, InfraInsertNodeAtPathPayload, InfraSetDataAtPathPayload, InitEmptyRepoPayload, InsertNodeAtPathPayload, PlatformInfraInitEmptyRepoPayload, PlatformInfraInsertNodeAtPathPayload, PlatformInfraSetDataAtPathPayload, PlatformResourceInstallationsInstallPayload, PlatformResourceInstallationsRollbackPayload, PlatformResourceInstallationsUninstallPayload, PlatformResourceInstallationsUpgradePayload, ProvisionBucketPayload, ResourceInstallationsInstallPayload, ResourceInstallationsRollbackPayload, ResourceInstallationsUninstallPayload, ResourceInstallationsUpgradePayload, SaveGraphPayload, SetDataAtPathPayload, StartExecutionPayload, ValidateFunctionGraphPayload, AddEdgePayloadSelect, AddEdgeAndSavePayloadSelect, AddNodePayloadSelect, AddNodeAndSavePayloadSelect, CopyGraphPayloadSelect, ImportDefinitionsPayloadSelect, ImportGraphJsonPayloadSelect, InfraInitEmptyRepoPayloadSelect, InfraInsertNodeAtPathPayloadSelect, InfraSetDataAtPathPayloadSelect, InitEmptyRepoPayloadSelect, InsertNodeAtPathPayloadSelect, PlatformInfraInitEmptyRepoPayloadSelect, PlatformInfraInsertNodeAtPathPayloadSelect, PlatformInfraSetDataAtPathPayloadSelect, PlatformResourceInstallationsInstallPayloadSelect, PlatformResourceInstallationsRollbackPayloadSelect, PlatformResourceInstallationsUninstallPayloadSelect, PlatformResourceInstallationsUpgradePayloadSelect, ProvisionBucketPayloadSelect, ResourceInstallationsInstallPayloadSelect, ResourceInstallationsRollbackPayloadSelect, ResourceInstallationsUninstallPayloadSelect, ResourceInstallationsUpgradePayloadSelect, SaveGraphPayloadSelect, SetDataAtPathPayloadSelect, StartExecutionPayloadSelect, ValidateFunctionGraphPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + AddEdgeInput, + AddEdgeAndSaveInput, + AddNodeInput, + AddNodeAndSaveInput, + CopyGraphInput, + ImportDefinitionsInput, + ImportGraphJsonInput, + InfraInitEmptyRepoInput, + InfraInsertNodeAtPathInput, + InfraSetDataAtPathInput, + InitEmptyRepoInput, + InsertNodeAtPathInput, + PlatformInfraInitEmptyRepoInput, + PlatformInfraInsertNodeAtPathInput, + PlatformInfraSetDataAtPathInput, + PlatformResourceInstallationsInstallInput, + PlatformResourceInstallationsRollbackInput, + PlatformResourceInstallationsUninstallInput, + PlatformResourceInstallationsUpgradeInput, + ProvisionBucketInput, + ResourceInstallationsInstallInput, + ResourceInstallationsRollbackInput, + ResourceInstallationsUninstallInput, + ResourceInstallationsUpgradeInput, + SaveGraphInput, + SetDataAtPathInput, + StartExecutionInput, + ValidateFunctionGraphInput, + AddEdgePayload, + AddEdgeAndSavePayload, + AddNodePayload, + AddNodeAndSavePayload, + CopyGraphPayload, + ImportDefinitionsPayload, + ImportGraphJsonPayload, + InfraInitEmptyRepoPayload, + InfraInsertNodeAtPathPayload, + InfraSetDataAtPathPayload, + InitEmptyRepoPayload, + InsertNodeAtPathPayload, + PlatformInfraInitEmptyRepoPayload, + PlatformInfraInsertNodeAtPathPayload, + PlatformInfraSetDataAtPathPayload, + PlatformResourceInstallationsInstallPayload, + PlatformResourceInstallationsRollbackPayload, + PlatformResourceInstallationsUninstallPayload, + PlatformResourceInstallationsUpgradePayload, + ProvisionBucketPayload, + ResourceInstallationsInstallPayload, + ResourceInstallationsRollbackPayload, + ResourceInstallationsUninstallPayload, + ResourceInstallationsUpgradePayload, + SaveGraphPayload, + SetDataAtPathPayload, + StartExecutionPayload, + ValidateFunctionGraphPayload, + AddEdgePayloadSelect, + AddEdgeAndSavePayloadSelect, + AddNodePayloadSelect, + AddNodeAndSavePayloadSelect, + CopyGraphPayloadSelect, + ImportDefinitionsPayloadSelect, + ImportGraphJsonPayloadSelect, + InfraInitEmptyRepoPayloadSelect, + InfraInsertNodeAtPathPayloadSelect, + InfraSetDataAtPathPayloadSelect, + InitEmptyRepoPayloadSelect, + InsertNodeAtPathPayloadSelect, + PlatformInfraInitEmptyRepoPayloadSelect, + PlatformInfraInsertNodeAtPathPayloadSelect, + PlatformInfraSetDataAtPathPayloadSelect, + PlatformResourceInstallationsInstallPayloadSelect, + PlatformResourceInstallationsRollbackPayloadSelect, + PlatformResourceInstallationsUninstallPayloadSelect, + PlatformResourceInstallationsUpgradePayloadSelect, + ProvisionBucketPayloadSelect, + ResourceInstallationsInstallPayloadSelect, + ResourceInstallationsRollbackPayloadSelect, + ResourceInstallationsUninstallPayloadSelect, + ResourceInstallationsUpgradePayloadSelect, + SaveGraphPayloadSelect, + SetDataAtPathPayloadSelect, + StartExecutionPayloadSelect, + ValidateFunctionGraphPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface AddEdgeVariables { input: AddEdgeInput; } @@ -101,397 +186,852 @@ export interface ValidateFunctionGraphVariables { } export function createMutationOperations(client: OrmClient) { return { - addEdge: (args: AddEdgeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addEdge: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddEdge", - fieldName: "addEdge", - ...buildCustomDocument("mutation", "AddEdge", "addEdge", options.select, args, [{ - name: "input", - type: "AddEdgeInput!" - }], connectionFieldsMap, "AddEdgePayload") - }), - addEdgeAndSave: (args: AddEdgeAndSaveVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addEdgeAndSave: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddEdgeAndSave", - fieldName: "addEdgeAndSave", - ...buildCustomDocument("mutation", "AddEdgeAndSave", "addEdgeAndSave", options.select, args, [{ - name: "input", - type: "AddEdgeAndSaveInput!" - }], connectionFieldsMap, "AddEdgeAndSavePayload") - }), - addNode: (args: AddNodeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addNode: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddNode", - fieldName: "addNode", - ...buildCustomDocument("mutation", "AddNode", "addNode", options.select, args, [{ - name: "input", - type: "AddNodeInput!" - }], connectionFieldsMap, "AddNodePayload") - }), - addNodeAndSave: (args: AddNodeAndSaveVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - addNodeAndSave: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "AddNodeAndSave", - fieldName: "addNodeAndSave", - ...buildCustomDocument("mutation", "AddNodeAndSave", "addNodeAndSave", options.select, args, [{ - name: "input", - type: "AddNodeAndSaveInput!" - }], connectionFieldsMap, "AddNodeAndSavePayload") - }), - copyGraph: (args: CopyGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - copyGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CopyGraph", - fieldName: "copyGraph", - ...buildCustomDocument("mutation", "CopyGraph", "copyGraph", options.select, args, [{ - name: "input", - type: "CopyGraphInput!" - }], connectionFieldsMap, "CopyGraphPayload") - }), - importDefinitions: (args: ImportDefinitionsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - importDefinitions: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ImportDefinitions", - fieldName: "importDefinitions", - ...buildCustomDocument("mutation", "ImportDefinitions", "importDefinitions", options.select, args, [{ - name: "input", - type: "ImportDefinitionsInput!" - }], connectionFieldsMap, "ImportDefinitionsPayload") - }), - 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") - }), - infraInitEmptyRepo: (args: InfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraInitEmptyRepo", - fieldName: "infraInitEmptyRepo", - ...buildCustomDocument("mutation", "InfraInitEmptyRepo", "infraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "InfraInitEmptyRepoInput!" - }], connectionFieldsMap, "InfraInitEmptyRepoPayload") - }), - infraInsertNodeAtPath: (args: InfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraInsertNodeAtPath", - fieldName: "infraInsertNodeAtPath", - ...buildCustomDocument("mutation", "InfraInsertNodeAtPath", "infraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "InfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "InfraInsertNodeAtPathPayload") - }), - infraSetDataAtPath: (args: InfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - infraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InfraSetDataAtPath", - fieldName: "infraSetDataAtPath", - ...buildCustomDocument("mutation", "InfraSetDataAtPath", "infraSetDataAtPath", options.select, args, [{ - name: "input", - type: "InfraSetDataAtPathInput!" - }], connectionFieldsMap, "InfraSetDataAtPathPayload") - }), - initEmptyRepo: (args: InitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - initEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InitEmptyRepo", - fieldName: "initEmptyRepo", - ...buildCustomDocument("mutation", "InitEmptyRepo", "initEmptyRepo", options.select, args, [{ - name: "input", - type: "InitEmptyRepoInput!" - }], connectionFieldsMap, "InitEmptyRepoPayload") - }), - insertNodeAtPath: (args: InsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - insertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InsertNodeAtPath", - fieldName: "insertNodeAtPath", - ...buildCustomDocument("mutation", "InsertNodeAtPath", "insertNodeAtPath", options.select, args, [{ - name: "input", - type: "InsertNodeAtPathInput!" - }], connectionFieldsMap, "InsertNodeAtPathPayload") - }), - platformInfraInitEmptyRepo: (args: PlatformInfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInitEmptyRepo", - fieldName: "platformInfraInitEmptyRepo", - ...buildCustomDocument("mutation", "PlatformInfraInitEmptyRepo", "platformInfraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "PlatformInfraInitEmptyRepoInput!" - }], connectionFieldsMap, "PlatformInfraInitEmptyRepoPayload") - }), - platformInfraInsertNodeAtPath: (args: PlatformInfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInsertNodeAtPath", - fieldName: "platformInfraInsertNodeAtPath", - ...buildCustomDocument("mutation", "PlatformInfraInsertNodeAtPath", "platformInfraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "PlatformInfraInsertNodeAtPathPayload") - }), - platformInfraSetDataAtPath: (args: PlatformInfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraSetDataAtPath", - fieldName: "platformInfraSetDataAtPath", - ...buildCustomDocument("mutation", "PlatformInfraSetDataAtPath", "platformInfraSetDataAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraSetDataAtPathInput!" - }], connectionFieldsMap, "PlatformInfraSetDataAtPathPayload") - }), - platformResourceInstallationsInstall: (args: PlatformResourceInstallationsInstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsInstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsInstall", - fieldName: "platformResourceInstallationsInstall", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsInstall", "platformResourceInstallationsInstall", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsInstallInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsInstallPayload") - }), - platformResourceInstallationsRollback: (args: PlatformResourceInstallationsRollbackVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsRollback: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsRollback", - fieldName: "platformResourceInstallationsRollback", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsRollback", "platformResourceInstallationsRollback", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsRollbackInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsRollbackPayload") - }), - platformResourceInstallationsUninstall: (args: PlatformResourceInstallationsUninstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsUninstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsUninstall", - fieldName: "platformResourceInstallationsUninstall", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsUninstall", "platformResourceInstallationsUninstall", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsUninstallInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsUninstallPayload") - }), - platformResourceInstallationsUpgrade: (args: PlatformResourceInstallationsUpgradeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformResourceInstallationsUpgrade: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformResourceInstallationsUpgrade", - fieldName: "platformResourceInstallationsUpgrade", - ...buildCustomDocument("mutation", "PlatformResourceInstallationsUpgrade", "platformResourceInstallationsUpgrade", options.select, args, [{ - name: "input", - type: "PlatformResourceInstallationsUpgradeInput!" - }], connectionFieldsMap, "PlatformResourceInstallationsUpgradePayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - resourceInstallationsInstall: (args: ResourceInstallationsInstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsInstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsInstall", - fieldName: "resourceInstallationsInstall", - ...buildCustomDocument("mutation", "ResourceInstallationsInstall", "resourceInstallationsInstall", options.select, args, [{ - name: "input", - type: "ResourceInstallationsInstallInput!" - }], connectionFieldsMap, "ResourceInstallationsInstallPayload") - }), - resourceInstallationsRollback: (args: ResourceInstallationsRollbackVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsRollback: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsRollback", - fieldName: "resourceInstallationsRollback", - ...buildCustomDocument("mutation", "ResourceInstallationsRollback", "resourceInstallationsRollback", options.select, args, [{ - name: "input", - type: "ResourceInstallationsRollbackInput!" - }], connectionFieldsMap, "ResourceInstallationsRollbackPayload") - }), - resourceInstallationsUninstall: (args: ResourceInstallationsUninstallVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsUninstall: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsUninstall", - fieldName: "resourceInstallationsUninstall", - ...buildCustomDocument("mutation", "ResourceInstallationsUninstall", "resourceInstallationsUninstall", options.select, args, [{ - name: "input", - type: "ResourceInstallationsUninstallInput!" - }], connectionFieldsMap, "ResourceInstallationsUninstallPayload") - }), - resourceInstallationsUpgrade: (args: ResourceInstallationsUpgradeVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - resourceInstallationsUpgrade: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ResourceInstallationsUpgrade", - fieldName: "resourceInstallationsUpgrade", - ...buildCustomDocument("mutation", "ResourceInstallationsUpgrade", "resourceInstallationsUpgrade", options.select, args, [{ - name: "input", - type: "ResourceInstallationsUpgradeInput!" - }], connectionFieldsMap, "ResourceInstallationsUpgradePayload") - }), - saveGraph: (args: SaveGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - saveGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SaveGraph", - fieldName: "saveGraph", - ...buildCustomDocument("mutation", "SaveGraph", "saveGraph", options.select, args, [{ - name: "input", - type: "SaveGraphInput!" - }], connectionFieldsMap, "SaveGraphPayload") - }), - setDataAtPath: (args: SetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetDataAtPath", - fieldName: "setDataAtPath", - ...buildCustomDocument("mutation", "SetDataAtPath", "setDataAtPath", options.select, args, [{ - name: "input", - type: "SetDataAtPathInput!" - }], connectionFieldsMap, "SetDataAtPathPayload") - }), - startExecution: (args: StartExecutionVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - startExecution: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "StartExecution", - fieldName: "startExecution", - ...buildCustomDocument("mutation", "StartExecution", "startExecution", options.select, args, [{ - name: "input", - type: "StartExecutionInput!" - }], connectionFieldsMap, "StartExecutionPayload") - }), - validateFunctionGraph: (args: ValidateFunctionGraphVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - validateFunctionGraph: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ValidateFunctionGraph", - fieldName: "validateFunctionGraph", - ...buildCustomDocument("mutation", "ValidateFunctionGraph", "validateFunctionGraph", options.select, args, [{ - name: "input", - type: "ValidateFunctionGraphInput!" - }], connectionFieldsMap, "ValidateFunctionGraphPayload") - }) + addEdge: ( + args: AddEdgeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdge: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdge', + fieldName: 'addEdge', + ...buildCustomDocument( + 'mutation', + 'AddEdge', + 'addEdge', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeInput!', + }, + ], + connectionFieldsMap, + 'AddEdgePayload' + ), + }), + addEdgeAndSave: ( + args: AddEdgeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdgeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdgeAndSave', + fieldName: 'addEdgeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddEdgeAndSave', + 'addEdgeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddEdgeAndSavePayload' + ), + }), + addNode: ( + args: AddNodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNode', + fieldName: 'addNode', + ...buildCustomDocument( + 'mutation', + 'AddNode', + 'addNode', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeInput!', + }, + ], + connectionFieldsMap, + 'AddNodePayload' + ), + }), + addNodeAndSave: ( + args: AddNodeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNodeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNodeAndSave', + fieldName: 'addNodeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddNodeAndSave', + 'addNodeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddNodeAndSavePayload' + ), + }), + copyGraph: ( + args: CopyGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyGraph', + fieldName: 'copyGraph', + ...buildCustomDocument( + 'mutation', + 'CopyGraph', + 'copyGraph', + options.select, + args, + [ + { + name: 'input', + type: 'CopyGraphInput!', + }, + ], + connectionFieldsMap, + 'CopyGraphPayload' + ), + }), + importDefinitions: ( + args: ImportDefinitionsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importDefinitions: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportDefinitions', + fieldName: 'importDefinitions', + ...buildCustomDocument( + 'mutation', + 'ImportDefinitions', + 'importDefinitions', + options.select, + args, + [ + { + name: 'input', + type: 'ImportDefinitionsInput!', + }, + ], + connectionFieldsMap, + 'ImportDefinitionsPayload' + ), + }), + 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' + ), + }), + infraInitEmptyRepo: ( + args: InfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraInitEmptyRepo', + fieldName: 'infraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InfraInitEmptyRepo', + 'infraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InfraInitEmptyRepoPayload' + ), + }), + infraInsertNodeAtPath: ( + args: InfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraInsertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraInsertNodeAtPath', + fieldName: 'infraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InfraInsertNodeAtPath', + 'infraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InfraInsertNodeAtPathPayload' + ), + }), + infraSetDataAtPath: ( + args: InfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + infraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InfraSetDataAtPath', + fieldName: 'infraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'InfraSetDataAtPath', + 'infraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'InfraSetDataAtPathPayload' + ), + }), + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + platformInfraInitEmptyRepo: ( + args: PlatformInfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInitEmptyRepo', + fieldName: 'platformInfraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInitEmptyRepo', + 'platformInfraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInitEmptyRepoPayload' + ), + }), + platformInfraInsertNodeAtPath: ( + args: PlatformInfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInsertNodeAtPath', + fieldName: 'platformInfraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInsertNodeAtPath', + 'platformInfraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInsertNodeAtPathPayload' + ), + }), + platformInfraSetDataAtPath: ( + args: PlatformInfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraSetDataAtPath', + fieldName: 'platformInfraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraSetDataAtPath', + 'platformInfraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraSetDataAtPathPayload' + ), + }), + platformResourceInstallationsInstall: < + S extends PlatformResourceInstallationsInstallPayloadSelect, + >( + args: PlatformResourceInstallationsInstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsInstall: InferSelectResult< + PlatformResourceInstallationsInstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsInstall', + fieldName: 'platformResourceInstallationsInstall', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsInstall', + 'platformResourceInstallationsInstall', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsInstallInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsInstallPayload' + ), + }), + platformResourceInstallationsRollback: < + S extends PlatformResourceInstallationsRollbackPayloadSelect, + >( + args: PlatformResourceInstallationsRollbackVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsRollback: InferSelectResult< + PlatformResourceInstallationsRollbackPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsRollback', + fieldName: 'platformResourceInstallationsRollback', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsRollback', + 'platformResourceInstallationsRollback', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsRollbackInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsRollbackPayload' + ), + }), + platformResourceInstallationsUninstall: < + S extends PlatformResourceInstallationsUninstallPayloadSelect, + >( + args: PlatformResourceInstallationsUninstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsUninstall: InferSelectResult< + PlatformResourceInstallationsUninstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsUninstall', + fieldName: 'platformResourceInstallationsUninstall', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsUninstall', + 'platformResourceInstallationsUninstall', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsUninstallInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsUninstallPayload' + ), + }), + platformResourceInstallationsUpgrade: < + S extends PlatformResourceInstallationsUpgradePayloadSelect, + >( + args: PlatformResourceInstallationsUpgradeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformResourceInstallationsUpgrade: InferSelectResult< + PlatformResourceInstallationsUpgradePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformResourceInstallationsUpgrade', + fieldName: 'platformResourceInstallationsUpgrade', + ...buildCustomDocument( + 'mutation', + 'PlatformResourceInstallationsUpgrade', + 'platformResourceInstallationsUpgrade', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformResourceInstallationsUpgradeInput!', + }, + ], + connectionFieldsMap, + 'PlatformResourceInstallationsUpgradePayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + resourceInstallationsInstall: ( + args: ResourceInstallationsInstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsInstall: InferSelectResult< + ResourceInstallationsInstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsInstall', + fieldName: 'resourceInstallationsInstall', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsInstall', + 'resourceInstallationsInstall', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsInstallInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsInstallPayload' + ), + }), + resourceInstallationsRollback: ( + args: ResourceInstallationsRollbackVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsRollback: InferSelectResult< + ResourceInstallationsRollbackPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsRollback', + fieldName: 'resourceInstallationsRollback', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsRollback', + 'resourceInstallationsRollback', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsRollbackInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsRollbackPayload' + ), + }), + resourceInstallationsUninstall: ( + args: ResourceInstallationsUninstallVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsUninstall: InferSelectResult< + ResourceInstallationsUninstallPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsUninstall', + fieldName: 'resourceInstallationsUninstall', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsUninstall', + 'resourceInstallationsUninstall', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsUninstallInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsUninstallPayload' + ), + }), + resourceInstallationsUpgrade: ( + args: ResourceInstallationsUpgradeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + resourceInstallationsUpgrade: InferSelectResult< + ResourceInstallationsUpgradePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'ResourceInstallationsUpgrade', + fieldName: 'resourceInstallationsUpgrade', + ...buildCustomDocument( + 'mutation', + 'ResourceInstallationsUpgrade', + 'resourceInstallationsUpgrade', + options.select, + args, + [ + { + name: 'input', + type: 'ResourceInstallationsUpgradeInput!', + }, + ], + connectionFieldsMap, + 'ResourceInstallationsUpgradePayload' + ), + }), + saveGraph: ( + args: SaveGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + saveGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SaveGraph', + fieldName: 'saveGraph', + ...buildCustomDocument( + 'mutation', + 'SaveGraph', + 'saveGraph', + options.select, + args, + [ + { + name: 'input', + type: 'SaveGraphInput!', + }, + ], + connectionFieldsMap, + 'SaveGraphPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), + startExecution: ( + args: StartExecutionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + startExecution: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'StartExecution', + fieldName: 'startExecution', + ...buildCustomDocument( + 'mutation', + 'StartExecution', + 'startExecution', + options.select, + args, + [ + { + name: 'input', + type: 'StartExecutionInput!', + }, + ], + connectionFieldsMap, + 'StartExecutionPayload' + ), + }), + validateFunctionGraph: ( + args: ValidateFunctionGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + validateFunctionGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ValidateFunctionGraph', + fieldName: 'validateFunctionGraph', + ...buildCustomDocument( + 'mutation', + 'ValidateFunctionGraph', + 'validateFunctionGraph', + options.select, + args, + [ + { + name: 'input', + type: 'ValidateFunctionGraphInput!', + }, + ], + connectionFieldsMap, + 'ValidateFunctionGraphPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/query-builder.ts b/sdk/constructive-sdk/src/compute/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/compute/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/compute/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/compute/orm/query/index.ts b/sdk/constructive-sdk/src/compute/orm/query/index.ts index c94a1d0491..505264ae62 100644 --- a/sdk/constructive-sdk/src/compute/orm/query/index.ts +++ b/sdk/constructive-sdk/src/compute/orm/query/index.ts @@ -3,28 +3,43 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; export interface ReadFunctionGraphVariables { graphId?: string; } export function createQueryOperations(client: OrmClient) { return { - readFunctionGraph: (args: ReadFunctionGraphVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - readFunctionGraph: unknown | null; - }>({ - client, - operation: "query", - operationName: "ReadFunctionGraph", - fieldName: "readFunctionGraph", - ...buildCustomDocument("query", "ReadFunctionGraph", "readFunctionGraph", options?.select, args, [{ - name: "graphId", - type: "UUID" - }], connectionFieldsMap, undefined) - }) + readFunctionGraph: ( + args: ReadFunctionGraphVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + readFunctionGraph: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ReadFunctionGraph', + fieldName: 'readFunctionGraph', + ...buildCustomDocument( + 'query', + 'ReadFunctionGraph', + 'readFunctionGraph', + options?.select, + args, + [ + { + name: 'graphId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/compute/orm/realtime.ts b/sdk/constructive-sdk/src/compute/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/compute/orm/realtime.ts +++ b/sdk/constructive-sdk/src/compute/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/compute/orm/select-types.ts b/sdk/constructive-sdk/src/compute/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/compute/orm/select-types.ts +++ b/sdk/constructive-sdk/src/compute/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/config/index.ts b/sdk/constructive-sdk/src/config/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/config/index.ts +++ b/sdk/constructive-sdk/src/config/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/config/orm/client.ts b/sdk/constructive-sdk/src/config/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/config/orm/client.ts +++ b/sdk/constructive-sdk/src/config/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/config/orm/index.ts b/sdk/constructive-sdk/src/config/orm/index.ts index fc3b40f037..bf16135b3c 100644 --- a/sdk/constructive-sdk/src/config/orm/index.ts +++ b/sdk/constructive-sdk/src/config/orm/index.ts @@ -3,20 +3,20 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { ConfigModel } from "./models/config"; -import { PlatformConfigModel } from "./models/platformConfig"; -import { PlatformInternalSecretModel } from "./models/platformInternalSecret"; -import { PlatformSecretModel } from "./models/platformSecret"; -import { SecretModel } from "./models/secret"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { ConfigModel } from './models/config'; +import { PlatformConfigModel } from './models/platformConfig'; +import { PlatformInternalSecretModel } from './models/platformInternalSecret'; +import { PlatformSecretModel } from './models/platformSecret'; +import { SecretModel } from './models/secret'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -48,6 +48,6 @@ export function createClient(config: OrmClientConfig) { platformInternalSecret: new PlatformInternalSecretModel(client), platformSecret: new PlatformSecretModel(client), secret: new SecretModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/config/orm/input-types.ts b/sdk/constructive-sdk/src/config/orm/input-types.ts index 2a682fe678..110c75415d 100644 --- a/sdk/constructive-sdk/src/config/orm/input-types.ts +++ b/sdk/constructive-sdk/src/config/orm/input-types.ts @@ -339,7 +339,8 @@ export interface SecretRelations {} // ============ Entity Types With Relations ============ export type ConfigWithRelations = Config & ConfigRelations; export type PlatformConfigWithRelations = PlatformConfig & PlatformConfigRelations; -export type PlatformInternalSecretWithRelations = PlatformInternalSecret & PlatformInternalSecretRelations; +export type PlatformInternalSecretWithRelations = PlatformInternalSecret & + PlatformInternalSecretRelations; export type PlatformSecretWithRelations = PlatformSecret & PlatformSecretRelations; export type SecretWithRelations = Secret & SecretRelations; // ============ Entity Select Types ============ @@ -563,11 +564,132 @@ export interface SecretFilter { updatedAt?: DatetimeFilter; } // ============ OrderBy Types ============ -export type ConfigOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALUE_ASC" | "VALUE_DESC"; -export type PlatformConfigOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VALUE_ASC" | "VALUE_DESC"; -export type PlatformInternalSecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformSecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PROVIDER_ASC" | "PROVIDER_DESC" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type SecretOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABELS_ASC" | "LABELS_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PROVIDER_ASC" | "PROVIDER_DESC" | "RETIRED_AT_ASC" | "RETIRED_AT_DESC" | "ROTATED_AT_ASC" | "ROTATED_AT_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; +export type ConfigOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC'; +export type PlatformConfigOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC'; +export type PlatformInternalSecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformSecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type SecretOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'RETIRED_AT_ASC' + | 'RETIRED_AT_DESC' + | 'ROTATED_AT_ASC' + | 'ROTATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; // ============ CRUD Input Types ============ export interface CreateConfigInput { clientMutationId?: string; @@ -1089,4 +1211,4 @@ export type PlatformConfigEdgeSelect = { node?: { select: PlatformConfigSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/config/orm/models/config.ts b/sdk/constructive-sdk/src/config/orm/models/config.ts index f7c80edfb1..cef2950915 100644 --- a/sdk/constructive-sdk/src/config/orm/models/config.ts +++ b/sdk/constructive-sdk/src/config/orm/models/config.ts @@ -3,56 +3,96 @@ * @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 { Config, ConfigWithRelations, ConfigSelect, ConfigFilter, ConfigOrderBy, CreateConfigInput, UpdateConfigInput, ConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Config, + ConfigWithRelations, + ConfigSelect, + ConfigFilter, + ConfigOrderBy, + CreateConfigInput, + UpdateConfigInput, + ConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ configs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Config", "configs", 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 - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Config', + 'configs', + 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, + }, + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "configs", + operation: 'query', + operationName: 'Config', + fieldName: 'configs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ config: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Config", "configs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Config', + 'configs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "config", + operation: 'query', + operationName: 'Config', + fieldName: 'config', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "config": data.configs?.nodes?.[0] ?? null - }) + config: data.configs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ config: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Config", "configs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Config', + 'configs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConfigFilter", "ConfigOrderBy", connectionFieldsMap); + 'ConfigFilter', + 'ConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Config", - fieldName: "config", + operation: 'query', + operationName: 'Config', + fieldName: 'config', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "config": data.configs?.nodes?.[0] ?? null - }) + config: data.configs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Config", "createConfig", "config", args.select, args.data, "CreateConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Config', + 'createConfig', + 'config', + args.select, + args.data, + 'CreateConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "createConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'createConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Config", "updateConfig", "config", args.select, args.where.id, args.data, "UpdateConfigInput", "id", "configPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Config', + 'updateConfig', + 'config', + args.select, + args.where.id, + args.data, + 'UpdateConfigInput', + 'id', + 'configPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "updateConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'updateConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConfig: { config: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Config", "deleteConfig", "config", { - id: args.where.id - }, "DeleteConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Config', + 'deleteConfig', + 'config', + { + id: args.where.id, + }, + 'DeleteConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Config", - fieldName: "deleteConfig", + operation: 'mutation', + operationName: 'Config', + fieldName: 'deleteConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/config/orm/models/index.ts b/sdk/constructive-sdk/src/config/orm/models/index.ts index 5bca8e3b99..0823cce0ad 100644 --- a/sdk/constructive-sdk/src/config/orm/models/index.ts +++ b/sdk/constructive-sdk/src/config/orm/models/index.ts @@ -3,8 +3,8 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { ConfigModel } from "./config"; -export { PlatformConfigModel } from "./platformConfig"; -export { PlatformInternalSecretModel } from "./platformInternalSecret"; -export { PlatformSecretModel } from "./platformSecret"; -export { SecretModel } from "./secret"; \ No newline at end of file +export { ConfigModel } from './config'; +export { PlatformConfigModel } from './platformConfig'; +export { PlatformInternalSecretModel } from './platformInternalSecret'; +export { PlatformSecretModel } from './platformSecret'; +export { SecretModel } from './secret'; diff --git a/sdk/constructive-sdk/src/config/orm/models/platformConfig.ts b/sdk/constructive-sdk/src/config/orm/models/platformConfig.ts index bf62b0821c..43634e7a80 100644 --- a/sdk/constructive-sdk/src/config/orm/models/platformConfig.ts +++ b/sdk/constructive-sdk/src/config/orm/models/platformConfig.ts @@ -3,56 +3,96 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { PlatformConfig, PlatformConfigWithRelations, PlatformConfigSelect, PlatformConfigFilter, PlatformConfigOrderBy, CreatePlatformConfigInput, UpdatePlatformConfigInput, PlatformConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfig, + PlatformConfigWithRelations, + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy, + CreatePlatformConfigInput, + UpdatePlatformConfigInput, + PlatformConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfigs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformConfig", "platformConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfigs", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfigs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformConfig", "platformConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfig", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformConfig": data.platformConfigs?.nodes?.[0] ?? null - }) + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformConfig", "platformConfigs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformConfigFilter", "PlatformConfigOrderBy", connectionFieldsMap); + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformConfig", - fieldName: "platformConfig", + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformConfig": data.platformConfigs?.nodes?.[0] ?? null - }) + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformConfig", "createPlatformConfig", "platformConfig", args.select, args.data, "CreatePlatformConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformConfig', + 'createPlatformConfig', + 'platformConfig', + args.select, + args.data, + 'CreatePlatformConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "createPlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'createPlatformConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformConfig", "updatePlatformConfig", "platformConfig", args.select, args.where.id, args.data, "UpdatePlatformConfigInput", "id", "platformConfigPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfig', + 'updatePlatformConfig', + 'platformConfig', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigInput', + 'id', + 'platformConfigPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "updatePlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'updatePlatformConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformConfig: { platformConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformConfig", "deletePlatformConfig", "platformConfig", { - id: args.where.id - }, "DeletePlatformConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfig', + 'deletePlatformConfig', + 'platformConfig', + { + id: args.where.id, + }, + 'DeletePlatformConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformConfig", - fieldName: "deletePlatformConfig", + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'deletePlatformConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/config/orm/models/platformInternalSecret.ts b/sdk/constructive-sdk/src/config/orm/models/platformInternalSecret.ts index 1e09df35f4..35e0c7b538 100644 --- a/sdk/constructive-sdk/src/config/orm/models/platformInternalSecret.ts +++ b/sdk/constructive-sdk/src/config/orm/models/platformInternalSecret.ts @@ -3,56 +3,98 @@ * @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 { PlatformInternalSecret, PlatformInternalSecretWithRelations, PlatformInternalSecretSelect, PlatformInternalSecretFilter, PlatformInternalSecretOrderBy, CreatePlatformInternalSecretInput, UpdatePlatformInternalSecretInput, PlatformInternalSecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInternalSecret, + PlatformInternalSecretWithRelations, + PlatformInternalSecretSelect, + PlatformInternalSecretFilter, + PlatformInternalSecretOrderBy, + CreatePlatformInternalSecretInput, + UpdatePlatformInternalSecretInput, + PlatformInternalSecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInternalSecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInternalSecrets: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInternalSecrets: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInternalSecret", "platformInternalSecrets", 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 - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + 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, + }, + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecrets", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInternalSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInternalSecret", "platformInternalSecrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecret", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecret', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformInternalSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInternalSecret": data.platformInternalSecrets?.nodes?.[0] ?? null - }) + platformInternalSecret: data.platformInternalSecrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInternalSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInternalSecret", "platformInternalSecrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInternalSecret', + 'platformInternalSecrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInternalSecretFilter", "PlatformInternalSecretOrderBy", connectionFieldsMap); + 'PlatformInternalSecretFilter', + 'PlatformInternalSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInternalSecret", - fieldName: "platformInternalSecret", + operation: 'query', + operationName: 'PlatformInternalSecret', + fieldName: 'platformInternalSecret', document, variables, transform: (data: { @@ -93,28 +142,35 @@ export class PlatformInternalSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInternalSecret": data.platformInternalSecrets?.nodes?.[0] ?? null - }) + platformInternalSecret: data.platformInternalSecrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInternalSecret: { platformInternalSecret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInternalSecret", "createPlatformInternalSecret", "platformInternalSecret", args.select, args.data, "CreatePlatformInternalSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInternalSecret', + 'createPlatformInternalSecret', + 'platformInternalSecret', + args.select, + args.data, + 'CreatePlatformInternalSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInternalSecret", - fieldName: "createPlatformInternalSecret", + operation: 'mutation', + operationName: 'PlatformInternalSecret', + fieldName: 'createPlatformInternalSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/config/orm/models/platformSecret.ts b/sdk/constructive-sdk/src/config/orm/models/platformSecret.ts index 366da27bfe..03c0e23540 100644 --- a/sdk/constructive-sdk/src/config/orm/models/platformSecret.ts +++ b/sdk/constructive-sdk/src/config/orm/models/platformSecret.ts @@ -3,56 +3,96 @@ * @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 { PlatformSecret, PlatformSecretWithRelations, PlatformSecretSelect, PlatformSecretFilter, PlatformSecretOrderBy, CreatePlatformSecretInput, UpdatePlatformSecretInput, PlatformSecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformSecret, + PlatformSecretWithRelations, + PlatformSecretSelect, + PlatformSecretFilter, + PlatformSecretOrderBy, + CreatePlatformSecretInput, + UpdatePlatformSecretInput, + PlatformSecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformSecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecrets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSecret", "platformSecrets", 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 - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformSecret', + 'platformSecrets', + 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, + }, + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecrets", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformSecret", "platformSecrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformSecret', + 'platformSecrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecret", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecret', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSecret": data.platformSecrets?.nodes?.[0] ?? null - }) + platformSecret: data.platformSecrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformSecret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformSecret", "platformSecrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformSecret', + 'platformSecrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformSecretFilter", "PlatformSecretOrderBy", connectionFieldsMap); + 'PlatformSecretFilter', + 'PlatformSecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformSecret", - fieldName: "platformSecret", + operation: 'query', + operationName: 'PlatformSecret', + fieldName: 'platformSecret', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class PlatformSecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformSecret": data.platformSecrets?.nodes?.[0] ?? null - }) + platformSecret: data.platformSecrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformSecret: { platformSecret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformSecret", "createPlatformSecret", "platformSecret", args.select, args.data, "CreatePlatformSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformSecret', + 'createPlatformSecret', + 'platformSecret', + args.select, + args.data, + 'CreatePlatformSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformSecret", - fieldName: "createPlatformSecret", + operation: 'mutation', + operationName: 'PlatformSecret', + fieldName: 'createPlatformSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/config/orm/models/secret.ts b/sdk/constructive-sdk/src/config/orm/models/secret.ts index af9f11b5ae..37571240d8 100644 --- a/sdk/constructive-sdk/src/config/orm/models/secret.ts +++ b/sdk/constructive-sdk/src/config/orm/models/secret.ts @@ -3,56 +3,96 @@ * @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 { Secret, SecretWithRelations, SecretSelect, SecretFilter, SecretOrderBy, CreateSecretInput, UpdateSecretInput, SecretPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Secret, + SecretWithRelations, + SecretSelect, + SecretFilter, + SecretOrderBy, + CreateSecretInput, + UpdateSecretInput, + SecretPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SecretModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secrets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Secret", "secrets", 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 - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Secret', + 'secrets', + 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, + }, + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secrets", + operation: 'query', + operationName: 'Secret', + fieldName: 'secrets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Secret", "secrets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Secret', + 'secrets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secret", + operation: 'query', + operationName: 'Secret', + fieldName: 'secret', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "secret": data.secrets?.nodes?.[0] ?? null - }) + secret: data.secrets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ secret: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Secret", "secrets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Secret', + 'secrets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SecretFilter", "SecretOrderBy", connectionFieldsMap); + 'SecretFilter', + 'SecretOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Secret", - fieldName: "secret", + operation: 'query', + operationName: 'Secret', + fieldName: 'secret', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class SecretModel { nodes?: InferSelectResult[]; }; }) => ({ - "secret": data.secrets?.nodes?.[0] ?? null - }) + secret: data.secrets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSecret: { secret: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Secret", "createSecret", "secret", args.select, args.data, "CreateSecretInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Secret', + 'createSecret', + 'secret', + args.select, + args.data, + 'CreateSecretInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Secret", - fieldName: "createSecret", + operation: 'mutation', + operationName: 'Secret', + fieldName: 'createSecret', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/config/orm/mutation/index.ts b/sdk/constructive-sdk/src/config/orm/mutation/index.ts index 8d24d8f7a0..13353608c7 100644 --- a/sdk/constructive-sdk/src/config/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/config/orm/mutation/index.ts @@ -3,11 +3,51 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { _SecretsDelInput, _SecretsRemoveArrayInput, _SecretsRotateInput, _SecretsSetInput, PlatformInternalSecretsDelInput, PlatformInternalSecretsRemoveArrayInput, PlatformInternalSecretsRotateInput, PlatformInternalSecretsSetInput, PlatformSecretsDelInput, PlatformSecretsRemoveArrayInput, PlatformSecretsRotateInput, PlatformSecretsSetInput, ProvisionBucketInput, _SecretsDelPayload, _SecretsRemoveArrayPayload, _SecretsRotatePayload, _SecretsSetPayload, PlatformInternalSecretsDelPayload, PlatformInternalSecretsRemoveArrayPayload, PlatformInternalSecretsRotatePayload, PlatformInternalSecretsSetPayload, PlatformSecretsDelPayload, PlatformSecretsRemoveArrayPayload, PlatformSecretsRotatePayload, PlatformSecretsSetPayload, ProvisionBucketPayload, _SecretsDelPayloadSelect, _SecretsRemoveArrayPayloadSelect, _SecretsRotatePayloadSelect, _SecretsSetPayloadSelect, PlatformInternalSecretsDelPayloadSelect, PlatformInternalSecretsRemoveArrayPayloadSelect, PlatformInternalSecretsRotatePayloadSelect, PlatformInternalSecretsSetPayloadSelect, PlatformSecretsDelPayloadSelect, PlatformSecretsRemoveArrayPayloadSelect, PlatformSecretsRotatePayloadSelect, PlatformSecretsSetPayloadSelect, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + _SecretsDelInput, + _SecretsRemoveArrayInput, + _SecretsRotateInput, + _SecretsSetInput, + PlatformInternalSecretsDelInput, + PlatformInternalSecretsRemoveArrayInput, + PlatformInternalSecretsRotateInput, + PlatformInternalSecretsSetInput, + PlatformSecretsDelInput, + PlatformSecretsRemoveArrayInput, + PlatformSecretsRotateInput, + PlatformSecretsSetInput, + ProvisionBucketInput, + _SecretsDelPayload, + _SecretsRemoveArrayPayload, + _SecretsRotatePayload, + _SecretsSetPayload, + PlatformInternalSecretsDelPayload, + PlatformInternalSecretsRemoveArrayPayload, + PlatformInternalSecretsRotatePayload, + PlatformInternalSecretsSetPayload, + PlatformSecretsDelPayload, + PlatformSecretsRemoveArrayPayload, + PlatformSecretsRotatePayload, + PlatformSecretsSetPayload, + ProvisionBucketPayload, + _SecretsDelPayloadSelect, + _SecretsRemoveArrayPayloadSelect, + _SecretsRotatePayloadSelect, + _SecretsSetPayloadSelect, + PlatformInternalSecretsDelPayloadSelect, + PlatformInternalSecretsRemoveArrayPayloadSelect, + PlatformInternalSecretsRotatePayloadSelect, + PlatformInternalSecretsSetPayloadSelect, + PlatformSecretsDelPayloadSelect, + PlatformSecretsRemoveArrayPayloadSelect, + PlatformSecretsRotatePayloadSelect, + PlatformSecretsSetPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface _secretsDelVariables { input: _SecretsDelInput; } @@ -56,187 +96,388 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - _secretsDel: (args: _secretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsDel", - fieldName: "_secretsDel", - ...buildCustomDocument("mutation", "_secretsDel", "_secretsDel", options.select, args, [{ - name: "input", - type: "_SecretsDelInput!" - }], connectionFieldsMap, "_SecretsDelPayload") - }), - _secretsRemoveArray: (args: _secretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsRemoveArray", - fieldName: "_secretsRemoveArray", - ...buildCustomDocument("mutation", "_secretsRemoveArray", "_secretsRemoveArray", options.select, args, [{ - name: "input", - type: "_SecretsRemoveArrayInput!" - }], connectionFieldsMap, "_SecretsRemoveArrayPayload") - }), - _secretsRotate: (args: _secretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsRotate", - fieldName: "_secretsRotate", - ...buildCustomDocument("mutation", "_secretsRotate", "_secretsRotate", options.select, args, [{ - name: "input", - type: "_SecretsRotateInput!" - }], connectionFieldsMap, "_SecretsRotatePayload") - }), - _secretsSet: (args: _secretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; - }>({ - client, - operation: "mutation", - operationName: "_secretsSet", - fieldName: "_secretsSet", - ...buildCustomDocument("mutation", "_secretsSet", "_secretsSet", options.select, args, [{ - name: "input", - type: "_SecretsSetInput!" - }], connectionFieldsMap, "_SecretsSetPayload") - }), - platformInternalSecretsDel: (args: PlatformInternalSecretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsDel: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsDel", - fieldName: "platformInternalSecretsDel", - ...buildCustomDocument("mutation", "PlatformInternalSecretsDel", "platformInternalSecretsDel", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsDelInput!" - }], connectionFieldsMap, "PlatformInternalSecretsDelPayload") - }), - platformInternalSecretsRemoveArray: (args: PlatformInternalSecretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsRemoveArray: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsRemoveArray", - fieldName: "platformInternalSecretsRemoveArray", - ...buildCustomDocument("mutation", "PlatformInternalSecretsRemoveArray", "platformInternalSecretsRemoveArray", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsRemoveArrayInput!" - }], connectionFieldsMap, "PlatformInternalSecretsRemoveArrayPayload") - }), - platformInternalSecretsRotate: (args: PlatformInternalSecretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsRotate: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsRotate", - fieldName: "platformInternalSecretsRotate", - ...buildCustomDocument("mutation", "PlatformInternalSecretsRotate", "platformInternalSecretsRotate", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsRotateInput!" - }], connectionFieldsMap, "PlatformInternalSecretsRotatePayload") - }), - platformInternalSecretsSet: (args: PlatformInternalSecretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInternalSecretsSet: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInternalSecretsSet", - fieldName: "platformInternalSecretsSet", - ...buildCustomDocument("mutation", "PlatformInternalSecretsSet", "platformInternalSecretsSet", options.select, args, [{ - name: "input", - type: "PlatformInternalSecretsSetInput!" - }], connectionFieldsMap, "PlatformInternalSecretsSetPayload") - }), - platformSecretsDel: (args: PlatformSecretsDelVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsDel: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsDel", - fieldName: "platformSecretsDel", - ...buildCustomDocument("mutation", "PlatformSecretsDel", "platformSecretsDel", options.select, args, [{ - name: "input", - type: "PlatformSecretsDelInput!" - }], connectionFieldsMap, "PlatformSecretsDelPayload") - }), - platformSecretsRemoveArray: (args: PlatformSecretsRemoveArrayVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsRemoveArray: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsRemoveArray", - fieldName: "platformSecretsRemoveArray", - ...buildCustomDocument("mutation", "PlatformSecretsRemoveArray", "platformSecretsRemoveArray", options.select, args, [{ - name: "input", - type: "PlatformSecretsRemoveArrayInput!" - }], connectionFieldsMap, "PlatformSecretsRemoveArrayPayload") - }), - platformSecretsRotate: (args: PlatformSecretsRotateVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsRotate: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsRotate", - fieldName: "platformSecretsRotate", - ...buildCustomDocument("mutation", "PlatformSecretsRotate", "platformSecretsRotate", options.select, args, [{ - name: "input", - type: "PlatformSecretsRotateInput!" - }], connectionFieldsMap, "PlatformSecretsRotatePayload") - }), - platformSecretsSet: (args: PlatformSecretsSetVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformSecretsSet: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformSecretsSet", - fieldName: "platformSecretsSet", - ...buildCustomDocument("mutation", "PlatformSecretsSet", "platformSecretsSet", options.select, args, [{ - name: "input", - type: "PlatformSecretsSetInput!" - }], connectionFieldsMap, "PlatformSecretsSetPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + _secretsDel: ( + args: _secretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsDel: InferSelectResult<_SecretsDelPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsDel', + fieldName: '_secretsDel', + ...buildCustomDocument( + 'mutation', + '_secretsDel', + '_secretsDel', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsDelInput!', + }, + ], + connectionFieldsMap, + '_SecretsDelPayload' + ), + }), + _secretsRemoveArray: ( + args: _secretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsRemoveArray: InferSelectResult<_SecretsRemoveArrayPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsRemoveArray', + fieldName: '_secretsRemoveArray', + ...buildCustomDocument( + 'mutation', + '_secretsRemoveArray', + '_secretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + '_SecretsRemoveArrayPayload' + ), + }), + _secretsRotate: ( + args: _secretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsRotate: InferSelectResult<_SecretsRotatePayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsRotate', + fieldName: '_secretsRotate', + ...buildCustomDocument( + 'mutation', + '_secretsRotate', + '_secretsRotate', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsRotateInput!', + }, + ], + connectionFieldsMap, + '_SecretsRotatePayload' + ), + }), + _secretsSet: ( + args: _secretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + _secretsSet: InferSelectResult<_SecretsSetPayload, S> | null; + }>({ + client, + operation: 'mutation', + operationName: '_secretsSet', + fieldName: '_secretsSet', + ...buildCustomDocument( + 'mutation', + '_secretsSet', + '_secretsSet', + options.select, + args, + [ + { + name: 'input', + type: '_SecretsSetInput!', + }, + ], + connectionFieldsMap, + '_SecretsSetPayload' + ), + }), + platformInternalSecretsDel: ( + args: PlatformInternalSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsDel', + fieldName: 'platformInternalSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsDel', + 'platformInternalSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsDelPayload' + ), + }), + platformInternalSecretsRemoveArray: ( + args: PlatformInternalSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsRemoveArray: InferSelectResult< + PlatformInternalSecretsRemoveArrayPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsRemoveArray', + fieldName: 'platformInternalSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsRemoveArray', + 'platformInternalSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsRemoveArrayPayload' + ), + }), + platformInternalSecretsRotate: ( + args: PlatformInternalSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsRotate: InferSelectResult< + PlatformInternalSecretsRotatePayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsRotate', + fieldName: 'platformInternalSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsRotate', + 'platformInternalSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsRotatePayload' + ), + }), + platformInternalSecretsSet: ( + args: PlatformInternalSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInternalSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInternalSecretsSet', + fieldName: 'platformInternalSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformInternalSecretsSet', + 'platformInternalSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInternalSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformInternalSecretsSetPayload' + ), + }), + platformSecretsDel: ( + args: PlatformSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsDel', + fieldName: 'platformSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsDel', + 'platformSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsDelPayload' + ), + }), + platformSecretsRemoveArray: ( + args: PlatformSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRemoveArray', + fieldName: 'platformSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRemoveArray', + 'platformSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRemoveArrayPayload' + ), + }), + platformSecretsRotate: ( + args: PlatformSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRotate', + fieldName: 'platformSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRotate', + 'platformSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRotatePayload' + ), + }), + platformSecretsSet: ( + args: PlatformSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsSet', + fieldName: 'platformSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsSet', + 'platformSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsSetPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/config/orm/query-builder.ts b/sdk/constructive-sdk/src/config/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/config/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/config/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/config/orm/realtime.ts b/sdk/constructive-sdk/src/config/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/config/orm/realtime.ts +++ b/sdk/constructive-sdk/src/config/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/config/orm/select-types.ts b/sdk/constructive-sdk/src/config/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/config/orm/select-types.ts +++ b/sdk/constructive-sdk/src/config/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/index.ts b/sdk/constructive-sdk/src/index.ts index 4f492497df..f64a72cd39 100644 --- a/sdk/constructive-sdk/src/index.ts +++ b/sdk/constructive-sdk/src/index.ts @@ -1,18 +1,18 @@ /** * @constructive-io/sdk - * + * * Auto-generated GraphQL types and ORM client. * Run `pnpm run generate` to populate this package from the schema files. - * + * * @generated by @constructive-io/graphql-codegen */ -export * as admin from "./admin"; -export * as agent from "./agent"; -export * as api from "./api"; -export * as auth from "./auth"; -export * as compute from "./compute"; -export * as config from "./config"; -export * as infra from "./infra"; -export * as modules from "./modules"; -export * as objects from "./objects"; -export * as usage from "./usage"; \ No newline at end of file +export * as admin from './admin'; +export * as agent from './agent'; +export * as api from './api'; +export * as auth from './auth'; +export * as compute from './compute'; +export * as config from './config'; +export * as infra from './infra'; +export * as modules from './modules'; +export * as objects from './objects'; +export * as usage from './usage'; diff --git a/sdk/constructive-sdk/src/infra/index.ts b/sdk/constructive-sdk/src/infra/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/infra/index.ts +++ b/sdk/constructive-sdk/src/infra/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/infra/orm/client.ts b/sdk/constructive-sdk/src/infra/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/infra/orm/client.ts +++ b/sdk/constructive-sdk/src/infra/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/infra/orm/index.ts b/sdk/constructive-sdk/src/infra/orm/index.ts index e121317be7..c40f0234ec 100644 --- a/sdk/constructive-sdk/src/infra/orm/index.ts +++ b/sdk/constructive-sdk/src/infra/orm/index.ts @@ -3,25 +3,25 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { DbPresetModel } from "./models/dbPreset"; -import { NamespaceModel } from "./models/namespace"; -import { NamespaceEventModel } from "./models/namespaceEvent"; -import { PlatformInfraCommitModel } from "./models/platformInfraCommit"; -import { PlatformInfraGetAllTreeNodesRecordModel } from "./models/platformInfraGetAllTreeNodesRecord"; -import { PlatformInfraObjectModel } from "./models/platformInfraObject"; -import { PlatformInfraRefModel } from "./models/platformInfraRef"; -import { PlatformInfraStoreModel } from "./models/platformInfraStore"; -import { PlatformNamespaceModel } from "./models/platformNamespace"; -import { PlatformNamespaceEventModel } from "./models/platformNamespaceEvent"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { DbPresetModel } from './models/dbPreset'; +import { NamespaceModel } from './models/namespace'; +import { NamespaceEventModel } from './models/namespaceEvent'; +import { PlatformInfraCommitModel } from './models/platformInfraCommit'; +import { PlatformInfraGetAllTreeNodesRecordModel } from './models/platformInfraGetAllTreeNodesRecord'; +import { PlatformInfraObjectModel } from './models/platformInfraObject'; +import { PlatformInfraRefModel } from './models/platformInfraRef'; +import { PlatformInfraStoreModel } from './models/platformInfraStore'; +import { PlatformNamespaceModel } from './models/platformNamespace'; +import { PlatformNamespaceEventModel } from './models/platformNamespaceEvent'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -58,6 +58,6 @@ export function createClient(config: OrmClientConfig) { platformInfraStore: new PlatformInfraStoreModel(client), platformNamespace: new PlatformNamespaceModel(client), platformNamespaceEvent: new PlatformNamespaceEventModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/input-types.ts b/sdk/constructive-sdk/src/infra/orm/input-types.ts index 1ac2c6461a..23e81e113d 100644 --- a/sdk/constructive-sdk/src/infra/orm/input-types.ts +++ b/sdk/constructive-sdk/src/infra/orm/input-types.ts @@ -436,12 +436,14 @@ export type DbPresetWithRelations = DbPreset & DbPresetRelations; export type NamespaceWithRelations = Namespace & NamespaceRelations; export type NamespaceEventWithRelations = NamespaceEvent & NamespaceEventRelations; export type PlatformInfraCommitWithRelations = PlatformInfraCommit & PlatformInfraCommitRelations; -export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & PlatformInfraGetAllTreeNodesRecordRelations; +export type PlatformInfraGetAllTreeNodesRecordWithRelations = PlatformInfraGetAllTreeNodesRecord & + PlatformInfraGetAllTreeNodesRecordRelations; export type PlatformInfraObjectWithRelations = PlatformInfraObject & PlatformInfraObjectRelations; export type PlatformInfraRefWithRelations = PlatformInfraRef & PlatformInfraRefRelations; export type PlatformInfraStoreWithRelations = PlatformInfraStore & PlatformInfraStoreRelations; export type PlatformNamespaceWithRelations = PlatformNamespace & PlatformNamespaceRelations; -export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & PlatformNamespaceEventRelations; +export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & + PlatformNamespaceEventRelations; // ============ Entity Select Types ============ export type DbPresetSelect = { active?: boolean; @@ -774,16 +776,202 @@ export interface PlatformNamespaceEventFilter { or?: PlatformNamespaceEventFilter[]; } // ============ OrderBy Types ============ -export type DbPresetOrderBy = "ACTIVE_ASC" | "ACTIVE_DESC" | "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "LABEL_ASC" | "LABEL_DESC" | "MODULES_HASH_ASC" | "MODULES_HASH_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SLUG_ASC" | "SLUG_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type NamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type PlatformInfraCommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type PlatformInfraGetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type PlatformInfraObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformInfraRefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type PlatformInfraStoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCOPE_ID_ASC" | "SCOPE_ID_DESC"; -export type PlatformNamespaceOrderBy = "ANNOTATIONS_ASC" | "ANNOTATIONS_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "ID_ASC" | "ID_DESC" | "IS_ACTIVE_ASC" | "IS_ACTIVE_DESC" | "IS_MANAGED_ASC" | "IS_MANAGED_DESC" | "LABELS_ASC" | "LABELS_DESC" | "LAST_ERROR_ASC" | "LAST_ERROR_DESC" | "NAMESPACE_NAME_ASC" | "NAMESPACE_NAME_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type PlatformNamespaceEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "METADATA_ASC" | "METADATA_DESC" | "NAMESPACE_ID_ASC" | "NAMESPACE_ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type DbPresetOrderBy = + | 'ACTIVE_ASC' + | 'ACTIVE_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LABEL_ASC' + | 'LABEL_DESC' + | 'MODULES_HASH_ASC' + | 'MODULES_HASH_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SLUG_ASC' + | 'SLUG_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type NamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type PlatformInfraCommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type PlatformInfraGetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type PlatformInfraObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformInfraRefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type PlatformInfraStoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCOPE_ID_ASC' + | 'SCOPE_ID_DESC'; +export type PlatformNamespaceOrderBy = + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_ACTIVE_ASC' + | 'IS_ACTIVE_DESC' + | 'IS_MANAGED_ASC' + | 'IS_MANAGED_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'NAMESPACE_NAME_ASC' + | 'NAMESPACE_NAME_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type PlatformNamespaceEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; // ============ CRUD Input Types ============ export interface CreateDbPresetInput { clientMutationId?: string; @@ -1826,4 +2014,4 @@ export type PlatformNamespaceEventEdgeSelect = { node?: { select: PlatformNamespaceEventSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/infra/orm/models/dbPreset.ts b/sdk/constructive-sdk/src/infra/orm/models/dbPreset.ts index 15b60268b5..a3e824a674 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/dbPreset.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/dbPreset.ts @@ -3,56 +3,96 @@ * @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 { DbPreset, DbPresetWithRelations, DbPresetSelect, DbPresetFilter, DbPresetOrderBy, CreateDbPresetInput, UpdateDbPresetInput, DbPresetPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPreset, + DbPresetWithRelations, + DbPresetSelect, + DbPresetFilter, + DbPresetOrderBy, + CreateDbPresetInput, + UpdateDbPresetInput, + DbPresetPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresets: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", 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 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + 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, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPresets", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPresets', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPreset", "dbPresets", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPreset: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPreset", "dbPresets", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPreset', + 'dbPresets', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetFilter", "DbPresetOrderBy", connectionFieldsMap); + 'DbPresetFilter', + 'DbPresetOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPreset", - fieldName: "dbPreset", + operation: 'query', + operationName: 'DbPreset', + fieldName: 'dbPreset', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPreset": data.dbPresets?.nodes?.[0] ?? null - }) + dbPreset: data.dbPresets?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPreset", "createDbPreset", "dbPreset", args.select, args.data, "CreateDbPresetInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPreset', + 'createDbPreset', + 'dbPreset', + args.select, + args.data, + 'CreateDbPresetInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "createDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'createDbPreset', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPreset", "updateDbPreset", "dbPreset", args.select, args.where.id, args.data, "UpdateDbPresetInput", "id", "dbPresetPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPreset', + 'updateDbPreset', + 'dbPreset', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetInput', + 'id', + 'dbPresetPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "updateDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'updateDbPreset', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPreset: { dbPreset: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPreset", "deleteDbPreset", "dbPreset", { - id: args.where.id - }, "DeleteDbPresetInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPreset', + 'deleteDbPreset', + 'dbPreset', + { + id: args.where.id, + }, + 'DeleteDbPresetInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPreset", - fieldName: "deleteDbPreset", + operation: 'mutation', + operationName: 'DbPreset', + fieldName: 'deleteDbPreset', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/index.ts b/sdk/constructive-sdk/src/infra/orm/models/index.ts index 60d8e491d5..1e5132eecf 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/index.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/index.ts @@ -3,13 +3,13 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { DbPresetModel } from "./dbPreset"; -export { NamespaceModel } from "./namespace"; -export { NamespaceEventModel } from "./namespaceEvent"; -export { PlatformInfraCommitModel } from "./platformInfraCommit"; -export { PlatformInfraGetAllTreeNodesRecordModel } from "./platformInfraGetAllTreeNodesRecord"; -export { PlatformInfraObjectModel } from "./platformInfraObject"; -export { PlatformInfraRefModel } from "./platformInfraRef"; -export { PlatformInfraStoreModel } from "./platformInfraStore"; -export { PlatformNamespaceModel } from "./platformNamespace"; -export { PlatformNamespaceEventModel } from "./platformNamespaceEvent"; \ No newline at end of file +export { DbPresetModel } from './dbPreset'; +export { NamespaceModel } from './namespace'; +export { NamespaceEventModel } from './namespaceEvent'; +export { PlatformInfraCommitModel } from './platformInfraCommit'; +export { PlatformInfraGetAllTreeNodesRecordModel } from './platformInfraGetAllTreeNodesRecord'; +export { PlatformInfraObjectModel } from './platformInfraObject'; +export { PlatformInfraRefModel } from './platformInfraRef'; +export { PlatformInfraStoreModel } from './platformInfraStore'; +export { PlatformNamespaceModel } from './platformNamespace'; +export { PlatformNamespaceEventModel } from './platformNamespaceEvent'; diff --git a/sdk/constructive-sdk/src/infra/orm/models/namespace.ts b/sdk/constructive-sdk/src/infra/orm/models/namespace.ts index 8c2bf42876..4e300068cd 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/namespace.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/namespace.ts @@ -3,56 +3,96 @@ * @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 { Namespace, NamespaceWithRelations, NamespaceSelect, NamespaceFilter, NamespaceOrderBy, CreateNamespaceInput, UpdateNamespaceInput, NamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Namespace, + NamespaceWithRelations, + NamespaceSelect, + NamespaceFilter, + NamespaceOrderBy, + CreateNamespaceInput, + UpdateNamespaceInput, + NamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", 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 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + 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, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespaces", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Namespace", "namespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Namespace", "namespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Namespace', + 'namespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceFilter", "NamespaceOrderBy", connectionFieldsMap); + 'NamespaceFilter', + 'NamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Namespace", - fieldName: "namespace", + operation: 'query', + operationName: 'Namespace', + fieldName: 'namespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespace": data.namespaces?.nodes?.[0] ?? null - }) + namespace: data.namespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Namespace", "createNamespace", "namespace", args.select, args.data, "CreateNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Namespace', + 'createNamespace', + 'namespace', + args.select, + args.data, + 'CreateNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "createNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'createNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Namespace", "updateNamespace", "namespace", args.select, args.where.id, args.data, "UpdateNamespaceInput", "id", "namespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Namespace', + 'updateNamespace', + 'namespace', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceInput', + 'id', + 'namespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "updateNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'updateNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespace: { namespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Namespace", "deleteNamespace", "namespace", { - id: args.where.id - }, "DeleteNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Namespace', + 'deleteNamespace', + 'namespace', + { + id: args.where.id, + }, + 'DeleteNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Namespace", - fieldName: "deleteNamespace", + operation: 'mutation', + operationName: 'Namespace', + fieldName: 'deleteNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/namespaceEvent.ts b/sdk/constructive-sdk/src/infra/orm/models/namespaceEvent.ts index 5fab4853c7..494442c263 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/namespaceEvent.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/namespaceEvent.ts @@ -3,56 +3,96 @@ * @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 { NamespaceEvent, NamespaceEventWithRelations, NamespaceEventSelect, NamespaceEventFilter, NamespaceEventOrderBy, CreateNamespaceEventInput, UpdateNamespaceEventInput, NamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceEvent, + NamespaceEventWithRelations, + NamespaceEventSelect, + NamespaceEventFilter, + NamespaceEventOrderBy, + CreateNamespaceEventInput, + UpdateNamespaceEventInput, + NamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", 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 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + 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, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvents", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceEvent", "namespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceEvent', + 'namespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceEventFilter", "NamespaceEventOrderBy", connectionFieldsMap); + 'NamespaceEventFilter', + 'NamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceEvent", - fieldName: "namespaceEvent", + operation: 'query', + operationName: 'NamespaceEvent', + fieldName: 'namespaceEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class NamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceEvent": data.namespaceEvents?.nodes?.[0] ?? null - }) + namespaceEvent: data.namespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceEvent", "createNamespaceEvent", "namespaceEvent", args.select, args.data, "CreateNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceEvent', + 'createNamespaceEvent', + 'namespaceEvent', + args.select, + args.data, + 'CreateNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "createNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'createNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + NamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceEvent", "updateNamespaceEvent", "namespaceEvent", args.select, args.where.id, args.data, "UpdateNamespaceEventInput", "id", "namespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceEvent', + 'updateNamespaceEvent', + 'namespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceEventInput', + 'id', + 'namespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "updateNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'updateNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceEvent: { namespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceEvent", "deleteNamespaceEvent", "namespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceEvent', + 'deleteNamespaceEvent', + 'namespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceEvent", - fieldName: "deleteNamespaceEvent", + operation: 'mutation', + operationName: 'NamespaceEvent', + fieldName: 'deleteNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/platformInfraCommit.ts b/sdk/constructive-sdk/src/infra/orm/models/platformInfraCommit.ts index b5e90c524d..ab0c34f08f 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/platformInfraCommit.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/platformInfraCommit.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraCommit, PlatformInfraCommitWithRelations, PlatformInfraCommitSelect, PlatformInfraCommitFilter, PlatformInfraCommitOrderBy, CreatePlatformInfraCommitInput, UpdatePlatformInfraCommitInput, PlatformInfraCommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraCommit, + PlatformInfraCommitWithRelations, + PlatformInfraCommitSelect, + PlatformInfraCommitFilter, + PlatformInfraCommitOrderBy, + CreatePlatformInfraCommitInput, + UpdatePlatformInfraCommitInput, + PlatformInfraCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraCommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", 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 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + 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, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommits", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraCommit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraCommit", "platformInfraCommits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraCommit', + 'platformInfraCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraCommitFilter", "PlatformInfraCommitOrderBy", connectionFieldsMap); + 'PlatformInfraCommitFilter', + 'PlatformInfraCommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraCommit", - fieldName: "platformInfraCommit", + operation: 'query', + operationName: 'PlatformInfraCommit', + fieldName: 'platformInfraCommit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraCommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraCommit": data.platformInfraCommits?.nodes?.[0] ?? null - }) + platformInfraCommit: data.platformInfraCommits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraCommit", "createPlatformInfraCommit", "platformInfraCommit", args.select, args.data, "CreatePlatformInfraCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraCommit', + 'createPlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.data, + 'CreatePlatformInfraCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "createPlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'createPlatformInfraCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraCommit", "updatePlatformInfraCommit", "platformInfraCommit", args.select, args.where.id, args.data, "UpdatePlatformInfraCommitInput", "id", "platformInfraCommitPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraCommit', + 'updatePlatformInfraCommit', + 'platformInfraCommit', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraCommitInput', + 'id', + 'platformInfraCommitPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "updatePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'updatePlatformInfraCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraCommit: { platformInfraCommit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraCommit", "deletePlatformInfraCommit", "platformInfraCommit", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraCommit', + 'deletePlatformInfraCommit', + 'platformInfraCommit', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraCommit", - fieldName: "deletePlatformInfraCommit", + operation: 'mutation', + operationName: 'PlatformInfraCommit', + fieldName: 'deletePlatformInfraCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts b/sdk/constructive-sdk/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts index 6c9bfc2b28..e0e0a2aeaa 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/platformInfraGetAllTreeNodesRecord.ts @@ -3,56 +3,109 @@ * @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 { PlatformInfraGetAllTreeNodesRecord, PlatformInfraGetAllTreeNodesRecordWithRelations, PlatformInfraGetAllTreeNodesRecordSelect, PlatformInfraGetAllTreeNodesRecordFilter, PlatformInfraGetAllTreeNodesRecordsOrderBy, CreatePlatformInfraGetAllTreeNodesRecordInput, UpdatePlatformInfraGetAllTreeNodesRecordInput, PlatformInfraGetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraGetAllTreeNodesRecord, + PlatformInfraGetAllTreeNodesRecordWithRelations, + PlatformInfraGetAllTreeNodesRecordSelect, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy, + CreatePlatformInfraGetAllTreeNodesRecordInput, + UpdatePlatformInfraGetAllTreeNodesRecordInput, + PlatformInfraGetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraGetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodes: ConnectionResult>; + findMany( + args: FindManyArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodes: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", 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 - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + 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, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodes", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformInfraGetAllTreeNodesRecord: InferSelectResult | null; + findFirst( + args: FindFirstArgs< + S, + PlatformInfraGetAllTreeNodesRecordFilter, + PlatformInfraGetAllTreeNodesRecordsOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraGetAllTreeNodesRecordFilter", "PlatformInfraGetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraGetAllTreeNodesRecordFilter', + 'PlatformInfraGetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "platformInfraGetAllTreeNodesRecord", + operation: 'query', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'platformInfraGetAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +113,41 @@ export class PlatformInfraGetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraGetAllTreeNodesRecord": data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null - }) + platformInfraGetAllTreeNodesRecord: data.platformInfraGetAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs< + S, + CreatePlatformInfraGetAllTreeNodesRecordInput['platformInfraGetAllTreeNodesRecord'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraGetAllTreeNodesRecord: { - platformInfraGetAllTreeNodesRecord: InferSelectResult; + platformInfraGetAllTreeNodesRecord: InferSelectResult< + PlatformInfraGetAllTreeNodesRecordWithRelations, + S + >; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraGetAllTreeNodesRecord", "createPlatformInfraGetAllTreeNodesRecord", "platformInfraGetAllTreeNodesRecord", args.select, args.data, "CreatePlatformInfraGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraGetAllTreeNodesRecord', + 'createPlatformInfraGetAllTreeNodesRecord', + 'platformInfraGetAllTreeNodesRecord', + args.select, + args.data, + 'CreatePlatformInfraGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraGetAllTreeNodesRecord", - fieldName: "createPlatformInfraGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'PlatformInfraGetAllTreeNodesRecord', + fieldName: 'createPlatformInfraGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/platformInfraObject.ts b/sdk/constructive-sdk/src/infra/orm/models/platformInfraObject.ts index 2978ff1c18..512cb448c4 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/platformInfraObject.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/platformInfraObject.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraObject, PlatformInfraObjectWithRelations, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy, CreatePlatformInfraObjectInput, UpdatePlatformInfraObjectInput, PlatformInfraObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraObject, + PlatformInfraObjectWithRelations, + PlatformInfraObjectSelect, + PlatformInfraObjectFilter, + PlatformInfraObjectOrderBy, + CreatePlatformInfraObjectInput, + UpdatePlatformInfraObjectInput, + PlatformInfraObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObjects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraObject", "platformInfraObjects", 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 - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + 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, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObjects", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObjects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraObject", "platformInfraObjects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraObjectFilter", "PlatformInfraObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraObject', + 'platformInfraObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraObjectFilter', + 'PlatformInfraObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class PlatformInfraObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraObject": data.platformInfraObjects?.nodes?.[0] ?? null - }) + platformInfraObject: data.platformInfraObjects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("PlatformInfraObject", "platformInfraGetNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'PlatformInfraObject', + 'platformInfraGetNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraObject", - fieldName: "platformInfraObject", + operation: 'query', + operationName: 'PlatformInfraObject', + fieldName: 'platformInfraObject', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraObject", "createPlatformInfraObject", "platformInfraObject", args.select, args.data, "CreatePlatformInfraObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraObject', + 'createPlatformInfraObject', + 'platformInfraObject', + args.select, + args.data, + 'CreatePlatformInfraObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "createPlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'createPlatformInfraObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraObject", "updatePlatformInfraObject", "platformInfraObject", args.select, args.where.id, args.data, "UpdatePlatformInfraObjectInput", "id", "platformInfraObjectPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraObject', + 'updatePlatformInfraObject', + 'platformInfraObject', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraObjectInput', + 'id', + 'platformInfraObjectPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "updatePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'updatePlatformInfraObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraObject", "deletePlatformInfraObject", "platformInfraObject", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraObject', + 'deletePlatformInfraObject', + 'platformInfraObject', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraObject", - fieldName: "deletePlatformInfraObject", + operation: 'mutation', + operationName: 'PlatformInfraObject', + fieldName: 'deletePlatformInfraObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/platformInfraRef.ts b/sdk/constructive-sdk/src/infra/orm/models/platformInfraRef.ts index 198e5cd359..c485407d95 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/platformInfraRef.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/platformInfraRef.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraRef, PlatformInfraRefWithRelations, PlatformInfraRefSelect, PlatformInfraRefFilter, PlatformInfraRefOrderBy, CreatePlatformInfraRefInput, UpdatePlatformInfraRefInput, PlatformInfraRefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraRef, + PlatformInfraRefWithRelations, + PlatformInfraRefSelect, + PlatformInfraRefFilter, + PlatformInfraRefOrderBy, + CreatePlatformInfraRefInput, + UpdatePlatformInfraRefInput, + PlatformInfraRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraRefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRefs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", 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 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + 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, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRefs", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRefs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraRef: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraRef", "platformInfraRefs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraRef', + 'platformInfraRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraRefFilter", "PlatformInfraRefOrderBy", connectionFieldsMap); + 'PlatformInfraRefFilter', + 'PlatformInfraRefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraRef", - fieldName: "platformInfraRef", + operation: 'query', + operationName: 'PlatformInfraRef', + fieldName: 'platformInfraRef', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class PlatformInfraRefModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraRef": data.platformInfraRefs?.nodes?.[0] ?? null - }) + platformInfraRef: data.platformInfraRefs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraRef", "createPlatformInfraRef", "platformInfraRef", args.select, args.data, "CreatePlatformInfraRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraRef', + 'createPlatformInfraRef', + 'platformInfraRef', + args.select, + args.data, + 'CreatePlatformInfraRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "createPlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'createPlatformInfraRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + scopeId: string; + }, + PlatformInfraRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraRef", "updatePlatformInfraRef", "platformInfraRef", args.select, args.where.id, args.data, "UpdatePlatformInfraRefInput", "id", "platformInfraRefPatch", connectionFieldsMap, { - scopeId: args.where.scopeId - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraRef', + 'updatePlatformInfraRef', + 'platformInfraRef', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraRefInput', + 'id', + 'platformInfraRefPatch', + connectionFieldsMap, + { + scopeId: args.where.scopeId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "updatePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'updatePlatformInfraRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - scopeId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + scopeId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraRef: { platformInfraRef: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraRef", "deletePlatformInfraRef", "platformInfraRef", { - id: args.where.id, - scopeId: args.where.scopeId - }, "DeletePlatformInfraRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraRef', + 'deletePlatformInfraRef', + 'platformInfraRef', + { + id: args.where.id, + scopeId: args.where.scopeId, + }, + 'DeletePlatformInfraRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraRef", - fieldName: "deletePlatformInfraRef", + operation: 'mutation', + operationName: 'PlatformInfraRef', + fieldName: 'deletePlatformInfraRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/platformInfraStore.ts b/sdk/constructive-sdk/src/infra/orm/models/platformInfraStore.ts index 857230b173..493d42e53c 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/platformInfraStore.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/platformInfraStore.ts @@ -3,56 +3,96 @@ * @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 { PlatformInfraStore, PlatformInfraStoreWithRelations, PlatformInfraStoreSelect, PlatformInfraStoreFilter, PlatformInfraStoreOrderBy, CreatePlatformInfraStoreInput, UpdatePlatformInfraStoreInput, PlatformInfraStorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformInfraStore, + PlatformInfraStoreWithRelations, + PlatformInfraStoreSelect, + PlatformInfraStoreFilter, + PlatformInfraStoreOrderBy, + CreatePlatformInfraStoreInput, + UpdatePlatformInfraStoreInput, + PlatformInfraStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformInfraStoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", 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 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + 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, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStores", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformInfraStore: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformInfraStore", "platformInfraStores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformInfraStore', + 'platformInfraStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformInfraStoreFilter", "PlatformInfraStoreOrderBy", connectionFieldsMap); + 'PlatformInfraStoreFilter', + 'PlatformInfraStoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformInfraStore", - fieldName: "platformInfraStore", + operation: 'query', + operationName: 'PlatformInfraStore', + fieldName: 'platformInfraStore', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformInfraStoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformInfraStore": data.platformInfraStores?.nodes?.[0] ?? null - }) + platformInfraStore: data.platformInfraStores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformInfraStore", "createPlatformInfraStore", "platformInfraStore", args.select, args.data, "CreatePlatformInfraStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformInfraStore', + 'createPlatformInfraStore', + 'platformInfraStore', + args.select, + args.data, + 'CreatePlatformInfraStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "createPlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'createPlatformInfraStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformInfraStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformInfraStore", "updatePlatformInfraStore", "platformInfraStore", args.select, args.where.id, args.data, "UpdatePlatformInfraStoreInput", "id", "platformInfraStorePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformInfraStore', + 'updatePlatformInfraStore', + 'platformInfraStore', + args.select, + args.where.id, + args.data, + 'UpdatePlatformInfraStoreInput', + 'id', + 'platformInfraStorePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "updatePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'updatePlatformInfraStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformInfraStore: { platformInfraStore: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformInfraStore", "deletePlatformInfraStore", "platformInfraStore", { - id: args.where.id - }, "DeletePlatformInfraStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformInfraStore', + 'deletePlatformInfraStore', + 'platformInfraStore', + { + id: args.where.id, + }, + 'DeletePlatformInfraStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformInfraStore", - fieldName: "deletePlatformInfraStore", + operation: 'mutation', + operationName: 'PlatformInfraStore', + fieldName: 'deletePlatformInfraStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/platformNamespace.ts b/sdk/constructive-sdk/src/infra/orm/models/platformNamespace.ts index 061849f0df..c4dff94953 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/platformNamespace.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/platformNamespace.ts @@ -3,56 +3,96 @@ * @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 { PlatformNamespace, PlatformNamespaceWithRelations, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy, CreatePlatformNamespaceInput, UpdatePlatformNamespaceInput, PlatformNamespacePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespace, + PlatformNamespaceWithRelations, + PlatformNamespaceSelect, + PlatformNamespaceFilter, + PlatformNamespaceOrderBy, + CreatePlatformNamespaceInput, + UpdatePlatformNamespaceInput, + PlatformNamespacePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaces: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", 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 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + 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, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespaces", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespaces', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespace: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespace", "platformNamespaces", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespace', + 'platformNamespaces', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceFilter", "PlatformNamespaceOrderBy", connectionFieldsMap); + 'PlatformNamespaceFilter', + 'PlatformNamespaceOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespace", - fieldName: "platformNamespace", + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlatformNamespaceModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespace": data.platformNamespaces?.nodes?.[0] ?? null - }) + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespace", "createPlatformNamespace", "platformNamespace", args.select, args.data, "CreatePlatformNamespaceInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespace', + 'createPlatformNamespace', + 'platformNamespace', + args.select, + args.data, + 'CreatePlatformNamespaceInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "createPlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'createPlatformNamespace', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformNamespacePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespace", "updatePlatformNamespace", "platformNamespace", args.select, args.where.id, args.data, "UpdatePlatformNamespaceInput", "id", "platformNamespacePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespace', + 'updatePlatformNamespace', + 'platformNamespace', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceInput', + 'id', + 'platformNamespacePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "updatePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'updatePlatformNamespace', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespace: { platformNamespace: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespace", "deletePlatformNamespace", "platformNamespace", { - id: args.where.id - }, "DeletePlatformNamespaceInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespace', + 'deletePlatformNamespace', + 'platformNamespace', + { + id: args.where.id, + }, + 'DeletePlatformNamespaceInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespace", - fieldName: "deletePlatformNamespace", + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'deletePlatformNamespace', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/models/platformNamespaceEvent.ts b/sdk/constructive-sdk/src/infra/orm/models/platformNamespaceEvent.ts index 90242716e8..198afe79ae 100644 --- a/sdk/constructive-sdk/src/infra/orm/models/platformNamespaceEvent.ts +++ b/sdk/constructive-sdk/src/infra/orm/models/platformNamespaceEvent.ts @@ -3,56 +3,98 @@ * @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 { PlatformNamespaceEvent, PlatformNamespaceEventWithRelations, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy, CreatePlatformNamespaceEventInput, UpdatePlatformNamespaceEventInput, PlatformNamespaceEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlatformNamespaceEvent, + PlatformNamespaceEventWithRelations, + PlatformNamespaceEventSelect, + PlatformNamespaceEventFilter, + PlatformNamespaceEventOrderBy, + CreatePlatformNamespaceEventInput, + UpdatePlatformNamespaceEventInput, + PlatformNamespaceEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlatformNamespaceEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - platformNamespaceEvents: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformNamespaceEvents: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", 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 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + 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, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvents", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ platformNamespaceEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlatformNamespaceEvent", "platformNamespaceEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlatformNamespaceEvent', + 'platformNamespaceEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlatformNamespaceEventFilter", "PlatformNamespaceEventOrderBy", connectionFieldsMap); + 'PlatformNamespaceEventFilter', + 'PlatformNamespaceEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlatformNamespaceEvent", - fieldName: "platformNamespaceEvent", + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', document, variables, transform: (data: { @@ -93,79 +142,111 @@ export class PlatformNamespaceEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "platformNamespaceEvent": data.platformNamespaceEvents?.nodes?.[0] ?? null - }) + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlatformNamespaceEvent", "createPlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.data, "CreatePlatformNamespaceEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlatformNamespaceEvent', + 'createPlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.data, + 'CreatePlatformNamespaceEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "createPlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'createPlatformNamespaceEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + PlatformNamespaceEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlatformNamespaceEvent", "updatePlatformNamespaceEvent", "platformNamespaceEvent", args.select, args.where.id, args.data, "UpdatePlatformNamespaceEventInput", "id", "platformNamespaceEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'PlatformNamespaceEvent', + 'updatePlatformNamespaceEvent', + 'platformNamespaceEvent', + args.select, + args.where.id, + args.data, + 'UpdatePlatformNamespaceEventInput', + 'id', + 'platformNamespaceEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "updatePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'updatePlatformNamespaceEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlatformNamespaceEvent: { platformNamespaceEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlatformNamespaceEvent", "deletePlatformNamespaceEvent", "platformNamespaceEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeletePlatformNamespaceEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlatformNamespaceEvent', + 'deletePlatformNamespaceEvent', + 'platformNamespaceEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeletePlatformNamespaceEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlatformNamespaceEvent", - fieldName: "deletePlatformNamespaceEvent", + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'deletePlatformNamespaceEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/mutation/index.ts b/sdk/constructive-sdk/src/infra/orm/mutation/index.ts index 3414cf9046..f266633531 100644 --- a/sdk/constructive-sdk/src/infra/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/infra/orm/mutation/index.ts @@ -3,11 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { PlatformInfraInitEmptyRepoInput, PlatformInfraInsertNodeAtPathInput, PlatformInfraSetDataAtPathInput, ProvisionBucketInput, PlatformInfraInitEmptyRepoPayload, PlatformInfraInsertNodeAtPathPayload, PlatformInfraSetDataAtPathPayload, ProvisionBucketPayload, PlatformInfraInitEmptyRepoPayloadSelect, PlatformInfraInsertNodeAtPathPayloadSelect, PlatformInfraSetDataAtPathPayloadSelect, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + PlatformInfraInitEmptyRepoInput, + PlatformInfraInsertNodeAtPathInput, + PlatformInfraSetDataAtPathInput, + ProvisionBucketInput, + PlatformInfraInitEmptyRepoPayload, + PlatformInfraInsertNodeAtPathPayload, + PlatformInfraSetDataAtPathPayload, + ProvisionBucketPayload, + PlatformInfraInitEmptyRepoPayloadSelect, + PlatformInfraInsertNodeAtPathPayloadSelect, + PlatformInfraSetDataAtPathPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface PlatformInfraInitEmptyRepoVariables { input: PlatformInfraInitEmptyRepoInput; } @@ -29,61 +42,124 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - platformInfraInitEmptyRepo: (args: PlatformInfraInitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInitEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInitEmptyRepo", - fieldName: "platformInfraInitEmptyRepo", - ...buildCustomDocument("mutation", "PlatformInfraInitEmptyRepo", "platformInfraInitEmptyRepo", options.select, args, [{ - name: "input", - type: "PlatformInfraInitEmptyRepoInput!" - }], connectionFieldsMap, "PlatformInfraInitEmptyRepoPayload") - }), - platformInfraInsertNodeAtPath: (args: PlatformInfraInsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraInsertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraInsertNodeAtPath", - fieldName: "platformInfraInsertNodeAtPath", - ...buildCustomDocument("mutation", "PlatformInfraInsertNodeAtPath", "platformInfraInsertNodeAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraInsertNodeAtPathInput!" - }], connectionFieldsMap, "PlatformInfraInsertNodeAtPathPayload") - }), - platformInfraSetDataAtPath: (args: PlatformInfraSetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - platformInfraSetDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "PlatformInfraSetDataAtPath", - fieldName: "platformInfraSetDataAtPath", - ...buildCustomDocument("mutation", "PlatformInfraSetDataAtPath", "platformInfraSetDataAtPath", options.select, args, [{ - name: "input", - type: "PlatformInfraSetDataAtPathInput!" - }], connectionFieldsMap, "PlatformInfraSetDataAtPathPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + platformInfraInitEmptyRepo: ( + args: PlatformInfraInitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInitEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInitEmptyRepo', + fieldName: 'platformInfraInitEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInitEmptyRepo', + 'platformInfraInitEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInitEmptyRepoPayload' + ), + }), + platformInfraInsertNodeAtPath: ( + args: PlatformInfraInsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraInsertNodeAtPath: InferSelectResult< + PlatformInfraInsertNodeAtPathPayload, + S + > | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraInsertNodeAtPath', + fieldName: 'platformInfraInsertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraInsertNodeAtPath', + 'platformInfraInsertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraInsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraInsertNodeAtPathPayload' + ), + }), + platformInfraSetDataAtPath: ( + args: PlatformInfraSetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformInfraSetDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformInfraSetDataAtPath', + fieldName: 'platformInfraSetDataAtPath', + ...buildCustomDocument( + 'mutation', + 'PlatformInfraSetDataAtPath', + 'platformInfraSetDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformInfraSetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'PlatformInfraSetDataAtPathPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/infra/orm/query-builder.ts b/sdk/constructive-sdk/src/infra/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/infra/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/infra/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/infra/orm/realtime.ts b/sdk/constructive-sdk/src/infra/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/infra/orm/realtime.ts +++ b/sdk/constructive-sdk/src/infra/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/infra/orm/select-types.ts b/sdk/constructive-sdk/src/infra/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/infra/orm/select-types.ts +++ b/sdk/constructive-sdk/src/infra/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/modules/index.ts b/sdk/constructive-sdk/src/modules/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/modules/index.ts +++ b/sdk/constructive-sdk/src/modules/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/modules/orm/client.ts b/sdk/constructive-sdk/src/modules/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/modules/orm/client.ts +++ b/sdk/constructive-sdk/src/modules/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/modules/orm/index.ts b/sdk/constructive-sdk/src/modules/orm/index.ts index e1606d62ad..f50345da8b 100644 --- a/sdk/constructive-sdk/src/modules/orm/index.ts +++ b/sdk/constructive-sdk/src/modules/orm/index.ts @@ -3,92 +3,92 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AgentModuleModel } from "./models/agentModule"; -import { ApiSurfaceModuleModel } from "./models/apiSurfaceModule"; -import { AppModuleModel } from "./models/appModule"; -import { BillingModuleModel } from "./models/billingModule"; -import { BillingProviderModuleModel } from "./models/billingProviderModule"; -import { BlueprintModel } from "./models/blueprint"; -import { BlueprintConstructionModel } from "./models/blueprintConstruction"; -import { BlueprintTemplateModel } from "./models/blueprintTemplate"; -import { CatalogModuleModel } from "./models/catalogModule"; -import { ComputeLogModuleModel } from "./models/computeLogModule"; -import { ConfigSecretsUserModuleModel } from "./models/configSecretsUserModule"; -import { ConnectedAccountsModuleModel } from "./models/connectedAccountsModule"; -import { CryptoAddressesModuleModel } from "./models/cryptoAddressesModule"; -import { CryptoAuthModuleModel } from "./models/cryptoAuthModule"; -import { DatabaseProvisionModuleModel } from "./models/databaseProvisionModule"; -import { DatabaseSettingsModuleModel } from "./models/databaseSettingsModule"; -import { DbPoolConfigModel } from "./models/dbPoolConfig"; -import { DbPoolModel } from "./models/dbPool"; -import { DbPresetModuleModel } from "./models/dbPresetModule"; -import { DbUsageModuleModel } from "./models/dbUsageModule"; -import { DefaultIdsModuleModel } from "./models/defaultIdsModule"; -import { DenormalizedTableFieldModel } from "./models/denormalizedTableField"; -import { DevicesModuleModel } from "./models/devicesModule"; -import { DomainModuleModel } from "./models/domainModule"; -import { EmailsModuleModel } from "./models/emailsModule"; -import { EntityTypeProvisionModel } from "./models/entityTypeProvision"; -import { EventsModuleModel } from "./models/eventsModule"; -import { FunctionDeploymentModuleModel } from "./models/functionDeploymentModule"; -import { FunctionInvocationModuleModel } from "./models/functionInvocationModule"; -import { FunctionModuleModel } from "./models/functionModule"; -import { GraphExecutionModuleModel } from "./models/graphExecutionModule"; -import { GraphModuleModel } from "./models/graphModule"; -import { HierarchyModuleModel } from "./models/hierarchyModule"; -import { HttpRouteModuleModel } from "./models/httpRouteModule"; -import { I18NModuleModel } from "./models/i18NModule"; -import { IdentityProvidersModuleModel } from "./models/identityProvidersModule"; -import { InferenceLogModuleModel } from "./models/inferenceLogModule"; -import { InfraConfigModuleModel } from "./models/infraConfigModule"; -import { InfraSecretsModuleModel } from "./models/infraSecretsModule"; -import { IntegrationProvidersModuleModel } from "./models/integrationProvidersModule"; -import { InternalSecretsModuleModel } from "./models/internalSecretsModule"; -import { InvitesModuleModel } from "./models/invitesModule"; -import { LimitsModuleModel } from "./models/limitsModule"; -import { MembershipTypesModuleModel } from "./models/membershipTypesModule"; -import { MembershipsModuleModel } from "./models/membershipsModule"; -import { MerkleStoreModuleModel } from "./models/merkleStoreModule"; -import { NamespaceModuleModel } from "./models/namespaceModule"; -import { NotificationsModuleModel } from "./models/notificationsModule"; -import { PermissionsModuleModel } from "./models/permissionsModule"; -import { PhoneNumbersModuleModel } from "./models/phoneNumbersModule"; -import { PlansModuleModel } from "./models/plansModule"; -import { PrincipalAuthModuleModel } from "./models/principalAuthModule"; -import { ProfilesModuleModel } from "./models/profilesModule"; -import { RateLimitMetersModuleModel } from "./models/rateLimitMetersModule"; -import { RateLimitsModuleModel } from "./models/rateLimitsModule"; -import { RealtimeModuleModel } from "./models/realtimeModule"; -import { RelationProvisionModel } from "./models/relationProvision"; -import { ResourceModuleModel } from "./models/resourceModule"; -import { RlsModuleModel } from "./models/rlsModule"; -import { RouteModuleModel } from "./models/routeModule"; -import { SecureTableProvisionModel } from "./models/secureTableProvision"; -import { SessionSecretsModuleModel } from "./models/sessionSecretsModule"; -import { SessionsModuleModel } from "./models/sessionsModule"; -import { SiteSurfaceModuleModel } from "./models/siteSurfaceModule"; -import { StorageLogModuleModel } from "./models/storageLogModule"; -import { StorageModuleModel } from "./models/storageModule"; -import { TransferLogModuleModel } from "./models/transferLogModule"; -import { UserAuthModuleModel } from "./models/userAuthModule"; -import { UserCredentialsModuleModel } from "./models/userCredentialsModule"; -import { UserSettingsModuleModel } from "./models/userSettingsModule"; -import { UserStateModuleModel } from "./models/userStateModule"; -import { UsersModuleModel } from "./models/usersModule"; -import { WebauthnAuthModuleModel } from "./models/webauthnAuthModule"; -import { WebauthnCredentialsModuleModel } from "./models/webauthnCredentialsModule"; -import { WebhookModuleModel } from "./models/webhookModule"; -import { createQueryOperations } from "./query"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createQueryOperations } from "./query"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AgentModuleModel } from './models/agentModule'; +import { ApiSurfaceModuleModel } from './models/apiSurfaceModule'; +import { AppModuleModel } from './models/appModule'; +import { BillingModuleModel } from './models/billingModule'; +import { BillingProviderModuleModel } from './models/billingProviderModule'; +import { BlueprintModel } from './models/blueprint'; +import { BlueprintConstructionModel } from './models/blueprintConstruction'; +import { BlueprintTemplateModel } from './models/blueprintTemplate'; +import { CatalogModuleModel } from './models/catalogModule'; +import { ComputeLogModuleModel } from './models/computeLogModule'; +import { ConfigSecretsUserModuleModel } from './models/configSecretsUserModule'; +import { ConnectedAccountsModuleModel } from './models/connectedAccountsModule'; +import { CryptoAddressesModuleModel } from './models/cryptoAddressesModule'; +import { CryptoAuthModuleModel } from './models/cryptoAuthModule'; +import { DatabaseProvisionModuleModel } from './models/databaseProvisionModule'; +import { DatabaseSettingsModuleModel } from './models/databaseSettingsModule'; +import { DbPoolConfigModel } from './models/dbPoolConfig'; +import { DbPoolModel } from './models/dbPool'; +import { DbPresetModuleModel } from './models/dbPresetModule'; +import { DbUsageModuleModel } from './models/dbUsageModule'; +import { DefaultIdsModuleModel } from './models/defaultIdsModule'; +import { DenormalizedTableFieldModel } from './models/denormalizedTableField'; +import { DevicesModuleModel } from './models/devicesModule'; +import { DomainModuleModel } from './models/domainModule'; +import { EmailsModuleModel } from './models/emailsModule'; +import { EntityTypeProvisionModel } from './models/entityTypeProvision'; +import { EventsModuleModel } from './models/eventsModule'; +import { FunctionDeploymentModuleModel } from './models/functionDeploymentModule'; +import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; +import { FunctionModuleModel } from './models/functionModule'; +import { GraphExecutionModuleModel } from './models/graphExecutionModule'; +import { GraphModuleModel } from './models/graphModule'; +import { HierarchyModuleModel } from './models/hierarchyModule'; +import { HttpRouteModuleModel } from './models/httpRouteModule'; +import { I18NModuleModel } from './models/i18NModule'; +import { IdentityProvidersModuleModel } from './models/identityProvidersModule'; +import { InferenceLogModuleModel } from './models/inferenceLogModule'; +import { InfraConfigModuleModel } from './models/infraConfigModule'; +import { InfraSecretsModuleModel } from './models/infraSecretsModule'; +import { IntegrationProvidersModuleModel } from './models/integrationProvidersModule'; +import { InternalSecretsModuleModel } from './models/internalSecretsModule'; +import { InvitesModuleModel } from './models/invitesModule'; +import { LimitsModuleModel } from './models/limitsModule'; +import { MembershipTypesModuleModel } from './models/membershipTypesModule'; +import { MembershipsModuleModel } from './models/membershipsModule'; +import { MerkleStoreModuleModel } from './models/merkleStoreModule'; +import { NamespaceModuleModel } from './models/namespaceModule'; +import { NotificationsModuleModel } from './models/notificationsModule'; +import { PermissionsModuleModel } from './models/permissionsModule'; +import { PhoneNumbersModuleModel } from './models/phoneNumbersModule'; +import { PlansModuleModel } from './models/plansModule'; +import { PrincipalAuthModuleModel } from './models/principalAuthModule'; +import { ProfilesModuleModel } from './models/profilesModule'; +import { RateLimitMetersModuleModel } from './models/rateLimitMetersModule'; +import { RateLimitsModuleModel } from './models/rateLimitsModule'; +import { RealtimeModuleModel } from './models/realtimeModule'; +import { RelationProvisionModel } from './models/relationProvision'; +import { ResourceModuleModel } from './models/resourceModule'; +import { RlsModuleModel } from './models/rlsModule'; +import { RouteModuleModel } from './models/routeModule'; +import { SecureTableProvisionModel } from './models/secureTableProvision'; +import { SessionSecretsModuleModel } from './models/sessionSecretsModule'; +import { SessionsModuleModel } from './models/sessionsModule'; +import { SiteSurfaceModuleModel } from './models/siteSurfaceModule'; +import { StorageLogModuleModel } from './models/storageLogModule'; +import { StorageModuleModel } from './models/storageModule'; +import { TransferLogModuleModel } from './models/transferLogModule'; +import { UserAuthModuleModel } from './models/userAuthModule'; +import { UserCredentialsModuleModel } from './models/userCredentialsModule'; +import { UserSettingsModuleModel } from './models/userSettingsModule'; +import { UserStateModuleModel } from './models/userStateModule'; +import { UsersModuleModel } from './models/usersModule'; +import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; +import { WebauthnCredentialsModuleModel } from './models/webauthnCredentialsModule'; +import { WebhookModuleModel } from './models/webhookModule'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -191,6 +191,6 @@ export function createClient(config: OrmClientConfig) { webauthnCredentialsModule: new WebauthnCredentialsModuleModel(client), webhookModule: new WebhookModuleModel(client), query: createQueryOperations(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/input-types.ts b/sdk/constructive-sdk/src/modules/orm/input-types.ts index 14905979ef..c5c73d471c 100644 --- a/sdk/constructive-sdk/src/modules/orm/input-types.ts +++ b/sdk/constructive-sdk/src/modules/orm/input-types.ts @@ -2353,46 +2353,61 @@ export type AgentModuleWithRelations = AgentModule & AgentModuleRelations; export type ApiSurfaceModuleWithRelations = ApiSurfaceModule & ApiSurfaceModuleRelations; export type AppModuleWithRelations = AppModule & AppModuleRelations; export type BillingModuleWithRelations = BillingModule & BillingModuleRelations; -export type BillingProviderModuleWithRelations = BillingProviderModule & BillingProviderModuleRelations; +export type BillingProviderModuleWithRelations = BillingProviderModule & + BillingProviderModuleRelations; export type BlueprintWithRelations = Blueprint & BlueprintRelations; -export type BlueprintConstructionWithRelations = BlueprintConstruction & BlueprintConstructionRelations; +export type BlueprintConstructionWithRelations = BlueprintConstruction & + BlueprintConstructionRelations; export type BlueprintTemplateWithRelations = BlueprintTemplate & BlueprintTemplateRelations; export type CatalogModuleWithRelations = CatalogModule & CatalogModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; -export type ConfigSecretsUserModuleWithRelations = ConfigSecretsUserModule & ConfigSecretsUserModuleRelations; -export type ConnectedAccountsModuleWithRelations = ConnectedAccountsModule & ConnectedAccountsModuleRelations; -export type CryptoAddressesModuleWithRelations = CryptoAddressesModule & CryptoAddressesModuleRelations; +export type ConfigSecretsUserModuleWithRelations = ConfigSecretsUserModule & + ConfigSecretsUserModuleRelations; +export type ConnectedAccountsModuleWithRelations = ConnectedAccountsModule & + ConnectedAccountsModuleRelations; +export type CryptoAddressesModuleWithRelations = CryptoAddressesModule & + CryptoAddressesModuleRelations; export type CryptoAuthModuleWithRelations = CryptoAuthModule & CryptoAuthModuleRelations; -export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & DatabaseProvisionModuleRelations; -export type DatabaseSettingsModuleWithRelations = DatabaseSettingsModule & DatabaseSettingsModuleRelations; +export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & + DatabaseProvisionModuleRelations; +export type DatabaseSettingsModuleWithRelations = DatabaseSettingsModule & + DatabaseSettingsModuleRelations; export type DbPoolConfigWithRelations = DbPoolConfig & DbPoolConfigRelations; export type DbPoolWithRelations = DbPool & DbPoolRelations; export type DbPresetModuleWithRelations = DbPresetModule & DbPresetModuleRelations; export type DbUsageModuleWithRelations = DbUsageModule & DbUsageModuleRelations; export type DefaultIdsModuleWithRelations = DefaultIdsModule & DefaultIdsModuleRelations; -export type DenormalizedTableFieldWithRelations = DenormalizedTableField & DenormalizedTableFieldRelations; +export type DenormalizedTableFieldWithRelations = DenormalizedTableField & + DenormalizedTableFieldRelations; export type DevicesModuleWithRelations = DevicesModule & DevicesModuleRelations; export type DomainModuleWithRelations = DomainModule & DomainModuleRelations; export type EmailsModuleWithRelations = EmailsModule & EmailsModuleRelations; export type EntityTypeProvisionWithRelations = EntityTypeProvision & EntityTypeProvisionRelations; export type EventsModuleWithRelations = EventsModule & EventsModuleRelations; -export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & FunctionDeploymentModuleRelations; -export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; +export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & + FunctionDeploymentModuleRelations; +export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & + FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; -export type GraphExecutionModuleWithRelations = GraphExecutionModule & GraphExecutionModuleRelations; +export type GraphExecutionModuleWithRelations = GraphExecutionModule & + GraphExecutionModuleRelations; export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; export type HierarchyModuleWithRelations = HierarchyModule & HierarchyModuleRelations; export type HttpRouteModuleWithRelations = HttpRouteModule & HttpRouteModuleRelations; export type I18NModuleWithRelations = I18NModule & I18NModuleRelations; -export type IdentityProvidersModuleWithRelations = IdentityProvidersModule & IdentityProvidersModuleRelations; +export type IdentityProvidersModuleWithRelations = IdentityProvidersModule & + IdentityProvidersModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; export type InfraConfigModuleWithRelations = InfraConfigModule & InfraConfigModuleRelations; export type InfraSecretsModuleWithRelations = InfraSecretsModule & InfraSecretsModuleRelations; -export type IntegrationProvidersModuleWithRelations = IntegrationProvidersModule & IntegrationProvidersModuleRelations; -export type InternalSecretsModuleWithRelations = InternalSecretsModule & InternalSecretsModuleRelations; +export type IntegrationProvidersModuleWithRelations = IntegrationProvidersModule & + IntegrationProvidersModuleRelations; +export type InternalSecretsModuleWithRelations = InternalSecretsModule & + InternalSecretsModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; export type LimitsModuleWithRelations = LimitsModule & LimitsModuleRelations; -export type MembershipTypesModuleWithRelations = MembershipTypesModule & MembershipTypesModuleRelations; +export type MembershipTypesModuleWithRelations = MembershipTypesModule & + MembershipTypesModuleRelations; export type MembershipsModuleWithRelations = MembershipsModule & MembershipsModuleRelations; export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; @@ -2402,27 +2417,32 @@ export type PhoneNumbersModuleWithRelations = PhoneNumbersModule & PhoneNumbersM export type PlansModuleWithRelations = PlansModule & PlansModuleRelations; export type PrincipalAuthModuleWithRelations = PrincipalAuthModule & PrincipalAuthModuleRelations; export type ProfilesModuleWithRelations = ProfilesModule & ProfilesModuleRelations; -export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & RateLimitMetersModuleRelations; +export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & + RateLimitMetersModuleRelations; export type RateLimitsModuleWithRelations = RateLimitsModule & RateLimitsModuleRelations; export type RealtimeModuleWithRelations = RealtimeModule & RealtimeModuleRelations; export type RelationProvisionWithRelations = RelationProvision & RelationProvisionRelations; export type ResourceModuleWithRelations = ResourceModule & ResourceModuleRelations; export type RlsModuleWithRelations = RlsModule & RlsModuleRelations; export type RouteModuleWithRelations = RouteModule & RouteModuleRelations; -export type SecureTableProvisionWithRelations = SecureTableProvision & SecureTableProvisionRelations; -export type SessionSecretsModuleWithRelations = SessionSecretsModule & SessionSecretsModuleRelations; +export type SecureTableProvisionWithRelations = SecureTableProvision & + SecureTableProvisionRelations; +export type SessionSecretsModuleWithRelations = SessionSecretsModule & + SessionSecretsModuleRelations; export type SessionsModuleWithRelations = SessionsModule & SessionsModuleRelations; export type SiteSurfaceModuleWithRelations = SiteSurfaceModule & SiteSurfaceModuleRelations; export type StorageLogModuleWithRelations = StorageLogModule & StorageLogModuleRelations; export type StorageModuleWithRelations = StorageModule & StorageModuleRelations; export type TransferLogModuleWithRelations = TransferLogModule & TransferLogModuleRelations; export type UserAuthModuleWithRelations = UserAuthModule & UserAuthModuleRelations; -export type UserCredentialsModuleWithRelations = UserCredentialsModule & UserCredentialsModuleRelations; +export type UserCredentialsModuleWithRelations = UserCredentialsModule & + UserCredentialsModuleRelations; export type UserSettingsModuleWithRelations = UserSettingsModule & UserSettingsModuleRelations; export type UserStateModuleWithRelations = UserStateModule & UserStateModuleRelations; export type UsersModuleWithRelations = UsersModule & UsersModuleRelations; export type WebauthnAuthModuleWithRelations = WebauthnAuthModule & WebauthnAuthModuleRelations; -export type WebauthnCredentialsModuleWithRelations = WebauthnCredentialsModule & WebauthnCredentialsModuleRelations; +export type WebauthnCredentialsModuleWithRelations = WebauthnCredentialsModule & + WebauthnCredentialsModuleRelations; export type WebhookModuleWithRelations = WebhookModule & WebhookModuleRelations; // ============ Entity Select Types ============ export type AgentModuleSelect = { @@ -7544,81 +7564,3082 @@ export interface WebhookModuleFilter { webhookEventsTableName?: StringFilter; } // ============ OrderBy Types ============ -export type AgentModuleOrderBy = "AGENT_TABLE_ID_ASC" | "AGENT_TABLE_ID_DESC" | "AGENT_TABLE_NAME_ASC" | "AGENT_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HAS_AGENTS_ASC" | "HAS_AGENTS_DESC" | "HAS_PLANS_ASC" | "HAS_PLANS_DESC" | "HAS_RESOURCES_ASC" | "HAS_RESOURCES_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_TABLE_ID_ASC" | "MESSAGE_TABLE_ID_DESC" | "MESSAGE_TABLE_NAME_ASC" | "MESSAGE_TABLE_NAME_DESC" | "NATURAL" | "PERSONA_TABLE_ID_ASC" | "PERSONA_TABLE_ID_DESC" | "PERSONA_TABLE_NAME_ASC" | "PERSONA_TABLE_NAME_DESC" | "PLAN_TABLE_ID_ASC" | "PLAN_TABLE_ID_DESC" | "PLAN_TABLE_NAME_ASC" | "PLAN_TABLE_NAME_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROMPTS_TABLE_ID_ASC" | "PROMPTS_TABLE_ID_DESC" | "PROMPTS_TABLE_NAME_ASC" | "PROMPTS_TABLE_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOURCES_ASC" | "RESOURCES_DESC" | "RESOURCE_TABLE_ID_ASC" | "RESOURCE_TABLE_ID_DESC" | "RESOURCE_TABLE_NAME_ASC" | "RESOURCE_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SHARED_ASC" | "SHARED_DESC" | "TASK_TABLE_ID_ASC" | "TASK_TABLE_ID_DESC" | "TASK_TABLE_NAME_ASC" | "TASK_TABLE_NAME_DESC" | "THREAD_TABLE_ID_ASC" | "THREAD_TABLE_ID_DESC" | "THREAD_TABLE_NAME_ASC" | "THREAD_TABLE_NAME_DESC"; -export type ApiSurfaceModuleOrderBy = "APIS_TABLE_ID_ASC" | "APIS_TABLE_ID_DESC" | "APIS_TABLE_NAME_ASC" | "APIS_TABLE_NAME_DESC" | "API_MODULES_TABLE_ID_ASC" | "API_MODULES_TABLE_ID_DESC" | "API_MODULES_TABLE_NAME_ASC" | "API_MODULES_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "API_SCHEMAS_TABLE_ID_ASC" | "API_SCHEMAS_TABLE_ID_DESC" | "API_SCHEMAS_TABLE_NAME_ASC" | "API_SCHEMAS_TABLE_NAME_DESC" | "API_SETTINGS_TABLE_ID_ASC" | "API_SETTINGS_TABLE_ID_DESC" | "API_SETTINGS_TABLE_NAME_ASC" | "API_SETTINGS_TABLE_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "CORS_SETTINGS_TABLE_ID_ASC" | "CORS_SETTINGS_TABLE_ID_DESC" | "CORS_SETTINGS_TABLE_NAME_ASC" | "CORS_SETTINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type AppModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "APPS_TABLE_ID_ASC" | "APPS_TABLE_ID_DESC" | "APPS_TABLE_NAME_ASC" | "APPS_TABLE_NAME_DESC" | "APP_COMPONENTS_TABLE_ID_ASC" | "APP_COMPONENTS_TABLE_ID_DESC" | "APP_COMPONENTS_TABLE_NAME_ASC" | "APP_COMPONENTS_TABLE_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type BillingModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BALANCES_TABLE_ID_ASC" | "BALANCES_TABLE_ID_DESC" | "BALANCES_TABLE_NAME_ASC" | "BALANCES_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ID_ASC" | "ID_DESC" | "LEDGER_TABLE_ID_ASC" | "LEDGER_TABLE_ID_DESC" | "LEDGER_TABLE_NAME_ASC" | "LEDGER_TABLE_NAME_DESC" | "METERS_TABLE_ID_ASC" | "METERS_TABLE_ID_DESC" | "METERS_TABLE_NAME_ASC" | "METERS_TABLE_NAME_DESC" | "METER_CREDITS_TABLE_ID_ASC" | "METER_CREDITS_TABLE_ID_DESC" | "METER_CREDITS_TABLE_NAME_ASC" | "METER_CREDITS_TABLE_NAME_DESC" | "METER_DEFAULTS_TABLE_ID_ASC" | "METER_DEFAULTS_TABLE_ID_DESC" | "METER_DEFAULTS_TABLE_NAME_ASC" | "METER_DEFAULTS_TABLE_NAME_DESC" | "METER_SOURCES_TABLE_ID_ASC" | "METER_SOURCES_TABLE_ID_DESC" | "METER_SOURCES_TABLE_NAME_ASC" | "METER_SOURCES_TABLE_NAME_DESC" | "NATURAL" | "PLAN_SUBSCRIPTIONS_TABLE_ID_ASC" | "PLAN_SUBSCRIPTIONS_TABLE_ID_DESC" | "PLAN_SUBSCRIPTIONS_TABLE_NAME_ASC" | "PLAN_SUBSCRIPTIONS_TABLE_NAME_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RECORD_USAGE_FUNCTION_ASC" | "RECORD_USAGE_FUNCTION_DESC" | "ROLLUP_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_ASC" | "SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_DESC"; -export type BillingProviderModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BILLING_CUSTOMERS_TABLE_ID_ASC" | "BILLING_CUSTOMERS_TABLE_ID_DESC" | "BILLING_CUSTOMERS_TABLE_NAME_ASC" | "BILLING_CUSTOMERS_TABLE_NAME_DESC" | "BILLING_PRICES_TABLE_ID_ASC" | "BILLING_PRICES_TABLE_ID_DESC" | "BILLING_PRICES_TABLE_NAME_ASC" | "BILLING_PRICES_TABLE_NAME_DESC" | "BILLING_PRODUCTS_TABLE_ID_ASC" | "BILLING_PRODUCTS_TABLE_ID_DESC" | "BILLING_PRODUCTS_TABLE_NAME_ASC" | "BILLING_PRODUCTS_TABLE_NAME_DESC" | "BILLING_SUBSCRIPTIONS_TABLE_ID_ASC" | "BILLING_SUBSCRIPTIONS_TABLE_ID_DESC" | "BILLING_SUBSCRIPTIONS_TABLE_NAME_ASC" | "BILLING_SUBSCRIPTIONS_TABLE_NAME_DESC" | "BILLING_WEBHOOK_EVENTS_TABLE_ID_ASC" | "BILLING_WEBHOOK_EVENTS_TABLE_ID_DESC" | "BILLING_WEBHOOK_EVENTS_TABLE_NAME_ASC" | "BILLING_WEBHOOK_EVENTS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRICES_TABLE_ID_ASC" | "PRICES_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PROCESS_BILLING_EVENT_FUNCTION_ASC" | "PROCESS_BILLING_EVENT_FUNCTION_DESC" | "PRODUCTS_TABLE_ID_ASC" | "PRODUCTS_TABLE_ID_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SUBSCRIPTIONS_TABLE_ID_ASC" | "SUBSCRIPTIONS_TABLE_ID_DESC"; -export type BlueprintOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DEFINITION_HASH_ASC" | "DEFINITION_HASH_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TABLE_HASHES_ASC" | "TABLE_HASHES_DESC" | "TEMPLATE_ID_ASC" | "TEMPLATE_ID_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type BlueprintConstructionOrderBy = "BLUEPRINT_ID_ASC" | "BLUEPRINT_ID_DESC" | "CONSTRUCTED_AT_ASC" | "CONSTRUCTED_AT_DESC" | "CONSTRUCTED_DEFINITION_ASC" | "CONSTRUCTED_DEFINITION_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_DETAILS_ASC" | "ERROR_DETAILS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "TABLE_MAP_ASC" | "TABLE_MAP_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type BlueprintTemplateOrderBy = "CATEGORIES_ASC" | "CATEGORIES_DESC" | "COMPLEXITY_ASC" | "COMPLEXITY_DESC" | "COPY_COUNT_ASC" | "COPY_COUNT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DEFINITION_ASC" | "DEFINITION_DESC" | "DEFINITION_HASH_ASC" | "DEFINITION_HASH_DESC" | "DEFINITION_SCHEMA_VERSION_ASC" | "DEFINITION_SCHEMA_VERSION_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "DISPLAY_NAME_ASC" | "DISPLAY_NAME_DESC" | "FORKED_FROM_ID_ASC" | "FORKED_FROM_ID_DESC" | "FORK_COUNT_ASC" | "FORK_COUNT_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_ASC" | "SOURCE_DESC" | "TABLE_HASHES_ASC" | "TABLE_HASHES_DESC" | "TAGS_ASC" | "TAGS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "VERSION_ASC" | "VERSION_DESC" | "VISIBILITY_ASC" | "VISIBILITY_DESC"; -export type CatalogModuleOrderBy = "APIS_TABLE_ID_ASC" | "APIS_TABLE_ID_DESC" | "APIS_TABLE_NAME_ASC" | "APIS_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "APPS_TABLE_ID_ASC" | "APPS_TABLE_ID_DESC" | "APPS_TABLE_NAME_ASC" | "APPS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAINS_TABLE_ID_ASC" | "DOMAINS_TABLE_ID_DESC" | "DOMAINS_TABLE_NAME_ASC" | "DOMAINS_TABLE_NAME_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTIONS_TABLE_ID_ASC" | "FUNCTIONS_TABLE_ID_DESC" | "FUNCTIONS_TABLE_NAME_ASC" | "FUNCTIONS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACES_TABLE_ID_ASC" | "NAMESPACES_TABLE_ID_DESC" | "NAMESPACES_TABLE_NAME_ASC" | "NAMESPACES_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOURCES_TABLE_ID_ASC" | "RESOURCES_TABLE_ID_DESC" | "RESOURCES_TABLE_NAME_ASC" | "RESOURCES_TABLE_NAME_DESC" | "RESOURCE_DEFINITIONS_TABLE_ID_ASC" | "RESOURCE_DEFINITIONS_TABLE_ID_DESC" | "RESOURCE_DEFINITIONS_TABLE_NAME_ASC" | "RESOURCE_DEFINITIONS_TABLE_NAME_DESC" | "RESOURCE_INSTALLATIONS_TABLE_ID_ASC" | "RESOURCE_INSTALLATIONS_TABLE_ID_DESC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_ASC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SITES_TABLE_ID_ASC" | "SITES_TABLE_ID_DESC" | "SITES_TABLE_NAME_ASC" | "SITES_TABLE_NAME_DESC"; -export type ComputeLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "COMPUTE_LOG_TABLE_ID_ASC" | "COMPUTE_LOG_TABLE_ID_DESC" | "COMPUTE_LOG_TABLE_NAME_ASC" | "COMPUTE_LOG_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type ConfigSecretsUserModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type ConnectedAccountsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type CryptoAddressesModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type CryptoAuthModuleOrderBy = "ADDRESSES_TABLE_ID_ASC" | "ADDRESSES_TABLE_ID_DESC" | "CRYPTO_NETWORK_ASC" | "CRYPTO_NETWORK_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SIGN_IN_RECORD_FAILURE_ASC" | "SIGN_IN_RECORD_FAILURE_DESC" | "SIGN_IN_REQUEST_CHALLENGE_ASC" | "SIGN_IN_REQUEST_CHALLENGE_DESC" | "SIGN_IN_WITH_CHALLENGE_ASC" | "SIGN_IN_WITH_CHALLENGE_DESC" | "SIGN_UP_WITH_KEY_ASC" | "SIGN_UP_WITH_KEY_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC" | "USER_FIELD_ASC" | "USER_FIELD_DESC"; -export type DatabaseProvisionModuleOrderBy = "ASYNC_ASC" | "ASYNC_DESC" | "BOOTSTRAP_ERROR_ASC" | "BOOTSTRAP_ERROR_DESC" | "BOOTSTRAP_STATUS_ASC" | "BOOTSTRAP_STATUS_DESC" | "BOOTSTRAP_USER_ASC" | "BOOTSTRAP_USER_DESC" | "COMPLETED_AT_ASC" | "COMPLETED_AT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATABASE_NAME_ASC" | "DATABASE_NAME_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "FULFILLED_AT_ASC" | "FULFILLED_AT_DESC" | "ID_ASC" | "ID_DESC" | "MODULES_ASC" | "MODULES_DESC" | "NATURAL" | "OPTIONS_ASC" | "OPTIONS_DESC" | "OWNER_ID_ASC" | "OWNER_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOURCE_DATABASE_ID_ASC" | "SOURCE_DATABASE_ID_DESC" | "STATUS_ASC" | "STATUS_DESC" | "SUBDOMAIN_ASC" | "SUBDOMAIN_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DatabaseSettingsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATABASE_SETTINGS_TABLE_ID_ASC" | "DATABASE_SETTINGS_TABLE_ID_DESC" | "DATABASE_SETTINGS_TABLE_NAME_ASC" | "DATABASE_SETTINGS_TABLE_NAME_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBKEY_SETTINGS_TABLE_ID_ASC" | "PUBKEY_SETTINGS_TABLE_ID_DESC" | "PUBKEY_SETTINGS_TABLE_NAME_ASC" | "PUBKEY_SETTINGS_TABLE_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RLS_SETTINGS_TABLE_ID_ASC" | "RLS_SETTINGS_TABLE_ID_DESC" | "RLS_SETTINGS_TABLE_NAME_ASC" | "RLS_SETTINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "WEBAUTHN_SETTINGS_TABLE_ID_ASC" | "WEBAUTHN_SETTINGS_TABLE_ID_DESC" | "WEBAUTHN_SETTINGS_TABLE_NAME_ASC" | "WEBAUTHN_SETTINGS_TABLE_NAME_DESC"; -export type DbPoolConfigOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DOMAIN_ASC" | "DOMAIN_DESC" | "ENABLED_ASC" | "ENABLED_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "MIN_ASC" | "MIN_DESC" | "NATURAL" | "POOL_OWNER_ID_ASC" | "POOL_OWNER_ID_DESC" | "PRESET_SLUG_ASC" | "PRESET_SLUG_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC" | "WARM_TTL_ASC" | "WARM_TTL_DESC"; -export type DbPoolOrderBy = "BOOTSTRAP_ERROR_ASC" | "BOOTSTRAP_ERROR_DESC" | "BOOTSTRAP_STATUS_ASC" | "BOOTSTRAP_STATUS_DESC" | "CLAIMED_AT_ASC" | "CLAIMED_AT_DESC" | "CLAIMED_BY_ASC" | "CLAIMED_BY_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ERROR_MESSAGE_ASC" | "ERROR_MESSAGE_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRESET_COMMIT_ID_ASC" | "PRESET_COMMIT_ID_DESC" | "PRESET_SLUG_ASC" | "PRESET_SLUG_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STATUS_ASC" | "STATUS_DESC" | "UPDATED_AT_ASC" | "UPDATED_AT_DESC"; -export type DbPresetModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DB_PRESETS_TABLE_ID_ASC" | "DB_PRESETS_TABLE_ID_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_ID_ASC" | "PUBLIC_SCHEMA_ID_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORE_NAME_ASC" | "STORE_NAME_DESC"; -export type DbUsageModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "COLLECT_DB_QUERY_STATS_FUNCTION_ASC" | "COLLECT_DB_QUERY_STATS_FUNCTION_DESC" | "COLLECT_DB_TABLE_STATS_FUNCTION_ASC" | "COLLECT_DB_TABLE_STATS_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "QUERY_STATS_LOG_TABLE_ID_ASC" | "QUERY_STATS_LOG_TABLE_ID_DESC" | "QUERY_STATS_LOG_TABLE_NAME_ASC" | "QUERY_STATS_LOG_TABLE_NAME_DESC" | "QUERY_STATS_SUMMARY_TABLE_ID_ASC" | "QUERY_STATS_SUMMARY_TABLE_ID_DESC" | "QUERY_STATS_SUMMARY_TABLE_NAME_ASC" | "QUERY_STATS_SUMMARY_TABLE_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_DESC" | "ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_STATS_LOG_TABLE_ID_ASC" | "TABLE_STATS_LOG_TABLE_ID_DESC" | "TABLE_STATS_LOG_TABLE_NAME_ASC" | "TABLE_STATS_LOG_TABLE_NAME_DESC" | "TABLE_STATS_SUMMARY_TABLE_ID_ASC" | "TABLE_STATS_SUMMARY_TABLE_ID_DESC" | "TABLE_STATS_SUMMARY_TABLE_NAME_ASC" | "TABLE_STATS_SUMMARY_TABLE_NAME_DESC"; -export type DefaultIdsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type DenormalizedTableFieldOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELD_ID_ASC" | "FIELD_ID_DESC" | "FUNC_NAME_ASC" | "FUNC_NAME_DESC" | "FUNC_ORDER_ASC" | "FUNC_ORDER_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REF_FIELD_ID_ASC" | "REF_FIELD_ID_DESC" | "REF_IDS_ASC" | "REF_IDS_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SET_IDS_ASC" | "SET_IDS_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "UPDATE_DEFAULTS_ASC" | "UPDATE_DEFAULTS_DESC" | "USE_UPDATES_ASC" | "USE_UPDATES_DESC"; -export type DevicesModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEVICE_SETTINGS_TABLE_ID_ASC" | "DEVICE_SETTINGS_TABLE_ID_DESC" | "DEVICE_SETTINGS_TABLE_NAME_ASC" | "DEVICE_SETTINGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "USER_DEVICES_TABLE_ID_ASC" | "USER_DEVICES_TABLE_ID_DESC" | "USER_DEVICES_TABLE_NAME_ASC" | "USER_DEVICES_TABLE_NAME_DESC"; -export type DomainModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAINS_TABLE_ID_ASC" | "DOMAINS_TABLE_ID_DESC" | "DOMAINS_TABLE_NAME_ASC" | "DOMAINS_TABLE_NAME_DESC" | "DOMAIN_EVENTS_TABLE_ID_ASC" | "DOMAIN_EVENTS_TABLE_ID_DESC" | "DOMAIN_EVENTS_TABLE_NAME_ASC" | "DOMAIN_EVENTS_TABLE_NAME_DESC" | "DOMAIN_VERIFICATIONS_TABLE_ID_ASC" | "DOMAIN_VERIFICATIONS_TABLE_ID_DESC" | "DOMAIN_VERIFICATIONS_TABLE_NAME_ASC" | "DOMAIN_VERIFICATIONS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MANAGED_DOMAINS_TABLE_ID_ASC" | "MANAGED_DOMAINS_TABLE_ID_DESC" | "MANAGED_DOMAINS_TABLE_NAME_ASC" | "MANAGED_DOMAINS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type EmailsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type EntityTypeProvisionOrderBy = "AGENTS_ASC" | "AGENTS_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DESCRIPTION_ASC" | "DESCRIPTION_DESC" | "FUNCTIONS_ASC" | "FUNCTIONS_DESC" | "GRAPHS_ASC" | "GRAPHS_DESC" | "HAS_INVITES_ASC" | "HAS_INVITES_DESC" | "HAS_INVITE_ACHIEVEMENTS_ASC" | "HAS_INVITE_ACHIEVEMENTS_DESC" | "HAS_LEVELS_ASC" | "HAS_LEVELS_DESC" | "HAS_LIMITS_ASC" | "HAS_LIMITS_DESC" | "HAS_PROFILES_ASC" | "HAS_PROFILES_DESC" | "ID_ASC" | "ID_DESC" | "IS_VISIBLE_ASC" | "IS_VISIBLE_DESC" | "NAMESPACES_ASC" | "NAMESPACES_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "OUT_AGENT_MODULE_ID_ASC" | "OUT_AGENT_MODULE_ID_DESC" | "OUT_BUCKETS_TABLE_ID_ASC" | "OUT_BUCKETS_TABLE_ID_DESC" | "OUT_DEFINITIONS_TABLE_ID_ASC" | "OUT_DEFINITIONS_TABLE_ID_DESC" | "OUT_ENTITY_TABLE_ID_ASC" | "OUT_ENTITY_TABLE_ID_DESC" | "OUT_ENTITY_TABLE_NAME_ASC" | "OUT_ENTITY_TABLE_NAME_DESC" | "OUT_EXECUTION_LOGS_TABLE_ID_ASC" | "OUT_EXECUTION_LOGS_TABLE_ID_DESC" | "OUT_FILES_TABLE_ID_ASC" | "OUT_FILES_TABLE_ID_DESC" | "OUT_FUNCTION_MODULE_ID_ASC" | "OUT_FUNCTION_MODULE_ID_DESC" | "OUT_GRAPHS_TABLE_ID_ASC" | "OUT_GRAPHS_TABLE_ID_DESC" | "OUT_GRAPH_MODULE_ID_ASC" | "OUT_GRAPH_MODULE_ID_DESC" | "OUT_INSTALLED_MODULES_ASC" | "OUT_INSTALLED_MODULES_DESC" | "OUT_INVITES_MODULE_ID_ASC" | "OUT_INVITES_MODULE_ID_DESC" | "OUT_INVOCATIONS_TABLE_ID_ASC" | "OUT_INVOCATIONS_TABLE_ID_DESC" | "OUT_MEMBERSHIP_TYPE_ASC" | "OUT_MEMBERSHIP_TYPE_DESC" | "OUT_NAMESPACES_TABLE_ID_ASC" | "OUT_NAMESPACES_TABLE_ID_DESC" | "OUT_NAMESPACE_EVENTS_TABLE_ID_ASC" | "OUT_NAMESPACE_EVENTS_TABLE_ID_DESC" | "OUT_NAMESPACE_MODULE_ID_ASC" | "OUT_NAMESPACE_MODULE_ID_DESC" | "OUT_PATH_SHARES_TABLE_ID_ASC" | "OUT_PATH_SHARES_TABLE_ID_DESC" | "OUT_STORAGE_MODULE_ID_ASC" | "OUT_STORAGE_MODULE_ID_DESC" | "PARENT_ENTITY_ASC" | "PARENT_ENTITY_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SKIP_ENTITY_POLICIES_ASC" | "SKIP_ENTITY_POLICIES_DESC" | "STORAGE_ASC" | "STORAGE_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "TABLE_PROVISION_ASC" | "TABLE_PROVISION_DESC"; -export type EventsModuleOrderBy = "ACHIEVEMENT_REWARDS_TABLE_ID_ASC" | "ACHIEVEMENT_REWARDS_TABLE_ID_DESC" | "ACHIEVEMENT_REWARDS_TABLE_NAME_ASC" | "ACHIEVEMENT_REWARDS_TABLE_NAME_DESC" | "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EVENTS_TABLE_ID_ASC" | "EVENTS_TABLE_ID_DESC" | "EVENTS_TABLE_NAME_ASC" | "EVENTS_TABLE_NAME_DESC" | "EVENT_AGGREGATES_TABLE_ID_ASC" | "EVENT_AGGREGATES_TABLE_ID_DESC" | "EVENT_AGGREGATES_TABLE_NAME_ASC" | "EVENT_AGGREGATES_TABLE_NAME_DESC" | "EVENT_TYPES_TABLE_ID_ASC" | "EVENT_TYPES_TABLE_ID_DESC" | "EVENT_TYPES_TABLE_NAME_ASC" | "EVENT_TYPES_TABLE_NAME_DESC" | "GRANT_ACHIEVEMENT_ASC" | "GRANT_ACHIEVEMENT_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "LEVELS_TABLE_ID_ASC" | "LEVELS_TABLE_ID_DESC" | "LEVELS_TABLE_NAME_ASC" | "LEVELS_TABLE_NAME_DESC" | "LEVEL_ACHIEVED_ASC" | "LEVEL_ACHIEVED_DESC" | "LEVEL_GRANTS_TABLE_ID_ASC" | "LEVEL_GRANTS_TABLE_ID_DESC" | "LEVEL_GRANTS_TABLE_NAME_ASC" | "LEVEL_GRANTS_TABLE_NAME_DESC" | "LEVEL_REQUIREMENTS_TABLE_ID_ASC" | "LEVEL_REQUIREMENTS_TABLE_ID_DESC" | "LEVEL_REQUIREMENTS_TABLE_NAME_ASC" | "LEVEL_REQUIREMENTS_TABLE_NAME_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RECORD_EVENT_ASC" | "RECORD_EVENT_DESC" | "REMOVE_EVENT_ASC" | "REMOVE_EVENT_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STEPS_REQUIRED_ASC" | "STEPS_REQUIRED_DESC" | "TG_ACHIEVEMENT_REWARD_ASC" | "TG_ACHIEVEMENT_REWARD_DESC" | "TG_CHECK_ACHIEVEMENTS_ASC" | "TG_CHECK_ACHIEVEMENTS_DESC" | "TG_EVENT_ASC" | "TG_EVENT_BOOL_ASC" | "TG_EVENT_BOOL_DESC" | "TG_EVENT_DESC" | "TG_EVENT_TOGGLE_ASC" | "TG_EVENT_TOGGLE_BOOL_ASC" | "TG_EVENT_TOGGLE_BOOL_DESC" | "TG_EVENT_TOGGLE_DESC" | "TG_UPDATE_AGGREGATES_ASC" | "TG_UPDATE_AGGREGATES_DESC" | "UPSERT_AGGREGATE_ASC" | "UPSERT_AGGREGATE_DESC"; -export type FunctionDeploymentModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DEPLOYMENTS_TABLE_ID_ASC" | "DEPLOYMENTS_TABLE_ID_DESC" | "DEPLOYMENTS_TABLE_NAME_ASC" | "DEPLOYMENTS_TABLE_NAME_DESC" | "DEPLOYMENT_EVENTS_TABLE_ID_ASC" | "DEPLOYMENT_EVENTS_TABLE_ID_DESC" | "DEPLOYMENT_EVENTS_TABLE_NAME_ASC" | "DEPLOYMENT_EVENTS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type FunctionInvocationModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "ATTEMPTS_TABLE_ID_ASC" | "ATTEMPTS_TABLE_ID_DESC" | "ATTEMPTS_TABLE_NAME_ASC" | "ATTEMPTS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EXECUTION_LOGS_TABLE_ID_ASC" | "EXECUTION_LOGS_TABLE_ID_DESC" | "EXECUTION_LOGS_TABLE_NAME_ASC" | "EXECUTION_LOGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "INVOCATIONS_TABLE_ID_ASC" | "INVOCATIONS_TABLE_ID_DESC" | "INVOCATIONS_TABLE_NAME_ASC" | "INVOCATIONS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type FunctionModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "BINDINGS_TABLE_ID_ASC" | "BINDINGS_TABLE_ID_DESC" | "BINDINGS_TABLE_NAME_ASC" | "BINDINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DEFINITIONS_TABLE_ID_ASC" | "DEFINITIONS_TABLE_ID_DESC" | "DEFINITIONS_TABLE_NAME_ASC" | "DEFINITIONS_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HAS_CRON_ASC" | "HAS_CRON_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEDULES_TABLE_ID_ASC" | "SCHEDULES_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type GraphExecutionModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EXECUTIONS_TABLE_ID_ASC" | "EXECUTIONS_TABLE_ID_DESC" | "EXECUTIONS_TABLE_NAME_ASC" | "EXECUTIONS_TABLE_NAME_DESC" | "GRAPH_MODULE_ID_ASC" | "GRAPH_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODE_STATES_TABLE_ID_ASC" | "NODE_STATES_TABLE_ID_DESC" | "NODE_STATES_TABLE_NAME_ASC" | "NODE_STATES_TABLE_NAME_DESC" | "OUTPUTS_TABLE_ID_ASC" | "OUTPUTS_TABLE_ID_DESC" | "OUTPUTS_TABLE_NAME_ASC" | "OUTPUTS_TABLE_NAME_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type GraphModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GRAPHS_TABLE_ID_ASC" | "GRAPHS_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_ID_ASC" | "PUBLIC_SCHEMA_ID_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type HierarchyModuleOrderBy = "CHART_EDGES_TABLE_ID_ASC" | "CHART_EDGES_TABLE_ID_DESC" | "CHART_EDGES_TABLE_NAME_ASC" | "CHART_EDGES_TABLE_NAME_DESC" | "CHART_EDGE_GRANTS_TABLE_ID_ASC" | "CHART_EDGE_GRANTS_TABLE_ID_DESC" | "CHART_EDGE_GRANTS_TABLE_NAME_ASC" | "CHART_EDGE_GRANTS_TABLE_NAME_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GET_MANAGERS_FUNCTION_ASC" | "GET_MANAGERS_FUNCTION_DESC" | "GET_SUBORDINATES_FUNCTION_ASC" | "GET_SUBORDINATES_FUNCTION_DESC" | "HIERARCHY_SPRT_TABLE_ID_ASC" | "HIERARCHY_SPRT_TABLE_ID_DESC" | "HIERARCHY_SPRT_TABLE_NAME_ASC" | "HIERARCHY_SPRT_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "IS_MANAGER_OF_FUNCTION_ASC" | "IS_MANAGER_OF_FUNCTION_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "REBUILD_HIERARCHY_FUNCTION_ASC" | "REBUILD_HIERARCHY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SPRT_TABLE_NAME_ASC" | "SPRT_TABLE_NAME_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type HttpRouteModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "HTTP_ROUTES_TABLE_ID_ASC" | "HTTP_ROUTES_TABLE_ID_DESC" | "HTTP_ROUTES_TABLE_NAME_ASC" | "HTTP_ROUTES_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVER_FUNCTION_NAME_ASC" | "RESOLVER_FUNCTION_NAME_DESC" | "RESOURCE_MODULE_ID_ASC" | "RESOURCE_MODULE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORAGE_MODULE_ID_ASC" | "STORAGE_MODULE_ID_DESC"; -export type I18NModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SETTINGS_TABLE_ID_ASC" | "SETTINGS_TABLE_ID_DESC"; -export type IdentityProvidersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type InferenceLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INFERENCE_LOG_TABLE_ID_ASC" | "INFERENCE_LOG_TABLE_ID_DESC" | "INFERENCE_LOG_TABLE_NAME_ASC" | "INFERENCE_LOG_TABLE_NAME_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type InfraConfigModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CONFIG_TABLE_ID_ASC" | "CONFIG_TABLE_ID_DESC" | "CONFIG_TABLE_NAME_ASC" | "CONFIG_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type InfraSecretsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SECRETS_TABLE_NAME_ASC" | "SECRETS_TABLE_NAME_DESC"; -export type IntegrationProvidersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type InternalSecretsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERNAL_SECRETS_TABLE_ID_ASC" | "INTERNAL_SECRETS_TABLE_ID_DESC" | "INTERNAL_SECRETS_TABLE_NAME_ASC" | "INTERNAL_SECRETS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type InvitesModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CLAIMED_INVITES_TABLE_ID_ASC" | "CLAIMED_INVITES_TABLE_ID_DESC" | "CLAIMED_INVITES_TABLE_NAME_ASC" | "CLAIMED_INVITES_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "EMAILS_TABLE_ID_ASC" | "EMAILS_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INVITES_TABLE_ID_ASC" | "INVITES_TABLE_ID_DESC" | "INVITES_TABLE_NAME_ASC" | "INVITES_TABLE_NAME_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SUBMIT_INVITE_CODE_FUNCTION_ASC" | "SUBMIT_INVITE_CODE_FUNCTION_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type LimitsModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "AGGREGATE_TABLE_ID_ASC" | "AGGREGATE_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "CAP_CHECK_TRIGGER_ASC" | "CAP_CHECK_TRIGGER_DESC" | "CREDIT_CODES_TABLE_ID_ASC" | "CREDIT_CODES_TABLE_ID_DESC" | "CREDIT_CODE_ITEMS_TABLE_ID_ASC" | "CREDIT_CODE_ITEMS_TABLE_ID_DESC" | "CREDIT_REDEMPTIONS_TABLE_ID_ASC" | "CREDIT_REDEMPTIONS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_TABLE_ID_ASC" | "DEFAULT_TABLE_ID_DESC" | "DEFAULT_TABLE_NAME_ASC" | "DEFAULT_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "EVENTS_TABLE_ID_ASC" | "EVENTS_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_ASC" | "LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_DESC" | "LIMIT_CAPS_DEFAULTS_TABLE_ID_ASC" | "LIMIT_CAPS_DEFAULTS_TABLE_ID_DESC" | "LIMIT_CAPS_TABLE_ID_ASC" | "LIMIT_CAPS_TABLE_ID_DESC" | "LIMIT_CHECK_FUNCTION_ASC" | "LIMIT_CHECK_FUNCTION_DESC" | "LIMIT_CHECK_SOFT_FUNCTION_ASC" | "LIMIT_CHECK_SOFT_FUNCTION_DESC" | "LIMIT_CREDITS_TABLE_ID_ASC" | "LIMIT_CREDITS_TABLE_ID_DESC" | "LIMIT_DECREMENT_FUNCTION_ASC" | "LIMIT_DECREMENT_FUNCTION_DESC" | "LIMIT_DECREMENT_TRIGGER_ASC" | "LIMIT_DECREMENT_TRIGGER_DESC" | "LIMIT_INCREMENT_FUNCTION_ASC" | "LIMIT_INCREMENT_FUNCTION_DESC" | "LIMIT_INCREMENT_TRIGGER_ASC" | "LIMIT_INCREMENT_TRIGGER_DESC" | "LIMIT_UPDATE_TRIGGER_ASC" | "LIMIT_UPDATE_TRIGGER_DESC" | "LIMIT_WARNINGS_TABLE_ID_ASC" | "LIMIT_WARNINGS_TABLE_ID_DESC" | "LIMIT_WARNING_STATE_TABLE_ID_ASC" | "LIMIT_WARNING_STATE_TABLE_ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVE_CAP_FUNCTION_ASC" | "RESOLVE_CAP_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type MembershipTypesModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type MembershipsModuleOrderBy = "ACTOR_MASK_CHECK_ASC" | "ACTOR_MASK_CHECK_DESC" | "ACTOR_PERM_CHECK_ASC" | "ACTOR_PERM_CHECK_DESC" | "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "ADMIN_GRANTS_TABLE_ID_ASC" | "ADMIN_GRANTS_TABLE_ID_DESC" | "ADMIN_GRANTS_TABLE_NAME_ASC" | "ADMIN_GRANTS_TABLE_NAME_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_LIMITS_TABLE_ID_ASC" | "DEFAULT_LIMITS_TABLE_ID_DESC" | "DEFAULT_PERMISSIONS_TABLE_ID_ASC" | "DEFAULT_PERMISSIONS_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_IDS_BY_MASK_ASC" | "ENTITY_IDS_BY_MASK_DESC" | "ENTITY_IDS_BY_PERM_ASC" | "ENTITY_IDS_BY_PERM_DESC" | "ENTITY_IDS_FUNCTION_ASC" | "ENTITY_IDS_FUNCTION_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ENTITY_TABLE_OWNER_ID_ASC" | "ENTITY_TABLE_OWNER_ID_DESC" | "GET_ORG_FN_ASC" | "GET_ORG_FN_DESC" | "GRANTS_TABLE_ID_ASC" | "GRANTS_TABLE_ID_DESC" | "GRANTS_TABLE_NAME_ASC" | "GRANTS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "LIMITS_TABLE_ID_ASC" | "LIMITS_TABLE_ID_DESC" | "MEMBERSHIPS_TABLE_ID_ASC" | "MEMBERSHIPS_TABLE_ID_DESC" | "MEMBERSHIPS_TABLE_NAME_ASC" | "MEMBERSHIPS_TABLE_NAME_DESC" | "MEMBERSHIP_DEFAULTS_TABLE_ID_ASC" | "MEMBERSHIP_DEFAULTS_TABLE_ID_DESC" | "MEMBERSHIP_DEFAULTS_TABLE_NAME_ASC" | "MEMBERSHIP_DEFAULTS_TABLE_NAME_DESC" | "MEMBERSHIP_SETTINGS_TABLE_ID_ASC" | "MEMBERSHIP_SETTINGS_TABLE_ID_DESC" | "MEMBERSHIP_SETTINGS_TABLE_NAME_ASC" | "MEMBERSHIP_SETTINGS_TABLE_NAME_DESC" | "MEMBERS_TABLE_ID_ASC" | "MEMBERS_TABLE_ID_DESC" | "MEMBERS_TABLE_NAME_ASC" | "MEMBERS_TABLE_NAME_DESC" | "MEMBER_PROFILES_TABLE_ID_ASC" | "MEMBER_PROFILES_TABLE_ID_DESC" | "NATURAL" | "OWNER_GRANTS_TABLE_ID_ASC" | "OWNER_GRANTS_TABLE_ID_DESC" | "OWNER_GRANTS_TABLE_NAME_ASC" | "OWNER_GRANTS_TABLE_NAME_DESC" | "PERMISSIONS_TABLE_ID_ASC" | "PERMISSIONS_TABLE_ID_DESC" | "PERMISSION_DEFAULT_GRANTS_TABLE_ID_ASC" | "PERMISSION_DEFAULT_GRANTS_TABLE_ID_DESC" | "PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_ASC" | "PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SPRT_TABLE_ID_ASC" | "SPRT_TABLE_ID_DESC"; -export type MerkleStoreModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "COMMIT_TABLE_ID_ASC" | "COMMIT_TABLE_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "FUNCTION_PREFIX_ASC" | "FUNCTION_PREFIX_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OBJECT_TABLE_ID_ASC" | "OBJECT_TABLE_ID_DESC" | "PERMISSION_KEY_ASC" | "PERMISSION_KEY_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "REF_TABLE_ID_ASC" | "REF_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORE_TABLE_ID_ASC" | "STORE_TABLE_ID_DESC"; -export type NamespaceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAMESPACES_TABLE_ID_ASC" | "NAMESPACES_TABLE_ID_DESC" | "NAMESPACES_TABLE_NAME_ASC" | "NAMESPACES_TABLE_NAME_DESC" | "NAMESPACE_EVENTS_TABLE_ID_ASC" | "NAMESPACE_EVENTS_TABLE_ID_DESC" | "NAMESPACE_EVENTS_TABLE_NAME_ASC" | "NAMESPACE_EVENTS_TABLE_NAME_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type NotificationsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHANNELS_TABLE_ID_ASC" | "CHANNELS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DELIVERY_LOG_TABLE_ID_ASC" | "DELIVERY_LOG_TABLE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "HAS_CHANNELS_ASC" | "HAS_CHANNELS_DESC" | "HAS_DIGEST_METADATA_ASC" | "HAS_DIGEST_METADATA_DESC" | "HAS_PREFERENCES_ASC" | "HAS_PREFERENCES_DESC" | "HAS_SETTINGS_EXTENSION_ASC" | "HAS_SETTINGS_EXTENSION_DESC" | "HAS_SUBSCRIPTIONS_ASC" | "HAS_SUBSCRIPTIONS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NOTIFICATIONS_TABLE_ID_ASC" | "NOTIFICATIONS_TABLE_ID_DESC" | "ORGANIZATION_SETTINGS_TABLE_ID_ASC" | "ORGANIZATION_SETTINGS_TABLE_ID_DESC" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PREFERENCES_TABLE_ID_ASC" | "PREFERENCES_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "READ_STATE_TABLE_ID_ASC" | "READ_STATE_TABLE_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SUPPRESSIONS_TABLE_ID_ASC" | "SUPPRESSIONS_TABLE_ID_DESC" | "USER_SETTINGS_TABLE_ID_ASC" | "USER_SETTINGS_TABLE_ID_DESC"; -export type PermissionsModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "BITLEN_ASC" | "BITLEN_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_TABLE_ID_ASC" | "DEFAULT_TABLE_ID_DESC" | "DEFAULT_TABLE_NAME_ASC" | "DEFAULT_TABLE_NAME_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "GET_BY_MASK_ASC" | "GET_BY_MASK_DESC" | "GET_MASK_ASC" | "GET_MASK_BY_NAME_ASC" | "GET_MASK_BY_NAME_DESC" | "GET_MASK_DESC" | "GET_PADDED_MASK_ASC" | "GET_PADDED_MASK_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type PhoneNumbersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type PlansModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "APPLY_BILLING_PLAN_FUNCTION_ASC" | "APPLY_BILLING_PLAN_FUNCTION_DESC" | "APPLY_PLAN_AGGREGATE_FUNCTION_ASC" | "APPLY_PLAN_AGGREGATE_FUNCTION_DESC" | "APPLY_PLAN_CAPS_FUNCTION_ASC" | "APPLY_PLAN_CAPS_FUNCTION_DESC" | "APPLY_PLAN_FUNCTION_ASC" | "APPLY_PLAN_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PLANS_TABLE_ID_ASC" | "PLANS_TABLE_ID_DESC" | "PLANS_TABLE_NAME_ASC" | "PLANS_TABLE_NAME_DESC" | "PLAN_CAPS_TABLE_ID_ASC" | "PLAN_CAPS_TABLE_ID_DESC" | "PLAN_LIMITS_TABLE_ID_ASC" | "PLAN_LIMITS_TABLE_ID_DESC" | "PLAN_LIMITS_TABLE_NAME_ASC" | "PLAN_LIMITS_TABLE_NAME_DESC" | "PLAN_METER_LIMITS_TABLE_ID_ASC" | "PLAN_METER_LIMITS_TABLE_ID_DESC" | "PLAN_OVERRIDES_TABLE_ID_ASC" | "PLAN_OVERRIDES_TABLE_ID_DESC" | "PLAN_PRICING_TABLE_ID_ASC" | "PLAN_PRICING_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type PrincipalAuthModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUDITS_TABLE_ID_ASC" | "AUDITS_TABLE_ID_DESC" | "CREATE_ORG_API_KEY_FUNCTION_ASC" | "CREATE_ORG_API_KEY_FUNCTION_DESC" | "CREATE_ORG_PRINCIPAL_FUNCTION_ASC" | "CREATE_ORG_PRINCIPAL_FUNCTION_DESC" | "CREATE_PRINCIPAL_FUNCTION_ASC" | "CREATE_PRINCIPAL_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ORG_PRINCIPAL_FUNCTION_ASC" | "DELETE_ORG_PRINCIPAL_FUNCTION_DESC" | "DELETE_PRINCIPAL_FUNCTION_ASC" | "DELETE_PRINCIPAL_FUNCTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRINCIPALS_TABLE_ID_ASC" | "PRINCIPALS_TABLE_ID_DESC" | "PRINCIPALS_TABLE_NAME_ASC" | "PRINCIPALS_TABLE_NAME_DESC" | "PRINCIPAL_ENTITIES_TABLE_ID_ASC" | "PRINCIPAL_ENTITIES_TABLE_ID_DESC" | "PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC" | "PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC" | "REVOKE_ORG_API_KEY_FUNCTION_ASC" | "REVOKE_ORG_API_KEY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type ProfilesModuleOrderBy = "ACTOR_TABLE_ID_ASC" | "ACTOR_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "MEMBERSHIPS_TABLE_ID_ASC" | "MEMBERSHIPS_TABLE_ID_DESC" | "NATURAL" | "PERMISSIONS_TABLE_ID_ASC" | "PERMISSIONS_TABLE_ID_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROFILE_DEFINITION_GRANTS_TABLE_ID_ASC" | "PROFILE_DEFINITION_GRANTS_TABLE_ID_DESC" | "PROFILE_DEFINITION_GRANTS_TABLE_NAME_ASC" | "PROFILE_DEFINITION_GRANTS_TABLE_NAME_DESC" | "PROFILE_GRANTS_TABLE_ID_ASC" | "PROFILE_GRANTS_TABLE_ID_DESC" | "PROFILE_GRANTS_TABLE_NAME_ASC" | "PROFILE_GRANTS_TABLE_NAME_DESC" | "PROFILE_PERMISSIONS_TABLE_ID_ASC" | "PROFILE_PERMISSIONS_TABLE_ID_DESC" | "PROFILE_PERMISSIONS_TABLE_NAME_ASC" | "PROFILE_PERMISSIONS_TABLE_NAME_DESC" | "PROFILE_TEMPLATES_TABLE_ID_ASC" | "PROFILE_TEMPLATES_TABLE_ID_DESC" | "PROFILE_TEMPLATES_TABLE_NAME_ASC" | "PROFILE_TEMPLATES_TABLE_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type RateLimitMetersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHECK_RATE_LIMIT_FUNCTION_ASC" | "CHECK_RATE_LIMIT_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RATE_LIMIT_OVERRIDES_TABLE_ID_ASC" | "RATE_LIMIT_OVERRIDES_TABLE_ID_DESC" | "RATE_LIMIT_OVERRIDES_TABLE_NAME_ASC" | "RATE_LIMIT_OVERRIDES_TABLE_NAME_DESC" | "RATE_LIMIT_STATE_TABLE_ID_ASC" | "RATE_LIMIT_STATE_TABLE_ID_DESC" | "RATE_LIMIT_STATE_TABLE_NAME_ASC" | "RATE_LIMIT_STATE_TABLE_NAME_DESC" | "RATE_WINDOW_LIMITS_TABLE_ID_ASC" | "RATE_WINDOW_LIMITS_TABLE_ID_DESC" | "RATE_WINDOW_LIMITS_TABLE_NAME_ASC" | "RATE_WINDOW_LIMITS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type RateLimitsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "IP_RATE_LIMITS_TABLE_ID_ASC" | "IP_RATE_LIMITS_TABLE_ID_DESC" | "IP_RATE_LIMITS_TABLE_NAME_ASC" | "IP_RATE_LIMITS_TABLE_NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RATE_LIMITS_TABLE_ID_ASC" | "RATE_LIMITS_TABLE_ID_DESC" | "RATE_LIMITS_TABLE_NAME_ASC" | "RATE_LIMITS_TABLE_NAME_DESC" | "RATE_LIMIT_SETTINGS_TABLE_ID_ASC" | "RATE_LIMIT_SETTINGS_TABLE_ID_DESC" | "RATE_LIMIT_SETTINGS_TABLE_NAME_ASC" | "RATE_LIMIT_SETTINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC"; -export type RealtimeModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CHANGE_LOG_TABLE_ID_ASC" | "CHANGE_LOG_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "LISTENER_NODE_TABLE_ID_ASC" | "LISTENER_NODE_TABLE_ID_DESC" | "NATURAL" | "NOTIFY_CHANNEL_ASC" | "NOTIFY_CHANNEL_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "RETENTION_HOURS_ASC" | "RETENTION_HOURS_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SOURCE_REGISTRY_TABLE_ID_ASC" | "SOURCE_REGISTRY_TABLE_ID_DESC" | "SUBSCRIPTIONS_SCHEMA_ID_ASC" | "SUBSCRIPTIONS_SCHEMA_ID_DESC"; -export type RelationProvisionOrderBy = "API_REQUIRED_ASC" | "API_REQUIRED_DESC" | "CREATE_INDEX_ASC" | "CREATE_INDEX_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACTION_ASC" | "DELETE_ACTION_DESC" | "EXPOSE_IN_API_ASC" | "EXPOSE_IN_API_DESC" | "FIELD_NAME_ASC" | "FIELD_NAME_DESC" | "GRANTS_ASC" | "GRANTS_DESC" | "ID_ASC" | "ID_DESC" | "IS_REQUIRED_ASC" | "IS_REQUIRED_DESC" | "JUNCTION_SCHEMA_ID_ASC" | "JUNCTION_SCHEMA_ID_DESC" | "JUNCTION_TABLE_ID_ASC" | "JUNCTION_TABLE_ID_DESC" | "JUNCTION_TABLE_NAME_ASC" | "JUNCTION_TABLE_NAME_DESC" | "NATURAL" | "NODES_ASC" | "NODES_DESC" | "OUT_FIELD_ID_ASC" | "OUT_FIELD_ID_DESC" | "OUT_JUNCTION_TABLE_ID_ASC" | "OUT_JUNCTION_TABLE_ID_DESC" | "OUT_SOURCE_FIELD_ID_ASC" | "OUT_SOURCE_FIELD_ID_DESC" | "OUT_TARGET_FIELD_ID_ASC" | "OUT_TARGET_FIELD_ID_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "RELATION_TYPE_ASC" | "RELATION_TYPE_DESC" | "SOURCE_FIELD_NAME_ASC" | "SOURCE_FIELD_NAME_DESC" | "SOURCE_TABLE_ID_ASC" | "SOURCE_TABLE_ID_DESC" | "TARGET_FIELD_NAME_ASC" | "TARGET_FIELD_NAME_DESC" | "TARGET_TABLE_ID_ASC" | "TARGET_TABLE_ID_DESC" | "USE_COMPOSITE_KEY_ASC" | "USE_COMPOSITE_KEY_DESC"; -export type ResourceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INSTALLATION_STORE_NAME_ASC" | "INSTALLATION_STORE_NAME_DESC" | "MERKLE_STORE_MODULE_ID_ASC" | "MERKLE_STORE_MODULE_ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "REQUIREMENTS_STATE_VIEW_NAME_ASC" | "REQUIREMENTS_STATE_VIEW_NAME_DESC" | "RESOLVED_REQUIREMENTS_VIEW_NAME_ASC" | "RESOLVED_REQUIREMENTS_VIEW_NAME_DESC" | "RESOURCES_TABLE_ID_ASC" | "RESOURCES_TABLE_ID_DESC" | "RESOURCES_TABLE_NAME_ASC" | "RESOURCES_TABLE_NAME_DESC" | "RESOURCE_BILLING_ROLLUP_FUNCTION_ASC" | "RESOURCE_BILLING_ROLLUP_FUNCTION_DESC" | "RESOURCE_DEFINITIONS_TABLE_ID_ASC" | "RESOURCE_DEFINITIONS_TABLE_ID_DESC" | "RESOURCE_DEFINITIONS_TABLE_NAME_ASC" | "RESOURCE_DEFINITIONS_TABLE_NAME_DESC" | "RESOURCE_EVENTS_TABLE_ID_ASC" | "RESOURCE_EVENTS_TABLE_ID_DESC" | "RESOURCE_EVENTS_TABLE_NAME_ASC" | "RESOURCE_EVENTS_TABLE_NAME_DESC" | "RESOURCE_INSTALLATIONS_TABLE_ID_ASC" | "RESOURCE_INSTALLATIONS_TABLE_ID_DESC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_ASC" | "RESOURCE_INSTALLATIONS_TABLE_NAME_DESC" | "RESOURCE_STATUS_CHECKS_TABLE_ID_ASC" | "RESOURCE_STATUS_CHECKS_TABLE_ID_DESC" | "RESOURCE_STATUS_CHECKS_TABLE_NAME_ASC" | "RESOURCE_STATUS_CHECKS_TABLE_NAME_DESC" | "RESOURCE_USAGE_LOG_TABLE_ID_ASC" | "RESOURCE_USAGE_LOG_TABLE_ID_DESC" | "RESOURCE_USAGE_LOG_TABLE_NAME_ASC" | "RESOURCE_USAGE_LOG_TABLE_NAME_DESC" | "RESOURCE_USAGE_SUMMARY_TABLE_ID_ASC" | "RESOURCE_USAGE_SUMMARY_TABLE_ID_DESC" | "RESOURCE_USAGE_SUMMARY_TABLE_NAME_ASC" | "RESOURCE_USAGE_SUMMARY_TABLE_NAME_DESC" | "ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_ASC" | "ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type RlsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUTHENTICATE_ASC" | "AUTHENTICATE_DESC" | "AUTHENTICATE_STRICT_ASC" | "AUTHENTICATE_STRICT_DESC" | "CURRENT_ROLE_ASC" | "CURRENT_ROLE_DESC" | "CURRENT_ROLE_ID_ASC" | "CURRENT_ROLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type RouteModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOMAIN_MODULE_ID_ASC" | "DOMAIN_MODULE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "HOSTNAME_BINDINGS_TABLE_ID_ASC" | "HOSTNAME_BINDINGS_TABLE_ID_DESC" | "HOSTNAME_BINDINGS_TABLE_NAME_ASC" | "HOSTNAME_BINDINGS_TABLE_NAME_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RESOLVER_FUNCTION_NAME_ASC" | "RESOLVER_FUNCTION_NAME_DESC" | "ROUTES_TABLE_ID_ASC" | "ROUTES_TABLE_ID_DESC" | "ROUTES_TABLE_NAME_ASC" | "ROUTES_TABLE_NAME_DESC" | "ROUTE_BINDINGS_TABLE_ID_ASC" | "ROUTE_BINDINGS_TABLE_ID_DESC" | "ROUTE_BINDINGS_TABLE_NAME_ASC" | "ROUTE_BINDINGS_TABLE_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC"; -export type SecureTableProvisionOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "FIELDS_ASC" | "FIELDS_DESC" | "GRANTS_ASC" | "GRANTS_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "NODES_ASC" | "NODES_DESC" | "OUT_FIELDS_ASC" | "OUT_FIELDS_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "USE_RLS_ASC" | "USE_RLS_DESC"; -export type SessionSecretsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type SessionsModuleOrderBy = "AUTH_SETTINGS_TABLE_ID_ASC" | "AUTH_SETTINGS_TABLE_ID_DESC" | "AUTH_SETTINGS_TABLE_NAME_ASC" | "AUTH_SETTINGS_TABLE_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_DEFAULT_EXPIRATION_ASC" | "SESSIONS_DEFAULT_EXPIRATION_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSIONS_TABLE_NAME_ASC" | "SESSIONS_TABLE_NAME_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_NAME_ASC" | "SESSION_CREDENTIALS_TABLE_NAME_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type SiteSurfaceModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "CATALOG_MODULE_ID_ASC" | "CATALOG_MODULE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "SITES_TABLE_ID_ASC" | "SITES_TABLE_ID_DESC" | "SITES_TABLE_NAME_ASC" | "SITES_TABLE_NAME_DESC" | "SITE_METADATA_TABLE_ID_ASC" | "SITE_METADATA_TABLE_ID_DESC" | "SITE_METADATA_TABLE_NAME_ASC" | "SITE_METADATA_TABLE_NAME_DESC" | "SITE_MODULES_TABLE_ID_ASC" | "SITE_MODULES_TABLE_ID_DESC" | "SITE_MODULES_TABLE_NAME_ASC" | "SITE_MODULES_TABLE_NAME_DESC" | "SITE_THEMES_TABLE_ID_ASC" | "SITE_THEMES_TABLE_ID_DESC" | "SITE_THEMES_TABLE_NAME_ASC" | "SITE_THEMES_TABLE_NAME_DESC"; -export type StorageLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "STORAGE_LOG_TABLE_ID_ASC" | "STORAGE_LOG_TABLE_ID_DESC" | "STORAGE_LOG_TABLE_NAME_ASC" | "STORAGE_LOG_TABLE_NAME_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type StorageModuleOrderBy = "ALLOWED_ORIGINS_ASC" | "ALLOWED_ORIGINS_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "BUCKETS_TABLE_ID_ASC" | "BUCKETS_TABLE_ID_DESC" | "BUCKETS_TABLE_NAME_ASC" | "BUCKETS_TABLE_NAME_DESC" | "CACHE_TTL_SECONDS_ASC" | "CACHE_TTL_SECONDS_DESC" | "CONFIRM_UPLOAD_DELAY_ASC" | "CONFIRM_UPLOAD_DELAY_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_MAX_FILE_SIZE_ASC" | "DEFAULT_MAX_FILE_SIZE_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "DOWNLOAD_URL_EXPIRY_SECONDS_ASC" | "DOWNLOAD_URL_EXPIRY_SECONDS_DESC" | "ENDPOINT_ASC" | "ENDPOINT_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FILES_TABLE_ID_ASC" | "FILES_TABLE_ID_DESC" | "FILES_TABLE_NAME_ASC" | "FILES_TABLE_NAME_DESC" | "FILE_EVENTS_TABLE_ID_ASC" | "FILE_EVENTS_TABLE_ID_DESC" | "HAS_AUDIT_LOG_ASC" | "HAS_AUDIT_LOG_DESC" | "HAS_CONFIRM_UPLOAD_ASC" | "HAS_CONFIRM_UPLOAD_DESC" | "HAS_CONTENT_HASH_ASC" | "HAS_CONTENT_HASH_DESC" | "HAS_CUSTOM_KEYS_ASC" | "HAS_CUSTOM_KEYS_DESC" | "HAS_PATH_SHARES_ASC" | "HAS_PATH_SHARES_DESC" | "HAS_VERSIONING_ASC" | "HAS_VERSIONING_DESC" | "ID_ASC" | "ID_DESC" | "MAX_BULK_FILES_ASC" | "MAX_BULK_FILES_DESC" | "MAX_BULK_TOTAL_SIZE_ASC" | "MAX_BULK_TOTAL_SIZE_DESC" | "MAX_FILENAME_LENGTH_ASC" | "MAX_FILENAME_LENGTH_DESC" | "NATURAL" | "PATH_SHARES_TABLE_ID_ASC" | "PATH_SHARES_TABLE_ID_DESC" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVIDER_ASC" | "PROVIDER_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "PUBLIC_URL_PREFIX_ASC" | "PUBLIC_URL_PREFIX_DESC" | "RESTRICT_READS_ASC" | "RESTRICT_READS_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "UPLOAD_URL_EXPIRY_SECONDS_ASC" | "UPLOAD_URL_EXPIRY_SECONDS_DESC"; -export type TransferLogModuleOrderBy = "ACTOR_FK_TABLE_ID_ASC" | "ACTOR_FK_TABLE_ID_DESC" | "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_FK_TABLE_ID_ASC" | "ENTITY_FK_TABLE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INTERVAL_ASC" | "INTERVAL_DESC" | "NATURAL" | "PREFIX_ASC" | "PREFIX_DESC" | "PREMAKE_ASC" | "PREMAKE_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "RETENTION_ASC" | "RETENTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "TRANSFER_LOG_TABLE_ID_ASC" | "TRANSFER_LOG_TABLE_ID_DESC" | "TRANSFER_LOG_TABLE_NAME_ASC" | "TRANSFER_LOG_TABLE_NAME_DESC" | "USAGE_SUMMARY_TABLE_ID_ASC" | "USAGE_SUMMARY_TABLE_ID_DESC" | "USAGE_SUMMARY_TABLE_NAME_ASC" | "USAGE_SUMMARY_TABLE_NAME_DESC"; -export type UserAuthModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "AUDITS_TABLE_ID_ASC" | "AUDITS_TABLE_ID_DESC" | "AUDITS_TABLE_NAME_ASC" | "AUDITS_TABLE_NAME_DESC" | "CHECK_PASSWORD_FUNCTION_ASC" | "CHECK_PASSWORD_FUNCTION_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DELETE_ACCOUNT_FUNCTION_ASC" | "DELETE_ACCOUNT_FUNCTION_DESC" | "EMAILS_TABLE_ID_ASC" | "EMAILS_TABLE_ID_DESC" | "ENCRYPTED_TABLE_ID_ASC" | "ENCRYPTED_TABLE_ID_DESC" | "EXTEND_TOKEN_EXPIRES_ASC" | "EXTEND_TOKEN_EXPIRES_DESC" | "FORGOT_PASSWORD_FUNCTION_ASC" | "FORGOT_PASSWORD_FUNCTION_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_ASC" | "REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_DESC" | "RESET_PASSWORD_FUNCTION_ASC" | "RESET_PASSWORD_FUNCTION_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SECRETS_TABLE_ID_ASC" | "SECRETS_TABLE_ID_DESC" | "SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_ASC" | "SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_DESC" | "SEND_VERIFICATION_EMAIL_FUNCTION_ASC" | "SEND_VERIFICATION_EMAIL_FUNCTION_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SET_PASSWORD_FUNCTION_ASC" | "SET_PASSWORD_FUNCTION_DESC" | "SIGN_IN_CROSS_ORIGIN_FUNCTION_ASC" | "SIGN_IN_CROSS_ORIGIN_FUNCTION_DESC" | "SIGN_IN_FUNCTION_ASC" | "SIGN_IN_FUNCTION_DESC" | "SIGN_OUT_FUNCTION_ASC" | "SIGN_OUT_FUNCTION_DESC" | "SIGN_UP_FUNCTION_ASC" | "SIGN_UP_FUNCTION_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC" | "VERIFY_EMAIL_FUNCTION_ASC" | "VERIFY_EMAIL_FUNCTION_DESC" | "VERIFY_PASSWORD_FUNCTION_ASC" | "VERIFY_PASSWORD_FUNCTION_DESC"; -export type UserCredentialsModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UserSettingsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UserStateModuleOrderBy = "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type UsersModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC" | "TYPE_TABLE_ID_ASC" | "TYPE_TABLE_ID_DESC" | "TYPE_TABLE_NAME_ASC" | "TYPE_TABLE_NAME_DESC"; -export type WebauthnAuthModuleOrderBy = "ATTESTATION_TYPE_ASC" | "ATTESTATION_TYPE_DESC" | "AUTH_SETTINGS_TABLE_ID_ASC" | "AUTH_SETTINGS_TABLE_ID_DESC" | "CHALLENGE_EXPIRY_ASC" | "CHALLENGE_EXPIRY_DESC" | "CREDENTIALS_TABLE_ID_ASC" | "CREDENTIALS_TABLE_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORIGIN_ALLOWLIST_ASC" | "ORIGIN_ALLOWLIST_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REQUIRE_USER_VERIFICATION_ASC" | "REQUIRE_USER_VERIFICATION_DESC" | "RESIDENT_KEY_ASC" | "RESIDENT_KEY_DESC" | "RP_ID_ASC" | "RP_ID_DESC" | "RP_NAME_ASC" | "RP_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SESSIONS_TABLE_ID_ASC" | "SESSIONS_TABLE_ID_DESC" | "SESSION_CREDENTIALS_TABLE_ID_ASC" | "SESSION_CREDENTIALS_TABLE_ID_DESC" | "SESSION_SECRETS_TABLE_ID_ASC" | "SESSION_SECRETS_TABLE_ID_DESC" | "USERS_TABLE_ID_ASC" | "USERS_TABLE_ID_DESC"; -export type WebauthnCredentialsModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "OWNER_TABLE_ID_ASC" | "OWNER_TABLE_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "TABLE_ID_ASC" | "TABLE_ID_DESC" | "TABLE_NAME_ASC" | "TABLE_NAME_DESC"; -export type WebhookModuleOrderBy = "API_NAME_ASC" | "API_NAME_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEFAULT_PERMISSIONS_ASC" | "DEFAULT_PERMISSIONS_DESC" | "ENTITY_FIELD_ASC" | "ENTITY_FIELD_DESC" | "ENTITY_TABLE_ID_ASC" | "ENTITY_TABLE_ID_DESC" | "FUNCTION_INVOCATION_MODULE_ID_ASC" | "FUNCTION_INVOCATION_MODULE_ID_DESC" | "FUNCTION_MODULE_ID_ASC" | "FUNCTION_MODULE_ID_DESC" | "ID_ASC" | "ID_DESC" | "INFRA_SECRETS_MODULE_ID_ASC" | "INFRA_SECRETS_MODULE_ID_DESC" | "NAMESPACE_MODULE_ID_ASC" | "NAMESPACE_MODULE_ID_DESC" | "NATURAL" | "POLICIES_ASC" | "POLICIES_DESC" | "PREFIX_ASC" | "PREFIX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PRIVATE_API_NAME_ASC" | "PRIVATE_API_NAME_DESC" | "PRIVATE_SCHEMA_ID_ASC" | "PRIVATE_SCHEMA_ID_DESC" | "PRIVATE_SCHEMA_NAME_ASC" | "PRIVATE_SCHEMA_NAME_DESC" | "PROVISIONS_ASC" | "PROVISIONS_DESC" | "PUBLIC_SCHEMA_NAME_ASC" | "PUBLIC_SCHEMA_NAME_DESC" | "SCHEMA_ID_ASC" | "SCHEMA_ID_DESC" | "SCOPE_ASC" | "SCOPE_DESC" | "WEBHOOK_ENDPOINTS_TABLE_ID_ASC" | "WEBHOOK_ENDPOINTS_TABLE_ID_DESC" | "WEBHOOK_ENDPOINTS_TABLE_NAME_ASC" | "WEBHOOK_ENDPOINTS_TABLE_NAME_DESC" | "WEBHOOK_EVENTS_TABLE_ID_ASC" | "WEBHOOK_EVENTS_TABLE_ID_DESC" | "WEBHOOK_EVENTS_TABLE_NAME_ASC" | "WEBHOOK_EVENTS_TABLE_NAME_DESC"; +export type AgentModuleOrderBy = + | 'AGENT_TABLE_ID_ASC' + | 'AGENT_TABLE_ID_DESC' + | 'AGENT_TABLE_NAME_ASC' + | 'AGENT_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HAS_AGENTS_ASC' + | 'HAS_AGENTS_DESC' + | 'HAS_PLANS_ASC' + | 'HAS_PLANS_DESC' + | 'HAS_RESOURCES_ASC' + | 'HAS_RESOURCES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_TABLE_ID_ASC' + | 'MESSAGE_TABLE_ID_DESC' + | 'MESSAGE_TABLE_NAME_ASC' + | 'MESSAGE_TABLE_NAME_DESC' + | 'NATURAL' + | 'PERSONA_TABLE_ID_ASC' + | 'PERSONA_TABLE_ID_DESC' + | 'PERSONA_TABLE_NAME_ASC' + | 'PERSONA_TABLE_NAME_DESC' + | 'PLAN_TABLE_ID_ASC' + | 'PLAN_TABLE_ID_DESC' + | 'PLAN_TABLE_NAME_ASC' + | 'PLAN_TABLE_NAME_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROMPTS_TABLE_ID_ASC' + | 'PROMPTS_TABLE_ID_DESC' + | 'PROMPTS_TABLE_NAME_ASC' + | 'PROMPTS_TABLE_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'RESOURCE_TABLE_ID_ASC' + | 'RESOURCE_TABLE_ID_DESC' + | 'RESOURCE_TABLE_NAME_ASC' + | 'RESOURCE_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SHARED_ASC' + | 'SHARED_DESC' + | 'TASK_TABLE_ID_ASC' + | 'TASK_TABLE_ID_DESC' + | 'TASK_TABLE_NAME_ASC' + | 'TASK_TABLE_NAME_DESC' + | 'THREAD_TABLE_ID_ASC' + | 'THREAD_TABLE_ID_DESC' + | 'THREAD_TABLE_NAME_ASC' + | 'THREAD_TABLE_NAME_DESC'; +export type ApiSurfaceModuleOrderBy = + | 'APIS_TABLE_ID_ASC' + | 'APIS_TABLE_ID_DESC' + | 'APIS_TABLE_NAME_ASC' + | 'APIS_TABLE_NAME_DESC' + | 'API_MODULES_TABLE_ID_ASC' + | 'API_MODULES_TABLE_ID_DESC' + | 'API_MODULES_TABLE_NAME_ASC' + | 'API_MODULES_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'API_SCHEMAS_TABLE_ID_ASC' + | 'API_SCHEMAS_TABLE_ID_DESC' + | 'API_SCHEMAS_TABLE_NAME_ASC' + | 'API_SCHEMAS_TABLE_NAME_DESC' + | 'API_SETTINGS_TABLE_ID_ASC' + | 'API_SETTINGS_TABLE_ID_DESC' + | 'API_SETTINGS_TABLE_NAME_ASC' + | 'API_SETTINGS_TABLE_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'CORS_SETTINGS_TABLE_ID_ASC' + | 'CORS_SETTINGS_TABLE_ID_DESC' + | 'CORS_SETTINGS_TABLE_NAME_ASC' + | 'CORS_SETTINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type AppModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPS_TABLE_ID_ASC' + | 'APPS_TABLE_ID_DESC' + | 'APPS_TABLE_NAME_ASC' + | 'APPS_TABLE_NAME_DESC' + | 'APP_COMPONENTS_TABLE_ID_ASC' + | 'APP_COMPONENTS_TABLE_ID_DESC' + | 'APP_COMPONENTS_TABLE_NAME_ASC' + | 'APP_COMPONENTS_TABLE_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type BillingModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BALANCES_TABLE_ID_ASC' + | 'BALANCES_TABLE_ID_DESC' + | 'BALANCES_TABLE_NAME_ASC' + | 'BALANCES_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LEDGER_TABLE_ID_ASC' + | 'LEDGER_TABLE_ID_DESC' + | 'LEDGER_TABLE_NAME_ASC' + | 'LEDGER_TABLE_NAME_DESC' + | 'METERS_TABLE_ID_ASC' + | 'METERS_TABLE_ID_DESC' + | 'METERS_TABLE_NAME_ASC' + | 'METERS_TABLE_NAME_DESC' + | 'METER_CREDITS_TABLE_ID_ASC' + | 'METER_CREDITS_TABLE_ID_DESC' + | 'METER_CREDITS_TABLE_NAME_ASC' + | 'METER_CREDITS_TABLE_NAME_DESC' + | 'METER_DEFAULTS_TABLE_ID_ASC' + | 'METER_DEFAULTS_TABLE_ID_DESC' + | 'METER_DEFAULTS_TABLE_NAME_ASC' + | 'METER_DEFAULTS_TABLE_NAME_DESC' + | 'METER_SOURCES_TABLE_ID_ASC' + | 'METER_SOURCES_TABLE_ID_DESC' + | 'METER_SOURCES_TABLE_NAME_ASC' + | 'METER_SOURCES_TABLE_NAME_DESC' + | 'NATURAL' + | 'PLAN_SUBSCRIPTIONS_TABLE_ID_ASC' + | 'PLAN_SUBSCRIPTIONS_TABLE_ID_DESC' + | 'PLAN_SUBSCRIPTIONS_TABLE_NAME_ASC' + | 'PLAN_SUBSCRIPTIONS_TABLE_NAME_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RECORD_USAGE_FUNCTION_ASC' + | 'RECORD_USAGE_FUNCTION_DESC' + | 'ROLLUP_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_ASC' + | 'SWEEP_EXPIRED_SUBSCRIPTIONS_FUNCTION_DESC'; +export type BillingProviderModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BILLING_CUSTOMERS_TABLE_ID_ASC' + | 'BILLING_CUSTOMERS_TABLE_ID_DESC' + | 'BILLING_CUSTOMERS_TABLE_NAME_ASC' + | 'BILLING_CUSTOMERS_TABLE_NAME_DESC' + | 'BILLING_PRICES_TABLE_ID_ASC' + | 'BILLING_PRICES_TABLE_ID_DESC' + | 'BILLING_PRICES_TABLE_NAME_ASC' + | 'BILLING_PRICES_TABLE_NAME_DESC' + | 'BILLING_PRODUCTS_TABLE_ID_ASC' + | 'BILLING_PRODUCTS_TABLE_ID_DESC' + | 'BILLING_PRODUCTS_TABLE_NAME_ASC' + | 'BILLING_PRODUCTS_TABLE_NAME_DESC' + | 'BILLING_SUBSCRIPTIONS_TABLE_ID_ASC' + | 'BILLING_SUBSCRIPTIONS_TABLE_ID_DESC' + | 'BILLING_SUBSCRIPTIONS_TABLE_NAME_ASC' + | 'BILLING_SUBSCRIPTIONS_TABLE_NAME_DESC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_ID_ASC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_ID_DESC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_NAME_ASC' + | 'BILLING_WEBHOOK_EVENTS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRICES_TABLE_ID_ASC' + | 'PRICES_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PROCESS_BILLING_EVENT_FUNCTION_ASC' + | 'PROCESS_BILLING_EVENT_FUNCTION_DESC' + | 'PRODUCTS_TABLE_ID_ASC' + | 'PRODUCTS_TABLE_ID_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SUBSCRIPTIONS_TABLE_ID_ASC' + | 'SUBSCRIPTIONS_TABLE_ID_DESC'; +export type BlueprintOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DEFINITION_HASH_ASC' + | 'DEFINITION_HASH_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TABLE_HASHES_ASC' + | 'TABLE_HASHES_DESC' + | 'TEMPLATE_ID_ASC' + | 'TEMPLATE_ID_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type BlueprintConstructionOrderBy = + | 'BLUEPRINT_ID_ASC' + | 'BLUEPRINT_ID_DESC' + | 'CONSTRUCTED_AT_ASC' + | 'CONSTRUCTED_AT_DESC' + | 'CONSTRUCTED_DEFINITION_ASC' + | 'CONSTRUCTED_DEFINITION_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_DETAILS_ASC' + | 'ERROR_DETAILS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'TABLE_MAP_ASC' + | 'TABLE_MAP_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type BlueprintTemplateOrderBy = + | 'CATEGORIES_ASC' + | 'CATEGORIES_DESC' + | 'COMPLEXITY_ASC' + | 'COMPLEXITY_DESC' + | 'COPY_COUNT_ASC' + | 'COPY_COUNT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DEFINITION_ASC' + | 'DEFINITION_DESC' + | 'DEFINITION_HASH_ASC' + | 'DEFINITION_HASH_DESC' + | 'DEFINITION_SCHEMA_VERSION_ASC' + | 'DEFINITION_SCHEMA_VERSION_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DISPLAY_NAME_ASC' + | 'DISPLAY_NAME_DESC' + | 'FORKED_FROM_ID_ASC' + | 'FORKED_FROM_ID_DESC' + | 'FORK_COUNT_ASC' + | 'FORK_COUNT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_ASC' + | 'SOURCE_DESC' + | 'TABLE_HASHES_ASC' + | 'TABLE_HASHES_DESC' + | 'TAGS_ASC' + | 'TAGS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'VERSION_ASC' + | 'VERSION_DESC' + | 'VISIBILITY_ASC' + | 'VISIBILITY_DESC'; +export type CatalogModuleOrderBy = + | 'APIS_TABLE_ID_ASC' + | 'APIS_TABLE_ID_DESC' + | 'APIS_TABLE_NAME_ASC' + | 'APIS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPS_TABLE_ID_ASC' + | 'APPS_TABLE_ID_DESC' + | 'APPS_TABLE_NAME_ASC' + | 'APPS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAINS_TABLE_ID_ASC' + | 'DOMAINS_TABLE_ID_DESC' + | 'DOMAINS_TABLE_NAME_ASC' + | 'DOMAINS_TABLE_NAME_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTIONS_TABLE_ID_ASC' + | 'FUNCTIONS_TABLE_ID_DESC' + | 'FUNCTIONS_TABLE_NAME_ASC' + | 'FUNCTIONS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOURCES_TABLE_ID_ASC' + | 'RESOURCES_TABLE_ID_DESC' + | 'RESOURCES_TABLE_NAME_ASC' + | 'RESOURCES_TABLE_NAME_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SITES_TABLE_ID_ASC' + | 'SITES_TABLE_ID_DESC' + | 'SITES_TABLE_NAME_ASC' + | 'SITES_TABLE_NAME_DESC'; +export type ComputeLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COMPUTE_LOG_TABLE_ID_ASC' + | 'COMPUTE_LOG_TABLE_ID_DESC' + | 'COMPUTE_LOG_TABLE_NAME_ASC' + | 'COMPUTE_LOG_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type ConfigSecretsUserModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type ConnectedAccountsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type CryptoAddressesModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type CryptoAuthModuleOrderBy = + | 'ADDRESSES_TABLE_ID_ASC' + | 'ADDRESSES_TABLE_ID_DESC' + | 'CRYPTO_NETWORK_ASC' + | 'CRYPTO_NETWORK_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SIGN_IN_RECORD_FAILURE_ASC' + | 'SIGN_IN_RECORD_FAILURE_DESC' + | 'SIGN_IN_REQUEST_CHALLENGE_ASC' + | 'SIGN_IN_REQUEST_CHALLENGE_DESC' + | 'SIGN_IN_WITH_CHALLENGE_ASC' + | 'SIGN_IN_WITH_CHALLENGE_DESC' + | 'SIGN_UP_WITH_KEY_ASC' + | 'SIGN_UP_WITH_KEY_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'USER_FIELD_ASC' + | 'USER_FIELD_DESC'; +export type DatabaseProvisionModuleOrderBy = + | 'ASYNC_ASC' + | 'ASYNC_DESC' + | 'BOOTSTRAP_ERROR_ASC' + | 'BOOTSTRAP_ERROR_DESC' + | 'BOOTSTRAP_STATUS_ASC' + | 'BOOTSTRAP_STATUS_DESC' + | 'BOOTSTRAP_USER_ASC' + | 'BOOTSTRAP_USER_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATABASE_NAME_ASC' + | 'DATABASE_NAME_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'FULFILLED_AT_ASC' + | 'FULFILLED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MODULES_ASC' + | 'MODULES_DESC' + | 'NATURAL' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOURCE_DATABASE_ID_ASC' + | 'SOURCE_DATABASE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SUBDOMAIN_ASC' + | 'SUBDOMAIN_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DatabaseSettingsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATABASE_SETTINGS_TABLE_ID_ASC' + | 'DATABASE_SETTINGS_TABLE_ID_DESC' + | 'DATABASE_SETTINGS_TABLE_NAME_ASC' + | 'DATABASE_SETTINGS_TABLE_NAME_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBKEY_SETTINGS_TABLE_ID_ASC' + | 'PUBKEY_SETTINGS_TABLE_ID_DESC' + | 'PUBKEY_SETTINGS_TABLE_NAME_ASC' + | 'PUBKEY_SETTINGS_TABLE_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RLS_SETTINGS_TABLE_ID_ASC' + | 'RLS_SETTINGS_TABLE_ID_DESC' + | 'RLS_SETTINGS_TABLE_NAME_ASC' + | 'RLS_SETTINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'WEBAUTHN_SETTINGS_TABLE_ID_ASC' + | 'WEBAUTHN_SETTINGS_TABLE_ID_DESC' + | 'WEBAUTHN_SETTINGS_TABLE_NAME_ASC' + | 'WEBAUTHN_SETTINGS_TABLE_NAME_DESC'; +export type DbPoolConfigOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'ENABLED_ASC' + | 'ENABLED_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'MIN_ASC' + | 'MIN_DESC' + | 'NATURAL' + | 'POOL_OWNER_ID_ASC' + | 'POOL_OWNER_ID_DESC' + | 'PRESET_SLUG_ASC' + | 'PRESET_SLUG_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'WARM_TTL_ASC' + | 'WARM_TTL_DESC'; +export type DbPoolOrderBy = + | 'BOOTSTRAP_ERROR_ASC' + | 'BOOTSTRAP_ERROR_DESC' + | 'BOOTSTRAP_STATUS_ASC' + | 'BOOTSTRAP_STATUS_DESC' + | 'CLAIMED_AT_ASC' + | 'CLAIMED_AT_DESC' + | 'CLAIMED_BY_ASC' + | 'CLAIMED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRESET_COMMIT_ID_ASC' + | 'PRESET_COMMIT_ID_DESC' + | 'PRESET_SLUG_ASC' + | 'PRESET_SLUG_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type DbPresetModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DB_PRESETS_TABLE_ID_ASC' + | 'DB_PRESETS_TABLE_ID_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_ID_ASC' + | 'PUBLIC_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORE_NAME_ASC' + | 'STORE_NAME_DESC'; +export type DbUsageModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COLLECT_DB_QUERY_STATS_FUNCTION_ASC' + | 'COLLECT_DB_QUERY_STATS_FUNCTION_DESC' + | 'COLLECT_DB_TABLE_STATS_FUNCTION_ASC' + | 'COLLECT_DB_TABLE_STATS_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'QUERY_STATS_LOG_TABLE_ID_ASC' + | 'QUERY_STATS_LOG_TABLE_ID_DESC' + | 'QUERY_STATS_LOG_TABLE_NAME_ASC' + | 'QUERY_STATS_LOG_TABLE_NAME_DESC' + | 'QUERY_STATS_SUMMARY_TABLE_ID_ASC' + | 'QUERY_STATS_SUMMARY_TABLE_ID_DESC' + | 'QUERY_STATS_SUMMARY_TABLE_NAME_ASC' + | 'QUERY_STATS_SUMMARY_TABLE_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_DB_QUERY_STATS_USAGE_SUMMARY_FUNCTION_DESC' + | 'ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_DB_TABLE_STATS_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_STATS_LOG_TABLE_ID_ASC' + | 'TABLE_STATS_LOG_TABLE_ID_DESC' + | 'TABLE_STATS_LOG_TABLE_NAME_ASC' + | 'TABLE_STATS_LOG_TABLE_NAME_DESC' + | 'TABLE_STATS_SUMMARY_TABLE_ID_ASC' + | 'TABLE_STATS_SUMMARY_TABLE_ID_DESC' + | 'TABLE_STATS_SUMMARY_TABLE_NAME_ASC' + | 'TABLE_STATS_SUMMARY_TABLE_NAME_DESC'; +export type DefaultIdsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type DenormalizedTableFieldOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELD_ID_ASC' + | 'FIELD_ID_DESC' + | 'FUNC_NAME_ASC' + | 'FUNC_NAME_DESC' + | 'FUNC_ORDER_ASC' + | 'FUNC_ORDER_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REF_FIELD_ID_ASC' + | 'REF_FIELD_ID_DESC' + | 'REF_IDS_ASC' + | 'REF_IDS_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SET_IDS_ASC' + | 'SET_IDS_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'UPDATE_DEFAULTS_ASC' + | 'UPDATE_DEFAULTS_DESC' + | 'USE_UPDATES_ASC' + | 'USE_UPDATES_DESC'; +export type DevicesModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_ID_ASC' + | 'DEVICE_SETTINGS_TABLE_ID_DESC' + | 'DEVICE_SETTINGS_TABLE_NAME_ASC' + | 'DEVICE_SETTINGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'USER_DEVICES_TABLE_ID_ASC' + | 'USER_DEVICES_TABLE_ID_DESC' + | 'USER_DEVICES_TABLE_NAME_ASC' + | 'USER_DEVICES_TABLE_NAME_DESC'; +export type DomainModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAINS_TABLE_ID_ASC' + | 'DOMAINS_TABLE_ID_DESC' + | 'DOMAINS_TABLE_NAME_ASC' + | 'DOMAINS_TABLE_NAME_DESC' + | 'DOMAIN_EVENTS_TABLE_ID_ASC' + | 'DOMAIN_EVENTS_TABLE_ID_DESC' + | 'DOMAIN_EVENTS_TABLE_NAME_ASC' + | 'DOMAIN_EVENTS_TABLE_NAME_DESC' + | 'DOMAIN_VERIFICATIONS_TABLE_ID_ASC' + | 'DOMAIN_VERIFICATIONS_TABLE_ID_DESC' + | 'DOMAIN_VERIFICATIONS_TABLE_NAME_ASC' + | 'DOMAIN_VERIFICATIONS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MANAGED_DOMAINS_TABLE_ID_ASC' + | 'MANAGED_DOMAINS_TABLE_ID_DESC' + | 'MANAGED_DOMAINS_TABLE_NAME_ASC' + | 'MANAGED_DOMAINS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type EmailsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type EntityTypeProvisionOrderBy = + | 'AGENTS_ASC' + | 'AGENTS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'FUNCTIONS_ASC' + | 'FUNCTIONS_DESC' + | 'GRAPHS_ASC' + | 'GRAPHS_DESC' + | 'HAS_INVITES_ASC' + | 'HAS_INVITES_DESC' + | 'HAS_INVITE_ACHIEVEMENTS_ASC' + | 'HAS_INVITE_ACHIEVEMENTS_DESC' + | 'HAS_LEVELS_ASC' + | 'HAS_LEVELS_DESC' + | 'HAS_LIMITS_ASC' + | 'HAS_LIMITS_DESC' + | 'HAS_PROFILES_ASC' + | 'HAS_PROFILES_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_VISIBLE_ASC' + | 'IS_VISIBLE_DESC' + | 'NAMESPACES_ASC' + | 'NAMESPACES_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'OUT_AGENT_MODULE_ID_ASC' + | 'OUT_AGENT_MODULE_ID_DESC' + | 'OUT_BUCKETS_TABLE_ID_ASC' + | 'OUT_BUCKETS_TABLE_ID_DESC' + | 'OUT_DEFINITIONS_TABLE_ID_ASC' + | 'OUT_DEFINITIONS_TABLE_ID_DESC' + | 'OUT_ENTITY_TABLE_ID_ASC' + | 'OUT_ENTITY_TABLE_ID_DESC' + | 'OUT_ENTITY_TABLE_NAME_ASC' + | 'OUT_ENTITY_TABLE_NAME_DESC' + | 'OUT_EXECUTION_LOGS_TABLE_ID_ASC' + | 'OUT_EXECUTION_LOGS_TABLE_ID_DESC' + | 'OUT_FILES_TABLE_ID_ASC' + | 'OUT_FILES_TABLE_ID_DESC' + | 'OUT_FUNCTION_MODULE_ID_ASC' + | 'OUT_FUNCTION_MODULE_ID_DESC' + | 'OUT_GRAPHS_TABLE_ID_ASC' + | 'OUT_GRAPHS_TABLE_ID_DESC' + | 'OUT_GRAPH_MODULE_ID_ASC' + | 'OUT_GRAPH_MODULE_ID_DESC' + | 'OUT_INSTALLED_MODULES_ASC' + | 'OUT_INSTALLED_MODULES_DESC' + | 'OUT_INVITES_MODULE_ID_ASC' + | 'OUT_INVITES_MODULE_ID_DESC' + | 'OUT_INVOCATIONS_TABLE_ID_ASC' + | 'OUT_INVOCATIONS_TABLE_ID_DESC' + | 'OUT_MEMBERSHIP_TYPE_ASC' + | 'OUT_MEMBERSHIP_TYPE_DESC' + | 'OUT_NAMESPACES_TABLE_ID_ASC' + | 'OUT_NAMESPACES_TABLE_ID_DESC' + | 'OUT_NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'OUT_NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'OUT_NAMESPACE_MODULE_ID_ASC' + | 'OUT_NAMESPACE_MODULE_ID_DESC' + | 'OUT_PATH_SHARES_TABLE_ID_ASC' + | 'OUT_PATH_SHARES_TABLE_ID_DESC' + | 'OUT_STORAGE_MODULE_ID_ASC' + | 'OUT_STORAGE_MODULE_ID_DESC' + | 'PARENT_ENTITY_ASC' + | 'PARENT_ENTITY_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SKIP_ENTITY_POLICIES_ASC' + | 'SKIP_ENTITY_POLICIES_DESC' + | 'STORAGE_ASC' + | 'STORAGE_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'TABLE_PROVISION_ASC' + | 'TABLE_PROVISION_DESC'; +export type EventsModuleOrderBy = + | 'ACHIEVEMENT_REWARDS_TABLE_ID_ASC' + | 'ACHIEVEMENT_REWARDS_TABLE_ID_DESC' + | 'ACHIEVEMENT_REWARDS_TABLE_NAME_ASC' + | 'ACHIEVEMENT_REWARDS_TABLE_NAME_DESC' + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EVENTS_TABLE_ID_ASC' + | 'EVENTS_TABLE_ID_DESC' + | 'EVENTS_TABLE_NAME_ASC' + | 'EVENTS_TABLE_NAME_DESC' + | 'EVENT_AGGREGATES_TABLE_ID_ASC' + | 'EVENT_AGGREGATES_TABLE_ID_DESC' + | 'EVENT_AGGREGATES_TABLE_NAME_ASC' + | 'EVENT_AGGREGATES_TABLE_NAME_DESC' + | 'EVENT_TYPES_TABLE_ID_ASC' + | 'EVENT_TYPES_TABLE_ID_DESC' + | 'EVENT_TYPES_TABLE_NAME_ASC' + | 'EVENT_TYPES_TABLE_NAME_DESC' + | 'GRANT_ACHIEVEMENT_ASC' + | 'GRANT_ACHIEVEMENT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'LEVELS_TABLE_ID_ASC' + | 'LEVELS_TABLE_ID_DESC' + | 'LEVELS_TABLE_NAME_ASC' + | 'LEVELS_TABLE_NAME_DESC' + | 'LEVEL_ACHIEVED_ASC' + | 'LEVEL_ACHIEVED_DESC' + | 'LEVEL_GRANTS_TABLE_ID_ASC' + | 'LEVEL_GRANTS_TABLE_ID_DESC' + | 'LEVEL_GRANTS_TABLE_NAME_ASC' + | 'LEVEL_GRANTS_TABLE_NAME_DESC' + | 'LEVEL_REQUIREMENTS_TABLE_ID_ASC' + | 'LEVEL_REQUIREMENTS_TABLE_ID_DESC' + | 'LEVEL_REQUIREMENTS_TABLE_NAME_ASC' + | 'LEVEL_REQUIREMENTS_TABLE_NAME_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RECORD_EVENT_ASC' + | 'RECORD_EVENT_DESC' + | 'REMOVE_EVENT_ASC' + | 'REMOVE_EVENT_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STEPS_REQUIRED_ASC' + | 'STEPS_REQUIRED_DESC' + | 'TG_ACHIEVEMENT_REWARD_ASC' + | 'TG_ACHIEVEMENT_REWARD_DESC' + | 'TG_CHECK_ACHIEVEMENTS_ASC' + | 'TG_CHECK_ACHIEVEMENTS_DESC' + | 'TG_EVENT_ASC' + | 'TG_EVENT_BOOL_ASC' + | 'TG_EVENT_BOOL_DESC' + | 'TG_EVENT_DESC' + | 'TG_EVENT_TOGGLE_ASC' + | 'TG_EVENT_TOGGLE_BOOL_ASC' + | 'TG_EVENT_TOGGLE_BOOL_DESC' + | 'TG_EVENT_TOGGLE_DESC' + | 'TG_UPDATE_AGGREGATES_ASC' + | 'TG_UPDATE_AGGREGATES_DESC' + | 'UPSERT_AGGREGATE_ASC' + | 'UPSERT_AGGREGATE_DESC'; +export type FunctionDeploymentModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DEPLOYMENTS_TABLE_ID_ASC' + | 'DEPLOYMENTS_TABLE_ID_DESC' + | 'DEPLOYMENTS_TABLE_NAME_ASC' + | 'DEPLOYMENTS_TABLE_NAME_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type FunctionInvocationModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'ATTEMPTS_TABLE_ID_ASC' + | 'ATTEMPTS_TABLE_ID_DESC' + | 'ATTEMPTS_TABLE_NAME_ASC' + | 'ATTEMPTS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EXECUTION_LOGS_TABLE_ID_ASC' + | 'EXECUTION_LOGS_TABLE_ID_DESC' + | 'EXECUTION_LOGS_TABLE_NAME_ASC' + | 'EXECUTION_LOGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATIONS_TABLE_ID_ASC' + | 'INVOCATIONS_TABLE_ID_DESC' + | 'INVOCATIONS_TABLE_NAME_ASC' + | 'INVOCATIONS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type FunctionModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BINDINGS_TABLE_ID_ASC' + | 'BINDINGS_TABLE_ID_DESC' + | 'BINDINGS_TABLE_NAME_ASC' + | 'BINDINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DEFINITIONS_TABLE_ID_ASC' + | 'DEFINITIONS_TABLE_ID_DESC' + | 'DEFINITIONS_TABLE_NAME_ASC' + | 'DEFINITIONS_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HAS_CRON_ASC' + | 'HAS_CRON_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEDULES_TABLE_ID_ASC' + | 'SCHEDULES_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type GraphExecutionModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_ID_ASC' + | 'EXECUTIONS_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_NAME_ASC' + | 'EXECUTIONS_TABLE_NAME_DESC' + | 'GRAPH_MODULE_ID_ASC' + | 'GRAPH_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODE_STATES_TABLE_ID_ASC' + | 'NODE_STATES_TABLE_ID_DESC' + | 'NODE_STATES_TABLE_NAME_ASC' + | 'NODE_STATES_TABLE_NAME_DESC' + | 'OUTPUTS_TABLE_ID_ASC' + | 'OUTPUTS_TABLE_ID_DESC' + | 'OUTPUTS_TABLE_NAME_ASC' + | 'OUTPUTS_TABLE_NAME_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type GraphModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GRAPHS_TABLE_ID_ASC' + | 'GRAPHS_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_ID_ASC' + | 'PUBLIC_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type HierarchyModuleOrderBy = + | 'CHART_EDGES_TABLE_ID_ASC' + | 'CHART_EDGES_TABLE_ID_DESC' + | 'CHART_EDGES_TABLE_NAME_ASC' + | 'CHART_EDGES_TABLE_NAME_DESC' + | 'CHART_EDGE_GRANTS_TABLE_ID_ASC' + | 'CHART_EDGE_GRANTS_TABLE_ID_DESC' + | 'CHART_EDGE_GRANTS_TABLE_NAME_ASC' + | 'CHART_EDGE_GRANTS_TABLE_NAME_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GET_MANAGERS_FUNCTION_ASC' + | 'GET_MANAGERS_FUNCTION_DESC' + | 'GET_SUBORDINATES_FUNCTION_ASC' + | 'GET_SUBORDINATES_FUNCTION_DESC' + | 'HIERARCHY_SPRT_TABLE_ID_ASC' + | 'HIERARCHY_SPRT_TABLE_ID_DESC' + | 'HIERARCHY_SPRT_TABLE_NAME_ASC' + | 'HIERARCHY_SPRT_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_MANAGER_OF_FUNCTION_ASC' + | 'IS_MANAGER_OF_FUNCTION_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'REBUILD_HIERARCHY_FUNCTION_ASC' + | 'REBUILD_HIERARCHY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SPRT_TABLE_NAME_ASC' + | 'SPRT_TABLE_NAME_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type HttpRouteModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'HTTP_ROUTES_TABLE_ID_ASC' + | 'HTTP_ROUTES_TABLE_ID_DESC' + | 'HTTP_ROUTES_TABLE_NAME_ASC' + | 'HTTP_ROUTES_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVER_FUNCTION_NAME_ASC' + | 'RESOLVER_FUNCTION_NAME_DESC' + | 'RESOURCE_MODULE_ID_ASC' + | 'RESOURCE_MODULE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORAGE_MODULE_ID_ASC' + | 'STORAGE_MODULE_ID_DESC'; +export type I18NModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SETTINGS_TABLE_ID_ASC' + | 'SETTINGS_TABLE_ID_DESC'; +export type IdentityProvidersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type InferenceLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INFERENCE_LOG_TABLE_ID_ASC' + | 'INFERENCE_LOG_TABLE_ID_DESC' + | 'INFERENCE_LOG_TABLE_NAME_ASC' + | 'INFERENCE_LOG_TABLE_NAME_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type InfraConfigModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CONFIG_TABLE_ID_ASC' + | 'CONFIG_TABLE_ID_DESC' + | 'CONFIG_TABLE_NAME_ASC' + | 'CONFIG_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type InfraSecretsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SECRETS_TABLE_NAME_ASC' + | 'SECRETS_TABLE_NAME_DESC'; +export type IntegrationProvidersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type InternalSecretsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERNAL_SECRETS_TABLE_ID_ASC' + | 'INTERNAL_SECRETS_TABLE_ID_DESC' + | 'INTERNAL_SECRETS_TABLE_NAME_ASC' + | 'INTERNAL_SECRETS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type InvitesModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CLAIMED_INVITES_TABLE_ID_ASC' + | 'CLAIMED_INVITES_TABLE_ID_DESC' + | 'CLAIMED_INVITES_TABLE_NAME_ASC' + | 'CLAIMED_INVITES_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'EMAILS_TABLE_ID_ASC' + | 'EMAILS_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVITES_TABLE_ID_ASC' + | 'INVITES_TABLE_ID_DESC' + | 'INVITES_TABLE_NAME_ASC' + | 'INVITES_TABLE_NAME_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SUBMIT_INVITE_CODE_FUNCTION_ASC' + | 'SUBMIT_INVITE_CODE_FUNCTION_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type LimitsModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'AGGREGATE_TABLE_ID_ASC' + | 'AGGREGATE_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CAP_CHECK_TRIGGER_ASC' + | 'CAP_CHECK_TRIGGER_DESC' + | 'CREDIT_CODES_TABLE_ID_ASC' + | 'CREDIT_CODES_TABLE_ID_DESC' + | 'CREDIT_CODE_ITEMS_TABLE_ID_ASC' + | 'CREDIT_CODE_ITEMS_TABLE_ID_DESC' + | 'CREDIT_REDEMPTIONS_TABLE_ID_ASC' + | 'CREDIT_REDEMPTIONS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_TABLE_ID_ASC' + | 'DEFAULT_TABLE_ID_DESC' + | 'DEFAULT_TABLE_NAME_ASC' + | 'DEFAULT_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'EVENTS_TABLE_ID_ASC' + | 'EVENTS_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_ASC' + | 'LIMIT_AGGREGATE_CHECK_SOFT_FUNCTION_DESC' + | 'LIMIT_CAPS_DEFAULTS_TABLE_ID_ASC' + | 'LIMIT_CAPS_DEFAULTS_TABLE_ID_DESC' + | 'LIMIT_CAPS_TABLE_ID_ASC' + | 'LIMIT_CAPS_TABLE_ID_DESC' + | 'LIMIT_CHECK_FUNCTION_ASC' + | 'LIMIT_CHECK_FUNCTION_DESC' + | 'LIMIT_CHECK_SOFT_FUNCTION_ASC' + | 'LIMIT_CHECK_SOFT_FUNCTION_DESC' + | 'LIMIT_CREDITS_TABLE_ID_ASC' + | 'LIMIT_CREDITS_TABLE_ID_DESC' + | 'LIMIT_DECREMENT_FUNCTION_ASC' + | 'LIMIT_DECREMENT_FUNCTION_DESC' + | 'LIMIT_DECREMENT_TRIGGER_ASC' + | 'LIMIT_DECREMENT_TRIGGER_DESC' + | 'LIMIT_INCREMENT_FUNCTION_ASC' + | 'LIMIT_INCREMENT_FUNCTION_DESC' + | 'LIMIT_INCREMENT_TRIGGER_ASC' + | 'LIMIT_INCREMENT_TRIGGER_DESC' + | 'LIMIT_UPDATE_TRIGGER_ASC' + | 'LIMIT_UPDATE_TRIGGER_DESC' + | 'LIMIT_WARNINGS_TABLE_ID_ASC' + | 'LIMIT_WARNINGS_TABLE_ID_DESC' + | 'LIMIT_WARNING_STATE_TABLE_ID_ASC' + | 'LIMIT_WARNING_STATE_TABLE_ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVE_CAP_FUNCTION_ASC' + | 'RESOLVE_CAP_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type MembershipTypesModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type MembershipsModuleOrderBy = + | 'ACTOR_MASK_CHECK_ASC' + | 'ACTOR_MASK_CHECK_DESC' + | 'ACTOR_PERM_CHECK_ASC' + | 'ACTOR_PERM_CHECK_DESC' + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'ADMIN_GRANTS_TABLE_ID_ASC' + | 'ADMIN_GRANTS_TABLE_ID_DESC' + | 'ADMIN_GRANTS_TABLE_NAME_ASC' + | 'ADMIN_GRANTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_LIMITS_TABLE_ID_ASC' + | 'DEFAULT_LIMITS_TABLE_ID_DESC' + | 'DEFAULT_PERMISSIONS_TABLE_ID_ASC' + | 'DEFAULT_PERMISSIONS_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_IDS_BY_MASK_ASC' + | 'ENTITY_IDS_BY_MASK_DESC' + | 'ENTITY_IDS_BY_PERM_ASC' + | 'ENTITY_IDS_BY_PERM_DESC' + | 'ENTITY_IDS_FUNCTION_ASC' + | 'ENTITY_IDS_FUNCTION_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ENTITY_TABLE_OWNER_ID_ASC' + | 'ENTITY_TABLE_OWNER_ID_DESC' + | 'GET_ORG_FN_ASC' + | 'GET_ORG_FN_DESC' + | 'GRANTS_TABLE_ID_ASC' + | 'GRANTS_TABLE_ID_DESC' + | 'GRANTS_TABLE_NAME_ASC' + | 'GRANTS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'LIMITS_TABLE_ID_ASC' + | 'LIMITS_TABLE_ID_DESC' + | 'MEMBERSHIPS_TABLE_ID_ASC' + | 'MEMBERSHIPS_TABLE_ID_DESC' + | 'MEMBERSHIPS_TABLE_NAME_ASC' + | 'MEMBERSHIPS_TABLE_NAME_DESC' + | 'MEMBERSHIP_DEFAULTS_TABLE_ID_ASC' + | 'MEMBERSHIP_DEFAULTS_TABLE_ID_DESC' + | 'MEMBERSHIP_DEFAULTS_TABLE_NAME_ASC' + | 'MEMBERSHIP_DEFAULTS_TABLE_NAME_DESC' + | 'MEMBERSHIP_SETTINGS_TABLE_ID_ASC' + | 'MEMBERSHIP_SETTINGS_TABLE_ID_DESC' + | 'MEMBERSHIP_SETTINGS_TABLE_NAME_ASC' + | 'MEMBERSHIP_SETTINGS_TABLE_NAME_DESC' + | 'MEMBERS_TABLE_ID_ASC' + | 'MEMBERS_TABLE_ID_DESC' + | 'MEMBERS_TABLE_NAME_ASC' + | 'MEMBERS_TABLE_NAME_DESC' + | 'MEMBER_PROFILES_TABLE_ID_ASC' + | 'MEMBER_PROFILES_TABLE_ID_DESC' + | 'NATURAL' + | 'OWNER_GRANTS_TABLE_ID_ASC' + | 'OWNER_GRANTS_TABLE_ID_DESC' + | 'OWNER_GRANTS_TABLE_NAME_ASC' + | 'OWNER_GRANTS_TABLE_NAME_DESC' + | 'PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSIONS_TABLE_ID_DESC' + | 'PERMISSION_DEFAULT_GRANTS_TABLE_ID_ASC' + | 'PERMISSION_DEFAULT_GRANTS_TABLE_ID_DESC' + | 'PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSION_DEFAULT_PERMISSIONS_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SPRT_TABLE_ID_ASC' + | 'SPRT_TABLE_ID_DESC'; +export type MerkleStoreModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'COMMIT_TABLE_ID_ASC' + | 'COMMIT_TABLE_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'FUNCTION_PREFIX_ASC' + | 'FUNCTION_PREFIX_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OBJECT_TABLE_ID_ASC' + | 'OBJECT_TABLE_ID_DESC' + | 'PERMISSION_KEY_ASC' + | 'PERMISSION_KEY_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORE_TABLE_ID_ASC' + | 'STORE_TABLE_ID_DESC'; +export type NamespaceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' + | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type NotificationsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHANNELS_TABLE_ID_ASC' + | 'CHANNELS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DELIVERY_LOG_TABLE_ID_ASC' + | 'DELIVERY_LOG_TABLE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'HAS_CHANNELS_ASC' + | 'HAS_CHANNELS_DESC' + | 'HAS_DIGEST_METADATA_ASC' + | 'HAS_DIGEST_METADATA_DESC' + | 'HAS_PREFERENCES_ASC' + | 'HAS_PREFERENCES_DESC' + | 'HAS_SETTINGS_EXTENSION_ASC' + | 'HAS_SETTINGS_EXTENSION_DESC' + | 'HAS_SUBSCRIPTIONS_ASC' + | 'HAS_SUBSCRIPTIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NOTIFICATIONS_TABLE_ID_ASC' + | 'NOTIFICATIONS_TABLE_ID_DESC' + | 'ORGANIZATION_SETTINGS_TABLE_ID_ASC' + | 'ORGANIZATION_SETTINGS_TABLE_ID_DESC' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PREFERENCES_TABLE_ID_ASC' + | 'PREFERENCES_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'READ_STATE_TABLE_ID_ASC' + | 'READ_STATE_TABLE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SUPPRESSIONS_TABLE_ID_ASC' + | 'SUPPRESSIONS_TABLE_ID_DESC' + | 'USER_SETTINGS_TABLE_ID_ASC' + | 'USER_SETTINGS_TABLE_ID_DESC'; +export type PermissionsModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BITLEN_ASC' + | 'BITLEN_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_TABLE_ID_ASC' + | 'DEFAULT_TABLE_ID_DESC' + | 'DEFAULT_TABLE_NAME_ASC' + | 'DEFAULT_TABLE_NAME_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'GET_BY_MASK_ASC' + | 'GET_BY_MASK_DESC' + | 'GET_MASK_ASC' + | 'GET_MASK_BY_NAME_ASC' + | 'GET_MASK_BY_NAME_DESC' + | 'GET_MASK_DESC' + | 'GET_PADDED_MASK_ASC' + | 'GET_PADDED_MASK_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type PhoneNumbersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type PlansModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'APPLY_BILLING_PLAN_FUNCTION_ASC' + | 'APPLY_BILLING_PLAN_FUNCTION_DESC' + | 'APPLY_PLAN_AGGREGATE_FUNCTION_ASC' + | 'APPLY_PLAN_AGGREGATE_FUNCTION_DESC' + | 'APPLY_PLAN_CAPS_FUNCTION_ASC' + | 'APPLY_PLAN_CAPS_FUNCTION_DESC' + | 'APPLY_PLAN_FUNCTION_ASC' + | 'APPLY_PLAN_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PLANS_TABLE_ID_ASC' + | 'PLANS_TABLE_ID_DESC' + | 'PLANS_TABLE_NAME_ASC' + | 'PLANS_TABLE_NAME_DESC' + | 'PLAN_CAPS_TABLE_ID_ASC' + | 'PLAN_CAPS_TABLE_ID_DESC' + | 'PLAN_LIMITS_TABLE_ID_ASC' + | 'PLAN_LIMITS_TABLE_ID_DESC' + | 'PLAN_LIMITS_TABLE_NAME_ASC' + | 'PLAN_LIMITS_TABLE_NAME_DESC' + | 'PLAN_METER_LIMITS_TABLE_ID_ASC' + | 'PLAN_METER_LIMITS_TABLE_ID_DESC' + | 'PLAN_OVERRIDES_TABLE_ID_ASC' + | 'PLAN_OVERRIDES_TABLE_ID_DESC' + | 'PLAN_PRICING_TABLE_ID_ASC' + | 'PLAN_PRICING_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type PrincipalAuthModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'CREATE_ORG_API_KEY_FUNCTION_ASC' + | 'CREATE_ORG_API_KEY_FUNCTION_DESC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_PRINCIPAL_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_PRINCIPAL_FUNCTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRINCIPALS_TABLE_ID_ASC' + | 'PRINCIPALS_TABLE_ID_DESC' + | 'PRINCIPALS_TABLE_NAME_ASC' + | 'PRINCIPALS_TABLE_NAME_DESC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_ASC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_DESC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC' + | 'REVOKE_ORG_API_KEY_FUNCTION_ASC' + | 'REVOKE_ORG_API_KEY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type ProfilesModuleOrderBy = + | 'ACTOR_TABLE_ID_ASC' + | 'ACTOR_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MEMBERSHIPS_TABLE_ID_ASC' + | 'MEMBERSHIPS_TABLE_ID_DESC' + | 'NATURAL' + | 'PERMISSIONS_TABLE_ID_ASC' + | 'PERMISSIONS_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_ID_ASC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_ID_DESC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_NAME_ASC' + | 'PROFILE_DEFINITION_GRANTS_TABLE_NAME_DESC' + | 'PROFILE_GRANTS_TABLE_ID_ASC' + | 'PROFILE_GRANTS_TABLE_ID_DESC' + | 'PROFILE_GRANTS_TABLE_NAME_ASC' + | 'PROFILE_GRANTS_TABLE_NAME_DESC' + | 'PROFILE_PERMISSIONS_TABLE_ID_ASC' + | 'PROFILE_PERMISSIONS_TABLE_ID_DESC' + | 'PROFILE_PERMISSIONS_TABLE_NAME_ASC' + | 'PROFILE_PERMISSIONS_TABLE_NAME_DESC' + | 'PROFILE_TEMPLATES_TABLE_ID_ASC' + | 'PROFILE_TEMPLATES_TABLE_ID_DESC' + | 'PROFILE_TEMPLATES_TABLE_NAME_ASC' + | 'PROFILE_TEMPLATES_TABLE_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type RateLimitMetersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHECK_RATE_LIMIT_FUNCTION_ASC' + | 'CHECK_RATE_LIMIT_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RATE_LIMIT_OVERRIDES_TABLE_ID_ASC' + | 'RATE_LIMIT_OVERRIDES_TABLE_ID_DESC' + | 'RATE_LIMIT_OVERRIDES_TABLE_NAME_ASC' + | 'RATE_LIMIT_OVERRIDES_TABLE_NAME_DESC' + | 'RATE_LIMIT_STATE_TABLE_ID_ASC' + | 'RATE_LIMIT_STATE_TABLE_ID_DESC' + | 'RATE_LIMIT_STATE_TABLE_NAME_ASC' + | 'RATE_LIMIT_STATE_TABLE_NAME_DESC' + | 'RATE_WINDOW_LIMITS_TABLE_ID_ASC' + | 'RATE_WINDOW_LIMITS_TABLE_ID_DESC' + | 'RATE_WINDOW_LIMITS_TABLE_NAME_ASC' + | 'RATE_WINDOW_LIMITS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type RateLimitsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IP_RATE_LIMITS_TABLE_ID_ASC' + | 'IP_RATE_LIMITS_TABLE_ID_DESC' + | 'IP_RATE_LIMITS_TABLE_NAME_ASC' + | 'IP_RATE_LIMITS_TABLE_NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RATE_LIMITS_TABLE_ID_ASC' + | 'RATE_LIMITS_TABLE_ID_DESC' + | 'RATE_LIMITS_TABLE_NAME_ASC' + | 'RATE_LIMITS_TABLE_NAME_DESC' + | 'RATE_LIMIT_SETTINGS_TABLE_ID_ASC' + | 'RATE_LIMIT_SETTINGS_TABLE_ID_DESC' + | 'RATE_LIMIT_SETTINGS_TABLE_NAME_ASC' + | 'RATE_LIMIT_SETTINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC'; +export type RealtimeModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CHANGE_LOG_TABLE_ID_ASC' + | 'CHANGE_LOG_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'LISTENER_NODE_TABLE_ID_ASC' + | 'LISTENER_NODE_TABLE_ID_DESC' + | 'NATURAL' + | 'NOTIFY_CHANNEL_ASC' + | 'NOTIFY_CHANNEL_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'RETENTION_HOURS_ASC' + | 'RETENTION_HOURS_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SOURCE_REGISTRY_TABLE_ID_ASC' + | 'SOURCE_REGISTRY_TABLE_ID_DESC' + | 'SUBSCRIPTIONS_SCHEMA_ID_ASC' + | 'SUBSCRIPTIONS_SCHEMA_ID_DESC'; +export type RelationProvisionOrderBy = + | 'API_REQUIRED_ASC' + | 'API_REQUIRED_DESC' + | 'CREATE_INDEX_ASC' + | 'CREATE_INDEX_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACTION_ASC' + | 'DELETE_ACTION_DESC' + | 'EXPOSE_IN_API_ASC' + | 'EXPOSE_IN_API_DESC' + | 'FIELD_NAME_ASC' + | 'FIELD_NAME_DESC' + | 'GRANTS_ASC' + | 'GRANTS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'IS_REQUIRED_ASC' + | 'IS_REQUIRED_DESC' + | 'JUNCTION_SCHEMA_ID_ASC' + | 'JUNCTION_SCHEMA_ID_DESC' + | 'JUNCTION_TABLE_ID_ASC' + | 'JUNCTION_TABLE_ID_DESC' + | 'JUNCTION_TABLE_NAME_ASC' + | 'JUNCTION_TABLE_NAME_DESC' + | 'NATURAL' + | 'NODES_ASC' + | 'NODES_DESC' + | 'OUT_FIELD_ID_ASC' + | 'OUT_FIELD_ID_DESC' + | 'OUT_JUNCTION_TABLE_ID_ASC' + | 'OUT_JUNCTION_TABLE_ID_DESC' + | 'OUT_SOURCE_FIELD_ID_ASC' + | 'OUT_SOURCE_FIELD_ID_DESC' + | 'OUT_TARGET_FIELD_ID_ASC' + | 'OUT_TARGET_FIELD_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'RELATION_TYPE_ASC' + | 'RELATION_TYPE_DESC' + | 'SOURCE_FIELD_NAME_ASC' + | 'SOURCE_FIELD_NAME_DESC' + | 'SOURCE_TABLE_ID_ASC' + | 'SOURCE_TABLE_ID_DESC' + | 'TARGET_FIELD_NAME_ASC' + | 'TARGET_FIELD_NAME_DESC' + | 'TARGET_TABLE_ID_ASC' + | 'TARGET_TABLE_ID_DESC' + | 'USE_COMPOSITE_KEY_ASC' + | 'USE_COMPOSITE_KEY_DESC'; +export type ResourceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INSTALLATION_STORE_NAME_ASC' + | 'INSTALLATION_STORE_NAME_DESC' + | 'MERKLE_STORE_MODULE_ID_ASC' + | 'MERKLE_STORE_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'REQUIREMENTS_STATE_VIEW_NAME_ASC' + | 'REQUIREMENTS_STATE_VIEW_NAME_DESC' + | 'RESOLVED_REQUIREMENTS_VIEW_NAME_ASC' + | 'RESOLVED_REQUIREMENTS_VIEW_NAME_DESC' + | 'RESOURCES_TABLE_ID_ASC' + | 'RESOURCES_TABLE_ID_DESC' + | 'RESOURCES_TABLE_NAME_ASC' + | 'RESOURCES_TABLE_NAME_DESC' + | 'RESOURCE_BILLING_ROLLUP_FUNCTION_ASC' + | 'RESOURCE_BILLING_ROLLUP_FUNCTION_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_ID_DESC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_ASC' + | 'RESOURCE_DEFINITIONS_TABLE_NAME_DESC' + | 'RESOURCE_EVENTS_TABLE_ID_ASC' + | 'RESOURCE_EVENTS_TABLE_ID_DESC' + | 'RESOURCE_EVENTS_TABLE_NAME_ASC' + | 'RESOURCE_EVENTS_TABLE_NAME_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_ID_DESC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_ASC' + | 'RESOURCE_INSTALLATIONS_TABLE_NAME_DESC' + | 'RESOURCE_STATUS_CHECKS_TABLE_ID_ASC' + | 'RESOURCE_STATUS_CHECKS_TABLE_ID_DESC' + | 'RESOURCE_STATUS_CHECKS_TABLE_NAME_ASC' + | 'RESOURCE_STATUS_CHECKS_TABLE_NAME_DESC' + | 'RESOURCE_USAGE_LOG_TABLE_ID_ASC' + | 'RESOURCE_USAGE_LOG_TABLE_ID_DESC' + | 'RESOURCE_USAGE_LOG_TABLE_NAME_ASC' + | 'RESOURCE_USAGE_LOG_TABLE_NAME_DESC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_ID_ASC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_ID_DESC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_NAME_ASC' + | 'RESOURCE_USAGE_SUMMARY_TABLE_NAME_DESC' + | 'ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_ASC' + | 'ROLLUP_RESOURCE_USAGE_SUMMARY_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type RlsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUTHENTICATE_ASC' + | 'AUTHENTICATE_DESC' + | 'AUTHENTICATE_STRICT_ASC' + | 'AUTHENTICATE_STRICT_DESC' + | 'CURRENT_ROLE_ASC' + | 'CURRENT_ROLE_DESC' + | 'CURRENT_ROLE_ID_ASC' + | 'CURRENT_ROLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type RouteModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOMAIN_MODULE_ID_ASC' + | 'DOMAIN_MODULE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'HOSTNAME_BINDINGS_TABLE_ID_ASC' + | 'HOSTNAME_BINDINGS_TABLE_ID_DESC' + | 'HOSTNAME_BINDINGS_TABLE_NAME_ASC' + | 'HOSTNAME_BINDINGS_TABLE_NAME_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RESOLVER_FUNCTION_NAME_ASC' + | 'RESOLVER_FUNCTION_NAME_DESC' + | 'ROUTES_TABLE_ID_ASC' + | 'ROUTES_TABLE_ID_DESC' + | 'ROUTES_TABLE_NAME_ASC' + | 'ROUTES_TABLE_NAME_DESC' + | 'ROUTE_BINDINGS_TABLE_ID_ASC' + | 'ROUTE_BINDINGS_TABLE_ID_DESC' + | 'ROUTE_BINDINGS_TABLE_NAME_ASC' + | 'ROUTE_BINDINGS_TABLE_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC'; +export type SecureTableProvisionOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'FIELDS_ASC' + | 'FIELDS_DESC' + | 'GRANTS_ASC' + | 'GRANTS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'NODES_ASC' + | 'NODES_DESC' + | 'OUT_FIELDS_ASC' + | 'OUT_FIELDS_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'USE_RLS_ASC' + | 'USE_RLS_DESC'; +export type SessionSecretsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type SessionsModuleOrderBy = + | 'AUTH_SETTINGS_TABLE_ID_ASC' + | 'AUTH_SETTINGS_TABLE_ID_DESC' + | 'AUTH_SETTINGS_TABLE_NAME_ASC' + | 'AUTH_SETTINGS_TABLE_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_DEFAULT_EXPIRATION_ASC' + | 'SESSIONS_DEFAULT_EXPIRATION_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_NAME_ASC' + | 'SESSIONS_TABLE_NAME_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_NAME_ASC' + | 'SESSION_CREDENTIALS_TABLE_NAME_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type SiteSurfaceModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'CATALOG_MODULE_ID_ASC' + | 'CATALOG_MODULE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'SITES_TABLE_ID_ASC' + | 'SITES_TABLE_ID_DESC' + | 'SITES_TABLE_NAME_ASC' + | 'SITES_TABLE_NAME_DESC' + | 'SITE_METADATA_TABLE_ID_ASC' + | 'SITE_METADATA_TABLE_ID_DESC' + | 'SITE_METADATA_TABLE_NAME_ASC' + | 'SITE_METADATA_TABLE_NAME_DESC' + | 'SITE_MODULES_TABLE_ID_ASC' + | 'SITE_MODULES_TABLE_ID_DESC' + | 'SITE_MODULES_TABLE_NAME_ASC' + | 'SITE_MODULES_TABLE_NAME_DESC' + | 'SITE_THEMES_TABLE_ID_ASC' + | 'SITE_THEMES_TABLE_ID_DESC' + | 'SITE_THEMES_TABLE_NAME_ASC' + | 'SITE_THEMES_TABLE_NAME_DESC'; +export type StorageLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'STORAGE_LOG_TABLE_ID_ASC' + | 'STORAGE_LOG_TABLE_ID_DESC' + | 'STORAGE_LOG_TABLE_NAME_ASC' + | 'STORAGE_LOG_TABLE_NAME_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type StorageModuleOrderBy = + | 'ALLOWED_ORIGINS_ASC' + | 'ALLOWED_ORIGINS_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'BUCKETS_TABLE_ID_ASC' + | 'BUCKETS_TABLE_ID_DESC' + | 'BUCKETS_TABLE_NAME_ASC' + | 'BUCKETS_TABLE_NAME_DESC' + | 'CACHE_TTL_SECONDS_ASC' + | 'CACHE_TTL_SECONDS_DESC' + | 'CONFIRM_UPLOAD_DELAY_ASC' + | 'CONFIRM_UPLOAD_DELAY_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_MAX_FILE_SIZE_ASC' + | 'DEFAULT_MAX_FILE_SIZE_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'DOWNLOAD_URL_EXPIRY_SECONDS_ASC' + | 'DOWNLOAD_URL_EXPIRY_SECONDS_DESC' + | 'ENDPOINT_ASC' + | 'ENDPOINT_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FILES_TABLE_ID_ASC' + | 'FILES_TABLE_ID_DESC' + | 'FILES_TABLE_NAME_ASC' + | 'FILES_TABLE_NAME_DESC' + | 'FILE_EVENTS_TABLE_ID_ASC' + | 'FILE_EVENTS_TABLE_ID_DESC' + | 'HAS_AUDIT_LOG_ASC' + | 'HAS_AUDIT_LOG_DESC' + | 'HAS_CONFIRM_UPLOAD_ASC' + | 'HAS_CONFIRM_UPLOAD_DESC' + | 'HAS_CONTENT_HASH_ASC' + | 'HAS_CONTENT_HASH_DESC' + | 'HAS_CUSTOM_KEYS_ASC' + | 'HAS_CUSTOM_KEYS_DESC' + | 'HAS_PATH_SHARES_ASC' + | 'HAS_PATH_SHARES_DESC' + | 'HAS_VERSIONING_ASC' + | 'HAS_VERSIONING_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_BULK_FILES_ASC' + | 'MAX_BULK_FILES_DESC' + | 'MAX_BULK_TOTAL_SIZE_ASC' + | 'MAX_BULK_TOTAL_SIZE_DESC' + | 'MAX_FILENAME_LENGTH_ASC' + | 'MAX_FILENAME_LENGTH_DESC' + | 'NATURAL' + | 'PATH_SHARES_TABLE_ID_ASC' + | 'PATH_SHARES_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVIDER_ASC' + | 'PROVIDER_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PUBLIC_URL_PREFIX_ASC' + | 'PUBLIC_URL_PREFIX_DESC' + | 'RESTRICT_READS_ASC' + | 'RESTRICT_READS_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'UPLOAD_URL_EXPIRY_SECONDS_ASC' + | 'UPLOAD_URL_EXPIRY_SECONDS_DESC'; +export type TransferLogModuleOrderBy = + | 'ACTOR_FK_TABLE_ID_ASC' + | 'ACTOR_FK_TABLE_ID_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_FK_TABLE_ID_ASC' + | 'ENTITY_FK_TABLE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INTERVAL_ASC' + | 'INTERVAL_DESC' + | 'NATURAL' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PREMAKE_ASC' + | 'PREMAKE_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'RETENTION_ASC' + | 'RETENTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'TRANSFER_LOG_TABLE_ID_ASC' + | 'TRANSFER_LOG_TABLE_ID_DESC' + | 'TRANSFER_LOG_TABLE_NAME_ASC' + | 'TRANSFER_LOG_TABLE_NAME_DESC' + | 'USAGE_SUMMARY_TABLE_ID_ASC' + | 'USAGE_SUMMARY_TABLE_ID_DESC' + | 'USAGE_SUMMARY_TABLE_NAME_ASC' + | 'USAGE_SUMMARY_TABLE_NAME_DESC'; +export type UserAuthModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'AUDITS_TABLE_NAME_ASC' + | 'AUDITS_TABLE_NAME_DESC' + | 'CHECK_PASSWORD_FUNCTION_ASC' + | 'CHECK_PASSWORD_FUNCTION_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DELETE_ACCOUNT_FUNCTION_ASC' + | 'DELETE_ACCOUNT_FUNCTION_DESC' + | 'EMAILS_TABLE_ID_ASC' + | 'EMAILS_TABLE_ID_DESC' + | 'ENCRYPTED_TABLE_ID_ASC' + | 'ENCRYPTED_TABLE_ID_DESC' + | 'EXTEND_TOKEN_EXPIRES_ASC' + | 'EXTEND_TOKEN_EXPIRES_DESC' + | 'FORGOT_PASSWORD_FUNCTION_ASC' + | 'FORGOT_PASSWORD_FUNCTION_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_ASC' + | 'REQUEST_CROSS_ORIGIN_TOKEN_FUNCTION_DESC' + | 'RESET_PASSWORD_FUNCTION_ASC' + | 'RESET_PASSWORD_FUNCTION_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SECRETS_TABLE_ID_ASC' + | 'SECRETS_TABLE_ID_DESC' + | 'SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_ASC' + | 'SEND_ACCOUNT_DELETION_EMAIL_FUNCTION_DESC' + | 'SEND_VERIFICATION_EMAIL_FUNCTION_ASC' + | 'SEND_VERIFICATION_EMAIL_FUNCTION_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SET_PASSWORD_FUNCTION_ASC' + | 'SET_PASSWORD_FUNCTION_DESC' + | 'SIGN_IN_CROSS_ORIGIN_FUNCTION_ASC' + | 'SIGN_IN_CROSS_ORIGIN_FUNCTION_DESC' + | 'SIGN_IN_FUNCTION_ASC' + | 'SIGN_IN_FUNCTION_DESC' + | 'SIGN_OUT_FUNCTION_ASC' + | 'SIGN_OUT_FUNCTION_DESC' + | 'SIGN_UP_FUNCTION_ASC' + | 'SIGN_UP_FUNCTION_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'VERIFY_EMAIL_FUNCTION_ASC' + | 'VERIFY_EMAIL_FUNCTION_DESC' + | 'VERIFY_PASSWORD_FUNCTION_ASC' + | 'VERIFY_PASSWORD_FUNCTION_DESC'; +export type UserCredentialsModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UserSettingsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UserStateModuleOrderBy = + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type UsersModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' + | 'TYPE_TABLE_ID_ASC' + | 'TYPE_TABLE_ID_DESC' + | 'TYPE_TABLE_NAME_ASC' + | 'TYPE_TABLE_NAME_DESC'; +export type WebauthnAuthModuleOrderBy = + | 'ATTESTATION_TYPE_ASC' + | 'ATTESTATION_TYPE_DESC' + | 'AUTH_SETTINGS_TABLE_ID_ASC' + | 'AUTH_SETTINGS_TABLE_ID_DESC' + | 'CHALLENGE_EXPIRY_ASC' + | 'CHALLENGE_EXPIRY_DESC' + | 'CREDENTIALS_TABLE_ID_ASC' + | 'CREDENTIALS_TABLE_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORIGIN_ALLOWLIST_ASC' + | 'ORIGIN_ALLOWLIST_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REQUIRE_USER_VERIFICATION_ASC' + | 'REQUIRE_USER_VERIFICATION_DESC' + | 'RESIDENT_KEY_ASC' + | 'RESIDENT_KEY_DESC' + | 'RP_ID_ASC' + | 'RP_ID_DESC' + | 'RP_NAME_ASC' + | 'RP_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'SESSION_SECRETS_TABLE_ID_ASC' + | 'SESSION_SECRETS_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC'; +export type WebauthnCredentialsModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'OWNER_TABLE_ID_ASC' + | 'OWNER_TABLE_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC'; +export type WebhookModuleOrderBy = + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'ENTITY_FIELD_ASC' + | 'ENTITY_FIELD_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_INVOCATION_MODULE_ID_ASC' + | 'FUNCTION_INVOCATION_MODULE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INFRA_SECRETS_MODULE_ID_ASC' + | 'INFRA_SECRETS_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'NATURAL' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'WEBHOOK_ENDPOINTS_TABLE_ID_ASC' + | 'WEBHOOK_ENDPOINTS_TABLE_ID_DESC' + | 'WEBHOOK_ENDPOINTS_TABLE_NAME_ASC' + | 'WEBHOOK_ENDPOINTS_TABLE_NAME_DESC' + | 'WEBHOOK_EVENTS_TABLE_ID_ASC' + | 'WEBHOOK_EVENTS_TABLE_ID_DESC' + | 'WEBHOOK_EVENTS_TABLE_NAME_ASC' + | 'WEBHOOK_EVENTS_TABLE_NAME_DESC'; // ============ CRUD Input Types ============ export interface CreateAgentModuleInput { clientMutationId?: string; @@ -11414,17 +14435,17 @@ export interface DeleteWebhookModuleInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "Blueprint": { - "blueprintConstructions": "BlueprintConstruction" + Blueprint: { + blueprintConstructions: 'BlueprintConstruction', }, - "BlueprintTemplate": { - "blueprintTemplatesByForkedFromId": "BlueprintTemplate", - "blueprintsByTemplateId": "Blueprint" + BlueprintTemplate: { + blueprintTemplatesByForkedFromId: 'BlueprintTemplate', + blueprintsByTemplateId: 'Blueprint', + }, + MerkleStoreModule: { + dbPresetModules: 'DbPresetModule', + graphModules: 'GraphModule', }, - "MerkleStoreModule": { - "dbPresetModules": "DbPresetModule", - "graphModules": "GraphModule" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ConstructBlueprintInput { @@ -18549,4 +21570,4 @@ export type WebhookModuleEdgeSelect = { node?: { select: WebhookModuleSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/modules/orm/models/agentModule.ts b/sdk/constructive-sdk/src/modules/orm/models/agentModule.ts index 27f6100e9a..ec52583704 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/agentModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/agentModule.ts @@ -3,56 +3,96 @@ * @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 { AgentModule, AgentModuleWithRelations, AgentModuleSelect, AgentModuleFilter, AgentModuleOrderBy, CreateAgentModuleInput, UpdateAgentModuleInput, AgentModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AgentModule, + AgentModuleWithRelations, + AgentModuleSelect, + AgentModuleFilter, + AgentModuleOrderBy, + CreateAgentModuleInput, + UpdateAgentModuleInput, + AgentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AgentModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AgentModule", "agentModules", 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 - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AgentModule', + 'agentModules', + 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, + }, + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModules", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AgentModule", "agentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AgentModule', + 'agentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModule", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AgentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentModule": data.agentModules?.nodes?.[0] ?? null - }) + agentModule: data.agentModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ agentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AgentModule", "agentModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AgentModule', + 'agentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AgentModuleFilter", "AgentModuleOrderBy", connectionFieldsMap); + 'AgentModuleFilter', + 'AgentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AgentModule", - fieldName: "agentModule", + operation: 'query', + operationName: 'AgentModule', + fieldName: 'agentModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AgentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "agentModule": data.agentModules?.nodes?.[0] ?? null - }) + agentModule: data.agentModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AgentModule", "createAgentModule", "agentModule", args.select, args.data, "CreateAgentModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AgentModule', + 'createAgentModule', + 'agentModule', + args.select, + args.data, + 'CreateAgentModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "createAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'createAgentModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AgentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AgentModule", "updateAgentModule", "agentModule", args.select, args.where.id, args.data, "UpdateAgentModuleInput", "id", "agentModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AgentModule', + 'updateAgentModule', + 'agentModule', + args.select, + args.where.id, + args.data, + 'UpdateAgentModuleInput', + 'id', + 'agentModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "updateAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'updateAgentModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAgentModule: { agentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AgentModule", "deleteAgentModule", "agentModule", { - id: args.where.id - }, "DeleteAgentModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AgentModule', + 'deleteAgentModule', + 'agentModule', + { + id: args.where.id, + }, + 'DeleteAgentModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AgentModule", - fieldName: "deleteAgentModule", + operation: 'mutation', + operationName: 'AgentModule', + fieldName: 'deleteAgentModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/apiSurfaceModule.ts b/sdk/constructive-sdk/src/modules/orm/models/apiSurfaceModule.ts index 449acbf127..12cb1d83e3 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/apiSurfaceModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/apiSurfaceModule.ts @@ -3,56 +3,96 @@ * @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 { ApiSurfaceModule, ApiSurfaceModuleWithRelations, ApiSurfaceModuleSelect, ApiSurfaceModuleFilter, ApiSurfaceModuleOrderBy, CreateApiSurfaceModuleInput, UpdateApiSurfaceModuleInput, ApiSurfaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ApiSurfaceModule, + ApiSurfaceModuleWithRelations, + ApiSurfaceModuleSelect, + ApiSurfaceModuleFilter, + ApiSurfaceModuleOrderBy, + CreateApiSurfaceModuleInput, + UpdateApiSurfaceModuleInput, + ApiSurfaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ApiSurfaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSurfaceModule", "apiSurfaceModules", 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 - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + 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, + }, + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModules", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ApiSurfaceModule", "apiSurfaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModule", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ApiSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSurfaceModule": data.apiSurfaceModules?.nodes?.[0] ?? null - }) + apiSurfaceModule: data.apiSurfaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ apiSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ApiSurfaceModule", "apiSurfaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ApiSurfaceModule', + 'apiSurfaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ApiSurfaceModuleFilter", "ApiSurfaceModuleOrderBy", connectionFieldsMap); + 'ApiSurfaceModuleFilter', + 'ApiSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ApiSurfaceModule", - fieldName: "apiSurfaceModule", + operation: 'query', + operationName: 'ApiSurfaceModule', + fieldName: 'apiSurfaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ApiSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "apiSurfaceModule": data.apiSurfaceModules?.nodes?.[0] ?? null - }) + apiSurfaceModule: data.apiSurfaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ApiSurfaceModule", "createApiSurfaceModule", "apiSurfaceModule", args.select, args.data, "CreateApiSurfaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ApiSurfaceModule', + 'createApiSurfaceModule', + 'apiSurfaceModule', + args.select, + args.data, + 'CreateApiSurfaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "createApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'createApiSurfaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ApiSurfaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ApiSurfaceModule", "updateApiSurfaceModule", "apiSurfaceModule", args.select, args.where.id, args.data, "UpdateApiSurfaceModuleInput", "id", "apiSurfaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ApiSurfaceModule', + 'updateApiSurfaceModule', + 'apiSurfaceModule', + args.select, + args.where.id, + args.data, + 'UpdateApiSurfaceModuleInput', + 'id', + 'apiSurfaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "updateApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'updateApiSurfaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteApiSurfaceModule: { apiSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ApiSurfaceModule", "deleteApiSurfaceModule", "apiSurfaceModule", { - id: args.where.id - }, "DeleteApiSurfaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ApiSurfaceModule', + 'deleteApiSurfaceModule', + 'apiSurfaceModule', + { + id: args.where.id, + }, + 'DeleteApiSurfaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ApiSurfaceModule", - fieldName: "deleteApiSurfaceModule", + operation: 'mutation', + operationName: 'ApiSurfaceModule', + fieldName: 'deleteApiSurfaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/appModule.ts b/sdk/constructive-sdk/src/modules/orm/models/appModule.ts index 4a23e0239d..78c5786d0e 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/appModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/appModule.ts @@ -3,56 +3,96 @@ * @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 { AppModule, AppModuleWithRelations, AppModuleSelect, AppModuleFilter, AppModuleOrderBy, CreateAppModuleInput, UpdateAppModuleInput, AppModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppModule, + AppModuleWithRelations, + AppModuleSelect, + AppModuleFilter, + AppModuleOrderBy, + CreateAppModuleInput, + UpdateAppModuleInput, + AppModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppModule", "appModules", 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 - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppModule', + 'appModules', + 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, + }, + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModules", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppModule", "appModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppModule', + 'appModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModule", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "appModule": data.appModules?.nodes?.[0] ?? null - }) + appModule: data.appModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppModule", "appModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppModule', + 'appModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppModuleFilter", "AppModuleOrderBy", connectionFieldsMap); + 'AppModuleFilter', + 'AppModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppModule", - fieldName: "appModule", + operation: 'query', + operationName: 'AppModule', + fieldName: 'appModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "appModule": data.appModules?.nodes?.[0] ?? null - }) + appModule: data.appModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppModule", "createAppModule", "appModule", args.select, args.data, "CreateAppModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppModule', + 'createAppModule', + 'appModule', + args.select, + args.data, + 'CreateAppModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "createAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'createAppModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppModule", "updateAppModule", "appModule", args.select, args.where.id, args.data, "UpdateAppModuleInput", "id", "appModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppModule', + 'updateAppModule', + 'appModule', + args.select, + args.where.id, + args.data, + 'UpdateAppModuleInput', + 'id', + 'appModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "updateAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'updateAppModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppModule: { appModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppModule", "deleteAppModule", "appModule", { - id: args.where.id - }, "DeleteAppModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppModule', + 'deleteAppModule', + 'appModule', + { + id: args.where.id, + }, + 'DeleteAppModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppModule", - fieldName: "deleteAppModule", + operation: 'mutation', + operationName: 'AppModule', + fieldName: 'deleteAppModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/billingModule.ts b/sdk/constructive-sdk/src/modules/orm/models/billingModule.ts index cc721490cc..432eb970f3 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/billingModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/billingModule.ts @@ -3,56 +3,96 @@ * @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 { BillingModule, BillingModuleWithRelations, BillingModuleSelect, BillingModuleFilter, BillingModuleOrderBy, CreateBillingModuleInput, UpdateBillingModuleInput, BillingModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BillingModule, + BillingModuleWithRelations, + BillingModuleSelect, + BillingModuleFilter, + BillingModuleOrderBy, + CreateBillingModuleInput, + UpdateBillingModuleInput, + BillingModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BillingModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("BillingModule", "billingModules", 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 - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BillingModule', + 'billingModules', + 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, + }, + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModules", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BillingModule", "billingModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BillingModule', + 'billingModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModule", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BillingModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingModule": data.billingModules?.nodes?.[0] ?? null - }) + billingModule: data.billingModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ billingModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BillingModule", "billingModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BillingModule', + 'billingModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BillingModuleFilter", "BillingModuleOrderBy", connectionFieldsMap); + 'BillingModuleFilter', + 'BillingModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingModule", - fieldName: "billingModule", + operation: 'query', + operationName: 'BillingModule', + fieldName: 'billingModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BillingModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingModule": data.billingModules?.nodes?.[0] ?? null - }) + billingModule: data.billingModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BillingModule", "createBillingModule", "billingModule", args.select, args.data, "CreateBillingModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BillingModule', + 'createBillingModule', + 'billingModule', + args.select, + args.data, + 'CreateBillingModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "createBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'createBillingModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BillingModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BillingModule", "updateBillingModule", "billingModule", args.select, args.where.id, args.data, "UpdateBillingModuleInput", "id", "billingModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BillingModule', + 'updateBillingModule', + 'billingModule', + args.select, + args.where.id, + args.data, + 'UpdateBillingModuleInput', + 'id', + 'billingModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "updateBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'updateBillingModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBillingModule: { billingModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BillingModule", "deleteBillingModule", "billingModule", { - id: args.where.id - }, "DeleteBillingModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BillingModule', + 'deleteBillingModule', + 'billingModule', + { + id: args.where.id, + }, + 'DeleteBillingModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingModule", - fieldName: "deleteBillingModule", + operation: 'mutation', + operationName: 'BillingModule', + fieldName: 'deleteBillingModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/billingProviderModule.ts b/sdk/constructive-sdk/src/modules/orm/models/billingProviderModule.ts index a6c5d8c34c..16a8a68460 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/billingProviderModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/billingProviderModule.ts @@ -3,56 +3,98 @@ * @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 { BillingProviderModule, BillingProviderModuleWithRelations, BillingProviderModuleSelect, BillingProviderModuleFilter, BillingProviderModuleOrderBy, CreateBillingProviderModuleInput, UpdateBillingProviderModuleInput, BillingProviderModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BillingProviderModule, + BillingProviderModuleWithRelations, + BillingProviderModuleSelect, + BillingProviderModuleFilter, + BillingProviderModuleOrderBy, + CreateBillingProviderModuleInput, + UpdateBillingProviderModuleInput, + BillingProviderModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BillingProviderModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - billingProviderModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + billingProviderModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("BillingProviderModule", "billingProviderModules", 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 - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BillingProviderModule', + 'billingProviderModules', + 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, + }, + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModules", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ billingProviderModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BillingProviderModule", "billingProviderModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BillingProviderModule', + 'billingProviderModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModule", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class BillingProviderModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingProviderModule": data.billingProviderModules?.nodes?.[0] ?? null - }) + billingProviderModule: data.billingProviderModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ billingProviderModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BillingProviderModule", "billingProviderModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BillingProviderModule', + 'billingProviderModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BillingProviderModuleFilter", "BillingProviderModuleOrderBy", connectionFieldsMap); + 'BillingProviderModuleFilter', + 'BillingProviderModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BillingProviderModule", - fieldName: "billingProviderModule", + operation: 'query', + operationName: 'BillingProviderModule', + fieldName: 'billingProviderModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class BillingProviderModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "billingProviderModule": data.billingProviderModules?.nodes?.[0] ?? null - }) + billingProviderModule: data.billingProviderModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BillingProviderModule", "createBillingProviderModule", "billingProviderModule", args.select, args.data, "CreateBillingProviderModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BillingProviderModule', + 'createBillingProviderModule', + 'billingProviderModule', + args.select, + args.data, + 'CreateBillingProviderModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "createBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'createBillingProviderModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BillingProviderModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BillingProviderModule", "updateBillingProviderModule", "billingProviderModule", args.select, args.where.id, args.data, "UpdateBillingProviderModuleInput", "id", "billingProviderModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BillingProviderModule', + 'updateBillingProviderModule', + 'billingProviderModule', + args.select, + args.where.id, + args.data, + 'UpdateBillingProviderModuleInput', + 'id', + 'billingProviderModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "updateBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'updateBillingProviderModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBillingProviderModule: { billingProviderModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BillingProviderModule", "deleteBillingProviderModule", "billingProviderModule", { - id: args.where.id - }, "DeleteBillingProviderModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BillingProviderModule', + 'deleteBillingProviderModule', + 'billingProviderModule', + { + id: args.where.id, + }, + 'DeleteBillingProviderModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BillingProviderModule", - fieldName: "deleteBillingProviderModule", + operation: 'mutation', + operationName: 'BillingProviderModule', + fieldName: 'deleteBillingProviderModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/blueprint.ts b/sdk/constructive-sdk/src/modules/orm/models/blueprint.ts index 10b60d528d..48e4dc3d89 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/blueprint.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/blueprint.ts @@ -3,56 +3,96 @@ * @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 { Blueprint, BlueprintWithRelations, BlueprintSelect, BlueprintFilter, BlueprintOrderBy, CreateBlueprintInput, UpdateBlueprintInput, BlueprintPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Blueprint, + BlueprintWithRelations, + BlueprintSelect, + BlueprintFilter, + BlueprintOrderBy, + CreateBlueprintInput, + UpdateBlueprintInput, + BlueprintPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprints: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Blueprint", "blueprints", 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 - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Blueprint', + 'blueprints', + 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, + }, + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprints", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprints', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Blueprint", "blueprints", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Blueprint', + 'blueprints', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprint", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprint', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BlueprintModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprint": data.blueprints?.nodes?.[0] ?? null - }) + blueprint: data.blueprints?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprint: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Blueprint", "blueprints", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Blueprint', + 'blueprints', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintFilter", "BlueprintOrderBy", connectionFieldsMap); + 'BlueprintFilter', + 'BlueprintOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Blueprint", - fieldName: "blueprint", + operation: 'query', + operationName: 'Blueprint', + fieldName: 'blueprint', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BlueprintModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprint": data.blueprints?.nodes?.[0] ?? null - }) + blueprint: data.blueprints?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Blueprint", "createBlueprint", "blueprint", args.select, args.data, "CreateBlueprintInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Blueprint', + 'createBlueprint', + 'blueprint', + args.select, + args.data, + 'CreateBlueprintInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "createBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'createBlueprint', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Blueprint", "updateBlueprint", "blueprint", args.select, args.where.id, args.data, "UpdateBlueprintInput", "id", "blueprintPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Blueprint', + 'updateBlueprint', + 'blueprint', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintInput', + 'id', + 'blueprintPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "updateBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'updateBlueprint', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprint: { blueprint: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Blueprint", "deleteBlueprint", "blueprint", { - id: args.where.id - }, "DeleteBlueprintInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Blueprint', + 'deleteBlueprint', + 'blueprint', + { + id: args.where.id, + }, + 'DeleteBlueprintInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Blueprint", - fieldName: "deleteBlueprint", + operation: 'mutation', + operationName: 'Blueprint', + fieldName: 'deleteBlueprint', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/blueprintConstruction.ts b/sdk/constructive-sdk/src/modules/orm/models/blueprintConstruction.ts index 3584463b31..ee6a157760 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/blueprintConstruction.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/blueprintConstruction.ts @@ -3,56 +3,98 @@ * @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 { BlueprintConstruction, BlueprintConstructionWithRelations, BlueprintConstructionSelect, BlueprintConstructionFilter, BlueprintConstructionOrderBy, CreateBlueprintConstructionInput, UpdateBlueprintConstructionInput, BlueprintConstructionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BlueprintConstruction, + BlueprintConstructionWithRelations, + BlueprintConstructionSelect, + BlueprintConstructionFilter, + BlueprintConstructionOrderBy, + CreateBlueprintConstructionInput, + UpdateBlueprintConstructionInput, + BlueprintConstructionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintConstructionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - blueprintConstructions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + blueprintConstructions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintConstruction", "blueprintConstructions", 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 - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + 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, + }, + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstructions", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstructions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintConstruction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BlueprintConstruction", "blueprintConstructions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstruction", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstruction', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class BlueprintConstructionModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintConstruction": data.blueprintConstructions?.nodes?.[0] ?? null - }) + blueprintConstruction: data.blueprintConstructions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintConstruction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintConstruction", "blueprintConstructions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BlueprintConstruction', + 'blueprintConstructions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintConstructionFilter", "BlueprintConstructionOrderBy", connectionFieldsMap); + 'BlueprintConstructionFilter', + 'BlueprintConstructionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintConstruction", - fieldName: "blueprintConstruction", + operation: 'query', + operationName: 'BlueprintConstruction', + fieldName: 'blueprintConstruction', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class BlueprintConstructionModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintConstruction": data.blueprintConstructions?.nodes?.[0] ?? null - }) + blueprintConstruction: data.blueprintConstructions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BlueprintConstruction", "createBlueprintConstruction", "blueprintConstruction", args.select, args.data, "CreateBlueprintConstructionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BlueprintConstruction', + 'createBlueprintConstruction', + 'blueprintConstruction', + args.select, + args.data, + 'CreateBlueprintConstructionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "createBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'createBlueprintConstruction', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintConstructionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BlueprintConstruction", "updateBlueprintConstruction", "blueprintConstruction", args.select, args.where.id, args.data, "UpdateBlueprintConstructionInput", "id", "blueprintConstructionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BlueprintConstruction', + 'updateBlueprintConstruction', + 'blueprintConstruction', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintConstructionInput', + 'id', + 'blueprintConstructionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "updateBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'updateBlueprintConstruction', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprintConstruction: { blueprintConstruction: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BlueprintConstruction", "deleteBlueprintConstruction", "blueprintConstruction", { - id: args.where.id - }, "DeleteBlueprintConstructionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BlueprintConstruction', + 'deleteBlueprintConstruction', + 'blueprintConstruction', + { + id: args.where.id, + }, + 'DeleteBlueprintConstructionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintConstruction", - fieldName: "deleteBlueprintConstruction", + operation: 'mutation', + operationName: 'BlueprintConstruction', + fieldName: 'deleteBlueprintConstruction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/blueprintTemplate.ts b/sdk/constructive-sdk/src/modules/orm/models/blueprintTemplate.ts index 92dce7b1c4..486ef1c8e2 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/blueprintTemplate.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/blueprintTemplate.ts @@ -3,56 +3,96 @@ * @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 { BlueprintTemplate, BlueprintTemplateWithRelations, BlueprintTemplateSelect, BlueprintTemplateFilter, BlueprintTemplateOrderBy, CreateBlueprintTemplateInput, UpdateBlueprintTemplateInput, BlueprintTemplatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + BlueprintTemplate, + BlueprintTemplateWithRelations, + BlueprintTemplateSelect, + BlueprintTemplateFilter, + BlueprintTemplateOrderBy, + CreateBlueprintTemplateInput, + UpdateBlueprintTemplateInput, + BlueprintTemplatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class BlueprintTemplateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplates: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintTemplate", "blueprintTemplates", 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 - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + 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, + }, + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplates", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("BlueprintTemplate", "blueprintTemplates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplate", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplate', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class BlueprintTemplateModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintTemplate": data.blueprintTemplates?.nodes?.[0] ?? null - }) + blueprintTemplate: data.blueprintTemplates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ blueprintTemplate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("BlueprintTemplate", "blueprintTemplates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'BlueprintTemplate', + 'blueprintTemplates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "BlueprintTemplateFilter", "BlueprintTemplateOrderBy", connectionFieldsMap); + 'BlueprintTemplateFilter', + 'BlueprintTemplateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "BlueprintTemplate", - fieldName: "blueprintTemplate", + operation: 'query', + operationName: 'BlueprintTemplate', + fieldName: 'blueprintTemplate', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class BlueprintTemplateModel { nodes?: InferSelectResult[]; }; }) => ({ - "blueprintTemplate": data.blueprintTemplates?.nodes?.[0] ?? null - }) + blueprintTemplate: data.blueprintTemplates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("BlueprintTemplate", "createBlueprintTemplate", "blueprintTemplate", args.select, args.data, "CreateBlueprintTemplateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'BlueprintTemplate', + 'createBlueprintTemplate', + 'blueprintTemplate', + args.select, + args.data, + 'CreateBlueprintTemplateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "createBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'createBlueprintTemplate', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + BlueprintTemplatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("BlueprintTemplate", "updateBlueprintTemplate", "blueprintTemplate", args.select, args.where.id, args.data, "UpdateBlueprintTemplateInput", "id", "blueprintTemplatePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'BlueprintTemplate', + 'updateBlueprintTemplate', + 'blueprintTemplate', + args.select, + args.where.id, + args.data, + 'UpdateBlueprintTemplateInput', + 'id', + 'blueprintTemplatePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "updateBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'updateBlueprintTemplate', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteBlueprintTemplate: { blueprintTemplate: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("BlueprintTemplate", "deleteBlueprintTemplate", "blueprintTemplate", { - id: args.where.id - }, "DeleteBlueprintTemplateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'BlueprintTemplate', + 'deleteBlueprintTemplate', + 'blueprintTemplate', + { + id: args.where.id, + }, + 'DeleteBlueprintTemplateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "BlueprintTemplate", - fieldName: "deleteBlueprintTemplate", + operation: 'mutation', + operationName: 'BlueprintTemplate', + fieldName: 'deleteBlueprintTemplate', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/catalogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/catalogModule.ts index 731c29804e..f03b06347e 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/catalogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/catalogModule.ts @@ -3,56 +3,96 @@ * @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 { CatalogModule, CatalogModuleWithRelations, CatalogModuleSelect, CatalogModuleFilter, CatalogModuleOrderBy, CreateCatalogModuleInput, UpdateCatalogModuleInput, CatalogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CatalogModule, + CatalogModuleWithRelations, + CatalogModuleSelect, + CatalogModuleFilter, + CatalogModuleOrderBy, + CreateCatalogModuleInput, + UpdateCatalogModuleInput, + CatalogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CatalogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CatalogModule", "catalogModules", 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 - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CatalogModule', + 'catalogModules', + 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, + }, + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModules", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CatalogModule", "catalogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CatalogModule', + 'catalogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModule", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CatalogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "catalogModule": data.catalogModules?.nodes?.[0] ?? null - }) + catalogModule: data.catalogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ catalogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CatalogModule", "catalogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CatalogModule', + 'catalogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CatalogModuleFilter", "CatalogModuleOrderBy", connectionFieldsMap); + 'CatalogModuleFilter', + 'CatalogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CatalogModule", - fieldName: "catalogModule", + operation: 'query', + operationName: 'CatalogModule', + fieldName: 'catalogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CatalogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "catalogModule": data.catalogModules?.nodes?.[0] ?? null - }) + catalogModule: data.catalogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CatalogModule", "createCatalogModule", "catalogModule", args.select, args.data, "CreateCatalogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CatalogModule', + 'createCatalogModule', + 'catalogModule', + args.select, + args.data, + 'CreateCatalogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "createCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'createCatalogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CatalogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CatalogModule", "updateCatalogModule", "catalogModule", args.select, args.where.id, args.data, "UpdateCatalogModuleInput", "id", "catalogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CatalogModule', + 'updateCatalogModule', + 'catalogModule', + args.select, + args.where.id, + args.data, + 'UpdateCatalogModuleInput', + 'id', + 'catalogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "updateCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'updateCatalogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCatalogModule: { catalogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CatalogModule", "deleteCatalogModule", "catalogModule", { - id: args.where.id - }, "DeleteCatalogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CatalogModule', + 'deleteCatalogModule', + 'catalogModule', + { + id: args.where.id, + }, + 'DeleteCatalogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CatalogModule", - fieldName: "deleteCatalogModule", + operation: 'mutation', + operationName: 'CatalogModule', + fieldName: 'deleteCatalogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/computeLogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/computeLogModule.ts index 042debf2b4..3451b45608 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/computeLogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/computeLogModule.ts @@ -3,56 +3,96 @@ * @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 { ComputeLogModule, ComputeLogModuleWithRelations, ComputeLogModuleSelect, ComputeLogModuleFilter, ComputeLogModuleOrderBy, CreateComputeLogModuleInput, UpdateComputeLogModuleInput, ComputeLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ComputeLogModule, + ComputeLogModuleWithRelations, + ComputeLogModuleSelect, + ComputeLogModuleFilter, + ComputeLogModuleOrderBy, + CreateComputeLogModuleInput, + UpdateComputeLogModuleInput, + ComputeLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ComputeLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ComputeLogModule", "computeLogModules", 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 - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ComputeLogModule', + 'computeLogModules', + 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, + }, + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModules", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ComputeLogModule", "computeLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ComputeLogModule', + 'computeLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModule", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ComputeLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "computeLogModule": data.computeLogModules?.nodes?.[0] ?? null - }) + computeLogModule: data.computeLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ computeLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ComputeLogModule", "computeLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ComputeLogModule', + 'computeLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ComputeLogModuleFilter", "ComputeLogModuleOrderBy", connectionFieldsMap); + 'ComputeLogModuleFilter', + 'ComputeLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ComputeLogModule", - fieldName: "computeLogModule", + operation: 'query', + operationName: 'ComputeLogModule', + fieldName: 'computeLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ComputeLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "computeLogModule": data.computeLogModules?.nodes?.[0] ?? null - }) + computeLogModule: data.computeLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ComputeLogModule", "createComputeLogModule", "computeLogModule", args.select, args.data, "CreateComputeLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ComputeLogModule', + 'createComputeLogModule', + 'computeLogModule', + args.select, + args.data, + 'CreateComputeLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "createComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'createComputeLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ComputeLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ComputeLogModule", "updateComputeLogModule", "computeLogModule", args.select, args.where.id, args.data, "UpdateComputeLogModuleInput", "id", "computeLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ComputeLogModule', + 'updateComputeLogModule', + 'computeLogModule', + args.select, + args.where.id, + args.data, + 'UpdateComputeLogModuleInput', + 'id', + 'computeLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "updateComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'updateComputeLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteComputeLogModule: { computeLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ComputeLogModule", "deleteComputeLogModule", "computeLogModule", { - id: args.where.id - }, "DeleteComputeLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ComputeLogModule', + 'deleteComputeLogModule', + 'computeLogModule', + { + id: args.where.id, + }, + 'DeleteComputeLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ComputeLogModule", - fieldName: "deleteComputeLogModule", + operation: 'mutation', + operationName: 'ComputeLogModule', + fieldName: 'deleteComputeLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/configSecretsUserModule.ts b/sdk/constructive-sdk/src/modules/orm/models/configSecretsUserModule.ts index a910033dff..bd97e5bf01 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/configSecretsUserModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/configSecretsUserModule.ts @@ -3,56 +3,98 @@ * @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 { ConfigSecretsUserModule, ConfigSecretsUserModuleWithRelations, ConfigSecretsUserModuleSelect, ConfigSecretsUserModuleFilter, ConfigSecretsUserModuleOrderBy, CreateConfigSecretsUserModuleInput, UpdateConfigSecretsUserModuleInput, ConfigSecretsUserModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ConfigSecretsUserModule, + ConfigSecretsUserModuleWithRelations, + ConfigSecretsUserModuleSelect, + ConfigSecretsUserModuleFilter, + ConfigSecretsUserModuleOrderBy, + CreateConfigSecretsUserModuleInput, + UpdateConfigSecretsUserModuleInput, + ConfigSecretsUserModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConfigSecretsUserModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - configSecretsUserModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + configSecretsUserModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ConfigSecretsUserModule", "configSecretsUserModules", 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 - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + 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, + }, + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModules", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ configSecretsUserModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ConfigSecretsUserModule", "configSecretsUserModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModule", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ConfigSecretsUserModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "configSecretsUserModule": data.configSecretsUserModules?.nodes?.[0] ?? null - }) + configSecretsUserModule: data.configSecretsUserModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ configSecretsUserModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ConfigSecretsUserModule", "configSecretsUserModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ConfigSecretsUserModule', + 'configSecretsUserModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConfigSecretsUserModuleFilter", "ConfigSecretsUserModuleOrderBy", connectionFieldsMap); + 'ConfigSecretsUserModuleFilter', + 'ConfigSecretsUserModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConfigSecretsUserModule", - fieldName: "configSecretsUserModule", + operation: 'query', + operationName: 'ConfigSecretsUserModule', + fieldName: 'configSecretsUserModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ConfigSecretsUserModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "configSecretsUserModule": data.configSecretsUserModules?.nodes?.[0] ?? null - }) + configSecretsUserModule: data.configSecretsUserModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ConfigSecretsUserModule", "createConfigSecretsUserModule", "configSecretsUserModule", args.select, args.data, "CreateConfigSecretsUserModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ConfigSecretsUserModule', + 'createConfigSecretsUserModule', + 'configSecretsUserModule', + args.select, + args.data, + 'CreateConfigSecretsUserModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "createConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'createConfigSecretsUserModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConfigSecretsUserModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ConfigSecretsUserModule", "updateConfigSecretsUserModule", "configSecretsUserModule", args.select, args.where.id, args.data, "UpdateConfigSecretsUserModuleInput", "id", "configSecretsUserModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ConfigSecretsUserModule', + 'updateConfigSecretsUserModule', + 'configSecretsUserModule', + args.select, + args.where.id, + args.data, + 'UpdateConfigSecretsUserModuleInput', + 'id', + 'configSecretsUserModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "updateConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'updateConfigSecretsUserModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConfigSecretsUserModule: { configSecretsUserModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ConfigSecretsUserModule", "deleteConfigSecretsUserModule", "configSecretsUserModule", { - id: args.where.id - }, "DeleteConfigSecretsUserModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ConfigSecretsUserModule', + 'deleteConfigSecretsUserModule', + 'configSecretsUserModule', + { + id: args.where.id, + }, + 'DeleteConfigSecretsUserModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConfigSecretsUserModule", - fieldName: "deleteConfigSecretsUserModule", + operation: 'mutation', + operationName: 'ConfigSecretsUserModule', + fieldName: 'deleteConfigSecretsUserModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/connectedAccountsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/connectedAccountsModule.ts index 7b725c2754..64b1dc5c4c 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/connectedAccountsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/connectedAccountsModule.ts @@ -3,56 +3,98 @@ * @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 { ConnectedAccountsModule, ConnectedAccountsModuleWithRelations, ConnectedAccountsModuleSelect, ConnectedAccountsModuleFilter, ConnectedAccountsModuleOrderBy, CreateConnectedAccountsModuleInput, UpdateConnectedAccountsModuleInput, ConnectedAccountsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ConnectedAccountsModule, + ConnectedAccountsModuleWithRelations, + ConnectedAccountsModuleSelect, + ConnectedAccountsModuleFilter, + ConnectedAccountsModuleOrderBy, + CreateConnectedAccountsModuleInput, + UpdateConnectedAccountsModuleInput, + ConnectedAccountsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ConnectedAccountsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - connectedAccountsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + connectedAccountsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("ConnectedAccountsModule", "connectedAccountsModules", 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 - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + 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, + }, + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModules", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ connectedAccountsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ConnectedAccountsModule", "connectedAccountsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModule", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class ConnectedAccountsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "connectedAccountsModule": data.connectedAccountsModules?.nodes?.[0] ?? null - }) + connectedAccountsModule: data.connectedAccountsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ connectedAccountsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ConnectedAccountsModule", "connectedAccountsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ConnectedAccountsModule', + 'connectedAccountsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ConnectedAccountsModuleFilter", "ConnectedAccountsModuleOrderBy", connectionFieldsMap); + 'ConnectedAccountsModuleFilter', + 'ConnectedAccountsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ConnectedAccountsModule", - fieldName: "connectedAccountsModule", + operation: 'query', + operationName: 'ConnectedAccountsModule', + fieldName: 'connectedAccountsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class ConnectedAccountsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "connectedAccountsModule": data.connectedAccountsModules?.nodes?.[0] ?? null - }) + connectedAccountsModule: data.connectedAccountsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ConnectedAccountsModule", "createConnectedAccountsModule", "connectedAccountsModule", args.select, args.data, "CreateConnectedAccountsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ConnectedAccountsModule', + 'createConnectedAccountsModule', + 'connectedAccountsModule', + args.select, + args.data, + 'CreateConnectedAccountsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "createConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'createConnectedAccountsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ConnectedAccountsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ConnectedAccountsModule", "updateConnectedAccountsModule", "connectedAccountsModule", args.select, args.where.id, args.data, "UpdateConnectedAccountsModuleInput", "id", "connectedAccountsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ConnectedAccountsModule', + 'updateConnectedAccountsModule', + 'connectedAccountsModule', + args.select, + args.where.id, + args.data, + 'UpdateConnectedAccountsModuleInput', + 'id', + 'connectedAccountsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "updateConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'updateConnectedAccountsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteConnectedAccountsModule: { connectedAccountsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ConnectedAccountsModule", "deleteConnectedAccountsModule", "connectedAccountsModule", { - id: args.where.id - }, "DeleteConnectedAccountsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ConnectedAccountsModule', + 'deleteConnectedAccountsModule', + 'connectedAccountsModule', + { + id: args.where.id, + }, + 'DeleteConnectedAccountsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ConnectedAccountsModule", - fieldName: "deleteConnectedAccountsModule", + operation: 'mutation', + operationName: 'ConnectedAccountsModule', + fieldName: 'deleteConnectedAccountsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/cryptoAddressesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/cryptoAddressesModule.ts index 28b923a35e..c7797726bf 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/cryptoAddressesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/cryptoAddressesModule.ts @@ -3,56 +3,98 @@ * @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 { CryptoAddressesModule, CryptoAddressesModuleWithRelations, CryptoAddressesModuleSelect, CryptoAddressesModuleFilter, CryptoAddressesModuleOrderBy, CreateCryptoAddressesModuleInput, UpdateCryptoAddressesModuleInput, CryptoAddressesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAddressesModule, + CryptoAddressesModuleWithRelations, + CryptoAddressesModuleSelect, + CryptoAddressesModuleFilter, + CryptoAddressesModuleOrderBy, + CreateCryptoAddressesModuleInput, + UpdateCryptoAddressesModuleInput, + CryptoAddressesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAddressesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - cryptoAddressesModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + cryptoAddressesModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddressesModule", "cryptoAddressesModules", 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 - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + 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, + }, + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModules", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddressesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAddressesModule", "cryptoAddressesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModule", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class CryptoAddressesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddressesModule": data.cryptoAddressesModules?.nodes?.[0] ?? null - }) + cryptoAddressesModule: data.cryptoAddressesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAddressesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAddressesModule", "cryptoAddressesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAddressesModule', + 'cryptoAddressesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAddressesModuleFilter", "CryptoAddressesModuleOrderBy", connectionFieldsMap); + 'CryptoAddressesModuleFilter', + 'CryptoAddressesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAddressesModule", - fieldName: "cryptoAddressesModule", + operation: 'query', + operationName: 'CryptoAddressesModule', + fieldName: 'cryptoAddressesModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class CryptoAddressesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAddressesModule": data.cryptoAddressesModules?.nodes?.[0] ?? null - }) + cryptoAddressesModule: data.cryptoAddressesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAddressesModule", "createCryptoAddressesModule", "cryptoAddressesModule", args.select, args.data, "CreateCryptoAddressesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAddressesModule', + 'createCryptoAddressesModule', + 'cryptoAddressesModule', + args.select, + args.data, + 'CreateCryptoAddressesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "createCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'createCryptoAddressesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAddressesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAddressesModule", "updateCryptoAddressesModule", "cryptoAddressesModule", args.select, args.where.id, args.data, "UpdateCryptoAddressesModuleInput", "id", "cryptoAddressesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAddressesModule', + 'updateCryptoAddressesModule', + 'cryptoAddressesModule', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAddressesModuleInput', + 'id', + 'cryptoAddressesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "updateCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'updateCryptoAddressesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAddressesModule: { cryptoAddressesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAddressesModule", "deleteCryptoAddressesModule", "cryptoAddressesModule", { - id: args.where.id - }, "DeleteCryptoAddressesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAddressesModule', + 'deleteCryptoAddressesModule', + 'cryptoAddressesModule', + { + id: args.where.id, + }, + 'DeleteCryptoAddressesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAddressesModule", - fieldName: "deleteCryptoAddressesModule", + operation: 'mutation', + operationName: 'CryptoAddressesModule', + fieldName: 'deleteCryptoAddressesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/cryptoAuthModule.ts b/sdk/constructive-sdk/src/modules/orm/models/cryptoAuthModule.ts index b2bf531ab9..d975e75267 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/cryptoAuthModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/cryptoAuthModule.ts @@ -3,56 +3,96 @@ * @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 { CryptoAuthModule, CryptoAuthModuleWithRelations, CryptoAuthModuleSelect, CryptoAuthModuleFilter, CryptoAuthModuleOrderBy, CreateCryptoAuthModuleInput, UpdateCryptoAuthModuleInput, CryptoAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + CryptoAuthModule, + CryptoAuthModuleWithRelations, + CryptoAuthModuleSelect, + CryptoAuthModuleFilter, + CryptoAuthModuleOrderBy, + CreateCryptoAuthModuleInput, + UpdateCryptoAuthModuleInput, + CryptoAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CryptoAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAuthModule", "cryptoAuthModules", 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 - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + 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, + }, + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModules", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("CryptoAuthModule", "cryptoAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModule", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CryptoAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAuthModule": data.cryptoAuthModules?.nodes?.[0] ?? null - }) + cryptoAuthModule: data.cryptoAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ cryptoAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("CryptoAuthModule", "cryptoAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'CryptoAuthModule', + 'cryptoAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CryptoAuthModuleFilter", "CryptoAuthModuleOrderBy", connectionFieldsMap); + 'CryptoAuthModuleFilter', + 'CryptoAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "CryptoAuthModule", - fieldName: "cryptoAuthModule", + operation: 'query', + operationName: 'CryptoAuthModule', + fieldName: 'cryptoAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class CryptoAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "cryptoAuthModule": data.cryptoAuthModules?.nodes?.[0] ?? null - }) + cryptoAuthModule: data.cryptoAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("CryptoAuthModule", "createCryptoAuthModule", "cryptoAuthModule", args.select, args.data, "CreateCryptoAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'CryptoAuthModule', + 'createCryptoAuthModule', + 'cryptoAuthModule', + args.select, + args.data, + 'CreateCryptoAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "createCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'createCryptoAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + CryptoAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("CryptoAuthModule", "updateCryptoAuthModule", "cryptoAuthModule", args.select, args.where.id, args.data, "UpdateCryptoAuthModuleInput", "id", "cryptoAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'CryptoAuthModule', + 'updateCryptoAuthModule', + 'cryptoAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateCryptoAuthModuleInput', + 'id', + 'cryptoAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "updateCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'updateCryptoAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCryptoAuthModule: { cryptoAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("CryptoAuthModule", "deleteCryptoAuthModule", "cryptoAuthModule", { - id: args.where.id - }, "DeleteCryptoAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'CryptoAuthModule', + 'deleteCryptoAuthModule', + 'cryptoAuthModule', + { + id: args.where.id, + }, + 'DeleteCryptoAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "CryptoAuthModule", - fieldName: "deleteCryptoAuthModule", + operation: 'mutation', + operationName: 'CryptoAuthModule', + fieldName: 'deleteCryptoAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/databaseProvisionModule.ts b/sdk/constructive-sdk/src/modules/orm/models/databaseProvisionModule.ts index dbfd38d4f7..1d9457eed6 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/databaseProvisionModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/databaseProvisionModule.ts @@ -3,56 +3,98 @@ * @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 { DatabaseProvisionModule, DatabaseProvisionModuleWithRelations, DatabaseProvisionModuleSelect, DatabaseProvisionModuleFilter, DatabaseProvisionModuleOrderBy, CreateDatabaseProvisionModuleInput, UpdateDatabaseProvisionModuleInput, DatabaseProvisionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseProvisionModule, + DatabaseProvisionModuleWithRelations, + DatabaseProvisionModuleSelect, + DatabaseProvisionModuleFilter, + DatabaseProvisionModuleOrderBy, + CreateDatabaseProvisionModuleInput, + UpdateDatabaseProvisionModuleInput, + DatabaseProvisionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseProvisionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - databaseProvisionModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + databaseProvisionModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseProvisionModule", "databaseProvisionModules", 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 - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + 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, + }, + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModules", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseProvisionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseProvisionModule", "databaseProvisionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModule", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DatabaseProvisionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseProvisionModule": data.databaseProvisionModules?.nodes?.[0] ?? null - }) + databaseProvisionModule: data.databaseProvisionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseProvisionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseProvisionModule", "databaseProvisionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseProvisionModule', + 'databaseProvisionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseProvisionModuleFilter", "DatabaseProvisionModuleOrderBy", connectionFieldsMap); + 'DatabaseProvisionModuleFilter', + 'DatabaseProvisionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseProvisionModule", - fieldName: "databaseProvisionModule", + operation: 'query', + operationName: 'DatabaseProvisionModule', + fieldName: 'databaseProvisionModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DatabaseProvisionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseProvisionModule": data.databaseProvisionModules?.nodes?.[0] ?? null - }) + databaseProvisionModule: data.databaseProvisionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseProvisionModule", "createDatabaseProvisionModule", "databaseProvisionModule", args.select, args.data, "CreateDatabaseProvisionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseProvisionModule', + 'createDatabaseProvisionModule', + 'databaseProvisionModule', + args.select, + args.data, + 'CreateDatabaseProvisionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "createDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'createDatabaseProvisionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseProvisionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseProvisionModule", "updateDatabaseProvisionModule", "databaseProvisionModule", args.select, args.where.id, args.data, "UpdateDatabaseProvisionModuleInput", "id", "databaseProvisionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseProvisionModule', + 'updateDatabaseProvisionModule', + 'databaseProvisionModule', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseProvisionModuleInput', + 'id', + 'databaseProvisionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "updateDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'updateDatabaseProvisionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseProvisionModule: { databaseProvisionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseProvisionModule", "deleteDatabaseProvisionModule", "databaseProvisionModule", { - id: args.where.id - }, "DeleteDatabaseProvisionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseProvisionModule', + 'deleteDatabaseProvisionModule', + 'databaseProvisionModule', + { + id: args.where.id, + }, + 'DeleteDatabaseProvisionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseProvisionModule", - fieldName: "deleteDatabaseProvisionModule", + operation: 'mutation', + operationName: 'DatabaseProvisionModule', + fieldName: 'deleteDatabaseProvisionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/databaseSettingsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/databaseSettingsModule.ts index 477e77aa01..14e7f06eae 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/databaseSettingsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/databaseSettingsModule.ts @@ -3,56 +3,98 @@ * @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 { DatabaseSettingsModule, DatabaseSettingsModuleWithRelations, DatabaseSettingsModuleSelect, DatabaseSettingsModuleFilter, DatabaseSettingsModuleOrderBy, CreateDatabaseSettingsModuleInput, UpdateDatabaseSettingsModuleInput, DatabaseSettingsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DatabaseSettingsModule, + DatabaseSettingsModuleWithRelations, + DatabaseSettingsModuleSelect, + DatabaseSettingsModuleFilter, + DatabaseSettingsModuleOrderBy, + CreateDatabaseSettingsModuleInput, + UpdateDatabaseSettingsModuleInput, + DatabaseSettingsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DatabaseSettingsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - databaseSettingsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + databaseSettingsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSettingsModule", "databaseSettingsModules", 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 - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + 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, + }, + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModules", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DatabaseSettingsModule", "databaseSettingsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModule", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DatabaseSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSettingsModule": data.databaseSettingsModules?.nodes?.[0] ?? null - }) + databaseSettingsModule: data.databaseSettingsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ databaseSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DatabaseSettingsModule", "databaseSettingsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DatabaseSettingsModule', + 'databaseSettingsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DatabaseSettingsModuleFilter", "DatabaseSettingsModuleOrderBy", connectionFieldsMap); + 'DatabaseSettingsModuleFilter', + 'DatabaseSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DatabaseSettingsModule", - fieldName: "databaseSettingsModule", + operation: 'query', + operationName: 'DatabaseSettingsModule', + fieldName: 'databaseSettingsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DatabaseSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "databaseSettingsModule": data.databaseSettingsModules?.nodes?.[0] ?? null - }) + databaseSettingsModule: data.databaseSettingsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DatabaseSettingsModule", "createDatabaseSettingsModule", "databaseSettingsModule", args.select, args.data, "CreateDatabaseSettingsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DatabaseSettingsModule', + 'createDatabaseSettingsModule', + 'databaseSettingsModule', + args.select, + args.data, + 'CreateDatabaseSettingsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "createDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'createDatabaseSettingsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DatabaseSettingsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DatabaseSettingsModule", "updateDatabaseSettingsModule", "databaseSettingsModule", args.select, args.where.id, args.data, "UpdateDatabaseSettingsModuleInput", "id", "databaseSettingsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DatabaseSettingsModule', + 'updateDatabaseSettingsModule', + 'databaseSettingsModule', + args.select, + args.where.id, + args.data, + 'UpdateDatabaseSettingsModuleInput', + 'id', + 'databaseSettingsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "updateDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'updateDatabaseSettingsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDatabaseSettingsModule: { databaseSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DatabaseSettingsModule", "deleteDatabaseSettingsModule", "databaseSettingsModule", { - id: args.where.id - }, "DeleteDatabaseSettingsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DatabaseSettingsModule', + 'deleteDatabaseSettingsModule', + 'databaseSettingsModule', + { + id: args.where.id, + }, + 'DeleteDatabaseSettingsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DatabaseSettingsModule", - fieldName: "deleteDatabaseSettingsModule", + operation: 'mutation', + operationName: 'DatabaseSettingsModule', + fieldName: 'deleteDatabaseSettingsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/dbPool.ts b/sdk/constructive-sdk/src/modules/orm/models/dbPool.ts index 07b4f67e30..32e26fe980 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/dbPool.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/dbPool.ts @@ -3,56 +3,96 @@ * @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 { DbPool, DbPoolWithRelations, DbPoolSelect, DbPoolFilter, DbPoolOrderBy, CreateDbPoolInput, UpdateDbPoolInput, DbPoolPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPool, + DbPoolWithRelations, + DbPoolSelect, + DbPoolFilter, + DbPoolOrderBy, + CreateDbPoolInput, + UpdateDbPoolInput, + DbPoolPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPoolModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPools: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPool", "dbPools", 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 - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPool', + 'dbPools', + 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, + }, + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPools", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPools', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPool: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPool", "dbPools", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPool', + 'dbPools', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPool", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPool', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPoolModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPool": data.dbPools?.nodes?.[0] ?? null - }) + dbPool: data.dbPools?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPool: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPool", "dbPools", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPool', + 'dbPools', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPoolFilter", "DbPoolOrderBy", connectionFieldsMap); + 'DbPoolFilter', + 'DbPoolOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPool", - fieldName: "dbPool", + operation: 'query', + operationName: 'DbPool', + fieldName: 'dbPool', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPoolModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPool": data.dbPools?.nodes?.[0] ?? null - }) + dbPool: data.dbPools?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPool", "createDbPool", "dbPool", args.select, args.data, "CreateDbPoolInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPool', + 'createDbPool', + 'dbPool', + args.select, + args.data, + 'CreateDbPoolInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "createDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'createDbPool', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPoolPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPool", "updateDbPool", "dbPool", args.select, args.where.id, args.data, "UpdateDbPoolInput", "id", "dbPoolPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPool', + 'updateDbPool', + 'dbPool', + args.select, + args.where.id, + args.data, + 'UpdateDbPoolInput', + 'id', + 'dbPoolPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "updateDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'updateDbPool', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPool: { dbPool: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPool", "deleteDbPool", "dbPool", { - id: args.where.id - }, "DeleteDbPoolInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPool', + 'deleteDbPool', + 'dbPool', + { + id: args.where.id, + }, + 'DeleteDbPoolInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPool", - fieldName: "deleteDbPool", + operation: 'mutation', + operationName: 'DbPool', + fieldName: 'deleteDbPool', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/dbPoolConfig.ts b/sdk/constructive-sdk/src/modules/orm/models/dbPoolConfig.ts index 37a3c62ff5..df67dbab50 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/dbPoolConfig.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/dbPoolConfig.ts @@ -3,56 +3,96 @@ * @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 { DbPoolConfig, DbPoolConfigWithRelations, DbPoolConfigSelect, DbPoolConfigFilter, DbPoolConfigOrderBy, CreateDbPoolConfigInput, UpdateDbPoolConfigInput, DbPoolConfigPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPoolConfig, + DbPoolConfigWithRelations, + DbPoolConfigSelect, + DbPoolConfigFilter, + DbPoolConfigOrderBy, + CreateDbPoolConfigInput, + UpdateDbPoolConfigInput, + DbPoolConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPoolConfigModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfigs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPoolConfig", "dbPoolConfigs", 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 - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + 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, + }, + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfigs", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfigs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPoolConfig", "dbPoolConfigs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfig", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfig', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPoolConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPoolConfig": data.dbPoolConfigs?.nodes?.[0] ?? null - }) + dbPoolConfig: data.dbPoolConfigs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPoolConfig: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPoolConfig", "dbPoolConfigs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPoolConfig', + 'dbPoolConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPoolConfigFilter", "DbPoolConfigOrderBy", connectionFieldsMap); + 'DbPoolConfigFilter', + 'DbPoolConfigOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPoolConfig", - fieldName: "dbPoolConfig", + operation: 'query', + operationName: 'DbPoolConfig', + fieldName: 'dbPoolConfig', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPoolConfigModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPoolConfig": data.dbPoolConfigs?.nodes?.[0] ?? null - }) + dbPoolConfig: data.dbPoolConfigs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPoolConfig", "createDbPoolConfig", "dbPoolConfig", args.select, args.data, "CreateDbPoolConfigInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPoolConfig', + 'createDbPoolConfig', + 'dbPoolConfig', + args.select, + args.data, + 'CreateDbPoolConfigInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "createDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'createDbPoolConfig', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPoolConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPoolConfig", "updateDbPoolConfig", "dbPoolConfig", args.select, args.where.id, args.data, "UpdateDbPoolConfigInput", "id", "dbPoolConfigPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPoolConfig', + 'updateDbPoolConfig', + 'dbPoolConfig', + args.select, + args.where.id, + args.data, + 'UpdateDbPoolConfigInput', + 'id', + 'dbPoolConfigPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "updateDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'updateDbPoolConfig', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPoolConfig: { dbPoolConfig: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPoolConfig", "deleteDbPoolConfig", "dbPoolConfig", { - id: args.where.id - }, "DeleteDbPoolConfigInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPoolConfig', + 'deleteDbPoolConfig', + 'dbPoolConfig', + { + id: args.where.id, + }, + 'DeleteDbPoolConfigInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPoolConfig", - fieldName: "deleteDbPoolConfig", + operation: 'mutation', + operationName: 'DbPoolConfig', + fieldName: 'deleteDbPoolConfig', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/dbPresetModule.ts b/sdk/constructive-sdk/src/modules/orm/models/dbPresetModule.ts index 1a2d12ef9c..e787354cf8 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/dbPresetModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/dbPresetModule.ts @@ -3,56 +3,96 @@ * @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 { DbPresetModule, DbPresetModuleWithRelations, DbPresetModuleSelect, DbPresetModuleFilter, DbPresetModuleOrderBy, CreateDbPresetModuleInput, UpdateDbPresetModuleInput, DbPresetModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbPresetModule, + DbPresetModuleWithRelations, + DbPresetModuleSelect, + DbPresetModuleFilter, + DbPresetModuleOrderBy, + CreateDbPresetModuleInput, + UpdateDbPresetModuleInput, + DbPresetModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbPresetModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbPresetModule", "dbPresetModules", 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 - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbPresetModule', + 'dbPresetModules', + 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, + }, + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModules", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbPresetModule", "dbPresetModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbPresetModule', + 'dbPresetModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModule", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbPresetModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPresetModule": data.dbPresetModules?.nodes?.[0] ?? null - }) + dbPresetModule: data.dbPresetModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbPresetModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbPresetModule", "dbPresetModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbPresetModule', + 'dbPresetModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbPresetModuleFilter", "DbPresetModuleOrderBy", connectionFieldsMap); + 'DbPresetModuleFilter', + 'DbPresetModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbPresetModule", - fieldName: "dbPresetModule", + operation: 'query', + operationName: 'DbPresetModule', + fieldName: 'dbPresetModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbPresetModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbPresetModule": data.dbPresetModules?.nodes?.[0] ?? null - }) + dbPresetModule: data.dbPresetModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbPresetModule", "createDbPresetModule", "dbPresetModule", args.select, args.data, "CreateDbPresetModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbPresetModule', + 'createDbPresetModule', + 'dbPresetModule', + args.select, + args.data, + 'CreateDbPresetModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "createDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'createDbPresetModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbPresetModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbPresetModule", "updateDbPresetModule", "dbPresetModule", args.select, args.where.id, args.data, "UpdateDbPresetModuleInput", "id", "dbPresetModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbPresetModule', + 'updateDbPresetModule', + 'dbPresetModule', + args.select, + args.where.id, + args.data, + 'UpdateDbPresetModuleInput', + 'id', + 'dbPresetModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "updateDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'updateDbPresetModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbPresetModule: { dbPresetModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbPresetModule", "deleteDbPresetModule", "dbPresetModule", { - id: args.where.id - }, "DeleteDbPresetModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbPresetModule', + 'deleteDbPresetModule', + 'dbPresetModule', + { + id: args.where.id, + }, + 'DeleteDbPresetModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbPresetModule", - fieldName: "deleteDbPresetModule", + operation: 'mutation', + operationName: 'DbPresetModule', + fieldName: 'deleteDbPresetModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/dbUsageModule.ts b/sdk/constructive-sdk/src/modules/orm/models/dbUsageModule.ts index 70423a1d03..45fc6b2a64 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/dbUsageModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/dbUsageModule.ts @@ -3,56 +3,96 @@ * @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 { DbUsageModule, DbUsageModuleWithRelations, DbUsageModuleSelect, DbUsageModuleFilter, DbUsageModuleOrderBy, CreateDbUsageModuleInput, UpdateDbUsageModuleInput, DbUsageModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DbUsageModule, + DbUsageModuleWithRelations, + DbUsageModuleSelect, + DbUsageModuleFilter, + DbUsageModuleOrderBy, + CreateDbUsageModuleInput, + UpdateDbUsageModuleInput, + DbUsageModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DbUsageModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DbUsageModule", "dbUsageModules", 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 - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DbUsageModule', + 'dbUsageModules', + 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, + }, + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModules", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DbUsageModule", "dbUsageModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DbUsageModule', + 'dbUsageModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModule", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DbUsageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbUsageModule": data.dbUsageModules?.nodes?.[0] ?? null - }) + dbUsageModule: data.dbUsageModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ dbUsageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DbUsageModule", "dbUsageModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DbUsageModule', + 'dbUsageModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DbUsageModuleFilter", "DbUsageModuleOrderBy", connectionFieldsMap); + 'DbUsageModuleFilter', + 'DbUsageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DbUsageModule", - fieldName: "dbUsageModule", + operation: 'query', + operationName: 'DbUsageModule', + fieldName: 'dbUsageModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DbUsageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "dbUsageModule": data.dbUsageModules?.nodes?.[0] ?? null - }) + dbUsageModule: data.dbUsageModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DbUsageModule", "createDbUsageModule", "dbUsageModule", args.select, args.data, "CreateDbUsageModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DbUsageModule', + 'createDbUsageModule', + 'dbUsageModule', + args.select, + args.data, + 'CreateDbUsageModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "createDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'createDbUsageModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DbUsageModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DbUsageModule", "updateDbUsageModule", "dbUsageModule", args.select, args.where.id, args.data, "UpdateDbUsageModuleInput", "id", "dbUsageModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DbUsageModule', + 'updateDbUsageModule', + 'dbUsageModule', + args.select, + args.where.id, + args.data, + 'UpdateDbUsageModuleInput', + 'id', + 'dbUsageModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "updateDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'updateDbUsageModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDbUsageModule: { dbUsageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DbUsageModule", "deleteDbUsageModule", "dbUsageModule", { - id: args.where.id - }, "DeleteDbUsageModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DbUsageModule', + 'deleteDbUsageModule', + 'dbUsageModule', + { + id: args.where.id, + }, + 'DeleteDbUsageModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DbUsageModule", - fieldName: "deleteDbUsageModule", + operation: 'mutation', + operationName: 'DbUsageModule', + fieldName: 'deleteDbUsageModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/defaultIdsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/defaultIdsModule.ts index 92143e9800..957d0061e4 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/defaultIdsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/defaultIdsModule.ts @@ -3,56 +3,96 @@ * @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 { DefaultIdsModule, DefaultIdsModuleWithRelations, DefaultIdsModuleSelect, DefaultIdsModuleFilter, DefaultIdsModuleOrderBy, CreateDefaultIdsModuleInput, UpdateDefaultIdsModuleInput, DefaultIdsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DefaultIdsModule, + DefaultIdsModuleWithRelations, + DefaultIdsModuleSelect, + DefaultIdsModuleFilter, + DefaultIdsModuleOrderBy, + CreateDefaultIdsModuleInput, + UpdateDefaultIdsModuleInput, + DefaultIdsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DefaultIdsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultIdsModule", "defaultIdsModules", 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 - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + 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, + }, + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModules", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DefaultIdsModule", "defaultIdsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModule", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DefaultIdsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultIdsModule": data.defaultIdsModules?.nodes?.[0] ?? null - }) + defaultIdsModule: data.defaultIdsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ defaultIdsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DefaultIdsModule", "defaultIdsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DefaultIdsModule', + 'defaultIdsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DefaultIdsModuleFilter", "DefaultIdsModuleOrderBy", connectionFieldsMap); + 'DefaultIdsModuleFilter', + 'DefaultIdsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DefaultIdsModule", - fieldName: "defaultIdsModule", + operation: 'query', + operationName: 'DefaultIdsModule', + fieldName: 'defaultIdsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DefaultIdsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "defaultIdsModule": data.defaultIdsModules?.nodes?.[0] ?? null - }) + defaultIdsModule: data.defaultIdsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DefaultIdsModule", "createDefaultIdsModule", "defaultIdsModule", args.select, args.data, "CreateDefaultIdsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DefaultIdsModule', + 'createDefaultIdsModule', + 'defaultIdsModule', + args.select, + args.data, + 'CreateDefaultIdsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "createDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'createDefaultIdsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DefaultIdsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DefaultIdsModule", "updateDefaultIdsModule", "defaultIdsModule", args.select, args.where.id, args.data, "UpdateDefaultIdsModuleInput", "id", "defaultIdsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DefaultIdsModule', + 'updateDefaultIdsModule', + 'defaultIdsModule', + args.select, + args.where.id, + args.data, + 'UpdateDefaultIdsModuleInput', + 'id', + 'defaultIdsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "updateDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'updateDefaultIdsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDefaultIdsModule: { defaultIdsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DefaultIdsModule", "deleteDefaultIdsModule", "defaultIdsModule", { - id: args.where.id - }, "DeleteDefaultIdsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DefaultIdsModule', + 'deleteDefaultIdsModule', + 'defaultIdsModule', + { + id: args.where.id, + }, + 'DeleteDefaultIdsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DefaultIdsModule", - fieldName: "deleteDefaultIdsModule", + operation: 'mutation', + operationName: 'DefaultIdsModule', + fieldName: 'deleteDefaultIdsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/denormalizedTableField.ts b/sdk/constructive-sdk/src/modules/orm/models/denormalizedTableField.ts index 2f529dcb80..bdc83099a2 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/denormalizedTableField.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/denormalizedTableField.ts @@ -3,56 +3,98 @@ * @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 { DenormalizedTableField, DenormalizedTableFieldWithRelations, DenormalizedTableFieldSelect, DenormalizedTableFieldFilter, DenormalizedTableFieldOrderBy, CreateDenormalizedTableFieldInput, UpdateDenormalizedTableFieldInput, DenormalizedTableFieldPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DenormalizedTableField, + DenormalizedTableFieldWithRelations, + DenormalizedTableFieldSelect, + DenormalizedTableFieldFilter, + DenormalizedTableFieldOrderBy, + CreateDenormalizedTableFieldInput, + UpdateDenormalizedTableFieldInput, + DenormalizedTableFieldPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DenormalizedTableFieldModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - denormalizedTableFields: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + denormalizedTableFields: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("DenormalizedTableField", "denormalizedTableFields", 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 - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + 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, + }, + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableFields", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableFields', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ denormalizedTableField: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DenormalizedTableField", "denormalizedTableFields", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableField", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableField', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class DenormalizedTableFieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "denormalizedTableField": data.denormalizedTableFields?.nodes?.[0] ?? null - }) + denormalizedTableField: data.denormalizedTableFields?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ denormalizedTableField: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DenormalizedTableField", "denormalizedTableFields", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DenormalizedTableField', + 'denormalizedTableFields', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DenormalizedTableFieldFilter", "DenormalizedTableFieldOrderBy", connectionFieldsMap); + 'DenormalizedTableFieldFilter', + 'DenormalizedTableFieldOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DenormalizedTableField", - fieldName: "denormalizedTableField", + operation: 'query', + operationName: 'DenormalizedTableField', + fieldName: 'denormalizedTableField', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class DenormalizedTableFieldModel { nodes?: InferSelectResult[]; }; }) => ({ - "denormalizedTableField": data.denormalizedTableFields?.nodes?.[0] ?? null - }) + denormalizedTableField: data.denormalizedTableFields?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DenormalizedTableField", "createDenormalizedTableField", "denormalizedTableField", args.select, args.data, "CreateDenormalizedTableFieldInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DenormalizedTableField', + 'createDenormalizedTableField', + 'denormalizedTableField', + args.select, + args.data, + 'CreateDenormalizedTableFieldInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "createDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'createDenormalizedTableField', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DenormalizedTableFieldPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DenormalizedTableField", "updateDenormalizedTableField", "denormalizedTableField", args.select, args.where.id, args.data, "UpdateDenormalizedTableFieldInput", "id", "denormalizedTableFieldPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DenormalizedTableField', + 'updateDenormalizedTableField', + 'denormalizedTableField', + args.select, + args.where.id, + args.data, + 'UpdateDenormalizedTableFieldInput', + 'id', + 'denormalizedTableFieldPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "updateDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'updateDenormalizedTableField', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDenormalizedTableField: { denormalizedTableField: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DenormalizedTableField", "deleteDenormalizedTableField", "denormalizedTableField", { - id: args.where.id - }, "DeleteDenormalizedTableFieldInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DenormalizedTableField', + 'deleteDenormalizedTableField', + 'denormalizedTableField', + { + id: args.where.id, + }, + 'DeleteDenormalizedTableFieldInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DenormalizedTableField", - fieldName: "deleteDenormalizedTableField", + operation: 'mutation', + operationName: 'DenormalizedTableField', + fieldName: 'deleteDenormalizedTableField', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/devicesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/devicesModule.ts index 532e5e6598..8dc6cf5282 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/devicesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/devicesModule.ts @@ -3,56 +3,96 @@ * @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 { DevicesModule, DevicesModuleWithRelations, DevicesModuleSelect, DevicesModuleFilter, DevicesModuleOrderBy, CreateDevicesModuleInput, UpdateDevicesModuleInput, DevicesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DevicesModule, + DevicesModuleWithRelations, + DevicesModuleSelect, + DevicesModuleFilter, + DevicesModuleOrderBy, + CreateDevicesModuleInput, + UpdateDevicesModuleInput, + DevicesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DevicesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DevicesModule", "devicesModules", 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 - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + 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, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModules", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DevicesModule", "devicesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModule", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DevicesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "devicesModule": data.devicesModules?.nodes?.[0] ?? null - }) + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ devicesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DevicesModule", "devicesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DevicesModule', + 'devicesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DevicesModuleFilter", "DevicesModuleOrderBy", connectionFieldsMap); + 'DevicesModuleFilter', + 'DevicesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DevicesModule", - fieldName: "devicesModule", + operation: 'query', + operationName: 'DevicesModule', + fieldName: 'devicesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DevicesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "devicesModule": data.devicesModules?.nodes?.[0] ?? null - }) + devicesModule: data.devicesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DevicesModule", "createDevicesModule", "devicesModule", args.select, args.data, "CreateDevicesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DevicesModule', + 'createDevicesModule', + 'devicesModule', + args.select, + args.data, + 'CreateDevicesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "createDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'createDevicesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DevicesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DevicesModule", "updateDevicesModule", "devicesModule", args.select, args.where.id, args.data, "UpdateDevicesModuleInput", "id", "devicesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DevicesModule', + 'updateDevicesModule', + 'devicesModule', + args.select, + args.where.id, + args.data, + 'UpdateDevicesModuleInput', + 'id', + 'devicesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "updateDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'updateDevicesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDevicesModule: { devicesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DevicesModule", "deleteDevicesModule", "devicesModule", { - id: args.where.id - }, "DeleteDevicesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DevicesModule', + 'deleteDevicesModule', + 'devicesModule', + { + id: args.where.id, + }, + 'DeleteDevicesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DevicesModule", - fieldName: "deleteDevicesModule", + operation: 'mutation', + operationName: 'DevicesModule', + fieldName: 'deleteDevicesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/domainModule.ts b/sdk/constructive-sdk/src/modules/orm/models/domainModule.ts index a8f1588a9c..fd1f536225 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/domainModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/domainModule.ts @@ -3,56 +3,96 @@ * @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 { DomainModule, DomainModuleWithRelations, DomainModuleSelect, DomainModuleFilter, DomainModuleOrderBy, CreateDomainModuleInput, UpdateDomainModuleInput, DomainModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + DomainModule, + DomainModuleWithRelations, + DomainModuleSelect, + DomainModuleFilter, + DomainModuleOrderBy, + CreateDomainModuleInput, + UpdateDomainModuleInput, + DomainModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class DomainModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("DomainModule", "domainModules", 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 - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'DomainModule', + 'domainModules', + 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, + }, + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModules", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("DomainModule", "domainModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'DomainModule', + 'domainModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModule", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class DomainModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainModule": data.domainModules?.nodes?.[0] ?? null - }) + domainModule: data.domainModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ domainModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("DomainModule", "domainModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'DomainModule', + 'domainModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "DomainModuleFilter", "DomainModuleOrderBy", connectionFieldsMap); + 'DomainModuleFilter', + 'DomainModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "DomainModule", - fieldName: "domainModule", + operation: 'query', + operationName: 'DomainModule', + fieldName: 'domainModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class DomainModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "domainModule": data.domainModules?.nodes?.[0] ?? null - }) + domainModule: data.domainModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("DomainModule", "createDomainModule", "domainModule", args.select, args.data, "CreateDomainModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'DomainModule', + 'createDomainModule', + 'domainModule', + args.select, + args.data, + 'CreateDomainModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "createDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'createDomainModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + DomainModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("DomainModule", "updateDomainModule", "domainModule", args.select, args.where.id, args.data, "UpdateDomainModuleInput", "id", "domainModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'DomainModule', + 'updateDomainModule', + 'domainModule', + args.select, + args.where.id, + args.data, + 'UpdateDomainModuleInput', + 'id', + 'domainModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "updateDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'updateDomainModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteDomainModule: { domainModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("DomainModule", "deleteDomainModule", "domainModule", { - id: args.where.id - }, "DeleteDomainModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'DomainModule', + 'deleteDomainModule', + 'domainModule', + { + id: args.where.id, + }, + 'DeleteDomainModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "DomainModule", - fieldName: "deleteDomainModule", + operation: 'mutation', + operationName: 'DomainModule', + fieldName: 'deleteDomainModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/emailsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/emailsModule.ts index 5b13919a98..f3a2297a8a 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/emailsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/emailsModule.ts @@ -3,56 +3,96 @@ * @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 { EmailsModule, EmailsModuleWithRelations, EmailsModuleSelect, EmailsModuleFilter, EmailsModuleOrderBy, CreateEmailsModuleInput, UpdateEmailsModuleInput, EmailsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EmailsModule, + EmailsModuleWithRelations, + EmailsModuleSelect, + EmailsModuleFilter, + EmailsModuleOrderBy, + CreateEmailsModuleInput, + UpdateEmailsModuleInput, + EmailsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EmailsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EmailsModule", "emailsModules", 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 - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EmailsModule', + 'emailsModules', + 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, + }, + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModules", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EmailsModule", "emailsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EmailsModule', + 'emailsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModule", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EmailsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "emailsModule": data.emailsModules?.nodes?.[0] ?? null - }) + emailsModule: data.emailsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ emailsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EmailsModule", "emailsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EmailsModule', + 'emailsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EmailsModuleFilter", "EmailsModuleOrderBy", connectionFieldsMap); + 'EmailsModuleFilter', + 'EmailsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EmailsModule", - fieldName: "emailsModule", + operation: 'query', + operationName: 'EmailsModule', + fieldName: 'emailsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EmailsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "emailsModule": data.emailsModules?.nodes?.[0] ?? null - }) + emailsModule: data.emailsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EmailsModule", "createEmailsModule", "emailsModule", args.select, args.data, "CreateEmailsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EmailsModule', + 'createEmailsModule', + 'emailsModule', + args.select, + args.data, + 'CreateEmailsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "createEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'createEmailsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EmailsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EmailsModule", "updateEmailsModule", "emailsModule", args.select, args.where.id, args.data, "UpdateEmailsModuleInput", "id", "emailsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EmailsModule', + 'updateEmailsModule', + 'emailsModule', + args.select, + args.where.id, + args.data, + 'UpdateEmailsModuleInput', + 'id', + 'emailsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "updateEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'updateEmailsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEmailsModule: { emailsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EmailsModule", "deleteEmailsModule", "emailsModule", { - id: args.where.id - }, "DeleteEmailsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EmailsModule', + 'deleteEmailsModule', + 'emailsModule', + { + id: args.where.id, + }, + 'DeleteEmailsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EmailsModule", - fieldName: "deleteEmailsModule", + operation: 'mutation', + operationName: 'EmailsModule', + fieldName: 'deleteEmailsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/entityTypeProvision.ts b/sdk/constructive-sdk/src/modules/orm/models/entityTypeProvision.ts index 5d95a2d830..c8e87d8f9c 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/entityTypeProvision.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/entityTypeProvision.ts @@ -3,56 +3,96 @@ * @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 { EntityTypeProvision, EntityTypeProvisionWithRelations, EntityTypeProvisionSelect, EntityTypeProvisionFilter, EntityTypeProvisionOrderBy, CreateEntityTypeProvisionInput, UpdateEntityTypeProvisionInput, EntityTypeProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EntityTypeProvision, + EntityTypeProvisionWithRelations, + EntityTypeProvisionSelect, + EntityTypeProvisionFilter, + EntityTypeProvisionOrderBy, + CreateEntityTypeProvisionInput, + UpdateEntityTypeProvisionInput, + EntityTypeProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EntityTypeProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvisions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EntityTypeProvision", "entityTypeProvisions", 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 - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + 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, + }, + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvisions", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EntityTypeProvision", "entityTypeProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvision", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvision', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EntityTypeProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "entityTypeProvision": data.entityTypeProvisions?.nodes?.[0] ?? null - }) + entityTypeProvision: data.entityTypeProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ entityTypeProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EntityTypeProvision", "entityTypeProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EntityTypeProvision', + 'entityTypeProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EntityTypeProvisionFilter", "EntityTypeProvisionOrderBy", connectionFieldsMap); + 'EntityTypeProvisionFilter', + 'EntityTypeProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EntityTypeProvision", - fieldName: "entityTypeProvision", + operation: 'query', + operationName: 'EntityTypeProvision', + fieldName: 'entityTypeProvision', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EntityTypeProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "entityTypeProvision": data.entityTypeProvisions?.nodes?.[0] ?? null - }) + entityTypeProvision: data.entityTypeProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EntityTypeProvision", "createEntityTypeProvision", "entityTypeProvision", args.select, args.data, "CreateEntityTypeProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EntityTypeProvision', + 'createEntityTypeProvision', + 'entityTypeProvision', + args.select, + args.data, + 'CreateEntityTypeProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "createEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'createEntityTypeProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EntityTypeProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EntityTypeProvision", "updateEntityTypeProvision", "entityTypeProvision", args.select, args.where.id, args.data, "UpdateEntityTypeProvisionInput", "id", "entityTypeProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EntityTypeProvision', + 'updateEntityTypeProvision', + 'entityTypeProvision', + args.select, + args.where.id, + args.data, + 'UpdateEntityTypeProvisionInput', + 'id', + 'entityTypeProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "updateEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'updateEntityTypeProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEntityTypeProvision: { entityTypeProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EntityTypeProvision", "deleteEntityTypeProvision", "entityTypeProvision", { - id: args.where.id - }, "DeleteEntityTypeProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EntityTypeProvision', + 'deleteEntityTypeProvision', + 'entityTypeProvision', + { + id: args.where.id, + }, + 'DeleteEntityTypeProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EntityTypeProvision", - fieldName: "deleteEntityTypeProvision", + operation: 'mutation', + operationName: 'EntityTypeProvision', + fieldName: 'deleteEntityTypeProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/eventsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/eventsModule.ts index a60011d618..0f07d39979 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/eventsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/eventsModule.ts @@ -3,56 +3,96 @@ * @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 { EventsModule, EventsModuleWithRelations, EventsModuleSelect, EventsModuleFilter, EventsModuleOrderBy, CreateEventsModuleInput, UpdateEventsModuleInput, EventsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + EventsModule, + EventsModuleWithRelations, + EventsModuleSelect, + EventsModuleFilter, + EventsModuleOrderBy, + CreateEventsModuleInput, + UpdateEventsModuleInput, + EventsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class EventsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("EventsModule", "eventsModules", 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 - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'EventsModule', + 'eventsModules', + 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, + }, + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModules", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("EventsModule", "eventsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'EventsModule', + 'eventsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModule", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class EventsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "eventsModule": data.eventsModules?.nodes?.[0] ?? null - }) + eventsModule: data.eventsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ eventsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("EventsModule", "eventsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'EventsModule', + 'eventsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "EventsModuleFilter", "EventsModuleOrderBy", connectionFieldsMap); + 'EventsModuleFilter', + 'EventsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "EventsModule", - fieldName: "eventsModule", + operation: 'query', + operationName: 'EventsModule', + fieldName: 'eventsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class EventsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "eventsModule": data.eventsModules?.nodes?.[0] ?? null - }) + eventsModule: data.eventsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("EventsModule", "createEventsModule", "eventsModule", args.select, args.data, "CreateEventsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'EventsModule', + 'createEventsModule', + 'eventsModule', + args.select, + args.data, + 'CreateEventsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "createEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'createEventsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + EventsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("EventsModule", "updateEventsModule", "eventsModule", args.select, args.where.id, args.data, "UpdateEventsModuleInput", "id", "eventsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'EventsModule', + 'updateEventsModule', + 'eventsModule', + args.select, + args.where.id, + args.data, + 'UpdateEventsModuleInput', + 'id', + 'eventsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "updateEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'updateEventsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteEventsModule: { eventsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("EventsModule", "deleteEventsModule", "eventsModule", { - id: args.where.id - }, "DeleteEventsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'EventsModule', + 'deleteEventsModule', + 'eventsModule', + { + id: args.where.id, + }, + 'DeleteEventsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "EventsModule", - fieldName: "deleteEventsModule", + operation: 'mutation', + operationName: 'EventsModule', + fieldName: 'deleteEventsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/functionDeploymentModule.ts b/sdk/constructive-sdk/src/modules/orm/models/functionDeploymentModule.ts index c3cec9d613..afe50267f8 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/functionDeploymentModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/functionDeploymentModule.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { FunctionDeploymentModule, FunctionDeploymentModuleWithRelations, FunctionDeploymentModuleSelect, FunctionDeploymentModuleFilter, FunctionDeploymentModuleOrderBy, CreateFunctionDeploymentModuleInput, UpdateFunctionDeploymentModuleInput, FunctionDeploymentModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentModule, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, + CreateFunctionDeploymentModuleInput, + UpdateFunctionDeploymentModuleInput, + FunctionDeploymentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionDeploymentModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionDeploymentModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModules", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModule", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionDeploymentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentModule": data.functionDeploymentModules?.nodes?.[0] ?? null - }) + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionDeploymentModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionDeploymentModule", "functionDeploymentModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionDeploymentModuleFilter", "FunctionDeploymentModuleOrderBy", connectionFieldsMap); + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionDeploymentModule", - fieldName: "functionDeploymentModule", + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class FunctionDeploymentModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionDeploymentModule": data.functionDeploymentModules?.nodes?.[0] ?? null - }) + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionDeploymentModule", "createFunctionDeploymentModule", "functionDeploymentModule", args.select, args.data, "CreateFunctionDeploymentModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentModule', + 'createFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.data, + 'CreateFunctionDeploymentModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "createFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'createFunctionDeploymentModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionDeploymentModule", "updateFunctionDeploymentModule", "functionDeploymentModule", args.select, args.where.id, args.data, "UpdateFunctionDeploymentModuleInput", "id", "functionDeploymentModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentModule', + 'updateFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentModuleInput', + 'id', + 'functionDeploymentModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "updateFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'updateFunctionDeploymentModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionDeploymentModule: { functionDeploymentModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionDeploymentModule", "deleteFunctionDeploymentModule", "functionDeploymentModule", { - id: args.where.id - }, "DeleteFunctionDeploymentModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentModule', + 'deleteFunctionDeploymentModule', + 'functionDeploymentModule', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionDeploymentModule", - fieldName: "deleteFunctionDeploymentModule", + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'deleteFunctionDeploymentModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/functionInvocationModule.ts b/sdk/constructive-sdk/src/modules/orm/models/functionInvocationModule.ts index 45fc3f9127..ba40e892ea 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/functionInvocationModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/functionInvocationModule.ts @@ -3,56 +3,98 @@ * @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 { FunctionInvocationModule, FunctionInvocationModuleWithRelations, FunctionInvocationModuleSelect, FunctionInvocationModuleFilter, FunctionInvocationModuleOrderBy, CreateFunctionInvocationModuleInput, UpdateFunctionInvocationModuleInput, FunctionInvocationModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionInvocationModule, + FunctionInvocationModuleWithRelations, + FunctionInvocationModuleSelect, + FunctionInvocationModuleFilter, + FunctionInvocationModuleOrderBy, + CreateFunctionInvocationModuleInput, + UpdateFunctionInvocationModuleInput, + FunctionInvocationModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionInvocationModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - functionInvocationModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocationModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationModule", "functionInvocationModules", 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 - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + 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, + }, + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModules", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionInvocationModule", "functionInvocationModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModule", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class FunctionInvocationModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationModule": data.functionInvocationModules?.nodes?.[0] ?? null - }) + functionInvocationModule: data.functionInvocationModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionInvocationModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionInvocationModule", "functionInvocationModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionInvocationModule', + 'functionInvocationModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionInvocationModuleFilter", "FunctionInvocationModuleOrderBy", connectionFieldsMap); + 'FunctionInvocationModuleFilter', + 'FunctionInvocationModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionInvocationModule", - fieldName: "functionInvocationModule", + operation: 'query', + operationName: 'FunctionInvocationModule', + fieldName: 'functionInvocationModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class FunctionInvocationModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionInvocationModule": data.functionInvocationModules?.nodes?.[0] ?? null - }) + functionInvocationModule: data.functionInvocationModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionInvocationModule", "createFunctionInvocationModule", "functionInvocationModule", args.select, args.data, "CreateFunctionInvocationModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionInvocationModule', + 'createFunctionInvocationModule', + 'functionInvocationModule', + args.select, + args.data, + 'CreateFunctionInvocationModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "createFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'createFunctionInvocationModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionInvocationModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionInvocationModule", "updateFunctionInvocationModule", "functionInvocationModule", args.select, args.where.id, args.data, "UpdateFunctionInvocationModuleInput", "id", "functionInvocationModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocationModule', + 'updateFunctionInvocationModule', + 'functionInvocationModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationModuleInput', + 'id', + 'functionInvocationModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "updateFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'updateFunctionInvocationModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionInvocationModule: { functionInvocationModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionInvocationModule", "deleteFunctionInvocationModule", "functionInvocationModule", { - id: args.where.id - }, "DeleteFunctionInvocationModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocationModule', + 'deleteFunctionInvocationModule', + 'functionInvocationModule', + { + id: args.where.id, + }, + 'DeleteFunctionInvocationModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionInvocationModule", - fieldName: "deleteFunctionInvocationModule", + operation: 'mutation', + operationName: 'FunctionInvocationModule', + fieldName: 'deleteFunctionInvocationModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/functionModule.ts b/sdk/constructive-sdk/src/modules/orm/models/functionModule.ts index af5039e9a4..7e127377dd 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/functionModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/functionModule.ts @@ -3,56 +3,96 @@ * @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 { FunctionModule, FunctionModuleWithRelations, FunctionModuleSelect, FunctionModuleFilter, FunctionModuleOrderBy, CreateFunctionModuleInput, UpdateFunctionModuleInput, FunctionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + FunctionModule, + FunctionModuleWithRelations, + FunctionModuleSelect, + FunctionModuleFilter, + FunctionModuleOrderBy, + CreateFunctionModuleInput, + UpdateFunctionModuleInput, + FunctionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class FunctionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionModule", "functionModules", 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 - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'FunctionModule', + 'functionModules', + 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, + }, + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModules", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("FunctionModule", "functionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'FunctionModule', + 'functionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModule", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class FunctionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionModule": data.functionModules?.nodes?.[0] ?? null - }) + functionModule: data.functionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ functionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("FunctionModule", "functionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'FunctionModule', + 'functionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "FunctionModuleFilter", "FunctionModuleOrderBy", connectionFieldsMap); + 'FunctionModuleFilter', + 'FunctionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "FunctionModule", - fieldName: "functionModule", + operation: 'query', + operationName: 'FunctionModule', + fieldName: 'functionModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class FunctionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "functionModule": data.functionModules?.nodes?.[0] ?? null - }) + functionModule: data.functionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("FunctionModule", "createFunctionModule", "functionModule", args.select, args.data, "CreateFunctionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'FunctionModule', + 'createFunctionModule', + 'functionModule', + args.select, + args.data, + 'CreateFunctionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "createFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'createFunctionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("FunctionModule", "updateFunctionModule", "functionModule", args.select, args.where.id, args.data, "UpdateFunctionModuleInput", "id", "functionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'FunctionModule', + 'updateFunctionModule', + 'functionModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionModuleInput', + 'id', + 'functionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "updateFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'updateFunctionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteFunctionModule: { functionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("FunctionModule", "deleteFunctionModule", "functionModule", { - id: args.where.id - }, "DeleteFunctionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'FunctionModule', + 'deleteFunctionModule', + 'functionModule', + { + id: args.where.id, + }, + 'DeleteFunctionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "FunctionModule", - fieldName: "deleteFunctionModule", + operation: 'mutation', + operationName: 'FunctionModule', + fieldName: 'deleteFunctionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/graphExecutionModule.ts b/sdk/constructive-sdk/src/modules/orm/models/graphExecutionModule.ts index 9f71b75b40..9f1866c036 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/graphExecutionModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/graphExecutionModule.ts @@ -3,56 +3,98 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument } from "../query-builder"; -import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from "../select-types"; -import type { GraphExecutionModule, GraphExecutionModuleWithRelations, GraphExecutionModuleSelect, GraphExecutionModuleFilter, GraphExecutionModuleOrderBy, CreateGraphExecutionModuleInput, UpdateGraphExecutionModuleInput, GraphExecutionModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GraphExecutionModule, + GraphExecutionModuleWithRelations, + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, + CreateGraphExecutionModuleInput, + UpdateGraphExecutionModuleInput, + GraphExecutionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GraphExecutionModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - graphExecutionModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined, - first: args?.first, - last: args?.last, - after: args?.after, - before: args?.before, - offset: args?.offset - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModules", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphExecutionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModule", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class GraphExecutionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphExecutionModule": data.graphExecutionModules?.nodes?.[0] ?? null - }) + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ graphExecutionModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("GraphExecutionModule", "graphExecutionModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "GraphExecutionModuleFilter", "GraphExecutionModuleOrderBy", connectionFieldsMap); + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphExecutionModule", - fieldName: "graphExecutionModule", + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class GraphExecutionModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphExecutionModule": data.graphExecutionModules?.nodes?.[0] ?? null - }) + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GraphExecutionModule", "createGraphExecutionModule", "graphExecutionModule", args.select, args.data, "CreateGraphExecutionModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GraphExecutionModule', + 'createGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.data, + 'CreateGraphExecutionModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "createGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'createGraphExecutionModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphExecutionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("GraphExecutionModule", "updateGraphExecutionModule", "graphExecutionModule", args.select, args.where.id, args.data, "UpdateGraphExecutionModuleInput", "id", "graphExecutionModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'GraphExecutionModule', + 'updateGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphExecutionModuleInput', + 'id', + 'graphExecutionModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "updateGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'updateGraphExecutionModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteGraphExecutionModule: { graphExecutionModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("GraphExecutionModule", "deleteGraphExecutionModule", "graphExecutionModule", { - id: args.where.id - }, "DeleteGraphExecutionModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'GraphExecutionModule', + 'deleteGraphExecutionModule', + 'graphExecutionModule', + { + id: args.where.id, + }, + 'DeleteGraphExecutionModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphExecutionModule", - fieldName: "deleteGraphExecutionModule", + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'deleteGraphExecutionModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/graphModule.ts b/sdk/constructive-sdk/src/modules/orm/models/graphModule.ts index a7fa776384..f337b77ed9 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/graphModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/graphModule.ts @@ -3,56 +3,96 @@ * @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 { GraphModule, GraphModuleWithRelations, GraphModuleSelect, GraphModuleFilter, GraphModuleOrderBy, CreateGraphModuleInput, UpdateGraphModuleInput, GraphModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GraphModule, + GraphModuleWithRelations, + GraphModuleSelect, + GraphModuleFilter, + GraphModuleOrderBy, + CreateGraphModuleInput, + UpdateGraphModuleInput, + GraphModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GraphModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GraphModule", "graphModules", 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 - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GraphModule', + 'graphModules', + 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, + }, + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModules", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GraphModule", "graphModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GraphModule', + 'graphModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModule", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class GraphModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphModule": data.graphModules?.nodes?.[0] ?? null - }) + graphModule: data.graphModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ graphModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("GraphModule", "graphModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'GraphModule', + 'graphModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "GraphModuleFilter", "GraphModuleOrderBy", connectionFieldsMap); + 'GraphModuleFilter', + 'GraphModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GraphModule", - fieldName: "graphModule", + operation: 'query', + operationName: 'GraphModule', + fieldName: 'graphModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class GraphModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "graphModule": data.graphModules?.nodes?.[0] ?? null - }) + graphModule: data.graphModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GraphModule", "createGraphModule", "graphModule", args.select, args.data, "CreateGraphModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GraphModule', + 'createGraphModule', + 'graphModule', + args.select, + args.data, + 'CreateGraphModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "createGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'createGraphModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("GraphModule", "updateGraphModule", "graphModule", args.select, args.where.id, args.data, "UpdateGraphModuleInput", "id", "graphModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'GraphModule', + 'updateGraphModule', + 'graphModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphModuleInput', + 'id', + 'graphModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "updateGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'updateGraphModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteGraphModule: { graphModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("GraphModule", "deleteGraphModule", "graphModule", { - id: args.where.id - }, "DeleteGraphModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'GraphModule', + 'deleteGraphModule', + 'graphModule', + { + id: args.where.id, + }, + 'DeleteGraphModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GraphModule", - fieldName: "deleteGraphModule", + operation: 'mutation', + operationName: 'GraphModule', + fieldName: 'deleteGraphModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/hierarchyModule.ts b/sdk/constructive-sdk/src/modules/orm/models/hierarchyModule.ts index 30eca6fb9e..16e9170d2b 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/hierarchyModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/hierarchyModule.ts @@ -3,56 +3,96 @@ * @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 { HierarchyModule, HierarchyModuleWithRelations, HierarchyModuleSelect, HierarchyModuleFilter, HierarchyModuleOrderBy, CreateHierarchyModuleInput, UpdateHierarchyModuleInput, HierarchyModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HierarchyModule, + HierarchyModuleWithRelations, + HierarchyModuleSelect, + HierarchyModuleFilter, + HierarchyModuleOrderBy, + CreateHierarchyModuleInput, + UpdateHierarchyModuleInput, + HierarchyModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HierarchyModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HierarchyModule", "hierarchyModules", 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 - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HierarchyModule', + 'hierarchyModules', + 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, + }, + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModules", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HierarchyModule", "hierarchyModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HierarchyModule', + 'hierarchyModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModule", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HierarchyModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "hierarchyModule": data.hierarchyModules?.nodes?.[0] ?? null - }) + hierarchyModule: data.hierarchyModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ hierarchyModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HierarchyModule", "hierarchyModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HierarchyModule', + 'hierarchyModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HierarchyModuleFilter", "HierarchyModuleOrderBy", connectionFieldsMap); + 'HierarchyModuleFilter', + 'HierarchyModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HierarchyModule", - fieldName: "hierarchyModule", + operation: 'query', + operationName: 'HierarchyModule', + fieldName: 'hierarchyModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HierarchyModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "hierarchyModule": data.hierarchyModules?.nodes?.[0] ?? null - }) + hierarchyModule: data.hierarchyModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HierarchyModule", "createHierarchyModule", "hierarchyModule", args.select, args.data, "CreateHierarchyModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HierarchyModule', + 'createHierarchyModule', + 'hierarchyModule', + args.select, + args.data, + 'CreateHierarchyModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "createHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'createHierarchyModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HierarchyModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HierarchyModule", "updateHierarchyModule", "hierarchyModule", args.select, args.where.id, args.data, "UpdateHierarchyModuleInput", "id", "hierarchyModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HierarchyModule', + 'updateHierarchyModule', + 'hierarchyModule', + args.select, + args.where.id, + args.data, + 'UpdateHierarchyModuleInput', + 'id', + 'hierarchyModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "updateHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'updateHierarchyModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHierarchyModule: { hierarchyModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HierarchyModule", "deleteHierarchyModule", "hierarchyModule", { - id: args.where.id - }, "DeleteHierarchyModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HierarchyModule', + 'deleteHierarchyModule', + 'hierarchyModule', + { + id: args.where.id, + }, + 'DeleteHierarchyModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HierarchyModule", - fieldName: "deleteHierarchyModule", + operation: 'mutation', + operationName: 'HierarchyModule', + fieldName: 'deleteHierarchyModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/httpRouteModule.ts b/sdk/constructive-sdk/src/modules/orm/models/httpRouteModule.ts index c44abc24a3..babf4d3085 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/httpRouteModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/httpRouteModule.ts @@ -3,56 +3,96 @@ * @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 { HttpRouteModule, HttpRouteModuleWithRelations, HttpRouteModuleSelect, HttpRouteModuleFilter, HttpRouteModuleOrderBy, CreateHttpRouteModuleInput, UpdateHttpRouteModuleInput, HttpRouteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + HttpRouteModule, + HttpRouteModuleWithRelations, + HttpRouteModuleSelect, + HttpRouteModuleFilter, + HttpRouteModuleOrderBy, + CreateHttpRouteModuleInput, + UpdateHttpRouteModuleInput, + HttpRouteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class HttpRouteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRouteModule", "httpRouteModules", 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 - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'HttpRouteModule', + 'httpRouteModules', + 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, + }, + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModules", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("HttpRouteModule", "httpRouteModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'HttpRouteModule', + 'httpRouteModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModule", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class HttpRouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRouteModule": data.httpRouteModules?.nodes?.[0] ?? null - }) + httpRouteModule: data.httpRouteModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ httpRouteModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("HttpRouteModule", "httpRouteModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'HttpRouteModule', + 'httpRouteModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "HttpRouteModuleFilter", "HttpRouteModuleOrderBy", connectionFieldsMap); + 'HttpRouteModuleFilter', + 'HttpRouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "HttpRouteModule", - fieldName: "httpRouteModule", + operation: 'query', + operationName: 'HttpRouteModule', + fieldName: 'httpRouteModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class HttpRouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "httpRouteModule": data.httpRouteModules?.nodes?.[0] ?? null - }) + httpRouteModule: data.httpRouteModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("HttpRouteModule", "createHttpRouteModule", "httpRouteModule", args.select, args.data, "CreateHttpRouteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'HttpRouteModule', + 'createHttpRouteModule', + 'httpRouteModule', + args.select, + args.data, + 'CreateHttpRouteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "createHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'createHttpRouteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + HttpRouteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("HttpRouteModule", "updateHttpRouteModule", "httpRouteModule", args.select, args.where.id, args.data, "UpdateHttpRouteModuleInput", "id", "httpRouteModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'HttpRouteModule', + 'updateHttpRouteModule', + 'httpRouteModule', + args.select, + args.where.id, + args.data, + 'UpdateHttpRouteModuleInput', + 'id', + 'httpRouteModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "updateHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'updateHttpRouteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteHttpRouteModule: { httpRouteModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("HttpRouteModule", "deleteHttpRouteModule", "httpRouteModule", { - id: args.where.id - }, "DeleteHttpRouteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'HttpRouteModule', + 'deleteHttpRouteModule', + 'httpRouteModule', + { + id: args.where.id, + }, + 'DeleteHttpRouteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "HttpRouteModule", - fieldName: "deleteHttpRouteModule", + operation: 'mutation', + operationName: 'HttpRouteModule', + fieldName: 'deleteHttpRouteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/i18NModule.ts b/sdk/constructive-sdk/src/modules/orm/models/i18NModule.ts index c49e6d670b..014ecefd15 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/i18NModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/i18NModule.ts @@ -3,56 +3,96 @@ * @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 { I18NModule, I18NModuleWithRelations, I18NModuleSelect, I18NModuleFilter, I18NModuleOrderBy, CreateI18NModuleInput, UpdateI18NModuleInput, I18NModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + I18NModule, + I18NModuleWithRelations, + I18NModuleSelect, + I18NModuleFilter, + I18NModuleOrderBy, + CreateI18NModuleInput, + UpdateI18NModuleInput, + I18NModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class I18NModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ i18nModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("I18NModule", "i18nModules", 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 - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'I18NModule', + 'i18nModules', + 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, + }, + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18nModules", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18nModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ i18NModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("I18NModule", "i18nModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'I18NModule', + 'i18nModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18NModule", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18NModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class I18NModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "i18NModule": data.i18nModules?.nodes?.[0] ?? null - }) + i18NModule: data.i18nModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ i18NModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("I18NModule", "i18nModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'I18NModule', + 'i18nModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "I18NModuleFilter", "I18NModuleOrderBy", connectionFieldsMap); + 'I18NModuleFilter', + 'I18NModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "I18NModule", - fieldName: "i18NModule", + operation: 'query', + operationName: 'I18NModule', + fieldName: 'i18NModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class I18NModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "i18NModule": data.i18nModules?.nodes?.[0] ?? null - }) + i18NModule: data.i18nModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("I18NModule", "createI18NModule", "i18NModule", args.select, args.data, "CreateI18NModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'I18NModule', + 'createI18NModule', + 'i18NModule', + args.select, + args.data, + 'CreateI18NModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "createI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'createI18NModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + I18NModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("I18NModule", "updateI18NModule", "i18NModule", args.select, args.where.id, args.data, "UpdateI18NModuleInput", "id", "i18NModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'I18NModule', + 'updateI18NModule', + 'i18NModule', + args.select, + args.where.id, + args.data, + 'UpdateI18NModuleInput', + 'id', + 'i18NModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "updateI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'updateI18NModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteI18NModule: { i18NModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("I18NModule", "deleteI18NModule", "i18NModule", { - id: args.where.id - }, "DeleteI18NModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'I18NModule', + 'deleteI18NModule', + 'i18NModule', + { + id: args.where.id, + }, + 'DeleteI18NModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "I18NModule", - fieldName: "deleteI18NModule", + operation: 'mutation', + operationName: 'I18NModule', + fieldName: 'deleteI18NModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/identityProvidersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/identityProvidersModule.ts index 35b05c8128..bc564b56d1 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/identityProvidersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/identityProvidersModule.ts @@ -3,56 +3,98 @@ * @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 { IdentityProvidersModule, IdentityProvidersModuleWithRelations, IdentityProvidersModuleSelect, IdentityProvidersModuleFilter, IdentityProvidersModuleOrderBy, CreateIdentityProvidersModuleInput, UpdateIdentityProvidersModuleInput, IdentityProvidersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IdentityProvidersModule, + IdentityProvidersModuleWithRelations, + IdentityProvidersModuleSelect, + IdentityProvidersModuleFilter, + IdentityProvidersModuleOrderBy, + CreateIdentityProvidersModuleInput, + UpdateIdentityProvidersModuleInput, + IdentityProvidersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IdentityProvidersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - identityProvidersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + identityProvidersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvidersModule", "identityProvidersModules", 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 - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + 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, + }, + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModules", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvidersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IdentityProvidersModule", "identityProvidersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModule", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class IdentityProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvidersModule": data.identityProvidersModules?.nodes?.[0] ?? null - }) + identityProvidersModule: data.identityProvidersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ identityProvidersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("IdentityProvidersModule", "identityProvidersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IdentityProvidersModule', + 'identityProvidersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IdentityProvidersModuleFilter", "IdentityProvidersModuleOrderBy", connectionFieldsMap); + 'IdentityProvidersModuleFilter', + 'IdentityProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IdentityProvidersModule", - fieldName: "identityProvidersModule", + operation: 'query', + operationName: 'IdentityProvidersModule', + fieldName: 'identityProvidersModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class IdentityProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "identityProvidersModule": data.identityProvidersModules?.nodes?.[0] ?? null - }) + identityProvidersModule: data.identityProvidersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IdentityProvidersModule", "createIdentityProvidersModule", "identityProvidersModule", args.select, args.data, "CreateIdentityProvidersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IdentityProvidersModule', + 'createIdentityProvidersModule', + 'identityProvidersModule', + args.select, + args.data, + 'CreateIdentityProvidersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "createIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'createIdentityProvidersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IdentityProvidersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IdentityProvidersModule", "updateIdentityProvidersModule", "identityProvidersModule", args.select, args.where.id, args.data, "UpdateIdentityProvidersModuleInput", "id", "identityProvidersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IdentityProvidersModule', + 'updateIdentityProvidersModule', + 'identityProvidersModule', + args.select, + args.where.id, + args.data, + 'UpdateIdentityProvidersModuleInput', + 'id', + 'identityProvidersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "updateIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'updateIdentityProvidersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIdentityProvidersModule: { identityProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IdentityProvidersModule", "deleteIdentityProvidersModule", "identityProvidersModule", { - id: args.where.id - }, "DeleteIdentityProvidersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IdentityProvidersModule', + 'deleteIdentityProvidersModule', + 'identityProvidersModule', + { + id: args.where.id, + }, + 'DeleteIdentityProvidersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IdentityProvidersModule", - fieldName: "deleteIdentityProvidersModule", + operation: 'mutation', + operationName: 'IdentityProvidersModule', + fieldName: 'deleteIdentityProvidersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/index.ts b/sdk/constructive-sdk/src/modules/orm/models/index.ts index b2fe8faa92..3aa2d03318 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/index.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/index.ts @@ -3,78 +3,78 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AgentModuleModel } from "./agentModule"; -export { ApiSurfaceModuleModel } from "./apiSurfaceModule"; -export { AppModuleModel } from "./appModule"; -export { BillingModuleModel } from "./billingModule"; -export { BillingProviderModuleModel } from "./billingProviderModule"; -export { BlueprintModel } from "./blueprint"; -export { BlueprintConstructionModel } from "./blueprintConstruction"; -export { BlueprintTemplateModel } from "./blueprintTemplate"; -export { CatalogModuleModel } from "./catalogModule"; -export { ComputeLogModuleModel } from "./computeLogModule"; -export { ConfigSecretsUserModuleModel } from "./configSecretsUserModule"; -export { ConnectedAccountsModuleModel } from "./connectedAccountsModule"; -export { CryptoAddressesModuleModel } from "./cryptoAddressesModule"; -export { CryptoAuthModuleModel } from "./cryptoAuthModule"; -export { DatabaseProvisionModuleModel } from "./databaseProvisionModule"; -export { DatabaseSettingsModuleModel } from "./databaseSettingsModule"; -export { DbPoolConfigModel } from "./dbPoolConfig"; -export { DbPoolModel } from "./dbPool"; -export { DbPresetModuleModel } from "./dbPresetModule"; -export { DbUsageModuleModel } from "./dbUsageModule"; -export { DefaultIdsModuleModel } from "./defaultIdsModule"; -export { DenormalizedTableFieldModel } from "./denormalizedTableField"; -export { DevicesModuleModel } from "./devicesModule"; -export { DomainModuleModel } from "./domainModule"; -export { EmailsModuleModel } from "./emailsModule"; -export { EntityTypeProvisionModel } from "./entityTypeProvision"; -export { EventsModuleModel } from "./eventsModule"; -export { FunctionDeploymentModuleModel } from "./functionDeploymentModule"; -export { FunctionInvocationModuleModel } from "./functionInvocationModule"; -export { FunctionModuleModel } from "./functionModule"; -export { GraphExecutionModuleModel } from "./graphExecutionModule"; -export { GraphModuleModel } from "./graphModule"; -export { HierarchyModuleModel } from "./hierarchyModule"; -export { HttpRouteModuleModel } from "./httpRouteModule"; -export { I18NModuleModel } from "./i18NModule"; -export { IdentityProvidersModuleModel } from "./identityProvidersModule"; -export { InferenceLogModuleModel } from "./inferenceLogModule"; -export { InfraConfigModuleModel } from "./infraConfigModule"; -export { InfraSecretsModuleModel } from "./infraSecretsModule"; -export { IntegrationProvidersModuleModel } from "./integrationProvidersModule"; -export { InternalSecretsModuleModel } from "./internalSecretsModule"; -export { InvitesModuleModel } from "./invitesModule"; -export { LimitsModuleModel } from "./limitsModule"; -export { MembershipTypesModuleModel } from "./membershipTypesModule"; -export { MembershipsModuleModel } from "./membershipsModule"; -export { MerkleStoreModuleModel } from "./merkleStoreModule"; -export { NamespaceModuleModel } from "./namespaceModule"; -export { NotificationsModuleModel } from "./notificationsModule"; -export { PermissionsModuleModel } from "./permissionsModule"; -export { PhoneNumbersModuleModel } from "./phoneNumbersModule"; -export { PlansModuleModel } from "./plansModule"; -export { PrincipalAuthModuleModel } from "./principalAuthModule"; -export { ProfilesModuleModel } from "./profilesModule"; -export { RateLimitMetersModuleModel } from "./rateLimitMetersModule"; -export { RateLimitsModuleModel } from "./rateLimitsModule"; -export { RealtimeModuleModel } from "./realtimeModule"; -export { RelationProvisionModel } from "./relationProvision"; -export { ResourceModuleModel } from "./resourceModule"; -export { RlsModuleModel } from "./rlsModule"; -export { RouteModuleModel } from "./routeModule"; -export { SecureTableProvisionModel } from "./secureTableProvision"; -export { SessionSecretsModuleModel } from "./sessionSecretsModule"; -export { SessionsModuleModel } from "./sessionsModule"; -export { SiteSurfaceModuleModel } from "./siteSurfaceModule"; -export { StorageLogModuleModel } from "./storageLogModule"; -export { StorageModuleModel } from "./storageModule"; -export { TransferLogModuleModel } from "./transferLogModule"; -export { UserAuthModuleModel } from "./userAuthModule"; -export { UserCredentialsModuleModel } from "./userCredentialsModule"; -export { UserSettingsModuleModel } from "./userSettingsModule"; -export { UserStateModuleModel } from "./userStateModule"; -export { UsersModuleModel } from "./usersModule"; -export { WebauthnAuthModuleModel } from "./webauthnAuthModule"; -export { WebauthnCredentialsModuleModel } from "./webauthnCredentialsModule"; -export { WebhookModuleModel } from "./webhookModule"; \ No newline at end of file +export { AgentModuleModel } from './agentModule'; +export { ApiSurfaceModuleModel } from './apiSurfaceModule'; +export { AppModuleModel } from './appModule'; +export { BillingModuleModel } from './billingModule'; +export { BillingProviderModuleModel } from './billingProviderModule'; +export { BlueprintModel } from './blueprint'; +export { BlueprintConstructionModel } from './blueprintConstruction'; +export { BlueprintTemplateModel } from './blueprintTemplate'; +export { CatalogModuleModel } from './catalogModule'; +export { ComputeLogModuleModel } from './computeLogModule'; +export { ConfigSecretsUserModuleModel } from './configSecretsUserModule'; +export { ConnectedAccountsModuleModel } from './connectedAccountsModule'; +export { CryptoAddressesModuleModel } from './cryptoAddressesModule'; +export { CryptoAuthModuleModel } from './cryptoAuthModule'; +export { DatabaseProvisionModuleModel } from './databaseProvisionModule'; +export { DatabaseSettingsModuleModel } from './databaseSettingsModule'; +export { DbPoolConfigModel } from './dbPoolConfig'; +export { DbPoolModel } from './dbPool'; +export { DbPresetModuleModel } from './dbPresetModule'; +export { DbUsageModuleModel } from './dbUsageModule'; +export { DefaultIdsModuleModel } from './defaultIdsModule'; +export { DenormalizedTableFieldModel } from './denormalizedTableField'; +export { DevicesModuleModel } from './devicesModule'; +export { DomainModuleModel } from './domainModule'; +export { EmailsModuleModel } from './emailsModule'; +export { EntityTypeProvisionModel } from './entityTypeProvision'; +export { EventsModuleModel } from './eventsModule'; +export { FunctionDeploymentModuleModel } from './functionDeploymentModule'; +export { FunctionInvocationModuleModel } from './functionInvocationModule'; +export { FunctionModuleModel } from './functionModule'; +export { GraphExecutionModuleModel } from './graphExecutionModule'; +export { GraphModuleModel } from './graphModule'; +export { HierarchyModuleModel } from './hierarchyModule'; +export { HttpRouteModuleModel } from './httpRouteModule'; +export { I18NModuleModel } from './i18NModule'; +export { IdentityProvidersModuleModel } from './identityProvidersModule'; +export { InferenceLogModuleModel } from './inferenceLogModule'; +export { InfraConfigModuleModel } from './infraConfigModule'; +export { InfraSecretsModuleModel } from './infraSecretsModule'; +export { IntegrationProvidersModuleModel } from './integrationProvidersModule'; +export { InternalSecretsModuleModel } from './internalSecretsModule'; +export { InvitesModuleModel } from './invitesModule'; +export { LimitsModuleModel } from './limitsModule'; +export { MembershipTypesModuleModel } from './membershipTypesModule'; +export { MembershipsModuleModel } from './membershipsModule'; +export { MerkleStoreModuleModel } from './merkleStoreModule'; +export { NamespaceModuleModel } from './namespaceModule'; +export { NotificationsModuleModel } from './notificationsModule'; +export { PermissionsModuleModel } from './permissionsModule'; +export { PhoneNumbersModuleModel } from './phoneNumbersModule'; +export { PlansModuleModel } from './plansModule'; +export { PrincipalAuthModuleModel } from './principalAuthModule'; +export { ProfilesModuleModel } from './profilesModule'; +export { RateLimitMetersModuleModel } from './rateLimitMetersModule'; +export { RateLimitsModuleModel } from './rateLimitsModule'; +export { RealtimeModuleModel } from './realtimeModule'; +export { RelationProvisionModel } from './relationProvision'; +export { ResourceModuleModel } from './resourceModule'; +export { RlsModuleModel } from './rlsModule'; +export { RouteModuleModel } from './routeModule'; +export { SecureTableProvisionModel } from './secureTableProvision'; +export { SessionSecretsModuleModel } from './sessionSecretsModule'; +export { SessionsModuleModel } from './sessionsModule'; +export { SiteSurfaceModuleModel } from './siteSurfaceModule'; +export { StorageLogModuleModel } from './storageLogModule'; +export { StorageModuleModel } from './storageModule'; +export { TransferLogModuleModel } from './transferLogModule'; +export { UserAuthModuleModel } from './userAuthModule'; +export { UserCredentialsModuleModel } from './userCredentialsModule'; +export { UserSettingsModuleModel } from './userSettingsModule'; +export { UserStateModuleModel } from './userStateModule'; +export { UsersModuleModel } from './usersModule'; +export { WebauthnAuthModuleModel } from './webauthnAuthModule'; +export { WebauthnCredentialsModuleModel } from './webauthnCredentialsModule'; +export { WebhookModuleModel } from './webhookModule'; diff --git a/sdk/constructive-sdk/src/modules/orm/models/inferenceLogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/inferenceLogModule.ts index ea4160dd85..f4c0f77d3b 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/inferenceLogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/inferenceLogModule.ts @@ -3,56 +3,96 @@ * @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 { InferenceLogModule, InferenceLogModuleWithRelations, InferenceLogModuleSelect, InferenceLogModuleFilter, InferenceLogModuleOrderBy, CreateInferenceLogModuleInput, UpdateInferenceLogModuleInput, InferenceLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InferenceLogModule, + InferenceLogModuleWithRelations, + InferenceLogModuleSelect, + InferenceLogModuleFilter, + InferenceLogModuleOrderBy, + CreateInferenceLogModuleInput, + UpdateInferenceLogModuleInput, + InferenceLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InferenceLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InferenceLogModule", "inferenceLogModules", 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 - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InferenceLogModule', + 'inferenceLogModules', + 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, + }, + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModules", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InferenceLogModule", "inferenceLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InferenceLogModule', + 'inferenceLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModule", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InferenceLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "inferenceLogModule": data.inferenceLogModules?.nodes?.[0] ?? null - }) + inferenceLogModule: data.inferenceLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ inferenceLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InferenceLogModule", "inferenceLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InferenceLogModule', + 'inferenceLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InferenceLogModuleFilter", "InferenceLogModuleOrderBy", connectionFieldsMap); + 'InferenceLogModuleFilter', + 'InferenceLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InferenceLogModule", - fieldName: "inferenceLogModule", + operation: 'query', + operationName: 'InferenceLogModule', + fieldName: 'inferenceLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InferenceLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "inferenceLogModule": data.inferenceLogModules?.nodes?.[0] ?? null - }) + inferenceLogModule: data.inferenceLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InferenceLogModule", "createInferenceLogModule", "inferenceLogModule", args.select, args.data, "CreateInferenceLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InferenceLogModule', + 'createInferenceLogModule', + 'inferenceLogModule', + args.select, + args.data, + 'CreateInferenceLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "createInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'createInferenceLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InferenceLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InferenceLogModule", "updateInferenceLogModule", "inferenceLogModule", args.select, args.where.id, args.data, "UpdateInferenceLogModuleInput", "id", "inferenceLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InferenceLogModule', + 'updateInferenceLogModule', + 'inferenceLogModule', + args.select, + args.where.id, + args.data, + 'UpdateInferenceLogModuleInput', + 'id', + 'inferenceLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "updateInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'updateInferenceLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInferenceLogModule: { inferenceLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InferenceLogModule", "deleteInferenceLogModule", "inferenceLogModule", { - id: args.where.id - }, "DeleteInferenceLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InferenceLogModule', + 'deleteInferenceLogModule', + 'inferenceLogModule', + { + id: args.where.id, + }, + 'DeleteInferenceLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InferenceLogModule", - fieldName: "deleteInferenceLogModule", + operation: 'mutation', + operationName: 'InferenceLogModule', + fieldName: 'deleteInferenceLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/infraConfigModule.ts b/sdk/constructive-sdk/src/modules/orm/models/infraConfigModule.ts index ace75e0620..12a793b04f 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/infraConfigModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/infraConfigModule.ts @@ -3,56 +3,96 @@ * @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 { InfraConfigModule, InfraConfigModuleWithRelations, InfraConfigModuleSelect, InfraConfigModuleFilter, InfraConfigModuleOrderBy, CreateInfraConfigModuleInput, UpdateInfraConfigModuleInput, InfraConfigModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraConfigModule, + InfraConfigModuleWithRelations, + InfraConfigModuleSelect, + InfraConfigModuleFilter, + InfraConfigModuleOrderBy, + CreateInfraConfigModuleInput, + UpdateInfraConfigModuleInput, + InfraConfigModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraConfigModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraConfigModule", "infraConfigModules", 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 - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraConfigModule', + 'infraConfigModules', + 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, + }, + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModules", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraConfigModule", "infraConfigModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraConfigModule', + 'infraConfigModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModule", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraConfigModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraConfigModule": data.infraConfigModules?.nodes?.[0] ?? null - }) + infraConfigModule: data.infraConfigModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraConfigModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraConfigModule", "infraConfigModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraConfigModule', + 'infraConfigModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraConfigModuleFilter", "InfraConfigModuleOrderBy", connectionFieldsMap); + 'InfraConfigModuleFilter', + 'InfraConfigModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraConfigModule", - fieldName: "infraConfigModule", + operation: 'query', + operationName: 'InfraConfigModule', + fieldName: 'infraConfigModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraConfigModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraConfigModule": data.infraConfigModules?.nodes?.[0] ?? null - }) + infraConfigModule: data.infraConfigModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraConfigModule", "createInfraConfigModule", "infraConfigModule", args.select, args.data, "CreateInfraConfigModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraConfigModule', + 'createInfraConfigModule', + 'infraConfigModule', + args.select, + args.data, + 'CreateInfraConfigModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "createInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'createInfraConfigModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraConfigModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraConfigModule", "updateInfraConfigModule", "infraConfigModule", args.select, args.where.id, args.data, "UpdateInfraConfigModuleInput", "id", "infraConfigModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraConfigModule', + 'updateInfraConfigModule', + 'infraConfigModule', + args.select, + args.where.id, + args.data, + 'UpdateInfraConfigModuleInput', + 'id', + 'infraConfigModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "updateInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'updateInfraConfigModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraConfigModule: { infraConfigModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraConfigModule", "deleteInfraConfigModule", "infraConfigModule", { - id: args.where.id - }, "DeleteInfraConfigModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraConfigModule', + 'deleteInfraConfigModule', + 'infraConfigModule', + { + id: args.where.id, + }, + 'DeleteInfraConfigModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraConfigModule", - fieldName: "deleteInfraConfigModule", + operation: 'mutation', + operationName: 'InfraConfigModule', + fieldName: 'deleteInfraConfigModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/infraSecretsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/infraSecretsModule.ts index d1089bf89d..165b4f2d59 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/infraSecretsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/infraSecretsModule.ts @@ -3,56 +3,96 @@ * @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 { InfraSecretsModule, InfraSecretsModuleWithRelations, InfraSecretsModuleSelect, InfraSecretsModuleFilter, InfraSecretsModuleOrderBy, CreateInfraSecretsModuleInput, UpdateInfraSecretsModuleInput, InfraSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InfraSecretsModule, + InfraSecretsModuleWithRelations, + InfraSecretsModuleSelect, + InfraSecretsModuleFilter, + InfraSecretsModuleOrderBy, + CreateInfraSecretsModuleInput, + UpdateInfraSecretsModuleInput, + InfraSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InfraSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InfraSecretsModule", "infraSecretsModules", 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 - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + 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, + }, + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModules", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InfraSecretsModule", "infraSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModule", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InfraSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraSecretsModule": data.infraSecretsModules?.nodes?.[0] ?? null - }) + infraSecretsModule: data.infraSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ infraSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InfraSecretsModule", "infraSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InfraSecretsModule', + 'infraSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InfraSecretsModuleFilter", "InfraSecretsModuleOrderBy", connectionFieldsMap); + 'InfraSecretsModuleFilter', + 'InfraSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InfraSecretsModule", - fieldName: "infraSecretsModule", + operation: 'query', + operationName: 'InfraSecretsModule', + fieldName: 'infraSecretsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InfraSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "infraSecretsModule": data.infraSecretsModules?.nodes?.[0] ?? null - }) + infraSecretsModule: data.infraSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InfraSecretsModule", "createInfraSecretsModule", "infraSecretsModule", args.select, args.data, "CreateInfraSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InfraSecretsModule', + 'createInfraSecretsModule', + 'infraSecretsModule', + args.select, + args.data, + 'CreateInfraSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "createInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'createInfraSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InfraSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InfraSecretsModule", "updateInfraSecretsModule", "infraSecretsModule", args.select, args.where.id, args.data, "UpdateInfraSecretsModuleInput", "id", "infraSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InfraSecretsModule', + 'updateInfraSecretsModule', + 'infraSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateInfraSecretsModuleInput', + 'id', + 'infraSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "updateInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'updateInfraSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInfraSecretsModule: { infraSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InfraSecretsModule", "deleteInfraSecretsModule", "infraSecretsModule", { - id: args.where.id - }, "DeleteInfraSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InfraSecretsModule', + 'deleteInfraSecretsModule', + 'infraSecretsModule', + { + id: args.where.id, + }, + 'DeleteInfraSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InfraSecretsModule", - fieldName: "deleteInfraSecretsModule", + operation: 'mutation', + operationName: 'InfraSecretsModule', + fieldName: 'deleteInfraSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/integrationProvidersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/integrationProvidersModule.ts index 23d033a40a..63c765faee 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/integrationProvidersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/integrationProvidersModule.ts @@ -3,56 +3,101 @@ * @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 { IntegrationProvidersModule, IntegrationProvidersModuleWithRelations, IntegrationProvidersModuleSelect, IntegrationProvidersModuleFilter, IntegrationProvidersModuleOrderBy, CreateIntegrationProvidersModuleInput, UpdateIntegrationProvidersModuleInput, IntegrationProvidersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + IntegrationProvidersModule, + IntegrationProvidersModuleWithRelations, + IntegrationProvidersModuleSelect, + IntegrationProvidersModuleFilter, + IntegrationProvidersModuleOrderBy, + CreateIntegrationProvidersModuleInput, + UpdateIntegrationProvidersModuleInput, + IntegrationProvidersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class IntegrationProvidersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvidersModule", "integrationProvidersModules", 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 - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + 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, + }, + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModules", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModule: InferSelectResult | null; + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModule: InferSelectResult< + IntegrationProvidersModuleWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindFirstDocument("IntegrationProvidersModule", "integrationProvidersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModule", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModule', document, variables, transform: (data: { @@ -60,32 +105,42 @@ export class IntegrationProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvidersModule": data.integrationProvidersModules?.nodes?.[0] ?? null - }) + integrationProvidersModule: data.integrationProvidersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ - integrationProvidersModule: InferSelectResult | null; + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + integrationProvidersModule: InferSelectResult< + IntegrationProvidersModuleWithRelations, + S + > | null; }> { - const { - document, - variables - } = buildFindManyDocument("IntegrationProvidersModule", "integrationProvidersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'IntegrationProvidersModule', + 'integrationProvidersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "IntegrationProvidersModuleFilter", "IntegrationProvidersModuleOrderBy", connectionFieldsMap); + 'IntegrationProvidersModuleFilter', + 'IntegrationProvidersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "IntegrationProvidersModule", - fieldName: "integrationProvidersModule", + operation: 'query', + operationName: 'IntegrationProvidersModule', + fieldName: 'integrationProvidersModule', document, variables, transform: (data: { @@ -93,74 +148,106 @@ export class IntegrationProvidersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "integrationProvidersModule": data.integrationProvidersModules?.nodes?.[0] ?? null - }) + integrationProvidersModule: data.integrationProvidersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("IntegrationProvidersModule", "createIntegrationProvidersModule", "integrationProvidersModule", args.select, args.data, "CreateIntegrationProvidersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'IntegrationProvidersModule', + 'createIntegrationProvidersModule', + 'integrationProvidersModule', + args.select, + args.data, + 'CreateIntegrationProvidersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "createIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'createIntegrationProvidersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + IntegrationProvidersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("IntegrationProvidersModule", "updateIntegrationProvidersModule", "integrationProvidersModule", args.select, args.where.id, args.data, "UpdateIntegrationProvidersModuleInput", "id", "integrationProvidersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'IntegrationProvidersModule', + 'updateIntegrationProvidersModule', + 'integrationProvidersModule', + args.select, + args.where.id, + args.data, + 'UpdateIntegrationProvidersModuleInput', + 'id', + 'integrationProvidersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "updateIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'updateIntegrationProvidersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteIntegrationProvidersModule: { integrationProvidersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("IntegrationProvidersModule", "deleteIntegrationProvidersModule", "integrationProvidersModule", { - id: args.where.id - }, "DeleteIntegrationProvidersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'IntegrationProvidersModule', + 'deleteIntegrationProvidersModule', + 'integrationProvidersModule', + { + id: args.where.id, + }, + 'DeleteIntegrationProvidersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "IntegrationProvidersModule", - fieldName: "deleteIntegrationProvidersModule", + operation: 'mutation', + operationName: 'IntegrationProvidersModule', + fieldName: 'deleteIntegrationProvidersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/internalSecretsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/internalSecretsModule.ts index 649ce5bbd9..cfffbed8d5 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/internalSecretsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/internalSecretsModule.ts @@ -3,56 +3,98 @@ * @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 { InternalSecretsModule, InternalSecretsModuleWithRelations, InternalSecretsModuleSelect, InternalSecretsModuleFilter, InternalSecretsModuleOrderBy, CreateInternalSecretsModuleInput, UpdateInternalSecretsModuleInput, InternalSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InternalSecretsModule, + InternalSecretsModuleWithRelations, + InternalSecretsModuleSelect, + InternalSecretsModuleFilter, + InternalSecretsModuleOrderBy, + CreateInternalSecretsModuleInput, + UpdateInternalSecretsModuleInput, + InternalSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InternalSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - internalSecretsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + internalSecretsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("InternalSecretsModule", "internalSecretsModules", 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 - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + 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, + }, + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModules", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ internalSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InternalSecretsModule", "internalSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModule", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class InternalSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "internalSecretsModule": data.internalSecretsModules?.nodes?.[0] ?? null - }) + internalSecretsModule: data.internalSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ internalSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InternalSecretsModule", "internalSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InternalSecretsModule', + 'internalSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InternalSecretsModuleFilter", "InternalSecretsModuleOrderBy", connectionFieldsMap); + 'InternalSecretsModuleFilter', + 'InternalSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InternalSecretsModule", - fieldName: "internalSecretsModule", + operation: 'query', + operationName: 'InternalSecretsModule', + fieldName: 'internalSecretsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class InternalSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "internalSecretsModule": data.internalSecretsModules?.nodes?.[0] ?? null - }) + internalSecretsModule: data.internalSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InternalSecretsModule", "createInternalSecretsModule", "internalSecretsModule", args.select, args.data, "CreateInternalSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InternalSecretsModule', + 'createInternalSecretsModule', + 'internalSecretsModule', + args.select, + args.data, + 'CreateInternalSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "createInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'createInternalSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InternalSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InternalSecretsModule", "updateInternalSecretsModule", "internalSecretsModule", args.select, args.where.id, args.data, "UpdateInternalSecretsModuleInput", "id", "internalSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InternalSecretsModule', + 'updateInternalSecretsModule', + 'internalSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateInternalSecretsModuleInput', + 'id', + 'internalSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "updateInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'updateInternalSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInternalSecretsModule: { internalSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InternalSecretsModule", "deleteInternalSecretsModule", "internalSecretsModule", { - id: args.where.id - }, "DeleteInternalSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InternalSecretsModule', + 'deleteInternalSecretsModule', + 'internalSecretsModule', + { + id: args.where.id, + }, + 'DeleteInternalSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InternalSecretsModule", - fieldName: "deleteInternalSecretsModule", + operation: 'mutation', + operationName: 'InternalSecretsModule', + fieldName: 'deleteInternalSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/invitesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/invitesModule.ts index b740ff9252..b244078720 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/invitesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/invitesModule.ts @@ -3,56 +3,96 @@ * @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 { InvitesModule, InvitesModuleWithRelations, InvitesModuleSelect, InvitesModuleFilter, InvitesModuleOrderBy, CreateInvitesModuleInput, UpdateInvitesModuleInput, InvitesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + InvitesModule, + InvitesModuleWithRelations, + InvitesModuleSelect, + InvitesModuleFilter, + InvitesModuleOrderBy, + CreateInvitesModuleInput, + UpdateInvitesModuleInput, + InvitesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class InvitesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("InvitesModule", "invitesModules", 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 - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'InvitesModule', + 'invitesModules', + 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, + }, + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModules", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("InvitesModule", "invitesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'InvitesModule', + 'invitesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModule", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class InvitesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "invitesModule": data.invitesModules?.nodes?.[0] ?? null - }) + invitesModule: data.invitesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ invitesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("InvitesModule", "invitesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'InvitesModule', + 'invitesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "InvitesModuleFilter", "InvitesModuleOrderBy", connectionFieldsMap); + 'InvitesModuleFilter', + 'InvitesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "InvitesModule", - fieldName: "invitesModule", + operation: 'query', + operationName: 'InvitesModule', + fieldName: 'invitesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class InvitesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "invitesModule": data.invitesModules?.nodes?.[0] ?? null - }) + invitesModule: data.invitesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("InvitesModule", "createInvitesModule", "invitesModule", args.select, args.data, "CreateInvitesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'InvitesModule', + 'createInvitesModule', + 'invitesModule', + args.select, + args.data, + 'CreateInvitesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "createInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'createInvitesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + InvitesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("InvitesModule", "updateInvitesModule", "invitesModule", args.select, args.where.id, args.data, "UpdateInvitesModuleInput", "id", "invitesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'InvitesModule', + 'updateInvitesModule', + 'invitesModule', + args.select, + args.where.id, + args.data, + 'UpdateInvitesModuleInput', + 'id', + 'invitesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "updateInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'updateInvitesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteInvitesModule: { invitesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("InvitesModule", "deleteInvitesModule", "invitesModule", { - id: args.where.id - }, "DeleteInvitesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'InvitesModule', + 'deleteInvitesModule', + 'invitesModule', + { + id: args.where.id, + }, + 'DeleteInvitesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "InvitesModule", - fieldName: "deleteInvitesModule", + operation: 'mutation', + operationName: 'InvitesModule', + fieldName: 'deleteInvitesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/limitsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/limitsModule.ts index 4e868d7c8f..50d0d76ba5 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/limitsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/limitsModule.ts @@ -3,56 +3,96 @@ * @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 { LimitsModule, LimitsModuleWithRelations, LimitsModuleSelect, LimitsModuleFilter, LimitsModuleOrderBy, CreateLimitsModuleInput, UpdateLimitsModuleInput, LimitsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + LimitsModule, + LimitsModuleWithRelations, + LimitsModuleSelect, + LimitsModuleFilter, + LimitsModuleOrderBy, + CreateLimitsModuleInput, + UpdateLimitsModuleInput, + LimitsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class LimitsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("LimitsModule", "limitsModules", 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 - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'LimitsModule', + 'limitsModules', + 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, + }, + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModules", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("LimitsModule", "limitsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'LimitsModule', + 'limitsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModule", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class LimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "limitsModule": data.limitsModules?.nodes?.[0] ?? null - }) + limitsModule: data.limitsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ limitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("LimitsModule", "limitsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'LimitsModule', + 'limitsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "LimitsModuleFilter", "LimitsModuleOrderBy", connectionFieldsMap); + 'LimitsModuleFilter', + 'LimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "LimitsModule", - fieldName: "limitsModule", + operation: 'query', + operationName: 'LimitsModule', + fieldName: 'limitsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class LimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "limitsModule": data.limitsModules?.nodes?.[0] ?? null - }) + limitsModule: data.limitsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("LimitsModule", "createLimitsModule", "limitsModule", args.select, args.data, "CreateLimitsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'LimitsModule', + 'createLimitsModule', + 'limitsModule', + args.select, + args.data, + 'CreateLimitsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "createLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'createLimitsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + LimitsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("LimitsModule", "updateLimitsModule", "limitsModule", args.select, args.where.id, args.data, "UpdateLimitsModuleInput", "id", "limitsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'LimitsModule', + 'updateLimitsModule', + 'limitsModule', + args.select, + args.where.id, + args.data, + 'UpdateLimitsModuleInput', + 'id', + 'limitsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "updateLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'updateLimitsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteLimitsModule: { limitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("LimitsModule", "deleteLimitsModule", "limitsModule", { - id: args.where.id - }, "DeleteLimitsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'LimitsModule', + 'deleteLimitsModule', + 'limitsModule', + { + id: args.where.id, + }, + 'DeleteLimitsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "LimitsModule", - fieldName: "deleteLimitsModule", + operation: 'mutation', + operationName: 'LimitsModule', + fieldName: 'deleteLimitsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/membershipTypesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/membershipTypesModule.ts index 87f83a4f04..9eeb67961f 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/membershipTypesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/membershipTypesModule.ts @@ -3,56 +3,98 @@ * @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 { MembershipTypesModule, MembershipTypesModuleWithRelations, MembershipTypesModuleSelect, MembershipTypesModuleFilter, MembershipTypesModuleOrderBy, CreateMembershipTypesModuleInput, UpdateMembershipTypesModuleInput, MembershipTypesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipTypesModule, + MembershipTypesModuleWithRelations, + MembershipTypesModuleSelect, + MembershipTypesModuleFilter, + MembershipTypesModuleOrderBy, + CreateMembershipTypesModuleInput, + UpdateMembershipTypesModuleInput, + MembershipTypesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipTypesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - membershipTypesModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + membershipTypesModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipTypesModule", "membershipTypesModules", 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 - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + 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, + }, + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModules", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipTypesModule", "membershipTypesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModule", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class MembershipTypesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipTypesModule": data.membershipTypesModules?.nodes?.[0] ?? null - }) + membershipTypesModule: data.membershipTypesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipTypesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipTypesModule", "membershipTypesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipTypesModule', + 'membershipTypesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipTypesModuleFilter", "MembershipTypesModuleOrderBy", connectionFieldsMap); + 'MembershipTypesModuleFilter', + 'MembershipTypesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipTypesModule", - fieldName: "membershipTypesModule", + operation: 'query', + operationName: 'MembershipTypesModule', + fieldName: 'membershipTypesModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class MembershipTypesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipTypesModule": data.membershipTypesModules?.nodes?.[0] ?? null - }) + membershipTypesModule: data.membershipTypesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipTypesModule", "createMembershipTypesModule", "membershipTypesModule", args.select, args.data, "CreateMembershipTypesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipTypesModule', + 'createMembershipTypesModule', + 'membershipTypesModule', + args.select, + args.data, + 'CreateMembershipTypesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "createMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'createMembershipTypesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MembershipTypesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipTypesModule", "updateMembershipTypesModule", "membershipTypesModule", args.select, args.where.id, args.data, "UpdateMembershipTypesModuleInput", "id", "membershipTypesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipTypesModule', + 'updateMembershipTypesModule', + 'membershipTypesModule', + args.select, + args.where.id, + args.data, + 'UpdateMembershipTypesModuleInput', + 'id', + 'membershipTypesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "updateMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'updateMembershipTypesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipTypesModule: { membershipTypesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipTypesModule", "deleteMembershipTypesModule", "membershipTypesModule", { - id: args.where.id - }, "DeleteMembershipTypesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipTypesModule', + 'deleteMembershipTypesModule', + 'membershipTypesModule', + { + id: args.where.id, + }, + 'DeleteMembershipTypesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipTypesModule", - fieldName: "deleteMembershipTypesModule", + operation: 'mutation', + operationName: 'MembershipTypesModule', + fieldName: 'deleteMembershipTypesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/membershipsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/membershipsModule.ts index ce4375291b..66b41bce21 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/membershipsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/membershipsModule.ts @@ -3,56 +3,96 @@ * @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 { MembershipsModule, MembershipsModuleWithRelations, MembershipsModuleSelect, MembershipsModuleFilter, MembershipsModuleOrderBy, CreateMembershipsModuleInput, UpdateMembershipsModuleInput, MembershipsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MembershipsModule, + MembershipsModuleWithRelations, + MembershipsModuleSelect, + MembershipsModuleFilter, + MembershipsModuleOrderBy, + CreateMembershipsModuleInput, + UpdateMembershipsModuleInput, + MembershipsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MembershipsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipsModule", "membershipsModules", 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 - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MembershipsModule', + 'membershipsModules', + 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, + }, + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModules", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MembershipsModule", "membershipsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MembershipsModule', + 'membershipsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModule", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MembershipsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipsModule": data.membershipsModules?.nodes?.[0] ?? null - }) + membershipsModule: data.membershipsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ membershipsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MembershipsModule", "membershipsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MembershipsModule', + 'membershipsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MembershipsModuleFilter", "MembershipsModuleOrderBy", connectionFieldsMap); + 'MembershipsModuleFilter', + 'MembershipsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MembershipsModule", - fieldName: "membershipsModule", + operation: 'query', + operationName: 'MembershipsModule', + fieldName: 'membershipsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MembershipsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "membershipsModule": data.membershipsModules?.nodes?.[0] ?? null - }) + membershipsModule: data.membershipsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MembershipsModule", "createMembershipsModule", "membershipsModule", args.select, args.data, "CreateMembershipsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MembershipsModule', + 'createMembershipsModule', + 'membershipsModule', + args.select, + args.data, + 'CreateMembershipsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "createMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'createMembershipsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MembershipsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MembershipsModule", "updateMembershipsModule", "membershipsModule", args.select, args.where.id, args.data, "UpdateMembershipsModuleInput", "id", "membershipsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MembershipsModule', + 'updateMembershipsModule', + 'membershipsModule', + args.select, + args.where.id, + args.data, + 'UpdateMembershipsModuleInput', + 'id', + 'membershipsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "updateMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'updateMembershipsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMembershipsModule: { membershipsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MembershipsModule", "deleteMembershipsModule", "membershipsModule", { - id: args.where.id - }, "DeleteMembershipsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MembershipsModule', + 'deleteMembershipsModule', + 'membershipsModule', + { + id: args.where.id, + }, + 'DeleteMembershipsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MembershipsModule", - fieldName: "deleteMembershipsModule", + operation: 'mutation', + operationName: 'MembershipsModule', + fieldName: 'deleteMembershipsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/merkleStoreModule.ts b/sdk/constructive-sdk/src/modules/orm/models/merkleStoreModule.ts index 3a6aa3c7c8..d3bb9d0c67 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/merkleStoreModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/merkleStoreModule.ts @@ -3,56 +3,96 @@ * @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 { MerkleStoreModule, MerkleStoreModuleWithRelations, MerkleStoreModuleSelect, MerkleStoreModuleFilter, MerkleStoreModuleOrderBy, CreateMerkleStoreModuleInput, UpdateMerkleStoreModuleInput, MerkleStoreModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + MerkleStoreModule, + MerkleStoreModuleWithRelations, + MerkleStoreModuleSelect, + MerkleStoreModuleFilter, + MerkleStoreModuleOrderBy, + CreateMerkleStoreModuleInput, + UpdateMerkleStoreModuleInput, + MerkleStoreModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class MerkleStoreModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("MerkleStoreModule", "merkleStoreModules", 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 - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + 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, + }, + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModules", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("MerkleStoreModule", "merkleStoreModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModule", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class MerkleStoreModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "merkleStoreModule": data.merkleStoreModules?.nodes?.[0] ?? null - }) + merkleStoreModule: data.merkleStoreModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ merkleStoreModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("MerkleStoreModule", "merkleStoreModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'MerkleStoreModule', + 'merkleStoreModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "MerkleStoreModuleFilter", "MerkleStoreModuleOrderBy", connectionFieldsMap); + 'MerkleStoreModuleFilter', + 'MerkleStoreModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "MerkleStoreModule", - fieldName: "merkleStoreModule", + operation: 'query', + operationName: 'MerkleStoreModule', + fieldName: 'merkleStoreModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class MerkleStoreModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "merkleStoreModule": data.merkleStoreModules?.nodes?.[0] ?? null - }) + merkleStoreModule: data.merkleStoreModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("MerkleStoreModule", "createMerkleStoreModule", "merkleStoreModule", args.select, args.data, "CreateMerkleStoreModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'MerkleStoreModule', + 'createMerkleStoreModule', + 'merkleStoreModule', + args.select, + args.data, + 'CreateMerkleStoreModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "createMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'createMerkleStoreModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + MerkleStoreModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("MerkleStoreModule", "updateMerkleStoreModule", "merkleStoreModule", args.select, args.where.id, args.data, "UpdateMerkleStoreModuleInput", "id", "merkleStoreModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'MerkleStoreModule', + 'updateMerkleStoreModule', + 'merkleStoreModule', + args.select, + args.where.id, + args.data, + 'UpdateMerkleStoreModuleInput', + 'id', + 'merkleStoreModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "updateMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'updateMerkleStoreModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteMerkleStoreModule: { merkleStoreModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("MerkleStoreModule", "deleteMerkleStoreModule", "merkleStoreModule", { - id: args.where.id - }, "DeleteMerkleStoreModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'MerkleStoreModule', + 'deleteMerkleStoreModule', + 'merkleStoreModule', + { + id: args.where.id, + }, + 'DeleteMerkleStoreModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "MerkleStoreModule", - fieldName: "deleteMerkleStoreModule", + operation: 'mutation', + operationName: 'MerkleStoreModule', + fieldName: 'deleteMerkleStoreModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/namespaceModule.ts b/sdk/constructive-sdk/src/modules/orm/models/namespaceModule.ts index 582b808922..bd5c681504 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/namespaceModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/namespaceModule.ts @@ -3,56 +3,96 @@ * @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 { NamespaceModule, NamespaceModuleWithRelations, NamespaceModuleSelect, NamespaceModuleFilter, NamespaceModuleOrderBy, CreateNamespaceModuleInput, UpdateNamespaceModuleInput, NamespaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NamespaceModule, + NamespaceModuleWithRelations, + NamespaceModuleSelect, + NamespaceModuleFilter, + NamespaceModuleOrderBy, + CreateNamespaceModuleInput, + UpdateNamespaceModuleInput, + NamespaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NamespaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceModule", "namespaceModules", 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 - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NamespaceModule', + 'namespaceModules', + 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, + }, + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModules", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NamespaceModule", "namespaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NamespaceModule', + 'namespaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModule", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NamespaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceModule": data.namespaceModules?.nodes?.[0] ?? null - }) + namespaceModule: data.namespaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ namespaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NamespaceModule", "namespaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NamespaceModule', + 'namespaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NamespaceModuleFilter", "NamespaceModuleOrderBy", connectionFieldsMap); + 'NamespaceModuleFilter', + 'NamespaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NamespaceModule", - fieldName: "namespaceModule", + operation: 'query', + operationName: 'NamespaceModule', + fieldName: 'namespaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NamespaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "namespaceModule": data.namespaceModules?.nodes?.[0] ?? null - }) + namespaceModule: data.namespaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NamespaceModule", "createNamespaceModule", "namespaceModule", args.select, args.data, "CreateNamespaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NamespaceModule', + 'createNamespaceModule', + 'namespaceModule', + args.select, + args.data, + 'CreateNamespaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "createNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'createNamespaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NamespaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NamespaceModule", "updateNamespaceModule", "namespaceModule", args.select, args.where.id, args.data, "UpdateNamespaceModuleInput", "id", "namespaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NamespaceModule', + 'updateNamespaceModule', + 'namespaceModule', + args.select, + args.where.id, + args.data, + 'UpdateNamespaceModuleInput', + 'id', + 'namespaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "updateNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'updateNamespaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNamespaceModule: { namespaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NamespaceModule", "deleteNamespaceModule", "namespaceModule", { - id: args.where.id - }, "DeleteNamespaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NamespaceModule', + 'deleteNamespaceModule', + 'namespaceModule', + { + id: args.where.id, + }, + 'DeleteNamespaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NamespaceModule", - fieldName: "deleteNamespaceModule", + operation: 'mutation', + operationName: 'NamespaceModule', + fieldName: 'deleteNamespaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/notificationsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/notificationsModule.ts index 2957519a06..a629d81108 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/notificationsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/notificationsModule.ts @@ -3,56 +3,96 @@ * @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 { NotificationsModule, NotificationsModuleWithRelations, NotificationsModuleSelect, NotificationsModuleFilter, NotificationsModuleOrderBy, CreateNotificationsModuleInput, UpdateNotificationsModuleInput, NotificationsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + NotificationsModule, + NotificationsModuleWithRelations, + NotificationsModuleSelect, + NotificationsModuleFilter, + NotificationsModuleOrderBy, + CreateNotificationsModuleInput, + UpdateNotificationsModuleInput, + NotificationsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class NotificationsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("NotificationsModule", "notificationsModules", 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 - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'NotificationsModule', + 'notificationsModules', + 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, + }, + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModules", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("NotificationsModule", "notificationsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'NotificationsModule', + 'notificationsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModule", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class NotificationsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "notificationsModule": data.notificationsModules?.nodes?.[0] ?? null - }) + notificationsModule: data.notificationsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ notificationsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("NotificationsModule", "notificationsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'NotificationsModule', + 'notificationsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "NotificationsModuleFilter", "NotificationsModuleOrderBy", connectionFieldsMap); + 'NotificationsModuleFilter', + 'NotificationsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "NotificationsModule", - fieldName: "notificationsModule", + operation: 'query', + operationName: 'NotificationsModule', + fieldName: 'notificationsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class NotificationsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "notificationsModule": data.notificationsModules?.nodes?.[0] ?? null - }) + notificationsModule: data.notificationsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("NotificationsModule", "createNotificationsModule", "notificationsModule", args.select, args.data, "CreateNotificationsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'NotificationsModule', + 'createNotificationsModule', + 'notificationsModule', + args.select, + args.data, + 'CreateNotificationsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "createNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'createNotificationsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + NotificationsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("NotificationsModule", "updateNotificationsModule", "notificationsModule", args.select, args.where.id, args.data, "UpdateNotificationsModuleInput", "id", "notificationsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'NotificationsModule', + 'updateNotificationsModule', + 'notificationsModule', + args.select, + args.where.id, + args.data, + 'UpdateNotificationsModuleInput', + 'id', + 'notificationsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "updateNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'updateNotificationsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteNotificationsModule: { notificationsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("NotificationsModule", "deleteNotificationsModule", "notificationsModule", { - id: args.where.id - }, "DeleteNotificationsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'NotificationsModule', + 'deleteNotificationsModule', + 'notificationsModule', + { + id: args.where.id, + }, + 'DeleteNotificationsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "NotificationsModule", - fieldName: "deleteNotificationsModule", + operation: 'mutation', + operationName: 'NotificationsModule', + fieldName: 'deleteNotificationsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/permissionsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/permissionsModule.ts index 1b7e756241..2a330457b5 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/permissionsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/permissionsModule.ts @@ -3,56 +3,96 @@ * @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 { PermissionsModule, PermissionsModuleWithRelations, PermissionsModuleSelect, PermissionsModuleFilter, PermissionsModuleOrderBy, CreatePermissionsModuleInput, UpdatePermissionsModuleInput, PermissionsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PermissionsModule, + PermissionsModuleWithRelations, + PermissionsModuleSelect, + PermissionsModuleFilter, + PermissionsModuleOrderBy, + CreatePermissionsModuleInput, + UpdatePermissionsModuleInput, + PermissionsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PermissionsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PermissionsModule", "permissionsModules", 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 - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PermissionsModule', + 'permissionsModules', + 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, + }, + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModules", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PermissionsModule", "permissionsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PermissionsModule', + 'permissionsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModule", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PermissionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "permissionsModule": data.permissionsModules?.nodes?.[0] ?? null - }) + permissionsModule: data.permissionsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ permissionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PermissionsModule", "permissionsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PermissionsModule', + 'permissionsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PermissionsModuleFilter", "PermissionsModuleOrderBy", connectionFieldsMap); + 'PermissionsModuleFilter', + 'PermissionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PermissionsModule", - fieldName: "permissionsModule", + operation: 'query', + operationName: 'PermissionsModule', + fieldName: 'permissionsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PermissionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "permissionsModule": data.permissionsModules?.nodes?.[0] ?? null - }) + permissionsModule: data.permissionsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PermissionsModule", "createPermissionsModule", "permissionsModule", args.select, args.data, "CreatePermissionsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PermissionsModule', + 'createPermissionsModule', + 'permissionsModule', + args.select, + args.data, + 'CreatePermissionsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "createPermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'createPermissionsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PermissionsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PermissionsModule", "updatePermissionsModule", "permissionsModule", args.select, args.where.id, args.data, "UpdatePermissionsModuleInput", "id", "permissionsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PermissionsModule', + 'updatePermissionsModule', + 'permissionsModule', + args.select, + args.where.id, + args.data, + 'UpdatePermissionsModuleInput', + 'id', + 'permissionsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "updatePermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'updatePermissionsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePermissionsModule: { permissionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PermissionsModule", "deletePermissionsModule", "permissionsModule", { - id: args.where.id - }, "DeletePermissionsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PermissionsModule', + 'deletePermissionsModule', + 'permissionsModule', + { + id: args.where.id, + }, + 'DeletePermissionsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PermissionsModule", - fieldName: "deletePermissionsModule", + operation: 'mutation', + operationName: 'PermissionsModule', + fieldName: 'deletePermissionsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/phoneNumbersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/phoneNumbersModule.ts index ee3e5afa0f..42cbdfc98f 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/phoneNumbersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/phoneNumbersModule.ts @@ -3,56 +3,96 @@ * @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 { PhoneNumbersModule, PhoneNumbersModuleWithRelations, PhoneNumbersModuleSelect, PhoneNumbersModuleFilter, PhoneNumbersModuleOrderBy, CreatePhoneNumbersModuleInput, UpdatePhoneNumbersModuleInput, PhoneNumbersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PhoneNumbersModule, + PhoneNumbersModuleWithRelations, + PhoneNumbersModuleSelect, + PhoneNumbersModuleFilter, + PhoneNumbersModuleOrderBy, + CreatePhoneNumbersModuleInput, + UpdatePhoneNumbersModuleInput, + PhoneNumbersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PhoneNumbersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumbersModule", "phoneNumbersModules", 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 - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + 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, + }, + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModules", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PhoneNumbersModule", "phoneNumbersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModule", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PhoneNumbersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumbersModule": data.phoneNumbersModules?.nodes?.[0] ?? null - }) + phoneNumbersModule: data.phoneNumbersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ phoneNumbersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PhoneNumbersModule", "phoneNumbersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PhoneNumbersModule', + 'phoneNumbersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PhoneNumbersModuleFilter", "PhoneNumbersModuleOrderBy", connectionFieldsMap); + 'PhoneNumbersModuleFilter', + 'PhoneNumbersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PhoneNumbersModule", - fieldName: "phoneNumbersModule", + operation: 'query', + operationName: 'PhoneNumbersModule', + fieldName: 'phoneNumbersModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PhoneNumbersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "phoneNumbersModule": data.phoneNumbersModules?.nodes?.[0] ?? null - }) + phoneNumbersModule: data.phoneNumbersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PhoneNumbersModule", "createPhoneNumbersModule", "phoneNumbersModule", args.select, args.data, "CreatePhoneNumbersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PhoneNumbersModule', + 'createPhoneNumbersModule', + 'phoneNumbersModule', + args.select, + args.data, + 'CreatePhoneNumbersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "createPhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'createPhoneNumbersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PhoneNumbersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PhoneNumbersModule", "updatePhoneNumbersModule", "phoneNumbersModule", args.select, args.where.id, args.data, "UpdatePhoneNumbersModuleInput", "id", "phoneNumbersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PhoneNumbersModule', + 'updatePhoneNumbersModule', + 'phoneNumbersModule', + args.select, + args.where.id, + args.data, + 'UpdatePhoneNumbersModuleInput', + 'id', + 'phoneNumbersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "updatePhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'updatePhoneNumbersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePhoneNumbersModule: { phoneNumbersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PhoneNumbersModule", "deletePhoneNumbersModule", "phoneNumbersModule", { - id: args.where.id - }, "DeletePhoneNumbersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PhoneNumbersModule', + 'deletePhoneNumbersModule', + 'phoneNumbersModule', + { + id: args.where.id, + }, + 'DeletePhoneNumbersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PhoneNumbersModule", - fieldName: "deletePhoneNumbersModule", + operation: 'mutation', + operationName: 'PhoneNumbersModule', + fieldName: 'deletePhoneNumbersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/plansModule.ts b/sdk/constructive-sdk/src/modules/orm/models/plansModule.ts index aef90eafc2..545fbdd7cb 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/plansModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/plansModule.ts @@ -3,56 +3,96 @@ * @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 { PlansModule, PlansModuleWithRelations, PlansModuleSelect, PlansModuleFilter, PlansModuleOrderBy, CreatePlansModuleInput, UpdatePlansModuleInput, PlansModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + PlansModule, + PlansModuleWithRelations, + PlansModuleSelect, + PlansModuleFilter, + PlansModuleOrderBy, + CreatePlansModuleInput, + UpdatePlansModuleInput, + PlansModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class PlansModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("PlansModule", "plansModules", 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 - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'PlansModule', + 'plansModules', + 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, + }, + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModules", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("PlansModule", "plansModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'PlansModule', + 'plansModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModule", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PlansModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "plansModule": data.plansModules?.nodes?.[0] ?? null - }) + plansModule: data.plansModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ plansModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PlansModule", "plansModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PlansModule', + 'plansModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PlansModuleFilter", "PlansModuleOrderBy", connectionFieldsMap); + 'PlansModuleFilter', + 'PlansModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PlansModule", - fieldName: "plansModule", + operation: 'query', + operationName: 'PlansModule', + fieldName: 'plansModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PlansModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "plansModule": data.plansModules?.nodes?.[0] ?? null - }) + plansModule: data.plansModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PlansModule", "createPlansModule", "plansModule", args.select, args.data, "CreatePlansModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'PlansModule', + 'createPlansModule', + 'plansModule', + args.select, + args.data, + 'CreatePlansModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "createPlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'createPlansModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlansModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updatePlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("PlansModule", "updatePlansModule", "plansModule", args.select, args.where.id, args.data, "UpdatePlansModuleInput", "id", "plansModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'PlansModule', + 'updatePlansModule', + 'plansModule', + args.select, + args.where.id, + args.data, + 'UpdatePlansModuleInput', + 'id', + 'plansModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "updatePlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'updatePlansModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deletePlansModule: { plansModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("PlansModule", "deletePlansModule", "plansModule", { - id: args.where.id - }, "DeletePlansModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'PlansModule', + 'deletePlansModule', + 'plansModule', + { + id: args.where.id, + }, + 'DeletePlansModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "PlansModule", - fieldName: "deletePlansModule", + operation: 'mutation', + operationName: 'PlansModule', + fieldName: 'deletePlansModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/principalAuthModule.ts b/sdk/constructive-sdk/src/modules/orm/models/principalAuthModule.ts index fcf622bb0f..c0e9d913d3 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/principalAuthModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/principalAuthModule.ts @@ -3,56 +3,96 @@ * @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"; +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<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class PrincipalAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalAuthModule": data.principalAuthModules?.nodes?.[0] ?? null - }) + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ principalAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("PrincipalAuthModule", "principalAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "PrincipalAuthModuleFilter", "PrincipalAuthModuleOrderBy", connectionFieldsMap); + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "PrincipalAuthModule", - fieldName: "principalAuthModule", + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class PrincipalAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "principalAuthModule": data.principalAuthModules?.nodes?.[0] ?? null - }) + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createPrincipalAuthModule: { principalAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("PrincipalAuthModule", "createPrincipalAuthModule", "principalAuthModule", args.select, args.data, "CreatePrincipalAuthModuleInput", connectionFieldsMap); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'createPrincipalAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'updatePrincipalAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + 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); + 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", + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'deletePrincipalAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/profilesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/profilesModule.ts index 1fc4cff3fb..15d5a94e79 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/profilesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/profilesModule.ts @@ -3,56 +3,96 @@ * @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 { ProfilesModule, ProfilesModuleWithRelations, ProfilesModuleSelect, ProfilesModuleFilter, ProfilesModuleOrderBy, CreateProfilesModuleInput, UpdateProfilesModuleInput, ProfilesModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ProfilesModule, + ProfilesModuleWithRelations, + ProfilesModuleSelect, + ProfilesModuleFilter, + ProfilesModuleOrderBy, + CreateProfilesModuleInput, + UpdateProfilesModuleInput, + ProfilesModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ProfilesModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ProfilesModule", "profilesModules", 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 - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ProfilesModule', + 'profilesModules', + 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, + }, + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModules", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ProfilesModule", "profilesModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ProfilesModule', + 'profilesModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModule", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ProfilesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "profilesModule": data.profilesModules?.nodes?.[0] ?? null - }) + profilesModule: data.profilesModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ profilesModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ProfilesModule", "profilesModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ProfilesModule', + 'profilesModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ProfilesModuleFilter", "ProfilesModuleOrderBy", connectionFieldsMap); + 'ProfilesModuleFilter', + 'ProfilesModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ProfilesModule", - fieldName: "profilesModule", + operation: 'query', + operationName: 'ProfilesModule', + fieldName: 'profilesModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ProfilesModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "profilesModule": data.profilesModules?.nodes?.[0] ?? null - }) + profilesModule: data.profilesModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ProfilesModule", "createProfilesModule", "profilesModule", args.select, args.data, "CreateProfilesModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ProfilesModule', + 'createProfilesModule', + 'profilesModule', + args.select, + args.data, + 'CreateProfilesModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "createProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'createProfilesModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ProfilesModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ProfilesModule", "updateProfilesModule", "profilesModule", args.select, args.where.id, args.data, "UpdateProfilesModuleInput", "id", "profilesModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ProfilesModule', + 'updateProfilesModule', + 'profilesModule', + args.select, + args.where.id, + args.data, + 'UpdateProfilesModuleInput', + 'id', + 'profilesModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "updateProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'updateProfilesModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteProfilesModule: { profilesModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ProfilesModule", "deleteProfilesModule", "profilesModule", { - id: args.where.id - }, "DeleteProfilesModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ProfilesModule', + 'deleteProfilesModule', + 'profilesModule', + { + id: args.where.id, + }, + 'DeleteProfilesModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ProfilesModule", - fieldName: "deleteProfilesModule", + operation: 'mutation', + operationName: 'ProfilesModule', + fieldName: 'deleteProfilesModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/rateLimitMetersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/rateLimitMetersModule.ts index cfa9903246..1205e581d8 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/rateLimitMetersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/rateLimitMetersModule.ts @@ -3,56 +3,98 @@ * @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 { RateLimitMetersModule, RateLimitMetersModuleWithRelations, RateLimitMetersModuleSelect, RateLimitMetersModuleFilter, RateLimitMetersModuleOrderBy, CreateRateLimitMetersModuleInput, UpdateRateLimitMetersModuleInput, RateLimitMetersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RateLimitMetersModule, + RateLimitMetersModuleWithRelations, + RateLimitMetersModuleSelect, + RateLimitMetersModuleFilter, + RateLimitMetersModuleOrderBy, + CreateRateLimitMetersModuleInput, + UpdateRateLimitMetersModuleInput, + RateLimitMetersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RateLimitMetersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - rateLimitMetersModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + rateLimitMetersModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitMetersModule", "rateLimitMetersModules", 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 - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + 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, + }, + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModules", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitMetersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RateLimitMetersModule", "rateLimitMetersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModule", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class RateLimitMetersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitMetersModule": data.rateLimitMetersModules?.nodes?.[0] ?? null - }) + rateLimitMetersModule: data.rateLimitMetersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitMetersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitMetersModule", "rateLimitMetersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RateLimitMetersModule', + 'rateLimitMetersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RateLimitMetersModuleFilter", "RateLimitMetersModuleOrderBy", connectionFieldsMap); + 'RateLimitMetersModuleFilter', + 'RateLimitMetersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitMetersModule", - fieldName: "rateLimitMetersModule", + operation: 'query', + operationName: 'RateLimitMetersModule', + fieldName: 'rateLimitMetersModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class RateLimitMetersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitMetersModule": data.rateLimitMetersModules?.nodes?.[0] ?? null - }) + rateLimitMetersModule: data.rateLimitMetersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RateLimitMetersModule", "createRateLimitMetersModule", "rateLimitMetersModule", args.select, args.data, "CreateRateLimitMetersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RateLimitMetersModule', + 'createRateLimitMetersModule', + 'rateLimitMetersModule', + args.select, + args.data, + 'CreateRateLimitMetersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "createRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'createRateLimitMetersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RateLimitMetersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RateLimitMetersModule", "updateRateLimitMetersModule", "rateLimitMetersModule", args.select, args.where.id, args.data, "UpdateRateLimitMetersModuleInput", "id", "rateLimitMetersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RateLimitMetersModule', + 'updateRateLimitMetersModule', + 'rateLimitMetersModule', + args.select, + args.where.id, + args.data, + 'UpdateRateLimitMetersModuleInput', + 'id', + 'rateLimitMetersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "updateRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'updateRateLimitMetersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRateLimitMetersModule: { rateLimitMetersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RateLimitMetersModule", "deleteRateLimitMetersModule", "rateLimitMetersModule", { - id: args.where.id - }, "DeleteRateLimitMetersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RateLimitMetersModule', + 'deleteRateLimitMetersModule', + 'rateLimitMetersModule', + { + id: args.where.id, + }, + 'DeleteRateLimitMetersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitMetersModule", - fieldName: "deleteRateLimitMetersModule", + operation: 'mutation', + operationName: 'RateLimitMetersModule', + fieldName: 'deleteRateLimitMetersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/rateLimitsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/rateLimitsModule.ts index 854856d9e4..dbf9501696 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/rateLimitsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/rateLimitsModule.ts @@ -3,56 +3,96 @@ * @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 { RateLimitsModule, RateLimitsModuleWithRelations, RateLimitsModuleSelect, RateLimitsModuleFilter, RateLimitsModuleOrderBy, CreateRateLimitsModuleInput, UpdateRateLimitsModuleInput, RateLimitsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RateLimitsModule, + RateLimitsModuleWithRelations, + RateLimitsModuleSelect, + RateLimitsModuleFilter, + RateLimitsModuleOrderBy, + CreateRateLimitsModuleInput, + UpdateRateLimitsModuleInput, + RateLimitsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RateLimitsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitsModule", "rateLimitsModules", 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 - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RateLimitsModule', + 'rateLimitsModules', + 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, + }, + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModules", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RateLimitsModule", "rateLimitsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RateLimitsModule', + 'rateLimitsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModule", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RateLimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitsModule": data.rateLimitsModules?.nodes?.[0] ?? null - }) + rateLimitsModule: data.rateLimitsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rateLimitsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RateLimitsModule", "rateLimitsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RateLimitsModule', + 'rateLimitsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RateLimitsModuleFilter", "RateLimitsModuleOrderBy", connectionFieldsMap); + 'RateLimitsModuleFilter', + 'RateLimitsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RateLimitsModule", - fieldName: "rateLimitsModule", + operation: 'query', + operationName: 'RateLimitsModule', + fieldName: 'rateLimitsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RateLimitsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rateLimitsModule": data.rateLimitsModules?.nodes?.[0] ?? null - }) + rateLimitsModule: data.rateLimitsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RateLimitsModule", "createRateLimitsModule", "rateLimitsModule", args.select, args.data, "CreateRateLimitsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RateLimitsModule', + 'createRateLimitsModule', + 'rateLimitsModule', + args.select, + args.data, + 'CreateRateLimitsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "createRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'createRateLimitsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RateLimitsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RateLimitsModule", "updateRateLimitsModule", "rateLimitsModule", args.select, args.where.id, args.data, "UpdateRateLimitsModuleInput", "id", "rateLimitsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RateLimitsModule', + 'updateRateLimitsModule', + 'rateLimitsModule', + args.select, + args.where.id, + args.data, + 'UpdateRateLimitsModuleInput', + 'id', + 'rateLimitsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "updateRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'updateRateLimitsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRateLimitsModule: { rateLimitsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RateLimitsModule", "deleteRateLimitsModule", "rateLimitsModule", { - id: args.where.id - }, "DeleteRateLimitsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RateLimitsModule', + 'deleteRateLimitsModule', + 'rateLimitsModule', + { + id: args.where.id, + }, + 'DeleteRateLimitsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RateLimitsModule", - fieldName: "deleteRateLimitsModule", + operation: 'mutation', + operationName: 'RateLimitsModule', + fieldName: 'deleteRateLimitsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/realtimeModule.ts b/sdk/constructive-sdk/src/modules/orm/models/realtimeModule.ts index a7be0753e0..2cb1075457 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/realtimeModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/realtimeModule.ts @@ -3,56 +3,96 @@ * @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 { RealtimeModule, RealtimeModuleWithRelations, RealtimeModuleSelect, RealtimeModuleFilter, RealtimeModuleOrderBy, CreateRealtimeModuleInput, UpdateRealtimeModuleInput, RealtimeModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RealtimeModule, + RealtimeModuleWithRelations, + RealtimeModuleSelect, + RealtimeModuleFilter, + RealtimeModuleOrderBy, + CreateRealtimeModuleInput, + UpdateRealtimeModuleInput, + RealtimeModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RealtimeModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RealtimeModule", "realtimeModules", 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 - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RealtimeModule', + 'realtimeModules', + 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, + }, + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModules", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RealtimeModule", "realtimeModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RealtimeModule', + 'realtimeModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModule", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RealtimeModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "realtimeModule": data.realtimeModules?.nodes?.[0] ?? null - }) + realtimeModule: data.realtimeModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ realtimeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RealtimeModule", "realtimeModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RealtimeModule', + 'realtimeModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RealtimeModuleFilter", "RealtimeModuleOrderBy", connectionFieldsMap); + 'RealtimeModuleFilter', + 'RealtimeModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RealtimeModule", - fieldName: "realtimeModule", + operation: 'query', + operationName: 'RealtimeModule', + fieldName: 'realtimeModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RealtimeModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "realtimeModule": data.realtimeModules?.nodes?.[0] ?? null - }) + realtimeModule: data.realtimeModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RealtimeModule", "createRealtimeModule", "realtimeModule", args.select, args.data, "CreateRealtimeModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RealtimeModule', + 'createRealtimeModule', + 'realtimeModule', + args.select, + args.data, + 'CreateRealtimeModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "createRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'createRealtimeModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RealtimeModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RealtimeModule", "updateRealtimeModule", "realtimeModule", args.select, args.where.id, args.data, "UpdateRealtimeModuleInput", "id", "realtimeModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RealtimeModule', + 'updateRealtimeModule', + 'realtimeModule', + args.select, + args.where.id, + args.data, + 'UpdateRealtimeModuleInput', + 'id', + 'realtimeModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "updateRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'updateRealtimeModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRealtimeModule: { realtimeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RealtimeModule", "deleteRealtimeModule", "realtimeModule", { - id: args.where.id - }, "DeleteRealtimeModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RealtimeModule', + 'deleteRealtimeModule', + 'realtimeModule', + { + id: args.where.id, + }, + 'DeleteRealtimeModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RealtimeModule", - fieldName: "deleteRealtimeModule", + operation: 'mutation', + operationName: 'RealtimeModule', + fieldName: 'deleteRealtimeModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/relationProvision.ts b/sdk/constructive-sdk/src/modules/orm/models/relationProvision.ts index 267d8855f3..c8bc481ca9 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/relationProvision.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/relationProvision.ts @@ -3,56 +3,96 @@ * @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 { RelationProvision, RelationProvisionWithRelations, RelationProvisionSelect, RelationProvisionFilter, RelationProvisionOrderBy, CreateRelationProvisionInput, UpdateRelationProvisionInput, RelationProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RelationProvision, + RelationProvisionWithRelations, + RelationProvisionSelect, + RelationProvisionFilter, + RelationProvisionOrderBy, + CreateRelationProvisionInput, + UpdateRelationProvisionInput, + RelationProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RelationProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvisions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RelationProvision", "relationProvisions", 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 - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RelationProvision', + 'relationProvisions', + 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, + }, + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvisions", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RelationProvision", "relationProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RelationProvision', + 'relationProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvision", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvision', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RelationProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "relationProvision": data.relationProvisions?.nodes?.[0] ?? null - }) + relationProvision: data.relationProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ relationProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RelationProvision", "relationProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RelationProvision', + 'relationProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RelationProvisionFilter", "RelationProvisionOrderBy", connectionFieldsMap); + 'RelationProvisionFilter', + 'RelationProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RelationProvision", - fieldName: "relationProvision", + operation: 'query', + operationName: 'RelationProvision', + fieldName: 'relationProvision', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RelationProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "relationProvision": data.relationProvisions?.nodes?.[0] ?? null - }) + relationProvision: data.relationProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RelationProvision", "createRelationProvision", "relationProvision", args.select, args.data, "CreateRelationProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RelationProvision', + 'createRelationProvision', + 'relationProvision', + args.select, + args.data, + 'CreateRelationProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "createRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'createRelationProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RelationProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RelationProvision", "updateRelationProvision", "relationProvision", args.select, args.where.id, args.data, "UpdateRelationProvisionInput", "id", "relationProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RelationProvision', + 'updateRelationProvision', + 'relationProvision', + args.select, + args.where.id, + args.data, + 'UpdateRelationProvisionInput', + 'id', + 'relationProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "updateRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'updateRelationProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRelationProvision: { relationProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RelationProvision", "deleteRelationProvision", "relationProvision", { - id: args.where.id - }, "DeleteRelationProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RelationProvision', + 'deleteRelationProvision', + 'relationProvision', + { + id: args.where.id, + }, + 'DeleteRelationProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RelationProvision", - fieldName: "deleteRelationProvision", + operation: 'mutation', + operationName: 'RelationProvision', + fieldName: 'deleteRelationProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/resourceModule.ts b/sdk/constructive-sdk/src/modules/orm/models/resourceModule.ts index 9f1e49821a..8fef54a24a 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/resourceModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/resourceModule.ts @@ -3,56 +3,96 @@ * @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 { ResourceModule, ResourceModuleWithRelations, ResourceModuleSelect, ResourceModuleFilter, ResourceModuleOrderBy, CreateResourceModuleInput, UpdateResourceModuleInput, ResourceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + ResourceModule, + ResourceModuleWithRelations, + ResourceModuleSelect, + ResourceModuleFilter, + ResourceModuleOrderBy, + CreateResourceModuleInput, + UpdateResourceModuleInput, + ResourceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ResourceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceModule", "resourceModules", 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 - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'ResourceModule', + 'resourceModules', + 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, + }, + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModules", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("ResourceModule", "resourceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'ResourceModule', + 'resourceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModule", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class ResourceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceModule": data.resourceModules?.nodes?.[0] ?? null - }) + resourceModule: data.resourceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ resourceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("ResourceModule", "resourceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'ResourceModule', + 'resourceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "ResourceModuleFilter", "ResourceModuleOrderBy", connectionFieldsMap); + 'ResourceModuleFilter', + 'ResourceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "ResourceModule", - fieldName: "resourceModule", + operation: 'query', + operationName: 'ResourceModule', + fieldName: 'resourceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class ResourceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "resourceModule": data.resourceModules?.nodes?.[0] ?? null - }) + resourceModule: data.resourceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("ResourceModule", "createResourceModule", "resourceModule", args.select, args.data, "CreateResourceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'ResourceModule', + 'createResourceModule', + 'resourceModule', + args.select, + args.data, + 'CreateResourceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "createResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'createResourceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + ResourceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("ResourceModule", "updateResourceModule", "resourceModule", args.select, args.where.id, args.data, "UpdateResourceModuleInput", "id", "resourceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'ResourceModule', + 'updateResourceModule', + 'resourceModule', + args.select, + args.where.id, + args.data, + 'UpdateResourceModuleInput', + 'id', + 'resourceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "updateResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'updateResourceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteResourceModule: { resourceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("ResourceModule", "deleteResourceModule", "resourceModule", { - id: args.where.id - }, "DeleteResourceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'ResourceModule', + 'deleteResourceModule', + 'resourceModule', + { + id: args.where.id, + }, + 'DeleteResourceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "ResourceModule", - fieldName: "deleteResourceModule", + operation: 'mutation', + operationName: 'ResourceModule', + fieldName: 'deleteResourceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/rlsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/rlsModule.ts index 5d167b4465..6a1c7cae75 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/rlsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/rlsModule.ts @@ -3,56 +3,96 @@ * @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 { RlsModule, RlsModuleWithRelations, RlsModuleSelect, RlsModuleFilter, RlsModuleOrderBy, CreateRlsModuleInput, UpdateRlsModuleInput, RlsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RlsModule, + RlsModuleWithRelations, + RlsModuleSelect, + RlsModuleFilter, + RlsModuleOrderBy, + CreateRlsModuleInput, + UpdateRlsModuleInput, + RlsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RlsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RlsModule", "rlsModules", 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 - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RlsModule', + 'rlsModules', + 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, + }, + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModules", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RlsModule", "rlsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RlsModule', + 'rlsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModule", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RlsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsModule": data.rlsModules?.nodes?.[0] ?? null - }) + rlsModule: data.rlsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ rlsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RlsModule", "rlsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RlsModule', + 'rlsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RlsModuleFilter", "RlsModuleOrderBy", connectionFieldsMap); + 'RlsModuleFilter', + 'RlsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RlsModule", - fieldName: "rlsModule", + operation: 'query', + operationName: 'RlsModule', + fieldName: 'rlsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RlsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "rlsModule": data.rlsModules?.nodes?.[0] ?? null - }) + rlsModule: data.rlsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RlsModule", "createRlsModule", "rlsModule", args.select, args.data, "CreateRlsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RlsModule', + 'createRlsModule', + 'rlsModule', + args.select, + args.data, + 'CreateRlsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "createRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'createRlsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RlsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RlsModule", "updateRlsModule", "rlsModule", args.select, args.where.id, args.data, "UpdateRlsModuleInput", "id", "rlsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RlsModule', + 'updateRlsModule', + 'rlsModule', + args.select, + args.where.id, + args.data, + 'UpdateRlsModuleInput', + 'id', + 'rlsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "updateRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'updateRlsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRlsModule: { rlsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RlsModule", "deleteRlsModule", "rlsModule", { - id: args.where.id - }, "DeleteRlsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RlsModule', + 'deleteRlsModule', + 'rlsModule', + { + id: args.where.id, + }, + 'DeleteRlsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RlsModule", - fieldName: "deleteRlsModule", + operation: 'mutation', + operationName: 'RlsModule', + fieldName: 'deleteRlsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/routeModule.ts b/sdk/constructive-sdk/src/modules/orm/models/routeModule.ts index d663444fdb..d57b13ceac 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/routeModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/routeModule.ts @@ -3,56 +3,96 @@ * @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 { RouteModule, RouteModuleWithRelations, RouteModuleSelect, RouteModuleFilter, RouteModuleOrderBy, CreateRouteModuleInput, UpdateRouteModuleInput, RouteModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + RouteModule, + RouteModuleWithRelations, + RouteModuleSelect, + RouteModuleFilter, + RouteModuleOrderBy, + CreateRouteModuleInput, + UpdateRouteModuleInput, + RouteModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RouteModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("RouteModule", "routeModules", 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 - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'RouteModule', + 'routeModules', + 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, + }, + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModules", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("RouteModule", "routeModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'RouteModule', + 'routeModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModule", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeModule": data.routeModules?.nodes?.[0] ?? null - }) + routeModule: data.routeModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ routeModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("RouteModule", "routeModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'RouteModule', + 'routeModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RouteModuleFilter", "RouteModuleOrderBy", connectionFieldsMap); + 'RouteModuleFilter', + 'RouteModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "RouteModule", - fieldName: "routeModule", + operation: 'query', + operationName: 'RouteModule', + fieldName: 'routeModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class RouteModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "routeModule": data.routeModules?.nodes?.[0] ?? null - }) + routeModule: data.routeModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("RouteModule", "createRouteModule", "routeModule", args.select, args.data, "CreateRouteModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'RouteModule', + 'createRouteModule', + 'routeModule', + args.select, + args.data, + 'CreateRouteModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "createRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'createRouteModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + RouteModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("RouteModule", "updateRouteModule", "routeModule", args.select, args.where.id, args.data, "UpdateRouteModuleInput", "id", "routeModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'RouteModule', + 'updateRouteModule', + 'routeModule', + args.select, + args.where.id, + args.data, + 'UpdateRouteModuleInput', + 'id', + 'routeModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "updateRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'updateRouteModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRouteModule: { routeModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("RouteModule", "deleteRouteModule", "routeModule", { - id: args.where.id - }, "DeleteRouteModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'RouteModule', + 'deleteRouteModule', + 'routeModule', + { + id: args.where.id, + }, + 'DeleteRouteModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "RouteModule", - fieldName: "deleteRouteModule", + operation: 'mutation', + operationName: 'RouteModule', + fieldName: 'deleteRouteModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/secureTableProvision.ts b/sdk/constructive-sdk/src/modules/orm/models/secureTableProvision.ts index d96900112a..88e10489d0 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/secureTableProvision.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/secureTableProvision.ts @@ -3,56 +3,98 @@ * @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 { SecureTableProvision, SecureTableProvisionWithRelations, SecureTableProvisionSelect, SecureTableProvisionFilter, SecureTableProvisionOrderBy, CreateSecureTableProvisionInput, UpdateSecureTableProvisionInput, SecureTableProvisionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SecureTableProvision, + SecureTableProvisionWithRelations, + SecureTableProvisionSelect, + SecureTableProvisionFilter, + SecureTableProvisionOrderBy, + CreateSecureTableProvisionInput, + UpdateSecureTableProvisionInput, + SecureTableProvisionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SecureTableProvisionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - secureTableProvisions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secureTableProvisions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("SecureTableProvision", "secureTableProvisions", 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 - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SecureTableProvision', + 'secureTableProvisions', + 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, + }, + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvisions", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvisions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ secureTableProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SecureTableProvision", "secureTableProvisions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SecureTableProvision', + 'secureTableProvisions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvision", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvision', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class SecureTableProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "secureTableProvision": data.secureTableProvisions?.nodes?.[0] ?? null - }) + secureTableProvision: data.secureTableProvisions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ secureTableProvision: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SecureTableProvision", "secureTableProvisions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SecureTableProvision', + 'secureTableProvisions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SecureTableProvisionFilter", "SecureTableProvisionOrderBy", connectionFieldsMap); + 'SecureTableProvisionFilter', + 'SecureTableProvisionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SecureTableProvision", - fieldName: "secureTableProvision", + operation: 'query', + operationName: 'SecureTableProvision', + fieldName: 'secureTableProvision', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class SecureTableProvisionModel { nodes?: InferSelectResult[]; }; }) => ({ - "secureTableProvision": data.secureTableProvisions?.nodes?.[0] ?? null - }) + secureTableProvision: data.secureTableProvisions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SecureTableProvision", "createSecureTableProvision", "secureTableProvision", args.select, args.data, "CreateSecureTableProvisionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SecureTableProvision', + 'createSecureTableProvision', + 'secureTableProvision', + args.select, + args.data, + 'CreateSecureTableProvisionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "createSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'createSecureTableProvision', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SecureTableProvisionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SecureTableProvision", "updateSecureTableProvision", "secureTableProvision", args.select, args.where.id, args.data, "UpdateSecureTableProvisionInput", "id", "secureTableProvisionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SecureTableProvision', + 'updateSecureTableProvision', + 'secureTableProvision', + args.select, + args.where.id, + args.data, + 'UpdateSecureTableProvisionInput', + 'id', + 'secureTableProvisionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "updateSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'updateSecureTableProvision', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSecureTableProvision: { secureTableProvision: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SecureTableProvision", "deleteSecureTableProvision", "secureTableProvision", { - id: args.where.id - }, "DeleteSecureTableProvisionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SecureTableProvision', + 'deleteSecureTableProvision', + 'secureTableProvision', + { + id: args.where.id, + }, + 'DeleteSecureTableProvisionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SecureTableProvision", - fieldName: "deleteSecureTableProvision", + operation: 'mutation', + operationName: 'SecureTableProvision', + fieldName: 'deleteSecureTableProvision', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/sessionSecretsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/sessionSecretsModule.ts index af5fbcd6f4..9460af6349 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/sessionSecretsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/sessionSecretsModule.ts @@ -3,56 +3,98 @@ * @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 { SessionSecretsModule, SessionSecretsModuleWithRelations, SessionSecretsModuleSelect, SessionSecretsModuleFilter, SessionSecretsModuleOrderBy, CreateSessionSecretsModuleInput, UpdateSessionSecretsModuleInput, SessionSecretsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SessionSecretsModule, + SessionSecretsModuleWithRelations, + SessionSecretsModuleSelect, + SessionSecretsModuleFilter, + SessionSecretsModuleOrderBy, + CreateSessionSecretsModuleInput, + UpdateSessionSecretsModuleInput, + SessionSecretsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SessionSecretsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - sessionSecretsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + sessionSecretsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("SessionSecretsModule", "sessionSecretsModules", 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 - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + 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, + }, + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModules", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SessionSecretsModule", "sessionSecretsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModule", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class SessionSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionSecretsModule": data.sessionSecretsModules?.nodes?.[0] ?? null - }) + sessionSecretsModule: data.sessionSecretsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionSecretsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SessionSecretsModule", "sessionSecretsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SessionSecretsModule', + 'sessionSecretsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SessionSecretsModuleFilter", "SessionSecretsModuleOrderBy", connectionFieldsMap); + 'SessionSecretsModuleFilter', + 'SessionSecretsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionSecretsModule", - fieldName: "sessionSecretsModule", + operation: 'query', + operationName: 'SessionSecretsModule', + fieldName: 'sessionSecretsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class SessionSecretsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionSecretsModule": data.sessionSecretsModules?.nodes?.[0] ?? null - }) + sessionSecretsModule: data.sessionSecretsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SessionSecretsModule", "createSessionSecretsModule", "sessionSecretsModule", args.select, args.data, "CreateSessionSecretsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SessionSecretsModule', + 'createSessionSecretsModule', + 'sessionSecretsModule', + args.select, + args.data, + 'CreateSessionSecretsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "createSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'createSessionSecretsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SessionSecretsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SessionSecretsModule", "updateSessionSecretsModule", "sessionSecretsModule", args.select, args.where.id, args.data, "UpdateSessionSecretsModuleInput", "id", "sessionSecretsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SessionSecretsModule', + 'updateSessionSecretsModule', + 'sessionSecretsModule', + args.select, + args.where.id, + args.data, + 'UpdateSessionSecretsModuleInput', + 'id', + 'sessionSecretsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "updateSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'updateSessionSecretsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSessionSecretsModule: { sessionSecretsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SessionSecretsModule", "deleteSessionSecretsModule", "sessionSecretsModule", { - id: args.where.id - }, "DeleteSessionSecretsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SessionSecretsModule', + 'deleteSessionSecretsModule', + 'sessionSecretsModule', + { + id: args.where.id, + }, + 'DeleteSessionSecretsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionSecretsModule", - fieldName: "deleteSessionSecretsModule", + operation: 'mutation', + operationName: 'SessionSecretsModule', + fieldName: 'deleteSessionSecretsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/sessionsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/sessionsModule.ts index 1b90af533a..324773df9f 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/sessionsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/sessionsModule.ts @@ -3,56 +3,96 @@ * @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 { SessionsModule, SessionsModuleWithRelations, SessionsModuleSelect, SessionsModuleFilter, SessionsModuleOrderBy, CreateSessionsModuleInput, UpdateSessionsModuleInput, SessionsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SessionsModule, + SessionsModuleWithRelations, + SessionsModuleSelect, + SessionsModuleFilter, + SessionsModuleOrderBy, + CreateSessionsModuleInput, + UpdateSessionsModuleInput, + SessionsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SessionsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SessionsModule", "sessionsModules", 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 - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SessionsModule', + 'sessionsModules', + 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, + }, + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModules", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SessionsModule", "sessionsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SessionsModule', + 'sessionsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModule", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SessionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionsModule": data.sessionsModules?.nodes?.[0] ?? null - }) + sessionsModule: data.sessionsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ sessionsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SessionsModule", "sessionsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SessionsModule', + 'sessionsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SessionsModuleFilter", "SessionsModuleOrderBy", connectionFieldsMap); + 'SessionsModuleFilter', + 'SessionsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SessionsModule", - fieldName: "sessionsModule", + operation: 'query', + operationName: 'SessionsModule', + fieldName: 'sessionsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SessionsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "sessionsModule": data.sessionsModules?.nodes?.[0] ?? null - }) + sessionsModule: data.sessionsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SessionsModule", "createSessionsModule", "sessionsModule", args.select, args.data, "CreateSessionsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SessionsModule', + 'createSessionsModule', + 'sessionsModule', + args.select, + args.data, + 'CreateSessionsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "createSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'createSessionsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SessionsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SessionsModule", "updateSessionsModule", "sessionsModule", args.select, args.where.id, args.data, "UpdateSessionsModuleInput", "id", "sessionsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SessionsModule', + 'updateSessionsModule', + 'sessionsModule', + args.select, + args.where.id, + args.data, + 'UpdateSessionsModuleInput', + 'id', + 'sessionsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "updateSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'updateSessionsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSessionsModule: { sessionsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SessionsModule", "deleteSessionsModule", "sessionsModule", { - id: args.where.id - }, "DeleteSessionsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SessionsModule', + 'deleteSessionsModule', + 'sessionsModule', + { + id: args.where.id, + }, + 'DeleteSessionsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SessionsModule", - fieldName: "deleteSessionsModule", + operation: 'mutation', + operationName: 'SessionsModule', + fieldName: 'deleteSessionsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/siteSurfaceModule.ts b/sdk/constructive-sdk/src/modules/orm/models/siteSurfaceModule.ts index 032b2d2cd5..891f21403a 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/siteSurfaceModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/siteSurfaceModule.ts @@ -3,56 +3,96 @@ * @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 { SiteSurfaceModule, SiteSurfaceModuleWithRelations, SiteSurfaceModuleSelect, SiteSurfaceModuleFilter, SiteSurfaceModuleOrderBy, CreateSiteSurfaceModuleInput, UpdateSiteSurfaceModuleInput, SiteSurfaceModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SiteSurfaceModule, + SiteSurfaceModuleWithRelations, + SiteSurfaceModuleSelect, + SiteSurfaceModuleFilter, + SiteSurfaceModuleOrderBy, + CreateSiteSurfaceModuleInput, + UpdateSiteSurfaceModuleInput, + SiteSurfaceModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SiteSurfaceModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SiteSurfaceModule", "siteSurfaceModules", 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 - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + 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, + }, + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModules", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SiteSurfaceModule", "siteSurfaceModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModule", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SiteSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteSurfaceModule": data.siteSurfaceModules?.nodes?.[0] ?? null - }) + siteSurfaceModule: data.siteSurfaceModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ siteSurfaceModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SiteSurfaceModule", "siteSurfaceModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SiteSurfaceModule', + 'siteSurfaceModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SiteSurfaceModuleFilter", "SiteSurfaceModuleOrderBy", connectionFieldsMap); + 'SiteSurfaceModuleFilter', + 'SiteSurfaceModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SiteSurfaceModule", - fieldName: "siteSurfaceModule", + operation: 'query', + operationName: 'SiteSurfaceModule', + fieldName: 'siteSurfaceModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class SiteSurfaceModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "siteSurfaceModule": data.siteSurfaceModules?.nodes?.[0] ?? null - }) + siteSurfaceModule: data.siteSurfaceModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SiteSurfaceModule", "createSiteSurfaceModule", "siteSurfaceModule", args.select, args.data, "CreateSiteSurfaceModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SiteSurfaceModule', + 'createSiteSurfaceModule', + 'siteSurfaceModule', + args.select, + args.data, + 'CreateSiteSurfaceModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "createSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'createSiteSurfaceModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + SiteSurfaceModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("SiteSurfaceModule", "updateSiteSurfaceModule", "siteSurfaceModule", args.select, args.where.id, args.data, "UpdateSiteSurfaceModuleInput", "id", "siteSurfaceModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'SiteSurfaceModule', + 'updateSiteSurfaceModule', + 'siteSurfaceModule', + args.select, + args.where.id, + args.data, + 'UpdateSiteSurfaceModuleInput', + 'id', + 'siteSurfaceModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "updateSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'updateSiteSurfaceModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteSiteSurfaceModule: { siteSurfaceModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("SiteSurfaceModule", "deleteSiteSurfaceModule", "siteSurfaceModule", { - id: args.where.id - }, "DeleteSiteSurfaceModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'SiteSurfaceModule', + 'deleteSiteSurfaceModule', + 'siteSurfaceModule', + { + id: args.where.id, + }, + 'DeleteSiteSurfaceModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SiteSurfaceModule", - fieldName: "deleteSiteSurfaceModule", + operation: 'mutation', + operationName: 'SiteSurfaceModule', + fieldName: 'deleteSiteSurfaceModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/storageLogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/storageLogModule.ts index e94ce03e99..a53edf15d1 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/storageLogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/storageLogModule.ts @@ -3,56 +3,96 @@ * @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 { StorageLogModule, StorageLogModuleWithRelations, StorageLogModuleSelect, StorageLogModuleFilter, StorageLogModuleOrderBy, CreateStorageLogModuleInput, UpdateStorageLogModuleInput, StorageLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + StorageLogModule, + StorageLogModuleWithRelations, + StorageLogModuleSelect, + StorageLogModuleFilter, + StorageLogModuleOrderBy, + CreateStorageLogModuleInput, + UpdateStorageLogModuleInput, + StorageLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StorageLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("StorageLogModule", "storageLogModules", 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 - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'StorageLogModule', + 'storageLogModules', + 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, + }, + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModules", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("StorageLogModule", "storageLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'StorageLogModule', + 'storageLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModule", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StorageLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageLogModule": data.storageLogModules?.nodes?.[0] ?? null - }) + storageLogModule: data.storageLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ storageLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("StorageLogModule", "storageLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'StorageLogModule', + 'storageLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StorageLogModuleFilter", "StorageLogModuleOrderBy", connectionFieldsMap); + 'StorageLogModuleFilter', + 'StorageLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageLogModule", - fieldName: "storageLogModule", + operation: 'query', + operationName: 'StorageLogModule', + fieldName: 'storageLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StorageLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageLogModule": data.storageLogModules?.nodes?.[0] ?? null - }) + storageLogModule: data.storageLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("StorageLogModule", "createStorageLogModule", "storageLogModule", args.select, args.data, "CreateStorageLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'StorageLogModule', + 'createStorageLogModule', + 'storageLogModule', + args.select, + args.data, + 'CreateStorageLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "createStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'createStorageLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorageLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("StorageLogModule", "updateStorageLogModule", "storageLogModule", args.select, args.where.id, args.data, "UpdateStorageLogModuleInput", "id", "storageLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'StorageLogModule', + 'updateStorageLogModule', + 'storageLogModule', + args.select, + args.where.id, + args.data, + 'UpdateStorageLogModuleInput', + 'id', + 'storageLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "updateStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'updateStorageLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStorageLogModule: { storageLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("StorageLogModule", "deleteStorageLogModule", "storageLogModule", { - id: args.where.id - }, "DeleteStorageLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'StorageLogModule', + 'deleteStorageLogModule', + 'storageLogModule', + { + id: args.where.id, + }, + 'DeleteStorageLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageLogModule", - fieldName: "deleteStorageLogModule", + operation: 'mutation', + operationName: 'StorageLogModule', + fieldName: 'deleteStorageLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/storageModule.ts b/sdk/constructive-sdk/src/modules/orm/models/storageModule.ts index 05877e81a0..f69dd6e624 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/storageModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/storageModule.ts @@ -3,56 +3,96 @@ * @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 { StorageModule, StorageModuleWithRelations, StorageModuleSelect, StorageModuleFilter, StorageModuleOrderBy, CreateStorageModuleInput, UpdateStorageModuleInput, StorageModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + StorageModule, + StorageModuleWithRelations, + StorageModuleSelect, + StorageModuleFilter, + StorageModuleOrderBy, + CreateStorageModuleInput, + UpdateStorageModuleInput, + StorageModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StorageModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("StorageModule", "storageModules", 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 - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'StorageModule', + 'storageModules', + 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, + }, + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModules", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("StorageModule", "storageModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'StorageModule', + 'storageModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModule", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StorageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageModule": data.storageModules?.nodes?.[0] ?? null - }) + storageModule: data.storageModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ storageModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("StorageModule", "storageModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'StorageModule', + 'storageModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StorageModuleFilter", "StorageModuleOrderBy", connectionFieldsMap); + 'StorageModuleFilter', + 'StorageModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "StorageModule", - fieldName: "storageModule", + operation: 'query', + operationName: 'StorageModule', + fieldName: 'storageModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StorageModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "storageModule": data.storageModules?.nodes?.[0] ?? null - }) + storageModule: data.storageModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("StorageModule", "createStorageModule", "storageModule", args.select, args.data, "CreateStorageModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'StorageModule', + 'createStorageModule', + 'storageModule', + args.select, + args.data, + 'CreateStorageModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "createStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'createStorageModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorageModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("StorageModule", "updateStorageModule", "storageModule", args.select, args.where.id, args.data, "UpdateStorageModuleInput", "id", "storageModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'StorageModule', + 'updateStorageModule', + 'storageModule', + args.select, + args.where.id, + args.data, + 'UpdateStorageModuleInput', + 'id', + 'storageModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "updateStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'updateStorageModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStorageModule: { storageModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("StorageModule", "deleteStorageModule", "storageModule", { - id: args.where.id - }, "DeleteStorageModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'StorageModule', + 'deleteStorageModule', + 'storageModule', + { + id: args.where.id, + }, + 'DeleteStorageModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "StorageModule", - fieldName: "deleteStorageModule", + operation: 'mutation', + operationName: 'StorageModule', + fieldName: 'deleteStorageModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/transferLogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/transferLogModule.ts index 6c929a1b6b..cab2bec096 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/transferLogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/transferLogModule.ts @@ -3,56 +3,96 @@ * @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 { TransferLogModule, TransferLogModuleWithRelations, TransferLogModuleSelect, TransferLogModuleFilter, TransferLogModuleOrderBy, CreateTransferLogModuleInput, UpdateTransferLogModuleInput, TransferLogModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + TransferLogModule, + TransferLogModuleWithRelations, + TransferLogModuleSelect, + TransferLogModuleFilter, + TransferLogModuleOrderBy, + CreateTransferLogModuleInput, + UpdateTransferLogModuleInput, + TransferLogModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class TransferLogModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("TransferLogModule", "transferLogModules", 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 - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'TransferLogModule', + 'transferLogModules', + 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, + }, + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModules", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("TransferLogModule", "transferLogModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'TransferLogModule', + 'transferLogModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModule", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class TransferLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "transferLogModule": data.transferLogModules?.nodes?.[0] ?? null - }) + transferLogModule: data.transferLogModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ transferLogModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("TransferLogModule", "transferLogModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'TransferLogModule', + 'transferLogModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "TransferLogModuleFilter", "TransferLogModuleOrderBy", connectionFieldsMap); + 'TransferLogModuleFilter', + 'TransferLogModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "TransferLogModule", - fieldName: "transferLogModule", + operation: 'query', + operationName: 'TransferLogModule', + fieldName: 'transferLogModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class TransferLogModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "transferLogModule": data.transferLogModules?.nodes?.[0] ?? null - }) + transferLogModule: data.transferLogModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("TransferLogModule", "createTransferLogModule", "transferLogModule", args.select, args.data, "CreateTransferLogModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'TransferLogModule', + 'createTransferLogModule', + 'transferLogModule', + args.select, + args.data, + 'CreateTransferLogModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "createTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'createTransferLogModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + TransferLogModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("TransferLogModule", "updateTransferLogModule", "transferLogModule", args.select, args.where.id, args.data, "UpdateTransferLogModuleInput", "id", "transferLogModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'TransferLogModule', + 'updateTransferLogModule', + 'transferLogModule', + args.select, + args.where.id, + args.data, + 'UpdateTransferLogModuleInput', + 'id', + 'transferLogModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "updateTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'updateTransferLogModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteTransferLogModule: { transferLogModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("TransferLogModule", "deleteTransferLogModule", "transferLogModule", { - id: args.where.id - }, "DeleteTransferLogModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'TransferLogModule', + 'deleteTransferLogModule', + 'transferLogModule', + { + id: args.where.id, + }, + 'DeleteTransferLogModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "TransferLogModule", - fieldName: "deleteTransferLogModule", + operation: 'mutation', + operationName: 'TransferLogModule', + fieldName: 'deleteTransferLogModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/userAuthModule.ts b/sdk/constructive-sdk/src/modules/orm/models/userAuthModule.ts index edc18d6631..341885e14c 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/userAuthModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/userAuthModule.ts @@ -3,56 +3,96 @@ * @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 { UserAuthModule, UserAuthModuleWithRelations, UserAuthModuleSelect, UserAuthModuleFilter, UserAuthModuleOrderBy, CreateUserAuthModuleInput, UpdateUserAuthModuleInput, UserAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserAuthModule, + UserAuthModuleWithRelations, + UserAuthModuleSelect, + UserAuthModuleFilter, + UserAuthModuleOrderBy, + CreateUserAuthModuleInput, + UpdateUserAuthModuleInput, + UserAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserAuthModule", "userAuthModules", 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 - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserAuthModule', + 'userAuthModules', + 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, + }, + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModules", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserAuthModule", "userAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserAuthModule', + 'userAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModule", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userAuthModule": data.userAuthModules?.nodes?.[0] ?? null - }) + userAuthModule: data.userAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserAuthModule", "userAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserAuthModule', + 'userAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserAuthModuleFilter", "UserAuthModuleOrderBy", connectionFieldsMap); + 'UserAuthModuleFilter', + 'UserAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserAuthModule", - fieldName: "userAuthModule", + operation: 'query', + operationName: 'UserAuthModule', + fieldName: 'userAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userAuthModule": data.userAuthModules?.nodes?.[0] ?? null - }) + userAuthModule: data.userAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserAuthModule", "createUserAuthModule", "userAuthModule", args.select, args.data, "CreateUserAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserAuthModule', + 'createUserAuthModule', + 'userAuthModule', + args.select, + args.data, + 'CreateUserAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "createUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'createUserAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserAuthModule", "updateUserAuthModule", "userAuthModule", args.select, args.where.id, args.data, "UpdateUserAuthModuleInput", "id", "userAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserAuthModule', + 'updateUserAuthModule', + 'userAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateUserAuthModuleInput', + 'id', + 'userAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "updateUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'updateUserAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserAuthModule: { userAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserAuthModule", "deleteUserAuthModule", "userAuthModule", { - id: args.where.id - }, "DeleteUserAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserAuthModule', + 'deleteUserAuthModule', + 'userAuthModule', + { + id: args.where.id, + }, + 'DeleteUserAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserAuthModule", - fieldName: "deleteUserAuthModule", + operation: 'mutation', + operationName: 'UserAuthModule', + fieldName: 'deleteUserAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/userCredentialsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/userCredentialsModule.ts index 64bd269be4..9e9bc0b2aa 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/userCredentialsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/userCredentialsModule.ts @@ -3,56 +3,98 @@ * @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 { UserCredentialsModule, UserCredentialsModuleWithRelations, UserCredentialsModuleSelect, UserCredentialsModuleFilter, UserCredentialsModuleOrderBy, CreateUserCredentialsModuleInput, UpdateUserCredentialsModuleInput, UserCredentialsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserCredentialsModule, + UserCredentialsModuleWithRelations, + UserCredentialsModuleSelect, + UserCredentialsModuleFilter, + UserCredentialsModuleOrderBy, + CreateUserCredentialsModuleInput, + UpdateUserCredentialsModuleInput, + UserCredentialsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserCredentialsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - userCredentialsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + userCredentialsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("UserCredentialsModule", "userCredentialsModules", 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 - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + 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, + }, + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModules", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserCredentialsModule", "userCredentialsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModule", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class UserCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userCredentialsModule": data.userCredentialsModules?.nodes?.[0] ?? null - }) + userCredentialsModule: data.userCredentialsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserCredentialsModule", "userCredentialsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserCredentialsModule', + 'userCredentialsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserCredentialsModuleFilter", "UserCredentialsModuleOrderBy", connectionFieldsMap); + 'UserCredentialsModuleFilter', + 'UserCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserCredentialsModule", - fieldName: "userCredentialsModule", + operation: 'query', + operationName: 'UserCredentialsModule', + fieldName: 'userCredentialsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class UserCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userCredentialsModule": data.userCredentialsModules?.nodes?.[0] ?? null - }) + userCredentialsModule: data.userCredentialsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserCredentialsModule", "createUserCredentialsModule", "userCredentialsModule", args.select, args.data, "CreateUserCredentialsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserCredentialsModule', + 'createUserCredentialsModule', + 'userCredentialsModule', + args.select, + args.data, + 'CreateUserCredentialsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "createUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'createUserCredentialsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserCredentialsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserCredentialsModule", "updateUserCredentialsModule", "userCredentialsModule", args.select, args.where.id, args.data, "UpdateUserCredentialsModuleInput", "id", "userCredentialsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserCredentialsModule', + 'updateUserCredentialsModule', + 'userCredentialsModule', + args.select, + args.where.id, + args.data, + 'UpdateUserCredentialsModuleInput', + 'id', + 'userCredentialsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "updateUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'updateUserCredentialsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserCredentialsModule: { userCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserCredentialsModule", "deleteUserCredentialsModule", "userCredentialsModule", { - id: args.where.id - }, "DeleteUserCredentialsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserCredentialsModule', + 'deleteUserCredentialsModule', + 'userCredentialsModule', + { + id: args.where.id, + }, + 'DeleteUserCredentialsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserCredentialsModule", - fieldName: "deleteUserCredentialsModule", + operation: 'mutation', + operationName: 'UserCredentialsModule', + fieldName: 'deleteUserCredentialsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/userSettingsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/userSettingsModule.ts index 4452bc7186..252d0cc8bf 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/userSettingsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/userSettingsModule.ts @@ -3,56 +3,96 @@ * @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 { UserSettingsModule, UserSettingsModuleWithRelations, UserSettingsModuleSelect, UserSettingsModuleFilter, UserSettingsModuleOrderBy, CreateUserSettingsModuleInput, UpdateUserSettingsModuleInput, UserSettingsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserSettingsModule, + UserSettingsModuleWithRelations, + UserSettingsModuleSelect, + UserSettingsModuleFilter, + UserSettingsModuleOrderBy, + CreateUserSettingsModuleInput, + UpdateUserSettingsModuleInput, + UserSettingsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserSettingsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserSettingsModule", "userSettingsModules", 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 - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserSettingsModule', + 'userSettingsModules', + 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, + }, + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModules", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserSettingsModule", "userSettingsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserSettingsModule', + 'userSettingsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModule", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userSettingsModule": data.userSettingsModules?.nodes?.[0] ?? null - }) + userSettingsModule: data.userSettingsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userSettingsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserSettingsModule", "userSettingsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserSettingsModule', + 'userSettingsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserSettingsModuleFilter", "UserSettingsModuleOrderBy", connectionFieldsMap); + 'UserSettingsModuleFilter', + 'UserSettingsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserSettingsModule", - fieldName: "userSettingsModule", + operation: 'query', + operationName: 'UserSettingsModule', + fieldName: 'userSettingsModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserSettingsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userSettingsModule": data.userSettingsModules?.nodes?.[0] ?? null - }) + userSettingsModule: data.userSettingsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserSettingsModule", "createUserSettingsModule", "userSettingsModule", args.select, args.data, "CreateUserSettingsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserSettingsModule', + 'createUserSettingsModule', + 'userSettingsModule', + args.select, + args.data, + 'CreateUserSettingsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "createUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'createUserSettingsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserSettingsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserSettingsModule", "updateUserSettingsModule", "userSettingsModule", args.select, args.where.id, args.data, "UpdateUserSettingsModuleInput", "id", "userSettingsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserSettingsModule', + 'updateUserSettingsModule', + 'userSettingsModule', + args.select, + args.where.id, + args.data, + 'UpdateUserSettingsModuleInput', + 'id', + 'userSettingsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "updateUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'updateUserSettingsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserSettingsModule: { userSettingsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserSettingsModule", "deleteUserSettingsModule", "userSettingsModule", { - id: args.where.id - }, "DeleteUserSettingsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserSettingsModule', + 'deleteUserSettingsModule', + 'userSettingsModule', + { + id: args.where.id, + }, + 'DeleteUserSettingsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserSettingsModule", - fieldName: "deleteUserSettingsModule", + operation: 'mutation', + operationName: 'UserSettingsModule', + fieldName: 'deleteUserSettingsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/userStateModule.ts b/sdk/constructive-sdk/src/modules/orm/models/userStateModule.ts index 14649c4d10..86999c74ae 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/userStateModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/userStateModule.ts @@ -3,56 +3,96 @@ * @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 { UserStateModule, UserStateModuleWithRelations, UserStateModuleSelect, UserStateModuleFilter, UserStateModuleOrderBy, CreateUserStateModuleInput, UpdateUserStateModuleInput, UserStateModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UserStateModule, + UserStateModuleWithRelations, + UserStateModuleSelect, + UserStateModuleFilter, + UserStateModuleOrderBy, + CreateUserStateModuleInput, + UpdateUserStateModuleInput, + UserStateModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UserStateModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UserStateModule", "userStateModules", 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 - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UserStateModule', + 'userStateModules', + 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, + }, + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModules", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UserStateModule", "userStateModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UserStateModule', + 'userStateModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModule", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UserStateModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userStateModule": data.userStateModules?.nodes?.[0] ?? null - }) + userStateModule: data.userStateModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ userStateModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UserStateModule", "userStateModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UserStateModule', + 'userStateModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UserStateModuleFilter", "UserStateModuleOrderBy", connectionFieldsMap); + 'UserStateModuleFilter', + 'UserStateModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UserStateModule", - fieldName: "userStateModule", + operation: 'query', + operationName: 'UserStateModule', + fieldName: 'userStateModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UserStateModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "userStateModule": data.userStateModules?.nodes?.[0] ?? null - }) + userStateModule: data.userStateModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UserStateModule", "createUserStateModule", "userStateModule", args.select, args.data, "CreateUserStateModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UserStateModule', + 'createUserStateModule', + 'userStateModule', + args.select, + args.data, + 'CreateUserStateModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "createUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'createUserStateModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UserStateModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UserStateModule", "updateUserStateModule", "userStateModule", args.select, args.where.id, args.data, "UpdateUserStateModuleInput", "id", "userStateModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UserStateModule', + 'updateUserStateModule', + 'userStateModule', + args.select, + args.where.id, + args.data, + 'UpdateUserStateModuleInput', + 'id', + 'userStateModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "updateUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'updateUserStateModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUserStateModule: { userStateModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UserStateModule", "deleteUserStateModule", "userStateModule", { - id: args.where.id - }, "DeleteUserStateModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UserStateModule', + 'deleteUserStateModule', + 'userStateModule', + { + id: args.where.id, + }, + 'DeleteUserStateModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UserStateModule", - fieldName: "deleteUserStateModule", + operation: 'mutation', + operationName: 'UserStateModule', + fieldName: 'deleteUserStateModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/usersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/usersModule.ts index 487116399e..950038fcf0 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/usersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/usersModule.ts @@ -3,56 +3,96 @@ * @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 { UsersModule, UsersModuleWithRelations, UsersModuleSelect, UsersModuleFilter, UsersModuleOrderBy, CreateUsersModuleInput, UpdateUsersModuleInput, UsersModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + UsersModule, + UsersModuleWithRelations, + UsersModuleSelect, + UsersModuleFilter, + UsersModuleOrderBy, + CreateUsersModuleInput, + UpdateUsersModuleInput, + UsersModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class UsersModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("UsersModule", "usersModules", 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 - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'UsersModule', + 'usersModules', + 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, + }, + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModules", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("UsersModule", "usersModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'UsersModule', + 'usersModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModule", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class UsersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "usersModule": data.usersModules?.nodes?.[0] ?? null - }) + usersModule: data.usersModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ usersModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("UsersModule", "usersModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'UsersModule', + 'usersModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "UsersModuleFilter", "UsersModuleOrderBy", connectionFieldsMap); + 'UsersModuleFilter', + 'UsersModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "UsersModule", - fieldName: "usersModule", + operation: 'query', + operationName: 'UsersModule', + fieldName: 'usersModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class UsersModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "usersModule": data.usersModules?.nodes?.[0] ?? null - }) + usersModule: data.usersModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("UsersModule", "createUsersModule", "usersModule", args.select, args.data, "CreateUsersModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'UsersModule', + 'createUsersModule', + 'usersModule', + args.select, + args.data, + 'CreateUsersModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "createUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'createUsersModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + UsersModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("UsersModule", "updateUsersModule", "usersModule", args.select, args.where.id, args.data, "UpdateUsersModuleInput", "id", "usersModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'UsersModule', + 'updateUsersModule', + 'usersModule', + args.select, + args.where.id, + args.data, + 'UpdateUsersModuleInput', + 'id', + 'usersModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "updateUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'updateUsersModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteUsersModule: { usersModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("UsersModule", "deleteUsersModule", "usersModule", { - id: args.where.id - }, "DeleteUsersModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'UsersModule', + 'deleteUsersModule', + 'usersModule', + { + id: args.where.id, + }, + 'DeleteUsersModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "UsersModule", - fieldName: "deleteUsersModule", + operation: 'mutation', + operationName: 'UsersModule', + fieldName: 'deleteUsersModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/webauthnAuthModule.ts b/sdk/constructive-sdk/src/modules/orm/models/webauthnAuthModule.ts index 8859f120d7..e8cdb4eb61 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/webauthnAuthModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/webauthnAuthModule.ts @@ -3,56 +3,96 @@ * @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 { WebauthnAuthModule, WebauthnAuthModuleWithRelations, WebauthnAuthModuleSelect, WebauthnAuthModuleFilter, WebauthnAuthModuleOrderBy, CreateWebauthnAuthModuleInput, UpdateWebauthnAuthModuleInput, WebauthnAuthModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnAuthModule, + WebauthnAuthModuleWithRelations, + WebauthnAuthModuleSelect, + WebauthnAuthModuleFilter, + WebauthnAuthModuleOrderBy, + CreateWebauthnAuthModuleInput, + UpdateWebauthnAuthModuleInput, + WebauthnAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnAuthModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnAuthModule", "webauthnAuthModules", 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 - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + 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, + }, + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModules", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnAuthModule", "webauthnAuthModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModule", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebauthnAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnAuthModule": data.webauthnAuthModules?.nodes?.[0] ?? null - }) + webauthnAuthModule: data.webauthnAuthModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnAuthModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnAuthModule", "webauthnAuthModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnAuthModule', + 'webauthnAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnAuthModuleFilter", "WebauthnAuthModuleOrderBy", connectionFieldsMap); + 'WebauthnAuthModuleFilter', + 'WebauthnAuthModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnAuthModule", - fieldName: "webauthnAuthModule", + operation: 'query', + operationName: 'WebauthnAuthModule', + fieldName: 'webauthnAuthModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebauthnAuthModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnAuthModule": data.webauthnAuthModules?.nodes?.[0] ?? null - }) + webauthnAuthModule: data.webauthnAuthModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnAuthModule", "createWebauthnAuthModule", "webauthnAuthModule", args.select, args.data, "CreateWebauthnAuthModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnAuthModule', + 'createWebauthnAuthModule', + 'webauthnAuthModule', + args.select, + args.data, + 'CreateWebauthnAuthModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "createWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'createWebauthnAuthModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnAuthModule", "updateWebauthnAuthModule", "webauthnAuthModule", args.select, args.where.id, args.data, "UpdateWebauthnAuthModuleInput", "id", "webauthnAuthModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnAuthModule', + 'updateWebauthnAuthModule', + 'webauthnAuthModule', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnAuthModuleInput', + 'id', + 'webauthnAuthModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "updateWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'updateWebauthnAuthModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnAuthModule: { webauthnAuthModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnAuthModule", "deleteWebauthnAuthModule", "webauthnAuthModule", { - id: args.where.id - }, "DeleteWebauthnAuthModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnAuthModule', + 'deleteWebauthnAuthModule', + 'webauthnAuthModule', + { + id: args.where.id, + }, + 'DeleteWebauthnAuthModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnAuthModule", - fieldName: "deleteWebauthnAuthModule", + operation: 'mutation', + operationName: 'WebauthnAuthModule', + fieldName: 'deleteWebauthnAuthModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/webauthnCredentialsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/webauthnCredentialsModule.ts index 8c2a060a9e..fd73e47620 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/webauthnCredentialsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/webauthnCredentialsModule.ts @@ -3,56 +3,98 @@ * @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 { WebauthnCredentialsModule, WebauthnCredentialsModuleWithRelations, WebauthnCredentialsModuleSelect, WebauthnCredentialsModuleFilter, WebauthnCredentialsModuleOrderBy, CreateWebauthnCredentialsModuleInput, UpdateWebauthnCredentialsModuleInput, WebauthnCredentialsModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebauthnCredentialsModule, + WebauthnCredentialsModuleWithRelations, + WebauthnCredentialsModuleSelect, + WebauthnCredentialsModuleFilter, + WebauthnCredentialsModuleOrderBy, + CreateWebauthnCredentialsModuleInput, + UpdateWebauthnCredentialsModuleInput, + WebauthnCredentialsModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebauthnCredentialsModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - webauthnCredentialsModules: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + webauthnCredentialsModules: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", 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 - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + 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, + }, + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModules", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModule", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModule', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class WebauthnCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredentialsModule": data.webauthnCredentialsModules?.nodes?.[0] ?? null - }) + webauthnCredentialsModule: data.webauthnCredentialsModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webauthnCredentialsModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebauthnCredentialsModule", "webauthnCredentialsModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebauthnCredentialsModule', + 'webauthnCredentialsModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebauthnCredentialsModuleFilter", "WebauthnCredentialsModuleOrderBy", connectionFieldsMap); + 'WebauthnCredentialsModuleFilter', + 'WebauthnCredentialsModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebauthnCredentialsModule", - fieldName: "webauthnCredentialsModule", + operation: 'query', + operationName: 'WebauthnCredentialsModule', + fieldName: 'webauthnCredentialsModule', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class WebauthnCredentialsModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webauthnCredentialsModule": data.webauthnCredentialsModules?.nodes?.[0] ?? null - }) + webauthnCredentialsModule: data.webauthnCredentialsModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebauthnCredentialsModule", "createWebauthnCredentialsModule", "webauthnCredentialsModule", args.select, args.data, "CreateWebauthnCredentialsModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebauthnCredentialsModule', + 'createWebauthnCredentialsModule', + 'webauthnCredentialsModule', + args.select, + args.data, + 'CreateWebauthnCredentialsModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "createWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'createWebauthnCredentialsModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebauthnCredentialsModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebauthnCredentialsModule", "updateWebauthnCredentialsModule", "webauthnCredentialsModule", args.select, args.where.id, args.data, "UpdateWebauthnCredentialsModuleInput", "id", "webauthnCredentialsModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebauthnCredentialsModule', + 'updateWebauthnCredentialsModule', + 'webauthnCredentialsModule', + args.select, + args.where.id, + args.data, + 'UpdateWebauthnCredentialsModuleInput', + 'id', + 'webauthnCredentialsModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "updateWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'updateWebauthnCredentialsModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebauthnCredentialsModule: { webauthnCredentialsModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebauthnCredentialsModule", "deleteWebauthnCredentialsModule", "webauthnCredentialsModule", { - id: args.where.id - }, "DeleteWebauthnCredentialsModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebauthnCredentialsModule', + 'deleteWebauthnCredentialsModule', + 'webauthnCredentialsModule', + { + id: args.where.id, + }, + 'DeleteWebauthnCredentialsModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebauthnCredentialsModule", - fieldName: "deleteWebauthnCredentialsModule", + operation: 'mutation', + operationName: 'WebauthnCredentialsModule', + fieldName: 'deleteWebauthnCredentialsModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/webhookModule.ts b/sdk/constructive-sdk/src/modules/orm/models/webhookModule.ts index 027621c87a..d792bcf865 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/webhookModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/webhookModule.ts @@ -3,56 +3,96 @@ * @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 { WebhookModule, WebhookModuleWithRelations, WebhookModuleSelect, WebhookModuleFilter, WebhookModuleOrderBy, CreateWebhookModuleInput, UpdateWebhookModuleInput, WebhookModulePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + WebhookModule, + WebhookModuleWithRelations, + WebhookModuleSelect, + WebhookModuleFilter, + WebhookModuleOrderBy, + CreateWebhookModuleInput, + UpdateWebhookModuleInput, + WebhookModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class WebhookModuleModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModules: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookModule", "webhookModules", 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 - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'WebhookModule', + 'webhookModules', + 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, + }, + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModules", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModules', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("WebhookModule", "webhookModules", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'WebhookModule', + 'webhookModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModule", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModule', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class WebhookModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookModule": data.webhookModules?.nodes?.[0] ?? null - }) + webhookModule: data.webhookModules?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ webhookModule: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("WebhookModule", "webhookModules", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'WebhookModule', + 'webhookModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "WebhookModuleFilter", "WebhookModuleOrderBy", connectionFieldsMap); + 'WebhookModuleFilter', + 'WebhookModuleOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "WebhookModule", - fieldName: "webhookModule", + operation: 'query', + operationName: 'WebhookModule', + fieldName: 'webhookModule', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class WebhookModuleModel { nodes?: InferSelectResult[]; }; }) => ({ - "webhookModule": data.webhookModules?.nodes?.[0] ?? null - }) + webhookModule: data.webhookModules?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("WebhookModule", "createWebhookModule", "webhookModule", args.select, args.data, "CreateWebhookModuleInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'WebhookModule', + 'createWebhookModule', + 'webhookModule', + args.select, + args.data, + 'CreateWebhookModuleInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "createWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'createWebhookModule', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + WebhookModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("WebhookModule", "updateWebhookModule", "webhookModule", args.select, args.where.id, args.data, "UpdateWebhookModuleInput", "id", "webhookModulePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'WebhookModule', + 'updateWebhookModule', + 'webhookModule', + args.select, + args.where.id, + args.data, + 'UpdateWebhookModuleInput', + 'id', + 'webhookModulePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "updateWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'updateWebhookModule', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteWebhookModule: { webhookModule: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("WebhookModule", "deleteWebhookModule", "webhookModule", { - id: args.where.id - }, "DeleteWebhookModuleInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'WebhookModule', + 'deleteWebhookModule', + 'webhookModule', + { + id: args.where.id, + }, + 'DeleteWebhookModuleInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "WebhookModule", - fieldName: "deleteWebhookModule", + operation: 'mutation', + operationName: 'WebhookModule', + fieldName: 'deleteWebhookModule', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/mutation/index.ts b/sdk/constructive-sdk/src/modules/orm/mutation/index.ts index 9720edba22..60041efadb 100644 --- a/sdk/constructive-sdk/src/modules/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/modules/orm/mutation/index.ts @@ -3,11 +3,42 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ConstructBlueprintInput, CopyTemplateToBlueprintInput, ProvisionBucketInput, ProvisionCheckConstraintInput, ProvisionFullTextSearchInput, ProvisionIndexInput, ProvisionRelationInput, ProvisionSpatialRelationInput, ProvisionTableInput, ProvisionUniqueConstraintInput, ConstructBlueprintPayload, CopyTemplateToBlueprintPayload, ProvisionBucketPayload, ProvisionCheckConstraintPayload, ProvisionFullTextSearchPayload, ProvisionIndexPayload, ProvisionRelationPayload, ProvisionSpatialRelationPayload, ProvisionTablePayload, ProvisionUniqueConstraintPayload, ConstructBlueprintPayloadSelect, CopyTemplateToBlueprintPayloadSelect, ProvisionBucketPayloadSelect, ProvisionCheckConstraintPayloadSelect, ProvisionFullTextSearchPayloadSelect, ProvisionIndexPayloadSelect, ProvisionRelationPayloadSelect, ProvisionSpatialRelationPayloadSelect, ProvisionTablePayloadSelect, ProvisionUniqueConstraintPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ConstructBlueprintInput, + CopyTemplateToBlueprintInput, + ProvisionBucketInput, + ProvisionCheckConstraintInput, + ProvisionFullTextSearchInput, + ProvisionIndexInput, + ProvisionRelationInput, + ProvisionSpatialRelationInput, + ProvisionTableInput, + ProvisionUniqueConstraintInput, + ConstructBlueprintPayload, + CopyTemplateToBlueprintPayload, + ProvisionBucketPayload, + ProvisionCheckConstraintPayload, + ProvisionFullTextSearchPayload, + ProvisionIndexPayload, + ProvisionRelationPayload, + ProvisionSpatialRelationPayload, + ProvisionTablePayload, + ProvisionUniqueConstraintPayload, + ConstructBlueprintPayloadSelect, + CopyTemplateToBlueprintPayloadSelect, + ProvisionBucketPayloadSelect, + ProvisionCheckConstraintPayloadSelect, + ProvisionFullTextSearchPayloadSelect, + ProvisionIndexPayloadSelect, + ProvisionRelationPayloadSelect, + ProvisionSpatialRelationPayloadSelect, + ProvisionTablePayloadSelect, + ProvisionUniqueConstraintPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for constructBlueprint * 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 — 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[] — 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. @@ -83,145 +114,295 @@ export interface ProvisionUniqueConstraintVariables { } export function createMutationOperations(client: OrmClient) { return { - constructBlueprint: (args: ConstructBlueprintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - constructBlueprint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ConstructBlueprint", - fieldName: "constructBlueprint", - ...buildCustomDocument("mutation", "ConstructBlueprint", "constructBlueprint", options.select, args, [{ - name: "input", - type: "ConstructBlueprintInput!" - }], connectionFieldsMap, "ConstructBlueprintPayload") - }), - copyTemplateToBlueprint: (args: CopyTemplateToBlueprintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - copyTemplateToBlueprint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "CopyTemplateToBlueprint", - fieldName: "copyTemplateToBlueprint", - ...buildCustomDocument("mutation", "CopyTemplateToBlueprint", "copyTemplateToBlueprint", options.select, args, [{ - name: "input", - type: "CopyTemplateToBlueprintInput!" - }], connectionFieldsMap, "CopyTemplateToBlueprintPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - provisionCheckConstraint: (args: ProvisionCheckConstraintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionCheckConstraint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionCheckConstraint", - fieldName: "provisionCheckConstraint", - ...buildCustomDocument("mutation", "ProvisionCheckConstraint", "provisionCheckConstraint", options.select, args, [{ - name: "input", - type: "ProvisionCheckConstraintInput!" - }], connectionFieldsMap, "ProvisionCheckConstraintPayload") - }), - provisionFullTextSearch: (args: ProvisionFullTextSearchVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionFullTextSearch: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionFullTextSearch", - fieldName: "provisionFullTextSearch", - ...buildCustomDocument("mutation", "ProvisionFullTextSearch", "provisionFullTextSearch", options.select, args, [{ - name: "input", - type: "ProvisionFullTextSearchInput!" - }], connectionFieldsMap, "ProvisionFullTextSearchPayload") - }), - provisionIndex: (args: ProvisionIndexVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionIndex: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionIndex", - fieldName: "provisionIndex", - ...buildCustomDocument("mutation", "ProvisionIndex", "provisionIndex", options.select, args, [{ - name: "input", - type: "ProvisionIndexInput!" - }], connectionFieldsMap, "ProvisionIndexPayload") - }), - provisionRelation: (args: ProvisionRelationVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionRelation: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionRelation", - fieldName: "provisionRelation", - ...buildCustomDocument("mutation", "ProvisionRelation", "provisionRelation", options.select, args, [{ - name: "input", - type: "ProvisionRelationInput!" - }], connectionFieldsMap, "ProvisionRelationPayload") - }), - provisionSpatialRelation: (args: ProvisionSpatialRelationVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionSpatialRelation: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionSpatialRelation", - fieldName: "provisionSpatialRelation", - ...buildCustomDocument("mutation", "ProvisionSpatialRelation", "provisionSpatialRelation", options.select, args, [{ - name: "input", - type: "ProvisionSpatialRelationInput!" - }], connectionFieldsMap, "ProvisionSpatialRelationPayload") - }), - provisionTable: (args: ProvisionTableVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionTable: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionTable", - fieldName: "provisionTable", - ...buildCustomDocument("mutation", "ProvisionTable", "provisionTable", options.select, args, [{ - name: "input", - type: "ProvisionTableInput!" - }], connectionFieldsMap, "ProvisionTablePayload") - }), - provisionUniqueConstraint: (args: ProvisionUniqueConstraintVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionUniqueConstraint: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionUniqueConstraint", - fieldName: "provisionUniqueConstraint", - ...buildCustomDocument("mutation", "ProvisionUniqueConstraint", "provisionUniqueConstraint", options.select, args, [{ - name: "input", - type: "ProvisionUniqueConstraintInput!" - }], connectionFieldsMap, "ProvisionUniqueConstraintPayload") - }) + constructBlueprint: ( + args: ConstructBlueprintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + constructBlueprint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ConstructBlueprint', + fieldName: 'constructBlueprint', + ...buildCustomDocument( + 'mutation', + 'ConstructBlueprint', + 'constructBlueprint', + options.select, + args, + [ + { + name: 'input', + type: 'ConstructBlueprintInput!', + }, + ], + connectionFieldsMap, + 'ConstructBlueprintPayload' + ), + }), + copyTemplateToBlueprint: ( + args: CopyTemplateToBlueprintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyTemplateToBlueprint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyTemplateToBlueprint', + fieldName: 'copyTemplateToBlueprint', + ...buildCustomDocument( + 'mutation', + 'CopyTemplateToBlueprint', + 'copyTemplateToBlueprint', + options.select, + args, + [ + { + name: 'input', + type: 'CopyTemplateToBlueprintInput!', + }, + ], + connectionFieldsMap, + 'CopyTemplateToBlueprintPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + provisionCheckConstraint: ( + args: ProvisionCheckConstraintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionCheckConstraint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionCheckConstraint', + fieldName: 'provisionCheckConstraint', + ...buildCustomDocument( + 'mutation', + 'ProvisionCheckConstraint', + 'provisionCheckConstraint', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionCheckConstraintInput!', + }, + ], + connectionFieldsMap, + 'ProvisionCheckConstraintPayload' + ), + }), + provisionFullTextSearch: ( + args: ProvisionFullTextSearchVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionFullTextSearch: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionFullTextSearch', + fieldName: 'provisionFullTextSearch', + ...buildCustomDocument( + 'mutation', + 'ProvisionFullTextSearch', + 'provisionFullTextSearch', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionFullTextSearchInput!', + }, + ], + connectionFieldsMap, + 'ProvisionFullTextSearchPayload' + ), + }), + provisionIndex: ( + args: ProvisionIndexVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionIndex: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionIndex', + fieldName: 'provisionIndex', + ...buildCustomDocument( + 'mutation', + 'ProvisionIndex', + 'provisionIndex', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionIndexInput!', + }, + ], + connectionFieldsMap, + 'ProvisionIndexPayload' + ), + }), + provisionRelation: ( + args: ProvisionRelationVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionRelation: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionRelation', + fieldName: 'provisionRelation', + ...buildCustomDocument( + 'mutation', + 'ProvisionRelation', + 'provisionRelation', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionRelationInput!', + }, + ], + connectionFieldsMap, + 'ProvisionRelationPayload' + ), + }), + provisionSpatialRelation: ( + args: ProvisionSpatialRelationVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionSpatialRelation: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionSpatialRelation', + fieldName: 'provisionSpatialRelation', + ...buildCustomDocument( + 'mutation', + 'ProvisionSpatialRelation', + 'provisionSpatialRelation', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionSpatialRelationInput!', + }, + ], + connectionFieldsMap, + 'ProvisionSpatialRelationPayload' + ), + }), + provisionTable: ( + args: ProvisionTableVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionTable: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionTable', + fieldName: 'provisionTable', + ...buildCustomDocument( + 'mutation', + 'ProvisionTable', + 'provisionTable', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionTableInput!', + }, + ], + connectionFieldsMap, + 'ProvisionTablePayload' + ), + }), + provisionUniqueConstraint: ( + args: ProvisionUniqueConstraintVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionUniqueConstraint: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionUniqueConstraint', + fieldName: 'provisionUniqueConstraint', + ...buildCustomDocument( + 'mutation', + 'ProvisionUniqueConstraint', + 'provisionUniqueConstraint', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionUniqueConstraintInput!', + }, + ], + connectionFieldsMap, + 'ProvisionUniqueConstraintPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/query-builder.ts b/sdk/constructive-sdk/src/modules/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/modules/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/modules/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/modules/orm/query/index.ts b/sdk/constructive-sdk/src/modules/orm/query/index.ts index 6bb6ccfe36..70496d57ba 100644 --- a/sdk/constructive-sdk/src/modules/orm/query/index.ts +++ b/sdk/constructive-sdk/src/modules/orm/query/index.ts @@ -3,10 +3,10 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for resolveBlueprintField * 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. @@ -29,51 +29,87 @@ export interface ResolveBlueprintTableVariables { } export function createQueryOperations(client: OrmClient) { return { - resolveBlueprintField: (args: ResolveBlueprintFieldVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - resolveBlueprintField: string | null; - }>({ - client, - operation: "query", - operationName: "ResolveBlueprintField", - fieldName: "resolveBlueprintField", - ...buildCustomDocument("query", "ResolveBlueprintField", "resolveBlueprintField", options?.select, args, [{ - name: "databaseId", - type: "UUID" - }, { - name: "fieldName", - type: "String" - }, { - name: "tableId", - type: "UUID" - }], connectionFieldsMap, undefined) - }), - resolveBlueprintTable: (args: ResolveBlueprintTableVariables, options?: { - select?: Record; - }) => new QueryBuilder<{ - resolveBlueprintTable: string | null; - }>({ - client, - operation: "query", - operationName: "ResolveBlueprintTable", - fieldName: "resolveBlueprintTable", - ...buildCustomDocument("query", "ResolveBlueprintTable", "resolveBlueprintTable", options?.select, args, [{ - name: "databaseId", - type: "UUID" - }, { - name: "defaultSchemaId", - type: "UUID" - }, { - name: "schemaName", - type: "String" - }, { - name: "tableMap", - type: "JSON" - }, { - name: "tableName", - type: "String" - }], connectionFieldsMap, undefined) - }) + resolveBlueprintField: ( + args: ResolveBlueprintFieldVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + resolveBlueprintField: string | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveBlueprintField', + fieldName: 'resolveBlueprintField', + ...buildCustomDocument( + 'query', + 'ResolveBlueprintField', + 'resolveBlueprintField', + options?.select, + args, + [ + { + name: 'databaseId', + type: 'UUID', + }, + { + name: 'fieldName', + type: 'String', + }, + { + name: 'tableId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + resolveBlueprintTable: ( + args: ResolveBlueprintTableVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + resolveBlueprintTable: string | null; + }>({ + client, + operation: 'query', + operationName: 'ResolveBlueprintTable', + fieldName: 'resolveBlueprintTable', + ...buildCustomDocument( + 'query', + 'ResolveBlueprintTable', + 'resolveBlueprintTable', + options?.select, + args, + [ + { + name: 'databaseId', + type: 'UUID', + }, + { + name: 'defaultSchemaId', + type: 'UUID', + }, + { + name: 'schemaName', + type: 'String', + }, + { + name: 'tableMap', + type: 'JSON', + }, + { + name: 'tableName', + type: 'String', + }, + ], + connectionFieldsMap, + undefined + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/modules/orm/realtime.ts b/sdk/constructive-sdk/src/modules/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/modules/orm/realtime.ts +++ b/sdk/constructive-sdk/src/modules/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/modules/orm/select-types.ts b/sdk/constructive-sdk/src/modules/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/modules/orm/select-types.ts +++ b/sdk/constructive-sdk/src/modules/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/objects/index.ts b/sdk/constructive-sdk/src/objects/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/objects/index.ts +++ b/sdk/constructive-sdk/src/objects/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/objects/orm/client.ts b/sdk/constructive-sdk/src/objects/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/objects/orm/client.ts +++ b/sdk/constructive-sdk/src/objects/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/objects/orm/index.ts b/sdk/constructive-sdk/src/objects/orm/index.ts index a38f67c89e..9d2f3fb51c 100644 --- a/sdk/constructive-sdk/src/objects/orm/index.ts +++ b/sdk/constructive-sdk/src/objects/orm/index.ts @@ -3,20 +3,20 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { CommitModel } from "./models/commit"; -import { GetAllTreeNodesRecordModel } from "./models/getAllTreeNodesRecord"; -import { ObjectModel } from "./models/object"; -import { RefModel } from "./models/ref"; -import { StoreModel } from "./models/store"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { CommitModel } from './models/commit'; +import { GetAllTreeNodesRecordModel } from './models/getAllTreeNodesRecord'; +import { ObjectModel } from './models/object'; +import { RefModel } from './models/ref'; +import { StoreModel } from './models/store'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -48,6 +48,6 @@ export function createClient(config: OrmClientConfig) { object: new ObjectModel(client), ref: new RefModel(client), store: new StoreModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/objects/orm/input-types.ts b/sdk/constructive-sdk/src/objects/orm/input-types.ts index eca4c2f021..bab07456e0 100644 --- a/sdk/constructive-sdk/src/objects/orm/input-types.ts +++ b/sdk/constructive-sdk/src/objects/orm/input-types.ts @@ -317,7 +317,8 @@ export interface RefRelations {} export interface StoreRelations {} // ============ Entity Types With Relations ============ export type CommitWithRelations = Commit & CommitRelations; -export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & GetAllTreeNodesRecordRelations; +export type GetAllTreeNodesRecordWithRelations = GetAllTreeNodesRecord & + GetAllTreeNodesRecordRelations; export type ObjectWithRelations = Object & ObjectRelations; export type RefWithRelations = Ref & RefRelations; export type StoreWithRelations = Store & StoreRelations; @@ -450,11 +451,80 @@ export interface StoreFilter { or?: StoreFilter[]; } // ============ OrderBy Types ============ -export type CommitOrderBy = "AUTHOR_ID_ASC" | "AUTHOR_ID_DESC" | "COMMITTER_ID_ASC" | "COMMITTER_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATE_ASC" | "DATE_DESC" | "ID_ASC" | "ID_DESC" | "MESSAGE_ASC" | "MESSAGE_DESC" | "NATURAL" | "PARENT_IDS_ASC" | "PARENT_IDS_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC" | "TREE_ID_ASC" | "TREE_ID_DESC"; -export type GetAllTreeNodesRecordsOrderBy = "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "NATURAL" | "DATA_ASC" | "DATA_DESC" | "PATH_ASC" | "PATH_DESC"; -export type ObjectOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DATA_ASC" | "DATA_DESC" | "ID_ASC" | "ID_DESC" | "KIDS_ASC" | "KIDS_DESC" | "KTREE_ASC" | "KTREE_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type RefOrderBy = "COMMIT_ID_ASC" | "COMMIT_ID_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "STORE_ID_ASC" | "STORE_ID_DESC"; -export type StoreOrderBy = "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "HASH_ASC" | "HASH_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; +export type CommitOrderBy = + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'NATURAL' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC'; +export type GetAllTreeNodesRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'DATA_ASC' + | 'DATA_DESC' + | 'PATH_ASC' + | 'PATH_DESC'; +export type ObjectOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type RefOrderBy = + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC'; +export type StoreOrderBy = + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; // ============ CRUD Input Types ============ export interface CreateCommitInput { clientMutationId?: string; @@ -945,4 +1015,4 @@ export type StoreEdgeSelect = { node?: { select: StoreSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/objects/orm/models/commit.ts b/sdk/constructive-sdk/src/objects/orm/models/commit.ts index 271de62194..9f20aeeefc 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/commit.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/commit.ts @@ -3,56 +3,96 @@ * @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 { Commit, CommitWithRelations, CommitSelect, CommitFilter, CommitOrderBy, CreateCommitInput, UpdateCommitInput, CommitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Commit, + CommitWithRelations, + CommitSelect, + CommitFilter, + CommitOrderBy, + CreateCommitInput, + UpdateCommitInput, + CommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class CommitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ commits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Commit", "commits", 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 - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Commit', + 'commits', + 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, + }, + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commits", + operation: 'query', + operationName: 'Commit', + fieldName: 'commits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ commit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Commit", "commits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Commit', + 'commits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commit", + operation: 'query', + operationName: 'Commit', + fieldName: 'commit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class CommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "commit": data.commits?.nodes?.[0] ?? null - }) + commit: data.commits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ commit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Commit", "commits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Commit', + 'commits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "CommitFilter", "CommitOrderBy", connectionFieldsMap); + 'CommitFilter', + 'CommitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Commit", - fieldName: "commit", + operation: 'query', + operationName: 'Commit', + fieldName: 'commit', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class CommitModel { nodes?: InferSelectResult[]; }; }) => ({ - "commit": data.commits?.nodes?.[0] ?? null - }) + commit: data.commits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Commit", "createCommit", "commit", args.select, args.data, "CreateCommitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Commit', + 'createCommit', + 'commit', + args.select, + args.data, + 'CreateCommitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "createCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'createCommit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + CommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Commit", "updateCommit", "commit", args.select, args.where.id, args.data, "UpdateCommitInput", "id", "commitPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Commit', + 'updateCommit', + 'commit', + args.select, + args.where.id, + args.data, + 'UpdateCommitInput', + 'id', + 'commitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "updateCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'updateCommit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteCommit: { commit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Commit", "deleteCommit", "commit", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteCommitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Commit', + 'deleteCommit', + 'commit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteCommitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Commit", - fieldName: "deleteCommit", + operation: 'mutation', + operationName: 'Commit', + fieldName: 'deleteCommit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/objects/orm/models/getAllTreeNodesRecord.ts b/sdk/constructive-sdk/src/objects/orm/models/getAllTreeNodesRecord.ts index bb9b696c09..00f51d01f7 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/getAllTreeNodesRecord.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/getAllTreeNodesRecord.ts @@ -3,56 +3,96 @@ * @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 { GetAllTreeNodesRecord, GetAllTreeNodesRecordWithRelations, GetAllTreeNodesRecordSelect, GetAllTreeNodesRecordFilter, GetAllTreeNodesRecordsOrderBy, CreateGetAllTreeNodesRecordInput, UpdateGetAllTreeNodesRecordInput, GetAllTreeNodesRecordPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + GetAllTreeNodesRecord, + GetAllTreeNodesRecordWithRelations, + GetAllTreeNodesRecordSelect, + GetAllTreeNodesRecordFilter, + GetAllTreeNodesRecordsOrderBy, + CreateGetAllTreeNodesRecordInput, + UpdateGetAllTreeNodesRecordInput, + GetAllTreeNodesRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class GetAllTreeNodesRecordModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("GetAllTreeNodesRecord", "getAllTreeNodes", 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 - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + 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, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodes", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ getAllTreeNodesRecord: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("GetAllTreeNodesRecord", "getAllTreeNodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "GetAllTreeNodesRecordFilter", "GetAllTreeNodesRecordsOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'GetAllTreeNodesRecord', + 'getAllTreeNodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllTreeNodesRecordFilter', + 'GetAllTreeNodesRecordsOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "GetAllTreeNodesRecord", - fieldName: "getAllTreeNodesRecord", + operation: 'query', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'getAllTreeNodesRecord', document, variables, transform: (data: { @@ -60,28 +100,35 @@ export class GetAllTreeNodesRecordModel { nodes?: InferSelectResult[]; }; }) => ({ - "getAllTreeNodesRecord": data.getAllTreeNodes?.nodes?.[0] ?? null - }) + getAllTreeNodesRecord: data.getAllTreeNodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createGetAllTreeNodesRecord: { getAllTreeNodesRecord: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("GetAllTreeNodesRecord", "createGetAllTreeNodesRecord", "getAllTreeNodesRecord", args.select, args.data, "CreateGetAllTreeNodesRecordInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'GetAllTreeNodesRecord', + 'createGetAllTreeNodesRecord', + 'getAllTreeNodesRecord', + args.select, + args.data, + 'CreateGetAllTreeNodesRecordInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "GetAllTreeNodesRecord", - fieldName: "createGetAllTreeNodesRecord", + operation: 'mutation', + operationName: 'GetAllTreeNodesRecord', + fieldName: 'createGetAllTreeNodesRecord', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/objects/orm/models/index.ts b/sdk/constructive-sdk/src/objects/orm/models/index.ts index bc21284ac0..4480ea666b 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/index.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/index.ts @@ -3,8 +3,8 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { CommitModel } from "./commit"; -export { GetAllTreeNodesRecordModel } from "./getAllTreeNodesRecord"; -export { ObjectModel } from "./object"; -export { RefModel } from "./ref"; -export { StoreModel } from "./store"; \ No newline at end of file +export { CommitModel } from './commit'; +export { GetAllTreeNodesRecordModel } from './getAllTreeNodesRecord'; +export { ObjectModel } from './object'; +export { RefModel } from './ref'; +export { StoreModel } from './store'; diff --git a/sdk/constructive-sdk/src/objects/orm/models/object.ts b/sdk/constructive-sdk/src/objects/orm/models/object.ts index b7d1d22830..9470d460f6 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/object.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/object.ts @@ -3,56 +3,96 @@ * @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 { Object, ObjectWithRelations, ObjectSelect, ObjectFilter, ObjectOrderBy, CreateObjectInput, UpdateObjectInput, ObjectPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Object, + ObjectWithRelations, + ObjectSelect, + ObjectFilter, + ObjectOrderBy, + CreateObjectInput, + UpdateObjectInput, + ObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class ObjectModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ objects: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Object", "objects", 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 - }, "ObjectFilter", "ObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Object', + 'objects', + 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, + }, + 'ObjectFilter', + 'ObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "objects", + operation: 'query', + operationName: 'Object', + fieldName: 'objects', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ object: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Object", "objects", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "ObjectFilter", "ObjectOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Object', + 'objects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'ObjectFilter', + 'ObjectOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "object", + operation: 'query', + operationName: 'Object', + fieldName: 'object', document, variables, transform: (data: { @@ -60,98 +100,137 @@ export class ObjectModel { nodes?: InferSelectResult[]; }; }) => ({ - "object": data.objects?.nodes?.[0] ?? null - }) + object: data.objects?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ object: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindOneDocument("Object", "getNodeAtPath", args.id, args.select, "id", "UUID!", connectionFieldsMap); + const { document, variables } = buildFindOneDocument( + 'Object', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Object", - fieldName: "object", + operation: 'query', + operationName: 'Object', + fieldName: 'object', document, - variables + variables, }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Object", "createObject", "object", args.select, args.data, "CreateObjectInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Object', + 'createObject', + 'object', + args.select, + args.data, + 'CreateObjectInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "createObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'createObject', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + ObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Object", "updateObject", "object", args.select, args.where.id, args.data, "UpdateObjectInput", "id", "objectPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Object', + 'updateObject', + 'object', + args.select, + args.where.id, + args.data, + 'UpdateObjectInput', + 'id', + 'objectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "updateObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'updateObject', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteObject: { object: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Object", "deleteObject", "object", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteObjectInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Object', + 'deleteObject', + 'object', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteObjectInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Object", - fieldName: "deleteObject", + operation: 'mutation', + operationName: 'Object', + fieldName: 'deleteObject', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/objects/orm/models/ref.ts b/sdk/constructive-sdk/src/objects/orm/models/ref.ts index 7d19ae58d2..d29b2308a0 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/ref.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/ref.ts @@ -3,56 +3,96 @@ * @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 { Ref, RefWithRelations, RefSelect, RefFilter, RefOrderBy, CreateRefInput, UpdateRefInput, RefPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Ref, + RefWithRelations, + RefSelect, + RefFilter, + RefOrderBy, + CreateRefInput, + UpdateRefInput, + RefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class RefModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ refs: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Ref", "refs", 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 - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Ref', + 'refs', + 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, + }, + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "refs", + operation: 'query', + operationName: 'Ref', + fieldName: 'refs', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ ref: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Ref", "refs", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Ref', + 'refs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "ref", + operation: 'query', + operationName: 'Ref', + fieldName: 'ref', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class RefModel { nodes?: InferSelectResult[]; }; }) => ({ - "ref": data.refs?.nodes?.[0] ?? null - }) + ref: data.refs?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ ref: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Ref", "refs", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Ref', + 'refs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "RefFilter", "RefOrderBy", connectionFieldsMap); + 'RefFilter', + 'RefOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Ref", - fieldName: "ref", + operation: 'query', + operationName: 'Ref', + fieldName: 'ref', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class RefModel { nodes?: InferSelectResult[]; }; }) => ({ - "ref": data.refs?.nodes?.[0] ?? null - }) + ref: data.refs?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Ref", "createRef", "ref", args.select, args.data, "CreateRefInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Ref', + 'createRef', + 'ref', + args.select, + args.data, + 'CreateRefInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "createRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'createRef', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + RefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Ref", "updateRef", "ref", args.select, args.where.id, args.data, "UpdateRefInput", "id", "refPatch", connectionFieldsMap, { - databaseId: args.where.databaseId - }); + const { document, variables } = buildUpdateByPkDocument( + 'Ref', + 'updateRef', + 'ref', + args.select, + args.where.id, + args.data, + 'UpdateRefInput', + 'id', + 'refPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "updateRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'updateRef', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - databaseId: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteRef: { ref: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Ref", "deleteRef", "ref", { - id: args.where.id, - databaseId: args.where.databaseId - }, "DeleteRefInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Ref', + 'deleteRef', + 'ref', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteRefInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Ref", - fieldName: "deleteRef", + operation: 'mutation', + operationName: 'Ref', + fieldName: 'deleteRef', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/objects/orm/models/store.ts b/sdk/constructive-sdk/src/objects/orm/models/store.ts index ed5d14a22e..3e81e5f9ca 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/store.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/store.ts @@ -3,56 +3,96 @@ * @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 { Store, StoreWithRelations, StoreSelect, StoreFilter, StoreOrderBy, CreateStoreInput, UpdateStoreInput, StorePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + Store, + StoreWithRelations, + StoreSelect, + StoreFilter, + StoreOrderBy, + CreateStoreInput, + UpdateStoreInput, + StorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class StoreModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ stores: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("Store", "stores", 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 - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'Store', + 'stores', + 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, + }, + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "stores", + operation: 'query', + operationName: 'Store', + fieldName: 'stores', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ store: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("Store", "stores", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'Store', + 'stores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "store", + operation: 'query', + operationName: 'Store', + fieldName: 'store', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class StoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "store": data.stores?.nodes?.[0] ?? null - }) + store: data.stores?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ store: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("Store", "stores", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'Store', + 'stores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "StoreFilter", "StoreOrderBy", connectionFieldsMap); + 'StoreFilter', + 'StoreOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "Store", - fieldName: "store", + operation: 'query', + operationName: 'Store', + fieldName: 'store', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class StoreModel { nodes?: InferSelectResult[]; }; }) => ({ - "store": data.stores?.nodes?.[0] ?? null - }) + store: data.stores?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("Store", "createStore", "store", args.select, args.data, "CreateStoreInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'Store', + 'createStore', + 'store', + args.select, + args.data, + 'CreateStoreInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "createStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'createStore', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + StorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("Store", "updateStore", "store", args.select, args.where.id, args.data, "UpdateStoreInput", "id", "storePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'Store', + 'updateStore', + 'store', + args.select, + args.where.id, + args.data, + 'UpdateStoreInput', + 'id', + 'storePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "updateStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'updateStore', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteStore: { store: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("Store", "deleteStore", "store", { - id: args.where.id - }, "DeleteStoreInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'Store', + 'deleteStore', + 'store', + { + id: args.where.id, + }, + 'DeleteStoreInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "Store", - fieldName: "deleteStore", + operation: 'mutation', + operationName: 'Store', + fieldName: 'deleteStore', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/objects/orm/mutation/index.ts b/sdk/constructive-sdk/src/objects/orm/mutation/index.ts index 13f2ac7c1e..a0c21cb2bd 100644 --- a/sdk/constructive-sdk/src/objects/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/objects/orm/mutation/index.ts @@ -3,11 +3,24 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { InitEmptyRepoInput, InsertNodeAtPathInput, ProvisionBucketInput, SetDataAtPathInput, InitEmptyRepoPayload, InsertNodeAtPathPayload, ProvisionBucketPayload, SetDataAtPathPayload, InitEmptyRepoPayloadSelect, InsertNodeAtPathPayloadSelect, ProvisionBucketPayloadSelect, SetDataAtPathPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + InitEmptyRepoInput, + InsertNodeAtPathInput, + ProvisionBucketInput, + SetDataAtPathInput, + InitEmptyRepoPayload, + InsertNodeAtPathPayload, + ProvisionBucketPayload, + SetDataAtPathPayload, + InitEmptyRepoPayloadSelect, + InsertNodeAtPathPayloadSelect, + ProvisionBucketPayloadSelect, + SetDataAtPathPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export interface InitEmptyRepoVariables { input: InitEmptyRepoInput; } @@ -29,61 +42,121 @@ export interface SetDataAtPathVariables { } export function createMutationOperations(client: OrmClient) { return { - initEmptyRepo: (args: InitEmptyRepoVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - initEmptyRepo: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InitEmptyRepo", - fieldName: "initEmptyRepo", - ...buildCustomDocument("mutation", "InitEmptyRepo", "initEmptyRepo", options.select, args, [{ - name: "input", - type: "InitEmptyRepoInput!" - }], connectionFieldsMap, "InitEmptyRepoPayload") - }), - insertNodeAtPath: (args: InsertNodeAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - insertNodeAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "InsertNodeAtPath", - fieldName: "insertNodeAtPath", - ...buildCustomDocument("mutation", "InsertNodeAtPath", "insertNodeAtPath", options.select, args, [{ - name: "input", - type: "InsertNodeAtPathInput!" - }], connectionFieldsMap, "InsertNodeAtPathPayload") - }), - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - setDataAtPath: (args: SetDataAtPathVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - setDataAtPath: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SetDataAtPath", - fieldName: "setDataAtPath", - ...buildCustomDocument("mutation", "SetDataAtPath", "setDataAtPath", options.select, args, [{ - name: "input", - type: "SetDataAtPathInput!" - }], connectionFieldsMap, "SetDataAtPathPayload") - }) + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/objects/orm/query-builder.ts b/sdk/constructive-sdk/src/objects/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/objects/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/objects/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/objects/orm/realtime.ts b/sdk/constructive-sdk/src/objects/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/objects/orm/realtime.ts +++ b/sdk/constructive-sdk/src/objects/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/objects/orm/select-types.ts b/sdk/constructive-sdk/src/objects/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/objects/orm/select-types.ts +++ b/sdk/constructive-sdk/src/objects/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/constructive-sdk/src/usage/index.ts b/sdk/constructive-sdk/src/usage/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/constructive-sdk/src/usage/index.ts +++ b/sdk/constructive-sdk/src/usage/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/constructive-sdk/src/usage/orm/client.ts b/sdk/constructive-sdk/src/usage/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/constructive-sdk/src/usage/orm/client.ts +++ b/sdk/constructive-sdk/src/usage/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/constructive-sdk/src/usage/orm/index.ts b/sdk/constructive-sdk/src/usage/orm/index.ts index 2937809ca5..7d48027d3b 100644 --- a/sdk/constructive-sdk/src/usage/orm/index.ts +++ b/sdk/constructive-sdk/src/usage/orm/index.ts @@ -3,33 +3,33 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AppLimitCapModel } from "./models/appLimitCap"; -import { AppLimitCapsDefaultModel } from "./models/appLimitCapsDefault"; -import { AppLimitModel } from "./models/appLimit"; -import { AppLimitCreditCodeModel } from "./models/appLimitCreditCode"; -import { AppLimitCreditCodeItemModel } from "./models/appLimitCreditCodeItem"; -import { AppLimitCreditModel } from "./models/appLimitCredit"; -import { AppLimitCreditRedemptionModel } from "./models/appLimitCreditRedemption"; -import { AppLimitDefaultModel } from "./models/appLimitDefault"; -import { AppLimitEventModel } from "./models/appLimitEvent"; -import { AppLimitWarningModel } from "./models/appLimitWarning"; -import { OrgLimitAggregateModel } from "./models/orgLimitAggregate"; -import { OrgLimitCapModel } from "./models/orgLimitCap"; -import { OrgLimitCapsDefaultModel } from "./models/orgLimitCapsDefault"; -import { OrgLimitModel } from "./models/orgLimit"; -import { OrgLimitCreditModel } from "./models/orgLimitCredit"; -import { OrgLimitDefaultModel } from "./models/orgLimitDefault"; -import { OrgLimitEventModel } from "./models/orgLimitEvent"; -import { OrgLimitWarningModel } from "./models/orgLimitWarning"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AppLimitCapModel } from './models/appLimitCap'; +import { AppLimitCapsDefaultModel } from './models/appLimitCapsDefault'; +import { AppLimitModel } from './models/appLimit'; +import { AppLimitCreditCodeModel } from './models/appLimitCreditCode'; +import { AppLimitCreditCodeItemModel } from './models/appLimitCreditCodeItem'; +import { AppLimitCreditModel } from './models/appLimitCredit'; +import { AppLimitCreditRedemptionModel } from './models/appLimitCreditRedemption'; +import { AppLimitDefaultModel } from './models/appLimitDefault'; +import { AppLimitEventModel } from './models/appLimitEvent'; +import { AppLimitWarningModel } from './models/appLimitWarning'; +import { OrgLimitAggregateModel } from './models/orgLimitAggregate'; +import { OrgLimitCapModel } from './models/orgLimitCap'; +import { OrgLimitCapsDefaultModel } from './models/orgLimitCapsDefault'; +import { OrgLimitModel } from './models/orgLimit'; +import { OrgLimitCreditModel } from './models/orgLimitCredit'; +import { OrgLimitDefaultModel } from './models/orgLimitDefault'; +import { OrgLimitEventModel } from './models/orgLimitEvent'; +import { OrgLimitWarningModel } from './models/orgLimitWarning'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -74,6 +74,6 @@ export function createClient(config: OrmClientConfig) { orgLimitDefault: new OrgLimitDefaultModel(client), orgLimitEvent: new OrgLimitEventModel(client), orgLimitWarning: new OrgLimitWarningModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/input-types.ts b/sdk/constructive-sdk/src/usage/orm/input-types.ts index c462da530b..f8df1c43d8 100644 --- a/sdk/constructive-sdk/src/usage/orm/input-types.ts +++ b/sdk/constructive-sdk/src/usage/orm/input-types.ts @@ -579,9 +579,11 @@ export type AppLimitCapWithRelations = AppLimitCap & AppLimitCapRelations; export type AppLimitCapsDefaultWithRelations = AppLimitCapsDefault & AppLimitCapsDefaultRelations; export type AppLimitWithRelations = AppLimit & AppLimitRelations; export type AppLimitCreditCodeWithRelations = AppLimitCreditCode & AppLimitCreditCodeRelations; -export type AppLimitCreditCodeItemWithRelations = AppLimitCreditCodeItem & AppLimitCreditCodeItemRelations; +export type AppLimitCreditCodeItemWithRelations = AppLimitCreditCodeItem & + AppLimitCreditCodeItemRelations; export type AppLimitCreditWithRelations = AppLimitCredit & AppLimitCreditRelations; -export type AppLimitCreditRedemptionWithRelations = AppLimitCreditRedemption & AppLimitCreditRedemptionRelations; +export type AppLimitCreditRedemptionWithRelations = AppLimitCreditRedemption & + AppLimitCreditRedemptionRelations; export type AppLimitDefaultWithRelations = AppLimitDefault & AppLimitDefaultRelations; export type AppLimitEventWithRelations = AppLimitEvent & AppLimitEventRelations; export type AppLimitWarningWithRelations = AppLimitWarning & AppLimitWarningRelations; @@ -1241,24 +1243,338 @@ export interface OrgLimitWarningFilter { warningType?: StringFilter; } // ============ OrderBy Types ============ -export type AppLimitCapOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCapsDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type AppLimitCreditCodeOrderBy = "CODE_ASC" | "CODE_DESC" | "CURRENT_REDEMPTIONS_ASC" | "CURRENT_REDEMPTIONS_DESC" | "EXPIRES_AT_ASC" | "EXPIRES_AT_DESC" | "ID_ASC" | "ID_DESC" | "MAX_REDEMPTIONS_ASC" | "MAX_REDEMPTIONS_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCreditCodeItemOrderBy = "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_CODE_ID_ASC" | "CREDIT_CODE_ID_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitCreditOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type AppLimitCreditRedemptionOrderBy = "CREDIT_CODE_ID_ASC" | "CREDIT_CODE_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type AppLimitDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC"; -export type AppLimitEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DELTA_ASC" | "DELTA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_AT_EVENT_ASC" | "MAX_AT_EVENT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_AFTER_ASC" | "NUM_AFTER_DESC" | "NUM_BEFORE_ASC" | "NUM_BEFORE_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type AppLimitWarningOrderBy = "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "THRESHOLD_VALUE_ASC" | "THRESHOLD_VALUE_DESC" | "WARNING_TYPE_ASC" | "WARNING_TYPE_DESC"; -export type OrgLimitAggregateOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "RESERVED_ASC" | "RESERVED_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type OrgLimitCapOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgLimitCapsDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC"; -export type OrgLimitOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_ASC" | "NUM_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PERIOD_CREDITS_ASC" | "PERIOD_CREDITS_DESC" | "PLAN_MAX_ASC" | "PLAN_MAX_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "PURCHASED_CREDITS_ASC" | "PURCHASED_CREDITS_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC" | "WINDOW_DURATION_ASC" | "WINDOW_DURATION_DESC" | "WINDOW_START_ASC" | "WINDOW_START_DESC"; -export type OrgLimitCreditOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "AMOUNT_ASC" | "AMOUNT_DESC" | "CREDIT_TYPE_ASC" | "CREDIT_TYPE_DESC" | "DEFAULT_LIMIT_ID_ASC" | "DEFAULT_LIMIT_ID_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "NATURAL" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type OrgLimitDefaultOrderBy = "ID_ASC" | "ID_DESC" | "MAX_ASC" | "MAX_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "SOFT_MAX_ASC" | "SOFT_MAX_DESC"; -export type OrgLimitEventOrderBy = "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DELTA_ASC" | "DELTA_DESC" | "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ENTITY_TYPE_ASC" | "ENTITY_TYPE_DESC" | "EVENT_TYPE_ASC" | "EVENT_TYPE_DESC" | "ID_ASC" | "ID_DESC" | "MAX_AT_EVENT_ASC" | "MAX_AT_EVENT_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "NUM_AFTER_ASC" | "NUM_AFTER_DESC" | "NUM_BEFORE_ASC" | "NUM_BEFORE_DESC" | "ORGANIZATION_ID_ASC" | "ORGANIZATION_ID_DESC" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "REASON_ASC" | "REASON_DESC"; -export type OrgLimitWarningOrderBy = "ENTITY_ID_ASC" | "ENTITY_ID_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PRIMARY_KEY_ASC" | "PRIMARY_KEY_DESC" | "TASK_IDENTIFIER_ASC" | "TASK_IDENTIFIER_DESC" | "THRESHOLD_VALUE_ASC" | "THRESHOLD_VALUE_DESC" | "WARNING_TYPE_ASC" | "WARNING_TYPE_DESC"; +export type AppLimitCapOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCapsDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type AppLimitCreditCodeOrderBy = + | 'CODE_ASC' + | 'CODE_DESC' + | 'CURRENT_REDEMPTIONS_ASC' + | 'CURRENT_REDEMPTIONS_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_REDEMPTIONS_ASC' + | 'MAX_REDEMPTIONS_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCreditCodeItemOrderBy = + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_CODE_ID_ASC' + | 'CREDIT_CODE_ID_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitCreditOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type AppLimitCreditRedemptionOrderBy = + | 'CREDIT_CODE_ID_ASC' + | 'CREDIT_CODE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type AppLimitDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC'; +export type AppLimitEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DELTA_ASC' + | 'DELTA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_AT_EVENT_ASC' + | 'MAX_AT_EVENT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_AFTER_ASC' + | 'NUM_AFTER_DESC' + | 'NUM_BEFORE_ASC' + | 'NUM_BEFORE_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type AppLimitWarningOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'THRESHOLD_VALUE_ASC' + | 'THRESHOLD_VALUE_DESC' + | 'WARNING_TYPE_ASC' + | 'WARNING_TYPE_DESC'; +export type OrgLimitAggregateOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'RESERVED_ASC' + | 'RESERVED_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type OrgLimitCapOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgLimitCapsDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC'; +export type OrgLimitOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_ASC' + | 'NUM_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PERIOD_CREDITS_ASC' + | 'PERIOD_CREDITS_DESC' + | 'PLAN_MAX_ASC' + | 'PLAN_MAX_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'PURCHASED_CREDITS_ASC' + | 'PURCHASED_CREDITS_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC' + | 'WINDOW_DURATION_ASC' + | 'WINDOW_DURATION_DESC' + | 'WINDOW_START_ASC' + | 'WINDOW_START_DESC'; +export type OrgLimitCreditOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'AMOUNT_ASC' + | 'AMOUNT_DESC' + | 'CREDIT_TYPE_ASC' + | 'CREDIT_TYPE_DESC' + | 'DEFAULT_LIMIT_ID_ASC' + | 'DEFAULT_LIMIT_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NATURAL' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type OrgLimitDefaultOrderBy = + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_ASC' + | 'MAX_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'SOFT_MAX_ASC' + | 'SOFT_MAX_DESC'; +export type OrgLimitEventOrderBy = + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DELTA_ASC' + | 'DELTA_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ENTITY_TYPE_ASC' + | 'ENTITY_TYPE_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MAX_AT_EVENT_ASC' + | 'MAX_AT_EVENT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'NUM_AFTER_ASC' + | 'NUM_AFTER_DESC' + | 'NUM_BEFORE_ASC' + | 'NUM_BEFORE_DESC' + | 'ORGANIZATION_ID_ASC' + | 'ORGANIZATION_ID_DESC' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'REASON_ASC' + | 'REASON_DESC'; +export type OrgLimitWarningOrderBy = + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'THRESHOLD_VALUE_ASC' + | 'THRESHOLD_VALUE_DESC' + | 'WARNING_TYPE_ASC' + | 'WARNING_TYPE_DESC'; // ============ CRUD Input Types ============ export interface CreateAppLimitCapInput { clientMutationId?: string; @@ -1770,17 +2086,17 @@ export interface DeleteOrgLimitWarningInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { - "AppLimitCreditCode": { - "appLimitCreditCodeItemsByCreditCodeId": "AppLimitCreditCodeItem", - "appLimitCreditRedemptionsByCreditCodeId": "AppLimitCreditRedemption" + AppLimitCreditCode: { + appLimitCreditCodeItemsByCreditCodeId: 'AppLimitCreditCodeItem', + appLimitCreditRedemptionsByCreditCodeId: 'AppLimitCreditRedemption', }, - "AppLimitDefault": { - "appLimitCreditCodeItemsByDefaultLimitId": "AppLimitCreditCodeItem", - "appLimitCreditsByDefaultLimitId": "AppLimitCredit" + AppLimitDefault: { + appLimitCreditCodeItemsByDefaultLimitId: 'AppLimitCreditCodeItem', + appLimitCreditsByDefaultLimitId: 'AppLimitCredit', + }, + OrgLimitDefault: { + orgLimitCreditsByDefaultLimitId: 'OrgLimitCredit', }, - "OrgLimitDefault": { - "orgLimitCreditsByDefaultLimitId": "OrgLimitCredit" - } } as Record>; // ============ Custom Input Types (from schema) ============ export interface ProvisionBucketInput { @@ -3618,4 +3934,4 @@ export type OrgLimitWarningEdgeSelect = { node?: { select: OrgLimitWarningSelect; }; -}; \ No newline at end of file +}; diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimit.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimit.ts index 3e7c702c15..e1903aae36 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimit.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimit.ts @@ -3,56 +3,96 @@ * @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 { AppLimit, AppLimitWithRelations, AppLimitSelect, AppLimitFilter, AppLimitOrderBy, CreateAppLimitInput, UpdateAppLimitInput, AppLimitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimit, + AppLimitWithRelations, + AppLimitSelect, + AppLimitFilter, + AppLimitOrderBy, + CreateAppLimitInput, + UpdateAppLimitInput, + AppLimitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimit", "appLimits", 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 - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimit', + 'appLimits', + 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, + }, + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimits", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimit", "appLimits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimit', + 'appLimits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimit", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimit": data.appLimits?.nodes?.[0] ?? null - }) + appLimit: data.appLimits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimit", "appLimits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimit', + 'appLimits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitFilter", "AppLimitOrderBy", connectionFieldsMap); + 'AppLimitFilter', + 'AppLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimit", - fieldName: "appLimit", + operation: 'query', + operationName: 'AppLimit', + fieldName: 'appLimit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimit": data.appLimits?.nodes?.[0] ?? null - }) + appLimit: data.appLimits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimit", "createAppLimit", "appLimit", args.select, args.data, "CreateAppLimitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimit', + 'createAppLimit', + 'appLimit', + args.select, + args.data, + 'CreateAppLimitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "createAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'createAppLimit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimit", "updateAppLimit", "appLimit", args.select, args.where.id, args.data, "UpdateAppLimitInput", "id", "appLimitPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimit', + 'updateAppLimit', + 'appLimit', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitInput', + 'id', + 'appLimitPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "updateAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'updateAppLimit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimit: { appLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimit", "deleteAppLimit", "appLimit", { - id: args.where.id - }, "DeleteAppLimitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimit', + 'deleteAppLimit', + 'appLimit', + { + id: args.where.id, + }, + 'DeleteAppLimitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimit", - fieldName: "deleteAppLimit", + operation: 'mutation', + operationName: 'AppLimit', + fieldName: 'deleteAppLimit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCap.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCap.ts index 883def6208..9f93b87628 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCap.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCap.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCap, AppLimitCapWithRelations, AppLimitCapSelect, AppLimitCapFilter, AppLimitCapOrderBy, CreateAppLimitCapInput, UpdateAppLimitCapInput, AppLimitCapPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCap, + AppLimitCapWithRelations, + AppLimitCapSelect, + AppLimitCapFilter, + AppLimitCapOrderBy, + CreateAppLimitCapInput, + UpdateAppLimitCapInput, + AppLimitCapPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCapModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCaps: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCap", "appLimitCaps", 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 - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCap', + 'appLimitCaps', + 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, + }, + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCaps", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCaps', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCap", "appLimitCaps", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCap', + 'appLimitCaps', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCap", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCap', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCap": data.appLimitCaps?.nodes?.[0] ?? null - }) + appLimitCap: data.appLimitCaps?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCap", "appLimitCaps", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCap', + 'appLimitCaps', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCapFilter", "AppLimitCapOrderBy", connectionFieldsMap); + 'AppLimitCapFilter', + 'AppLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCap", - fieldName: "appLimitCap", + operation: 'query', + operationName: 'AppLimitCap', + fieldName: 'appLimitCap', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCap": data.appLimitCaps?.nodes?.[0] ?? null - }) + appLimitCap: data.appLimitCaps?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCap", "createAppLimitCap", "appLimitCap", args.select, args.data, "CreateAppLimitCapInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCap', + 'createAppLimitCap', + 'appLimitCap', + args.select, + args.data, + 'CreateAppLimitCapInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "createAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'createAppLimitCap', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCapPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCap", "updateAppLimitCap", "appLimitCap", args.select, args.where.id, args.data, "UpdateAppLimitCapInput", "id", "appLimitCapPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCap', + 'updateAppLimitCap', + 'appLimitCap', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCapInput', + 'id', + 'appLimitCapPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "updateAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'updateAppLimitCap', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCap: { appLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCap", "deleteAppLimitCap", "appLimitCap", { - id: args.where.id - }, "DeleteAppLimitCapInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCap', + 'deleteAppLimitCap', + 'appLimitCap', + { + id: args.where.id, + }, + 'DeleteAppLimitCapInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCap", - fieldName: "deleteAppLimitCap", + operation: 'mutation', + operationName: 'AppLimitCap', + fieldName: 'deleteAppLimitCap', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCapsDefault.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCapsDefault.ts index 6e64cd49f5..3b0ac8a23b 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCapsDefault.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCapsDefault.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCapsDefault, AppLimitCapsDefaultWithRelations, AppLimitCapsDefaultSelect, AppLimitCapsDefaultFilter, AppLimitCapsDefaultOrderBy, CreateAppLimitCapsDefaultInput, UpdateAppLimitCapsDefaultInput, AppLimitCapsDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCapsDefault, + AppLimitCapsDefaultWithRelations, + AppLimitCapsDefaultSelect, + AppLimitCapsDefaultFilter, + AppLimitCapsDefaultOrderBy, + CreateAppLimitCapsDefaultInput, + UpdateAppLimitCapsDefaultInput, + AppLimitCapsDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCapsDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCapsDefault", "appLimitCapsDefaults", 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 - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + 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, + }, + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefaults", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCapsDefault", "appLimitCapsDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefault", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCapsDefault": data.appLimitCapsDefaults?.nodes?.[0] ?? null - }) + appLimitCapsDefault: data.appLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCapsDefault", "appLimitCapsDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCapsDefault', + 'appLimitCapsDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCapsDefaultFilter", "AppLimitCapsDefaultOrderBy", connectionFieldsMap); + 'AppLimitCapsDefaultFilter', + 'AppLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCapsDefault", - fieldName: "appLimitCapsDefault", + operation: 'query', + operationName: 'AppLimitCapsDefault', + fieldName: 'appLimitCapsDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCapsDefault": data.appLimitCapsDefaults?.nodes?.[0] ?? null - }) + appLimitCapsDefault: data.appLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCapsDefault", "createAppLimitCapsDefault", "appLimitCapsDefault", args.select, args.data, "CreateAppLimitCapsDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCapsDefault', + 'createAppLimitCapsDefault', + 'appLimitCapsDefault', + args.select, + args.data, + 'CreateAppLimitCapsDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "createAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'createAppLimitCapsDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCapsDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCapsDefault", "updateAppLimitCapsDefault", "appLimitCapsDefault", args.select, args.where.id, args.data, "UpdateAppLimitCapsDefaultInput", "id", "appLimitCapsDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCapsDefault', + 'updateAppLimitCapsDefault', + 'appLimitCapsDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCapsDefaultInput', + 'id', + 'appLimitCapsDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "updateAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'updateAppLimitCapsDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCapsDefault: { appLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCapsDefault", "deleteAppLimitCapsDefault", "appLimitCapsDefault", { - id: args.where.id - }, "DeleteAppLimitCapsDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCapsDefault', + 'deleteAppLimitCapsDefault', + 'appLimitCapsDefault', + { + id: args.where.id, + }, + 'DeleteAppLimitCapsDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCapsDefault", - fieldName: "deleteAppLimitCapsDefault", + operation: 'mutation', + operationName: 'AppLimitCapsDefault', + fieldName: 'deleteAppLimitCapsDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCredit.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCredit.ts index b78f6d159a..7f66c4eb09 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCredit.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCredit.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCredit, AppLimitCreditWithRelations, AppLimitCreditSelect, AppLimitCreditFilter, AppLimitCreditOrderBy, CreateAppLimitCreditInput, UpdateAppLimitCreditInput, AppLimitCreditPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCredit, + AppLimitCreditWithRelations, + AppLimitCreditSelect, + AppLimitCreditFilter, + AppLimitCreditOrderBy, + CreateAppLimitCreditInput, + UpdateAppLimitCreditInput, + AppLimitCreditPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCredit", "appLimitCredits", 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 - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCredit', + 'appLimitCredits', + 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, + }, + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredits", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCredit", "appLimitCredits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCredit', + 'appLimitCredits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredit", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCredit": data.appLimitCredits?.nodes?.[0] ?? null - }) + appLimitCredit: data.appLimitCredits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCredit", "appLimitCredits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCredit', + 'appLimitCredits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditFilter", "AppLimitCreditOrderBy", connectionFieldsMap); + 'AppLimitCreditFilter', + 'AppLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCredit", - fieldName: "appLimitCredit", + operation: 'query', + operationName: 'AppLimitCredit', + fieldName: 'appLimitCredit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCredit": data.appLimitCredits?.nodes?.[0] ?? null - }) + appLimitCredit: data.appLimitCredits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCredit", "createAppLimitCredit", "appLimitCredit", args.select, args.data, "CreateAppLimitCreditInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCredit', + 'createAppLimitCredit', + 'appLimitCredit', + args.select, + args.data, + 'CreateAppLimitCreditInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "createAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'createAppLimitCredit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCredit", "updateAppLimitCredit", "appLimitCredit", args.select, args.where.id, args.data, "UpdateAppLimitCreditInput", "id", "appLimitCreditPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCredit', + 'updateAppLimitCredit', + 'appLimitCredit', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditInput', + 'id', + 'appLimitCreditPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "updateAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'updateAppLimitCredit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCredit: { appLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCredit", "deleteAppLimitCredit", "appLimitCredit", { - id: args.where.id - }, "DeleteAppLimitCreditInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCredit', + 'deleteAppLimitCredit', + 'appLimitCredit', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCredit", - fieldName: "deleteAppLimitCredit", + operation: 'mutation', + operationName: 'AppLimitCredit', + fieldName: 'deleteAppLimitCredit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCode.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCode.ts index db2a6b0b29..a449fef840 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCode.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCode.ts @@ -3,56 +3,96 @@ * @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 { AppLimitCreditCode, AppLimitCreditCodeWithRelations, AppLimitCreditCodeSelect, AppLimitCreditCodeFilter, AppLimitCreditCodeOrderBy, CreateAppLimitCreditCodeInput, UpdateAppLimitCreditCodeInput, AppLimitCreditCodePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditCode, + AppLimitCreditCodeWithRelations, + AppLimitCreditCodeSelect, + AppLimitCreditCodeFilter, + AppLimitCreditCodeOrderBy, + CreateAppLimitCreditCodeInput, + UpdateAppLimitCreditCodeInput, + AppLimitCreditCodePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditCodeModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodes: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCode", "appLimitCreditCodes", 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 - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + 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, + }, + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCodes", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCodes', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCode: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditCode", "appLimitCreditCodes", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCode", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCode', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitCreditCodeModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCode": data.appLimitCreditCodes?.nodes?.[0] ?? null - }) + appLimitCreditCode: data.appLimitCreditCodes?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCode: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCode", "appLimitCreditCodes", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCode', + 'appLimitCreditCodes', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditCodeFilter", "AppLimitCreditCodeOrderBy", connectionFieldsMap); + 'AppLimitCreditCodeFilter', + 'AppLimitCreditCodeOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCode", - fieldName: "appLimitCreditCode", + operation: 'query', + operationName: 'AppLimitCreditCode', + fieldName: 'appLimitCreditCode', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitCreditCodeModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCode": data.appLimitCreditCodes?.nodes?.[0] ?? null - }) + appLimitCreditCode: data.appLimitCreditCodes?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditCode", "createAppLimitCreditCode", "appLimitCreditCode", args.select, args.data, "CreateAppLimitCreditCodeInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditCode', + 'createAppLimitCreditCode', + 'appLimitCreditCode', + args.select, + args.data, + 'CreateAppLimitCreditCodeInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "createAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'createAppLimitCreditCode', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditCodePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditCode", "updateAppLimitCreditCode", "appLimitCreditCode", args.select, args.where.id, args.data, "UpdateAppLimitCreditCodeInput", "id", "appLimitCreditCodePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditCode', + 'updateAppLimitCreditCode', + 'appLimitCreditCode', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditCodeInput', + 'id', + 'appLimitCreditCodePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "updateAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'updateAppLimitCreditCode', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditCode: { appLimitCreditCode: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditCode", "deleteAppLimitCreditCode", "appLimitCreditCode", { - id: args.where.id - }, "DeleteAppLimitCreditCodeInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditCode', + 'deleteAppLimitCreditCode', + 'appLimitCreditCode', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditCodeInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCode", - fieldName: "deleteAppLimitCreditCode", + operation: 'mutation', + operationName: 'AppLimitCreditCode', + fieldName: 'deleteAppLimitCreditCode', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCodeItem.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCodeItem.ts index ccf3875343..5f37d3fbe0 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCodeItem.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCodeItem.ts @@ -3,56 +3,98 @@ * @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 { AppLimitCreditCodeItem, AppLimitCreditCodeItemWithRelations, AppLimitCreditCodeItemSelect, AppLimitCreditCodeItemFilter, AppLimitCreditCodeItemOrderBy, CreateAppLimitCreditCodeItemInput, UpdateAppLimitCreditCodeItemInput, AppLimitCreditCodeItemPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditCodeItem, + AppLimitCreditCodeItemWithRelations, + AppLimitCreditCodeItemSelect, + AppLimitCreditCodeItemFilter, + AppLimitCreditCodeItemOrderBy, + CreateAppLimitCreditCodeItemInput, + UpdateAppLimitCreditCodeItemInput, + AppLimitCreditCodeItemPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditCodeItemModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appLimitCreditCodeItems: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appLimitCreditCodeItems: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", 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 - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + 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, + }, + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItems", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItems', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodeItem: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItem", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItem', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppLimitCreditCodeItemModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCodeItem": data.appLimitCreditCodeItems?.nodes?.[0] ?? null - }) + appLimitCreditCodeItem: data.appLimitCreditCodeItems?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditCodeItem: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditCodeItem", "appLimitCreditCodeItems", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditCodeItem', + 'appLimitCreditCodeItems', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditCodeItemFilter", "AppLimitCreditCodeItemOrderBy", connectionFieldsMap); + 'AppLimitCreditCodeItemFilter', + 'AppLimitCreditCodeItemOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditCodeItem", - fieldName: "appLimitCreditCodeItem", + operation: 'query', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'appLimitCreditCodeItem', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppLimitCreditCodeItemModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditCodeItem": data.appLimitCreditCodeItems?.nodes?.[0] ?? null - }) + appLimitCreditCodeItem: data.appLimitCreditCodeItems?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditCodeItem", "createAppLimitCreditCodeItem", "appLimitCreditCodeItem", args.select, args.data, "CreateAppLimitCreditCodeItemInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditCodeItem', + 'createAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + args.select, + args.data, + 'CreateAppLimitCreditCodeItemInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "createAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'createAppLimitCreditCodeItem', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditCodeItemPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditCodeItem", "updateAppLimitCreditCodeItem", "appLimitCreditCodeItem", args.select, args.where.id, args.data, "UpdateAppLimitCreditCodeItemInput", "id", "appLimitCreditCodeItemPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditCodeItem', + 'updateAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditCodeItemInput', + 'id', + 'appLimitCreditCodeItemPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "updateAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'updateAppLimitCreditCodeItem', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditCodeItem: { appLimitCreditCodeItem: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditCodeItem", "deleteAppLimitCreditCodeItem", "appLimitCreditCodeItem", { - id: args.where.id - }, "DeleteAppLimitCreditCodeItemInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditCodeItem', + 'deleteAppLimitCreditCodeItem', + 'appLimitCreditCodeItem', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditCodeItemInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditCodeItem", - fieldName: "deleteAppLimitCreditCodeItem", + operation: 'mutation', + operationName: 'AppLimitCreditCodeItem', + fieldName: 'deleteAppLimitCreditCodeItem', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditRedemption.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditRedemption.ts index 754ba79962..582960bd9f 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditRedemption.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditRedemption.ts @@ -3,56 +3,98 @@ * @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 { AppLimitCreditRedemption, AppLimitCreditRedemptionWithRelations, AppLimitCreditRedemptionSelect, AppLimitCreditRedemptionFilter, AppLimitCreditRedemptionOrderBy, CreateAppLimitCreditRedemptionInput, UpdateAppLimitCreditRedemptionInput, AppLimitCreditRedemptionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitCreditRedemption, + AppLimitCreditRedemptionWithRelations, + AppLimitCreditRedemptionSelect, + AppLimitCreditRedemptionFilter, + AppLimitCreditRedemptionOrderBy, + CreateAppLimitCreditRedemptionInput, + UpdateAppLimitCreditRedemptionInput, + AppLimitCreditRedemptionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitCreditRedemptionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ - appLimitCreditRedemptions: ConnectionResult>; + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + appLimitCreditRedemptions: ConnectionResult< + InferSelectResult + >; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", 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 - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + 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, + }, + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemptions", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemptions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditRedemption: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemption", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemption', document, variables, transform: (data: { @@ -60,32 +102,39 @@ export class AppLimitCreditRedemptionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditRedemption": data.appLimitCreditRedemptions?.nodes?.[0] ?? null - }) + appLimitCreditRedemption: data.appLimitCreditRedemptions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitCreditRedemption: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitCreditRedemption", "appLimitCreditRedemptions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitCreditRedemption', + 'appLimitCreditRedemptions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitCreditRedemptionFilter", "AppLimitCreditRedemptionOrderBy", connectionFieldsMap); + 'AppLimitCreditRedemptionFilter', + 'AppLimitCreditRedemptionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitCreditRedemption", - fieldName: "appLimitCreditRedemption", + operation: 'query', + operationName: 'AppLimitCreditRedemption', + fieldName: 'appLimitCreditRedemption', document, variables, transform: (data: { @@ -93,74 +142,106 @@ export class AppLimitCreditRedemptionModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitCreditRedemption": data.appLimitCreditRedemptions?.nodes?.[0] ?? null - }) + appLimitCreditRedemption: data.appLimitCreditRedemptions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitCreditRedemption", "createAppLimitCreditRedemption", "appLimitCreditRedemption", args.select, args.data, "CreateAppLimitCreditRedemptionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitCreditRedemption', + 'createAppLimitCreditRedemption', + 'appLimitCreditRedemption', + args.select, + args.data, + 'CreateAppLimitCreditRedemptionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "createAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'createAppLimitCreditRedemption', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitCreditRedemptionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitCreditRedemption", "updateAppLimitCreditRedemption", "appLimitCreditRedemption", args.select, args.where.id, args.data, "UpdateAppLimitCreditRedemptionInput", "id", "appLimitCreditRedemptionPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitCreditRedemption', + 'updateAppLimitCreditRedemption', + 'appLimitCreditRedemption', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitCreditRedemptionInput', + 'id', + 'appLimitCreditRedemptionPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "updateAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'updateAppLimitCreditRedemption', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitCreditRedemption: { appLimitCreditRedemption: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitCreditRedemption", "deleteAppLimitCreditRedemption", "appLimitCreditRedemption", { - id: args.where.id - }, "DeleteAppLimitCreditRedemptionInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitCreditRedemption', + 'deleteAppLimitCreditRedemption', + 'appLimitCreditRedemption', + { + id: args.where.id, + }, + 'DeleteAppLimitCreditRedemptionInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitCreditRedemption", - fieldName: "deleteAppLimitCreditRedemption", + operation: 'mutation', + operationName: 'AppLimitCreditRedemption', + fieldName: 'deleteAppLimitCreditRedemption', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitDefault.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitDefault.ts index 6a45e01c7f..f0eb49d31f 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitDefault.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitDefault.ts @@ -3,56 +3,96 @@ * @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 { AppLimitDefault, AppLimitDefaultWithRelations, AppLimitDefaultSelect, AppLimitDefaultFilter, AppLimitDefaultOrderBy, CreateAppLimitDefaultInput, UpdateAppLimitDefaultInput, AppLimitDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitDefault, + AppLimitDefaultWithRelations, + AppLimitDefaultSelect, + AppLimitDefaultFilter, + AppLimitDefaultOrderBy, + CreateAppLimitDefaultInput, + UpdateAppLimitDefaultInput, + AppLimitDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitDefault", "appLimitDefaults", 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 - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitDefault', + 'appLimitDefaults', + 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, + }, + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefaults", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitDefault", "appLimitDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitDefault', + 'appLimitDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefault", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitDefault": data.appLimitDefaults?.nodes?.[0] ?? null - }) + appLimitDefault: data.appLimitDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitDefault", "appLimitDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitDefault', + 'appLimitDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitDefaultFilter", "AppLimitDefaultOrderBy", connectionFieldsMap); + 'AppLimitDefaultFilter', + 'AppLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitDefault", - fieldName: "appLimitDefault", + operation: 'query', + operationName: 'AppLimitDefault', + fieldName: 'appLimitDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitDefault": data.appLimitDefaults?.nodes?.[0] ?? null - }) + appLimitDefault: data.appLimitDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitDefault", "createAppLimitDefault", "appLimitDefault", args.select, args.data, "CreateAppLimitDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitDefault', + 'createAppLimitDefault', + 'appLimitDefault', + args.select, + args.data, + 'CreateAppLimitDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "createAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'createAppLimitDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitDefault", "updateAppLimitDefault", "appLimitDefault", args.select, args.where.id, args.data, "UpdateAppLimitDefaultInput", "id", "appLimitDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitDefault', + 'updateAppLimitDefault', + 'appLimitDefault', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitDefaultInput', + 'id', + 'appLimitDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "updateAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'updateAppLimitDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitDefault: { appLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitDefault", "deleteAppLimitDefault", "appLimitDefault", { - id: args.where.id - }, "DeleteAppLimitDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitDefault', + 'deleteAppLimitDefault', + 'appLimitDefault', + { + id: args.where.id, + }, + 'DeleteAppLimitDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitDefault", - fieldName: "deleteAppLimitDefault", + operation: 'mutation', + operationName: 'AppLimitDefault', + fieldName: 'deleteAppLimitDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitEvent.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitEvent.ts index 9a54edcef3..17fd7e8866 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitEvent.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitEvent.ts @@ -3,56 +3,96 @@ * @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 { AppLimitEvent, AppLimitEventWithRelations, AppLimitEventSelect, AppLimitEventFilter, AppLimitEventOrderBy, CreateAppLimitEventInput, UpdateAppLimitEventInput, AppLimitEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitEvent, + AppLimitEventWithRelations, + AppLimitEventSelect, + AppLimitEventFilter, + AppLimitEventOrderBy, + CreateAppLimitEventInput, + UpdateAppLimitEventInput, + AppLimitEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitEvent", "appLimitEvents", 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 - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitEvent', + 'appLimitEvents', + 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, + }, + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvents", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitEvent", "appLimitEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitEvent', + 'appLimitEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvent", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitEvent": data.appLimitEvents?.nodes?.[0] ?? null - }) + appLimitEvent: data.appLimitEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitEvent", "appLimitEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitEvent', + 'appLimitEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitEventFilter", "AppLimitEventOrderBy", connectionFieldsMap); + 'AppLimitEventFilter', + 'AppLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitEvent", - fieldName: "appLimitEvent", + operation: 'query', + operationName: 'AppLimitEvent', + fieldName: 'appLimitEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class AppLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitEvent": data.appLimitEvents?.nodes?.[0] ?? null - }) + appLimitEvent: data.appLimitEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitEvent", "createAppLimitEvent", "appLimitEvent", args.select, args.data, "CreateAppLimitEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitEvent', + 'createAppLimitEvent', + 'appLimitEvent', + args.select, + args.data, + 'CreateAppLimitEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "createAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'createAppLimitEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + AppLimitEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitEvent", "updateAppLimitEvent", "appLimitEvent", args.select, args.where.id, args.data, "UpdateAppLimitEventInput", "id", "appLimitEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitEvent', + 'updateAppLimitEvent', + 'appLimitEvent', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitEventInput', + 'id', + 'appLimitEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "updateAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'updateAppLimitEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitEvent: { appLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitEvent", "deleteAppLimitEvent", "appLimitEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteAppLimitEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitEvent', + 'deleteAppLimitEvent', + 'appLimitEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteAppLimitEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitEvent", - fieldName: "deleteAppLimitEvent", + operation: 'mutation', + operationName: 'AppLimitEvent', + fieldName: 'deleteAppLimitEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitWarning.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitWarning.ts index c7e959263a..4d31d5490a 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitWarning.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitWarning.ts @@ -3,56 +3,96 @@ * @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 { AppLimitWarning, AppLimitWarningWithRelations, AppLimitWarningSelect, AppLimitWarningFilter, AppLimitWarningOrderBy, CreateAppLimitWarningInput, UpdateAppLimitWarningInput, AppLimitWarningPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AppLimitWarning, + AppLimitWarningWithRelations, + AppLimitWarningSelect, + AppLimitWarningFilter, + AppLimitWarningOrderBy, + CreateAppLimitWarningInput, + UpdateAppLimitWarningInput, + AppLimitWarningPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AppLimitWarningModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarnings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitWarning", "appLimitWarnings", 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 - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AppLimitWarning', + 'appLimitWarnings', + 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, + }, + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarnings", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarnings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AppLimitWarning", "appLimitWarnings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AppLimitWarning', + 'appLimitWarnings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarning", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarning', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AppLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitWarning": data.appLimitWarnings?.nodes?.[0] ?? null - }) + appLimitWarning: data.appLimitWarnings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ appLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AppLimitWarning", "appLimitWarnings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AppLimitWarning', + 'appLimitWarnings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AppLimitWarningFilter", "AppLimitWarningOrderBy", connectionFieldsMap); + 'AppLimitWarningFilter', + 'AppLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AppLimitWarning", - fieldName: "appLimitWarning", + operation: 'query', + operationName: 'AppLimitWarning', + fieldName: 'appLimitWarning', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class AppLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "appLimitWarning": data.appLimitWarnings?.nodes?.[0] ?? null - }) + appLimitWarning: data.appLimitWarnings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AppLimitWarning", "createAppLimitWarning", "appLimitWarning", args.select, args.data, "CreateAppLimitWarningInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AppLimitWarning', + 'createAppLimitWarning', + 'appLimitWarning', + args.select, + args.data, + 'CreateAppLimitWarningInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "createAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'createAppLimitWarning', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + AppLimitWarningPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("AppLimitWarning", "updateAppLimitWarning", "appLimitWarning", args.select, args.where.id, args.data, "UpdateAppLimitWarningInput", "id", "appLimitWarningPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'AppLimitWarning', + 'updateAppLimitWarning', + 'appLimitWarning', + args.select, + args.where.id, + args.data, + 'UpdateAppLimitWarningInput', + 'id', + 'appLimitWarningPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "updateAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'updateAppLimitWarning', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteAppLimitWarning: { appLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("AppLimitWarning", "deleteAppLimitWarning", "appLimitWarning", { - id: args.where.id - }, "DeleteAppLimitWarningInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'AppLimitWarning', + 'deleteAppLimitWarning', + 'appLimitWarning', + { + id: args.where.id, + }, + 'DeleteAppLimitWarningInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AppLimitWarning", - fieldName: "deleteAppLimitWarning", + operation: 'mutation', + operationName: 'AppLimitWarning', + fieldName: 'deleteAppLimitWarning', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/index.ts b/sdk/constructive-sdk/src/usage/orm/models/index.ts index 33c8f9a18e..049cfdab13 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/index.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/index.ts @@ -3,21 +3,21 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AppLimitCapModel } from "./appLimitCap"; -export { AppLimitCapsDefaultModel } from "./appLimitCapsDefault"; -export { AppLimitModel } from "./appLimit"; -export { AppLimitCreditCodeModel } from "./appLimitCreditCode"; -export { AppLimitCreditCodeItemModel } from "./appLimitCreditCodeItem"; -export { AppLimitCreditModel } from "./appLimitCredit"; -export { AppLimitCreditRedemptionModel } from "./appLimitCreditRedemption"; -export { AppLimitDefaultModel } from "./appLimitDefault"; -export { AppLimitEventModel } from "./appLimitEvent"; -export { AppLimitWarningModel } from "./appLimitWarning"; -export { OrgLimitAggregateModel } from "./orgLimitAggregate"; -export { OrgLimitCapModel } from "./orgLimitCap"; -export { OrgLimitCapsDefaultModel } from "./orgLimitCapsDefault"; -export { OrgLimitModel } from "./orgLimit"; -export { OrgLimitCreditModel } from "./orgLimitCredit"; -export { OrgLimitDefaultModel } from "./orgLimitDefault"; -export { OrgLimitEventModel } from "./orgLimitEvent"; -export { OrgLimitWarningModel } from "./orgLimitWarning"; \ No newline at end of file +export { AppLimitCapModel } from './appLimitCap'; +export { AppLimitCapsDefaultModel } from './appLimitCapsDefault'; +export { AppLimitModel } from './appLimit'; +export { AppLimitCreditCodeModel } from './appLimitCreditCode'; +export { AppLimitCreditCodeItemModel } from './appLimitCreditCodeItem'; +export { AppLimitCreditModel } from './appLimitCredit'; +export { AppLimitCreditRedemptionModel } from './appLimitCreditRedemption'; +export { AppLimitDefaultModel } from './appLimitDefault'; +export { AppLimitEventModel } from './appLimitEvent'; +export { AppLimitWarningModel } from './appLimitWarning'; +export { OrgLimitAggregateModel } from './orgLimitAggregate'; +export { OrgLimitCapModel } from './orgLimitCap'; +export { OrgLimitCapsDefaultModel } from './orgLimitCapsDefault'; +export { OrgLimitModel } from './orgLimit'; +export { OrgLimitCreditModel } from './orgLimitCredit'; +export { OrgLimitDefaultModel } from './orgLimitDefault'; +export { OrgLimitEventModel } from './orgLimitEvent'; +export { OrgLimitWarningModel } from './orgLimitWarning'; diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimit.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimit.ts index 246f61238f..188531420f 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimit.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimit.ts @@ -3,56 +3,96 @@ * @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 { OrgLimit, OrgLimitWithRelations, OrgLimitSelect, OrgLimitFilter, OrgLimitOrderBy, CreateOrgLimitInput, UpdateOrgLimitInput, OrgLimitPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimit, + OrgLimitWithRelations, + OrgLimitSelect, + OrgLimitFilter, + OrgLimitOrderBy, + CreateOrgLimitInput, + UpdateOrgLimitInput, + OrgLimitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimit", "orgLimits", 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 - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimit', + 'orgLimits', + 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, + }, + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimits", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimit", "orgLimits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimit', + 'orgLimits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimit", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimit": data.orgLimits?.nodes?.[0] ?? null - }) + orgLimit: data.orgLimits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimit", "orgLimits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimit', + 'orgLimits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitFilter", "OrgLimitOrderBy", connectionFieldsMap); + 'OrgLimitFilter', + 'OrgLimitOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimit", - fieldName: "orgLimit", + operation: 'query', + operationName: 'OrgLimit', + fieldName: 'orgLimit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimit": data.orgLimits?.nodes?.[0] ?? null - }) + orgLimit: data.orgLimits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimit", "createOrgLimit", "orgLimit", args.select, args.data, "CreateOrgLimitInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimit', + 'createOrgLimit', + 'orgLimit', + args.select, + args.data, + 'CreateOrgLimitInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "createOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'createOrgLimit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimit", "updateOrgLimit", "orgLimit", args.select, args.where.id, args.data, "UpdateOrgLimitInput", "id", "orgLimitPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimit', + 'updateOrgLimit', + 'orgLimit', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitInput', + 'id', + 'orgLimitPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "updateOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'updateOrgLimit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimit: { orgLimit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimit", "deleteOrgLimit", "orgLimit", { - id: args.where.id - }, "DeleteOrgLimitInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimit', + 'deleteOrgLimit', + 'orgLimit', + { + id: args.where.id, + }, + 'DeleteOrgLimitInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimit", - fieldName: "deleteOrgLimit", + operation: 'mutation', + operationName: 'OrgLimit', + fieldName: 'deleteOrgLimit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitAggregate.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitAggregate.ts index cccd405709..43f24e6d05 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitAggregate.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitAggregate.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitAggregate, OrgLimitAggregateWithRelations, OrgLimitAggregateSelect, OrgLimitAggregateFilter, OrgLimitAggregateOrderBy, CreateOrgLimitAggregateInput, UpdateOrgLimitAggregateInput, OrgLimitAggregatePatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitAggregate, + OrgLimitAggregateWithRelations, + OrgLimitAggregateSelect, + OrgLimitAggregateFilter, + OrgLimitAggregateOrderBy, + CreateOrgLimitAggregateInput, + UpdateOrgLimitAggregateInput, + OrgLimitAggregatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitAggregateModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregates: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitAggregate", "orgLimitAggregates", 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 - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + 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, + }, + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregates", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregates', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitAggregate", "orgLimitAggregates", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregate", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregate', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitAggregateModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitAggregate": data.orgLimitAggregates?.nodes?.[0] ?? null - }) + orgLimitAggregate: data.orgLimitAggregates?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitAggregate: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitAggregate", "orgLimitAggregates", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitAggregate', + 'orgLimitAggregates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitAggregateFilter", "OrgLimitAggregateOrderBy", connectionFieldsMap); + 'OrgLimitAggregateFilter', + 'OrgLimitAggregateOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitAggregate", - fieldName: "orgLimitAggregate", + operation: 'query', + operationName: 'OrgLimitAggregate', + fieldName: 'orgLimitAggregate', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitAggregateModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitAggregate": data.orgLimitAggregates?.nodes?.[0] ?? null - }) + orgLimitAggregate: data.orgLimitAggregates?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitAggregate", "createOrgLimitAggregate", "orgLimitAggregate", args.select, args.data, "CreateOrgLimitAggregateInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitAggregate', + 'createOrgLimitAggregate', + 'orgLimitAggregate', + args.select, + args.data, + 'CreateOrgLimitAggregateInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "createOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'createOrgLimitAggregate', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitAggregatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitAggregate", "updateOrgLimitAggregate", "orgLimitAggregate", args.select, args.where.id, args.data, "UpdateOrgLimitAggregateInput", "id", "orgLimitAggregatePatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitAggregate', + 'updateOrgLimitAggregate', + 'orgLimitAggregate', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitAggregateInput', + 'id', + 'orgLimitAggregatePatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "updateOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'updateOrgLimitAggregate', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitAggregate: { orgLimitAggregate: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitAggregate", "deleteOrgLimitAggregate", "orgLimitAggregate", { - id: args.where.id - }, "DeleteOrgLimitAggregateInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitAggregate', + 'deleteOrgLimitAggregate', + 'orgLimitAggregate', + { + id: args.where.id, + }, + 'DeleteOrgLimitAggregateInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitAggregate", - fieldName: "deleteOrgLimitAggregate", + operation: 'mutation', + operationName: 'OrgLimitAggregate', + fieldName: 'deleteOrgLimitAggregate', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCap.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCap.ts index 932ee5f41c..0877ea93fd 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCap.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCap.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCap, OrgLimitCapWithRelations, OrgLimitCapSelect, OrgLimitCapFilter, OrgLimitCapOrderBy, CreateOrgLimitCapInput, UpdateOrgLimitCapInput, OrgLimitCapPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCap, + OrgLimitCapWithRelations, + OrgLimitCapSelect, + OrgLimitCapFilter, + OrgLimitCapOrderBy, + CreateOrgLimitCapInput, + UpdateOrgLimitCapInput, + OrgLimitCapPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCapModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCaps: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCap", "orgLimitCaps", 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 - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCap', + 'orgLimitCaps', + 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, + }, + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCaps", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCaps', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCap", "orgLimitCaps", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCap', + 'orgLimitCaps', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCap", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCap', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCap": data.orgLimitCaps?.nodes?.[0] ?? null - }) + orgLimitCap: data.orgLimitCaps?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCap: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCap", "orgLimitCaps", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCap', + 'orgLimitCaps', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCapFilter", "OrgLimitCapOrderBy", connectionFieldsMap); + 'OrgLimitCapFilter', + 'OrgLimitCapOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCap", - fieldName: "orgLimitCap", + operation: 'query', + operationName: 'OrgLimitCap', + fieldName: 'orgLimitCap', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCapModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCap": data.orgLimitCaps?.nodes?.[0] ?? null - }) + orgLimitCap: data.orgLimitCaps?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCap", "createOrgLimitCap", "orgLimitCap", args.select, args.data, "CreateOrgLimitCapInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCap', + 'createOrgLimitCap', + 'orgLimitCap', + args.select, + args.data, + 'CreateOrgLimitCapInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "createOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'createOrgLimitCap', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCapPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCap", "updateOrgLimitCap", "orgLimitCap", args.select, args.where.id, args.data, "UpdateOrgLimitCapInput", "id", "orgLimitCapPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCap', + 'updateOrgLimitCap', + 'orgLimitCap', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCapInput', + 'id', + 'orgLimitCapPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "updateOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'updateOrgLimitCap', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCap: { orgLimitCap: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCap", "deleteOrgLimitCap", "orgLimitCap", { - id: args.where.id - }, "DeleteOrgLimitCapInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCap', + 'deleteOrgLimitCap', + 'orgLimitCap', + { + id: args.where.id, + }, + 'DeleteOrgLimitCapInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCap", - fieldName: "deleteOrgLimitCap", + operation: 'mutation', + operationName: 'OrgLimitCap', + fieldName: 'deleteOrgLimitCap', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCapsDefault.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCapsDefault.ts index 333bc342a2..de62c801b7 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCapsDefault.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCapsDefault.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCapsDefault, OrgLimitCapsDefaultWithRelations, OrgLimitCapsDefaultSelect, OrgLimitCapsDefaultFilter, OrgLimitCapsDefaultOrderBy, CreateOrgLimitCapsDefaultInput, UpdateOrgLimitCapsDefaultInput, OrgLimitCapsDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCapsDefault, + OrgLimitCapsDefaultWithRelations, + OrgLimitCapsDefaultSelect, + OrgLimitCapsDefaultFilter, + OrgLimitCapsDefaultOrderBy, + CreateOrgLimitCapsDefaultInput, + UpdateOrgLimitCapsDefaultInput, + OrgLimitCapsDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCapsDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", 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 - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + 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, + }, + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefaults", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefault", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCapsDefault": data.orgLimitCapsDefaults?.nodes?.[0] ?? null - }) + orgLimitCapsDefault: data.orgLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCapsDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCapsDefault", "orgLimitCapsDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCapsDefault', + 'orgLimitCapsDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCapsDefaultFilter", "OrgLimitCapsDefaultOrderBy", connectionFieldsMap); + 'OrgLimitCapsDefaultFilter', + 'OrgLimitCapsDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCapsDefault", - fieldName: "orgLimitCapsDefault", + operation: 'query', + operationName: 'OrgLimitCapsDefault', + fieldName: 'orgLimitCapsDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCapsDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCapsDefault": data.orgLimitCapsDefaults?.nodes?.[0] ?? null - }) + orgLimitCapsDefault: data.orgLimitCapsDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCapsDefault", "createOrgLimitCapsDefault", "orgLimitCapsDefault", args.select, args.data, "CreateOrgLimitCapsDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCapsDefault', + 'createOrgLimitCapsDefault', + 'orgLimitCapsDefault', + args.select, + args.data, + 'CreateOrgLimitCapsDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "createOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'createOrgLimitCapsDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCapsDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCapsDefault", "updateOrgLimitCapsDefault", "orgLimitCapsDefault", args.select, args.where.id, args.data, "UpdateOrgLimitCapsDefaultInput", "id", "orgLimitCapsDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCapsDefault', + 'updateOrgLimitCapsDefault', + 'orgLimitCapsDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCapsDefaultInput', + 'id', + 'orgLimitCapsDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "updateOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'updateOrgLimitCapsDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCapsDefault: { orgLimitCapsDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCapsDefault", "deleteOrgLimitCapsDefault", "orgLimitCapsDefault", { - id: args.where.id - }, "DeleteOrgLimitCapsDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCapsDefault', + 'deleteOrgLimitCapsDefault', + 'orgLimitCapsDefault', + { + id: args.where.id, + }, + 'DeleteOrgLimitCapsDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCapsDefault", - fieldName: "deleteOrgLimitCapsDefault", + operation: 'mutation', + operationName: 'OrgLimitCapsDefault', + fieldName: 'deleteOrgLimitCapsDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCredit.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCredit.ts index 0ef684e92b..497dd5d807 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCredit.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCredit.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitCredit, OrgLimitCreditWithRelations, OrgLimitCreditSelect, OrgLimitCreditFilter, OrgLimitCreditOrderBy, CreateOrgLimitCreditInput, UpdateOrgLimitCreditInput, OrgLimitCreditPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitCredit, + OrgLimitCreditWithRelations, + OrgLimitCreditSelect, + OrgLimitCreditFilter, + OrgLimitCreditOrderBy, + CreateOrgLimitCreditInput, + UpdateOrgLimitCreditInput, + OrgLimitCreditPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitCreditModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredits: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCredit", "orgLimitCredits", 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 - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + 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, + }, + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredits", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredits', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitCredit", "orgLimitCredits", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredit", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredit', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCredit": data.orgLimitCredits?.nodes?.[0] ?? null - }) + orgLimitCredit: data.orgLimitCredits?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitCredit: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitCredit", "orgLimitCredits", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitCredit', + 'orgLimitCredits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitCreditFilter", "OrgLimitCreditOrderBy", connectionFieldsMap); + 'OrgLimitCreditFilter', + 'OrgLimitCreditOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitCredit", - fieldName: "orgLimitCredit", + operation: 'query', + operationName: 'OrgLimitCredit', + fieldName: 'orgLimitCredit', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitCreditModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitCredit": data.orgLimitCredits?.nodes?.[0] ?? null - }) + orgLimitCredit: data.orgLimitCredits?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitCredit", "createOrgLimitCredit", "orgLimitCredit", args.select, args.data, "CreateOrgLimitCreditInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitCredit', + 'createOrgLimitCredit', + 'orgLimitCredit', + args.select, + args.data, + 'CreateOrgLimitCreditInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "createOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'createOrgLimitCredit', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitCreditPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitCredit", "updateOrgLimitCredit", "orgLimitCredit", args.select, args.where.id, args.data, "UpdateOrgLimitCreditInput", "id", "orgLimitCreditPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitCredit', + 'updateOrgLimitCredit', + 'orgLimitCredit', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitCreditInput', + 'id', + 'orgLimitCreditPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "updateOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'updateOrgLimitCredit', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitCredit: { orgLimitCredit: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitCredit", "deleteOrgLimitCredit", "orgLimitCredit", { - id: args.where.id - }, "DeleteOrgLimitCreditInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitCredit', + 'deleteOrgLimitCredit', + 'orgLimitCredit', + { + id: args.where.id, + }, + 'DeleteOrgLimitCreditInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitCredit", - fieldName: "deleteOrgLimitCredit", + operation: 'mutation', + operationName: 'OrgLimitCredit', + fieldName: 'deleteOrgLimitCredit', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitDefault.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitDefault.ts index 3b1dfb8b6d..3c91177b9c 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitDefault.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitDefault.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitDefault, OrgLimitDefaultWithRelations, OrgLimitDefaultSelect, OrgLimitDefaultFilter, OrgLimitDefaultOrderBy, CreateOrgLimitDefaultInput, UpdateOrgLimitDefaultInput, OrgLimitDefaultPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitDefault, + OrgLimitDefaultWithRelations, + OrgLimitDefaultSelect, + OrgLimitDefaultFilter, + OrgLimitDefaultOrderBy, + CreateOrgLimitDefaultInput, + UpdateOrgLimitDefaultInput, + OrgLimitDefaultPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitDefaultModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefaults: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitDefault", "orgLimitDefaults", 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 - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + 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, + }, + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefaults", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefaults', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitDefault", "orgLimitDefaults", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefault", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefault', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitDefault": data.orgLimitDefaults?.nodes?.[0] ?? null - }) + orgLimitDefault: data.orgLimitDefaults?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitDefault: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitDefault", "orgLimitDefaults", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitDefault', + 'orgLimitDefaults', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitDefaultFilter", "OrgLimitDefaultOrderBy", connectionFieldsMap); + 'OrgLimitDefaultFilter', + 'OrgLimitDefaultOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitDefault", - fieldName: "orgLimitDefault", + operation: 'query', + operationName: 'OrgLimitDefault', + fieldName: 'orgLimitDefault', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitDefaultModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitDefault": data.orgLimitDefaults?.nodes?.[0] ?? null - }) + orgLimitDefault: data.orgLimitDefaults?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitDefault", "createOrgLimitDefault", "orgLimitDefault", args.select, args.data, "CreateOrgLimitDefaultInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitDefault', + 'createOrgLimitDefault', + 'orgLimitDefault', + args.select, + args.data, + 'CreateOrgLimitDefaultInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "createOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'createOrgLimitDefault', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitDefaultPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitDefault", "updateOrgLimitDefault", "orgLimitDefault", args.select, args.where.id, args.data, "UpdateOrgLimitDefaultInput", "id", "orgLimitDefaultPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitDefault', + 'updateOrgLimitDefault', + 'orgLimitDefault', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitDefaultInput', + 'id', + 'orgLimitDefaultPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "updateOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'updateOrgLimitDefault', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitDefault: { orgLimitDefault: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitDefault", "deleteOrgLimitDefault", "orgLimitDefault", { - id: args.where.id - }, "DeleteOrgLimitDefaultInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitDefault', + 'deleteOrgLimitDefault', + 'orgLimitDefault', + { + id: args.where.id, + }, + 'DeleteOrgLimitDefaultInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitDefault", - fieldName: "deleteOrgLimitDefault", + operation: 'mutation', + operationName: 'OrgLimitDefault', + fieldName: 'deleteOrgLimitDefault', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitEvent.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitEvent.ts index 957e209173..419737757d 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitEvent.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitEvent.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitEvent, OrgLimitEventWithRelations, OrgLimitEventSelect, OrgLimitEventFilter, OrgLimitEventOrderBy, CreateOrgLimitEventInput, UpdateOrgLimitEventInput, OrgLimitEventPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitEvent, + OrgLimitEventWithRelations, + OrgLimitEventSelect, + OrgLimitEventFilter, + OrgLimitEventOrderBy, + CreateOrgLimitEventInput, + UpdateOrgLimitEventInput, + OrgLimitEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitEventModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvents: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitEvent", "orgLimitEvents", 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 - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + 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, + }, + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvents", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvents', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitEvent", "orgLimitEvents", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvent", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvent', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitEvent": data.orgLimitEvents?.nodes?.[0] ?? null - }) + orgLimitEvent: data.orgLimitEvents?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitEvent: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitEvent", "orgLimitEvents", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitEvent', + 'orgLimitEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitEventFilter", "OrgLimitEventOrderBy", connectionFieldsMap); + 'OrgLimitEventFilter', + 'OrgLimitEventOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitEvent", - fieldName: "orgLimitEvent", + operation: 'query', + operationName: 'OrgLimitEvent', + fieldName: 'orgLimitEvent', document, variables, transform: (data: { @@ -93,79 +140,111 @@ export class OrgLimitEventModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitEvent": data.orgLimitEvents?.nodes?.[0] ?? null - }) + orgLimitEvent: data.orgLimitEvents?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitEvent", "createOrgLimitEvent", "orgLimitEvent", args.select, args.data, "CreateOrgLimitEventInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitEvent', + 'createOrgLimitEvent', + 'orgLimitEvent', + args.select, + args.data, + 'CreateOrgLimitEventInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "createOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'createOrgLimitEvent', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgLimitEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitEvent", "updateOrgLimitEvent", "orgLimitEvent", args.select, args.where.id, args.data, "UpdateOrgLimitEventInput", "id", "orgLimitEventPatch", connectionFieldsMap, { - createdAt: args.where.createdAt - }); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitEvent', + 'updateOrgLimitEvent', + 'orgLimitEvent', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitEventInput', + 'id', + 'orgLimitEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "updateOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'updateOrgLimitEvent', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - createdAt: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitEvent: { orgLimitEvent: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitEvent", "deleteOrgLimitEvent", "orgLimitEvent", { - id: args.where.id, - createdAt: args.where.createdAt - }, "DeleteOrgLimitEventInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitEvent', + 'deleteOrgLimitEvent', + 'orgLimitEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgLimitEventInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitEvent", - fieldName: "deleteOrgLimitEvent", + operation: 'mutation', + operationName: 'OrgLimitEvent', + fieldName: 'deleteOrgLimitEvent', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitWarning.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitWarning.ts index c87ba9cf50..67d887241a 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitWarning.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitWarning.ts @@ -3,56 +3,96 @@ * @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 { OrgLimitWarning, OrgLimitWarningWithRelations, OrgLimitWarningSelect, OrgLimitWarningFilter, OrgLimitWarningOrderBy, CreateOrgLimitWarningInput, UpdateOrgLimitWarningInput, OrgLimitWarningPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + OrgLimitWarning, + OrgLimitWarningWithRelations, + OrgLimitWarningSelect, + OrgLimitWarningFilter, + OrgLimitWarningOrderBy, + CreateOrgLimitWarningInput, + UpdateOrgLimitWarningInput, + OrgLimitWarningPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class OrgLimitWarningModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarnings: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitWarning", "orgLimitWarnings", 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 - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + 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, + }, + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarnings", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarnings', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("OrgLimitWarning", "orgLimitWarnings", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarning", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarning', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class OrgLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitWarning": data.orgLimitWarnings?.nodes?.[0] ?? null - }) + orgLimitWarning: data.orgLimitWarnings?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: string; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ orgLimitWarning: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("OrgLimitWarning", "orgLimitWarnings", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'OrgLimitWarning', + 'orgLimitWarnings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "OrgLimitWarningFilter", "OrgLimitWarningOrderBy", connectionFieldsMap); + 'OrgLimitWarningFilter', + 'OrgLimitWarningOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "OrgLimitWarning", - fieldName: "orgLimitWarning", + operation: 'query', + operationName: 'OrgLimitWarning', + fieldName: 'orgLimitWarning', document, variables, transform: (data: { @@ -93,74 +140,106 @@ export class OrgLimitWarningModel { nodes?: InferSelectResult[]; }; }) => ({ - "orgLimitWarning": data.orgLimitWarnings?.nodes?.[0] ?? null - }) + orgLimitWarning: data.orgLimitWarnings?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("OrgLimitWarning", "createOrgLimitWarning", "orgLimitWarning", args.select, args.data, "CreateOrgLimitWarningInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'OrgLimitWarning', + 'createOrgLimitWarning', + 'orgLimitWarning', + args.select, + args.data, + 'CreateOrgLimitWarningInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "createOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'createOrgLimitWarning', document, - variables + variables, }); } - update(args: UpdateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + update( + args: UpdateArgs< + S, + { + id: string; + }, + OrgLimitWarningPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ updateOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildUpdateByPkDocument("OrgLimitWarning", "updateOrgLimitWarning", "orgLimitWarning", args.select, args.where.id, args.data, "UpdateOrgLimitWarningInput", "id", "orgLimitWarningPatch", connectionFieldsMap, undefined); + const { document, variables } = buildUpdateByPkDocument( + 'OrgLimitWarning', + 'updateOrgLimitWarning', + 'orgLimitWarning', + args.select, + args.where.id, + args.data, + 'UpdateOrgLimitWarningInput', + 'id', + 'orgLimitWarningPatch', + connectionFieldsMap, + undefined + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "updateOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'updateOrgLimitWarning', document, - variables + variables, }); } - delete(args: DeleteArgs<{ - id: string; - }, S> & { - select: S; - } & StrictSelect): QueryBuilder<{ + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ deleteOrgLimitWarning: { orgLimitWarning: InferSelectResult; }; }> { - const { - document, - variables - } = buildDeleteByPkDocument("OrgLimitWarning", "deleteOrgLimitWarning", "orgLimitWarning", { - id: args.where.id - }, "DeleteOrgLimitWarningInput", args.select, connectionFieldsMap); + const { document, variables } = buildDeleteByPkDocument( + 'OrgLimitWarning', + 'deleteOrgLimitWarning', + 'orgLimitWarning', + { + id: args.where.id, + }, + 'DeleteOrgLimitWarningInput', + args.select, + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "OrgLimitWarning", - fieldName: "deleteOrgLimitWarning", + operation: 'mutation', + operationName: 'OrgLimitWarning', + fieldName: 'deleteOrgLimitWarning', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/mutation/index.ts b/sdk/constructive-sdk/src/usage/orm/mutation/index.ts index 9c8a2c2e94..176d63791b 100644 --- a/sdk/constructive-sdk/src/usage/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/usage/orm/mutation/index.ts @@ -3,11 +3,27 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, SeedAppLimitCapsDefaultsInput, SeedAppLimitDefaultsInput, SeedOrgLimitCapsDefaultsInput, SeedOrgLimitDefaultsInput, ProvisionBucketPayload, SeedAppLimitCapsDefaultsPayload, SeedAppLimitDefaultsPayload, SeedOrgLimitCapsDefaultsPayload, SeedOrgLimitDefaultsPayload, ProvisionBucketPayloadSelect, SeedAppLimitCapsDefaultsPayloadSelect, SeedAppLimitDefaultsPayloadSelect, SeedOrgLimitCapsDefaultsPayloadSelect, SeedOrgLimitDefaultsPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + SeedAppLimitCapsDefaultsInput, + SeedAppLimitDefaultsInput, + SeedOrgLimitCapsDefaultsInput, + SeedOrgLimitDefaultsInput, + ProvisionBucketPayload, + SeedAppLimitCapsDefaultsPayload, + SeedAppLimitDefaultsPayload, + SeedOrgLimitCapsDefaultsPayload, + SeedOrgLimitDefaultsPayload, + ProvisionBucketPayloadSelect, + SeedAppLimitCapsDefaultsPayloadSelect, + SeedAppLimitDefaultsPayloadSelect, + SeedOrgLimitCapsDefaultsPayloadSelect, + SeedOrgLimitDefaultsPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -32,75 +48,150 @@ export interface SeedOrgLimitDefaultsVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }), - seedAppLimitCapsDefaults: (args: SeedAppLimitCapsDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedAppLimitCapsDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedAppLimitCapsDefaults", - fieldName: "seedAppLimitCapsDefaults", - ...buildCustomDocument("mutation", "SeedAppLimitCapsDefaults", "seedAppLimitCapsDefaults", options.select, args, [{ - name: "input", - type: "SeedAppLimitCapsDefaultsInput!" - }], connectionFieldsMap, "SeedAppLimitCapsDefaultsPayload") - }), - seedAppLimitDefaults: (args: SeedAppLimitDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedAppLimitDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedAppLimitDefaults", - fieldName: "seedAppLimitDefaults", - ...buildCustomDocument("mutation", "SeedAppLimitDefaults", "seedAppLimitDefaults", options.select, args, [{ - name: "input", - type: "SeedAppLimitDefaultsInput!" - }], connectionFieldsMap, "SeedAppLimitDefaultsPayload") - }), - seedOrgLimitCapsDefaults: (args: SeedOrgLimitCapsDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedOrgLimitCapsDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedOrgLimitCapsDefaults", - fieldName: "seedOrgLimitCapsDefaults", - ...buildCustomDocument("mutation", "SeedOrgLimitCapsDefaults", "seedOrgLimitCapsDefaults", options.select, args, [{ - name: "input", - type: "SeedOrgLimitCapsDefaultsInput!" - }], connectionFieldsMap, "SeedOrgLimitCapsDefaultsPayload") - }), - seedOrgLimitDefaults: (args: SeedOrgLimitDefaultsVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - seedOrgLimitDefaults: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "SeedOrgLimitDefaults", - fieldName: "seedOrgLimitDefaults", - ...buildCustomDocument("mutation", "SeedOrgLimitDefaults", "seedOrgLimitDefaults", options.select, args, [{ - name: "input", - type: "SeedOrgLimitDefaultsInput!" - }], connectionFieldsMap, "SeedOrgLimitDefaultsPayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + seedAppLimitCapsDefaults: ( + args: SeedAppLimitCapsDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedAppLimitCapsDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedAppLimitCapsDefaults', + fieldName: 'seedAppLimitCapsDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedAppLimitCapsDefaults', + 'seedAppLimitCapsDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedAppLimitCapsDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedAppLimitCapsDefaultsPayload' + ), + }), + seedAppLimitDefaults: ( + args: SeedAppLimitDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedAppLimitDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedAppLimitDefaults', + fieldName: 'seedAppLimitDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedAppLimitDefaults', + 'seedAppLimitDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedAppLimitDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedAppLimitDefaultsPayload' + ), + }), + seedOrgLimitCapsDefaults: ( + args: SeedOrgLimitCapsDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedOrgLimitCapsDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedOrgLimitCapsDefaults', + fieldName: 'seedOrgLimitCapsDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedOrgLimitCapsDefaults', + 'seedOrgLimitCapsDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedOrgLimitCapsDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedOrgLimitCapsDefaultsPayload' + ), + }), + seedOrgLimitDefaults: ( + args: SeedOrgLimitDefaultsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + seedOrgLimitDefaults: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SeedOrgLimitDefaults', + fieldName: 'seedOrgLimitDefaults', + ...buildCustomDocument( + 'mutation', + 'SeedOrgLimitDefaults', + 'seedOrgLimitDefaults', + options.select, + args, + [ + { + name: 'input', + type: 'SeedOrgLimitDefaultsInput!', + }, + ], + connectionFieldsMap, + 'SeedOrgLimitDefaultsPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/constructive-sdk/src/usage/orm/query-builder.ts b/sdk/constructive-sdk/src/usage/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/usage/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/usage/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/constructive-sdk/src/usage/orm/realtime.ts b/sdk/constructive-sdk/src/usage/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/constructive-sdk/src/usage/orm/realtime.ts +++ b/sdk/constructive-sdk/src/usage/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/constructive-sdk/src/usage/orm/select-types.ts b/sdk/constructive-sdk/src/usage/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/constructive-sdk/src/usage/orm/select-types.ts +++ b/sdk/constructive-sdk/src/usage/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration diff --git a/sdk/migrate-client/src/migrate/index.ts b/sdk/migrate-client/src/migrate/index.ts index df69b72f28..654223e7a5 100644 --- a/sdk/migrate-client/src/migrate/index.ts +++ b/sdk/migrate-client/src/migrate/index.ts @@ -2,4 +2,4 @@ * GraphQL SDK - auto-generated, do not edit * @generated by @constructive-io/graphql-codegen */ -export * from "./orm"; \ No newline at end of file +export * from './orm'; diff --git a/sdk/migrate-client/src/migrate/orm/client.ts b/sdk/migrate-client/src/migrate/orm/client.ts index 12819a92f7..16e683c712 100644 --- a/sdk/migrate-client/src/migrate/orm/client.ts +++ b/sdk/migrate-client/src/migrate/orm/client.ts @@ -55,16 +55,13 @@ export class FetchAdapter implements GraphQLAdapter { constructor( private endpoint: string, headers?: Record, - fetchFn?: typeof globalThis.fetch, + fetchFn?: typeof globalThis.fetch ) { this.headers = headers ?? {}; this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { const response = await this.fetchFn(this.endpoint, { method: 'POST', headers: { @@ -82,9 +79,7 @@ export class FetchAdapter implements GraphQLAdapter { return { ok: false, data: null, - errors: [ - { message: `HTTP ${response.status}: ${response.statusText}` }, - ], + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], }; } @@ -150,7 +145,7 @@ export interface OrmClientConfig { export class GraphQLRequestError extends Error { constructor( public readonly errors: GraphQLError[], - public readonly data: unknown = null, + public readonly data: unknown = null ) { const messages = errors.map((e) => e.message).join('; '); super(`GraphQL Error: ${messages}`); @@ -166,15 +161,9 @@ export class OrmClient { if (config.adapter) { this.adapter = config.adapter; } else if (config.endpoint) { - this.adapter = new FetchAdapter( - config.endpoint, - config.headers, - config.fetch, - ); + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); } else { - throw new Error( - 'OrmClientConfig requires either an endpoint or a custom adapter', - ); + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); } if (config.realtime) { @@ -182,10 +171,7 @@ export class OrmClient { } } - async execute( - document: string, - variables?: Record, - ): Promise> { + async execute(document: string, variables?: Record): Promise> { return this.adapter.execute(document, variables); } @@ -202,19 +188,14 @@ export class OrmClient { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { if (!this.realtimeManager) { throw new Error( - 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.', + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' ); } - return this.realtimeManager.subscribe( - meta, - document, - variables, - options, - ); + return this.realtimeManager.subscribe(meta, document, variables, options); } /** @@ -241,9 +222,7 @@ export class OrmClient { } /** Register a listener for WebSocket connection state changes */ - onConnectionStateChange( - listener: ConnectionStateListener, - ): Unsubscribe { + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { if (!this.realtimeManager) return () => {}; return this.realtimeManager.onConnectionStateChange(listener); } diff --git a/sdk/migrate-client/src/migrate/orm/index.ts b/sdk/migrate-client/src/migrate/orm/index.ts index 916d270bc1..1de525fe85 100644 --- a/sdk/migrate-client/src/migrate/orm/index.ts +++ b/sdk/migrate-client/src/migrate/orm/index.ts @@ -3,17 +3,17 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "./client"; -import type { OrmClientConfig } from "./client"; -import { AstMigrationModel } from "./models/astMigration"; -import { SqlActionModel } from "./models/sqlAction"; -import { createMutationOperations } from "./mutation"; -export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from "./client"; -export { GraphQLRequestError, FetchAdapter } from "./client"; -export { QueryBuilder } from "./query-builder"; -export * from "./select-types"; -export * from "./models"; -export { createMutationOperations } from "./mutation"; +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { AstMigrationModel } from './models/astMigration'; +import { SqlActionModel } from './models/sqlAction'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; /** * Create an ORM client instance * @@ -42,6 +42,6 @@ export function createClient(config: OrmClientConfig) { return { astMigration: new AstMigrationModel(client), sqlAction: new SqlActionModel(client), - mutation: createMutationOperations(client) + mutation: createMutationOperations(client), }; -} \ No newline at end of file +} diff --git a/sdk/migrate-client/src/migrate/orm/input-types.ts b/sdk/migrate-client/src/migrate/orm/input-types.ts index d65d0a6411..fa3df05750 100644 --- a/sdk/migrate-client/src/migrate/orm/input-types.ts +++ b/sdk/migrate-client/src/migrate/orm/input-types.ts @@ -378,8 +378,62 @@ export interface SqlActionFilter { verify?: StringFilter; } // ============ OrderBy Types ============ -export type AstMigrationOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOYS_ASC" | "DEPLOYS_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REQUIRES_ASC" | "REQUIRES_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; -export type SqlActionOrderBy = "ACTION_ID_ASC" | "ACTION_ID_DESC" | "ACTION_NAME_ASC" | "ACTION_NAME_DESC" | "ACTOR_ID_ASC" | "ACTOR_ID_DESC" | "CONTENT_ASC" | "CONTENT_DESC" | "CREATED_AT_ASC" | "CREATED_AT_DESC" | "DATABASE_ID_ASC" | "DATABASE_ID_DESC" | "DEPLOY_ASC" | "DEPLOY_DESC" | "DEPS_ASC" | "DEPS_DESC" | "ID_ASC" | "ID_DESC" | "NAME_ASC" | "NAME_DESC" | "NATURAL" | "PAYLOAD_ASC" | "PAYLOAD_DESC" | "REVERT_ASC" | "REVERT_DESC" | "VERIFY_ASC" | "VERIFY_DESC"; +export type AstMigrationOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOYS_ASC' + | 'DEPLOYS_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REQUIRES_ASC' + | 'REQUIRES_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; +export type SqlActionOrderBy = + | 'ACTION_ID_ASC' + | 'ACTION_ID_DESC' + | 'ACTION_NAME_ASC' + | 'ACTION_NAME_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'CONTENT_ASC' + | 'CONTENT_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'DEPLOY_ASC' + | 'DEPLOY_DESC' + | 'DEPS_ASC' + | 'DEPS_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'NATURAL' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'REVERT_ASC' + | 'REVERT_DESC' + | 'VERIFY_ASC' + | 'VERIFY_DESC'; // ============ CRUD Input Types ============ export interface CreateAstMigrationInput { clientMutationId?: string; @@ -491,4 +545,4 @@ export type ProvisionBucketPayloadSelect = { error?: boolean; provider?: boolean; success?: boolean; -}; \ No newline at end of file +}; diff --git a/sdk/migrate-client/src/migrate/orm/models/astMigration.ts b/sdk/migrate-client/src/migrate/orm/models/astMigration.ts index b6f4db557f..bfcc5f455a 100644 --- a/sdk/migrate-client/src/migrate/orm/models/astMigration.ts +++ b/sdk/migrate-client/src/migrate/orm/models/astMigration.ts @@ -3,56 +3,96 @@ * @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 { AstMigration, AstMigrationWithRelations, AstMigrationSelect, AstMigrationFilter, AstMigrationOrderBy, CreateAstMigrationInput, UpdateAstMigrationInput, AstMigrationPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + AstMigration, + AstMigrationWithRelations, + AstMigrationSelect, + AstMigrationFilter, + AstMigrationOrderBy, + CreateAstMigrationInput, + UpdateAstMigrationInput, + AstMigrationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class AstMigrationModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigrations: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("AstMigration", "astMigrations", 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 - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'AstMigration', + 'astMigrations', + 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, + }, + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigrations", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigrations', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigration: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("AstMigration", "astMigrations", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'AstMigration', + 'astMigrations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigration", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigration', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class AstMigrationModel { nodes?: InferSelectResult[]; }; }) => ({ - "astMigration": data.astMigrations?.nodes?.[0] ?? null - }) + astMigration: data.astMigrations?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ astMigration: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("AstMigration", "astMigrations", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'AstMigration', + 'astMigrations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "AstMigrationFilter", "AstMigrationOrderBy", connectionFieldsMap); + 'AstMigrationFilter', + 'AstMigrationOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "AstMigration", - fieldName: "astMigration", + operation: 'query', + operationName: 'AstMigration', + fieldName: 'astMigration', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class AstMigrationModel { nodes?: InferSelectResult[]; }; }) => ({ - "astMigration": data.astMigrations?.nodes?.[0] ?? null - }) + astMigration: data.astMigrations?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createAstMigration: { astMigration: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("AstMigration", "createAstMigration", "astMigration", args.select, args.data, "CreateAstMigrationInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'AstMigration', + 'createAstMigration', + 'astMigration', + args.select, + args.data, + 'CreateAstMigrationInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "AstMigration", - fieldName: "createAstMigration", + operation: 'mutation', + operationName: 'AstMigration', + fieldName: 'createAstMigration', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/migrate-client/src/migrate/orm/models/index.ts b/sdk/migrate-client/src/migrate/orm/models/index.ts index f77b376cd6..1afc71d657 100644 --- a/sdk/migrate-client/src/migrate/orm/models/index.ts +++ b/sdk/migrate-client/src/migrate/orm/models/index.ts @@ -3,5 +3,5 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -export { AstMigrationModel } from "./astMigration"; -export { SqlActionModel } from "./sqlAction"; \ No newline at end of file +export { AstMigrationModel } from './astMigration'; +export { SqlActionModel } from './sqlAction'; diff --git a/sdk/migrate-client/src/migrate/orm/models/sqlAction.ts b/sdk/migrate-client/src/migrate/orm/models/sqlAction.ts index 8099171baf..74b4418688 100644 --- a/sdk/migrate-client/src/migrate/orm/models/sqlAction.ts +++ b/sdk/migrate-client/src/migrate/orm/models/sqlAction.ts @@ -3,56 +3,96 @@ * @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 { SqlAction, SqlActionWithRelations, SqlActionSelect, SqlActionFilter, SqlActionOrderBy, CreateSqlActionInput, UpdateSqlActionInput, SqlActionPatch } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +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 { + SqlAction, + SqlActionWithRelations, + SqlActionSelect, + SqlActionFilter, + SqlActionOrderBy, + CreateSqlActionInput, + UpdateSqlActionInput, + SqlActionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; export class SqlActionModel { constructor(private client: OrmClient) {} - findMany(args: FindManyArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlActions: ConnectionResult>; }> { - const { - document, - variables - } = buildFindManyDocument("SqlAction", "sqlActions", 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 - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindManyDocument( + 'SqlAction', + 'sqlActions', + 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, + }, + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlActions", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlActions', document, - variables + variables, }); } - findFirst(args: FindFirstArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlAction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindFirstDocument("SqlAction", "sqlActions", args.select, { - where: args?.where, - orderBy: args?.orderBy as string[] | undefined - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + const { document, variables } = buildFindFirstDocument( + 'SqlAction', + 'sqlActions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlAction", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlAction', document, variables, transform: (data: { @@ -60,32 +100,39 @@ export class SqlActionModel { nodes?: InferSelectResult[]; }; }) => ({ - "sqlAction": data.sqlActions?.nodes?.[0] ?? null - }) + sqlAction: data.sqlActions?.nodes?.[0] ?? null, + }), }); } - findOne(args: { - id: number; - select: S; - } & StrictSelect): QueryBuilder<{ + findOne( + args: { + id: number; + select: S; + } & StrictSelect + ): QueryBuilder<{ sqlAction: InferSelectResult | null; }> { - const { - document, - variables - } = buildFindManyDocument("SqlAction", "sqlActions", args.select, { - where: { - id: { - equalTo: args.id - } + const { document, variables } = buildFindManyDocument( + 'SqlAction', + 'sqlActions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, }, - first: 1 - }, "SqlActionFilter", "SqlActionOrderBy", connectionFieldsMap); + 'SqlActionFilter', + 'SqlActionOrderBy', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "query", - operationName: "SqlAction", - fieldName: "sqlAction", + operation: 'query', + operationName: 'SqlAction', + fieldName: 'sqlAction', document, variables, transform: (data: { @@ -93,28 +140,35 @@ export class SqlActionModel { nodes?: InferSelectResult[]; }; }) => ({ - "sqlAction": data.sqlActions?.nodes?.[0] ?? null - }) + sqlAction: data.sqlActions?.nodes?.[0] ?? null, + }), }); } - create(args: CreateArgs & { - select: S; - } & StrictSelect): QueryBuilder<{ + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ createSqlAction: { sqlAction: InferSelectResult; }; }> { - const { - document, - variables - } = buildCreateDocument("SqlAction", "createSqlAction", "sqlAction", args.select, args.data, "CreateSqlActionInput", connectionFieldsMap); + const { document, variables } = buildCreateDocument( + 'SqlAction', + 'createSqlAction', + 'sqlAction', + args.select, + args.data, + 'CreateSqlActionInput', + connectionFieldsMap + ); return new QueryBuilder({ client: this.client, - operation: "mutation", - operationName: "SqlAction", - fieldName: "createSqlAction", + operation: 'mutation', + operationName: 'SqlAction', + fieldName: 'createSqlAction', document, - variables + variables, }); } -} \ No newline at end of file +} diff --git a/sdk/migrate-client/src/migrate/orm/mutation/index.ts b/sdk/migrate-client/src/migrate/orm/mutation/index.ts index 1e981b094d..989afbcbd6 100644 --- a/sdk/migrate-client/src/migrate/orm/mutation/index.ts +++ b/sdk/migrate-client/src/migrate/orm/mutation/index.ts @@ -3,11 +3,15 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import { OrmClient } from "../client"; -import { QueryBuilder, buildCustomDocument } from "../query-builder"; -import type { InferSelectResult, StrictSelect } from "../select-types"; -import type { ProvisionBucketInput, ProvisionBucketPayload, ProvisionBucketPayloadSelect } from "../input-types"; -import { connectionFieldsMap } from "../input-types"; +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ProvisionBucketInput, + ProvisionBucketPayload, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; /** * Variables for provisionBucket * Provision an S3 bucket for a logical bucket in the database. @@ -20,19 +24,34 @@ export interface ProvisionBucketVariables { } export function createMutationOperations(client: OrmClient) { return { - provisionBucket: (args: ProvisionBucketVariables, options: { - select: S; - } & StrictSelect) => new QueryBuilder<{ - provisionBucket: InferSelectResult | null; - }>({ - client, - operation: "mutation", - operationName: "ProvisionBucket", - fieldName: "provisionBucket", - ...buildCustomDocument("mutation", "ProvisionBucket", "provisionBucket", options.select, args, [{ - name: "input", - type: "ProvisionBucketInput!" - }], connectionFieldsMap, "ProvisionBucketPayload") - }) + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), }; -} \ No newline at end of file +} diff --git a/sdk/migrate-client/src/migrate/orm/query-builder.ts b/sdk/migrate-client/src/migrate/orm/query-builder.ts index d0dab0d2d7..fd785bbae6 100644 --- a/sdk/migrate-client/src/migrate/orm/query-builder.ts +++ b/sdk/migrate-client/src/migrate/orm/query-builder.ts @@ -5,12 +5,7 @@ */ import { parseType, print } from '@constructive-io/graphql-query/runtime'; import * as t from 'gql-ast'; -import type { - ArgumentNode, - EnumValueNode, - FieldNode, - VariableDefinitionNode, -} from 'graphql'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; import { GraphQLRequestError, OrmClient, QueryResult } from './client'; @@ -38,7 +33,7 @@ export class QueryBuilder { async execute(): Promise> { const rawResult = await this.config.client.execute( this.config.document, - this.config.variables, + this.config.variables ); if (!rawResult.ok) { return rawResult; @@ -80,7 +75,7 @@ export class QueryBuilder { * Execute and unwrap, calling onError callback on failure */ async unwrapOrElse( - onError: (errors: import('./client').GraphQLError[]) => D, + onError: (errors: import('./client').GraphQLError[]) => D ): Promise { const result = await this.execute(); if (!result.ok) { @@ -109,16 +104,14 @@ const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; export function buildSelections( select: Record | undefined, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): FieldNode[] { if (!select) { return []; } const fields: FieldNode[] = []; - const entityConnections = entityType - ? connectionFieldsMap?.[entityType] - : undefined; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; for (const [key, value] of Object.entries(select)) { if (value === false || value === undefined) { @@ -142,9 +135,8 @@ export function buildSelections( // Field with arguments (e.g. requestUploadUrl on bucket types) if (nested.args && typeof nested.args === 'object') { - const fieldArgs = Object.entries(nested.args).map( - ([argName, argValue]) => - t.argument({ name: argName, value: buildValueAst(argValue) }), + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) ); const nestedSelect = nested.select; if (nestedSelect && typeof nestedSelect === 'object') { @@ -158,14 +150,14 @@ export function buildSelections( selectionSet: subSelections.length ? t.selectionSet({ selections: subSelections }) : undefined, - }), + }) ); } else { fields.push( t.field({ name: key, args: fieldArgs.length ? fieldArgs : undefined, - }), + }) ); } continue; @@ -173,7 +165,7 @@ export function buildSelections( if (!nested.select || typeof nested.select !== 'object') { throw new Error( - `Invalid selection for field "${key}": nested selections must include a "select" object.`, + `Invalid selection for field "${key}": nested selections must include a "select" object.` ); } @@ -181,7 +173,7 @@ export function buildSelections( const nestedSelections = buildSelections( nested.select, connectionFieldsMap, - relatedEntityType, + relatedEntityType ); const isConnection = nested.connection === true || @@ -207,7 +199,7 @@ export function buildSelections( selectionSet: t.selectionSet({ selections: buildConnectionSelections(nestedSelections), }), - }), + }) ); } else { fields.push( @@ -215,7 +207,7 @@ export function buildSelections( name: key, args, selectionSet: t.selectionSet({ selections: nestedSelections }), - }), + }) ); } } @@ -243,14 +235,10 @@ export function buildFindManyDocument( }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -265,7 +253,7 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -275,37 +263,37 @@ export function buildFindManyDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -313,9 +301,7 @@ export function buildFindManyDocument( t.operationDefinition({ operation: OP_QUERY, name: operationName + 'Query', - variableDefinitions: variableDefinitions.length - ? variableDefinitions - : undefined, + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, selectionSet: t.selectionSet({ selections: [ t.field({ @@ -341,14 +327,10 @@ export function buildFindFirstDocument( args: { where?: TWhere; orderBy?: string[] }, filterTypeName: string, orderByTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = []; @@ -360,7 +342,7 @@ export function buildFindFirstDocument( { varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -370,7 +352,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); addVariable( { @@ -380,7 +362,7 @@ export function buildFindFirstDocument( }, variableDefinitions, queryArgs, - variables, + variables ); const document = t.document({ @@ -419,14 +401,10 @@ export function buildCreateDocument( select: TSelect, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -449,11 +427,7 @@ export function buildCreateDocument( }; } -export function buildUpdateDocument< - TSelect, - TWhere extends { id: string }, - TData, ->( +export function buildUpdateDocument( operationName: string, mutationField: string, entityField: string, @@ -462,14 +436,10 @@ export function buildUpdateDocument< data: TData, inputTypeName: string, patchFieldName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -504,14 +474,10 @@ export function buildUpdateByPkDocument( idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>, - extraKeys?: Record, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -543,14 +509,10 @@ export function buildFindOneDocument( select: TSelect, idArgName: string, idTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; const variableDefinitions: VariableDefinitionNode[] = [ @@ -592,24 +554,17 @@ export function buildFindOneDocument( }; } -export function buildDeleteDocument< - TWhere extends { id: string }, - TSelect = undefined, ->( +export function buildDeleteDocument( operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -641,14 +596,10 @@ export function buildDeleteByPkDocument( keys: Record, inputTypeName: string, select?: TSelect, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const entitySelections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -673,7 +624,7 @@ export function buildJunctionRemoveDocument( operationName: string, mutationField: string, keys: Record, - inputTypeName: string, + inputTypeName: string ): { document: string; variables: Record } { return { document: buildInputMutationDocument({ @@ -696,7 +647,7 @@ export function buildCustomDocument( args: TArgs, variableDefinitions: Array<{ name: string; type: string }>, connectionFieldsMap?: Record>, - entityType?: string, + entityType?: string ): { document: string; variables: Record } { let actualSelect: TSelect = select; let isConnection = false; @@ -707,29 +658,23 @@ export function buildCustomDocument( } const selections = actualSelect - ? buildSelections( - actualSelect as Record, - connectionFieldsMap, - entityType, - ) + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) : []; const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ variable: t.variable({ name: definition.name }), type: parseType(definition.type), - }), + }) ); const fieldArgs = variableDefinitions.map((definition) => t.argument({ name: definition.name, value: t.variable({ name: definition.name }), - }), + }) ); - const fieldSelections = isConnection - ? buildConnectionSelections(selections) - : selections; + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; const document = t.document({ definitions: [ @@ -759,7 +704,7 @@ export function buildCustomDocument( } function isCustomSelectionWrapper( - value: unknown, + value: unknown ): value is { select: Record; connection?: boolean } { if (!value || typeof value !== 'object' || Array.isArray(value)) { return false; @@ -776,11 +721,7 @@ function isCustomSelectionWrapper( return false; } - return ( - !!record.select && - typeof record.select === 'object' && - !Array.isArray(record.select) - ); + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); } // ============================================================================ @@ -791,24 +732,16 @@ function buildArgs(args: Array): ArgumentNode[] { return args.filter((arg): arg is ArgumentNode => arg !== null); } -function buildOptionalArg( - name: string, - value: number | string | undefined, -): ArgumentNode | null { +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { if (value === undefined) { return null; } const valueNode = - typeof value === 'number' - ? t.intValue({ value: value.toString() }) - : t.stringValue({ value }); + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); return t.argument({ name, value: valueNode }); } -function buildEnumListArg( - name: string, - values: string[] | undefined, -): ArgumentNode | null { +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { if (!values || values.length === 0) { return null; } @@ -902,7 +835,7 @@ function addVariable( spec: VariableSpec, definitions: VariableDefinitionNode[], args: ArgumentNode[], - variables: Record, + variables: Record ): void { if (spec.value === undefined || !spec.typeName) return; @@ -910,19 +843,19 @@ function addVariable( t.variableDefinition({ variable: t.variable({ name: spec.varName }), type: parseType(spec.typeName), - }), + }) ); args.push( t.argument({ name: spec.argName ?? spec.varName, value: t.variable({ name: spec.varName }), - }), + }) ); variables[spec.varName] = spec.value; } function buildValueAst( - value: unknown, + value: unknown ): | ReturnType | ReturnType @@ -963,7 +896,7 @@ function buildValueAst( t.objectField({ name: key, value: buildValueAst(val), - }), + }) ), }); } @@ -982,14 +915,10 @@ export function buildBulkInsertDocument( data: TData[], inputTypeName: string, onConflict?: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1021,14 +950,10 @@ export function buildBulkUpsertDocument( data: TData[], inputTypeName: string, onConflict: unknown, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1060,14 +985,10 @@ export function buildBulkUpdateDocument( where: TWhere, data: TData, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { @@ -1098,14 +1019,10 @@ export function buildBulkDeleteDocument( select: TSelect, where: TWhere, inputTypeName: string, - connectionFieldsMap?: Record>, + connectionFieldsMap?: Record> ): { document: string; variables: Record } { const selections = select - ? buildSelections( - select as Record, - connectionFieldsMap, - operationName, - ) + ? buildSelections(select as Record, connectionFieldsMap, operationName) : [t.field({ name: 'id' })]; return { diff --git a/sdk/migrate-client/src/migrate/orm/realtime.ts b/sdk/migrate-client/src/migrate/orm/realtime.ts index 2af9d8db17..214eb56203 100644 --- a/sdk/migrate-client/src/migrate/orm/realtime.ts +++ b/sdk/migrate-client/src/migrate/orm/realtime.ts @@ -31,7 +31,7 @@ interface WsSink { export interface WsClient { subscribe>( payload: { query: string; variables?: Record }, - sink: WsSink>, + sink: WsSink> ): () => void; dispose(): void; } @@ -44,11 +44,7 @@ export interface WsClient { export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; /** Connection state of the WebSocket */ -export type ConnectionState = - | 'disconnected' - | 'connecting' - | 'connected' - | 'reconnecting'; +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; /** Listener for connection state changes */ export type ConnectionStateListener = (state: ConnectionState) => void; @@ -78,10 +74,7 @@ export interface SubscriptionEvent { * @typeParam T - The row type of the subscribed table * @typeParam TFilter - The filter type for the table */ -export interface SubscribeOptions< - T, - TFilter = Record, -> { +export interface SubscribeOptions> { /** Server-side filter to limit which events are delivered */ filter?: TFilter; /** Called when a subscription event is received */ @@ -167,7 +160,7 @@ export class RealtimeManager { onEvent: (event: SubscriptionEvent) => void; onError?: (error: Error) => void; onComplete?: () => void; - }, + } ): Unsubscribe { this.activeSubscriptions++; let disposed = false; @@ -178,11 +171,7 @@ export class RealtimeManager { next: (result) => { if (disposed) return; if (result.errors) { - options.onError?.( - new Error( - result.errors.map((e) => e.message).join('; '), - ), - ); + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); return; } @@ -193,28 +182,22 @@ export class RealtimeManager { if (!payload) return; const event: SubscriptionEvent = { - operation: - (payload.event as SubscriptionOperation) ?? 'UPDATE', + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', data: (payload[meta.dataFieldName] as T) ?? null, - previousValues: payload.previousValues as - | Partial - | undefined, - timestamp: - (payload.timestamp as string) ?? new Date().toISOString(), + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), }; options.onEvent(event); }, error: (err) => { if (disposed) return; - options.onError?.( - err instanceof Error ? err : new Error(String(err)), - ); + options.onError?.(err instanceof Error ? err : new Error(String(err))); }, complete: () => { if (disposed) return; options.onComplete?.(); }, - }, + } ); return () => { diff --git a/sdk/migrate-client/src/migrate/orm/select-types.ts b/sdk/migrate-client/src/migrate/orm/select-types.ts index ac94d8e0f6..4b39d7e820 100644 --- a/sdk/migrate-client/src/migrate/orm/select-types.ts +++ b/sdk/migrate-client/src/migrate/orm/select-types.ts @@ -44,11 +44,7 @@ export interface UpdateArgs { select?: TSelect; } -export type FindOneArgs< - TSelect, - TIdName extends string = 'id', - TId = string, -> = { +export type FindOneArgs = { select?: TSelect; } & Record; @@ -106,11 +102,7 @@ type DecrementDepth = { * NOTE: Depth is intentionally capped to avoid circular-instantiation issues * in very large cyclic schemas. */ -export type DeepExact< - T, - Shape, - Depth extends DepthLevel = 10, -> = Depth extends 0 +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never @@ -124,11 +116,7 @@ export type DeepExact< } ? DeepExact< Omit & { - select: DeepExact< - NS, - NonNullable, - DecrementDepth[Depth] - >; + select: DeepExact, DecrementDepth[Depth]>; }, Extract, DecrementDepth[Depth] @@ -153,9 +141,7 @@ export type StrictSelect = S extends DeepExact ? {} : never; * Uses a shallower recursion depth to keep editor autocomplete responsive * in large schemas while still validating common nested-select mistakes. */ -export type HookStrictSelect = S extends DeepExact - ? {} - : never; +export type HookStrictSelect = S extends DeepExact ? {} : never; /** * Infer result type from select configuration